6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Koha › Tools › News</title>
8 [% INCLUDE 'doc-head-close.inc' %]
9 [% IF ( opac_news_count ) %]
13 <body id="tools_koha-news" class="tools">
14 [% INCLUDE 'header.inc' %]
15 [% INCLUDE 'cat-search.inc' %]
17 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › [% IF ( add_form ) %]<a href="/cgi-bin/koha/tools/koha-news.pl">News</a> › [% IF ( id ) %]
18 Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div>
21 <div class="main container-fluid">
23 <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
25 <div class="main container-fluid">
27 <div class="col-sm-10 col-sm-push-2">
31 [% UNLESS ( add_form ) %]
32 [% IF error_message == 'title_missing' %]
33 <div class="dialog alert">Error: Required news title missing!</div>
36 <div id="toolbar" class="btn-toolbar">
37 <a class="btn btn-default" id="newentry" href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&lang=[% lang | html %]"><i class="fa fa-plus"></i> New entry</a>
42 [% IF ( op == 'add' ) %]
43 [% default_lang = lang %]
45 [% default_lang = new_detail.lang %]
47 <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
48 <input type="hidden" name="op" value="[% op | html %]" />
49 <input type="hidden" name="id" value="[% id | html %]" />
50 <fieldset class="rows">
51 <legend>OPAC and Koha news</legend>
53 <label for="lang">Display location:</label>
54 <select id="lang" name="lang">
55 [% IF ( default_lang == "" ) %]
56 <option value="" selected="selected">All</option>
58 <option value="" >All</option>
60 [% IF ( default_lang == "koha" ) %]
61 <option value="koha" selected="selected">Librarian interface</option>
63 <option value="koha" >Librarian interface</option>
65 [% IF ( default_lang == "slip" ) %]
66 <option value="slip" selected="selected">Slip</option>
68 <option value="slip" >Slip</option>
70 [% FOREACH lang_lis IN lang_list %]
71 <optgroup label="[% lang_lis.language | html %]">
72 [% FOREACH location IN [ '', 'OpacNavRight' ] %]
73 [% IF ( location == '' ) %]
74 [% SET location_lang = lang_lis.language %]
75 [% SET location = "OPAC news" %]
77 [% SET location_lang = location _ "_" _ lang_lis.language %]
79 [% IF ( location_lang == default_lang ) %]
80 <option value="[% location_lang | html %]" selected="selected">[% location | html %] ([% lang_lis.language | html %])</option>
82 <option value="[% location_lang | html %]">[% location | html %] ([% lang_lis.language | html %])</option>
90 <label for="branch">Library: </label>
91 <select id="branch" name="branch">
92 [% IF ( new_detail.branchcode == '' ) %]
93 <option value="" selected="selected">All libraries</option>
95 <option value="" >All libraries</option>
97 [% PROCESS options_for_libraries libraries => Branches.all( selected => new_detail.branchcode, unfiltered => 1, ) %]
101 <label for="title" class="required">Title: </label>
102 <input id="title" size="30" type="text" name="title" value="[% new_detail.title | html %]" required="required" class="required" /> <span class="required">Required</span>
105 <label for="from">Publication date: </label>
106 <input id="from" type="text" name="timestamp" size="15" value="[% new_detail.timestamp | html %]" class="datepickerfrom" />
107 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
110 <label for="to">Expiration date: </label>
111 <input id="to" type="text" name="expirationdate" size="15" value="[% new_detail.expirationdate | html %]" class="datepickerto" />
113 [% INCLUDE 'date-format.inc' %]
114 <br>News will still be accessible by direct URL if expired.
118 <label for="number">Appear in position: </label>
119 [% IF ( new_detail.number ) %]
120 <input id="number" size="3" name="number" type="text" value="[% new_detail.number | html %]" />
122 <input id="number" size="3" name="number" type="text" />
125 <li><label for="content">News: </label>
126 <textarea name="content" id="content" cols="75" rows="10">[% new_detail.content | $raw %]</textarea>
131 <fieldset class="action"><input class="button" type="submit" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/tools/koha-news.pl">Cancel</a></fieldset>
134 <div style="margin-bottom:5px;">
135 <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
136 <label for="lang">Display location:</label>
137 <select name="lang" id="lang">
138 [% IF ( lang == "" ) %]
139 <option value="" selected="selected">All</option>
141 <option value="" >All</option>
143 [% IF ( lang == "koha" ) %]
144 <option value="koha" selected="selected">Librarian interface</option>
146 <option value="koha" >Librarian interface</option>
148 [% IF ( lang == "slip" ) %]
149 <option value="slip" selected="selected">Slip</option>
151 <option value="slip" >Slip</option>
153 [% FOREACH lang_lis IN lang_list %]
154 [% IF ( lang_lis.language == lang ) %]
155 <option value="[% lang_lis.language | html %]" selected="selected">OPAC ([% lang_lis.language | html %])</option>
157 <option value="[% lang_lis.language | html %]" >OPAC ([% lang_lis.language | html %])</option>
161 <label for="branch">Library: </label>
162 <select id="branch" name="branch">
163 [% IF ( branchcode == "" ) %]
164 <option value="" selected="selected">All libraries</option>
166 <option value="" >All libraries</option>
168 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
170 <input type="submit" class="button" value="Filter" />
173 [% IF ( opac_news_count ) %]
174 <form id="del_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl">
181 <th class="title-string">Publication date</th>
182 <th class="title-string">Expiration date</th>
188 <tbody>[% FOREACH opac_new IN opac_news %]
189 [% IF ( opac_new.expired ) %]
195 <input type="checkbox" name="ids" value="[% opac_new.idnew | html %]" />
197 <td>[% SWITCH opac_new.lang %]
205 OPAC ([% opac_new.lang | html %])
208 <td>[% IF ( opac_new.branchcode == "" ) -%]
210 [% ELSE %][% opac_new.branchname | html %]
212 <td>[% opac_new.number | html %]</td>
213 <td><span title="[% opac_new.newdate | html %]">[% opac_new.newdate | $KohaDates %]</span></td>
214 <td><span title="[% opac_new.expirationdate | html %]">[% opac_new.expirationdate | $KohaDates %] [% IF ( opac_new.expired ) %](<span class="expired">expired</span>)[% END %]</span></td>
215 <td>[% opac_new.title | html %]</td>
216 <td>[% opac_new.author_title | html %] [% opac_new.author_firstname | html %] [% opac_new.author_surname | html %]</td>
218 [% opac_new.content | $raw %]
221 <a href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&id=[% opac_new.idnew | uri %]" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
222 <a href="/cgi-bin/koha/tools/koha-news.pl?op=del&ids=[% opac_new.idnew | uri %]" class="delete_news btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</a>
227 <input type="hidden" name="op" value="del" />
228 <fieldset class="action"><input type="submit" class="button" value="Delete selected" /></fieldset>
231 <div class="dialog message">There are no news items.</div>
236 [% UNLESS ( add_form ) %]
237 </div> <!-- /.col-sm-10.col-sm-push-2 -->
239 <div class="col-sm-2 col-sm-pull-10">
241 [% INCLUDE 'tools-menu.inc' %]
243 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
245 </div> <!-- /.row -->
247 [% MACRO jsinclude BLOCK %]
248 [% INCLUDE 'calendar.inc' %]
249 [% Asset.js("js/tools-menu.js") | $raw %]
250 [% IF ( opac_news_count ) %]
251 [% INCLUDE 'datatables.inc' %]
253 $(document).ready(function() {
254 $("#newst").dataTable($.extend(true, {}, dataTablesDefaults, {
256 { "aTargets": [ 0,-1,-2 ], "bSortable": false },
257 { "aTargets": [ 0, -1 ], "bSearchable": false },
258 { 'sType': "title-string", 'aTargets' : [ 'title-string'] }
260 "sPaginationType": "full_numbers"
262 $(".delete_news").on("click", function(){
263 return confirmDelete( _("Are you sure you want to delete this news item? This cannot be undone.") );
267 var form = document.getElementById('del_form');
268 var inputs = form.getElementsByTagName('input');
270 for (var i=0; i<inputs.length; i++) {
271 if (inputs[i].type == 'checkbox' && inputs[i].name == 'ids') {
272 checked = inputs[i].checked;
273 if (checked) return true;
278 $("#del_form").on("submit",function(){
280 return confirmDelete( _("Are you sure you want to delete the selected news?") );
282 alert(_("Please select a news item to delete."));
289 [% Asset.js("lib/tiny_mce/tiny_mce.js") | $raw %]
291 tinyMCE.baseURL = "[% interface | html %]/lib/tiny_mce";
295 convert_urls : false,
296 relative_urls : false,
297 content_css : "[% interface | html %]/[% theme | html %]/css/tinymce.css",
298 plugins : "table,save,advhr,advlink,searchreplace,print,contextmenu",
299 theme_advanced_buttons1 : "save,|,bold,italic,|,cut,copy,paste,|,search,replace,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,link,unlink,anchor,cleanup,help,code,advhr,|,print",
300 theme_advanced_buttons2 : "tablecontrols,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,removeformat,|,visualaid,|,sub,sup,|,charmap",
301 theme_advanced_buttons3 : "",
302 theme_advanced_toolbar_location : "top",
303 theme_advanced_toolbar_align : "left",
304 theme_advanced_path_location : "bottom",
305 theme_advanced_resizing : true,
306 plugin_insertdate_dateFormat : "%Y-%m-%d",
307 plugin_insertdate_timeFormat : "%H:%M:%S",
308 apply_source_formatting : true,
315 [% INCLUDE 'intranet-bottom.inc' %]