* code for task#1377.

This commit is contained in:
chencongzhi520@gmail.com
2013-06-18 08:26:45 +00:00
parent 52eaccd025
commit 17563eae27
8 changed files with 126 additions and 48 deletions
+5 -31
View File
@@ -116,37 +116,11 @@ class projectModel extends model
*/
public function select($projects, $projectID, $currentModule, $currentMethod, $extra = '')
{
$projectMode = $this->cookie->projectMode ? $this->cookie->projectMode : 'all';
$products = $this->loadModel('product')->getPairs('nocode');
$productGroup = $this->getProductGroupList();
$selectGroup = array();
foreach($productGroup as $productID => $projects)
{
if(!isset($products[$productID]) and $productID != '') continue;
foreach($projects as $project)
{
if($projectMode == 'noclosed' and ($project->status == 'done' or $project->status == 'suspended')) continue;
$status = $project->status != 'done' ? $this->lang->project->selectGroup->doing : '';
if($project->product)
{
$product = isset($products[$project->product]) ? $products[$project->product] : '';
$selectGroup[$product][$project->id] = $project->name . $status;
}
else
{
$selectGroup[$this->lang->project->noProduct][$project->id] = $project->name . $status;
}
}
}
/* See product's model method:select. */
$switchCode = "switchProject($('#projectID').val(), '$currentModule', '$currentMethod', '$extra');";
$onchange = "onchange=\"$switchCode\"";
$onkeypress = "onkeypress=\"eventKeyCode=event.keyCode; if(eventKeyCode == 13) $switchCode\"";
$onclick = "onclick=\"eventKeyCode = 13; $switchCode\"";
$selectHtml = html::selectGroup('projectID', $selectGroup, $projectID, "tabindex=2 $onchange $onkeypress");
return $selectHtml;
$currentProject = $this->getById($projectID);
$output = "<div id='currentItem'>";
$output .= "<a onclick=\"showDropMenu('project', '$projectID', '$currentModule', '$currentMethod', '$extra')\">{$currentProject->name}<span id='dropIcon'></span></a>";
$output .= "</div><div id='dropMenu'></div>";
return $output;
}
/**