Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
 All Data Structures Functions Variables Pages
MatrixReportWizardView.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 function getTitle()
46  {
47  return parent::getTitle() . ' - ' . Zurmo::t('ReportsModule', 'Matrix');
48  }
49 
54  protected function renderContainingViews(WizardActiveForm $form)
55  {
56  $moduleForReportWizardView = new ModuleForReportWizardView ($this->model, $form);
57  $filtersForReportWizardView = new FiltersForReportWizardView($this->model, $form, true);
58  $groupBysForReportWizardView = new GroupBysForReportWizardView($this->model, $form, true);
59  $displayAttributesForReportWizardView = new DisplayAttributesForReportWizardView($this->model, $form, true);
60  $generalDataForReportWizardView = new GeneralDataForReportWizardView($this->model, $form, true);
61 
62  $gridView = new GridView(5, 1);
63  $gridView->setView($moduleForReportWizardView, 0, 0);
64  $gridView->setView($filtersForReportWizardView, 1, 0);
65  $gridView->setView($groupBysForReportWizardView, 2, 0);
66  $gridView->setView($displayAttributesForReportWizardView, 3, 0);
67  $gridView->setView($generalDataForReportWizardView, 4, 0);
68  return $gridView->render();
69  }
70 
75  protected function renderConfigSaveAjax($formName)
76  {
77  assert('is_string($formName)');
78  return "linkId = $('#" . $formName . "').find('.attachLoadingTarget').attr('id');
79  if (linkId == '" . ModuleForReportWizardView::getNextPageLinkId() . "')
80  {
81  $('#" . static::getValidationScenarioInputId() . "').val('" .
82  ReportWizardForm::FILTERS_VALIDATION_SCENARIO . "');
83  $('#ModuleForReportWizardView').hide();
84  " . static::renderTreeViewAjaxScriptContent($formName, 'FiltersForReportWizardView', $this->model->type) . "
85  $('#FiltersForReportWizardView').show();
86  $('.StepsAndProgressBarForWizardView').find('.progress-bar').width('40%');
87  $('.StepsAndProgressBarForWizardView').find('.current-step').removeClass('current-step').next().addClass('current-step');
88  }
89  if (linkId == '" . FiltersForReportWizardView::getNextPageLinkId() . "')
90  {
91  $('#" . static::getValidationScenarioInputId() . "').val('" .
92  ReportWizardForm::GROUP_BYS_VALIDATION_SCENARIO . "');
93  $('#FiltersForReportWizardView').hide();
94  " . static::renderTreeViewAjaxScriptContent($formName, 'GroupBysForReportWizardView', $this->model->type) . "
95  $('#GroupBysForReportWizardView').show();
96  $('.StepsAndProgressBarForWizardView').find('.progress-bar').width('60%');
97  $('.StepsAndProgressBarForWizardView').find('.current-step').removeClass('current-step').next().addClass('current-step');
98  }
99  if (linkId == '" . GroupBysForReportWizardView::getNextPageLinkId() . "')
100  {
101  $('#" . static::getValidationScenarioInputId() . "').val('" .
102  ReportWizardForm::DISPLAY_ATTRIBUTES_VALIDATION_SCENARIO . "');
103  $('#GroupBysForReportWizardView').hide();
104  " . static::renderTreeViewAjaxScriptContent($formName, 'DisplayAttributesForReportWizardView', $this->model->type) . "
105  $('#DisplayAttributesForReportWizardView').show();
106  $('.StepsAndProgressBarForWizardView').find('.progress-bar').width('80%');
107  $('.StepsAndProgressBarForWizardView').find('.current-step').removeClass('current-step').next().addClass('current-step');
108  }
110  {
111  $('#" . static::getValidationScenarioInputId() . "').val('" .
112  ReportWizardForm::GENERAL_DATA_VALIDATION_SCENARIO . "');
113  $('#DisplayAttributesForReportWizardView').hide();
114  $('#GeneralDataForReportWizardView').show();
115  $('.StepsAndProgressBarForWizardView').find('.progress-bar').width('100%');
116  $('.StepsAndProgressBarForWizardView').find('.current-step').removeClass('current-step').next().addClass('current-step');
117  }
118  if (linkId == '" . GeneralDataForReportWizardView::getNextPageLinkId() . "')
119  {
120  " . $this->getSaveAjaxString($formName) . "
121  }
122  else
123  {
124  $('#" . $formName . "').find('.attachLoadingTarget').removeClass('loading');
125  $('#" . $formName . "').find('.attachLoadingTarget').removeClass('loading-ajax-submit');
126  $('#" . $formName . "').find('.attachLoadingTarget').removeClass('attachLoadingTarget');
127  }
128  ";
129  }
130 
131  protected function registerClickFlowScript()
132  {
133  Yii::app()->clientScript->registerScript('clickflow', "
134  $('#" . ModuleForReportWizardView::getPreviousPageLinkId() . "').unbind('click');
135  $('#" . ModuleForReportWizardView::getPreviousPageLinkId() . "').bind('click', function()
136  {
137  url = document.referrer;
138  window.location.href = url;
139  return false;
140  }
141  );
142  $('#" . FiltersForReportWizardView::getPreviousPageLinkId() . "').unbind('click');
143  $('#" . FiltersForReportWizardView::getPreviousPageLinkId() . "').bind('click', function()
144  {
145  $('#" . static::getValidationScenarioInputId() . "').val('" . ReportWizardForm::MODULE_VALIDATION_SCENARIO . "');
146  $('#" . WizardActiveForm::makeErrorsSummaryId(static::getFormId()) . "').hide();
147  $('#ModuleForReportWizardView').show();
148  $('#FiltersForReportWizardView').hide();
149  $('.StepsAndProgressBarForWizardView').find('.progress-bar').width('20%');
150  $('.StepsAndProgressBarForWizardView').find('.current-step').removeClass('current-step').prev().addClass('current-step');
151  return false;
152  }
153  );
154  $('#" . GroupBysForReportWizardView::getPreviousPageLinkId() . "').unbind('click');
155  $('#" . GroupBysForReportWizardView::getPreviousPageLinkId() . "').bind('click', function()
156  {
157  $('#" . static::getValidationScenarioInputId() . "').val('" . ReportWizardForm::FILTERS_VALIDATION_SCENARIO . "');
158  $('#FiltersForReportWizardView').show();
159  $('#GroupBysForReportWizardView').hide();
160  $('.StepsAndProgressBarForWizardView').find('.progress-bar').width('40%');
161  $('.StepsAndProgressBarForWizardView').find('.current-step').removeClass('current-step').prev().addClass('current-step');
162  return false;
163  }
164  );
165  $('#" . DisplayAttributesForReportWizardView::getPreviousPageLinkId() . "').unbind('click');
166  $('#" . DisplayAttributesForReportWizardView::getPreviousPageLinkId() . "').bind('click', function()
167  {
168  $('#" . static::getValidationScenarioInputId() . "').val('" . ReportWizardForm::GROUP_BYS_VALIDATION_SCENARIO . "');
169  $('#GroupBysForReportWizardView').show();
170  $('#DisplayAttributesForReportWizardView').hide();
171  $('.StepsAndProgressBarForWizardView').find('.progress-bar').width('60%');
172  $('.StepsAndProgressBarForWizardView').find('.current-step').removeClass('current-step').prev().addClass('current-step');
173  return false;
174  }
175  );
176  $('#" . GeneralDataForReportWizardView::getPreviousPageLinkId() . "').unbind('click');
177  $('#" . GeneralDataForReportWizardView::getPreviousPageLinkId() . "').bind('click', function()
178  {
179  $('#" . static::getValidationScenarioInputId() . "').val('" . ReportWizardForm::DISPLAY_ATTRIBUTES_VALIDATION_SCENARIO . "');
180  $('#DisplayAttributesForReportWizardView').show();
181  $('#GeneralDataForReportWizardView').hide();
182  $('.StepsAndProgressBarForWizardView').find('.progress-bar').width('80%');
183  $('.StepsAndProgressBarForWizardView').find('.current-step').removeClass('current-step').prev().addClass('current-step');
184  return false;
185  }
186  );
187  ");
188  }
189 
190  protected function registerModuleClassNameChangeScriptExtraPart()
191  {
192  return " $('#GroupBysForReportWizardView').find('.dynamic-rows').find('ul:first').find('li').remove();
193  $('#GroupBysTreeArea').html('');
195  ";
196  }
197  }
198 ?>
renderContainingViews(WizardActiveForm $form)
getSaveAjaxString($formName, $redirectAfterSave=true, array $additionalAjaxOptions=array())
Definition: WizardView.php:281
Generated on Sat Jul 11 2020 07:10:34
Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.