/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = TipoTarea::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['idtipotarea' => $this->idtipotarea, 'tarea_idtarea' => $this->tarea_idtarea]);
     $query->andFilterWhere(['like', 'nombre', $this->nombre])->andFilterWhere(['like', 'descripcion', $this->descripcion]);
     return $dataProvider;
 }
Beispiel #2
0
?>
<div class="tareas-has-recurso-humano-view">

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

    <p>
        <?php 
echo Html::a('Update', ['update', 'tareas_idtareas' => $model->tareas_idtareas, 'recurso_humano_idrecurso_humano' => $model->recurso_humano_idrecurso_humano], ['class' => 'btn btn-primary']);
?>
        <?php 
echo Html::a('Delete', ['delete', 'tareas_idtareas' => $model->tareas_idtareas, 'recurso_humano_idrecurso_humano' => $model->recurso_humano_idrecurso_humano], ['class' => 'btn btn-danger', 'data' => ['confirm' => 'Are you sure you want to delete this item?', 'method' => 'post']]);
?>
    </p>

    <?php 
echo DetailView::widget(['model' => $model->tareasIdtareas, 'attributes' => ['nombre', 'descripcion', 'fecha_inicio', 'fecha_fin']]);
?>
    </p>

    <?php 
echo DetailView::widget(['model' => $model->recursoHumanoIdrecursoHumano, 'attributes' => ['nombre', 'puesto', 'area', 'edad', 'antiguedad', 'fotografia']]);
?>
    <?php 
echo DetailView::widget(['model' => TipoTarea::getTipo(['tareas_idtareas' => $model->tareas_idtareas]), 'attributes' => ['nombre']]);
?>

</div>
 /**
  * Finds the TipoTarea model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return TipoTarea the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = TipoTarea::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTipoTareaIdtipoTarea()
 {
     return $this->hasOne(TipoTarea::className(), ['idtipo_tarea' => 'tipo_tarea_idtipo_tarea']);
 }
Beispiel #5
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTipoTareas()
 {
     return $this->hasMany(TipoTarea::className(), ['tareas_idtareas' => 'idtareas']);
 }
echo $form->field($model, 'nombre')->textInput(['maxlength' => true]);
?>

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

    <?php 
echo $form->field($model, 'fecha_inicio')->textInput();
?>

    <?php 
echo $form->field($model, 'fecha_fin')->textInput();
?>

    <?php 
echo $form->field($model, 'tipo_tarea_idtipo_tarea')->dropDownList(ArrayHelper::map(\app\models\TipoTarea::find()->asArray()->all(), 'idtipo_tarea', 'nombre'), ['prompt' => 'Selecciona']);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

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

</div>