Commit | Line | Data |
---|---|---|
e501603b | 1 | <?php |
c3fc2621 | 2 | |
e501603b TO |
3 | /** |
4 | * @package CRM | |
ca5cec67 | 5 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
e501603b TO |
6 | * |
7 | * Generated from xml/schema/CRM/Campaign/Survey.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
88c31c05 | 9 | * (GenCodeChecksum:64142d8dce39f27b66b36f62ba137b74) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the Survey entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Campaign_DAO_Survey extends CRM_Core_DAO { |
929a1c14 CW |
16 | const EXT = 'civicrm'; |
17 | const TABLE_ADDED = '3.2'; | |
d31fb4e3 | 18 | const COMPONENT = 'CiviCampaign'; |
c3fc2621 | 19 | |
e501603b | 20 | /** |
f41f0342 | 21 | * Static instance to hold the table name. |
e501603b TO |
22 | * |
23 | * @var string | |
24 | */ | |
fa45b5b9 | 25 | public static $_tableName = 'civicrm_survey'; |
c3fc2621 | 26 | |
449c4e6b CW |
27 | /** |
28 | * Icon associated with this entity. | |
29 | * | |
30 | * @var string | |
31 | */ | |
32 | public static $_icon = 'fa-clipboard'; | |
33 | ||
8ab43c93 CW |
34 | /** |
35 | * Field to show when displaying a record. | |
36 | * | |
37 | * @var string | |
38 | */ | |
39 | public static $_labelField = 'title'; | |
40 | ||
e501603b | 41 | /** |
f41f0342 | 42 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b | 43 | * |
c3fc2621 | 44 | * @var bool |
e501603b | 45 | */ |
fa45b5b9 | 46 | public static $_log = FALSE; |
c3fc2621 | 47 | |
e501603b TO |
48 | /** |
49 | * Survey id. | |
50 | * | |
e6ca0a57 | 51 | * @var int |
e501603b TO |
52 | */ |
53 | public $id; | |
c3fc2621 | 54 | |
e501603b TO |
55 | /** |
56 | * Title of the Survey. | |
57 | * | |
58 | * @var string | |
59 | */ | |
60 | public $title; | |
c3fc2621 | 61 | |
e501603b TO |
62 | /** |
63 | * Foreign key to the Campaign. | |
64 | * | |
e6ca0a57 | 65 | * @var int |
e501603b TO |
66 | */ |
67 | public $campaign_id; | |
c3fc2621 | 68 | |
e501603b TO |
69 | /** |
70 | * Implicit FK to civicrm_option_value where option_group = activity_type | |
71 | * | |
e6ca0a57 | 72 | * @var int |
e501603b TO |
73 | */ |
74 | public $activity_type_id; | |
c3fc2621 | 75 | |
e501603b TO |
76 | /** |
77 | * Recontact intervals for each status. | |
78 | * | |
79 | * @var text | |
80 | */ | |
81 | public $recontact_interval; | |
c3fc2621 | 82 | |
e501603b TO |
83 | /** |
84 | * Script instructions for volunteers to use for the survey. | |
85 | * | |
86 | * @var text | |
87 | */ | |
88 | public $instructions; | |
c3fc2621 | 89 | |
e501603b TO |
90 | /** |
91 | * Number of days for recurrence of release. | |
92 | * | |
e6ca0a57 | 93 | * @var int |
e501603b TO |
94 | */ |
95 | public $release_frequency; | |
c3fc2621 | 96 | |
e501603b TO |
97 | /** |
98 | * Maximum number of contacts to allow for survey. | |
99 | * | |
e6ca0a57 | 100 | * @var int |
e501603b TO |
101 | */ |
102 | public $max_number_of_contacts; | |
c3fc2621 | 103 | |
e501603b TO |
104 | /** |
105 | * Default number of contacts to allow for survey. | |
106 | * | |
e6ca0a57 | 107 | * @var int |
e501603b TO |
108 | */ |
109 | public $default_number_of_contacts; | |
c3fc2621 | 110 | |
e501603b TO |
111 | /** |
112 | * Is this survey enabled or disabled/cancelled? | |
113 | * | |
e6ca0a57 | 114 | * @var bool |
e501603b TO |
115 | */ |
116 | public $is_active; | |
c3fc2621 | 117 | |
e501603b TO |
118 | /** |
119 | * Is this default survey? | |
120 | * | |
e6ca0a57 | 121 | * @var bool |
e501603b TO |
122 | */ |
123 | public $is_default; | |
c3fc2621 | 124 | |
e501603b TO |
125 | /** |
126 | * FK to civicrm_contact, who created this Survey. | |
127 | * | |
e6ca0a57 | 128 | * @var int |
e501603b TO |
129 | */ |
130 | public $created_id; | |
c3fc2621 | 131 | |
e501603b TO |
132 | /** |
133 | * Date and time that Survey was created. | |
134 | * | |
135 | * @var datetime | |
136 | */ | |
137 | public $created_date; | |
c3fc2621 | 138 | |
e501603b TO |
139 | /** |
140 | * FK to civicrm_contact, who recently edited this Survey. | |
141 | * | |
e6ca0a57 | 142 | * @var int |
e501603b TO |
143 | */ |
144 | public $last_modified_id; | |
c3fc2621 | 145 | |
e501603b TO |
146 | /** |
147 | * Date and time that Survey was edited last time. | |
148 | * | |
149 | * @var datetime | |
150 | */ | |
151 | public $last_modified_date; | |
c3fc2621 | 152 | |
e501603b TO |
153 | /** |
154 | * Used to store option group id. | |
155 | * | |
e6ca0a57 | 156 | * @var int |
e501603b TO |
157 | */ |
158 | public $result_id; | |
c3fc2621 | 159 | |
e501603b TO |
160 | /** |
161 | * Bypass the email verification. | |
162 | * | |
e6ca0a57 | 163 | * @var bool |
e501603b TO |
164 | */ |
165 | public $bypass_confirm; | |
c3fc2621 | 166 | |
e501603b TO |
167 | /** |
168 | * Title for Thank-you page (header title tag, and display at the top of the page). | |
169 | * | |
170 | * @var string | |
171 | */ | |
172 | public $thankyou_title; | |
c3fc2621 | 173 | |
e501603b TO |
174 | /** |
175 | * text and html allowed. displayed above result on success page | |
176 | * | |
177 | * @var text | |
178 | */ | |
179 | public $thankyou_text; | |
c3fc2621 | 180 | |
e501603b TO |
181 | /** |
182 | * Can people share the petition through social media? | |
183 | * | |
e6ca0a57 | 184 | * @var bool |
e501603b TO |
185 | */ |
186 | public $is_share; | |
c3fc2621 | 187 | |
e501603b | 188 | /** |
f41f0342 | 189 | * Class constructor. |
e501603b | 190 | */ |
c3fc2621 | 191 | public function __construct() { |
e501603b TO |
192 | $this->__table = 'civicrm_survey'; |
193 | parent::__construct(); | |
194 | } | |
c3fc2621 | 195 | |
449c4e6b CW |
196 | /** |
197 | * Returns localized title of this entity. | |
7b66c3b5 AH |
198 | * |
199 | * @param bool $plural | |
200 | * Whether to return the plural version of the title. | |
449c4e6b | 201 | */ |
7b66c3b5 AH |
202 | public static function getEntityTitle($plural = FALSE) { |
203 | return $plural ? ts('Surveys') : ts('Survey'); | |
449c4e6b CW |
204 | } |
205 | ||
e501603b | 206 | /** |
f41f0342 | 207 | * Returns foreign keys and entity references. |
e501603b TO |
208 | * |
209 | * @return array | |
210 | * [CRM_Core_Reference_Interface] | |
211 | */ | |
c3fc2621 | 212 | public static function getReferenceColumns() { |
346aaaba | 213 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
fa45b5b9 | 214 | Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); |
c3fc2621 CW |
215 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'campaign_id', 'civicrm_campaign', 'id'); |
216 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'created_id', 'civicrm_contact', 'id'); | |
217 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'last_modified_id', 'civicrm_contact', 'id'); | |
346aaaba | 218 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
e501603b | 219 | } |
346aaaba | 220 | return Civi::$statics[__CLASS__]['links']; |
e501603b | 221 | } |
c3fc2621 | 222 | |
e501603b TO |
223 | /** |
224 | * Returns all the column names of this table | |
225 | * | |
226 | * @return array | |
227 | */ | |
c3fc2621 | 228 | public static function &fields() { |
346aaaba | 229 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
230 | Civi::$statics[__CLASS__]['fields'] = [ |
231 | 'id' => [ | |
e501603b TO |
232 | 'name' => 'id', |
233 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 234 | 'title' => ts('Survey ID'), |
215b423e | 235 | 'description' => ts('Survey id.'), |
c3fc2621 | 236 | 'required' => TRUE, |
a36434b9 | 237 | 'where' => 'civicrm_survey.id', |
522a26c9 | 238 | 'table_name' => 'civicrm_survey', |
239 | 'entity' => 'Survey', | |
240 | 'bao' => 'CRM_Campaign_BAO_Survey', | |
6a7e5e5d | 241 | 'localizable' => 0, |
2cbbebe8 A |
242 | 'html' => [ |
243 | 'type' => 'Number', | |
244 | ], | |
1fe423d6 | 245 | 'readonly' => TRUE, |
a9d0587b | 246 | 'add' => '3.3', |
c3fc2621 CW |
247 | ], |
248 | 'title' => [ | |
e501603b TO |
249 | 'name' => 'title', |
250 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 251 | 'title' => ts('Survey Title'), |
215b423e | 252 | 'description' => ts('Title of the Survey.'), |
c3fc2621 | 253 | 'required' => TRUE, |
e501603b TO |
254 | 'maxlength' => 255, |
255 | 'size' => CRM_Utils_Type::HUGE, | |
c3fc2621 | 256 | 'import' => TRUE, |
e501603b | 257 | 'where' => 'civicrm_survey.title', |
c3fc2621 | 258 | 'export' => TRUE, |
522a26c9 | 259 | 'table_name' => 'civicrm_survey', |
260 | 'entity' => 'Survey', | |
261 | 'bao' => 'CRM_Campaign_BAO_Survey', | |
6a7e5e5d | 262 | 'localizable' => 1, |
a9d0587b | 263 | 'add' => '3.3', |
c3fc2621 CW |
264 | ], |
265 | 'campaign_id' => [ | |
e501603b TO |
266 | 'name' => 'campaign_id', |
267 | 'type' => CRM_Utils_Type::T_INT, | |
2cbbebe8 | 268 | 'title' => ts('Campaign ID'), |
215b423e | 269 | 'description' => ts('Foreign key to the Campaign.'), |
a36434b9 | 270 | 'where' => 'civicrm_survey.campaign_id', |
e501603b | 271 | 'default' => 'NULL', |
522a26c9 | 272 | 'table_name' => 'civicrm_survey', |
273 | 'entity' => 'Survey', | |
274 | 'bao' => 'CRM_Campaign_BAO_Survey', | |
6a7e5e5d | 275 | 'localizable' => 0, |
e501603b | 276 | 'FKClassName' => 'CRM_Campaign_DAO_Campaign', |
2cbbebe8 | 277 | 'html' => [ |
8813f972 | 278 | 'type' => 'EntityRef', |
2cbbebe8 A |
279 | 'label' => ts("Campaign"), |
280 | ], | |
a9d0587b | 281 | 'add' => '3.3', |
c3fc2621 CW |
282 | ], |
283 | 'activity_type_id' => [ | |
e501603b TO |
284 | 'name' => 'activity_type_id', |
285 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 286 | 'title' => ts('Activity Type'), |
215b423e | 287 | 'description' => ts('Implicit FK to civicrm_option_value where option_group = activity_type'), |
c3fc2621 | 288 | 'import' => TRUE, |
e501603b | 289 | 'where' => 'civicrm_survey.activity_type_id', |
c3fc2621 | 290 | 'export' => TRUE, |
e501603b | 291 | 'default' => 'NULL', |
522a26c9 | 292 | 'table_name' => 'civicrm_survey', |
293 | 'entity' => 'Survey', | |
294 | 'bao' => 'CRM_Campaign_BAO_Survey', | |
6a7e5e5d | 295 | 'localizable' => 0, |
c3fc2621 | 296 | 'html' => [ |
e501603b | 297 | 'type' => 'Select', |
c3fc2621 CW |
298 | ], |
299 | 'pseudoconstant' => [ | |
e501603b TO |
300 | 'optionGroupName' => 'activity_type', |
301 | 'optionEditPath' => 'civicrm/admin/options/activity_type', | |
e6ca0a57 | 302 | ], |
a9d0587b | 303 | 'add' => '3.3', |
c3fc2621 CW |
304 | ], |
305 | 'recontact_interval' => [ | |
e501603b TO |
306 | 'name' => 'recontact_interval', |
307 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 308 | 'title' => ts('Follow up Interval'), |
215b423e | 309 | 'description' => ts('Recontact intervals for each status.'), |
e501603b TO |
310 | 'rows' => 20, |
311 | 'cols' => 80, | |
a36434b9 | 312 | 'where' => 'civicrm_survey.recontact_interval', |
522a26c9 | 313 | 'table_name' => 'civicrm_survey', |
314 | 'entity' => 'Survey', | |
315 | 'bao' => 'CRM_Campaign_BAO_Survey', | |
6a7e5e5d | 316 | 'localizable' => 0, |
c3fc2621 | 317 | 'html' => [ |
e501603b | 318 | 'type' => 'TextArea', |
c3fc2621 | 319 | ], |
a9d0587b | 320 | 'add' => '3.3', |
c3fc2621 CW |
321 | ], |
322 | 'instructions' => [ | |
e501603b TO |
323 | 'name' => 'instructions', |
324 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 325 | 'title' => ts('Instructions'), |
215b423e | 326 | 'description' => ts('Script instructions for volunteers to use for the survey.'), |
e501603b TO |
327 | 'rows' => 20, |
328 | 'cols' => 80, | |
a36434b9 | 329 | 'where' => 'civicrm_survey.instructions', |
522a26c9 | 330 | 'table_name' => 'civicrm_survey', |
331 | 'entity' => 'Survey', | |
332 | 'bao' => 'CRM_Campaign_BAO_Survey', | |
6a7e5e5d | 333 | 'localizable' => 1, |
c3fc2621 | 334 | 'html' => [ |
e501603b | 335 | 'type' => 'TextArea', |
c3fc2621 | 336 | ], |
a9d0587b | 337 | 'add' => '3.3', |
c3fc2621 CW |
338 | ], |
339 | 'release_frequency' => [ | |
e501603b TO |
340 | 'name' => 'release_frequency', |
341 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 342 | 'title' => ts('Survey Hold Duration'), |
215b423e | 343 | 'description' => ts('Number of days for recurrence of release.'), |
a36434b9 | 344 | 'where' => 'civicrm_survey.release_frequency', |
e501603b | 345 | 'default' => 'NULL', |
522a26c9 | 346 | 'table_name' => 'civicrm_survey', |
347 | 'entity' => 'Survey', | |
348 | 'bao' => 'CRM_Campaign_BAO_Survey', | |
6a7e5e5d | 349 | 'localizable' => 0, |
a9d0587b | 350 | 'add' => '3.3', |
c3fc2621 CW |
351 | ], |
352 | 'max_number_of_contacts' => [ | |
e501603b TO |
353 | 'name' => 'max_number_of_contacts', |
354 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 355 | 'title' => ts('Maximum number of contacts'), |
215b423e | 356 | 'description' => ts('Maximum number of contacts to allow for survey.'), |
a36434b9 | 357 | 'where' => 'civicrm_survey.max_number_of_contacts', |
e501603b | 358 | 'default' => 'NULL', |
522a26c9 | 359 | 'table_name' => 'civicrm_survey', |
360 | 'entity' => 'Survey', | |
361 | 'bao' => 'CRM_Campaign_BAO_Survey', | |
6a7e5e5d | 362 | 'localizable' => 0, |
a9d0587b | 363 | 'add' => '3.3', |
c3fc2621 CW |
364 | ], |
365 | 'default_number_of_contacts' => [ | |
e501603b TO |
366 | 'name' => 'default_number_of_contacts', |
367 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 368 | 'title' => ts('Default number of contacts'), |
215b423e | 369 | 'description' => ts('Default number of contacts to allow for survey.'), |
a36434b9 | 370 | 'where' => 'civicrm_survey.default_number_of_contacts', |
e501603b | 371 | 'default' => 'NULL', |
522a26c9 | 372 | 'table_name' => 'civicrm_survey', |
373 | 'entity' => 'Survey', | |
374 | 'bao' => 'CRM_Campaign_BAO_Survey', | |
6a7e5e5d | 375 | 'localizable' => 0, |
a9d0587b | 376 | 'add' => '3.3', |
c3fc2621 CW |
377 | ], |
378 | 'is_active' => [ | |
e501603b TO |
379 | 'name' => 'is_active', |
380 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 381 | 'title' => ts('Survey Is Active'), |
215b423e | 382 | 'description' => ts('Is this survey enabled or disabled/cancelled?'), |
a36434b9 | 383 | 'where' => 'civicrm_survey.is_active', |
e501603b | 384 | 'default' => '1', |
522a26c9 | 385 | 'table_name' => 'civicrm_survey', |
386 | 'entity' => 'Survey', | |
387 | 'bao' => 'CRM_Campaign_BAO_Survey', | |
6a7e5e5d | 388 | 'localizable' => 0, |
a9d0587b | 389 | 'add' => '3.3', |
c3fc2621 CW |
390 | ], |
391 | 'is_default' => [ | |
e501603b TO |
392 | 'name' => 'is_default', |
393 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 394 | 'title' => ts('Is Default Survey'), |
215b423e | 395 | 'description' => ts('Is this default survey?'), |
a36434b9 | 396 | 'where' => 'civicrm_survey.is_default', |
45a83e42 | 397 | 'default' => '0', |
522a26c9 | 398 | 'table_name' => 'civicrm_survey', |
399 | 'entity' => 'Survey', | |
400 | 'bao' => 'CRM_Campaign_BAO_Survey', | |
6a7e5e5d | 401 | 'localizable' => 0, |
a9d0587b | 402 | 'add' => '3.3', |
c3fc2621 CW |
403 | ], |
404 | 'created_id' => [ | |
e501603b TO |
405 | 'name' => 'created_id', |
406 | 'type' => CRM_Utils_Type::T_INT, | |
2cbbebe8 | 407 | 'title' => ts('Created By Contact ID'), |
215b423e | 408 | 'description' => ts('FK to civicrm_contact, who created this Survey.'), |
a36434b9 | 409 | 'where' => 'civicrm_survey.created_id', |
522a26c9 | 410 | 'table_name' => 'civicrm_survey', |
411 | 'entity' => 'Survey', | |
412 | 'bao' => 'CRM_Campaign_BAO_Survey', | |
6a7e5e5d | 413 | 'localizable' => 0, |
e501603b | 414 | 'FKClassName' => 'CRM_Contact_DAO_Contact', |
2cbbebe8 A |
415 | 'html' => [ |
416 | 'label' => ts("Created By"), | |
417 | ], | |
a9d0587b | 418 | 'add' => '3.3', |
c3fc2621 CW |
419 | ], |
420 | 'created_date' => [ | |
e501603b TO |
421 | 'name' => 'created_date', |
422 | 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, | |
c3fc2621 | 423 | 'title' => ts('Campaign Created Date'), |
215b423e | 424 | 'description' => ts('Date and time that Survey was created.'), |
a36434b9 | 425 | 'where' => 'civicrm_survey.created_date', |
522a26c9 | 426 | 'table_name' => 'civicrm_survey', |
427 | 'entity' => 'Survey', | |
428 | 'bao' => 'CRM_Campaign_BAO_Survey', | |
6a7e5e5d | 429 | 'localizable' => 0, |
a9d0587b | 430 | 'add' => '3.3', |
c3fc2621 CW |
431 | ], |
432 | 'last_modified_id' => [ | |
e501603b TO |
433 | 'name' => 'last_modified_id', |
434 | 'type' => CRM_Utils_Type::T_INT, | |
2cbbebe8 | 435 | 'title' => ts('Modified By Contact ID'), |
215b423e | 436 | 'description' => ts('FK to civicrm_contact, who recently edited this Survey.'), |
a36434b9 | 437 | 'where' => 'civicrm_survey.last_modified_id', |
522a26c9 | 438 | 'table_name' => 'civicrm_survey', |
439 | 'entity' => 'Survey', | |
440 | 'bao' => 'CRM_Campaign_BAO_Survey', | |
6a7e5e5d | 441 | 'localizable' => 0, |
e501603b | 442 | 'FKClassName' => 'CRM_Contact_DAO_Contact', |
2cbbebe8 A |
443 | 'html' => [ |
444 | 'label' => ts("Modified By"), | |
445 | ], | |
a9d0587b | 446 | 'add' => '3.3', |
c3fc2621 CW |
447 | ], |
448 | 'last_modified_date' => [ | |
e501603b TO |
449 | 'name' => 'last_modified_date', |
450 | 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, | |
c3fc2621 | 451 | 'title' => ts('Survey Modified On'), |
215b423e | 452 | 'description' => ts('Date and time that Survey was edited last time.'), |
a36434b9 | 453 | 'where' => 'civicrm_survey.last_modified_date', |
522a26c9 | 454 | 'table_name' => 'civicrm_survey', |
455 | 'entity' => 'Survey', | |
456 | 'bao' => 'CRM_Campaign_BAO_Survey', | |
6a7e5e5d | 457 | 'localizable' => 0, |
a9d0587b | 458 | 'add' => '3.3', |
c3fc2621 CW |
459 | ], |
460 | 'result_id' => [ | |
e501603b TO |
461 | 'name' => 'result_id', |
462 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 463 | 'title' => ts('Survey Result'), |
215b423e | 464 | 'description' => ts('Used to store option group id.'), |
a36434b9 | 465 | 'where' => 'civicrm_survey.result_id', |
e501603b | 466 | 'default' => 'NULL', |
522a26c9 | 467 | 'table_name' => 'civicrm_survey', |
468 | 'entity' => 'Survey', | |
469 | 'bao' => 'CRM_Campaign_BAO_Survey', | |
6a7e5e5d | 470 | 'localizable' => 0, |
a9d0587b | 471 | 'add' => '3.3', |
c3fc2621 CW |
472 | ], |
473 | 'bypass_confirm' => [ | |
e501603b TO |
474 | 'name' => 'bypass_confirm', |
475 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 476 | 'title' => ts('No Email Verification'), |
215b423e | 477 | 'description' => ts('Bypass the email verification.'), |
a36434b9 | 478 | 'where' => 'civicrm_survey.bypass_confirm', |
45a83e42 | 479 | 'default' => '0', |
522a26c9 | 480 | 'table_name' => 'civicrm_survey', |
481 | 'entity' => 'Survey', | |
482 | 'bao' => 'CRM_Campaign_BAO_Survey', | |
6a7e5e5d | 483 | 'localizable' => 0, |
a9d0587b | 484 | 'add' => '4.2', |
c3fc2621 CW |
485 | ], |
486 | 'thankyou_title' => [ | |
e501603b TO |
487 | 'name' => 'thankyou_title', |
488 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 489 | 'title' => ts('Thank-you Title'), |
215b423e | 490 | 'description' => ts('Title for Thank-you page (header title tag, and display at the top of the page).'), |
e501603b TO |
491 | 'maxlength' => 255, |
492 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 493 | 'where' => 'civicrm_survey.thankyou_title', |
522a26c9 | 494 | 'table_name' => 'civicrm_survey', |
495 | 'entity' => 'Survey', | |
496 | 'bao' => 'CRM_Campaign_BAO_Survey', | |
6a7e5e5d | 497 | 'localizable' => 1, |
a9d0587b | 498 | 'add' => '4.2', |
c3fc2621 CW |
499 | ], |
500 | 'thankyou_text' => [ | |
e501603b TO |
501 | 'name' => 'thankyou_text', |
502 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 503 | 'title' => ts('Thank-you Text'), |
215b423e | 504 | 'description' => ts('text and html allowed. displayed above result on success page'), |
e501603b TO |
505 | 'rows' => 8, |
506 | 'cols' => 60, | |
a36434b9 | 507 | 'where' => 'civicrm_survey.thankyou_text', |
522a26c9 | 508 | 'table_name' => 'civicrm_survey', |
509 | 'entity' => 'Survey', | |
510 | 'bao' => 'CRM_Campaign_BAO_Survey', | |
6a7e5e5d | 511 | 'localizable' => 1, |
c3fc2621 | 512 | 'html' => [ |
e501603b | 513 | 'type' => 'TextArea', |
c3fc2621 | 514 | ], |
a9d0587b | 515 | 'add' => '4.2', |
c3fc2621 CW |
516 | ], |
517 | 'is_share' => [ | |
e501603b TO |
518 | 'name' => 'is_share', |
519 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 520 | 'title' => ts('Is shared through social media'), |
215b423e | 521 | 'description' => ts('Can people share the petition through social media?'), |
a36434b9 | 522 | 'where' => 'civicrm_survey.is_share', |
e501603b | 523 | 'default' => '1', |
522a26c9 | 524 | 'table_name' => 'civicrm_survey', |
525 | 'entity' => 'Survey', | |
526 | 'bao' => 'CRM_Campaign_BAO_Survey', | |
6a7e5e5d | 527 | 'localizable' => 0, |
a9d0587b | 528 | 'add' => '4.4', |
c3fc2621 CW |
529 | ], |
530 | ]; | |
346aaaba | 531 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 532 | } |
346aaaba | 533 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 534 | } |
c3fc2621 | 535 | |
e501603b | 536 | /** |
bd8e0b14 | 537 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
538 | * |
539 | * @return array | |
bd8e0b14 | 540 | * Array(string $name => string $uniqueName). |
e501603b | 541 | */ |
c3fc2621 | 542 | public static function &fieldKeys() { |
bd8e0b14 TO |
543 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
544 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 545 | } |
bd8e0b14 | 546 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 547 | } |
c3fc2621 | 548 | |
e501603b TO |
549 | /** |
550 | * Returns the names of this table | |
551 | * | |
552 | * @return string | |
553 | */ | |
c3fc2621 | 554 | public static function getTableName() { |
e501603b TO |
555 | return CRM_Core_DAO::getLocaleTableName(self::$_tableName); |
556 | } | |
c3fc2621 | 557 | |
e501603b TO |
558 | /** |
559 | * Returns if this table needs to be logged | |
560 | * | |
c3fc2621 | 561 | * @return bool |
e501603b | 562 | */ |
c3fc2621 | 563 | public function getLog() { |
e501603b TO |
564 | return self::$_log; |
565 | } | |
c3fc2621 | 566 | |
e501603b TO |
567 | /** |
568 | * Returns the list of fields that can be imported | |
569 | * | |
570 | * @param bool $prefix | |
571 | * | |
572 | * @return array | |
573 | */ | |
c3fc2621 CW |
574 | public static function &import($prefix = FALSE) { |
575 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'survey', $prefix, []); | |
60808919 | 576 | return $r; |
e501603b | 577 | } |
c3fc2621 | 578 | |
e501603b TO |
579 | /** |
580 | * Returns the list of fields that can be exported | |
581 | * | |
582 | * @param bool $prefix | |
583 | * | |
584 | * @return array | |
585 | */ | |
c3fc2621 CW |
586 | public static function &export($prefix = FALSE) { |
587 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'survey', $prefix, []); | |
60808919 | 588 | return $r; |
e501603b | 589 | } |
c3fc2621 | 590 | |
e7a6b91a AS |
591 | /** |
592 | * Returns the list of indices | |
c3fc2621 CW |
593 | * |
594 | * @param bool $localize | |
595 | * | |
596 | * @return array | |
e7a6b91a AS |
597 | */ |
598 | public static function indices($localize = TRUE) { | |
c3fc2621 CW |
599 | $indices = [ |
600 | 'UI_activity_type_id' => [ | |
e7a6b91a | 601 | 'name' => 'UI_activity_type_id', |
c3fc2621 | 602 | 'field' => [ |
e7a6b91a | 603 | 0 => 'activity_type_id', |
c3fc2621 CW |
604 | ], |
605 | 'localizable' => FALSE, | |
e7a6b91a | 606 | 'sig' => 'civicrm_survey::0::activity_type_id', |
c3fc2621 CW |
607 | ], |
608 | ]; | |
e7a6b91a AS |
609 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
610 | } | |
c3fc2621 | 611 | |
e501603b | 612 | } |