Merge pull request #11163 from mickadoo/CRM-21334-fire-hooks-on-contact-image-deletion
[civicrm-core.git] / CRM / UF / Form / AdvanceSetting.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
7e9e8871 4 | CiviCRM version 4.7 |
6a488035 5 +--------------------------------------------------------------------+
0f03f337 6 | Copyright CiviCRM LLC (c) 2004-2017 |
6a488035
TO
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 +--------------------------------------------------------------------+
d25dd0ee 26 */
6a488035
TO
27
28/**
29 *
30 * @package CRM
0f03f337 31 * @copyright CiviCRM LLC (c) 2004-2017
6a488035
TO
32 */
33class CRM_UF_Form_AdvanceSetting extends CRM_UF_Form_Group {
34
35 /**
dbb0d30b 36 * Build the form object for Advanced Settings.
6a488035 37 *
c490a46a 38 * @param CRM_Core_Form $form
6a488035
TO
39 */
40 public static function buildAdvanceSetting(&$form) {
41 // should mapping be enabled for this group
42 $form->addElement('checkbox', 'is_map', ts('Enable mapping for this profile?'));
43
44 // should we allow updates on a exisitng contact
353ffa53 45 $options = array();
6a488035
TO
46 $options[] = $form->createElement('radio', NULL, NULL, ts('Issue warning and do not save'), 0);
47 $options[] = $form->createElement('radio', NULL, NULL, ts('Update the matching contact'), 1);
48 $options[] = $form->createElement('radio', NULL, NULL, ts('Allow duplicate contact to be created'), 2);
49
50 $form->addGroup($options, 'is_update_dupe', ts('What to do upon duplicate match'));
51 // we do not have any url checks to allow relative urls
52 $form->addElement('text', 'post_URL', ts('Redirect URL'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_UFGroup', 'post_URL'));
53 $form->addElement('text', 'cancel_URL', ts('Cancel Redirect URL'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_UFGroup', 'cancel_URL'));
c48f851a
SL
54 $form->addElement('text', 'cancel_button_text', ts('Cancel Button Text'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_UFGroup', 'cancel_button_text'));
55 $form->addElement('text', 'submit_button_text', ts('Submit Button Text'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_UFGroup', 'submit_button_text'));
6a488035
TO
56
57 // add select for groups
af9b09df 58 $group = array('' => ts('- select -')) + $form->_group;
6a488035
TO
59 $form->_groupElement = &$form->addElement('select', 'group', ts('Limit listings to a specific Group?'), $group);
60
61 //add notify field
62 $form->addElement('text', 'notify', ts('Notify when profile form is submitted?'));
63
64 //group where new contacts are directed.
65 $form->addElement('select', 'add_contact_to_group', ts('Add new contacts to a Group?'), $group);
66
67 // add CAPTCHA To this group ?
68 $form->addElement('checkbox', 'add_captcha', ts('Include reCAPTCHA?'));
69
70 // should we display an edit link
71 $form->addElement('checkbox', 'is_edit_link', ts('Include profile edit links in search results?'));
72
73 // should we display a link to the website profile
74 $config = CRM_Core_Config::singleton();
75 $form->addElement('checkbox', 'is_uf_link', ts('Include %1 user account information links in search results?', array(1 => $config->userFramework)));
76
77 // want to create cms user
78 $session = CRM_Core_Session::singleton();
79 $cmsId = FALSE;
80 if ($form->_cId = $session->get('userID')) {
81 $form->_cmsId = TRUE;
82 }
83
353ffa53 84 $options = array();
6a488035
TO
85 $options[] = $form->createElement('radio', NULL, NULL, ts('No account create option'), 0);
86 $options[] = $form->createElement('radio', NULL, NULL, ts('Give option, but not required'), 1);
87 $options[] = $form->createElement('radio', NULL, NULL, ts('Account creation required'), 2);
88
89 $form->addGroup($options, 'is_cms_user', ts('%1 user account registration option?', array(1 => $config->userFramework)));
90
91 // options for including Proximity Search in the profile search form
353ffa53 92 $proxOptions = array();
6a488035
TO
93 $proxOptions[] = $form->createElement('radio', NULL, NULL, ts('None'), 0);
94 $proxOptions[] = $form->createElement('radio', NULL, NULL, ts('Optional'), 1);
95 $proxOptions[] = $form->createElement('radio', NULL, NULL, ts('Required'), 2);
96
8e3d52a4 97 $form->addGroup($proxOptions, 'is_proximity_search', ts('Proximity Search'));
6a488035 98 }
96025800 99
6a488035 100}