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