+[% USE raw %]
+[% USE Asset %]
+[% USE KohaDates %]
+[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Acquisitions › Contracts ›
[% IF ( add_form ) %]
- [% IF ( contractnumber ) %]Modify contract '[% contractname %]'
+ [% IF ( contractnumber ) %]Modify contract '[% contractname | html %]'
[% ELSE %]New contract[% END %]
[% END %]
-[% IF ( else ) %]Contracts of [% booksellername %][% END %]
+[% IF ( else ) %]Contracts of [% booksellername | html %][% END %]
[% IF ( add_validate ) %]Data recorded[% END %]
-[% IF ( delete_confirm ) %]Confirm deletion of contract '[% contractnumber %]'[% END %]
+[% IF ( delete_confirm ) %]Confirm deletion of contract '[% contractnumber | html %]'[% END %]
[% IF ( delete_confirmed ) %]Contract deleted[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
-[% INCLUDE 'calendar.inc' %]
-<script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
-<script type="text/javascript">
-//<![CDATA[
-// to check if the data are correctly entered.
-function Check(ff) {
- var ok=0;
- var _alertString=_("Form not submitted because of the following problem(s)");
- _alertString +="\n-------------------------------------------------------------------\n\n";
- if (!(isNotNull(ff.contractname,0))){
- ok=1;
- _alertString += _("- Name missing") + "\n";
- }
- var startDate = Date_from_syspref($("#contractstartdate").val());
- var endDate = Date_from_syspref($("#contractenddate").val());
- if (!parseInt(startDate.getTime())) {
- ok=1;
- _alertString += _("- Start date missing or invalid.") + "\n";
- }
- if (!parseInt(endDate.getTime())) {
- ok=1;
- _alertString += _("- End date missing or invalid.") + "\n";
- }
-
- if (startDate > endDate) {
- ok=1;
- _alertString += _("Wrong date! start date cannot be after end date.") + "\n";
- }
- if (endDate < (new Date)) {
- ok=1;
- _alertString += _("End date before today, Invalid end date!") + "\n";
- }
- if (ok) { // if there is a problem
- alert(_alertString);
- return false;
-}
-// if all is good
- ff.submit();
-}
-//]]>
-</script>
</head>
+
<body id="acq_aqcontract" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'contracts-admin-search.inc' %]
›
<a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
›
- <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername %]</a>
+ <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]">[% booksellername | html %]</a>
›
[% IF ( add_form ) %]
- <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid %]">Contracts</a>
+ <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid | html %]">Contracts</a>
›
- [% IF ( contractnumber ) %]Modify contract '[% contractname %]'
+ [% IF ( contractnumber ) %]Modify contract '[% contractname | html %]'
[% ELSE %]New contract
[% END %]
[% END %]
[% IF ( add_validate ) %]
- <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid %]">Contracts</a>
+ <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid | html %]">Contracts</a>
› Data recorded
[% END %]
[% IF ( delete_confirm ) %]
- <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid %]">Contracts</a>
- › Confirm deletion of contract [% contractnumber %]
+ <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid | html %]">Contracts</a>
+ › Confirm deletion of contract [% contractnumber | html %]
[% END %]
[% IF ( delete_confirmed ) %]
- <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid %]">Contracts</a> › Contract Deleted
+ <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid | html %]">Contracts</a> › Contract deleted
[% END %]
[% IF ( else ) %]Contracts[% END %]
</div>
-<div id="doc" class="yui-t7">
+<div id="doc3" class="yui-t2">
+
<div id="bd">
- <div id="yui-main">
+ <div id="yui-main">
+ <div class="yui-b">
+
+[% INCLUDE 'acquisitions-toolbar.inc' %]
+
+[% IF error == 'not_deleted' %]
+ <div class="dialog alert">Contract has not been deleted. Maybe a basket linked to this contract exists.</div>
+[% END %]
+
[% IF ( add_form ) %]
- <form name="Aform" action="[% script_name %]" method="post">
+ <form name="Aform" action="[% script_name | html %]" method="post">
<input type="hidden" name="op" value="add_validate" />
- <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
+ <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
<input type="hidden" name="checked" value="0" />
[% IF ( contractnumber ) %]
- <h1>Modify contract [% contractname %] for [% booksellername %]</h1>
+ <h1>Modify contract [% contractname | html %] for [% booksellername | html %]</h1>
[% ELSE %]
- <h1>New contract for [% booksellername %]</h1>
+ <h1>New contract for [% booksellername | html %]</h1>
[% END %]
<fieldset class="rows">
<ol>
[% IF ( contractnumber ) %]
- <li><span class="label">Contract id </span>[% contractnumber %]
- <input type="hidden" name="contractnumber" value="[% contractnumber %]" />
+ <li><span class="label">Contract id </span>[% contractnumber | html %]
+ <input type="hidden" name="contractnumber" value="[% contractnumber | html %]" />
<input type="hidden" name="is_a_modif" value="1" />
</li>
[% END %]
- <li><label for="contractname" class="required">Name *</label>
- <input type="text" name="contractname" id="contractname" size="40" maxlength="80" value="[% contractname %]" />
+ <li><label for="contractname" class="required">Name: *</label>
+ <input type="text" name="contractname" id="contractname" size="40" maxlength="80" value="[% contractname | html %]" />
</li>
- <li><label for="contractdescription">Description</label>
- <input type="text" name="contractdescription" id="contractdescription" size="40" maxlength="80" value="[% contractdescription %]" />
+ <li><label for="contractdescription">Description: </label>
+ <input type="text" name="contractdescription" id="contractdescription" size="40" maxlength="80" value="[% contractdescription | html %]" />
</li>
- <li><label for="from" class="required">Start date *</label>
- <input type="text" name="contractstartdate" id="from" value="[% contractstartdate %]" maxlength="10" size="10" class="datepickerfrom" />
+ <li><label for="from" class="required">Start date: *</label>
+ <input type="text" name="contractstartdate" id="from" value="[% contractstartdate | $KohaDates %]" maxlength="10" size="10" class="datepickerfrom" />
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
</li>
- <li><label for="to" class="required">End date *</label>
- <input type="text" name="contractenddate" id="to" value="[% contractenddate %]" maxlength="10" size="10" class="datepickerto" />
+ <li><label for="to" class="required">End date: *</label>
+ <input type="text" name="contractenddate" id="to" value="[% contractenddate | $KohaDates %]" maxlength="10" size="10" class="datepickerto" />
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
</li>
</ol>
</fieldset>
<fieldset class="action">
- <input type="button" value="Save" onclick="Check(this.form);" /> <a class="cancel" href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid %]&contractnumber=[% contractnumber %]">Cancel</a>
+ <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>
</fieldset>
</form>
[% END %]
[% IF ( add_validate ) %]
<h3>Data recorded</h3>
- <form action="[% script_name %]" method="post">
+ <form action="[% script_name | html %]" method="post">
<input type="submit" value="OK" />
</form>
[% END %]
[% IF ( delete_confirm ) %]
- <form action="[% script_name %]" method="post">
- <fieldset>
- <legend>Confirm deletion of contract [% contractnumber %]</legend>
+ <div class="dialog alert">
+ <h3>Confirm deletion of contract <i>[% contractname | html %]</i></h3>
<table>
- <tr><th scope="row">Contract number:</th><td>[% contractnumber %]</td></tr>
- <tr><th scope="row">Contract name:</th><td>[% contractname %]</td></tr>
- <tr><th scope="row">Contract description:</th><td>[% contractdescription %]</td></tr>
- <tr><th scope="row">Contract start date:</th><td>[% contractstartdate %]</td></tr>
- <tr><th scope="row">Contract end date:</th><td>[% contractenddate %]</td></tr>
- <tr><th scope="row">Vendor:</th><td>[% booksellername %]</td></tr>
+ <tr><th scope="row">Contract number:</th><td>[% contractnumber | html %]</td></tr>
+ <tr><th scope="row">Contract name:</th><td>[% contractname | html %]</td></tr>
+ <tr><th scope="row">Contract description:</th><td>[% contractdescription | html %]</td></tr>
+ <tr><th scope="row">Contract start date:</th><td>[% contractstartdate | $KohaDates %]</td></tr>
+ <tr><th scope="row">Contract end date:</th><td>[% contractenddate | $KohaDates %]</td></tr>
+ <tr><th scope="row">Vendor:</th><td>[% booksellername | html %]</td></tr>
</table>
- <fieldset class="action">
+ <form action="[% script_name | html %]" method="post">
<input type="hidden" name="op" value="delete_confirmed" />
- <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
- <input type="hidden" name="contractnumber" value="[% contractnumber %]" />
- <input type="submit" value="Delete this Contract" />
- <a class="cancel" href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid %]&contractnumber=[% contractnumber %]">Cancel</a>
- </fieldset>
- </fieldset>
- </form>
+ <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
+ <input type="hidden" name="contractnumber" value="[% contractnumber | html %]" />
+ <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete contract</button>
+ </form>
+ <form action="/cgi-bin/koha/admin/aqcontract.pl" method="get">
+ <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
+ <input type="hidden" name="contractnumber" value="[% contractnumber | html %]" />
+ <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
+ </form>
+ </div>
[% END %]
[% IF ( delete_confirmed ) %]
<h3>Contract deleted</h3>
- <form action="[% script_name %]" method="post">
- <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
+ <form action="[% script_name | html %]" method="post">
+ <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
<input type="submit" value="OK" />
</form>
[% END %]
[% IF ( else ) %]
- <div id="toolbar">
- <script type="text/javascript">
- //<![CDATA[
- // prepare DOM for YUI Toolbar
- $(document).ready(function() {
- yuiToolbar();
- });
- // YUI Toolbar Functions
- function yuiToolbar() {
- new YAHOO.widget.Button("newcontract");
- }
- //]]>
- </script>
- <ul class="toolbar">
- <li><a id="newcontract" href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&booksellerid=[% booksellerid %]">New contract</a></li>
- </ul>
- </div>
- <h2>Contract(s) of [% booksellername %]</h2>
+ <h2>Contract(s) of [% booksellername | html %]</h2>
[% IF ( loop ) %]
<table>
<tr>
<th scope="col">Description</th>
<th scope="col">Start date</th>
<th scope="col">End date</th>
- <th scope="col" colspan="2"> </th>
+ <th scope="col">Actions</th>
</tr>
[% FOREACH loo IN loop %]
- [% IF ( loop.even ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
+ <tr>
<td>
- <a href="[% loo.script_name %]?op=add_form&booksellerid=[% loo.booksellerid %]&contractnumber=[% loo.contractnumber %]">[% loo.contractname %]</a>
+ <a href="[% loo.script_name | html %]?op=add_form&booksellerid=[% loo.booksellerid | html %]&contractnumber=[% loo.contractnumber | html %]">[% loo.contractname | html %]</a>
+ </td>
+ <td>[% loo.contractdescription | html %]</td>
+ <td>[% loo.contractstartdate | html %]</td>
+ <td>[% loo.contractenddate | html %]</td>
+ <td class="actions">
+ <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>
+ <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>
</td>
- <td>[% loo.contractdescription %]</td>
- <td>[% loo.contractstartdate %]</td>
- <td>[% loo.contractenddate %]</td>
- <td><a href="[% loo.script_name %]?op=add_form&contractnumber=[% loo.contractnumber %]&booksellerid=[% loo.booksellerid %]">Edit</a></td>
- <td><a href="[% loo.script_name %]?op=delete_confirm&contractnumber=[% loo.contractnumber %]&booksellerid=[% loo.booksellerid %]">Delete</a></td>
</tr>
[% END %]
</table>
[% ELSE %]
- <div class="dialog message">There are no contracts with this vendor.</div>
+ <div class="dialog message">
+ There are no contracts with this vendor.
+ [% IF active %]
+ <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&booksellerid=[% booksellerid | html %]">Add a contract</a>.
+ [% END %]
+ </div>
[% END %]
[% END %]
- </div>
</div>
+</div>
+<div class="yui-b">
+[% INCLUDE 'vendor-menu.inc' %]
+</div>
+</div>
+[% MACRO jsinclude BLOCK %]
+ [% INCLUDE 'calendar.inc' %]
+ [% Asset.js("js/acq.js") | $raw %]
+ <script type="text/javascript">
+ //<![CDATA[
+ // to check if the data are correctly entered.
+ function Check(ff) {
+ var ok=0;
+ var _alertString=_("Form not submitted because of the following problem(s)");
+ _alertString +="\n-------------------------------------------------------------------\n\n";
+ if (!(isNotNull(ff.contractname,0))){
+ ok=1;
+ _alertString += _("- Name missing") + "\n";
+ }
+ var startDate = Date_from_syspref($("#from").val());
+ var endDate = Date_from_syspref($("#to").val());
+ if (!parseInt(startDate.getTime())) {
+ ok=1;
+ _alertString += _("- Start date missing or invalid.") + "\n";
+ }
+ if (!parseInt(endDate.getTime())) {
+ ok=1;
+ _alertString += _("- End date missing or invalid.") + "\n";
+ }
+
+ if (startDate > endDate) {
+ ok=1;
+ _alertString += _("Wrong date! start date cannot be after end date.") + "\n";
+ }
+ if (endDate < (new Date)) {
+ ok=1;
+ _alertString += _("End date before today, Invalid end date!") + "\n";
+ }
+ if (ok) { // if there is a problem
+ alert(_alertString);
+ return false;
+ }
+ // if all is good
+ ff.submit();
+ }
+ //]]>
+ </script>
+[% END %]
[% INCLUDE 'intranet-bottom.inc' %]