Bug 15413: Adding colons where appropriate
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / aqcontract.tt
1 [% USE KohaDates %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Acquisitions &rsaquo; Contracts &rsaquo;
4 [% IF ( add_form ) %]
5     [% IF ( contractnumber ) %]Modify contract '[% contractname %]'
6 [% ELSE %]New contract[% END %]
7 [% END %]
8 [% IF ( else ) %]Contracts of [% booksellername %][% END %]
9 [% IF ( add_validate ) %]Data recorded[% END %]
10 [% IF ( delete_confirm ) %]Confirm deletion of contract '[% contractnumber %]'[% END %]
11 [% IF ( delete_confirmed ) %]Contract deleted[% END %]</title>
12 [% INCLUDE 'doc-head-close.inc' %]
13 [% INCLUDE 'calendar.inc' %]
14 <script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
15 <script type="text/javascript">
16 //<![CDATA[
17 // to check if the data are correctly entered.
18 function Check(ff) {
19     var ok=0;
20     var _alertString=_("Form not submitted because of the following problem(s)");
21     _alertString +="\n-------------------------------------------------------------------\n\n";
22     if (!(isNotNull(ff.contractname,0))){
23         ok=1;
24         _alertString += _("- Name missing") + "\n";
25     }
26     var startDate = Date_from_syspref($("#from").val());
27     var endDate   = Date_from_syspref($("#to").val());
28     if (!parseInt(startDate.getTime())) {
29         ok=1;
30         _alertString += _("- Start date missing or invalid.") + "\n";
31     }
32     if (!parseInt(endDate.getTime())) {
33         ok=1;
34         _alertString += _("- End date missing or invalid.") + "\n";
35     }
36     
37     if (startDate > endDate) {
38         ok=1;
39         _alertString += _("Wrong date! start date cannot be after end date.") + "\n";
40     }
41     if (endDate < (new Date)) {
42         ok=1;
43         _alertString += _("End date before today, Invalid end date!") + "\n";
44     }
45     if (ok) { // if there is a problem
46         alert(_alertString);
47     return false;
48 }
49 // if all is good
50     ff.submit();
51 }
52 //]]>
53 </script>
54 </head>
55 <body id="acq_aqcontract" class="acq">
56 [% INCLUDE 'header.inc' %]
57 [% INCLUDE 'contracts-admin-search.inc' %]
58
59 <div id="breadcrumbs">
60     <a href="/cgi-bin/koha/mainpage.pl">Home</a>
61     &rsaquo;
62     <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
63     &rsaquo;
64     <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername %]</a>
65     &rsaquo;
66     [% IF ( add_form ) %]
67         <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid %]">Contracts</a>
68         &rsaquo;
69         [% IF ( contractnumber ) %]Modify contract '[% contractname %]'
70         [% ELSE %]New contract
71         [% END %]
72     [% END %]
73     [% IF ( add_validate ) %]
74         <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid %]">Contracts</a>
75         &rsaquo; Data recorded
76     [% END %]
77     [% IF ( delete_confirm ) %]
78         <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid %]">Contracts</a>
79         &rsaquo; Confirm deletion of contract [% contractnumber %]
80     [% END %]
81     [% IF ( delete_confirmed ) %]
82         <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid %]">Contracts</a> &rsaquo; Contract deleted
83     [% END %]
84     [% IF ( else ) %]Contracts[% END %]
85 </div>
86
87 <div id="doc3" class="yui-t2">
88
89     <div id="bd">
90     <div id="yui-main">
91     <div class="yui-b">
92
93 [% INCLUDE 'acquisitions-toolbar.inc' %]
94
95 [% IF error == 'not_deleted' %]
96     <div class="dialog alert">Contract has not been deleted. Maybe a basket linked to this contract exists.</div>
97 [% END %]
98
99                 [% IF ( add_form ) %]
100                     <form name="Aform" action="[% script_name %]" method="post">
101                         <input type="hidden" name="op" value="add_validate" />
102                         <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
103                         <input type="hidden" name="checked" value="0" />
104                         [% IF ( contractnumber ) %]
105                             <h1>Modify contract [% contractname %] for [% booksellername %]</h1>
106                         [% ELSE %]
107                             <h1>New contract for [% booksellername %]</h1>
108                         [% END %]
109                         <fieldset class="rows">
110                             <ol>
111                                 [% IF ( contractnumber ) %]
112                                         <li><span class="label">Contract id </span>[% contractnumber %]
113                                             <input type="hidden" name="contractnumber" value="[% contractnumber %]" />
114                                             <input type="hidden" name="is_a_modif" value="1" />
115                                         </li>
116                                 [% END %]
117                                 <li><label for="contractname" class="required">Name: *</label> &nbsp;
118                                         <input type="text" name="contractname" id="contractname" size="40" maxlength="80" value="[% contractname %]" />
119                                 </li>
120                                 <li><label for="contractdescription">Description: </label> &nbsp;
121                                         <input type="text" name="contractdescription" id="contractdescription" size="40" maxlength="80" value="[% contractdescription %]" />
122                                 </li>
123                                 <li><label for="from" class="required">Start date: *</label> &nbsp;
124                                         <input type="text" name="contractstartdate" id="from" value="[% contractstartdate | $KohaDates %]" maxlength="10" size="10" class="datepickerfrom" />
125                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
126                                 </li>
127                                 <li><label for="to" class="required">End date: *</label> &nbsp;
128                                         <input type="text" name="contractenddate" id="to" value="[% contractenddate | $KohaDates %]" maxlength="10"  size="10" class="datepickerto" />
129                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
130                                 </li>
131                             </ol>
132                         </fieldset>
133                         <fieldset class="action">
134                             <input type="button" value="Save" onclick="Check(this.form);" /> <a class="cancel" href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid %]&amp;contractnumber=[% contractnumber %]">Cancel</a>
135                         </fieldset>
136                     </form>
137             [% END %]
138             [% IF ( add_validate ) %]
139                 <h3>Data recorded</h3>
140                 <form action="[% script_name %]" method="post">
141                     <input type="submit" value="OK" />
142                 </form>
143             [% END %]
144             [% IF ( delete_confirm ) %]
145                     <div class="dialog alert">
146                         <h3>Confirm deletion of contract <i>[% contractname %]</i></h3>
147                         <table>
148                             <tr><th scope="row">Contract number:</th><td>[% contractnumber %]</td></tr>
149                             <tr><th scope="row">Contract name:</th><td>[% contractname %]</td></tr>
150                             <tr><th scope="row">Contract description:</th><td>[% contractdescription %]</td></tr>
151                             <tr><th scope="row">Contract start date:</th><td>[% contractstartdate | $KohaDates %]</td></tr>
152                             <tr><th scope="row">Contract end date:</th><td>[% contractenddate | $KohaDates %]</td></tr>
153                             <tr><th scope="row">Vendor:</th><td>[% booksellername %]</td></tr>
154                         </table>
155                         <form action="[% script_name %]" method="post">
156                             <input type="hidden" name="op" value="delete_confirmed" />
157                             <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
158                             <input type="hidden" name="contractnumber" value="[% contractnumber %]" />
159                             <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete contract</button>
160                         </form>
161                         <form action="/cgi-bin/koha/admin/aqcontract.pl" method="get">
162                             <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
163                             <input type="hidden" name="contractnumber" value="[% contractnumber %]" />
164                             <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
165                         </form>
166                     </div>
167             [% END %]
168             [% IF ( delete_confirmed ) %]
169                 <h3>Contract deleted</h3>
170                 <form action="[% script_name %]" method="post">
171                     <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
172                     <input type="submit" value="OK" />
173                 </form>
174             [% END %]
175             [% IF ( else ) %]
176                 <h2>Contract(s) of [% booksellername %]</h2>
177                 [% IF ( loop ) %]
178                     <table>
179                         <tr>
180                             <th scope="col">Name</th>
181                             <th scope="col">Description</th>
182                             <th scope="col">Start date</th>
183                             <th scope="col">End date</th>
184                             <th scope="col" colspan="2">&nbsp; </th>
185                         </tr>
186                     [% FOREACH loo IN loop %]
187                         <tr>
188                         <td>
189                             <a href="[% loo.script_name %]?op=add_form&amp;booksellerid=[% loo.booksellerid %]&amp;contractnumber=[% loo.contractnumber %]">[% loo.contractname %]</a>
190                         </td>
191                         <td>[% loo.contractdescription %]</td>
192                         <td>[% loo.contractstartdate %]</td>
193                         <td>[% loo.contractenddate %]</td>
194                         <td><a href="[% loo.script_name %]?op=add_form&amp;contractnumber=[% loo.contractnumber %]&amp;booksellerid=[% loo.booksellerid %]">Edit</a></td>
195                         <td><a href="[% loo.script_name %]?op=delete_confirm&amp;contractnumber=[% loo.contractnumber %]&amp;booksellerid=[% loo.booksellerid %]">Delete</a></td>
196                         </tr>
197                     [% END %]
198                 </table>
199                 [% ELSE %]
200                     <div class="dialog message">
201                         There are no contracts with this vendor.
202                         [% IF active %]
203                             <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&amp;booksellerid=[% booksellerid %]">Add a contract</a>.
204                         [% END %]
205                     </div>
206                 [% END %]
207             [% END %]
208 </div>
209 </div>
210 <div class="yui-b">
211 [% INCLUDE 'vendor-menu.inc' %]
212 </div>
213 </div>
214 [% INCLUDE 'intranet-bottom.inc' %]