first commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
use_helper('stCategory');
|
||||
|
||||
$defaults = array();
|
||||
|
||||
if ($sf_request->hasErrors() && $sf_request->hasParameter('categories'))
|
||||
{
|
||||
$parameters = $sf_request->getParameter('categories');
|
||||
$defaults = stJQueryToolsHelper::parseTokensFromRequest($parameters);
|
||||
}
|
||||
elseif (!$discount->isNew())
|
||||
{
|
||||
$defaults = DiscountHasCategoryPeer::doSelectCategoriesForTokenInput($discount);
|
||||
}
|
||||
|
||||
echo category_picker_input_tag('categories', $defaults, array('show_default' => false, 'allow_assign_parents_only' => true));
|
||||
?>
|
||||
<script>
|
||||
jQuery(function($) {
|
||||
$('.all_products').change(function() {
|
||||
if ($(this).prop('checked')) {
|
||||
$('#sf_fieldset_kategorie_i_producenci').hide();
|
||||
} else {
|
||||
$('#sf_fieldset_kategorie_i_producenci').show();
|
||||
}
|
||||
}).change();
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php echo $discount_coupon_code->getCode() ?>
|
||||
<?php echo input_hidden_tag('discount_coupon_code[code]', $discount_coupon_code->getCode()) ?>
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php echo input_tag ('discount[conditions][from_amount]', stPrice::round($discount->getCondition('from_amount', 0)), array('size' => 7, 'class' => 'support')) ?> <?php echo stCurrency::getDefault()->getShortcut() ?>
|
||||
|
||||
<?php echo st_price_add_format_behavior('discount_conditions_from_amount'); ?>
|
||||
@@ -0,0 +1 @@
|
||||
<?php echo input_tag('discount_coupon_code[discount]', $discount_coupon_code->getDiscount(), array('size' => 3)) ?> %
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
use_helper('stCategory');
|
||||
|
||||
$defaults = array();
|
||||
|
||||
if ($sf_request->hasErrors() && $sf_request->hasParameter('categories'))
|
||||
{
|
||||
$parameters = $sf_request->getParameter('categories');
|
||||
$defaults = stJQueryToolsHelper::parseTokensFromRequest($parameters);
|
||||
}
|
||||
elseif (!$discount_coupon_code->isNew())
|
||||
{
|
||||
$defaults = DiscountCouponCodeHasCategoryPeer::doSelectCategoriesForTokenInput($discount_coupon_code);
|
||||
}
|
||||
|
||||
echo category_picker_input_tag('categories', $defaults, array('show_default' => false, 'allow_assign_parents_only' => true));
|
||||
?>
|
||||
<script>
|
||||
jQuery(function($) {
|
||||
$('.all_products').change(function() {
|
||||
if ($(this).prop('checked')) {
|
||||
$('#sf_fieldset_kategorie_i_producenci').hide();
|
||||
} else {
|
||||
$('#sf_fieldset_kategorie_i_producenci').show();
|
||||
}
|
||||
}).change();
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
use_helper('stProducer');
|
||||
|
||||
$defaults = array();
|
||||
|
||||
if ($sf_request->hasErrors() && $sf_request->hasParameter('producers'))
|
||||
{
|
||||
$parameters = $sf_request->getParameter('producers');
|
||||
$defaults = stJQueryToolsHelper::parseTokensFromRequest($parameters);
|
||||
}
|
||||
elseif (!$discount_coupon_code->isNew())
|
||||
{
|
||||
$defaults = DiscountCouponCodeHasProducerPeer::doSelectProducerForTokenInput($discount_coupon_code);
|
||||
}
|
||||
|
||||
echo producer_picker_input_tag('producers', $defaults);
|
||||
@@ -0,0 +1 @@
|
||||
<?php echo select_tag('discount_range[discount_id]', options_for_select(DiscountRangePeer::getDiscountsForSelect(), $discount_range->getDiscountId()))?>
|
||||
@@ -0,0 +1 @@
|
||||
<?php echo input_tag('filters[generated_for]', isset($filters['generated_for']) ? $filters['generated_for'] : null) ?>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php if ($discount_coupon_code->getOrderId() && $discount_coupon_code->getOrder()): ?>
|
||||
<a href="<?php echo st_url_for('@stOrder?action=edit&id='.$discount_coupon_code->getOrderId()) ?>"><?php echo __('Zamówienie') ?>: <?php echo $discount_coupon_code->getOrder()->getNumber() ?></a><br>
|
||||
<a href="<?php echo st_url_for('@stUser?action=edit&id='.$discount_coupon_code->getOrder()->getSfGuardUserId()) ?>"><?php echo $discount_coupon_code->getOrder()->getOptClientEmail() ?></a>
|
||||
<?php endif ?>
|
||||
@@ -0,0 +1 @@
|
||||
<?php echo $discount_coupon_code->getDiscount() ?>%
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php echo link_to(st_admin_get_icon('collapse'), 'stDiscountBackend/list?id='.$discount->getId().'&pos=-1')?>
|
||||
<?php echo link_to(st_admin_get_icon('expand'), 'stDiscountBackend/list?id='.$discount->getId().'&pos=1')?>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
use_helper('stProducer');
|
||||
|
||||
$defaults = array();
|
||||
|
||||
if ($sf_request->hasErrors() && $sf_request->hasParameter('producers'))
|
||||
{
|
||||
$parameters = $sf_request->getParameter('producers');
|
||||
$defaults = stJQueryToolsHelper::parseTokensFromRequest($parameters);
|
||||
}
|
||||
elseif (!$discount->isNew())
|
||||
{
|
||||
$defaults = DiscountHasProducerPeer::doSelectProducerForTokenInput($discount);
|
||||
}
|
||||
|
||||
echo producer_picker_input_tag('producers', $defaults);
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
// auto-generated by sfPropelAdmin
|
||||
// date: 2009/10/28 11:49:18
|
||||
?>
|
||||
<?php if ($sf_request->getError('delete')): ?>
|
||||
<div class="form-errors">
|
||||
<h2><?php echo __('Błąd podczas usuwania.', array('%name%' => 'Product')) ?></h2>
|
||||
<dl>
|
||||
<dt><?php echo __('Uwaga:')?></dt>
|
||||
<dd><?php echo $sf_request->getError('delete') ?></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<?php elseif ($sf_flash->has('notice')): ?>
|
||||
<div class="save-ok">
|
||||
<h2><?php echo __($sf_flash->get('notice')) ?></h2>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
// auto-generated by sfPropelAdmin
|
||||
// date: 2009/10/28 11:49:18
|
||||
?>
|
||||
<?php if ($sf_request->getError('delete')): ?>
|
||||
<div class="form-errors">
|
||||
<h2><?php echo __('Błąd podczas usuwania.', array('%name%' => 'Product')) ?></h2>
|
||||
<dl>
|
||||
<dt><?php echo __('Uwaga:')?></dt>
|
||||
<dd><?php echo $sf_request->getError('delete') ?></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<?php elseif ($sf_flash->has('notice')): ?>
|
||||
<div class="save-ok">
|
||||
<h2><?php echo __($sf_flash->get('notice')) ?></h2>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($sf_flash->has('warning')): ?>
|
||||
<div class="form-errors">
|
||||
<h2><?php echo __($sf_flash->get('warning')) ?></h2>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php echo select_tag('discount[type]', options_for_select(DiscountPeer::getDiscountTypes(), $discount->getType()), array('class' => 'support')) ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function($) {
|
||||
var discount_type = $('#discount_type');
|
||||
var discount_all_clients = $('#discount_all_clients');
|
||||
var discount_allow_anonymous_clients = $('#discount_allow_anonymous_clients');
|
||||
var discount_auto_active = $('#discount_auto_active');
|
||||
|
||||
discount_type.change(function() {
|
||||
var value = this.options[this.selectedIndex].value;
|
||||
|
||||
if (value == 'S')
|
||||
{
|
||||
$('.row_product').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('.row_product').hide();
|
||||
}
|
||||
|
||||
if (value == 'S' || value == 'O')
|
||||
{
|
||||
$('#sf_fieldset_kategorie_i_producenci').hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#sf_fieldset_kategorie_i_producenci').show();
|
||||
}
|
||||
|
||||
var all_products = $('#discount_all_products');
|
||||
|
||||
if (value != 'O') {
|
||||
$('.row_conditions').hide();
|
||||
all_products.attr('disabled', value == 'S').attr('checked', value != 'S' ? all_products.get(0).defaultChecked : false);
|
||||
} else {
|
||||
$('.row_conditions').show();
|
||||
$('#discount_all_products').attr('checked', true).attr('disabled', true);
|
||||
}
|
||||
});
|
||||
|
||||
discount_all_clients.change(function() {
|
||||
discount_auto_active.prop('disabled', this.checked);
|
||||
});
|
||||
|
||||
discount_allow_anonymous_clients.change(function() {
|
||||
discount_auto_active.prop('disabled', this.checked);
|
||||
});
|
||||
|
||||
discount_auto_active.change(function() {
|
||||
discount_all_clients.prop('disabled', this.checked);
|
||||
discount_allow_anonymous_clients.prop('disabled', this.checked);
|
||||
});
|
||||
|
||||
discount_all_clients.change();
|
||||
discount_allow_anonymous_clients.change();
|
||||
discount_auto_active.change();
|
||||
discount_type.change();
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1 @@
|
||||
<?php echo select_tag('filters[type_label]', options_for_select(DiscountPeer::getDiscountTypes(), isset($filters['type_label']) ? $filters['type_label'] : null, array('include_custom' => '---')), array('class' => 'support')) ?>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
if ($discount_coupon_code->getUsed() > 0)
|
||||
{
|
||||
echo st_link_to($discount_coupon_code->getUsed(), '@stOrder?action=list&filters[discount_coupon_code]='.$discount_coupon_code->getCode());
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $discount_coupon_code->getUsed();
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* @var Discount $value
|
||||
* @var Discount $entity
|
||||
*/
|
||||
if ($type == 'edit')
|
||||
{
|
||||
echo st_admin_table_start([
|
||||
['label' => __('Klient detaliczny')],
|
||||
['label' => __('Klient hurtowy')],
|
||||
['label' => __('Rodzaj')],
|
||||
]);
|
||||
|
||||
echo "<tbody>";
|
||||
echo "<tr>";
|
||||
|
||||
echo content_tag('td', st_admin_optional_input('discount[value]', $value->getValue(), ['size' => 8, 'disabled' => null === $value->getValue()]));
|
||||
echo content_tag('td', st_admin_optional_input('discount[wholesale_value]', $value->getWholesaleValue(), ['size' => 8, 'disabled' => null === $value->getWholesaleValue()]));
|
||||
echo content_tag('td', st_discount_type_select_tag('discount[price_type]', $value->getPriceType()));
|
||||
|
||||
echo "</tr>";
|
||||
echo "</tbody>";
|
||||
|
||||
echo st_admin_table_end();
|
||||
}
|
||||
elseif (null !== $entity->getValue())
|
||||
{
|
||||
echo $entity->getPriceType() == Discount::PERCENT_TYPE ? $entity->getValue().'%' : st_currency_default_format($entity->getValue());
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ($type == 'edit'): ?>
|
||||
<script>
|
||||
jQuery(function($) {
|
||||
const fields = $('#discount_value, #discount_wholesale_value');
|
||||
|
||||
fields.change(function() {
|
||||
const input = $(this);
|
||||
let value = input.val();
|
||||
value = stPrice.fixNumberFormat(value, $('#discount_price_type').val() == '<?php echo Discount::PERCENT_TYPE ?>' ? 0 : 2);
|
||||
input.val(value);
|
||||
|
||||
if (input.is('#discount_value')) {
|
||||
$('#discount_allow_anonymous_clients').prop('disabled', !input.prop('checked'));
|
||||
}
|
||||
}).change();
|
||||
|
||||
$('#discount_price_type').change(function() {
|
||||
fields.change();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php endif ?>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
if (null !== $entity->getWholesaleValue())
|
||||
{
|
||||
echo $entity->getPriceType() == Discount::PERCENT_TYPE ? $entity->getWholesaleValue().'%' : st_currency_default_format($entity->getWholesaleValue());
|
||||
}
|
||||
Reference in New Issue
Block a user