Bug 26160: Make POS items table configurable
[koha-equinox.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / columns_settings.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE TablesSettings %]
4 [% SET footerjs = 1 %]
5 [% SET panel_id = 0 %]
6 [% BLOCK pagelist %]
7     [% IF module.keys and module.keys.size > 0 %]
8         Jump to:
9         [% FOR pagename IN module.keys %]
10             <a href="#[% pagename | url %]">[% pagename | html %]</a>
11             [% UNLESS loop.last %]<span class="separator"> | </span>[% END %]
12         [% END %]
13     [% END %]
14     <div class="pagelist">
15         <form method="post" action="/cgi-bin/koha/admin/columns_settings.pl">
16             <input type="hidden" name="action" value="save" />
17             <input type="hidden" name="module" value="[% modulename | html %]" />
18             <input type="hidden" name="panel" value="[% panel_id | html %]" />
19             [% SET panel_id = panel_id + 1 %]
20             [% IF module.keys and module.keys.size > 0 %]
21                 [% FOR pagename IN module.keys %]
22                     <h4 class="page_name" id="[% pagename | html %]">Page: [% pagename | html %]</h4>
23                     [% SET tables = module %]
24                     [% IF tables.$pagename.keys and tables.$pagename.keys.size > 0 %]
25                         [% FOR tablename IN tables.$pagename.keys.sort %]
26                             [% SET table_id = pagename _ '#' _ tablename %]
27                             <div class="datatable_config" id="[% table_id | html %]">
28                                 <input type="hidden" name="table_id" value="[% table_id| html %]" />
29                                 [% IF pagename == 'additem' AND tablename == 'itemst' %]
30                                     <div class="alert">Changes made below will only apply to item subfields that are mapped to the 'items' table. <a href="/cgi-bin/koha/admin/koha2marclinks.pl?tablename=items">Go to Koha to MARC mapping</a></div>
31                                 [% END %]
32                                 <table>
33                                     <caption>
34                                         [% IF tablename == 'currencies-table' %]
35                                             Currency
36                                         [% ELSIF pagename == 'additem' AND tablename == 'itemst' %]
37                                             Items Editor
38                                         [% ELSE %]
39                                             Table id: [% tablename | html %]
40                                         [% END %]
41                                     </caption>
42                                     <thead>
43                                         <tr>
44                                             <th>Column name</th>
45                                             <th>Is hidden by default</th>
46                                             <th>Cannot be toggled</th>
47                                         </tr>
48                                     </thead>
49                                     <tbody>
50                                         [% FOR column IN tables.$pagename.$tablename.columns %]
51                                             [% SET value = pagename _ '#' _ tablename _ '#' _ column.columnname %]
52                                             <tr>
53                                                 <td>
54                                                     [% column.columnname | html %]
55                                                     <input type="hidden" name="columnid" value="[% value | html %]" />
56                                                 </td>
57                                                 <td>
58                                                     [% IF column.is_hidden %]
59                                                         [% IF column.cannot_be_modified %]
60                                                             <input type="checkbox" name="[% value | html %]_hidden" value="1" checked="checked" disabled="disabled" />
61                                                             <input type="hidden" name="[% value | html %]_hidden" value="1" />
62                                                         [% ELSE %]
63                                                             <input type="checkbox" name="[% value | html %]_hidden" value="1" checked="checked" />
64                                                         [% END %]
65                                                     [% ELSE %]
66                                                         [% IF column.cannot_be_modified %]
67                                                             <input type="checkbox" name="[% value | html %]_hidden" value="1" disabled="disabled" />
68                                                             <input type="hidden" name="[% value | html %]_hidden" value="0" />
69                                                         [% ELSE %]
70                                                             <input type="checkbox" name="[% value | html %]_hidden" value="1" />
71                                                         [% END %]
72                                                     [% END %]
73                                                 </td>
74                                                 <td>
75                                                     [% IF column.cannot_be_toggled %]
76                                                         [% IF column.cannot_be_modified %]
77                                                             <input type="checkbox" name="[% value | html %]_cannot_be_toggled" value="1" checked="checked" disabled="disabled" />
78                                                             <input type="hidden" name="[% value | html %]_cannot_be_toggled" value="1" />
79                                                         [% ELSE %]
80                                                             <input type="checkbox" name="[% value | html %]_cannot_be_toggled" value="1" checked="checked" />
81                                                         [% END %]
82                                                     [% ELSE %]
83                                                         [% IF column.cannot_be_modified %]
84                                                             <input type="checkbox" name="[% value | html %]_cannot_be_toggled" value="1" disabled="disabled" />
85                                                             <input type="hidden" name="[% value | html %]_cannot_be_toggled" value="0" />
86                                                         [% ELSE %]
87                                                             <input type="checkbox" name="[% value | html %]_cannot_be_toggled" value="1" />
88                                                         [% END %]
89                                                     [% END %]
90                                                 </td>
91                                             </tr>
92                                         [% END %]
93                                     </tbody>
94                                 </table>
95                                 [% SET table_settings = TablesSettings.GetTableSettings( modulename, pagename, tablename ) %]
96                                 [% IF table_settings.default_display_length %]
97                                     <p>
98                                         Default display length:
99                                         <select name="[% table_id | html %]_default_display_length">
100                                             [% IF table_settings.default_display_length == 10 %]
101                                                 <option value="10" selected="selected">10</option>
102                                             [% ELSE %]
103                                                 <option value="10">10</option>
104                                             [% END %]
105                                             [% IF table_settings.default_display_length == 20 %]
106                                                 <option value="20" selected="selected">20</option>
107                                             [% ELSE %]
108                                                 <option value="20">20</option>
109                                             [% END %]
110                                             [% IF table_settings.default_display_length == 50 %]
111                                                 <option value="50" selected="selected">50</option>
112                                             [% ELSE %]
113                                                 <option value="50">50</option>
114                                             [% END %]
115                                             [% IF table_settings.default_display_length == 100 %]
116                                                 <option value="100" selected="selected">100</option>
117                                             [% ELSE %]
118                                                 <option value="100">100</option>
119                                             [% END %]
120                                             [% IF table_settings.default_display_length == -1 %]
121                                                 <option value="-1" selected="selected">All</option>
122                                             [% ELSE %]
123                                                 <option value="-1">All</option>
124                                             [% END %]
125                                         </select>
126                                     </p>
127                                 [% END %]
128                                 [% IF table_settings.default_sort_order.defined %]
129                                     <p>
130                                         Default sort order:
131                                         <select name="[% pagename | html %]#[% tablename | html %]_default_sort_order">
132                                             [% FOR column IN tables.$pagename.$tablename.columns %]
133                                                 [% IF table_settings.default_sort_order == loop.count - 1 %]
134                                                     <option value="[% loop.count - 1 %]" selected="selected">[% column.columnname | html %]</option>
135                                                 [% ELSE %]
136                                                     <option value="[% loop.count - 1 %]">[% column.columnname | html %]</option>
137                                                 [% END %]
138                                             [% END %]
139                                         </select>
140                                     </p>
141                                 [% END %]
142
143                             </div>
144                         [% END %]
145                         <fieldset class="action">
146                             <input type="submit" value="Save" />
147                         </fieldset>
148                     [% ELSE %]
149                         There is no table to configure for this module.
150                     [% END %]
151                 [% END %]
152             [% ELSE %]
153                 There is no page using the table configuration in this module.
154             [% END %]
155         </form>
156     </div>
157 [% END %]
158
159 [% INCLUDE 'doc-head-open.inc' %]
160 <title>Koha &rsaquo; Administration &rsaquo; Table settings</title>
161 [% INCLUDE 'doc-head-close.inc' %]
162 <style>
163     caption {
164         font-size: 115%;
165     }
166
167     .datatable_config {
168         margin-left: 1em;
169     }
170     .page_name {
171         border-top: 1px solid #b9d8d9;
172         margin-top: 1em;
173         padding-top: 1em;
174     }
175 </style>
176 </head>
177
178 <body id="admin_tables" class="admin">
179
180     [% INCLUDE 'header.inc' %]
181     [% INCLUDE 'prefs-admin-search.inc' %]
182     <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; Table settings</div>
183
184     <div class="main container-fluid">
185         <div class="row">
186                 <div class="col-sm-10 col-sm-push-2">
187                         <main>
188
189                             <h2>Table settings</h2>
190                             <div id="modules">
191                                 <div class="panel_header"><a href="#acqui">Acquisition</a></div>
192                                 <div id="acqui">
193                                     <h3>Acquisition tables</h3>
194                                     [% PROCESS pagelist module=modules.acqui modulename="acqui" %]
195                                 </div>
196
197                                 <div class="panel_header"><a href="#admin">Administration</a></div>
198                                 <div id="admin">
199                                     <h3>Administration tables</h3>
200                                     [% PROCESS pagelist module=modules.admin modulename="admin" %]
201                                 </div>
202
203                                 <div class="panel_header"><a href="#authorities">Authorities</a></div>
204                                 <div id="authorities">
205                                     <h3>Authorities tables</h3>
206                                     [% PROCESS pagelist module=modules.authorities modulename="authorities" %]
207                                 </div>
208
209                                 <div class="panel_header"><a href="#catalog">Catalog</a></div>
210                                 <div id="catalogue">
211                                     <h3>Catalogue tables</h3>
212                                     [% PROCESS pagelist module=modules.catalogue modulename="catalogue" %]
213                                 </div>
214
215                                 <div class="panel_header"><a href="#cataloguing">Cataloging</a></div>
216                                 <div id="cataloguing">
217                                     <h3>Cataloguing tables</h3>
218                                     [% PROCESS pagelist module=modules.cataloguing modulename="cataloguing" %]
219                                 </div>
220
221                                 <div class="panel_header"><a href="#circulation">Circulation</a></div>
222                                 <div id="circulation">
223                                     <h3>Circulation tables</h3>
224                                     [% PROCESS pagelist module=modules.circ modulename="circ" %]
225                                 </div>
226
227                                 <div class="panel_header"><a href="#coursereserves">Course reserves</a></div>
228                                 <div id="coursereserves">
229                                     <h3>Course reserves tables</h3>
230                                     [% PROCESS pagelist module=modules.coursereserves modulename="coursereserves" %]
231                                 </div>
232
233                                 <div class="panel_header"><a href="#ill">Interlibrary loans</a></div>
234                                 <div id="ill">
235                                     <h3>Interlibrary loans tables</h3>
236                                     [% PROCESS pagelist module=modules.illrequests modulename="illrequests" %]
237                                 </div>
238
239                                 <div class="panel_header"><a href="#members">Patrons</a></div>
240                                 <div id="members">
241                                     <h3>Patrons tables</h3>
242                                     [% PROCESS pagelist module=modules.members modulename="members" %]
243                                 </div>
244
245                                 <div class="panel_header"><a href="#pos">Point of sale</a></div>
246                                 <div id="pos">
247                                     <h3>Point of sale tables</h3>
248                                     [% PROCESS pagelist module=modules.pos modulename="pos" %]
249                                 </div>
250
251                                 <div class="panel_header"><a href="#tools">Tools</a></div>
252                                 <div id="tools">
253                                     <h3>Tools tables</h3>
254                                     [% PROCESS pagelist module=modules.tools modulename="tools" %]
255                                 </div>
256
257                                 <div class="panel_header"><a href="#opac">OPAC</a></div>
258                                 <div id="opac">
259                                     <h3>OPAC tables</h3>
260                                     [% PROCESS pagelist module=modules.opac modulename="opac" %]
261                                 </div>
262
263                                 <div class="panel_header"><a href="#reports">Reports</a></div>
264                                 <div id="reports">
265                                     <h3>Reports tables</h3>
266                                     [% PROCESS pagelist module=modules.reports modulename="reports" %]
267                                 </div>
268
269                                 <div class="panel_header"><a href="#serials">Serials</a></div>
270                                 <div id="serials">
271                                     <h3>Serials tables</h3>
272                                     [% PROCESS pagelist module=modules.serials modulename="serials" %]
273                                 </div>
274
275                             </div>
276                         </main>
277                 </div> <!-- /.col-sm-10.col-sm-push-2 -->
278
279                 <div class="col-sm-2 col-sm-pull-10">
280                         <aside>
281                                 [% INCLUDE 'admin-menu.inc' %]
282                         </aside>
283                 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
284         </div> <!-- /.row -->
285
286 [% MACRO jsinclude BLOCK %]
287     [% Asset.js("js/admin-menu.js") | $raw %]
288     <script>
289         $(document).ready( function() {
290             var accordion = $( "#modules" ).accordion({
291                     collapsible: true,
292                     heightStyle: "content",
293                     header: ".panel_header",
294                 [%- IF panel -%]
295                     [%# we were asked to show a specific panel, usually on update %]
296                     active: [%- panel | html -%]
297                 [%- ELSE -%]
298                     active: false
299                 [%- END -%]
300             });
301         });
302     </script>
303 [% END %]
304 [% INCLUDE 'intranet-bottom.inc' %]