Merge branch 'bug_9647' into 3.12-master
[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="/intranet-tmpl/prog/en/css/datatables.css" />
7     <script type="text/javascript" src="/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.dataTables.min.js"></script>
8     [% INCLUDE 'datatables-strings.inc' %]
9     <script type="text/javascript" src="/intranet-tmpl/prog/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 type="text/javascript" src="[% themelang %]/js/tinymce/jscripts/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,iespell,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 </script>
46 </head>
47 <body id="tools_koha-news" class="tools">
48 [% INCLUDE 'header.inc' %]
49 [% INCLUDE 'cat-search.inc' %]
50
51 <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 ) %]
52 Edit News Item[% ELSE %]Add News Item[% END %][% ELSE %]News[% END %]</div>
53
54 [% IF ( add_form ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
55    <div id="bd">
56         <div id="yui-main">
57         <div class="yui-b">
58
59 [% UNLESS ( add_form ) %]
60 <div id="toolbar" class="btn-toolbar">
61     <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>
62 </div>
63 [% END %]
64
65 [% IF ( add_form ) %]
66         <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
67             <input type="hidden" name="op" value="[% op %]" />
68             <input type="hidden" name="id" value="[% id %]" />
69                         <fieldset class="rows">
70             <legend>OPAC and Koha news</legend>
71            <ol> <li>
72             <label for="lang">Display location</label>
73             <select id="lang" name="lang">
74                 <option value="koha">Librarian interface</option>
75                 [% IF ( slip ) %]<option value="slip" selected="selected">Slip</option>[% ELSE %]<option value="slip">Slip</option>[% END %]
76                 [% FOREACH lang_lis IN lang_list %]
77                     [% 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 %]
78                 [% END %]
79             </select>
80             </li>
81             <li>
82                 <label for="title">Title</label>
83                 <input id="title" size="30" type="text" name="title" value="[% new_detail.title %]" />
84             </li>
85             <li>
86                 <label for="from">Publication date</label>
87                 <input id="from" type="text" name="timestamp" size="15" value="[% new_detail.timestamp %]" class="datepickerfrom" />
88                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
89             </li>
90             <li>
91                 <label for="to">Expiration date</label>
92                 <input id="to" type="text" name="expirationdate" size="15" value="[% new_detail.expirationdate %]" class="datepickerto" />
93                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
94             </li>
95             <li>
96                 <label for="number">Appear in position </label>
97                 [% IF ( new_detail.number ) %]
98                     <input id="number" size="3" name="number" type="text" checked="checked" value="[% new_detail.number %]" />
99                 [% ELSE %]
100                     <input id="number" size="3" name="number" type="text" />
101                 [% END %]
102             </li>
103             <li><label for="new">News</label>
104             <textarea name="new" id="new"  cols="75" rows="10">[% new_detail.new %]</textarea></li>
105             </ol>
106                         </fieldset>
107   
108                 <fieldset class="action"><input class="button" type="submit" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/tools/koha-news.pl">Cancel</a></fieldset>
109         </form>
110     [% ELSE %]
111         <div style="margin-bottom:5px;">
112         <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
113             <label for="lang">Display location:</label>
114             <select name="lang" id="lang">
115             <option value="">All</option>
116             <option value="koha">Librarian interface</option>
117             <option value="slip">Slip</option>
118                 [% FOREACH lang_lis IN lang_list %]
119                     [% IF ( lang_lis.selected ) %]
120                         <option value="[% lang_lis.language %]" selected="selected">
121                     [% ELSE %]
122                         <option value="[% lang_lis.language %]">
123                     [% END %]
124                         OPAC ([% lang_lis.language %])
125                     </option>
126                 [% END %]
127             </select>
128             <input type="submit" class="button" value="Filter" />
129         </form>
130         </div>
131         [% IF ( opac_news_count ) %]
132         <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?')">
133                 <table id="newst">
134                    <thead> <tr>
135                         <th>&nbsp;</th>
136                         <th>Location</th>
137                         <th>Number</th>
138                         <th>Creation date</th>
139                         <th>Expiration date</th>
140                         <th>Title</th>
141                         <th>News</th>
142                         <th>&nbsp;</th>
143                     </tr></thead>
144                     <tbody>[% FOREACH opac_new IN opac_news %]
145                          [% IF ( opac_new.expired ) %]
146                             <tr class="expired">
147                             [% ELSE %]
148                             <tr>
149                             [% END %]
150                             <td>
151                                 <input type="checkbox" name="ids" value="[% opac_new.idnew %]" />
152                             </td>
153                             <td>[% IF ( opac_new.lang == 'koha' ) %]
154                                     Librarian interface
155                                  [% ELSE %]
156                                     [% IF ( opac_new.lang == 'slip' ) %]
157                                         Slip
158                                     [% ELSE %]
159                                         OPAC
160                                     [% END %]
161                                  [% END %]
162                              </td>
163
164                             <td>[% opac_new.number %]</td>
165                             <td>[% opac_new.newdate %]</td>
166                             <td>[% opac_new.expirationdate %] [% IF ( opac_new.expired ) %](<span class="expired">expired</span>)[% END %]</td>
167                             <td>[% opac_new.title %]</td>
168                            <td>
169                                 [% opac_new.new %]
170                             </td>
171                             <td><a href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&amp;id=[% opac_new.idnew %]">Edit</a></td>
172                         </tr>
173                     [% END %]</tbody>
174                 </table>
175                 <input type="hidden" name="op" value="del" />
176                 <fieldset class="action"><input type="submit" class="button" value="Delete selected" /></fieldset>
177             </form>
178         [% ELSE %]
179             <p>No news loaded</p>
180         [% END %]
181     [% END %]
182 </div>
183 </div>
184 [% UNLESS ( add_form ) %]
185     <div class="yui-b noprint">
186         [% INCLUDE 'tools-menu.inc' %]
187     </div>
188 [% END %]
189 </div>
190 [% INCLUDE 'intranet-bottom.inc' %]