Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 241

Přidáno uživatelem Michal Kliment před více než 15 roky(ů)

V Nastaveni dodelana sekce Ekonomika.

Zobrazit rozdíly:

freenetis/trunk/kohana/application/i18n/cs_CZ/texts.php
'back to vlan interfaces list' => 'Zpět na seznam VLAN rozhraní',
'back to vlans list' => 'Zpět na seznam VLANů',
'bank account' => 'Bankovní účet',
'bank fee' => 'Bankovní poplatek',
'bank fee have to be a number' => 'Bankovní poplatek musí být číslo',
'bad phone format' => 'Špatný formát telefonu',
'bank info' => 'Údaje platby',
'bank transfer fee' => 'Bankovní poplatek',
......
'credit accounts' => 'Kreditní účty',
'current credit' => 'Stav kreditu',
'current credit on this account is' => 'Stav kreditu na tomto účtu je',
'currency' => 'Měna',
'czk' => 'Kč',
'database' => 'Databáze',
'database has been successfully updated' => 'Databáze byla úspěšně upravena.',
......
'do transfer' => 'Proveď transakci',
'double entry account' => 'Podvojný účet',
'duplex' => 'Duplexní',
'economy' => 'Ekonomika',
'economic variables' => 'Ekonomické proměnné',
'economic variables have been successfully updated' => 'Ekonomické proměnné byly úspěšně aktualizovány',
'edit' => 'Upravit',
'edit account' => 'Upravit účet',
'edit device' => 'Upravit zařízení',
......
'engineers' => 'Technici',
'entrance date' => 'Datum vstupu',
'entrance fee' => 'Vstupní příspěvek',
'entrance fee have to be a number' => 'Vstupní příspěvk musí být číslo',
'entrance fee left' => 'Nedoplatek vstupního příspěvku',
'enumerations' => 'Výčty',
'error - cant add new account' => 'Chyba - nelze vytvořit účet.',
......
'fee or penalty comment'=> 'Komentář k poplatku/pokutě',
'from/to'=> 'Od/komu',
'from'=> 'Od',
'gateway ip address' => 'IP adresa brány',
'gateway ip address' => 'IP adresa brány',
'export members to xls file' => 'Exportovat členy do xls souboru',
'fee' => 'Poplatek',
'fee or penalty comment' => 'Komentář k poplatku/pokutě',
......
'minimal duration of interrupt is one month' => 'Minimální délka přerušení je jeden měsíc',
'money transfers' => 'Převody peněz',
'money transfers of member' => 'Převody peněz člena',
'monthly member payment' => 'Měsiční členské příspěvky',
'monthly member payment have to be a number' => 'Měsíční členské příspěvky musí být číslo',
'must be logged in' => 'Musíte se přihlásit.',
'must pay regular fee' => 'Platí pravidelný příspěvek',
'my profile' => 'Můj profil',
......
'origin account' => 'Zdrojový účet',
'original term' => 'Původní výraz',
'ospf area id' => 'OSPF area ID',
'outbound' => 'odchozí',
'outbound' => 'Odchozí',
'page title' => 'Titulek stránky',
'password successfully changed' => 'Heslo úspěšně změněno',
'password' => 'Heslo',
'pay from account' => 'Platit z účtu',
'penalty' => 'Pokuta',
'penalty and fee' => 'Poplatky a pokuty',
'penalty have to be a number' => 'Pokuta musí být číslo',
'phone' => 'Telefon',
'phone already exists in database' => 'Telefon je již v databázi',
'port detail' => 'Detail portu',
......
'send e-mail' => 'Pošli e-mail',
'send sms' => 'Pošli SMS',
'send to member' => 'Pošli členovi',
'settings' => 'Nastavení',
'show all transfers on the account' => 'Ukaž všechny transakce tohoto účtu',
'show his transfers' => 'Zobrazit jeho transakce',
'show his devices' => 'Zobrazit jeho zařízení',
'show his devices' => 'Zobrazit jeho zařízení',
'show transfer' => 'ukaž transakci',
'show transfers on this account' => 'Ukaž transakce tohoto účtu',
'show user' => 'Ukaž uživatele',
......
'subnets' => 'Podsítě',
'suppliers account' => '',
'surname' => 'Příjmení',
'system settings' => 'Nastavení systému',
'system' => 'Systém',
'system users' => 'Systémový uživatelé',
'system variables' => 'Systémové proměnné',
'system variables were successfully updated' => 'Systémové proměnné byly úspěšně aktualizovány',
'system variables werent successfully updated' => 'Systémové proměnné nebyly úspěšně aktualizovány',
'system variables have been successfully updated' => 'Systémové proměnné byly úspěšně aktualizovány',
'system variables havent been updated' => 'Systémové proměnné nebyly úspěšně aktualizovány',
'tag_802_1q' => 'tag 802.1Q',
'technology' => 'Technologie',
'the transfer successfully done' => 'Transakce úspěšně dokončena',
......
'total items' => 'Celkem položek',
'town' => 'Město',
'transfer details' => 'Detaily transakce',
'transfer fee' => 'Poplatek za transakci',
'transfer fee have to be a number' => 'Poplatek za transakci musí být číslo',
'transfer informations' => 'Informace o transakci',
'transfers' => 'Transakce',
'translated term' => 'Přeložený výraz',
freenetis/trunk/kohana/application/controllers/settings.php
{
url::redirect(url_lang::base().'settings/system');
}
/**
* @author Michal Kliment
* Form to set up system variables
*/
function system()
{
......
$this->form->group('')->label(url_lang::lang('texts.System variables'));
// just only variable page title
$this->form->input('title')->label(url_lang::lang('texts.Page title').':')->rules('length[3,40]')->value($this->setting->title);
$this->form->input('title')->label(url_lang::lang('texts.Page title').':')->rules('length[3,40]|required')->value($this->setting->title);
$this->form->submit('submit')->value(url_lang::lang('texts.Save'));
special::required_forge_style($this->form, ' *', 'required');
......
}
if ($issaved)
// if all action were succesfull
$this->session->set_flash('message', url_lang::lang('texts.System variables were successfully updated').'.');
$this->session->set_flash('message', url_lang::lang('texts.System variables have been successfully updated').'.');
else
// if not
$this->session->set_flash('message', url_lang::lang('texts.System variables werent successfully updated').'.');
$this->session->set_flash('message', url_lang::lang('texts.System variables havent been successfully updated').'.');
url::redirect(url_lang::base().'settings/system');
}
......
$view->footer = new View('base/footer');
$view->content = new View('settings/system');
$view->content->form = $this->form->html();
$view->content->headline = url_lang::lang('texts.System settings');
$view->content->headline = url_lang::lang('texts.Settings').' - '.url_lang::lang('texts.System');
$view->header->menu = Controller::render_menu();
$view->header->title = url_lang::lang('texts.System settings');
$view->header->title = url_lang::lang('texts.Settings').' - '.url_lang::lang('texts.System');
$view->render(TRUE);
}
/**
* @author Michal Kliment
* form to set up economic variables
*/
function economy()
{
// access control
if (!$this->acl_check_edit(get_class($this),'economy'))
Controller::error(1);
// creating of new forge
$this->form = new Forge(url_lang::base()."settings/economy", '', 'POST', array('id' => 'article_form'));
$this->form->set_attr('class', 'form_class')->set_attr('method', 'post');
$this->form->group('')->label(url_lang::lang('texts.Economic variables'));
$this->form->input('currency')->label(url_lang::lang('texts.Currency').':')->rules('length[3,40]|required')->value($this->setting->currency);
$this->form->input('entrance_fee')->label(url_lang::lang('texts.Entrance fee').':')->rules('length[1,40]')->value($this->setting->entrance_fee)->callback(array($this, 'valid_entrance_fee'));
$this->form->input('monthly_member_payment')->label(url_lang::lang('texts.Monthly member payment').':')->rules('length[1,40]|required')->value($this->setting->monthly_member_payment)->callback(array($this, 'valid_monthly_member_payment'));
$this->form->input('bank_fee')->label(url_lang::lang('texts.Bank fee').':')->rules('length[1,40]')->value($this->setting->bank_fee)->callback(array($this, 'valid_bank_fee'));
$this->form->input('transfer_fee')->label(url_lang::lang('texts.Transfer fee').':')->rules('length[1,40]')->value($this->setting->transfer_fee)->callback(array($this, 'valid_transfer_fee'));
$this->form->input('penalty')->label(url_lang::lang('texts.Penalty').':')->rules('length[1,40]')->value($this->setting->penalty)->callback(array($this, 'valid_penalty'));
$this->form->submit('submit')->value(url_lang::lang('texts.Save'));
special::required_forge_style($this->form, ' *', 'required');
// form validate
if ($this->form->validate())
{
$form_data = $this->form->as_array();
$config_model = new Config_Model();
$issaved = true;
foreach ($form_data as $name => $value)
{
// check if variable exists
if ($config_model->check_exist_variable($name))
// update of variable
$issaved = $issaved && $config_model->update_variable($name,$value);
else
// insert new variable
$issaved = $issaved && $config_model->insert_variable($name,$value);
}
if ($issaved)
// if all action were succesfull
$this->session->set_flash('message', url_lang::lang('texts.Economic variables have been successfully updated').'.');
else
// if not
$this->session->set_flash('message', url_lang::lang('texts.Economic variables havent been successfully updated').'.');
url::redirect(url_lang::base().'settings/economy');
}
// create view for this template
$view = new View('template');
$view->header = new View('base/header');
$view->footer = new View('base/footer');
$view->content = new View('settings/economy');
$view->content->form = $this->form->html();
$view->content->headline = url_lang::lang('texts.Settings').' - '.url_lang::lang('texts.Economy');
$view->header->menu = Controller::render_menu();
$view->header->title = url_lang::lang('texts.Settings').' - '.url_lang::lang('texts.Economy');
$view->render(TRUE);
}
// start of validation function
function valid_entrance_fee($input)
{
if (!is_numeric($input->value))
$input->add_error('required', url_lang::lang('texts.Entrance fee have to be a number'));
}
function valid_monthly_member_payment($input)
{
if (!is_numeric($input->value))
$input->add_error('required', url_lang::lang('texts.Monthly member payment have to be a number'));
}
function valid_bank_fee($input)
{
if (!is_numeric($input->value))
$input->add_error('required', url_lang::lang('texts.Bank fee have to be a number'));
}
function valid_transfer_fee($input)
{
if (!is_numeric($input->value))
$input->add_error('required', url_lang::lang('texts.Transfer fee have to be a number'));
}
function valid_penalty($input)
{
if (!is_numeric($input->value))
$input->add_error('required', url_lang::lang('texts.Penalty have to be a number'));
}
// end of validatation function
}
?>
freenetis/trunk/kohana/application/upgrade_sql/upgrade_sql_239.php
<?php
$upgrade_sql[239] = array(
"ALTER TABLE `accounts` CHANGE `type` `type_old` ENUM( 'bank', 'analytic', 'master', 'project', 'operating', 'infrastructure', 'suppliers', 'unidentified' ) CHARACTER SET utf8 COLLATE utf8_czech_ci NULL DEFAULT NULL",
"ALTER TABLE `accounts` ADD `type_id` INT( 11 ) NOT NULL AFTER `name`",
"INSERT INTO `enum_types` (`id`,`type_id`,`value`) VALUES
('27', '5', 'bank'),
('28', '5', 'analytic'),
('29', '5', 'master'),
('30', '5', 'project'),
('31', '5', 'operating'),
('32', '5', 'infrastructure'),
('33', '5', 'suppliers'),
('34', '5', 'unidentified');",
"UPDATE `accounts`, `enum_types` SET `accounts`.`type_id` = `enum_types`.`id` WHERE `accounts`.`type_old` = `enum_types`.`value`;",
"ALTER TABLE `accounts` DROP `type_old`, DROP `start_amount`;"
);
?>
freenetis/trunk/kohana/application/upgrade_sql/upgrade_sql.php
$upgrade_sql[get_SVN_rev()] = array(
"ALTER TABLE `accounts` CHANGE `type` `type_old` ENUM( 'bank', 'analytic', 'master', 'project', 'operating', 'infrastructure', 'suppliers', 'unidentified' ) CHARACTER SET utf8 COLLATE utf8_czech_ci NULL DEFAULT NULL",
"UPDATE `acl` SET `note` = 'Administratori systemu mohou spravovat zneni prekladu a veskere nastaveni.' WHERE `acl`.`id` = 57 LIMIT 1;",
"ALTER TABLE `accounts` ADD `type_id` INT( 11 ) NOT NULL AFTER `name`",
"INSERT INTO `axo` (`id`, `section_value`, `value`, `order_value`, `name`, `hidden`) VALUES
(130, 'Settings_Controller', 'economy', 0, 'Ekonomika', 0);",
"INSERT INTO `enum_types` (`id`,`type_id`,`value`) VALUES
('27', '5', 'bank'),
('28', '5', 'analytic'),
('29', '5', 'master'),
('30', '5', 'project'),
('31', '5', 'operating'),
('32', '5', 'infrastructure'),
('33', '5', 'suppliers'),
('34', '5', 'unidentified');",
"UPDATE `accounts`, `enum_types` SET `accounts`.`type_id` = `enum_types`.`id` WHERE `accounts`.`type_old` = `enum_types`.`value`;",
"ALTER TABLE `accounts` DROP `type_old`, DROP `start_amount`;"
"INSERT INTO `axo_map` (`acl_id`, `section_value`, `value`) VALUES
(57, 'Settings_Controller', 'economy');"
);
freenetis/trunk/kohana/application/libraries/Setting.php
<?php defined('SYSPATH') or die('No direct script access.');
class Setting
class Setting
{
private $config = NULL;
// setting up default value of some variables
private $title = 'FreeNetIS';
private $db_schema_version = 0;
public function __construct()
private $db_schema_version = 0;
private $currency = 'CZK';
private $entrance_fee = 0;
private $monthly_member_payment = 0;
private $bank_fee = 0;
private $transfer_fee = 0;
private $penalty = 0;
public function __construct()
{
// creating of config model + // creating of config model
$this->config = new Config_Model();
}
......
}
}
}
}
freenetis/trunk/kohana/application/libraries/MY_Controller.php
if ($this->acl_check_2D('menu', 'administration'))
$myMenu .= '<li class="administration"><h2>'.url_lang::lang('texts.Administration').'</h2>
<ul>
<li>'.html::anchor(url_lang::base().'settings/system', url_lang::lang('texts.System settings')).'</li>
<li>'.html::anchor(url_lang::base().'settings', url_lang::lang('texts.Settings')).'</li>
<li>'.html::anchor(url_lang::base().'access_rights', url_lang::lang('texts.Access rights')).'</li>
<li>'.html::anchor(url_lang::base().'translations', url_lang::lang('texts.Translations')).'</li>
<li>'.html::anchor(url_lang::base().'enum_types', url_lang::lang('texts.Enumerations')).'</li>
freenetis/trunk/kohana/application/views/settings/economy.php
<h2><?php echo $headline ?></h2>
<br />
<?php echo ($message = $this->session->get('message')) ? '<div class="message">'.$message.'</div>' : '' ?>
<?php echo url_lang::lang('texts.Section') ?>: <?php echo html::anchor(url_lang::base().'settings/system',url_lang::lang('texts.System')) ?> - <?php echo url_lang::lang('texts.Economy') ?>
<br /><br />
<?php echo $form ?>
freenetis/trunk/kohana/application/views/settings/system.php
<h2><?php echo $headline ?></h2>
<br />
<?php echo ($message = $this->session->get('message')) ? '<div class="message">'.$message.'</div>' : '' ?>
<?php echo (isset($create)) ? $create : '' ?>
<?php echo url_lang::lang('texts.Section') ?>: <?php echo url_lang::lang('texts.System') ?> - <?php echo html::anchor(url_lang::base().'settings/economy',url_lang::lang('texts.Economy')) ?>
<br /><br />
<?php echo $form ?>

Také k dispozici: Unified diff