All Data Structures Functions Variables Pages
AccountsModule.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 
38  {
39  const RIGHT_CREATE_ACCOUNTS = 'Create Accounts';
40  const RIGHT_DELETE_ACCOUNTS = 'Delete Accounts';
41  const RIGHT_ACCESS_ACCOUNTS = 'Access Accounts Tab';
42 
43  public function getDependencies()
44  {
45  return array(
46  'configuration',
47  'zurmo',
48  );
49  }
50 
51  public function getRootModelNames()
52  {
53  return array('Account');
54  }
55 
56  public static function getTranslatedRightsLabels()
57  {
59  $labels = array();
60  $labels[self::RIGHT_CREATE_ACCOUNTS] = Zurmo::t('AccountsModule', 'Create AccountsModulePluralLabel', $params);
61  $labels[self::RIGHT_DELETE_ACCOUNTS] = Zurmo::t('AccountsModule', 'Delete AccountsModulePluralLabel', $params);
62  $labels[self::RIGHT_ACCESS_ACCOUNTS] = Zurmo::t('AccountsModule', 'Access AccountsModulePluralLabel Tab', $params);
63  return $labels;
64  }
65 
66  public static function getDefaultMetadata()
67  {
68  $metadata = array();
69  $metadata['global'] = array(
70  'designerMenuItems' => array(
71  'showFieldsLink' => true,
72  'showGeneralLink' => true,
73  'showLayoutsLink' => true,
74  'showMenusLink' => true,
75  ),
76  'globalSearchAttributeNames' => array(
77  'name',
78  'anyEmail',
79  'officePhone',
80  ),
81  'tabMenuItems' => array(
82  array(
83  'label' => "eval:Zurmo::t('AccountsModule', 'AccountsModulePluralLabel', \$translationParams)",
84  'url' => array('/accounts/default'),
85  'right' => self::RIGHT_ACCESS_ACCOUNTS,
86  'mobile' => true,
87  ),
88  ),
89  'shortcutsCreateMenuItems' => array(
90  array(
91  'label' => "eval:Zurmo::t('AccountsModule', 'AccountsModuleSingularLabel', \$translationParams)",
92  'url' => array('/accounts/default/create'),
93  'right' => self::RIGHT_CREATE_ACCOUNTS,
94  'mobile' => true,
95  ),
96  ),
97  'updateLatestActivityDateTimeWhenATaskIsCompleted' => true,
98  'updateLatestActivityDateTimeWhenANoteIsCreated' => true,
99  'updateLatestActivityDateTimeWhenAnEmailIsSentOrArchived' => true,
100  'updateLatestActivityDateTimeWhenAMeetingIsInThePast' => true,
101  );
102  return $metadata;
103  }
104 
105  public static function getPrimaryModelName()
106  {
107  return 'Account';
108  }
109 
110  public static function getAccessRight()
111  {
112  return self::RIGHT_ACCESS_ACCOUNTS;
113  }
114 
115  public static function getCreateRight()
116  {
117  return self::RIGHT_CREATE_ACCOUNTS;
118  }
119 
120  public static function getDeleteRight()
121  {
122  return self::RIGHT_DELETE_ACCOUNTS;
123  }
124 
125  public static function getDefaultDataMakerClassName()
126  {
127  return 'AccountsDefaultDataMaker';
128  }
129 
130  public static function getDemoDataMakerClassNames()
131  {
132  return array('AccountsDemoDataMaker');
133  }
134 
135  public static function getGlobalSearchFormClassName()
136  {
137  return 'AccountsSearchForm';
138  }
139 
140  public static function hasPermissions()
141  {
142  return true;
143  }
144 
145  public static function isReportable()
146  {
147  return true;
148  }
149 
150  public static function canHaveWorkflow()
151  {
152  return true;
153  }
154 
155  public static function canHaveContentTemplates()
156  {
157  return true;
158  }
159 
160  protected static function getSingularModuleLabel($language)
161  {
162  return Zurmo::t('AccountsModule', 'Account', array(), null, $language);
163  }
164 
165  protected static function getPluralModuleLabel($language)
166  {
167  return Zurmo::t('AccountsModule', 'Accounts', array(), null, $language);
168  }
169 
170  public static function shouldUpdateLatestActivityDateTimeWhenATaskIsCompleted()
171  {
172  $metadata = static::getMetadata();
173  if (isset($metadata['global']['updateLatestActivityDateTimeWhenATaskIsCompleted']))
174  {
175  return (bool) $metadata['global']['updateLatestActivityDateTimeWhenATaskIsCompleted'];
176  }
177  return false;
178  }
179 
180  public static function shouldUpdateLatestActivityDateTimeWhenANoteIsCreated()
181  {
182  $metadata = static::getMetadata();
183  if (isset($metadata['global']['updateLatestActivityDateTimeWhenANoteIsCreated']))
184  {
185  return (bool) $metadata['global']['updateLatestActivityDateTimeWhenANoteIsCreated'];
186  }
187  return false;
188  }
189 
190  public static function shouldUpdateLatestActivityDateTimeWhenAnEmailIsSentOrArchived()
191  {
192  $metadata = static::getMetadata();
193  if (isset($metadata['global']['updateLatestActivityDateTimeWhenAnEmailIsSentOrArchived']))
194  {
195  return (bool) $metadata['global']['updateLatestActivityDateTimeWhenAnEmailIsSentOrArchived'];
196  }
197  return false;
198  }
199 
200  public static function shouldUpdateLatestActivityDateTimeWhenAMeetingIsInThePast()
201  {
202  $metadata = static::getMetadata();
203  if (isset($metadata['global']['updateLatestActivityDateTimeWhenAMeetingIsInThePast']))
204  {
205  return (bool) $metadata['global']['updateLatestActivityDateTimeWhenAMeetingIsInThePast'];
206  }
207  return false;
208  }
209  }
210 ?>
static getTranslationParamsForAllModules()
Definition: LabelUtil.php:75
Generated on Tue May 26 2020 07:10:28