本文整理匯總了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;