@@ -42,34 +42,34 @@ discard block |
||
42 | 42 | |
43 | 43 | |
44 | 44 | $dictionary['ACLAction'] = array('table' => 'acl_actions', 'comment' => 'Determine the allowable actions available to users' |
45 | - ,'fields' => array ( |
|
46 | - 'id' => |
|
47 | - array ( |
|
45 | + ,'fields' => array ( |
|
46 | + 'id' => |
|
47 | + array ( |
|
48 | 48 | 'name' => 'id', |
49 | 49 | 'vname' => 'LBL_ID', |
50 | 50 | 'required'=>true, |
51 | 51 | 'type' => 'id', |
52 | 52 | 'reportable'=>false, |
53 | 53 | 'comment' => 'Unique identifier' |
54 | - ), |
|
55 | - 'date_entered' => |
|
56 | - array ( |
|
54 | + ), |
|
55 | + 'date_entered' => |
|
56 | + array ( |
|
57 | 57 | 'name' => 'date_entered', |
58 | 58 | 'vname' => 'LBL_DATE_ENTERED', |
59 | 59 | 'type' => 'datetime', |
60 | 60 | 'required'=>true, |
61 | 61 | 'comment' => 'Date record created' |
62 | - ), |
|
63 | - 'date_modified' => |
|
64 | - array ( |
|
62 | + ), |
|
63 | + 'date_modified' => |
|
64 | + array ( |
|
65 | 65 | 'name' => 'date_modified', |
66 | 66 | 'vname' => 'LBL_DATE_MODIFIED', |
67 | 67 | 'type' => 'datetime', |
68 | 68 | 'required'=>true, |
69 | 69 | 'comment' => 'Date record last modified' |
70 | - ), |
|
70 | + ), |
|
71 | 71 | 'modified_user_id' => |
72 | - array ( |
|
72 | + array ( |
|
73 | 73 | 'name' => 'modified_user_id', |
74 | 74 | 'rname' => 'user_name', |
75 | 75 | 'id_name' => 'modified_user_id', |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | 'len' => 36, |
83 | 83 | 'reportable'=>true, |
84 | 84 | 'comment' => 'User who last modified record' |
85 | - ), |
|
85 | + ), |
|
86 | 86 | 'created_by' => |
87 | - array ( |
|
87 | + array ( |
|
88 | 88 | 'name' => 'created_by', |
89 | 89 | 'rname' => 'user_name', |
90 | 90 | 'id_name' => 'created_by', |
@@ -95,63 +95,63 @@ discard block |
||
95 | 95 | 'dbType' => 'id', |
96 | 96 | 'len' => 36, |
97 | 97 | 'comment' => 'User ID who created record' |
98 | - ), |
|
99 | - 'name' => |
|
100 | - array ( |
|
98 | + ), |
|
99 | + 'name' => |
|
100 | + array ( |
|
101 | 101 | 'name' => 'name', |
102 | 102 | 'type' => 'varchar', |
103 | 103 | 'vname' => 'LBL_NAME', |
104 | 104 | 'len' => 150, |
105 | 105 | 'comment' => 'Name of the allowable action (view, list, delete, edit)' |
106 | - ), |
|
107 | - 'category' => |
|
108 | - array ( |
|
106 | + ), |
|
107 | + 'category' => |
|
108 | + array ( |
|
109 | 109 | 'name' => 'category', |
110 | 110 | 'vname' => 'LBL_CATEGORY', |
111 | 111 | 'type' => 'varchar', |
112 | - 'len' =>100, |
|
112 | + 'len' =>100, |
|
113 | 113 | 'reportable'=>true, |
114 | 114 | 'comment' => 'Category of the allowable action (usually the name of a module)' |
115 | - ), |
|
115 | + ), |
|
116 | 116 | 'acltype' => |
117 | - array ( |
|
117 | + array ( |
|
118 | 118 | 'name' => 'acltype', |
119 | 119 | 'vname' => 'LBL_TYPE', |
120 | 120 | 'type' => 'varchar', |
121 | - 'len' =>100, |
|
121 | + 'len' =>100, |
|
122 | 122 | 'reportable'=>true, |
123 | 123 | 'comment' => 'Specifier for Category, usually "module"' |
124 | - ), |
|
125 | - 'aclaccess' => |
|
126 | - array ( |
|
124 | + ), |
|
125 | + 'aclaccess' => |
|
126 | + array ( |
|
127 | 127 | 'name' => 'aclaccess', |
128 | 128 | 'vname' => 'LBL_ACCESS', |
129 | 129 | 'type' => 'int', |
130 | 130 | 'len'=>3, |
131 | 131 | 'reportable'=>true, |
132 | 132 | 'comment' => 'Number specifying access priority; highest access "wins"' |
133 | - ), |
|
134 | - 'deleted' => |
|
135 | - array ( |
|
133 | + ), |
|
134 | + 'deleted' => |
|
135 | + array ( |
|
136 | 136 | 'name' => 'deleted', |
137 | 137 | 'vname' => 'LBL_DELETED', |
138 | 138 | 'type' => 'bool', |
139 | 139 | 'reportable'=>false, |
140 | 140 | 'comment' => 'Record deletion indicator' |
141 | - ), |
|
142 | - 'roles' => |
|
143 | - array ( |
|
144 | - 'name' => 'roles', |
|
141 | + ), |
|
142 | + 'roles' => |
|
143 | + array ( |
|
144 | + 'name' => 'roles', |
|
145 | 145 | 'type' => 'link', |
146 | 146 | 'relationship' => 'acl_roles_actions', |
147 | 147 | 'source'=>'non-db', |
148 | - 'vname'=>'LBL_USERS', |
|
149 | - ), |
|
148 | + 'vname'=>'LBL_USERS', |
|
149 | + ), |
|
150 | 150 | ), |
151 | 151 | 'indices' => array ( |
152 | - array('name' =>'aclactionid', 'type' =>'primary', 'fields'=>array('id')), |
|
153 | - array('name' =>'idx_aclaction_id_del', 'type' =>'index', 'fields'=>array('id', 'deleted')), |
|
154 | - array('name' =>'idx_category_name', 'type' =>'index', 'fields'=>array('category', 'name')), ) |
|
152 | + array('name' =>'aclactionid', 'type' =>'primary', 'fields'=>array('id')), |
|
153 | + array('name' =>'idx_aclaction_id_del', 'type' =>'index', 'fields'=>array('id', 'deleted')), |
|
154 | + array('name' =>'idx_category_name', 'type' =>'index', 'fields'=>array('category', 'name')), ) |
|
155 | 155 | |
156 | 156 | ); |
157 | 157 | ?> |
158 | 158 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | |
43 | 43 | |
44 | 44 | $dictionary['ACLAction'] = array('table' => 'acl_actions', 'comment' => 'Determine the allowable actions available to users' |
45 | - ,'fields' => array ( |
|
45 | + ,'fields' => array( |
|
46 | 46 | 'id' => |
47 | - array ( |
|
47 | + array( |
|
48 | 48 | 'name' => 'id', |
49 | 49 | 'vname' => 'LBL_ID', |
50 | 50 | 'required'=>true, |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | 'comment' => 'Unique identifier' |
54 | 54 | ), |
55 | 55 | 'date_entered' => |
56 | - array ( |
|
56 | + array( |
|
57 | 57 | 'name' => 'date_entered', |
58 | 58 | 'vname' => 'LBL_DATE_ENTERED', |
59 | 59 | 'type' => 'datetime', |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | 'comment' => 'Date record created' |
62 | 62 | ), |
63 | 63 | 'date_modified' => |
64 | - array ( |
|
64 | + array( |
|
65 | 65 | 'name' => 'date_modified', |
66 | 66 | 'vname' => 'LBL_DATE_MODIFIED', |
67 | 67 | 'type' => 'datetime', |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | 'comment' => 'Date record last modified' |
70 | 70 | ), |
71 | 71 | 'modified_user_id' => |
72 | - array ( |
|
72 | + array( |
|
73 | 73 | 'name' => 'modified_user_id', |
74 | 74 | 'rname' => 'user_name', |
75 | 75 | 'id_name' => 'modified_user_id', |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | 'comment' => 'User who last modified record' |
85 | 85 | ), |
86 | 86 | 'created_by' => |
87 | - array ( |
|
87 | + array( |
|
88 | 88 | 'name' => 'created_by', |
89 | 89 | 'rname' => 'user_name', |
90 | 90 | 'id_name' => 'created_by', |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | 'comment' => 'User ID who created record' |
98 | 98 | ), |
99 | 99 | 'name' => |
100 | - array ( |
|
100 | + array( |
|
101 | 101 | 'name' => 'name', |
102 | 102 | 'type' => 'varchar', |
103 | 103 | 'vname' => 'LBL_NAME', |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | 'comment' => 'Name of the allowable action (view, list, delete, edit)' |
106 | 106 | ), |
107 | 107 | 'category' => |
108 | - array ( |
|
108 | + array( |
|
109 | 109 | 'name' => 'category', |
110 | 110 | 'vname' => 'LBL_CATEGORY', |
111 | 111 | 'type' => 'varchar', |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | 'comment' => 'Category of the allowable action (usually the name of a module)' |
115 | 115 | ), |
116 | 116 | 'acltype' => |
117 | - array ( |
|
117 | + array( |
|
118 | 118 | 'name' => 'acltype', |
119 | 119 | 'vname' => 'LBL_TYPE', |
120 | 120 | 'type' => 'varchar', |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | 'comment' => 'Specifier for Category, usually "module"' |
124 | 124 | ), |
125 | 125 | 'aclaccess' => |
126 | - array ( |
|
126 | + array( |
|
127 | 127 | 'name' => 'aclaccess', |
128 | 128 | 'vname' => 'LBL_ACCESS', |
129 | 129 | 'type' => 'int', |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | 'comment' => 'Number specifying access priority; highest access "wins"' |
133 | 133 | ), |
134 | 134 | 'deleted' => |
135 | - array ( |
|
135 | + array( |
|
136 | 136 | 'name' => 'deleted', |
137 | 137 | 'vname' => 'LBL_DELETED', |
138 | 138 | 'type' => 'bool', |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | 'comment' => 'Record deletion indicator' |
141 | 141 | ), |
142 | 142 | 'roles' => |
143 | - array ( |
|
143 | + array( |
|
144 | 144 | 'name' => 'roles', |
145 | 145 | 'type' => 'link', |
146 | 146 | 'relationship' => 'acl_roles_actions', |
@@ -148,10 +148,10 @@ discard block |
||
148 | 148 | 'vname'=>'LBL_USERS', |
149 | 149 | ), |
150 | 150 | ), |
151 | -'indices' => array ( |
|
151 | +'indices' => array( |
|
152 | 152 | array('name' =>'aclactionid', 'type' =>'primary', 'fields'=>array('id')), |
153 | 153 | array('name' =>'idx_aclaction_id_del', 'type' =>'index', 'fields'=>array('id', 'deleted')), |
154 | - array('name' =>'idx_category_name', 'type' =>'index', 'fields'=>array('category', 'name')), ) |
|
154 | + array('name' =>'idx_category_name', 'type' =>'index', 'fields'=>array('category', 'name')),) |
|
155 | 155 | |
156 | 156 | ); |
157 | 157 | ?> |
158 | 158 | \ No newline at end of file |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -42,33 +42,33 @@ |
||
42 | 42 | |
43 | 43 | |
44 | 44 | $layout_defs['ACL'] = array( |
45 | - // sets up which panels to show, in which order, and with what linked_fields |
|
46 | - 'subpanel_setup' => array( |
|
45 | + // sets up which panels to show, in which order, and with what linked_fields |
|
46 | + 'subpanel_setup' => array( |
|
47 | 47 | 'users' => array( |
48 | - 'top_buttons' => array( array('widget_class' => 'SubPanelTopSubModuleSelectButton', 'popup_module' => 'Users'),), |
|
49 | - 'order' => 20, |
|
50 | - 'module' => 'Users', |
|
51 | - 'subpanel_name' => 'ForSubModules', |
|
52 | - 'get_subpanel_data' => 'users', |
|
53 | - 'add_subpanel_data' => 'user_id', |
|
54 | - 'title_key' => 'LBL_USERS_SUBPANEL_TITLE', |
|
55 | - ), |
|
56 | - ), |
|
48 | + 'top_buttons' => array( array('widget_class' => 'SubPanelTopSubModuleSelectButton', 'popup_module' => 'Users'),), |
|
49 | + 'order' => 20, |
|
50 | + 'module' => 'Users', |
|
51 | + 'subpanel_name' => 'ForSubModules', |
|
52 | + 'get_subpanel_data' => 'users', |
|
53 | + 'add_subpanel_data' => 'user_id', |
|
54 | + 'title_key' => 'LBL_USERS_SUBPANEL_TITLE', |
|
55 | + ), |
|
56 | + ), |
|
57 | 57 | ); |
58 | 58 | $layout_defs['UserRoles'] = array( |
59 | - // sets up which panels to show, in which order, and with what linked_fields |
|
60 | - 'subpanel_setup' => array( |
|
59 | + // sets up which panels to show, in which order, and with what linked_fields |
|
60 | + 'subpanel_setup' => array( |
|
61 | 61 | 'acl' => array( |
62 | - 'top_buttons' => array(array('widget_class' => 'SubPanelTopSubModuleSelectButton', 'popup_module' => 'ACL'),), |
|
63 | - 'order' => 20, |
|
64 | - 'module' => 'ACL', |
|
65 | - 'subpanel_def_path'=>'modules/ACL/Roles/subpanels/default.php', |
|
66 | - 'subpanel_name' => 'default', |
|
67 | - 'get_subpanel_data' => 'roles', |
|
68 | - 'add_subpanel_data' => 'role_id', |
|
69 | - 'title_key' => 'LBL_ROLES_SUBPANEL_TITLE', |
|
70 | - ), |
|
71 | - ), |
|
62 | + 'top_buttons' => array(array('widget_class' => 'SubPanelTopSubModuleSelectButton', 'popup_module' => 'ACL'),), |
|
63 | + 'order' => 20, |
|
64 | + 'module' => 'ACL', |
|
65 | + 'subpanel_def_path'=>'modules/ACL/Roles/subpanels/default.php', |
|
66 | + 'subpanel_name' => 'default', |
|
67 | + 'get_subpanel_data' => 'roles', |
|
68 | + 'add_subpanel_data' => 'role_id', |
|
69 | + 'title_key' => 'LBL_ROLES_SUBPANEL_TITLE', |
|
70 | + ), |
|
71 | + ), |
|
72 | 72 | |
73 | 73 | ); |
74 | 74 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | // sets up which panels to show, in which order, and with what linked_fields |
46 | 46 | 'subpanel_setup' => array( |
47 | 47 | 'users' => array( |
48 | - 'top_buttons' => array( array('widget_class' => 'SubPanelTopSubModuleSelectButton', 'popup_module' => 'Users'),), |
|
48 | + 'top_buttons' => array(array('widget_class' => 'SubPanelTopSubModuleSelectButton', 'popup_module' => 'Users'),), |
|
49 | 49 | 'order' => 20, |
50 | 50 | 'module' => 'Users', |
51 | 51 | 'subpanel_name' => 'ForSubModules', |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -38,96 +38,96 @@ |
||
38 | 38 | * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
39 | 39 | ********************************************************************************/ |
40 | 40 | |
41 | - if(!defined('ACL_ALLOW_NONE')){ |
|
42 | - define('ACL_ALLOW_ADMIN_DEV', 100); |
|
43 | - define('ACL_ALLOW_ADMIN', 99); |
|
44 | - define('ACL_ALLOW_ALL', 90); |
|
45 | - define('ACL_ALLOW_ENABLED', 89); |
|
46 | - define('ACL_ALLOW_OWNER', 75); |
|
47 | - define('ACL_ALLOW_NORMAL', 1); |
|
48 | - define('ACL_ALLOW_DEFAULT', 0); |
|
49 | - define('ACL_ALLOW_DISABLED', -98); |
|
50 | - define('ACL_ALLOW_NONE', -99); |
|
51 | - define('ACL_ALLOW_DEV', 95); |
|
52 | - } |
|
53 | - /** |
|
54 | - * $GLOBALS['ACLActionAccessLevels |
|
55 | - * these are rendering descriptions for Access Levels giving information such as the label, color, and text color to use when rendering the access level |
|
56 | - */ |
|
57 | - $GLOBALS['ACLActionAccessLevels'] = array( |
|
58 | - ACL_ALLOW_ALL=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_ALL', 'text_color'=>'white'), |
|
59 | - ACL_ALLOW_OWNER=>array('color'=>'#6F6800', 'label'=>'LBL_ACCESS_OWNER', 'text_color'=>'white'), |
|
60 | - ACL_ALLOW_NONE=>array('color'=>'#FF0000', 'label'=>'LBL_ACCESS_NONE', 'text_color'=>'white'), |
|
61 | - ACL_ALLOW_ENABLED=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_ENABLED', 'text_color'=>'white'), |
|
62 | - ACL_ALLOW_DISABLED=>array('color'=>'#FF0000', 'label'=>'LBL_ACCESS_DISABLED', 'text_color'=>'white'), |
|
63 | - ACL_ALLOW_ADMIN=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_ADMIN', 'text_color'=>'white'), |
|
64 | - ACL_ALLOW_NORMAL=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_NORMAL', 'text_color'=>'white'), |
|
65 | - ACL_ALLOW_DEFAULT=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_DEFAULT', 'text_color'=>'white'), |
|
66 | - ACL_ALLOW_DEV=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_DEV', 'text_color'=>'white'), |
|
67 | - ACL_ALLOW_ADMIN_DEV=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_ADMIN_DEV', 'text_color'=>'white'), |
|
68 | - ); |
|
41 | + if(!defined('ACL_ALLOW_NONE')){ |
|
42 | + define('ACL_ALLOW_ADMIN_DEV', 100); |
|
43 | + define('ACL_ALLOW_ADMIN', 99); |
|
44 | + define('ACL_ALLOW_ALL', 90); |
|
45 | + define('ACL_ALLOW_ENABLED', 89); |
|
46 | + define('ACL_ALLOW_OWNER', 75); |
|
47 | + define('ACL_ALLOW_NORMAL', 1); |
|
48 | + define('ACL_ALLOW_DEFAULT', 0); |
|
49 | + define('ACL_ALLOW_DISABLED', -98); |
|
50 | + define('ACL_ALLOW_NONE', -99); |
|
51 | + define('ACL_ALLOW_DEV', 95); |
|
52 | + } |
|
53 | + /** |
|
54 | + * $GLOBALS['ACLActionAccessLevels |
|
55 | + * these are rendering descriptions for Access Levels giving information such as the label, color, and text color to use when rendering the access level |
|
56 | + */ |
|
57 | + $GLOBALS['ACLActionAccessLevels'] = array( |
|
58 | + ACL_ALLOW_ALL=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_ALL', 'text_color'=>'white'), |
|
59 | + ACL_ALLOW_OWNER=>array('color'=>'#6F6800', 'label'=>'LBL_ACCESS_OWNER', 'text_color'=>'white'), |
|
60 | + ACL_ALLOW_NONE=>array('color'=>'#FF0000', 'label'=>'LBL_ACCESS_NONE', 'text_color'=>'white'), |
|
61 | + ACL_ALLOW_ENABLED=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_ENABLED', 'text_color'=>'white'), |
|
62 | + ACL_ALLOW_DISABLED=>array('color'=>'#FF0000', 'label'=>'LBL_ACCESS_DISABLED', 'text_color'=>'white'), |
|
63 | + ACL_ALLOW_ADMIN=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_ADMIN', 'text_color'=>'white'), |
|
64 | + ACL_ALLOW_NORMAL=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_NORMAL', 'text_color'=>'white'), |
|
65 | + ACL_ALLOW_DEFAULT=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_DEFAULT', 'text_color'=>'white'), |
|
66 | + ACL_ALLOW_DEV=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_DEV', 'text_color'=>'white'), |
|
67 | + ACL_ALLOW_ADMIN_DEV=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_ADMIN_DEV', 'text_color'=>'white'), |
|
68 | + ); |
|
69 | 69 | /** |
70 | - * $GLOBALS['ACLActions |
|
71 | - * These are the actions for a given type. It includes the ACCESS Levels for that action and the label for that action. Every an object of the category (e.g. module) is added all associated actions are added for that object |
|
72 | - */ |
|
70 | + * $GLOBALS['ACLActions |
|
71 | + * These are the actions for a given type. It includes the ACCESS Levels for that action and the label for that action. Every an object of the category (e.g. module) is added all associated actions are added for that object |
|
72 | + */ |
|
73 | 73 | $GLOBALS['ACLActions'] = array( |
74 | - 'module'=>array('actions'=> |
|
75 | - array( |
|
76 | - 'access'=> |
|
77 | - array( |
|
78 | - 'aclaccess'=>array(ACL_ALLOW_ENABLED,ACL_ALLOW_DEFAULT, ACL_ALLOW_DISABLED), |
|
79 | - 'label'=>'LBL_ACTION_ACCESS', |
|
80 | - 'default'=>ACL_ALLOW_ENABLED, |
|
81 | - ), |
|
74 | + 'module'=>array('actions'=> |
|
75 | + array( |
|
76 | + 'access'=> |
|
77 | + array( |
|
78 | + 'aclaccess'=>array(ACL_ALLOW_ENABLED,ACL_ALLOW_DEFAULT, ACL_ALLOW_DISABLED), |
|
79 | + 'label'=>'LBL_ACTION_ACCESS', |
|
80 | + 'default'=>ACL_ALLOW_ENABLED, |
|
81 | + ), |
|
82 | 82 | |
83 | - 'view'=> |
|
84 | - array( |
|
85 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
86 | - 'label'=>'LBL_ACTION_VIEW', |
|
87 | - 'default'=>ACL_ALLOW_ALL, |
|
88 | - ), |
|
83 | + 'view'=> |
|
84 | + array( |
|
85 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
86 | + 'label'=>'LBL_ACTION_VIEW', |
|
87 | + 'default'=>ACL_ALLOW_ALL, |
|
88 | + ), |
|
89 | 89 | |
90 | - 'list'=> |
|
91 | - array( |
|
92 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
93 | - 'label'=>'LBL_ACTION_LIST', |
|
94 | - 'default'=>ACL_ALLOW_ALL, |
|
95 | - ), |
|
96 | - 'edit'=> |
|
97 | - array( |
|
98 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
99 | - 'label'=>'LBL_ACTION_EDIT', |
|
100 | - 'default'=>ACL_ALLOW_ALL, |
|
90 | + 'list'=> |
|
91 | + array( |
|
92 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
93 | + 'label'=>'LBL_ACTION_LIST', |
|
94 | + 'default'=>ACL_ALLOW_ALL, |
|
95 | + ), |
|
96 | + 'edit'=> |
|
97 | + array( |
|
98 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
99 | + 'label'=>'LBL_ACTION_EDIT', |
|
100 | + 'default'=>ACL_ALLOW_ALL, |
|
101 | 101 | |
102 | - ), |
|
103 | - 'delete'=> |
|
104 | - array( |
|
105 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
106 | - 'label'=>'LBL_ACTION_DELETE', |
|
107 | - 'default'=>ACL_ALLOW_ALL, |
|
102 | + ), |
|
103 | + 'delete'=> |
|
104 | + array( |
|
105 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
106 | + 'label'=>'LBL_ACTION_DELETE', |
|
107 | + 'default'=>ACL_ALLOW_ALL, |
|
108 | 108 | |
109 | - ), |
|
110 | - 'import'=> |
|
111 | - array( |
|
112 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
113 | - 'label'=>'LBL_ACTION_IMPORT', |
|
114 | - 'default'=>ACL_ALLOW_ALL, |
|
115 | - ), |
|
116 | - 'export'=> |
|
117 | - array( |
|
118 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
119 | - 'label'=>'LBL_ACTION_EXPORT', |
|
120 | - 'default'=>ACL_ALLOW_ALL, |
|
121 | - ), |
|
109 | + ), |
|
110 | + 'import'=> |
|
111 | + array( |
|
112 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
113 | + 'label'=>'LBL_ACTION_IMPORT', |
|
114 | + 'default'=>ACL_ALLOW_ALL, |
|
115 | + ), |
|
116 | + 'export'=> |
|
117 | + array( |
|
118 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
119 | + 'label'=>'LBL_ACTION_EXPORT', |
|
120 | + 'default'=>ACL_ALLOW_ALL, |
|
121 | + ), |
|
122 | 122 | 'massupdate'=> |
123 | - array( |
|
124 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
125 | - 'label'=>'LBL_ACTION_MASSUPDATE', |
|
126 | - 'default'=>ACL_ALLOW_ALL, |
|
127 | - ), |
|
123 | + array( |
|
124 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
125 | + 'label'=>'LBL_ACTION_MASSUPDATE', |
|
126 | + 'default'=>ACL_ALLOW_ALL, |
|
127 | + ), |
|
128 | 128 | |
129 | 129 | |
130 | - ),), |
|
130 | + ),), |
|
131 | 131 | ); |
132 | 132 | |
133 | 133 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
39 | 39 | ********************************************************************************/ |
40 | 40 | |
41 | - if(!defined('ACL_ALLOW_NONE')){ |
|
41 | + if (!defined('ACL_ALLOW_NONE')) { |
|
42 | 42 | define('ACL_ALLOW_ADMIN_DEV', 100); |
43 | 43 | define('ACL_ALLOW_ADMIN', 99); |
44 | 44 | define('ACL_ALLOW_ALL', 90); |
@@ -75,53 +75,53 @@ discard block |
||
75 | 75 | array( |
76 | 76 | 'access'=> |
77 | 77 | array( |
78 | - 'aclaccess'=>array(ACL_ALLOW_ENABLED,ACL_ALLOW_DEFAULT, ACL_ALLOW_DISABLED), |
|
78 | + 'aclaccess'=>array(ACL_ALLOW_ENABLED, ACL_ALLOW_DEFAULT, ACL_ALLOW_DISABLED), |
|
79 | 79 | 'label'=>'LBL_ACTION_ACCESS', |
80 | 80 | 'default'=>ACL_ALLOW_ENABLED, |
81 | 81 | ), |
82 | 82 | |
83 | 83 | 'view'=> |
84 | 84 | array( |
85 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
85 | + 'aclaccess'=>array(ACL_ALLOW_ALL, ACL_ALLOW_OWNER, ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
86 | 86 | 'label'=>'LBL_ACTION_VIEW', |
87 | 87 | 'default'=>ACL_ALLOW_ALL, |
88 | 88 | ), |
89 | 89 | |
90 | 90 | 'list'=> |
91 | 91 | array( |
92 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
92 | + 'aclaccess'=>array(ACL_ALLOW_ALL, ACL_ALLOW_OWNER, ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
93 | 93 | 'label'=>'LBL_ACTION_LIST', |
94 | 94 | 'default'=>ACL_ALLOW_ALL, |
95 | 95 | ), |
96 | 96 | 'edit'=> |
97 | 97 | array( |
98 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
98 | + 'aclaccess'=>array(ACL_ALLOW_ALL, ACL_ALLOW_OWNER, ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
99 | 99 | 'label'=>'LBL_ACTION_EDIT', |
100 | 100 | 'default'=>ACL_ALLOW_ALL, |
101 | 101 | |
102 | 102 | ), |
103 | 103 | 'delete'=> |
104 | 104 | array( |
105 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
105 | + 'aclaccess'=>array(ACL_ALLOW_ALL, ACL_ALLOW_OWNER, ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
106 | 106 | 'label'=>'LBL_ACTION_DELETE', |
107 | 107 | 'default'=>ACL_ALLOW_ALL, |
108 | 108 | |
109 | 109 | ), |
110 | 110 | 'import'=> |
111 | 111 | array( |
112 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
112 | + 'aclaccess'=>array(ACL_ALLOW_ALL, ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
113 | 113 | 'label'=>'LBL_ACTION_IMPORT', |
114 | 114 | 'default'=>ACL_ALLOW_ALL, |
115 | 115 | ), |
116 | 116 | 'export'=> |
117 | 117 | array( |
118 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
118 | + 'aclaccess'=>array(ACL_ALLOW_ALL, ACL_ALLOW_OWNER, ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
119 | 119 | 'label'=>'LBL_ACTION_EXPORT', |
120 | 120 | 'default'=>ACL_ALLOW_ALL, |
121 | 121 | ), |
122 | 122 | 'massupdate'=> |
123 | 123 | array( |
124 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
124 | + 'aclaccess'=>array(ACL_ALLOW_ALL, ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
125 | 125 | 'label'=>'LBL_ACTION_MASSUPDATE', |
126 | 126 | 'default'=>ACL_ALLOW_ALL, |
127 | 127 | ), |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -44,8 +44,8 @@ |
||
44 | 44 | global $app_strings, $current_language; |
45 | 45 | |
46 | 46 | $dashletMeta['MyPipelineBySalesStageDashlet'] = array('title' => 'LBL_TITLE', |
47 | - 'description' => 'LBL_TITLE', |
|
48 | - 'icon' => 'icon_Charts_Funnel_32.gif', |
|
49 | - 'module' => 'Opportunities', |
|
50 | - 'category' => 'Charts'); |
|
47 | + 'description' => 'LBL_TITLE', |
|
48 | + 'icon' => 'icon_Charts_Funnel_32.gif', |
|
49 | + 'module' => 'Opportunities', |
|
50 | + 'category' => 'Charts'); |
|
51 | 51 | ?> |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -62,14 +62,14 @@ discard block |
||
62 | 62 | { |
63 | 63 | global $timedate; |
64 | 64 | |
65 | - if(empty($options['mypbss_date_start'])) |
|
65 | + if (empty($options['mypbss_date_start'])) |
|
66 | 66 | $options['mypbss_date_start'] = $timedate->nowDbDate(); |
67 | - if(empty($options['mypbss_date_end'])) |
|
67 | + if (empty($options['mypbss_date_end'])) |
|
68 | 68 | $options['mypbss_date_end'] = $timedate->asDbDate($timedate->getNow()->modify("+6 months")); |
69 | - if(empty($options['title'])) |
|
69 | + if (empty($options['title'])) |
|
70 | 70 | $options['title'] = translate('LBL_MY_PIPELINE_FORM_TITLE', 'Home'); |
71 | 71 | |
72 | - parent::__construct($id,$options); |
|
72 | + parent::__construct($id, $options); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -105,11 +105,11 @@ discard block |
||
105 | 105 | $searchFormTab = 'advanced_search'; |
106 | 106 | $userId = $current_user->id; |
107 | 107 | |
108 | - $url_params = array( 'assigned_user_id' => $current_user->id ); |
|
108 | + $url_params = array('assigned_user_id' => $current_user->id); |
|
109 | 109 | $group_by = $this->constructGroupBy(); |
110 | 110 | |
111 | 111 | $currency_symbol = $sugar_config['default_currency_symbol']; |
112 | - if ($current_user->getPreference('currency')){ |
|
112 | + if ($current_user->getPreference('currency')) { |
|
113 | 113 | |
114 | 114 | $currency = new Currency(); |
115 | 115 | $currency->retrieve($current_user->getPreference('currency')); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | $thousands_symbol = translate('LBL_OPP_THOUSANDS', 'Charts'); |
120 | 120 | |
121 | - $subtitle = translate('LBL_OPP_SIZE', 'Charts') . " " . $currency_symbol . "1" . translate('LBL_OPP_THOUSANDS', 'Charts'); |
|
121 | + $subtitle = translate('LBL_OPP_SIZE', 'Charts')." ".$currency_symbol."1".translate('LBL_OPP_THOUSANDS', 'Charts'); |
|
122 | 122 | |
123 | 123 | $query = $this->constructQuery(); |
124 | 124 | $data = $this->constructCEChartData($this->getChartData($query)); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $startDate = $timedate->to_display_date($this->mypbss_date_start, false); |
148 | 148 | $endDate = $timedate->to_display_date($this->mypbss_date_end, false); |
149 | 149 | |
150 | - if(!is_array($chartReadyData['data'])||count($chartReadyData['data']) < 1) |
|
150 | + if (!is_array($chartReadyData['data']) || count($chartReadyData['data']) < 1) |
|
151 | 151 | { |
152 | 152 | return "<h3 class='noGraphDataPoints'>$this->noDataMessage</h3>"; |
153 | 153 | } |
@@ -325,15 +325,15 @@ discard block |
||
325 | 325 | $result = $db->query($query); |
326 | 326 | $row = $db->fetchByAssoc($result, false); |
327 | 327 | |
328 | - while($row != null){ |
|
328 | + while ($row != null) { |
|
329 | 329 | $temp_data[] = $row; |
330 | 330 | $row = $db->fetchByAssoc($result, false); |
331 | 331 | } |
332 | 332 | |
333 | 333 | // reorder and set the array based on the order of selected_datax |
334 | - foreach($selected_datax as $sales_stage){ |
|
335 | - foreach($temp_data as $key => $value){ |
|
336 | - if ($value['sales_stage'] == $sales_stage){ |
|
334 | + foreach ($selected_datax as $sales_stage) { |
|
335 | + foreach ($temp_data as $key => $value) { |
|
336 | + if ($value['sales_stage'] == $sales_stage) { |
|
337 | 337 | $value['sales_stage'] = $app_list_strings['sales_stage_dom'][$value['sales_stage']]; |
338 | 338 | $value['key'] = $sales_stage; |
339 | 339 | $value['value'] = $value['sales_stage']; |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | ) |
355 | 355 | { |
356 | 356 | $total = 0; |
357 | - foreach($dataset as $value){ |
|
357 | + foreach ($dataset as $value) { |
|
358 | 358 | $total += $value; |
359 | 359 | } |
360 | 360 | |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | ) |
371 | 371 | { |
372 | 372 | $newData = array(); |
373 | - foreach($dataset as $key=>$value){ |
|
373 | + foreach ($dataset as $key=>$value) { |
|
374 | 374 | $newData[$value['sales_stage']] = $value['total']; |
375 | 375 | } |
376 | 376 | return $newData; |
@@ -387,12 +387,12 @@ discard block |
||
387 | 387 | count(*) AS opp_count, |
388 | 388 | sum(amount_usdollar/1000) AS total |
389 | 389 | FROM users,opportunities "; |
390 | - $query .= " WHERE opportunities.assigned_user_id IN ('{$GLOBALS['current_user']->id}') " . |
|
391 | - " AND opportunities.date_closed >= ". db_convert("'".$this->mypbss_date_start."'",'date'). |
|
392 | - " AND opportunities.date_closed <= ".db_convert("'".$this->mypbss_date_end."'",'date') . |
|
390 | + $query .= " WHERE opportunities.assigned_user_id IN ('{$GLOBALS['current_user']->id}') ". |
|
391 | + " AND opportunities.date_closed >= ".db_convert("'".$this->mypbss_date_start."'", 'date'). |
|
392 | + " AND opportunities.date_closed <= ".db_convert("'".$this->mypbss_date_end."'", 'date'). |
|
393 | 393 | " AND opportunities.assigned_user_id = users.id AND opportunities.deleted=0 "; |
394 | - if ( count($this->mypbss_sales_stages) > 0 ) |
|
395 | - $query .= " AND opportunities.sales_stage IN ('" . implode("','",$this->mypbss_sales_stages) . "') "; |
|
394 | + if (count($this->mypbss_sales_stages) > 0) |
|
395 | + $query .= " AND opportunities.sales_stage IN ('".implode("','", $this->mypbss_sales_stages)."') "; |
|
396 | 396 | $query .= " GROUP BY opportunities.sales_stage ,users.user_name,opportunities.assigned_user_id"; |
397 | 397 | |
398 | 398 | return $query; |
@@ -409,22 +409,22 @@ discard block |
||
409 | 409 | return $groupBy; |
410 | 410 | } |
411 | 411 | |
412 | - protected function prepareChartData($data,$currency_symbol, $thousands_symbol) |
|
412 | + protected function prepareChartData($data, $currency_symbol, $thousands_symbol) |
|
413 | 413 | { |
414 | 414 | //Use the lead_source to categorise the data for the charts |
415 | 415 | $chart['labels'] = array(); |
416 | 416 | $chart['data'] = array(); |
417 | 417 | //Need to add all elements into the key, as they are stacked (even though the category is not present, the value could be) |
418 | 418 | $chart['key'] = array(); |
419 | - $chart['tooltips']= array(); |
|
419 | + $chart['tooltips'] = array(); |
|
420 | 420 | $chart['total'] = 0; |
421 | 421 | |
422 | - foreach($data as $key=>$value) |
|
422 | + foreach ($data as $key=>$value) |
|
423 | 423 | { |
424 | 424 | $formattedFloat = (float)number_format((float)$value, 2, '.', ''); |
425 | 425 | $chart['labels'][] = $key; |
426 | 426 | $chart['data'][] = $formattedFloat; |
427 | - $chart['total']+=$formattedFloat; |
|
427 | + $chart['total'] += $formattedFloat; |
|
428 | 428 | $chart['tooltips'][] = "'$key' amounts to $currency_symbol$formattedFloat$thousands_symbol (click bar to drill-through)"; |
429 | 429 | } |
430 | 430 | return $chart; |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -62,12 +64,15 @@ discard block |
||
62 | 64 | { |
63 | 65 | global $timedate; |
64 | 66 | |
65 | - if(empty($options['mypbss_date_start'])) |
|
66 | - $options['mypbss_date_start'] = $timedate->nowDbDate(); |
|
67 | - if(empty($options['mypbss_date_end'])) |
|
68 | - $options['mypbss_date_end'] = $timedate->asDbDate($timedate->getNow()->modify("+6 months")); |
|
69 | - if(empty($options['title'])) |
|
70 | - $options['title'] = translate('LBL_MY_PIPELINE_FORM_TITLE', 'Home'); |
|
67 | + if(empty($options['mypbss_date_start'])) { |
|
68 | + $options['mypbss_date_start'] = $timedate->nowDbDate(); |
|
69 | + } |
|
70 | + if(empty($options['mypbss_date_end'])) { |
|
71 | + $options['mypbss_date_end'] = $timedate->asDbDate($timedate->getNow()->modify("+6 months")); |
|
72 | + } |
|
73 | + if(empty($options['title'])) { |
|
74 | + $options['title'] = translate('LBL_MY_PIPELINE_FORM_TITLE', 'Home'); |
|
75 | + } |
|
71 | 76 | |
72 | 77 | parent::__construct($id,$options); |
73 | 78 | } |
@@ -80,11 +85,12 @@ discard block |
||
80 | 85 | global $app_list_strings; |
81 | 86 | |
82 | 87 | $selected_datax = array(); |
83 | - if (count($this->mypbss_sales_stages) > 0) |
|
84 | - foreach ($this->mypbss_sales_stages as $key) |
|
88 | + if (count($this->mypbss_sales_stages) > 0) { |
|
89 | + foreach ($this->mypbss_sales_stages as $key) |
|
85 | 90 | $selected_datax[] = $key; |
86 | - else |
|
87 | - $selected_datax = array_keys($app_list_strings['sales_stage_dom']); |
|
91 | + } else { |
|
92 | + $selected_datax = array_keys($app_list_strings['sales_stage_dom']); |
|
93 | + } |
|
88 | 94 | |
89 | 95 | $this->_searchFields['mypbss_sales_stages']['options'] = $app_list_strings['sales_stage_dom']; |
90 | 96 | $this->_searchFields['mypbss_sales_stages']['input_name0'] = $selected_datax; |
@@ -316,8 +322,7 @@ discard block |
||
316 | 322 | $datax[$key] = $app_list_strings['sales_stage_dom'][$key]; |
317 | 323 | array_push($selected_datax, $key); |
318 | 324 | } |
319 | - } |
|
320 | - else { |
|
325 | + } else { |
|
321 | 326 | $datax = $app_list_strings['sales_stage_dom']; |
322 | 327 | $selected_datax = array_keys($app_list_strings['sales_stage_dom']); |
323 | 328 | } |
@@ -391,8 +396,9 @@ discard block |
||
391 | 396 | " AND opportunities.date_closed >= ". db_convert("'".$this->mypbss_date_start."'",'date'). |
392 | 397 | " AND opportunities.date_closed <= ".db_convert("'".$this->mypbss_date_end."'",'date') . |
393 | 398 | " AND opportunities.assigned_user_id = users.id AND opportunities.deleted=0 "; |
394 | - if ( count($this->mypbss_sales_stages) > 0 ) |
|
395 | - $query .= " AND opportunities.sales_stage IN ('" . implode("','",$this->mypbss_sales_stages) . "') "; |
|
399 | + if ( count($this->mypbss_sales_stages) > 0 ) { |
|
400 | + $query .= " AND opportunities.sales_stage IN ('" . implode("','",$this->mypbss_sales_stages) . "') "; |
|
401 | + } |
|
396 | 402 | $query .= " GROUP BY opportunities.sales_stage ,users.user_name,opportunities.assigned_user_id"; |
397 | 403 | |
398 | 404 | return $query; |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -66,11 +68,13 @@ discard block |
||
66 | 68 | { |
67 | 69 | global $timedate; |
68 | 70 | |
69 | - if(empty($options['obm_date_start'])) |
|
70 | - $options['obm_date_start'] = $timedate->nowDbDate(); |
|
71 | + if(empty($options['obm_date_start'])) { |
|
72 | + $options['obm_date_start'] = $timedate->nowDbDate(); |
|
73 | + } |
|
71 | 74 | |
72 | - if(empty($options['obm_date_end'])) |
|
73 | - $options['obm_date_end'] = $timedate->asDbDate($timedate->getNow()->modify("+6 months")); |
|
75 | + if(empty($options['obm_date_end'])) { |
|
76 | + $options['obm_date_end'] = $timedate->asDbDate($timedate->getNow()->modify("+6 months")); |
|
77 | + } |
|
74 | 78 | |
75 | 79 | parent::__construct($id,$options); |
76 | 80 | } |
@@ -80,8 +84,9 @@ discard block |
||
80 | 84 | */ |
81 | 85 | public function displayOptions() |
82 | 86 | { |
83 | - if (!isset($this->obm_ids) || count($this->obm_ids) == 0) |
|
84 | - $this->_searchFields['obm_ids']['input_name0'] = array_keys(get_user_array(false)); |
|
87 | + if (!isset($this->obm_ids) || count($this->obm_ids) == 0) { |
|
88 | + $this->_searchFields['obm_ids']['input_name0'] = array_keys(get_user_array(false)); |
|
89 | + } |
|
85 | 90 | |
86 | 91 | return parent::displayOptions(); |
87 | 92 | } |
@@ -247,8 +252,9 @@ discard block |
||
247 | 252 | $query .= " WHERE opportunities.date_closed >= ".db_convert("'".$this->obm_date_start."'",'date') . |
248 | 253 | " AND opportunities.date_closed <= ".db_convert("'".$this->obm_date_end."'",'date') . |
249 | 254 | " AND opportunities.deleted=0"; |
250 | - if (count($this->obm_ids) > 0) |
|
251 | - $query .= " AND opportunities.assigned_user_id IN ('" . implode("','",$this->obm_ids) . "')"; |
|
255 | + if (count($this->obm_ids) > 0) { |
|
256 | + $query .= " AND opportunities.assigned_user_id IN ('" . implode("','",$this->obm_ids) . "')"; |
|
257 | + } |
|
252 | 258 | $query .= " GROUP BY sales_stage,". |
253 | 259 | db_convert('opportunities.date_closed','date_format',array("'%Y-%m'"),array("'YYYY-MM'")) . |
254 | 260 | " ORDER BY m"; |
@@ -274,8 +280,9 @@ discard block |
||
274 | 280 | $chart['labels'][] = $key; |
275 | 281 | $chart['data'][] = array(); |
276 | 282 | } |
277 | - if(!in_array($stage,$chart['key'])) |
|
278 | - $chart['key'][] = $stage; |
|
283 | + if(!in_array($stage,$chart['key'])) { |
|
284 | + $chart['key'][] = $stage; |
|
285 | + } |
|
279 | 286 | |
280 | 287 | $formattedFloat = (float)number_format((float)$i["total"], 2, '.', ''); |
281 | 288 | $chart['data'][count($chart['data'])-1][] = $formattedFloat; |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -66,13 +66,13 @@ discard block |
||
66 | 66 | { |
67 | 67 | global $timedate; |
68 | 68 | |
69 | - if(empty($options['obm_date_start'])) |
|
69 | + if (empty($options['obm_date_start'])) |
|
70 | 70 | $options['obm_date_start'] = $timedate->nowDbDate(); |
71 | 71 | |
72 | - if(empty($options['obm_date_end'])) |
|
72 | + if (empty($options['obm_date_end'])) |
|
73 | 73 | $options['obm_date_end'] = $timedate->asDbDate($timedate->getNow()->modify("+6 months")); |
74 | 74 | |
75 | - parent::__construct($id,$options); |
|
75 | + parent::__construct($id, $options); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | public function display() |
93 | 93 | { |
94 | 94 | $currency_symbol = $GLOBALS['sugar_config']['default_currency_symbol']; |
95 | - if ($GLOBALS['current_user']->getPreference('currency')){ |
|
95 | + if ($GLOBALS['current_user']->getPreference('currency')) { |
|
96 | 96 | |
97 | 97 | $currency = new Currency(); |
98 | 98 | $currency->retrieve($GLOBALS['current_user']->getPreference('currency')); |
@@ -103,13 +103,13 @@ discard block |
||
103 | 103 | $action = 'index'; |
104 | 104 | $query = 'true'; |
105 | 105 | $searchFormTab = 'advanced_search'; |
106 | - $groupBy = array( 'm', 'sales_stage', ); |
|
106 | + $groupBy = array('m', 'sales_stage',); |
|
107 | 107 | |
108 | 108 | |
109 | 109 | $data = $this->getChartData($this->constructQuery()); |
110 | 110 | |
111 | 111 | //I have taken out the sort as this will throw off the labels we have calculated |
112 | - $data = $this->sortData($data,'m', false, 'sales_stage', true, true); |
|
112 | + $data = $this->sortData($data, 'm', false, 'sales_stage', true, true); |
|
113 | 113 | |
114 | 114 | $chartReadyData = $this->prepareChartData($data, $currency_symbol, $thousands_symbol); |
115 | 115 | $canvasId = 'rGraphOutcomeByMonth'.uniqid(); |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | $colours = "['#a6cee3','#1f78b4','#b2df8a','#33a02c','#fb9a99','#e31a1c','#fdbf6f','#ff7f00','#cab2d6','#6a3d9a','#ffff99','#b15928']"; |
130 | 130 | |
131 | 131 | |
132 | - if(!is_array($chartReadyData['data'])||count($chartReadyData['data']) < 1) |
|
132 | + if (!is_array($chartReadyData['data']) || count($chartReadyData['data']) < 1) |
|
133 | 133 | { |
134 | 134 | return "<h3 class='noGraphDataPoints'>$this->noDataMessage</h3>"; |
135 | 135 | } |
@@ -242,45 +242,45 @@ discard block |
||
242 | 242 | protected function constructQuery() |
243 | 243 | { |
244 | 244 | $query = "SELECT sales_stage,". |
245 | - db_convert('opportunities.date_closed','date_format',array("'%Y-%m'"),array("'YYYY-MM'"))." as m, ". |
|
245 | + db_convert('opportunities.date_closed', 'date_format', array("'%Y-%m'"), array("'YYYY-MM'"))." as m, ". |
|
246 | 246 | "sum(amount_usdollar/1000) as total, count(*) as opp_count FROM opportunities "; |
247 | - $query .= " WHERE opportunities.date_closed >= ".db_convert("'".$this->obm_date_start."'",'date') . |
|
248 | - " AND opportunities.date_closed <= ".db_convert("'".$this->obm_date_end."'",'date') . |
|
247 | + $query .= " WHERE opportunities.date_closed >= ".db_convert("'".$this->obm_date_start."'", 'date'). |
|
248 | + " AND opportunities.date_closed <= ".db_convert("'".$this->obm_date_end."'", 'date'). |
|
249 | 249 | " AND opportunities.deleted=0"; |
250 | 250 | if (count($this->obm_ids) > 0) |
251 | - $query .= " AND opportunities.assigned_user_id IN ('" . implode("','",$this->obm_ids) . "')"; |
|
251 | + $query .= " AND opportunities.assigned_user_id IN ('".implode("','", $this->obm_ids)."')"; |
|
252 | 252 | $query .= " GROUP BY sales_stage,". |
253 | - db_convert('opportunities.date_closed','date_format',array("'%Y-%m'"),array("'YYYY-MM'")) . |
|
253 | + db_convert('opportunities.date_closed', 'date_format', array("'%Y-%m'"), array("'YYYY-MM'")). |
|
254 | 254 | " ORDER BY m"; |
255 | 255 | |
256 | 256 | return $query; |
257 | 257 | } |
258 | 258 | |
259 | - protected function prepareChartData($data,$currency_symbol, $thousands_symbol) |
|
259 | + protected function prepareChartData($data, $currency_symbol, $thousands_symbol) |
|
260 | 260 | { |
261 | 261 | //Use the lead_source to categorise the data for the charts |
262 | 262 | $chart['labels'] = array(); |
263 | 263 | $chart['data'] = array(); |
264 | 264 | //Need to add all elements into the key, as they are stacked (even though the category is not present, the value could be) |
265 | 265 | $chart['key'] = array(); |
266 | - $chart['tooltips']= array(); |
|
266 | + $chart['tooltips'] = array(); |
|
267 | 267 | |
268 | - foreach($data as $i) |
|
268 | + foreach ($data as $i) |
|
269 | 269 | { |
270 | 270 | $key = $i["m"]; |
271 | 271 | $stage = $i["sales_stage"]; |
272 | 272 | $stage_dom_option = $i["sales_stage_dom_option"]; |
273 | - if(!in_array($key,$chart['labels'])) |
|
273 | + if (!in_array($key, $chart['labels'])) |
|
274 | 274 | { |
275 | 275 | $chart['labels'][] = $key; |
276 | 276 | $chart['data'][] = array(); |
277 | 277 | } |
278 | - if(!in_array($stage,$chart['key'])) |
|
278 | + if (!in_array($stage, $chart['key'])) |
|
279 | 279 | $chart['key'][] = $stage; |
280 | 280 | |
281 | 281 | $formattedFloat = (float)number_format((float)$i["total"], 2, '.', ''); |
282 | - $chart['data'][count($chart['data'])-1][] = $formattedFloat; |
|
283 | - $chart['tooltips'][]="<div><input type='hidden' class='stage' value='$stage_dom_option'><input type='hidden' class='date' value='$key'></div>".$stage.'('.$currency_symbol.$formattedFloat.$thousands_symbol.') '.$key; |
|
282 | + $chart['data'][count($chart['data']) - 1][] = $formattedFloat; |
|
283 | + $chart['tooltips'][] = "<div><input type='hidden' class='stage' value='$stage_dom_option'><input type='hidden' class='date' value='$key'></div>".$stage.'('.$currency_symbol.$formattedFloat.$thousands_symbol.') '.$key; |
|
284 | 284 | } |
285 | 285 | return $chart; |
286 | 286 | } |
@@ -44,8 +44,8 @@ |
||
44 | 44 | global $app_strings, $current_language; |
45 | 45 | |
46 | 46 | $dashletMeta['PipelineBySalesStageDashlet'] = array('title' => 'LBL_TITLE', |
47 | - 'description' => 'LBL_TITLE', |
|
48 | - 'module' => 'Opportunities', |
|
49 | - 'icon' => 'icon_Charts_Funnel_32.gif', |
|
50 | - 'category' => 'Charts'); |
|
47 | + 'description' => 'LBL_TITLE', |
|
48 | + 'module' => 'Opportunities', |
|
49 | + 'icon' => 'icon_Charts_Funnel_32.gif', |
|
50 | + 'category' => 'Charts'); |
|
51 | 51 | ?> |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | global $current_user, $sugar_config; |
86 | 86 | |
87 | 87 | $currency_symbol = $sugar_config['default_currency_symbol']; |
88 | - if ($current_user->getPreference('currency')){ |
|
88 | + if ($current_user->getPreference('currency')) { |
|
89 | 89 | |
90 | 90 | $currency = new Currency(); |
91 | 91 | $currency->retrieve($current_user->getPreference('currency')); |
@@ -106,12 +106,12 @@ discard block |
||
106 | 106 | |
107 | 107 | $module = 'Opportunities'; |
108 | 108 | $action = 'index'; |
109 | - $query ='true'; |
|
110 | - $searchFormTab ='advanced_search'; |
|
109 | + $query = 'true'; |
|
110 | + $searchFormTab = 'advanced_search'; |
|
111 | 111 | |
112 | 112 | $colours = "['#a6cee3','#1f78b4','#b2df8a','#33a02c','#fb9a99','#e31a1c','#fdbf6f','#ff7f00','#cab2d6','#6a3d9a','#ffff99','#b15928','#8080ff','#c03f80']"; |
113 | 113 | |
114 | - if(!is_array($chartReadyData['data'])||count($chartReadyData['data']) < 1) |
|
114 | + if (!is_array($chartReadyData['data']) || count($chartReadyData['data']) < 1) |
|
115 | 115 | { |
116 | 116 | return "<h3 class='noGraphDataPoints'>$this->noDataMessage</h3>"; |
117 | 117 | } |
@@ -208,28 +208,28 @@ discard block |
||
208 | 208 | |
209 | 209 | $row = $db->fetchByAssoc($result); |
210 | 210 | |
211 | - while ($row != null){ |
|
211 | + while ($row != null) { |
|
212 | 212 | $dataSet[] = $row; |
213 | 213 | $row = $db->fetchByAssoc($result); |
214 | 214 | } |
215 | 215 | return $dataSet; |
216 | 216 | } |
217 | 217 | |
218 | - protected function prepareChartData($data,$currency_symbol, $thousands_symbol) |
|
218 | + protected function prepareChartData($data, $currency_symbol, $thousands_symbol) |
|
219 | 219 | { |
220 | 220 | //return $data; |
221 | - $chart['labels']=array(); |
|
222 | - $chart['data']=array(); |
|
221 | + $chart['labels'] = array(); |
|
222 | + $chart['data'] = array(); |
|
223 | 223 | $total = 0; |
224 | - foreach($data as $i) |
|
224 | + foreach ($data as $i) |
|
225 | 225 | { |
226 | - $chart['labelsAndValues'][]=$i['lead_source'].' ('.$currency_symbol.(int)$i['total'].$thousands_symbol.')'; |
|
226 | + $chart['labelsAndValues'][] = $i['lead_source'].' ('.$currency_symbol.(int)$i['total'].$thousands_symbol.')'; |
|
227 | 227 | //$chart['labelsAndValues'][]=$currency_symbol.(int)$i['total'].$thousands_symbol; |
228 | - $chart['labels'][]=$i['lead_source']; |
|
229 | - $chart['data'][]=(int)$i['total']; |
|
230 | - $total+=(int)$i['total']; |
|
228 | + $chart['labels'][] = $i['lead_source']; |
|
229 | + $chart['data'][] = (int)$i['total']; |
|
230 | + $total += (int)$i['total']; |
|
231 | 231 | } |
232 | - $chart['total']=$total; |
|
232 | + $chart['total'] = $total; |
|
233 | 233 | return $chart; |
234 | 234 | } |
235 | 235 | |
@@ -241,12 +241,12 @@ discard block |
||
241 | 241 | $query = "SELECT lead_source,sum(amount_usdollar/1000) as total,count(*) as opp_count ". |
242 | 242 | "FROM opportunities "; |
243 | 243 | $query .= "WHERE opportunities.deleted=0 "; |
244 | - if ( count($this->pbls_ids) > 0 ) |
|
245 | - $query .= "AND opportunities.assigned_user_id IN ('".implode("','",$this->pbls_ids)."') "; |
|
246 | - if ( count($this->pbls_lead_sources) > 0 ) |
|
247 | - $query .= "AND opportunities.lead_source IN ('".implode("','",$this->pbls_lead_sources)."') "; |
|
244 | + if (count($this->pbls_ids) > 0) |
|
245 | + $query .= "AND opportunities.assigned_user_id IN ('".implode("','", $this->pbls_ids)."') "; |
|
246 | + if (count($this->pbls_lead_sources) > 0) |
|
247 | + $query .= "AND opportunities.lead_source IN ('".implode("','", $this->pbls_lead_sources)."') "; |
|
248 | 248 | else |
249 | - $query .= "AND opportunities.lead_source IN ('".implode("','",array_keys($GLOBALS['app_list_strings']['lead_source_dom']))."') "; |
|
249 | + $query .= "AND opportunities.lead_source IN ('".implode("','", array_keys($GLOBALS['app_list_strings']['lead_source_dom']))."') "; |
|
250 | 250 | $query .= "GROUP BY lead_source ORDER BY total DESC"; |
251 | 251 | |
252 | 252 | return $query; |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -62,17 +64,19 @@ discard block |
||
62 | 64 | global $app_list_strings; |
63 | 65 | |
64 | 66 | $selected_datax = array(); |
65 | - if (!empty($this->pbls_lead_sources) && sizeof($this->pbls_lead_sources) > 0) |
|
66 | - foreach ($this->pbls_lead_sources as $key) |
|
67 | + if (!empty($this->pbls_lead_sources) && sizeof($this->pbls_lead_sources) > 0) { |
|
68 | + foreach ($this->pbls_lead_sources as $key) |
|
67 | 69 | $selected_datax[] = $key; |
68 | - else |
|
69 | - $selected_datax = array_keys($app_list_strings['lead_source_dom']); |
|
70 | + } else { |
|
71 | + $selected_datax = array_keys($app_list_strings['lead_source_dom']); |
|
72 | + } |
|
70 | 73 | |
71 | 74 | $this->_searchFields['pbls_lead_sources']['options'] = array_filter($app_list_strings['lead_source_dom']); |
72 | 75 | $this->_searchFields['pbls_lead_sources']['input_name0'] = $selected_datax; |
73 | 76 | |
74 | - if (!isset($this->pbls_ids) || count($this->pbls_ids) == 0) |
|
75 | - $this->_searchFields['pbls_ids']['input_name0'] = array_keys(get_user_array(false)); |
|
77 | + if (!isset($this->pbls_ids) || count($this->pbls_ids) == 0) { |
|
78 | + $this->_searchFields['pbls_ids']['input_name0'] = array_keys(get_user_array(false)); |
|
79 | + } |
|
76 | 80 | |
77 | 81 | return parent::displayOptions(); |
78 | 82 | } |
@@ -241,12 +245,14 @@ discard block |
||
241 | 245 | $query = "SELECT lead_source,sum(amount_usdollar/1000) as total,count(*) as opp_count ". |
242 | 246 | "FROM opportunities "; |
243 | 247 | $query .= "WHERE opportunities.deleted=0 "; |
244 | - if ( count($this->pbls_ids) > 0 ) |
|
245 | - $query .= "AND opportunities.assigned_user_id IN ('".implode("','",$this->pbls_ids)."') "; |
|
246 | - if ( count($this->pbls_lead_sources) > 0 ) |
|
247 | - $query .= "AND opportunities.lead_source IN ('".implode("','",$this->pbls_lead_sources)."') "; |
|
248 | - else |
|
249 | - $query .= "AND opportunities.lead_source IN ('".implode("','",array_keys($GLOBALS['app_list_strings']['lead_source_dom']))."') "; |
|
248 | + if ( count($this->pbls_ids) > 0 ) { |
|
249 | + $query .= "AND opportunities.assigned_user_id IN ('".implode("','",$this->pbls_ids)."') "; |
|
250 | + } |
|
251 | + if ( count($this->pbls_lead_sources) > 0 ) { |
|
252 | + $query .= "AND opportunities.lead_source IN ('".implode("','",$this->pbls_lead_sources)."') "; |
|
253 | + } else { |
|
254 | + $query .= "AND opportunities.lead_source IN ('".implode("','",array_keys($GLOBALS['app_list_strings']['lead_source_dom']))."') "; |
|
255 | + } |
|
250 | 256 | $query .= "GROUP BY lead_source ORDER BY total DESC"; |
251 | 257 | |
252 | 258 | return $query; |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -61,17 +63,19 @@ discard block |
||
61 | 63 | global $app_list_strings; |
62 | 64 | |
63 | 65 | $selected_datax = array(); |
64 | - if (!empty($this->lsbo_lead_sources) && sizeof($this->lsbo_lead_sources) > 0) |
|
65 | - foreach ($this->lsbo_lead_sources as $key) |
|
66 | + if (!empty($this->lsbo_lead_sources) && sizeof($this->lsbo_lead_sources) > 0) { |
|
67 | + foreach ($this->lsbo_lead_sources as $key) |
|
66 | 68 | $selected_datax[] = $key; |
67 | - else |
|
68 | - $selected_datax = array_keys($app_list_strings['lead_source_dom']); |
|
69 | + } else { |
|
70 | + $selected_datax = array_keys($app_list_strings['lead_source_dom']); |
|
71 | + } |
|
69 | 72 | |
70 | 73 | $this->_searchFields['lsbo_lead_sources']['options'] = array_filter($app_list_strings['lead_source_dom']); |
71 | 74 | $this->_searchFields['lsbo_lead_sources']['input_name0'] = $selected_datax; |
72 | 75 | |
73 | - if (!isset($this->lsbo_ids) || count($this->lsbo_ids) == 0) |
|
74 | - $this->_searchFields['lsbo_ids']['input_name0'] = array_keys(get_user_array(false)); |
|
76 | + if (!isset($this->lsbo_ids) || count($this->lsbo_ids) == 0) { |
|
77 | + $this->_searchFields['lsbo_ids']['input_name0'] = array_keys(get_user_array(false)); |
|
78 | + } |
|
75 | 79 | |
76 | 80 | return parent::displayOptions(); |
77 | 81 | } |
@@ -131,8 +135,9 @@ discard block |
||
131 | 135 | |
132 | 136 | |
133 | 137 | $url_params = array(); |
134 | - if ( count($this->lsbo_ids) > 0 ) |
|
135 | - $url_params['assigned_user_id'] = array_values($this->lsbo_ids); |
|
138 | + if ( count($this->lsbo_ids) > 0 ) { |
|
139 | + $url_params['assigned_user_id'] = array_values($this->lsbo_ids); |
|
140 | + } |
|
136 | 141 | |
137 | 142 | |
138 | 143 | $data = $this->getChartData($this->constructQuery()); |
@@ -253,12 +258,14 @@ discard block |
||
253 | 258 | $query = "SELECT lead_source,sales_stage,sum(amount_usdollar/1000) as total, ". |
254 | 259 | "count(*) as opp_count FROM opportunities "; |
255 | 260 | $query .= " WHERE opportunities.deleted=0 "; |
256 | - if ( count($this->lsbo_ids) > 0 ) |
|
257 | - $query .= "AND opportunities.assigned_user_id IN ('".implode("','",$this->lsbo_ids)."') "; |
|
258 | - if ( count($this->lsbo_lead_sources) > 0 ) |
|
259 | - $query .= "AND opportunities.lead_source IN ('".implode("','",$this->lsbo_lead_sources)."') "; |
|
260 | - else |
|
261 | - $query .= "AND opportunities.lead_source IN ('".implode("','",array_keys($GLOBALS['app_list_strings']['lead_source_dom']))."') "; |
|
261 | + if ( count($this->lsbo_ids) > 0 ) { |
|
262 | + $query .= "AND opportunities.assigned_user_id IN ('".implode("','",$this->lsbo_ids)."') "; |
|
263 | + } |
|
264 | + if ( count($this->lsbo_lead_sources) > 0 ) { |
|
265 | + $query .= "AND opportunities.lead_source IN ('".implode("','",$this->lsbo_lead_sources)."') "; |
|
266 | + } else { |
|
267 | + $query .= "AND opportunities.lead_source IN ('".implode("','",array_keys($GLOBALS['app_list_strings']['lead_source_dom']))."') "; |
|
268 | + } |
|
262 | 269 | $query .= " GROUP BY sales_stage,lead_source ORDER BY lead_source,sales_stage"; |
263 | 270 | |
264 | 271 | return $query; |
@@ -282,8 +289,9 @@ discard block |
||
282 | 289 | $chart['labels'][] = $key; |
283 | 290 | $chart['data'][] = array(); |
284 | 291 | } |
285 | - if(!in_array($stage,$chart['key'])) |
|
286 | - $chart['key'][] = $stage; |
|
292 | + if(!in_array($stage,$chart['key'])) { |
|
293 | + $chart['key'][] = $stage; |
|
294 | + } |
|
287 | 295 | |
288 | 296 | $formattedFloat = (float)number_format((float)$i["total"], 2, '.', ''); |
289 | 297 | $chart['data'][count($chart['data'])-1][] = $formattedFloat; |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -114,24 +114,24 @@ discard block |
||
114 | 114 | */ |
115 | 115 | |
116 | 116 | $currency_symbol = $sugar_config['default_currency_symbol']; |
117 | - if ($current_user->getPreference('currency')){ |
|
117 | + if ($current_user->getPreference('currency')) { |
|
118 | 118 | |
119 | 119 | $currency = new Currency(); |
120 | 120 | $currency->retrieve($current_user->getPreference('currency')); |
121 | 121 | $currency_symbol = $currency->symbol; |
122 | 122 | } |
123 | - $subtitle = translate('LBL_OPP_SIZE', 'Charts') . " " . $currency_symbol . "1" . translate('LBL_OPP_THOUSANDS', 'Charts'); |
|
123 | + $subtitle = translate('LBL_OPP_SIZE', 'Charts')." ".$currency_symbol."1".translate('LBL_OPP_THOUSANDS', 'Charts'); |
|
124 | 124 | $thousands_symbol = translate('LBL_OPP_THOUSANDS', 'Charts'); |
125 | 125 | |
126 | 126 | $module = 'Opportunities'; |
127 | - $action = 'index'; |
|
128 | - $query = 'true'; |
|
127 | + $action = 'index'; |
|
128 | + $query = 'true'; |
|
129 | 129 | $searchFormTab = 'advanced_search'; |
130 | - $groupBy = array( 'lead_source', 'sales_stage' ); |
|
130 | + $groupBy = array('lead_source', 'sales_stage'); |
|
131 | 131 | |
132 | 132 | |
133 | 133 | $url_params = array(); |
134 | - if ( count($this->lsbo_ids) > 0 ) |
|
134 | + if (count($this->lsbo_ids) > 0) |
|
135 | 135 | $url_params['assigned_user_id'] = array_values($this->lsbo_ids); |
136 | 136 | |
137 | 137 | |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | |
158 | 158 | $colours = "['#a6cee3','#1f78b4','#b2df8a','#33a02c','#fb9a99','#e31a1c','#fdbf6f','#ff7f00','#cab2d6','#6a3d9a','#ffff99','#b15928']"; |
159 | 159 | |
160 | - if(!is_array($chartReadyData['data'])||count($chartReadyData['data']) < 1) |
|
160 | + if (!is_array($chartReadyData['data']) || count($chartReadyData['data']) < 1) |
|
161 | 161 | { |
162 | 162 | return "<h3 class='noGraphDataPoints'>$this->noDataMessage</h3>"; |
163 | 163 | } |
@@ -253,43 +253,43 @@ discard block |
||
253 | 253 | $query = "SELECT lead_source,sales_stage,sum(amount_usdollar/1000) as total, ". |
254 | 254 | "count(*) as opp_count FROM opportunities "; |
255 | 255 | $query .= " WHERE opportunities.deleted=0 "; |
256 | - if ( count($this->lsbo_ids) > 0 ) |
|
257 | - $query .= "AND opportunities.assigned_user_id IN ('".implode("','",$this->lsbo_ids)."') "; |
|
258 | - if ( count($this->lsbo_lead_sources) > 0 ) |
|
259 | - $query .= "AND opportunities.lead_source IN ('".implode("','",$this->lsbo_lead_sources)."') "; |
|
256 | + if (count($this->lsbo_ids) > 0) |
|
257 | + $query .= "AND opportunities.assigned_user_id IN ('".implode("','", $this->lsbo_ids)."') "; |
|
258 | + if (count($this->lsbo_lead_sources) > 0) |
|
259 | + $query .= "AND opportunities.lead_source IN ('".implode("','", $this->lsbo_lead_sources)."') "; |
|
260 | 260 | else |
261 | - $query .= "AND opportunities.lead_source IN ('".implode("','",array_keys($GLOBALS['app_list_strings']['lead_source_dom']))."') "; |
|
261 | + $query .= "AND opportunities.lead_source IN ('".implode("','", array_keys($GLOBALS['app_list_strings']['lead_source_dom']))."') "; |
|
262 | 262 | $query .= " GROUP BY sales_stage,lead_source ORDER BY lead_source,sales_stage"; |
263 | 263 | |
264 | 264 | return $query; |
265 | 265 | } |
266 | 266 | |
267 | - protected function prepareChartData($data,$currency_symbol, $thousands_symbol) |
|
267 | + protected function prepareChartData($data, $currency_symbol, $thousands_symbol) |
|
268 | 268 | { |
269 | 269 | //Use the lead_source to categorise the data for the charts |
270 | 270 | $chart['labels'] = array(); |
271 | 271 | $chart['data'] = array(); |
272 | 272 | //Need to add all elements into the key, as they are stacked (even though the category is not present, the value could be |
273 | 273 | $chart['key'] = array(); |
274 | - $chart['tooltips']= array(); |
|
274 | + $chart['tooltips'] = array(); |
|
275 | 275 | |
276 | - foreach($data as $i) |
|
276 | + foreach ($data as $i) |
|
277 | 277 | { |
278 | 278 | $key = $i["lead_source"]; |
279 | 279 | $keyDom = $i["lead_source_dom_option"]; |
280 | 280 | $stage = $i["sales_stage"]; |
281 | 281 | $stageDom = $i["sales_stage_dom_option"]; |
282 | - if(!in_array($key,$chart['labels'])) |
|
282 | + if (!in_array($key, $chart['labels'])) |
|
283 | 283 | { |
284 | 284 | $chart['labels'][] = $key; |
285 | 285 | $chart['data'][] = array(); |
286 | 286 | } |
287 | - if(!in_array($stage,$chart['key'])) |
|
287 | + if (!in_array($stage, $chart['key'])) |
|
288 | 288 | $chart['key'][] = $stage; |
289 | 289 | |
290 | 290 | $formattedFloat = (float)number_format((float)$i["total"], 2, '.', ''); |
291 | - $chart['data'][count($chart['data'])-1][] = $formattedFloat; |
|
292 | - $chart['tooltips'][]="<div><input type='hidden' class='stage' value='$stageDom'><input type='hidden' class='category' value='$keyDom'></div>".$stage.'('.$currency_symbol.$formattedFloat.$thousands_symbol.') '.$key; |
|
291 | + $chart['data'][count($chart['data']) - 1][] = $formattedFloat; |
|
292 | + $chart['tooltips'][] = "<div><input type='hidden' class='stage' value='$stageDom'><input type='hidden' class='category' value='$keyDom'></div>".$stage.'('.$currency_symbol.$formattedFloat.$thousands_symbol.') '.$key; |
|
293 | 293 | } |
294 | 294 | return $chart; |
295 | 295 | } |