Fix for Bug 3895 - Menu on left of Contracts is for Admin Pages
[koha_fer] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / aqcontract.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Acquisitions &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)");
19     _alertString +="\n-------------------------------------------------------------------\n\n";
20     if (!(isNotNull(ff.contractname,0))){
21         ok=1;
22         _alertString += _("- Name missing") + "\n";
23     }
24     var startDate = Date_from_syspref($("#contractstartdate").val());
25     var endDate   = Date_from_syspref($("#contractenddate").val());
26     if (!parseInt(startDate.getTime())) {
27         ok=1;
28         _alertString += _("- Start date missing or invalid.") + "\n";
29     }
30     if (!parseInt(endDate.getTime())) {
31         ok=1;
32         _alertString += _("- End date missing or invalid.") + "\n";
33     }
34     
35     if (startDate > endDate) {
36         ok=1;
37         _alertString += _("Wrong date! start date cannot be after end date.") + "\n";
38     }
39     if (endDate < (new Date)) {
40         ok=1;
41         _alertString += _("End date before today, Invalid end date!") + "\n";
42     }
43     if (ok) { // if there is a problem
44         alert(_alertString);
45     return false;
46 }
47 // if all is good
48     ff.submit();
49 }
50 //]]>
51 </script>
52 </head>
53 <body>
54 <!-- TMPL_INCLUDE NAME="header.inc" -->
55 <!-- TMPL_INCLUDE NAME="contracts-admin-search.inc" -->
56
57 <div id="breadcrumbs">
58     <a href="/cgi-bin/koha/mainpage.pl">Home</a>
59     &rsaquo;
60     <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
61     &rsaquo;
62     <a href="/cgi-bin/koha/acqui/supplier.pl?supplierid=<!--TMPL_VAR name="booksellerid" -->"><!-- TMPL_VAR name="booksellername" --></a>
63     &rsaquo;
64     <!-- TMPL_IF NAME="add_form" -->
65         <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=<!-- TMPL_VAR  NAME="booksellerid" -->">Contracts</a>
66         &rsaquo;
67         <!-- TMPL_IF NAME="contractnumber" -->Modify contract '<!-- TMPL_VAR NAME="contractname" -->'
68         <!-- TMPL_ELSE -->New contract
69         <!-- /TMPL_IF -->
70     <!-- /TMPL_IF -->
71     <!-- TMPL_IF NAME="add_validate" -->
72         <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=<!-- TMPL_VAR  NAME="booksellerid" -->">Contracts</a>
73         &rsaquo; Data recorded
74     <!-- /TMPL_IF -->
75     <!-- TMPL_IF NAME="delete_confirm" -->
76         <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=<!-- TMPL_VAR  NAME="booksellerid" -->">Contracts</a>
77         &rsaquo; Confirm Deletion of Contract <!-- TMPL_VAR NAME="contractnumber" -->
78     <!-- /TMPL_IF -->
79     <!-- TMPL_IF NAME="delete_confirmed" -->
80         <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=<!-- TMPL_VAR  NAME="booksellerid" -->">Contracts</a> &rsaquo; Contract Deleted
81     <!-- /TMPL_IF -->
82     <!-- TMPL_IF NAME="else" -->Contracts<!-- /TMPL_IF -->
83 </div>
84
85 <div id="doc" class="yui-t7">
86     <div id="bd">
87         <div id="yui-main">
88                 <!-- TMPL_IF NAME="add_form" -->
89                     <form name="Aform" action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
90                         <input type="hidden" name="op" value="add_validate" />
91                         <input type="hidden" name="booksellerid" value="<!-- TMPL_VAR NAME="booksellerid" -->" />
92                         <input type="hidden" name="checked" value="0" />
93                         <!-- TMPL_IF NAME="contractnumber" -->
94                             <h1>Modify contract <!-- TMPL_VAR NAME="contractname" --> for <!-- TMPL_VAR NAME="booksellername" --></h1>
95                         <!-- TMPL_ELSE -->
96                             <h1>New contract for <!-- TMPL_VAR NAME="booksellername" --></h1>
97                         <!-- /TMPL_IF -->
98                         <fieldset class="rows">
99                             <ol>
100                                 <!-- TMPL_IF NAME="contractnumber" -->
101                                         <li><span class="label">Contract id </span><!-- TMPL_VAR NAME="contractnumber" -->
102                                             <input type="hidden" name="contractnumber" value="<!-- TMPL_VAR NAME="contractnumber" -->" />
103                                             <input type="hidden" name="is_a_modif" value="1" />
104                                         </li>
105                                 <!-- /TMPL_IF -->
106                                 <li><label for="contractname" class="required">Name *</label> &nbsp;
107                                         <input type="text" name="contractname" id="contractname" size="40" maxlength="80" value="<!-- TMPL_VAR NAME="contractname" -->" />
108                                 </li>
109                                 <li><label for="contractdescription">Description</label> &nbsp;
110                                         <input type="text" name="contractdescription" id="contractdescription" size="40" maxlength="80" value="<!-- TMPL_VAR NAME="contractdescription" -->" />
111                                 </li>
112                                 <li><label for="contractstartdate" class="required">Start date *</label> &nbsp;
113                                         <input type="text" name="contractstartdate" id="contractstartdate" value="<!-- TMPL_VAR NAME="contractstartdate" -->" maxlength="10"  size="10"/>
114                                         <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="contractstartdate_button" alt="Show Calendar" />
115                                         <script language="JavaScript" type="text/javascript">
116                                             Calendar.setup(
117                                             {
118                                             inputField : "contractstartdate",
119                                             ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
120                                             button : "contractstartdate_button"
121                                             }
122                                             );
123                                         </script>
124                                 <div class="hint"><!-- TMPL_INCLUDE NAME="date-format.inc" --></div>
125                                 </li>
126                                 <li><label for="contractenddate" class="required">End date *</label> &nbsp;
127                                         <input type="text" name="contractenddate" id="contractenddate" value="<!-- TMPL_VAR NAME="contractenddate" -->" maxlength="10"  size="10" />
128                                         <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="contractenddate_button" alt="Show Calendar" />
129                                         <script language="JavaScript" type="text/javascript">
130                                             Calendar.setup(
131                                             {
132                                             inputField : "contractenddate",
133                                             ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
134                                             button : "contractenddate_button"
135                                             }
136                                             );
137                                         </script>
138                                 <div class="hint"><!-- TMPL_INCLUDE NAME="date-format.inc" --></div>
139                                 </li>
140                             </ol>
141                         </fieldset>
142                         <fieldset class="action">
143                             <input type="button" value="Save" onclick="Check(this.form);" /> <a class="cancel" href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=<!-- TMPL_VAR NAME="booksellerid" -->&amp;contractnumber=<!-- TMPL_VAR NAME="contractnumber" -->">Cancel</a>
144                         </fieldset>
145                     </form>
146             <!-- /TMPL_IF -->
147             <!-- TMPL_IF NAME="add_validate" -->
148                 <h3>Data recorded</h3>
149                 <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
150                     <input type="submit" value="OK" />
151                 </form>
152             <!-- /TMPL_IF -->
153             <!-- TMPL_IF NAME="delete_confirm" -->
154                 <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
155                     <fieldset>
156                         <legend>Confirm Deletion of Contract <!-- TMPL_VAR NAME="contractnumber" --></legend>
157                         <table>
158                             <tr><th scope="row">Contract number:</th><td><!-- TMPL_VAR NAME="contractnumber" --></td></tr>
159                             <tr><th scope="row">Contract name:</th><td><!-- TMPL_VAR NAME="contractname" --></td></tr>
160                             <tr><th scope="row">Contract description:</th><td><!-- TMPL_VAR NAME="contractdescription" --></td></tr>
161                             <tr><th scope="row">Contract start date:</th><td><!-- TMPL_VAR NAME="contractstartdate" --></td></tr>
162                             <tr><th scope="row">Contract end date:</th><td><!-- TMPL_VAR NAME="contractenddate" --></td></tr>
163                             <tr><th scope="row">Vendor:</th><td><!-- TMPL_VAR NAME="booksellername" --></td></tr>
164                         </table>
165                         <fieldset class="action">
166                             <input type="hidden" name="op" value="delete_confirmed" />
167                             <input type="hidden" name="booksellerid" value="<!-- TMPL_VAR name="booksellerid" -->" />
168                             <input type="hidden" name="contractnumber" value="<!-- TMPL_VAR NAME="contractnumber" -->" />
169                             <input type="submit" value="Delete this Contract" />
170                             <a class="cancel" href="/cgi-bin/koha/admin/aqcontract.pl">Cancel</a> 
171                         </fieldset>
172                     </fieldset>
173                 </form>
174             <!-- /TMPL_IF -->
175             <!-- TMPL_IF NAME="delete_confirmed" -->
176                 <h3>Contract Deleted</h3>
177                 <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
178                     <input type="hidden" name="booksellerid" value="<!-- TMPL_VAR name="booksellerid" -->" />
179                     <input type="submit" value="OK" />
180                 </form>
181             <!-- /TMPL_IF -->
182             <!-- TMPL_IF NAME="else" -->
183                 <div id="toolbar">
184                     <script type="text/javascript">
185                         //<![CDATA[
186                         // prepare DOM for YUI Toolbar
187                         $(document).ready(function() {
188                         yuiToolbar();
189                         });
190                         // YUI Toolbar Functions
191                         function yuiToolbar() {
192                         new YAHOO.widget.Button("newcontract");
193                         }
194                         //]]>
195                     </script>
196                     <ul class="toolbar">
197                         <li><a id="newcontract" href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&amp;booksellerid=<!-- TMPL_VAR name="booksellerid" -->">New Contract</a></li>
198                     </ul>
199                 </div>
200                 <h2>Contract(s) of <!-- TMPL_VAR name="booksellername" --></h2>
201                 <!-- TMPL_IF name="loop" -->
202                     <table>
203                         <tr>
204                             <th scope="col">Name</th>
205                             <th scope="col">Description</th>
206                             <th scope="col">Start date</th>
207                             <th scope="col">End date</th>
208                             <th scope="col" colspan="2">&nbsp; </th>
209                         </tr>
210                     <!-- TMPL_LOOP NAME="loop" -->
211                         <!-- TMPL_IF NAME="__even__" --><tr class="highlight"><!-- TMPL_ELSE --><tr><!-- /TMPL_IF -->
212                         <td>
213                             <a href="<!-- TMPL_VAR NAME="script_name" -->?op=add_form&amp;contractnumber=<!-- TMPL_VAR NAME="contractnumber" -->"><!-- TMPL_VAR NAME="contractname" --></a>
214                         </td>
215                         <td><!-- TMPL_VAR NAME="contractdescription" --></td>
216                         <td><!-- TMPL_VAR NAME="contractstartdate" --></td>
217                         <td><!-- TMPL_VAR NAME="contractenddate" --></td>
218                         <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>
219                         <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>
220                         </tr>
221                     <!-- /TMPL_LOOP -->
222                 </table>
223                 <!-- TMPL_ELSE -->
224                 <div class="dialog message">There are no contracts with this vendor.</div>
225                 <!-- /TMPL_IF -->
226             <!-- /TMPL_IF -->
227         </div>
228 </div>
229 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->