You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2014-01-08 15:15:28

Mastermixer
Member
From: Germany
Registered: 2013-12-16
Posts: 18

[GLPI 84.3 - resolved] Can't hide statistics tab in self-service user

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

#2 2014-01-13 10:53:19

Mastermixer
Member
From: Germany
Registered: 2013-12-16
Posts: 18

Re: [GLPI 84.3 - resolved] Can't hide statistics tab in self-service user

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

#3 2014-01-13 11:28:37

Mastermixer
Member
From: Germany
Registered: 2013-12-16
Posts: 18

Re: [GLPI 84.3 - resolved] Can't hide statistics tab in self-service user

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

#4 2014-01-17 12:37:11

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,278

Re: [GLPI 84.3 - resolved] Can't hide statistics tab in self-service user

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

#5 2014-01-21 09:52:07

Mastermixer
Member
From: Germany
Registered: 2013-12-16
Posts: 18

Re: [GLPI 84.3 - resolved] Can't hide statistics tab in self-service user

yllen wrote:

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

#6 2014-01-24 13:00:30

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,278

Re: [GLPI 84.3 - resolved] Can't hide statistics tab in self-service user

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

#7 2014-01-27 17:11:07

Mastermixer
Member
From: Germany
Registered: 2013-12-16
Posts: 18

Re: [GLPI 84.3 - resolved] Can't hide statistics tab in self-service user

Tell me how, please! I like standards! The normal way is not working. What else?

Offline

#8 2014-01-29 10:58:41

MoYo
GLPI - Lead
From: Poitiers
Registered: 2004-09-13
Posts: 14,513
Website

Re: [GLPI 84.3 - resolved] Can't hide statistics tab in self-service user

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

Board footer

Powered by FluxBB