Completed
Push — console-installer ( e2b50d...6ce748 )
by Adam
22:30
created
modules/Import/maps/ImportMapOther.php 4 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
 
48 48
 class ImportMapOther
49 49
 {
50
-	/**
50
+    /**
51 51
      * String identifier for this import
52 52
      */
53 53
     public $name = 'other';
54
-	/**
54
+    /**
55 55
      * Field delimiter
56 56
      */
57 57
     public $delimiter;
@@ -59,18 +59,18 @@  discard block
 block discarded – undo
59 59
      * Field enclosure
60 60
      */
61 61
     public $enclosure;
62
-	/**
62
+    /**
63 63
      * Do we have a header?
64 64
      */
65 65
     public $has_header = true;
66 66
 
67
-	/**
67
+    /**
68 68
      * Gets the default mapping for a module
69 69
      *
70 70
      * @param  string $module
71 71
      * @return array field mappings
72 72
      */
73
-	public function getMapping(
73
+    public function getMapping(
74 74
         $module
75 75
         )
76 76
     {
@@ -142,18 +142,18 @@  discard block
 block discarded – undo
142 142
         }
143 143
     }
144 144
 	
145
-	/**
145
+    /**
146 146
      * Returns a list of fields that should be ignorred for the module during import
147 147
      *
148 148
      * @param  string $module
149 149
      * @return array of fields to ignor
150 150
      */
151
-	public function getIgnoredFields(
152
-		$module
153
-		)
154
-	{
155
-		return array();
156
-	}
151
+    public function getIgnoredFields(
152
+        $module
153
+        )
154
+    {
155
+        return array();
156
+    }
157 157
 }
158 158
 
159 159
 
Please login to merge, or discard this patch.
Switch Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -75,70 +75,70 @@
 block discarded – undo
75 75
         )
76 76
     {
77 77
         switch ($module) {
78
-        case 'Contacts':
79
-        case 'Leads':
80
-            return array(
81
-                "Salutation"=>"salutation",
82
-                "Full Name"=>"full_name",
83
-                "Company"=>"company",
84
-                "First Name"=>"first_name",
85
-                "Last Name"=>"last_name",
86
-                "Title"=>"title",
87
-                "Department"=>"department",
88
-                "Birthday"=>"birthdate",
89
-                "Home Phone"=>"phone_home",
90
-                "Mobile Phone"=>"phone_mobile",
91
-                "Business Phone"=>"phone_work",
92
-                "Other Phone"=>"phone_other",
93
-                "Business Fax"=>"phone_fax",
94
-                "E-mail Address"=>"email1",
95
-                "E-mail 2"=>"email2",
96
-                "Assistant's Name"=>"assistant",
97
-                "Assistant's Phone"=>"assistant_phone",
98
-                "Business Street"=>"primary_address_street",
99
-                "Business Street 2"=>"primary_address_street_2",
100
-                "Business Street 3"=>"primary_address_street_3",
101
-                "Business City"=>"primary_address_city",
102
-                "Business State"=>"primary_address_state",
103
-                "Business Postal Code"=>"primary_address_postalcode",
104
-                "Business Country/Region"=>"primary_address_country",
105
-                "Home Street"=>"alt_address_street",
106
-                "Home Street 2"=>"alt_address_street_2",
107
-                "Home Street 3"=>"alt_address_street_3",
108
-                "Home City"=>"alt_address_city",
109
-                "Home State"=>"alt_address_state",
110
-                "Home Postal Code"=>"alt_address_postalcode",
111
-                "Home Country/Region"=>"alt_address_country",
112
-                );
113
-            break;
114
-        case 'Accounts':
115
-            return array(
116
-                "Company"=>"name",
117
-                "Business Street"=>"billing_address_street",
118
-                "Business City"=>"billing_address_city",
119
-                "Business State"=>"billing_address_state",
120
-                "Business Country"=>"billing_address_country",
121
-                "Business Postal Code"=>"billing_address_postalcode",
122
-                "Business Fax"=>"phone_fax",
123
-                "Company Main Phone"=>"phone_office",
124
-                "Web Page"=>"website",
125
-                );
126
-            break;
127
-        case 'Opportunities':
128
-            return array(
129
-                "Opportunity Name"=>"name" ,
130
-                "Type"=>"opportunity_type",
131
-                "Lead Source"=>"lead_source",
132
-                "Amount"=>"amount",
133
-                "Created Date"=>"date_entered",
134
-                "Close Date"=>"date_closed",
135
-                "Next Step"=>"next_step",
136
-                "Stage"=>"sales_stage",
137
-                "Probability (%)"=>"probability",
138
-                "Account Name"=>"account_name");
139
-            break;
140
-        default:
141
-            return array();
78
+            case 'Contacts':
79
+            case 'Leads':
80
+                return array(
81
+                    "Salutation"=>"salutation",
82
+                    "Full Name"=>"full_name",
83
+                    "Company"=>"company",
84
+                    "First Name"=>"first_name",
85
+                    "Last Name"=>"last_name",
86
+                    "Title"=>"title",
87
+                    "Department"=>"department",
88
+                    "Birthday"=>"birthdate",
89
+                    "Home Phone"=>"phone_home",
90
+                    "Mobile Phone"=>"phone_mobile",
91
+                    "Business Phone"=>"phone_work",
92
+                    "Other Phone"=>"phone_other",
93
+                    "Business Fax"=>"phone_fax",
94
+                    "E-mail Address"=>"email1",
95
+                    "E-mail 2"=>"email2",
96
+                    "Assistant's Name"=>"assistant",
97
+                    "Assistant's Phone"=>"assistant_phone",
98
+                    "Business Street"=>"primary_address_street",
99
+                    "Business Street 2"=>"primary_address_street_2",
100
+                    "Business Street 3"=>"primary_address_street_3",
101
+                    "Business City"=>"primary_address_city",
102
+                    "Business State"=>"primary_address_state",
103
+                    "Business Postal Code"=>"primary_address_postalcode",
104
+                    "Business Country/Region"=>"primary_address_country",
105
+                    "Home Street"=>"alt_address_street",
106
+                    "Home Street 2"=>"alt_address_street_2",
107
+                    "Home Street 3"=>"alt_address_street_3",
108
+                    "Home City"=>"alt_address_city",
109
+                    "Home State"=>"alt_address_state",
110
+                    "Home Postal Code"=>"alt_address_postalcode",
111
+                    "Home Country/Region"=>"alt_address_country",
112
+                    );
113
+                break;
114
+            case 'Accounts':
115
+                return array(
116
+                    "Company"=>"name",
117
+                    "Business Street"=>"billing_address_street",
118
+                    "Business City"=>"billing_address_city",
119
+                    "Business State"=>"billing_address_state",
120
+                    "Business Country"=>"billing_address_country",
121
+                    "Business Postal Code"=>"billing_address_postalcode",
122
+                    "Business Fax"=>"phone_fax",
123
+                    "Company Main Phone"=>"phone_office",
124
+                    "Web Page"=>"website",
125
+                    );
126
+                break;
127
+            case 'Opportunities':
128
+                return array(
129
+                    "Opportunity Name"=>"name" ,
130
+                    "Type"=>"opportunity_type",
131
+                    "Lead Source"=>"lead_source",
132
+                    "Amount"=>"amount",
133
+                    "Created Date"=>"date_entered",
134
+                    "Close Date"=>"date_closed",
135
+                    "Next Step"=>"next_step",
136
+                    "Stage"=>"sales_stage",
137
+                    "Probability (%)"=>"probability",
138
+                    "Account Name"=>"account_name");
139
+                break;
140
+            default:
141
+                return array();
142 142
         }
143 143
     }
144 144
 	
Please login to merge, or discard this 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.
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
             break;
127 127
         case 'Opportunities':
128 128
             return array(
129
-                "Opportunity Name"=>"name" ,
129
+                "Opportunity Name"=>"name",
130 130
                 "Type"=>"opportunity_type",
131 131
                 "Lead Source"=>"lead_source",
132 132
                 "Amount"=>"amount",
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
Please login to merge, or discard this patch.
modules/Import/maps/ImportMap.php 3 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -175,19 +175,19 @@  discard block
 block discarded – undo
175 175
      * @see SugarBean::retrieve()
176 176
      */
177 177
     public function retrieve($id = -1, $encode=true,$deleted=true)
178
-	{
179
-	    $returnVal = parent::retrieve($id,$encode,$deleted);
178
+    {
179
+        $returnVal = parent::retrieve($id,$encode,$deleted);
180 180
 
181
-	    if ( !($returnVal instanceOf $this) ) {
182
-	        return $returnVal;
183
-	    }
181
+        if ( !($returnVal instanceOf $this) ) {
182
+            return $returnVal;
183
+        }
184 184
 
185
-	    if ( $this->source == 'tab' && $this->delimiter == '' ) {
186
-	        $this->delimiter = "\t";
187
-	    }
185
+        if ( $this->source == 'tab' && $this->delimiter == '' ) {
186
+            $this->delimiter = "\t";
187
+        }
188 188
 
189
-	    return $this;
190
-	}
189
+        return $this;
190
+    }
191 191
 
192 192
     /**
193 193
      * Save
@@ -372,10 +372,10 @@  discard block
 block discarded – undo
372 372
         //list of field values we track during import wizard
373 373
         $import_step_fields = array(
374 374
         //step1
375
-          //  'import_module', 'source', 'custom_enclosure', 'custom_enclosure_other', 'custom_delimiter', 'type',
375
+            //  'import_module', 'source', 'custom_enclosure', 'custom_enclosure_other', 'custom_delimiter', 'type',
376 376
         //step2
377
-           // 'custom_delimiter', 'custom_enclosure', 'type', 'source', 'source_id', 'import_module', 'has_header',
378
-         //step3
377
+            // 'custom_delimiter', 'custom_enclosure', 'type', 'source', 'source_id', 'import_module', 'has_header',
378
+            //step3
379 379
             'display_tabs_def','custom_delimiter', 'custom_enclosure', 'import_type', 'source', 'source_id', 'import_module', 'has_header', 'importlocale_charset',
380 380
             'importlocale_dateformat', 'importlocale_timeformat', 'importlocale_timezone', 'importlocale_currency',
381 381
             'importlocale_default_currency_significant_digits', 'importlocale_num_grp_sep', 'importlocale_dec_sep',
Please login to merge, or discard this patch.
Spacing   +38 added lines, -38 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.
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
     public function getMapping()
108 108
     {
109 109
         $mapping_arr = array();
110
-        if ( !empty($this->content) )
110
+        if (!empty($this->content))
111 111
         {
112
-            $pairs = explode("&",$this->content);
113
-            foreach ($pairs as $pair){
114
-                list($name,$value) = explode("=",$pair);
112
+            $pairs = explode("&", $this->content);
113
+            foreach ($pairs as $pair) {
114
+                list($name, $value) = explode("=", $pair);
115 115
                 $mapping_arr[trim($name)] = $value;
116 116
             }
117 117
         }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         $mapping_arr
129 129
         )
130 130
     {
131
-        $output = array ();
131
+        $output = array();
132 132
         foreach ($mapping_arr as $key => $item) {
133 133
             $output[] = "$key=$item";
134 134
         }
@@ -143,11 +143,11 @@  discard block
 block discarded – undo
143 143
     public function getDefaultValues()
144 144
     {
145 145
         $defa_arr = array();
146
-        if ( !empty($this->default_values) )
146
+        if (!empty($this->default_values))
147 147
         {
148
-            $pairs = explode("&",$this->default_values);
149
-            foreach ($pairs as $pair){
150
-                list($name,$value) = explode("=",$pair);
148
+            $pairs = explode("&", $this->default_values);
149
+            foreach ($pairs as $pair) {
150
+                list($name, $value) = explode("=", $pair);
151 151
                 $defa_arr[trim($name)] = $value;
152 152
             }
153 153
         }
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
         $defa_arr
165 165
         )
166 166
     {
167
-        $output = array ();
167
+        $output = array();
168 168
         foreach ($defa_arr as $key => $item) {
169 169
             $output[] = "$key=$item";
170 170
         }
@@ -174,15 +174,15 @@  discard block
 block discarded – undo
174 174
     /**
175 175
      * @see SugarBean::retrieve()
176 176
      */
177
-    public function retrieve($id = -1, $encode=true,$deleted=true)
177
+    public function retrieve($id = -1, $encode = true, $deleted = true)
178 178
 	{
179
-	    $returnVal = parent::retrieve($id,$encode,$deleted);
179
+	    $returnVal = parent::retrieve($id, $encode, $deleted);
180 180
 
181
-	    if ( !($returnVal instanceOf $this) ) {
181
+	    if (!($returnVal instanceOf $this)) {
182 182
 	        return $returnVal;
183 183
 	    }
184 184
 
185
-	    if ( $this->source == 'tab' && $this->delimiter == '' ) {
185
+	    if ($this->source == 'tab' && $this->delimiter == '') {
186 186
 	        $this->delimiter = "\t";
187 187
 	    }
188 188
 
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 
228 228
         // Bug 23354 - Make sure enclosure gets saved as an empty string if
229 229
         // it is an empty string, instead of as a null
230
-        if ( strlen($enclosure) <= 0 ) $enclosure = ' ';
230
+        if (strlen($enclosure) <= 0) $enclosure = ' ';
231 231
 
232 232
         $this->assigned_user_id = $owner_id;
233 233
         $this->name             = $name;
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
         parent::save();
243 243
 
244 244
         // Bug 29365 - The enclosure character isn't saved correctly if it's a tab using MssqlManager, so resave it
245
-        if ( $enclosure == '\\t' && $this->db instanceOf MssqlManager ) {
245
+        if ($enclosure == '\\t' && $this->db instanceOf MssqlManager) {
246 246
             $this->enclosure = $enclosure;
247 247
             parent::save();
248 248
         }
@@ -262,11 +262,11 @@  discard block
 block discarded – undo
262 262
     {
263 263
         global $current_user;
264 264
 
265
-        if ( !is_admin($current_user) ) {
265
+        if (!is_admin($current_user)) {
266 266
             $other_map = new ImportMap();
267 267
             $other_map->retrieve_by_string_fields(array('id'=> $id), false);
268 268
 
269
-            if ( $other_map->assigned_user_id != $current_user->id )
269
+            if ($other_map->assigned_user_id != $current_user->id)
270 270
                 return false;
271 271
         }
272 272
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
     {
288 288
         global $current_user;
289 289
 
290
-        if ( !is_admin($current_user) )
290
+        if (!is_admin($current_user))
291 291
             return false;
292 292
 
293 293
         // check for problems
@@ -313,16 +313,16 @@  discard block
 block discarded – undo
313 313
         $other_map->retrieve_by_string_fields($query_arr, false);
314 314
 
315 315
         // if we find this other map, quit
316
-        if ( isset($other_map->id) )
316
+        if (isset($other_map->id))
317 317
             return false;
318 318
 
319 319
         // otherwise update the is_published flag
320 320
         $query = "UPDATE $this->table_name
321
-                    SET is_published = '". ($flag?'yes':'no') . "',
321
+                    SET is_published = '".($flag ? 'yes' : 'no')."',
322 322
                         assigned_user_id = '$user_id'
323 323
                     WHERE id = '{$this->id}'";
324 324
 
325
-        $this->db->query($query,true,"Error marking import map published: ");
325
+        $this->db->query($query, true, "Error marking import map published: ");
326 326
 
327 327
         return true;
328 328
     }
@@ -339,21 +339,21 @@  discard block
 block discarded – undo
339 339
     {
340 340
         $query = "SELECT *
341 341
                     FROM {$this->table_name}
342
-                    " . $this->get_where($fields_array);
342
+                    ".$this->get_where($fields_array);
343 343
 
344
-        $result = $this->db->query($query,true," Error: ");
344
+        $result = $this->db->query($query, true, " Error: ");
345 345
         $obj_arr = array();
346 346
 
347
-        while ($row = $this->db->fetchByAssoc($result,FALSE) ) {
347
+        while ($row = $this->db->fetchByAssoc($result, FALSE)) {
348 348
             $focus = new ImportMap();
349 349
 
350
-            foreach($this->column_fields as $field) {
351
-                if(isset($row[$field])) {
350
+            foreach ($this->column_fields as $field) {
351
+                if (isset($row[$field])) {
352 352
                     $focus->$field = $row[$field];
353 353
                 }
354 354
             }
355 355
             $focus->fill_in_additional_detail_fields();
356
-            $obj_arr[]=$focus;
356
+            $obj_arr[] = $focus;
357 357
         }
358 358
 
359 359
         return $obj_arr;
@@ -376,37 +376,37 @@  discard block
 block discarded – undo
376 376
         //step2
377 377
            // 'custom_delimiter', 'custom_enclosure', 'type', 'source', 'source_id', 'import_module', 'has_header',
378 378
          //step3
379
-            'display_tabs_def','custom_delimiter', 'custom_enclosure', 'import_type', 'source', 'source_id', 'import_module', 'has_header', 'importlocale_charset',
379
+            'display_tabs_def', 'custom_delimiter', 'custom_enclosure', 'import_type', 'source', 'source_id', 'import_module', 'has_header', 'importlocale_charset',
380 380
             'importlocale_dateformat', 'importlocale_timeformat', 'importlocale_timezone', 'importlocale_currency',
381 381
             'importlocale_default_currency_significant_digits', 'importlocale_num_grp_sep', 'importlocale_dec_sep',
382 382
         '   importlocale_default_locale_name_format');
383 383
 
384 384
         //retrieve user preferences and populate preference array
385 385
         $preference_values_str = $current_user->getPreference('field_values', 'import');
386
-        $preference_values = json_decode($preference_values_str,true);
386
+        $preference_values = json_decode($preference_values_str, true);
387 387
 
388
-        foreach ($import_step_fields as $val){
388
+        foreach ($import_step_fields as $val) {
389 389
             //overwrite preference array with new values from request if the value is different or new
390
-            if((isset($_REQUEST[$val]) && !isset($preference_values[$val])) || (isset($_REQUEST[$val]) && $preference_values[$val] != $_REQUEST[$val])){
390
+            if ((isset($_REQUEST[$val]) && !isset($preference_values[$val])) || (isset($_REQUEST[$val]) && $preference_values[$val] != $_REQUEST[$val])) {
391 391
                 $preference_values[$val] = $_REQUEST[$val];
392 392
                 $set = true;
393 393
             }
394 394
         }
395 395
 
396 396
         //force the values to passed in array if array is set
397
-        if(!empty($ForceValsArr) && is_array($ForceValsArr)){
398
-            foreach ($ForceValsArr as $forceKey=>$forceVal){
397
+        if (!empty($ForceValsArr) && is_array($ForceValsArr)) {
398
+            foreach ($ForceValsArr as $forceKey=>$forceVal) {
399 399
                 $preference_values[$forceKey] = $forceVal;
400 400
                 $set = true;
401 401
             }
402 402
         }
403 403
 
404 404
         //set preferences if any changes were made and return the new array
405
-        if($set){
406
-            $preference_values_str =  json_encode($preference_values);
405
+        if ($set) {
406
+            $preference_values_str = json_encode($preference_values);
407 407
             $current_user->setPreference('field_values', $preference_values_str, 0, 'import');
408 408
         }
409
-        if(empty($preference_values)){
409
+        if (empty($preference_values)) {
410 410
             return array();
411 411
         }
412 412
 
Please login to merge, or discard this patch.
Braces   +16 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -227,7 +229,9 @@  discard block
 block discarded – undo
227 229
 
228 230
         // Bug 23354 - Make sure enclosure gets saved as an empty string if
229 231
         // it is an empty string, instead of as a null
230
-        if ( strlen($enclosure) <= 0 ) $enclosure = ' ';
232
+        if ( strlen($enclosure) <= 0 ) {
233
+            $enclosure = ' ';
234
+        }
231 235
 
232 236
         $this->assigned_user_id = $owner_id;
233 237
         $this->name             = $name;
@@ -266,8 +270,9 @@  discard block
 block discarded – undo
266 270
             $other_map = new ImportMap();
267 271
             $other_map->retrieve_by_string_fields(array('id'=> $id), false);
268 272
 
269
-            if ( $other_map->assigned_user_id != $current_user->id )
270
-                return false;
273
+            if ( $other_map->assigned_user_id != $current_user->id ) {
274
+                            return false;
275
+            }
271 276
         }
272 277
 
273 278
         return parent::mark_deleted($id);
@@ -287,8 +292,9 @@  discard block
 block discarded – undo
287 292
     {
288 293
         global $current_user;
289 294
 
290
-        if ( !is_admin($current_user) )
291
-            return false;
295
+        if ( !is_admin($current_user) ) {
296
+                    return false;
297
+        }
292 298
 
293 299
         // check for problems
294 300
         if ($flag) {
@@ -299,8 +305,7 @@  discard block
 block discarded – undo
299 305
                 'name'         =>$this->name,
300 306
                 'is_published' =>'yes'
301 307
                 );
302
-        }
303
-        else {
308
+        } else {
304 309
             // if you are trying to unpublish a map
305 310
             // but you own an unpublished map by the same name
306 311
             $query_arr = array(
@@ -313,8 +318,9 @@  discard block
 block discarded – undo
313 318
         $other_map->retrieve_by_string_fields($query_arr, false);
314 319
 
315 320
         // if we find this other map, quit
316
-        if ( isset($other_map->id) )
317
-            return false;
321
+        if ( isset($other_map->id) ) {
322
+                    return false;
323
+        }
318 324
 
319 325
         // otherwise update the is_published flag
320 326
         $query = "UPDATE $this->table_name
Please login to merge, or discard this patch.
modules/Import/ImportDuplicateCheck.php 2 patches
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 
4 4
 /*********************************************************************************
5 5
  * SugarCRM Community Edition is a customer relationship management program developed by
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     /*
57 57
      * holds current field when a duplicate has been found
58 58
      */
59
-    public $_dupedFields =array();
59
+    public $_dupedFields = array();
60 60
 
61 61
     /**
62 62
      * Constructor
@@ -78,18 +78,18 @@  discard block
 block discarded – undo
78 78
         $indexes = $this->_focus->getIndices();
79 79
 
80 80
         //grab any custom indexes if they exist
81
-        if($this->_focus->hasCustomFields()){
81
+        if ($this->_focus->hasCustomFields()) {
82 82
             $custmIndexes = $this->_focus->db->helper->get_indices($this->_focus->table_name.'_cstm');
83
-            $indexes = array_merge($custmIndexes,$indexes);
83
+            $indexes = array_merge($custmIndexes, $indexes);
84 84
         }
85 85
 
86
-        if ( $this->_focus->getFieldDefinition('email1') )
86
+        if ($this->_focus->getFieldDefinition('email1'))
87 87
             $indexes[] = array(
88 88
                 'name' => 'special_idx_email1',
89 89
                 'type' => 'index',
90 90
                 'fields' => array('email1')
91 91
                 );
92
-        if ( $this->_focus->getFieldDefinition('email2') )
92
+        if ($this->_focus->getFieldDefinition('email2'))
93 93
             $indexes[] = array(
94 94
                 'name' => 'special_idx_email2',
95 95
                 'type' => 'index',
@@ -112,18 +112,18 @@  discard block
 block discarded – undo
112 112
             );
113 113
 
114 114
         $index_array = array();
115
-        foreach ($this->_getIndexVardefs() as $index){
116
-            if ($index['type'] == "index"){
115
+        foreach ($this->_getIndexVardefs() as $index) {
116
+            if ($index['type'] == "index") {
117 117
                 $labelsArray = array();
118
-                foreach ($index['fields'] as $field){
118
+                foreach ($index['fields'] as $field) {
119 119
                     if ($field == 'deleted') continue;
120 120
                     $fieldDef = $this->_focus->getFieldDefinition($field);
121
-                    if ( isset($fieldDef['vname']) && isset($super_language_pack[$fieldDef['vname']]) )
121
+                    if (isset($fieldDef['vname']) && isset($super_language_pack[$fieldDef['vname']]))
122 122
                         $labelsArray[$fieldDef['name']] = $super_language_pack[$fieldDef['vname']];
123 123
                     else
124 124
                         $labelsArray[$fieldDef['name']] = $fieldDef['name'];
125 125
                 }
126
-                $index_array[$index['name']] = str_replace(":", "",implode(", ",$labelsArray));
126
+                $index_array[$index['name']] = str_replace(":", "", implode(", ", $labelsArray));
127 127
             }
128 128
         }
129 129
 
@@ -138,21 +138,21 @@  discard block
 block discarded – undo
138 138
      */
139 139
     public function isADuplicateRecordByFields($fieldList)
140 140
     {
141
-        foreach($fieldList as $field)
141
+        foreach ($fieldList as $field)
142 142
         {
143
-            if ( $field == 'email1' || $field == 'email2' )
143
+            if ($field == 'email1' || $field == 'email2')
144 144
             {
145 145
                 $emailAddress = new SugarEmailAddress();
146 146
                 $email = $field;
147
-                if ( $emailAddress->getCountEmailAddressByBean($this->_focus->$email,$this->_focus,($field == 'email1')) > 0 )
147
+                if ($emailAddress->getCountEmailAddressByBean($this->_focus->$email, $this->_focus, ($field == 'email1')) > 0)
148 148
                     return true;
149 149
             }
150 150
             else
151 151
             {
152 152
                 $index_fields = array('deleted' => '0');
153
-                if( is_array($field) )
153
+                if (is_array($field))
154 154
                 {
155
-                    foreach($field as $tmpField)
155
+                    foreach ($field as $tmpField)
156 156
                     {
157 157
                         if ($tmpField == 'deleted')
158 158
                             continue;
@@ -160,16 +160,16 @@  discard block
 block discarded – undo
160 160
                             $index_fields[$tmpField] = $this->_focus->$tmpField;
161 161
                     }
162 162
                 }
163
-                elseif($field != 'deleted' && strlen($this->_focus->$field) > 0)
163
+                elseif ($field != 'deleted' && strlen($this->_focus->$field) > 0)
164 164
                     $index_fields[$field] = $this->_focus->$field;
165 165
 
166
-                if ( count($index_fields) <= 1 )
166
+                if (count($index_fields) <= 1)
167 167
                     continue;
168 168
 
169 169
                 $newfocus = loadBean($this->_focus->module_dir);
170
-                $result = $newfocus->retrieve_by_string_fields($index_fields,true);
170
+                $result = $newfocus->retrieve_by_string_fields($index_fields, true);
171 171
 
172
-                if ( !is_null($result) )
172
+                if (!is_null($result))
173 173
                     return true;
174 174
             }
175 175
         }
@@ -183,15 +183,15 @@  discard block
 block discarded – undo
183 183
      * @param  array $indexlist
184 184
      * @return bool true if this bean is a duplicate or false if it isn't
185 185
      */
186
-    public function isADuplicateRecord( $indexlist )
186
+    public function isADuplicateRecord($indexlist)
187 187
     {
188 188
         // Bug #51264 : Importing updates to rows prevented by duplicates check
189
-        if ( !empty($this->_focus) && ($this->_focus instanceof SugarBean) && !empty($this->_focus->id) )
189
+        if (!empty($this->_focus) && ($this->_focus instanceof SugarBean) && !empty($this->_focus->id))
190 190
         {
191 191
             $_focus = clone $this->_focus;
192 192
             $_focus->id = null;
193 193
             $_focus->retrieve($this->_focus->id);
194
-            if ( !empty($_focus->id) )
194
+            if (!empty($_focus->id))
195 195
             {
196 196
                 return false;
197 197
             }
@@ -200,20 +200,20 @@  discard block
 block discarded – undo
200 200
 
201 201
         //lets strip the indexes of the name field in the value and leave only the index name
202 202
         $origIndexList = $indexlist;
203
-        $indexlist=array();
204
-        $fieldlist=array();
205
-        $customIndexlist=array();
206
-        foreach($origIndexList as $iv){
207
-            if(empty($iv)) continue;
208
-            $field_index_array = explode('::',$iv);
209
-            if($field_index_array[0] == 'customfield'){
203
+        $indexlist = array();
204
+        $fieldlist = array();
205
+        $customIndexlist = array();
206
+        foreach ($origIndexList as $iv) {
207
+            if (empty($iv)) continue;
208
+            $field_index_array = explode('::', $iv);
209
+            if ($field_index_array[0] == 'customfield') {
210 210
                 //this is a custom field, so place in custom array
211 211
                 $customIndexlist[] = $field_index_array[1];
212 212
 
213
-            }else{
213
+            } else {
214 214
                 //this is not a custom field, so place in index list
215 215
                 $indexlist[] = $field_index_array[0];
216
-                if(isset($field_index_array[1])) {
216
+                if (isset($field_index_array[1])) {
217 217
                     $fieldlist[] = $field_index_array[1];
218 218
                 }
219 219
             }
@@ -221,11 +221,11 @@  discard block
 block discarded – undo
221 221
 
222 222
         //if full_name is set, then manually search on the first and last name fields before iterating through rest of fields
223 223
         //this is a special handling of the name fields on people objects, the rest of the fields are checked individually
224
-        if(in_array('full_name',$indexlist)){
224
+        if (in_array('full_name', $indexlist)) {
225 225
             $newfocus = loadBean($this->_focus->module_dir);
226
-            $result = $newfocus->retrieve_by_string_fields(array('deleted' =>'0', 'first_name'=>$this->_focus->first_name, 'last_name'=>$this->_focus->last_name),true);
226
+            $result = $newfocus->retrieve_by_string_fields(array('deleted' =>'0', 'first_name'=>$this->_focus->first_name, 'last_name'=>$this->_focus->last_name), true);
227 227
 
228
-            if ( !is_null($result) ){
228
+            if (!is_null($result)) {
229 229
                 //set dupe field to full_name and name fields
230 230
                 $this->_dupedFields[] = 'full_name';
231 231
                 $this->_dupedFields[] = 'first_name';
@@ -235,61 +235,61 @@  discard block
 block discarded – undo
235 235
         }
236 236
 
237 237
         // loop through var def indexes and compare with selected indexes
238
-        foreach ($this->_getIndexVardefs() as $index){
238
+        foreach ($this->_getIndexVardefs() as $index) {
239 239
             // if we get an index not in the indexlist, loop
240
-            if ( !in_array($index['name'],$indexlist) )
240
+            if (!in_array($index['name'], $indexlist))
241 241
                 continue;
242 242
 
243 243
             // This handles the special case of duplicate email checking
244
-            if ( $index['name'] == 'special_idx_email1' || $index['name'] == 'special_idx_email2' ) {
244
+            if ($index['name'] == 'special_idx_email1' || $index['name'] == 'special_idx_email2') {
245 245
                 $emailAddress = new SugarEmailAddress();
246 246
                 $email = $index['fields'][0];
247
-                if ( $emailAddress->getCountEmailAddressByBean(
247
+                if ($emailAddress->getCountEmailAddressByBean(
248 248
                         $this->_focus->$email,
249 249
                         $this->_focus,
250 250
                         ($index['name'] == 'special_idx_email1')
251
-                        ) > 0 ){ foreach($index['fields'] as $field){
252
-                        if($field !='deleted')
251
+                        ) > 0) { foreach ($index['fields'] as $field) {
252
+                        if ($field != 'deleted')
253 253
                             $this->_dupedFields[] = $field;
254 254
                     }
255 255
                 }
256 256
             }
257 257
             // Adds a hook so you can define a method in the bean to handle dupe checking
258
-            elseif ( isset($index['dupeCheckFunction']) ) {
259
-                $functionName = substr_replace($index['dupeCheckFunction'],'',0,9);
260
-                if ( method_exists($this->_focus,$functionName) && $this->_focus->$functionName($index) === true)
258
+            elseif (isset($index['dupeCheckFunction'])) {
259
+                $functionName = substr_replace($index['dupeCheckFunction'], '', 0, 9);
260
+                if (method_exists($this->_focus, $functionName) && $this->_focus->$functionName($index) === true)
261 261
                     return $this->_focus->$functionName($index);
262 262
             }
263 263
             else {
264 264
                 $index_fields = array('deleted' => '0');
265 265
                 //search only for the field we have selected
266
-                foreach($index['fields'] as $field){
267
-                    if ($field == 'deleted' ||  !in_array($field,$fieldlist))
266
+                foreach ($index['fields'] as $field) {
267
+                    if ($field == 'deleted' || !in_array($field, $fieldlist))
268 268
                         continue;
269
-                    if (!in_array($field,$index_fields))
269
+                    if (!in_array($field, $index_fields))
270 270
                         if (isset($this->_focus->$field) && strlen($this->_focus->$field) > 0)
271 271
                             $index_fields[$field] = $this->_focus->$field;
272 272
                 }
273 273
 
274 274
                 // if there are no valid fields in the index field list, loop
275
-                if ( count($index_fields) <= 1 )
275
+                if (count($index_fields) <= 1)
276 276
                     continue;
277 277
 
278 278
                 $newfocus = loadBean($this->_focus->module_dir);
279
-                $result = $newfocus->retrieve_by_string_fields($index_fields,true);
279
+                $result = $newfocus->retrieve_by_string_fields($index_fields, true);
280 280
 
281
-                if ( !is_null($result) ){
281
+                if (!is_null($result)) {
282 282
                     //remove deleted as a duped field
283 283
                     unset($index_fields['deleted']);
284 284
 
285 285
                     //create string based on array of dupe fields
286
-                    $this->_dupedFields = array_merge(array_keys($index_fields),$this->_dupedFields);
286
+                    $this->_dupedFields = array_merge(array_keys($index_fields), $this->_dupedFields);
287 287
                 }
288 288
             }
289 289
         }
290 290
 
291 291
         //return true if any dupes were found
292
-        if(!empty($this->_dupedFields)){
292
+        if (!empty($this->_dupedFields)) {
293 293
             return true;
294 294
         }
295 295
 
@@ -301,33 +301,33 @@  discard block
 block discarded – undo
301 301
     {
302 302
         require_once('include/export_utils.php');
303 303
         $import_fields = $this->_focus->get_importable_fields();
304
-        $importable_keys = array_keys($import_fields);//
304
+        $importable_keys = array_keys($import_fields); //
305 305
 
306 306
         $index_array = array();
307 307
         $fields_used = array();
308
-        $mstr_exclude_array = array('all'=>array('team_set_id','id','deleted'),'contacts'=>array('email2'), array('leads'=>'reports_to_id'), array('prospects'=>'tracker_key'));
308
+        $mstr_exclude_array = array('all'=>array('team_set_id', 'id', 'deleted'), 'contacts'=>array('email2'), array('leads'=>'reports_to_id'), array('prospects'=>'tracker_key'));
309 309
 
310 310
         //create exclude array from subset of applicable mstr_exclude_array elements
311
-        $exclude_array =  isset($mstr_exclude_array[strtolower($this->_focus->module_dir)])?array_merge($mstr_exclude_array[strtolower($this->_focus->module_dir)], $mstr_exclude_array['all']) : $mstr_exclude_array['all'];
311
+        $exclude_array = isset($mstr_exclude_array[strtolower($this->_focus->module_dir)]) ? array_merge($mstr_exclude_array[strtolower($this->_focus->module_dir)], $mstr_exclude_array['all']) : $mstr_exclude_array['all'];
312 312
 
313 313
 
314 314
 
315 315
         //process all fields belonging to indexes
316
-        foreach ($this->_getIndexVardefs() as $index){
317
-            if ($index['type'] == "index"){
316
+        foreach ($this->_getIndexVardefs() as $index) {
317
+            if ($index['type'] == "index") {
318 318
 
319
-                foreach ($index['fields'] as $field){
320
-                    $fieldName='';
319
+                foreach ($index['fields'] as $field) {
320
+                    $fieldName = '';
321 321
 
322 322
                     //skip this field if it is the deleted field, not in the importable keys array, or a field in the exclude array
323 323
                     if (!in_array($field, $importable_keys) || in_array($field, $exclude_array)) continue;
324 324
                     $fieldDef = $this->_focus->getFieldDefinition($field);
325 325
 
326 326
                     //skip if this field is already defined (from another index)
327
-                    if (in_array($fieldDef['name'],$fields_used)) continue;
327
+                    if (in_array($fieldDef['name'], $fields_used)) continue;
328 328
 
329 329
                     //get the proper export label
330
-                    $fieldName = translateForExport($fieldDef['name'],$this->_focus);
330
+                    $fieldName = translateForExport($fieldDef['name'], $this->_focus);
331 331
 
332 332
 
333 333
                     $index_array[$index['name'].'::'.$fieldDef['name']] = $fieldName;
@@ -338,9 +338,9 @@  discard block
 block discarded – undo
338 338
         }
339 339
 
340 340
         //special handling for beans with first_name and last_name
341
-        if(in_array('first_name', $fields_used) && in_array('last_name', $fields_used)){
341
+        if (in_array('first_name', $fields_used) && in_array('last_name', $fields_used)) {
342 342
             //since both full name and last name fields have been mapped, add full name index
343
-            $index_array['full_name::full_name'] = translateForExport('full_name',$this->_focus);
343
+            $index_array['full_name::full_name'] = translateForExport('full_name', $this->_focus);
344 344
             $fields_used[] = 'full_name';
345 345
         }
346 346
 
Please login to merge, or discard this patch.
Braces   +64 added lines, -42 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 
4 6
 /*********************************************************************************
5 7
  * SugarCRM Community Edition is a customer relationship management program developed by
@@ -83,18 +85,20 @@  discard block
 block discarded – undo
83 85
             $indexes = array_merge($custmIndexes,$indexes);
84 86
         }
85 87
 
86
-        if ( $this->_focus->getFieldDefinition('email1') )
87
-            $indexes[] = array(
88
+        if ( $this->_focus->getFieldDefinition('email1') ) {
89
+                    $indexes[] = array(
88 90
                 'name' => 'special_idx_email1',
89 91
                 'type' => 'index',
90 92
                 'fields' => array('email1')
91 93
                 );
92
-        if ( $this->_focus->getFieldDefinition('email2') )
93
-            $indexes[] = array(
94
+        }
95
+        if ( $this->_focus->getFieldDefinition('email2') ) {
96
+                    $indexes[] = array(
94 97
                 'name' => 'special_idx_email2',
95 98
                 'type' => 'index',
96 99
                 'fields' => array('email2')
97 100
                 );
101
+        }
98 102
 
99 103
         return $indexes;
100 104
     }
@@ -116,12 +120,15 @@  discard block
 block discarded – undo
116 120
             if ($index['type'] == "index"){
117 121
                 $labelsArray = array();
118 122
                 foreach ($index['fields'] as $field){
119
-                    if ($field == 'deleted') continue;
123
+                    if ($field == 'deleted') {
124
+                        continue;
125
+                    }
120 126
                     $fieldDef = $this->_focus->getFieldDefinition($field);
121
-                    if ( isset($fieldDef['vname']) && isset($super_language_pack[$fieldDef['vname']]) )
122
-                        $labelsArray[$fieldDef['name']] = $super_language_pack[$fieldDef['vname']];
123
-                    else
124
-                        $labelsArray[$fieldDef['name']] = $fieldDef['name'];
127
+                    if ( isset($fieldDef['vname']) && isset($super_language_pack[$fieldDef['vname']]) ) {
128
+                                            $labelsArray[$fieldDef['name']] = $super_language_pack[$fieldDef['vname']];
129
+                    } else {
130
+                                            $labelsArray[$fieldDef['name']] = $fieldDef['name'];
131
+                    }
125 132
                 }
126 133
                 $index_array[$index['name']] = str_replace(":", "",implode(", ",$labelsArray));
127 134
             }
@@ -144,33 +151,37 @@  discard block
 block discarded – undo
144 151
             {
145 152
                 $emailAddress = new SugarEmailAddress();
146 153
                 $email = $field;
147
-                if ( $emailAddress->getCountEmailAddressByBean($this->_focus->$email,$this->_focus,($field == 'email1')) > 0 )
148
-                    return true;
149
-            }
150
-            else
154
+                if ( $emailAddress->getCountEmailAddressByBean($this->_focus->$email,$this->_focus,($field == 'email1')) > 0 ) {
155
+                                    return true;
156
+                }
157
+            } else
151 158
             {
152 159
                 $index_fields = array('deleted' => '0');
153 160
                 if( is_array($field) )
154 161
                 {
155 162
                     foreach($field as $tmpField)
156 163
                     {
157
-                        if ($tmpField == 'deleted')
158
-                            continue;
159
-                        if (strlen($this->_focus->$tmpField) > 0)
160
-                            $index_fields[$tmpField] = $this->_focus->$tmpField;
164
+                        if ($tmpField == 'deleted') {
165
+                                                    continue;
166
+                        }
167
+                        if (strlen($this->_focus->$tmpField) > 0) {
168
+                                                    $index_fields[$tmpField] = $this->_focus->$tmpField;
169
+                        }
161 170
                     }
171
+                } elseif($field != 'deleted' && strlen($this->_focus->$field) > 0) {
172
+                                    $index_fields[$field] = $this->_focus->$field;
162 173
                 }
163
-                elseif($field != 'deleted' && strlen($this->_focus->$field) > 0)
164
-                    $index_fields[$field] = $this->_focus->$field;
165 174
 
166
-                if ( count($index_fields) <= 1 )
167
-                    continue;
175
+                if ( count($index_fields) <= 1 ) {
176
+                                    continue;
177
+                }
168 178
 
169 179
                 $newfocus = loadBean($this->_focus->module_dir);
170 180
                 $result = $newfocus->retrieve_by_string_fields($index_fields,true);
171 181
 
172
-                if ( !is_null($result) )
173
-                    return true;
182
+                if ( !is_null($result) ) {
183
+                                    return true;
184
+                }
174 185
             }
175 186
         }
176 187
 
@@ -204,13 +215,15 @@  discard block
 block discarded – undo
204 215
         $fieldlist=array();
205 216
         $customIndexlist=array();
206 217
         foreach($origIndexList as $iv){
207
-            if(empty($iv)) continue;
218
+            if(empty($iv)) {
219
+                continue;
220
+            }
208 221
             $field_index_array = explode('::',$iv);
209 222
             if($field_index_array[0] == 'customfield'){
210 223
                 //this is a custom field, so place in custom array
211 224
                 $customIndexlist[] = $field_index_array[1];
212 225
 
213
-            }else{
226
+            } else{
214 227
                 //this is not a custom field, so place in index list
215 228
                 $indexlist[] = $field_index_array[0];
216 229
                 if(isset($field_index_array[1])) {
@@ -237,8 +250,9 @@  discard block
 block discarded – undo
237 250
         // loop through var def indexes and compare with selected indexes
238 251
         foreach ($this->_getIndexVardefs() as $index){
239 252
             // if we get an index not in the indexlist, loop
240
-            if ( !in_array($index['name'],$indexlist) )
241
-                continue;
253
+            if ( !in_array($index['name'],$indexlist) ) {
254
+                            continue;
255
+            }
242 256
 
243 257
             // This handles the special case of duplicate email checking
244 258
             if ( $index['name'] == 'special_idx_email1' || $index['name'] == 'special_idx_email2' ) {
@@ -249,31 +263,35 @@  discard block
 block discarded – undo
249 263
                         $this->_focus,
250 264
                         ($index['name'] == 'special_idx_email1')
251 265
                         ) > 0 ){ foreach($index['fields'] as $field){
252
-                        if($field !='deleted')
253
-                            $this->_dupedFields[] = $field;
266
+                        if($field !='deleted') {
267
+                                                    $this->_dupedFields[] = $field;
268
+                        }
254 269
                     }
255 270
                 }
256 271
             }
257 272
             // Adds a hook so you can define a method in the bean to handle dupe checking
258 273
             elseif ( isset($index['dupeCheckFunction']) ) {
259 274
                 $functionName = substr_replace($index['dupeCheckFunction'],'',0,9);
260
-                if ( method_exists($this->_focus,$functionName) && $this->_focus->$functionName($index) === true)
261
-                    return $this->_focus->$functionName($index);
262
-            }
263
-            else {
275
+                if ( method_exists($this->_focus,$functionName) && $this->_focus->$functionName($index) === true) {
276
+                                    return $this->_focus->$functionName($index);
277
+                }
278
+            } else {
264 279
                 $index_fields = array('deleted' => '0');
265 280
                 //search only for the field we have selected
266 281
                 foreach($index['fields'] as $field){
267
-                    if ($field == 'deleted' ||  !in_array($field,$fieldlist))
268
-                        continue;
269
-                    if (!in_array($field,$index_fields))
270
-                        if (isset($this->_focus->$field) && strlen($this->_focus->$field) > 0)
282
+                    if ($field == 'deleted' ||  !in_array($field,$fieldlist)) {
283
+                                            continue;
284
+                    }
285
+                    if (!in_array($field,$index_fields)) {
286
+                                            if (isset($this->_focus->$field) && strlen($this->_focus->$field) > 0)
271 287
                             $index_fields[$field] = $this->_focus->$field;
288
+                    }
272 289
                 }
273 290
 
274 291
                 // if there are no valid fields in the index field list, loop
275
-                if ( count($index_fields) <= 1 )
276
-                    continue;
292
+                if ( count($index_fields) <= 1 ) {
293
+                                    continue;
294
+                }
277 295
 
278 296
                 $newfocus = loadBean($this->_focus->module_dir);
279 297
                 $result = $newfocus->retrieve_by_string_fields($index_fields,true);
@@ -320,11 +338,15 @@  discard block
 block discarded – undo
320 338
                     $fieldName='';
321 339
 
322 340
                     //skip this field if it is the deleted field, not in the importable keys array, or a field in the exclude array
323
-                    if (!in_array($field, $importable_keys) || in_array($field, $exclude_array)) continue;
341
+                    if (!in_array($field, $importable_keys) || in_array($field, $exclude_array)) {
342
+                        continue;
343
+                    }
324 344
                     $fieldDef = $this->_focus->getFieldDefinition($field);
325 345
 
326 346
                     //skip if this field is already defined (from another index)
327
-                    if (in_array($fieldDef['name'],$fields_used)) continue;
347
+                    if (in_array($fieldDef['name'],$fields_used)) {
348
+                        continue;
349
+                    }
328 350
 
329 351
                     //get the proper export label
330 352
                     $fieldName = translateForExport($fieldDef['name'],$this->_focus);
Please login to merge, or discard this patch.
modules/Cases/vardefs.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -245,7 +245,7 @@
 block discarded – undo
245 245
             array(
246 246
                 'name' => 'emails',
247 247
                 'type' => 'link',
248
-                'relationship' => 'emails_cases_rel',/* reldef in emails */
248
+                'relationship' => 'emails_cases_rel', /* reldef in emails */
249 249
                 'source' => 'non-db',
250 250
                 'vname' => 'LBL_EMAILS',
251 251
             ),
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
Please login to merge, or discard this patch.
modules/Cases/metadata/accountsquickcreatedefs.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -40,39 +40,39 @@
 block discarded – undo
40 40
 $viewdefs['Cases']['AccountsQuickCreate'] = array(
41 41
 'templateMeta' => array('form' => 
42 42
                             array (
43
-                              'hidden' => 
44
-                              array (
43
+                                'hidden' => 
44
+                                array (
45 45
                                 0 => '<input type="hidden" name="account_id" value="{$smarty.request.account_id}">',
46 46
                                 1 => '<input type="hidden" name="account_name" value="{$smarty.request.account_name}">',
47
-                              ),
47
+                                ),
48 48
                             ),
49 49
                         'maxColumns' => '2', 
50 50
                         'widths' => array(
51 51
                                         array('label' => '10', 'field' => '30'), 
52 52
                                         array('label' => '10', 'field' => '30')
53 53
                                         ),
54
-                       ),
54
+                        ),
55 55
 'panels' =>
56 56
 
57 57
 array (
58 58
   
59
-  array (
59
+    array (
60 60
     array ('name'=>'name', 'displayParams'=>array('size'=>65, 'required'=>true)),
61 61
     'priority'
62
-  ),
62
+    ),
63 63
   
64
-  array (
64
+    array (
65 65
     'status',
66 66
     array('name'=>'account_name', 'type'=>'readonly'),
67
-  ),
67
+    ),
68 68
   
69
-  array (
70 69
     array (
71
-      'name' => 'description',
72
-      'displayParams' => array ('rows' => '4','cols' => '60'),
73
-      'nl2br' => true,
70
+    array (
71
+        'name' => 'description',
72
+        'displayParams' => array ('rows' => '4','cols' => '60'),
73
+        'nl2br' => true,
74
+    ),
74 75
     ),
75
-  ),
76 76
 
77 77
 ),
78 78
 
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
 
40 40
 $viewdefs['Cases']['AccountsQuickCreate'] = array(
41 41
 'templateMeta' => array('form' => 
42
-                            array (
42
+                            array(
43 43
                               'hidden' => 
44
-                              array (
44
+                              array(
45 45
                                 0 => '<input type="hidden" name="account_id" value="{$smarty.request.account_id}">',
46 46
                                 1 => '<input type="hidden" name="account_name" value="{$smarty.request.account_name}">',
47 47
                               ),
@@ -54,22 +54,22 @@  discard block
 block discarded – undo
54 54
                        ),
55 55
 'panels' =>
56 56
 
57
-array (
57
+array(
58 58
   
59
-  array (
60
-    array ('name'=>'name', 'displayParams'=>array('size'=>65, 'required'=>true)),
59
+  array(
60
+    array('name'=>'name', 'displayParams'=>array('size'=>65, 'required'=>true)),
61 61
     'priority'
62 62
   ),
63 63
   
64
-  array (
64
+  array(
65 65
     'status',
66 66
     array('name'=>'account_name', 'type'=>'readonly'),
67 67
   ),
68 68
   
69
-  array (
70
-    array (
69
+  array(
70
+    array(
71 71
       'name' => 'description',
72
-      'displayParams' => array ('rows' => '4','cols' => '60'),
72
+      'displayParams' => array('rows' => '4', 'cols' => '60'),
73 73
       'nl2br' => true,
74 74
     ),
75 75
   ),
Please login to merge, or discard this patch.
modules/Cases/metadata/additionalDetails.php 3 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -42,31 +42,31 @@
 block discarded – undo
42 42
     return additionalDetailsaCase($fields);
43 43
 }
44 44
 function additionalDetailsaCase($fields) {
45
-	static $mod_strings;
46
-	if(empty($mod_strings)) {
47
-		global $current_language;
48
-		$mod_strings = return_module_language($current_language, 'Cases');
49
-	}
45
+    static $mod_strings;
46
+    if(empty($mod_strings)) {
47
+        global $current_language;
48
+        $mod_strings = return_module_language($current_language, 'Cases');
49
+    }
50 50
 		
51
-	$overlib_string = '';
51
+    $overlib_string = '';
52 52
 		
53
-	if(!empty($fields['DESCRIPTION'])) { 
54
-		$overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
55
-		if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...';
56
-		$overlib_string .= '<br>';
57
-	}
58
-	if(!empty($fields['RESOLUTION'])) { 
59
-		$overlib_string .= '<b>'. $mod_strings['LBL_RESOLUTION'] . '</b> ' . substr($fields['RESOLUTION'], 0, 300);
60
-		if(strlen($fields['RESOLUTION']) > 300) $overlib_string .= '...';
61
-	}		
53
+    if(!empty($fields['DESCRIPTION'])) { 
54
+        $overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
55
+        if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...';
56
+        $overlib_string .= '<br>';
57
+    }
58
+    if(!empty($fields['RESOLUTION'])) { 
59
+        $overlib_string .= '<b>'. $mod_strings['LBL_RESOLUTION'] . '</b> ' . substr($fields['RESOLUTION'], 0, 300);
60
+        if(strlen($fields['RESOLUTION']) > 300) $overlib_string .= '...';
61
+    }		
62 62
 	
63
-	return array('fieldToAddTo' => 'NAME', 
64
-				 'string' => $overlib_string, 
65
-				 'width' => '400',
66
-				 'editLink' => "index.php?action=EditView&module=Cases&return_module=Cases&record={$fields['ID']}", 
67
-				 'viewLink' => "index.php?action=DetailView&module=Cases&return_module=Cases&record={$fields['ID']}");
63
+    return array('fieldToAddTo' => 'NAME', 
64
+                    'string' => $overlib_string, 
65
+                    'width' => '400',
66
+                    'editLink' => "index.php?action=EditView&module=Cases&return_module=Cases&record={$fields['ID']}", 
67
+                    'viewLink' => "index.php?action=DetailView&module=Cases&return_module=Cases&record={$fields['ID']}");
68 68
 }
69 69
  
70
- ?>
70
+    ?>
71 71
  
72 72
  
73 73
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 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.
@@ -43,21 +43,21 @@  discard block
 block discarded – undo
43 43
 }
44 44
 function additionalDetailsaCase($fields) {
45 45
 	static $mod_strings;
46
-	if(empty($mod_strings)) {
46
+	if (empty($mod_strings)) {
47 47
 		global $current_language;
48 48
 		$mod_strings = return_module_language($current_language, 'Cases');
49 49
 	}
50 50
 		
51 51
 	$overlib_string = '';
52 52
 		
53
-	if(!empty($fields['DESCRIPTION'])) { 
54
-		$overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
55
-		if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...';
53
+	if (!empty($fields['DESCRIPTION'])) { 
54
+		$overlib_string .= '<b>'.$mod_strings['LBL_DESCRIPTION'].'</b> '.substr($fields['DESCRIPTION'], 0, 300);
55
+		if (strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...';
56 56
 		$overlib_string .= '<br>';
57 57
 	}
58
-	if(!empty($fields['RESOLUTION'])) { 
59
-		$overlib_string .= '<b>'. $mod_strings['LBL_RESOLUTION'] . '</b> ' . substr($fields['RESOLUTION'], 0, 300);
60
-		if(strlen($fields['RESOLUTION']) > 300) $overlib_string .= '...';
58
+	if (!empty($fields['RESOLUTION'])) { 
59
+		$overlib_string .= '<b>'.$mod_strings['LBL_RESOLUTION'].'</b> '.substr($fields['RESOLUTION'], 0, 300);
60
+		if (strlen($fields['RESOLUTION']) > 300) $overlib_string .= '...';
61 61
 	}		
62 62
 	
63 63
 	return array('fieldToAddTo' => 'NAME', 
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -52,12 +54,16 @@  discard block
 block discarded – undo
52 54
 		
53 55
 	if(!empty($fields['DESCRIPTION'])) { 
54 56
 		$overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
55
-		if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...';
57
+		if(strlen($fields['DESCRIPTION']) > 300) {
58
+		    $overlib_string .= '...';
59
+		}
56 60
 		$overlib_string .= '<br>';
57 61
 	}
58 62
 	if(!empty($fields['RESOLUTION'])) { 
59 63
 		$overlib_string .= '<b>'. $mod_strings['LBL_RESOLUTION'] . '</b> ' . substr($fields['RESOLUTION'], 0, 300);
60
-		if(strlen($fields['RESOLUTION']) > 300) $overlib_string .= '...';
64
+		if(strlen($fields['RESOLUTION']) > 300) {
65
+		    $overlib_string .= '...';
66
+		}
61 67
 	}		
62 68
 	
63 69
 	return array('fieldToAddTo' => 'NAME', 
Please login to merge, or discard this patch.
modules/Cases/metadata/editviewdefs.php 2 patches
Indentation   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -39,143 +39,143 @@
 block discarded – undo
39 39
 
40 40
 $viewdefs ['Cases'] =
41 41
 array (
42
-  'EditView' => 
43
-  array (
42
+    'EditView' => 
43
+    array (
44 44
     'templateMeta' => 
45 45
     array (
46
-      'maxColumns' => '2',
47
-      'widths' => 
48
-      array (
46
+        'maxColumns' => '2',
47
+        'widths' => 
48
+        array (
49 49
         0 => 
50 50
         array (
51
-          'label' => '10',
52
-          'field' => '30',
51
+            'label' => '10',
52
+            'field' => '30',
53 53
         ),
54 54
         1 => 
55 55
         array (
56
-          'label' => '10',
57
-          'field' => '30',
56
+            'label' => '10',
57
+            'field' => '30',
58 58
         ),
59
-      ),
60
-      'includes' => 
61
-      array (
62
-          0 =>
63
-              array (
64
-                  'file' => 'include/javascript/bindWithDelay.js',
65
-              ),
59
+        ),
60
+        'includes' => 
61
+        array (
62
+            0 =>
63
+                array (
64
+                    'file' => 'include/javascript/bindWithDelay.js',
65
+                ),
66 66
         1 =>
67 67
         array (
68
-          'file' => 'modules/AOK_KnowledgeBase/AOK_KnowledgeBase_SuggestionBox.js',
68
+            'file' => 'modules/AOK_KnowledgeBase/AOK_KnowledgeBase_SuggestionBox.js',
69
+        ),
70
+            2 =>
71
+                array (
72
+                    'file' => 'include/javascript/qtip/jquery.qtip.min.js',
73
+                ),
69 74
         ),
70
-          2 =>
71
-              array (
72
-                  'file' => 'include/javascript/qtip/jquery.qtip.min.js',
73
-              ),
74
-      ),
75
-      'useTabs' => false,
76
-      'tabDefs' => 
77
-      array (
75
+        'useTabs' => false,
76
+        'tabDefs' => 
77
+        array (
78 78
         'LBL_CASE_INFORMATION' => 
79 79
         array (
80
-          'newTab' => false,
81
-          'panelDefault' => 'expanded',
80
+            'newTab' => false,
81
+            'panelDefault' => 'expanded',
82 82
         ),
83
-      ),
84
-      'form' => 
85
-      array (
83
+        ),
84
+        'form' => 
85
+        array (
86 86
         'enctype' => 'multipart/form-data',
87
-      ),
87
+        ),
88 88
     ),
89 89
     'panels' => 
90 90
     array (
91
-      'lbl_case_information' => 
92
-      array (
91
+        'lbl_case_information' => 
92
+        array (
93 93
         0 => 
94 94
         array (
95
-          0 => 
96
-          array (
95
+            0 => 
96
+            array (
97 97
             'name' => 'case_number',
98 98
             'type' => 'readonly',
99
-          ),
100
-          1 => 'priority',
99
+            ),
100
+            1 => 'priority',
101 101
         ),
102 102
         1 => 
103 103
         array (
104
-          0 => 
105
-          array (
104
+            0 => 
105
+            array (
106 106
             'name' => 'state',
107 107
             'comment' => 'The state of the case (i.e. open/closed)',
108 108
             'label' => 'LBL_STATE',
109
-          ),
110
-          1 => 'status',
109
+            ),
110
+            1 => 'status',
111 111
         ),
112 112
         2 => 
113 113
         array (
114
-          0 => 'type',
115
-          1 => 'account_name',
114
+            0 => 'type',
115
+            1 => 'account_name',
116 116
         ),
117 117
         3 => 
118 118
         array (
119
-          0 => 
120
-          array (
119
+            0 => 
120
+            array (
121 121
             'name' => 'name',
122 122
             'displayParams' => 
123 123
             array (
124
-              //'size' => 75,
124
+                //'size' => 75,
125
+            ),
125 126
             ),
126
-          ),
127 127
             1 =>
128 128
                 array (
129 129
                     'name' => 'suggestion_box',
130
-                  //'studio' => 'visible',
130
+                    //'studio' => 'visible',
131 131
                     'label' => 'LBL_SUGGESTION_BOX'
132 132
                 ),
133 133
         ),
134 134
         4 =>
135 135
         array (
136
-          0 => 
137
-          array (
136
+            0 => 
137
+            array (
138 138
             'name' => 'description',
139 139
             'nl2br' => true,
140
-          ),
140
+            ),
141 141
         ),
142 142
         5 =>
143 143
         array (
144
-          0 => 
145
-          array (
144
+            0 => 
145
+            array (
146 146
             'name' => 'resolution',
147 147
             'nl2br' => true,
148
-          ),
148
+            ),
149 149
         ),
150 150
         6 =>
151 151
         array (
152
-          0 => 
153
-          array (
152
+            0 => 
153
+            array (
154 154
             'name' => 'update_text',
155 155
             'studio' => 'visible',
156 156
             'label' => 'LBL_UPDATE_TEXT',
157
-          ),
158
-          1 => 
159
-          array (
157
+            ),
158
+            1 => 
159
+            array (
160 160
             'name' => 'internal',
161 161
             'studio' => 'visible',
162 162
             'label' => 'LBL_INTERNAL',
163
-          ),
163
+            ),
164 164
         ),
165 165
         7 =>
166 166
         array (
167
-          0 => 
168
-          array (
167
+            0 => 
168
+            array (
169 169
             'name' => 'case_update_form',
170 170
             'studio' => 'visible',
171
-          ),
171
+            ),
172 172
         ),
173 173
         8 =>
174 174
         array (
175
-          0 => 'assigned_user_name',
175
+            0 => 'assigned_user_name',
176 176
         ),
177
-      ),
177
+        ),
178
+    ),
178 179
     ),
179
-  ),
180 180
 );
181 181
 ?>
Please login to merge, or discard this patch.
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -38,71 +38,71 @@  discard block
 block discarded – undo
38 38
  ********************************************************************************/
39 39
 
40 40
 $viewdefs ['Cases'] =
41
-array (
41
+array(
42 42
   'EditView' => 
43
-  array (
43
+  array(
44 44
     'templateMeta' => 
45
-    array (
45
+    array(
46 46
       'maxColumns' => '2',
47 47
       'widths' => 
48
-      array (
48
+      array(
49 49
         0 => 
50
-        array (
50
+        array(
51 51
           'label' => '10',
52 52
           'field' => '30',
53 53
         ),
54 54
         1 => 
55
-        array (
55
+        array(
56 56
           'label' => '10',
57 57
           'field' => '30',
58 58
         ),
59 59
       ),
60 60
       'includes' => 
61
-      array (
61
+      array(
62 62
           0 =>
63
-              array (
63
+              array(
64 64
                   'file' => 'include/javascript/bindWithDelay.js',
65 65
               ),
66 66
         1 =>
67
-        array (
67
+        array(
68 68
           'file' => 'modules/AOK_KnowledgeBase/AOK_KnowledgeBase_SuggestionBox.js',
69 69
         ),
70 70
           2 =>
71
-              array (
71
+              array(
72 72
                   'file' => 'include/javascript/qtip/jquery.qtip.min.js',
73 73
               ),
74 74
       ),
75 75
       'useTabs' => false,
76 76
       'tabDefs' => 
77
-      array (
77
+      array(
78 78
         'LBL_CASE_INFORMATION' => 
79
-        array (
79
+        array(
80 80
           'newTab' => false,
81 81
           'panelDefault' => 'expanded',
82 82
         ),
83 83
       ),
84 84
       'form' => 
85
-      array (
85
+      array(
86 86
         'enctype' => 'multipart/form-data',
87 87
       ),
88 88
     ),
89 89
     'panels' => 
90
-    array (
90
+    array(
91 91
       'lbl_case_information' => 
92
-      array (
92
+      array(
93 93
         0 => 
94
-        array (
94
+        array(
95 95
           0 => 
96
-          array (
96
+          array(
97 97
             'name' => 'case_number',
98 98
             'type' => 'readonly',
99 99
           ),
100 100
           1 => 'priority',
101 101
         ),
102 102
         1 => 
103
-        array (
103
+        array(
104 104
           0 => 
105
-          array (
105
+          array(
106 106
             'name' => 'state',
107 107
             'comment' => 'The state of the case (i.e. open/closed)',
108 108
             'label' => 'LBL_STATE',
@@ -110,68 +110,68 @@  discard block
 block discarded – undo
110 110
           1 => 'status',
111 111
         ),
112 112
         2 => 
113
-        array (
113
+        array(
114 114
           0 => 'type',
115 115
           1 => 'account_name',
116 116
         ),
117 117
         3 => 
118
-        array (
118
+        array(
119 119
           0 => 
120
-          array (
120
+          array(
121 121
             'name' => 'name',
122 122
             'displayParams' => 
123
-            array (
123
+            array(
124 124
               //'size' => 75,
125 125
             ),
126 126
           ),
127 127
             1 =>
128
-                array (
128
+                array(
129 129
                     'name' => 'suggestion_box',
130 130
                   //'studio' => 'visible',
131 131
                     'label' => 'LBL_SUGGESTION_BOX'
132 132
                 ),
133 133
         ),
134 134
         4 =>
135
-        array (
135
+        array(
136 136
           0 => 
137
-          array (
137
+          array(
138 138
             'name' => 'description',
139 139
             'nl2br' => true,
140 140
           ),
141 141
         ),
142 142
         5 =>
143
-        array (
143
+        array(
144 144
           0 => 
145
-          array (
145
+          array(
146 146
             'name' => 'resolution',
147 147
             'nl2br' => true,
148 148
           ),
149 149
         ),
150 150
         6 =>
151
-        array (
151
+        array(
152 152
           0 => 
153
-          array (
153
+          array(
154 154
             'name' => 'update_text',
155 155
             'studio' => 'visible',
156 156
             'label' => 'LBL_UPDATE_TEXT',
157 157
           ),
158 158
           1 => 
159
-          array (
159
+          array(
160 160
             'name' => 'internal',
161 161
             'studio' => 'visible',
162 162
             'label' => 'LBL_INTERNAL',
163 163
           ),
164 164
         ),
165 165
         7 =>
166
-        array (
166
+        array(
167 167
           0 => 
168
-          array (
168
+          array(
169 169
             'name' => 'case_update_form',
170 170
             'studio' => 'visible',
171 171
           ),
172 172
         ),
173 173
         8 =>
174
-        array (
174
+        array(
175 175
           0 => 'assigned_user_name',
176 176
         ),
177 177
       ),
Please login to merge, or discard this patch.
modules/Cases/metadata/SearchFields.php 3 patches
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -40,110 +40,110 @@
 block discarded – undo
40 40
 global $current_user;
41 41
 $module_name = "Cases";
42 42
 $searchFields['Cases'] = array (
43
-  'name' => 
44
-  array (
43
+    'name' => 
44
+    array (
45 45
     'query_type' => 'default',
46
-  ),
47
-  'account_name' => 
48
-  array (
46
+    ),
47
+    'account_name' => 
48
+    array (
49 49
     'query_type' => 'default',
50 50
     'db_field' => 
51 51
     array (
52
-      0 => 'accounts.name',
52
+        0 => 'accounts.name',
53
+    ),
53 54
     ),
54
-  ),
55
-  'status' => 
56
-  array (
55
+    'status' => 
56
+    array (
57 57
     'query_type' => 'default',
58 58
     'options' => 'case_status_dom',
59 59
     'template_var' => 'STATUS_OPTIONS',
60
-  ),
61
-  'priority' => 
62
-  array (
60
+    ),
61
+    'priority' => 
62
+    array (
63 63
     'query_type' => 'default',
64 64
     'options' => 'case_priority_dom',
65 65
     'template_var' => 'PRIORITY_OPTIONS',
66 66
     'options_add_blank' => true,
67
-  ),
68
-  'case_number' => 
69
-  array (
67
+    ),
68
+    'case_number' => 
69
+    array (
70 70
     'query_type' => 'default',
71 71
     'operator' => 'in',
72
-  ),
73
-  'current_user_only' => 
74
-  array (
72
+    ),
73
+    'current_user_only' => 
74
+    array (
75 75
     'query_type' => 'default',
76 76
     'db_field' => 
77 77
     array (
78
-      0 => 'assigned_user_id',
78
+        0 => 'assigned_user_id',
79 79
     ),
80 80
     'my_items' => true,
81 81
     'vname' => 'LBL_CURRENT_USER_FILTER',
82 82
     'type' => 'bool',
83
-  ),
84
-  'assigned_user_id' => 
85
-  array (
83
+    ),
84
+    'assigned_user_id' => 
85
+    array (
86 86
     'query_type' => 'default',
87
-  ),
88
-  'open_only' => 
89
-  array (
87
+    ),
88
+    'open_only' => 
89
+    array (
90 90
     'query_type' => 'default',
91 91
     'db_field' => 
92 92
     array (
93
-      0 => 'status',
93
+        0 => 'status',
94 94
     ),
95 95
     'operator' => 'not in',
96 96
     'closed_values' => 
97 97
     array (
98
-      0 => 'Closed',
99
-      1 => 'Rejected',
100
-      2 => 'Duplicate',
101
-      3 => 'Closed_Closed',
102
-      4 => 'Closed_Rejected',
103
-      5 => 'Closed_Duplicate',
98
+        0 => 'Closed',
99
+        1 => 'Rejected',
100
+        2 => 'Duplicate',
101
+        3 => 'Closed_Closed',
102
+        4 => 'Closed_Rejected',
103
+        5 => 'Closed_Duplicate',
104 104
     ),
105 105
     'type' => 'bool',
106
-  ),
107
-  'range_date_entered' => 
108
-  array (
106
+    ),
107
+    'range_date_entered' => 
108
+    array (
109 109
     'query_type' => 'default',
110 110
     'enable_range_search' => true,
111 111
     'is_date_field' => true,
112
-  ),
113
-  'start_range_date_entered' => 
114
-  array (
112
+    ),
113
+    'start_range_date_entered' => 
114
+    array (
115 115
     'query_type' => 'default',
116 116
     'enable_range_search' => true,
117 117
     'is_date_field' => true,
118
-  ),
119
-  'end_range_date_entered' => 
120
-  array (
118
+    ),
119
+    'end_range_date_entered' => 
120
+    array (
121 121
     'query_type' => 'default',
122 122
     'enable_range_search' => true,
123 123
     'is_date_field' => true,
124
-  ),
125
-  'range_date_modified' => 
126
-  array (
124
+    ),
125
+    'range_date_modified' => 
126
+    array (
127 127
     'query_type' => 'default',
128 128
     'enable_range_search' => true,
129 129
     'is_date_field' => true,
130
-  ),
131
-  'start_range_date_modified' => 
132
-  array (
130
+    ),
131
+    'start_range_date_modified' => 
132
+    array (
133 133
     'query_type' => 'default',
134 134
     'enable_range_search' => true,
135 135
     'is_date_field' => true,
136
-  ),
137
-  'end_range_date_modified' => 
138
-  array (
136
+    ),
137
+    'end_range_date_modified' => 
138
+    array (
139 139
     'query_type' => 'default',
140 140
     'enable_range_search' => true,
141 141
     'is_date_field' => true,
142
-  ),
143
-  'state' => 
144
-  array (
142
+    ),
143
+    'state' => 
144
+    array (
145 145
     'query_type' => 'default',
146
-  ),
146
+    ),
147 147
     'favorites_only' => array(
148 148
         'query_type'=>'format',
149 149
         'operator' => 'subquery',
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 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,42 +39,42 @@  discard block
 block discarded – undo
39 39
  ********************************************************************************/
40 40
 global $current_user;
41 41
 $module_name = "Cases";
42
-$searchFields['Cases'] = array (
42
+$searchFields['Cases'] = array(
43 43
   'name' => 
44
-  array (
44
+  array(
45 45
     'query_type' => 'default',
46 46
   ),
47 47
   'account_name' => 
48
-  array (
48
+  array(
49 49
     'query_type' => 'default',
50 50
     'db_field' => 
51
-    array (
51
+    array(
52 52
       0 => 'accounts.name',
53 53
     ),
54 54
   ),
55 55
   'status' => 
56
-  array (
56
+  array(
57 57
     'query_type' => 'default',
58 58
     'options' => 'case_status_dom',
59 59
     'template_var' => 'STATUS_OPTIONS',
60 60
   ),
61 61
   'priority' => 
62
-  array (
62
+  array(
63 63
     'query_type' => 'default',
64 64
     'options' => 'case_priority_dom',
65 65
     'template_var' => 'PRIORITY_OPTIONS',
66 66
     'options_add_blank' => true,
67 67
   ),
68 68
   'case_number' => 
69
-  array (
69
+  array(
70 70
     'query_type' => 'default',
71 71
     'operator' => 'in',
72 72
   ),
73 73
   'current_user_only' => 
74
-  array (
74
+  array(
75 75
     'query_type' => 'default',
76 76
     'db_field' => 
77
-    array (
77
+    array(
78 78
       0 => 'assigned_user_id',
79 79
     ),
80 80
     'my_items' => true,
@@ -82,19 +82,19 @@  discard block
 block discarded – undo
82 82
     'type' => 'bool',
83 83
   ),
84 84
   'assigned_user_id' => 
85
-  array (
85
+  array(
86 86
     'query_type' => 'default',
87 87
   ),
88 88
   'open_only' => 
89
-  array (
89
+  array(
90 90
     'query_type' => 'default',
91 91
     'db_field' => 
92
-    array (
92
+    array(
93 93
       0 => 'status',
94 94
     ),
95 95
     'operator' => 'not in',
96 96
     'closed_values' => 
97
-    array (
97
+    array(
98 98
       0 => 'Closed',
99 99
       1 => 'Rejected',
100 100
       2 => 'Duplicate',
@@ -105,43 +105,43 @@  discard block
 block discarded – undo
105 105
     'type' => 'bool',
106 106
   ),
107 107
   'range_date_entered' => 
108
-  array (
108
+  array(
109 109
     'query_type' => 'default',
110 110
     'enable_range_search' => true,
111 111
     'is_date_field' => true,
112 112
   ),
113 113
   'start_range_date_entered' => 
114
-  array (
114
+  array(
115 115
     'query_type' => 'default',
116 116
     'enable_range_search' => true,
117 117
     'is_date_field' => true,
118 118
   ),
119 119
   'end_range_date_entered' => 
120
-  array (
120
+  array(
121 121
     'query_type' => 'default',
122 122
     'enable_range_search' => true,
123 123
     'is_date_field' => true,
124 124
   ),
125 125
   'range_date_modified' => 
126
-  array (
126
+  array(
127 127
     'query_type' => 'default',
128 128
     'enable_range_search' => true,
129 129
     'is_date_field' => true,
130 130
   ),
131 131
   'start_range_date_modified' => 
132
-  array (
132
+  array(
133 133
     'query_type' => 'default',
134 134
     'enable_range_search' => true,
135 135
     'is_date_field' => true,
136 136
   ),
137 137
   'end_range_date_modified' => 
138
-  array (
138
+  array(
139 139
     'query_type' => 'default',
140 140
     'enable_range_search' => true,
141 141
     'is_date_field' => true,
142 142
   ),
143 143
   'state' => 
144
-  array (
144
+  array(
145 145
     'query_type' => 'default',
146 146
   ),
147 147
     'favorites_only' => array(
@@ -150,6 +150,6 @@  discard block
 block discarded – undo
150 150
         'subquery' => "SELECT favorites.parent_id FROM favorites
151 151
 			                    WHERE favorites.deleted = 0
152 152
 			                        and favorites.parent_type = '".$module_name."'
153
-			                        and favorites.assigned_user_id = '" .$current_user->id . "') OR NOT ({0}",
153
+			                        and favorites.assigned_user_id = '" .$current_user->id."') OR NOT ({0}",
154 154
         'db_field'=>array('id')),
155 155
 );
156 156
\ No newline at end of file
Please login to merge, or discard this patch.
modules/Cases/metadata/detailviewdefs.php 2 patches
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -39,129 +39,129 @@
 block discarded – undo
39 39
 
40 40
 $viewdefs ['Cases'] = 
41 41
 array (
42
-  'DetailView' => 
43
-  array (
42
+    'DetailView' => 
43
+    array (
44 44
     'templateMeta' => 
45 45
     array (
46
-      'form' => 
47
-      array (
46
+        'form' => 
47
+        array (
48 48
         'buttons' => 
49 49
         array (
50
-          0 => 'EDIT',
51
-          1 => 'DUPLICATE',
52
-          2 => 'DELETE',
53
-          3 => 'FIND_DUPLICATES',
50
+            0 => 'EDIT',
51
+            1 => 'DUPLICATE',
52
+            2 => 'DELETE',
53
+            3 => 'FIND_DUPLICATES',
54 54
         ),
55
-      ),
56
-      'maxColumns' => '2',
57
-      'widths' => 
58
-      array (
55
+        ),
56
+        'maxColumns' => '2',
57
+        'widths' => 
58
+        array (
59 59
         0 => 
60 60
         array (
61
-          'label' => '10',
62
-          'field' => '30',
61
+            'label' => '10',
62
+            'field' => '30',
63 63
         ),
64 64
         1 => 
65 65
         array (
66
-          'label' => '10',
67
-          'field' => '30',
66
+            'label' => '10',
67
+            'field' => '30',
68 68
         ),
69
-      ),
70
-      'useTabs' => true,
71
-      'tabDefs' => 
72
-      array (
69
+        ),
70
+        'useTabs' => true,
71
+        'tabDefs' => 
72
+        array (
73 73
         'LBL_CASE_INFORMATION' => 
74 74
         array (
75
-          'newTab' => true,
76
-          'panelDefault' => 'expanded',
75
+            'newTab' => true,
76
+            'panelDefault' => 'expanded',
77 77
         ),
78 78
         'LBL_AOP_CASE_UPDATES' => 
79 79
         array (
80
-          'newTab' => false,
81
-          'panelDefault' => 'expanded',
80
+            'newTab' => false,
81
+            'panelDefault' => 'expanded',
82
+        ),
82 83
         ),
83
-      ),
84 84
     ),
85 85
     'panels' => 
86 86
     array (
87
-      'lbl_case_information' => 
88
-      array (
87
+        'lbl_case_information' => 
88
+        array (
89 89
         0 => 
90 90
         array (
91
-          0 => 
92
-          array (
91
+            0 => 
92
+            array (
93 93
             'name' => 'case_number',
94 94
             'label' => 'LBL_CASE_NUMBER',
95
-          ),
96
-          1 => 'priority',
95
+            ),
96
+            1 => 'priority',
97 97
         ),
98 98
         1 => 
99 99
         array (
100
-          0 => 
101
-          array (
100
+            0 => 
101
+            array (
102 102
             'name' => 'state',
103 103
             'comment' => 'The state of the case (i.e. open/closed)',
104 104
             'label' => 'LBL_STATE',
105
-          ),
106
-          1 => 'status',
105
+            ),
106
+            1 => 'status',
107 107
         ),
108 108
         2 => 
109 109
         array (
110
-          0 => 'type',
111
-          1 => 'account_name',
110
+            0 => 'type',
111
+            1 => 'account_name',
112 112
         ),
113 113
         3 => 
114 114
         array (
115
-          0 => 
116
-          array (
115
+            0 => 
116
+            array (
117 117
             'name' => 'name',
118 118
             'label' => 'LBL_SUBJECT',
119
-          ),
119
+            ),
120 120
         ),
121 121
         4 => 
122 122
         array (
123
-          0 => 'description',
123
+            0 => 'description',
124 124
         ),
125 125
         5 => 
126 126
         array (
127
-          0 => 'resolution',
127
+            0 => 'resolution',
128 128
         ),
129 129
         6 => 
130 130
         array (
131
-          0 => 
132
-          array (
131
+            0 => 
132
+            array (
133 133
             'name' => 'assigned_user_name',
134 134
             'label' => 'LBL_ASSIGNED_TO',
135
-          ),
135
+            ),
136 136
         ),
137 137
         7 => 
138 138
         array (
139
-          0 => 
140
-          array (
139
+            0 => 
140
+            array (
141 141
             'name' => 'date_entered',
142 142
             'customCode' => '{$fields.date_entered.value} {$APP.LBL_BY} {$fields.created_by_name.value}',
143
-          ),
144
-          1 => 
145
-          array (
143
+            ),
144
+            1 => 
145
+            array (
146 146
             'name' => 'date_modified',
147 147
             'label' => 'LBL_DATE_MODIFIED',
148 148
             'customCode' => '{$fields.date_modified.value} {$APP.LBL_BY} {$fields.modified_by_name.value}',
149
-          ),
149
+            ),
150
+        ),
150 151
         ),
151
-      ),
152
-      'LBL_AOP_CASE_UPDATES' => 
153
-      array (
152
+        'LBL_AOP_CASE_UPDATES' => 
153
+        array (
154 154
         0 => 
155 155
         array (
156
-          0 => 
157
-          array (
156
+            0 => 
157
+            array (
158 158
             'name' => 'aop_case_updates_threaded',
159 159
             'studio' => 'visible',
160 160
             'label' => 'LBL_AOP_CASE_UPDATES_THREADED',
161
-          ),
161
+            ),
162
+        ),
162 163
         ),
163
-      ),
164 164
     ),
165
-  ),
165
+    ),
166 166
 );
167 167
 ?>
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -38,15 +38,15 @@  discard block
 block discarded – undo
38 38
  ********************************************************************************/
39 39
 
40 40
 $viewdefs ['Cases'] = 
41
-array (
41
+array(
42 42
   'DetailView' => 
43
-  array (
43
+  array(
44 44
     'templateMeta' => 
45
-    array (
45
+    array(
46 46
       'form' => 
47
-      array (
47
+      array(
48 48
         'buttons' => 
49
-        array (
49
+        array(
50 50
           0 => 'EDIT',
51 51
           1 => 'DUPLICATE',
52 52
           2 => 'DELETE',
@@ -55,50 +55,50 @@  discard block
 block discarded – undo
55 55
       ),
56 56
       'maxColumns' => '2',
57 57
       'widths' => 
58
-      array (
58
+      array(
59 59
         0 => 
60
-        array (
60
+        array(
61 61
           'label' => '10',
62 62
           'field' => '30',
63 63
         ),
64 64
         1 => 
65
-        array (
65
+        array(
66 66
           'label' => '10',
67 67
           'field' => '30',
68 68
         ),
69 69
       ),
70 70
       'useTabs' => true,
71 71
       'tabDefs' => 
72
-      array (
72
+      array(
73 73
         'LBL_CASE_INFORMATION' => 
74
-        array (
74
+        array(
75 75
           'newTab' => true,
76 76
           'panelDefault' => 'expanded',
77 77
         ),
78 78
         'LBL_AOP_CASE_UPDATES' => 
79
-        array (
79
+        array(
80 80
           'newTab' => false,
81 81
           'panelDefault' => 'expanded',
82 82
         ),
83 83
       ),
84 84
     ),
85 85
     'panels' => 
86
-    array (
86
+    array(
87 87
       'lbl_case_information' => 
88
-      array (
88
+      array(
89 89
         0 => 
90
-        array (
90
+        array(
91 91
           0 => 
92
-          array (
92
+          array(
93 93
             'name' => 'case_number',
94 94
             'label' => 'LBL_CASE_NUMBER',
95 95
           ),
96 96
           1 => 'priority',
97 97
         ),
98 98
         1 => 
99
-        array (
99
+        array(
100 100
           0 => 
101
-          array (
101
+          array(
102 102
             'name' => 'state',
103 103
             'comment' => 'The state of the case (i.e. open/closed)',
104 104
             'label' => 'LBL_STATE',
@@ -106,43 +106,43 @@  discard block
 block discarded – undo
106 106
           1 => 'status',
107 107
         ),
108 108
         2 => 
109
-        array (
109
+        array(
110 110
           0 => 'type',
111 111
           1 => 'account_name',
112 112
         ),
113 113
         3 => 
114
-        array (
114
+        array(
115 115
           0 => 
116
-          array (
116
+          array(
117 117
             'name' => 'name',
118 118
             'label' => 'LBL_SUBJECT',
119 119
           ),
120 120
         ),
121 121
         4 => 
122
-        array (
122
+        array(
123 123
           0 => 'description',
124 124
         ),
125 125
         5 => 
126
-        array (
126
+        array(
127 127
           0 => 'resolution',
128 128
         ),
129 129
         6 => 
130
-        array (
130
+        array(
131 131
           0 => 
132
-          array (
132
+          array(
133 133
             'name' => 'assigned_user_name',
134 134
             'label' => 'LBL_ASSIGNED_TO',
135 135
           ),
136 136
         ),
137 137
         7 => 
138
-        array (
138
+        array(
139 139
           0 => 
140
-          array (
140
+          array(
141 141
             'name' => 'date_entered',
142 142
             'customCode' => '{$fields.date_entered.value} {$APP.LBL_BY} {$fields.created_by_name.value}',
143 143
           ),
144 144
           1 => 
145
-          array (
145
+          array(
146 146
             'name' => 'date_modified',
147 147
             'label' => 'LBL_DATE_MODIFIED',
148 148
             'customCode' => '{$fields.date_modified.value} {$APP.LBL_BY} {$fields.modified_by_name.value}',
@@ -150,11 +150,11 @@  discard block
 block discarded – undo
150 150
         ),
151 151
       ),
152 152
       'LBL_AOP_CASE_UPDATES' => 
153
-      array (
153
+      array(
154 154
         0 => 
155
-        array (
155
+        array(
156 156
           0 => 
157
-          array (
157
+          array(
158 158
             'name' => 'aop_case_updates_threaded',
159 159
             'studio' => 'visible',
160 160
             'label' => 'LBL_AOP_CASE_UPDATES_THREADED',
Please login to merge, or discard this patch.