Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1910

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

Opravy:
- fixes #442: Nezobrazeni polozek gridu pri prvnim nacteni

Zobrazit rozdíly:

freenetis/branches/1.1/application/i18n/cs_CZ/texts.php
'here' => 'zde',
'hide' => 'Skrýt',
'hide form items' => 'Skrýt položky formuláře',
'hide grid on its first load' => 'Skrývat grid při jeho první načtení',
'hide this table' => 'Schovat tuto tabulku',
'high priority ip addresses' => 'IP adresy s vysokou prioritou',
'hide whole descriptions' => 'Skrýt celé popisky',
freenetis/branches/1.1/application/i18n/cs_CZ/help.php
'fio_password' => 'Heslo pro daného uživatele do internetového bankovnictví. Zvažte bezpečnostní riziko spojené s ukládáním hesla od internetového bankovnictví na server s Freenetisem.',
'fio_view_name' => 'Název pohledu, je potřeba si vytvořit vlastní pohled (filtr) v internetovém bankovnictví, ve kterém budou zobrazeny všechny dostupné sloupce (celkem 18).',
'gateway' => 'Určuje, zda-li je tato IP adresa bránou ve své podsíti. Typicky má toto nastavena každá IP adresa končící na jedničku v síti s prefixem 24.',
'grid_hide_on_first_load' => 'Určuje, jestli skrývat grid a jeho položky při jeho první načtení. Účelem je optimalizace spotřeby paměti.',
'gps_coordinates' => 'GPS souřadnice může být ve tvaru desetinného čísla, nebo: hodiny°minuty\'sekundy&quot.',
'ignore_whitelist' => 'Umožňuje této zprávě, je-li aktivována, ignorovat bílou listinu. Určeno pro velmi speciální případy, například pokud je připojen městský úřad, který je na trvalé bílé listině, aby nebyl obtěžován a i přesto chceme jeho počítače přesměrovat nebo upozornit kvůli informaci o výpadku.',
'initial_immunity' => 'Počet dní, po které nemá být nový člen upozorňován na placení. Výchozí hodnota je 14 dní.',
freenetis/branches/1.1/application/i18n/en_US/help.php
'entrance_fee_instalment' => 'Instalment initial contribution is for the case when a member wants to repay the initial contribution gradually. Here he set amount each month will be deducted from his credit account. If you do not use the installment, let the installment amount equal to the amount of initial contribution.',
'gateway' => 'Determines whether an IP address in your subnet gateway. Typically this is set each IP address ending in the number one network prefix 24th',
'gps_coordinates' => 'GPS can be in shape of real number, or: hours°minutes\'seconds&quot.',
'grid_hide_on_first_load' => 'It determines whether hide grid and its items on its first load. It is used as optimalization of memory usage.',
'ignore_whitelist' => 'Allows this report, when activated, to ignore the white list. Designed for very special cases, such as when connected to the municipality, which is on permanent white list not to be harassed and even though we want to redirect his computer for information about the outage.',
'log_queues_info' => 'Errors has been reported (in system or in some network elements), please %s and perform the necessary actions to correct them.',
'login_name' => 'Login name is necessary for login to system. Login name can contains letters from english alphabet, numbers and dot. It has to contains at least 5 letters.',
freenetis/branches/1.1/application/helpers/form.php
if (empty($action) OR ! is_string($action))
{
// Use the current URL as the default action
$action = url::site(Router::$current_uri);
$action = url::base().url::current(TRUE);
}
elseif (strpos($action, '://') === FALSE)
{
freenetis/branches/1.1/application/controllers/users.php
$order_by_direction = 'asc';
$model_users = new User_Model();
$total_users = $model_users->count_all_users($filter_form->as_sql());
// hide grid on its first load (#442)
$hide_grid = Settings::get('grid_hide_on_first_load') && $filter_form->is_first_load();
if (!$hide_grid)
{
try
{
$total_users = $model_users->count_all_users($filter_form->as_sql());
if (($sql_offset = ($page - 1) * $limit_results) > $total_users)
$sql_offset = 0;
if (($sql_offset = ($page - 1) * $limit_results) > $total_users)
$sql_offset = 0;
$query = $model_users->get_all_users(
$sql_offset, (int)$limit_results, $order_by,
$order_by_direction, $filter_form->as_sql()
);
$query = $model_users->get_all_users(
$sql_offset, (int)$limit_results, $order_by,
$order_by_direction, $filter_form->as_sql()
);
}
catch (Exception $e)
{
if ($filter_form->is_loaded_from_saved_query())
{
status::error('Invalid saved query');
// disable default query (loop protection)
if ($filter_form->is_loaded_from_default_saved_query())
{
ORM::factory('filter_query')->remove_default($filter_form->get_base_url());
}
$this->redirect(url_lang::current());
}
throw $e;
}
}
$grid = new Grid('users', __('List of all users'), array
(
......
'base_url' => Config::get('lang').'/users/show_all/'
. $limit_results.'/'.$order_by.'/'.$order_by_direction ,
'uri_segment' => 'page',
'total_items' => $total_users,
'total_items' => isset($total_users) ? $total_users : 0,
'items_per_page' => $limit_results,
'style' => 'classic',
'order_by' => $order_by,
......
'filter' => $filter_form
));
// export vCard
$grid->add_new_button(
'vcard/export' . server::query_string(),
'Export vCard', array
(
'title' => __('Export vCard'),
'class' => 'popup_link'
)
);
if (!$hide_grid)
{
// export vCard
$grid->add_new_button(
'vcard/export' . server::query_string(),
'Export vCard', array
(
'title' => __('Export vCard'),
'class' => 'popup_link'
)
);
}
$grid->order_field('id')
->label('ID');
......
->label('Show works');
}
$grid->datasource($query);
if (!$hide_grid)
$grid->datasource($query);
$view = new View('main');
$view->breadcrumbs = __('Users');
freenetis/branches/1.1/application/controllers/email_queues.php
$email_queue_model = new Email_queue_Model();
// counts all sent e-mail
$total_emails = $email_queue_model->count_all_sent_emails($filter_form->as_sql());
// hide grid on its first load (#442)
$hide_grid = Settings::get('grid_hide_on_first_load') && $filter_form->is_first_load();
// limit check
if (($sql_offset = ($page - 1) * $limit_results) > $total_emails)
$sql_offset = 0;
$emails = $email_queue_model->get_all_sent_emails(
$sql_offset, (int)$limit_results, $order_by, $order_by_direction,
$filter_form->as_sql()
);
if (!$hide_grid)
{
try
{
// counts all sent e-mail
$total_emails = $email_queue_model->count_all_sent_emails($filter_form->as_sql());
// limit check
if (($sql_offset = ($page - 1) * $limit_results) > $total_emails)
$sql_offset = 0;
$emails = $email_queue_model->get_all_sent_emails(
$sql_offset, (int)$limit_results, $order_by, $order_by_direction,
$filter_form->as_sql()
);
}
catch (Exception $e)
{
if ($filter_form->is_loaded_from_saved_query())
{
status::error('Invalid saved query');
// disable default query (loop protection)
if ($filter_form->is_loaded_from_default_saved_query())
{
ORM::factory('filter_query')->remove_default($filter_form->get_base_url());
}
$this->redirect(url_lang::current());
}
throw $e;
}
}
// headline
$headline = __('List of all sent e-mails');
......
'selector_max_multiplier' => 20,
'base_url' => $path,
'uri_segment' => 'page',
'total_items' => $total_emails,
'total_items' => isset($total_emails) ? $total_emails : 0,
'items_per_page' => $limit_results,
'style' => 'classic',
'order_by' => $order_by,
......
'email_queues/show_all_unsent', __('Show all unsent e-mails')
);
if ($this->acl_check_delete('Settings_Controller', 'system'))
if (!$hide_grid && $this->acl_check_delete('Settings_Controller', 'system'))
{
$grid->add_new_button(
'email_queues/delete_sent' . server::query_string(),
......
->label('Send again')
->url('email_queues/send');
// load data
$grid->datasource($emails);
if (!$hide_grid)
{
// load data
$grid->datasource($emails);
}
$view = new View('main');
$view->breadcrumbs = __('Sent e-mails');
freenetis/branches/1.1/application/controllers/members.php
// load members
$model_members = new Member_Model();
try
// hide grid on its first load (#442)
$hide_grid = Settings::get('grid_hide_on_first_load') && $filter_form->is_first_load();
if (!$hide_grid)
{
$total_members = $model_members->count_all_members($filter_form->as_sql());
try
{
$total_members = $model_members->count_all_members($filter_form->as_sql());
// limit check
if (($sql_offset = ($page - 1) * $limit_results) > $total_members)
$sql_offset = 0;
// limit check
if (($sql_offset = ($page - 1) * $limit_results) > $total_members)
$sql_offset = 0;
// query data
$query = $model_members->get_all_members(
$sql_offset, $limit_results, $order_by, $order_by_direction,
$filter_form->as_sql()
);
}
catch (Exception $e)
{
if ($filter_form->is_loaded_from_saved_query())
// query data
$query = $model_members->get_all_members(
$sql_offset, $limit_results, $order_by, $order_by_direction,
$filter_form->as_sql()
);
}
catch (Exception $e)
{
status::error('Invalid saved query');
// disable default query (loop protection)
if ($filter_form->is_loaded_from_default_saved_query())
if ($filter_form->is_loaded_from_saved_query())
{
ORM::factory('filter_query')->remove_default($filter_form->get_base_url());
status::error('Invalid saved query');
// disable default query (loop protection)
if ($filter_form->is_loaded_from_default_saved_query())
{
ORM::factory('filter_query')->remove_default($filter_form->get_base_url());
}
$this->redirect(url_lang::current());
}
$this->redirect(url_lang::current());
throw $e;
}
throw $e;
}
// headline
$headline = __('List of all members');
// path to form
$path = Config::get('lang') . '/members/show_all/' . $limit_results . '/'
. $order_by . '/' . $order_by_direction.'/'.$page_word.'/'
......
'selector_max_multiplier' => 25,
'base_url' => $path,
'uri_segment' => 'page',
'total_items' => $total_members,
'total_items' => isset($total_members) ? $total_members : 0,
'items_per_page' => $limit_results,
'style' => 'classic',
'order_by' => $order_by,
......
));
}
if ($this->acl_check_edit('Members_Controller', 'registration'))
if (!$hide_grid && $this->acl_check_edit('Members_Controller', 'registration'))
{
if (!$regs)
{
......
}
}
if ($this->acl_check_view(get_class($this), 'members'))
if (!$hide_grid && $this->acl_check_view(get_class($this), 'members'))
{
// csv export of members
$grid->add_new_button(
......
->url('transfers/show_by_account')
->label('Show transfers');
}
if (!$hide_grid)
{
// load data
$grid->datasource($query);
}
// load data
$grid->datasource($query);
if (isset($_POST) && count ($_POST))
{
$ids = $_POST["ids"];
$regs = $_POST["registrations"];
ORM::factory('member')->update_member_registrations($ids, $regs);
status::success('Registrations has been successfully updated.');
url::redirect($_POST['url']);
}
$headline = __('List of all members');
// view
$view = new View('main');
freenetis/branches/1.1/application/controllers/settings.php
$this->form->input('currency')
->rules('length[3,40]|required')
->value(Settings::get('currency'));
$this->form->radio('grid_hide_on_first_load')
->label('Hide grid on its first load')
->options(arr::bool())
->default(Settings::get('grid_hide_on_first_load'))
->help('grid_hide_on_first_load');
$this->form->group(__('Modules').' '.help::hint('modules'));;
$this->form->group(__('Modules').' '.help::hint('modules'));;
// self-registration
$this->form->radio('self_registration')
freenetis/branches/1.1/application/controllers/work_reports.php
$work_report_model = new Job_report_Model();
$total_work_reports = $work_report_model->count_all_work_reports(
$filter_form->as_sql()
);
// hide grid on its first load (#442)
$hide_grid = Settings::get('grid_hide_on_first_load') && $filter_form->is_first_load();
if (!$hide_grid)
{
try
{
$total_work_reports = $work_report_model->count_all_work_reports(
$filter_form->as_sql()
);
if (($sql_offset = ($page - 1) * $limit_results) > $total_work_reports)
$sql_offset = 0;
if (($sql_offset = ($page - 1) * $limit_results) > $total_work_reports)
$sql_offset = 0;
$work_reports = $work_report_model->get_all_work_reports(
$sql_offset, (int)$limit_results, $order_by, $order_by_direction,
$filter_form->as_sql()
);
$work_reports = $work_report_model->get_all_work_reports(
$sql_offset, (int)$limit_results, $order_by, $order_by_direction,
$filter_form->as_sql()
);
}
catch (Exception $e)
{
if ($filter_form->is_loaded_from_saved_query())
{
status::error('Invalid saved query');
// disable default query (loop protection)
if ($filter_form->is_loaded_from_default_saved_query())
{
ORM::factory('filter_query')->remove_default($filter_form->get_base_url());
}
$this->redirect(url_lang::current());
}
throw $e;
}
}
// create grid
$grid = new Grid('work_reports/show_all', null, array
......
'base_url' => Config::get('lang').'/work_reports/pending/'
. $limit_results.'/'.$order_by.'/'.$order_by_direction,
'uri_segment' => 'page',
'total_items' => $total_work_reports,
'total_items' => isset($total_work_reports) ? $total_work_reports : 0,
'items_per_page' => $limit_results,
'style' => 'classic',
'filter' => $filter_form,
......
->class('delete_link');
}
$grid->datasource($work_reports);
if (!$hide_grid)
$grid->datasource($work_reports);
$title = __('Work reports');
freenetis/branches/1.1/application/controllers/works.php
->type('number');
$work_model = new Job_Model();
$total_works = $work_model->count_all_works($filter_form->as_sql());
// hide grid on its first load (#442)
$hide_grid = Settings::get('grid_hide_on_first_load') && $filter_form->is_first_load();
if (!$hide_grid)
{
try
{
$total_works = $work_model->count_all_works($filter_form->as_sql());
if (($sql_offset = ($page - 1) * $limit_results) > $total_works)
$sql_offset = 0;
if (($sql_offset = ($page - 1) * $limit_results) > $total_works)
$sql_offset = 0;
$works = $work_model->get_all_works(
$sql_offset, (int)$limit_results, $order_by,
$order_by_direction, $filter_form->as_sql()
);
$works = $work_model->get_all_works(
$sql_offset, (int)$limit_results, $order_by,
$order_by_direction, $filter_form->as_sql()
);
}
catch (Exception $e)
{
if ($filter_form->is_loaded_from_saved_query())
{
status::error('Invalid saved query');
// disable default query (loop protection)
if ($filter_form->is_loaded_from_default_saved_query())
{
ORM::factory('filter_query')->remove_default($filter_form->get_base_url());
}
$this->redirect(url_lang::current());
}
throw $e;
}
$vote_model = new Vote_Model();
$vote_model = new Vote_Model();
$items_to_vote = $vote_model->get_all_items_user_can_vote(
$this->user_id, Vote_Model::WORK
);
$works_to_vote = array();
if (array_key_exists(Vote_Model::WORK, $items_to_vote))
$works_to_vote = $items_to_vote[Vote_Model::WORK];
$items_to_vote = $vote_model->get_all_items_user_can_vote(
$this->user_id, Vote_Model::WORK
);
$works_to_vote = array();
if (array_key_exists(Vote_Model::WORK, $items_to_vote))
$works_to_vote = $items_to_vote[Vote_Model::WORK];
}
// create grid
$grid = new Grid('works/show_all', NULL, array
(
......
'base_url' => Config::get('lang').'/works/show_all/'
. $limit_results.'/'.$order_by.'/'.$order_by_direction ,
'uri_segment' => 'page',
'total_items' => $total_works,
'total_items' => isset($total_works) ? $total_works : 0,
'items_per_page' => $limit_results,
'style' => 'classic',
'order_by' => $order_by,
......
->class('center');
// user can vote -> show columns for form items
if (count($works_to_vote))
if (!$hide_grid && count($works_to_vote))
{
$grid->order_form_field('vote')
->label(__('Vote'))
......
->url('works/delete')
->class('delete_link');
}
if (!$hide_grid)
$grid->datasource($works);
$grid->datasource($works);
// form is submited
if (isset ($_POST) && count ($_POST))
{
freenetis/branches/1.1/application/controllers/requests.php
$request_model = new Request_Model();
$total_requests = $request_model->count_all_requests(
$filter_form->as_sql()
);
// hide grid on its first load (#442)
$hide_grid = Settings::get('grid_hide_on_first_load') && $filter_form->is_first_load();
if (($sql_offset = ($page - 1) * $limit_results) > $total_requests)
$sql_offset = 0;
$requests = $request_model->get_all_requests(
$sql_offset, (int) $limit_results, $order_by, $order_by_direction,
$filter_form->as_sql()
);
$vote_model = new Vote_Model();
if (!$hide_grid)
{
try
{
$total_requests = $request_model->count_all_requests(
$filter_form->as_sql()
);
$items_to_vote = $vote_model->get_all_items_user_can_vote(
$this->user_id
);
if (($sql_offset = ($page - 1) * $limit_results) > $total_requests)
$sql_offset = 0;
$requests = $request_model->get_all_requests(
$sql_offset, (int) $limit_results, $order_by, $order_by_direction,
$filter_form->as_sql()
);
}
catch (Exception $e)
{
if ($filter_form->is_loaded_from_saved_query())
{
status::error('Invalid saved query');
// disable default query (loop protection)
if ($filter_form->is_loaded_from_default_saved_query())
{
ORM::factory('filter_query')->remove_default($filter_form->get_base_url());
}
$this->redirect(url_lang::current());
}
throw $e;
}
$vote_model = new Vote_Model();
$items_to_vote = $vote_model->get_all_items_user_can_vote(
$this->user_id
);
$request_to_vote = array();
if (array_key_exists(Vote_Model::REQUEST, $items_to_vote))
$request_to_vote = $items_to_vote[Vote_Model::REQUEST];
}
$request_to_vote = array();
if (array_key_exists(Vote_Model::REQUEST, $items_to_vote))
$request_to_vote = $items_to_vote[Vote_Model::REQUEST];
// create grid
$grid = new Grid('requests/show_all', NULL, array
(
......
'base_url' => Config::get('lang').'/requests/show_all/'
. $limit_results.'/'.$order_by.'/'.$order_by_direction ,
'uri_segment' => 'page',
'total_items' => $total_requests,
'total_items' => isset($total_requests) ? $total_requests : 0,
'items_per_page' => $limit_results,
'style' => 'classic',
'order_by' => $order_by,
......
->class('center');
// user can vote -> show columns for form items
if (count($request_to_vote))
if (!$hide_grid && count($request_to_vote))
{
$grid->order_form_field('vote')
->label(__('Vote'))
......
->class('delete_link');
}
$grid->datasource($requests);
if (!$hide_grid)
$grid->datasource($requests);
// form is submited
if (isset ($_POST) && count ($_POST))
freenetis/branches/1.1/application/libraries/Filter_form.php
'select_number' => 'key',
'network_address' => 'value'
);
/**
* Boolean value whether it is first load of filters (#442)
* @var boolean
*/
protected $first_load = FALSE;
/**
* Constructor, sets table name and compiles values from $_GET
......
$tables = $data["tables"];
$this->loaded_from_saved_query = TRUE;
$this->first_load = FALSE;
}
// load query from URL
else
......
$this->can_add = TRUE;
$this->loaded_from_saved_query = FALSE;
$this->first_load = FALSE;
}
$this->keys = Input::instance()->get('keys');
......
$this->can_add = FALSE;
$this->loaded_from_saved_query = TRUE;
$this->loaded_from_default_saved_query = TRUE;
$this->first_load = TRUE;
}
// load data
......
}
}
else
{
$this->can_add = FALSE;
$this->first_load = TRUE;
}
}
/**
......
}
/**
* Indicates whether it is first load
*
* @return boolean
*/
public function is_first_load()
{
return $this->first_load;
}
/**
* Returns base URL of the filter form.
*
* @return string URL
freenetis/branches/1.1/application/libraries/Settings.php
// structures (another IS). I (Ondrej Fibich) made this due to
// import of passwords from old IS of PVFREE association (2013-02-15)
'pasword_check_for_md5' => FALSE,
// whether hide grid on its first load (for optimalization) (#442)
'grid_hide_on_first_load' => FALSE,
);
/**
freenetis/branches/1.1/application/views/grid_template.php
<?php echo ($filter) ? $filter.'<br />' : '' ?>
<?php echo empty($buttons) ? '' : implode(' | ', $buttons).'<br /><br />' ?>
<?php if(isset($items)): ?>
<?php if ($form)
{
echo form::open(NULL, array('class' => 'grid_form'));
......
<?php echo $paginator; ?>
<?php echo $selector; ?>
<?php endif ?>
</div>

Také k dispozici: Unified diff