Modifications to enable YUI-Grids layout structure. Unfinished.
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / letter.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Letters Administration</title>
3 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4 <!-- TMPL_INCLUDE NAME="header.inc" -->
5
6 <!-- TMPL_INCLUDE NAME="menu-tools.inc" -->
7
8 <div id="doc3" class="yui-t2">
9    
10    <div id="bd">
11         <div id="yui-main">
12         <div class="yui-b"><div class="yui-g">
13
14         <!-- TMPL_IF NAME="else" -->
15                 <form action="/cgi-bin/koha/tools/letter.pl" method="post">
16                 <input type="text" name="searchfield" value="">
17                 <input type="submit" class="button" value="Filter"></form>
18                 <!-- TMPL_IF NAME="search" -->
19                 <br />You Searched for <b><!-- TMPL_VAR NAME="searchfield" --></b><p><br />
20                 <!-- /TMPL_IF -->
21                 <table>
22                 <tr>
23                         <th>Module</th>
24                         <th>Code</th>
25                         <th>Name</th>
26                         <th>&nbsp;</th>
27                         <th>&nbsp;</th>
28                 </tr>
29                 <!-- TMPL_LOOP NAME="letter" -->
30                         <tr bgcolor=<!-- TMPL_VAR NAME="toggle" --> >
31                                 <td><!-- TMPL_VAR NAME="module" --></td>
32                                 <td><!-- TMPL_VAR NAME="code" --></td>
33                                 <td><!-- TMPL_VAR NAME="name" --></td>
34                                 <td>
35                                         <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>
36                                 </td>
37                                 <td>
38                                         <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>
39                                 </td>
40                         </tr>
41                 <!-- /TMPL_LOOP -->
42                 </table>
43                 <form action="/cgi-bin/koha/tools/letter.pl" method="post">
44                         <input type="hidden" name="op" value="add_form">
45                         <br />
46                         <input type="submit" class="button" value="Add Letter" title="Add Letter" alt="Add Letter">
47                         <br />
48                 </form>
49                 <br clear="all">
50         <!-- /TMPL_IF -->
51         
52         <!-- TMPL_IF NAME="add_form" -->
53         <script language="javascript" type="text/javascript">
54                 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
55                 function isNotNull(f,noalert) {
56                         if (f.value.length ==0) {
57         return false;
58                         }
59                         return true;
60                 }
61                 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
62                 function toUC(f) {
63                         var x=f.value.toUpperCase();
64                         f.value=x;
65                         return true;
66                 }
67                 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
68                 function isNum(v,maybenull) {
69                 var n = new Number(v.value);
70                 if (isNaN(n)) {
71                         return false;
72                         }
73                 if (maybenull==0 && v.value=='') {
74                         return false;
75                 }
76                 return true;
77                 }
78                 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
79                 function isDate(f) {
80                         var t = Date.parse(f.value);
81                         if (isNaN(t)) {
82                                 return false;
83                         }
84                 }
85                 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
86                 function Check(f) {
87                         var ok=1;
88                         var _alertString="";
89                         var alertString2;
90 /*                      if (!(isNotNull(window.document.Aform.code))) {
91                                 _alertString += "\n- " + _("Code missing");
92                         }*/
93 /*                      if (!(isNotNull(window.document.Aform.name))) {
94                                 _alertString += "\n- " + _("Name missing");
95                         }*/
96                         if (_alertString.length==0) {
97                                 document.Aform.submit();
98                         } else {
99                                 alertString2  = _("Form not submitted because of the following problem(s)");
100                                 alertString2 += "\n------------------------------------------------------------------------------------\n";
101                                 alertString2 += _alertString;
102                                 alert(alertString2);
103                         }
104                 }
105                 // GPL code coming from PhpMyAdmin
106                 function insertValueQuery() {
107                         var myQuery = document.Aform.content;
108                         var myListBox = document.Aform.SQLfieldname;
109                 
110                         if(myListBox.options.length > 0) {
111                                 var chaineAj = "";
112                                 var NbSelect = 0;
113                                 for(var i=0; i<myListBox.options.length; i++) {
114                                         if (myListBox.options[i].selected){
115                                                 NbSelect++;
116                                                 if (NbSelect > 1)
117                                                         chaineAj += ", ";
118                                                 chaineAj += myListBox.options[i].value;
119                                         }
120                                 }
121                 
122                                 //IE support
123                                 if (document.selection) {
124                                         myQuery.focus();
125                                         sel = document.selection.createRange();
126                                         sel.text = chaineAj;
127                                         document.Aform.insert.focus();
128                                 }
129                                 //MOZILLA/NETSCAPE support
130                                 else if (document.Aform.content.selectionStart || document.Aform.content.selectionStart == "0") {
131                                         var startPos = document.Aform.content.selectionStart;
132                                         var endPos = document.Aform.content.selectionEnd;
133                                         var chaineSql = document.Aform.content.value;
134                                         myQuery.value = chaineSql.substring(0, startPos) +'<<'+ chaineAj+'>>' + chaineSql.substring(endPos, chaineSql.length);
135                                 } else {
136                                         myQuery.value += chaineAj;
137                                 }
138                         }
139                 }
140                 
141                 </script>
142         <!-- TMPL_IF name="modify" -->
143                         <h2 class="parameters">Modify letter</h2>
144                 <!-- TMPL_ELSE -->
145                         <h2 class="parameters">Add letter</h2>
146                 <!-- /TMPL_IF -->
147                 <form action="/cgi-bin/koha/tools/letter.pl" name="Aform" method="post">
148                 <input type="hidden" name="op" value="add_validate">
149                 <input type="hidden" name="checked" value="0">
150                 <!-- TMPL_IF NAME="modify" -->
151                         <p>
152                                 <label class="label100">Koha module:</label>
153                                 <select name="module">
154                                     <!--TMPL_IF Name="catalogue"-->
155                                     <option value="catalogue" selected="selected">Catalogue</option>
156                                     <!--TMPL_ELSE-->
157                                     <option value="catalogue" >Catalogue</option>
158                                     <!--/TMPL_IF-->
159                                     <!--TMPL_IF Name="Serial"-->
160                                     <option value="serial" selected="selected">Serial</option>
161                                     <!--TMPL_ELSE-->
162                                     <option value="serial">Serial</option>
163                                     <!--/TMPL_IF-->
164                                     <!--TMPL_IF Name="claimacquisition"-->
165                                     <option value="claimacquisition" selected="selected">Claim Acquisition</option>
166                                     <!--TMPL_ELSE-->
167                                     <option value="claimacquisition">Claim Acquisition</option>
168                                     <!--/TMPL_IF -->
169                                     <!--TMPL_IF Name="claimissues"-->
170                                     <option value="claimissues" selected="selected">Claim Issues</option>
171                                     <!--TMPL_ELSE-->
172                                     <option value="claimissues">Claim Issues</option>
173                                     <!--/TMPL_IF-->
174                                     <!--TMPL_IF Name="circulation"-->
175                                     <option value="circulation" selected="selected">Circulation</option>
176                                     <!--TMPL_ELSE-->
177                                     <option value="circulation">Circulation</option>
178                                     <!--/TMPL_IF-->
179                                     <!--TMPL_IF Name="members"-->
180                                     <option value="members" selected="selected">Members</option>
181                                     <!--TMPL_ELSE-->
182                                     <option value="members">Members</option>
183                                     <!--/TMPL_IF-->
184                                 </select>
185                         </p>
186                         <p>
187                                 <label class="label100">Code:</label><input type="hidden" name="code" value="<!-- TMPL_VAR NAME="code" -->"><!-- TMPL_VAR NAME="code" -->
188                         </p>
189                 <!-- /TMPL_IF -->
190                 
191                 <!-- TMPL_IF NAME="adding" -->
192                         <p>
193                                 <label class="label100">Koha module:</label>
194                                 <select name="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;">
195                                                 <!--TMPL_IF Name="catalogue"-->
196                         <option value="catalogue" selected="selected">Catalogue</option>
197                                                 <!--TMPL_ELSE-->
198                         <option value="catalogue" >Catalogue</option>
199                         <!--/TMPL_IF-->
200                                                 <!--TMPL_IF Name="serial"-->
201                                                 <option value="serial" selected="selected">Serial</option>
202                                                 <!--TMPL_ELSE-->
203                                                 <option value="serial">Serial</option>
204                                                 <!--/TMPL_IF-->
205                                                 <!--TMPL_IF Name="claimacquisition"-->
206                                                 <option value="claimacquisition" selected="selected">Claim Acquisition</option>
207                                                 <!--TMPL_ELSE-->
208                                                 <option value="claimacquisition">Claim Acquisition</option>
209                                                 <!--/TMPL_IF -->
210                                                 <!--TMPL_IF Name="claimissues"-->
211                                                 <option value="claimissues" selected="selected">Claim Issues</option>
212                                                 <!--TMPL_ELSE-->
213                                                 <option value="claimissues">Claim Issues</option>
214                                                 <!--/TMPL_IF-->
215                                                 <!--TMPL_IF Name="circulation"-->
216                                                 <option value="circulation" selected="selected">Circulation</option>
217                                                 <!--TMPL_ELSE-->
218                                                 <option value="circulation">Circulation</option>
219                                                 <!--/TMPL_IF-->
220                                                 <!--TMPL_IF Name="members"-->
221                                                 <option value="members" selected="selected">Members</option>
222                                                 <!--TMPL_ELSE-->
223                                                 <option value="members">Members</option>
224                                                 <!--/TMPL_IF-->
225                                 </select>
226                         </p>
227                         <p>
228                                 <label class="label100">Code:</label><input type="text" name="code" size="20" maxlength="20">
229                         </p>
230                 <!-- /TMPL_IF -->
231                 
232                 <p>
233                         <label class="label100">Name:</label><input type="text" name="name" size="60" value="<!-- TMPL_VAR NAME="name" -->">
234                 </p>
235                 <p>
236                         <label class="label100">Title (mail subject):</label><input type="text" name="title" size="60" value="<!-- TMPL_VAR NAME="title" -->">
237                 </p>
238                 <p>
239                         <label class="label100">Content (mail content):</label>
240                 </p>
241                 <p>             
242                 <select name="SQLfieldname" size="9">
243                         <!-- TMPL_LOOP name="SQLfieldname" -->
244                                 <option value="<!-- TMPL_VAR name="value"-->"><!-- TMPL_VAR name="text"--></option>
245                         <!-- /TMPL_LOOP -->
246                 </select>
247         <input type="button" name="insert" value="&gt;&gt;" onclick="insertValueQuery()" title="Insert" />
248         <textarea name="content" cols="100" rows="15"><!-- TMPL_VAR NAME="content" --></textarea>
249                 </p>
250                 <p><input type="button" value="OK" onclick="Check(this.form)" class="button"></p>
251                 </form>
252         <!-- /TMPL_IF -->
253         
254         <!-- TMPL_IF NAME="add_validate" -->
255         Data recorded
256         <form action="<!-- TMPL_VAR NAME="action" -->" method="post">
257         <input type="submit" value="OK">
258         </form>
259         <!-- /TMPL_IF -->
260         
261         <!-- TMPL_IF NAME="delete_confirm" -->
262         <table border="0" cellspacing="0" cellpadding="5">
263                 <tr valign="top" bgcolor="#99cc33">
264                         <td background="<!-- TMPL_VAR NAME="themelang" -->/images/background-mem.gif">
265                                 <b>module / Code</b>
266                         </td>
267                         <td background="<!-- TMPL_VAR NAME="themelang" -->/images/background-mem.gif">
268                                 <b><!-- TMPL_VAR name="module"--> / <!-- TMPL_VAR NAME="code" --></b>
269                         </td>
270                 </tr>
271         
272                 <form action="<!-- TMPL_VAR NAME="action" -->" method="post"><input type="hidden" name="op" value="delete_confirmed">
273                 <input type="hidden" name="code" value="<!-- TMPL_VAR NAME="code" -->">
274                 <input type="hidden" name="module" value="<!-- TMPL_VAR NAME="module" -->">
275                 <tr>
276                         <td>Name</td>
277                         <td><!-- TMPL_VAR NAME="Name" --></td>
278                 </tr>
279                 <tr>
280                         <td colspan="2" align="center">CONFIRM DELETION</td>
281                 </tr>
282                 <tr>
283                         <td>
284                                 <input type="submit" value="YES">
285                                 </form>
286                         </td>
287                         <td>
288                                 <form action="<!-- TMPL_VAR NAME="action" -->" method="post">
289                                         <input type="submit" value="NO">
290                                 </form>
291                         </td>
292                 </tr>
293         </table>
294         <!-- /TMPL_IF -->
295         
296         <!-- TMPL_IF NAME="delete_confirmed" -->
297         Data deleted
298         <form action="<!-- TMPL_VAR NAME="action" -->" method="post">
299         <input type="submit" value="OK">
300         </form>
301         <!-- /TMPL_IF -->
302
303 </div>
304 </div>
305 </div>
306
307 <!-- TMPL_INCLUDE NAME="mainmenu.inc" -->
308 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->