Пример #1
0
        if (!in_array($newStatus, array(STATUS_LIST_PAUSE, STATUS_LIST_WORK))) {
            $logger->add(array($arResult['TASK']['PROPS']['CUSTOMER']['VALUE'], $arResult['TASK']['PROPS']['PROGRAMMER']['VALUE']), $arParams['ID'], 'status', StatusHelper::getStr($newStatus) . ' #' . $arResult['TASK']['ID'] . ' ' . $arResult['TASK']['NAME']);
        }
    }
    if ($commentStatus == STATUS_COMMENT_CONFIRM || $newStatus == STATUS_LIST_AGR_CALCED) {
        crmEntitiesHelper::recalcTaskTime($arParams['ID']);
    }
    LocalRedirect($APPLICATION->GetCurDir());
}
/* edit task */
$new_task = $_REQUEST["new_task"];
if ($arResult['CAN_EDIT'] && isset($new_task)) {
    $el = new CIBlockElement();
    $updated = $el->Update($arParams['ID'], array("DETAIL_TEXT" => $new_task, "NAME" => $_REQUEST['NAME_NEW']));
    if ($updated) {
        $propsUpdate['PRIORITY'] = validatePriority($_REQUEST['priority']);
        $calc = formatTime($_REQUEST['NEW_CALC']);
        if ($calc != $arResult['TASK']['PROPS']['CALC']['VALUE']) {
            $propsUpdate['CALC'] = $calc;
        }
        if ($newCustomer = intval($_REQUEST['CUSTOMER_NEW'])) {
            if (in_array($newCustomer, $arResult['CUSTOMERS_IDS'])) {
                $propsUpdate['CUSTOMER'] = $newCustomer;
            }
        }
        if ($newProgrammer = intval($_REQUEST['PROGRAMMER_NEW'])) {
            if (in_array($newProgrammer, $arResult['PROGRAMERS_IDS'])) {
                $propsUpdate['PROGRAMMER'] = $newProgrammer;
            }
        }
        foreach ($_FILES['attach'] as $code => $values) {
Пример #2
0
    return;
}
CModule::IncludeModule('iblock');
$arResult['USER_ID'] = CUser::GetID();
if ($_REQUEST['addtask']) {
    $el = new CIBlockElement();
    $name = trim($_REQUEST['name']);
    $description = trim($_REQUEST['description']);
    foreach ($_FILES['attach'] as $code => $values) {
        foreach ($values as $key => $value) {
            if ($_FILES['attach']["tmp_name"][$key]) {
                $arFiles[$key][$code] = $value;
            }
        }
    }
    $priority = validatePriority($_REQUEST['priority']);
    $programmer = $_REQUEST['PROGRAMMER'];
    $customer = $_REQUEST['CUSTOMER'] ? $_REQUEST['CUSTOMER'] : CUser::GetID();
    $arProjectArray = array("PROPERTY_VALUES" => array('PROGRAMMER' => $programmer, 'PROJECT' => $arParams["PROJECT"], 'FILES' => $arFiles, 'PRIORITY' => $priority, 'CUSTOMER' => $customer), "MODIFIED_BY" => $USER->GetID(), "IBLOCK_SECTION_ID" => false, "IBLOCK_ID" => TASKS_IBLOCK_ID, "NAME" => $name, "DETAIL_TEXT" => $description);
    if ($newTaskId = $el->Add($arProjectArray)) {
        ToolTip::Add('Задача "' . $name . '" добавлена');
        $logger = new CrmLog('task');
        $logger->add(array($programmer, $customer), $newTaskId, 'add', $description);
        LocalRedirect(TASKS_LIST_URL . $arParams["PROJECT"] . '/');
    } else {
        $arResult['ERROR'] = $el->LAST_ERROR;
    }
}
$arSelect = array("ID", "IBLOCK_ID", "NAME", "DETAIL_PAGE_URL", "PROPERTY_*");
$arFilter = array("IBLOCK_ID" => PROJECTS_IBLOCK_ID, 'ID' => $arParams["PROJECT"]);
$userFilter = $USER->GetViewProjectsFilter();