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