Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 424

Přidáno uživatelem Jiří Sviták před asi 15 roky(ů)

Opravy ruznych chyb, pridana prace se sablonami bankovnich vypisu pro CSV soubory.

Zobrazit rozdíly:

freenetis/trunk/kohana/application/i18n/cs_CZ/texts.php
'add new project account' => 'Přidat nový projektový účet',
'add new segment' => 'Přidat nový segment',
'add new subnet' => 'Přidat novou podsíť',
'add new template' => 'Přidat novou šablonu',
'add new transfer' => 'Přidat nový převod',
'add new translation' => 'Přidat nový překlad',
'add new user' => 'Přidat nového uživatele',
......
'back to account transfers' => 'Zpět na převody účtu',
'back to all subnets' => 'Zpět na seznam podsítí',
'back to bank accounts' => 'Zpět na bankovní účty',
'back to bank templates' => 'Zpět na bankovní šablony',
'back to day book' => 'Zpět na účetní deník',
'back to detail' => 'Zpět na detail',
'back to device parameters' => 'Zpět na parametry zařízení',
......
'bank fees' => 'Bankovní poplatky',
'bank info' => 'Údaje platby',
'bank interests' => 'Bankovní úroky',
'bank templates of csv files' => 'Bankovní šablony pro CSV soubory',
'bank transfer' => 'Bankovní převod',
'bank transfer fee' => 'Bankovní poplatek',
'bank transfer id' => 'ID bankovního převodu',
......
'cash' => 'Pokladna',
'cash flow' => 'Peněžní tok',
'code' => 'Kód',
'column headers' => 'Hlavičky sloupců',
'comment' => 'Komentář',
'confirm' => 'Potvrdit',
'confirm password' => 'Heslo znovu',
......
'contractual increase' => 'Smluvní navýšení',
'cookies must be enabled' => 'Musí být zapnuty cookies.',
'counteraccount' => 'Protiúčet',
'counteraccount bank code' => 'Kód banky protiúčtu',
'counteraccount name' => 'Název protiúčtu',
'counteraccount number' => 'Číslo protiúčtu',
'credit' => 'Kredit',
'credit accounts' => 'Kreditní účty',
'csv file template' => 'Šablona CSV souboru',
'csv file templates' => 'Šablony CSV souborů',
'current application password is' => 'Současné aplikační heslo je',
'current credit' => 'Současný kredit',
'currency' => 'Měna',
......
'error - amount has to be positive' => 'Chyba - částka musí být kladná.',
'error - cant add new account' => 'Chyba - nelze vytvořit účet.',
'error - cant add new member' => 'Chyba - nelze vytvořit člena.',
'error - cant add new template' => 'Chyba - nelze přidat novou šablonu.',
'error - cant add new user' => 'Chyba - nelze vytvořit uživatele.',
'error - cant add new work' => 'Chyba - nelze přidat novou práci.',
'error - cant deduct entrance fee' => 'Chyba - nelze strhnout vstupní příspěvek.',
......
'error - cant update account' => 'Chyba - nelze upravit účet.',
'error - cant update additional contacts' => 'Chyba - nelze upravit další kontakty.',
'error - cant update member' => 'Chyba - nelze upravit člena.',
'error - cant update template' => 'Chyba - nelze upravit šablonu.',
'error - cant update transfer' => 'Chyba - nelze upravit převod.',
'error - cant update user' => 'Chyba - nelze upravit uživatele.',
'error - cant update work' => 'Chyba - nelze upravit práci.',
......
'fees' => 'Poplatky',
'fees have been successfully deducted' => 'Členské příspěvky byly úspěšně strženy.',
'file' => 'Soubor',
'file with bank transfer listing' => 'HTML soubor s výpisem z banky',
'file type' => 'Typ souboru',
'file with bank transfer listing' => 'Soubor s bankovním výpisem',
'fill in at least one from prices' => 'Vyplňte alespoň jednu z cen.',
'filter' => 'Filtrovat',
'finances' => 'Finance',
......
'system variables havent been updated' => 'Systémové proměnné nebyly úspěšně aktualizovány',
'tag_802_1q' => 'tag 802.1Q',
'technology' => 'Technologie',
'template' => 'Šablona',
'template has been successfully added' => 'Šablona byla úspěšně přidána.',
'template has been successfully updated' => 'Šablona byla úspěšně upravena.',
'template name' => 'Název šablony',
'the first bank account information' => 'Údaje o prvním bankovním účtu',
'the parsed account is unknown' => 'Parsovaný účet je neznámý',
'the transfer successfully done' => 'Převod úspěšně dokončen',
......
'transfer' => 'Převod',
'transfer details' => 'Detaily převodu',
'transfer fee' => 'Poplatek za platbu',
'transfer fee have to be a number' => 'Poplatek za převod musí být číslo',
'transfer has been successfully added' => 'Převod byl úspěšně přidán.',
'transfer has been successfully updated' => 'Převod byl úspěšně upraven.',
'transfer id' => 'ID převodu',
......
'unknown ip address' => 'Neznámá IP adresa',
'unlogged user' => 'Nepřihlášený uživatel',
'update' => 'Upravit',
'upload bank transfers listing' => 'Uploaduj výpis z banky',
'upload bank transfers listing' => 'Nahrát bankovní výpis',
'user' => 'Uživatel',
'user cannot be deleted, he has some dependent items in database' => 'Uživatel nelze smazat, má závislé objekty v databázi.',
'user identification' => 'Identifikace uživatele',
freenetis/trunk/kohana/application/controllers/bank_templates.php
<?php
/**
* This controller handles work with bank templates for CSV bank listing files.
* @author Jiri Svitak
*
*/
class Bank_templates_Controller extends Controller
{
function index()
{
url::redirect(url_lang::base().'bank_templates/show_all');
}
/**
* Shows all bank templates for CSV files.
* @param $limit_results
* @param $order_by
* @param $order_by_direction
* @return unknown_type
*/
function show_all($limit_results = 200, $order_by = 'id', $order_by_direction = 'asc', $page_word = null, $page = 1)
{
if (!$this->acl_check_view('Accounts_Controller', 'bank_transfers'))
Controller::Error(ACCESS);
// get new selector
if (is_numeric($this->input->get('record_per_page')))
$limit_results = (int) $this->input->get('record_per_page');
// get order of grid from parameters
$allowed_order_type = array('id', 'original_term', 'translated_term', 'lang');
if (!in_array(strtolower($order_by),$allowed_order_type))
$order_by = 'id';
if (strtolower($order_by_direction) != 'asc' && strtolower($order_by_direction) != 'desc')
$order_by_direction = 'asc';
// get data from database
$model_templates = new Bank_template_Model();
$total_templates = count($model_templates->find_all());
if (($sql_offset = ($page - 1) * $limit_results) > $total_templates)
$sql_offset = 0;
$templates = $model_templates->orderby($order_by, $order_by_direction)->limit($limit_results, $sql_offset)->find_all();
$headline = url_lang::lang('texts.Bank templates of CSV files');
$grid = new Grid(url_lang::base().'translations', $headline, array(
//'separator' => '',
'use_paginator' => true,
'use_selector' => true,
'current' => $limit_results, //current selected 'records_per_page' value
'selector_increace' => 200, // increace
'selector_min' => 200, // minimum where selector start
'selector_max_multiplier' => 10,
'base_url' => Config::item('locale.lang').'/bank_templates/show_all/'.$limit_results.'/'.$order_by.'/'.$order_by_direction,
'uri_segment' => 'page', // pass a string as uri_segment to trigger former 'label' functionality
'total_items' => $total_templates, // use db count query here of course
'items_per_page' => $limit_results, // it may be handy to set defaults for stuff like this in config/pagination.php
'style' => 'classic',
'order_by' => $order_by,
'order_by_direction' => $order_by_direction,
'limit_results' => $limit_results,
'message' => $this->session->get_once('message')
));
$grid->add_new_button(url_lang::base().'bank_templates/add', url_lang::lang('texts.Add new template'));
$grid->order_field('id')->label(url_lang::lang('texts.ID'));
$grid->order_field('template_name')->label(url_lang::lang('texts.Template name'));
$grid->action_field('id')->label(url_lang::lang('texts.Template'))->url(url_lang::base().'bank_templates/show')->action(url_lang::lang('texts.Show'));
$grid->action_field('id')->label(url_lang::lang('texts.Template'))->url(url_lang::base().'bank_templates/edit')->action(url_lang::lang('texts.Edit'));
//$grid->action_field('id')->label(url_lang::lang('texts.Template'))->url(url_lang::base().'bank_templates/delete')->action(url_lang::lang('texts.Delete'));
$grid->datasource($templates);
$view = new View('template');
$view->header = new View('base/header');
$view->footer = new View('base/footer');
$view->content = $grid;
$view->header->menu = Controller::render_menu();
$view->header->title = $headline;
$view->render(TRUE);
}
/**
* Function shows bank template of csv file.
* @param $template_id
* @return unknown_type
*/
function show($template_id = null)
{
if (!isset($template_id))
{
Controller::warning(PARAMETER);
}
$template = new Bank_template_Model($template_id);
if ($template->id == 0)
{
Controller::error(RECORD);
}
// to do
//if (!$this->acl_check_view(get_class($this),'devices',$member_id))
// Controller::error(ACCESS);
$headline = url_lang::lang('texts.Add new template');
$view = new View('template');
$view->header = new View('base/header');
$view->header->menu = Controller::render_menu();
$view->header->title = $headline;
$view->content = new View('bank_templates_show');
$view->content->template = $template;
$view->content->headline = $headline;
$view->content->message = $this->session->get_once('message');
$view->footer = new View('base/footer');
$view->render(TRUE);
}
/**
* Function adds new bank template for csv files.
* @return unknown_type
*/
function add()
{
$form = new Forge(url_lang::base().'bank_templates/add', '', 'POST', array('id' => 'article_form'));
$form->set_attr('class', 'form_class')->set_attr('method', 'post');
$form->group('')->label(url_lang::lang('texts.Template name'));
$form->input('template_name')->label(url_lang::lang('texts.Template name').':')->rules('required|length[1,50]');
$form->group('')->label(url_lang::lang('texts.Column headers'));
$form->input('account_name')->label(url_lang::lang('texts.Account name').':')->rules('required|length[1,30]');
$form->input('account_number')->label(url_lang::lang('texts.Account number').':')->rules('required|length[1,30]');
$form->input('bank_code')->label(url_lang::lang('texts.Bank code').':')->rules('required|length[1,30]');
$form->input('constant_symbol')->label(url_lang::lang('texts.Constant symbol').':')->rules('required|length[1,30]');
$form->input('variable_symbol')->label(url_lang::lang('texts.Variable symbol').':')->rules('required|length[1,30]');
$form->input('specific_symbol')->label(url_lang::lang('texts.Specific symbol').':')->rules('required|length[1,30]');
$form->input('counteraccount_name')->label(url_lang::lang('texts.Counteraccount name').':')->rules('required|length[1,30]');
$form->input('counteraccount_number')->label(url_lang::lang('texts.Counteraccount number').':')->rules('required|length[1,30]');
$form->input('counteraccount_bank_code')->label(url_lang::lang('texts.Counteraccount bank code').':')->rules('required|length[1,30]');
$form->input('text')->label(url_lang::lang('texts.Text').':')->rules('required|length[1,30]');
$form->input('amount')->label(url_lang::lang('texts.Amount').':')->rules('required|length[1,30]');
$form->input('datetime')->label(url_lang::lang('texts.Date and time').':')->rules('required|length[1,30]');
$form->submit('submit')->value(url_lang::lang('texts.Add'));
special::required_forge_style($form, ' *', 'required');
if ($form->validate())
{
$form_data = $form->as_array();
$template = new Bank_template_Model();
foreach($form_data as $key => $value)
{
$template->$key = htmlspecialchars($value);
}
if ($template->save())
{
$this->session->set_flash('message', url_lang::lang('texts.Template has been successfully added.'));
url::redirect(url_lang::base().'bank_templates/show'.$template->id);
}
else
{
$this->session->set_flash('message', url_lang::lang('texts.Error - cant add new template.'));
url::redirect(url_lang::base().'bank_templates/show'.$template->id);
}
}
else
{
$view = new View('template');
$view->header = new View('base/header');
$view->content = new View('form');
$view->footer = new View('base/footer');
$view->header->menu = Controller::render_menu();
$view->header->title = url_lang::lang('texts.Add new template');
$view->content->headline = url_lang::lang('texts.Add new template');
$view->content->link_back = html::anchor(url_lang::base().'bank_templates/show_all/',url_lang::lang('texts.Back to bank templates'));
$view->content->form = $form->html();
$view->render(TRUE);
}
}
/**
* Function edits bank template for csv files.
* @return unknown_type
*/
function edit($template_id = null)
{
if (!isset($template_id))
{
Controller::warning(PARAMETER);
}
$template = new Bank_template_Model($template_id);
if ($template->id == 0)
{
Controller::error(RECORD);
}
$form = new Forge(url_lang::base().'bank_templates/edit/'.$template_id, '', 'POST', array('id' => 'article_form'));
$form->set_attr('class', 'form_class')->set_attr('method', 'post');
$form->group('')->label(url_lang::lang('texts.Template name'));
$form->input('template_name')->label(url_lang::lang('texts.Template name').':')->rules('required|length[1,50]')->value($template->template_name);
$form->group('')->label(url_lang::lang('texts.Column headers'));
$form->input('account_name')->label(url_lang::lang('texts.Account name').':')->rules('required|length[1,30]')->value($template->account_name);
$form->input('account_number')->label(url_lang::lang('texts.Account number').':')->rules('required|length[1,30]')->value($template->account_number);
$form->input('bank_code')->label(url_lang::lang('texts.Bank code').':')->rules('required|length[1,30]')->value($template->bank_code);
$form->input('constant_symbol')->label(url_lang::lang('texts.Constant symbol').':')->rules('required|length[1,30]')->value($template->constant_symbol);
$form->input('variable_symbol')->label(url_lang::lang('texts.Variable symbol').':')->rules('required|length[1,30]')->value($template->variable_symbol);
$form->input('specific_symbol')->label(url_lang::lang('texts.Specific symbol').':')->rules('required|length[1,30]')->value($template->specific_symbol);
$form->input('counteraccount_name')->label(url_lang::lang('texts.Counteraccount name').':')->rules('required|length[1,30]')->value($template->counteraccount_name);
$form->input('counteraccount_number')->label(url_lang::lang('texts.Counteraccount number').':')->rules('required|length[1,30]')->value($template->counteraccount_number);
$form->input('counteraccount_bank_code')->label(url_lang::lang('texts.Counteraccount bank code').':')->rules('required|length[1,30]')->value($template->counteraccount_bank_code);
$form->input('text')->label(url_lang::lang('texts.Text').':')->rules('required|length[1,30]')->value($template->text);
$form->input('amount')->label(url_lang::lang('texts.Amount').':')->rules('required|length[1,30]')->value($template->amount);
$form->input('datetime')->label(url_lang::lang('texts.Date and time').':')->rules('required|length[1,30]')->value($template->datetime);
$form->submit('submit')->value(url_lang::lang('texts.Edit'));
special::required_forge_style($form, ' *', 'required');
if ($form->validate())
{
$form_data = $form->as_array();
foreach($form_data as $key => $value)
{
$template->$key = htmlspecialchars($value);
}
if ($template->save())
{
$this->session->set_flash('message', url_lang::lang('texts.Template has been successfully updated.'));
url::redirect(url_lang::base().'bank_templates/show/'.$template->id);
}
else
{
$this->session->set_flash('message', url_lang::lang('texts.Error - cant edit new template.'));
url::redirect(url_lang::base().'bank_templates/show'.$template->id);
}
}
else
{
$view = new View('template');
$view->header = new View('base/header');
$view->content = new View('form');
$view->footer = new View('base/footer');
$view->header->menu = Controller::render_menu();
$view->header->title = url_lang::lang('texts.Add new template');
$view->content->headline = url_lang::lang('texts.Add new template');
$view->content->link_back = html::anchor(url_lang::base().'bank_templates/show_all/',url_lang::lang('texts.Back to bank templates'));
$view->content->form = $form->html();
$view->render(TRUE);
}
}
}
?>
freenetis/trunk/kohana/application/controllers/members.php
*/
function registration($limit_results = 500, $page = 1)
{
if (!$this->acl_check_edit(get_class($this), 'registration')) Controller::error(ACCESS);
if ($this->input->post('registrationsubmit')!='')
{
$arr_ids = $this->input->post('ids');
$limit_results = $this->input->post('limit_results');
$page = $this->input->post('page');
$arr_registrations = $this->input->post('registrations');
$issaved = true;
foreach($arr_ids as $id)
{
$member = new Member_Model($id);
$member->registration = false;
$issaved = $issaved && $member->save();
}
if(isset($arr_registrations))
{
foreach($arr_registrations as $i => $registration)
{
$member = new Member_Model($i);
$member->registration = true;
$issaved = $issaved && $member->save();
}
}
url::redirect(url_lang::base().'members/registration/'.$limit_results.'/'.$page);
}
else
{
$member_model = new Member_Model();
$count = $member_model->count_all_members();
$min = ($page-1) * $limit_results;
$max_page = $count / $limit_results;
if($count % $limit_results >0) $max_page++;
$members = $member_model->get_all_members_to_registration($min, $limit_results);
$view = new View('template');
$view->header = new View('base/header');
$view->content = new View('members/registration');
$view->footer = new View('base/footer');
$view->header->menu = Controller::render_menu();
$view->header->title = url_lang::lang('texts.Administration of members registrations');
//$view->header->other_styles = html::stylesheet('media/css/forms.css');
$view->content->members = $members;
$view->content->page = $page;
$view->content->max_page = $max_page;
......
* @param encoding optional parameter; by default the result is encoded in utf-8 and encoding can change this
* @return unknown_type
*/
function csv_export($encoding = null)
function csv_export($encoding = 'utf-8')
{
// access rights
if (!$this->acl_check_view(get_class($this),'members'))
......
// yes and no for registration
$yes = url_lang::lang('texts.yes');
$no = url_lang::lang('texts.no');
// encoding of characters
if (!isset($encoding))
$encoding = 'utf-8';
// this foreach goes through rows
foreach ($members as $line)
{
......
$title = url_lang::lang('texts.'.$key);
// file cannot start with ID, otherwise excel and openoffice think that the file is invalid
if ($title == 'ID')
$title = 'Číslo';
$title = url_lang::lang('texts.Number');
// character encoding
if ($encoding != 'utf-8')
$title = iconv ('utf-8', $encoding, $title);
freenetis/trunk/kohana/application/controllers/users.php
if (!isset($user_id))
Controller::warning(PARAMETER);
$user_model=new User_Model();
$user_model = new User_Model();
$user_model->find($user_id);
if ($user_model->id == 0)
Controller::error(RECORD);
$this->user_id = $user_id;
//check if logged user have access right to edit this user
......
$view->footer = new View('base/footer');
$view->header->menu = Controller::render_menu();
$view->header->title = url_lang::lang('texts.Display member');
$view->content->headline = url_lang::lang('texts.Editing of user').' '.$user_data->pre_title.' '.$user_data->name.' '.$user_data->middle_name.' '.$user_data->surname.' '.$user_data->post_title;
$view->content->headline = url_lang::lang('texts.Editing of user').' '.$user_model->pre_title.' '.$user_model->name.' '.$user_model->middle_name.' '.$user_model->surname.' '.$user_model->post_title;
$view->content->form = $form->html();
$view->content->link_back = html::anchor(url_lang::base().'users/show/'.$user_data->id,url_lang::lang('texts.Back to this user'));
$view->content->link_back = html::anchor(url_lang::base().'users/show/'.$user_model->id,url_lang::lang('texts.Back to this user'));
$view->render(TRUE);
}
} // end of edit function
freenetis/trunk/kohana/application/controllers/translations.php
// check if logged user have access right to view all translations
if (!$this->acl_check_view(get_class($this),'translation'))
Controller::Error(1);
Controller::Error(ACCESS);
// get new selector
if (is_numeric($this->input->get('record_per_page')))
......
$view->footer = new View('base/footer');
$view->content = new View('show_all');
$view->content->table = $grid;
$view->content->headline = '';
$view->content->headline = url_lang::lang('texts.Translations');
$view->header->menu = Controller::render_menu();
$view->header->title = url_lang::lang('texts.Translations');
$view->render(TRUE);
......
{
// access control
if (!$this->acl_check_new(get_class($this),'translation'))
Controller::error(1);
Controller::error(ACCESS);
// form for new translation
$form = new Forge(url_lang::base().'translations/add', '', 'POST', array('id' => 'article_form'));
......
// has translation been successfully saved?
if ($translation_data->save())
{
$this->session->set_flash('message', url_lang::lang('texts.Translation has been successfully added').'.');
$this->session->set_flash('message', url_lang::lang('texts.Translation has been successfully added.'));
url::redirect(url_lang::base().'translations/show_all');
}
else
......
{
// access control
if (!$this->acl_check_edit(get_class($this),'translation'))
Controller::error(1);
Controller::error(ACCESS);
if (isset($id))
{
......
unset($form_data);
if ($translation_model->save())
{
$this->session->set_flash('message', url_lang::lang('texts.Translation has been successfully updated').'.');
$this->session->set_flash('message', url_lang::lang('texts.Translation has been successfully updated.'));
url::redirect(url_lang::base().'translations/show_all');
exit;
}
}
// view for editing user
$view = new View('template');
$view->header = new View('base/header');
$view->content = new View('translations/edit');
$view->content = new View('form');
$view->footer = new View('base/footer');
$view->header->menu = Controller::render_menu();
$view->header->title = url_lang::lang('texts.Edit translation');
......
}
else
{
Controller::warning(1);
Controller::warning(PARAMETER);
}
}
......
{
// access control
if (!$this->acl_check_delete(get_class($this),'translation'))
Controller::error(1);
Controller::error(ACCESS);
if (isset($id))
{
......
}
else
{
Controller::warning(1);
Controller::warning(PARAMETER);
}
}
freenetis/trunk/kohana/application/controllers/bank_accounts.php
// adding bank account
if ($this->acl_check_new('Accounts_Controller', 'bank_accounts'))
$baa_grid->add_new_button(url_lang::base().'bank_accounts/add', url_lang::lang('texts.Add new bank account of association'));
// csv file templates for bank listings
if ($this->acl_check_view('Accounts_Controller', 'bank_transfers'))
$baa_grid->add_new_button(url_lang::base().'bank_templates/show_all', url_lang::lang('texts.CSV file templates'));
$baa_grid->field('id')->label(url_lang::lang('texts.ID'));
$baa_grid->field('baname')->label(url_lang::lang('texts.Account name'));
$baa_grid->field('account_number')->label(url_lang::lang('texts.Account number'));
freenetis/trunk/kohana/application/controllers/accounts.php
* @param $id
* @return unknown_type
*/
public function upload_bank_file($id=null) {
public function upload_bank_file($id=null)
{
if (!isset($id))
Controller::warning(PARAMETER);
if (!$this->acl_check_new('Accounts_Controller', 'bank_transfers'))
Controller::error(ACCESS);
$bank_acc_model=new Bank_account_Model($id);
if ($bank_acc_model->id == 0)
Controller::error(RECORD);
// file types of bank listings
$types = array();
$types[0] = 'HTML eBanka';
$types[1] = 'texts.CSV';
// csv templates
// form
$form = new Forge(url_lang::base()."accounts/upload_bank_file/$id", '','POST',array('id' => 'article_form'));
$form->set_attr('class', 'form_class')->set_attr('method', 'post');
$form->dropdown('type')->label(url_lang::lang('texts.File type'))->options($types)->rules('required');
$form->dropdown('csv_template')->label(url_lang::lang('texts.CSV file template'));
$form->upload('listing', TRUE)->label(url_lang::lang('texts.File with bank transfer listing'))
->rules('required|allow[htm,html]');
$form->submit(url_lang::lang('texts.Submit'));
special::required_forge_style($form, ' *', 'required');
// validation
if($form->validate())
{
$try_default=true;
if (isset($id)) { // známe id, účtu, který se má importovat?
$bank_acc_model=new Bank_account_Model($id);
if ($bank_acc_model->id)
switch ($bank_acc_model->bank_nr) {
case "0300":
$try_default=false;
break;
case "2400":
case "5500":
default:
} // switch
}
if ($try_default) $this->parse_ebank_account(null, $form->listing->value);
{
if ($form['type'] == 0)
{
$this->parse_ebank_account(null, $form->listing->value);
}
else
{
echo 'CSV import still not supported';
die();
}
}
else
{
$title = url_lang::lang('texts.Upload bank transfers listing');
$view->form = new View('registration');
$view = new View('template');
$view->header = new View('base/header');
$view->header->title = $title;
$view->header->menu = Controller::render_menu();
$view->content = new View('form');
$view->content->form = $form->html();
$view->content->link_back = html::anchor(url_lang::base().'accounts/show_all',
url_lang::lang('texts.Back to bank accounts'));
$view->content->link_back = html::anchor(url_lang::base().'bank_accounts/show_all', url_lang::lang('texts.Back to bank accounts'));
$view->content->headline = $title;
$view->footer = new View('base/footer');
$view->render(TRUE);
$view->footer = new View('base/footer');
$view->render(TRUE);
}
}
......
echo "Memory usage=".(memory_get_usage()-$mem)."<p>\n";
echo"parse - end: ".(microtime(true)-$start)."<p>\n";
//print_r($this);
die("OK");
//die("OK");
echo html::anchor(url_lang::base().'bank_accounts/show_all', url_lang::lang('texts.Back to bank accounts'));
}
}
freenetis/trunk/kohana/application/controllers/devices.php
'order_by' => $order_by,
'order_by_direction' => $order_by_direction,
'limit_results' => $limit_results,
'query_string' => $query_string
'query_string' => $query_string,
'filter' => $filter->view
));
if ($this->acl_check_new(get_class($this),'devices'))
$grid->add_new_button(url_lang::base().'devices/add_whole', url_lang::lang('texts.Add new whole device'));
......
$view->header = new View('base/header');
$view->header->title = url_lang::lang('texts.Devices list');
$view->header->menu = Controller::render_menu();
$view->content = $filter->view.'<br />'.$grid;
$view->content = $grid;
$view->footer = new View('base/footer');
$view->render(TRUE);
} // end of show_all function
freenetis/trunk/kohana/application/upgrade_sql/upgrade_sql.php
}
// array of sql queries that upgrade database
$upgrade_sql[get_SVN_rev()] = array("
DROP TABLE IF EXISTS `voip_sips`;",
"CREATE TABLE `voip_sips` (
`id` int(11) NOT NULL auto_increment,
`user_id` int(11) NOT NULL,
`name` varchar(80) collate utf8_czech_ci NOT NULL,
`accountcode` varchar(20) collate utf8_czech_ci default NULL,
`amaflags` varchar(13) collate utf8_czech_ci default NULL,
`callgroup` varchar(10) collate utf8_czech_ci default NULL,
`callerid` varchar(80) collate utf8_czech_ci NOT NULL,
`canreinvite` char(3) collate utf8_czech_ci default 'no',
`context` varchar(80) collate utf8_czech_ci default 'internal',
`defaultip` varchar(15) collate utf8_czech_ci default NULL,
`dtmfmode` varchar(7) collate utf8_czech_ci default NULL,
`fromuser` varchar(80) collate utf8_czech_ci default NULL,
`fromdomain` varchar(80) collate utf8_czech_ci default NULL,
`fullcontact` varchar(80) collate utf8_czech_ci default NULL,
`host` varchar(31) collate utf8_czech_ci NOT NULL default 'dynamic',
`insecure` varchar(4) collate utf8_czech_ci default NULL,
`language` char(2) collate utf8_czech_ci default 'cz',
`mailbox` varchar(50) collate utf8_czech_ci NOT NULL,
`md5secret` varchar(80) collate utf8_czech_ci default NULL,
`nat` varchar(5) collate utf8_czech_ci NOT NULL default 'yes',
`deny` varchar(95) collate utf8_czech_ci default NULL,
`permit` varchar(95) collate utf8_czech_ci default NULL,
`mask` varchar(95) collate utf8_czech_ci default NULL,
`pickupgroup` varchar(10) collate utf8_czech_ci default NULL,
`port` varchar(5) collate utf8_czech_ci default NULL,
`qualify` char(3) collate utf8_czech_ci default NULL,
`restrictcid` char(1) collate utf8_czech_ci default NULL,
`rtptimeout` char(3) collate utf8_czech_ci default NULL,
`rtpholdtimeout` char(3) collate utf8_czech_ci default NULL,
`secret` varchar(80) collate utf8_czech_ci NOT NULL,
`type` varchar(6) collate utf8_czech_ci NOT NULL default 'friend',
`username` varchar(80) collate utf8_czech_ci NOT NULL,
`disallow` varchar(100) collate utf8_czech_ci default NULL,
`allow` varchar(100) collate utf8_czech_ci default NULL,
`musiconhold` varchar(100) collate utf8_czech_ci default NULL,
`regseconds` int(11) NOT NULL default '0',
`ipaddr` varchar(15) collate utf8_czech_ci NOT NULL,
`regexten` varchar(80) collate utf8_czech_ci NOT NULL,
`cancallforward` char(3) collate utf8_czech_ci default 'yes',
`setvar` varchar(100) collate utf8_czech_ci NOT NULL,
`auth` varchar(10) collate utf8_czech_ci default NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ;",
"CREATE TABLE IF NOT EXISTS `voip_voicemail_users` (
`id` int(11) NOT NULL auto_increment,
`customer_id` int(11) NOT NULL,
`context` varchar(50) collate utf8_czech_ci NOT NULL,
`mailbox` varchar(10) collate utf8_czech_ci NOT NULL default '0',
`password` varchar(4) collate utf8_czech_ci NOT NULL default '0',
`fullname` varchar(50) collate utf8_czech_ci NOT NULL,
`email` varchar(50) collate utf8_czech_ci NOT NULL,
`pager` varchar(50) collate utf8_czech_ci NOT NULL,
`stamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `customer_id` (`customer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;"
$upgrade_sql[get_SVN_rev()] = array(
"ALTER TABLE `streets` CHANGE `street` `street` VARCHAR( 30 ) NOT NULL ",
"ALTER TABLE `bank_templates` CHANGE `bank_name` `template_name` VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL ",
"ALTER TABLE `bank_templates`
CHANGE `bank_code` `bank_code` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_czech_ci NULL DEFAULT NULL,
CHANGE `account_name` `account_name` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_czech_ci NULL DEFAULT NULL,
CHANGE `account_number` `account_number` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_czech_ci NULL DEFAULT NULL,
CHANGE `constant_symbol` `constant_symbol` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_czech_ci NULL DEFAULT NULL,
CHANGE `variable_symbol` `variable_symbol` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL,
CHANGE `specific_symbol` `specific_symbol` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_czech_ci NULL DEFAULT NULL,
CHANGE `counteraccount_name` `counteraccount_name` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_czech_ci NULL DEFAULT NULL,
CHANGE `counteraccount_number` `counteraccount_number` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL,
CHANGE `counteraccount_bank_code` `counteraccount_bank_code` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL,
CHANGE `text` `text` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_czech_ci NULL DEFAULT NULL,
CHANGE `amount` `amount` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_czech_ci NULL DEFAULT NULL,
CHANGE `datetime` `datetime` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_czech_ci NULL DEFAULT NULL"
);
?>
freenetis/trunk/kohana/application/upgrade_sql/upgrade_sql_422.php
<?php
$upgrade_sql[422] = array("
DROP TABLE IF EXISTS `voip_sips`;",
"CREATE TABLE `voip_sips` (
`id` int(11) NOT NULL auto_increment,
`user_id` int(11) NOT NULL,
`name` varchar(80) collate utf8_czech_ci NOT NULL,
`accountcode` varchar(20) collate utf8_czech_ci default NULL,
`amaflags` varchar(13) collate utf8_czech_ci default NULL,
`callgroup` varchar(10) collate utf8_czech_ci default NULL,
`callerid` varchar(80) collate utf8_czech_ci NOT NULL,
`canreinvite` char(3) collate utf8_czech_ci default 'no',
`context` varchar(80) collate utf8_czech_ci default 'internal',
`defaultip` varchar(15) collate utf8_czech_ci default NULL,
`dtmfmode` varchar(7) collate utf8_czech_ci default NULL,
`fromuser` varchar(80) collate utf8_czech_ci default NULL,
`fromdomain` varchar(80) collate utf8_czech_ci default NULL,
`fullcontact` varchar(80) collate utf8_czech_ci default NULL,
`host` varchar(31) collate utf8_czech_ci NOT NULL default 'dynamic',
`insecure` varchar(4) collate utf8_czech_ci default NULL,
`language` char(2) collate utf8_czech_ci default 'cz',
`mailbox` varchar(50) collate utf8_czech_ci NOT NULL,
`md5secret` varchar(80) collate utf8_czech_ci default NULL,
`nat` varchar(5) collate utf8_czech_ci NOT NULL default 'yes',
`deny` varchar(95) collate utf8_czech_ci default NULL,
`permit` varchar(95) collate utf8_czech_ci default NULL,
`mask` varchar(95) collate utf8_czech_ci default NULL,
`pickupgroup` varchar(10) collate utf8_czech_ci default NULL,
`port` varchar(5) collate utf8_czech_ci default NULL,
`qualify` char(3) collate utf8_czech_ci default NULL,
`restrictcid` char(1) collate utf8_czech_ci default NULL,
`rtptimeout` char(3) collate utf8_czech_ci default NULL,
`rtpholdtimeout` char(3) collate utf8_czech_ci default NULL,
`secret` varchar(80) collate utf8_czech_ci NOT NULL,
`type` varchar(6) collate utf8_czech_ci NOT NULL default 'friend',
`username` varchar(80) collate utf8_czech_ci NOT NULL,
`disallow` varchar(100) collate utf8_czech_ci default NULL,
`allow` varchar(100) collate utf8_czech_ci default NULL,
`musiconhold` varchar(100) collate utf8_czech_ci default NULL,
`regseconds` int(11) NOT NULL default '0',
`ipaddr` varchar(15) collate utf8_czech_ci NOT NULL,
`regexten` varchar(80) collate utf8_czech_ci NOT NULL,
`cancallforward` char(3) collate utf8_czech_ci default 'yes',
`setvar` varchar(100) collate utf8_czech_ci NOT NULL,
`auth` varchar(10) collate utf8_czech_ci default NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ;",
"CREATE TABLE IF NOT EXISTS `voip_voicemail_users` (
`id` int(11) NOT NULL auto_increment,
`customer_id` int(11) NOT NULL,
`context` varchar(50) collate utf8_czech_ci NOT NULL,
`mailbox` varchar(10) collate utf8_czech_ci NOT NULL default '0',
`password` varchar(4) collate utf8_czech_ci NOT NULL default '0',
`fullname` varchar(50) collate utf8_czech_ci NOT NULL,
`email` varchar(50) collate utf8_czech_ci NOT NULL,
`pager` varchar(50) collate utf8_czech_ci NOT NULL,
`stamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `customer_id` (`customer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;"
);
?>
freenetis/trunk/kohana/application/views/members/show.php
$links[] = html::anchor(url_lang::base().'members/edit/'.$member_data->member_id,url_lang::lang('texts.Edit member'));
if ($this->acl_check_view('Accounts_Controller', 'transfers', $member_data->member_id) && $member_data->member_id <> 1)
$links[] = html::anchor(url_lang::base().'transfers/show_by_member/'.$member_data->member_id,url_lang::lang('texts.Show his transfers'));
if ($member_data->member_id <> 1 && $member_data->entrance_fee_left != 0 && $this->acl_check_edit('Members_Controller', 'en_fee_left', $member_data->member_id))
if ($member_data->member_id != 1 && $member_data->entrance_fee_left != 0 && $this->acl_check_edit('Members_Controller', 'en_fee_left', $member_data->member_id))
$links[] = html::anchor(url_lang::base().'transfers/deduct_entrance_fees/'.$member_data->member_id, url_lang::lang('texts.Deduct entrance fee'), array('onclick' => 'return potvrd(\''.url_lang::lang('texts.Do you want to deduct this member\'s entrance fee').'\')'));
echo implode (' | ', $links)
?>
......
<?php
unset($links);
if($this->acl_check_edit('Users_Controller','users',$member_data->member_id))
$links[] = html::anchor(url_lang::base().'users/edit'.$member_data->id, url_lang::lang('texts.Edit'));
$links[] = html::anchor(url_lang::base().'users/edit/'.$member_data->id, url_lang::lang('texts.Edit'));
if ($this->acl_check_view('Devices_Controller', 'devices', $member_data->member_id))
$links[] = html::anchor(url_lang::base().'devices/show_by_user/'.$member_data->id,url_lang::lang('texts.Show his devices'));
if ($member_data->id != 1 && $this->acl_check_view('Users_Controller', 'work', $member_data->member_id))
......
<br />
<?php
if ($member_data->member_id <> 1)
if ($member_data->member_id != 1)
{
if (isset($voip))
{ ?>
freenetis/trunk/kohana/application/views/bank_templates_show.php
<h2><?php echo $headline ?></h2>
<?php
echo $message ? '<div class="message">'.$message.'</div>' : '';
?>
<br />
<?php
$links[] = html::anchor(url_lang::base().'bank_templates/show_all/', url_lang::lang('texts.Back to bank templates'));
$links[] = html::anchor(url_lang::base().'bank_templates/edit/'.$template->id, url_lang::lang('texts.Edit'));
echo implode(' | ', $links);
?>
<br />
<br />
<table class="extended">
<tr>
<th colspan="2"><?php echo url_lang::lang('texts.Basic information') ?></th>
</tr>
<tr>
<th>ID</th>
<td><?php echo $template->id ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Template name') ?></th>
<td><?php echo $template->template_name ?></td>
</tr>
</table>
<br />
<table class="extended">
<tr>
<th colspan="2"><?php echo url_lang::lang('texts.Column headers') ?></th>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Account name') ?></th>
<td><?php echo $template->account_name ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Account number') ?></th>
<td><?php echo $template->account_number ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Bank code') ?></th>
<td><?php echo $template->bank_code ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Constant symbol') ?></th>
<td><?php echo $template->constant_symbol ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Variable symbol') ?></th>
<td><?php echo $template->variable_symbol ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Specific symbol') ?></th>
<td><?php echo $template->specific_symbol ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Counteraccount name') ?></th>
<td><?php echo $template->counteraccount_name ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Counteraccount number') ?></th>
<td><?php echo $template->counteraccount_number ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Counteraccount bank code') ?></th>
<td><?php echo $template->counteraccount_bank_code ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Text') ?></th>
<td><?php echo $template->text ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Amount') ?></th>
<td><?php echo $template->amount ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Date and time') ?></th>
<td><?php echo $template->datetime ?></td>
</tr>
</table>

Také k dispozici: Unified diff