예제 #1
0
 /**
  * Finds user by [[username]]
  *
  * @return User|null
  */
 protected function getUser()
 {
     if ($this->_user === null) {
         $this->_user = UserAdmin::findByUsername($this->username);
     }
     return $this->_user;
 }
예제 #2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = UserAdmin::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([
                'id' => $this->id,
                'position_id'['position'],
     		'section_id'['section'],
                'status' => $this->status,
                'created_at' => $this->created_at,
                'updated_at' => $this->updated_at,
            ]);*/
     $query->joinWith('position')->joinWith('section');
     $query->andFilterWhere(['like', 'userFName', $this->userFName])->andFilterWhere(['like', 'userMName', $this->userMName])->andFilterWhere(['like', 'userLName', $this->userLName])->andFilterWhere(['like', 'username', $this->username])->andFilterWhere(['like', 'password_hash', $this->password_hash])->andFilterWhere(['like', 'auth_key', $this->auth_key])->andFilterWhere(['like', 'email', $this->email])->andFilterWhere(['like', 'position.positionName', $this->position_id])->andFilterWhere(['like', 'section.sectionName', $this->section_id]);
     return $dataProvider;
 }
예제 #3
0
echo $form->field($model, 'docWorkflowComment')->textInput(['maxlength' => true]);
?>

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

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

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

	<?php 
echo $form->field($model, 'user_release')->dropDownList(ArrayHelper::map(\backend\models\UserAdmin::find()->all(), 'id', 'FPname'), ['prompt' => 'Reciepient']);
?>
    
    <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>
예제 #4
0
</h1>-->

    <p>Assign to:</p>

    <div class="row">
        <div class="col-lg-8">
            <?php 
//$form = ActiveForm::begin(['id' => 'login-form']);
$form = ActiveForm::begin();
?>
               <!-- <?php 
echo $form->field($model, 'user_id')->dropDownList(ArrayHelper::map(\common\models\User::find()->where('username != :username', ['username' => Yii::$app->user->identity->username])->all(), 'id', 'username'), ['prompt' => 'User']);
?>
-->
				
				<?php 
echo $form->field($model, 'user_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(\backend\models\UserAdmin::find()->where('username != :username', ['username' => Yii::$app->user->identity->username])->all(), 'id', 'Fullname'), 'options' => ['placeholder' => 'Select a Receiver'], 'pluginOptions' => ['allowClear' => true]]);
?>
					
                <div class="form-group">
                    <?php 
echo Html::submitButton('Release', ['class' => 'btn btn-primary', 'name' => 'login-button']);
?>
                </div>
            <?php 
ActiveForm::end();
?>
        </div>
    </div>
</div>
예제 #5
0
 /**
  * Finds the UserAdmin model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return UserAdmin the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = UserAdmin::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }