View | Details | Raw Unified | Return to bug 15766
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt (-2 / +31 lines)
Lines 124-130 Link Here
124
                return (-1);
124
                return (-1);
125
            };
125
            };
126
126
127
         $(document).ready(function() {
127
        $(document).ready(function() {
128
            $("#batcht").dataTable($.extend(true, {}, dataTablesDefaults, {
128
            $("#batcht").dataTable($.extend(true, {}, dataTablesDefaults, {
129
                "autoWidth": false,
129
                "autoWidth": false,
130
                "aoColumnDefs": [
130
                "aoColumnDefs": [
Lines 167-173 Link Here
167
                var batch_id = $(this).data("batch-id");
167
                var batch_id = $(this).data("batch-id");
168
                GB_showCenter(_("Export labels"),"/cgi-bin/koha/labels/label-print.pl?batch_id=" + batch_id + "&label_id=" + label_id, 400, 800);
168
                GB_showCenter(_("Export labels"),"/cgi-bin/koha/labels/label-print.pl?batch_id=" + batch_id + "&label_id=" + label_id, 400, 800);
169
            });
169
            });
170
         });
170
            $("#savedesc").click(function(event){
171
                event.preventDefault(); // prevent form submission
172
                var newdescription = $(this).siblings('input[name="description"]').val();
173
                var batch_id = $(this).data('batch_id');
174
                var ajaxData = {
175
                    'newdescription': newdescription,
176
                    'batch_id': batch_id,
177
                    'card_element': "batch",
178
                    };
179
180
                $.ajax({
181
                    url: '/cgi-bin/koha/svc/patroncards',
182
                    type: 'POST',
183
                    dataType: 'json',
184
                    data: ajaxData,
185
                })
186
187
                .done(function(data){
188
                    if (data.status == 'success') {
189
                        $("input[name='description']").text(data.newdesc);
190
                        $("#change-status").text(_("Saved"));
191
                    } else {
192
                        $("#change-status").text(_("Unable to save description"));
193
                    }
194
                });
195
            });
196
        });
171
    //]]>
197
    //]]>
172
    </script>
198
    </script>
173
</head>
199
</head>
Lines 208-213 Link Here
208
                                    <ol><li>
234
                                    <ol><li>
209
                                        <input type="hidden" name="op" value="add" />
235
                                        <input type="hidden" name="op" value="add" />
210
                                        <input type="hidden" name="batch_id" value="[% batch_id %]" />
236
                                        <input type="hidden" name="batch_id" value="[% batch_id %]" />
237
                                        <label for="description">Batch description: </label>
238
                                        <input type="text" name="description" value="[% description %]">
239
                                        <a href="#" id="savedesc" data-batch_id="[% batch_id %]">Save description</a> <span id="change-status"></span>
211
                                    </li>
240
                                    </li>
212
                                    <li>
241
                                    <li>
213
                                        <input type="radio" name="number_type" id="barcode_enter" value="barcode" checked />
242
                                        <input type="radio" name="number_type" id="barcode_enter" value="barcode" checked />
(-)a/labels/label-edit-batch.pl (+3 lines)
Lines 62-67 my @item_numbers; Link Here
62
my $number_list;
62
my $number_list;
63
my $number_type = $cgi->param('number_type') || "barcode";
63
my $number_type = $cgi->param('number_type') || "barcode";
64
my $batch_id = $cgi->param('element_id') || $cgi->param('batch_id') || 0;
64
my $batch_id = $cgi->param('element_id') || $cgi->param('batch_id') || 0;
65
my $description = $cgi->param('description') || '';
65
@label_ids = $cgi->multi_param('label_id') if $cgi->param('label_id');
66
@label_ids = $cgi->multi_param('label_id') if $cgi->param('label_id');
66
@item_numbers = $cgi->multi_param('item_number') if $cgi->param('item_number');
67
@item_numbers = $cgi->multi_param('item_number') if $cgi->param('item_number');
67
$number_list = $cgi->param('number_list') if $cgi->param('number_list');
68
$number_list = $cgi->param('number_list') if $cgi->param('number_list');
Lines 99-104 elsif ($op eq 'add') { Link Here
99
    }
100
    }
100
    if ($batch_id != 0) {$batch = C4::Labels::Batch->retrieve(batch_id => $batch_id);}
101
    if ($batch_id != 0) {$batch = C4::Labels::Batch->retrieve(batch_id => $batch_id);}
101
    if ($batch_id == 0 || $batch == -2) {$batch = C4::Labels::Batch->new(branch_code => $branch_code);}
102
    if ($batch_id == 0 || $batch == -2) {$batch = C4::Labels::Batch->new(branch_code => $branch_code);}
103
    $template->param( description => $batch->{description} );
102
    if ($branch_code){
104
    if ($branch_code){
103
        foreach my $item_number (@item_numbers) {
105
        foreach my $item_number (@item_numbers) {
104
            $err = $batch->add_item($item_number);
106
            $err = $batch->add_item($item_number);
Lines 123-128 elsif ($op eq 'de_duplicate') { Link Here
123
}
125
}
124
else { # edit
126
else { # edit
125
    $batch = C4::Labels::Batch->retrieve(batch_id => $batch_id);
127
    $batch = C4::Labels::Batch->retrieve(batch_id => $batch_id);
128
    $template->param( description => $batch->{description} );
126
}
129
}
127
130
128
my $items = $batch->get_attr('items');
131
my $items = $batch->get_attr('items');
(-)a/labels/label-manage.pl (-1 / +1 lines)
Lines 66-71 my $display_columns = { layout => [ # db column => {col label Link Here
66
                                    ],
66
                                    ],
67
                        batch =>    [
67
                        batch =>    [
68
                                        {batch_id        => {label => 'Batch ID',       link_field      => 0}},
68
                                        {batch_id        => {label => 'Batch ID',       link_field      => 0}},
69
                                        {description     => {label => 'Description',    link_field      => 0}},
69
                                        {_item_count     => {label => 'Item Count',     link_field      => 0}},
70
                                        {_item_count     => {label => 'Item Count',     link_field      => 0}},
70
                                        {select          => {label => 'Actions',         value           => 'batch_id'}},
71
                                        {select          => {label => 'Actions',         value           => 'batch_id'}},
71
                                        {select1         => {label => ' ',           link_field       => 'batch_id'}},
72
                                        {select1         => {label => ' ',           link_field       => 'batch_id'}},
72
- 

Return to bug 15766