Example #1
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set titles
     $this->setCreateTitle(Yii::t('kalibao', 'create_title'));
     $this->setUpdateTitle(Yii::t('kalibao', 'update_title'));
     // models
     $models = $this->getModels();
     // language
     $language = $this->getLanguage();
     // get drop down list methods
     $dropDownList = $this->getDropDownList();
     // upload config
     $uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
     // set items
     $items = [];
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'id', 'value' => $models['main']->id]);
     }
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'stockout', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'preorder', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'delivery_date', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm date-picker date-range', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('delivery_date')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'real_stock', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'alert_stock', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('alert_stock')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'direct_delivery', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'supplier_id', 'type' => 'activeDropDownList', 'data' => $dropDownList('supplier.name'), 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('supplier_id')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'additional_delay', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('additional_delay')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'just_in_time', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'temporary_stockout', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'message', 'type' => 'activeTextarea', 'options' => ['class' => 'form-control input-sm wysiwyg-textarea', 'data-ckeditor-language' => $language]]);
     $this->setItems($items);
 }
Example #2
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set titles
     $this->setCreateTitle(Yii::t('kalibao.backend', 'cms_news_create_title'));
     $this->setUpdateTitle(Yii::t('kalibao.backend', 'cms_news_update_title'));
     // models
     $models = $this->getModels();
     // language
     $language = $this->getLanguage();
     // get drop down list methods
     $dropDownList = $this->getDropDownList();
     // upload config
     $uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
     // set items
     $items = [];
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'id', 'value' => $models['main']->id]);
     }
     $items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'title', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('title')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'cms_news_group_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'cms_news_group_i18n.title']), 'data-add-action' => Url::to('/cms/cms-news-group/create'), 'data-update-action' => Url::to('/cms/cms-news-group/update'), 'data-update-argument' => 'id', 'data-related-field' => '.link_cms_news_group_title', 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->cms_news_group_id) ? CmsNewsGroupI18n::findOne(['cms_news_group_id' => $models['main']->cms_news_group_id, 'i18n_id' => $language])->title : '']]);
     $items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'content', 'type' => 'activeTextarea', 'options' => ['class' => 'form-control input-sm wysiwyg-textarea', 'data-ckeditor-filebrowser-browse-url' => Url::to(['cms-image/list', 'mode' => 'explorer']), 'data-ckeditor-language' => $language]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'activated', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'published_at', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm date-picker date-range', 'value' => $models['main']->published_at != '' ? Yii::$app->formatter->asDatetime($models['main']->published_at, 'yyyy-MM-dd') : '', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('published_at')]]);
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'created_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->created_at, I18N::getDateFormat())]);
     }
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->updated_at, I18N::getDateFormat())]);
     }
     $this->setItems($items);
 }
Example #3
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set titles
     $this->setCreateTitle(Yii::t('kalibao', 'create_title'));
     $this->setUpdateTitle(Yii::t('kalibao', 'update_title'));
     // models
     $models = $this->getModels();
     // language
     $language = $this->getLanguage();
     // get drop down list methods
     $dropDownList = $this->getDropDownList();
     // upload config
     $uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
     // set items
     $items = [];
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'available_date', 'type' => 'activeTextInput', 'options' => ['class' => 'required form-control input-sm date-picker date-range', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('available_date')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'lidoli_category_id', 'type' => 'activeTextInput', 'options' => ['class' => 'required form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('lidoli_category_id')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'brand_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'required form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'brand.name']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->brand_id) ? Brand::findOne(['id' => $models['main']->brand_id])->name : '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'supplier_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'required form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'supplier.name']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->supplier_id) ? Supplier::findOne(['id' => $models['main']->supplier_id])->name : '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'catalog_category_id', 'type' => 'activeDropDownList', 'data' => $dropDownList('category_i18n.title'), 'options' => ['class' => 'required form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('catalog_category_id')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'google_category_id', 'type' => 'activeDropDownList', 'data' => $dropDownList('category_i18n.title'), 'options' => ['class' => 'required form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('google_category_id')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'stats_category_id', 'type' => 'activeDropDownList', 'data' => $dropDownList('category_i18n.title'), 'options' => ['class' => 'required form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('stats_category_id')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'accountant_category_id', 'type' => 'activeDropDownList', 'data' => $dropDownList('category_i18n.title'), 'options' => ['class' => 'required form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('accountant_category_id')]]);
     $items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'name', 'type' => 'activeTextInput', 'options' => ['class' => 'required form-control input-sm', 'maxlength' => true, 'placeholder' => $models['i18n']->getAttributeLabel('name')]]);
     $items['base_price'] = new InputField(['model' => $models['main'], 'attribute' => 'base_price', 'type' => 'activeTextInput', 'required' => true, 'options' => ['class' => 'form-control input-sm required', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('base_price'), 'id' => 'base_price']]);
     $this->setItems($items);
 }
Example #4
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set titles
     $this->setCreateTitle(Yii::t('kalibao', 'create_title'));
     $this->setUpdateTitle(Yii::t('kalibao', 'update_title'));
     // models
     $models = $this->getModels();
     // language
     $language = $this->getLanguage();
     // get drop down list methods
     $dropDownList = $this->getDropDownList();
     // upload config
     $uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
     // set items
     $items = [];
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'id', 'value' => $models['main']->id]);
     }
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'file', 'type' => 'activeFileInput', 'options' => ['maxlength' => true, 'class' => 'input-advanced-uploader', 'placeholder' => $models['main']->getAttributeLabel('file'), 'data-type-uploader' => $uploadConfig['main']['file']['type'], 'data-file-url' => $models['main']->file != '' ? $uploadConfig['main']['file']['baseUrl'] . '/' . $models['main']->file : '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'media_type_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'media_type_i18n.title']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->media_type_id) ? MediaTypeI18n::findOne(['media_type_id' => $models['main']->media_type_id, 'i18n_id' => $language])->title : '']]);
     $items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'title', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['i18n']->getAttributeLabel('title')]]);
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'created_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->created_at, I18N::getDateFormat())]);
     }
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->updated_at, I18N::getDateFormat())]);
     }
     $this->setItems($items);
 }
Example #5
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set titles
     $this->setCreateTitle(Yii::t('kalibao.backend', 'rbac_permission_create_title'));
     $this->setUpdateTitle(Yii::t('kalibao.backend', 'rbac_permission_update_title'));
     // models
     $models = $this->getModels();
     // language
     $language = $this->getLanguage();
     // get drop down list methods
     $dropDownList = $this->getDropDownList();
     // upload config
     $uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
     // set items
     $items = [];
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'id', 'value' => $models['main']->id]);
     }
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'name', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('name')]]);
     $items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'title', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('title')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'rule_path', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('rule_path')]]);
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'created_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->created_at, I18N::getDateFormat())]);
     }
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->updated_at, I18N::getDateFormat())]);
     }
     $this->setItems($items);
 }
Example #6
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set titles
     $this->setCreateTitle(Yii::t('kalibao.backend', 'variable_variable_create_title'));
     $this->setUpdateTitle(Yii::t('kalibao.backend', 'variable_variable_update_title'));
     // models
     $models = $this->getModels();
     // language
     $language = $this->getLanguage();
     // get drop down list methods
     $dropDownList = $this->getDropDownList();
     // upload config
     $uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
     // set items
     $items = [];
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'id', 'value' => $models['main']->id]);
     }
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'variable_group_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'variable_group_i18n.title']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-add-action' => Url::to('/variable/variable-group/create'), 'data-update-action' => Url::to('/variable/variable-group/update'), 'data-update-argument' => 'id', 'data-related-field' => '.link_variable_group_title', 'data-text' => !empty($models['main']->variable_group_id) ? VariableGroupI18n::findOne(['variable_group_id' => $models['main']->variable_group_id, 'i18n_id' => $language])->title : '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'name', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('name')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'val', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('val')]]);
     $items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'description', 'type' => 'activeTextarea', 'options' => ['class' => 'form-control input-sm', 'data-ckeditor-language' => $language]]);
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'created_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->created_at, I18N::getDateFormat())]);
     }
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->updated_at, I18N::getDateFormat())]);
     }
     $this->setItems($items);
 }
Example #7
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set titles
     $this->setCreateTitle(Yii::t('kalibao', 'create_title'));
     $this->setUpdateTitle(Yii::t('kalibao', 'update_title'));
     // models
     $models = $this->getModels();
     // language
     $language = $this->getLanguage();
     // get drop down list methods
     $dropDownList = $this->getDropDownList();
     // upload config
     $uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
     // set items
     $items = [];
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'company_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'company.name']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->company_id) ? Company::findOne(['third_id' => $models['main']->company_id])->name : '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'person_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'person.last_name']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->person_id) ? Person::findOne(['third_id' => $models['main']->person_id])->last_name : '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'is_primary', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'created_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->created_at, I18N::getDateFormat())]);
     }
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->updated_at, I18N::getDateFormat())]);
     }
     $this->setItems($items);
 }
Example #8
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // models
     $models = $this->getModels();
     // language
     $language = $this->getLanguage();
     // get drop down list methods
     $dropDownList = $this->getDropDownList();
     // upload config
     $uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
     // set items
     $items = [];
     if (!$models['main']->isNewRecord) {
         $items['id'] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'id', 'value' => $models['main']->id]);
     }
     $items['exclude_discount_code'] = new InputField(['model' => $models['main'], 'attribute' => 'exclude_discount_code', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $items['force_secure'] = new InputField(['model' => $models['main'], 'attribute' => 'force_secure', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $items['archived'] = new InputField(['model' => $models['main'], 'attribute' => 'archived', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $items['top_product'] = new InputField(['model' => $models['main'], 'attribute' => 'top_product', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $items['exclude_from_google'] = new InputField(['model' => $models['main'], 'attribute' => 'exclude_from_google', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $items['link_brand_product'] = new InputField(['model' => $models['main'], 'attribute' => 'link_brand_product', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('link_brand_product')]]);
     $items['link_product_test'] = new InputField(['model' => $models['main'], 'attribute' => 'link_product_test', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('link_product_test')]]);
     $items['available'] = new InputField(['model' => $models['main'], 'attribute' => 'available', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $items['available_date'] = new InputField(['model' => $models['main'], 'attribute' => 'available_date', 'type' => 'activeTextInput', 'required' => true, 'options' => ['class' => 'form-control input-sm date-picker date-range required', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('available_date')]]);
     $items['alternative_product'] = new InputField(['model' => $models['main'], 'attribute' => 'alternative_product', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'product_i18n.name']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->alternative_product) ? ProductI18n::findOne(['product_id' => $models['main']->alternative_product, 'i18n_id' => $language])->name : '']]);
     $items['lidoli_category_id'] = new InputField(['model' => $models['main'], 'attribute' => 'lidoli_category_id', 'type' => 'activeTextInput', 'required' => true, 'options' => ['class' => 'form-control input-sm required', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('lidoli_category_id')]]);
     $items['brand_id'] = new InputField(['model' => $models['main'], 'attribute' => 'brand_id', 'type' => 'activeHiddenInput', 'required' => true, 'options' => ['class' => 'form-control input-sm input-ajax-select required', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'brand.name']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->brand_id) ? Brand::findOne(['id' => $models['main']->brand_id])->name : '']]);
     $items['supplier_id'] = new InputField(['model' => $models['main'], 'attribute' => 'supplier_id', 'type' => 'activeHiddenInput', 'required' => true, 'options' => ['class' => 'form-control input-sm input-ajax-select required', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'supplier.name']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->supplier_id) ? Supplier::findOne(['id' => $models['main']->supplier_id])->name : '']]);
     $items['catalog_category_id'] = new InputField(['model' => $models['main'], 'attribute' => 'catalog_category_id', 'type' => 'activeDropDownList', 'data' => $dropDownList('category_i18n.title'), 'required' => true, 'options' => ['class' => 'form-control input-sm required', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('catalog_category_id')]]);
     $items['google_category_id'] = new InputField(['model' => $models['main'], 'attribute' => 'google_category_id', 'type' => 'activeDropDownList', 'data' => $dropDownList('category_i18n.title'), 'required' => true, 'options' => ['class' => 'form-control input-sm required', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('google_category_id')]]);
     $items['stats_category_id'] = new InputField(['model' => $models['main'], 'attribute' => 'stats_category_id', 'type' => 'activeDropDownList', 'data' => $dropDownList('category_i18n.title'), 'required' => true, 'options' => ['class' => 'form-control input-sm required', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('stats_category_id')]]);
     $items['accountant_category_id'] = new InputField(['model' => $models['main'], 'attribute' => 'accountant_category_id', 'type' => 'activeDropDownList', 'data' => $dropDownList('category_i18n.title'), 'required' => true, 'options' => ['class' => 'form-control input-sm required', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('accountant_category_id')]]);
     $items['base_price'] = new InputField(['model' => $models['main'], 'attribute' => 'base_price', 'type' => 'activeTextInput', 'required' => true, 'options' => ['class' => 'form-control input-sm required', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('base_price'), 'id' => 'base_price']]);
     $items['is_pack'] = new InputField(['model' => $models['main'], 'attribute' => 'is_pack', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $items['short_description'] = new InputField(['model' => $models['i18n'], 'attribute' => 'short_description', 'type' => 'activeTextarea', 'options' => ['class' => 'form-control input-sm wysiwyg-textarea', 'data-ckeditor-language' => $language]]);
     $items['long_description'] = new InputField(['model' => $models['i18n'], 'attribute' => 'long_description', 'type' => 'activeTextarea', 'options' => ['class' => 'form-control input-sm wysiwyg-textarea', 'data-ckeditor-language' => $language]]);
     $items['comment'] = new InputField(['model' => $models['i18n'], 'attribute' => 'comment', 'type' => 'activeTextarea', 'options' => ['class' => 'form-control input-sm wysiwyg-textarea', 'data-ckeditor-language' => $language]]);
     $items['page_title'] = new InputField(['model' => $models['i18n'], 'attribute' => 'page_title', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['i18n']->getAttributeLabel('page_title')]]);
     $items['name'] = new InputField(['model' => $models['i18n'], 'attribute' => 'name', 'type' => 'activeTextInput', 'required' => true, 'options' => ['class' => 'form-control input-sm required', 'maxlength' => true, 'placeholder' => $models['i18n']->getAttributeLabel('name')]]);
     $items['infos_shipping'] = new InputField(['model' => $models['i18n'], 'attribute' => 'infos_shipping', 'type' => 'activeTextarea', 'options' => ['class' => 'form-control input-sm wysiwyg-textarea', 'data-ckeditor-language' => $language]]);
     $items['meta_description'] = new InputField(['model' => $models['i18n'], 'attribute' => 'meta_description', 'type' => 'activeTextarea', 'options' => ['class' => 'form-control input-sm', 'placeholder' => $models['i18n']->getAttributeLabel('meta_description')]]);
     $items['meta_keywords'] = new InputField(['model' => $models['i18n'], 'attribute' => 'meta_keywords', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['i18n']->getAttributeLabel('meta_keywords')]]);
     if (!$models['main']->isNewRecord) {
         $items['created_at'] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'created_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->created_at, I18N::getDateFormat())]);
     }
     if (!$models['main']->isNewRecord) {
         $items['updated_at'] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->updated_at, I18N::getDateFormat())]);
     }
     $this->setItems($items);
 }
Example #9
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set titles
     $this->setCreateTitle(Yii::t('kalibao', 'create_title'));
     $this->setUpdateTitle(Yii::t('kalibao', 'update_title'));
     // models
     $models = $this->getModels();
     // language
     $language = $this->getLanguage();
     // get drop down list methods
     $dropDownList = $this->getDropDownList();
     // upload config
     $uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
     // set items
     $items = [];
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'id', 'value' => $models['main']->id]);
     }
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'branch_type_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'branch_type_i18n.label']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->branch_type_id) ? BranchTypeI18n::findOne(['branch_type_id' => $models['main']->branch_type_id, 'i18n_id' => $language])->label : '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'tree_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'tree_i18n.label']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->tree_id) ? TreeI18n::findOne(['tree_id' => $models['main']->tree_id, 'i18n_id' => $language])->label : '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'parent', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'branch_i18n.label']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->parent) ? BranchI18n::findOne(['branch_id' => $models['main']->parent, 'i18n_id' => $language])->label : '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'order', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('order')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'media_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'media_i18n.title']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->media_id) ? MediaI18n::findOne(['media_id' => $models['main']->media_id, 'i18n_id' => $language])->title : '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'visible', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'background', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('background')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'presentation_type', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'offset', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('offset')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'display_brands_types', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'big_menu_only_first_level', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'unfold', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'google_shopping_category_id', 'type' => 'activeDropDownList', 'data' => $dropDownList('google_shopping_category.id'), 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('google_shopping_category_id')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'google_shopping', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'affiliation_category_id', 'type' => 'activeDropDownList', 'data' => $dropDownList('affiliation_category.id'), 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('affiliation_category_id')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'affiliation', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'label', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['i18n']->getAttributeLabel('label')]]);
     $items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'description', 'type' => 'activeTextarea', 'options' => ['class' => 'form-control input-sm wysiwyg-textarea', 'data-ckeditor-language' => $language]]);
     $items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'url', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['i18n']->getAttributeLabel('url')]]);
     $items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'meta_title', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['i18n']->getAttributeLabel('meta_title')]]);
     $items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'meta_description', 'type' => 'activeTextarea', 'options' => ['class' => 'form-control input-sm', 'placeholder' => $models['i18n']->getAttributeLabel('meta_description')]]);
     $items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'meta_keywords', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['i18n']->getAttributeLabel('meta_keywords')]]);
     $items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'h1_tag', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['i18n']->getAttributeLabel('h1_tag')]]);
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'created_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->created_at, I18N::getDateFormat())]);
     }
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->updated_at, I18N::getDateFormat())]);
     }
     $this->setItems($items);
 }
Example #10
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set titles
     $this->setCreateTitle(Yii::t('kalibao.backend', 'rbac_user_create_title'));
     $this->setUpdateTitle(Yii::t('kalibao.backend', 'rbac_user_update_title'));
     // models
     $models = $this->getModels();
     // language
     $language = $this->getLanguage();
     // get drop down list methods
     $dropDownList = $this->getDropDownList();
     // upload config
     $uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
     // set items
     $items = [];
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'third_id', 'value' => $models['main']->third_id]);
     }
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'first_name', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('first_name')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'last_name', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('last_name')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'email', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('email')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'default_language', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'language_i18n.title']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->default_language) ? LanguageI18n::findOne(['language_id' => $models['main']->default_language, 'i18n_id' => $language])->title : '']]);
     $items[] = new InputField(['model' => $models['user'], 'attribute' => 'password', 'type' => 'activePasswordInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['user']->getAttributeLabel('password')]]);
     $items[] = new InputField(['model' => $models['user'], 'attribute' => 'password_repeat', 'type' => 'activePasswordInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['user']->getAttributeLabel('password_repeat')]]);
     $items[] = new InputField(['model' => $models['user'], 'attribute' => 'status', 'type' => 'activeDropDownList', 'data' => $dropDownList('user.status:required'), 'options' => ['class' => 'form-control input-sm']]);
     $items[] = new InputField(['model' => $models['user'], 'attribute' => 'active_password_reset', 'type' => 'activeCheckbox', 'options' => ['label' => '']]);
     if (!empty($models['rbacRoles'])) {
         $rbacRoles = [];
         foreach ($models['rbacRoles'] as $rbacRole) {
             $rbacRoles[$rbacRole->id] = $rbacRole->rbacRoleI18ns[0]->title;
         }
         $rbacUserRoles = [];
         foreach ($models['rbacUserRoles'] as $rbacUserRole) {
             $rbacUserRoles[] = $rbacUserRole->rbac_role_id;
         }
         $items[] = new SimpleValueField(['label' => Yii::t('kalibao.backend', 'person_user_roles'), 'value' => Html::checkboxList('rbacUserRolesId', $rbacUserRoles, $rbacRoles, ['unselect' => '-1'])]);
     }
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'created_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->created_at, I18N::getDateFormat())]);
     }
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->updated_at, I18N::getDateFormat())]);
     }
     $this->setItems($items);
 }
Example #11
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set titles
     $this->setCreateTitle(Yii::t('kalibao.backend', 'mail_mail_sending_role_create_title'));
     $this->setUpdateTitle(Yii::t('kalibao.backend', 'mail_mail_sending_role_update_title'));
     // models
     $models = $this->getModels();
     // language
     $language = $this->getLanguage();
     // get drop down list methods
     $dropDownList = $this->getDropDownList();
     // upload config
     $uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
     // set items
     $items = [];
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'mail_send_role_id', 'type' => 'activeDropDownList', 'data' => $dropDownList('mail_send_role_i18n.title'), 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('mail_send_role_id')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'person_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'person.full_name']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->person_id) ? Person::findOne(['id' => $models['main']->person_id])->first_name : '']]);
     $this->setItems($items);
 }
Example #12
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set titles
     $this->setCreateTitle(Yii::t('kalibao.backend', 'language_language_create_title'));
     $this->setUpdateTitle(Yii::t('kalibao.backend', 'language_language_update_title'));
     // models
     $models = $this->getModels();
     // language
     $language = $this->getLanguage();
     // get drop down list methods
     $dropDownList = $this->getDropDownList();
     // upload config
     $uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
     // set items
     $items = [];
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'id', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('id')]]);
     $items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'title', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('title')]]);
     $this->setItems($items);
 }
Example #13
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set titles
     $this->setCreateTitle(Yii::t('kalibao', 'create_title'));
     $this->setUpdateTitle(Yii::t('kalibao', 'update_title'));
     // models
     $models = $this->getModels();
     // language
     $language = $this->getLanguage();
     // get drop down list methods
     $dropDownList = $this->getDropDownList();
     // upload config
     $uploadConfig['address'] = $this->uploadConfig[(new \ReflectionClass($models['address']))->getName()];
     // set items
     $items = [];
     if (!$models['address']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['address'], 'attribute' => 'id', 'value' => $models['address']->id]);
     }
     $items[] = new InputField(['model' => $models['address'], 'attribute' => 'third_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'third.id']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['address']->third_id) ? Third::findOne(['id' => $models['address']->third_id])->id : '']]);
     $items[] = new InputField(['model' => $models['address'], 'attribute' => 'address_type_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'address_type_i18n.title']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['address']->address_type_id) ? AddressTypeI18n::findOne(['address_type_id' => $models['address']->address_type_id, 'i18n_id' => $language])->title : '']]);
     $items[] = new InputField(['model' => $models['address'], 'attribute' => 'label', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['address']->getAttributeLabel('label')]]);
     $items[] = new InputField(['model' => $models['address'], 'attribute' => 'place_1', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['address']->getAttributeLabel('place_1')]]);
     $items[] = new InputField(['model' => $models['address'], 'attribute' => 'place_2', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['address']->getAttributeLabel('place_2')]]);
     $items[] = new InputField(['model' => $models['address'], 'attribute' => 'street_number', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['address']->getAttributeLabel('street_number')]]);
     $items[] = new InputField(['model' => $models['address'], 'attribute' => 'door_code', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['address']->getAttributeLabel('door_code')]]);
     $items[] = new InputField(['model' => $models['address'], 'attribute' => 'zip_code', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['address']->getAttributeLabel('zip_code')]]);
     $items[] = new InputField(['model' => $models['address'], 'attribute' => 'city', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['address']->getAttributeLabel('city')]]);
     $items[] = new InputField(['model' => $models['address'], 'attribute' => 'country', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['address']->getAttributeLabel('country')]]);
     $items[] = new InputField(['model' => $models['address'], 'attribute' => 'is_primary', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $items[] = new InputField(['model' => $models['address'], 'attribute' => 'note', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['address']->getAttributeLabel('note')]]);
     if (!$models['address']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['address'], 'attribute' => 'created_at', 'value' => Yii::$app->formatter->asDatetime($models['address']->created_at, I18N::getDateFormat())]);
     }
     if (!$models['address']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['address'], 'attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDatetime($models['address']->updated_at, I18N::getDateFormat())]);
     }
     $this->setItems($items);
 }
Example #14
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set titles
     $this->setCreateTitle(Yii::t('kalibao.backend', 'message_message_create_title'));
     $this->setUpdateTitle(Yii::t('kalibao.backend', 'message_message_update_title'));
     // models
     $models = $this->getModels();
     // language
     $language = $this->getLanguage();
     // get drop down list methods
     $dropDownList = $this->getDropDownList();
     // set items
     $items = [];
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'message_group_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'message_group_i18n.title']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-add-action' => Url::to('/message/message-group/create'), 'data-update-action' => Url::to('/message/message-group/update'), 'data-update-argument' => 'id', 'data-related-field' => '.link_message_group_title', 'data-text' => !empty($models['main']->message_group_id) ? MessageGroupI18n::findOne(['message_group_id' => $models['main']->message_group_id, 'i18n_id' => $language])->title : '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'source', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('source')]]);
     $models['i18ns'] = $this->orderLanguage($models['i18ns']);
     foreach ($models['i18ns'] as $languageId => $model) {
         $items[] = new InputField(['model' => $model, 'attribute' => 'translation', 'type' => 'activeTextarea', 'label' => Html::labelI18n($languageId), 'options' => ['class' => 'form-control input-sm', 'placeholder' => $models['main']->getAttributeLabel('translation'), 'maxlength' => true, 'name' => (new \ReflectionClass($model))->getShortName() . '[' . $languageId . '][translation]']]);
     }
     $this->setItems($items);
 }
Example #15
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set titles
     $this->setCreateTitle(Yii::t('kalibao.backend', 'cms_page_create_title'));
     $this->setUpdateTitle(Yii::t('kalibao.backend', 'cms_page_update_title'));
     // models
     $models = $this->getModels();
     // language
     $language = $this->getLanguage();
     // get drop down list methods
     $dropDownList = $this->getDropDownList();
     // upload config
     $uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
     // set items
     $items = [];
     if (!$models['main']->isNewRecord) {
         $items['id'] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'id', 'value' => $models['main']->id]);
     }
     $items['title'] = new InputField(['model' => $models['i18n'], 'attribute' => 'title', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('title')]]);
     $items['activated'] = new InputField(['model' => $models['main'], 'attribute' => 'activated', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $items['cache_duration'] = new InputField(['model' => $models['main'], 'attribute' => 'cache_duration', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('cache_duration')]]);
     $items['cms_layout_id'] = new InputField(['model' => $models['main'], 'attribute' => 'cms_layout_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select input-ajax-select-layout', 'data-url-page-contents' => Url::to(['load-page-contents']), 'data-page-id' => !$models['main']->isNewRecord ? $models['main']->id : '', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'cms_layout_i18n.name']), 'data-add-action' => Url::to('/cms/cms-layout/create'), 'data-update-action' => Url::to('/cms/cms-layout/update'), 'data-update-argument' => 'id', 'data-related-field' => '.link_cms_layout_name', 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->cms_layout_id) ? CmsLayoutI18n::findOne(['cms_layout_id' => $models['main']->cms_layout_id, 'i18n_id' => $language])->name : '']]);
     $items['slug'] = new InputField(['model' => $models['i18n'], 'attribute' => 'slug', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm active-slug', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('slug')]]);
     $items['html_title'] = new InputField(['model' => $models['i18n'], 'attribute' => 'html_title', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('html_title')]]);
     $items['html_description'] = new InputField(['model' => $models['i18n'], 'attribute' => 'html_description', 'type' => 'activeTextarea', 'options' => ['class' => 'form-control input-sm', 'placeholder' => $models['i18n']->getAttributeLabel('html_description')]]);
     $items['html_keywords'] = new InputField(['model' => $models['i18n'], 'attribute' => 'html_keywords', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('html_keywords')]]);
     if (isset($models['pageContents'])) {
         $editPageContents = new EditPageContents(['language' => $this->getLanguage(), 'models' => ['pageContents' => $models['pageContents']]]);
         $items = array_merge($items, $editPageContents->getItems());
     }
     if (!$models['main']->isNewRecord) {
         $items['created_at'] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'created_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->created_at, I18N::getDateFormat())]);
     }
     if (!$models['main']->isNewRecord) {
         $items['updated_at'] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->updated_at, I18N::getDateFormat())]);
     }
     $this->setItems($items);
 }
Example #16
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set titles
     $this->setUpdateTitle(Yii::t('kalibao.backend', 'rbac_user_update_title'));
     // models
     $models = $this->getModels();
     // language
     $language = $this->getLanguage();
     // get drop down list methods
     $dropDownList = $this->getDropDownList();
     // upload config
     $uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
     // set items
     $items = [];
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'first_name', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('first_name')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'last_name', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('last_name')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'email', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('email')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'default_language', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'language_i18n.title']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->default_language) ? LanguageI18n::findOne(['language_id' => $models['main']->default_language, 'i18n_id' => $language])->title : '']]);
     $items[] = new InputField(['model' => $models['user'], 'attribute' => 'password', 'type' => 'activePasswordInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['user']->getAttributeLabel('password')]]);
     $items[] = new InputField(['model' => $models['user'], 'attribute' => 'password_repeat', 'type' => 'activePasswordInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['user']->getAttributeLabel('password_repeat')]]);
     $this->setItems($items);
 }
Example #17
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set titles
     $this->setCreateTitle(Yii::t('kalibao', 'create_title'));
     $this->setUpdateTitle(Yii::t('kalibao', 'update_title'));
     // models
     $models = $this->getModels();
     // language
     $language = $this->getLanguage();
     // get drop down list methods
     $dropDownList = $this->getDropDownList();
     // upload config
     $uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
     // set items
     $items = [];
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'third_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'third.id']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->third_id) ? Third::findOne(['id' => $models['main']->third_id])->id : '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'first_name', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('first_name')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'last_name', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('last_name')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'email', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('email')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'default_language', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'language_i18n.title']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->default_language) ? LanguageI18n::findOne(['language_id' => $models['main']->default_language, 'i18n_id' => $language])->title : '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'user_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'user.username']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->user_id) ? User::findOne(['id' => $models['main']->user_id])->username : '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'gender_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'person_gender_i18n.title']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->gender_id) ? PersonGenderI18n::findOne(['gender_id' => $models['main']->gender_id, 'i18n_id' => $language])->title : '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'phone_1', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('phone_1')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'phone_2', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('phone_2')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'fax', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('fax')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'website', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('website')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'birthday', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm date-picker date-range', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('birthday')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'skype', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('skype')]]);
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'created_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->created_at, I18N::getDateFormat())]);
     }
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->updated_at, I18N::getDateFormat())]);
     }
     $this->setItems($items);
 }
Example #18
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set titles
     $this->setCreateTitle(Yii::t('kalibao.backend', 'language_language_group_language_create_title'));
     $this->setUpdateTitle(Yii::t('kalibao.backend', 'language_language_group_language_update_title'));
     // models
     $models = $this->getModels();
     // language
     $language = $this->getLanguage();
     // get drop down list methods
     $dropDownList = $this->getDropDownList();
     // upload config
     $uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
     // set items
     $items = [];
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'id', 'value' => $models['main']->id]);
     }
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'language_group_id', 'type' => 'activeDropDownList', 'data' => $dropDownList('language_group_i18n.title'), 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('language_group_id')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'language_id', 'type' => 'activeDropDownList', 'data' => $dropDownList('language_i18n.title'), 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('language_id')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'activated', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
     $this->setItems($items);
 }