1: | <?php |
2: | declare(strict_types=1); |
3: | |
4: | |
5: | |
6: | |
7: | |
8: | |
9: | |
10: | |
11: | |
12: | |
13: | |
14: | |
15: | |
16: | |
17: | |
18: | |
19: | |
20: | class Crm_Module extends Module_Skeleton |
21: | { |
22: | const FROM_ADDRESS = CRM_FROM_ADDRESS; |
23: | |
24: | |
25: | const REPLY_ADDRESS = CRM_REPLY_ADDRESS; |
26: | const FROM_NAME = CRM_FROM_NAME; |
27: | const FROM_NO_REPLY_ADDRESS = CRM_FROM_NO_REPLY_ADDRESS; |
28: | const MAX_SMS_LENGTH = 150; |
29: | |
30: | const COPY_ADMIN = CRM_COPY_ADMIN; |
31: | |
32: | const TICKET_STCLOSE = 'close'; |
33: | const TICKET_STAPPEND = 'append'; |
34: | const TICKET_STOPEN = 'open'; |
35: | const PRIORITIES = array('normal', 'high', 'outage'); |
36: | const LOW_PRIORITY_SUBJECTS = array('billing'); |
37: | |
38: | |
39: | |
40: | const SHORT_COPY_ADMIN = CRM_SHORT_COPY_ADMIN; |
41: | |
42: | |
43: | private static $CRM_SERVER_HOST = CRM_TICKET_HOST; |
44: | |
45: | private static $CRM_SERVER_USER = CRM_TICKET_USER; |
46: | |
47: | private static $CRM_SERVER_PASSWORD = CRM_TICKET_PASSWORD; |
48: | |
49: | private static $CRM_SERVER_DATABASE = CRM_TICKET_DB; |
50: | |
51: | |
52: | |
53: | |
54: | |
55: | |
56: | public function __construct() |
57: | { |
58: | parent::__construct(); |
59: | $this->exportedFunctions = array( |
60: | '*' => PRIVILEGE_SITE | PRIVILEGE_ADMIN, |
61: | 'append_ticket_via_email' => PRIVILEGE_ADMIN, |
62: | 'get_notifications' => PRIVILEGE_ALL, |
63: | 'cancel_notification' => PRIVILEGE_ALL, |
64: | 'configured' => PRIVILEGE_ALL |
65: | |
66: | ); |
67: | } |
68: | |
69: | |
70: | |
71: | |
72: | |
73: | |
74: | public function enabled(): bool |
75: | { |
76: | return $this->configured() && |
77: | ($this->permission_level & PRIVILEGE_ADMIN || !$this->getServiceValue('billing', 'parent_invoice')); |
78: | } |
79: | |
80: | |
81: | |
82: | |
83: | |
84: | |
85: | public function configured(): bool |
86: | { |
87: | return false; |
88: | } |
89: | |
90: | |
91: | |
92: | |
93: | |
94: | |
95: | public function get_notifications(): array |
96: | { |
97: | return []; |
98: | } |
99: | } |
100: | |