Bugzilla – Attachment 61463 Details for
Bug 15766
Give label and patron card batches a description
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15766: Adding descriptions to label batches
Bug-15766-Adding-descriptions-to-label-batches.patch (text/plain), 5.58 KB, created by
Biblibre Sandboxes
on 2017-03-22 15:19:55 UTC
(
hide
)
Description:
Bug 15766: Adding descriptions to label batches
Filename:
MIME Type:
Creator:
Biblibre Sandboxes
Created:
2017-03-22 15:19:55 UTC
Size:
5.58 KB
patch
obsolete
>From fd020ae718321983eb250a907f548603a9857aad Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Wed, 8 Feb 2017 01:26:06 +0000 >Subject: [PATCH] Bug 15766: Adding descriptions to label batches > >Same fix, but for Label creator. Follow same test plan but in >Tools->Label creator. > >Sponsored-by: Catalyst IT > >Signed-off-by: Eric Gosselin <eric.gosselin@inlibro.com> >--- > .../prog/en/modules/labels/label-edit-batch.tt | 33 ++++++++++++++++++++-- > labels/label-edit-batch.pl | 3 ++ > labels/label-manage.pl | 1 + > 3 files changed, 35 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt >index ed905a9..fdb8212 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt >@@ -124,7 +124,7 @@ > return (-1); > }; > >- $(document).ready(function() { >+ $(document).ready(function() { > $("#batcht").dataTable($.extend(true, {}, dataTablesDefaults, { > "autoWidth": false, > "aoColumnDefs": [ >@@ -167,7 +167,33 @@ > var batch_id = $(this).data("batch-id"); > GB_showCenter(_("Export labels"),"/cgi-bin/koha/labels/label-print.pl?batch_id=" + batch_id + "&label_id=" + label_id, 400, 800); > }); >- }); >+ $("#savedesc").click(function(event){ >+ event.preventDefault(); // prevent form submission >+ var newdescription = $(this).siblings('input[name="description"]').val(); >+ var batch_id = $(this).data('batch_id'); >+ var ajaxData = { >+ 'newdescription': newdescription, >+ 'batch_id': batch_id, >+ 'card_element': "batch", >+ }; >+ >+ $.ajax({ >+ url: '/cgi-bin/koha/svc/patroncards', >+ type: 'POST', >+ dataType: 'json', >+ data: ajaxData, >+ }) >+ >+ .done(function(data){ >+ if (data.status == 'success') { >+ $("input[name='description']").text(data.newdesc); >+ $("#change-status").text(_("Saved")); >+ } else { >+ $("#change-status").text(_("Unable to save description")); >+ } >+ }); >+ }); >+ }); > //]]> > </script> > </head> >@@ -208,6 +234,9 @@ > <ol><li> > <input type="hidden" name="op" value="add" /> > <input type="hidden" name="batch_id" value="[% batch_id %]" /> >+ <label for="description">Batch description: </label> >+ <input type="text" name="description" value="[% description %]"> >+ <a href="#" id="savedesc" data-batch_id="[% batch_id %]">Save description</a> <span id="change-status"></span> > </li> > <li> > <input type="radio" name="number_type" id="barcode_enter" value="barcode" checked /> >diff --git a/labels/label-edit-batch.pl b/labels/label-edit-batch.pl >index 5252213..88a9205 100755 >--- a/labels/label-edit-batch.pl >+++ b/labels/label-edit-batch.pl >@@ -62,6 +62,7 @@ my @item_numbers; > my $number_list; > my $number_type = $cgi->param('number_type') || "barcode"; > my $batch_id = $cgi->param('element_id') || $cgi->param('batch_id') || 0; >+my $description = $cgi->param('description') || ''; > @label_ids = $cgi->multi_param('label_id') if $cgi->param('label_id'); > @item_numbers = $cgi->multi_param('item_number') if $cgi->param('item_number'); > $number_list = $cgi->param('number_list') if $cgi->param('number_list'); >@@ -99,6 +100,7 @@ elsif ($op eq 'add') { > } > if ($batch_id != 0) {$batch = C4::Labels::Batch->retrieve(batch_id => $batch_id);} > if ($batch_id == 0 || $batch == -2) {$batch = C4::Labels::Batch->new(branch_code => $branch_code);} >+ $template->param( description => $batch->{description} ); > if ($branch_code){ > foreach my $item_number (@item_numbers) { > $err = $batch->add_item($item_number); >@@ -123,6 +125,7 @@ elsif ($op eq 'de_duplicate') { > } > else { # edit > $batch = C4::Labels::Batch->retrieve(batch_id => $batch_id); >+ $template->param( description => $batch->{description} ); > } > > my $items = $batch->get_attr('items'); >diff --git a/labels/label-manage.pl b/labels/label-manage.pl >index 1d8a34e..8ee73b1 100755 >--- a/labels/label-manage.pl >+++ b/labels/label-manage.pl >@@ -66,6 +66,7 @@ my $display_columns = { layout => [ # db column => {col label > ], > batch => [ > {batch_id => {label => 'Batch ID', link_field => 0}}, >+ {description => {label => 'Description', link_field => 0}}, > {_item_count => {label => 'Item Count', link_field => 0}}, > {select => {label => 'Actions', value => 'batch_id'}}, > {select1 => {label => ' ', link_field => 'batch_id'}}, >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15766
:
59994
|
59998
|
59999
|
61462
|
61463
|
61464
|
63221
|
63222
|
63223
|
66515
|
67305
|
67862
|
68282
|
68359
|
68360
|
68361
|
68362
|
75213
|
75214
|
75215
|
75216
|
75715
|
75843
|
79839
|
79840
|
79841
|
79842
|
79843
|
79844
|
79845
|
79846
|
80446
|
80447
|
80448
|
80449
|
80450
|
80451
|
81070
|
81084
|
81086