first commit

This commit is contained in:
2025-03-12 17:06:23 +01:00
commit 2241f7131f
13185 changed files with 1692479 additions and 0 deletions

View File

@@ -0,0 +1,152 @@
<?php
/**
* SOTESHOP/stLukasPlugin
*
* Ten plik należy do aplikacji stLukasPlugin opartej na licencji (Professional License SOTE).
* Nie zmieniaj tego pliku, jeśli chcesz korzystać z automatycznych aktualizacji oprogramowania.
* Jeśli chcesz wprowadzać swoje modyfikacje do programu, zapoznaj się z dokumentacją, jak zmieniać
* oprogramowanie bez zmiany kodu bazowego http://www.sote.pl/modifications
*
* @package stLukasPlugin
* @subpackage actions
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/sote (Professional License SOTE)
* @version $Id: actions.class.php 10 2009-08-24 09:32:18Z michal $
* @author Michal Prochowski <michal.prochowski@sote.pl>
*/
/**
* Klasa stLukasFrontendActions
*
* @package stLukasPlugin
* @subpackage actions
*/
class stLukasFrontendActions extends stActions
{
/**
* Składanie eWniosku
*/
public function executeEwniosek()
{
$this->setLayout(false);
$stLukas = new stLukas();
$context = $this->getContext();
$this->url = '';
/**
* Hack na zmianę języka
*/
stLanguage::getInstance($context)->clearPath();
if ($this->getRequest()->hasParameter('type'))
{
$type = $this->getRequest()->getParameter('type');
if ($type == stLukas::TYPE_ORDER)
{
$c = new Criteria();
$c->add(OrderPeer::ID, $this->getRequest()->getParameter('id'));
$order = OrderPeer::doSelectOne($c);
// $stWebRequest = new stWebRequest();
// $wsdlFilename = sfConfig::get('sf_web_dir').DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.'lukas_bank.wsdl';
//
// if (!file_exists($wsdlFilename) || (time() - filemtime($wsdlFilename)) > 864000)
// {
// $b = new sfWebBrowser(array(), 'sfCurlAdapter', array('ssl_verify' => false));
// $b->get(stLukas::LUKAS_WSDL_URL);
// $wsdl = trim($b->getResponseText());
//
// file_put_contents($wsdlFilename, $wsdl);
// }
$client = new SoapClient(stLukas::LUKAS_WSDL_URL, array('cache_wsdl' => 0, 'trace'=>1));
$xml = '<?xml version="1.0" encoding="UTF-8"?>';
$xml.= '<form>';
$xml.= '<block id="creditInfo">';
$xml.= '<element importAs="creditInfo.creditAmount.value">'.($order->getUnpaidAmount()).'</element>';
$xml.= '</block>';
$xml.= '<block id="cart">';
$xml.= '<element importAs="cart.shopName.value">'.$stLukas->getShopName().'</element>';
$xml.= '<element importAs="cart.orderNumber.value">'.$order->getNumber().'</element>';
$c = new Criteria();
$c->add(OrderProductPeer::ORDER_ID, $order->getId());
$products = OrderProductPeer::doSelect($c);
$i = 1;
foreach($products as $product)
{
$xml.= '<element importAs="cart.itemName'.$i.'.value">'.$product->getName().'</element>';
$xml.= '<element importAs="cart.itemQty'.$i.'.value">'.$product->getQuantity().'</element>';
$xml.= '<element importAs="cart.itemPrice'.$i.'.value">'.$product->getPriceBrutto().'</element>';
$i++;
}
if($order->getOrderDelivery()->getCostBrutto()!=0){
$xml.= '<element importAs="cart.itemName'.$i.'.value">'.$context->getI18n()->__('Dostawa:').' '.$order->getOrderDelivery()->getName().'</element>';
$xml.= '<element importAs="cart.itemQty'.$i.'.value">1</element>';
$xml.= '<element importAs="cart.itemPrice'.$i.'.value">'.$order->getOrderDelivery()->getCostBrutto().'</element>';
}
$xml.= '</block>';
$xml.= '<block id="email">';
$xml.= '<element importAs="email.address.value">'.$order->getGuardUser()->getUsername().'</element>';
$xml.= '</block>';
$xml.= '</form>';
try {
$paramSetup = $client->put($xml);
} catch (Exception $e) { }
$this->url = $stLukas->generateUrl(array('simulate' => true, 'param_setup' => $paramSetup));
} elseif ($type == stLukas::TYPE_PRODUCT) {
$this->url = $stLukas->generateUrl(array('simulate' => true, 'amount' => $this->getRequest()->getParameter('price')));
}
} else {
if ($this->hasFlash('lukas_procedure') && $this->getFlash('lukas_procedure') == true)
{
$this->url = $stLukas->generateUrl(array('procedure' => true));
} else {
$basket = stBasket::getInstance($context->getUser());
$delivery = stDeliveryFrontend::getInstance($basket);
$this->url = $stLukas->generateUrl(array('simulate' => true, 'amount' => ($basket->getTotalAmount(true)+$delivery->getTotalDeliveryCost(true))));
}
}
}
/**
* Procedura składania wniosku
*/
public function executeProcedure()
{
$this->setFlash('lukas_procedure', true);
$this->redirect('lukas/ewniosek');
}
/**
* Pozytywny powrót z płatności
*/
public function executeReturnSuccess()
{
$this->smarty = new stSmarty($this->getModuleName());
}
/**
* Negatywny powrót z płatności
*/
public function executeReturnFail()
{
$this->smarty = new stSmarty($this->getModuleName());
$this->contactPage = WebpagePeer::retrieveByState('CONTACT');
}
}

View File

@@ -0,0 +1,63 @@
<?php
/**
* SOTESHOP/stLukasPlugin
*
* Ten plik należy do aplikacji stLukasPlugin opartej na licencji (Professional License SOTE).
* Nie zmieniaj tego pliku, jeśli chcesz korzystać z automatycznych aktualizacji oprogramowania.
* Jeśli chcesz wprowadzać swoje modyfikacje do programu, zapoznaj się z dokumentacją, jak zmieniać
* oprogramowanie bez zmiany kodu bazowego http://www.sote.pl/modifications
*
* @package stLukasPlugin
* @subpackage actions
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/sote (Professional License SOTE)
* @version $Id: components.class.php 2020 2009-11-05 15:03:10Z krzysiek $
* @author Michal Prochowski <michal.prochowski@sote.pl>
*/
/**
* Klasa stLukasFrontendComponents
*
* @package stLukasPlugin
* @subpackage actions
*/
class stLukasFrontendComponents extends sfComponents {
/**
* Pokazywanie formularza płatności
*/
public function executeShowPayment() {
$this->smarty = new stSmarty('stLukasFrontend');
if (stPaymentType::hasOrderInSummary()) {
$this->stLukas = new stLukas();
$this->order = stPaymentType::getOrderInSummary();
}
}
/**
* Obliczanie rat w produkcie
*/
public function executeCalculate() {
$this->smarty = new stSmarty('stLukasFrontend');
if (!stLukas::isActive() || !stLukas::showInProduct(ProductPeer::getShowedProduct()))
return sfView::NONE;
}
/**
* Obliczanie rat w koszyku
*/
public function executeCalculateInBasket() {
$this->smarty = new stSmarty('stLukasFrontend');
}
/**
* Obliczanie rat w potwierdzeniu zamówienia
*/
public function executeOrderSummary() {
$this->smarty = new stSmarty('stLukasFrontend');
$this->basket = stBasket::getInstance(sfContext::getInstance()->getUser());
$this->delivery = stDeliveryFrontend::getInstance($this->basket);
}
}

View File

@@ -0,0 +1,11 @@
<?php
use_helper('stUrl');
use_javascript('/js/stLukasPlugin/stLukasPlugin.js');
$smarty->assign('form', form_tag('lukas/ewniosek', array('method' => 'post', 'target' => 'lukasWindow', 'name' => 'lukasCalculator')));
$smarty->assign('type', input_hidden_tag('type', stLukas::TYPE_PRODUCT));
$smarty->assign('id', input_hidden_tag('id', $id));
$smarty->assign('price', input_hidden_tag('price', '', array('id' => 'lukasPrice')));
$smarty->assign('submit', link_to(image_tag('https://ewniosek.credit-agricole.pl/eWniosek/res/CA_grafika/oblicz_raty_duckblue.png'), '#', array('onClick' => 'lukasUpdatePrice(); openLukasUrlWithPost("'.st_url_for('lukas/ewniosek').'");')));
$smarty->display('lukas_calculate.html');

View File

@@ -0,0 +1,11 @@
<?php
use_helper('stUrl');
use_javascript('/js/stLukasPlugin/stLukasPlugin.js');
if($sf_user->getBasket()->getTotalAmount(true) <="500"){
$smarty->assign('link', link_to(image_tag('https://ewniosek.credit-agricole.pl/eWniosek/res/CA_grafika/oblicz_raty_duckblue.png'), '#', array('id'=>'credit-agricol')));
}else{
$smarty->assign('link', link_to(image_tag('https://ewniosek.credit-agricole.pl/eWniosek/res/CA_grafika/oblicz_raty_duckblue.png'), '#', array('id'=>'credit-agricol','onClick' => "window.open('".url_for('lukas/ewniosek')."', 'lukasWindow', 'location=no, scrollbars=yes, resizable=yes, toolbar=no, menubar=no, height=600, width=840');")));
}
$smarty->assign('amount', $sf_user->getBasket()->getTotalAmount(true));
$smarty->display('lukas_calculate_in_basket.html');

View File

@@ -0,0 +1,8 @@
<?php
use_helper('stUrl');
use_javascript('/js/stLukasPlugin/stLukasPlugin.js');
$smarty->assign('form', form_tag('lukas/ewniosek', array('method' => 'post', 'target' => 'lukasWindow', 'name' => 'lukasCalculator')));
$smarty->assign('submit', link_to(st_theme_image_tag('stLukasPlugin/oblicz_rate.gif'), '#', array('onClick' => 'openLukasUrlWithPost("'.url_for('lukas/ewniosek').'");')));
$smarty->display('lukas_order_summary.html');

View File

@@ -0,0 +1,19 @@
<?php
use_helper('stUrl');
st_theme_use_stylesheet('stPayment.css');
st_theme_use_stylesheet('stLukasPlugin.css');
use_javascript('/js/stLukasPlugin/stLukasPlugin.js');
$smarty->assign('check_configuration', $stLukas->checkPaymentConfiguration());
if ($stLukas->checkPaymentConfiguration())
{
$smarty->assign('form_start', form_tag('lukas/ewniosek', array('class' => 'st_form', 'id'=>'lukas_form')));
$smarty->assign('type', input_hidden_tag('type', stLukas::TYPE_ORDER));
$smarty->assign('id', input_hidden_tag('id', $order->getId()));
$smarty->assign('procedure', link_to(__('Warunkami udzielania kredytu ratalnego Credit Agricole Bank Polska'), '#', array('onClick' => 'openLukasUrl("'.st_url_for('lukas/procedure').'");')));
$smarty->assign('statement', checkbox_tag('lukas_statement', 1, false));
$text = __("Proszę zaznaczyć opcję: 'Oświadczam, że zapoznałem/am się z informacją o warunkach i sposobie udzielania kredytu ratalnego Credit Agricole Bank Polska'");
$smarty->assign('submit_button', image_tag('https://ewniosek.credit-agricole.pl/eWniosek/res/CA_grafika/raty_120x44_duckblue.png', array('id' => 'lukas_zloz_wniosek', 'onClick' => 'jQuery(function($){$("#lukas_form").submit();})', 'style' => 'cursor: pointer')));
$smarty->assign('description', stPaymentType::getSummaryDescriptionByOrderIdAndHash($order->getId()));
}
$smarty->display('lukas_show_payment.html');

View File

@@ -0,0 +1,24 @@
<script type="text/javascript">
var mode = 0;
var url = "<?php echo $url;?>";
mode = /MSIE (\d+\.\d+);/.test(navigator.userAgent) == true ? 1 : 0;
function loaded(mode)
{
if(mode == 0)
{
top.location.href = url;
}
else
{
document.getElementById('mf').action = url;
document.getElementById('mf').submit();
}
}
</script>
<form id="mf" action="" method="post"></form>
<script type="text/javascript">
loaded(mode);
</script>

View File

@@ -0,0 +1,4 @@
<?php
st_theme_use_stylesheet('stPayment.css');
$smarty->assign('contactLink', is_object($contactPage) ? url_for('stWebpageFrontend/index?url='.$contactPage->getFriendlyUrl()) : null);
$smarty->display('lukas_return_fail.html');

View File

@@ -0,0 +1,3 @@
<?php
st_theme_use_stylesheet('stPayment.css');
$smarty->display('lukas_return_success.html');

View File

@@ -0,0 +1,18 @@
{if $isActive}
{if $show == true}
<li>
{$form}
{$type}
{$id}
{$price}
{$submit}
</form>
</li>
{else}
<li>
{if $isDisabled == false}
{__ text="Zakupy w systemie ratalnym LUKAS Raty dostępne są od 500zł do 10000zł wartości całego zamówienia."}
{/if}
</li>
{/if}
{/if}

View File

@@ -0,0 +1,12 @@
{if $showInBasket == true}
{$link}
{else}
<script language="javascript" type="text/javascript">
{foreach from=$paymentTypes item=id}
document.getElementById("delivery_default_payment-{$id}").disabled = true;
document.getElementById("delivery_default_payment-{$id}").checked = false;
{/foreach}
document.getElementById("delivery_default_payment-{$deliveryPaymentId}").checked = true;
</script>
{__ text="Zakupy w systemie ratalnym LUKAS Raty dostępne są od 500zł do 10000zł wartości całego zamówienia."}
{/if}

View File

@@ -0,0 +1,5 @@
<li>
{$form}
{$submit}
</form>
</li>

View File

@@ -0,0 +1,8 @@
<div class="st_application">
<h1 class="st_title">
{__ text="Płatność"}
</h1>
<p style="text-align: center; margin-bottom: 20px;">
{__ text="Płatność nie została zrealizowana."}
</p>
</div>

View File

@@ -0,0 +1,8 @@
<div class="st_application">
<h1 class="st_title">
{__ text="Płatność"}
</h1>
<p style="text-align: center; margin-bottom: 20px;">
{__ text="Dziękujemy za dokonanie płatności."}
</p>
</div>

View File

@@ -0,0 +1,34 @@
{if $check_configuration}
<div id="st_box_payment">
<p><img id="st_home" src="/images/frontend/theme/default/stLukasPlugin/logo.png" alt=""/></p>
<p>
<div style="width: 750px; text-align: left; margin: 0px auto 15px;">
{__ text="Wybrana została przez Ciebie forma płatności LUKAS Raty."}<br />
{__ text="Aby złożyć wniosek o kredyt zapoznaj się z"} {$procedure}:<br />
<br />
{$statement}{__ text="Oświadczam, że zapoznałem/am się z informacją o warunkach i sposobie udzielania kredytu ratalnego Credit Agricole Bank Polska"}<br />
<br />
{__ text="Do wypełnienia wniosku potrzebne będą dane z Twojego dowodu osobistego, a także informacje dotyczące miejsca i formy zatrudnienia oraz wysokości uzyskiwanego dochodu."}<br />
{__ text="Jeżeli do decyzji kredytowej potrzebne będą dodatkowe informacje, poinformuje Cię o tym przedstawiciel Banku."}<br />
<br />
{__ text="Po wybraniu przycisku"} <b>{__ text='"Wypełnij wniosek"'}</b> {__ text="zostaniesz przeniesiony/na na bezpieczne strony Credit Agricole Bank Polska S.A., wszystkie informacje przesyłane do Banku są chronione protokołem SSL."}<br />
{__ text="Przejście na stronę Wniosku jest równoznaczne z wyrażeniem zgody na przetwarzanie danych osobowych przez Credit Agricole Bank Polska S.A."}<br />
{__ text="Zgodnie z art. 24 Ustawy o ochronie danych osobowych z dnia 29 sierpnia 1997 r. Twoje dane będą przetwarzane przez Credit Agricole Bank Polska S.A. w celu realizacji umowy kredytu oraz należytego jej wykonania."}
{__ text="Podanie danych ma charakter dobrowolny i przysługuje Ci prawo wglądu do tych danych oraz ich poprawiania."}
{__ text="Administratorem danych osobowych jest Credit Agricole Bank Polska S.A. z siedzibą we Wrocławiu, Pl. Orląt Lwowskich 1."}<br />
<br />
</div>
</p>
{$form_start}
{$type}
{$id}
{$submit_button}
</form>
<br />
</div>
{else}
<div id="st_box_payment">
<p><img id="st_home" src="/images/frontend/theme/default/stLukasPlugin/logo.png" alt=""/></p>
<p>{__ text="Płatność została błędnie skonfigurowana."}</p>
</div>
{/if}

View File

@@ -0,0 +1,8 @@
<li>
{$form}
{$type}
{$id}
{$price}
{$submit}
</form>
</li>

View File

@@ -0,0 +1,20 @@
{$link}
{if $amount <= "500"}
{literal}
<script type="text/javascript">
jQuery(function ($)
{
var amount = {/literal}{$amount}{literal};
if($( "#credit-agricol" ).closest("li").children('input').is(':checked') && amount <= '500'){
$( "#st_delivery-payment_list" ).find('input:first').attr('checked', true);
}
$( "#credit-agricol" ).closest("li").children('input').remove();
$( "#credit-agricol" ).closest("li").css("padding-left", "20px");
});
</script>
{/literal}
{/if}

View File

@@ -0,0 +1,5 @@
<li>
{$form}
{$submit}
</form>
</li>

View File

@@ -0,0 +1,9 @@
<div id="stPayment_return" class="box roundies">
<div class="title">
<h2>{__ text="Płatność"}</h2>
</div>
<div class="content">
<p>{__ text="Rezygnacja z wypełnienia Wniosku o kredyt ratalny Credit Agricole Bank Polska S.A."}</p>
<p>{__ text="Skontaktuj się ze sklepem i wybierz inną metodę płatności."}</p>
</div>
</div>

View File

@@ -0,0 +1,9 @@
<div id="stPayment_return" class="box roundies">
<div class="title">
<h2>{__ text="Płatność"}</h2>
</div>
<div class="content">
<p>{__ text="Wniosek został złożony poprawnie - dziękujemy."}</p>
<p>{__ text="W ciągu 24 h skontaktuje się z Tobą doradca Credit Agricole Bank Polska S.A., potem Twoje zamówienie będzie mogło być zrealizowane."}</p>
</div>
</div>

View File

@@ -0,0 +1,16 @@
{if $check_configuration}
<div id="st_box_payment">
<img id="st_home" src="https://ewniosek.credit-agricole.pl/eWniosek/res/CA_grafika/485_przezroczysty.png" alt=""/>
{$form_start}
{$type}
{$id}
{$submit_button}
</form>
<br />
</div>
{else}
<div id="st_box_payment">
<p><img id="st_home" src="/images/frontend/theme/default2/stLukasPlugin/logo.png" alt=""/></p>
<p>{__ text="Płatność została błędnie skonfigurowana."}</p>
</div>
{/if}

View File

@@ -0,0 +1,8 @@
<li id="credit-agricole-button">
{$form}
{$type}
{$id}
{$price}
{$submit}
</form>
</li>

View File

@@ -0,0 +1,22 @@
{$link}
{if $amount <= "500"}
{literal}
<script type="text/javascript">
jQuery(function ($)
{
var amount = {/literal}{$amount}{literal};
if($( "#credit-agricol" ).closest("label").children('input').is(':checked') && amount <= '500'){
$( "#shopping-cart-payment" ).find('input:first').attr('checked', true);
}
$( "#credit-agricol" ).closest("label").children('input').attr('disabled', true);
$( "#credit-agricol" ).closest("label").children('input').css("margin-right", "5px");
$( "#credit-agricol" ).closest("div").removeClass("radio");
$( "#credit-agricol" ).closest("div").css("margin-top", "-5px","margin-bottom", "6px");
$( "#credit-agricol" ).css("margin-left", "20px");
});
</script>
{/literal}
{/if}

View File

@@ -0,0 +1,5 @@
<!-- <li>
{$form}
{$submit}
</form>
</li> -->

View File

@@ -0,0 +1,20 @@
{set layout="one_column"}
<div id="payment">
<div class="title">
<h1>{__ text="Płatność"}</h1>
</div>
<div class="panel panel-default center-block">
<div class="panel-heading">
{__ text="Credit Agricole Raty"}
</div>
<div class="panel-body text-center">
<p>
{__ text="Rezygnacja z wypełnienia Wniosku o kredyt ratalny Credit Agricole Bank Polska S.A."}<br />
{__ text="Skontaktuj się z nami." langCatalogue="stPayment"}
</p>
{if $contactLink}
<a href="{$contactLink}" class="btn btn-primary">{__ text="Kontakt" langCatalogue="stPayment"}</a>
{/if}
</div>
</div>
</div>

View File

@@ -0,0 +1,16 @@
{set layout="one_column"}
<div id="payment">
<div class="title">
<h1>{__ text="Płatność"}</h1>
</div>
<div class="panel panel-default center-block">
<div class="panel-heading">
{__ text="Credit Agricole Raty"}
</div>
<div class="panel-body text-center">
<p>{__ text="Wniosek został złożony poprawnie - dziękujemy."}</p>
<p>{__ text="W ciągu 24 h skontaktuje się z Tobą doradca Credit Agricole Bank Polska S.A., potem Twoje zamówienie będzie mogło być zrealizowane."}</p>
<a href="/" class="btn btn-primary">{__ text="Wróć do zakupów" langCatalogue="stPayment"}</a>
</div>
</div>
</div>

View File

@@ -0,0 +1,22 @@
<div class="panel panel-default center-block">
<div class="panel-heading">
{__ text="Credit Agricole Raty"}
</div>
<div class="panel-body text-center">
{if $check_configuration}
<img src="https://ewniosek.credit-agricole.pl/eWniosek/res/CA_grafika/485_przezroczysty.png" class="img-responsive" alt="{__ text="Credit Agricole Raty"}"/>
<span>
{$description}
</span>
{$form_start}
{$type}
{$id}
<button type="submit" class="btn btn-primary pull-right">
{__ text="Zapłać"}
</button>
</form>
{else}
{__ text="Płatność została błędnie skonfigurowana."}
{/if}
</div>
</div>