* @copyright 2007-2011 PrestaShop SA * @version Release: $Revision: 6684 $ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ class AdminSuppliers extends AdminTab { protected $maxImageSize = 200000; public function __construct() { $this->table = 'supplier'; $this->className = 'Supplier'; $this->view = true; $this->edit = true; $this->delete = true; $this->_select = 'COUNT(p.`id_product`) AS products'; $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'product` p ON (a.`id_supplier` = p.`id_supplier`)'; $this->_group = 'GROUP BY a.`id_supplier`'; $this->fieldImageSettings = array('name' => 'logo', 'dir' => 'su'); $this->fieldsDisplay = array( 'id_supplier' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'name' => array('title' => $this->l('Name'), 'width' => 120), 'logo' => array('title' => $this->l('Logo'), 'align' => 'center', 'image' => 'su', 'orderby' => false, 'search' => false), 'products' => array('title' => $this->l('Number of products'), 'align' => 'right', 'filter_type' => 'int', 'tmpTableFilter' => true), 'active' => array('title' => $this->l('Enabled'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false) ); parent::__construct(); } public function viewsupplier() { global $cookie; if (!($supplier = $this->loadObject())) return; echo '
'.$product->name.' | '.(!empty($product->reference) ? ''.$this->l('Ref:').' '.$product->reference.' | ' : '').' '.(!empty($product->ean13) ? ''.$this->l('EAN13:').' '.$product->ean13.' | ' : '').' '.(!empty($product->upc) ? ''.$this->l('UPC:').' '.$product->upc.' | ' : '').' '.(Configuration::get('PS_STOCK_MANAGEMENT') ? ''.$this->l('Qty:').' '.$product->quantity.' | ' : '').'
---|
'.$this->l('Attribute name').' | '.$this->l('Reference').' | '.$this->l('EAN13').' | '.$this->l('UPC').' | '.(Configuration::get('PS_STOCK_MANAGEMENT') ? ''.$this->l('Quantity').' | ' : '').'
---|---|---|---|---|
'.stripslashes($list).' | '.$product_attribute['reference'].' | '.(Configuration::get('PS_STOCK_MANAGEMENT') ? ''.$product_attribute['ean13'].' | '.$product_attribute['upc'].' | ' : '').''.$product_attribute['quantity'].' |