@@ -45,14 +45,14 @@ discard block |
||
45 | 45 | //TODO Rename this to edit link |
46 | 46 | class SugarWidgetSubPanelRelFieldEditButton extends SugarWidgetField |
47 | 47 | { |
48 | - function displayHeaderCell(&$layout_def) |
|
49 | - { |
|
50 | - return ' '; |
|
51 | - } |
|
48 | + function displayHeaderCell(&$layout_def) |
|
49 | + { |
|
50 | + return ' '; |
|
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 |
||
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 |
||
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 |
@@ -1,5 +1,5 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -1,5 +1,7 @@ |
||
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. |
@@ -48,7 +48,7 @@ |
||
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 | } |
@@ -1,5 +1,5 @@ |
||
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. |
@@ -1,5 +1,7 @@ |
||
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. |
@@ -45,120 +45,120 @@ |
||
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 | ?> |
@@ -1,5 +1,5 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -1,5 +1,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -47,103 +47,103 @@ discard block |
||
47 | 47 | { |
48 | 48 | |
49 | 49 | |
50 | - function &_get_form($defines, $additionalFormFields = null, $asUrl = false) |
|
51 | - { |
|
52 | - global $app_strings; |
|
53 | - global $currentModule; |
|
54 | - |
|
55 | - // Create the additional form fields with real values if they were not passed in |
|
56 | - if(empty($additionalFormFields) && $this->additional_form_fields) |
|
57 | - { |
|
58 | - foreach($this->additional_form_fields as $key=>$value) |
|
59 | - { |
|
60 | - if(!empty($defines['focus']->$value)) |
|
61 | - { |
|
62 | - $additionalFormFields[$key] = $defines['focus']->$value; |
|
63 | - } |
|
64 | - else |
|
65 | - { |
|
66 | - $additionalFormFields[$key] = ''; |
|
67 | - } |
|
68 | - } |
|
69 | - } |
|
70 | - |
|
71 | - if(!empty($this->module)) |
|
72 | - { |
|
73 | - $defines['child_module_name'] = $this->module; |
|
74 | - } |
|
75 | - else |
|
76 | - { |
|
77 | - $defines['child_module_name'] = $defines['module']; |
|
78 | - } |
|
79 | - |
|
80 | - $defines['parent_bean_name'] = get_class( $defines['focus']); |
|
81 | - |
|
82 | - $relationship_name = $this->get_subpanel_relationship_name($defines); |
|
83 | - |
|
84 | - $form = 'form' . $relationship_name; |
|
85 | - $button = '<form onsubmit="return SUGAR.subpanelUtils.sendAndRetrieve(this.id, \'subpanel_' . $defines['subpanel_definition']->name . '\', \'' . addslashes($app_strings['LBL_LOADING']) . '\');" action="index.php" method="post" name="form" id="form' . $form . "\">\n"; |
|
86 | - |
|
87 | - //module_button is used to override the value of module name |
|
88 | - $button .= "<input type='hidden' name='target_module' value='".$defines['child_module_name']."'>\n"; |
|
89 | - $button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_id' value='".$defines['focus']->id."'>\n"; |
|
90 | - |
|
91 | - if(isset($defines['focus']->name)) |
|
92 | - { |
|
93 | - $button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_name' value='".$defines['focus']->name."'>"; |
|
94 | - #26451,add these fields for custom one-to-many relate field. |
|
50 | + function &_get_form($defines, $additionalFormFields = null, $asUrl = false) |
|
51 | + { |
|
52 | + global $app_strings; |
|
53 | + global $currentModule; |
|
54 | + |
|
55 | + // Create the additional form fields with real values if they were not passed in |
|
56 | + if(empty($additionalFormFields) && $this->additional_form_fields) |
|
57 | + { |
|
58 | + foreach($this->additional_form_fields as $key=>$value) |
|
59 | + { |
|
60 | + if(!empty($defines['focus']->$value)) |
|
61 | + { |
|
62 | + $additionalFormFields[$key] = $defines['focus']->$value; |
|
63 | + } |
|
64 | + else |
|
65 | + { |
|
66 | + $additionalFormFields[$key] = ''; |
|
67 | + } |
|
68 | + } |
|
69 | + } |
|
70 | + |
|
71 | + if(!empty($this->module)) |
|
72 | + { |
|
73 | + $defines['child_module_name'] = $this->module; |
|
74 | + } |
|
75 | + else |
|
76 | + { |
|
77 | + $defines['child_module_name'] = $defines['module']; |
|
78 | + } |
|
79 | + |
|
80 | + $defines['parent_bean_name'] = get_class( $defines['focus']); |
|
81 | + |
|
82 | + $relationship_name = $this->get_subpanel_relationship_name($defines); |
|
83 | + |
|
84 | + $form = 'form' . $relationship_name; |
|
85 | + $button = '<form onsubmit="return SUGAR.subpanelUtils.sendAndRetrieve(this.id, \'subpanel_' . $defines['subpanel_definition']->name . '\', \'' . addslashes($app_strings['LBL_LOADING']) . '\');" action="index.php" method="post" name="form" id="form' . $form . "\">\n"; |
|
86 | + |
|
87 | + //module_button is used to override the value of module name |
|
88 | + $button .= "<input type='hidden' name='target_module' value='".$defines['child_module_name']."'>\n"; |
|
89 | + $button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_id' value='".$defines['focus']->id."'>\n"; |
|
90 | + |
|
91 | + if(isset($defines['focus']->name)) |
|
92 | + { |
|
93 | + $button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_name' value='".$defines['focus']->name."'>"; |
|
94 | + #26451,add these fields for custom one-to-many relate field. |
|
95 | 95 | if(!empty($defines['child_module_name'])){ |
96 | - $button .= "<input type='hidden' name='". $relationship_name ."_name' value='".$defines['focus']->name."'>"; |
|
97 | - $childFocusName = !empty($GLOBALS['beanList'][$defines['child_module_name']]) ? $GLOBALS['beanList'][$defines['child_module_name']] : ""; |
|
98 | - if(!empty($GLOBALS['dictionary'][ $childFocusName ]["fields"][$relationship_name .'_name']['id_name'])){ |
|
99 | - $button .= "<input type='hidden' name='". $GLOBALS['dictionary'][ $childFocusName ]["fields"][$relationship_name .'_name']['id_name'] ."' value='".$defines['focus']->id."'>"; |
|
100 | - } |
|
96 | + $button .= "<input type='hidden' name='". $relationship_name ."_name' value='".$defines['focus']->name."'>"; |
|
97 | + $childFocusName = !empty($GLOBALS['beanList'][$defines['child_module_name']]) ? $GLOBALS['beanList'][$defines['child_module_name']] : ""; |
|
98 | + if(!empty($GLOBALS['dictionary'][ $childFocusName ]["fields"][$relationship_name .'_name']['id_name'])){ |
|
99 | + $button .= "<input type='hidden' name='". $GLOBALS['dictionary'][ $childFocusName ]["fields"][$relationship_name .'_name']['id_name'] ."' value='".$defines['focus']->id."'>"; |
|
100 | + } |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | //Set the return_name form variable that will allow EditView2.php |
104 | 104 | $additionalFormFields['return_name'] = $defines['focus']->name; |
105 | - } |
|
105 | + } |
|
106 | 106 | |
107 | - if(!empty($defines['view'])) |
|
108 | - $button .= '<input type="hidden" name="target_view" value="'. $defines['view'] . '" />'; |
|
109 | - $button .= '<input type="hidden" name="to_pdf" value="true" />'; |
|
107 | + if(!empty($defines['view'])) |
|
108 | + $button .= '<input type="hidden" name="target_view" value="'. $defines['view'] . '" />'; |
|
109 | + $button .= '<input type="hidden" name="to_pdf" value="true" />'; |
|
110 | 110 | $button .= '<input type="hidden" name="tpl" value="QuickCreate.tpl" />'; |
111 | - $button .= '<input type="hidden" name="return_module" value="' . $currentModule . "\" />\n"; |
|
112 | - $button .= '<input type="hidden" name="return_action" value="' . $defines['action'] . "\" />\n"; |
|
113 | - $button .= '<input type="hidden" name="return_id" value="' . $defines['focus']->id . "\" />\n"; |
|
114 | - $button .= '<input type="hidden" name="return_relationship" value="' . $relationship_name . "\" />\n"; |
|
115 | - $button .= '<input type="hidden" name="record" value="" />'; |
|
116 | - |
|
117 | - // TODO: move this out and get $additionalFormFields working properly |
|
118 | - if(empty($additionalFormFields['parent_type'])) |
|
119 | - { |
|
120 | - if($defines['focus']->object_name=='Contact') { |
|
121 | - $additionalFormFields['parent_type'] = 'Accounts'; |
|
122 | - } |
|
123 | - else { |
|
124 | - $additionalFormFields['parent_type'] = $defines['focus']->module_dir; |
|
125 | - } |
|
126 | - } |
|
127 | - if(empty($additionalFormFields['parent_name'])) |
|
128 | - { |
|
129 | - if($defines['focus']->object_name=='Contact') { |
|
130 | - $additionalFormFields['parent_name'] = $defines['focus']->account_name; |
|
131 | - $additionalFormFields['account_name'] = $defines['focus']->account_name; |
|
132 | - } |
|
133 | - else { |
|
134 | - $additionalFormFields['parent_name'] = $defines['focus']->name; |
|
135 | - } |
|
136 | - } |
|
137 | - if(empty($additionalFormFields['parent_id'])) |
|
138 | - { |
|
139 | - if($defines['focus']->object_name=='Contact') { |
|
140 | - $additionalFormFields['parent_id'] = $defines['focus']->account_id; |
|
141 | - $additionalFormFields['account_id'] = $defines['focus']->account_id; |
|
142 | - } |
|
143 | - else { |
|
144 | - $additionalFormFields['parent_id'] = $defines['focus']->id; |
|
145 | - } |
|
146 | - } |
|
111 | + $button .= '<input type="hidden" name="return_module" value="' . $currentModule . "\" />\n"; |
|
112 | + $button .= '<input type="hidden" name="return_action" value="' . $defines['action'] . "\" />\n"; |
|
113 | + $button .= '<input type="hidden" name="return_id" value="' . $defines['focus']->id . "\" />\n"; |
|
114 | + $button .= '<input type="hidden" name="return_relationship" value="' . $relationship_name . "\" />\n"; |
|
115 | + $button .= '<input type="hidden" name="record" value="" />'; |
|
116 | + |
|
117 | + // TODO: move this out and get $additionalFormFields working properly |
|
118 | + if(empty($additionalFormFields['parent_type'])) |
|
119 | + { |
|
120 | + if($defines['focus']->object_name=='Contact') { |
|
121 | + $additionalFormFields['parent_type'] = 'Accounts'; |
|
122 | + } |
|
123 | + else { |
|
124 | + $additionalFormFields['parent_type'] = $defines['focus']->module_dir; |
|
125 | + } |
|
126 | + } |
|
127 | + if(empty($additionalFormFields['parent_name'])) |
|
128 | + { |
|
129 | + if($defines['focus']->object_name=='Contact') { |
|
130 | + $additionalFormFields['parent_name'] = $defines['focus']->account_name; |
|
131 | + $additionalFormFields['account_name'] = $defines['focus']->account_name; |
|
132 | + } |
|
133 | + else { |
|
134 | + $additionalFormFields['parent_name'] = $defines['focus']->name; |
|
135 | + } |
|
136 | + } |
|
137 | + if(empty($additionalFormFields['parent_id'])) |
|
138 | + { |
|
139 | + if($defines['focus']->object_name=='Contact') { |
|
140 | + $additionalFormFields['parent_id'] = $defines['focus']->account_id; |
|
141 | + $additionalFormFields['account_id'] = $defines['focus']->account_id; |
|
142 | + } |
|
143 | + else { |
|
144 | + $additionalFormFields['parent_id'] = $defines['focus']->id; |
|
145 | + } |
|
146 | + } |
|
147 | 147 | |
148 | 148 | if(strtolower($defines['child_module_name']) =='contracts') { |
149 | 149 | //set variables to account name, or parent account name |
@@ -161,43 +161,43 @@ discard block |
||
161 | 161 | } |
162 | 162 | } |
163 | 163 | |
164 | - $button .= '<input type="hidden" name="action" value="SubpanelCreates" />' . "\n"; |
|
165 | - $button .= '<input type="hidden" name="module" value="Home" />' . "\n"; |
|
166 | - $button .= '<input type="hidden" name="target_action" value="QuickCreate" />' . "\n"; |
|
167 | - |
|
168 | - // fill in additional form fields for all but action |
|
169 | - foreach($additionalFormFields as $key => $value) |
|
170 | - { |
|
171 | - if($key != 'action') |
|
172 | - { |
|
173 | - $button .= '<input type="hidden" name="' . $key . '" value=\'' . $value . '\' />' . "\n"; |
|
174 | - } |
|
175 | - } |
|
176 | - |
|
177 | - return $button; |
|
178 | - } |
|
179 | - |
|
180 | - /** |
|
181 | - * get_subpanel_relationship_name |
|
182 | - * Get the relationship name based on the subapnel definition |
|
183 | - * @param mixed $defines The subpanel definition |
|
184 | - */ |
|
185 | - function get_subpanel_relationship_name($defines) { |
|
186 | - $relationship_name = ''; |
|
187 | - if(!empty($defines)) { |
|
188 | - $relationship_name = isset($defines['module']) ? $defines['module'] : ''; |
|
189 | - $dataSource = $defines['subpanel_definition']->get_data_source_name(true); |
|
190 | - if (!empty($dataSource)) { |
|
191 | - $relationship_name = $dataSource; |
|
192 | - //Try to set the relationship name to the real relationship, not the link. |
|
193 | - if (!empty($defines['subpanel_definition']->parent_bean->field_defs[$dataSource]) |
|
194 | - && !empty($defines['subpanel_definition']->parent_bean->field_defs[$dataSource]['relationship'])) |
|
195 | - { |
|
196 | - $relationship_name = $defines['subpanel_definition']->parent_bean->field_defs[$dataSource]['relationship']; |
|
197 | - } |
|
198 | - } |
|
199 | - } |
|
200 | - return $relationship_name; |
|
201 | - } |
|
164 | + $button .= '<input type="hidden" name="action" value="SubpanelCreates" />' . "\n"; |
|
165 | + $button .= '<input type="hidden" name="module" value="Home" />' . "\n"; |
|
166 | + $button .= '<input type="hidden" name="target_action" value="QuickCreate" />' . "\n"; |
|
167 | + |
|
168 | + // fill in additional form fields for all but action |
|
169 | + foreach($additionalFormFields as $key => $value) |
|
170 | + { |
|
171 | + if($key != 'action') |
|
172 | + { |
|
173 | + $button .= '<input type="hidden" name="' . $key . '" value=\'' . $value . '\' />' . "\n"; |
|
174 | + } |
|
175 | + } |
|
176 | + |
|
177 | + return $button; |
|
178 | + } |
|
179 | + |
|
180 | + /** |
|
181 | + * get_subpanel_relationship_name |
|
182 | + * Get the relationship name based on the subapnel definition |
|
183 | + * @param mixed $defines The subpanel definition |
|
184 | + */ |
|
185 | + function get_subpanel_relationship_name($defines) { |
|
186 | + $relationship_name = ''; |
|
187 | + if(!empty($defines)) { |
|
188 | + $relationship_name = isset($defines['module']) ? $defines['module'] : ''; |
|
189 | + $dataSource = $defines['subpanel_definition']->get_data_source_name(true); |
|
190 | + if (!empty($dataSource)) { |
|
191 | + $relationship_name = $dataSource; |
|
192 | + //Try to set the relationship name to the real relationship, not the link. |
|
193 | + if (!empty($defines['subpanel_definition']->parent_bean->field_defs[$dataSource]) |
|
194 | + && !empty($defines['subpanel_definition']->parent_bean->field_defs[$dataSource]['relationship'])) |
|
195 | + { |
|
196 | + $relationship_name = $defines['subpanel_definition']->parent_bean->field_defs[$dataSource]['relationship']; |
|
197 | + } |
|
198 | + } |
|
199 | + } |
|
200 | + return $relationship_name; |
|
201 | + } |
|
202 | 202 | } |
203 | 203 | ?> |
@@ -1,5 +1,5 @@ discard block |
||
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,11 +53,11 @@ discard block |
||
53 | 53 | global $currentModule; |
54 | 54 | |
55 | 55 | // Create the additional form fields with real values if they were not passed in |
56 | - if(empty($additionalFormFields) && $this->additional_form_fields) |
|
56 | + if (empty($additionalFormFields) && $this->additional_form_fields) |
|
57 | 57 | { |
58 | - foreach($this->additional_form_fields as $key=>$value) |
|
58 | + foreach ($this->additional_form_fields as $key=>$value) |
|
59 | 59 | { |
60 | - if(!empty($defines['focus']->$value)) |
|
60 | + if (!empty($defines['focus']->$value)) |
|
61 | 61 | { |
62 | 62 | $additionalFormFields[$key] = $defines['focus']->$value; |
63 | 63 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } |
69 | 69 | } |
70 | 70 | |
71 | - if(!empty($this->module)) |
|
71 | + if (!empty($this->module)) |
|
72 | 72 | { |
73 | 73 | $defines['child_module_name'] = $this->module; |
74 | 74 | } |
@@ -77,26 +77,26 @@ discard block |
||
77 | 77 | $defines['child_module_name'] = $defines['module']; |
78 | 78 | } |
79 | 79 | |
80 | - $defines['parent_bean_name'] = get_class( $defines['focus']); |
|
80 | + $defines['parent_bean_name'] = get_class($defines['focus']); |
|
81 | 81 | |
82 | 82 | $relationship_name = $this->get_subpanel_relationship_name($defines); |
83 | 83 | |
84 | - $form = 'form' . $relationship_name; |
|
85 | - $button = '<form onsubmit="return SUGAR.subpanelUtils.sendAndRetrieve(this.id, \'subpanel_' . $defines['subpanel_definition']->name . '\', \'' . addslashes($app_strings['LBL_LOADING']) . '\');" action="index.php" method="post" name="form" id="form' . $form . "\">\n"; |
|
84 | + $form = 'form'.$relationship_name; |
|
85 | + $button = '<form onsubmit="return SUGAR.subpanelUtils.sendAndRetrieve(this.id, \'subpanel_'.$defines['subpanel_definition']->name.'\', \''.addslashes($app_strings['LBL_LOADING']).'\');" action="index.php" method="post" name="form" id="form'.$form."\">\n"; |
|
86 | 86 | |
87 | 87 | //module_button is used to override the value of module name |
88 | 88 | $button .= "<input type='hidden' name='target_module' value='".$defines['child_module_name']."'>\n"; |
89 | 89 | $button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_id' value='".$defines['focus']->id."'>\n"; |
90 | 90 | |
91 | - if(isset($defines['focus']->name)) |
|
91 | + if (isset($defines['focus']->name)) |
|
92 | 92 | { |
93 | 93 | $button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_name' value='".$defines['focus']->name."'>"; |
94 | 94 | #26451,add these fields for custom one-to-many relate field. |
95 | - if(!empty($defines['child_module_name'])){ |
|
96 | - $button .= "<input type='hidden' name='". $relationship_name ."_name' value='".$defines['focus']->name."'>"; |
|
95 | + if (!empty($defines['child_module_name'])) { |
|
96 | + $button .= "<input type='hidden' name='".$relationship_name."_name' value='".$defines['focus']->name."'>"; |
|
97 | 97 | $childFocusName = !empty($GLOBALS['beanList'][$defines['child_module_name']]) ? $GLOBALS['beanList'][$defines['child_module_name']] : ""; |
98 | - if(!empty($GLOBALS['dictionary'][ $childFocusName ]["fields"][$relationship_name .'_name']['id_name'])){ |
|
99 | - $button .= "<input type='hidden' name='". $GLOBALS['dictionary'][ $childFocusName ]["fields"][$relationship_name .'_name']['id_name'] ."' value='".$defines['focus']->id."'>"; |
|
98 | + if (!empty($GLOBALS['dictionary'][$childFocusName]["fields"][$relationship_name.'_name']['id_name'])) { |
|
99 | + $button .= "<input type='hidden' name='".$GLOBALS['dictionary'][$childFocusName]["fields"][$relationship_name.'_name']['id_name']."' value='".$defines['focus']->id."'>"; |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
@@ -104,29 +104,29 @@ discard block |
||
104 | 104 | $additionalFormFields['return_name'] = $defines['focus']->name; |
105 | 105 | } |
106 | 106 | |
107 | - if(!empty($defines['view'])) |
|
108 | - $button .= '<input type="hidden" name="target_view" value="'. $defines['view'] . '" />'; |
|
107 | + if (!empty($defines['view'])) |
|
108 | + $button .= '<input type="hidden" name="target_view" value="'.$defines['view'].'" />'; |
|
109 | 109 | $button .= '<input type="hidden" name="to_pdf" value="true" />'; |
110 | 110 | $button .= '<input type="hidden" name="tpl" value="QuickCreate.tpl" />'; |
111 | - $button .= '<input type="hidden" name="return_module" value="' . $currentModule . "\" />\n"; |
|
112 | - $button .= '<input type="hidden" name="return_action" value="' . $defines['action'] . "\" />\n"; |
|
113 | - $button .= '<input type="hidden" name="return_id" value="' . $defines['focus']->id . "\" />\n"; |
|
114 | - $button .= '<input type="hidden" name="return_relationship" value="' . $relationship_name . "\" />\n"; |
|
111 | + $button .= '<input type="hidden" name="return_module" value="'.$currentModule."\" />\n"; |
|
112 | + $button .= '<input type="hidden" name="return_action" value="'.$defines['action']."\" />\n"; |
|
113 | + $button .= '<input type="hidden" name="return_id" value="'.$defines['focus']->id."\" />\n"; |
|
114 | + $button .= '<input type="hidden" name="return_relationship" value="'.$relationship_name."\" />\n"; |
|
115 | 115 | $button .= '<input type="hidden" name="record" value="" />'; |
116 | 116 | |
117 | 117 | // TODO: move this out and get $additionalFormFields working properly |
118 | - if(empty($additionalFormFields['parent_type'])) |
|
118 | + if (empty($additionalFormFields['parent_type'])) |
|
119 | 119 | { |
120 | - if($defines['focus']->object_name=='Contact') { |
|
120 | + if ($defines['focus']->object_name == 'Contact') { |
|
121 | 121 | $additionalFormFields['parent_type'] = 'Accounts'; |
122 | 122 | } |
123 | 123 | else { |
124 | 124 | $additionalFormFields['parent_type'] = $defines['focus']->module_dir; |
125 | 125 | } |
126 | 126 | } |
127 | - if(empty($additionalFormFields['parent_name'])) |
|
127 | + if (empty($additionalFormFields['parent_name'])) |
|
128 | 128 | { |
129 | - if($defines['focus']->object_name=='Contact') { |
|
129 | + if ($defines['focus']->object_name == 'Contact') { |
|
130 | 130 | $additionalFormFields['parent_name'] = $defines['focus']->account_name; |
131 | 131 | $additionalFormFields['account_name'] = $defines['focus']->account_name; |
132 | 132 | } |
@@ -134,9 +134,9 @@ discard block |
||
134 | 134 | $additionalFormFields['parent_name'] = $defines['focus']->name; |
135 | 135 | } |
136 | 136 | } |
137 | - if(empty($additionalFormFields['parent_id'])) |
|
137 | + if (empty($additionalFormFields['parent_id'])) |
|
138 | 138 | { |
139 | - if($defines['focus']->object_name=='Contact') { |
|
139 | + if ($defines['focus']->object_name == 'Contact') { |
|
140 | 140 | $additionalFormFields['parent_id'] = $defines['focus']->account_id; |
141 | 141 | $additionalFormFields['account_id'] = $defines['focus']->account_id; |
142 | 142 | } |
@@ -145,32 +145,32 @@ discard block |
||
145 | 145 | } |
146 | 146 | } |
147 | 147 | |
148 | - if(strtolower($defines['child_module_name']) =='contracts') { |
|
148 | + if (strtolower($defines['child_module_name']) == 'contracts') { |
|
149 | 149 | //set variables to account name, or parent account name |
150 | - if(strtolower($defines['parent_bean_name']) == 'account' ){ |
|
150 | + if (strtolower($defines['parent_bean_name']) == 'account') { |
|
151 | 151 | //if account is parent bean, then get focus id/focus name |
152 | - if(isset($defines['focus']->id))$additionalFormFields['account_id'] = $defines['focus']->id; |
|
153 | - if(isset($defines['focus']->name))$additionalFormFields['account_name'] = $defines['focus']->name; |
|
154 | - }elseif(strtolower($defines['parent_bean_name']) == 'quote' ){ |
|
152 | + if (isset($defines['focus']->id))$additionalFormFields['account_id'] = $defines['focus']->id; |
|
153 | + if (isset($defines['focus']->name))$additionalFormFields['account_name'] = $defines['focus']->name; |
|
154 | + }elseif (strtolower($defines['parent_bean_name']) == 'quote') { |
|
155 | 155 | //if quote is parent bean, then get billing_account_id/billing_account_name |
156 | - if(isset($defines['focus']->billing_account_id))$additionalFormFields['account_id'] = $defines['focus']->billing_account_id; |
|
157 | - if(isset($defines['focus']->billing_account_name))$additionalFormFields['account_name'] = $defines['focus']->billing_account_name; |
|
158 | - }else{ |
|
159 | - if(isset($defines['focus']->account_id))$additionalFormFields['account_id'] = $defines['focus']->account_id; |
|
160 | - if(isset($defines['focus']->account_name))$additionalFormFields['account_name'] = $defines['focus']->account_name; |
|
156 | + if (isset($defines['focus']->billing_account_id))$additionalFormFields['account_id'] = $defines['focus']->billing_account_id; |
|
157 | + if (isset($defines['focus']->billing_account_name))$additionalFormFields['account_name'] = $defines['focus']->billing_account_name; |
|
158 | + } else { |
|
159 | + if (isset($defines['focus']->account_id))$additionalFormFields['account_id'] = $defines['focus']->account_id; |
|
160 | + if (isset($defines['focus']->account_name))$additionalFormFields['account_name'] = $defines['focus']->account_name; |
|
161 | 161 | } |
162 | 162 | } |
163 | 163 | |
164 | - $button .= '<input type="hidden" name="action" value="SubpanelCreates" />' . "\n"; |
|
165 | - $button .= '<input type="hidden" name="module" value="Home" />' . "\n"; |
|
166 | - $button .= '<input type="hidden" name="target_action" value="QuickCreate" />' . "\n"; |
|
164 | + $button .= '<input type="hidden" name="action" value="SubpanelCreates" />'."\n"; |
|
165 | + $button .= '<input type="hidden" name="module" value="Home" />'."\n"; |
|
166 | + $button .= '<input type="hidden" name="target_action" value="QuickCreate" />'."\n"; |
|
167 | 167 | |
168 | 168 | // fill in additional form fields for all but action |
169 | - foreach($additionalFormFields as $key => $value) |
|
169 | + foreach ($additionalFormFields as $key => $value) |
|
170 | 170 | { |
171 | - if($key != 'action') |
|
171 | + if ($key != 'action') |
|
172 | 172 | { |
173 | - $button .= '<input type="hidden" name="' . $key . '" value=\'' . $value . '\' />' . "\n"; |
|
173 | + $button .= '<input type="hidden" name="'.$key.'" value=\''.$value.'\' />'."\n"; |
|
174 | 174 | } |
175 | 175 | } |
176 | 176 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | function get_subpanel_relationship_name($defines) { |
186 | 186 | $relationship_name = ''; |
187 | - if(!empty($defines)) { |
|
187 | + if (!empty($defines)) { |
|
188 | 188 | $relationship_name = isset($defines['module']) ? $defines['module'] : ''; |
189 | 189 | $dataSource = $defines['subpanel_definition']->get_data_source_name(true); |
190 | 190 | if (!empty($dataSource)) { |
@@ -1,5 +1,7 @@ discard block |
||
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. |
@@ -60,8 +62,7 @@ discard block |
||
60 | 62 | if(!empty($defines['focus']->$value)) |
61 | 63 | { |
62 | 64 | $additionalFormFields[$key] = $defines['focus']->$value; |
63 | - } |
|
64 | - else |
|
65 | + } else |
|
65 | 66 | { |
66 | 67 | $additionalFormFields[$key] = ''; |
67 | 68 | } |
@@ -71,8 +72,7 @@ discard block |
||
71 | 72 | if(!empty($this->module)) |
72 | 73 | { |
73 | 74 | $defines['child_module_name'] = $this->module; |
74 | - } |
|
75 | - else |
|
75 | + } else |
|
76 | 76 | { |
77 | 77 | $defines['child_module_name'] = $defines['module']; |
78 | 78 | } |
@@ -104,8 +104,9 @@ discard block |
||
104 | 104 | $additionalFormFields['return_name'] = $defines['focus']->name; |
105 | 105 | } |
106 | 106 | |
107 | - if(!empty($defines['view'])) |
|
108 | - $button .= '<input type="hidden" name="target_view" value="'. $defines['view'] . '" />'; |
|
107 | + if(!empty($defines['view'])) { |
|
108 | + $button .= '<input type="hidden" name="target_view" value="'. $defines['view'] . '" />'; |
|
109 | + } |
|
109 | 110 | $button .= '<input type="hidden" name="to_pdf" value="true" />'; |
110 | 111 | $button .= '<input type="hidden" name="tpl" value="QuickCreate.tpl" />'; |
111 | 112 | $button .= '<input type="hidden" name="return_module" value="' . $currentModule . "\" />\n"; |
@@ -119,8 +120,7 @@ discard block |
||
119 | 120 | { |
120 | 121 | if($defines['focus']->object_name=='Contact') { |
121 | 122 | $additionalFormFields['parent_type'] = 'Accounts'; |
122 | - } |
|
123 | - else { |
|
123 | + } else { |
|
124 | 124 | $additionalFormFields['parent_type'] = $defines['focus']->module_dir; |
125 | 125 | } |
126 | 126 | } |
@@ -129,8 +129,7 @@ discard block |
||
129 | 129 | if($defines['focus']->object_name=='Contact') { |
130 | 130 | $additionalFormFields['parent_name'] = $defines['focus']->account_name; |
131 | 131 | $additionalFormFields['account_name'] = $defines['focus']->account_name; |
132 | - } |
|
133 | - else { |
|
132 | + } else { |
|
134 | 133 | $additionalFormFields['parent_name'] = $defines['focus']->name; |
135 | 134 | } |
136 | 135 | } |
@@ -139,8 +138,7 @@ discard block |
||
139 | 138 | if($defines['focus']->object_name=='Contact') { |
140 | 139 | $additionalFormFields['parent_id'] = $defines['focus']->account_id; |
141 | 140 | $additionalFormFields['account_id'] = $defines['focus']->account_id; |
142 | - } |
|
143 | - else { |
|
141 | + } else { |
|
144 | 142 | $additionalFormFields['parent_id'] = $defines['focus']->id; |
145 | 143 | } |
146 | 144 | } |
@@ -149,15 +147,27 @@ discard block |
||
149 | 147 | //set variables to account name, or parent account name |
150 | 148 | if(strtolower($defines['parent_bean_name']) == 'account' ){ |
151 | 149 | //if account is parent bean, then get focus id/focus name |
152 | - if(isset($defines['focus']->id))$additionalFormFields['account_id'] = $defines['focus']->id; |
|
153 | - if(isset($defines['focus']->name))$additionalFormFields['account_name'] = $defines['focus']->name; |
|
154 | - }elseif(strtolower($defines['parent_bean_name']) == 'quote' ){ |
|
150 | + if(isset($defines['focus']->id)) { |
|
151 | + $additionalFormFields['account_id'] = $defines['focus']->id; |
|
152 | + } |
|
153 | + if(isset($defines['focus']->name)) { |
|
154 | + $additionalFormFields['account_name'] = $defines['focus']->name; |
|
155 | + } |
|
156 | + } elseif(strtolower($defines['parent_bean_name']) == 'quote' ){ |
|
155 | 157 | //if quote is parent bean, then get billing_account_id/billing_account_name |
156 | - if(isset($defines['focus']->billing_account_id))$additionalFormFields['account_id'] = $defines['focus']->billing_account_id; |
|
157 | - if(isset($defines['focus']->billing_account_name))$additionalFormFields['account_name'] = $defines['focus']->billing_account_name; |
|
158 | - }else{ |
|
159 | - if(isset($defines['focus']->account_id))$additionalFormFields['account_id'] = $defines['focus']->account_id; |
|
160 | - if(isset($defines['focus']->account_name))$additionalFormFields['account_name'] = $defines['focus']->account_name; |
|
158 | + if(isset($defines['focus']->billing_account_id)) { |
|
159 | + $additionalFormFields['account_id'] = $defines['focus']->billing_account_id; |
|
160 | + } |
|
161 | + if(isset($defines['focus']->billing_account_name)) { |
|
162 | + $additionalFormFields['account_name'] = $defines['focus']->billing_account_name; |
|
163 | + } |
|
164 | + } else{ |
|
165 | + if(isset($defines['focus']->account_id)) { |
|
166 | + $additionalFormFields['account_id'] = $defines['focus']->account_id; |
|
167 | + } |
|
168 | + if(isset($defines['focus']->account_name)) { |
|
169 | + $additionalFormFields['account_name'] = $defines['focus']->account_name; |
|
170 | + } |
|
161 | 171 | } |
162 | 172 | } |
163 | 173 |
@@ -42,59 +42,59 @@ |
||
42 | 42 | |
43 | 43 | class SugarWidgetFieldInt extends SugarWidgetReportField |
44 | 44 | { |
45 | - function displayList($layout_def) |
|
46 | - { |
|
45 | + function displayList($layout_def) |
|
46 | + { |
|
47 | 47 | |
48 | - return $this->displayListPlain($layout_def); |
|
49 | - } |
|
48 | + return $this->displayListPlain($layout_def); |
|
49 | + } |
|
50 | 50 | |
51 | - function queryFilterEquals(&$layout_def) |
|
52 | - { |
|
51 | + function queryFilterEquals(&$layout_def) |
|
52 | + { |
|
53 | 53 | return $this->_get_column_select($layout_def)."= '".$GLOBALS['db']->quote($layout_def['input_name0'])."'\n"; |
54 | - } |
|
54 | + } |
|
55 | 55 | |
56 | - function queryFilterNot_Equals(&$layout_def) |
|
57 | - { |
|
56 | + function queryFilterNot_Equals(&$layout_def) |
|
57 | + { |
|
58 | 58 | return $this->_get_column_select($layout_def)."!='".$GLOBALS['db']->quote($layout_def['input_name0'])."'\n"; |
59 | - } |
|
59 | + } |
|
60 | 60 | |
61 | - function queryFilterGreater(&$layout_def) |
|
62 | - { |
|
61 | + function queryFilterGreater(&$layout_def) |
|
62 | + { |
|
63 | 63 | return $this->_get_column_select($layout_def)." > '".$GLOBALS['db']->quote($layout_def['input_name0'])."'\n"; |
64 | - } |
|
64 | + } |
|
65 | 65 | |
66 | - function queryFilterLess(&$layout_def) |
|
67 | - { |
|
66 | + function queryFilterLess(&$layout_def) |
|
67 | + { |
|
68 | 68 | return $this->_get_column_select($layout_def)." < '".$GLOBALS['db']->quote($layout_def['input_name0'])."'\n"; |
69 | - } |
|
69 | + } |
|
70 | 70 | |
71 | - function queryFilterBetween(&$layout_def) |
|
72 | - { |
|
73 | - return $this->_get_column_select($layout_def)." BETWEEN '".$GLOBALS['db']->quote($layout_def['input_name0']). "' AND '" . $GLOBALS['db']->quote($layout_def['input_name1']) . "'\n"; |
|
74 | - } |
|
71 | + function queryFilterBetween(&$layout_def) |
|
72 | + { |
|
73 | + return $this->_get_column_select($layout_def)." BETWEEN '".$GLOBALS['db']->quote($layout_def['input_name0']). "' AND '" . $GLOBALS['db']->quote($layout_def['input_name1']) . "'\n"; |
|
74 | + } |
|
75 | 75 | |
76 | - function queryFilterStarts_With(&$layout_def) |
|
77 | - { |
|
78 | - return $this->queryFilterEquals($layout_def); |
|
79 | - } |
|
76 | + function queryFilterStarts_With(&$layout_def) |
|
77 | + { |
|
78 | + return $this->queryFilterEquals($layout_def); |
|
79 | + } |
|
80 | 80 | |
81 | - function displayInput(&$layout_def) |
|
82 | - { |
|
83 | - return '<input type="text" size="20" value="' . $layout_def['input_name0'] . '" name="' . $layout_def['name'] . '">'; |
|
81 | + function displayInput(&$layout_def) |
|
82 | + { |
|
83 | + return '<input type="text" size="20" value="' . $layout_def['input_name0'] . '" name="' . $layout_def['name'] . '">'; |
|
84 | 84 | |
85 | - } |
|
85 | + } |
|
86 | 86 | |
87 | - function display($layout_def) |
|
88 | - { |
|
89 | - //Bug40995 |
|
90 | - if(isset($obj->layout_manager->defs['reporter']->focus->field_name_map[$layout_def['name']]['precision'])) |
|
91 | - { |
|
92 | - $precision=$obj->layout_manager->defs['reporter']->focus->field_name_map[$layout_def['name']]['precision']; |
|
93 | - $layout_def['precision']=$precision; |
|
94 | - } |
|
95 | - //Bug40995 |
|
96 | - return parent::display($layout_def); |
|
97 | - } |
|
87 | + function display($layout_def) |
|
88 | + { |
|
89 | + //Bug40995 |
|
90 | + if(isset($obj->layout_manager->defs['reporter']->focus->field_name_map[$layout_def['name']]['precision'])) |
|
91 | + { |
|
92 | + $precision=$obj->layout_manager->defs['reporter']->focus->field_name_map[$layout_def['name']]['precision']; |
|
93 | + $layout_def['precision']=$precision; |
|
94 | + } |
|
95 | + //Bug40995 |
|
96 | + return parent::display($layout_def); |
|
97 | + } |
|
98 | 98 | |
99 | 99 | } |
100 | 100 |
@@ -1,5 +1,5 @@ discard block |
||
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. |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | function queryFilterBetween(&$layout_def) |
72 | 72 | { |
73 | - return $this->_get_column_select($layout_def)." BETWEEN '".$GLOBALS['db']->quote($layout_def['input_name0']). "' AND '" . $GLOBALS['db']->quote($layout_def['input_name1']) . "'\n"; |
|
73 | + return $this->_get_column_select($layout_def)." BETWEEN '".$GLOBALS['db']->quote($layout_def['input_name0'])."' AND '".$GLOBALS['db']->quote($layout_def['input_name1'])."'\n"; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | function queryFilterStarts_With(&$layout_def) |
@@ -80,17 +80,17 @@ discard block |
||
80 | 80 | |
81 | 81 | function displayInput(&$layout_def) |
82 | 82 | { |
83 | - return '<input type="text" size="20" value="' . $layout_def['input_name0'] . '" name="' . $layout_def['name'] . '">'; |
|
83 | + return '<input type="text" size="20" value="'.$layout_def['input_name0'].'" name="'.$layout_def['name'].'">'; |
|
84 | 84 | |
85 | 85 | } |
86 | 86 | |
87 | 87 | function display($layout_def) |
88 | 88 | { |
89 | 89 | //Bug40995 |
90 | - if(isset($obj->layout_manager->defs['reporter']->focus->field_name_map[$layout_def['name']]['precision'])) |
|
90 | + if (isset($obj->layout_manager->defs['reporter']->focus->field_name_map[$layout_def['name']]['precision'])) |
|
91 | 91 | { |
92 | - $precision=$obj->layout_manager->defs['reporter']->focus->field_name_map[$layout_def['name']]['precision']; |
|
93 | - $layout_def['precision']=$precision; |
|
92 | + $precision = $obj->layout_manager->defs['reporter']->focus->field_name_map[$layout_def['name']]['precision']; |
|
93 | + $layout_def['precision'] = $precision; |
|
94 | 94 | } |
95 | 95 | //Bug40995 |
96 | 96 | return parent::display($layout_def); |
@@ -1,5 +1,7 @@ |
||
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. |
@@ -45,38 +45,38 @@ |
||
45 | 45 | |
46 | 46 | class SugarWidgetSubPanelTopSummaryButton extends SugarWidgetSubPanelTopButton |
47 | 47 | { |
48 | - function display($widget_data, $additionalFormFields = NULL, $nonbutton = false) |
|
49 | - { |
|
48 | + function display($widget_data, $additionalFormFields = NULL, $nonbutton = false) |
|
49 | + { |
|
50 | 50 | |
51 | 51 | |
52 | - global $app_strings; |
|
53 | - global $currentModule; |
|
52 | + global $app_strings; |
|
53 | + global $currentModule; |
|
54 | 54 | |
55 | - $popup_request_data = array( |
|
56 | - 'call_back_function' => 'set_return', |
|
57 | - 'form_name' => 'EditView', |
|
58 | - 'field_to_name_array' => array(), |
|
59 | - ); |
|
55 | + $popup_request_data = array( |
|
56 | + 'call_back_function' => 'set_return', |
|
57 | + 'form_name' => 'EditView', |
|
58 | + 'field_to_name_array' => array(), |
|
59 | + ); |
|
60 | 60 | |
61 | - $json_encoded_php_array = $this->_create_json_encoded_popup_request($popup_request_data); |
|
62 | - $title = $app_strings['LBL_ACCUMULATED_HISTORY_BUTTON_TITLE']; |
|
63 | - //$accesskey = $app_strings['LBL_ACCUMULATED_HISTORY_BUTTON_KEY']; |
|
64 | - $value = $app_strings['LBL_ACCUMULATED_HISTORY_BUTTON_LABEL']; |
|
65 | - $module_name = 'Activities'; |
|
66 | - $id = $widget_data['focus']->id; |
|
67 | - $initial_filter = "&record=$id&module_name=$currentModule"; |
|
68 | - if(ACLController::moduleSupportsACL($widget_data['module']) && !ACLController::checkAccess($widget_data['module'], 'detail', true)){ |
|
69 | - $temp = '<input disabled type="button" name="summary_button" id="summary_button"' |
|
70 | - . ' class="button"' |
|
71 | - . ' title="' . $title . '"' |
|
72 | - . ' value="' . $value . '"'; |
|
73 | - return $temp; |
|
74 | - } |
|
75 | - return '<input type="button" name="summary_button" id="summary_button"' |
|
76 | - . ' class="button"' |
|
77 | - . ' title="' . $title . '"' |
|
78 | - . ' value="' . $value . '"' |
|
79 | - . " onclick='open_popup(\"$module_name\",600,400,\"$initial_filter\",false,false,$json_encoded_php_array);' />\n"; |
|
80 | - } |
|
61 | + $json_encoded_php_array = $this->_create_json_encoded_popup_request($popup_request_data); |
|
62 | + $title = $app_strings['LBL_ACCUMULATED_HISTORY_BUTTON_TITLE']; |
|
63 | + //$accesskey = $app_strings['LBL_ACCUMULATED_HISTORY_BUTTON_KEY']; |
|
64 | + $value = $app_strings['LBL_ACCUMULATED_HISTORY_BUTTON_LABEL']; |
|
65 | + $module_name = 'Activities'; |
|
66 | + $id = $widget_data['focus']->id; |
|
67 | + $initial_filter = "&record=$id&module_name=$currentModule"; |
|
68 | + if(ACLController::moduleSupportsACL($widget_data['module']) && !ACLController::checkAccess($widget_data['module'], 'detail', true)){ |
|
69 | + $temp = '<input disabled type="button" name="summary_button" id="summary_button"' |
|
70 | + . ' class="button"' |
|
71 | + . ' title="' . $title . '"' |
|
72 | + . ' value="' . $value . '"'; |
|
73 | + return $temp; |
|
74 | + } |
|
75 | + return '<input type="button" name="summary_button" id="summary_button"' |
|
76 | + . ' class="button"' |
|
77 | + . ' title="' . $title . '"' |
|
78 | + . ' value="' . $value . '"' |
|
79 | + . " onclick='open_popup(\"$module_name\",600,400,\"$initial_filter\",false,false,$json_encoded_php_array);' />\n"; |
|
80 | + } |
|
81 | 81 | } |
82 | 82 | ?> |
83 | 83 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
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. |
@@ -65,17 +65,17 @@ discard block |
||
65 | 65 | $module_name = 'Activities'; |
66 | 66 | $id = $widget_data['focus']->id; |
67 | 67 | $initial_filter = "&record=$id&module_name=$currentModule"; |
68 | - if(ACLController::moduleSupportsACL($widget_data['module']) && !ACLController::checkAccess($widget_data['module'], 'detail', true)){ |
|
69 | - $temp = '<input disabled type="button" name="summary_button" id="summary_button"' |
|
68 | + if (ACLController::moduleSupportsACL($widget_data['module']) && !ACLController::checkAccess($widget_data['module'], 'detail', true)) { |
|
69 | + $temp = '<input disabled type="button" name="summary_button" id="summary_button"' |
|
70 | 70 | . ' class="button"' |
71 | - . ' title="' . $title . '"' |
|
72 | - . ' value="' . $value . '"'; |
|
71 | + . ' title="'.$title.'"' |
|
72 | + . ' value="'.$value.'"'; |
|
73 | 73 | return $temp; |
74 | 74 | } |
75 | 75 | return '<input type="button" name="summary_button" id="summary_button"' |
76 | 76 | . ' class="button"' |
77 | - . ' title="' . $title . '"' |
|
78 | - . ' value="' . $value . '"' |
|
77 | + . ' title="'.$title.'"' |
|
78 | + . ' value="'.$value.'"' |
|
79 | 79 | . " onclick='open_popup(\"$module_name\",600,400,\"$initial_filter\",false,false,$json_encoded_php_array);' />\n"; |
80 | 80 | } |
81 | 81 | } |
@@ -1,5 +1,7 @@ |
||
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. |
@@ -43,7 +43,7 @@ |
||
43 | 43 | |
44 | 44 | class SugarWidgetFieldDatePicker extends SugarWidgetFieldDateTime |
45 | 45 | { |
46 | - function displayInput($layout_def) |
|
46 | + function displayInput($layout_def) |
|
47 | 47 | { |
48 | 48 | global $timedate; |
49 | 49 |
@@ -1,5 +1,5 @@ |
||
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. |
@@ -1,5 +1,7 @@ |
||
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. |
@@ -1,5 +1,7 @@ discard block |
||
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. |
@@ -62,14 +64,23 @@ discard block |
||
62 | 64 | |
63 | 65 | |
64 | 66 | |
65 | - if(isset($_REQUEST['action'])) $action = $_REQUEST['action']; |
|
66 | - else $action = ''; |
|
67 | + if(isset($_REQUEST['action'])) { |
|
68 | + $action = $_REQUEST['action']; |
|
69 | + } else { |
|
70 | + $action = ''; |
|
71 | + } |
|
67 | 72 | |
68 | - if(isset($_REQUEST['module'])) $module = $_REQUEST['module']; |
|
69 | - else $module = ''; |
|
73 | + if(isset($_REQUEST['module'])) { |
|
74 | + $module = $_REQUEST['module']; |
|
75 | + } else { |
|
76 | + $module = ''; |
|
77 | + } |
|
70 | 78 | |
71 | - if(isset($_REQUEST['record'])) $record = $_REQUEST['record']; |
|
72 | - else $record = ''; |
|
79 | + if(isset($_REQUEST['record'])) { |
|
80 | + $record = $_REQUEST['record']; |
|
81 | + } else { |
|
82 | + $record = ''; |
|
83 | + } |
|
73 | 84 | |
74 | 85 | if (!empty($focus->name)) { |
75 | 86 | $name = $focus->name; |
@@ -45,62 +45,62 @@ discard block |
||
45 | 45 | |
46 | 46 | class SugarWidgetSubPanelEmailLink extends SugarWidgetField { |
47 | 47 | |
48 | - function displayList($layout_def) { |
|
49 | - global $current_user; |
|
50 | - global $beanList; |
|
51 | - global $focus; |
|
52 | - global $sugar_config; |
|
53 | - global $locale; |
|
54 | - |
|
55 | - if(isset($layout_def['varname'])) { |
|
56 | - $key = strtoupper($layout_def['varname']); |
|
57 | - } else { |
|
58 | - $key = $this->_get_column_alias($layout_def); |
|
59 | - $key = strtoupper($key); |
|
60 | - } |
|
61 | - $value = $layout_def['fields'][$key]; |
|
62 | - |
|
63 | - |
|
64 | - |
|
65 | - if(isset($_REQUEST['action'])) $action = $_REQUEST['action']; |
|
66 | - else $action = ''; |
|
67 | - |
|
68 | - if(isset($_REQUEST['module'])) $module = $_REQUEST['module']; |
|
69 | - else $module = ''; |
|
70 | - |
|
71 | - if(isset($_REQUEST['record'])) $record = $_REQUEST['record']; |
|
72 | - else $record = ''; |
|
73 | - |
|
74 | - if (!empty($focus->name)) { |
|
75 | - $name = $focus->name; |
|
76 | - } else { |
|
77 | - if( !empty($focus->first_name) && !empty($focus->last_name)) { |
|
78 | - $name = $locale->getLocaleFormattedName($focus->first_name, $focus->last_name); |
|
79 | - } |
|
80 | - if(empty($name)) { |
|
81 | - $name = '*'; |
|
82 | - } |
|
83 | - } |
|
84 | - |
|
85 | - $userPref = $current_user->getPreference('email_link_type'); |
|
86 | - $defaultPref = $sugar_config['email_default_client']; |
|
87 | - if($userPref != '') { |
|
88 | - $client = $userPref; |
|
89 | - } else { |
|
90 | - $client = $defaultPref; |
|
91 | - } |
|
92 | - |
|
93 | - if($client == 'sugar') |
|
94 | - { |
|
95 | - $composeData = array( |
|
96 | - 'load_id' => $layout_def['fields']['ID'], |
|
48 | + function displayList($layout_def) { |
|
49 | + global $current_user; |
|
50 | + global $beanList; |
|
51 | + global $focus; |
|
52 | + global $sugar_config; |
|
53 | + global $locale; |
|
54 | + |
|
55 | + if(isset($layout_def['varname'])) { |
|
56 | + $key = strtoupper($layout_def['varname']); |
|
57 | + } else { |
|
58 | + $key = $this->_get_column_alias($layout_def); |
|
59 | + $key = strtoupper($key); |
|
60 | + } |
|
61 | + $value = $layout_def['fields'][$key]; |
|
62 | + |
|
63 | + |
|
64 | + |
|
65 | + if(isset($_REQUEST['action'])) $action = $_REQUEST['action']; |
|
66 | + else $action = ''; |
|
67 | + |
|
68 | + if(isset($_REQUEST['module'])) $module = $_REQUEST['module']; |
|
69 | + else $module = ''; |
|
70 | + |
|
71 | + if(isset($_REQUEST['record'])) $record = $_REQUEST['record']; |
|
72 | + else $record = ''; |
|
73 | + |
|
74 | + if (!empty($focus->name)) { |
|
75 | + $name = $focus->name; |
|
76 | + } else { |
|
77 | + if( !empty($focus->first_name) && !empty($focus->last_name)) { |
|
78 | + $name = $locale->getLocaleFormattedName($focus->first_name, $focus->last_name); |
|
79 | + } |
|
80 | + if(empty($name)) { |
|
81 | + $name = '*'; |
|
82 | + } |
|
83 | + } |
|
84 | + |
|
85 | + $userPref = $current_user->getPreference('email_link_type'); |
|
86 | + $defaultPref = $sugar_config['email_default_client']; |
|
87 | + if($userPref != '') { |
|
88 | + $client = $userPref; |
|
89 | + } else { |
|
90 | + $client = $defaultPref; |
|
91 | + } |
|
92 | + |
|
93 | + if($client == 'sugar') |
|
94 | + { |
|
95 | + $composeData = array( |
|
96 | + 'load_id' => $layout_def['fields']['ID'], |
|
97 | 97 | 'load_module' => $this->layout_manager->defs['module_name'], |
98 | 98 | 'parent_type' => $this->layout_manager->defs['module_name'], |
99 | 99 | 'parent_id' => $layout_def['fields']['ID'], |
100 | - 'return_module' => $module, |
|
101 | - 'return_action' => $action, |
|
102 | - 'return_id' => $record |
|
103 | - ); |
|
100 | + 'return_module' => $module, |
|
101 | + 'return_action' => $action, |
|
102 | + 'return_id' => $record |
|
103 | + ); |
|
104 | 104 | if(isset($layout_def['fields']['FULL_NAME'])){ |
105 | 105 | $composeData['parent_name'] = $layout_def['fields']['FULL_NAME']; |
106 | 106 | $composeData['to_email_addrs'] = sprintf("%s <%s>", $layout_def['fields']['FULL_NAME'], $layout_def['fields']['EMAIL1']); |
@@ -110,11 +110,11 @@ discard block |
||
110 | 110 | require_once('modules/Emails/EmailUI.php'); |
111 | 111 | $emailUi = new EmailUI(); |
112 | 112 | $link = $emailUi->populateComposeViewFields(); |
113 | - } else { |
|
114 | - $link = '<a href="mailto:' . $value .'" >'; |
|
115 | - } |
|
113 | + } else { |
|
114 | + $link = '<a href="mailto:' . $value .'" >'; |
|
115 | + } |
|
116 | 116 | |
117 | - return $link.$value.'</a>'; |
|
117 | + return $link.$value.'</a>'; |
|
118 | 118 | |
119 | - } |
|
119 | + } |
|
120 | 120 | } // end class def |
@@ -1,5 +1,5 @@ discard block |
||
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 |
||
52 | 52 | global $sugar_config; |
53 | 53 | global $locale; |
54 | 54 | |
55 | - if(isset($layout_def['varname'])) { |
|
55 | + if (isset($layout_def['varname'])) { |
|
56 | 56 | $key = strtoupper($layout_def['varname']); |
57 | 57 | } else { |
58 | 58 | $key = $this->_get_column_alias($layout_def); |
@@ -62,35 +62,35 @@ discard block |
||
62 | 62 | |
63 | 63 | |
64 | 64 | |
65 | - if(isset($_REQUEST['action'])) $action = $_REQUEST['action']; |
|
65 | + if (isset($_REQUEST['action'])) $action = $_REQUEST['action']; |
|
66 | 66 | else $action = ''; |
67 | 67 | |
68 | - if(isset($_REQUEST['module'])) $module = $_REQUEST['module']; |
|
68 | + if (isset($_REQUEST['module'])) $module = $_REQUEST['module']; |
|
69 | 69 | else $module = ''; |
70 | 70 | |
71 | - if(isset($_REQUEST['record'])) $record = $_REQUEST['record']; |
|
71 | + if (isset($_REQUEST['record'])) $record = $_REQUEST['record']; |
|
72 | 72 | else $record = ''; |
73 | 73 | |
74 | 74 | if (!empty($focus->name)) { |
75 | 75 | $name = $focus->name; |
76 | 76 | } else { |
77 | - if( !empty($focus->first_name) && !empty($focus->last_name)) { |
|
77 | + if (!empty($focus->first_name) && !empty($focus->last_name)) { |
|
78 | 78 | $name = $locale->getLocaleFormattedName($focus->first_name, $focus->last_name); |
79 | 79 | } |
80 | - if(empty($name)) { |
|
80 | + if (empty($name)) { |
|
81 | 81 | $name = '*'; |
82 | 82 | } |
83 | 83 | } |
84 | 84 | |
85 | 85 | $userPref = $current_user->getPreference('email_link_type'); |
86 | 86 | $defaultPref = $sugar_config['email_default_client']; |
87 | - if($userPref != '') { |
|
87 | + if ($userPref != '') { |
|
88 | 88 | $client = $userPref; |
89 | 89 | } else { |
90 | 90 | $client = $defaultPref; |
91 | 91 | } |
92 | 92 | |
93 | - if($client == 'sugar') |
|
93 | + if ($client == 'sugar') |
|
94 | 94 | { |
95 | 95 | $composeData = array( |
96 | 96 | 'load_id' => $layout_def['fields']['ID'], |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | 'return_action' => $action, |
102 | 102 | 'return_id' => $record |
103 | 103 | ); |
104 | - if(isset($layout_def['fields']['FULL_NAME'])){ |
|
104 | + if (isset($layout_def['fields']['FULL_NAME'])) { |
|
105 | 105 | $composeData['parent_name'] = $layout_def['fields']['FULL_NAME']; |
106 | 106 | $composeData['to_email_addrs'] = sprintf("%s <%s>", $layout_def['fields']['FULL_NAME'], $layout_def['fields']['EMAIL1']); |
107 | 107 | } else { |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $emailUi = new EmailUI(); |
112 | 112 | $link = $emailUi->populateComposeViewFields(); |
113 | 113 | } else { |
114 | - $link = '<a href="mailto:' . $value .'" >'; |
|
114 | + $link = '<a href="mailto:'.$value.'" >'; |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | return $link.$value.'</a>'; |
@@ -45,121 +45,121 @@ |
||
45 | 45 | |
46 | 46 | class SugarWidgetSubPanelTopCreateTaskButton 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="Tasks"; |
|
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($defines['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="Tasks"; |
|
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($defines['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 | - |
|
151 | - return $button; |
|
152 | - } |
|
153 | - |
|
154 | - |
|
155 | - function display($defines, $additionalFormFields = null, $nonbutton = false) |
|
156 | - { |
|
157 | - $focus = new Task; |
|
158 | - if ( !$focus->ACLAccess('EditView') ) { |
|
159 | - return ''; |
|
160 | - } |
|
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 | + |
|
151 | + return $button; |
|
152 | + } |
|
153 | + |
|
154 | + |
|
155 | + function display($defines, $additionalFormFields = null, $nonbutton = false) |
|
156 | + { |
|
157 | + $focus = new Task; |
|
158 | + if ( !$focus->ACLAccess('EditView') ) { |
|
159 | + return ''; |
|
160 | + } |
|
161 | 161 | |
162 | - return parent::display($defines, $additionalFormFields); |
|
163 | - } |
|
162 | + return parent::display($defines, $additionalFormFields); |
|
163 | + } |
|
164 | 164 | } |
165 | 165 | ?> |
@@ -1,5 +1,5 @@ discard block |
||
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 |
||
50 | 50 | global $app_strings; |
51 | 51 | global $currentModule; |
52 | 52 | |
53 | - $this->module="Tasks"; |
|
53 | + $this->module = "Tasks"; |
|
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 |
||
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 |
||
78 | 78 | $defines['child_module_name'] = $defines['module']; |
79 | 79 | } |
80 | 80 | |
81 | - if(empty($defines['subpanelDiv'])) |
|
81 | + if (empty($defines['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 |
||
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 |
||
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 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | function display($defines, $additionalFormFields = null, $nonbutton = false) |
156 | 156 | { |
157 | 157 | $focus = new Task; |
158 | - if ( !$focus->ACLAccess('EditView') ) { |
|
158 | + if (!$focus->ACLAccess('EditView')) { |
|
159 | 159 | return ''; |
160 | 160 | } |
161 | 161 |
@@ -1,5 +1,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |