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 2008-10-22 00:34:58

Taras_
Member
From: Russia
Registered: 2006-04-25
Posts: 57
Website

Tickets again (submission by email - one parser, many orgs)

Hi to All.

Q1:
I want ticket submitted by user (by email) to became in user's entity.
I.e. user "A" with email "E" are in entity "O", email sent from "E" creates ticket for organization "O".
Is it possible (how?) or planned?

P.S. As I understand, user may belong to many orgs in same time. It makes a bit difficult to sort mail/tickets in such way. In this case ticket can go to "first" or parser's entity.

Q2:
Is it possible to change ticket's entity?

Thanks in advance and sorry for english.


Multiple GLPI instances. Thanks to developers! smile

Offline

#2 2008-10-22 00:47:46

Taras_
Member
From: Russia
Registered: 2006-04-25
Posts: 57
Website

Re: Tickets again (submission by email - one parser, many orgs)

Q2: solved


Multiple GLPI instances. Thanks to developers! smile

Offline

#3 2008-10-28 16:09:01

Taras_
Member
From: Russia
Registered: 2006-04-25
Posts: 57
Website

Re: Tickets again (submission by email - one parser, many orgs)

Q1 update, about automatic assigning email ticket to entity.

My configutation.
1) Many workers from many organizations send email to ONE support mailbox. Using one mailbox we can't create different mailgate parsers for different organizations. Creating own mailbox for every organizations is... not good idea, next step will be printing own business cards for every customer ;-).
2) Each organization corresponds to entity in GLPI.
3) Each worker corresponds to user in GLPI's entity. User's email may be in corporate domain, i.e. username@someorg.tld for each org's user or in different domains for users in same org. In first case we can automatically assign ticket to entity using one rule, in second case it's to complicated - rule for every worker.

To resolve this proble I added few lines of code to buildTicket() in mailgate.class.php.

                if (!$exists) {
                        unset($tkt['tracking']);
                        // Mail followup
                        $tkt['uemail']=$head['from'];
                        $tkt['emailupdates']=1;
                        // Which entity ?
                        $tkt['FK_entities']=$this->entity;
/// Added
                $query="SELECT FK_entities from glpi_users WHERE email='".$head['from']."'";
                $result=$DB->query($query);
                if ($result&&$DB->numrows($result)) {
                       $tkt['FK_entities']=$DB->result($result,0,"FK_entities");
                }

Multiple GLPI instances. Thanks to developers! smile

Offline

#4 2008-10-28 16:20:44

JMD
GLPI - Lead
Registered: 2004-09-13
Posts: 9,180
Website

Re: Tickets again (submission by email - one parser, many orgs)

I understand you needs esposed in point 1.

This feature is planned  but not also simple as it seems.

You could have a look at this thread  (in french but google have good translation) : http://glpi-project.org/forum/viewtopic.php?id=12367


JMD / Jean-Mathieu Doléans - Glpi-project.org - Association Indepnet
Apportez votre pierre au  projet GLPI   : Soutenir

Offline

#5 2008-10-28 16:22:03

remi
GLPI-DEV
From: Champagne
Registered: 2007-04-28
Posts: 7,127
Website

Re: Tickets again (submission by email - one parser, many orgs)

Point 2 and 3 are very specific...

There is a open ticket about such a feature for a future version.

Regards.


Dév. Fedora 29 - PHP 5.6/7.0/7.1/7.2/7.3/7.4 - MariaDB 10.3 - GLPI master
Certifié ITILv3 - RPM pour Fedora, RHEL et CentOS sur https://blog.remirepo.net/

Offline

#6 2008-10-28 16:31:53

Taras_
Member
From: Russia
Registered: 2006-04-25
Posts: 57
Website

Re: Tickets again (submission by email - one parser, many orgs)

Merci!
I'll go to train my extremely poor French while reading corresponding thread ;-)


Multiple GLPI instances. Thanks to developers! smile

Offline

#7 2008-10-28 16:35:28

JMD
GLPI - Lead
Registered: 2004-09-13
Posts: 9,180
Website

Re: Tickets again (submission by email - one parser, many orgs)


JMD / Jean-Mathieu Doléans - Glpi-project.org - Association Indepnet
Apportez votre pierre au  projet GLPI   : Soutenir

Offline

#8 2009-03-26 20:32:45

treydock
Member
Registered: 2009-02-26
Posts: 42

Re: Tickets again (submission by email - one parser, many orgs)

Taras' example worked for me with some tweaking.  We are a multi-department organization that all emails for entire organization go to one email address.  I spent many hours trying to make rules work using the submitter's group.  This is the altered code I used to get mine working.  What it does is create the ticket with the correct entity assigned to the user.

 $query="select  glpi_users_profiles.FK_entities from glpi_users , glpi_users_profiles where glpi_users.email='".$head['from']."' and glpi_users_profiles.FK_users = glpi_users.ID";
                         $result=$DB->query($query);
                         if ($result&&$DB->numrows($result)) {
                                 $tkt['FK_entities']=$DB->result($result,0,"FK_entities");
                            }

Trying the same approach to assign the user's group to the ticket but so far haven't been able to get it to work.


Live Instance >> CentOS 5.6 x64 | Apache-2.2.3 | PHP-5.1.6 | MySQL-5.0.77 | Kernel 2.6.18-194.el5 | GLPI v0.80.2 | OCS 2.0RC3 (~500 units)
Dev Server >> Same as above

Offline

#9 2009-03-26 21:29:38

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

Re: Tickets again (submission by email - one parser, many orgs)

Your solution work only if a user is affected to only one entity


MoYo - Julien Dombre - Association INDEPNET
Contribute to GLPI :    Support     Contribute     References     Freshmeat

Offline

#10 2009-03-27 09:02:28

Taras_
Member
From: Russia
Registered: 2006-04-25
Posts: 57
Website

Re: Tickets again (submission by email - one parser, many orgs)

MoYo wrote:

Your solution work only if a user is affected to only one entity

I understand.
I think, that this change can be added to GLPI with additional check if user assigned to only one entity.


Multiple GLPI instances. Thanks to developers! smile

Offline

#11 2009-03-27 18:21:44

treydock
Member
Registered: 2009-02-26
Posts: 42

Re: Tickets again (submission by email - one parser, many orgs)

Taras_ wrote:
MoYo wrote:

Your solution work only if a user is affected to only one entity

I understand.
I think, that this change can be added to GLPI with additional check if user assigned to only one entity.

Ah didn't realize it was for one entity per user.  My entity structure only has one per user anyways so missed that part.

I've also want to get working what was mentioned earlier , that is assign to user's group on ticket creation.  I tried the same approach from what I posted above, but did not have luck ; that and all my users belong to two groups at least.  Even if it created the ticket with only one of the user's groups that would be great but can't seem to find information in the db tables that can be used to match user ID to a group.


Live Instance >> CentOS 5.6 x64 | Apache-2.2.3 | PHP-5.1.6 | MySQL-5.0.77 | Kernel 2.6.18-194.el5 | GLPI v0.80.2 | OCS 2.0RC3 (~500 units)
Dev Server >> Same as above

Offline

#12 2009-03-29 13:17:31

Taras_
Member
From: Russia
Registered: 2006-04-25
Posts: 57
Website

Re: Tickets again (submission by email - one parser, many orgs)

treydock wrote:

... but can't seem to find information in the db tables that can be used to match user ID to a group.

Information you need (as I understand) located in glpi_users_groups:

mysql> describe glpi_users_groups;
+-----------+---------+------+-----+---------+----------------+
| Field     | Type    | Null | Key | Default | Extra          |
+-----------+---------+------+-----+---------+----------------+
| ID        | int(11) | NO   | PRI | NULL    | auto_increment |
| FK_users  | int(11) | NO   | MUL | 0       |                |
| FK_groups | int(11) | NO   | MUL | 0       |                |
+-----------+---------+------+-----+---------+----------------+
3 rows in set (0.00 sec)

Multiple GLPI instances. Thanks to developers! smile

Offline

Board footer

Powered by FluxBB