|
Lines 27-32
use C4::Context;
Link Here
|
| 27 |
use C4::Branch qw(GetBranchesCount); |
27 |
use C4::Branch qw(GetBranchesCount); |
| 28 |
use Koha::DateUtils qw(dt_from_string); |
28 |
use Koha::DateUtils qw(dt_from_string); |
| 29 |
use Memoize; |
29 |
use Memoize; |
|
|
30 |
use Memoize::Expire; |
| 30 |
use DateTime::Format::MySQL; |
31 |
use DateTime::Format::MySQL; |
| 31 |
use autouse 'Data::Dumper' => qw(Dumper); |
32 |
use autouse 'Data::Dumper' => qw(Dumper); |
| 32 |
use DBI qw(:sql_types); |
33 |
use DBI qw(:sql_types); |
|
Lines 78-84
BEGIN {
Link Here
|
| 78 |
} |
79 |
} |
| 79 |
|
80 |
|
| 80 |
# expensive functions |
81 |
# expensive functions |
| 81 |
memoize('GetAuthorisedValues'); |
82 |
tie my %memoize_cache => 'Memoize::Expire', |
|
|
83 |
LIFETIME => 10; |
| 84 |
memoize('GetAuthorisedValues', SCALAR_HASH => [HASH => \%memoize_cache]); |
| 82 |
|
85 |
|
| 83 |
=head1 NAME |
86 |
=head1 NAME |
| 84 |
|
87 |
|
|
Lines 1254-1259
Create a new authorised value.
Link Here
|
| 1254 |
sub AddAuthorisedValue { |
1257 |
sub AddAuthorisedValue { |
| 1255 |
my ($category, $authorised_value, $lib, $lib_opac, $imageurl) = @_; |
1258 |
my ($category, $authorised_value, $lib, $lib_opac, $imageurl) = @_; |
| 1256 |
|
1259 |
|
|
|
1260 |
# clear the memoize cache |
| 1261 |
flush_cache('AddAuthorisedValue'); |
| 1262 |
|
| 1257 |
my $dbh = C4::Context->dbh; |
1263 |
my $dbh = C4::Context->dbh; |
| 1258 |
my $query = qq{ |
1264 |
my $query = qq{ |
| 1259 |
INSERT INTO authorised_values (category, authorised_value, lib, lib_opac, imageurl) |
1265 |
INSERT INTO authorised_values (category, authorised_value, lib, lib_opac, imageurl) |
| 1260 |
- |
|
|