Letters / alert system, continuing...
[wip/koha-chris_n.git] / koha-tmpl / intranet-tmpl / default / en / bull / subscription-add.tmpl
1 <!-- TMPL_INCLUDE NAME="bull-top.inc" -->
2 <!--------------------------MAIN BODY OF PAGE-------------------------->
3 <div id="mainbloc">
4 <!-- TMPL_IF name="mod" -->
5         <h1 class="bull">Modify subscription</h1>
6         <form method="post" name="f" action="subscription-detail.pl">
7                 <input type="hidden" name="op" value="modsubscription">
8                 <input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->">
9 <!-- TMPL_ELSE -->
10         <h1 class="bull">Add a subscription</h1>
11         <form method="post" name="f">
12 <!-- /TMPL_IF -->
13 <div id="bloc25">
14         <h2 class="bull">Subscription information</h2>
15                 <input type="hidden" name="op" value="addsubscription">
16                 <input type="hidden" name="user" value="<!-- TMPL_VAR name="user" -->">
17                 <p>Librarian</td><td> <!-- TMPL_VAR name="user" --></p>
18                 <p><label class="label100">Supplier</label><input type="text" name="aqbooksellerid" value="<!-- TMPL_VAR name="aqbooksellerid" -->" size=4> (<input type="text" name="aqbooksellername" value="<!-- TMPL_VAR name="aqbooksellername" -->" disabled readonly>)<a href="#" onClick="FindAcqui(f)">...</a></p>
19                 <p><label class="label100">Biblio</label><input type="text" name="biblionumber" value="<!-- TMPL_VAR name="biblionumber" -->" size=4> (<input type="text" name="title" value="<!-- TMPL_VAR name="bibliotitle" -->" disabled readonly>)<a href="#" onClick="Plugin(f)">...</a></p>
20                 <p><label class="label100">Notes</label><textarea name="notes" cols="30" rows="2"><!-- TMPL_VAR name="notes" --></textarea></p>
21                 <p><label class="label100">Enable issue alert</label>
22                         <select name="letter">
23                                 <option value=""></option>
24                                 <!-- TMPL_LOOP name="letters" -->
25                                         <!-- TMPL_IF name="selected" -->
26                                                 <option value="<!-- TMPL_VAR name="code" -->" selected><!-- TMPL_VAR name="name" --></option>
27                                         <!-- TMPL_ELSE -->
28                                                 <option value="<!-- TMPL_VAR name="code" -->"><!-- TMPL_VAR name="name" --></option>
29                                         <!-- /TMPL_IF -->
30                                 <!-- /TMPL_LOOP -->
31                         </select>
32                 </p>
33                 <p class="problem">warning</p>
34                 <ul>
35                         <li>remember you <b>must</b> have created a biblio <b>before</b> creating a subscription</li>
36                         <li>You also must have selected a supplier if you want to ask for late issues</li>
37                 </ul>
38 </div>
39 <div id="bloc25">
40         <h2 class="bull">Planning</h2>
41         <p><label class="label100">Beginnning date:</label> <input type="text" name="startdate" value="<!-- TMPL_VAR name="startdate" -->" size=13 maxlength=10></p>
42         <p><label class="label100">Frequency (*)</label>
43                         <select name="periodicity" size="1">
44                                 <option value="" selected>Unknown</option>
45                                 <!-- TMPL_IF name="periodicity1" -->
46                                         <option value="1" selected>1/day</option>
47                                 <!-- TMPL_ELSE -->
48                                         <option value="1">1/day</option>
49                                 <!-- /TMPL_IF -->
50                                 <!-- TMPL_IF name="periodicity2" -->
51                                         <option value="2" selected>1/week</option>
52                                 <!-- TMPL_ELSE -->
53                                         <option value="2">1/week</option>
54                                 <!-- /TMPL_IF -->
55                                 <!-- TMPL_IF name="periodicity3" -->
56                                         <option value="3" selected>1/2 weeks (2/month)</option>
57                                 <!-- TMPL_ELSE -->
58                                         <option value="3">1/2 weeks (2/months)</option>
59                                 <!-- /TMPL_IF -->
60                                 <!-- TMPL_IF name="periodicity4" -->
61                                         <option value="4" selected>1/3 weeks</option>
62                                 <!-- TMPL_ELSE -->
63                                         <option value="4">1/3 weeks</option>
64                                 <!-- /TMPL_IF -->
65                                 <!-- TMPL_IF name="periodicity5" -->
66                                         <option value="5" selected>1/month</option>
67                                 <!-- TMPL_ELSE -->
68                                         <option value="5">1/month</option>
69                                 <!-- /TMPL_IF -->
70                                 <!-- TMPL_IF name="periodicity6" -->
71                                         <option value="6" selected>1/2 months (6/year)</option>
72                                 <!-- TMPL_ELSE -->
73                                         <option value="6">1/2 months (6/year)</option>
74                                 <!-- /TMPL_IF -->
75                                 <!-- TMPL_IF name="periodicity7" -->
76                                         <option value="7" selected>1/3 months (1/quarter)</option>
77                                 <!-- TMPL_ELSE -->
78                                         <option value="7">1/3 months (1/quarter)</option>
79                                 <!-- /TMPL_IF -->
80                                 <!-- periodicity8 is 1/quarter, exactly like periodicity7 -->
81                                 <!-- TMPL_IF name="periodicity9" -->
82                                         <option value="9" selected>2/years</option>
83                                 <!-- TMPL_ELSE -->
84                                         <option value="9">2/years</option>
85                                 <!-- /TMPL_IF -->
86                                 <!-- TMPL_IF name="periodicity10" -->
87                                         <option value="10" selected>1/year</option>
88                                 <!-- TMPL_ELSE -->
89                                         <option value="10">1/year</option>
90                                 <!-- /TMPL_IF -->
91                                 <!-- TMPL_IF name="periodicity11" -->
92                                         <option value="11" selected>1/2 years</option>
93                                 <!-- TMPL_ELSE -->
94                                         <option value="11">1/2 years</option>
95                                 <!-- /TMPL_IF -->
96                         </select>
97         </p>
98         <p><label class="label100">Arrives on</label>
99                         <select name="dow" size="1">
100                                 <option value="">None</option>
101                                 <!-- TMPL_IF name="dow1" -->
102                                         <option value="1" selected>Monday</option>
103                                 <!-- TMPL_ELSE -->
104                                         <option value="1">Monday</option>
105                                 <!-- /TMPL_IF -->
106                                 <!-- TMPL_IF name="dow2" -->
107                                         <option value="2" selected>Tuesday</option>
108                                 <!-- TMPL_ELSE -->
109                                         <option value="2">Tuesday</option>
110                                 <!-- /TMPL_IF -->
111                                 <!-- TMPL_IF name="dow3" -->
112                                         <option value="3" selected>Wednesday</option>
113                                 <!-- TMPL_ELSE -->
114                                         <option value="3">Wednesday</option>
115                                 <!-- /TMPL_IF -->
116                                 <!-- TMPL_IF name="dow4" -->
117                                         <option value="4" selected>Thursday</option>
118                                 <!-- TMPL_ELSE -->
119                                         <option value="4">Thursday</option>
120                                 <!-- /TMPL_IF -->
121                                 <!-- TMPL_IF name="dow5" -->
122                                         <option value="5" selected>Friday</option>
123                                 <!-- TMPL_ELSE -->
124                                         <option value="5">Friday</option>
125                                 <!-- /TMPL_IF -->
126                                 <!-- TMPL_IF name="dow6" -->
127                                         <option value="6" selected>Saturday</option>
128                                 <!-- TMPL_ELSE -->
129                                         <option value="6">Saturday</option>
130                                 <!-- /TMPL_IF -->
131                                 <!-- TMPL_IF name="dow7" -->
132                                         <option value="7" selected>Sunday</option>
133                                 <!-- TMPL_ELSE -->
134                                         <option value="7">Sunday</option>
135                                 <!-- /TMPL_IF -->
136                         </select>
137 </div>
138 <div id="bloc25">
139         <h2 class="bull">Subscription length</h2>
140         <p>* fill 1 from :</p>
141         <ul>
142                 <p><label class="label100">Number of issues</label><input type="text" name="numberlength" value="<!-- TMPL_VAR name="numberlength" -->"></p>
143                 <p><label class="label100">Number of weeks</label><input type="text" name="weeklength" value="<!-- TMPL_VAR name="weeklength" -->"></p>
144                 <p><label class="label100">Number of months</label><input type="text" name="monthlength" value="<!-- TMPL_VAR name="monthlength" -->"></p>
145         </ul>
146 </div>
147 <div id="bloc25">
148         <h2 class="bull">Numbering calculation</h2>
149         <p>
150                 <p>Numbering formula: <input type="text" name="numberingmethod" value="<!-- TMPL_VAR name="numberingmethod" -->"></p>
151                 <table class="small">
152                         <tr>
153                                 <th class="bull">&nbsp;</th>
154                                 <th class="bull">X</th>
155                                 <th class="bull">Y</th>
156                                 <th class="bull">Z</th>
157                         </tr>
158                         <tr>
159                                 <td class="bull">Add</td>
160                                 <td>
161                                         <input type="text" name="add1" value="<!-- TMPL_VAR name="add1" -->">
162                                 </td>
163                                 <td>
164                                         <input type="text" name="add2" value="<!-- TMPL_VAR name="add2" -->">
165                                 </td>
166                                 <td>
167                                         <input type="text" name="add3" value="<!-- TMPL_VAR name="add3" -->">
168                                 </td>
169                         </tr>
170                         <tr>
171                                 <td class="bull">once every</td>
172                                 <td><input type="text" name="every1" value="<!-- TMPL_VAR name="every1" -->"></td>
173                                 <td><input type="text" name="every2" value="<!-- TMPL_VAR name="every2" -->"></td>
174                                 <td><input type="text" name="every3" value="<!-- TMPL_VAR name="every3" -->"></td>
175                         </tr>
176                         <tr>
177                                 <td class="bull">When more than</td>
178                                 <td><input type="text" name="whenmorethan1" value="<!-- TMPL_VAR name="whenmorethan1" -->"></td>
179                                 <td><input type="text" name="whenmorethan2" value="<!-- TMPL_VAR name="whenmorethan2" -->"></td>
180                                 <td><input type="text" name="whenmorethan3" value="<!-- TMPL_VAR name="whenmorethan3" -->"></td>
181                         </tr>
182                         <!-- TMPL_IF name="mod" -->
183                         <tr>
184                                 <td class="bull">The loop is for instance</td>
185                                 <td><input type="text" name="innerloop1" value="<!-- TMPL_VAR name="innerloop1" -->"></td>
186                                 <td><input type="text" name="innerloop2" value="<!-- TMPL_VAR name="innerloop2" -->"></td>
187                                 <td><input type="text" name="innerloop3" value="<!-- TMPL_VAR name="innerloop3" -->"></td>
188                         </tr>
189                         <!-- /TMPL_IF -->
190                         <tr>
191                                 <td class="bull">Set back to</td>
192                                 <td><input type="text" name="setto1" value="<!-- TMPL_VAR name="setto1" -->"></td>
193                                 <td><input type="text" name="setto2" value="<!-- TMPL_VAR name="setto2" -->"></td>
194                                 <td><input type="text" name="setto3" value="<!-- TMPL_VAR name="setto3" -->"></td>
195                         </tr>
196                         <tr>
197                                 <td class="bull">
198                                         <!-- TMPL_IF name="mod" -->
199                                                 Last value
200                                         <!-- TMPL_ELSE -->
201                                                 Begins with
202                                         <!-- /TMPL_IF -->
203                                 </td>
204                                 <td><input type="text" name="lastvalue1" value="<!-- TMPL_VAR name="lastvalue1" -->"></td>
205                                 <td><input type="text" name="lastvalue2" value="<!-- TMPL_VAR name="lastvalue2" -->"></td>
206                                 <td><input type="text" name="lastvalue3" value="<!-- TMPL_VAR name="lastvalue3" -->"></td>
207                         </tr>
208                 </table>
209         </p>
210 </div>
211 <!-- TMPL_IF name="mod" -->
212         <input type="button" value="Save subscription" onclick="Check(this.form)" accesskey="w" class="button bull">
213 <!-- TMPL_ELSE -->
214         <input type="button" value="Add subscription" onclick="Check(this.form)" accesskey="w" class="button bull">
215 <!-- /TMPL_IF -->
216 </div>
217
218 </form>
219 <!-- TMPL_INCLUDE NAME="bull-bottom.inc" -->
220
221 <script language="JavaScript" type="text/javascript">
222
223 function Plugin(f)
224 {
225          window.open("subscription-bib-search.pl","Find a bib index",'width=500,height=400,toolbar=false,scrollbars=yes');
226 }
227
228 function FindAcqui(f)
229 {
230          window.open("acqui-search.pl","Find a supplier",'width=500,height=400,toolbar=false,scrollbars=yes');
231 }
232
233
234 function Check(f)
235 {
236         if (f.startdate.value.length != 0 && 
237                         f.numberlength.value+f.weeklength.value+f.monthlength.value > 0)
238                 {
239                         document.f.submit();
240                 }
241 else
242 {
243         alert('field marked with * are mandatory');
244 }
245         return false;
246 }
247 </script>