Merge branch 'bug_9436' into 3.12-master
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / cities.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Administration &rsaquo; [% IF ( add_form ) %]Cities &rsaquo; [% IF ( cityid ) %] Modify city[% ELSE %] New city[% END %][% ELSE %][% IF ( delete_confirm ) %]Cities &rsaquo; Confirm deletion of city[% ELSE %] Cities[% END %][% END %]</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
5 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
6 [% INCLUDE 'datatables-strings.inc' %]
7 <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
8 <script type="text/javascript">
9 //<![CDATA[
10     function Check(f) {
11         if (f.city_zipcode.value.length == 0 && f.city_name.value.length == 0 ) {
12             alert(_("City name & zipcode missing"));
13         } else{
14             document.Aform.submit();
15         }
16     }
17     $(document).ready(function() {
18         $("#table_cities").dataTable($.extend(true, {}, dataTablesDefaults, {
19             "aoColumnDefs": [
20                 { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
21             ],
22             "aaSorting": [[ 1, "asc" ]],
23             "iDisplayLength": 10,
24             "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
25         }));
26     });
27 //]]>
28 </script>
29 </head>
30 <body id="admin_cities" class="admin">
31 [% INCLUDE 'header.inc' %]
32 [% INCLUDE 'cities-admin-search.inc' %]
33
34 <div id="breadcrumbs">
35     <a href="/cgi-bin/koha/mainpage.pl">Home</a>
36     &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
37     &rsaquo; <a href="/cgi-bin/koha/admin/cities.pl">Cities</a>
38     [% IF ( add_form ) %]
39     &rsaquo; [% IF ( cityid ) %]Modify[% ELSE %]New[% END %] City
40     [% ELSIF ( delete_confirm ) %]
41     &rsaquo; Confirm deletion of city
42     [% END %]
43 </div>
44
45 <div id="doc3" class="yui-t2">
46    
47    <div id="bd">
48         <div id="yui-main">
49         <div class="yui-b">
50
51 [% IF ( add_form ) %]
52         [% IF ( cityid ) %]
53                 <h1>Modify a city</h1>
54         [% ELSE %]
55                 <h1>New city</h1>
56         [% END %]
57
58         <form action="[% script_name %]" name="Aform" method="post">
59         <input type="hidden" name="op" value="add_validate" />
60         <input type="hidden" name="checked" value="0" />
61         <input type="hidden" name="cityid" value="[% cityid %]" />
62
63 <fieldset class="rows"><ol>     [% IF ( cityid ) %]
64                 <li>
65                 <span class="label">City ID: </span>[% cityid %]</li>
66         [% END %]
67         <li>
68         <label for="city_name" class="required" title="required">City: </label>
69         <input type="text" name="city_name" id="city_name" size="80" maxlength="100" value="[% city_name |html %]" />
70         </li>
71         <li>
72         <label for="city_state">State: </label>
73         <input type="text" name="city_state" id="city_state" size="80" maxlength="100" value="[% city_state |html %]" />
74         </li>
75         <li>                            
76         <label for="city_zipcode" class="required" title="required">Zip/Postal code: </label>
77         <input type="text" name="city_zipcode" id="city_zipcode" size="20" maxlength="20" value="[% city_zipcode %]" />
78         </li>
79         <li>
80         <label for="city_country">Country: </label>
81         <input type="text" name="city_country" id="city_country" size="80" maxlength="100" value="[% city_country |html %]" />
82         </li></ol></fieldset>
83         
84         <fieldset class="action">
85                 <input class="button" type="button" onclick="Check(this.form)" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/admin/cities.pl">Cancel</a>
86         </fieldset>
87         </form>
88
89 [% END %]
90 [% IF ( delete_confirm ) %]
91     <div class="dialog alert">
92     <h3>Delete City "[% city_name %]?"</h3>
93     <table>
94         <tr><th>City id</th>
95             <td>[% cityid %]</td>
96         </tr>
97         <tr><th>City</th>
98             <td>[% city_name %]</td>
99         </tr>
100         <tr><th>State</th>
101             <td>[% city_state %]</td>
102         </tr>
103         <tr><th>Zip/Postal code</th>
104             <td>[% city_zipcode %]</td>
105         </tr>
106         <tr><th>Country</th>
107             <td>[% city_country %]</td>
108         </tr>
109     </table>
110     <form action="[% script_name %]" method="post">
111         <input type="hidden" name="op" value="delete_confirmed" />
112         <input type="hidden" name="cityid" value="[% cityid %]" />
113         <input type="submit" class="approve" value="Yes, Delete" />
114     </form>
115     <form action="[% script_name %]" method="get">
116         <input type="submit" class="deny" value="No, do not Delete" />
117     </form>
118 </div>
119 [% END %]
120
121 [% IF ( else ) %]
122
123 <div id="toolbar" class="btn-toolbar">
124     <a class="btn btn-small" id="newcity" href="[% script_name %]?op=add_form"><i class="icon-plus"></i> New city</a>
125 </div>
126
127         <h2>Cities</h2>
128         [% IF ( searchfield ) %]
129                 Searching: [% searchfield %]
130         [% END %]
131
132 [% IF ( loop ) %]
133 <table id="table_cities">
134                 <thead>
135                         <th>City ID</th>
136                         <th>City</th>
137                         <th>State</th>
138                         <th>Zip/Postal code</th>
139                         <th>Country</th>
140                         <th>&nbsp;</th>
141                         <th>&nbsp;</th>
142                 </thead>
143                 [% FOREACH loo IN loop %]
144                 [% UNLESS ( loop.odd ) %]
145                 <tr class="highlight">
146                 [% ELSE %]
147                 <tr>
148                 [% END %]
149                         <td>[% loo.cityid %]</td>
150                         <td>[% loo.city_name %]</td>
151                         <td>[% loo.city_state %]</td>
152                         <td>[% loo.city_zipcode %]</td>
153                         <td>[% loo.city_country %]</td>
154                         <td><a href="[% loo.script_name %]?op=add_form&amp;cityid=[% loo.cityid %]">Edit</a></td>
155                         <td><a href="[% loo.script_name %]?op=delete_confirm&amp;cityid=[% loo.cityid %]">Delete</a></td>
156                 </tr>
157                 [% END %]
158         </table>[% END %]
159 [% END %]
160
161 </div>
162 </div>
163 <div class="yui-b">
164 [% INCLUDE 'admin-menu.inc' %]
165 </div>
166 </div>
167 [% INCLUDE 'intranet-bottom.inc' %]
168