@@ -38,28 +38,28 @@ |
||
38 | 38 | ********************************************************************************/ |
39 | 39 | |
40 | 40 | |
41 | - $searchdefs['Project'] = array( |
|
42 | - 'templateMeta' => array( |
|
43 | - 'maxColumns' => '3', |
|
44 | - 'maxColumnsBasic' => '4', |
|
41 | + $searchdefs['Project'] = array( |
|
42 | + 'templateMeta' => array( |
|
43 | + 'maxColumns' => '3', |
|
44 | + 'maxColumnsBasic' => '4', |
|
45 | 45 | 'widths' => array('label' => '10', 'field' => '30'), |
46 | - ), |
|
46 | + ), |
|
47 | 47 | 'layout' => array( |
48 | - 'basic_search' => array( |
|
49 | - 'name', |
|
50 | - array('name'=>'current_user_only', 'label'=>'LBL_CURRENT_USER_FILTER', 'type'=>'bool'), |
|
48 | + 'basic_search' => array( |
|
49 | + 'name', |
|
50 | + array('name'=>'current_user_only', 'label'=>'LBL_CURRENT_USER_FILTER', 'type'=>'bool'), |
|
51 | 51 | array ('name' => 'favorites_only','label' => 'LBL_FAVORITES_FILTER','type' => 'bool',), |
52 | 52 | |
53 | 53 | |
54 | 54 | ), |
55 | - 'advanced_search' => array( |
|
56 | - 'name', |
|
57 | - 'estimated_start_date', |
|
58 | - 'estimated_end_date', |
|
59 | - 'status', |
|
60 | - 'priority', |
|
55 | + 'advanced_search' => array( |
|
56 | + 'name', |
|
57 | + 'estimated_start_date', |
|
58 | + 'estimated_end_date', |
|
59 | + 'status', |
|
60 | + 'priority', |
|
61 | 61 | |
62 | - ), |
|
63 | - ), |
|
64 | - ); |
|
62 | + ), |
|
63 | + ), |
|
64 | + ); |
|
65 | 65 | ?> |
@@ -48,7 +48,7 @@ |
||
48 | 48 | 'basic_search' => array( |
49 | 49 | 'name', |
50 | 50 | array('name'=>'current_user_only', 'label'=>'LBL_CURRENT_USER_FILTER', 'type'=>'bool'), |
51 | - array ('name' => 'favorites_only','label' => 'LBL_FAVORITES_FILTER','type' => 'bool',), |
|
51 | + array('name' => 'favorites_only', 'label' => 'LBL_FAVORITES_FILTER', 'type' => 'bool',), |
|
52 | 52 | |
53 | 53 | |
54 | 54 | ), |
@@ -51,20 +51,20 @@ |
||
51 | 51 | and favorites.parent_type = "'.$module_name.'" |
52 | 52 | and favorites.assigned_user_id = "' .$current_user->id . '") OR NOT ({0}', |
53 | 53 | 'db_field'=>array('id')), |
54 | - //Range Search Support |
|
55 | - 'range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
56 | - 'start_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
57 | - 'end_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
58 | - 'range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
59 | - 'start_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
60 | - 'end_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
54 | + //Range Search Support |
|
55 | + 'range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
56 | + 'start_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
57 | + 'end_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
58 | + 'range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
59 | + 'start_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
60 | + 'end_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
61 | 61 | |
62 | - 'range_estimated_start_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
63 | - 'start_range_estimated_start_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
64 | - 'end_range_estimated_start_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
65 | - 'range_estimated_end_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
66 | - 'start_range_estimated_end_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
67 | - 'end_range_estimated_end_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
68 | - //Range Search Support |
|
62 | + 'range_estimated_start_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
63 | + 'start_range_estimated_start_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
64 | + 'end_range_estimated_start_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
65 | + 'range_estimated_end_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
66 | + 'start_range_estimated_end_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
67 | + 'end_range_estimated_end_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
68 | + //Range Search Support |
|
69 | 69 | ); |
70 | 70 | ?> |
@@ -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. |
@@ -40,31 +40,31 @@ discard block |
||
40 | 40 | global $current_user; |
41 | 41 | $module_name = "Project"; |
42 | 42 | $searchFields['Project'] = |
43 | - array ( |
|
44 | - 'name' => array( 'query_type'=>'default'), |
|
45 | - 'current_user_only'=> array('query_type'=>'default','db_field'=>array('assigned_user_id'),'my_items'=>true, 'vname' => 'LBL_CURRENT_USER_FILTER', 'type' => 'bool'), |
|
43 | + array( |
|
44 | + 'name' => array('query_type'=>'default'), |
|
45 | + 'current_user_only'=> array('query_type'=>'default', 'db_field'=>array('assigned_user_id'), 'my_items'=>true, 'vname' => 'LBL_CURRENT_USER_FILTER', 'type' => 'bool'), |
|
46 | 46 | 'favorites_only' => array( |
47 | 47 | 'query_type'=>'format', |
48 | 48 | 'operator' => 'subquery', |
49 | 49 | 'subquery' => 'SELECT favorites.parent_id FROM favorites |
50 | 50 | WHERE favorites.deleted = 0 |
51 | 51 | and favorites.parent_type = "'.$module_name.'" |
52 | - and favorites.assigned_user_id = "' .$current_user->id . '") OR NOT ({0}', |
|
52 | + and favorites.assigned_user_id = "' .$current_user->id.'") OR NOT ({0}', |
|
53 | 53 | 'db_field'=>array('id')), |
54 | 54 | //Range Search Support |
55 | - 'range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
56 | - 'start_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
57 | - 'end_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
58 | - 'range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
59 | - 'start_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
60 | - 'end_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
55 | + 'range_date_entered' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
56 | + 'start_range_date_entered' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
57 | + 'end_range_date_entered' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
58 | + 'range_date_modified' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
59 | + 'start_range_date_modified' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
60 | + 'end_range_date_modified' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
61 | 61 | |
62 | - 'range_estimated_start_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
63 | - 'start_range_estimated_start_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
64 | - 'end_range_estimated_start_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
65 | - 'range_estimated_end_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
66 | - 'start_range_estimated_end_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
67 | - 'end_range_estimated_end_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
62 | + 'range_estimated_start_date' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
63 | + 'start_range_estimated_start_date' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
64 | + 'end_range_estimated_start_date' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
65 | + 'range_estimated_end_date' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
66 | + 'start_range_estimated_end_date' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
67 | + 'end_range_estimated_end_date' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
68 | 68 | //Range Search Support |
69 | 69 | ); |
70 | 70 | ?> |
@@ -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,176 +42,176 @@ |
||
42 | 42 | |
43 | 43 | $viewdefs ['Project'] = |
44 | 44 | array ( |
45 | - 'DetailView' => |
|
46 | - array ( |
|
45 | + 'DetailView' => |
|
46 | + array ( |
|
47 | 47 | 'templateMeta' => |
48 | 48 | array ( |
49 | - 'maxColumns' => '2', |
|
50 | - 'widths' => |
|
51 | - array ( |
|
49 | + 'maxColumns' => '2', |
|
50 | + 'widths' => |
|
51 | + array ( |
|
52 | 52 | 0 => |
53 | 53 | array ( |
54 | - 'label' => '10', |
|
55 | - 'field' => '30', |
|
54 | + 'label' => '10', |
|
55 | + 'field' => '30', |
|
56 | 56 | ), |
57 | 57 | 1 => |
58 | 58 | array ( |
59 | - 'label' => '10', |
|
60 | - 'field' => '30', |
|
59 | + 'label' => '10', |
|
60 | + 'field' => '30', |
|
61 | + ), |
|
61 | 62 | ), |
62 | - ), |
|
63 | - 'includes' => |
|
64 | - array ( |
|
63 | + 'includes' => |
|
64 | + array ( |
|
65 | 65 | 0 => |
66 | 66 | array ( |
67 | - 'file' => 'modules/Project/Project.js', |
|
67 | + 'file' => 'modules/Project/Project.js', |
|
68 | 68 | ), |
69 | 69 | 1 => |
70 | 70 | array ( |
71 | - 'file' => 'modules/Project/js/custom_project.js', |
|
71 | + 'file' => 'modules/Project/js/custom_project.js', |
|
72 | + ), |
|
72 | 73 | ), |
73 | - ), |
|
74 | - 'form' => |
|
75 | - array ( |
|
74 | + 'form' => |
|
75 | + array ( |
|
76 | 76 | 'buttons' => |
77 | 77 | array ( |
78 | - 0 => |
|
79 | - array ( |
|
78 | + 0 => |
|
79 | + array ( |
|
80 | 80 | 'customCode' => '<input title="{$APP.LBL_EDIT_BUTTON_TITLE}" accessKey="{$APP.LBL_EDIT_BUTTON_KEY}" class="button" type="submit" name="Edit" id="edit_button" value="{$APP.LBL_EDIT_BUTTON_LABEL}"onclick="{if $IS_TEMPLATE}this.form.return_module.value=\'Project\'; this.form.return_action.value=\'ProjectTemplatesDetailView\'; this.form.return_id.value=\'{$id}\'; this.form.action.value=\'ProjectTemplatesEditView\';{else}this.form.return_module.value=\'Project\'; this.form.return_action.value=\'DetailView\'; this.form.return_id.value=\'{$id}\'; this.form.action.value=\'EditView\'; {/if}"/>', |
81 | 81 | 'sugar_html' => |
82 | 82 | array ( |
83 | - 'type' => 'submit', |
|
84 | - 'value' => ' {$APP.LBL_EDIT_BUTTON_LABEL} ', |
|
85 | - 'htmlOptions' => |
|
86 | - array ( |
|
83 | + 'type' => 'submit', |
|
84 | + 'value' => ' {$APP.LBL_EDIT_BUTTON_LABEL} ', |
|
85 | + 'htmlOptions' => |
|
86 | + array ( |
|
87 | 87 | 'id' => 'edit_button', |
88 | 88 | 'class' => 'button', |
89 | 89 | 'accessKey' => '{$APP.LBL_EDIT_BUTTON_KEY}', |
90 | 90 | 'name' => 'Edit', |
91 | 91 | 'onclick' => '{if $IS_TEMPLATE}this.form.return_module.value=\'Project\'; this.form.return_action.value=\'ProjectTemplatesDetailView\'; this.form.return_id.value=\'{$id}\'; this.form.action.value=\'ProjectTemplatesEditView\';{else}this.form.return_module.value=\'Project\'; this.form.return_action.value=\'DetailView\'; this.form.return_id.value=\'{$id}\'; this.form.action.value=\'EditView\'; {/if}', |
92 | - ), |
|
92 | + ), |
|
93 | 93 | ), |
94 | - ), |
|
95 | - 1 => |
|
96 | - array ( |
|
94 | + ), |
|
95 | + 1 => |
|
96 | + array ( |
|
97 | 97 | 'customCode' => '<input title="{$APP.LBL_DELETE_BUTTON_TITLE}" accessKey="{$APP.LBL_DELETE_BUTTON_KEY}" class="button" type="button" name="Delete" id="delete_button" value="{$APP.LBL_DELETE_BUTTON_LABEL}" onclick="project_delete(this);"/>', |
98 | 98 | 'sugar_html' => |
99 | 99 | array ( |
100 | - 'type' => 'button', |
|
101 | - 'id' => 'delete_button', |
|
102 | - 'value' => '{$APP.LBL_DELETE_BUTTON_LABEL}', |
|
103 | - 'htmlOptions' => |
|
104 | - array ( |
|
100 | + 'type' => 'button', |
|
101 | + 'id' => 'delete_button', |
|
102 | + 'value' => '{$APP.LBL_DELETE_BUTTON_LABEL}', |
|
103 | + 'htmlOptions' => |
|
104 | + array ( |
|
105 | 105 | 'title' => '{$APP.LBL_DELETE_BUTTON_TITLE}', |
106 | 106 | 'accessKey' => '{$APP.LBL_DELETE_BUTTON_KEY}', |
107 | 107 | 'id' => 'delete_button', |
108 | 108 | 'class' => 'button', |
109 | 109 | 'onclick' => 'project_delete(this);', |
110 | - ), |
|
110 | + ), |
|
111 | + ), |
|
111 | 112 | ), |
112 | - ), |
|
113 | - 2 => |
|
114 | - array ( |
|
113 | + 2 => |
|
114 | + array ( |
|
115 | 115 | 'customCode' => '<input title="{$APP.LBL_DUPLICATE_BUTTON_TITLE}" accessKey="{$APP.LBL_DUPLICATE_BUTTON_KEY}" class="button" type="submit" name="Duplicate" id="duplicate_button" value="{$APP.LBL_DUPLICATE_BUTTON_LABEL}"onclick="{if $IS_TEMPLATE}this.form.return_module.value=\'Project\'; this.form.return_action.value=\'ProjectTemplatesDetailView\'; this.form.isDuplicate.value=true; this.form.action.value=\'projecttemplateseditview\'; this.form.return_id.value=\'{$id}\';{else}this.form.return_module.value=\'Project\'; this.form.return_action.value=\'DetailView\'; this.form.isDuplicate.value=true; this.form.action.value=\'EditView\'; this.form.return_id.value=\'{$id}\';{/if}""/>', |
116 | 116 | 'sugar_html' => |
117 | 117 | array ( |
118 | - 'type' => 'submit', |
|
119 | - 'value' => '{$APP.LBL_DUPLICATE_BUTTON_LABEL}', |
|
120 | - 'htmlOptions' => |
|
121 | - array ( |
|
118 | + 'type' => 'submit', |
|
119 | + 'value' => '{$APP.LBL_DUPLICATE_BUTTON_LABEL}', |
|
120 | + 'htmlOptions' => |
|
121 | + array ( |
|
122 | 122 | 'title' => '{$APP.LBL_DUPLICATE_BUTTON_TITLE}', |
123 | 123 | 'accessKey' => '{$APP.LBL_DUPLICATE_BUTTON_KEY}', |
124 | 124 | 'class' => 'button', |
125 | 125 | 'name' => 'Duplicate', |
126 | 126 | 'id' => 'duplicate_button', |
127 | 127 | 'onclick' => '{if $IS_TEMPLATE}this.form.return_module.value=\'Project\'; this.form.return_action.value=\'ProjectTemplatesDetailView\'; this.form.isDuplicate.value=true; this.form.action.value=\'projecttemplateseditview\'; this.form.return_id.value=\'{$id}\';{else}this.form.return_module.value=\'Project\'; this.form.return_action.value=\'DetailView\'; this.form.isDuplicate.value=true; this.form.action.value=\'EditView\'; this.form.return_id.value=\'{$id}\';{/if}', |
128 | - ), |
|
128 | + ), |
|
129 | 129 | ), |
130 | - ), |
|
131 | - 3 => |
|
132 | - array ( |
|
130 | + ), |
|
131 | + 3 => |
|
132 | + array ( |
|
133 | 133 | 'customCode' => '<input title="{$APP.LBL_VIEW_GANTT_TITLE}" class="button" type="button" name="view_gantt" id="view_gantt" value="{$APP.LBL_GANTT_BUTTON_LABEL}" onclick="javascript:window.location.href=\'index.php?module=Project&action=view_GanttChart&project_id={$id}\'"/>', |
134 | - ), |
|
134 | + ), |
|
135 | + ), |
|
135 | 136 | ), |
136 | - ), |
|
137 | - 'useTabs' => true, |
|
138 | - 'tabDefs' => |
|
139 | - array ( |
|
137 | + 'useTabs' => true, |
|
138 | + 'tabDefs' => |
|
139 | + array ( |
|
140 | 140 | 'LBL_PROJECT_INFORMATION' => |
141 | 141 | array ( |
142 | - 'newTab' => true, |
|
143 | - 'panelDefault' => 'expanded', |
|
142 | + 'newTab' => true, |
|
143 | + 'panelDefault' => 'expanded', |
|
144 | 144 | ), |
145 | 145 | 'LBL_PANEL_ASSIGNMENT' => |
146 | 146 | array ( |
147 | - 'newTab' => true, |
|
148 | - 'panelDefault' => 'expanded', |
|
147 | + 'newTab' => true, |
|
148 | + 'panelDefault' => 'expanded', |
|
149 | + ), |
|
149 | 150 | ), |
150 | - ), |
|
151 | 151 | ), |
152 | 152 | 'panels' => |
153 | 153 | array ( |
154 | - 'lbl_project_information' => |
|
155 | - array ( |
|
154 | + 'lbl_project_information' => |
|
155 | + array ( |
|
156 | 156 | 0 => |
157 | 157 | array ( |
158 | - 0 => 'name', |
|
159 | - 1 => 'status', |
|
158 | + 0 => 'name', |
|
159 | + 1 => 'status', |
|
160 | 160 | ), |
161 | 161 | 1 => |
162 | 162 | array ( |
163 | - 0 => |
|
164 | - array ( |
|
163 | + 0 => |
|
164 | + array ( |
|
165 | 165 | 'name' => 'estimated_start_date', |
166 | 166 | 'label' => 'LBL_DATE_START', |
167 | - ), |
|
168 | - 1 => 'priority', |
|
167 | + ), |
|
168 | + 1 => 'priority', |
|
169 | 169 | ), |
170 | 170 | 2 => |
171 | 171 | array ( |
172 | - 0 => |
|
173 | - array ( |
|
172 | + 0 => |
|
173 | + array ( |
|
174 | 174 | 'name' => 'estimated_end_date', |
175 | 175 | 'label' => 'LBL_DATE_END', |
176 | - ), |
|
177 | - 1 => '', |
|
176 | + ), |
|
177 | + 1 => '', |
|
178 | 178 | ), |
179 | 179 | 3 => |
180 | 180 | array ( |
181 | - 0 => 'description', |
|
181 | + 0 => 'description', |
|
182 | 182 | ), |
183 | - ), |
|
184 | - 'LBL_PANEL_ASSIGNMENT' => |
|
185 | - array ( |
|
183 | + ), |
|
184 | + 'LBL_PANEL_ASSIGNMENT' => |
|
185 | + array ( |
|
186 | 186 | 0 => |
187 | 187 | array ( |
188 | - 0 => |
|
189 | - array ( |
|
188 | + 0 => |
|
189 | + array ( |
|
190 | 190 | 'name' => 'assigned_user_name', |
191 | 191 | 'label' => 'LBL_ASSIGNED_TO', |
192 | - ), |
|
193 | - 1 => |
|
194 | - array ( |
|
192 | + ), |
|
193 | + 1 => |
|
194 | + array ( |
|
195 | 195 | 'name' => 'am_projecttemplates_project_1_name', |
196 | - ), |
|
196 | + ), |
|
197 | 197 | ), |
198 | 198 | 1 => |
199 | 199 | array ( |
200 | - 0 => |
|
201 | - array ( |
|
200 | + 0 => |
|
201 | + array ( |
|
202 | 202 | 'name' => 'date_entered', |
203 | 203 | 'comment' => 'Date record created', |
204 | 204 | 'label' => 'LBL_DATE_ENTERED', |
205 | - ), |
|
206 | - 1 => |
|
207 | - array ( |
|
205 | + ), |
|
206 | + 1 => |
|
207 | + array ( |
|
208 | 208 | 'name' => 'date_modified', |
209 | 209 | 'comment' => 'Date record last modified', |
210 | 210 | 'label' => 'LBL_DATE_MODIFIED', |
211 | - ), |
|
211 | + ), |
|
212 | 212 | ), |
213 | - ), |
|
213 | + ), |
|
214 | + ), |
|
214 | 215 | ), |
215 | - ), |
|
216 | 216 | ); |
217 | 217 | ?> |
@@ -41,49 +41,49 @@ discard block |
||
41 | 41 | |
42 | 42 | |
43 | 43 | $viewdefs ['Project'] = |
44 | -array ( |
|
44 | +array( |
|
45 | 45 | 'DetailView' => |
46 | - array ( |
|
46 | + array( |
|
47 | 47 | 'templateMeta' => |
48 | - array ( |
|
48 | + array( |
|
49 | 49 | 'maxColumns' => '2', |
50 | 50 | 'widths' => |
51 | - array ( |
|
51 | + array( |
|
52 | 52 | 0 => |
53 | - array ( |
|
53 | + array( |
|
54 | 54 | 'label' => '10', |
55 | 55 | 'field' => '30', |
56 | 56 | ), |
57 | 57 | 1 => |
58 | - array ( |
|
58 | + array( |
|
59 | 59 | 'label' => '10', |
60 | 60 | 'field' => '30', |
61 | 61 | ), |
62 | 62 | ), |
63 | 63 | 'includes' => |
64 | - array ( |
|
64 | + array( |
|
65 | 65 | 0 => |
66 | - array ( |
|
66 | + array( |
|
67 | 67 | 'file' => 'modules/Project/Project.js', |
68 | 68 | ), |
69 | 69 | 1 => |
70 | - array ( |
|
70 | + array( |
|
71 | 71 | 'file' => 'modules/Project/js/custom_project.js', |
72 | 72 | ), |
73 | 73 | ), |
74 | 74 | 'form' => |
75 | - array ( |
|
75 | + array( |
|
76 | 76 | 'buttons' => |
77 | - array ( |
|
77 | + array( |
|
78 | 78 | 0 => |
79 | - array ( |
|
79 | + array( |
|
80 | 80 | 'customCode' => '<input title="{$APP.LBL_EDIT_BUTTON_TITLE}" accessKey="{$APP.LBL_EDIT_BUTTON_KEY}" class="button" type="submit" name="Edit" id="edit_button" value="{$APP.LBL_EDIT_BUTTON_LABEL}"onclick="{if $IS_TEMPLATE}this.form.return_module.value=\'Project\'; this.form.return_action.value=\'ProjectTemplatesDetailView\'; this.form.return_id.value=\'{$id}\'; this.form.action.value=\'ProjectTemplatesEditView\';{else}this.form.return_module.value=\'Project\'; this.form.return_action.value=\'DetailView\'; this.form.return_id.value=\'{$id}\'; this.form.action.value=\'EditView\'; {/if}"/>', |
81 | 81 | 'sugar_html' => |
82 | - array ( |
|
82 | + array( |
|
83 | 83 | 'type' => 'submit', |
84 | 84 | 'value' => ' {$APP.LBL_EDIT_BUTTON_LABEL} ', |
85 | 85 | 'htmlOptions' => |
86 | - array ( |
|
86 | + array( |
|
87 | 87 | 'id' => 'edit_button', |
88 | 88 | 'class' => 'button', |
89 | 89 | 'accessKey' => '{$APP.LBL_EDIT_BUTTON_KEY}', |
@@ -93,15 +93,15 @@ discard block |
||
93 | 93 | ), |
94 | 94 | ), |
95 | 95 | 1 => |
96 | - array ( |
|
96 | + array( |
|
97 | 97 | 'customCode' => '<input title="{$APP.LBL_DELETE_BUTTON_TITLE}" accessKey="{$APP.LBL_DELETE_BUTTON_KEY}" class="button" type="button" name="Delete" id="delete_button" value="{$APP.LBL_DELETE_BUTTON_LABEL}" onclick="project_delete(this);"/>', |
98 | 98 | 'sugar_html' => |
99 | - array ( |
|
99 | + array( |
|
100 | 100 | 'type' => 'button', |
101 | 101 | 'id' => 'delete_button', |
102 | 102 | 'value' => '{$APP.LBL_DELETE_BUTTON_LABEL}', |
103 | 103 | 'htmlOptions' => |
104 | - array ( |
|
104 | + array( |
|
105 | 105 | 'title' => '{$APP.LBL_DELETE_BUTTON_TITLE}', |
106 | 106 | 'accessKey' => '{$APP.LBL_DELETE_BUTTON_KEY}', |
107 | 107 | 'id' => 'delete_button', |
@@ -111,14 +111,14 @@ discard block |
||
111 | 111 | ), |
112 | 112 | ), |
113 | 113 | 2 => |
114 | - array ( |
|
114 | + array( |
|
115 | 115 | 'customCode' => '<input title="{$APP.LBL_DUPLICATE_BUTTON_TITLE}" accessKey="{$APP.LBL_DUPLICATE_BUTTON_KEY}" class="button" type="submit" name="Duplicate" id="duplicate_button" value="{$APP.LBL_DUPLICATE_BUTTON_LABEL}"onclick="{if $IS_TEMPLATE}this.form.return_module.value=\'Project\'; this.form.return_action.value=\'ProjectTemplatesDetailView\'; this.form.isDuplicate.value=true; this.form.action.value=\'projecttemplateseditview\'; this.form.return_id.value=\'{$id}\';{else}this.form.return_module.value=\'Project\'; this.form.return_action.value=\'DetailView\'; this.form.isDuplicate.value=true; this.form.action.value=\'EditView\'; this.form.return_id.value=\'{$id}\';{/if}""/>', |
116 | 116 | 'sugar_html' => |
117 | - array ( |
|
117 | + array( |
|
118 | 118 | 'type' => 'submit', |
119 | 119 | 'value' => '{$APP.LBL_DUPLICATE_BUTTON_LABEL}', |
120 | 120 | 'htmlOptions' => |
121 | - array ( |
|
121 | + array( |
|
122 | 122 | 'title' => '{$APP.LBL_DUPLICATE_BUTTON_TITLE}', |
123 | 123 | 'accessKey' => '{$APP.LBL_DUPLICATE_BUTTON_KEY}', |
124 | 124 | 'class' => 'button', |
@@ -129,82 +129,82 @@ discard block |
||
129 | 129 | ), |
130 | 130 | ), |
131 | 131 | 3 => |
132 | - array ( |
|
132 | + array( |
|
133 | 133 | 'customCode' => '<input title="{$APP.LBL_VIEW_GANTT_TITLE}" class="button" type="button" name="view_gantt" id="view_gantt" value="{$APP.LBL_GANTT_BUTTON_LABEL}" onclick="javascript:window.location.href=\'index.php?module=Project&action=view_GanttChart&project_id={$id}\'"/>', |
134 | 134 | ), |
135 | 135 | ), |
136 | 136 | ), |
137 | 137 | 'useTabs' => true, |
138 | 138 | 'tabDefs' => |
139 | - array ( |
|
139 | + array( |
|
140 | 140 | 'LBL_PROJECT_INFORMATION' => |
141 | - array ( |
|
141 | + array( |
|
142 | 142 | 'newTab' => true, |
143 | 143 | 'panelDefault' => 'expanded', |
144 | 144 | ), |
145 | 145 | 'LBL_PANEL_ASSIGNMENT' => |
146 | - array ( |
|
146 | + array( |
|
147 | 147 | 'newTab' => true, |
148 | 148 | 'panelDefault' => 'expanded', |
149 | 149 | ), |
150 | 150 | ), |
151 | 151 | ), |
152 | 152 | 'panels' => |
153 | - array ( |
|
153 | + array( |
|
154 | 154 | 'lbl_project_information' => |
155 | - array ( |
|
155 | + array( |
|
156 | 156 | 0 => |
157 | - array ( |
|
157 | + array( |
|
158 | 158 | 0 => 'name', |
159 | 159 | 1 => 'status', |
160 | 160 | ), |
161 | 161 | 1 => |
162 | - array ( |
|
162 | + array( |
|
163 | 163 | 0 => |
164 | - array ( |
|
164 | + array( |
|
165 | 165 | 'name' => 'estimated_start_date', |
166 | 166 | 'label' => 'LBL_DATE_START', |
167 | 167 | ), |
168 | 168 | 1 => 'priority', |
169 | 169 | ), |
170 | 170 | 2 => |
171 | - array ( |
|
171 | + array( |
|
172 | 172 | 0 => |
173 | - array ( |
|
173 | + array( |
|
174 | 174 | 'name' => 'estimated_end_date', |
175 | 175 | 'label' => 'LBL_DATE_END', |
176 | 176 | ), |
177 | 177 | 1 => '', |
178 | 178 | ), |
179 | 179 | 3 => |
180 | - array ( |
|
180 | + array( |
|
181 | 181 | 0 => 'description', |
182 | 182 | ), |
183 | 183 | ), |
184 | 184 | 'LBL_PANEL_ASSIGNMENT' => |
185 | - array ( |
|
185 | + array( |
|
186 | 186 | 0 => |
187 | - array ( |
|
187 | + array( |
|
188 | 188 | 0 => |
189 | - array ( |
|
189 | + array( |
|
190 | 190 | 'name' => 'assigned_user_name', |
191 | 191 | 'label' => 'LBL_ASSIGNED_TO', |
192 | 192 | ), |
193 | 193 | 1 => |
194 | - array ( |
|
194 | + array( |
|
195 | 195 | 'name' => 'am_projecttemplates_project_1_name', |
196 | 196 | ), |
197 | 197 | ), |
198 | 198 | 1 => |
199 | - array ( |
|
199 | + array( |
|
200 | 200 | 0 => |
201 | - array ( |
|
201 | + array( |
|
202 | 202 | 'name' => 'date_entered', |
203 | 203 | 'comment' => 'Date record created', |
204 | 204 | 'label' => 'LBL_DATE_ENTERED', |
205 | 205 | ), |
206 | 206 | 1 => |
207 | - array ( |
|
207 | + array( |
|
208 | 208 | 'name' => 'date_modified', |
209 | 209 | 'comment' => 'Date record last modified', |
210 | 210 | 'label' => 'LBL_DATE_MODIFIED', |
@@ -40,34 +40,34 @@ |
||
40 | 40 | |
41 | 41 | |
42 | 42 | $viewdefs['Project']['QuickCreate'] = array( |
43 | - 'templateMeta' => array('maxColumns' => '2', |
|
43 | + 'templateMeta' => array('maxColumns' => '2', |
|
44 | 44 | 'widths' => array( |
45 | 45 | array('label' => '10', 'field' => '30'), |
46 | 46 | array('label' => '10', 'field' => '30') |
47 | 47 | ), |
48 | - ), |
|
48 | + ), |
|
49 | 49 | 'panels' => |
50 | 50 | |
51 | 51 | array ( |
52 | 52 | |
53 | - array ( |
|
53 | + array ( |
|
54 | 54 | 'name', |
55 | 55 | 'status' |
56 | - ), |
|
56 | + ), |
|
57 | 57 | |
58 | - array ( |
|
58 | + array ( |
|
59 | 59 | 'estimated_start_date', |
60 | 60 | 'estimated_end_date' |
61 | - ), |
|
61 | + ), |
|
62 | 62 | |
63 | - array('priority',), |
|
64 | - array('assigned_user_name', |
|
65 | - ), |
|
66 | - array ( |
|
63 | + array('priority',), |
|
64 | + array('assigned_user_name', |
|
65 | + ), |
|
66 | + array ( |
|
67 | 67 | array ( |
68 | - 'name' => 'description', |
|
68 | + 'name' => 'description', |
|
69 | + ), |
|
69 | 70 | ), |
70 | - ), |
|
71 | 71 | |
72 | 72 | ), |
73 | 73 |
@@ -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. |
@@ -48,14 +48,14 @@ discard block |
||
48 | 48 | ), |
49 | 49 | 'panels' => |
50 | 50 | |
51 | -array ( |
|
51 | +array( |
|
52 | 52 | |
53 | - array ( |
|
53 | + array( |
|
54 | 54 | 'name', |
55 | 55 | 'status' |
56 | 56 | ), |
57 | 57 | |
58 | - array ( |
|
58 | + array( |
|
59 | 59 | 'estimated_start_date', |
60 | 60 | 'estimated_end_date' |
61 | 61 | ), |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | array('priority',), |
64 | 64 | array('assigned_user_name', |
65 | 65 | ), |
66 | - array ( |
|
67 | - array ( |
|
66 | + array( |
|
67 | + array( |
|
68 | 68 | 'name' => 'description', |
69 | 69 | ), |
70 | 70 | ), |
@@ -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,13 +38,13 @@ |
||
38 | 38 | ********************************************************************************/ |
39 | 39 | |
40 | 40 | |
41 | - $metafiles['Project'] = array( |
|
42 | - 'detailviewdefs' => 'modules/Project/metadata/detailviewdefs.php', |
|
43 | - 'editviewdefs' => 'modules/Project/metadata/editviewdefs.php', |
|
44 | - 'listviewdefs' => 'modules/Project/metadata/listviewdefs.php', |
|
45 | - 'searchdefs' => 'modules/Project/metadata/searchdefs.php', |
|
46 | - 'popupdefs' => 'modules/Project/metadata/popupdefs.php', |
|
47 | - 'searchfields' => 'modules/Project/metadata/SearchFields.php', |
|
41 | + $metafiles['Project'] = array( |
|
42 | + 'detailviewdefs' => 'modules/Project/metadata/detailviewdefs.php', |
|
43 | + 'editviewdefs' => 'modules/Project/metadata/editviewdefs.php', |
|
44 | + 'listviewdefs' => 'modules/Project/metadata/listviewdefs.php', |
|
45 | + 'searchdefs' => 'modules/Project/metadata/searchdefs.php', |
|
46 | + 'popupdefs' => 'modules/Project/metadata/popupdefs.php', |
|
47 | + 'searchfields' => 'modules/Project/metadata/SearchFields.php', |
|
48 | 48 | |
49 | - ); |
|
49 | + ); |
|
50 | 50 | ?> |
@@ -43,48 +43,48 @@ |
||
43 | 43 | |
44 | 44 | $listViewDefs ['Project'] = |
45 | 45 | array ( |
46 | - 'NAME' => |
|
47 | - array ( |
|
46 | + 'NAME' => |
|
47 | + array ( |
|
48 | 48 | 'width' => '25%', |
49 | 49 | 'label' => 'LBL_LIST_NAME', |
50 | 50 | 'link' => true, |
51 | 51 | 'default' => true, |
52 | - ), |
|
53 | - 'PRIORITY' => |
|
54 | - array ( |
|
52 | + ), |
|
53 | + 'PRIORITY' => |
|
54 | + array ( |
|
55 | 55 | 'type' => 'enum', |
56 | 56 | 'label' => 'LBL_PRIORITY', |
57 | 57 | 'width' => '10%', |
58 | 58 | 'default' => true, |
59 | - ), |
|
60 | - 'STATUS' => |
|
61 | - array ( |
|
59 | + ), |
|
60 | + 'STATUS' => |
|
61 | + array ( |
|
62 | 62 | 'width' => '10%', |
63 | 63 | 'label' => 'LBL_STATUS', |
64 | 64 | 'link' => false, |
65 | 65 | 'default' => true, |
66 | - ), |
|
67 | - 'ESTIMATED_START_DATE' => |
|
68 | - array ( |
|
66 | + ), |
|
67 | + 'ESTIMATED_START_DATE' => |
|
68 | + array ( |
|
69 | 69 | 'width' => '10%', |
70 | 70 | 'label' => 'LBL_DATE_START', |
71 | 71 | 'link' => false, |
72 | 72 | 'default' => true, |
73 | - ), |
|
74 | - 'ASSIGNED_USER_NAME' => |
|
75 | - array ( |
|
73 | + ), |
|
74 | + 'ASSIGNED_USER_NAME' => |
|
75 | + array ( |
|
76 | 76 | 'width' => '10%', |
77 | 77 | 'label' => 'LBL_LIST_ASSIGNED_USER_ID', |
78 | 78 | 'module' => 'Employees', |
79 | 79 | 'id' => 'ASSIGNED_USER_ID', |
80 | 80 | 'default' => true, |
81 | - ), |
|
82 | - 'ESTIMATED_END_DATE' => |
|
83 | - array ( |
|
81 | + ), |
|
82 | + 'ESTIMATED_END_DATE' => |
|
83 | + array ( |
|
84 | 84 | 'width' => '10%', |
85 | 85 | 'label' => 'LBL_DATE_END', |
86 | 86 | 'link' => false, |
87 | 87 | 'default' => true, |
88 | - ), |
|
88 | + ), |
|
89 | 89 | ); |
90 | 90 | ?> |
@@ -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,37 +42,37 @@ discard block |
||
42 | 42 | |
43 | 43 | |
44 | 44 | $listViewDefs ['Project'] = |
45 | -array ( |
|
45 | +array( |
|
46 | 46 | 'NAME' => |
47 | - array ( |
|
47 | + array( |
|
48 | 48 | 'width' => '25%', |
49 | 49 | 'label' => 'LBL_LIST_NAME', |
50 | 50 | 'link' => true, |
51 | 51 | 'default' => true, |
52 | 52 | ), |
53 | 53 | 'PRIORITY' => |
54 | - array ( |
|
54 | + array( |
|
55 | 55 | 'type' => 'enum', |
56 | 56 | 'label' => 'LBL_PRIORITY', |
57 | 57 | 'width' => '10%', |
58 | 58 | 'default' => true, |
59 | 59 | ), |
60 | 60 | 'STATUS' => |
61 | - array ( |
|
61 | + array( |
|
62 | 62 | 'width' => '10%', |
63 | 63 | 'label' => 'LBL_STATUS', |
64 | 64 | 'link' => false, |
65 | 65 | 'default' => true, |
66 | 66 | ), |
67 | 67 | 'ESTIMATED_START_DATE' => |
68 | - array ( |
|
68 | + array( |
|
69 | 69 | 'width' => '10%', |
70 | 70 | 'label' => 'LBL_DATE_START', |
71 | 71 | 'link' => false, |
72 | 72 | 'default' => true, |
73 | 73 | ), |
74 | 74 | 'ASSIGNED_USER_NAME' => |
75 | - array ( |
|
75 | + array( |
|
76 | 76 | 'width' => '10%', |
77 | 77 | 'label' => 'LBL_LIST_ASSIGNED_USER_ID', |
78 | 78 | 'module' => 'Employees', |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | 'default' => true, |
81 | 81 | ), |
82 | 82 | 'ESTIMATED_END_DATE' => |
83 | - array ( |
|
83 | + array( |
|
84 | 84 | 'width' => '10%', |
85 | 85 | 'label' => 'LBL_DATE_END', |
86 | 86 | 'link' => false, |
@@ -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. |
@@ -49,8 +49,8 @@ |
||
49 | 49 | global $app_strings; |
50 | 50 | |
51 | 51 | $dashletMeta['SugarFeedDashlet'] = array('module' => 'SugarFeed', |
52 | - 'title' => translate('LBL_HOMEPAGE_TITLE', 'SugarFeed'), |
|
53 | - 'description' => 'A customizable view into Sugar_Feed', |
|
54 | - 'icon' => 'themes/default/images/icon_SugarFeed_32.gif', |
|
55 | - 'dynamic_hide' => true, |
|
56 | - 'category' => 'Tools'); |
|
57 | 52 | \ No newline at end of file |
53 | + 'title' => translate('LBL_HOMEPAGE_TITLE', 'SugarFeed'), |
|
54 | + 'description' => 'A customizable view into Sugar_Feed', |
|
55 | + 'icon' => 'themes/default/images/icon_SugarFeed_32.gif', |
|
56 | + 'dynamic_hide' => true, |
|
57 | + 'category' => 'Tools'); |
|
58 | 58 | \ No newline at end of file |
@@ -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. |
@@ -53,21 +53,21 @@ discard block |
||
53 | 53 | |
54 | 54 | |
55 | 55 | function SugarFeedDashlet($id, $def = null) { |
56 | - global $current_user, $app_strings, $app_list_strings; |
|
56 | + global $current_user, $app_strings, $app_list_strings; |
|
57 | 57 | |
58 | - require_once('modules/SugarFeed/metadata/dashletviewdefs.php'); |
|
59 | - $this->myItemsOnly = false; |
|
58 | + require_once('modules/SugarFeed/metadata/dashletviewdefs.php'); |
|
59 | + $this->myItemsOnly = false; |
|
60 | 60 | parent::DashletGeneric($id, $def); |
61 | - $this->myItemsOnly = false; |
|
62 | - $this->isConfigurable = true; |
|
63 | - $this->hasScript = true; |
|
64 | - $pattern = array(); |
|
65 | - $pattern[] = "/-/"; |
|
66 | - $pattern[] = "/[0-9]/"; |
|
67 | - $replacements = array(); |
|
68 | - $replacements[] = ''; |
|
69 | - $replacements[] = ''; |
|
70 | - $this->idjs = preg_replace($pattern,$replacements,$this->id); |
|
61 | + $this->myItemsOnly = false; |
|
62 | + $this->isConfigurable = true; |
|
63 | + $this->hasScript = true; |
|
64 | + $pattern = array(); |
|
65 | + $pattern[] = "/-/"; |
|
66 | + $pattern[] = "/[0-9]/"; |
|
67 | + $replacements = array(); |
|
68 | + $replacements[] = ''; |
|
69 | + $replacements[] = ''; |
|
70 | + $this->idjs = preg_replace($pattern,$replacements,$this->id); |
|
71 | 71 | // Add in some default categories. |
72 | 72 | $this->categories['ALL'] = translate('LBL_ALL','SugarFeed'); |
73 | 73 | // Need to get the rest of the active SugarFeed modules |
@@ -93,9 +93,9 @@ discard block |
||
93 | 93 | |
94 | 94 | |
95 | 95 | if(empty($def['title'])) $this->title = translate('LBL_HOMEPAGE_TITLE', 'SugarFeed'); |
96 | - if(!empty($def['rows']))$this->displayRows = $def['rows']; |
|
97 | - if(!empty($def['categories']))$this->selectedCategories = $def['categories']; |
|
98 | - if(!empty($def['userfeed_created'])) $this->userfeed_created = $def['userfeed_created']; |
|
96 | + if(!empty($def['rows']))$this->displayRows = $def['rows']; |
|
97 | + if(!empty($def['categories']))$this->selectedCategories = $def['categories']; |
|
98 | + if(!empty($def['userfeed_created'])) $this->userfeed_created = $def['userfeed_created']; |
|
99 | 99 | $this->searchFields = $dashletData['SugarFeedDashlet']['searchFields']; |
100 | 100 | $this->columns = $dashletData['SugarFeedDashlet']['columns']; |
101 | 101 | |
@@ -110,20 +110,20 @@ discard block |
||
110 | 110 | $this->categories["Twitter"] = "Twitter"; |
111 | 111 | } |
112 | 112 | |
113 | - $catCount = count($this->categories); |
|
114 | - ACLController::filterModuleList($this->categories, false); |
|
115 | - if(count($this->categories) < $catCount){ |
|
116 | - if(!empty($this->selectedCategories)){ |
|
117 | - ACLController::filterModuleList($this->selectedCategories, true); |
|
118 | - }else{ |
|
119 | - $this->selectedCategories = array_keys($this->categories); |
|
120 | - unset($this->selectedCategories[0]); |
|
121 | - } |
|
122 | - } |
|
113 | + $catCount = count($this->categories); |
|
114 | + ACLController::filterModuleList($this->categories, false); |
|
115 | + if(count($this->categories) < $catCount){ |
|
116 | + if(!empty($this->selectedCategories)){ |
|
117 | + ACLController::filterModuleList($this->selectedCategories, true); |
|
118 | + }else{ |
|
119 | + $this->selectedCategories = array_keys($this->categories); |
|
120 | + unset($this->selectedCategories[0]); |
|
121 | + } |
|
122 | + } |
|
123 | 123 | $this->seedBean = new SugarFeed(); |
124 | 124 | } |
125 | 125 | |
126 | - function process($lvsParams = array()) { |
|
126 | + function process($lvsParams = array()) { |
|
127 | 127 | global $current_user; |
128 | 128 | |
129 | 129 | $currentSearchFields = array(); |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | |
140 | 140 | $this->lvs->export = false; |
141 | 141 | $this->lvs->multiSelect = false; |
142 | - $this->lvs->quickViewLinks = false; |
|
142 | + $this->lvs->quickViewLinks = false; |
|
143 | 143 | // columns |
144 | 144 | foreach($this->columns as $name => $val) { |
145 | 145 | if(!empty($val['default']) && $val['default']) { |
@@ -170,11 +170,11 @@ discard block |
||
170 | 170 | $owner_modules = array(); |
171 | 171 | $regular_modules = array(); |
172 | 172 | foreach($mod_list as $module => $ignore) { |
173 | - // Handle the UserFeed differently |
|
174 | - if ( $module == 'UserFeed') { |
|
175 | - $regular_modules[] = 'UserFeed'; |
|
176 | - continue; |
|
177 | - } |
|
173 | + // Handle the UserFeed differently |
|
174 | + if ( $module == 'UserFeed') { |
|
175 | + $regular_modules[] = 'UserFeed'; |
|
176 | + continue; |
|
177 | + } |
|
178 | 178 | if($module == 'Facebook'){ |
179 | 179 | $regular_modules[] = "Facebook"; |
180 | 180 | continue; |
@@ -187,12 +187,12 @@ discard block |
||
187 | 187 | if ( in_array($module,$this->externalAPIList) ) { |
188 | 188 | $external_modules[] = $module; |
189 | 189 | } |
190 | - if (ACLAction::getUserAccessLevel($current_user->id,$module,'view') <= ACL_ALLOW_NONE ) { |
|
191 | - // Not enough access to view any records, don't add it to any lists |
|
192 | - continue; |
|
193 | - } |
|
194 | - if ( ACLAction::getUserAccessLevel($current_user->id,$module,'view') == ACL_ALLOW_OWNER ) { |
|
195 | - $owner_modules[] = $module; |
|
190 | + if (ACLAction::getUserAccessLevel($current_user->id,$module,'view') <= ACL_ALLOW_NONE ) { |
|
191 | + // Not enough access to view any records, don't add it to any lists |
|
192 | + continue; |
|
193 | + } |
|
194 | + if ( ACLAction::getUserAccessLevel($current_user->id,$module,'view') == ACL_ALLOW_OWNER ) { |
|
195 | + $owner_modules[] = $module; |
|
196 | 196 | } else { |
197 | 197 | $regular_modules[] = $module; |
198 | 198 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | |
204 | 204 | if(!empty($this->displayTpl)) |
205 | 205 | { |
206 | - //MFH BUG #14296 |
|
206 | + //MFH BUG #14296 |
|
207 | 207 | $where = ''; |
208 | 208 | if(!empty($whereArray)){ |
209 | 209 | $where = '(' . implode(') AND (', $whereArray) . ')'; |
@@ -213,35 +213,35 @@ discard block |
||
213 | 213 | $additional_where = ''; |
214 | 214 | |
215 | 215 | |
216 | - $module_limiter = " sugarfeed.related_module in ('" . implode("','", $regular_modules) . "')"; |
|
216 | + $module_limiter = " sugarfeed.related_module in ('" . implode("','", $regular_modules) . "')"; |
|
217 | 217 | |
218 | - if( is_admin($GLOBALS['current_user'] ) ) |
|
218 | + if( is_admin($GLOBALS['current_user'] ) ) |
|
219 | 219 | { |
220 | 220 | $all_modules = array_merge($regular_modules, $owner_modules, $admin_modules); |
221 | 221 | $module_limiter = " sugarfeed.related_module in ('" . implode("','", $all_modules) . "')"; |
222 | 222 | } |
223 | 223 | else if ( count($owner_modules) > 0 |
224 | - ) { |
|
224 | + ) { |
|
225 | 225 | $module_limiter = " ((sugarfeed.related_module IN ('".implode("','", $regular_modules)."') " |
226 | - .") "; |
|
227 | - if ( count($owner_modules) > 0 ) { |
|
228 | - $module_limiter .= "OR (sugarfeed.related_module IN('".implode("','", $owner_modules)."') AND sugarfeed.assigned_user_id = '".$current_user->id."' " |
|
229 | - .") "; |
|
230 | - } |
|
231 | - $module_limiter .= ")"; |
|
226 | + .") "; |
|
227 | + if ( count($owner_modules) > 0 ) { |
|
228 | + $module_limiter .= "OR (sugarfeed.related_module IN('".implode("','", $owner_modules)."') AND sugarfeed.assigned_user_id = '".$current_user->id."' " |
|
229 | + .") "; |
|
230 | + } |
|
231 | + $module_limiter .= ")"; |
|
232 | 232 | } |
233 | - if(!empty($where)) { $where .= ' AND '; } |
|
233 | + if(!empty($where)) { $where .= ' AND '; } |
|
234 | 234 | |
235 | 235 | |
236 | - $where .= $module_limiter; |
|
236 | + $where .= $module_limiter; |
|
237 | 237 | |
238 | 238 | $this->lvs->setup($this->seedBean, $this->displayTpl, $where , $lvsParams, 0, $this->displayRows, |
239 | - array('name', |
|
239 | + array('name', |
|
240 | 240 | 'description', |
241 | 241 | 'date_entered', |
242 | 242 | 'created_by', |
243 | 243 | /* BEGIN - SECURITY GROUPS */ |
244 | - //related_module now included but keep this here just in case |
|
244 | + //related_module now included but keep this here just in case |
|
245 | 245 | 'related_module', |
246 | 246 | 'related_id', |
247 | 247 | /* END - SECURITY GROUPS */ |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | |
278 | 278 | // assign a baseURL w/ the action set as DisplayDashlet |
279 | 279 | foreach($this->lvs->data['pageData']['urls'] as $type => $url) { |
280 | - // awu Replacing action=DisplayDashlet with action=DynamicAction&DynamicAction=DisplayDashlet |
|
280 | + // awu Replacing action=DisplayDashlet with action=DynamicAction&DynamicAction=DisplayDashlet |
|
281 | 281 | $this->lvs->data['pageData']['urls'][$type] = $url.'&action=DynamicAction&DynamicAction=displayDashlet'; |
282 | 282 | if($type != 'orderBy') |
283 | 283 | $this->lvs->data['pageData']['urls'][$type] = $url.'&action=DynamicAction&DynamicAction=displayDashlet&sugar_body_only=1&id=' . $this->id; |
@@ -335,58 +335,58 @@ discard block |
||
335 | 335 | $this->lvs->data['data'] = $resortQueue; |
336 | 336 | } |
337 | 337 | |
338 | - function deleteUserFeed() { |
|
339 | - if(!empty($_REQUEST['record'])) { |
|
340 | - $feed = new SugarFeed(); |
|
341 | - $feed->retrieve($_REQUEST['record']); |
|
342 | - if(is_admin($GLOBALS['current_user']) || $feed->created_by == $GLOBALS['current_user']->id){ |
|
343 | - $feed->mark_deleted($_REQUEST['record']); |
|
338 | + function deleteUserFeed() { |
|
339 | + if(!empty($_REQUEST['record'])) { |
|
340 | + $feed = new SugarFeed(); |
|
341 | + $feed->retrieve($_REQUEST['record']); |
|
342 | + if(is_admin($GLOBALS['current_user']) || $feed->created_by == $GLOBALS['current_user']->id){ |
|
343 | + $feed->mark_deleted($_REQUEST['record']); |
|
344 | 344 | |
345 | - } |
|
345 | + } |
|
346 | 346 | } |
347 | 347 | } |
348 | - function pushUserFeed() { |
|
349 | - if(!empty($_REQUEST['text']) || (!empty($_REQUEST['link_url']) && !empty($_REQUEST['link_type']))) { |
|
350 | - $text = htmlspecialchars($_REQUEST['text']); |
|
351 | - //allow for bold and italic user tags |
|
352 | - $text = preg_replace('/&lt;(\/*[bi])&gt;/i','<$1>', $text); |
|
348 | + function pushUserFeed() { |
|
349 | + if(!empty($_REQUEST['text']) || (!empty($_REQUEST['link_url']) && !empty($_REQUEST['link_type']))) { |
|
350 | + $text = htmlspecialchars($_REQUEST['text']); |
|
351 | + //allow for bold and italic user tags |
|
352 | + $text = preg_replace('/&lt;(\/*[bi])&gt;/i','<$1>', $text); |
|
353 | 353 | SugarFeed::pushFeed($text, 'UserFeed', $GLOBALS['current_user']->id, |
354 | - $GLOBALS['current_user']->id, |
|
354 | + $GLOBALS['current_user']->id, |
|
355 | 355 | $_REQUEST['link_type'], $_REQUEST['link_url'] |
356 | 356 | ); |
357 | 357 | } |
358 | 358 | |
359 | 359 | } |
360 | 360 | |
361 | - function pushUserFeedReply( ) { |
|
362 | - if(!empty($_REQUEST['text'])&&!empty($_REQUEST['parentFeed'])) { |
|
363 | - $text = htmlspecialchars($_REQUEST['text']); |
|
364 | - //allow for bold and italic user tags |
|
365 | - $text = preg_replace('/&lt;(\/*[bi])&gt;/i','<$1>', $text); |
|
361 | + function pushUserFeedReply( ) { |
|
362 | + if(!empty($_REQUEST['text'])&&!empty($_REQUEST['parentFeed'])) { |
|
363 | + $text = htmlspecialchars($_REQUEST['text']); |
|
364 | + //allow for bold and italic user tags |
|
365 | + $text = preg_replace('/&lt;(\/*[bi])&gt;/i','<$1>', $text); |
|
366 | 366 | SugarFeed::pushFeed($text, 'SugarFeed', $_REQUEST['parentFeed'], |
367 | - $GLOBALS['current_user']->id, |
|
367 | + $GLOBALS['current_user']->id, |
|
368 | 368 | '', '' |
369 | 369 | ); |
370 | 370 | } |
371 | 371 | |
372 | 372 | } |
373 | 373 | |
374 | - function displayOptions() { |
|
374 | + function displayOptions() { |
|
375 | 375 | global $app_strings; |
376 | 376 | global $app_list_strings; |
377 | 377 | $ss = new Sugar_Smarty(); |
378 | 378 | $ss->assign('titleLBL', translate('LBL_TITLE', 'SugarFeed')); |
379 | - $ss->assign('categoriesLBL', translate('LBL_CATEGORIES', 'SugarFeed')); |
|
380 | - $ss->assign('autenticationPendingLBL', translate('LBL_AUTHENTICATION_PENDING', 'SugarFeed')); |
|
379 | + $ss->assign('categoriesLBL', translate('LBL_CATEGORIES', 'SugarFeed')); |
|
380 | + $ss->assign('autenticationPendingLBL', translate('LBL_AUTHENTICATION_PENDING', 'SugarFeed')); |
|
381 | 381 | $ss->assign('rowsLBL', translate('LBL_ROWS', 'SugarFeed')); |
382 | 382 | $ss->assign('saveLBL', $app_strings['LBL_SAVE_BUTTON_LABEL']); |
383 | 383 | $ss->assign('clearLBL', $app_strings['LBL_CLEAR_BUTTON_LABEL']); |
384 | 384 | $ss->assign('title', $this->title); |
385 | - $ss->assign('categories', $this->categories); |
|
385 | + $ss->assign('categories', $this->categories); |
|
386 | 386 | if ( empty($this->selectedCategories) ) { |
387 | 387 | $this->selectedCategories['ALL'] = 'ALL'; |
388 | 388 | } |
389 | - $ss->assign('selectedCategories', $this->selectedCategories); |
|
389 | + $ss->assign('selectedCategories', $this->selectedCategories); |
|
390 | 390 | $ss->assign('rows', $this->displayRows); |
391 | 391 | $externalApis = array(); |
392 | 392 | foreach ( $this->externalAPIList as $apiObj => $apiName ) { |
@@ -399,58 +399,58 @@ discard block |
||
399 | 399 | $ss->assign('authenticateLBL', translate('LBL_AUTHENTICATE', 'SugarFeed')); |
400 | 400 | $ss->assign('id', $this->id); |
401 | 401 | if($this->isAutoRefreshable()) { |
402 | - $ss->assign('isRefreshable', true); |
|
403 | - $ss->assign('autoRefresh', $GLOBALS['app_strings']['LBL_DASHLET_CONFIGURE_AUTOREFRESH']); |
|
404 | - $ss->assign('autoRefreshOptions', $this->getAutoRefreshOptions()); |
|
405 | - $ss->assign('autoRefreshSelect', $this->autoRefresh); |
|
406 | - } |
|
402 | + $ss->assign('isRefreshable', true); |
|
403 | + $ss->assign('autoRefresh', $GLOBALS['app_strings']['LBL_DASHLET_CONFIGURE_AUTOREFRESH']); |
|
404 | + $ss->assign('autoRefreshOptions', $this->getAutoRefreshOptions()); |
|
405 | + $ss->assign('autoRefreshSelect', $this->autoRefresh); |
|
406 | + } |
|
407 | 407 | |
408 | 408 | return $ss->fetch('custom/modules/SugarFeed/Dashlets/SugarFeedDashlet/Options.tpl'); |
409 | 409 | } |
410 | 410 | |
411 | - /** |
|
412 | - * creats the values |
|
413 | - * @return |
|
414 | - * @param $req Object |
|
415 | - */ |
|
416 | - function saveOptions($req) { |
|
411 | + /** |
|
412 | + * creats the values |
|
413 | + * @return |
|
414 | + * @param $req Object |
|
415 | + */ |
|
416 | + function saveOptions($req) { |
|
417 | 417 | global $sugar_config, $timedate, $current_user, $theme; |
418 | 418 | $options = array(); |
419 | 419 | $options['title'] = $req['title']; |
420 | - $rows = intval($_REQUEST['rows']); |
|
420 | + $rows = intval($_REQUEST['rows']); |
|
421 | 421 | if($rows <= 0) { |
422 | 422 | $rows = 15; |
423 | 423 | } |
424 | - if($rows > 100){ |
|
425 | - $rows = 100; |
|
426 | - } |
|
424 | + if($rows > 100){ |
|
425 | + $rows = 100; |
|
426 | + } |
|
427 | 427 | if ( isset($req['autoRefresh']) ) |
428 | 428 | $options['autoRefresh'] = $req['autoRefresh']; |
429 | 429 | $options['rows'] = $rows; |
430 | - $options['categories'] = $req['categories']; |
|
431 | - foreach($options['categories'] as $cat){ |
|
432 | - if($cat == 'ALL'){ |
|
433 | - unset($options['categories']); |
|
434 | - } |
|
435 | - } |
|
430 | + $options['categories'] = $req['categories']; |
|
431 | + foreach($options['categories'] as $cat){ |
|
432 | + if($cat == 'ALL'){ |
|
433 | + unset($options['categories']); |
|
434 | + } |
|
435 | + } |
|
436 | 436 | |
437 | 437 | |
438 | 438 | return $options; |
439 | 439 | } |
440 | 440 | |
441 | 441 | |
442 | - function sugarFeedDisplayScript() { |
|
443 | - // Forces the quicksearch to reload anytime the dashlet gets refreshed |
|
444 | - return '<script type="text/javascript"> |
|
442 | + function sugarFeedDisplayScript() { |
|
443 | + // Forces the quicksearch to reload anytime the dashlet gets refreshed |
|
444 | + return '<script type="text/javascript"> |
|
445 | 445 | enableQS(false); |
446 | 446 | </script>'; |
447 | - } |
|
448 | - /** |
|
449 | - * |
|
450 | - * @return javascript including QuickSearch for SugarFeeds |
|
451 | - */ |
|
452 | - function displayScript() { |
|
453 | - require_once('include/QuickSearchDefaults.php'); |
|
447 | + } |
|
448 | + /** |
|
449 | + * |
|
450 | + * @return javascript including QuickSearch for SugarFeeds |
|
451 | + */ |
|
452 | + function displayScript() { |
|
453 | + require_once('include/QuickSearchDefaults.php'); |
|
454 | 454 | $ss = new Sugar_Smarty(); |
455 | 455 | $ss->assign('saving', translate('LBL_SAVING', 'SugarFeed')); |
456 | 456 | $ss->assign('saved', translate('LBL_SAVED', 'SugarFeed')); |
@@ -461,15 +461,15 @@ discard block |
||
461 | 461 | return $str; // return parent::display for title and such |
462 | 462 | } |
463 | 463 | |
464 | - /** |
|
465 | - * |
|
466 | - * @return the fully rendered dashlet |
|
467 | - */ |
|
468 | - function display(){ |
|
464 | + /** |
|
465 | + * |
|
466 | + * @return the fully rendered dashlet |
|
467 | + */ |
|
468 | + function display(){ |
|
469 | 469 | |
470 | - $listview = parent::display(); |
|
471 | - $GLOBALS['current_sugarfeed'] = $this; |
|
472 | - $listview = preg_replace_callback('/\{([^\^ }]+)\.([^\}]+)\}/', create_function( |
|
470 | + $listview = parent::display(); |
|
471 | + $GLOBALS['current_sugarfeed'] = $this; |
|
472 | + $listview = preg_replace_callback('/\{([^\^ }]+)\.([^\}]+)\}/', create_function( |
|
473 | 473 | '$matches', |
474 | 474 | 'if($matches[1] == "this"){$var = $matches[2]; return $GLOBALS[\'current_sugarfeed\']->$var;}else{return translate($matches[2], $matches[1]);}' |
475 | 475 | ),$listview); |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | preg_match_all('/\[(\w+)\:/', $listview, $alt_modules); |
480 | 480 | |
481 | 481 | //now process each token to create the proper url and image tags in feed, leaving a string for the alt to be replaced in next step |
482 | - $listview = preg_replace('/\[(\w+)\:([\w\-\d]*)\:([^\]]*)\]/', '<a href="index.php?module=$1&action=DetailView&record=$2"><img src="themes/default/images/$1.gif" border=0 REPLACE_ALT>$3</a>', $listview); /*SKIP_IMAGE_TAG*/ |
|
482 | + $listview = preg_replace('/\[(\w+)\:([\w\-\d]*)\:([^\]]*)\]/', '<a href="index.php?module=$1&action=DetailView&record=$2"><img src="themes/default/images/$1.gif" border=0 REPLACE_ALT>$3</a>', $listview); /*SKIP_IMAGE_TAG*/ |
|
483 | 483 | |
484 | 484 | |
485 | 485 | //process each module for the singular version so we can populate the alt tag on the image |
@@ -493,25 +493,25 @@ discard block |
||
493 | 493 | |
494 | 494 | |
495 | 495 | |
496 | - return $listview.'</div></div>'; |
|
497 | - } |
|
496 | + return $listview.'</div></div>'; |
|
497 | + } |
|
498 | 498 | |
499 | 499 | |
500 | - /** |
|
501 | - * |
|
502 | - * @return the title and the user post form |
|
503 | - * @param $text Object |
|
504 | - */ |
|
505 | - function getHeader($text='') { |
|
506 | - return parent::getHeader($text) . $this->getPostForm().$this->getDisabledWarning().$this->sugarFeedDisplayScript().'<div class="sugarFeedDashlet"><div id="contentScroller'.$this->idjs.'">'; |
|
507 | - } |
|
500 | + /** |
|
501 | + * |
|
502 | + * @return the title and the user post form |
|
503 | + * @param $text Object |
|
504 | + */ |
|
505 | + function getHeader($text='') { |
|
506 | + return parent::getHeader($text) . $this->getPostForm().$this->getDisabledWarning().$this->sugarFeedDisplayScript().'<div class="sugarFeedDashlet"><div id="contentScroller'.$this->idjs.'">'; |
|
507 | + } |
|
508 | 508 | |
509 | 509 | |
510 | - /** |
|
511 | - * |
|
512 | - * @return a warning message if the sugar feed system is not enabled currently |
|
513 | - */ |
|
514 | - function getDisabledWarning(){ |
|
510 | + /** |
|
511 | + * |
|
512 | + * @return a warning message if the sugar feed system is not enabled currently |
|
513 | + */ |
|
514 | + function getDisabledWarning(){ |
|
515 | 515 | /* Check to see if the sugar feed system is enabled */ |
516 | 516 | if ( ! $this->shouldDisplay() ) { |
517 | 517 | // The Sugar Feeds are disabled, populate the warning message |
@@ -521,29 +521,29 @@ discard block |
||
521 | 521 | } |
522 | 522 | } |
523 | 523 | |
524 | - /** |
|
525 | - * |
|
526 | - * @return the form for users posting custom messages to the feed stream |
|
527 | - */ |
|
528 | - function getPostForm(){ |
|
524 | + /** |
|
525 | + * |
|
526 | + * @return the form for users posting custom messages to the feed stream |
|
527 | + */ |
|
528 | + function getPostForm(){ |
|
529 | 529 | global $current_user; |
530 | 530 | |
531 | 531 | if ( (!empty($this->selectedCategories) && !in_array('UserFeed',$this->selectedCategories)) |
532 | - ) { |
|
532 | + ) { |
|
533 | 533 | // The user feed system isn't enabled, don't let them post notes |
534 | 534 | return ''; |
535 | 535 | } |
536 | - $user_name = ucfirst($GLOBALS['current_user']->user_name); |
|
537 | - $moreimg = SugarThemeRegistry::current()->getImage('advanced_search' , 'onclick="toggleDisplay(\'more_' . $this->id . '\'); toggleDisplay(\'more_img_'.$this->id.'\'); toggleDisplay(\'less_img_'.$this->id.'\');"',null,null,'.gif',translate('LBL_SHOW_MORE_OPTIONS','SugarFeed')); |
|
538 | - $lessimg = SugarThemeRegistry::current()->getImage('basic_search' , 'onclick="toggleDisplay(\'more_' . $this->id . '\'); toggleDisplay(\'more_img_'.$this->id.'\'); toggleDisplay(\'less_img_'.$this->id.'\');"',null,null,'.gif',translate('LBL_HIDE_OPTIONS','SugarFeed')); |
|
539 | - $ss = new Sugar_Smarty(); |
|
540 | - $ss->assign('LBL_TO', translate('LBL_TO', 'SugarFeed')); |
|
541 | - $ss->assign('LBL_POST', translate('LBL_POST', 'SugarFeed')); |
|
542 | - $ss->assign('LBL_SELECT', translate('LBL_SELECT', 'SugarFeed')); |
|
543 | - $ss->assign('LBL_IS', translate('LBL_IS', 'SugarFeed')); |
|
544 | - $ss->assign('id', $this->id); |
|
545 | - $ss->assign('more_img', $moreimg); |
|
546 | - $ss->assign('less_img', $lessimg); |
|
536 | + $user_name = ucfirst($GLOBALS['current_user']->user_name); |
|
537 | + $moreimg = SugarThemeRegistry::current()->getImage('advanced_search' , 'onclick="toggleDisplay(\'more_' . $this->id . '\'); toggleDisplay(\'more_img_'.$this->id.'\'); toggleDisplay(\'less_img_'.$this->id.'\');"',null,null,'.gif',translate('LBL_SHOW_MORE_OPTIONS','SugarFeed')); |
|
538 | + $lessimg = SugarThemeRegistry::current()->getImage('basic_search' , 'onclick="toggleDisplay(\'more_' . $this->id . '\'); toggleDisplay(\'more_img_'.$this->id.'\'); toggleDisplay(\'less_img_'.$this->id.'\');"',null,null,'.gif',translate('LBL_HIDE_OPTIONS','SugarFeed')); |
|
539 | + $ss = new Sugar_Smarty(); |
|
540 | + $ss->assign('LBL_TO', translate('LBL_TO', 'SugarFeed')); |
|
541 | + $ss->assign('LBL_POST', translate('LBL_POST', 'SugarFeed')); |
|
542 | + $ss->assign('LBL_SELECT', translate('LBL_SELECT', 'SugarFeed')); |
|
543 | + $ss->assign('LBL_IS', translate('LBL_IS', 'SugarFeed')); |
|
544 | + $ss->assign('id', $this->id); |
|
545 | + $ss->assign('more_img', $moreimg); |
|
546 | + $ss->assign('less_img', $lessimg); |
|
547 | 547 | |
548 | 548 | include_once("include/social/get_feed_data.php"); |
549 | 549 | $ss->assign('facebook', $html ); |
@@ -559,12 +559,12 @@ discard block |
||
559 | 559 | foreach ( $linkTypesIn as $key => $value ) { |
560 | 560 | $linkTypes[$key] = translate('LBL_LINK_TYPE_'.$value,'SugarFeed'); |
561 | 561 | } |
562 | - $ss->assign('link_types', $linkTypes); |
|
562 | + $ss->assign('link_types', $linkTypes); |
|
563 | 563 | |
564 | 564 | $userPostFormTplFile = 'modules/SugarFeed/Dashlets/SugarFeedDashlet/UserPostForm.tpl'; |
565 | 565 | $fetch = $ss->fetch(get_custom_file_if_exists($userPostFormTplFile)); |
566 | 566 | return $fetch; |
567 | - } |
|
567 | + } |
|
568 | 568 | |
569 | 569 | // This is called from the include/MySugar/DashletsDialog/DashletsDialog.php and determines if we should display the SugarFeed dashlet as an option or not |
570 | 570 | static function shouldDisplay() { |
@@ -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. |
@@ -67,55 +67,55 @@ discard block |
||
67 | 67 | $replacements = array(); |
68 | 68 | $replacements[] = ''; |
69 | 69 | $replacements[] = ''; |
70 | - $this->idjs = preg_replace($pattern,$replacements,$this->id); |
|
70 | + $this->idjs = preg_replace($pattern, $replacements, $this->id); |
|
71 | 71 | // Add in some default categories. |
72 | - $this->categories['ALL'] = translate('LBL_ALL','SugarFeed'); |
|
72 | + $this->categories['ALL'] = translate('LBL_ALL', 'SugarFeed'); |
|
73 | 73 | // Need to get the rest of the active SugarFeed modules |
74 | 74 | $module_list = SugarFeed::getActiveFeedModules(); |
75 | 75 | |
76 | 76 | // Translate the category names |
77 | - if ( ! is_array($module_list) ) { $module_list = array(); } |
|
78 | - foreach ( $module_list as $module ) { |
|
79 | - if ( $module == 'UserFeed' ) { |
|
77 | + if (!is_array($module_list)) { $module_list = array(); } |
|
78 | + foreach ($module_list as $module) { |
|
79 | + if ($module == 'UserFeed') { |
|
80 | 80 | // Fake module, need to translate specially |
81 | - $this->categories[$module] = translate('LBL_USER_FEED','SugarFeed'); |
|
81 | + $this->categories[$module] = translate('LBL_USER_FEED', 'SugarFeed'); |
|
82 | 82 | } else { |
83 | 83 | $this->categories[$module] = $app_list_strings['moduleList'][$module]; |
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
87 | 87 | // Need to add the external api's here |
88 | - $this->externalAPIList = ExternalAPIFactory::getModuleDropDown('SugarFeed',true); |
|
89 | - if ( !is_array($this->externalAPIList) ) { $this->externalAPIList = array(); } |
|
90 | - foreach ( $this->externalAPIList as $apiObj => $apiName ) { |
|
88 | + $this->externalAPIList = ExternalAPIFactory::getModuleDropDown('SugarFeed', true); |
|
89 | + if (!is_array($this->externalAPIList)) { $this->externalAPIList = array(); } |
|
90 | + foreach ($this->externalAPIList as $apiObj => $apiName) { |
|
91 | 91 | $this->categories[$apiObj] = $apiName; |
92 | 92 | } |
93 | 93 | |
94 | 94 | |
95 | - if(empty($def['title'])) $this->title = translate('LBL_HOMEPAGE_TITLE', 'SugarFeed'); |
|
96 | - if(!empty($def['rows']))$this->displayRows = $def['rows']; |
|
97 | - if(!empty($def['categories']))$this->selectedCategories = $def['categories']; |
|
98 | - if(!empty($def['userfeed_created'])) $this->userfeed_created = $def['userfeed_created']; |
|
95 | + if (empty($def['title'])) $this->title = translate('LBL_HOMEPAGE_TITLE', 'SugarFeed'); |
|
96 | + if (!empty($def['rows']))$this->displayRows = $def['rows']; |
|
97 | + if (!empty($def['categories']))$this->selectedCategories = $def['categories']; |
|
98 | + if (!empty($def['userfeed_created'])) $this->userfeed_created = $def['userfeed_created']; |
|
99 | 99 | $this->searchFields = $dashletData['SugarFeedDashlet']['searchFields']; |
100 | 100 | $this->columns = $dashletData['SugarFeedDashlet']['columns']; |
101 | 101 | |
102 | 102 | $twitter_enabled = $this->check_enabled('twitter'); |
103 | 103 | $facebook_enabled = $this->check_enabled('facebook'); |
104 | 104 | |
105 | - if($facebook_enabled){ |
|
105 | + if ($facebook_enabled) { |
|
106 | 106 | $this->categories["Facebook"] = "Facebook"; |
107 | 107 | } |
108 | 108 | |
109 | - if($twitter_enabled){ |
|
109 | + if ($twitter_enabled) { |
|
110 | 110 | $this->categories["Twitter"] = "Twitter"; |
111 | 111 | } |
112 | 112 | |
113 | 113 | $catCount = count($this->categories); |
114 | 114 | ACLController::filterModuleList($this->categories, false); |
115 | - if(count($this->categories) < $catCount){ |
|
116 | - if(!empty($this->selectedCategories)){ |
|
115 | + if (count($this->categories) < $catCount) { |
|
116 | + if (!empty($this->selectedCategories)) { |
|
117 | 117 | ACLController::filterModuleList($this->selectedCategories, true); |
118 | - }else{ |
|
118 | + } else { |
|
119 | 119 | $this->selectedCategories = array_keys($this->categories); |
120 | 120 | unset($this->selectedCategories[0]); |
121 | 121 | } |
@@ -126,9 +126,9 @@ discard block |
||
126 | 126 | /** |
127 | 127 | * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead |
128 | 128 | */ |
129 | - function SugarFeedDashlet($id, $def = null){ |
|
129 | + function SugarFeedDashlet($id, $def = null) { |
|
130 | 130 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
131 | - if(isset($GLOBALS['log'])) { |
|
131 | + if (isset($GLOBALS['log'])) { |
|
132 | 132 | $GLOBALS['log']->deprecated($deprecatedMessage); |
133 | 133 | } |
134 | 134 | else { |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $lvsParams['massupdate'] = false; |
148 | 148 | |
149 | 149 | // apply filters |
150 | - if(isset($this->filters) || $this->myItemsOnly) { |
|
150 | + if (isset($this->filters) || $this->myItemsOnly) { |
|
151 | 151 | $whereArray = $this->buildWhere(); |
152 | 152 | } |
153 | 153 | |
@@ -155,8 +155,8 @@ discard block |
||
155 | 155 | $this->lvs->multiSelect = false; |
156 | 156 | $this->lvs->quickViewLinks = false; |
157 | 157 | // columns |
158 | - foreach($this->columns as $name => $val) { |
|
159 | - if(!empty($val['default']) && $val['default']) { |
|
158 | + foreach ($this->columns as $name => $val) { |
|
159 | + if (!empty($val['default']) && $val['default']) { |
|
160 | 160 | $displayColumns[strtoupper($name)] = $val; |
161 | 161 | $displayColumns[strtoupper($name)]['label'] = trim($displayColumns[strtoupper($name)]['label'], ':'); |
162 | 162 | } |
@@ -173,39 +173,39 @@ discard block |
||
173 | 173 | |
174 | 174 | |
175 | 175 | // Get the real module list |
176 | - if (empty($this->selectedCategories)){ |
|
176 | + if (empty($this->selectedCategories)) { |
|
177 | 177 | $mod_list = $this->categories; |
178 | 178 | } else { |
179 | - $mod_list = array_flip($this->selectedCategories);//27949, here the key of $this->selectedCategories is not module name, the value is module name, so array_flip it. |
|
179 | + $mod_list = array_flip($this->selectedCategories); //27949, here the key of $this->selectedCategories is not module name, the value is module name, so array_flip it. |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | $external_modules = array(); |
183 | 183 | $admin_modules = array(); |
184 | 184 | $owner_modules = array(); |
185 | 185 | $regular_modules = array(); |
186 | - foreach($mod_list as $module => $ignore) { |
|
186 | + foreach ($mod_list as $module => $ignore) { |
|
187 | 187 | // Handle the UserFeed differently |
188 | - if ( $module == 'UserFeed') { |
|
188 | + if ($module == 'UserFeed') { |
|
189 | 189 | $regular_modules[] = 'UserFeed'; |
190 | 190 | continue; |
191 | 191 | } |
192 | - if($module == 'Facebook'){ |
|
192 | + if ($module == 'Facebook') { |
|
193 | 193 | $regular_modules[] = "Facebook"; |
194 | 194 | continue; |
195 | 195 | } |
196 | - if($module == 'Twitter'){ |
|
196 | + if ($module == 'Twitter') { |
|
197 | 197 | $regular_modules[] = 'Twitter'; |
198 | 198 | continue; |
199 | 199 | } |
200 | 200 | |
201 | - if ( in_array($module,$this->externalAPIList) ) { |
|
201 | + if (in_array($module, $this->externalAPIList)) { |
|
202 | 202 | $external_modules[] = $module; |
203 | 203 | } |
204 | - if (ACLAction::getUserAccessLevel($current_user->id,$module,'view') <= ACL_ALLOW_NONE ) { |
|
204 | + if (ACLAction::getUserAccessLevel($current_user->id, $module, 'view') <= ACL_ALLOW_NONE) { |
|
205 | 205 | // Not enough access to view any records, don't add it to any lists |
206 | 206 | continue; |
207 | 207 | } |
208 | - if ( ACLAction::getUserAccessLevel($current_user->id,$module,'view') == ACL_ALLOW_OWNER ) { |
|
208 | + if (ACLAction::getUserAccessLevel($current_user->id, $module, 'view') == ACL_ALLOW_OWNER) { |
|
209 | 209 | $owner_modules[] = $module; |
210 | 210 | } else { |
211 | 211 | $regular_modules[] = $module; |
@@ -215,41 +215,41 @@ discard block |
||
215 | 215 | |
216 | 216 | |
217 | 217 | |
218 | - if(!empty($this->displayTpl)) |
|
218 | + if (!empty($this->displayTpl)) |
|
219 | 219 | { |
220 | 220 | //MFH BUG #14296 |
221 | 221 | $where = ''; |
222 | - if(!empty($whereArray)){ |
|
223 | - $where = '(' . implode(') AND (', $whereArray) . ')'; |
|
222 | + if (!empty($whereArray)) { |
|
223 | + $where = '('.implode(') AND (', $whereArray).')'; |
|
224 | 224 | |
225 | 225 | } |
226 | 226 | |
227 | 227 | $additional_where = ''; |
228 | 228 | |
229 | 229 | |
230 | - $module_limiter = " sugarfeed.related_module in ('" . implode("','", $regular_modules) . "')"; |
|
230 | + $module_limiter = " sugarfeed.related_module in ('".implode("','", $regular_modules)."')"; |
|
231 | 231 | |
232 | - if( is_admin($GLOBALS['current_user'] ) ) |
|
232 | + if (is_admin($GLOBALS['current_user'])) |
|
233 | 233 | { |
234 | 234 | $all_modules = array_merge($regular_modules, $owner_modules, $admin_modules); |
235 | - $module_limiter = " sugarfeed.related_module in ('" . implode("','", $all_modules) . "')"; |
|
235 | + $module_limiter = " sugarfeed.related_module in ('".implode("','", $all_modules)."')"; |
|
236 | 236 | } |
237 | - else if ( count($owner_modules) > 0 |
|
237 | + else if (count($owner_modules) > 0 |
|
238 | 238 | ) { |
239 | 239 | $module_limiter = " ((sugarfeed.related_module IN ('".implode("','", $regular_modules)."') " |
240 | 240 | .") "; |
241 | - if ( count($owner_modules) > 0 ) { |
|
241 | + if (count($owner_modules) > 0) { |
|
242 | 242 | $module_limiter .= "OR (sugarfeed.related_module IN('".implode("','", $owner_modules)."') AND sugarfeed.assigned_user_id = '".$current_user->id."' " |
243 | 243 | .") "; |
244 | 244 | } |
245 | 245 | $module_limiter .= ")"; |
246 | 246 | } |
247 | - if(!empty($where)) { $where .= ' AND '; } |
|
247 | + if (!empty($where)) { $where .= ' AND '; } |
|
248 | 248 | |
249 | 249 | |
250 | 250 | $where .= $module_limiter; |
251 | 251 | |
252 | - $this->lvs->setup($this->seedBean, $this->displayTpl, $where , $lvsParams, 0, $this->displayRows, |
|
252 | + $this->lvs->setup($this->seedBean, $this->displayTpl, $where, $lvsParams, 0, $this->displayRows, |
|
253 | 253 | array('name', |
254 | 254 | 'description', |
255 | 255 | 'date_entered', |
@@ -266,35 +266,35 @@ discard block |
||
266 | 266 | 'link_url', |
267 | 267 | 'link_type')); |
268 | 268 | |
269 | - foreach($this->lvs->data['data'] as $row => $data) { |
|
269 | + foreach ($this->lvs->data['data'] as $row => $data) { |
|
270 | 270 | |
271 | - $this->lvs->data['data'][$row]['NAME'] = str_replace("{this.CREATED_BY}",get_assigned_user_name($this->lvs->data['data'][$row]['CREATED_BY']),$data['NAME']); |
|
271 | + $this->lvs->data['data'][$row]['NAME'] = str_replace("{this.CREATED_BY}", get_assigned_user_name($this->lvs->data['data'][$row]['CREATED_BY']), $data['NAME']); |
|
272 | 272 | |
273 | 273 | //Translate the SugarFeeds labels if necessary. |
274 | - preg_match('/\{([^\^ }]+)\.([^\}]+)\}/', $this->lvs->data['data'][$row]['NAME'] ,$modStringMatches ); |
|
275 | - if(count($modStringMatches) == 3 && $modStringMatches[1] == 'SugarFeed' && !empty($data['RELATED_MODULE']) ) |
|
274 | + preg_match('/\{([^\^ }]+)\.([^\}]+)\}/', $this->lvs->data['data'][$row]['NAME'], $modStringMatches); |
|
275 | + if (count($modStringMatches) == 3 && $modStringMatches[1] == 'SugarFeed' && !empty($data['RELATED_MODULE'])) |
|
276 | 276 | { |
277 | 277 | $modKey = $modStringMatches[2]; |
278 | 278 | $modString = translate($modKey, $modStringMatches[1]); |
279 | - if( strpos($modString, '{0}') === FALSE || !isset($GLOBALS['app_list_strings']['moduleListSingular'][$data['RELATED_MODULE']]) ) |
|
279 | + if (strpos($modString, '{0}') === FALSE || !isset($GLOBALS['app_list_strings']['moduleListSingular'][$data['RELATED_MODULE']])) |
|
280 | 280 | continue; |
281 | 281 | |
282 | 282 | $modStringSingular = $GLOBALS['app_list_strings']['moduleListSingular'][$data['RELATED_MODULE']]; |
283 | - $modString = string_format($modString, array($modStringSingular) ); |
|
284 | - $this->lvs->data['data'][$row]['NAME'] = preg_replace('/' . $modStringMatches[0] . '/', strtolower($modString), $this->lvs->data['data'][$row]['NAME']); |
|
283 | + $modString = string_format($modString, array($modStringSingular)); |
|
284 | + $this->lvs->data['data'][$row]['NAME'] = preg_replace('/'.$modStringMatches[0].'/', strtolower($modString), $this->lvs->data['data'][$row]['NAME']); |
|
285 | 285 | } |
286 | 286 | //if social then unless the user is the assigned user it wont show. IJD1986 |
287 | - if(($data['RELATED_MODULE'] == "facebook" || $data['RELATED_MODULE'] == "twitter" ) && $data['ASSIGNED_USER_ID'] != $current_user->id){ |
|
287 | + if (($data['RELATED_MODULE'] == "facebook" || $data['RELATED_MODULE'] == "twitter") && $data['ASSIGNED_USER_ID'] != $current_user->id) { |
|
288 | 288 | unset($this->lvs->data['data'][$row]); |
289 | 289 | } |
290 | 290 | } |
291 | 291 | |
292 | 292 | // assign a baseURL w/ the action set as DisplayDashlet |
293 | - foreach($this->lvs->data['pageData']['urls'] as $type => $url) { |
|
293 | + foreach ($this->lvs->data['pageData']['urls'] as $type => $url) { |
|
294 | 294 | // awu Replacing action=DisplayDashlet with action=DynamicAction&DynamicAction=DisplayDashlet |
295 | 295 | $this->lvs->data['pageData']['urls'][$type] = $url.'&action=DynamicAction&DynamicAction=displayDashlet'; |
296 | - if($type != 'orderBy') |
|
297 | - $this->lvs->data['pageData']['urls'][$type] = $url.'&action=DynamicAction&DynamicAction=displayDashlet&sugar_body_only=1&id=' . $this->id; |
|
296 | + if ($type != 'orderBy') |
|
297 | + $this->lvs->data['pageData']['urls'][$type] = $url.'&action=DynamicAction&DynamicAction=displayDashlet&sugar_body_only=1&id='.$this->id; |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | $this->lvs->ss->assign('dashletId', $this->id); |
@@ -309,27 +309,27 @@ discard block |
||
309 | 309 | |
310 | 310 | $fetchRecordCount = $this->displayRows + $this->lvs->data['pageData']['offsets']['current']; |
311 | 311 | |
312 | - foreach ( $external_modules as $apiName ) { |
|
312 | + foreach ($external_modules as $apiName) { |
|
313 | 313 | $api = ExternalAPIFactory::loadAPI($apiName); |
314 | - if ( $api !== FALSE ) { |
|
314 | + if ($api !== FALSE) { |
|
315 | 315 | // FIXME: Actually calculate the oldest sugar feed we can see, once we get an API that supports this sort of filter. |
316 | - $reply = $api->getLatestUpdates(0,$fetchRecordCount); |
|
317 | - if ( $reply['success'] && count($reply['messages']) > 0 ) { |
|
316 | + $reply = $api->getLatestUpdates(0, $fetchRecordCount); |
|
317 | + if ($reply['success'] && count($reply['messages']) > 0) { |
|
318 | 318 | array_splice($resortQueue, count($resortQueue), 0, $reply['messages']); |
319 | - } else if ( !$reply['success'] ) { |
|
319 | + } else if (!$reply['success']) { |
|
320 | 320 | $feedErrors[] = $reply['errorMessage']; |
321 | 321 | } |
322 | 322 | } |
323 | 323 | } |
324 | 324 | |
325 | - if ( count($feedErrors) > 0 ) { |
|
326 | - $this->lvs->ss->assign('feedErrors',$feedErrors); |
|
325 | + if (count($feedErrors) > 0) { |
|
326 | + $this->lvs->ss->assign('feedErrors', $feedErrors); |
|
327 | 327 | } |
328 | 328 | |
329 | 329 | // If we need to resort, get to work! |
330 | - foreach ( $this->lvs->data['data'] as $normalMessage ) { |
|
331 | - list($user_date,$user_time) = explode(' ',$normalMessage['DATE_ENTERED']); |
|
332 | - list($db_date,$db_time) = $td->to_db_date_time($user_date,$user_time); |
|
330 | + foreach ($this->lvs->data['data'] as $normalMessage) { |
|
331 | + list($user_date, $user_time) = explode(' ', $normalMessage['DATE_ENTERED']); |
|
332 | + list($db_date, $db_time) = $td->to_db_date_time($user_date, $user_time); |
|
333 | 333 | |
334 | 334 | $unix_timestamp = strtotime($db_date.' '.$db_time); |
335 | 335 | |
@@ -339,31 +339,31 @@ discard block |
||
339 | 339 | $resortQueue[] = $normalMessage; |
340 | 340 | } |
341 | 341 | |
342 | - usort($resortQueue,create_function('$a,$b','return $a["sort_key"]<$b["sort_key"];')); |
|
342 | + usort($resortQueue, create_function('$a,$b', 'return $a["sort_key"]<$b["sort_key"];')); |
|
343 | 343 | |
344 | 344 | // Trim it down to the necessary number of records |
345 | 345 | $numRecords = count($resortQueue); |
346 | 346 | $numRecords = $numRecords - $this->lvs->data['pageData']['offsets']['current']; |
347 | - $numRecords = min($this->displayRows,$numRecords); |
|
347 | + $numRecords = min($this->displayRows, $numRecords); |
|
348 | 348 | |
349 | 349 | $this->lvs->data['data'] = $resortQueue; |
350 | 350 | } |
351 | 351 | |
352 | 352 | function deleteUserFeed() { |
353 | - if(!empty($_REQUEST['record'])) { |
|
353 | + if (!empty($_REQUEST['record'])) { |
|
354 | 354 | $feed = new SugarFeed(); |
355 | 355 | $feed->retrieve($_REQUEST['record']); |
356 | - if(is_admin($GLOBALS['current_user']) || $feed->created_by == $GLOBALS['current_user']->id){ |
|
356 | + if (is_admin($GLOBALS['current_user']) || $feed->created_by == $GLOBALS['current_user']->id) { |
|
357 | 357 | $feed->mark_deleted($_REQUEST['record']); |
358 | 358 | |
359 | 359 | } |
360 | 360 | } |
361 | 361 | } |
362 | 362 | function pushUserFeed() { |
363 | - if(!empty($_REQUEST['text']) || (!empty($_REQUEST['link_url']) && !empty($_REQUEST['link_type']))) { |
|
363 | + if (!empty($_REQUEST['text']) || (!empty($_REQUEST['link_url']) && !empty($_REQUEST['link_type']))) { |
|
364 | 364 | $text = htmlspecialchars($_REQUEST['text']); |
365 | 365 | //allow for bold and italic user tags |
366 | - $text = preg_replace('/&lt;(\/*[bi])&gt;/i','<$1>', $text); |
|
366 | + $text = preg_replace('/&lt;(\/*[bi])&gt;/i', '<$1>', $text); |
|
367 | 367 | SugarFeed::pushFeed($text, 'UserFeed', $GLOBALS['current_user']->id, |
368 | 368 | $GLOBALS['current_user']->id, |
369 | 369 | $_REQUEST['link_type'], $_REQUEST['link_url'] |
@@ -373,10 +373,10 @@ discard block |
||
373 | 373 | } |
374 | 374 | |
375 | 375 | function pushUserFeedReply( ) { |
376 | - if(!empty($_REQUEST['text'])&&!empty($_REQUEST['parentFeed'])) { |
|
376 | + if (!empty($_REQUEST['text']) && !empty($_REQUEST['parentFeed'])) { |
|
377 | 377 | $text = htmlspecialchars($_REQUEST['text']); |
378 | 378 | //allow for bold and italic user tags |
379 | - $text = preg_replace('/&lt;(\/*[bi])&gt;/i','<$1>', $text); |
|
379 | + $text = preg_replace('/&lt;(\/*[bi])&gt;/i', '<$1>', $text); |
|
380 | 380 | SugarFeed::pushFeed($text, 'SugarFeed', $_REQUEST['parentFeed'], |
381 | 381 | $GLOBALS['current_user']->id, |
382 | 382 | '', '' |
@@ -397,22 +397,22 @@ discard block |
||
397 | 397 | $ss->assign('clearLBL', $app_strings['LBL_CLEAR_BUTTON_LABEL']); |
398 | 398 | $ss->assign('title', $this->title); |
399 | 399 | $ss->assign('categories', $this->categories); |
400 | - if ( empty($this->selectedCategories) ) { |
|
400 | + if (empty($this->selectedCategories)) { |
|
401 | 401 | $this->selectedCategories['ALL'] = 'ALL'; |
402 | 402 | } |
403 | 403 | $ss->assign('selectedCategories', $this->selectedCategories); |
404 | 404 | $ss->assign('rows', $this->displayRows); |
405 | 405 | $externalApis = array(); |
406 | - foreach ( $this->externalAPIList as $apiObj => $apiName ) { |
|
406 | + foreach ($this->externalAPIList as $apiObj => $apiName) { |
|
407 | 407 | //only show external APis that the user has not created |
408 | - if ( ! EAPM::getLoginInfo($apiName) ) { |
|
408 | + if (!EAPM::getLoginInfo($apiName)) { |
|
409 | 409 | $externalApis[] = $apiObj; |
410 | 410 | } |
411 | 411 | } |
412 | 412 | $ss->assign('externalApiList', JSON::encode($externalApis)); |
413 | 413 | $ss->assign('authenticateLBL', translate('LBL_AUTHENTICATE', 'SugarFeed')); |
414 | 414 | $ss->assign('id', $this->id); |
415 | - if($this->isAutoRefreshable()) { |
|
415 | + if ($this->isAutoRefreshable()) { |
|
416 | 416 | $ss->assign('isRefreshable', true); |
417 | 417 | $ss->assign('autoRefresh', $GLOBALS['app_strings']['LBL_DASHLET_CONFIGURE_AUTOREFRESH']); |
418 | 418 | $ss->assign('autoRefreshOptions', $this->getAutoRefreshOptions()); |
@@ -432,18 +432,18 @@ discard block |
||
432 | 432 | $options = array(); |
433 | 433 | $options['title'] = $req['title']; |
434 | 434 | $rows = intval($_REQUEST['rows']); |
435 | - if($rows <= 0) { |
|
435 | + if ($rows <= 0) { |
|
436 | 436 | $rows = 15; |
437 | 437 | } |
438 | - if($rows > 100){ |
|
438 | + if ($rows > 100) { |
|
439 | 439 | $rows = 100; |
440 | 440 | } |
441 | - if ( isset($req['autoRefresh']) ) |
|
441 | + if (isset($req['autoRefresh'])) |
|
442 | 442 | $options['autoRefresh'] = $req['autoRefresh']; |
443 | 443 | $options['rows'] = $rows; |
444 | 444 | $options['categories'] = $req['categories']; |
445 | - foreach($options['categories'] as $cat){ |
|
446 | - if($cat == 'ALL'){ |
|
445 | + foreach ($options['categories'] as $cat) { |
|
446 | + if ($cat == 'ALL') { |
|
447 | 447 | unset($options['categories']); |
448 | 448 | } |
449 | 449 | } |
@@ -479,14 +479,14 @@ discard block |
||
479 | 479 | * |
480 | 480 | * @return the fully rendered dashlet |
481 | 481 | */ |
482 | - function display(){ |
|
482 | + function display() { |
|
483 | 483 | |
484 | 484 | $listview = parent::display(); |
485 | 485 | $GLOBALS['current_sugarfeed'] = $this; |
486 | 486 | $listview = preg_replace_callback('/\{([^\^ }]+)\.([^\}]+)\}/', create_function( |
487 | 487 | '$matches', |
488 | 488 | 'if($matches[1] == "this"){$var = $matches[2]; return $GLOBALS[\'current_sugarfeed\']->$var;}else{return translate($matches[2], $matches[1]);}' |
489 | - ),$listview); |
|
489 | + ), $listview); |
|
490 | 490 | |
491 | 491 | |
492 | 492 | //grab each token and store the module for later processing |
@@ -498,10 +498,10 @@ discard block |
||
498 | 498 | |
499 | 499 | //process each module for the singular version so we can populate the alt tag on the image |
500 | 500 | $altStrings = array(); |
501 | - foreach($alt_modules[1] as $alt){ |
|
501 | + foreach ($alt_modules[1] as $alt) { |
|
502 | 502 | //create the alt string and replace the alt token |
503 | - $altString = 'alt="'.translate('LBL_VIEW','SugarFeed').' '.$GLOBALS['app_list_strings']['moduleListSingular'][$alt].'"'; |
|
504 | - $listview = preg_replace('/REPLACE_ALT/', $altString, $listview,1); |
|
503 | + $altString = 'alt="'.translate('LBL_VIEW', 'SugarFeed').' '.$GLOBALS['app_list_strings']['moduleListSingular'][$alt].'"'; |
|
504 | + $listview = preg_replace('/REPLACE_ALT/', $altString, $listview, 1); |
|
505 | 505 | } |
506 | 506 | |
507 | 507 | |
@@ -516,8 +516,8 @@ discard block |
||
516 | 516 | * @return the title and the user post form |
517 | 517 | * @param $text Object |
518 | 518 | */ |
519 | - function getHeader($text='') { |
|
520 | - return parent::getHeader($text) . $this->getPostForm().$this->getDisabledWarning().$this->sugarFeedDisplayScript().'<div class="sugarFeedDashlet"><div id="contentScroller'.$this->idjs.'">'; |
|
519 | + function getHeader($text = '') { |
|
520 | + return parent::getHeader($text).$this->getPostForm().$this->getDisabledWarning().$this->sugarFeedDisplayScript().'<div class="sugarFeedDashlet"><div id="contentScroller'.$this->idjs.'">'; |
|
521 | 521 | } |
522 | 522 | |
523 | 523 | |
@@ -525,11 +525,11 @@ discard block |
||
525 | 525 | * |
526 | 526 | * @return a warning message if the sugar feed system is not enabled currently |
527 | 527 | */ |
528 | - function getDisabledWarning(){ |
|
528 | + function getDisabledWarning() { |
|
529 | 529 | /* Check to see if the sugar feed system is enabled */ |
530 | - if ( ! $this->shouldDisplay() ) { |
|
530 | + if (!$this->shouldDisplay()) { |
|
531 | 531 | // The Sugar Feeds are disabled, populate the warning message |
532 | - return translate('LBL_DASHLET_DISABLED','SugarFeed'); |
|
532 | + return translate('LBL_DASHLET_DISABLED', 'SugarFeed'); |
|
533 | 533 | } else { |
534 | 534 | return ''; |
535 | 535 | } |
@@ -539,17 +539,17 @@ discard block |
||
539 | 539 | * |
540 | 540 | * @return the form for users posting custom messages to the feed stream |
541 | 541 | */ |
542 | - function getPostForm(){ |
|
542 | + function getPostForm() { |
|
543 | 543 | global $current_user; |
544 | 544 | |
545 | - if ( (!empty($this->selectedCategories) && !in_array('UserFeed',$this->selectedCategories)) |
|
545 | + if ((!empty($this->selectedCategories) && !in_array('UserFeed', $this->selectedCategories)) |
|
546 | 546 | ) { |
547 | 547 | // The user feed system isn't enabled, don't let them post notes |
548 | 548 | return ''; |
549 | 549 | } |
550 | 550 | $user_name = ucfirst($GLOBALS['current_user']->user_name); |
551 | - $moreimg = SugarThemeRegistry::current()->getImage('advanced_search' , 'onclick="toggleDisplay(\'more_' . $this->id . '\'); toggleDisplay(\'more_img_'.$this->id.'\'); toggleDisplay(\'less_img_'.$this->id.'\');"',null,null,'.gif',translate('LBL_SHOW_MORE_OPTIONS','SugarFeed')); |
|
552 | - $lessimg = SugarThemeRegistry::current()->getImage('basic_search' , 'onclick="toggleDisplay(\'more_' . $this->id . '\'); toggleDisplay(\'more_img_'.$this->id.'\'); toggleDisplay(\'less_img_'.$this->id.'\');"',null,null,'.gif',translate('LBL_HIDE_OPTIONS','SugarFeed')); |
|
551 | + $moreimg = SugarThemeRegistry::current()->getImage('advanced_search', 'onclick="toggleDisplay(\'more_'.$this->id.'\'); toggleDisplay(\'more_img_'.$this->id.'\'); toggleDisplay(\'less_img_'.$this->id.'\');"', null, null, '.gif', translate('LBL_SHOW_MORE_OPTIONS', 'SugarFeed')); |
|
552 | + $lessimg = SugarThemeRegistry::current()->getImage('basic_search', 'onclick="toggleDisplay(\'more_'.$this->id.'\'); toggleDisplay(\'more_img_'.$this->id.'\'); toggleDisplay(\'less_img_'.$this->id.'\');"', null, null, '.gif', translate('LBL_HIDE_OPTIONS', 'SugarFeed')); |
|
553 | 553 | $ss = new Sugar_Smarty(); |
554 | 554 | $ss->assign('LBL_TO', translate('LBL_TO', 'SugarFeed')); |
555 | 555 | $ss->assign('LBL_POST', translate('LBL_POST', 'SugarFeed')); |
@@ -560,9 +560,9 @@ discard block |
||
560 | 560 | $ss->assign('less_img', $lessimg); |
561 | 561 | |
562 | 562 | include_once("include/social/get_feed_data.php"); |
563 | - $ss->assign('facebook', $html ); |
|
563 | + $ss->assign('facebook', $html); |
|
564 | 564 | |
565 | - if($current_user->getPreference('use_real_names') == 'on'){ |
|
565 | + if ($current_user->getPreference('use_real_names') == 'on') { |
|
566 | 566 | $ss->assign('user_name', $current_user->full_name); |
567 | 567 | } |
568 | 568 | else { |
@@ -570,8 +570,8 @@ discard block |
||
570 | 570 | } |
571 | 571 | $linkTypesIn = SugarFeed::getLinkTypes(); |
572 | 572 | $linkTypes = array(); |
573 | - foreach ( $linkTypesIn as $key => $value ) { |
|
574 | - $linkTypes[$key] = translate('LBL_LINK_TYPE_'.$value,'SugarFeed'); |
|
573 | + foreach ($linkTypesIn as $key => $value) { |
|
574 | + $linkTypes[$key] = translate('LBL_LINK_TYPE_'.$value, 'SugarFeed'); |
|
575 | 575 | } |
576 | 576 | $ss->assign('link_types', $linkTypes); |
577 | 577 | |
@@ -586,16 +586,16 @@ discard block |
||
586 | 586 | $admin = new Administration(); |
587 | 587 | $admin->retrieveSettings(); |
588 | 588 | |
589 | - if ( !isset($admin->settings['sugarfeed_enabled']) || $admin->settings['sugarfeed_enabled'] != '1' ) { |
|
589 | + if (!isset($admin->settings['sugarfeed_enabled']) || $admin->settings['sugarfeed_enabled'] != '1') { |
|
590 | 590 | return false; |
591 | 591 | } else { |
592 | 592 | return true; |
593 | 593 | } |
594 | 594 | } |
595 | 595 | |
596 | - function check_enabled($type){ |
|
596 | + function check_enabled($type) { |
|
597 | 597 | global $db; |
598 | - $query = "SELECT * FROM config where name = 'module_" .$type . "' and value = 1;"; |
|
598 | + $query = "SELECT * FROM config where name = 'module_".$type."' and value = 1;"; |
|
599 | 599 | $results = $db->query($query); |
600 | 600 | |
601 | 601 | while ($row = $db->fetchByAssoc($results)) { |
@@ -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. |
@@ -92,10 +94,18 @@ discard block |
||
92 | 94 | } |
93 | 95 | |
94 | 96 | |
95 | - if(empty($def['title'])) $this->title = translate('LBL_HOMEPAGE_TITLE', 'SugarFeed'); |
|
96 | - if(!empty($def['rows']))$this->displayRows = $def['rows']; |
|
97 | - if(!empty($def['categories']))$this->selectedCategories = $def['categories']; |
|
98 | - if(!empty($def['userfeed_created'])) $this->userfeed_created = $def['userfeed_created']; |
|
97 | + if(empty($def['title'])) { |
|
98 | + $this->title = translate('LBL_HOMEPAGE_TITLE', 'SugarFeed'); |
|
99 | + } |
|
100 | + if(!empty($def['rows'])) { |
|
101 | + $this->displayRows = $def['rows']; |
|
102 | + } |
|
103 | + if(!empty($def['categories'])) { |
|
104 | + $this->selectedCategories = $def['categories']; |
|
105 | + } |
|
106 | + if(!empty($def['userfeed_created'])) { |
|
107 | + $this->userfeed_created = $def['userfeed_created']; |
|
108 | + } |
|
99 | 109 | $this->searchFields = $dashletData['SugarFeedDashlet']['searchFields']; |
100 | 110 | $this->columns = $dashletData['SugarFeedDashlet']['columns']; |
101 | 111 | |
@@ -115,7 +125,7 @@ discard block |
||
115 | 125 | if(count($this->categories) < $catCount){ |
116 | 126 | if(!empty($this->selectedCategories)){ |
117 | 127 | ACLController::filterModuleList($this->selectedCategories, true); |
118 | - }else{ |
|
128 | + } else{ |
|
119 | 129 | $this->selectedCategories = array_keys($this->categories); |
120 | 130 | unset($this->selectedCategories[0]); |
121 | 131 | } |
@@ -130,8 +140,7 @@ discard block |
||
130 | 140 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
131 | 141 | if(isset($GLOBALS['log'])) { |
132 | 142 | $GLOBALS['log']->deprecated($deprecatedMessage); |
133 | - } |
|
134 | - else { |
|
143 | + } else { |
|
135 | 144 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
136 | 145 | } |
137 | 146 | self::__construct($id, $def); |
@@ -233,8 +242,7 @@ discard block |
||
233 | 242 | { |
234 | 243 | $all_modules = array_merge($regular_modules, $owner_modules, $admin_modules); |
235 | 244 | $module_limiter = " sugarfeed.related_module in ('" . implode("','", $all_modules) . "')"; |
236 | - } |
|
237 | - else if ( count($owner_modules) > 0 |
|
245 | + } else if ( count($owner_modules) > 0 |
|
238 | 246 | ) { |
239 | 247 | $module_limiter = " ((sugarfeed.related_module IN ('".implode("','", $regular_modules)."') " |
240 | 248 | .") "; |
@@ -276,8 +284,9 @@ discard block |
||
276 | 284 | { |
277 | 285 | $modKey = $modStringMatches[2]; |
278 | 286 | $modString = translate($modKey, $modStringMatches[1]); |
279 | - if( strpos($modString, '{0}') === FALSE || !isset($GLOBALS['app_list_strings']['moduleListSingular'][$data['RELATED_MODULE']]) ) |
|
280 | - continue; |
|
287 | + if( strpos($modString, '{0}') === FALSE || !isset($GLOBALS['app_list_strings']['moduleListSingular'][$data['RELATED_MODULE']]) ) { |
|
288 | + continue; |
|
289 | + } |
|
281 | 290 | |
282 | 291 | $modStringSingular = $GLOBALS['app_list_strings']['moduleListSingular'][$data['RELATED_MODULE']]; |
283 | 292 | $modString = string_format($modString, array($modStringSingular) ); |
@@ -293,8 +302,9 @@ discard block |
||
293 | 302 | foreach($this->lvs->data['pageData']['urls'] as $type => $url) { |
294 | 303 | // awu Replacing action=DisplayDashlet with action=DynamicAction&DynamicAction=DisplayDashlet |
295 | 304 | $this->lvs->data['pageData']['urls'][$type] = $url.'&action=DynamicAction&DynamicAction=displayDashlet'; |
296 | - if($type != 'orderBy') |
|
297 | - $this->lvs->data['pageData']['urls'][$type] = $url.'&action=DynamicAction&DynamicAction=displayDashlet&sugar_body_only=1&id=' . $this->id; |
|
305 | + if($type != 'orderBy') { |
|
306 | + $this->lvs->data['pageData']['urls'][$type] = $url.'&action=DynamicAction&DynamicAction=displayDashlet&sugar_body_only=1&id=' . $this->id; |
|
307 | + } |
|
298 | 308 | } |
299 | 309 | |
300 | 310 | $this->lvs->ss->assign('dashletId', $this->id); |
@@ -438,8 +448,9 @@ discard block |
||
438 | 448 | if($rows > 100){ |
439 | 449 | $rows = 100; |
440 | 450 | } |
441 | - if ( isset($req['autoRefresh']) ) |
|
442 | - $options['autoRefresh'] = $req['autoRefresh']; |
|
451 | + if ( isset($req['autoRefresh']) ) { |
|
452 | + $options['autoRefresh'] = $req['autoRefresh']; |
|
453 | + } |
|
443 | 454 | $options['rows'] = $rows; |
444 | 455 | $options['categories'] = $req['categories']; |
445 | 456 | foreach($options['categories'] as $cat){ |
@@ -564,8 +575,7 @@ discard block |
||
564 | 575 | |
565 | 576 | if($current_user->getPreference('use_real_names') == 'on'){ |
566 | 577 | $ss->assign('user_name', $current_user->full_name); |
567 | - } |
|
568 | - else { |
|
578 | + } else { |
|
569 | 579 | $ss->assign('user_name', $user_name); |
570 | 580 | } |
571 | 581 | $linkTypesIn = SugarFeed::getLinkTypes(); |
@@ -40,26 +40,26 @@ discard block |
||
40 | 40 | |
41 | 41 | class updateDependencies { |
42 | 42 | |
43 | - function update_dependency(&$bean, $event, $arguments){ |
|
43 | + function update_dependency(&$bean, $event, $arguments) { |
|
44 | 44 | //Get all tasks that are dependant on the current task being saved. |
45 | 45 | $Task = BeanFactory::getBean('ProjectTask'); |
46 | 46 | $tasks = $Task->get_full_list("", "project_task.project_id = '".$bean->project_id."' AND project_task.predecessors = '".$bean->project_task_id."'"); |
47 | 47 | |
48 | - if($bean->date_finish != $bean->fetched_row['date_finish']){ //if the end date of a current task is changed |
|
48 | + if ($bean->date_finish != $bean->fetched_row['date_finish']) { //if the end date of a current task is changed |
|
49 | 49 | |
50 | 50 | $diff = $this->count_days($bean->date_finish, $bean->fetched_row['date_finish']); //Gets the difference in days |
51 | 51 | |
52 | - foreach($tasks as $task){ //loop through all dependant tasks |
|
52 | + foreach ($tasks as $task) { //loop through all dependant tasks |
|
53 | 53 | |
54 | - $rel_type = $task->relationship_type;//Determine their dependency type |
|
54 | + $rel_type = $task->relationship_type; //Determine their dependency type |
|
55 | 55 | |
56 | - if($rel_type == 'FS'){//if its a Finish to start |
|
56 | + if ($rel_type == 'FS') {//if its a Finish to start |
|
57 | 57 | //Modify the task's start and end date dependant on the difference in days |
58 | 58 | $start = new DateTime($task->date_start); |
59 | 59 | $start = $start->modify($diff); |
60 | 60 | $startdate = $start->format('Y-m-d'); |
61 | 61 | |
62 | - $duration = $task->duration - 1;//take one off to maintain correct gantt bar length |
|
62 | + $duration = $task->duration - 1; //take one off to maintain correct gantt bar length |
|
63 | 63 | |
64 | 64 | $enddate = $start->modify('+'.$duration.' days'); |
65 | 65 | $enddate = $enddate->format('Y-m-d'); |
@@ -69,9 +69,9 @@ discard block |
||
69 | 69 | $task->save(); |
70 | 70 | |
71 | 71 | } |
72 | - else if($rel_type == 'SS'){//if its a start to start |
|
72 | + else if ($rel_type == 'SS') {//if its a start to start |
|
73 | 73 | //check if the tasks duration has not been changed so that it does not update when the parent tasks duration is changed |
74 | - if($bean->fetched_row['duration'] == $bean->duration){ |
|
74 | + if ($bean->fetched_row['duration'] == $bean->duration) { |
|
75 | 75 | |
76 | 76 | $start = new DateTime($task->date_start); |
77 | 77 | $start = $start->modify($diff); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | //Gets the difference in days between two dates |
99 | - function count_days($start_date, $end_date){ |
|
99 | + function count_days($start_date, $end_date) { |
|
100 | 100 | |
101 | 101 | $d1 = new DateTime($start_date); |
102 | 102 | $d2 = new DateTime($end_date); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | if ($difference->invert == 1) { |
105 | 105 | return '+'.$difference->d.' days'; //returns positive days |
106 | 106 | } else { |
107 | - return -$difference->d.' days';//returns negative days |
|
107 | + return -$difference->d.' days'; //returns negative days |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | } |
@@ -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. |
@@ -68,8 +70,7 @@ discard block |
||
68 | 70 | $task->date_finish = $enddate; |
69 | 71 | $task->save(); |
70 | 72 | |
71 | - } |
|
72 | - else if($rel_type == 'SS'){//if its a start to start |
|
73 | + } else if($rel_type == 'SS'){//if its a start to start |
|
73 | 74 | //check if the tasks duration has not been changed so that it does not update when the parent tasks duration is changed |
74 | 75 | if($bean->fetched_row['duration'] == $bean->duration){ |
75 | 76 |