Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 501

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

Uprava filtrovani clenu podle presmerovani, radny clen si muze zobrazit podrobnosti o sve platbe.

Zobrazit rozdíly:

freenetis/trunk/kohana/application/i18n/cs_CZ/texts.php
'received member fees' => 'Přijaté členské příspěvky',
'redir' => 'Přesm',
'redirect' => 'Přesměrovat',
'redirected only' => 'Jen přesměrovaní',
'redirection' => 'Přesměrování',
'redirection has been successfully set' => 'Přesměrování bylo úspěšně nastaveno.',
'reg' => 'Přih.',
freenetis/trunk/kohana/application/models/member.php
<?php
class Member_Model extends ORM
{
protected $has_many = array('invoices', ' users', 'accounts', 'transfers', 'bank_accounts');
protected $belongs_to = array('address_point');
public static $all = 1;
public static $redirected = 2;
public function __construct($id = false)
{
......
if ($key == 'id') $key = 'm.id';
if ($key == 'comment') $key = 'm.comment';
if ($key == 'type' && $value == 0) continue;
if ($key != 'submit')
if ($key != 'submit' && $key != 'redirect')
{
if ($where == '')
$where = 'WHERE '.$key.' LIKE \'%'.trim($value).'%\' COLLATE utf8_general_ci';
$where = 'WHERE ';
else
$where .= ' AND '.$key.' LIKE \'%'.trim($value).'%\' COLLATE utf8_general_ci';
$where .= ' AND ';
$where .= $key.' LIKE \'%'.trim($value).'%\' COLLATE utf8_general_ci';
}
if ($key == 'redirect' && $value == self::$redirected)
{
if ($where == '')
$where = 'WHERE m.redirect > 0';
else
$where .= ' AND m.redirect > 0';
}
}
return self::$db->query("SELECT
m.id, m.registration, m.name, s.street, ap.street_number, t.town, t.quarter, m.variable_symbol, a.id AS aid
......
$where = '';
foreach($filter_values as $key => $value)
{
if ($key == 'street') $key = 's.'.$key;
if ($key == 'town') $key = 't.'.$key;
if ($key == 'street') $key = 's.street';
if ($key == 'town') $key = 't.town';
if ($key == 'name') $key = 'm.name';
if ($key == 'id') $key = 'm.id';
if ($key == 'comment') $key = 'm.comment';
if ($key == 'type' && $value == 0) continue;
if ($key != 'submit')
if ($key != 'submit' && $key != 'redirect')
{
if ($where == '')
$where = 'WHERE '.$key.' LIKE \'%'.trim($value).'%\' COLLATE utf8_general_ci';
$where = 'WHERE ';
else
$where .= ' AND '.$key.' LIKE \'%'.trim($value).'%\' COLLATE utf8_general_ci';
$where .= ' AND ';
$where .= $key.' LIKE \'%'.trim($value).'%\' COLLATE utf8_general_ci';
}
if ($key == 'redirect' && $value == self::$redirected)
{
if ($where == '')
$where = 'WHERE m.redirect > 0';
else
$where .= ' AND m.redirect > 0';
}
}
return self::$db->query("SELECT COUNT(*) AS total
FROM members m
freenetis/trunk/kohana/application/models/transfer.php
public function get_transfer($trans_id = null)
{
return self::$db->query("SELECT
t.id, t.previous_transfer_id, t.datetime, t.creation_datetime, t.text, t.amount,
t.id, t.previous_transfer_id, t.datetime, t.creation_datetime, t.text, t.amount, t.member_id,
oa.id AS oa_id,
oa.name AS oa_name,
da.id AS da_id,
freenetis/trunk/kohana/application/controllers/members.php
// types of members to filtering
$enum_types = new Enum_type_Model();
$types = $enum_types->get_values(Enum_type_Model::$member_type_id);
$types[0] = url_lang::lang('texts.All');
$types[0] = url_lang::lang('texts.All');
// types of redirection
$redir_types[Member_Model::$all] = url_lang::lang('texts.All');
$redir_types[Member_Model::$redirected] = url_lang::lang('texts.Redirected only');
// creates fields for filtering members
$filter=new Table_Form(url_lang::base()."members/show_all", "get", array(
new Table_Form_Item('text','name','Name'),
......
new Table_Form_Item('text','street','Street'),
"tr",
new Table_Form_Item('text','id','ID'),
new Table_Form_Item('text','redirect','Redirection'),
new Table_Form_Item('select','redirect','Show', $redir_types),
"tr",
new Table_Form_Item('text','comment','Comment'),
new Table_Form_Item('select','type','Type', $types),
freenetis/trunk/kohana/application/controllers/transfers.php
$grid->order_field('datetime')->label(url_lang::lang('texts.Date and time'));
$grid->order_field('amount')->label(url_lang::lang('texts.Amount'));
$grid->order_field('text')->label(url_lang::lang('texts.Text'));
if ($this->acl_check_view('Accounts_Controller', 'transfers'))
if ($this->acl_check_view('Accounts_Controller', 'transfers', $account->member_id))
$grid->action_field('id')->label(url_lang::lang('texts.Transfer'))->url(url_lang::base().'transfers/show')->action(url_lang::lang('texts.Show'));
// transfers should not be edited
//if ($this->acl_check_edit('Accounts_Controller', 'transfers'))
......
*/
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 = $transfer_model->get_transfer($transfer_id);
if (!is_object($transfer))
Controller::error(RECORD);
if (!$this->acl_check_view('Accounts_Controller', 'transfers', $transfer->member_id))
Controller::error(ACCESS);
// 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
......
$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 = new View('transfers_show');
$view->content->headline = $headline;
$view->content->transfer = $transfer;
$view->content->dependent_transfers = $dependent_transfers;
freenetis/trunk/kohana/application/views/transfers/show.php
<h2><?php echo $headline ?></h2>
<br />
<?php echo $message ? '<div class="message">'.$message.'</div>' : '' ?>
<?php echo html::anchor(url_lang::base().'transfers/show_all', url_lang::lang('texts.Back to day book')) ?><br />
<br />
<table class="extended" cellspacing="0" style="float:left; width:360px;">
<tr>
<th colspan="2"><?php echo url_lang::lang('texts.Transfer') ?></th>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Transfer ID')?></th>
<td><?php echo $transfer->id ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Origin account') ?></th>
<td><?php echo html::anchor(url_lang::base().'transfers/show_by_account/'.$transfer->oa_id, $transfer->oa_name); ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Destination account') ?></th>
<td><?php echo html::anchor(url_lang::base().'transfers/show_by_account/'.$transfer->da_id, $transfer->da_name); ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Date and time') ?></th>
<td><?php echo $transfer->datetime; ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Date and time of creation') ?></th>
<td><?php echo $transfer->creation_datetime; ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Text') ?></th>
<td><?php echo $transfer->text; ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Amount') ?></th>
<td><?php echo number_format((float)$transfer->amount, 2, ',', ' ').' '.$this->setting->currency ?></td>
</tr>
<?php if (isset($transfer->previous_transfer_id)) { ?>
<tr>
<th><?php echo url_lang::lang('texts.Previous transfer') ?></th>
<td><?php echo html::anchor(url_lang::base().'transfers/show/'.$transfer->previous_transfer_id, $transfer->previous_transfer_id) ?></td>
</tr>
<?php } ?>
<?php ?>
<?php foreach ($dependent_transfers as $dep) { ?>
<tr>
<th><?php echo url_lang::lang('texts.Dependent transfer') ?></th>
<td><?php echo html::anchor(url_lang::base().'transfers/show/'.$dep->id, $dep->id) ?></td>
</tr>
<?php } ?>
</table>
<?php if (isset($bt)) { ?>
<table class="extended" style="float:left;width:360px; margin-left:10px;">
<tr>
<th colspan="2"><?php echo url_lang::lang('texts.Bank transfer') ?></th>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Bank transfer ID') ?></th>
<td><?php echo $bt->bt_id ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Constant symbol') ?></th>
<td><?php echo $bt->constant_symbol ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Variable symbol') ?></th>
<td><?php echo $bt->variable_symbol ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Specific symbol') ?></th>
<td><?php echo $bt->specific_symbol ?></td>
</tr>
<tr>
<th colspan="2"><?php echo url_lang::lang('texts.Origin bank account') ?></th>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Bank account id') ?></th>
<td><?php echo html::anchor(url_lang::base().'bank_transfers/show_by_bank_account/'.$bt->bt_origin_id, $bt->bt_origin_id) ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Account name') ?></th>
<td><?php echo $bt->oba_name ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Account number') ?></th>
<td><?php echo $bt->oba_number ?></td>
</tr>
<tr>
<th colspan="2"><?php echo url_lang::lang('texts.Destination bank account') ?></th>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Bank account id') ?></th>
<td><?php echo html::anchor(url_lang::base().'bank_transfers/show_by_bank_account/'.$bt->bt_destination_id, $bt->bt_destination_id) ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Account name') ?></th>
<td><?php echo $bt->dba_name ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Account number') ?></th>
<td><?php echo $bt->dba_number ?></td>
</tr>
</table>
<?php } ?>
freenetis/trunk/kohana/application/views/transfers_show.php
<h2><?php echo $headline ?></h2>
<br />
<?php
echo $message ? '<div class="message">'.$message.'</div>' : '';
if ($this->acl_check_view('Accounts_Controller', 'transfers')) {
echo html::anchor(url_lang::base().'transfers/show_all', url_lang::lang('texts.Back to day book')); ?>
<br />
<?php } ?>
<br />
<table class="extended" cellspacing="0" style="float:left; width:360px;">
<tr>
<th colspan="2"><?php echo url_lang::lang('texts.Transfer') ?></th>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Transfer ID')?></th>
<td><?php echo $transfer->id ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Origin account') ?></th>
<td><?php echo html::anchor(url_lang::base().'transfers/show_by_account/'.$transfer->oa_id, $transfer->oa_name); ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Destination account') ?></th>
<td><?php echo html::anchor(url_lang::base().'transfers/show_by_account/'.$transfer->da_id, $transfer->da_name); ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Date and time') ?></th>
<td><?php echo $transfer->datetime; ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Date and time of creation') ?></th>
<td><?php echo $transfer->creation_datetime; ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Text') ?></th>
<td><?php echo $transfer->text; ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Amount') ?></th>
<td><?php echo number_format((float)$transfer->amount, 2, ',', ' ').' '.$this->setting->currency ?></td>
</tr>
<?php if (isset($transfer->previous_transfer_id)) { ?>
<tr>
<th><?php echo url_lang::lang('texts.Previous transfer') ?></th>
<td><?php echo html::anchor(url_lang::base().'transfers/show/'.$transfer->previous_transfer_id, $transfer->previous_transfer_id) ?></td>
</tr>
<?php } ?>
<?php ?>
<?php foreach ($dependent_transfers as $dep) { ?>
<tr>
<th><?php echo url_lang::lang('texts.Dependent transfer') ?></th>
<td><?php echo html::anchor(url_lang::base().'transfers/show/'.$dep->id, $dep->id) ?></td>
</tr>
<?php } ?>
</table>
<?php if (isset($bt)) { ?>
<table class="extended" style="float:left;width:360px; margin-left:10px;">
<tr>
<th colspan="2"><?php echo url_lang::lang('texts.Bank transfer') ?></th>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Bank transfer ID') ?></th>
<td><?php echo $bt->bt_id ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Constant symbol') ?></th>
<td><?php echo $bt->constant_symbol ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Variable symbol') ?></th>
<td><?php echo $bt->variable_symbol ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Specific symbol') ?></th>
<td><?php echo $bt->specific_symbol ?></td>
</tr>
<tr>
<th colspan="2"><?php echo url_lang::lang('texts.Origin bank account') ?></th>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Bank account id') ?></th>
<td><?php echo html::anchor(url_lang::base().'bank_transfers/show_by_bank_account/'.$bt->bt_origin_id, $bt->bt_origin_id) ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Account name') ?></th>
<td><?php echo $bt->oba_name ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Account number') ?></th>
<td><?php echo $bt->oba_number ?></td>
</tr>
<tr>
<th colspan="2"><?php echo url_lang::lang('texts.Destination bank account') ?></th>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Bank account id') ?></th>
<td><?php echo html::anchor(url_lang::base().'bank_transfers/show_by_bank_account/'.$bt->bt_destination_id, $bt->bt_destination_id) ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Account name') ?></th>
<td><?php echo $bt->dba_name ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Account number') ?></th>
<td><?php echo $bt->dba_number ?></td>
</tr>
</table>
<?php } ?>

Také k dispozici: Unified diff