本文整理汇总了PHP中CTask::GetIdByLetter方法的典型用法代码示例。如果您正苦于以下问题:PHP CTask::GetIdByLetter方法的具体用法?PHP CTask::GetIdByLetter怎么用?PHP CTask::GetIdByLetter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTask
的用法示例。
在下文中一共展示了CTask::GetIdByLetter方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ShowParamsHTMLByArray
<?
ShowParamsHTMLByArray($arAllOptions["controller_auth"]);
?>
<?endif?>
<?
$tabControl->BeginNextTab();
$module_id="main";
$GROUP_DEFAULT_TASK = COption::GetOptionString($module_id, "GROUP_DEFAULT_TASK", "");
if ($GROUP_DEFAULT_TASK == '')
{
$GROUP_DEFAULT_RIGHT = COption::GetOptionString($module_id, "GROUP_DEFAULT_RIGHT", "D");
$GROUP_DEFAULT_TASK = CTask::GetIdByLetter($GROUP_DEFAULT_RIGHT,$module_id,'module');
if ($GROUP_DEFAULT_TASK)
COption::SetOptionString($module_id, "GROUP_DEFAULT_TASK", $GROUP_DEFAULT_TASK);
}
?>
<tr>
<td width="50%"><b><?php
echo GetMessage("MAIN_BY_DEFAULT");
?>
</b></td>
<td width="50%">
<script>var arSubordTasks = [];</script>
<?
$arTasksInModule = CTask::GetTasksInModules(true,$module_id,'module');
$nID = COperation::GetIDByName('edit_subordinate_users');
$arTasks = $arTasksInModule['main'];
示例2: substr
if ($rcode == "ER") {
$errorMessage .= substr($responseBody, 2) . "<br />";
} elseif ($rcode != "OK") {
$errorMessage .= GetMessage("SPTEN_SCRM_ERR_ANSWER") . "<br />";
} else {
$crmUrl4Import = trim(substr($responseBody, 2));
}
}
}
if (empty($errorMessage)) {
if ($createNewSaleUser) {
$APPLICATION->SetGroupRight("sale", $groupId, "W", false);
//$APPLICATION->SetGroupRight("catalog", $groupId, "R", false);
CGroup::SetModulePermission($groupId, "catalog", CTask::GetIdByLetter("R", "catalog"));
//$APPLICATION->SetGroupRight("main", $groupId, "R", false);
CGroup::SetModulePermission($groupId, "main", CTask::GetIdByLetter("R", "main"));
$opt = COption::GetOptionString("sale", "1C_SALE_GROUP_PERMISSIONS", "");
$opt .= ($opt != "" ? "," : "") . $groupId;
COption::SetOptionString("sale", "1C_SALE_GROUP_PERMISSIONS", $opt);
function GetAccessArrTmp()
{
$PERM = array();
@(include $_SERVER["DOCUMENT_ROOT"] . "/bitrix/.access.php");
return $PERM;
}
$arFPermsTmp = GetAccessArrTmp();
$arFPerms = array_key_exists("admin", $arFPermsTmp) ? $arFPermsTmp["admin"] : array();
$arFPerms[$groupId . ""] = "R";
$APPLICATION->SetFileAccessPermission(array(SITE_ID, "/bitrix/admin"), $arFPerms);
}
LocalRedirect($APPLICATION->GetCurPage() . "?lang=" . LANGUAGE_ID . "&success=Y&crm_imp_url=" . urlencode(($crmUrlScheme == 'ssl://' ? "https" : "http") . "://" . $crmUrlHost . ":" . $crmUrlPort . $crmUrl4Import) . "&crm_url=" . urlencode(($crmUrlScheme == 'ssl://' ? "https" : "http") . "://" . $crmUrlHost . ":" . $crmUrlPort));
示例3: array
}
//for each groups
$db_groups = CGroup::GetList($order="sort", $by="asc", array("ACTIVE" => "Y", "ADMIN" => "N"));
while($db_groups->ExtractFields("g_")):
if($g_ANONYMOUS=="Y")
$anonym = $g_NAME;
if($path=="/")
$perm = $CUR_PERM["/"][$g_ID];
else
$perm = $CUR_PERM[$arParsedPath["LAST"]][$g_ID];
if (substr($perm,0,2) == 'T_')
$taskId = intval(substr($perm,2));
elseif(strlen($perm) == 1)
$taskId = CTask::GetIdByLetter($perm,'main','file');
else
$taskId = 'NOT_REF';
if ($taskId != 'NOT_REF')
{
$z = CTask::GetById($taskId);
if (!($r = $z->Fetch()))
$taskId = 'NOT_REF';
}
//if(isset($arSubordGroups) && !in_array($g_ID,$arSubordGroups))
//{
// $hidden_groups .= '<input type="hidden" name="g_'.$g_ID.'" value="'.$taskId.'">';
// continue;
//}
?>
示例4: GetFileAccessPermissionByUser
function GetFileAccessPermissionByUser($intUserID, $path, $groups = false, $task_mode = false)
{
$intUserIDTmp = intval($intUserID);
if ($intUserIDTmp . '|' != $intUserID . '|') {
return !$task_mode ? 'D' : array(CTask::GetIdByLetter('D', 'main', 'file'));
}
$intUserID = $intUserIDTmp;
if ($groups === false) {
$groups = CUser::GetUserGroup($intUserID);
foreach ($groups as $key => $val) {
$groups[$key] = "G" . $val;
}
} elseif (is_array($groups) && !empty($groups)) {
$bNumbers = preg_match('/^[0-9]+$/', $groups[0]);
if ($bNumbers) {
foreach ($groups as $key => $val) {
$groups[$key] = "G" . $val;
}
}
}
CMain::InitPathVars($site, $path);
$DOC_ROOT = CSite::GetSiteDocRoot($site);
$bWin = strncasecmp(PHP_OS, "WIN", 3) == 0;
if ($bWin) {
$path = strtolower($path);
}
if (trim($path, "/") != "") {
$path = Rel2Abs("/", $path);
if ($path == "") {
return !$task_mode ? 'D' : array(CTask::GetIdByLetter('D', 'main', 'file'));
}
}
$bAdminM = in_array("G1", $groups);
if ($bAdminM) {
return !$task_mode ? 'X' : array(CTask::GetIdByLetter('X', 'main', 'file'));
}
if (substr($path, -12) == "/.access.php" && !$bAdminM) {
return !$task_mode ? 'D' : array(CTask::GetIdByLetter('D', 'main', 'file'));
}
if (substr($path, -10) == "/.htaccess" && !$bAdminM) {
return !$task_mode ? 'D' : array(CTask::GetIdByLetter('D', 'main', 'file'));
}
$max_perm = "D";
$arGroupTask = array();
$io = CBXVirtualIo::GetInstance();
$groups[] = "*";
while (true) {
$path = rtrim($path, "");
$path = rtrim($path, "/");
if ($path == '') {
$access_file_name = "/.access.php";
$Dir = "/";
} else {
$pos = strrpos($path, "/");
if ($pos === false) {
break;
}
$Dir = substr($path, $pos + 1);
$Dir = TrimUnsafe($Dir);
$path = substr($path, 0, $pos + 1);
$access_file_name = $path . ".access.php";
}
if (array_key_exists($site . "|" . $access_file_name, $this->FILE_PERMISSION_CACHE)) {
$PERM = $this->FILE_PERMISSION_CACHE[$site . "|" . $access_file_name];
} else {
$PERM = array();
if ($io->FileExists($DOC_ROOT . $access_file_name)) {
include $io->GetPhysicalName($DOC_ROOT . $access_file_name);
}
if ($bWin && !empty($PERM)) {
$PERM_TMP = array();
foreach ($PERM as $key => $val) {
$PERM_TMP[strtolower($key)] = $val;
}
$PERM = $PERM_TMP;
}
$this->FILE_PERMISSION_CACHE[$site . "|" . $access_file_name] = $PERM;
}
if ($PERM[$Dir] && is_array($PERM[$Dir])) {
$dir_perm = $PERM[$Dir];
foreach ($groups as $key => $group_id) {
if (isset($dir_perm[$group_id])) {
$perm = $dir_perm[$group_id];
} elseif (preg_match('/^G[0-9]+$/', $group_id)) {
//compatibility with group id
$perm = $dir_perm[substr($group_id, 1)];
} else {
continue;
}
if ($task_mode) {
if (substr($perm, 0, 2) == 'T_') {
$tid = intval(substr($perm, 2));
} elseif (($tid = CTask::GetIdByLetter($perm, 'main', 'file')) === false) {
continue;
}
$arGroupTask[$group_id] = $tid;
} else {
if (substr($perm, 0, 2) == 'T_') {
$tid = intval(substr($perm, 2));
$perm = CTask::GetLetter($tid);
//.........这里部分代码省略.........
示例5: intval
{
//Restore post value if error occured
$currentPerm = intval($_POST["PERMISSION"][$access_code]);
}
elseif (isset($currentPermission[$assignFileName]) && isset($currentPermission[$assignFileName][$access_code]))
{
$permLetter = $currentPermission[$assignFileName][$access_code];
if (substr($permLetter, 0, 2) == "T_")
{
$currentPerm = intval(substr($permLetter, 2));
if (!array_key_exists($currentPerm, $arPermTypes))
$currentPerm = false;
}
else
$currentPerm = CTask::GetIdByLetter($permLetter, "main", "file");
}
if ($currentPerm === false && $access_code == "*" && $path == "/")
$currentPerm = $inheritTaskID;
if ($access_code == "*")
$jsInheritPerm = $inheritTaskID;
$permissionID = $access_code."_".intval($currentPerm)."_".intval($inheritTaskID);?>
<tr>
<td><?php
echo $access_code == "*" ? GetMessage("EDIT_ACCESS_ALL_GROUPS") : ($arNames[$access_code]["provider"] != '' ? '<b>' . $arNames[$access_code]["provider"] . ':</b> ' : '') . $arNames[$access_code]["name"];
?>
</td>
示例6: foreach
foreach ($arGroup["TASKS_FILE"] as $arFile) {
$taskName = $arFile[0];
$filePath = $arFile[1];
$dbResult = CTask::GetList(array(), array("NAME" => $taskName));
if ($arTask = $dbResult->Fetch()) {
CExtranetWizardServices::SetFilePermission(array(WIZARD_SITE_ID, $filePath), array($groupID => "T_" . $arTask["ID"]));
}
}
}
// set view perms for employee groups
$rsGroupEmployees = CGroup::GetList($by = "c_sort", $order = "asc", array("STRING_ID" => "EMPLOYEES%"));
while ($arGroupEmployees = $rsGroupEmployees->Fetch()) {
$dbResult = CTask::GetList(array(), array("NAME" => "fm_folder_access_read"));
if ($arTask = $dbResult->Fetch()) {
CExtranetWizardServices::SetFilePermission(array(WIZARD_SITE_ID, WIZARD_SITE_DIR), array($arGroupEmployees["ID"] => "T_" . $arTask["ID"]));
}
}
$APPLICATION->SetGroupRight("fileman", WIZARD_EXTRANET_ADMIN_GROUP, "F");
$task_id = CTask::GetIdByLetter("F", "fileman");
if (intval($task_id) > 0) {
CGroup::SetTasksForModule("fileman", array(WIZARD_EXTRANET_ADMIN_GROUP => array("ID" => $task_id)));
}
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/.top.menu.php", array("EXTRANET_ADMIN_GROUP_ID" => $ExtranetAdminGroupID));
$rsUser = CUser::GetList($by = "ID", $order = "desc", array("GROUPS_ID" => array(1)));
while ($arAdminUser = $rsUser->Fetch()) {
$arUserGroups = CUser::GetUserGroup($arAdminUser["ID"]);
if (is_array($arUserGroups) && !in_array(WIZARD_EXTRANET_GROUP, $arUserGroups)) {
$arUserGroups[] = WIZARD_EXTRANET_GROUP;
CUser::SetUserGroup($arAdminUser["ID"], $arUserGroups);
}
}
示例7: IncludeModuleLangFile
}
IncludeModuleLangFile(__FILE__);
$module_id = 'timeman';
CModule::IncludeModule($module_id);
$arAllModuleOptions = array('edit_wd' => array('workday_start' => array(1 => 'time', 32400, 'clock'), 'workday_finish' => array(1 => 'time', 64800, 'clock'), 'workday_close_undo' => array(1 => 'checkbox', 'Y', 'checkbox'), 'workday_max_start' => array(1 => 'time', 33300, 'clock'), 'workday_min_finish' => array(1 => 'time', 63900, 'clock'), 'workday_min_duration' => array(1 => 'time', 28800, 'text'), 'workday_report_required' => array(1 => 'string', 'A', 'select', array('A' => GetMessage('TM_FIELD_UF_TM_REPORT_REQ_A'), 'Y' => GetMessage('TM_FIELD_UF_TM_REPORT_REQ_Y'), 'N' => GetMessage('TM_FIELD_UF_TM_REPORT_REQ_N'))), 'workday_allowed_delta' => array(1 => 'string', 900, 'text')), 'edit_wr' => array("report_forum_id" => array(1 => 'int', 0, 'selectbox'), "WORK_REPORT_PATH" => array(1 => 'string', "/company/work_report.php", "string"), "TIMEMAN_REPORT_PATH" => array(1 => 'string', "/company/timeman.php", "string")));
$aTabs = array(array("DIV" => "edit_wd", "TAB" => GetMessage("TM_WD_SETTINGS"), "ICON" => "timeman_settings", "TITLE" => GetMessage("TM_WD_SETTINGS_TITLE")), array("DIV" => "edit_access", "TAB" => GetMessage("TM_ACCESS"), "ICON" => "timeman_settings", "TITLE" => GetMessage("TM_ACCESS_TITLE")), array("DIV" => "edit_wr", "TAB" => GetMessage("WR_WORK_REPORTS"), "ICON" => "timeman_settings", "TITLE" => GetMessage("WR_WORK_REPORTS_SETTINGS")));
$tabControl = new CAdminTabControl("tabControl", $aTabs);
if ($REQUEST_METHOD == "POST" && strlen($Update . $Apply . $RestoreDefaults) > 0 && check_bitrix_sessid()) {
if (strlen($RestoreDefaults) > 0) {
COption::RemoveOption($module_id);
$z = CGroup::GetList($v1 = "id", $v2 = "asc", array("ACTIVE" => "Y", "ADMIN" => "N"));
while ($zr = $z->Fetch()) {
$APPLICATION->DelGroupRight($module_id, array($zr["ID"]));
}
CGroup::SetTasksForModule($module_id, array());
COption::SetOptionString($module_id, "GROUP_DEFAULT_TASK", CTask::GetIdByLetter('N', $module_id));
COption::SetOptionString($module_id, "GROUP_DEFAULT_RIGHT", "N");
} else {
foreach ($arAllModuleOptions as $tab => $arAllOptions) {
foreach ($arAllOptions as $opt => $arOptDef) {
// if (true isset($_REQUEST[$opt]))
// {
$value = trim($_REQUEST[$opt]);
switch ($arOptDef[1]) {
case 'time':
if (strlen($value) > 0) {
list($hour, $min) = explode(':', $value, 2);
if (IsAmPmMode() && preg_match('/(am|pm)/i', $min, $match)) {
$ampm = strtolower($match[0]);
if ($ampm == 'pm' && $hour < 12) {
$hour += 12;