5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha › Acquisitions › Contracts ›
8 [% IF ( contractnumber ) %]Modify contract '[% contractname | html %]'
9 [% ELSE %]New contract[% END %]
11 [% IF ( else ) %]Contracts of [% booksellername | html %][% END %]
12 [% IF ( add_validate ) %]Data recorded[% END %]
13 [% IF ( delete_confirm ) %]Confirm deletion of contract '[% contractnumber | html %]'[% END %]
14 [% IF ( delete_confirmed ) %]Contract deleted[% END %]</title>
15 [% INCLUDE 'doc-head-close.inc' %]
18 <body id="acq_aqcontract" class="acq">
19 [% INCLUDE 'header.inc' %]
20 [% INCLUDE 'contracts-admin-search.inc' %]
22 <div id="breadcrumbs">
23 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
25 <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
27 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]">[% booksellername | html %]</a>
30 <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid | html %]">Contracts</a>
32 [% IF ( contractnumber ) %]Modify contract '[% contractname | html %]'
33 [% ELSE %]New contract
36 [% IF ( add_validate ) %]
37 <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid | html %]">Contracts</a>
38 › Data recorded
40 [% IF ( delete_confirm ) %]
41 <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid | html %]">Contracts</a>
42 › Confirm deletion of contract [% contractnumber | html %]
44 [% IF ( delete_confirmed ) %]
45 <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid | html %]">Contracts</a> › Contract deleted
47 [% IF ( else ) %]Contracts[% END %]
50 <div class="main container-fluid">
52 <div class="col-sm-10 col-sm-push-2">
55 [% INCLUDE 'acquisitions-toolbar.inc' %]
57 [% IF error == 'not_deleted' %]
58 <div class="dialog alert">Contract has not been deleted. Maybe a basket linked to this contract exists.</div>
62 <form name="Aform" action="[% script_name | html %]" method="post">
63 <input type="hidden" name="op" value="add_validate" />
64 <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
65 <input type="hidden" name="checked" value="0" />
66 [% IF ( contractnumber ) %]
67 <h1>Modify contract [% contractname | html %] for [% booksellername | html %]</h1>
69 <h1>New contract for [% booksellername | html %]</h1>
71 <fieldset class="rows">
73 [% IF ( contractnumber ) %]
74 <li><span class="label">Contract id </span>[% contractnumber | html %]
75 <input type="hidden" name="contractnumber" value="[% contractnumber | html %]" />
76 <input type="hidden" name="is_a_modif" value="1" />
79 <li><label for="contractname" class="required">Name: *</label>
80 <input type="text" name="contractname" id="contractname" size="40" maxlength="80" value="[% contractname | html %]" />
82 <li><label for="contractdescription">Description: </label>
83 <input type="text" name="contractdescription" id="contractdescription" size="40" maxlength="80" value="[% contractdescription | html %]" />
85 <li><label for="from" class="required">Start date: *</label>
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>
89 <li><label for="to" class="required">End date: *</label>
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>
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 | html %]&contractnumber=[% contractnumber | html %]">Cancel</a>
100 [% IF ( add_validate ) %]
101 <h3>Data recorded</h3>
102 <form action="[% script_name | html %]" method="post">
103 <input type="submit" value="OK" />
106 [% IF ( delete_confirm ) %]
107 <div class="dialog alert">
108 <h3>Confirm deletion of contract <i>[% contractname | html %]</i></h3>
110 <tr><th scope="row">Contract number:</th><td>[% contractnumber | html %]</td></tr>
111 <tr><th scope="row">Contract name:</th><td>[% contractname | html %]</td></tr>
112 <tr><th scope="row">Contract description:</th><td>[% contractdescription | html %]</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 | html %]</td></tr>
117 <form action="[% script_name | html %]" method="post">
118 <input type="hidden" name="op" value="delete_confirmed" />
119 <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
120 <input type="hidden" name="contractnumber" value="[% contractnumber | html %]" />
121 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete contract</button>
123 <form action="/cgi-bin/koha/admin/aqcontract.pl" method="get">
124 <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
125 <input type="hidden" name="contractnumber" value="[% contractnumber | html %]" />
126 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
130 [% IF ( delete_confirmed ) %]
131 <h3>Contract deleted</h3>
132 <form action="[% script_name | html %]" method="post">
133 <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
134 <input type="submit" value="OK" />
138 <h2>Contract(s) of [% booksellername | html %]</h2>
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>
148 [% FOREACH loo IN loop %]
151 <a href="[% loo.script_name | html %]?op=add_form&booksellerid=[% loo.booksellerid | html %]&contractnumber=[% loo.contractnumber | html %]">[% loo.contractname | html %]</a>
153 <td>[% loo.contractdescription | html %]</td>
154 <td>[% loo.contractstartdate | html %]</td>
155 <td>[% loo.contractenddate | html %]</td>
157 <a href="[% loo.script_name | html %]?op=add_form&contractnumber=[% loo.contractnumber | html %]&booksellerid=[% loo.booksellerid | html %]" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
158 <a href="[% loo.script_name | html %]?op=delete_confirm&contractnumber=[% loo.contractnumber | html %]&booksellerid=[% loo.booksellerid | html %]" class="btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</a>
164 <div class="dialog message">
165 There are no contracts with this vendor.
167 <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&booksellerid=[% booksellerid | html %]">Add a contract</a>.
174 </div> <!-- /.col-sm-10.col-sm-push-2 -->
176 <div class="col-sm-2 col-sm-pull-10">
178 [% INCLUDE 'acquisitions-menu.inc' %]
180 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
181 </div> <!-- /.row -->
183 [% MACRO jsinclude BLOCK %]
184 [% INCLUDE 'calendar.inc' %]
185 [% Asset.js("js/acq.js") | $raw %]
188 // to check if the data are correctly entered.
191 var _alertString=_("Form not submitted because of the following problem(s)");
192 _alertString +="\n-------------------------------------------------------------------\n\n";
193 if (!(isNotNull(ff.contractname,0))){
195 _alertString += _("- Name missing") + "\n";
197 var startDate = Date_from_syspref($("#from").val());
198 var endDate = Date_from_syspref($("#to").val());
199 if (!parseInt(startDate.getTime())) {
201 _alertString += _("- Start date missing or invalid.") + "\n";
203 if (!parseInt(endDate.getTime())) {
205 _alertString += _("- End date missing or invalid.") + "\n";
208 if (startDate > endDate) {
210 _alertString += _("Wrong date! start date cannot be after end date.") + "\n";
212 if (endDate < (new Date)) {
214 _alertString += _("End date before today, Invalid end date!") + "\n";
216 if (ok) { // if there is a problem
226 [% INCLUDE 'intranet-bottom.inc' %]