Example #1
0
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\DataColumn', 'attribute' => 'conferenceid', 'filter' => Conference::getList(), 'format' => 'raw', 'value' => function ($model, $key, $index, $column) {
    /** @var $model app\models\Doclad */
    return $model->section !== null ? Html::encode($model->section->conference->cnf_title) . '<br />' . Html::encode($model->section->sec_title) : '';
}], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'doc_subject', 'format' => 'raw', 'value' => function ($model, $key, $index, $column) {
    $sFiles = '';
    $aFiles = $model->files;
    if (count($aFiles) > 0) {
        $sFiles = array_reduce($aFiles, function ($sRes, $item) {
            /** @var File $item */
            return '<br />' . Html::a($item->file_orig_name, str_replace(DIRECTORY_SEPARATOR, '/', $item->file_name)) . $sRes;
        }, '');
    }
    /** @var $model app\models\Doclad */
    return Html::encode($model->doc_subject) . (Yii::$app->user->identity->isMainModerator($model) ? ' <span class="glyphicon glyphicon-star"></span>' : '') . ($sFiles != '' ? '<br />' : '') . $sFiles . '<br />' . '<br />' . $model->getFullState();
}], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'doc_type', 'filter' => Doclad::getAllTypes(), 'format' => 'raw', 'value' => function ($model, $key, $index, $column) {
    /** @var $model app\models\Doclad */
    return Html::encode($model->typeTitle()) . ($model->doc_format != Doclad::DOC_FORMAT_NOFORMAT ? '<br />' . Html::encode($model->getFormat()) : '');
}], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'doc_state', 'filter' => Doclad::getAllStatuses(), 'format' => 'raw', 'value' => function ($model, $key, $index, $column) {
    /** @var $model app\models\Doclad */
    $a = [Doclad::DOC_STATUS_NEW => '', Doclad::DOC_STATUS_APPROVE => 'ok', Doclad::DOC_STATUS_NOT_APPROVE => 'remove', Doclad::DOC_STATUS_REVISION => 'refresh'];
    return $a[$model->doc_state] != '' ? '<span class="glyphicon glyphicon-' . $a[$model->doc_state] . '"></span>' : '';
}], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'doc_lider_fam', 'format' => 'raw', 'value' => function ($model, $key, $index, $column) {
    /** @var $model app\models\Doclad */
    return Html::encode($model->getLeadername(false)) . '<br />' . Yii::$app->formatter->asEmail($model->doc_lider_email) . ', ' . Html::a(str_replace(['(', ')'], [' (', ') '], $model->doc_lider_phone), 'tel:+' . preg_replace('|[^\\d]|', '', $model->doc_lider_phone));
}], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {filedownload}', 'buttons' => ['view' => function ($url, $model, $key) {
    /** @var Doclad $model */
    $options = [];
    $sIcon = 'pencil';
    if ($model->doc_state == Doclad::DOC_STATUS_APPROVE) {
        $sIcon = 'eye-open';
Example #2
0
<?php

use yii\helpers\Html;
use yii\grid\GridView;
use app\models\Conference;
use app\models\Doclad;
/* @var $this yii\web\View */
/* @var $searchModel app\models\SectionSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Секции';
$this->params['breadcrumbs'][] = $this->title;
$aDocladTypes = Doclad::getAllTypes();
?>
<div class="section-index">

    <!-- h1><?php 
echo Html::encode($this->title);
?>
</h1 -->
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a('Добавить секцию', ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['sec_title', ['attribute' => 'sec_cnf_id', 'class' => 'yii\\grid\\DataColumn', 'filter' => Conference::getList(), 'value' => function ($model, $key, $index, $column) {
Example #3
0
<div class="section-form">

    <?php 
$form = ActiveForm::begin();
?>

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

    <?php 
echo $form->field($model, 'sec_cnf_id')->dropDownList(Conference::getList());
?>

    <?php 
echo $form->field($model, 'sec_doclad_type')->dropDownList(array_merge(['' => ''], Doclad::getAllTypes()));
?>

    <?php 
echo '';
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Создать' : 'Сохранить', ['class' => 'btn btn-success']);
?>
    </div>

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