Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
 All Data Structures Functions Variables Pages
CalendarView.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 CalendarView extends ModelView implements PortletViewInterface
41  {
42  protected $controllerId;
43 
44  protected $moduleId;
45 
46  protected $params;
47 
48  protected $viewData;
49 
50  protected $uniqueLayoutId;
51 
52  protected $dataProvider;
53 
60  protected $renderViewToolBarDuringRenderContent = false;
61 
62  public function __construct($viewData, $params, $uniqueLayoutId)
63  {
64  assert('isset($params["controllerId"])');
65  $this->modelClassName = $this->getModelClassName();
66  $this->viewData = $viewData;
67  $this->params = $params;
68  $this->uniqueLayoutId = $uniqueLayoutId;
69  $this->controllerId = $this->resolveControllerId();
70  $this->moduleId = $this->resolveModuleId();
71  }
72 
73  public function getPortletParams()
74  {
75  return array();
76  }
77 
82  protected function renderContent()
83  {
84  $content = null;
85  if ($this->renderViewToolBarDuringRenderContent)
86  {
87  $content .= $this->renderViewToolBar();
88  }
89  $cClipWidget = new CClipWidget();
90  $cClipWidget->beginClip("Calendar");
91  $cClipWidget->widget('application.core.widgets.Calendar', array(
93  'htmlOptions' => array(
94  'id' => 'calendar' . $this->uniqueLayoutId,
95  'name' => 'calendar' . $this->uniqueLayoutId,
96  ),
97  'options' => array(
99  DateTimeUtil::getLocaleDateFormat()),
100  'onChangeMonthYear' => $this->getOnChangeMonthScript(),
101  'onSelect' => $this->getOnSelectScript(),
102  'altFormat' => 'yy-mm-dd',
103  'altField' => '#calendarSelectedDate' . $this->uniqueLayoutId
104  ),
105  'dayEvents' => $this->makeDayEvents(),
106 
107  ));
108  $cClipWidget->endClip();
109  $content .= $cClipWidget->getController()->clips['Calendar'];
110  $content .= ZurmoHtml::textField('calendarSelectedDate' . $this->uniqueLayoutId,
111  null,
112  array('id' => 'calendarSelectedDate' . $this->uniqueLayoutId,
113  'style' => 'display:none;'));
114  return $content;
115  }
116 
117  protected function getOnChangeMonthScript()
118  {
119  }
120 
121  protected function getOnSelectScript()
122  {
123  }
124 
125  protected function makeDayEvents()
126  {
127  return array();
128  }
129 
130  public function isUniqueToAPage()
131  {
132  return true;
133  }
134 
135  public function getTitle()
136  {
137  if (!empty($this->viewData['title']))
138  {
139  return $this->viewData['title'];
140  }
141  else
142  {
143  return static::getDefaultTitle();
144  }
145  }
146 
147  public static function getDefaultTitle()
148  {
149  $metadata = self::getMetadata();
150  $title = $metadata['perUser']['title'];
152  return $title;
153  }
154 
155  public static function canUserConfigure()
156  {
157  return false;
158  }
159 
160  public static function getDesignerRulesType()
161  {
162  }
163 
169  public static function getDisplayDescription()
170  {
171  return null;
172  }
173 
177  public static function getPortletDescription()
178  {
179  }
180 
181  public function getModelClassName()
182  {
183  $moduleClassName = $this->getActionModuleClassName();
184  return $moduleClassName::getPrimaryModelName();
185  }
186 
191  public static function getPortletRulesType()
192  {
193  return 'Calendar';
194  }
195 
196  public function renderPortletHeadContent()
197  {
198  return $this->renderViewToolBar();
199  }
200 
204  private function resolveControllerId()
205  {
206  return 'default';
207  }
208 
212  private function resolveModuleId()
213  {
214  $moduleClassName = $this->getActionModuleClassName();
215  return $moduleClassName::getDirectoryName();
216  }
217 
221  protected function getActionModuleClassName()
222  {
223  $calledClass = get_called_class();
224  return $calledClass::getModuleClassName();
225  }
226 
227  protected function getDataProvider()
228  {
229  if ($this->dataProvider == null)
230  {
231  $this->dataProvider = $this->makeDataProvider();
232  }
233  return $this->dataProvider;
234  }
235 
236  protected function makeDataProvider()
237  {
238  throw new NotImplementedException();
239  }
240  }
241 ?>
static getDisplayDescription()
static resolveEvaluateSubString(&$subString, $resolveVariableName=null, $params=null, $defaultValue=null)
renderViewToolBar($renderInForm=true)
getActionModuleClassName()
static getPortletDescription()
static getPortletRulesType()
Generated on Sat Jul 4 2020 07:10:29
Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.