136 lines
4.7 KiB
PHP
136 lines
4.7 KiB
PHP
<?php
|
|
/**
|
|
* 2007-2017 Decanet
|
|
*
|
|
* 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.decanet.fr for more information.
|
|
*
|
|
* @author Decanet SA <contact@decanet.fr>
|
|
* @copyright 2007-2017 Decanet SA
|
|
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
|
* International Registered Trademark & Property of PrestaShop SA
|
|
*/
|
|
|
|
class HTMLTemplatePrelevementSepaPdf extends HTMLTemplate
|
|
{
|
|
public $custom_model;
|
|
public function __construct($custom_object, $smarty)
|
|
{
|
|
$this->custom_model = $custom_object;
|
|
$this->smarty = $smarty;
|
|
// header informations
|
|
//$id_lang = Context::getContext()->language->id;
|
|
$this->title = HTMLTemplatePrelevementSepaPdf::l('Mandat SEPA a imprimer et nous retourner');
|
|
// footer informations
|
|
$this->shop = new Shop(Context::getContext()->shop->id);
|
|
}
|
|
|
|
/**
|
|
* Returns the template's HTML content
|
|
* @return string HTML content
|
|
*/
|
|
public function getContent()
|
|
{
|
|
$this->smarty->assign(array(
|
|
'custom_model' => $this->custom_model,
|
|
'shop_name' => $this->shop->name,
|
|
));
|
|
return $this->custom_model->html;
|
|
}
|
|
|
|
/**
|
|
* Returns the template's HTML header
|
|
*
|
|
* @return string HTML header
|
|
*/
|
|
public function getHeader()
|
|
{
|
|
$prel_obj = new PrelevementSEPA();
|
|
$this->assignCommonHeaderData();
|
|
$this->smarty->assign(array(
|
|
'conf' => $prel_obj->conf_keys,
|
|
'sepa' => $this->custom_model
|
|
));
|
|
|
|
$template = $prel_obj->getLocalPath().'views/templates/front/'.$prel_obj->conf_keys['template'].'.header.tpl';
|
|
if (!file_exists($template)) {
|
|
$template = $prel_obj->getLocalPath().'views/templates/front/mandate.header.tpl';
|
|
}
|
|
if (file_exists(_PS_THEME_DIR_.'modules/'.$prel_obj->name.'/views/templates/front/'.
|
|
$prel_obj->conf_keys['template'].'.header.tpl')) {
|
|
$template = _PS_THEME_DIR_.'modules/'.$prel_obj->name.'/views/templates/front/'.
|
|
$prel_obj->conf_keys['template'].'.header.tpl';
|
|
}
|
|
return $this->smarty->fetch($template);
|
|
}
|
|
|
|
public function getFooter()
|
|
{
|
|
$prel_obj = new PrelevementSEPA();
|
|
$shop_address = $this->getShopAddress();
|
|
$id_shop = (int)$this->shop->id;
|
|
$this->smarty->assign(
|
|
array(
|
|
'conf' => $prel_obj->conf_keys,
|
|
'shop_address' => $shop_address,
|
|
'shop_fax' => Configuration::get('PS_SHOP_FAX', null, null, $id_shop),
|
|
'shop_phone' => Configuration::get('PS_SHOP_PHONE', null, null, $id_shop),
|
|
'shop_email' => Configuration::get('PS_SHOP_EMAIL', null, null, $id_shop),
|
|
'free_text' => Configuration::get(
|
|
'PS_INVOICE_FREE_TEXT',
|
|
(int)Context::getContext()->language->id,
|
|
null,
|
|
$id_shop
|
|
)
|
|
)
|
|
);
|
|
|
|
$template = $prel_obj->getLocalPath().'views/templates/front/'.$prel_obj->conf_keys['template'].'.footer.tpl';
|
|
if (!file_exists($template)) {
|
|
$template = $prel_obj->getLocalPath().'views/templates/front/mandate.footer.tpl';
|
|
}
|
|
if (file_exists(_PS_THEME_DIR_.'modules/'.$prel_obj->name.'/views/templates/front/'.
|
|
$prel_obj->conf_keys['template'].'.footer.tpl')) {
|
|
$template = _PS_THEME_DIR_.'modules/'.$prel_obj->name.'/views/templates/front/'.
|
|
$prel_obj->conf_keys['template'].'.footer.tpl';
|
|
}
|
|
return $this->smarty->fetch($template);
|
|
}
|
|
|
|
public function getPagination()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* Returns the template filename
|
|
* @return string filename
|
|
*/
|
|
public function getFilename()
|
|
{
|
|
return 'sepa-'.$this->custom_model->rum.'.pdf';
|
|
}
|
|
|
|
/**
|
|
* Returns the template filename when using bulk rendering
|
|
* @return string filename
|
|
*/
|
|
public function getBulkFilename()
|
|
{
|
|
return 'sepa-'.$this->custom_model->rum.'.pdf';
|
|
}
|
|
}
|