Ejemplo n.º 1
0
 public function contactPersonValidator()
 {
     $userIds = array_keys(CompanyHelper::userList($this->company->id));
     if (!in_array($this->user_id, $userIds)) {
         $this->addError('user_id', 'Incorrect user_id');
     }
 }
Ejemplo n.º 2
0
    </div>

    <?php 
echo $form->errorSummary($model);
?>

    <?php 
echo $form->dropDownListControlGroup($model, 'status', VacancyHelper::statuses(), ['class' => 'span4']);
?>

    <?php 
echo $form->textFieldControlGroup($model, 'name', ['size' => 200, 'class' => 'span8']);
?>

    <?php 
echo $form->dropDownListControlGroup($model, 'user_id', CompanyHelper::userList($company->id), ['class' => 'span8']);
?>

    <?php 
echo $form->dropDownListControlGroup($model, 'city_id', UserCitiesHelper::all());
?>


    <?php 
echo $form->textAreaControlGroup($model, 'description', ['rows' => 8, 'class' => 'span8']);
?>

    <?php 
echo $form->textAreaControlGroup($model, 'requirements', ['rows' => 4, 'class' => 'span8']);
?>
Ejemplo n.º 3
0
            [ <?php 
    echo $model->getAttributeLabel('created_at') . ': ' . $model->created_at;
    ?>
 ]
            [ <?php 
    echo $model->getAttributeLabel('updated_at') . ': ' . $model->updated_at;
    ?>
 ]
        <?php 
}
?>

    </div>

<?php 
$this->widget('bootstrap.widgets.TbDetailView', ['data' => $model, 'attributes' => ['id', ['name' => 'status', 'value' => VacancyHelper::statusName($model), 'type' => 'html'], 'city.city_name', ['name' => 'user_id', 'value' => function (Vacancy $vacancy) {
    $users = CompanyHelper::userList($vacancy->company_id);
    return $users[$vacancy->user_id];
}], 'name', 'description', 'requirements', 'housing:boolean', 'company.name', ['name' => 'created_at', 'value' => function (Vacancy $vacancy) {
    $creator = '--';
    if (!empty($vacancy->creator)) {
        $creator = $vacancy->creator->getFirstLastName();
    }
    return $creator . ": " . Yii::app()->dateFormatter->formatDateTime($vacancy->created_at, "long");
}], ['name' => 'updated_at', 'value' => function (Vacancy $vacancy) {
    $updater = '--';
    if (!empty($vacancy->updater)) {
        $updater = $vacancy->updater->getFirstLastName();
    }
    return $updater . ": " . Yii::app()->dateFormatter->formatDateTime($vacancy->created_at, "long");
}], ['name' => 'close_time', 'value' => Yii::app()->dateFormatter->formatDateTime($model->close_time, "long")], ['name' => 'positions', 'value' => VacancyHelper::positionsAsString($model)], ['name' => 'educations', 'value' => VacancyHelper::educationsAsString($model)], ['name' => 'categories', 'value' => VacancyHelper::categoriesAsString($model)]]]);