Commit c8fd5491 authored by Яков's avatar Яков
Browse files

two

parent 48680c56
discount_phone:
class: sfDoctrineRouteCollection
options:
model: DiscountPhone
module: discount_phone
prefix_path: /discount_phone
column: id
with_wildcard_routes: true
discount:
class: sfDoctrineRouteCollection
options:
model: Discount
module: discount
prefix_path: /discount
column: id
with_wildcard_routes: true
notification_emails: notification_emails:
class: sfDoctrineRouteCollection class: sfDoctrineRouteCollection
options: options:
......
<?php <?php
if (!$form->isNew()) { if (!$form->isNew()) {
$discount = Doctrine::getTable('DiscountPhone')->findOneByOrderId($form->getObject()->getId());
$offers = $form->getObject()->getOffers(); $offers = $form->getObject()->getOffers();
if (count($offers) > 0) { if (count($offers) > 0) {
?> ?>
<div class="advanced_custom"> <div class="advanced_custom">
<?php
if ($discount) {
?>
<div>Использована скидка <?php echo $discount->getDiscount()->getTitle() . ' с ' . $discount->getActiveDiscount() . '%' ?></div>
<?php
}
?>
<div class="advanced_custom__h">Товарные предложения<sup>&nbsp;<?php echo count($offers);?></sup></div> <div class="advanced_custom__h">Товарные предложения<sup>&nbsp;<?php echo count($offers);?></sup></div>
<div class="content"> <div class="content">
<table width="100%" cellspacing="0" cellpadding="0"> <table width="100%" cellspacing="0" cellpadding="0">
...@@ -25,7 +17,7 @@ if (!$form->isNew()) { ...@@ -25,7 +17,7 @@ if (!$form->isNew()) {
<?php <?php
$total = 0; $total = 0;
foreach ($offers as $offer) { foreach ($offers as $offer) {
echo '<tr align="right"><td align="left">' . $offer['Offer']['Translation']['ru']['title'] . '</td><td>' . $offer['amount'] . '</td><td>' . number_format($offer['price']/$offer['amount'], 0, ',', ' ') . '&nbsp;₽</td><td><nobr>' . number_format($offer['price'], 0, ',', ' ') . '&nbsp;₽</nobr></td></tr>'; echo '<tr align="right"><td align="left">' . $offer['Offer']['Translation']['ru']['title'] . '</td><td>' . $offer['amount'] . '</td><td>' . number_format($offer['Offer']['price'], 0, ',', ' ') . '&nbsp;₽</td><td><nobr>' . number_format($offer['price'], 0, ',', ' ') . '&nbsp;₽</nobr></td></tr>';
$total += $offer['price']; $total += $offer['price'];
} }
echo '<tr class="advanced_custom__tr_divider_top"><td align="right" colspan="4"><nobr><b>Итого:&nbsp;</b>' . number_format($total, 0, ',', ' ') . '&nbsp;₽</nobr></td></tr>'; echo '<tr class="advanced_custom__tr_divider_top"><td align="right" colspan="4"><nobr><b>Итого:&nbsp;</b>' . number_format($total, 0, ',', ' ') . '&nbsp;₽</nobr></td></tr>';
......
<?php
require_once dirname(__FILE__).'/../lib/discountGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/discountGeneratorHelper.class.php';
/**
* discount actions.
*
* @package sf
* @subpackage discount
* @author Atma
* @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class discountActions extends autoDiscountActions
{
}
generator:
class: sfDoctrineGenerator
param:
model_class: Discount
theme: admin
non_verbose_templates: true
with_show: false
singular: ~
plural: ~
route_prefix: discount
with_doctrine_route: true
actions_base_class: sfActions
order: 45
config:
tabs:
0: { label: 'Скидки' }
1: { label: 'Телефоны', url_for: 'discount_phone/index?tab=1' }
actions: ~
fields:
id: {label: 'id'}
title: {label: Название}
utm: {label: 'UTM'}
comment: {label: 'Комментарий'}
url: {label: 'Ссылка', help: 'Для автоматической генерации оставьте поле пустым'}
created_at: {label: 'Дата создания'}
updated_at: {label: 'Дата изменения'}
phones: {label: ''}
list:
layout: ~
title: 'Скидки'
display: [title, utm, comment, url, _phones, created_at]
max_per_page: 100
object_actions:
_delete: ~
_edit: ~
search:
fields: false
export: false
filter:
class: false
form: ~
edit:
title: Редактирование скидки
new:
title: Добавление скидки
\ No newline at end of file
<?php
/**
* discount module configuration.
*
* @package sf
* @subpackage discount
* @author Atma
* @version SVN: $Id: configuration.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class discountGeneratorConfiguration extends BaseDiscountGeneratorConfiguration
{
public function getFormActions()
{
return array( '_list' => NULL, '_save' => NULL, '_save_and_add' => NULL, '_save_and_list' => NULL,);
}
public function getListObjectActions()
{
return array( '_edit' => NULL,);
}
public function getListBatchActions()
{
return array();
}
}
<?php
/**
* discount module helper.
*
* @package sf
* @subpackage discount
* @author Atma
* @version SVN: $Id: helper.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class discountGeneratorHelper extends BaseDiscountGeneratorHelper
{
}
<?php if ($field->isPartial()): ?>
<?php include_partial('discount_phone/'.$name, array('form' => $form, 'attributes' => $attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes)) ?>
<?php elseif ($field->isComponent()): ?>
<?php include_component('discount_phone', $name, array('form' => $form, 'attributes' => $attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes)) ?>
<?php else: ?>
<div class="<?php echo $class ?><?php $form[$name]->hasError() and print ' errors' ?>">
<div>
<?php $opts = $form[$name]->getWidget()->getOptions(); ?>
<?php if (key_exists('type', $opts) && $opts['type'] == 'checkbox'): ?>
<div class="content"><label><?php echo $form[$name]->render($attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes); ?><?php echo $label; ?></label></div>
<?php else: ?>
<span class="inline-label"><?php echo $form[$name]->renderLabel($label) ?></span>
<div class="content">
<?php echo $name == 'url' ? 'http://'.$this->context->getRequest()->getHost().'/ru/discount/' : ''; ?> <?php echo $form[$name]->render($attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes) ?><?php echo ($name == 'url' ? '/ ' : '') ?> <?php echo ( $name == 'url' && !$form->isNew() ? '<div style="margin-left: 10px !important;" class="pseudo_button lui_pseudo pseudo_button_file_wrapper only_root_button" >Скопировать в буфер обмена</div>' : ''); ?>
<?php echo $form[$name]->renderError() ?>
<?php if ($help): ?><span class="help"><?php echo __($help, array(), 'messages') ?></span><?php elseif ($help = $form[$name]->renderHelp()): ?><span class="help"><?php echo strip_tags($help, '<a><i>') ?></span><?php endif; ?>
</div>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<?php
if ($name == 'url') {
?>
<script>
$('.pseudo_button').on('click', function (e) {
try {
}
document.execCommand('copy');
} catch(err) {
console.log('Can`t copy');
})
</script>
<?php
}
?>
\ No newline at end of file
<?php
echo link_to('Перейти к телефонам', 'discount_phone/filter?discount_phone_filters[discount_id]=' . $discount->getId(), array("class" => "lui_pseudo", "onclick" => "event.stopPropagation();"));
?>
\ No newline at end of file
<?php
require_once dirname(__FILE__).'/../lib/discount_phoneGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/discount_phoneGeneratorHelper.class.php';
/**
* discount_phone actions.
*
* @package sf
* @subpackage discount_phone
* @author Atma
* @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class discount_phoneActions extends autoDiscount_phoneActions
{
}
generator:
class: sfDoctrineGenerator
param:
model_class: DiscountPhone
theme: admin
non_verbose_templates: true
with_show: false
singular: ~
plural: ~
route_prefix: discount_phone
with_doctrine_route: true
actions_base_class: sfActions
skip: true
config:
tabs:
0: { label: 'Скидки', url_for: 'discount/index?tab=0' }
1: { label: 'Телефоны' }
actions: ~
fields:
id: {label: 'id'}
phone: {label: 'Телефон'}
discount_id: {label: 'Скидка'}
active_discount: {label: 'Текущая скидка'}
order_id: {label: ' заказа'}
created_at: {label: 'Создана'}
updated_at: {label: 'Активирована'}
discount: {label: 'Скидка'}
list:
layout: ~
title: 'Скидки'
display: [phone, _discount, created_at, _updated_at]
max_per_page: 100
object_actions:
_delete: ~
_edit: ~
search:
fields: false
export: false
filter:
display: [discount_id]
form: ~
edit:
title: Редактирование телефона
new:
title: Добавление телефона
\ No newline at end of file
<?php
/**
* discount_phone module configuration.
*
* @package sf
* @subpackage discount_phone
* @author Atma
* @version SVN: $Id: configuration.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class discount_phoneGeneratorConfiguration extends BaseDiscount_phoneGeneratorConfiguration
{
public function getListBatchActions()
{
return array();
}
public function getListActions()
{
return array();
}
}
<?php
/**
* discount_phone module helper.
*
* @package sf
* @subpackage discount_phone
* @author Atma
* @version SVN: $Id: helper.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class discount_phoneGeneratorHelper extends BaseDiscount_phoneGeneratorHelper
{
}
<?php
echo $discount_phone->getDiscountId() ? $discount_phone->getDiscount()->getTitle() : '';
?>
\ No newline at end of file
<?php
echo $discount_phone->getOrderId() ? $discount_phone->getUpdatedAt() : '';
?>
\ No newline at end of file
...@@ -21,7 +21,6 @@ all: ...@@ -21,7 +21,6 @@ all:
class: sfSessionStorage class: sfSessionStorage
param: param:
session_name: om session_name: om
session_cookie_lifetime: 2592000
routing: routing:
class: sfPatternRouting class: sfPatternRouting
param: param:
......
...@@ -8,10 +8,6 @@ homepage: ...@@ -8,10 +8,6 @@ homepage:
requirements: requirements:
sf_culture: (?:ru|en) sf_culture: (?:ru|en)
homepage_discount:
url: /:sf_culture/discount/:url/
param: { module: main, action: index }
search: search:
url: /:sf_culture/search/ url: /:sf_culture/search/
param: { module: search, action: search } param: { module: search, action: search }
...@@ -28,10 +24,6 @@ review: ...@@ -28,10 +24,6 @@ review:
url: /:sf_culture/review/ url: /:sf_culture/review/
param: { module: review, action: index } param: { module: review, action: index }
discount:
url: /:sf_culture/discount/
param: { module: discount, action: index }
catalog: catalog:
url: /:sf_culture/catalog/ url: /:sf_culture/catalog/
param: { module: catalog, action: index } param: { module: catalog, action: index }
...@@ -56,10 +48,6 @@ basket_complete: ...@@ -56,10 +48,6 @@ basket_complete:
url: /:sf_culture/basket/complete/ url: /:sf_culture/basket/complete/
param: { module: basket, action: complete } param: { module: basket, action: complete }
basket_check_discount:
url: /:sf_culture/basket/check_discount/
param: { module: discount, action: check_discount }
catalog_show_cat: catalog_show_cat:
url: /catalog/:alias/ url: /catalog/:alias/
param: { module: catalog, action: show_cat } param: { module: catalog, action: show_cat }
...@@ -96,10 +84,6 @@ uploader: ...@@ -96,10 +84,6 @@ uploader:
url: /uploader/ url: /uploader/
param: { module: main, action: uploader } param: { module: main, action: uploader }
check_discount_term:
url: /check_discount_term/
param: { module: discount, action: check_discount_term }
page_show: page_show:
url: /:sf_culture/:alias/ url: /:sf_culture/:alias/
class: sfDoctrineRoute class: sfDoctrineRoute
......
...@@ -6,7 +6,7 @@ prod: ...@@ -6,7 +6,7 @@ prod:
dev: dev:
.settings: .settings:
error_reporting: <?php echo (E_ALL | E_STRICT)."\n" ?> error_reporting: <?php echo (E_ALL | E_STRICT)."\n" ?>
web_debug: true web_debug: false
cache: true cache: true
etag: false etag: false
logging_enabled: false logging_enabled: false
......
...@@ -4,18 +4,18 @@ default: ...@@ -4,18 +4,18 @@ default:
metas: metas:
robots: 'index, follow' robots: 'index, follow'
stylesheets: stylesheets:
- 'fonts.css?deploy=1519103092' - 'fonts.css?deploy=1519103100'
- 'g.css?deploy=1519103094' - 'g.css?deploy=1519103101'
- 'p.css?deploy=1519103095' - 'p.css?deploy=1519103104'
- 'a.css?deploy=1519103092' - 'a.css?deploy=1519103102'
- 'nouislider.css?deploy=1519103100' - 'nouislider.css?deploy=1519103100'
javascripts: javascripts:
- 'jquery-2.1.4.min.js?deploy=1519103092' - 'jquery-2.1.4.min.js?deploy=1519103100'
- 'jquery.plugins.js?deploy=1519103092' - 'jquery.plugins.js?deploy=1519103100'
- 'jquery.cycle2.min.js?deploy=1519103092' - 'jquery.cycle2.min.js?deploy=1519103100'
- 'jquery.cycle2.swipe.js?deploy=1519103092' - 'jquery.cycle2.swipe.js?deploy=1519103100'
- 'jquery.cycle2.carousel.min.js' - 'jquery.cycle2.carousel.min.js?deploy=1519103100'
- 'nouislider.js?deploy=1519103092' - 'nouislider.js?deploy=1519103100'
- 'init.d.js?deploy=1519103092' - 'init.d.js?deploy=1519103100'
has_layout: true has_layout: true
layout: layout layout: layout
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment