6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Koha › Tools › News</title>
8 [% INCLUDE 'doc-head-close.inc' %]
9 [% IF ( opac_news_count ) %]
10 [% Asset.css("css/datatables.css") | $raw %]
14 <body id="tools_koha-news" class="tools">
15 [% INCLUDE 'header.inc' %]
16 [% INCLUDE 'cat-search.inc' %]
18 <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 ) %]
19 Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div>
22 <div class="main container-fluid">
24 <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
26 <div id="doc3" class="yui-t2">
32 [% UNLESS ( add_form ) %]
33 [% IF error_message == 'title_missing' %]
34 <div class="dialog alert">Error: Required news title missing!</div>
36 <div id="toolbar" class="btn-toolbar">
37 <a class="btn btn-default btn-sm" 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' ) %][% default_lang = lang | html %]
43 [% ELSE %][% default_lang = new_detail.lang | html %]
45 <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
46 <input type="hidden" name="op" value="[% op | html %]" />
47 <input type="hidden" name="id" value="[% id | html %]" />
48 <fieldset class="rows">
49 <legend>OPAC and Koha news</legend>
51 <label for="lang">Display location:</label>
52 <select id="lang" name="lang">
53 [% IF ( default_lang == "" ) %]
54 <option value="" selected="selected">All</option>
56 <option value="" >All</option>
58 [% IF ( default_lang == "koha" ) %]
59 <option value="koha" selected="selected">Librarian interface</option>
61 <option value="koha" >Librarian interface</option>
63 [% IF ( default_lang == "slip" ) %]
64 <option value="slip" selected="selected">Slip</option>
66 <option value="slip" >Slip</option>
68 [% FOREACH lang_lis IN lang_list %]
69 [% IF ( lang_lis.language == default_lang ) %]
70 <option value="[% lang_lis.language | html %]" selected="selected">OPAC ([% lang_lis.language | html %])</option>
72 <option value="[% lang_lis.language | html %]" >OPAC ([% lang_lis.language | html %])</option>
78 <label for="branch">Library: </label>
79 <select id="branch" name="branch">
80 [% IF ( new_detail.branchcode == '' ) %]
81 <option value="" selected="selected">All libraries</option>
83 <option value="" >All libraries</option>
85 [% PROCESS options_for_libraries libraries => Branches.all( selected => new_detail.branchcode, unfiltered => 1, ) %]
89 <label for="title" class="required">Title: </label>
90 <input id="title" size="30" type="text" name="title" value="[% new_detail.title | html %]" required="required" class="required" /> <span class="required">Required</span>
93 <label for="from">Publication date: </label>
94 <input id="from" type="text" name="timestamp" size="15" value="[% new_detail.timestamp | html %]" class="datepickerfrom" />
95 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
98 <label for="to">Expiration date: </label>
99 <input id="to" type="text" name="expirationdate" size="15" value="[% new_detail.expirationdate | html %]" class="datepickerto" />
100 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
103 <label for="number">Appear in position: </label>
104 [% IF ( new_detail.number ) %]
105 <input id="number" size="3" name="number" type="text" value="[% new_detail.number | html %]" />
107 <input id="number" size="3" name="number" type="text" />
110 <li><label for="content">News: </label>
111 <textarea name="content" id="content" cols="75" rows="10">[% new_detail.content | $raw %]</textarea>
116 <fieldset class="action"><input class="button" type="submit" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/tools/koha-news.pl">Cancel</a></fieldset>
119 <div style="margin-bottom:5px;">
120 <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
121 <label for="lang">Display location:</label>
122 <select name="lang" id="lang">
123 [% IF ( lang == "" ) %]
124 <option value="" selected="selected">All</option>
126 <option value="" >All</option>
128 [% IF ( lang == "koha" ) %]
129 <option value="koha" selected="selected">Librarian interface</option>
131 <option value="koha" >Librarian interface</option>
133 [% IF ( lang == "slip" ) %]
134 <option value="slip" selected="selected">Slip</option>
136 <option value="slip" >Slip</option>
138 [% FOREACH lang_lis IN lang_list %]
139 [% IF ( lang_lis.language == lang ) %]
140 <option value="[% lang_lis.language | html %]" selected="selected">OPAC ([% lang_lis.language | html %])</option>
142 <option value="[% lang_lis.language | html %]" >OPAC ([% lang_lis.language | html %])</option>
146 <label for="branch">Library: </label>
147 <select id="branch" name="branch">
148 [% IF ( branchcode == "" ) %]
149 <option value="" selected="selected">All libraries</option>
151 <option value="" >All libraries</option>
153 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
155 <input type="submit" class="button" value="Filter" />
158 [% IF ( opac_news_count ) %]
159 <form id="del_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl">
166 <th class="title-string">Publication date</th>
167 <th class="title-string">Expiration date</th>
173 <tbody>[% FOREACH opac_new IN opac_news %]
174 [% IF ( opac_new.expired ) %]
180 <input type="checkbox" name="ids" value="[% opac_new.idnew | html %]" />
182 <td>[% SWITCH opac_new.lang %]
190 OPAC ([% opac_new.lang | html %])
193 <td>[% IF ( opac_new.branchcode == "" ) -%]
195 [% ELSE %][% opac_new.branchname | html %]
197 <td>[% opac_new.number | html %]</td>
198 <td><span title="[% opac_new.newdate | html %]">[% opac_new.newdate | $KohaDates %]</span></td>
199 <td><span title="[% opac_new.expirationdate | html %]">[% opac_new.expirationdate | $KohaDates %] [% IF ( opac_new.expired ) %](<span class="expired">expired</span>)[% END %]</span></td>
200 <td>[% opac_new.title | html %]</td>
201 <td>[% opac_new.author_title | html %] [% opac_new.author_firstname | html %] [% opac_new.author_surname | html %]</td>
203 [% opac_new.content | $raw %]
206 <a href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&id=[% opac_new.idnew | html %]" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
207 <a href="/cgi-bin/koha/tools/koha-news.pl?op=del&ids=[% opac_new.idnew | html %]" class="delete_news btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</a>
212 <input type="hidden" name="op" value="del" />
213 <fieldset class="action"><input type="submit" class="button" value="Delete selected" /></fieldset>
216 <div class="dialog message">There are no news items.</div>
221 [% UNLESS ( add_form ) %]
222 <div class="yui-b noprint">
223 [% INCLUDE 'tools-menu.inc' %]
228 [% MACRO jsinclude BLOCK %]
229 [% INCLUDE 'calendar.inc' %]
230 [% Asset.js("js/tools-menu.js") | $raw %]
231 [% IF ( opac_news_count ) %]
232 [% INCLUDE 'datatables.inc' %]
233 <script type="text/javascript">
234 $(document).ready(function() {
235 $("#newst").dataTable($.extend(true, {}, dataTablesDefaults, {
237 { "aTargets": [ 0,-1,-2 ], "bSortable": false },
238 { "aTargets": [ 0, -1 ], "bSearchable": false },
239 { 'sType': "title-string", 'aTargets' : [ 'title-string'] }
241 "sPaginationType": "full_numbers"
243 $(".delete_news").on("click", function(){
244 return confirmDelete( _("Are you sure you want to delete this news item? This cannot be undone.") );
248 var form = document.getElementById('del_form');
249 var inputs = form.getElementsByTagName('input');
251 for (var i=0; i<inputs.length; i++) {
252 if (inputs[i].type == 'checkbox' && inputs[i].name == 'ids') {
253 checked = inputs[i].checked;
254 if (checked) return true;
259 $("#del_form").on("submit",function(){
261 return confirmDelete( _("Are you sure you want to delete the selected news?") );
263 alert(_("Please select a news item to delete."));
270 [% Asset.js("lib/tiny_mce/tiny_mce.js") | $raw %]
271 <script type="text/javascript">
272 tinyMCE.baseURL = "[% interface | html %]/lib/tiny_mce";
276 convert_urls : false,
277 relative_urls : false,
278 content_css : "[% interface | html %]/[% theme | html %]/css/tinymce.css",
279 plugins : "table,save,advhr,advlink,searchreplace,print,contextmenu",
280 theme_advanced_buttons1 : "save,|,bold,italic,|,cut,copy,paste,|,search,replace,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,link,unlink,anchor,cleanup,help,code,advhr,|,print",
281 theme_advanced_buttons2 : "tablecontrols,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,removeformat,|,visualaid,|,sub,sup,|,charmap",
282 theme_advanced_buttons3 : "",
283 theme_advanced_toolbar_location : "top",
284 theme_advanced_toolbar_align : "left",
285 theme_advanced_path_location : "bottom",
286 theme_advanced_resizing : true,
287 plugin_insertdate_dateFormat : "%Y-%m-%d",
288 plugin_insertdate_timeFormat : "%H:%M:%S",
289 apply_source_formatting : true,
296 [% INCLUDE 'intranet-bottom.inc' %]