* fix the error when create product and project.

This commit is contained in:
wangchunsheng
2011-07-06 00:23:11 +00:00
parent f363c1aea0
commit 97e2b766c7
4 changed files with 4 additions and 4 deletions

View File

@@ -169,7 +169,7 @@ class product extends control
die(js::locate($this->createLink($this->moduleName, 'browse', "productID=$productID"), 'parent'));
}
$this->product->setMenu($this->products, '');
$this->product->setMenu($this->products, key($this->products));
$this->view->header->title = $this->lang->product->create;
$this->view->position[] = $this->view->header->title;

View File

@@ -25,7 +25,7 @@ class productModel extends model
public function setMenu($products, $productID, $extra = '')
{
/* Has access privilege?. */
if(!isset($products[$productID]) and !$this->checkPriv($this->getById($productID)))
if($products and !isset($products[$productID]) and !$this->checkPriv($this->getById($productID)))
{
echo(js::alert($this->lang->product->accessDenied));
die(js::locate('back'));

View File

@@ -526,7 +526,7 @@ class project extends control
die(js::locate($this->createLink('project', 'create', "projectID=$projectID"), 'parent'));
}
$this->project->setMenu($this->projects, '');
$this->project->setMenu($this->projects, key($this->projects));
$this->view->header->title = $this->lang->project->create;
$this->view->position[] = $this->view->header->title;

View File

@@ -66,7 +66,7 @@ class projectModel extends model
public function setMenu($projects, $projectID)
{
/* Check the privilege. */
if(!isset($projects[$projectID]) and !$this->checkPriv($this->getById($projectID)))
if($projects and !isset($projects[$projectID]) and !$this->checkPriv($this->getById($projectID)))
{
echo(js::alert($this->lang->project->accessDenied));
die(js::locate('back'));