Completed
Push — console-installer ( 186d32...cb4007 )
by Adam
91:14 queued 78:40
created
include/generic/SugarWidgets/SugarWidgetFieldtext.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
     function queryFilterEquals($layout_def)
51 51
     {
52 52
         return $this->reporter->db->convert($this->_get_column_select($layout_def), "text2char").
53
-        	" = ".$this->reporter->db->quoted($layout_def['input_name0']);
53
+            " = ".$this->reporter->db->quoted($layout_def['input_name0']);
54 54
     }
55 55
 
56 56
     function queryFilterNot_Equals_Str($layout_def)
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 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.
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
     /**
51 51
      * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead
52 52
      */
53
-    function SugarWidgetFieldText(&$layout_manager){
53
+    function SugarWidgetFieldText(&$layout_manager) {
54 54
         $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
55
-        if(isset($GLOBALS['log'])) {
55
+        if (isset($GLOBALS['log'])) {
56 56
             $GLOBALS['log']->deprecated($deprecatedMessage);
57 57
         }
58 58
         else {
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     function queryFilterNot_Equals_Str($layout_def)
72 72
     {
73 73
         $column = $this->_get_column_select($layout_def);
74
-        return "($column IS NULL OR ". $this->reporter->db->convert($column, "text2char")." != ".
74
+        return "($column IS NULL OR ".$this->reporter->db->convert($column, "text2char")." != ".
75 75
             $this->reporter->db->quoted($layout_def['input_name0']).")";
76 76
     }
77 77
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,7 +43,9 @@  discard block
 block discarded – undo
43 43
  * Date: 06/03/15
44 44
  * Comments
45 45
  */
46
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
46
+if(!defined('sugarEntry') || !sugarEntry) {
47
+    die('Not A Valid Entry Point');
48
+}
47 49
 
48 50
 class CasesController extends SugarController {
49 51
 
@@ -90,8 +92,7 @@  discard block
 block discarded – undo
90 92
                 $count++;
91 93
             }
92 94
             echo '</table>';
93
-        }
94
-        else {
95
+        } else {
95 96
             echo $mod_strings['LBL_NO_SUGGESTIONS'];
96 97
         }
97 98
         die();
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelTopSelectAccountButton.php 3 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -44,21 +44,21 @@
 block discarded – undo
44 44
 
45 45
 
46 46
 class SugarWidgetSubPanelTopSelectAccountButton extends SugarWidgetSubPanelTopSelectButton {
47
-	function display($widget_data, $additionalFormFields = NULL, $nonbutton = false)
48
-	{
49
-		/*
47
+    function display($widget_data, $additionalFormFields = NULL, $nonbutton = false)
48
+    {
49
+        /*
50 50
 		* i.dymovsky
51 51
 		* Because when user role can't edit Accounts, it also can't edit Membership Organizations. Select button leads to change MO list
52 52
 		* See bug 25633
53 53
 		* Bug25633 code change start
54 54
 		*/
55
-		if (!ACLController::checkAccess($widget_data["module"], "edit", true)) {
56
-			return ;
57
-		}
58
-		/*
55
+        if (!ACLController::checkAccess($widget_data["module"], "edit", true)) {
56
+            return ;
57
+        }
58
+        /*
59 59
 		* Bug25633 code change end
60 60
 		*/
61 61
 		
62
-		return parent::display($widget_data);
63
-	}
62
+        return parent::display($widget_data);
63
+    }
64 64
 }
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.
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 		* Bug25633 code change start
54 54
 		*/
55 55
 		if (!ACLController::checkAccess($widget_data["module"], "edit", true)) {
56
-			return ;
56
+			return;
57 57
 		}
58 58
 		/*
59 59
 		* Bug25633 code change end
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.
include/generic/SugarWidgets/SugarWidgetFielddatetimecombo.php 3 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -42,28 +42,28 @@
 block discarded – undo
42 42
 
43 43
 
44 44
 class SugarWidgetFieldDateTimecombo extends SugarWidgetFieldDateTime {
45
-	var $reporter;
46
-	var $assigned_user=null;
45
+    var $reporter;
46
+    var $assigned_user=null;
47 47
 
48 48
     function SugarWidgetFieldDateTimecombo(&$layout_manager) {
49 49
         parent::SugarWidgetFieldDateTime($layout_manager);
50 50
         $this->reporter = $this->layout_manager->getAttribute('reporter');
51 51
     }
52
-	//TODO:now for date time field , we just search from date start to date end. The time is from 00:00:00 to 23:59:59
53
-	//If there is requirement, we can modify report.js::addFilterInputDatetimesBetween and this function
54
-	function queryFilterBetween_Datetimes(& $layout_def) {
55
-		global $timedate;
56
-		if($this->getAssignedUser()) {
57
-			$begin = $timedate->handle_offset($layout_def['input_name0'], $timedate->get_db_date_time_format(), false, $this->assigned_user);
58
-			$end = $timedate->handle_offset($layout_def['input_name2'], $timedate->get_db_date_time_format(), false, $this->assigned_user);
59
-		}
60
-		else {
61
-			$begin = $layout_def['input_name0'];
62
-			$end = $layout_def['input_name1'];
63
-		}
64
-		return "(".$this->_get_column_select($layout_def).">=".$this->reporter->db->convert($this->reporter->db->quoted($begin), "datetime").
65
-			" AND\n ".$this->_get_column_select($layout_def)."<=".$this->reporter->db->convert($this->reporter->db->quoted($end), "datetime").
66
-			")\n";
67
-	}
52
+    //TODO:now for date time field , we just search from date start to date end. The time is from 00:00:00 to 23:59:59
53
+    //If there is requirement, we can modify report.js::addFilterInputDatetimesBetween and this function
54
+    function queryFilterBetween_Datetimes(& $layout_def) {
55
+        global $timedate;
56
+        if($this->getAssignedUser()) {
57
+            $begin = $timedate->handle_offset($layout_def['input_name0'], $timedate->get_db_date_time_format(), false, $this->assigned_user);
58
+            $end = $timedate->handle_offset($layout_def['input_name2'], $timedate->get_db_date_time_format(), false, $this->assigned_user);
59
+        }
60
+        else {
61
+            $begin = $layout_def['input_name0'];
62
+            $end = $layout_def['input_name1'];
63
+        }
64
+        return "(".$this->_get_column_select($layout_def).">=".$this->reporter->db->convert($this->reporter->db->quoted($begin), "datetime").
65
+            " AND\n ".$this->_get_column_select($layout_def)."<=".$this->reporter->db->convert($this->reporter->db->quoted($end), "datetime").
66
+            ")\n";
67
+    }
68 68
 
69 69
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !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,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
 class SugarWidgetFieldDateTimecombo extends SugarWidgetFieldDateTime {
45 45
 	var $reporter;
46
-	var $assigned_user=null;
46
+	var $assigned_user = null;
47 47
 
48 48
     function __construct(&$layout_manager) {
49 49
         parent::__construct($layout_manager);
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
     /**
54 54
      * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead
55 55
      */
56
-    function SugarWidgetFieldDateTimecombo(&$layout_manager){
56
+    function SugarWidgetFieldDateTimecombo(&$layout_manager) {
57 57
         $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
58
-        if(isset($GLOBALS['log'])) {
58
+        if (isset($GLOBALS['log'])) {
59 59
             $GLOBALS['log']->deprecated($deprecatedMessage);
60 60
         }
61 61
         else {
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	//If there is requirement, we can modify report.js::addFilterInputDatetimesBetween and this function
69 69
 	function queryFilterBetween_Datetimes(& $layout_def) {
70 70
 		global $timedate;
71
-		if($this->getAssignedUser()) {
71
+		if ($this->getAssignedUser()) {
72 72
 			$begin = $timedate->handle_offset($layout_def['input_name0'], $timedate->get_db_date_time_format(), false, $this->assigned_user);
73 73
 			$end = $timedate->handle_offset($layout_def['input_name2'], $timedate->get_db_date_time_format(), false, $this->assigned_user);
74 74
 		}
Please login to merge, or discard this patch.
Braces   +5 added lines, -5 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.
@@ -57,8 +59,7 @@  discard block
 block discarded – undo
57 59
         $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
58 60
         if(isset($GLOBALS['log'])) {
59 61
             $GLOBALS['log']->deprecated($deprecatedMessage);
60
-        }
61
-        else {
62
+        } else {
62 63
             trigger_error($deprecatedMessage, E_USER_DEPRECATED);
63 64
         }
64 65
         self::__construct($layout_manager);
@@ -71,8 +72,7 @@  discard block
 block discarded – undo
71 72
 		if($this->getAssignedUser()) {
72 73
 			$begin = $timedate->handle_offset($layout_def['input_name0'], $timedate->get_db_date_time_format(), false, $this->assigned_user);
73 74
 			$end = $timedate->handle_offset($layout_def['input_name2'], $timedate->get_db_date_time_format(), false, $this->assigned_user);
74
-		}
75
-		else {
75
+		} else {
76 76
 			$begin = $layout_def['input_name0'];
77 77
 			$end = $layout_def['input_name1'];
78 78
 		}
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelDelegatesSelectButton.php 3 patches
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.
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     {
48 48
         global $mod_strings;
49 49
         $button = "<script src='include/javascript/checkbox.js' type='text/javascript'></script>";
50
-        $button  .= "<form id='CustSelectForm' name='CustSelectForm' method='post' action=''>";
50
+        $button .= "<form id='CustSelectForm' name='CustSelectForm' method='post' action=''>";
51 51
 
52 52
        // $button .= "<input id='custom_hidden_5' type='hidden' name='custom_hidden_5' value=''/>";
53 53
         $button .= "<input id='Custom_Select' class='button' type='button' name='Custom_Select' onclick='select_targets()' value='".$mod_strings['LBL_SELECT_DELEGATES']."'/>\n</form>";	
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
         global $mod_strings;
49 49
         
50 50
         $button  = "<form id='ManageDelegatesForm' name='ManageDelegatesForm' method='post' action=''>";
51
-       // $button .= "<input id='custom_hidden_5' type='hidden' name='custom_hidden_5' value=''/>";
51
+        // $button .= "<input id='custom_hidden_5' type='hidden' name='custom_hidden_5' value=''/>";
52 52
         $button .= "<input id='Manage_Delegates' class='button' type='button' name='Manage_Delegates' onclick='manage_delegates()' value='".$mod_strings['LBL_MANAGE_DELEGATES']."'/>\n</form>";
53 53
         return $button;
54 54
     }
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.
include/generic/SugarWidgets/SugarWidgetSubPanelTopButton_c.php 3 patches
Braces   +33 added lines, -28 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.
@@ -66,31 +68,38 @@  discard block
 block discarded – undo
66 68
 			$class_details = $module;
67 69
 
68 70
 			// If keys were passed into the constructor, translate them from keys to values.
69
-			if(!empty($class_details['module']))
70
-				$this->module = $class_details['module'];
71
-			if(!empty($class_details['title']))
72
-				$this->title = $app_strings[$class_details['title']];
73
-			if(!empty($class_details['access_key']))
74
-				$this->access_key = $app_strings[$class_details['access_key']];
75
-			if(!empty($class_details['form_value']))
76
-				$this->form_value = translate($class_details['form_value'], $this->module);
77
-			if(!empty($class_details['additional_form_fields']))
78
-				$this->additional_form_fields = $class_details['additional_form_fields'];
71
+			if(!empty($class_details['module'])) {
72
+							$this->module = $class_details['module'];
73
+			}
74
+			if(!empty($class_details['title'])) {
75
+							$this->title = $app_strings[$class_details['title']];
76
+			}
77
+			if(!empty($class_details['access_key'])) {
78
+							$this->access_key = $app_strings[$class_details['access_key']];
79
+			}
80
+			if(!empty($class_details['form_value'])) {
81
+							$this->form_value = translate($class_details['form_value'], $this->module);
82
+			}
83
+			if(!empty($class_details['additional_form_fields'])) {
84
+							$this->additional_form_fields = $class_details['additional_form_fields'];
85
+			}
79 86
 			if(!empty($class_details['ACL'])){
80 87
 				$this->acl = $class_details['ACL'];
81 88
 			}
82
-		}
83
-		else
89
+		} else
84 90
 		{
85 91
 			$this->module = $module;
86 92
 
87 93
 			// If keys were passed into the constructor, translate them from keys to values.
88
-			if(!empty($title))
89
-				$this->title = $app_strings[$title];
90
-			if(!empty($access_key))
91
-				$this->access_key = $app_strings[$access_key];
92
-			if(!empty($form_value))
93
-				$this->form_value = translate($form_value, $module);
94
+			if(!empty($title)) {
95
+							$this->title = $app_strings[$title];
96
+			}
97
+			if(!empty($access_key)) {
98
+							$this->access_key = $app_strings[$access_key];
99
+			}
100
+			if(!empty($form_value)) {
101
+							$this->form_value = translate($form_value, $module);
102
+			}
94 103
 		}
95 104
 	}
96 105
 
@@ -116,8 +125,7 @@  discard block
 block discarded – undo
116 125
                 if(!empty($defines['focus']->$value))
117 126
                 {
118 127
                     $additionalFormFields[$key] = $defines['focus']->$value;
119
-                }
120
-                else
128
+                } else
121 129
                 {
122 130
                     $additionalFormFields[$key] = '';
123 131
                 }
@@ -128,8 +136,7 @@  discard block
 block discarded – undo
128 136
 		if(!empty($this->module))
129 137
         {
130 138
             $defines['child_module_name'] = $this->module;
131
-        }
132
-        else
139
+        } else
133 140
         {
134 141
             $defines['child_module_name'] = $defines['module'];
135 142
         }
@@ -161,7 +168,7 @@  discard block
 block discarded – undo
161 168
 
162 169
         if($currentModule == 'Campaigns'){
163 170
             $formValues['return_action'] = "DetailView";
164
-        }else{
171
+        } else{
165 172
             $formValues['return_action'] = $defines['action'];
166 173
             if ( $formValues['return_action'] == 'SubPanelViewer' ) {
167 174
                 $formValues['return_action'] = 'DetailView';
@@ -195,8 +202,7 @@  discard block
 block discarded – undo
195 202
         {
196 203
             if($defines['focus']->object_name=='Contact') {
197 204
                 $additionalFormFields['parent_type'] = 'Accounts';
198
-            }
199
-            else {
205
+            } else {
200 206
                 $additionalFormFields['parent_type'] = $defines['focus']->module_dir;
201 207
             }
202 208
         }
@@ -205,8 +211,7 @@  discard block
 block discarded – undo
205 211
             if($defines['focus']->object_name=='Contact') {
206 212
                 $additionalFormFields['parent_name'] = $defines['focus']->account_name;
207 213
                 $additionalFormFields['account_name'] = $defines['focus']->account_name;
208
-            }
209
-            else {
214
+            } else {
210 215
                 $additionalFormFields['parent_name'] = $defines['focus']->name;
211 216
             }
212 217
         }
Please login to merge, or discard this patch.
Indentation   +98 added lines, -98 removed lines patch added patch discarded remove patch
@@ -46,60 +46,60 @@  discard block
 block discarded – undo
46 46
 class SugarWidgetSubPanelTopButton_c extends SugarWidget
47 47
 {
48 48
     var $module;
49
-	var $title;
50
-	var $access_key;
51
-	var $form_value;
52
-	var $additional_form_fields;
53
-	var $acl;
49
+    var $title;
50
+    var $access_key;
51
+    var $form_value;
52
+    var $additional_form_fields;
53
+    var $acl;
54 54
 
55 55
 //TODO rename defines to layout defs and make it a member variable instead of passing it multiple layers with extra copying.
56 56
 
57
-	/** Take the keys for the strings and look them up.  Module is literal, the rest are label keys
58
-	*/
59
-	function __construct($module='', $title='', $access_key='', $form_value='')
60
-	{
61
-		global $app_strings;
62
-
63
-		if(is_array($module))
64
-		{
65
-			// it is really the class details from the mapping
66
-			$class_details = $module;
67
-
68
-			// If keys were passed into the constructor, translate them from keys to values.
69
-			if(!empty($class_details['module']))
70
-				$this->module = $class_details['module'];
71
-			if(!empty($class_details['title']))
72
-				$this->title = $app_strings[$class_details['title']];
73
-			if(!empty($class_details['access_key']))
74
-				$this->access_key = $app_strings[$class_details['access_key']];
75
-			if(!empty($class_details['form_value']))
76
-				$this->form_value = translate($class_details['form_value'], $this->module);
77
-			if(!empty($class_details['additional_form_fields']))
78
-				$this->additional_form_fields = $class_details['additional_form_fields'];
79
-			if(!empty($class_details['ACL'])){
80
-				$this->acl = $class_details['ACL'];
81
-			}
82
-		}
83
-		else
84
-		{
85
-			$this->module = $module;
86
-
87
-			// If keys were passed into the constructor, translate them from keys to values.
88
-			if(!empty($title))
89
-				$this->title = $app_strings[$title];
90
-			if(!empty($access_key))
91
-				$this->access_key = $app_strings[$access_key];
92
-			if(!empty($form_value))
93
-				$this->form_value = translate($form_value, $module);
94
-		}
95
-	}
57
+    /** Take the keys for the strings and look them up.  Module is literal, the rest are label keys
58
+     */
59
+    function __construct($module='', $title='', $access_key='', $form_value='')
60
+    {
61
+        global $app_strings;
62
+
63
+        if(is_array($module))
64
+        {
65
+            // it is really the class details from the mapping
66
+            $class_details = $module;
67
+
68
+            // If keys were passed into the constructor, translate them from keys to values.
69
+            if(!empty($class_details['module']))
70
+                $this->module = $class_details['module'];
71
+            if(!empty($class_details['title']))
72
+                $this->title = $app_strings[$class_details['title']];
73
+            if(!empty($class_details['access_key']))
74
+                $this->access_key = $app_strings[$class_details['access_key']];
75
+            if(!empty($class_details['form_value']))
76
+                $this->form_value = translate($class_details['form_value'], $this->module);
77
+            if(!empty($class_details['additional_form_fields']))
78
+                $this->additional_form_fields = $class_details['additional_form_fields'];
79
+            if(!empty($class_details['ACL'])){
80
+                $this->acl = $class_details['ACL'];
81
+            }
82
+        }
83
+        else
84
+        {
85
+            $this->module = $module;
86
+
87
+            // If keys were passed into the constructor, translate them from keys to values.
88
+            if(!empty($title))
89
+                $this->title = $app_strings[$title];
90
+            if(!empty($access_key))
91
+                $this->access_key = $app_strings[$access_key];
92
+            if(!empty($form_value))
93
+                $this->form_value = translate($form_value, $module);
94
+        }
95
+    }
96 96
 
97 97
     public function getWidgetId($buttonSuffix = true)
98 98
     {
99
-    	$widgetID = parent::getWidgetId() . '_'.preg_replace('[ ]', '', strtolower($this->form_value));
100
-    	if($buttonSuffix){
101
-    		$widgetID .= '_button';
102
-    	}
99
+        $widgetID = parent::getWidgetId() . '_'.preg_replace('[ ]', '', strtolower($this->form_value));
100
+        if($buttonSuffix){
101
+            $widgetID .= '_button';
102
+        }
103 103
         return $widgetID;
104 104
     }
105 105
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         }
126 126
 
127 127
 
128
-		if(!empty($this->module))
128
+        if(!empty($this->module))
129 129
         {
130 130
             $defines['child_module_name'] = $this->module;
131 131
         }
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         }
136 136
 
137 137
         $defines['parent_bean_name'] = get_class( $defines['focus']);
138
-		$relationship_name = $this->get_subpanel_relationship_name($defines);
138
+        $relationship_name = $this->get_subpanel_relationship_name($defines);
139 139
 
140 140
 
141 141
         $formValues = array();
@@ -150,10 +150,10 @@  discard block
 block discarded – undo
150 150
             // #26451,add these fields for custom one-to-many relate field.
151 151
             if(!empty($defines['child_module_name'])){
152 152
                 $formValues[$relationship_name."_name"] = $defines['focus']->name;
153
-            	$childFocusName = !empty($GLOBALS['beanList'][$defines['child_module_name']]) ? $GLOBALS['beanList'][$defines['child_module_name']] : "";
154
-            	if(!empty($GLOBALS['dictionary'][ $childFocusName ]["fields"][$relationship_name .'_name']['id_name'])){
155
-            		$formValues[$GLOBALS['dictionary'][ $childFocusName ]["fields"][$relationship_name .'_name']['id_name']] = $defines['focus']->id;
156
-            	}
153
+                $childFocusName = !empty($GLOBALS['beanList'][$defines['child_module_name']]) ? $GLOBALS['beanList'][$defines['child_module_name']] : "";
154
+                if(!empty($GLOBALS['dictionary'][ $childFocusName ]["fields"][$relationship_name .'_name']['id_name'])){
155
+                    $formValues[$GLOBALS['dictionary'][ $childFocusName ]["fields"][$relationship_name .'_name']['id_name']] = $defines['focus']->id;
156
+                }
157 157
             }
158 158
         }
159 159
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
                 $additionalFormFields['parent_id'] = $defines['focus']->account_id;
217 217
                 $additionalFormFields['account_id'] = $defines['focus']->account_id;
218 218
             } else if($defines['focus']->object_name=='Contract') {
219
-            	$additionalFormFields['contract_id'] = $defines['focus']->id;
219
+                $additionalFormFields['contract_id'] = $defines['focus']->id;
220 220
             } else {
221 221
                 $additionalFormFields['parent_id'] = $defines['focus']->id;
222 222
             }
@@ -266,17 +266,17 @@  discard block
 block discarded – undo
266 266
         }
267 267
     }
268 268
 
269
-	/** This default function is used to create the HTML for a simple button */
270
-	function display($defines, $additionalFormFields = null, $nonbutton = false)
271
-	{
272
-		$temp='';
273
-		$inputID = $this->getWidgetId();
269
+    /** This default function is used to create the HTML for a simple button */
270
+    function display($defines, $additionalFormFields = null, $nonbutton = false)
271
+    {
272
+        $temp='';
273
+        $inputID = $this->getWidgetId();
274 274
 
275
-		if(!empty($this->acl) && ACLController::moduleSupportsACL($defines['module'])  &&  !ACLController::checkAccess($defines['module'], $this->acl, true)){
276
-			return $temp;
277
-		}
275
+        if(!empty($this->acl) && ACLController::moduleSupportsACL($defines['module'])  &&  !ACLController::checkAccess($defines['module'], $this->acl, true)){
276
+            return $temp;
277
+        }
278 278
 
279
-		global $app_strings;
279
+        global $app_strings;
280 280
 
281 281
         if ( isset($_REQUEST['layout_def_key']) && $_REQUEST['layout_def_key'] == 'UserEAPM' ) {
282 282
             // Subpanels generally don't go on the editview, so we have to handle this special
@@ -289,42 +289,42 @@  discard block
 block discarded – undo
289 289
         }
290 290
 
291 291
         if ($nonbutton) {
292
-           // $button = "<a onclick=''>$this->form_value";
292
+            // $button = "<a onclick=''>$this->form_value";
293 293
         }
294 294
         return $button;
295
-	}
296
-
297
-	/**
298
-	 * Returns a string that is the JSON encoded version of the popup request.
299
-	 * Perhaps this function should be moved to a more globally accessible location?
300
-	 */
301
-	function _create_json_encoded_popup_request($popup_request_data)
302
-	{
303
-	    return json_encode($popup_request_data);
304
-	}
305
-
306
-	/**
307
-	 * get_subpanel_relationship_name
308
-	 * Get the relationship name based on the subapnel definition
309
-	 * @param mixed $defines The subpanel definition
310
-	 */
311
-	function get_subpanel_relationship_name($defines) {
312
-		 $relationship_name = '';
313
-		 if(!empty($defines)) {
314
-		 	$relationship_name = isset($defines['module']) ? $defines['module'] : '';
315
-	     	$dataSource = $defines['subpanel_definition']->get_data_source_name(true);
316
-         	if (!empty($dataSource)) {
317
-				$relationship_name = $dataSource;
318
-				//Try to set the relationship name to the real relationship, not the link.
319
-				if (!empty($defines['subpanel_definition']->parent_bean->field_defs[$dataSource])
320
-				 && !empty($defines['subpanel_definition']->parent_bean->field_defs[$dataSource]['relationship']))
321
-				{
322
-					$relationship_name = $defines['subpanel_definition']->parent_bean->field_defs[$dataSource]['relationship'];
323
-				}
324
-			}
325
-		 }
326
-		 return $relationship_name;
327
-	}
295
+    }
296
+
297
+    /**
298
+     * Returns a string that is the JSON encoded version of the popup request.
299
+     * Perhaps this function should be moved to a more globally accessible location?
300
+     */
301
+    function _create_json_encoded_popup_request($popup_request_data)
302
+    {
303
+        return json_encode($popup_request_data);
304
+    }
305
+
306
+    /**
307
+     * get_subpanel_relationship_name
308
+     * Get the relationship name based on the subapnel definition
309
+     * @param mixed $defines The subpanel definition
310
+     */
311
+    function get_subpanel_relationship_name($defines) {
312
+            $relationship_name = '';
313
+            if(!empty($defines)) {
314
+                $relationship_name = isset($defines['module']) ? $defines['module'] : '';
315
+                $dataSource = $defines['subpanel_definition']->get_data_source_name(true);
316
+                if (!empty($dataSource)) {
317
+                $relationship_name = $dataSource;
318
+                //Try to set the relationship name to the real relationship, not the link.
319
+                if (!empty($defines['subpanel_definition']->parent_bean->field_defs[$dataSource])
320
+                 && !empty($defines['subpanel_definition']->parent_bean->field_defs[$dataSource]['relationship']))
321
+                {
322
+                    $relationship_name = $defines['subpanel_definition']->parent_bean->field_defs[$dataSource]['relationship'];
323
+                }
324
+            }
325
+            }
326
+            return $relationship_name;
327
+    }
328 328
 
329 329
 }
330 330
 ?>
Please login to merge, or discard this patch.
Spacing   +61 added lines, -61 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.
@@ -56,27 +56,27 @@  discard block
 block discarded – undo
56 56
 
57 57
 	/** Take the keys for the strings and look them up.  Module is literal, the rest are label keys
58 58
 	*/
59
-	function __construct($module='', $title='', $access_key='', $form_value='')
59
+	function __construct($module = '', $title = '', $access_key = '', $form_value = '')
60 60
 	{
61 61
 		global $app_strings;
62 62
 
63
-		if(is_array($module))
63
+		if (is_array($module))
64 64
 		{
65 65
 			// it is really the class details from the mapping
66 66
 			$class_details = $module;
67 67
 
68 68
 			// If keys were passed into the constructor, translate them from keys to values.
69
-			if(!empty($class_details['module']))
69
+			if (!empty($class_details['module']))
70 70
 				$this->module = $class_details['module'];
71
-			if(!empty($class_details['title']))
71
+			if (!empty($class_details['title']))
72 72
 				$this->title = $app_strings[$class_details['title']];
73
-			if(!empty($class_details['access_key']))
73
+			if (!empty($class_details['access_key']))
74 74
 				$this->access_key = $app_strings[$class_details['access_key']];
75
-			if(!empty($class_details['form_value']))
75
+			if (!empty($class_details['form_value']))
76 76
 				$this->form_value = translate($class_details['form_value'], $this->module);
77
-			if(!empty($class_details['additional_form_fields']))
77
+			if (!empty($class_details['additional_form_fields']))
78 78
 				$this->additional_form_fields = $class_details['additional_form_fields'];
79
-			if(!empty($class_details['ACL'])){
79
+			if (!empty($class_details['ACL'])) {
80 80
 				$this->acl = $class_details['ACL'];
81 81
 			}
82 82
 		}
@@ -85,19 +85,19 @@  discard block
 block discarded – undo
85 85
 			$this->module = $module;
86 86
 
87 87
 			// If keys were passed into the constructor, translate them from keys to values.
88
-			if(!empty($title))
88
+			if (!empty($title))
89 89
 				$this->title = $app_strings[$title];
90
-			if(!empty($access_key))
90
+			if (!empty($access_key))
91 91
 				$this->access_key = $app_strings[$access_key];
92
-			if(!empty($form_value))
92
+			if (!empty($form_value))
93 93
 				$this->form_value = translate($form_value, $module);
94 94
 		}
95 95
 	}
96 96
 
97 97
     public function getWidgetId($buttonSuffix = true)
98 98
     {
99
-    	$widgetID = parent::getWidgetId() . '_'.preg_replace('[ ]', '', strtolower($this->form_value));
100
-    	if($buttonSuffix){
99
+    	$widgetID = parent::getWidgetId().'_'.preg_replace('[ ]', '', strtolower($this->form_value));
100
+    	if ($buttonSuffix) {
101 101
     		$widgetID .= '_button';
102 102
     	}
103 103
         return $widgetID;
@@ -109,11 +109,11 @@  discard block
 block discarded – undo
109 109
         global $currentModule;
110 110
 
111 111
         // Create the additional form fields with real values if they were not passed in
112
-        if(empty($additionalFormFields) && $this->additional_form_fields)
112
+        if (empty($additionalFormFields) && $this->additional_form_fields)
113 113
         {
114
-            foreach($this->additional_form_fields as $key=>$value)
114
+            foreach ($this->additional_form_fields as $key=>$value)
115 115
             {
116
-                if(!empty($defines['focus']->$value))
116
+                if (!empty($defines['focus']->$value))
117 117
                 {
118 118
                     $additionalFormFields[$key] = $defines['focus']->$value;
119 119
                 }
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         }
126 126
 
127 127
 
128
-		if(!empty($this->module))
128
+		if (!empty($this->module))
129 129
         {
130 130
             $defines['child_module_name'] = $this->module;
131 131
         }
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
             $defines['child_module_name'] = $defines['module'];
135 135
         }
136 136
 
137
-        $defines['parent_bean_name'] = get_class( $defines['focus']);
137
+        $defines['parent_bean_name'] = get_class($defines['focus']);
138 138
 		$relationship_name = $this->get_subpanel_relationship_name($defines);
139 139
 
140 140
 
@@ -144,65 +144,65 @@  discard block
 block discarded – undo
144 144
         $formValues['module'] = $defines['child_module_name'];
145 145
         $formValues[strtolower($defines['parent_bean_name'])."_id"] = $defines['focus']->id;
146 146
 
147
-        if(isset($defines['focus']->name))
147
+        if (isset($defines['focus']->name))
148 148
         {
149 149
             $formValues[strtolower($defines['parent_bean_name'])."_name"] = $defines['focus']->name;
150 150
             // #26451,add these fields for custom one-to-many relate field.
151
-            if(!empty($defines['child_module_name'])){
151
+            if (!empty($defines['child_module_name'])) {
152 152
                 $formValues[$relationship_name."_name"] = $defines['focus']->name;
153 153
             	$childFocusName = !empty($GLOBALS['beanList'][$defines['child_module_name']]) ? $GLOBALS['beanList'][$defines['child_module_name']] : "";
154
-            	if(!empty($GLOBALS['dictionary'][ $childFocusName ]["fields"][$relationship_name .'_name']['id_name'])){
155
-            		$formValues[$GLOBALS['dictionary'][ $childFocusName ]["fields"][$relationship_name .'_name']['id_name']] = $defines['focus']->id;
154
+            	if (!empty($GLOBALS['dictionary'][$childFocusName]["fields"][$relationship_name.'_name']['id_name'])) {
155
+            		$formValues[$GLOBALS['dictionary'][$childFocusName]["fields"][$relationship_name.'_name']['id_name']] = $defines['focus']->id;
156 156
             	}
157 157
             }
158 158
         }
159 159
 
160 160
         $formValues['return_module'] = $currentModule;
161 161
 
162
-        if($currentModule == 'Campaigns'){
162
+        if ($currentModule == 'Campaigns') {
163 163
             $formValues['return_action'] = "DetailView";
164
-        }else{
164
+        } else {
165 165
             $formValues['return_action'] = $defines['action'];
166
-            if ( $formValues['return_action'] == 'SubPanelViewer' ) {
166
+            if ($formValues['return_action'] == 'SubPanelViewer') {
167 167
                 $formValues['return_action'] = 'DetailView';
168 168
             }
169 169
         }
170 170
 
171 171
         $formValues['return_id'] = $defines['focus']->id;
172 172
         $formValues['return_relationship'] = $relationship_name;
173
-        switch ( strtolower( $currentModule ) )
173
+        switch (strtolower($currentModule))
174 174
         {
175 175
             case 'prospects' :
176
-                $name = $defines['focus']->account_name ;
177
-                break ;
176
+                $name = $defines['focus']->account_name;
177
+                break;
178 178
             case 'documents' :
179
-                $name = $defines['focus']->document_name ;
180
-                break ;
179
+                $name = $defines['focus']->document_name;
180
+                break;
181 181
             case 'kbdocuments' :
182
-                $name = $defines['focus']->kbdocument_name ;
183
-                break ;
182
+                $name = $defines['focus']->kbdocument_name;
183
+                break;
184 184
             case 'leads' :
185 185
             case 'contacts' :
186
-                $name = $defines['focus']->first_name . " " .$defines['focus']->last_name ;
187
-                break ;
186
+                $name = $defines['focus']->first_name." ".$defines['focus']->last_name;
187
+                break;
188 188
             default :
189 189
                $name = (isset($defines['focus']->name)) ? $defines['focus']->name : "";
190 190
         }
191 191
         $formValues['return_name'] = $name;
192 192
 
193 193
         // TODO: move this out and get $additionalFormFields working properly
194
-        if(empty($additionalFormFields['parent_type']))
194
+        if (empty($additionalFormFields['parent_type']))
195 195
         {
196
-            if($defines['focus']->object_name=='Contact') {
196
+            if ($defines['focus']->object_name == 'Contact') {
197 197
                 $additionalFormFields['parent_type'] = 'Accounts';
198 198
             }
199 199
             else {
200 200
                 $additionalFormFields['parent_type'] = $defines['focus']->module_dir;
201 201
             }
202 202
         }
203
-        if(empty($additionalFormFields['parent_name']))
203
+        if (empty($additionalFormFields['parent_name']))
204 204
         {
205
-            if($defines['focus']->object_name=='Contact') {
205
+            if ($defines['focus']->object_name == 'Contact') {
206 206
                 $additionalFormFields['parent_name'] = $defines['focus']->account_name;
207 207
                 $additionalFormFields['account_name'] = $defines['focus']->account_name;
208 208
             }
@@ -210,54 +210,54 @@  discard block
 block discarded – undo
210 210
                 $additionalFormFields['parent_name'] = $defines['focus']->name;
211 211
             }
212 212
         }
213
-        if(empty($additionalFormFields['parent_id']))
213
+        if (empty($additionalFormFields['parent_id']))
214 214
         {
215
-            if($defines['focus']->object_name=='Contact') {
215
+            if ($defines['focus']->object_name == 'Contact') {
216 216
                 $additionalFormFields['parent_id'] = $defines['focus']->account_id;
217 217
                 $additionalFormFields['account_id'] = $defines['focus']->account_id;
218
-            } else if($defines['focus']->object_name=='Contract') {
218
+            } else if ($defines['focus']->object_name == 'Contract') {
219 219
             	$additionalFormFields['contract_id'] = $defines['focus']->id;
220 220
             } else {
221 221
                 $additionalFormFields['parent_id'] = $defines['focus']->id;
222 222
             }
223 223
         }
224 224
 
225
-        if ($defines['focus']->object_name=='Opportunity') {
225
+        if ($defines['focus']->object_name == 'Opportunity') {
226 226
             $additionalFormFields['account_id'] = $defines['focus']->account_id;
227 227
             $additionalFormFields['account_name'] = $defines['focus']->account_name;
228 228
         }
229 229
 
230
-        if (!empty($defines['child_module_name']) and $defines['child_module_name']=='Contacts' and !empty($defines['parent_bean_name']) and $defines['parent_bean_name']=='contact' ) {
231
-            if (!empty($defines['focus']->id ) and !empty($defines['focus']->name)) {
230
+        if (!empty($defines['child_module_name']) and $defines['child_module_name'] == 'Contacts' and !empty($defines['parent_bean_name']) and $defines['parent_bean_name'] == 'contact') {
231
+            if (!empty($defines['focus']->id) and !empty($defines['focus']->name)) {
232 232
                 $formValues['reports_to_id'] = $defines['focus']->id;
233 233
                 $formValues['reports_to_name'] = $defines['focus']->name;
234 234
             }
235 235
         }
236 236
         $formValues['action'] = "EditView";
237 237
 
238
-        if ( $asUrl ) {
238
+        if ($asUrl) {
239 239
             $returnLink = '';
240
-            foreach($formValues as $key => $value ) {
240
+            foreach ($formValues as $key => $value) {
241 241
                 $returnLink .= $key.'='.$value.'&';
242 242
             }
243
-            foreach($additionalFormFields as $key => $value ) {
243
+            foreach ($additionalFormFields as $key => $value) {
244 244
                 $returnLink .= $key.'='.$value.'&';
245 245
             }
246
-            $returnLink = rtrim($returnLink,'&');
246
+            $returnLink = rtrim($returnLink, '&');
247 247
 
248 248
             return $returnLink;
249 249
         } else {
250 250
 
251
-            $form = 'form' . $relationship_name;
252
-            $button = '<form action="index.php" method="post" name="form" id="' . $form . "\">\n";
253
-            foreach($formValues as $key => $value) {
254
-                $button .= "<input type='hidden' name='" . $key . "' value='" . $value . "' />\n";
251
+            $form = 'form'.$relationship_name;
252
+            $button = '<form action="index.php" method="post" name="form" id="'.$form."\">\n";
253
+            foreach ($formValues as $key => $value) {
254
+                $button .= "<input type='hidden' name='".$key."' value='".$value."' />\n";
255 255
             }
256 256
 
257 257
             // fill in additional form fields for all but action
258
-            foreach($additionalFormFields as $key => $value) {
259
-                if($key != 'action') {
260
-                    $button .= "<input type='hidden' name='" . $key . "' value='" . $value . "' />\n";
258
+            foreach ($additionalFormFields as $key => $value) {
259
+                if ($key != 'action') {
260
+                    $button .= "<input type='hidden' name='".$key."' value='".$value."' />\n";
261 261
                 }
262 262
             }
263 263
 
@@ -269,18 +269,18 @@  discard block
 block discarded – undo
269 269
 	/** This default function is used to create the HTML for a simple button */
270 270
 	function display($defines, $additionalFormFields = null, $nonbutton = false)
271 271
 	{
272
-		$temp='';
272
+		$temp = '';
273 273
 		$inputID = $this->getWidgetId();
274 274
 
275
-		if(!empty($this->acl) && ACLController::moduleSupportsACL($defines['module'])  &&  !ACLController::checkAccess($defines['module'], $this->acl, true)){
275
+		if (!empty($this->acl) && ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], $this->acl, true)) {
276 276
 			return $temp;
277 277
 		}
278 278
 
279 279
 		global $app_strings;
280 280
 
281
-        if ( isset($_REQUEST['layout_def_key']) && $_REQUEST['layout_def_key'] == 'UserEAPM' ) {
281
+        if (isset($_REQUEST['layout_def_key']) && $_REQUEST['layout_def_key'] == 'UserEAPM') {
282 282
             // Subpanels generally don't go on the editview, so we have to handle this special
283
-            $megaLink = $this->_get_form($defines, $additionalFormFields,true);
283
+            $megaLink = $this->_get_form($defines, $additionalFormFields, true);
284 284
             //$button = "<input title='$this->title' accesskey='$this->access_key' class='button' type='submit' name='$inputID' id='$inputID' value='$this->form_value' onclick='javascript:document.location=\"index.php?".$megaLink."\"; return false;'/>";
285 285
         } else {
286 286
             $button = $this->_get_form($defines, $additionalFormFields);
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 	 */
311 311
 	function get_subpanel_relationship_name($defines) {
312 312
 		 $relationship_name = '';
313
-		 if(!empty($defines)) {
313
+		 if (!empty($defines)) {
314 314
 		 	$relationship_name = isset($defines['module']) ? $defines['module'] : '';
315 315
 	     	$dataSource = $defines['subpanel_definition']->get_data_source_name(true);
316 316
          	if (!empty($dataSource)) {
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelRelFieldEditButton.php 3 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -45,14 +45,14 @@  discard block
 block discarded – undo
45 45
 //TODO Rename this to edit link
46 46
 class SugarWidgetSubPanelRelFieldEditButton extends SugarWidgetField
47 47
 {
48
-	function displayHeaderCell(&$layout_def)
49
-	{
50
-		return '&nbsp;';
51
-	}
48
+    function displayHeaderCell(&$layout_def)
49
+    {
50
+        return '&nbsp;';
51
+    }
52 52
 
53
-	function displayList(&$layout_def)
54
-	{
55
-		die("<pre>" . print_r($layout_def, true) . "</pre>");
53
+    function displayList(&$layout_def)
54
+    {
55
+        die("<pre>" . print_r($layout_def, true) . "</pre>");
56 56
 
57 57
         $rel = $layout_def['linked_field'];
58 58
         $module = $layout_def['module'];
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
 
61 61
         global $app_strings;
62 62
 
63
-		$edit_icon_html = SugarThemeRegistry::current()->getImage( 'edit_inline',
64
-			'align="absmiddle" alt="' . $app_strings['LNK_EDIT'] . '" border="0"');
63
+        $edit_icon_html = SugarThemeRegistry::current()->getImage( 'edit_inline',
64
+            'align="absmiddle" alt="' . $app_strings['LNK_EDIT'] . '" border="0"');
65 65
 
66 66
         $script = "
67 67
         function editRel(name, id, module) {
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
 		}";
90 90
 
91 91
         return "<script>$script</script>"
92
-             . '<div onclick="editRel(\'p1_b1_accounts\', \'cac203f3-0380-495f-3231-4cf58f089f00\', \'Accounts\')">'
93
-             . $edit_icon_html . "</div>";
94
-	}
92
+                . '<div onclick="editRel(\'p1_b1_accounts\', \'cac203f3-0380-495f-3231-4cf58f089f00\', \'Accounts\')">'
93
+                . $edit_icon_html . "</div>";
94
+    }
95 95
 		
96 96
 }
97 97
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !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.
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 	function displayList(&$layout_def)
54 54
 	{
55
-		die("<pre>" . print_r($layout_def, true) . "</pre>");
55
+		die("<pre>".print_r($layout_def, true)."</pre>");
56 56
 
57 57
         $rel = $layout_def['linked_field'];
58 58
         $module = $layout_def['module'];
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
 
61 61
         global $app_strings;
62 62
 
63
-		$edit_icon_html = SugarThemeRegistry::current()->getImage( 'edit_inline',
64
-			'align="absmiddle" alt="' . $app_strings['LNK_EDIT'] . '" border="0"');
63
+		$edit_icon_html = SugarThemeRegistry::current()->getImage('edit_inline',
64
+			'align="absmiddle" alt="'.$app_strings['LNK_EDIT'].'" border="0"');
65 65
 
66 66
         $script = "
67 67
         function editRel(name, id, module) {
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 
91 91
         return "<script>$script</script>"
92 92
              . '<div onclick="editRel(\'p1_b1_accounts\', \'cac203f3-0380-495f-3231-4cf58f089f00\', \'Accounts\')">'
93
-             . $edit_icon_html . "</div>";
93
+             . $edit_icon_html."</div>";
94 94
 	}
95 95
 		
96 96
 }
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.
include/generic/SugarWidgets/SugarWidgetSubPanelManageDelegatesButton.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
         global $mod_strings;
49 49
         
50 50
         $button  = "<form id='ManageDelegatesForm' name='ManageDelegatesForm' method='post' action=''>";
51
-       // $button .= "<input id='custom_hidden_5' type='hidden' name='custom_hidden_5' value=''/>";
51
+        // $button .= "<input id='custom_hidden_5' type='hidden' name='custom_hidden_5' value=''/>";
52 52
         $button .= "<input id='Manage_Delegates' class='button' type='button' name='Manage_Delegates' onclick='manage_delegates()' value='".$mod_strings['LBL_MANAGE_DELEGATES']."'/>\n</form>";
53 53
         return $button;
54 54
     }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 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.
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.
include/generic/SugarWidgets/SugarWidgetSubPanelTopComposeEmailButton.php 3 patches
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -45,57 +45,57 @@
 block discarded – undo
45 45
 
46 46
 class SugarWidgetSubPanelTopComposeEmailButton extends SugarWidgetSubPanelTopButton
47 47
 {
48
-	var $form_value = '';
48
+    var $form_value = '';
49 49
     
50 50
     public function getWidgetId($buttonSuffix = true)
51 51
     {
52
-    	global $app_strings;
53
-		$this->form_value = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_LABEL'];
54
-    	return parent::getWidgetId();
52
+        global $app_strings;
53
+        $this->form_value = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_LABEL'];
54
+        return parent::getWidgetId();
55 55
     }
56 56
 
57
-	function display($defines, $additionalFormFields = NULL, $nonbutton = false)
58
-	{
59
-		if((ACLController::moduleSupportsACL($defines['module'])  && !ACLController::checkAccess($defines['module'], 'edit', true) ||
60
-			$defines['module'] == "Activities" & !ACLController::checkAccess("Emails", 'edit', true))){
61
-			$temp = '';
62
-			return $temp;
63
-		}
57
+    function display($defines, $additionalFormFields = NULL, $nonbutton = false)
58
+    {
59
+        if((ACLController::moduleSupportsACL($defines['module'])  && !ACLController::checkAccess($defines['module'], 'edit', true) ||
60
+            $defines['module'] == "Activities" & !ACLController::checkAccess("Emails", 'edit', true))){
61
+            $temp = '';
62
+            return $temp;
63
+        }
64 64
 		
65
-		global $app_strings,$current_user,$sugar_config,$beanList,$beanFiles;
66
-		$title = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_TITLE'];
67
-		//$accesskey = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_KEY'];
68
-		$value = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_LABEL'];
69
-		$parent_type = $defines['focus']->module_dir;
70
-		$parent_id = $defines['focus']->id;
65
+        global $app_strings,$current_user,$sugar_config,$beanList,$beanFiles;
66
+        $title = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_TITLE'];
67
+        //$accesskey = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_KEY'];
68
+        $value = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_LABEL'];
69
+        $parent_type = $defines['focus']->module_dir;
70
+        $parent_id = $defines['focus']->id;
71 71
 
72
-		//martin Bug 19660
73
-		$userPref = $current_user->getPreference('email_link_type');
74
-		$defaultPref = $sugar_config['email_default_client'];
75
-		if($userPref != '') {
76
-			$client = $userPref;
77
-		} else {
78
-			$client = $defaultPref;
79
-		}
80
-		if($client != 'sugar') {
81
-			$bean = $defines['focus'];
82
-			// awu: Not all beans have emailAddress property, we must account for this
83
-			if (isset($bean->emailAddress)){
84
-				$to_addrs = $bean->emailAddress->getPrimaryAddress($bean);
85
-				$button = "<input class='button' type='button'  value='$value'  id='". $this->getWidgetId() . "'  name='".preg_replace('[ ]', '', $value)."'   title='$title' onclick=\"location.href='mailto:$to_addrs';return false;\" />";
86
-			}
87
-			else{
88
-				$button = "<input class='button' type='button'  value='$value'  id='". $this->getWidgetId() ."'  name='".preg_replace('[ ]', '', $value)."'  title='$title' onclick=\"location.href='mailto:';return false;\" />";
89
-			}
90
-		} else {
91
-			//Generate the compose package for the quick create options.
92
-    		$composeData = array("parent_id" => $parent_id, "parent_type"=>$parent_type);
72
+        //martin Bug 19660
73
+        $userPref = $current_user->getPreference('email_link_type');
74
+        $defaultPref = $sugar_config['email_default_client'];
75
+        if($userPref != '') {
76
+            $client = $userPref;
77
+        } else {
78
+            $client = $defaultPref;
79
+        }
80
+        if($client != 'sugar') {
81
+            $bean = $defines['focus'];
82
+            // awu: Not all beans have emailAddress property, we must account for this
83
+            if (isset($bean->emailAddress)){
84
+                $to_addrs = $bean->emailAddress->getPrimaryAddress($bean);
85
+                $button = "<input class='button' type='button'  value='$value'  id='". $this->getWidgetId() . "'  name='".preg_replace('[ ]', '', $value)."'   title='$title' onclick=\"location.href='mailto:$to_addrs';return false;\" />";
86
+            }
87
+            else{
88
+                $button = "<input class='button' type='button'  value='$value'  id='". $this->getWidgetId() ."'  name='".preg_replace('[ ]', '', $value)."'  title='$title' onclick=\"location.href='mailto:';return false;\" />";
89
+            }
90
+        } else {
91
+            //Generate the compose package for the quick create options.
92
+            $composeData = array("parent_id" => $parent_id, "parent_type"=>$parent_type);
93 93
             require_once('modules/Emails/EmailUI.php');
94 94
             $eUi = new EmailUI();
95 95
             $j_quickComposeOptions = $eUi->generateComposePackageForQuickCreate($composeData, http_build_query($composeData), false, $defines['focus']);
96 96
 
97 97
             $button = "<input title='$title'  id='". $this->getWidgetId()."'  onclick='SUGAR.quickCompose.init($j_quickComposeOptions);' class='button' type='submit' name='".preg_replace('[ ]', '', $value)."_button' value='$value' />";
98
-		}
99
-		return $button;
100
-	}
98
+        }
99
+        return $button;
100
+    }
101 101
 }
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 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.
@@ -56,13 +56,13 @@  discard block
 block discarded – undo
56 56
 
57 57
 	function display($defines, $additionalFormFields = NULL, $nonbutton = false)
58 58
 	{
59
-		if((ACLController::moduleSupportsACL($defines['module'])  && !ACLController::checkAccess($defines['module'], 'edit', true) ||
60
-			$defines['module'] == "Activities" & !ACLController::checkAccess("Emails", 'edit', true))){
59
+		if ((ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true) ||
60
+			$defines['module'] == "Activities" & !ACLController::checkAccess("Emails", 'edit', true))) {
61 61
 			$temp = '';
62 62
 			return $temp;
63 63
 		}
64 64
 		
65
-		global $app_strings,$current_user,$sugar_config,$beanList,$beanFiles;
65
+		global $app_strings, $current_user, $sugar_config, $beanList, $beanFiles;
66 66
 		$title = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_TITLE'];
67 67
 		//$accesskey = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_KEY'];
68 68
 		$value = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_LABEL'];
@@ -72,20 +72,20 @@  discard block
 block discarded – undo
72 72
 		//martin Bug 19660
73 73
 		$userPref = $current_user->getPreference('email_link_type');
74 74
 		$defaultPref = $sugar_config['email_default_client'];
75
-		if($userPref != '') {
75
+		if ($userPref != '') {
76 76
 			$client = $userPref;
77 77
 		} else {
78 78
 			$client = $defaultPref;
79 79
 		}
80
-		if($client != 'sugar') {
80
+		if ($client != 'sugar') {
81 81
 			$bean = $defines['focus'];
82 82
 			// awu: Not all beans have emailAddress property, we must account for this
83
-			if (isset($bean->emailAddress)){
83
+			if (isset($bean->emailAddress)) {
84 84
 				$to_addrs = $bean->emailAddress->getPrimaryAddress($bean);
85
-				$button = "<input class='button' type='button'  value='$value'  id='". $this->getWidgetId() . "'  name='".preg_replace('[ ]', '', $value)."'   title='$title' onclick=\"location.href='mailto:$to_addrs';return false;\" />";
85
+				$button = "<input class='button' type='button'  value='$value'  id='".$this->getWidgetId()."'  name='".preg_replace('[ ]', '', $value)."'   title='$title' onclick=\"location.href='mailto:$to_addrs';return false;\" />";
86 86
 			}
87
-			else{
88
-				$button = "<input class='button' type='button'  value='$value'  id='". $this->getWidgetId() ."'  name='".preg_replace('[ ]', '', $value)."'  title='$title' onclick=\"location.href='mailto:';return false;\" />";
87
+			else {
88
+				$button = "<input class='button' type='button'  value='$value'  id='".$this->getWidgetId()."'  name='".preg_replace('[ ]', '', $value)."'  title='$title' onclick=\"location.href='mailto:';return false;\" />";
89 89
 			}
90 90
 		} else {
91 91
 			//Generate the compose package for the quick create options.
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
             $eUi = new EmailUI();
95 95
             $j_quickComposeOptions = $eUi->generateComposePackageForQuickCreate($composeData, http_build_query($composeData), false, $defines['focus']);
96 96
 
97
-            $button = "<input title='$title'  id='". $this->getWidgetId()."'  onclick='SUGAR.quickCompose.init($j_quickComposeOptions);' class='button' type='submit' name='".preg_replace('[ ]', '', $value)."_button' value='$value' />";
97
+            $button = "<input title='$title'  id='".$this->getWidgetId()."'  onclick='SUGAR.quickCompose.init($j_quickComposeOptions);' class='button' type='submit' name='".preg_replace('[ ]', '', $value)."_button' value='$value' />";
98 98
 		}
99 99
 		return $button;
100 100
 	}
Please login to merge, or discard this patch.
Braces   +4 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.
@@ -83,8 +85,7 @@  discard block
 block discarded – undo
83 85
 			if (isset($bean->emailAddress)){
84 86
 				$to_addrs = $bean->emailAddress->getPrimaryAddress($bean);
85 87
 				$button = "<input class='button' type='button'  value='$value'  id='". $this->getWidgetId() . "'  name='".preg_replace('[ ]', '', $value)."'   title='$title' onclick=\"location.href='mailto:$to_addrs';return false;\" />";
86
-			}
87
-			else{
88
+			} else{
88 89
 				$button = "<input class='button' type='button'  value='$value'  id='". $this->getWidgetId() ."'  name='".preg_replace('[ ]', '', $value)."'  title='$title' onclick=\"location.href='mailto:';return false;\" />";
89 90
 			}
90 91
 		} else {
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelTopScheduleCallButton.php 3 patches
Indentation   +114 added lines, -114 removed lines patch added patch discarded remove patch
@@ -45,120 +45,120 @@
 block discarded – undo
45 45
 
46 46
 class SugarWidgetSubPanelTopScheduleCallButton extends SugarWidgetSubPanelTopButtonQuickCreate
47 47
 {
48
-	function &_get_form($defines, $additionalFormFields = null, $asUrl = false)
49
-	{
50
-		global $app_strings;
51
-		global $currentModule;
52
-
53
-		$this->module="Calls";
54
-		$this->subpanelDiv = "activities";
55
-
56
-		// Create the additional form fields with real values if they were not passed in
57
-		if(empty($additionalFormFields) && $this->additional_form_fields)
58
-		{
59
-			foreach($this->additional_form_fields as $key=>$value)
60
-			{
61
-				if(!empty($defines['focus']->$value))
62
-				{
63
-					$additionalFormFields[$key] = $defines['focus']->$value;
64
-				}
65
-				else
66
-				{
67
-					$additionalFormFields[$key] = '';
68
-				}
69
-			}
70
-		}
71
-
72
-		if(!empty($this->module))
73
-		{
74
-			$defines['child_module_name'] = $this->module;
75
-		}
76
-		else
77
-		{
78
-			$defines['child_module_name'] = $defines['module'];
79
-		}
80
-
81
-		if(!empty($this->subpanelDiv))
82
-		{
83
-			$defines['subpanelDiv'] = $this->subpanelDiv;
84
-		}
85
-
86
-		$defines['parent_bean_name'] = get_class( $defines['focus']);
87
-
88
-		$form = 'form' . $defines['child_module_name'];
89
-		$button = '<form onsubmit="return SUGAR.subpanelUtils.sendAndRetrieve(this.id, \'subpanel_' . strtolower($defines['subpanelDiv']) . '\', \'' . addslashes($app_strings['LBL_LOADING']) . '\');" action="index.php" method="post" name="form" id="form' . $form . "\">\n";
90
-
91
-		//module_button is used to override the value of module name
92
-		$button .= "<input type='hidden' name='target_module' value='".$defines['child_module_name']."'>\n";
93
-		$button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_id' value='".$defines['focus']->id."'>\n";
94
-
95
-		if(isset($defines['focus']->name))
96
-		{
97
-			$button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_name' value='".$defines['focus']->name."'>";
98
-		}
99
-
100
-		$button .= '<input type="hidden" name="to_pdf" value="true" />';
48
+    function &_get_form($defines, $additionalFormFields = null, $asUrl = false)
49
+    {
50
+        global $app_strings;
51
+        global $currentModule;
52
+
53
+        $this->module="Calls";
54
+        $this->subpanelDiv = "activities";
55
+
56
+        // Create the additional form fields with real values if they were not passed in
57
+        if(empty($additionalFormFields) && $this->additional_form_fields)
58
+        {
59
+            foreach($this->additional_form_fields as $key=>$value)
60
+            {
61
+                if(!empty($defines['focus']->$value))
62
+                {
63
+                    $additionalFormFields[$key] = $defines['focus']->$value;
64
+                }
65
+                else
66
+                {
67
+                    $additionalFormFields[$key] = '';
68
+                }
69
+            }
70
+        }
71
+
72
+        if(!empty($this->module))
73
+        {
74
+            $defines['child_module_name'] = $this->module;
75
+        }
76
+        else
77
+        {
78
+            $defines['child_module_name'] = $defines['module'];
79
+        }
80
+
81
+        if(!empty($this->subpanelDiv))
82
+        {
83
+            $defines['subpanelDiv'] = $this->subpanelDiv;
84
+        }
85
+
86
+        $defines['parent_bean_name'] = get_class( $defines['focus']);
87
+
88
+        $form = 'form' . $defines['child_module_name'];
89
+        $button = '<form onsubmit="return SUGAR.subpanelUtils.sendAndRetrieve(this.id, \'subpanel_' . strtolower($defines['subpanelDiv']) . '\', \'' . addslashes($app_strings['LBL_LOADING']) . '\');" action="index.php" method="post" name="form" id="form' . $form . "\">\n";
90
+
91
+        //module_button is used to override the value of module name
92
+        $button .= "<input type='hidden' name='target_module' value='".$defines['child_module_name']."'>\n";
93
+        $button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_id' value='".$defines['focus']->id."'>\n";
94
+
95
+        if(isset($defines['focus']->name))
96
+        {
97
+            $button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_name' value='".$defines['focus']->name."'>";
98
+        }
99
+
100
+        $button .= '<input type="hidden" name="to_pdf" value="true" />';
101 101
         $button .= '<input type="hidden" name="tpl" value="QuickCreate.tpl" />';
102
-		$button .= '<input type="hidden" name="return_module" value="' . $currentModule . "\" />\n";
103
-		$button .= '<input type="hidden" name="return_action" value="' . $defines['action'] . "\" />\n";
104
-		$button .= '<input type="hidden" name="return_id" value="' . $defines['focus']->id . "\" />\n";
105
-		$button .= '<input type="hidden" name="record" value="" />';
106
-
107
-		// TODO: move this out and get $additionalFormFields working properly
108
-		if(empty($additionalFormFields['parent_type']))
109
-		{
110
-			if($defines['focus']->object_name=='Contact') {
111
-				$additionalFormFields['parent_type'] = 'Accounts';
112
-			}
113
-			else {
114
-				$additionalFormFields['parent_type'] = $defines['focus']->module_dir;
115
-			}
116
-		}
117
-		if(empty($additionalFormFields['parent_name']))
118
-		{
119
-			if($defines['focus']->object_name=='Contact') {
120
-				$additionalFormFields['parent_name'] = $defines['focus']->account_name;
121
-				$additionalFormFields['account_name'] = $defines['focus']->account_name;
122
-			}
123
-			else {
124
-				$additionalFormFields['parent_name'] = $defines['focus']->name;
125
-			}
126
-		}
127
-		if(empty($additionalFormFields['parent_id']))
128
-		{
129
-			if($defines['focus']->object_name=='Contact') {
130
-				$additionalFormFields['parent_id'] = $defines['focus']->account_id;
131
-				$additionalFormFields['account_id'] = $defines['focus']->account_id;
132
-			}
133
-			else {
134
-				$additionalFormFields['parent_id'] = $defines['focus']->id;
135
-			}
136
-		}
137
-
138
-		$button .= '<input type="hidden" name="action" value="SubpanelCreates" />' . "\n";
139
-		$button .= '<input type="hidden" name="module" value="Home" />' . "\n";
140
-		$button .= '<input type="hidden" name="target_action" value="QuickCreate" />' . "\n";
141
-
142
-		// fill in additional form fields for all but action
143
-		foreach($additionalFormFields as $key => $value)
144
-		{
145
-			if($key != 'action')
146
-			{
147
-				$button .= '<input type="hidden" name="' . $key . '" value="' . $value . '" />' . "\n";
148
-			}
149
-		}
150
-		$button .= getVersionedScript('include/SugarFields/Fields/Datetimecombo/Datetimecombo.js')."\n";
151
-		return $button;
152
-	}
153
-
154
-	function display($defines, $additionalFormFields = null, $nonbutton = false)
155
-	{
156
-	    $focus = new Call;
157
-		if ( !$focus->ACLAccess('EditView') ) {
158
-		    return '';
159
-	    }
160
-
161
-		return parent::display($defines, $additionalFormFields);
162
-	}
102
+        $button .= '<input type="hidden" name="return_module" value="' . $currentModule . "\" />\n";
103
+        $button .= '<input type="hidden" name="return_action" value="' . $defines['action'] . "\" />\n";
104
+        $button .= '<input type="hidden" name="return_id" value="' . $defines['focus']->id . "\" />\n";
105
+        $button .= '<input type="hidden" name="record" value="" />';
106
+
107
+        // TODO: move this out and get $additionalFormFields working properly
108
+        if(empty($additionalFormFields['parent_type']))
109
+        {
110
+            if($defines['focus']->object_name=='Contact') {
111
+                $additionalFormFields['parent_type'] = 'Accounts';
112
+            }
113
+            else {
114
+                $additionalFormFields['parent_type'] = $defines['focus']->module_dir;
115
+            }
116
+        }
117
+        if(empty($additionalFormFields['parent_name']))
118
+        {
119
+            if($defines['focus']->object_name=='Contact') {
120
+                $additionalFormFields['parent_name'] = $defines['focus']->account_name;
121
+                $additionalFormFields['account_name'] = $defines['focus']->account_name;
122
+            }
123
+            else {
124
+                $additionalFormFields['parent_name'] = $defines['focus']->name;
125
+            }
126
+        }
127
+        if(empty($additionalFormFields['parent_id']))
128
+        {
129
+            if($defines['focus']->object_name=='Contact') {
130
+                $additionalFormFields['parent_id'] = $defines['focus']->account_id;
131
+                $additionalFormFields['account_id'] = $defines['focus']->account_id;
132
+            }
133
+            else {
134
+                $additionalFormFields['parent_id'] = $defines['focus']->id;
135
+            }
136
+        }
137
+
138
+        $button .= '<input type="hidden" name="action" value="SubpanelCreates" />' . "\n";
139
+        $button .= '<input type="hidden" name="module" value="Home" />' . "\n";
140
+        $button .= '<input type="hidden" name="target_action" value="QuickCreate" />' . "\n";
141
+
142
+        // fill in additional form fields for all but action
143
+        foreach($additionalFormFields as $key => $value)
144
+        {
145
+            if($key != 'action')
146
+            {
147
+                $button .= '<input type="hidden" name="' . $key . '" value="' . $value . '" />' . "\n";
148
+            }
149
+        }
150
+        $button .= getVersionedScript('include/SugarFields/Fields/Datetimecombo/Datetimecombo.js')."\n";
151
+        return $button;
152
+    }
153
+
154
+    function display($defines, $additionalFormFields = null, $nonbutton = false)
155
+    {
156
+        $focus = new Call;
157
+        if ( !$focus->ACLAccess('EditView') ) {
158
+            return '';
159
+        }
160
+
161
+        return parent::display($defines, $additionalFormFields);
162
+    }
163 163
 }
164 164
 ?>
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 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.
@@ -50,15 +50,15 @@  discard block
 block discarded – undo
50 50
 		global $app_strings;
51 51
 		global $currentModule;
52 52
 
53
-		$this->module="Calls";
53
+		$this->module = "Calls";
54 54
 		$this->subpanelDiv = "activities";
55 55
 
56 56
 		// Create the additional form fields with real values if they were not passed in
57
-		if(empty($additionalFormFields) && $this->additional_form_fields)
57
+		if (empty($additionalFormFields) && $this->additional_form_fields)
58 58
 		{
59
-			foreach($this->additional_form_fields as $key=>$value)
59
+			foreach ($this->additional_form_fields as $key=>$value)
60 60
 			{
61
-				if(!empty($defines['focus']->$value))
61
+				if (!empty($defines['focus']->$value))
62 62
 				{
63 63
 					$additionalFormFields[$key] = $defines['focus']->$value;
64 64
 				}
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 			}
70 70
 		}
71 71
 
72
-		if(!empty($this->module))
72
+		if (!empty($this->module))
73 73
 		{
74 74
 			$defines['child_module_name'] = $this->module;
75 75
 		}
@@ -78,45 +78,45 @@  discard block
 block discarded – undo
78 78
 			$defines['child_module_name'] = $defines['module'];
79 79
 		}
80 80
 
81
-		if(!empty($this->subpanelDiv))
81
+		if (!empty($this->subpanelDiv))
82 82
 		{
83 83
 			$defines['subpanelDiv'] = $this->subpanelDiv;
84 84
 		}
85 85
 
86
-		$defines['parent_bean_name'] = get_class( $defines['focus']);
86
+		$defines['parent_bean_name'] = get_class($defines['focus']);
87 87
 
88
-		$form = 'form' . $defines['child_module_name'];
89
-		$button = '<form onsubmit="return SUGAR.subpanelUtils.sendAndRetrieve(this.id, \'subpanel_' . strtolower($defines['subpanelDiv']) . '\', \'' . addslashes($app_strings['LBL_LOADING']) . '\');" action="index.php" method="post" name="form" id="form' . $form . "\">\n";
88
+		$form = 'form'.$defines['child_module_name'];
89
+		$button = '<form onsubmit="return SUGAR.subpanelUtils.sendAndRetrieve(this.id, \'subpanel_'.strtolower($defines['subpanelDiv']).'\', \''.addslashes($app_strings['LBL_LOADING']).'\');" action="index.php" method="post" name="form" id="form'.$form."\">\n";
90 90
 
91 91
 		//module_button is used to override the value of module name
92 92
 		$button .= "<input type='hidden' name='target_module' value='".$defines['child_module_name']."'>\n";
93 93
 		$button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_id' value='".$defines['focus']->id."'>\n";
94 94
 
95
-		if(isset($defines['focus']->name))
95
+		if (isset($defines['focus']->name))
96 96
 		{
97 97
 			$button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_name' value='".$defines['focus']->name."'>";
98 98
 		}
99 99
 
100 100
 		$button .= '<input type="hidden" name="to_pdf" value="true" />';
101 101
         $button .= '<input type="hidden" name="tpl" value="QuickCreate.tpl" />';
102
-		$button .= '<input type="hidden" name="return_module" value="' . $currentModule . "\" />\n";
103
-		$button .= '<input type="hidden" name="return_action" value="' . $defines['action'] . "\" />\n";
104
-		$button .= '<input type="hidden" name="return_id" value="' . $defines['focus']->id . "\" />\n";
102
+		$button .= '<input type="hidden" name="return_module" value="'.$currentModule."\" />\n";
103
+		$button .= '<input type="hidden" name="return_action" value="'.$defines['action']."\" />\n";
104
+		$button .= '<input type="hidden" name="return_id" value="'.$defines['focus']->id."\" />\n";
105 105
 		$button .= '<input type="hidden" name="record" value="" />';
106 106
 
107 107
 		// TODO: move this out and get $additionalFormFields working properly
108
-		if(empty($additionalFormFields['parent_type']))
108
+		if (empty($additionalFormFields['parent_type']))
109 109
 		{
110
-			if($defines['focus']->object_name=='Contact') {
110
+			if ($defines['focus']->object_name == 'Contact') {
111 111
 				$additionalFormFields['parent_type'] = 'Accounts';
112 112
 			}
113 113
 			else {
114 114
 				$additionalFormFields['parent_type'] = $defines['focus']->module_dir;
115 115
 			}
116 116
 		}
117
-		if(empty($additionalFormFields['parent_name']))
117
+		if (empty($additionalFormFields['parent_name']))
118 118
 		{
119
-			if($defines['focus']->object_name=='Contact') {
119
+			if ($defines['focus']->object_name == 'Contact') {
120 120
 				$additionalFormFields['parent_name'] = $defines['focus']->account_name;
121 121
 				$additionalFormFields['account_name'] = $defines['focus']->account_name;
122 122
 			}
@@ -124,9 +124,9 @@  discard block
 block discarded – undo
124 124
 				$additionalFormFields['parent_name'] = $defines['focus']->name;
125 125
 			}
126 126
 		}
127
-		if(empty($additionalFormFields['parent_id']))
127
+		if (empty($additionalFormFields['parent_id']))
128 128
 		{
129
-			if($defines['focus']->object_name=='Contact') {
129
+			if ($defines['focus']->object_name == 'Contact') {
130 130
 				$additionalFormFields['parent_id'] = $defines['focus']->account_id;
131 131
 				$additionalFormFields['account_id'] = $defines['focus']->account_id;
132 132
 			}
@@ -135,16 +135,16 @@  discard block
 block discarded – undo
135 135
 			}
136 136
 		}
137 137
 
138
-		$button .= '<input type="hidden" name="action" value="SubpanelCreates" />' . "\n";
139
-		$button .= '<input type="hidden" name="module" value="Home" />' . "\n";
140
-		$button .= '<input type="hidden" name="target_action" value="QuickCreate" />' . "\n";
138
+		$button .= '<input type="hidden" name="action" value="SubpanelCreates" />'."\n";
139
+		$button .= '<input type="hidden" name="module" value="Home" />'."\n";
140
+		$button .= '<input type="hidden" name="target_action" value="QuickCreate" />'."\n";
141 141
 
142 142
 		// fill in additional form fields for all but action
143
-		foreach($additionalFormFields as $key => $value)
143
+		foreach ($additionalFormFields as $key => $value)
144 144
 		{
145
-			if($key != 'action')
145
+			if ($key != 'action')
146 146
 			{
147
-				$button .= '<input type="hidden" name="' . $key . '" value="' . $value . '" />' . "\n";
147
+				$button .= '<input type="hidden" name="'.$key.'" value="'.$value.'" />'."\n";
148 148
 			}
149 149
 		}
150 150
 		$button .= getVersionedScript('include/SugarFields/Fields/Datetimecombo/Datetimecombo.js')."\n";
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 	function display($defines, $additionalFormFields = null, $nonbutton = false)
155 155
 	{
156 156
 	    $focus = new Call;
157
-		if ( !$focus->ACLAccess('EditView') ) {
157
+		if (!$focus->ACLAccess('EditView')) {
158 158
 		    return '';
159 159
 	    }
160 160
 
Please login to merge, or discard this patch.
Braces   +8 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.
@@ -61,8 +63,7 @@  discard block
 block discarded – undo
61 63
 				if(!empty($defines['focus']->$value))
62 64
 				{
63 65
 					$additionalFormFields[$key] = $defines['focus']->$value;
64
-				}
65
-				else
66
+				} else
66 67
 				{
67 68
 					$additionalFormFields[$key] = '';
68 69
 				}
@@ -72,8 +73,7 @@  discard block
 block discarded – undo
72 73
 		if(!empty($this->module))
73 74
 		{
74 75
 			$defines['child_module_name'] = $this->module;
75
-		}
76
-		else
76
+		} else
77 77
 		{
78 78
 			$defines['child_module_name'] = $defines['module'];
79 79
 		}
@@ -109,8 +109,7 @@  discard block
 block discarded – undo
109 109
 		{
110 110
 			if($defines['focus']->object_name=='Contact') {
111 111
 				$additionalFormFields['parent_type'] = 'Accounts';
112
-			}
113
-			else {
112
+			} else {
114 113
 				$additionalFormFields['parent_type'] = $defines['focus']->module_dir;
115 114
 			}
116 115
 		}
@@ -119,8 +118,7 @@  discard block
 block discarded – undo
119 118
 			if($defines['focus']->object_name=='Contact') {
120 119
 				$additionalFormFields['parent_name'] = $defines['focus']->account_name;
121 120
 				$additionalFormFields['account_name'] = $defines['focus']->account_name;
122
-			}
123
-			else {
121
+			} else {
124 122
 				$additionalFormFields['parent_name'] = $defines['focus']->name;
125 123
 			}
126 124
 		}
@@ -129,8 +127,7 @@  discard block
 block discarded – undo
129 127
 			if($defines['focus']->object_name=='Contact') {
130 128
 				$additionalFormFields['parent_id'] = $defines['focus']->account_id;
131 129
 				$additionalFormFields['account_id'] = $defines['focus']->account_id;
132
-			}
133
-			else {
130
+			} else {
134 131
 				$additionalFormFields['parent_id'] = $defines['focus']->id;
135 132
 			}
136 133
 		}
Please login to merge, or discard this patch.