Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
 All Data Structures Functions Variables Pages
EditView.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 
40  abstract class EditView extends DetailsView
41  {
47  protected $viewContainsFileUploadElement = false;
48 
53  protected $wrapContentInWrapperDiv = true;
54 
55  protected function renderOperationDescriptionContent()
56  {
57  }
58 
64  protected function renderContent()
65  {
66  $content = $this->renderTitleContent();
67  $maxCellsPresentInAnyRow = $this->resolveMaxCellsPresentInAnyRow($this->getFormLayoutMetadata());
68  if ($maxCellsPresentInAnyRow > 1)
69  {
70  $class = "wide double-column form";
71  }
72  else
73  {
74  $class = "wide form";
75  }
76  $content .= '<div class="' . $class . '">';
77  $clipWidget = new ClipWidget();
78  list($form, $formStart) = $clipWidget->renderBeginWidget(
79  'ZurmoActiveForm',
80  array_merge(
81  array('id' => static::getFormId(),
82  'htmlOptions' => $this->resolveFormHtmlOptions()),
83  $this->resolveActiveFormAjaxValidationOptions()
84  )
85  );
86  $content .= $formStart;
87  $content .= $this->renderOperationDescriptionContent();
88 
89  $content .= '<div class="attributesContainer">';
90  if ($form != null && $this->renderRightSideFormLayoutForEdit($form) == null)
91  {
92  $class = ' full-width';
93  }
94  else
95  {
96  $class = '';
97  }
98  $content .= ZurmoHtml::tag('div', array('class' => 'left-column' . $class), $this->renderFormLayout($form));
99  $content .= $this->renderRightSideContent($form);
100  $content .= '</div>';
101 
102  $content .= $this->renderAfterFormLayout($form);
103  $actionElementContent = $this->renderActionElementBar(true);
104  if ($actionElementContent != null)
105  {
106  $content .= $this->resolveAndWrapDockableViewToolbarContent($actionElementContent);
107  }
108  $formEnd = $clipWidget->renderEndWidget();
109  $content .= $formEnd;
110  $content .= $this->renderModalContainer();
111  $content .= '</div>';
112  if ($this->wrapContentInWrapperDiv)
113  {
114  return ZurmoHtml::tag('div', array('class' => 'wrapper'), $content);
115  }
116  return $content;
117  }
118 
119  protected function renderRightSideContent($form = null)
120  {
121  assert('$form == null || $form instanceof ZurmoActiveForm');
122  if ($form != null)
123  {
124  $rightSideContent = $this->renderRightSideFormLayoutForEdit($form);
125  if ($rightSideContent != null)
126  {
127  $content = ZurmoHtml::tag('div', array('class' => 'right-side-edit-view-panel'), $rightSideContent);
128  $content = ZurmoHtml::tag('div', array('class' => 'right-column'), $content);
129  return $content;
130  }
131  }
132  }
133 
134  protected function renderRightSideFormLayoutForEdit($form)
135  {
136  }
137 
138  protected function renderAfterFormLayout($form)
139  {
140  Yii::app()->clientScript->registerScriptFile(
141  Yii::app()->getAssetManager()->publish(
142  Yii::getPathOfAlias('application.core.views.assets')) . '/dropDownInteractions.js');
143  }
144 
145  protected function renderModalContainer()
146  {
147  return ZurmoHtml::tag('div', array(
148  'id' => ModelElement::MODAL_CONTAINER_PREFIX . '-' . $this->getFormId()
149  ), '');
150  }
151 
152  protected function resolveActiveFormAjaxValidationOptions()
153  {
154  return array('enableAjaxValidation' => false);
155  }
156 
157  public static function getDesignerRulesType()
158  {
159  return 'EditView';
160  }
161 
162  protected function shouldDisplayCell($detailViewOnly)
163  {
164  return !$detailViewOnly;
165  }
166 
167  protected static function getFormId()
168  {
169  return 'edit-form';
170  }
171 
172  protected function resolveFormHtmlOptions()
173  {
174  $data = array('onSubmit' => 'js:return $(this).attachLoadingOnSubmit("' . static::getFormId() . '")');
175  if ($this->viewContainsFileUploadElement)
176  {
177  $data['enctype'] = 'multipart/form-data';
178  }
179  return $data;
180  }
181  }
182 ?>
renderContent()
Definition: EditView.php:64
renderFormLayout($form=null)
resolveAndWrapDockableViewToolbarContent($content)
getFormLayoutMetadata()
resolveMaxCellsPresentInAnyRow($metadata)
renderActionElementBar($renderedInForm)
Generated on Sat Jul 11 2020 07:10:26
Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.