예제 #1
0
} else {
    $arrPERM = CAdvContract::GetUserPermissions($CONTRACT_ID);
    $arrPERM = is_array($arrPERM[$CONTRACT_ID]) ? $arrPERM[$CONTRACT_ID] : array();
    if (!$isDemo) {
        if (count($arrPERM) <= 0) {
            $APPLICATION->AuthForm(GetMessage("AD_ERROR_NOT_ENOUGH_PERMISSIONS_CONTRACT"));
        }
        if (!in_array("ADD", $arrPERM)) {
            $isEditMode = false;
        }
    }
    if ($action == "view") {
        $isEditMode = false;
    }
    $arrCONTRACT_TYPE = CAdvContract::GetTypeArray($CONTRACT_ID);
    $isOwner = CAdvContract::IsOwner($CONTRACT_ID);
}
function pr_comp($a, $b)
{
    if ($a["SORT"] < $b["SORT"]) {
        return -1;
    } elseif ($a["SORT"] > $b["SORT"]) {
        return 1;
    } else {
        return 0;
    }
}
if ($_SERVER["REQUEST_METHOD"] == "POST" && ($_POST["action"] == 'getTemplate' || $_POST["action"] == 'refreshTemplate' || $_POST["action"] == 'refreshAll') && isset($_POST["name"]) && check_bitrix_sessid()) {
    $GLOBALS['APPLICATION']->RestartBuffer();
    if (strlen($_POST["name"]) > 0) {
        $properties = is_array($_POST['properties']) ? $_POST['properties'] : array();
IncludeModuleLangFile(__FILE__);
$err_mess = "FILE: " . __FILE__ . "<br>LINE: ";
define("HELP_FILE", "adv_contract_list.php");
$aTabs = array(array("DIV" => "edit1", "TAB" => GetMessage("AD_TAB_CONTRACT"), "ICON" => "ad_contract_edit", "TITLE" => GetMessage("AD_TAB_TITLE_CONTRACT")), array("DIV" => "edit2", "TAB" => GetMessage("AD_TAB_LIMIT"), "ICON" => "ad_contract_edit", "TITLE" => GetMessage("AD_CONTRACT_LIMITS")), array("DIV" => "edit3", "TAB" => GetMessage("AD_TAB_TARG"), "ICON" => "ad_contract_edit", "TITLE" => GetMessage("AD_TAB_TITLE_TARG")), array("DIV" => "edit4", "TAB" => GetMessage("AD_TAB_ACCESS"), "ICON" => "ad_contract_edit", "TITLE" => GetMessage("AD_OWNER_PERMISSIONS")));
if ($isAdmin || $isDemo && !$isOwner) {
    $aTabs[] = array("DIV" => "edit5", "TAB" => GetMessage("AD_TAB_COMMENT"), "ICON" => "ad_contract_edit", "TITLE" => GetMessage("AD_ADMIN_COMMENTS"));
}
$tabControl = new CAdminTabControl("tabControl", $aTabs);
/***************************************************************************
						ќбработка GET | POST
***************************************************************************/
$strError = '';
$ID = intval($ID);
$arrPERM = CAdvContract::GetUserPermissions($ID);
$arrPERM = is_array($arrPERM[$ID]) ? $arrPERM[$ID] : array();
$isOwner = CAdvContract::IsOwner($ID);
$isEditMode = false;
$isEditRightsMode = false;
if (!$isDemo) {
    if (count($arrPERM) <= 0) {
        $APPLICATION->AuthForm(GetMessage("AD_ERROR_NOT_ENOUGH_PERMISSIONS_CONTRACT"));
    }
} else {
    if (!$isOwner) {
        $isEditMode = true;
    }
}
if ($isAdmin) {
    $isEditMode = true;
}
if (in_array("EDIT", $arrPERM)) {