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