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