Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
 All Data Structures Functions Variables Pages
ImportWizardCreateUpdateModelsCompleteView.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 
43  {
47  protected $dataProvider;
48 
52  protected $mappingData;
53 
57  protected $modelsCreated = 0;
58 
62  protected $modelsUpdated = 0;
63 
67  protected $rowsWithErrors = 0;
68 
79  public function __construct($controllerId, $moduleId, ImportWizardForm $model, ImportDataProvider $dataProvider,
80  array $mappingData, $modelsCreated = 0, $modelsUpdated = 0, $rowsWithErrors = 0)
81  {
82  assert('is_int($modelsCreated)');
83  assert('is_int($modelsUpdated)');
84  assert('is_int($rowsWithErrors)');
85  parent::__construct($controllerId, $moduleId, $model);
86  $this->dataProvider = $dataProvider;
87  $this->mappingData = $mappingData;
88  $this->modelsCreated = $modelsCreated;
89  $this->modelsUpdated = $modelsUpdated;
90  $this->rowsWithErrors = $rowsWithErrors;
91  }
92 
99  protected function renderFormLayout($form = null)
100  {
101  assert('$form instanceof ZurmoActiveForm');
102  $content = Zurmo::t('ImportModule', 'Congratulations! Your import is complete. Below is a summary of the results.');
103  $content = ZurmoHtml::tag('h3', array(), $content);
104  $content .= $this->renderStatusGroupsContent();
105  return $content;
106  }
107 
108  protected function renderStatusGroupsContent()
109  {
110  $content = null;
111  $content .= '<ul class="import-summary">';
112 
113  $label = Zurmo::t('Core', 'Created');
114  $count = ZurmoHtml::tag('strong', array(), $this->modelsCreated);
115  $led = ZurmoHtml::tag('i', array('class' => 'led state-true'), '');
116  $content .= ZurmoHtml::tag('li', array(), $count . $label . $led );
117 
118  $label = Zurmo::t('ImportModule', 'Updated');
119  $count = ZurmoHtml::tag('strong', array(), $this->modelsUpdated);
120  $led = ZurmoHtml::tag('i', array('class' => 'led'), '');
121  $content .= ZurmoHtml::tag('li', array(), $count . $label . $led );
122 
123  $label = Zurmo::t('Core', 'Skipped');
124  $count = ZurmoHtml::tag('strong', array(), $this->rowsWithErrors);
125  $led = ZurmoHtml::tag('i', array('class' => 'led state-false'), '');
126  $content .= ZurmoHtml::tag('li', array(), $count . $label . $led );
127 
128  $content .= '</ul>';
129  return $content;
130  }
131 
132  protected function renderAfterFormLayout($form)
133  {
134  $view = new ImportResultsImportTempTableListView($this->controllerId, $this->moduleId, $this->dataProvider,
135  $this->mappingData, $this->model->importRulesType, $this->resolveConfigurationForm(), $form, $this->model->id);
136  return $view->render();
137  }
138 
139  protected function resolveConfigurationForm()
140  {
141  $configurationForm = new ImportResultsConfigurationForm();
142  $this->resolveConfigFormFromRequest($configurationForm);
143  return $configurationForm;
144  }
145 
146  protected function resolveConfigFormFromRequest(& $configurationForm)
147  {
148  $excludeFromRestore = array();
149  if (isset($_GET[get_class($configurationForm)]))
150  {
151  $configurationForm->setAttributes($_GET[get_class($configurationForm)]);
152  }
153  }
154 
158  protected function renderNextPageLinkContent()
159  {
160  return null;
161  }
162 
163  protected function renderTitleContent()
164  {
165  return null;
166  }
167  }
168 ?>
__construct($controllerId, $moduleId, ImportWizardForm $model, ImportDataProvider $dataProvider, array $mappingData, $modelsCreated=0, $modelsUpdated=0, $rowsWithErrors=0)
render()
Definition: View.php:83
Generated on Fri Jul 10 2020 07:10:33
Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.