Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 988

Přidáno uživatelem Jiří Sviták před více než 13 roky(ů)

Ve výpisu členů přidán sloupec pro zkratku typu člena. Výchozí filtrování zobrazení členů je na všechny členy kromě bývalých, kteří tam zbytečně překáželi.

Zobrazit rozdíly:

freenetis/branches/testing/application/i18n/cs_CZ/texts.php
'add admin to redirection module' => 'Přidat správce do modulu přesměrování',
'add address point' => 'Přidat adresní bod',
'add backup' => 'Přidat zálohu',
'add comment' => 'Přidat komentář',
'add comment' => 'Přidat komentář k finančnímu stavu člena',
'add contact' => 'Přidat kontakt',
'add member fee payment by cash' => 'Přidat platbu členského příspěvku hotově',
'add new' => 'Přidat nový',
......
'all ip addresses of member' => 'všem IP adresám člena',
'all redirected' => 'Všichni přesměrovaní',
'all transfers' => 'Všechny převody',
'all without former' => 'Všichni bez bývalých',
'allow' => 'Povolit',
'allowed subnets' => 'Povolené podsítě',
'allowed subnets of member' => 'Povolené podsítě člena',
freenetis/branches/testing/application/helpers/callback.php
}
/**
* Makes abbreviation of member type.
* @author Jiri Svitak
* @param <type> $item
* @param <type> $name
*/
static function member_type_name_field($item, $name)
{
$abbreviation = '';
$words = explode(' ', $item->type_name);
foreach($words as $word)
{
$abbreviation .= mb_substr($word, 0, 1, 'UTF-8');
}
echo mb_strtoupper($abbreviation, 'UTF-8');
}
/**
* Callback field for member name. Leaves blank name if needed.
* @author Jiri Svitak
* @param unknown_type $item
freenetis/branches/testing/application/models/member.php
}
}
if ($key == 'type' && $value != 0)
// special member types to filter
if ($key == 'type')
{
if ($value != 0)
{
$where[] = "m.type = $value";
}
else
// all without former members, default option
{
$enum_model = new Enum_type_Model();
$value = $enum_model->get_type_id('Former member');
$where[] = "m.type <> $value";
}
}
if ($key == 'redirect' && $value != self::$all)
{
......
$where[] = "m.redirect & 8 = 8";
}
}
// default filtering
if (count($filter_values) == 0)
{
$enum_model = new Enum_type_Model();
$value = $enum_model->get_type_id('Former member');
$where[] = "m.type <> $value";
}
$where = implode(" AND ",$where);
$where = ($where!='') ? 'WHERE '.$where : '';
return $this->db->query("
SELECT id, id AS member_id, registration, name, street, street_number, town, quarter, variable_symbol, aid, balance, redirect, GROUP_CONCAT(a_comment SEPARATOR ', \n\n') AS a_comment, a_comments_thread_id FROM
SELECT id, id AS member_id, registration, name, street, street_number, town, quarter, variable_symbol, aid, balance, redirect, GROUP_CONCAT(a_comment SEPARATOR ', \n\n') AS a_comment, a_comments_thread_id, type_name FROM
(
SELECT
m.id, m.registration, m.name,
......
m.variable_symbol, a.id AS aid,
a.balance,
m.redirect, CONCAT(u.surname,' ',u.name,' (',SUBSTRING(c.datetime,1,10),'):\n',c.text) AS a_comment,
a.comments_thread_id AS a_comments_thread_id
a.comments_thread_id AS a_comments_thread_id,
IFNULL(f.translated_term, e.value) AS type_name
FROM members m
LEFT JOIN address_points ap ON m.address_point_id = ap.id
LEFT JOIN streets s ON ap.street_id = s.id
......
LEFT JOIN comments_threads ct ON a.comments_thread_id = ct.id
LEFT JOIN comments c ON ct.id = c.comments_thread_id
LEFT JOIN users u ON c.user_id = u.id
LEFT JOIN enum_types e ON m.type = e.id
LEFT JOIN (SELECT * FROM translations WHERE lang = '".Config::get('lang')."') f ON e.value = f.original_term
$where
ORDER BY c.datetime DESC
) AS q
......
}
}
if ($key == 'type' && $value != 0)
// special member types to filter
if ($key == 'type')
{
if ($value != 0)
{
$where[] = "m.type = $value";
}
else
// all without former members, default option
{
$enum_model = new Enum_type_Model();
$value = $enum_model->get_type_id('Former member');
$where[] = "m.type <> $value";
}
}
if ($key == 'redirect' && $value != self::$all)
{
......
$where[] = "m.redirect & 8 = 8";
}
}
// default filtering
if (count($filter_values) == 0)
{
$enum_model = new Enum_type_Model();
$value = $enum_model->get_type_id('Former member');
$where[] = "m.type <> $value";
}
$where = implode(" AND ",$where);
$where = ($where!='') ? 'WHERE '.$where : '';
freenetis/branches/testing/application/controllers/members.php
if (is_numeric($this->input->get('record_per_page')))
$limit_results = (int) $this->input->get('record_per_page');
// parameters control
$allowed_order_type = array('id', 'name', 'street', 'street_number', 'town', 'quarter', 'ZIP_code', 'qos_ceil', 'qos_rate', 'entrance_fee', 'debt_payment_rate', 'current_credit', 'entrance_date', 'comment', 'balance');
$allowed_order_type = array('id', 'name', 'street', 'street_number', 'town', 'quarter', 'ZIP_code', 'qos_ceil', 'qos_rate', 'entrance_fee', 'debt_payment_rate', 'current_credit', 'entrance_date', 'comment', 'balance', 'type_name');
if (!in_array(strtolower($order_by), $allowed_order_type))
$order_by = 'id';
if (strtolower($order_by_direction) != 'asc' && strtolower($order_by_direction) != 'desc')
......
// 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 without former');
// types of redirection
$redir_types[Member_Model::$all] = url_lang::lang('texts.All');
$redir_types[Member_Model::$all_redirected] = url_lang::lang('texts.All redirected');
......
// database columns - some are commented out because of lack of space
$grid->order_field('id')->label('ID');
$grid->order_field('registration')->label(url_lang::lang('texts.Reg'))->bool(array(url_lang::lang('texts.No'),url_lang::lang('texts.Yes')))->class('center');
$grid->order_callback_field('type_name')->label(url_lang::lang('texts.Type'))->callback('callback::member_type_name_field');
$grid->order_field('name')->label(url_lang::lang('texts.Name'));
$grid->order_field('street')->label(url_lang::lang('texts.Street'));
$grid->order_field('street_number')->label(url_lang::lang('texts.Street number'));

Také k dispozici: Unified diff