Lines 25-33
Koha::Acquisition::Utils - Additional Koha functions for dealing with orders and
Link Here
|
25 |
|
25 |
|
26 |
=head1 SUBROUTINES |
26 |
=head1 SUBROUTINES |
27 |
|
27 |
|
28 |
=head3 get_infos_syspref($syspref_name, $record, $field_list) |
28 |
=head3 GetMarcFieldsToOrderValues($syspref_name, $record, $field_list) |
29 |
|
29 |
|
30 |
my $data = Koha::Acquisition::Utils::get_infos_syspref('MarcFieldsToOrder', $marcrecord, ['price', 'quantity', 'budget_code', etc.]); |
30 |
my $data = Koha::Acquisition::Utils::GetMarcFieldsToOrderValues('MarcFieldsToOrder', $marcrecord, ['price', 'quantity', 'budget_code', etc.]); |
31 |
|
31 |
|
32 |
This subroutine accepts a syspref ( MarcFieldsToOrder ), |
32 |
This subroutine accepts a syspref ( MarcFieldsToOrder ), |
33 |
a marc record, and an arrayref of fields to retrieve. |
33 |
a marc record, and an arrayref of fields to retrieve. |
Lines 38-44
given system preference.
Link Here
|
38 |
|
38 |
|
39 |
=cut |
39 |
=cut |
40 |
|
40 |
|
41 |
sub get_infos_syspref { |
41 |
sub GetMarcFieldsToOrderValues { |
42 |
my ($syspref_name, $record, $field_list) = @_; |
42 |
my ($syspref_name, $record, $field_list) = @_; |
43 |
my $syspref = C4::Context->preference($syspref_name); |
43 |
my $syspref = C4::Context->preference($syspref_name); |
44 |
$syspref = "$syspref\n\n"; # YAML is anal on ending \n. Surplus does not hurt |
44 |
$syspref = "$syspref\n\n"; # YAML is anal on ending \n. Surplus does not hurt |
Lines 76-82
The return value is a hashref of key value pairs, where the keys are the field l
Link Here
|
76 |
and the values are extracted from the MARC record based on the key to MARC field mapping from the |
76 |
and the values are extracted from the MARC record based on the key to MARC field mapping from the |
77 |
given system preference. |
77 |
given system preference. |
78 |
|
78 |
|
79 |
The largest difference between get_infos_syspref and GetMarcItemFieldsToOrderValues is that the former deals |
79 |
The largest difference between GetMarcFieldsToOrderValues and GetMarcItemFieldsToOrderValues is that the former deals |
80 |
with singular marc fields, while the latter works on multiple matching marc fields and returns -1 if it cannot |
80 |
with singular marc fields, while the latter works on multiple matching marc fields and returns -1 if it cannot |
81 |
find a matching number of all fields to be looked up. |
81 |
find a matching number of all fields to be looked up. |
82 |
|
82 |
|