fix wrong namespace and replaced a couple more CreateObject

This commit is contained in:
Ralf Becker 2016-07-26 09:03:02 +02:00
parent b3a3ba39e2
commit babaab8278
3 changed files with 9 additions and 12 deletions

View File

@ -92,10 +92,7 @@ class calendar_datasource extends datasource
if (!is_array($this->pm_config)) if (!is_array($this->pm_config))
{ {
$c =& CreateObject('phpgwapi.config','projectmanager'); $this->pm_config = Api\Config::read('projectmanager');
$c->read_repository();
$this->pm_config = $c->config_data;
unset($c);
if (!$this->pm_config['hours_per_workday']) $this->pm_config['hours_per_workday'] = 8; if (!$this->pm_config['hours_per_workday']) $this->pm_config['hours_per_workday'] = 8;
} }
$ds['pe_planned_time'] -= $nights * 60 * (24 - $this->pm_config['hours_per_workday']); $ds['pe_planned_time'] -= $nights * 60 * (24 - $this->pm_config['hours_per_workday']);

View File

@ -577,7 +577,7 @@ class calendar_merge extends Api\Storage\Merge
$replacements = $this->contact_replacements(substr($participant,1),''); $replacements = $this->contact_replacements(substr($participant,1),'');
break; break;
case 'r': case 'r':
if (is_null(self::$resources)) self::$resources = CreateObject('resources.resources_bo'); if (is_null(self::$resources)) self::$resources = new resources_bo();
if (($resource = self::$resources->read(substr($participant,1)))) if (($resource = self::$resources->read(substr($participant,1))))
{ {
foreach($resource as $name => $value) foreach($resource as $name => $value)

View File

@ -372,7 +372,7 @@ class calendar_uiforms extends calendar_ui
{ {
continue; continue;
} }
// email or rfc822 addresse (eg. "Ralf Becker <ralf@domain.com>") // email or rfc822 addresse (eg. "Ralf Becker <ralf@domain.com>")
$email = array(); $email = array();
if(preg_match('/^(.*<)?([a-z0-9_.-]+@[a-z0-9_.-]{5,})>?$/i',$participant,$email)) if(preg_match('/^(.*<)?([a-z0-9_.-]+@[a-z0-9_.-]{5,})>?$/i',$participant,$email))
@ -483,7 +483,7 @@ class calendar_uiforms extends calendar_ui
{ {
// Update main window // Update main window
$client_updated = $this->update_client($event['id'], $content['edit_single']); $client_updated = $this->update_client($event['id'], $content['edit_single']);
// refreshing the calendar-view with the changed participant-status // refreshing the calendar-view with the changed participant-status
if($event['recur_type'] != MCAL_RECUR_NONE) if($event['recur_type'] != MCAL_RECUR_NONE)
{ {
@ -766,7 +766,7 @@ class calendar_uiforms extends calendar_ui
calendar_so::split_status($status,$q,$r); calendar_so::split_status($status,$q,$r);
if ($uid[0] != 'c' && $uid[0] != 'e' && $uid != $this->bo->user && $status != 'U') if ($uid[0] != 'c' && $uid[0] != 'e' && $uid != $this->bo->user && $status != 'U')
{ {
$preferences = new Preferences($uid); $preferences = new Api\Preferences($uid);
$part_prefs = $preferences->read_repository(); $part_prefs = $preferences->read_repository();
switch ($part_prefs['calendar']['reset_stati']) switch ($part_prefs['calendar']['reset_stati'])
{ {
@ -1028,7 +1028,7 @@ class calendar_uiforms extends calendar_ui
} }
else else
{ {
Framework::refresh_opener($msg, 'calendar', Framework::refresh_opener($msg, 'calendar',
$event['id'] . ($content['edit_single'] ? ':' . (int)$content['edit_single'] : '' ), $event['id'] . ($content['edit_single'] ? ':' . (int)$content['edit_single'] : '' ),
$button == 'save' && $client_updated ? ($content['id'] ? $update_type : 'add') : 'delete' $button == 'save' && $client_updated ? ($content['id'] ? $update_type : 'add') : 'delete'
); );
@ -2490,7 +2490,7 @@ class calendar_uiforms extends calendar_ui
$etpl = new etemplate_new('calendar.export'); $etpl = new etemplate_new('calendar.export');
$etpl->exec('calendar.calendar_uiforms.export',$content); $etpl->exec('calendar.calendar_uiforms.export',$content);
} }
/** /**
* Edit category ACL (admin only) * Edit category ACL (admin only)
* *
@ -2773,7 +2773,7 @@ class calendar_uiforms extends calendar_ui
calendar_so::split_status($status,$q,$r); calendar_so::split_status($status,$q,$r);
if ($uid[0] != 'c' && $uid[0] != 'e' && $uid != $this->bo->user && $status != 'U') if ($uid[0] != 'c' && $uid[0] != 'e' && $uid != $this->bo->user && $status != 'U')
{ {
$preferences = new Preferenes($uid); $preferences = new Api\Preferenes($uid);
$part_prefs = $preferences->read_repository(); $part_prefs = $preferences->read_repository();
switch ($part_prefs['calendar']['reset_stati']) switch ($part_prefs['calendar']['reset_stati'])
{ {
@ -2847,7 +2847,7 @@ class calendar_uiforms extends calendar_ui
{ {
$d = new Api\DateTime($date, Api\DateTime::$user_timezone); $d = new Api\DateTime($date, Api\DateTime::$user_timezone);
} }
// If we have a recuring event for a particular day, make an exception // If we have a recuring event for a particular day, make an exception
if ($event['recur_type'] != MCAL_RECUR_NONE && $date) if ($event['recur_type'] != MCAL_RECUR_NONE && $date)
{ {