1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11:
12: class Ingo_Storage_Vacation extends Ingo_Storage_Rule
13: {
14:
15: 16:
17: protected $_addr = array();
18:
19: 20:
21: protected $_days = 7;
22:
23: 24:
25: protected $_excludes = array();
26:
27: 28:
29: protected $_ignorelist = true;
30:
31: 32:
33: protected $_reason = '';
34:
35: 36:
37: protected $_subject = '';
38:
39: 40:
41: protected $_start;
42:
43: 44:
45: protected $_end;
46:
47: 48:
49: protected $_obtype = Ingo_Storage::ACTION_VACATION;
50:
51: 52:
53: public function setVacationAddresses($data, $sort = true)
54: {
55: $this->_addr = $this->_addressList($data, $sort);
56: }
57:
58: 59:
60: public function setVacationDays($data)
61: {
62: $this->_days = $data;
63: }
64:
65: 66:
67: public function setVacationExcludes($data, $sort = true)
68: {
69: $this->_excludes = $this->_addressList($data, $sort);
70: }
71:
72: 73:
74: public function setVacationIgnorelist($data)
75: {
76: $this->_ignorelist = $data;
77: }
78:
79: 80:
81: public function setVacationReason($data)
82: {
83: $this->_reason = $data;
84: }
85:
86: 87:
88: public function setVacationSubject($data)
89: {
90: $this->_subject = $data;
91: }
92:
93: 94:
95: public function setVacationStart($data)
96: {
97: $this->_start = $data;
98: }
99:
100: 101:
102: public function setVacationEnd($data)
103: {
104: $this->_end = $data;
105: }
106:
107: 108:
109: public function getVacationAddresses()
110: {
111: try {
112: return Horde::callHook('vacation_addresses', array(Ingo::getUser()), 'ingo');
113: } catch (Horde_Exception_HookNotSet $e) {
114: return $this->_addr;
115: }
116: }
117:
118: 119:
120: public function getVacationDays()
121: {
122: return $this->_days;
123: }
124:
125: 126:
127: public function getVacationExcludes()
128: {
129: return $this->_excludes;
130: }
131:
132: 133:
134: public function getVacationIgnorelist()
135: {
136: return $this->_ignorelist;
137: }
138:
139: 140:
141: public function getVacationReason()
142: {
143: return $this->_reason;
144: }
145:
146: 147:
148: public function getVacationSubject()
149: {
150: return $this->_subject;
151: }
152:
153: 154:
155: public function getVacationStart()
156: {
157: return $this->_start;
158: }
159:
160: 161:
162: public function getVacationStartYear()
163: {
164: return date('Y', $this->_start);
165: }
166:
167: 168:
169: public function getVacationStartMonth()
170: {
171: return date('n', $this->_start);
172: }
173:
174: 175:
176: public function getVacationStartDay()
177: {
178: return date('j', $this->_start);
179: }
180:
181: 182:
183: public function getVacationEnd()
184: {
185: return $this->_end;
186: }
187:
188: 189:
190: public function getVacationEndYear()
191: {
192: return date('Y', $this->_end);
193: }
194:
195: 196:
197: public function getVacationEndMonth()
198: {
199: return date('n', $this->_end);
200: }
201:
202: 203:
204: public function getVacationEndDay()
205: {
206: return date('j', $this->_end);
207: }
208:
209: }
210: