Example #1
0
function trackStartedTask($stopStartedTask = true)
{
    CModule::IncludeModule('iblock');
    $res = CIBlockElement::GetList(array(), array("IBLOCK_ID" => TASKS_IBLOCK_ID, 'ACTIVE' => 'Y', "PROPERTY_PROGRAMMER" => CUser::GetID(), "PROPERTY_STATUS" => STATUS_LIST_WORK), false, false, array('ID', 'NAME', 'PROPERTY_PROJECT', 'PROPERTY_STATUS_DATE'));
    if ($taskArr = $res->Fetch()) {
        if ($stopStartedTask) {
            CIBlockElement::SetPropertyValuesEx($taskArr['ID'], TASKS_IBLOCK_ID, array('STATUS' => STATUS_LIST_PAUSE));
        }
        $link = TASKS_LIST_URL . $taskArr["PROPERTY_PROJECT_VALUE"] . '/' . $taskArr['ID'] . '/';
        $date = new DateTime($taskArr["PROPERTY_STATUS_DATE_VALUE"]);
        $curdate = new DateTime();
        $diff = $date->diff($curdate);
        $h = $diff->format('%h');
        $i = $diff->format('%i');
        if ($h || $i) {
            $timingText = '';
            if ($h) {
                $timingText = "{$h} ч, ";
            }
            if ($i) {
                $timingText = $timingText . "{$i} мин. ";
            }
            $decTime = $h + $i / 60;
            $decTime = round($decTime, 2);
            $el = new CIBlockElement();
            if ($el->Add(array("DATE_ACTIVE_FROM" => ConvertTimeStamp(time(), "SHORT"), "MODIFIED_BY" => CUser::GetID(), "IBLOCK_SECTION_ID" => false, "IBLOCK_ID" => TRACKING_IBLOCK_ID, "NAME" => 'Без названия' . ' (' . $decTime . 'ч.)', "ACTIVE" => "Y", "PROPERTY_VALUES" => array("HOURS" => $decTime, "TASK" => $taskArr['ID'])))) {
                crmEntitiesHelper::recalcTaskTracking($taskArr['ID']);
                ToolTip::Add("+ {$timingText} в трекер задачи \"<a target=\"_blank\" href=\"{$link}\">{$taskArr['ID']} {$taskArr['NAME']}</a>\"");
            } else {
                ToolTip::AddError($el->LAST_ERROR);
            }
        }
    }
}
 public function includeProfile($profileUpdate)
 {
     $obj_vali = new Validation();
     $sess_obj->checkAdminLoged();
     $user_name = $_POST['user_name'];
     $user_id = $obj_vali->userNameToID($user_name);
     $obj_reg = new Register();
     $get_profile = new ToolTip();
     $obj_sponser = new Validation();
     $u_name = $_POST['user_name'];
     $user_id = $obj_sponser->userNameToID($u_name);
     $table_prefix = $_SESSION['table_prefix'];
     $user_details = $table_prefix . "user_details";
     $ft_individual = $table_prefix . "ft_individual";
     $qr = "select u.* from {$user_details} AS u\n    INNER JOIN {$ft_individual} AS f ON u.user_detail_refid=f.id\n    where user_detail_refid='" . $user_id . "'";
     //echo $qr;
     $details = $get_profile->getUserData($qr);
     $sponser = $obj_sponser->getSponserIdName($u_name);
 }
<?php

require_once '../../class/Auth.php';
$sess_obj = new Auth();
require dirname(__FILE__) . "/class-excel-xml.inc.php";
require_once '../../class/Payout.php';
require_once '../../class/ToolTip.php';
$obj_payout = new Payout();
$get_profile = new ToolTip();
require_once '../../class/Validation.php';
$obj_sponser = new Validation();
if ($_GET["from"] and $_GET["to"]) {
    $from_date = $_GET["from"];
    $to_date = $_GET["to"];
    $from_date = $_GET["from"] . " 00:00:00";
    $to_date = $_GET["to"] . " 23:59:59";
    $obj_payout->getActivation($from_date, $to_date, 'yes');
    $count = count($obj_payout->actiavtion_details);
    //echo "From: $from_date To: $to_date";
    if ($count >= 1) {
        $doc[1][0] = "No";
        $doc[1][1] = "Username";
        $doc[1][2] = "Name";
        $doc[1][3] = "Referral UserID";
        $doc[1][4] = "Referral Full Name";
        $doc[1][5] = "Mobile No";
        $doc[1][6] = "Email";
        $count = $count + 2;
        $j = 0;
        $k = 0;
        for ($i = 2; $i < $count; $i++) {
Example #4
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
$rsUsers = CUser::GetList($by = "NAME", $order = "ASCS", array('ACTIVE' => 'Y'), array('FIELDS' => array('ID', 'NAME', 'LOGIN', 'LAST_NAME')));
while ($arUser = $rsUsers->Fetch()) {
    $arResult['USERS'][] = $arUser;
}
if ($_REQUEST['add']) {
    CModule::IncludeModule('iblock');
    $el = new CIBlockElement();
    $name = trim($_REQUEST['name']);
    $description = trim($_REQUEST['description']);
    $arProjectArray = array("PROPERTY_VALUES" => array('CUSTOMER' => $_REQUEST['CUSTOMER'], 'PROGRAMMER' => $_REQUEST['PROGRAMMER'], 'URL' => trim($_REQUEST['url'])), "MODIFIED_BY" => $USER->GetID(), "IBLOCK_SECTION_ID" => false, "IBLOCK_ID" => PROJECTS_IBLOCK_ID, "NAME" => $name, "PREVIEW_TEXT" => $description, "DETAIL_PICTURE" => $_FILES['logo']);
    if ($el->Add($arProjectArray)) {
        ToolTip::Add('Проект "' . $name . '" добавлен');
        LocalRedirect(PROJECTS_LIST_URL);
    } else {
        $arResult['ERROR'] = $el->LAST_ERROR;
    }
}
$this->IncludeComponentTemplate();
Example #5
0
            break;
        }
    }
    LocalRedirect($APPLICATION->GetCurDir() . '#comment' . intval($_REQUEST['id']));
}
/* delete comment */
if ($delete_comment = $_REQUEST['delete_comment']) {
    foreach ($arResult['COMMENTS'] as $comment) {
        if ($comment['ID'] == $delete_comment) {
            if ($comment['CREATED_BY'] == $arResult['USER_ID']) {
                $el = new CIBlockElement();
                $res = $el->Update($delete_comment, array("ACTIVE" => 'N'));
                crmEntitiesHelper::recalcCommentsCnt($arParams['ID']);
                $logger->add(array($arResult['TASK']['PROPS']['CUSTOMER']['VALUE'], $arResult['TASK']['PROPS']['PROGRAMMER']['VALUE']), $arParams['ID'], 'delete_comment', strip_tags($comment['~PREVIEW_TEXT']));
                ToolTip::Add('Комментарий удалён');
                crmEntitiesHelper::RecalcLastCommentDateTime($arParams['ID']);
            } else {
                ToolTip::AddError('Ошибка доступа к комментарию');
            }
            break;
        }
    }
    LocalRedirect($APPLICATION->GetCurDir());
}
/* tracking time */
$res = CIBlockElement::GetList(array("ID" => "ASC"), array("PROPERTY_TASK" => $arParams['ID'], "IBLOCK_ID" => TRACKING_IBLOCK_ID, "ACTIVE" => "Y"), false, false, array('DETAIL_TEXT', 'ID', 'DATE_CREATE', 'PROPERTY_HOURS'));
while ($ar_fields = $res->GetNext()) {
    $ar_fields['DATE_CREATE'] = CIBlockFormatProperties::DateFormat($arParams['DATE_FORMAT'], MakeTimeStamp($ar_fields['DATE_CREATE'], CSite::GetDateFormat()));
    $arResult['TRACKING'][] = $ar_fields;
}
$this->IncludeComponentTemplate();
Example #6
0
File: footer.php Project: kudin/crm
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
?>
 
                </div>
            </div>  
        </div>
    </div>  
    <?php 
if (defined('SHOWTINYSCRIPT')) {
    ?>
<script type="text/javascript" src="/js/tinymce/tinymce.min.js"></script> <?php 
}
?>
  
    <?php 
ToolTip::ShowJs(true);
?>
    <link href="/css/icheck/flat/green.css" rel="stylesheet">
    <script src="/js/icheck/icheck.min.js"></script>
</body> 
</html>
Example #7
0
    $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();
$arFilter = array_merge($userFilter, $arFilter);
$res = CIBlockElement::GetList(array(), $arFilter, false, false, $arSelect);
if ($ob = $res->GetNextElement()) {
    $arFields = $ob->GetFields();
    $arProps = $ob->GetProperties();