';
}
private function _postValidation()
{
if (Tools::getValue('EMC_WIDTH') == 0)
$this->_postErrors[] = $this->l('Width not specified');
if (Tools::getValue('EMC_HEIGHT') == 0)
$this->_postErrors[] = $this->l('Height not specified');
if (Tools::getValue('EMC_DEPTH') == 0)
$this->_postErrors[] = $this->l('Depth not specified');
if (Tools::getValue('EMC_ORDER_STATE') == 0)
$this->_postErrors[] = $this->l('Order state not specified');
if (Tools::getValue('EMC_CARRIER') == 0)
$this->_postErrors[] = $this->l('Carrier not specified');
if (Tools::getValue('EMC_ORDER_PAST_STATE') == 0)
$this->_postErrors[] = $this->l('Order state "order past" not specified');
if (Tools::getValue('EMC_SEND_STATE') == 0)
$this->_postErrors[] = $this->l('Order state send not specified');
if (Tools::getValue('EMC_DELIVERY_STATE') == 0)
$this->_postErrors[] = $this->l('Order state delivery not specified');
if (Tools::getValue('EMC_LAST_NAME') == '')
$this->_postErrors[] = $this->l('Last name not specified');
if (Tools::getValue('EMC_FIRST_NAME') == '')
$this->_postErrors[] = $this->l('First name not specified');
if (Tools::getValue('EMC_ADDRESS') == '')
$this->_postErrors[] = $this->l('Address not specified');
if (Tools::getValue('EMC_ZIP_CODE') == '')
$this->_postErrors[] = $this->l('Zip Code not specified');
if (Tools::getValue('EMC_CITY') == '')
$this->_postErrors[] = $this->l('City not specified');
if (Tools::getValue('EMC_COUNTRY') == '')
$this->_postErrors[] = $this->l('Country not specified');
if (Tools::getValue('EMC_PHONE') == '')
$this->_postErrors[] = $this->l('Phone not specified');
if (Tools::getValue('EMC_EMAIL') == '')
$this->_postErrors[] = $this->l('E-mail not specified');
if (Tools::getValue('EMC_LOGIN') == '')
$this->_postErrors[] = $this->l('Login not specified');
}
private function _postProcess()
{
if (Configuration::updateValue('EMC_WIDTH', (int)(Tools::getValue('EMC_WIDTH'))) AND Configuration::updateValue('EMC_HEIGHT', (int)(Tools::getValue('EMC_HEIGHT'))) AND
Configuration::updateValue('EMC_DEPTH', (int)(Tools::getValue('EMC_DEPTH'))) AND Configuration::updateValue('EMC_ORDER_STATE', (int)(Tools::getValue('EMC_ORDER_STATE'))) AND
Configuration::updateValue('EMC_CARRIER', (int)(Tools::getValue('EMC_CARRIER'))) AND Configuration::updateValue('EMC_PACKAGING_DEFAULT', Tools::getValue('EMC_PACKAGING_DEFAULT'))
AND Configuration::updateValue('EMC_GENDER', Tools::getValue('EMC_GENDER')) AND Configuration::updateValue('EMC_LAST_NAME', Tools::getValue('EMC_LAST_NAME'))
AND Configuration::updateValue('EMC_FIRST_NAME', Tools::getValue('EMC_FIRST_NAME')) AND Configuration::updateValue('EMC_ADDRESS', Tools::getValue('EMC_ADDRESS'))
AND Configuration::updateValue('EMC_ZIP_CODE', Tools::getValue('EMC_ZIP_CODE')) AND Configuration::updateValue('EMC_CITY', Tools::getValue('EMC_CITY'))
AND Configuration::updateValue('EMC_COUNTRY', Tools::getValue('EMC_COUNTRY')) AND Configuration::updateValue('EMC_PHONE', Tools::getValue('EMC_PHONE'))
AND Configuration::updateValue('EMC_EMAIL', Tools::getValue('EMC_EMAIL')) AND Configuration::updateValue('EMC_ORDER_PAST_STATE', Tools::getValue('EMC_ORDER_PAST_STATE'))
AND Configuration::updateValue('EMC_SEND_STATE', Tools::getValue('EMC_SEND_STATE')) AND Configuration::updateValue('EMC_EMAILS', Tools::getValue('EMC_EMAILS'))
AND Configuration::updateValue('EMC_LOGIN', Tools::getValue('EMC_LOGIN')) AND Configuration::updateValue('EMC_CONTENT', Tools::getValue('type_objet_'))
AND Configuration::updateValue('EMC_DELIVERY_STATE', Tools::getValue('EMC_DELIVERY_STATE')))
{
$dataSync = (($emc_login = Configuration::get('EMC_LOGIN'))
? '' : '');
$this->_html .= $this->displayConfirmation($this->l('Configuration updated').$dataSync);
}
else
$this->_html .= '
'.$this->l('Settings failed').'
';
}
static function selectNature($selected = '', $id = '')
{
$select = '';
return $select;
}
public function hookAdminOrder($params)
{
$order = new Order($params['id_order']);
if ($order->id_carrier == Configuration::get('EMC_CARRIER'))
{
$return = Db::getInstance()->ExecuteS('SELECT * FROM '._DB_PREFIX_.'envoimoinscher WHERE id_order = \''.(int)($order->id).'\' LIMIT 1');
if (isset($return[0]['shipping_number']))
{
$html = '
';
return $html;
}
}
}
public function lang($str)
{
switch($str)
{
case 'No order to export':
return $this->l('No order to export');
break;
case 'Please configure this module in order':
return $this->l('Please configure this module in order');
break;
case 'Change configuration':
return $this->l('Change configuration');
break;
case 'ID':
return $this->l('ID');
break;
case 'Name':
return $this->l('Name');
break;
case 'Total Cost':
return $this->l('Total Cost');
break;
case 'Total shipment':
return $this->l('Total shipment');
break;
case 'Date':
return $this->l('Date');
break;
case 'Packaging':
return $this->l('Packaging');
break;
case 'Nature of contents':
return $this->l('Nature of contents');
break;
case 'Detail':
return $this->l('Detail');
break;
case 'View':
return $this->l('View');
break;
case 'Send':
return $this->l('Send');
break;
case 'List of orders to export':
return $this->l('List of orders to export');
break;
}
}
}