Bug 10904: Limit patron update request management by branch
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / koha-news.tt
1 [% USE KohaDates %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Tools &rsaquo; News</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 [% INCLUDE 'calendar.inc' %]
6 [% IF ( opac_news_count ) %]
7     <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
8     [% INCLUDE 'datatables.inc' %]
9     <script type="text/javascript">//<![CDATA[
10     $(document).ready(function() {
11         $("#newst").dataTable($.extend(true, {}, dataTablesDefaults, {
12             "aoColumnDefs": [
13                 { "aTargets": [ 0,-1,-2 ], "bSortable": false },
14                 { "aTargets": [ 0, -1 ], "bSearchable": false },
15                 { 'sType': "title-string", 'aTargets' : [ 'title-string'] }
16             ],
17             "sPaginationType": "full_numbers"
18         }));
19     });
20     //]]>
21     </script>
22 [% END %]
23 <script type="text/javascript" src="[% interface %]/lib/tiny_mce/tiny_mce.js"></script>
24 <script type="text/javascript">//<![CDATA[
25 var MSG_CONFIRM_DELETE_NEWS  = _("Are you sure you want to delete the selected news?");
26
27 tinyMCE.init({
28     mode : "textareas",
29     theme : "advanced",
30     convert_urls : false,
31     relative_urls : false,
32     content_css : "[% themelang %]/css/tinymce.css",
33     plugins : "table,save,advhr,advlink,searchreplace,print,contextmenu",
34     theme_advanced_buttons1 : "save,|,bold,italic,|,cut,copy,paste,|,search,replace,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,link,unlink,anchor,cleanup,help,code,advhr,|,print",
35     theme_advanced_buttons2 : "tablecontrols,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,removeformat,|,visualaid,|,sub,sup,|,charmap",
36     theme_advanced_buttons3 : "",
37     theme_advanced_toolbar_location : "top",
38     theme_advanced_toolbar_align : "left",
39     theme_advanced_path_location : "bottom",
40     theme_advanced_resizing : true,
41     plugin_insertdate_dateFormat : "%Y-%m-%d",
42     plugin_insertdate_timeFormat : "%H:%M:%S",
43     apply_source_formatting : true,
44     height : "300",
45     width : "700"
46 //]]>
47 });
48 //]]>
49 </script>
50 </head>
51 <body id="tools_koha-news" class="tools">
52 [% INCLUDE 'header.inc' %]
53 [% INCLUDE 'cat-search.inc' %]
54
55 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; [% IF ( add_form ) %]<a href="/cgi-bin/koha/tools/koha-news.pl">News</a> &rsaquo; [% IF ( id ) %]
56 Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div>
57
58 [% IF ( add_form ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
59    <div id="bd">
60         <div id="yui-main">
61         <div class="yui-b">
62
63 [% UNLESS ( add_form ) %]
64     [% IF error_message == 'title_missing' %]
65         <div class="dialog alert">Error: Required news title missing!</div>
66     [% END %]
67 <div id="toolbar" class="btn-toolbar">
68     <a class="btn btn-small" id="newentry" href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&amp;lang=[% lang %]"><i class="fa fa-plus"></i> New entry</a>
69 </div>
70 [% END %]
71
72 [% IF ( add_form ) %]
73     [% IF ( op == 'add' ) %][% default_lang = lang %]
74     [% ELSE %][% default_lang = new_detail.lang %]
75     [% END %]
76         <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
77             <input type="hidden" name="op" value="[% op %]" />
78             <input type="hidden" name="id" value="[% id %]" />
79                         <fieldset class="rows">
80             <legend>OPAC and Koha news</legend>
81            <ol> <li>
82             <label for="lang">Display location</label>
83             <select id="lang" name="lang">
84                 [% IF ( default_lang == "" ) %]
85                 <option value="" selected="selected">All</option>
86                 [% ELSE %]
87                 <option value=""                    >All</option>
88                 [% END %]
89                 [% IF ( default_lang == "koha" ) %]
90                 <option value="koha" selected="selected">Librarian interface</option>
91                 [% ELSE %]
92                 <option value="koha"                    >Librarian interface</option>
93                 [% END %]
94                 [% IF ( default_lang == "slip" ) %]
95                 <option value="slip" selected="selected">Slip</option>
96                 [% ELSE %]
97                 <option value="slip"                    >Slip</option>
98                 [% END %]
99                 [% FOREACH lang_lis IN lang_list %]
100                 [% IF ( lang_lis.language == default_lang ) %]
101                     <option value="[% lang_lis.language %]" selected="selected">OPAC ([% lang_lis.language %])</option>
102                 [% ELSE %]
103                     <option value="[% lang_lis.language %]"                    >OPAC ([% lang_lis.language %])</option>
104                 [% END %]
105                 [% END %]
106             </select>
107             </li>
108             <li>
109                 <label for="branch">Library: </label>
110                 <select id="branch" name="branch">
111                 [% IF ( new_detail.branchcode == '' ) %]
112                     <option value="" selected="selected">All libraries</option>
113                 [% ELSE %]
114                     <option value=""         >All libraries</option>
115                 [% END %]
116                 [% FOREACH branch_item IN branch_list %]
117                 [% IF ( branch_item.value.branchcode == new_detail.branchcode ) %]
118                     <option value="[% branch_item.value.branchcode %]" selected="selected">[% branch_item.value.branchname %]</option>
119                 [% ELSE %]
120                     <option value="[% branch_item.value.branchcode %]">[% branch_item.value.branchname %]</option>
121                 [% END %]
122                 [% END %]
123                 </select>
124             </li>
125             <li>
126                 <label for="title" class="required">Title: </label>
127                 <input id="title" size="30" type="text" name="title" value="[% new_detail.title %]" required="required" class="required" /> <span class="required">Required</span>
128             </li>
129             <li>
130                 <label for="from">Publication date: </label>
131                 <input id="from" type="text" name="timestamp" size="15" value="[% new_detail.timestamp %]" class="datepickerfrom" />
132                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
133             </li>
134             <li>
135                 <label for="to">Expiration date: </label>
136                 <input id="to" type="text" name="expirationdate" size="15" value="[% new_detail.expirationdate %]" class="datepickerto" />
137                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
138             </li>
139             <li>
140                 <label for="number">Appear in position: </label>
141                 [% IF ( new_detail.number ) %]
142                     <input id="number" size="3" name="number" type="text" value="[% new_detail.number %]" />
143                 [% ELSE %]
144                     <input id="number" size="3" name="number" type="text" />
145                 [% END %]
146             </li>
147             <li><label for="new">News: </label>
148             <textarea name="new" id="new"  cols="75" rows="10">[% new_detail.new %]</textarea>
149             </li>
150             </ol>
151                         </fieldset>
152   
153                 <fieldset class="action"><input class="button" type="submit" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/tools/koha-news.pl">Cancel</a></fieldset>
154         </form>
155     [% ELSE %]
156         <div style="margin-bottom:5px;">
157         <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
158             <label for="lang">Display location:</label>
159             <select name="lang" id="lang">
160             [% IF ( lang == "" ) %]
161             <option value=""     selected="selected">All</option>
162             [% ELSE %]
163             <option value=""             >All</option>
164             [% END %]
165             [% IF ( lang == "koha" ) %]
166             <option value="koha" selected="selected">Librarian interface</option>
167             [% ELSE %]
168             <option value="koha"         >Librarian interface</option>
169             [% END %]
170             [% IF ( lang == "slip" ) %]
171             <option value="slip" selected="selected">Slip</option>
172             [% ELSE %]
173             <option value="slip"         >Slip</option>
174             [% END %]
175                 [% FOREACH lang_lis IN lang_list %]
176                 [% IF ( lang_lis.language == lang ) %]
177                     <option value="[% lang_lis.language %]" selected="selected">OPAC ([% lang_lis.language %])</option>
178                 [% ELSE %]
179                     <option value="[% lang_lis.language %]"         >OPAC ([% lang_lis.language %])</option>
180                 [% END %]
181                 [% END %]
182             </select>
183             <label for="branch">Library: </label>
184             <select id="branch" name="branch">
185                 [% IF ( branchcode == "" ) %]
186                 <option value="" selected="selected">All libraries</option>
187                 [% ELSE %]
188                 <option value=""         >All libraries</option>
189                 [% END %]
190                 [% FOREACH branch_item IN branch_list %]
191                 [% IF ( branch_item.value.branchcode == branchcode ) %]
192                     <option value="[% branch_item.value.branchcode %]"
193                             selected="selected">[% branch_item.value.branchname %]
194                     </option>
195                 [% ELSE %]
196                     <option value="[% branch_item.value.branchcode %]"
197                                     >[% branch_item.value.branchname %]
198                     </option>
199                 [% END %]
200                 [% END %]
201             </select>
202             <input type="submit" class="button" value="Filter" />
203         </form>
204         </div>
205         [% IF ( opac_news_count ) %]
206         <form name="del_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" onsubmit='return confirm(MSG_CONFIRM_DELETE_NEWS)'>
207                 <table id="newst">
208                    <thead> <tr>
209                         <th>&nbsp;</th>
210                         <th>Location</th>
211                         <th>Library</th>
212                         <th>Number</th>
213                         <th class="title-string">Publication date</th>
214                         <th class="title-string">Expiration date</th>
215                         <th>Title</th>
216                         <th>Author</th>
217                         <th>News</th>
218                         <th>&nbsp;</th>
219                     </tr></thead>
220                     <tbody>[% FOREACH opac_new IN opac_news %]
221                          [% IF ( opac_new.expired ) %]
222                             <tr class="expired">
223                             [% ELSE %]
224                             <tr>
225                             [% END %]
226                             <td>
227                                 <input type="checkbox" name="ids" value="[% opac_new.idnew %]" />
228                             </td>
229                             <td>[% SWITCH opac_new.lang %]
230                                 [%   CASE "koha" %]
231                                     Librarian interface
232                                 [%   CASE "slip" %]
233                                     Slip
234                                 [%   CASE "" %]
235                                     All
236                                 [%   CASE %]
237                                     OPAC ([% opac_new.lang %])
238                                 [% END %]
239                              </td>
240                             <td>[% IF ( opac_new.branchcode == "" ) -%]
241                                 All libraries
242                                 [% ELSE %][% opac_new.branchname %]
243                                 [% END %]</td>
244                             <td>[% opac_new.number %]</td>
245                             <td><span title="[% opac_new.newdate %]">[% opac_new.newdate | $KohaDates %]</span></td>
246                             <td><span title="[% opac_new.expirationdate %]">[% opac_new.expirationdate | $KohaDates %] [% IF ( opac_new.expired ) %](<span class="expired">expired</span>)[% END %]</span></td>
247                             <td>[% opac_new.title %]</td>
248                             <td>[% opac_new.author_title %] [% opac_new.author_firstname %] [% opac_new.author_surname %]</td>
249                            <td>
250                                 [% opac_new.new %]
251                             </td>
252                             <td><a href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&amp;id=[% opac_new.idnew %]">Edit</a></td>
253                         </tr>
254                     [% END %]</tbody>
255                 </table>
256                 <input type="hidden" name="op" value="del" />
257                 <fieldset class="action"><input type="submit" class="button" value="Delete selected" /></fieldset>
258             </form>
259         [% ELSE %]
260             <p>No news loaded</p>
261         [% END %]
262     [% END %]
263 </div>
264 </div>
265 [% UNLESS ( add_form ) %]
266     <div class="yui-b noprint">
267         [% INCLUDE 'tools-menu.inc' %]
268     </div>
269 [% END %]
270 </div>
271 [% INCLUDE 'intranet-bottom.inc' %]