Esempio n. 1
0
 /**
  * Взять новые проекты с указанным бюджетом за прошедшие сутки
  *
  * @param string  $error       Сюда записываем ошибку если есть
  * @param integer $timeOffset  Количество секунд смещения даты от которой получаем проекты. 0 - сейчас
  * @return array Данные выборки
  */
 function GetNewProjectsWithBudjet(&$error, $timeOffset = 0)
 {
     global $DB;
     if ($timeOffset) {
         $lOffset = $DB->parse("- interval '?i seconds'", $timeOffset);
         $rOffset = $DB->parse("AND p.post_date <= (now() - interval '?i seconds')", $timeOffset);
     }
     $sql = "SELECT p.kind, p.name, p.descr, p.id, p.post_date, e.login, p.cost, p.priceby, p.currency, p.pro_only, p.videolnk, p.verify_only\n           FROM projects p\n         INNER JOIN\n           employer e\n             ON e.uid = p.user_id\n            AND e.is_banned = '0'\n          LEFT JOIN projects_blocked pb ON pb.project_id = p.id\n          WHERE pb.project_id IS NULL\n            /*AND p.moderator_status > 0  */\n            AND p.post_date > DATE_TRUNC('hour', now() - interval '96 hours' {$lOffset})\n            {$rOffset}\n            AND p.closed = false \n            AND p.kind <> 9 \n          ORDER BY p.cost DESC, p.kind, p.post_date DESC";
     if ($prjs = $DB->rows($sql)) {
         foreach ($prjs as &$prj) {
             $prj['specs'] = new_projects::getSpecs($prj['id']);
         }
     }
     $error = $DB->error;
     return $prjs;
 }
/**
 * Отдает HTML для Редактирование проектов и конкурсов
 * 
 * @param  object $objResponse xajaxResponse
 * @param  string $rec_id идентификатор записи
 * @param  string $rec_type тип записи
 * @param  array $aParams дополнительные параметры с UID отправителя. остальные - опционально
 * @return string
 */
function _admEditProjectsParseForm(&$objResponse, $rec_id = '', $rec_type = '', $aParams = array())
{
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/city.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/country.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/attachedfiles.php';
    $sTmpKey = md5(uniqid($_SESSION['uid']));
    $tmpPrj = new tmp_project($sTmpKey);
    $prj = $tmpPrj->init(1, $rec_id);
    $tmpPrj->fix();
    // $aFolders   = projects::getUserFolders( $prj['user_id'] ); // папки
    $remTPeriod = $tmpPrj->getRemainingTopPeriod($remTD, $remTH, $remTM, $remtverb);
    // закрепление
    // страны и города
    $countries = country::GetCountries();
    if ($prj['country']) {
        $cities = city::GetCities($prj['country']);
    }
    // разделы
    $categories = professions::GetAllGroupsLite();
    $professions = professions::GetAllProfessions();
    array_group($professions, 'groupid');
    $professions[0] = array();
    $project_categories = new_projects::getSpecs($rec_id);
    if (empty($project_categories)) {
        $project_categories[] = array('category_id' => 0, 'subcategory_id' => 0);
    }
    ob_start();
    include_once $_SERVER['DOCUMENT_ROOT'] . '/user/adm_edit_tpl/projects.php';
    $sHtml = ob_get_contents();
    ob_end_clean();
    // текст
    $sOnReady = "if(document.getElementById('adm_edit_descr')) \n        document.getElementById('adm_edit_descr').value = (\$('adm_edit_descr_source')? \$('adm_edit_descr_source').value : null);";
    // аттачи
    $sAttach = getAttachedFilesJs(projects::GetAllAttach($rec_id), tmp_project::MAX_FILE_COUNT, tmp_project::MAX_FILE_SIZE, 'project');
    $objResponse->assign('h4_adm_edit', 'innerHTML', 'Редактировать ' . ($rec_type == '7' ? 'конкурс' : 'проект'));
    $objResponse->assign('div_adm_edit', 'innerHTML', $sHtml);
    $objResponse->script("\$('div_adm_reason').setStyle('display', 'none');");
    $objResponse->script("adm_edit_content.editMenuItems = ['', 'Основное', 'Файлы', 'Платные услуги'];");
    $objResponse->script('adm_edit_content.edit();');
    $objResponse->script($sAttach);
    $objResponse->script($sOnReady);
    $objResponse->script("var mx = new MultiInput('adm_edit_professions','category_line'); mx.init();");
    $objResponse->script('xajax_getAdmEditReasons(' . admin_log::ACT_ID_EDIT_PROJECTS . ');');
    // для конкурса даты окончания и определения победителей
    if ($prj['kind'] == 7) {
        $objResponse->script("new tcal ({ 'formname': 'adm_edit_frm', 'controlname': 'adm_edit_end_date', 'iconId': 'end_date_btn', 'clickEvent': function(){ adm_edit_content.hideError('end_date'); } });");
        $objResponse->script("new tcal ({ 'formname': 'adm_edit_frm', 'controlname': 'adm_edit_win_date', 'iconId': 'win_date_btn', 'clickEvent': function(){ adm_edit_content.hideError('win_date'); } });");
    }
}
Esempio n. 3
0
 /**
  * Проверяет по специализациям, может ли текущий пользователь ответить на проект.
  * 
  * @param int $projec_id ид проекта
  *
  * @return boolean
  */
 public static function offerSpecIsAllowed($projec_id)
 {
     require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php';
     require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects.php';
     // ПРО отвечают без ограничений
     if (is_pro()) {
         return true;
     }
     if (!get_uid(false)) {
         return false;
     }
     $is_send_offers = false;
     $spec_project = new_projects::getSpecs($projec_id);
     $user_spec = professions::GetProfsAddSpec($_SESSION['uid']);
     if (is_array($user_spec)) {
         $user_spec = array_merge($user_spec, $_SESSION['specs']);
     } else {
         $user_spec = $_SESSION['specs'];
     }
     if ($user_spec) {
         $user_spec = array_merge($user_spec, professions::GetMirroredProfs(professions::GetProfessionOrigin(implode(',', $user_spec))));
         $user_spec = array_unique($user_spec);
         //@todo запехать в один запрос
         foreach ($user_spec as $spec) {
             $prof_group[$spec] = professions::GetProfField($spec, 'prof_group');
         }
     }
     foreach ($spec_project as $specs) {
         if (is_array($prof_group) && in_array($specs['category_id'], $prof_group)) {
             $is_send_offers = true;
             // Разрашаем оставлять отзыв
             break;
         }
     }
     return $is_send_offers;
 }
Esempio n. 4
0
 /**
  * Заполняет значения в зависимости от проекта.
  * 
  * @param array $project данные проекта
  */
 public function initProject($project)
 {
     $stop_words = new stop_words(hasPermissions('projects'));
     $title = $project['moderator_status'] === '0' && $project['kind'] != 4 && $project['is_pro'] != 't' ? $stop_words->replace($project['name'], 'plain', false) : $project['name'];
     $title50 = LenghtFormatEx(trim(strip_tags($title)), 50);
     $title100 = LenghtFormatEx(trim(strip_tags($title)), 100);
     $sp = new_projects::getSpecs($project['id']);
     $is_spec = $sp[0]['subcategory_id'] > 0;
     $prof_id = $is_spec ? $sp[0]['subcategory_id'] : $sp[0]['category_id'];
     $this->seo_value = new SeoValues();
     $this->seo_value->initCard($prof_id, $is_spec);
     $this->title = sprintf(SeoText::PRJ_TITLE, $title50, $this->seo_value->getKey(1));
     $this->description = sprintf(SeoText::PRJ_DESC, $title100, $this->seo_value->getKeysString(3));
     $this->keywords = sprintf(SeoText::PRJ_KEY, $this->seo_value->getFTitle(1), $this->seo_value->getKeysString());
     $this->footer_text = sprintf(SeoText::PRJ_TAGS, $this->seo_value->getFTitle(1), $this->seo_value->getKeysString());
 }
function quickprjedit_get_prj($prj_id)
{
    $objResponse = new xajaxResponse();
    if (hasPermissions('projects')) {
        require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects.php';
        require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php';
        require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/country.php';
        require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/city.php';
        $categories = professions::GetAllGroupsLite();
        $professions = professions::GetAllProfessions();
        array_group($professions, 'groupid');
        $professions[0] = array();
        $oprj = new new_projects();
        $project = $oprj->getPrj($prj_id);
        if ($project['id']) {
            $project_categories = $oprj->getSpecs($project['id']);
            if (empty($project_categories)) {
                $project_categories[] = array('category_id' => 0, 'subcategory_id' => 0);
            }
            $html_categories = '';
            foreach ($project_categories as $project_category) {
                $html_categories .= "<div id='category_line'>\n                                        <select name='categories[]' class='b-select__select b-select__select_width_180' onchange='popupQEditPrjRefreshSubCategory(this);'>\n                                            <option value='0'>Выберите раздел</option>\n                                     ";
                foreach ($categories as $cat) {
                    if ($cat['id'] <= 0) {
                        continue;
                    }
                    $html_categories .= "<option value='{$cat['id']}' " . ($project_category['category_id'] == $cat['id'] ? ' selected' : '') . ">{$cat['name']}</option>";
                }
                $html_categories .= "</select>\n                                        <select name='subcategories[]' class='b-select__select b-select__select_width_180'>\n                                    ";
                $categories_specs = $professions[$project_category['category_id']];
                for ($i = 0; $i < sizeof($categories_specs); ++$i) {
                    $html_categories .= "<option value='{$categories_specs[$i]['id']}'" . ($categories_specs[$i]['id'] == $project_category['subcategory_id'] ? ' selected' : '') . ">{$categories_specs[$i]['profname']}</option>";
                }
                $html_categories .= "      <option value='0' " . ($project_category['subcategory_id'] == 0 ? ' selected' : '') . '>Все специализации</option>
                                        </select>
                                     </div>
                                     ';
            }
            $countries = country::GetCountries();
            if ($project['country']) {
                $cities = city::GetCities($project['country']);
            }
            $html_location = '';
            $html_location .= "<div><select id='popup_qedit_prj_fld_country' name='country' onChange='popupQEditPrjCityUpd(this.value);'><option value='0'>Страна</option>";
            foreach ($countries as $country_id => $country) {
                $html_location .= "<option value='{$country_id}' " . ($country_id == $project['country'] ? 'selected' : '') . ">{$country}</option>";
            }
            $html_location .= '</select></div>';
            $html_location .= "<div id='frm_city'><select name='city'><option value='0'>Город</option>";
            if ($cities) {
                foreach ($cities as $city_id => $city) {
                    $html_location .= "<option value='{$city_id}' " . ($city_id == $project['city'] ? 'selected' : '') . ">{$city}</option>";
                }
            }
            $html_location .= '</select>';
            $objResponse->assign('popup_qedit_prj_fld_id', 'value', $project['id']);
            $objResponse->assign('popup_qedit_prj_fld_name', 'value', htmlspecialchars_decode($project['name'], ENT_QUOTES));
            $objResponse->assign('popup_qedit_prj_fld_descr', 'value', htmlspecialchars_decode($project['descr'], ENT_QUOTES));
            $objResponse->assign('popup_qedit_prj_fld_categories', 'innerHTML', $html_categories);
            $objResponse->assign('popup_qedit_prj_fld_location', 'innerHTML', $html_location);
            $objResponse->script('$("popup_qedit_prj_fld_kind_1").set("checked", false);');
            switch ($project['kind']) {
                case 1:
                    $objResponse->script('$("popup_qedit_prj_cal1").setStyle("display", "none");');
                    $objResponse->script('$("popup_qedit_prj_cal2").setStyle("display", "none");');
                    $objResponse->script('$("popup_qedit_prj_kind").setStyle("display", "block");');
                    $objResponse->script('$("popup_qedit_prj_fld_kind_1").set("checked", true);');
                    $objResponse->script('$("popup_qedit_prj_fld_location").setStyle("display", "none");');
                    break;
                case 2:
                    //$objResponse->script('$("sbr_text_block").setStyle("display", "none");');
                    break;
                case 4:
                    $objResponse->script('$("popup_qedit_prj_cal1").setStyle("display", "none");');
                    $objResponse->script('$("popup_qedit_prj_cal2").setStyle("display", "none");');
                    $objResponse->script('$("popup_qedit_prj_kind").setStyle("display", "block");');
                    $objResponse->script('$("popup_qedit_prj_fld_kind_2").set("checked", true);');
                    $objResponse->script('$("popup_qedit_prj_fld_location").setStyle("display", "block");');
                    break;
                case 7:
                    $objResponse->script('$("popup_qedit_prj_cal1").setStyle("display", "block");');
                    $objResponse->script('$("popup_qedit_prj_cal2").setStyle("display", "block");');
                    $objResponse->script('$("popup_qedit_prj_kind").setStyle("display", "none");');
                    $objResponse->script('$("popup_qedit_prj_fld_location").setStyle("display", "none");');
                    $objResponse->script('$("popup_qedit_prj_fld_end_date").set("value", "' . date('d-m-Y', strtotime($project['end_date'])) . '");');
                    $objResponse->script('$("popup_qedit_prj_fld_win_date").set("value", "' . date('d-m-Y', strtotime($project['win_date'])) . '");');
                    break;
            }
            if ($project['pro_only'] == 't') {
                $objResponse->script('$("popup_qedit_prj_fld_pro_only").set("checked", true);');
            } else {
                $objResponse->script('$("popup_qedit_prj_fld_pro_only").set("checked", false);');
            }
            if ($project['verify_only'] == 't') {
                $objResponse->script('$("popup_qedit_prj_fld_verify_only").set("checked", true);');
            } else {
                $objResponse->script('$("popup_qedit_prj_fld_verify_only").set("checked", false);');
            }
            if ($project['prefer_sbr'] == 't') {
                $objResponse->script('$("popup_qedit_prj_fld_prefer_sbr").set("checked", true);');
            } else {
                $objResponse->script('$("popup_qedit_prj_fld_prefer_sbr").set("checked", false);');
            }
            if ($project['strong_top'] == 1) {
                $objResponse->script('$("popup_qedit_prj_fld_strong_top").set("checked", true);');
            } else {
                $objResponse->script('$("popup_qedit_prj_fld_strong_top").set("checked", false);');
            }
            /*if($project['prefer_sbr']=='t') {
                  $objResponse->script('$("popup_qedit_prj_fld_prefer_sbr").set("checked", true);');
              } else {
                  $objResponse->script('$("popup_qedit_prj_fld_prefer_sbr").set("checked", false);');
              }*/
            $objResponse->script("var mx = new MultiInput('popup_qedit_prj_fld_categories','category_line', " . (int) ($project['is_pro'] === 't') . '); mx.init();');
            require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/attachedfiles.php';
            $attchedfiles = new attachedfiles($attachedfiles_session);
            $attachedfiles_tmpprj_files = $oprj->GetAllAttach($project['id']);
            if ($attachedfiles_tmpprj_files) {
                $attachedfiles_prj_files = array();
                foreach ($attachedfiles_tmpprj_files as $attachedfiles_prj_file) {
                    $attachedfiles_prj_files[] = $attachedfiles_prj_file['file_id'];
                }
                $attchedfiles->setFiles($attachedfiles_prj_files);
            }
            $attachedfiles_files = $attchedfiles->getFiles();
            $js_attachedfiles = 'attachedfiles_list = [];';
            if ($attachedfiles_files) {
                $n = 0;
                foreach ($attachedfiles_files as $attachedfiles_file) {
                    $js_attachedfiles .= "attachedfiles_list[{$n}] = new Object;\n";
                    $js_attachedfiles .= "attachedfiles_list[{$n}].id = '" . md5($attachedfiles_file['id']) . "';\n";
                    $js_attachedfiles .= "attachedfiles_list[{$n}].name = '{$attachedfiles_file['orig_name']}';\n";
                    $js_attachedfiles .= "attachedfiles_list[{$n}].path = '" . WDCPREFIX . "/{$attachedfiles_file['path']}{$attachedfiles_file['name']}';\n";
                    $js_attachedfiles .= "attachedfiles_list[{$n}].size = '" . ConvertBtoMB($attachedfiles_file['size']) . "';\n";
                    $js_attachedfiles .= "attachedfiles_list[{$n}].type = '{$attachedfiles_file['type']}';\n";
                    ++$n;
                }
            }
            $objResponse->script($js_attachedfiles);
            $objResponse->script("attachedFiles.init('popup_qedit_prj_attachedfiles', '" . $attchedfiles->getSession() . "', attachedfiles_list, " . tmp_project::MAX_FILE_COUNT . ', ' . tmp_project::MAX_FILE_SIZE . ",'" . implode(', ', $GLOBALS['disallowed_array']) . "', 'project', " . get_uid(false) . ');');
            if ($project['is_color'] == 't') {
                $objResponse->script("\$('popup_qedit_prj_is_color').set('checked', true); popupQEditPrjToggleIsColor();");
            } else {
                $objResponse->script("\$('popup_qedit_prj_is_color').set('checked', false); popupQEditPrjToggleIsColor();");
            }
            if ($project['is_bold'] == 't') {
                $objResponse->script("\$('popup_qedit_prj_is_bold').set('checked', true); popupQEditPrjToggleIsBold();");
            } else {
                $objResponse->script("\$('popup_qedit_prj_is_bold').set('checked', false); popupQEditPrjToggleIsBold();");
            }
            if ($project['hide'] == 't') {
                $objResponse->script("\$('popup_qedit_prj_is_hide').set('checked', true); ");
            } else {
                $objResponse->script("\$('popup_qedit_prj_is_hide').set('checked', false); ");
            }
            if ($project['urgent'] == 't') {
                $objResponse->script("\$('popup_qedit_prj_is_urgent').set('checked', true); ");
            } else {
                $objResponse->script("\$('popup_qedit_prj_is_urgent').set('checked', false); ");
            }
            $objResponse->assign('popup_qedit_prj_logolink', 'value', $project['link']);
            $key = md5(uniqid($uid));
            $tmpPrj = new tmp_project($key);
            $tmpPrj->init(1, $project['id']);
            $remTPeriod = $tmpPrj->getRemainingTopPeriod($remTD, $remTH, $remTM, $remtverb);
            $addedTD = $tmpPrj->getAddedTopDays();
            $objResponse->assign('popup_qedit_prj_fld_tmpid', 'value', $key);
            if ($remTPeriod || $addedTD) {
                $objResponse->script('$("popup_qedit_prj_top_ok").set("checked", true);');
                $objResponse->script('$("popup_qedit_prj_top_ok").set("disabled", true);');
                $objResponse->script('$("popup_qedit_prj_top_ok_tab1_days").set("value", "1");');
                $objResponse->script('$("popup_qedit_prj_top_ok_icon").setStyle("display", "block");');
                $objResponse->script('$("popup_qedit_prj_top_ok_tab1").setStyle("display", "none");');
                $objResponse->script('$("popup_qedit_prj_top_ok_tab2").setStyle("display", "block");');
                $objResponse->script('$("popup_qedit_prj_top_ok_tab1_days").set("disabled", true);');
                $objResponse->script('$("popup_qedit_prj_top_ok_tab2_c").set("checked", false);');
                $objResponse->script('$("popup_qedit_prj_top_ok_tab2_c").set("disabled", false);');
                $objResponse->script('$("popup_qedit_prj_top_ok_tab2_days").set("disabled", false);');
                $objResponse->script('$("popup_qedit_prj_top_ok_tab2_days").set("value", "1");');
                $objResponse->script('$("popup_qedit_prj_top_ok_tab2_left").set("html", "' . $remtverb . ' ' . $remTPeriod . '");');
            } else {
                $objResponse->script('$("popup_qedit_prj_top_ok").set("checked", false);');
                $objResponse->script('$("popup_qedit_prj_top_ok").set("disabled", false);');
                $objResponse->script('$("popup_qedit_prj_top_ok_tab1_days").set("value", "1");');
                $objResponse->script('$("popup_qedit_prj_top_ok_icon").setStyle("display", "none");');
                $objResponse->script('$("popup_qedit_prj_top_ok_tab1").setStyle("display", "none");');
                $objResponse->script('$("popup_qedit_prj_top_ok_tab2").setStyle("display", "none");');
                $objResponse->script('$("popup_qedit_prj_top_ok_tab1_days").set("disabled", false);');
                $objResponse->script('$("popup_qedit_prj_top_ok_tab2_c").set("checked", false);');
                $objResponse->script('$("popup_qedit_prj_top_ok_tab2_c").set("disabled", true);');
                $objResponse->script('$("popup_qedit_prj_top_ok_tab2_days").set("disabled", true);');
            }
            if ($project['logo_id']) {
                $logo = $tmpPrj->getLogo();
                $objResponse->script('$("popup_qedit_prj_use_logo_src").set("href", "' . WDCPREFIX . '/' . $logo['path'] . $logo['name'] . '");');
                $objResponse->script('$("popup_qedit_prj_use_logo").set("checked", true);');
                $objResponse->script('$("popup_qedit_prj_use_logo").set("disabled", true);');
                $objResponse->script('$("popup_qedit_prj_use_logo_tab").setStyle("display", "block");');
                $objResponse->script('$("popup_qedit_prj_use_logo_tab2").setStyle("display", "none");');
            } else {
                $objResponse->script('$("popup_qedit_prj_use_logo").set("checked", false);');
                $objResponse->script('$("popup_qedit_prj_use_logo").set("disabled", false);');
                $objResponse->script('$("popup_qedit_prj_use_logo_tab").setStyle("display", "none");');
                $objResponse->script('$("popup_qedit_prj_use_logo_tab2").setStyle("display", "none");');
            }
            $tmpPrj->fix();
            $objResponse->call('center_popup', '.b-shadow_center-quick');
        }
    }
    return $objResponse;
}
Esempio n. 6
0
 if (!$item_page) {
     $item_page = 1;
 }
 #if (!$_SESSION['uid'] && !$pass) { include("../fbd.php"); exit; }
 // Проект.
 $obj_project = new projects();
 $project = $obj_project->GetPrjCust($prj_id);
 $projectObject = $obj_project->initData($project);
 if (!$project) {
     include '../404.php';
     exit;
 }
 $project['descr'] = htmlspecialchars($project['descr'], ENT_QUOTES, 'CP1251', false);
 $is_owner = $project['user_id'] == $uid;
 $is_adm = hasPermissions('projects');
 $project_specs = new_projects::getSpecs($prj_id);
 GaJsHelper::getInstance()->setProjectCategory($project_specs);
 //Если это перемещенная вакансия то редиректим владельца на редактивание
 //А посетителю 404
 /*
 if ($projectObject->isNotPayedVacancy()) {
     if($is_owner) {
         $popup_param = $is_pro ? '' : '&popup=1';
         header("Location: /public/?step=1&kind=4&public={$project['id']}{$popup_param}");
     }elseif(!$is_adm) {
         include("../404.php"); 
         exit;
     }
 }
 */
 if ($is_owner && $projectObject->isProject() && !$projectObject->isPreferSbr()) {
Esempio n. 7
0
 /**
  * Получение списока проектов
  * 
  * @param  array $aParams массив входящих данных
  * @return array $aResult ответ
  */
 protected function x____projects_list($aParams = array())
 {
     $this->_validDevice($aParams);
     require_once ABS_PATH . '/classes/projects_filter.php';
     require_once ABS_PATH . '/classes/projects.php';
     $nUid = get_uid(false);
     $nPage = self::$_aPlatform[$this->_sPlatform]['filter_page'];
     // какой фильтр получать
     $prj_filter = new projects_filters();
     $filter = $prj_filter->GetFilter($nUid, $error, $nPage);
     if (is_array($filter) && $filter && $filter['active'] == 't' && $filter['use_main_filter'] == 't') {
         $filter = $prj_filter->GetFilter($nUid, $error, 0);
     }
     $nKind = intvalPgSql($aParams['kind']);
     $nKind = !empty($nKind) ? $nKind : $this->_mCfg['default_kind'];
     $nPage = intvalPgSql($aParams['page']);
     $nPage = !empty($nPage) ? $nPage : 1;
     $oPrj = new new_projects();
     $oPrj->page_size = $this->_mCfg['items_per_page'];
     if (is_emp()) {
         $aProjects = $oPrj->GetCurPrjs($nUid, '', true, false, $nKind);
         $nPrgCnt = count($aProjects);
     } else {
         $aProjects = $oPrj->getProjects($nPrgCnt, $nKind, $nPage, true, $filter, true, false, NULL, false, NULL, true);
     }
     $aResult = array('projects_list' => array());
     if (is_array($aProjects) && $aProjects) {
         $aItems = array();
         $aIds = array();
         $nCnt = 0;
         foreach ($aProjects as $aOne) {
             $aResult['projects_list'][$nCnt] = $this->_getProjectData($aOne);
             $aItems[$aOne['id']] =& $aResult['projects_list'][$nCnt];
             $aIds[] = $aOne['id'];
             $nCnt++;
         }
         $aSpecs = new_projects::getSpecs($aIds);
         if (is_array($aSpecs) && $aSpecs) {
             foreach ($aSpecs as $aOne) {
                 $aItems[$aOne['project_id']]['category_id'] = $aOne['category_id'];
                 $aItems[$aOne['project_id']]['subcategory_id'] = $aOne['subcategory_id'];
             }
         }
         $aResult['projects_total'] = intval($nPrgCnt);
     }
     return $aResult;
 }