name = 'privatesale_mail_delay';
$this->tab = 'administration';
$this->version = '1.0';
parent::__construct();
$this->displayName = $this->l('Mail retard vente privée');
$this->description = $this->l('Envoie un mail pour prévenir du retard de livraison d\'une VP');
}
public function install() {
if(!parent::install() ) {
return FALSE;
}
return TRUE;
}
public function getContent(){
if(Tools::isSubmit('saveConfiguration')){
$montant = Tools::getValue('remise_ps_delay');
if( !Validate::isInt($montant) ) {
$this->_html .= "
Le montant de la remise doit être un nombre
";
}else{
Configuration::updateValue(self::DATA_REMISE, $montant);
$this->_html .= "Montant mis à jour
";
}
Configuration::updateValue(self::DATA_DESC, Tools::getValue('remise_description'));
$this->_html .= "Description mis à jour
";
Configuration::updateValue(self::DATA_MAIL, Tools::getValue('mail_ps_delay'), true);
$this->_html .= "Mail mis à jour
";
}
$this->_html .= self::displayForm();
echo $this->_html;
}
public static function displayForm(){
$mail_delay_sql = 'SELECT value FROM ps_configuration WHERE name = "'. self::DATA_MAIL.'"';
$mail_delay = DB::getInstance()->getValue($mail_delay_sql);
$data .= 'Alerte mail retard de livraison
';
// TinyMCE
global $cookie;
$iso = Language::getIsoById((int)($cookie->id_lang));
$isoTinyMCE = (file_exists(_PS_ROOT_DIR_.'/js/tiny_mce/langs/'.$iso.'.js') ? $iso : 'en');
$ad = dirname($_SERVER["PHP_SELF"]);
$data .= '
';
return $data;
}
}