Passed
Push — scrutinizer-code-quality ( eedb15...27193c )
by Adam
54:15 queued 15s
created
include/generic/SugarWidgets/SugarWidgetSubPanelEditButton.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -48,16 +48,16 @@
 block discarded – undo
48 48
     protected static $defs = array();
49 49
     protected static $edit_icon_html;
50 50
 
51
-	function displayHeaderCell($layout_def)
52
-	{
53
-		return '';
54
-	}
51
+    function displayHeaderCell($layout_def)
52
+    {
53
+        return '';
54
+    }
55 55
 
56
-	function displayList($layout_def)
57
-	{
58
-		global $app_strings;
56
+    function displayList($layout_def)
57
+    {
58
+        global $app_strings;
59 59
         global $subpanel_item_count;
60
-		$unique_id = $layout_def['subpanel_id']."_edit_".$subpanel_item_count; //bug 51512
60
+        $unique_id = $layout_def['subpanel_id']."_edit_".$subpanel_item_count; //bug 51512
61 61
 
62 62
         if ($layout_def['EditView']) {
63 63
 
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetFieldtime.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
                 global $timedate;
47 47
                 // i guess qualifier and column_function are the same..
48 48
                 if (! empty($layout_def['column_function']))
49
-                 {
49
+                    {
50 50
                         $func_name = 'displayList'.$layout_def['column_function'];
51 51
                         if ( method_exists($this,$func_name))
52 52
                         {
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
                 $content = $this->displayListPlain($layout_def);
63 63
                 
64 64
                 if(!empty($date)) { // able to get the date context of the time            	
65
-                	$td = explode(' ', $timedate->to_display_date_time($date . ' ' . $content));
66
-	                return $td[1];
65
+                    $td = explode(' ', $timedate->to_display_date_time($date . ' ' . $content));
66
+                    return $td[1];
67 67
                 }
68 68
                 else { // assume there is no time context
69
-                 	return $timedate->to_display_time($content);
69
+                        return $timedate->to_display_time($content);
70 70
                 }
71 71
         }
72 72
 }
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelSelectAllButton.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
     function display($defines, $additionalFormFields = null)
46 46
     {
47 47
         $button  = "<form method='post' action='/index.php?module=MODULE_NAME&action=CUSTOM_ACTION'>";
48
-       // $button .= "<input id='custom_hidden_1' type='hidden' name='custom_hidden_1' value=''/>";
48
+        // $button .= "<input id='custom_hidden_1' type='hidden' name='custom_hidden_1' value=''/>";
49 49
         $button .= "<input class='button' type='submit' name='Custom Save' value='Select All' />\n</form>";
50 50
         return $button;
51 51
     }
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetFieldid.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,10 +42,10 @@
 block discarded – undo
42 42
 class SugarWidgetFieldId extends SugarWidgetReportField
43 43
 {
44 44
 
45
- function queryFilterIs(&$layout_def)
46
- {
47
-		return $this->_get_column_select($layout_def)."='".$GLOBALS['db']->quote($layout_def['input_name0'])."'\n";
48
- }
45
+    function queryFilterIs(&$layout_def)
46
+    {
47
+        return $this->_get_column_select($layout_def)."='".$GLOBALS['db']->quote($layout_def['input_name0'])."'\n";
48
+    }
49 49
 
50 50
 
51 51
 }
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelRemoveButtonAccount.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -43,14 +43,14 @@
 block discarded – undo
43 43
 
44 44
 
45 45
 class SugarWidgetSubPanelRemoveButtonAccount extends SugarWidgetSubPanelRemoveButton {
46
-	/**
47
-	 * 
48
-	 * @see SugarWidgetSubPanelRemoveButton::displayList()
49
-	 */
50
-	function displayList(&$layout_def) {
51
-		if (!$layout_def['EditView']) {
52
-			return false;
53
-		}
54
-		return parent::displayList($layout_def);
55
-	}
46
+    /**
47
+     * 
48
+     * @see SugarWidgetSubPanelRemoveButton::displayList()
49
+     */
50
+    function displayList(&$layout_def) {
51
+        if (!$layout_def['EditView']) {
52
+            return false;
53
+        }
54
+        return parent::displayList($layout_def);
55
+    }
56 56
 }
57 57
\ No newline at end of file
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelActivitiesStatusField.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -46,27 +46,27 @@
 block discarded – undo
46 46
 
47 47
 class SugarWidgetSubPanelActivitiesStatusField extends SugarWidgetField
48 48
 {
49
-	function displayList($layout_def)
50
-	{
51
-		global $current_language;
52
-		$app_list_strings = return_app_list_strings_language($current_language);
49
+    function displayList($layout_def)
50
+    {
51
+        global $current_language;
52
+        $app_list_strings = return_app_list_strings_language($current_language);
53 53
 		
54
-		$module = empty($layout_def['module']) ? '' : $layout_def['module'];
54
+        $module = empty($layout_def['module']) ? '' : $layout_def['module'];
55 55
 		
56
-		if(isset($layout_def['varname']))
57
-		{
58
-			$key = strtoupper($layout_def['varname']);
59
-		}
60
-		else
61
-		{
62
-			$key = $this->_get_column_alias($layout_def);
63
-			$key = strtoupper($key);
64
-		}
56
+        if(isset($layout_def['varname']))
57
+        {
58
+            $key = strtoupper($layout_def['varname']);
59
+        }
60
+        else
61
+        {
62
+            $key = $this->_get_column_alias($layout_def);
63
+            $key = strtoupper($key);
64
+        }
65 65
 
66
-		$value = $layout_def['fields'][$key];
67
-		// cn: bug 5813, removing double-derivation of lang-pack value
68
-		return $value;
69
-	}
66
+        $value = $layout_def['fields'][$key];
67
+        // cn: bug 5813, removing double-derivation of lang-pack value
68
+        return $value;
69
+    }
70 70
 }
71 71
 
72 72
 ?>
73 73
\ No newline at end of file
Please login to merge, or discard this patch.
generic/SugarWidgets/SugarWidgetSubPanelTopScheduleMeetingButton.php 1 patch
Indentation   +116 added lines, -116 removed lines patch added patch discarded remove patch
@@ -45,121 +45,121 @@
 block discarded – undo
45 45
 
46 46
 class SugarWidgetSubPanelTopScheduleMeetingButton 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="Meetings";
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="Meetings";
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
-		$button .= getVersionedScript('cache/include/javascript/sugar_grp_jsolait.js')."\n";
152
-
153
-		return $button;
154
-	}
155
-
156
-	function display($defines, $additionalFormFields = null, $nonbutton = false)
157
-	{
158
-	    $focus = new Meeting;
159
-		if ( !$focus->ACLAccess('EditView') ) {
160
-		    return '';
161
-	    }
162
-
163
-		return parent::display($defines, $additionalFormFields);
164
-	}
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
+        $button .= getVersionedScript('cache/include/javascript/sugar_grp_jsolait.js')."\n";
152
+
153
+        return $button;
154
+    }
155
+
156
+    function display($defines, $additionalFormFields = null, $nonbutton = false)
157
+    {
158
+        $focus = new Meeting;
159
+        if ( !$focus->ACLAccess('EditView') ) {
160
+            return '';
161
+        }
162
+
163
+        return parent::display($defines, $additionalFormFields);
164
+    }
165 165
 }?>
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelCloseButton.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -45,34 +45,34 @@
 block discarded – undo
45 45
 //TODO Rename this to close button field
46 46
 class SugarWidgetSubPanelCloseButton extends SugarWidgetField
47 47
 {
48
-	function displayList($layout_def)
49
-	{
50
-		global $app_strings;
48
+    function displayList($layout_def)
49
+    {
50
+        global $app_strings;
51 51
         global $subpanel_item_count;
52
-		$return_module = $_REQUEST['module'];
53
-		$return_id = $_REQUEST['record'];
54
-		$module_name = $layout_def['module'];
55
-		$record_id = $layout_def['fields']['ID'];
52
+        $return_module = $_REQUEST['module'];
53
+        $return_id = $_REQUEST['record'];
54
+        $module_name = $layout_def['module'];
55
+        $record_id = $layout_def['fields']['ID'];
56 56
         $unique_id = $layout_def['subpanel_id']."_close_".$subpanel_item_count; //bug 51512
57 57
 
58
-		// calls and meetings are held.
59
-		$new_status = 'Held';
58
+        // calls and meetings are held.
59
+        $new_status = 'Held';
60 60
 		
61
-		switch($module_name)
62
-		{
63
-			case 'Tasks':
64
-				$new_status = 'Completed';
65
-				break;
66
-		}
61
+        switch($module_name)
62
+        {
63
+            case 'Tasks':
64
+                $new_status = 'Completed';
65
+                break;
66
+        }
67 67
         
68
-		if ($layout_def['EditView']) {
69
-		    $html = "<a id=\"$unique_id\" onclick='SUGAR.util.closeActivityPanel.show(\"$module_name\",\"$record_id\",\"$new_status\",\"subpanel\",\"{$layout_def['subpanel_id']}\");' >".$app_strings['LNK_CLOSE']."</a>";
70
-		    return $html;
71
-		} else {
72
-		    return '';
73
-		}
68
+        if ($layout_def['EditView']) {
69
+            $html = "<a id=\"$unique_id\" onclick='SUGAR.util.closeActivityPanel.show(\"$module_name\",\"$record_id\",\"$new_status\",\"subpanel\",\"{$layout_def['subpanel_id']}\");' >".$app_strings['LNK_CLOSE']."</a>";
70
+            return $html;
71
+        } else {
72
+            return '';
73
+        }
74 74
 
75
-	}
75
+    }
76 76
 }
77 77
 
78 78
 ?>
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelDeleteButton.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -44,40 +44,40 @@
 block discarded – undo
44 44
 
45 45
 class SugarWidgetSubPanelDeleteButton extends SugarWidgetField
46 46
 {
47
-	function displayList($layout_def)
48
-	{
49
-		global $app_strings;
47
+    function displayList($layout_def)
48
+    {
49
+        global $app_strings;
50 50
         global $subpanel_item_count;
51
-		$return_module = $_REQUEST['module'];
52
-		$return_id = $_REQUEST['record'];
53
-		$module_name = $layout_def['module'];
54
-		$record_id = $layout_def['fields']['ID'];
51
+        $return_module = $_REQUEST['module'];
52
+        $return_id = $_REQUEST['record'];
53
+        $module_name = $layout_def['module'];
54
+        $record_id = $layout_def['fields']['ID'];
55 55
         $unique_id = $layout_def['subpanel_id']."_delete_".$subpanel_item_count; //bug 51512
56 56
 
57
-		// calls and meetings are held.
58
-		$new_status = 'Held';
57
+        // calls and meetings are held.
58
+        $new_status = 'Held';
59 59
 
60
-		switch($module_name)
61
-		{
62
-			case 'Tasks':
63
-				$new_status = 'Completed';
64
-				break;
65
-		}
66
-		$subpanel = $layout_def['subpanel_id'];
67
-		if (isset($layout_def['linked_field_set']) && !empty($layout_def['linked_field_set'])) {
68
-			$linked_field= $layout_def['linked_field_set'] ;
69
-		} else {
70
-			$linked_field = $layout_def['linked_field'];
71
-		}
72
-		$refresh_page = 0;
73
-		if(!empty($layout_def['refresh_page'])){
74
-			$refresh_page = 1;
75
-		}
60
+        switch($module_name)
61
+        {
62
+            case 'Tasks':
63
+                $new_status = 'Completed';
64
+                break;
65
+        }
66
+        $subpanel = $layout_def['subpanel_id'];
67
+        if (isset($layout_def['linked_field_set']) && !empty($layout_def['linked_field_set'])) {
68
+            $linked_field= $layout_def['linked_field_set'] ;
69
+        } else {
70
+            $linked_field = $layout_def['linked_field'];
71
+        }
72
+        $refresh_page = 0;
73
+        if(!empty($layout_def['refresh_page'])){
74
+            $refresh_page = 1;
75
+        }
76 76
 
77
-		$html = "<a id=\"$unique_id\" onclick='return sp_del_conf();' href=\"javascript:sub_p_del('$subpanel', '$module_name', '$record_id', $refresh_page);\">".$app_strings['LNK_DELETE']."</a>";
78
-		return $html;
77
+        $html = "<a id=\"$unique_id\" onclick='return sp_del_conf();' href=\"javascript:sub_p_del('$subpanel', '$module_name', '$record_id', $refresh_page);\">".$app_strings['LNK_DELETE']."</a>";
78
+        return $html;
79 79
 
80
-	}
80
+    }
81 81
 }
82 82
 
83 83
 ?>
84 84
\ No newline at end of file
Please login to merge, or discard this patch.