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,64 @@
<?php
class stCashBillBackendActions extends stActions {
public function initializeParameters() {
$this->webRequest = new stWebRequest();
$this->config = stConfig::getInstance('stCashBillBackend');
if ($this->config->get('shop_id', $this->getRequestParameter('config[shop_id]'), true) != '' && $this->config->get('secret_key', $this->getRequestParameter('config[secret_key]'), true) != '')
{
$this->configuration_check = true;
} else {
$this->configuration_check = false;
}
$i18n = $this->getContext()->getI18n();
$this->labels = array(
'config{shop_id}' => $i18n->__('Identyfikator'),
'config{secret_key}' => $i18n->__('Klucz'),
);
}
public function executeIndex() {
$this->initializeParameters();
if ($this->getRequest()->getMethod() == sfRequest::POST) {
$this->config->setFromRequest('config');
$this->config->save();
$this->setFlash('notice', $this->getContext()->getI18n()->__('Twoje zmiany zostały zapisane', null, 'stAdminGeneratorPlugin'));
}
if ($this->config->get('shop_id', $this->getRequestParameter('config[shop_id]'), true) != '' && $this->config->get('secret_key', $this->getRequestParameter('config[secret_key]'), true) != '')
{
$this->configuration_check = true;
} else {
$notice = $this->getContext()->getI18n()->__('Zobacz')."&nbsp;".$this->getContext()->getI18n()->__('krótki przewodnik uruchomienia płatności CashBill.')."&nbsp;".'<a href="http://www.cashbill.pl/download/integracje/Platnosci/PlatnosciCashBillSOTE.pdf" target="_blank">'.$this->getContext()->getI18n()->__('krótki przewodnik uruchomienia płatności CashBill.').'</a>'."&nbsp;".$this->getContext()->getI18n()->__('Sprawdź promocyjne warunki dla klientów SOTE.');
$this->setFlash("info", $notice, false);
$this->configuration_check = false;
}
}
public function validateIndex() {
if ($this->getRequest()->getMethod() == sfRequest::POST)
stAuthUsersListener::checkModificationCredentials($this, $this->getRequest(), $this->getModuleName());
return true;
}
public function handleErrorIndex() {
$this->initializeParameters();
return sfView::SUCCESS;
}
}

View File

@@ -0,0 +1,13 @@
<?php
class stCashBillBackendComponents extends sfComponents
{
public function executeListMenu()
{
}
}
?>

View File

@@ -0,0 +1,19 @@
<div class="list-menu">
<ul>
<li class="selected">
<?php echo link_to(__('CashBill'),'stCashBillBackend/index')?>
</li>
<li>
<?php if (sfContext::getInstance()->getUser()->getCulture() == 'pl_PL'): ?>
<a href="https://www.sote.pl/docs/cashbill" target="_blank"><?php echo __('Dokumentacja'); ?></a>
<?php else: ?>
<a href="https://www.soteshop.com/docs/cashbill" target="_blank"><?php echo __('Documentation'); ?></a>
<?php endif; ?>
</li>
</ul>
</div>
<div class="clr"></div>

View File

@@ -0,0 +1,37 @@
<?php use_helper('I18N', 'stAdminGenerator', 'Validation');?>
<?php echo st_get_admin_head('stCashBillPlugin', __('CashBill'), '', array('stPayment'));?>
<?php st_view_slot_start('application-menu') ?>
<?php st_include_component('stCashBillBackend', 'listMenu') ?>
<?php st_view_slot_end() ?>
<?php echo form_tag('cashbill/index', array('id' => 'sf_admin_config_form', 'name' => 'sf_admin_config_form', 'class' => 'admin_form'));?>
<?php st_include_partial('stAdminGenerator/message', array('labels' => $labels, 'i18n_catalogue' => 'stLukasBackend'));?>
<fieldset>
<div class="content">
<?php echo st_admin_get_form_field('config[shop_id]', __('Identyfikator punktu płatności'), $config->get('shop_id'), 'input_tag', array('required' => true, 'autocomplete' => "off")) ?>
<?php echo st_admin_get_form_field('config[secret_key]', __('Klucz punktu płatności'), $config->get('secret_key'), 'input_tag', array('required' => true, 'autocomplete' => "off")) ?>
<?php if (SF_ENVIRONMENT == 'dev' || $sf_request->hasParameter('debug')): ?>
<?php echo st_admin_get_form_field('config[test]', __('Aktywuj tryb testowy'), 1, 'checkbox_tag', array('checked' => $config->get('test'))) ?>
<?php endif;?>
<?php echo st_admin_get_form_field('config[show_variant]', __('Wybierz kanału płatności'), array('none' => __('W serwisie CashBill (zalecana)'), 'image' => __('W sklepie - graficzna'), 'text' => __('W sklepie - tekstowa')), 'select_tag', array('selected' => $config->get('show_variant'))) ?>
</div>
</fieldset>
<fieldset>
<div class="content">
<?php echo st_admin_get_form_field('url_report', __('Adres serwerowego potwierdzenia transakcji'), "http://".$webRequest->getHost()."/cashbill/reportStatus", 'input_tag', array('readonly' => true, 'size' => 80, 'clipboard' => true)) ?>
</div>
</fieldset>
<?php echo st_get_admin_actions(array(
array('type' => 'download', 'label' => __('Pobierz przewodnik'), 'action' => 'http://www.cashbill.pl/download/integracje/Platnosci/PlatnosciCashBillSOTE.pdf', 'params' => array('target' => '_blank')),
array('type' => 'save', 'label' => __('Zapisz', null, 'stAdminGeneratorPlugin'))
)) ?>
</form>
<br class="st_clear_all">
<?php echo st_get_admin_foot();?>

View File

@@ -0,0 +1,7 @@
fields:
config{shop_id}:
required:
msg: Proszę uzupełnić pole.
config{secret_key}:
required:
msg: Proszę uzupełnić pole.