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