Revize 498
Přidáno uživatelem Jiří Sviták před asi 15 roky(ů)
freenetis/trunk/kohana/application/i18n/cs_CZ/texts.php | ||
---|---|---|
'admin has been successfully removed from this device' => 'Správce byl úspěšně odebrán od tohoto zařízení.',
|
||
'admins' => 'Správci',
|
||
'all' => 'Všichni',
|
||
'all transfers' => 'Všechny převody',
|
||
'amount' => 'Částka',
|
||
'antenna' => 'Anténa',
|
||
'applicant' => 'Čekatel na členství',
|
||
... | ... | |
'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',
|
||
'do you want to restore membership of this member' => 'Chcete obnovit členství tohoto člena',
|
||
'documentation' => 'Dokumentace',
|
||
'double entry account' => 'Podvojný účet',
|
||
'double-entry accounts' => 'Podvojné účty',
|
||
... | ... | |
'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 change password' => 'Chyba - nelze změnit heslo.',
|
||
'error - cant restore membership' => 'Chyba - nelze obnovit členství.',
|
||
'error - cant set redirection' => 'Chyba - nelze nastavit přesměrování.',
|
||
'error - cant update account' => 'Chyba - nelze upravit účet.',
|
||
'error - cant update additional contacts' => 'Chyba - nelze upravit další kontakty.',
|
||
... | ... | |
'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.',
|
||
'membership of the member has been successfully restored' => 'Členství člena bylo úspěšně obnoveno.',
|
||
'memory consumed' => 'Spotřeba paměti',
|
||
'message' => 'Zpráva',
|
||
'middle name' => 'Prostřední jméno',
|
||
... | ... | |
'origin bank account' => 'Zdrojový bankovní účet',
|
||
'original term' => 'Původní výraz',
|
||
'ospf area id' => 'OSPF area ID',
|
||
'other accounts' => 'Ostatní účty',
|
||
'other' => 'Ostatní',
|
||
'outbound' => 'Odchozí',
|
||
'owner of account' => 'Vlastník účtu',
|
||
'page title' => 'Titulek stránky',
|
||
... | ... | |
'regular member' => 'Řádný člen',
|
||
'regular members' => 'Řádní členové',
|
||
'remove' => 'Odebrat',
|
||
'restore membership' => 'Obnovit členství',
|
||
'save changes' => 'Uložit změny',
|
||
'save' => 'Uložit',
|
||
'save wireless setting' => 'Uložit bezdrátové nastavení',
|
||
... | ... | |
'wireless setting has been successfully deleted' => 'Bezdrátové nastavení bylo úspěšně smazáno.',
|
||
'wireless setting has been successfully saved' => 'Bezdrátové nastavení bylo úspěšně uloženo.',
|
||
'wireless setting has been successfully updated' => 'Bezdrátové nastavení bylo úspěšně upraveno.',
|
||
'without inner transfers' => 'Bez vnitřních převodů',
|
||
'voip admins' => 'VoIP správci',
|
||
'voip number interval must be in format xxxxxxxxx-xxxxxxxxx' => 'Rozsah VoIP čísel musí být ve formátu xxxxxxxxx-xxxxxxxxx',
|
||
'voip number must be 9 characters long' => 'VoIP číslo musí obsahovat 9 znaků',
|
freenetis/trunk/kohana/application/models/account.php | ||
---|---|---|
public static $accounting_system = 1;
|
||
public static $credit = 2;
|
||
public static $project = 3;
|
||
public static $other = 4;
|
||
|
||
|
||
//protected $has_one = array();
|
||
... | ... | |
}
|
||
|
||
/**
|
||
* Accounting system requires special query.
|
||
* @return unknown_type
|
||
*/
|
||
public function get_accounting_system($limit_from = 0, $limit_results = 20, $order_by = 'id', $order_by_direction = 'asc', $filter_values = array())
|
||
{
|
||
$where = '';
|
||
$datetime1 = '';
|
||
$datetime2 = '';
|
||
foreach ($filter_values as $key => $value)
|
||
{
|
||
if ($key == 'name')
|
||
{
|
||
$where = " WHERE aa.name LIKE '%".$value."%' COLLATE utf8_general_ci";
|
||
}
|
||
if ($key == 'datetime')
|
||
{
|
||
$datetime1 = " AND t1.datetime LIKE '%".$value."%' COLLATE utf8_general_ci";
|
||
$datetime2 = " AND t2.datetime LIKE '%".$value."%' COLLATE utf8_general_ci";
|
||
}
|
||
}
|
||
// query
|
||
return self::$db->query("
|
||
SELECT aa.id, aa.name, SUM(partial_balance) AS balance
|
||
FROM account_attributes aa
|
||
JOIN
|
||
(SELECT q2.account_attribute_id, (inbound - outbound) AS partial_balance FROM
|
||
(SELECT q1.*, IFNULL(SUM(amount), 0) AS inbound FROM
|
||
(SELECT q0.*, IFNULL(SUM(amount), 0) AS outbound FROM
|
||
(SELECT a.id, a.account_attribute_id
|
||
FROM accounts a
|
||
WHERE a.member_id = 1
|
||
) q0
|
||
LEFT JOIN transfers t1 ON q0.id = t1.origin_id $datetime1
|
||
GROUP BY q0.id
|
||
) q1
|
||
LEFT JOIN transfers t2 ON q1.id = t2.destination_id $datetime2
|
||
GROUP BY q1.id
|
||
) q2
|
||
) q3 ON aa.id = q3.account_attribute_id
|
||
$where
|
||
GROUP BY q3.account_attribute_id
|
||
ORDER BY $order_by $order_by_direction
|
||
LIMIT $limit_from, $limit_results"
|
||
);
|
||
}
|
||
|
||
public function get_accounting_system_count($filter_values = array())
|
||
{
|
||
$where = '';
|
||
foreach ($filter_values as $key => $value)
|
||
{
|
||
if ($key == 'name')
|
||
$where = "AND aa.name LIKE '%".$value."%' COLLATE utf8_general_ci";
|
||
}
|
||
return self::$db->query("SELECT COUNT(*) AS total
|
||
FROM
|
||
(SELECT a.account_attribute_id
|
||
FROM account_attributes aa
|
||
JOIN accounts a ON aa.id = a.account_attribute_id
|
||
WHERE a.member_id = 1 $where
|
||
GROUP BY a.account_attribute_id
|
||
) q1
|
||
")->current()->total;
|
||
}
|
||
|
||
|
||
/**
|
||
* Function gets some double-entry accounts. Used in dropdown to select destination account.
|
||
* @return unknown_type
|
||
*/
|
freenetis/trunk/kohana/application/models/account_attribute.php | ||
---|---|---|
* If a constant is not found in the table, its predefined value would be kept.
|
||
*/
|
||
//public function __construct() {}
|
||
|
||
/**
|
||
* Accounting system requires special query.
|
||
* For every account type it counts balance. For example credit accounts 221100 is one account
|
||
* representing money on all credit accounts in system.
|
||
* @return unknown_type
|
||
*/
|
||
public function get_accounting_system($limit_from = 0, $limit_results = 20, $order_by = 'id', $order_by_direction = 'asc', $filter_values = array())
|
||
{
|
||
$where = '';
|
||
$datetime1 = '';
|
||
$datetime2 = '';
|
||
foreach ($filter_values as $key => $value)
|
||
{
|
||
if ($key == 'name')
|
||
{
|
||
$where = " WHERE aa.name LIKE '%".$value."%' COLLATE utf8_general_ci";
|
||
}
|
||
if ($key == 'datetime')
|
||
{
|
||
$datetime1 = " AND t1.datetime LIKE '%".$value."%' COLLATE utf8_general_ci";
|
||
$datetime2 = " AND t2.datetime LIKE '%".$value."%' COLLATE utf8_general_ci";
|
||
}
|
||
}
|
||
// query
|
||
return self::$db->query("
|
||
SELECT aa.id, aa.name, SUM(partial_balance) AS balance
|
||
FROM account_attributes aa
|
||
JOIN
|
||
(SELECT q2.account_attribute_id, (inbound - outbound) AS partial_balance FROM
|
||
(SELECT q1.*, IFNULL(SUM(amount), 0) AS inbound FROM
|
||
(SELECT q0.*, IFNULL(SUM(amount), 0) AS outbound FROM
|
||
(SELECT a.id, a.account_attribute_id
|
||
FROM accounts a
|
||
) q0
|
||
LEFT JOIN transfers t1 ON q0.id = t1.origin_id $datetime1
|
||
GROUP BY q0.id
|
||
) q1
|
||
LEFT JOIN transfers t2 ON q1.id = t2.destination_id $datetime2
|
||
GROUP BY q1.id
|
||
) q2
|
||
) q3 ON aa.id = q3.account_attribute_id
|
||
$where
|
||
GROUP BY q3.account_attribute_id
|
||
ORDER BY $order_by $order_by_direction
|
||
LIMIT $limit_from, $limit_results"
|
||
);
|
||
}
|
||
|
||
public function get_accounting_system_count($filter_values = array())
|
||
{
|
||
$where = '';
|
||
foreach ($filter_values as $key => $value)
|
||
{
|
||
if ($key == 'name')
|
||
$where = "AND aa.name LIKE '%".$value."%' COLLATE utf8_general_ci";
|
||
}
|
||
return self::$db->query("SELECT COUNT(*) AS total
|
||
FROM
|
||
(SELECT a.account_attribute_id
|
||
FROM account_attributes aa
|
||
JOIN accounts a ON aa.id = a.account_attribute_id
|
||
WHERE a.member_id = 1 $where
|
||
GROUP BY a.account_attribute_id
|
||
) q1
|
||
")->current()->total;
|
||
}
|
||
|
||
}
|
||
?>
|
freenetis/trunk/kohana/application/models/transfer.php | ||
---|---|---|
public static $deduct_member_fee = 1;
|
||
public static $deduct_entrance_fee = 2;
|
||
|
||
// groups of transfers
|
||
public static $all_transfers = 1;
|
||
public static $without_inner = 2;
|
||
|
||
/**
|
||
* Function gets all double-entry transfer. They are shown in day book.
|
||
* @param $limit_from
|
||
... | ... | |
$where = '';
|
||
foreach($filter_values as $key => $value)
|
||
{
|
||
if ($key != 'submit')
|
||
if ($key != 'submit' && $key != 'group')
|
||
{
|
||
if ($where == '')
|
||
$where = 'WHERE ';
|
||
else
|
||
$where .= ' AND ';
|
||
if ($key == 'oa_name')
|
||
$key = 'oa.name';
|
||
$where .= "oa.name LIKE '%".$value."%' COLLATE utf8_general_ci";
|
||
if ($key == 'da_name')
|
||
$key = 'da.name';
|
||
if ($where == '')
|
||
$where .= 'WHERE '.$key.' LIKE \'%'.$value.'%\' COLLATE utf8_general_ci';
|
||
else
|
||
$where .= ' AND '.$key.' LIKE \'%'.$value.'%\' COLLATE utf8_general_ci';
|
||
$where .= "da.name LIKE '%".$value."%' COLLATE utf8_general_ci";
|
||
if ($key == 'text')
|
||
$where .= "t.text LIKE '%".$value."%' COLLATE utf8_general_ci";
|
||
if ($key == 'datetime')
|
||
$where .= "t.datetime LIKE '%".$value."%' COLLATE utf8_general_ci";
|
||
if ($key == 'amount')
|
||
$where .= "t.amount LIKE '%".$value."%' COLLATE utf8_general_ci";
|
||
}
|
||
/*
|
||
if ($key == 'group')
|
||
{
|
||
if ($value == self::$without_inner)
|
||
{
|
||
if ($where == '')
|
||
$where = 'WHERE ';
|
||
else
|
||
$where .= ' AND ';
|
||
$where .= "ABS(oa.account_attribute_id - da.account_attribute_id) > 99 ";
|
||
}
|
||
}
|
||
*/
|
||
}
|
||
return self::$db->query("SELECT
|
||
t.id,
|
||
... | ... | |
$where = '';
|
||
foreach($filter_values as $key => $value)
|
||
{
|
||
if ($key != 'submit')
|
||
if ($key != 'submit' && $key != 'group')
|
||
{
|
||
if ($where == '')
|
||
$where = 'WHERE ';
|
||
else
|
||
$where .= ' AND ';
|
||
if ($key == 'oa_name')
|
||
$key = 'oa.name';
|
||
$where .= "oa.name LIKE '%".$value."%' COLLATE utf8_general_ci";
|
||
if ($key == 'da_name')
|
||
$key = 'da.name';
|
||
if ($where == '')
|
||
$where .= 'WHERE '.$key.' LIKE \'%'.$value.'%\' COLLATE utf8_general_ci';
|
||
else
|
||
$where .= ' AND '.$key.' LIKE \'%'.$value.'%\' COLLATE utf8_general_ci';
|
||
$where .= "da.name LIKE '%".$value."%' COLLATE utf8_general_ci";
|
||
if ($key == 'text')
|
||
$where .= "t.text LIKE '%".$value."%' COLLATE utf8_general_ci";
|
||
if ($key == 'datetime')
|
||
$where .= "t.datetime LIKE '%".$value."%' COLLATE utf8_general_ci";
|
||
if ($key == 'amount')
|
||
$where .= "t.amount LIKE '%".$value."%' COLLATE utf8_general_ci";
|
||
}
|
||
/*
|
||
if ($key == 'group')
|
||
{
|
||
if ($value == self::$without_inner)
|
||
{
|
||
if ($where == '')
|
||
$where = 'WHERE ';
|
||
else
|
||
$where .= ' AND ';
|
||
$where .= "ABS(oa.account_attribute_id - da.account_attribute_id) > 99 ";
|
||
}
|
||
}
|
||
*/
|
||
}
|
||
return self::$db->query("SELECT COUNT(*) AS total
|
||
FROM transfers t
|
||
... | ... | |
)->current();
|
||
}
|
||
|
||
/**
|
||
* Finds entrance fee transfer from member's credit account to infrastructure account.
|
||
* @param $member_id
|
||
* @return unknown_type
|
||
*/
|
||
public function get_entrance_fee_transfer($member_id)
|
||
{
|
||
return self::$db->query("SELECT *
|
||
FROM transfers t
|
||
JOIN accounts a1 ON t.origin_id = a1.id
|
||
JOIN accounts a2 ON t.destination_id = a2.id
|
||
WHERE a1.member_id = $member_id AND a2.account_attribute_id = ".Account_attribute_Model::$infrastructure
|
||
);
|
||
}
|
||
|
||
}
|
||
|
||
?>
|
freenetis/trunk/kohana/application/controllers/members.php | ||
---|---|---|
}
|
||
if ($this->acl_check_edit(get_class($this),'organization_id', $member_id))
|
||
$form->input('organization_identifier')->label(url_lang::lang('texts.Organization identifier').':')->rules('length[3,20]')->value($member_data->organization_identifier);
|
||
if ($this->acl_check_edit('Members_Controller', 'var_sym', $member_id))
|
||
if ($this->acl_check_edit('Members_Controller', 'var_sym', $member_id) && $member_id != 1)
|
||
$form->input('variable_symbol')->label(url_lang::lang('texts.Variable symbol').':')->rules('required|length[1,10]')->value($member_data->variable_symbol)->callback(array($this, 'valid_var_sym'));
|
||
|
||
$form->group('')->label(url_lang::lang('texts.Address'));
|
||
... | ... | |
$form->dropdown('town_id')->label(url_lang::lang('texts.town').':')->rules('required')->options($arr_towns)->selected($address_point->town_id);
|
||
}
|
||
|
||
$form->group('')->label(url_lang::lang('texts.Account information'));
|
||
if ($this->acl_check_edit(get_class($this),'en_fee',$member_id) && ($member_data->entrance_fee == $member_data->entrance_fee_left))
|
||
$form->input('entrance_fee')->label(url_lang::lang('texts.Entrance fee').':')->rules('valid_numeric')->value($member_data->entrance_fee);
|
||
if ($this->acl_check_edit(get_class($this),'debit',$member_id))
|
||
$form->input('debt_payment_rate')->label(url_lang::lang('texts.Debit payment rate').':')->rules('valid_numeric')->value($member_data->debt_payment_rate);
|
||
|
||
// trying to find transfer of entrance fee to infrastructure account
|
||
$transfer_model = new Transfer_Model();
|
||
$entrance_transfer = $transfer_model->get_entrance_fee_transfer($member_id);
|
||
if (count($entrance_transfer) == 0)
|
||
{
|
||
$form->group('')->label(url_lang::lang('texts.Account information'));
|
||
if ($this->acl_check_edit(get_class($this),'en_fee',$member_id))
|
||
$form->input('entrance_fee')->label(url_lang::lang('texts.Entrance fee').':')->rules('valid_numeric')->value($member_data->entrance_fee);
|
||
if ($this->acl_check_edit(get_class($this),'debit',$member_id))
|
||
$form->input('debt_payment_rate')->label(url_lang::lang('texts.Debit payment rate').':')->rules('valid_numeric')->value($member_data->debt_payment_rate);
|
||
}
|
||
|
||
// additional information
|
||
$form->group('')->label(url_lang::lang('texts.Additional information'));
|
||
if ($this->acl_check_edit(get_class($this),'qos_ceil',$member_id))
|
||
$form->input('qos_ceil')->label(url_lang::lang('texts.qos ceil').':')->rules('valid_numeric')->value($member_data->qos_ceil);
|
||
... | ... | |
$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);
|
||
if ($parsed['year'] == '0')
|
||
{
|
||
$form->checkbox('end_membership')->label(url_lang::lang('texts.End membership'))->checked(false);
|
||
$form->date('leaving_date')->label(url_lang::lang('texts.Leaving date').':')->years(date('Y', strtotime($member_data->entrance_date)), date('Y'))->value(strtotime(date('Y-m-d')))->callback(array($this, 'valid_leaving_date'));
|
||
}
|
||
else
|
||
{
|
||
$form->checkbox('end_membership')->label(url_lang::lang('texts.End membership'))->checked(true);
|
||
$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);
|
||
|
||
$form->submit('submit')->value(url_lang::lang('texts.Edit'));
|
||
special::required_forge_style($form, ' *', 'required');
|
||
|
||
// form validation
|
||
if($form->validate())
|
||
{
|
||
$form_data = $form->as_array();
|
||
... | ... | |
{
|
||
$form_data[$key] = htmlspecialchars($value);
|
||
}
|
||
$member_data = new Member_Model;
|
||
$member_data = new Member_Model();
|
||
$member_data->find_by_id($member_id);
|
||
|
||
$address_point_model = new Address_point_Model();
|
||
... | ... | |
$member_data->type = $form_data['type'];
|
||
if ($this->acl_check_edit(get_class($this), 'organization_id', $member_id))
|
||
$member_data->organization_identifier = $form_data['organization_identifier'];
|
||
if ($this->acl_check_edit('Members_Controller', 'var_sym', $member_id))
|
||
if ($this->acl_check_edit('Members_Controller', 'var_sym', $member_id) && $member_id != 1)
|
||
$member_data->variable_symbol = $form_data['variable_symbol'];
|
||
if ($this->acl_check_edit(get_class($this),'comment',$member_id))
|
||
$member_data->comment = $form_data['comment'];
|
||
... | ... | |
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'])
|
||
$member_data->leaving_date = date("Y-m-d", $form_data['leaving_date']);
|
||
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)) {
|
||
... | ... | |
$member_data->qos_ceil = $form_data['qos_ceil'];
|
||
if ($this->acl_check_edit(get_class($this),'qos_rate',$member_id))
|
||
$member_data->qos_rate = $form_data['qos_rate'];
|
||
if ($this->acl_check_edit(get_class($this),'en_fee',$member_id))
|
||
$member_data->entrance_fee = $form_data['entrance_fee'];
|
||
if ($this->acl_check_edit(get_class($this),'en_fee_left',$member_id))
|
||
$member_data->entrance_fee_left = $form_data['entrance_fee'];
|
||
if ($this->acl_check_edit(get_class($this),'debit',$member_id))
|
||
$member_data->debt_payment_rate = $form_data['debt_payment_rate'];
|
||
|
||
// entrance fee can be edit if entrance fee has not been deducted
|
||
if (count($entrance_transfer) == 0)
|
||
{
|
||
if ($this->acl_check_edit(get_class($this),'en_fee',$member_id))
|
||
$member_data->entrance_fee = $form_data['entrance_fee'];
|
||
if ($this->acl_check_edit(get_class($this),'en_fee_left',$member_id))
|
||
$member_data->entrance_fee_left = $form_data['entrance_fee'];
|
||
if ($this->acl_check_edit(get_class($this),'debit',$member_id))
|
||
$member_data->debt_payment_rate = $form_data['debt_payment_rate'];
|
||
}
|
||
|
||
$member_saved = $member_data->save();
|
||
|
||
... | ... | |
}
|
||
|
||
/**
|
||
* Function restores membership of member.
|
||
* @param $member_id
|
||
* @return unknown_type
|
||
*/
|
||
function restore_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);
|
||
// this sets member to regular member
|
||
$member->leaving_date = '0000-00-00';
|
||
$enum_type_model = new Enum_type_Model();
|
||
$member->type = $enum_type_model->get_type_id('Regular member');
|
||
if ($member->save())
|
||
$this->session->set_flash('message', url_lang::lang('texts.Membership of the member has been successfully restored.'));
|
||
else
|
||
$this->session->set_flash('message', url_lang::lang('texts.Error - cant restore membership.'));
|
||
url::redirect(url_lang::base().'members/show/'.(int)$member_id);
|
||
}
|
||
|
||
/**
|
||
* to do - write comment
|
||
* @param $limit_results
|
||
* @param $page
|
freenetis/trunk/kohana/application/controllers/users.php | ||
---|---|---|
}
|
||
$view = new View('main');
|
||
$view->title = url_lang::lang('texts.Display user');
|
||
$view->content = new View('users/show');
|
||
$view->content = new View('users_show');
|
||
$view->content->user_data = $model_users;
|
||
$view->content->contacts = $contacts;
|
||
$view->content->contact_types = $arr_contact_types;
|
freenetis/trunk/kohana/application/controllers/transfers.php | ||
---|---|---|
* @author Jiri Svitak
|
||
*
|
||
*/
|
||
class Transfers_Controller extends Controller {
|
||
|
||
class Transfers_Controller extends Controller
|
||
{
|
||
// used for storing id of origin account for callback function
|
||
protected $origin;
|
||
|
||
/**
|
||
... | ... | |
$order_by = 'id';
|
||
if (strtolower($order_by_direction) != 'asc' && strtolower($order_by_direction) != 'desc')
|
||
$order_by_direction = 'desc';
|
||
// there are two groups of transfers
|
||
$arr_groups[Transfer_Model::$all_transfers] = url_lang::lang('texts.All transfers');
|
||
$arr_groups[Transfer_Model::$without_inner] = url_lang::lang('texts.Without inner transfers');
|
||
// creates fields for filtering
|
||
$filter=new Table_Form(url_lang::base()."transfers/show_all", "get", array(
|
||
new Table_Form_Item('text', 'oa_name', 'Origin account'),
|
||
... | ... | |
new Table_Form_Item('text', 'da_name', 'Destination account'),
|
||
new Table_Form_Item('text', 'amount', 'Amount'),
|
||
"tr",
|
||
new Table_Form_Item('text', 'text', 'Text'),
|
||
new Table_Form_Item('text', 'text', 'Text'),
|
||
//new Table_Form_Item('select', 'group', 'Group', $arr_groups),
|
||
//"tr",
|
||
"td", new Table_Form_Item('submit', 'submit', 'Filter')
|
||
)
|
||
);
|
||
... | ... | |
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);
|
||
{
|
||
url::redirect(url_lang::base().'transfers/show_all');
|
||
//Controller::warning(PARAMETER);
|
||
}
|
||
$account = new Account_Model($account_id);
|
||
if ($account->id == 0)
|
||
Controller::error(RECORD);
|
freenetis/trunk/kohana/application/controllers/accounts.php | ||
---|---|---|
$arr_groups[Account_Model::$accounting_system] = url_lang::lang('texts.Accounting system');
|
||
$arr_groups[Account_Model::$credit] = url_lang::lang('texts.Credit subaccounts');
|
||
$arr_groups[Account_Model::$project] = url_lang::lang('texts.Project subaccounts');
|
||
$arr_groups[Account_Model::$other] = url_lang::lang('texts.Other');
|
||
$filter=new Table_Form(url_lang::base()."accounts/show_all", "get", array(
|
||
new Table_Form_Item('text', 'name', 'Account name'),
|
||
new Table_Form_Item('select', 'group', 'Group', $arr_groups),
|
||
... | ... | |
if (strtolower($order_by_direction) != 'asc' && strtolower($order_by_direction) != 'desc')
|
||
$order_by_direction = 'asc';
|
||
|
||
$account_model = new Account_Model();
|
||
// choosing database model
|
||
if (isset($filter_values['group']))
|
||
$load_account_system = $filter_values['group'] == Account_Model::$accounting_system;
|
||
else
|
||
$load_account_system = true;
|
||
if ($load_account_system)
|
||
{
|
||
$total_accounts = $account_model->get_accounting_system_count($filter_values);
|
||
$account_attribute_model = new Account_attribute_Model();
|
||
$total_accounts = $account_attribute_model->get_accounting_system_count($filter_values);
|
||
if (($sql_offset = ($page - 1) * $limit_results) > $total_accounts)
|
||
$sql_offset = 0;
|
||
$accounts = $account_model->get_accounting_system($sql_offset, (int)$limit_results, $order_by, $order_by_direction, $filter_values);
|
||
$accounts = $account_attribute_model->get_accounting_system($sql_offset, (int)$limit_results, $order_by, $order_by_direction, $filter_values);
|
||
}
|
||
else
|
||
{
|
||
$account_model = new Account_Model();
|
||
$total_accounts = $account_model->get_accounts_count($filter_values);
|
||
if (($sql_offset = ($page - 1) * $limit_results) > $total_accounts)
|
||
$sql_offset = 0;
|
||
... | ... | |
$query_string = '?'.implode('&', $arr_gets);
|
||
|
||
if (count($filter_values) == 0)
|
||
$filter_values['group'] = Account_Model::$credit;
|
||
$filter_values['group'] = Account_Model::$accounting_system;
|
||
// set correct headline for chosen group
|
||
$headline = $arr_groups[$filter_values['group']];
|
||
// save current group of double entry accounts to session
|
freenetis/trunk/kohana/application/views/members_show.php | ||
---|---|---|
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').'\')'));
|
||
}
|
||
else
|
||
{
|
||
if ($this->acl_check_edit('Members_Controller', 'members'))
|
||
$links[] = html::anchor(url_lang::base().'members/restore_membership/'.$member_data->member_id, url_lang::lang('texts.Restore membership'), array('onclick' => 'return potvrd(\''.url_lang::lang('texts.Do you want to restore 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'));
|
||
... | ... | |
<th><?php echo url_lang::lang('texts.Member name') ?></th>
|
||
<td><?php echo $member_data->namem ?></td>
|
||
</tr>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Organization identifier') ?></th>
|
||
<td><?php echo $member_data->organization_identifier ?></td>
|
||
</tr>
|
||
<?php if ($member_data->member_id != 1) { ?>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Variable symbol') ?></th>
|
||
... | ... | |
<td><?php echo $member_data->entrance_date ?></td>
|
||
</tr>
|
||
<?php } ?>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Type') ?></th>
|
||
<td><?php echo $member_type ?></td>
|
||
</tr>
|
||
<?php if ($this->acl_check_view('Members_Controller', 'leaving_date', $member_data->member_id) && $member_data->leaving_date != '0000-00-00') { ?>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Leaving date') ?></th>
|
||
... | ... | |
</tr>
|
||
<?php } ?>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Type') ?></th>
|
||
<td><?php echo $member_type ?></td>
|
||
</tr>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Organization identifier') ?></th>
|
||
<td><?php echo $member_data->organization_identifier ?></td>
|
||
</tr>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Address') ?></th>
|
||
<td><?php echo $address_point->street->street.' '.$address_point->street_number?></td>
|
||
</tr>
|
freenetis/trunk/kohana/application/views/users/show.php | ||
---|---|---|
<h2><?php echo url_lang::lang('texts.User').' '.$user_data->pre_title.' '.$user_data->name.' '.$user_data->middle_name.' '.$user_data->surname.' '.$user_data->post_title ?></h2><br />
|
||
|
||
<?php echo $message ? '<div class="message">'.$message.'</div>' : '' ?>
|
||
|
||
<?php
|
||
|
||
$links = array();
|
||
|
||
if ($this->acl_check_view('Members_Controller','members', $user_data->member_id))
|
||
$links[] = html::anchor(url_lang::base().'members/show/'.$user_data->member_id, url_lang::lang('texts.Back to the member'));
|
||
if ($this->acl_check_edit(get_class($this),'users',$user_data->member_id))
|
||
$links[] = html::anchor(url_lang::base().'users/edit/'.$user_data->id,url_lang::lang('texts.Edit user'));
|
||
if ($this->acl_check_view('Devices_Controller', 'devices', $user_data->member_id))
|
||
$links[] = html::anchor(url_lang::base().'devices/show_by_user/'.$user_data->id,url_lang::lang('texts.Show his devices'));
|
||
if ($user_data->id <> 1 && $this->acl_check_view('Users_Controller', 'work', $user_data->member_id))
|
||
$links[] = html::anchor(url_lang::base().'works/show_by_user/'.$user_data->id,url_lang::lang('texts.Show his works'));
|
||
if ($this->acl_check_edit(get_class($this),'password',$user_data->member_id))
|
||
$links[] = html::anchor(url_lang::base().'users/change_password/'.$user_data->id,url_lang::lang('texts.Change password'));
|
||
if ($this->acl_check_edit(get_class($this), 'application_password', $user_data->member_id))
|
||
$links[] = html::anchor(url_lang::base().'users/change_application_password/'.$user_data->member_id, url_lang::lang('texts.Change application password'));
|
||
|
||
echo implode (' | ', $links)
|
||
|
||
|
||
?>
|
||
<br /><br />
|
||
|
||
<table class="extended" cellspacing="0">
|
||
<tr>
|
||
<th colspan="2"><?php echo url_lang::lang('texts.Basic information') ?></th>
|
||
</tr>
|
||
<tr>
|
||
<th>ID</th>
|
||
<td><?php echo $user_data->id ?></td>
|
||
</tr>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Username') ?></th>
|
||
<td><?php echo $user_data->login ?></td>
|
||
</tr>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Name') ?></th>
|
||
<td><?php echo $user_data->pre_title.' '.$user_data->name.' '.$user_data->middle_name.' '.$user_data->surname.' '.$user_data->post_title ?></td>
|
||
</tr>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Member name') ?></th>
|
||
<td><?php echo html::anchor(url_lang::base().'members/show/'.$user_data->member_id,$user_data->member->name) ?></td>
|
||
</tr>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Type') ?></th>
|
||
<td><?php echo ($user_data->type==1) ? url_lang::lang('texts.Main') : url_lang::lang('texts.Collateral') ?></td>
|
||
</tr>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Birthday') ?></th>
|
||
<td><?php echo $user_data->birthday ?></td>
|
||
</tr>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Comment') ?></th>
|
||
<td><?php echo trim($user_data->comment)!='' ? $user_data->comment : ' '; ?></td>
|
||
</tr>
|
||
<tr>
|
||
<th colspan="2"><?php echo url_lang::lang('texts.Contact information') ?></th>
|
||
</tr>
|
||
<tr>
|
||
<th>E-mail</th>
|
||
<td><?php echo $user_data->email ?></td>
|
||
</tr>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Phone') ?></th>
|
||
<td><?php echo $user_data->phone ?></td>
|
||
</tr>
|
||
<?php if ($user_data->id != 1) { ?>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.VoIP') ?></th>
|
||
<td><?php echo $voip ?></td>
|
||
</tr>
|
||
<?php } ?>
|
||
<?php foreach ($contacts as $i => $contact):?>
|
||
<tr>
|
||
<th><?php echo $contact_types[$i] ?></th>
|
||
<td><?php echo $contact->value ?></td>
|
||
</tr>
|
||
<?php endforeach; ?>
|
||
<?php if ($this->acl_check_new(get_class($this),'additional_contacts',$user_data->member_id)) { ?>
|
||
<tr>
|
||
<td colspan="2"><?php echo html::anchor(url_lang::base().'users/additional_contacts/'.$user_data->id,url_lang::lang('texts.Administrate additional contacts')) ?></td>
|
||
</tr>
|
||
<?php } ?>
|
||
</table>
|
freenetis/trunk/kohana/application/views/users_show.php | ||
---|---|---|
<h2><?php echo url_lang::lang('texts.User').' '.$user_data->pre_title.' '.$user_data->name.' '.$user_data->middle_name.' '.$user_data->surname.' '.$user_data->post_title ?></h2><br />
|
||
|
||
<?php echo $message ? '<div class="message">'.$message.'</div>' : '' ?>
|
||
|
||
<?php
|
||
|
||
$links = array();
|
||
|
||
if ($this->acl_check_view('Members_Controller','members', $user_data->member_id))
|
||
$links[] = html::anchor(url_lang::base().'members/show/'.$user_data->member_id, url_lang::lang('texts.Back to the member'));
|
||
if ($this->acl_check_edit(get_class($this),'users',$user_data->member_id))
|
||
$links[] = html::anchor(url_lang::base().'users/edit/'.$user_data->id,url_lang::lang('texts.Edit user'));
|
||
if ($this->acl_check_view('Devices_Controller', 'devices', $user_data->member_id))
|
||
$links[] = html::anchor(url_lang::base().'devices/show_by_user/'.$user_data->id,url_lang::lang('texts.Show devices'));
|
||
if ($user_data->id <> 1 && $this->acl_check_view('Users_Controller', 'work', $user_data->member_id))
|
||
$links[] = html::anchor(url_lang::base().'works/show_by_user/'.$user_data->id,url_lang::lang('texts.Show works'));
|
||
if ($this->acl_check_edit(get_class($this),'password',$user_data->member_id))
|
||
$links[] = html::anchor(url_lang::base().'users/change_password/'.$user_data->id,url_lang::lang('texts.Change password'));
|
||
if ($this->acl_check_edit(get_class($this), 'application_password', $user_data->member_id))
|
||
$links[] = html::anchor(url_lang::base().'users/change_application_password/'.$user_data->member_id, url_lang::lang('texts.Change application password'));
|
||
|
||
echo implode (' | ', $links)
|
||
|
||
|
||
?>
|
||
<br /><br />
|
||
|
||
<table class="extended" cellspacing="0">
|
||
<tr>
|
||
<th colspan="2"><?php echo url_lang::lang('texts.Basic information') ?></th>
|
||
</tr>
|
||
<tr>
|
||
<th>ID</th>
|
||
<td><?php echo $user_data->id ?></td>
|
||
</tr>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Username') ?></th>
|
||
<td><?php echo $user_data->login ?></td>
|
||
</tr>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Name') ?></th>
|
||
<td><?php echo $user_data->pre_title.' '.$user_data->name.' '.$user_data->middle_name.' '.$user_data->surname.' '.$user_data->post_title ?></td>
|
||
</tr>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Member name') ?></th>
|
||
<td><?php echo html::anchor(url_lang::base().'members/show/'.$user_data->member_id,$user_data->member->name) ?></td>
|
||
</tr>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Type') ?></th>
|
||
<td><?php echo ($user_data->type==1) ? url_lang::lang('texts.Main') : url_lang::lang('texts.Collateral') ?></td>
|
||
</tr>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Birthday') ?></th>
|
||
<td><?php echo $user_data->birthday ?></td>
|
||
</tr>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Comment') ?></th>
|
||
<td><?php echo trim($user_data->comment)!='' ? $user_data->comment : ' '; ?></td>
|
||
</tr>
|
||
<tr>
|
||
<th colspan="2"><?php echo url_lang::lang('texts.Contact information') ?></th>
|
||
</tr>
|
||
<tr>
|
||
<th>E-mail</th>
|
||
<td><?php echo $user_data->email ?></td>
|
||
</tr>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Phone') ?></th>
|
||
<td><?php echo $user_data->phone ?></td>
|
||
</tr>
|
||
<?php if ($user_data->id != 1) { ?>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.VoIP') ?></th>
|
||
<td><?php echo $voip ?></td>
|
||
</tr>
|
||
<?php } ?>
|
||
<?php foreach ($contacts as $i => $contact):?>
|
||
<tr>
|
||
<th><?php echo $contact_types[$i] ?></th>
|
||
<td><?php echo $contact->value ?></td>
|
||
</tr>
|
||
<?php endforeach; ?>
|
||
<?php if ($this->acl_check_new(get_class($this),'additional_contacts',$user_data->member_id)) { ?>
|
||
<tr>
|
||
<td colspan="2"><?php echo html::anchor(url_lang::base().'users/additional_contacts/'.$user_data->id,url_lang::lang('texts.Administrate additional contacts')) ?></td>
|
||
</tr>
|
||
<?php } ?>
|
||
</table>
|
Také k dispozici: Unified diff
Pridano tlacitko pro obnoveni clenstvi byvaleho clena. Upravy ucetni osnovy a podvojnych uctu. Opravy chyb.