Database Flag Primary User



  • Hello,

    I'm currently searching for a flag in the DB that sets the user as primary user.
    I wrote an php script that exports the i-doit data, but i got troubles querying the primary user
    out of a device that is used from more than one user. Do you know where this flag is set in code or database?

    Greetings
    Thomas


  • i-doit Kenner

    Hello Thomas,

    do you mean the category "contact assginment"?

    Regards,
    jkondek



  • Hello jkondek,

    exactly what i meant.

    Greetings Thomas


  • i-doit Kenner

    Hello Thomas,

    in the table "isys_catg_contact_list" there is a column named "isys_catg_contact_list__primary_contact".
    The value can be 0 (not primary) or 1 (primary).

    Check it out 😉

    Regards,
    jkondek



  • Hallo jkondek,

    thanks this helped me a lot, the only thing i'm still looking for is a database connection
    between the object ID and the name of the User  (obj_title is unfortunately inconsistent)

    Thanks a lot
    Thomas


  • i-doit Kenner

    Hello Thomas,

    that's easy, here is a query for all objects with a primary contact:

    SELECT
    j1.isys_obj__title AS 'object',
    j2.isys_obj__title AS 'primary contact'

    FROM isys_obj AS j1

    LEFT JOIN isys_catg_contact_list
    ON isys_catg_contact_list__isys_obj__id = j1.isys_obj__id

    LEFT JOIN isys_connection
    ON isys_connection__id = isys_catg_contact_list__isys_connection__id

    LEFT JOIN isys_obj AS j2
    ON j2.isys_obj__id = isys_connection__isys_obj__id

    WHERE TRUE
    AND isys_catg_contact_list__primary_contact = 1

    Maybe you want to add something like this (only all server):
    AND j1.isys_obj__isys_obj_type__id = 5

    Regards,
    jkondek


 


Datenschutz / Privacy Policy