Working : Coupon : fix links and errors display
This commit is contained in:
@@ -103,25 +103,25 @@
|
|||||||
|
|
||||||
<!-- Route to the Coupon controller (process Coupon browsing) -->
|
<!-- Route to the Coupon controller (process Coupon browsing) -->
|
||||||
|
|
||||||
<route id="admin.coupon.list" path="/admin/coupon">
|
<route id="admin.coupon.list" path="/admin/coupon/">
|
||||||
<default key="_controller">Thelia\Controller\Admin\CouponController::browseAction</default>
|
<default key="_controller">Thelia\Controller\Admin\CouponController::browseAction</default>
|
||||||
</route>
|
</route>
|
||||||
<route id="admin.coupon.create" path="/admin/coupon/create">
|
<route id="admin.coupon.create" path="/admin/coupon/create/">
|
||||||
<default key="_controller">Thelia\Controller\Admin\CouponController::createAction</default>
|
<default key="_controller">Thelia\Controller\Admin\CouponController::createAction</default>
|
||||||
</route>
|
</route>
|
||||||
<route id="admin.coupon.update" path="/admin/coupon/update/{couponId}">
|
<route id="admin.coupon.update" path="/admin/coupon/update/{couponId}/">
|
||||||
<default key="_controller">Thelia\Controller\Admin\CouponController::updateAction</default>
|
<default key="_controller">Thelia\Controller\Admin\CouponController::updateAction</default>
|
||||||
</route>
|
</route>
|
||||||
<route id="admin.coupon.read" path="/admin/coupon/read/{couponId}">
|
<route id="admin.coupon.read" path="/admin/coupon/read/{couponId}/">
|
||||||
<default key="_controller">Thelia\Controller\Admin\CouponController::readAction</default>
|
<default key="_controller">Thelia\Controller\Admin\CouponController::readAction</default>
|
||||||
</route>
|
</route>
|
||||||
<route id="admin.coupon.rule.input" path="/admin/coupon/rule/{ruleId}">
|
<route id="admin.coupon.rule.input" path="/admin/coupon/rule/{ruleId}/">
|
||||||
<default key="_controller">Thelia\Controller\Admin\CouponController::getRuleInputAction</default>
|
<default key="_controller">Thelia\Controller\Admin\CouponController::getRuleInputAction</default>
|
||||||
</route>
|
</route>
|
||||||
<route id="admin.coupon.rule.update" path="/admin/coupon/{couponId}/rule/update/">
|
<route id="admin.coupon.rule.update" path="/admin/coupon/{couponId}/rule/update/">
|
||||||
<default key="_controller">Thelia\Controller\Admin\CouponController::updateRulesAction</default>
|
<default key="_controller">Thelia\Controller\Admin\CouponController::updateRulesAction</default>
|
||||||
</route>
|
</route>
|
||||||
<route id="admin.coupon.consume" path="/admin/coupon/consume/{couponCode}">
|
<route id="admin.coupon.consume" path="/admin/coupon/consume/{couponCode}/">
|
||||||
<default key="_controller">Thelia\Controller\Admin\CouponController::consumeAction</default>
|
<default key="_controller">Thelia\Controller\Admin\CouponController::consumeAction</default>
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,54 @@ class CouponController extends BaseAdminController
|
|||||||
{
|
{
|
||||||
$this->checkAuth('ADMIN', 'admin.coupon.view');
|
$this->checkAuth('ADMIN', 'admin.coupon.view');
|
||||||
|
|
||||||
return $this->render('coupon-list');
|
$args['urlReadCoupon'] = $this->getRoute(
|
||||||
|
'admin.coupon.read',
|
||||||
|
array('couponId' => 'couponId'),
|
||||||
|
Router::ABSOLUTE_URL
|
||||||
|
);
|
||||||
|
|
||||||
|
$args['urlEditCoupon'] = $this->getRoute(
|
||||||
|
'admin.coupon.update',
|
||||||
|
array('couponId' => 'couponId'),
|
||||||
|
Router::ABSOLUTE_URL
|
||||||
|
);
|
||||||
|
|
||||||
|
$args['urlCreateCoupon'] = $this->getRoute(
|
||||||
|
'admin.coupon.create',
|
||||||
|
array(),
|
||||||
|
Router::ABSOLUTE_URL
|
||||||
|
);
|
||||||
|
|
||||||
|
return $this->render('coupon-list', $args);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Manage Coupons read display
|
||||||
|
*
|
||||||
|
* @param int $couponId Coupon Id
|
||||||
|
*
|
||||||
|
* @return \Symfony\Component\HttpFoundation\Response
|
||||||
|
*/
|
||||||
|
public function readAction($couponId)
|
||||||
|
{
|
||||||
|
$this->checkAuth('ADMIN', 'admin.coupon.read');
|
||||||
|
|
||||||
|
// Database request repeated in the loop but cached
|
||||||
|
$search = CouponQuery::create();
|
||||||
|
$coupon = $search->findOneById($couponId);
|
||||||
|
|
||||||
|
if ($coupon === null) {
|
||||||
|
return $this->pageNotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
$args['couponId'] = $couponId;
|
||||||
|
$args['urlEditCoupon'] = $this->getRoute(
|
||||||
|
'admin.coupon.update',
|
||||||
|
array('couponId' => $couponId),
|
||||||
|
Router::ABSOLUTE_URL
|
||||||
|
);
|
||||||
|
|
||||||
|
return $this->render('coupon-read', $args);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -95,7 +142,7 @@ class CouponController extends BaseAdminController
|
|||||||
|
|
||||||
$i18n = new I18n();
|
$i18n = new I18n();
|
||||||
/** @var Lang $lang */
|
/** @var Lang $lang */
|
||||||
$lang = $this->getSession()->get('lang');
|
$lang = $this->getSession()->getLang();
|
||||||
$eventToDispatch = TheliaEvents::COUPON_CREATE;
|
$eventToDispatch = TheliaEvents::COUPON_CREATE;
|
||||||
|
|
||||||
if ($this->getRequest()->isMethod('POST')) {
|
if ($this->getRequest()->isMethod('POST')) {
|
||||||
@@ -113,7 +160,8 @@ class CouponController extends BaseAdminController
|
|||||||
->format($lang->getDateFormat());
|
->format($lang->getDateFormat());
|
||||||
}
|
}
|
||||||
|
|
||||||
$args['formAction'] = 'admin/coupon/create';
|
$args['availableCoupons'] = $this->getAvailableCoupons();
|
||||||
|
$args['formAction'] = 'admin/coupon/create/';
|
||||||
|
|
||||||
return $this->render(
|
return $this->render(
|
||||||
'coupon-create',
|
'coupon-create',
|
||||||
@@ -205,7 +253,7 @@ class CouponController extends BaseAdminController
|
|||||||
// Pass it to the parser
|
// Pass it to the parser
|
||||||
$this->getParserContext()->addForm($changeForm);
|
$this->getParserContext()->addForm($changeForm);
|
||||||
}
|
}
|
||||||
|
$args['couponCode'] = $coupon->getCode();
|
||||||
$args['availableCoupons'] = $this->getAvailableCoupons();
|
$args['availableCoupons'] = $this->getAvailableCoupons();
|
||||||
$args['availableRules'] = $this->getAvailableRules();
|
$args['availableRules'] = $this->getAvailableRules();
|
||||||
$args['urlAjaxGetRuleInput'] = $this->getRoute(
|
$args['urlAjaxGetRuleInput'] = $this->getRoute(
|
||||||
@@ -320,27 +368,7 @@ class CouponController extends BaseAdminController
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Manage Coupons read display
|
|
||||||
*
|
|
||||||
* @param int $couponId Coupon Id
|
|
||||||
*
|
|
||||||
* @return \Symfony\Component\HttpFoundation\Response
|
|
||||||
*/
|
|
||||||
public function readAction($couponId)
|
|
||||||
{
|
|
||||||
$this->checkAuth('ADMIN', 'admin.coupon.read');
|
|
||||||
|
|
||||||
// Database request repeated in the loop but cached
|
|
||||||
$search = CouponQuery::create();
|
|
||||||
$coupon = $search->findOneById($couponId);
|
|
||||||
|
|
||||||
if ($coupon === null) {
|
|
||||||
return $this->pageNotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->render('coupon-read', array('couponId' => $couponId));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manage Coupons read display
|
* Manage Coupons read display
|
||||||
@@ -657,17 +685,17 @@ class CouponController extends BaseAdminController
|
|||||||
/** @var CouponManager $couponManager */
|
/** @var CouponManager $couponManager */
|
||||||
$couponManager = $this->container->get('thelia.coupon.manager');
|
$couponManager = $this->container->get('thelia.coupon.manager');
|
||||||
$availableCoupons = $couponManager->getAvailableCoupons();
|
$availableCoupons = $couponManager->getAvailableCoupons();
|
||||||
$cleanedRules = array();
|
$cleanedCoupons = array();
|
||||||
/** @var CouponInterface $availableCoupon */
|
/** @var CouponInterface $availableCoupon */
|
||||||
foreach ($availableCoupons as $availableCoupon) {
|
foreach ($availableCoupons as $availableCoupon) {
|
||||||
$rule = array();
|
$rule = array();
|
||||||
$rule['serviceId'] = $availableCoupon->getServiceId();
|
$rule['serviceId'] = $availableCoupon->getServiceId();
|
||||||
$rule['name'] = $availableCoupon->getName();
|
$rule['name'] = $availableCoupon->getName();
|
||||||
$rule['toolTip'] = $availableCoupon->getToolTip();
|
$rule['toolTip'] = $availableCoupon->getToolTip();
|
||||||
$cleanedRules[] = $rule;
|
$cleanedCoupons[] = $rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $cleanedRules;
|
return $cleanedCoupons;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
namespace Thelia\Core\Template\Loop;
|
namespace Thelia\Core\Template\Loop;
|
||||||
|
|
||||||
use Propel\Runtime\ActiveQuery\Criteria;
|
use Propel\Runtime\ActiveQuery\Criteria;
|
||||||
|
use Propel\Runtime\Util\PropelModelPager;
|
||||||
use Thelia\Constraint\ConstraintFactory;
|
use Thelia\Constraint\ConstraintFactory;
|
||||||
use Thelia\Constraint\Rule\CouponRuleInterface;
|
use Thelia\Constraint\Rule\CouponRuleInterface;
|
||||||
use Thelia\Core\HttpFoundation\Request;
|
use Thelia\Core\HttpFoundation\Request;
|
||||||
@@ -38,6 +39,7 @@ use Thelia\Coupon\Type\CouponInterface;
|
|||||||
use Thelia\Model\CouponQuery;
|
use Thelia\Model\CouponQuery;
|
||||||
use Thelia\Model\Coupon as MCoupon;
|
use Thelia\Model\Coupon as MCoupon;
|
||||||
use Thelia\Type;
|
use Thelia\Type;
|
||||||
|
use Thelia\Type\BooleanOrBothType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by JetBrains PhpStorm.
|
* Created by JetBrains PhpStorm.
|
||||||
@@ -53,17 +55,22 @@ use Thelia\Type;
|
|||||||
class Coupon extends BaseI18nLoop
|
class Coupon extends BaseI18nLoop
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
* Define all args used in your loop
|
||||||
|
*
|
||||||
* @return ArgumentCollection
|
* @return ArgumentCollection
|
||||||
*/
|
*/
|
||||||
protected function getArgDefinitions()
|
protected function getArgDefinitions()
|
||||||
{
|
{
|
||||||
return new ArgumentCollection(
|
return new ArgumentCollection(
|
||||||
Argument::createIntListTypeArgument('id')
|
Argument::createIntListTypeArgument('id'),
|
||||||
|
Argument::createBooleanOrBothTypeArgument('is_enabled', 1)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $pagination
|
* Execute Loop
|
||||||
|
*
|
||||||
|
* @param PropelModelPager $pagination
|
||||||
*
|
*
|
||||||
* @return \Thelia\Core\Template\Element\LoopResult
|
* @return \Thelia\Core\Template\Element\LoopResult
|
||||||
*/
|
*/
|
||||||
@@ -75,11 +82,16 @@ class Coupon extends BaseI18nLoop
|
|||||||
$locale = $this->configureI18nProcessing($search, array('TITLE', 'DESCRIPTION', 'SHORT_DESCRIPTION'));
|
$locale = $this->configureI18nProcessing($search, array('TITLE', 'DESCRIPTION', 'SHORT_DESCRIPTION'));
|
||||||
|
|
||||||
$id = $this->getId();
|
$id = $this->getId();
|
||||||
|
$isEnabled = $this->getIsEnabled();
|
||||||
|
|
||||||
if (null !== $id) {
|
if (null !== $id) {
|
||||||
$search->filterById($id, Criteria::IN);
|
$search->filterById($id, Criteria::IN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($isEnabled != BooleanOrBothType::ANY) {
|
||||||
|
$search->filterByIsEnabled($isEnabled ? 1 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
// Perform search
|
// Perform search
|
||||||
$coupons = $this->search($search, $pagination);
|
$coupons = $this->search($search, $pagination);
|
||||||
|
|
||||||
@@ -122,7 +134,7 @@ class Coupon extends BaseI18nLoop
|
|||||||
|
|
||||||
$cleanedRules = array();
|
$cleanedRules = array();
|
||||||
/** @var CouponRuleInterface $rule */
|
/** @var CouponRuleInterface $rule */
|
||||||
foreach ($rules->getRules() as $key => $rule) {
|
foreach ($rules->getRules() as $rule) {
|
||||||
$cleanedRules[] = $rule->getToolTip();
|
$cleanedRules[] = $rule->getToolTip();
|
||||||
}
|
}
|
||||||
$loopResultRow->set("ID", $coupon->getId())
|
$loopResultRow->set("ID", $coupon->getId())
|
||||||
|
|||||||
@@ -23,7 +23,10 @@
|
|||||||
|
|
||||||
namespace Thelia\Form;
|
namespace Thelia\Form;
|
||||||
|
|
||||||
|
use Symfony\Component\Validator\Constraints\Date;
|
||||||
|
use Symfony\Component\Validator\Constraints\GreaterThanOrEqual;
|
||||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
|
use Symfony\Component\Validator\Constraints\NotEqualTo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by JetBrains PhpStorm.
|
* Created by JetBrains PhpStorm.
|
||||||
@@ -68,7 +71,6 @@ class CouponCreationForm extends BaseForm
|
|||||||
'shortDescription',
|
'shortDescription',
|
||||||
'text',
|
'text',
|
||||||
array(
|
array(
|
||||||
'invalid_message' => 'test',
|
|
||||||
'constraints' => array(
|
'constraints' => array(
|
||||||
new NotBlank()
|
new NotBlank()
|
||||||
)
|
)
|
||||||
@@ -78,7 +80,6 @@ class CouponCreationForm extends BaseForm
|
|||||||
'description',
|
'description',
|
||||||
'textarea',
|
'textarea',
|
||||||
array(
|
array(
|
||||||
'invalid_message' => 'test',
|
|
||||||
'constraints' => array(
|
'constraints' => array(
|
||||||
new NotBlank()
|
new NotBlank()
|
||||||
)
|
)
|
||||||
@@ -88,16 +89,23 @@ class CouponCreationForm extends BaseForm
|
|||||||
'effect',
|
'effect',
|
||||||
'text',
|
'text',
|
||||||
array(
|
array(
|
||||||
'invalid_message' => 'test',
|
|
||||||
'constraints' => array(
|
'constraints' => array(
|
||||||
new NotBlank()
|
new NotBlank(),
|
||||||
|
new NotEqualTo(
|
||||||
|
array(
|
||||||
|
'value' => -1
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
->add(
|
->add(
|
||||||
'amount',
|
'amount',
|
||||||
'money',
|
'money',
|
||||||
array()
|
array(
|
||||||
|
'constraints' => array(
|
||||||
|
new NotBlank()
|
||||||
|
))
|
||||||
)
|
)
|
||||||
->add(
|
->add(
|
||||||
'isEnabled',
|
'isEnabled',
|
||||||
@@ -109,7 +117,8 @@ class CouponCreationForm extends BaseForm
|
|||||||
'text',
|
'text',
|
||||||
array(
|
array(
|
||||||
'constraints' => array(
|
'constraints' => array(
|
||||||
new NotBlank()
|
new NotBlank(),
|
||||||
|
new Date()
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -133,7 +142,12 @@ class CouponCreationForm extends BaseForm
|
|||||||
'text',
|
'text',
|
||||||
array(
|
array(
|
||||||
'constraints' => array(
|
'constraints' => array(
|
||||||
new NotBlank()
|
new NotBlank(),
|
||||||
|
new GreaterThanOrEqual(
|
||||||
|
array(
|
||||||
|
'value' => -1
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ INSERT INTO `config` (`name`, `value`, `secured`, `hidden`, `created_at`, `updat
|
|||||||
('currency_rate_update_url', 'http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml', 0, 0, NOW(), NOW()),
|
('currency_rate_update_url', 'http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml', 0, 0, NOW(), NOW()),
|
||||||
('page_not_found_view', '404.html', 0, 0, NOW(), NOW()),
|
('page_not_found_view', '404.html', 0, 0, NOW(), NOW()),
|
||||||
('use_tax_free_amounts', 0, 1, 0, NOW(), NOW()),
|
('use_tax_free_amounts', 0, 1, 0, NOW(), NOW()),
|
||||||
('process_assets', '0', 0, 0, NOW(), NOW());
|
('process_assets', '1', 0, 0, NOW(), NOW());
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO `module` (`id`, `code`, `type`, `activate`, `position`, `full_namespace`, `created_at`, `updated_at`) VALUES
|
INSERT INTO `module` (`id`, `code`, `type`, `activate`, `position`, `full_namespace`, `created_at`, `updated_at`) VALUES
|
||||||
|
|||||||
@@ -146,7 +146,7 @@
|
|||||||
|
|
||||||
{loop name="menu-auth-coupon" type="auth" roles="ADMIN" permissions="admin.coupon.view"}
|
{loop name="menu-auth-coupon" type="auth" roles="ADMIN" permissions="admin.coupon.view"}
|
||||||
<li class="{if $admin_current_location == 'coupon'}active{/if}" id="coupon_menu">
|
<li class="{if $admin_current_location == 'coupon'}active{/if}" id="coupon_menu">
|
||||||
<a href="{url path='/admin/coupon-list'}">{intl l="Coupons"}</a>
|
<a href="{url path='/admin/coupon/'}">{intl l="Coupons"}</a>
|
||||||
</li>
|
</li>
|
||||||
{/loop}
|
{/loop}
|
||||||
|
|
||||||
|
|||||||
@@ -115,6 +115,8 @@ $(function($){
|
|||||||
|
|
||||||
// Reload effect inputs when changing effect
|
// Reload effect inputs when changing effect
|
||||||
couponManager.onEffectChange = function() {
|
couponManager.onEffectChange = function() {
|
||||||
|
var optionSelected = $("option:selected", this);
|
||||||
|
$('#effectToolTip').html(optionSelected.attr("data-description"));
|
||||||
$('#effect').on('change', function () {
|
$('#effect').on('change', function () {
|
||||||
var optionSelected = $("option:selected", this);
|
var optionSelected = $("option:selected", this);
|
||||||
$('#effectToolTip').html(optionSelected.attr("data-description"));
|
$('#effectToolTip').html(optionSelected.attr("data-description"));
|
||||||
@@ -134,6 +136,32 @@ $(function($){
|
|||||||
// var onInputsChange = function()
|
// var onInputsChange = function()
|
||||||
// In AJAX response
|
// In AJAX response
|
||||||
|
|
||||||
|
// Set max usage to unlimited or not
|
||||||
|
couponManager.onUsageUnlimitedChange = function() {
|
||||||
|
if (!$('#max-usage').parent().hasClass('has-error')) {
|
||||||
|
$('#max-usage').hide().attr('value', '-1');
|
||||||
|
}
|
||||||
|
$('#is-unlimited').change(function(){
|
||||||
|
var $this = $(this);
|
||||||
|
if ($this.is(':checked')) {
|
||||||
|
$('#max-usage').hide().attr('value', '-1');
|
||||||
|
} else {
|
||||||
|
$('#max-usage').show().val('').attr('value', '');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
couponManager.onUsageUnlimitedChange();
|
||||||
|
|
||||||
|
// // -- Effect description
|
||||||
|
// if($('[name=effect]').length){
|
||||||
|
// var $effectSelect = $('[name=effect]'),
|
||||||
|
// $helpBlock = $effectSelect.next('.help-block');
|
||||||
|
//
|
||||||
|
// $effectSelect.change(function(){
|
||||||
|
// var description = $(this).find(":selected").data('description');
|
||||||
|
// $helpBlock.text(description);
|
||||||
|
// });
|
||||||
|
// }
|
||||||
});
|
});
|
||||||
|
|
||||||
// Rule to save
|
// Rule to save
|
||||||
|
|||||||
@@ -40,34 +40,7 @@
|
|||||||
});
|
});
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
// -- Effect description
|
|
||||||
if($('[name=effect]').length){
|
|
||||||
var $effectSelect = $('[name=effect]'),
|
|
||||||
$helpBlock = $effectSelect.next('.help-block');
|
|
||||||
|
|
||||||
$effectSelect.change(function(){
|
|
||||||
var description = $(this).find(":selected").data('description');
|
|
||||||
$helpBlock.text(description);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// -- Max usage --
|
|
||||||
if($('#is-unlimited').length){
|
|
||||||
|
|
||||||
if($('#is-unlimited').is(':checked')){
|
|
||||||
$('#max-usage').hide().attr('value', '-1');
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#is-unlimited').change(function(){
|
|
||||||
if($('#is-unlimited').is(':checked')){
|
|
||||||
$('#max-usage').hide().attr('value', '-1');
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$('#max-usage').show().val('').attr('value', '');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// -- Bootstrap tooltip --
|
// -- Bootstrap tooltip --
|
||||||
if($('[rel="tooltip"]').length){
|
if($('[rel="tooltip"]').length){
|
||||||
|
|||||||
@@ -7,12 +7,14 @@
|
|||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<ul class="breadcrumb">
|
<ul class="breadcrumb">
|
||||||
{include file="includes/coupon_breadcrumb.html"}
|
<li><a href="{url path='admin/home'}">{intl l='Home'}</a></li>
|
||||||
|
<li><a href="{url path='admin/coupon/'}">{intl l='Coupon'}</a></li>
|
||||||
|
<li>{intl l='Create'}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h1>Coupons : <small>Add a coupon</small></h1>
|
<h1>{intl l='Coupons : '}<small>{intl l='Create a new coupon'}</small></h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{form name="thelia.admin.coupon.creation"}
|
{form name="thelia.admin.coupon.creation"}
|
||||||
@@ -33,9 +35,11 @@
|
|||||||
<script src="{$asset_url}"></script>
|
<script src="{$asset_url}"></script>
|
||||||
{/javascripts}
|
{/javascripts}
|
||||||
|
|
||||||
<script>
|
{javascripts file='assets/js/json2.js'}
|
||||||
$(function($){
|
<script src="{$asset_url}"></script>
|
||||||
miniBrowser(0, '/test_to_remove/datas_coupon_edit.json');
|
{/javascripts}
|
||||||
});
|
|
||||||
</script>
|
{javascripts file='assets/js/coupon.js'}
|
||||||
|
<script src="{$asset_url}"></script>
|
||||||
|
{/javascripts}
|
||||||
{/block}
|
{/block}
|
||||||
|
|||||||
@@ -7,70 +7,50 @@
|
|||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<ul class="breadcrumb">
|
<ul class="breadcrumb">
|
||||||
{include file="includes/coupon_breadcrumb.html"}
|
<li><a href="{url path='admin/home'}">{intl l='Home'}</a></li>
|
||||||
|
<li><a href="{url path='admin/coupon/'}">{intl l='Coupon'}</a></li>
|
||||||
|
<li>{intl l='Browse'}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h1>Coupons : <small>List of coupons</small></h1>
|
<h1>{intl l='Coupons : '}<small>{intl l='List'}</small></h1>
|
||||||
|
<a href="{$urlCreateCoupon}" class="btn btn-default btn-primary btn-medium">
|
||||||
|
<span class="glyphicon glyphicon-add"></span> {intl l='Create a new coupon'}
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<section class="row">
|
<section class="row">
|
||||||
<div class="col-md-12 general-block-decorator">
|
<div class="col-md-12 general-block-decorator">
|
||||||
<table class="table table-striped tablesorter">
|
<table class="table table-striped tablesorter">
|
||||||
<caption>
|
<caption>
|
||||||
List of enabled coupons
|
{intl l='Enabled coupons'}
|
||||||
</caption>
|
</caption>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Code</th>
|
<th>{block name="coupon-label-code"}{intl l='Code'}{/block}</th>
|
||||||
<th>Title</th>
|
<th>{block name="coupon-label-title"}{intl l='Title'}{/block}</th>
|
||||||
<th>Expiration date</th>
|
<th>{block name="coupon-label-expiration-date"}{intl l='Expiration date'}{/block}</th>
|
||||||
<th>Usage left</th>
|
<th>{block name="coupon-label-usage-left"}{intl l='Usage left'}{/block}</th>
|
||||||
<th class="sorter-false filter-false">Actions</th>
|
<th class="sorter-false filter-false">{block name="coupon-label-action"}{/block}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
{loop type="coupon" name="list_coupon" is_enabled="1" backend_context="true"}
|
||||||
<td><a href="#">XMAS13</a></td>
|
<tr>
|
||||||
<td>Coupon for XMAS -30 €</td>
|
<td>{block name="coupon-code"}<a href="{$urlReadCoupon|replace:'couponId':$ID}">{$CODE}</a>{/block}</td>
|
||||||
<td>18/10/2013</td>
|
<td>{block name="coupon-title"}{$TITLE}{/block}</td>
|
||||||
<td>49</td>
|
<td>{block name="coupon-expiration-date"}{$EXPIRATION_DATE}{/block}</td>
|
||||||
<td>
|
<td>{block name="coupon-usage-left"}{$USAGE_LEFT}{/block}</td>
|
||||||
<a href="#url" class="btn btn-default btn-primary btn-medium"><span class="glyphicon glyphicon-edit"></span> Edit</a>
|
<td>
|
||||||
<a href="#url" class="btn btn-default btn-danger btn-medium" data-toggle="confirm" data-target="#disable"><span class="glyphicon glyphicon-off"></span> Disable</a>
|
{block name="coupon-action"}
|
||||||
</td>
|
<a href="{$urlEditCoupon|replace:'couponId':$ID}" class="btn btn-default btn-primary btn-medium">
|
||||||
</tr>
|
<span class="glyphicon glyphicon-edit"></span> {intl l='Edit'}
|
||||||
<tr>
|
</a>
|
||||||
<td><a href="#">XMAS13</a></td>
|
{/block}
|
||||||
<td>Coupon for XMAS -30 €</td>
|
</td>
|
||||||
<td>05/09/2013</td>
|
</tr>
|
||||||
<td>20</td>
|
{/loop}
|
||||||
<td>
|
|
||||||
<a href="#url" class="btn btn-default btn-primary btn-medium"><span class="glyphicon glyphicon-edit"></span> Edit</a>
|
|
||||||
<a href="#url" class="btn btn-default btn-danger btn-medium" data-toggle="confirm" data-target="#disable"><span class="glyphicon glyphicon-off"></span> Disable</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><a href="#">XMAS13</a></td>
|
|
||||||
<td>Coupon for XMAS -30 €</td>
|
|
||||||
<td>03/12/2013</td>
|
|
||||||
<td>9</td>
|
|
||||||
<td>
|
|
||||||
<a href="#url" class="btn btn-default btn-primary btn-medium"><span class="glyphicon glyphicon-edit"></span> Edit</a>
|
|
||||||
<a href="#url" class="btn btn-default btn-danger btn-medium" data-toggle="confirm" data-target="#disable"><span class="glyphicon glyphicon-off"></span> Disable</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><a href="#">XMAS13</a></td>
|
|
||||||
<td>Coupon for XMAS -30 €</td>
|
|
||||||
<td>25/01/2013</td>
|
|
||||||
<td>4</td>
|
|
||||||
<td>
|
|
||||||
<a href="#url" class="btn btn-default btn-primary btn-medium"><span class="glyphicon glyphicon-edit"></span> Edit</a>
|
|
||||||
<a href="#url" class="btn btn-default btn-danger btn-medium" data-toggle="confirm" data-target="#disable"><span class="glyphicon glyphicon-off"></span> Disable</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@@ -80,58 +60,33 @@
|
|||||||
<div class="col-md-12 general-block-decorator">
|
<div class="col-md-12 general-block-decorator">
|
||||||
<table class="table table-striped tablesorter">
|
<table class="table table-striped tablesorter">
|
||||||
<caption>
|
<caption>
|
||||||
List of disabled coupons
|
{intl l='Disabled coupons'}
|
||||||
</caption>
|
</caption>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Code</th>
|
<th>{block name="coupon-label-code"}{intl l='Code'}{/block}</th>
|
||||||
<th>Title</th>
|
<th>{block name="coupon-label-title"}{intl l='Title'}{/block}</th>
|
||||||
<th>Expiration date</th>
|
<th>{block name="coupon-label-expiration-date"}{intl l='Expiration date'}{/block}</th>
|
||||||
<th>Usage left</th>
|
<th>{block name="coupon-label-usage-left"}{intl l='Usage left'}{/block}</th>
|
||||||
<th class="sorter-false filter-false">Actions</th>
|
<th class="sorter-false filter-false">{block name="coupon-label-action"}{/block}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
{loop type="coupon" name="list_coupon" is_enabled="0" backend_context="true"}
|
||||||
<td>XMAS13</td>
|
<tr>
|
||||||
<td>Coupon for XMAS -30 €</td>
|
<td>{block name="coupon-code"}<a href="{$urlReadCoupon|replace:'couponId':$ID}">{$CODE}</a>{/block}</td>
|
||||||
<td>18/10/2013</td>
|
<td>{block name="coupon-title"}{$TITLE}{/block}</td>
|
||||||
<td>49</td>
|
<td>{block name="coupon-expiration-date"}{$EXPIRATION_DATE}{/block}</td>
|
||||||
<td>
|
<td>{block name="coupon-usage-left"}{$USAGE_LEFT}{/block}</td>
|
||||||
<a href="#url" class="btn btn-default btn-primary btn-medium"><span class="glyphicon glyphicon-edit"></span> Edit</a>
|
<td>
|
||||||
<a href="#url" class="btn btn-default btn-success btn-medium" data-toggle="confirm" data-target="#enable"><span class="glyphicon glyphicon-ok"></span> Enabled</a>
|
{block name="coupon-action"}
|
||||||
</td>
|
<a href="{$urlEditCoupon|replace:'couponId':$ID}" class="btn btn-default btn-primary btn-medium">
|
||||||
</tr>
|
<span class="glyphicon glyphicon-edit"></span> {intl l='Edit'}
|
||||||
<tr>
|
</a>
|
||||||
<td>XMAS13</td>
|
{/block}
|
||||||
<td>Coupon for XMAS -20 €</td>
|
</td>
|
||||||
<td>05/09/2013</td>
|
</tr>
|
||||||
<td>49</td>
|
{/loop}
|
||||||
<td>
|
|
||||||
<a href="#url" class="btn btn-default btn-primary btn-medium"><span class="glyphicon glyphicon-edit"></span> Edit</a>
|
|
||||||
<a href="#url" class="btn btn-default btn-success btn-medium" data-toggle="confirm" data-target="#enable"><span class="glyphicon glyphicon-ok"></span> Enabled</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>XMAS13</td>
|
|
||||||
<td>Coupon for XMAS -50 €</td>
|
|
||||||
<td>03/12/2013</td>
|
|
||||||
<td>49</td>
|
|
||||||
<td>
|
|
||||||
<a href="#url" class="btn btn-default btn-primary btn-medium"><span class="glyphicon glyphicon-edit"></span> Edit</a>
|
|
||||||
<a href="#url" class="btn btn-default btn-success btn-medium" data-toggle="confirm" data-target="#enable"><span class="glyphicon glyphicon-ok"></span> Enabled</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>XMAS13</td>
|
|
||||||
<td>Coupon for XMAS -5 €</td>
|
|
||||||
<td>25/01/2013</td>
|
|
||||||
<td>49</td>
|
|
||||||
<td>
|
|
||||||
<a href="#url" class="btn btn-default btn-primary btn-medium"><span class="glyphicon glyphicon-edit"></span> Edit</a>
|
|
||||||
<a href="#url" class="btn btn-default btn-success btn-medium" data-toggle="confirm" data-target="#enable"><span class="glyphicon glyphicon-ok"></span> Enabled</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@@ -139,9 +94,6 @@
|
|||||||
|
|
||||||
</section> <!-- #wrapper -->
|
</section> <!-- #wrapper -->
|
||||||
|
|
||||||
{include file='includes/confirmation-modal.html' id="disable" message="{intl l='Do you really want to disable this element ?'}"}
|
|
||||||
{include file='includes/confirmation-modal.html' id="enable" message="{intl l='Do you really want to enable this element ?'}"}
|
|
||||||
|
|
||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,141 +4,146 @@
|
|||||||
|
|
||||||
{block name="main-content"}
|
{block name="main-content"}
|
||||||
<section id="wrapper" class="container">
|
<section id="wrapper" class="container">
|
||||||
|
{loop type="coupon" name="read_coupon" id={$couponId} backend_context="true"}
|
||||||
<nav>
|
<nav>
|
||||||
<ul class="breadcrumb">
|
<ul class="breadcrumb">
|
||||||
{include file="includes/coupon_breadcrumb.html"}
|
<li><a href="{url path='admin/home'}">{intl l='Home'}</a></li>
|
||||||
|
<li><a href="{url path='admin/coupon/'}">{intl l='Coupon'}</a></li>
|
||||||
|
<li>{$CODE}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
{loop type="coupon" name="read_coupon" id={$couponId} backend_context="true"}
|
|
||||||
<div class="page-header">
|
|
||||||
<h1>{intl l='Coupon : '}<small>{$CODE}</small></h1>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<section class="row">
|
<div class="page-header">
|
||||||
<div class="col-md-12 general-block-decorator">
|
<h1>{intl l='Coupon : '}<small>{$CODE}</small></h1>
|
||||||
|
|
||||||
<div class="alert alert-info">
|
|
||||||
<span class="glyphicon glyphicon-question-sign"></span>
|
|
||||||
{if !$IS_ENABLED}{intl l='This coupon is disabled, you can enable to the bottom of this form.'}{/if}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<table class="table table-striped">
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td>{intl l='Title'}</td>
|
|
||||||
<td>{$TITLE}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">
|
|
||||||
{if $IS_ENABLED}
|
|
||||||
<span class="label label-success">
|
|
||||||
{intl l="Is enabled"}
|
|
||||||
</span>
|
|
||||||
{else}
|
|
||||||
<span class="label label-warning">
|
|
||||||
{intl l="Is disabled"}
|
|
||||||
</span>
|
|
||||||
{/if}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">
|
|
||||||
{$TOOLTIP}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>{intl l='Expiration date'}</td>
|
|
||||||
<td>{$EXPIRATION_DATE} ({$DAY_LEFT_BEFORE_EXPIRATION} {intl l="days left"})</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>{intl l='Usage left'}</td>
|
|
||||||
<td>
|
|
||||||
{if $USAGE_LEFT}
|
|
||||||
<span class="label label-success">
|
|
||||||
{$USAGE_LEFT}
|
|
||||||
</span>
|
|
||||||
{else}
|
|
||||||
<span class="label label-warning">
|
|
||||||
0
|
|
||||||
</span>
|
|
||||||
{/if}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">{$SHORT_DESCRIPTION}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">{$DESCRIPTION}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">
|
|
||||||
{if $IS_CUMULATIVE}
|
|
||||||
<span class="label label-success">
|
|
||||||
{intl l="May be cumulative"}
|
|
||||||
</span>
|
|
||||||
{else}
|
|
||||||
<span class="label label-warning">
|
|
||||||
{intl l="Can't be cumulative"}
|
|
||||||
</span>
|
|
||||||
{/if}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">
|
|
||||||
{if $IS_REMOVING_POSTAGE}
|
|
||||||
<span class="label label-warning">
|
|
||||||
{intl l="Will remove postage"}
|
|
||||||
</span>
|
|
||||||
{else}
|
|
||||||
<span class="label label-success">
|
|
||||||
{intl l="Won't remove postage"}
|
|
||||||
</span>
|
|
||||||
{/if}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">
|
|
||||||
{if $IS_AVAILABLE_ON_SPECIAL_OFFERS}
|
|
||||||
<span class="label label-warning">
|
|
||||||
{intl l="Will be available on special offers"}
|
|
||||||
</span>
|
|
||||||
{else}
|
|
||||||
<span class="label label-success">
|
|
||||||
{intl l="Won't be available on special offers"}
|
|
||||||
</span>
|
|
||||||
{/if}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>{intl l='Amount'}</td>
|
|
||||||
<td>{$AMOUNT}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>{intl l='Application field'}</td>
|
|
||||||
<td>
|
|
||||||
<ul class="list-unstyled">
|
|
||||||
{foreach from=$APPLICATION_CONDITIONS item=rule name=rulesForeach}
|
|
||||||
{if !$smarty.foreach.rulesForeach.first}
|
|
||||||
<li><span class="label label-info">{intl l='And'}</span></li>
|
|
||||||
{/if}
|
|
||||||
<li>{$rule nofilter}</li>
|
|
||||||
{/foreach}
|
|
||||||
</ul>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>{intl l='Actions'}</td>
|
|
||||||
<td>
|
|
||||||
<a href="#url" class="btn btn-default btn-primary btn-medium"><span class="icon-edit icon-white"></span> {intl l='Edit'}</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
{/loop}
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
|
||||||
|
<section class="row">
|
||||||
|
<div class="col-md-12 general-block-decorator">
|
||||||
|
|
||||||
|
{if !$IS_ENABLED}
|
||||||
|
<div class="alert alert-info">
|
||||||
|
<span class="glyphicon glyphicon-question-sign"></span>
|
||||||
|
{intl l='This coupon is disabled, you can enable to the bottom of this form.'}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<table class="table table-striped">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>{intl l='Title'}</td>
|
||||||
|
<td>{$TITLE}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
{if $IS_ENABLED}
|
||||||
|
<span class="label label-success">
|
||||||
|
{intl l="Is enabled"}
|
||||||
|
</span>
|
||||||
|
{else}
|
||||||
|
<span class="label label-warning">
|
||||||
|
{intl l="Is disabled"}
|
||||||
|
</span>
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
{$TOOLTIP}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>{intl l='Amount'}</td>
|
||||||
|
<td>{$AMOUNT}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>{intl l='Expiration date'}</td>
|
||||||
|
<td>{$EXPIRATION_DATE} ({$DAY_LEFT_BEFORE_EXPIRATION} {intl l="days left"})</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>{intl l='Usage left'}</td>
|
||||||
|
<td>
|
||||||
|
{if $USAGE_LEFT}
|
||||||
|
<span class="label label-success">
|
||||||
|
{$USAGE_LEFT}
|
||||||
|
</span>
|
||||||
|
{else}
|
||||||
|
<span class="label label-warning">
|
||||||
|
0
|
||||||
|
</span>
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
{if $IS_CUMULATIVE}
|
||||||
|
<span class="label label-success">
|
||||||
|
{intl l="May be cumulative"}
|
||||||
|
</span>
|
||||||
|
{else}
|
||||||
|
<span class="label label-warning">
|
||||||
|
{intl l="Can't be cumulative"}
|
||||||
|
</span>
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
{if $IS_REMOVING_POSTAGE}
|
||||||
|
<span class="label label-warning">
|
||||||
|
{intl l="Will remove postage"}
|
||||||
|
</span>
|
||||||
|
{else}
|
||||||
|
<span class="label label-success">
|
||||||
|
{intl l="Won't remove postage"}
|
||||||
|
</span>
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
{if $IS_AVAILABLE_ON_SPECIAL_OFFERS}
|
||||||
|
<span class="label label-warning">
|
||||||
|
{intl l="Will be available on special offers"}
|
||||||
|
</span>
|
||||||
|
{else}
|
||||||
|
<span class="label label-success">
|
||||||
|
{intl l="Won't be available on special offers"}
|
||||||
|
</span>
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>{intl l='Application field'}</td>
|
||||||
|
<td>
|
||||||
|
<ul class="list-unstyled">
|
||||||
|
{foreach from=$APPLICATION_CONDITIONS item=rule name=rulesForeach}
|
||||||
|
{if !$smarty.foreach.rulesForeach.first}
|
||||||
|
<li><span class="label label-info">{intl l='And'}</span></li>
|
||||||
|
{/if}
|
||||||
|
<li>{$rule nofilter}</li>
|
||||||
|
{/foreach}
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">{$SHORT_DESCRIPTION}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">{$DESCRIPTION}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
<a href="{$urlEditCoupon}" class="btn btn-default btn-primary btn-medium">
|
||||||
|
<span class="icon-edit icon-white"></span> {intl l='Edit'}
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
{/loop}
|
||||||
</section> <!-- #wrapper -->
|
</section> <!-- #wrapper -->
|
||||||
|
|
||||||
{include file='includes/confirmation-modal.html' id="enable" message="{intl l='Do you really want to enable this element ?'}"}
|
{include file='includes/confirmation-modal.html' id="enable" message="{intl l='Do you really want to enable this element ?'}"}
|
||||||
|
|||||||
@@ -7,12 +7,14 @@
|
|||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<ul class="breadcrumb">
|
<ul class="breadcrumb">
|
||||||
{include file="includes/coupon_breadcrumb.html"}
|
<li><a href="{url path='admin/home'}">{intl l='Home'}</a></li>
|
||||||
|
<li><a href="{url path='admin/coupon/'}">{intl l='Coupon'}</a></li>
|
||||||
|
<li>{intl l='Update'} {$couponCode}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h1>Coupons : <small>Update a coupon</small></h1>
|
<h1>{intl l='Coupons : '}<small>{intl l='Update'} {$couponCode}</small></h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{form name="thelia.admin.coupon.creation"}
|
{form name="thelia.admin.coupon.creation"}
|
||||||
|
|||||||
@@ -11,118 +11,119 @@
|
|||||||
{/form_field}
|
{/form_field}
|
||||||
|
|
||||||
{form_field form=$form field='success_url'}
|
{form_field form=$form field='success_url'}
|
||||||
<input type="hidden" name="{$name}" value="{url path='/admin/coupon/read/{id}'}" />
|
<input type="hidden" name="{$name}" value="{url path='/admin/coupon/update/{id}'}" />
|
||||||
{/form_field}
|
{/form_field}
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<div class="form-group">
|
{form_field form=$form field='code'}
|
||||||
<label for="code">{intl l='Code :'}</label>
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
{form_field form=$form field='code'}
|
<label class="control-label" for="code">{intl l='Code :'}</label>
|
||||||
<input id="code" class="form-control" type="text" name="{$name}" value="{$value}" placeholder="{intl l='code'}">
|
<input id="code" class="form-control" type="text" name="{$name}" value="{$value}" placeholder="{intl l='code'}">
|
||||||
{if $error}{$message}{/if}
|
{if $error}{$message}{/if}
|
||||||
{/form_field}
|
</div>
|
||||||
</div>
|
{/form_field}
|
||||||
|
|
||||||
<div class="form-group">
|
{form_field form=$form field='title'}
|
||||||
<label for="title">{intl l='Title :'}</label>
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
{form_field form=$form field='title'}
|
<label for="title" class="control-label" >{intl l='Title :'}</label>
|
||||||
<input id="title" class="form-control" type="text" name="{$name}" value="{$value}" placeholder="{intl l='title'}">
|
<input id="title" class="form-control" type="text" name="{$name}" value="{$value}" placeholder="{intl l='title'}">
|
||||||
{if $error}{$message}{/if}
|
{if $error}{$message}{/if}
|
||||||
{/form_field}
|
</div>
|
||||||
</div>
|
{/form_field}
|
||||||
|
|
||||||
<div class="form-group">
|
{form_field form=$form field='isEnabled'}
|
||||||
<label for="enabled" class="checkbox">
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
{form_field form=$form field='isEnabled'}
|
<label for="enabled" class="checkbox control-label">
|
||||||
<input id="enabled" type="checkbox" name="{$name}" {if $value}value="1" checked{else}value="0"{/if} >
|
<input id="enabled" type="checkbox" name="{$name}" {if $value}value="1" checked{else}value="0"{/if} >
|
||||||
{if $error}{$message}{/if}
|
{if $error}{$message}{/if}
|
||||||
{/form_field}
|
{intl l='Is enabled ?'}
|
||||||
{intl l='Is enabled ?'}
|
</label>
|
||||||
</label>
|
</div>
|
||||||
</div>
|
{/form_field}
|
||||||
|
|
||||||
<div class="form-group">
|
{form_field form=$form field='isAvailableOnSpecialOffers'}
|
||||||
<label for="available-on-special-offers" class="checkbox">
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
{form_field form=$form field='isAvailableOnSpecialOffers'}
|
<label for="available-on-special-offers" class="checkbox control-label">
|
||||||
<input id="available-on-special-offers" type="checkbox" name="{$name}" {if $value}value="1" checked{else}value="0"{/if} >
|
<input id="available-on-special-offers" type="checkbox" name="{$name}" {if $value}value="1" checked{else}value="0"{/if} >
|
||||||
{if $error}{$message}{/if}
|
{if $error}{$message}{/if}
|
||||||
{/form_field}
|
{intl l='Is available on special offers ?'}
|
||||||
{intl l='Is available on special offers ?'}
|
</label>
|
||||||
</label>
|
</div>
|
||||||
</div>
|
{/form_field}
|
||||||
|
|
||||||
<div class="form-group">
|
{form_field form=$form field='isCumulative'}
|
||||||
<label for="cumulative" class="checkbox">
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
{form_field form=$form field='isCumulative'}
|
<label for="cumulative" class="checkbox control-label">
|
||||||
<input id="cumulative" type="checkbox" name="{$name}" {if $value}value="1" checked{else}value="0"{/if} >
|
<input id="cumulative" type="checkbox" name="{$name}" {if $value}value="1" checked{else}value="0"{/if} >
|
||||||
{if $error}{$message}{/if}
|
{if $error}{$message}{/if}
|
||||||
{/form_field}
|
{intl l='Is cumulative ?'}
|
||||||
{intl l='Is cumulative ?'}
|
</label>
|
||||||
</label>
|
</div>
|
||||||
</div>
|
{/form_field}
|
||||||
|
|
||||||
<div class="form-group">
|
{form_field form=$form field='isRemovingPostage'}
|
||||||
<label for="renoving-postage" class="checkbox">
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
{form_field form=$form field='isRemovingPostage'}
|
<label for="renoving-postage" class="checkbox control-label">
|
||||||
<input id="renoving-postage" type="checkbox" name="{$name}" {if $value}value="1" checked{else}value="0"{/if} >
|
<input id="renoving-postage" type="checkbox" name="{$name}" {if $value}value="1" checked{else}value="0"{/if} >
|
||||||
{if $error}{$message}{/if}
|
{if $error}{$message}{/if}
|
||||||
{/form_field}
|
{intl l='Is removing postage ?'}
|
||||||
{intl l='Is removing postage ?'}
|
</label>
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="expiration-date">{intl l='Expiration date :'}</label>
|
|
||||||
<div class="input-append date" data-date="12/02/2012" data-date-format="dd/mm/yyyy">
|
|
||||||
{form_field form=$form field='expirationDate'}
|
|
||||||
<input type="text" id="expiration-date" name="{$name}" value="{if $defaultDate}{$defaultDate}{else}{$value}{/if}">
|
|
||||||
{if $error}{$message}{/if}
|
|
||||||
{/form_field}
|
|
||||||
<span class="add-on"><span class="icon-th"></span></span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{/form_field}
|
||||||
|
|
||||||
<div class="form-group">
|
{form_field form=$form field='expirationDate'}
|
||||||
<label for="max-usage">{intl l='Max usage :'}</label>
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
<label for="is-unlimited" class="checkbox">
|
<label for="expiration-date" class="control-label">{intl l='Expiration date :'}</label>
|
||||||
<input id="is-unlimited" type="checkbox" name="is-unlimited" checked >
|
<div class="input-append date" data-date="12/02/2012" data-date-format="dd/mm/yyyy">
|
||||||
{intl l='Is unlimited ?'}
|
<input type="text" id="expiration-date" name="{$name}" class="form-control" value="{if $defaultDate}{$defaultDate}{else}{$value}{/if}">
|
||||||
</label>
|
{if $error}{$message}{/if}
|
||||||
{form_field form=$form field='maxUsage'}
|
<span class="add-on"><span class="icon-th"></span></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/form_field}
|
||||||
|
|
||||||
|
{form_field form=$form field='maxUsage'}
|
||||||
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
|
<label for="max-usage" class="control-label">{intl l='Max usage :'}</label>
|
||||||
|
<label for="is-unlimited" class="checkbox control-label">
|
||||||
|
<input id="is-unlimited" type="checkbox" name="is-unlimited" {if $error}{else}checked{/if} >
|
||||||
|
{intl l='Is unlimited ?'}
|
||||||
|
</label>
|
||||||
<input id="max-usage" type="text" class="form-control" name="{$name}" value="{$value}" placeholder="{intl l='max usage'}">
|
<input id="max-usage" type="text" class="form-control" name="{$name}" value="{$value}" placeholder="{intl l='max usage'}">
|
||||||
{if $error}{$message}{/if}
|
{if $error}{$message}{/if}
|
||||||
{/form_field}
|
</div>
|
||||||
</div>
|
{/form_field}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<div class="well clearfix">
|
<div class="well clearfix">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="form-group">
|
{form_field form=$form field='effect'}
|
||||||
<label for="effect">{intl l='Effect :'}</label>
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
{form_field form=$form field='effect'}
|
<label for="effect" class="control-label">{intl l='Effect :'}</label>
|
||||||
<select name="{$name}" value="{$value}" id="effect" class="col-md-12 form-control">
|
<select name="{$name}" value="{$value}" id="effect" class="col-md-12 form-control">
|
||||||
|
<option value="-1" data-description="">{intl l='Please select an effect'}</option>
|
||||||
{foreach from=$availableCoupons item=availableCoupon}
|
{foreach from=$availableCoupons item=availableCoupon}
|
||||||
<option value="{$availableCoupon.serviceId}" data-description="{$availableCoupon.toolTip}">{$availableCoupon.name}</option>
|
<option value="{$availableCoupon.serviceId}" data-description="{$availableCoupon.toolTip}" {if $value == $availableCoupon.serviceId}selected="selected"{/if}>{$availableCoupon.name}</option>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</select>
|
</select>
|
||||||
{if $error}{$message}{/if}
|
{if $error}{$message}{/if}
|
||||||
{/form_field}
|
<span id="effectToolTip" class="help-block">{$availableCoupons.0.toolTip}</span>
|
||||||
<span id="effectToolTip" class="help-block">{$availableCoupons.0.toolTip}</span>
|
</div>
|
||||||
</div>
|
{/form_field}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="form-group">
|
{form_field form=$form field='amount'}
|
||||||
<label for="amount">{intl l='Amount :'}</label>
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
{form_field form=$form field='amount'}
|
<label for="amount" class="control-label">{intl l='Amount :'}</label>
|
||||||
<input id="amount" type="text" class="form-control" name="{$name}" value="{$value}" placeholder="{intl l='14.50'}">
|
<input id="amount" type="text" class="form-control" name="{$name}" value="{$value}" placeholder="{intl l='14.50'}">
|
||||||
{if $error}{$message}{/if}
|
{if $error}{$message}{/if}
|
||||||
{/form_field}
|
</div>
|
||||||
</div>
|
{/form_field}
|
||||||
{*<div class="form-group">*}
|
{*<div class="form-group {if $error}has-error{/if}">*}
|
||||||
{*<label for="category">Category :</label>*}
|
{*<label for="category">Category :</label>*}
|
||||||
{*form_field form=$form field='category'*}
|
{*form_field form=$form field='category'*}
|
||||||
{*<select name="{$name}" value="{$value}" id="category" class="form-control">*}
|
{*<select name="{$name}" value="{$value}" id="category" class="form-control">*}
|
||||||
@@ -136,27 +137,27 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
{form_field form=$form field='shortDescription'}
|
||||||
<label for="short-description">{intl l='Short description :'}</label>
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
{form_field form=$form field='shortDescription'}
|
<label for="short-description" class="control-label">{intl l='Short description :'}</label>
|
||||||
<textarea id="short-description" name="{$name}" placeholder="{intl l='short description'}" class="span12" rows="5">{$value nofilter}</textarea>
|
<textarea id="short-description" name="{$name}" class="form-control" placeholder="{intl l='short description'}" class="span12" rows="5">{$value nofilter}</textarea>
|
||||||
{if $error}{$message}{/if}
|
{if $error}{$message}{/if}
|
||||||
{/form_field}
|
</div>
|
||||||
</div>
|
{/form_field}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
|
|
||||||
<div class="form-group">
|
{form_field form=$form field='description'}
|
||||||
<label for="description">{intl l='Long description :'}</label>
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
{form_field form=$form field='description'}
|
<label for="description" class="control-label">{intl l='Long description :'}</label>
|
||||||
<textarea id="description" name="{$name}" placeholder="{intl l='long description'}" class="form-control wysiwyg" rows="10">{$value nofilter}</textarea>
|
<textarea id="description" name="{$name}" placeholder="{intl l='long description'}" class="form-control wysiwyg" rows="10">{$value nofilter}</textarea>
|
||||||
{if $error}{$message}{/if}
|
{if $error}{$message}{/if}
|
||||||
{/form_field}
|
</div>
|
||||||
</div>
|
{/form_field}
|
||||||
|
|
||||||
<button type="submit" class="btn btn-default btn-primary">{intl l='Save'}</button>
|
<button type="submit" class="btn btn-default btn-primary">{intl l='Save your modifications'}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -186,16 +187,16 @@
|
|||||||
<section class="row">
|
<section class="row">
|
||||||
<div class="col-md-12 general-block-decorator clearfix">
|
<div class="col-md-12 general-block-decorator clearfix">
|
||||||
<a id="constraint-save-btn" title="{intl l='Save this rule'}" class="btn btn-default btn-primary pull-right">
|
<a id="constraint-save-btn" title="{intl l='Save this rule'}" class="btn btn-default btn-primary pull-right">
|
||||||
<span class="glyphicon glyphicon-plus-sign"></span>
|
<span class="glyphicon glyphicon-plus-sign"></span> {intl l='Save this rule'}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div id="rule-add-organizer" class="form-group col-md-2">
|
<div id="rule-add-organizer" class="form-group col-md-2">
|
||||||
<label for="type">{intl l='Condition type :'}</label>
|
<label for="type">{intl l='Condition type :'}</label>
|
||||||
<label class="radio">
|
<label class="radio">
|
||||||
<input type="radio" name="type" id="type" value="1" checked> {intl l='And'}
|
<input type="radio" name="type" class="form-control" id="type" value="1" checked> {intl l='And'}
|
||||||
</label>
|
</label>
|
||||||
<label class="radio">
|
<label class="radio">
|
||||||
<input type="radio" name="type" value="2"> {intl l='Or'}
|
<input type="radio" name="type" class="form-control" value="2"> {intl l='Or'}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
{* Breadcrumb for coupon browsing and editing *}
|
|
||||||
|
|
||||||
<li><a href="{url path='admin/home'}">Home</a></li>
|
|
||||||
<li><a href="{url path='admin/coupon'}">Coupon</a></li>
|
|
||||||
<li><a href="{url path="admin/coupon/browse/$ID"}">Browse</a></li>
|
|
||||||
Reference in New Issue
Block a user