Test Failed
Push — CI ( 0f01dd...c95a04 )
by Adam
55:13
created
modules/Documents/metadata/quickcreatedefs.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -49,42 +49,42 @@
 block discarded – undo
49 49
                                             array('label' => '10', 'field' => '30')
50 50
                                             ),
51 51
                             'includes' => 
52
-                              array (
52
+                                array (
53 53
                                 array('file' => 'include/javascript/popup_parent_helper.js'),
54 54
                                 array('file' => 'cache/include/javascript/sugar_grp_jsolait.js'),
55 55
                                 array('file' => 'modules/Documents/documents.js'),
56
-                              ),
56
+                                ),
57 57
 ),
58
- 'panels' =>array (
59
-  'default' => 
60
-  array (
58
+    'panels' =>array (
59
+    'default' => 
60
+    array (
61 61
     
62 62
     array (
63
-      'status_id',
63
+        'status_id',
64 64
     ),
65 65
     array (
66
-      array('name'=>'filename', 
66
+        array('name'=>'filename', 
67 67
             'displayParams'=>array('required'=>true, 'onchangeSetFileNameTo' => 'document_name'),
68 68
             ),
69 69
     ),
70 70
     
71 71
     array (
72
-      'document_name',
73
-       array('name'=>'revision',
72
+        'document_name',
73
+        array('name'=>'revision',
74 74
             'customCode' => '<input name="revision" type="text" value="{$fields.revision.value}" {$DISABLED}>'
75
-           ),
75
+            ),
76 76
     ),    
77 77
     
78 78
     array (
79
-       array('name'=>'active_date','displayParams'=>array('required'=>true)),
80
-       'category_id',
79
+        array('name'=>'active_date','displayParams'=>array('required'=>true)),
80
+        'category_id',
81 81
     ),
82 82
     
83 83
 
84 84
     array (
85
-      array('name'=>'description', 'displayParams'=>array('rows'=>10, 'cols'=>120)),
85
+        array('name'=>'description', 'displayParams'=>array('rows'=>10, 'cols'=>120)),
86
+    ),
86 87
     ),
87
-  ),
88 88
 )
89 89
 
90 90
 );
Please login to merge, or discard this patch.
modules/Documents/metadata/listviewdefs.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -42,16 +42,16 @@  discard block
 block discarded – undo
42 42
 
43 43
 
44 44
 $listViewDefs['Documents'] = array(
45
-  'DOCUMENT_NAME' => 
46
-  array (
45
+    'DOCUMENT_NAME' => 
46
+    array (
47 47
     'width' => '20%',
48 48
     'label' => 'LBL_NAME',
49 49
     'link' => true,
50 50
     'default' => true,
51 51
     'bold' => true,
52
-  ),
53
-  'FILENAME' => 
54
-  array (
52
+    ),
53
+    'FILENAME' => 
54
+    array (
55 55
     'width' => '20%',
56 56
     'label' => 'LBL_FILENAME',
57 57
     'link' => true,
@@ -66,45 +66,45 @@  discard block
 block discarded – undo
66 66
         2 => 'doc_type',
67 67
         3 => 'doc_url',
68 68
     ),
69
-  ),
70
-  'CATEGORY_ID' => 
71
-  array (
69
+    ),
70
+    'CATEGORY_ID' => 
71
+    array (
72 72
     'width' => '10%',
73 73
     'label' => 'LBL_LIST_CATEGORY',
74 74
     'default' => true,
75
-  ),
76
-  'SUBCATEGORY_ID' => 
77
-  array (
75
+    ),
76
+    'SUBCATEGORY_ID' => 
77
+    array (
78 78
     'width' => '15%',
79 79
     'label' => 'LBL_LIST_SUBCATEGORY',
80 80
     'default' => true,
81
-  ),
82
-  'LAST_REV_CREATE_DATE' => 
83
-  array (
81
+    ),
82
+    'LAST_REV_CREATE_DATE' => 
83
+    array (
84 84
     'width' => '10%',
85 85
     'label' => 'LBL_LIST_LAST_REV_DATE',
86 86
     'default' => true,
87 87
     'sortable' => false,
88 88
     'related_fields' => 
89 89
     array (
90
-      0 => 'document_revision_id',
90
+        0 => 'document_revision_id',
91
+    ),
91 92
     ),
92
-  ),
93
-  'EXP_DATE' => 
94
-  array (
93
+    'EXP_DATE' => 
94
+    array (
95 95
     'width' => '10%',
96 96
     'label' => 'LBL_LIST_EXP_DATE',
97 97
     'default' => true,
98
-  ),
99
-  'ASSIGNED_USER_NAME' =>
100
-  array(
98
+    ),
99
+    'ASSIGNED_USER_NAME' =>
100
+    array(
101 101
     'width' => '10',
102 102
     'label' => 'LBL_LIST_ASSIGNED_USER',
103 103
     'module' => 'Employees',
104 104
     'id' => 'ASSIGNED_USER_ID',
105 105
     'default' => true),
106
-  'MODIFIED_BY_NAME' =>
107
-  array (
106
+    'MODIFIED_BY_NAME' =>
107
+    array (
108 108
     'width' => '10%',
109 109
     'label' => 'LBL_MODIFIED_USER',
110 110
     'module' => 'Users',
@@ -113,13 +113,13 @@  discard block
 block discarded – undo
113 113
     'sortable' => false,
114 114
     'related_fields' =>
115 115
     array (
116
-      0 => 'modified_user_id',
116
+        0 => 'modified_user_id',
117 117
     ),
118 118
     ),
119
-  'DATE_ENTERED' => array (
119
+    'DATE_ENTERED' => array (
120 120
     'width' => '10%',
121 121
     'label' => 'LBL_DATE_ENTERED',
122 122
     'default' => true,
123
-  )
123
+    )
124 124
 );
125 125
 ?>
126 126
\ No newline at end of file
Please login to merge, or discard this patch.
modules/Campaigns/PopupCampaignRoi.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -79,46 +79,46 @@
 block discarded – undo
79 79
             //$opp_query1 .= " and deleted=0";
80 80
             $opp_result1=$campaign->db->query($opp_query1);
81 81
             $opp_data1=$campaign->db->fetchByAssoc($opp_result1);
82
- //get the click-throughs
83
- $query_click = "SELECT count(*) hits ";
84
-			$query_click.= " FROM campaign_log ";
85
-			$query_click.= " WHERE campaign_id = '$campaign_id' AND activity_type='link' AND related_type='CampaignTrackers' AND archived=0 AND deleted=0";
82
+    //get the click-throughs
83
+    $query_click = "SELECT count(*) hits ";
84
+            $query_click.= " FROM campaign_log ";
85
+            $query_click.= " WHERE campaign_id = '$campaign_id' AND activity_type='link' AND related_type='CampaignTrackers' AND archived=0 AND deleted=0";
86 86
 
87 87
             //if $marketing id is specified, then lets filter the chart by the value
88 88
             if (!empty($marketing_id)){
89 89
                 $query_click.= " AND marketing_id ='$marketing_id'";
90 90
             }
91 91
 
92
-			$query_click.= " GROUP BY  activity_type, target_type";
93
-			$query_click.= " ORDER BY  activity_type, target_type";
94
-			$result = $campaign->db->query($query_click);
92
+            $query_click.= " GROUP BY  activity_type, target_type";
93
+            $query_click.= " ORDER BY  activity_type, target_type";
94
+            $result = $campaign->db->query($query_click);
95 95
 
96 96
 
97
-  $xtpl->assign("OPP_COUNT", $opp_data1['opp_count']);
98
-  $xtpl->assign("ACTUAL_COST",$opp_data1['actual_cost']);
99
-  $xtpl->assign("PLANNED_BUDGET",$opp_data1['budget']);
100
-  $xtpl->assign("EXPECTED_REVENUE",$opp_data1['expected_revenue']);
97
+    $xtpl->assign("OPP_COUNT", $opp_data1['opp_count']);
98
+    $xtpl->assign("ACTUAL_COST",$opp_data1['actual_cost']);
99
+    $xtpl->assign("PLANNED_BUDGET",$opp_data1['budget']);
100
+    $xtpl->assign("EXPECTED_REVENUE",$opp_data1['expected_revenue']);
101 101
 
102 102
 
103 103
 
104 104
 
105
-	$currency  = new Currency();
105
+    $currency  = new Currency();
106 106
 if(isset($focus->currency_id) && !empty($focus->currency_id))
107 107
 {
108
-	$currency->retrieve($focus->currency_id);
109
-	if( $currency->deleted != 1){
110
-		$xtpl->assign("CURRENCY", $currency->iso4217 .' '.$currency->symbol );
111
-	}else $xtpl->assign("CURRENCY", $currency->getDefaultISO4217() .' '.$currency->getDefaultCurrencySymbol() );
108
+    $currency->retrieve($focus->currency_id);
109
+    if( $currency->deleted != 1){
110
+        $xtpl->assign("CURRENCY", $currency->iso4217 .' '.$currency->symbol );
111
+    }else $xtpl->assign("CURRENCY", $currency->getDefaultISO4217() .' '.$currency->getDefaultCurrencySymbol() );
112 112
 }else{
113 113
 
114
-	$xtpl->assign("CURRENCY", $currency->getDefaultISO4217() .' '.$currency->getDefaultCurrencySymbol() );
114
+    $xtpl->assign("CURRENCY", $currency->getDefaultISO4217() .' '.$currency->getDefaultCurrencySymbol() );
115 115
 
116 116
 }
117 117
 
118 118
 global $current_user;
119 119
 if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){
120 120
 
121
-	$xtpl->assign("ADMIN_EDIT","<a href='index.php?action=index&module=DynamicLayout&from_action=".$_REQUEST['action'] ."&from_module=".$_REQUEST['module'] ."&record=".$_REQUEST['record']. "'>".SugarThemeRegistry::current()->getImage("EditLayout","border='0' align='bottom'",null,null,'.gif',$mod_strings['LBL_EDIT_LAYOUT'])."</a>");
121
+    $xtpl->assign("ADMIN_EDIT","<a href='index.php?action=index&module=DynamicLayout&from_action=".$_REQUEST['action'] ."&from_module=".$_REQUEST['module'] ."&record=".$_REQUEST['record']. "'>".SugarThemeRegistry::current()->getImage("EditLayout","border='0' align='bottom'",null,null,'.gif',$mod_strings['LBL_EDIT_LAYOUT'])."</a>");
122 122
 
123 123
 }
124 124
 
Please login to merge, or discard this patch.
modules/Campaigns/WizardNewsletter.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
     foreach($trkr_lists as $trkr_id){
295 295
         $ct_focus = new CampaignTracker();
296 296
         $ct_focus->retrieve($trkr_id);
297
-      if(isset($ct_focus->tracker_name) && !empty($ct_focus->tracker_name)){
297
+        if(isset($ct_focus->tracker_name) && !empty($ct_focus->tracker_name)){
298 298
             if($ct_focus->is_optout){$opt = 'checked';}else{$opt = '';}
299 299
             $trkr_html .= "<div id='existing_trkr".$trkr_count."'> <table width='100%' border='0' cellspacing='0' cellpadding='0'>" ;
300 300
             $trkr_html .= "<tr class='evenListRowS1'><td width='15%'><input name='wiz_step3_is_optout".$trkr_count."' title='".$mod_strings['LBL_EDIT_OPT_OUT'] . $trkr_count ."' id='existing_is_optout". $trkr_count ."' class='checkbox' type='checkbox' $opt  /><input name='wiz_step3_id".$trkr_count."' value='".$ct_focus->id."' id='existing_tracker_id". $trkr_count ."'type='hidden''/></td>";
@@ -305,8 +305,8 @@  discard block
 block discarded – undo
305 305
 
306 306
 
307 307
 
308
-      }
309
-      $trkr_count =$trkr_count+1;
308
+        }
309
+        $trkr_count =$trkr_count+1;
310 310
     }
311 311
     
312 312
     $trkr_html .= "<div id='no_trackers'></div>";
@@ -391,33 +391,33 @@  discard block
 block discarded – undo
391 391
 $prospect_lists = $focus->prospectlists->get();
392 392
 
393 393
 if((isset($_REQUEST['wizardtype']) && $_REQUEST['wizardtype'] ==1) || ($focus->campaign_type=='NewsLetter')){
394
- //this is a newsletter type campaign, fill in subscription values   
394
+    //this is a newsletter type campaign, fill in subscription values   
395 395
 
396 396
 //if prospect lists are returned, then iterate through and populate form values
397 397
 if(count($prospect_lists)>0){
398 398
     
399 399
     foreach($prospect_lists as $pl_id){
400 400
     //retrieve prospect list
401
-     $pl = new ProspectList();   
402
-     $pl->retrieve($pl_id);
401
+        $pl = new ProspectList();   
402
+        $pl->retrieve($pl_id);
403 403
 
404
-      if(isset($pl->list_type) && !empty($pl->list_type)){
405
-         //assign values based on type
406
-         if(($pl->list_type == 'default') || ($pl->list_type == 'seed')){            
404
+        if(isset($pl->list_type) && !empty($pl->list_type)){
405
+            //assign values based on type
406
+            if(($pl->list_type == 'default') || ($pl->list_type == 'seed')){            
407 407
             $ss->assign('SUBSCRIPTION_ID', $pl->id);
408 408
             $ss->assign('SUBSCRIPTION_NAME', $pl->name);
409
-         };
410
-         if($pl->list_type == 'exempt'){
409
+            };
410
+            if($pl->list_type == 'exempt'){
411 411
             $ss->assign('UNSUBSCRIPTION_ID', $pl->id);
412 412
             $ss->assign('UNSUBSCRIPTION_NAME', $pl->name);
413 413
          
414
-         };
415
-         if($pl->list_type == 'test'){
414
+            };
415
+            if($pl->list_type == 'test'){
416 416
             $ss->assign('TEST_ID', $pl->id);
417 417
             $ss->assign('TEST_NAME', $pl->name);
418 418
          
419
-         };
420
-      }
419
+            };
420
+        }
421 421
      
422 422
     }
423 423
 }
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 
426 426
 
427 427
 }else{
428
- //this is not a newlsetter campaign, so fill in target list table
428
+    //this is not a newlsetter campaign, so fill in target list table
429 429
     //create array for javascript, this will help to display the option text, not the value
430 430
     $dom_txt =' ';
431 431
     foreach($app_list_strings['prospect_list_type_dom'] as $key=>$val){
@@ -438,19 +438,19 @@  discard block
 block discarded – undo
438 438
         
439 439
         foreach($prospect_lists as $pl_id){
440 440
         //retrieve prospect list
441
-             $pl = new ProspectList();   
442
-             $pl_focus = $pl->retrieve($pl_id);
443
-             $trgt_html .= "<div id='existing_trgt".$trgt_count."'> <table class='tabDetailViewDL2' width='100%'>" ;
444
-             $trgt_html .= "<td width='25%'> <input id='existing_target_name". $trgt_count ."' type='hidden' type='text' size='60' maxlength='255' name='existing_target_name". $trgt_count ."'  value='". $pl_focus->name."' >". $pl_focus->name."</td>";
445
-             $trgt_html .= "<td width='25%'><input type='hidden' size='60' maxlength='255' name='existing_tracker_list_type". $trgt_count ."'   id='existing_tracker_list_type". $trgt_count ."' value='".$pl_focus->list_type."' >".$app_list_strings['prospect_list_type_dom'][$pl_focus->list_type];
446
-             $trgt_html .= "<input type='hidden' name='added_target_id". $trgt_count ."' id='added_target_id". $trgt_count ."' value='". $pl_focus->id ."' ></td>";
447
-             $trgt_html .= "<td><a href='#' onclick=\"javascript:remove_existing_target('existing_trgt".$trgt_count."','".$pl_focus->id."'); \" >  ";
448
-             $trgt_html .= SugarThemeRegistry::current()->getImage('delete_inline', "border='0' align='absmiddle'", 12, 12, ".gif", $mod_strings['LBL_DELETE'])."</a></td></tr></table></div>";
441
+                $pl = new ProspectList();   
442
+                $pl_focus = $pl->retrieve($pl_id);
443
+                $trgt_html .= "<div id='existing_trgt".$trgt_count."'> <table class='tabDetailViewDL2' width='100%'>" ;
444
+                $trgt_html .= "<td width='25%'> <input id='existing_target_name". $trgt_count ."' type='hidden' type='text' size='60' maxlength='255' name='existing_target_name". $trgt_count ."'  value='". $pl_focus->name."' >". $pl_focus->name."</td>";
445
+                $trgt_html .= "<td width='25%'><input type='hidden' size='60' maxlength='255' name='existing_tracker_list_type". $trgt_count ."'   id='existing_tracker_list_type". $trgt_count ."' value='".$pl_focus->list_type."' >".$app_list_strings['prospect_list_type_dom'][$pl_focus->list_type];
446
+                $trgt_html .= "<input type='hidden' name='added_target_id". $trgt_count ."' id='added_target_id". $trgt_count ."' value='". $pl_focus->id ."' ></td>";
447
+                $trgt_html .= "<td><a href='#' onclick=\"javascript:remove_existing_target('existing_trgt".$trgt_count."','".$pl_focus->id."'); \" >  ";
448
+                $trgt_html .= SugarThemeRegistry::current()->getImage('delete_inline', "border='0' align='absmiddle'", 12, 12, ".gif", $mod_strings['LBL_DELETE'])."</a></td></tr></table></div>";
449 449
 
450 450
 
451 451
     
452 452
           
453
-          $trgt_count =$trgt_count +1;
453
+            $trgt_count =$trgt_count +1;
454 454
         }
455 455
         
456 456
         $trgt_html  .= "<div id='no_targets'></div>";
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
 
492 492
 
493 493
 //  this is the wizard control script that resides in page    
494
- $divScript = <<<EOQ
494
+    $divScript = <<<EOQ
495 495
 
496 496
  <script type="text/javascript" language="javascript">
497 497
    
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
         $nav_html .= "<tr><td scope='row' nowrap><div id='nav_step'".($i+2).">".$mod_strings['LBL_NAVIGATION_MENU_SEND_EMAIL']."</div></li>";
606 606
         $nav_html .= "<tr><td scope='row' nowrap><div id='nav_step'".($i+3).">".$summ_url."</div></td></tr>";
607 607
     }else{
608
-     $nav_html .= "<tr><td scope='row' nowrap><div id='nav_step'".($i+1).">".$summ_url."</div></td></tr>";   
608
+        $nav_html .= "<tr><td scope='row' nowrap><div id='nav_step'".($i+1).">".$summ_url."</div></td></tr>";   
609 609
     }
610 610
        
611 611
     $nav_html .= '</table>';
Please login to merge, or discard this patch.
modules/Campaigns/GenerateWebToLeadForm.php 1 patch
Indentation   +216 added lines, -216 removed lines patch added patch discarded remove patch
@@ -101,19 +101,19 @@  discard block
 block discarded – undo
101 101
 }
102 102
 
103 103
 
104
- $lead = new Lead();
105
- $fieldsMetaData = new FieldsMetaData();
106
- $xtpl=new XTemplate ('modules/Campaigns/WebToLeadForm.html');
107
- $xtpl->assign("MOD", $mod_strings);
108
- $xtpl->assign("APP", $app_strings);
109
- $Web_To_Lead_Form_html = '';
110
- $Web_To_Lead_Form_html .='<link rel="stylesheet" type="text/css" media="all" href="' . getJSPath(SugarThemeRegistry::current()->getCSSURL('calendar-win2k-cold-1.css')) . '">';
111
-
112
- $Web_To_Lead_Form_html .= "<script type=\"text/javascript\" src='" . getJSPath($site_url.'/cache/include/javascript/sugar_grp1.js') . "'></script>";
113
- $Web_To_Lead_Form_html .= '<script type="text/javascript" src="' . getJSPath($site_url.'/cache/include/javascript/calendar.js') . '"></script>';
114
-
115
- $Web_To_Lead_Form_html .="<form action='$web_post_url' name='WebToLeadForm' method='POST' id='WebToLeadForm'>";
116
- $Web_To_Lead_Form_html .= "<table width='100%' style='border-top: 1px solid;
104
+    $lead = new Lead();
105
+    $fieldsMetaData = new FieldsMetaData();
106
+    $xtpl=new XTemplate ('modules/Campaigns/WebToLeadForm.html');
107
+    $xtpl->assign("MOD", $mod_strings);
108
+    $xtpl->assign("APP", $app_strings);
109
+    $Web_To_Lead_Form_html = '';
110
+    $Web_To_Lead_Form_html .='<link rel="stylesheet" type="text/css" media="all" href="' . getJSPath(SugarThemeRegistry::current()->getCSSURL('calendar-win2k-cold-1.css')) . '">';
111
+
112
+    $Web_To_Lead_Form_html .= "<script type=\"text/javascript\" src='" . getJSPath($site_url.'/cache/include/javascript/sugar_grp1.js') . "'></script>";
113
+    $Web_To_Lead_Form_html .= '<script type="text/javascript" src="' . getJSPath($site_url.'/cache/include/javascript/calendar.js') . '"></script>';
114
+
115
+    $Web_To_Lead_Form_html .="<form action='$web_post_url' name='WebToLeadForm' method='POST' id='WebToLeadForm'>";
116
+    $Web_To_Lead_Form_html .= "<table width='100%' style='border-top: 1px solid;
117 117
 border-bottom: 1px solid;
118 118
 padding: 10px 6px 12px 10px;
119 119
 background-color: rgb(233, 243, 255);
@@ -126,21 +126,21 @@  discard block
 block discarded – undo
126 126
 $Web_To_Lead_Form_html .= "<tr align='left' style='color: rgb(0, 105, 225); font-family: Arial,Verdana,Helvetica,sans-serif; font-size: 12px; font-weight: normal; margin-bottom: 0px; margin-top: 0px;'><TD COLSPAN='4'>$web_form_description</TD></tr>";
127 127
 $Web_To_Lead_Form_html .= "<tr align='center' style='color: rgb(0, 105, 225); font-family: Arial,Verdana,Helvetica,sans-serif; font-size: 8px; font-weight: normal; margin-bottom: 0px; margin-top: 0px;'><TD COLSPAN='4'>&nbsp</TD></tr>";
128 128
 
129
- //$Web_To_Lead_Form_html .= "\n<p>\n";
129
+    //$Web_To_Lead_Form_html .= "\n<p>\n";
130 130
 
131 131
 if(!empty($_REQUEST['colsFirst']) && !empty($_REQUEST['colsSecond'])){
132
- if(count($_REQUEST['colsFirst']) < count($_REQUEST['colsSecond'])){
133
-   $columns= count($_REQUEST['colsSecond']);
134
- }
135
- if(count($_REQUEST['colsFirst']) > count($_REQUEST['colsSecond']) || count($_REQUEST['colsFirst']) == count($_REQUEST['colsSecond'])){
136
-   $columns= count($_REQUEST['colsFirst']);
137
- }
132
+    if(count($_REQUEST['colsFirst']) < count($_REQUEST['colsSecond'])){
133
+    $columns= count($_REQUEST['colsSecond']);
134
+    }
135
+    if(count($_REQUEST['colsFirst']) > count($_REQUEST['colsSecond']) || count($_REQUEST['colsFirst']) == count($_REQUEST['colsSecond'])){
136
+    $columns= count($_REQUEST['colsFirst']);
137
+    }
138 138
 }
139 139
 else if(!empty($_REQUEST['colsFirst'])){
140
- $columns= count($_REQUEST['colsFirst']);
140
+    $columns= count($_REQUEST['colsFirst']);
141 141
 }
142 142
 else if(!empty($_REQUEST['colsSecond'])){
143
- $columns= count($_REQUEST['colsSecond']);
143
+    $columns= count($_REQUEST['colsSecond']);
144 144
 }
145 145
 
146 146
 
@@ -153,140 +153,140 @@  discard block
 block discarded – undo
153 153
     if(!empty($_REQUEST['colsFirst'][$i])){
154 154
         $colsFirstField = $_REQUEST['colsFirst'][$i];
155 155
         //_pp($_REQUEST['colsFirst']);
156
-     }
156
+        }
157 157
     if(!empty($_REQUEST['colsSecond'][$i])){
158 158
         $colsSecondField = $_REQUEST['colsSecond'][$i];
159 159
         //_pp($_REQUEST['colsSecond']);
160
-     }
160
+        }
161 161
 
162 162
     if(isset($lead->field_defs[$colsFirstField]) && $lead->field_defs[$colsFirstField] != null)
163 163
     {
164
-         $field_vname = preg_replace('/:$/','',translate($lead->field_defs[$colsFirstField]['vname'],'Leads'));
165
-         $field_name  = $colsFirstField;
166
-         $field_label = $field_vname .": ";
167
-         if(isset($lead->field_defs[$colsFirstField]['custom_type']) && $lead->field_defs[$colsFirstField]['custom_type'] != null){
164
+            $field_vname = preg_replace('/:$/','',translate($lead->field_defs[$colsFirstField]['vname'],'Leads'));
165
+            $field_name  = $colsFirstField;
166
+            $field_label = $field_vname .": ";
167
+            if(isset($lead->field_defs[$colsFirstField]['custom_type']) && $lead->field_defs[$colsFirstField]['custom_type'] != null){
168 168
             $field_type= $lead->field_defs[$colsFirstField]['custom_type'];
169
-         }
170
-         else{
169
+            }
170
+            else{
171 171
             $field_type= $lead->field_defs[$colsFirstField]['type'];
172
-         }
172
+            }
173 173
          
174
-         //bug: 47574 - make sure, that webtolead_email1 field has same required attribute as email1 field
175
-         if($colsFirstField == 'webtolead_email1' && isset($lead->field_defs['email1']) && isset($lead->field_defs['email1']['required'])){
176
-             $lead->field_defs['webtolead_email1']['required'] = $lead->field_defs['email1']['required'];
177
-         }
174
+            //bug: 47574 - make sure, that webtolead_email1 field has same required attribute as email1 field
175
+            if($colsFirstField == 'webtolead_email1' && isset($lead->field_defs['email1']) && isset($lead->field_defs['email1']['required'])){
176
+                $lead->field_defs['webtolead_email1']['required'] = $lead->field_defs['email1']['required'];
177
+            }
178 178
          
179
-         $field_required = '';
180
-         if(isset($lead->field_defs[$colsFirstField]['required']) && $lead->field_defs[$colsFirstField]['required'] != null
179
+            $field_required = '';
180
+            if(isset($lead->field_defs[$colsFirstField]['required']) && $lead->field_defs[$colsFirstField]['required'] != null
181 181
              && $lead->field_defs[$colsFirstField]['required'] != 0)
182
-          {
182
+            {
183 183
             $field_required = $lead->field_defs[$colsFirstField]['required'];
184 184
             if (! in_array($lead->field_defs[$colsFirstField]['name'], $required_fields)){
185
-              array_push($required_fields,$lead->field_defs[$colsFirstField]['name']);
186
-             }
187
-          }
188
-          if($lead->field_defs[$colsFirstField]['name']=='last_name'){
185
+                array_push($required_fields,$lead->field_defs[$colsFirstField]['name']);
186
+                }
187
+            }
188
+            if($lead->field_defs[$colsFirstField]['name']=='last_name'){
189 189
             if (! in_array($lead->field_defs[$colsFirstField]['name'], $required_fields)){
190
-              array_push($required_fields,$lead->field_defs[$colsFirstField]['name']);
190
+                array_push($required_fields,$lead->field_defs[$colsFirstField]['name']);
191 191
             }
192
-          }
193
-         if($field_type=='multienum' || $field_type=='enum' || $field_type=='radioenum')  $field_options= $lead->field_defs[$colsFirstField]['options'];
192
+            }
193
+            if($field_type=='multienum' || $field_type=='enum' || $field_type=='radioenum')  $field_options= $lead->field_defs[$colsFirstField]['options'];
194 194
     }
195 195
     //preg_replace('/:$/','',translate($field_def['vname'],'Leads')
196 196
     if(isset($lead->field_defs[$colsSecondField]) && $lead->field_defs[$colsSecondField] != null)
197 197
     {
198
-         $field1_vname= preg_replace('/:$/','',translate($lead->field_defs[$colsSecondField]['vname'],'Leads'));
199
-         $field1_name= $colsSecondField;
200
-         $field1_label = $field1_vname .": ";
201
-         if(isset($lead->field_defs[$colsSecondField]['custom_type']) && $lead->field_defs[$colsSecondField]['custom_type'] != null){
198
+            $field1_vname= preg_replace('/:$/','',translate($lead->field_defs[$colsSecondField]['vname'],'Leads'));
199
+            $field1_name= $colsSecondField;
200
+            $field1_label = $field1_vname .": ";
201
+            if(isset($lead->field_defs[$colsSecondField]['custom_type']) && $lead->field_defs[$colsSecondField]['custom_type'] != null){
202 202
             $field1_type= $lead->field_defs[$colsSecondField]['custom_type'];
203
-         }
204
-         else{
203
+            }
204
+            else{
205 205
             $field1_type= $lead->field_defs[$colsSecondField]['type'];
206
-         }
206
+            }
207 207
          
208
-         //bug: 47574 - make sure, that webtolead_email1 field has same required attribute as email1 field
209
-         if($colsSecondField == 'webtolead_email1' && isset($lead->field_defs['email1']) && isset($lead->field_defs['email1']['required'])){
210
-             $lead->field_defs['webtolead_email1']['required'] = $lead->field_defs['email1']['required'];
211
-         }
208
+            //bug: 47574 - make sure, that webtolead_email1 field has same required attribute as email1 field
209
+            if($colsSecondField == 'webtolead_email1' && isset($lead->field_defs['email1']) && isset($lead->field_defs['email1']['required'])){
210
+                $lead->field_defs['webtolead_email1']['required'] = $lead->field_defs['email1']['required'];
211
+            }
212 212
          
213
-         $field1_required = '';
214
-         if(isset($lead->field_defs[$colsSecondField]['required']) && $lead->field_defs[$colsSecondField]['required'] != null
213
+            $field1_required = '';
214
+            if(isset($lead->field_defs[$colsSecondField]['required']) && $lead->field_defs[$colsSecondField]['required'] != null
215 215
              && $lead->field_defs[$colsSecondField]['required'] != 0){
216
-          $field1_required = $lead->field_defs[$colsSecondField]['required'];
217
-           if (! in_array($lead->field_defs[$colsSecondField]['name'], $required_fields)){
218
-              array_push($required_fields,$lead->field_defs[$colsSecondField]['name']);
216
+            $field1_required = $lead->field_defs[$colsSecondField]['required'];
217
+            if (! in_array($lead->field_defs[$colsSecondField]['name'], $required_fields)){
218
+                array_push($required_fields,$lead->field_defs[$colsSecondField]['name']);
219 219
             }
220
-         }
221
-         if($lead->field_defs[$colsSecondField]['name']=='last_name'){
220
+            }
221
+            if($lead->field_defs[$colsSecondField]['name']=='last_name'){
222 222
             if (! in_array($lead->field_defs[$colsSecondField]['name'], $required_fields)){
223
-              array_push($required_fields,$lead->field_defs[$colsSecondField]['name']);
223
+                array_push($required_fields,$lead->field_defs[$colsSecondField]['name']);
224 224
             }
225
-         }
226
-         if($field1_type=='multienum' || $field1_type=='enum' || $field1_type=='radioenum')  $field1_options= $lead->field_defs[$colsSecondField]['options'];
225
+            }
226
+            if($field1_type=='multienum' || $field1_type=='enum' || $field1_type=='radioenum')  $field1_options= $lead->field_defs[$colsSecondField]['options'];
227 227
     }
228 228
 
229
-     $Web_To_Lead_Form_html .= "<tr>";
229
+        $Web_To_Lead_Form_html .= "<tr>";
230 230
 
231 231
     if(isset($lead->field_defs[$colsFirstField]) && $lead->field_defs[$colsFirstField] != null){
232 232
         if($field_type=='multienum' || $field_type=='enum' || $field_type=='radioenum'){
233
-          $lead_options = '';
234
-          if(!empty($lead->$field_name)){
233
+            $lead_options = '';
234
+            if(!empty($lead->$field_name)){
235 235
             $lead_options= get_select_options_with_id($app_list_strings[$field_options], unencodeMultienum($lead->$field_name));
236
-          }
237
-          else{
236
+            }
237
+            else{
238 238
             $lead_options= get_select_options_with_id($app_list_strings[$field_options], '');
239
-          }
240
-          if($field_required){
239
+            }
240
+            if($field_required){
241 241
                 $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field_label</span sugar='slot'><span class='required' style='color: rgb(255, 0, 0);'>$web_required_symbol</span></td>";
242 242
             }
243
-         else{
243
+            else{
244 244
                 $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field_label</span sugar='slot'></td>";
245
-             }
246
-          if(isset($lead->field_defs[$colsFirstField]['isMultiSelect']) && $lead->field_defs[$colsFirstField]['isMultiSelect'] ==1){
245
+                }
246
+            if(isset($lead->field_defs[$colsFirstField]['isMultiSelect']) && $lead->field_defs[$colsFirstField]['isMultiSelect'] ==1){
247 247
             $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'><select id='{$field_name}' multiple='true' name='{$field_name}[]' tabindex='1'>$lead_options</select></span sugar='slot'></td>";
248
-          }elseif(ifRadioButton($lead->field_defs[$colsFirstField]['name'])){
248
+            }elseif(ifRadioButton($lead->field_defs[$colsFirstField]['name'])){
249 249
             $Web_To_Lead_Form_html .="<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'>";
250 250
             foreach($app_list_strings[$field_options] as $field_option_key => $field_option){
251 251
                 if($field_option != null){
252
-                	if(!empty($lead->$field_name) && in_array($field_option_key,unencodeMultienum($lead->$field_name))){
253
-                		$Web_To_Lead_Form_html .="<input id='$colsFirstField"."_$field_option_key' checked name='$colsFirstField' value='$field_option_key' type='radio'>";
254
-                	} else{
255
-                		$Web_To_Lead_Form_html .="<input id='$colsFirstField"."_$field_option_key' name='$colsFirstField' value='$field_option_key' type='radio'>";
256
-                	}
257
-	                $Web_To_Lead_Form_html .="<span ='document.getElementById('".$lead->field_defs[$colsFirstField]."_$field_option_key').checked =true style='cursor:default'; onmousedown='return false;'>$field_option</span><br>";
252
+                    if(!empty($lead->$field_name) && in_array($field_option_key,unencodeMultienum($lead->$field_name))){
253
+                        $Web_To_Lead_Form_html .="<input id='$colsFirstField"."_$field_option_key' checked name='$colsFirstField' value='$field_option_key' type='radio'>";
254
+                    } else{
255
+                        $Web_To_Lead_Form_html .="<input id='$colsFirstField"."_$field_option_key' name='$colsFirstField' value='$field_option_key' type='radio'>";
256
+                    }
257
+                    $Web_To_Lead_Form_html .="<span ='document.getElementById('".$lead->field_defs[$colsFirstField]."_$field_option_key').checked =true style='cursor:default'; onmousedown='return false;'>$field_option</span><br>";
258 258
                 }
259 259
             }
260 260
             $Web_To_Lead_Form_html .="</span sugar='slot'></td>";
261
-          }else{
261
+            }else{
262 262
             $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'><select id=$field_name name=$field_name tabindex='1'>$lead_options</select></span sugar='slot'></td>";
263
-          }
264
-         }
265
-         if($field_type=='bool'){
266
-          if($field_required){
263
+            }
264
+            }
265
+            if($field_type=='bool'){
266
+            if($field_required){
267 267
                 $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field_label</span sugar='slot'><span class='required' style='color: rgb(255, 0, 0);'>$web_required_symbol</span></td>";
268
-          }
269
-          else{
268
+            }
269
+            else{
270 270
                 $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field_label</span sugar='slot'></td>";
271
-          }
272
-          $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'><input type='checkbox' id=$field_name name=$field_name></span sugar='slot'></td>";
273
-          if (! in_array($lead->field_defs[$colsFirstField]['name'], $bool_fields)){
274
-              array_push($bool_fields,$lead->field_defs[$colsFirstField]['name']);
275
-             }
276
-         }
277
-         if($field_type=='date') {
271
+            }
272
+            $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'><input type='checkbox' id=$field_name name=$field_name></span sugar='slot'></td>";
273
+            if (! in_array($lead->field_defs[$colsFirstField]['name'], $bool_fields)){
274
+                array_push($bool_fields,$lead->field_defs[$colsFirstField]['name']);
275
+                }
276
+            }
277
+            if($field_type=='date') {
278 278
 
279
-          global $timedate;
280
-          $cal_dateformat = $timedate->get_cal_date_format();
281
-	      $LBL_ENTER_DATE = translate('LBL_ENTER_DATE', 'Charts');
282
-          if($field_required){
279
+            global $timedate;
280
+            $cal_dateformat = $timedate->get_cal_date_format();
281
+            $LBL_ENTER_DATE = translate('LBL_ENTER_DATE', 'Charts');
282
+            if($field_required){
283 283
                 $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field_label</span sugar='slot'><span class='required' style='color: rgb(255, 0, 0);'>$web_required_symbol</span></td>";
284
-          }
285
-          else{
284
+            }
285
+            else{
286 286
                 $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field_label</span sugar='slot'></td>";
287
-          }
287
+            }
288 288
 
289
-			$Web_To_Lead_Form_html .= "
289
+            $Web_To_Lead_Form_html .= "
290 290
 				<td width='35%' style='font-size: 12px; font-weight: normal;'>
291 291
 				<script type='text/javascript'>
292 292
 					update{$field_name}Value = function() {
@@ -301,121 +301,121 @@  discard block
 block discarded – undo
301 301
 					}
302 302
 				</script>
303 303
 				<span sugar='slot'><input type='hidden' id='{$field_name}' name='{$field_name}'/>";
304
-          	$order = explode("%", $cal_dateformat);
305
-          	foreach($order as $part)
306
-          	{
307
-          		if (!isset($part[0]))
308
-          			continue;
309
-          		if (strToUpper($part[0]) == "M" )
310
-          			$Web_To_Lead_Form_html .= translate("LBL_MONTH") . ":<input class=\"text\"
304
+                $order = explode("%", $cal_dateformat);
305
+                foreach($order as $part)
306
+                {
307
+                    if (!isset($part[0]))
308
+                        continue;
309
+                    if (strToUpper($part[0]) == "M" )
310
+                        $Web_To_Lead_Form_html .= translate("LBL_MONTH") . ":<input class=\"text\"
311 311
 					name=\"{$field_name}_month\" size='2' maxlength='2' id='{$field_name}_month' value=''
312 312
 					onblur=\"update{$field_name}Value()\">";
313
-				else if (strToUpper($part[0]) == "D" )
314
-					$Web_To_Lead_Form_html .=  translate("LBL_DAY") . ":<input class=\"text\"
313
+                else if (strToUpper($part[0]) == "D" )
314
+                    $Web_To_Lead_Form_html .=  translate("LBL_DAY") . ":<input class=\"text\"
315 315
 					name=\"{$field_name}_day\" size='2' maxlength='2' id='{$field_name}_day' value=''
316 316
 					onblur=\"update{$field_name}Value()\">";
317
-				else if (strToUpper($part[0]) == "Y" )
318
-					$Web_To_Lead_Form_html .= translate("LBL_YEAR") . ":<input class=\"text\"
317
+                else if (strToUpper($part[0]) == "Y" )
318
+                    $Web_To_Lead_Form_html .= translate("LBL_YEAR") . ":<input class=\"text\"
319 319
 					name=\"{$field_name}_year\" size='4' maxlength='4' id='{$field_name}_year' value=''
320 320
 					onblur=\"update{$field_name}Value()\">";
321
-          	}
322
-          	$Web_To_Lead_Form_html .= "</span></td>";
323
-	     } // if
321
+                }
322
+                $Web_To_Lead_Form_html .= "</span></td>";
323
+            } // if
324 324
 
325
-         if( $field_type=='varchar' ||  $field_type=='name'
325
+            if( $field_type=='varchar' ||  $field_type=='name'
326 326
           ||  $field_type=='phone' || $field_type=='currency' || $field_type=='url' || $field_type=='int'){
327
-           if($field_name=='last_name' ||   $field_required){
327
+            if($field_name=='last_name' ||   $field_required){
328 328
                 $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field_label</span sugar='slot'><span class='required' style='color: rgb(255, 0, 0);'>$web_required_symbol</span></td>";
329
-              }
329
+                }
330 330
             else{
331 331
                 $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field_label</span sugar='slot'></td>";
332
-             }
333
-             if ( $field_name=='email1'||$field_name=='email2' ){
334
-                 $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'><input id=$field_name name=$field_name type='text' onchange='validateEmailAdd();'></span sugar='slot'></td>";
335
-             } else {
332
+                }
333
+                if ( $field_name=='email1'||$field_name=='email2' ){
334
+                    $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'><input id=$field_name name=$field_name type='text' onchange='validateEmailAdd();'></span sugar='slot'></td>";
335
+                } else {
336
+                $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'><input id=$field_name name=$field_name type='text'></span sugar='slot'></td>";
337
+                }
338
+            }
339
+            if ( $field_type == 'text' ) {
340
+                $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field_label</span sugar='slot'></td>";
341
+                $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span id='ta_replace' sugar='slot'><input id=$field_name name=$field_name type='text'></span sugar='slot'></td>";
342
+            }
343
+            if($field_type=='relate' &&  $field_name=='account_name'){
344
+                $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field_label</span sugar='slot'></td>";
336 345
                 $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'><input id=$field_name name=$field_name type='text'></span sugar='slot'></td>";
337
-             }
338
-            }
339
-          if ( $field_type == 'text' ) {
340
-               $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field_label</span sugar='slot'></td>";
341
-			   $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span id='ta_replace' sugar='slot'><input id=$field_name name=$field_name type='text'></span sugar='slot'></td>";
342
-           }
343
-           if($field_type=='relate' &&  $field_name=='account_name'){
344
-	            $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field_label</span sugar='slot'></td>";
345
-	            $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'><input id=$field_name name=$field_name type='text'></span sugar='slot'></td>";
346
-           }
347
-          if($field_type=='email'){
346
+            }
347
+            if($field_type=='email'){
348 348
             if($field_required){
349 349
                 $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field_label</span sugar='slot'><span class='required' style='color: rgb(255, 0, 0);'>$web_required_symbol</span></td>";
350
-              }
351
-           else{
350
+                }
351
+            else{
352 352
                 $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field_label</span sugar='slot'></td>";
353
-             }
353
+                }
354 354
             $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'><input id=$field_name name=$field_name type='text' onchange='validateEmailAdd();'></span sugar='slot'></td>";
355
-           }
356
-       }
357
-      else{
355
+            }
356
+        }
357
+        else{
358 358
             $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>&nbsp</span sugar='slot'></td>";
359 359
             $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'>&nbsp</span sugar='slot'></td>";
360 360
         }
361 361
 
362
-     if(isset($lead->field_defs[$colsSecondField]) && $lead->field_defs[$colsSecondField] != null){
363
-         if($field1_type=='multienum' || $field1_type=='enum' || $field1_type=='radioenum'){
364
-          $lead1_options = '';
365
-          if(!empty($lead->$field1_name)){
362
+        if(isset($lead->field_defs[$colsSecondField]) && $lead->field_defs[$colsSecondField] != null){
363
+            if($field1_type=='multienum' || $field1_type=='enum' || $field1_type=='radioenum'){
364
+            $lead1_options = '';
365
+            if(!empty($lead->$field1_name)){
366 366
             $lead1_options= get_select_options_with_id($app_list_strings[$field1_options], unencodeMultienum($lead->$field1_name));
367
-          }
368
-          else{
367
+            }
368
+            else{
369 369
             $lead1_options= get_select_options_with_id($app_list_strings[$field1_options], '');
370
-          }
370
+            }
371 371
             if($field1_required){
372 372
                 $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field1_label</span sugar='slot'><span class='required' style='color: rgb(255, 0, 0);'>$web_required_symbol</span></td>";
373 373
             }
374 374
             else{
375 375
                 $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field1_label</span sugar='slot'></td>";
376
-             }
376
+                }
377 377
             if(isset($lead->field_defs[$colsSecondField]['isMultiSelect']) && $lead->field_defs[$colsSecondField]['isMultiSelect'] ==1){
378 378
                 $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'><select id='{$field1_name}' name='{$field1_name}[]' multiple='true' tabindex='1'>$lead1_options</select></span sugar='slot'></td>";
379 379
             }elseif(ifRadioButton($lead->field_defs[$colsSecondField]['name'])){
380 380
                 $Web_To_Lead_Form_html .="<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'>";
381 381
                 foreach($app_list_strings[$field1_options] as $field_option_key => $field_option){
382 382
                     if($field_option != null){
383
-                    	if(!empty($lead->$field1_name) && in_array($field_option_key,unencodeMultienum($lead->$field1_name))){
384
-                    		$Web_To_Lead_Form_html .="<input id='$colsSecondField"."_$field_option_key' checked name='$colsSecondField' value='$field_option_key' type='radio'>";
385
-                    	}else{
386
-	                    	$Web_To_Lead_Form_html .="<input id='$colsSecondField"."_$field_option_key' name='$colsSecondField' value='$field_option_key' type='radio'>";
387
-	                    }
388
-	                    $Web_To_Lead_Form_html .="<span ='document.getElementById('".$lead->field_defs[$colsSecondField]."_$field_option_key').checked =true style='cursor:default'; onmousedown='return false;'>$field_option</span><br>";
383
+                        if(!empty($lead->$field1_name) && in_array($field_option_key,unencodeMultienum($lead->$field1_name))){
384
+                            $Web_To_Lead_Form_html .="<input id='$colsSecondField"."_$field_option_key' checked name='$colsSecondField' value='$field_option_key' type='radio'>";
385
+                        }else{
386
+                            $Web_To_Lead_Form_html .="<input id='$colsSecondField"."_$field_option_key' name='$colsSecondField' value='$field_option_key' type='radio'>";
387
+                        }
388
+                        $Web_To_Lead_Form_html .="<span ='document.getElementById('".$lead->field_defs[$colsSecondField]."_$field_option_key').checked =true style='cursor:default'; onmousedown='return false;'>$field_option</span><br>";
389 389
                     }
390 390
                 }
391 391
                 $Web_To_Lead_Form_html .="</span sugar='slot'></td>";
392 392
             }else{
393 393
                 $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'><select id=$field1_name name=$field1_name tabindex='1'>$lead1_options</select></span sugar='slot'></td>";
394 394
             }
395
-         }
396
-         if($field1_type=='bool'){
397
-          if($field1_required){
395
+            }
396
+            if($field1_type=='bool'){
397
+            if($field1_required){
398 398
             $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field1_label</span sugar='slot'><span class='required' style='color: rgb(255, 0, 0);'>$web_required_symbol</span></td>";
399
-          }
400
-          else{
399
+            }
400
+            else{
401 401
             $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field1_label</span sugar='slot'></td>";
402
-          }
402
+            }
403 403
             $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'><input id=$field1_name name=$field1_name type='checkbox'></span sugar='slot'></td>";
404 404
             if (! in_array($lead->field_defs[$colsSecondField]['name'], $bool_fields)){
405
-              array_push($bool_fields,$lead->field_defs[$colsSecondField]['name']);
406
-             }
407
-         }
408
-         if($field1_type=='date') {
409
-	        global $timedate;
410
-			$cal_dateformat = $timedate->get_cal_date_format();
411
-	        $LBL_ENTER_DATE = translate('LBL_ENTER_DATE', 'Charts');
412
-          if($field1_required){
405
+                array_push($bool_fields,$lead->field_defs[$colsSecondField]['name']);
406
+                }
407
+            }
408
+            if($field1_type=='date') {
409
+            global $timedate;
410
+            $cal_dateformat = $timedate->get_cal_date_format();
411
+            $LBL_ENTER_DATE = translate('LBL_ENTER_DATE', 'Charts');
412
+            if($field1_required){
413 413
                 $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field1_label</span sugar='slot'><span class='required' style='color: rgb(255, 0, 0);'>$web_required_symbol</span></td>";
414
-          }
415
-          else{
414
+            }
415
+            else{
416 416
                 $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field1_label</span sugar='slot'></td>";
417
-          }
418
-			$Web_To_Lead_Form_html .= " 
417
+            }
418
+            $Web_To_Lead_Form_html .= " 
419 419
 				<td width='35%' style='font-size: 12px; font-weight: normal;'>
420 420
 				<script type='text/javascript'>
421 421
 					update{$field1_name}Value = function() {
@@ -430,64 +430,64 @@  discard block
 block discarded – undo
430 430
 					}
431 431
 				</script>
432 432
 				<span sugar='slot'><input type='hidden' id='{$field1_name}' name='{$field1_name}'/>";
433
-          	$order = explode("%", $cal_dateformat);
434
-          	foreach($order as $part)
435
-          	{
436
-          		if (!isset($part[0]))
437
-          			continue;
438
-          		if (strToUpper($part[0]) == "M" )
439
-          			$Web_To_Lead_Form_html .= translate("LBL_MONTH") . ":<input class=\"text\"
433
+                $order = explode("%", $cal_dateformat);
434
+                foreach($order as $part)
435
+                {
436
+                    if (!isset($part[0]))
437
+                        continue;
438
+                    if (strToUpper($part[0]) == "M" )
439
+                        $Web_To_Lead_Form_html .= translate("LBL_MONTH") . ":<input class=\"text\"
440 440
 					name=\"{$field1_name}_month\" size='2' maxlength='2' id='{$field1_name}_month' value='' 
441 441
 					onblur=\"update{$field1_name}Value()\">";
442
-				else if (strToUpper($part[0]) == "D" ) 
443
-					$Web_To_Lead_Form_html .=  translate("LBL_DAY") . ":<input class=\"text\"
442
+                else if (strToUpper($part[0]) == "D" ) 
443
+                    $Web_To_Lead_Form_html .=  translate("LBL_DAY") . ":<input class=\"text\"
444 444
 					name=\"{$field1_name}_day\" size='2' maxlength='2' id='{$field1_name}_day' value='' 
445 445
 					onblur=\"update{$field1_name}Value()\">";
446
-				else if (strToUpper($part[0]) == "Y" ) 
447
-					$Web_To_Lead_Form_html .= translate("LBL_YEAR") . ":<input class=\"text\"
446
+                else if (strToUpper($part[0]) == "Y" ) 
447
+                    $Web_To_Lead_Form_html .= translate("LBL_YEAR") . ":<input class=\"text\"
448 448
 					name=\"{$field1_name}_year\" size='4' maxlength='4' id='{$field1_name}_year' value='' 
449 449
 					onblur=\"update{$field1_name}Value()\">";
450
-          	}
451
-          	$Web_To_Lead_Form_html .= "</span></td>";
452
-         } // if
453
-         if( $field1_type=='varchar' ||  $field1_type=='name'
450
+                }
451
+                $Web_To_Lead_Form_html .= "</span></td>";
452
+            } // if
453
+            if( $field1_type=='varchar' ||  $field1_type=='name'
454 454
           ||  $field1_type=='phone' || $field1_type=='currency' || $field1_type=='url' || $field1_type=='int'){
455 455
             if($field1_name=='last_name' ||  $field1_required){
456 456
                 $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field1_label</span sugar='slot'><span class='required' style='color: rgb(255, 0, 0);'>$web_required_symbol</span></td>";
457
-              }
457
+                }
458 458
             else{
459 459
                 $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field1_label</span sugar='slot'></td>";
460
-             }
461
-             if ( $field1_name=='email1'||$field1_name=='email2' ){
462
-                 $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'><input id=$field1_name name=$field1_name type='text' onchange='validateEmailAdd();'></span sugar='slot'></td>";
463
-             } else {
460
+                }
461
+                if ( $field1_name=='email1'||$field1_name=='email2' ){
462
+                    $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'><input id=$field1_name name=$field1_name type='text' onchange='validateEmailAdd();'></span sugar='slot'></td>";
463
+                } else {
464
+                $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'><input id=$field1_name name=$field1_name type='text'></span sugar='slot'></td>";
465
+                }
466
+
467
+            }
468
+            if ( $field1_type == 'text' ) {
469
+                $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field1_label</span sugar='slot'></td>";
470
+                $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span id='ta_replace' sugar='slot'><input id=$field1_name name=$field1_name type='text'></span sugar='slot'></td>";
471
+            }
472
+            if($field1_type=='relate' &&  $field1_name=='account_name'){
473
+                $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field1_label</span sugar='slot'></td>";
464 474
                 $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'><input id=$field1_name name=$field1_name type='text'></span sugar='slot'></td>";
465
-             }
466
-
467
-           }
468
-           if ( $field1_type == 'text' ) {
469
-               $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field1_label</span sugar='slot'></td>";
470
-				$Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span id='ta_replace' sugar='slot'><input id=$field1_name name=$field1_name type='text'></span sugar='slot'></td>";
471
-           }
472
-           if($field1_type=='relate' &&  $field1_name=='account_name'){
473
-	            $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field1_label</span sugar='slot'></td>";
474
-	            $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'><input id=$field1_name name=$field1_name type='text'></span sugar='slot'></td>";
475
-           }
476
-           if($field1_type=='email'){
477
-           	if($field1_required){
475
+            }
476
+            if($field1_type=='email'){
477
+                if($field1_required){
478 478
                 $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field1_label</span sugar='slot'><span class='required' style='color: rgb(255, 0, 0);'>$web_required_symbol</span></td>";
479
-              }
479
+                }
480 480
             else{
481 481
                 $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>$field1_label</span sugar='slot'></td>";
482
-             }
482
+                }
483 483
             $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'><input id=$field1_name name=$field1_name type='text' onchange='validateEmailAdd();'></span sugar='slot'></td>";
484
-           }
485
-      }
486
-      else{
484
+            }
485
+        }
486
+        else{
487 487
             $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>&nbsp</span sugar='slot'></td>";
488 488
             $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'>&nbsp</span sugar='slot'></td>";
489
-       }
490
-       $Web_To_Lead_Form_html .= "</tr>";
489
+        }
490
+        $Web_To_Lead_Form_html .= "</tr>";
491 491
 }
492 492
 
493 493
 $Web_To_Lead_Form_html .= "<tr align='center' style='color: rgb(0, 105, 225); font-family: Arial,Verdana,Helvetica,sans-serif; font-size: 18px; font-weight: bold; margin-bottom: 0px; margin-top: 0px;'><TD COLSPAN='4'>&nbsp</TD></tr>";
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
 $Web_To_Lead_Form_html .= "<tr align='center'><td colspan='10'><input type='button' onclick='submit_form();' class='button' name='Submit' value='$web_form_submit_label'/></td></tr>";
501 501
 
502 502
 if(!empty($web_form_campaign)){
503
-   $Web_To_Lead_Form_html .= "<tr><td style='display: none'><input type='hidden' id='campaign_id' name='campaign_id' value='$web_form_campaign'></td></tr>";
503
+    $Web_To_Lead_Form_html .= "<tr><td style='display: none'><input type='hidden' id='campaign_id' name='campaign_id' value='$web_form_campaign'></td></tr>";
504 504
 }
505 505
 if(!empty($web_redirect_url)){
506 506
     $Web_To_Lead_Form_html .= "<tr><td style='display: none'><input type='hidden' id='redirect_url' name='redirect_url' value='$web_redirect_url'></td></tr>";
Please login to merge, or discard this patch.
modules/Campaigns/WizardEmailSetupSave.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 //perform this if the option to create new mail box has been checked
86 86
 if(isset($_REQUEST['wiz_new_mbox']) && ($_REQUEST['wiz_new_mbox']=='1')){
87 87
     
88
-   //Populate the Request variables that inboundemail expects
88
+    //Populate the Request variables that inboundemail expects
89 89
     $_REQUEST['mark_read'] = 1;
90 90
     $_REQUEST['only_since'] = 1;
91 91
     $_REQUEST['mailbox_type'] = 'bounce';
@@ -114,18 +114,18 @@  discard block
 block discarded – undo
114 114
 function clean_up_post($prefix){
115 115
 
116 116
     foreach ($_REQUEST as $key => $val) {
117
-              if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){
118
-              $newkey  =substr($key, strlen($prefix)) ;
119
-              $_REQUEST[$newkey] = $val;
120
-         }               
117
+                if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){
118
+                $newkey  =substr($key, strlen($prefix)) ;
119
+                $_REQUEST[$newkey] = $val;
120
+            }               
121 121
     }
122 122
 
123 123
     foreach ($_POST as $key => $val) {
124
-              if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){
125
-              $newkey  =substr($key, strlen($prefix)) ;
126
-              $_POST[$newkey] = $val;
124
+                if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){
125
+                $newkey  =substr($key, strlen($prefix)) ;
126
+                $_POST[$newkey] = $val;
127 127
               
128
-         }               
128
+            }               
129 129
     }
130 130
 }
131 131
 
Please login to merge, or discard this patch.
modules/Campaigns/WizardNewsletterSave.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     $campaign_focus = populateFromPost('', $campaign_focus);
62 62
 
63 63
     foreach($camp_steps as $step){
64
-       $campaign_focus =  populate_wizard_bean_from_request($campaign_focus,$step);
64
+        $campaign_focus =  populate_wizard_bean_from_request($campaign_focus,$step);
65 65
     }
66 66
 
67 67
     //save here so we can link relationships
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 //require_once('modules/Campaigns/WizardMarketing.php');
221 221
 $header_URL = "Location: index.php?return_module=Campaigns&module=Campaigns&action=".$action."&campaign_id=".$campaign_focus->id."&return_action=WizardNewsLetter&return_id=".$campaign_focus->id;
222 222
 $GLOBALS['log']->debug("about to post header URL of: $header_URL");
223
- header($header_URL);
223
+    header($header_URL);
224 224
 
225 225
 
226 226
 
@@ -230,15 +230,15 @@  discard block
 block discarded – undo
230 230
  */
231 231
 function populate_wizard_bean_from_request($bean,$prefix){
232 232
     foreach($_REQUEST as $key=> $val){
233
-     $key = trim($key);
234
-     if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){
235
-          $field  =substr($key, strlen($prefix)) ;
236
-          if(isset($_REQUEST[$key]) && !empty($_REQUEST[$key])){
237
-              //echo "prefix is $prefix, field is $field,    key is $key,   and value is $val<br>";
238
-              $value = $_REQUEST[$key];
239
-              $bean->$field = $value;
240
-          }
241
-     }
233
+        $key = trim($key);
234
+        if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){
235
+            $field  =substr($key, strlen($prefix)) ;
236
+            if(isset($_REQUEST[$key]) && !empty($_REQUEST[$key])){
237
+                //echo "prefix is $prefix, field is $field,    key is $key,   and value is $val<br>";
238
+                $value = $_REQUEST[$key];
239
+                $bean->$field = $value;
240
+            }
241
+        }
242 242
     }
243 243
 
244 244
     return $bean;
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
         if($pl_subs->name == $_REQUEST['wiz_step3_subscription_name']){
265 265
             $pl_list[] = $pl_subs;
266 266
             $create_new = false;
267
-       }
267
+        }
268 268
 
269 269
     }
270 270
     //create new bio if one was not retrieved successfully
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
         if($pl_un_subs->name == $_REQUEST['wiz_step3_unsubscription_name']){
293 293
             $pl_list[] = $pl_un_subs;
294 294
             $create_new = false;
295
-       }
295
+        }
296 296
 
297 297
     }
298 298
     //create new bean if one was not retrieved successfully
Please login to merge, or discard this patch.
modules/Campaigns/WebToLeadCapture.php 1 patch
Indentation   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -55,16 +55,16 @@  discard block
 block discarded – undo
55 55
  * To make your changes upgrade safe create a file called leadCapture_override.php and place the changes there
56 56
  */
57 57
 $users = array(
58
-	'PUT A RANDOM KEY FROM THE WEBSITE HERE' => array('name'=>'PUT THE USER_NAME HERE', 'pass'=>'PUT THE USER_HASH FOR THE RESPECTIVE USER HERE'),
58
+    'PUT A RANDOM KEY FROM THE WEBSITE HERE' => array('name'=>'PUT THE USER_NAME HERE', 'pass'=>'PUT THE USER_HASH FOR THE RESPECTIVE USER HERE'),
59 59
 );
60 60
 
61 61
 if (isset($_POST['campaign_id']) && !empty($_POST['campaign_id'])) {
62
-	    //adding the client ip address
63
-	    $_POST['client_id_address'] = query_client_ip();
64
-		$campaign_id=$_POST['campaign_id'];
65
-		$campaign = new Campaign();
66
-		$camp_query  = "select name,id from campaigns where id='$campaign_id'";
67
-		$camp_query .= " and deleted=0";
62
+        //adding the client ip address
63
+        $_POST['client_id_address'] = query_client_ip();
64
+        $campaign_id=$_POST['campaign_id'];
65
+        $campaign = new Campaign();
66
+        $camp_query  = "select name,id from campaigns where id='$campaign_id'";
67
+        $camp_query .= " and deleted=0";
68 68
         $camp_result=$campaign->db->query($camp_query);
69 69
         $camp_data = $campaign->db->fetchByAssoc($camp_result);
70 70
         // Bug 41292 - have to select marketing_id for new lead
@@ -78,20 +78,20 @@  discard block
 block discarded – undo
78 78
         $marketing_result = $db->limitQuery($marketing_query, 0, 1, true);
79 79
         $marketing_data = $db->fetchByAssoc($marketing_result);
80 80
         // .Bug 41292
81
-		if (isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id'])) {
82
-			$current_user = new User();
83
-			$current_user->retrieve($_REQUEST['assigned_user_id']);
84
-		} 
81
+        if (isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id'])) {
82
+            $current_user = new User();
83
+            $current_user->retrieve($_REQUEST['assigned_user_id']);
84
+        } 
85 85
 
86
-	    if(isset($camp_data) && $camp_data != null ){
87
-			$leadForm = new LeadFormBase();
86
+        if(isset($camp_data) && $camp_data != null ){
87
+            $leadForm = new LeadFormBase();
88 88
             $lead = new Lead();
89
-			$prefix = '';
90
-			if(!empty($_POST['prefix'])){
91
-				$prefix = $_POST['prefix'];
92
-			}
89
+            $prefix = '';
90
+            if(!empty($_POST['prefix'])){
91
+                $prefix = $_POST['prefix'];
92
+            }
93 93
 
94
-			if(empty($lead->id)) {
94
+            if(empty($lead->id)) {
95 95
                 $lead->id = create_guid();
96 96
                 $lead->new_with_id = true;
97 97
             }
@@ -114,47 +114,47 @@  discard block
 block discarded – undo
114 114
             // checkRequired needs a major overhaul before it works for web to lead forms.
115 115
             $lead = $leadForm->handleSave($prefix, false, false, false, $lead);
116 116
             
117
-			if(!empty($lead)){
117
+            if(!empty($lead)){
118 118
 				
119
-	            //create campaign log
120
-	            $camplog = new CampaignLog();
121
-	            $camplog->campaign_id  = $_POST['campaign_id'];
122
-	            $camplog->related_id   = $lead->id;
123
-	            $camplog->related_type = $lead->module_dir;
124
-	            $camplog->activity_type = "lead";
125
-	            $camplog->target_type = $lead->module_dir;
126
-	            $campaign_log->activity_date=$timedate->now();
127
-	            $camplog->target_id    = $lead->id;
119
+                //create campaign log
120
+                $camplog = new CampaignLog();
121
+                $camplog->campaign_id  = $_POST['campaign_id'];
122
+                $camplog->related_id   = $lead->id;
123
+                $camplog->related_type = $lead->module_dir;
124
+                $camplog->activity_type = "lead";
125
+                $camplog->target_type = $lead->module_dir;
126
+                $campaign_log->activity_date=$timedate->now();
127
+                $camplog->target_id    = $lead->id;
128 128
                 if(isset($marketing_data['id']))
129 129
                 {
130 130
                     $camplog->marketing_id = $marketing_data['id'];
131 131
                 }
132
-	            $camplog->save();
132
+                $camplog->save();
133 133
 
134
-		        //link campaignlog and lead
134
+                //link campaignlog and lead
135 135
 
136
-		        if (isset($_POST['email1']) && $_POST['email1'] != null)
136
+                if (isset($_POST['email1']) && $_POST['email1'] != null)
137 137
                 {
138 138
                     $lead->email1 = $_POST['email1'];
139
-		        } 
139
+                } 
140 140
                 //in case there are old forms used webtolead_email1
141 141
                 elseif (isset($_POST['webtolead_email1']) && $_POST['webtolead_email1'] != null)
142 142
                 {
143 143
                     $lead->email1 = $_POST['webtolead_email1'];
144 144
                 }
145 145
                 
146
-		        if (isset($_POST['email2']) && $_POST['email2'] != null)
146
+                if (isset($_POST['email2']) && $_POST['email2'] != null)
147 147
                 {
148 148
                     $lead->email2 = $_POST['email2'];
149
-		        } 
149
+                } 
150 150
                 //in case there are old forms used webtolead_email2
151 151
                 elseif (isset($_POST['webtolead_email2']) && $_POST['webtolead_email2'] != null)
152 152
                 {
153 153
                     $lead->email2 = $_POST['webtolead_email2'];
154 154
                 }
155 155
                 
156
-		        $lead->load_relationship('campaigns');
157
-		        $lead->campaigns->add($camplog->id);
156
+                $lead->load_relationship('campaigns');
157
+                $lead->campaigns->add($camplog->id);
158 158
                 if(!empty($GLOBALS['check_notify'])) {
159 159
                     $lead->save($GLOBALS['check_notify']);
160 160
                 }
@@ -176,87 +176,87 @@  discard block
 block discarded – undo
176 176
                     
177 177
                 }
178 178
             }              
179
-			if(isset($_POST['redirect_url']) && !empty($_POST['redirect_url'])){
180
-			    // Get the redirect url, and make sure the query string is not too long
181
-		        $redirect_url = $_POST['redirect_url'];
182
-		        $query_string = '';
183
-				$first_char = '&';
184
-				if(strpos($redirect_url, '?') === FALSE){
185
-					$first_char = '?';
186
-				}
187
-				$first_iteration = true;
188
-				$get_and_post = array_merge($_GET, $_POST);
189
-				foreach($get_and_post as $param => $value) {
179
+            if(isset($_POST['redirect_url']) && !empty($_POST['redirect_url'])){
180
+                // Get the redirect url, and make sure the query string is not too long
181
+                $redirect_url = $_POST['redirect_url'];
182
+                $query_string = '';
183
+                $first_char = '&';
184
+                if(strpos($redirect_url, '?') === FALSE){
185
+                    $first_char = '?';
186
+                }
187
+                $first_iteration = true;
188
+                $get_and_post = array_merge($_GET, $_POST);
189
+                foreach($get_and_post as $param => $value) {
190 190
 
191
-					if($param == 'redirect_url' && $param == 'submit')
192
-						continue;
191
+                    if($param == 'redirect_url' && $param == 'submit')
192
+                        continue;
193 193
 					
194
-					if($first_iteration){
195
-						$first_iteration = false;
196
-						$query_string .= $first_char;
197
-					}
198
-					else{
199
-						$query_string .= "&";
200
-					}
201
-					$query_string .= "{$param}=".urlencode($value);
202
-				}
203
-				if(empty($lead)) {
204
-					if($first_iteration){
205
-						$query_string .= $first_char;
206
-					}
207
-					else{
208
-						$query_string .= "&";
209
-					}
210
-					$query_string .= "error=1";
211
-				}
194
+                    if($first_iteration){
195
+                        $first_iteration = false;
196
+                        $query_string .= $first_char;
197
+                    }
198
+                    else{
199
+                        $query_string .= "&";
200
+                    }
201
+                    $query_string .= "{$param}=".urlencode($value);
202
+                }
203
+                if(empty($lead)) {
204
+                    if($first_iteration){
205
+                        $query_string .= $first_char;
206
+                    }
207
+                    else{
208
+                        $query_string .= "&";
209
+                    }
210
+                    $query_string .= "error=1";
211
+                }
212 212
 				
213
-				$redirect_url = $redirect_url.$query_string;
213
+                $redirect_url = $redirect_url.$query_string;
214 214
 
215 215
 
216
-				// Check if the headers have been sent, or if the redirect url is greater than 2083 characters (IE max URL length)
217
-				//   and use a javascript form submission if that is the case.
218
-			    if(headers_sent() || strlen($redirect_url) > 2083){
219
-    				echo '<html ' . get_language_header() . '><head><title>SugarCRM</title></head><body>';
220
-    				echo '<form name="redirect" action="' .$_POST['redirect_url']. '" method="GET">';
216
+                // Check if the headers have been sent, or if the redirect url is greater than 2083 characters (IE max URL length)
217
+                //   and use a javascript form submission if that is the case.
218
+                if(headers_sent() || strlen($redirect_url) > 2083){
219
+                    echo '<html ' . get_language_header() . '><head><title>SugarCRM</title></head><body>';
220
+                    echo '<form name="redirect" action="' .$_POST['redirect_url']. '" method="GET">';
221 221
     
222
-    				foreach($_POST as $param => $value) {
223
-    					if($param != 'redirect_url' ||$param != 'submit') {
224
-    						echo '<input type="hidden" name="'.$param.'" value="'.$value.'">';
225
-    					}
226
-    				}
227
-    				if(empty($lead)) {
228
-    					echo '<input type="hidden" name="error" value="1">';
229
-    				}
230
-    				echo '</form><script language="javascript" type="text/javascript">document.redirect.submit();</script>';
231
-    				echo '</body></html>';
232
-    			}
233
-				else{
234
-    				header("Location: {$redirect_url}");
235
-    				die();
236
-			    }
237
-			}
238
-			else{
239
-				echo $mod_strings['LBL_THANKS_FOR_SUBMITTING_LEAD'];
240
-			}
241
-			sugar_cleanup();
242
-			// die to keep code from running into redirect case below
243
-			die();
244
-	    }
245
-	   else{
246
-	  	  echo $mod_strings['LBL_SERVER_IS_CURRENTLY_UNAVAILABLE'];
247
-	  }
222
+                    foreach($_POST as $param => $value) {
223
+                        if($param != 'redirect_url' ||$param != 'submit') {
224
+                            echo '<input type="hidden" name="'.$param.'" value="'.$value.'">';
225
+                        }
226
+                    }
227
+                    if(empty($lead)) {
228
+                        echo '<input type="hidden" name="error" value="1">';
229
+                    }
230
+                    echo '</form><script language="javascript" type="text/javascript">document.redirect.submit();</script>';
231
+                    echo '</body></html>';
232
+                }
233
+                else{
234
+                    header("Location: {$redirect_url}");
235
+                    die();
236
+                }
237
+            }
238
+            else{
239
+                echo $mod_strings['LBL_THANKS_FOR_SUBMITTING_LEAD'];
240
+            }
241
+            sugar_cleanup();
242
+            // die to keep code from running into redirect case below
243
+            die();
244
+        }
245
+        else{
246
+            echo $mod_strings['LBL_SERVER_IS_CURRENTLY_UNAVAILABLE'];
247
+        }
248 248
 }
249 249
 
250 250
 if (!empty($_POST['redirect'])) {
251 251
     if(headers_sent()){
252
-    	echo '<html ' . get_language_header() . '><head><title>SugarCRM</title></head><body>';
253
-    	echo '<form name="redirect" action="' .$_POST['redirect']. '" method="GET">';
254
-    	echo '</form><script language="javascript" type="text/javascript">document.redirect.submit();</script>';
255
-    	echo '</body></html>';
252
+        echo '<html ' . get_language_header() . '><head><title>SugarCRM</title></head><body>';
253
+        echo '<form name="redirect" action="' .$_POST['redirect']. '" method="GET">';
254
+        echo '</form><script language="javascript" type="text/javascript">document.redirect.submit();</script>';
255
+        echo '</body></html>';
256 256
     }
257 257
     else{
258
-    	header("Location: {$_POST['redirect']}");
259
-    	die();
258
+        header("Location: {$_POST['redirect']}");
259
+        die();
260 260
     }
261 261
 }
262 262
 
Please login to merge, or discard this patch.
modules/Campaigns/DeleteTestCampaigns.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,8 +66,8 @@
 block discarded – undo
66 66
     $test_ids = array();
67 67
     $test_list_ids = array();
68 68
     while($row = $focus->db->fetchByAssoc($res)) {
69
-       $test_ids[] = $row['emailid'];
70
-       $test_list_ids[$row['listid']] = true;
69
+        $test_ids[] = $row['emailid'];
70
+        $test_list_ids[$row['listid']] = true;
71 71
     }
72 72
     $test_list_ids = array_keys($test_list_ids);
73 73
     unset($res);
Please login to merge, or discard this patch.