Passed
Push — scrutinizer-code-quality ( 09f5a1...c4c5fb )
by Adam
56:05 queued 14:08
created
modules/AOK_KnowledgeBase/AOK_KnowledgeBase.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,16 +43,16 @@
 block discarded – undo
43 43
 require_once('modules/AOK_KnowledgeBase/AOK_KnowledgeBase_sugar.php');
44 44
 class AOK_KnowledgeBase extends AOK_KnowledgeBase_sugar {
45 45
 
46
-	public function __construct(){
46
+	public function __construct() {
47 47
 		parent::__construct();
48 48
 	}
49 49
 
50 50
     /**
51 51
      * @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
52 52
      */
53
-    public function AOK_KnowledgeBase(){
53
+    public function AOK_KnowledgeBase() {
54 54
         $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
55
-        if(isset($GLOBALS['log'])) {
55
+        if (isset($GLOBALS['log'])) {
56 56
             $GLOBALS['log']->deprecated($deprecatedMessage);
57 57
         }
58 58
         else {
Please login to merge, or discard this patch.
modules/AOK_KnowledgeBase/AOK_KnowledgeBase_sugar.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	var $object_name = 'AOK_KnowledgeBase';
51 51
 	var $table_name = 'aok_knowledgebase';
52 52
 	var $importable = false;
53
-	var $disable_row_level_security = true ; // to ensure that modules created and deployed under CE will continue to function under team security if the instance is upgraded to PRO
53
+	var $disable_row_level_security = true; // to ensure that modules created and deployed under CE will continue to function under team security if the instance is upgraded to PRO
54 54
 		var $id;
55 55
 		var $name;
56 56
 		var $date_entered;
@@ -73,16 +73,16 @@  discard block
 block discarded – undo
73 73
 		var $user_id1_c;
74 74
 		var $approver;
75 75
 
76
-    public function __construct(){
76
+    public function __construct() {
77 77
 		parent::__construct();
78 78
 	}
79 79
 
80 80
     /**
81 81
      * @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
82 82
      */
83
-    public function AOK_KnowledgeBase_sugar(){
83
+    public function AOK_KnowledgeBase_sugar() {
84 84
         $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
85
-        if(isset($GLOBALS['log'])) {
85
+        if (isset($GLOBALS['log'])) {
86 86
             $GLOBALS['log']->deprecated($deprecatedMessage);
87 87
         }
88 88
         else {
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
     }
93 93
 
94 94
 
95
-	function bean_implements($interface){
96
-		switch($interface){
95
+	function bean_implements($interface) {
96
+		switch ($interface) {
97 97
 			case 'ACL': return true;
98 98
 		}
99 99
 		return false;
Please login to merge, or discard this patch.
modules/Meetings/Meeting.php 1 patch
Spacing   +125 added lines, -125 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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.
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	var $meetings_arr;
94 94
 	// when assoc w/ a user/contact:
95 95
 	var $minutes_value_default = 15;
96
-	var $minutes_values = array('0'=>'00','15'=>'15','30'=>'30','45'=>'45');
96
+	var $minutes_values = array('0'=>'00', '15'=>'15', '30'=>'30', '45'=>'45');
97 97
 	var $table_name = "meetings";
98 98
 	var $rel_users_table = "meetings_users";
99 99
 	var $rel_contacts_table = "meetings_contacts";
@@ -104,8 +104,8 @@  discard block
 block discarded – undo
104 104
 	var $importable = true;
105 105
 	// This is used to retrieve related fields from form posts.
106 106
 	var $additional_column_fields = array('assigned_user_name', 'assigned_user_id', 'contact_id', 'user_id', 'contact_name', 'accept_status');
107
-	var $relationship_fields = array('account_id'=>'accounts','opportunity_id'=>'opportunity','case_id'=>'case',
108
-									 'assigned_user_id'=>'users','contact_id'=>'contacts', 'user_id'=>'users', 'meeting_id'=>'meetings');
107
+	var $relationship_fields = array('account_id'=>'accounts', 'opportunity_id'=>'opportunity', 'case_id'=>'case',
108
+									 'assigned_user_id'=>'users', 'contact_id'=>'contacts', 'user_id'=>'users', 'meeting_id'=>'meetings');
109 109
 	// so you can run get_users() twice and run query only once
110 110
 	var $cached_get_users = null;
111 111
 	var $new_schema = true;
@@ -117,11 +117,11 @@  discard block
 block discarded – undo
117 117
 	public function __construct() {
118 118
 		parent::__construct();
119 119
 		$this->setupCustomFields('Meetings');
120
-		foreach($this->field_defs as $field) {
120
+		foreach ($this->field_defs as $field) {
121 121
 			$this->field_name_map[$field['name']] = $field;
122 122
 		}
123 123
 //		$this->fill_in_additional_detail_fields();
124
-        if(!empty($GLOBALS['app_list_strings']['duration_intervals'])) {
124
+        if (!empty($GLOBALS['app_list_strings']['duration_intervals'])) {
125 125
             $this->minutes_values = $GLOBALS['app_list_strings']['duration_intervals'];
126 126
         }
127 127
 	}
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
 	/**
130 130
 	 * @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
131 131
 	 */
132
-	public function Meeting(){
132
+	public function Meeting() {
133 133
 		$deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
134
-		if(isset($GLOBALS['log'])) {
134
+		if (isset($GLOBALS['log'])) {
135 135
 			$GLOBALS['log']->deprecated($deprecatedMessage);
136 136
 		}
137 137
 		else {
@@ -145,21 +145,21 @@  discard block
 block discarded – undo
145 145
 	 * @param $view string
146 146
 	 * @param $is_owner bool
147 147
 	 */
148
-	function ACLAccess($view,$is_owner='not_set',$in_group='not_set'){
148
+	function ACLAccess($view, $is_owner = 'not_set', $in_group = 'not_set') {
149 149
 		// don't check if meeting is being synced from Outlook
150
-		if($this->syncing == false){
150
+		if ($this->syncing == false) {
151 151
 			$view = strtolower($view);
152
-			switch($view){
152
+			switch ($view) {
153 153
 				case 'edit':
154 154
 				case 'save':
155 155
 				case 'editview':
156 156
 				case 'delete':
157
-					if(!empty($this->recurring_source) && $this->recurring_source != "Sugar"){
157
+					if (!empty($this->recurring_source) && $this->recurring_source != "Sugar") {
158 158
 						return false;
159 159
 					}
160 160
 			}
161 161
 		}
162
-		return parent::ACLAccess($view,$is_owner,$in_group);
162
+		return parent::ACLAccess($view, $is_owner, $in_group);
163 163
 	}
164 164
 
165 165
 	/**
@@ -178,14 +178,14 @@  discard block
 block discarded – undo
178 178
 
179 179
 		global $disable_date_format;
180 180
 
181
-        if(isset($this->date_start))
181
+        if (isset($this->date_start))
182 182
         {
183 183
             $td = $timedate->fromDb($this->date_start);
184
-            if(!$td){
184
+            if (!$td) {
185 185
             		$this->date_start = $timedate->to_db($this->date_start);
186 186
             		$td = $timedate->fromDb($this->date_start);
187 187
             }
188
-            if($td)
188
+            if ($td)
189 189
             {
190 190
                 if (isset($this->duration_hours) && $this->duration_hours != '')
191 191
                 {
@@ -199,17 +199,17 @@  discard block
 block discarded – undo
199 199
             }
200 200
         }
201 201
 
202
-		$check_notify =(!empty($_REQUEST['send_invites']) && $_REQUEST['send_invites'] == '1') ? true : false;
203
-		if(empty($_REQUEST['send_invites'])) {
204
-			if(!empty($this->id)) {
202
+		$check_notify = (!empty($_REQUEST['send_invites']) && $_REQUEST['send_invites'] == '1') ? true : false;
203
+		if (empty($_REQUEST['send_invites'])) {
204
+			if (!empty($this->id)) {
205 205
 				$old_record = new Meeting();
206 206
 				$old_record->retrieve($this->id);
207 207
 				$old_assigned_user_id = $old_record->assigned_user_id;
208 208
 			}
209
-			if((empty($this->id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $GLOBALS['current_user']->id != $_REQUEST['assigned_user_id']) || (isset($old_assigned_user_id) && !empty($old_assigned_user_id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $old_assigned_user_id != $_REQUEST['assigned_user_id']) ){
209
+			if ((empty($this->id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $GLOBALS['current_user']->id != $_REQUEST['assigned_user_id']) || (isset($old_assigned_user_id) && !empty($old_assigned_user_id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $old_assigned_user_id != $_REQUEST['assigned_user_id'])) {
210 210
 				$this->special_notification = true;
211 211
 				$check_notify = true;
212
-                if(isset($_REQUEST['assigned_user_name'])) {
212
+                if (isset($_REQUEST['assigned_user_name'])) {
213 213
                     $this->new_assigned_user_name = $_REQUEST['assigned_user_name'];
214 214
                 }
215 215
 			}
@@ -221,23 +221,23 @@  discard block
 block discarded – undo
221 221
 		}*/
222 222
 
223 223
 		// prevent a mass mailing for recurring meetings created in Calendar module
224
-		if(empty($this->id) && !empty($_REQUEST['module']) && $_REQUEST['module'] == "Calendar" && !empty($_REQUEST['repeat_type']) && !empty($this->repeat_parent_id))
224
+		if (empty($this->id) && !empty($_REQUEST['module']) && $_REQUEST['module'] == "Calendar" && !empty($_REQUEST['repeat_type']) && !empty($this->repeat_parent_id))
225 225
 			$check_notify = false;
226 226
 
227
-        if (empty($this->status) ) {
227
+        if (empty($this->status)) {
228 228
             $this->status = $this->getDefaultStatus();
229 229
         }
230 230
 
231 231
         // Do any external API saving
232 232
         // Clear out the old external API stuff if we have changed types
233
-        if (isset($this->fetched_row) && $this->fetched_row['type'] != $this->type ) {
233
+        if (isset($this->fetched_row) && $this->fetched_row['type'] != $this->type) {
234 234
             $this->join_url = '';
235 235
             $this->host_url = '';
236 236
             $this->external_id = '';
237 237
             $this->creator = '';
238 238
         }
239 239
 
240
-        if (!empty($this->type) && $this->type != 'Sugar' ) {
240
+        if (!empty($this->type) && $this->type != 'Sugar') {
241 241
             require_once('include/externalAPI/ExternalAPIFactory.php');
242 242
             $api = ExternalAPIFactory::loadAPI($this->type);
243 243
         }
@@ -246,27 +246,27 @@  discard block
 block discarded – undo
246 246
 			$this->type = 'Sugar';
247 247
 		}
248 248
 
249
-        if ( isset($api) && is_a($api,'WebMeeting') && empty($this->in_relationship_update) ) {
249
+        if (isset($api) && is_a($api, 'WebMeeting') && empty($this->in_relationship_update)) {
250 250
             // Make sure the API initialized and it supports Web Meetings
251 251
             // Also make suer we have an ID, the external site needs something to reference
252
-            if ( !isset($this->id) || empty($this->id) ) {
252
+            if (!isset($this->id) || empty($this->id)) {
253 253
                 $this->id = create_guid();
254 254
                 $this->new_with_id = true;
255 255
             }
256 256
             $response = $api->scheduleMeeting($this);
257
-            if ( $response['success'] == TRUE ) {
257
+            if ($response['success'] == TRUE) {
258 258
                 // Need to send out notifications
259
-                if ( $api->canInvite ) {
259
+                if ($api->canInvite) {
260 260
                     $notifyList = $this->get_notification_recipients();
261
-                    foreach($notifyList as $person) {
262
-                        $api->inviteAttendee($this,$person,$check_notify);
261
+                    foreach ($notifyList as $person) {
262
+                        $api->inviteAttendee($this, $person, $check_notify);
263 263
                     }
264 264
 
265 265
                 }
266 266
             } else {
267 267
                 // Generic Message Provides no value to End User - Log the issue with message detail and continue
268 268
                 // SugarApplication::appendErrorMessage($GLOBALS['app_strings']['ERR_EXTERNAL_API_SAVE_FAIL']);
269
-                $GLOBALS['log']->warn('ERR_EXTERNAL_API_SAVE_FAIL' . ": " . $this->type . " - " .  $response['errorMessage']);
269
+                $GLOBALS['log']->warn('ERR_EXTERNAL_API_SAVE_FAIL'.": ".$this->type." - ".$response['errorMessage']);
270 270
             }
271 271
 
272 272
             $api->logoff();
@@ -274,11 +274,11 @@  discard block
 block discarded – undo
274 274
 
275 275
 		$return_id = parent::save($check_notify);
276 276
 
277
-		if($this->update_vcal) {
277
+		if ($this->update_vcal) {
278 278
 			vCal::cache_sugar_vcal($current_user);
279 279
 		}
280 280
 
281
-		if(isset($_REQUEST['reminders_data'])) {
281
+		if (isset($_REQUEST['reminders_data'])) {
282 282
 			Reminder::saveRemindersDataJson('Meetings', $return_id, html_entity_decode($_REQUEST['reminders_data']));
283 283
 		}
284 284
 
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 
297 297
 		parent::mark_deleted($id);
298 298
 
299
-		if($this->update_vcal) {
299
+		if ($this->update_vcal) {
300 300
 			vCal::cache_sugar_vcal($current_user);
301 301
 		}
302 302
 	}
@@ -305,13 +305,13 @@  discard block
 block discarded – undo
305 305
 		return "$this->name";
306 306
 	}
307 307
 
308
-    function create_export_query($order_by, $where, $relate_link_join='')
308
+    function create_export_query($order_by, $where, $relate_link_join = '')
309 309
     {
310 310
         $custom_join = $this->getCustomJoin(true, true, $where);
311 311
         $custom_join['join'] .= $relate_link_join;
312 312
 		$contact_required = stristr($where, "contacts");
313 313
 
314
-		if($contact_required) {
314
+		if ($contact_required) {
315 315
 			$query = "SELECT meetings.*, contacts.first_name, contacts.last_name, contacts.assigned_user_id contact_name_owner, users.user_name as assigned_user_name   ";
316 316
             $query .= $custom_join['select'];
317 317
 			$query .= " FROM contacts, meetings, meetings_contacts ";
@@ -326,14 +326,14 @@  discard block
 block discarded – undo
326 326
 
327 327
         $query .= $custom_join['join'];
328 328
 
329
-		if($where != "")
329
+		if ($where != "")
330 330
 			$query .= " where $where AND ".$where_auto;
331 331
 		else
332 332
 			$query .= " where ".$where_auto;
333 333
 
334 334
         $order_by = $this->process_order_by($order_by);
335 335
         if (!empty($order_by)) {
336
-            $query .= ' ORDER BY ' . $order_by;
336
+            $query .= ' ORDER BY '.$order_by;
337 337
         }
338 338
 
339 339
 		return $query;
@@ -349,12 +349,12 @@  discard block
 block discarded – undo
349 349
 		if (!empty($this->contact_id)) {
350 350
 			$query  = "SELECT first_name, last_name FROM contacts ";
351 351
 			$query .= "WHERE id='$this->contact_id' AND deleted=0";
352
-			$result = $this->db->limitQuery($query,0,1,true," Error filling in additional detail fields: ");
352
+			$result = $this->db->limitQuery($query, 0, 1, true, " Error filling in additional detail fields: ");
353 353
 
354 354
 			// Get the contact name.
355 355
 			$row = $this->db->fetchByAssoc($result);
356 356
 			$GLOBALS['log']->info("additional call fields $query");
357
-			if($row != null)
357
+			if ($row != null)
358 358
 			{
359 359
 				$this->contact_name = $locale->getLocaleFormattedName($row['first_name'], $row['last_name'], '', '');
360 360
 				$GLOBALS['log']->debug("Call($this->id): contact_name = $this->contact_name");
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 
398 398
 		global $timedate;
399 399
         $this->time_meridiem = $timedate->AMPMMenu('', $this->time_start, 'onchange="SugarWidgetScheduler.update_time();"');
400
-		$hours_arr = array ();
400
+		$hours_arr = array();
401 401
 		$num_of_hours = 13;
402 402
 		$start_at = 1;
403 403
 
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 			$start_at = 0;
407 407
 		} //if
408 408
 
409
-		for ($i = $start_at; $i < $num_of_hours; $i ++) {
409
+		for ($i = $start_at; $i < $num_of_hours; $i++) {
410 410
 			$i = $i."";
411 411
 			if (strlen($i) == 1) {
412 412
 				$i = "0".$i;
@@ -429,12 +429,12 @@  discard block
 block discarded – undo
429 429
 		if (is_null($this->duration_minutes))
430 430
 			$this->duration_minutes = "1";
431 431
 
432
-		if(empty($this->id) && !empty($_REQUEST['date_start'])){
432
+		if (empty($this->id) && !empty($_REQUEST['date_start'])) {
433 433
 			$this->date_start = $_REQUEST['date_start'];
434 434
 		}
435
-        if(!empty($this->date_start))
435
+        if (!empty($this->date_start))
436 436
         {
437
-            $td = SugarDateTime::createFromFormat($GLOBALS['timedate']->get_date_time_format(),$this->date_start);
437
+            $td = SugarDateTime::createFromFormat($GLOBALS['timedate']->get_date_time_format(), $this->date_start);
438 438
             if (!empty($td))
439 439
             {
440 440
     	        if (!empty($this->duration_hours) && $this->duration_hours != '')
@@ -455,9 +455,9 @@  discard block
 block discarded – undo
455 455
 
456 456
 		global $app_list_strings;
457 457
 		$parent_types = $app_list_strings['record_type_display'];
458
-		$disabled_parent_types = ACLController::disabledModuleList($parent_types,false, 'list');
459
-		foreach($disabled_parent_types as $disabled_parent_type){
460
-			if($disabled_parent_type != $this->parent_type){
458
+		$disabled_parent_types = ACLController::disabledModuleList($parent_types, false, 'list');
459
+		foreach ($disabled_parent_types as $disabled_parent_type) {
460
+			if ($disabled_parent_type != $this->parent_type) {
461 461
 				unset($parent_types[$disabled_parent_type]);
462 462
 			}
463 463
 		}
@@ -467,9 +467,9 @@  discard block
 block discarded – undo
467 467
 			$this->reminder_time = -1;
468 468
 		}
469 469
 
470
-		if ( empty($this->id) ) {
470
+		if (empty($this->id)) {
471 471
 		    $reminder_t = $GLOBALS['current_user']->getPreference('reminder_time');
472
-		    if ( isset($reminder_t) )
472
+		    if (isset($reminder_t))
473 473
 		        $this->reminder_time = $reminder_t;
474 474
 		}
475 475
 		$this->reminder_checked = $this->reminder_time == -1 ? false : true;
@@ -477,9 +477,9 @@  discard block
 block discarded – undo
477 477
 		if (empty($this->email_reminder_time)) {
478 478
 			$this->email_reminder_time = -1;
479 479
 		}
480
-		if(empty($this->id)){
480
+		if (empty($this->id)) {
481 481
 			$reminder_t = $GLOBALS['current_user']->getPreference('email_reminder_time');
482
-			if(isset($reminder_t))
482
+			if (isset($reminder_t))
483 483
 		    		$this->email_reminder_time = $reminder_t;
484 484
 		}
485 485
 		$this->email_reminder_checked = $this->email_reminder_time == -1 ? false : true;
@@ -496,15 +496,15 @@  discard block
 block discarded – undo
496 496
 		$meeting_fields = $this->get_list_view_array();
497 497
 
498 498
 		global $app_list_strings, $focus, $action, $currentModule;
499
-		if(isset($this->parent_type))
499
+		if (isset($this->parent_type))
500 500
 			$meeting_fields['PARENT_MODULE'] = $this->parent_type;
501
-		if($this->status == "Planned") {
501
+		if ($this->status == "Planned") {
502 502
 			//cn: added this if() to deal with sequential Closes in Meetings.	this is a hack to a hack(formbase.php->handleRedirect)
503
-			if(empty($action))
503
+			if (empty($action))
504 504
 			     $action = "index";
505 505
             $setCompleteUrl = "<a id='{$this->id}' onclick='SUGAR.util.closeActivityPanel.show(\"{$this->module_dir}\",\"{$this->id}\",\"Held\",\"listview\",\"1\");'>";
506 506
 			if ($this->ACLAccess('edit')) {
507
-                $meeting_fields['SET_COMPLETE'] = $setCompleteUrl . SugarThemeRegistry::current()->getImage("close_inline"," border='0'",null,null,'.gif',translate('LBL_CLOSEINLINE'))."</a>";
507
+                $meeting_fields['SET_COMPLETE'] = $setCompleteUrl.SugarThemeRegistry::current()->getImage("close_inline", " border='0'", null, null, '.gif', translate('LBL_CLOSEINLINE'))."</a>";
508 508
             } else {
509 509
                 $meeting_fields['SET_COMPLETE'] = '';
510 510
             }
@@ -514,9 +514,9 @@  discard block
 block discarded – undo
514 514
 		$nextday = $timedate->asDbDate($timedate->getNow()->get("+1 day"));
515 515
 		$mergeTime = $meeting_fields['DATE_START']; //$timedate->merge_date_time($meeting_fields['DATE_START'], $meeting_fields['TIME_START']);
516 516
 		$date_db = $timedate->to_db($mergeTime);
517
-		if($date_db	< $today	) {
518
-			$meeting_fields['DATE_START']= "<font class='overdueTask'>".$meeting_fields['DATE_START']."</font>";
519
-		}else if($date_db	< $nextday) {
517
+		if ($date_db < $today) {
518
+			$meeting_fields['DATE_START'] = "<font class='overdueTask'>".$meeting_fields['DATE_START']."</font>";
519
+		} else if ($date_db < $nextday) {
520 520
 			$meeting_fields['DATE_START'] = "<font class='todaysTask'>".$meeting_fields['DATE_START']."</font>";
521 521
 		} else {
522 522
 			$meeting_fields['DATE_START'] = "<font class='futureTask'>".$meeting_fields['DATE_START']."</font>";
@@ -538,8 +538,8 @@  discard block
 block discarded – undo
538 538
         $meeting_fields['CONTACT_ID'] = $this->contact_id;
539 539
         $meeting_fields['CONTACT_NAME'] = $this->contact_name;
540 540
 		$meeting_fields['PARENT_NAME'] = $this->parent_name;
541
-        $meeting_fields['REMINDER_CHECKED'] = $this->reminder_time==-1 ? false : true;
542
-        $meeting_fields['EMAIL_REMINDER_CHECKED'] = $this->email_reminder_time==-1 ? false : true;
541
+        $meeting_fields['REMINDER_CHECKED'] = $this->reminder_time == -1 ? false : true;
542
+        $meeting_fields['EMAIL_REMINDER_CHECKED'] = $this->email_reminder_time == -1 ? false : true;
543 543
 
544 544
 
545 545
 		return $meeting_fields;
@@ -553,12 +553,12 @@  discard block
 block discarded – undo
553 553
 
554 554
 
555 555
 		// cn: bug 9494 - passing a contact breaks this call
556
-		$notifyUser =($meeting->current_notify_user->object_name == 'User') ? $meeting->current_notify_user : $current_user;
556
+		$notifyUser = ($meeting->current_notify_user->object_name == 'User') ? $meeting->current_notify_user : $current_user;
557 557
 		// cn: bug 8078 - fixed call to $timedate
558
-		if(strtolower(get_class($meeting->current_notify_user)) == 'contact') {
558
+		if (strtolower(get_class($meeting->current_notify_user)) == 'contact') {
559 559
 			$xtpl->assign("ACCEPT_URL", $sugar_config['site_url'].
560 560
 							'/index.php?entryPoint=acceptDecline&module=Meetings&contact_id='.$meeting->current_notify_user->id.'&record='.$meeting->id);
561
-		} elseif(strtolower(get_class($meeting->current_notify_user)) == 'lead') {
561
+		} elseif (strtolower(get_class($meeting->current_notify_user)) == 'lead') {
562 562
 			$xtpl->assign("ACCEPT_URL", $sugar_config['site_url'].
563 563
 							'/index.php?entryPoint=acceptDecline&module=Meetings&lead_id='.$meeting->current_notify_user->id.'&record='.$meeting->id);
564 564
 		} else {
@@ -567,16 +567,16 @@  discard block
 block discarded – undo
567 567
 		}
568 568
 		$xtpl->assign("MEETING_TO", $meeting->current_notify_user->new_assigned_user_name);
569 569
 		$xtpl->assign("MEETING_SUBJECT", trim($meeting->name));
570
-		$xtpl->assign("MEETING_STATUS",(isset($meeting->status)? $app_list_strings['meeting_status_dom'][$meeting->status]:""));
570
+		$xtpl->assign("MEETING_STATUS", (isset($meeting->status) ? $app_list_strings['meeting_status_dom'][$meeting->status] : ""));
571 571
 		$typekey = strtolower($meeting->type);
572
-		if(isset($meeting->type)) {
573
-		    if(!empty($app_list_strings['eapm_list'][$typekey])) {
572
+		if (isset($meeting->type)) {
573
+		    if (!empty($app_list_strings['eapm_list'][$typekey])) {
574 574
     		    $typestring = $app_list_strings['eapm_list'][$typekey];
575 575
 	    	} else {
576 576
 		        $typestring = $app_list_strings['meeting_type_dom'][$meeting->type];
577 577
 		    }
578 578
 		}
579
-		$xtpl->assign("MEETING_TYPE", isset($meeting->type)? $typestring:"");
579
+		$xtpl->assign("MEETING_TYPE", isset($meeting->type) ? $typestring : "");
580 580
 		$startdate = $timedate->fromDb($meeting->date_start);
581 581
 		$xtpl->assign("MEETING_STARTDATE", $timedate->asUser($startdate, $notifyUser)." ".TimeDate::userTimezoneSuffix($startdate, $notifyUser));
582 582
 		$enddate = $timedate->fromDb($meeting->date_end);
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
 		$xtpl->assign("MEETING_HOURS", $meeting->duration_hours);
585 585
 		$xtpl->assign("MEETING_MINUTES", $meeting->duration_minutes);
586 586
 		$xtpl->assign("MEETING_DESCRIPTION", $meeting->description);
587
-        if ( !empty($meeting->join_url) ) {
587
+        if (!empty($meeting->join_url)) {
588 588
             $xtpl->assign('MEETING_URL', $meeting->join_url);
589 589
             $xtpl->parse('Meeting.Meeting_External_API');
590 590
         }
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
 	/**
596 596
 	 * Redefine method to attach ics file to notification email
597 597
 	 */
598
-	public function create_notification_email($notify_user){
598
+	public function create_notification_email($notify_user) {
599 599
         // reset acceptance status for non organizer if date is changed
600 600
         if (($notify_user->id != $GLOBALS['current_user']->id) && $this->date_changed) {
601 601
             $this->set_accept_status($notify_user, 'none');
@@ -603,12 +603,12 @@  discard block
 block discarded – undo
603 603
 
604 604
 		$notify_mail = parent::create_notification_email($notify_user);
605 605
 
606
-		$path = SugarConfig::getInstance()->get('upload_dir','upload/') . $this->id;
606
+		$path = SugarConfig::getInstance()->get('upload_dir', 'upload/').$this->id;
607 607
 
608 608
 		require_once("modules/vCals/vCal.php");
609 609
 		$content = vCal::get_ical_event($this, $GLOBALS['current_user']);
610 610
 
611
-		if(file_put_contents($path,$content)){
611
+		if (file_put_contents($path, $content)) {
612 612
 			$notify_mail->AddAttachment($path, 'meeting.ics', 'base64', 'text/calendar');
613 613
 		}
614 614
 		return $notify_mail;
@@ -617,10 +617,10 @@  discard block
 block discarded – undo
617 617
 	/**
618 618
 	 * Redefine method to remove ics after email is sent
619 619
 	 */
620
-	public function send_assignment_notifications($notify_user, $admin){
620
+	public function send_assignment_notifications($notify_user, $admin) {
621 621
 		parent::send_assignment_notifications($notify_user, $admin);
622 622
 
623
-		$path = SugarConfig::getInstance()->get('upload_dir','upload/') . $this->id;
623
+		$path = SugarConfig::getInstance()->get('upload_dir', 'upload/').$this->id;
624 624
 		unlink($path);
625 625
 	}
626 626
 
@@ -632,13 +632,13 @@  discard block
 block discarded – undo
632 632
 		$result = $this->db->query($query, true);
633 633
 		$list = Array();
634 634
 
635
-		while($row = $this->db->fetchByAssoc($result)) {
635
+		while ($row = $this->db->fetchByAssoc($result)) {
636 636
 			$template = new User(); // PHP 5 will retrieve by reference, always over-writing the "old" one
637 637
 			$record = $template->retrieve($row['user_id']);
638 638
 			$template->required = $row['required'];
639 639
 			$template->accept_status = $row['accept_status'];
640 640
 
641
-			if($record != null) {
641
+			if ($record != null) {
642 642
 				// this copies the object into the array
643 643
 				$list[] = $template;
644 644
 			}
@@ -654,13 +654,13 @@  discard block
 block discarded – undo
654 654
 		$result = $this->db->query($query, true);
655 655
 		$list = Array();
656 656
 
657
-		while($row = $this->db->fetchByAssoc($result)) {
657
+		while ($row = $this->db->fetchByAssoc($result)) {
658 658
 			$record = $template->retrieve($row['meeting_id']);
659 659
 			$template->required = $row['required'];
660 660
 			$template->accept_status = $row['accept_status'];
661 661
 
662 662
 
663
-			if($record != null)
663
+			if ($record != null)
664 664
 			{
665 665
 			// this copies the object into the array
666 666
 			$list[] = $template;
@@ -670,54 +670,54 @@  discard block
 block discarded – undo
670 670
 	}
671 671
 
672 672
 
673
-	function set_accept_status(&$user,$status)
673
+	function set_accept_status(&$user, $status)
674 674
 	{
675
-		if($user->object_name == 'User')
675
+		if ($user->object_name == 'User')
676 676
 		{
677
-			$relate_values = array('user_id'=>$user->id,'meeting_id'=>$this->id);
677
+			$relate_values = array('user_id'=>$user->id, 'meeting_id'=>$this->id);
678 678
 			$data_values = array('accept_status'=>$status);
679
-			$this->set_relationship($this->rel_users_table, $relate_values, true, true,$data_values);
679
+			$this->set_relationship($this->rel_users_table, $relate_values, true, true, $data_values);
680 680
 			global $current_user;
681 681
 
682
-			if($this->update_vcal)
682
+			if ($this->update_vcal)
683 683
 			{
684 684
 				vCal::cache_sugar_vcal($user);
685 685
 			}
686 686
 		}
687
-		else if($user->object_name == 'Contact')
687
+		else if ($user->object_name == 'Contact')
688 688
 		{
689
-			$relate_values = array('contact_id'=>$user->id,'meeting_id'=>$this->id);
689
+			$relate_values = array('contact_id'=>$user->id, 'meeting_id'=>$this->id);
690 690
 			$data_values = array('accept_status'=>$status);
691
-			$this->set_relationship($this->rel_contacts_table, $relate_values, true, true,$data_values);
691
+			$this->set_relationship($this->rel_contacts_table, $relate_values, true, true, $data_values);
692 692
 		}
693
-        else if($user->object_name == 'Lead')
693
+        else if ($user->object_name == 'Lead')
694 694
 		{
695
-			$relate_values = array('lead_id'=>$user->id,'meeting_id'=>$this->id);
695
+			$relate_values = array('lead_id'=>$user->id, 'meeting_id'=>$this->id);
696 696
 			$data_values = array('accept_status'=>$status);
697
-			$this->set_relationship($this->rel_leads_table, $relate_values, true, true,$data_values);
697
+			$this->set_relationship($this->rel_leads_table, $relate_values, true, true, $data_values);
698 698
 		}
699 699
 	}
700 700
 
701 701
 
702 702
 	function get_notification_recipients() {
703
-		if($this->special_notification) {
703
+		if ($this->special_notification) {
704 704
 			return parent::get_notification_recipients();
705 705
 		}
706 706
 
707 707
 		$list = array();
708
-		if(!is_array($this->contacts_arr)) {
709
-			$this->contacts_arr =	array();
708
+		if (!is_array($this->contacts_arr)) {
709
+			$this->contacts_arr = array();
710 710
 		}
711 711
 
712
-		if(!is_array($this->users_arr)) {
713
-			$this->users_arr =	array();
712
+		if (!is_array($this->users_arr)) {
713
+			$this->users_arr = array();
714 714
 		}
715 715
 
716
-        if(!is_array($this->leads_arr)) {
717
-			$this->leads_arr =	array();
716
+        if (!is_array($this->leads_arr)) {
717
+			$this->leads_arr = array();
718 718
 		}
719 719
 
720
-		foreach($this->users_arr as $user_id) {
720
+		foreach ($this->users_arr as $user_id) {
721 721
 			$notify_user = new User();
722 722
 			$notify_user->retrieve($user_id);
723 723
 			$notify_user->new_assigned_user_name = $notify_user->full_name;
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
 			$list[$notify_user->id] = $notify_user;
726 726
 		}
727 727
 
728
-		foreach($this->contacts_arr as $contact_id) {
728
+		foreach ($this->contacts_arr as $contact_id) {
729 729
 			$notify_user = new Contact();
730 730
 			$notify_user->retrieve($contact_id);
731 731
 			$notify_user->new_assigned_user_name = $notify_user->full_name;
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
 			$list[$notify_user->id] = $notify_user;
734 734
 		}
735 735
 
736
-        foreach($this->leads_arr as $lead_id) {
736
+        foreach ($this->leads_arr as $lead_id) {
737 737
 			$notify_user = new Lead();
738 738
 			$notify_user->retrieve($lead_id);
739 739
 			$notify_user->new_assigned_user_name = $notify_user->full_name;
@@ -742,9 +742,9 @@  discard block
 block discarded – undo
742 742
 		}
743 743
 
744 744
 		global $sugar_config;
745
-		if(isset($sugar_config['disable_notify_current_user']) && $sugar_config['disable_notify_current_user']) {
745
+		if (isset($sugar_config['disable_notify_current_user']) && $sugar_config['disable_notify_current_user']) {
746 746
 			global $current_user;
747
-			if(isset($list[$current_user->id]))
747
+			if (isset($list[$current_user->id]))
748 748
 				unset($list[$current_user->id]);
749 749
 		}
750 750
 		return $list;
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
 
753 753
 
754 754
 	function bean_implements($interface) {
755
-		switch($interface) {
755
+		switch ($interface) {
756 756
 			case 'ACL':return true;
757 757
 		}
758 758
 		return false;
@@ -762,18 +762,18 @@  discard block
 block discarded – undo
762 762
 		$array_assign = parent::listviewACLHelper();
763 763
 		$is_owner = false;
764 764
 		$in_group = false; //SECURITY GROUPS
765
-		if(!empty($this->parent_name)) {
765
+		if (!empty($this->parent_name)) {
766 766
 
767
-			if(!empty($this->parent_name_owner)) {
767
+			if (!empty($this->parent_name_owner)) {
768 768
 				global $current_user;
769 769
 				$is_owner = $current_user->id == $this->parent_name_owner;
770 770
 			}
771 771
 			/* BEGIN - SECURITY GROUPS */
772 772
 			//parent_name_owner not being set for whatever reason so we need to figure this out
773
-			else if(!empty($this->parent_type) && !empty($this->parent_id)) {
773
+			else if (!empty($this->parent_type) && !empty($this->parent_id)) {
774 774
 				global $current_user;
775
-                $parent_bean = BeanFactory::getBean($this->parent_type,$this->parent_id);
776
-                if($parent_bean !== false) {
775
+                $parent_bean = BeanFactory::getBean($this->parent_type, $this->parent_id);
776
+                if ($parent_bean !== false) {
777 777
                 	$is_owner = $current_user->id == $parent_bean->assigned_user_id;
778 778
                 }
779 779
 			}
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
 		/**
787 787
 		if(!ACLController::moduleSupportsACL($this->parent_type) || ACLController::checkAccess($this->parent_type, 'view', $is_owner)) {
788 788
 		*/
789
-		if(!ACLController::moduleSupportsACL($this->parent_type) || ACLController::checkAccess($this->parent_type, 'view', $is_owner, 'module', $in_group)){
789
+		if (!ACLController::moduleSupportsACL($this->parent_type) || ACLController::checkAccess($this->parent_type, 'view', $is_owner, 'module', $in_group)) {
790 790
         /* END - SECURITY GROUPS */
791 791
 			$array_assign['PARENT'] = 'a';
792 792
 		} else {
@@ -796,8 +796,8 @@  discard block
 block discarded – undo
796 796
 		$is_owner = false;
797 797
 		$in_group = false; //SECURITY GROUPS
798 798
 
799
-		if(!empty($this->contact_name)) {
800
-			if(!empty($this->contact_name_owner)) {
799
+		if (!empty($this->contact_name)) {
800
+			if (!empty($this->contact_name_owner)) {
801 801
 				global $current_user;
802 802
 				$is_owner = $current_user->id == $this->contact_name_owner;
803 803
 			}
@@ -805,8 +805,8 @@  discard block
 block discarded – undo
805 805
 			//contact_name_owner not being set for whatever reason so we need to figure this out
806 806
 			else {
807 807
 				global $current_user;
808
-                $parent_bean = BeanFactory::getBean('Contacts',$this->contact_id);
809
-                if($parent_bean !== false) {
808
+                $parent_bean = BeanFactory::getBean('Contacts', $this->contact_id);
809
+                if ($parent_bean !== false) {
810 810
                 	$is_owner = $current_user->id == $parent_bean->assigned_user_id;
811 811
                 }
812 812
 			}
@@ -819,7 +819,7 @@  discard block
 block discarded – undo
819 819
 		/**
820 820
 		if(ACLController::checkAccess('Contacts', 'view', $is_owner)) {
821 821
 		*/
822
-		if(ACLController::checkAccess('Contacts', 'view', $is_owner, 'module', $in_group)) {
822
+		if (ACLController::checkAccess('Contacts', 'view', $is_owner, 'module', $in_group)) {
823 823
         /* END - SECURITY GROUPS */
824 824
 			$array_assign['CONTACT'] = 'a';
825 825
 		} else {
@@ -830,17 +830,17 @@  discard block
 block discarded – undo
830 830
 
831 831
 
832 832
 	function save_relationship_changes($is_update, $exclude = array()) {
833
-	    if(empty($this->in_workflow)) {
834
-           if(empty($this->in_import)){//if a meeting is being imported then contact_id  should not be excluded
833
+	    if (empty($this->in_workflow)) {
834
+           if (empty($this->in_import)) {//if a meeting is being imported then contact_id  should not be excluded
835 835
            //if the global soap_server_object variable is not empty (as in from a soap/OPI call), then process the assigned_user_id relationship, otherwise
836 836
            //add assigned_user_id to exclude list and let the logic from MeetingFormBase determine whether assigned user id gets added to the relationship
837
-           	if(!empty($GLOBALS['soap_server_object'])){
837
+           	if (!empty($GLOBALS['soap_server_object'])) {
838 838
            		$exclude = array('contact_id', 'user_id');
839
-           	}else{
840
-	    		$exclude = array('contact_id', 'user_id','assigned_user_id');
839
+           	} else {
840
+	    		$exclude = array('contact_id', 'user_id', 'assigned_user_id');
841 841
            	}
842 842
            }
843
-           else{
843
+           else {
844 844
            	$exclude = array('user_id');
845 845
            }
846 846
         }
@@ -853,14 +853,14 @@  discard block
 block discarded – undo
853 853
 	 */
854 854
 	public function afterImportSave()
855 855
 	{
856
-	    if ( $this->parent_type == 'Contacts' ) {
856
+	    if ($this->parent_type == 'Contacts') {
857 857
 	        $this->load_relationship('contacts');
858
-	        if ( !$this->contacts->relationship_exists('contacts',array('id'=>$this->parent_id)) )
858
+	        if (!$this->contacts->relationship_exists('contacts', array('id'=>$this->parent_id)))
859 859
 	            $this->contacts->add($this->parent_id);
860 860
 	    }
861
-	    elseif ( $this->parent_type == 'Leads' ) {
861
+	    elseif ($this->parent_type == 'Leads') {
862 862
 	        $this->load_relationship('leads');
863
-	        if ( !$this->leads->relationship_exists('leads',array('id'=>$this->parent_id)) )
863
+	        if (!$this->leads->relationship_exists('leads', array('id'=>$this->parent_id)))
864 864
 	            $this->leads->add($this->parent_id);
865 865
 	    }
866 866
 
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
         sugar_cache_put($cacheKeyName, $apiList);
903 903
     }
904 904
 
905
-	if(!empty($value) && empty($apiList[$value]))
905
+	if (!empty($value) && empty($apiList[$value]))
906 906
 	{
907 907
 		$apiList[$value] = $value;
908 908
     }
Please login to merge, or discard this patch.
modules/Meetings/MeetingsJjwg_MapsLogicHook.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@
 block discarded – undo
15 15
     /**
16 16
      * @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
17 17
      */
18
-    function MeetingsJjwg_MapsLogicHook(){
18
+    function MeetingsJjwg_MapsLogicHook() {
19 19
         $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
20
-        if(isset($GLOBALS['log'])) {
20
+        if (isset($GLOBALS['log'])) {
21 21
             $GLOBALS['log']->deprecated($deprecatedMessage);
22 22
         }
23 23
         else {
Please login to merge, or discard this patch.
modules/Meetings/views/view.listbytype.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 /*********************************************************************************
5 5
  * SugarCRM Community Edition is a customer relationship management program developed by
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
     /**
53 53
      * @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
54 54
      */
55
-    function MeetingsViewListbytype(){
55
+    function MeetingsViewListbytype() {
56 56
         $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
57
-        if(isset($GLOBALS['log'])) {
57
+        if (isset($GLOBALS['log'])) {
58 58
             $GLOBALS['log']->deprecated($deprecatedMessage);
59 59
         }
60 60
         else {
@@ -64,20 +64,20 @@  discard block
 block discarded – undo
64 64
     }
65 65
 
66 66
 
67
- 	function listViewProcess(){
68
-        if (!$eapmBean = EAPM::getLoginInfo('IBMSmartCloud', true) ) {
67
+ 	function listViewProcess() {
68
+        if (!$eapmBean = EAPM::getLoginInfo('IBMSmartCloud', true)) {
69 69
             $smarty = new Sugar_Smarty();
70 70
             echo $smarty->fetch('include/externalAPI/IBMSmartCloud/IBMSmartCloudSignup.'.$GLOBALS['current_language'].'.tpl');
71 71
             return;
72 72
         }
73 73
 
74 74
         $apiName = 'IBMSmartCloud';
75
-        $api = ExternalAPIFactory::loadAPI($apiName,true);
75
+        $api = ExternalAPIFactory::loadAPI($apiName, true);
76 76
         $api->loadEAPM($eapmBean);
77 77
 
78 78
         $quickCheck = $api->quickCheckLogin();
79
-        if ( ! $quickCheck['success'] ) {
80
-            $errorMessage = string_format(translate('LBL_ERR_FAILED_QUICKCHECK','EAPM'), array('IBM SmartCloud'));
79
+        if (!$quickCheck['success']) {
80
+            $errorMessage = string_format(translate('LBL_ERR_FAILED_QUICKCHECK', 'EAPM'), array('IBM SmartCloud'));
81 81
             $errorMessage .= '<form method="POST" target="_EAPM_CHECK" action="index.php">';
82 82
             $errorMessage .= '<input type="hidden" name="module" value="EAPM">';
83 83
             $errorMessage .= '<input type="hidden" name="action" value="Save">';
@@ -102,18 +102,18 @@  discard block
 block discarded – undo
102 102
 
103 103
    		unset($this->searchForm->searchdefs['layout']['advanced_search']);
104 104
 
105
-		if(!$this->headers) {
105
+		if (!$this->headers) {
106 106
 			return;
107 107
         }
108 108
 
109
-		if(empty($_REQUEST['search_form_only']) || $_REQUEST['search_form_only'] == false){
110
-			$this->lv->ss->assign("SEARCH",false);
111
-            if ( !isset($_REQUEST['name_basic']) ) {
109
+		if (empty($_REQUEST['search_form_only']) || $_REQUEST['search_form_only'] == false) {
110
+			$this->lv->ss->assign("SEARCH", false);
111
+            if (!isset($_REQUEST['name_basic'])) {
112 112
                 $_REQUEST['name_basic'] = '';
113 113
             }
114
-            $this->lv->ss->assign('DCSEARCH',$_REQUEST['name_basic']);
114
+            $this->lv->ss->assign('DCSEARCH', $_REQUEST['name_basic']);
115 115
 			$this->lv->setup($this->seed, 'include/ListView/ListViewDCMenu.tpl', $this->where, $this->params);
116
-			$savedSearchName = empty($_REQUEST['saved_search_select_name']) ? '' : (' - ' . $_REQUEST['saved_search_select_name']);
116
+			$savedSearchName = empty($_REQUEST['saved_search_select_name']) ? '' : (' - '.$_REQUEST['saved_search_select_name']);
117 117
 			echo $this->lv->display();
118 118
 		}
119 119
  	}
@@ -124,18 +124,18 @@  discard block
 block discarded – undo
124 124
         $_REQUEST = $oldRequest;
125 125
     }
126 126
 
127
-    function processSearchForm(){
127
+    function processSearchForm() {
128 128
    		// $type = 'LotusLiveDirect';
129 129
    		$type = 'IBMSmartCloud';
130 130
           global $timedate;
131 131
 
132 132
          $two_hours_ago = $GLOBALS['db']->convert($GLOBALS['db']->quoted($timedate->asDb($timedate->getNow()->get("-2 hours"))), 'datetime');
133 133
 
134
-   		$where =  " meetings.type = '$type' AND meetings.status != 'Held' AND meetings.status != 'Not Held' AND meetings.date_start > {$two_hours_ago} AND ( meetings.assigned_user_id = '".$GLOBALS['db']->quote($GLOBALS['current_user']->id)."' OR exists ( SELECT id FROM meetings_users WHERE meeting_id = meetings.id AND user_id = '".$GLOBALS['db']->quote($GLOBALS['current_user']->id)."' AND deleted = 0 ) ) ";
134
+   		$where = " meetings.type = '$type' AND meetings.status != 'Held' AND meetings.status != 'Not Held' AND meetings.date_start > {$two_hours_ago} AND ( meetings.assigned_user_id = '".$GLOBALS['db']->quote($GLOBALS['current_user']->id)."' OR exists ( SELECT id FROM meetings_users WHERE meeting_id = meetings.id AND user_id = '".$GLOBALS['db']->quote($GLOBALS['current_user']->id)."' AND deleted = 0 ) ) ";
135 135
 
136
-          if ( isset($_REQUEST['name_basic']) ) {
136
+          if (isset($_REQUEST['name_basic'])) {
137 137
               $name_search = trim($_REQUEST['name_basic']);
138
-              if ( ! empty($name_search) ) {
138
+              if (!empty($name_search)) {
139 139
                   $where .= " AND meetings.name LIKE '".$GLOBALS['db']->quote($name_search)."%' ";
140 140
               }
141 141
           }
Please login to merge, or discard this patch.
modules/Meetings/MeetingsListViewSmarty.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -14,9 +14,9 @@  discard block
 block discarded – undo
14 14
     /**
15 15
      * @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
16 16
      */
17
-    function MeetingsListViewSmarty(){
17
+    function MeetingsListViewSmarty() {
18 18
         $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
19
-        if(isset($GLOBALS['log'])) {
19
+        if (isset($GLOBALS['log'])) {
20 20
             $GLOBALS['log']->deprecated($deprecatedMessage);
21 21
         }
22 22
         else {
@@ -31,14 +31,14 @@  discard block
 block discarded – undo
31 31
 
32 32
         global $app_strings;
33 33
 
34
-        $script = "<a href='javascript:void(0)' id='export_listview_top' " .
35
-            "onclick=\"return sListView.send_form(true, '{$_REQUEST['module']}', " .
36
-            "'index.php?entryPoint=export', " .
37
-            "'{$app_strings['LBL_LISTVIEW_NO_SELECTED']}')\">{$app_strings['LBL_EXPORT']}</a>" .
38
-            "</li><li>" . // List item hack
39
-            "<a href='javascript:void(0)' id='map_listview_top' " .
40
-            " onclick=\"return sListView.send_form(true, 'jjwg_Maps', " .
41
-            "'index.php?entryPoint=jjwg_Maps&display_module={$_REQUEST['module']}', " .
34
+        $script = "<a href='javascript:void(0)' id='export_listview_top' ".
35
+            "onclick=\"return sListView.send_form(true, '{$_REQUEST['module']}', ".
36
+            "'index.php?entryPoint=export', ".
37
+            "'{$app_strings['LBL_LISTVIEW_NO_SELECTED']}')\">{$app_strings['LBL_EXPORT']}</a>".
38
+            "</li><li>".// List item hack
39
+            "<a href='javascript:void(0)' id='map_listview_top' ".
40
+            " onclick=\"return sListView.send_form(true, 'jjwg_Maps', ".
41
+            "'index.php?entryPoint=jjwg_Maps&display_module={$_REQUEST['module']}', ".
42 42
             "'{$app_strings['LBL_LISTVIEW_NO_SELECTED']}')\">{$app_strings['LBL_MAP']}</a>";
43 43
 
44 44
         return $script;
Please login to merge, or discard this patch.
modules/SugarFeed/Dashlets/SugarFeedDashlet/SugarFeedDashlet.php 1 patch
Spacing   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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('/&amp;lt;(\/*[bi])&amp;gt;/i','<$1>', $text);
366
+			$text = preg_replace('/&amp;lt;(\/*[bi])&amp;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
 block discarded – undo
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('/&amp;lt;(\/*[bi])&amp;gt;/i','<$1>', $text);
379
+			$text = preg_replace('/&amp;lt;(\/*[bi])&amp;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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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)) {
Please login to merge, or discard this patch.
modules/Contacts/ContactsJjwg_MapsLogicHook.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@
 block discarded – undo
15 15
     /**
16 16
      * @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
17 17
      */
18
-    function ContactsJjwg_MapsLogicHook(){
18
+    function ContactsJjwg_MapsLogicHook() {
19 19
         $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
20
-        if(isset($GLOBALS['log'])) {
20
+        if (isset($GLOBALS['log'])) {
21 21
             $GLOBALS['log']->deprecated($deprecatedMessage);
22 22
         }
23 23
         else {
Please login to merge, or discard this patch.
modules/Contacts/ContactsListViewSmarty.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 
6 6
 class ContactsListViewSmarty extends ListViewSmarty {
7 7
 
8
-	function __construct(){
8
+	function __construct() {
9 9
 
10 10
 		parent::__construct();
11 11
 		$this->targetList = true;
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
     /**
16 16
      * @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
17 17
      */
18
-    function ContactsListViewSmarty(){
18
+    function ContactsListViewSmarty() {
19 19
         $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
20
-        if(isset($GLOBALS['log'])) {
20
+        if (isset($GLOBALS['log'])) {
21 21
             $GLOBALS['log']->deprecated($deprecatedMessage);
22 22
         }
23 23
         else {
@@ -30,25 +30,25 @@  discard block
 block discarded – undo
30 30
 	function process($file, $data, $htmlVar) {
31 31
 		parent::process($file, $data, $htmlVar);
32 32
 
33
-        	if(!ACLController::checkAccess($this->seed->module_dir,'export',true) || !$this->export) {
33
+        	if (!ACLController::checkAccess($this->seed->module_dir, 'export', true) || !$this->export) {
34 34
 			$this->ss->assign('exportLink', $this->buildExportLink());
35 35
 		}
36 36
 	}
37 37
 
38
-	function buildExportLink($id = 'export_link'){
38
+	function buildExportLink($id = 'export_link') {
39 39
 		global $app_strings;
40 40
 		global $sugar_config;
41 41
 
42 42
 		$script = "";
43
-		if(ACLController::checkAccess($this->seed->module_dir,'export',true)) {
44
-			if($this->export) {
43
+		if (ACLController::checkAccess($this->seed->module_dir, 'export', true)) {
44
+			if ($this->export) {
45 45
                 		$script = parent::buildExportLink($id);
46 46
             		}
47 47
         	}
48 48
 
49
-            $script .= "<a href='javascript:void(0)' id='map_listview_top' " .
50
-                    " onclick=\"return sListView.send_form(true, 'jjwg_Maps', " .
51
-                    "'index.php?entryPoint=jjwg_Maps&display_module={$_REQUEST['module']}', " .
49
+            $script .= "<a href='javascript:void(0)' id='map_listview_top' ".
50
+                    " onclick=\"return sListView.send_form(true, 'jjwg_Maps', ".
51
+                    "'index.php?entryPoint=jjwg_Maps&display_module={$_REQUEST['module']}', ".
52 52
                     "'{$app_strings['LBL_LISTVIEW_NO_SELECTED']}')\">{$app_strings['LBL_MAP']}</a>";
53 53
 
54 54
 		return formLetter::LVSmarty().$script;
Please login to merge, or discard this patch.