Community
    • Categories
    • Recent
    • Popular
    • Users
    • Search
    • Register
    • Login

    Database Flag Primary User

    Scheduled Pinned Locked Moved Operating
    6 Posts 2 Posters 2.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ? This user is from outside of this forum
      Guest
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • J Offline
        jkondek
        last edited by

        Hello Thomas,

        do you mean the category "contact assginment"?

        Regards,
        jkondek

        1 Reply Last reply Reply Quote 0
        • ? This user is from outside of this forum
          Guest
          last edited by

          Hello jkondek,

          exactly what i meant.

          Greetings Thomas

          1 Reply Last reply Reply Quote 0
          • J Offline
            jkondek
            last edited by

            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

            1 Reply Last reply Reply Quote 0
            • ? This user is from outside of this forum
              Guest
              last edited by

              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

              1 Reply Last reply Reply Quote 0
              • J Offline
                jkondek
                last edited by

                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

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post