Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
 All Data Structures Functions Variables Pages
UserConfigurationForm.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  private $user;
46 
47  public $listPageSize;
48 
49  public $subListPageSize;
50 
51  public $dashboardListPageSize;
52 
53  public $themeColor;
54 
55  public $backgroundTexture;
56 
57  public $hideWelcomeView = false;
58 
59  public $enableDesktopNotifications = true;
60 
61  public $defaultPermissionSetting;
62 
63  public $defaultPermissionGroupSetting;
64 
65  public $visibleAndOrderedTabMenuItems;
66 
67  public $selectedVisibleAndOrderedTabMenuItems;
68 
69  public $hideFromSelecting = false;
70 
71  public $hideFromLeaderboard = false;
72 
73  const DEFAULT_PERMISSIONS_SETTING_OWNER = 1;
74  const DEFAULT_PERMISSIONS_SETTING_OWNER_AND_USERS_IN_GROUP = 2;
75  const DEFAULT_PERMISSIONS_SETTING_EVERYONE = 3;
76  const VISIBLE_AND_ORDERED_TAB_MENU_ITEMS = 'selectedVisibleAndOrderedTabMenuItems';
77 
78  public function __construct($user)
79  {
80  assert('$user instanceof User');
81  assert('is_int($user->id) && $user->id > 0');
82  $this->user = $user;
83  }
84 
85  public function getUser()
86  {
87  return $this->user;
88  }
89 
94  public function getId()
95  {
96  return $this->user->id;
97  }
98 
99  public function rules()
100  {
101  return array(
102  array('listPageSize', 'required'),
103  array('listPageSize', 'type', 'type' => 'integer'),
104  array('listPageSize', 'numerical', 'min' => 1, 'max' => ZurmoSystemConfigurationUtil::getBatchSize()),
105  array('subListPageSize', 'required'),
106  array('subListPageSize', 'type', 'type' => 'integer'),
107  array('subListPageSize', 'numerical', 'min' => 1, 'max' => ZurmoSystemConfigurationUtil::getBatchSize()),
108  array('dashboardListPageSize', 'required'),
109  array('dashboardListPageSize', 'type', 'type' => 'integer'),
110  array('dashboardListPageSize', 'numerical', 'min' => 1, 'max' => ZurmoSystemConfigurationUtil::getBatchSize()),
111  array('themeColor', 'required'),
112  array('themeColor', 'type', 'type' => 'string'),
113  array('backgroundTexture', 'type', 'type' => 'string'),
114  array('hideWelcomeView', 'boolean'),
115  array('enableDesktopNotifications', 'boolean'),
116  array('hideFromSelecting', 'boolean'),
117  array('hideFromLeaderboard', 'boolean'),
118  array('defaultPermissionSetting', 'numerical', 'min' => self::DEFAULT_PERMISSIONS_SETTING_OWNER,
119  'max' => self::DEFAULT_PERMISSIONS_SETTING_EVERYONE),
120  array('defaultPermissionGroupSetting', 'numerical', 'min' => 1),
121  array('selectedVisibleAndOrderedTabMenuItems', 'type', 'type' => 'array'),
122  );
123  }
124 
125  public function attributeLabels()
126  {
127  return array(
128  'listPageSize' => Zurmo::t('ZurmoModule', 'List page size'),
129  'subListPageSize' => Zurmo::t('ZurmoModule', 'Sublist page size'),
130  'dashboardListPageSize' => Zurmo::t('ZurmoModule', 'Dashboard portlet list page size'),
131  'themeColor' => Zurmo::t('Core', 'Theme'),
132  'backgroundTexture' => Zurmo::t('UsersModule', 'Texture'),
133  'hideWelcomeView' => Zurmo::t('UsersModule', 'Hide welcome page'),
134  'hideFromSelecting' => Zurmo::t('UsersModule', 'Hide from selecting'),
135  'hideFromLeaderboard' => Zurmo::t('UsersModule', 'Hide from leaderboard'),
136  'enableDesktopNotifications' => Zurmo::t('UsersModule', 'Enable Desktop notifications')
137  );
138  }
139 
140  public static function getAllDefaultPermissionTypes()
141  {
142  return array(
143  static::DEFAULT_PERMISSIONS_SETTING_OWNER => Zurmo::t('ZurmoModule', 'Owner'),
144  static::DEFAULT_PERMISSIONS_SETTING_OWNER_AND_USERS_IN_GROUP =>
145  Zurmo::t('ZurmoModule', 'Owner and users in'),
146  static::DEFAULT_PERMISSIONS_SETTING_EVERYONE => GroupsModule::resolveEveryoneDisplayLabel(),
147  );
148  }
149  }
150 ?>
static resolveEveryoneDisplayLabel()
static getBatchSize($returnDefaultIfMissing=true, $setDefaultIfMissing=false)
Generated on Fri Jul 10 2020 07:10:35
Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.