Bug 10513: (follow-up) allow for multiline checkin alerts/messages
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / koha-news.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Tools &rsaquo; News</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% INCLUDE 'calendar.inc' %]
5 [% IF ( opac_news_count ) %]
6     <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/en/css/datatables.css" />
7     <script type="text/javascript" src="[% interface %]/[% theme %]/en/lib/jquery/plugins/jquery.dataTables.min.js"></script>
8     [% INCLUDE 'datatables-strings.inc' %]
9     <script type="text/javascript" src="[% interface %]/[% theme %]/en/js/datatables.js"></script>
10     <script type="text/javascript">//<![CDATA[
11     [% IF (dateformat == 'metric') %]dt_add_type_uk_date();[% END %]
12     $(document).ready(function() {
13         $("#newst").dataTable($.extend(true, {}, dataTablesDefaults, {
14             "sDom": 't',
15             "aoColumnDefs": [
16                 { "aTargets": [ 0,-1,-2 ], "bSortable": false, "bSearchable": false }
17             ],
18             "bPaginate": false
19         }));
20     });
21     //]]>
22     </script>
23 [% END %]
24 <script language="javascript" type="text/javascript" src="[% interface %]/lib/tiny_mce/tiny_mce.js"></script>
25 <script type="text/javascript">//<![CDATA[
26 tinyMCE.init({
27     mode : "textareas",
28     theme : "advanced",
29     content_css : "[% themelang %]/css/tinymce.css",
30     plugins : "table,save,advhr,advlink,searchreplace,print,contextmenu",
31     theme_advanced_buttons1 : "save,|,bold,italic,|,cut,copy,paste,|,search,replace,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,link,unlink,anchor,cleanup,help,code,advhr,|,print",
32     theme_advanced_buttons2 : "tablecontrols,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,removeformat,|,visualaid,|,sub,sup,|,charmap",
33     theme_advanced_buttons3 : "",
34     theme_advanced_toolbar_location : "top",
35     theme_advanced_toolbar_align : "left",
36     theme_advanced_path_location : "bottom",
37     theme_advanced_resizing : true,
38     plugin_insertdate_dateFormat : "%Y-%m-%d",
39     plugin_insertdate_timeFormat : "%H:%M:%S",
40     apply_source_formatting : true,
41     height : "300",
42     width : "700"
43 //]]>
44 });
45 //]]>
46 </script>
47 </head>
48 <body id="tools_koha-news" class="tools">
49 [% INCLUDE 'header.inc' %]
50 [% INCLUDE 'cat-search.inc' %]
51
52 <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 ) %]
53 Edit News Item[% ELSE %]Add News Item[% END %][% ELSE %]News[% END %]</div>
54
55 [% IF ( add_form ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
56    <div id="bd">
57         <div id="yui-main">
58         <div class="yui-b">
59
60 [% UNLESS ( add_form ) %]
61 <div id="toolbar" class="btn-toolbar">
62     <a class="btn btn-small" id="newentry" href="/cgi-bin/koha/tools/koha-news.pl?op=add_form"><i class="icon-plus"></i> New entry</a>
63 </div>
64 [% END %]
65
66 [% IF ( add_form ) %]
67         <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
68             <input type="hidden" name="op" value="[% op %]" />
69             <input type="hidden" name="id" value="[% id %]" />
70                         <fieldset class="rows">
71             <legend>OPAC and Koha news</legend>
72            <ol> <li>
73             <label for="lang">Display location</label>
74             <select id="lang" name="lang">
75                 <option value="koha">Librarian interface</option>
76                 [% IF ( slip ) %]<option value="slip" selected="selected">Slip</option>[% ELSE %]<option value="slip">Slip</option>[% END %]
77                 [% FOREACH lang_lis IN lang_list %]
78                     [% IF ( lang_lis.selected ) %]<option value="[% lang_lis.language %]" selected="selected">OPAC ([% lang_lis.language %])</option>[% ELSE %]<option value="[% lang_lis.language %]">OPAC ([% lang_lis.language %])</option>[% END %]
79                 [% END %]
80             </select>
81             </li>
82             <li>
83                 <label for="title">Title: </label>
84                 <input id="title" size="30" type="text" name="title" value="[% new_detail.title %]" />
85             </li>
86             <li>
87                 <label for="from">Publication date: </label>
88                 <input id="from" type="text" name="timestamp" size="15" value="[% new_detail.timestamp %]" class="datepickerfrom" />
89                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
90             </li>
91             <li>
92                 <label for="to">Expiration date: </label>
93                 <input id="to" type="text" name="expirationdate" size="15" value="[% new_detail.expirationdate %]" class="datepickerto" />
94                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
95             </li>
96             <li>
97                 <label for="number">Appear in position: </label>
98                 [% IF ( new_detail.number ) %]
99                     <input id="number" size="3" name="number" type="text" checked="checked" value="[% new_detail.number %]" />
100                 [% ELSE %]
101                     <input id="number" size="3" name="number" type="text" />
102                 [% END %]
103             </li>
104             <li><label for="new">News: </label>
105             <textarea name="new" id="new"  cols="75" rows="10">[% new_detail.new %]</textarea></li>
106             </ol>
107                         </fieldset>
108   
109                 <fieldset class="action"><input class="button" type="submit" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/tools/koha-news.pl">Cancel</a></fieldset>
110         </form>
111     [% ELSE %]
112         <div style="margin-bottom:5px;">
113         <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
114             <label for="lang">Display location:</label>
115             <select name="lang" id="lang">
116             <option value="">All</option>
117             <option value="koha">Librarian interface</option>
118             <option value="slip">Slip</option>
119                 [% FOREACH lang_lis IN lang_list %]
120                     [% IF ( lang_lis.selected ) %]
121                         <option value="[% lang_lis.language %]" selected="selected">
122                     [% ELSE %]
123                         <option value="[% lang_lis.language %]">
124                     [% END %]
125                         OPAC ([% lang_lis.language %])
126                     </option>
127                 [% END %]
128             </select>
129             <input type="submit" class="button" value="Filter" />
130         </form>
131         </div>
132         [% IF ( opac_news_count ) %]
133         <form name="del_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" onsubmit="return confirm('Are you sure you want to delete the selected news?')">
134                 <table id="newst">
135                    <thead> <tr>
136                         <th>&nbsp;</th>
137                         <th>Location</th>
138                         <th>Number</th>
139                         <th>Creation date</th>
140                         <th>Expiration date</th>
141                         <th>Title</th>
142                         <th>News</th>
143                         <th>&nbsp;</th>
144                     </tr></thead>
145                     <tbody>[% FOREACH opac_new IN opac_news %]
146                          [% IF ( opac_new.expired ) %]
147                             <tr class="expired">
148                             [% ELSE %]
149                             <tr>
150                             [% END %]
151                             <td>
152                                 <input type="checkbox" name="ids" value="[% opac_new.idnew %]" />
153                             </td>
154                             <td>[% IF ( opac_new.lang == 'koha' ) %]
155                                     Librarian interface
156                                  [% ELSE %]
157                                     [% IF ( opac_new.lang == 'slip' ) %]
158                                         Slip
159                                     [% ELSE %]
160                                         OPAC
161                                     [% END %]
162                                  [% END %]
163                              </td>
164
165                             <td>[% opac_new.number %]</td>
166                             <td>[% opac_new.newdate %]</td>
167                             <td>[% opac_new.expirationdate %] [% IF ( opac_new.expired ) %](<span class="expired">expired</span>)[% END %]</td>
168                             <td>[% opac_new.title %]</td>
169                            <td>
170                                 [% opac_new.new %]
171                             </td>
172                             <td><a href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&amp;id=[% opac_new.idnew %]">Edit</a></td>
173                         </tr>
174                     [% END %]</tbody>
175                 </table>
176                 <input type="hidden" name="op" value="del" />
177                 <fieldset class="action"><input type="submit" class="button" value="Delete selected" /></fieldset>
178             </form>
179         [% ELSE %]
180             <p>No news loaded</p>
181         [% END %]
182     [% END %]
183 </div>
184 </div>
185 [% UNLESS ( add_form ) %]
186     <div class="yui-b noprint">
187         [% INCLUDE 'tools-menu.inc' %]
188     </div>
189 [% END %]
190 </div>
191 [% INCLUDE 'intranet-bottom.inc' %]