3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha › Tools › News</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6 [% INCLUDE 'calendar.inc' %]
7 [% IF ( opac_news_count ) %]
8 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
9 [% INCLUDE 'datatables.inc' %]
10 <script type="text/javascript">//<![CDATA[
11 $(document).ready(function() {
12 $("#newst").dataTable($.extend(true, {}, dataTablesDefaults, {
14 { "aTargets": [ 0,-1,-2 ], "bSortable": false },
15 { "aTargets": [ 0, -1 ], "bSearchable": false },
16 { 'sType': "title-string", 'aTargets' : [ 'title-string'] }
18 "sPaginationType": "full_numbers"
20 $(".delete_news").on("click", function(){
21 return confirmDelete( _("Are you sure you want to delete this news item? This cannot be undone.") );
25 var form = document.getElementById('del_form');
26 var inputs = form.getElementsByTagName('input');
28 for (var i=0; i<inputs.length; i++) {
29 if (inputs[i].type == 'checkbox' && inputs[i].name == 'ids') {
30 checked = inputs[i].checked;
31 if (checked) return true;
36 $("#del_form").on("submit",function(){
38 return confirmDelete( _("Are you sure you want to delete the selected news?") );
40 alert(_("Please select a news item to delete."));
48 <script type="text/javascript" src="[% interface %]/lib/tiny_mce/tiny_mce.js"></script>
49 <script type="text/javascript">//<![CDATA[
54 relative_urls : false,
55 content_css : "[% interface %]/[% theme %]/css/tinymce.css",
56 plugins : "table,save,advhr,advlink,searchreplace,print,contextmenu",
57 theme_advanced_buttons1 : "save,|,bold,italic,|,cut,copy,paste,|,search,replace,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,link,unlink,anchor,cleanup,help,code,advhr,|,print",
58 theme_advanced_buttons2 : "tablecontrols,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,removeformat,|,visualaid,|,sub,sup,|,charmap",
59 theme_advanced_buttons3 : "",
60 theme_advanced_toolbar_location : "top",
61 theme_advanced_toolbar_align : "left",
62 theme_advanced_path_location : "bottom",
63 theme_advanced_resizing : true,
64 plugin_insertdate_dateFormat : "%Y-%m-%d",
65 plugin_insertdate_timeFormat : "%H:%M:%S",
66 apply_source_formatting : true,
74 <body id="tools_koha-news" class="tools">
75 [% INCLUDE 'header.inc' %]
76 [% INCLUDE 'cat-search.inc' %]
78 <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 ) %]
79 Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div>
81 [% IF ( add_form ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
86 [% UNLESS ( add_form ) %]
87 [% IF error_message == 'title_missing' %]
88 <div class="dialog alert">Error: Required news title missing!</div>
90 <div id="toolbar" class="btn-toolbar">
91 <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>
96 [% IF ( op == 'add' ) %][% default_lang = lang %]
97 [% ELSE %][% default_lang = new_detail.lang %]
99 <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
100 <input type="hidden" name="op" value="[% op %]" />
101 <input type="hidden" name="id" value="[% id %]" />
102 <fieldset class="rows">
103 <legend>OPAC and Koha news</legend>
105 <label for="lang">Display location:</label>
106 <select id="lang" name="lang">
107 [% IF ( default_lang == "" ) %]
108 <option value="" selected="selected">All</option>
110 <option value="" >All</option>
112 [% IF ( default_lang == "koha" ) %]
113 <option value="koha" selected="selected">Librarian interface</option>
115 <option value="koha" >Librarian interface</option>
117 [% IF ( default_lang == "slip" ) %]
118 <option value="slip" selected="selected">Slip</option>
120 <option value="slip" >Slip</option>
122 [% FOREACH lang_lis IN lang_list %]
123 [% IF ( lang_lis.language == default_lang ) %]
124 <option value="[% lang_lis.language %]" selected="selected">OPAC ([% lang_lis.language %])</option>
126 <option value="[% lang_lis.language %]" >OPAC ([% lang_lis.language %])</option>
132 <label for="branch">Library: </label>
133 <select id="branch" name="branch">
134 [% IF ( new_detail.branchcode == '' ) %]
135 <option value="" selected="selected">All libraries</option>
137 <option value="" >All libraries</option>
139 [% PROCESS options_for_libraries libraries => Branches.all( selected => new_detail.branchcode, unfiltered => 1, ) %]
143 <label for="title" class="required">Title: </label>
144 <input id="title" size="30" type="text" name="title" value="[% new_detail.title %]" required="required" class="required" /> <span class="required">Required</span>
147 <label for="from">Publication date: </label>
148 <input id="from" type="text" name="timestamp" size="15" value="[% new_detail.timestamp %]" class="datepickerfrom" />
149 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
152 <label for="to">Expiration date: </label>
153 <input id="to" type="text" name="expirationdate" size="15" value="[% new_detail.expirationdate %]" class="datepickerto" />
154 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
157 <label for="number">Appear in position: </label>
158 [% IF ( new_detail.number ) %]
159 <input id="number" size="3" name="number" type="text" value="[% new_detail.number %]" />
161 <input id="number" size="3" name="number" type="text" />
164 <li><label for="content">News: </label>
165 <textarea name="content" id="content" cols="75" rows="10">[% new_detail.content %]</textarea>
170 <fieldset class="action"><input class="button" type="submit" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/tools/koha-news.pl">Cancel</a></fieldset>
173 <div style="margin-bottom:5px;">
174 <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
175 <label for="lang">Display location:</label>
176 <select name="lang" id="lang">
177 [% IF ( lang == "" ) %]
178 <option value="" selected="selected">All</option>
180 <option value="" >All</option>
182 [% IF ( lang == "koha" ) %]
183 <option value="koha" selected="selected">Librarian interface</option>
185 <option value="koha" >Librarian interface</option>
187 [% IF ( lang == "slip" ) %]
188 <option value="slip" selected="selected">Slip</option>
190 <option value="slip" >Slip</option>
192 [% FOREACH lang_lis IN lang_list %]
193 [% IF ( lang_lis.language == lang ) %]
194 <option value="[% lang_lis.language %]" selected="selected">OPAC ([% lang_lis.language %])</option>
196 <option value="[% lang_lis.language %]" >OPAC ([% lang_lis.language %])</option>
200 <label for="branch">Library: </label>
201 <select id="branch" name="branch">
202 [% IF ( branchcode == "" ) %]
203 <option value="" selected="selected">All libraries</option>
205 <option value="" >All libraries</option>
207 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
209 <input type="submit" class="button" value="Filter" />
212 [% IF ( opac_news_count ) %]
213 <form id="del_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl">
220 <th class="title-string">Publication date</th>
221 <th class="title-string">Expiration date</th>
227 <tbody>[% FOREACH opac_new IN opac_news %]
228 [% IF ( opac_new.expired ) %]
234 <input type="checkbox" name="ids" value="[% opac_new.idnew %]" />
236 <td>[% SWITCH opac_new.lang %]
244 OPAC ([% opac_new.lang %])
247 <td>[% IF ( opac_new.branchcode == "" ) -%]
249 [% ELSE %][% opac_new.branchname %]
251 <td>[% opac_new.number %]</td>
252 <td><span title="[% opac_new.newdate %]">[% opac_new.newdate | $KohaDates %]</span></td>
253 <td><span title="[% opac_new.expirationdate %]">[% opac_new.expirationdate | $KohaDates %] [% IF ( opac_new.expired ) %](<span class="expired">expired</span>)[% END %]</span></td>
254 <td>[% opac_new.title %]</td>
255 <td>[% opac_new.author_title %] [% opac_new.author_firstname %] [% opac_new.author_surname %]</td>
257 [% opac_new.content %]
260 <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>
261 <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>
266 <input type="hidden" name="op" value="del" />
267 <fieldset class="action"><input type="submit" class="button" value="Delete selected" /></fieldset>
270 <div class="dialog message">There are no news items.</div>
275 [% UNLESS ( add_form ) %]
276 <div class="yui-b noprint">
277 [% INCLUDE 'tools-menu.inc' %]
281 [% INCLUDE 'intranet-bottom.inc' %]