Beispiel #1
0
    ?>
</td>
		</tr>
	<?php 
}
?>
</table>

<h2>
	<?php 
echo Yii::t('app', 'Waarnemingen');
?>
	<?php 
if (Yii::$app->user->can('createObservation', ['visit' => $visit])) {
    ?>
		<a href="<?php 
    echo Url::toRoute(['observations/form', 'visit_id' => $visit->id]);
    ?>
" class="btn btn-success pull-right"><?php 
    echo Yii::t('app', 'Waarneming toevoegen');
    ?>
</a>
	<?php 
}
?>
</h2>

<?php 
$searchModel = new ObservationsSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams, ['visit_id' => $visit->id, 'show_null' => true]);
echo $this->render('/observations/partials/dataTable.php', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
Beispiel #2
0
<?php

use app\models\search\ObservationsSearch;
use fedemotta\datatables\DataTables;
use yii\helpers\Url;
use yii\helpers\Html;
$searchModel = new ObservationsSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams, ['validated' => false, 'show_null' => false]);
?>

<h1><?php 
echo Yii::t('app', 'Niet gevalideerde waarnemingen');
?>
</h1>
<div class="table-responsive">
	<?php 
echo DataTables::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'date', 'value' => function ($model, $key, $index, $column) {
    return Html::a($model->visit->date, Url::toRoute('/observations/detail/' . $model->id));
}, 'format' => 'html'], ['label' => Yii::t('app', 'Project'), 'value' => function ($model, $key, $index, $column) {
    return Html::a($model->box->project->name, Url::toRoute('/projects/detail/' . $model->box->project->id));
}, 'format' => 'html'], ['attribute' => 'box_id', 'value' => function ($model, $key, $index, $column) {
    return Html::a($model->box->code, Url::toRoute('/boxes/detail/' . $model->box_id));
}, 'format' => 'html'], ['label' => Yii::t('app', 'Waarnemer(s)'), 'value' => function ($model, $key, $index, $column) {
    if ($model->visit->getObservers()->exists()) {
        $returnArray = [];
        foreach ($model->visit->getObservers()->all() as $observer) {
            $returnArray[] = $observer->username;
        }
        return implode($returnArray, ', ');
    }
    return '#VERWIJDERD';
Beispiel #3
0
<?php

use app\models\search\ObservationsSearch;
$searchModel = new ObservationsSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
?>

<h1><?php 
echo Yii::t('app', 'Alle waarnemingen');
?>
</h1>

<?php 
echo $this->render('/observations/partials/dataTable.php', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
Beispiel #4
0
<?php

use app\models\search\ObservationsSearch;
$searchModel = new ObservationsSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams, ['personal' => true]);
?>

<h1><?php 
echo Yii::t('app', 'Mijn waarnemingen');
?>
</h1>

<?php 
echo $this->render('/observations/partials/dataTable.php', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);