Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
 All Data Structures Functions Variables Pages
GeneralDataForReportWizardView.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 
41  {
45  public static function getWizardStepTitle()
46  {
47  return Zurmo::t('ReportsModule', 'Save Report');
48  }
49 
53  public static function getPreviousPageLinkId()
54  {
55  return 'generalDataPreviousLink';
56  }
57 
61  public static function getNextPageLinkId()
62  {
63  return 'generalDataSaveAndRunLink';
64  }
65 
69  protected function renderFormContent()
70  {
71  $leftSideContent = null;
72  $element = new TextElement($this->model, 'name', $this->form);
73  $element->editableTemplate = '<th>{label}<span class="required">*</span></th><td colspan="{colspan}">{content}{error}</td>';;
74  $leftSideContent = '<table class="form-fields"><colgroup><col class="col-0"><col class="col-1">' . '</colgroup><tr>' . $element->render() . '</tr>';
75  $element = new TextAreaElement($this->model, 'description', $this->form, array('rows' => 5));
76  $leftSideContent .= '<tr>' . $element->render() . '</tr>';
77  $element = new CurrencyConversionTypeStaticDropDownElement($this->model, 'currencyConversionType', $this->form);
78  $leftSideContent .= '<tr>' . $element->render() . '</tr>';
79  $element = new CurrencyCodeStaticDropDownFormElement($this->model, 'spotConversionCurrencyCode', $this->form, array('addBlank' => true));
80  $leftSideContent .= '<tr>' . $element->render() . '</tr></table>';
81  $leftSideContent = ZurmoHtml::tag('div', array('class' => 'panel'), $leftSideContent);
82  $leftSideContent = ZurmoHtml::tag('div', array('class' => 'left-column'), $leftSideContent);
83 
84  $rightSideContent = ZurmoHtml::tag('div', array('class' => 'right-side-edit-view-panel'), $this->renderRightSideFormLayout());
85  $rightSideContent = ZurmoHtml::tag('div', array('class' => 'right-column'), $rightSideContent);
86 
87  $content = '<div class="attributesContainer">';
88  $content .= $leftSideContent . $rightSideContent;
89  $content .= '</div>';
90 
91  return $content;
92  }
93 
97  protected function renderRightSideFormLayout()
98  {
99  $content = '<h3>' . Zurmo::t('ZurmoModule', 'Rights and Permissions') . '</h3><div id="owner-box">';
100  $element = new OwnerNameIdElement($this->model, 'null', $this->form);
101  $element->editableTemplate = '{label}{content}{error}';
102  $content .= $element->render().'</div>';
103  $element = new ReportExplicitReadWriteModelPermissionsElement($this->model,
104  'explicitReadWriteModelPermissions', $this->form);
105  $element->editableTemplate = '{label}{content}{error}';
106  $content .= $element->render();
107  return $content;
108  }
109 
113  protected function renderNextPageLinkContent()
114  {
115  $params = array();
116  $params['label'] = Zurmo::t('ReportsModule', 'Save and Run');
117  $params['htmlOptions'] = array('id' => static::getNextPageLinkId(), 'onclick' => 'js:$(this).addClass("attachLoadingTarget");');
118  $element = new SaveButtonActionElement(null, null, null, $params);
119  return $element->render();
120  }
121 
122  protected function registerScripts()
123  {
124  $currencyConversionTypeSelectId = CurrencyConversionTypeStaticDropDownElement::
125  resolveInputIdPrefixIntoString(
126  array(get_class($this->model), 'currencyConversionType'));
127  $spotConversionCurrencyCodeSelectId = CurrencyStaticDropDownFormElement::
128  resolveInputIdPrefixIntoString(
129  array(get_class($this->model), 'spotConversionCurrencyCode'));
130  Yii::app()->clientScript->registerScript('currencyConversionTypeHelper', "
131  if ($('#" . $currencyConversionTypeSelectId . "').val() != " . Report::CURRENCY_CONVERSION_TYPE_SPOT . ")
132  {
133  $('#" . $spotConversionCurrencyCodeSelectId . "').parentsUntil('tr').parent().hide();
134  }
135  $('#" . $currencyConversionTypeSelectId . "').change( function()
136  {
137  if ($(this).val() == " . Report::CURRENCY_CONVERSION_TYPE_SPOT . ")
138  {
139  $('#" . $spotConversionCurrencyCodeSelectId . "').parentsUntil('tr').parent().show();
140  }
141  else
142  {
143  $('#" . $spotConversionCurrencyCodeSelectId . "').val('');
144  $('#" . $spotConversionCurrencyCodeSelectId . "').parentsUntil('tr').parent().hide();
145  }
146  }
147  );
148  ");
149  }
150  }
151 ?>
const CURRENCY_CONVERSION_TYPE_SPOT
Definition: Report.php:82
Generated on Wed Dec 2 2020 07:10:31
Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.