Merge remote branch 'kc/master' into new/enh/bug_5917
[koha.git] / koha-tt / 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 </head>
17 <body>
18 [% INCLUDE 'header.inc' %]
19 [% INCLUDE 'cat-search.inc' %]
20
21 <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 ) %]
22 Edit News Item[% ELSE %]Add News Item[% END %][% ELSE %]News[% END %]</div>
23
24 [% IF ( add_form ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
25    <div id="bd">
26         <div id="yui-main">
27         <div class="yui-b">
28  
29 [% UNLESS ( add_form ) %]
30 <div id="toolbar">
31         <script type="text/javascript">
32         //<![CDATA[
33         // prepare DOM for YUI Toolbar
34          $(document).ready(function() {
35             yuiToolbar();
36          });
37         // YUI Toolbar Functions
38         function yuiToolbar() {
39             new YAHOO.widget.Button("newentry");
40         }
41         //]]>
42         </script>
43         <ul class="toolbar">
44         <li><a id="newentry" href="/cgi-bin/koha/tools/koha-news.pl?op=add_form">New Entry</a></li>
45 </ul></div>
46 [% END %]
47
48 [% IF ( add_form ) %]
49         <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
50             <input type="hidden" name="op" value="[% op %]" />
51             <input type="hidden" name="id" value="[% id %]" />
52                         <fieldset class="rows">
53                         <legend>OPAC and Koha News</legend>
54            <ol> <li>
55             <label for="lang">Display Location</label>
56             <select id="lang" name="lang">
57                 <option value="koha">Librarian interface</option>
58                 [% IF ( slip ) %]<option value="slip" selected="selected">Slip</option>[% ELSE %]<option value="slip">Slip</option>[% END %]
59                 [% FOREACH lang_lis IN lang_list %]
60                     [% 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 %]
61                 [% END %]
62             </select>
63             </li>
64             <li>
65                 <label for="title">Title</label>
66                 <input id="title" size="30" type="text" name="title" value="[% title %]" />
67             </li>
68             <li>
69                 <label for="timestamp">Publication date</label>
70                 <input id="timestamp" type="text" name="timestamp" size="15" value="[% timestamp %]" />
71                 <img src="[% themelang %]/lib/calendar/cal.gif" alt="Show Calendar" border="0" id="timestampButton" style="cursor: pointer;" />
72                 <script type="text/javascript">
73                     Calendar.setup(
74                     {
75                         button : "timestampButton",
76                         inputField : "timestamp",
77                         ifFormat : "[% DHTMLcalendar_dateformat %]"
78                     }
79                     );
80                 </script>
81                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
82             </li>
83             <li>
84                 <label for="expirationdate">Expiration date</label>
85                 <input id="expirationdate" type="text" name="expirationdate" size="15" value="[% expirationdate %]" />
86                 <img src="[% themelang %]/lib/calendar/cal.gif" alt="Show Calendar" border="0" id="openCalendar" style="cursor: pointer;" />
87                 <script type="text/javascript">
88                     Calendar.setup(
89                     {
90                         button : "openCalendar",
91                         inputField : "expirationdate",
92                         ifFormat : "[% DHTMLcalendar_dateformat %]"
93                     }
94                     );
95                 </script>
96                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
97             </li>
98             <li>
99                 <label for="number">Appear in position </label>
100                 [% IF ( number ) %]
101                     <input id="number" size="3" name="number" type="text" checked="checked" value="[% number %]" />
102                 [% ELSE %]
103                     <input id="number" size="3" name="number" type="text" />
104                 [% END %]
105             </li>
106             <li><label for="new">News</label>
107             <textarea name="new" id="new"  cols="75" rows="10">[% new %]</textarea></li>
108             </ol>
109                         </fieldset>
110   
111                 <fieldset class="action"><input class="button" type="submit" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/tools/koha-news.pl">Cancel</a></fieldset>
112         </form>
113     [% ELSE %]
114         <div style="margin-bottom:5px;">
115         <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
116             <label for="lang">Display Location:</label>
117             <select name="lang" id="lang">
118             <option value="">All</option>
119             <option value="koha">Librarian interface</option>
120             <option value="slip">Slip</option>
121                 [% FOREACH lang_lis IN lang_list %]
122                     [% IF ( lang_lis.selected ) %]
123                         <option value="[% lang_lis.language %]" selected="selected">
124                     [% ELSE %]
125                         <option value="[% lang_lis.language %]">
126                     [% END %]
127                         OPAC ([% lang_lis.language %])
128                     </option>
129                 [% END %]
130             </select>
131             <input type="submit" class="button" value="Filter" />
132         </form>
133         </div>
134         [% IF ( opac_news_count ) %]
135         <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?')">
136                 <table id="newst">
137                    <thead> <tr>
138                         <th>&nbsp;</th>
139                         <th>Location</th>
140                         <th>Number</th>
141                         <th>Creation&nbsp;Date</th>
142                         <th>Expiration&nbsp;Date</th>
143                         <th>Title</th>
144                         <th>News</th>
145                         <th>&nbsp;</th>
146                     </tr></thead>
147                     <tbody>[% FOREACH opac_new IN opac_news %]
148                          [% IF ( opac_new.expired ) %]
149                             <tr class="expired">
150                             [% ELSE %]
151                             <tr>
152                             [% END %]
153                             <td>
154                                 <input type="checkbox" name="ids" value="[% opac_new.idnew %]" />
155                             </td>
156                             <td>[% IF ( lang == 'koha' ) %]
157                                     Librarian interface
158                                  [% ELSE %]
159                                     [% IF ( lang == 'slip' ) %]
160                                         Slip
161                                     [% ELSE %]
162                                         OPAC
163                                     [% END %]
164                                  [% END %]
165                              </td>
166
167                             <td>[% opac_new.number %]</td>
168                             <td>[% opac_new.newdate %]</td>
169                             <td>[% opac_new.expirationdate %] [% IF ( opac_new.expired ) %](<span class="expired">expired</span>)[% END %]</td>
170                             <td>[% opac_new.title %]</td>
171                            <td>
172                                 [% opac_new.new %]
173                             </td>
174                             <td><a href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&amp;id=[% opac_new.idnew %]">Edit</a></td>
175                         </tr>
176                     [% END %]</tbody>
177                 </table>
178                 <input type="hidden" name="op" value="del" />
179                 <fieldset class="action"><input type="submit" class="button" value="Delete selected" /></fieldset>
180             </form>
181         [% ELSE %]
182             <p>No news loaded</p>
183         [% END %]
184     [% END %]
185 </div>
186 </div>
187 [% UNLESS ( add_form ) %]
188     <div class="yui-b noprint">
189         [% INCLUDE 'tools-menu.inc' %]
190     </div>
191 [% END %]
192 </div>
193 [% INCLUDE 'intranet-bottom.inc' %]