Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
 All Data Structures Functions Variables Pages
MassActionView.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 MassActionView extends EditView
41  {
47  protected $activeAttributes;
48 
49  protected $alertMessage;
50 
51  protected $selectedRecordCount;
52 
53  protected $title;
54 
55  protected $moduleClassName;
56 
57  abstract protected function renderAlertMessage();
58 
59  abstract protected function renderPreActionElementBar($form);
60 
61  abstract protected function renderItemLabel();
62 
63  abstract protected function renderItemOperationType();
64 
65  abstract protected function renderOperationHighlight();
66 
71  public function __construct($controllerId, $moduleId, RedBeanModel $model, $activeAttributes, $selectedRecordCount, $title, $alertMessage = null, $moduleClassName = null)
72  {
73  assert('is_array($activeAttributes)');
74  assert('is_string($title)');
75 
76  $this->controllerId = $controllerId;
77  $this->moduleId = $moduleId;
78  $this->model = $model;
79  $this->modelClassName = get_class($model);
80  $this->modelId = $model->id;
81  $this->activeAttributes = $activeAttributes;
82  $this->selectedRecordCount = $selectedRecordCount;
83  $this->title = $title;
84  $this->alertMessage = $alertMessage;
85  $this->moduleClassName = $moduleClassName;
86  }
87 
88  protected function renderContent()
89  {
90  $content = '<div class="wrapper">';
91  $content .= $this->renderTitleContent();
92  $content .= '<div class="wide form">';
93  $content .= '<div class="left-column full-width">';
94  $clipWidget = new ClipWidget();
95  list($form, $formStart) = $clipWidget->renderBeginWidget(
96  'ZurmoActiveForm',
97  array('id' => static::getFormId(), 'enableAjaxValidation' => false)
98  );
99  $content .= $formStart;
100  $content .= $this->renderAlertMessage();
101  $content .= $this->renderOperationDescriptionContent();
102  $content .= $this->renderPreActionElementBar($form);
103  $actionElementContent = $this->renderActionElementBar(true);
104  if ($actionElementContent != null)
105  {
106  $content .= '<div class="view-toolbar-container clearfix"><div class="form-toolbar">';
107  $content .= $actionElementContent;
108  $content .= '</div></div>';
109  }
110  $formEnd = $clipWidget->renderEndWidget();
111  $content .= $formEnd;
112  $content .= $this->renderModalContainer();
113  $content .= '</div></div></div>';
114  return $content;
115  }
116 
117  protected function renderItemCount()
118  {
119  return ZurmoHtml::tag('strong', array(), $this->selectedRecordCount) . '&#160;';
120  }
121 
122  protected function renderItemOperationMessage()
123  {
124  $message = 'selected for ' . $this->renderItemOperationType() . '. ';
125  $message .= $this->getOperationAdditionalMessage();
126  $category = $this->renderItemOperationMessageCategory();
127  return Zurmo::t($category, $message);
128  }
129 
130  protected function renderItemOperationMessageCategory()
131  {
132  return 'Core';
133  }
134 
135  protected function renderOperationMessage()
136  {
137  $message = $this->renderItemCount() .
138  $this->renderItemLabel() .
139  ' ' .
140  $this->renderItemOperationMessage();
141  return $message;
142  }
143 
144  protected function renderOperationDescriptionContent()
145  {
146  $highlight = $this->renderOperationHighlight();
147  $message = $this->renderOperationMessage();
148  $description = $highlight . $message;
149  return ZurmoHtml::wrapLabel($description, 'operation-description');
150  }
151 
152  protected function getSelectedRecordCount()
153  {
154  return $this->selectedRecordCount;
155  }
156 
157  protected function getOperationAdditionalMessage()
158  {
159  return null;
160  }
161  }
162 ?>
static wrapLabel($label, $class= 'z-label')
Definition: ZurmoHtml.php:656
__construct($controllerId, $moduleId, RedBeanModel $model, $activeAttributes, $selectedRecordCount, $title, $alertMessage=null, $moduleClassName=null)
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.