Răsfoiți Sursa

Sources initiales 2.7.0 (GLPI 9.4)

Nathan 4 ani în urmă
părinte
comite
db5b0a2005
66 a modificat fișierele cu 10588 adăugiri și 0 ștergeri
  1. 661 0
      LICENSE
  2. 40 0
      ajax/dropdownAllItems.php
  3. 106 0
      front/appliancequery.form.php
  4. 45 0
      front/appliancequery.php
  5. 72 0
      front/archires.graph.php
  6. 74 0
      front/archires.map.php
  7. 47 0
      front/archires.php
  8. 39 0
      front/archires.test.php
  9. 136 0
      front/config.form.php
  10. 105 0
      front/locationquery.form.php
  11. 47 0
      front/locationquery.php
  12. 104 0
      front/networkequipmentquery.form.php
  13. 47 0
      front/networkequipmentquery.php
  14. 84 0
      front/view.form.php
  15. 47 0
      front/view.php
  16. 887 0
      hook.php
  17. 317 0
      inc/appliancequery.class.php
  18. 119 0
      inc/archires.class.php
  19. 214 0
      inc/imageitem.class.php
  20. 397 0
      inc/locationquery.class.php
  21. 86 0
      inc/menu.class.php
  22. 400 0
      inc/networkequipmentquery.class.php
  23. 198 0
      inc/networkinterfacecolor.class.php
  24. 149 0
      inc/profile.class.php
  25. 730 0
      inc/prototype.class.php
  26. 244 0
      inc/querytype.class.php
  27. 224 0
      inc/statecolor.class.php
  28. 561 0
      inc/view.class.php
  29. 211 0
      inc/vlancolor.class.php
  30. BIN
      locales/cs_CZ.mo
  31. 232 0
      locales/cs_CZ.po
  32. BIN
      locales/da_DK.mo
  33. 226 0
      locales/da_DK.po
  34. BIN
      locales/de_DE.mo
  35. 225 0
      locales/de_DE.po
  36. BIN
      locales/en_GB.mo
  37. 225 0
      locales/en_GB.po
  38. BIN
      locales/es_ES.mo
  39. 226 0
      locales/es_ES.po
  40. BIN
      locales/fr_FR.mo
  41. 226 0
      locales/fr_FR.po
  42. 225 0
      locales/glpi.pot
  43. BIN
      locales/hr_HR.mo
  44. 230 0
      locales/hr_HR.po
  45. BIN
      locales/it_IT.mo
  46. 225 0
      locales/it_IT.po
  47. BIN
      locales/pt_BR.mo
  48. 226 0
      locales/pt_BR.po
  49. BIN
      locales/ro_RO.mo
  50. 229 0
      locales/ro_RO.po
  51. BIN
      locales/ru_RU.mo
  52. 232 0
      locales/ru_RU.po
  53. BIN
      locales/tr_TR.mo
  54. 226 0
      locales/tr_TR.po
  55. BIN
      pics/archires.png
  56. BIN
      pics/mini_archires.png
  57. BIN
      pics/nothing.png
  58. BIN
      pics/socket.png
  59. 88 0
      setup.php
  60. 145 0
      sql/empty-1.5.sql
  61. 145 0
      sql/empty-1.6.sql
  62. 165 0
      sql/empty-1.7.0.sql
  63. 164 0
      sql/empty-1.7.2.sql
  64. 182 0
      sql/empty-1.8.0.sql
  65. 182 0
      sql/empty-2.1.0.sql
  66. 173 0
      sql/empty-2.2.sql

+ 661 - 0
LICENSE

@@ -0,0 +1,661 @@
+                    GNU AFFERO GENERAL PUBLIC LICENSE
+                       Version 3, 19 November 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+our General Public Licenses are intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  Developers that use our General Public Licenses protect your rights
+with two steps: (1) assert copyright on the software, and (2) offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
+
+  A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate.  Many developers of free software are heartened and
+encouraged by the resulting cooperation.  However, in the case of
+software used on network servers, this result may fail to come about.
+The GNU General Public License permits making a modified version and
+letting the public access it on a server without ever releasing its
+source code to the public.
+
+  The GNU Affero General Public License is designed specifically to
+ensure that, in such cases, the modified source code becomes available
+to the community.  It requires the operator of a network server to
+provide the source code of the modified version running there to the
+users of that server.  Therefore, public use of a modified version, on
+a publicly accessible server, gives the public access to the source
+code of the modified version.
+
+  An older license, called the Affero General Public License and
+published by Affero, was designed to accomplish similar goals.  This is
+a different license, not a version of the Affero GPL, but Affero has
+released a new version of the Affero GPL which permits relicensing under
+this license.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU Affero General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Remote Network Interaction; Use with the GNU General Public License.
+
+  Notwithstanding any other provision of this License, if you modify the
+Program, your modified version must prominently offer all users
+interacting with it remotely through a computer network (if your version
+supports such interaction) an opportunity to receive the Corresponding
+Source of your version by providing access to the Corresponding Source
+from a network server at no charge, through some standard or customary
+means of facilitating copying of software.  This Corresponding Source
+shall include the Corresponding Source for any work covered by version 3
+of the GNU General Public License that is incorporated pursuant to the
+following paragraph.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the work with which it is combined will remain governed by version
+3 of the GNU General Public License.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU Affero General Public License from time to time.  Such new versions
+will be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU Affero General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU Affero General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU Affero General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU Affero General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU Affero General Public License for more details.
+
+    You should have received a copy of the GNU Affero General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source.  For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code.  There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+<http://www.gnu.org/licenses/>.

+ 40 - 0
ajax/dropdownAllItems.php

@@ -0,0 +1,40 @@
+<?php
+/*
+ * @version $Id: dropdownAllItems.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+  LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+ */
+
+include ("../../../inc/includes.php");
+header("Content-Type: text/html; charset=UTF-8");
+Html::header_nocache();
+
+// Make a select box
+if (isset($_POST["itemtype"])) {
+   Dropdown::show($_POST['itemtype'].'Type', ['width'   => '80%',
+                                              'name'    => $_POST['myname']]);
+}

+ 106 - 0
front/appliancequery.form.php

@@ -0,0 +1,106 @@
+<?php
+/*
+ * @version $Id: appliancequery.form.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+ */
+
+include ("../../../inc/includes.php");
+
+if (!isset($_GET["id"])) {
+   $_GET["id"] = "";
+}
+
+if (isset($_GET["start"])) {
+   $start = $_GET["start"];
+} else {
+   $start = 0;
+}
+
+$PluginArchiresApplianceQuery = new PluginArchiresApplianceQuery();
+$PluginArchiresQueryType      = new PluginArchiresQueryType();
+
+if (isset($_POST["add"])) {
+   $PluginArchiresApplianceQuery->check(-1, CREATE,$_POST);
+   $PluginArchiresApplianceQuery->add($_POST);
+   Html::back();
+
+} else if (isset($_POST["delete"])) {
+   $PluginArchiresApplianceQuery->check($_POST['id'], DELETE);
+   $PluginArchiresApplianceQuery->delete($_POST);
+   Html::redirect(Toolbox::getItemTypeSearchURL('PluginArchiresApplianceQuery'));
+
+} else if (isset($_POST["restore"])) {
+   $PluginArchiresApplianceQuery->check($_POST['id'], PURGE);
+   $PluginArchiresApplianceQuery->restore($_POST);
+   Html::redirect(Toolbox::getItemTypeSearchURL('PluginArchiresApplianceQuery'));
+
+} else if (isset($_POST["purge"])) {
+   $PluginArchiresApplianceQuery->check($_POST['id'], PURGE);
+   $PluginArchiresApplianceQuery->delete($_POST,1);
+   Html::redirect(Toolbox::getItemTypeSearchURL('PluginArchiresApplianceQuery'));
+
+} else if (isset($_POST["update"])) {
+   $PluginArchiresApplianceQuery->check($_POST['id'], UPDATE);
+   $PluginArchiresApplianceQuery->update($_POST);
+   Html::back();
+
+} else if (isset($_POST["duplicate"])) {
+   $PluginArchiresApplianceQuery->check($_POST['id'], CREATE);
+   unset($_POST['id']);
+   $PluginArchiresApplianceQuery->add($_POST);
+   Html::back();
+
+} else if (isset($_POST["addtype"])) {
+   if ($PluginArchiresQueryType->canCreate()) {
+      $PluginArchiresQueryType->addType('PluginArchiresApplianceQuery', $_POST['type'],
+                                        $_POST['_itemtype'], $_POST['query']);
+   }
+   Html::back();
+
+} else if (isset($_POST["deletetype"])) {
+   if ($PluginArchiresQueryType->canCreate()) {
+      $PluginArchiresQueryType->getFromDB($_POST["id"],-1);
+      foreach ($_POST["item"] as $key => $val) {
+         if ($val == 1) {
+            $PluginArchiresQueryType->deleteType($key);
+         }
+      }
+   }
+   Html::back();
+
+} else {
+
+   $PluginArchiresApplianceQuery->checkGlobal(READ);
+
+   Html::header(PluginArchiresArchires::getTypeName()." ".PluginArchiresApplianceQuery::getTypeName(),
+                '',"tools","pluginarchiresmenu", "appliance");
+
+   $PluginArchiresApplianceQuery->display($_GET);
+
+   Html::footer();
+}

+ 45 - 0
front/appliancequery.php

@@ -0,0 +1,45 @@
+<?php
+/*
+ * @version $Id: appliancequery.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+*/
+
+include ("../../../inc/includes.php");
+
+Html::header(PluginArchiresArchires::getTypeName()." ".PluginArchiresApplianceQuery::getTypeName(),
+             '',"tools","pluginarchiresmenu", "appliance");
+
+$PluginArchiresApplianceQuery = new PluginArchiresApplianceQuery();
+
+if ($PluginArchiresApplianceQuery->canView() || Session::haveRight("config", UPDATE)) {
+   Search::show("PluginArchiresApplianceQuery");
+} else {
+   Html::displayRightError();
+}
+
+Html::footer();

+ 72 - 0
front/archires.graph.php

@@ -0,0 +1,72 @@
+<?php
+/*
+ * @version $Id: archires.graph.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+*/
+
+include ("../../../inc/includes.php");
+
+if (!isset($_GET["id"])) {
+   $_GET["id"] = "";
+}
+
+$PluginArchiresView      = new PluginArchiresView();
+$PluginArchiresPrototype = new PluginArchiresPrototype();
+
+$object = $_GET["querytype"];
+$obj    = new $object();
+
+if (isset($_GET["displayview"])) {
+   $obj->getFromDB($_GET["plugin_archires_queries_id"]);
+   Html::redirect($CFG_GLPI["root_doc"]."/plugins/archires/front/archires.graph.php?id=".
+                  $obj->fields["id"]."&querytype=".$_GET["querytype"]."&plugin_archires_views_id=".
+                  $_GET["plugin_archires_views_id"]);
+
+} else {
+   Html::header(PluginArchiresArchires::getTypeName(),'',"tools","pluginarchires");
+
+   $obj->getFromDB($_GET["id"]);
+   $object_view = $obj->fields["plugin_archires_views_id"];
+   $entities_id = $obj->fields["entities_id"];
+
+   if ($PluginArchiresView->getFromDB($object_view)
+       && Session::haveAccessToEntity($entities_id)) {
+
+      if (!isset($_GET["plugin_archires_views_id"])) {
+        $plugin_archires_views_id = $object_view;
+      } else {
+        $plugin_archires_views_id = $_GET["plugin_archires_views_id"];
+      }
+      $PluginArchiresPrototype->displayGraph($obj,$plugin_archires_views_id,1);
+
+   } else {
+      Html::redirect($CFG_GLPI["root_doc"]."/plugins/archires/front/archires.php");
+   }
+
+   Html::footer();
+}

+ 74 - 0
front/archires.map.php

@@ -0,0 +1,74 @@
+<?php
+/*
+ * @version $Id: archires.map.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+*/
+
+include ("../../../inc/includes.php");
+
+$PluginArchiresView      = new PluginArchiresView();
+$PluginArchiresPrototype = new PluginArchiresPrototype();
+
+$PluginArchiresView->getFromDB($_GET["plugin_archires_views_id"]);
+if (isset($_GET["format"])) {
+   $format = $_GET["format"];
+} else {
+   $format = $PluginArchiresView->fields["format"];
+}
+
+if ($format == PluginArchiresView::PLUGIN_ARCHIRES_JPEG_FORMAT) {
+   $format_graph = "jpeg";
+} else if ($format == PluginArchiresView::PLUGIN_ARCHIRES_PNG_FORMAT) {
+   $format_graph = "png";
+} else if ($format == PluginArchiresView::PLUGIN_ARCHIRES_GIF_FORMAT) {
+   $format_graph = "gif";
+} else if ($format == PluginArchiresView::PLUGIN_ARCHIRES_SVG_FORMAT) {
+   $format_graph = "svg";
+}
+
+$object      = $_GET["querytype"];
+$obj         = new $object();
+$obj->getFromDB($_GET["id"]);
+$object_view = $obj->fields["plugin_archires_views_id"];
+
+if (!isset($_GET["plugin_archires_views_id"])) {
+   $plugin_archires_views_id = $object_view;
+} else {
+   $plugin_archires_views_id = $_GET["plugin_archires_views_id"];
+}
+$output_data = $PluginArchiresPrototype->createGraph($format_graph,$obj,$plugin_archires_views_id);
+
+if ($format == PluginArchiresView::PLUGIN_ARCHIRES_SVG_FORMAT) {
+   header("Content-type: image/svg+xml");
+   header('Content-Disposition: attachment; filename="image.svg"');
+} else {
+   header("Content-Type: image/".$format_graph."");
+}
+header("Content-Length: ".strlen($output_data));
+
+echo $output_data;

+ 47 - 0
front/archires.php

@@ -0,0 +1,47 @@
+<?php
+/*
+ * @version $Id: archires.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+*/
+
+include ("../../../inc/includes.php");
+
+Html::header(PluginArchiresArchires::getTypeName(),'',"tools", "pluginarchiresmenu");
+
+$PluginArchiresArchires = new PluginArchiresArchires();
+
+if ($PluginArchiresArchires->canView()
+    || Session::haveRight("config", UPDATE)) {
+
+   PluginArchiresArchires::showSummary();
+
+} else {
+   Html::displayRightError();
+}
+
+Html::footer();

+ 39 - 0
front/archires.test.php

@@ -0,0 +1,39 @@
+<?php
+/*
+ * @version $Id: archires.test.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+*/
+
+include ("../../../inc/includes.php");
+
+$PluginArchiresPrototype = new PluginArchiresPrototype();
+$output_data             = $PluginArchiresPrototype->testGraphviz();
+
+header("Content-Type: image/png");
+header("Content-Length: " . strlen($output_data));
+echo $output_data;

+ 136 - 0
front/config.form.php

@@ -0,0 +1,136 @@
+<?php
+/*
+ * @version $Id: config.form.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+ */
+
+if (!defined('GLPI_ROOT')) {
+   include ("../../../inc/includes.php");
+}
+
+$plugin = new Plugin();
+if ($plugin->isActivated("archires")) {
+   Session::checkRight("config", UPDATE);
+   $PluginArchiresImageItem             = new PluginArchiresImageItem();
+   $PluginArchiresNetworkInterfaceColor = new PluginArchiresNetworkInterfaceColor();
+   $PluginArchiresVlanColor             = new PluginArchiresVlanColor();
+   $PluginArchiresStateColor            = new PluginArchiresStateColor();
+
+   if (isset($_POST["add"]) && isset($_POST['_itemtype'])) {
+      if ($PluginArchiresImageItem->canCreate()) {
+         $PluginArchiresImageItem->addItemImage($_POST['type'], $_POST['_itemtype'],
+                                                $_POST['img']);
+      }
+      Html::back();
+
+   } else if (isset($_POST["delete"])) {
+      Session::checkRight("config", UPDATE);
+      $PluginArchiresImageItem->getFromDB($_POST["id"],-1);
+
+      foreach ($_POST["item"] as $key => $val) {
+         if ($val == 1) {
+            $PluginArchiresImageItem->delete(['id' => $key]);
+         }
+      }
+      Html::back();
+
+   } else if (isset($_POST["add_color_networkinterface"])
+              && isset($_POST['networkinterfaces_id'])) {
+
+      if ($PluginArchiresNetworkInterfaceColor->canCreate()) {
+         $PluginArchiresNetworkInterfaceColor->addNetworkInterfaceColor($_POST['networkinterfaces_id'],
+                                                                        $_POST['color']);
+      }
+      Html::back();
+
+   } else if (isset($_POST["delete_color_networkinterface"])) {
+      Session::checkRight("config", UPDATE);
+      $PluginArchiresNetworkInterfaceColor->getFromDB($_POST["id"],-1);
+
+      foreach ($_POST["item_color"] as $key => $val) {
+         if ($val == 1) {
+            $PluginArchiresNetworkInterfaceColor->delete(['id' => $key]);
+         }
+      }
+      Html::back();
+
+   } else if (isset($_POST["add_color_state"]) && isset($_POST['states_id'])) {
+      if ($PluginArchiresStateColor->canCreate()) {
+         $PluginArchiresStateColor->addStateColor($_POST['states_id'],$_POST['color']);
+      }
+      Html::back();
+
+   } else if (isset($_POST["delete_color_state"])) {
+      Session::checkRight("config", UPDATE);
+      $PluginArchiresStateColor->getFromDB($_POST["id"],-1);
+
+      foreach ($_POST["item_color"] as $key => $val) {
+         if ($val == 1) {
+            $PluginArchiresStateColor->delete(['id' => $key]);
+         }
+      }
+      Html::back();
+
+   } else if (isset($_POST["add_color_vlan"]) && isset($_POST['vlans_id'])) {
+      if ($PluginArchiresVlanColor->canCreate()) {
+         $PluginArchiresVlanColor->addVlanColor($_POST['vlans_id'],$_POST['color']);
+      }
+      Html::back();
+
+   } else if (isset($_POST["delete_color_vlan"])) {
+      Session::checkRight("config", UPDATE);
+      $PluginArchiresVlanColor->getFromDB($_POST["id"],-1);
+
+      foreach ($_POST["item_color"] as $key => $val) {
+         if ($val == 1) {
+            $PluginArchiresVlanColor->delete(['id' => $key]);
+         }
+      }
+      Html::back();
+
+   } else {
+      Html::header(PluginArchiresArchires::getTypeName(), '', "tools", "pluginarchiresmenu");
+
+      $PluginArchiresImageItem->showConfigForm();
+
+      $PluginArchiresNetworkInterfaceColor->showConfigForm(true);
+
+      $PluginArchiresVlanColor->showConfigForm(true);
+
+      $PluginArchiresStateColor->showConfigForm(true);
+
+      Html::footer();
+   }
+
+} else {
+   Html::header(__('Setup'), '', "config", "plugins");
+   echo "<div class='center'><br><br>".
+         "<img src=\"".$CFG_GLPI["root_doc"]."/pics/warning.png\" alt='warning'><br><br>";
+   echo "<b>".__('Please activate the plugin','addressing')."</b></div>";
+   Html::footer();
+}

+ 105 - 0
front/locationquery.form.php

@@ -0,0 +1,105 @@
+<?php
+/*
+ * @version $Id: locationquery.form.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+ */
+
+include ("../../../inc/includes.php");
+
+if (!isset($_GET["id"])) {
+   $_GET["id"] = "";
+}
+if (isset($_GET["start"])) {
+   $start = $_GET["start"];
+} else {
+   $start = 0;
+}
+
+$PluginArchiresLocationQuery = new PluginArchiresLocationQuery();
+$PluginArchiresQueryType     = new PluginArchiresQueryType();
+
+if (isset($_POST["add"])) {
+   $PluginArchiresLocationQuery->check(-1, CREATE,$_POST);
+   $PluginArchiresLocationQuery->add($_POST);
+   Html::back();
+
+} else if (isset($_POST["delete"])) {
+   $PluginArchiresLocationQuery->check($_POST['id'],DELETE);
+   $PluginArchiresLocationQuery->delete($_POST);
+   Html::redirect(Toolbox::getItemTypeSearchURL('PluginArchiresLocationQuery'));
+
+} else if (isset($_POST["restore"])) {
+   $PluginArchiresLocationQuery->check($_POST['id'],PURGE);
+   $PluginArchiresLocationQuery->restore($_POST);
+   Html::redirect(Toolbox::getItemTypeSearchURL('PluginArchiresLocationQuery'));
+
+} else if (isset($_POST["purge"])) {
+   $PluginArchiresLocationQuery->check($_POST['id'],PURGE);
+   $PluginArchiresLocationQuery->delete($_POST,1);
+   Html::redirect(Toolbox::getItemTypeSearchURL('PluginArchiresLocationQuery'));
+
+} else if (isset($_POST["update"])) {
+   $PluginArchiresLocationQuery->check($_POST['id'],UPDATE);
+   $PluginArchiresLocationQuery->update($_POST);
+   Html::back();
+
+} else if (isset($_POST["duplicate"])) {
+   $PluginArchiresLocationQuery->check($_POST['id'],CREATE);
+   unset($_POST['id']);
+   $PluginArchiresLocationQuery->add($_POST);
+   Html::back();
+
+} else if (isset($_POST["addtype"]) && isset($_POST['_itemtype'])) {
+   if ($PluginArchiresQueryType->canCreate()) {
+      $PluginArchiresQueryType->addType('PluginArchiresLocationQuery', $_POST['type'],
+                                        $_POST['_itemtype'], $_POST['query']);
+   }
+   Html::back();
+
+} else if (isset($_POST["deletetype"])) {
+   if ($PluginArchiresQueryType->canCreate()) {
+      $PluginArchiresQueryType->getFromDB($_POST["id"],-1);
+
+      foreach ($_POST["item"] as $key => $val) {
+         if ($val == 1) {
+            $PluginArchiresQueryType->delete(['id' => $key]);
+         }
+      }
+   }
+   Html::back();
+
+} else {
+   $PluginArchiresLocationQuery->checkGlobal(READ);
+
+   Html::header(PluginArchiresArchires::getTypeName()." ".PluginArchiresLocationQuery::getTypeName(),
+                '',"tools","pluginarchiresmenu","location");
+
+   $PluginArchiresLocationQuery->display($_GET);
+
+   Html::footer();
+}

+ 47 - 0
front/locationquery.php

@@ -0,0 +1,47 @@
+<?php
+/*
+ * @version $Id: locationquery.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+*/
+
+include ("../../../inc/includes.php");
+
+Html::header(PluginArchiresArchires::getTypeName()." ".PluginArchiresLocationQuery::getTypeName(),
+             '',"tools","pluginarchiresmenu","location");
+
+$PluginArchiresLocationQuery = new PluginArchiresLocationQuery();
+
+if ($PluginArchiresLocationQuery->canView()
+    || Session::haveRight("config", UPDATE)) {
+   Search::show("PluginArchiresLocationQuery");
+
+} else {
+   Html::displayRightError();
+}
+
+Html::footer();

+ 104 - 0
front/networkequipmentquery.form.php

@@ -0,0 +1,104 @@
+<?php
+/*
+ * @version $Id: networkequipmentquery.form.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+ */
+
+include ("../../../inc/includes.php");
+
+if (!isset($_GET["id"])) {
+   $_GET["id"] = "";
+}
+if (isset($_GET["start"])) {
+   $start = $_GET["start"];
+} else {
+   $start = 0;
+}
+
+$PluginArchiresNetworkEquipmentQuery = new PluginArchiresNetworkEquipmentQuery();
+$PluginArchiresQueryType             = new PluginArchiresQueryType();
+
+if (isset($_POST["add"])) {
+   $PluginArchiresNetworkEquipmentQuery->check(-1,CREATE,$_POST);
+   $PluginArchiresNetworkEquipmentQuery->add($_POST);
+   Html::back();
+
+} else if (isset($_POST["delete"])) {
+   $PluginArchiresNetworkEquipmentQuery->check($_POST['id'],DELETE);
+   $PluginArchiresNetworkEquipmentQuery->delete($_POST);
+   Html::redirect(Toolbox::getItemTypeSearchURL('PluginArchiresNetworkEquipmentQuery'));
+
+} else if (isset($_POST["restore"])) {
+   $PluginArchiresNetworkEquipmentQuery->check($_POST['id'],PURGE);
+   $PluginArchiresNetworkEquipmentQuery->restore($_POST);
+   Html::redirect(Toolbox::getItemTypeSearchURL('PluginArchiresNetworkEquipmentQuery'));
+
+} else if (isset($_POST["purge"])) {
+   $PluginArchiresNetworkEquipmentQuery->check($_POST['id'],PURGE);
+   $PluginArchiresNetworkEquipmentQuery->delete($_POST,1);
+   Html::redirect(Toolbox::getItemTypeSearchURL('PluginArchiresNetworkEquipmentQuery'));
+
+} else if (isset($_POST["update"])) {
+   $PluginArchiresNetworkEquipmentQuery->check($_POST['id'],UPDATE);
+   $PluginArchiresNetworkEquipmentQuery->update($_POST);
+   Html::back();
+
+} else if (isset($_POST["duplicate"])) {
+   $PluginArchiresNetworkEquipmentQuery->check($_POST['id'],CREATE);
+   unset($_POST['id']);
+   $PluginArchiresNetworkEquipmentQuery->add($_POST);
+   Html::back();
+
+} else if (isset($_POST["addtype"])) {
+   if ($PluginArchiresQueryType->canCreate()) {
+      $PluginArchiresQueryType->addType('PluginArchiresNetworkEquipmentQuery', $_POST['type'],
+                                        $_POST['_itemtype'], $_POST['query']);
+   }
+   Html::back();
+
+} else if (isset($_POST["deletetype"])) {
+   if ($PluginArchiresQueryType->canCreate()) {
+      $PluginArchiresQueryType->getFromDB($_POST["id"],-1);
+
+      foreach ($_POST["item"] as $key => $val) {
+         if ($val == 1) {
+            $PluginArchiresQueryType->delete(['id' => $key]);
+         }
+      }
+   }
+   Html::back();
+
+} else {
+   $PluginArchiresNetworkEquipmentQuery->checkGlobal(READ);
+
+   Html::header(PluginArchiresArchires::getTypeName()." ".PluginArchiresNetworkEquipmentQuery::getTypeName(),
+                '',"tools","pluginarchiresmenu","networkequipment");
+
+   $PluginArchiresNetworkEquipmentQuery->display($_GET);
+
+   Html::footer();
+}

+ 47 - 0
front/networkequipmentquery.php

@@ -0,0 +1,47 @@
+<?php
+/*
+ * @version $Id: networkequipmentquery.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+*/
+
+include ("../../../inc/includes.php");
+
+Html::header(PluginArchiresArchires::getTypeName()." ".PluginArchiresNetworkEquipmentQuery::getTypeName(),
+             '',"tools","pluginarchiresmenu","networkequipment");
+
+$PluginArchiresNetworkEquipmentQuery = new PluginArchiresNetworkEquipmentQuery();
+
+if ($PluginArchiresNetworkEquipmentQuery->canView()
+    || Session::haveRight("config", UPDATE)) {
+   Search::show("PluginArchiresNetworkEquipmentQuery");
+
+} else {
+   Html::displayRightError();
+}
+
+Html::footer();

+ 84 - 0
front/view.form.php

@@ -0,0 +1,84 @@
+<?php
+/*
+ * @version $Id: view.form.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+ */
+
+include ("../../../inc/includes.php");
+
+if (!isset($_GET["id"])) {
+   $_GET["id"] = "";
+}
+
+if (isset($_GET["start"])) {
+   $start = $_GET["start"];
+} else {
+   $start = 0;
+}
+$PluginArchiresView = new PluginArchiresView();
+
+if (isset($_POST["add"])) {
+   $PluginArchiresView->check(-1, CREATE,$_POST);
+   $PluginArchiresView->add($_POST);
+   Html::back();
+
+} else if (isset($_POST["delete"])) {
+   $PluginArchiresView->check($_POST['id'],DELETE);
+   $PluginArchiresView->delete($_POST);
+   Html::redirect(Toolbox::getItemTypeSearchURL('PluginArchiresView'));
+
+} else if (isset($_POST["restore"])) {
+   $PluginArchiresView->check($_POST['id'],PURGE);
+   $PluginArchiresView->restore($_POST);
+   Html::redirect(Toolbox::getItemTypeSearchURL('PluginArchiresView'));
+
+} else if (isset($_POST["purge"])) {
+   $PluginArchiresView->check($_POST['id'],PURGE);
+   $PluginArchiresView->delete($_POST,1);
+   Html::redirect(Toolbox::getItemTypeSearchURL('PluginArchiresView'));
+
+} else if (isset($_POST["update"])) {
+   $PluginArchiresView->check($_POST['id'],UPDATE);
+   $PluginArchiresView->update($_POST);
+   Html::back();
+
+} else if (isset($_POST["duplicate"])) {
+   $PluginArchiresView->check($_POST['id'],CREATE);
+   unset($_POST['id']);
+   $PluginArchiresView->add($_POST);
+   Html::back();
+
+} else {
+   $PluginArchiresView->checkGlobal(READ);
+
+   Html::header(PluginArchiresView::getTypeName(),'',"tools","pluginarchiresmenu","view");
+
+   $PluginArchiresView->display($_GET);
+
+   Html::footer();
+}

+ 47 - 0
front/view.php

@@ -0,0 +1,47 @@
+<?php
+/*
+ * @version $Id: view.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+*/
+
+include ("../../../inc/includes.php");
+
+Html::header(PluginArchiresView::getTypeName(),'',"tools", "pluginarchiresmenu", "view");
+
+$PluginArchiresView = new PluginArchiresView();
+
+if ($PluginArchiresView->canView()
+    || Session::haveRight("config", UPDATE)) {
+
+   Search::show("PluginArchiresView");
+
+} else {
+   Html::displayRightError();
+}
+
+Html::footer();

+ 887 - 0
hook.php

@@ -0,0 +1,887 @@
+<?php
+/*
+ * @version $Id: hook.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2019 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+ */
+
+function plugin_archires_install() {
+   global $DB;
+
+   include_once (GLPI_ROOT."/plugins/archires/inc/profile.class.php");
+   $update = false;
+
+
+   if (!$DB->tableExists("glpi_plugin_archires_config")
+       && !$DB->tableExists("glpi_plugin_archires_views")) {
+      $DB->runFile(GLPI_ROOT ."/plugins/archires/sql/empty-2.2.sql");
+
+   } else {
+      $update = true;
+
+      // update to 1.3
+      if ($DB->tableExists("glpi_plugin_archires_display")
+          && !$DB->fieldExists("glpi_plugin_archires_display","display_ports")) {
+
+         $migration = new Migration(13);
+
+         $migration->addField("glpi_plugin_archires_display", "display_ports",
+                              "ENUM('1', '0') NOT NULL DEFAULT '0'");
+
+         $migration->executeMigration();
+      }
+
+      // update to 1.4
+      if ($DB->tableExists("glpi_plugin_archires_display")
+          && !$DB->tableExists("glpi_plugin_archires_profiles")) {
+
+         plugin_archires_updateTo14();
+      }
+
+      // update to 1.5
+      if ($DB->tableExists("glpi_plugin_archires_display")
+          && !$DB->tableExists("glpi_plugin_archires_image_device")) {
+
+         plugin_archires_updateTo15();
+      }
+
+      // update to 1.7.0
+      if ($DB->tableExists("glpi_plugin_archires_profiles")
+          && $DB->fieldExists("glpi_plugin_archires_profiles","interface")) {
+
+         plugin_archires_updateTo170();
+      }
+
+      // update to 1.7.2
+      if ($DB->tableExists("glpi_plugin_archires_config")
+          && $DB->FieldExists("glpi_plugin_archires_config","system")) {
+
+         $migration = new Migration(172);
+
+         $migration->dropField("glpi_plugin_archires_config", "system");
+
+         $migration->executeMigration();
+      }
+
+      // update to 1.8.0
+      if (!$DB->tableExists("glpi_plugin_archires_views")) {
+         plugin_archires_updateTo180();
+      }
+
+      // update to 2.1.0
+      if ($DB->tableExists("glpi_plugin_archires_appliancequeries")
+            && !$DB->fieldExists("glpi_plugin_archires_appliancequeries", "plugin_appliances_appliances_id")) {
+         plugin_archires_updateTo210();
+      }
+
+      // Update 2.2
+      if ($DB->tableExists("glpi_plugin_archires_profiles")) {
+         //Add new rights in glpi_profilerights table
+         $profileRight = new ProfileRight();
+         $query = ['FROM' => 'glpi_plugin_archires_profiles'];
+
+         foreach ($DB->request($query) as $data) {
+            $right['profiles_id']   = $data['profiles_id'];
+            $right['name']          = "plugin_archires";
+            $droit                  = $data['archires'];
+            if ($droit == 'r') {
+               $right['rights'] = 1;
+            } else if ($droit == 'w') {
+               $right['rights'] = ALLSTANDARDRIGHT;
+            }
+            $profileRight->add($right);
+         }
+         $DB->query("DROP TABLE `glpi_plugin_archires_profiles`");
+      }
+   }
+
+   $rep_files_archires = realpath(GLPI_PLUGIN_DOC_DIR)."/archires";
+   if (!is_dir($rep_files_archires)
+       && !mkdir($rep_files_archires)) {
+      die(sprintf(__('Failed to create the directory %s. Verify that you have the correct permission'),
+                  $rep_files_archires));
+   }
+
+   PluginArchiresProfile::createFirstAccess($_SESSION['glpiactiveprofile']['id']);
+   return true;
+}
+
+
+function plugin_archires_updateTo14() {
+   global $DB;
+
+   $migration = new Migration(14);
+
+   if (!$DB->tableExists("glpi_plugin_archires_color")) {
+      $query = "CREATE TABLE `glpi_plugin_archires_color` (
+                  `ID` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+                  `iface` INT( 11 ) NOT NULL ,
+                  `color` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL
+                ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci";
+      $DB->queryOrDie($query,'1.4 add glpi_plugin_archires_color '.$DB->error());
+   }
+
+   if (!$DB->tableExists("glpi_plugin_archires_profiles")) {
+      $query = "CREATE TABLE `glpi_plugin_archires_profiles` (
+                  `ID` int(11) NOT NULL auto_increment,
+                  `name` varchar(255) collate utf8_unicode_ci default NULL,
+                  `interface` varchar(50) collate utf8_unicode_ci NOT NULL default 'archires',
+                  `is_default` enum('0','1') NOT NULL default '0',
+                  `archires` char(1) default NULL,
+                  PRIMARY KEY  (`ID`),
+                  KEY `interface` (`interface`)
+                ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci";
+      $DB->queryorDie($query,'1.4 add glpi_plugin_archires_profiles '.$DB->error());
+
+      $query = "INSERT INTO `glpi_plugin_archires_profiles`
+                       (`ID`, `name` , `interface`, `is_default`, `archires`)
+                VALUES ('1', 'post-only', 'archires', '1', NULL),
+                       ('2', 'normal', 'archires', '0', NULL),
+                       ('3', 'admin', 'archires', '0', 'r'),
+                       ('4', 'super-admin', 'archires', '0', 'r')";
+      $DB->queryOrDie($query, '1.4 insert into glpi_plugin_archires_profiles '.$DB->error());
+   }
+
+   $migration->addField("glpi_plugin_archires_display", "display_ip",
+                        "ENUM('1', '0') NOT NULL DEFAULT '0'");
+   $migration->addField("glpi_plugin_archires_display", "system",
+                        "ENUM('1', '0') NOT NULL DEFAULT '0'");
+
+   $migration->executeMigration();
+}
+
+
+function plugin_archires_updateTo15() {
+   global $DB;
+
+   $migration = new Migration(15);
+
+   $migration->changeField("glpi_plugin_archires_profiles", "is_default", "is_default",
+                           "smallint(6) NOT NULL default '0'");
+
+   $query = "UPDATE `glpi_plugin_archires_profiles`
+             SET `is_default` = '0'
+             WHERE `is_default` = '1'";
+   $DB->queryOrDie($query,'1.5 insert into glpi_plugin_archires_profiles '.$DB->error());
+
+   $query = "UPDATE `glpi_plugin_archires_profiles`
+             SET `is_default` = '1'
+             WHERE `is_default` = '2'";
+   $DB->queryOrDie($query, '1.5 insert into glpi_plugin_archires_profiles '.$DB->error());
+
+   $migration->renameTable("glpi_plugin_archires_color", "glpi_plugin_archires_color_iface");
+
+   $migration->renameTable("glpi_plugin_archires_config", "glpi_plugin_archires_image_device");
+
+   $migration->dropTable("glpi_plugin_archires_display");
+
+   if (!$DB->tableExists("glpi_plugin_archires_color_state")) {
+      $query = "CREATE TABLE `glpi_plugin_archires_color_state` (
+                  `ID` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+                  `state` INT( 11 ) NOT NULL ,
+                  `color` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL
+                ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci";
+      $DB->queryOrDie($query, '1.5 create glpi_plugin_archires_color_state '.$DB->error());
+   }
+
+   if (!$DB->tableExists("glpi_plugin_archires_query_location")) {
+      $query = "CREATE TABLE `glpi_plugin_archires_query_location` (
+                  `ID` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+                  `FK_entities` int(11) NOT NULL default '0',
+                  `name` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+                  `location` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL DEFAULT '0',
+                  `child` smallint(6) NOT NULL default '0',
+                  `network` INT( 11 ) NOT NULL DEFAULT '0',
+                  `status` INT( 11 ) NOT NULL DEFAULT '0',
+                  `FK_group` INT( 11 ) NOT NULL DEFAULT '0',
+                  `FK_config` INT( 11 ) NOT NULL DEFAULT '0',
+                  `FK_vlan` INT( 11 ) NOT NULL DEFAULT '0',
+                  `link` smallint(6) NOT NULL default '1',
+                  `notes` LONGTEXT,
+                  `deleted` smallint(6) NOT NULL default '0'
+                ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci";
+      $DB->queryOrDie($query, '1.5 create glpi_plugin_archires_query_location '.$DB->error());
+   }
+
+   if (!$DB->tableExists("glpi_plugin_archires_query_switch")) {
+      $query = "CREATE TABLE `glpi_plugin_archires_query_switch` (
+                  `ID` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+                  `FK_entities` int(11) NOT NULL default '0',
+                  `name` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+                  `switch` INT( 11 ) NOT NULL DEFAULT '0',
+                  `network` INT( 11 ) NOT NULL DEFAULT '0',
+                  `status` INT( 11 ) NOT NULL DEFAULT '0',
+                  `FK_group` INT( 11 ) NOT NULL DEFAULT '0',
+                  `FK_config` INT( 11 ) NOT NULL DEFAULT '0',
+                  `FK_vlan` INT( 11 ) NOT NULL DEFAULT '0',
+                  `link` smallint(6) NOT NULL default '1',
+                  `notes` LONGTEXT,
+                  `deleted` smallint(6) NOT NULL default '0'
+                ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci";
+      $DB->queryOrDie($query, '1.5 create glpi_plugin_archires_query_switch '.$DB->error());
+   }
+
+   if (!$DB->tableExists("glpi_plugin_archires_query_applicatifs")) {
+      $query = "CREATE TABLE `glpi_plugin_archires_query_applicatifs` (
+                  `ID` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+                  `FK_entities` int(11) NOT NULL default '0',
+                  `name` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+                  `applicatifs` INT( 11 ) NOT NULL DEFAULT '0',
+                  `network` INT( 11 ) NOT NULL DEFAULT '0',
+                  `status` INT( 11 ) NOT NULL DEFAULT '0',
+                  `FK_group` INT( 11 ) NOT NULL DEFAULT '0',
+                  `FK_config` INT( 11 ) NOT NULL DEFAULT '0',
+                  `FK_vlan` INT( 11 ) NOT NULL DEFAULT '0',
+                  `link` smallint(6) NOT NULL default '1',
+                  `notes` LONGTEXT,
+                  `deleted` smallint(6) NOT NULL default '0'
+                ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci";
+      $DB->queryOrDie($query, '1.5 create glpi_plugin_archires_query_applicatifs '.$DB->error());
+   }
+
+   if (!$DB->tableExists("glpi_plugin_archires_query_type")) {
+      $query = "CREATE TABLE `glpi_plugin_archires_query_type` (
+                  `ID` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+                  `type_query` INT( 11 ) NOT NULL ,
+                  `type` INT( 11 ) NOT NULL ,
+                  `device_type` INT( 11 ) NOT NULL,
+                  `FK_query` INT( 11 ) NOT NULL
+                ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci";
+      $DB->queryOrDie($query,'1.5 create glpi_plugin_archires_query_type '.$DB->error());
+   }
+
+   if (!$DB->tableExists("glpi_plugin_archires_config")) {
+      $query = "CREATE TABLE `glpi_plugin_archires_config` (
+                  `ID` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+                  `FK_entities` int(11) NOT NULL default '0',
+                  `name` VARCHAR( 250 ) collate utf8_unicode_ci NOT NULL,
+                  `computer` smallint(6) NOT NULL default '0',
+                  `networking` smallint(6) NOT NULL default '0',
+                  `printer` smallint(6) NOT NULL default '0',
+                  `peripheral` smallint(6) NOT NULL default '0',
+                  `phone` smallint(6) NOT NULL default '0',
+                  `display_ports` smallint(6) NOT NULL default '0',
+                  `display_ip` smallint(6) NOT NULL default '0',
+                  `display_type` smallint(6) NOT NULL default '0',
+                  `display_state` smallint(6) NOT NULL default '0',
+                  `display_location` smallint(6) NOT NULL default '0',
+                  `display_entity` smallint(6) NOT NULL default '0',
+                  `system` smallint(6) NOT NULL default '0',
+                  `engine` smallint(6) NOT NULL default '0',
+                  `format` smallint(6) NOT NULL default '0',
+                  `deleted` smallint(6) NOT NULL default '0'
+                ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci";
+      $DB->queryOrDie($query, '1.5 create glpi_plugin_archires_config '.$DB->error());
+   }
+
+   $query = "INSERT INTO `glpi_plugin_archires_config`
+                    (`ID`,`FK_entities`,`name`, `computer` , `networking`, `printer`, `peripheral`,
+                     `phone`, `display_ports`, `display_ip`, `display_type`, `display_state`,
+                     `display_location`, `display_entity`, `system`,`engine`, `format`)
+             VALUES ('1', '0', 'default', '1', '1', '1', '1', '1', '0', '0', '0', '0', '0', '0',
+                     '0', '0', '1')";
+   $DB->queryOrDie($query, '1.5 insert into glpi_plugin_archires_config '.$DB->error());
+
+   $query = "INSERT INTO `glpi_displaypreferences`
+                    (`ID` , `type` , `num` , `rank` , `FK_users` )
+             VALUES (NULL, '3000', '2', '1', '0'),
+                    (NULL, '3000', '3', '2', '0'),
+                    (NULL, '3000', '4', '3', '0'),
+                    (NULL, '3000', '5', '4', '0'),
+                    (NULL, '3000', '6', '5', '0'),
+                    (NULL, '3000', '7', '6', '0'),
+                    (NULL, '3000', '8', '7', '0'),
+                    (NULL, '3000', '9', '8', '0'),
+                    (NULL, '3001', '2', '1', '0'),
+                    (NULL, '3001', '3', '2', '0'),
+                    (NULL, '3001', '4', '3', '0'),
+                    (NULL, '3001', '5', '4', '0'),
+                    (NULL, '3001', '6', '5', '0'),
+                    (NULL, '3001', '7', '6', '0'),
+                    (NULL, '3001', '8', '7', '0'),
+                    (NULL, '3002', '2', '1', '0'),
+                    (NULL, '3002', '3', '2', '0'),
+                    (NULL, '3002', '4', '3', '0'),
+                    (NULL, '3002', '5', '4', '0'),
+                    (NULL, '3002', '6', '5', '0'),
+                    (NULL, '3002', '7', '6', '0'),
+                    (NULL, '3002', '8', '7', '0')";
+   $DB->queryOrDie($query, '1.5 insert into glpi_displaypreferences '.$DB->error());
+
+   $migration->executeMigration();
+}
+
+
+function plugin_archires_updateTo170() {
+   global $DB;
+
+   $migration = new Migration(170);
+
+   $migration->addKey("glpi_plugin_archires_query_location", "deleted");
+
+   $migration->addKey("glpi_plugin_archires_query_switch", "deleted");
+
+   $migration->addKey("glpi_plugin_archires_query_applicatifs", "deleted");
+
+   $migration->addKey("glpi_plugin_archires_image_device", "device_type");
+
+   $migration->addKey("glpi_plugin_archires_query_type", "FK_query");
+   $migration->addKey("glpi_plugin_archires_query_type", "type_query");
+   $migration->addKey("glpi_plugin_archires_query_type", "type");
+   $migration->addKey("glpi_plugin_archires_query_type", "device_type");
+
+   $migration->addKey("glpi_plugin_archires_color_iface", "iface");
+
+   $migration->addKey("glpi_plugin_archires_config", "deleted");
+   $migration->addKey("glpi_plugin_archires_config", "FK_entities");
+   $migration->addKey("glpi_plugin_archires_config", "name");
+   $migration->addField("glpi_plugin_archires_config", "color", "smallint(6) NOT NULL default '0'");
+
+   if (!$DB->tableExists("glpi_plugin_archires_color_vlan")) {
+      $query = "CREATE TABLE `glpi_plugin_archires_color_vlan` (
+                  `ID` INT( 11 ) NOT NULL auto_increment,
+                  `vlan` INT( 11 ) NOT NULL ,
+                  `color` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+                  PRIMARY KEY  (`ID`)
+                ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci";
+      $DB->queryOrDie($query, '1.7.0 create glpi_plugin_archires_color_vlan '.$DB->error());
+   }
+
+   $migration->dropField("glpi_plugin_archires_profiles", "interface");
+   $migration->dropField("glpi_plugin_archires_profiles", "is_default");
+
+   $migration->changeField("glpi_plugin_archires_query_location", "`status", "state", 'integer');
+
+   $migration->changeField("glpi_plugin_archires_query_switch", "`status", "state", 'integer');
+
+   $migration->changeField("glpi_plugin_archires_query_applicatifs", "`status", "state", 'integer');
+
+   $migration->executeMigration();
+}
+
+
+function plugin_archires_updateTo180() {
+
+   $migration = new Migration(180);
+
+   $migration->renameTable("glpi_plugin_archires_query_location",
+                           "glpi_plugin_archires_locationqueries");
+
+   $migration->renameTable("glpi_plugin_archires_query_switch",
+                           "glpi_plugin_archires_networkequipmentqueries");
+
+   $migration->renameTable("glpi_plugin_archires_query_applicatifs",
+                           "glpi_plugin_archires_appliancequeries");
+
+   $migration->renameTable("glpi_plugin_archires_image_device", "glpi_plugin_archires_imageitems");
+
+   $migration->renameTable("glpi_plugin_archires_query_type", "glpi_plugin_archires_querytypes");
+
+   $migration->renameTable("glpi_plugin_archires_color_iface",
+                           "glpi_plugin_archires_networkinterfacecolors");
+
+   $migration->renameTable("glpi_plugin_archires_color_state", "glpi_plugin_archires_statecolors");
+
+   $migration->renameTable("glpi_plugin_archires_color_vlan", "glpi_plugin_archires_vlancolors");
+
+   $migration->renameTable("glpi_plugin_archires_config", "glpi_plugin_archires_views");
+
+
+   $migration->dropKey("glpi_plugin_archires_locationqueries", "deleted");
+   $migration->changeField("glpi_plugin_archires_locationqueries", "ID", "id", 'autoincrement');
+   $migration->changeField("glpi_plugin_archires_locationqueries", "name", "name", 'string');
+   $migration->changeField("glpi_plugin_archires_locationqueries", "FK_entities", "entities_id",
+                           'integer');
+   $migration->changeField("glpi_plugin_archires_locationqueries", "location", "locations_id",
+                           'integer', ['comment' => 'RELATION to glpi_locations (id)']);
+   $migration->changeField("glpi_plugin_archires_locationqueries", "network", "networks_id",
+                           'integer', ['comment' => 'RELATION to glpi_networks (id)']);
+   $migration->changeField("glpi_plugin_archires_locationqueries", "state", "states_id",
+                           'integer', ['comment' => 'RELATION to glpi_states (id)']);
+   $migration->changeField("glpi_plugin_archires_locationqueries", "FK_group", "groups_id",
+                           'integer', ['comment' => 'RELATION to glpi_groups (id)']);
+   $migration->changeField("glpi_plugin_archires_locationqueries", "FK_config",
+                           "plugin_archires_views_id", 'integer',
+                           ['comment' => 'RELATION to glpi_plugin_archires_views (id)']);
+   $migration->changeField("glpi_plugin_archires_locationqueries", "FK_vlan", "vlans_id",
+                           'integer', ['comment' => 'RELATION to glpi_vlans (id)']);
+   $migration->changeField("glpi_plugin_archires_locationqueries", "deleted", "is_deleted", 'bool');
+   $migration->changeField("glpi_plugin_archires_locationqueries", "notes", "notepad", 'longtext');
+   $migration->dropField("glpi_plugin_archires_locationqueries", "link");
+   $migration->addKey("glpi_plugin_archires_locationqueries", "name");
+   $migration->addKey("glpi_plugin_archires_locationqueries", "entities_id");
+   $migration->addKey("glpi_plugin_archires_locationqueries", "locations_id");
+   $migration->addKey("glpi_plugin_archires_locationqueries", "networks_id");
+   $migration->addKey("glpi_plugin_archires_locationqueries", "groups_id");
+   $migration->addKey("glpi_plugin_archires_locationqueries", "plugin_archires_views_id");
+   $migration->addKey("glpi_plugin_archires_locationqueries", "states_id");
+   $migration->addKey("glpi_plugin_archires_locationqueries", "vlans_id");
+   $migration->addKey("glpi_plugin_archires_locationqueries", "is_deleted");
+
+
+   $migration->dropKey("glpi_plugin_archires_networkequipmentqueries", "deleted");
+   $migration->changeField("glpi_plugin_archires_networkequipmentqueries", "ID", "id",
+                           'autoincrement');
+   $migration->changeField("glpi_plugin_archires_networkequipmentqueries", "name", "name", 'string');
+   $migration->changeField("glpi_plugin_archires_networkequipmentqueries", "FK_entities",
+                           "entities_id", 'integer');
+   $migration->changeField("glpi_plugin_archires_networkequipmentqueries", "switch",
+                           "networkequipments_id", 'integer',
+                           ['comment' => 'RELATION to glpi_networkequipments (id)']);
+   $migration->changeField("glpi_plugin_archires_networkequipmentqueries", "network", "networks_id",
+                           'integer', ['comment' => 'RELATION to glpi_networks (id)']);
+   $migration->changeField("glpi_plugin_archires_networkequipmentqueries", "state", "states_id",
+                           'integer', ['comment' => 'RELATION to glpi_states (id)']);
+   $migration->changeField("glpi_plugin_archires_networkequipmentqueries", "FK_group", "groups_id",
+                           'integer', ['comment' => 'RELATION to glpi_groups (id)']);
+   $migration->changeField("glpi_plugin_archires_networkequipmentqueries", "FK_config",
+                           "plugin_archires_views_id", 'integer',
+                           ['comment' => 'RELATION to glpi_plugin_archires_views (id)']);
+   $migration->changeField("glpi_plugin_archires_networkequipmentqueries", "FK_vlan", "vlans_id",
+                           'integer', ['comment' => 'RELATION to glpi_vlans (id)']);
+   $migration->changeField("glpi_plugin_archires_networkequipmentqueries", "deleted", "is_deleted",
+                           'bool');
+   $migration->changeField("glpi_plugin_archires_networkequipmentqueries", "notes", "notepad",
+                           'longtext');
+   $migration->dropField("glpi_plugin_archires_networkequipmentqueries", "link");
+   $migration->addKey("glpi_plugin_archires_networkequipmentqueries", "name");
+   $migration->addKey("glpi_plugin_archires_networkequipmentqueries", "entities_id");
+   $migration->addKey("glpi_plugin_archires_networkequipmentqueries", "networkequipments_id");
+   $migration->addKey("glpi_plugin_archires_networkequipmentqueries", "networks_id");
+   $migration->addKey("glpi_plugin_archires_networkequipmentqueries", "groups_id");
+   $migration->addKey("glpi_plugin_archires_networkequipmentqueries", "plugin_archires_views_id");
+   $migration->addKey("glpi_plugin_archires_networkequipmentqueries", "states_id");
+   $migration->addKey("glpi_plugin_archires_networkequipmentqueries", "vlans_id");
+   $migration->addKey("glpi_plugin_archires_networkequipmentqueries", "is_deleted");
+
+
+   $migration->dropKey("glpi_plugin_archires_appliancequeries", "deleted");
+   $migration->changeField("glpi_plugin_archires_appliancequeries", "ID", "id", 'autoincrement');
+   $migration->changeField("glpi_plugin_archires_appliancequeries", "name", "name", 'string');
+   $migration->changeField("glpi_plugin_archires_appliancequeries", "FK_entities", "entities_id",
+                           'integer');
+   $migration->changeField("glpi_plugin_archires_appliancequeries", "applicatifs", "appliances_id",
+                           'integer', ['comment' => 'RELATION to glpi_plugin_appliances (id)']);
+   $migration->changeField("glpi_plugin_archires_appliancequeries", "network", "networks_id",
+                           'integer', ['comment' => 'RELATION to glpi_networks (id)']);
+   $migration->changeField("glpi_plugin_archires_appliancequeries", "state", "states_id",
+                           'integer', ['comment' => 'RELATION to glpi_states (id)']);
+   $migration->changeField("glpi_plugin_archires_appliancequeries", "FK_group", "groups_id",
+                           'integer', ['comment' => 'RELATION to glpi_groups (id)']);
+   $migration->changeField("glpi_plugin_archires_appliancequeries", "FK_config",
+                           "plugin_archires_views_id", 'integer',
+                           ['comment' => 'RELATION to glpi_plugin_archires_views (id)']);
+   $migration->changeField("glpi_plugin_archires_appliancequeries", "FK_vlan", "vlans_id",
+                           'integer', ['comment' => 'RELATION to glpi_vlans (id)']);
+   $migration->changeField("glpi_plugin_archires_appliancequeries", "deleted", "is_deleted", 'bool');
+   $migration->changeField("glpi_plugin_archires_appliancequeries", "notes", "notepad", 'longtext');
+   $migration->dropField("glpi_plugin_archires_appliancequeries", "link");
+   $migration->addKey("glpi_plugin_archires_appliancequeries", "name");
+   $migration->addKey("glpi_plugin_archires_appliancequeries", "entities_id");
+   $migration->addKey("glpi_plugin_archires_appliancequeries", "appliances_id");
+   $migration->addKey("glpi_plugin_archires_appliancequeries", "networks_id");
+   $migration->addKey("glpi_plugin_archires_appliancequeries", "groups_id");
+   $migration->addKey("glpi_plugin_archires_appliancequeries", "plugin_archires_views_id");
+   $migration->addKey("glpi_plugin_archires_appliancequeries", "states_id");
+   $migration->addKey("glpi_plugin_archires_appliancequeries", "vlans_id");
+   $migration->addKey("glpi_plugin_archires_appliancequeries", "is_deleted");
+
+
+   $migration->dropKey("glpi_plugin_archires_imageitems", "device_type");
+   $migration->changeField("glpi_plugin_archires_imageitems", "ID", "id", 'autoincrement');
+   $migration->changeField("glpi_plugin_archires_imageitems", "type", "type", 'integer');
+   $migration->changeField("glpi_plugin_archires_imageitems", "device_type", "itemtype",
+                           "varchar(100) collate utf8_unicode_ci NOT NULL",
+                           ['comment' => 'see .class.php file']);
+
+
+   $migration->dropKey("glpi_plugin_archires_querytypes", "FK_query");
+   $migration->dropKey("glpi_plugin_archires_querytypes", "type");
+   $migration->dropKey("glpi_plugin_archires_querytypes", "type_query");
+   $migration->dropKey("glpi_plugin_archires_querytypes", "device_type");
+   $migration->changeField("glpi_plugin_archires_querytypes", "ID", "id", 'autoincrement');
+   $migration->changeField("glpi_plugin_archires_querytypes", "type_query", "querytype",
+                           "varchar(100) collate utf8_unicode_ci NOT NULL",
+                           ['comment' => 'RELATION to the 3 type of archires (type)']);
+   $migration->changeField("glpi_plugin_archires_querytypes", "type", "type", 'integer');
+   $migration->changeField("glpi_plugin_archires_querytypes", "device_type", "itemtype",
+                           "varchar(100) collate utf8_unicode_ci NOT NULL",
+                           ['comment' => 'see .class.php file']);
+   $migration->changeField("glpi_plugin_archires_querytypes", "FK_query",
+                           "plugin_archires_queries_id", 'integer',
+                           ['comment' => 'RELATION to the 3 queries tables (id)']);
+   $migration->addKey("glpi_plugin_archires_querytypes", "querytype");
+   $migration->addKey("glpi_plugin_archires_querytypes", "type");
+   $migration->addKey("glpi_plugin_archires_querytypes", "itemtype");
+   $migration->addKey("glpi_plugin_archires_querytypes", "plugin_archires_queries_id");
+
+   $migration->migrationOneTable("glpi_plugin_archires_querytypes");
+
+   $query = "UPDATE `glpi_plugin_archires_querytypes`
+             SET `querytype` = 'PluginArchiresLocationQuery'
+             WHERE `querytype` = 0";
+   $DB->queryOrDie($query, '1.8.0 update glpi_plugin_archires_querytypes (querytype) '.$DB->error());
+
+   $query = "UPDATE `glpi_plugin_archires_querytypes`
+             SET `querytype` = 'PluginArchiresNetworkEquipmentQuery'
+             WHERE `querytype` = 1";
+   $DB->queryOrDie($query, '1.8.0 update glpi_plugin_archires_querytypes (querytype) '.$DB->error());
+
+   $query = "UPDATE `glpi_plugin_archires_querytypes`
+             SET `querytype` = 'PluginArchiresApplianceQuery'
+             WHERE `querytype` = 2";
+   $DB->queryOrDie($query, '1.8.0 update glpi_plugin_archires_querytypes (querytype) '.$DB->error());
+
+
+   $migration->dropKey("glpi_plugin_archires_networkinterfacecolors", "iface");
+   $migration->changeField("glpi_plugin_archires_networkinterfacecolors", "ID", "id",
+                           'autoincrement');
+   $migration->changeField("glpi_plugin_archires_networkinterfacecolors", "iface",
+                           "networkinterfaces_id", 'integer',
+                           ['comment' => 'RELATION to glpi_networkinterfaces (id)']);
+   $migration->addKey("glpi_plugin_archires_networkinterfacecolors", "networkinterfaces_id");
+
+
+   $migration->changeField("glpi_plugin_archires_statecolors", "ID", "id", 'autoincrement');
+   $migration->changeField("glpi_plugin_archires_statecolors", "state", "states_id", 'integer',
+                           ['comment' => 'RELATION to glpi_states (id)']);
+   $migration->addKey("glpi_plugin_archires_statecolors", "states_id");
+
+
+   $migration->changeField("glpi_plugin_archires_vlancolors", "ID", "id", 'autoincrement');
+   $migration->changeField("glpi_plugin_archires_vlancolors", "vlan", "vlans_id", 'integer',
+                           ['comment' => 'RELATION to glpi_vlans (id)']);
+   $migration->addKey("glpi_plugin_archires_vlancolors", "vlans_id");
+
+
+   $migration->dropKey("glpi_plugin_archires_views", "deleted");
+   $migration->dropKey("glpi_plugin_archires_views", "FK_entities");
+   $migration->changeField("glpi_plugin_archires_views", "ID", "id", 'autoincrement');
+   $migration->changeField("glpi_plugin_archires_views", "name", "name", 'string');
+   $migration->changeField("glpi_plugin_archires_views", "FK_entities", "entities_id", 'integer');
+   $migration->changeField("glpi_plugin_archires_views", "deleted", "is_deleted", 'bool');
+   $migration->addKey("glpi_plugin_archires_views", "entities_id");
+   $migration->addKey("glpi_plugin_archires_views", "is_deleted");
+
+
+   $migration->changeField("glpi_plugin_archires_profiles", "ID", "id", 'autoincrement');
+   $migration->addField("glpi_plugin_archires_profiles", "profiles_id", 'integer',
+                        ['comment' => 'RELATION to glpi_profiles (id)']);
+   $migration->changeField("glpi_plugin_archires_profiles", "archires", "archires", 'char');
+   $migration->addKey("glpi_plugin_archires_profiles", "profiles_id");
+
+   $query = "DELETE
+             FROM `glpi_displaypreferences`
+             WHERE `itemtype` = 3000 AND `num` = 9";
+   $DB->queryOrDie($query, '1.8.0 delete glpi_displaypreferences (itemtype) '.$DB->error());
+
+   $query = "DELETE
+             FROM `glpi_displaypreferences`
+             WHERE `itemtype` = 3001 AND `num` = 8";
+   $DB->queryOrDie($query, '1.8.0 delete glpi_displaypreferences (itemtype) '.$DB->error());
+
+   $query = "DELETE
+             FROM `glpi_displaypreferences`
+             WHERE `itemtype` = 3002 AND `num` = 8";
+   $DB->queryOrDie($query, '1.8.0 delete glpi_displaypreferences (itemtype) '.$DB->error());
+
+
+   $migration->executeMigration();
+}
+
+
+function plugin_archires_updateTo210() {
+
+   $migration = new Migration(210);
+
+   $migration->changeField("glpi_plugin_archires_appliancequeries", "appliances_id",
+                           "plugin_appliances_appliances_id",
+                           'integer', ['comment' => 'RELATION to glpi_plugin_appliances (id)']);
+
+   $migration->executeMigration();
+}
+
+
+function plugin_archires_uninstall() {
+   global $DB;
+
+   $tables = ["glpi_plugin_archires_imageitems",
+              "glpi_plugin_archires_views",
+              "glpi_plugin_archires_networkinterfacecolors",
+              "glpi_plugin_archires_vlancolors",
+              "glpi_plugin_archires_statecolors",
+              "glpi_plugin_archires_profiles",
+              "glpi_plugin_archires_locationqueries",
+              "glpi_plugin_archires_networkequipmentqueries",
+              "glpi_plugin_archires_appliancequeries",
+              "glpi_plugin_archires_querytypes"];
+
+   foreach ($tables as $table) {
+      $DB->query("DROP TABLE IF EXISTS `$table`;");
+   }
+   //old versions
+   $tables = ["glpi_plugin_archires_query_location",
+              "glpi_plugin_archires_query_switch",
+              "glpi_plugin_archires_query_applicatifs",
+              "glpi_plugin_archires_image_device",
+              "glpi_plugin_archires_query_type",
+              "glpi_plugin_archires_color_iface",
+              "glpi_plugin_archires_color_state",
+              "glpi_plugin_archires_config",
+              "glpi_plugin_archires_color_vlan"];
+
+   foreach ($tables as $table) {
+      $DB->query("DROP TABLE IF EXISTS `$table`;");
+   }
+
+   $rep_files_archires = GLPI_PLUGIN_DOC_DIR."/archires";
+
+   Toolbox::deleteDir($rep_files_archires);
+
+   $tables_glpi = ["glpi_displaypreferences",
+                   "glpi_documents_items",
+                   "glpi_bookmarks",
+                   "glpi_logs"];
+
+   foreach ($tables_glpi as $table_glpi)
+      $DB->query("DELETE FROM `$table_glpi`
+                  WHERE `itemtype` = 'PluginArchiresLocationQuery'
+                        OR `itemtype` = 'PluginArchiresNetworkEquipmentQuery'
+                        OR `itemtype` = 'PluginArchiresApplianceQuery'
+                        OR `itemtype` = 'PluginArchiresView';");
+
+   return true;
+}
+
+
+// Define dropdown relations
+function plugin_archires_getDatabaseRelations() {
+
+   $plugin = new Plugin();
+   if ($plugin->isActivated("archires")) {
+      return ["glpi_locations" => ["glpi_plugin_archires_locationqueries" => "locations_id"],
+
+              "glpi_networks"  => ["glpi_plugin_archires_locationqueries"         => "networks_id",
+                                   "glpi_plugin_archires_appliancequeries"        => "networks_id",
+                                   "glpi_plugin_archires_networkequipmentqueries" => "networks_id"],
+
+              "glpi_states"    => ["glpi_plugin_archires_locationqueries"          => "states_id",
+                                   "glpi_plugin_archires_appliancequeries"         => "states_id",
+                                   "glpi_plugin_archires_networkequipmentqueries"  => "states_id",
+                                   "glpi_plugin_archires_statecolors"              => "states_id"],
+
+              "glpi_groups"    => ["glpi_plugin_archires_locationqueries"          => "groups_id",
+                                   "glpi_plugin_archires_appliancequeries"         => "groups_id",
+                                   "glpi_plugin_archires_networkequipmentqueries"  => "groups_id"],
+
+              "glpi_vlans"     => ["glpi_plugin_archires_locationqueries"          => "vlans_id",
+                                   "glpi_plugin_archires_appliancequeries"         => "vlans_id",
+                                   "glpi_plugin_archires_networkequipmentqueries"  => "vlans_id",
+                                   "glpi_plugin_archires_vlancolors"               => "vlans_id"],
+
+              "glpi_entities"  => ["glpi_plugin_archires_locationqueries"          => "entities_id",
+                                   "glpi_plugin_archires_networkequipmentqueries"  => "entities_id",
+                                   "glpi_plugin_archires_appliancequeries"         => "entities_id",
+                                   "glpi_plugin_archires_views"                    => "entities_id"],
+
+              "glpi_plugin_archires_views"
+                               => ["glpi_plugin_archires_locationqueries"         => "plugin_archires_views_id",
+                                   "glpi_plugin_archires_networkequipmentqueries" => "plugin_archires_views_id",
+                                   "glpi_plugin_archires_appliancequeries"        => "plugin_archires_views_id"],
+
+              "glpi_plugin_appliances_appliances"
+                               => ["glpi_plugin_archires_appliancequeries" => "appliances_id"],
+
+              "glpi_profiles"  => ["glpi_plugin_addressing_profiles" => "profiles_id"],
+
+              "glpi_networkinterfaces"
+                               => ["glpi_plugin_archires_networkinterfacecolors" => "networkinterfaces_id"]];
+   }
+   return [];
+}
+
+
+////// SEARCH FUNCTIONS ///////() {
+
+function plugin_archires_giveItem($type,$ID,$data,$num) {
+
+   $searchopt = &Search::getOptions($type);
+
+   $table = $searchopt[$ID]["table"];
+   $field = $searchopt[$ID]["field"];
+
+   switch ($table.'.'.$field) {
+      case "glpi_locations.completename" :
+         if (empty($data["ITEM_$num"])) {
+            $out = __('All root locations', 'archires');
+         } else {
+            $out = $data["ITEM_$num"];
+         }
+         return $out;
+
+      case "glpi_networks.name" :
+      case "glpi_states.name" :
+      case "glpi_vlans.name" :
+         if (empty($data["ITEM_$num"])) {
+            $out = __('All');
+         } else {
+            $out = $data["ITEM_$num"];
+         }
+         return $out;
+
+      case "glpi_networkequipments.name" :
+      case "glpi_plugin_appliances_appliances.name" :
+         if (empty($data["ITEM_$num"])) {
+            $out = __('None');
+         } else {
+            $out = $data["ITEM_$num"];
+         }
+         return $out;
+
+      case "glpi_plugin_archires_views.display_ports" :
+         if (empty($data["ITEM_$num"])) {
+            $out = __('No');
+         } else if ($data["ITEM_$num"] == '1') {
+            $out = __('See numbers', 'archires');
+         } else if ($data["ITEM_$num"] == '2') {
+            $out = __('See names', 'archires');
+         }
+         return $out;
+
+      case "glpi_plugin_archires_views.engine" :
+         if (empty($data["ITEM_$num"])) {
+            $out = "Dot";
+         } else if ($data["ITEM_$num"] == '1') {
+            $out = "Neato";
+         }
+         return $out;
+
+      case "glpi_plugin_archires_views.format" :
+         if ($data["ITEM_$num"] == PluginArchiresView::PLUGIN_ARCHIRES_JPEG_FORMAT) {
+            $out = "jpeg";
+         } else if ($data["ITEM_$num"] == PluginArchiresView::PLUGIN_ARCHIRES_PNG_FORMAT) {
+            $out = "png";
+         } else if ($data["ITEM_$num"]  == PluginArchiresView::PLUGIN_ARCHIRES_GIF_FORMAT) {
+            $out = "gif";
+         }
+         return $out;
+
+      case "glpi_plugin_archires_views.color" :
+         if (empty($data["ITEM_$num"])) {
+            $out = __('Type of network', 'archires');
+         } else if ($data["ITEM_$num"] == '1') {
+            $out = __('VLAN');
+         }
+         return $out;
+   }
+   return "";
+}
+
+
+////// SPECIFIC MODIF MASSIVE FUNCTIONS ///////
+
+function plugin_archires_MassiveActions($type) {
+
+   // Specific one
+   switch ($type) {
+      case 'PluginArchiresLocationQuery' :
+      case 'PluginArchiresNetworkEquipmentQuery' :
+      case 'PluginArchiresApplianceQuery' :
+      case 'PluginArchiresView' :
+         return ["plugin_archires_duplicate" => __('Duplicate'),
+                 "plugin_archires_transfert" => __('Transfer')];
+   }
+   return [];
+}
+
+
+// How to display specific actions ?
+function plugin_archires_MassiveActionsDisplay($options=[]) {
+
+   switch ($options['itemtype']) {
+      case 'PluginArchiresLocationQuery':
+      case 'PluginArchiresNetworkEquipmentQuery' :
+      case 'PluginArchiresApplianceQuery' :
+      case 'PluginArchiresView':
+         switch ($options['action']) {
+            // No case for add_document : use GLPI core one
+            case "plugin_archires_duplicate" :
+            case "plugin_archires_transfert" :
+               Dropdown::show('Entity');
+               echo "&nbsp;<input type='submit' name='massiveaction' class='submit' value='".
+                     _sx('button', 'Post')."'>";
+               break;
+         }
+         break;
+   }
+   return "";
+}
+
+
+// How to process specific actions ?
+function plugin_archires_MassiveActionsProcess($data) {
+   global $DB;
+
+   switch ($data['action']) {
+      case 'plugin_archires_duplicate' :
+         if (($data['itemtype'] == 'PluginArchiresLocationQuery')
+             || ($data['itemtype']=='PluginArchiresNetworkEquipmentQuery')
+             || ($data['itemtype']=='PluginArchiresApplianceQuery')
+             || ($data['itemtype']=='PluginArchiresView')) {
+
+            $item = new $data['itemtype']();
+            foreach ($data['item'] as $key => $val) {
+               if (($val == 1) && $item->getFromDB($key)) {
+                  unset($item->fields["id"]);
+                  $item->fields["entities_id"] = $data["entities_id"];
+                  if ($item->can(-1,'w',$item->fields)) {
+                     $item->add($item->fields);
+                  }
+               }
+            }
+         }
+         break;
+
+      case 'plugin_archires_transfert' :
+         if (($data['itemtype']=='PluginArchiresLocationQuery')
+             || ($data['itemtype']=='PluginArchiresNetworkEquipmentQuery')
+             || ($data['itemtype']=='PluginArchiresApplianceQuery')
+             || ($data['itemtype']=='PluginArchiresView')) {
+
+            $item = new $data['itemtype']();
+            foreach ($data["item"] as $key => $val) {
+               if ($val == 1) {
+                  $values["id"]          = $key;
+                  $values["entities_id"] = $data['entities_id'];
+                  $item->update($values);
+
+               }
+            }
+         }
+         break;
+   }
+}

+ 317 - 0
inc/appliancequery.class.php

@@ -0,0 +1,317 @@
+<?php
+/*
+ * @version $Id: appliancequery.class.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+ */
+
+if (!defined('GLPI_ROOT')) {
+   die("Sorry. You can't access directly to this file");
+}
+
+class PluginArchiresApplianceQuery extends CommonDBTM {
+
+   static $rightname             = "plugin_archires";
+   protected $usenotepad         = true;
+
+
+   static function getTypeName($nb=0) {
+      return PluginAppliancesAppliance::getTypeName($nb);
+   }
+
+
+   function cleanDBonPurge() {
+
+      $querytype = new PluginArchiresQueryType();
+      $querytype->deleteByCriteria(['plugin_archires_queries_id' => $this->fields['id']]);
+   }
+
+
+   function rawSearchOptions() {
+
+      $tab = [];
+
+      $tab[] = ['id'             => 'common',
+                'name'           => self::getTypeName(2)];
+
+      $tab[] = ['id'             => '1',
+                'table'          => $this->getTable(),
+                'field'          =>'name',
+                'name'           => __('Name'),
+                'datatype'       => 'itemlink',
+                'itemlink_type'  => $this->getType()];
+
+      $tab[] = ['id'             => '2',
+                'table'          => 'glpi_plugin_appliances_appliances',
+                'field'          => 'name',
+                'name'           => PluginAppliancesAppliance::getTypeName(1),
+                'datatype'       => 'dropdown'];
+
+      $tab[] = ['id'             => '3',
+                'table'          => 'glpi_networks',
+                'field'          => 'name',
+                'name'           => _n('Network', 'Networks', 2),
+                'datatype'       => 'dropdown'];
+
+      $tab[] = ['id'             => '4',
+                'table'          => 'glpi_states',
+                'field'          => 'name',
+                'name'           => __('State'),
+                'datatype'       => 'dropdown'];
+
+      $tab[] = ['id'             => '5',
+                'table'          => 'glpi_groups',
+                'field'          => 'completename',
+                'name'           => __('Group'),
+                'datatype'       => 'dropdown'];
+
+      $tab[] = ['id'             => '6',
+                'table'          => 'glpi_vlans',
+                'field'          => 'name',
+                'name'           => __('VLAN'),
+                'datatype'       => 'dropdown'];
+
+      $tab[] = ['id'             => '7',
+               'table'           => 'glpi_plugin_archires_views',
+               'field'           => 'name',
+               'name'            => PluginArchiresView::getTypeName(1),
+               'datatype'        => 'dropdown'];
+
+      $tab[] = ['id'             => '30',
+               'table'           => $this->getTable(),
+               'field'           => 'id',
+               'name'            => __('ID'),
+               'datatype'        => 'number'];
+
+      $tab[] = ['id'             => '80',
+               'table'           => 'glpi_entities',
+               'field'           => 'completename',
+               'name'            => __('Entity'),
+               'datatype'        => 'dropdown'];
+
+   return $tab;
+   }
+
+
+   function prepareInputForAdd($input) {
+
+      if (!isset ($input["plugin_archires_views_id"])
+          || $input["plugin_archires_views_id"] == 0) {
+         Session::addMessageAfterRedirect(__('Thanks to specify a default used view', 'archires'),
+                                          false, ERROR);
+         return [];
+      }
+      return $input;
+   }
+
+
+   function defineTabs($options=[]) {
+
+      $ong = [];
+      $this->addDefaultFormTab($ong)
+         ->addStandardTab('PluginArchiresQueryType', $ong, $options)
+         ->addStandardTab('PluginArchiresView', $ong, $options)
+         ->addStandardTab('PluginArchiresPrototype', $ong, $options)
+         ->addStandardTab('Notepad',$ong, $options);
+
+      return $ong;
+   }
+
+
+   function showForm ($ID, $options=[]) {
+
+      $this->initForm($ID, $options);
+      $this->showFormHeader($options);
+
+      echo "<tr class='tab_bg_1'>";
+      echo "<td>".__('Name')."</td>";
+      echo "<td>";
+      Html::autocompletionTextField($this,"name");
+      echo "</td>";
+      echo "<td>".__('Group')."</td><td>";
+      Group::dropdown(['name'   => "groups_id",
+                       'value'  => $this->fields["groups_id"],
+                       'entity' => $this->fields["entities_id"]]);
+      echo "</td></tr>";
+
+      echo "<tr class='tab_bg_1'>";
+      echo "<td>".PluginAppliancesAppliance::getTypeName(1)."</td><td>";
+      Dropdown::show('PluginAppliancesAppliance',
+                     ['name'   => "appliances_id",
+                      'value'  => $this->fields["plugin_appliances_appliances_id"],
+                      'entity' => $this->fields["entities_id"]]);
+      echo "</td>";
+      echo "<td>".__('VLAN')."</td><td>";
+      Vlan::dropdown(['name'  => "vlans_id",
+                      'value' => $this->fields["vlans_id"]]);
+      echo "</td></tr>";
+
+      echo "<tr class='tab_bg_1'><td>".__('Network')."</td><td>";
+      Network::dropdown(['name'  => "networks_id",
+                         'value' => $this->fields["networks_id"]]);
+      echo "</td>";
+      echo "<td>".PluginArchiresView::getTypeName(1)."</td><td>";
+      //View
+      Dropdown::show('PluginArchiresView',
+                     ['name'  => "plugin_archires_views_id",
+                      'value' => $this->fields["plugin_archires_views_id"]]);
+      echo "</td></tr>";
+
+      echo "<tr class='tab_bg_1'><td>".__('State')."</td><td colspan='3'>";
+      State::dropdown(['name' => "states_id"]);
+      echo "</td></tr>";
+
+      $this->showFormButtons($options);
+
+      return true;
+   }
+
+
+   function Query ($ID,$PluginArchiresView,$for) {
+      global $DB;
+
+      $dbu = new DbUtils();
+
+      $this->getFromDB($ID);
+
+      $types   = [];
+      $devices = [];
+      $ports   = [];
+
+      if ($PluginArchiresView->fields["computer"] != 0) {
+         $types[] = 'Computer';
+      }
+      if ($PluginArchiresView->fields["printer"] != 0) {
+         $types[] = 'Printer';
+      }
+      if ($PluginArchiresView->fields["peripheral"] != 0) {
+         $types[] = 'Peripheral';
+      }
+      if ($PluginArchiresView->fields["phone"] != 0) {
+         $types[] = 'Phone';
+      }
+      if ($PluginArchiresView->fields["networking"] != 0) {
+         $types[] = 'NetworkEquipment';
+      }
+      foreach ($types as $key => $val) {
+         $fieldsnp = "`np`.`id`, `np`.`items_id`, `np`.`logical_number`, `np`.`instantiation_type`,
+                      `glpi_ipaddresses`.`name` AS ip, `ipn`.`netmask`, `np`.`name` AS namep";
+
+         $itemtable = $dbu->getTableForItemType($val);
+         $query = "SELECT `$itemtable`.`id` AS idc, $fieldsnp , `$itemtable`.`name`,
+                          `$itemtable`.`".getForeignKeyFieldForTable($dbu->getTableForItemType($val."Type"))."`
+                              AS `type`,
+                          `$itemtable`.`users_id`, `$itemtable`.`groups_id`, `$itemtable`.`contact`,
+                          `$itemtable`.`states_id`, `$itemtable`.`entities_id`,
+                          `$itemtable`.`locations_id`
+                   FROM `glpi_networkports` np,
+                        `$itemtable`,
+                        `glpi_ipnetworks` AS ipn,
+                        `glpi_plugin_appliances_appliances_items` app";
+
+         if ($this->fields["vlans_id"] > "0") {
+            $query .= ", `glpi_networkports_vlans` nv";
+         }
+
+         $query .= " LEFT JOIN `glpi_networknames`
+                        ON (`glpi_networknames`.`itemtype` = 'NetworkPort')
+                     LEFT JOIN `glpi_ipaddresses`
+                        ON (`glpi_ipaddresses`.`itemtype` = 'NetworkName'
+                            AND `glpi_networknames`.`id` = `glpi_ipaddresses`.`items_id`)
+                     WHERE `np`.`instantiation_type` = 'NetworkPortEthernet'
+                           AND `np`.`itemtype` = '$val'
+                           AND `np`.`items_id` = `$itemtable`.`id`
+                           AND `app`.`items_id` = `$itemtable`.`id`
+                           AND `$itemtable`.`is_deleted` = '0'
+                           AND `$itemtable`.`is_template` = '0'
+                           AND `np`.`id` = `glpi_networknames`.`items_id`".
+                           getEntitiesRestrictRequest(" AND",$itemtable);
+
+         if ($this->fields["vlans_id"] > "0") {
+            $query .= " AND `nv`.`networkports_id` = `np`.`id`
+                        AND `vlans_id` = '".$this->fields["vlans_id"]."'";
+         }
+         if (($this->fields["networks_id"] > "0")
+             && ($val != 'Phone')
+             && ($val != 'Peripheral')) {
+            $query .= " AND `$itemtable`.`networks_id` = '".$this->fields["networks_id"]."'";
+         }
+         if ($this->fields["states_id"] > "0") {
+            $query .= " AND `$itemtable`.`states_id` = '".$this->fields["states_id"]."'";
+         }
+         if ($this->fields["groups_id"] > "0") {
+            $query .= " AND `$itemtable`.`groups_id` = '".$this->fields["groups_id"]."'";
+         }
+
+         $query .= " AND `app`.`plugin_appliances_appliances_id` = '".$this->fields["plugin_appliances_appliances_id"]."'
+                     AND `app`.`itemtype` = '$val' ";
+
+         $PluginArchiresQueryType = new PluginArchiresQueryType();
+         $query .= $PluginArchiresQueryType->queryTypeCheck($this->getType(), $ID, $val);
+
+         $query .= "ORDER BY `glpi_ipaddresses`.`name` ASC ";
+
+         if ($result = $DB->request($query)) {
+            while ($data = $result->next()) {
+
+               if ($PluginArchiresView->fields["display_state"] != 0) {
+                  $devices[$val][$data["items_id"]]["states_id"] = $data["states_id"];
+               }
+               $devices[$val][$data["items_id"]]["type"]         = $data["type"];
+               $devices[$val][$data["items_id"]]["name"]         = $data["name"];
+               $devices[$val][$data["items_id"]]["users_id"]     = $data["users_id"];
+               $devices[$val][$data["items_id"]]["groups_id"]    = $data["groups_id"];
+               $devices[$val][$data["items_id"]]["contact"]      = $data["contact"];
+               $devices[$val][$data["items_id"]]["entity"]       = $data["entities_id"];
+               $devices[$val][$data["items_id"]]["locations_id"] = $data["locations_id"];
+
+               if ($data["ip"]) {
+                  if (!empty($devices[$val][$data["items_id"]]["ip"])) {
+                     $devices[$val][$data["items_id"]]["ip"]  .= " - ";
+                     $devices[$val][$data["items_id"]]["ip"]  .= $data["ip"];
+                  } else {
+                     $devices[$val][$data["items_id"]]["ip"]  = $data["ip"];
+                  }
+               }
+
+               $ports[$data["id"]]["items_id"]             = $data["items_id"];
+               $ports[$data["id"]]["logical_number"]       = $data["logical_number"];
+               $ports[$data["id"]]["ip"]                   = $data["ip"];
+               $ports[$data["id"]]["netmask"]              = $data["netmask"];
+               $ports[$data["id"]]["namep"]                = $data["namep"];
+               $ports[$data["id"]]["idp"]                  = $data["id"];
+               $ports[$data["id"]]["itemtype"]             = $val;
+            }
+         }
+      }
+      if ($for) {
+         return $devices;
+      }
+      return $ports;
+   }
+
+}

+ 119 - 0
inc/archires.class.php

@@ -0,0 +1,119 @@
+<?php
+/*
+ * @version $Id: archires.class.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+ */
+
+if (!defined('GLPI_ROOT')) {
+   die("Sorry. You can't access directly to this file");
+}
+
+class PluginArchiresArchires extends CommonDBTM {
+
+   static $rightname       = "plugin_archires";
+
+   protected $usenotepad   = true;
+
+
+   static function getTypeName($nb=0) {
+      return _n('Network Architecture', 'Network Architectures', $nb, 'archires');
+   }
+
+
+   static function showSummary() {
+
+      $dbu = new DbUtils();
+
+      echo "<div class='center'><table class='tab_cadre' cellpadding='5' width='50%'>";
+      echo "<tr><th>".__('Summary')."</th></tr>";
+
+      if ($dbu->countElementsInTable('glpi_plugin_archires_views',
+                                     ['entities_id' => $_SESSION["glpiactive_entity"]]) > 0) {
+
+         echo "<tr class='tab_bg_1'><td>";
+         echo "<a href='view.php'>".PluginArchiresView::getTypeName(2)."</a>";
+         echo "</td></tr>";
+
+         echo "<tr class='tab_bg_1'><td>";
+         echo "<a href='locationquery.php'>".
+                sprintf(__('%1$s - %2$s'), self::getTypeName(1),
+                        PluginArchiresLocationQuery::getTypeName(1))."</a>";
+         echo "</td></tr>";
+
+         echo "<tr class='tab_bg_1'><td>";
+         echo "<a href='networkequipmentquery.php'>".
+                sprintf(__('%1$s - %2$s'), self::getTypeName(1),
+                        PluginArchiresNetworkEquipmentQuery::getTypeName(1))."</a>";
+         echo "</td></tr>";
+
+         $plugin = new Plugin();
+         if ($plugin->isActivated("appliances")) {
+            echo "<tr class='tab_bg_1'><td>";
+            echo "<a href='appliancequery.php'>".
+                   sprintf(__('%1$s - %2$s'), self::getTypeName(1),
+                           PluginAppliancesAppliance::getTypeName(1))."</a>";
+            echo "</td></tr>";
+         }
+      } else {
+         echo "<tr class='tab_bg_1'><td>";
+         echo "<a href='view.form.php?new=1'>".__('Add view', 'archires')."</a>";
+         echo "</td></tr>";
+      }
+      echo "</table></div>";
+   }
+
+
+   function showAllItems($myname, $value_type=0, $value=0, $entity_restrict=-1) {
+      global $DB,$CFG_GLPI;
+
+      $types = ['Computer','NetworkEquipment','Peripheral','Phone','Printer'];
+      $rand  = mt_rand();
+
+      foreach ($types as $label) {
+         $item = new $label();
+         $params[$label] = $item->getTypeName();
+      }
+
+      Dropdown::showFromArray('_itemtype', $params, ['width'               => '80%',
+                                                     'rand'                => $rand,
+                                                     'display_emptychoice' => true]);
+
+      $field_id = Html::cleanId("dropdown__itemtype$rand");
+
+      $params = ['itemtype'       => '__VALUE__',
+                 'value'           => $value,
+                 'myname'          => $myname,
+                 'entity' => $entity_restrict];
+
+      echo "<span id='show_$myname$rand'>&nbsp;</span>\n";
+      Ajax::updateItemOnSelectEvent($field_id, "show_$myname$rand",
+                                    $CFG_GLPI["root_doc"]."/plugins/archires/ajax/dropdownAllItems.php",
+                                    $params);
+      return $rand;
+   }
+}

+ 214 - 0
inc/imageitem.class.php

@@ -0,0 +1,214 @@
+<?php
+/*
+ * @version $Id: imageitem.class.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/aarchires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+ */
+
+if (!defined('GLPI_ROOT')) {
+   die("Sorry. You can't access directly to this file");
+}
+
+class PluginArchiresImageItem extends CommonDBTM {
+
+   static $rightname  = "plugin_archires";
+
+
+   function getFromDBbyType($itemtype, $type) {
+      global $DB;
+
+      $query = ['FROM'  => $this->getTable(),
+                'WHERE' =>  ['itemtype' => $itemtype,
+                             'type'     => $type]];
+
+      if ($result = $DB->request($query)) {
+         if (count($result) != 1) {
+            return false;
+         }
+         $this->fields = $result->next();
+         if (is_array($this->fields) && count($this->fields)) {
+            return true;
+         }
+      }
+      return false;
+   }
+
+
+   function addItemImage($type,$itemtype,$img) {
+      global $DB;
+
+      $dbu = new DbUtils();
+
+      if ($type != '-1') {
+         if ($this->getfromDBbyType($itemtype, $type)) {
+            $this->update(['id'  => $this->fields['id'],
+                           'img' => $img]);
+         } else {
+            $this->add(['itemtype' => $itemtype,
+                        'type'     => $type,
+                        'img'      => $img]);
+         }
+      } else {
+         $query  = ['FROM' => $dbu->getTableForItemType($itemtype."Type")];
+
+         $result = $DB->request($query);
+         $i      = 0;
+         while ($i < count($result)) {
+            $row        = $result->next();
+            $type_table = $row['id'];
+            if ($this->getfromDBbyType($itemtype,$type_table)) {
+            $this->update(['id'  => $this->fields['id'],
+                           'img' => $img]);
+           } else {
+             $this->add(['itemtype' => $itemtype,
+                         'type'     => $type_table,
+                         'img'      => $img]);
+            }
+            $i++;
+         }
+      }
+   }
+
+
+   function showConfigForm() {
+      global $DB, $CFG_GLPI;
+
+      echo "<form method='post' action='./config.form.php'>";
+      echo "<table class='tab_cadre' cellpadding='5' width='50%'>";
+      echo "<tr><th colspan='4'>".__('Associate pictures with item types', 'archires')."</th></tr>";
+
+      echo "<tr class='tab_bg_1'><td>";
+      $PluginArchiresArchires = new PluginArchiresArchires();
+      $PluginArchiresArchires->showAllItems("type",0,0,$_SESSION["glpiactive_entity"]);
+      echo "</td><td>";
+      //file
+      $rep = "../pics/";
+      $dir = opendir($rep);
+
+      while ($f = readdir($dir)) {
+         if (is_file($rep.$f)) {
+            $values[$f] = $f;
+         }
+      }
+      Dropdown::showFromArray('img', $values);
+      closedir($dir);
+      Html::showToolTip(nl2br(__('Some types of items must be created so that the association can exist',
+                                 'archires')));
+      echo "</td><td>";
+
+      echo "<div class='center'><input type='submit' name='add' value=\""._sx('button', 'Add').
+             "\" class='submit'></div>";
+      echo "</td></tr>";
+      echo "</table>";
+      Html::closeForm();
+
+      $query = ['FROM'  => $this->getTable(),
+                'ORDER' => ['itemtype ASC', 'type ASC']];
+
+      if ($result = $DB->request($query)) {
+         $number = count($result);
+         if ($number) {
+            $rand = mt_rand();
+            echo "<div id='liste'>";
+            Html::openMassiveActionsForm('mass'.__CLASS__.$rand);
+            $massiveactionparams = ['num_displayed'    => $number,
+                                    'container'        => 'mass'.__CLASS__.$rand];
+            Html::showMassiveActions($massiveactionparams);
+
+            echo "<table class='tab_cadre' cellpadding='5' width='50%'>";
+            echo "<tr>";
+            echo "<th width='10'>";
+            Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand);
+            echo "</th>";
+            echo "<th class='left'>".__('Item')."</th>";
+            echo "<th class='left'>".__('Item type')."</th>";
+            echo "<th class='left'>".__('Picture', 'archires')."</th><th></th>";
+            echo "</tr>";
+
+            while ($ligne = $result->next()) {
+               $ID = $ligne["id"];
+               echo "<tr class='tab_bg_1'>";
+               echo "<td width='10'>";
+               $PluginArchiresArchires = new PluginArchiresArchires();
+               $item                   = new $ligne["itemtype"]();
+               Html::showMassiveActionCheckBox(__CLASS__, $ID);
+               echo "</td><td>".$item->getTypeName()."</td>";
+               $class     = $ligne["itemtype"]."Type";
+               $typeclass = new $class();
+               $typeclass->getFromDB($ligne["type"]);
+               $name = '';
+               if (isset($typeclass->fields["name"])) {
+                  $name = $typeclass->fields["name"];
+               }
+               echo "<td>".$name."</td>";
+               echo "<td><img src=\"".$CFG_GLPI["root_doc"]."/plugins/archires/pics/".$ligne["img"].
+                           "\" alt=\"".$ligne["img"]."\" title=\"".$ligne["img"]."\"></td>";
+               echo "<td width='10'>";
+               echo "</td>";
+            }
+
+            echo "</table>";
+            $massiveactionparams['ontop'] = false;
+            Html::showMassiveActions($massiveactionparams);
+            echo "</div>";
+            Html::closeForm();
+         }
+      }
+   }
+
+
+   function displayItemImage($type,$itemtype,$test) {
+      global $DB;
+
+      $path = "";
+      if ($test)
+         $path="../";
+
+      $image_name = $path."pics/nothing.png";
+
+      $query = ['FROM'  => 'glpi_plugin_archires_imageitems',
+                'WHERE' => ['itemtype' => $itemtype]];
+
+      if ($result = $DB->request($query)) {
+         while ($ligne= $result->next()) {
+            $config_img = $ligne["img"];
+            if ($type == $ligne["type"]) {
+               $image_name = $path."pics/$config_img";
+            }
+         }
+      }
+      return $image_name;
+   }
+
+
+   function getForbiddenStandardMassiveAction() {
+
+      $forbidden   = parent::getForbiddenStandardMassiveAction();
+      $forbidden[] = 'update';
+      return $forbidden;
+   }
+}

+ 397 - 0
inc/locationquery.class.php

@@ -0,0 +1,397 @@
+<?php
+/*
+ * @version $Id: locationquery.class.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+ */
+
+if (!defined('GLPI_ROOT')) {
+   die("Sorry. You can't access directly to this file");
+}
+
+class PluginArchiresLocationQuery extends CommonDBTM {
+
+   static $rightname      = "plugin_archires";
+   protected $usenotepad  = true;
+
+
+
+   static function getTypeName($nb=0) {
+      return __('Location');
+   }
+
+
+   function cleanDBonPurge() {
+
+      $querytype = new PluginArchiresQueryType();
+      $querytype->deleteByCriteria(['plugin_archires_queries_id' => $this->fields['id']]);
+   }
+
+
+   function rawSearchOptions() {
+
+      $tab = [];
+
+      $tab[] = ['id'             => 'common',
+               'name'           => self::getTypeName(2)];
+
+      $tab[] = ['id'             => '1',
+               'table'          => $this->getTable(),
+               'field'          =>'name',
+               'name'           => __('Name'),
+               'datatype'       => 'itemlink',
+               'itemlink_type'  => $this->getType()];
+
+      $tab[] = ['id'             => '2',
+               'table'          => $this->getTable(),
+               'field'          => 'child',
+               'name'           => __('Childs', 'archires'),
+               'datatype'       => 'bool'];
+
+      $tab[] = ['id'             => '3',
+               'table'          => 'glpi_locations',
+               'field'          => 'completename',
+               'name'           => __('Location')];
+
+      $tab[] = ['id'             => '4',
+               'table'          => 'glpi_networks',
+               'field'          => 'name',
+               'name'           => __('Network'),
+               'datatype'       => 'dropdown'];
+
+      $tab[] = ['id'             => '5',
+               'table'          => 'glpi_states',
+               'field'          => 'name',
+               'name'           => _n('State', 'States', 1),
+               'datatype'       => 'dropdown'];
+
+      $tab[] = ['id'             => '6',
+               'table'          => 'glpi_groups',
+               'field'          => 'completename',
+               'name'           => _n('Group', 'Groups', 1),
+               'datatype'       => 'dropdown'];
+
+      $tab[] = ['id'             => '7',
+               'table'          => 'glpi_vlans',
+               'field'          => 'name',
+               'name'           => __('VLAN'),
+               'datatype'       => 'dropdown'];
+
+      $tab[] = ['id'             => '8',
+               'table'          => 'glpi_plugin_archires_views',
+               'field'          => 'name',
+               'name'           => PluginArchiresView::getTypeName(1),
+               'datatype'       => 'dropdown'];
+
+      $tab[] = ['id'             => '30',
+               'table'          => $this->getTable(),
+               'field'          => 'id',
+               'name'           => __('ID'),
+               'datatype'       => 'number'];
+
+      $tab[] = ['id'             => '80',
+               'table'          => 'glpi_entities',
+               'field'          => 'completename',
+               'name'           => __('Entity'),
+               'datatype'       => 'dropdown'];
+
+      return $tab;
+   }
+
+
+   function prepareInputForAdd($input) {
+
+      if (!isset ($input["plugin_archires_views_id"])
+          || $input["plugin_archires_views_id"] == 0) {
+         Session::addMessageAfterRedirect(__('Thanks to specify a default used view', 'archires'),
+                                          false, ERROR);
+         return [];
+      }
+      return $input;
+   }
+
+
+   function defineTabs($options=[]) {
+
+      $ong = [];
+      $this->addDefaultFormTab($ong)
+         ->addStandardTab('PluginArchiresQueryType', $ong, $options)
+         ->addStandardTab('PluginArchiresView', $ong, $options)
+         ->addStandardTab('PluginArchiresPrototype', $ong, $options)
+         ->addStandardTab('Notepad',$ong, $options);
+
+      return $ong;
+   }
+
+
+   function showForm ($ID, $options=[]) {
+
+      $this->initForm($ID, $options);
+      $this->showFormHeader($options);
+
+      echo "<tr class='tab_bg_1'>";
+      echo "<td>".__('Name')."</td>";
+      echo "<td>";
+      Html::autocompletionTextField($this,"name");
+      echo "</td>";
+      echo "<td>".__('State')."</td><td>";
+      State::dropdown(['name'  => "states_id",
+                       'value' => $this->fields["states_id"]]);
+      echo "</td></tr>";
+
+      echo "<tr class='tab_bg_1'>";
+      echo "<td>".__('Location')."</td><td>";
+      $this->dropdownLocation($this, $ID);
+      echo "</td>";
+      echo "<td>".__('Group')."</td><td>";
+      Group::dropdown(['name'   => "groups_id",
+                       'value'  => $this->fields["groups_id"],
+                       'entity' => $this->fields["entities_id"]]);
+      echo "</td></tr>";
+
+      echo "<tr class='tab_bg_1'>";
+      echo "<td>".__('Childs', 'archires')."</td>";
+      echo "<td>";
+      Dropdown::showYesNo("child",$this->fields["child"]);
+      echo "</td>";
+      echo "<td>".__('VLAN')."</td><td>";
+      Vlan::dropdown(['name'  => "vlans_id",
+                      'value' => $this->fields["vlans_id"]]);
+      echo "</td></tr>";
+
+      echo "<tr class='tab_bg_1'>";
+      echo "<td>".__('Network')."</td><td>";
+      Network::dropdown(['name'  => "networks_id",
+                         'value' => $this->fields["networks_id"]]);
+      echo "</td>";
+      echo "<td>".PluginArchiresView::getTypeName(1)."</td><td>";
+      //View
+      Dropdown::show('PluginArchiresView',
+                     ['name'  => "plugin_archires_views_id",
+                      'value' => $this->fields["plugin_archires_views_id"]]);
+      echo "</td></tr>";
+
+      $this->showFormButtons($options);
+
+      return true;
+   }
+
+
+   function dropdownLocation($object,$ID) {
+      global $DB;
+
+      $obj          = new $object();
+      $dbu          = new DbUtils();
+      $locations_id = -1;
+
+      if ($obj->getFromDB($ID)) {
+         $locations_id = $obj->fields["locations_id"];
+      }
+      $where = '';
+      $query0 = ['SELECT'  => 'entities_id',
+                 'FROM'    => 'glpi_locations',
+                 'WHERE'   => $dbu->getEntitiesRestrictCriteria('glpi_locations'),
+                 'GROUPBY' => 'entities_id',
+                 'ORDER'   => 'entities_id'];
+
+      echo "<select name='locations_id'>";
+      echo "<option value='0'>".Dropdown::EMPTY_VALUE."</option>\n";
+      echo "<option option value='-1' ".($locations_id=="-1"?" selected ":"").">".
+             __('All root locations', 'archires')."</option>";
+
+      if ($result0 = $DB->request($query0)) {
+         while ($ligne0 = $result0->next()) {
+            echo "<optgroup label='".Dropdown::getDropdownName("glpi_entities",
+                                                               $ligne0["entities_id"])."'>";
+
+            $query = ['SELECT'   => ['id', 'completename'],
+                      'FROM'     => 'glpi_locations',
+                      'WHERE'    => ['entities_id' => $ligne0["entities_id"]],
+                      'ORDER'    => ['completename ASC']];
+
+            if ($result = $DB->request($query)) {
+               while ($ligne = $result->next()) {
+                  $location    = $ligne["completename"];
+                  $location_id = $ligne["id"];
+                  echo "<option value='".$location_id."' ".
+                        (($location_id == "".$locations_id."")?" selected ":"").">".$location.
+                       "</option>";
+               }
+            }
+            echo "</optgroup>";
+         }
+      }
+      echo "</select>";
+   }
+
+
+   function Query($ID,$PluginArchiresView,$for) {
+      global $DB;
+
+      $dbu = new DbUtils();
+
+      $this->getFromDB($ID);
+
+      $types   = [];
+      $devices = [];
+      $ports   = [];
+
+      if ($PluginArchiresView->fields["computer"] != 0) {
+         $types[]='Computer';
+      }
+      if ($PluginArchiresView->fields["printer"] != 0) {
+         $types[]='Printer';
+      }
+      if ($PluginArchiresView->fields["peripheral"] != 0) {
+         $types[]='Peripheral';
+      }
+      if ($PluginArchiresView->fields["phone"] != 0) {
+         $types[]='Phone';
+      }
+      if ($PluginArchiresView->fields["networking"] != 0) {
+         $types[]='NetworkEquipment';
+      }
+
+      foreach ($types as $key => $val) {
+         $itemtable = $dbu->getTableForItemType($val);
+         $fieldsnp = "`np`.`id`, `np`.`items_id`, `np`.`logical_number`, `np`.`instantiation_type`,
+                      `glpi_ipaddresses`.`name` AS ip, `glpi_ipnetworks`.`netmask`,
+                      `np`.`name` AS namep";
+
+         $query = "SELECT `$itemtable`.`id` AS idc, $fieldsnp , `$itemtable`.`name`,
+                          `$itemtable`.`".getForeignKeyFieldForTable($dbu->getTableForItemType($val."Type"))."`
+                              AS `type`,
+                          `$itemtable`.`users_id`, `$itemtable`.`groups_id`, `$itemtable`.`contact`,
+                          `$itemtable`.`states_id`, `$itemtable`.`entities_id`,
+                          `$itemtable`.`locations_id`
+                   FROM `glpi_networkports` np";
+
+         if ($this->fields["vlans_id"] > "0") {
+            $query .= ", `glpi_networkports_vlans` nv ";
+         }
+
+         $query .= " LEFT JOIN `glpi_networkportethernets`
+                        ON `glpi_networkportethernets`.`networkports_id` = `np`.`id`
+                     LEFT JOIN `glpi_networknames`
+                        ON (`glpi_networknames`.`itemtype` = 'NetworkPort'
+                            AND `np`.`id` = `glpi_networknames`.`items_id`)
+                     LEFT JOIN `glpi_ipaddresses`
+                        ON (`glpi_ipaddresses`.`itemtype` = 'NetworkName'
+                            AND `glpi_networknames`.`id` = `glpi_ipaddresses`.`items_id`)
+                     LEFT JOIN `glpi_ipaddresses_ipnetworks`
+                        ON `glpi_ipaddresses_ipnetworks`.`ipaddresses_id` = `glpi_ipaddresses`.`id`
+                     LEFT JOIN `glpi_ipnetworks`
+                        ON `np`.`id` = `glpi_ipaddresses_ipnetworks`.`ipnetworks_id`
+                     LEFT JOIN `$itemtable`
+                        ON (`np`.`items_id` = `$itemtable`.`id`
+                            AND `$itemtable`.`is_deleted` = '0'
+                            AND `$itemtable`.`is_template` = '0'".
+                            $dbu->getEntitiesRestrictRequest(" AND",$itemtable).")
+                     LEFT JOIN `glpi_locations` lc
+                        ON `lc`.`id` = `$itemtable`.`locations_id`
+                     WHERE `np`.`instantiation_type` = 'NetworkPortEthernet'
+                           AND `np`.`itemtype` = '$val'";
+
+         if ($this->fields["vlans_id"] > "0") {
+            $query .= " AND `nv`.`networkports_id` = np`.`id`
+                        AND `vlans_id` = '".$this->fields["vlans_id"]."'";
+         }
+         if (($this->fields["networks_id"] > "0")
+             && ($val != 'Phone')
+             && ($val != 'Peripheral')) {
+            $query .= " AND `$itemtable`.`networks_id` = '".$this->fields["networks_id"]."'";
+         }
+         if ($this->fields["states_id"] > "0") {
+            $query .= " AND `$itemtable`.`states_id` = '".$this->fields["states_id"]."'";
+         }
+         if ($this->fields["groups_id"] > "0") {
+            $query .= " AND `$itemtable`.`groups_id` = '".$this->fields["groups_id"]."'";
+         }
+         if ($this->fields["locations_id"] != "-1") {
+            $query .= " AND `lc`.`id` = `$itemtable`.`locations_id` ";
+            if ($this->fields["child"]
+                && !empty($this->fields["locations_id"])) {
+               $query .= " AND " . getRealQueryForTreeItem('glpi_locations',
+                                                           $this->fields["locations_id"],
+                                                           "`lc`.`id`");
+            } else {
+               $query .= " AND `lc`.`id` = '".$this->fields["locations_id"]."'";
+
+            }
+         } else { // locations_id == -1 soit Lieux racines
+            $query .= " AND `lc`.`id` = `$itemtable`.`locations_id`";
+
+            if ($this->fields["child"]=='0') { // Pas d'enfants'
+               $query .= " AND `lc`.`level`=1 ";
+            }
+            // else, Si enfants => pas de restriction
+         }
+         //types
+         $PluginArchiresQueryType = new PluginArchiresQueryType();
+         $query .= $PluginArchiresQueryType->queryTypeCheck($this->getType(),$ID,$val);
+         $query .= "ORDER BY `glpi_ipaddresses`.`name` ASC ";
+
+         if ($result = $DB->request($query)) {
+            while ($data = $result->next()) {
+               if ($PluginArchiresView->fields["display_state"] != 0) {
+                  $devices[$val][$data["items_id"]]["states_id"] = $data["states_id"];
+               }
+               $devices[$val][$data["items_id"]]["type"]         = $data["type"];
+               $devices[$val][$data["items_id"]]["name"]         = $data["name"];
+               $devices[$val][$data["items_id"]]["users_id"]     = $data["users_id"];
+               $devices[$val][$data["items_id"]]["groups_id"]    = $data["groups_id"];
+               $devices[$val][$data["items_id"]]["contact"]      = $data["contact"];
+               $devices[$val][$data["items_id"]]["entity"]       = $data["entities_id"];
+               $devices[$val][$data["items_id"]]["locations_id"] = $data["locations_id"];
+
+               if ($data["ip"]) {
+                  if (!empty($devices[$val][$data["items_id"]]["ip"])) {
+                     $devices[$val][$data["items_id"]]["ip"] .= " - ";
+                     $devices[$val][$data["items_id"]]["ip"] .= $data["ip"];
+                  } else {
+                     $devices[$val][$data["items_id"]]["ip"] = $data["ip"];
+                  }
+               }
+
+               $ports[$data["id"]]["items_id"]             = $data["items_id"];
+               $ports[$data["id"]]["logical_number"]       = $data["logical_number"];
+               $ports[$data["id"]]["instantiation_type"]   = $data["instantiation_type"];
+               $ports[$data["id"]]["ip"]                   = $data["ip"];
+               $ports[$data["id"]]["netmask"]              = $data["netmask"];
+               $ports[$data["id"]]["namep"]                = $data["namep"];
+               $ports[$data["id"]]["idp"]                  = $data["id"];
+               $ports[$data["id"]]["itemtype"]             = $val;
+
+            }
+         }
+      }
+      if ($for) {
+         return $devices;
+      }
+      return $ports;
+   }
+}

+ 86 - 0
inc/menu.class.php

@@ -0,0 +1,86 @@
+<?php
+/*
+ * @version $Id: setup.php 164 2013-09-03 12:39:17Z tsmr $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+ */
+
+class PluginArchiresMenu extends CommonGLPI {
+
+   static $rightname = 'plugin_archires';
+
+
+   static function getMenuName() {
+      return _n('Network Architecture', 'Network Architectures', 2, 'archires');
+   }
+
+
+   static function getMenuContent() {
+      global $CFG_GLPI;
+
+      $menu                    = [];
+      $menu['title']           = self::getMenuName();
+      $menu['page']            = '/plugins/archires/front/archires.php';
+      $menu['links']['search'] = '/plugins/archires/front/archires.php';
+
+
+      $menu['options']['view']['title']           = _n('View', 'Views', 2);
+      $menu['options']['view']['page']            = '/plugins/archires/front/view.php';
+      $menu['options']['view']['links']['add']    = '/plugins/archires/front/view.form.php';
+      $menu['options']['view']['links']['search'] = '/plugins/archires/front/view.php';
+
+      $menu['options']['location']['title']           = __('Location');
+      $menu['options']['location']['page']            = '/plugins/archires/front/locationquery.php';
+      $menu['options']['location']['links']['add']    = '/plugins/archires/front/locationquery.form.php';
+      $menu['options']['location']['links']['search'] = '/plugins/archires/front/locationquery.php';
+
+      $menu['options']['networkequipment']['title']           = _n('Network equipment', 'Network equipments', 1, 'archires');
+      $menu['options']['networkequipment']['page']            = '/plugins/archires/front/networkequipmentquery.php';
+      $menu['options']['networkequipment']['links']['add']    = '/plugins/archires/front/networkequipmentquery.form.php';
+      $menu['options']['networkequipment']['links']['search'] = '/plugins/archires/front/networkequipmentquery.php';
+
+      if (class_exists('PluginAppliancesAppliance')) {
+         $menu['options']['appliance']['title']           = __('appliances');
+         $menu['options']['appliance']['page']            = '/plugins/archires/front/appliancequery.php';
+         $menu['options']['appliance']['links']['add']    = '/plugins/archires/front/appliancequery.form.php?new=1';
+         $menu['options']['appliance']['links']['search'] = '/plugins/archires/front/appliancequery.php';
+      }
+      return $menu;
+   }
+
+
+   static function removeRightsFromSession() {
+
+      if (isset($_SESSION['glpimenu']['tools']['types']['PluginArchiresMenu'])) {
+         unset($_SESSION['glpimenu']['tools']['types']['PluginArchiresMenu']);
+      }
+      if (isset($_SESSION['glpimenu']['tools']['content']['PluginArchiresMenu'])) {
+         unset($_SESSION['glpimenu']['tools']['content']['PluginArchiresMenu']);
+      }
+   }
+
+}

+ 400 - 0
inc/networkequipmentquery.class.php

@@ -0,0 +1,400 @@
+<?php
+/*
+ * @version $Id: networkequipmentquery.class.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+ */
+
+if (!defined('GLPI_ROOT')) {
+   die("Sorry. You can't access directly to this file");
+}
+
+class PluginArchiresNetworkEquipmentQuery extends CommonDBTM {
+
+   static $rightname      = "plugin_archires";
+   protected $usenotepad  = true;
+
+
+   static function getTypeName($nb=0) {
+      return _n('Network equipment', 'Network equipments', 1, 'archires');
+   }
+
+
+   function cleanDBonPurge() {
+
+      $querytype = new PluginArchiresQueryType;
+      $querytype->deleteByCriteria(['plugin_archires_queries_id' => $this->fields['id']]);
+   }
+
+
+   function rawSearchOptions() {
+
+      $tab = [];
+
+      $tab[] = ['id'             => 'common',
+               'name'           => self::getTypeName(2)];
+
+      $tab[] = ['id'             => '1',
+               'table'          => $this->getTable(),
+               'field'          =>'name',
+               'name'           => __('Name'),
+               'datatype'       => 'itemlink',
+               'itemlink_type'  => $this->getType()];
+
+      $tab[] = ['id'             => '2',
+               'table'          => 'glpi_networkequipments',
+               'field'          => 'name',
+               'name'           => _n('Network equipment', 'Network equipments', 1, 'archires'),
+               'datatype'       => 'dropdown'];
+
+
+      $tab[] = ['id'             => '3',
+               'table'          => 'glpi_networks',
+               'field'          => 'name',
+               'name'           => __('Network'),
+               'datatype'       => 'dropdown'];
+
+      $tab[] = ['id'             => '4',
+               'table'          => 'glpi_states',
+               'field'          => 'name',
+               'name'           => __('State'),
+               'datatype'       => 'dropdown'];
+
+      $tab[] = ['id'             => '5',
+               'table'          => 'glpi_groups',
+               'field'          => 'completename',
+               'name'           => __('Group'),
+               'datatype'       => 'dropdown'];
+
+      $tab[] = ['id'             => '6',
+               'table'          => 'glpi_vlans',
+               'field'          => 'name',
+               'name'           => __('VLAN'),
+               'datatype'       => 'dropdown'];
+
+      $tab[] = ['id'             => '7',
+               'table'          => 'glpi_plugin_archires_views',
+               'field'          => 'name',
+               'name'           => PluginArchiresView::getTypeName(1),
+               'datatype'       => 'dropdown'];
+
+      $tab[] = ['id'             => '30',
+               'table'          => $this->getTable(),
+               'field'          => 'id',
+               'name'           => __('ID'),
+               'datatype'       => 'number'];
+
+      $tab[] = ['id'             => '80',
+               'table'          => 'glpi_entities',
+               'field'          => 'completename',
+               'name'           => __('Entity'),
+               'datatype'       => 'dropdown'];
+
+      return $tab;
+   }
+
+
+  function prepareInputForAdd($input) {
+
+      if (!isset ($input["plugin_archires_views_id"])
+          || ($input["plugin_archires_views_id"] == 0)) {
+         Session::addMessageAfterRedirect(__('Thanks to specify a default used view', 'archires'),
+                                          false, ERROR);
+         return [];
+      }
+      return $input;
+   }
+
+
+   function defineTabs($options=[]) {
+
+      $ong = [];
+      $this->addDefaultFormTab($ong)
+         ->addStandardTab('PluginArchiresQueryType', $ong, $options)
+         ->addStandardTab('PluginArchiresView', $ong, $options)
+         ->addStandardTab('PluginArchiresPrototype', $ong, $options)
+         ->addStandardTab('Notepad',$ong, $options);
+
+      return $ong;
+   }
+
+
+   function showForm ($ID, $options=[]) {
+
+      $this->initForm($ID, $options);
+      $this->showFormHeader($options);
+
+      echo "<tr class='tab_bg_1'>";
+      echo "<td>".__('Name')."</td>";
+      echo "<td>";
+      Html::autocompletionTextField($this,"name");
+      echo "</td>";
+      echo "<td>".__('Group')."</td><td>";
+      Group::dropdown(['name'   => "groups_id",
+                       'value'  => $this->fields["groups_id"],
+                       'entity' => $this->fields["entities_id"]]);
+      echo "</td></tr>";
+
+      echo "<tr class='tab_bg_1'>";
+      echo "<td>"._n('Network equipment', 'Network equipments', 1, 'archires')."</td><td>";
+      NetworkEquipment::dropdown(['name'   => "networkequipments_id",
+                                  'value'  => $this->fields["networkequipments_id"],
+                                  'entity' => $this->fields["entities_id"]]);
+      echo "</td>";
+      echo "<td>".__('VLAN')."</td><td>";
+      Vlan::dropdown(['name' => "vlans_id",
+                      'value' => $this->fields["vlans_id"]]);
+      echo "</td></tr>";
+
+      echo "<tr class='tab_bg_1'>";
+      echo "<td>".__('Network')."</td><td>";
+      Network::dropdown(['name'  => "networks_id",
+                         'value' => $this->fields["networks_id"]]);
+      echo "</td>";
+      echo "<td>".PluginArchiresView::getTypeName(1)."</td><td>";
+      //View
+      Dropdown::show('PluginArchiresView',
+                     ['name'  => "plugin_archires_views_id",
+                      'value' => $this->fields["plugin_archires_views_id"]]);
+      echo "</td></tr>";
+
+      echo "<tr class='tab_bg_1'>";
+      echo "<td>".__('State')."</td><td colspan='3'>";
+      State::dropdown(['name'  => "states_id",
+                       'value' => $this->fields["states_id"]]);
+      echo "</td></tr>";
+
+      $this->showFormButtons($options);
+
+      return true;
+   }
+
+
+   function Query($ID,$PluginArchiresView,$for) {
+      global $DB;
+
+      $dbu = new DbUtils();
+
+      $this->getFromDB($ID);
+
+      $types   = [];
+      $devices = [];
+      $ports   = [];
+
+      if ($PluginArchiresView->fields["computer"] != 0) {
+         $types[] = 'Computer';
+      }
+      if ($PluginArchiresView->fields["printer"] != 0) {
+         $types[] = 'Printer';
+      }
+      if ($PluginArchiresView->fields["peripheral"] != 0) {
+         $types[] = 'Peripheral';
+      }
+      if ($PluginArchiresView->fields["phone"] != 0) {
+         $types[]='Phone';
+      }
+      if ($PluginArchiresView->fields["networking"] != 0) {
+         $types[] = 'NetworkEquipment';
+      }
+
+      $query_switch = ['SELECT'     => ['glpi_networkports.name', 'glpi_networkports.id'],
+                       'FROM'       => 'glpi_networkports',
+                       'LEFT JOIN'  => ['glpi_networkequipments'
+                                        =>['FKEY' => ['glpi_networkports'  => 'items_id',
+                                                      'glpi_networkequipments' => 'id']]],
+                       'WHERE'      => ['glpi_networkequipments.is_deleted' => 0,
+                                        'is_template'                       => 0,
+                                        'itemtype'                          => 'NetworkEquipment']
+                                        + $dbu->getEntitiesRestrictCriteria('glpi_networkequipments')];
+
+      if ($this->fields["networkequipments_id"]) {
+         $query_switch['WHERE']['glpi_networkequipments.id'] = $this->fields["networkequipments_id"];
+      }
+
+      if ($result_switch = $DB->request($query_switch)) {
+         while ($ligne = $result_switch->next()) {
+            $port = $ligne['name'];
+            $nw   = new NetworkPort_NetworkPort();
+            $end  = $nw->getOppositeContact($ligne['id']);
+
+            if ($end) {
+               foreach ($types as $key => $val) {
+                  $itemtable = $dbu->getTableForItemType($val);
+                  $fieldsnp = "`np`.`id`, `np`.`items_id`, `np`.`logical_number`,
+                               `np`.`instantiation_type`, `glpi_ipaddresses`.`name` AS ip,
+                               `ipn`.`netmask`, `np`.`name` AS namep";
+
+                  $query = "SELECT `$itemtable`.`id` AS idc, $fieldsnp , `$itemtable`.`name`,
+                                   `$itemtable`.`".getForeignKeyFieldForTable($dbu->getTableForItemType($val."Type"))."`
+                                       AS `type`,
+                                   `$itemtable`.`users_id`, `$itemtable`.`groups_id`,
+                                   `$itemtable`.`contact`, `$itemtable`.`states_id`,
+                                   `$itemtable`.`entities_id`,`$itemtable`.`locations_id`
+                            FROM `$itemtable`,
+                                 `glpi_ipnetworks` AS ipn,
+                                 `glpi_networkports` np";
+
+                  if ($this->fields["vlans_id"] > "0") {
+                     $query .= ", `glpi_networkports_vlans` nv";
+                  }
+
+                  $query .= " LEFT JOIN `glpi_networknames`
+                                 ON (`glpi_networknames`.`itemtype` = 'NetworkPort'
+                                     AND `np`.`id` = `glpi_networknames`.`items_id`)
+                              LEFT JOIN `glpi_ipaddresses`
+                                 ON (`glpi_ipaddresses`.`itemtype` = 'NetworkName'
+                                     AND `glpi_networknames`.`id` = `glpi_ipaddresses`.`items_id`)
+                              WHERE `np`.`instantiation_type` = 'NetworkPortEthernet'
+                                 AND `np`.`itemtype` = '$val'
+                                 AND `np`.`items_id` = `$itemtable`.`id`
+                                 AND `np`.`id` ='$end'
+                                 AND `$itemtable`.`is_deleted` = '0'
+                                 AND `$itemtable`.`is_template` = '0' ".
+                                 $dbu->getEntitiesRestrictRequest(" AND", $itemtable);
+
+                  if ($this->fields["vlans_id"] > "0") {
+                     $query .= " AND `nv`.`networkports_id` = `np`.`id`
+                                 AND vlans_id= '".$this->fields["vlans_id"]."'";
+                  }
+                  if (($this->fields["networks_id"] > "0")
+                      && ($val != 'Phone')
+                      && ($val != 'Peripheral')) {
+                     $query .= " AND `$itemtable`.`networks_id` = '".$this->fields["networks_id"]."'";
+                  }
+                  if ($this->fields["states_id"] > "0") {
+                     $query .= " AND `$itemtable`.`states_id` = '".$this->fields["states_id"]."'";
+                  }
+                  if ($this->fields["groups_id"] > "0") {
+                     $query .= " AND `$itemtable`.`groups_id` = '".$this->fields["groups_id"]."'";
+                  }
+
+                  //types
+                  $PluginArchiresQueryType = new PluginArchiresQueryType();
+                  $query .= $PluginArchiresQueryType->queryTypeCheck($this->getType(), $ID, $val);
+                  $query .= "GROUP BY `np`.`id` ORDER BY `np`.`id` ASC ";
+
+                  if ($result = $DB->query($query)) {
+                     while ($data = $DB->fetch_array($result)) {
+
+                        if ($PluginArchiresView->fields["display_state"] != 0) {
+                           $devices[$val][$data["items_id"]]["states_id"] = $data["states_id"];
+                        }
+                        $devices[$val][$data["items_id"]]["type"]         = $data["type"];
+                        $devices[$val][$data["items_id"]]["name"]         = $data["name"];
+                        $devices[$val][$data["items_id"]]["users_id"]     = $data["users_id"];
+                        $devices[$val][$data["items_id"]]["groups_id"]    = $data["groups_id"];
+                        $devices[$val][$data["items_id"]]["contact"]      = $data["contact"];
+                        $devices[$val][$data["items_id"]]["entity"]       = $data["entities_id"];
+                        $devices[$val][$data["items_id"]]["locations_id"] = $data["locations_id"];
+
+                        $ports[$data["id"]]["items_id"]             = $data["items_id"];
+                        $ports[$data["id"]]["logical_number"]       = $data["logical_number"];
+                        $ports[$data["id"]]["ip"]                   = $data["ip"];
+                        $ports[$data["id"]]["netmask"]              = $data["netmask"];
+                        $ports[$data["id"]]["namep"]                = $data["namep"];
+                        $ports[$data["id"]]["idp"]                  = $data["id"];
+                        $ports[$data["id"]]["itemtype"]             = $val;
+
+                        //ip
+                        if ($data["ip"]) {
+                           if (!empty($devices[$val][$data["items_id"]]["ip"])) {
+                              $devices[$val][$data["items_id"]]["ip"] .= " - ";
+                              $devices[$val][$data["items_id"]]["ip"] .= $data["ip"];
+                           } else {
+                              $devices[$val][$data["items_id"]]["ip"] = $data["ip"];
+                           }
+                        }
+                        //fin ip
+                     }
+                  }
+               }
+            }
+         }
+      }
+      //The networking
+      $query = "SELECT `n`.`id` AS `idn`, `np`.`id`, `np`.`items_id`, `np`.`logical_number`,
+                       `np`.`instantiation_type`, `glpi_ipaddresses`.`name` AS ip,
+                       `np`.`name` AS `namep`,
+                       `ipn`.`address` AS `nip`, `ipn`.`netmask`, `n`.`name`,
+                       `n`.`networkequipmenttypes_id` AS `type`, `n`.`users_id`, `n`.`groups_id`,
+                       `n`.`contact`, `n`.`states_id`, `n`.`entities_id`,`n`.`locations_id`
+                FROM `glpi_networkports` `np`, `glpi_networkequipments` `n`,
+                     `glpi_ipnetworks` `ipn`";
+
+      if ($this->fields["vlans_id"] > "0") {
+         $query .= ", `glpi_networkports_vlans` nv ";
+      }
+
+      $query .= " LEFT JOIN `glpi_networknames`
+                        ON (`glpi_networknames`.`itemtype` = 'NetworkPort')
+                  LEFT JOIN `glpi_ipaddresses`
+                        ON (`glpi_ipaddresses`.`itemtype` = 'NetworkName'
+                            AND `glpi_networknames`.`id` = `glpi_ipaddresses`.`items_id`)
+                  WHERE `np`.`instantiation_type` = 'NetworkPortEthernet'
+                       AND `np`.`itemtype` = 'NetworkEquipment'
+                       AND `np`.`items_id` = `n`.`id`
+                       AND `n`.`is_deleted` = '0'
+                       AND `n`.`is_template` = '0'
+                       AND `glpi_networknames`.`items_id` = `np`.`id`".
+                       $dbu->getEntitiesRestrictRequest(' AND', 'n')."
+                       AND `n`.`id` = '".$this->fields["networkequipments_id"]."' ";
+
+      if ($this->fields["vlans_id"] > "0") {
+         $query .= " AND `nv`.`networkports_id` = `np`.`id`
+                     AND vlans_id= '".$this->fields["vlans_id"]."' ";
+      }
+      $query .= " ORDER BY `ip` ASC ";
+
+      if ($result = $DB->request($query)) {
+         while ($data = $result->next()) {
+            if ($PluginArchiresView->fields["display_state"] != 0) {
+               $devices['NetworkEquipment'][$data["items_id"]]["states_id"] = $data["states_id"];
+            }
+            $devices['NetworkEquipment'][$data["items_id"]]["name"]         = $data["name"];
+            $devices['NetworkEquipment'][$data["items_id"]]["type"]         = $data["type"];
+            $devices['NetworkEquipment'][$data["items_id"]]["users_id"]     = $data["users_id"];
+            $devices['NetworkEquipment'][$data["items_id"]]["groups_id"]    = $data["groups_id"];
+            $devices['NetworkEquipment'][$data["items_id"]]["contact"]      = $data["contact"];
+            $devices['NetworkEquipment'][$data["items_id"]]["ip"]           = $data["nip"];
+            $devices['NetworkEquipment'][$data["items_id"]]["entity"]       = $data["entities_id"];
+            $devices['NetworkEquipment'][$data["items_id"]]["locations_id"] = $data["locations_id"];
+            $ports[$data["id"]]["items_id"]                                 = $data["items_id"];
+            $ports[$data["id"]]["logical_number"]                           = $data["logical_number"];
+            $ports[$data["id"]]["ip"]                                       = $data["ip"];
+            $ports[$data["id"]]["netmask"]                                  = $data["netmask"];
+            $ports[$data["id"]]["namep"]                                    = $data["namep"];
+            $ports[$data["id"]]["idp"]                                      = $data["id"];
+            $ports[$data["id"]]["itemtype"]                                 = 'NetworkEquipment';
+         }
+      }
+
+      if ($for) {
+         return $devices;
+      }
+      return $ports;
+   }
+}

+ 198 - 0
inc/networkinterfacecolor.class.php

@@ -0,0 +1,198 @@
+<?php
+/*
+ * @version $Id: networkinterfacecolor.class.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+ */
+
+if (!defined('GLPI_ROOT')) {
+   die("Sorry. You can't access directly to this file");
+}
+
+class PluginArchiresNetworkInterfaceColor extends CommonDBTM {
+
+   static $rightname             = "plugin_archires";
+
+
+   function getFromDBbyNetworkInterface($networkinterfaces_id) {
+      global $DB;
+
+      $query = ['FROM'  => $this->getTable(),
+                'WHERE' => ['networkinterfaces_id' => $networkinterfaces_id]];
+
+      if ($result = $DB->request($query)) {
+         if (count($result) != 1) {
+            return false;
+         }
+         $this->fields = $result->next();
+         if (is_array($this->fields) && count($this->fields)) {
+            return true;
+         }
+      }
+      return false;
+   }
+
+
+   function addNetworkInterfaceColor($networkinterfaces_id,$color) {
+      global $DB;
+
+      if ($networkinterfaces_id != '-1') {
+         if ($this->getFromDBbyNetworkInterface($networkinterfaces_id)) {
+            $this->update(['id'    => $this->fields['id'],
+                           'color' => $color]);
+         } else {
+            $this->add(['networkinterfaces_id' => $networkinterfaces_id,
+                        'color'                => $color]);
+         }
+      } else {
+         $query  = ['FROM' => 'glpi_networkinterfaces'];
+         $result = $DB->request($query);
+         $i      = 0;
+         while ($i < count($result)) {
+            $row = $result->next();
+           $networkinterface_table = $rox['id'];
+           if ($this->getFromDBbyNetworkInterface($networkinterface_table)) {
+               $this->update(['id'    => $this->fields['id'],
+                              'color' => $color]);
+           } else {
+               $this->add(['networkinterfaces_id' => $networkinterface_table,
+                           'color'                => $color]);
+           }
+           $i++;
+         }
+      }
+   }
+
+
+   function showConfigForm($canupdate=false) {
+      global $DB;
+
+      if ($canupdate) {
+         echo "<div class='firstbloc'>";
+         echo "<form method='post' name='networkinterface_color' action='./config.form.php'>";
+         echo "<table class='tab_cadre' cellpadding='5' width='50%'><tr ><th colspan='3'>";
+         echo __('Associate colors with network types', 'archires')."</th></tr>";
+
+         echo "<tr class='tab_bg_1'><td width='70%'>";
+         $this->dropdownNetworkInterface();
+         echo "</td><td>";
+         echo "<input type='text' name=\"color\">";
+         echo "&nbsp;";
+         Html::showToolTip(nl2br(__('Please use this color format', 'archires')),
+                           ['link'       => 'http://www.graphviz.org/doc/info/colors.html',
+                            'linktarget' => '_blank']);
+         echo "</td><td></div>";
+         echo "<div class='center'>";
+         echo "<input type='submit' name='add_color_networkinterface' value=\"".
+            _sx('button', 'Add')."\" class='submit' ></div></td></tr>";
+         echo "</table>";
+         Html::closeForm();
+         echo "</div>";
+      }
+
+      $query = ['FROM'  => $this->getTable(),
+                'ORDER' => 'networkinterfaces_id ASC'];
+
+      if ($result = $DB->request($query)) {
+         $number = count($result);
+
+         if ($number) {
+            echo "<div id='liste_color' class='spaced center'>";
+            if ($canupdate) {
+               $rand = mt_rand();
+               Html::openMassiveActionsForm('mass'.__CLASS__.$rand);
+               $massiveactionparams = ['num_displayed'    => $number,
+                                       'container'        => 'mass'.__CLASS__.$rand];
+               Html::showMassiveActions($massiveactionparams);
+            }
+            echo "<table class='tab_cadre' cellpadding='5' width='50%'>";
+            echo "<tr>";
+            if ($canupdate) {
+               echo "<th width='10'>";
+               Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand);
+               echo "</th>";
+            }
+            echo "<th class='left'>".__('Type of network', 'archires')."</th>";
+            echo "<th class='left'>".__('Color', 'archires')."</th><th></th>";
+            echo "</tr>";
+
+            while ($ligne = $result->next()) {
+               $ID = $ligne["id"];
+               echo "<tr class='tab_bg_1'>";
+               if ($canupdate) {
+                  echo "<td width='10'>";
+                  Html::showMassiveActionCheckBox(__CLASS__, $ID);
+                  echo "</td>";
+               }
+               echo "</td><td>".Dropdown::getDropdownName("glpi_networkinterfaces",
+                                                     $ligne["networkinterfaces_id"])."</td><";
+               echo "td bgcolor='".$ligne["color"]."'>".$ligne["color"]."</td>";
+            }
+
+            echo "</table>";
+            if ($canupdate) {
+               $massiveactionparams['ontop'] = false;
+               Html::showMassiveActions($massiveactionparams);
+            }
+            echo "</div>";
+            Html::closeForm();
+         }
+      }
+   }
+
+
+   function dropdownNetworkInterface() {
+      global $DB;
+
+      $colors = [];
+      foreach($DB->request("glpi_plugin_archires_networkinterfacecolors") as $color) {
+         $colors[] = $color['networkinterfaces_id'];
+      }
+
+      $query = ['FROM'  => 'glpi_networkinterfaces',
+                'WHERE' =>  ['NOT' => ['id' => [implode("','",$colors)]]],
+                'ORDER' => 'name'];
+
+      $result = $DB->request($query);
+
+      if (count($result)) {
+         while ($data = $result->next()) {
+            $values[$data['id']] = $data["name"];
+         }
+         Dropdown::showFromArray('networkinterfaces_id', $values, ['width'               => '80%',
+                                                                   'display_emptychoice' => true]);
+      }
+   }
+
+
+   function getForbiddenStandardMassiveAction() {
+
+      $forbidden   = parent::getForbiddenStandardMassiveAction();
+      $forbidden[] = 'update';
+      return $forbidden;
+   }
+}

+ 149 - 0
inc/profile.class.php

@@ -0,0 +1,149 @@
+<?php
+/*
+ * @version $Id: profile.class.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+ */
+
+if (!defined('GLPI_ROOT')) {
+   die("Sorry. You can't access directly to this file");
+}
+
+class PluginArchiresProfile extends Profile {
+
+   static $rightname = "profile";
+
+
+   //if profile deleted
+   static function purgeProfiles(Profile $prof) {
+
+      $plugprof = new self();
+      $plugprof->deleteByCriteria(['profiles_id' => $prof->getField("id")]);
+   }
+
+
+   function getFromDBByProfile($profiles_id) {
+      global $DB;
+
+      $query = ['FROM'  => $this->getTable(),
+                'WHERE' => ['profiles_id' => $profiles_id]];
+
+      if ($result = $DB->request($query)) {
+         if (count($result) != 1) {
+            return false;
+         }
+         $this->fields = $result->next();
+         if (is_array($this->fields) && count($this->fields)) {
+            return true;
+         }
+      }
+      return false;
+   }
+
+
+   static function createFirstAccess($ID) {
+      self::addDefaultProfileInfos($ID, ['plugin_archires' => ALLSTANDARDRIGHT], true);
+   }
+
+
+   //profiles modification
+   function showForProfile(Profile $prof){
+
+      $canedit = Session::haveRightsOr(self::$rightname, [CREATE, UPDATE, PURGE]);
+
+      if ($canedit) {
+         echo "<form method='post' action='".$prof->getFormURL()."'>";
+      }
+
+      $rights = [['itemtype'  => 'PluginArchiresArchires',
+                  'label'     => __('Generate graphs', 'archires'),
+                  'field'     => 'plugin_archires']];
+
+      $prof->displayRightsChoiceMatrix($rights, ['canedit'       => $canedit,
+                                                 'default_class' => 'tab_bg_2',
+                                                 'title'         => __('General')]);
+
+      echo "<table class='tab_cadre_fixehov'>";
+      $effective_rights = ProfileRight::getProfileRights($prof->getField('id'), ['plugin_archires']);
+      echo Html::hidden('id', ['value' => $prof->getField('id')]);
+      echo "</table>";
+
+      if ($canedit) {
+         echo "<div class='center'>";
+         echo Html::hidden('id', ['value' => $prof->getField('id')]);
+         echo Html::submit(_sx('button', 'Save'), ['name' => 'update']);
+         echo "</div>\n";
+         Html::closeForm();
+      }
+   }
+
+
+   function getTabNameForItem(CommonGLPI $item, $withtemplate=0) {
+
+      if ($item->getType() == 'Profile') {
+         if ($item->getField('id')
+             && ($item->getField('interface') != 'helpdesk')) {
+            return PluginArchiresArchires::getTypeName(2);
+         }
+      }
+      return '';
+   }
+
+
+   static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) {
+
+      if ($item->getType() == 'Profile') {
+         $prof = new self();
+         $ID   = $item->getField('id');
+         self::addDefaultProfileInfos($item->getID(), ['plugin_archires' => 0]);
+         $prof->showForProfile($item);
+      }
+      return true;
+   }
+
+
+   static function addDefaultProfileInfos($profiles_id, $rights) {
+
+      $dbu = new DbUtils();
+
+      $profileRight = new ProfileRight();
+      foreach ($rights as $right => $value) {
+         if (!$dbu->countElementsInTable('glpi_profilerights',
+                                         ['profiles_id' => $profiles_id,
+                                          'name'        => $right])) {
+            $myright['profiles_id'] = $profiles_id;
+            $myright['name']        = $right;
+            $myright['rights']      = $value;
+            $profileRight->add($myright);
+
+            //Add right to the current session
+            $_SESSION['glpiactiveprofile'][$right] = $value;
+         }
+      }
+   }
+
+}

+ 730 - 0
inc/prototype.class.php

@@ -0,0 +1,730 @@
+<?php
+/*
+ * @version $Id: prototype.class.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+ */
+
+if (!defined('GLPI_ROOT')) {
+   die("Sorry. You can't access directly to this file");
+}
+
+class PluginArchiresPrototype extends CommonDBTM {
+
+   static $rightname = "plugin_archires";
+
+
+   private static function dotIt($engine, $graph, $format) {
+
+      $out         = '';
+      $Path        = realpath(GLPI_PLUGIN_DOC_DIR."/archires");
+      $graph_name  = tempnam($Path, "txt");
+      $out_name    = tempnam($Path, $format);
+
+      if (file_put_contents($graph_name, $graph)) {
+         $command = "$engine -T$format -o\"$out_name\" \"$graph_name\" ";
+         $out     = shell_exec($command);
+         $out     = file_get_contents($out_name);
+         unlink($graph_name);
+         unlink($out_name);
+      }
+      return $out;
+   }
+
+
+   function testGraphviz() {
+
+      $graph = "graph G {
+                  a;
+                  b;
+                  c -- d;
+                  a -- c;}";
+
+      return self::dotIt('dot', $graph, 'png');
+   }
+
+
+   function CleanField($string) {
+
+      $string = str_replace(">", " - ", $string);
+      $string = str_replace("&", " - ", $string);
+      return $string;
+   }
+
+
+   static function displayTypeAndIP($PluginArchiresView,$itemtype,$device,$generation) {
+
+      $graph                  = "";
+      $PluginArchiresArchires = new PluginArchiresArchires();
+
+      if (($PluginArchiresView->fields["display_ip"] != 0)
+          && isset($device["ip"])) {
+
+         if (($PluginArchiresView->fields["display_type"] != 0)
+             && !empty($device["type"])) {
+            $class     = $itemtype."Type";
+            $typeclass = new $class();
+            $typeclass->getFromDB($device["type"]);
+
+            if (!$generation) {
+               $graph = $typeclass->fields["name"] . " " .$device["ip"];
+            } else {
+               $graph = " - ".$typeclass->fields["name"].
+                        "</td></tr><tr><td>".$device["ip"]."</td></tr>";
+            }
+
+         } else {
+            if (!$generation) {
+               $graph = $device["ip"];
+            } else {
+               $graph ="</td></tr><tr><td>".$device["ip"]."</td></tr>";
+            }
+         }
+
+      } else {
+         if (($PluginArchiresView->fields["display_type"] != 0)
+             && !empty($device["type"])) {
+            $class     = $itemtype."Type";
+            $typeclass = new $class();
+            $typeclass->getFromDB($device["type"]);
+
+            if (!$generation) {
+               $graph =$typeclass->fields["name"];
+            } else {
+               $graph ="</td></tr><tr><td>".
+                        $typeclass->fields["name"]."</td></tr>";
+            }
+
+         } else {
+            if (!$generation) {
+               echo "";
+            } else {
+               $graph ="</td></tr>";
+            }
+         }
+      }
+      return $graph;
+  }
+
+
+   static function displayUsers($url,$device,$generation) {
+
+      $graph ="";
+      if ($device["users_id"]) {
+         if ($generation) {
+            $graph = "URL=\"".$url."\" tooltip=\"".getUserName($device["users_id"])."\"";
+         } else {
+            $graph = "<a href='".$url."'>".getUserName($device["users_id"])."</a>";
+         }
+
+      } else if (!$device["users_id"] && $device["groups_id"]) {
+         if ($generation) {
+            $graph = "URL=\"".$url."\" tooltip=\"".Dropdown::getDropdownName("glpi_groups",
+                                                                             $device["groups_id"])."\"";
+         } else {
+            $graph = "<a href='".$url."'>".Dropdown::getDropdownName("glpi_groups",
+                                                                     $device["groups_id"])."</a>";
+         }
+
+      } else if (!$device["users_id"]
+                 && !$device["groups_id"]
+                 && $device["contact"]) {
+         if ($generation) {
+            $graph = "URL=\"".$url."\" tooltip=\"".$device["contact"]."\"";
+         } else {
+            $graph = "<a href='".$url."'>".$device["contact"]."</a>";
+         }
+
+      } else {
+         if ($generation) {
+            $graph = "URL=\"".$url."\" tooltip=\"".$device["name"]."\"";
+         } else {
+            $graph = "<a href='".$url."'>".$device["name"]."</a>";
+         }
+      }
+      return $graph;
+   }
+
+
+   static function test($item) {
+      global $DB,$CFG_GLPI;
+
+      $ID                       = $item->getID();
+      $type                     = $item->getType();
+      $plugin_archires_views_id = $item->fields["plugin_archires_views_id"];
+
+      if (!$plugin_archires_views_id) {
+         return false;
+      }
+      $plugin             = new Plugin();
+      $PluginArchiresView = new PluginArchiresView();
+
+      if ($plugin->isActivated("appliances")) {
+         $PluginArchiresApplianceQuery = new PluginArchiresApplianceQuery();
+      }
+      $PluginArchiresLocationQuery         = new PluginArchiresLocationQuery();
+      $PluginArchiresNetworkEquipmentQuery = new PluginArchiresNetworkEquipmentQuery();
+      $PluginArchiresStateColor            = new PluginArchiresStateColor();
+      $PluginArchiresImageItem             = new PluginArchiresImageItem();
+
+      $PluginArchiresView->getFromDB($plugin_archires_views_id);
+
+      $devices = [];
+      $ports   = [];
+
+      echo "<br><div class='center'>";
+      echo "<table class='tab_cadre_fixe'cellpadding='2' width='75%'>";
+      echo "<tr><th colspan='6'>".__('Item')."</th></tr>";
+      echo "<tr><th>".__('Graphviz name', 'archires')."</th>";
+      echo "<th>".__('Associated picture', 'archires')."</th>";
+      echo "<th>".__('Name of item', 'archires')."</th>";
+      echo "<th>".sprintf(__('%1$s / %2$s'), __('Type'), __('IP'))."</th>";
+      echo "<th>".__('Status')."</th>";
+      echo "<th>".sprintf(__('%1$s / %2$s'), __('User'),
+                          sprintf(__('%1$s / %2$s'), __('Group'), __('Contact')))."</th></tr>";
+
+      if ($type == 'PluginArchiresLocationQuery') {
+         $devices = $PluginArchiresLocationQuery->Query($ID, $PluginArchiresView, true);
+         $ports   = $PluginArchiresLocationQuery->Query($ID, $PluginArchiresView, false);
+
+      } else if ($type == 'PluginArchiresNetworkEquipmentQuery') {
+         $devices = $PluginArchiresNetworkEquipmentQuery->Query($ID, $PluginArchiresView, true);
+         $ports   = $PluginArchiresNetworkEquipmentQuery->Query($ID, $PluginArchiresView, false);
+
+      } else if ($type == 'PluginArchiresApplianceQuery') {
+         $devices = $PluginArchiresApplianceQuery->Query($ID, $PluginArchiresView, true);
+         $ports   = $PluginArchiresApplianceQuery->Query($ID, $PluginArchiresView, false);
+      }
+
+      foreach ($devices as $itemtype => $typed_devices) {
+         foreach ($typed_devices as $device_id => $device) {
+            $device_unique_name  = $itemtype . "_" . $device_id . "_";
+            $device_unique_name .= $device["name"];
+
+            $image_name = $PluginArchiresImageItem->displayItemImage($device["type"], $itemtype,
+                                                                     true);
+            $link       = Toolbox::getItemTypeFormURL($itemtype);
+            $url        = $link."?id=".$device_id;
+
+            echo "<tr class='tab_bg_1'>";
+            echo "<td>$device_unique_name</td>";
+            echo "<td class='center'><img src='$image_name' alt='$image_name'></td>";
+            echo "<td>" . $device["name"]."</td>";
+
+            echo "<td>";
+            echo self::displayTypeAndIP($PluginArchiresView, $itemtype, $device, false);
+            echo  "</td>";
+
+            echo  "<td>";
+            if ($PluginArchiresView->fields["display_state"]!=0 && isset($device["states_id"])) {
+               echo $PluginArchiresStateColor->displayColorState($device);
+            }
+            echo  "</td>";
+
+            echo  "<td>";
+            echo self::displayUsers($url, $device, false);
+            echo  "</td>";
+            echo  "</tr>";
+         }
+      }
+      echo "</table>";
+
+      echo "<br><table class='tab_cadre_fixe' cellpadding='2' width='75%'>";
+      echo "<tr><th colspan='6'>"._n('Link', 'Links', 2, 'archires')."</th></tr>";
+      echo "<tr><th>".__('Graphviz links', 'archires')."</th>";
+      echo "<th>".__('IP item 1', 'archires')."</th>";
+      echo "<th>".__('Socket item 1', 'archires')."</th>";
+      echo "<th>".__('Associated picture', 'archires')."</th>";
+      echo "<th>".__('Socket item 2', 'archires')."</th>";
+      echo "<th>".__('IP item 2', 'archires')."</th></tr>";
+
+      $wires = [];
+
+      $query = ['SELECT'   => ['id', 'networkports_id_1', 'networkports_id_2'],
+                'FROM'     => 'glpi_networkports_networkports'];
+
+      if ($result = $DB->request($query)) {
+         while ($data = $result->next()) {
+            $wires[$data["id"]]["networkports_id_1"] = $data["networkports_id_1"];
+            $wires[$data["id"]]["networkports_id_2"] = $data["networkports_id_2"];
+         }
+      }
+
+      foreach ($wires as $wire) {
+         if (isset($ports[$wire["networkports_id_1"]])
+             && !empty($ports[$wire["networkports_id_1"]])
+             && isset($ports[$wire["networkports_id_2"]])
+             && !empty($ports[$wire["networkports_id_2"]])) {
+
+            $items_id1              = $ports[$wire["networkports_id_1"]]["items_id"];
+            $itemtype1              = $ports[$wire["networkports_id_1"]]["itemtype"];
+            $logical_number1        = $ports[$wire["networkports_id_1"]]["logical_number"];
+            $name1                  = $ports[$wire["networkports_id_1"]]["namep"];
+            $ID1                    = $ports[$wire["networkports_id_1"]]["idp"];
+            $ip1                    = $ports[$wire["networkports_id_1"]]["ip"];
+            $device_unique_name1    = $itemtype1 . "_" . $items_id1 . "_";
+            $device_unique_name1   .= $devices[$itemtype1][$items_id1]["name"];
+
+            $items_id2              = $ports[$wire["networkports_id_2"]]["items_id"];
+            $itemtype2              = $ports[$wire["networkports_id_2"]]["itemtype"];
+            $logical_number2        = $ports[$wire["networkports_id_2"]]["logical_number"];
+            $name2                  = $ports[$wire["networkports_id_2"]]["namep"];
+            $ID2                    = $ports[$wire["networkports_id_2"]]["idp"];
+            $ip2                    = $ports[$wire["networkports_id_2"]]["ip"];
+            $device_unique_name2    = $itemtype2 . "_" . $items_id2 . "_";
+            $device_unique_name2   .= $devices[$itemtype2][$items_id2]["name"];
+
+            echo "<tr class='tab_bg_1'>";
+
+            if ($PluginArchiresView->fields["display_ports"]!=0
+                && $PluginArchiresView->fields["engine"]!=1) {
+
+               $url_ports = $CFG_GLPI["root_doc"] . "/front/networkport.form.php?id=";
+               echo  "<td>".printf(__('%1$s - %2$s'), $device_unique_name1, $device_unique_name2).
+                     "</td>";
+
+               if ($PluginArchiresView->fields["display_ip"]!=0) {
+                  echo  "<td>".$ip1."</td>";
+               } else {
+                  echo  "<td></td>";
+               }
+               echo "<td><a href='".$url_ports.$ID1."'>".$name1."</a> - ".
+                           __('Socket', 'archires')." ".$logical_number1."</td>";
+               echo "<td class='center'><img src= \"../pics/socket.png\" alt='../pics/socket.png' />";
+               echo "</td><td><a href='".$url_ports.$ID2."'>".$name2."</a> - ".
+                               __('Socket', 'archires')." ".$logical_number2."</td>";
+               if ($PluginArchiresView->fields["display_ip"]!=0) {
+                  echo  "<td>".$ip2."</td>";
+               } else {
+                  echo  "<td></td>";
+               }
+            } else {
+
+               echo  "<td>".$device_unique_name1." -- ".$device_unique_name2 ."</td>";
+               echo "<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>";
+            }
+         }
+      }
+      echo "</tr></table>";
+
+      echo "<br><table class='tab_cadre' cellpadding='2'>";
+      echo "<tr><th>".__('Test Graphviz', 'archires')."</th></tr>";
+      echo "<tr class='tab_bg_1'><td>";
+      echo "<img src='./archires.test.php' alt=''>";
+      echo "</td></tr>";
+      echo "</table>";
+
+      echo "</div>";
+   }
+
+
+   function graphItems($device,$device_id,$itemtype,$format,$image_name,$url,$PluginArchiresView) {
+      global $DB;
+
+      $PluginArchiresStateColor = new PluginArchiresStateColor();
+
+      $device_unique_name  = $itemtype . "_" . $device_id . "_";
+      $device_unique_name .= $device["name"];
+
+      $graph  = "\"".$device_unique_name."\"[shape=plaintext, label=";
+      //label
+      $graph .= "<<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
+
+      //img
+      $graph .= "<tr><td><img src=\"".realpath(GLPI_ROOT)."/plugins/archires/".$image_name. "\"/>".
+                "</td></tr>";
+
+      $graph .= "<tr><td> </td></tr><tr><td>".$device["name"];
+      //ip / type
+      $graph .= self::displayTypeAndIP($PluginArchiresView, $itemtype, $device, true);
+      //entity
+      if (($PluginArchiresView->fields["display_entity"] != 0) && isset($device["entity"])) {
+         $graph .= "<tr><td>".$this->CleanField(Dropdown::getDropdownName("glpi_entities",
+                                                                          $device["entity"])).
+                   "</td></tr>";
+      }
+      //location
+      if (($PluginArchiresView->fields["display_location"] != 0) && isset($device["locations_id"])) {
+         $graph .= "<tr><td>".$this->CleanField(Dropdown::getDropdownName("glpi_locations",
+                                                                          $device["locations_id"])).
+                   "</td></tr>";
+      }
+
+      //state
+      if (($PluginArchiresView->fields["display_state"] !=0 ) && isset($device["states_id"])) {
+         $graph .="<tr><td>".$PluginArchiresStateColor->displayColorState($device)."</td></tr>";
+      }
+
+      $graph .= "</table>>";
+      //end label
+
+      //link - users
+      $graph .=self::displayUsers($url, $device, true);
+
+      $graph .="];\n";
+
+      return $graph;
+   }
+
+
+   function graphPorts($devices, $ports, $wire, $format, $PluginArchiresView) {
+      global $DB, $CFG_GLPI;
+
+      $PluginArchiresNetworkInterfaceColor = new PluginArchiresNetworkInterfaceColor();
+      $PluginArchiresVlanColor             = new PluginArchiresVlanColor();
+
+      $items_id1              = $ports[$wire["networkports_id_1"]]["items_id"];
+      $itemtype1              = $ports[$wire["networkports_id_1"]]["itemtype"];
+      $logical_number1        = $ports[$wire["networkports_id_1"]]["logical_number"];
+      $name1                  = $ports[$wire["networkports_id_1"]]["namep"];
+      $ID1                    = $ports[$wire["networkports_id_1"]]["idp"];
+      $ip1                    = $ports[$wire["networkports_id_1"]]["ip"];
+      $netmask1               = $ports[$wire["networkports_id_2"]]["netmask"];
+      $device_unique_name1    = $itemtype1 . "_" . $items_id1 . "_";
+      $device_unique_name1   .= $devices[$itemtype1][$items_id1]["name"];
+
+      $items_id2              = $ports[$wire["networkports_id_2"]]["items_id"];
+      $itemtype2              = $ports[$wire["networkports_id_2"]]["itemtype"];
+      $logical_number2        = $ports[$wire["networkports_id_2"]]["logical_number"];
+      $name2                  = $ports[$wire["networkports_id_2"]]["namep"];
+      $ID2                    = $ports[$wire["networkports_id_2"]]["idp"];
+      $ip2                    = $ports[$wire["networkports_id_2"]]["ip"];
+      $netmask2               = $ports[$wire["networkports_id_2"]]["netmask"];
+      $device_unique_name2    = $itemtype2 . "_" . $items_id2 . "_";
+      $device_unique_name2   .= $devices[$itemtype2][$items_id2]["name"];
+
+      $graph = "";
+
+      if ($PluginArchiresView->fields["color"] == PluginArchiresView::PLUGIN_ARCHIRES_NETWORK_COLOR ) {
+         if (empty($networkinterfaces_id1) && empty($networkinterfaces_id2)) {
+            $graph .= "edge [color=black,arrowsize=1, fontname=\"Verdana\", fontsize=\"5\"];\n";
+
+         } else if (!empty($networkinterfaces_id1)) {
+            if ($PluginArchiresNetworkInterfaceColor->getFromDBbyNetworkInterface($networkinterfaces_id1)) {
+               $graph .= "edge [color=".$PluginArchiresNetworkInterfaceColor->fields["color"].",
+                                fontname=\"Verdana\", fontsize=\"5\"];\n";
+            } else {
+               $graph .= "edge [color=black,arrowsize=1, fontname=\"Verdana\", fontsize=\"5\"];\n";
+            }
+
+         } else {
+            if ($PluginArchiresNetworkInterfaceColor->getFromDBbyNetworkInterface($networkinterfaces_id2)) {
+               $graph .= "edge [color=".$PluginArchiresNetworkInterfaceColor->fields["color"].",
+                                fontname=\"Verdana\", fontsize=\"5\"];\n";
+            } else {
+               $graph .= "edge [color=black,arrowsize=1, fontname=\"Verdana\", fontsize=\"5\"];\n";
+            }
+         }
+      } else if ($PluginArchiresView->fields["color"] == PluginArchiresView::PLUGIN_ARCHIRES_VLAN_COLOR) {
+         $vlan1 = $PluginArchiresVlanColor->getVlanbyNetworkPort($ID1);
+         $vlan2 = $PluginArchiresVlanColor->getVlanbyNetworkPort($ID2);
+
+         if (empty($vlan1) && empty($vlan2)) {
+            $graph .= "edge [color=black,arrowsize=1, fontname=\"Verdana\", fontsize=\"5\"];\n";
+
+         } else if (!empty($vlan1)) {
+            if ($PluginArchiresVlanColor->getFromDBbyVlan($vlan1)) {
+               $graph .= "edge [color=".$PluginArchiresVlanColor->fields["color"].",
+                                fontname=\"Verdana\", fontsize=\"5\"];\n";
+            } else {
+               $graph .= "edge [color=black,arrowsize=1, fontname=\"Verdana\", fontsize=\"5\"];\n";
+            }
+
+         } else {
+            if ($PluginArchiresVlanColor->getFromDBbyVlan($vlan2)) {
+               $graph .= "edge [color=".$PluginArchiresVlanColor->fields["color"].",
+                                fontname=\"Verdana\", fontsize=\"5\"];\n";
+            } else {
+               $graph .= "edge [color=black,arrowsize=1, fontname=\"Verdana\", fontsize=\"5\"];\n";
+            }
+         }
+      }
+      //Display Ports
+      if (($PluginArchiresView->fields["display_ports"] != 0)
+          && ($PluginArchiresView->fields["engine"] != 1)) {
+         $url_ports = $CFG_GLPI["root_doc"] . "/front/networkport.form.php?id=";
+         $graph .= "\"".$device_unique_name1."\"";
+         $graph .= " -- \"".$device_unique_name2."\"[label=";
+         $graph .= "<<table border=\"0\" cellpadding=\"2\" cellspacing=\"2\">";
+         //display ip ports
+         if ($PluginArchiresView->fields["display_ip"] != 0) {
+            if (!empty($ip1)) {
+               $graph .= "<tr><td>".$ip1;
+               if (!empty($netmask1)) {
+                  $graph = sprintf(__('%1$s / %2$s'), $graph, $netmask1);
+               }
+               $graph .= "</td></tr>";
+            }
+         }
+         $graph .= "<tr><td HREF=\"".$url_ports.$ID1."\" tooltip=\"".$name1;
+         if ($_SESSION["glpiis_ids_visible"] || empty($name1)) {
+            $graph.= "_".$ID1."_";
+         }
+         $graph .= "\">";
+
+         if ($PluginArchiresView->fields["display_ports"]==1) {
+            $graph .= __('Socket', 'archires')." ".$logical_number1;
+         } else if ($PluginArchiresView->fields["display_ports"]==2) {
+            $graph .= $name1;
+            if ($_SESSION["glpiis_ids_visible"] || empty($name1)) {
+                $graph = sprintf(__('%1$s (%2$s)'), $graph, $ID1);
+            }
+         }
+         $graph .= "</td></tr>";
+
+         if ($format!='svg') {
+            $graph .= "<tr><td><img src= '../pics/socket.png' /></td></tr>";
+         } else {
+            $graph .= "<tr><td><img src=\"".realpath(GLPI_ROOT)."/plugins/archires/pics/socket.png\"/>".
+                      "</td></tr>";
+         }
+         $graph .= "<tr><td HREF=\"".$url_ports.$ID2."\" tooltip=\"".$name2;
+         if ($_SESSION["glpiis_ids_visible"] || empty($name2)) {
+            $graph.= "_".$ID2."_";
+         }
+         $graph .= "\">";
+
+         if ($PluginArchiresView->fields["display_ports"]==1) {
+            $graph .= __('Socket', 'archires')." ".$logical_number2;
+         } else if ($PluginArchiresView->fields["display_ports"]==2) {
+            $graph .= $name2;
+            if ($_SESSION["glpiis_ids_visible"] || empty($name2)) {
+               $graph = sprintf(__('%1$s (%2$s)'), $graph, $ID2);
+            }
+         }
+         $graph .= "</td></tr>";
+
+         //display ip ports
+         if ($PluginArchiresView->fields["display_ip"] != 0) {
+            if (!empty($ip2)) {
+               $graph .= "<tr><td>".$ip2;
+               if (!empty($netmask2)) {
+                  $graph = sprintf(__('%1$s / %2$s'), $graph, $netmask2);
+               }
+               $graph .= "</td></tr>";
+            }
+         }
+         $graph .= "</table>>];\n";
+
+      } else {
+         $graph .= "\"".$device_unique_name1."\"";
+         $graph .= " -- \"".$device_unique_name2."\";\n";
+      }
+
+      return $graph;
+   }
+
+
+   static function displayGraph($item, $plugin_archires_views_id, $select=0) {
+      global $DB,$CFG_GLPI;
+
+      $querytype   = $item->getType();
+      $ID          = $item->getID();
+      $object_view = $item->fields["plugin_archires_views_id"];
+      $graph       = new self();
+
+      if (!isset($plugin_archires_views_id)) {
+        $plugin_archires_views_id = $object_view;
+      }
+      if (!$object_view && !$plugin_archires_views_id) {
+        return false;
+      }
+
+      $PluginArchiresView                  = new PluginArchiresView();
+      $PluginArchiresView->getFromDB($plugin_archires_views_id);
+      $PluginArchiresNetworkInterfaceColor = new PluginArchiresNetworkInterfaceColor();
+      $PluginArchiresVlanColor             = new PluginArchiresVlanColor();
+      $PluginArchiresStateColor            = new PluginArchiresStateColor();
+
+      echo "<div class='center'>";
+      $PluginArchiresView->viewSelect($item, $plugin_archires_views_id, $select);
+      echo "</div>";
+
+      if (isset($ID) && !empty($ID)) {
+         echo "<img src='".$CFG_GLPI["root_doc"]."/plugins/archires/front/archires.map.php?id=".$ID.
+               "&amp;querytype=".$querytype."&amp;plugin_archires_views_id=".$plugin_archires_views_id.
+               "' alt='' usemap='#G'>";
+         echo $graph->createGraph("cmapx", $item, $plugin_archires_views_id);
+      }
+      //legend
+      if (isset($ID) && !empty($ID)) {
+         echo "<div class='center'>";
+         echo "<table cellpadding='5'>";
+         echo "<tr><td class='top'>";
+         if ( $PluginArchiresView->fields["color"] == 0 ) {
+            $PluginArchiresNetworkInterfaceColor->showConfigForm();
+         } else if ($PluginArchiresView->fields["color"] == 1 ) {
+            $PluginArchiresVlanColor->showConfigForm();
+         }
+         echo "</td><td>".$PluginArchiresStateColor->showConfigForm()."</td>";
+         echo "</tr>";
+         echo "</table>";
+         echo "</div>";
+
+      } else {
+         echo "<div class='center'><br><br><img src=\"".$CFG_GLPI["root_doc"].
+               "/pics/warning.png\" alt='warning'><br><br>";
+         echo "<b>".__('No item found')."</b></div>";
+      }
+   }
+
+
+   function createGraph($format,$obj,$plugin_archires_views_id) {
+      global $DB,$CFG_GLPI;
+
+      $type        = get_class($obj);
+      $ID          = $obj->fields["id"];
+      $object_view = $obj->fields["plugin_archires_views_id"];
+
+      if (!isset($plugin_archires_views_id)) {
+        $plugin_archires_views_id = $object_view;
+      }
+      $PluginArchiresView = new PluginArchiresView();
+
+      $plugin = new Plugin();
+      if ($plugin->isActivated("appliances")) {
+         $PluginArchiresApplianceQuery = new PluginArchiresApplianceQuery();
+      }
+      $PluginArchiresLocationQuery         = new PluginArchiresLocationQuery();
+      $PluginArchiresNetworkEquipmentQuery = new PluginArchiresNetworkEquipmentQuery();
+      $PluginArchiresImageItem             = new PluginArchiresImageItem();
+
+      $PluginArchiresView->getFromDB($plugin_archires_views_id);
+
+      $devices = [];
+      $ports   = [];
+
+      if ($type == 'PluginArchiresLocationQuery') {
+         $devices = $PluginArchiresLocationQuery->Query($ID, $PluginArchiresView, true);
+         $ports   = $PluginArchiresLocationQuery->Query($ID, $PluginArchiresView, false);
+
+      } else if ($type == 'PluginArchiresNetworkEquipmentQuery') {
+         $devices = $PluginArchiresNetworkEquipmentQuery->Query($ID, $PluginArchiresView, true);
+         $ports   = $PluginArchiresNetworkEquipmentQuery->Query($ID, $PluginArchiresView, false);
+
+      } else if ($type == 'PluginArchiresApplianceQuery') {
+         $devices = $PluginArchiresApplianceQuery->Query($ID, $PluginArchiresView, true);
+         $ports   = $PluginArchiresApplianceQuery->Query($ID, $PluginArchiresView, false);
+      }
+      $wires = [];
+
+      $query = ['SELECT'   => ['id', 'networkports_id_1', 'networkports_id_2'],
+                'FROM'     => 'glpi_networkports_networkports'];
+
+      if ($result = $DB->request($query)) {
+         while ($data = $result->next()) {
+            $wires[$data["id"]]["networkports_id_1"] = $data["networkports_id_1"];
+            $wires[$data["id"]]["networkports_id_2"] = $data["networkports_id_2"];
+         }
+      }
+
+      $graph  = "graph G {\n";
+      $graph .= "overlap=false;\n";
+
+      $graph .= "bgcolor=white;\n";
+
+      //items
+      $graph .= "node [shape=polygon, sides=6, fontname=\"Verdana\", fontsize=\"5\"];\n";
+
+      foreach ($devices as $itemtype => $typed_devices) {
+         foreach ($typed_devices as $device_id => $device) {
+            $image_name = $PluginArchiresImageItem->displayItemImage($device["type"], $itemtype,
+                                                                     false);
+            $link = Toolbox::getItemTypeFormURL($itemtype);
+            $url = $link."?id=".$device_id;
+
+            $graph .= $this->graphItems($device, $device_id, $itemtype, $format, $image_name, $url,
+                                        $PluginArchiresView);
+         }
+      }
+
+      foreach ($wires as $wire) {
+         if (!empty($ports[$wire["networkports_id_1"]])
+             && !empty($ports[$wire["networkports_id_2"]])
+             && isset($ports[$wire["networkports_id_1"]])
+             && isset($ports[$wire["networkports_id_2"]]) ) {
+
+            $graph .= $this->graphPorts($devices,$ports,$wire,$format,$PluginArchiresView);
+         }
+      }
+
+      $graph .= "}\n";
+
+      return $this->generateGraphviz($graph,$format,$PluginArchiresView);
+   }
+
+
+   function generateGraphviz($graph, $format, $PluginArchiresView) {
+
+      if ($PluginArchiresView->fields["engine"] != 0) {
+         $engine_archires = "neato";
+      } else {
+         $engine_archires = "dot";
+      }
+
+      return self::dotIt($engine_archires, $graph, $format);
+   }
+
+
+   static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) {
+
+      switch ($item->getType()) {
+         case 'PluginArchiresApplianceQuery' :
+         case 'PluginArchiresLocationQuery' :
+         case 'PluginArchiresNetworkEquipmentQuery' :
+            switch ($tabnum) {
+               case 1 :
+                  self::test($item);
+                  break;
+
+               case 2 :
+                  $plugin_archires_views_id = $item->fields["plugin_archires_views_id"];
+                  self::displayGraph($item, $plugin_archires_views_id);
+                  PluginArchiresView::linkToAllViews($item);
+                  break;
+            }
+            break;
+      }
+      return true;
+   }
+
+
+   function getTabNameForItem(CommonGLPI $item, $withtemplate=0) {
+
+      if (!$withtemplate && Session::haveRight("plugin_archires", READ)) {
+         switch ($item->getType()) {
+            case 'PluginArchiresApplianceQuery' :
+            case 'PluginArchiresLocationQuery' :
+            case 'PluginArchiresNetworkEquipmentQuery' :
+               return ['1' => __('Test'),
+                       '2' => __('Generation', 'archires')];
+         }
+      }
+      return '';
+   }
+
+}

+ 244 - 0
inc/querytype.class.php

@@ -0,0 +1,244 @@
+<?php
+/*
+ * @version $Id: querytype.class.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+ */
+
+if (!defined('GLPI_ROOT')) {
+   die("Sorry. You can't access directly to this file");
+}
+
+class PluginArchiresQueryType extends CommonDBTM {
+
+   static $rightname = "plugin_archires";
+
+
+   function getFromDBbyType($itemtype, $type,$type_query,$query_ID) {
+      global $DB;
+
+      $query = ['FROM'  => $this->getTable(),
+                'WHERE' => ['itemtype'                   => $itemtype,
+                            'type'                       => $type,
+                            'querytype'                  => $type_query,
+                            'plugin_archires_queries_id' => $query_ID]];
+
+      if ($result = $DB->request($query)) {
+         if (count($result) != 1) {
+            return false;
+         }
+         $this->fields = $result->next();
+         if (is_array($this->fields) && count($this->fields)) {
+            return true;
+         }
+      }
+      return false;
+   }
+
+
+   function addType($querytype, $type, $itemtype, $plugin_archires_queries_id) {
+      global $DB;
+
+      $dbu = new DbUtils();
+
+      if ($type != '-1') {
+         if (!$this->getFromDBbyType($itemtype, $type, $querytype, $plugin_archires_queries_id)) {
+            $this->add(['itemtype'                   => $itemtype,
+                        'type'                       => $type,
+                        'querytype'                  => $querytype,
+                        'plugin_archires_queries_id' => $plugin_archires_queries_id]);
+         }
+      } else {
+         $query = ['FROM' => $dbu->getTableForItemType($itemtype."Type")];
+         $result = $DB->request($query);
+         $i      = 0;
+
+         while ($i < count($result)) {
+            $row = $result->next();
+            $type_table = $row['id'];
+            if (!$this->getFromDBbyType($itemtype, $type_table, $querytype,
+                                        $plugin_archires_queries_id)) {
+               $this->add(['itemtype'                   => $itemtype,
+                           'type'                       => $type_table,
+                           'querytype'                  => $querytype,
+                           'plugin_archires_queries_id' => $plugin_archires_queries_id]);
+            }
+            $i++;
+         }
+      }
+   }
+
+
+   function queryTypeCheck($querytype, $plugin_archires_views_id, $val) {
+      global $DB;
+
+      $dbu = new DbUtils();
+
+      $query0 = ['FROM'    => $this->getTable(),
+                 'WHERE'   => ['querytype'                  => $querytype,
+                               'plugin_archires_queries_id' => $plugin_archires_views_id,
+                               'itemtype'                   => $val]];
+      $result0 = $DB->request($query0);
+      $query   = "";
+
+      if (count($result0)) {
+        $itemtable = $dbu->getTableForItemType($val);
+        $query     = "AND `$itemtable`.`".getForeignKeyFieldForTable($dbu->getTableForItemType($val."Type"))."`
+                           IN (0 ";
+         while ($data0 = $result0->next()) {
+            $query .= ", ".$data0["type"];
+         }
+         $query .= ") ";
+      }
+      return $query;
+   }
+
+
+   static function showTypes($item) {
+      global $DB;
+
+      $type     = $item->getType();
+      $ID       = $item->getID();
+
+      if ($type == 'PluginArchiresLocationQuery') {
+         $page = "locationquery";
+      } else if ($type == 'PluginArchiresNetworkEquipmentQuery') {
+         $page = "networkequipmentquery";
+      } else if ($type == 'PluginArchiresApplianceQuery') {
+         $page = "appliancequery";
+      }
+
+      $PluginArchiresArchires = new PluginArchiresArchires();
+
+      if (Session::haveRight("plugin_archires", UPDATE)) {
+         echo "<form method='post' action=\"./".$page.".form.php\">";
+         echo "<table class='tab_cadre' cellpadding='5' width='34%'><tr><th colspan='2'>";
+         echo __('Display types of items', 'archires')."</th></tr>";
+         echo "<tr class='tab_bg_1'><td>";
+         $PluginArchiresArchires->showAllItems("type", 0, 0, $_SESSION["glpiactive_entity"]);
+         echo "</td>";
+         echo "<td>";
+         echo "<input type='hidden' name='query' value='$ID'>";
+         echo "<input type='submit' name='addtype' value=\""._sx('button', 'Add')."\" class='submit'>";
+         echo "</td></tr>";
+         echo "</table>";
+         Html::closeForm();
+      }
+
+      $query = ['FROM'  => 'glpi_plugin_archires_querytypes',
+                'WHERE' => ['plugin_archires_queries_id' => $ID,
+                            'querytype'                  => $type],
+                'ORDER' => ['itemtype ASC', 'type ASC']];
+
+      if ($result = $DB->request($query)) {
+         $number = count($result);
+         if ($number) {
+            echo "<div id='liste'>";
+            if (Session::haveRight("plugin_archires", UPDATE)) {
+               $rand = mt_rand();
+               Html::openMassiveActionsForm('mass'.__CLASS__.$rand);
+               $massiveactionparams = ['num_displayed'    => $number,
+                                       'container'        => 'mass'.__CLASS__.$rand];
+               Html::showMassiveActions($massiveactionparams);
+            }
+            echo "<table class='tab_cadre' cellpadding='5' width='63%'>";
+            echo "<tr>";
+            if (Session::haveRight("plugin_archires", UPDATE)) {
+               echo "<th width='10'>";
+               Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand);
+               echo "</th>";
+            }
+            echo "<th class='left'>".__('Item')."</th>";
+            echo "<th class='left'>".__('Item type')."</th><th></th>";
+            echo "</tr>";
+
+            while ($ligne = $result->next()) {
+               $ID = $ligne["id"];
+               echo "<tr class='tab_bg_1'>";
+               echo "<td width='10'>";
+               if (Session::haveRight("plugin_archires", UPDATE)) {
+                  Html::showMassiveActionCheckBox(__CLASS__, $ID);
+               } else {
+                  echo "&nbsp;";
+               }
+               $item = new $ligne["itemtype"]();
+               echo "<td>".$item->getTypeName()."</td>";
+               $class     = $ligne["itemtype"]."Type";
+               $typeclass = new $class();
+               $typeclass->getFromDB($ligne["type"]);
+               echo "<td>".$typeclass->fields["name"]."</td>";
+               echo "<td>";
+               echo "<input type='hidden' name='id' value='$ID'>";
+               echo "</td>";
+            }
+
+            echo "</table>";
+            if (Session::haveRight("plugin_archires", UPDATE)) {
+               $massiveactionparams['ontop'] = false;
+               Html::showMassiveActions($massiveactionparams);
+            }
+            echo "</div>";
+            Html::closeForm();
+         }
+      }
+   }
+
+
+   static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) {
+
+      switch ($item->getType()) {
+         case 'PluginArchiresApplianceQuery' :
+         case 'PluginArchiresLocationQuery' :
+         case 'PluginArchiresNetworkEquipmentQuery' :
+            self::showTypes($item);
+            break;
+      }
+      return true;
+   }
+
+
+   function getTabNameForItem(CommonGLPI $item, $withtemplate=0) {
+
+      if (!$withtemplate && Session::haveRight("plugin_archires", READ)) {
+          switch ($item->getType()) {
+            case 'PluginArchiresApplianceQuery' :
+            case 'PluginArchiresLocationQuery' :
+            case 'PluginArchiresNetworkEquipmentQuery' :
+               return __('Item type');
+         }
+      }
+      return '';
+   }
+
+
+   function getForbiddenStandardMassiveAction() {
+
+      $forbidden   = parent::getForbiddenStandardMassiveAction();
+      $forbidden[] = 'update';
+      return $forbidden;
+   }
+}

+ 224 - 0
inc/statecolor.class.php

@@ -0,0 +1,224 @@
+<?php
+/*
+ * @version $Id: statecolor.class.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+ */
+
+if (!defined('GLPI_ROOT')) {
+   die("Sorry. You can't access directly to this file");
+}
+
+class PluginArchiresStateColor extends CommonDBTM {
+
+   static $rightname = "plugin_archires";
+
+
+   function getFromDBbyState($state) {
+      global $DB;
+
+      $query = ['FROM'  => $this->getTable(),
+                'WHERE' => ['states_id' => $state]];
+
+      if ($result = $DB->request($query)) {
+         if (count($result) != 1) {
+            return false;
+         }
+         $this->fields = $result->next();
+         if (is_array($this->fields) && count($this->fields)) {
+            return true;
+         }
+      }
+      return false;
+   }
+
+
+   function addStateColor($state,$color) {
+      global $DB;
+
+      if ($state != '-1') {
+         if ($this->getfromDBbyState($state)) {
+            $this->update(['id'    => $this->fields['id'],
+                           'color' => $color]);
+         } else {
+            $this->add(['states_id' => $state,
+                        'color'     => $color]);
+         }
+      } else {
+         $query  = ['FROM' => 'glpi_states'];
+         $result = $DB->request($query);
+         $i      = 0;
+
+         while ($i < count($result)) {
+            $row = $result->next();
+            $state_table = $row['id'];
+            if ($this->getfromDBbyState($state_table)) {
+               $this->update(['id'    => $this->fields['id'],
+                              'color' => $color]);
+            } else {
+               $this->add(['states_id' => $state_table,
+                           'color'     => $color]);
+            }
+            $i++;
+         }
+      }
+   }
+
+
+   function showConfigForm($canupdate=false) {
+      global $DB;
+
+      if ($canupdate) {
+         echo "<div class='firstbloc'>";
+         echo "<form method='post' name='state_color' action='./config.form.php'>";
+         echo "<table class='tab_cadre' cellpadding='5' width='50%'>";
+         echo "<tr><th colspan='3'>".__('Associate colors with items statuses', 'archires').
+              "</th></tr>";
+
+         echo "<tr class='tab_bg_1'><td width='70%'>";
+         $this->dropdownState();
+         echo "</td>";
+         echo "<td><input type='text' name='color'>";
+         echo "&nbsp;";
+         Html::showToolTip(nl2br(__('Please use this color format', 'archires')),
+                           ['link'       => 'http://www.graphviz.org/doc/info/colors.html',
+                            'linktarget' => '_blank']);
+         echo "</td><td></div>";
+         echo "<div class='center'><input type='submit' name='add_color_state' value=\"".
+                                    _sx('button', 'Add')."\" class='submit' ></div></td></tr>";
+         echo "</table></div>";
+         Html::closeForm();
+      }
+
+      $query = ['FROM'  => $this->getTable(),
+                'ORDER' => ['states_id ASC']];
+
+      if ($result = $DB->request($query)) {
+         $number = count($result);
+
+         if ($number) {
+            echo "<div id='liste_color'>";
+            if ($canupdate) {
+               $rand = mt_rand();
+               Html::openMassiveActionsForm('mass'.__CLASS__.$rand);
+               $massiveactionparams = ['num_displayed'    => $number,
+                                       'container'        => 'mass'.__CLASS__.$rand];
+               Html::showMassiveActions($massiveactionparams);
+            }
+            echo "<table class='tab_cadre' cellpadding='5' width='50%'>";
+            echo "<tr>";
+            if ($canupdate) {
+               echo "<th width='10'>";
+               Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand);
+               echo "</th>";
+            }
+            echo "<th class='left' widht='50%'>".__('Status')."</th>";
+            echo "<th class='left'>".__('Color', 'archires')."</th><th></th>";
+            echo "</tr>";
+
+            while ($ligne = $result->next()) {
+               $ID = $ligne["id"];
+               echo "<tr class='tab_bg_1'>";
+                if ($canupdate) {
+                  echo "<td width='10'>";
+                  Html::showMassiveActionCheckBox(__CLASS__, $ID);
+                  echo "</td>";
+               }
+               echo "</td><td>".Dropdown::getDropdownName("glpi_states",$ligne["states_id"])."</td>";
+               echo "<td bgcolor='".$ligne["color"]."'>".$ligne["color"]."</td>";
+               echo "<td><input type='hidden' name='id' value='$ID'>";
+            }
+
+            echo "</table>";
+            if ($canupdate) {
+              $massiveactionparams['ontop'] = false;
+               Html::showMassiveActions($massiveactionparams);
+            }
+            echo "</div>";
+            Html::closeForm();
+         }
+      }
+   }
+
+
+   function dropdownState() {
+      global $DB;
+
+      $colors = [];
+      foreach ($DB->request("glpi_plugin_archires_statecolors") as $color) {
+         $colors[] = $color['states_id'];
+      }
+
+      $query = ['FROM'  => 'glpi_states',
+                'WHERE' => ['NOT' => ['id' => [implode("','",$colors)]]],
+                'ORDER' => 'name'];
+
+      $result = $DB->request($query);
+
+      if (count($result)) {
+         $values = [1 => __('All statuses', 'archires')];
+         while ($data = $result->next()) {
+            $values[$data['id']] = $data["name"];
+         }
+         Dropdown::showFromArray('states_id', $values, ['width'               => '80%',
+                                                        'display_emptychoice' => true]);
+      }
+   }
+
+
+   function displayColorState($device) {
+      global $DB;
+
+      $graph       = "";
+      $query_state = ['FROM'  => $this->getTable(),
+                      'WHERE' => ['states_id' => $device["states_id"]]];
+
+      $result_state = $DB->request($query_state);
+      $number_state = count($result_state);
+
+      if ($number_state && ($device["states_id"] > 0)) {
+         $row = $result_state->next();
+         $color_state = $row['color'];
+         $graph ="<font color=\"$color_state\">".Dropdown::getDropdownName("glpi_states",
+                                                                           $device["states_id"])
+                ."</font>";
+      } else if (!$number_state && ($device["states_id"] > 0)) {
+         $graph = Dropdown::getDropdownName("glpi_states",$device["states_id"]);
+      }
+      return $graph;
+   }
+
+
+
+   function getForbiddenStandardMassiveAction() {
+
+      $forbidden   = parent::getForbiddenStandardMassiveAction();
+      $forbidden[] = 'update';
+      return $forbidden;
+   }
+
+}

+ 561 - 0
inc/view.class.php

@@ -0,0 +1,561 @@
+<?php
+/*
+ * @version $Id: view.class.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+ */
+
+if (!defined('GLPI_ROOT')) {
+   die("Sorry. You can't access directly to this file");
+}
+
+class PluginArchiresView extends CommonDBTM {
+
+   static $rightname = "plugin_archires";
+
+   const PLUGIN_ARCHIRES_NETWORK_COLOR = 0;
+   const PLUGIN_ARCHIRES_VLAN_COLOR    = 1;
+
+   const PLUGIN_ARCHIRES_JPEG_FORMAT = 0;
+   const PLUGIN_ARCHIRES_PNG_FORMAT  = 1;
+   const PLUGIN_ARCHIRES_GIF_FORMAT  = 2;
+   const PLUGIN_ARCHIRES_SVG_FORMAT  = 3;
+
+
+   static function getTypeName($nb=0) {
+      return _n('View', 'Views', $nb);
+   }
+
+
+   function rawSearchOptions() {
+
+      $tab = [];
+
+      $tab[] = ['id'             => 'common',
+               'name'           => self::getTypeName(2)];
+
+      $tab[] = ['id'             => '1',
+               'table'          => $this->getTable(),
+               'field'          =>'name',
+               'name'           => __('Name'),
+               'datatype'       => 'itemlink',
+               'itemlink_type'  => $this->getType()];
+
+      $tab[] = ['id'             => '2',
+               'table'          => $this->getTable(),
+               'field'          => 'computer',
+               'name'           => _n('Computer', 'Computers', 2),
+               'datatype'       => 'bool'];
+
+
+      $tab[] = ['id'             => '3',
+               'table'          => $this->getTable(),
+               'field'          => 'networking',
+               'name'           => _n('Network equipment', 'Network equipments', 2, 'archires'),
+               'datatype'       => 'bool'];
+
+      $tab[] = ['id'             => '4',
+               'table'          => $this->getTable(),
+               'field'          => 'printer',
+               'name'           => _n('Printer', 'Printers', 2),
+               'datatype'       => 'bool'];
+
+      $tab[] = ['id'             => '5',
+               'table'          => $this->getTable(),
+               'field'          => 'peripheral',
+               'name'           => _n('Device', 'Devices', 2),
+               'datatype'       => 'bool'];
+
+      $tab[] = ['id'             => '6',
+               'table'          => $this->getTable(),
+               'field'          => 'phone',
+               'name'           => _n('Phone', 'Phones', 2),
+               'datatype'       => 'bool'];
+
+      $tab[] = ['id'             => '7',
+               'table'          => $this->getTable(),
+               'field'          => 'display_ports',
+               'name'           => __('Display sockets', 'archires'),
+               'datatype'       => 'text'];
+
+      $tab[] = ['id'             => '8',
+               'table'          => $this->getTable(),
+               'field'          => 'display_ip',
+               'name'           => __('Display IP/Mask', 'archires'),
+               'datatype'       => 'bool'];
+
+      $tab[] = ['id'             => '9',
+               'table'          => $this->getTable(),
+               'field'          => 'display_type',
+               'name'           => __('Display item types', 'archires'),
+               'datatype'       => 'bool'];
+
+      $tab[] = ['id'             => '10',
+               'table'          => $this->getTable(),
+               'field'          => 'display_state',
+               'name'           => __('Display item statuses', 'archires'),
+               'datatype'       => 'bool'];
+
+      $tab[] = ['id'             => '11',
+               'table'          => $this->getTable(),
+               'field'          => 'display_location',
+               'name'           => __('Display item locations', 'archires'),
+               'datatype'       => 'bool'];
+
+      $tab[] = ['id'             => '12',
+               'table'          => $this->getTable(),
+               'field'          => 'display_entity',
+               'name'           => __('Display item entities', 'archires'),
+               'datatype'       => 'bool'];
+
+      $tab[] = ['id'             => '13',
+               'table'          => $this->getTable(),
+               'field'          => 'engine',
+               'name'           => __('Rendering engine', 'archires')];
+
+      $tab[] = ['id'             => '14',
+               'table'          => $this->getTable(),
+               'field'          => 'format',
+               'name'           => __('Image format', 'archires')];
+
+      $tab[] = ['id'             => '15',
+               'table'          => $this->getTable(),
+               'field'          => 'color',
+               'name'           => __('Color', 'archires')];
+
+      return $tab;
+   }
+
+
+   function dropdownObject($obj) {
+      global $DB;
+
+      $dbu = new DbUtils();
+
+      $ID = $obj->fields["id"];
+
+      $query = ['SELECT' => ['id', 'name'],
+                'FROM'   => $obj->getTable(),
+                'WHERE'  => ['is_deleted' => 0]];
+
+      // Add Restrict to current entities
+      if ($obj->isEntityAssign()) {
+         $query['WHERE'] += $dbu->getEntitiesRestrictCriteria($obj->getTable());
+      }
+      $query['ORDER'] = 'name ASC';
+
+      if ($result = $DB->request($query)) {
+         if (count($result)) {
+            echo "<select name='plugin_archires_queries_id' size='1'> ";
+            while ($ligne = $result->next()) {
+               echo "<option value='".$ligne["id"]."' ".(($ligne["id"] == "".$ID."")?" selected ":"").">".
+                     $ligne["name"]."</option>";
+            }
+            echo "</select>";
+         }
+      }
+   }
+
+
+   function dropdownView($obj,$default) {
+      global $DB;
+
+      if (isset($obj->fields["id"])) {
+         $default = $obj->fields["plugin_archires_views_id"];
+      }
+      $query = ['SELECT'   => ['id', 'name'],
+                'FROM'     => $this->getTable(),
+                'WHERE'    => ['is_deleted'  => 0,
+                               'entities_id' => $_SESSION["glpiactive_entity"]],
+                'ORDER'    => 'name ASC'];
+
+      echo "<select name='plugin_archires_views_id' size='1'> ";
+      echo "<option value='0'>".Dropdown::EMPTY_VALUE."</option>\n";
+      if ($result = $DB->request($query)) {
+         while ($ligne= $result->next()) {
+            $view_name = $ligne["name"];
+            $view_id   = $ligne["id"];
+            echo "<option value='".$view_id."' ".($view_id=="".$default.""?" selected ":"").">".
+                  $view_name."</option>";
+         }
+      }
+      echo "</select>";
+   }
+
+
+   static function linkToAllViews($item) {
+
+      echo "<div class='center'>";
+      echo "<a href=\"./archires.graph.php?id=".$item->getID()."&querytype=".$item->getType()."\">".
+             __('See all views', 'archires');
+      echo "</a></div>";
+   }
+
+
+   function viewSelect($obj,$plugin_archires_views_id,$select=0) {
+      global $CFG_GLPI,$DB;
+
+      $querytype   = get_class($obj);
+      $ID          = $obj->fields["id"];
+      $object_view = $obj->fields["plugin_archires_views_id"];
+      if (!isset($plugin_archires_views_id)) {
+         $plugin_archires_views_id = $object_view;
+      }
+      if ($select) {
+         // display only
+         echo "<form method='get' name='selecting' action='".$CFG_GLPI["root_doc"].
+               "/plugins/archires/front/archires.graph.php'>";
+         echo "<table class='tab_cadre' cellpadding='5'>";
+         echo "<tr class='tab_bg_1'>";
+
+         echo "<td class='center'>".__('Display', 'archires');
+         $this->dropdownObject($obj);
+         echo "</td>";
+
+         echo "<td class='center'>".self::getTypeName(2);
+         $this->dropdownView(-1, $plugin_archires_views_id);
+         echo "</td>";
+
+         echo "<td>";
+         echo "<input type='hidden' name='querytype' value=\"".$querytype."\"> ";
+         echo "<input type='submit' class='submit'  name='displayview' value=\"".
+                _sx('button', 'Post')."\"> ";
+         echo "</td>";
+         echo "</tr>";
+         echo "</table>";
+         Html::closeForm();
+      }
+      echo "<a href='".$CFG_GLPI["root_doc"]."/plugins/archires/front/archires.map.php?format=".
+            self::PLUGIN_ARCHIRES_SVG_FORMAT."&amp;id=".$ID."&amp;querytype=".$querytype.
+            "&amp;plugin_archires_views_id=".
+            $plugin_archires_views_id."'>[".__('SVG')."]</a>";
+   }
+
+
+   function showForm($ID, $options=[]) {
+
+      $this->initForm($ID, $options);
+      $this->showFormHeader($options);
+
+      echo "<tr class='tab_bg_1'>";
+      echo "<td colspan='1'>".__('Name')."</td>";
+      echo "<td colspan='3'>";
+      Html::autocompletionTextField($this, "name", ['size' => 20]);
+      echo "</td></tr>";
+
+      echo "<tr class='tab_bg_2'><th colspan='4'>".__('Display of items', 'archires')."</th></tr>";
+
+      echo "<tr class='tab_bg_1'>";
+      echo "<td>"._n('Computer', 'Computers', 2)."</td>";
+      echo "<td>";
+      Dropdown::showYesNo("computer",$this->fields["computer"]);
+      echo "</td>";
+      echo "<td>"._n('Network equipment', 'Network equipments', 2, 'archires')."</td>";
+      echo "<td>";
+      Dropdown::showYesNo("networking",$this->fields["networking"]);
+      echo "</td></tr>";
+
+      echo "<tr class='tab_bg_1'>";
+      echo "<td>"._n('Printer', 'Printers', 2)."</td>";
+      echo "<td>";
+      Dropdown::showYesNo("printer",$this->fields["printer"]);
+      echo "</td>";
+      echo "<td>"._n('Device', 'Devices', 2)."</td>";
+      echo "<td>";
+      Dropdown::showYesNo("peripheral",$this->fields["peripheral"]);
+      echo "</td></tr>";
+
+      echo "<tr class='tab_bg_1'>";
+      echo "<td>"._n('Phone', 'Phones', 2)."</td>";
+      echo "<td>";
+      Dropdown::showYesNo("phone",$this->fields["phone"]);
+      echo "</td><td>&nbsp;</td></tr>";
+
+      echo "<tr class='tab_bg_2'><th colspan='4'>".__('Display description', 'archires')."</th></tr>";
+
+      echo "<tr class='tab_bg_1'>";
+      echo "<td>".__('Display sockets', 'archires')."</td>";
+      echo "<td><select name='display_ports'> ";
+      echo "<option ";
+      if ($this->fields["display_ports"] == '0') {
+         echo "selected ";
+      }
+      echo "value='0'>".__('No')."</option>";
+      echo "<option ";
+      if ($this->fields["display_ports"] == '1') {
+         echo "selected ";
+      }
+      echo "value='1'>".__('See numbers', 'archires')."</option>";
+      echo "<option ";
+      if ($this->fields["display_ports"] == '2') {
+         echo "selected ";
+      }
+      echo "value='2'>".__('See names', 'archires')."</option>";
+      echo "</select></td>";
+      echo "<td>".__('Display IP/Mask', 'archires')."</td>";
+      echo "<td>";
+      Dropdown::showYesNo("display_ip",$this->fields["display_ip"]);
+      echo "</td></tr>";
+
+      echo "<tr class='tab_bg_1'>";
+      echo "<td>".__('Display item types', 'archires')."</td>";
+      echo "<td>";
+      Dropdown::showYesNo("display_type",$this->fields["display_type"]);
+      echo "</td>";
+      echo "<td>".__('Display item statuses', 'archires')."</td>";
+      echo "<td>";
+      Dropdown::showYesNo("display_state",$this->fields["display_state"]);
+      echo "</td></tr>";
+
+      echo "<tr class='tab_bg_1'>";
+      echo "<td>".__('Display item locations', 'archires')."</td>";
+      echo "<td>";
+      Dropdown::showYesNo("display_location",$this->fields["display_location"]);
+      echo "</td>";
+      echo "<td>".__('Display item entities', 'archires')."</td>";
+      echo "<td>";
+      Dropdown::showYesNo("display_entity",$this->fields["display_entity"]);
+      echo "</td></tr>";
+
+      echo "<tr class='tab_bg_2'><th colspan='4'>".__('Generation', 'archires')."</th></tr>";
+
+      echo "<tr class='tab_bg_1'>";
+      echo "<td>".__('Rendering engine', 'archires')."</td>";
+      echo "<td><select name='engine'> ";
+      echo "<option ";
+      if ($this->fields["engine"] == '0') {
+         echo "selected ";
+      }
+      echo "value='0'>Dot</option>";
+      echo "<option ";
+      if ($this->fields["engine"] == '1') {
+         echo "selected ";
+      }
+      echo "value='1'>Neato</option>";
+      echo "</select>&nbsp;";
+      Html::showToolTip(nl2br(__('With neato, the sockets will not be displayed', 'archires')));
+      echo "</td>";
+      echo "<td>".__('Image format', 'archires')."</td>";
+      echo "<td><select name='format'> ";
+      echo "<option ";
+      if ($this->fields["format"] == self::PLUGIN_ARCHIRES_JPEG_FORMAT) {
+         echo "selected ";
+      }
+      echo "value='0'>jpeg</option>";
+      echo "<option ";
+      if ($this->fields["format"] == self::PLUGIN_ARCHIRES_PNG_FORMAT) {
+         echo "selected ";
+      }
+      echo "value='1'>png</option>";
+      echo "<option ";
+      if ($this->fields["format"] == self::PLUGIN_ARCHIRES_GIF_FORMAT) {
+         echo "selected ";
+      }
+      echo "value='2'>gif</option>";
+      echo "</select></td>";
+
+      echo "<tr class='tab_bg_1'>";
+      echo "<td>".__('Color', 'archires')."</td>";
+      echo "<td colspan='3'><select name='color'> ";
+      echo "<option ";
+      if ($this->fields["color"]=='0') {
+         echo "selected ";
+      }
+      echo "value='0'>".__('Type of network', 'archires')."</option>";
+      echo "<option ";
+      if ($this->fields["color"] == '1') {
+         echo "selected ";
+      }
+      echo "value='1'>".__('VLAN')."</option>";
+      echo "</select></td></tr>";
+
+      $this->showFormButtons($options);
+      return true;
+   }
+
+
+   static function showView($item) {
+      global $DB;
+
+      $plugin_archires_views_id = $item->fields["plugin_archires_views_id"];
+
+      if (!$plugin_archires_views_id) {
+         return false;
+      }
+      $view = new self();
+      $view->getFromDB($plugin_archires_views_id);
+
+      $name_config = $view->fields["name"];
+
+      echo "<table class='tab_cadre_fixe' cellpadding='2'width='75%'>";
+      echo "<tr>";
+      echo "<th colspan='3'>".sprintf(__('%1$s: %2$s'), self::getTypeName(1), $name_config);
+      echo "</th></tr>";
+
+      echo "<tr class='tab_bg_2 top'>";
+      echo "<th>".__('Display of items', 'archires')."</th>";
+      echo "<th>".__('Display description', 'archires')."</th>";
+      echo "<th>".__('Generation', 'archires').
+           "</th></tr>";
+
+      echo "<tr class='tab_bg_1 top'><td class='center'>";
+      if ($view->fields["computer"] != 0) {
+         printf(__('%1$s: %2$s'), _n('Computer', 'Computers', 2), __('Yes'));
+      } else {
+         printf(__('%1$s: %2$s'), _n('Computer', 'Computers', 2), __('No'));
+      }
+      echo "<br>";
+
+      if ($view->fields["networking"] != 0) {
+         printf(__('%1$s: %2$s'), _n('Network equipment', 'Network equipments', 2, 'archires'),
+                __('Yes'));
+      } else {
+         printf(__('%1$s: %2$s'), _n('Network equipment', 'Network equipments', 2, 'archires'),
+                __('No'));
+      }
+      echo "<br>";
+
+      if ($view->fields["printer"] !=0 ) {
+         printf(__('%1$s: %2$s'), _n('Printer', 'Printers', 2), __('Yes'));
+      } else {
+         printf(__('%1$s: %2$s'), _n('Printer', 'Printers', 2), __('No'));
+      }
+      echo "<br>";
+
+      if ($view->fields["peripheral"]!=0) {
+          printf(__('%1$s: %2$s'), _n('Device', 'Devices', 2), __('Yes'));
+      } else {
+          printf(__('%1$s: %2$s'), _n('Device', 'Devices', 2), __('No'));
+      }
+      echo "<br>";
+
+      if ($view->fields["phone"] != 0) {
+          printf(__('%1$s: %2$s'), _n('Phone', 'Phones', 2), __('Yes'));
+      } else {
+          printf(__('%1$s: %2$s'), _n('Phone', 'Phones', 2), __('No'));
+      }
+      echo "</td>";
+
+      echo "<td class='center'>";
+      if ($view->fields["display_ports"] != 0) {
+          printf(__('%1$s: %2$s'), __('Display sockets', 'archires'), __('Yes'));
+      } else {
+          printf(__('%1$s: %2$s'), __('Display sockets', 'archires'), __('No'));
+      }
+      echo "<br>";
+
+      if ($view->fields["display_ip"] != 0) {
+          printf(__('%1$s: %2$s'), __('Display IP/Mask', 'archires'), __('Yes'));
+      } else {
+          printf(__('%1$s: %2$s'), __('Display IP/Mask', 'archires'), __('No'));
+      }
+      echo "<br>";
+
+      if ($view->fields["display_type"] != 0) {
+          printf(__('%1$s: %2$s'), __('Display item types', 'archires'), __('Yes'));
+      } else {
+          printf(__('%1$s: %2$s'), __('Display item types', 'archires'), __('No'));
+      }
+      echo "<br>";
+
+      if ($view->fields["display_state"] != 0) {
+          printf(__('%1$s: %2$s'), __('Display item statuses', 'archires'), __('Yes'));
+      } else {
+          printf(__('%1$s: %2$s'), __('Display item statuses', 'archires'), __('No'));
+      }
+      echo "<br>";
+
+      if ($view->fields["display_location"] != 0) {
+          printf(__('%1$s: %2$s'), __('Display item locations', 'archires'), __('Yes'));
+      } else {
+          printf(__('%1$s: %2$s'), __('Display item locations', 'archires'), __('No'));
+      }
+      echo "<br>";
+
+      if ($view->fields["display_entity"] != 0) {
+          printf(__('%1$s: %2$s'), __('Display item entities', 'archires'), __('Yes'));
+      } else {
+          printf(__('%1$s: %2$s'), __('Display item entities', 'archires'), __('No'));
+      }
+      echo "</td>";
+
+      $engine = '';
+     if ($view->fields["engine"] != 0) {
+         $engine = "Neato";
+      } else {
+         $engine = "Dot";
+      }
+
+      echo "<td class='center'>". sprintf(__('%1$s: %2$s'), __('All'),
+                                          sprintf(__('%1$s %2$s'),
+                                                  __('Rendering engine', 'archires'), $engine));
+      echo "<br>";
+      $format_graph = '';
+      if ($view->fields["format"] == self::PLUGIN_ARCHIRES_JPEG_FORMAT) {
+         $format_graph = "jpeg";
+      } else if ($view->fields["format"] == self::PLUGIN_ARCHIRES_PNG_FORMAT) {
+         $format_graph = "png";
+      } else if ($view->fields["format"] == self::PLUGIN_ARCHIRES_GIF_FORMAT) {
+         $format_graph = "gif";
+      }
+      printf(__('%1$s: %2$s'), __('Image format', 'archires'), $format_graph);
+      echo "</td></tr>";
+      echo "</table>";
+   }
+
+
+   static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) {
+
+      switch ($item->getType()) {
+         case 'PluginArchiresApplianceQuery' :
+         case 'PluginArchiresLocationQuery' :
+         case 'PluginArchiresNetworkEquipmentQuery' :
+            switch ($tabnum) {
+               case 1 :
+                  self::showView($item);
+                  break;
+            }
+            break;
+      }
+      return true;
+   }
+
+
+   function getTabNameForItem(CommonGLPI $item, $withtemplate=0) {
+
+      if (!$withtemplate && Session::haveRight("plugin_archires", READ)) {
+         switch ($item->getType()) {
+            case 'PluginArchiresApplianceQuery' :
+            case 'PluginArchiresLocationQuery' :
+            case 'PluginArchiresNetworkEquipmentQuery' :
+               return self::getTypeName(1);
+         }
+      }
+      return '';
+   }
+
+}

+ 211 - 0
inc/vlancolor.class.php

@@ -0,0 +1,211 @@
+<?php
+/*
+ * @version $Id: vlancolor.class.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2018 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+ */
+
+if (!defined('GLPI_ROOT')) {
+   die("Sorry. You can't access directly to this file");
+}
+
+class PluginArchiresVlanColor extends CommonDBTM {
+
+   static $rightname = "plugin_archires";
+
+
+   function getFromDBbyVlan($vlan) {
+      global $DB;
+
+      $query = ['FROM'  => $this->getTable(),
+                'WHERE' => ['vlans_id' => $vlan]];
+
+      if ($result = $DB->request($query)) {
+         if (count($result) != 1) {
+            return false;
+         }
+         $this->fields = $result->next();
+         if (is_array($this->fields) && count($this->fields)) {
+            return true;
+         }
+         return false;
+      }
+      return false;
+   }
+
+
+   function addVlanColor($vlan,$color) {
+      global $DB;
+
+      if ($vlan != '-1') {
+         if ($this->getfromDBbyVlan($vlan)) {
+            $this->update(['id'    => $this->fields['id'],
+                           'color' => $color]);
+         } else {
+            $this->add(['vlans_id' => $vlan,
+                        'color'    => $color]);
+         }
+      } else {
+         $query = ['FROM' => 'glpi_vlans'];
+         $result = $DB->request($query);
+
+         $i = 0;
+         while ($i < count($result)) {
+            $vlan_table=$DB->result($result, $i, "id");
+            if ($this->getfromDBbyVlan($vlan_table)) {
+               $this->update(['id'    => $this->fields['id'],
+                              'color' => $color]);
+            } else {
+               $this->add(['vlans_id' => $vlan_table,
+                           'color'    => $color]);
+           }
+           $i++;
+         }
+      }
+   }
+
+
+   function showConfigForm($canupdate=false) {
+      global $DB;
+
+      if ($canupdate) {
+         echo "<div class='firstbloc'>";
+         echo "<form method='post' name='vlan_color' action='./config.form.php'>";
+         echo "<table class='tab_cadre' cellpadding='5' width='50%'><tr ><th colspan='3'>";
+         echo __('Associate colors to VLANs', 'archires')."</th></tr>";
+         echo "<tr class='tab_bg_1'><td width='60%'>";
+         $this->dropdownVlan();
+         echo "</td>";
+         echo "<td><input type='text' name='color'>";
+         echo "&nbsp;";
+         Html::showToolTip(nl2br(__('Please use this color format', 'archires')),
+                           ['link'       => 'http://www.graphviz.org/doc/info/colors.html',
+                            'linktarget' => '_blank']);
+         echo "<td class='center'><input type='submit' name='add_color_vlan' value=\"".
+                _sx('button', 'Add')."\" class='submit'></td></tr>";
+         echo "</table>";
+         Html::closeForm();
+      }
+
+      $query = ['FROM'  => $this->getTable(),
+                'ORDER' => 'vlans_id ASC'];
+
+      if ($result = $DB->request($query)) {
+         $number = count($result);
+
+         if ($number != 0) {
+            echo "<div id='liste_vlan'>";
+            if ($canupdate) {
+               $rand = mt_rand();
+               Html::openMassiveActionsForm('mass'.__CLASS__.$rand);
+               $massiveactionparams = ['num_displayed'    => $number,
+                                       'container'        => 'mass'.__CLASS__.$rand];
+               Html::showMassiveActions($massiveactionparams);
+            }
+            echo "<table class='tab_cadre' cellpadding='5' width='50%'>";
+            echo "<tr>";
+            if ($canupdate) {
+               echo "<th width='10'>";
+               Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand);
+               echo "</th>";
+            }
+            echo "<th class='left'>".__('VLAN')."</th>";
+            echo "<th class='left'>".__('Color', 'archires')."</th><th></th>";
+            echo "</tr>";
+
+            while($ligne = $result->next()) {
+               $ID = $ligne["id"];
+               echo "<tr class='tab_bg_1'>";
+               if ($canupdate) {
+                  echo "<td width='10'>";
+                  Html::showMassiveActionCheckBox(__CLASS__, $ID);
+                  echo "</td>";
+               }
+               echo "<td>".Dropdown::getDropdownName("glpi_vlans", $ligne["vlans_id"])."</td>";
+               echo "<td bgcolor='".$ligne["color"]."'>".$ligne["color"]."</td>";
+               echo "<td><input type='hidden' name='id' value='$ID'></td>";
+            }
+
+            echo "</table>";
+            if ($canupdate) {
+               $massiveactionparams['ontop'] = false;
+               Html::showMassiveActions($massiveactionparams);
+            }
+            echo "</div>";
+            Html::closeForm();
+         }
+      }
+   }
+
+
+   function dropdownVlan() {
+      global $DB;
+
+      $colors = [];
+      foreach($DB->request("glpi_plugin_archires_vlancolors") as $color) {
+         $colors[] = $color['vlans_id'];
+      }
+
+      $query = ['FROM'  => 'glpi_vlans',
+                'WHERE' =>  ['NOT' => ['id' => [implode("','",$colors)]]],
+                'ORDER' => 'name'];
+      $result = $DB->request($query);
+
+      if (count($result)) {
+         $values = [1 => __('All VLANs', 'archires')];
+         while ($data = $result->next()) {
+            $values[$data['id']] = $data["name"];
+         }
+         Dropdown::showFromArray('vlans_id', $values, ['width'                => '80%',
+                                                       'display_emptychoice'  => true]);
+      }
+   }
+
+
+   function getVlanbyNetworkPort ($ID) {
+    global $DB;
+
+      $query = ['SELECT'   => 'glpi_vlans.id',
+                'FROM'     => ['glpi_vlans', 'glpi_networkports_vlans'],
+                'WHERE'    => ['vlans_id'          => 'glpi_vlans.id',
+                               'networkports_id'   => $ID]];
+
+      if ($result = $DB->request($query)) {
+        $data_vlan = $result->next();
+        $vlan      = $data_vlan["id"] ;
+      }
+      return $vlan;
+   }
+
+
+   function getForbiddenStandardMassiveAction() {
+
+      $forbidden   = parent::getForbiddenStandardMassiveAction();
+      $forbidden[] = 'update';
+      return $forbidden;
+   }
+}

BIN
locales/cs_CZ.mo


+ 232 - 0
locales/cs_CZ.po

@@ -0,0 +1,232 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# 
+# Translators:
+# Pavel Borecki <pavel.borecki@gmail.com>, 2018
+msgid ""
+msgstr ""
+"Project-Id-Version: GLPI Project - archires plugin\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-08-11 14:01+0200\n"
+"PO-Revision-Date: 2018-06-28 10:54+0000\n"
+"Last-Translator: Pavel Borecki <pavel.borecki@gmail.com>\n"
+"Language-Team: Czech (Czech Republic) (http://www.transifex.com/yllen/glpi-project-archires-plugin/language/cs_CZ/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: cs_CZ\n"
+"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n"
+
+#: hook.php:736 inc/locationquery.class.php:209
+msgid "All root locations"
+msgstr "Všechna kořenová umístění"
+
+#: hook.php:765 inc/view.class.php:292
+msgid "See numbers"
+msgstr "Zobrazit počty"
+
+#: hook.php:767 inc/view.class.php:297
+msgid "See names"
+msgstr "Zobrazit názvy"
+
+#: hook.php:791 inc/networkinterfacecolor.class.php:142 inc/view.class.php:368
+msgid "Type of network"
+msgstr "Typ sítě"
+
+#: setup.php:63 inc/archires.class.php:44 inc/menu.class.php:38
+msgid "Network Architecture"
+msgid_plural "Network Architectures"
+msgstr[0] "Architektura sítě"
+msgstr[1] "Architektury sítě"
+msgstr[2] "Architektur sítě"
+msgstr[3] "Architektury sítě"
+
+#: front/config.form.php:134
+msgid "Please activate the plugin"
+msgstr "Zapněte zásuvný modul"
+
+#: inc/appliancequery.class.php:114 inc/locationquery.class.php:119
+#: inc/networkequipmentquery.class.php:113
+msgid "Thanks to specify a default used view"
+msgstr "Vyberte pohled, který použít jako výchozí"
+
+#: inc/archires.class.php:83
+msgid "Add view"
+msgstr "Přidat pohled"
+
+#: inc/imageitem.class.php:102
+msgid "Associate pictures with item types"
+msgstr "Přiřadit obrázky k typům položek"
+
+#: inc/imageitem.class.php:119
+msgid "Some types of items must be created so that the association can exist"
+msgstr "Aby mohlo existovat přiřazení, je třeba nejprve vytvořit nějaké typy položek"
+
+#: inc/imageitem.class.php:150
+msgid "Picture"
+msgstr "Obrázek"
+
+#: inc/locationquery.class.php:69 inc/locationquery.class.php:165
+msgid "Childs"
+msgstr "Podřízené"
+
+#: inc/menu.class.php:61 inc/networkequipmentquery.class.php:43
+#: inc/networkequipmentquery.class.php:67
+#: inc/networkequipmentquery.class.php:150 inc/view.class.php:73
+#: inc/view.class.php:257 inc/view.class.php:414 inc/view.class.php:417
+msgid "Network equipment"
+msgid_plural "Network equipments"
+msgstr[0] "Síťové zařízení"
+msgstr[1] "Síťová zařízení"
+msgstr[2] "Síťových zařízení"
+msgstr[3] "Síťová zařízení"
+
+#: inc/networkinterfacecolor.class.php:100
+msgid "Associate colors with network types"
+msgstr "Přiřadit barvy k typům sítí"
+
+#: inc/networkinterfacecolor.class.php:107 inc/statecolor.class.php:109
+#: inc/vlancolor.class.php:108
+msgid "Please use this color format"
+msgstr "Použijte tento formát barev"
+
+#: inc/networkinterfacecolor.class.php:143 inc/statecolor.class.php:143
+#: inc/view.class.php:131 inc/view.class.php:362 inc/vlancolor.class.php:141
+msgid "Color"
+msgstr "Barva"
+
+#: inc/profile.class.php:84
+msgid "Generate graphs"
+msgstr "Vytvořit diagramy"
+
+#: inc/prototype.class.php:202
+msgid "Graphviz name"
+msgstr "Graphviz název"
+
+#: inc/prototype.class.php:203 inc/prototype.class.php:261
+msgid "Associated picture"
+msgstr "Přiřazený obrázek"
+
+#: inc/prototype.class.php:204
+msgid "Name of item"
+msgstr "Název položky"
+
+#: inc/prototype.class.php:257
+msgid "Link"
+msgid_plural "Links"
+msgstr[0] "Odkaz"
+msgstr[1] "Odkazy"
+msgstr[2] "Odkazů"
+msgstr[3] "Odkazy"
+
+#: inc/prototype.class.php:258
+msgid "Graphviz links"
+msgstr "Graphviz spojení"
+
+#: inc/prototype.class.php:259
+msgid "IP item 1"
+msgstr "IP položka 1"
+
+#: inc/prototype.class.php:260
+msgid "Socket item 1"
+msgstr "Položka zásuvky 1"
+
+#: inc/prototype.class.php:262
+msgid "Socket item 2"
+msgstr "Položka zásuvky 2"
+
+#: inc/prototype.class.php:263
+msgid "IP item 2"
+msgstr "IP položka 2"
+
+#: inc/prototype.class.php:318 inc/prototype.class.php:321
+#: inc/prototype.class.php:494 inc/prototype.class.php:516
+msgid "Socket"
+msgstr "Zásuvka"
+
+#: inc/prototype.class.php:337
+msgid "Test Graphviz"
+msgstr "Vyzkoušet Graphviz"
+
+#: inc/prototype.class.php:728 inc/view.class.php:324 inc/view.class.php:402
+msgid "Generation"
+msgstr "Vytváření"
+
+#: inc/querytype.class.php:138
+msgid "Display types of items"
+msgstr "Zobrazit typy položek"
+
+#: inc/statecolor.class.php:101
+msgid "Associate colors with items statuses"
+msgstr "Přiřadit barvy ke stavům položek"
+
+#: inc/statecolor.class.php:189
+msgid "All statuses"
+msgstr "Všechny stavy"
+
+#: inc/view.class.php:93 inc/view.class.php:281 inc/view.class.php:445
+#: inc/view.class.php:447
+msgid "Display sockets"
+msgstr "Zobrazit zásuvky"
+
+#: inc/view.class.php:98 inc/view.class.php:299 inc/view.class.php:452
+#: inc/view.class.php:454
+msgid "Display IP/Mask"
+msgstr "Zobrazit IP adresu/masku"
+
+#: inc/view.class.php:103 inc/view.class.php:305 inc/view.class.php:459
+#: inc/view.class.php:461
+msgid "Display item types"
+msgstr "Zobrazit typy položek"
+
+#: inc/view.class.php:108 inc/view.class.php:309 inc/view.class.php:466
+#: inc/view.class.php:468
+msgid "Display item statuses"
+msgstr "Zobrazit stavy položek"
+
+#: inc/view.class.php:113 inc/view.class.php:315 inc/view.class.php:473
+#: inc/view.class.php:475
+msgid "Display item locations"
+msgstr "Zobrazit umístění položek"
+
+#: inc/view.class.php:118 inc/view.class.php:319 inc/view.class.php:480
+#: inc/view.class.php:482
+msgid "Display item entities"
+msgstr "Zobrazit entity položek"
+
+#: inc/view.class.php:123 inc/view.class.php:327 inc/view.class.php:495
+msgid "Rendering engine"
+msgstr "Vykreslovací engine"
+
+#: inc/view.class.php:127 inc/view.class.php:342 inc/view.class.php:505
+msgid "Image format"
+msgstr "Formát obrázku"
+
+#: inc/view.class.php:194
+msgid "See all views"
+msgstr "Zobrazit všechny pohledy"
+
+#: inc/view.class.php:215
+msgid "Display"
+msgstr "Zobrazit"
+
+#: inc/view.class.php:250 inc/view.class.php:400
+msgid "Display of items"
+msgstr "Zobrazit položky"
+
+#: inc/view.class.php:278 inc/view.class.php:401
+msgid "Display description"
+msgstr "Zobrazit popis"
+
+#: inc/view.class.php:340
+msgid "With neato, the sockets will not be displayed"
+msgstr "S neato nebudou zobrazeny zásuvky"
+
+#: inc/vlancolor.class.php:102
+msgid "Associate colors to VLANs"
+msgstr "Přiřadit barvy k virt. sítím (VLAN)"
+
+#: inc/vlancolor.class.php:186
+msgid "All VLANs"
+msgstr "Všechny virt. sítě (VLAN)"

BIN
locales/da_DK.mo


+ 226 - 0
locales/da_DK.po

@@ -0,0 +1,226 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# 
+# Translators:
+# Jens Hyllegaard <jens.hyllegaard@gmail.com>, 2013,2017
+msgid ""
+msgstr ""
+"Project-Id-Version: GLPI Project - archires plugin\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-08-11 14:01+0200\n"
+"PO-Revision-Date: 2017-09-22 23:25+0000\n"
+"Last-Translator: Jens Hyllegaard <jens.hyllegaard@gmail.com>\n"
+"Language-Team: Danish (Denmark) (http://www.transifex.com/yllen/glpi-project-archires-plugin/language/da_DK/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: da_DK\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: hook.php:736 inc/locationquery.class.php:209
+msgid "All root locations"
+msgstr "Alle rod-lokationer"
+
+#: hook.php:765 inc/view.class.php:292
+msgid "See numbers"
+msgstr "Se antal"
+
+#: hook.php:767 inc/view.class.php:297
+msgid "See names"
+msgstr "Se navne"
+
+#: hook.php:791 inc/networkinterfacecolor.class.php:142 inc/view.class.php:368
+msgid "Type of network"
+msgstr "Netværkstype"
+
+#: setup.php:63 inc/archires.class.php:44 inc/menu.class.php:38
+msgid "Network Architecture"
+msgid_plural "Network Architectures"
+msgstr[0] "Netværksarkitektur"
+msgstr[1] "Netværksarkitekturer"
+
+#: front/config.form.php:134
+msgid "Please activate the plugin"
+msgstr "Aktivér venligst udvidelsen"
+
+#: inc/appliancequery.class.php:114 inc/locationquery.class.php:119
+#: inc/networkequipmentquery.class.php:113
+msgid "Thanks to specify a default used view"
+msgstr "Angiv venligst en standardvisning"
+
+#: inc/archires.class.php:83
+msgid "Add view"
+msgstr "Tilføj visning"
+
+#: inc/imageitem.class.php:102
+msgid "Associate pictures with item types"
+msgstr "Tilknyt billeder til emnetyper"
+
+#: inc/imageitem.class.php:119
+msgid "Some types of items must be created so that the association can exist"
+msgstr "Der skal oprettes nogle emnetyper for at tilknytningen kan eksistere"
+
+#: inc/imageitem.class.php:150
+msgid "Picture"
+msgstr "Billede"
+
+#: inc/locationquery.class.php:69 inc/locationquery.class.php:165
+msgid "Childs"
+msgstr "Børn"
+
+#: inc/menu.class.php:61 inc/networkequipmentquery.class.php:43
+#: inc/networkequipmentquery.class.php:67
+#: inc/networkequipmentquery.class.php:150 inc/view.class.php:73
+#: inc/view.class.php:257 inc/view.class.php:414 inc/view.class.php:417
+msgid "Network equipment"
+msgid_plural "Network equipments"
+msgstr[0] "Netværksudstyr"
+msgstr[1] "Netværksudstyr"
+
+#: inc/networkinterfacecolor.class.php:100
+msgid "Associate colors with network types"
+msgstr "Tilknyt farver til netværkstyper"
+
+#: inc/networkinterfacecolor.class.php:107 inc/statecolor.class.php:109
+#: inc/vlancolor.class.php:108
+msgid "Please use this color format"
+msgstr "Brug venligst dette farveformat"
+
+#: inc/networkinterfacecolor.class.php:143 inc/statecolor.class.php:143
+#: inc/view.class.php:131 inc/view.class.php:362 inc/vlancolor.class.php:141
+msgid "Color"
+msgstr "Farve"
+
+#: inc/profile.class.php:84
+msgid "Generate graphs"
+msgstr "Generer grafik"
+
+#: inc/prototype.class.php:202
+msgid "Graphviz name"
+msgstr "Graphviz navn"
+
+#: inc/prototype.class.php:203 inc/prototype.class.php:261
+msgid "Associated picture"
+msgstr "Tilknyttet billede"
+
+#: inc/prototype.class.php:204
+msgid "Name of item"
+msgstr "Emnenavn"
+
+#: inc/prototype.class.php:257
+msgid "Link"
+msgid_plural "Links"
+msgstr[0] "Link"
+msgstr[1] "Links"
+
+#: inc/prototype.class.php:258
+msgid "Graphviz links"
+msgstr "Graphviz links"
+
+#: inc/prototype.class.php:259
+msgid "IP item 1"
+msgstr "IP emne 1"
+
+#: inc/prototype.class.php:260
+msgid "Socket item 1"
+msgstr "Stik emne 1"
+
+#: inc/prototype.class.php:262
+msgid "Socket item 2"
+msgstr "Stik emne 2"
+
+#: inc/prototype.class.php:263
+msgid "IP item 2"
+msgstr "IP emne 2"
+
+#: inc/prototype.class.php:318 inc/prototype.class.php:321
+#: inc/prototype.class.php:494 inc/prototype.class.php:516
+msgid "Socket"
+msgstr "Stik"
+
+#: inc/prototype.class.php:337
+msgid "Test Graphviz"
+msgstr "Test Graphviz"
+
+#: inc/prototype.class.php:728 inc/view.class.php:324 inc/view.class.php:402
+msgid "Generation"
+msgstr "Generering"
+
+#: inc/querytype.class.php:138
+msgid "Display types of items"
+msgstr "Vis emnetyper"
+
+#: inc/statecolor.class.php:101
+msgid "Associate colors with items statuses"
+msgstr "Tilnyt farver til emners status"
+
+#: inc/statecolor.class.php:189
+msgid "All statuses"
+msgstr "Alle status"
+
+#: inc/view.class.php:93 inc/view.class.php:281 inc/view.class.php:445
+#: inc/view.class.php:447
+msgid "Display sockets"
+msgstr "Vis stik"
+
+#: inc/view.class.php:98 inc/view.class.php:299 inc/view.class.php:452
+#: inc/view.class.php:454
+msgid "Display IP/Mask"
+msgstr "Vis IP/Maske"
+
+#: inc/view.class.php:103 inc/view.class.php:305 inc/view.class.php:459
+#: inc/view.class.php:461
+msgid "Display item types"
+msgstr "Vis emnetyper"
+
+#: inc/view.class.php:108 inc/view.class.php:309 inc/view.class.php:466
+#: inc/view.class.php:468
+msgid "Display item statuses"
+msgstr "Vis emnestatus"
+
+#: inc/view.class.php:113 inc/view.class.php:315 inc/view.class.php:473
+#: inc/view.class.php:475
+msgid "Display item locations"
+msgstr "Vis emnelokationer"
+
+#: inc/view.class.php:118 inc/view.class.php:319 inc/view.class.php:480
+#: inc/view.class.php:482
+msgid "Display item entities"
+msgstr "Vis emne entiteter"
+
+#: inc/view.class.php:123 inc/view.class.php:327 inc/view.class.php:495
+msgid "Rendering engine"
+msgstr "Rederingsmotor"
+
+#: inc/view.class.php:127 inc/view.class.php:342 inc/view.class.php:505
+msgid "Image format"
+msgstr "Billedformat"
+
+#: inc/view.class.php:194
+msgid "See all views"
+msgstr "Se alle visninger"
+
+#: inc/view.class.php:215
+msgid "Display"
+msgstr "Vis"
+
+#: inc/view.class.php:250 inc/view.class.php:400
+msgid "Display of items"
+msgstr "Visning af emner"
+
+#: inc/view.class.php:278 inc/view.class.php:401
+msgid "Display description"
+msgstr "Vis beskrivelse"
+
+#: inc/view.class.php:340
+msgid "With neato, the sockets will not be displayed"
+msgstr "Ved neato, vil stik ikke blive vist"
+
+#: inc/vlancolor.class.php:102
+msgid "Associate colors to VLANs"
+msgstr "Tilknyt farver til VLANs"
+
+#: inc/vlancolor.class.php:186
+msgid "All VLANs"
+msgstr "Alle VLANs"

BIN
locales/de_DE.mo


+ 225 - 0
locales/de_DE.po

@@ -0,0 +1,225 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# 
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: GLPI Project - archires plugin\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-08-11 14:01+0200\n"
+"PO-Revision-Date: 2017-09-22 23:25+0000\n"
+"Last-Translator: Nelly Mahu-Lasson <nini.lasson@orange.fr>\n"
+"Language-Team: German (Germany) (http://www.transifex.com/yllen/glpi-project-archires-plugin/language/de_DE/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: de_DE\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: hook.php:736 inc/locationquery.class.php:209
+msgid "All root locations"
+msgstr "All root locations"
+
+#: hook.php:765 inc/view.class.php:292
+msgid "See numbers"
+msgstr "See numbers"
+
+#: hook.php:767 inc/view.class.php:297
+msgid "See names"
+msgstr "See names"
+
+#: hook.php:791 inc/networkinterfacecolor.class.php:142 inc/view.class.php:368
+msgid "Type of network"
+msgstr "Typen des Netzwerks"
+
+#: setup.php:63 inc/archires.class.php:44 inc/menu.class.php:38
+msgid "Network Architecture"
+msgid_plural "Network Architectures"
+msgstr[0] ""
+msgstr[1] ""
+
+#: front/config.form.php:134
+msgid "Please activate the plugin"
+msgstr ""
+
+#: inc/appliancequery.class.php:114 inc/locationquery.class.php:119
+#: inc/networkequipmentquery.class.php:113
+msgid "Thanks to specify a default used view"
+msgstr "Thanks to specify a default used view"
+
+#: inc/archires.class.php:83
+msgid "Add view"
+msgstr "Ansicht hinzuf&uuml;gen"
+
+#: inc/imageitem.class.php:102
+msgid "Associate pictures with item types"
+msgstr "Bilder mit Material verkn&uuml;pfen"
+
+#: inc/imageitem.class.php:119
+msgid "Some types of items must be created so that the association can exist"
+msgstr "Einige Arten von Items m&uuml;ssen erstellt werden, damit eine Zuordnug existieren kann"
+
+#: inc/imageitem.class.php:150
+msgid "Picture"
+msgstr "Bild"
+
+#: inc/locationquery.class.php:69 inc/locationquery.class.php:165
+msgid "Childs"
+msgstr "Nachfolger"
+
+#: inc/menu.class.php:61 inc/networkequipmentquery.class.php:43
+#: inc/networkequipmentquery.class.php:67
+#: inc/networkequipmentquery.class.php:150 inc/view.class.php:73
+#: inc/view.class.php:257 inc/view.class.php:414 inc/view.class.php:417
+msgid "Network equipment"
+msgid_plural "Network equipments"
+msgstr[0] ""
+msgstr[1] ""
+
+#: inc/networkinterfacecolor.class.php:100
+msgid "Associate colors with network types"
+msgstr "Netzwerktypen mit einer Farbe verkn&uuml;pfen"
+
+#: inc/networkinterfacecolor.class.php:107 inc/statecolor.class.php:109
+#: inc/vlancolor.class.php:108
+msgid "Please use this color format"
+msgstr "Bitte benutzen Sie folgende Farben"
+
+#: inc/networkinterfacecolor.class.php:143 inc/statecolor.class.php:143
+#: inc/view.class.php:131 inc/view.class.php:362 inc/vlancolor.class.php:141
+msgid "Color"
+msgstr "Farbe"
+
+#: inc/profile.class.php:84
+msgid "Generate graphs"
+msgstr "Erzeuge einen Graphen"
+
+#: inc/prototype.class.php:202
+msgid "Graphviz name"
+msgstr "Graphviz name"
+
+#: inc/prototype.class.php:203 inc/prototype.class.php:261
+msgid "Associated picture"
+msgstr "Zugeh&ouml;riges Bild"
+
+#: inc/prototype.class.php:204
+msgid "Name of item"
+msgstr "Name des Materials"
+
+#: inc/prototype.class.php:257
+msgid "Link"
+msgid_plural "Links"
+msgstr[0] ""
+msgstr[1] ""
+
+#: inc/prototype.class.php:258
+msgid "Graphviz links"
+msgstr "Graphviz links"
+
+#: inc/prototype.class.php:259
+msgid "IP item 1"
+msgstr "IP material 1"
+
+#: inc/prototype.class.php:260
+msgid "Socket item 1"
+msgstr "Steckverbindungsmaterial 1"
+
+#: inc/prototype.class.php:262
+msgid "Socket item 2"
+msgstr "Steckverbindungsmaterial 2"
+
+#: inc/prototype.class.php:263
+msgid "IP item 2"
+msgstr "IP material 2"
+
+#: inc/prototype.class.php:318 inc/prototype.class.php:321
+#: inc/prototype.class.php:494 inc/prototype.class.php:516
+msgid "Socket"
+msgstr "Socket"
+
+#: inc/prototype.class.php:337
+msgid "Test Graphviz"
+msgstr "Test Graphviz"
+
+#: inc/prototype.class.php:728 inc/view.class.php:324 inc/view.class.php:402
+msgid "Generation"
+msgstr "Erzeuge"
+
+#: inc/querytype.class.php:138
+msgid "Display types of items"
+msgstr "Zeige Item Typen"
+
+#: inc/statecolor.class.php:101
+msgid "Associate colors with items statuses"
+msgstr "Verkn&uuml;pfe Farbe mit Item Zustand"
+
+#: inc/statecolor.class.php:189
+msgid "All statuses"
+msgstr "Alle zust&auml;nde"
+
+#: inc/view.class.php:93 inc/view.class.php:281 inc/view.class.php:445
+#: inc/view.class.php:447
+msgid "Display sockets"
+msgstr "Zeige Anzahl der Steckverbindungen"
+
+#: inc/view.class.php:98 inc/view.class.php:299 inc/view.class.php:452
+#: inc/view.class.php:454
+msgid "Display IP/Mask"
+msgstr "IP/Mask anzeigen"
+
+#: inc/view.class.php:103 inc/view.class.php:305 inc/view.class.php:459
+#: inc/view.class.php:461
+msgid "Display item types"
+msgstr "Zeige Item typ"
+
+#: inc/view.class.php:108 inc/view.class.php:309 inc/view.class.php:466
+#: inc/view.class.php:468
+msgid "Display item statuses"
+msgstr "Zeige Item Zustand"
+
+#: inc/view.class.php:113 inc/view.class.php:315 inc/view.class.php:473
+#: inc/view.class.php:475
+msgid "Display item locations"
+msgstr "Zeige Item Standort"
+
+#: inc/view.class.php:118 inc/view.class.php:319 inc/view.class.php:480
+#: inc/view.class.php:482
+msgid "Display item entities"
+msgstr "Zeige Item Einheit"
+
+#: inc/view.class.php:123 inc/view.class.php:327 inc/view.class.php:495
+msgid "Rendering engine"
+msgstr "Rendering engine"
+
+#: inc/view.class.php:127 inc/view.class.php:342 inc/view.class.php:505
+msgid "Image format"
+msgstr "Bildformat"
+
+#: inc/view.class.php:194
+msgid "See all views"
+msgstr "Kein Standort definiert"
+
+#: inc/view.class.php:215
+msgid "Display"
+msgstr "Display"
+
+#: inc/view.class.php:250 inc/view.class.php:400
+msgid "Display of items"
+msgstr "Anzeige von Items"
+
+#: inc/view.class.php:278 inc/view.class.php:401
+msgid "Display description"
+msgstr "Zeige Beschreibung"
+
+#: inc/view.class.php:340
+msgid "With neato, the sockets will not be displayed"
+msgstr "Mit neato werden Steckverbindungen nicht angezeigt"
+
+#: inc/vlancolor.class.php:102
+msgid "Associate colors to VLANs"
+msgstr "VLANs mit Farben verkn&uuml;pfen"
+
+#: inc/vlancolor.class.php:186
+msgid "All VLANs"
+msgstr "Alle VLANs"

BIN
locales/en_GB.mo


+ 225 - 0
locales/en_GB.po

@@ -0,0 +1,225 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# 
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: GLPI Project - archires plugin\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-08-11 14:01+0200\n"
+"PO-Revision-Date: 2017-09-22 23:25+0000\n"
+"Last-Translator: Nelly Mahu-Lasson <nini.lasson@orange.fr>\n"
+"Language-Team: English (United Kingdom) (http://www.transifex.com/yllen/glpi-project-archires-plugin/language/en_GB/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en_GB\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: hook.php:736 inc/locationquery.class.php:209
+msgid "All root locations"
+msgstr "All root locations"
+
+#: hook.php:765 inc/view.class.php:292
+msgid "See numbers"
+msgstr "See numbers"
+
+#: hook.php:767 inc/view.class.php:297
+msgid "See names"
+msgstr "See names"
+
+#: hook.php:791 inc/networkinterfacecolor.class.php:142 inc/view.class.php:368
+msgid "Type of network"
+msgstr "Type of network"
+
+#: setup.php:63 inc/archires.class.php:44 inc/menu.class.php:38
+msgid "Network Architecture"
+msgid_plural "Network Architectures"
+msgstr[0] "Network Architecture"
+msgstr[1] "Network Architectures"
+
+#: front/config.form.php:134
+msgid "Please activate the plugin"
+msgstr "Please activate the plugin"
+
+#: inc/appliancequery.class.php:114 inc/locationquery.class.php:119
+#: inc/networkequipmentquery.class.php:113
+msgid "Thanks to specify a default used view"
+msgstr "Thanks to specify a default used view"
+
+#: inc/archires.class.php:83
+msgid "Add view"
+msgstr "Add view"
+
+#: inc/imageitem.class.php:102
+msgid "Associate pictures with item types"
+msgstr "Associate pictures with item types"
+
+#: inc/imageitem.class.php:119
+msgid "Some types of items must be created so that the association can exist"
+msgstr "Some types of items must be created so that the association can exist"
+
+#: inc/imageitem.class.php:150
+msgid "Picture"
+msgstr "Picture"
+
+#: inc/locationquery.class.php:69 inc/locationquery.class.php:165
+msgid "Childs"
+msgstr "Childs"
+
+#: inc/menu.class.php:61 inc/networkequipmentquery.class.php:43
+#: inc/networkequipmentquery.class.php:67
+#: inc/networkequipmentquery.class.php:150 inc/view.class.php:73
+#: inc/view.class.php:257 inc/view.class.php:414 inc/view.class.php:417
+msgid "Network equipment"
+msgid_plural "Network equipments"
+msgstr[0] "Network equipment"
+msgstr[1] "Network equipments"
+
+#: inc/networkinterfacecolor.class.php:100
+msgid "Associate colors with network types"
+msgstr "Associate colors with network types"
+
+#: inc/networkinterfacecolor.class.php:107 inc/statecolor.class.php:109
+#: inc/vlancolor.class.php:108
+msgid "Please use this color format"
+msgstr "Please use this color format"
+
+#: inc/networkinterfacecolor.class.php:143 inc/statecolor.class.php:143
+#: inc/view.class.php:131 inc/view.class.php:362 inc/vlancolor.class.php:141
+msgid "Color"
+msgstr "Color"
+
+#: inc/profile.class.php:84
+msgid "Generate graphs"
+msgstr "Generate graphs"
+
+#: inc/prototype.class.php:202
+msgid "Graphviz name"
+msgstr "Graphviz name"
+
+#: inc/prototype.class.php:203 inc/prototype.class.php:261
+msgid "Associated picture"
+msgstr "Associated picture"
+
+#: inc/prototype.class.php:204
+msgid "Name of item"
+msgstr "Name of item"
+
+#: inc/prototype.class.php:257
+msgid "Link"
+msgid_plural "Links"
+msgstr[0] ""
+msgstr[1] ""
+
+#: inc/prototype.class.php:258
+msgid "Graphviz links"
+msgstr "Graphviz links"
+
+#: inc/prototype.class.php:259
+msgid "IP item 1"
+msgstr "IP item 1"
+
+#: inc/prototype.class.php:260
+msgid "Socket item 1"
+msgstr "Socket item 1"
+
+#: inc/prototype.class.php:262
+msgid "Socket item 2"
+msgstr "Socket item 2"
+
+#: inc/prototype.class.php:263
+msgid "IP item 2"
+msgstr "IP item 2"
+
+#: inc/prototype.class.php:318 inc/prototype.class.php:321
+#: inc/prototype.class.php:494 inc/prototype.class.php:516
+msgid "Socket"
+msgstr "Socket"
+
+#: inc/prototype.class.php:337
+msgid "Test Graphviz"
+msgstr "Test Graphviz"
+
+#: inc/prototype.class.php:728 inc/view.class.php:324 inc/view.class.php:402
+msgid "Generation"
+msgstr "Generation"
+
+#: inc/querytype.class.php:138
+msgid "Display types of items"
+msgstr "Display types of items"
+
+#: inc/statecolor.class.php:101
+msgid "Associate colors with items statuses"
+msgstr "Associate colors with items statuses"
+
+#: inc/statecolor.class.php:189
+msgid "All statuses"
+msgstr "All statuses"
+
+#: inc/view.class.php:93 inc/view.class.php:281 inc/view.class.php:445
+#: inc/view.class.php:447
+msgid "Display sockets"
+msgstr "Display sockets"
+
+#: inc/view.class.php:98 inc/view.class.php:299 inc/view.class.php:452
+#: inc/view.class.php:454
+msgid "Display IP/Mask"
+msgstr "Display IP/Mask"
+
+#: inc/view.class.php:103 inc/view.class.php:305 inc/view.class.php:459
+#: inc/view.class.php:461
+msgid "Display item types"
+msgstr "Display item types"
+
+#: inc/view.class.php:108 inc/view.class.php:309 inc/view.class.php:466
+#: inc/view.class.php:468
+msgid "Display item statuses"
+msgstr "Display item statuses"
+
+#: inc/view.class.php:113 inc/view.class.php:315 inc/view.class.php:473
+#: inc/view.class.php:475
+msgid "Display item locations"
+msgstr "Display item locations"
+
+#: inc/view.class.php:118 inc/view.class.php:319 inc/view.class.php:480
+#: inc/view.class.php:482
+msgid "Display item entities"
+msgstr "Display item entities"
+
+#: inc/view.class.php:123 inc/view.class.php:327 inc/view.class.php:495
+msgid "Rendering engine"
+msgstr "Rendering engine"
+
+#: inc/view.class.php:127 inc/view.class.php:342 inc/view.class.php:505
+msgid "Image format"
+msgstr "Image format"
+
+#: inc/view.class.php:194
+msgid "See all views"
+msgstr "See all views"
+
+#: inc/view.class.php:215
+msgid "Display"
+msgstr "Display"
+
+#: inc/view.class.php:250 inc/view.class.php:400
+msgid "Display of items"
+msgstr "Display of items"
+
+#: inc/view.class.php:278 inc/view.class.php:401
+msgid "Display description"
+msgstr "Display description"
+
+#: inc/view.class.php:340
+msgid "With neato, the sockets will not be displayed"
+msgstr "With neato, the sockets will not be displayed"
+
+#: inc/vlancolor.class.php:102
+msgid "Associate colors to VLANs"
+msgstr "Associate colors to VLANs"
+
+#: inc/vlancolor.class.php:186
+msgid "All VLANs"
+msgstr "All VLANs"

BIN
locales/es_ES.mo


+ 226 - 0
locales/es_ES.po

@@ -0,0 +1,226 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# 
+# Translators:
+# FranciscoFJ <dev-ooo@satel-sa.com>, 2019
+msgid ""
+msgstr ""
+"Project-Id-Version: GLPI Project - archires plugin\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-08-11 14:01+0200\n"
+"PO-Revision-Date: 2019-03-21 16:01+0000\n"
+"Last-Translator: FranciscoFJ <dev-ooo@satel-sa.com>\n"
+"Language-Team: Spanish (Spain) (http://www.transifex.com/yllen/glpi-project-archires-plugin/language/es_ES/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: es_ES\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: hook.php:736 inc/locationquery.class.php:209
+msgid "All root locations"
+msgstr "Todos los lugares principales"
+
+#: hook.php:765 inc/view.class.php:292
+msgid "See numbers"
+msgstr "See numbers"
+
+#: hook.php:767 inc/view.class.php:297
+msgid "See names"
+msgstr "See names"
+
+#: hook.php:791 inc/networkinterfacecolor.class.php:142 inc/view.class.php:368
+msgid "Type of network"
+msgstr "Tipo de red"
+
+#: setup.php:63 inc/archires.class.php:44 inc/menu.class.php:38
+msgid "Network Architecture"
+msgid_plural "Network Architectures"
+msgstr[0] "Arquitectura de red"
+msgstr[1] "Arquitecturas de red"
+
+#: front/config.form.php:134
+msgid "Please activate the plugin"
+msgstr "Por favor activa el complemento"
+
+#: inc/appliancequery.class.php:114 inc/locationquery.class.php:119
+#: inc/networkequipmentquery.class.php:113
+msgid "Thanks to specify a default used view"
+msgstr "Thanks to specify a default used view"
+
+#: inc/archires.class.php:83
+msgid "Add view"
+msgstr "Añadir una vista"
+
+#: inc/imageitem.class.php:102
+msgid "Associate pictures with item types"
+msgstr "Asociar las imágenes a los tipos de material"
+
+#: inc/imageitem.class.php:119
+msgid "Some types of items must be created so that the association can exist"
+msgstr "Des types de matériels doivent être créés pour que l'association puisse exister"
+
+#: inc/imageitem.class.php:150
+msgid "Picture"
+msgstr "Imagen"
+
+#: inc/locationquery.class.php:69 inc/locationquery.class.php:165
+msgid "Childs"
+msgstr "Hijos"
+
+#: inc/menu.class.php:61 inc/networkequipmentquery.class.php:43
+#: inc/networkequipmentquery.class.php:67
+#: inc/networkequipmentquery.class.php:150 inc/view.class.php:73
+#: inc/view.class.php:257 inc/view.class.php:414 inc/view.class.php:417
+msgid "Network equipment"
+msgid_plural "Network equipments"
+msgstr[0] "Equipo de red"
+msgstr[1] "Equipos de red"
+
+#: inc/networkinterfacecolor.class.php:100
+msgid "Associate colors with network types"
+msgstr "Asociar los colores a los tipos de redes"
+
+#: inc/networkinterfacecolor.class.php:107 inc/statecolor.class.php:109
+#: inc/vlancolor.class.php:108
+msgid "Please use this color format"
+msgstr "Utilizar este formato para introducir el color"
+
+#: inc/networkinterfacecolor.class.php:143 inc/statecolor.class.php:143
+#: inc/view.class.php:131 inc/view.class.php:362 inc/vlancolor.class.php:141
+msgid "Color"
+msgstr "Color"
+
+#: inc/profile.class.php:84
+msgid "Generate graphs"
+msgstr "Generar un gráfico"
+
+#: inc/prototype.class.php:202
+msgid "Graphviz name"
+msgstr "Nombre Graphviz"
+
+#: inc/prototype.class.php:203 inc/prototype.class.php:261
+msgid "Associated picture"
+msgstr "Imagen asociada"
+
+#: inc/prototype.class.php:204
+msgid "Name of item"
+msgstr "Nombre del material"
+
+#: inc/prototype.class.php:257
+msgid "Link"
+msgid_plural "Links"
+msgstr[0] "Enlace"
+msgstr[1] "Enlaces"
+
+#: inc/prototype.class.php:258
+msgid "Graphviz links"
+msgstr "Enlaces Graphviz"
+
+#: inc/prototype.class.php:259
+msgid "IP item 1"
+msgstr "IP material 1"
+
+#: inc/prototype.class.php:260
+msgid "Socket item 1"
+msgstr "Puerto material 2"
+
+#: inc/prototype.class.php:262
+msgid "Socket item 2"
+msgstr "Puerto material 2"
+
+#: inc/prototype.class.php:263
+msgid "IP item 2"
+msgstr "IP material 2"
+
+#: inc/prototype.class.php:318 inc/prototype.class.php:321
+#: inc/prototype.class.php:494 inc/prototype.class.php:516
+msgid "Socket"
+msgstr "Puerto"
+
+#: inc/prototype.class.php:337
+msgid "Test Graphviz"
+msgstr "Probar Graphviz"
+
+#: inc/prototype.class.php:728 inc/view.class.php:324 inc/view.class.php:402
+msgid "Generation"
+msgstr "Generación"
+
+#: inc/querytype.class.php:138
+msgid "Display types of items"
+msgstr "Mostrar los tipos de materiales"
+
+#: inc/statecolor.class.php:101
+msgid "Associate colors with items statuses"
+msgstr "Asociar los colores a los estados de los materiales"
+
+#: inc/statecolor.class.php:189
+msgid "All statuses"
+msgstr "Todos los estados"
+
+#: inc/view.class.php:93 inc/view.class.php:281 inc/view.class.php:445
+#: inc/view.class.php:447
+msgid "Display sockets"
+msgstr "Ver los puertos"
+
+#: inc/view.class.php:98 inc/view.class.php:299 inc/view.class.php:452
+#: inc/view.class.php:454
+msgid "Display IP/Mask"
+msgstr "Ver IP/Máscara"
+
+#: inc/view.class.php:103 inc/view.class.php:305 inc/view.class.php:459
+#: inc/view.class.php:461
+msgid "Display item types"
+msgstr "Ver el tipo de material"
+
+#: inc/view.class.php:108 inc/view.class.php:309 inc/view.class.php:466
+#: inc/view.class.php:468
+msgid "Display item statuses"
+msgstr "Ver el estado del material"
+
+#: inc/view.class.php:113 inc/view.class.php:315 inc/view.class.php:473
+#: inc/view.class.php:475
+msgid "Display item locations"
+msgstr "Ver lugar del material"
+
+#: inc/view.class.php:118 inc/view.class.php:319 inc/view.class.php:480
+#: inc/view.class.php:482
+msgid "Display item entities"
+msgstr "Ver la entidad del material"
+
+#: inc/view.class.php:123 inc/view.class.php:327 inc/view.class.php:495
+msgid "Rendering engine"
+msgstr "Motor de renderizado"
+
+#: inc/view.class.php:127 inc/view.class.php:342 inc/view.class.php:505
+msgid "Image format"
+msgstr "Formato de la imagen"
+
+#: inc/view.class.php:194
+msgid "See all views"
+msgstr "See all views"
+
+#: inc/view.class.php:215
+msgid "Display"
+msgstr "Mostrar"
+
+#: inc/view.class.php:250 inc/view.class.php:400
+msgid "Display of items"
+msgstr "Mostrar los materiales"
+
+#: inc/view.class.php:278 inc/view.class.php:401
+msgid "Display description"
+msgstr "Ver Descripción"
+
+#: inc/view.class.php:340
+msgid "With neato, the sockets will not be displayed"
+msgstr "Con neato, los puertos no serań visibles"
+
+#: inc/vlancolor.class.php:102
+msgid "Associate colors to VLANs"
+msgstr "Associer des couleurs aux VLAN"
+
+#: inc/vlancolor.class.php:186
+msgid "All VLANs"
+msgstr "Tous les VLANs"

BIN
locales/fr_FR.mo


+ 226 - 0
locales/fr_FR.po

@@ -0,0 +1,226 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# 
+# Translators:
+# Nelly Mahu-Lasson <nini.lasson@orange.fr>, 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: GLPI Project - archires plugin\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-08-11 14:01+0200\n"
+"PO-Revision-Date: 2017-09-22 23:25+0000\n"
+"Last-Translator: Nelly Mahu-Lasson <nini.lasson@orange.fr>\n"
+"Language-Team: French (France) (http://www.transifex.com/yllen/glpi-project-archires-plugin/language/fr_FR/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: fr_FR\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#: hook.php:736 inc/locationquery.class.php:209
+msgid "All root locations"
+msgstr "Tous les lieux racines"
+
+#: hook.php:765 inc/view.class.php:292
+msgid "See numbers"
+msgstr "Voir les numéros"
+
+#: hook.php:767 inc/view.class.php:297
+msgid "See names"
+msgstr "Voir les noms"
+
+#: hook.php:791 inc/networkinterfacecolor.class.php:142 inc/view.class.php:368
+msgid "Type of network"
+msgstr "Type de réseau"
+
+#: setup.php:63 inc/archires.class.php:44 inc/menu.class.php:38
+msgid "Network Architecture"
+msgid_plural "Network Architectures"
+msgstr[0] "Architecture réseau"
+msgstr[1] "Architectures réseau"
+
+#: front/config.form.php:134
+msgid "Please activate the plugin"
+msgstr "Merci d'activer le plugin"
+
+#: inc/appliancequery.class.php:114 inc/locationquery.class.php:119
+#: inc/networkequipmentquery.class.php:113
+msgid "Thanks to specify a default used view"
+msgstr "Merci de spécifier une vue utilisée par défaut"
+
+#: inc/archires.class.php:83
+msgid "Add view"
+msgstr "Ajouter une vue"
+
+#: inc/imageitem.class.php:102
+msgid "Associate pictures with item types"
+msgstr "Associer les images à des types de matériel"
+
+#: inc/imageitem.class.php:119
+msgid "Some types of items must be created so that the association can exist"
+msgstr "Des types de matériels doivent être créés pour que l'association puisse exister"
+
+#: inc/imageitem.class.php:150
+msgid "Picture"
+msgstr "Image"
+
+#: inc/locationquery.class.php:69 inc/locationquery.class.php:165
+msgid "Childs"
+msgstr "Enfants"
+
+#: inc/menu.class.php:61 inc/networkequipmentquery.class.php:43
+#: inc/networkequipmentquery.class.php:67
+#: inc/networkequipmentquery.class.php:150 inc/view.class.php:73
+#: inc/view.class.php:257 inc/view.class.php:414 inc/view.class.php:417
+msgid "Network equipment"
+msgid_plural "Network equipments"
+msgstr[0] "Matériel réseau"
+msgstr[1] "Matériels réseau"
+
+#: inc/networkinterfacecolor.class.php:100
+msgid "Associate colors with network types"
+msgstr "Associer des couleurs aux types de réseau"
+
+#: inc/networkinterfacecolor.class.php:107 inc/statecolor.class.php:109
+#: inc/vlancolor.class.php:108
+msgid "Please use this color format"
+msgstr "Veuillez utiliser ce formatage de couleur"
+
+#: inc/networkinterfacecolor.class.php:143 inc/statecolor.class.php:143
+#: inc/view.class.php:131 inc/view.class.php:362 inc/vlancolor.class.php:141
+msgid "Color"
+msgstr "Couleur"
+
+#: inc/profile.class.php:84
+msgid "Generate graphs"
+msgstr "Génération de graphique"
+
+#: inc/prototype.class.php:202
+msgid "Graphviz name"
+msgstr "Nom Graphviz"
+
+#: inc/prototype.class.php:203 inc/prototype.class.php:261
+msgid "Associated picture"
+msgstr "Image associée"
+
+#: inc/prototype.class.php:204
+msgid "Name of item"
+msgstr "Nom du matériel"
+
+#: inc/prototype.class.php:257
+msgid "Link"
+msgid_plural "Links"
+msgstr[0] "Lien"
+msgstr[1] "Liens"
+
+#: inc/prototype.class.php:258
+msgid "Graphviz links"
+msgstr "Liaisons Graphviz"
+
+#: inc/prototype.class.php:259
+msgid "IP item 1"
+msgstr "IP matériel 1"
+
+#: inc/prototype.class.php:260
+msgid "Socket item 1"
+msgstr "Port matériel 1"
+
+#: inc/prototype.class.php:262
+msgid "Socket item 2"
+msgstr "Port matériel 2"
+
+#: inc/prototype.class.php:263
+msgid "IP item 2"
+msgstr "IP matériel 2"
+
+#: inc/prototype.class.php:318 inc/prototype.class.php:321
+#: inc/prototype.class.php:494 inc/prototype.class.php:516
+msgid "Socket"
+msgstr "Port"
+
+#: inc/prototype.class.php:337
+msgid "Test Graphviz"
+msgstr "Test Graphviz"
+
+#: inc/prototype.class.php:728 inc/view.class.php:324 inc/view.class.php:402
+msgid "Generation"
+msgstr "Génération"
+
+#: inc/querytype.class.php:138
+msgid "Display types of items"
+msgstr "Afficher des types de matériel particulier"
+
+#: inc/statecolor.class.php:101
+msgid "Associate colors with items statuses"
+msgstr "Associer des couleurs aux statuts des matériels"
+
+#: inc/statecolor.class.php:189
+msgid "All statuses"
+msgstr "Tous les statuts"
+
+#: inc/view.class.php:93 inc/view.class.php:281 inc/view.class.php:445
+#: inc/view.class.php:447
+msgid "Display sockets"
+msgstr "Voir les ports"
+
+#: inc/view.class.php:98 inc/view.class.php:299 inc/view.class.php:452
+#: inc/view.class.php:454
+msgid "Display IP/Mask"
+msgstr "Voir les IP/Masque"
+
+#: inc/view.class.php:103 inc/view.class.php:305 inc/view.class.php:459
+#: inc/view.class.php:461
+msgid "Display item types"
+msgstr "Voir le type de matériel"
+
+#: inc/view.class.php:108 inc/view.class.php:309 inc/view.class.php:466
+#: inc/view.class.php:468
+msgid "Display item statuses"
+msgstr "Voir l'état du matériel"
+
+#: inc/view.class.php:113 inc/view.class.php:315 inc/view.class.php:473
+#: inc/view.class.php:475
+msgid "Display item locations"
+msgstr "Voir le lieu du matériel"
+
+#: inc/view.class.php:118 inc/view.class.php:319 inc/view.class.php:480
+#: inc/view.class.php:482
+msgid "Display item entities"
+msgstr "Voir l'entité du matériel"
+
+#: inc/view.class.php:123 inc/view.class.php:327 inc/view.class.php:495
+msgid "Rendering engine"
+msgstr "Moteur de rendu"
+
+#: inc/view.class.php:127 inc/view.class.php:342 inc/view.class.php:505
+msgid "Image format"
+msgstr "Format de l'image"
+
+#: inc/view.class.php:194
+msgid "See all views"
+msgstr "Voir toutes les vues"
+
+#: inc/view.class.php:215
+msgid "Display"
+msgstr "Afficher"
+
+#: inc/view.class.php:250 inc/view.class.php:400
+msgid "Display of items"
+msgstr "Affichage des matériels"
+
+#: inc/view.class.php:278 inc/view.class.php:401
+msgid "Display description"
+msgstr "Affichage de la description"
+
+#: inc/view.class.php:340
+msgid "With neato, the sockets will not be displayed"
+msgstr "Avec neato, les ports ne seront pas visibles"
+
+#: inc/vlancolor.class.php:102
+msgid "Associate colors to VLANs"
+msgstr "Associer des couleurs aux VLAN"
+
+#: inc/vlancolor.class.php:186
+msgid "All VLANs"
+msgstr "Tous les VLANs"

+ 225 - 0
locales/glpi.pot

@@ -0,0 +1,225 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-08-11 14:01+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
+
+#: hook.php:736 inc/locationquery.class.php:209
+msgid "All root locations"
+msgstr ""
+
+#: hook.php:765 inc/view.class.php:292
+msgid "See numbers"
+msgstr ""
+
+#: hook.php:767 inc/view.class.php:297
+msgid "See names"
+msgstr ""
+
+#: hook.php:791 inc/networkinterfacecolor.class.php:142 inc/view.class.php:368
+msgid "Type of network"
+msgstr ""
+
+#: setup.php:63 inc/archires.class.php:44 inc/menu.class.php:38
+msgid "Network Architecture"
+msgid_plural "Network Architectures"
+msgstr[0] ""
+msgstr[1] ""
+
+#: front/config.form.php:134
+msgid "Please activate the plugin"
+msgstr ""
+
+#: inc/appliancequery.class.php:114 inc/locationquery.class.php:119
+#: inc/networkequipmentquery.class.php:113
+msgid "Thanks to specify a default used view"
+msgstr ""
+
+#: inc/archires.class.php:83
+msgid "Add view"
+msgstr ""
+
+#: inc/imageitem.class.php:102
+msgid "Associate pictures with item types"
+msgstr ""
+
+#: inc/imageitem.class.php:119
+msgid "Some types of items must be created so that the association can exist"
+msgstr ""
+
+#: inc/imageitem.class.php:150
+msgid "Picture"
+msgstr ""
+
+#: inc/locationquery.class.php:69 inc/locationquery.class.php:165
+msgid "Childs"
+msgstr ""
+
+#: inc/menu.class.php:61 inc/networkequipmentquery.class.php:43
+#: inc/networkequipmentquery.class.php:67
+#: inc/networkequipmentquery.class.php:150 inc/view.class.php:73
+#: inc/view.class.php:257 inc/view.class.php:414 inc/view.class.php:417
+msgid "Network equipment"
+msgid_plural "Network equipments"
+msgstr[0] ""
+msgstr[1] ""
+
+#: inc/networkinterfacecolor.class.php:100
+msgid "Associate colors with network types"
+msgstr ""
+
+#: inc/networkinterfacecolor.class.php:107 inc/statecolor.class.php:109
+#: inc/vlancolor.class.php:108
+msgid "Please use this color format"
+msgstr ""
+
+#: inc/networkinterfacecolor.class.php:143 inc/statecolor.class.php:143
+#: inc/view.class.php:131 inc/view.class.php:362 inc/vlancolor.class.php:141
+msgid "Color"
+msgstr ""
+
+#: inc/profile.class.php:84
+msgid "Generate graphs"
+msgstr ""
+
+#: inc/prototype.class.php:202
+msgid "Graphviz name"
+msgstr ""
+
+#: inc/prototype.class.php:203 inc/prototype.class.php:261
+msgid "Associated picture"
+msgstr ""
+
+#: inc/prototype.class.php:204
+msgid "Name of item"
+msgstr ""
+
+#: inc/prototype.class.php:257
+msgid "Link"
+msgid_plural "Links"
+msgstr[0] ""
+msgstr[1] ""
+
+#: inc/prototype.class.php:258
+msgid "Graphviz links"
+msgstr ""
+
+#: inc/prototype.class.php:259
+msgid "IP item 1"
+msgstr ""
+
+#: inc/prototype.class.php:260
+msgid "Socket item 1"
+msgstr ""
+
+#: inc/prototype.class.php:262
+msgid "Socket item 2"
+msgstr ""
+
+#: inc/prototype.class.php:263
+msgid "IP item 2"
+msgstr ""
+
+#: inc/prototype.class.php:318 inc/prototype.class.php:321
+#: inc/prototype.class.php:494 inc/prototype.class.php:516
+msgid "Socket"
+msgstr ""
+
+#: inc/prototype.class.php:337
+msgid "Test Graphviz"
+msgstr ""
+
+#: inc/prototype.class.php:728 inc/view.class.php:324 inc/view.class.php:402
+msgid "Generation"
+msgstr ""
+
+#: inc/querytype.class.php:138
+msgid "Display types of items"
+msgstr ""
+
+#: inc/statecolor.class.php:101
+msgid "Associate colors with items statuses"
+msgstr ""
+
+#: inc/statecolor.class.php:189
+msgid "All statuses"
+msgstr ""
+
+#: inc/view.class.php:93 inc/view.class.php:281 inc/view.class.php:445
+#: inc/view.class.php:447
+msgid "Display sockets"
+msgstr ""
+
+#: inc/view.class.php:98 inc/view.class.php:299 inc/view.class.php:452
+#: inc/view.class.php:454
+msgid "Display IP/Mask"
+msgstr ""
+
+#: inc/view.class.php:103 inc/view.class.php:305 inc/view.class.php:459
+#: inc/view.class.php:461
+msgid "Display item types"
+msgstr ""
+
+#: inc/view.class.php:108 inc/view.class.php:309 inc/view.class.php:466
+#: inc/view.class.php:468
+msgid "Display item statuses"
+msgstr ""
+
+#: inc/view.class.php:113 inc/view.class.php:315 inc/view.class.php:473
+#: inc/view.class.php:475
+msgid "Display item locations"
+msgstr ""
+
+#: inc/view.class.php:118 inc/view.class.php:319 inc/view.class.php:480
+#: inc/view.class.php:482
+msgid "Display item entities"
+msgstr ""
+
+#: inc/view.class.php:123 inc/view.class.php:327 inc/view.class.php:495
+msgid "Rendering engine"
+msgstr ""
+
+#: inc/view.class.php:127 inc/view.class.php:342 inc/view.class.php:505
+msgid "Image format"
+msgstr ""
+
+#: inc/view.class.php:194
+msgid "See all views"
+msgstr ""
+
+#: inc/view.class.php:215
+msgid "Display"
+msgstr ""
+
+#: inc/view.class.php:250 inc/view.class.php:400
+msgid "Display of items"
+msgstr ""
+
+#: inc/view.class.php:278 inc/view.class.php:401
+msgid "Display description"
+msgstr ""
+
+#: inc/view.class.php:340
+msgid "With neato, the sockets will not be displayed"
+msgstr ""
+
+#: inc/vlancolor.class.php:102
+msgid "Associate colors to VLANs"
+msgstr ""
+
+#: inc/vlancolor.class.php:186
+msgid "All VLANs"
+msgstr ""

BIN
locales/hr_HR.mo


+ 230 - 0
locales/hr_HR.po

@@ -0,0 +1,230 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# 
+# Translators:
+# Robert Pavicic <rpavicic@brrax.hr>, 2013
+# Sime Meic-Sidic, 2013
+msgid ""
+msgstr ""
+"Project-Id-Version: GLPI Project - archires plugin\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-08-11 14:01+0200\n"
+"PO-Revision-Date: 2017-09-22 23:25+0000\n"
+"Last-Translator: Nelly Mahu-Lasson <nini.lasson@orange.fr>\n"
+"Language-Team: Croatian (http://www.transifex.com/yllen/glpi-project-archires-plugin/language/hr/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: hr\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+
+#: hook.php:736 inc/locationquery.class.php:209
+msgid "All root locations"
+msgstr "Sve root lokacije"
+
+#: hook.php:765 inc/view.class.php:292
+msgid "See numbers"
+msgstr "Pogledaj brojeve"
+
+#: hook.php:767 inc/view.class.php:297
+msgid "See names"
+msgstr "Pogledaj nazive"
+
+#: hook.php:791 inc/networkinterfacecolor.class.php:142 inc/view.class.php:368
+msgid "Type of network"
+msgstr "Tip mreže"
+
+#: setup.php:63 inc/archires.class.php:44 inc/menu.class.php:38
+msgid "Network Architecture"
+msgid_plural "Network Architectures"
+msgstr[0] "Mrežna arhitektura"
+msgstr[1] "Mrežne arhitekture"
+msgstr[2] "Mrežne arhitekture"
+
+#: front/config.form.php:134
+msgid "Please activate the plugin"
+msgstr "Molimo uključite dodatak"
+
+#: inc/appliancequery.class.php:114 inc/locationquery.class.php:119
+#: inc/networkequipmentquery.class.php:113
+msgid "Thanks to specify a default used view"
+msgstr "Zahvaljujemo što ste odredili zadani pogled za korištenje"
+
+#: inc/archires.class.php:83
+msgid "Add view"
+msgstr "Dodaj pogled"
+
+#: inc/imageitem.class.php:102
+msgid "Associate pictures with item types"
+msgstr "Poveži slike sa tipovima stavki"
+
+#: inc/imageitem.class.php:119
+msgid "Some types of items must be created so that the association can exist"
+msgstr "Neki tipovi predmeta moraju biti kreirani kako bi veze mogle postojati"
+
+#: inc/imageitem.class.php:150
+msgid "Picture"
+msgstr "Slika"
+
+#: inc/locationquery.class.php:69 inc/locationquery.class.php:165
+msgid "Childs"
+msgstr "Djeca"
+
+#: inc/menu.class.php:61 inc/networkequipmentquery.class.php:43
+#: inc/networkequipmentquery.class.php:67
+#: inc/networkequipmentquery.class.php:150 inc/view.class.php:73
+#: inc/view.class.php:257 inc/view.class.php:414 inc/view.class.php:417
+msgid "Network equipment"
+msgid_plural "Network equipments"
+msgstr[0] "Mrežna oprema"
+msgstr[1] "Mrežne opreme"
+msgstr[2] "Mrežne opreme"
+
+#: inc/networkinterfacecolor.class.php:100
+msgid "Associate colors with network types"
+msgstr "Poveži boje sa tipovima mreže"
+
+#: inc/networkinterfacecolor.class.php:107 inc/statecolor.class.php:109
+#: inc/vlancolor.class.php:108
+msgid "Please use this color format"
+msgstr "Molimo da koristite ovaj format boje"
+
+#: inc/networkinterfacecolor.class.php:143 inc/statecolor.class.php:143
+#: inc/view.class.php:131 inc/view.class.php:362 inc/vlancolor.class.php:141
+msgid "Color"
+msgstr "Boja"
+
+#: inc/profile.class.php:84
+msgid "Generate graphs"
+msgstr "Stvori grafikone"
+
+#: inc/prototype.class.php:202
+msgid "Graphviz name"
+msgstr "Graphviz naziv"
+
+#: inc/prototype.class.php:203 inc/prototype.class.php:261
+msgid "Associated picture"
+msgstr "Povezana slika"
+
+#: inc/prototype.class.php:204
+msgid "Name of item"
+msgstr "Naziv stavke"
+
+#: inc/prototype.class.php:257
+msgid "Link"
+msgid_plural "Links"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+#: inc/prototype.class.php:258
+msgid "Graphviz links"
+msgstr "Graphviz veze"
+
+#: inc/prototype.class.php:259
+msgid "IP item 1"
+msgstr "IP stavka 1"
+
+#: inc/prototype.class.php:260
+msgid "Socket item 1"
+msgstr "Utor stavka 1"
+
+#: inc/prototype.class.php:262
+msgid "Socket item 2"
+msgstr "Utor stavka 2"
+
+#: inc/prototype.class.php:263
+msgid "IP item 2"
+msgstr "IP stavka 2"
+
+#: inc/prototype.class.php:318 inc/prototype.class.php:321
+#: inc/prototype.class.php:494 inc/prototype.class.php:516
+msgid "Socket"
+msgstr "Utor"
+
+#: inc/prototype.class.php:337
+msgid "Test Graphviz"
+msgstr "Testiraj Graphviz"
+
+#: inc/prototype.class.php:728 inc/view.class.php:324 inc/view.class.php:402
+msgid "Generation"
+msgstr "Generiranje"
+
+#: inc/querytype.class.php:138
+msgid "Display types of items"
+msgstr "Prikaži tipove stavki"
+
+#: inc/statecolor.class.php:101
+msgid "Associate colors with items statuses"
+msgstr "Poveži boje sa statusima stavki"
+
+#: inc/statecolor.class.php:189
+msgid "All statuses"
+msgstr "Svi statusi"
+
+#: inc/view.class.php:93 inc/view.class.php:281 inc/view.class.php:445
+#: inc/view.class.php:447
+msgid "Display sockets"
+msgstr "Prikaži utore"
+
+#: inc/view.class.php:98 inc/view.class.php:299 inc/view.class.php:452
+#: inc/view.class.php:454
+msgid "Display IP/Mask"
+msgstr "Prikaži IP/Masku"
+
+#: inc/view.class.php:103 inc/view.class.php:305 inc/view.class.php:459
+#: inc/view.class.php:461
+msgid "Display item types"
+msgstr "Prikaži tipove stavki"
+
+#: inc/view.class.php:108 inc/view.class.php:309 inc/view.class.php:466
+#: inc/view.class.php:468
+msgid "Display item statuses"
+msgstr "Prikaži tipove statusa"
+
+#: inc/view.class.php:113 inc/view.class.php:315 inc/view.class.php:473
+#: inc/view.class.php:475
+msgid "Display item locations"
+msgstr "Prikaži mjesta stavki"
+
+#: inc/view.class.php:118 inc/view.class.php:319 inc/view.class.php:480
+#: inc/view.class.php:482
+msgid "Display item entities"
+msgstr "Prikaži entitete stavki"
+
+#: inc/view.class.php:123 inc/view.class.php:327 inc/view.class.php:495
+msgid "Rendering engine"
+msgstr "Engine za renderiranje"
+
+#: inc/view.class.php:127 inc/view.class.php:342 inc/view.class.php:505
+msgid "Image format"
+msgstr "Format slike"
+
+#: inc/view.class.php:194
+msgid "See all views"
+msgstr "Pogledaj sve prikaze"
+
+#: inc/view.class.php:215
+msgid "Display"
+msgstr "Prikaz"
+
+#: inc/view.class.php:250 inc/view.class.php:400
+msgid "Display of items"
+msgstr "Prikaz stavki"
+
+#: inc/view.class.php:278 inc/view.class.php:401
+msgid "Display description"
+msgstr "Prikaz opisa"
+
+#: inc/view.class.php:340
+msgid "With neato, the sockets will not be displayed"
+msgstr "S neato, utor neće biti prikazan"
+
+#: inc/vlancolor.class.php:102
+msgid "Associate colors to VLANs"
+msgstr "Poveži boje sa VLAN-ovima"
+
+#: inc/vlancolor.class.php:186
+msgid "All VLANs"
+msgstr "Svi VLAN-ovi"

BIN
locales/it_IT.mo


+ 225 - 0
locales/it_IT.po

@@ -0,0 +1,225 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# 
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: GLPI Project - archires plugin\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-08-11 14:01+0200\n"
+"PO-Revision-Date: 2017-09-22 23:25+0000\n"
+"Last-Translator: Nelly Mahu-Lasson <nini.lasson@orange.fr>\n"
+"Language-Team: Italian (Italy) (http://www.transifex.com/yllen/glpi-project-archires-plugin/language/it_IT/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: it_IT\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: hook.php:736 inc/locationquery.class.php:209
+msgid "All root locations"
+msgstr "Tutte le posizioni root"
+
+#: hook.php:765 inc/view.class.php:292
+msgid "See numbers"
+msgstr "See numbers"
+
+#: hook.php:767 inc/view.class.php:297
+msgid "See names"
+msgstr "See names"
+
+#: hook.php:791 inc/networkinterfacecolor.class.php:142 inc/view.class.php:368
+msgid "Type of network"
+msgstr "Tipo di rete"
+
+#: setup.php:63 inc/archires.class.php:44 inc/menu.class.php:38
+msgid "Network Architecture"
+msgid_plural "Network Architectures"
+msgstr[0] ""
+msgstr[1] ""
+
+#: front/config.form.php:134
+msgid "Please activate the plugin"
+msgstr ""
+
+#: inc/appliancequery.class.php:114 inc/locationquery.class.php:119
+#: inc/networkequipmentquery.class.php:113
+msgid "Thanks to specify a default used view"
+msgstr "Thanks to specify a default used view"
+
+#: inc/archires.class.php:83
+msgid "Add view"
+msgstr "Aggiungi visualizzazione"
+
+#: inc/imageitem.class.php:102
+msgid "Associate pictures with item types"
+msgstr "Associa immagini con i tipi di materiale"
+
+#: inc/imageitem.class.php:119
+msgid "Some types of items must be created so that the association can exist"
+msgstr "Some types of items must be created so that the association can exist"
+
+#: inc/imageitem.class.php:150
+msgid "Picture"
+msgstr "Immagini"
+
+#: inc/locationquery.class.php:69 inc/locationquery.class.php:165
+msgid "Childs"
+msgstr "Figli"
+
+#: inc/menu.class.php:61 inc/networkequipmentquery.class.php:43
+#: inc/networkequipmentquery.class.php:67
+#: inc/networkequipmentquery.class.php:150 inc/view.class.php:73
+#: inc/view.class.php:257 inc/view.class.php:414 inc/view.class.php:417
+msgid "Network equipment"
+msgid_plural "Network equipments"
+msgstr[0] ""
+msgstr[1] ""
+
+#: inc/networkinterfacecolor.class.php:100
+msgid "Associate colors with network types"
+msgstr "Associa colori con i tipi di rete"
+
+#: inc/networkinterfacecolor.class.php:107 inc/statecolor.class.php:109
+#: inc/vlancolor.class.php:108
+msgid "Please use this color format"
+msgstr "Usa il seguente formato per il colore"
+
+#: inc/networkinterfacecolor.class.php:143 inc/statecolor.class.php:143
+#: inc/view.class.php:131 inc/view.class.php:362 inc/vlancolor.class.php:141
+msgid "Color"
+msgstr "Colore"
+
+#: inc/profile.class.php:84
+msgid "Generate graphs"
+msgstr "Genera un grafico"
+
+#: inc/prototype.class.php:202
+msgid "Graphviz name"
+msgstr "Nome Graphviz"
+
+#: inc/prototype.class.php:203 inc/prototype.class.php:261
+msgid "Associated picture"
+msgstr "Immagine associata"
+
+#: inc/prototype.class.php:204
+msgid "Name of item"
+msgstr "Nome del materiale"
+
+#: inc/prototype.class.php:257
+msgid "Link"
+msgid_plural "Links"
+msgstr[0] ""
+msgstr[1] ""
+
+#: inc/prototype.class.php:258
+msgid "Graphviz links"
+msgstr "Collegamenti Graphviz"
+
+#: inc/prototype.class.php:259
+msgid "IP item 1"
+msgstr "IP materiale 1"
+
+#: inc/prototype.class.php:260
+msgid "Socket item 1"
+msgstr "Socket materiale 1"
+
+#: inc/prototype.class.php:262
+msgid "Socket item 2"
+msgstr "Socket materiale 2"
+
+#: inc/prototype.class.php:263
+msgid "IP item 2"
+msgstr "IP materiale 2"
+
+#: inc/prototype.class.php:318 inc/prototype.class.php:321
+#: inc/prototype.class.php:494 inc/prototype.class.php:516
+msgid "Socket"
+msgstr "Socket"
+
+#: inc/prototype.class.php:337
+msgid "Test Graphviz"
+msgstr "Test Graphviz"
+
+#: inc/prototype.class.php:728 inc/view.class.php:324 inc/view.class.php:402
+msgid "Generation"
+msgstr "Generazione"
+
+#: inc/querytype.class.php:138
+msgid "Display types of items"
+msgstr "Mostra il tipo degli elementi"
+
+#: inc/statecolor.class.php:101
+msgid "Associate colors with items statuses"
+msgstr "Associa colori con lo stato degli elementi"
+
+#: inc/statecolor.class.php:189
+msgid "All statuses"
+msgstr "Tutti gli stati"
+
+#: inc/view.class.php:93 inc/view.class.php:281 inc/view.class.php:445
+#: inc/view.class.php:447
+msgid "Display sockets"
+msgstr "Visualizza i numeri di socket"
+
+#: inc/view.class.php:98 inc/view.class.php:299 inc/view.class.php:452
+#: inc/view.class.php:454
+msgid "Display IP/Mask"
+msgstr "Visulizza IP/Mask"
+
+#: inc/view.class.php:103 inc/view.class.php:305 inc/view.class.php:459
+#: inc/view.class.php:461
+msgid "Display item types"
+msgstr "Visualizza tipo elementi"
+
+#: inc/view.class.php:108 inc/view.class.php:309 inc/view.class.php:466
+#: inc/view.class.php:468
+msgid "Display item statuses"
+msgstr "Visualizza stato elementi"
+
+#: inc/view.class.php:113 inc/view.class.php:315 inc/view.class.php:473
+#: inc/view.class.php:475
+msgid "Display item locations"
+msgstr "Visualizza posizione elementi"
+
+#: inc/view.class.php:118 inc/view.class.php:319 inc/view.class.php:480
+#: inc/view.class.php:482
+msgid "Display item entities"
+msgstr "Visulizza entit&agrave; degli elementi"
+
+#: inc/view.class.php:123 inc/view.class.php:327 inc/view.class.php:495
+msgid "Rendering engine"
+msgstr "Motore grafico"
+
+#: inc/view.class.php:127 inc/view.class.php:342 inc/view.class.php:505
+msgid "Image format"
+msgstr "Formato immagine"
+
+#: inc/view.class.php:194
+msgid "See all views"
+msgstr "See all views"
+
+#: inc/view.class.php:215
+msgid "Display"
+msgstr "Mostra"
+
+#: inc/view.class.php:250 inc/view.class.php:400
+msgid "Display of items"
+msgstr "Visualizzazione degli elementi"
+
+#: inc/view.class.php:278 inc/view.class.php:401
+msgid "Display description"
+msgstr "Visualizza descrizione"
+
+#: inc/view.class.php:340
+msgid "With neato, the sockets will not be displayed"
+msgstr "Con neato, i sockets non saranno visualizzati"
+
+#: inc/vlancolor.class.php:102
+msgid "Associate colors to VLANs"
+msgstr "Associer des couleurs aux VLAN"
+
+#: inc/vlancolor.class.php:186
+msgid "All VLANs"
+msgstr "Tous les VLANs"

BIN
locales/pt_BR.mo


+ 226 - 0
locales/pt_BR.po

@@ -0,0 +1,226 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# 
+# Translators:
+# Taysa, 2019
+msgid ""
+msgstr ""
+"Project-Id-Version: GLPI Project - archires plugin\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-08-11 14:01+0200\n"
+"PO-Revision-Date: 2019-04-25 19:51+0000\n"
+"Last-Translator: Taysa\n"
+"Language-Team: Portuguese (Brazil) (http://www.transifex.com/yllen/glpi-project-archires-plugin/language/pt_BR/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: pt_BR\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#: hook.php:736 inc/locationquery.class.php:209
+msgid "All root locations"
+msgstr "Todas as localizações do Root"
+
+#: hook.php:765 inc/view.class.php:292
+msgid "See numbers"
+msgstr "Veja os números"
+
+#: hook.php:767 inc/view.class.php:297
+msgid "See names"
+msgstr "Veja os nomes"
+
+#: hook.php:791 inc/networkinterfacecolor.class.php:142 inc/view.class.php:368
+msgid "Type of network"
+msgstr "Tipo de rede"
+
+#: setup.php:63 inc/archires.class.php:44 inc/menu.class.php:38
+msgid "Network Architecture"
+msgid_plural "Network Architectures"
+msgstr[0] "Arquitetura de Rede"
+msgstr[1] "Arquiteturas de Rede"
+
+#: front/config.form.php:134
+msgid "Please activate the plugin"
+msgstr "Por favor ative o plugin"
+
+#: inc/appliancequery.class.php:114 inc/locationquery.class.php:119
+#: inc/networkequipmentquery.class.php:113
+msgid "Thanks to specify a default used view"
+msgstr "Obrigado por especificar uma visualização padrão"
+
+#: inc/archires.class.php:83
+msgid "Add view"
+msgstr "Adicionar visualização"
+
+#: inc/imageitem.class.php:102
+msgid "Associate pictures with item types"
+msgstr "Associar fotos a tipos de itens"
+
+#: inc/imageitem.class.php:119
+msgid "Some types of items must be created so that the association can exist"
+msgstr "Alguns tipos de itens devem ser criados para que a associação possa existir"
+
+#: inc/imageitem.class.php:150
+msgid "Picture"
+msgstr "Imagem"
+
+#: inc/locationquery.class.php:69 inc/locationquery.class.php:165
+msgid "Childs"
+msgstr ""
+
+#: inc/menu.class.php:61 inc/networkequipmentquery.class.php:43
+#: inc/networkequipmentquery.class.php:67
+#: inc/networkequipmentquery.class.php:150 inc/view.class.php:73
+#: inc/view.class.php:257 inc/view.class.php:414 inc/view.class.php:417
+msgid "Network equipment"
+msgid_plural "Network equipments"
+msgstr[0] "Equipamento de rede"
+msgstr[1] "Equipamentos de rede"
+
+#: inc/networkinterfacecolor.class.php:100
+msgid "Associate colors with network types"
+msgstr "Associar cores a tipos de rede"
+
+#: inc/networkinterfacecolor.class.php:107 inc/statecolor.class.php:109
+#: inc/vlancolor.class.php:108
+msgid "Please use this color format"
+msgstr "Por favor, use este formato de cor"
+
+#: inc/networkinterfacecolor.class.php:143 inc/statecolor.class.php:143
+#: inc/view.class.php:131 inc/view.class.php:362 inc/vlancolor.class.php:141
+msgid "Color"
+msgstr "Cor"
+
+#: inc/profile.class.php:84
+msgid "Generate graphs"
+msgstr "Gerar gráficos"
+
+#: inc/prototype.class.php:202
+msgid "Graphviz name"
+msgstr "Nome do Graphviz"
+
+#: inc/prototype.class.php:203 inc/prototype.class.php:261
+msgid "Associated picture"
+msgstr "Imagem associada"
+
+#: inc/prototype.class.php:204
+msgid "Name of item"
+msgstr "Nome do item"
+
+#: inc/prototype.class.php:257
+msgid "Link"
+msgid_plural "Links"
+msgstr[0] "Vínculo"
+msgstr[1] "Vínculos"
+
+#: inc/prototype.class.php:258
+msgid "Graphviz links"
+msgstr "Vínculos do Graphviz"
+
+#: inc/prototype.class.php:259
+msgid "IP item 1"
+msgstr "IP do item 1"
+
+#: inc/prototype.class.php:260
+msgid "Socket item 1"
+msgstr "Socket do item 1"
+
+#: inc/prototype.class.php:262
+msgid "Socket item 2"
+msgstr "Socket do item 2"
+
+#: inc/prototype.class.php:263
+msgid "IP item 2"
+msgstr "IP do item 2"
+
+#: inc/prototype.class.php:318 inc/prototype.class.php:321
+#: inc/prototype.class.php:494 inc/prototype.class.php:516
+msgid "Socket"
+msgstr "Socket"
+
+#: inc/prototype.class.php:337
+msgid "Test Graphviz"
+msgstr "Teste Graphviz"
+
+#: inc/prototype.class.php:728 inc/view.class.php:324 inc/view.class.php:402
+msgid "Generation"
+msgstr "Geração"
+
+#: inc/querytype.class.php:138
+msgid "Display types of items"
+msgstr "Exibir tipos de itens"
+
+#: inc/statecolor.class.php:101
+msgid "Associate colors with items statuses"
+msgstr "Associar cores a status de itens"
+
+#: inc/statecolor.class.php:189
+msgid "All statuses"
+msgstr "Todos os status"
+
+#: inc/view.class.php:93 inc/view.class.php:281 inc/view.class.php:445
+#: inc/view.class.php:447
+msgid "Display sockets"
+msgstr "Mostrar sockets"
+
+#: inc/view.class.php:98 inc/view.class.php:299 inc/view.class.php:452
+#: inc/view.class.php:454
+msgid "Display IP/Mask"
+msgstr "Mostrar IP/Mask"
+
+#: inc/view.class.php:103 inc/view.class.php:305 inc/view.class.php:459
+#: inc/view.class.php:461
+msgid "Display item types"
+msgstr "Mostrar tipos de item"
+
+#: inc/view.class.php:108 inc/view.class.php:309 inc/view.class.php:466
+#: inc/view.class.php:468
+msgid "Display item statuses"
+msgstr "Mostrar status de item"
+
+#: inc/view.class.php:113 inc/view.class.php:315 inc/view.class.php:473
+#: inc/view.class.php:475
+msgid "Display item locations"
+msgstr "Mostrar localização do item"
+
+#: inc/view.class.php:118 inc/view.class.php:319 inc/view.class.php:480
+#: inc/view.class.php:482
+msgid "Display item entities"
+msgstr "Mostrar entidade do item"
+
+#: inc/view.class.php:123 inc/view.class.php:327 inc/view.class.php:495
+msgid "Rendering engine"
+msgstr "Mecanismo de renderização"
+
+#: inc/view.class.php:127 inc/view.class.php:342 inc/view.class.php:505
+msgid "Image format"
+msgstr "Formato da imagem"
+
+#: inc/view.class.php:194
+msgid "See all views"
+msgstr "Ver todas as visualizações"
+
+#: inc/view.class.php:215
+msgid "Display"
+msgstr "Exibição"
+
+#: inc/view.class.php:250 inc/view.class.php:400
+msgid "Display of items"
+msgstr "Exibição de itens"
+
+#: inc/view.class.php:278 inc/view.class.php:401
+msgid "Display description"
+msgstr "Exibir descrição"
+
+#: inc/view.class.php:340
+msgid "With neato, the sockets will not be displayed"
+msgstr ""
+
+#: inc/vlancolor.class.php:102
+msgid "Associate colors to VLANs"
+msgstr "Associar cores a VLANs"
+
+#: inc/vlancolor.class.php:186
+msgid "All VLANs"
+msgstr "Todas as VLANs"

BIN
locales/ro_RO.mo


+ 229 - 0
locales/ro_RO.po

@@ -0,0 +1,229 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# 
+# Translators:
+# Doru  DEACONU <dumitrudeaconu@yahoo.com>, 2015
+msgid ""
+msgstr ""
+"Project-Id-Version: GLPI Project - archires plugin\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-08-11 14:01+0200\n"
+"PO-Revision-Date: 2017-09-22 23:25+0000\n"
+"Last-Translator: Nelly Mahu-Lasson <nini.lasson@orange.fr>\n"
+"Language-Team: Romanian (Romania) (http://www.transifex.com/yllen/glpi-project-archires-plugin/language/ro_RO/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: ro_RO\n"
+"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n"
+
+#: hook.php:736 inc/locationquery.class.php:209
+msgid "All root locations"
+msgstr "Toate locatiile radacina"
+
+#: hook.php:765 inc/view.class.php:292
+msgid "See numbers"
+msgstr "Vezi numerele"
+
+#: hook.php:767 inc/view.class.php:297
+msgid "See names"
+msgstr "Vezi numele"
+
+#: hook.php:791 inc/networkinterfacecolor.class.php:142 inc/view.class.php:368
+msgid "Type of network"
+msgstr "Tip retea"
+
+#: setup.php:63 inc/archires.class.php:44 inc/menu.class.php:38
+msgid "Network Architecture"
+msgid_plural "Network Architectures"
+msgstr[0] "Arhitectura Retea"
+msgstr[1] "Arhitecturi Retea"
+msgstr[2] "Arhitecturi Retea"
+
+#: front/config.form.php:134
+msgid "Please activate the plugin"
+msgstr "Activati pluginul va rog"
+
+#: inc/appliancequery.class.php:114 inc/locationquery.class.php:119
+#: inc/networkequipmentquery.class.php:113
+msgid "Thanks to specify a default used view"
+msgstr "Specificati vederea folosita implicit"
+
+#: inc/archires.class.php:83
+msgid "Add view"
+msgstr "Add view"
+
+#: inc/imageitem.class.php:102
+msgid "Associate pictures with item types"
+msgstr "Asociati imagini la tipuri de elemente"
+
+#: inc/imageitem.class.php:119
+msgid "Some types of items must be created so that the association can exist"
+msgstr "Unele tipuri de elemente trebuiesc create pentru ca asocierea sa existe"
+
+#: inc/imageitem.class.php:150
+msgid "Picture"
+msgstr "Imagini"
+
+#: inc/locationquery.class.php:69 inc/locationquery.class.php:165
+msgid "Childs"
+msgstr "Copii"
+
+#: inc/menu.class.php:61 inc/networkequipmentquery.class.php:43
+#: inc/networkequipmentquery.class.php:67
+#: inc/networkequipmentquery.class.php:150 inc/view.class.php:73
+#: inc/view.class.php:257 inc/view.class.php:414 inc/view.class.php:417
+msgid "Network equipment"
+msgid_plural "Network equipments"
+msgstr[0] "Echipament retea"
+msgstr[1] "Echipamente retea"
+msgstr[2] "Echipamente retea"
+
+#: inc/networkinterfacecolor.class.php:100
+msgid "Associate colors with network types"
+msgstr "Asociati culori la tipuri de retea"
+
+#: inc/networkinterfacecolor.class.php:107 inc/statecolor.class.php:109
+#: inc/vlancolor.class.php:108
+msgid "Please use this color format"
+msgstr "Utilizati acest format de culoare"
+
+#: inc/networkinterfacecolor.class.php:143 inc/statecolor.class.php:143
+#: inc/view.class.php:131 inc/view.class.php:362 inc/vlancolor.class.php:141
+msgid "Color"
+msgstr "Culoare"
+
+#: inc/profile.class.php:84
+msgid "Generate graphs"
+msgstr "Genereaza grafice"
+
+#: inc/prototype.class.php:202
+msgid "Graphviz name"
+msgstr "Nume grafic"
+
+#: inc/prototype.class.php:203 inc/prototype.class.php:261
+msgid "Associated picture"
+msgstr "Imagine asociata"
+
+#: inc/prototype.class.php:204
+msgid "Name of item"
+msgstr "Nume element"
+
+#: inc/prototype.class.php:257
+msgid "Link"
+msgid_plural "Links"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+#: inc/prototype.class.php:258
+msgid "Graphviz links"
+msgstr "Linkuri grafice"
+
+#: inc/prototype.class.php:259
+msgid "IP item 1"
+msgstr "IP item 1"
+
+#: inc/prototype.class.php:260
+msgid "Socket item 1"
+msgstr "Socket item 1"
+
+#: inc/prototype.class.php:262
+msgid "Socket item 2"
+msgstr "Socket item 2"
+
+#: inc/prototype.class.php:263
+msgid "IP item 2"
+msgstr "IP item 2"
+
+#: inc/prototype.class.php:318 inc/prototype.class.php:321
+#: inc/prototype.class.php:494 inc/prototype.class.php:516
+msgid "Socket"
+msgstr "Socket"
+
+#: inc/prototype.class.php:337
+msgid "Test Graphviz"
+msgstr "Test Grafice"
+
+#: inc/prototype.class.php:728 inc/view.class.php:324 inc/view.class.php:402
+msgid "Generation"
+msgstr "Generatie"
+
+#: inc/querytype.class.php:138
+msgid "Display types of items"
+msgstr "Afiseaza tipuri elemente"
+
+#: inc/statecolor.class.php:101
+msgid "Associate colors with items statuses"
+msgstr "Asociaza culori la statusurile elementelor"
+
+#: inc/statecolor.class.php:189
+msgid "All statuses"
+msgstr "Toate statusurile"
+
+#: inc/view.class.php:93 inc/view.class.php:281 inc/view.class.php:445
+#: inc/view.class.php:447
+msgid "Display sockets"
+msgstr "Afiseaza sockets"
+
+#: inc/view.class.php:98 inc/view.class.php:299 inc/view.class.php:452
+#: inc/view.class.php:454
+msgid "Display IP/Mask"
+msgstr "Afiseaza  IP/Mask"
+
+#: inc/view.class.php:103 inc/view.class.php:305 inc/view.class.php:459
+#: inc/view.class.php:461
+msgid "Display item types"
+msgstr "Afiseaza tipuri item"
+
+#: inc/view.class.php:108 inc/view.class.php:309 inc/view.class.php:466
+#: inc/view.class.php:468
+msgid "Display item statuses"
+msgstr "Afiseaza  statusuri element"
+
+#: inc/view.class.php:113 inc/view.class.php:315 inc/view.class.php:473
+#: inc/view.class.php:475
+msgid "Display item locations"
+msgstr "Afiseaza  locatiiile elementelor"
+
+#: inc/view.class.php:118 inc/view.class.php:319 inc/view.class.php:480
+#: inc/view.class.php:482
+msgid "Display item entities"
+msgstr "Afiseaza entitatile elementelor"
+
+#: inc/view.class.php:123 inc/view.class.php:327 inc/view.class.php:495
+msgid "Rendering engine"
+msgstr "Rendering engine"
+
+#: inc/view.class.php:127 inc/view.class.php:342 inc/view.class.php:505
+msgid "Image format"
+msgstr "Format imagine"
+
+#: inc/view.class.php:194
+msgid "See all views"
+msgstr "Vezi toate vederile"
+
+#: inc/view.class.php:215
+msgid "Display"
+msgstr "Display"
+
+#: inc/view.class.php:250 inc/view.class.php:400
+msgid "Display of items"
+msgstr "Afiseaza  elementele"
+
+#: inc/view.class.php:278 inc/view.class.php:401
+msgid "Display description"
+msgstr "Afiseaza descrierea"
+
+#: inc/view.class.php:340
+msgid "With neato, the sockets will not be displayed"
+msgstr "Cu neato,  socketele nu vor fi afisate"
+
+#: inc/vlancolor.class.php:102
+msgid "Associate colors to VLANs"
+msgstr "Culori asociate la VLANuri"
+
+#: inc/vlancolor.class.php:186
+msgid "All VLANs"
+msgstr "Toate VLAN urile"

BIN
locales/ru_RU.mo


+ 232 - 0
locales/ru_RU.po

@@ -0,0 +1,232 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# 
+# Translators:
+# Nikolai Petrov <techobsl@yandex.ru>, 2017
+msgid ""
+msgstr ""
+"Project-Id-Version: GLPI Project - archires plugin\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-08-11 14:01+0200\n"
+"PO-Revision-Date: 2017-10-19 18:15+0000\n"
+"Last-Translator: Nikolai Petrov <techobsl@yandex.ru>\n"
+"Language-Team: Russian (Russia) (http://www.transifex.com/yllen/glpi-project-archires-plugin/language/ru_RU/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: ru_RU\n"
+"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
+
+#: hook.php:736 inc/locationquery.class.php:209
+msgid "All root locations"
+msgstr "Все местонахождения"
+
+#: hook.php:765 inc/view.class.php:292
+msgid "See numbers"
+msgstr "Смотрите номера"
+
+#: hook.php:767 inc/view.class.php:297
+msgid "See names"
+msgstr "Смотрите названия"
+
+#: hook.php:791 inc/networkinterfacecolor.class.php:142 inc/view.class.php:368
+msgid "Type of network"
+msgstr "Тип сети"
+
+#: setup.php:63 inc/archires.class.php:44 inc/menu.class.php:38
+msgid "Network Architecture"
+msgid_plural "Network Architectures"
+msgstr[0] "Сетевая архитектура"
+msgstr[1] "Сетевые архитектуры"
+msgstr[2] "Сетевые архитектуры"
+msgstr[3] "Сетевые архитектуры"
+
+#: front/config.form.php:134
+msgid "Please activate the plugin"
+msgstr "Пожалуйста, активируйте этот плагин"
+
+#: inc/appliancequery.class.php:114 inc/locationquery.class.php:119
+#: inc/networkequipmentquery.class.php:113
+msgid "Thanks to specify a default used view"
+msgstr "Благодаря указанному по умолчанию использываему виду"
+
+#: inc/archires.class.php:83
+msgid "Add view"
+msgstr "Добавить вид"
+
+#: inc/imageitem.class.php:102
+msgid "Associate pictures with item types"
+msgstr "Назначить изображения типам объектов"
+
+#: inc/imageitem.class.php:119
+msgid "Some types of items must be created so that the association can exist"
+msgstr "Некоторые типы элементов должны быть созданы так, чтобы связи могли существовать"
+
+#: inc/imageitem.class.php:150
+msgid "Picture"
+msgstr "Изображение"
+
+#: inc/locationquery.class.php:69 inc/locationquery.class.php:165
+msgid "Childs"
+msgstr "Подчинённые"
+
+#: inc/menu.class.php:61 inc/networkequipmentquery.class.php:43
+#: inc/networkequipmentquery.class.php:67
+#: inc/networkequipmentquery.class.php:150 inc/view.class.php:73
+#: inc/view.class.php:257 inc/view.class.php:414 inc/view.class.php:417
+msgid "Network equipment"
+msgid_plural "Network equipments"
+msgstr[0] "Сетевое оборудование"
+msgstr[1] "Сетевые оборудования"
+msgstr[2] "Сетевые оборудования"
+msgstr[3] "Сетевые оборудования"
+
+#: inc/networkinterfacecolor.class.php:100
+msgid "Associate colors with network types"
+msgstr "Назначить цвет для типа сети"
+
+#: inc/networkinterfacecolor.class.php:107 inc/statecolor.class.php:109
+#: inc/vlancolor.class.php:108
+msgid "Please use this color format"
+msgstr "Используйте данный формат цвета"
+
+#: inc/networkinterfacecolor.class.php:143 inc/statecolor.class.php:143
+#: inc/view.class.php:131 inc/view.class.php:362 inc/vlancolor.class.php:141
+msgid "Color"
+msgstr "Цвет"
+
+#: inc/profile.class.php:84
+msgid "Generate graphs"
+msgstr "Формирование"
+
+#: inc/prototype.class.php:202
+msgid "Graphviz name"
+msgstr "Graphviz имя"
+
+#: inc/prototype.class.php:203 inc/prototype.class.php:261
+msgid "Associated picture"
+msgstr "Назначено изображение"
+
+#: inc/prototype.class.php:204
+msgid "Name of item"
+msgstr "Название"
+
+#: inc/prototype.class.php:257
+msgid "Link"
+msgid_plural "Links"
+msgstr[0] "Связь"
+msgstr[1] "Связи"
+msgstr[2] "Связи"
+msgstr[3] "Связи"
+
+#: inc/prototype.class.php:258
+msgid "Graphviz links"
+msgstr "Graphviz связи"
+
+#: inc/prototype.class.php:259
+msgid "IP item 1"
+msgstr "IP номер  1"
+
+#: inc/prototype.class.php:260
+msgid "Socket item 1"
+msgstr "Разъем номер 1"
+
+#: inc/prototype.class.php:262
+msgid "Socket item 2"
+msgstr "Разъем номер 2"
+
+#: inc/prototype.class.php:263
+msgid "IP item 2"
+msgstr "IP номер 2"
+
+#: inc/prototype.class.php:318 inc/prototype.class.php:321
+#: inc/prototype.class.php:494 inc/prototype.class.php:516
+msgid "Socket"
+msgstr "Порт"
+
+#: inc/prototype.class.php:337
+msgid "Test Graphviz"
+msgstr "Тестирование Graphviz"
+
+#: inc/prototype.class.php:728 inc/view.class.php:324 inc/view.class.php:402
+msgid "Generation"
+msgstr "Сформировать"
+
+#: inc/querytype.class.php:138
+msgid "Display types of items"
+msgstr "Показывать тип"
+
+#: inc/statecolor.class.php:101
+msgid "Associate colors with items statuses"
+msgstr "Назначить цвета по статусу объектов"
+
+#: inc/statecolor.class.php:189
+msgid "All statuses"
+msgstr "Все статусы"
+
+#: inc/view.class.php:93 inc/view.class.php:281 inc/view.class.php:445
+#: inc/view.class.php:447
+msgid "Display sockets"
+msgstr "Показывать количество портов"
+
+#: inc/view.class.php:98 inc/view.class.php:299 inc/view.class.php:452
+#: inc/view.class.php:454
+msgid "Display IP/Mask"
+msgstr "Показывать IP/Маску"
+
+#: inc/view.class.php:103 inc/view.class.php:305 inc/view.class.php:459
+#: inc/view.class.php:461
+msgid "Display item types"
+msgstr "Показывать тип объекта"
+
+#: inc/view.class.php:108 inc/view.class.php:309 inc/view.class.php:466
+#: inc/view.class.php:468
+msgid "Display item statuses"
+msgstr "Показывать статус объекта"
+
+#: inc/view.class.php:113 inc/view.class.php:315 inc/view.class.php:473
+#: inc/view.class.php:475
+msgid "Display item locations"
+msgstr "Показывать расположение"
+
+#: inc/view.class.php:118 inc/view.class.php:319 inc/view.class.php:480
+#: inc/view.class.php:482
+msgid "Display item entities"
+msgstr "Показывать организацию"
+
+#: inc/view.class.php:123 inc/view.class.php:327 inc/view.class.php:495
+msgid "Rendering engine"
+msgstr "Движок визуализации"
+
+#: inc/view.class.php:127 inc/view.class.php:342 inc/view.class.php:505
+msgid "Image format"
+msgstr "Формат изображения"
+
+#: inc/view.class.php:194
+msgid "See all views"
+msgstr "Посмотреть все виды"
+
+#: inc/view.class.php:215
+msgid "Display"
+msgstr "Показать"
+
+#: inc/view.class.php:250 inc/view.class.php:400
+msgid "Display of items"
+msgstr "Показывать объекты"
+
+#: inc/view.class.php:278 inc/view.class.php:401
+msgid "Display description"
+msgstr "Показывать описание"
+
+#: inc/view.class.php:340
+msgid "With neato, the sockets will not be displayed"
+msgstr "При использовании neato порты не отображаются"
+
+#: inc/vlancolor.class.php:102
+msgid "Associate colors to VLANs"
+msgstr "Связать цвета с VLAN"
+
+#: inc/vlancolor.class.php:186
+msgid "All VLANs"
+msgstr "Все VLAN"

BIN
locales/tr_TR.mo


+ 226 - 0
locales/tr_TR.po

@@ -0,0 +1,226 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# 
+# Translators:
+# Kaya Zeren <kayazeren@gmail.com>, 2013,2015-2016
+msgid ""
+msgstr ""
+"Project-Id-Version: GLPI Project - archires plugin\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-08-11 14:01+0200\n"
+"PO-Revision-Date: 2017-09-23 22:31+0000\n"
+"Last-Translator: Kaya Zeren <kayazeren@gmail.com>\n"
+"Language-Team: Turkish (Turkey) (http://www.transifex.com/yllen/glpi-project-archires-plugin/language/tr_TR/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: tr_TR\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#: hook.php:736 inc/locationquery.class.php:209
+msgid "All root locations"
+msgstr "Tüm kök konumlar"
+
+#: hook.php:765 inc/view.class.php:292
+msgid "See numbers"
+msgstr "Sayılara bakın"
+
+#: hook.php:767 inc/view.class.php:297
+msgid "See names"
+msgstr "Adlara bakın"
+
+#: hook.php:791 inc/networkinterfacecolor.class.php:142 inc/view.class.php:368
+msgid "Type of network"
+msgstr "Ağ tipi"
+
+#: setup.php:63 inc/archires.class.php:44 inc/menu.class.php:38
+msgid "Network Architecture"
+msgid_plural "Network Architectures"
+msgstr[0] "Ağ Mimarisi"
+msgstr[1] "Ağ Mimarisi"
+
+#: front/config.form.php:134
+msgid "Please activate the plugin"
+msgstr "Lütfen uygulama ekini etkinleştirin"
+
+#: inc/appliancequery.class.php:114 inc/locationquery.class.php:119
+#: inc/networkequipmentquery.class.php:113
+msgid "Thanks to specify a default used view"
+msgstr "Varsayılan olarak kullanılan görünüm belirtildiği için"
+
+#: inc/archires.class.php:83
+msgid "Add view"
+msgstr "Görünüm ekleyin"
+
+#: inc/imageitem.class.php:102
+msgid "Associate pictures with item types"
+msgstr "Öge tiplerine görseller atayın"
+
+#: inc/imageitem.class.php:119
+msgid "Some types of items must be created so that the association can exist"
+msgstr "Görsel atayabilmek için öge tipleri oluşturulmalıdır"
+
+#: inc/imageitem.class.php:150
+msgid "Picture"
+msgstr "Görsel"
+
+#: inc/locationquery.class.php:69 inc/locationquery.class.php:165
+msgid "Childs"
+msgstr "Alt ögeler"
+
+#: inc/menu.class.php:61 inc/networkequipmentquery.class.php:43
+#: inc/networkequipmentquery.class.php:67
+#: inc/networkequipmentquery.class.php:150 inc/view.class.php:73
+#: inc/view.class.php:257 inc/view.class.php:414 inc/view.class.php:417
+msgid "Network equipment"
+msgid_plural "Network equipments"
+msgstr[0] "Ağ aygıtı"
+msgstr[1] "Ağ aygıtı"
+
+#: inc/networkinterfacecolor.class.php:100
+msgid "Associate colors with network types"
+msgstr "Ağ tiplerine renk atayın"
+
+#: inc/networkinterfacecolor.class.php:107 inc/statecolor.class.php:109
+#: inc/vlancolor.class.php:108
+msgid "Please use this color format"
+msgstr "Lütfen şu renk biçimini kullanın"
+
+#: inc/networkinterfacecolor.class.php:143 inc/statecolor.class.php:143
+#: inc/view.class.php:131 inc/view.class.php:362 inc/vlancolor.class.php:141
+msgid "Color"
+msgstr "Renk"
+
+#: inc/profile.class.php:84
+msgid "Generate graphs"
+msgstr "Çizelge oluşturma"
+
+#: inc/prototype.class.php:202
+msgid "Graphviz name"
+msgstr "Graphviz adı"
+
+#: inc/prototype.class.php:203 inc/prototype.class.php:261
+msgid "Associated picture"
+msgstr "Atanmış görsel"
+
+#: inc/prototype.class.php:204
+msgid "Name of item"
+msgstr "Öge adı"
+
+#: inc/prototype.class.php:257
+msgid "Link"
+msgid_plural "Links"
+msgstr[0] "Bağlantı"
+msgstr[1] "Bağlantı"
+
+#: inc/prototype.class.php:258
+msgid "Graphviz links"
+msgstr "Graphviz bağlantıları"
+
+#: inc/prototype.class.php:259
+msgid "IP item 1"
+msgstr "IP ögesi 1"
+
+#: inc/prototype.class.php:260
+msgid "Socket item 1"
+msgstr "Soket ögesi 1"
+
+#: inc/prototype.class.php:262
+msgid "Socket item 2"
+msgstr "Soket ögesi 2"
+
+#: inc/prototype.class.php:263
+msgid "IP item 2"
+msgstr "IP ögesi 2"
+
+#: inc/prototype.class.php:318 inc/prototype.class.php:321
+#: inc/prototype.class.php:494 inc/prototype.class.php:516
+msgid "Socket"
+msgstr "Soket"
+
+#: inc/prototype.class.php:337
+msgid "Test Graphviz"
+msgstr "Graphviz Sınayın"
+
+#: inc/prototype.class.php:728 inc/view.class.php:324 inc/view.class.php:402
+msgid "Generation"
+msgstr "Oluşturma"
+
+#: inc/querytype.class.php:138
+msgid "Display types of items"
+msgstr "Öge tipleri görüntülensin "
+
+#: inc/statecolor.class.php:101
+msgid "Associate colors with items statuses"
+msgstr "Öge durumlarına renk atayın"
+
+#: inc/statecolor.class.php:189
+msgid "All statuses"
+msgstr "Tüm durumlar"
+
+#: inc/view.class.php:93 inc/view.class.php:281 inc/view.class.php:445
+#: inc/view.class.php:447
+msgid "Display sockets"
+msgstr "Soketler görüntülensin"
+
+#: inc/view.class.php:98 inc/view.class.php:299 inc/view.class.php:452
+#: inc/view.class.php:454
+msgid "Display IP/Mask"
+msgstr "IP/Maske görüntülensin"
+
+#: inc/view.class.php:103 inc/view.class.php:305 inc/view.class.php:459
+#: inc/view.class.php:461
+msgid "Display item types"
+msgstr "Öge tipleri görüntülensin"
+
+#: inc/view.class.php:108 inc/view.class.php:309 inc/view.class.php:466
+#: inc/view.class.php:468
+msgid "Display item statuses"
+msgstr "Öge durumları görüntülensin"
+
+#: inc/view.class.php:113 inc/view.class.php:315 inc/view.class.php:473
+#: inc/view.class.php:475
+msgid "Display item locations"
+msgstr "Öge konumları görüntülensin"
+
+#: inc/view.class.php:118 inc/view.class.php:319 inc/view.class.php:480
+#: inc/view.class.php:482
+msgid "Display item entities"
+msgstr "Öge birimleri görüntülensin"
+
+#: inc/view.class.php:123 inc/view.class.php:327 inc/view.class.php:495
+msgid "Rendering engine"
+msgstr "Görüntüleme motoru"
+
+#: inc/view.class.php:127 inc/view.class.php:342 inc/view.class.php:505
+msgid "Image format"
+msgstr "Görsel biçimi"
+
+#: inc/view.class.php:194
+msgid "See all views"
+msgstr "Tüm görünümlere bakın"
+
+#: inc/view.class.php:215
+msgid "Display"
+msgstr "Görünüm"
+
+#: inc/view.class.php:250 inc/view.class.php:400
+msgid "Display of items"
+msgstr "Öge görünümü"
+
+#: inc/view.class.php:278 inc/view.class.php:401
+msgid "Display description"
+msgstr "Görünüm açıklaması"
+
+#: inc/view.class.php:340
+msgid "With neato, the sockets will not be displayed"
+msgstr "Neato ile soketler görüntülenemez"
+
+#: inc/vlancolor.class.php:102
+msgid "Associate colors to VLANs"
+msgstr "VLAN renkleri atayın"
+
+#: inc/vlancolor.class.php:186
+msgid "All VLANs"
+msgstr "Tüm VLAN"

BIN
pics/archires.png


BIN
pics/mini_archires.png


BIN
pics/nothing.png


BIN
pics/socket.png


+ 88 - 0
setup.php

@@ -0,0 +1,88 @@
+<?php
+/*
+ * @version $Id: setup.php 234 2019-12-12 14:34:31Z yllen $
+ -------------------------------------------------------------------------
+ LICENSE
+
+ This file is part of Archires plugin for GLPI.
+
+ Archires is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Archires is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Archires. If not, see <http://www.gnu.org/licenses/>.
+
+ @package   archires
+ @author    Nelly Mahu-Lasson, Xavier Caillaud
+ @copyright Copyright (c) 2016-2019 Archires plugin team
+ @license   AGPL License 3.0 or (at your option) any later version
+            http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ @link      https://forge.glpi-project.org/projects/archires
+ @since     version 2.2
+ --------------------------------------------------------------------------
+ */
+
+// Init the hooks of the plugins -Needed
+function plugin_init_archires() {
+   global $PLUGIN_HOOKS,$CFG_GLPI;
+
+   $PLUGIN_HOOKS['csrf_compliant']['archires'] = true;
+
+   Plugin::registerClass('PluginArchiresProfile', ['addtabon' => ['Profile']]);
+
+   $PLUGIN_HOOKS['pre_item_purge']['archires'] = ['Profile' => ['PluginArchiresProfile',
+                                                                'purgeProfiles']];
+
+   if (Session::getLoginUserID()) {
+      if (Session::haveRight("plugin_archires", READ)) {
+         $PLUGIN_HOOKS["menu_toadd"]['archires'] = ['tools' => 'PluginArchiresMenu'];
+     }
+
+      if (Session::haveRight("plugin_archires", CREATE)) {
+         $PLUGIN_HOOKS['use_massive_action']['archires'] = 1;
+      }
+      // Config page
+      if (Session::haveRight("plugin_archires", UPDATE)
+          || Session::haveRight("config", UPDATE)) {
+         $PLUGIN_HOOKS['config_page']['archires'] = 'front/config.form.php';
+      }
+   }
+}
+
+
+// Get the name and the version of the plugin - Needed
+function plugin_version_archires() {
+
+   return ['name'           => _n('Network Architecture', 'Network Architectures', 2, 'archires'),
+           'version'        => '2.7.0',
+           'author'         => 'Xavier Caillaud, Nelly Mahu-Lasson',
+           'license'        => 'AGPLv3+',
+           'homepage'       => ' https://forge.glpi-project.org/projects/archires',
+           'minGlpiVersion' => '9.4',
+           'requirements'   => ['glpi' => ['min' => '9.4',
+                                           'max' => '9.5']]];
+}
+
+
+// Optional : check prerequisites before install : may print errors or add to message after redirect
+function plugin_archires_check_prerequisites() {
+
+   if (version_compare(GLPI_VERSION,'9.4','lt') || version_compare(GLPI_VERSION,'9.5','ge')) {
+      echo "This plugin requires GLPI >= 9.4";
+      return false;
+   }
+   return true;
+}
+
+
+// Uninstall process for plugin : need to return true if succeeded : may display messages or add to message after redirect
+function plugin_archires_check_config() {
+   return true;
+}

+ 145 - 0
sql/empty-1.5.sql

@@ -0,0 +1,145 @@
+DROP TABLE IF EXISTS `glpi_plugin_archires_query_location`;
+CREATE TABLE `glpi_plugin_archires_query_location` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`FK_entities` int(11) NOT NULL default '0',
+	`name` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	`location` INT( 4 ) NOT NULL DEFAULT '0',
+	`child` smallint(6) NOT NULL default '0',
+	`network` INT( 11 ) NOT NULL DEFAULT '0',
+	`status` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_group` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_config` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_vlan` INT( 11 ) NOT NULL DEFAULT '0',
+	`link` smallint(6) NOT NULL default '1',
+	`notes` LONGTEXT,
+	`deleted` smallint(6) NOT NULL default '0',
+	PRIMARY KEY  (`ID`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_query_switch`;
+CREATE TABLE `glpi_plugin_archires_query_switch` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`FK_entities` int(11) NOT NULL default '0',
+	`name` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	`switch` INT( 11 ) NOT NULL DEFAULT '0',
+	`network` INT( 11 ) NOT NULL DEFAULT '0',
+	`status` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_group` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_config` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_vlan` INT( 11 ) NOT NULL DEFAULT '0',
+	`link` smallint(6) NOT NULL default '1',
+	`notes` LONGTEXT,
+	`deleted` smallint(6) NOT NULL default '0',
+	PRIMARY KEY  (`ID`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_query_applicatifs`;
+CREATE TABLE `glpi_plugin_archires_query_applicatifs` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`FK_entities` int(11) NOT NULL default '0',
+	`name` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	`applicatifs` INT( 11 ) NOT NULL DEFAULT '0',
+	`network` INT( 11 ) NOT NULL DEFAULT '0',
+	`status` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_group` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_config` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_vlan` INT( 11 ) NOT NULL DEFAULT '0',
+	`link` smallint(6) NOT NULL default '1',
+	`notes` LONGTEXT,
+	`deleted` smallint(6) NOT NULL default '0',
+	PRIMARY KEY  (`ID`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_image_device`;
+CREATE TABLE `glpi_plugin_archires_image_device` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`type` INT( 11 ) NOT NULL ,
+	`device_type` INT( 11 ) NOT NULL ,
+	`img` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`ID`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_query_type`;
+CREATE TABLE `glpi_plugin_archires_query_type` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`type_query` INT( 11 ) NOT NULL ,
+	`type` INT( 11 ) NOT NULL ,
+	`device_type` INT( 11 ) NOT NULL,
+	`FK_query` INT( 11 ) NOT NULL,
+	PRIMARY KEY  (`ID`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_color_iface`;
+CREATE TABLE `glpi_plugin_archires_color_iface` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`iface` INT( 11 ) NOT NULL ,
+	`color` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`ID`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_color_state`;
+CREATE TABLE `glpi_plugin_archires_color_state` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`state` INT( 11 ) NOT NULL ,
+	`color` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`ID`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_config`;
+CREATE TABLE `glpi_plugin_archires_config` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`FK_entities` int(11) NOT NULL default '0',
+	`name` VARCHAR( 250 ) collate utf8_unicode_ci NOT NULL,
+	`computer` smallint(6) NOT NULL default '0',
+	`networking` smallint(6) NOT NULL default '0',
+	`printer` smallint(6) NOT NULL default '0',
+	`peripheral` smallint(6) NOT NULL default '0',
+	`phone` smallint(6) NOT NULL default '0',
+	`display_ports` smallint(6) NOT NULL default '0',
+	`display_ip` smallint(6) NOT NULL default '0',
+	`display_type` smallint(6) NOT NULL default '0',
+	`display_state` smallint(6) NOT NULL default '0',
+	`display_location` smallint(6) NOT NULL default '0',
+	`display_entity` smallint(6) NOT NULL default '0',
+	`system` smallint(6) NOT NULL default '0',
+	`engine` smallint(6) NOT NULL default '0',
+	`format` smallint(6) NOT NULL default '0',
+	`deleted` smallint(6) NOT NULL default '0',
+	PRIMARY KEY  (`ID`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+INSERT INTO `glpi_plugin_archires_config` ( `ID`,`FK_entities`,`name`, `computer` , `networking`, `printer`, `peripheral`, `phone`,`display_ports`,`display_ip`,`display_type`,`display_state`,`display_location`,`display_entity`,`system`,`engine`,`format`) VALUES ('1','0','default','1', '1','1','1','1','0','0','0','0','0','0','0','0','1');
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_profiles`;
+CREATE TABLE `glpi_plugin_archires_profiles` (
+	`ID` int(11) NOT NULL auto_increment,
+	`name` varchar(255) collate utf8_unicode_ci default NULL,
+	`interface` varchar(50) collate utf8_unicode_ci NOT NULL default 'archires',
+	`is_default` smallint(6) NOT NULL default '0',
+	`archires` char(1) default NULL,
+	PRIMARY KEY  (`ID`),
+	KEY `interface` (`interface`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','2','1','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','3','2','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','4','3','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','5','4','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','6','5','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','7','6','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','8','7','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','9','8','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','2','1','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','3','2','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','4','3','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','5','4','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','6','5','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','7','6','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','8','7','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','2','1','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','3','2','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','4','3','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','5','4','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','6','5','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','7','6','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','8','7','0');

+ 145 - 0
sql/empty-1.6.sql

@@ -0,0 +1,145 @@
+DROP TABLE IF EXISTS `glpi_plugin_archires_query_location`;
+CREATE TABLE `glpi_plugin_archires_query_location` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`FK_entities` int(11) NOT NULL default '0',
+	`name` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	`location` INT( 4 ) NOT NULL DEFAULT '0',
+	`child` smallint(6) NOT NULL default '0',
+	`network` INT( 11 ) NOT NULL DEFAULT '0',
+	`status` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_group` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_config` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_vlan` INT( 11 ) NOT NULL DEFAULT '0',
+	`link` smallint(6) NOT NULL default '1',
+	`notes` LONGTEXT,
+	`deleted` smallint(6) NOT NULL default '0',
+	PRIMARY KEY  (`ID`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_query_switch`;
+CREATE TABLE `glpi_plugin_archires_query_switch` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`FK_entities` int(11) NOT NULL default '0',
+	`name` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	`switch` INT( 11 ) NOT NULL DEFAULT '0',
+	`network` INT( 11 ) NOT NULL DEFAULT '0',
+	`status` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_group` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_config` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_vlan` INT( 11 ) NOT NULL DEFAULT '0',
+	`link` smallint(6) NOT NULL default '1',
+	`notes` LONGTEXT,
+	`deleted` smallint(6) NOT NULL default '0',
+	PRIMARY KEY  (`ID`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_query_applicatifs`;
+CREATE TABLE `glpi_plugin_archires_query_applicatifs` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`FK_entities` int(11) NOT NULL default '0',
+	`name` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	`applicatifs` INT( 11 ) NOT NULL DEFAULT '0',
+	`network` INT( 11 ) NOT NULL DEFAULT '0',
+	`status` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_group` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_config` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_vlan` INT( 11 ) NOT NULL DEFAULT '0',
+	`link` smallint(6) NOT NULL default '1',
+	`notes` LONGTEXT,
+	`deleted` smallint(6) NOT NULL default '0',
+	PRIMARY KEY  (`ID`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_image_device`;
+CREATE TABLE `glpi_plugin_archires_image_device` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`type` INT( 11 ) NOT NULL ,
+	`device_type` INT( 11 ) NOT NULL ,
+	`img` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`ID`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_query_type`;
+CREATE TABLE `glpi_plugin_archires_query_type` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`type_query` INT( 11 ) NOT NULL ,
+	`type` INT( 11 ) NOT NULL ,
+	`device_type` INT( 11 ) NOT NULL,
+	`FK_query` INT( 11 ) NOT NULL,
+	PRIMARY KEY  (`ID`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_color_iface`;
+CREATE TABLE `glpi_plugin_archires_color_iface` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`iface` INT( 11 ) NOT NULL ,
+	`color` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`ID`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_color_state`;
+CREATE TABLE `glpi_plugin_archires_color_state` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`state` INT( 11 ) NOT NULL ,
+	`color` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`ID`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_config`;
+CREATE TABLE `glpi_plugin_archires_config` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`FK_entities` int(11) NOT NULL default '0',
+	`name` VARCHAR( 250 ) collate utf8_unicode_ci NOT NULL,
+	`computer` smallint(6) NOT NULL default '0',
+	`networking` smallint(6) NOT NULL default '0',
+	`printer` smallint(6) NOT NULL default '0',
+	`peripheral` smallint(6) NOT NULL default '0',
+	`phone` smallint(6) NOT NULL default '0',
+	`display_ports` smallint(6) NOT NULL default '0',
+	`display_ip` smallint(6) NOT NULL default '0',
+	`display_type` smallint(6) NOT NULL default '0',
+	`display_state` smallint(6) NOT NULL default '0',
+	`display_location` smallint(6) NOT NULL default '0',
+	`display_entity` smallint(6) NOT NULL default '0',
+	`system` smallint(6) NOT NULL default '0',
+	`engine` smallint(6) NOT NULL default '0',
+	`format` smallint(6) NOT NULL default '0',
+	`deleted` smallint(6) NOT NULL default '0',
+	PRIMARY KEY  (`ID`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+INSERT INTO `glpi_plugin_archires_config` ( `ID`,`FK_entities`,`name`, `computer` , `networking`, `printer`, `peripheral`, `phone`,`display_ports`,`display_ip`,`display_type`,`display_state`,`display_location`,`display_entity`,`system`,`engine`,`format`) VALUES ('1','0','default','1', '1','1','1','1','0','0','0','0','0','0','0','0','1');
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_profiles`;
+CREATE TABLE `glpi_plugin_archires_profiles` (
+	`ID` int(11) NOT NULL auto_increment,
+	`name` varchar(255) collate utf8_unicode_ci default NULL,
+	`interface` varchar(50) collate utf8_unicode_ci NOT NULL default 'archires',
+	`is_default` smallint(6) NOT NULL default '0',
+	`archires` char(1) default NULL,
+	PRIMARY KEY  (`ID`),
+	KEY `interface` (`interface`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','2','1','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','3','2','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','4','3','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','5','4','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','6','5','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','7','6','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','8','7','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','9','8','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','2','1','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','3','2','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','4','3','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','5','4','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','6','5','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','7','6','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','8','7','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','2','1','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','3','2','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','4','3','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','5','4','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','6','5','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','7','6','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','8','7','0');

+ 165 - 0
sql/empty-1.7.0.sql

@@ -0,0 +1,165 @@
+DROP TABLE IF EXISTS `glpi_plugin_archires_query_location`;
+CREATE TABLE `glpi_plugin_archires_query_location` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`FK_entities` int(11) NOT NULL default '0',
+	`name` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	`location` INT( 4 ) NOT NULL DEFAULT '0',
+	`child` smallint(6) NOT NULL default '0',
+	`network` INT( 11 ) NOT NULL DEFAULT '0',
+	`state` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_group` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_config` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_vlan` INT( 11 ) NOT NULL DEFAULT '0',
+	`link` smallint(6) NOT NULL default '1',
+	`notes` LONGTEXT,
+	`deleted` smallint(6) NOT NULL default '0',
+	PRIMARY KEY  (`ID`),
+	KEY `deleted` (`deleted`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_query_switch`;
+CREATE TABLE `glpi_plugin_archires_query_switch` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`FK_entities` int(11) NOT NULL default '0',
+	`name` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	`switch` INT( 11 ) NOT NULL DEFAULT '0',
+	`network` INT( 11 ) NOT NULL DEFAULT '0',
+	`state` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_group` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_config` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_vlan` INT( 11 ) NOT NULL DEFAULT '0',
+	`link` smallint(6) NOT NULL default '1',
+	`notes` LONGTEXT,
+	`deleted` smallint(6) NOT NULL default '0',
+	PRIMARY KEY  (`ID`),
+	KEY `deleted` (`deleted`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_query_applicatifs`;
+CREATE TABLE `glpi_plugin_archires_query_applicatifs` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`FK_entities` int(11) NOT NULL default '0',
+	`name` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	`applicatifs` INT( 11 ) NOT NULL DEFAULT '0',
+	`network` INT( 11 ) NOT NULL DEFAULT '0',
+	`state` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_group` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_config` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_vlan` INT( 11 ) NOT NULL DEFAULT '0',
+	`link` smallint(6) NOT NULL default '1',
+	`notes` LONGTEXT,
+	`deleted` smallint(6) NOT NULL default '0',
+	PRIMARY KEY  (`ID`),
+	KEY `deleted` (`deleted`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_image_device`;
+CREATE TABLE `glpi_plugin_archires_image_device` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`type` INT( 11 ) NOT NULL ,
+	`device_type` INT( 11 ) NOT NULL ,
+	`img` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`ID`),
+	KEY `device_type` (`device_type`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_query_type`;
+CREATE TABLE `glpi_plugin_archires_query_type` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`type_query` INT( 11 ) NOT NULL ,
+	`type` INT( 11 ) NOT NULL ,
+	`device_type` INT( 11 ) NOT NULL,
+	`FK_query` INT( 11 ) NOT NULL,
+	PRIMARY KEY  (`ID`),
+	KEY `FK_query` (`FK_query`),
+	KEY `type` (`type`),
+	KEY `type_query` (`type_query`),
+	KEY `device_type` (`device_type`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_color_iface`;
+CREATE TABLE `glpi_plugin_archires_color_iface` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`iface` INT( 11 ) NOT NULL ,
+	`color` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`ID`),
+	KEY `iface` (`iface`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_color_state`;
+CREATE TABLE `glpi_plugin_archires_color_state` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`state` INT( 11 ) NOT NULL ,
+	`color` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`ID`),
+	KEY `state` (`state`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_color_vlan`;
+CREATE TABLE `glpi_plugin_archires_color_vlan` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`vlan` INT( 11 ) NOT NULL ,
+	`color` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`ID`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_config`;
+CREATE TABLE `glpi_plugin_archires_config` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`FK_entities` int(11) NOT NULL default '0',
+	`name` VARCHAR( 250 ) collate utf8_unicode_ci NOT NULL,
+	`computer` smallint(6) NOT NULL default '0',
+	`networking` smallint(6) NOT NULL default '0',
+	`printer` smallint(6) NOT NULL default '0',
+	`peripheral` smallint(6) NOT NULL default '0',
+	`phone` smallint(6) NOT NULL default '0',
+	`display_ports` smallint(6) NOT NULL default '0',
+	`display_ip` smallint(6) NOT NULL default '0',
+	`display_type` smallint(6) NOT NULL default '0',
+	`display_state` smallint(6) NOT NULL default '0',
+	`display_location` smallint(6) NOT NULL default '0',
+	`display_entity` smallint(6) NOT NULL default '0',
+	`system` smallint(6) NOT NULL default '0',
+	`engine` smallint(6) NOT NULL default '0',
+	`format` smallint(6) NOT NULL default '0',
+	`color` smallint(6) NOT NULL default '0',
+	`deleted` smallint(6) NOT NULL default '0',
+	PRIMARY KEY  (`ID`),
+	KEY `deleted` (`deleted`),
+	KEY `FK_entities` (`FK_entities`),
+	KEY `name` (`name`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+INSERT INTO `glpi_plugin_archires_config` ( `ID`,`FK_entities`,`name`, `computer` , `networking`, `printer`, `peripheral`, `phone`,`display_ports`,`display_ip`,`display_type`,`display_state`,`display_location`,`display_entity`,`system`,`engine`,`format`) VALUES ('1','0','default','1', '1','1','1','1','0','0','0','0','0','0','0','0','1');
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_profiles`;
+CREATE TABLE `glpi_plugin_archires_profiles` (
+	`ID` int(11) NOT NULL auto_increment,
+	`name` varchar(255) collate utf8_unicode_ci default NULL,
+	`archires` char(1) default NULL,
+	PRIMARY KEY  (`ID`),
+	KEY `name` (`name`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','2','1','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','3','2','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','4','3','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','5','4','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','6','5','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','7','6','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','8','7','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','9','8','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','2','1','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','3','2','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','4','3','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','5','4','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','6','5','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','7','6','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','8','7','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','2','1','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','3','2','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','4','3','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','5','4','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','6','5','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','7','6','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','8','7','0');

+ 164 - 0
sql/empty-1.7.2.sql

@@ -0,0 +1,164 @@
+DROP TABLE IF EXISTS `glpi_plugin_archires_query_location`;
+CREATE TABLE `glpi_plugin_archires_query_location` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`FK_entities` int(11) NOT NULL default '0',
+	`name` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	`location` INT( 4 ) NOT NULL DEFAULT '0',
+	`child` smallint(6) NOT NULL default '0',
+	`network` INT( 11 ) NOT NULL DEFAULT '0',
+	`state` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_group` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_config` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_vlan` INT( 11 ) NOT NULL DEFAULT '0',
+	`link` smallint(6) NOT NULL default '1',
+	`notes` LONGTEXT,
+	`deleted` smallint(6) NOT NULL default '0',
+	PRIMARY KEY  (`ID`),
+	KEY `deleted` (`deleted`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_query_switch`;
+CREATE TABLE `glpi_plugin_archires_query_switch` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`FK_entities` int(11) NOT NULL default '0',
+	`name` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	`switch` INT( 11 ) NOT NULL DEFAULT '0',
+	`network` INT( 11 ) NOT NULL DEFAULT '0',
+	`state` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_group` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_config` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_vlan` INT( 11 ) NOT NULL DEFAULT '0',
+	`link` smallint(6) NOT NULL default '1',
+	`notes` LONGTEXT,
+	`deleted` smallint(6) NOT NULL default '0',
+	PRIMARY KEY  (`ID`),
+	KEY `deleted` (`deleted`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_query_applicatifs`;
+CREATE TABLE `glpi_plugin_archires_query_applicatifs` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`FK_entities` int(11) NOT NULL default '0',
+	`name` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	`applicatifs` INT( 11 ) NOT NULL DEFAULT '0',
+	`network` INT( 11 ) NOT NULL DEFAULT '0',
+	`state` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_group` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_config` INT( 11 ) NOT NULL DEFAULT '0',
+	`FK_vlan` INT( 11 ) NOT NULL DEFAULT '0',
+	`link` smallint(6) NOT NULL default '1',
+	`notes` LONGTEXT,
+	`deleted` smallint(6) NOT NULL default '0',
+	PRIMARY KEY  (`ID`),
+	KEY `deleted` (`deleted`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_image_device`;
+CREATE TABLE `glpi_plugin_archires_image_device` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`type` INT( 11 ) NOT NULL ,
+	`device_type` INT( 11 ) NOT NULL ,
+	`img` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`ID`),
+	KEY `device_type` (`device_type`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_query_type`;
+CREATE TABLE `glpi_plugin_archires_query_type` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`type_query` INT( 11 ) NOT NULL ,
+	`type` INT( 11 ) NOT NULL ,
+	`device_type` INT( 11 ) NOT NULL,
+	`FK_query` INT( 11 ) NOT NULL,
+	PRIMARY KEY  (`ID`),
+	KEY `FK_query` (`FK_query`),
+	KEY `type` (`type`),
+	KEY `type_query` (`type_query`),
+	KEY `device_type` (`device_type`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_color_iface`;
+CREATE TABLE `glpi_plugin_archires_color_iface` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`iface` INT( 11 ) NOT NULL ,
+	`color` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`ID`),
+	KEY `iface` (`iface`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_color_state`;
+CREATE TABLE `glpi_plugin_archires_color_state` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`state` INT( 11 ) NOT NULL ,
+	`color` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`ID`),
+	KEY `state` (`state`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_color_vlan`;
+CREATE TABLE `glpi_plugin_archires_color_vlan` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`vlan` INT( 11 ) NOT NULL ,
+	`color` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`ID`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_config`;
+CREATE TABLE `glpi_plugin_archires_config` (
+	`ID` INT( 11 ) NOT NULL auto_increment,
+	`FK_entities` int(11) NOT NULL default '0',
+	`name` VARCHAR( 250 ) collate utf8_unicode_ci NOT NULL,
+	`computer` smallint(6) NOT NULL default '0',
+	`networking` smallint(6) NOT NULL default '0',
+	`printer` smallint(6) NOT NULL default '0',
+	`peripheral` smallint(6) NOT NULL default '0',
+	`phone` smallint(6) NOT NULL default '0',
+	`display_ports` smallint(6) NOT NULL default '0',
+	`display_ip` smallint(6) NOT NULL default '0',
+	`display_type` smallint(6) NOT NULL default '0',
+	`display_state` smallint(6) NOT NULL default '0',
+	`display_location` smallint(6) NOT NULL default '0',
+	`display_entity` smallint(6) NOT NULL default '0',
+	`engine` smallint(6) NOT NULL default '0',
+	`format` smallint(6) NOT NULL default '0',
+	`color` smallint(6) NOT NULL default '0',
+	`deleted` smallint(6) NOT NULL default '0',
+	PRIMARY KEY  (`ID`),
+	KEY `deleted` (`deleted`),
+	KEY `FK_entities` (`FK_entities`),
+	KEY `name` (`name`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+INSERT INTO `glpi_plugin_archires_config` ( `ID`,`FK_entities`,`name`, `computer` , `networking`, `printer`, `peripheral`, `phone`,`display_ports`,`display_ip`,`display_type`,`display_state`,`display_location`,`display_entity`,`system`,`engine`,`format`) VALUES ('1','0','default','1', '1','1','1','1','0','0','0','0','0','0','0','0','1');
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_profiles`;
+CREATE TABLE `glpi_plugin_archires_profiles` (
+	`ID` int(11) NOT NULL auto_increment,
+	`name` varchar(255) collate utf8_unicode_ci default NULL,
+	`archires` char(1) default NULL,
+	PRIMARY KEY  (`ID`),
+	KEY `name` (`name`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','2','1','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','3','2','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','4','3','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','5','4','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','6','5','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','7','6','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','8','7','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3000','9','8','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','2','1','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','3','2','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','4','3','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','5','4','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','6','5','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','7','6','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3001','8','7','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','2','1','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','3','2','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','4','3','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','5','4','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','6','5','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','7','6','0');
+INSERT INTO `glpi_display` ( `ID` , `type` , `num` , `rank` , `FK_users` )  VALUES (NULL,'3002','8','7','0');

+ 182 - 0
sql/empty-1.8.0.sql

@@ -0,0 +1,182 @@
+DROP TABLE IF EXISTS `glpi_plugin_archires_locationqueries`;
+CREATE TABLE `glpi_plugin_archires_locationqueries` (
+	`id` int(11) NOT NULL auto_increment,
+	`entities_id` int(11) NOT NULL default '0',
+	`name` varchar(255) collate utf8_unicode_ci default NULL,
+	`locations_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_locations (id)',
+	`child` smallint(6) NOT NULL default '0',
+	`networks_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_networks (id)',
+	`states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)',
+	`groups_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_groups (id)',
+	`plugin_archires_views_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_plugin_archires_views (id)',
+	`vlans_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_vlans (id)',
+	`notepad` longtext collate utf8_unicode_ci,
+	`is_deleted` tinyint(1) NOT NULL default '0',
+	PRIMARY KEY  (`id`),
+	KEY `name` (`name`),
+	KEY `entities_id` (`entities_id`),
+	KEY `locations_id` (`locations_id`),
+	KEY `networks_id` (`networks_id`),
+	KEY `groups_id` (`groups_id`),
+	KEY `plugin_archires_views_id` (`plugin_archires_views_id`),
+	KEY `states_id` (`states_id`),
+	KEY `vlans_id` (`vlans_id`),
+	KEY `is_deleted` (`is_deleted`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_networkequipmentqueries`;
+CREATE TABLE `glpi_plugin_archires_networkequipmentqueries` (
+	`id` int(11) NOT NULL auto_increment,
+	`entities_id` int(11) NOT NULL default '0',
+	`name` varchar(255) collate utf8_unicode_ci default NULL,
+	`networkequipments_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_networkequipments (id)',
+	`networks_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_networks (id)',
+	`states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)',
+	`groups_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_groups (id)',
+	`plugin_archires_views_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_plugin_archires_views (id)',
+	`vlans_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_vlans (id)',
+	`notepad` longtext collate utf8_unicode_ci,
+	`is_deleted` tinyint(1) NOT NULL default '0',
+	PRIMARY KEY  (`id`),
+	KEY `name` (`name`),
+	KEY `entities_id` (`entities_id`),
+	KEY `networkequipments_id` (`networkequipments_id`),
+	KEY `networks_id` (`networks_id`),
+	KEY `groups_id` (`groups_id`),
+	KEY `plugin_archires_views_id` (`plugin_archires_views_id`),
+	KEY `states_id` (`states_id`),
+	KEY `vlans_id` (`vlans_id`),
+	KEY `is_deleted` (`is_deleted`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_appliancequeries`;
+CREATE TABLE `glpi_plugin_archires_appliancequeries` (
+	`id` int(11) NOT NULL auto_increment,
+	`entities_id` int(11) NOT NULL default '0',
+	`name` varchar(255) collate utf8_unicode_ci default NULL,
+	`appliances_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_plugin_appliances (id)',
+	`networks_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_networks (id)',
+	`states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)',
+	`groups_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_groups (id)',
+	`plugin_archires_views_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_plugin_archires_views (id)',
+	`vlans_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_vlans (id)',
+	`notepad` longtext collate utf8_unicode_ci,
+	`is_deleted` tinyint(1) NOT NULL default '0',
+	PRIMARY KEY  (`id`),
+	KEY `name` (`name`),
+	KEY `entities_id` (`entities_id`),
+	KEY `appliances_id` (`appliances_id`),
+	KEY `networks_id` (`networks_id`),
+	KEY `groups_id` (`groups_id`),
+	KEY `plugin_archires_views_id` (`plugin_archires_views_id`),
+	KEY `states_id` (`states_id`),
+	KEY `vlans_id` (`vlans_id`),
+	KEY `is_deleted` (`is_deleted`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_imageitems`;
+CREATE TABLE `glpi_plugin_archires_imageitems` (
+	`id` int(11) NOT NULL auto_increment,
+	`type` int(11) NOT NULL default '0',
+	`itemtype` varchar(100) collate utf8_unicode_ci NOT NULL COMMENT 'see .class.php file',
+	`img` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_querytypes`;
+CREATE TABLE `glpi_plugin_archires_querytypes` (
+	`id` int(11) NOT NULL auto_increment,
+	`querytype` varchar(100) collate utf8_unicode_ci NOT NULL COMMENT 'RELATION to the 3 type of archires (type)',
+	`type` int(11) NOT NULL default '0',
+	`itemtype` varchar(100) collate utf8_unicode_ci NOT NULL COMMENT 'see .class.php file',
+	`plugin_archires_queries_id` int(11) NOT NULL default '0' COMMENT 'RELATION to the 3 queries tables (id)',
+	PRIMARY KEY  (`id`),
+	KEY `plugin_archires_queries_id` (`plugin_archires_queries_id`),
+	KEY `type` (`type`),
+	KEY `querytype` (`querytype`),
+	KEY `itemtype` (`itemtype`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_networkinterfacecolors`;
+CREATE TABLE `glpi_plugin_archires_networkinterfacecolors` (
+	`id` int(11) NOT NULL auto_increment,
+	`networkinterfaces_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_networkinterfaces (id)',
+	`color` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`id`),
+	KEY `networkinterfaces_id` (`networkinterfaces_id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_statecolors`;
+CREATE TABLE `glpi_plugin_archires_statecolors` (
+	`id` int(11) NOT NULL auto_increment,
+	`states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)',
+	`color` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`id`),
+	KEY `states_id` (`states_id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_vlancolors`;
+CREATE TABLE `glpi_plugin_archires_vlancolors` (
+	`id` int(11) NOT NULL auto_increment,
+	`vlans_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_vlans (id)',
+	`color` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`id`),
+	KEY `vlans_id` (`vlans_id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_views`;
+CREATE TABLE `glpi_plugin_archires_views` (
+	`id` int(11) NOT NULL auto_increment,
+	`entities_id` int(11) NOT NULL default '0',
+	`name` varchar(255) collate utf8_unicode_ci default NULL,
+	`computer` smallint(6) NOT NULL default '0',
+	`networking` smallint(6) NOT NULL default '0',
+	`printer` smallint(6) NOT NULL default '0',
+	`peripheral` smallint(6) NOT NULL default '0',
+	`phone` smallint(6) NOT NULL default '0',
+	`display_ports` smallint(6) NOT NULL default '0',
+	`display_ip` smallint(6) NOT NULL default '0',
+	`display_type` smallint(6) NOT NULL default '0',
+	`display_state` smallint(6) NOT NULL default '0',
+	`display_location` smallint(6) NOT NULL default '0',
+	`display_entity` smallint(6) NOT NULL default '0',
+	`engine` smallint(6) NOT NULL default '0',
+	`format` smallint(6) NOT NULL default '0',
+	`color` smallint(6) NOT NULL default '0',
+	`is_deleted` tinyint(1) NOT NULL default '0',
+	PRIMARY KEY  (`ID`),
+	KEY `name` (`name`),
+	KEY `entities_id` (`entities_id`),
+	KEY `is_deleted` (`is_deleted`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+INSERT INTO `glpi_plugin_archires_views` ( `id`,`entities_id`,`name`, `computer` , `networking`, `printer`, `peripheral`, `phone`,`display_ports`,`display_ip`,`display_type`,`display_state`,`display_location`,`display_entity`,`engine`,`format`) VALUES ('1','0','default','1', '1','1','1','1','0','0','0','0','0','0','0','1');
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_profiles`;
+CREATE TABLE `glpi_plugin_archires_profiles` (
+	`id` int(11) NOT NULL auto_increment,
+	`profiles_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_profiles (id)',
+	`archires` char(1) collate utf8_unicode_ci default NULL,
+	PRIMARY KEY  (`id`),
+	KEY `profiles_id` (`profiles_id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresLocationQuery','2','1','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresLocationQuery','3','2','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresLocationQuery','4','3','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresLocationQuery','5','4','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresLocationQuery','6','5','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresLocationQuery','7','6','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresLocationQuery','8','7','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresNetworkEquipmentQuery','2','1','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresNetworkEquipmentQuery','3','2','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresNetworkEquipmentQuery','4','3','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresNetworkEquipmentQuery','5','4','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresNetworkEquipmentQuery','6','5','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresNetworkEquipmentQuery','7','6','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresApplianceQuery','2','1','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresApplianceQuery','3','2','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresApplianceQuery','4','3','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresApplianceQuery','5','4','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresApplianceQuery','6','5','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresApplianceQuery','7','6','0');

+ 182 - 0
sql/empty-2.1.0.sql

@@ -0,0 +1,182 @@
+DROP TABLE IF EXISTS `glpi_plugin_archires_locationqueries`;
+CREATE TABLE `glpi_plugin_archires_locationqueries` (
+	`id` int(11) NOT NULL auto_increment,
+	`entities_id` int(11) NOT NULL default '0',
+	`name` varchar(255) collate utf8_unicode_ci default NULL,
+	`locations_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_locations (id)',
+	`child` smallint(6) NOT NULL default '0',
+	`networks_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_networks (id)',
+	`states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)',
+	`groups_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_groups (id)',
+	`plugin_archires_views_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_plugin_archires_views (id)',
+	`vlans_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_vlans (id)',
+	`notepad` longtext collate utf8_unicode_ci,
+	`is_deleted` tinyint(1) NOT NULL default '0',
+	PRIMARY KEY  (`id`),
+	KEY `name` (`name`),
+	KEY `entities_id` (`entities_id`),
+	KEY `locations_id` (`locations_id`),
+	KEY `networks_id` (`networks_id`),
+	KEY `groups_id` (`groups_id`),
+	KEY `plugin_archires_views_id` (`plugin_archires_views_id`),
+	KEY `states_id` (`states_id`),
+	KEY `vlans_id` (`vlans_id`),
+	KEY `is_deleted` (`is_deleted`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_networkequipmentqueries`;
+CREATE TABLE `glpi_plugin_archires_networkequipmentqueries` (
+	`id` int(11) NOT NULL auto_increment,
+	`entities_id` int(11) NOT NULL default '0',
+	`name` varchar(255) collate utf8_unicode_ci default NULL,
+	`networkequipments_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_networkequipments (id)',
+	`networks_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_networks (id)',
+	`states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)',
+	`groups_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_groups (id)',
+	`plugin_archires_views_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_plugin_archires_views (id)',
+	`vlans_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_vlans (id)',
+	`notepad` longtext collate utf8_unicode_ci,
+	`is_deleted` tinyint(1) NOT NULL default '0',
+	PRIMARY KEY  (`id`),
+	KEY `name` (`name`),
+	KEY `entities_id` (`entities_id`),
+	KEY `networkequipments_id` (`networkequipments_id`),
+	KEY `networks_id` (`networks_id`),
+	KEY `groups_id` (`groups_id`),
+	KEY `plugin_archires_views_id` (`plugin_archires_views_id`),
+	KEY `states_id` (`states_id`),
+	KEY `vlans_id` (`vlans_id`),
+	KEY `is_deleted` (`is_deleted`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_appliancequeries`;
+CREATE TABLE `glpi_plugin_archires_appliancequeries` (
+	`id` int(11) NOT NULL auto_increment,
+	`entities_id` int(11) NOT NULL default '0',
+	`name` varchar(255) collate utf8_unicode_ci default NULL,
+	`plugin_appliances_appliances_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_plugin_appliances (id)',
+	`networks_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_networks (id)',
+	`states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)',
+	`groups_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_groups (id)',
+	`plugin_archires_views_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_plugin_archires_views (id)',
+	`vlans_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_vlans (id)',
+	`notepad` longtext collate utf8_unicode_ci,
+	`is_deleted` tinyint(1) NOT NULL default '0',
+	PRIMARY KEY  (`id`),
+	KEY `name` (`name`),
+	KEY `entities_id` (`entities_id`),
+	KEY `appliances_id` (`plugin_appliances_appliances_id`),
+	KEY `networks_id` (`networks_id`),
+	KEY `groups_id` (`groups_id`),
+	KEY `plugin_archires_views_id` (`plugin_archires_views_id`),
+	KEY `states_id` (`states_id`),
+	KEY `vlans_id` (`vlans_id`),
+	KEY `is_deleted` (`is_deleted`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_imageitems`;
+CREATE TABLE `glpi_plugin_archires_imageitems` (
+	`id` int(11) NOT NULL auto_increment,
+	`type` int(11) NOT NULL default '0',
+	`itemtype` varchar(100) collate utf8_unicode_ci NOT NULL COMMENT 'see .class.php file',
+	`img` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_querytypes`;
+CREATE TABLE `glpi_plugin_archires_querytypes` (
+	`id` int(11) NOT NULL auto_increment,
+	`querytype` varchar(100) collate utf8_unicode_ci NOT NULL COMMENT 'RELATION to the 3 type of archires (type)',
+	`type` int(11) NOT NULL default '0',
+	`itemtype` varchar(100) collate utf8_unicode_ci NOT NULL COMMENT 'see .class.php file',
+	`plugin_archires_queries_id` int(11) NOT NULL default '0' COMMENT 'RELATION to the 3 queries tables (id)',
+	PRIMARY KEY  (`id`),
+	KEY `plugin_archires_queries_id` (`plugin_archires_queries_id`),
+	KEY `type` (`type`),
+	KEY `querytype` (`querytype`),
+	KEY `itemtype` (`itemtype`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_networkinterfacecolors`;
+CREATE TABLE `glpi_plugin_archires_networkinterfacecolors` (
+	`id` int(11) NOT NULL auto_increment,
+	`networkinterfaces_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_networkinterfaces (id)',
+	`color` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`id`),
+	KEY `networkinterfaces_id` (`networkinterfaces_id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_statecolors`;
+CREATE TABLE `glpi_plugin_archires_statecolors` (
+	`id` int(11) NOT NULL auto_increment,
+	`states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)',
+	`color` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`id`),
+	KEY `states_id` (`states_id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_vlancolors`;
+CREATE TABLE `glpi_plugin_archires_vlancolors` (
+	`id` int(11) NOT NULL auto_increment,
+	`vlans_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_vlans (id)',
+	`color` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`id`),
+	KEY `vlans_id` (`vlans_id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_views`;
+CREATE TABLE `glpi_plugin_archires_views` (
+	`id` int(11) NOT NULL auto_increment,
+	`entities_id` int(11) NOT NULL default '0',
+	`name` varchar(255) collate utf8_unicode_ci default NULL,
+	`computer` smallint(6) NOT NULL default '0',
+	`networking` smallint(6) NOT NULL default '0',
+	`printer` smallint(6) NOT NULL default '0',
+	`peripheral` smallint(6) NOT NULL default '0',
+	`phone` smallint(6) NOT NULL default '0',
+	`display_ports` smallint(6) NOT NULL default '0',
+	`display_ip` smallint(6) NOT NULL default '0',
+	`display_type` smallint(6) NOT NULL default '0',
+	`display_state` smallint(6) NOT NULL default '0',
+	`display_location` smallint(6) NOT NULL default '0',
+	`display_entity` smallint(6) NOT NULL default '0',
+	`engine` smallint(6) NOT NULL default '0',
+	`format` smallint(6) NOT NULL default '0',
+	`color` smallint(6) NOT NULL default '0',
+	`is_deleted` tinyint(1) NOT NULL default '0',
+	PRIMARY KEY  (`ID`),
+	KEY `name` (`name`),
+	KEY `entities_id` (`entities_id`),
+	KEY `is_deleted` (`is_deleted`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+INSERT INTO `glpi_plugin_archires_views` ( `id`,`entities_id`,`name`, `computer` , `networking`, `printer`, `peripheral`, `phone`,`display_ports`,`display_ip`,`display_type`,`display_state`,`display_location`,`display_entity`,`engine`,`format`) VALUES ('1','0','default','1', '1','1','1','1','0','0','0','0','0','0','0','1');
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_profiles`;
+CREATE TABLE `glpi_plugin_archires_profiles` (
+	`id` int(11) NOT NULL auto_increment,
+	`profiles_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_profiles (id)',
+	`archires` char(1) collate utf8_unicode_ci default NULL,
+	PRIMARY KEY  (`id`),
+	KEY `profiles_id` (`profiles_id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresLocationQuery','2','1','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresLocationQuery','3','2','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresLocationQuery','4','3','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresLocationQuery','5','4','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresLocationQuery','6','5','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresLocationQuery','7','6','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresLocationQuery','8','7','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresNetworkEquipmentQuery','2','1','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresNetworkEquipmentQuery','3','2','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresNetworkEquipmentQuery','4','3','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresNetworkEquipmentQuery','5','4','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresNetworkEquipmentQuery','6','5','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresNetworkEquipmentQuery','7','6','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresApplianceQuery','2','1','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresApplianceQuery','3','2','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresApplianceQuery','4','3','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresApplianceQuery','5','4','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresApplianceQuery','6','5','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresApplianceQuery','7','6','0');

+ 173 - 0
sql/empty-2.2.sql

@@ -0,0 +1,173 @@
+DROP TABLE IF EXISTS `glpi_plugin_archires_locationqueries`;
+CREATE TABLE `glpi_plugin_archires_locationqueries` (
+	`id` int(11) NOT NULL auto_increment,
+	`entities_id` int(11) NOT NULL default '0',
+	`name` varchar(255) collate utf8_unicode_ci default NULL,
+	`locations_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_locations (id)',
+	`child` smallint(6) NOT NULL default '0',
+	`networks_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_networks (id)',
+	`states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)',
+	`groups_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_groups (id)',
+	`plugin_archires_views_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_plugin_archires_views (id)',
+	`vlans_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_vlans (id)',
+	`notepad` longtext collate utf8_unicode_ci,
+	`is_deleted` tinyint(1) NOT NULL default '0',
+	PRIMARY KEY  (`id`),
+	KEY `name` (`name`),
+	KEY `entities_id` (`entities_id`),
+	KEY `locations_id` (`locations_id`),
+	KEY `networks_id` (`networks_id`),
+	KEY `groups_id` (`groups_id`),
+	KEY `plugin_archires_views_id` (`plugin_archires_views_id`),
+	KEY `states_id` (`states_id`),
+	KEY `vlans_id` (`vlans_id`),
+	KEY `is_deleted` (`is_deleted`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_networkequipmentqueries`;
+CREATE TABLE `glpi_plugin_archires_networkequipmentqueries` (
+	`id` int(11) NOT NULL auto_increment,
+	`entities_id` int(11) NOT NULL default '0',
+	`name` varchar(255) collate utf8_unicode_ci default NULL,
+	`networkequipments_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_networkequipments (id)',
+	`networks_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_networks (id)',
+	`states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)',
+	`groups_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_groups (id)',
+	`plugin_archires_views_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_plugin_archires_views (id)',
+	`vlans_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_vlans (id)',
+	`notepad` longtext collate utf8_unicode_ci,
+	`is_deleted` tinyint(1) NOT NULL default '0',
+	PRIMARY KEY  (`id`),
+	KEY `name` (`name`),
+	KEY `entities_id` (`entities_id`),
+	KEY `networkequipments_id` (`networkequipments_id`),
+	KEY `networks_id` (`networks_id`),
+	KEY `groups_id` (`groups_id`),
+	KEY `plugin_archires_views_id` (`plugin_archires_views_id`),
+	KEY `states_id` (`states_id`),
+	KEY `vlans_id` (`vlans_id`),
+	KEY `is_deleted` (`is_deleted`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_appliancequeries`;
+CREATE TABLE `glpi_plugin_archires_appliancequeries` (
+	`id` int(11) NOT NULL auto_increment,
+	`entities_id` int(11) NOT NULL default '0',
+	`name` varchar(255) collate utf8_unicode_ci default NULL,
+	`plugin_appliances_appliances_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_plugin_appliances (id)',
+	`networks_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_networks (id)',
+	`states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)',
+	`groups_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_groups (id)',
+	`plugin_archires_views_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_plugin_archires_views (id)',
+	`vlans_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_vlans (id)',
+	`notepad` longtext collate utf8_unicode_ci,
+	`is_deleted` tinyint(1) NOT NULL default '0',
+	PRIMARY KEY  (`id`),
+	KEY `name` (`name`),
+	KEY `entities_id` (`entities_id`),
+	KEY `appliances_id` (`plugin_appliances_appliances_id`),
+	KEY `networks_id` (`networks_id`),
+	KEY `groups_id` (`groups_id`),
+	KEY `plugin_archires_views_id` (`plugin_archires_views_id`),
+	KEY `states_id` (`states_id`),
+	KEY `vlans_id` (`vlans_id`),
+	KEY `is_deleted` (`is_deleted`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_imageitems`;
+CREATE TABLE `glpi_plugin_archires_imageitems` (
+	`id` int(11) NOT NULL auto_increment,
+	`type` int(11) NOT NULL default '0',
+	`itemtype` varchar(100) collate utf8_unicode_ci NOT NULL COMMENT 'see .class.php file',
+	`img` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_querytypes`;
+CREATE TABLE `glpi_plugin_archires_querytypes` (
+	`id` int(11) NOT NULL auto_increment,
+	`querytype` varchar(100) collate utf8_unicode_ci NOT NULL COMMENT 'RELATION to the 3 type of archires (type)',
+	`type` int(11) NOT NULL default '0',
+	`itemtype` varchar(100) collate utf8_unicode_ci NOT NULL COMMENT 'see .class.php file',
+	`plugin_archires_queries_id` int(11) NOT NULL default '0' COMMENT 'RELATION to the 3 queries tables (id)',
+	PRIMARY KEY  (`id`),
+	KEY `plugin_archires_queries_id` (`plugin_archires_queries_id`),
+	KEY `type` (`type`),
+	KEY `querytype` (`querytype`),
+	KEY `itemtype` (`itemtype`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_networkinterfacecolors`;
+CREATE TABLE `glpi_plugin_archires_networkinterfacecolors` (
+	`id` int(11) NOT NULL auto_increment,
+	`networkinterfaces_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_networkinterfaces (id)',
+	`color` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`id`),
+	KEY `networkinterfaces_id` (`networkinterfaces_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_statecolors`;
+CREATE TABLE `glpi_plugin_archires_statecolors` (
+	`id` int(11) NOT NULL auto_increment,
+	`states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)',
+	`color` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`id`),
+	KEY `states_id` (`states_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_vlancolors`;
+CREATE TABLE `glpi_plugin_archires_vlancolors` (
+	`id` int(11) NOT NULL auto_increment,
+	`vlans_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_vlans (id)',
+	`color` VARCHAR( 50 ) collate utf8_unicode_ci NOT NULL,
+	PRIMARY KEY  (`id`),
+	KEY `vlans_id` (`vlans_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DROP TABLE IF EXISTS `glpi_plugin_archires_views`;
+CREATE TABLE `glpi_plugin_archires_views` (
+	`id` int(11) NOT NULL auto_increment,
+	`entities_id` int(11) NOT NULL default '0',
+	`name` varchar(255) collate utf8_unicode_ci default NULL,
+	`computer` smallint(6) NOT NULL default '0',
+	`networking` smallint(6) NOT NULL default '0',
+	`printer` smallint(6) NOT NULL default '0',
+	`peripheral` smallint(6) NOT NULL default '0',
+	`phone` smallint(6) NOT NULL default '0',
+	`display_ports` smallint(6) NOT NULL default '0',
+	`display_ip` smallint(6) NOT NULL default '0',
+	`display_type` smallint(6) NOT NULL default '0',
+	`display_state` smallint(6) NOT NULL default '0',
+	`display_location` smallint(6) NOT NULL default '0',
+	`display_entity` smallint(6) NOT NULL default '0',
+	`engine` smallint(6) NOT NULL default '0',
+	`format` smallint(6) NOT NULL default '0',
+	`color` smallint(6) NOT NULL default '0',
+	`is_deleted` tinyint(1) NOT NULL default '0',
+	PRIMARY KEY  (`ID`),
+	KEY `name` (`name`),
+	KEY `entities_id` (`entities_id`),
+	KEY `is_deleted` (`is_deleted`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+INSERT INTO `glpi_plugin_archires_views` ( `id`,`entities_id`,`name`, `computer` , `networking`, `printer`, `peripheral`, `phone`,`display_ports`,`display_ip`,`display_type`,`display_state`,`display_location`,`display_entity`,`engine`,`format`) VALUES ('1','0','default','1', '1','1','1','1','0','0','0','0','0','0','0','1');
+
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresLocationQuery','2','1','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresLocationQuery','3','2','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresLocationQuery','4','3','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresLocationQuery','5','4','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresLocationQuery','6','5','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresLocationQuery','7','6','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresLocationQuery','8','7','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresNetworkEquipmentQuery','2','1','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresNetworkEquipmentQuery','3','2','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresNetworkEquipmentQuery','4','3','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresNetworkEquipmentQuery','5','4','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresNetworkEquipmentQuery','6','5','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresNetworkEquipmentQuery','7','6','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresApplianceQuery','2','1','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresApplianceQuery','3','2','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresApplianceQuery','4','3','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresApplianceQuery','5','4','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresApplianceQuery','6','5','0');
+INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginArchiresApplianceQuery','7','6','0');