update
This commit is contained in:
@@ -108,6 +108,7 @@ class DictionaryController extends MainController implements ControllerInterface
|
||||
//'User' => array('User' => 'Index'),
|
||||
'Słowniki' => array('Dictionary' => 'Index'),
|
||||
'Zmienne serwisu' => array('Setup' => 'Index'),
|
||||
'Ustawienia formularza' => array('FormSettings' => 'Index'),
|
||||
// 'Kategorie produktów' => array('ProductCategory' => 'Index'),
|
||||
// 'Serie produktów' => array('ProductSeries' => 'Index'),
|
||||
// 'Materiał produktów' => array('ProductSpec' => 'Index', 'type' => 2),
|
||||
@@ -150,4 +151,4 @@ class DictionaryController extends MainController implements ControllerInterface
|
||||
|
||||
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
61
_rejestracja/Admin/controller/FormSettingsController.php
Normal file
61
_rejestracja/Admin/controller/FormSettingsController.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
class FormSettingsController extends MainController implements ControllerInterface {
|
||||
|
||||
public function IndexAction($param) {
|
||||
$errors = array();
|
||||
|
||||
if (Request::GetPost('doFormSettingsEdit')) {
|
||||
$post = Request::GetAllPost();
|
||||
$errors = RegistrationFormSettings::Validate($post);
|
||||
|
||||
if (empty($errors)) {
|
||||
RegistrationFormSettings::SaveSettings($post);
|
||||
$this->smarty->assign('info', 'Zapisano ustawienia formularza.');
|
||||
$this->smarty->assign('type', 'ok');
|
||||
} else {
|
||||
$this->smarty->assign('info', 'Popraw pola formularza.');
|
||||
$this->smarty->assign('type', 'error');
|
||||
}
|
||||
}
|
||||
|
||||
$settings = RegistrationFormSettings::GetSettings();
|
||||
$this->smarty->assign('settings', $settings);
|
||||
$this->smarty->assign('errors', $errors);
|
||||
}
|
||||
|
||||
public function preDispatch($param) {
|
||||
$this->RunShared('Auth', $param);
|
||||
$this->Run($param);
|
||||
$admin = AuthDAL::GetAdmin();
|
||||
$this->user = $admin;
|
||||
|
||||
$this->smarty->assign('titleAdmin', 'Administracja');
|
||||
$struct = array(
|
||||
'Słowniki' => array('Dictionary' => 'Index'),
|
||||
'Zmienne serwisu' => array('Setup' => 'Index'),
|
||||
'Ustawienia formularza' => array('FormSettings' => 'Index'),
|
||||
);
|
||||
|
||||
$this->smarty->assign('structure', $this->renderStruct($struct));
|
||||
}
|
||||
|
||||
private function renderStruct($struct) {
|
||||
$return = '';
|
||||
|
||||
foreach ($struct as $k => $row) {
|
||||
$return .= '<li><a href="' . Router::GenerateUrl('dictpig', $row) . '">' . $k . '</a></li>';
|
||||
}
|
||||
|
||||
$html = '<ul>';
|
||||
$html .= $return;
|
||||
$html .= '</ul>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
public function postDispatch($param) {
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -144,6 +144,7 @@ class SetupController extends MainController implements ControllerInterface {
|
||||
//'User' => array('User' => 'Index'),
|
||||
'Słowniki' => array('Dictionary' => 'Index'),
|
||||
'Zmienne serwisu' => array('Setup' => 'Index'),
|
||||
'Ustawienia formularza' => array('FormSettings' => 'Index'),
|
||||
// 'Kategorie produktów' => array('ProductCategory' => 'Index'),
|
||||
// 'Serie produktów' => array('ProductSeries' => 'Index'),
|
||||
// 'Materiał produktów' => array('ProductSpec' => 'Index', 'type' => 2),
|
||||
@@ -179,4 +180,4 @@ class SetupController extends MainController implements ControllerInterface {
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
72
_rejestracja/Admin/template/partial/FormSettings/Index.tpl
Normal file
72
_rejestracja/Admin/template/partial/FormSettings/Index.tpl
Normal file
@@ -0,0 +1,72 @@
|
||||
<div class="panelRightTop"></div>
|
||||
<div class="panelRightBody">
|
||||
<div class="paddedContent">
|
||||
{dropDownContainer title="Ustawienia formularza"}
|
||||
{if isset($info)}
|
||||
<div class="{if $type == 'error'}error{else}info{/if}">{$info}</div>
|
||||
{/if}
|
||||
<form method="post" action="">
|
||||
<table align="center" class="adminTable" cellpadding="2" cellspacing="2" style="width: 760px;">
|
||||
<tr>
|
||||
<th colspan="3">Dni udzialu</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 240px;">Jeden dzien z noclegiem</td>
|
||||
<td><textarea name="registration_form_days_lodging" class="input" style="width: 420px; height: 70px;">{$settings.days_lodging_text}</textarea></td>
|
||||
<td>{if isset($errors.registration_form_days_lodging)}<span class="validate">{$errors.registration_form_days_lodging}</span>{/if}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jeden dzien bez noclegu</td>
|
||||
<td><textarea name="registration_form_days_no_lodging" class="input" style="width: 420px; height: 90px;">{$settings.days_no_lodging_text}</textarea></td>
|
||||
<td>{if isset($errors.registration_form_days_no_lodging)}<span class="validate">{$errors.registration_form_days_no_lodging}</span>{/if}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="3">Ceny z parametrow formularza</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Nazwa</td>
|
||||
<td>Cena normalna netto</td>
|
||||
<td>Cena obnizona netto</td>
|
||||
</tr>
|
||||
{foreach from=$settings.prices key=priceKey item=price}
|
||||
{if $priceKey != 'one_day'}
|
||||
<tr>
|
||||
<td>{$price.name} (ID {$price.id})</td>
|
||||
<td><input type="text" name="price[{$price.id}]" value="{$price.price}" class="input" /></td>
|
||||
<td><input type="text" name="price_prom[{$price.id}]" value="{$price.price_prom}" class="input" /></td>
|
||||
</tr>
|
||||
{/if}
|
||||
{/foreach}
|
||||
<tr>
|
||||
<th colspan="3">Ceny jednego dnia</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jeden dzien - cena obnizona netto</td>
|
||||
<td><input type="text" name="registration_form_one_day_price_prom" value="{$settings.one_day_price_prom}" class="input" /></td>
|
||||
<td>{if isset($errors.registration_form_one_day_price_prom)}<span class="validate">{$errors.registration_form_one_day_price_prom}</span>{/if}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jeden dzien - cena normalna netto</td>
|
||||
<td><input type="text" name="registration_form_one_day_price_normal" value="{$settings.one_day_price_normal}" class="input" /></td>
|
||||
<td>{if isset($errors.registration_form_one_day_price_normal)}<span class="validate">{$errors.registration_form_one_day_price_normal}</span>{/if}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="3">VAT</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Mnoznik VAT</td>
|
||||
<td><input type="text" name="registration_form_vat_multiplier" value="{$settings.vat_multiplier}" class="input" /></td>
|
||||
<td>{if isset($errors.registration_form_vat_multiplier)}<span class="validate">{$errors.registration_form_vat_multiplier}</span>{/if}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="2">
|
||||
<input type="submit" value="Zapisz" name="doFormSettingsEdit" class="button buttonZapisz" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
{/dropDownContainer}
|
||||
</div>
|
||||
</div>
|
||||
<div class="panelRightBottom"></div>
|
||||
Reference in New Issue
Block a user