本文整理汇总了PHP中erLhcoreClassUserDep::getDefaultUserDepartment方法的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassUserDep::getDefaultUserDepartment方法的具体用法?PHP erLhcoreClassUserDep::getDefaultUserDepartment怎么用?PHP erLhcoreClassUserDep::getDefaultUserDepartment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类erLhcoreClassUserDep
的用法示例。
在下文中一共展示了erLhcoreClassUserDep::getDefaultUserDepartment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: htmlspecialchars_decode
$chat->status_sub = erLhcoreClassModelChat::STATUS_SUB_OWNER_CHANGED;
$chat->user_typing_txt = (string) $chat->user . ' ' . htmlspecialchars_decode(erTranslationClassLhTranslation::getInstance()->getTranslation('chat/accepttrasnfer', 'has joined the chat!'), ENT_QUOTES);
$chat->user_typing = time();
// Change department if user cannot read current department, so chat appears in right menu
$filter = erLhcoreClassUserDep::parseUserDepartmetnsForFilter($currentUser->getUserID());
if ($filter !== true && !in_array($chat->dep_id, $filter)) {
$dep_id = erLhcoreClassUserDep::getDefaultUserDepartment();
if ($dep_id > 0) {
$chat->dep_id = $dep_id;
$chat->status_sub = erLhcoreClassModelChat::STATUS_SUB_OWNER_CHANGED;
}
}
}
if (!erLhcoreClassChat::hasAccessToRead($chat)) {
if ($currentUser->getUserID() == $chatTransfer->transfer_to_user_id) {
$dep_id = erLhcoreClassUserDep::getDefaultUserDepartment();
if ($dep_id > 0) {
$chat->dep_id = $dep_id;
$chat->status_sub = erLhcoreClassModelChat::STATUS_SUB_OWNER_CHANGED;
}
} else {
exit;
// User does not have permission to assign chat to himself
}
}
// All ok, we can make changes
erLhcoreClassChat::getSession()->update($chat);
erLhcoreClassTransfer::getSession()->delete($chatTransfer);
if ($Params['user_parameters_unordered']['postaction'] == 'singlewindow') {
erLhcoreClassModule::redirect('chat/single/' . $chat->id);
exit;