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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt (-3 / +22 lines)
Lines 333-339 function placeHold () { Link Here
333
        [% CASE 'error_on_delete' %]
333
        [% CASE 'error_on_delete' %]
334
            <span>An error occurred when deleting this list.</span>
334
            <span>An error occurred when deleting this list.</span>
335
        [% CASE 'error_on_add_biblio' %]
335
        [% CASE 'error_on_add_biblio' %]
336
           <span>The item ([% m.item_barcode %]) has not been added to the list. Please verify it is not already in the list.</span>
336
            [% IF m.item_barcode %]
337
               <span>The item ([% m.item_barcode %]) has not been added to the list. Please verify it is not already in the list.</span>
338
            [% ELSE %]
339
                <span>The record ([% m.bibnum %]) has not been added to the list. Please verify it is not already in the list.</span>
340
            [% END %]
337
        [% CASE 'success_on_update' %]
341
        [% CASE 'success_on_update' %]
338
            <span>List updated.</span>
342
            <span>List updated.</span>
339
        [% CASE 'success_on_insert' %]
343
        [% CASE 'success_on_insert' %]
Lines 341-353 function placeHold () { Link Here
341
        [% CASE 'success_on_delete' %]
345
        [% CASE 'success_on_delete' %]
342
            <span>List deleted.</span>
346
            <span>List deleted.</span>
343
        [% CASE 'success_on_add_biblio' %]
347
        [% CASE 'success_on_add_biblio' %]
344
            <span>The item ([% m.item_barcode %]) has been added to the list.</span>
348
            [% IF m.item_barcode %]
349
                <span>The item ([% m.item_barcode %]) has been added to the list.</span>
350
            [% ELSE %]
351
                <span>The record ([% m.bibnum %]) has been added to the list.</span>
352
            [% END %]
345
        [% CASE 'success_on_remove_biblios' %]
353
        [% CASE 'success_on_remove_biblios' %]
346
            <span>The item has been removed from the list.</span>
354
            <span>The item has been removed from the list.</span>
347
        [% CASE 'does_not_exist' %]
355
        [% CASE 'does_not_exist' %]
348
            <span>This list does not exist.</span>
356
            <span>This list does not exist.</span>
349
        [% CASE 'item_does_not_exist' %]
357
        [% CASE 'item_does_not_exist' %]
350
            <span>The item ([% m.item_barcode %]) does not exist.</span>
358
            [% IF m.item_barcode %]
359
                <span>The item ([% m.item_barcode %]) does not exist.</span>
360
            [% ELSE %]
361
                <span>The record ([% m.bibnum %]) does not exist.</span>
362
            [% END %]
351
        [% CASE 'unauthorized_on_view' %]
363
        [% CASE 'unauthorized_on_view' %]
352
            <span>You do not have permission to view this list.</span>
364
            <span>You do not have permission to view this list.</span>
353
        [% CASE 'unauthorized_on_update' %]
365
        [% CASE 'unauthorized_on_update' %]
Lines 668-673 function placeHold () { Link Here
668
          <input type="hidden" name="referer" value="view" />
680
          <input type="hidden" name="referer" value="view" />
669
          <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber %]" />
681
          <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber %]" />
670
        </li>
682
        </li>
683
        <li>
684
          <label for="biblionumbers">Biblio numbers:</label>
685
          <textarea name="biblionumbers" id="biblionumbers" class="focus" autocomplete="off" rows="5"></textarea>
686
          <input type="hidden" name="op" value="add_biblio" />
687
          <input type="hidden" name="referer" value="view" />
688
          <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber %]" />
689
        </li>
671
      </ol>
690
      </ol>
672
      <fieldset class="action">
691
      <fieldset class="action">
673
        <input type="submit" value="Add" />
692
        <input type="submit" value="Add" />
(-)a/virtualshelves/shelves.pl (-1 / +24 lines)
Lines 165-170 if ( $op eq 'add_form' ) { Link Here
165
                push @messages, { type => 'alert', code => 'unauthorized_on_add_biblio' };
165
                push @messages, { type => 'alert', code => 'unauthorized_on_add_biblio' };
166
            }
166
            }
167
        }
167
        }
168
        if ( my $biblionumbers = $query->param('biblionumbers') ) {
169
            if ( $shelf->can_biblios_be_added( $loggedinuser ) ) {
170
                my @biblionumbers = split /\n/, $biblionumbers;
171
                foreach my $biblionumber (@biblionumbers) {
172
                    $biblionumber =~ s/\r$//; # strip any naughty return chars
173
                    next if $biblionumber eq '';
174
                    my $biblio = GetBiblio($biblionumber);
175
                    if (defined $biblio) {
176
                        my $added = eval { $shelf->add_biblio( $biblionumber, $loggedinuser ); };
177
                        if ($@) {
178
                            push @messages, { bibnum => $biblionumber, type => 'alert', code => ref($@), msg => $@ };
179
                        } elsif ( $added ) {
180
                            push @messages, { bibnum => $biblionumber, type => 'message', code => 'success_on_add_biblio' };
181
                        } else {
182
                            push @messages, { bibnum => $biblionumber, type => 'message', code => 'error_on_add_biblio' };
183
                        }
184
                    } else {
185
                        push @messages, { bibnum => $biblionumber, type => 'alert', code => 'item_does_not_exist' };
186
                    }
187
                }
188
            } else {
189
                push @messages, { type => 'alert', code => 'unauthorized_on_add_biblio' };
190
            }
191
        }
168
    } else {
192
    } else {
169
        push @messages, { type => 'alert', code => 'does_not_exist' };
193
        push @messages, { type => 'alert', code => 'does_not_exist' };
170
    }
194
    }
171
- 

Return to bug 17214