Example #1
0
echo $form->field($model, 'email')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'newPassword')->passwordInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'newPasswordRepeat')->passwordInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'status')->dropDownList(User::getStatusesArray());
?>

    <?php 
echo $form->field($model, 'role')->dropDownList(User::getRolesArray());
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? Module::t('module', 'BUTTON_CREATE') : Module::t('module', 'BUTTON_SAVE'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary', 'name' => 'submit-button']);
?>
    </div>

    <?php 
ActiveForm::end();
?>

</div>
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['id' => 'ID', 'created_at' => UserModule::t('module', 'USER_CREATED'), 'updated_at' => UserModule::t('module', 'USER_UPDATED'), 'username' => UserModule::t('module', 'USER_USERNAME'), 'email' => UserModule::t('module', 'USER_EMAIL'), 'status' => UserModule::t('module', 'USER_STATUS'), 'role' => UserModule::t('module', 'USER_ROLE'), 'date_from' => Module::t('module', 'USER_DATE_FROM'), 'date_to' => Module::t('module', 'USER_DATE_TO')];
 }
Example #3
0
<?php

use yii\helpers\Html;
use app\modules\admin\modules\user\Module;
/* @var $this yii\web\View */
/* @var $model app\modules\admin\modules\user\models\User */
$this->title = Module::t('module', 'TITLE_CREATE');
$this->params['breadcrumbs'][] = ['label' => Module::t('module', 'ADMIN_USERS'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-create">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <?php 
echo $this->render('_form', ['model' => $model]);
?>

</div>
Example #4
0
use app\components\grid\LinkColumn;
use app\modules\admin\modules\user\models\User;
use app\modules\admin\modules\user\Module;
use app\components\grid\SetColumn;
use kartik\date\DatePicker;
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel \app\modules\admin\modules\user\models\search\UserSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Module::t('module', 'ADMIN_USERS');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="users-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p>
        <?php 
echo Html::a(Module::t('module', 'ADMIN_USERS_ADD'), ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'date_from', 'attribute2' => 'date_to', 'type' => DatePicker::TYPE_RANGE, 'separator' => '-', 'pluginOptions' => ['format' => 'yyyy-mm-dd']]), 'attribute' => 'created_at', 'format' => 'datetime'], ['class' => LinkColumn::className(), 'attribute' => 'username'], 'email:email', ['class' => SetColumn::className(), 'filter' => User::getStatusesArray(), 'attribute' => 'status', 'name' => 'statusName', 'cssCLasses' => User::getLabelsArray()], ['filter' => User::getRolesArray(), 'attribute' => 'role', 'value' => 'RoleName'], ['class' => ActionColumn::className()]]]);
?>
</div>
Example #5
0
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ArrayHelper::merge(parent::attributeLabels(), ['newPassword' => Module::t('module', 'USER_NEW_PASSWORD'), 'newPasswordRepeat' => Module::t('module', 'USER_REPEAT_PASSWORD')]);
 }
Example #6
0
use yii\helpers\Html;
use yii\widgets\DetailView;
use app\modules\admin\modules\user\Module;
/* @var $this yii\web\View */
/* @var $model app\modules\admin\modules\user\models\User */
$this->title = $model->username;
$this->params['breadcrumbs'][] = ['label' => Module::t('module', 'ADMIN_USERS'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-view">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p>
        <?php 
echo Html::a(Module::t('module', 'BUTTON_UPDATE'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
        <?php 
echo Html::a(Module::t('module', 'BUTTON_DELETE'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Module::t('module', 'CONFIRM_DELETE'), 'method' => 'post']]);
?>
    </p>

    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'username', 'email:email', 'created_at:datetime', 'updated_at:datetime', 'last_visit:datetime', ['attribute' => 'status', 'format' => 'raw', 'value' => $model->getStatusLabelName()], ['attribute' => 'role', 'value' => $model->getRoleName()]]]);
?>

</div>
Example #7
0
<?php

use yii\helpers\Html;
use app\modules\admin\modules\user\Module;
/* @var $this yii\web\View */
/* @var $model app\modules\admin\modules\user\models\User */
$this->title = $model->username;
$this->params['breadcrumbs'][] = ['label' => Module::t('module', 'ADMIN_USERS'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->username, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = Module::t('module', 'TITLE_UPDATE');
?>
<div class="user-update">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <?php 
echo $this->render('_form', ['model' => $model]);
?>

</div>