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

(-)a/C4/Items.pm (-6 / +4 lines)
Lines 1376-1395 sub GetItemsInfo { Link Here
1376
1376
1377
        my $av;
1377
        my $av;
1378
        # get notforloan complete status if applicable
1378
        # get notforloan complete status if applicable
1379
        $av = Koha::AuthorisedValues->search_by_koha_field({frameworkcode => $data->{frameworkcode}, kohafield => 'items.notforloan', authorised_value => $data->{itemnotforloan} });
1379
        $av = Koha::AuthorisedValues->find_by_koha_field({frameworkcode => $data->{frameworkcode}, kohafield => 'items.notforloan', authorised_value => $data->{itemnotforloan} });
1380
        $av = $av->count ? $av->next : undef;
1381
        $data->{notforloanvalue}     = $av ? $av->lib : '';
1380
        $data->{notforloanvalue}     = $av ? $av->lib : '';
1382
        $data->{notforloanvalueopac} = $av ? $av->opac_description : '';
1381
        $data->{notforloanvalueopac} = $av ? $av->opac_description : '';
1383
1382
1384
        # get restricted status and description if applicable
1383
        # get restricted status and description if applicable
1385
        $av = Koha::AuthorisedValues->search_by_koha_field({frameworkcode => $data->{frameworkcode}, kohafield => 'items.restricted', authorised_value => $data->{restricted} });
1384
        $av = Koha::AuthorisedValues->find_by_koha_field({frameworkcode => $data->{frameworkcode}, kohafield => 'items.restricted', authorised_value => $data->{restricted} });
1386
        $av = $av->count ? $av->next : undef;
1387
        $data->{restricted}     = $av ? $av->lib : '';
1385
        $data->{restricted}     = $av ? $av->lib : '';
1388
        $data->{restrictedopac} = $av ? $av->opac_description : '';
1386
        $data->{restrictedopac} = $av ? $av->opac_description : '';
1389
1387
1390
        # my stack procedures
1388
        # my stack procedures
1391
        $av = Koha::AuthorisedValues->search_by_koha_field({frameworkcode => $data->{frameworkcode}, kohafield => 'items.stack', authorised_value => $data->{stack} });
1389
        $av = Koha::AuthorisedValues->find_by_koha_field({frameworkcode => $data->{frameworkcode}, kohafield => 'items.stack', authorised_value => $data->{stack} });
1392
        $data->{stack}          = $av->count ? $av->next->lib : '';
1390
        $data->{stack}          = $av ? $av->lib : '';
1393
1391
1394
        # Find the last 3 people who borrowed this item.
1392
        # Find the last 3 people who borrowed this item.
1395
        my $sth2 = $dbh->prepare("SELECT * FROM old_issues,borrowers
1393
        my $sth2 = $dbh->prepare("SELECT * FROM old_issues,borrowers
(-)a/acqui/orderreceive.pl (-10 / +10 lines)
Lines 129-148 if ($AcqCreateItem eq 'receiving') { Link Here
129
    foreach (@itemnumbers) {
129
    foreach (@itemnumbers) {
130
        my $item = GetItem($_);
130
        my $item = GetItem($_);
131
        my $av;
131
        my $av;
132
        $av = Koha::AuthorisedValues->search_by_koha_field({frameworkcode => $fw, kohafield => 'items.notforloan', authorised_value => $item->{notforloan} });
132
        $av = Koha::AuthorisedValues->find_by_koha_field({frameworkcode => $fw, kohafield => 'items.notforloan', authorised_value => $item->{notforloan} });
133
        $item->{notforloan} = $av->count ? $av->next->lib : '';
133
        $item->{notforloan} = $av ? $av->lib : '';
134
134
135
        $av = Koha::AuthorisedValues->search_by_koha_field({frameworkcode => $fw, kohafield => 'items.restricted', authorised_value => $item->{restricted} });
135
        $av = Koha::AuthorisedValues->find_by_koha_field({frameworkcode => $fw, kohafield => 'items.restricted', authorised_value => $item->{restricted} });
136
        $item->{restricted} = $av->count ? $av->next->lib : '';
136
        $item->{restricted} = $av ? $av->lib : '';
137
137
138
        $av = Koha::AuthorisedValues->search_by_koha_field({frameworkcode => $fw, kohafield => 'items.location', authorised_value => $item->{location} });
138
        $av = Koha::AuthorisedValues->find_by_koha_field({frameworkcode => $fw, kohafield => 'items.location', authorised_value => $item->{location} });
139
        $item->{location} = $av->count ? $av->next->lib : '';
139
        $item->{location} = $av ? $av->lib : '';
140
140
141
        $av = Koha::AuthorisedValues->search_by_koha_field({frameworkcode => $fw, kohafield => 'items.collection', authorised_value => $item->{collection} });
141
        $av = Koha::AuthorisedValues->find_by_koha_field({frameworkcode => $fw, kohafield => 'items.collection', authorised_value => $item->{collection} });
142
        $item->{collection} = $av->count ? $av->next->lib : '';
142
        $item->{collection} = $av ? $av->lib : '';
143
143
144
        $av = Koha::AuthorisedValues->search_by_koha_field({frameworkcode => $fw, kohafield => 'items.materials', authorised_value => $item->{materials} });
144
        $av = Koha::AuthorisedValues->find_by_koha_field({frameworkcode => $fw, kohafield => 'items.materials', authorised_value => $item->{materials} });
145
        $item->{materials} = $av->count ? $av->next->lib : '';
145
        $item->{materials} = $av ? $av->lib : '';
146
146
147
        my $itemtype = getitemtypeinfo($item->{itype});
147
        my $itemtype = getitemtypeinfo($item->{itype});
148
        $item->{itemtype} = $itemtype->{description};
148
        $item->{itemtype} = $itemtype->{description};
(-)a/catalogue/getitem-ajax.pl (-10 / +10 lines)
Lines 56-75 if($itemnumber) { Link Here
56
    }
56
    }
57
57
58
    my $av;
58
    my $av;
59
    $av = Koha::AuthorisedValues->search_by_koha_field({ frameworkcode => $fw, kohafield => 'items.notforloan', authorised_value => $item->{notforloan} });
59
    $av = Koha::AuthorisedValues->find_by_koha_field({ frameworkcode => $fw, kohafield => 'items.notforloan', authorised_value => $item->{notforloan} });
60
    $item->{notforloan} = $av->count ? $av->next->lib : '';
60
    $item->{notforloan} = $av ? $av->lib : '';
61
61
62
    $av = Koha::AuthorisedValues->search_by_koha_field({ frameworkcode => $fw, kohafield => 'items.restricted', authorised_value => $item->{restricted} });
62
    $av = Koha::AuthorisedValues->find_by_koha_field({ frameworkcode => $fw, kohafield => 'items.restricted', authorised_value => $item->{restricted} });
63
    $item->{restricted} = $av->count ? $av->next->lib : '';
63
    $item->{restricted} = $av ? $av->lib : '';
64
64
65
    $av = Koha::AuthorisedValues->search_by_koha_field({ frameworkcode => $fw, kohafield => 'items.location', authorised_value => $item->{location} });
65
    $av = Koha::AuthorisedValues->find_by_koha_field({ frameworkcode => $fw, kohafield => 'items.location', authorised_value => $item->{location} });
66
    $item->{location} = $av->count ? $av->next->lib : '';
66
    $item->{location} = $av ? $av->lib : '';
67
67
68
    $av = Koha::AuthorisedValues->search_by_koha_field({ frameworkcode => $fw, kohafield => 'items.collection', authorised_value => $item->{collection} });
68
    $av = Koha::AuthorisedValues->find_by_koha_field({ frameworkcode => $fw, kohafield => 'items.collection', authorised_value => $item->{collection} });
69
    $item->{collection} = $av->count ? $av->next->lib : '';
69
    $item->{collection} = $av ? $av->lib : '';
70
70
71
    $av = Koha::AuthorisedValues->search_by_koha_field({ frameworkcode => $fw, kohafield => 'items.materials', authorised_value => $item->{materials} });
71
    $av = Koha::AuthorisedValues->find_by_koha_field({ frameworkcode => $fw, kohafield => 'items.materials', authorised_value => $item->{materials} });
72
    $item->{materials} = $av->count ? $av->next->lib : '';
72
    $item->{materials} = $av ? $av->lib : '';
73
73
74
    my $itemtype = getitemtypeinfo($item->{itype});
74
    my $itemtype = getitemtypeinfo($item->{itype});
75
    $item->{itemtype} = $itemtype->{description};
75
    $item->{itemtype} = $itemtype->{description};
(-)a/circ/circulation.pl (-2 / +2 lines)
Lines 393-400 if (@$barcodes) { Link Here
393
        unless($issueconfirmed){
393
        unless($issueconfirmed){
394
            #  Get the item title for more information
394
            #  Get the item title for more information
395
            my $materials = $iteminfo->{'materials'};
395
            my $materials = $iteminfo->{'materials'};
396
            my $av = Koha::AuthorisedValues->search_by_koha_field({ frameworkcode => $getmessageiteminfo->{frameworkcode}, kohafield => 'items.materials', authorised_value => $materials });
396
            my $av = Koha::AuthorisedValues->find_by_koha_field({ frameworkcode => $getmessageiteminfo->{frameworkcode}, kohafield => 'items.materials', authorised_value => $materials });
397
            $materials = $av->count ? $av->next->lib : '';
397
            $materials = $av ? $av->lib : '';
398
            $template_params->{additional_materials} = $materials;
398
            $template_params->{additional_materials} = $materials;
399
            $template_params->{itemhomebranch} = $iteminfo->{'homebranch'};
399
            $template_params->{itemhomebranch} = $iteminfo->{'homebranch'};
400
400
(-)a/circ/returns.pl (-3 / +2 lines)
Lines 279-286 if ($barcode) { Link Here
279
    $returnbranch = $biblio->{$hbr};
279
    $returnbranch = $biblio->{$hbr};
280
280
281
    my $materials = $biblio->{'materials'};
281
    my $materials = $biblio->{'materials'};
282
    my $av = Koha::AuthorisedValues->search_by_koha_field({frameworkcode => '', kohafield =>'items.materials', authorised_value => $materials });
282
    my $av = Koha::AuthorisedValues->find_by_koha_field({frameworkcode => '', kohafield =>'items.materials', authorised_value => $materials });
283
    $materials = $av->count ? $av->next->lib : '';
283
    $materials = $av ? $av->lib : '';
284
284
285
    $template->param(
285
    $template->param(
286
        title            => $biblio->{'title'},
286
        title            => $biblio->{'title'},
287
- 

Return to bug 17642