Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 995

Přidáno uživatelem Michal Kliment před více než 13 roky(ů)

Merge zmen z testingu do vetve s vyhledavanim a filtrovanim.

Zobrazit rozdíly:

freenetis/branches/search_filters/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/search_filters/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/search_filters/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/search_filters/application/models/job.php
SELECT c.*, CONCAT(u.surname," ",u.name) AS user FROM comments c
LEFT JOIN users u ON c.user_id = u.id
ORDER BY datetime DESC
) AS c WHERE c.comments_thread_id = j.comments_thread_id GROUP BY c.user_id
) AS c WHERE c.comments_thread_id = j.comments_thread_id GROUP BY c.comments_thread_id
) AS comments,
(
SELECT GROUP_CONCAT(comment SEPARATOR ", \n\n") FROM
......
SELECT c.*, CONCAT(u.surname," ",u.name) AS user FROM comments c
LEFT JOIN users u ON c.user_id = u.id
ORDER BY datetime DESC
) AS c WHERE c.comments_thread_id = j.comments_thread_id GROUP BY c.user_id
) AS c WHERE c.comments_thread_id = j.comments_thread_id GROUP BY c.comments_thread_id
) AS comments,
(
SELECT GROUP_CONCAT(comment SEPARATOR ", \n\n") FROM
......
SELECT c.*, CONCAT(u.surname," ",u.name) AS user FROM comments c
LEFT JOIN users u ON c.user_id = u.id
ORDER BY datetime DESC
) AS c WHERE c.comments_thread_id = j.comments_thread_id GROUP BY c.user_id
) AS c WHERE c.comments_thread_id = j.comments_thread_id GROUP BY c.comments_thread_id
) AS comments,
(
SELECT GROUP_CONCAT(comment SEPARATOR ", \n\n") FROM
freenetis/branches/search_filters/application/controllers/users.php
$user_data->middle_name = $form_data['middle_name'];
$user_data->surname = $form_data['surname'];
$user_data->post_title = $form_data['post_title'];
$user_data->comment = $form_data['comment'];
if (isset($form_data['comment']))
$user_data->comment = $form_data['comment'];
$user_data->type = User_Model::$user;
$user_data->member_id = $member_id;
$user_data->application_password = security::generate_password();
freenetis/branches/search_filters/application/controllers/voip.php
$emails = $user->get_user_emails($user->id);
$email = '';
if ($emails != false)
if ($emails != false && $emails->current())
{
$email = $emails->current()->email;
}
freenetis/branches/search_filters/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'));
freenetis/branches/search_filters/application/controllers/sms.php
else
$answer = ' - ';
}
$code = ORM::factory('contact')->find_phone_country_code($sms->receiver);
$number = substr($sms->receiver, strlen($code));
if (substr($sms->receiver, 0, 3) == '420')
$receiver = substr($sms->receiver, 3);
$receiver = ORM::factory('user')->get_user_by_phone_number_country_code ($number, $code);
$receiver = ORM::factory('user')->where('phone', $receiver)->find();
if ($receiver->id != null)
{
if (substr($sms->receiver, 0,3) == '420')
$r = html::anchor(url_lang::base().'users/show/'.$receiver->id, '420'.$receiver->phone, array('title' => $receiver->name.' '.$receiver->surname));
else
$r = html::anchor(url_lang::base().'users/show/'.$receiver->id, $receiver->phone, array('title' => $receiver->name.' '.$receiver->surname));
}
if ($receiver && $receiver->id)
$r = html::anchor(url_lang::base().'users/show/'.$receiver->id, $code.$number, array('title' => $receiver->name.' '.$receiver->surname));
else
$r = $sms->receiver;
$r = $sms->receiver;
$view = new View('main');
$view->title = url_lang::lang('texts.Show SMS message');
freenetis/branches/search_filters/application/controllers/works.php
$this->form->dropdown('user_id')->label(url_lang::lang('texts.User'))->options($arr_users)->rules('required')->selected($work->user_id);
$this->form->textarea('description')->label(url_lang::lang('texts.Description').':')->rules('required|length[0,65535]')->value($work->description);
$this->form->date('date')->label(url_lang::lang('texts.Date').':')->years(date('Y')-10, date('Y'))->rules('required')->value(strtotime($work->date));
$this->form->input('hours')->label(url_lang::lang('texts.Hours').':')->rules('required|length[0,250]|valid_numeric')->value($work->hours);
$this->form->input('km')->label(url_lang::lang('texts.Km').':')->rules('length[0,250]|valid_numeric')->value($work->km);
$this->form->input('suggest_amount')->label(url_lang::lang('texts.Suggest amount').':')->rules('required|valid_numeric')->value($work->suggest_amount);
$this->form->input('hours')->label(url_lang::lang('texts.Hours').':')->rules('required|length[0,250]|valid_numeric')->value(num::decimal_point($work->hours));
$this->form->input('km')->label(url_lang::lang('texts.Km').':')->rules('length[0,250]|valid_numeric')->value(num::decimal_point($work->km));
$this->form->input('suggest_amount')->label(url_lang::lang('texts.Suggest amount').':')->rules('required|valid_numeric')->value(num::decimal_point($work->suggest_amount));
if ($this->acl_check_view('approval','templates'))
{

Také k dispozici: Unified diff