public function loadModel($id) { if (($model = DictionaryGroup::model()->findByPk($id)) === null) { throw new CHttpException(404, 'Страница не найдена'); } return $model; }
public function loadModel($id) { if (($model = DictionaryGroup::model()->findByPk($id)) === null) { throw new CHttpException(404, Yii::t('DictionaryModule.dictionary', 'Requested page was not found')); } return $model; }
public function up() { Yii::app()->setImport(['application.modules.dictionary.models.*']); $this->insert('site_dictionary_dictionary_group', ['code' => 'euro-countries', 'name_ru' => 'Список стран', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $t = DictionaryGroup::model()->findByAttributes(['code' => 'euro-countries']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'AT', 'name_ru' => 'Австрия', 'value' => 'Австрия', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'AL', 'name_ru' => 'Албания', 'value' => 'Албания', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'AD', 'name_ru' => 'Андорра', 'value' => 'Андорра', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'BY', 'name_ru' => 'Белоруссия', 'value' => 'Белоруссия', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'BE', 'name_ru' => 'Бельгия', 'value' => 'Бельгия', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'BG', 'name_ru' => 'Болгария', 'value' => 'Болгария', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'BA', 'name_ru' => 'Босния и Герцеговина', 'value' => 'Босния и Герцеговина', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'VA', 'name_ru' => 'Ватикан', 'value' => 'Ватикан', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'GB', 'name_ru' => 'Великобритания', 'value' => 'Великобритания', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'HU', 'name_ru' => 'Венгрия', 'value' => 'Венгрия', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'DE', 'name_ru' => 'Германия', 'value' => 'Германия', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'GR', 'name_ru' => 'Греция', 'value' => 'Греция', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'DK', 'name_ru' => 'Дания', 'value' => 'Дания', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'IE', 'name_ru' => 'Ирландия', 'value' => 'Ирландия', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'IS', 'name_ru' => 'Исландия', 'value' => 'Исландия', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'ES', 'name_ru' => 'Испания', 'value' => 'Испания', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'IT', 'name_ru' => 'Италия', 'value' => 'Италия', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'LV', 'name_ru' => 'Латвия', 'value' => 'Латвия', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'LT', 'name_ru' => 'Литва', 'value' => 'Литва', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'LI', 'name_ru' => 'Лихтенштейн', 'value' => 'Лихтенштейн', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'LU', 'name_ru' => 'Люксембург', 'value' => 'Люксембург', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'MK', 'name_ru' => 'Македония', 'value' => 'Македония', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'MT', 'name_ru' => 'Мальта', 'value' => 'Мальта', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'MD', 'name_ru' => 'Молдавия', 'value' => 'Молдавия', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'MC', 'name_ru' => 'Монако', 'value' => 'Монако', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'NL', 'name_ru' => 'Нидерланды', 'value' => 'Нидерланды', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'NO', 'name_ru' => 'Норвегия', 'value' => 'Норвегия', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'PL', 'name_ru' => 'Польша', 'value' => 'Польша', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'PT', 'name_ru' => 'Португалия', 'value' => 'Португалия', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'RUS', 'name_ru' => 'Россия', 'value' => 'Россия', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'RO', 'name_ru' => 'Румыния', 'value' => 'Румыния', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'SM', 'name_ru' => 'Сан-Марино', 'value' => 'Сан-Марино', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'RS', 'name_ru' => 'Сербия', 'value' => 'Сербия', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'SK', 'name_ru' => 'Словакия', 'value' => 'Словакия', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'SI', 'name_ru' => 'Словения', 'value' => 'Словения', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'UA', 'name_ru' => 'Украина', 'value' => 'Украина', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'FI', 'name_ru' => 'Финляндия', 'value' => 'Финляндия', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'FR', 'name_ru' => 'Франция', 'value' => 'Франция', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'HR', 'name_ru' => 'Хорватия', 'value' => 'Хорватия', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'ME', 'name_ru' => 'Черногория', 'value' => 'Черногория', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'CZ', 'name_ru' => 'Чехия', 'value' => 'Чехия', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'CHE', 'name_ru' => 'Швейцария', 'value' => 'Швейцария', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'SE', 'name_ru' => 'Швеция', 'value' => 'Швеция', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'EE', 'name_ru' => 'Эстония', 'value' => 'Эстония', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'CN', 'name_ru' => 'Китай', 'value' => 'Китай', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $this->insert('site_dictionary_dictionary_data', ['group_id' => $t->id, 'code' => 'US', 'name_ru' => 'США', 'value' => 'США', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); }
public function getGroupList() { return CHtml::listData(DictionaryGroup::model()->findAll(array('select' => 'id, title')), 'id', 'title'); }
<h1> <?php echo Yii::t('DictionaryModule.dictionary', 'Dictionary items'); ?> <small><?php echo Yii::t('DictionaryModule.dictionary', 'management'); ?> </small> </h1> </div> <p> <a class="btn btn-default btn-sm dropdown-toggle" data-toggle="collapse" data-target="#search-toggle"> <i class="fa fa-search"> </i> <?php echo Yii::t('DictionaryModule.dictionary', 'Find dictionariy items'); ?> <span class="caret"> </span> </a> </p> <div id="search-toggle" class="collapse out search-form"> <?php Yii::app()->clientScript->registerScript('search', "\n \$('.search-form form').submit(function () {\n \$.fn.yiiGridView.update('dictionary-data-grid', {\n data: \$(this).serialize()\n });\n\n return false;\n });\n"); $this->renderPartial('_search', ['model' => $model]); ?> </div> <?php $this->widget('yupe\\widgets\\CustomGridView', ['id' => 'dictionary-data-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => [['name' => 'id', 'htmlOptions' => ['style' => 'width:20px'], 'type' => 'raw', 'value' => 'CHtml::link($data->id, array("/dictionary/dictionaryDataBackend/update", "id" => $data->id))'], ['class' => 'bootstrap.widgets.TbEditableColumn', 'name' => 'name', 'editable' => ['url' => $this->createUrl('/dictionary/dictionaryDataBackend/inline'), 'mode' => 'inline', 'params' => [Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken]], 'filter' => CHtml::activeTextField($model, 'name', ['class' => 'form-control'])], ['class' => 'bootstrap.widgets.TbEditableColumn', 'name' => 'value', 'editable' => ['url' => $this->createUrl('/dictionary/dictionaryDataBackend/inline'), 'mode' => 'inline', 'params' => [Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken]], 'filter' => CHtml::activeTextField($model, 'value', ['class' => 'form-control'])], ['class' => 'bootstrap.widgets.TbEditableColumn', 'name' => 'code', 'editable' => ['url' => $this->createUrl('/dictionary/dictionaryDataBackend/inline'), 'mode' => 'inline', 'params' => [Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken]], 'filter' => CHtml::activeTextField($model, 'code', ['class' => 'form-control'])], ['class' => 'bootstrap.widgets.TbEditableColumn', 'editable' => ['url' => $this->createUrl('/dictionary/dictionaryDataBackend/inline'), 'mode' => 'popup', 'type' => 'select', 'title' => Yii::t('DictionaryModule.dictionary', 'Select {field}', ['{field}' => mb_strtolower($model->getAttributeLabel('group_id'))]), 'source' => CHtml::listData(DictionaryGroup::model()->findAll(), 'id', 'name'), 'params' => [Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken]], 'name' => 'group_id', 'type' => 'raw', 'value' => '$data->group->name', 'filter' => CHtml::activeDropDownList($model, 'group_id', CHtml::listData(DictionaryGroup::model()->findAll(), 'id', 'name'), ['class' => 'form-control', 'empty' => ''])], ['class' => 'yupe\\widgets\\EditableStatusColumn', 'name' => 'status', 'url' => $this->createUrl('/dictionary/dictionaryDataBackend/inline'), 'source' => $model->getStatusList(), 'options' => [DictionaryData::STATUS_ACTIVE => ['class' => 'label-success'], DictionaryData::STATUS_DELETED => ['class' => 'label-default']]], ['class' => 'yupe\\widgets\\CustomButtonColumn']]]);
public function actionCart($courseAlias, $typeAlias) { // Авторизован ли пользователь if (Yii::app()->user->isAuthenticated() === false) { $this->redirect(Yii::app()->user->loginUrl); } if (($user = Yii::app()->user->getProfile()) === null) { Yii::app()->user->setFlash(yupe\widgets\YFlashMessages::ERROR_MESSAGE, Yii::t('UserModule.user', 'User not found.')); Yii::app()->user->logout(); $this->redirect((array) '/user/account/login'); } // Вид курса $courseType = CourseType::model()->findByCourseAndType($courseAlias, $typeAlias); if (!$courseType) { throw new CHttpException(404); } // Подписка $criteria = new CDbCriteria(); $criteria->compare('t.type', Subscription::TYPE_FULL); $criteria->compare('t.status', Subscription::STATUS_INACTIVE); $criteria->compare('t.user_id', $user->id); $criteria->compare('t.course_type_id', $courseType->id); $subscription = Subscription::model()->with(array('user', 'courseType', 'coupon'))->find($criteria); if (!$subscription) { throw new CHttpException(404); } // Если введен 100%-й купон if (!empty($subscription->coupon_id) && $subscription->total_cost == 0) { // Вызываем метод, обрабатывающий оплату $subscription->pay(); $this->redirect(array('/user/account/index')); } elseif (empty($subscription->coupon_id)) { $subscription->total_cost = $courseType->price; $subscription->update(array('total_cost')); } // Способы оплаты $dictionaryGroup = DictionaryGroup::model()->findByCode('payment-methods'); $paymentMethods = $dictionaryGroup != null ? $dictionaryGroup->getData() : array(); // Робокасса $paymentSystem = Yii::app()->paymentManager->getPaymentSystemObject('robokassa'); // Вывод в шаблон $this->render('cart', array('subscription' => $subscription, 'courseType' => $courseType, 'paymentMethods' => $paymentMethods, 'paymentSystem' => $paymentSystem)); }
public function getColorList() { $dictionaryGroup = DictionaryGroup::model()->findByCode('colors'); if ($dictionaryGroup != null) { return CHtml::listData($dictionaryGroup->getData(), 'id', 'name'); } return array(); }
/** * Список возможных типов: * * @return array */ public function getTypeList() { $dictionaryGroup = DictionaryGroup::model()->findByCode('feedback-types'); if ($dictionaryGroup != null) { return CHtml::listData($dictionaryGroup->getData(), 'id', 'name'); } return array(); }
<?php $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', ['action' => Yii::app()->createUrl($this->route), 'method' => 'get', 'type' => 'vertical', 'htmlOptions' => ['class' => 'well']]); ?> <fieldset class="inline"> <div class="row"> <div class="col-sm-3"> <?php echo $form->dropDownListGroup($model, 'group_id', ['widgetOptions' => ['data' => CHtml::listData(DictionaryGroup::model()->findAll(), 'id', 'name')]]); ?> </div> <div class="col-sm-3"> <?php echo $form->textFieldGroup($model, 'name'); ?> </div> <div class="col-sm-3"> <?php echo $form->textFieldGroup($model, 'code'); ?> </div> </div> <div class="row"> <div class="col-sm-3"> <?php echo $form->textFieldGroup($model, 'description'); ?> </div> <div class="col-sm-3"> <?php
echo Yii::t('DictionaryModule.dictionary', 'management'); ?> </small> </h1> </div> <button class="btn btn-small dropdown-toggle" data-toggle="collapse" data-target="#search-toggle"> <i class="icon-search"> </i> <?php echo CHtml::link(Yii::t('DictionaryModule.dictionary', 'Find dictionariy items'), '#', array('class' => 'search-button')); ?> <span class="caret"> </span> </button> <div id="search-toggle" class="collapse out search-form"> <?php Yii::app()->clientScript->registerScript('search', "\n \$('.search-form form').submit(function() {\n \$.fn.yiiGridView.update('dictionary-data-grid', {\n data: \$(this).serialize()\n });\n return false;\n });\n"); $this->renderPartial('_search', array('model' => $model)); ?> </div> <br/> <p><?php echo Yii::t('DictionaryModule.dictionary', 'This section describes dictionary items management'); ?> </p> <?php $this->widget('yupe\\widgets\\CustomGridView', array('id' => 'dictionary-data-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array(array('name' => 'id', 'htmlOptions' => array('style' => 'width:20px'), 'type' => 'raw', 'value' => 'CHtml::link($data->id, array("/dictionary/dictionaryDataBackend/update", "id" => $data->id))'), array('class' => 'bootstrap.widgets.TbEditableColumn', 'name' => 'name', 'editable' => array('url' => $this->createUrl('/dictionary/dictionaryDataBackend/inline'), 'mode' => 'inline', 'params' => array(Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken))), array('class' => 'bootstrap.widgets.TbEditableColumn', 'name' => 'value', 'editable' => array('url' => $this->createUrl('/dictionary/dictionaryDataBackend/inline'), 'mode' => 'inline', 'params' => array(Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken))), array('class' => 'bootstrap.widgets.TbEditableColumn', 'name' => 'code', 'editable' => array('url' => $this->createUrl('/dictionary/dictionaryDataBackend/inline'), 'mode' => 'inline', 'params' => array(Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken))), array('class' => 'bootstrap.widgets.TbEditableColumn', 'editable' => array('url' => $this->createUrl('/dictionary/dictionaryDataBackend/inline'), 'mode' => 'popup', 'type' => 'select', 'title' => Yii::t('DictionaryModule.dictionary', 'Select {field}', array('{field}' => mb_strtolower($model->getAttributeLabel('group_id')))), 'source' => CHtml::listData(DictionaryGroup::model()->findAll(), 'id', 'name'), 'params' => array(Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken)), 'name' => 'group_id', 'type' => 'raw', 'value' => '$data->group->name', 'filter' => CHtml::listData(DictionaryGroup::model()->findAll(), 'id', 'name')), array('class' => 'bootstrap.widgets.TbEditableColumn', 'editable' => array('url' => $this->createUrl('/dictionary/dictionaryDataBackend/inline'), 'mode' => 'popup', 'type' => 'select', 'title' => Yii::t('DictionaryModule.dictionary', 'Select {field}', array('{field}' => mb_strtolower($model->getAttributeLabel('status')))), 'source' => $model->getStatusList(), 'params' => array(Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken)), 'name' => 'status', 'type' => 'raw', 'value' => '$data->getStatus()', 'filter' => $model->getStatusList()), array('class' => 'bootstrap.widgets.TbButtonColumn'))));
<?php $this->widget('yupe\\widgets\\BackendGridView', ['id' => 'dictionary-data-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => [['name' => 'id', 'htmlOptions' => ['style' => 'width:20px'], 'type' => 'raw', 'value' => 'CHtml::link($data->id, array("/dictionary/dictionaryDataBackend/update", "id" => $data->id))'], ['class' => 'yupe.widgets.columns.CustomEditableColumn', 'name' => 'name'], ['class' => 'yupe.widgets.columns.CustomEditableColumn', 'name' => 'value'], ['class' => 'yupe.widgets.columns.CustomEditableColumn', 'name' => 'code'], ['class' => 'yupe.widgets.columns.CustomEditableColumn', 'editable' => ['mode' => 'popup', 'type' => 'select', 'title' => Yii::t('DictionaryModule.dictionary', 'Select {field}', ['{field}' => mb_strtolower($model->getAttributeLabel('group_id'))]), 'source' => CHtml::listData(DictionaryGroup::model()->findAll(), 'id', 'name')], 'name' => 'group_id', 'type' => 'raw', 'value' => '$data->group->name', 'filter' => CHtml::listData(DictionaryGroup::model()->findAll(), 'id', 'name')], ['name' => 'sort', 'class' => 'yupe.widgets.columns.CustomEditableColumn', 'htmlOptions' => ['style' => 'width:80px'], 'editable' => ['success' => 'js: function(response, newValue) { $.fn.yiiGridView.update("dictionary-data-grid"); }']], ['class' => 'yupe\\widgets\\columns\\EditableStatusColumn', 'name' => 'status', 'source' => $model->getStatusList(), 'options' => [DictionaryData::STATUS_ACTIVE => ['class' => 'label-success'], DictionaryData::STATUS_DELETED => ['class' => 'label-default']]], ['class' => 'yupe\\widgets\\columns\\CustomButtonColumn']]]);
public function up() { Yii::app()->setImport(['application.modules.dictionary.models.*']); $this->delete('site_dictionary_dictionary_data', 'code = :code', [':code' => 'transport-river-hovercraft']); $this->delete('site_dictionary_dictionary_data', 'code = :code', [':code' => 'transport-river-dry-cargo']); $this->delete('site_dictionary_dictionary_data', 'code = :code', [':code' => 'transport-sea-dry-cargo-ship']); $this->delete('site_dictionary_dictionary_data', 'code = :code', [':code' => 'transport-sea-tanker']); $this->delete('site_dictionary_dictionary_data', 'code = :code', [':code' => 'transport-sea-container']); $this->delete('site_dictionary_dictionary_data', 'code = :code', [':code' => 'holodilny']); $this->delete('site_dictionary_dictionary_data', 'code = :code', [':code' => 'cist']); $this->delete('site_dictionary_dictionary_data', 'code = :code', [':code' => 'stel']); /* $this->delete('site_dictionary_dictionary_data', 'code = :code', [':code' => 'gruzovye-avtomobili-do-35t']); $this->delete('site_dictionary_dictionary_data', 'code = :code', [':code' => 'gruzovye-avtomobili-svyshe-35t']); $this->delete('site_dictionary_dictionary_data', 'code = :code', [':code' => 'sedelnye-tyagachi']); $this->delete('site_dictionary_dictionary_data', 'code = :code', [':code' => 'pricepy']); $this->delete('site_dictionary_dictionary_data', 'code = :code', [':code' => 'polupricepy']); $this->delete('site_dictionary_dictionary_data', 'code = :code', [':code' => 'spectehnika']); */ // Cargo - train $m = DictionaryGroup::model()->findByAttributes(['code' => 'tip-transporta-train']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'krytie-vagony', 'name_ru' => 'Крытые вагоны', 'value' => 'Крытые вагоны', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'poluvagony', 'name_ru' => 'Полувагоны', 'value' => 'Полувагоны', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'vagony-cisterny', 'name_ru' => 'Вагоны-цистерны', 'value' => 'Вагоны-цистерны', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'dumpkary', 'name_ru' => 'Думпкары', 'value' => 'Думпкары', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'hoppery', 'name_ru' => 'Хопперы', 'value' => 'Хопперы', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'platformy', 'name_ru' => 'Платформы', 'value' => 'Платформы', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'fitingovie-platformy', 'name_ru' => 'Фитинговые платформы', 'value' => 'Фитинговые платформы', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'vagony-bunkerskogo-tipa', 'name_ru' => 'Вагоны бункерского типа', 'value' => 'Вагоны бункерского типа', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'transportery', 'name_ru' => 'Траспортёры', 'value' => 'Траспортёры', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'avtomobilevozy', 'name_ru' => 'Автомобилевозы', 'value' => 'Автомобилевозы', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'vagony-kenguru', 'name_ru' => 'Вагоны-кенгуру', 'value' => 'Вагоны-кенгуру', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'izotermicheskie', 'name_ru' => 'Изотермические', 'value' => 'Изотермические', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'vagony-ledniki', 'name_ru' => 'Вагоны-ледники', 'value' => 'Вагоны-ледники', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'refrizheratornie', 'name_ru' => 'Рефрижераторные', 'value' => 'Рефрижераторные', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'vagony-termosy', 'name_ru' => 'Вагоны-термосы', 'value' => 'Вагоны-термосы', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); // Cargo - river $m = DictionaryGroup::model()->findByAttributes(['code' => 'tip-transporta-river']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'river-barzha', 'name_ru' => 'Баржа', 'value' => 'Баржа', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'river-nalivnaya-barzha', 'name_ru' => 'Наливная баржа', 'value' => 'Наливная баржа', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'river-gazovozy', 'name_ru' => 'Газовозы', 'value' => 'Газовозы', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'river-tankery', 'name_ru' => 'Танкеры', 'value' => 'Танкеры', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'river-lesovozy', 'name_ru' => 'Лесовозы', 'value' => 'Лесовозы', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'river-suda-dlya-perevozki-navalochnyh-gruzov', 'name_ru' => 'Суда для перевозки навалочных грузов', 'value' => 'Суда для перевозки навалочных грузов', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'river-treylernie-suda', 'name_ru' => 'Трейлерные суда', 'value' => 'Трейлерные суда', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'river-refrizhiratornie-suda', 'name_ru' => 'Рефрижераторные суда', 'value' => 'Рефрижераторные суда', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'river-suhogruznie-suda', 'name_ru' => 'Сухогрузные суда', 'value' => 'Сухогрузные суда', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'river-konteynernie-suda', 'name_ru' => 'Контейнерные суда', 'value' => 'Контейнерные суда', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'river-lihterovozy', 'name_ru' => 'Лихтеровозы', 'value' => 'Лихтеровозы', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'river-transportnie-buksiry', 'name_ru' => 'Траспортные буксиры', 'value' => 'Траспортные буксиры', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'river-buksiry-tolkachi', 'name_ru' => 'Буксиры-толкачи', 'value' => 'Буксиры-толкачи', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); // Cargo - sea $m = DictionaryGroup::model()->findByAttributes(['code' => 'tip-transporta-sea']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'sea-barzha', 'name_ru' => 'Баржа', 'value' => 'Баржа', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'sea-nalivnaya-barzha', 'name_ru' => 'Наливная баржа', 'value' => 'Наливная баржа', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'sea-gazovozy', 'name_ru' => 'Газовозы', 'value' => 'Газовозы', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'sea-tankery', 'name_ru' => 'Танкеры', 'value' => 'Танкеры', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'sea-lesovozy', 'name_ru' => 'Лесовозы', 'value' => 'Лесовозы', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'sea-suda-dlya-perevozki-navalochnyh-gruzov', 'name_ru' => 'Суда для перевозки навалочных грузов', 'value' => 'Суда для перевозки навалочных грузов', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'sea-treylernie-suda', 'name_ru' => 'Трейлерные суда', 'value' => 'Трейлерные суда', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'sea-refrizhiratornie-suda', 'name_ru' => 'Рефрижераторные суда', 'value' => 'Рефрижераторные суда', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'sea-suhogruznie-suda', 'name_ru' => 'Сухогрузные суда', 'value' => 'Сухогрузные суда', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'sea-konteynernie-suda', 'name_ru' => 'Контейнерные суда', 'value' => 'Контейнерные суда', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'sea-lihterovozy', 'name_ru' => 'Лихтеровозы', 'value' => 'Лихтеровозы', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'sea-transportnie-buksiry', 'name_ru' => 'Траспортные буксиры', 'value' => 'Траспортные буксиры', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'sea-buksiry-tolkachi', 'name_ru' => 'Буксиры-толкачи', 'value' => 'Буксиры-толкачи', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); // Cargo - air $m = DictionaryGroup::model()->findByAttributes(['code' => 'tip-transporta-air']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'vertolet', 'name_ru' => 'Вертолет', 'value' => 'Вертолет', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'samolet', 'name_ru' => 'Самолет', 'value' => 'Самолет', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); // Storage type $m = DictionaryGroup::model()->findByAttributes(['code' => 'sklad-type']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'proizvodstvennie', 'name_ru' => 'Производственные', 'value' => 'Производственные', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'tranzitno-perevalochnie', 'name_ru' => 'Транзитно-перевалочные', 'value' => 'Транзитно-перевалочные', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'tamozhennie', 'name_ru' => 'Таможенные', 'value' => 'Таможенные', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'sezonnogo-hraneniya', 'name_ru' => 'Сезонного хранения', 'value' => 'Сезонного хранения', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'optovie-raspredelitelnie', 'name_ru' => 'Оптовые распределительные', 'value' => 'Оптовые распределительные', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'kommer-ob-polzovaniya', 'name_ru' => 'Коммерческие общего пользования', 'value' => 'Коммерческие общего пользования', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'bunrernie-sooruzheniya', 'name_ru' => 'Бункерные сооружения', 'value' => 'Бункерные сооружения', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'rezervuari', 'name_ru' => 'Резервуары', 'value' => 'Резервуары', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'seyfi-dlya-opasnih-veshestv', 'name_ru' => 'Сейфы для опасных веществ', 'value' => 'Сейфы для опасных веществ', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'ovoshehranilisha', 'name_ru' => 'Овощехранилища', 'value' => 'Овощехранилища', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'fruktohranilisha', 'name_ru' => 'Фруктохранилища', 'value' => 'Фруктохранилища', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'sklad-holodilniki', 'name_ru' => 'Склад-холодильники с машинным охлаждением', 'value' => 'Склад-холодильники с машинным охлаждением', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'ledniki', 'name_ru' => 'Ледники для хранения продуктов', 'value' => 'Ледники для хранения продуктов', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); // Storage service $this->insert('site_dictionary_dictionary_group', ['code' => 'sklad-uslugi', 'name_ru' => 'Складские услуги', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1]); $m = DictionaryGroup::model()->findByAttributes(['code' => 'sklad-uslugi']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'razgruzka-i-pogruzka-transporta', 'name_ru' => 'Разгрузка и погрузка транспорта', 'value' => 'Разгрузка и погрузка транспорта', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'priyomka-postupivshih-gruzov-po-kolichestvu-i-po-kachestvu', 'name_ru' => 'Приёмка поступивших грузов по количеству и по качеству', 'value' => 'Приёмка поступивших грузов по количеству и по качеству', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'razmeshchenie-na-hranenie-stellazhi-ili-shtabeli', 'name_ru' => 'Размещение на хранение (стеллажи или штабели)', 'value' => 'Размещение на хранение (стеллажи или штабели)', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'otborka-tovarov-iz-mest-hraneniya', 'name_ru' => 'Отборка товаров из мест хранения', 'value' => 'Отборка товаров из мест хранения', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'komplektovanie-i-upakovka-tovarov', 'name_ru' => 'Комплектование и упаковка товаров', 'value' => 'Комплектование и упаковка товаров', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'vnutriskladskoe-peremeshchenie-gruzov', 'name_ru' => 'Внутрискладское перемещение грузов', 'value' => 'Внутрискладское перемещение грузов', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'ohrana-obekta', 'name_ru' => 'Охрана объекта', 'value' => 'Охрана объекта', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); // Spectehnika $m = DictionaryGroup::model()->findByAttributes(['code' => 'kategoriya-transporta']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'avtogreydery', 'name_ru' => 'Автогрейдеры', 'value' => 'Автогрейдеры', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'avtokrany', 'name_ru' => 'Автокраны', 'value' => 'Автокраны', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'buldozery', 'name_ru' => 'Бульдозеры', 'value' => 'Бульдозеры', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'burovye-ustanovki', 'name_ru' => 'Буровые установки', 'value' => 'Буровые установки', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'krany', 'name_ru' => 'Краны', 'value' => 'Краны', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'pogruzchiki', 'name_ru' => 'Погрузчики', 'value' => 'Погрузчики', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'samosvaly', 'name_ru' => 'Самосвалы', 'value' => 'Самосвалы', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'selskohoz-tehnika', 'name_ru' => 'Сельскохозяйственная техника', 'value' => 'Сельскохозяйственная техника', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'snegouborochnaya-tehnika', 'name_ru' => 'Снегоуборочная техника', 'value' => 'Снегоуборочная техника', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'traktory', 'name_ru' => 'Тракторы', 'value' => 'Тракторы', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'ekskavatory', 'name_ru' => 'Экскаваторы', 'value' => 'Экскаваторы', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'dorozhno-stroitelnaya-tehnika', 'name_ru' => 'Дорожно-строительная техника', 'value' => 'Дорожно-строительная техника', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'kommercheskiy-transport', 'name_ru' => 'Коммерческий транспорт', 'value' => 'Коммерческий транспорт', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'kommunalnye-mashiny', 'name_ru' => 'Коммунальные машины', 'value' => 'Коммунальные машины', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'kommunalnaya-tehnika', 'name_ru' => 'Коммунальная техника', 'value' => 'Коммунальная техника', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'bunkerovoz', 'name_ru' => 'Бункеровоз', 'value' => 'Бункеровоз', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'uborochnye-mashiny', 'name_ru' => 'Уборочные машины', 'value' => 'Уборочные машины', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'lesozagotovitelnaya-tehnika', 'name_ru' => 'Лесозаготовительная техника', 'value' => 'Лесозаготовительная техника', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'promyshlennoe-oborudovanie', 'name_ru' => 'Промышленное оборудование', 'value' => 'Промышленное оборудование', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'zernouborochnaya-tehnika', 'name_ru' => 'Зерноуборочная техника', 'value' => 'Зерноуборочная техника', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'kormozagotovitelnaya-tehnika', 'name_ru' => 'Кормозаготовительная техника', 'value' => 'Кормозаготовительная техника', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'mini-tehnika', 'name_ru' => 'Мини техника', 'value' => 'Мини техника', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'opryskivateli', 'name_ru' => 'Опрыскиватели', 'value' => 'Опрыскиватели', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'posevnaya-tehnika', 'name_ru' => 'Посевная техника', 'value' => 'Посевная техника', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'pochvoobrabatyvayushchaya-tehnika', 'name_ru' => 'Почвообрабатывающая техника', 'value' => 'Почвообрабатывающая техника', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'tehnika-dlya-sadovodstva', 'name_ru' => 'Техника для садоводства', 'value' => 'Техника для садоводства', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'traktory-selskohozyaystvennye', 'name_ru' => 'Тракторы сельскохозяйственные', 'value' => 'Тракторы сельскохозяйственные', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'uborochnaya-tehnika', 'name_ru' => 'Уборочная техника', 'value' => 'Уборочная техника', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'stroitelnaya-tehnika', 'name_ru' => 'Строительная техника', 'value' => 'Строительная техника', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'karernye-samosvaly', 'name_ru' => 'Карьерные самосвалы', 'value' => 'Карьерные самосвалы', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'tehnika-dlya-betona', 'name_ru' => 'Техника для бетона', 'value' => 'Техника для бетона', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'frontalnye-pogruzchiki', 'name_ru' => 'Фронтальные погрузчики', 'value' => 'Фронтальные погрузчики', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); $this->insert('site_dictionary_dictionary_data', ['group_id' => $m->id, 'code' => 'ekskavatory-pogruzchiki', 'name_ru' => 'Экскаваторы-погрузчики', 'value' => 'Экскаваторы-погрузчики', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1']); /* $this->insert('site_dictionary_dictionary_data', [ 'group_id' => $m->id, 'code' => 'pricepy-i-polupricepy', 'name_ru' => 'Прицепы и полуприцепы', 'value' => 'Прицепы и полуприцепы', 'create_time' => date('Y-m-d H:i:s'), 'update_time' => date('Y-m-d H:i:s'), 'create_user_id' => 1, 'update_user_id' => 1, 'status' => '1', ]); */ $this->execute("\n ALTER TABLE `site_cargo_relations`\n ALTER `type` DROP DEFAULT;\n ALTER TABLE `site_cargo_relations`\n CHANGE COLUMN `type` `type` ENUM('load_type','unload_type','documents','body','type_transport') NOT NULL AFTER `id`;\n "); }
public function getColorActiveList() { $dictionaryGroup = DictionaryGroup::model()->findByCode('colors'); if ($dictionaryGroup != null) { $criteria = new CDbCriteria(); $criteria->compare('t.group_id', $dictionaryGroup->id); if ($this->category_id !== null) { $colorsIds = CHtml::listData(InteriorItem::model()->published()->category($this->category_id)->findAll(array('select' => 'color_id')), 'color_id', 'color_id'); } else { $colorsIds = CHtml::listData(InteriorItem::model()->published()->findAll(array('select' => 'color_id')), 'color_id', 'color_id'); } $criteria->addInCondition('t.id', array_keys($colorsIds)); $criteria->order = 't.sort ASC'; $list = DictionaryData::model()->active()->findAll($criteria); return CHtml::listData($list, 'id', 'name'); } return array(); }
public function getAttributeValuesList($name) { $dictionaryGroup = DictionaryGroup::model()->findByCode($name); if ($dictionaryGroup != null) { return CHtml::listData($dictionaryGroup->getData(), 'id', 'name'); } return array(); }
public function getSurfaceList() { $dictionaryGroup = DictionaryGroup::model()->findByCode('chemical-surface'); if ($dictionaryGroup != null) { return CHtml::listData($dictionaryGroup->getData(), 'id', 'name'); } return array(); }
public function getCountryAliasList() { $dictionaryGroup = DictionaryGroup::model()->findByCode('country'); if ($dictionaryGroup != null) { return CHtml::listData($dictionaryGroup->getData(), 'id', 'code'); } return array(); }
public function getMaterialList() { $dictionaryGroup = DictionaryGroup::model()->findByCode('material'); if ($dictionaryGroup != null) { return CHtml::listData($dictionaryGroup->getData(), 'id', 'title'); } return array(); }
public function actionSeoColorCountry() { // Цвета $colors = array(); $dictionaryGroup = DictionaryGroup::model()->findByCode('colors'); if ($dictionaryGroup != null) { $colors = $dictionaryGroup->getData(); } if (empty($colors)) { exit('Нет доступных цветов'); } // Страны $countries = array(); $dictionaryGroup = DictionaryGroup::model()->findByCode('country'); if ($dictionaryGroup != null) { $countries = $dictionaryGroup->getData(); } if (empty($countries)) { exit('Нет доступных стран'); } $seoArray = $this->_buildColorCountrySeoArray(); $typesList = ProductType::model()->findAll(array('order' => 't.sort ASC')); $seriesList = Series::model()->findAll(array('order' => 't.sort ASC')); $criteria = new CDbCriteria(); $criteria->select = new CDbExpression('MAX(sort) as sort'); $max = StoneSeoPage::model()->find($criteria); $sort = $max->sort; $counter = 0; foreach ($typesList as $type) { foreach ($seriesList as $series) { foreach ($countries as $country) { foreach ($colors as $color) { $seoKey = $type->id . '_' . $series->id . '_' . $color->id . '_' . $country->id; if (!in_array($seoKey, $seoArray)) { continue; } $counter++; $sort += 10; $seoPage = new StoneSeoPage(); $seoPage->type_id = $type->id; $seoPage->series_id = $series->id; $seoPage->country_id = $country->id; $seoPage->color_id = $color->id; $seoPage->sort = $sort; $countryCases = explode(';', $country->value); if ($type->id == ProductType::STONES_CATALOG_ID) { $seoTitle = $color->name . ' ' . mb_strtolower($series->title, 'UTF-8') . ' из ' . $countryCases[2]; // Страна } else { if (key_exists(2, $series->cases) && $series->cases[2] != '') { $seoTitle = $color->value . ' ' . mb_strtolower($series->cases[2], 'UTF-8') . ' ' . mb_strtolower($type->title_rus, 'UTF-8') . ' из ' . $countryCases[2]; // Страна } else { $seoTitle = $color->value . ' ' . mb_strtolower($type->title_rus, 'UTF-8') . ' из ' . $series->cases[1] . ' из ' . $countryCases[2]; // Страна } } $seoTitle = mb_strtoupper(mb_substr($seoTitle, 0, 1, 'UTF-8'), 'UTF-8') . mb_substr($seoTitle, 1, mb_strlen($seoTitle), 'UTF-8'); $seoPage->title = $seoTitle; //$seoPage->save(); echo $counter . '. ' . $seoPage->title . '<br />'; //echo $counter . '. ' . $type->getUrl($series->alias, $color->code, $country->code) . '<br />'; } } } } }
<span class="required">*</span> <?php echo Yii::t('DictionaryModule.dictionary', 'are required.'); ?> </div> <?php echo $form->errorSummary($model); ?> <div class='control-group <?php echo $model->hasErrors("group_id") ? "error" : ""; ?> '> <?php echo $form->dropDownListRow($model, 'group_id', CHtml::listData(DictionaryGroup::model()->findAll(), 'id', 'title')); ?> </div> <div class='control-group <?php echo $model->hasErrors("title") ? "error" : ""; ?> '> <?php echo $form->textFieldRow($model, 'title', array('class' => 'span7', 'maxlength' => 300)); ?> </div> <div class='control-group <?php echo $model->hasErrors("code") ? "error" : ""; ?>
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer the ID of the model to be loaded */ public function loadModel($id) { $model = DictionaryGroup::model()->findByPk((int) $id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }