[replace previous] fix for 3612 (bookseller improvements)
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / aqcontract.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Administration &rsaquo; Contracts &rsaquo;
3 <!-- TMPL_IF NAME="add_form" -->
4     <!-- TMPL_IF NAME="contractnumber" -->Modify contract '<!-- TMPL_VAR NAME="contractname" -->'
5 <!-- TMPL_ELSE -->New contract<!-- /TMPL_IF -->
6 <!-- /TMPL_IF -->
7 <!-- TMPL_IF NAME="add_validate" -->Data recorded<!-- /TMPL_IF -->
8 <!-- TMPL_IF NAME="delete_confirm" -->Confirm Deletion of Contract '<!-- TMPL_VAR NAME="contractnumber" -->'<!-- /TMPL_IF -->
9 <!-- TMPL_IF NAME="delete_confirmed" -->Contract Deleted<!-- /TMPL_IF --></title>
10 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
11 <!-- TMPL_INCLUDE NAME="calendar.inc" -->
12 <script type="text/javascript" src="<!-- TMPL_VAR NAME='themelang' -->/js/acq.js"></script>
13 <script type="text/javascript">
14 //<![CDATA[
15 // to check if the data are correctly entered.
16 function Check(ff) {
17     var ok=0;
18     var _alertString=_("Form not submitted because of the following problem(s)\n");
19     _alertString +="-------------------------------------------------------------------\n\n";
20     if (!(isNotNull(ff.contractname,0))){
21         ok=1;
22         _alertString += _("- Name missing\n");
23     }
24     if (!(CheckDate(ff.contractstartdate))){
25         ok=1;
26         _alertString += _("- Start date missing\n");
27     }
28     if (!(CheckDate(ff.contractenddate))){
29         ok=1;
30         _alertString += _("- End date missing\n");
31     }
32     
33     if (!CompareDate(ff.contractstartdate.value, ff.contractenddate.value)) {
34         ok=1;
35         _alertString += _("Wrong date! start date can not be after end date.\n");
36     }
37     if (! CheckEndDate(ff.contractenddate.value)) {
38         ok=1;
39         _alertString += _("End date before today, Invalid end date!\n");
40     }
41     if (ok) { // if there is a problem
42         alert(_alertString);
43     return false;
44 }
45 // if all is good
46     ff.submit();
47 }
48 //]]>
49 </script>
50 </head>
51 <body>
52 <!-- TMPL_INCLUDE NAME="header.inc" -->
53 <!-- TMPL_INCLUDE NAME="contracts-admin-search.inc" -->
54
55 <div id="breadcrumbs">
56     <a href="/cgi-bin/koha/mainpage.pl">Home</a>
57     &rsaquo;
58     <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
59     &rsaquo;
60     <a href="/cgi-bin/koha/acqui/supplier.pl?supplierid=<!--TMPL_VAR name="booksellerid" -->"><!-- TMPL_VAR name="name" --></a>
61     &rsaquo;
62     <!-- TMPL_IF NAME="add_form" -->
63         <a href="/cgi-bin/koha/admin/aqcontract.pl">Contracts</a>
64         &rsaquo;
65         <!-- TMPL_IF NAME="contractnumber" -->Modify contract '<!-- TMPL_VAR NAME="contractname" -->'
66         <!-- TMPL_ELSE -->New contract
67         <!-- /TMPL_IF -->
68     <!-- /TMPL_IF -->
69     <!-- TMPL_IF NAME="add_validate" -->
70         <a href="/cgi-bin/koha/admin/aqcontract.pl">Contracts</a>
71         &rsaquo; Data recorded
72     <!-- /TMPL_IF -->
73     <!-- TMPL_IF NAME="delete_confirm" -->
74         <a href="/cgi-bin/koha/admin/aqcontract.pl">Contracts</a>
75         &rsaquo; Confirm Deletion of Contract <!-- TMPL_VAR NAME="contractnumber" -->
76     <!-- /TMPL_IF -->
77     <!-- TMPL_IF NAME="delete_confirmed" -->
78         <a href="/cgi-bin/koha/admin/aqcontract.pl">Contracts</a> &rsaquo; Contract Deleted
79     <!-- /TMPL_IF -->
80     <!-- TMPL_IF NAME="else" -->Contracts<!-- /TMPL_IF -->
81 </div>
82
83 <div id="doc3" class="yui-t2">
84     <div id="bd">
85         <div id="yui-main">
86             <div class="yui-b">
87                 <!-- TMPL_IF NAME="add_form" -->
88                     <form name="Aform" action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
89                         <input type="hidden" name="op" value="add_validate" />
90                         <input type="hidden" name="checked" value="0" />
91                         <!-- TMPL_IF NAME="contractnumber" -->
92                             <h1>Modify contract <!-- TMPL_VAR NAME="contractname" -->
93                                 <select id="booksellerid" name="booksellerid">
94                                 <!-- TMPL_LOOP NAME="booksellerloop" -->
95                                     <!-- TMPL_IF NAME="selected" -->
96                                         <option value="<!-- TMPL_VAR NAME="id" -->" selected="selected"><!-- TMPL_VAR NAME="name" --></option>
97                                     <!-- TMPL_ELSE -->
98                                         <option value="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="name" --></option>
99                                     <!-- /TMPL_IF -->
100                                 <!-- /TMPL_LOOP -->
101                                 </select>
102                             </h1>
103                         <!-- TMPL_ELSE -->
104                             <h1>New contract 
105                                 <select id="booksellerid" name="booksellerid">
106                                 <!-- TMPL_LOOP NAME="booksellerloop" -->
107                                     <!-- TMPL_IF NAME="selected" -->
108                                         <option value="<!-- TMPL_VAR NAME="id" -->" selected="selected"><!-- TMPL_VAR NAME="name" --></option>
109                                     <!-- TMPL_ELSE -->
110                                         <option value="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="name" --></option>
111                                     <!-- /TMPL_IF -->
112                                 <!-- /TMPL_LOOP -->
113                                 </select>
114                             </h1>
115                         <!-- /TMPL_IF -->
116                         <fieldset class="rows">
117                             <ol>
118                                 <!-- TMPL_IF NAME="contractnumber" -->
119                                         <li><span class="label">Contract id </span><!-- TMPL_VAR NAME="contractnumber" -->
120                                             <input type="hidden" name="contractnumber" value="<!-- TMPL_VAR NAME="contractnumber" -->" />
121                                             <input type="hidden" name="is_a_modif" value="1" />
122                                         </li>
123                                 <!-- /TMPL_IF -->
124                                 <li><label for="contractname" class="required">Name *</label> &nbsp;
125                                         <input type="text" name="contractname" id="contractname" size="40" maxlength="80" value="<!-- TMPL_VAR NAME="contractname" -->" />
126                                 </li>
127                                 <li><label for="contractdescription">Description</label> &nbsp;
128                                         <input type="text" name="contractdescription" id="contractdescription" size="40" maxlength="80" value="<!-- TMPL_VAR NAME="contractdescription" -->" />
129                                 </li>
130                                 <li><label for="booksellerid">Bookseller</label>
131
132                                 </li>
133                                 <li><label for="contractstartdate" class="required">Start date *</label> &nbsp;
134                                         <input type="text" name="contractstartdate" id="contractstartdate" value="<!-- TMPL_VAR NAME="contractstartdate" -->" maxlength="10"  size="10"/>
135                                         <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="contractstartdate_button" alt="Show Calendar" />
136                                         <script language="JavaScript" type="text/javascript">
137                                             Calendar.setup(
138                                             {
139                                             inputField : "contractstartdate",
140                                             ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
141                                             button : "contractstartdate_button"
142                                             }
143                                             );
144                                         </script>
145                                 </li>
146                                 <li><label for="contractenddate" class="required">End date *</label> &nbsp;
147                                         <input type="text" name="contractenddate" id="contractenddate" value="<!-- TMPL_VAR NAME="contractenddate" -->" maxlength="10"  size="10" />
148                                         <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="contractenddate_button" alt="Show Calendar" />
149                                         <script language="JavaScript" type="text/javascript">
150                                             Calendar.setup(
151                                             {
152                                             inputField : "contractenddate",
153                                             ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
154                                             button : "contractenddate_button"
155                                             }
156                                             );
157                                         </script>
158                                 </li>
159                             </ol>
160                         </fieldset>
161                         <fieldset class="action">
162                             <input type="button" value="Save" onclick="Check(this.form);" />
163                         </fieldset>
164                     </form>
165             <!-- /TMPL_IF -->
166             <!-- TMPL_IF NAME="add_validate" -->
167                 <h3>Data recorded</h3>
168                 <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
169                     <input type="submit" value="OK" />
170                 </form>
171             <!-- /TMPL_IF -->
172             <!-- TMPL_IF NAME="delete_confirm" -->
173                 <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
174                     <fieldset>
175                         <legend>Confirm Deletion of Contract <!-- TMPL_VAR NAME="contractnumber" --></legend>
176                         <table>
177                             <tr><th scope="row">contractnumber:</th><td><!-- TMPL_VAR NAME="contractnumber" --></td></tr>
178                             <tr><th scope="row">Contract Name:</th><td><!-- TMPL_VAR NAME="contractname" --></td></tr>
179                             <tr><th scope="row">Contract Description:</th><td><!-- TMPL_VAR NAME="contractdescription" --></td></tr>
180                             <tr><th scope="row">contractstartdate:</th><td><!-- TMPL_VAR NAME="contractstartdate" --></td></tr>
181                             <tr><th scope="row">contractenddate:</th><td><!-- TMPL_VAR NAME="contractenddate" --></td></tr>
182                             <tr><th scope="row">bookseller:</th><td><!-- TMPL_VAR NAME="booksellername" --></td></tr>
183                         </table>
184                         <fieldset class="action">
185                             <input type="hidden" name="op" value="delete_confirmed" />
186                             <input type="hidden" name="booksellerid" value="<!-- TMPL_VAR name="booksellerid" -->" />
187                             <input type="hidden" name="contractnumber" value="<!-- TMPL_VAR NAME="contractnumber" -->" />
188                             <input type="submit" value="Delete this Contract" />
189                             <a class="cancel" href="/cgi-bin/koha/admin/aqcontract.pl">Cancel</a> 
190                         </fieldset>
191                     </fieldset>
192                 </form>
193             <!-- /TMPL_IF -->
194             <!-- TMPL_IF NAME="delete_confirmed" -->
195                 <h3>Contract Deleted</h3>
196                 <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
197                     <input type="hidden" name="booksellerid" value="<!-- TMPL_VAR name="booksellerid" -->/>
198                     <input type="submit" value="OK" />
199                 </form>
200             <!-- /TMPL_IF -->
201             <!-- TMPL_IF NAME="else" -->
202                 <div id="toolbar">
203                     <script type="text/javascript">
204                         //<![CDATA[
205                         // prepare DOM for YUI Toolbar
206                         $(document).ready(function() {
207                         yuiToolbar();
208                         });
209                         // YUI Toolbar Functions
210                         function yuiToolbar() {
211                         new YAHOO.widget.Button("newcontract");
212                         }
213                         //]]>
214                     </script>
215                     <ul class="toolbar">
216                         <li><a id="newcontract" href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&booksellerid=<!-- TMPL_VAR name="booksellerid" -->">New Contract</a></li>
217                     </ul>
218                 </div>
219                 <h2>Contract(s) of <!-- TMPL_VAR name="name" --></h2>
220                 <!-- TMPL_IF name="loop" -->
221                     <table>
222                         <tr>
223                             <th scope="col">Name</th>
224                             <th scope="col">Description</th>
225                             <th scope="col">Start date</th>
226                             <th scope="col">End date</th>
227                             <th scope="col" colspan="2">&nbsp; </th>
228                         </tr>
229                     <!-- TMPL_LOOP NAME="loop" -->
230                         <!-- TMPL_IF NAME="toggle" -->
231                             <tr class="highlight">
232                         <!-- TMPL_ELSE -->
233                             <tr>
234                         <!-- /TMPL_IF -->
235                             <td>
236                                 <a href="<!-- TMPL_VAR NAME="script_name" -->?op=add_form&amp;contractnumber=<!-- TMPL_VAR NAME="contractnumber" -->"><!-- TMPL_VAR NAME="contractname" --></a>
237                         </td>
238                         <td><!-- TMPL_VAR NAME="contractdescription" --></td>
239                         <td><!-- TMPL_VAR NAME="contractstartdate" --></td>
240                         <td><!-- TMPL_VAR NAME="contractenddate" --></td>
241                         <td><a href="<!-- TMPL_VAR NAME="script_name" -->?op=add_form&amp;contractnumber=<!-- TMPL_VAR NAME="contractnumber" -->&booksellerid=<!-- TMPL_VAR name="booksellerid" -->">Edit</a></td>
242                         <td><a href="<!-- TMPL_VAR NAME="script_name" -->?op=delete_confirm&amp;contractnumber=<!-- TMPL_VAR NAME="contractnumber" -->&booksellerid=<!-- TMPL_VAR name="booksellerid" -->">Delete</a></td>
243                         </tr>
244                     <!-- /TMPL_LOOP -->
245                 </table>
246                 <!-- /TMPL_IF -->
247             <!-- /TMPL_IF -->
248         </div>
249     </div>
250     <div class="yui-b">
251         <!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
252     </div>
253 </div>
254 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->