Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
 All Data Structures Functions Variables Pages
ContactInlineCreateForArchivedEmailCreateView.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 
42  {
43  protected $uniqueId;
44 
45  public function __construct($controllerId, $moduleId, $emailMessageId, $model, $uniqueId, $saveActionId, $urlParameters)
46  {
47  assert('is_string($uniqueId) || is_int($uniqueId)');
48  assert('$model instanceof Contact');
49  parent::__construct($model, $controllerId, $moduleId, $saveActionId, $urlParameters, null);
50  $this->uniqueId = $uniqueId;
51  }
52 
53  public static function getDefaultMetadata()
54  {
55  $metadata = array(
56  'global' => array(
57  'toolbar' => array(
58  'elements' => array(
59  array('type' => 'CancelLinkForEmailsMatchingList', 'htmlOptions' => array (
60  'id' => 'eval:"createContactCancel" . $this->uniqueId',
61  'name' => 'eval:"createContactCancel" . $this->uniqueId',
62  'class' => 'eval:"createContactCancel"')),
63  array('type' => 'SaveButton', 'htmlOptions' => array (
64  'id' => 'eval:"save-contact-" . $this->uniqueId',
65  'name' => 'eval:"save-contact-" . $this->uniqueId')),
66  ),
67  ),
68  'derivedAttributeTypes' => array(
69  'TitleFullName',
70  'ContactStateDropDown',
71  ),
72  'nonPlaceableAttributeNames' => array(
73  'title',
74  'firstName',
75  'lastName',
76  'owner',
77  'state',
78  ),
79  'panelsDisplayType' => FormLayout::PANELS_DISPLAY_TYPE_ALL,
80  'panels' => array(
81  array(
82  'rows' => array(
83  array('cells' =>
84  array(
85  array(
86  'elements' => array(
87  array('attributeName' => 'null', 'type' => 'TitleFullName'),
88  ),
89  ),
90  )
91  ),
92  array('cells' =>
93  array(
94  array(
95  'elements' => array(
96  array('attributeName' => 'null', 'type' => 'ContactStateDropDown'),
97  ),
98  ),
99  )
100  ),
101  array('cells' =>
102  array(
103  array(
104  'elements' => array(
105  array('attributeName' => 'account', 'type' => 'AccountSelectOrCreate'),
106  ),
107  ),
108  )
109  ),
110  array('cells' =>
111  array(
112  array(
113  'elements' => array(
114  array('attributeName' => 'officePhone', 'type' => 'Phone'),
115  ),
116  ),
117  )
118  ),
119  array('cells' =>
120  array(
121  array(
122  'elements' => array(
123  array('attributeName' => 'primaryEmail', 'type' => 'EmailAddressInformation'),
124  ),
125  ),
126  )
127  ),
128  ),
129  ),
130  ),
131  ),
132  );
133  return $metadata;
134  }
135 
141  protected function renderConfigSaveAjax($formName)
142  {
143  // Begin Not Coding Standard
144  return ZurmoHtml::ajax(array(
145  'type' => 'POST',
146  'data' => 'js:$("#' . $formName . '").serialize()',
147  'url' => $this->getValidateAndSaveUrl(),
148  'update' => '#' . $this->uniquePageId,
149  'complete' => "function(XMLHttpRequest, textStatus){
150  $('#wrapper-" . $this->uniqueId . "').parent().parent().parent().remove();
151  $('#" . self::getNotificationBarId() . "').jnotifyAddMessage(
152  {
153  text: '" . Zurmo::t('ContactsModule', 'Created ContactsModuleSingularLabel successfully', LabelUtil::getTranslationParamsForAllModules()) . "',
154  permanent: false,
155  showIcon: true,
156  });
157  if ($('.email-archive-item').length==0)
158  {
159  window.location.reload();
160  }
161  }",
162 
163  ));
164  // End Not Coding Standard
165  }
166 
167  public function renderAfterFormLayout($form)
168  {
169  $this->renderScriptsContent();
170  }
171 
172  protected function renderScriptsContent()
173  {
174  return Yii::app()->clientScript->registerScript('contactInlineCreateCollapseActions', "
175  $('.createContactCancel').each(function()
176  {
177  $('.createContactCancel').live('click', function()
178  {
179  $(this).parentsUntil('.email-archive-item').find('.ContactInlineCreateForArchivedEmailCreateView').hide();
180  $(this).closest('.email-archive-item').closest('td').removeClass('active-panel')
181  .find('.z-action-link-active').removeClass('z-action-link-active');
182  });
183  });");
184  }
185 
186  protected function doesLabelHaveOwnCell()
187  {
188  return false;
189  }
190 
191  public function getFormName()
192  {
193  return "contact-inline-create-form-" . $this->uniqueId;
194  }
195 
196  public function isUniqueToAPage()
197  {
198  return false;
199  }
200 
206  protected function getViewStyle()
207  {
208  return " style='display:none;'";
209  }
210 
217  protected function resolveElementInformationDuringFormLayoutRender(& $elementInformation)
218  {
219  $elementInformation['inputPrefix'] = array(get_class($this->model), $this->uniqueId);
220  if ($elementInformation['attributeName'] == 'account')
221  {
222  $elementInformation['type'] = 'AccountSelectOrCreate';
223  }
224  }
225 
226  public static function getDisplayDescription()
227  {
228  return Zurmo::t('EmailMessagesModule', 'Matching Archived Emails');
229  }
230 
231  protected static function getNotificationBarId()
232  {
233  return 'FlashMessageBar';
234  }
235  }
236 ?>
static getTranslationParamsForAllModules()
Definition: LabelUtil.php:75
Generated on Fri Dec 4 2020 07:10:27
Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.