diff --git a/admin-dev/tabs/AdminStockManagement.php b/admin-dev/tabs/AdminStockManagement.php deleted file mode 100644 index 3ec1e2d68..000000000 --- a/admin-dev/tabs/AdminStockManagement.php +++ /dev/null @@ -1,212 +0,0 @@ - -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 7307 $ -* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ - -class AdminStockManagement extends AdminTab -{ - public function __construct() - { - $this->context = Context::getContext(); - $this->table = 'stock_mvt'; - $this->className = 'StockMvt'; - $this->edit = false; - $this->delete = false; - $this->view = false; - - $this->fieldsDisplay = array( - 'id_stock_mvt' => array('title' => $this->l('ID'), 'width' => 40), - 'product_name' => array('title' => $this->l('Product Name'), 'width' => 200, 'havingFilter' => true), - 'physical_quantity' => array('title' => $this->l('Quantity'), 'width' => 40), - 'reason' => array('title' => $this->l('Reason'), 'width' => 200), - 'id_order' => array('title' => $this->l('ID Order'), 'width' => 40), - 'employee' => array('title' => $this->l('Employee'), 'width' => 100, 'havingFilter' => true), - 'warehouse' => array('title' => $this->l('Warehouse'), 'width' => 100, 'havingFilter' => true), - ); - - $this->_select = 'CONCAT(pl.name, \' \', GROUP_CONCAT(IFNULL(al.name, \'\'), \'\')) product_name, CONCAT(e.lastname, \' \', e.firstname) AS employee, mrl.name AS reason, CONCAT(w.reference, " - ", w.name) AS warehouse'; - $this->_join = 'INNER JOIN '._DB_PREFIX_.'stock stock ON a.id_stock = stock.id_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->addSqlRestrictionOnLang('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) - LEFT JOIN `'._DB_PREFIX_.'warehouse` w ON (w.id_warehouse = stock.id_warehouse) - LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON (pac.id_product_attribute = stock.id_product_attribute) - LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON (al.id_attribute = pac.id_attribute AND al.id_lang = '.(int)$this->context->language->id.')'; - $this->_group = 'GROUP BY a.id_stock_mvt'; - parent::__construct(); - } - - public function postProcess() - { - /*if (Tools::isSubmit('rebuildStock')) - StockMvt::addMissingMvt($this->context->employee->id, false);*/ - return parent::postProcess(); - } - - public function displayForm($isMainTab = true) - { - parent::displayForm(); - - if (!($obj = $this->loadObject(true))) - return; - $dl = 'name'; - echo '
- '.($obj->id ? '' : '').' -
'.$this->l('Stock Movement').' - -
'; - foreach ($this->_languages as $language) - echo '
- * -
'; - $this->displayFlags($this->_languages, $this->_defaultFormLanguage, $dl, 'name'); - echo '
-
 
- -
- -
-
 
'; - echo '
- -
-
-
'; - } -/* - public function viewstock_mvt() - { - $stockMvt = new StockMvt((int)Tools::getValue('id_stock_mvt')); - $product = new Product((int)$stockMvt->id_product, true, $this->context->language->id); - $movements = $product->getStockMvts($this->context->language->id); - - echo '

'.$this->l('Stock Movements for').' '.$product->name.'

- - - - - - - - - - '; - $irow = 0; - foreach ($movements AS $k => $mvt) - { - echo ' - - - - - - - - - '; - } - echo '
'.$this->l('ID').''.$this->l('Product Name').''.$this->l('Quantity').''.$this->l('Reason').''.$this->l('Employee').''.$this->l('Order').''.$this->l('Date').'
'.$mvt['id_stock_mvt'].''.$mvt['product_name'].''.$mvt['quantity'].''.$mvt['reason'].''.$mvt['employee'].'#'.$mvt['id_order'].''.Tools::displayDate($mvt['date_add'], $this->context->language->id).'
'; - } -*/ - public function display() - { - $old_post = false; - - if (!isset($_GET['addstock_mvt_reason']) OR (Tools::isSubmit('submitAddstock_mvt_reason') AND Tools::getValue('id_stock_mvt_reason'))) - { - if (isset($_POST)) - { - $old_post = $_POST; - } - echo '

'.$this->l('Stock movement history').'

'; - parent::display(); - /*if (!isset($_GET['view'.$this->table])) - echo ' -
-
- -
- -
-
-

';*/ - } - if (isset($_GET['view'.$this->table])) - return; - if ($old_post) - $_POST = $old_post; - - $this->table = 'stock_mvt_reason'; - $this->className = 'StockMvtReason'; - $this->identifier = 'id_stock_mvt_reason'; - $this->edit = true; - $this->delete = true; - $this->lang = true; - $this->add = true; - $this->view = false; - $this->_listSkipDelete = array(1,2,3,4); - - - $this->_defaultOrderBy = $this->identifier; - $this->fieldsDisplay = array('id_stock_mvt_reason' => array('title' => $this->l('ID'), 'width' => 40), - 'sign' => array('title' => $this->l('Sign'), 'width' => 15, 'align' => 'center', 'type' => 'select', 'icon' => array(-1 => 'arrow_down.png', 1 => 'arrow_up.png'), 'orderby' => false), - 'name' => array('title' => $this->l('Name'), 'width' => 500)); - - $reasons_inc = StockMvtReason::getStockMvtReasons($this->context->language->id, 1); - $reasons_dec = StockMvtReason::getStockMvtReasons($this->context->language->id, -1); - - $this->optionsList = array( - 'general' => array( - 'title' => $this->l('Options'), - 'fields' => array( - 'PS_STOCK_MVT_INC_REASON_DEFAULT' => array( - 'title' => $this->l('Default Stock Movement reason for increment stock:'), - 'cast' => 'intval', - 'type' => 'select', - 'list' => $reasons_inc, - 'identifier' => 'id_stock_mvt_reason' - ), - 'PS_STOCK_MVT_DEC_REASON_DEFAULT' => array( - 'title' => $this->l('Default Stock Movement reason for decrement stock:'), - 'cast' => 'intval', - 'type' => 'select', - 'list' => $reasons_dec, - 'identifier' => 'id_stock_mvt_reason' - ), - ), - ), - ); - unset($this->_select, $this->_join, $this->_group, $this->_filterHaving, $this->_filter); - - echo '

'.$this->l('Stock movement reason').'

'; - $this->postProcess(); - return parent::display(); - } -} - - diff --git a/admin-dev/themes/template/list_action_addstock.tpl b/admin-dev/themes/template/list_action_addstock.tpl new file mode 100644 index 000000000..945bf23ee --- /dev/null +++ b/admin-dev/themes/template/list_action_addstock.tpl @@ -0,0 +1,27 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 9197 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{$action} \ No newline at end of file diff --git a/admin-dev/themes/template/list_action_details.tpl b/admin-dev/themes/template/list_action_details.tpl index 1f0674d3e..86801f5d8 100644 --- a/admin-dev/themes/template/list_action_details.tpl +++ b/admin-dev/themes/template/list_action_details.tpl @@ -41,7 +41,7 @@ $(document).ready(function() { context: this, async: false, success: function(data) { - if(typeof(data.use_parent_structure) == 'undefined' || data.use_parent_structure) + if(typeof(data.use_parent_structure) == 'undefined' || (data.use_parent_structure == true)) $.each(data.data, function(it, row) { if($('#details_{$id}').parent().parent().hasClass('alt_row')) @@ -65,7 +65,7 @@ $(document).ready(function() { var content = $(''); else var content = $(''); - content.append($(''+data+'').attr('colspan', $('#details_{$id}').parent().parent().find('td').length)); + content.append($(''+data.data+'').attr('colspan', $('#details_{$id}').parent().parent().find('td').length)); $('#details_{$id}').parent().parent().after(content); } this.dataMaped = true; diff --git a/admin-dev/themes/template/list_action_removestock.tpl b/admin-dev/themes/template/list_action_removestock.tpl new file mode 100644 index 000000000..551cab4c9 --- /dev/null +++ b/admin-dev/themes/template/list_action_removestock.tpl @@ -0,0 +1,27 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 9197 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{$action} \ No newline at end of file diff --git a/admin-dev/themes/template/list_action_transferstock.tpl b/admin-dev/themes/template/list_action_transferstock.tpl new file mode 100644 index 000000000..0703b3eb8 --- /dev/null +++ b/admin-dev/themes/template/list_action_transferstock.tpl @@ -0,0 +1,27 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 9197 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{$action} \ No newline at end of file diff --git a/admin-dev/themes/template/list_content.tpl b/admin-dev/themes/template/list_content.tpl index a1c13c5b3..84d43041c 100644 --- a/admin-dev/themes/template/list_content.tpl +++ b/admin-dev/themes/template/list_content.tpl @@ -31,7 +31,7 @@ {if isset($tr.color) && $color_on_bg}style="background-color: {$tr.color}"{/if} > - {if $bulk_actions AND isset($listSkipDelete) AND !in_array($tr.$identifier, $listSkipDelete)} + {if $bulk_actions AND array_key_exists('delete', $list_skip_actions) AND !in_array($tr.$identifier, $list_skip_actions['delete'])} {/if} diff --git a/admin-dev/themes/template/list_footer.tpl b/admin-dev/themes/template/list_footer.tpl index 4629b0399..90b82c8a2 100644 --- a/admin-dev/themes/template/list_footer.tpl +++ b/admin-dev/themes/template/list_footer.tpl @@ -1,5 +1,5 @@ {* -* 2007-2011 PrestaShop +* 2007-2011 PrestaShop * * NOTICE OF LICENSE * @@ -35,8 +35,10 @@ +{if !$simple_header} +{/if} {* if (isset($this->_includeTab) AND sizeof($this->_includeTab)) echo '

'; diff --git a/admin-dev/themes/template/list_header.tpl b/admin-dev/themes/template/list_header.tpl index 01a462276..fcc794234 100644 --- a/admin-dev/themes/template/list_header.tpl +++ b/admin-dev/themes/template/list_header.tpl @@ -24,7 +24,10 @@ * International Registered Trademark & Property of PrestaShop SA *} +{if !$simple_header} + +