예제 #1
0
파일: _form.php 프로젝트: lowbase/yii2-user
        </div>
        <div class="col-lg-6">
        </div>
    </div>

    <div class="row">
        <div class="col-lg-6">
            <?php 
echo '<label class="control-label">' . Yii::t('user', 'Обладает допусками') . '</label>';
?>
            <?php 
echo Select2::widget(['name' => 'AuthItem[children_array]', 'value' => array_keys($model->children_array), 'data' => AuthItem::getAll(), 'options' => ['multiple' => true], 'pluginOptions' => ['tags' => true]]);
?>
        </div>
        <div class="col-lg-6">
            <?php 
echo '<label class="control-label">' . Yii::t('user', 'Обладают пользователи') . '</label>';
?>
            <?php 
echo Select2::widget(['name' => 'AuthItem[user_array]', 'value' => array_keys($model->user_array), 'data' => User::getAll(), 'options' => ['multiple' => true], 'pluginOptions' => ['tags' => true]]);
?>
        </div>
    </div>


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

</div>
예제 #2
0
        <div class="col-lg-6">
            <?php 
echo $form->field($model, 'image');
?>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-6">
            <?php 
echo $form->field($model, 'created_by')->widget(Select2::classname(), ['data' => User::getAll(true), 'options' => ['placeholder' => '', 'id' => 'created'], 'pluginOptions' => ['allowClear' => true]]);
?>
        </div>
        <div class="col-lg-6">
            <?php 
echo $form->field($model, 'updated_by')->widget(Select2::classname(), ['data' => User::getAll(true), 'options' => ['placeholder' => '', 'id' => 'updated'], 'pluginOptions' => ['allowClear' => true]]);
?>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-6">
            <?php 
echo $form->field($model, 'created_at_from')->widget(DatePicker::classname(), ['options' => ['placeholder' => ''], 'type' => DatePicker::TYPE_COMPONENT_APPEND, 'pluginOptions' => ['autoclose' => true, 'format' => 'dd.mm.yyyy']]);
?>
        </div>
        <div class="col-lg-6">
            <?php 
echo $form->field($model, 'created_at_till')->widget(DatePicker::classname(), ['options' => ['placeholder' => ''], 'type' => DatePicker::TYPE_COMPONENT_APPEND, 'pluginOptions' => ['autoclose' => true, 'format' => 'dd.mm.yyyy']]);
?>
        </div>
예제 #3
0
파일: index.php 프로젝트: lowbase/yii2-cms
    $icon = $model->is_folder ? 'glyphicon glyphicon-folder-open' : 'glyphicon glyphicon-file';
    return "<span class='" . $icon . "'></span> " . $model->id;
}], 'name', ['attribute' => 'parent_id', 'vAlign' => 'middle', 'format' => 'raw', 'width' => '150px', 'value' => function ($model) {
    return $model->parent_id && $model->parent ? $model->parent->name : null;
}, 'filter' => Document::getAll(), 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => ' ', 'class' => 'form-control']], ['attribute' => 'template_id', 'vAlign' => 'middle', 'format' => 'raw', 'width' => '150px', 'value' => function ($model) {
    return $model->template_id && $model->template ? $model->template->name : null;
}, 'filter' => Template::getAll(), 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => ' ', 'class' => 'form-control']], ['attribute' => 'created_at', 'vAlign' => 'middle', 'format' => ['date', 'dd.MM.Y HH:mm:ss'], 'width' => '200px', 'filter' => DatePicker::widget(['value' => isset($_GET['DocumentSearch']['created_at']) ? $_GET['DocumentSearch']['created_at'] : '', 'name' => 'DocumentSearch[created_at]', 'type' => DatePicker::TYPE_COMPONENT_APPEND, 'pluginOptions' => ['format' => 'dd.mm.yyyy', 'todayHighlight' => true]])], ['attribute' => 'created_by', 'vAlign' => 'middle', 'format' => 'raw', 'width' => '200px;', 'value' => function ($model) {
    $value = '';
    if (isset($model->created)) {
        $value .= $model->created->first_name;
        if ($model->created->last_name) {
            $value .= ' ' . $model->created->last_name;
        }
    }
    return $value . ' (' . $model->created_by . ')';
}, 'filter' => User::getAll(true), 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => ' ', 'class' => 'form-control', 'id' => 'created_by']], ['attribute' => 'status', 'vAlign' => 'middle', 'format' => 'raw', 'value' => function ($model) {
    switch ($model->status) {
        case Document::STATUS_BLOCKED:
            return '<span class="label label-danger">
                            <i class="glyphicon glyphicon-lock"></i> ' . Document::getStatusArray()[Document::STATUS_BLOCKED] . '</span>';
            break;
        case Document::STATUS_WAIT:
            return '<span class="label label-warning">
                            <i class="glyphicon glyphicon-hourglass"></i> ' . Document::getStatusArray()[Document::STATUS_WAIT] . '</span>';
            break;
        case Document::STATUS_ACTIVE:
            return '<span class="label label-success">
                            <i class="glyphicon glyphicon-ok"></i> ' . Document::getStatusArray()[Document::STATUS_ACTIVE] . '</span>';
            break;
    }
    return false;