Skip to content

Commit

Permalink
updated the dropdown #15286#
Browse files Browse the repository at this point in the history
  • Loading branch information
vivekshekar committed Jan 30, 2015
1 parent d38930b commit 34ddeb1
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions plugin/Zendesk/class/Zendesk.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,13 @@ function getProjectList($iduser){
$q = new sqlQuery($this->getDbCon());
$sql = "select idproject,name from project where iduser = ".$iduser." and status='open'";
$q->query($sql);

$project = array();
while($q->fetch()){

$idproject = $q->getData("idproject");
$project_name = $q->getData("name");

$html .= '<option value='.$idproject.'>'.$project_name.'</option>';
$project[$idproject] = $project_name;
//$html .= '<option value='.$idproject.'>'.$project_name.'</option>';
}

//Get project if user is co-worker
Expand All @@ -191,10 +191,14 @@ function getProjectList($iduser){
while($q1->fetch()){
$project_id = $q1->getData("project_id");
$c_project_name = $q1->getData("project_name");
$html .= '<option value='.$project_id.'>'.$c_project_name.'</option>';
$project[$project_id] = $c_project_name;
//$html .= '<option value='.$project_id.'>'.$c_project_name.'</option>';
}
}

@natcasesort($project);
foreach($project as $key=>$value){
$html .= '<option value='.$key.'>'.$value.'</option>';
}
return $html;
}

Expand Down

0 comments on commit 34ddeb1

Please sign in to comment.