* finish for testtask branch.

This commit is contained in:
wangyidong
2015-10-29 10:05:01 +08:00
parent d52bb5da5c
commit 1202c8db38
11 changed files with 75 additions and 42 deletions
+10 -10
View File
@@ -51,15 +51,6 @@ class branch extends control
$this->display();
}
public function ajaxGetBranches($productID)
{
$product = $this->loadModel('product')->getById($productID);
if(empty($product) or $product->type == 'normal') die();
$branches = $this->branch->getPairs($productID);
die(html::select('branch', $branches, '', "class='form-control' onchange='loadBranch()'"));
}
public function delete($branchID, $confirm = 'no')
{
if($confirm == 'no') die(js::confirm($this->lang->branch->confirmDelete, inlink('delete', "branchID=$branchID&confirm=yes")));
@@ -67,5 +58,14 @@ class branch extends control
$this->branch->delete(TABLE_BRANCH, $branchID);
die(js::reload('parent'));
}
}
public function ajaxGetBranches($productID, $oldBranch = 0)
{
$product = $this->loadModel('product')->getById($productID);
if(empty($product) or $product->type == 'normal') die();
$branches = $this->branch->getPairs($productID);
if($oldBranch) $branches = array($oldBranch => $branches[$oldBranch]);
die(html::select('branch', $branches, '', "class='form-control' onchange='loadBranch()'"));
}
}