kohabug 1993 - task scheduler improvements
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / letter.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Tools &rsaquo; Notices<!-- TMPL_IF NAME="add_form" --><!-- TMPL_IF name="modify" --> &rsaquo; Modify notice<!-- TMPL_ELSE --> &rsaquo; Add notice<!-- /TMPL_IF --><!-- /TMPL_IF --><!-- TMPL_IF NAME="add_validate" --> &rsaquo; Notice added<!-- /TMPL_IF --><!-- TMPL_IF NAME="delete_confirm" --> &rsaquo; Confirm Deletion<!-- /TMPL_IF --></title>
3 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
5         <script type="text/javascript">
6         //<![CDATA[
7 $(document).ready(function() {
8         $("#lettert").tablesorter({
9                 widgets : ['zebra'],
10                 sortList: [[0,0]],
11                 headers: { 3: {sorter:false},4: { sorter: false }}
12         }); 
13 }); 
14 <!-- TMPL_IF NAME="add_form" -->
15         
16                 function isNotNull(f,noalert) {
17                         if (f.value.length ==0) {
18         return false;
19                         }
20                         return true;
21                 }
22         
23                 function toUC(f) {
24                         var x=f.value.toUpperCase();
25                         f.value=x;
26                         return true;
27                 }
28         
29                 function isNum(v,maybenull) {
30                 var n = new Number(v.value);
31                 if (isNaN(n)) {
32                         return false;
33                         }
34                 if (maybenull==0 && v.value=='') {
35                         return false;
36                 }
37                 return true;
38                 }
39         
40                 function isDate(f) {
41                         var t = Date.parse(f.value);
42                         if (isNaN(t)) {
43                                 return false;
44                         }
45                 }
46         
47                 function Check(f) {
48                         var ok=1;
49                         var _alertString="";
50                         var alertString2;
51 /*                      if (!(isNotNull(window.document.Aform.code))) {
52                                 _alertString += "\n- " + _("Code missing");
53                         }*/
54 /*                      if (!(isNotNull(window.document.Aform.name))) {
55                                 _alertString += "\n- " + _("Name missing");
56                         }*/
57                         if (_alertString.length==0) {
58                                 document.Aform.submit();
59                         } else {
60                                 alertString2  = _("Form not submitted because of the following problem(s)");
61                                 alertString2 += "\n------------------------------------------------------------------------------------\n";
62                                 alertString2 += _alertString;
63                                 alert(alertString2);
64                         }
65                 }
66                 // GPL code coming from PhpMyAdmin
67                 function insertValueQuery() {
68                         var myQuery = document.Aform.content;
69                         var myListBox = document.Aform.SQLfieldname;
70                 
71                         if(myListBox.options.length > 0) {
72                                 var chaineAj = "";
73                                 var NbSelect = 0;
74                                 for(var i=0; i<myListBox.options.length; i++) {
75                                         if (myListBox.options[i].selected){
76                                                 NbSelect++;
77                                                 if (NbSelect > 1)
78                                                         chaineAj += ", ";
79                                                 chaineAj += myListBox.options[i].value;
80                                         }
81                                 }
82                 
83                                 //IE support
84                                 if (document.selection) {
85                                         myQuery.focus();
86                                         sel = document.selection.createRange();
87                                         sel.text = chaineAj;
88                                         document.Aform.insert.focus();
89                                 }
90                                 //MOZILLA/NETSCAPE support
91                                 else if (document.Aform.content.selectionStart || document.Aform.content.selectionStart == "0") {
92                                         var startPos = document.Aform.content.selectionStart;
93                                         var endPos = document.Aform.content.selectionEnd;
94                                         var chaineSql = document.Aform.content.value;
95                                         myQuery.value = chaineSql.substring(0, startPos) +'<<'+ chaineAj+'>>' + chaineSql.substring(endPos, chaineSql.length);
96                                 } else {
97                                         myQuery.value += chaineAj;
98                                 }
99                         }
100                 }
101         <!-- /TMPL_IF -->
102                 //]]>
103                 </script>
104 </head>
105 <body>
106 <!-- TMPL_INCLUDE NAME="header.inc" -->
107 <!-- TMPL_INCLUDE NAME="letters-search.inc" -->
108
109 <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; <!-- TMPL_IF NAME="add_form" --><!-- TMPL_IF name="modify" --><a href="/cgi-bin/koha/tools/letter.pl">Notices</a> &rsaquo; Modify notice<!-- TMPL_ELSE --> <a href="/cgi-bin/koha/tools/letter.pl">Notices</a> &rsaquo; Add notice<!-- /TMPL_IF --><!-- TMPL_ELSE --><!-- TMPL_IF NAME="add_validate" --> <a href="/cgi-bin/koha/tools/letter.pl">Notices</a> &rsaquo; Notice added<!-- TMPL_ELSE --><!-- TMPL_IF NAME="delete_confirm" --> <a href="/cgi-bin/koha/tools/letter.pl">Notices</a> &rsaquo; Confirm Deletion<!-- TMPL_ELSE -->Notices<!-- /TMPL_IF --><!-- /TMPL_IF --><!-- /TMPL_IF --></div>
110
111 <!-- TMPL_IF NAME="add_form" --><div id="doc" class="yui-t7"><!-- TMPL_ELSE --><div id="doc3" class="yui-t2"><!-- /TMPL_IF -->
112    
113    <div id="bd">
114         <div id="yui-main">
115         <div class="yui-b">
116
117         <!-- TMPL_IF NAME="else" -->
118 <div id="toolbar">
119         <script type="text/javascript">
120         //<![CDATA[
121         // prepare DOM for YUI Toolbar
122          $(document).ready(function() {
123             yuiToolbar();
124          });
125         // YUI Toolbar Functions
126         function yuiToolbar() {
127             new YAHOO.widget.Button("newnotice");
128         }
129         //]]>
130         </script>
131         <ul class="toolbar">
132         <li><a id="newnotice" href="/cgi-bin/koha/tools/letter.pl?op=add_form">New Notice</a></li>
133 </ul></div>
134                 
135                 <!-- TMPL_IF NAME="search" -->
136                 <p>You Searched for <b><!-- TMPL_VAR NAME="searchfield" --></b></p>
137                 <!-- /TMPL_IF -->
138                 <!-- TMPL_IF NAME="letter" --><table id="lettert">
139                 <thead><tr>
140                         <th>Module</th>
141                         <th>Code</th>
142                         <th>Name</th>
143                         <th>&nbsp;</th>
144                         <th>&nbsp;</th>
145                 </tr></thead>
146                 <tbody><!-- TMPL_LOOP NAME="letter" -->
147                 <!-- TMPL_IF NAME="toggle" --><tr class="highlight"><!-- TMPL_ELSE --><tr><!-- /TMPL_IF -->
148                                 <td><!-- TMPL_VAR NAME="module" --></td>
149                                 <td><!-- TMPL_VAR NAME="code" --></td>
150                                 <td><!-- TMPL_VAR NAME="name" --></td>
151                                 <td>
152                                         <a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=<!-- TMPL_VAR name="module" -->&amp;code=<!-- TMPL_VAR NAME="code" -->">Edit</a>
153                                 </td>
154                                 <td>
155                                         <a href="/cgi-bin/koha/tools/letter.pl?op=delete_confirm&amp;module=<!-- TMPL_VAR name="module"-->&amp;code=<!-- TMPL_VAR NAME="code" -->">Delete</a>
156                                 </td>
157                         </tr>
158                 <!-- /TMPL_LOOP --></tbody>
159                 </table>
160                 <!-- /TMPL_IF -->
161
162         <!-- /TMPL_IF -->
163         
164         <!-- TMPL_IF NAME="add_form" -->
165         
166         
167                 <form action="/cgi-bin/koha/tools/letter.pl" name="Aform" method="post">
168                 <input type="hidden" name="op" value="add_validate" />
169                 <input type="hidden" name="checked" value="0" />
170                 <!-- TMPL_IF name="modify" -->
171                 <input type="hidden" name="add" value="0" />
172                 <!-- TMPL_ELSE -->
173                 <input type="hidden" name="add" value="1" />
174                 <!-- /TMPL_IF -->
175                 <fieldset class="rows">
176                 <legend><!-- TMPL_IF name="modify" -->Modify notice<!-- TMPL_ELSE -->Add notice<!-- /TMPL_IF --></legend>
177                 <ol>
178                 <!-- TMPL_IF NAME="modify" -->
179                         <li>
180                                 <label for="module">Koha module:</label>
181                                 <select name="module" id="module">
182                                     <!--TMPL_IF Name="catalogue"-->
183                                     <option value="catalogue" selected="selected">Catalogue</option>
184                                     <!--TMPL_ELSE-->
185                                     <option value="catalogue" >Catalogue</option>
186                                     <!--/TMPL_IF-->
187                                     <!--TMPL_IF Name="Serial"-->
188                                     <option value="serial" selected="selected">Serials (Routing List)</option>
189                                     <!--TMPL_ELSE-->
190                                     <option value="serial">Serials (Routing List)</option>
191                                     <!--/TMPL_IF-->
192                                     <!--TMPL_IF Name="claimacquisition"-->
193                                     <option value="claimacquisition" selected="selected">Claim Acquisition</option>
194                                     <!--TMPL_ELSE-->
195                                     <option value="claimacquisition">Claim Acquisition</option>
196                                     <!--/TMPL_IF -->
197                                     <!--TMPL_IF Name="claimissues"-->
198                                     <option value="claimissues" selected="selected">Claim Serial Issue</option>
199                                     <!--TMPL_ELSE-->
200                                     <option value="claimissues">Claim Serial Issue</option>
201                                     <!--/TMPL_IF-->
202                                     <!--TMPL_IF Name="circulation"-->
203                                     <option value="circulation" selected="selected">Circulation</option>
204                                     <!--TMPL_ELSE-->
205                                     <option value="circulation">Circulation</option>
206                                     <!--/TMPL_IF-->
207                                     <!--TMPL_IF Name="members"-->
208                                     <option value="members" selected="selected">Members</option>
209                                     <!--TMPL_ELSE-->
210                                     <option value="members">Members</option>
211                                     <!--/TMPL_IF-->
212                                 </select>
213                         </li>
214                         <li>
215                                 <span class="label">Code:</span><input type="hidden" id="code" name="code" value="<!-- TMPL_VAR NAME="code" -->" /><!-- TMPL_VAR NAME="code" -->
216                         </li>
217                 <!-- /TMPL_IF -->
218                 
219                 <!-- TMPL_IF NAME="adding" -->
220                         <li>
221                                 <label for="module">Koha module:</label>
222                                 <select name="module" id="module" onchange="javascript:window.location.href = unescape(window.location.pathname)+'?op=add_form&amp;module='+this.value+'&amp;content='+window.document.forms['Aform'].elements['content'].value;">
223                                                 <!--TMPL_IF Name="catalogue"-->
224                         <option value="catalogue" selected="selected">Catalogue</option>
225                                                 <!--TMPL_ELSE-->
226                         <option value="catalogue" >Catalogue</option>
227                         <!--/TMPL_IF-->
228                                                 <!--TMPL_IF Name="serial"-->
229                                                 <option value="serial" selected="selected">Serials (Routing List)</option>
230                                                 <!--TMPL_ELSE-->
231                                                 <option value="serial">Serials (Routing List)</option>
232                                                 <!--/TMPL_IF-->
233                                                 <!--TMPL_IF Name="claimacquisition"-->
234                                                 <option value="claimacquisition" selected="selected">Claim Acquisition</option>
235                                                 <!--TMPL_ELSE-->
236                                                 <option value="claimacquisition">Claim Acquisition</option>
237                                                 <!--/TMPL_IF -->
238                                                 <!--TMPL_IF Name="claimissues"-->
239                                                 <option value="claimissues" selected="selected">Claim Serial Issues</option>
240                                                 <!--TMPL_ELSE-->
241                                                 <option value="claimissues">Claim Serial Issues</option>
242                                                 <!--/TMPL_IF-->
243                                                 <!--TMPL_IF Name="circulation"-->
244                                                 <option value="circulation" selected="selected">Circulation</option>
245                                                 <!--TMPL_ELSE-->
246                                                 <option value="circulation">Circulation</option>
247                                                 <!--/TMPL_IF-->
248                                                 <!--TMPL_IF Name="members"-->
249                                                 <option value="members" selected="selected">Members</option>
250                                                 <!--TMPL_ELSE-->
251                                                 <option value="members">Members</option>
252                                                 <!--/TMPL_IF-->
253                                 </select>
254                         </li>
255                         <li>
256                                 <label for="code">Code:</label><input type="text" id="code" name="code" size="20" maxlength="20" />
257                         </li>
258                 <!-- /TMPL_IF -->
259                 
260                 <li>
261                         <label for="name">Name:</label><input type="text" id="name" name="name" size="60" value="<!-- TMPL_VAR NAME="name" -->" />
262                 </li>
263                 <li>
264                         <label for="title">Message Subject:</label><input type="text" id="title" name="title" size="60" value="<!-- TMPL_VAR NAME="title" -->" />
265                 </li>
266                 <li>
267                         <label for="SQLfieldname">Message Body:</label>
268                 </li>
269                 <li>
270                 <table>
271                 <tr><td><select name="SQLfieldname" id="SQLfieldname" size="9">
272                         <!-- TMPL_LOOP name="SQLfieldname" -->
273                                 <option value="<!-- TMPL_VAR name="value"-->"><!-- TMPL_VAR name="text"--></option>
274                         <!-- /TMPL_LOOP -->
275                 </select></td><td><input type="button" name="insert" value="&gt;&gt;" onclick="insertValueQuery()" title="Insert" /></td><td><textarea name="content" cols="80" rows="15"><!-- TMPL_VAR NAME="content" --></textarea></td></tr></table>
276
277                 </li>
278                 </ol>
279                 </fieldset>
280                 <fieldset class="action"><input type="button" value="Submit" onclick="Check(this.form)" class="button" /></fieldset>
281                 </form>
282         <!-- /TMPL_IF -->
283         
284         <!-- TMPL_IF NAME="add_validate" -->
285         Data recorded
286         <form action="<!-- TMPL_VAR NAME="action" -->" method="post">
287         <input type="submit" value="OK" />
288         </form>
289         <!-- /TMPL_IF -->
290         
291         <!-- TMPL_IF NAME="delete_confirm" -->
292         <div class="dialog alert"><h3>Delete Notice?</h3>
293         <table>
294                 <tr>
295                         <td>
296                                 <b>module / Code</b>
297                         </td>
298                         <td>
299                                 <b><!-- TMPL_VAR name="module"--> / <!-- TMPL_VAR NAME="code" --></b>
300                         </td>
301                 </tr>
302                 <tr>
303                         <td>Name</td>
304                         <td><!-- TMPL_VAR NAME="Name" --></td>
305                 </tr>
306         </table>
307                 <form action="<!-- TMPL_VAR NAME="action" -->" method="post">
308                 <input type="hidden" name="op" value="delete_confirmed">
309                 <input type="hidden" name="code" value="<!-- TMPL_VAR NAME="code" -->" />
310                 <input type="hidden" name="module" value="<!-- TMPL_VAR NAME="module" -->" />
311                                 <input type="submit" value="Yes, Delete" class="approve" />
312                                 </form>
313
314                                 <form action="<!-- TMPL_VAR NAME="action" -->" method="get">
315                                         <input type="submit" value="No, Do Not Delete" class="deny" />
316                                 </form>
317                 </div>
318
319         <!-- /TMPL_IF -->
320         
321         <!-- TMPL_IF NAME="delete_confirmed" -->
322         Data deleted
323         <form action="<!-- TMPL_VAR NAME="action" -->" method="post">
324         <input type="submit" value="OK" />
325         </form>
326         <!-- /TMPL_IF -->
327
328 </div>
329 </div>
330 <!-- TMPL_UNLESS NAME="add_form" -->
331     <div class="yui-b noprint">
332         <!-- TMPL_INCLUDE NAME="tools-menu.inc" -->
333     </div>
334 <!-- /TMPL_UNLESS -->
335 </div>
336 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->