* fix for bug
This commit is contained in:
+11
-1
@@ -53,7 +53,17 @@ class tree extends control
|
||||
if($viewType == 'story')
|
||||
{
|
||||
$this->product->setMenu($this->product->getPairs(), $rootID, 'story');
|
||||
$this->view->allProduct = $this->product->getPairs();
|
||||
$products = $this->product->getPairs();
|
||||
$allProduct = array();
|
||||
foreach($products as $key => $productVal)
|
||||
{
|
||||
if($key == $rootID) continue;
|
||||
$allProduct[$key] = $productVal;
|
||||
}
|
||||
$this->view->allProduct =$allProduct;
|
||||
$keys = array_keys($allProduct);
|
||||
$this->view->key = $keys[0];
|
||||
$this->view->productModules = $this->tree->getOptionMenu($keys[0], 'story');
|
||||
$this->lang->tree->menu = $this->lang->product->menu;
|
||||
$this->lang->set('menugroup.tree', 'product');
|
||||
|
||||
|
||||
@@ -14,33 +14,12 @@ function syncModule(rootID)
|
||||
})
|
||||
});
|
||||
$.each(modules, function(key, value)
|
||||
{
|
||||
if(value) $('#sonModule').append("<span><input name=modules[] value=" + value + " style=margin-bottom:5px class=text-3 /><br /><span>");
|
||||
})
|
||||
})
|
||||
}
|
||||
function syncProductModule(rootID)
|
||||
{
|
||||
link = createLink('tree', 'ajaxGetSonModules', 'moduleID=' + $('#productModule').val() + '&rootID=' + rootID);
|
||||
$.getJSON(link, function(modules)
|
||||
{
|
||||
$('.helplink').addClass('hidden');
|
||||
$.each(modules, function(key, value)
|
||||
{
|
||||
moduleName = value;
|
||||
$('.text-3').each(function()
|
||||
{
|
||||
if(this.value == moduleName) modules[key] = null;
|
||||
if(!this.value) $(this).parent().addClass('hidden');
|
||||
})
|
||||
});
|
||||
$('#sonModule').empty();
|
||||
$.each(modules, function(key, value)
|
||||
{
|
||||
{
|
||||
if(value) $('#sonModule').append("<span><input name=modules[] value=" + value + " style=margin-bottom:5px class=text-3 /><br /><span>");
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function syncProduct(obj)
|
||||
{
|
||||
link = createLink('tree', 'ajaxGetModules', 'rootID=' + obj.value);
|
||||
@@ -53,7 +32,7 @@ function syncProduct(obj)
|
||||
$('#productModule').append('<option value=' + key + '>' + value + '</option')
|
||||
});
|
||||
})
|
||||
$('#copyModule').attr('onclick', 'syncProductModule('+obj.value+')');
|
||||
$('#copyModule').attr('onclick', 'syncModule('+obj.value+')');
|
||||
}
|
||||
$(document).ready(function()
|
||||
{
|
||||
|
||||
@@ -59,22 +59,22 @@
|
||||
}
|
||||
else if($viewType == 'story')
|
||||
{
|
||||
echo html::select('allProduct', $allProduct, $rootID, 'class=select-3 onchange=syncProduct(this)');
|
||||
echo html::select('productModule', $productModules, '', 'class=select-3');
|
||||
echo html::commonButton($lang->tree->syncFromProduct, 'id=copyModule onclick=syncProductModule('.$rootID.')');
|
||||
echo html::select('allProduct', $allProduct, 'onchange=syncProduct(this)');
|
||||
echo html::select('productModule', $productModules, '');
|
||||
echo html::commonButton($lang->tree->syncFromProduct, 'id=copyModule onclick=syncModule('.$key.')');
|
||||
echo '<br />';
|
||||
echo '<br />';
|
||||
echo '<br />';
|
||||
}
|
||||
$maxOrder = 0;
|
||||
echo '<div id=sonModule>';
|
||||
echo '<div id="sonModule">';
|
||||
foreach($sons as $sonModule)
|
||||
{
|
||||
if($sonModule->order > $maxOrder) $maxOrder = $sonModule->order;
|
||||
echo '<span>' . html::input("modules[id$sonModule->id]", $sonModule->name, 'class=text-3 style="margin-bottom:5px"') . '<br /></span>';
|
||||
}
|
||||
for($i = 0; $i < TREE::NEW_CHILD_COUNT ; $i ++) echo '<span>' . html::input("modules[]", '', 'class=text-3 style="margin-bottom:5px"') . '<br /></span>';
|
||||
?>
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user