Hi,

feature is interesting but I think it was complex to use your patch.
A complete way to manage it maybe to ue rule engine defining a new action like :
"Assign to tech with less tickets in group" and select the target group.

It will permit to limit the assignation to a group and be more flexible.

Any other ideas about that ?

Regards

Julien



Le 13/09/2011 03:17, Zorianny Itriago a écrit :
Hi!!!

I'm using GLPI and I added a fragment in the code because I needed to assign tickets with a queue, where the ticket is assigned to a technical with less tickets in this moment. The problem is I can't to update the version, because I'll lost the changes. Is possible you can to add this option???

This is the function:
static function agregarTicketTecnico($ticketID=0) { //agregado
      global $DB, $LANG, $CFG_GLPI;

      if ($ticketID != 0) {
$DBread = DBConnection::getReadConnection();//clase conexion con la BD $consulta = "(SELECT users_id,0 as cantidad FROM glpi_groups_users ". "INNER JOIN glpi_users u ON (u.id <http://u.id>=users_id AND u.is_active=1)". "WHERE groups_id in (SELECT groups_id From glpi_groups_tickets where tickets_id = ".$ticketID.") ". "AND users_id not in (SELECT users_id from glpi_tickets_users where tickets_id in (select id from glpi_tickets where status='assign') and type=2) ".
                    ") UNION ( ".
"SELECT u.users_id,count(u.tickets_id) as cantidad FROM glpi_tickets_users u ". "INNER JOIN glpi_users gu ON (gu.id <http://gu.id>=u.users_id AND gu.is_active=1)". "INNER JOIN glpi_tickets t ON (t.id <http://t.id> = u.tickets_id and t.status='assign') ". "WHERE u.type=2 and u.users_id in (SELECT users_id FROM glpi_groups_users WHERE groups_id in ". "(SELECT groups_id From glpi_groups_tickets where tickets_id = ".$ticketID.")) ".
                    "group by u.users_id ) ".
"ORDER BY cantidad asc";//consulta para buscar el tecnico con menos tickets
         $resultado = $DBread->query($consulta);

$res = $DBread->fetch_assoc($resultado);//para pasar el arreglo x URL


         //asignar ticket automaticamente al tecnico
$insert = "INSERT INTO glpi_tickets_users (tickets_id,users_id,type,use_notification) VALUES (".$ticketID.",".$res['users_id'].",2,1)";
          $result = $DBread->query($insert);
        }

   }

From Caracas, Venezuela
excuse me, my redaction in English is terrible...

--
Saludos
Zorianny Itriago


_______________________________________________
Glpi-dev mailing list
Glpi-dev@gna.org
https://mail.gna.org/listinfo/glpi-dev

_______________________________________________
Glpi-dev mailing list
Glpi-dev@gna.org
https://mail.gna.org/listinfo/glpi-dev

Reply via email to