first commit
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
<?php use_javascript('stPrice.js') ?>
|
||||
<?php if($paczkomaty_pack->isNew()):?>
|
||||
<div class="row">
|
||||
<label for="paczkomaty_pack_pack_type">
|
||||
<?php echo __('Rozmiar', array(), 'stPaczkomatyBackend');?>:
|
||||
</label>
|
||||
<?php echo select_tag('paczkomaty_pack[pack_type]', options_for_select(array('A' => 'A (8 x 38 x 64 cm)', 'B' => 'B (19 x 38 x 64 cm)', 'C' => 'C (41 x 38 x 64 cm)'), !$sf_request->hasParameter('paczkomaty_pack[pack_type]') ? $paczkomaty_pack->getPackType() : $sf_request->getParameter('paczkomaty_pack[pack_type]')));?>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<label for="paczkomaty_pack_insurance">
|
||||
<?php echo __('Kwota ubezpieczenia', array(), 'stPaczkomatyBackend');?>:
|
||||
</label>
|
||||
<?php echo st_admin_optional_input('paczkomaty_pack[insurance]', $paczkomaty_pack->getInsurance() ? $paczkomaty_pack->getInsurance() : $paczkomaty_pack->getInsurance(true), array('size' => 7, 'disabled' => !$paczkomaty_pack->getInsurance() && !$paczkomaty_pack->hasAllegroInsurance())); ?> PLN
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<label for="paczkomaty_pack_cash_on_delivery">
|
||||
<?php echo __('Kwota pobrania', array(), 'stPaczkomatyBackend');?>:
|
||||
</label>
|
||||
<?php echo st_admin_optional_input('paczkomaty_pack[cash_on_delivery]', $paczkomaty_pack->getCashOnDelivery() ? $paczkomaty_pack->getCashOnDelivery() : $paczkomaty_pack->getCashOnDelivery(true), array('size' => 7, 'disabled' => !$paczkomaty_pack->getCashOnDelivery() && ($sf_request->getMethod() == sfRequest::POST || !$paczkomaty_pack->hasCashOnDelivery()))); ?> PLN
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<label for="paczkomaty_pack_description">
|
||||
<?php echo __('Numer referencyjny', array(), 'stPaczkomatyBackend');?>:
|
||||
</label>
|
||||
<?php echo input_tag('paczkomaty_pack[description]', !$sf_request->hasParameter('paczkomaty_pack[description]') ? $paczkomaty_pack->getDescription() : $sf_request->getParameter('paczkomaty_pack[description]'), array('size' => 80));?>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
jQuery(function($) {
|
||||
$(document).ready(function() {
|
||||
$('#paczkomaty_pack_insurance').change(function() {
|
||||
$(this).val(stPrice.fixNumberFormat($(this).val()));
|
||||
});
|
||||
$('#paczkomaty_pack_cash_on_delivery').change(function() {
|
||||
$(this).val(stPrice.fixNumberFormat($(this).val()));
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php else:?>
|
||||
<div class="row">
|
||||
<label for="paczkomaty_pack_pack_type">
|
||||
<?php echo __('Rozmiar', array(), 'stPaczkomatyBackend');?>:
|
||||
</label>
|
||||
<?php echo $paczkomaty_pack->getPackType();?>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<label for="paczkomaty_pack_insurance">
|
||||
<?php echo __('Kwota ubezpieczenia', array(), 'stPaczkomatyBackend');?>:
|
||||
</label>
|
||||
<?php echo stPrice::round($paczkomaty_pack->getInsurance()); ?> PLN
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<label for="paczkomaty_pack_cash_on_delivery">
|
||||
<?php echo __('Kwota pobrania', array(), 'stPaczkomatyBackend');?>:
|
||||
</label>
|
||||
<?php echo stPrice::round($paczkomaty_pack->getCashOnDelivery()); ?> PLN
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<label for="paczkomaty_pack_description">
|
||||
<?php echo __('Numer referencyjny', array(), 'stPaczkomatyBackend');?>:
|
||||
</label>
|
||||
<?php echo $paczkomaty_pack->getDescription();?>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @var PaczkomatyPack $paczkomaty_pack
|
||||
*/
|
||||
$currency = 'PLN';
|
||||
|
||||
if (!$paczkomaty_pack->isAdminGeneratorPlainField())
|
||||
{
|
||||
$cashOnDelivery = $paczkomaty_pack->getCashOnDelivery() ? $paczkomaty_pack->getCashOnDelivery() : $paczkomaty_pack->getCashOnDelivery(true);
|
||||
|
||||
echo st_admin_optional_input('paczkomaty_pack[cash_on_delivery]', st_price_format($cashOnDelivery), array(
|
||||
'size' => 7,
|
||||
'disabled' => !$paczkomaty_pack->getCashOnDelivery() && ($sf_request->getMethod() == sfRequest::POST || !$paczkomaty_pack->hasCashOnDelivery())
|
||||
)) . ' ' . $currency;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo stPrice::round($paczkomaty_pack->getCashOnDelivery()) . ' ' . $currency;
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript" language="javascript">
|
||||
jQuery(function($) {
|
||||
$('#paczkomaty_pack_cash_on_delivery').change(function() {
|
||||
$(this).val(stPrice.fixNumberFormat($(this).val()));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
use_helper('stPaczkomaty');
|
||||
$paczkomaty_params = array();
|
||||
|
||||
if ($paczkomaty_pack->hasAllegroTransactionId())
|
||||
{
|
||||
$paczkomaty_params['function'] = 'AllegroParcelCollect';
|
||||
}
|
||||
else
|
||||
{
|
||||
$paczkomaty_params['function'] = 'ParcelCollect';
|
||||
}
|
||||
|
||||
if ($paczkomaty_pack->hasCashOnDelivery())
|
||||
{
|
||||
$paczkomaty_params['paymentavailable'] = 't';
|
||||
}
|
||||
|
||||
?>
|
||||
<?php if($paczkomaty_pack->isNew()):?>
|
||||
<?php echo input_hidden_tag('order', $sf_request->getParameter('order'));?>
|
||||
<div class="row">
|
||||
<label for="paczkomaty_pack_customer_email">
|
||||
<?php echo __('Adres e-mail odbiorcy', array(), 'stPaczkomatyBackend');?>:
|
||||
</label>
|
||||
<div class="field<?php if ($sf_request->hasError('paczkomaty_pack{customer_email}')):?> form-error<?php endif; ?>">
|
||||
<?php if ($sf_request->hasError('paczkomaty_pack{customer_email}')):?>
|
||||
<?php echo form_error('paczkomaty_pack{customer_email}', array('class' => 'form-error-msg'));?>
|
||||
<?php endif;?>
|
||||
<?php echo input_tag('paczkomaty_pack[customer_email]', !$sf_request->hasParameter('paczkomaty_pack[customer_email]') ? $paczkomaty_pack->getCustomerEmail() : $sf_request->getParameter('paczkomaty_pack[customer_email]'), array('size' => 30));?>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="paczkomaty_pack_customer_phone">
|
||||
<?php echo __('Numer komórkowy odbiorcy', array(), 'stPaczkomatyBackend');?>:
|
||||
</label>
|
||||
<div class="field<?php if ($sf_request->hasError('paczkomaty_pack{customer_phone}')): ?> form-error<?php endif;?>">
|
||||
<?php if ($sf_request->hasError('paczkomaty_pack{customer_phone}')):?>
|
||||
<?php echo form_error('paczkomaty_pack{customer_phone}', array('class' => 'form-error-msg'));?>
|
||||
<?php endif;?>
|
||||
<?php echo input_tag('paczkomaty_pack[customer_phone]', !$sf_request->hasParameter('paczkomaty_pack[customer_phone]') ? $paczkomaty_pack->getCustomerPhone() : $sf_request->getParameter('paczkomaty_pack[customer_phone]'), array('size' => 15));?>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="paczkomaty_pack_customer_paczkomat">
|
||||
<?php echo __('Paczkomat odbiorcy', array(), 'stPaczkomatyBackend');?>:
|
||||
</label>
|
||||
<?php show_paczkomaty_dropdown_list('paczkomaty_pack[customer_paczkomat]', $paczkomaty_pack->getCustomerPaczkomat(), array('paczkomaty' => $paczkomaty_params));?>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div class="row">
|
||||
<label for="paczkomaty_pack_customer_email">
|
||||
<?php echo __('Adres e-mail odbiorcy', array(), 'stPaczkomatyBackend');?>:
|
||||
</label>
|
||||
<?php echo $paczkomaty_pack->getCustomerEmail();?>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="paczkomaty_pack_customer_phone">
|
||||
<?php echo __('Numer komórkowy odbiorcy', array(), 'stPaczkomatyBackend');?>:
|
||||
</label>
|
||||
<?php echo $paczkomaty_pack->getCustomerPhone();?>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="paczkomaty_pack_customer_paczkomat">
|
||||
<?php echo __('Paczkomat odbiorcy', array(), 'stPaczkomatyBackend');?>:
|
||||
</label>
|
||||
<div id="st-paczkomaty-customer-machine">
|
||||
<img src="/images/backend/icons/indicator.gif" alt="loading..." />
|
||||
</div>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
if (!$value->isAdminGeneratorPlainField())
|
||||
{
|
||||
echo st_countries_select_tag($name, $value->$method(), $options);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $value->$method() ? CountriesPeer::retrieveByIsoA2($value->$method()) : '-';
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
if (!$paczkomaty_pack->isAdminGeneratorPlainField())
|
||||
{
|
||||
echo input_tag('paczkomaty_pack[customer_email]', $paczkomaty_pack->getCustomerEmail(), array('size' => 80));
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $paczkomaty_pack->getCustomerEmail();
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
if (!$paczkomaty_pack->isAdminGeneratorPlainField())
|
||||
{
|
||||
echo input_tag('paczkomaty_pack[customer_phone]', $paczkomaty_pack->getCustomerPhone(), array('size' => 80));
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $paczkomaty_pack->getCustomerPhone();
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php echo st_inpost_point_select_tag('paczkomaty_pack[customer_pickup_point]', $paczkomaty_pack->getCustomerPickupPoint(), array (
|
||||
'title' => 'Paczkomat odbiorcy',
|
||||
'disabled' => $paczkomaty_pack->isAdminGeneratorPlainField()
|
||||
)); ?>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php use_helper('stPaczkomaty');
|
||||
echo show_paczkomaty_dropdown_list('config[default_sender_paczkomat]', !$sf_request->hasParameter('config[default_sender_paczkomat]') ? $config->get('default_sender_paczkomat') : $sf_request->getParameter('config[default_sender_paczkomat]'), array('paczkomaty' => array('function' => 'ParcelSend')));
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
if (!$paczkomaty_pack->isAdminGeneratorPlainField())
|
||||
{
|
||||
echo input_tag('paczkomaty_pack[description]', !$sf_request->hasParameter('paczkomaty_pack[description]') ? $paczkomaty_pack->getDescription() : $sf_request->getParameter('paczkomaty_pack[description]'), array('size' => 80));
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $paczkomaty_pack->getDescription();
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
echo input_tag('filters[dispatch_order]', isset($filters['dispatch_order']) ? $filters['dispatch_order'] : null, ['id' => 'filters_dispatch_order_id', 'size' => 14]);
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @var PaczkomatyPack $paczkomaty_pack
|
||||
*/
|
||||
|
||||
echo $paczkomaty_pack->getPaczkomatyDispatchOrder();
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php echo st_inpost_point_select_tag('paczkomaty_pack[dropoff_point]', $paczkomaty_pack->getDropoffPoint(), array (
|
||||
'title' => 'Paczkomat nadawcy',
|
||||
'disabled' => $paczkomaty_pack->isAdminGeneratorPlainField()
|
||||
)); ?>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
if (!$paczkomaty_pack->isAdminGeneratorPlainField())
|
||||
{
|
||||
echo st_admin_checkbox_tag('paczkomaty_pack[end_of_week_collection]', true, $paczkomaty_pack->getEndOfWeekCollection());
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $paczkomaty_pack->getEndOfWeekCollection() ? __("Tak", null, "stAdminGeneratorPlugin") : __("Nie", null, "stAdminGeneratorPlugin");
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @var PaczkomatyPack $paczkomaty_pack
|
||||
*/
|
||||
$currency = 'PLN';
|
||||
|
||||
if (!$paczkomaty_pack->isAdminGeneratorPlainField())
|
||||
{
|
||||
$insuranceAmount = $paczkomaty_pack->getInsurance() ? $paczkomaty_pack->getInsurance() : $paczkomaty_pack->getInsurance(true);
|
||||
echo st_admin_optional_input('paczkomaty_pack[insurance]', st_price_format($insuranceAmount), array(
|
||||
'size' => 7,
|
||||
'disabled' => !$paczkomaty_pack->getInsurance() && !$paczkomaty_pack->hasAllegroInsurance()
|
||||
)) . ' ' . $currency;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo stPrice::round($paczkomaty_pack->getInsurance()) . ' ' . $currency;
|
||||
}
|
||||
?>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
jQuery(function($) {
|
||||
$('#paczkomaty_pack_insurance').change(function() {
|
||||
$(this).val(stPrice.fixNumberFormat($(this).val()));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,7 @@
|
||||
<div>
|
||||
<?php if ($pp): ?>
|
||||
<a href="<?php echo $pp->getTrackingUrl() ?>" target="_blank" style="display: inline-block; padding-right: 15px; background: #444; color: #fafafa; text-decoration: none"><img src="/images/backend/icons/inpost-zolte-tlo.png" style="line-height: 0; vertical-align: middle; padding-right: 15px"; /><span style="vertical-align: middle;"><?php echo __('Śledź przesyłkę') ?></span></a>
|
||||
<?php else: ?>
|
||||
<a href="<?php echo url_for('@stPaczkomatyCreatePack?order='.$order->getId());?>" style="display: inline-block; padding-right: 15px; background: #444; color: #fafafa; text-decoration: none"><img src="/images/backend/icons/inpost-zolte-tlo.png" style="line-height: 0; vertical-align: middle; padding-right: 15px"; /><span style="vertical-align: middle;"><?php echo __('Wyślij paczkę') ?></span></a>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php use_helper('stOrder') ?>
|
||||
|
||||
<?php echo st_order_status_select_tag('config[order_status]', $config->get('order_status'), array('include_custom' => true)) ?>
|
||||
@@ -0,0 +1 @@
|
||||
<?php echo st_inpost_organization_select_tag('config[organization]', $config->get('organization')); ?>
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php if(!$paczkomaty_pack->isNew()):?>
|
||||
<div class="row">
|
||||
<label for="paczkomaty_pack_code">
|
||||
<?php echo __('Numer paczki', array(), 'stPaczkomatyBackend');?>:
|
||||
</label>
|
||||
<?php echo $paczkomaty_pack->getCode();?>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<label for="paczkomaty_pack_status">
|
||||
<?php echo __('Status paczki', array(), 'stPaczkomatyBackend');?>:
|
||||
</label>
|
||||
<div id="st-paczkomaty-status">
|
||||
<img src="/images/backend/icons/indicator.gif" alt="loading..." />
|
||||
</div>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<label for="paczkomaty_pack_status_changed_at">
|
||||
<?php echo __('Aktualizacja statusu w systemie Paczkomaty.pl', array(), 'stPaczkomatyBackend');?>:
|
||||
</label>
|
||||
<div id="st-paczkomaty-status-date">
|
||||
<img src="/images/backend/icons/indicator.gif" alt="loading..." />
|
||||
</div>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
jQuery(function ($) {
|
||||
$(document).ready(function() {
|
||||
$.getJSON('/backend.php/paczkomaty/getPackStatus?code=<?php echo $paczkomaty_pack->getCode();?>', function(data) {
|
||||
$('#st-paczkomaty-status').html(data.clientStatus);
|
||||
$('#st-paczkomaty-status-date').html(data.date);
|
||||
<?php if($paczkomaty_pack->getStatus() == 'Created'):?>
|
||||
if (data.status != 'Created') {
|
||||
$('.action-pay_for_pack').hide();
|
||||
$('.action-download_sticker input').attr('value', 'Pobierz etykiete');
|
||||
$('.action-download_sticker input').css('background-image', 'url(/images/backend/icons/download_sticker.png)');
|
||||
}
|
||||
<?php endif;?>
|
||||
});
|
||||
$.getJSON('/paczkomaty/getMachine?number=<?php echo $paczkomaty_pack->getCustomerPaczkomat();?>', function(data) {
|
||||
$('#st-paczkomaty-customer-machine').html(data.number + ', ' + data.street + ' ' + data.house + ', ' + data.postCode + ' ' + data.city);
|
||||
});
|
||||
<?php if($paczkomaty_pack->getUseSenderPaczkomat()):?>
|
||||
$.getJSON('/paczkomaty/getMachine?number=<?php echo $paczkomaty_pack->getSenderPaczkomat();?>', function(data) {
|
||||
$('#st-paczkomaty-sender-machine').html(data.number + ', ' + data.street + ' ' + data.house + ', ' + data.postCode + ' ' + data.city);
|
||||
});
|
||||
<?php endif;?>
|
||||
$('.action-save').hide();
|
||||
<?php if(!is_null($paczkomaty_pack->getStatus()) && $paczkomaty_pack->getStatus() != 'Created'):?>
|
||||
$('.action-pay_for_pack').hide();
|
||||
$('.action-download_sticker input').attr('value', 'Pobierz etykiete');
|
||||
<?php else:?>
|
||||
$('.action-download_sticker input').css('background-image', 'url(/images/backend/icons/pay_and_download.png)');
|
||||
<?php endif;?>
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php else:?>
|
||||
<script type="text/javascript" language="javascript">
|
||||
jQuery(function($) {
|
||||
$(document).ready(function() {
|
||||
$('#sf_fieldset_informacje_o_paczce').hide();
|
||||
$('.action-pay_for_pack').hide();
|
||||
$('.action-download_sticker').hide();
|
||||
$('.action-list').hide();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php endif;?>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
$options = array('A' => 'A (8 x 38 x 64 cm)', 'B' => 'B (19 x 38 x 64 cm)', 'C' => 'C (41 x 38 x 64 cm)');
|
||||
|
||||
if (!$paczkomaty_pack->isAdminGeneratorPlainField())
|
||||
{
|
||||
echo select_tag('paczkomaty_pack[pack_type]', options_for_select($options, !$sf_request->hasParameter('paczkomaty_pack[pack_type]') ? $paczkomaty_pack->getPackType() : $sf_request->getParameter('paczkomaty_pack[pack_type]')));
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $options[$paczkomaty_pack->getPackType()];
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1 @@
|
||||
<?php echo select_tag('delivery_dimension[paczkomaty_size]', options_for_select(array('NONE' => '-', 'A' => 'A (8 x 38 x 64 cm)', 'B' => 'B (19 x 38 x 64 cm)', 'C' => 'C (41 x 38 x 64 cm)'), !$sf_request->hasParameter('delivery_dimension[paczkomaty_size]') ? $delivery_dimension->getPaczkomatySize() : $sf_request->getParameter('delivery_dimension[paczkomaty_size]')));
|
||||
@@ -0,0 +1 @@
|
||||
<?php echo select_tag('delivery[paczkomaty_type]', options_for_select(array('NONE' => __('Wyłączone'), 'ALL' => __('Wszystkie'), 'COD' => __('Z płatnością przy odbiorze')), $delivery->getPaczkomatyType()));
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* @var PaczkomatyPack $paczkomaty_pack
|
||||
*/
|
||||
if ($type == 'list')
|
||||
{
|
||||
$trackingNumbers = [];
|
||||
|
||||
foreach ($paczkomaty_pack->getParcels() as $parcel)
|
||||
{
|
||||
$trackingNumbers[] = $parcel['number'];
|
||||
}
|
||||
|
||||
echo implode(', ', $trackingNumbers);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo delivery_parcels_manager_tag('paczkomaty_pack[parcels]', $paczkomaty_pack->getParcels(), [
|
||||
'fields' => [
|
||||
'weight' => [
|
||||
'label' => __('Waga [kg]'),
|
||||
'type' => !$paczkomaty_pack->isAdminGeneratorPlainField() ? 'input_tag' : 'plain',
|
||||
'options' => [
|
||||
'data-format' => 'decimal',
|
||||
'data-format-min-value' => 0.1,
|
||||
'size' => 8
|
||||
],
|
||||
],
|
||||
'width' => [
|
||||
'label' => __('Szerokość [cm]'),
|
||||
'type' => !$paczkomaty_pack->isAdminGeneratorPlainField() ? 'input_tag' : 'plain',
|
||||
'options' => [
|
||||
'data-format' => 'integer',
|
||||
'data-format-min-value' => 1,
|
||||
'size' => 8,
|
||||
'class' => 'app-dpd-size'
|
||||
],
|
||||
],
|
||||
'height' => [
|
||||
'label' => __('Wysokość [cm]'),
|
||||
'type' => !$paczkomaty_pack->isAdminGeneratorPlainField() ? 'input_tag' : 'plain',
|
||||
'options' => [
|
||||
'data-format' => 'integer',
|
||||
'data-format-min-value' => 1,
|
||||
'size' => 8,
|
||||
'class' => 'app-dpd-size'
|
||||
],
|
||||
],
|
||||
'length' => [
|
||||
'label' => __('Długość [cm]'),
|
||||
'type' => !$paczkomaty_pack->isAdminGeneratorPlainField() ? 'input_tag' : 'plain',
|
||||
'options' => [
|
||||
'data-format' => 'integer',
|
||||
'data-format-min-value' => 1,
|
||||
'size' => 8,
|
||||
'class' => 'app-dpd-size'
|
||||
],
|
||||
],
|
||||
],
|
||||
'disabled' => $paczkomaty_pack->isAdminGeneratorPlainField(),
|
||||
]);
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php use_helper('stPaczkomaty');?>
|
||||
<?php if($paczkomaty_pack->isNew()):
|
||||
$paczkomaty_params = array();
|
||||
|
||||
if ($paczkomaty_pack->hasAllegroTransactionId())
|
||||
{
|
||||
$paczkomaty_params['function'] = 'ParcelSend,AllegroParcelSend';
|
||||
}
|
||||
else
|
||||
{
|
||||
$paczkomaty_params['function'] = 'ParcelSend';
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="row">
|
||||
<label for="paczkomaty_pack_use_sender_paczkomat">
|
||||
<?php echo __('Użyj Paczkomatu', array(), 'stPaczkomatyBackend');?>
|
||||
</label>
|
||||
<?php $useSenderPaczkomat = !$sf_request->hasParameter('paczkomaty_pack[use_sender_paczkomat]') ? $paczkomaty_pack->getUseSenderPaczkomat() : $sf_request->getParameter('paczkomaty_pack[use_sender_paczkomat]');?>
|
||||
<?php echo checkbox_tag('paczkomaty_pack[use_sender_paczkomat]', 1, $useSenderPaczkomat);?>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<label for="paczkomaty_pack_sender_paczkomat">
|
||||
<?php echo __('Paczkomat nadawcy', array(), 'stPaczkomatyBackend');?>
|
||||
</label>
|
||||
<?php show_paczkomaty_dropdown_list('paczkomaty_pack[sender_paczkomat]', $paczkomaty_pack->getSenderPaczkomat(), array('disabled' => !$useSenderPaczkomat, 'paczkomaty' => array('function' => 'ParcelSend')));?>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<script type="text/javascript" language="javascript">
|
||||
jQuery(function($) {
|
||||
$(document).ready(function() {
|
||||
$('#paczkomaty_pack_use_sender_paczkomat').change(function() {
|
||||
$('#paczkomaty_pack_sender_paczkomat').prop('disabled', !$(this).prop('checked'));
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php else:?>
|
||||
<div class="row">
|
||||
<label for="paczkomaty_pack_customer_email">
|
||||
<?php echo __('Użyj Paczkomatu', array(), 'stPaczkomatyBackend');?>:
|
||||
</label>
|
||||
<?php if ($paczkomaty_pack->getUseSenderPaczkomat()):?>
|
||||
<img src="/images/backend/beta/icons/16x16/tick.png" alt="loading..." />
|
||||
<?php else:?>
|
||||
<img src="/images/backend/beta/icons/16x16/cancel.png" alt="loading..." />
|
||||
<?php endif;?>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="paczkomaty_pack_sender_paczkomat">
|
||||
<?php echo __('Paczkomat nadawcy', array(), 'stPaczkomatyBackend');?>:
|
||||
</label>
|
||||
<?php if ($paczkomaty_pack->getUseSenderPaczkomat()):?>
|
||||
<div id="st-paczkomaty-sender-machine">
|
||||
<img src="/images/backend/icons/indicator.gif" alt="loading..." />
|
||||
</div>
|
||||
<?php else:?>
|
||||
-
|
||||
<?php endif;?>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
<?php
|
||||
/**
|
||||
* @var PaczkomatyPack $paczkomaty_pack
|
||||
*/
|
||||
if ($type == 'edit' && !$paczkomaty_pack->isAdminGeneratorPlainField())
|
||||
{
|
||||
echo st_inpost_sending_method_select_tag('paczkomaty_pack[sending_method]', $paczkomaty_pack->getSendingMethod(), array (
|
||||
'service' => $paczkomaty_pack->getService(),
|
||||
'target' => '.row_dropoff_point',
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
$api = stInPostApi::getInstance();
|
||||
$methods = $api->getSendingMethods();
|
||||
echo $methods[$paczkomaty_pack->getSendingMethod()];
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ($type == 'edit' && $paczkomaty_pack->isAdminGeneratorPlainField() && $paczkomaty_pack->getSendingMethod() != 'parcel_locker'): ?>
|
||||
<script>
|
||||
jQuery(function($) {
|
||||
$('.row_dropoff_point').hide();
|
||||
});
|
||||
</script>
|
||||
<?php endif ?>
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
echo st_inpost_sending_method_select_tag($name, $value, ['include_custom' => '---']);
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
$selectOptions = [];
|
||||
|
||||
foreach (['inpostp', 'inpostk'] as $type)
|
||||
{
|
||||
if (stDeliveryTypeConfiguration::has($type))
|
||||
{
|
||||
$service = stDeliveryTypeService::get($type);
|
||||
$selectOptions[$service->getType()] = $service->getLabel();
|
||||
}
|
||||
}
|
||||
|
||||
echo select_tag($name, $selectOptions, [
|
||||
'include_custom' => '---',
|
||||
'selected' => isset($filters['service_type']) ? $filters['service_type'] : null
|
||||
]);
|
||||
@@ -0,0 +1,59 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="pl" style="height: 100%;">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
||||
<meta http-equiv="x-ua-compatible" content="IE=11"/>
|
||||
<title>Geowidget v4 - Example - Search Locker Point</title>
|
||||
<script src="https://geowidget.easypack24.net/js/sdk-for-javascript.js"></script>
|
||||
<script type="text/javascript">
|
||||
window.easyPackAsyncInit = function () {
|
||||
easyPack.init({
|
||||
instance: 'pl',
|
||||
mapType: 'osm',
|
||||
apiEndpoint: '<?php echo $endpoint ?>',
|
||||
searchType: 'osm',
|
||||
points: {
|
||||
types: ['pop', 'parcel_locker'],
|
||||
},
|
||||
display: {
|
||||
showTypesFilters: false
|
||||
},
|
||||
map: {
|
||||
useGeolocation: true,
|
||||
initialTypes: ['parcel_locker']
|
||||
}
|
||||
});
|
||||
|
||||
var scope = '#<?php echo $scope ?>';
|
||||
|
||||
$ = window.parent.jQuery;
|
||||
|
||||
var selected = $(scope);
|
||||
|
||||
var map = easyPack.mapWidget('easypack-map', function(point) {
|
||||
$(scope + '_label').html(point.name + '<p>' + point.address.line1 + ', ' + point.address.line2 + '</p>');
|
||||
selected.val(point.name);
|
||||
$(scope + '_trigger').data('overlay').close();
|
||||
});
|
||||
|
||||
|
||||
if (selected.val()) {
|
||||
map.searchLockerPoint(selected.val());
|
||||
}
|
||||
|
||||
// setTimeout(function() {
|
||||
// var modal = window.parent.jQuery('#inpost-easypack-modal');
|
||||
|
||||
// modal.find('iframe').height(window.document.body.scrollHeight);
|
||||
|
||||
// console.log('test');
|
||||
// }, 2000);
|
||||
}
|
||||
</script>
|
||||
<link rel="stylesheet" href="https://geowidget.easypack24.net/css/easypack.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="easypack-map"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php use_helper('I18N', 'stAdminGenerator', 'Validation');?>
|
||||
<?php echo st_get_admin_head('stPaczkomatyPlugin', __('Konfiguracja', array()), __('',array()),array('stPayment', 'stProduct','stDeliveryPlugin'));?>
|
||||
<div id="sf_admin_content">
|
||||
<div id="sf_admin_content_config">
|
||||
<form>
|
||||
<fieldset>
|
||||
<div class="st_fieldset-content">
|
||||
<div class="form-row">
|
||||
<a href="<?php echo get_7_link();?>" target="_blank">Zamów aktualizację do wersji 7</a>
|
||||
<br class="st_clear_all" />
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<br class="st_clear_all" />
|
||||
<?php echo st_get_admin_foot();?>
|
||||
Reference in New Issue
Block a user