Merge pull request #8944 from totten/master-givi
[civicrm-core.git] / CRM / Core / DAO / ActionSchedule.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
26 */
27 /**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2016
30 *
31 * Generated from xml/schema/CRM/Core/ActionSchedule.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:06960967b276e6b2b7cd31a7ded61c03)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Core_DAO_ActionSchedule extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_action_schedule';
44 /**
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
47 *
48 * @var boolean
49 */
50 static $_log = false;
51 /**
52 *
53 * @var int unsigned
54 */
55 public $id;
56 /**
57 * Name of the action(reminder)
58 *
59 * @var string
60 */
61 public $name;
62 /**
63 * Title of the action(reminder)
64 *
65 * @var string
66 */
67 public $title;
68 /**
69 * Recipient
70 *
71 * @var string
72 */
73 public $recipient;
74 /**
75 * Is this the recipient criteria limited to OR in addition to?
76 *
77 * @var boolean
78 */
79 public $limit_to;
80 /**
81 * Entity value
82 *
83 * @var string
84 */
85 public $entity_value;
86 /**
87 * Entity status
88 *
89 * @var string
90 */
91 public $entity_status;
92 /**
93 * Reminder Interval.
94 *
95 * @var int unsigned
96 */
97 public $start_action_offset;
98 /**
99 * Time units for reminder.
100 *
101 * @var string
102 */
103 public $start_action_unit;
104 /**
105 * Reminder Action
106 *
107 * @var string
108 */
109 public $start_action_condition;
110 /**
111 * Entity date
112 *
113 * @var string
114 */
115 public $start_action_date;
116 /**
117 *
118 * @var boolean
119 */
120 public $is_repeat;
121 /**
122 * Time units for repetition of reminder.
123 *
124 * @var string
125 */
126 public $repetition_frequency_unit;
127 /**
128 * Time interval for repeating the reminder.
129 *
130 * @var int unsigned
131 */
132 public $repetition_frequency_interval;
133 /**
134 * Time units till repetition of reminder.
135 *
136 * @var string
137 */
138 public $end_frequency_unit;
139 /**
140 * Time interval till repeating the reminder.
141 *
142 * @var int unsigned
143 */
144 public $end_frequency_interval;
145 /**
146 * Reminder Action till repeating the reminder.
147 *
148 * @var string
149 */
150 public $end_action;
151 /**
152 * Entity end date
153 *
154 * @var string
155 */
156 public $end_date;
157 /**
158 * Is this option active?
159 *
160 * @var boolean
161 */
162 public $is_active;
163 /**
164 * Contact IDs to which reminder should be sent.
165 *
166 * @var string
167 */
168 public $recipient_manual;
169 /**
170 * listing based on recipient field.
171 *
172 * @var string
173 */
174 public $recipient_listing;
175 /**
176 * Body of the mailing in text format.
177 *
178 * @var longtext
179 */
180 public $body_text;
181 /**
182 * Body of the mailing in html format.
183 *
184 * @var longtext
185 */
186 public $body_html;
187 /**
188 * Content of the SMS text.
189 *
190 * @var longtext
191 */
192 public $sms_body_text;
193 /**
194 * Subject of mailing
195 *
196 * @var string
197 */
198 public $subject;
199 /**
200 * Record Activity for this reminder?
201 *
202 * @var boolean
203 */
204 public $record_activity;
205 /**
206 * Name/ID of the mapping to use on this table
207 *
208 * @var string
209 */
210 public $mapping_id;
211 /**
212 * FK to Group
213 *
214 * @var int unsigned
215 */
216 public $group_id;
217 /**
218 * FK to the message template.
219 *
220 * @var int unsigned
221 */
222 public $msg_template_id;
223 /**
224 * FK to the message template.
225 *
226 * @var int unsigned
227 */
228 public $sms_template_id;
229 /**
230 * Date on which the reminder be sent.
231 *
232 * @var date
233 */
234 public $absolute_date;
235 /**
236 * Name in "from" field
237 *
238 * @var string
239 */
240 public $from_name;
241 /**
242 * Email address in "from" field
243 *
244 * @var string
245 */
246 public $from_email;
247 /**
248 * Send the message as email or sms or both.
249 *
250 * @var string
251 */
252 public $mode;
253 /**
254 *
255 * @var int unsigned
256 */
257 public $sms_provider_id;
258 /**
259 * Used for repeating entity
260 *
261 * @var string
262 */
263 public $used_for;
264 /**
265 * Used for multilingual installation
266 *
267 * @var string
268 */
269 public $filter_contact_language;
270 /**
271 * Used for multilingual installation
272 *
273 * @var string
274 */
275 public $communication_language;
276 /**
277 * class constructor
278 *
279 * @return civicrm_action_schedule
280 */
281 function __construct() {
282 $this->__table = 'civicrm_action_schedule';
283 parent::__construct();
284 }
285 /**
286 * Returns foreign keys and entity references
287 *
288 * @return array
289 * [CRM_Core_Reference_Interface]
290 */
291 static function getReferenceColumns() {
292 if (!isset(Civi::$statics[__CLASS__]['links'])) {
293 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
294 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'group_id', 'civicrm_group', 'id');
295 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'msg_template_id', 'civicrm_msg_template', 'id');
296 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'sms_template_id', 'civicrm_msg_template', 'id');
297 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'sms_provider_id', 'civicrm_sms_provider', 'id');
298 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
299 }
300 return Civi::$statics[__CLASS__]['links'];
301 }
302 /**
303 * Returns all the column names of this table
304 *
305 * @return array
306 */
307 static function &fields() {
308 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
309 Civi::$statics[__CLASS__]['fields'] = array(
310 'id' => array(
311 'name' => 'id',
312 'type' => CRM_Utils_Type::T_INT,
313 'title' => ts('Action Schedule ID') ,
314 'required' => true,
315 ) ,
316 'name' => array(
317 'name' => 'name',
318 'type' => CRM_Utils_Type::T_STRING,
319 'title' => ts('Name') ,
320 'description' => 'Name of the action(reminder)',
321 'maxlength' => 64,
322 'size' => CRM_Utils_Type::BIG,
323 ) ,
324 'title' => array(
325 'name' => 'title',
326 'type' => CRM_Utils_Type::T_STRING,
327 'title' => ts('Title') ,
328 'description' => 'Title of the action(reminder)',
329 'maxlength' => 64,
330 'size' => CRM_Utils_Type::BIG,
331 ) ,
332 'recipient' => array(
333 'name' => 'recipient',
334 'type' => CRM_Utils_Type::T_STRING,
335 'title' => ts('Recipient') ,
336 'description' => 'Recipient',
337 'maxlength' => 64,
338 'size' => CRM_Utils_Type::BIG,
339 ) ,
340 'limit_to' => array(
341 'name' => 'limit_to',
342 'type' => CRM_Utils_Type::T_BOOLEAN,
343 'title' => ts('Limit To') ,
344 'description' => 'Is this the recipient criteria limited to OR in addition to?',
345 ) ,
346 'entity_value' => array(
347 'name' => 'entity_value',
348 'type' => CRM_Utils_Type::T_STRING,
349 'title' => ts('Entity Value') ,
350 'description' => 'Entity value',
351 'maxlength' => 255,
352 'size' => CRM_Utils_Type::HUGE,
353 ) ,
354 'entity_status' => array(
355 'name' => 'entity_status',
356 'type' => CRM_Utils_Type::T_STRING,
357 'title' => ts('Entity Status') ,
358 'description' => 'Entity status',
359 'maxlength' => 64,
360 'size' => CRM_Utils_Type::BIG,
361 ) ,
362 'start_action_offset' => array(
363 'name' => 'start_action_offset',
364 'type' => CRM_Utils_Type::T_INT,
365 'title' => ts('Start Action Offset') ,
366 'description' => 'Reminder Interval.',
367 ) ,
368 'start_action_unit' => array(
369 'name' => 'start_action_unit',
370 'type' => CRM_Utils_Type::T_STRING,
371 'title' => ts('Start Action Unit') ,
372 'description' => 'Time units for reminder.',
373 'maxlength' => 8,
374 'size' => CRM_Utils_Type::EIGHT,
375 'html' => array(
376 'type' => 'Select',
377 ) ,
378 'pseudoconstant' => array(
379 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
380 )
381 ) ,
382 'start_action_condition' => array(
383 'name' => 'start_action_condition',
384 'type' => CRM_Utils_Type::T_STRING,
385 'title' => ts('Start Action Condition') ,
386 'description' => 'Reminder Action',
387 'maxlength' => 64,
388 'size' => CRM_Utils_Type::BIG,
389 ) ,
390 'start_action_date' => array(
391 'name' => 'start_action_date',
392 'type' => CRM_Utils_Type::T_STRING,
393 'title' => ts('Start Action Date') ,
394 'description' => 'Entity date',
395 'maxlength' => 64,
396 'size' => CRM_Utils_Type::BIG,
397 ) ,
398 'is_repeat' => array(
399 'name' => 'is_repeat',
400 'type' => CRM_Utils_Type::T_BOOLEAN,
401 'title' => ts('Repeat?') ,
402 ) ,
403 'repetition_frequency_unit' => array(
404 'name' => 'repetition_frequency_unit',
405 'type' => CRM_Utils_Type::T_STRING,
406 'title' => ts('Repetition Frequency Unit') ,
407 'description' => 'Time units for repetition of reminder.',
408 'maxlength' => 8,
409 'size' => CRM_Utils_Type::EIGHT,
410 'html' => array(
411 'type' => 'Select',
412 ) ,
413 'pseudoconstant' => array(
414 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
415 )
416 ) ,
417 'repetition_frequency_interval' => array(
418 'name' => 'repetition_frequency_interval',
419 'type' => CRM_Utils_Type::T_INT,
420 'title' => ts('Repetition Frequency Interval') ,
421 'description' => 'Time interval for repeating the reminder.',
422 ) ,
423 'end_frequency_unit' => array(
424 'name' => 'end_frequency_unit',
425 'type' => CRM_Utils_Type::T_STRING,
426 'title' => ts('End Frequency Unit') ,
427 'description' => 'Time units till repetition of reminder.',
428 'maxlength' => 8,
429 'size' => CRM_Utils_Type::EIGHT,
430 'html' => array(
431 'type' => 'Select',
432 ) ,
433 'pseudoconstant' => array(
434 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
435 )
436 ) ,
437 'end_frequency_interval' => array(
438 'name' => 'end_frequency_interval',
439 'type' => CRM_Utils_Type::T_INT,
440 'title' => ts('End Frequency Interval') ,
441 'description' => 'Time interval till repeating the reminder.',
442 ) ,
443 'end_action' => array(
444 'name' => 'end_action',
445 'type' => CRM_Utils_Type::T_STRING,
446 'title' => ts('End Action') ,
447 'description' => 'Reminder Action till repeating the reminder.',
448 'maxlength' => 32,
449 'size' => CRM_Utils_Type::MEDIUM,
450 ) ,
451 'end_date' => array(
452 'name' => 'end_date',
453 'type' => CRM_Utils_Type::T_STRING,
454 'title' => ts('End Date') ,
455 'description' => 'Entity end date',
456 'maxlength' => 64,
457 'size' => CRM_Utils_Type::BIG,
458 ) ,
459 'is_active' => array(
460 'name' => 'is_active',
461 'type' => CRM_Utils_Type::T_BOOLEAN,
462 'title' => ts('Schedule is Active?') ,
463 'description' => 'Is this option active?',
464 'default' => '1',
465 ) ,
466 'recipient_manual' => array(
467 'name' => 'recipient_manual',
468 'type' => CRM_Utils_Type::T_STRING,
469 'title' => ts('Recipient Manual') ,
470 'description' => 'Contact IDs to which reminder should be sent.',
471 'maxlength' => 128,
472 'size' => CRM_Utils_Type::HUGE,
473 ) ,
474 'recipient_listing' => array(
475 'name' => 'recipient_listing',
476 'type' => CRM_Utils_Type::T_STRING,
477 'title' => ts('Recipient Listing') ,
478 'description' => 'listing based on recipient field.',
479 'maxlength' => 128,
480 'size' => CRM_Utils_Type::HUGE,
481 ) ,
482 'body_text' => array(
483 'name' => 'body_text',
484 'type' => CRM_Utils_Type::T_LONGTEXT,
485 'title' => ts('Reminder Text') ,
486 'description' => 'Body of the mailing in text format.',
487 ) ,
488 'body_html' => array(
489 'name' => 'body_html',
490 'type' => CRM_Utils_Type::T_LONGTEXT,
491 'title' => ts('Reminder HTML') ,
492 'description' => 'Body of the mailing in html format.',
493 ) ,
494 'sms_body_text' => array(
495 'name' => 'sms_body_text',
496 'type' => CRM_Utils_Type::T_LONGTEXT,
497 'title' => ts('SMS Reminder Text') ,
498 'description' => 'Content of the SMS text.',
499 ) ,
500 'subject' => array(
501 'name' => 'subject',
502 'type' => CRM_Utils_Type::T_STRING,
503 'title' => ts('Reminder Subject') ,
504 'description' => 'Subject of mailing',
505 'maxlength' => 128,
506 'size' => CRM_Utils_Type::HUGE,
507 ) ,
508 'record_activity' => array(
509 'name' => 'record_activity',
510 'type' => CRM_Utils_Type::T_BOOLEAN,
511 'title' => ts('Record Activity for Reminder?') ,
512 'description' => 'Record Activity for this reminder?',
513 'default' => 'NULL',
514 ) ,
515 'mapping_id' => array(
516 'name' => 'mapping_id',
517 'type' => CRM_Utils_Type::T_STRING,
518 'title' => ts('Reminder Mapping') ,
519 'description' => 'Name/ID of the mapping to use on this table',
520 'maxlength' => 64,
521 'size' => CRM_Utils_Type::BIG,
522 ) ,
523 'group_id' => array(
524 'name' => 'group_id',
525 'type' => CRM_Utils_Type::T_INT,
526 'title' => ts('Reminder Group') ,
527 'description' => 'FK to Group',
528 'FKClassName' => 'CRM_Contact_DAO_Group',
529 'html' => array(
530 'type' => 'Select',
531 ) ,
532 'pseudoconstant' => array(
533 'table' => 'civicrm_group',
534 'keyColumn' => 'id',
535 'labelColumn' => 'title',
536 )
537 ) ,
538 'msg_template_id' => array(
539 'name' => 'msg_template_id',
540 'type' => CRM_Utils_Type::T_INT,
541 'title' => ts('Reminder Template') ,
542 'description' => 'FK to the message template.',
543 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
544 ) ,
545 'sms_template_id' => array(
546 'name' => 'sms_template_id',
547 'type' => CRM_Utils_Type::T_INT,
548 'title' => ts('SMS Reminder Template') ,
549 'description' => 'FK to the message template.',
550 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
551 ) ,
552 'absolute_date' => array(
553 'name' => 'absolute_date',
554 'type' => CRM_Utils_Type::T_DATE,
555 'title' => ts('Fixed Date for Reminder') ,
556 'description' => 'Date on which the reminder be sent.',
557 ) ,
558 'from_name' => array(
559 'name' => 'from_name',
560 'type' => CRM_Utils_Type::T_STRING,
561 'title' => ts('Reminder from Name') ,
562 'description' => 'Name in "from" field',
563 'maxlength' => 255,
564 'size' => CRM_Utils_Type::HUGE,
565 ) ,
566 'from_email' => array(
567 'name' => 'from_email',
568 'type' => CRM_Utils_Type::T_STRING,
569 'title' => ts('Reminder From Email') ,
570 'description' => 'Email address in "from" field',
571 'maxlength' => 255,
572 'size' => CRM_Utils_Type::HUGE,
573 ) ,
574 'mode' => array(
575 'name' => 'mode',
576 'type' => CRM_Utils_Type::T_STRING,
577 'title' => ts('Message Mode') ,
578 'description' => 'Send the message as email or sms or both.',
579 'maxlength' => 128,
580 'size' => CRM_Utils_Type::HUGE,
581 'default' => 'Email',
582 'html' => array(
583 'type' => 'Select',
584 ) ,
585 'pseudoconstant' => array(
586 'optionGroupName' => 'msg_mode',
587 'optionEditPath' => 'civicrm/admin/options/msg_mode',
588 )
589 ) ,
590 'sms_provider_id' => array(
591 'name' => 'sms_provider_id',
592 'type' => CRM_Utils_Type::T_INT,
593 'title' => ts('SMS Provider') ,
594 'FKClassName' => 'CRM_SMS_DAO_Provider',
595 'html' => array(
596 'type' => 'Select',
597 ) ,
598 ) ,
599 'used_for' => array(
600 'name' => 'used_for',
601 'type' => CRM_Utils_Type::T_STRING,
602 'title' => ts('Used For') ,
603 'description' => 'Used for repeating entity',
604 'maxlength' => 64,
605 'size' => CRM_Utils_Type::BIG,
606 ) ,
607 'filter_contact_language' => array(
608 'name' => 'filter_contact_language',
609 'type' => CRM_Utils_Type::T_STRING,
610 'title' => ts('Filter Contact Language') ,
611 'description' => 'Used for multilingual installation',
612 'maxlength' => 128,
613 'size' => CRM_Utils_Type::HUGE,
614 ) ,
615 'communication_language' => array(
616 'name' => 'communication_language',
617 'type' => CRM_Utils_Type::T_STRING,
618 'title' => ts('Communication Language') ,
619 'description' => 'Used for multilingual installation',
620 'maxlength' => 8,
621 'size' => CRM_Utils_Type::EIGHT,
622 ) ,
623 );
624 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
625 }
626 return Civi::$statics[__CLASS__]['fields'];
627 }
628 /**
629 * Return a mapping from field-name to the corresponding key (as used in fields()).
630 *
631 * @return array
632 * Array(string $name => string $uniqueName).
633 */
634 static function &fieldKeys() {
635 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
636 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
637 }
638 return Civi::$statics[__CLASS__]['fieldKeys'];
639 }
640 /**
641 * Returns the names of this table
642 *
643 * @return string
644 */
645 static function getTableName() {
646 return self::$_tableName;
647 }
648 /**
649 * Returns if this table needs to be logged
650 *
651 * @return boolean
652 */
653 function getLog() {
654 return self::$_log;
655 }
656 /**
657 * Returns the list of fields that can be imported
658 *
659 * @param bool $prefix
660 *
661 * @return array
662 */
663 static function &import($prefix = false) {
664 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'action_schedule', $prefix, array());
665 return $r;
666 }
667 /**
668 * Returns the list of fields that can be exported
669 *
670 * @param bool $prefix
671 *
672 * @return array
673 */
674 static function &export($prefix = false) {
675 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'action_schedule', $prefix, array());
676 return $r;
677 }
678 }