You are not logged in.
Hello GLPI User,
please confirm the following situation:
1. Set self-service user from "silmplified interface" to "standard interface" and save.
2. In tab "Assistance" - Visibility. Set "Statistics" to "No" and save.
I can still see the statistics tab, when I login with self-service user.
Bug?
Last edited by Mastermixer (2014-01-13 17:34:50)
Offline
Ok. Nobody knows, so I try it on my own...
I found out, that the following code in /inc/ticket.class.php is responsible for showing the tabs.
function defineTabs($options=array()) {
$ong = array();
$this->addStandardTab('TicketFollowup',$ong, $options);
$this->addStandardTab('TicketValidation', $ong, $options);
$this->addStandardTab('TicketTask', $ong, $options);
$this->addStandardTab(__CLASS__, $ong, $options);
$this->addStandardTab('TicketCost', $ong, $options);
$this->addStandardTab('Document_Item', $ong, $options);
$this->addStandardTab('Problem', $ong, $options);
// $this->addStandardTab('Change', $ong, $options);
$this->addStandardTab('Log', $ong, $options);
return $ong;
}
When I uncomment
// $this->addStandardTab(__CLASS__, $ong, $options);
The two tabs 'Solutions', 'Statistics' are hidden now. For statistics - ok.
Now I like to show the 'Solutions' tab.
Hints are welcome :-)
Last edited by Mastermixer (2014-01-13 10:58:00)
Offline
Got it!
/inc/ticket.class.php:
// Not check show_all_ticket for Ticket itself
switch ($item->getType()) {
case __CLASS__ :
$ong = array();
$ong[2] = _n('Solution', 'Solutions', 1);
// enquete si statut clos
if ($item->fields['status'] == self::CLOSED) {
$satisfaction = new TicketSatisfaction();
if ($satisfaction->getFromDB($item->getID())) {
$ong[3] = __('Satisfaction');
}
}
if (Session::haveRight('observe_ticket','1')) {
$ong[4] = __('Statistics');
}
return $ong;
// default :
// return _n('Ticket','Tickets',2);
}
return '';
}
Comment out:
// if (Session::haveRight('observe_ticket','1')) {
// $ong[4] = __('Statistics');
// }
Ok. That works. Statistics tab is hidden.
Back to the root problem.
Is this the right if query?
if (Session::haveRight('observe_ticket','1'))
In my opinion the haveRight('observe_ticket','1') is not the right one here and I changed it to:
if (Session::haveRight('statistic','1')) {
$ong[4] = __('Statistics');
}
BAZINGA! It works.
Please correct me, if I'm wrong. Thanks.
Last edited by Mastermixer (2014-03-10 08:56:18)
Offline
You just have to save Statistic No in the profile, loggin out and login in and you will not have Statistic menu
CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6 - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)
Offline
You just have to save Statistic No in the profile, loggin out and login in and you will not have Statistic menu
Hi! Thanks for your answer yllen.
For the statistics menu this is right. But I want to change the visibility of the statistics tab in the ticket sight. Even when I change the statistic rights to "No", the statistics tab is still shown in the ticket of a post-only user and I don't want to show these times to the post-only user - maybe later ... ;-)
Offline
You can hidde this tab without changing the core
CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6 - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)
Offline
Tell me how, please! I like standards! The normal way is not working. What else?
Offline
Right answer is You cannot hide this tab without changing the core
MoYo - Julien Dombre - Association INDEPNET
Contribute to GLPI : Support Contribute References Freshmeat
Offline