[MT1234] Code cleaning
[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="booksellername" --></a>
61     &rsaquo;
62     <!-- TMPL_IF NAME="add_form" -->
63         <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=<!-- TMPL_VAR  NAME="booksellerid" -->">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?booksellerid=<!-- TMPL_VAR  NAME="booksellerid" -->">Contracts</a>
71         &rsaquo; Data recorded
72     <!-- /TMPL_IF -->
73     <!-- TMPL_IF NAME="delete_confirm" -->
74         <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=<!-- TMPL_VAR  NAME="booksellerid" -->">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?booksellerid=<!-- TMPL_VAR  NAME="booksellerid" -->">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" --> for <!-- TMPL_VAR NAME="booksellername" --></h1>
93                         <!-- TMPL_ELSE -->
94                             <h1>New contract for <!-- TMPL_VAR NAME="booksellername" --></h1>
95                         <!-- /TMPL_IF -->
96                         <fieldset class="rows">
97                             <ol>
98                                 <!-- TMPL_IF NAME="contractnumber" -->
99                                         <li><span class="label">Contract id </span><!-- TMPL_VAR NAME="contractnumber" -->
100                                             <input type="hidden" name="contractnumber" value="<!-- TMPL_VAR NAME="contractnumber" -->" />
101                                             <input type="hidden" name="is_a_modif" value="1" />
102                                         </li>
103                                 <!-- /TMPL_IF -->
104                                 <li><label for="contractname" class="required">Name *</label> &nbsp;
105                                         <input type="text" name="contractname" id="contractname" size="40" maxlength="80" value="<!-- TMPL_VAR NAME="contractname" -->" />
106                                 </li>
107                                 <li><label for="contractdescription">Description</label> &nbsp;
108                                         <input type="text" name="contractdescription" id="contractdescription" size="40" maxlength="80" value="<!-- TMPL_VAR NAME="contractdescription" -->" />
109                                 </li>
110                                 <li><label for="booksellerid">Vendor</label>
111                                 <select id="booksellerid" name="booksellerid">
112                                 <!-- TMPL_LOOP NAME="booksellerloop" -->
113                                     <!-- TMPL_IF NAME="selected" -->
114                                         <option value="<!-- TMPL_VAR NAME="id" -->" selected="selected"><!-- TMPL_VAR NAME="name" --></option>
115                                     <!-- TMPL_ELSE -->
116                                         <option value="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="name" --></option>
117                                     <!-- /TMPL_IF -->
118                                 <!-- /TMPL_LOOP -->
119                                 </select>
120                                 </li>
121                                 <li><label for="contractstartdate" class="required">Start date *</label> &nbsp;
122                                         <input type="text" name="contractstartdate" id="contractstartdate" value="<!-- TMPL_VAR NAME="contractstartdate" -->" maxlength="10"  size="10"/>
123                                         <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="contractstartdate_button" alt="Show Calendar" />
124                                         <script language="JavaScript" type="text/javascript">
125                                             Calendar.setup(
126                                             {
127                                             inputField : "contractstartdate",
128                                             ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
129                                             button : "contractstartdate_button"
130                                             }
131                                             );
132                                         </script>
133                                 </li>
134                                 <li><label for="contractenddate" class="required">End date *</label> &nbsp;
135                                         <input type="text" name="contractenddate" id="contractenddate" value="<!-- TMPL_VAR NAME="contractenddate" -->" maxlength="10"  size="10" />
136                                         <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="contractenddate_button" alt="Show Calendar" />
137                                         <script language="JavaScript" type="text/javascript">
138                                             Calendar.setup(
139                                             {
140                                             inputField : "contractenddate",
141                                             ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
142                                             button : "contractenddate_button"
143                                             }
144                                             );
145                                         </script>
146                                 </li>
147                             </ol>
148                         </fieldset>
149                         <fieldset class="action">
150                             <input type="button" value="Save" onclick="Check(this.form);" />
151                         </fieldset>
152                     </form>
153             <!-- /TMPL_IF -->
154             <!-- TMPL_IF NAME="add_validate" -->
155                 <h3>Data recorded</h3>
156                 <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
157                     <input type="submit" value="OK" />
158                 </form>
159             <!-- /TMPL_IF -->
160             <!-- TMPL_IF NAME="delete_confirm" -->
161                 <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
162                     <fieldset>
163                         <legend>Confirm Deletion of Contract <!-- TMPL_VAR NAME="contractnumber" --></legend>
164                         <table>
165                             <tr><th scope="row">Contract number:</th><td><!-- TMPL_VAR NAME="contractnumber" --></td></tr>
166                             <tr><th scope="row">Contract name:</th><td><!-- TMPL_VAR NAME="contractname" --></td></tr>
167                             <tr><th scope="row">Contract description:</th><td><!-- TMPL_VAR NAME="contractdescription" --></td></tr>
168                             <tr><th scope="row">Contract start date:</th><td><!-- TMPL_VAR NAME="contractstartdate" --></td></tr>
169                             <tr><th scope="row">Contract end date:</th><td><!-- TMPL_VAR NAME="contractenddate" --></td></tr>
170                             <tr><th scope="row">Vendor:</th><td><!-- TMPL_VAR NAME="booksellername" --></td></tr>
171                         </table>
172                         <fieldset class="action">
173                             <input type="hidden" name="op" value="delete_confirmed" />
174                             <input type="hidden" name="booksellerid" value="<!-- TMPL_VAR name="booksellerid" -->" />
175                             <input type="hidden" name="contractnumber" value="<!-- TMPL_VAR NAME="contractnumber" -->" />
176                             <input type="submit" value="Delete this Contract" />
177                             <a class="cancel" href="/cgi-bin/koha/admin/aqcontract.pl">Cancel</a> 
178                         </fieldset>
179                     </fieldset>
180                 </form>
181             <!-- /TMPL_IF -->
182             <!-- TMPL_IF NAME="delete_confirmed" -->
183                 <h3>Contract Deleted</h3>
184                 <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
185                     <input type="hidden" name="booksellerid" value="<!-- TMPL_VAR name="booksellerid" -->/>
186                     <input type="submit" value="OK" />
187                 </form>
188             <!-- /TMPL_IF -->
189             <!-- TMPL_IF NAME="else" -->
190                 <div id="toolbar">
191                     <script type="text/javascript">
192                         //<![CDATA[
193                         // prepare DOM for YUI Toolbar
194                         $(document).ready(function() {
195                         yuiToolbar();
196                         });
197                         // YUI Toolbar Functions
198                         function yuiToolbar() {
199                         new YAHOO.widget.Button("newcontract");
200                         }
201                         //]]>
202                     </script>
203                     <ul class="toolbar">
204                         <li><a id="newcontract" href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&amp;booksellerid=<!-- TMPL_VAR name="booksellerid" -->">New Contract</a></li>
205                     </ul>
206                 </div>
207                 <h2>Contract(s) of <!-- TMPL_VAR name="booksellername" --></h2>
208                 <!-- TMPL_IF name="loop" -->
209                     <table>
210                         <tr>
211                             <th scope="col">Name</th>
212                             <th scope="col">Description</th>
213                             <th scope="col">Start date</th>
214                             <th scope="col">End date</th>
215                             <th scope="col" colspan="2">&nbsp; </th>
216                         </tr>
217                     <!-- TMPL_LOOP NAME="loop" -->
218                         <!-- TMPL_IF NAME="__even__" --><tr class="highlight"><!-- TMPL_ELSE --><tr><!-- /TMPL_IF -->
219                         <td>
220                             <a href="<!-- TMPL_VAR NAME="script_name" -->?op=add_form&amp;contractnumber=<!-- TMPL_VAR NAME="contractnumber" -->"><!-- TMPL_VAR NAME="contractname" --></a>
221                         </td>
222                         <td><!-- TMPL_VAR NAME="contractdescription" --></td>
223                         <td><!-- TMPL_VAR NAME="contractstartdate" --></td>
224                         <td><!-- TMPL_VAR NAME="contractenddate" --></td>
225                         <td><a href="<!-- TMPL_VAR NAME="script_name" -->?op=add_form&amp;contractnumber=<!-- TMPL_VAR NAME="contractnumber" -->&amp;booksellerid=<!-- TMPL_VAR name="booksellerid" -->">Edit</a></td>
226                         <td><a href="<!-- TMPL_VAR NAME="script_name" -->?op=delete_confirm&amp;contractnumber=<!-- TMPL_VAR NAME="contractnumber" -->&amp;booksellerid=<!-- TMPL_VAR name="booksellerid" -->">Delete</a></td>
227                         </tr>
228                     <!-- /TMPL_LOOP -->
229                 </table>
230                 <!-- /TMPL_IF -->
231             <!-- /TMPL_IF -->
232         </div>
233     </div>
234     <div class="yui-b">
235         <!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
236     </div>
237 </div>
238 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->