5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha › Tools › News</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% IF ( opac_news_count ) %]
9 [% Asset.css("css/datatables.css") %]
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 id="doc3" class="yui-t2">
31 [% UNLESS ( add_form ) %]
32 [% IF error_message == 'title_missing' %]
33 <div class="dialog alert">Error: Required news title missing!</div>
35 <div id="toolbar" class="btn-toolbar">
36 <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>
41 [% IF ( op == 'add' ) %][% default_lang = lang %]
42 [% ELSE %][% default_lang = new_detail.lang %]
44 <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
45 <input type="hidden" name="op" value="[% op %]" />
46 <input type="hidden" name="id" value="[% id %]" />
47 <fieldset class="rows">
48 <legend>OPAC and Koha news</legend>
50 <label for="lang">Display location:</label>
51 <select id="lang" name="lang">
52 [% IF ( default_lang == "" ) %]
53 <option value="" selected="selected">All</option>
55 <option value="" >All</option>
57 [% IF ( default_lang == "koha" ) %]
58 <option value="koha" selected="selected">Librarian interface</option>
60 <option value="koha" >Librarian interface</option>
62 [% IF ( default_lang == "slip" ) %]
63 <option value="slip" selected="selected">Slip</option>
65 <option value="slip" >Slip</option>
67 [% FOREACH lang_lis IN lang_list %]
68 [% IF ( lang_lis.language == default_lang ) %]
69 <option value="[% lang_lis.language %]" selected="selected">OPAC ([% lang_lis.language %])</option>
71 <option value="[% lang_lis.language %]" >OPAC ([% lang_lis.language %])</option>
77 <label for="branch">Library: </label>
78 <select id="branch" name="branch">
79 [% IF ( new_detail.branchcode == '' ) %]
80 <option value="" selected="selected">All libraries</option>
82 <option value="" >All libraries</option>
84 [% PROCESS options_for_libraries libraries => Branches.all( selected => new_detail.branchcode, unfiltered => 1, ) %]
88 <label for="title" class="required">Title: </label>
89 <input id="title" size="30" type="text" name="title" value="[% new_detail.title %]" required="required" class="required" /> <span class="required">Required</span>
92 <label for="from">Publication date: </label>
93 <input id="from" type="text" name="timestamp" size="15" value="[% new_detail.timestamp %]" class="datepickerfrom" />
94 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
97 <label for="to">Expiration date: </label>
98 <input id="to" type="text" name="expirationdate" size="15" value="[% new_detail.expirationdate %]" class="datepickerto" />
99 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
102 <label for="number">Appear in position: </label>
103 [% IF ( new_detail.number ) %]
104 <input id="number" size="3" name="number" type="text" value="[% new_detail.number %]" />
106 <input id="number" size="3" name="number" type="text" />
109 <li><label for="content">News: </label>
110 <textarea name="content" id="content" cols="75" rows="10">[% new_detail.content %]</textarea>
115 <fieldset class="action"><input class="button" type="submit" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/tools/koha-news.pl">Cancel</a></fieldset>
118 <div style="margin-bottom:5px;">
119 <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
120 <label for="lang">Display location:</label>
121 <select name="lang" id="lang">
122 [% IF ( lang == "" ) %]
123 <option value="" selected="selected">All</option>
125 <option value="" >All</option>
127 [% IF ( lang == "koha" ) %]
128 <option value="koha" selected="selected">Librarian interface</option>
130 <option value="koha" >Librarian interface</option>
132 [% IF ( lang == "slip" ) %]
133 <option value="slip" selected="selected">Slip</option>
135 <option value="slip" >Slip</option>
137 [% FOREACH lang_lis IN lang_list %]
138 [% IF ( lang_lis.language == lang ) %]
139 <option value="[% lang_lis.language %]" selected="selected">OPAC ([% lang_lis.language %])</option>
141 <option value="[% lang_lis.language %]" >OPAC ([% lang_lis.language %])</option>
145 <label for="branch">Library: </label>
146 <select id="branch" name="branch">
147 [% IF ( branchcode == "" ) %]
148 <option value="" selected="selected">All libraries</option>
150 <option value="" >All libraries</option>
152 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
154 <input type="submit" class="button" value="Filter" />
157 [% IF ( opac_news_count ) %]
158 <form id="del_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl">
165 <th class="title-string">Publication date</th>
166 <th class="title-string">Expiration date</th>
172 <tbody>[% FOREACH opac_new IN opac_news %]
173 [% IF ( opac_new.expired ) %]
179 <input type="checkbox" name="ids" value="[% opac_new.idnew %]" />
181 <td>[% SWITCH opac_new.lang %]
189 OPAC ([% opac_new.lang %])
192 <td>[% IF ( opac_new.branchcode == "" ) -%]
194 [% ELSE %][% opac_new.branchname %]
196 <td>[% opac_new.number %]</td>
197 <td><span title="[% opac_new.newdate %]">[% opac_new.newdate | $KohaDates %]</span></td>
198 <td><span title="[% opac_new.expirationdate %]">[% opac_new.expirationdate | $KohaDates %] [% IF ( opac_new.expired ) %](<span class="expired">expired</span>)[% END %]</span></td>
199 <td>[% opac_new.title %]</td>
200 <td>[% opac_new.author_title %] [% opac_new.author_firstname %] [% opac_new.author_surname %]</td>
202 [% opac_new.content %]
205 <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>
206 <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>
211 <input type="hidden" name="op" value="del" />
212 <fieldset class="action"><input type="submit" class="button" value="Delete selected" /></fieldset>
215 <div class="dialog message">There are no news items.</div>
220 [% UNLESS ( add_form ) %]
221 <div class="yui-b noprint">
222 [% INCLUDE 'tools-menu.inc' %]
227 [% MACRO jsinclude BLOCK %]
228 [% INCLUDE 'calendar.inc' %]
229 [% Asset.js("js/tools-menu.js") %]
230 [% IF ( opac_news_count ) %]
231 [% INCLUDE 'datatables.inc' %]
232 <script type="text/javascript">
233 $(document).ready(function() {
234 $("#newst").dataTable($.extend(true, {}, dataTablesDefaults, {
236 { "aTargets": [ 0,-1,-2 ], "bSortable": false },
237 { "aTargets": [ 0, -1 ], "bSearchable": false },
238 { 'sType': "title-string", 'aTargets' : [ 'title-string'] }
240 "sPaginationType": "full_numbers"
242 $(".delete_news").on("click", function(){
243 return confirmDelete( _("Are you sure you want to delete this news item? This cannot be undone.") );
247 var form = document.getElementById('del_form');
248 var inputs = form.getElementsByTagName('input');
250 for (var i=0; i<inputs.length; i++) {
251 if (inputs[i].type == 'checkbox' && inputs[i].name == 'ids') {
252 checked = inputs[i].checked;
253 if (checked) return true;
258 $("#del_form").on("submit",function(){
260 return confirmDelete( _("Are you sure you want to delete the selected news?") );
262 alert(_("Please select a news item to delete."));
269 [% Asset.js("lib/tiny_mce/tiny_mce.js") %]
270 <script type="text/javascript">
271 tinyMCE.baseURL = "[% interface %]/lib/tiny_mce";
275 convert_urls : false,
276 relative_urls : false,
277 content_css : "[% interface %]/[% theme %]/css/tinymce.css",
278 plugins : "table,save,advhr,advlink,searchreplace,print,contextmenu",
279 theme_advanced_buttons1 : "save,|,bold,italic,|,cut,copy,paste,|,search,replace,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,link,unlink,anchor,cleanup,help,code,advhr,|,print",
280 theme_advanced_buttons2 : "tablecontrols,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,removeformat,|,visualaid,|,sub,sup,|,charmap",
281 theme_advanced_buttons3 : "",
282 theme_advanced_toolbar_location : "top",
283 theme_advanced_toolbar_align : "left",
284 theme_advanced_path_location : "bottom",
285 theme_advanced_resizing : true,
286 plugin_insertdate_dateFormat : "%Y-%m-%d",
287 plugin_insertdate_timeFormat : "%H:%M:%S",
288 apply_source_formatting : true,
295 [% INCLUDE 'intranet-bottom.inc' %]