?>
        <?php 
echo $form->labelEx($model, 'priority_id');
?>
        <?php 
echo $form->dropDownList($model, 'priority_id', $data, array('prompt' => 'Select'));
?>
        <?php 
echo $form->error($model, 'priority_id');
?>
        
        <?php 
echo $form->labelEx($model, 'assigned_project_id');
?>
        <?php 
$projectsByCurrentUser = Project::getMenteeProjects(User::getCurrentUserId());
if (count($projectsByCurrentUser) > 0) {
    $model->assigned_project_id = $projectsByCurrentUser[0]->id;
}
echo $form->dropDownList($model, 'assigned_project_id', CHtml::listData($projectsByCurrentUser, 'id', 'title'), array('empty' => ' '));
?>
        <?php 
echo $form->error($model, 'assigned_project_id');
?>

 
        <?php 
/* If the user if project mentor. He has the option of assign the ticket to another project mentor */
if (User::isCurrentUserProMentor() || User::isCurrentUserAdmin()) {
    $pmentor = User::model()->findAll("isProMentor=:isProMentor and id!=:id", array(':isProMentor' => 1, ':id' => User::model()->getCurrentUserId()));
    //select * from user where isProMentor = '1' AND username != 'lsanc104'