Bug 27846: (follow-up) Add id back to breadcrumbs container
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / aqcontract.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE KohaDates %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha &rsaquo; Acquisitions &rsaquo; Contracts &rsaquo;
7 [% IF ( add_form ) %]
8     [% IF ( contractnumber ) %]Modify contract '[% contractname | html %]'
9 [% ELSE %]New contract[% END %]
10 [% 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' %]
16 </head>
17
18 <body id="acq_aqcontract" class="acq">
19 [% INCLUDE 'header.inc' %]
20 [% INCLUDE 'contracts-admin-search.inc' %]
21
22 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
23     <ol>
24         <li>
25             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
26         </li>
27         <li>
28             <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
29         </li>
30         <li>
31             <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
32         </li>
33
34         [% IF ( add_form ) %]
35             <li>
36                 <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid | uri %]">Contracts</a>
37             </li>
38             [% IF ( contractnumber ) %]
39                 <li>
40                     <a href="#" aria-current="page">
41                         Modify contract '[% contractname | html %]'
42                     </a>
43                 </li>
44             [% ELSE %]
45                 <li>
46                     <a href="#" aria-current="page">
47                         New contract
48                     </a>
49                 </li>
50             [% END %]
51         [% END %]
52
53         [% IF ( add_validate ) %]
54             <li>
55                 <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid | uri %]">Contracts</a>
56             </li>
57             <li>
58                 <a href="#" aria-current="page">
59                     Data recorded
60                 </a>
61             </li>
62         [% END %]
63
64         [% IF ( delete_confirm ) %]
65             <li>
66                 <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid | uri %]">Contracts</a>
67             </li>
68             <li>
69                 <a href="#" aria-current="page">
70                     Confirm deletion of contract [% contractnumber | html %]
71                 </a>
72             </li>
73         [% END %]
74
75         [% IF ( delete_confirmed ) %]
76             <li>
77                 <a href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid | uri %]">Contracts</a>
78             </li>
79             <li>
80                 <a href="#" aria-current="page">
81                     Contract deleted
82                 </a>
83             </li>
84         [% END %]
85
86         [% IF ( else ) %]
87             <li>
88                 <a href="#" aria-current="page">
89                     Contracts
90                 </a>
91             </li>
92         [% END %]
93     </ol>
94 </nav>
95
96 <div class="main container-fluid">
97     <div class="row">
98         <div class="col-sm-10 col-sm-push-2">
99             <main>
100
101 [% INCLUDE 'acquisitions-toolbar.inc' %]
102
103 [% IF error == 'not_deleted' %]
104     <div class="dialog alert">Contract has not been deleted. Maybe a basket linked to this contract exists.</div>
105 [% END %]
106
107                 [% IF ( add_form ) %]
108                     <form name="Aform" action="/cgi-bin/koha/admin/aqcontract.pl" id="add_modify_contract" method="post">
109                         <input type="hidden" name="op" value="add_validate" />
110                         <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
111                         <input type="hidden" name="checked" value="0" />
112                         [% IF ( contractnumber ) %]
113                             <h1>Modify contract [% contractname | html %] for [% booksellername | html %]</h1>
114                         [% ELSE %]
115                             <h1>New contract for [% booksellername | html %]</h1>
116                         [% END %]
117                         <fieldset class="rows">
118                             <ol>
119                                 [% IF ( contractnumber ) %]
120                                         <li><span class="label">Contract id </span>[% contractnumber | html %]
121                                             <input type="hidden" name="contractnumber" value="[% contractnumber | html %]" />
122                                             <input type="hidden" name="is_a_modif" value="1" />
123                                         </li>
124                                 [% END %]
125                                 <li><label for="contractname" class="required">Name:</label> &nbsp;
126                                         <input type="text" name="contractname" id="contractname" size="40" maxlength="80" value="[% contractname | html %]" />
127                                         <span class="required">Required</span>
128                                 </li>
129                                 <li><label for="contractdescription">Description: </label> &nbsp;
130                                         <input type="text" name="contractdescription" id="contractdescription" size="40" maxlength="80" value="[% contractdescription | html %]" />
131                                 </li>
132                                 <li><label for="from" class="required">Start date:</label> &nbsp;
133                                         <input type="text" name="contractstartdate" id="from" value="[% contractstartdate | $KohaDates %]" maxlength="10" size="10" class="datepickerfrom" />
134                                         <span class="required">Required</span>
135                                     <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
136                                 </li>
137                                 <li><label for="to" class="required">End date:</label> &nbsp;
138                                         <input type="text" name="contractenddate" id="to" value="[% contractenddate | $KohaDates %]" maxlength="10"  size="10" class="datepickerto" />
139                                         <span class="required">Required</span>
140                                     <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
141                                 </li>
142                             </ol>
143                         </fieldset>
144                         <fieldset class="action">
145                             <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid | html %]&amp;contractnumber=[% contractnumber | html %]">Cancel</a>
146                         </fieldset>
147                     </form>
148             [% END %]
149             [% IF ( add_validate ) %]
150                 <h3>Data recorded</h3>
151                 <form action="[% script_name | html %]" method="post">
152                     <input type="submit" value="OK" />
153                 </form>
154             [% END %]
155             [% IF ( delete_confirm ) %]
156                     <div class="dialog alert">
157                         <h3>Confirm deletion of contract <em>[% contractname | html %]</em></h3>
158                         <table>
159                             <tr><th scope="row">Contract number:</th><td>[% contractnumber | html %]</td></tr>
160                             <tr><th scope="row">Contract name:</th><td>[% contractname | html %]</td></tr>
161                             <tr><th scope="row">Contract description:</th><td>[% contractdescription | html %]</td></tr>
162                             <tr><th scope="row">Contract start date:</th><td>[% contractstartdate | $KohaDates %]</td></tr>
163                             <tr><th scope="row">Contract end date:</th><td>[% contractenddate | $KohaDates %]</td></tr>
164                             <tr><th scope="row">Vendor:</th><td>[% booksellername | html %]</td></tr>
165                         </table>
166                         <form action="[% script_name | html %]" method="post">
167                             <input type="hidden" name="op" value="delete_confirmed" />
168                             <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
169                             <input type="hidden" name="contractnumber" value="[% contractnumber | html %]" />
170                             <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete contract</button>
171                         </form>
172                         <form action="/cgi-bin/koha/admin/aqcontract.pl" method="get">
173                             <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
174                             <input type="hidden" name="contractnumber" value="[% contractnumber | html %]" />
175                             <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
176                         </form>
177                     </div>
178             [% END %]
179             [% IF ( delete_confirmed ) %]
180                 <h3>Contract deleted</h3>
181                 <form action="[% script_name | html %]" method="post">
182                     <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
183                     <input type="submit" value="OK" />
184                 </form>
185             [% END %]
186             [% IF ( else ) %]
187                 <h2>Contract(s) of [% booksellername | html %]</h2>
188                 [% IF ( loop ) %]
189                     <table>
190                         <tr>
191                             <th scope="col">Name</th>
192                             <th scope="col">Description</th>
193                             <th scope="col">Start date</th>
194                             <th scope="col">End date</th>
195                             <th scope="col">Actions</th>
196                         </tr>
197                     [% FOREACH loo IN loop %]
198                         <tr>
199                         <td>
200                             <a href="[% loo.script_name | url %]?op=add_form&amp;booksellerid=[% loo.booksellerid | uri %]&amp;contractnumber=[% loo.contractnumber | uri %]">[% loo.contractname | html %]</a>
201                         </td>
202                         <td>[% loo.contractdescription | html %]</td>
203                         <td>[% loo.contractstartdate | html %]</td>
204                         <td>[% loo.contractenddate | html %]</td>
205                         <td class="actions">
206                             <a href="[% loo.script_name | url %]?op=add_form&amp;contractnumber=[% loo.contractnumber | uri %]&amp;booksellerid=[% loo.booksellerid | uri %]" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
207                             <a href="[% loo.script_name | url %]?op=delete_confirm&amp;contractnumber=[% loo.contractnumber | uri %]&amp;booksellerid=[% loo.booksellerid | uri %]" class="btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</a>
208                         </td>
209                         </tr>
210                     [% END %]
211                 </table>
212                 [% ELSE %]
213                     <div class="dialog message">
214                         There are no contracts with this vendor.
215                         [% IF active %]
216                             <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&amp;booksellerid=[% booksellerid | uri %]">Add a contract</a>.
217                         [% END %]
218                     </div>
219                 [% END %]
220             [% END %]
221
222             </main>
223         </div> <!-- /.col-sm-10.col-sm-push-2 -->
224
225         <div class="col-sm-2 col-sm-pull-10">
226             <aside>
227                 [% INCLUDE 'acquisitions-menu.inc' %]
228             </aside>
229         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
230      </div> <!-- /.row -->
231
232 [% MACRO jsinclude BLOCK %]
233     [% INCLUDE 'calendar.inc' %]
234     [% Asset.js("js/acq.js") | $raw %]
235     <script>
236         $(document).ready(function(){
237             $("#add_modify_contract").validate({
238                 rules: {
239                     contractstartdate: "required",
240                     contractname: "required",
241                     contractenddate: {
242                         required: true,
243                         date_on_or_after: "#from"
244                     }
245                 },
246                 messages: {
247                     contractenddate: {
248                         date_on_or_after: _("Contract end date must be on or after contract start date")
249                     }
250                 }
251             });
252         });
253     </script>
254 [% END %]
255 [% INCLUDE 'intranet-bottom.inc' %]