first commit
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* SOTESHOP/stPolcardPlugin
|
||||
*
|
||||
* Ten plik należy do aplikacji stPolcardPlugin 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 stPolcardPlugin
|
||||
* @subpackage actions
|
||||
* @copyright SOTE (www.sote.pl)
|
||||
* @license http://www.sote.pl/license/sote (Professional License SOTE)
|
||||
* @version $Id: actions.class.php 7196 2010-08-02 12:45:55Z marek $
|
||||
* @author Michal Prochowski <michal.prochowski@sote.pl>
|
||||
*/
|
||||
|
||||
/**
|
||||
* Klasa stPolcardBackendActions
|
||||
*
|
||||
* @package stPolcardPlugin
|
||||
* @subpackage actions
|
||||
*/
|
||||
class stPolcardBackendActions extends stActions
|
||||
{
|
||||
/**
|
||||
* Wyświetla konfigurację modułu
|
||||
*/
|
||||
public function executeIndex()
|
||||
{
|
||||
$this->config = stConfig::getInstance($this->getModuleName());
|
||||
|
||||
if ($this->getRequest()->getMethod() == sfRequest::POST)
|
||||
{
|
||||
$this->config->setFromRequest('config');
|
||||
$this->config->save();
|
||||
$this->setFlash('notice', 'Twoje zmiany zostały zapisane');
|
||||
}
|
||||
|
||||
|
||||
$this->labels = $this->getLabels();
|
||||
}
|
||||
|
||||
public function validateIndex()
|
||||
{
|
||||
if ($this->getRequest()->getMethod() == sfRequest::POST)
|
||||
{
|
||||
stAuthUsersListener::checkModificationCredentials($this, $this->getRequest(), $this->getModuleName());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getLabels()
|
||||
{
|
||||
return array(
|
||||
'config{pos_id}' => $this->getContext()->getI18n()->__('Identyfikator sprzedaży'),
|
||||
'config{shared_key}' => $this->getContext()->getI18n()->__('Klucz współdzielony'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Akcja w przypadku błędu w uzupełnianiu pó
|
||||
*/
|
||||
public function handleErrorIndex()
|
||||
{
|
||||
$this->config = stConfig::getInstance($this->getModuleName());
|
||||
$this->labels = $this->getLabels();
|
||||
return sfView::SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
class stPolcardBackendComponents extends sfComponents
|
||||
{
|
||||
|
||||
public function executeListMenu()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,19 @@
|
||||
<div class="list-menu">
|
||||
<ul>
|
||||
|
||||
<li class="selected">
|
||||
<?php echo link_to(__('Payeezy'),'stPolcardBackend/index')?>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<?php if (sfContext::getInstance()->getUser()->getCulture() == 'pl_PL'): ?>
|
||||
<a href="https://www.sote.pl/docs/payeezy" target="_blank"><?php echo __('Dokumentacja'); ?></a>
|
||||
<?php else: ?>
|
||||
<a href="https://www.soteshop.com/docs/payeezy" target="_blank"><?php echo __('Documentation'); ?></a>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="clr"></div>
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php $protocol = stConfig::getInstance('stSecurityBackend')->get('ssl') ? 'https' : 'http' ?>
|
||||
<?php use_helper('I18N', 'stAdminGenerator', 'Validation') ?>
|
||||
<?php echo st_get_admin_head('stPolcardPlugin', __('Payeezy'), array('culture' => $config->getCulture()), array('stPayment')) ?>
|
||||
<?php st_view_slot_start('application-menu') ?>
|
||||
<?php st_include_component('stPolcardBackend', 'listMenu') ?>
|
||||
<?php st_view_slot_end() ?>
|
||||
<?php st_include_partial('stAdminGenerator/message', array('labels' => $labels, 'i18n_catalogue' => 'stPolcardBackend'));?>
|
||||
<?php echo form_tag('stPolcardBackend/index', array('id' => 'sf_admin_config_form', 'name' => 'sf_admin_config_form', 'class' => 'admin_form'));?>
|
||||
<fieldset>
|
||||
<div class="content">
|
||||
<?php if (SF_ENVIRONMENT == 'dev' || $sf_request->hasParameter('debug')): ?>
|
||||
<div class="row">
|
||||
<?php echo st_admin_get_form_field('config[test]', __('Tryb testowy'), 1, 'checkbox_tag', array('checked' => $config->get('test'))) ?>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<div class="row">
|
||||
<?php echo st_admin_get_form_field('config[pos_id]', __('Identyfikator sprzedaży'), $config->get('pos_id'), 'input_tag', array('required' => true, 'size' => '60')) ?>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<?php echo st_admin_get_form_field('config[shared_key]', __('Klucz współdzielony'), $config->get('shared_key'), 'input_password_tag', array('required' => true, 'size' => '60')) ?>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<h2><?php echo __('Konfiguracja usługi') ?></h2>
|
||||
<div class="content">
|
||||
<div class="row">
|
||||
<?php echo st_admin_get_form_field('config[success]', __('Adres odpowiedzi pozytywnej'), $protocol.'://'.$sf_request->getHost().'/polcard/returnSuccess', 'input_tag', array('readonly' => true, 'size' => '60', 'clipboard' => true)) ?>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<?php echo st_admin_get_form_field('config[fail]', __('Adres odpowiedzi negatywnej'), $protocol.'://'.$sf_request->getHost().'/polcard/returnFail', 'input_tag', array('readonly' => true, 'size' => '60', 'clipboard' => true)) ?>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<?php echo st_admin_get_form_field('config[notify]', __('Adres potwierdzenia'), $protocol.'://'.$sf_request->getHost().'/polcard/statusReport', 'input_tag', array('readonly' => true, 'size' => '60', 'clipboard' => true)) ?>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<?php echo st_get_admin_actions(array(
|
||||
array('type' => 'save', 'label' => __('Zapisz', null, 'stAdminGeneratorPlugin'))
|
||||
)) ?>
|
||||
</form>
|
||||
<div class="clr"></div>
|
||||
<?php echo st_get_admin_foot();?>
|
||||
@@ -0,0 +1,7 @@
|
||||
fields:
|
||||
config{pos_id}:
|
||||
required:
|
||||
msg: Proszę uzupełnić pole.
|
||||
config{shared_key}:
|
||||
required:
|
||||
msg: Proszę uzupełnić pole.
|
||||
Reference in New Issue
Block a user