Esempio n. 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Areas::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $query->joinWith('idResponsable');
     $dataProvider->sort->attributes['responsable_name'] = ['asc' => ['users.first_name' => SORT_ASC], 'desc' => ['users.first_name' => SORT_DESC]];
     $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(['id' => $this->id, 'area_id' => $this->area_id, 'id_responsable' => $this->id_responsable]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'description', $this->description])->andFilterWhere(['like', 'idResponsable.first_name', $this->responsable_name]);
     return $dataProvider;
 }
Esempio n. 2
0
			$nameValue = "";
			$emailValue = "";
		}else{
			$user = User::findOne(\Yii::$app->user->identity->id);
			$nameValue = $user->first_name . " " . $user->lastname;
			$emailValue = $user->email;
		}
	?>
	
	<?= $form->field($request, 'name')->textInput(['value'=>$nameValue,'maxlength' => true]) ?>
	
	<?= $form->field($request, 'email')->textInput(['value'=> $emailValue,'maxlength' => true]) ?>
	
    <?= $form->field($request, 'area_id')->dropDownList(
		ArrayHelper::map(
			Areas::find()->all(),
			'id',
			'name'
		), array('prompt'=> "")) ?>
		
	<?= $form->field($request, 'category_id')->dropDownList(
		ArrayHelper::map(
			Categories::find()->all(),
			'id',
			'name'
		), array('prompt'=> "")) ?>
		

    <?= $form->field($request, 'subject')->textInput(['maxlength' => true]) ?>

    <?= $form->field($request, 'description')->textarea(['rows' => 6]) ?>
Esempio n. 3
0
?>
<div class="site-signup">
    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p>Por favor llene los campos para poder darse de alta:</p>

    <div class="row">
        <div class="col-lg-5">
            <?php 
$form = ActiveForm::begin(['id' => 'form-signup']);
?>
            <?php 
$areas = Areas::find()->all();
$areaslista = ArrayHelper::map($areas, 'id_area', 'nombre_area');
?>
                <?php 
echo $form->field($model, 'nombre');
?>

                <?php 
echo $form->field($model, 'username')->label('Nombre de usuario');
?>

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

                <?php 
Esempio n. 4
0
			'checked'=>'Checked',			//Verificado
			'denied'=>'Denaied',			//Rechazado
			'completed'=>'Completed',		//Finalizado
		]
	) ?>
	
	<?= $form->field($request, 'scheduled_start_date')->widget(\yii\jui\DatePicker::classname(), [
		'dateFormat' => 'yyyy-MM-dd',
	]) ?>
	
	<?= $form->field($request, 'scheduled_end_date')->widget(\yii\jui\DatePicker::classname(), [
		'dateFormat' => 'yyyy-MM-dd',
	]) ?>
	
	<?php
	$arrayAreas=ArrayHelper::map(Areas::find()->all(),'id','name');
	$areasRequests = (new \yii\db\Query())
    ->select(['area_id'])
    ->from('areas_request')
    ->where(['request_id' => $request->id])
    ->all();
	if(!empty($areasRequests)){
		foreach ($areasRequests as $areaRequest){
			unset($arrayAreas[$areaRequest["area_id"]]);
		}
	}
	?>
	
	<?= $form->field($request, 'listAreas')->checkboxList($arrayAreas) ?>
	
	<?php
Esempio n. 5
0
use app\models\Categories;
use app\models\Areas;

/* @var $this yii\web\View */
/* @var $model app\models\Categories */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="categories-form">

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

    <?= $form->field($model, 'category_id')->dropDownList(
    ArrayHelper::map(Categories::find()->all(),'id','name'), array('prompt'=>''))?>

    <?= $form->field($model, 'id_area')->dropDownList(ArrayHelper::map(Areas::find()->all(),'id','name')) ?>

    <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'description')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'service_level_agreement_asignment')->textInput() ?>

    <?= $form->field($model, 'service_level_agreement_completion')->textInput() ?>

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

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