diff --git a/admin/inc/class.admin_config.inc.php b/admin/inc/class.admin_config.inc.php index 6db4049e5b..ae38805f4d 100644 --- a/admin/inc/class.admin_config.inc.php +++ b/admin/inc/class.admin_config.inc.php @@ -291,7 +291,7 @@ class admin_config // make everything readonly and remove save/apply button, if user has not rights to store config if ($GLOBALS['egw']->acl->check('site_config_acce',2,'admin')) { - $readonlys[__ALL__] = true; + $readonlys['__ALL__'] = true; $readonlys['cancel'] = false; } diff --git a/api/src/Accounts.php b/api/src/Accounts.php index f7cc06c5ae..2ec473a64c 100644 --- a/api/src/Accounts.php +++ b/api/src/Accounts.php @@ -612,6 +612,20 @@ class Accounts $account['account_firstname'] , $account['account_lastname'], $account_id); } + /** + * Return formatted username for Links, does NOT throw if $account_id is not int + * + * @param $account_id + */ + static function title($account_id) + { + if (empty($account_id) || !is_numeric($account_id) && !($id = self::getInstance()->name2id($account_id))) + { + return '#'.$account_id; + } + return self::username($id ?? $account_id); + } + /** * Format an email address according to the system standard * diff --git a/api/src/Link.php b/api/src/Link.php index 40a3bafeda..f86e96fd36 100644 --- a/api/src/Link.php +++ b/api/src/Link.php @@ -154,7 +154,7 @@ class Link extends Link\Storage 'name' => 'Accounts', 'icon' => 'addressbook/accounts', 'query' => 'EGroupware\\Api\\Accounts::link_query', - 'title' => 'EGroupware\\Api\\Accounts::username', + 'title' => 'EGroupware\\Api\\Accounts::title', 'view' => array('menuaction'=>'addressbook.addressbook_ui.view','ajax'=>'true'), 'view_id' => 'account_id' ), @@ -914,7 +914,12 @@ class Link extends Link\Storage } else { - $title = self::title($app,$id); // no titles method --> fallback to query each link separate + try { + $title = self::title($app, $id); // no titles method --> fallback to query each link separate + } + catch (\Throwable $e) { + $title = lang('Error').': '.$e->getMessage(); + } } } $titles[$id] = $title; diff --git a/api/src/Sharing.php b/api/src/Sharing.php index 7962a0ab4b..13640b379b 100644 --- a/api/src/Sharing.php +++ b/api/src/Sharing.php @@ -396,7 +396,7 @@ class Sharing $class = strpos($status, '404') === 0 ? 'EGroupware\Api\Exception\NotFound' : (strpos($status, '401') === 0 ? 'EGroupware\Api\Exception\NoPermission' : 'EGroupware\Api\Exception'); - throw new $class($message, $status); + throw new $class($message, (int)$status); } /** diff --git a/calendar/inc/class.calendar_so.inc.php b/calendar/inc/class.calendar_so.inc.php index c38081cd7c..d8a19748f1 100644 --- a/calendar/inc/class.calendar_so.inc.php +++ b/calendar/inc/class.calendar_so.inc.php @@ -1663,6 +1663,14 @@ ORDER BY cal_user_type, cal_usre_id // check if recurrence enddate was adjusted if(isset($event['recur_enddate'])) { + if (is_object($event['recur_enddate'])) + { + $event['recur_enddate'] = Api\DateTime::user2server($event['recur_enddate'], 'ts'); + } + if (is_object($old_repeats['recur_enddate'])) + { + $old_repeats['recur_enddate'] = Api\DateTime::user2server($old_repeats['recur_enddate'], 'ts'); + } // recurrences need to be truncated if((int)$event['recur_enddate'] > 0 && ((int)$old_repeats['recur_enddate'] == 0 || (int)$old_repeats['recur_enddate'] > (int)$event['recur_enddate']) diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index 9f5359cb66..37b047e681 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -55,7 +55,7 @@ class calendar_uiforms extends calendar_ui /** * default locking time for entries, that are opened by another user * - * @var locktime in seconds + * @var int lock time in seconds */ var $locktime_default=1; @@ -262,7 +262,7 @@ class calendar_uiforms extends calendar_ui ); } - return array( + $ret = array( 'participant_types' => $participant_types, 'participants' => $participants, 'owner' => $owner, @@ -278,6 +278,7 @@ class calendar_uiforms extends calendar_ui 'videoconference' => !empty($_GET['videoconference']), '##notify_externals' => !empty($_GET['videoconference']) ? 'yes' : $this->cal_prefs['notify_externals'], ); + return $ret; } /** @@ -1872,7 +1873,7 @@ class calendar_uiforms extends calendar_ui if ($event['recur_type'] != MCAL_RECUR_NONE) { - $readonlys['recur_exception'] = !count($content['recur_exception']); // otherwise we get a delete button + $readonlys['recur_exception'] = empty($content['recur_exception']); // otherwise we get a delete button //$onclick =& $etpl->get_cell_attribute('button[delete]','onclick'); //$onclick = str_replace('Delete this event','Delete this series of recuring events',$onclick); } @@ -2843,7 +2844,7 @@ class calendar_uiforms extends calendar_ui #error_log(__METHOD__.print_r($content,true)); if (is_numeric($cal_id = $content ? $content : $_REQUEST['cal_id'])) { - if (!($ical =& $boical->exportVCal(array($cal_id),'2.0','PUBLISH',false))) + if (!($ical = $boical->exportVCal(array($cal_id),'2.0','PUBLISH',false))) { $msg = lang('Permission denied'); @@ -2872,7 +2873,7 @@ class calendar_uiforms extends calendar_ui } else { - $ical =& $boical->exportVCal($events,'2.0','PUBLISH',false); + $ical = $boical->exportVCal($events,'2.0','PUBLISH',false); Api\Header\Content::type($content['file'] ? $content['file'] : 'event.ics','text/calendar',bytes($ical)); echo $ical; exit(); diff --git a/importexport/inc/class.importexport_export_csv.inc.php b/importexport/inc/class.importexport_export_csv.inc.php index aa3a8e0aee..b143d53346 100644 --- a/importexport/inc/class.importexport_export_csv.inc.php +++ b/importexport/inc/class.importexport_export_csv.inc.php @@ -387,18 +387,16 @@ class importexport_export_csv implements importexport_iface_export_record $record->$name = ''; } } - foreach($fields['select-account'] ?? [] as $name) { + foreach($fields['select-account'] ?? [] as $name) + { // Compare against null to deal with empty arrays - if ($record->$name !== null) { - if(is_array($record->$name)) { - $names = array(); - foreach($record->$name as $_name) { - $names[] = Api\Accounts::username($_name); - } - $record->$name = implode(', ', $names); - } else { - $record->$name = Api\Accounts::username($record->$name); + if ($record->$name !== null) + { + $names = array(); + foreach((array)$record->$name as $_name) { + $names[] = Api\Accounts::title((int)$_name ?: $_name); } + $record->$name = implode(', ', $names); } else {