Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
bc77d7c0 | 4 | | Copyright CiviCRM LLC. All rights reserved. | |
6a488035 | 5 | | | |
bc77d7c0 TO |
6 | | This work is published under the GNU AGPLv3 license with some | |
7 | | permitted exceptions and without any warranty. For full license | | |
8 | | and copyright information, see https://civicrm.org/licensing | | |
6a488035 | 9 | +--------------------------------------------------------------------+ |
d25dd0ee | 10 | */ |
6a488035 TO |
11 | |
12 | /** | |
13 | * | |
14 | * @package CRM | |
ca5cec67 | 15 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
6a488035 TO |
16 | */ |
17 | class CRM_UF_Form_AdvanceSetting extends CRM_UF_Form_Group { | |
18 | ||
19 | /** | |
dbb0d30b | 20 | * Build the form object for Advanced Settings. |
6a488035 | 21 | * |
c490a46a | 22 | * @param CRM_Core_Form $form |
6a488035 TO |
23 | */ |
24 | public static function buildAdvanceSetting(&$form) { | |
5e59ce48 SL |
25 | $entityFields = [ |
26 | 'cancel_button_text', | |
27 | 'submit_button_text', | |
28 | ]; | |
29 | $form->assign('advancedFieldsConverted', $entityFields); | |
30 | ||
6a488035 TO |
31 | // should mapping be enabled for this group |
32 | $form->addElement('checkbox', 'is_map', ts('Enable mapping for this profile?')); | |
33 | ||
34 | // should we allow updates on a exisitng contact | |
be2fb01f | 35 | $options = []; |
6a488035 TO |
36 | $options[] = $form->createElement('radio', NULL, NULL, ts('Issue warning and do not save'), 0); |
37 | $options[] = $form->createElement('radio', NULL, NULL, ts('Update the matching contact'), 1); | |
38 | $options[] = $form->createElement('radio', NULL, NULL, ts('Allow duplicate contact to be created'), 2); | |
39 | ||
40 | $form->addGroup($options, 'is_update_dupe', ts('What to do upon duplicate match')); | |
41 | // we do not have any url checks to allow relative urls | |
42 | $form->addElement('text', 'post_URL', ts('Redirect URL'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_UFGroup', 'post_URL')); | |
b3f1028c JP |
43 | |
44 | $form->add('advcheckbox', 'add_cancel_button', ts('Include Cancel Button?')); | |
6a488035 TO |
45 | $form->addElement('text', 'cancel_URL', ts('Cancel Redirect URL'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_UFGroup', 'cancel_URL')); |
46 | ||
47 | // add select for groups | |
be2fb01f | 48 | $group = ['' => ts('- select -')] + $form->_group; |
6a488035 TO |
49 | $form->_groupElement = &$form->addElement('select', 'group', ts('Limit listings to a specific Group?'), $group); |
50 | ||
51 | //add notify field | |
52 | $form->addElement('text', 'notify', ts('Notify when profile form is submitted?')); | |
53 | ||
54 | //group where new contacts are directed. | |
55 | $form->addElement('select', 'add_contact_to_group', ts('Add new contacts to a Group?'), $group); | |
56 | ||
57 | // add CAPTCHA To this group ? | |
58 | $form->addElement('checkbox', 'add_captcha', ts('Include reCAPTCHA?')); | |
59 | ||
60 | // should we display an edit link | |
61 | $form->addElement('checkbox', 'is_edit_link', ts('Include profile edit links in search results?')); | |
62 | ||
63 | // should we display a link to the website profile | |
64 | $config = CRM_Core_Config::singleton(); | |
be2fb01f | 65 | $form->addElement('checkbox', 'is_uf_link', ts('Include %1 user account information links in search results?', [1 => $config->userFramework])); |
6a488035 TO |
66 | |
67 | // want to create cms user | |
68 | $session = CRM_Core_Session::singleton(); | |
69 | $cmsId = FALSE; | |
70 | if ($form->_cId = $session->get('userID')) { | |
71 | $form->_cmsId = TRUE; | |
72 | } | |
73 | ||
be2fb01f | 74 | $options = []; |
6a488035 TO |
75 | $options[] = $form->createElement('radio', NULL, NULL, ts('No account create option'), 0); |
76 | $options[] = $form->createElement('radio', NULL, NULL, ts('Give option, but not required'), 1); | |
77 | $options[] = $form->createElement('radio', NULL, NULL, ts('Account creation required'), 2); | |
78 | ||
be2fb01f | 79 | $form->addGroup($options, 'is_cms_user', ts('%1 user account registration option?', [1 => $config->userFramework])); |
6a488035 TO |
80 | |
81 | // options for including Proximity Search in the profile search form | |
be2fb01f | 82 | $proxOptions = []; |
6a488035 TO |
83 | $proxOptions[] = $form->createElement('radio', NULL, NULL, ts('None'), 0); |
84 | $proxOptions[] = $form->createElement('radio', NULL, NULL, ts('Optional'), 1); | |
85 | $proxOptions[] = $form->createElement('radio', NULL, NULL, ts('Required'), 2); | |
86 | ||
8e3d52a4 | 87 | $form->addGroup($proxOptions, 'is_proximity_search', ts('Proximity Search')); |
6a488035 | 88 | } |
96025800 | 89 | |
6a488035 | 90 | } |