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 [% PROCESS lang_locations language => default_lang %]
59 <label for="branch">Library: </label>
60 <select id="branch" name="branch">
61 [% IF ( new_detail.branchcode == '' ) %]
62 <option value="" selected="selected">All libraries</option>
64 <option value="" >All libraries</option>
66 [% PROCESS options_for_libraries libraries => Branches.all( selected => new_detail.branchcode, unfiltered => 1, ) %]
70 <label for="title" class="required">Title: </label>
71 <input id="title" size="30" type="text" name="title" value="[% new_detail.title | html %]" required="required" class="required" /> <span class="required">Required</span>
74 <label for="from">Publication date: </label>
75 <input id="from" type="text" name="timestamp" size="15" value="[% new_detail.timestamp | html %]" class="datepickerfrom" />
76 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
79 <label for="to">Expiration date: </label>
80 <input id="to" type="text" name="expirationdate" size="15" value="[% new_detail.expirationdate | html %]" class="datepickerto" />
82 [% INCLUDE 'date-format.inc' %]
83 <br>News will still be accessible by direct URL if expired.
87 <label for="number">Appear in position: </label>
88 [% IF ( new_detail.number ) %]
89 <input id="number" size="3" name="number" type="text" value="[% new_detail.number | html %]" />
91 <input id="number" size="3" name="number" type="text" />
94 <li><label for="content">News: </label>
95 <textarea name="content" id="content" cols="75" rows="10">[% new_detail.content | $raw %]</textarea>
100 <fieldset class="action"><input class="button" type="submit" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/tools/koha-news.pl">Cancel</a></fieldset>
103 <div style="margin-bottom:5px;">
104 <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
105 <label for="lang">Display location:</label>
106 <select name="lang" id="lang">
107 [% PROCESS lang_locations language => lang %]
109 <label for="branch">Library: </label>
110 <select id="branch" name="branch">
111 [% IF ( branchcode == "" ) %]
112 <option value="" selected="selected">All libraries</option>
114 <option value="" >All libraries</option>
116 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
118 <input type="submit" class="button" value="Filter" />
121 [% IF ( opac_news_count ) %]
122 <form id="del_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl">
129 <th class="title-string">Publication date</th>
130 <th class="title-string">Expiration date</th>
136 <tbody>[% FOREACH opac_new IN opac_news %]
137 [% IF ( opac_new.expired ) %]
143 <input type="checkbox" name="ids" value="[% opac_new.idnew | html %]" />
145 <td>[% SWITCH opac_new.lang %]
153 OPAC ([% opac_new.lang | html %])
156 <td>[% IF ( opac_new.branchcode == "" ) -%]
158 [% ELSE %][% opac_new.branchname | html %]
160 <td>[% opac_new.number | html %]</td>
161 <td><span title="[% opac_new.newdate | html %]">[% opac_new.newdate | $KohaDates %]</span></td>
162 <td><span title="[% opac_new.expirationdate | html %]">[% opac_new.expirationdate | $KohaDates %] [% IF ( opac_new.expired ) %](<span class="expired">expired</span>)[% END %]</span></td>
163 <td>[% opac_new.title | html %]</td>
164 <td>[% opac_new.author_title | html %] [% opac_new.author_firstname | html %] [% opac_new.author_surname | html %]</td>
166 [% opac_new.content | $raw %]
169 <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>
170 <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>
175 <input type="hidden" name="op" value="del" />
176 <fieldset class="action"><input type="submit" class="button" value="Delete selected" /></fieldset>
179 <div class="dialog message">There are no news items.</div>
184 [% UNLESS ( add_form ) %]
185 </div> <!-- /.col-sm-10.col-sm-push-2 -->
187 <div class="col-sm-2 col-sm-pull-10">
189 [% INCLUDE 'tools-menu.inc' %]
191 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
193 </div> <!-- /.row -->
195 [% MACRO jsinclude BLOCK %]
196 [% INCLUDE 'calendar.inc' %]
197 [% Asset.js("js/tools-menu.js") | $raw %]
198 [% IF ( opac_news_count ) %]
199 [% INCLUDE 'datatables.inc' %]
201 $(document).ready(function() {
202 $("#newst").dataTable($.extend(true, {}, dataTablesDefaults, {
204 { "aTargets": [ 0,-1,-2 ], "bSortable": false },
205 { "aTargets": [ 0, -1 ], "bSearchable": false },
206 { 'sType': "title-string", 'aTargets' : [ 'title-string'] }
208 "sPaginationType": "full_numbers"
210 $(".delete_news").on("click", function(){
211 return confirmDelete( _("Are you sure you want to delete this news item? This cannot be undone.") );
215 var form = document.getElementById('del_form');
216 var inputs = form.getElementsByTagName('input');
218 for (var i=0; i<inputs.length; i++) {
219 if (inputs[i].type == 'checkbox' && inputs[i].name == 'ids') {
220 checked = inputs[i].checked;
221 if (checked) return true;
226 $("#del_form").on("submit",function(){
228 return confirmDelete( _("Are you sure you want to delete the selected news?") );
230 alert(_("Please select a news item to delete."));
237 [% Asset.js("lib/tiny_mce/tiny_mce.js") | $raw %]
239 tinyMCE.baseURL = "[% interface | html %]/lib/tiny_mce";
243 convert_urls : false,
244 relative_urls : false,
245 content_css : "[% interface | html %]/[% theme | html %]/css/tinymce.css",
246 plugins : "table,save,advhr,advlink,searchreplace,print,contextmenu",
247 theme_advanced_buttons1 : "save,|,bold,italic,|,cut,copy,paste,|,search,replace,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,link,unlink,anchor,cleanup,help,code,advhr,|,print",
248 theme_advanced_buttons2 : "tablecontrols,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,removeformat,|,visualaid,|,sub,sup,|,charmap",
249 theme_advanced_buttons3 : "",
250 theme_advanced_toolbar_location : "top",
251 theme_advanced_toolbar_align : "left",
252 theme_advanced_path_location : "bottom",
253 theme_advanced_resizing : true,
254 plugin_insertdate_dateFormat : "%Y-%m-%d",
255 plugin_insertdate_timeFormat : "%H:%M:%S",
256 apply_source_formatting : true,
263 [% BLOCK lang_locations %]
264 [% IF ( language == "" ) %]
265 <option value="" selected="selected">All</option>
267 <option value="">All</option>
269 [% IF ( language == "koha" ) %]
270 <option value="koha" selected="selected">Librarian interface</option>
272 <option value="koha">Librarian interface</option>
274 [% IF ( language == "slip" ) %]
275 <option value="slip" selected="selected">Slip</option>
277 <option value="slip">Slip</option>
279 [% FOREACH lang_lis IN lang_list %]
280 <optgroup label="[% lang_lis.language | html %]">
281 [% FOREACH location IN [ '', 'OpacNavRight' ] %]
282 [% IF ( location == '' ) %]
283 [% SET location_lang = lang_lis.language %]
284 [% SET location = BLOCK %]OPAC news[% END %]
286 [% SET location_lang = location _ "_" _ lang_lis.language %]
288 [% IF ( location_lang == language ) %]
289 <option value="[% location_lang | html %]" selected="selected">[% location | html %] ([% lang_lis.language | html %])</option>
291 <option value="[% location_lang | html %]">[% location | html %] ([% lang_lis.language | html %])</option>
298 [% INCLUDE 'intranet-bottom.inc' %]