Completed
Push — master ( 58f496...a833c2 )
by Adam
18:52
created
data/Relationships/One2MRelationship.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	        	$related = $link->getBeans();
153 153
 	        	
154 154
         		// Clear the relations from many side bean
155
-	        	foreach($related as $relBean) {
155
+	        	foreach ($related as $relBean) {
156 156
 	        		$this->remove($focus, $relBean);
157 157
 	        	}
158 158
             } else { // For non self-referencing, remove all the relationships from the many (RHS) side
Please login to merge, or discard this patch.
data/Relationships/RelationshipFactory.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
     protected $relationships;
53 53
 
54
-    protected function __construct(){
54
+    protected function __construct() {
55 55
         //Load the relationship definitions from the cache.
56 56
         $this->loadRelationships();
57 57
     }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     public static function deleteCache()
76 76
     {
77 77
         $file = self::getInstance()->getCacheFile();
78
-        if(sugar_is_file($file))
78
+        if (sugar_is_file($file))
79 79
         {
80 80
             unlink($file);
81 81
         }
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         $def = $this->relationships[$relationshipName];
99 99
 
100 100
         $type = isset($def['true_relationship_type']) ? $def['true_relationship_type'] : $def['relationship_type'];
101
-        switch($type)
101
+        switch ($type)
102 102
         {
103 103
             case "many-to-many":
104 104
                 if (isset($def['rhs_module']) && $def['rhs_module'] == 'EmailAddresses')
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             case "one-to-many":
113 113
                 require_once("data/Relationships/One2MBeanRelationship.php");
114 114
                 //If a relationship has no table or join keys, it must be bean based
115
-                if (empty($def['true_relationship_type']) || (empty($def['table']) && empty($def['join_table'])) || empty($def['join_key_rhs'])){
115
+                if (empty($def['true_relationship_type']) || (empty($def['table']) && empty($def['join_table'])) || empty($def['join_key_rhs'])) {
116 116
                     return new One2MBeanRelationship($def);
117 117
                 }
118 118
                 else {
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
                 }
121 121
                 break;
122 122
             case "one-to-one":
123
-                if (empty($def['true_relationship_type'])){
123
+                if (empty($def['true_relationship_type'])) {
124 124
                     require_once("data/Relationships/One2OneBeanRelationship.php");
125 125
                     return new One2OneBeanRelationship($def);
126 126
                 }
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
                 break;
132 132
         }
133 133
 
134
-        $GLOBALS['log']->fatal ("$relationshipName had an unknown type $type ");
134
+        $GLOBALS['log']->fatal("$relationshipName had an unknown type $type ");
135 135
 
136 136
         return false;
137 137
     }
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
     protected function loadRelationships()
151 151
     {
152
-        if(sugar_is_file($this->getCacheFile()))
152
+        if (sugar_is_file($this->getCacheFile()))
153 153
         {
154 154
             include($this->getCacheFile());
155 155
             $this->relationships = $relationships;
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
         if (empty($beanList))
170 170
             include("include/modules.php");
171 171
         //Reload ALL the module vardefs....
172
-        foreach($beanList as $moduleName => $beanName)
172
+        foreach ($beanList as $moduleName => $beanName)
173 173
         {
174 174
             VardefManager::loadVardef($moduleName, BeanFactory::getObjectName($moduleName), false, array(
175 175
                 //If relationships are not yet loaded, we can't figure out the rel_calc_fields.
@@ -184,13 +184,13 @@  discard block
 block discarded – undo
184 184
         {
185 185
             if (!empty($def['relationships']))
186 186
             {
187
-                foreach($def['relationships'] as $relKey => $relDef)
187
+                foreach ($def['relationships'] as $relKey => $relDef)
188 188
                 {
189 189
                     if ($key == $relKey) //Relationship only entry, we need to capture everything
190 190
                         $relationships[$key] = array_merge(array('name' => $key), (array)$def, (array)$relDef);
191 191
                     else {
192 192
                         $relationships[$relKey] = array_merge(array('name' => $relKey), (array)$relDef);
193
-                        if(!empty($relationships[$relKey]['join_table']) && empty($relationships[$relKey]['fields'])
193
+                        if (!empty($relationships[$relKey]['join_table']) && empty($relationships[$relKey]['fields'])
194 194
                             && isset($dictionary[$relationships[$relKey]['join_table']]['fields'])) {
195 195
                             $relationships[$relKey]['fields'] = $dictionary[$relationships[$relKey]['join_table']]['fields'];
196 196
                         }
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
         }
201 201
         //Save it out
202 202
         sugar_mkdir(dirname($this->getCacheFile()), null, true);
203
-        $out = "<?php \n \$relationships = " . var_export($relationships, true) . ";";
203
+        $out = "<?php \n \$relationships = ".var_export($relationships, true).";";
204 204
         sugar_file_put_contents_atomic($this->getCacheFile(), $out);
205 205
 
206 206
         $this->relationships = $relationships;
Please login to merge, or discard this patch.
data/Relationships/EmailAddressRelationship.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
             } else {
154 154
                 $roleCheck .= " AND $table.bean_module";
155 155
             }
156
-            $roleCheck .= " = '" . $this->getLHSModule() . "'";
156
+            $roleCheck .= " = '".$this->getLHSModule()."'";
157 157
         }
158 158
 
159 159
         return $roleCheck;
Please login to merge, or discard this patch.
themes/Suite7/css/colourSelector.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // config|_override.php
4
-if(is_file('../../../config.php')) {
4
+if (is_file('../../../config.php')) {
5 5
     require_once('../../../config.php');
6 6
 }
7 7
 
8 8
 // load up the config_override.php file.  This is used to provide default user settings
9
-if(is_file('../../../config_override.php')) {
9
+if (is_file('../../../config_override.php')) {
10 10
     require_once('../../../config_override.php');
11 11
 }
12 12
 
13
-if(!isset($sugar_config['theme_settings']['Suite7'])) return;
13
+if (!isset($sugar_config['theme_settings']['Suite7'])) return;
14 14
 
15 15
 //set file type back to css from php
16 16
 header("Content-type: text/css; charset: UTF-8");
Please login to merge, or discard this patch.
soap.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
- if(!defined('sugarEntry'))define('sugarEntry', true);
2
+ if (!defined('sugarEntry'))define('sugarEntry', true);
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 $server->configureWSDL('sugarsoap', $NAMESPACE, $sugar_config['site_url'].'/soap.php');
65 65
 
66 66
 //New API is in these files
67
-if(!empty($administrator->settings['portal_on'])) {
67
+if (!empty($administrator->settings['portal_on'])) {
68 68
 	require_once('soap/SoapPortalUsers.php');
69 69
 }
70 70
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 /* Begin the HTTP listener service and exit. */
79 79
 ob_clean();
80 80
 
81
-if (!isset($HTTP_RAW_POST_DATA)){
81
+if (!isset($HTTP_RAW_POST_DATA)) {
82 82
     $HTTP_RAW_POST_DATA = file_get_contents('php://input');
83 83
 }
84 84
 
@@ -87,8 +87,8 @@  discard block
 block discarded – undo
87 87
 $resourceManager->setup('Soap');
88 88
 $observers = $resourceManager->getObservers();
89 89
 //Call set_soap_server for SoapResourceObserver instance(s)
90
-foreach($observers as $observer) {
91
-   if(method_exists($observer, 'set_soap_server')) {
90
+foreach ($observers as $observer) {
91
+   if (method_exists($observer, 'set_soap_server')) {
92 92
    	  $observer->set_soap_server($server);
93 93
    }
94 94
 }
Please login to merge, or discard this patch.
modules/Connectors/InstallDefaultConnectors.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -39,34 +39,34 @@  discard block
 block discarded – undo
39 39
  ********************************************************************************/
40 40
 
41 41
 
42
-$default_modules_sources = array (
42
+$default_modules_sources = array(
43 43
   'Accounts' =>
44
-  array (
44
+  array(
45 45
      'ext_rest_insideview' => 'ext_rest_insideview',
46 46
   ),
47 47
   'Contacts' =>
48
-  array (
48
+  array(
49 49
      'ext_rest_insideview' => 'ext_rest_insideview',
50 50
   ),
51 51
   'Leads' =>
52
-  array (
52
+  array(
53 53
      'ext_rest_insideview' => 'ext_rest_insideview',
54 54
   ),
55 55
   'Prospects' =>
56
-  array (
56
+  array(
57 57
 
58 58
   ),
59 59
   'Opportunities' =>
60
-  array (
60
+  array(
61 61
     'ext_rest_insideview' => 'ext_rest_insideview',
62 62
   ),
63 63
 );
64 64
 
65 65
 $previous_connectors = array();
66
-if(file_exists('custom/modules/Connectors/metadata/connectors.php')){
66
+if (file_exists('custom/modules/Connectors/metadata/connectors.php')) {
67 67
     require('custom/modules/Connectors/metadata/connectors.php');
68 68
 
69
-    foreach($connectors as $connector_array){
69
+    foreach ($connectors as $connector_array) {
70 70
         $connector_id = $connector_array['id'];
71 71
         $previous_connectors[$connector_id] = $connector_id;
72 72
     }
@@ -74,14 +74,14 @@  discard block
 block discarded – undo
74 74
 
75 75
 // Merge in old modules the customer added instead of overriding it completely with defaults
76 76
 // If they have customized their connectors modules
77
-if(file_exists('custom/modules/Connectors/metadata/display_config.php')){
77
+if (file_exists('custom/modules/Connectors/metadata/display_config.php')) {
78 78
     require('custom/modules/Connectors/metadata/display_config.php');
79 79
 
80 80
     // Remove the default settings from being copied over since they already existed
81
-    foreach($default_modules_sources as $module => $sources){
82
-        foreach($sources as $source_key => $source){
83
-            foreach($previous_connectors as $previous_connector){
84
-                if(in_array($previous_connector, $default_modules_sources[$module])){
81
+    foreach ($default_modules_sources as $module => $sources) {
82
+        foreach ($sources as $source_key => $source) {
83
+            foreach ($previous_connectors as $previous_connector) {
84
+                if (in_array($previous_connector, $default_modules_sources[$module])) {
85 85
                     unset($default_modules_sources[$module][$previous_connector]);
86 86
                 }
87 87
             }
@@ -89,24 +89,24 @@  discard block
 block discarded – undo
89 89
     }
90 90
 
91 91
     // Merge in the new connector default settings with the current settings
92
-    if ( isset($modules_sources) && is_array($modules_sources) ) {
93
-        foreach($modules_sources as $module => $sources){
94
-            if(!empty($default_modules_sources[$module])){
92
+    if (isset($modules_sources) && is_array($modules_sources)) {
93
+        foreach ($modules_sources as $module => $sources) {
94
+            if (!empty($default_modules_sources[$module])) {
95 95
                 $merged = array_merge($modules_sources[$module], $default_modules_sources[$module]);
96 96
                 $default_modules_sources[$module] = $merged;
97 97
             }
98
-            else{
98
+            else {
99 99
                 $default_modules_sources[$module] = $modules_sources[$module];
100 100
             }
101 101
         }
102 102
     }
103 103
 }
104 104
 
105
-if(!file_exists('custom/modules/Connectors/metadata')) {
105
+if (!file_exists('custom/modules/Connectors/metadata')) {
106 106
    mkdir_recursive('custom/modules/Connectors/metadata');
107 107
 }
108 108
 
109
-if(!write_array_to_file('modules_sources', $default_modules_sources, 'custom/modules/Connectors/metadata/display_config.php')) {
109
+if (!write_array_to_file('modules_sources', $default_modules_sources, 'custom/modules/Connectors/metadata/display_config.php')) {
110 110
    $GLOBALS['log']->fatal('Cannot write file custom/modules/Connectors/metadata/display_config.php');
111 111
 }
112 112
 
Please login to merge, or discard this patch.
modules/Connectors/action_view_map.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,16 +38,16 @@
 block discarded – undo
38 38
  ********************************************************************************/
39 39
 
40 40
 
41
-$action_view_map['retrievesource']= 'retrievesource';
42
-$action_view_map['step1']= 'step1';
43
-$action_view_map['step2']= 'step2';
41
+$action_view_map['retrievesource'] = 'retrievesource';
42
+$action_view_map['step1'] = 'step1';
43
+$action_view_map['step2'] = 'step2';
44 44
 
45 45
 //Admin main page
46 46
 $action_view_map['connectorsettings'] = 'connectorsettings';
47 47
 
48 48
 //Admin pages for the connector properties
49 49
 $action_view_map['modifyproperties'] = 'modifyproperties';
50
-$action_view_map['sourceproperties']= 'sourceproperties';
50
+$action_view_map['sourceproperties'] = 'sourceproperties';
51 51
 
52 52
 //Admin pages to enable/disable connector for modules
53 53
 $action_view_map['modifydisplay'] = 'modifydisplay';
Please login to merge, or discard this patch.
modules/Prospects/ProspectFormBase.php 1 patch
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -46,71 +46,71 @@  discard block
 block discarded – undo
46 46
  * Contributor(s): ______________________________________..
47 47
  ********************************************************************************/
48 48
 
49
-class ProspectFormBase  {
49
+class ProspectFormBase {
50 50
 
51
-function checkForDuplicates($prefix){
51
+function checkForDuplicates($prefix) {
52 52
 	global $local_log;
53 53
 	require_once('include/formbase.php');
54 54
 	
55 55
 	$focus = new Prospect();
56
-	if(!checkRequired($prefix, array_keys($focus->required_fields))){
56
+	if (!checkRequired($prefix, array_keys($focus->required_fields))) {
57 57
 		return null;
58 58
 	}
59 59
 	$query = '';
60 60
 	$baseQuery = 'select id,first_name, last_name, title, email1, email2  from prospects where deleted!=1 and (';
61
-	if(!empty($_POST[$prefix.'first_name']) && !empty($_POST[$prefix.'last_name'])){
62
-		$query = $baseQuery ."  (first_name like '". $_POST[$prefix.'first_name'] . "%' and last_name = '". $_POST[$prefix.'last_name'] ."')";
63
-	}else{
64
-			$query = $baseQuery ."  last_name = '". $_POST[$prefix.'last_name'] ."'";
61
+	if (!empty($_POST[$prefix.'first_name']) && !empty($_POST[$prefix.'last_name'])) {
62
+		$query = $baseQuery."  (first_name like '".$_POST[$prefix.'first_name']."%' and last_name = '".$_POST[$prefix.'last_name']."')";
63
+	} else {
64
+			$query = $baseQuery."  last_name = '".$_POST[$prefix.'last_name']."'";
65 65
 	}
66
-	if(!empty($_POST[$prefix.'email1'])){
67
-		if(empty($query)){
68
-		$query = $baseQuery. "  email1='". $_POST[$prefix.'email1'] . "' or email2 = '". $_POST[$prefix.'email1'] ."'";
69
-		}else {
70
-			$query .= "or email1='". $_POST[$prefix.'email1'] . "' or email2 = '". $_POST[$prefix.'email1'] ."'";
66
+	if (!empty($_POST[$prefix.'email1'])) {
67
+		if (empty($query)) {
68
+		$query = $baseQuery."  email1='".$_POST[$prefix.'email1']."' or email2 = '".$_POST[$prefix.'email1']."'";
69
+		} else {
70
+			$query .= "or email1='".$_POST[$prefix.'email1']."' or email2 = '".$_POST[$prefix.'email1']."'";
71 71
 		}
72 72
 	}
73
-	if(!empty($_POST[$prefix.'email2'])){
74
-		if(empty($query))	{
75
-			$query = $baseQuery. "  email1='". $_POST[$prefix.'email2'] . "' or email2 = '". $_POST[$prefix.'email2'] ."'";
76
-		}else{
77
-			$query .= "or email1='". $_POST[$prefix.'email2'] . "' or email2 = '". $_POST[$prefix.'email2'] ."'";
73
+	if (!empty($_POST[$prefix.'email2'])) {
74
+		if (empty($query)) {
75
+			$query = $baseQuery."  email1='".$_POST[$prefix.'email2']."' or email2 = '".$_POST[$prefix.'email2']."'";
76
+		} else {
77
+			$query .= "or email1='".$_POST[$prefix.'email2']."' or email2 = '".$_POST[$prefix.'email2']."'";
78 78
 		}
79 79
 
80 80
 	}
81 81
 
82
-	if(!empty($query)){
82
+	if (!empty($query)) {
83 83
 		$rows = array();
84 84
 		
85 85
 		$db = DBManagerFactory::getInstance();
86 86
 		$result = $db->query($query.');');
87
-        while($row = $db->fetchByAssoc($result)) {
87
+        while ($row = $db->fetchByAssoc($result)) {
88 88
             $rows[] = $row;
89 89
 		}
90
-		if(count($rows) > 0) return $rows;
90
+		if (count($rows) > 0) return $rows;
91 91
 		}
92 92
 	return null;
93 93
 }
94 94
 
95 95
 
96
-function buildTableForm($rows, $mod=''){
96
+function buildTableForm($rows, $mod = '') {
97 97
 	global $action;
98
-	if(!empty($mod)){
98
+	if (!empty($mod)) {
99 99
 	global $current_language;
100 100
 	$mod_strings = return_module_language($current_language, $mod);
101
-	}else global $mod_strings;
101
+	} else global $mod_strings;
102 102
 	global $app_strings;
103 103
 	$cols = sizeof($rows[0]) * 2 + 1;
104 104
 	if ($action != 'ShowDuplicates') 
105 105
 	{
106
-		$form = '<table width="100%"><tr><td>'.$mod_strings['MSG_DUPLICATE']. '</td></tr><tr><td height="20"></td></tr></table>';
106
+		$form = '<table width="100%"><tr><td>'.$mod_strings['MSG_DUPLICATE'].'</td></tr><tr><td height="20"></td></tr></table>';
107 107
 		$form .= "<form action='index.php' method='post' name='dupProspects'><input type='hidden' name='selectedProspect' value=''>";
108 108
 	}
109 109
 	else 
110 110
 	{
111
-		$form = '<table width="100%"><tr><td>'.$mod_strings['MSG_SHOW_DUPLICATES']. '</td></tr><tr><td height="20"></td></tr></table>';
111
+		$form = '<table width="100%"><tr><td>'.$mod_strings['MSG_SHOW_DUPLICATES'].'</td></tr><tr><td height="20"></td></tr></table>';
112 112
 	}
113
-	$form .= get_form_header($mod_strings['LBL_DUPLICATE'],"", '');
113
+	$form .= get_form_header($mod_strings['LBL_DUPLICATE'], "", '');
114 114
 	$form .= "<table width='100%' cellpadding='0' cellspacing='0'>	<tr >	";
115 115
 	if ($action != 'ShowDuplicates') 
116 116
 	{
@@ -120,16 +120,16 @@  discard block
 block discarded – undo
120 120
 	require_once('include/formbase.php');
121 121
 	$form .= getPostToForm();
122 122
 
123
-	if(isset($rows[0])){
124
-		foreach ($rows[0] as $key=>$value){
125
-			if($key != 'id'){
126
-					$form .= "<td scope='col' >". $mod_strings[$mod_strings['db_'.$key]]. "</td>";
123
+	if (isset($rows[0])) {
124
+		foreach ($rows[0] as $key=>$value) {
125
+			if ($key != 'id') {
126
+					$form .= "<td scope='col' >".$mod_strings[$mod_strings['db_'.$key]]."</td>";
127 127
 			}
128 128
 		}
129 129
 		$form .= "</tr>";
130 130
 	}
131 131
 	$rowColor = 'oddListRowS1';
132
-	foreach($rows as $row){
132
+	foreach ($rows as $row) {
133 133
 
134 134
 		$form .= "<tr class='$rowColor'>";
135 135
 		if ($action != 'ShowDuplicates') 
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
 		$wasSet = false;
139 139
 
140 140
 		foreach ($row as $key=>$value) {
141
-            if($key != 'id') {
142
-                if(!$wasSet) {
141
+            if ($key != 'id') {
142
+                if (!$wasSet) {
143 143
                     $form .= "<td scope='row' ><a target='_blank' href='index.php?module=Prospects&action=DetailView&record=${row['id']}'>$value</a></td>\n";
144 144
                     $wasSet = true;
145 145
                 }
@@ -149,9 +149,9 @@  discard block
 block discarded – undo
149 149
             }
150 150
 		}
151 151
 
152
-		if($rowColor == 'evenListRowS1'){
152
+		if ($rowColor == 'evenListRowS1') {
153 153
 			$rowColor = 'oddListRowS1';
154
-		}else{
154
+		} else {
155 155
 			 $rowColor = 'evenListRowS1';
156 156
 		}
157 157
 		$form .= "</tr>";
@@ -172,17 +172,17 @@  discard block
 block discarded – undo
172 172
 
173 173
 
174 174
 }
175
-function getWideFormBody($prefix, $mod='',$formname='',  $prospect = ''){
176
-	if(!ACLController::checkAccess('Prospects', 'edit', true)){
175
+function getWideFormBody($prefix, $mod = '', $formname = '', $prospect = '') {
176
+	if (!ACLController::checkAccess('Prospects', 'edit', true)) {
177 177
 		return '';
178 178
 	}
179 179
 	
180
-	if(empty($prospect)){
180
+	if (empty($prospect)) {
181 181
 		$prospect = new Prospect();
182 182
 	}
183 183
 	global $mod_strings;
184 184
 $temp_strings = $mod_strings;
185
-if(!empty($mod)){
185
+if (!empty($mod)) {
186 186
 	global $current_language;
187 187
 	$mod_strings = return_module_language($current_language, $mod);
188 188
 }
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 		$lbl_first_name = $mod_strings['LBL_FIRST_NAME'];
195 195
 		$lbl_last_name = $mod_strings['LBL_LAST_NAME'];
196 196
 		$lbl_phone = $mod_strings['LBL_OFFICE_PHONE'];
197
-		$lbl_address =  $mod_strings['LBL_PRIMARY_ADDRESS'];
197
+		$lbl_address = $mod_strings['LBL_PRIMARY_ADDRESS'];
198 198
 		$user_id = $current_user->id;
199 199
 		$lbl_email_address = $mod_strings['LBL_EMAIL_ADDRESS'];
200 200
 		$form = <<<EOQ
@@ -295,21 +295,21 @@  discard block
 block discarded – undo
295 295
 $javascript = new javascript();
296 296
 $javascript->setFormName($formname);
297 297
 $javascript->setSugarBean(new Prospect());
298
-$javascript->addField('email1','false',$prefix);
299
-$javascript->addField('email2','false',$prefix);
298
+$javascript->addField('email1', 'false', $prefix);
299
+$javascript->addField('email2', 'false', $prefix);
300 300
 $javascript->addRequiredFields($prefix);
301
-$form .=$javascript->getScript();
301
+$form .= $javascript->getScript();
302 302
 $mod_strings = $temp_strings;
303 303
 return $form;
304 304
 }
305 305
 
306
-function getFormBody($prefix, $mod='', $formname=''){
307
-	if(!ACLController::checkAccess('Prospects', 'edit', true)){
306
+function getFormBody($prefix, $mod = '', $formname = '') {
307
+	if (!ACLController::checkAccess('Prospects', 'edit', true)) {
308 308
 		return '';
309 309
 	}
310 310
 global $mod_strings;
311 311
 $temp_strings = $mod_strings;
312
-if(!empty($mod)){
312
+if (!empty($mod)) {
313 313
 	global $current_language;
314 314
 	$mod_strings = return_module_language($current_language, $mod);
315 315
 }
@@ -359,22 +359,22 @@  discard block
 block discarded – undo
359 359
 $javascript = new javascript();
360 360
 $javascript->setFormName($formname);
361 361
 $javascript->setSugarBean(new Prospect());
362
-$javascript->addField('email1','false',$prefix);
362
+$javascript->addField('email1', 'false', $prefix);
363 363
 $javascript->addRequiredFields($prefix);
364 364
 
365
-$form .=$javascript->getScript();
365
+$form .= $javascript->getScript();
366 366
 $mod_strings = $temp_strings;
367 367
 return $form;
368 368
 
369 369
 }
370
-function getForm($prefix, $mod=''){
371
-if(!ACLController::checkAccess('Prospects', 'edit', true)){
370
+function getForm($prefix, $mod = '') {
371
+if (!ACLController::checkAccess('Prospects', 'edit', true)) {
372 372
 		return '';
373 373
 	}
374
-if(!empty($mod)){
374
+if (!empty($mod)) {
375 375
 	global $current_language;
376 376
 	$mod_strings = return_module_language($current_language, $mod);
377
-}else global $mod_strings;
377
+} else global $mod_strings;
378 378
 global $app_strings;
379 379
 
380 380
 $lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 			<input type="hidden" name="${prefix}module" value="Prospects">
390 390
 			<input type="hidden" name="${prefix}action" value="Save">
391 391
 EOQ;
392
-$the_form .= $this->getFormBody($prefix,'Prospects', "${prefix}ProspectSave");
392
+$the_form .= $this->getFormBody($prefix, 'Prospects', "${prefix}ProspectSave");
393 393
 $the_form .= <<<EOQ
394 394
 		<input title="$lbl_save_button_title" accessKey="$lbl_save_button_key" class="button" type="submit" name="${prefix}button" value="  $lbl_save_button_label  " >
395 395
 		</form>
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 }
405 405
 
406 406
 
407
-function handleSave($prefix,$redirect=true, $useRequired=false){
407
+function handleSave($prefix, $redirect = true, $useRequired = false) {
408 408
 	global $theme;
409 409
 	
410 410
 	
@@ -416,14 +416,14 @@  discard block
 block discarded – undo
416 416
 	
417 417
 	
418 418
 	$focus = new Prospect();
419
-	if($useRequired &&  !checkRequired($prefix, array_keys($focus->required_fields))){
419
+	if ($useRequired && !checkRequired($prefix, array_keys($focus->required_fields))) {
420 420
 		return null;
421 421
 	}
422 422
 	$focus = populateFromPost($prefix, $focus);
423
-	if(!$focus->ACLAccess('Save')){
423
+	if (!$focus->ACLAccess('Save')) {
424 424
 		return null;
425 425
 	}
426
-	if (!isset($GLOBALS['check_notify'])) $GLOBALS['check_notify']=false;
426
+	if (!isset($GLOBALS['check_notify'])) $GLOBALS['check_notify'] = false;
427 427
 	
428 428
 	if (!isset($_POST[$prefix.'email_opt_out'])) $focus->email_opt_out = 0;
429 429
 	if (!isset($_POST[$prefix.'do_not_call'])) $focus->do_not_call = 0;
@@ -480,27 +480,27 @@  discard block
 block discarded – undo
480 480
 	$return_id = $focus->id;
481 481
     
482 482
 	$GLOBALS['log']->debug("Saved record with id of ".$return_id);
483
-    if(isset($_POST['popup']) && $_POST['popup'] == 'true') {
483
+    if (isset($_POST['popup']) && $_POST['popup'] == 'true') {
484 484
         $get = '&module=';
485
-        if(!empty($_POST['return_module'])) $get .= $_POST['return_module'];
485
+        if (!empty($_POST['return_module'])) $get .= $_POST['return_module'];
486 486
         else $get .= 'Prospects';
487 487
         $get .= '&action=';
488
-        if(!empty($_POST['return_action'])) $get .= $_POST['return_action'];
488
+        if (!empty($_POST['return_action'])) $get .= $_POST['return_action'];
489 489
         else $get .= 'Popup';
490
-        if(!empty($_POST['return_id'])) $get .= '&return_id='.$_POST['return_id'];
491
-        if(!empty($_POST['popup'])) $get .= '&popup='.$_POST['popup'];
492
-        if(!empty($_POST['create'])) $get .= '&create='.$_POST['create'];
493
-        if(!empty($_POST['to_pdf'])) $get .= '&to_pdf='.$_POST['to_pdf'];
494
-        $get .= '&first_name=' . $focus->first_name;
495
-        $get .= '&last_name=' . $focus->last_name;
490
+        if (!empty($_POST['return_id'])) $get .= '&return_id='.$_POST['return_id'];
491
+        if (!empty($_POST['popup'])) $get .= '&popup='.$_POST['popup'];
492
+        if (!empty($_POST['create'])) $get .= '&create='.$_POST['create'];
493
+        if (!empty($_POST['to_pdf'])) $get .= '&to_pdf='.$_POST['to_pdf'];
494
+        $get .= '&first_name='.$focus->first_name;
495
+        $get .= '&last_name='.$focus->last_name;
496 496
         $get .= '&query=true';
497 497
         header("Location: index.php?$get");
498 498
         return;
499 499
     }
500
-	if($redirect){
500
+	if ($redirect) {
501 501
 	    require_once('include/formbase.php');
502 502
 	    handleRedirect($return_id, 'Prospects');
503
-	}else{
503
+	} else {
504 504
 		return $focus;
505 505
 	}
506 506
 }
Please login to merge, or discard this patch.
modules/Prospects/metadata/additionalDetails.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -41,49 +41,49 @@  discard block
 block discarded – undo
41 41
 
42 42
 function additionalDetailsProspect($fields) {
43 43
 	static $mod_strings;
44
-	if(empty($mod_strings)) {
44
+	if (empty($mod_strings)) {
45 45
 		global $current_language;
46 46
 		$mod_strings = return_module_language($current_language, 'Prospects');
47 47
 	}
48 48
 		
49 49
 	$overlib_string = '';
50 50
 	
51
-	if(!empty($fields['ACCOUNT_NAME'])) $overlib_string .= '<b>'. $mod_strings['LBL_EDIT_ACCOUNT_NAME'] . '</b> ' . $fields['ACCOUNT_NAME'] . '<br>';
52
-	if(!empty($fields['PRIMARY_ADDRESS_STREET']) || !empty($fields['PRIMARY_ADDRESS_CITY']) ||
51
+	if (!empty($fields['ACCOUNT_NAME'])) $overlib_string .= '<b>'.$mod_strings['LBL_EDIT_ACCOUNT_NAME'].'</b> '.$fields['ACCOUNT_NAME'].'<br>';
52
+	if (!empty($fields['PRIMARY_ADDRESS_STREET']) || !empty($fields['PRIMARY_ADDRESS_CITY']) ||
53 53
 		!empty($fields['PRIMARY_ADDRESS_STATE']) || !empty($fields['PRIMARY_ADDRESS_POSTALCODE']) ||
54 54
 		!empty($fields['PRIMARY_ADDRESS_COUNTRY']))
55
-			$overlib_string .= '<b>' . $mod_strings['LBL_PRIMARY_ADDRESS'] . '</b><br>';
56
-	if(!empty($fields['PRIMARY_ADDRESS_STREET'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET'] . '<br>';
57
-	if(!empty($fields['PRIMARY_ADDRESS_STREET_2'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_2'] . '<br>';
58
-	if(!empty($fields['PRIMARY_ADDRESS_STREET_3'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_3'] . '<br>';
59
-	if(!empty($fields['PRIMARY_ADDRESS_CITY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_CITY'] . ', ';
60
-	if(!empty($fields['PRIMARY_ADDRESS_STATE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STATE'] . ' ';
61
-	if(!empty($fields['PRIMARY_ADDRESS_POSTALCODE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_POSTALCODE'] . ' ';
62
-	if(!empty($fields['PRIMARY_ADDRESS_COUNTRY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_COUNTRY'] . '<br>';
63
-	if(strlen($overlib_string) > 0 && !(strrpos($overlib_string, '<br>') == strlen($overlib_string) - 4)) 
55
+			$overlib_string .= '<b>'.$mod_strings['LBL_PRIMARY_ADDRESS'].'</b><br>';
56
+	if (!empty($fields['PRIMARY_ADDRESS_STREET'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET'].'<br>';
57
+	if (!empty($fields['PRIMARY_ADDRESS_STREET_2'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_2'].'<br>';
58
+	if (!empty($fields['PRIMARY_ADDRESS_STREET_3'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_3'].'<br>';
59
+	if (!empty($fields['PRIMARY_ADDRESS_CITY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_CITY'].', ';
60
+	if (!empty($fields['PRIMARY_ADDRESS_STATE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STATE'].' ';
61
+	if (!empty($fields['PRIMARY_ADDRESS_POSTALCODE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_POSTALCODE'].' ';
62
+	if (!empty($fields['PRIMARY_ADDRESS_COUNTRY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_COUNTRY'].'<br>';
63
+	if (strlen($overlib_string) > 0 && !(strrpos($overlib_string, '<br>') == strlen($overlib_string) - 4)) 
64 64
 		$overlib_string .= '<br>';  
65
-	if(!empty($fields['PHONE_MOBILE'])) $overlib_string .= '<b>'. $mod_strings['LBL_MOBILE_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_MOBILE'] . '</span><br>';
66
-	if(!empty($fields['PHONE_HOME'])) $overlib_string .= '<b>'. $mod_strings['LBL_HOME_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_HOME'] . '</span><br>';
67
-	if(!empty($fields['PHONE_OTHER'])) $overlib_string .= '<b>'. $mod_strings['LBL_OTHER_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_OTHER'] . '</span><br>';
65
+	if (!empty($fields['PHONE_MOBILE'])) $overlib_string .= '<b>'.$mod_strings['LBL_MOBILE_PHONE'].'</b> <span class="phone">'.$fields['PHONE_MOBILE'].'</span><br>';
66
+	if (!empty($fields['PHONE_HOME'])) $overlib_string .= '<b>'.$mod_strings['LBL_HOME_PHONE'].'</b> <span class="phone">'.$fields['PHONE_HOME'].'</span><br>';
67
+	if (!empty($fields['PHONE_OTHER'])) $overlib_string .= '<b>'.$mod_strings['LBL_OTHER_PHONE'].'</b> <span class="phone">'.$fields['PHONE_OTHER'].'</span><br>';
68 68
 
69
-	if(!empty($fields['EMAIL1'])) 
70
-		$overlib_string .= '<b>'. $mod_strings['LBL_EMAIL_ADDRESS'] . '</b> ' . 
71
-								 "<a href=index.php?module=Emails&action=Compose&contact_id={$fields['ID']}&" .
72
-								 "parent_type=Contacts&parent_id={$fields['ID']}&to_addrs_ids={$fields['ID']}&to_addrs_names" .
73
-								 "={$fields['FIRST_NAME']}&nbsp;{$fields['LAST_NAME']}&to_addrs_emails={$fields['EMAIL1']}&" .
74
-								 "to_email_addrs=" . urlencode("{$fields['FIRST_NAME']} {$fields['LAST_NAME']} <{$fields['EMAIL1']}>") .
69
+	if (!empty($fields['EMAIL1'])) 
70
+		$overlib_string .= '<b>'.$mod_strings['LBL_EMAIL_ADDRESS'].'</b> '. 
71
+								 "<a href=index.php?module=Emails&action=Compose&contact_id={$fields['ID']}&".
72
+								 "parent_type=Contacts&parent_id={$fields['ID']}&to_addrs_ids={$fields['ID']}&to_addrs_names".
73
+								 "={$fields['FIRST_NAME']}&nbsp;{$fields['LAST_NAME']}&to_addrs_emails={$fields['EMAIL1']}&".
74
+								 "to_email_addrs=".urlencode("{$fields['FIRST_NAME']} {$fields['LAST_NAME']} <{$fields['EMAIL1']}>").
75 75
 								 "&return_module=Contacts&return_action=ListView'>{$fields['EMAIL1']}</a><br>";
76
-	if(!empty($fields['EMAIL2'])) 
77
-		$overlib_string .= '<b>'. $mod_strings['LBL_OTHER_EMAIL_ADDRESS'] . '</b> ' . 
78
-								 "<a href=index.php?module=Emails&action=Compose&contact_id={$fields['ID']}&" .
79
-								 "parent_type=Contacts&parent_id={$fields['ID']}&to_addrs_ids={$fields['ID']}&to_addrs_names" .
80
-								 "={$fields['FIRST_NAME']}&nbsp;{$fields['LAST_NAME']}&to_addrs_emails={$fields['EMAIL2']}&" .
81
-								 "to_email_addrs=" . urlencode("{$fields['FIRST_NAME']} {$fields['LAST_NAME']} <{$fields['EMAIL2']}>") .
76
+	if (!empty($fields['EMAIL2'])) 
77
+		$overlib_string .= '<b>'.$mod_strings['LBL_OTHER_EMAIL_ADDRESS'].'</b> '. 
78
+								 "<a href=index.php?module=Emails&action=Compose&contact_id={$fields['ID']}&".
79
+								 "parent_type=Contacts&parent_id={$fields['ID']}&to_addrs_ids={$fields['ID']}&to_addrs_names".
80
+								 "={$fields['FIRST_NAME']}&nbsp;{$fields['LAST_NAME']}&to_addrs_emails={$fields['EMAIL2']}&".
81
+								 "to_email_addrs=".urlencode("{$fields['FIRST_NAME']} {$fields['LAST_NAME']} <{$fields['EMAIL2']}>").
82 82
 								 "&return_module=Contacts&return_action=ListView'>{$fields['EMAIL2']}</a><br>";
83 83
 	
84
-	if(!empty($fields['DESCRIPTION'])) { 
85
-		$overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
86
-		if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...';
84
+	if (!empty($fields['DESCRIPTION'])) { 
85
+		$overlib_string .= '<b>'.$mod_strings['LBL_DESCRIPTION'].'</b> '.substr($fields['DESCRIPTION'], 0, 300);
86
+		if (strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...';
87 87
 	}	
88 88
 	
89 89
 	return array('fieldToAddTo' => 'FULL_NAME', 
Please login to merge, or discard this patch.