Test Failed
Push — CI ( 0f01dd...c95a04 )
by Adam
55:13
created
modules/Opportunities/metadata/metafiles.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -43,13 +43,13 @@
 block discarded – undo
43 43
  * To change the template for this generated file go to
44 44
  * Window - Preferences - PHPeclipse - PHP - Code Templates
45 45
  */
46
- $metafiles['Opportunities'] = array(
47
-	'detailviewdefs'  => 	'modules/Opportunities/metadata/detailviewdefs.php', 	
48
-	'editviewdefs'    => 	'modules/Opportunities/metadata/editviewdefs.php',
49
- 	'listviewdefs'    => 	'modules/Opportunities/metadata/listviewdefs.php',
50
- 	'searchdefs'      =>    'modules/Opportunities/metadata/searchdefs.php',
51
- 	'popupdefs'	      =>    'modules/Opportunities/metadata/popupdefs.php',
52
- 	'searchfields'	  =>    'modules/Opportunities/metadata/SearchFields.php',
46
+    $metafiles['Opportunities'] = array(
47
+    'detailviewdefs'  => 	'modules/Opportunities/metadata/detailviewdefs.php', 	
48
+    'editviewdefs'    => 	'modules/Opportunities/metadata/editviewdefs.php',
49
+        'listviewdefs'    => 	'modules/Opportunities/metadata/listviewdefs.php',
50
+        'searchdefs'      =>    'modules/Opportunities/metadata/searchdefs.php',
51
+        'popupdefs'	      =>    'modules/Opportunities/metadata/popupdefs.php',
52
+        'searchfields'	  =>    'modules/Opportunities/metadata/SearchFields.php',
53 53
 
54
- );
54
+    );
55 55
 ?>
Please login to merge, or discard this patch.
modules/Opportunities/metadata/listviewdefs.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -42,43 +42,43 @@  discard block
 block discarded – undo
42 42
 
43 43
 
44 44
 $listViewDefs['Opportunities'] = array(
45
-	'NAME' => array(
46
-		'width'   => '30',  
47
-		'label'   => 'LBL_LIST_OPPORTUNITY_NAME', 
48
-		'link'    => true,
45
+    'NAME' => array(
46
+        'width'   => '30',  
47
+        'label'   => 'LBL_LIST_OPPORTUNITY_NAME', 
48
+        'link'    => true,
49 49
         'default' => true),
50
-	'ACCOUNT_NAME' => array(
51
-		'width'   => '20', 
52
-		'label'   => 'LBL_LIST_ACCOUNT_NAME', 
53
-		'id'      => 'ACCOUNT_ID',
50
+    'ACCOUNT_NAME' => array(
51
+        'width'   => '20', 
52
+        'label'   => 'LBL_LIST_ACCOUNT_NAME', 
53
+        'id'      => 'ACCOUNT_ID',
54 54
         'module'  => 'Accounts',
55
-		'link'    => true,
55
+        'link'    => true,
56 56
         'default' => true,
57 57
         'sortable'=> true,
58 58
         'ACLTag' => 'ACCOUNT',
59 59
         'contextMenu' => array('objectType' => 'sugarAccount', 
60
-                               'metaData' => array('return_module' => 'Contacts', 
61
-                                                   'return_action' => 'ListView', 
62
-                                                   'module' => 'Accounts',
63
-                                                   'return_action' => 'ListView', 
64
-                                                   'parent_id' => '{$ACCOUNT_ID}', 
65
-                                                   'parent_name' => '{$ACCOUNT_NAME}', 
66
-                                                   'account_id' => '{$ACCOUNT_ID}', 
67
-                                                   'account_name' => '{$ACCOUNT_NAME}',
68
-                                                   ),
69
-                              ),
60
+                                'metaData' => array('return_module' => 'Contacts', 
61
+                                                    'return_action' => 'ListView', 
62
+                                                    'module' => 'Accounts',
63
+                                                    'return_action' => 'ListView', 
64
+                                                    'parent_id' => '{$ACCOUNT_ID}', 
65
+                                                    'parent_name' => '{$ACCOUNT_NAME}', 
66
+                                                    'account_id' => '{$ACCOUNT_ID}', 
67
+                                                    'account_name' => '{$ACCOUNT_NAME}',
68
+                                                    ),
69
+                                ),
70 70
         'related_fields' => array('account_id')),
71
-	'SALES_STAGE' => array(
72
-		'width'   => '10',  
73
-		'label'   => 'LBL_LIST_SALES_STAGE',
71
+    'SALES_STAGE' => array(
72
+        'width'   => '10',  
73
+        'label'   => 'LBL_LIST_SALES_STAGE',
74 74
         'default' => true), 
75
-	'AMOUNT_USDOLLAR' => array(
76
-		'width'   => '10', 
77
-		'label'   => 'LBL_LIST_AMOUNT_USDOLLAR',
75
+    'AMOUNT_USDOLLAR' => array(
76
+        'width'   => '10', 
77
+        'label'   => 'LBL_LIST_AMOUNT_USDOLLAR',
78 78
         'align'   => 'right',
79 79
         'default' => true,
80 80
         'currency_format' => true,
81
-	),  
81
+    ),  
82 82
     'OPPORTUNITY_TYPE' => array(
83 83
         'width' => '15', 
84 84
         'label' => 'LBL_TYPE'),
@@ -91,17 +91,17 @@  discard block
 block discarded – undo
91 91
     'PROBABILITY' => array(
92 92
         'width' => '10', 
93 93
         'label' => 'LBL_PROBABILITY'),
94
-	'DATE_CLOSED' => array(
95
-		'width' => '10', 
96
-		'label' => 'LBL_LIST_DATE_CLOSED',
94
+    'DATE_CLOSED' => array(
95
+        'width' => '10', 
96
+        'label' => 'LBL_LIST_DATE_CLOSED',
97 97
         'default' => true),
98 98
     'CREATED_BY_NAME' => array(
99 99
         'width' => '10', 
100 100
         'label' => 'LBL_CREATED'),
101
-	'ASSIGNED_USER_NAME' => array(
102
-		'width' => '5', 
103
-		'label' => 'LBL_LIST_ASSIGNED_USER',
104
-		'module' => 'Employees',
101
+    'ASSIGNED_USER_NAME' => array(
102
+        'width' => '5', 
103
+        'label' => 'LBL_LIST_ASSIGNED_USER',
104
+        'module' => 'Employees',
105 105
         'id' => 'ASSIGNED_USER_ID',
106 106
         'default' => true),
107 107
     'MODIFIED_BY_NAME' => array(
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
     'DATE_ENTERED' => array(
111 111
         'width' => '10', 
112 112
         'label' => 'LBL_DATE_ENTERED',
113
-		'default' => true)
113
+        'default' => true)
114 114
 );
115 115
 
116 116
 ?>
Please login to merge, or discard this patch.
modules/Opportunities/OpportunityFormBase.php 1 patch
Indentation   +129 added lines, -129 removed lines patch added patch discarded remove patch
@@ -45,97 +45,97 @@  discard block
 block discarded – undo
45 45
 
46 46
 
47 47
 function checkForDuplicates($prefix){
48
-	require_once('include/formbase.php');
48
+    require_once('include/formbase.php');
49 49
 	
50
-	$focus = new Opportunity();
51
-	$query = '';
52
-	$baseQuery = 'select id, name, sales_stage,amount, date_closed  from opportunities where deleted!=1 and (';
53
-
54
-	if(isset($_POST[$prefix.'name']) && !empty($_POST[$prefix.'name'])){
55
-		$query = $baseQuery ."  name like '%".$_POST[$prefix.'name']."%'";
56
-		$query .= getLikeForEachWord('name', $_POST[$prefix.'name']);
57
-	}
58
-
59
-	if(!empty($query)){
60
-		$rows = array();
61
-		global $db;
62
-		$result = $db->query($query.')');
63
-		$i=-1;
64
-		while(($row=$db->fetchByAssoc($result)) != null) {
65
-			$i++;
66
-			$rows[$i] = $row;
67
-		}
68
-		if ($i==-1) return null;
50
+    $focus = new Opportunity();
51
+    $query = '';
52
+    $baseQuery = 'select id, name, sales_stage,amount, date_closed  from opportunities where deleted!=1 and (';
53
+
54
+    if(isset($_POST[$prefix.'name']) && !empty($_POST[$prefix.'name'])){
55
+        $query = $baseQuery ."  name like '%".$_POST[$prefix.'name']."%'";
56
+        $query .= getLikeForEachWord('name', $_POST[$prefix.'name']);
57
+    }
58
+
59
+    if(!empty($query)){
60
+        $rows = array();
61
+        global $db;
62
+        $result = $db->query($query.')');
63
+        $i=-1;
64
+        while(($row=$db->fetchByAssoc($result)) != null) {
65
+            $i++;
66
+            $rows[$i] = $row;
67
+        }
68
+        if ($i==-1) return null;
69 69
 		
70
-		return $rows;		
71
-	}
72
-	return null;
70
+        return $rows;		
71
+    }
72
+    return null;
73 73
 }
74 74
 
75 75
 
76 76
 function buildTableForm($rows, $mod='Opportunities'){
77
-	if(!empty($mod)){
78
-	global $current_language;
79
-	$mod_strings = return_module_language($current_language, $mod);
80
-	}else global $mod_strings;
81
-	global $app_strings;
82
-	$cols = sizeof($rows[0]) * 2 + 1;
83
-	$form = '<table width="100%"><tr><td>'.$mod_strings['MSG_DUPLICATE']. '</td></tr><tr><td height="20"></td></tr></table>';
84
-
85
-	$form .= "<form action='index.php' method='post' name='dupOpps'><input type='hidden' name='selectedOpportunity' value=''>";
86
-	$form .= "<table width='100%' cellpadding='0' cellspacing='0' class='list view'>";
87
-	$form .= "<tr class='pagination'><td colspan='$cols'><table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td><input type='submit' class='button' name='ContinueOpportunity' value='${mod_strings['LNK_NEW_OPPORTUNITY']}'></td></tr></table></td></tr><tr>";
88
-	$form .= "<tr><td scope='col'>&nbsp;</td>";
77
+    if(!empty($mod)){
78
+    global $current_language;
79
+    $mod_strings = return_module_language($current_language, $mod);
80
+    }else global $mod_strings;
81
+    global $app_strings;
82
+    $cols = sizeof($rows[0]) * 2 + 1;
83
+    $form = '<table width="100%"><tr><td>'.$mod_strings['MSG_DUPLICATE']. '</td></tr><tr><td height="20"></td></tr></table>';
84
+
85
+    $form .= "<form action='index.php' method='post' name='dupOpps'><input type='hidden' name='selectedOpportunity' value=''>";
86
+    $form .= "<table width='100%' cellpadding='0' cellspacing='0' class='list view'>";
87
+    $form .= "<tr class='pagination'><td colspan='$cols'><table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td><input type='submit' class='button' name='ContinueOpportunity' value='${mod_strings['LNK_NEW_OPPORTUNITY']}'></td></tr></table></td></tr><tr>";
88
+    $form .= "<tr><td scope='col'>&nbsp;</td>";
89 89
     require_once('include/formbase.php');
90
-	$form .= getPostToForm();
91
-	if(isset($rows[0])){
92
-		foreach ($rows[0] as $key=>$value){
93
-			if($key != 'id'){
94
-					$form .= "<td scope='col'>". $mod_strings[$mod_strings['db_'.$key]]. "</td>";
95
-		}}
96
-		$form .= "</tr>";
97
-	}
98
-
99
-	$rowColor = 'oddListRowS1';
100
-	foreach($rows as $row){
101
-
102
-		$form .= "<tr class='$rowColor'>";
103
-
104
-		$form .= "<td width='1%' nowrap='nowrap'><a href='#' onclick='document.dupOpps.selectedOpportunity.value=\"${row['id']}\";document.dupOpps.submit();'>[${app_strings['LBL_SELECT_BUTTON_LABEL']}]</a>&nbsp;&nbsp;</td>";
105
-		$wasSet = false;
106
-		foreach ($row as $key=>$value){
107
-				if($key != 'id'){
108
-					if(!$wasSet){
109
-					$form .= "<td scope='row'><a target='_blank' href='index.php?module=Opportunities&action=DetailView&record=${row['id']}'>$value</a></td>";
110
-					$wasSet = true;
111
-					}else{
112
-					$form .= "<td><a target='_blank' href='index.php?module=Opportunities&action=DetailView&record=${row['id']}'>$value</a></td>";
113
-					}
114
-				}}
115
-
116
-		if($rowColor == 'evenListRowS1'){
117
-			$rowColor = 'oddListRowS1';
118
-		}else{
119
-			 $rowColor = 'evenListRowS1';
120
-		}
121
-		$form .= "</tr>";
122
-	}
90
+    $form .= getPostToForm();
91
+    if(isset($rows[0])){
92
+        foreach ($rows[0] as $key=>$value){
93
+            if($key != 'id'){
94
+                    $form .= "<td scope='col'>". $mod_strings[$mod_strings['db_'.$key]]. "</td>";
95
+        }}
96
+        $form .= "</tr>";
97
+    }
98
+
99
+    $rowColor = 'oddListRowS1';
100
+    foreach($rows as $row){
101
+
102
+        $form .= "<tr class='$rowColor'>";
103
+
104
+        $form .= "<td width='1%' nowrap='nowrap'><a href='#' onclick='document.dupOpps.selectedOpportunity.value=\"${row['id']}\";document.dupOpps.submit();'>[${app_strings['LBL_SELECT_BUTTON_LABEL']}]</a>&nbsp;&nbsp;</td>";
105
+        $wasSet = false;
106
+        foreach ($row as $key=>$value){
107
+                if($key != 'id'){
108
+                    if(!$wasSet){
109
+                    $form .= "<td scope='row'><a target='_blank' href='index.php?module=Opportunities&action=DetailView&record=${row['id']}'>$value</a></td>";
110
+                    $wasSet = true;
111
+                    }else{
112
+                    $form .= "<td><a target='_blank' href='index.php?module=Opportunities&action=DetailView&record=${row['id']}'>$value</a></td>";
113
+                    }
114
+                }}
115
+
116
+        if($rowColor == 'evenListRowS1'){
117
+            $rowColor = 'oddListRowS1';
118
+        }else{
119
+                $rowColor = 'evenListRowS1';
120
+        }
121
+        $form .= "</tr>";
122
+    }
123 123
     $form .= "<tr class='pagination'><td colspan='$cols'><table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td><input type='submit' class='button' name='ContinueOpportunity' value='${mod_strings['LNK_NEW_OPPORTUNITY']}'></td></tr></table></td></tr><tr>";
124
-	$form .= "</table><BR></form>";
124
+    $form .= "</table><BR></form>";
125 125
 
126
-	return $form;
126
+    return $form;
127 127
 
128 128
 
129 129
 
130 130
 }
131 131
 
132 132
 function getForm($prefix, $mod='Opportunities'){
133
-	if(!ACLController::checkAccess('Opportunities', 'edit', true)){
134
-		return '';
135
-	}
133
+    if(!ACLController::checkAccess('Opportunities', 'edit', true)){
134
+        return '';
135
+    }
136 136
 if(!empty($mod)){
137
-	global $current_language;
138
-	$mod_strings = return_module_language($current_language, $mod);
137
+    global $current_language;
138
+    $mod_strings = return_module_language($current_language, $mod);
139 139
 }else global $mod_strings;
140 140
 global $app_strings;
141 141
 global $sugar_version, $sugar_config;
@@ -165,18 +165,18 @@  discard block
 block discarded – undo
165 165
 }
166 166
 
167 167
 function getWideFormBody($prefix, $mod='Opportunities', $formname='', $lead='', $showaccount = true){
168
-	if(!ACLController::checkAccess('Opportunities', 'edit', true)){
169
-		return '';
170
-	}
171
-	if(empty($lead)){
172
-		$lead = new Lead();
173
-	}
168
+    if(!ACLController::checkAccess('Opportunities', 'edit', true)){
169
+        return '';
170
+    }
171
+    if(empty($lead)){
172
+        $lead = new Lead();
173
+    }
174 174
 global $mod_strings, $sugar_config;
175 175
 $showaccount = $showaccount && $sugar_config['require_accounts'];
176 176
 $temp_strings = $mod_strings;
177 177
 if(!empty($mod)){
178
-	global $current_language;
179
-	$mod_strings = return_module_language($current_language, $mod);
178
+    global $current_language;
179
+    $mod_strings = return_module_language($current_language, $mod);
180 180
 }
181 181
 
182 182
 global $app_strings;
@@ -215,9 +215,9 @@  discard block
 block discarded – undo
215 215
 $ntc_date_format = $timedate->get_user_date_format();
216 216
 $cal_dateformat = $timedate->get_cal_date_format();
217 217
 if (isset($lead->assigned_user_id)) {
218
-	$user_id=$lead->assigned_user_id;
218
+    $user_id=$lead->assigned_user_id;
219 219
 } else {
220
-	$user_id = $current_user->id;
220
+    $user_id = $current_user->id;
221 221
 }
222 222
 
223 223
 
@@ -229,9 +229,9 @@  discard block
 block discarded – undo
229 229
 
230 230
 
231 231
 if (isset($lead->opportunity_amount)) {
232
-	$opp_amount=$lead->opportunity_amount;
232
+    $opp_amount=$lead->opportunity_amount;
233 233
 } else {
234
- 	$opp_amount='';
234
+        $opp_amount='';
235 235
 }
236 236
 $jsCalendarImage = SugarThemeRegistry::current()->getImageURL('jscalendar.gif');
237 237
 $the_form .= <<<EOQ
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 </tr>
258 258
 EOQ;
259 259
 if($showaccount){
260
-	$the_form .= <<<EOQ
260
+    $the_form .= <<<EOQ
261 261
 <tr>
262 262
     <td scope="row">${mod_strings['LBL_ACCOUNT_NAME']}&nbsp;<span class="required">${lbl_required_symbol}</span></td>
263 263
 </tr>
@@ -285,9 +285,9 @@  discard block
 block discarded – undo
285 285
 </tr>
286 286
 EOQ;
287 287
 //carry forward custom lead fields to opportunities during Lead Conversion
288
-	$tempOpp = new Opportunity();
289
-	if (method_exists($lead, 'convertCustomFieldsForm')) $lead->convertCustomFieldsForm($the_form, $tempOpp, $prefix);
290
-	unset($tempOpp);
288
+    $tempOpp = new Opportunity();
289
+    if (method_exists($lead, 'convertCustomFieldsForm')) $lead->convertCustomFieldsForm($the_form, $tempOpp, $prefix);
290
+    unset($tempOpp);
291 291
 
292 292
 $the_form .= <<<EOQ
293 293
 
@@ -315,12 +315,12 @@  discard block
 block discarded – undo
315 315
 } // end getWideFormBody
316 316
 
317 317
 function getFormBody($prefix, $mod='Opportunities', $formname=''){
318
-	if(!ACLController::checkAccess('Opportunities', 'edit', true)){
319
-		return '';
320
-	}
318
+    if(!ACLController::checkAccess('Opportunities', 'edit', true)){
319
+        return '';
320
+    }
321 321
 if(!empty($mod)){
322
-	global $current_language;
323
-	$mod_strings = return_module_language($current_language, $mod);
322
+    global $current_language;
323
+    $mod_strings = return_module_language($current_language, $mod);
324 324
 }else global $mod_strings;
325 325
 global $app_strings;
326 326
 global $app_list_strings;
@@ -363,13 +363,13 @@  discard block
 block discarded – undo
363 363
 /// SETUP ACCOUNT POPUP
364 364
 
365 365
 $popup_request_data = array(
366
-	'call_back_function' => 'set_return',
367
-	'form_name' => "{$prefix}OppSave",
368
-	'field_to_name_array' => array(
369
-		'id' => 'account_id',
370
-		'name' => 'account_name',
371
-		),
372
-	);
366
+    'call_back_function' => 'set_return',
367
+    'form_name' => "{$prefix}OppSave",
368
+    'field_to_name_array' => array(
369
+        'id' => 'account_id',
370
+        'name' => 'account_name',
371
+        ),
372
+    );
373 373
 
374 374
 $json = getJSONobj();
375 375
 $encoded_popup_request_data = $json->encode($popup_request_data);
@@ -429,12 +429,12 @@  discard block
 block discarded – undo
429 429
     global $current_user;
430 430
 	
431 431
 	
432
-	require_once('include/formbase.php');
432
+    require_once('include/formbase.php');
433 433
 	
434
-	$focus = new Opportunity();
435
-	if($useRequired &&  !checkRequired($prefix, array_keys($focus->required_fields))){
436
-		return null;
437
-	}
434
+    $focus = new Opportunity();
435
+    if($useRequired &&  !checkRequired($prefix, array_keys($focus->required_fields))){
436
+        return null;
437
+    }
438 438
 
439 439
     if(empty($_POST['currency_id'])){
440 440
         $currency_id = $current_user->getPreference('currency');
@@ -442,28 +442,28 @@  discard block
 block discarded – undo
442 442
             $focus->currency_id =   $currency_id;
443 443
         }
444 444
     }
445
-	$focus = populateFromPost($prefix, $focus);
446
-	if( !ACLController::checkAccess($focus->module_dir, 'edit', $focus->isOwner($current_user->id))){
447
-		ACLController::displayNoAccess(true);
448
-	}
449
-	$check_notify = FALSE;
450
-	if (isset($GLOBALS['check_notify'])) {
451
-		$check_notify = $GLOBALS['check_notify'];
452
-	}
453
-
454
-	$focus->save($check_notify);
455
-
456
-	if(!empty($_POST['duplicate_parent_id'])){
457
-		clone_relationship($focus->db, array('opportunities_contacts'),'opportunity_id',  $_POST['duplicate_parent_id'], $focus->id);
458
-	}
459
-	$return_id = $focus->id;
445
+    $focus = populateFromPost($prefix, $focus);
446
+    if( !ACLController::checkAccess($focus->module_dir, 'edit', $focus->isOwner($current_user->id))){
447
+        ACLController::displayNoAccess(true);
448
+    }
449
+    $check_notify = FALSE;
450
+    if (isset($GLOBALS['check_notify'])) {
451
+        $check_notify = $GLOBALS['check_notify'];
452
+    }
453
+
454
+    $focus->save($check_notify);
455
+
456
+    if(!empty($_POST['duplicate_parent_id'])){
457
+        clone_relationship($focus->db, array('opportunities_contacts'),'opportunity_id',  $_POST['duplicate_parent_id'], $focus->id);
458
+    }
459
+    $return_id = $focus->id;
460 460
 	
461
-	$GLOBALS['log']->debug("Saved record with id of ".$return_id);
462
-	if($redirect){
463
-		handleRedirect($return_id,"Opportunities" );
464
-	}else{
465
-		return $focus;
466
-	}
461
+    $GLOBALS['log']->debug("Saved record with id of ".$return_id);
462
+    if($redirect){
463
+        handleRedirect($return_id,"Opportunities" );
464
+    }else{
465
+        return $focus;
466
+    }
467 467
 }
468 468
 
469 469
 }
Please login to merge, or discard this patch.
modules/ProspectLists/field_arrays.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -46,15 +46,15 @@
 block discarded – undo
46 46
  * Contributor(s): ______________________________________..
47 47
  ********************************************************************************/
48 48
 $fields_array['ProspectList'] = array ('column_fields' => array(
49
-				"id", "date_entered",
50
-				"date_modified", "modified_user_id",
51
-				"assigned_user_id", "created_by",
52
-				"name", "description",'list_type','domain_name',
53
-	),
49
+                "id", "date_entered",
50
+                "date_modified", "modified_user_id",
51
+                "assigned_user_id", "created_by",
52
+                "name", "description",'list_type','domain_name',
53
+    ),
54 54
         'list_fields' =>  array(
55
-				'id', 'name', 'description','list_type',
56
-				'assigned_user_id','assigned_user_name',
57
-	),
55
+                'id', 'name', 'description','list_type',
56
+                'assigned_user_id','assigned_user_name',
57
+    ),
58 58
     'required_fields' =>  array('name'=>1,'list_type'=>2),
59 59
 );
60 60
 ?>
61 61
\ No newline at end of file
Please login to merge, or discard this patch.
modules/ProspectLists/ProspectListFormBase.php 1 patch
Indentation   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -52,71 +52,71 @@  discard block
 block discarded – undo
52 52
 
53 53
 function getForm($prefix, $mod='', $form=''){
54 54
 	
55
-	if(!ACLController::checkAccess('ProspectLists', 'edit', true)){
56
-		return '';
57
-	}
55
+    if(!ACLController::checkAccess('ProspectLists', 'edit', true)){
56
+        return '';
57
+    }
58 58
 	
59
-	if(!empty($mod)){
60
-		global $current_language;
61
-		$mod_strings = return_module_language($current_language, $mod);
62
-	} else {
63
-		global $mod_strings;
64
-	}
65
-	global $app_strings,$current_user;
59
+    if(!empty($mod)){
60
+        global $current_language;
61
+        $mod_strings = return_module_language($current_language, $mod);
62
+    } else {
63
+        global $mod_strings;
64
+    }
65
+    global $app_strings,$current_user;
66 66
 	
67
-	$lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
68
-	$lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
69
-	$lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
70
-	$user_id = $current_user->id;
67
+    $lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
68
+    $lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
69
+    $lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
70
+    $user_id = $current_user->id;
71 71
 
72 72
 
73
-	$the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
74
-	$the_form .= <<<EOQ
73
+    $the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
74
+    $the_form .= <<<EOQ
75 75
 		<form name="${prefix}ProspectListSave" onSubmit="return check_form('${prefix}ProspectListSave');" method="POST" action="index.php">
76 76
 			<input type="hidden" name="${prefix}module" value="ProspectLists">
77 77
 			<input type="hidden" name="${prefix}action" value="Save">
78 78
 			<input type="hidden" name="assigned_user_id" value='${user_id}'>
79 79
 EOQ;
80 80
 
81
-	$the_form .= $this->getFormBody($prefix, $mod, $prefix."ProspectListSave");
82
-	$the_form .= <<<EOQ
81
+    $the_form .= $this->getFormBody($prefix, $mod, $prefix."ProspectListSave");
82
+    $the_form .= <<<EOQ
83 83
 		<p><input title="$lbl_save_button_title" accessKey="$lbl_save_button_key" class="button" type="submit" name="button" value="  $lbl_save_button_label  " ></p>
84 84
 		</form>
85 85
 
86 86
 EOQ;
87 87
 
88
-	$the_form .= get_left_form_footer();
89
-	$the_form .= get_validate_record_js();
88
+    $the_form .= get_left_form_footer();
89
+    $the_form .= get_validate_record_js();
90 90
 
91
-	return $the_form;	
91
+    return $the_form;	
92 92
 }
93 93
 
94 94
 function getFormBody($prefix, $mod='',$formname='', $size='30',$script=true) {
95
-	if(!ACLController::checkAccess('ProspectLists', 'edit', true)){
96
-		return '';
97
-	}
98
-	global $mod_strings;
99
-	$temp_strings = $mod_strings;
100
-	if(!empty($mod)){
101
-		global $current_language;
102
-		$mod_strings = return_module_language($current_language, $mod);
103
-	}
104
-	global $app_strings;
105
-	global $current_user;
106
-	global $app_list_strings;
95
+    if(!ACLController::checkAccess('ProspectLists', 'edit', true)){
96
+        return '';
97
+    }
98
+    global $mod_strings;
99
+    $temp_strings = $mod_strings;
100
+    if(!empty($mod)){
101
+        global $current_language;
102
+        $mod_strings = return_module_language($current_language, $mod);
103
+    }
104
+    global $app_strings;
105
+    global $current_user;
106
+    global $app_list_strings;
107 107
 	
108
-	$lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
109
-	$lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
110
-	$lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
111
-	$lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
112
-	$user_id = $current_user->id;
108
+    $lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
109
+    $lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
110
+    $lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
111
+    $lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
112
+    $user_id = $current_user->id;
113 113
 
114
-	$list_options=get_select_options_with_id($app_list_strings['prospect_list_type_dom'], 'default');
114
+    $list_options=get_select_options_with_id($app_list_strings['prospect_list_type_dom'], 'default');
115 115
 	
116
-	$lbl_prospect_list_name = $mod_strings['LBL_PROSPECT_LIST_NAME'];
117
-	$lbl_list_type = $mod_strings['LBL_LIST_TYPE'];
116
+    $lbl_prospect_list_name = $mod_strings['LBL_PROSPECT_LIST_NAME'];
117
+    $lbl_list_type = $mod_strings['LBL_LIST_TYPE'];
118 118
 	
119
-	$form = <<<EOQ
119
+    $form = <<<EOQ
120 120
 			<p><input type="hidden" name="record" value="">
121 121
 			$lbl_prospect_list_name&nbsp;<span class="required">$lbl_required_symbol</span><br>
122 122
 			<input name='name' type="text" value=""><br>
@@ -126,43 +126,43 @@  discard block
 block discarded – undo
126 126
 
127 127
 	
128 128
 	
129
-	$javascript = new javascript();
130
-	$javascript->setFormName($formname);
131
-	$javascript->setSugarBean(new ProspectList());
132
-	$javascript->addRequiredFields($prefix);
133
-	$form .=$javascript->getScript();
134
-	$mod_strings = $temp_strings;
135
-	return $form;
129
+    $javascript = new javascript();
130
+    $javascript->setFormName($formname);
131
+    $javascript->setSugarBean(new ProspectList());
132
+    $javascript->addRequiredFields($prefix);
133
+    $form .=$javascript->getScript();
134
+    $mod_strings = $temp_strings;
135
+    return $form;
136 136
 }
137 137
 
138
-	function handleSave($prefix,$redirect=true, $useRequired=false){
138
+    function handleSave($prefix,$redirect=true, $useRequired=false){
139 139
 		
140 140
 		
141
-		require_once('include/formbase.php');
141
+        require_once('include/formbase.php');
142 142
 	
143 143
 		
144
-		$focus = new ProspectList();
145
-		if($useRequired &&  !checkRequired($prefix, array_keys($focus->required_fields))){
146
-			return null;
147
-		}
148
-		$focus = populateFromPost($prefix, $focus);
149
-		if(!$focus->ACLAccess('Save')){
150
-			ACLController::displayNoAccess(true);
151
-			sugar_cleanup(true);
152
-		}
153
-		if(empty($focus->name)){
154
-			return null;
155
-		}	
144
+        $focus = new ProspectList();
145
+        if($useRequired &&  !checkRequired($prefix, array_keys($focus->required_fields))){
146
+            return null;
147
+        }
148
+        $focus = populateFromPost($prefix, $focus);
149
+        if(!$focus->ACLAccess('Save')){
150
+            ACLController::displayNoAccess(true);
151
+            sugar_cleanup(true);
152
+        }
153
+        if(empty($focus->name)){
154
+            return null;
155
+        }	
156 156
         if ( !isset($focus->assigned_user_id) || $focus->assigned_user_id == '' )
157 157
             $focus->assigned_user_id = $GLOBALS['current_user']->id;
158 158
 	
159
-		$return_id = $focus->save();
160
-		if($redirect){
161
-			$GLOBALS['log']->debug("Saved record with id of ".$return_id);
162
-			handleRedirect($return_id, "ProspectLists");
163
-		} else { 
164
-			return $focus;
165
-		}
166
-	}
159
+        $return_id = $focus->save();
160
+        if($redirect){
161
+            $GLOBALS['log']->debug("Saved record with id of ".$return_id);
162
+            handleRedirect($return_id, "ProspectLists");
163
+        } else { 
164
+            return $focus;
165
+        }
166
+    }
167 167
 }
168 168
 ?>
Please login to merge, or discard this patch.
modules/ProspectLists/TargetListUpdate.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -54,42 +54,42 @@
 block discarded – undo
54 54
 
55 55
 $uids = array();
56 56
 if($_REQUEST['select_entire_list'] == '1'){
57
-	$order_by = '';
57
+    $order_by = '';
58 58
 
59
-	require_once('include/MassUpdate.php');
60
-	$mass = new MassUpdate();
61
-	$mass->generateSearchWhere($_REQUEST['module'], $_REQUEST['current_query_by_page']);
62
-	$ret_array = create_export_query_relate_link_patch($_REQUEST['module'], $mass->searchFields, $mass->where_clauses);
63
-	/* BEGIN - SECURITY GROUPS */
64
-	//need to hijack the $ret_array['where'] of securitygorup required
65
-	if($focus->bean_implements('ACL') && ACLController::requireSecurityGroup($focus->module_dir, 'list') )
66
-	{
67
-		require_once('modules/SecurityGroups/SecurityGroup.php');
68
-		global $current_user;
69
-		$owner_where = $focus->getOwnerWhere($current_user->id);
70
-		$group_where = SecurityGroup::getGroupWhere($focus->table_name,$focus->module_dir,$current_user->id);
71
-		if(!empty($owner_where)){
72
-			if(empty($ret_array['where']))
73
-			{
74
-				$ret_array['where'] = " (".  $owner_where." or ".$group_where.") ";
75
-			} else {
76
-				$ret_array['where'] .= " AND (".  $owner_where." or ".$group_where.") ";
77
-			}
78
-		} else {
79
-			$ret_array['where'] .= ' AND '.  $group_where;
80
-		}
81
-	}
82
-	/* END - SECURITY GROUPS */
83
-	$query = $focus->create_export_query($order_by, $ret_array['where'], $ret_array['join']);
84
-	$result = $GLOBALS['db']->query($query,true);
85
-	$uids = array();
86
-	while($val = $GLOBALS['db']->fetchByAssoc($result,false))
87
-	{
88
-		array_push($uids, $val['id']);
89
-	}
59
+    require_once('include/MassUpdate.php');
60
+    $mass = new MassUpdate();
61
+    $mass->generateSearchWhere($_REQUEST['module'], $_REQUEST['current_query_by_page']);
62
+    $ret_array = create_export_query_relate_link_patch($_REQUEST['module'], $mass->searchFields, $mass->where_clauses);
63
+    /* BEGIN - SECURITY GROUPS */
64
+    //need to hijack the $ret_array['where'] of securitygorup required
65
+    if($focus->bean_implements('ACL') && ACLController::requireSecurityGroup($focus->module_dir, 'list') )
66
+    {
67
+        require_once('modules/SecurityGroups/SecurityGroup.php');
68
+        global $current_user;
69
+        $owner_where = $focus->getOwnerWhere($current_user->id);
70
+        $group_where = SecurityGroup::getGroupWhere($focus->table_name,$focus->module_dir,$current_user->id);
71
+        if(!empty($owner_where)){
72
+            if(empty($ret_array['where']))
73
+            {
74
+                $ret_array['where'] = " (".  $owner_where." or ".$group_where.") ";
75
+            } else {
76
+                $ret_array['where'] .= " AND (".  $owner_where." or ".$group_where.") ";
77
+            }
78
+        } else {
79
+            $ret_array['where'] .= ' AND '.  $group_where;
80
+        }
81
+    }
82
+    /* END - SECURITY GROUPS */
83
+    $query = $focus->create_export_query($order_by, $ret_array['where'], $ret_array['join']);
84
+    $result = $GLOBALS['db']->query($query,true);
85
+    $uids = array();
86
+    while($val = $GLOBALS['db']->fetchByAssoc($result,false))
87
+    {
88
+        array_push($uids, $val['id']);
89
+    }
90 90
 }
91 91
 else{
92
-	$uids = explode ( ',', $_POST['uids'] );
92
+    $uids = explode ( ',', $_POST['uids'] );
93 93
 }
94 94
 
95 95
 // find the relationship to use
Please login to merge, or discard this patch.
modules/ProspectLists/ProspectList.php 1 patch
Indentation   +201 added lines, -201 removed lines patch added patch discarded remove patch
@@ -50,107 +50,107 @@  discard block
 block discarded – undo
50 50
 
51 51
 
52 52
 class ProspectList extends SugarBean {
53
-	var $field_name_map;
53
+    var $field_name_map;
54 54
 	
55
-	// Stored fields
56
-	var $id;
57
-	var $date_entered;
58
-	var $date_modified;
59
-	var $modified_user_id;
60
-	var $assigned_user_id;
61
-	var $created_by;
62
-	var $created_by_name;
63
-	var $modified_by_name;
64
-	var $list_type;
65
-	var $domain_name;
66
-
67
-	var $name;
68
-	var $description;
55
+    // Stored fields
56
+    var $id;
57
+    var $date_entered;
58
+    var $date_modified;
59
+    var $modified_user_id;
60
+    var $assigned_user_id;
61
+    var $created_by;
62
+    var $created_by_name;
63
+    var $modified_by_name;
64
+    var $list_type;
65
+    var $domain_name;
66
+
67
+    var $name;
68
+    var $description;
69 69
 	
70
-	// These are related
71
-	var $assigned_user_name;
72
-	var $prospect_id;
73
-	var $contact_id;
74
-	var $lead_id;
75
-
76
-	// module name definitions and table relations
77
-	var $table_name = "prospect_lists";
78
-	var $module_dir = 'ProspectLists';
79
-	var $rel_prospects_table = "prospect_lists_prospects";
80
-	var $object_name = "ProspectList";
81
-
82
-	// This is used to retrieve related fields from form posts.
83
-	var $additional_column_fields = array(
84
-		'assigned_user_name', 'assigned_user_id', 'campaign_id',
85
-	);
86
-	var $relationship_fields = array(
87
-		'campaign_id'=>'campaigns',
88
-		'prospect_list_prospects' => 'prospects',
89
-	);
70
+    // These are related
71
+    var $assigned_user_name;
72
+    var $prospect_id;
73
+    var $contact_id;
74
+    var $lead_id;
75
+
76
+    // module name definitions and table relations
77
+    var $table_name = "prospect_lists";
78
+    var $module_dir = 'ProspectLists';
79
+    var $rel_prospects_table = "prospect_lists_prospects";
80
+    var $object_name = "ProspectList";
81
+
82
+    // This is used to retrieve related fields from form posts.
83
+    var $additional_column_fields = array(
84
+        'assigned_user_name', 'assigned_user_id', 'campaign_id',
85
+    );
86
+    var $relationship_fields = array(
87
+        'campaign_id'=>'campaigns',
88
+        'prospect_list_prospects' => 'prospects',
89
+    );
90 90
 
91 91
     var $entry_count;
92 92
     
93
-	function ProspectList() {
94
-		global $sugar_config;
95
-		parent::SugarBean();
93
+    function ProspectList() {
94
+        global $sugar_config;
95
+        parent::SugarBean();
96 96
 		
97
-	}
97
+    }
98 98
 
99
-	var $new_schema = true;
99
+    var $new_schema = true;
100 100
 
101
-	function get_summary_text()
102
-	{
103
-		return "$this->name";
104
-	}
101
+    function get_summary_text()
102
+    {
103
+        return "$this->name";
104
+    }
105 105
 
106
-	function create_list_query($order_by, $where, $show_deleted = 0)
107
-	{
106
+    function create_list_query($order_by, $where, $show_deleted = 0)
107
+    {
108 108
         $custom_join = $this->getCustomJoin();
109 109
 		
110
-		$query = "SELECT ";
111
-		$query .= "users.user_name as assigned_user_name, ";
112
-		$query .= "prospect_lists.*";
110
+        $query = "SELECT ";
111
+        $query .= "users.user_name as assigned_user_name, ";
112
+        $query .= "prospect_lists.*";
113 113
 
114 114
         $query .= $custom_join['select'];
115
-		$query .= " FROM prospect_lists ";
115
+        $query .= " FROM prospect_lists ";
116 116
 
117
-		$query .= "LEFT JOIN users
117
+        $query .= "LEFT JOIN users
118 118
 					ON prospect_lists.assigned_user_id=users.id ";
119 119
 
120 120
         $query .= $custom_join['join'];
121 121
 
122
-			$where_auto = '1=1';
123
-				if($show_deleted == 0){
124
-                	$where_auto = "$this->table_name.deleted=0";
125
-				}else if($show_deleted == 1){
126
-                	$where_auto = "$this->table_name.deleted=1";
127
-				}
122
+            $where_auto = '1=1';
123
+                if($show_deleted == 0){
124
+                    $where_auto = "$this->table_name.deleted=0";
125
+                }else if($show_deleted == 1){
126
+                    $where_auto = "$this->table_name.deleted=1";
127
+                }
128 128
 
129
-		if($where != "")
130
-			$query .= "where $where AND ".$where_auto;
131
-		else
132
-			$query .= "where ".$where_auto;
129
+        if($where != "")
130
+            $query .= "where $where AND ".$where_auto;
131
+        else
132
+            $query .= "where ".$where_auto;
133 133
 
134
-		if($order_by != "")
135
-			$query .= " ORDER BY $order_by";
136
-		else
137
-			$query .= " ORDER BY prospect_lists.name";
134
+        if($order_by != "")
135
+            $query .= " ORDER BY $order_by";
136
+        else
137
+            $query .= " ORDER BY prospect_lists.name";
138 138
 
139
-		return $query;
140
-	}
139
+        return $query;
140
+    }
141 141
 
142 142
 
143
-	function create_export_query($order_by, $where)
144
-	{
143
+    function create_export_query($order_by, $where)
144
+    {
145 145
 
146 146
                                 $query = "SELECT
147 147
                                 prospect_lists.*,
148 148
                                 users.user_name as assigned_user_name ";
149
-	                            $query .= "FROM prospect_lists ";
150
-		$query .= 				"LEFT JOIN users
149
+                                $query .= "FROM prospect_lists ";
150
+        $query .= 				"LEFT JOIN users
151 151
                                 ON prospect_lists.assigned_user_id=users.id ";
152 152
 
153
-		$where_auto = " prospect_lists.deleted=0";
153
+        $where_auto = " prospect_lists.deleted=0";
154 154
 
155 155
         if($where != "")
156 156
                 $query .= " WHERE $where AND ".$where_auto;
@@ -164,47 +164,47 @@  discard block
 block discarded – undo
164 164
         return $query;
165 165
     }
166 166
 
167
-	function create_export_members_query($record_id)
168
-	{
169
-		$members = array(	'Accounts' 	=> array('has_custom_fields' => false, 'fields' => array()), 
170
-					'Contacts' 	=> array('has_custom_fields' => false, 'fields' => array()),
171
-					'Users' 	=> array('has_custom_fields' => false, 'fields' => array()),
172
-					'Prospects' 	=> array('has_custom_fields' => false, 'fields' => array()),
173
-					'Leads' 	=> array('has_custom_fields' => false, 'fields' => array())
174
-				);
175
-
176
-		// query all custom fields in the fields_meta_data table for the modules which are being exported 
177
-		$db = DBManagerFactory::getInstance();
178
-		$result = $db->query("select name, custom_module from fields_meta_data where custom_module in ('" . 
179
-					implode("', '", array_keys($members)) . "')",
180
-					true,
181
-					"ProspectList::create_export_members_query() : error querying custom fields");
182
-
183
-		// cycle through the custom fields and put them in the members array according to 
184
-		// what module the field belongs
185
-		// take into account that the same custom field may exist in more modules
186
-		while($val = $db->fetchByAssoc($result, false)) 
187
-		{
188
-			$fieldname = $val['name'];
189
-
190
-			foreach($members as $membername => &$memberarr)	
191
-			{
192
-				// if the field belongs to this module, then query it in the cstm table
193
-				if ($membername == $val['custom_module'])
194
-				{
195
-					$memberarr['has_custom_fields'] = true;
196
-					$memberarr['fields'][$fieldname] = 
197
-						strtolower($membername) . '_cstm.'.$fieldname . ' AS ' . $fieldname;
198
-				}
199
-				// else, only if for this module no entry exists for this field, query an empty string
200
-				else if (!isset($memberarr['fields'][$val['name']]))
201
-				{
202
-					$memberarr['fields'][$fieldname] = "'' AS " . $fieldname;
203
-				}
204
-			}
205
-		}
206
-
207
-		$leads_query = "SELECT l.id AS id, 'Leads' AS related_type, '' AS \"name\", l.first_name AS first_name, l.last_name AS last_name, l.title AS title, l.salutation AS salutation, 
167
+    function create_export_members_query($record_id)
168
+    {
169
+        $members = array(	'Accounts' 	=> array('has_custom_fields' => false, 'fields' => array()), 
170
+                    'Contacts' 	=> array('has_custom_fields' => false, 'fields' => array()),
171
+                    'Users' 	=> array('has_custom_fields' => false, 'fields' => array()),
172
+                    'Prospects' 	=> array('has_custom_fields' => false, 'fields' => array()),
173
+                    'Leads' 	=> array('has_custom_fields' => false, 'fields' => array())
174
+                );
175
+
176
+        // query all custom fields in the fields_meta_data table for the modules which are being exported 
177
+        $db = DBManagerFactory::getInstance();
178
+        $result = $db->query("select name, custom_module from fields_meta_data where custom_module in ('" . 
179
+                    implode("', '", array_keys($members)) . "')",
180
+                    true,
181
+                    "ProspectList::create_export_members_query() : error querying custom fields");
182
+
183
+        // cycle through the custom fields and put them in the members array according to 
184
+        // what module the field belongs
185
+        // take into account that the same custom field may exist in more modules
186
+        while($val = $db->fetchByAssoc($result, false)) 
187
+        {
188
+            $fieldname = $val['name'];
189
+
190
+            foreach($members as $membername => &$memberarr)	
191
+            {
192
+                // if the field belongs to this module, then query it in the cstm table
193
+                if ($membername == $val['custom_module'])
194
+                {
195
+                    $memberarr['has_custom_fields'] = true;
196
+                    $memberarr['fields'][$fieldname] = 
197
+                        strtolower($membername) . '_cstm.'.$fieldname . ' AS ' . $fieldname;
198
+                }
199
+                // else, only if for this module no entry exists for this field, query an empty string
200
+                else if (!isset($memberarr['fields'][$val['name']]))
201
+                {
202
+                    $memberarr['fields'][$fieldname] = "'' AS " . $fieldname;
203
+                }
204
+            }
205
+        }
206
+
207
+        $leads_query = "SELECT l.id AS id, 'Leads' AS related_type, '' AS \"name\", l.first_name AS first_name, l.last_name AS last_name, l.title AS title, l.salutation AS salutation, 
208 208
 				l.primary_address_street AS primary_address_street,l.primary_address_city AS primary_address_city, l.primary_address_state AS primary_address_state, l.primary_address_postalcode AS primary_address_postalcode, l.primary_address_country AS primary_address_country,
209 209
 				l.account_name AS account_name,
210 210
 				ea.email_address AS primary_email_address, ea.invalid_email AS invalid_email, ea.opt_out AS opt_out, ea.deleted AS ea_deleted, ear.deleted AS ear_deleted, ear.primary_address AS primary_address,
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 				AND l.deleted=0
220 220
 				AND (ear.deleted=0 OR ear.deleted IS NULL)";
221 221
 
222
-		$users_query = "SELECT u.id AS id, 'Users' AS related_type, '' AS \"name\", u.first_name AS first_name, u.last_name AS last_name,u.title AS title, '' AS salutation, 
222
+        $users_query = "SELECT u.id AS id, 'Users' AS related_type, '' AS \"name\", u.first_name AS first_name, u.last_name AS last_name,u.title AS title, '' AS salutation, 
223 223
 				u.address_street AS primary_address_street,u.address_city AS primary_address_city, u.address_state AS primary_address_state,  u.address_postalcode AS primary_address_postalcode, u.address_country AS primary_address_country,
224 224
 				'' AS account_name,
225 225
 				ea.email_address AS email_address, ea.invalid_email AS invalid_email, ea.opt_out AS opt_out, ea.deleted AS ea_deleted, ear.deleted AS ear_deleted, ear.primary_address AS primary_address,
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 				AND u.deleted=0
235 235
 				AND (ear.deleted=0 OR ear.deleted IS NULL)";
236 236
 
237
-		$contacts_query = "SELECT c.id AS id, 'Contacts' AS related_type, '' AS \"name\", c.first_name AS first_name, c.last_name AS last_name,c.title AS title, c.salutation AS salutation, 
237
+        $contacts_query = "SELECT c.id AS id, 'Contacts' AS related_type, '' AS \"name\", c.first_name AS first_name, c.last_name AS last_name,c.title AS title, c.salutation AS salutation, 
238 238
 				c.primary_address_street AS primary_address_street,c.primary_address_city AS primary_address_city, c.primary_address_state AS primary_address_state,  c.primary_address_postalcode AS primary_address_postalcode, c.primary_address_country AS primary_address_country,
239 239
 				a.name AS account_name,
240 240
 				ea.email_address AS email_address, ea.invalid_email AS invalid_email, ea.opt_out AS opt_out, ea.deleted AS ea_deleted, ear.deleted AS ear_deleted, ear.primary_address AS primary_address,
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 				AND ac.deleted=0
251 251
                 AND (ear.deleted=0 OR ear.deleted IS NULL)";
252 252
 
253
-		$prospects_query = "SELECT p.id AS id, 'Prospects' AS related_type, '' AS \"name\", p.first_name AS first_name, p.last_name AS last_name,p.title AS title, p.salutation AS salutation, 
253
+        $prospects_query = "SELECT p.id AS id, 'Prospects' AS related_type, '' AS \"name\", p.first_name AS first_name, p.last_name AS last_name,p.title AS title, p.salutation AS salutation, 
254 254
 				p.primary_address_street AS primary_address_street,p.primary_address_city AS primary_address_city, p.primary_address_state AS primary_address_state,  p.primary_address_postalcode AS primary_address_postalcode, p.primary_address_country AS primary_address_country,
255 255
 				p.account_name AS account_name,
256 256
 				ea.email_address AS email_address, ea.invalid_email AS invalid_email, ea.opt_out AS opt_out, ea.deleted AS ea_deleted, ear.deleted AS ear_deleted, ear.primary_address AS primary_address,
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 				AND p.deleted=0
266 266
 				AND (ear.deleted=0 OR ear.deleted IS NULL)";
267 267
 
268
-		$accounts_query = "SELECT a.id AS id, 'Accounts' AS related_type, a.name AS \"name\", '' AS first_name, '' AS last_name,'' AS title, '' AS salutation, 
268
+        $accounts_query = "SELECT a.id AS id, 'Accounts' AS related_type, a.name AS \"name\", '' AS first_name, '' AS last_name,'' AS title, '' AS salutation, 
269 269
 				a.billing_address_street AS primary_address_street,a.billing_address_city AS primary_address_city, a.billing_address_state AS primary_address_state, a.billing_address_postalcode AS primary_address_postalcode, a.billing_address_country AS primary_address_country,
270 270
 				'' AS account_name,
271 271
 				ea.email_address AS email_address, ea.invalid_email AS invalid_email, ea.opt_out AS opt_out, ea.deleted AS ea_deleted, ear.deleted AS ear_deleted, ear.primary_address AS primary_address,
@@ -279,115 +279,115 @@  discard block
 block discarded – undo
279 279
 				WHERE plp.prospect_list_id = $record_id  AND plp.deleted=0 
280 280
 				AND a.deleted=0
281 281
 				AND (ear.deleted=0 OR ear.deleted IS NULL)";
282
-		$order_by = "ORDER BY related_type, id, primary_address DESC";
283
-		$query = "$leads_query UNION ALL $users_query UNION ALL $contacts_query UNION ALL $prospects_query UNION ALL $accounts_query $order_by";
284
-		return $query;
285
-	}
282
+        $order_by = "ORDER BY related_type, id, primary_address DESC";
283
+        $query = "$leads_query UNION ALL $users_query UNION ALL $contacts_query UNION ALL $prospects_query UNION ALL $accounts_query $order_by";
284
+        return $query;
285
+    }
286 286
 	
287
-	function save_relationship_changes($is_update, $exclude = array())
287
+    function save_relationship_changes($is_update, $exclude = array())
288 288
     {
289
-    	parent::save_relationship_changes($is_update, $exclude);
290
-		if($this->lead_id != "")
291
-	   		$this->set_prospect_relationship($this->id, $this->lead_id, "lead");
292
-    	if($this->contact_id != "")
293
-    		$this->set_prospect_relationship($this->id, $this->contact_id, "contact");
294
-    	if($this->prospect_id != "")
295
-    		$this->set_prospect_relationship($this->id, $this->contact_id, "prospect");
289
+        parent::save_relationship_changes($is_update, $exclude);
290
+        if($this->lead_id != "")
291
+                $this->set_prospect_relationship($this->id, $this->lead_id, "lead");
292
+        if($this->contact_id != "")
293
+            $this->set_prospect_relationship($this->id, $this->contact_id, "contact");
294
+        if($this->prospect_id != "")
295
+            $this->set_prospect_relationship($this->id, $this->contact_id, "prospect");
296 296
     }
297 297
 
298
-	function set_prospect_relationship($prospect_list_id, &$link_ids, $link_name)
299
-	{
300
-		$link_field = sprintf("%s_id", $link_name);
298
+    function set_prospect_relationship($prospect_list_id, &$link_ids, $link_name)
299
+    {
300
+        $link_field = sprintf("%s_id", $link_name);
301 301
 		
302
-		foreach($link_ids as $link_id)
303
-		{
304
-			$this->set_relationship('prospect_lists_prospects', array( $link_field=>$link_id, 'prospect_list_id'=>$prospect_list_id ));
305
-		}
306
-	}
307
-
308
-	function set_prospect_relationship_single($prospect_list_id, $link_id, $link_name)
309
-	{
310
-		$link_field = sprintf("%s_id", $link_name);
302
+        foreach($link_ids as $link_id)
303
+        {
304
+            $this->set_relationship('prospect_lists_prospects', array( $link_field=>$link_id, 'prospect_list_id'=>$prospect_list_id ));
305
+        }
306
+    }
307
+
308
+    function set_prospect_relationship_single($prospect_list_id, $link_id, $link_name)
309
+    {
310
+        $link_field = sprintf("%s_id", $link_name);
311 311
 		
312
-		$this->set_relationship('prospect_lists_prospects', array( $link_field=>$link_id, 'prospect_list_id'=>$prospect_list_id ));
313
-	}
312
+        $this->set_relationship('prospect_lists_prospects', array( $link_field=>$link_id, 'prospect_list_id'=>$prospect_list_id ));
313
+    }
314 314
 
315 315
 
316
-	function clear_prospect_relationship($prospect_list_id, $link_id, $link_name)
317
-	{
318
-		$link_field = sprintf("%s_id", $link_name);
319
-		$where_clause = " AND $link_field = '$link_id' ";
316
+    function clear_prospect_relationship($prospect_list_id, $link_id, $link_name)
317
+    {
318
+        $link_field = sprintf("%s_id", $link_name);
319
+        $where_clause = " AND $link_field = '$link_id' ";
320 320
 		
321
-		$query = sprintf("DELETE FROM prospect_lists_prospects WHERE prospect_list_id='%s' AND deleted = '0' %s", $prospect_list_id, $where_clause);
321
+        $query = sprintf("DELETE FROM prospect_lists_prospects WHERE prospect_list_id='%s' AND deleted = '0' %s", $prospect_list_id, $where_clause);
322 322
 	
323
-		$this->db->query($query, true, "Error clearing prospect/prospect_list relationship: ");
324
-	}
323
+        $this->db->query($query, true, "Error clearing prospect/prospect_list relationship: ");
324
+    }
325 325
 	
326 326
 
327
-	function mark_relationships_deleted($id)
328
-	{
329
-	}
327
+    function mark_relationships_deleted($id)
328
+    {
329
+    }
330 330
 
331
-	function fill_in_additional_list_fields()
332
-	{
333
-	}
331
+    function fill_in_additional_list_fields()
332
+    {
333
+    }
334 334
 
335
-	function fill_in_additional_detail_fields()
336
-	{
337
-		parent::fill_in_additional_detail_fields();
335
+    function fill_in_additional_detail_fields()
336
+    {
337
+        parent::fill_in_additional_detail_fields();
338 338
         $this->entry_count = $this->get_entry_count();
339
-	}
339
+    }
340 340
 
341 341
 	
342
-	function update_currency_id($fromid, $toid){
343
-	}
342
+    function update_currency_id($fromid, $toid){
343
+    }
344 344
 
345 345
 
346
-	function get_entry_count()
347
-	{
348
-		$query = "SELECT count(*) AS num FROM prospect_lists_prospects WHERE prospect_list_id='$this->id' AND deleted = '0'";
349
-		$result = $this->db->query($query, true, "Grabbing prospect_list entry count");
346
+    function get_entry_count()
347
+    {
348
+        $query = "SELECT count(*) AS num FROM prospect_lists_prospects WHERE prospect_list_id='$this->id' AND deleted = '0'";
349
+        $result = $this->db->query($query, true, "Grabbing prospect_list entry count");
350 350
 		
351
-		$row = $this->db->fetchByAssoc($result);
351
+        $row = $this->db->fetchByAssoc($result);
352 352
 
353
-		if($row)
354
-			return $row['num'];
355
-		else
356
-			return 0;
357
-	}
353
+        if($row)
354
+            return $row['num'];
355
+        else
356
+            return 0;
357
+    }
358 358
 		
359 359
 		
360
-	function get_list_view_data(){
361
-		$temp_array = $this->get_list_view_array();
362
-		$temp_array["ENTRY_COUNT"] = $this->get_entry_count();		
363
-		return $temp_array;
364
-	}
365
-	/**
360
+    function get_list_view_data(){
361
+        $temp_array = $this->get_list_view_array();
362
+        $temp_array["ENTRY_COUNT"] = $this->get_entry_count();		
363
+        return $temp_array;
364
+    }
365
+    /**
366 366
 		builds a generic search based on the query string using or
367 367
 		do not include any $this-> because this is called on without having the class instantiated
368
-	*/
369
-	function build_generic_where_clause ($the_query_string) 
370
-	{
371
-		$where_clauses = Array();
372
-		$the_query_string = $GLOBALS['db']->quote($the_query_string);
373
-		array_push($where_clauses, "prospect_lists.name like '$the_query_string%'");
368
+     */
369
+    function build_generic_where_clause ($the_query_string) 
370
+    {
371
+        $where_clauses = Array();
372
+        $the_query_string = $GLOBALS['db']->quote($the_query_string);
373
+        array_push($where_clauses, "prospect_lists.name like '$the_query_string%'");
374 374
 
375
-		$the_where = "";
376
-		foreach($where_clauses as $clause)
377
-		{
378
-			if($the_where != "") $the_where .= " or ";
379
-			$the_where .= $clause;
380
-		}
375
+        $the_where = "";
376
+        foreach($where_clauses as $clause)
377
+        {
378
+            if($the_where != "") $the_where .= " or ";
379
+            $the_where .= $clause;
380
+        }
381 381
 
382 382
 
383
-		return $the_where;
384
-	}
383
+        return $the_where;
384
+    }
385 385
 
386
-	function save($check_notify = FALSE) {
386
+    function save($check_notify = FALSE) {
387 387
 
388
-		return parent::save($check_notify);
388
+        return parent::save($check_notify);
389 389
 
390
-	}
390
+    }
391 391
 
392 392
     function mark_deleted($id){
393 393
         $query = "UPDATE prospect_lists_prospects SET deleted = 1 WHERE prospect_list_id = '{$id}' ";
@@ -395,12 +395,12 @@  discard block
 block discarded – undo
395 395
         return parent::mark_deleted($id);
396 396
     }
397 397
 	
398
-	 function bean_implements($interface){
399
-		switch($interface){
400
-			case 'ACL':return true;
401
-		}
402
-		return false;
403
-	}
398
+        function bean_implements($interface){
399
+        switch($interface){
400
+            case 'ACL':return true;
401
+        }
402
+        return false;
403
+    }
404 404
 
405 405
 }
406 406
 
Please login to merge, or discard this patch.
modules/ProspectLists/SubPanelView.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
 $button  = "<form action='index.php' method='post' name='ProspectListForm' id='ProspectListForm'>\n";
68 68
 $button .= "<input type='hidden' name='module' value='ProspectLists'>\n";
69 69
 if ($currentModule == 'Campaigns') {
70
-	$button .= "<input type='hidden' name='campaign_id' value='$focus->id'>\n";
71
-	$button .= "<input type='hidden' name='record' value='$focus->id'>\n";
72
-	$button .= "<input type='hidden' name='campaign_name' value=\"$focus->name\">\n";
70
+    $button .= "<input type='hidden' name='campaign_id' value='$focus->id'>\n";
71
+    $button .= "<input type='hidden' name='record' value='$focus->id'>\n";
72
+    $button .= "<input type='hidden' name='campaign_name' value=\"$focus->name\">\n";
73 73
 }
74 74
 $button .= "<input type='hidden' name='prospect_list_id' value=''>\n";
75 75
 $button .= "<input type='hidden' name='return_module' value='".$currentModule."'>\n";
@@ -80,28 +80,28 @@  discard block
 block discarded – undo
80 80
 $button .= "<input title='".$app_strings['LBL_NEW_BUTTON_TITLE']."' accessyKey='".$app_strings['LBL_NEW_BUTTON_KEY']."' class='button' onclick=\"this.form.action.value='EditView'\" type='submit' name='New' value='  ".$app_strings['LBL_NEW_BUTTON_LABEL']."  '>\n";
81 81
 if ($currentModule == 'Campaigns')
82 82
 {
83
-	///////////////////////////////////////
84
-	///
85
-	/// SETUP PARENT POPUP
83
+    ///////////////////////////////////////
84
+    ///
85
+    /// SETUP PARENT POPUP
86 86
 	
87
-	$popup_request_data = array(
88
-		'call_back_function' => 'set_return_prospect_list_and_save',
89
-		'form_name' => 'ProspectListForm',
90
-		'field_to_name_array' => array(
91
-			'id' => 'prospect_list_id',
92
-			),
93
-		);
87
+    $popup_request_data = array(
88
+        'call_back_function' => 'set_return_prospect_list_and_save',
89
+        'form_name' => 'ProspectListForm',
90
+        'field_to_name_array' => array(
91
+            'id' => 'prospect_list_id',
92
+            ),
93
+        );
94 94
 	
95
-	$json = getJSONobj();
96
-	$encoded_popup_request_data = $json->encode($popup_request_data);
95
+    $json = getJSONobj();
96
+    $encoded_popup_request_data = $json->encode($popup_request_data);
97 97
 	
98
-	//
99
-	///////////////////////////////////////
98
+    //
99
+    ///////////////////////////////////////
100 100
 	
101
-	$button .= "<input title='".$app_strings['LBL_SELECT_BUTTON_TITLE']
102
-		." 'accessyKey='".$app_strings['LBL_SELECT_BUTTON_KEY']
103
-		."' type='button' class='button' value='  ".$app_strings['LBL_SELECT_BUTTON_LABEL']
104
-		."  ' name='button' onclick='open_popup(\"ProspectLists\", 600, 400, \"\", false, true, {$encoded_popup_request_data});'>\n";
101
+    $button .= "<input title='".$app_strings['LBL_SELECT_BUTTON_TITLE']
102
+        ." 'accessyKey='".$app_strings['LBL_SELECT_BUTTON_KEY']
103
+        ."' type='button' class='button' value='  ".$app_strings['LBL_SELECT_BUTTON_LABEL']
104
+        ."  ' name='button' onclick='open_popup(\"ProspectLists\", 600, 400, \"\", false, true, {$encoded_popup_request_data});'>\n";
105 105
 //		."  ' name='button' onclick='window.open(\"index.php?module=ProspectLists&action=Popup&html=Popup_picker&form=DetailView&form_submit=true&query=true\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'>\n";
106 106
 }
107 107
 
Please login to merge, or discard this patch.
modules/AOS_Products/AOS_Products_sugar.php 1 patch
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -32,53 +32,53 @@
 block discarded – undo
32 32
 
33 33
 
34 34
 class AOS_Products_sugar extends Basic {
35
-	var $new_schema = true;
36
-	var $module_dir = 'AOS_Products';
37
-	var $object_name = 'AOS_Products';
38
-	var $table_name = 'aos_products';
39
-	var $importable = true;
35
+    var $new_schema = true;
36
+    var $module_dir = 'AOS_Products';
37
+    var $object_name = 'AOS_Products';
38
+    var $table_name = 'aos_products';
39
+    var $importable = true;
40 40
 
41
-	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
41
+    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
42 42
 
43
-		var $id;
44
-		var $name;
45
-		var $date_entered;
46
-		var $date_modified;
47
-		var $modified_user_id;
48
-		var $modified_by_name;
49
-		var $created_by;
50
-		var $created_by_name;
51
-		var $description;
52
-		var $deleted;
53
-		var $created_by_link;
54
-		var $modified_user_link;
55
-		var $assigned_user_id;
56
-		var $assigned_user_name;
57
-		var $assigned_user_link;
58
-		var $maincode;
59
-		var $part_number;
60
-		var $category;
61
-		var $type;
62
-		var $cost;
63
-		var $currency_id;
64
-		var $price;
65
-		var $url;
66
-		var $contact_id;
67
-		var $contact;
43
+        var $id;
44
+        var $name;
45
+        var $date_entered;
46
+        var $date_modified;
47
+        var $modified_user_id;
48
+        var $modified_by_name;
49
+        var $created_by;
50
+        var $created_by_name;
51
+        var $description;
52
+        var $deleted;
53
+        var $created_by_link;
54
+        var $modified_user_link;
55
+        var $assigned_user_id;
56
+        var $assigned_user_name;
57
+        var $assigned_user_link;
58
+        var $maincode;
59
+        var $part_number;
60
+        var $category;
61
+        var $type;
62
+        var $cost;
63
+        var $currency_id;
64
+        var $price;
65
+        var $url;
66
+        var $contact_id;
67
+        var $contact;
68 68
 	
69 69
 
70 70
 
71 71
 
72 72
 
73
-	function AOS_Products_sugar(){	
74
-		parent::Basic();
75
-	}
73
+    function AOS_Products_sugar(){	
74
+        parent::Basic();
75
+    }
76 76
 	
77
-	function bean_implements($interface){
78
-		switch($interface){
79
-			case 'ACL': return true;
80
-		}
81
-		return false;
77
+    function bean_implements($interface){
78
+        switch($interface){
79
+            case 'ACL': return true;
80
+        }
81
+        return false;
82 82
 }
83 83
 		
84 84
 }
Please login to merge, or discard this patch.