28ca6dc87871dab545e89a20bb033fe3e203ed82
[Evergreen.git] / Open-ILS / src / perlmods / OpenILS / Const.pm
1 package OpenILS::Const;
2 use strict; use warnings;
3 use vars qw(@EXPORT_OK %EXPORT_TAGS);
4 use Exporter;
5 use base qw/Exporter/;
6
7
8 # ---------------------------------------------------------------------
9 # Shoves defined constants into the export array
10 # so they don't have to be listed twice in the code
11 # ---------------------------------------------------------------------
12 sub econst {
13    my($name, $value) = @_;
14    my $caller = caller;
15    no strict;
16    *{$name} = sub () { $value };
17    push @{$caller.'::EXPORT_OK'}, $name;
18 }
19
20 # ---------------------------------------------------------------------
21 # CONSTANTS
22 # ---------------------------------------------------------------------
23
24
25
26 # ---------------------------------------------------------------------
27 # Copy Statuses
28 # ---------------------------------------------------------------------
29 econst OILS_COPY_STATUS_AVAILABLE     => 0;
30 econst OILS_COPY_STATUS_CHECKED_OUT   => 1;
31 econst OILS_COPY_STATUS_BINDERY       => 2;
32 econst OILS_COPY_STATUS_LOST          => 3;
33 econst OILS_COPY_STATUS_MISSING       => 4;
34 econst OILS_COPY_STATUS_IN_PROCESS    => 5;
35 econst OILS_COPY_STATUS_IN_TRANSIT    => 6;
36 econst OILS_COPY_STATUS_RESHELVING    => 7;
37 econst OILS_COPY_STATUS_ON_HOLDS_SHELF=> 8;
38 econst OILS_COPY_STATUS_ON_ORDER             => 9;
39 econst OILS_COPY_STATUS_ILL           => 10;
40 econst OILS_COPY_STATUS_CATALOGING    => 11;
41 econst OILS_COPY_STATUS_RESERVES      => 12;
42 econst OILS_COPY_STATUS_DISCARD       => 13;
43 econst OILS_COPY_STATUS_DAMAGED       => 14;
44
45
46 # ---------------------------------------------------------------------
47 # Circ defaults for pre-cataloged copies
48 # ---------------------------------------------------------------------
49 econst OILS_PRECAT_COPY_FINE_LEVEL    => 2;
50 econst OILS_PRECAT_COPY_LOAN_DURATION => 2;
51 econst OILS_PRECAT_CALL_NUMBER        => -1;
52 econst OILS_PRECAT_RECORD                            => -1;
53
54
55 # ---------------------------------------------------------------------
56 # Circ constants
57 # ---------------------------------------------------------------------
58 econst OILS_CIRC_DURATION_SHORT       => 1;
59 econst OILS_CIRC_DURATION_NORMAL      => 2;
60 econst OILS_CIRC_DURATION_EXTENDED    => 3;
61 econst OILS_REC_FINE_LEVEL_LOW        => 1;
62 econst OILS_REC_FINE_LEVEL_NORMAL     => 2;
63 econst OILS_REC_FINE_LEVEL_HIGH       => 3;
64 econst OILS_STOP_FINES_CHECKIN        => 'CHECKIN';
65 econst OILS_STOP_FINES_RENEW          => 'RENEW';
66 econst OILS_STOP_FINES_LOST           => 'LOST';
67 econst OILS_STOP_FINES_CLAIMSRETURNED => 'CLAIMSRETURNED';
68 econst OILS_STOP_FINES_LONGOVERDUE    => 'LONGOVERDUE';
69 econst OILS_STOP_FINES_MAX_FINES      => 'MAXFINES';
70 econst OILS_UNLIMITED_CIRC_DURATION   => 'unlimited';
71
72 # ---------------------------------------------------------------------
73 # Settings
74 # ---------------------------------------------------------------------
75 econst OILS_SETTING_LOST_PROCESSING_FEE => 'circ.lost_materials_processing_fee';
76 econst OILS_SETTING_DEF_ITEM_PRICE => 'cat.default_item_price';
77 econst OILS_SETTING_ORG_BOUNCED_EMAIL => 'org.bounced_emails';
78 econst OILS_SETTING_CHARGE_LOST_ON_ZERO => 'circ.charge_lost_on_zero';
79 econst OILS_SETTING_VOID_OVERDUE_ON_LOST => 'circ.void_overdue_on_lost';
80 econst OILS_SETTING_HOLD_SOFT_STALL => 'circ.hold_stalling.soft';
81 econst OILS_SETTING_HOLD_HARD_STALL => 'circ.hold_stalling.hard';
82 econst OILS_SETTING_HOLD_SOFT_BOUNDARY => 'circ.hold_boundary.soft';
83 econst OILS_SETTING_HOLD_HARD_BOUNDARY => 'circ.hold_boundary.hard';
84 econst OILS_SETTING_HOLD_EXPIRE => 'circ.hold_expire_interval';
85
86
87
88 econst OILS_HOLD_TYPE_COPY        => 'C';
89 econst OILS_HOLD_TYPE_VOLUME      => 'V';
90 econst OILS_HOLD_TYPE_TITLE       => 'T';
91 econst OILS_HOLD_TYPE_METARECORD  => 'M';
92
93
94 econst OILS_BILLING_TYPE_OVERDUE_MATERIALS => 'Overdue materials';
95 econst OILS_BILLING_TYPE_COLLECTION_FEE => 'Long Overdue Collection Fee';
96
97
98
99 # ---------------------------------------------------------------------
100 # finally, export all the constants
101 # ---------------------------------------------------------------------
102 %EXPORT_TAGS = ( const => [ @EXPORT_OK ] );
103