All Data Structures Functions Variables Pages
UpcomingMeetingsRelatedListView.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 getDefaultMetadata()
46  {
47  $metadata = parent::getDefaultMetadata();
48  $metadata = array_merge($metadata, array(
49  'perUser' => array(
50  'title' => "eval:Zurmo::t('MeetingsModule', 'Upcoming MeetingsModulePluralLabel List',
51  LabelUtil::getTranslationParamsForAllModules())",
52  ),
53  'global' => array(
54  'toolbar' => array(
55  'elements' => array(
56  array( 'type' => 'CreateFromRelatedListLink',
57  'routeModuleId' => 'eval:$this->moduleId',
58  'routeParameters' => 'eval:$this->getCreateLinkRouteParameters()'),
59  ),
60  ),
61  'nonPlaceableAttributeNames' => array(
62  'latestDateTime',
63  ),
64  'panels' => array(
65  array(
66  'rows' => array(
67  array('cells' =>
68  array(
69  array(
70  'elements' => array(
71  array('attributeName' => 'name', 'type' => 'Text', 'isLink' => true),
72  ),
73  ),
74  )
75  ),
76  array('cells' =>
77  array(
78  array(
79  'elements' => array(
80  array('attributeName' => 'startDateTime', 'type' => 'DateTime'),
81  ),
82  ),
83  )
84  ),
85  ),
86  ),
87  ),
88  ),
89  ));
90  return $metadata;
91  }
92 
96  protected function getCreateLinkRouteParameters()
97  {
98  return array(
99  'relationAttributeName' => $this->getRelationAttributeName(),
100  'relationModelId' => $this->params['relationModel']->id,
101  'relationModuleId' => $this->params['relationModuleId'],
102  'redirectUrl' => $this->params['redirectUrl'],
103  );
104  }
105 
110  protected function makeSearchAttributeData($stringTime = null)
111  {
112  assert('is_string($stringTime) || $stringTime == null');
113  $searchAttributeData = array();
114  $searchAttributeData['clauses'] = array(
115  1 => array(
116  'attributeName' => 'startDateTime',
117  'operatorType' => 'greaterThan',
118  'value' => DateTimeUtil::
119  convertDateIntoTimeZoneAdjustedDateTimeBeginningOfDay(
120  DateTimeUtil::getFirstDayOfAMonthDate($stringTime))
121  ),
122  2 => array(
123  'attributeName' => 'startDateTime',
124  'operatorType' => 'lessThan',
125  'value' => DateTimeUtil::
126  convertDateIntoTimeZoneAdjustedDateTimeEndOfDay(
127  DateTimeUtil::getLastDayOfAMonthDate($stringTime))
128  ),
129  3 => array(
130  'attributeName' => 'logged',
131  'operatorType' => 'doesNotEqual',
132  'value' => true
133  ),
134  4 => array(
135  'attributeName' => 'logged',
136  'operatorType' => 'isNull',
137  'value' => null
138  ),
139  5 => array(
140  'attributeName' => 'activityItems',
141  'relatedAttributeName' => 'id',
142  'operatorType' => 'equals',
143  'value' => (int)$this->params['relationModel']->getClassId('Item')
144  )
145  );
146  $searchAttributeData['structure'] = '(1 and 2 and (3 or 4) and 5)';
147  return $searchAttributeData;
148  }
149 
150  protected function getSortAttributeForDataProvider()
151  {
152  return 'startDateTime';
153  }
154 
155  protected function resolveSortDescendingForDataProvider()
156  {
157  return true;
158  }
159 
163  public static function getModuleClassName()
164  {
165  return 'MeetingsModule';
166  }
167  }
168 ?>
Generated on Wed Apr 8 2020 07:10:42