Passed
Push — scrutinizer-code-quality ( eedb15...27193c )
by Adam
54:15 queued 15s
created
include/SugarFields/Parsers/MetaParser.php 2 patches
Braces   +6 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.
@@ -456,8 +458,9 @@  discard block
 block discarded – undo
456 458
     while ($file = readdir($handler)) {
457 459
         // if $file isn't this directory or its parent,
458 460
         // add it to the results array
459
-        if ($file != '.' && $file != '..')
460
-            $results[] = $file;
461
+        if ($file != '.' && $file != '..') {
462
+                    $results[] = $file;
463
+        }
461 464
     }
462 465
 
463 466
     // tidy up: close the handler
Please login to merge, or discard this patch.
Doc Comments   +23 added lines, -7 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 /**
97 97
  * getFormElementsNames
98 98
  * Parses for the name values of input, select, textarea types from string content
99
- * @param $contents The String contents to parse
99
+ * @param string $contents The String contents to parse
100 100
  * @return $matches Array of name/value pairs
101 101
  */
102 102
 function getFormElementsNames($contents) {
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 /**
109 109
  * getTagAttribute
110 110
  * Returns the name/value of a tag attribute where name is set to $name
111
- * @param $name The name of the attribute
111
+ * @param string $name The name of the attribute
112 112
  * @param $contents The contents to parse
113 113
  * @param $filter Option regular expression to filter value
114 114
  * @return Array of name/value for matching attribute
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
  * and method call getElementsByType("<td>", $contents) returns
164 164
  * "<td>Text <table><tr><td>a</td></tr></table></td>"
165 165
  *
166
- * @param $type The type of element to parse out and return
166
+ * @param string $type The type of element to parse out and return
167 167
  * @return a tag element format Array
168 168
  */
169 169
 function getElementsByType($type, $contents) {
@@ -208,6 +208,7 @@  discard block
 block discarded – undo
208 208
 /**
209 209
  * getElementValue
210 210
  *
211
+ * @param string $type
211 212
  */
212 213
 function getElementValue($type, $contents, $filter = "(.*?)") {
213 214
    $exp = "'<".$type."[^>]*?>".$filter."</".$type."[^>]*?>'si";
@@ -244,7 +245,7 @@  discard block
 block discarded – undo
244 245
  * Returns the highest number of <td>...</td> blocks within a <tr>...</tr> block.
245 246
  * @param $contents The table contents to parse
246 247
  * @param $filter Optional filter to parse for an attribute within the td block.
247
- * @return The maximum column count
248
+ * @return integer maximum column count
248 249
  */
249 250
 function getMaxColumns($contents, $filter) {
250 251
    preg_match_all("'(<tr[^>]*?>)(.*?)(</tr[^>]*?>)'si", $contents, $matches, PREG_SET_ORDER);
@@ -281,6 +282,9 @@  discard block
 block discarded – undo
281 282
  * trimHTML
282 283
  * This function removes the \r (return), \n (newline) and \t (tab) markup from string
283 284
  */
285
+/**
286
+ * @param string $contents
287
+ */
284 288
 function trimHTML($contents) {
285 289
    $contents = str_replace(array("\r"), array(""), $contents);
286 290
    $contents = str_replace(array("\n"), array(""), $contents);
@@ -342,6 +346,9 @@  discard block
 block discarded – undo
342 346
 
343 347
 }
344 348
 
349
+/**
350
+ * @param string $javascript
351
+ */
345 352
 static function parseDelimiters($javascript) {
346 353
 	$newJavascript = '';
347 354
 	$scriptLength = strlen($javascript);
@@ -441,7 +448,7 @@  discard block
 block discarded – undo
441 448
  * dirList
442 449
  * Utility method to list all the files in a given directory.
443 450
  *
444
- * @param $directory The directory to scan
451
+ * @param string $directory The directory to scan
445 452
  * @return $results The files in the directory that were found
446 453
  */
447 454
 function dirList ($directory) {
@@ -496,6 +503,9 @@  discard block
 block discarded – undo
496 503
    return null;
497 504
 }
498 505
 
506
+/**
507
+ * @param string $moduleDir
508
+ */
499 509
 function applyPreRules($moduleDir, $panels) {
500 510
    if(file_exists("include/SugarFields/Parsers/Rules/".$moduleDir."ParseRule.php")) {
501 511
 	  require_once("include/SugarFields/Parsers/Rules/".$moduleDir."ParseRule.php");
@@ -506,6 +516,9 @@  discard block
 block discarded – undo
506 516
    return $panels;
507 517
 }
508 518
 
519
+/**
520
+ * @param string $moduleDir
521
+ */
509 522
 function applyRules($moduleDir, $panels) {
510 523
    return $this->applyPostRules($moduleDir, $panels);
511 524
 }
@@ -537,6 +550,9 @@  discard block
 block discarded – undo
537 550
    return $panels;
538 551
 }
539 552
 
553
+/**
554
+ * @param string $moduleDir
555
+ */
540 556
 function createFileContents($moduleDir, $panels, $templateMeta=array(), $htmlFilePath) {
541 557
 
542 558
 $header = "<?php\n\n";
@@ -587,7 +603,7 @@  discard block
 block discarded – undo
587 603
  * mergePanels
588 604
  * This function merges the $panels Array against the $masterCopy's meta data definition
589 605
  * @param $panels meta data Array to merge
590
- * @param $moduleDir Directory name of the module
606
+ * @param string $moduleDir Directory name of the module
591 607
  * @param $masterCopy file path to the meta data master copy
592 608
  * @return Array of merged $panel definition
593 609
  */
@@ -680,7 +696,7 @@  discard block
 block discarded – undo
680 696
  * mergeTemplateMeta
681 697
  * This function merges the $templateMeta Array against the $masterCopy's meta data definition
682 698
  * @param $templateMeta meta data Array to merge
683
- * @param $moduleDir Directory name of the module
699
+ * @param string $moduleDir Directory name of the module
684 700
  * @param $masterCopy file path to the meta data master copy
685 701
  * @return Array of merged $templateMeta definition
686 702
  */
Please login to merge, or discard this patch.
include/SugarFields/SugarFieldHandler.php 2 patches
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -91,10 +91,10 @@  discard block
 block discarded – undo
91 91
         		$file = 'custom/include/SugarFields/Fields/' . $field . '/SugarField' . $field. '.php';
92 92
                 $type = $field;
93 93
 			//else check the fields directory
94
-			}else if(file_exists('include/SugarFields/Fields/' . $field . '/SugarField' . $field. '.php')){
94
+			} else if(file_exists('include/SugarFields/Fields/' . $field . '/SugarField' . $field. '.php')){
95 95
            		$file = 'include/SugarFields/Fields/' . $field . '/SugarField' . $field. '.php';
96 96
                 $type = $field;
97
-        	}else{
97
+        	} else{
98 98
                 // No direct class, check the directories to see if they are defined
99 99
         		if( $returnNullIfBase &&
100 100
                     !is_dir('custom/include/SugarFields/Fields/'.$field) &&
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 			$customClass = 'Custom' . $class;
112 112
         	if(class_exists($customClass)){
113 113
         		$sugarFieldObjects[$field] = new $customClass($field);
114
-        	}else{
114
+        	} else{
115 115
         		$sugarFieldObjects[$field] = new $class($field);
116 116
         	}
117 117
         }
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -47,6 +47,9 @@
 block discarded – undo
47 47
     function SugarFieldHandler() {
48 48
     }
49 49
 
50
+    /**
51
+     * @param string $field
52
+     */
50 53
     static function fixupFieldType($field) {
51 54
             switch($field) {
52 55
                case 'double':
Please login to merge, or discard this patch.
SugarFields/Fields/Assigned_user_name/SugarFieldAssigned_user_name.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
 		if(!empty($vardef['function']['returns']) && $vardef['function']['returns']== 'html'){
47 47
     	   $this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
48 48
            return $this->fetch($this->findTemplate('EditViewFunction'));
49
-    	}else{
49
+    	} else{
50 50
     	   $this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
51 51
            return $this->fetch($this->findTemplate('SearchView'));
52 52
     	}
Please login to merge, or discard this patch.
include/SugarEmailAddress/SugarEmailAddress.php 2 patches
Braces   +39 added lines, -26 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.
@@ -132,8 +134,9 @@  discard block
 block discarded – undo
132 134
         $alternate_found = false;
133 135
         $alternate2_found = false;
134 136
         foreach($this->addresses as $k=>$address) {
135
-            if ($primary_found && $alternate_found)
136
-                break;
137
+            if ($primary_found && $alternate_found) {
138
+                            break;
139
+            }
137 140
             if ($address['primary_address'] == 1 && !$primary_found) {
138 141
                 $primary_index = $k;
139 142
                 $primary_found = true;
@@ -271,8 +274,9 @@  discard block
 block discarded – undo
271 274
         )
272 275
     {
273 276
         $emailCaps = strtoupper(trim($email));
274
-        if(empty($emailCaps))
275
-            return 0;
277
+        if(empty($emailCaps)) {
278
+                    return 0;
279
+        }
276 280
 
277 281
         $q = "SELECT *
278 282
                 FROM email_addr_bean_rel eabl JOIN email_addresses ea
@@ -288,7 +292,9 @@  discard block
 block discarded – undo
288 292
 
289 293
         // do it this way to make the count accurate in oracle
290 294
         $i = 0;
291
-        while ($this->db->fetchByAssoc($r)) ++$i;
295
+        while ($this->db->fetchByAssoc($r)) {
296
+            ++$i;
297
+        }
292 298
 
293 299
         return $i;
294 300
     }
@@ -471,8 +477,9 @@  discard block
 block discarded – undo
471 477
                     foreach($_REQUEST as $k => $v) {
472 478
                         if(preg_match('/'.$eId.'emailAddressVerifiedValue[0-9]+$/i', $k) && !empty($v)) {
473 479
                             $validateFlag = str_replace("Value", "Flag", $k);
474
-                            if (isset($_REQUEST[$validateFlag]) && $_REQUEST[$validateFlag] == "true")
475
-                              $new_addrs[$k] = $v;
480
+                            if (isset($_REQUEST[$validateFlag]) && $_REQUEST[$validateFlag] == "true") {
481
+                                                          $new_addrs[$k] = $v;
482
+                            }
476 483
                         }
477 484
                     }
478 485
                 }
@@ -675,8 +682,7 @@  discard block
 block discarded – undo
675 682
         if ($id) {
676 683
             $r = $this->db->query("SELECT * FROM email_addresses WHERE id='".$this->db->quote($id)."'");
677 684
             $current_email = $this->db->fetchByAssoc($r);
678
-        }
679
-        else {
685
+        } else {
680 686
             $current_email = null;
681 687
         }
682 688
 
@@ -716,8 +722,7 @@  discard block
 block discarded – undo
716 722
                 $upd_r = $this->db->query($upd_q);
717 723
             }
718 724
             return $duplicate_email['id'];
719
-        }
720
-        else {
725
+        } else {
721 726
             // no case-insensitive address match - it's new, or undeleted.
722 727
             $guid = '';
723 728
             if(!empty($address)){
@@ -783,8 +788,7 @@  discard block
 block discarded – undo
783 788
             // otherwise
784 789
             $q .= "
785 790
                 ORDER BY ear.reply_to_address DESC";
786
-        }
787
-        else
791
+        } else
788 792
         {
789 793
             // retrieve reply-to address only
790 794
             $q .= "
@@ -835,8 +839,9 @@  discard block
 block discarded – undo
835 839
      */
836 840
     function getEmailAddressWidgetEditView($id, $module, $asMetadata=false, $tpl='',$tabindex='0')
837 841
     {
838
-        if ( !($this->smarty instanceOf Sugar_Smarty ) )
839
-            $this->smarty = new Sugar_Smarty();
842
+        if ( !($this->smarty instanceOf Sugar_Smarty ) ) {
843
+                    $this->smarty = new Sugar_Smarty();
844
+        }
840 845
 
841 846
         global $app_strings, $dictionary, $beanList;
842 847
 
@@ -854,8 +859,9 @@  discard block
 block discarded – undo
854 859
         if(!empty($id)) {
855 860
             $prefillDataArr = $this->getAddressesByGUID($id, $module);
856 861
             //When coming from convert leads, sometimes module is Contacts while the id is for a lead.
857
-            if (empty($prefillDataArr) && $module == "Contacts")
858
-                $prefillDataArr = $this->getAddressesByGUID($id, "Leads");
862
+            if (empty($prefillDataArr) && $module == "Contacts") {
863
+                            $prefillDataArr = $this->getAddressesByGUID($id, "Leads");
864
+            }
859 865
         } else if(isset($_REQUEST['full_form']) && !empty($_REQUEST['emailAddressWidget'])){
860 866
             $widget_id = isset($_REQUEST[$module . '_email_widget_id']) ? $_REQUEST[$module . '_email_widget_id'] : '0';
861 867
             $count = 0;
@@ -880,8 +886,9 @@  discard block
 block discarded – undo
880 886
 
881 887
         $required = false;
882 888
         $vardefs = $dictionary[$beanList[$passedModule]]['fields'];
883
-        if (!empty($vardefs['email1']) && isset($vardefs['email1']['required']) && $vardefs['email1']['required'])
884
-            $required = true;
889
+        if (!empty($vardefs['email1']) && isset($vardefs['email1']['required']) && $vardefs['email1']['required']) {
890
+                    $required = true;
891
+        }
885 892
         $this->smarty->assign('required', $required);
886 893
 
887 894
         $this->smarty->assign('module', $saveModule);
@@ -935,13 +942,16 @@  discard block
 block discarded – undo
935 942
      */
936 943
     function getEmailAddressWidgetDetailView($focus, $tpl='')
937 944
     {
938
-        if ( !($this->smarty instanceOf Sugar_Smarty ) )
939
-            $this->smarty = new Sugar_Smarty();
945
+        if ( !($this->smarty instanceOf Sugar_Smarty ) ) {
946
+                    $this->smarty = new Sugar_Smarty();
947
+        }
940 948
 
941 949
         global $app_strings;
942 950
         global $current_user;
943 951
         $assign = array();
944
-        if(empty($focus->id))return '';
952
+        if(empty($focus->id)) {
953
+            return '';
954
+        }
945 955
         $prefillData = $this->getAddressesByGUID($focus->id, $focus->module_dir);
946 956
 
947 957
         foreach($prefillData as $addressItem) {
@@ -970,8 +980,9 @@  discard block
 block discarded – undo
970 980
      */
971 981
     function getEmailAddressWidgetDuplicatesView($focus)
972 982
     {
973
-        if ( !($this->smarty instanceOf Sugar_Smarty ) )
974
-            $this->smarty = new Sugar_Smarty();
983
+        if ( !($this->smarty instanceOf Sugar_Smarty ) ) {
984
+                    $this->smarty = new Sugar_Smarty();
985
+        }
975 986
 
976 987
         $count = 0;
977 988
         $emails = array();
@@ -1131,7 +1142,9 @@  discard block
 block discarded – undo
1131 1142
 
1132 1143
         if($view == 'EditView' || $view == 'QuickCreate' || $view == 'ConvertLead') {
1133 1144
             $module = $focus->module_dir;
1134
-            if ($view == 'ConvertLead' && $module == "Contacts")  $module = "Leads";
1145
+            if ($view == 'ConvertLead' && $module == "Contacts") {
1146
+                $module = "Leads";
1147
+            }
1135 1148
 
1136 1149
             return $sea->getEmailAddressWidgetEditView($focus->id, $module, false,'',$tabindex);
1137 1150
         }
Please login to merge, or discard this patch.
Doc Comments   +10 added lines, -16 removed lines patch added patch discarded remove patch
@@ -80,8 +80,6 @@  discard block
 block discarded – undo
80 80
 
81 81
     /**
82 82
      * Legacy email address handling.  This is to allow support for SOAP or customizations
83
-     * @param string $id
84
-     * @param string $module
85 83
      */
86 84
     function handleLegacySave($bean, $prefix = "") {
87 85
         if(!isset($_REQUEST) || !isset($_REQUEST['useEmailWidget'])) {
@@ -166,12 +164,6 @@  discard block
 block discarded – undo
166 164
 
167 165
     /**
168 166
      * Saves email addresses for a parent bean
169
-     * @param string $id Parent bean ID
170
-     * @param string $module Parent bean's module
171
-     * @param array $addresses Override of $_REQUEST vars, used to handle non-standard bean saves
172
-     * @param string $primary GUID of primary address
173
-     * @param string $replyTo GUID of reply-to address
174
-     * @param string $invalid GUID of invalid address
175 167
      */
176 168
     public function save($check_notify = FALSE) {
177 169
         $args = func_get_args();
@@ -369,7 +361,6 @@  discard block
 block discarded – undo
369 361
      * Saves email addresses for a parent bean
370 362
      * @param string $id Parent bean ID
371 363
      * @param string $module Parent bean's module
372
-     * @param array $addresses Override of $_REQUEST vars, used to handle non-standard bean saves
373 364
      * @param string $primary GUID of primary address
374 365
      * @param string $replyTo GUID of reply-to address
375 366
      * @param string $invalid GUID of invalid address
@@ -620,7 +611,7 @@  discard block
 block discarded – undo
620 611
 
621 612
     /**
622 613
      * preps a passed email address for email address storage
623
-     * @param array $addr Address in focus, must be RFC compliant
614
+     * @param string $addr Address in focus, must be RFC compliant
624 615
      * @return string $id email_addresses ID
625 616
      */
626 617
     function getEmailGUID($addr) {
@@ -733,7 +724,8 @@  discard block
 block discarded – undo
733 724
  
734 725
     /**
735 726
      * Returns Primary or newest email address
736
-     * @param object $focus Object in focus
727
+     * @param boolean $focus Object in focus
728
+     * @param string $parent_type
737 729
      * @return string email
738 730
      */
739 731
     function getPrimaryAddress($focus,$parent_id=null,$parent_type=null) {
@@ -804,7 +796,7 @@  discard block
 block discarded – undo
804 796
      * Returns all email addresses by parent's GUID
805 797
      * @param string $id Parent's GUID
806 798
      * @param string $module Parent's module
807
-     * @return array
799
+     * @return string
808 800
      */
809 801
     function getAddressesByGUID($id, $module) {
810 802
         $return = array();
@@ -828,7 +820,6 @@  discard block
 block discarded – undo
828 820
 
829 821
     /**
830 822
      * Returns the HTML/JS for the EmailAddress widget
831
-     * @param string $parent_id ID of parent bean, generally $focus
832 823
      * @param string $module $focus' module
833 824
      * @param bool asMetadata Default false
834 825
      * @return string HTML/JS for widget
@@ -965,7 +956,7 @@  discard block
 block discarded – undo
965 956
 
966 957
     /**
967 958
      * getEmailAddressWidgetDuplicatesView($focus)
968
-     * @param object $focus Bean in focus
959
+     * @param Lead $focus Bean in focus
969 960
      * @return string HTML that contains hidden input values based off of HTML request
970 961
      */
971 962
     function getEmailAddressWidgetDuplicatesView($focus)
@@ -1041,6 +1032,7 @@  discard block
 block discarded – undo
1041 1032
     /**
1042 1033
      * getFormBaseURL
1043 1034
      *
1035
+     * @param SugarBean $focus
1044 1036
      */
1045 1037
     function getFormBaseURL($focus) {
1046 1038
         $get = "";
@@ -1081,13 +1073,15 @@  discard block
 block discarded – undo
1081 1073
 
1082 1074
     }
1083 1075
 
1076
+    /**
1077
+     * @param string $view
1078
+     */
1084 1079
     function setView($view) {
1085 1080
        $this->view = $view;
1086 1081
     }
1087 1082
 
1088 1083
 /**
1089 1084
  * This function is here so the Employees/Users division can be handled cleanly in one place
1090
- * @param object $focus SugarBean
1091 1085
  * @return string The value for the bean_module column in the email_addr_bean_rel table
1092 1086
  */
1093 1087
     function getCorrectedModule(&$module) {
@@ -1119,7 +1113,7 @@  discard block
 block discarded – undo
1119 1113
 
1120 1114
 /**
1121 1115
  * Convenience function for MVC (Mystique)
1122
- * @param object $focus SugarBean
1116
+ * @param SugarBean $focus SugarBean
1123 1117
  * @param string $field unused
1124 1118
  * @param string $value unused
1125 1119
  * @param string $view DetailView or EditView
Please login to merge, or discard this patch.
include/SugarOauth.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@
 block discarded – undo
133 133
             try{
134 134
                 $this->_last = $token = parent::getRequestToken($params);
135 135
                 return array('oauth_token' => $token->getToken(), 'oauth_token_secret' => $token->getTokenSecret());
136
-            }catch(Zend_Oauth_Exception $e){
136
+            } catch(Zend_Oauth_Exception $e){
137 137
                 return array('oauth_token' => '', 'oauth_token_secret' => '');
138 138
             }
139 139
         }
Please login to merge, or discard this patch.
include/formbase.php 2 patches
Braces   +10 added lines, -11 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.
@@ -77,8 +79,9 @@  discard block
 block discarded – undo
77 79
 {
78 80
 	global $current_user;
79 81
 
80
-	if(!empty($_REQUEST[$prefix.'record']) && !$skipRetrieve)
81
-		$focus->retrieve($_REQUEST[$prefix.'record']);
82
+	if(!empty($_REQUEST[$prefix.'record']) && !$skipRetrieve) {
83
+			$focus->retrieve($_REQUEST[$prefix.'record']);
84
+	}
82 85
 
83 86
 	if(!empty($_POST['assigned_user_id']) && 
84 87
 	    ($focus->assigned_user_id != $_POST['assigned_user_id']) && 
@@ -240,8 +243,7 @@  discard block
 block discarded – undo
240 243
     if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] != "")
241 244
 	{
242 245
 		$return_module = $_REQUEST['return_module'];
243
-	}
244
-	else
246
+	} else
245 247
 	{
246 248
 		$return_module = $return_module;
247 249
 	}
@@ -275,14 +277,12 @@  discard block
 block discarded – undo
275 277
 			$return_module = $_REQUEST['module'];
276 278
 			$return_action = $_REQUEST['return_action']; 
277 279
 			// wp: return action needs to be set for one-click close in task list
278
-		} 
279
-		else 
280
+		} else 
280 281
 		{
281 282
 			// if we "Cancel", we go back to the list view.
282 283
 			$return_action = $_REQUEST['return_action'];
283 284
 		}
284
-	}
285
-	else
285
+	} else
286 286
 	{
287 287
 		$return_action = "DetailView";
288 288
 	}
@@ -378,8 +378,7 @@  discard block
 block discarded – undo
378 378
     $focus=BeanFactory::getBean('Prospects');
379 379
     if(is_array($child_id)){
380 380
         $uids = $child_id;
381
-    }
382
-    else{
381
+    } else{
383 382
         $uids = array($child_id);
384 383
     }
385 384
 
Please login to merge, or discard this patch.
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -235,6 +235,9 @@  discard block
 block discarded – undo
235 235
 }
236 236
 
237 237
 //eggsurplus: abstract to simplify unit testing
238
+/**
239
+ * @return string
240
+ */
238 241
 function buildRedirectURL($return_id='', $return_module='') 
239 242
 {
240 243
     if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] != "")
@@ -339,6 +342,9 @@  discard block
 block discarded – undo
339 342
     }
340 343
 }
341 344
 
345
+/**
346
+ * @param string $fieldname
347
+ */
342 348
 function getLikeForEachWord($fieldname, $value, $minsize=4)
343 349
 {
344 350
 	$value = trim($value);
Please login to merge, or discard this patch.
include/Popups/PopupSmarty.php 2 patches
Braces   +45 added lines, -25 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.
@@ -128,8 +130,9 @@  discard block
 block discarded – undo
128 130
         foreach($this->displayColumns as $name => $params) {
129 131
             $this->displayColumns[$name]['width'] = round($this->displayColumns[$name]['width'] / $adjustment, 2);
130 132
             // figure out which contextMenu objectsTypes are required
131
-            if(!empty($params['contextMenu']['objectType']))
132
-                $contextMenuObjectsTypes[$params['contextMenu']['objectType']] = true;
133
+            if(!empty($params['contextMenu']['objectType'])) {
134
+                            $contextMenuObjectsTypes[$params['contextMenu']['objectType']] = true;
135
+            }
133 136
         }
134 137
 		$this->th->ss->assign('displayColumns', $this->displayColumns);
135 138
 
@@ -147,10 +150,17 @@  discard block
 block discarded – undo
147 150
 		$this->th->ss->assign('searchForm', $this->searchForm->display(false));
148 151
         //rrs
149 152
 
150
-		if($this->export) $this->th->ss->assign('exportLink', $this->buildExportLink());
153
+		if($this->export) {
154
+		    $this->th->ss->assign('exportLink', $this->buildExportLink());
155
+		}
151 156
 		$this->th->ss->assign('quickViewLinks', $this->quickViewLinks);
152
-		if($this->mailMerge) $this->th->ss->assign('mergeLink', $this->buildMergeLink()); // still check for mailmerge access
153
-		if($this->mergeduplicates) $this->th->ss->assign('mergedupLink', $this->buildMergeDuplicatesLink());
157
+		if($this->mailMerge) {
158
+		    $this->th->ss->assign('mergeLink', $this->buildMergeLink());
159
+		}
160
+		// still check for mailmerge access
161
+		if($this->mergeduplicates) {
162
+		    $this->th->ss->assign('mergedupLink', $this->buildMergeDuplicatesLink());
163
+		}
154 164
 
155 165
 
156 166
 		if (!empty($_REQUEST['mode']) && strtoupper($_REQUEST['mode']) == 'MULTISELECT') {
@@ -301,7 +311,7 @@  discard block
 block discarded – undo
301 311
 
302 312
 		if(file_exists('custom/modules/'.$this->module.'/metadata/metafiles.php')){
303 313
 			require('custom/modules/'.$this->module.'/metadata/metafiles.php');
304
-		}elseif(file_exists('modules/'.$this->module.'/metadata/metafiles.php')){
314
+		} elseif(file_exists('modules/'.$this->module.'/metadata/metafiles.php')){
305 315
 			require('modules/'.$this->module.'/metadata/metafiles.php');
306 316
 		}
307 317
 
@@ -321,21 +331,24 @@  discard block
 block discarded – undo
321 331
 		$displayColumns = array();
322 332
 		if(!empty($_REQUEST['displayColumns'])) {
323 333
 		    foreach(explode('|', $_REQUEST['displayColumns']) as $num => $col) {
324
-		        if(!empty($listViewDefs[$this->module][$col]))
325
-		            $displayColumns[$col] = $this->listviewdefs[$this->module][$col];
334
+		        if(!empty($listViewDefs[$this->module][$col])) {
335
+		        		            $displayColumns[$col] = $this->listviewdefs[$this->module][$col];
336
+		        }
326 337
 		    }
327
-		}
328
-		else {
338
+		} else {
329 339
 		    foreach($this->listviewdefs[$this->module] as $col => $para) {
330
-		        if(!empty($para['default']) && $para['default'])
331
-		            $displayColumns[$col] = $para;
340
+		        if(!empty($para['default']) && $para['default']) {
341
+		        		            $displayColumns[$col] = $para;
342
+		        }
332 343
 		    }
333 344
 		}
334 345
 		$params['massupdate'] = true;
335 346
 		if(!empty($_REQUEST['orderBy'])) {
336 347
 		    $params['orderBy'] = $_REQUEST['orderBy'];
337 348
 		    $params['overrideOrder'] = true;
338
-		    if(!empty($_REQUEST['sortOrder'])) $params['sortOrder'] = $_REQUEST['sortOrder'];
349
+		    if(!empty($_REQUEST['sortOrder'])) {
350
+		        $params['sortOrder'] = $_REQUEST['sortOrder'];
351
+		    }
339 352
 		}
340 353
 
341 354
 		$lv->displayColumns = $displayColumns;
@@ -453,7 +466,9 @@  discard block
 block discarded – undo
453 466
 
454 467
         // Need to include the default whereStatement
455 468
 		if(!empty($this->_popupMeta['whereStatement'])){
456
-            if(!empty($where))$where .= ' AND ';
469
+            if(!empty($where)) {
470
+                $where .= ' AND ';
471
+            }
457 472
             $where .= $this->_popupMeta['whereStatement'];
458 473
 		}
459 474
 
@@ -472,11 +487,13 @@  discard block
 block discarded – undo
472 487
 				$this->formData[] = array('field' => $data);
473 488
 				$value = '';
474 489
 				$this->customFieldDefs[$data['name']]= $data;
475
-				if(!empty($_REQUEST[$data['name']]))
476
-	            	$value = $_REQUEST[$data['name']];
490
+				if(!empty($_REQUEST[$data['name']])) {
491
+					            	$value = $_REQUEST[$data['name']];
492
+				}
477 493
 	            $this->customFieldDefs[$data['name']]['value'] = $value;
478
-			}else
479
-				$this->formData[] = array('field' => array('name'=>$data));
494
+			} else {
495
+							$this->formData[] = array('field' => array('name'=>$data));
496
+			}
480 497
 		}
481 498
 		$this->fieldDefs = array();
482 499
 		if($this->seed){
@@ -487,13 +504,15 @@  discard block
 block discarded – undo
487 504
 	            //if we have a relate type then reset to name so that we end up with a textbox
488 505
 	            //rather than a select button
489 506
 	            $this->fieldDefs[$name]['name'] = $this->fieldDefs[$name]['name'];
490
-	            if($this->fieldDefs[$name]['type'] == 'relate')
491
-	            	$this->fieldDefs[$name]['type'] = 'name';
507
+	            if($this->fieldDefs[$name]['type'] == 'relate') {
508
+	            	            	$this->fieldDefs[$name]['type'] = 'name';
509
+	            }
492 510
 	            if(isset($this->fieldDefs[$name]['options']) && isset($GLOBALS['app_list_strings'][$this->fieldDefs[$name]['options']])) {
493 511
 	                $this->fieldDefs[$name]['options'] = $GLOBALS['app_list_strings'][$this->fieldDefs[$name]['options']]; // fill in enums
494 512
 	            }
495
-	            if(!empty($_REQUEST[$name]))
496
-	            	$value = $_REQUEST[$name];
513
+	            if(!empty($_REQUEST[$name])) {
514
+	            	            	$value = $_REQUEST[$name];
515
+	            }
497 516
 	            $this->fieldDefs[$name]['value'] = $value;
498 517
 	        }
499 518
 		}
@@ -540,8 +559,9 @@  discard block
 block discarded – undo
540 559
 EOQ;
541 560
 		// if metadata contains custom inputs for the quickcreate
542 561
 		if(!empty($this->_popupMeta['customInput']) && is_array($this->_popupMeta['customInput'])) {
543
-			foreach($this->_popupMeta['customInput'] as $key => $value)
544
-				$formSave .= '<input type="hidden" name="' . $key . '" value="'. $value .'">\n';
562
+			foreach($this->_popupMeta['customInput'] as $key => $value) {
563
+							$formSave .= '<input type="hidden" name="' . $key . '" value="'. $value .'">\n';
564
+			}
545 565
 		}
546 566
 
547 567
 
Please login to merge, or discard this patch.
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -70,6 +70,9 @@  discard block
 block discarded – undo
70 70
     var $module;
71 71
     var $massUpdateData = '';
72 72
 
73
+	/**
74
+	 * @param string $module
75
+	 */
73 76
 	function PopupSmarty($seed, $module){
74 77
 		parent::ListViewSmarty();
75 78
 		$this->th = new TemplateHandler();
@@ -108,6 +111,7 @@  discard block
 block discarded – undo
108 111
      * @param file file Template file to use
109 112
      * @param data array from ListViewData
110 113
      * @param html_var string the corresponding html var in xtpl per row
114
+     * @param string $htmlVar
111 115
      *
112 116
      */
113 117
 	function process($file, $data, $htmlVar) {
Please login to merge, or discard this patch.
include/SubPanel/SubPanelDefinitions.php 2 patches
Braces   +60 added lines, -39 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.
@@ -85,7 +87,9 @@  discard block
 block discarded – undo
85 87
 
86 88
 		$this->_instance_properties = $instance_properties ;
87 89
 
88
-		if(isset($instance_properties['collection_list' ])) $this->base_collection_list = $instance_properties['collection_list' ];
90
+		if(isset($instance_properties['collection_list' ])) {
91
+		    $this->base_collection_list = $instance_properties['collection_list' ];
92
+		}
89 93
 
90 94
 		if(!empty($collections) && isset($instance_properties['collection_list' ])){
91 95
 			foreach($instance_properties['collection_list' ] as $cname => $value){
@@ -277,7 +281,9 @@  discard block
 block discarded – undo
277 281
 				}
278 282
 			}
279 283
 			// if it's empty just dump out as there is nothing to process.
280
-			if(empty($this->sub_subpanels)) return false;
284
+			if(empty($this->sub_subpanels)) {
285
+			    return false;
286
+			}
281 287
 			//Sync displayed list fields across the subpanels
282 288
 			$display_fields = $this->getDisplayFieldsFromCollection($this->sub_subpanels);
283 289
 			$query_fields = array();
@@ -291,10 +297,11 @@  discard block
 block discarded – undo
291 297
 					if (isset($def['vname']) && isset($def['width']))
292 298
 					{
293 299
 						$index++;
294
-						if(!empty($def['alias']))
295
-							$listFieldMap[$key][$def['alias']] = $field;
296
-						else
297
-							$listFieldMap[$key][$field] = $field;
300
+						if(!empty($def['alias'])) {
301
+													$listFieldMap[$key][$def['alias']] = $field;
302
+						} else {
303
+													$listFieldMap[$key][$field] = $field;
304
+						}
298 305
 						if (!isset($display_fields[$def['vname']]))
299 306
 						{
300 307
 							if(sizeof($display_fields) > $index)
@@ -332,13 +339,11 @@  discard block
 block discarded – undo
332 339
 					if (isset($subpanel->panel_definition['list_fields'][$field]))
333 340
 					{
334 341
 						$list_fields[$field] = $subpanel->panel_definition['list_fields'][$field];
335
-					}
336
-					else if ($list_key != $field && isset($subpanel->panel_definition['list_fields'][$list_key]))
342
+					} else if ($list_key != $field && isset($subpanel->panel_definition['list_fields'][$list_key]))
337 343
 					{
338 344
 						$list_fields[$list_key] = $subpanel->panel_definition['list_fields'][$list_key];
339 345
 
340
-					}
341
-					else {
346
+					} else {
342 347
 						$list_fields[$field] = $display_fields[$vname];
343 348
 					}
344 349
 				}
@@ -347,8 +352,7 @@  discard block
 block discarded – undo
347 352
 					if (isset($subpanel->panel_definition['list_fields'][$field]))
348 353
 					{
349 354
 						$list_fields[$field] = $subpanel->panel_definition['list_fields'][$field];
350
-					}
351
-					else {
355
+					} else {
352 356
 						$list_fields[$field] = $def;
353 357
 					}
354 358
 				}
@@ -624,18 +628,22 @@  discard block
 block discarded – undo
624 628
 		global $modListHeader ;
625 629
 		global $modules_exempt_from_availability_check ;
626 630
 
627
-		if (isset ( $this->_visible_tabs_array ))
628
-			return $this->_visible_tabs_array ;
631
+		if (isset ( $this->_visible_tabs_array )) {
632
+					return $this->_visible_tabs_array ;
633
+		}
629 634
 
630
-		if (empty($modListHeader))
631
-		    $modListHeader = query_module_access_list($GLOBALS['current_user']);
635
+		if (empty($modListHeader)) {
636
+				    $modListHeader = query_module_access_list($GLOBALS['current_user']);
637
+		}
632 638
 
633 639
 		$this->_visible_tabs_array = array ( ) ; // bug 16820 - make sure this is an array for the later ksort
634 640
 
635
-		if (isset ( $this->layout_defs [ 'subpanel_setup' ] )) // bug 17434 - belts-and-braces - check that we have some subpanels first
641
+		if (isset ( $this->layout_defs [ 'subpanel_setup' ] )) {
642
+		    // bug 17434 - belts-and-braces - check that we have some subpanels first
636 643
 		{
637 644
 			//retrieve list of hidden subpanels
638 645
 			$hidden_panels = $this->get_hidden_subpanels();
646
+		}
639 647
 
640 648
 			//activities is a special use case in that if it is hidden,
641 649
 			//then the history tab should be hidden too.
@@ -648,8 +656,9 @@  discard block
 block discarded – undo
648 656
 			{
649 657
 				//exclude if this subpanel is hidden from admin screens
650 658
                 $module = $key;
651
-                if ( isset($values_array['module']) )
652
-                    $module = strtolower($values_array['module']);
659
+                if ( isset($values_array['module']) ) {
660
+                                    $module = strtolower($values_array['module']);
661
+                }
653 662
 				 if ($hidden_panels && is_array($hidden_panels) && (in_array($module, $hidden_panels) || array_key_exists($module, $hidden_panels)) ){
654 663
 				 	//this panel is hidden, skip it
655 664
 				 	continue;
@@ -696,8 +705,9 @@  discard block
 block discarded – undo
696 705
 	 */
697 706
 	function load_subpanel ( $name , $reload = false , $original_only = false, $search_query = '', $collections = array() )
698 707
 	{
699
-		if (!is_dir('modules/' . $this->layout_defs [ 'subpanel_setup' ][ strtolower ( $name ) ] [ 'module' ]))
700
-			return false;
708
+		if (!is_dir('modules/' . $this->layout_defs [ 'subpanel_setup' ][ strtolower ( $name ) ] [ 'module' ])) {
709
+					return false;
710
+		}
701 711
 
702 712
 		$subpanel = new aSubPanel ( $name, $this->layout_defs [ 'subpanel_setup' ] [ strtolower ( $name ) ], $this->_focus, $reload, $original_only, $search_query, $collections ) ;
703 713
 
@@ -720,16 +730,19 @@  discard block
 block discarded – undo
720 730
 
721 731
 		if (empty ( $this->layout_defs ) || $reload || (! empty ( $layout_def_key ) && ! isset ( $layout_defs [ $layout_def_key ] )))
722 732
 		{
723
-			if (file_exists ( 'modules/' . $this->_focus->module_dir . '/metadata/subpaneldefs.php' ))
724
-				require ('modules/' . $this->_focus->module_dir . '/metadata/subpaneldefs.php') ;
733
+			if (file_exists ( 'modules/' . $this->_focus->module_dir . '/metadata/subpaneldefs.php' )) {
734
+							require ('modules/' . $this->_focus->module_dir . '/metadata/subpaneldefs.php') ;
735
+			}
725 736
 
726
-			if (! $original_only && file_exists ( 'custom/modules/' . $this->_focus->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php' ))
727
-				require ('custom/modules/' . $this->_focus->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php') ;
737
+			if (! $original_only && file_exists ( 'custom/modules/' . $this->_focus->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php' )) {
738
+							require ('custom/modules/' . $this->_focus->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php') ;
739
+			}
728 740
 
729
-			if (! empty ( $layout_def_key ))
730
-				$this->layout_defs = $layout_defs [ $layout_def_key ] ;
731
-			else
732
-				$this->layout_defs = $layout_defs [ $this->_focus->module_dir ] ;
741
+			if (! empty ( $layout_def_key )) {
742
+							$this->layout_defs = $layout_defs [ $layout_def_key ] ;
743
+			} else {
744
+							$this->layout_defs = $layout_defs [ $this->_focus->module_dir ] ;
745
+			}
733 746
 
734 747
 		}
735 748
 
@@ -785,11 +798,15 @@  discard block
 block discarded – undo
785 798
 		foreach($modules_to_check as $mod_name){
786 799
 
787 800
 			//skip if module name is not in bean list, otherwise get the bean class name
788
-			if(!isset($beanList[$mod_name])) continue;
801
+			if(!isset($beanList[$mod_name])) {
802
+			    continue;
803
+			}
789 804
 			$class = $beanList[$mod_name];
790 805
 
791 806
 			//skip if class name is not in file list, otherwise require the bean file and create new class
792
-			if(!isset($beanFiles[$class]) || !file_exists($beanFiles[$class])) continue;
807
+			if(!isset($beanFiles[$class]) || !file_exists($beanFiles[$class])) {
808
+			    continue;
809
+			}
793 810
 
794 811
 			//retrieve subpanels for this bean
795 812
 			require_once($beanFiles[$class]);
@@ -803,15 +820,20 @@  discard block
 block discarded – undo
803 820
 			foreach( $sub_tabs as $panel_key){
804 821
 				$panel_key = strtolower($panel_key);
805 822
                 $panel_module = $panel_key;
806
-                if ( isset($spd->layout_defs['subpanel_setup'][$panel_key]['module']) )
807
-                    $panel_module = strtolower($spd->layout_defs['subpanel_setup'][$panel_key]['module']);
823
+                if ( isset($spd->layout_defs['subpanel_setup'][$panel_key]['module']) ) {
824
+                                    $panel_module = strtolower($spd->layout_defs['subpanel_setup'][$panel_key]['module']);
825
+                }
808 826
                 //if module_only flag is set, only if it is also in module array
809
-				if($return_tab_modules_only && !array_key_exists($panel_module, $modules_to_check)) continue;
827
+				if($return_tab_modules_only && !array_key_exists($panel_module, $modules_to_check)) {
828
+				    continue;
829
+				}
810 830
 				$panel_key_name = $panel_module;
811 831
 
812 832
 				//group_by_key_name is set to true, then array will hold an entry for each
813 833
 				//subpanel, with the module name prepended in the key
814
-				if($group_by_module) $panel_key_name = $class.'_'.$panel_key_name;
834
+				if($group_by_module) {
835
+				    $panel_key_name = $class.'_'.$panel_key_name;
836
+				}
815 837
 				//add panel name to subpanel array
816 838
 				$spd_arr[$panel_key_name] = $panel_module;
817 839
 			}
@@ -864,12 +886,11 @@  discard block
 block discarded – undo
864 886
 					}
865 887
 
866 888
 
867
-				}else{
889
+				} else{
868 890
 					//no settings found, return empty
869 891
 					return $hidden_subpanels;
870 892
 				}
871
-			}
872
-			else
893
+			} else
873 894
 			{	//no settings found, return empty
874 895
 				return $hidden_subpanels;
875 896
 			}
Please login to merge, or discard this patch.
Doc Comments   +8 added lines patch added patch discarded remove patch
@@ -417,11 +417,19 @@
 block discarded – undo
417 417
 	}
418 418
 
419 419
 	//get value of a property defined at the panel instance level.
420
+
421
+	/**
422
+	 * @param string $name
423
+	 */
420 424
 	function get_inst_prop_value ( $name )
421 425
 	{
422 426
 		return isset($this->_instance_properties[$name]) ? $this->_instance_properties [ $name ] : null;
423 427
 	}
424 428
 	//get value of a property defined at the panel definition level.
429
+
430
+	/**
431
+	 * @param string $name
432
+	 */
425 433
 	function get_def_prop_value ( $name )
426 434
 	{
427 435
 		if (isset ( $this->panel_definition [ $name ] ))
Please login to merge, or discard this patch.
include/SubPanel/SubPanel.php 2 patches
Braces   +20 added lines, -12 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.
@@ -141,8 +143,7 @@  discard block
 block discarded – undo
141 143
 			if(empty($widget_data['widget_class']))
142 144
 			{
143 145
 				$widget_contents .= "widget_class not defined for top subpanel buttons";
144
-			}
145
-			else
146
+			} else
146 147
 			{
147 148
 				$widget_contents .= $layout_manager->widgetDisplay($widget_data);
148 149
 			}
@@ -163,7 +164,7 @@  discard block
 block discarded – undo
163 164
 
164 165
 		if(isset($this->listview)){
165 166
 			$ListView =& $this->listview;
166
-		}else{
167
+		} else{
167 168
 			$ListView = new ListView();
168 169
 		}
169 170
 		$ListView->initNewXTemplate($xTemplatePath,$this->subpanel_defs->mod_strings);
@@ -178,7 +179,9 @@  discard block
 block discarded – undo
178 179
 		$ListView->xTemplateAssign("SUBPANEL_ID", $this->subpanel_id);
179 180
 		$ListView->xTemplateAssign("SUBPANEL_SEARCH", $this->getSearchForm());
180 181
 		$display_sps = '';
181
-		if($this->search_query == '' && empty($this->collections)) $display_sps = 'display:none';
182
+		if($this->search_query == '' && empty($this->collections)) {
183
+		    $display_sps = 'display:none';
184
+		}
182 185
 		$ListView->xTemplateAssign("DISPLAY_SPS",$display_sps);
183 186
 
184 187
 		if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace']))
@@ -311,10 +314,12 @@  discard block
 block discarded – undo
311 314
   		$moduleInstaller = new ModuleInstaller();
312 315
   		$moduleInstaller->silent = true; // make sure that the ModuleInstaller->log() function doesn't echo while rebuilding the layoutdefs
313 316
   		$moduleInstaller->rebuild_layoutdefs();
314
-  		if (file_exists('modules/'.  $panel->parent_bean->module_dir . '/layout_defs.php'))
315
-  			include('modules/'.  $panel->parent_bean->module_dir . '/layout_defs.php');
316
-  		if (file_exists('custom/modules/'.  $panel->parent_bean->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php'))
317
-  			include('custom/modules/'.  $panel->parent_bean->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php');
317
+  		if (file_exists('modules/'.  $panel->parent_bean->module_dir . '/layout_defs.php')) {
318
+  		  			include('modules/'.  $panel->parent_bean->module_dir . '/layout_defs.php');
319
+  		}
320
+  		if (file_exists('custom/modules/'.  $panel->parent_bean->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php')) {
321
+  		  			include('custom/modules/'.  $panel->parent_bean->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php');
322
+  		}
318 323
   }
319 324
 
320 325
 	function get_subpanel_setup($module)
@@ -400,7 +405,9 @@  discard block
 block discarded – undo
400 405
 
401 406
 		$where_clauses = $searchForm->generateSearchWhere(true, $seed->module_dir);
402 407
 
403
-		if (count($where_clauses) > 0 )$this->search_query = '('. implode(' ) AND ( ', $where_clauses) . ')';
408
+		if (count($where_clauses) > 0 ) {
409
+		    $this->search_query = '('. implode(' ) AND ( ', $where_clauses) . ')';
410
+		}
404 411
 		$GLOBALS['log']->info("Subpanel Where Clause: $this->search_query");
405 412
 
406 413
 		return print_r($where_clauses,true);
@@ -436,8 +443,9 @@  discard block
 block discarded – undo
436 443
 
437 444
 			$searchForm->setup($subpanel_searchMetaData, $searchMetaData['searchFields'], 'SubpanelSearchFormGeneric.tpl', 'basic_search');
438 445
 
439
-			if(!empty($this->collections))
440
-				$searchForm->searchFields['collection'] = array();
446
+			if(!empty($this->collections)) {
447
+							$searchForm->searchFields['collection'] = array();
448
+			}
441 449
 
442 450
 			$searchForm->populateFromRequest();
443 451
 
Please login to merge, or discard this patch.
Doc Comments   +10 added lines patch added patch discarded remove patch
@@ -102,6 +102,9 @@  discard block
 block discarded – undo
102 102
 		}
103 103
 	}
104 104
 
105
+	/**
106
+	 * @param string $template_file
107
+	 */
105 108
 	function setTemplateFile($template_file)
106 109
 	{
107 110
 		$this->template_file = $template_file;
@@ -271,6 +274,10 @@  discard block
 block discarded – undo
271 274
   }
272 275
 
273 276
   //saves overrides for defs
277
+
278
+  /**
279
+   * @param string $subsection
280
+   */
274 281
   function saveSubPanelDefOverride( $panel, $subsection, $override){
275 282
   		global $layout_defs, $beanList;
276 283
 
@@ -406,6 +413,9 @@  discard block
 block discarded – undo
406 413
 		return print_r($where_clauses,true);
407 414
 	}
408 415
 
416
+	/**
417
+	 * @param string $module
418
+	 */
409 419
 	function get_searchdefs($module)
410 420
 	{
411 421
 		$thisPanel =& $this->subpanel_defs;
Please login to merge, or discard this patch.