title = 'Управление справочниками'; $this->params['breadcrumbs'][] = $this->title; $alert = Yii::$app->session->getFlash('successFias'); if ($alert) { echo Html::tag('div', $alert, ['class' => 'alert alert-success', 'role' => 'alert']); } else { $alert = Yii::$app->session->getFlash('errorFias'); if ($alert) { echo Html::tag('div', $alert, ['class' => 'alert alert-danger', 'role' => 'alert']); } } ?>

Основные справочники

Заменить ссылки на устаревшие справочные данные true, 'headerContainer' => ['class' => 'thead-light'], 'tableOptions' => ['class' => 'table-sm'], 'striped' => false, 'summary' => false, 'pager' => [ 'firstPageLabel' => '<<', 'prevPageLabel' => '<', 'nextPageLabel' => '>', 'lastPageLabel' => '>>', ], 'dataProvider' => new ArrayDataProvider([ 'allModels' => AppUpdate::GetArrayOfDictionaries(), 'key' => 'key', 'pagination' => false ]), 'id' => 'custom-dictionary-grid', 'columns' => [ [ 'class' => \yii\grid\CheckboxColumn::class, 'name' => 'key' ], [ 'attribute' => 'name', 'label' => 'Наименование справочника', ] ], ]); ?>
Обновление адресного классификатора из базы КЛАДР (обновление может занять продолжительное время) 'btn btn-primary', 'data-confirm' => 'Вы уверены, что хотите обновить данные справочника КЛАДР?', 'data-method' => 'get', ] ) ); ?>
Обновление адресного классификатора из базы ФИАС в Информационной системе вуза (экспериментально) 'btn btn-primary', ], ); ?>
$fild) { if (isset($fild)) { echo Html::tag( 'div', $fild, [ 'role' => 'alert', 'class' => 'alert alert-danger', ] ); } } } $js = <<: " + warning.warning; alert.appendChild(span); wrapper.append(alert); } } function fetchMethod(method) { return $.ajax({ url: "/admin/dictionary/update-one-dictionary", data: { method: method, }, type: "get", }); } function processErrorResponse(method, e) { var message = ""; if (e.responseJSON && e.responseJSON.message && e.responseJSON.message === "no-data-warning") { appendWarning(dictionariesArray[method], "Нет данных"); return true; } if (e.responseText && e.responseText.includes("no-data-warning")) { appendWarning(dictionariesArray[method], "Нет данных"); return true; } console.error(e); if (e.responseJSON && e.responseJSON.message) { message = e.responseJSON.message; if (e.responseJSON["stack-trace"]) { try { message = message + "

" + e.responseJSON["stack-trace"].join("
"); } catch (er) { console.error(er); } } } else if (e.responseText) { message = e.responseText; } else { message = "Внутренняя ошибка сервера"; } showTextError(message); return false; } function makeRequest(method, methodName) { setCurrentDictionary(methodName || dictionariesArray[method]); try { fetchMethod(method).done(function (res) { if (res && res.error_message) { showTextError(res.error_message); } return res && res.status; }); } catch (e) { return processErrorResponse(method, e); } } $(function () { $('[data-toggle="tooltip"]').tooltip(); }); $("#custom-dictionary-grid input:checkbox").not(".disabled_checkbox").prop("checked", true); function checkSelection() { var sr = $("#custom-dictionary-grid").yiiGridView("getSelectedRows"); if (sr.length === 0) { alert("Операция не может быть выполнена, необходимо выбрать хотя бы один справочник"); } return sr; } $(".update-dictionaries").click(function (e) { dictionariesArrayKeys = checkSelection(); if (dictionariesArrayKeys.length > 0) { resetProgress(); showUpdateRow(); $.ajax({ url: "/admin/dictionary/get-dictionary-to-update", type: "get", }) .done(function (res) { progressStep = Math.round(70 / dictionariesArrayKeys.length); dictionariesArray = res; updateDictionary(); }) .catch(function (res) { console.error(res); }); } }); JS; $this->registerJs($js, ViewAlias::POS_END); ?>