Merge remote-tracking branch 'origin/new/bug_5604'
[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 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
6 <script type="text/javascript">//<![CDATA[
7 $(document).ready(function() {
8         $("#newst").tablesorter({[% IF ( dateformat == 'metric' ) %]
9                 dateFormat: 'uk',[% END %]
10                 sortList: [[2,0]],
11                 headers: { 0: {sorter:false},6: { sorter: false },7: { sorter: false }}
12         }); 
13 }); 
14 //]]>
15 </script>
16 <script language="javascript" type="text/javascript" src="[% themelang %]/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
17 <script language="javascript" type="text/javascript">
18 tinyMCE.init({
19     mode : "textareas",
20     theme : "advanced",
21     content_css : "[% themelang %]/css/tinymce.css",
22     plugins : "table,save,advhr,advlink,iespell,searchreplace,print,contextmenu",
23     theme_advanced_buttons1 : "save,|,bold,italic,|,cut,copy,paste,|,search,replace,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,link,unlink,anchor,cleanup,help,code,advhr,|,print",
24     theme_advanced_buttons2 : "tablecontrols,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,removeformat,|,visualaid,|,sub,sup,|,charmap",
25     theme_advanced_buttons3 : "",
26     theme_advanced_toolbar_location : "top",
27     theme_advanced_toolbar_align : "left",
28     theme_advanced_path_location : "bottom",
29     theme_advanced_resizing : true,
30     plugin_insertdate_dateFormat : "%Y-%m-%d",
31     plugin_insertdate_timeFormat : "%H:%M:%S",
32     apply_source_formatting : true,
33     height : "300",
34     width : "700"
35 });
36 </script>
37 </head>
38 <body>
39 [% INCLUDE 'header.inc' %]
40 [% INCLUDE 'cat-search.inc' %]
41
42 <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 ) %]
43 Edit News Item[% ELSE %]Add News Item[% END %][% ELSE %]News[% END %]</div>
44
45 [% IF ( add_form ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
46    <div id="bd">
47         <div id="yui-main">
48         <div class="yui-b">
49  
50 [% UNLESS ( add_form ) %]
51 <div id="toolbar">
52         <script type="text/javascript">
53         //<![CDATA[
54         // prepare DOM for YUI Toolbar
55          $(document).ready(function() {
56             yuiToolbar();
57          });
58         // YUI Toolbar Functions
59         function yuiToolbar() {
60             new YAHOO.widget.Button("newentry");
61         }
62         //]]>
63         </script>
64         <ul class="toolbar">
65         <li><a id="newentry" href="/cgi-bin/koha/tools/koha-news.pl?op=add_form">New Entry</a></li>
66 </ul></div>
67 [% END %]
68
69 [% IF ( add_form ) %]
70         <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
71             <input type="hidden" name="op" value="[% op %]" />
72             <input type="hidden" name="id" value="[% id %]" />
73                         <fieldset class="rows">
74                         <legend>OPAC and Koha News</legend>
75            <ol> <li>
76             <label for="lang">Display Location</label>
77             <select id="lang" name="lang">
78                 <option value="koha">Librarian interface</option>
79                 [% IF ( slip ) %]<option value="slip" selected="selected">Slip</option>[% ELSE %]<option value="slip">Slip</option>[% END %]
80                 [% FOREACH lang_lis IN lang_list %]
81                     [% 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 %]
82                 [% END %]
83             </select>
84             </li>
85             <li>
86                 <label for="title">Title</label>
87                 <input id="title" size="30" type="text" name="title" value="[% new_detail.title %]" />
88             </li>
89             <li>
90                 <label for="timestamp">Publication date</label>
91                 <input id="timestamp" type="text" name="timestamp" size="15" value="[% new_detail.timestamp %]" />
92                 <img src="[% themelang %]/lib/calendar/cal.gif" alt="Show Calendar" border="0" id="timestampButton" style="cursor: pointer;" />
93                 <script type="text/javascript">
94                     Calendar.setup(
95                     {
96                         button : "timestampButton",
97                         inputField : "timestamp",
98                         ifFormat : "[% DHTMLcalendar_dateformat %]"
99                     }
100                     );
101                 </script>
102                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
103             </li>
104             <li>
105                 <label for="expirationdate">Expiration date</label>
106                 <input id="expirationdate" type="text" name="expirationdate" size="15" value="[% new_detail.expirationdate %]" />
107                 <img src="[% themelang %]/lib/calendar/cal.gif" alt="Show Calendar" border="0" id="openCalendar" style="cursor: pointer;" />
108                 <script type="text/javascript">
109                     Calendar.setup(
110                     {
111                         button : "openCalendar",
112                         inputField : "expirationdate",
113                         ifFormat : "[% DHTMLcalendar_dateformat %]"
114                     }
115                     );
116                 </script>
117                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
118             </li>
119             <li>
120                 <label for="number">Appear in position </label>
121                 [% IF ( new_detail.number ) %]
122                     <input id="number" size="3" name="number" type="text" checked="checked" value="[% new_detail.number %]" />
123                 [% ELSE %]
124                     <input id="number" size="3" name="number" type="text" />
125                 [% END %]
126             </li>
127             <li><label for="new">News</label>
128             <textarea name="new" id="new"  cols="75" rows="10">[% new_detail.new %]</textarea></li>
129             </ol>
130                         </fieldset>
131   
132                 <fieldset class="action"><input class="button" type="submit" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/tools/koha-news.pl">Cancel</a></fieldset>
133         </form>
134     [% ELSE %]
135         <div style="margin-bottom:5px;">
136         <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
137             <label for="lang">Display Location:</label>
138             <select name="lang" id="lang">
139             <option value="">All</option>
140             <option value="koha">Librarian interface</option>
141             <option value="slip">Slip</option>
142                 [% FOREACH lang_lis IN lang_list %]
143                     [% IF ( lang_lis.selected ) %]
144                         <option value="[% lang_lis.language %]" selected="selected">
145                     [% ELSE %]
146                         <option value="[% lang_lis.language %]">
147                     [% END %]
148                         OPAC ([% lang_lis.language %])
149                     </option>
150                 [% END %]
151             </select>
152             <input type="submit" class="button" value="Filter" />
153         </form>
154         </div>
155         [% IF ( opac_news_count ) %]
156         <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?')">
157                 <table id="newst">
158                    <thead> <tr>
159                         <th>&nbsp;</th>
160                         <th>Location</th>
161                         <th>Number</th>
162                         <th>Creation&nbsp;Date</th>
163                         <th>Expiration&nbsp;Date</th>
164                         <th>Title</th>
165                         <th>News</th>
166                         <th>&nbsp;</th>
167                     </tr></thead>
168                     <tbody>[% FOREACH opac_new IN opac_news %]
169                          [% IF ( opac_new.expired ) %]
170                             <tr class="expired">
171                             [% ELSE %]
172                             <tr>
173                             [% END %]
174                             <td>
175                                 <input type="checkbox" name="ids" value="[% opac_new.idnew %]" />
176                             </td>
177                             <td>[% IF ( opac_new.lang == 'koha' ) %]
178                                     Librarian interface
179                                  [% ELSE %]
180                                     [% IF ( opac_new.lang == 'slip' ) %]
181                                         Slip
182                                     [% ELSE %]
183                                         OPAC
184                                     [% END %]
185                                  [% END %]
186                              </td>
187
188                             <td>[% opac_new.number %]</td>
189                             <td>[% opac_new.newdate %]</td>
190                             <td>[% opac_new.expirationdate %] [% IF ( opac_new.expired ) %](<span class="expired">expired</span>)[% END %]</td>
191                             <td>[% opac_new.title %]</td>
192                            <td>
193                                 [% opac_new.new %]
194                             </td>
195                             <td><a href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&amp;id=[% opac_new.idnew %]">Edit</a></td>
196                         </tr>
197                     [% END %]</tbody>
198                 </table>
199                 <input type="hidden" name="op" value="del" />
200                 <fieldset class="action"><input type="submit" class="button" value="Delete selected" /></fieldset>
201             </form>
202         [% ELSE %]
203             <p>No news loaded</p>
204         [% END %]
205     [% END %]
206 </div>
207 </div>
208 [% UNLESS ( add_form ) %]
209     <div class="yui-b noprint">
210         [% INCLUDE 'tools-menu.inc' %]
211     </div>
212 [% END %]
213 </div>
214 [% INCLUDE 'intranet-bottom.inc' %]