Revize 1279
Přidáno uživatelem Ondřej Fibich před asi 13 roky(ů)
freenetis/branches/testing/application/controllers/work_reports.php | ||
---|---|---|
$page_word = null, $page = 1)
|
||
{
|
||
// acccess control
|
||
if (!$this->acl_check_view('Users_Controller','work'))
|
||
if (!$this->acl_check_view('Users_Controller', 'work'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
... | ... | |
'limit_results' => $limit_results
|
||
));
|
||
|
||
if ($this->acl_check_new('Users_Controller','work'))
|
||
if ($this->acl_check_new('Users_Controller', 'work'))
|
||
{
|
||
$grid->add_new_button('work_reports/add', __('Add new work report'));
|
||
}
|
||
... | ... | |
$page_word = null, $page = 1)
|
||
{
|
||
// acccess control
|
||
if (!$this->acl_check_view('Users_Controller','work'))
|
||
if (!$this->acl_check_view('Users_Controller', 'work'))
|
||
Controller::error(ACCESS);
|
||
|
||
// gets new selector
|
||
... | ... | |
$page_word = null, $page = 1)
|
||
{
|
||
// acccess control
|
||
if (!$this->acl_check_view('Users_Controller','work'))
|
||
if (!$this->acl_check_view('Users_Controller', 'work'))
|
||
Controller::error(ACCESS);
|
||
|
||
// gets new selector
|
||
... | ... | |
'total_items' => count($concepts)
|
||
));
|
||
|
||
if ($this->acl_check_new('Users_Controller', 'work'))
|
||
if ($this->acl_check_new('Users_Controller', 'work', $user->member_id))
|
||
{
|
||
$grid_concepts->add_new_button(
|
||
'work_reports/add/' . $user->id,
|
||
... | ... | |
|
||
$actions = $grid_pending->grouped_action_field();
|
||
|
||
if ($this->acl_check_view('Users_Controller', 'work'))
|
||
if ($this->acl_check_view('Users_Controller', 'work', $user->member_id))
|
||
{
|
||
$actions->add_action()
|
||
->icon_action('show')
|
||
... | ... | |
|
||
$actions = $grid_approved->grouped_action_field();
|
||
|
||
if ($this->acl_check_view('Users_Controller', 'work'))
|
||
if ($this->acl_check_view('Users_Controller', 'work', $user->member_id))
|
||
{
|
||
$actions->add_action()
|
||
->icon_action('show')
|
||
... | ... | |
|
||
$actions = $grid_rejected->grouped_action_field();
|
||
|
||
if ($this->acl_check_view('Users_Controller', 'work'))
|
||
if ($this->acl_check_view('Users_Controller', 'work', $user->member_id))
|
||
{
|
||
$actions->add_action()
|
||
->icon_action('show')
|
||
... | ... | |
Controller::error(RECORD);
|
||
}
|
||
|
||
$member_id = $work_report_model->user->member_id;
|
||
|
||
// concept can be viewed only by owner
|
||
if (!$this->acl_check_view('Users_Controller', 'work') || (
|
||
if (!$this->acl_check_view('Users_Controller', 'work', $member_id) || (
|
||
$work_report->concept &&
|
||
$this->user_id != $work_report_model->user_id &&
|
||
$this->user_id != $work_report_model->added_by_id
|
||
... | ... | |
}
|
||
|
||
// access control
|
||
if ($this->acl_check_view('Users_Controller', 'work'))
|
||
if ($this->acl_check_view('Users_Controller', 'work', $member_id))
|
||
{
|
||
$works_grid->grouped_action_field()
|
||
->add_action()
|
||
... | ... | |
case 0:
|
||
case 1:
|
||
$state_text = __('Pending');
|
||
$breadcrumbs->link('work_reports/pending', 'Pending');
|
||
$breadcrumbs->link('work_reports/pending', 'Pending',
|
||
$this->acl_check_view('Users_Controller', 'work'));
|
||
break;
|
||
|
||
case 2:
|
||
$state_text = '<span style="color: red;">'.__('Rejected').'</span>';
|
||
$breadcrumbs->link('work_reports/rejected', 'Rejected');
|
||
$breadcrumbs->link(
|
||
'work_reports/rejected', 'Rejected',
|
||
$this->acl_check_view('Users_Controller', 'work')
|
||
);
|
||
break;
|
||
|
||
case 3:
|
||
... | ... | |
}
|
||
|
||
$state_text .= '</span>';
|
||
$breadcrumbs->link('work_reports/approved', 'Approved');
|
||
$breadcrumbs->link(
|
||
'work_reports/approved', 'Approved',
|
||
$this->acl_check_view('Users_Controller', 'work')
|
||
);
|
||
break;
|
||
}
|
||
|
||
... | ... | |
|
||
$linkback = Path::instance()->previous()->current();
|
||
|
||
if (url::slice(url_lang::uri($linkback), 0, 2) == 'work_reports/show_by_user')
|
||
if (url::slice(url_lang::uri($linkback), 0, 2) == 'work_reports/show_by_user' ||
|
||
!$this->acl_check_view('Users_Controller', 'work'))
|
||
{
|
||
url::redirect( 'work_reports/show_by_user/' . $work_report->user_id);
|
||
}
|
Také k dispozici: Unified diff
Opravy:
- oprava prav u pracovnich vykazu