<td class="hidden-xs"> <?php echo Html::a('Criar tarefa', false, ['class' => 'btn btn-success pull-right', 'onClick' => "taskCreate();"]); ?> </td> </tr> </table> </div> <?php echo GridView::widget(['id' => 'grid-task', 'dataProvider' => $dataProvider, 'layout' => '{items} {pager}', 'columns' => ['title', ['attribute' => 'start', 'headerOptions' => ['class' => 'hidden-xs'], 'contentOptions' => ['class' => 'hidden-xs']], ['attribute' => 'end', 'headerOptions' => ['class' => 'hidden-xs'], 'contentOptions' => ['class' => 'hidden-xs']], ['attribute' => 'status', 'headerOptions' => ['class' => 'hidden-xs'], 'contentOptions' => ['class' => 'hidden-xs'], 'value' => function ($data) { return app\enum\TaskStatus::toName($data->status); }], ['attribute' => 'done', 'headerOptions' => ['class' => 'hidden-xs'], 'contentOptions' => ['class' => 'hidden-xs']], ['attribute' => 'task_type', 'value' => function ($data) { return app\enum\TaskType::toName($data->task_type); }], ['attribute' => 'member_id', 'value' => function ($data) { return $data->owner->name; }], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {delete}', 'buttons' => ['view' => function ($url, $model, $key) { return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', null, ['href' => 'javascript:void(0);', 'onclick' => 'taskUpdate(' . $model->id . ');', 'title' => 'Ver/Editar', 'data-pjax' => '0']); }, 'delete' => function ($url, $model, $key) { if ($model->member_id == \Yii::$app->user->identity->family_member_id) { return Html::a('<span class="glyphicon glyphicon-trash"></span>', null, ['href' => $url, 'title' => 'Eliminar', 'data-pjax' => '0']); } return false; }]]]]); Pjax::end(); ?> <?php
<?php echo Html::activeHiddenInput($model, 'id'); ?> <?php echo Html::activeHiddenInput($model, 'family_id'); echo Html::activeHiddenInput($model, 'member_id'); ?> <?php echo $form->field($model, 'title')->textInput(['maxlength' => true]); ?> <div class="salenta"> <?php echo $form->field($model, 'task_type')->dropDownList(app\enum\TaskType::getList(), ['onchange' => 'typeChanged();']); ?> </div> <?php echo $form->field($model, 'date_set')->checkbox(); ?> <div id="date-set-control" class="<?php echo $model->date_set == '1' ? '' : 'hidden'; ?> "> <?php echo $form->field($model, 'start')->widget(DatePicker::className(), ['language' => 'pt', 'inline' => false, 'clientOptions' => ['autoclose' => true, 'todayBtn' => true, 'format' => 'yyyy-mm-dd']]); ?>
?> <?php $form = ActiveForm::begin(['id' => 'task-form', 'layout' => 'horizontal']); ?> <?php echo Html::activeHiddenInput($model, 'id'); ?> <?php echo $form->field($model, 'title')->textInput(['disabled' => true]); ?> <div class="salenta"> <?php echo $form->field($model, 'task_type')->dropDownList(app\enum\TaskType::getList(), ['disabled' => true]); ?> </div> <div id="date-set-control" class="<?php echo $model->date_set == '1' ? '' : 'hidden'; ?> "> <?php echo $form->field($model, 'start')->textInput(['disabled' => true]); ?> <?php echo $form->field($model, 'end')->textInput(['disabled' => true]); ?> </div> <?php