tomolimo / processmaker

GLPI plugin that provides an interface with ProcessMaker (http://www.processmaker.com/)
30 stars 11 forks source link

Synchronization of GLPI and ProcessMaker user fields. #138

Closed kofe88 closed 2 years ago

kofe88 commented 2 years ago

Hello. Is it possible to implement additional synchronization of user fields between the GLPI and PM databases? For example: 1.field from the GLPI database glpi.glpi_useremails.email in the PM database field wf_workflow.USERS.USR_EMAIL 2.field from the GLPI database glpi.glpi_users.registration_number in the PM database field wf_workflow.USERS.USR_ZIP_CODE Is it possible to expect the implementation of such synchronization? Or maybe you can tell me how I can add it myself?

tomolimo commented 2 years ago

Hello @kofe88,

It's not planned to add such info in the case variable list, which is already very long... But it's always possible to request the needed info from the GLPI DB: For this you need to create a new Database connection in the process definition, and you can use it eveyrwhere in dynaforms, or in triggers.

Thank you, Regards, Tomolimo

tomolimo commented 2 years ago

Question: for what do you need the email info?

kofe88 commented 2 years ago

Question: for what do you need the email info?

I asked because DB connections for some reason do not work, even to their own database through 127.0.0.1, although he writes that all connections are successful. image image Then create Dropdown in Dynaform: image With this sql code: SELECT USR_UID, USR_FIRSTNAME FROM USERS; and getting null result image But with databese PM Database this sql code is working: image image Found Errors in log file: `sqlExecution ERROR: Sql Execution {"code":0,"file":"/opt/processmaker-server/thirdparty/propel/Propel.php","line":506,"message":" [wrapped: No driver has been registered to handle connection type: ]","nativeQuery":"SELECT USR_UID, USR_FIRSTNAME FROM USERS;"} {"file":"/opt/processmaker-server/gulliver/system/class.monologProvider.php","line":483,"class":"MonologProvider","function":"addLog"}

<400> Sep 09 11:05:10 sqlExecution ERROR: Sql Execution {"code":0,"file":"/opt/processmaker-server/thirdparty/propel/Propel.php","line":506,"message":" [wrapped: No driver has been registered to handle connection type: ]","nativeQuery":"SELECT USR_UID, USR_FIRSTNAME FROM USERS;"} {"file":"/opt/processmaker-server/gulliver/system/class.monologProvider.php","line":483,"class":"MonologProvider","function":"addLog"} `
tomolimo commented 2 years ago

Hello @kofe88 If you need to access the PM database, then you have to use the already defined DB connection named 'PM Database'. Thank you Regards, Tomolimo

kofe88 commented 2 years ago

Hello @kofe88 If you need to access the PM database, then you have to use the already defined DB connection named 'PM Database'. Thank you Regards, Tomolimo

I found what the problem was. "problem caused by special character in MySQL password." In the user's password for connecting to the database. Here was the same problem here https://forum.processmaker.com/viewtopic.php?t=708638
I changed the password from (for example) "password#" to "password" and now requests are being executed. This is bug from 2017 Year :)