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