Revize 1882
Přidáno uživatelem Michal Kliment před více než 11 roky(ů)
freenetis/branches/1.1/application/controllers/users.php | ||
---|---|---|
->url('devices/show_by_user')
|
||
->label('Show devices');
|
||
}
|
||
if ($this->acl_check_view('Users_Controller', 'work'))
|
||
if (Settings::get('works_enabled') && $this->acl_check_view('Users_Controller', 'work'))
|
||
{
|
||
$actions->add_action('id')
|
||
->icon_action('work')
|
freenetis/branches/1.1/application/controllers/votes.php | ||
---|---|---|
*/
|
||
public function add_to_work($work_id = NULL)
|
||
{
|
||
// works are not enabled
|
||
if (!Settings::get('works_enabled'))
|
||
Controller::error (ACCESS);
|
||
|
||
// is parameter set?
|
||
if (!$work_id || !is_numeric($work_id))
|
||
Controller::warning(PARAMETER);
|
||
... | ... | |
{
|
||
// vote about work
|
||
case Vote_Model::WORK:
|
||
|
||
// works are not enabled
|
||
if (!Settings::get('works_enabled'))
|
||
Controller::error (ACCESS);
|
||
|
||
$work = new Job_Model($vote->fk_id);
|
||
|
||
... | ... | |
{
|
||
case Vote_Model::WORK:
|
||
|
||
// works are not enabled
|
||
if (!Settings::get('works_enabled'))
|
||
Controller::error (ACCESS);
|
||
|
||
$work = new Job_Model($vote->fk_id);
|
||
|
||
$approval_template_item = new Approval_template_item_Model();
|
freenetis/branches/1.1/application/controllers/members.php | ||
---|---|---|
->label('Show devices');
|
||
}
|
||
|
||
if ($this->acl_check_edit('Users_Controller', 'work', $member_id))
|
||
if (Settings::get('works_enabled') && $this->acl_check_edit('Users_Controller', 'work', $member_id))
|
||
{
|
||
$actions->add_action('id')
|
||
->icon_action('work')
|
||
... | ... | |
}
|
||
|
||
// user's works link
|
||
if ($member->id != 1 &&
|
||
if (Settings::get('works_enabled') && $member->id != 1 &&
|
||
$this->acl_check_view('Users_Controller', 'work', $member->id))
|
||
{
|
||
$user_links[] = html::anchor(
|
||
... | ... | |
}
|
||
|
||
// user's work reports link
|
||
if ($member->id != 1 &&
|
||
if (Settings::get('works_enabled') && $member->id != 1 &&
|
||
$this->acl_check_view('Users_Controller', 'work', $member->id))
|
||
{
|
||
$user_links[] = html::anchor(
|
freenetis/branches/1.1/application/controllers/settings.php | ||
---|---|---|
->label('Monitoring')
|
||
->options(arr::bool())
|
||
->default(Settings::get('monitoring_enabled'));
|
||
|
||
// Works
|
||
$this->form->radio('works_enabled')
|
||
->label('Works')
|
||
->options(arr::bool())
|
||
->default(Settings::get('works_enabled'));
|
||
|
||
$this->form->group('E-mail settings');
|
||
|
||
... | ... | |
|
||
// creating of new forge
|
||
$this->form = new Forge('settings/approval');
|
||
|
||
if (Settings::get('works_enabled'))
|
||
{
|
||
$this->form->group('Work');
|
||
|
||
$this->form->dropdown('default_work_approval_template')
|
||
->label('Default approval template')
|
||
->options($arr_approval_templates)
|
||
->selected(Settings::get('default_work_approval_template'))
|
||
->rules('required');
|
||
|
||
$this->form->group('Work');
|
||
$this->form->group('Work report');
|
||
|
||
$this->form->dropdown('default_work_approval_template')
|
||
->label('Default approval template')
|
||
->options($arr_approval_templates)
|
||
->selected(Settings::get('default_work_approval_template'))
|
||
->rules('required');
|
||
$this->form->dropdown('default_work_report_approval_template')
|
||
->label('Default approval template')
|
||
->options($arr_approval_templates)
|
||
->selected(Settings::get('default_work_report_approval_template'))
|
||
->rules('required');
|
||
}
|
||
|
||
$this->form->group('Work report');
|
||
|
||
$this->form->dropdown('default_work_report_approval_template')
|
||
->label('Default approval template')
|
||
->options($arr_approval_templates)
|
||
->selected(Settings::get('default_work_report_approval_template'))
|
||
->rules('required');
|
||
|
||
$this->form->group('Request');
|
||
|
||
$this->form->dropdown('default_request_approval_template')
|
freenetis/branches/1.1/application/controllers/work_reports.php | ||
---|---|---|
class Work_reports_Controller extends Controller
|
||
{
|
||
/**
|
||
* Only checks whether works are enabled
|
||
*
|
||
* @author Michal Kliment
|
||
*/
|
||
public function __construct()
|
||
{
|
||
parent::__construct();
|
||
|
||
// works are not enabled
|
||
if (!Settings::get('works_enabled'))
|
||
Controller::error (ACCESS);
|
||
}
|
||
|
||
/**
|
||
* Redirects to pending
|
||
*/
|
||
public function index()
|
freenetis/branches/1.1/application/controllers/works.php | ||
---|---|---|
* @package Controller
|
||
*/
|
||
class Works_Controller extends Controller
|
||
{
|
||
{
|
||
/**
|
||
* Only checks whether works are enabled
|
||
*
|
||
* @author Michal Kliment
|
||
*/
|
||
public function __construct()
|
||
{
|
||
parent::__construct();
|
||
|
||
// works are not enabled
|
||
if (!Settings::get('works_enabled'))
|
||
Controller::error (ACCESS);
|
||
}
|
||
|
||
/**
|
||
* Index redirects to work pending
|
||
*/
|
||
public function index()
|
freenetis/branches/1.1/application/controllers/comments.php | ||
---|---|---|
* @param integer $comments_thread_id
|
||
*/
|
||
public function add($comments_thread_id = NULL)
|
||
{
|
||
{
|
||
// bad parameter
|
||
if (!$comments_thread_id || !is_numeric($comments_thread_id))
|
||
Controller::warning(PARAMETER);
|
||
... | ... | |
|
||
case 'job':
|
||
// access control
|
||
if (!$this->acl_check_new(get_class($this), 'works', $parent->user->member_id))
|
||
if (!Settings::get('works_enabled') ||
|
||
!$this->acl_check_new(get_class($this), 'works', $parent->user->member_id))
|
||
Controller::error(ACCESS);
|
||
|
||
if (url::slice(url_lang::uri(Path::instance()->previous()), 1, 1) == 'show_work')
|
||
... | ... | |
|
||
case 'job':
|
||
// access control
|
||
if (!$this->acl_check_edit(get_class($this), 'works', $comment->user->member_id))
|
||
if (!Settings::get('works_enabled') ||
|
||
!$this->acl_check_edit(get_class($this), 'works', $comment->user->member_id))
|
||
Controller::error(ACCESS);
|
||
|
||
if (url::slice(url_lang::uri(Path::instance()->previous()), 1, 1) == 'show_work')
|
||
... | ... | |
|
||
case 'job':
|
||
// access control
|
||
if (!$this->acl_check_delete(get_class($this), 'works', $comment->user->member_id))
|
||
if (!Settings::get('works_enabled') ||
|
||
!$this->acl_check_delete(get_class($this), 'works', $comment->user->member_id))
|
||
Controller::error(ACCESS);
|
||
|
||
$link_back_url = $this->redirect(Path::instance()->previous());
|
||
$link_back_url = Path::instance()->previous();
|
||
|
||
break;
|
||
|
freenetis/branches/1.1/application/libraries/Menu_builder.php | ||
---|---|---|
<?php defined('SYSPATH') or die('No direct script access.');
|
||
/*
|
||
* This file is part of open source system FreenetIS
|
||
* and it is released under GPLv3 licence.
|
||
*
|
||
* More info about licence can be found:
|
||
* http://www.gnu.org/licenses/gpl-3.0.html
|
||
*
|
||
* More info about project can be found:
|
||
* http://www.freenetis.org/
|
||
*
|
||
*/
|
||
|
||
/**
|
||
* This is library for menu building
|
||
*
|
||
* @author Michal Kliment
|
||
* @version 1.0
|
||
*/
|
||
class Menu_builder
|
||
{
|
||
/**
|
||
* Template to show menu
|
||
* @var string
|
||
*/
|
||
protected $template = 'menu';
|
||
|
||
/**
|
||
* Array with menu groups (eg.Networks)
|
||
* @var array
|
||
*/
|
||
protected $groups = array();
|
||
|
||
/**
|
||
* Array with menu items without group
|
||
* @var array
|
||
*/
|
||
protected $items = array();
|
||
|
||
/**
|
||
* Add new group do menu
|
||
*
|
||
* @author Michal Kliment
|
||
* @param string $name
|
||
* @param string $label
|
||
*/
|
||
public function addGroup($name, $label = '')
|
||
{
|
||
$group = new stdClass();
|
||
$group->name = $name;
|
||
$group->label = $label;
|
||
$group->items = array();
|
||
|
||
$this->groups[$name] = $group;
|
||
}
|
||
|
||
/**
|
||
* Adds new item to menu.
|
||
*
|
||
* @author Michal Kliment
|
||
* @param type $url URL of item's link
|
||
* @param type $label Text of item's link
|
||
* @param type $group Group to which item belongs
|
||
* @param array $extra Array with extra arguments
|
||
*/
|
||
public function addItem($url, $label, $group = '', $extra = array())
|
||
{
|
||
$item = new stdClass();
|
||
$item->url = $url;
|
||
$item->label = $label;
|
||
|
||
foreach ($extra as $key => $value)
|
||
$item->$key = $value;
|
||
|
||
// group exists
|
||
if (isset($this->groups[$group]))
|
||
$this->groups[$group]->items[] = $item;
|
||
else
|
||
$this->items[] = $item;
|
||
}
|
||
|
||
/**
|
||
* Render menu
|
||
*
|
||
* @author Michal Kliment
|
||
* @return string
|
||
*/
|
||
public function render()
|
||
{
|
||
$view = new View($this->template);
|
||
|
||
$groups = array();
|
||
|
||
foreach ($this->groups as $group)
|
||
{
|
||
// group is empty, not render
|
||
if (!count($group->items))
|
||
continue;
|
||
|
||
$groups[] = $group;
|
||
}
|
||
|
||
$view->groups = $groups;
|
||
|
||
$view->items = $this->items;
|
||
|
||
return $view->render();
|
||
}
|
||
|
||
/**
|
||
* Call render
|
||
*
|
||
* @author Michal Kliment
|
||
* @return string
|
||
*/
|
||
public function __toString()
|
||
{
|
||
return $this->render();
|
||
}
|
||
}
|
||
|
||
?>
|
freenetis/branches/1.1/application/libraries/MY_Controller.php | ||
---|---|---|
{
|
||
$this->count_inactive_dhcp_servers =
|
||
ORM::factory('device')->count_inactive_dhcp_servers();
|
||
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Build menu
|
||
*
|
||
* @author Michal Kliment
|
||
* @return Menu_builder
|
||
*/
|
||
public function build_menu()
|
||
{
|
||
$menu = new Menu_builder();
|
||
|
||
/*********************** MY PROFILE ***********************/
|
||
|
||
$menu->addGroup('account', __('My profile'));
|
||
|
||
// my profile
|
||
if ($this->session->get('user_type') == User_Model::MAIN_USER &&
|
||
$this->acl_check_view('Members_Controller', 'members', $this->member_id))
|
||
{
|
||
$menu->addItem(
|
||
'members/show/'.$this->member_id,
|
||
__('My profile'), 'account');
|
||
}
|
||
elseif ($this->acl_check_view('Users_Controller', 'users', $this->member_id))
|
||
{
|
||
$menu->addItem(
|
||
'users/show/'.$this->user_id,
|
||
__('My profile'), 'account');
|
||
}
|
||
|
||
// my transfers
|
||
if ($this->member_account_id &&
|
||
($this->acl_check_view('Accounts_Controller', 'transfers', $this->member_id) ||
|
||
$this->acl_check_view('Members_Controller', 'currentcredit')))
|
||
{
|
||
$menu->addItem(
|
||
'transfers/show_by_account/'.$this->member_account_id,
|
||
__('My transfers'), 'account');
|
||
}
|
||
|
||
// my devices
|
||
if ($this->acl_check_view('Devices_Controller', 'devices',$this->member_id))
|
||
{
|
||
$menu->addItem(
|
||
'devices/show_by_user/'.$this->user_id,
|
||
__('My devices'), 'account');
|
||
}
|
||
|
||
// my connection requests
|
||
if ($this->member_id != Member_Model::ASSOCIATION &&
|
||
$this->acl_check_view('Connection_Requests_Controller', 'request', $this->member_id) &&
|
||
Settings::get('connection_request_enable'))
|
||
{
|
||
$menu->addItem(
|
||
'connection_requests/show_by_member/'.$this->member_id,
|
||
__('My connection requests'), 'account');
|
||
}
|
||
|
||
// my works
|
||
if (Settings::get('works_enabled') &&
|
||
$this->member_id != Member_Model::ASSOCIATION &&
|
||
$this->acl_check_view('Users_Controller', 'work', $this->member_id))
|
||
{
|
||
$menu->addItem(
|
||
'works/show_by_user/'.$this->user_id,
|
||
__('My works'), 'account');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// my work reports
|
||
if (Settings::get('works_enabled') &&
|
||
$this->member_id != Member_Model::ASSOCIATION &&
|
||
$this->acl_check_view('Users_Controller', 'work', $this->member_id))
|
||
{
|
||
|
||
$menu->addItem('work_reports/show_by_user/'.$this->user_id,
|
||
__('My work reports'), 'account');
|
||
}
|
||
|
||
// my phone invoices
|
||
if ($this->user_has_phone_invoices)
|
||
{
|
||
$menu->addItem(
|
||
'phone_invoices/show_by_user/'.$this->user_id,
|
||
__('My phone invoices'), 'account',
|
||
array
|
||
(
|
||
'count' => $this->count_unfilled_phone_invoices
|
||
));
|
||
}
|
||
|
||
// my VoIP calls
|
||
if (Settings::get('voip_enabled') && $this->user_has_voip)
|
||
{
|
||
$menu->addItem(
|
||
'voip_calls/show_by_user/'.$this->user_id,
|
||
__('My VoIP calls'), 'account');
|
||
}
|
||
|
||
// my mail
|
||
$menu->addItem('mail/inbox', __('My mail'), 'account',
|
||
array
|
||
(
|
||
'count' => $this->unread_user_mails
|
||
));
|
||
|
||
/*********************** USERS *************************/
|
||
|
||
$menu->addGroup('users', __('Users'));
|
||
|
||
// list of members
|
||
if ($this->acl_check_view('Members_Controller', 'members'))
|
||
{
|
||
$menu->addItem(
|
||
'members/show_all', __('Members'), 'users');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of registered applicants
|
||
if (Settings::get('self_registration') &&
|
||
$this->acl_check_view('Members_Controller', 'members'))
|
||
{
|
||
$menu->addItem(
|
||
'members/applicants', __('Registered applicants'),
|
||
'users', array
|
||
(
|
||
'count' => $this->count_of_registered_members
|
||
));
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of membership interrupts
|
||
if ($this->acl_check_view('Members_Controller', 'members'))
|
||
{
|
||
$menu->addItem(
|
||
'membership_interrupts/show_all', __('Membership interrupts'),
|
||
'users');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of users
|
||
if ($this->acl_check_view('Members_Controller', 'members'))
|
||
{
|
||
$menu->addItem(
|
||
'users/show_all', __('Users'),
|
||
'users');
|
||
}
|
||
|
||
/************************** FINANCES *****************/
|
||
|
||
$menu->addGroup('transfer', __('Finances'));
|
||
|
||
// list of unidentified transfers
|
||
if ($this->acl_check_view('Accounts_Controller', 'unidentified_transfers'))
|
||
{
|
||
$menu->addItem(
|
||
'bank_transfers/unidentified_transfers/',
|
||
__('Unidentified transfers'), 'transfer',
|
||
array
|
||
(
|
||
'count' => $this->count_unidentified_transfers
|
||
));
|
||
}
|
||
|
||
// list of bank accounts
|
||
if ($this->acl_check_view('Accounts_Controller', 'bank_accounts'))
|
||
{
|
||
$menu->addItem(
|
||
'bank_accounts/show_all', __('Bank accounts'),
|
||
'transfer');
|
||
}
|
||
|
||
// list of accounts
|
||
if ($this->acl_check_view('Accounts_Controller', 'accounts'))
|
||
{
|
||
$menu->addItem(
|
||
'accounts/show_all', __('Double-entry accounts'),
|
||
'transfer');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of transfers
|
||
if ($this->acl_check_view('Accounts_Controller', 'accounts'))
|
||
{
|
||
$menu->addItem(
|
||
'transfers/show_all', __('Day book'),'transfer');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
if ($this->acl_check_view('Accounts_Controller', 'accounts'))
|
||
{
|
||
$menu->addItem(
|
||
'invoices/show_all', __('Invoices'), 'transfer');
|
||
}
|
||
|
||
/********************** APPROVAL ***********************/
|
||
|
||
$menu->addGroup('approval', __('Approval'));
|
||
|
||
// list of works
|
||
if (Settings::get('works_enabled') &&
|
||
$this->acl_check_view('Users_Controller', 'work'))
|
||
{
|
||
$menu->addItem(
|
||
'works/pending', __('Works'), 'approval',
|
||
array
|
||
(
|
||
'count' => $this->count_of_unvoted_works_of_voter
|
||
));
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of work reports
|
||
if (Settings::get('works_enabled') &&
|
||
$this->acl_check_view('Users_Controller', 'work'))
|
||
{
|
||
$menu->addItem(
|
||
'work_reports/pending', __('Work reports'),
|
||
'approval', array
|
||
(
|
||
'count' => $this->count_of_unvoted_works_reports_of_voter
|
||
));
|
||
}
|
||
|
||
/*********************** NETWORKS ********************/
|
||
|
||
$menu->addGroup('networks', __('Networks'));
|
||
|
||
// list of connection requests
|
||
if (Settings::get('connection_request_enable') &&
|
||
$this->acl_check_view('Connection_Requests_Controller', 'request'))
|
||
{
|
||
$menu->addItem(
|
||
'connection_requests/show_all',
|
||
__('Connection requests'), 'networks',
|
||
array
|
||
(
|
||
'count' => $this->count_undecided_connection_requests
|
||
));
|
||
}
|
||
|
||
// list of devices
|
||
if ($this->acl_check_view('Devices_Controller', 'devices'))
|
||
{
|
||
$menu->addItem(
|
||
'devices/show_all', __('Devices'),
|
||
'networks');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of ifaces
|
||
if ($this->acl_check_view('Devices_Controller', 'devices'))
|
||
{
|
||
$menu->addItem(
|
||
'ifaces/show_all', __('Interfaces'),
|
||
'networks');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of IP addresses
|
||
if ($this->acl_check_view('Devices_Controller', 'devices'))
|
||
{
|
||
$menu->addItem(
|
||
'ip_addresses/show_all', __('IP addresses'),
|
||
'networks');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of subnets
|
||
if ($this->acl_check_view('Devices_Controller', 'devices'))
|
||
{
|
||
$menu->addItem(
|
||
'subnets/show_all', __('Subnets'), 'networks');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of links
|
||
if ($this->acl_check_view('Devices_Controller', 'devices'))
|
||
{
|
||
$menu->addItem(
|
||
'links/show_all', __('Links'), 'networks');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of VLANs
|
||
if ($this->acl_check_view('Devices_Controller', 'devices'))
|
||
{
|
||
$menu->addItem(
|
||
'vlans/show_all', __('Vlans'), 'networks');
|
||
}
|
||
|
||
// list of VoIP numbers
|
||
if (Settings::get('voip_enabled') &&
|
||
$this->acl_check_view('VoIP_Controller', 'voip'))
|
||
{
|
||
$menu->addItem(
|
||
'voip/show_all', __('VoIP'), 'networks');
|
||
}
|
||
|
||
// list of clouds
|
||
if ($this->acl_check_view('Clouds_Controller', 'clouds'))
|
||
{
|
||
$menu->addItem(
|
||
'clouds/show_all', __('Clouds'), 'networks');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// tools
|
||
if ($this->acl_check_view('Devices_Controller', 'devices'))
|
||
{
|
||
$menu->addItem(
|
||
'tools/ssh', __('Tools'), 'networks');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// traffic
|
||
if (Settings::get('ulogd_enabled') &&
|
||
$this->acl_check_view('Devices_Controller', 'devices'))
|
||
{
|
||
$menu->addItem(
|
||
'traffic/show_all', __('Traffic'), 'networks');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// monitoring
|
||
if (Settings::get('monitoring_enabled') &&
|
||
$this->acl_check_view('Devices_Controller', 'devices'))
|
||
{
|
||
$menu->addItem(
|
||
'monitoring/show_all', __('Monitoring'),
|
||
'networks', array
|
||
(
|
||
'count' => $this->devices_down_count,
|
||
'color' => 'red'
|
||
));
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of DHCP servers
|
||
if ($this->acl_check_view('Devices_Controller', 'devices'))
|
||
{
|
||
$menu->addItem(
|
||
'devices/show_all_dhcp_servers', __('DHCP servers'),
|
||
'networks', array
|
||
(
|
||
'count' => $this->count_inactive_dhcp_servers,
|
||
'color' => 'red'
|
||
));
|
||
}
|
||
|
||
/***************** NOTIFICATIONS *********************/
|
||
|
||
$menu->addGroup('redirection', __('Notifications'));
|
||
|
||
// list of messages
|
||
if ($this->acl_check_view('Messages_Controller', 'message'))
|
||
{
|
||
$menu->addItem(
|
||
'messages/show_all', __('Messages'),
|
||
'redirection');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of whitelists
|
||
if ($this->acl_check_view('Messages_Controller', 'message'))
|
||
{
|
||
$menu->addItem(
|
||
'members_whitelists/show_all', __('Whitelist'),
|
||
'redirection');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of activated redirections
|
||
if ($this->acl_check_view('Messages_Controller', 'message'))
|
||
{
|
||
$menu->addItem(
|
||
'redirect/show_all', __('Activated redirections'),
|
||
'redirection');
|
||
}
|
||
|
||
/**************** ADMINISTRATION *******************/
|
||
|
||
$menu->addGroup('administration', __('Administration'));
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of errors and logs
|
||
if ($this->acl_check_view('Settings_Controller', 'system'))
|
||
{
|
||
$menu->addItem(
|
||
'log_queues/show_all', __('Errors and logs'),
|
||
'administration',
|
||
array
|
||
(
|
||
'count' => $this->count_of_unclosed_logged_errors,
|
||
'color' => 'red'
|
||
));
|
||
}
|
||
|
||
// settings
|
||
if ($this->acl_check_view('Settings_Controller', 'system'))
|
||
{
|
||
$menu->addItem(
|
||
'settings/', __('Settings'),
|
||
'administration');
|
||
}
|
||
|
||
// list of address points
|
||
if ($this->acl_check_view('Address_points_Controller', 'address_point'))
|
||
{
|
||
$menu->addItem(
|
||
'address_points/show_all', __('Address points'),
|
||
'administration');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of SMS messages
|
||
if ($this->acl_check_view('Settings_Controller', 'system'))
|
||
{
|
||
$menu->addItem(
|
||
'sms/show_all', __('SMS messages'),
|
||
'administration');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of e-mails
|
||
if ($this->acl_check_view('Settings_Controller', 'system'))
|
||
{
|
||
$menu->addItem(
|
||
'email_queues/show_all_unsent', __('E-mails'),
|
||
'administration');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of device_templates
|
||
if ($this->acl_check_view('Devices_Controller', 'devices'))
|
||
{
|
||
$menu->addItem(
|
||
'device_templates/show_all', __('Device templates'),
|
||
'administration');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of approval templates
|
||
if ($this->acl_check_view('Settings_Controller', 'system'))
|
||
{
|
||
$menu->addItem(
|
||
'approval_templates/show_all', __('Approval templates'),
|
||
'administration');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// access rights
|
||
if ($this->acl_check_view('Settings_Controller', 'system'))
|
||
{
|
||
$menu->addItem(
|
||
'acl/show_all', __('Access rights'),
|
||
'administration');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of fees
|
||
if ($this->acl_check_view('Settings_Controller', 'system'))
|
||
{
|
||
$menu->addItem(
|
||
'fees/show_all', __('Fees'),
|
||
'administration');
|
||
}
|
||
|
||
// list of login logs
|
||
if ($this->acl_check_view('Login_logs_Controller', 'logs'))
|
||
{
|
||
$menu->addItem(
|
||
'login_logs/show_all', __('Login logs'),
|
||
'administration');
|
||
}
|
||
|
||
// list of action logs
|
||
if (Settings::get('action_logs_active') &&
|
||
$this->acl_check_view('Logs_Controller', 'logs'))
|
||
{
|
||
$menu->addItem(
|
||
'logs/show_all', __('Action logs'),
|
||
'administration');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of stats
|
||
if ($this->acl_check_view('Settings_Controller', 'system'))
|
||
{
|
||
$menu->addItem(
|
||
'stats/members_increase_decrease', __('Stats'),
|
||
'administration');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of translations
|
||
if ($this->acl_check_view('Settings_Controller', 'system'))
|
||
{
|
||
$menu->addItem(
|
||
'translations/show_all', __('Translations'),
|
||
'administration');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of enumerations
|
||
if ($this->acl_check_view('Settings_Controller', 'system'))
|
||
{
|
||
$menu->addItem(
|
||
'enum_types/show_all', __('Enumerations'),
|
||
'administration');
|
||
}
|
||
|
||
// list of phone invoices
|
||
if ($this->acl_check_view('Phone_invoices_Controller', 'invoices'))
|
||
{
|
||
$menu->addItem(
|
||
'phone_invoices/show_all', __('Phone invoices'),
|
||
'administration');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of speed classes
|
||
if ($this->acl_check_view('Settings_Controller', 'system'))
|
||
{
|
||
$menu->addItem(
|
||
'speed_classes/show_all', __('Speed classes'),
|
||
'administration');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of phone operators
|
||
if ($this->acl_check_view('Settings_Controller', 'system'))
|
||
{
|
||
$menu->addItem(
|
||
'phone_operators/show_all', __('Phone operators'),
|
||
'administration');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of filter queries
|
||
if ($this->acl_check_view('Settings_Controller', 'system'))
|
||
{
|
||
$menu->addItem(
|
||
'filter_queries/show_all', __('Filter queries'),
|
||
'administration');
|
||
}
|
||
|
||
return $menu;
|
||
}
|
||
|
||
/**
|
freenetis/branches/1.1/application/views/menu.php | ||
---|---|---|
<ul>
|
||
|
||
<li class="account"><h2><?php echo __('My profile')?></h2>
|
||
<?php foreach ($groups as $group): ?>
|
||
<li class="<?php echo $group->name ?>"><h2><?php echo $group->label ?></h2>
|
||
<ul>
|
||
<li>
|
||
<?php if ($this->session->get('user_type') == User_Model::MAIN_USER && $this->acl_check_view('Members_Controller', 'members', $this->member_id)): ?>
|
||
<?php echo html::anchor('members/show/'.$this->member_id, __('My profile')); ?>
|
||
<?php elseif ($this->acl_check_view('Users_Controller', 'users', $this->member_id)): ?>
|
||
<?php echo html::anchor('users/show/'.$this->user_id, __('My profile')); ?>
|
||
<?php endif ?>
|
||
</li>
|
||
|
||
<?php if ($this->member_account_id && ($this->acl_check_view('Accounts_Controller', 'transfers', $this->member_id) || $this->acl_check_view('Members_Controller', 'currentcredit'))): ?>
|
||
<li><?php echo html::anchor('transfers/show_by_account/'.$this->member_account_id, __('My transfers')) ?></li>
|
||
<?php foreach ($group->items as $item): ?>
|
||
<li>
|
||
<?php echo html::anchor($item->url, $item->label); ?>
|
||
<?php if (isset($item->count)): ?>
|
||
<?php echo html::menu_item_counter($item->count, (isset($item->color) ? $item->color : '')) ?>
|
||
<?php endif ?>
|
||
|
||
<?php if ($this->acl_check_view('Devices_Controller', 'devices',$this->member_id)): ?>
|
||
<li><?php echo html::anchor('devices/show_by_user/'.$this->user_id, __('My devices')) ?></li>
|
||
<?php endif ?>
|
||
|
||
<?php if ($this->member_id != Member_Model::ASSOCIATION && $this->acl_check_view('Connection_Requests_Controller', 'request', $this->member_id) && Settings::get('connection_request_enable')): ?>
|
||
<li><?php echo html::anchor('connection_requests/show_by_member/'.$this->member_id, __('My connection requests')) ?></li>
|
||
<?php endif ?>
|
||
|
||
<?php if ($this->member_id != Member_Model::ASSOCIATION && $this->acl_check_view('Users_Controller', 'work', $this->member_id)): ?>
|
||
<li><?php echo html::anchor('works/show_by_user/'.$this->user_id, __('My works')) ?></li>
|
||
<li><?php echo html::anchor('work_reports/show_by_user/'.$this->user_id, __('My work reports')) ?></li>
|
||
<?php endif ?>
|
||
|
||
<?php if ($this->user_has_phone_invoices): ?>
|
||
<li>
|
||
<?php echo html::anchor('phone_invoices/show_by_user/'.$this->user_id, __('My phone invoices')) ?>
|
||
<?php echo html::menu_item_counter($this->count_unfilled_phone_invoices) ?>
|
||
</li>
|
||
<?php endif ?>
|
||
|
||
<?php if (Settings::get('voip_enabled') && $this->user_has_voip): ?>
|
||
<li><?php echo html::anchor('voip_calls/show_by_user/'.$this->user_id, __('My VoIP calls')) ?></li>
|
||
<?php endif ?>
|
||
|
||
<li>
|
||
<?php echo html::anchor('mail/inbox', __('My mail')) ?>
|
||
<?php echo html::menu_item_counter($this->unread_user_mails) ?>
|
||
</li>
|
||
</li>
|
||
<?php endforeach ?>
|
||
</ul>
|
||
</li>
|
||
|
||
<?php if ($this->acl_check_view('Members_Controller', 'members')) { ?>
|
||
<li class="users"><h2><?php echo __('Users') ?></h2>
|
||
<ul>
|
||
<li><?php echo html::anchor('members/show_all', __('Members')) ?></li>
|
||
|
||
<?php if (Settings::get('self_registration')): ?>
|
||
<li>
|
||
<?php echo html::anchor('members/applicants', __('Registered applicants')) ?>
|
||
<?php echo html::menu_item_counter($this->count_of_registered_members) ?>
|
||
</li>
|
||
<?php endif ?>
|
||
|
||
<li><?php echo html::anchor('membership_interrupts/show_all', __('Membership interrupts')) ?></li>
|
||
<li><?php echo html::anchor('users/show_all', __('Users')) ?></li>
|
||
</ul>
|
||
</li>
|
||
<?php } ?>
|
||
|
||
<?php if ($this->acl_check_view('Accounts_Controller', 'accounts') || $this->acl_check_view('Accounts_Controller', 'unidentified_transfers')): ?>
|
||
<li class="transfer"><h2><?php echo __('Finances') ?></h2>
|
||
<ul>
|
||
<?php if ($this->acl_check_view('Accounts_Controller', 'unidentified_transfers')): ?>
|
||
<li>
|
||
<?php echo html::anchor('bank_transfers/unidentified_transfers/', __('Unidentified transfers')) ?>
|
||
<?php echo html::menu_item_counter($this->count_unidentified_transfers) ?>
|
||
</li>
|
||
<?php endif ?>
|
||
|
||
<?php if ($this->acl_check_view('Accounts_Controller', 'bank_accounts')): ?>
|
||
<li><?php echo html::anchor('bank_accounts/show_all', __('Bank accounts')) ?></li>
|
||
<?php endif ?>
|
||
|
||
<?php if ($this->acl_check_view('Accounts_Controller', 'accounts')): ?>
|
||
<li><?php echo html::anchor('accounts/show_all', __('Double-entry accounts')) ?></li>
|
||
<li><?php echo html::anchor('transfers/show_all', __('Day book')) ?></li>
|
||
<li><?php echo html::anchor('invoices/show_all', __('Invoices')) ?></li>
|
||
<?php endif ?>
|
||
|
||
</ul>
|
||
</li>
|
||
<?php endif ?>
|
||
|
||
<?php if ($this->acl_check_view('Users_Controller', 'work')): ?>
|
||
<li class="approval"><h2><?php echo __('Approval') ?></h2>
|
||
<ul>
|
||
<?php if ($this->acl_check_view('Users_Controller', 'work')): ?>
|
||
<li>
|
||
<?php echo html::anchor('works/pending', __('Works')) ?>
|
||
<?php echo html::menu_item_counter($this->count_of_unvoted_works_of_voter) ?>
|
||
</li>
|
||
<li>
|
||
<?php echo html::anchor('work_reports/pending', __('Work reports')) ?>
|
||
<?php echo html::menu_item_counter($this->count_of_unvoted_works_reports_of_voter) ?>
|
||
</li>
|
||
<?php endif ?>
|
||
</ul>
|
||
</li>
|
||
<?php endif ?>
|
||
|
||
<?php if ($this->acl_check_view('Devices_Controller', 'devices') || $this->acl_check_view('Connection_Requests_Controller', 'request')): ?>
|
||
<li class="networks"><h2><?php echo __('Networks') ?></h2>
|
||
<ul>
|
||
<?php endif ?>
|
||
|
||
<?php if ($this->acl_check_view('Connection_Requests_Controller', 'request') && Settings::get('connection_request_enable')): ?>
|
||
<li>
|
||
<?php echo html::anchor('connection_requests/show_all', __('Connection requests')) ?>
|
||
<?php echo html::menu_item_counter($this->count_undecided_connection_requests) ?>
|
||
</li>
|
||
<?php endif ?>
|
||
|
||
<?php if ($this->acl_check_view('Devices_Controller', 'devices')): ?>
|
||
<li><?php echo html::anchor('ip_addresses/show_all', __('IP addresses')) ?></li>
|
||
<li><?php echo html::anchor('subnets/show_all', __('Subnets')) ?></li>
|
||
<li><?php echo html::anchor('devices/show_all', __('Devices')) ?></li>
|
||
<li><?php echo html::anchor('device_templates/show_all', __('Device templates')) ?></li>
|
||
<li><?php echo html::anchor('ifaces/show_all', __('Interfaces')) ?></li>
|
||
<li><?php echo html::anchor('links/show_all', __('Links')) ?></li>
|
||
<li><?php echo html::anchor('vlans/show_all', __('Vlans')) ?></li>
|
||
|
||
<?php if (Settings::get('voip_enabled') && $this->acl_check_view('VoIP_Controller', 'voip')): ?>
|
||
<li><?php echo html::anchor('voip/show_all', __('VoIP')) ?></li>
|
||
<?php endif ?>
|
||
|
||
<?php if ($this->acl_check_view('Clouds_Controller', 'clouds')): ?>
|
||
<li><?php echo html::anchor('clouds/show_all', __('Clouds')) ?></li>
|
||
<?php endif ?>
|
||
|
||
<li><?php echo html::anchor('tools/ssh', __('Tools')) ?></li>
|
||
|
||
<?php if (Settings::get('ulogd_enabled') == 1): ?>
|
||
<li><?php echo html::anchor('traffic/show_all', __('Traffic')) ?></li>
|
||
<?php endif ?>
|
||
|
||
<?php if (Settings::get('monitoring_enabled') == 1): ?>
|
||
<li>
|
||
<?php echo html::anchor('monitoring/show_all', __('Monitoring')) ?>
|
||
<?php echo html::menu_item_counter($this->devices_down_count, 'red') ?>
|
||
</li>
|
||
<?php endif ?>
|
||
|
||
<li>
|
||
<?php echo html::anchor('devices/show_all_dhcp_servers', __('DHCP servers')) ?>
|
||
<?php echo html::menu_item_counter($this->count_inactive_dhcp_servers, 'red') ?>
|
||
</li>
|
||
<?php endif ?>
|
||
<?php if ($this->acl_check_view('Devices_Controller', 'devices') || $this->acl_check_view('Connection_Requests_Controller', 'request')): ?>
|
||
</ul>
|
||
</li>
|
||
<?php endif ?>
|
||
|
||
<?php if ($this->acl_check_view('Messages_Controller', 'message')): ?>
|
||
<li class="redirection"><h2><?php echo __('Notifications') ?></h2>
|
||
<ul>
|
||
<li><?php echo html::anchor('redirect/show_all', __('Activated redirections')) ?></li>
|
||
<li><?php echo html::anchor('members_whitelists/show_all', __('Whitelist')) ?></li>
|
||
<li><?php echo html::anchor('messages/show_all', __('Messages')) ?></li>
|
||
</ul>
|
||
</li>
|
||
<?php endif ?>
|
||
|
||
<?php if ($this->acl_check_view('Settings_Controller', 'system') || $this->acl_check_view('Address_points_Controller', 'address_point')): ?>
|
||
<li class="administration"><h2><?php echo __('Administration') ?></h2>
|
||
<ul>
|
||
<?php if ($this->acl_check_view('Settings_Controller', 'system')): ?>
|
||
<li>
|
||
<?php echo html::anchor('log_queues/show_all', __('Errors and logs')) ?>
|
||
<?php echo html::menu_item_counter($this->count_of_unclosed_logged_errors, 'red') ?>
|
||
</li>
|
||
<li><?php echo html::anchor('settings/', __('Settings')) ?></li>
|
||
<?php endif ?>
|
||
|
||
<?php if ($this->acl_check_view('Address_points_Controller', 'address_point')): ?>
|
||
<li><?php echo html::anchor('address_points/show_all', __('Address points')) ?></li>
|
||
<?php endif ?>
|
||
|
||
<?php if ($this->acl_check_view('Settings_Controller', 'system')): ?>
|
||
<li><?php echo html::anchor('sms/show_all', __('SMS messages')) ?></li>
|
||
<li><?php echo html::anchor('email_queues/show_all_unsent', __('E-mails')) ?></li>
|
||
<li><?php echo html::anchor('approval_templates/show_all', __('Approval')) ?></li>
|
||
<li><?php echo html::anchor('acl/show_all', __('Access rights')) ?></li>
|
||
<li><?php echo html::anchor('fees/show_all', __('Fees')) ?></li>
|
||
<?php endif ?>
|
||
|
||
<?php if ($this->acl_check_view('Login_logs_Controller', 'logs')): ?>
|
||
<li><?php echo html::anchor('login_logs/show_all', __('Login logs')) ?></li>
|
||
<?php endif ?>
|
||
|
||
<?php if ($this->acl_check_view('Logs_Controller', 'logs') && Settings::get('action_logs_active') == 1): ?>
|
||
<li><?php echo html::anchor('logs/show_all', __('Action logs')) ?></li>
|
||
<?php endif ?>
|
||
|
||
<?php if ($this->acl_check_view('Settings_Controller', 'system')): ?>
|
||
<li><?php echo html::anchor('stats/members_increase_decrease', __('Stats')) ?></li>
|
||
<li><?php echo html::anchor('translations/show_all', __('Translations')) ?></li>
|
||
<li><?php echo html::anchor('enum_types/show_all', __('Enumerations')) ?></li>
|
||
<?php endif ?>
|
||
|
||
<?php if ($this->acl_check_view('Phone_invoices_Controller', 'invoices')): ?>
|
||
<li><?php echo html::anchor('phone_invoices/show_all', __('Phone invoices')) ?></li>
|
||
<?php endif ?>
|
||
|
||
<?php if ($this->acl_check_view('Settings_Controller', 'system')): ?>
|
||
<li><?php echo html::anchor('speed_classes/show_all', __('Speed classes')) ?></li>
|
||
<li><?php echo html::anchor('phone_operators/show_all', __('Phone operators')) ?></li>
|
||
<?php endif ?>
|
||
|
||
<?php if ($this->acl_check_view('Settings_Controller', 'system')): ?>
|
||
<li><?php echo html::anchor('filter_queries/show_all', __('Filter queries')) ?></li>
|
||
<?php endif ?>
|
||
|
||
</ul>
|
||
</li>
|
||
<?php endif ?>
|
||
|
||
|
||
</ul>
|
||
<?php endforeach ?>
|
||
</ul>
|
freenetis/branches/1.1/application/views/users/show.php | ||
---|---|---|
$links[] = html::anchor('users/edit/'.$user_data->id,__('Edit user'));
|
||
if ($this->acl_check_view('Devices_Controller', 'devices', $user_data->member_id))
|
||
$links[] = html::anchor('devices/show_by_user/'.$user_data->id,__('Show devices'));
|
||
if ($user_data->id <> Member_Model::ASSOCIATION && $this->acl_check_view('Users_Controller', 'work', $user_data->member_id))
|
||
if (Settings::get('works_enabled') && $user_data->id <> Member_Model::ASSOCIATION && $this->acl_check_view('Users_Controller', 'work', $user_data->member_id))
|
||
{
|
||
$links[] = html::anchor('works/show_by_user/'.$user_data->id,__('Show works'));
|
||
$links[] = html::anchor('work_reports/show_by_user/'.$user_data->id,__('Show work reports'));
|
freenetis/branches/1.1/application/views/transfers/show.php | ||
---|---|---|
<th><?php echo __('Work report') ?></th>
|
||
<td><?php echo html::anchor('work_reports/show/'.$transfer->job_report_id, $transfer->job_report_description) ?></td>
|
||
</tr>
|
||
<?php } else if (isset($transfer->job_id)) { ?>
|
||
<?php } else if (isset($transfer->job_id) && Settings::get('works_enabled')) { ?>
|
||
<tr>
|
||
<th><?php echo __('Work') ?></th>
|
||
<td><?php echo html::anchor('works/show/'.$transfer->job_id, $transfer->job_description) ?></td>
|
freenetis/branches/1.1/application/views/main.php | ||
---|---|---|
?>
|
||
<div id="whisper"></div>
|
||
<?php
|
||
echo new View('menu');
|
||
echo $this->build_menu();
|
||
endif
|
||
?>
|
||
</div>
|
Také k dispozici: Unified diff
Upravy:
- fixes #513 - Moznost povoleni/zakazani praci
- fixes #523 - Vylepsit system generovani menu