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