本文整理汇总了PHP中CIntranetUtils类的典型用法代码示例。如果您正苦于以下问题:PHP CIntranetUtils类的具体用法?PHP CIntranetUtils怎么用?PHP CIntranetUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CIntranetUtils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _FormatUser
function _FormatUser(&$arUser, $arPath)
{
global $USER, $CACHE_ABSENCE;
if ($arUser['PERSONAL_PHOTO']) {
$arImage = CIntranetUtils::InitImage($arUser['PERSONAL_PHOTO'], 30);
$arUser['PERSONAL_PHOTO'] = $arImage['IMG'];
}
if ($arPath['DETAIL_URL']) {
$arUser['DETAIL_URL'] = str_replace('#ID#', $arUser['ID'], $arPath['DETAIL_URL']);
}
$arUser["canViewProfile"] = CSocNetUserPerms::CanPerformOperation($USER->GetID(), $arUser['ID'], "viewprofile", CSocNetUser::IsCurrentUserModuleAdmin());
$arUser["canMessage"] = CSocNetUserPerms::CanPerformOperation($USER->GetID(), $arUser['ID'], "message", CSocNetUser::IsCurrentUserModuleAdmin());
if ($arPath['MESSAGES_CHAT_URL']) {
$arUser['MESSAGES_CHAT_URL'] = str_replace('#ID#', $arUser['ID'], $arPath['MESSAGES_CHAT_URL']);
}
$arUser['IS_ABSENT'] = CIntranetUtils::IsUserAbsent($arUser['ID']);
$arUser['IS_ONLINE'] = CSocNetUser::IsOnLine($arUser['ID']);
if ($arUser['IS_ABSENT']) {
$maxAbsence = 0;
foreach ($CACHE_ABSENCE[$arUser["ID"]] as $arAbsence) {
if (MakeTimeStamp($arAbsence["DATE_TO"]) > $maxAbsence) {
$arUser['ABSENT_TILL'] = $arAbsence["DATE_TO"];
}
}
}
$arFilter = array("TO_USER_ID" => $arUser['ID'], "MESSAGE_TYPE" => SONET_MESSAGE_PRIVATE, "FROM_USER_ID" => $USER->GetID());
$dbMessages = CSocNetMessages::GetList(array("DATE_CREATE" => "DESC"), $arFilter, false, array("nTopCount" => 1), array("ID", "DATE_CREATE"));
if ($arMessages = $dbMessages->GetNext()) {
$arUser['LAST_CHAT'] = $arMessages["DATE_CREATE"];
}
return true;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:32,代码来源:index.php
示例2: executeComponent
public function executeComponent()
{
global $USER, $APPLICATION;
if (!CModule::IncludeModule('mail')) {
ShowError(GetMessage('MAIL_MODULE_NOT_INSTALLED'));
return;
}
if (!is_object($USER) || !$USER->IsAuthorized()) {
$APPLICATION->AuthForm('');
return;
}
if (!CIntranetUtils::IsExternalMailAvailable()) {
ShowError(GetMessage('INTR_MAIL_UNAVAILABLE'));
return;
}
$page = isset($_REQUEST['page']) ? $_REQUEST['page'] : null;
switch ($page) {
case 'domain':
return $this->executeDomainPage();
break;
case 'manage':
return $this->executeManagePage();
break;
case 'success':
return $this->executeSuccessPage();
break;
default:
return $this->executeHomePage($page);
}
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:30,代码来源:class.php
示例3: execute
public static function execute()
{
global $USER;
$result = array();
$error = false;
if (!CModule::IncludeModule('mail')) {
$error = GetMessage('MAIL_MODULE_NOT_INSTALLED');
}
if ($error === false) {
if (!is_object($USER) || !$USER->IsAuthorized()) {
$error = GetMessage('INTR_MAIL_AUTH');
}
}
if ($error === false) {
if (!CIntranetUtils::IsExternalMailAvailable()) {
$error = GetMessage('INTR_MAIL_UNAVAILABLE');
}
}
if ($error === false) {
$page = isset($_REQUEST['page']) ? $_REQUEST['page'] : null;
$act = isset($_REQUEST['act']) ? $_REQUEST['act'] : null;
switch ($page) {
case 'domain':
$result = (array) self::handleDomainAction($act, $error);
break;
case 'manage':
$result = (array) self::handleManageAction($act, $error);
break;
default:
$result = (array) self::handleDefaultAction($act, $error);
}
}
self::returnJson(array_merge(array('result' => $error === false ? 'ok' : 'error', 'error' => CharsetConverter::ConvertCharset($error, SITE_CHARSET, 'UTF-8')), $result));
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:34,代码来源:ajax.php
示例4: isSupervisor
/**
* Check if user is head of any company departmant
* @param integer $userID User ID
* @return boolean
*/
public static function isSupervisor($userID)
{
if (!Loader::includeModule('intranet')) {
return false;
}
$dbResult = \CIntranetUtils::GetSubordinateDepartmentsList($userID);
return is_array($dbResult->Fetch());
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:13,代码来源:intranetmanager.php
示例5: executeComponent
public function executeComponent()
{
global $APPLICATION;
$this->arParams['LAST_MAIL_CHECK'] = null;
$this->arParams['IS_TIME_TO_MAIL_CHECK'] = null;
$settedUp = null;
if (defined('SKIP_MAIL_CHECK') && SKIP_MAIL_CHECK == true) {
$settedUp = false;
}
if (defined('ADMIN_SECTION') && ADMIN_SECTION == true) {
$settedUp = false;
}
if ($settedUp !== false) {
$isMobileInstalled = COption::GetOptionString('main', 'wizard_mobile_installed', 'N', SITE_ID) == 'Y';
$isMobileVersion = strpos($APPLICATION->GetCurPage(), SITE_DIR . 'm/') === 0;
if ($isMobileInstalled && $isMobileVersion) {
$settedUp = false;
}
}
if ($settedUp !== false) {
if (!is_callable(array('CIntranetUtils', 'IsExternalMailAvailable')) || !CIntranetUtils::IsExternalMailAvailable()) {
$settedUp = false;
}
}
if ($settedUp !== false) {
$lastMailCheck = CUserOptions::GetOption('global', 'last_mail_check_' . SITE_ID, null);
if (isset($lastMailCheck) && intval($lastMailCheck) < 0) {
$settedUp = false;
}
}
if ($settedUp !== false) {
$isTimeToMailCheck = true;
if (isset($lastMailCheck)) {
$settedUp = true;
$isTimeToMailCheck = false;
if (intval($lastMailCheck) >= 0) {
$checkInterval = COption::GetOptionString('intranet', 'mail_check_period', 10) * 60;
$isTimeToMailCheck = time() - intval($lastMailCheck) >= $checkInterval;
}
}
}
if ($settedUp !== false) {
$this->arParams['LAST_MAIL_CHECK'] = $lastMailCheck;
$this->arParams['IS_TIME_TO_MAIL_CHECK'] = $isTimeToMailCheck;
}
$this->arParams['SETTED_UP'] = $settedUp;
$this->includeComponentTemplate();
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:48,代码来源:class.php
示例6: searchImmediateEmployeesInSubDepartments
private static function searchImmediateEmployeesInSubDepartments($departmentId)
{
$arDepartmentHeads = array();
$arQueueDepartmentsEmployees = array();
// IDs of departments where we need employees
$arSubDepartments = CIntranetUtils::getSubDepartments($departmentId);
if (is_array($arSubDepartments)) {
foreach ($arSubDepartments as $subDepId) {
$headUserId = CIntranetUtils::GetDepartmentManagerID($subDepId);
if ($headUserId) {
$arDepartmentHeads[] = $headUserId;
} else {
$arQueueDepartmentsEmployees[] = $subDepId;
$result = self::searchImmediateEmployeesInSubDepartments($subDepId);
$arDepartmentHeads = array_merge($arDepartmentHeads, $result['arDepartmentHeads']);
$arQueueDepartmentsEmployees = array_merge($arQueueDepartmentsEmployees, $result['arQueueDepartmentsEmployees']);
}
}
}
return array('arDepartmentHeads' => $arDepartmentHeads, 'arQueueDepartmentsEmployees' => $arQueueDepartmentsEmployees);
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:21,代码来源:intranettools.php
示例7: foreach
$arDepCacheValue[$arSect['ID']] = $arSect['NAME'];
}
}
foreach ($arUser['UF_DEPARTMENT'] as $key => $sect) {
$arDep[$sect] = $arDepCacheValue[$sect];
}
}
$arUser['UF_DEPARTMENT'] = $arDep;
$arUser["DETAIL_URL"] = $arItem["URL"];
$arUser['IS_ONLINE'] = $bSoNet && $arUser['IS_ONLINE'] == "Y";
if ($arUser['PERSONAL_BIRTHDAY']) {
$arBirthDate = ParseDateTime($arUser['PERSONAL_BIRTHDAY'], CSite::GetDateFormat('SHORT'));
$arUser['IS_BIRTHDAY'] = intval($arBirthDate['MM']) == date('n') && intval($arBirthDate['DD']) == date('j');
}
$arUser['IS_FEATURED'] = CIntranetUtils::IsUserHonoured($arUser['ID']);
$arUser['IS_ABSENT'] = CIntranetUtils::IsUserAbsent($arUser['ID']);
$arResult["SEARCH"][$i]["USER"] = $arUser;
}
}
}
$arResult['USER_PROP'] = array();
$arRes = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("USER", 0, LANGUAGE_ID);
if (!empty($arRes)) {
foreach ($arRes as $key => $val) {
$arResult['USER_PROP'][$val["FIELD_NAME"]] = strLen($val["EDIT_FORM_LABEL"]) > 0 ? $val["EDIT_FORM_LABEL"] : $val["FIELD_NAME"];
}
}
}
$arrDropdown = array();
$arResult["DROPDOWN_SONET"] = array();
$EntityType = array_key_exists("arrFILTER", $arParams) && in_array("socialnetwork_group", $arParams["arrFILTER"]) ? SONET_ENTITY_GROUP : SONET_ENTITY_USER;
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:result_modifier.php
示例8: CTimeManUser
$user_url = COption::GetOptionString('intranet', 'path_user', '/company/personal/user/#USER_ID#/', $_REQUEST['site_id']);
$obUser = new CTimeManUser($arRes['USER_ID']);
$obUser->SITE_ID = $_REQUEST['site_id'];
$bReturnRes = true;
$dbRes = CUser::GetList($by = 'ID', $order = 'ASC', array('ID' => $arRes['USER_ID']), array('SELECT' => array('UF_*')));
$arCurrentUser = $dbRes->GetNext();
$arCurrentUser['PHOTO'] = $arCurrentUser['PERSONAL_PHOTO'] > 0 ? CIntranetUtils::InitImage($arCurrentUser['PERSONAL_PHOTO'], 32, 0, BX_RESIZE_IMAGE_EXACT) : array();
$arManagers = CTimeMan::GetUserManagers($arRes['USER_ID']);
if (!is_array($arManagers) || count($arManagers) <= 0) {
$arManagers = array($arRes['USER_ID']);
}
$user_url = COption::GetOptionString('intranet', 'path_user', '/company/personal/user/#USER_ID#/', $_REQUEST['site_id']);
$dbManagers = CUser::GetList($by = 'ID', $order = 'ASC', array('ID' => implode('|', $arManagers)));
$arCurrentUserManagers = array();
while ($manager = $dbManagers->Fetch()) {
$manager['PHOTO'] = $manager['PERSONAL_PHOTO'] > 0 ? CIntranetUtils::InitImage($manager['PERSONAL_PHOTO'], 32, 0, BX_RESIZE_IMAGE_EXACT) : array();
$arCurrentUserManagers[] = array('ID' => $manager['ID'], 'LOGIN' => $manager['LOGIN'], 'NAME' => CUser::FormatName(CSite::GetNameFormat(false), $manager, true, false), 'URL' => str_replace(array('#ID#', '#USER_ID#'), $manager['ID'], $user_url), 'WORK_POSITION' => $manager['WORK_POSITION'], 'PHOTO' => $manager['PHOTO']['CACHE']['src']);
}
$arRes['DATE_START'] = MakeTimeStamp($arRes['DATE_START']) - CTimeZone::GetOffset();
$arRes['DATE_FINISH'] = MakeTimeStamp($arRes['DATE_FINISH']) - CTimeZone::GetOffset();
$arInfo = array('INFO' => $arRes, 'DATE_TEXT' => FormatDate('j F Y', $arRes['DATE_START']), 'CALENDAR_ENABLED' => CBXFeatures::IsFeatureEnabled('Calendar'), 'TASKS_ENABLED' => CBXFeatures::IsFeatureEnabled('Tasks') && IsModuleInstalled('tasks'));
$cur_info = $obUser->GetCurrentInfo();
if ($cur_info['ID'] == $ID) {
$arInfo['STATE'] = $obUser->State();
$arInfo['EXPIRED_DATE'] = $obUser->GetExpiredRecommendedDate();
} else {
$arInfo['STATE'] = 'CLOSED';
}
$res = array('FROM' => array('ID' => $arCurrentUser['ID'], 'LOGIN' => $arCurrentUser['LOGIN'], 'NAME' => CUser::FormatName(CSite::GetNameFormat(false), $arCurrentUser, true, false), 'URL' => str_replace(array('#ID#', '#USER_ID#'), $arCurrentUser['ID'], $user_url), 'WORK_POSITION' => $arCurrentUser['WORK_POSITION'], 'PHOTO' => $arCurrentUser['PHOTO']['CACHE']['src']), 'TO' => array_values($arCurrentUserManagers), 'INFO' => $arInfo, 'REPORT' => '', 'CAN_EDIT' => $bCanEdit ? 'Y' : 'N', 'REPORTS' => array());
if (count($res['TO']) <= 0) {
$res['TO'] = array($res['FROM']);
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:timeman.php
示例9: elseif
$show_user = "active";
if (isset($_REQUEST['show_user'])) {
if ($_REQUEST['show_user'] == 'inactive') {
$show_user = 'inactive';
} elseif ($_REQUEST['show_user'] == 'fired') {
$show_user = 'fired';
} elseif ($_REQUEST['show_user'] == 'extranet') {
$show_user = 'extranet';
} elseif ($_REQUEST['show_user'] == 'all') {
$show_user = 'all';
} else {
$show_user = 'active';
}
}
$arParams["show_user"] = $show_user;
$outlook_link = 'javascript:' . CIntranetUtils::GetStsSyncURL(array('LINK_URL' => $APPLICATION->GetCurPage()), 'contacts', $arParams["EXTRANET_TYPE"] == "employees" ? true : false);
global $USER;
?>
<div class="employee-search-block">
<?php
if (($USER->CanDoOperation('bitrix24_invite') && IsModuleInstalled('bitrix24') || !IsModuleInstalled("bitrix24") && $USER->CanDoOperation('edit_all_users')) && CModule::IncludeModule('intranet') && $arParams['TABLE_VIEW'] != 'group_table') {
?>
<a class="webform-small-button webform-small-button-blue bx24-top-toolbar-add" href="javascript:void(0)" onclick="<?php
echo CIntranetInviteDialog::ShowInviteDialogLink();
?>
">
<span class="webform-small-button-icon"></span>
<span class="webform-small-button-text"><?php
echo GetMessage("INTR_COMP_IS_TPL_TOOLBAR_USER_INVITE");
?>
</span>
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:template.php
示例10: array
$arResult['DEPARTMENTS'] = array();
$dbRes = CIntranetUtils::GetSubordinateDepartmentsList($arResult["User"]["ID"]);
while ($arRes = $dbRes->GetNext()) {
$arRes['URL'] = str_replace('#ID#', $arRes['ID'], $arParams['PATH_TO_CONPANY_DEPARTMENT']);
$arResult['DEPARTMENTS'][$arRes['ID']] = $arRes;
$arResult['DEPARTMENTS'][$arRes['ID']]['EMPLOYEE_COUNT'] = 0;
$rsUsers = CIntranetUtils::GetDepartmentEmployees(array($arRes['ID']), $bRecursive = true);
while ($arUser = $rsUsers->Fetch()) {
if ($arUser['ID'] != $arResult["User"]["ID"]) {
//self
$arResult['DEPARTMENTS'][$arRes['ID']]['EMPLOYEE_COUNT']++;
}
}
}
//managers
$arResult['MANAGERS'] = CIntranetUtils::GetDepartmentManager($arResult["User"]["UF_DEPARTMENT"], $arResult["User"]["ID"], true);
if ($arParams["CACHE_TIME"] > 0) {
$obCache->EndDataCache(array('DEPARTMENTS' => $arResult['DEPARTMENTS'], 'MANAGERS' => $arResult['MANAGERS']));
if (defined("BX_COMP_MANAGED_CACHE")) {
$GLOBALS["CACHE_MANAGER"]->EndTagCache();
}
}
} elseif ($arParams["CACHE_TIME"] > 0) {
$vars = $obCache->GetVars();
$arResult['DEPARTMENTS'] = $vars['DEPARTMENTS'];
$arResult['MANAGERS'] = $vars['MANAGERS'];
}
if (CModule::IncludeModule("extranet") && CExtranet::IsExtranetSite() && !CExtranet::IsIntranetUser()) {
$arResult['MANAGERS'] = array();
}
}
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php
示例11: UpdateListItems
public function UpdateListItems($listName, $updates)
{
global $USER;
$arStatusValues = array_flip($this->arStatusValues);
$arPriorityValues = array_flip($this->arPriorityValues);
if (!$listName_original = CIntranetUtils::checkGUID($listName))
return new CSoapFault('Data error', 'Wrong GUID - '.$listName);
$obResponse = new CXMLCreator('Results');
$listName = ToUpper(CIntranetUtils::makeGUID($listName_original));
$arSections = CCalendarSect::GetList(array('arFilter' => array('XML_ID' => $listName_original)));
if (!$arSections || !is_array($arSections[0]))
return new CSoapFault(
'List not found',
'List with '.$listName.' GUID not found'
);
$arSection = $arSections[0];
$bGroup = $arSection['CAL_TYPE'] == 'group';
$calType = $arSection['CAL_TYPE'];
$ownerId = $arSection['OWNER_ID'];
if ($bGroup)
{
CModule::IncludeModule('socialnetwork');
$arGroupTmp = CSocNetGroup::GetByID($arSection['SOCNET_GROUP_ID']);
if ($arGroupTmp["CLOSED"] == "Y")
if (COption::GetOptionString("socialnetwork", "work_with_closed_groups", "N") != "Y")
return new CSoapFault('Cannot modify archive group calendar', 'Cannot modify archive group calendar');
}
$obBatch = $updates->children[0];
$atrONERROR = $obBatch->getAttribute('OnError');
$atrDATEINUTC = $obBatch->getAttribute('DateInUtc');
$atrPROPERTIES = $obBatch->getAttribute('Properties');
$arChanges = $obBatch->children;
$arResultIDs = array();
$dateStart = ConvertTimeStamp(strtotime('-1 hour'), 'FULL');
$arResponseRows = array();
$arReplicationIDs = array();
$userId = (is_object($USER) && $USER->GetID()) ? $USER->GetID() : 1;
foreach ($arChanges as $obMethod)
{
$arData = array('_command' => $obMethod->getAttribute('Cmd'));
foreach ($obMethod->children as $obField)
{
$name = $obField->getAttribute('Name');
if ($name == 'MetaInfo')
$name .= '_'.$obField->getAttribute('Property');
$arData[$name] = $obField->content;
}
if ($arData['_command'] == 'Delete')
{
$obRes = new CXMLCreator('Result');
$obRes->setAttribute('ID', $obMethod->getAttribute('ID').','.$arData['_command']);
$obRes->setAttribute('List', $listName);
$obRes->addChild($obNode = new CXMLCreator('ErrorCode'));
$res = CCalendar::DeleteEvent($arData['ID']);
if ($res === true)
$obNode->setData('0x00000000');
else
$obNode->setData('0x81020014');
/*
0x00000000 - ok
0x81020015 - data conflict
0x81020014 - generic error such as invalid value for Field
0x81020016 - item does not exist
*/
$obResponse->addChild($obRes);
}
elseif ($arData['_command'] == 'New' || $arData['_command'] == 'Update')
{
$q = ToLower($arData['Description']);
if (($pos = strrpos($q, '</body>')) !== false) $arData['Description'] = substr($arData['Description'], 0, $pos);
if (($pos = strpos($q, '<body>')) !== false) $arData['Description'] = substr($arData['Description'], $pos + 6);
$arData['Description'] = str_replace('</DIV>', "\r\n</DIV>", $arData['Description']);
$arData['Description'] = str_replace(array(" ", " "), "", $arData['Description']);
$arData['Description'] = preg_replace("/<![^>]*>/", '', $arData['Description']);
//$arData['Description'] = strip_tags($arData['Description']);
$arData['Description'] = trim($arData['Description']);
$arData['Location'] = trim($arData['Location']);
if (isset($arData['EventDate']))
{
$arData['EventDate'] = $this->__makeTS($arData['EventDate']);
$arData['EndDate'] = $this->__makeTS($arData['EndDate']) + ($arData['fAllDayEvent'] ? -86340 : 0);
//.........这里部分代码省略.........
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:101,代码来源:webservice.php
示例12: Execute
public function Execute()
{
if (!CModule::IncludeModule("intranet")) {
$this->UserType = "random";
$this->SkipAbsent = "N";
}
$arUsers = array();
if ($this->UserType == "boss") {
if ($this->SkipAbsent != "Y" && $this->SkipAbsent != "N") {
$this->SkipAbsent = "N";
}
$arUsers = $this->GetUsersList($this->UserParameter, false);
if (count($arUsers) <= 0) {
$this->GetUser = null;
return CBPActivityExecutionStatus::Closed;
}
$userId = $arUsers[0];
$arUserDepartmentId = null;
$dbUser = CUser::GetByID($userId);
if ($arUser = $dbUser->Fetch()) {
if (isset($arUser["UF_DEPARTMENT"])) {
if (!is_array($arUser["UF_DEPARTMENT"])) {
$arUser["UF_DEPARTMENT"] = array($arUser["UF_DEPARTMENT"]);
}
foreach ($arUser["UF_DEPARTMENT"] as $v) {
$arUserDepartmentId[] = $v;
}
}
}
$arUserDepartments = array();
$departmentIBlockId = COption::GetOptionInt('intranet', 'iblock_structure');
foreach ($arUserDepartmentId as $departmentId) {
$ar = array();
$dbPath = CIBlockSection::GetNavChain($departmentIBlockId, $departmentId);
while ($arPath = $dbPath->GetNext()) {
$ar[] = $arPath["ID"];
}
$arUserDepartments[] = array_reverse($ar);
}
$arBoss = array();
foreach ($arUserDepartments as $arV) {
$maxLevel = $this->MaxLevel;
foreach ($arV as $level => $deptId) {
if ($maxLevel > 0 && $level + 1 > $maxLevel) {
break;
}
$dbRes = CIBlockSection::GetList(array(), array('IBLOCK_ID' => $departmentIBlockId, 'ID' => $deptId), false, array('ID', 'UF_HEAD'));
while ($arRes = $dbRes->Fetch()) {
if ($arRes["UF_HEAD"] == $userId || intval($arRes["UF_HEAD"]) <= 0 || $this->SkipAbsent == "Y" && CIntranetUtils::IsUserAbsent($arRes["UF_HEAD"])) {
$maxLevel++;
continue;
}
if (!in_array($arRes["UF_HEAD"], $arBoss)) {
$arBoss[] = $arRes["UF_HEAD"];
}
}
}
}
$ar = array();
foreach ($arBoss as $v) {
$ar[] = "user_" . $v;
}
if (count($ar) == 0) {
$ar = null;
} elseif (count($ar) == 1) {
$ar = $ar[0];
}
if ($ar !== null) {
$this->GetUser = $ar;
return CBPActivityExecutionStatus::Closed;
}
} else {
if ($this->SkipAbsent != "Y" && $this->SkipAbsent != "N") {
$this->SkipAbsent = "Y";
}
$arUsers = $this->GetUsersList($this->UserParameter, $this->SkipAbsent == "Y");
if ($this->SkipAbsent == "Y") {
$arUsers = array_values($arUsers);
}
if (count($arUsers) > 0) {
$rnd = mt_rand(0, count($arUsers) - 1);
$this->GetUser = "user_" . $arUsers[$rnd];
return CBPActivityExecutionStatus::Closed;
}
}
$arReserveUsers = $this->GetUsersList($this->ReserveUserParameter, $this->SkipAbsent == "Y");
if (count($arReserveUsers) > 0) {
if ($this->UserType == 'random') {
$this->GetUser = 'user_' . $arReserveUsers[0];
} else {
foreach ($arReserveUsers as &$user) {
$user = 'user_' . $user;
}
unset($user);
$this->GetUser = $arReserveUsers;
}
}
return CBPActivityExecutionStatus::Closed;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:99,代码来源:getuseractivity.php
示例13: array
: </td>
<td>
<?php
if ($arResult['CURRENT_USER']['DEPARTMENT_TOP']) {
?>
<input type="checkbox" id="only_mine_office" onclick="BXChangeFilterTop_adv(this)" <?php
echo $arResult['FILTER_VALUES'][$arParams['FILTER_NAME'] . '_UF_DEPARTMENT'] == $arResult['CURRENT_USER']['DEPARTMENT_TOP'] || $arResult['FILTER_VALUES'][$arParams['FILTER_NAME'] . '_UF_DEPARTMENT'] == array($arResult['CURRENT_USER']['DEPARTMENT_TOP']) ? 'checked="checked"' : '';
?>
/>
<label for="only_mine_office"><?php
echo GetMessage('INTR_ISS_PARAM_DEPARTMENT_MINE');
?>
</label><br />
<?php
}
CIntranetUtils::ShowDepartmentFilter($arResult['UF_DEPARTMENT_field'], $arResult['bVarsFromForm']);
?>
</td>
</tr><tr>
<?php
}
?>
<td class="bx-filter-caption"><?php
echo GetMessage('INTR_ISS_PARAM_POST');
?>
: </td>
<td><input type="text" name="<?php
echo $arParams['FILTER_NAME'];
?>
_POST" value="<?php
echo $arResult['FILTER_VALUES'][$arParams['FILTER_NAME'] . '_POST'];
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:template.php
示例14: GetMessage
$this->SetViewTarget("sidebar_tools_2", 100);
?>
<div class="sidebar-links">
<?php
if ($arResult['USER_CAN_SET_HEAD'] && $current_section) {
?>
<span id="blank"></span>
<a href="javascript:void(0)" id="bx_head_link" onclick="ShowHeadMenu(this);" style="display: none;"><i class="sidebar-action-head"></i><b><?php
echo GetMessage('INTR_IS_TPL_HEAD');
?>
<span></span></b></a>
<?php
}
?>
<a href="javascript:<?php
echo htmlspecialcharsbx(CIntranetUtils::GetStsSyncURL(array('LINK_URL' => $APPLICATION->GetCurPage()), 'contacts'));
?>
" title="<?php
echo GetMessage('INTR_IS_TPL_OUTLOOK_TITLE');
?>
"><i class="sidebar-action-outlook"></i><b><?php
echo GetMessage('INTR_IS_TPL_OUTLOOK');
?>
</b></a>
</div>
<?php
$this->EndViewTarget();
echo $sFilter;
?>
<br />
<?php
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:template.php
示例15: htmlspecialcharsbx
<tr><td><li><a href="javascript:<?php
echo htmlspecialcharsbx(CIntranetUtils::GetStsSyncURL(array('LINK_URL' => '/' . $USER->GetID() . '/'), 'tasks'));
?>
"><?php
echo GetMessage("COMPANY_TASKS");
?>
</a></td></tr>
<?php
if (COption::GetOptionInt("intranet", 'iblock_calendar', 0) > 0) {
$dbRs = CIBlockSection::GetList(array(), array("IBLOCK_ID" => COption::GetOptionInt("intranet", 'iblock_calendar', 0), 'CREATED_BY' => $USER->GetID()));
if ($arRs = $dbRs->Fetch()) {
$dbRs2 = CIBlockSection::GetList(array(), array('SECTION_ID' => $arRs["ID"]));
while ($arRs2 = $dbRs2->GetNext()) {
?>
<tr><td><li><a href="javascript:<?php
echo htmlspecialcharsbx(CIntranetUtils::GetStsSyncURL(array('ID' => $arRs2["ID"], 'LINK_URL' => 'company/personal/user/' . $USER->GetID() . '/calendar/'), 'calendar'));
?>
"><?php
echo GetMessage("COMPANY_CONNECT");
?>
<?php
echo $arRs2["NAME"];
?>
</a></td></tr>
<?php
}
?>
<?php
}
}
?>
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:outlook_inc.php
示例16: _GetWhere
protected static function _GetWhere($ID)
{
if ($SP_LIST_ID = CIntranetUtils::checkGUID($ID)) {
return 'SP_LIST_ID=\'' . $SP_LIST_ID . '\'';
} else {
$ID = intval($ID);
if ($ID <= 0) {
return false;
}
return 'IBLOCK_ID=\'' . $ID . '\'';
}
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:12,代码来源:sharepoint.php
示例17: getSubUsers
private static function getSubUsers($userId)
{
static $arSubUsersIdsCache = array();
if (!isset($arSubUsersIdsCache[$userId])) {
$arSubUsersIds = array();
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
$rsSubUsers = CIntranetUtils::GetSubordinateEmployees($userId, $bRecursive = true, $bSkipSelf = false, $onlyActive = 'Y');
while ($ar = $rsSubUsers->fetch()) {
$arSubUsersIds[] = (int) $ar['ID'];
}
$arSubUsersIdsCache[$userId] = $arSubUsersIds;
}
return $arSubUsersIdsCache[$userId];
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:14,代码来源:taskitem.php
示例18: array
}
$matches = array();
if (preg_match('/^(.*?)<[a-z0-9.\\-_]+@[a-z0-9.\\-]+> \\[([\\d]+?)\\]/i', $search, $matches)) {
$matches[2] = intval($matches[2]);
if ($matches[2] > 0 && (!is_array($arUsersToFilter) || in_array($matches[2], $arUsersToFilter))) {
$dbRes = CUser::GetByID($matches[2]);
if ($arRes = $dbRes->Fetch()) {
$arUsers = array(array('ID' => $arRes['ID'], 'NAME' => str_replace(array(';', ','), ' ', CIntranetUtils::FormatName($nameTemplate, $arRes, false)) . ' <' . $arRes['EMAIL'] . '>', 'UF_DEPARTMENT' => $arRes['UF_DEPARTMENT'], 'READY' => 'Y'));
Header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET);
echo CUtil::PhpToJsObject($arUsers);
die;
}
} elseif (strlen($matches[1]) > 0) {
$search = $matches[1];
}
}
$arUsers = array();
if (GetFilterQuery("TEST", $search)) {
$arFilter = array("ACTIVE" => "Y", "CONFIRM_CODE" => false, "NAME_SEARCH" => $search);
if ("I" == $EXTERNAL) {
$arFilter["!UF_DEPARTMENT"] = false;
}
$dbRes = CUser::GetList($by = "last_name", $order = "asc", $arFilter, array("SELECT" => array("UF_DEPARTMENT"), "FIELDS" => array("ID", "NAME", "LAST_NAME", "SECOND_NAME", "EMAIL", "LOGIN"), "NAV_PARAMS" => array("nTopCount" => 10)));
while ($arRes = $dbRes->Fetch()) {
$arUsers[] = array("ID" => $arRes["ID"], "NAME" => str_replace(array(';', ','), ' ', CIntranetUtils::FormatName($nameTemplate, $arRes, false)) . ' <' . $arRes['EMAIL'] . '>', "UF_DEPARTMENT" => $arRes["UF_DEPARTMENT"]);
}
}
Header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET);
echo CUtil::PhpToJsObject($arUsers);
die;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:ajax.php
示例19: array
$notSelectedUsersId = $arParams['VALUE'];
// Prevent using users, that doesn't activate it's account
// http://jabber.bx/view.php?id=29118
if (IsModuleInstalled('bitrix24')) {
$arFilter['CONFIRM_CODE'] = false;
}
$dbRes = CUser::GetList($by = 'last_name', $order = 'asc', $arFilter, array('SELECT' => array('UF_DEPARTMENT')));
while ($arRes = $dbRes->GetNext()) {
if (($key = array_search($arRes['ID'], $notSelectedUsersId)) !== false) {
//if user already selected, then we not select from extranet
unset($notSelectedUsersId[$key]);
}
$arResult["CURRENT_USERS"][] = array('ID' => $arRes['ID'], 'NAME' => CUser::FormatName($arParams["NAME_TEMPLATE"], $arRes, true, false), '~NAME' => CUser::FormatName($arParams["NAME_TEMPLATE"], array("NAME" => $arRes["~NAME"], "LAST_NAME" => $arRes["~LAST_NAME"], "LOGIN" => $arRes["~LOGIN"], "SECOND_NAME" => $arRes["~SECOND_NAME"]), true, false), 'LOGIN' => $arRes['LOGIN'], 'EMAIL' => $arRes['EMAIL'], 'WORK_POSITION' => $arRes['WORK_POSITION'] ? $arRes['WORK_POSITION'] : $arRes['PERSONAL_PROFESSION'], '~WORK_POSITION' => $arRes['~WORK_POSITION'] ? $arRes['~WORK_POSITION'] : $arRes['~PERSONAL_PROFESSION'], 'PHOTO' => (string) CIntranetUtils::createAvatar($arRes, array(), $arParams['SITE_ID']), 'HEAD' => false, 'SUBORDINATE' => is_array($arSubDeps) && is_array($arRes['UF_DEPARTMENT']) && array_intersect($arRes['UF_DEPARTMENT'], $arSubDeps) ? 'Y' : 'N', 'SUPERORDINATE' => in_array($arRes["ID"], $arManagers) ? 'Y' : 'N');
}
if ($notSelectedUsersId && CModule::IncludeModule('extranet')) {
foreach (CIntranetUserSelectorHelper::getExtranetUsers(implode('|', $notSelectedUsersId)) as $arRes) {
$arResult["CURRENT_USERS"][] = array('ID' => $arRes['ID'], 'NAME' => CUser::FormatName($arParams["NAME_TEMPLATE"], $arRes, true, false), '~NAME' => CUser::FormatName($arParams["NAME_TEMPLATE"], array("NAME" => $arRes["~NAME"], "LAST_NAME" => $arRes["~LAST_NAME"], "LOGIN" => $arRes["~LOGIN"], "SECOND_NAME" => $arRes["~SECOND_NAME"]), true, false), 'LOGIN' => $arRes['LOGIN'], 'EMAIL' => $arRes['EMAIL'], 'WORK_POSITION' => $arRes['WORK_POSITION'] ? $arRes['WORK_POSITION'] : $arRes['PERSONAL_PROFESSION'], '~WORK_POSITION' => $arRes['~WORK_POSITION'] ? $arRes['~WORK_POSITION'] : $arRes['~PERSONAL_PROFESSION'], 'PHOTO' => (string) CIntranetUtils::createAvatar($arRes, array(), $arParams['SITE_ID']), 'HEAD' => false, 'SUBORDINATE' => is_array($arSubDeps) && is_array($arRes['UF_DEPARTMENT']) && array_intersect($arRes['UF_DEPARTMENT'], $arSubDeps) ? 'Y' : 'N', 'SUPERORDINATE' => in_array($arRes["ID"], $arManagers) ? 'Y' : 'N');
}
unset($arRes);
}
}
$arResult['FIXED_USERS'] = isset($arParams['FIXED_USERS']) && is_array($arParams['FIXED_USERS']) ? $arParams['FIXED_USERS'] : array();
$groups = array();
if ($arParams["DISPLAY_TAB_GROUP"] == 'Y') {
$groups = CIntranetUserSelectorHelper::getUserGroups($USER->GetID());
}
$arResult["GROUPS"] = $groups;
$arResult["CURRENT_USERS"] = array_values(array_filter($arResult["CURRENT_USERS"], array('CIntranetUserSelectorHelper', 'filterViewableUsers')));
$arResult["LAST_USERS"] = array_values(array_filter($arResult["LAST_USERS"], array('CIntranetUserSelectorHelper', 'filterViewableUsers')));
CUtil::InitJSCore(array("tooltip"));
$this->IncludeComponentTemplate();
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php
示例20: GetAttachmentCollection
function GetAttachmentCollection($listName, $listItemID)
{
$start = microtime(true);
if (!($listName_original = CIntranetUtils::checkGUID($listName))) {
return new CSoapFault('Data error', 'Wrong GUID - ' . $listName);
}
$listName = ToUpper(CIntranetUtils::makeGUID($listName_original));
$listItemID = intval($listItemID);
$dbRes = CUser::GetByID($listItemID);
//$dbRes = CUser::GetList(($by="id"), ($order="asc"), array("ID_EQUAL_EXACT"=>IntVal($listItemID)));
//$dbRes = $GLOBALS['DB']->Query('SELECT PERSONAL_PHOTO FROM b_user WHERE id=\''.$listItemID.'\'');
$obData = new CXMLCreator('Attachments');
if (($arUser = $dbRes->Fetch()) && $arUser['PERSONAL_PHOTO']) {
$arImage = self::InitImage($arUser['PERSONAL_PHOTO'], 100, 100);
$obData->addChild($obAttachment = new CXMLCreator('Attachment'));
$obAttachment->setData(CHTTP::URN2URI($arImage['CACHE']['src']));
//$data = '<Attachments><Attachment>http://'.$_SERVER['SERVER_NAME'].$arImage['CACHE']['src'].'</Attachment></Attachments>';
}
// else
// {
// $data = '<Attachments></Attachments>';
// }
//return array('GetAttachmentCollectionResult' => $data);
return array('GetAttachmentCollectionResult' => $obData);
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:25,代码来源:ws_contacts.php
注:本文中的CIntranetUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论