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

(-)a/C4/Koha.pm (-5 / +5 lines)
Lines 1229-1250 sub GetKohaAuthorisedValueLib { Link Here
1229
1229
1230
=head2 AddAuthorisedValue
1230
=head2 AddAuthorisedValue
1231
1231
1232
    AddAuthorisedValue($category, $authorised_value, $lib, $lib_opac);
1232
    AddAuthorisedValue($category, $authorised_value, $lib, $lib_opac, $imageurl);
1233
1233
1234
Create a new authorised value.
1234
Create a new authorised value.
1235
1235
1236
=cut
1236
=cut
1237
1237
1238
sub AddAuthorisedValue {
1238
sub AddAuthorisedValue {
1239
    my ($category, $authorised_value, $lib, $lib_opac) = @_;
1239
    my ($category, $authorised_value, $lib, $lib_opac, $imageurl) = @_;
1240
1240
1241
    my $dbh = C4::Context->dbh;
1241
    my $dbh = C4::Context->dbh;
1242
    my $query = qq{
1242
    my $query = qq{
1243
        INSERT INTO authorised_values (category, authorised_value, lib, lib_opac)
1243
        INSERT INTO authorised_values (category, authorised_value, lib, lib_opac, imageurl)
1244
        VALUES (?,?,?,?)
1244
        VALUES (?,?,?,?,?)
1245
    };
1245
    };
1246
    my $sth = $dbh->prepare($query);
1246
    my $sth = $dbh->prepare($query);
1247
    $sth->execute($category, $authorised_value, $lib, $lib_opac);
1247
    $sth->execute($category, $authorised_value, $lib, $lib_opac, $imageurl);
1248
}
1248
}
1249
1249
1250
=head2 display_marc_indicators
1250
=head2 display_marc_indicators
(-)a/t/db_dependent/Koha.t (-6 / +3 lines)
Lines 32-40 subtest 'Authorized Values Tests' => sub { Link Here
32
32
33
33
34
# Insert an entry into authorised_value table
34
# Insert an entry into authorised_value table
35
    my $query = "INSERT INTO authorised_values (category, authorised_value, lib, lib_opac, imageurl) VALUES (?,?,?,?,?);";
35
    my $insert_success = AddAuthorisedValue($data->{category}, $data->{authorised_value}, $data->{lib}, $data->{lib_opac}, $data->{imageurl});
36
    my $sth = $dbh->prepare($query);
37
    my $insert_success = $sth->execute($data->{category}, $data->{authorised_value}, $data->{lib}, $data->{lib_opac}, $data->{imageurl});
38
    ok($insert_success, "Insert data in database");
36
    ok($insert_success, "Insert data in database");
39
37
40
38
Lines 57-64 subtest 'Authorized Values Tests' => sub { Link Here
57
55
58
# Clean up
56
# Clean up
59
    if($insert_success){
57
    if($insert_success){
60
        $query = "DELETE FROM authorised_values WHERE category=? AND authorised_value=? AND lib=? AND lib_opac=? AND imageurl=?;";
58
        my $query = "DELETE FROM authorised_values WHERE category=? AND authorised_value=? AND lib=? AND lib_opac=? AND imageurl=?;";
61
        $sth = $dbh->prepare($query);
59
        my $sth = $dbh->prepare($query);
62
        $sth->execute($data->{category}, $data->{authorised_value}, $data->{lib}, $data->{lib_opac}, $data->{imageurl});
60
        $sth->execute($data->{category}, $data->{authorised_value}, $data->{lib}, $data->{lib_opac}, $data->{imageurl});
63
    }
61
    }
64
};
62
};
65
- 

Return to bug 9117