7c5fb7b2dc137968d11cd7d15b808ecf99991864
[Evergreen.git] / Open-ILS / src / perlmods / lib / 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 econst OILS_COPY_STATUS_ON_RESV_SHELF => 15;
45 econst OILS_COPY_STATUS_LONG_OVERDUE  => 16;
46 econst OILS_COPY_STATUS_LOST_AND_PAID => 17;
47 econst OILS_COPY_STATUS_CANCELED_TRANSIT => 18;
48
49 # ---------------------------------------------------------------------
50 # Circ defaults for pre-cataloged copies
51 # ---------------------------------------------------------------------
52 econst OILS_PRECAT_COPY_FINE_LEVEL    => 2;
53 econst OILS_PRECAT_COPY_LOAN_DURATION => 2;
54 econst OILS_PRECAT_CALL_NUMBER        => -1;
55 econst OILS_PRECAT_RECORD                => -1;
56
57
58 # ---------------------------------------------------------------------
59 # Circ constants
60 # ---------------------------------------------------------------------
61 econst OILS_CIRC_DURATION_SHORT       => 1;
62 econst OILS_CIRC_DURATION_NORMAL      => 2;
63 econst OILS_CIRC_DURATION_EXTENDED    => 3;
64 econst OILS_REC_FINE_LEVEL_LOW        => 1;
65 econst OILS_REC_FINE_LEVEL_NORMAL     => 2;
66 econst OILS_REC_FINE_LEVEL_HIGH       => 3;
67 econst OILS_STOP_FINES_CHECKIN        => 'CHECKIN';
68 econst OILS_STOP_FINES_RENEW          => 'RENEW';
69 econst OILS_STOP_FINES_LOST           => 'LOST';
70 econst OILS_STOP_FINES_CLAIMSRETURNED => 'CLAIMSRETURNED';
71 econst OILS_STOP_FINES_LONGOVERDUE    => 'LONGOVERDUE';
72 econst OILS_STOP_FINES_MAX_FINES      => 'MAXFINES';
73 econst OILS_STOP_FINES_CLAIMS_NEVERCHECKEDOUT => 'CLAIMSNEVERCHECKEDOUT';
74 econst OILS_UNLIMITED_CIRC_DURATION   => 'unlimited';
75
76 # ---------------------------------------------------------------------
77 # Settings
78 # ---------------------------------------------------------------------
79 econst OILS_SETTING_LOST_PROCESSING_FEE => 'circ.lost_materials_processing_fee';
80 econst OILS_SETTING_DEF_ITEM_PRICE => 'cat.default_item_price';
81 econst OILS_SETTING_MIN_ITEM_PRICE => 'circ.min_item_price';
82 econst OILS_SETTING_MAX_ITEM_PRICE => 'circ.max_item_price';
83 econst OILS_SETTING_ORG_BOUNCED_EMAIL => 'org.bounced_emails';
84 econst OILS_SETTING_CHARGE_LOST_ON_ZERO => 'circ.charge_lost_on_zero';
85 econst OILS_SETTING_VOID_OVERDUE_ON_LOST => 'circ.void_overdue_on_lost';
86 econst OILS_SETTING_HOLD_SOFT_STALL => 'circ.hold_stalling.soft';
87 econst OILS_SETTING_HOLD_HARD_STALL => 'circ.hold_stalling.hard';
88 econst OILS_SETTING_HOLD_SOFT_BOUNDARY => 'circ.hold_boundary.soft';
89 econst OILS_SETTING_HOLD_HARD_BOUNDARY => 'circ.hold_boundary.hard';
90 econst OILS_SETTING_HOLD_EXPIRE => 'circ.hold_expire_interval';
91 econst OILS_SETTING_HOLD_ESIMATE_WAIT_INTERVAL => 'circ.holds.default_estimated_wait_interval';
92 econst OILS_SETTING_VOID_LOST_ON_CHECKIN                => 'circ.void_lost_on_checkin';
93 econst OILS_SETTING_MAX_ACCEPT_RETURN_OF_LOST           => 'circ.max_accept_return_of_lost';
94 econst OILS_SETTING_VOID_LOST_PROCESS_FEE_ON_CHECKIN    => 'circ.void_lost_proc_fee_on_checkin';
95 econst OILS_SETTING_RESTORE_OVERDUE_ON_LOST_RETURN      => 'circ.restore_overdue_on_lost_return';
96 econst OILS_SETTING_LOST_IMMEDIATELY_AVAILABLE          => 'circ.lost_immediately_available';
97 econst OILS_SETTING_BLOCK_HOLD_FOR_EXPIRED_PATRON       => 'circ.holds.expired_patron_block';
98 econst OILS_SETTING_GENERATE_OVERDUE_ON_LOST_RETURN     => 'circ.lost.generate_overdue_on_checkin';
99 econst OILS_SETTING_MAX_DUPLICATE_HOLDS => 'circ.holds.max_duplicate_holds';
100
101
102
103
104 econst OILS_HOLD_TYPE_COPY        => 'C';
105 econst OILS_HOLD_TYPE_FORCE       => 'F';
106 econst OILS_HOLD_TYPE_RECALL      => 'R';
107 econst OILS_HOLD_TYPE_ISSUANCE    => 'I';
108 econst OILS_HOLD_TYPE_VOLUME      => 'V';
109 econst OILS_HOLD_TYPE_TITLE       => 'T';
110 econst OILS_HOLD_TYPE_METARECORD  => 'M';
111 econst OILS_HOLD_TYPE_MONOPART    => 'P';
112
113
114 econst OILS_BILLING_TYPE_OVERDUE_MATERIALS => 'Overdue materials';
115 econst OILS_BILLING_TYPE_COLLECTION_FEE => 'Long Overdue Collection Fee';
116 econst OILS_BILLING_TYPE_DEPOSIT => 'System: Deposit';
117 econst OILS_BILLING_TYPE_RENTAL => 'System: Rental';
118 econst OILS_BILLING_NOTE_SYSTEM => 'SYSTEM GENERATED';
119
120 econst OILS_ACQ_DEBIT_TYPE_PURCHASE => 'purchase';
121 econst OILS_ACQ_DEBIT_TYPE_TRANSFER => 'xfer';
122
123 # all penalties with ID < 100 are managed automatically
124 econst OILS_PENALTY_AUTO_ID => 100;
125 econst OILS_PENALTY_PATRON_EXCEEDS_FINES => 1;
126 econst OILS_PENALTY_PATRON_EXCEEDS_OVERDUE_COUNT => 2;
127 econst OILS_PENALTY_INVALID_PATRON_ADDRESS => 29;
128
129
130 econst OILS_BILLING_TYPE_NOTIFICATION_FEE => 9;
131
132
133
134 # ---------------------------------------------------------------------
135 # finally, export all the constants
136 # ---------------------------------------------------------------------
137 %EXPORT_TAGS = ( const => [ @EXPORT_OK ] );
138