4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha › Tools › News</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% IF ( opac_news_count ) %]
8 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
12 <body id="tools_koha-news" class="tools">
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'cat-search.inc' %]
16 <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 ) %]
17 Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div>
20 <div class="main container-fluid">
22 <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
24 <div id="doc3" class="yui-t2">
30 [% UNLESS ( add_form ) %]
31 [% IF error_message == 'title_missing' %]
32 <div class="dialog alert">Error: Required news title missing!</div>
34 <div id="toolbar" class="btn-toolbar">
35 <a class="btn btn-default btn-sm" id="newentry" href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&lang=[% lang %]"><i class="fa fa-plus"></i> New entry</a>
40 [% IF ( op == 'add' ) %][% default_lang = lang %]
41 [% ELSE %][% default_lang = new_detail.lang %]
43 <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
44 <input type="hidden" name="op" value="[% op %]" />
45 <input type="hidden" name="id" value="[% id %]" />
46 <fieldset class="rows">
47 <legend>OPAC and Koha news</legend>
49 <label for="lang">Display location:</label>
50 <select id="lang" name="lang">
51 [% IF ( default_lang == "" ) %]
52 <option value="" selected="selected">All</option>
54 <option value="" >All</option>
56 [% IF ( default_lang == "koha" ) %]
57 <option value="koha" selected="selected">Librarian interface</option>
59 <option value="koha" >Librarian interface</option>
61 [% IF ( default_lang == "slip" ) %]
62 <option value="slip" selected="selected">Slip</option>
64 <option value="slip" >Slip</option>
66 [% FOREACH lang_lis IN lang_list %]
67 [% IF ( lang_lis.language == default_lang ) %]
68 <option value="[% lang_lis.language %]" selected="selected">OPAC ([% lang_lis.language %])</option>
70 <option value="[% lang_lis.language %]" >OPAC ([% lang_lis.language %])</option>
76 <label for="branch">Library: </label>
77 <select id="branch" name="branch">
78 [% IF ( new_detail.branchcode == '' ) %]
79 <option value="" selected="selected">All libraries</option>
81 <option value="" >All libraries</option>
83 [% PROCESS options_for_libraries libraries => Branches.all( selected => new_detail.branchcode, unfiltered => 1, ) %]
87 <label for="title" class="required">Title: </label>
88 <input id="title" size="30" type="text" name="title" value="[% new_detail.title %]" required="required" class="required" /> <span class="required">Required</span>
91 <label for="from">Publication date: </label>
92 <input id="from" type="text" name="timestamp" size="15" value="[% new_detail.timestamp %]" class="datepickerfrom" />
93 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
96 <label for="to">Expiration date: </label>
97 <input id="to" type="text" name="expirationdate" size="15" value="[% new_detail.expirationdate %]" class="datepickerto" />
98 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
101 <label for="number">Appear in position: </label>
102 [% IF ( new_detail.number ) %]
103 <input id="number" size="3" name="number" type="text" value="[% new_detail.number %]" />
105 <input id="number" size="3" name="number" type="text" />
108 <li><label for="content">News: </label>
109 <textarea name="content" id="content" cols="75" rows="10">[% new_detail.content %]</textarea>
114 <fieldset class="action"><input class="button" type="submit" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/tools/koha-news.pl">Cancel</a></fieldset>
117 <div style="margin-bottom:5px;">
118 <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
119 <label for="lang">Display location:</label>
120 <select name="lang" id="lang">
121 [% IF ( lang == "" ) %]
122 <option value="" selected="selected">All</option>
124 <option value="" >All</option>
126 [% IF ( lang == "koha" ) %]
127 <option value="koha" selected="selected">Librarian interface</option>
129 <option value="koha" >Librarian interface</option>
131 [% IF ( lang == "slip" ) %]
132 <option value="slip" selected="selected">Slip</option>
134 <option value="slip" >Slip</option>
136 [% FOREACH lang_lis IN lang_list %]
137 [% IF ( lang_lis.language == lang ) %]
138 <option value="[% lang_lis.language %]" selected="selected">OPAC ([% lang_lis.language %])</option>
140 <option value="[% lang_lis.language %]" >OPAC ([% lang_lis.language %])</option>
144 <label for="branch">Library: </label>
145 <select id="branch" name="branch">
146 [% IF ( branchcode == "" ) %]
147 <option value="" selected="selected">All libraries</option>
149 <option value="" >All libraries</option>
151 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
153 <input type="submit" class="button" value="Filter" />
156 [% IF ( opac_news_count ) %]
157 <form id="del_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl">
164 <th class="title-string">Publication date</th>
165 <th class="title-string">Expiration date</th>
171 <tbody>[% FOREACH opac_new IN opac_news %]
172 [% IF ( opac_new.expired ) %]
178 <input type="checkbox" name="ids" value="[% opac_new.idnew %]" />
180 <td>[% SWITCH opac_new.lang %]
188 OPAC ([% opac_new.lang %])
191 <td>[% IF ( opac_new.branchcode == "" ) -%]
193 [% ELSE %][% opac_new.branchname %]
195 <td>[% opac_new.number %]</td>
196 <td><span title="[% opac_new.newdate %]">[% opac_new.newdate | $KohaDates %]</span></td>
197 <td><span title="[% opac_new.expirationdate %]">[% opac_new.expirationdate | $KohaDates %] [% IF ( opac_new.expired ) %](<span class="expired">expired</span>)[% END %]</span></td>
198 <td>[% opac_new.title %]</td>
199 <td>[% opac_new.author_title %] [% opac_new.author_firstname %] [% opac_new.author_surname %]</td>
201 [% opac_new.content %]
204 <a href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&id=[% opac_new.idnew %]" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
205 <a href="/cgi-bin/koha/tools/koha-news.pl?op=del&ids=[% opac_new.idnew %]" class="delete_news btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</a>
210 <input type="hidden" name="op" value="del" />
211 <fieldset class="action"><input type="submit" class="button" value="Delete selected" /></fieldset>
214 <div class="dialog message">There are no news items.</div>
219 [% UNLESS ( add_form ) %]
220 <div class="yui-b noprint">
221 [% INCLUDE 'tools-menu.inc' %]
226 [% MACRO jsinclude BLOCK %]
227 [% INCLUDE 'calendar.inc' %]
228 <script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu_[% KOHA_VERSION %].js"></script>
229 [% IF ( opac_news_count ) %]
230 [% INCLUDE 'datatables.inc' %]
231 <script type="text/javascript">
232 $(document).ready(function() {
233 $("#newst").dataTable($.extend(true, {}, dataTablesDefaults, {
235 { "aTargets": [ 0,-1,-2 ], "bSortable": false },
236 { "aTargets": [ 0, -1 ], "bSearchable": false },
237 { 'sType': "title-string", 'aTargets' : [ 'title-string'] }
239 "sPaginationType": "full_numbers"
241 $(".delete_news").on("click", function(){
242 return confirmDelete( _("Are you sure you want to delete this news item? This cannot be undone.") );
246 var form = document.getElementById('del_form');
247 var inputs = form.getElementsByTagName('input');
249 for (var i=0; i<inputs.length; i++) {
250 if (inputs[i].type == 'checkbox' && inputs[i].name == 'ids') {
251 checked = inputs[i].checked;
252 if (checked) return true;
257 $("#del_form").on("submit",function(){
259 return confirmDelete( _("Are you sure you want to delete the selected news?") );
261 alert(_("Please select a news item to delete."));
268 <script type="text/javascript" src="[% interface %]/lib/tiny_mce/tiny_mce_[% KOHA_VERSION %].js"></script>
269 <script type="text/javascript">
270 tinyMCE.baseURL = "[% interface %]/lib/tiny_mce";
274 convert_urls : false,
275 relative_urls : false,
276 content_css : "[% interface %]/[% theme %]/css/tinymce.css",
277 plugins : "table,save,advhr,advlink,searchreplace,print,contextmenu",
278 theme_advanced_buttons1 : "save,|,bold,italic,|,cut,copy,paste,|,search,replace,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,link,unlink,anchor,cleanup,help,code,advhr,|,print",
279 theme_advanced_buttons2 : "tablecontrols,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,removeformat,|,visualaid,|,sub,sup,|,charmap",
280 theme_advanced_buttons3 : "",
281 theme_advanced_toolbar_location : "top",
282 theme_advanced_toolbar_align : "left",
283 theme_advanced_path_location : "bottom",
284 theme_advanced_resizing : true,
285 plugin_insertdate_dateFormat : "%Y-%m-%d",
286 plugin_insertdate_timeFormat : "%H:%M:%S",
287 apply_source_formatting : true,
294 [% INCLUDE 'intranet-bottom.inc' %]