Commit 20fec362 by semenov

Merge branch 'master' into 'release'

Master

See merge request !9
parents 72b19657 7dcac8ea
Процесс разработки модуля.
==============
1.0.3
-----------------
* У полей формы добавлено значение активности.
......@@ -23,7 +23,7 @@ class Module extends CmsModule
protected function _descriptor()
{
return array_merge(parent::_descriptor(), [
"version" => "1.0.2",
"version" => "1.0.3",
"name" => "Модуль конструктор форм",
"description" => "Модуль прорабатывает модель данных игрового портала. Поставляет модели Игра, Игровой жанр, Игровая платформа, Игровая компания (разработчик, издатель)",
......
<?php
/**
* @author Semenov Alexander <semenov@skeeks.com>
* @link http://skeeks.com/
* @copyright 2010 SkeekS (СкикС)
* @date 03.04.2015
*/
use yii\db\Schema;
use yii\db\Migration;
class m150405_230558_alter_table__form_field extends Migration
{
public function safeUp()
{
$this->execute("ALTER TABLE {{%form_field}} ADD `active` TINYINT(1) NOT NULL DEFAULT '1' ;");
}
public function down()
{
echo "m150122_273205_alter_table__cms_user__emails_adn_phones cannot be reverted.\n";
return false;
}
}
......@@ -64,7 +64,7 @@ class FormField extends Core
public function rules()
{
return array_merge(parent::rules(), [
[['created_by', 'updated_by', 'created_at', 'updated_at', 'form_id'], 'integer'],
[['created_by', 'updated_by', 'created_at', 'updated_at', 'form_id', 'active'], 'integer'],
[['hint'], 'string'],
[['element_config'], 'safe'],
[['priority'], 'integer'],
......@@ -114,6 +114,7 @@ class FormField extends Core
'hint' => \Yii::t('app', 'Небольшая подсказка элемента'),
'name' => \Yii::t('app', 'Название'),
'label' => \Yii::t('app', 'Label элемента'),
'active' => \Yii::t('app', 'Активность'),
]);
}
......
......@@ -182,7 +182,7 @@ class FormSendMessage extends Core
'form' => $form,
'formSendMessage' => $this
])
->setFrom([\Yii::$app->params['supportEmail'] => \Yii::$app->name])
->setFrom([\Yii::$app->cms->adminEmail => \Yii::$app->name])
->setTo($formEmail->value)
->setSubject("Отправка формы «{$form->name}» #" . $this->id)
->send();
......
......@@ -237,4 +237,22 @@ class FormValidateModel extends Model
return $result;
}
/**
* @inheritdoc
*/
public function attributeLabelsValues()
{
$result = [];
foreach ($this->modelForm->fields() as $field)
{
if ($this->getAttribute($field->attribute))
{
$result[$field->normalName()] = $this->getAttribute($field->attribute);
}
}
return $result;
}
}
\ No newline at end of file
......@@ -76,9 +76,14 @@ use common\models\User;
'sortable' => true,
'columns' => [
//['class' => 'yii\grid\SerialColumn'],
'attribute',
'name',
'label',
'hint',
[
'class' => \skeeks\cms\grid\BooleanColumn::className(),
'attribute' => 'active'
],
],
],
]); ?>
......
......@@ -83,6 +83,14 @@ class ActiveForm extends \skeeks\cms\base\widgets\ActiveForm
sx.notify.error(response.message);
}
if (data.redirect)
{
_.delay(function()
{
window.location.href = data.redirect;
}, 200);
}
})
.execute();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment