Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
 All Data Structures Functions Variables Pages
ContactEditAndDetailsView.php
1 <?php
2  /*********************************************************************************
3  * Zurmo is a customer relationship management program developed by
4  * Zurmo, Inc. Copyright (C) 2017 Zurmo Inc.
5  *
6  * Zurmo is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Affero General Public License version 3 as published by the
8  * Free Software Foundation with the addition of the following permission added
9  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10  * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
11  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
12  *
13  * Zurmo is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Affero General Public License along with
19  * this program; if not, see http://www.gnu.org/licenses or write to the Free
20  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  * 02110-1301 USA.
22  *
23  * You can contact Zurmo, Inc. with a mailing address at 27 North Wacker Drive
24  * Suite 370 Chicago, IL 60606. or at email address contact@zurmo.com.
25  *
26  * The interactive user interfaces in original and modified versions
27  * of this program must display Appropriate Legal Notices, as required under
28  * Section 5 of the GNU Affero General Public License version 3.
29  *
30  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31  * these Appropriate Legal Notices must retain the display of the Zurmo
32  * logo and Zurmo copyright notice. If the display of the logo is not reasonably
33  * feasible for technical reasons, the Appropriate Legal Notices must display the words
34  * "Copyright Zurmo Inc. 2017. All rights reserved".
35  ********************************************************************************/
36 
38  {
39  public static function getDefaultMetadata()
40  {
41  $metadata = array(
42  'global' => array(
43  'toolbar' => array(
44  'elements' => array(
45  array('type' => 'SaveButton', 'renderType' => 'Edit'),
46  array('type' => 'CancelLink', 'renderType' => 'Edit'),
47  array('type' => 'EditLink', 'renderType' => 'Details'),
48  array('type' => 'AuditEventsModalListLink', 'renderType' => 'Details'),
49  array('type' => 'CopyLink', 'renderType' => 'Details'),
50  array('type' => 'ContactDeleteLink', 'renderType' => 'Details'),
51  ),
52  ),
53  'derivedAttributeTypes' => array(
54  'TitleFullName',
55  'ContactStateDropDown',
56  ),
57  'nonPlaceableAttributeNames' => array(
58  'title',
59  'firstName',
60  'lastName',
61  'state',
62  'googleWebTrackingId',
63  'latestActivityDateTime'
64  ),
65  'panelsDisplayType' => FormLayout::PANELS_DISPLAY_TYPE_ALL,
66  'panels' => array(
67  array(
68  'rows' => array(
69  array('cells' =>
70  array(
71  array(
72  'elements' => array(
73  array('attributeName' => 'null', 'type' => 'TitleFullName'),
74  ),
75  ),
76  )
77  ),
78  array('cells' =>
79  array(
80  array(
81  'elements' => array(
82  array('attributeName' => 'null', 'type' => 'ContactStateDropDown'),
83  ),
84  ),
85  )
86  ),
87  array('cells' =>
88  array(
89  array(
90  'elements' => array(
91  array('attributeName' => 'jobTitle', 'type' => 'Text'),
92  ),
93  ),
94  )
95  ),
96  array('cells' =>
97  array(
98  array(
99  'elements' => array(
100  array('attributeName' => 'account', 'type' => 'Account'),
101  ),
102  ),
103  )
104  ),
105  array('cells' =>
106  array(
107  array(
108  'elements' => array(
109  array('attributeName' => 'department', 'type' => 'Text'),
110  ),
111  ),
112  )
113  ),
114  array('cells' =>
115  array(
116  array(
117  'elements' => array(
118  array('attributeName' => 'officePhone', 'type' => 'Phone'),
119  ),
120  ),
121  )
122  ),
123  array('cells' =>
124  array(
125  array(
126  'elements' => array(
127  array('attributeName' => 'source', 'type' => 'DropDown', 'addBlank' => true),
128  ),
129  ),
130  )
131  ),
132  array('cells' =>
133  array(
134  array(
135  'elements' => array(
136  array('attributeName' => 'mobilePhone', 'type' => 'Phone'),
137  ),
138  ),
139  )
140  ),
141  array('cells' =>
142  array(
143  array(
144  'elements' => array(
145  array('attributeName' => 'officeFax', 'type' => 'Phone'),
146  ),
147  ),
148  )
149  ),
150  array('cells' =>
151  array(
152  array(
153  'elements' => array(
154  array('attributeName' => 'primaryEmail', 'type' => 'EmailAddressInformation'),
155  ),
156  ),
157  )
158  ),
159  array('cells' =>
160  array(
161  array(
162  'elements' => array(
163  array('attributeName' => 'secondaryEmail', 'type' => 'EmailAddressInformation'),
164  ),
165  ),
166  )
167  ),
168  array('cells' =>
169  array(
170  array(
171  'elements' => array(
172  array('attributeName' => 'primaryAddress', 'type' => 'Address'),
173  ),
174  ),
175  )
176  ),
177  array('cells' =>
178  array(
179  array(
180  'elements' => array(
181  array('attributeName' => 'secondaryAddress', 'type' => 'Address'),
182  ),
183  ),
184  )
185  ),
186  array('cells' =>
187  array(
188  array(
189  'elements' => array(
190  array('attributeName' => 'description', 'type' => 'TextArea'),
191  ),
192  ),
193  )
194  ),
195  ),
196  ),
197  ),
198  ),
199  );
200  return $metadata;
201  }
202 
203  protected function renderContent()
204  {
205  $this->registerCopyAddressFromAccountScript();
206  $this->registerCopyOfficePhoneAndFaxFromAccountScript();
207  return parent::renderContent();
208  }
209 
210  protected function renderAfterFormLayoutForDetailsContent()
211  {
212  return ContactDetailsViewUtil::renderAfterFormLayoutForDetailsContent($this->getModel(), null);
213  }
214 
215  protected function getNewModelTitleLabel()
216  {
217  return Zurmo::t('ContactsModule', 'Create ContactsModuleSingularLabel',
219  }
220 
221  protected function registerCopyAddressFromAccountScript()
222  {
223  $url = Yii::app()->createUrl('contacts/default/getAccountAddressesToCopy');
224  $successScript = null;
225  foreach ($this->model->primaryAddress->getAttributeNames() as $attribute)
226  {
227  $successScript .= "$('#Contact_primaryAddress_" . $attribute . "').val(data.billingAddress_" . $attribute . ").trigger('change'); \n";
228  $successScript .= "$('#Contact_secondaryAddress_" . $attribute . "').val(data.shippingAddress_" . $attribute . ").trigger('change'); \n";
229  }
230  // Begin Not Coding Standard
231  Yii::app()->clientScript->registerScript('copyAddressFromAccountToContactScript', "
232  $('#Contact_account_id').live('change', function()
233  {
234  if ($('#Contact_account_id').val() &&
235  !$('#Contact_primaryAddress_street1').val() &&
236  !$('#Contact_primaryAddress_street2').val() &&
237  !$('#Contact_primaryAddress_city').val() &&
238  !$('#Contact_primaryAddress_state').val() &&
239  !$('#Contact_primaryAddress_postalCode').val() &&
240  !$('#Contact_primaryAddress_country').val() &&
241  !$('#Contact_secondaryAddress_street1').val() &&
242  !$('#Contact_secondaryAddress_street2').val() &&
243  !$('#Contact_secondaryAddress_city').val() &&
244  !$('#Contact_secondaryAddress_state').val() &&
245  !$('#Contact_secondaryAddress_postalCode').val() &&
246  !$('#Contact_secondaryAddress_country').val())
247  {
248  $.ajax(
249  {
250  url : '" . $url . "?id=' + $('#Contact_account_id').val(),
251  type : 'GET',
252  dataType: 'json',
253  success : function(data)
254  {
255  " . $successScript . "
256  },
257  error : function()
258  {
259  //todo: error call
260  }
261  }
262  );
263  }
264  }
265  );
266  ");
267  // End Not Coding Standard
268  }
269 
270  protected function registerCopyOfficePhoneAndFaxFromAccountScript()
271  {
272  $url = Yii::app()->createUrl('contacts/default/getAccountOfficePhoneAndFaxToCopy');
273  // Begin Not Coding Standard
274  Yii::app()->clientScript->registerScript('copyOfficePhoneAndFaxFromAccountScript', "
275  $('#Contact_account_id').live('change', function()
276  {
277  if ($('#Contact_account_id').val() &&
278  !$('#Contact_officeFax').val() &&
279  !$('#Contact_officePhone').val())
280  {
281  $.ajax(
282  {
283  url : '" . $url . "?id=' + $('#Contact_account_id').val(),
284  type : 'GET',
285  dataType: 'json',
286  success : function(data)
287  {
288  $('#Contact_officePhone').val(data.officePhone).trigger('change');
289  $('#Contact_officeFax').val(data.officeFax).trigger('change');
290  },
291  error : function()
292  {
293  //todo: error call
294  }
295  }
296  );
297  }
298  }
299  );
300  ");
301  // End Not Coding Standard
302  }
303 
304  public static function getDesignerRulesType()
305  {
306  return 'DetailsViewOnlyForUserOwnerEditAndDetailsView';
307  }
308  }
309 ?>
static getTranslationParamsForAllModules()
Definition: LabelUtil.php:75
Generated on Sun Jan 17 2021 07:10:21
Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.