// Fix on shops + remove id_group_shop from stock + fix stock
This commit is contained in:
@@ -50,9 +50,9 @@ class AdminGroupShop extends AdminTab
|
||||
if (Tools::isSubmit('delete'.$this->table) OR Tools::isSubmit('status') OR Tools::isSubmit('status'.$this->table))
|
||||
{
|
||||
$object = $this->loadObject();
|
||||
if(GroupShop::getTotalGroupShops() == 1)
|
||||
if (GroupShop::getTotalGroupShops() == 1)
|
||||
$this->_errors[] = Tools::displayError('You cannot delete or disable the last groupshop.');
|
||||
elseif($object->haveShops())
|
||||
else if ($object->haveShops())
|
||||
$this->_errors[] = Tools::displayError('You cannot delete or disable a groupshop which have this shops using it.');
|
||||
|
||||
if (sizeof($this->_errors))
|
||||
|
||||
@@ -121,17 +121,16 @@ class AdminGroups extends AdminTab
|
||||
</select>
|
||||
<p>'.$this->l('How the prices are displayed on order summary for this customer group (tax included or excluded).').'</p>
|
||||
</div>
|
||||
<div class="clear"> </div>
|
||||
<div class="margin-form">
|
||||
<input type="submit" value="'.$this->l(' Save ').'" name="submitAdd'.$this->table.'" class="button" />
|
||||
</div>';
|
||||
<div class="clear"> </div>';
|
||||
if (Shop::isMultiShopActivated())
|
||||
{
|
||||
echo '<label>'.$this->l('GroupShop association:').'</label><div class="margin-form">';
|
||||
$this->displayAssoShop('group_shop');
|
||||
echo '</div>';
|
||||
}
|
||||
echo '
|
||||
echo '<div class="margin-form">
|
||||
<input type="submit" value="'.$this->l(' Save ').'" name="submitAdd'.$this->table.'" class="button" />
|
||||
</div>
|
||||
<div class="small"><sup>*</sup> '.$this->l('Required field').'</div>
|
||||
</fieldset>
|
||||
</form><br />';
|
||||
|
||||
@@ -257,7 +257,7 @@ class AdminModulesPositions extends AdminTab
|
||||
else
|
||||
echo '<p>'.$this->l('By clicking here you will be redirected to the front office of your shop to move and delete modules directly.').'</p>
|
||||
<br>
|
||||
<a href="'.$this->context->link->getPageLink('index').'&live_edit&ad='.$admin_dir.'&liveToken='.sha1($admin_dir._COOKIE_KEY_).'" target="_blank" class="button">'.$this->l('Run LiveEdit').'</a>';
|
||||
<a href="'.$this->context->link->getPageLink('index', false, null, 'live_edit&ad='.$admin_dir.'&liveToken='.sha1($admin_dir._COOKIE_KEY_).((Shop::isMultiShopActivated()) ? '&id_shop='.Context::getContext()->shop->getID() : '')).'" target="_blank" class="button">'.$this->l('Run LiveEdit').'</a>';
|
||||
echo '</fieldset>';
|
||||
|
||||
// Print hook list
|
||||
|
||||
@@ -102,13 +102,21 @@ class AdminShop extends AdminTab
|
||||
<input type="text" name="name" id="name" value="'.$this->getFieldValue($obj, 'name').'" />
|
||||
</div>
|
||||
<label for="id_group_shop">'.$this->l('Group Shop').'</label>
|
||||
<div class="margin-form">
|
||||
<select '.$disabled.' name="id_group_shop" id="id_group_shop">';
|
||||
foreach (GroupShop::getGroupShops() AS $group)
|
||||
echo '<option value="'.(int)$group['id_group_shop'].'" '.($obj->id_group_shop == $group['id_group_shop'] ? 'selected="selected"' : '').'">'.$group['name'].'</option>';
|
||||
echo '
|
||||
</select>
|
||||
</div>';
|
||||
<div class="margin-form">';
|
||||
if ($disabled)
|
||||
{
|
||||
$groupShop = new GroupShop($obj->id_group_shop);
|
||||
echo $groupShop->name;
|
||||
echo '<input type="hidden" name="id_group_shop" value="'.$obj->id_group_shop.'" />';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<select '.$disabled.' name="id_group_shop" id="id_group_shop">';
|
||||
foreach (GroupShop::getGroupShops() AS $group)
|
||||
echo '<option value="'.(int)$group['id_group_shop'].'" '.($obj->id_group_shop == $group['id_group_shop'] ? 'selected="selected"' : '').'">'.$group['name'].'</option>';
|
||||
echo '</select>';
|
||||
}
|
||||
echo ' </div>';
|
||||
echo '<label for="id_category">'.$this->l('Category root').'</label>
|
||||
<div class="margin-form">
|
||||
<select id="id_category" name="id_category">';
|
||||
|
||||
@@ -47,7 +47,7 @@ class AdminStockMvt extends AdminTab
|
||||
|
||||
|
||||
$this->_select = 'CONCAT(pl.name, \' \', GROUP_CONCAT(IFNULL(al.name, \'\'), \'\')) product_name, CONCAT(e.lastname, \' \', e.firstname) employee, mrl.name reason';
|
||||
$this->_join = 'INNER JOIN '._DB_PREFIX_.'stock stock ON a.id_stock = stock.id_stock '.$this->context->shop->sqlSharedStock('stock').'
|
||||
$this->_join = 'INNER JOIN '._DB_PREFIX_.'stock stock ON a.id_stock = stock.id_stock '.$this->context->shop->sqlRestriction(Shop::SHARE_STOCK, 'stock').'
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (stock.id_product = pl.id_product AND pl.id_lang = '.(int)$this->context->language->id.$this->context->shop->sqlLang('pl').')
|
||||
LEFT JOIN `'._DB_PREFIX_.'stock_mvt_reason_lang` mrl ON (a.id_stock_mvt_reason = mrl.id_stock_mvt_reason AND mrl.id_lang = '.(int)$this->context->language->id.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'employee` e ON (e.id_employee = a.id_employee)
|
||||
|
||||
Reference in New Issue
Block a user