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 | |
39405208 | 35 | $form->addRadio('is_update_dupe', ts('What to do upon duplicate match'), [ts('Issue warning and do not save'), ts('Update the matching contact'), ts('Allow duplicate contact to be created')]); |
6a488035 TO |
36 | // we do not have any url checks to allow relative urls |
37 | $form->addElement('text', 'post_URL', ts('Redirect URL'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_UFGroup', 'post_URL')); | |
b3f1028c JP |
38 | |
39 | $form->add('advcheckbox', 'add_cancel_button', ts('Include Cancel Button?')); | |
6a488035 TO |
40 | $form->addElement('text', 'cancel_URL', ts('Cancel Redirect URL'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_UFGroup', 'cancel_URL')); |
41 | ||
42 | // add select for groups | |
be2fb01f | 43 | $group = ['' => ts('- select -')] + $form->_group; |
6a488035 TO |
44 | $form->_groupElement = &$form->addElement('select', 'group', ts('Limit listings to a specific Group?'), $group); |
45 | ||
46 | //add notify field | |
47 | $form->addElement('text', 'notify', ts('Notify when profile form is submitted?')); | |
48 | ||
49 | //group where new contacts are directed. | |
50 | $form->addElement('select', 'add_contact_to_group', ts('Add new contacts to a Group?'), $group); | |
51 | ||
52 | // add CAPTCHA To this group ? | |
53 | $form->addElement('checkbox', 'add_captcha', ts('Include reCAPTCHA?')); | |
54 | ||
55 | // should we display an edit link | |
56 | $form->addElement('checkbox', 'is_edit_link', ts('Include profile edit links in search results?')); | |
57 | ||
58 | // should we display a link to the website profile | |
59 | $config = CRM_Core_Config::singleton(); | |
be2fb01f | 60 | $form->addElement('checkbox', 'is_uf_link', ts('Include %1 user account information links in search results?', [1 => $config->userFramework])); |
6a488035 TO |
61 | |
62 | // want to create cms user | |
63 | $session = CRM_Core_Session::singleton(); | |
64 | $cmsId = FALSE; | |
65 | if ($form->_cId = $session->get('userID')) { | |
66 | $form->_cmsId = TRUE; | |
67 | } | |
68 | ||
39405208 | 69 | $form->addRadio('is_cms_user', ts('%1 user account registration option?', [1 => $config->userFramework]), [ts('No account create option'), ts('Give option, but not required'), ts('Account creation required')]); |
6a488035 TO |
70 | |
71 | // options for including Proximity Search in the profile search form | |
39405208 | 72 | $form->addRadio('is_proximity_search', ts('Proximity Search'), [ts('None'), ts('Optional'), ts('Required')]); |
6a488035 | 73 | } |
96025800 | 74 | |
6a488035 | 75 | } |