126 lines
7.5 KiB
PHP
126 lines
7.5 KiB
PHP
<?php use_helper('I18N', 'stAdminGenerator', 'stJQueryTools', 'stPrice'); ?>
|
|
<?php st_include_partial('stReview/header', array('title' => __('Konfiguracja'), 'culture' => $config -> getCulture(), 'route' => 'stReview/config')); ?>
|
|
<?php st_include_partial('stAdminGenerator/message'); ?>
|
|
<?php st_view_slot_start('application-menu') ?>
|
|
<?php st_include_component('stReview', 'listMenu') ?>
|
|
<?php st_view_slot_end() ?>
|
|
|
|
<?php echo form_tag('stReview/config?culture=' . $config -> getCulture(), array('id' => 'sf_admin_config_form', 'name' => 'sf_admin_config_form', 'class' => 'admin_form')); ?>
|
|
|
|
<fieldset>
|
|
<h2><?php echo __('Ustawienie wysyłania maili') ?></h2>
|
|
|
|
<div class="content">
|
|
|
|
<?php echo st_admin_get_form_field('config[auto_send]', __('Wysyłaj przy zmianie statusu'), 1, 'checkbox_tag', array('checked' => $config->get('auto_send'), 'help' => __('Wiadomości będą automatycznie wysyłane po zmianie statusu zamówienia.', null, 'stReview'))) ?>
|
|
|
|
<div class="form-row">
|
|
<?php echo label_for('config[order_status_type]', __('Dla statusu zamówienia'), ''); ?>
|
|
<div class="field">
|
|
<?php echo select_tag('config[order_status_type]', options_for_select($select_options, $config->get("order_status_type")), array('class' => 'support')) ?>
|
|
<br class="st_clear_all" />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
|
|
<?php echo st_admin_get_form_field('config[cron_send]', __('Wysyłaj z opóźnieniem'), 1, 'checkbox_tag', array('checked' => $config->get('cron_send'), 'help' => __('Wiadomości będą automatycznie wysyłane korzystając z harmonogramu zadań.'))) ?>
|
|
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
<label for="config_send_type"><?php echo __('Wysyłaj po'); ?><a class="help" title="<?php echo __('Wiadomość zostanie wysłana po X dniach od zmiany statusu zamówienia.') ?>" href="#"></a></label>
|
|
<div class="field">
|
|
<select class="support" id="config_cron_du_date" name="config[cron_du_date]">
|
|
<option value="3" <?php if($config -> get('cron_du_date')==3): ?> selected="selected" <?php endif; ?>><?php echo __('3 dniach'); ?></option>
|
|
<option value="7" <?php if($config -> get('cron_du_date')==7): ?> selected="selected" <?php endif; ?>><?php echo __('7 dniach'); ?></option>
|
|
<option value="21" <?php if($config -> get('cron_du_date')==21): ?> selected="selected" <?php endif; ?>><?php echo __('21 dniach'); ?></option>
|
|
</select>
|
|
<br class="st_clear_all">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
<label for="config_send_type"><?php echo __('Wysyłaj dla'); ?><a class="help" title="<?php echo __('W przypadku większej ilości produktów w zamówieniu, automatyczna prośba o recenzę będzie wysyłana do jednego produktu.') ?>" href="#"></a></label>
|
|
<div class="field">
|
|
<select class="support" id="config_send_type" name="config[send_type]">
|
|
<option value="1" <?php if($config -> get('send_type')==1): ?> selected="selected" <?php endif; ?>><?php echo __('Dla najdroższego produktu'); ?></option>
|
|
<option value="2" <?php if($config -> get('send_type')==2): ?> selected="selected" <?php endif; ?>><?php echo __('Dla pierwszego'); ?></option>
|
|
</select>
|
|
<br class="st_clear_all">
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="form-row">
|
|
<?php echo label_for('config[description]', __('Treść wiadomości'), ''); ?>
|
|
<div class="field">
|
|
<?php echo textarea_tag('config[description]', $config -> get('description', null, true), array('size' => '100x3')); ?>
|
|
<br class="st_clear_all" />
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</fieldset>
|
|
|
|
<?php echo st_get_admin_actions_head('style="margin-top: 10px; float: right"'); ?>
|
|
<?php echo st_get_admin_action('save', __('Zapisz', null, 'stAdminGeneratorPlugin'), null, array('name' => 'save')); ?>
|
|
<?php echo st_get_admin_actions_foot(); ?>
|
|
</form>
|
|
|
|
<?php echo st_get_admin_foot(); ?>
|
|
|
|
|
|
<script type="text/javascript">
|
|
jQuery(function($) {
|
|
checkActive();
|
|
$('#config_auto_send').change(function() {
|
|
checkActive();
|
|
});
|
|
|
|
$('#config_cron_send').change(function() {
|
|
checkActive();
|
|
});
|
|
|
|
function checkActive()
|
|
{
|
|
if ($('#config_auto_send').attr('checked')) {
|
|
|
|
$( "#config_order_status_type" ).prop( "disabled", false );
|
|
$( "#config_order_status_type" ).trigger("chosen:updated");
|
|
|
|
$( "#config_cron_send" ).prop( "disabled", false );
|
|
|
|
$( "#config_cron_du_date" ).prop( "disabled", false );
|
|
$( "#config_cron_du_date" ).trigger("chosen:updated");
|
|
|
|
|
|
if ($('#config_cron_send').attr('checked') && $('#config_auto_send').attr('checked')) {
|
|
$( "#config_cron_du_date" ).prop( "disabled", false );
|
|
} else {
|
|
$( "#config_cron_du_date" ).prop( "disabled", true );
|
|
}
|
|
|
|
$( "#config_cron_du_date" ).trigger("chosen:updated");
|
|
|
|
|
|
} else {
|
|
|
|
$( "#config_order_status_type" ).prop( "disabled", true );
|
|
$( "#config_order_status_type" ).trigger("chosen:updated");
|
|
|
|
$( "#config_cron_send" ).prop( "disabled", true );
|
|
|
|
if ($('#config_cron_send').attr('checked') && $('#config_auto_send').attr('checked')) {
|
|
$( "#config_cron_du_date" ).prop( "disabled", false );
|
|
} else {
|
|
$( "#config_cron_du_date" ).prop( "disabled", true );
|
|
}
|
|
|
|
$( "#config_cron_du_date" ).trigger("chosen:updated");
|
|
|
|
}
|
|
}
|
|
|
|
});
|
|
</script>
|