bug 15112: Make greybox consistent size across label/card creator
authorLiz Rea <liz@catalyst.net.nz>
Mon, 2 Nov 2015 23:20:25 +0000 (12:20 +1300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Thu, 5 Nov 2015 12:51:03 +0000 (09:51 -0300)
Also fixes minor issue with buttons stacking on patroncards/edit-batch
and labels/label-manage

To test:

Export a batch every way you can:

multiple together from label/label-manage
individual items from labels/label-edit-batch
selected items from labels/label-edit-batch
export full batch from labels/label-edit-batch

multiple together from patroncards/manage
individual cards from patroncards/manage
individual cards from patroncards/edit-batch
selected cards from patroncards/edit-batch
export full batch from patroncards/edit-batch

Also notice that before this patch, the delete and export buttons
were stacking on the table rows, and  that now they are not doing
that anymore. It may take a force refresh to see the behaviour and
the change.

Signed-off-by: Marc VĂ©ron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt
koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt
koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt
koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt

index 6f2bbad..362ea8c 100644 (file)
                         alert(_("Please select at least one label to export."));
                         return;     // no batch selected
                     }
-                    return GB_showCenter('Export labels', "/cgi-bin/koha/labels/label-print.pl?batch_id=[% batch_id %]&" + getstr, 700, 800);
+                    return GB_showCenter('Export labels', "/cgi-bin/koha/labels/label-print.pl?batch_id=[% batch_id %]&" + getstr, 400, 800);
                 }
                 else if (mode == 'batch') {
-                    return GB_showCenter('Export labels', "/cgi-bin/koha/labels/label-print.pl?batch_id=[% batch_id %]", 700, 800);
+                    return GB_showCenter('Export labels', "/cgi-bin/koha/labels/label-print.pl?batch_id=[% batch_id %]", 400, 800);
                 }
                 else {
                     // some pass-thru error trapping just in case...
 
          $(document).ready(function() {
             $("#batcht").dataTable($.extend(true, {}, dataTablesDefaults, {
+                "autoWidth": false,
                 "aoColumnDefs": [
                     { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
-                    { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }
+                    { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
                 ],
                 "aaSorting": [[ 0, "asc" ]],
                 "sPaginationType": "four_button"
                                                     <tr>
                                                         [% FOREACH text_field IN table_loo.text_fields %]
                                                             [% IF ( text_field.select_field ) %]
-                                                                <td><a class="btn btn-mini" onclick="return confirm(MSG_CONFIRM_DELETE);" href="/cgi-bin/koha/labels/label-edit-batch.pl?op=remove&amp;batch_id=[% batch_id |url %]&amp;label_id=[% text_field.field_value |url %]"><icon class="fa fa-trash"></icon> Delete</a> <a class="btn btn-mini" href="#" onclick="GB_showCenter('Export labels','/cgi-bin/koha/labels/label-print.pl?batch_id=[% batch_id %]&amp;label_id=[% text_field.field_value |url %]')"><icon class="fa fa-share-square-o"></icon> Export</a></td>
+                                                                <td><a class="btn btn-mini" onclick="return confirm(MSG_CONFIRM_DELETE);" href="/cgi-bin/koha/labels/label-edit-batch.pl?op=remove&amp;batch_id=[% batch_id |url %]&amp;label_id=[% text_field.field_value |url %]"><icon class="fa fa-trash"></icon> Delete</a><a class="btn btn-mini" href="#" onclick="GB_showCenter('Export labels','/cgi-bin/koha/labels/label-print.pl?batch_id=[% batch_id %]&amp;label_id=[% text_field.field_value |url %]', 400, 800)"><icon class="fa fa-share-square-o"></icon> Export</a></td>
                                                                 <td><center><input type="checkbox" name="action" value="[% text_field.field_value %]"></center></td>
                                                             [% ELSE %]
                                                                 <td>
index dfa17de..6a89aaf 100644 (file)
@@ -38,7 +38,7 @@
                     alert(_("Please select at least one batch to export."));
                     return;     // no batch selected
                 }
-                return GB_showCenter('Export Labels', "/cgi-bin/koha/labels/label-print.pl?" + getstr, 700, 800);
+                return GB_showCenter('Export Labels', "/cgi-bin/koha/labels/label-print.pl?" + getstr, 400, 800);
             };
             function selected_layout(op) {
                 var selected = new Array;
index 32e6924..d53b843 100644 (file)
                         alert(_("Please select at least one card to export."));
                         return;     // no batch selected
                     }
-                    return GB_showCenter(_("Export patron cards"), "/cgi-bin/koha/patroncards/print.pl?batch_id=[% batch_id %]&" + getstr, 700, 800);
+                    return GB_showCenter(_("Export patron cards"), "/cgi-bin/koha/patroncards/print.pl?batch_id=[% batch_id %]&" + getstr, 400, 800);
                 }
                 else if (mode == 'batch') {
-                    return GB_showCenter(_("Export patron cards"), "/cgi-bin/koha/patroncards/print.pl?batch_id=[% batch_id %]", 700, 800);
+                    return GB_showCenter(_("Export patron cards"), "/cgi-bin/koha/patroncards/print.pl?batch_id=[% batch_id %]", 400, 800);
                 }
                 else {
                     // some pass-thru error trapping just in case...
                     { "aTargets": [ -2, -1 ], "bSortable": false, "bSearchable": false }
                 ],
                 "aaSorting": [[ 0, "asc" ]],
-                "sPaginationType": "four_button"
+                "sPaginationType": "four_button",
+                "autoWidth": false
             }));
             $("#additems").click(function(){
                 Add();
index 7641a48..0812da4 100644 (file)
@@ -86,7 +86,7 @@
                     alert(_("Please select at least one batch to export."));
                     return;     // no batch selected
                 }
-                return GB_showCenter(_("Export patron cards"), "/cgi-bin/koha/patroncards/print.pl?" + getstr, 700, 800);
+                return GB_showCenter(_("Export patron cards"), "/cgi-bin/koha/patroncards/print.pl?" + getstr, 400, 800);
             };
             function selected_layouts(op) {
                 if (document.layouts.action.length) {
                                 [% IF ( text_field.select_field ) %]
                                     <td>
                                       <a class="btn btn-mini" href="/cgi-bin/koha/patroncards/edit-[% card_element %].pl?op=edit&element_id=[% text_field.field_value %]"><icon class="fa fa-edit"></icon> Edit</a>
-                                      [% IF ( print ) %]<a class="btn btn-mini" href="#" onclick="GB_showCenter('Export single batch','/cgi-bin/koha/patroncards/print.pl?batch_id=[% text_field.field_value |url %]')"><icon class="fa fa-share-square-o"></icon> Export</a>[% END %]
+                                      [% IF ( print ) %]<a class="btn btn-mini" href="#" onclick="GB_showCenter('Export single batch','/cgi-bin/koha/patroncards/print.pl?batch_id=[% text_field.field_value |url %]', 400, 800)"><icon class="fa fa-share-square-o"></icon> Export</a>[% END %]
                                       <a class="btn btn-mini" onclick="return confirm(MSG_CONFIRM_DELETE);" href="/cgi-bin/koha/patroncards/manage.pl?op=delete&card_element=[% card_element %]&element_id=[% text_field.field_value %]"><icon class="fa fa-trash"></icon> Delete</a>
                                     </td>
                                     [% IF ( print ) %]<td align="center"><input type="checkbox" name="action" value="[% text_field.field_value %]" /></td>[% END %]