* fix the error when create product and project.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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'));
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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'));
|
||||
|
||||
Reference in New Issue
Block a user