Revize 490
Přidáno uživatelem Jiří Sviták před asi 15 roky(ů)
freenetis/trunk/kohana/application/i18n/cs_CZ/texts.php | ||
---|---|---|
'do you want to delete this town' => 'Chcete smazat toto město',
|
||
'do you want to delete this user' => 'Chcete smazat tohoto uživatele',
|
||
'do you want to delete this vlan interface' => 'Chcete smazat toto VLAN rozhraní',
|
||
'do you want to end membership of this member' => 'Chcete ukončit členství tohoto člena',
|
||
'documentation' => 'Dokumentace',
|
||
'double entry account' => 'Podvojný účet',
|
||
'double-entry accounts' => 'Podvojné účty',
|
||
... | ... | |
'error - can\'t delete translation' => 'Chyba - nelze smazat překlad.',
|
||
'error - cant do the transfer' => 'Chyba - nelze provést transakci.',
|
||
'error - cant edit fee' => 'Chyba - nelze upravit poplatek.',
|
||
'error - cant end membership' => 'Chyba - nelze ukončit členství.',
|
||
'error - cant change password' => 'Chyba - nelze změnit heslo',
|
||
'error - cant set redirection' => 'Chyba - nelze nastavit přesměrování.',
|
||
'error - cant update account' => 'Chyba - nelze upravit účet.',
|
||
... | ... | |
'i accept this message and i want to cancel this redirection' => 'Beru na vědomí tuto zprávu a chci zrušit toto přesměrování',
|
||
'id' => 'ID',
|
||
'identified payment' => 'Identifikovaná platba',
|
||
'if you were redirected, wait and redirection will stop in one minute' => 'Pokud jste byli přesměrováni, počkejte a přesměrování do jedné minuty skončí.',
|
||
'ignore' => 'Ignorovat',
|
||
'import dhcp export from mikrotik' => 'Import exportu DHCP z Mikrotiku',
|
||
'import has been successfully finished' => 'Import byl úspěšně dokončen.',
|
||
... | ... | |
'membership interruption has been succesfully added' => 'Přerušení členství bylo úspěšně přidáno',
|
||
'membership interruption has been succesfully deleted' => 'Přerušení členství bylo úspěšně smazáno',
|
||
'membership interruption has been succesfully updated' => 'Přerušení členství bylo úspěšně aktualizováno',
|
||
'membership of the member has been ended' => 'Členství člena bylo ukončeno.',
|
||
'memory consumed' => 'Spotřeba paměti',
|
||
'message' => 'Zpráva',
|
||
'middle name' => 'Prostřední jméno',
|
freenetis/trunk/kohana/application/models/bank_transfer.php | ||
---|---|---|
* @param $order_by_direction
|
||
* @return unknown_type
|
||
*/
|
||
public function get_bank_transfers($ba_id = null, $limit_from = 0, $limit_results = 20, $order_by = 'id', $order_by_direction = 'DESC')
|
||
public function get_bank_transfers($ba_id = null, $limit_from = 0, $limit_results = 20, $order_by = 'id', $order_by_direction = 'DESC', $filter_values = array())
|
||
{
|
||
$where = '';
|
||
foreach($filter_values as $key => $value)
|
||
{
|
||
if ($key != 'submit')
|
||
{
|
||
$where .= ' AND '.$key.' LIKE \'%'.$value.'%\' COLLATE utf8_general_ci';
|
||
}
|
||
}
|
||
if ($order_by == 'amount')
|
||
$order_by = 'IF(bt.destination_id = '.$ba_id.', amount, amount*-1 )';
|
||
return self::$db->query("SELECT
|
||
bt.id,
|
||
IF (bt.destination_id = ".$ba_id.", FALSE, TRUE) AS trans_type,
|
||
CONCAT(ba.account_nr, '/', ba.bank_nr) AS account_number,
|
||
IF (bt.destination_id = $ba_id, FALSE, TRUE) AS trans_type,
|
||
ba.account_nr, ba.bank_nr,
|
||
ba.name,
|
||
t.datetime, t.text, t.amount,
|
||
bt.variable_symbol
|
||
FROM bank_transfers bt
|
||
LEFT JOIN bank_accounts ba ON ba.id = IF (bt.origin_id = ".$ba_id.", bt.destination_id, bt.origin_id)
|
||
LEFT JOIN bank_accounts ba ON ba.id = IF (bt.origin_id = $ba_id, bt.destination_id, bt.origin_id)
|
||
LEFT JOIN transfers t ON t.id = bt.transfer_id
|
||
WHERE (bt.origin_id = ".$ba_id." OR bt.destination_id = ".$ba_id.")
|
||
ORDER BY ".$order_by." ".$order_by_direction."
|
||
LIMIT ".$limit_from." , ".$limit_results
|
||
WHERE (bt.origin_id = $ba_id OR bt.destination_id = $ba_id)
|
||
$where
|
||
ORDER BY $order_by $order_by_direction
|
||
LIMIT $limit_from, $limit_results"
|
||
);
|
||
}
|
||
|
||
... | ... | |
* @param $account_id
|
||
* @return unknown_type
|
||
*/
|
||
public function count_bank_transfers($ba_id)
|
||
public function count_bank_transfers($ba_id, $filter_values = array())
|
||
{
|
||
$where = '';
|
||
foreach($filter_values as $key => $value)
|
||
{
|
||
if ($key != 'submit')
|
||
{
|
||
$where .= ' AND '.$key.' LIKE \'%'.$value.'%\' COLLATE utf8_general_ci';
|
||
}
|
||
}
|
||
return self::$db->query("SELECT COUNT(*) AS total
|
||
FROM bank_transfers bt
|
||
LEFT JOIN bank_accounts ba ON ba.id = IF (bt.origin_id = ".$ba_id.", bt.destination_id, bt.origin_id)
|
||
WHERE bt.origin_id = ".$ba_id." OR bt.destination_id = ".$ba_id
|
||
LEFT JOIN bank_accounts ba ON ba.id = IF (bt.origin_id = $ba_id, bt.destination_id, bt.origin_id)
|
||
LEFT JOIN transfers t ON t.id = bt.transfer_id
|
||
WHERE bt.origin_id = $ba_id OR bt.destination_id = $ba_id
|
||
$where"
|
||
)->current()->total;
|
||
}
|
||
|
freenetis/trunk/kohana/application/models/transfer.php | ||
---|---|---|
* @param $order_by_direction
|
||
* @return unknown_type
|
||
*/
|
||
public function get_transfers($account_id = null, $limit_from = 0, $limit_results = 20, $order_by = 't.id', $order_by_direction = 'ASC')
|
||
public function get_transfers($account_id = null, $limit_from = 0, $limit_results = 20, $order_by = 't.id', $order_by_direction = 'ASC', $filter_values = array())
|
||
{
|
||
$where = '';
|
||
foreach($filter_values as $key => $value)
|
||
{
|
||
if ($key != 'submit')
|
||
{
|
||
$where .= ' AND '.$key.' LIKE \'%'.$value.'%\' COLLATE utf8_general_ci';
|
||
}
|
||
}
|
||
if ($order_by == 'amount')
|
||
$order_by = 'IF( t.destination_id = '.$account_id.', amount, amount*-1 )';
|
||
return self::$db->query("SELECT
|
||
... | ... | |
FROM transfers t
|
||
LEFT JOIN accounts a ON a.id = IF(t.origin_id = $account_id, t.destination_id, t.origin_id)
|
||
WHERE t.origin_id = $account_id OR t.destination_id = $account_id
|
||
$where
|
||
ORDER BY $order_by $order_by_direction
|
||
LIMIT $limit_from, $limit_results"
|
||
);
|
||
... | ... | |
* @param $order_by_direction
|
||
* @return unknown_type
|
||
*/
|
||
public function count_transfers($account_id = null)
|
||
public function count_transfers($account_id = null, $filter_values = array())
|
||
{
|
||
return self::$db->query("SELECT
|
||
t.id, IF(t.destination_id = $account_id, FALSE, TRUE) AS trans_type,
|
||
t.text, t.amount, t.datetime,
|
||
a.name
|
||
$where = '';
|
||
foreach($filter_values as $key => $value)
|
||
{
|
||
if ($key != 'submit')
|
||
{
|
||
$where .= ' AND '.$key.' LIKE \'%'.$value.'%\' COLLATE utf8_general_ci';
|
||
}
|
||
}
|
||
return self::$db->query("SELECT COUNT(*) AS total
|
||
FROM transfers t
|
||
LEFT JOIN accounts a ON a.id = IF(t.origin_id = $account_id, t.destination_id, t.origin_id)
|
||
WHERE t.origin_id = $account_id OR t.destination_id = $account_id"
|
||
)->count();
|
||
WHERE t.origin_id = $account_id OR t.destination_id = $account_id
|
||
$where"
|
||
)->current()->total;
|
||
}
|
||
|
||
/**
|
freenetis/trunk/kohana/application/controllers/members.php | ||
---|---|---|
if (count($model_members->get_member($member_id)) == 0)
|
||
Controller::error(RECORD);
|
||
$member_data = $model_members->get_member($member_id)->current();
|
||
|
||
|
||
// address point
|
||
$address_point = new Address_point_Model($member_data->address_point_id);
|
||
|
||
|
||
// member type string
|
||
$model_translation = new Translation_Model();
|
||
$member_type = $model_translation->get_translation($member_data->member_type);
|
||
$model_contacts = new Contact_Model();
|
||
$contacts = $model_contacts->find_all_by_user_id($member_data->id);
|
||
$enum_type_model = new Enum_type_Model();
|
||
// member type
|
||
$enum_type_model = new Enum_type_Model();
|
||
$former_member = $member_data->member_type == 'Former member';
|
||
|
||
// get balance of member's credit account, association doesn't have credit account
|
||
if ($member_id != 1)
|
||
{
|
||
... | ... | |
where(array('member_id' => $member_id,
|
||
'account_attribute_id' => Account_attribute_Model::$credit))->find();
|
||
}
|
||
// contacts of main user of member
|
||
$model_contacts = new Contact_Model();
|
||
$contacts = $model_contacts->find_all_by_user_id($member_data->id);
|
||
$arr_contact_types = array();
|
||
foreach($contacts as $i => $contact)
|
||
{
|
||
$arr_contact_types[$i] = $enum_type_model->get_value($contact->type);
|
||
}
|
||
// users
|
||
// users of member
|
||
$model_users = new User_Model();
|
||
$users = $model_users->orderby($order_by,$order_by_direction)->find_all_by_member_id($member_id);
|
||
$user_grid = new Grid(url_lang::base().'members', null,array(
|
||
... | ... | |
$voip_grid->action_field('user_id')->label(url_lang::lang('texts.Account'))->url(url_lang::base().'voip/show')->action(url_lang::lang('texts.Show'));
|
||
$voip_grid->action_field('user_id')->label(url_lang::lang('texts.User'))->url(url_lang::base().'users/show')->action(url_lang::lang('texts.Show'));
|
||
$voip_grid->datasource($voip);
|
||
|
||
// view
|
||
$view = new View('main');
|
||
$view->title = url_lang::lang('texts.Display member');
|
||
$view->content = new View('members_show');
|
||
... | ... | |
$member_data->registration = $registration_value[(bool)$member_data->registration];
|
||
$view->content->member_data = $member_data;
|
||
$view->content->member_type = $member_type;
|
||
$view->content->former = $former_member;
|
||
$view->content->address_point = $address_point;
|
||
$view->content->contact_types = $arr_contact_types;
|
||
$view->content->contacts = $contacts;
|
||
... | ... | |
if ($this->acl_check_edit(get_class($this),'type',$member_id))
|
||
{
|
||
$enum_types = new Enum_type_Model();
|
||
$types = $enum_types->get_values(Enum_type_Model::$member_type_id);
|
||
$types = $enum_types->get_values(Enum_type_Model::$member_type_id);
|
||
unset($types[$enum_types->get_type_id('Former member')]);
|
||
$form->dropdown('type')->label(url_lang::lang('texts.Type').':')->options($types)->selected($member_data->typem)->callback(array($this, 'valid_member_type'));
|
||
}
|
||
if ($this->acl_check_edit(get_class($this),'organization_id', $member_id))
|
||
... | ... | |
$form->input('qos_rate')->label(url_lang::lang('texts.qos rate').':')->rules('valid_numeric')->value($member_data->qos_rate);
|
||
if ($this->acl_check_edit(get_class($this),'entrance_date',$member_id))
|
||
$form->date('entrance_date')->label(url_lang::lang('texts.Entrance date').':')->years(date('Y')-100, date('Y'))->rules('required')->value(strtotime($member_data->entrance_date));
|
||
|
||
/*
|
||
if ($this->acl_check_edit(get_class($this),'leaving_date',$member_id))
|
||
{
|
||
$parsed = date_parse($member_data->leaving_date);
|
||
... | ... | |
$form->date('leaving_date')->label(url_lang::lang('texts.Leaving date').':')->years(date('Y', strtotime($member_data->entrance_date)), date('Y'))->value(strtotime($member_data->leaving_date))->callback(array($this, 'valid_leaving_date'));
|
||
}
|
||
}
|
||
*/
|
||
|
||
if ($this->acl_check_edit(get_class($this),'comment',$member_id))
|
||
$form->textarea('comment')->label(url_lang::lang('texts.Comment').':')->rules('length[0,250]')->value($member_data->comment);
|
||
... | ... | |
// member data
|
||
if ($this->acl_check_edit(get_class($this),'entrance_date',$member_id))
|
||
$member_data->entrance_date = date("Y-m-d",$form_data['entrance_date']);
|
||
|
||
/*
|
||
if ($this->acl_check_edit(get_class($this),'leaving_date',$member_id))
|
||
{
|
||
if ($form_data['end_membership'])
|
||
... | ... | |
else
|
||
$member_data->leaving_date = '0000-00-00';
|
||
}
|
||
*/
|
||
|
||
if ($this->acl_check_edit(get_class($this),'name',$member_id))
|
||
$member_data->name = $form_data['membername'];
|
||
if ($this->acl_check_edit(get_class($this),'address',$member_id)) {
|
||
... | ... | |
} // end of edit function
|
||
|
||
/**
|
||
* Function ends membership of member.
|
||
* @param $member_id
|
||
* @return unknown_type
|
||
*/
|
||
function end_membership($member_id = null)
|
||
{
|
||
if (!isset($member_id))
|
||
Controller::warning(PARAMETER);
|
||
$member = new Member_Model($member_id);
|
||
if ($member->id == 0)
|
||
Controller::error(RECORD);
|
||
if (!$this->acl_check_edit(get_class($this), 'members', $member_id))
|
||
Controller::error(ACCESS);
|
||
// form
|
||
$form = new Forge(url_lang::base().'members/end_membership/'.$member_id, '', 'POST', array('id' => 'article_form'));
|
||
$form->set_attr('class', 'form_class')->set_attr('method', 'post');
|
||
$form->date('leaving_date')->label(url_lang::lang('texts.Leaving date'));
|
||
$form->submit('submit')->value(url_lang::lang('texts.End membership'));
|
||
special::required_forge_style($form, ' *', 'required');
|
||
// validation
|
||
if ($form->validate())
|
||
{
|
||
$form_data = $form->as_array();
|
||
$member->leaving_date = date('Y-m-d', $form_data['leaving_date']);
|
||
$enum_type_model = new Enum_type_Model();
|
||
$member->type = $enum_type_model->get_type_id('Former member');
|
||
if ($member->save())
|
||
$this->session->set_flash('message', url_lang::lang('texts.Membership of the member has been ended.'));
|
||
else
|
||
$this->session->set_flash('message', url_lang::lang('texts.Error - cant end membership.'));
|
||
url::redirect(url_lang::base().'members/show/'.(int)$member_id);
|
||
}
|
||
$headline = url_lang::lang('texts.End membership');
|
||
$view = new View('main');
|
||
$view->title = $headline;
|
||
$view->content = new View('form');
|
||
$view->content->headline = $headline;
|
||
$view->content->form = $form->html();
|
||
$view->content->link_back = html::anchor(url_lang::base().'members/show/'.$member_id,url_lang::lang('texts.Back to the member'));
|
||
$view->render(TRUE);
|
||
}
|
||
|
||
/**
|
||
* to do - write comment
|
||
* @param $limit_results
|
||
* @param $page
|
freenetis/trunk/kohana/application/controllers/users.php | ||
---|---|---|
|
||
$filter=new Table_Form(url_lang::base()."users/show_all", "get", array(
|
||
|
||
new Table_Form_Item('text','name','Name'),
|
||
new Table_Form_Item('text','surname','Surname'),
|
||
new Table_Form_Item('text','surname','Surname'),
|
||
new Table_Form_Item('text','name','Name'),
|
||
"tr",
|
||
new Table_Form_Item('text','email','Email'),
|
||
new Table_Form_Item('text','phone','Phone'),
|
freenetis/trunk/kohana/application/controllers/transfers.php | ||
---|---|---|
<?php
|
||
/**
|
||
* This controller handles double-entry transfers and special actions with transfers like deducting fees etc.
|
||
*
|
||
* @author Jiri Svitak
|
||
*
|
||
*/
|
||
class Transfers_Controller extends Controller {
|
||
|
||
protected $origin;
|
||
... | ... | |
}
|
||
|
||
/**
|
||
* It shows all double-entry transfers. They are shown in day book.
|
||
* @author Jiri Svitak
|
||
* It shows all double-entry transfers. They are shown in day book.
|
||
* @param $limit_results
|
||
* @param $order_by
|
||
* @param $order_by_direction
|
||
* @return unknown_type
|
||
*/
|
||
function show_all($limit_results = 500, $order_by = 'id', $order_by_direction = 'desc', $page_word = null, $page = 1)
|
||
function show_all($limit_results = 500, $order_by = 'datetime', $order_by_direction = 'desc', $page_word = null, $page = 1)
|
||
{
|
||
if (!$this->acl_check_view('Accounts_Controller', 'transfers'))
|
||
Controller::error(ACCESS);
|
||
... | ... | |
}
|
||
|
||
/**
|
||
* It shows transfers of credit account.
|
||
* @author Jiri Svitak
|
||
* Function shows information of transfer including previous transfer if exists.
|
||
* @param $transfer_id
|
||
* @return unknown_type
|
||
*/
|
||
function show($transfer_id = null)
|
||
{
|
||
if (!$this->acl_check_view('Accounts_Controller', 'transfers'))
|
||
Controller::error(ACCESS);
|
||
if (!isset($transfer_id))
|
||
Controller::warning(PARAMETER);
|
||
$account_model = new Account_Model();
|
||
$transfer_model = new Transfer_Model();
|
||
$transfer = $transfer_model->get_transfer($transfer_id);
|
||
if (!is_object($transfer))
|
||
Controller::error(RECORD);
|
||
// transfers dependent on this transfer, if this transfer is member fee payment
|
||
$dependent_transfers = $transfer_model->get_dependent_transfers($transfer->id);
|
||
$bt = null;
|
||
// bank transfer is only assigned to transfer from member fees account to account of association
|
||
$member_fees = ORM::factory('account')->find_by_account_attribute_id(Account_attribute_Model::$member_fees);
|
||
$bt_model = ORM::factory('bank_transfer')->find_by_transfer_id($transfer->id);
|
||
if ($transfer->oa_id == $member_fees->id && is_object($bt_model) && $bt_model->id != 0)
|
||
{
|
||
|
||
$bt = $bt_model->get_bank_transfer($transfer_id);
|
||
}
|
||
$headline = url_lang::lang('texts.Detail of transfer number').' '.$transfer->id;
|
||
$view = new View('main');
|
||
$view->title = $headline;
|
||
$view->content = new View('transfers/show');
|
||
$view->content->headline = $headline;
|
||
$view->content->transfer = $transfer;
|
||
$view->content->dependent_transfers = $dependent_transfers;
|
||
$view->content->bt = $bt;
|
||
$view->content->message = $this->session->get_once('message');
|
||
$view->render(TRUE);
|
||
}
|
||
|
||
/**
|
||
* @author Jiri Svitak
|
||
* It shows transfers of credit account.
|
||
* @param $account_id
|
||
* @return unknown_type
|
||
*/
|
||
function show_by_account($account_id = NULL, $limit_results = 500, $order_by = 'id', $order_by_direction = 'asc', $page_word = null, $page = 1)
|
||
function show_by_account($account_id = NULL, $limit_results = 500, $order_by = 'datetime', $order_by_direction = 'desc', $page_word = null, $page = 1)
|
||
{
|
||
if (!isset($account_id))
|
||
Controller::warning(PARAMETER);
|
||
... | ... | |
$order_by = 'datetime';
|
||
if (strtolower($order_by_direction) != 'asc' && strtolower($order_by_direction) != 'desc')
|
||
$order_by_direction = 'desc';
|
||
// creates fields for filtering
|
||
$filter=new Table_Form(url_lang::base()."transfers/show_by_account/$account_id", "get", array(
|
||
new Table_Form_Item('text', 'name', 'Counteraccount'),
|
||
new Table_Form_Item('text', 'datetime', 'Date and time'),
|
||
"tr",
|
||
new Table_Form_Item('text', 'text', 'Text'),
|
||
new Table_Form_Item('text', 'amount', 'Amount'),
|
||
"tr",
|
||
"td", new Table_Form_Item('submit', 'submit', 'Filter')
|
||
)
|
||
);
|
||
$arr_gets = array();
|
||
foreach ($this->input->get() as $key=>$value)
|
||
$arr_gets[] = $key.'='.$value;
|
||
$query_string = '?'.implode('&',$arr_gets);
|
||
// transfers on account
|
||
$transfer_model = new Transfer_Model();
|
||
$total_transfers = $transfer_model->count_transfers($account_id);
|
||
$total_transfers = $transfer_model->count_transfers($account_id, $filter->values());
|
||
if (($sql_offset = ($page - 1) * $limit_results) > $total_transfers)
|
||
$sql_offset = 0;
|
||
$transfers = $transfer_model->get_transfers($account_id, $sql_offset, (int)$limit_results, $order_by, $order_by_direction);
|
||
$transfers = $transfer_model->get_transfers($account_id, $sql_offset, (int)$limit_results, $order_by, $order_by_direction, $filter->values());
|
||
// headline
|
||
$headline = url_lang::lang('texts.Transfers of double-entry account');
|
||
// grid of transfers
|
||
... | ... | |
'order_by_direction' => $order_by_direction,
|
||
'limit_results' => $limit_results,
|
||
'variables' => $account_id.'/',
|
||
'url_array_ofset' => 1
|
||
));
|
||
'url_array_ofset' => 1,
|
||
'query_string' => $query_string,
|
||
'filter' => $filter->view
|
||
));
|
||
if ($this->acl_check_view('Accounts_Controller', 'accounts'))
|
||
$grid->add_new_button(url_lang::base().'members/show/'.$account->member_id, url_lang::lang('texts.Back to the member'));
|
||
if ($this->acl_check_new('Accounts_Controller', 'transfers'))
|
||
... | ... | |
$view->content->grid = $grid;
|
||
$view->content->message = $this->session->get_once('message');
|
||
$view->render(TRUE);
|
||
} // end of show_by_bank_account function
|
||
} // end of show_by_account function
|
||
|
||
/**
|
||
* Function shows information of transfer including previous transfer if exists.
|
||
* @author Jiri Svitak
|
||
* @param $transfer_id
|
||
* @return unknown_type
|
||
*/
|
||
function show($transfer_id = null)
|
||
{
|
||
if (!$this->acl_check_view('Accounts_Controller', 'transfers'))
|
||
Controller::error(ACCESS);
|
||
if (!isset($transfer_id))
|
||
Controller::warning(PARAMETER);
|
||
$account_model = new Account_Model();
|
||
$transfer_model = new Transfer_Model();
|
||
$transfer = $transfer_model->get_transfer($transfer_id);
|
||
if (!is_object($transfer))
|
||
Controller::error(RECORD);
|
||
// transfers dependent on this transfer, if this transfer is member fee payment
|
||
$dependent_transfers = $transfer_model->get_dependent_transfers($transfer->id);
|
||
// bank transfer is only assigned to transfer from member fees account to account of association
|
||
$member_fees = ORM::factory('account')->find_by_account_attribute_id(Account_attribute_Model::$member_fees);
|
||
$bt_model = ORM::factory('bank_transfer')->find_by_transfer_id($transfer->id);
|
||
if ($transfer->oa_id == $member_fees->id && is_object($bt_model) && $bt_model->id != 0)
|
||
$bt = $bt_model->get_bank_transfer($transfer_id);
|
||
$headline = url_lang::lang('texts.Detail of transfer number').' '.$transfer->id;
|
||
$view = new View('main');
|
||
$view->title = $headline;
|
||
$view->content = new View('transfers/show');
|
||
$view->content->headline = $headline;
|
||
$view->content->transfer = $transfer;
|
||
$view->content->dependent_transfers = $dependent_transfers;
|
||
$view->content->bt = $bt;
|
||
$view->content->message = $this->session->get_once('message');
|
||
$view->render(TRUE);
|
||
}
|
||
|
||
/**
|
||
* Function adds transfers. Transfer can be send only.
|
||
* @author Jiri Svitak
|
||
* @param $origin_account
|
||
* @return unknown_type
|
||
*/
|
||
... | ... | |
}
|
||
|
||
/**
|
||
* Function edits double-entry transfers. They should not be edited.
|
||
* Wrong transfer should be solved by new transfer.
|
||
* @author Jiri Svitak
|
||
* Function edits double-entry transfers.
|
||
* @param $transfer_id
|
||
* @return unknown_type
|
||
*/
|
||
... | ... | |
}
|
||
|
||
/**
|
||
* Function deducts member fees.
|
||
* Function deducts member fees. This version creates one transfer per month.
|
||
* This version is still buggy and uncomplete
|
||
* @return unknown_type
|
||
*/
|
||
/*
|
||
function deduct_fees()
|
||
{
|
||
// access rights
|
||
... | ... | |
$view->render(TRUE);
|
||
}
|
||
}
|
||
*/
|
||
|
||
/**
|
||
* Function returns true if member has to pay fee in given month, else it returns false.
|
||
* still buggy
|
||
* @param $member_id
|
||
* @param $month
|
||
* @return unknown_type
|
||
*/
|
||
/*
|
||
private function has_to_pay($member_id = null, $month = null)
|
||
{
|
||
if ($member_id == null || $month == null)
|
||
... | ... | |
// result
|
||
return $entrance && $leaving && $mi;
|
||
}
|
||
|
||
*/
|
||
|
||
/**
|
||
* Function deducts member fees.
|
||
* Function deducts member fees. This version creates one deducting transfer per year and its value
|
||
* can be recalculated (for example every month).
|
||
* Functional and debugged version.
|
||
* @author Jiri Svitak
|
||
* @return unknown_type
|
||
*/
|
||
/*
|
||
function deduct_fees()
|
||
{
|
||
// access rights
|
||
... | ... | |
$view->render(TRUE);
|
||
}
|
||
}
|
||
*/
|
||
|
||
|
||
/**
|
||
* Function deducts entrance fees. This fee is deducted only one once to each member.
|
||
* It checks each member if his fee was deducted, and if it is not, then
|
||
* the fee is deducted.
|
||
* @author Jiri Svitak
|
||
* @return unknown_type
|
||
*/
|
||
function deduct_entrance_fees($member_id = null)
|
||
... | ... | |
|
||
/**
|
||
* Function adds member fee payment by cash.
|
||
* @author Jiri Svitak
|
||
* @param $member_id
|
||
* @return unknown_type
|
||
*/
|
freenetis/trunk/kohana/application/controllers/redirect.php | ||
---|---|---|
// no reason to redirect, this shouldn't happen
|
||
else
|
||
{
|
||
$content = url_lang::lang('texts.System has not found reason to this redirection, this should not happen in ordinary running.');
|
||
$content = url_lang::lang('texts.System has not found reason to this redirection, this should not happen in ordinary running.').' '.
|
||
url_lang::lang('texts.If you were redirected, wait and redirection will stop in one minute.');
|
||
}
|
||
// engineer of user's device, owner of ip address - if available
|
||
if ($ip_address->id != 0)
|
freenetis/trunk/kohana/application/controllers/bank_transfers.php | ||
---|---|---|
if (strtolower($order_by_direction) != 'asc' && strtolower($order_by_direction) != 'desc')
|
||
$order_by_direction = 'desc';
|
||
|
||
// creates fields for filtering unidentified transfers
|
||
$filter=new Table_Form(url_lang::base()."bank_transfers/show_by_bank_account/$bank_account_id", "get", array(
|
||
new Table_Form_Item('text', 'datetime', 'Date and time'),
|
||
new Table_Form_Item('text', 'name', 'Account name'),
|
||
"tr",
|
||
new Table_Form_Item('text', 'variable_symbol', 'Variable symbol'),
|
||
new Table_Form_Item('text', 'amount', 'Amount'),
|
||
"tr",
|
||
new Table_Form_Item('text', 'account_nr', 'Account number'),
|
||
new Table_Form_Item('text', 'bank_nr', 'Bank code'),
|
||
"tr",
|
||
new Table_Form_Item('submit', 'submit', 'Filter')
|
||
)
|
||
);
|
||
$arr_gets = array();
|
||
foreach ($this->input->get() as $key=>$value)
|
||
$arr_gets[] = $key.'='.$value;
|
||
$query_string = '?'.implode('&',$arr_gets);
|
||
|
||
// model
|
||
$bt_model = new Bank_transfer_Model();
|
||
$total_bank_transfers = $bt_model->count_bank_transfers($bank_account_id);
|
||
$total_bank_transfers = $bt_model->count_bank_transfers($bank_account_id, $filter->values());
|
||
if (($sql_offset = ($page - 1) * $limit_results) > $total_bank_transfers)
|
||
$sql_offset = 0;
|
||
$bts = $bt_model->get_bank_transfers($bank_account_id, $sql_offset, (int)$limit_results, $order_by, $order_by_direction);
|
||
$bts = $bt_model->get_bank_transfers($bank_account_id, $sql_offset, (int)$limit_results, $order_by, $order_by_direction, $filter->values());
|
||
|
||
$headline = url_lang::lang('texts.Transfers of bank account');
|
||
$grid = new Grid(url_lang::base().'transfers', null, array(
|
||
... | ... | |
'order_by_direction' => $order_by_direction,
|
||
'limit_results' => $limit_results,
|
||
'variables' => $bank_account_id.'/',
|
||
'url_array_ofset' => 1
|
||
));
|
||
'url_array_ofset' => 1,
|
||
'query_string' => $query_string,
|
||
'filter' => $filter->view
|
||
));
|
||
|
||
$grid->add_new_button(url_lang::base().'bank_accounts/show_all', url_lang::lang('texts.Back to bank accounts'));
|
||
if ($ba->member_id == 1 && $this->acl_check_new('Accounts_Controller', 'bank_transfers'))
|
||
... | ... | |
$grid->order_field('trans_type')->label(url_lang::lang('texts.Type'))->bool(array(url_lang::lang('texts.Arrival'),url_lang::lang('texts.Outbound')));
|
||
$grid->order_field('datetime')->label(url_lang::lang('texts.Date and time'));
|
||
$grid->order_field('name')->label(url_lang::lang('texts.Counteraccount'));
|
||
$grid->order_field('account_number')->label(url_lang::lang('texts.Account number'));
|
||
$grid->order_field('account_nr')->label(url_lang::lang('texts.Account number'));
|
||
$grid->order_field('bank_nr')->label(url_lang::lang('texts.Bank code'));
|
||
$grid->order_field('text')->label(url_lang::lang('texts.Text'));
|
||
$grid->order_field('variable_symbol')->label(url_lang::lang('texts.VS'));
|
||
$grid->order_field('amount')->label(url_lang::lang('texts.Amount'));
|
freenetis/trunk/kohana/application/controllers/ip_addresses.php | ||
---|---|---|
|
||
foreach ($subnets as $subnet)
|
||
{
|
||
$arr_subnets[$subnet->id] = $subnet->net_str.'/'.$subnet->mask.': '.$subnet->name;
|
||
$arr_subnets[$subnet->id] = $subnet->name.': '.$subnet->net_str.'/'.$subnet->mask;
|
||
}
|
||
|
||
$this->form->dropdown('iface_id')->label(url_lang::lang('texts.Interface name').':')->options($arr_ifaces);
|
freenetis/trunk/kohana/application/controllers/export.php | ||
---|---|---|
Controller::error(ACCESS);
|
||
$member_model = new Member_Model();
|
||
$items = $member_model->get_all_members_to_export();
|
||
$filename = url_lang::lang('texts.Members').'.csv';
|
||
break;
|
||
case 'subnets':
|
||
$subnet_model = new Subnet_Model($id);
|
||
... | ... | |
Controller::error(RECORD);
|
||
if (!$this->acl_check_view('Devices_Controller', 'subnet'))
|
||
Controller::error(ACCESS);
|
||
$items = $subnet_model->get_items_of_subnet($id);
|
||
$items = $subnet_model->get_items_of_subnet($id);
|
||
$filename = $subnet_model->name.'.csv';
|
||
break;
|
||
default:
|
||
Controller::warning(PARAMETER, url_lang::lang('texts.Bad parameter for export'));
|
||
}
|
||
// set content header
|
||
header('Content-type: application/csv');
|
||
$filename = url_lang::lang('texts.Members').'.csv';
|
||
header('Content-Disposition: attachment; filename="'.$filename.'"');
|
||
$first = true;
|
||
// yes and no for registration
|
freenetis/trunk/kohana/application/views/members_show.php | ||
---|---|---|
echo $message ? '<div class="message">'.$message.'</div>' : '';
|
||
|
||
$links = array();
|
||
if ($this->acl_check_edit('Members_Controller', 'members', $member_data->member_id))
|
||
|
||
if (!$former && $this->acl_check_edit('Members_Controller', 'members', $member_data->member_id))
|
||
$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_account/'.$account->id, url_lang::lang('texts.Show his transfers'));
|
||
if ($this->acl_check_edit('Accounts_Controller', 'transfers', $member_data->member_id) && $member_data->member_id != 1)
|
||
$links[] = html::anchor(url_lang::base().'transfers/add_member_fee_payment_by_cash/'.$member_data->member_id, url_lang::lang('texts.Payment by cash'));
|
||
if ($this->acl_check_edit('Members_Controller', 'redirect', $member_data->member_id))
|
||
if ($member_data->member_id != 1)
|
||
{
|
||
if ($this->acl_check_view('Accounts_Controller', 'transfers', $member_data->member_id))
|
||
$links[] = html::anchor(url_lang::base().'transfers/show_by_account/'.$account->id, url_lang::lang('texts.Show his transfers'));
|
||
if (!$former)
|
||
{
|
||
if ($this->acl_check_edit('Accounts_Controller', 'transfers', $member_data->member_id))
|
||
$links[] = html::anchor(url_lang::base().'transfers/add_member_fee_payment_by_cash/'.$member_data->member_id, url_lang::lang('texts.Payment by cash'));
|
||
if ($member_data->entrance_fee_left != 0 && $this->acl_check_new('Accounts_Controller', 'transfers'))
|
||
$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').'\')'));
|
||
if ($this->acl_check_edit('Members_Controller', 'members'))
|
||
$links[] = html::anchor(url_lang::base().'members/end_membership/'.$member_data->member_id, url_lang::lang('texts.End membership'), array('onclick' => 'return potvrd(\''.url_lang::lang('texts.Do you want to end membership of this member').'\')'));
|
||
}
|
||
}
|
||
if (!$former && $this->acl_check_edit('Members_Controller', 'redirect', $member_data->member_id))
|
||
$links[] = html::anchor(url_lang::base().'redirect/member/'.$member_data->member_id, url_lang::lang('texts.Redirection'));
|
||
if ($member_data->member_id != 1 && $member_data->entrance_fee_left != 0 && $this->acl_check_new('Accounts_Controller', 'transfers'))
|
||
$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').'\')'));
|
||
if ($member_data->member_id != 1 && $this->acl_check_edit('Members_Controller', 'members'))
|
||
$links[] = html::anchor(url_lang::base().'members/end_membership/'.$member_data->member_id, url_lang::lang('texts.End membership'));
|
||
|
||
echo implode (' | ', $links)
|
||
?>
|
||
<br />
|
||
... | ... | |
<br />
|
||
<?php
|
||
unset($links);
|
||
if($this->acl_check_edit('Users_Controller','users',$member_data->member_id))
|
||
if(!$former && $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'));
|
||
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))
|
||
$links[] = html::anchor(url_lang::base().'works/show_by_user/'.$member_data->id,url_lang::lang('texts.Show his works'));
|
||
if ($this->acl_check_edit('Users_Controller', 'password', $member_data->id))
|
||
$links[] = html::anchor(url_lang::base().'users/change_password/'.$member_data->id, url_lang::lang('texts.Change password'));
|
||
if ($this->acl_check_edit('Users_Controller', 'application_password', $member_data->id))
|
||
$links[] = html::anchor(url_lang::base().'users/change_application_password/'.$member_data->id, url_lang::lang('texts.Change application password'));
|
||
$links[] = html::anchor(url_lang::base().'works/show_by_user/'.$member_data->id,url_lang::lang('texts.Show his works'));
|
||
if (!$former)
|
||
{
|
||
if ($this->acl_check_edit('Users_Controller', 'password', $member_data->id))
|
||
$links[] = html::anchor(url_lang::base().'users/change_password/'.$member_data->id, url_lang::lang('texts.Change password'));
|
||
if ($this->acl_check_edit('Users_Controller', 'application_password', $member_data->id))
|
||
$links[] = html::anchor(url_lang::base().'users/change_application_password/'.$member_data->id, url_lang::lang('texts.Change application password'));
|
||
}
|
||
echo implode(' | ', $links);
|
||
?>
|
||
<br />
|
Také k dispozici: Unified diff
Zmenen system ukoncovani clenstvi, uz neni v editaci, ale ma sve tlacitko. V bankovnich prevodech a podvojnych prevodech na nejakem ucte pridan filtr a nastaveno vychozi razeni sestupne podle ucetniho datumu.