All Data Structures Functions Variables Pages
TasksModule.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_TASKS = 'Create Tasks';
40 
41  const RIGHT_DELETE_TASKS = 'Delete Tasks';
42 
43  const RIGHT_ACCESS_TASKS = 'Access Tasks';
44 
48  public function getDependencies()
49  {
50  return array(
51  'activities'
52  );
53  }
54 
58  public function getRootModelNames()
59  {
60  return array('Task');
61  }
62 
66  public static function getTranslatedRightsLabels()
67  {
69  $labels = array();
70  $labels[self::RIGHT_CREATE_TASKS] = Zurmo::t('TasksModule', 'Create TasksModulePluralLabel', $params);
71  $labels[self::RIGHT_DELETE_TASKS] = Zurmo::t('TasksModule', 'Delete TasksModulePluralLabel', $params);
72  $labels[self::RIGHT_ACCESS_TASKS] = Zurmo::t('TasksModule', 'Access TasksModulePluralLabel', $params);
73  return $labels;
74  }
75 
79  public static function getDefaultMetadata()
80  {
81  $metadata = array();
82  $metadata['global'] = array(
83  'designerMenuItems' => array(
84  'showFieldsLink' => true,
85  'showGeneralLink' => true,
86  'showLayoutsLink' => true,
87  'showMenusLink' => false,
88  ),
89  'shortcutsCreateMenuItems' => array(
90  array(
91  'label' => "eval:Zurmo::t('TasksModule', 'TasksModuleSingularLabel', \$translationParams)",
92  'url' => Yii::app()->createUrl('tasks/default/modalCreate',
93  array('modalId' => TasksUtil::getModalContainerId())),
94  'ajaxLinkOptions' => "TasksUtil::resolveAjaxOptionsForCreateMenuItem()",
95  'right' => self::RIGHT_CREATE_TASKS,
96  'mobile' => true,
97  ),
98  ),
99  'globalSearchAttributeNames' => array(
100  'uniqueIdentifier',
101  'name',
102  ),
103  );
104  return $metadata;
105  }
106 
110  public static function getPrimaryModelName()
111  {
112  return 'Task';
113  }
114 
118  public static function getAccessRight()
119  {
120  return self::RIGHT_ACCESS_TASKS;
121  }
122 
126  public static function getCreateRight()
127  {
128  return self::RIGHT_CREATE_TASKS;
129  }
130 
134  public static function getDeleteRight()
135  {
136  return self::RIGHT_DELETE_TASKS;
137  }
138 
142  public static function getDemoDataMakerClassNames()
143  {
144  return array('TasksDemoDataMaker');
145  }
146 
150  public static function hasPermissions()
151  {
152  return true;
153  }
154 
160  public static function getGlobalSearchFormClassName()
161  {
162  return 'TasksSearchForm';
163  }
164 
168  public static function modelsAreNeverGloballySearched()
169  {
170  return true;
171  }
172 
176  public static function isReportable()
177  {
178  return true;
179  }
180 
184  public static function canHaveWorkflow()
185  {
186  return true;
187  }
188 
192  public static function canHaveContentTemplates()
193  {
194  return true;
195  }
196 
200  protected static function getSingularModuleLabel($language)
201  {
202  return Zurmo::t('TasksModule', 'Task', array(), null, $language);
203  }
204 
208  protected static function getPluralModuleLabel($language)
209  {
210  return Zurmo::t('TasksModule', 'Tasks', array(), null, $language);
211  }
212 
213  public static function canShowOnCalendar()
214  {
215  return true;
216  }
217  }
218 ?>
static getCreateRight()
static getDemoDataMakerClassNames()
static getDefaultMetadata()
Definition: TasksModule.php:79
static getTranslationParamsForAllModules()
Definition: LabelUtil.php:75
static isReportable()
static getModalContainerId()
Definition: TasksUtil.php:127
static getSingularModuleLabel($language)
static getGlobalSearchFormClassName()
static getDeleteRight()
static modelsAreNeverGloballySearched()
static hasPermissions()
static getAccessRight()
static canHaveWorkflow()
static getPrimaryModelName()
static getPluralModuleLabel($language)
static getTranslatedRightsLabels()
Definition: TasksModule.php:66
static canHaveContentTemplates()
Generated on Mon May 25 2020 07:10:34