Revize 1905
Přidáno uživatelem Ondřej Fibich před více než 11 roky(ů)
freenetis/branches/1.1/application/models/enum_type.php | ||
---|---|---|
*/
|
||
public function get_all($order_by, $order_by_direction)
|
||
{
|
||
return $this->select('enum_types.id', 'enum_type_names.type_name as type', 'enum_types.value')
|
||
->join('enum_type_names', 'enum_types.type_id', 'enum_type_names.id')
|
||
->where('read_only', 0)
|
||
->orderby($order_by, $order_by_direction)
|
||
->find_all();
|
||
// order by check
|
||
if (!$this->has_column($order_by))
|
||
{
|
||
$order_by = 'id';
|
||
}
|
||
// order by direction check
|
||
if (strtolower($order_by_direction) != 'desc')
|
||
{
|
||
$order_by_direction = 'asc';
|
||
}
|
||
// query
|
||
return $this->db->query("
|
||
SELECT et.id, etn.type_name as type, et.value, et.read_only AS readonly
|
||
FROM enum_types et
|
||
JOIN enum_type_names etn ON et.type_id = etn.id
|
||
LEFT JOIN translations t ON etn.type_name = t.original_term AND t.lang = ?
|
||
ORDER BY $order_by $order_by_direction
|
||
", Config::get('lang'));
|
||
}
|
||
|
||
/**
|
freenetis/branches/1.1/application/models/login_log.php | ||
---|---|---|
* @return Mysql_Result
|
||
*/
|
||
public function get_all_login_logs($sql_offset = 0, $limit_results = 500,
|
||
$order_by = 'last_time', $order_by_direction = 'ASC', $filter_sql = '')
|
||
$order_by = 'last_time', $order_by_direction = 'DESC', $filter_sql = '')
|
||
{
|
||
$where = '';
|
||
|
||
... | ... | |
$order_by = 'last_time';
|
||
}
|
||
|
||
if ($order_by == 'last_time')
|
||
{
|
||
$order_by = "IF(last_time IS NULL, 0, 1) $order_by_direction, last_time";
|
||
}
|
||
|
||
return $this->db->query("
|
||
SELECT id, name, IFNULL(last_time,?) as last_time
|
||
FROM (
|
freenetis/branches/1.1/application/controllers/enum_types.php | ||
---|---|---|
// check if logged user have access right to edit this enum types
|
||
if ($this->acl_check_edit('Settings_Controller', 'enum_types'))
|
||
{
|
||
$actions->add_action()
|
||
$actions->add_conditional_action()
|
||
->condition('is_not_readonly')
|
||
->icon_action('edit')
|
||
->url('enum_types/edit');
|
||
}
|
||
... | ... | |
// check if logged user have access right to delete this enum_types
|
||
if ($this->acl_check_delete('Settings_Controller', 'enum_types'))
|
||
{
|
||
$actions->add_action()
|
||
$actions->add_conditional_action()
|
||
->condition('is_not_readonly')
|
||
->icon_action('delete')
|
||
->url('enum_types/delete')
|
||
->class('delete_link');
|
||
... | ... | |
|
||
$enum_type = new Enum_type_Model($enum_type_id);
|
||
|
||
if (!$enum_type->id)
|
||
if (!$enum_type->id || $enum_type->read_only)
|
||
url::redirect('enum_types/show_all');
|
||
|
||
$arr_type_names = ORM::factory('enum_type_name')->select_list('id', 'type_name');
|
||
... | ... | |
|
||
$enum_type = new Enum_type_Model($enum_type_id);
|
||
|
||
if (!$enum_type->id)
|
||
if (!$enum_type->id || $enum_type->read_only)
|
||
url::redirect('enum_types/show_all');
|
||
|
||
// success
|
freenetis/branches/1.1/application/controllers/login_logs.php | ||
---|---|---|
* @author Michal Kliment
|
||
*/
|
||
public function show_all($limit_results = 50, $order_by = 'last_time',
|
||
$order_by_direction = 'ASC', $page_word = null, $page = 1)
|
||
$order_by_direction = 'DESC', $page_word = null, $page = 1)
|
||
{
|
||
// access
|
||
if (!$this->acl_check_view('Login_logs_Controller', 'logs'))
|
Také k dispozici: Unified diff
Upravy:
- vylepseni enumeraci (zobrazeni vsech id readonly, kontrola read only pri mazani)
- razeni logu prihlaseni