Skip to content

Commit

Permalink
Replace explicit bean instantiations in files 51 - 60
Browse files Browse the repository at this point in the history
- File: '... /include/OutboundEmail/OutboundEmail.php'

   - Replaced 1 occurrence(s) of 'new Administration()'

- File: '... /include/EntryPointConfirmOptInHandler.php'

   - Replaced 1 occurrence(s) of 'new EmailMan()'

- File: '... /include/SearchForm/SearchForm.php'

   - Replaced 1 occurrence(s) of 'new SavedSearch()'

- File: '... /include/SearchForm/SearchForm2.php'

   - Replaced 1 occurrence(s) of 'new Currency()'

- File: '... /cron.php'

   - Replaced 1 occurrence(s) of 'new User()'

- File: '... /service/v3/SugarWebServiceUtilv3.php'

   - Replaced 1 occurrence(s) of 'new Release()'

- File: '... /service/v3/SugarWebServiceImplv3.php'

   - Replaced 1 occurrence(s) of 'new User()'

   - Replaced 1 occurrence(s) of 'new Currency()'

   - Replaced 1 occurrence(s) of 'new Tracker()'

   - Replaced 1 occurrence(s) of 'new Administration()'

- File: '... /service/v3_1/SugarWebServiceUtilv3_1.php'

   - Replaced 1 occurrence(s) of 'new Release()'

- File: '... /service/v3_1/SugarWebServiceImplv3_1.php'

   - Replaced 1 occurrence(s) of 'new User()'

   - Replaced 1 occurrence(s) of 'new Currency()'

   - Replaced 1 occurrence(s) of 'new Administration()'

- File: '... /service/v4_1/SugarWebServiceUtilv4_1.php'

   - Replaced 1 occurrence(s) of 'new User()'
  • Loading branch information
j.dang committed Jan 22, 2020
1 parent 65bf099 commit 30c71a6
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
$app_strings = return_application_language($current_language);

global $current_user;
$current_user = new User();
$current_user = BeanFactory::newBean('Users');
$current_user->getSystemUser();

$GLOBALS['log']->debug('--------------------------------------------> at cron.php <--------------------------------------------');
Expand Down
2 changes: 1 addition & 1 deletion include/EntryPointConfirmOptInHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private function methodConfirmOptInSelected($post)
$msg = '';

foreach ($uids as $uid) {
$emailMan = new EmailMan();
$emailMan = BeanFactory::newBean('EmailMan');
if (!$emailMan->addOptInEmailToEmailQueue($module, $uid)) {
$errors++;
} elseif ($emailMan->getLastOptInWarn()) {
Expand Down
2 changes: 1 addition & 1 deletion include/OutboundEmail/OutboundEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ public function isAllowUserAccessToSystemDefaultOutbound()
$a = $this->db->fetchByAssoc($r);
if (!empty($a)) {
// next see if the admin preference for using the system outbound is set
$admin = new Administration();
$admin = BeanFactory::newBean('Administration');
$admin->retrieveSettings('', true);
if (isset($admin->settings['notify_allow_default_outbound'])
&& $admin->settings['notify_allow_default_outbound'] == 2
Expand Down
2 changes: 1 addition & 1 deletion include/SearchForm/SearchForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ public function getButtons()
global $app_strings;

$SAVED_SEARCHES_OPTIONS = '';
$savedSearch = new SavedSearch();
$savedSearch = BeanFactory::newBean('SavedSearch');
$SAVED_SEARCHES_OPTIONS = $savedSearch->getSelect($this->module);
$str = "<input tabindex='2' title='{$app_strings['LBL_SEARCH_BUTTON_TITLE']}' onclick='SUGAR.savedViews.setChooser()' class='button' type='submit' name='button' value='{$app_strings['LBL_SEARCH_BUTTON_LABEL']}' id='search_form_submit'/>&nbsp;";
$str .= "<input tabindex='2' title='{$app_strings['LBL_CLEAR_BUTTON_TITLE']}' onclick='SUGAR.searchForm.clear_form(this.form); return false;' class='button' type='button' name='clear' value=' {$app_strings['LBL_CLEAR_BUTTON_LABEL']} ' id='search_form_clear'/>";
Expand Down
2 changes: 1 addition & 1 deletion include/SearchForm/SearchForm2.php
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@ public function generateSearchWhere($add_custom_fields = false, $module = '')
$currency_id = -99;
}
if ($currency_id != -99) {
$currency = new Currency();
$currency = BeanFactory::newBean('Currencies');
$currency->retrieve($currency_id);
$tmpfield_value = $currency->convertToDollar($tmpfield_value);
}
Expand Down
8 changes: 4 additions & 4 deletions service/v3/SugarWebServiceImplv3.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ public function login($user_auth, $application, $name_value_list)
$GLOBALS['log']->info('Begin: SugarWebServiceImpl->login');
global $sugar_config, $system_config;
$error = new SoapError();
$user = new User();
$user = BeanFactory::newBean('Users');
$success = false;
if (!empty($user_auth['encryption']) && $user_auth['encryption'] === 'PLAIN') {
$user_auth['password'] = md5($user_auth['password']);
}
//rrs
$system_config = new Administration();
$system_config = BeanFactory::newBean('Administration');
$system_config->retrieveSettings('system');
$authController = new AuthenticationController();
//rrs
Expand Down Expand Up @@ -146,7 +146,7 @@ public function login($user_auth, $application, $name_value_list)
$nameValueArray['user_default_team_id'] = self::$helperObject->get_name_value('user_default_team_id', $current_user->default_team);
$nameValueArray['user_default_dateformat'] = self::$helperObject->get_name_value('user_default_dateformat', $current_user->getPreference('datef'));
$nameValueArray['user_default_timeformat'] = self::$helperObject->get_name_value('user_default_timeformat', $current_user->getPreference('timef'));
$currencyObject = new Currency();
$currencyObject = BeanFactory::newBean('Currencies');
$currencyObject->retrieve($cur_id);
$nameValueArray['user_currency_name'] = self::$helperObject->get_name_value('user_currency_name', $currencyObject->name);
$_SESSION['user_language'] = $current_language;
Expand Down Expand Up @@ -329,7 +329,7 @@ public function get_last_viewed($session, $module_names)
if ($module == 'Home') {
$module = '';
}
$tracker = new Tracker();
$tracker = BeanFactory::newBean('Trackers');
$entryList = $tracker->get_recently_viewed($GLOBALS['current_user']->id, $module);
foreach ($entryList as $entry) {
$results[] = $entry;
Expand Down
2 changes: 1 addition & 1 deletion service/v3/SugarWebServiceUtilv3.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public function get_field_list($value, $fields, $translate=true)

if ($value->module_dir == 'Bugs') {
require_once('modules/Releases/Release.php');
$seedRelease = new Release();
$seedRelease = BeanFactory::newBean('Releases');
$options = $seedRelease->get_releases(true, "Active");
$options_ret = array();
foreach ($options as $name=>$value) {
Expand Down
6 changes: 3 additions & 3 deletions service/v3_1/SugarWebServiceImplv3_1.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,10 @@ public function login($user_auth, $application, $name_value_list = array())
$GLOBALS['log']->info('Begin: SugarWebServiceImpl->login');
global $sugar_config, $system_config;
$error = new SoapError();
$user = new User();
$user = BeanFactory::newBean('Users');
$success = false;
//rrs
$system_config = new Administration();
$system_config = BeanFactory::newBean('Administration');
$system_config->retrieveSettings('system');
$authController = new AuthenticationController();
//rrs
Expand Down Expand Up @@ -466,7 +466,7 @@ public function login($user_auth, $application, $name_value_list = array())
);


$currencyObject = new Currency();
$currencyObject = BeanFactory::newBean('Currencies');
$currencyObject->retrieve($cur_id);
$nameValueArray['user_currency_name'] = self::$helperObject->get_name_value(
'user_currency_name',
Expand Down
2 changes: 1 addition & 1 deletion service/v3_1/SugarWebServiceUtilv3_1.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public function get_field_list($value, $fields, $translate=true)

if ($value->module_dir == 'Bugs') {
require_once('modules/Releases/Release.php');
$seedRelease = new Release();
$seedRelease = BeanFactory::newBean('Releases');
$options = $seedRelease->get_releases(true, "Active");
$options_ret = array();
foreach ($options as $name=>$value) {
Expand Down
2 changes: 1 addition & 1 deletion service/v4_1/SugarWebServiceUtilv4_1.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function validate_authenticated($session_id)
if (!empty($_SESSION['is_valid_session']) && $this->is_valid_ip_address('ip_address') && $_SESSION['type'] == 'user') {
global $current_user;
require_once('modules/Users/User.php');
$current_user = new User();
$current_user = BeanFactory::newBean('Users');
$current_user->retrieve($_SESSION['user_id']);
$this->login_success();
$GLOBALS['log']->info('Begin: SoapHelperWebServices->validate_authenticated - passed');
Expand Down

0 comments on commit 30c71a6

Please sign in to comment.