[-] MO : fixed bug #PSCFV-3148 - now referalprogram use module controller

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16740 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
vAugagneur
2012-08-07 12:17:53 +00:00
parent 284a9acae6
commit 1cf5ddd038
13 changed files with 349 additions and 300 deletions
+73
View File
@@ -0,0 +1,73 @@
<?php
/*
* 2007-2012 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 <contact@prestashop.com>
* @copyright 2007-2012 PrestaShop SA
* @version Release: $Revision: 13573 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
/**
* @since 1.5.0
*/
class ReferralprogramEmailModuleFrontController extends ModuleFrontController
{
public $content_only = true;
public $display_header = false;
public $display_footer = false;
/**
* @see FrontController::initContent()
*/
public function initContent()
{
parent::initContent();
$shop_name = htmlentities(Configuration::get('PS_SHOP_NAME'), NULL, 'utf-8');
$shop_url = Tools::getHttpHost(true, true);
$customer = Context::getContext()->customer;
if (!preg_match("#.*\.html$#Ui", Tools::getValue('mail')) OR !preg_match("#.*\.html$#Ui", Tools::getValue('mail')))
die(Tools::redirect());
$file = file_get_contents(dirname(__FILE__).'/../../mails/'.strval(preg_replace('#\.{2,}#', '.', Tools::getValue('mail'))));
$file = str_replace('{shop_name}', $shop_name, $file);
$file = str_replace('{shop_url}', $shop_url.__PS_BASE_URI__, $file);
$file = str_replace('{shop_logo}', $shop_url._PS_IMG_.'logo.jpg', $file);
$file = str_replace('{firstname}', $customer->firstname, $file);
$file = str_replace('{lastname}', $customer->lastname, $file);
$file = str_replace('{email}', $customer->email, $file);
$file = str_replace('{firstname_friend}', 'XXXXX', $file);
$file = str_replace('{lastname_friend}', 'xxxxxx', $file);
$file = str_replace('{link}', 'authentication.php?create_account=1', $file);
$discount_type = (int)(Configuration::get('REFERRAL_DISCOUNT_TYPE'));
if ($discount_type == 1)
$file = str_replace('{discount}', Discount::display((float)(Configuration::get('REFERRAL_PERCENTAGE')), $discount_type, new Currency($this->context->currency->id)), $file);
else
$file = str_replace('{discount}', Discount::display((float)(Configuration::get('REFERRAL_DISCOUNT_VALUE_' . $this->context->currency->id)), $discount_type, new Currency($this->context->currency->id)), $file);
$this->context->smarty->assign(array('content' => $file));
$this->setTemplate('email.tpl');
}
}
+206
View File
@@ -0,0 +1,206 @@
<?php
/*
* 2007-2012 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 <contact@prestashop.com>
* @copyright 2007-2012 PrestaShop SA
* @version Release: $Revision: 13573 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
/**
* @since 1.5.0
*/
include_once(dirname(__FILE__).'../../../ReferralProgramModule.php');
include_once(dirname(__FILE__).'../../../referralprogram.php');
class ReferralprogramProgramModuleFrontController extends ModuleFrontController
{
public function init()
{
if (!$this->context->customer->isLogged())
Tools::redirect('index.php?controller=authentication&back=modules/referralprogram/referralprogram-program.php');
parent::init();
}
public function setMedia()
{
parent::setMedia();
$this->addJqueryPlugin(array('thickbox', 'idTabs'));
}
/**
* @see FrontController::initContent()
*/
public function initContent()
{
parent::initContent();
// get discount value (ready to display)
$discount_type = (int)(Configuration::get('REFERRAL_DISCOUNT_TYPE'));
if ($discount_type == 1)
$discount = Discount::display((float)(Configuration::get('REFERRAL_PERCENTAGE')), $discount_type, new Currency($this->context->currency->id));
else
$discount = Discount::display((float)(Configuration::get('REFERRAL_DISCOUNT_VALUE_'.(int)($this->context->currency->id))), $discount_type, new Currency($this->context->currency->id));
$activeTab = 'sponsor';
$error = false;
// Mailing invitation to friend sponsor
$invitation_sent = false;
$nbInvitation = 0;
if (Tools::isSubmit('submitSponsorFriends') AND Tools::getValue('friendsEmail') AND sizeof($friendsEmail = Tools::getValue('friendsEmail')) >= 1)
{
$activeTab = 'sponsor';
if (!Tools::getValue('conditionsValided'))
$error = 'conditions not valided';
else
{
$friendsLastName = Tools::getValue('friendsLastName');
$friendsFirstName = Tools::getValue('friendsFirstName');
$mails_exists = array();
foreach ($friendsEmail AS $key => $friendEmail)
{
$friendEmail = strval($friendEmail);
$friendLastName = strval($friendsLastName[$key]);
$friendFirstName = strval($friendsFirstName[$key]);
if (empty($friendEmail) AND empty($friendLastName) AND empty($friendFirstName))
continue;
elseif (empty($friendEmail) OR !Validate::isEmail($friendEmail))
$error = 'email invalid';
elseif (empty($friendFirstName) OR empty($friendLastName) OR !Validate::isName($friendLastName) OR !Validate::isName($friendFirstName))
$error = 'name invalid';
elseif (ReferralProgramModule::isEmailExists($friendEmail) OR Customer::customerExists($friendEmail))
$mails_exists[] = $friendEmail;
else
{
$referralprogram = new ReferralProgramModule();
$referralprogram->id_sponsor = (int)($this->context->customer->id);
$referralprogram->firstname = $friendFirstName;
$referralprogram->lastname = $friendLastName;
$referralprogram->email = $friendEmail;
if (!$referralprogram->validateFields(false))
$error = 'name invalid';
else
{
if ($referralprogram->save())
{
if (Configuration::get('PS_CIPHER_ALGORITHM'))
$cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_);
else
$cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_);
$vars = array(
'{email}' => strval($this->context->customer->email),
'{lastname}' => strval($this->context->customer->lastname),
'{firstname}' => strval($this->context->customer->firstname),
'{email_friend}' => $friendEmail,
'{lastname_friend}' => $friendLastName,
'{firstname_friend}' => $friendFirstName,
'{link}' => 'authentication.php?create_account=1&sponsor='.urlencode($cipherTool->encrypt($referralprogram->id.'|'.$referralprogram->email.'|')),
'{discount}' => $discount);
Mail::Send((int)$this->context->language->id, 'referralprogram-invitation', Mail::l('Referral Program', (int)$this->context->language->id), $vars, $friendEmail, $friendFirstName.' '.$friendLastName, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/../../mails/');
$invitation_sent = true;
$nbInvitation++;
$activeTab = 'pending';
}
else
$error = 'cannot add friends';
}
}
if ($error)
break;
}
if ($nbInvitation > 0)
unset($_POST);
//Not to stop the sending of e-mails in case of doubloon
if(sizeof($mails_exists))
$error = 'email exists';
}
}
// Mailing revive
$revive_sent = false;
$nbRevive = 0;
if (Tools::isSubmit('revive'))
{
$activeTab = 'pending';
if (Tools::getValue('friendChecked') AND sizeof($friendsChecked = Tools::getValue('friendChecked')) >= 1)
{
foreach ($friendsChecked as $key => $friendChecked)
{
if (ReferralProgramModule::isSponsorFriend((int)($this->context->customer->id), (int)($friendChecked)))
{
if (Configuration::get('PS_CIPHER_ALGORITHM'))
$cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_);
else
$cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_);
$referralprogram = new ReferralProgramModule((int)($key));
$vars = array(
'{email}' => $this->context->customer->email,
'{lastname}' => $this->context->customer->lastname,
'{firstname}' => $this->context->customer->firstname,
'{email_friend}' => $referralprogram->email,
'{lastname_friend}' => $referralprogram->lastname,
'{firstname_friend}' => $referralprogram->firstname,
'{link}' => 'authentication.php?create_account=1&sponsor='.urlencode($cipherTool->encrypt($referralprogram->id.'|'.$referralprogram->email.'|')),
'{discount}' => $discount
);
$referralprogram->save();
Mail::Send((int)$this->context->language->id, 'referralprogram-invitation', Mail::l('Referral Program', (int)$this->context->language->id), $vars, $referralprogram->email, $referralprogram->firstname.' '.$referralprogram->lastname, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/../../mails/');
$revive_sent = true;
$nbRevive++;
}
}
}
else
$error = 'no revive checked';
}
$customer = new Customer((int)($this->context->customer->id));
$stats = $customer->getStats();
$orderQuantity = (int)(Configuration::get('REFERRAL_ORDER_QUANTITY'));
$canSendInvitations = false;
if ((int)($stats['nb_orders']) >= $orderQuantity)
$canSendInvitations = true;
// Smarty display
$this->context->smarty->assign(array(
'activeTab' => $activeTab,
'discount' => $discount,
'orderQuantity' => $orderQuantity,
'canSendInvitations' => $canSendInvitations,
'nbFriends' => (int)(Configuration::get('REFERRAL_NB_FRIENDS')),
'error' => $error,
'invitation_sent' => $invitation_sent,
'nbInvitation' => $nbInvitation,
'pendingFriends' => ReferralProgramModule::getSponsorFriend((int)($this->context->customer->id), 'pending'),
'revive_sent' => $revive_sent,
'nbRevive' => $nbRevive,
'subscribeFriends' => ReferralProgramModule::getSponsorFriend((int)($this->context->customer->id), 'subscribed'),
'mails_exists' => (isset($mails_exists) ? $mails_exists : array())
));
$this->setTemplate('program.tpl');
}
}
@@ -20,35 +20,39 @@
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2012 PrestaShop SA
* @version Release: $Revision: 6844 $
* @version Release: $Revision: 13573 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
require_once(dirname(__FILE__).'/../../config/config.inc.php');
require_once(dirname(__FILE__).'/../../init.php');
include_once(dirname(__FILE__).'/referralprogram.php');
if (!Tools::getValue('width') AND !Tools::getValue('height'))
require_once(dirname(__FILE__).'/../../header.php');
$xmlFile = _PS_MODULE_DIR_.'referralprogram/referralprogram.xml';
if (file_exists($xmlFile))
/**
* @since 1.5.0
*/
class ReferralprogramRulesModuleFrontController extends ModuleFrontController
{
if ($xml = @simplexml_load_file($xmlFile))
public $content_only = true;
public $display_header = false;
public $display_footer = false;
/**
* @see FrontController::initContent()
*/
public function initContent()
{
$smarty->assign(array(
'xml' => $xml,
'paragraph' => 'paragraph_'.$cookie->id_lang
));
parent::initContent();
$xmlFile = _PS_MODULE_DIR_.'referralprogram/referralprogram.xml';
if (file_exists($xmlFile))
{
if ($xml = @simplexml_load_file($xmlFile))
{
$this->context->smarty->assign(array(
'xml' => $xml,
'paragraph' => 'paragraph_'.$this->context->language->id
));
}
}
$this->setTemplate('rules.tpl');
}
}
$referralprogram = new ReferralProgram();
echo $referralprogram->display(dirname(__FILE__).'/referralprogram', 'referralprogram-rules.tpl');
if (!Tools::getValue('width') AND !Tools::getValue('height'))
require_once(dirname(__FILE__).'/../../footer.php');
}
-60
View File
@@ -1,60 +0,0 @@
<?php
/*
* 2007-2012 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 <contact@prestashop.com>
* @copyright 2007-2012 PrestaShop SA
* @version Release: $Revision: 6844 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
require_once('../../config/config.inc.php');
require_once('../../init.php');
$shop_name = htmlentities(Configuration::get('PS_SHOP_NAME'), NULL, 'utf-8');
$shop_url = Tools::getHttpHost(true, true);
$customer = Context::getContext()->customer;
if (!preg_match("#.*\.html$#Ui", Tools::getValue('mail')) OR !preg_match("#.*\.html$#Ui", Tools::getValue('mail')))
die(Tools::displayError());
$file = file_get_contents(dirname(__FILE__).'/mails/'.strval(preg_replace('#\.{2,}#', '.', Tools::getValue('mail'))));
$file = str_replace('{shop_name}', $shop_name, $file);
$file = str_replace('{shop_url}', $shop_url.__PS_BASE_URI__, $file);
$file = str_replace('{shop_logo}', $shop_url._PS_IMG_.'logo.jpg', $file);
$file = str_replace('{firstname}', $customer->firstname, $file);
$file = str_replace('{lastname}', $customer->lastname, $file);
$file = str_replace('{email}', $customer->email, $file);
$file = str_replace('{firstname_friend}', 'XXXXX', $file);
$file = str_replace('{lastname_friend}', 'xxxxxx', $file);
$file = str_replace('{link}', 'authentication.php?create_account=1', $file);
$discount_type = (int)(Configuration::get('REFERRAL_DISCOUNT_TYPE'));
if ($discount_type == 1)
{
$file = str_replace('{discount}', Discount::display((float)(Configuration::get('REFERRAL_PERCENTAGE')), $discount_type, new Currency($cookie->id_currency)), $file);
}
else
{
$file = str_replace('{discount}', Discount::display((float)(Configuration::get('REFERRAL_DISCOUNT_VALUE_' . $cookie->id_currency)), $discount_type, new Currency($cookie->id_currency)), $file);
}
echo $file;
@@ -1,201 +0,0 @@
<?php
/*
* 2007-2012 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 <contact@prestashop.com>
* @copyright 2007-2012 PrestaShop SA
* @version Release: $Revision: 7310 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
/* SSL Management */
$useSSL = true;
require_once(dirname(__FILE__).'/../../config/config.inc.php');
require_once(dirname(__FILE__).'/../../init.php');
include_once(dirname(__FILE__).'/ReferralProgramModule.php');
include_once(dirname(__FILE__).'/referralprogram.php');
$context = Context::getContext();
if (!$context->customer->isLogged())
Tools::redirect('index.php?controller=authentication&back=modules/referralprogram/referralprogram-program.php');
$context->controller->addJqueryPlugin(array('thickbox', 'idTabs'));
include(dirname(__FILE__).'/../../header.php');
// get discount value (ready to display)
$discount_type = (int)(Configuration::get('REFERRAL_DISCOUNT_TYPE'));
if ($discount_type == 1)
{
$discount = Discount::display((float)(Configuration::get('REFERRAL_PERCENTAGE')), $discount_type, new Currency($cookie->id_currency));
}
else
{
$discount = Discount::display((float)(Configuration::get('REFERRAL_DISCOUNT_VALUE_'.(int)($cookie->id_currency))), $discount_type, new Currency($cookie->id_currency));
}
$activeTab = 'sponsor';
$error = false;
// Mailing invitation to friend sponsor
$invitation_sent = false;
$nbInvitation = 0;
if (Tools::isSubmit('submitSponsorFriends') AND Tools::getValue('friendsEmail') AND sizeof($friendsEmail = Tools::getValue('friendsEmail')) >= 1)
{
$activeTab = 'sponsor';
if (!Tools::getValue('conditionsValided'))
$error = 'conditions not valided';
else
{
$friendsLastName = Tools::getValue('friendsLastName');
$friendsFirstName = Tools::getValue('friendsFirstName');
$mails_exists = array();
foreach ($friendsEmail AS $key => $friendEmail)
{
$friendEmail = strval($friendEmail);
$friendLastName = strval($friendsLastName[$key]);
$friendFirstName = strval($friendsFirstName[$key]);
if (empty($friendEmail) AND empty($friendLastName) AND empty($friendFirstName))
continue;
elseif (empty($friendEmail) OR !Validate::isEmail($friendEmail))
$error = 'email invalid';
elseif (empty($friendFirstName) OR empty($friendLastName) OR !Validate::isName($friendLastName) OR !Validate::isName($friendFirstName))
$error = 'name invalid';
elseif (ReferralProgramModule::isEmailExists($friendEmail) OR Customer::customerExists($friendEmail))
{
$mails_exists[] = $friendEmail;
}
else
{
$referralprogram = new ReferralProgramModule();
$referralprogram->id_sponsor = (int)($cookie->id_customer);
$referralprogram->firstname = $friendFirstName;
$referralprogram->lastname = $friendLastName;
$referralprogram->email = $friendEmail;
if (!$referralprogram->validateFields(false))
$error = 'name invalid';
else
{
if ($referralprogram->save())
{
if (Configuration::get('PS_CIPHER_ALGORITHM'))
$cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_);
else
$cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_);
$vars = array(
'{email}' => strval($cookie->email),
'{lastname}' => strval($cookie->customer_lastname),
'{firstname}' => strval($cookie->customer_firstname),
'{email_friend}' => $friendEmail,
'{lastname_friend}' => $friendLastName,
'{firstname_friend}' => $friendFirstName,
'{link}' => 'authentication.php?create_account=1&sponsor='.urlencode($cipherTool->encrypt($referralprogram->id.'|'.$referralprogram->email.'|')),
'{discount}' => $discount);
Mail::Send((int)$cookie->id_lang, 'referralprogram-invitation', Mail::l('Referral Program', (int)$cookie->id_lang), $vars, $friendEmail, $friendFirstName.' '.$friendLastName, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/');
$invitation_sent = true;
$nbInvitation++;
$activeTab = 'pending';
}
else
$error = 'cannot add friends';
}
}
if ($error)
break;
}
if ($nbInvitation > 0)
unset($_POST);
//Not to stop the sending of e-mails in case of doubloon
if(sizeof($mails_exists))
$error = 'email exists';
}
}
// Mailing revive
$revive_sent = false;
$nbRevive = 0;
if (Tools::isSubmit('revive'))
{
$activeTab = 'pending';
if (Tools::getValue('friendChecked') AND sizeof($friendsChecked = Tools::getValue('friendChecked')) >= 1)
{
foreach ($friendsChecked as $key => $friendChecked)
{
if (ReferralProgramModule::isSponsorFriend((int)($cookie->id_customer), (int)($friendChecked)))
{
if (Configuration::get('PS_CIPHER_ALGORITHM'))
$cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_);
else
$cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_);
$referralprogram = new ReferralProgramModule((int)($key));
$vars = array(
'{email}' => $cookie->email,
'{lastname}' => $cookie->customer_lastname,
'{firstname}' => $cookie->customer_firstname,
'{email_friend}' => $referralprogram->email,
'{lastname_friend}' => $referralprogram->lastname,
'{firstname_friend}' => $referralprogram->firstname,
'{link}' => 'authentication.php?create_account=1&sponsor='.urlencode($cipherTool->encrypt($referralprogram->id.'|'.$referralprogram->email.'|')),
'{discount}' => $discount
);
$referralprogram->save();
Mail::Send((int)$cookie->id_lang, 'referralprogram-invitation', Mail::l('Referral Program', (int)$cookie->id_lang), $vars, $referralprogram->email, $referralprogram->firstname.' '.$referralprogram->lastname, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/');
$revive_sent = true;
$nbRevive++;
}
}
}
else
$error = 'no revive checked';
}
$customer = new Customer((int)($cookie->id_customer));
$stats = $customer->getStats();
$orderQuantity = (int)(Configuration::get('REFERRAL_ORDER_QUANTITY'));
$canSendInvitations = false;
if ((int)($stats['nb_orders']) >= $orderQuantity)
$canSendInvitations = true;
// Smarty display
$smarty->assign(array(
'activeTab' => $activeTab,
'discount' => $discount,
'orderQuantity' => $orderQuantity,
'canSendInvitations' => $canSendInvitations,
'nbFriends' => (int)(Configuration::get('REFERRAL_NB_FRIENDS')),
'error' => $error,
'invitation_sent' => $invitation_sent,
'nbInvitation' => $nbInvitation,
'pendingFriends' => ReferralProgramModule::getSponsorFriend((int)($cookie->id_customer), 'pending'),
'revive_sent' => $revive_sent,
'nbRevive' => $nbRevive,
'subscribeFriends' => ReferralProgramModule::getSponsorFriend((int)($cookie->id_customer), 'subscribed'),
'mails_exists' => (isset($mails_exists) ? $mails_exists : array())
));
$referralprogram = new ReferralProgram();
echo $referralprogram->display(dirname(__FILE__).'/referralprogram.php', 'referralprogram-program.tpl');
include(dirname(__FILE__).'/../../footer.php');
+1 -8
View File
@@ -1,13 +1,6 @@
<?xml version='1.0' encoding='utf-8' ?>
<referralprogram>
<body>
<paragraph_1><![CDATA[<p>toto Quisque in mauris. Duis eu diam. Nullam at metus in lectus interdum elementum. Vestibulum dapibus diam ut libero. Vivamus placerat lacus at dui. Integer dapibus est in magna.</p>
<p>Curabitur vel erat eget sapien semper feugiat. Sed sodales dictum pede. Ut adipiscing. Cras aliquam, erat eget auctor pretium, lorem pede pellentesque metus, at ultrices est est sit amet libero.</p>
<p>Aliquam erat volutpat. Maecenas aliquet, felis at eleifend suscipit, risus sem congue est, id vestibulum libero sapien in ligula. Nulla ut urna id eros lacinia gravida.</p>]]></paragraph_1>
<paragraph_2><![CDATA[<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean nisl diam, sollicitudin vitae, tempor nec, suscipit non, quam. Donec in nulla. Nam consequat bibendum leo. Etiam viverra congue nisl. Aliquam ac tellus vitae arcu ornare convallis.</p>
<p>Nulla ut erat. Vivamus ornare imperdiet libero. Integer risus mauris, faucibus eu, fermentum tincidunt, molestie non, arcu. Phasellus mattis, dui ac vestibulum pellentesque, enim turpis scelerisque augue, ut tristique quam metus eu metus. Donec pellentesque faucibus velit. Vivamus quis ipsum. leather edition is near from you ut libero sed mauris venenatis iaculis. Curabitur nulla erat, accumsan ac, consequat quis, aliquet sit amet, orci.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean nisl diam, sollicitudin vitae, tempor nec, suscipit non, quam. Donec in nulla. Nam consequat bibendum leo. Etiam viverra congue nisl. Aliquam ac tellus vitae arcu ornare convallis.</p>
<p>Nulla ut erat. Vivamus ornare imperdiet libero. Integer risus mauris, faucibus eu, fermentum tincidunt, molestie non, arcu. Phasellus mattis, dui ac vestibulum pellentesque, enim turpis scelerisque augue, ut tristique quam metus eu metus. Donec pellentesque faucibus velit. Vivamus quis ipsum. Pellentesque ut libero sed mauris venenatis iaculis. Curabitur nulla erat, accumsan ac, consequat quis, aliquet sit amet, orci.</p>]]></paragraph_2>
<paragraph_3><![CDATA[<p>test espagnol</p>]]></paragraph_3>
<paragraph_4><![CDATA[sdfsvgsd gs dbhf hf ghfd htrs htzrht zr]]></paragraph_4>
</body>
</referralprogram>
+27
View File
@@ -0,0 +1,27 @@
{*
* 2007-2012 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 <contact@prestashop.com>
* @copyright 2007-2012 PrestaShop SA
* @version Release: $Revision: 6594 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{$content}
@@ -96,7 +96,7 @@
{/if},
{l s='he or she will receive a %1$d voucher and you will receive your own voucher worth %2$d.' sprintf=[$discount,$discount] mod='referralprogram'}
</p>
<form method="post" action="{$base_dir_ssl}modules/referralprogram/referralprogram-program.php" class="std">
<form method="post" action="{$link->getModuleLink('referralprogram', 'program', [], true)}" class="std">
<table class="std">
<thead>
<tr>
@@ -123,10 +123,12 @@
<p class="checkbox">
<input type="checkbox" name="conditionsValided" id="conditionsValided" value="1" {if isset($smarty.post.conditionsValided) AND $smarty.post.conditionsValided eq 1}checked="checked"{/if} />
<label for="conditionsValided">{l s='I agree to the terms of service and adhere to them unconditionally.' mod='referralprogram'}</label>
<a href="{$base_dir_ssl}modules/referralprogram/referralprogram-rules.php?height=500&amp;width=400" class="thickbox" title="{l s='Conditions of the referral program' mod='referralprogram'}">{l s='Read conditions.' mod='referralprogram'}</a>
<a href="{$link->getModuleLink('referralprogram', 'rules', ['height' => '500', 'width' => '400'], true)}" class="thickbox" title="{l s='Conditions of the referral program' mod='referralprogram'}">{l s='Read conditions.' mod='referralprogram'}</a>
</p>
<p class="see_email">
{l s='Preview' mod='referralprogram'} <a href="{$base_dir_ssl}modules/referralprogram/preview-email.php?height=500&amp;width=600&amp;mail={$lang_iso}/referralprogram-invitation.html" class="thickbox" title="{l s='Invitation e-mail' mod='referralprogram'}">{l s='the default e-mail' mod='referralprogram'}</a> {l s='that will be sent to your friend(s).' mod='referralprogram'}
{l s='Preview' mod='referralprogram'}
{assign var="file" value="{$lang_iso}/referralprogram-invitation.html"}
<a href="{$link->getModuleLink('referralprogram', 'email', ['height' => '500', 'width' => '600', 'mail' => {$file}], true)}" class="thickbox" title="{l s='Invitation e-mail' mod='referralprogram'}">{l s='the default e-mail' mod='referralprogram'}</a> {l s='that will be sent to your friend(s).' mod='referralprogram'}
</p>
<p class="submit">
<input type="submit" id="submitSponsorFriends" name="submitSponsorFriends" class="button_large" value="{l s='Validate' mod='referralprogram'}" />
@@ -144,7 +146,7 @@
<p>
{l s='These friends have not yet placed an order on this Website since you sponsored them, but you can try again! To do so, mark the checkboxes of the friend(s) you want to remind, then click on the button "Remind my friend(s)"' mod='referralprogram'}
</p>
<form method="post" action="{$base_dir_ssl}modules/referralprogram/referralprogram-program.php" class="std">
<form method="post" action="{$link->getModuleLink('referralprogram', 'program', [], true)}" class="std">
<table class="std">
<thead>
<tr>
@@ -25,5 +25,10 @@
*}
<!-- MODULE ReferralProgram -->
<li class="referralprogram"><a href="{$base_dir_ssl}modules/referralprogram/referralprogram-program.php" title="{l s='Referral program' mod='referralprogram'}"><img src="{$module_template_dir}referralprogram.gif" alt="{l s='Referral program' mod='referralprogram'}" class="icon" /> {l s='Referral program' mod='referralprogram'}</a></li>
<li class="referralprogram">
<a href="{$link->getModuleLink('referralprogram', 'program', [], true)}" title="{l s='Referral program' mod='referralprogram'}">
<img src="{$module_template_dir}referralprogram.gif" alt="{l s='Referral program' mod='referralprogram'}" class="icon" />
{l s='Referral program' mod='referralprogram'}
</a>
</li>
<!-- END : MODULE ReferralProgram -->
@@ -29,7 +29,7 @@
<img src="{$module_template_dir}referralprogram.gif" alt="{l s='Referral program' mod='referralprogram'}" class="icon" />
{l s='You have earned a voucher worth %s thanks to your sponsor!' sprintf=$discount_display mod='referralprogram'}
{l s='Enter voucher name %s to receive the reduction on this order.' sprintf=$discount->name mod='referralprogram'}
<a href="{$module_template_dir}referralprogram-program.php" title="{l s='Referral program' mod='referralprogram'}">{l s='View your referral program.' mod='referralprogram'}</a>
<a href="{$link->getModuleLink('referralprogram', 'program', [], true)}" title="{l s='Referral program' mod='referralprogram'}">{l s='View your referral program.' mod='referralprogram'}</a>
</p>
<br />
<!-- END : MODULE ReferralProgram -->