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 class="main container-fluid">
28 <div class="col-sm-10 col-sm-push-2">
32 [% UNLESS ( add_form ) %]
33 [% IF error_message == 'title_missing' %]
34 <div class="dialog alert">Error: Required news title missing!</div>
37 <div id="toolbar" class="btn-toolbar">
38 <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>
43 [% IF ( op == 'add' ) %][% default_lang = lang | html %]
44 [% ELSE %][% default_lang = new_detail.lang | html %]
46 <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
47 <input type="hidden" name="op" value="[% op | html %]" />
48 <input type="hidden" name="id" value="[% id | html %]" />
49 <fieldset class="rows">
50 <legend>OPAC and Koha news</legend>
52 <label for="lang">Display location:</label>
53 <select id="lang" name="lang">
54 [% IF ( default_lang == "" ) %]
55 <option value="" selected="selected">All</option>
57 <option value="" >All</option>
59 [% IF ( default_lang == "koha" ) %]
60 <option value="koha" selected="selected">Librarian interface</option>
62 <option value="koha" >Librarian interface</option>
64 [% IF ( default_lang == "slip" ) %]
65 <option value="slip" selected="selected">Slip</option>
67 <option value="slip" >Slip</option>
69 [% FOREACH lang_lis IN lang_list %]
70 [% IF ( lang_lis.language == default_lang ) %]
71 <option value="[% lang_lis.language | html %]" selected="selected">OPAC ([% lang_lis.language | html %])</option>
73 <option value="[% lang_lis.language | html %]" >OPAC ([% lang_lis.language | html %])</option>
79 <label for="branch">Library: </label>
80 <select id="branch" name="branch">
81 [% IF ( new_detail.branchcode == '' ) %]
82 <option value="" selected="selected">All libraries</option>
84 <option value="" >All libraries</option>
86 [% PROCESS options_for_libraries libraries => Branches.all( selected => new_detail.branchcode, unfiltered => 1, ) %]
90 <label for="title" class="required">Title: </label>
91 <input id="title" size="30" type="text" name="title" value="[% new_detail.title | html %]" required="required" class="required" /> <span class="required">Required</span>
94 <label for="from">Publication date: </label>
95 <input id="from" type="text" name="timestamp" size="15" value="[% new_detail.timestamp | html %]" class="datepickerfrom" />
96 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
99 <label for="to">Expiration date: </label>
100 <input id="to" type="text" name="expirationdate" size="15" value="[% new_detail.expirationdate | html %]" class="datepickerto" />
101 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
104 <label for="number">Appear in position: </label>
105 [% IF ( new_detail.number ) %]
106 <input id="number" size="3" name="number" type="text" value="[% new_detail.number | html %]" />
108 <input id="number" size="3" name="number" type="text" />
111 <li><label for="content">News: </label>
112 <textarea name="content" id="content" cols="75" rows="10">[% new_detail.content | $raw %]</textarea>
117 <fieldset class="action"><input class="button" type="submit" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/tools/koha-news.pl">Cancel</a></fieldset>
120 <div style="margin-bottom:5px;">
121 <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
122 <label for="lang">Display location:</label>
123 <select name="lang" id="lang">
124 [% IF ( lang == "" ) %]
125 <option value="" selected="selected">All</option>
127 <option value="" >All</option>
129 [% IF ( lang == "koha" ) %]
130 <option value="koha" selected="selected">Librarian interface</option>
132 <option value="koha" >Librarian interface</option>
134 [% IF ( lang == "slip" ) %]
135 <option value="slip" selected="selected">Slip</option>
137 <option value="slip" >Slip</option>
139 [% FOREACH lang_lis IN lang_list %]
140 [% IF ( lang_lis.language == lang ) %]
141 <option value="[% lang_lis.language | html %]" selected="selected">OPAC ([% lang_lis.language | html %])</option>
143 <option value="[% lang_lis.language | html %]" >OPAC ([% lang_lis.language | html %])</option>
147 <label for="branch">Library: </label>
148 <select id="branch" name="branch">
149 [% IF ( branchcode == "" ) %]
150 <option value="" selected="selected">All libraries</option>
152 <option value="" >All libraries</option>
154 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
156 <input type="submit" class="button" value="Filter" />
159 [% IF ( opac_news_count ) %]
160 <form id="del_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl">
167 <th class="title-string">Publication date</th>
168 <th class="title-string">Expiration date</th>
174 <tbody>[% FOREACH opac_new IN opac_news %]
175 [% IF ( opac_new.expired ) %]
181 <input type="checkbox" name="ids" value="[% opac_new.idnew | html %]" />
183 <td>[% SWITCH opac_new.lang %]
191 OPAC ([% opac_new.lang | html %])
194 <td>[% IF ( opac_new.branchcode == "" ) -%]
196 [% ELSE %][% opac_new.branchname | html %]
198 <td>[% opac_new.number | html %]</td>
199 <td><span title="[% opac_new.newdate | html %]">[% opac_new.newdate | $KohaDates %]</span></td>
200 <td><span title="[% opac_new.expirationdate | html %]">[% opac_new.expirationdate | $KohaDates %] [% IF ( opac_new.expired ) %](<span class="expired">expired</span>)[% END %]</span></td>
201 <td>[% opac_new.title | html %]</td>
202 <td>[% opac_new.author_title | html %] [% opac_new.author_firstname | html %] [% opac_new.author_surname | html %]</td>
204 [% opac_new.content | $raw %]
207 <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>
208 <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>
213 <input type="hidden" name="op" value="del" />
214 <fieldset class="action"><input type="submit" class="button" value="Delete selected" /></fieldset>
217 <div class="dialog message">There are no news items.</div>
222 [% UNLESS ( add_form ) %]
223 </div> <!-- /.col-sm-10.col-sm-push-2 -->
225 <div class="col-sm-2 col-sm-pull-10">
227 [% INCLUDE 'tools-menu.inc' %]
229 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
231 </div> <!-- /.row -->
233 [% MACRO jsinclude BLOCK %]
234 [% INCLUDE 'calendar.inc' %]
235 [% Asset.js("js/tools-menu.js") | $raw %]
236 [% IF ( opac_news_count ) %]
237 [% INCLUDE 'datatables.inc' %]
239 $(document).ready(function() {
240 $("#newst").dataTable($.extend(true, {}, dataTablesDefaults, {
242 { "aTargets": [ 0,-1,-2 ], "bSortable": false },
243 { "aTargets": [ 0, -1 ], "bSearchable": false },
244 { 'sType': "title-string", 'aTargets' : [ 'title-string'] }
246 "sPaginationType": "full_numbers"
248 $(".delete_news").on("click", function(){
249 return confirmDelete( _("Are you sure you want to delete this news item? This cannot be undone.") );
253 var form = document.getElementById('del_form');
254 var inputs = form.getElementsByTagName('input');
256 for (var i=0; i<inputs.length; i++) {
257 if (inputs[i].type == 'checkbox' && inputs[i].name == 'ids') {
258 checked = inputs[i].checked;
259 if (checked) return true;
264 $("#del_form").on("submit",function(){
266 return confirmDelete( _("Are you sure you want to delete the selected news?") );
268 alert(_("Please select a news item to delete."));
275 [% Asset.js("lib/tiny_mce/tiny_mce.js") | $raw %]
277 tinyMCE.baseURL = "[% interface | html %]/lib/tiny_mce";
281 convert_urls : false,
282 relative_urls : false,
283 content_css : "[% interface | html %]/[% theme | html %]/css/tinymce.css",
284 plugins : "table,save,advhr,advlink,searchreplace,print,contextmenu",
285 theme_advanced_buttons1 : "save,|,bold,italic,|,cut,copy,paste,|,search,replace,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,link,unlink,anchor,cleanup,help,code,advhr,|,print",
286 theme_advanced_buttons2 : "tablecontrols,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,removeformat,|,visualaid,|,sub,sup,|,charmap",
287 theme_advanced_buttons3 : "",
288 theme_advanced_toolbar_location : "top",
289 theme_advanced_toolbar_align : "left",
290 theme_advanced_path_location : "bottom",
291 theme_advanced_resizing : true,
292 plugin_insertdate_dateFormat : "%Y-%m-%d",
293 plugin_insertdate_timeFormat : "%H:%M:%S",
294 apply_source_formatting : true,
301 [% INCLUDE 'intranet-bottom.inc' %]