Example #1
0
 function InstallDB()
 {
     global $DB, $APPLICATION;
     $this->errors = false;
     if (!$DB->Query("SELECT 'x' FROM b_im_chat", true)) {
         $this->errors = $DB->RunSQLBatch($_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/im/install/db/" . strtolower($DB->type) . "/install.sql");
     }
     if ($this->errors !== false) {
         $APPLICATION->ThrowException(implode("", $this->errors));
         return false;
     }
     RegisterModule("im");
     RegisterModuleDependences('main', 'OnAddRatingVote', 'im', 'CIMEvent', 'OnAddRatingVote');
     RegisterModuleDependences('main', 'OnCancelRatingVote', 'im', 'CIMEvent', 'OnCancelRatingVote');
     RegisterModuleDependences('main', 'OnAfterUserUpdate', 'im', 'CIMEvent', 'OnAfterUserUpdate');
     RegisterModuleDependences('main', 'OnUserDelete', 'im', 'CIMEvent', 'OnUserDelete');
     RegisterModuleDependences("pull", "OnGetDependentModule", "im", "CIMEvent", "OnGetDependentModule");
     RegisterModuleDependences("main", "OnProlog", "main", "", "", 3, "/modules/im/ajax_hit.php");
     RegisterModuleDependences("perfmon", "OnGetTableSchema", "im", "CIMTableSchema", "OnGetTableSchema");
     RegisterModuleDependences("im", "OnGetNotifySchema", "im", "CIMNotifySchema", "OnGetNotifySchema");
     RegisterModuleDependences("main", "OnFileDelete", "im", "CIMEvent", "OnFileDelete");
     RegisterModuleDependences("main", "OnApplicationsBuildList", "im", "DesktopApplication", "OnApplicationsBuildList");
     CAgent::AddAgent("CIMMail::MailNotifyAgent();", "im", "N", 600);
     CAgent::AddAgent("CIMMail::MailMessageAgent();", "im", "N", 600);
     CAgent::AddAgent("CIMDisk::RemoveTmpFileAgent();", "im", "N", 43200);
     CModule::IncludeModule("im");
     if (CIMConvert::ConvertCount() > 0) {
         Cmodule::IncludeModule("im");
         CAdminNotify::Add(array("MESSAGE" => GetMessage("IM_CONVERT_MESSAGE", array("#A_TAG_START#" => '<a href="/bitrix/admin/im_convert.php?lang=' . LANGUAGE_ID . '">', "#A_TAG_END#" => "</a>")), "TAG" => "IM_CONVERT", "MODULE_ID" => "IM", "ENABLE_CLOSE" => "Y"));
         CAgent::AddAgent("CIMConvert::UndeliveredMessageAgent();", "im", "N", 20, "", "Y", ConvertTimeStamp(time() + CTimeZone::GetOffset() + 20, "FULL"));
     }
     return true;
 }
        }
    }
    if (in_array($type, array("out", "reveil"))) {
        if (!$op->sortie_reveil_reel) {
            $nb_sorties_non_realisees++;
        }
        $sejour->loadRefsAffectations();
        if ($sejour->_ref_first_affectation->_id) {
            $sejour->_ref_first_affectation->loadRefLit();
            $sejour->_ref_first_affectation->_ref_lit->loadCompleteView();
        }
    }
}
// Chargement de la liste du personnel pour le reveil
$personnels = array();
if (in_array($type, array("ops", "reveil")) && Cmodule::getActive("dPpersonnel")) {
    $personnel = new CPersonnel();
    $personnels = $personnel->loadListPers("reveil");
}
// Vérification de la check list journalière
$daily_check_lists = array();
$daily_check_list_types = array();
$require_check_list = 0;
$require_check_list_close = 0;
$listChirs = array();
$listAnesths = array();
$date_close_checklist = null;
$date_open_checklist = null;
if ($type == "reveil" || $type == "preop") {
    $bloc = new CBlocOperatoire();
    if (!$bloc->load($bloc_id) && count($listSalles)) {
<?php

require_once dirname(__DIR__) . "/classes/general/threads.php";
set_time_limit(0);
if ($params = Threads::getParams()) {
    $_SERVER["DOCUMENT_ROOT"] = $DOCUMENT_ROOT = $params["documentRoot"];
    require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
    Cmodule::IncludeModule("acrit.exportpro");
    $export = new CAcritExportproExport(intval($params["profileId"]));
    $export->Export("cron", $params["cronPage"]);
}
Example #4
0
<?php

$module_id = "acrit.exportpro";
$POST_RIGHT = $APPLICATION->GetGroupRight($module_id);
if ($POST_RIGHT >= "R") {
    IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/options.php");
    Cmodule::IncludeModule($module_id);
    IncludeModuleLangFile(__FILE__);
    AcritLicence::Show();
    $aTabs = array(array("DIV" => "edit1", "TAB" => GetMessage("MAIN_TAB_RIGHTS"), "ICON" => "main_settings", "TITLE" => GetMessage("MAIN_TAB_TITLE_RIGHTS")), array("DIV" => "edit2", "TAB" => GetMessage("MAIN_TAB_SUPPORT"), "ICON" => "main_settings", "TITLE" => GetMessage("MAIN_TAB_TITLE_SUPPORT")));
    $tabControl = new CAdminTabControl("tabControl", $aTabs);
    if ($REQUEST_METHOD == "POST" && strlen($Update . $Apply . $RestoreDefaults) > 0 && $POST_RIGHT == "W" && check_bitrix_sessid()) {
        $Update = $Update . $Apply;
        ob_start();
        require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/admin/group_rights.php";
        ob_end_clean();
        if (strlen($_REQUEST["back_url_settings"]) > 0) {
            if (strlen($Apply) > 0 || strlen($RestoreDefaults) > 0) {
                LocalRedirect($APPLICATION->GetCurPage() . "?mid=" . urlencode($module_id) . "&lang=" . urlencode(LANGUAGE_ID) . "&back_url_settings=" . urlencode($_REQUEST["back_url_settings"]) . "&" . $tabControl->ActiveTabParam());
            } else {
                LocalRedirect($_REQUEST["back_url_settings"]);
            }
        } else {
            LocalRedirect($APPLICATION->GetCurPage() . "?mid=" . urlencode($module_id) . "&lang=" . urlencode(LANGUAGE_ID) . "&" . $tabControl->ActiveTabParam());
        }
    }
    require __DIR__ . "/admin/auto_tests.php";
    ?>
    
	<form method="post" action="<?php 
    echo $APPLICATION->GetCurPage();
     * @array mixed
     *
     * Функция для проверки купленных и отложенных товаров в массивах
     */
    function actual_prod($ar1, $ar2)
    {
        foreach ($ar1 as $k => $v) {
            if (in_array($v, $ar2)) {
                unset($ar1[$k]);
            }
        }
        return $ar1;
    }
}
Cmodule::IncludeModule('sale');
Cmodule::IncludeModule('iblock');

$date_mount  = date($DB->DateFormatToPHP(CSite::GetDateFormat("SHORT")), (time()-(30*24*60*60)));

// выберем все отложенные товары за последний месяц
$dbBasketItems = CSaleBasket::GetList(array("NAME" => "ASC","ID" => "ASC"),
    array("LID" => SITE_ID,"DELAY" => 'Y','>DATE_INSERT'=>$date_mount),
    false,false, array("ID", "PRODUCT_ID",'USER_ID')
);
while ($arItems = $dbBasketItems->Fetch())
{
    // соберем отложенные продукты по каждому пользователю
    $users_delay_products[$arItems['USER_ID']][] = $arItems['PRODUCT_ID'];
    $user_ids[] = $arItems['USER_ID'];
    $products_ids[] = $arItems['PRODUCT_ID'];
}
Example #6
0
 public static function getModelsList()
 {
     Cmodule::IncludeModule("iblock");
     $result = array();
     $arSort = array("SORT" => "ASC");
     $arFliter = array("IBLOCK_ID" => IBLOCK_SK_CALC_CHASSIS_ID, "ACTIVE" => "Y");
     $arSelect = array("IBLOCK_ID", "ID", "NAME");
     $cacheLifetime = 86400 * 7;
     $cacheID = 'AllModels';
     $cachePath = '/myclasses/' . $cacheID;
     $obCache = new CPHPCache();
     if ($obCache->InitCache()) {
         $vars = $obCache->GetVars();
         // Извлечение переменных из кэша
         $result = $vars["result"];
     } elseif ($obCache->StartDataCache()) {
         $db = CIBlockElement::GetList($arSort, $arFliter, false, false, $arSelect);
         while ($ob = $db->getNext()) {
             $result[$ob["ID"]] = array("ID" => $ob["ID"], "NAME" => $ob["NAME"]);
         }
         $obCache->EndDataCache(array("result" => $result));
         // Сохраняем переменные в кэш.
     }
     return $result;
 }