├── LICENSE ├── README.md ├── ajax └── getEntitiesRights.php ├── css └── style.css ├── front ├── entity.form.php └── ticket.form.php ├── hook.php ├── img ├── gifs │ ├── TransferTicketEntity_EN.gif │ └── TransferTicketEntity_FR.gif └── logo.png ├── inc ├── entity.class.php ├── profile.class.php └── ticket.class.php ├── js ├── entitySettings.js ├── profileSettings.js └── script.js ├── locales ├── en_GB.mo ├── en_GB.po ├── es_VE.mo ├── es_VE.po ├── fr.mo ├── fr.po ├── fr_FR.mo ├── fr_FR.po ├── pt_BR.mo ├── pt_BR.po ├── pt_PT.mo ├── pt_PT.po └── transferticketentity.pot ├── setup.php ├── transferticketentity.xml └── transifex.yaml /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GLPi Transfer Ticket Entity Plugin (FR) 2 | 3 | ## Introduction 4 | 5 | Ce plugin permet, pour les profils autorisés, de transférer des tickets d'une entité à une autre sur laquelle ils n'ont pas les accès. 6 | Il s'adresse aux organisations qui ont configurés, dans GLPI, leurs périmètres d'activités par entité (DRH, Comptabilité, SI, ...). 7 | 8 | L'intérêt étant de pouvoir transférer un ticket entre techniciens "GLPI" d'entités différentes et de continuer à assurer la confidentialité des données entre entités. 9 | 10 | Pour exemple : 11 | Un profil "technicien comptable" a, par défaut, visibilité que sur les tickets de son entité "Comptabilité". 12 | Dès lors, où un des tickets, qui lui est assigné, concerne la DRH, il aura la possibilité de leur transférer avec suivi. 13 | Une fois le transfert effectué, il n'a plus aucune visibilité sur le ticket. 14 | 15 | ## Documentation 16 | 17 | Pour configurer les prérequis du transfert d'entité : 18 | 19 | - Dans Administration > Profils > VotreProfil > Assistance > Ticket : Mettre à jour doit être coché. 20 | 21 | - Autoriser la fonction Transfert : définit si le transfert est autorisé vers l'entité et groupes associés 22 | - Groupe à assigner obligatoire pour effectuer un transfert : 23 | - Définit si le ticket transféré doit être obligatoirement assigné à un groupe. 24 | - Si non, le choix "aucun" apparaîtra dans la liste du groupe cible et sera à sélectionner 25 | - Si le ticket est envoyé dans une entité sans groupe, il sera considéré comme "nouveau" 26 | - Justification obligatoire pour effectuer un transfert 27 | - Si oui, le champ de saisi s'affiche avec un encart rouge 28 | - Si non, ce dernier apparaîtra avec un encart bleu toutefois la zone de saisie restera active si besoin. 29 | - Garder la catégorie après le transfert : 30 | - Si oui, la catégorie du ticket sera gardé après le transfert seulement si elle est disponible dans l'entité cible, sinon elle sera remise à null. 31 | - Si non, la catégorie du ticket sera remise à null. 32 | - Si non, il est possible de choisir une catégorie par défaut. 33 | - :warning: Si la catégorie est obligatoire dans l'entité de destination (via les templates de GLPI) et qu'elle sera équivalente à null après le transfert, une erreur apparaîtra. 34 | 35 | ## Où configurer le plugin 36 | 37 | Vous pouvez configurer les droits d'accès au plugin dans l'administration des profils. 38 | Les prérequis du transfert se gèrent dans l'administration des entités. 39 | 40 | ## Compatibilité 41 | 42 | Ce plugin a été testé jusqu'à la version de GLPI 10.0.14 43 | 44 | # GLPi Transfer Ticket Entity Plugin (EN) 45 | 46 | ## Introduction 47 | 48 | This plugin enables authorized profiles to transfer tickets from one entity to another to which they do not have access. 49 | It is designed for organizations that have configured their GLPI activity perimeters by entity (HR, Accounting, IS, etc.). 50 | 51 | The aim is to be able to transfer a ticket between "GLPI" technicians from different entities, and to continue to ensure the confidentiality of data between entities. 52 | 53 | For example: 54 | An "accounting technician" profile has, by default, visibility only on the tickets of its "Accounting" entity. 55 | If one of the tickets assigned to him concerns the HR department, he will be able to transfer it with follow-up. 56 | Once the transfer has been made, he no longer has any visibility of the ticket. 57 | 58 | ## Documentation 59 | 60 | To configure entity transfer prerequisites : 61 | 62 | - In Administration > Profile > YourProfile > Assistance > Ticket : Update must be checked. 63 | 64 | - Allow transfer function : defines whether transfer is allowed to the entity and associated groups 65 | - Assigned group required to make a transfer : 66 | - Defines whether the transferred ticket must be assigned to a group. 67 | - If not, the choice "none" will appear in the target group list and must be selected. 68 | - If the ticket is sent to an entity without a group, it will be considered "new" 69 | - Justification required to make a transfer : 70 | - If yes, the input field is displayed with a red highlighting. 71 | - If no, it will appear with a blue highlighting, but the input field will remain active if required. 72 | - Keep category after transfer : 73 | - If yes, category's ticket will be keep only if it is available in the target entity, otherwise it will be reset to null. 74 | - If no, category's ticket will be set to null. 75 | - If no, it's possible to select a default category. 76 | - :warning: If category is mandatory in the chosen entity (via GLPI's templates) and it will be equal to null after transfer, an error will occur. 77 | 78 | ## Where set up the plugin 79 | 80 | You can configure access rights to the plugin in profile administration. 81 | The transfer prerequisites are managed in the entity administration. 82 | 83 | ## Compatibility 84 | 85 | This plugin has been tested up to GLPI version 10.0.14 -------------------------------------------------------------------------------- /ajax/getEntitiesRights.php: -------------------------------------------------------------------------------- 1 | . 21 | 22 | @category Ticket 23 | @package Transferticketentity 24 | @author Yannick Comba 25 | @copyright 2015-2023 Département de Maine et Loire plugin team 26 | @license AGPL License 3.0 or (at your option) any later version 27 | https://www.gnu.org/licenses/gpl-3.0.html 28 | @link https://github.com/departement-maine-et-loire/ 29 | -------------------------------------------------------------------------- 30 | */ 31 | 32 | include ("../../../inc/includes.php"); 33 | 34 | header("Content-Type: text/html; charset=UTF-8"); 35 | Html::header_nocache(); 36 | Session::checkLoginUser(); 37 | 38 | // if (!isset($_REQUEST['id']) 39 | // || !isset($_REQUEST['type'])) { 40 | // exit; 41 | // } 42 | 43 | /** 44 | * Retrieve entities rights from plugin table 45 | * 46 | * @return $array 47 | */ 48 | function getEntitiesRights() 49 | { 50 | global $DB; 51 | 52 | $result = $DB->request([ 53 | 'SELECT' => ['entities_id', 'allow_entity_only_transfer', 'justification_transfer', 'allow_transfer', 'keep_category'], 54 | 'FROM' => 'glpi_plugin_transferticketentity_entities_settings', 55 | 'ORDER' => ['entities_id ASC'] 56 | ]); 57 | 58 | $array = array(); 59 | 60 | foreach($result as $data){ 61 | array_push($array, $data); 62 | } 63 | 64 | return $array; 65 | } 66 | 67 | /** 68 | * Affiche les données en json pour faire de l'ajax dans ../js/script.js 69 | * 70 | * @return void 71 | */ 72 | function showJsonData() { 73 | $getEntitiesRights = getEntitiesRights(); 74 | 75 | echo json_encode($getEntitiesRights); 76 | } 77 | 78 | showJsonData(); -------------------------------------------------------------------------------- /css/style.css: -------------------------------------------------------------------------------- 1 | /*----------------------------------------- all files -----------------------------------------------*/ 2 | 3 | .tt_hidden_value { 4 | display:none; 5 | } 6 | 7 | /* .tt_flex { 8 | display:flex; 9 | } */ 10 | 11 | /*--------------------------------------- ticket.class.php -------------------------------------------*/ 12 | 13 | .unauthorised { 14 | text-align: center; 15 | color: red; 16 | font-size: 1.15rem; 17 | padding-top: 2rem; 18 | } 19 | 20 | #tt_gest_error { 21 | color:red; 22 | } 23 | 24 | .form_transfert { 25 | margin:auto; 26 | display:none; 27 | } 28 | 29 | .form_transfert #div_confirmation { 30 | display: none; 31 | padding-left: .5rem; 32 | } 33 | 34 | .form_transfert #div_confirmation #tt_btn_open_modal_form { 35 | display:inline-flex; 36 | align-items: center; 37 | justify-content: center; 38 | white-space: nowrap; 39 | border: 1px solid rgba(98, 105, 118, 0.24); 40 | border-radius: 4px; 41 | font-weight: 500; 42 | line-height: 1.4285714286; 43 | padding: 0.4375rem 1rem; 44 | } 45 | 46 | .tt_modal { 47 | background-color: red; 48 | background-color: #fefefe; 49 | margin: auto; 50 | max-width: 600px; 51 | padding: 15px; 52 | border: 1px solid #888; 53 | box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19); 54 | text-align: center; 55 | z-index: 10001; 56 | } 57 | 58 | .tt_modal label { 59 | padding-bottom: .5rem; 60 | } 61 | 62 | .tt_modal textarea { 63 | width: 80%; 64 | height: 80px; 65 | padding: 12px 20px; 66 | box-sizing: border-box; 67 | border: 2px solid #ccc; 68 | border-radius: 4px; 69 | background-color: #f8f8f8; 70 | resize: none; 71 | } 72 | 73 | .tt_modal textarea:focus { 74 | outline: none !important; 75 | border-color: #719ECE; 76 | box-shadow: 0 0 10px #719ECE; 77 | } 78 | 79 | .form_transfert .tt_group_choice { 80 | display: none; 81 | } 82 | 83 | .tt_group_choice { 84 | gap: 0.25rem; 85 | } 86 | 87 | #canceltransfert { 88 | display:inline-flex; 89 | align-items: center; 90 | justify-content: center; 91 | white-space: nowrap; 92 | background-color: #f00020; 93 | color: white; 94 | border: 1px solid rgba(98, 105, 118, 0.24); 95 | border-radius: 4px; 96 | font-weight: 500; 97 | line-height: 1.4285714286; 98 | padding: 0.4375rem 2rem; 99 | margin-right:1rem; 100 | } 101 | 102 | #transfertticket { 103 | display:inline-flex; 104 | align-items: center; 105 | justify-content: center; 106 | white-space: nowrap; 107 | background-color: #80cead; 108 | color: #1e293b; 109 | border: 1px solid rgba(98, 105, 118, 0.24); 110 | border-radius: 4px; 111 | font-weight: 500; 112 | line-height: 1.4285714286; 113 | padding: 0.4375rem 2rem; 114 | } 115 | 116 | #tt_modal_form_adder .justification { 117 | padding-bottom:1rem; 118 | } 119 | 120 | #tt_modal_form_adder h2 p { 121 | color:black; 122 | font-weight:normal; 123 | } 124 | 125 | #tt_modal_form_adder p { 126 | padding-bottom:1rem; 127 | } 128 | 129 | .group_not_found { 130 | text-align: center; 131 | color: red; 132 | font-size: 0.9rem; 133 | padding-top: 2rem; 134 | } 135 | 136 | .adv-msg { 137 | color: #800000; 138 | } 139 | 140 | /*--------------------------------------- profile.class.php -------------------------------------------*/ 141 | 142 | .tt_profile_border-top { 143 | background:var(--tblr-border-color-light); 144 | } 145 | 146 | .tt_profile_border-top h4 { 147 | line-height:1.4285714286; 148 | font-size:0.875rem; 149 | color:#626976; 150 | } 151 | 152 | .tt_profile_tab_bg_2 { 153 | width:40%; 154 | } -------------------------------------------------------------------------------- /front/entity.form.php: -------------------------------------------------------------------------------- 1 | . 21 | 22 | @category Ticket 23 | @package Transferticketentity 24 | @author Yannick Comba 25 | @copyright 2015-2023 Département de Maine et Loire plugin team 26 | @license AGPL License 3.0 or (at your option) any later version 27 | https://www.gnu.org/licenses/gpl-3.0.html 28 | @link https://github.com/departement-maine-et-loire/ 29 | -------------------------------------------------------------------------- 30 | */ 31 | 32 | namespace GlpiPlugin\Transferticketentity; 33 | use CommonDBTM; 34 | use Session; 35 | 36 | require '../../../inc/includes.php'; 37 | 38 | if (!isset($_SESSION['glpiactiveprofile']['id'])) { 39 | // Session is not valid then exit 40 | exit; 41 | } 42 | 43 | class PluginTransferticketentityFormEntity extends CommonDBTM 44 | { 45 | public $getNameEntity; 46 | public $ticketTransferRights; 47 | public $checkTransferSettings; 48 | 49 | public function __construct() 50 | { 51 | $this->getNameEntity = $this->getNameEntity(null); 52 | $this->ticketTransferRights = $this->ticketTransferRights(); 53 | $this->checkTransferSettings = $this->checkTransferSettings(null); 54 | } 55 | 56 | public function getNameEntity($ID) 57 | { 58 | global $DB; 59 | 60 | $result = $DB->request([ 61 | 'FROM' => 'glpi_entities', 62 | 'WHERE' => ['id' => $ID] 63 | ]); 64 | 65 | $array = array(); 66 | 67 | foreach($result as $data){ 68 | return $data['name']; 69 | } 70 | 71 | return $array; 72 | } 73 | 74 | public function checkTransferSettings($ID) 75 | { 76 | global $DB; 77 | 78 | $result = $DB->request([ 79 | 'FROM' => 'glpi_plugin_transferticketentity_entities_settings', 80 | 'WHERE' => ['entities_id' => $ID] 81 | ]); 82 | 83 | $array = array(); 84 | 85 | foreach($result as $data){ 86 | array_push($array, $data); 87 | } 88 | 89 | return $array; 90 | } 91 | 92 | /** 93 | * Carries out the necessary actions for the transfer entity 94 | * 95 | * @return void 96 | */ 97 | public function ticketTransferRights() 98 | { 99 | global $CFG_GLPI; 100 | global $DB; 101 | 102 | if (isset($_POST['transfertticket'])) { 103 | $theServer = $_POST['theServer']; 104 | 105 | $allow_entity_only_transfer = $_POST['allow_entity_only_transfer']; 106 | $justification_transfer = $_POST['justification_transfer']; 107 | $allow_transfer = $_POST['allow_transfer']; 108 | $keep_category = $_POST['keep_category']; 109 | $itilcategories_id = $_POST['itilcategories_id']; 110 | $ID = $_POST['ID']; 111 | 112 | $entityName = self::getNameEntity($ID); 113 | $checkTransferSettings = self::checkTransferSettings($ID); 114 | 115 | if (!empty($checkTransferSettings)) { 116 | foreach ($checkTransferSettings as $transferSettings) { 117 | $DB->delete('glpi_plugin_transferticketentity_entities_settings', 118 | [ 119 | 'entities_id' => $transferSettings['entities_id'] 120 | ] 121 | ); 122 | } 123 | } 124 | 125 | $DB->insert('glpi_plugin_transferticketentity_entities_settings', 126 | [ 127 | 'entities_id' => $ID, 128 | 'allow_entity_only_transfer' => $allow_entity_only_transfer, 129 | 'justification_transfer' => $justification_transfer, 130 | 'allow_transfer' => $allow_transfer, 131 | 'keep_category' => $keep_category, 132 | 'itilcategories_id' => $itilcategories_id 133 | ] 134 | ); 135 | 136 | Session::addMessageAfterRedirect( 137 | __( 138 | "Item successfully updated : " 139 | ) . $entityName, 140 | true, 141 | INFO 142 | ); 143 | 144 | header('location:' . $theServer . 'front/entity.form.php?id=' . $ID); 145 | } 146 | } 147 | } 148 | 149 | $transferticketentityEntity = new PluginTransferticketentityFormEntity(); -------------------------------------------------------------------------------- /front/ticket.form.php: -------------------------------------------------------------------------------- 1 | . 21 | 22 | @category Ticket 23 | @package Transferticketentity 24 | @author Yannick Comba 25 | @copyright 2015-2023 Département de Maine et Loire plugin team 26 | @license AGPL License 3.0 or (at your option) any later version 27 | https://www.gnu.org/licenses/gpl-3.0.html 28 | @link https://github.com/departement-maine-et-loire/ 29 | -------------------------------------------------------------------------- 30 | */ 31 | 32 | namespace GlpiPlugin\Transferticketentity; 33 | use CommonDBTM; 34 | use Session; 35 | use Ticket_User; 36 | use CommonITILActor; 37 | use Group_Ticket; 38 | use Ticket; 39 | use TicketTask; 40 | use Planning; 41 | 42 | require '../../../inc/includes.php'; 43 | 44 | if (!isset($_SESSION['glpiactiveprofile']['id'])) { 45 | // Session is not valid then exit 46 | exit; 47 | } 48 | 49 | class PluginTransferticketentityTransfer extends CommonDBTM 50 | { 51 | public $checkTechRight; 52 | public $checkAssign; 53 | public $checkEntityETT; 54 | public $checkGroup; 55 | public $theEntity; 56 | public $checkEntityRight; 57 | public $theGroup; 58 | public $ticketTransferETT; 59 | 60 | public function __construct() 61 | { 62 | $this->checkTechRight = $this->checkTechRight(); 63 | $this->checkAssign = $this->checkAssign(); 64 | $this->checkEntityETT = $this->checkEntityETT(); 65 | $this->checkGroup = $this->checkGroup(); 66 | $this->theEntity = $this->theEntity(); 67 | $this->checkEntityRight = $this->checkEntityRight(); 68 | $this->theGroup = $this->theGroup(); 69 | $this->ticketTransferETT = $this->ticketTransferETT(); 70 | } 71 | 72 | /** 73 | * Checks technician's right 74 | * 75 | * @return bool 76 | */ 77 | public function checkTechRight() 78 | { 79 | global $DB; 80 | 81 | $technician_profile = $_POST['technician_profile']; 82 | 83 | $result = $DB->request([ 84 | 'FROM' => 'glpi_profilerights', 85 | 'WHERE' => ['name' => 'plugin_transferticketentity_bypass', 'profiles_id' => $technician_profile] 86 | ]); 87 | 88 | $array = array(); 89 | 90 | foreach($result as $data){ 91 | array_push($array, $data['rights']); 92 | } 93 | 94 | return $array; 95 | } 96 | 97 | /** 98 | * Checks that the technician or his group is assigned to the ticket 99 | * 100 | * @return bool 101 | */ 102 | public function checkAssign() 103 | { 104 | global $DB; 105 | 106 | $id_ticket = $_POST['id_ticket']; 107 | $id_user = $_POST['id_user']; 108 | $groupTech = array(); 109 | 110 | $result = $DB->request([ 111 | 'SELECT' => 'groups_id', 112 | 'FROM' => 'glpi_groups_users', 113 | 'WHERE' => ['users_id' => $id_user] 114 | ]); 115 | 116 | foreach($result as $data){ 117 | if(!in_array($data, $groupTech)) { 118 | array_push($groupTech, $data['groups_id']); 119 | } 120 | } 121 | 122 | $checkAssignedTech = array(); 123 | $checkAssignedGroup = array(); 124 | 125 | $result = $DB->request([ 126 | 'SELECT' => 'users_id', 127 | 'FROM' => 'glpi_tickets_users', 128 | 'WHERE' => ['tickets_id' => $id_ticket] 129 | ]); 130 | 131 | foreach($result as $data){ 132 | if(!in_array($data, $checkAssignedTech)) { 133 | array_push($checkAssignedTech, $data['users_id']); 134 | } 135 | } 136 | 137 | $result = $DB->request([ 138 | 'SELECT' => 'groups_id', 139 | 'FROM' => 'glpi_groups_tickets', 140 | 'WHERE' => ['tickets_id' => $id_ticket] 141 | ]); 142 | 143 | foreach($result as $data){ 144 | if(!in_array($data, $checkAssignedGroup)) { 145 | array_push($checkAssignedGroup, $data['groups_id']); 146 | } 147 | } 148 | 149 | $var_check = 0; 150 | 151 | if (in_array($id_user, $checkAssignedTech)) { 152 | $var_check++; 153 | } 154 | 155 | foreach($groupTech as $checkAssign) { 156 | if (in_array($checkAssign, $checkAssignedGroup)) { 157 | $var_check++; 158 | } 159 | } 160 | 161 | if ($var_check >= 1) { 162 | return true; 163 | } else { 164 | return false; 165 | } 166 | } 167 | 168 | /** 169 | * Get only the entities with at least one active group 170 | * 171 | * @return array $checkEntityETT 172 | */ 173 | public function checkEntityETT() 174 | { 175 | global $DB; 176 | 177 | $result = $DB->request([ 178 | 'SELECT' => ['E.id', 'E.entities_id', 'E.name', 'TES.allow_entity_only_transfer', 'TES.justification_transfer', 'TES.allow_transfer'], 179 | 'FROM' => 'glpi_entities AS E', 180 | 'LEFT JOIN' => ['glpi_plugin_transferticketentity_entities_settings AS TES' => ['FKEY' => ['E' => 'id', 181 | 'TES' => 'entities_id']]], 182 | 'WHERE' => ['TES.allow_transfer' => 1], 183 | 'GROUPBY' => 'E.id', 184 | 'ORDER' => 'E.entities_id ASC' 185 | ]); 186 | 187 | $array = array(); 188 | 189 | foreach($result as $data){ 190 | array_push($array, $data['id']); 191 | } 192 | 193 | return $array; 194 | } 195 | 196 | /** 197 | * Get only the groups belonging to the selected entity 198 | * 199 | * @return array $checkGroup 200 | */ 201 | public function checkGroup() 202 | { 203 | global $DB; 204 | 205 | $entity_choice = $_REQUEST['entity_choice']; 206 | 207 | $result = $DB->request([ 208 | 'SELECT' => 'glpi_groups.id', 209 | 'FROM' => 'glpi_groups', 210 | 'LEFT JOIN' => ['glpi_entities' => ['FKEY' => ['glpi_groups' => 'entities_id', 211 | 'glpi_entities' => 'id']]], 212 | 'WHERE' => ['glpi_groups.is_assign' => 1, 'glpi_entities.id' => $entity_choice], 213 | 'ORDER' => 'glpi_entities.id ASC' 214 | ]); 215 | 216 | $array = array(); 217 | 218 | foreach($result as $data){ 219 | array_push($array, $data['id']); 220 | } 221 | 222 | return $array; 223 | } 224 | 225 | /** 226 | * Get the name of the selected entity 227 | * 228 | * @return $data 229 | */ 230 | public function theEntity() 231 | { 232 | global $DB; 233 | $entity_choice = $_REQUEST['entity_choice']; 234 | 235 | $result = $DB->request([ 236 | 'SELECT' => 'name', 237 | 'FROM' => 'glpi_entities', 238 | 'WHERE' => ['id' => $entity_choice] 239 | ]); 240 | 241 | $array = array(); 242 | 243 | foreach($result as $data){ 244 | array_push($array, $data['name']); 245 | } 246 | 247 | return $array[0]; 248 | } 249 | 250 | /** 251 | * Get selected entity rights 252 | * 253 | * @return array 254 | */ 255 | public function checkEntityRight() 256 | { 257 | global $DB; 258 | 259 | $entity_choice = $_REQUEST['entity_choice']; 260 | 261 | $result = $DB->request([ 262 | 'FROM' => 'glpi_plugin_transferticketentity_entities_settings', 263 | 'WHERE' => ['entities_id' => $entity_choice] 264 | ]); 265 | 266 | $array = array(); 267 | 268 | foreach($result as $data){ 269 | $array['allow_entity_only_transfer'] = $data['allow_entity_only_transfer']; 270 | $array['justification_transfer'] = $data['justification_transfer']; 271 | $array['allow_transfer'] = $data['allow_transfer']; 272 | $array['keep_category'] = $data['keep_category']; 273 | $array['itilcategories_id'] = $data['itilcategories_id']; 274 | } 275 | 276 | return $array; 277 | } 278 | 279 | /** 280 | * Get the selected group name 281 | * 282 | * @return $data 283 | */ 284 | public function theGroup() 285 | { 286 | global $DB; 287 | 288 | if (!empty($_REQUEST['group_choice'])) { 289 | $group_choice = $_REQUEST['group_choice']; 290 | 291 | $result = $DB->request([ 292 | 'SELECT' => 'name', 293 | 'FROM' => 'glpi_groups', 294 | 'WHERE' => ['id' => $group_choice] 295 | ]); 296 | 297 | $array = array(); 298 | 299 | foreach($result as $data){ 300 | array_push($array, $data['name']); 301 | } 302 | 303 | return $array[0]; 304 | } else return false; 305 | } 306 | 307 | /** 308 | * Check if category exist in target entity 309 | * 310 | * @return bool 311 | */ 312 | public function checkExistingCategory() 313 | { 314 | global $DB; 315 | 316 | $id_ticket = $_POST['id_ticket']; 317 | $targetEntity = $_REQUEST['entity_choice']; 318 | 319 | $result = $DB->request([ 320 | 'SELECT' => 'itilcategories_id', 321 | 'FROM' => 'glpi_tickets', 322 | 'WHERE' => ['id' => $id_ticket] 323 | ]); 324 | 325 | $getTicketCategory = ''; 326 | 327 | foreach ($result as $data) { 328 | $getTicketCategory = $data['itilcategories_id']; 329 | } 330 | 331 | $result = $DB->request([ 332 | 'FROM' => 'glpi_entities', 333 | 'WHERE' => ['id' => $targetEntity] 334 | ]); 335 | 336 | $ancestorsEntities = array(); 337 | 338 | foreach ($result as $data) { 339 | if ($data['ancestors_cache']) { 340 | $ancestorsEntities = $data['ancestors_cache']; 341 | $ancestorsEntities = json_decode($ancestorsEntities, true); 342 | array_push($ancestorsEntities, $targetEntity); 343 | } else { 344 | array_push($ancestorsEntities, 0); 345 | } 346 | } 347 | 348 | $result = $DB->request([ 349 | 'FROM' => 'glpi_itilcategories', 350 | 'WHERE' => ['id' => $getTicketCategory] 351 | ]); 352 | 353 | $getEntitiesFromCategoryTicket = ''; 354 | $isRecursiveCategory = ''; 355 | 356 | foreach ($result as $data) { 357 | $getEntitiesFromCategoryTicket = $data['entities_id']; 358 | $isRecursiveCategory = $data['is_recursive']; 359 | } 360 | 361 | if (!$isRecursiveCategory) { 362 | if ($getEntitiesFromCategoryTicket == $targetEntity) { 363 | $isRecursiveCategory = true; 364 | } 365 | } 366 | 367 | if (in_array($getEntitiesFromCategoryTicket, $ancestorsEntities) && $isRecursiveCategory) { 368 | return true; 369 | } else { 370 | return false; 371 | } 372 | } 373 | 374 | /** 375 | * Check GLPIs mandatory fields 376 | * 377 | * @return int 378 | */ 379 | public function checkTicketTemplateID() 380 | { 381 | global $DB; 382 | 383 | $entity_choice = $_REQUEST['entity_choice']; 384 | $selectedTemplate = 0; 385 | 386 | while (!$selectedTemplate) { 387 | $query = [ 388 | 'FROM' => 'glpi_entities', 389 | 'WHERE' => ['id' => $entity_choice] 390 | ]; 391 | 392 | foreach ($DB->request($query) as $data) { 393 | $id = $data['id']; 394 | $entity_choice = $data['entities_id']; 395 | $selectedTemplate = $data['tickettemplates_id']; 396 | } 397 | 398 | if ((!$id && !$selectedTemplate) || ($entity_choice === null && !$selectedTemplate)) { 399 | return 0; 400 | } 401 | } 402 | 403 | return $selectedTemplate; 404 | } 405 | 406 | /** 407 | * Check GLPIs mandatory fields 408 | * 409 | * @return boolean 410 | */ 411 | public function checkMandatoryCategory() 412 | { 413 | global $DB; 414 | 415 | $id_ticket = $_POST['id_ticket']; 416 | $tickettemplates_id = self::checkTicketTemplateID(); 417 | 418 | $ttm_class = 'Ticket' . 'TemplateMandatoryField'; 419 | $ttm = new $ttm_class(); 420 | $mandatoryFields = $ttm->getMandatoryFields($tickettemplates_id); 421 | 422 | $result = $DB->request([ 423 | 'FROM' => 'glpi_tickets', 424 | 'WHERE' => ['id' => $id_ticket] 425 | ]); 426 | 427 | $ticketFields = array(); 428 | 429 | foreach($result as $data){ 430 | array_push($ticketFields, $data); 431 | } 432 | 433 | $ticketFields = $ticketFields[0]; 434 | 435 | // Check if category field is mandatory 436 | foreach ($mandatoryFields as $mandatoryField => $MF) { 437 | if ($mandatoryField == 'itilcategories_id') { 438 | return true; 439 | } 440 | } 441 | 442 | return false; 443 | } 444 | 445 | /** 446 | * Carries out the necessary actions for the transfer entity 447 | * 448 | * @return void 449 | */ 450 | public function ticketTransferETT() 451 | { 452 | global $CFG_GLPI; 453 | global $DB; 454 | 455 | if (isset($_POST['transfertticket'])) { 456 | $checkAssign = self::checkAssign(); 457 | $checkTechRight = self::checkTechRight(); 458 | $checkEntity = self::checkEntityETT(); 459 | $checkGroup = self::checkGroup(); 460 | $checkEntityRight = self::checkEntityRight(); 461 | $checkExistingCategory = self::checkExistingCategory(); 462 | $checkMandatoryCategory = self::checkMandatoryCategory(); 463 | 464 | $id_ticket = $_POST['id_ticket']; 465 | $theServer = $_POST['theServer']; 466 | $justification = $_POST['justification']; 467 | $requiredGroup = true; 468 | 469 | $theEntity = self::theEntity(); 470 | $theGroup = self::theGroup(); 471 | 472 | $entity_choice = $_REQUEST['entity_choice']; 473 | $group_choice = $_REQUEST['group_choice']; 474 | 475 | if (!isset($_POST['justification']) || $_POST['justification'] == '') { 476 | if ($checkEntityRight['justification_transfer'] == 1) { 477 | Session::addMessageAfterRedirect( 478 | __( 479 | "Please explain your transfer", 480 | 'transferticketentity' 481 | ), 482 | true, 483 | ERROR 484 | ); 485 | 486 | header('location:' . $theServer); 487 | 488 | return false; 489 | } else { 490 | $justification = ''; 491 | } 492 | } 493 | 494 | if (empty($group_choice) && $checkEntityRight['allow_entity_only_transfer'] == 1) { 495 | Session::addMessageAfterRedirect( 496 | __( 497 | "Please select a valid group", 498 | 'transferticketentity' 499 | ), 500 | true, 501 | ERROR 502 | ); 503 | 504 | header('location:' . $theServer); 505 | 506 | return false; 507 | } else if (empty($group_choice) && $checkEntityRight['allow_entity_only_transfer'] == 0) { 508 | $requiredGroup = false; 509 | } 510 | 511 | if (!$checkTechRight[0] && !$checkAssign) { 512 | Session::addMessageAfterRedirect( 513 | __( 514 | "You must be assigned to the ticket to be able to transfer it", 515 | 'transferticketentity' 516 | ), 517 | true, 518 | ERROR 519 | ); 520 | 521 | header('location:' . $theServer); 522 | } else if (!in_array($entity_choice, $checkEntity)) { 523 | // Check that the selected entity belongs to those available 524 | Session::addMessageAfterRedirect( 525 | __( 526 | "Please select a valid entity", 527 | 'transferticketentity' 528 | ), 529 | true, 530 | ERROR 531 | ); 532 | 533 | header('location:' . $theServer); 534 | } else if (!empty($group_choice) && !in_array($group_choice, $checkGroup)) { 535 | Session::addMessageAfterRedirect( 536 | __( 537 | "Please select a valid group", 538 | 'transferticketentity' 539 | ), 540 | true, 541 | ERROR 542 | ); 543 | 544 | header('location:' . $theServer); 545 | } 546 | else { 547 | // Change the entity ticket and set its status to processing (assigned) 548 | $ticket = new Ticket(); 549 | 550 | $ticket_update = [ 551 | 'id' => $id_ticket, 552 | 'entities_id' => $entity_choice, 553 | ]; 554 | 555 | if ($theGroup) { 556 | $ticket_status = ['status' => 2]; 557 | $ticket_update = array_merge($ticket_update, $ticket_status); 558 | } else { 559 | $ticket_status = ['status' => 1]; 560 | $ticket_update = array_merge($ticket_update, $ticket_status); 561 | } 562 | 563 | // In case keep_category is at yes and category doesn't exist, reset category's ticket 564 | if ($checkEntityRight['keep_category'] && !$checkExistingCategory) { 565 | $ticket_category = ['itilcategories_id' => 0]; 566 | $ticket_update = array_merge($ticket_update, $ticket_category); 567 | } 568 | 569 | if (!$checkEntityRight['keep_category']) { 570 | if ($checkEntityRight['itilcategories_id'] == null) { 571 | $ticket_category = ['itilcategories_id' => 0]; 572 | } else { 573 | $ticket_category = ['itilcategories_id' => $checkEntityRight['itilcategories_id']]; 574 | } 575 | $ticket_update = array_merge($ticket_update, $ticket_category); 576 | } 577 | 578 | // If category is mandatory with GLPIs template and category will be null 579 | if ($ticket_category['itilcategories_id'] == 0 && $checkMandatoryCategory) { 580 | Session::addMessageAfterRedirect( 581 | __( 582 | "Category will be set to null but its configured as mandatory in GLPIs template, please contact your administrator.", 583 | 'transferticketentity' 584 | ), 585 | true, 586 | ERROR 587 | ); 588 | 589 | header('location:' . $theServer); 590 | 591 | return false; 592 | } 593 | 594 | // Remove the link with the current user 595 | $delete_link_user = [ 596 | 'tickets_id' => $id_ticket, 597 | 'type' => CommonITILActor::ASSIGN 598 | ]; 599 | 600 | $ticket_user = new Ticket_User(); 601 | $found_user = $ticket_user->find($delete_link_user); 602 | 603 | foreach ($found_user as $id => $tu) { 604 | //delete user 605 | $ticket_user->delete(['id' => $id]); 606 | } 607 | 608 | // Remove the link with the current group 609 | $delete_link_group = [ 610 | 'tickets_id' => $id_ticket, 611 | 'type' => CommonITILActor::ASSIGN 612 | ]; 613 | 614 | $group_ticket = new Group_Ticket(); 615 | $found_group = $group_ticket->find($delete_link_group); 616 | 617 | foreach ($found_group as $id => $tu) { 618 | //delete group 619 | $group_ticket->delete(['id' => $id]); 620 | } 621 | 622 | $ticket->update($ticket_update); 623 | 624 | if ($requiredGroup) { 625 | // Change group ticket 626 | $group_check = [ 627 | 'tickets_id' => $id_ticket, 628 | 'groups_id' => $group_choice, 629 | 'type' => CommonITILActor::ASSIGN 630 | ]; 631 | 632 | if (!$group_ticket->find($group_check)) { 633 | $group_ticket->add($group_check); 634 | } else { 635 | $group_ticket->update($group_check); 636 | } 637 | } 638 | 639 | $groupText = "

$justification"; 640 | 641 | if ($theGroup) { 642 | $groupText = __("in the group", "transferticketentity") . " $theGroup \n

$justification"; 643 | } 644 | 645 | // Log the transfer in a task 646 | $task = new TicketTask(); 647 | $task->add([ 648 | 'tickets_id' => $id_ticket, 649 | 'is_private' => true, 650 | 'state' => Planning::INFO, 651 | 'content' => __( 652 | "Escalation to", 653 | "transferticketentity" 654 | ) . " $theEntity " . $groupText 655 | ]); 656 | 657 | Session::addMessageAfterRedirect( 658 | __( 659 | "Successful transfer for ticket n° : ", 660 | "transferticketentity" 661 | ) . $id_ticket, 662 | true, 663 | INFO 664 | ); 665 | 666 | $theServer = explode("/ticket.form.php",$theServer); 667 | $theServer = $theServer[0]; 668 | header('location:' . $theServer . '/central.php'); 669 | } 670 | 671 | } else if (isset($_POST['canceltransfert'])) { 672 | $id_ticket = $_POST['id_ticket']; 673 | $theServer = $_POST['theServer']; 674 | 675 | Session::addMessageAfterRedirect( 676 | __("Transfer canceled", 'transferticketentity'), 677 | true, 678 | ERROR 679 | ); 680 | 681 | header('location:' . $theServer); 682 | } 683 | } 684 | } 685 | 686 | $transferticketentityTicket = new PluginTransferticketentityTransfer(); -------------------------------------------------------------------------------- /hook.php: -------------------------------------------------------------------------------- 1 | . 21 | 22 | @category Ticket 23 | @package Transferticketentity 24 | @author Yannick Comba 25 | @copyright 2015-2023 Département de Maine et Loire plugin team 26 | @license AGPL License 3.0 or (at your option) any later version 27 | https://www.gnu.org/licenses/gpl-3.0.html 28 | @link https://github.com/departement-maine-et-loire/ 29 | -------------------------------------------------------------------------- 30 | */ 31 | 32 | /** 33 | * Install hook 34 | * 35 | * @return boolean 36 | */ 37 | function plugin_transferticketentity_install() 38 | { 39 | global $DB; 40 | 41 | PluginTransferticketentityProfile::createFirstAccess($_SESSION["glpiactiveprofile"]["id"]); 42 | 43 | $default_charset = DBConnection::getDefaultCharset(); 44 | $default_collation = DBConnection::getDefaultCollation(); 45 | $default_key_sign = DBConnection::getDefaultPrimaryKeySignOption(); 46 | 47 | if (!$DB->TableExists("glpi_plugin_transferticketentity_entities_settings")) { 48 | $query = "CREATE TABLE `glpi_plugin_transferticketentity_entities_settings` ( 49 | `id` int {$default_key_sign} NOT NULL auto_increment, 50 | `entities_id` int {$default_key_sign} NOT NULL, 51 | `allow_entity_only_transfer` BOOLEAN NOT NULL DEFAULT 0, 52 | `justification_transfer` BOOLEAN NOT NULL DEFAULT 0, 53 | `allow_transfer` BOOLEAN NOT NULL DEFAULT 0, 54 | `keep_category` BOOLEAN NOT NULL DEFAULT 0, 55 | `itilcategories_id` INT {$default_key_sign}, 56 | PRIMARY KEY (`id`), 57 | FOREIGN KEY (`entities_id`) REFERENCES `glpi_entities` (`id`), 58 | FOREIGN KEY (`itilcategories_id`) REFERENCES `glpi_itilcategories` (`id`) 59 | ) ENGINE=InnoDB DEFAULT CHARSET={$default_charset} COLLATE={$default_collation} ROW_FORMAT=DYNAMIC;"; 60 | 61 | $DB->query($query) or die("error creating glpi_plugin_transferticketentity_entities_settings " . $DB->error()); 62 | } 63 | 64 | return true; 65 | } 66 | 67 | /** 68 | * Uninstall hook 69 | * 70 | * @return boolean 71 | */ 72 | function plugin_transferticketentity_uninstall() 73 | { 74 | global $DB; 75 | 76 | $result = $DB->request([ 77 | 'SELECT' => ['profiles_id'], 78 | 'FROM' => 'glpi_profilerights', 79 | 'WHERE' => ['name' => 'plugin_transferticketentity_use', 'rights' => ALLSTANDARDRIGHT] 80 | ]); 81 | 82 | foreach ($result as $id_profil) { 83 | $DB->delete('glpi_profilerights', 84 | [ 85 | 'name' => 'plugin_transferticketentity_use', 86 | 'profiles_id' => $id_profil 87 | ] 88 | ); 89 | } 90 | 91 | $tables = ["glpi_plugin_transferticketentity_entities_settings"]; 92 | 93 | foreach ($tables as $table) { 94 | if ($DB->tableExists($table)) { 95 | $DB->queryOrDie("DROP TABLE IF EXISTS `".$table."`", $DB->error()); 96 | } 97 | } 98 | 99 | return true; 100 | } -------------------------------------------------------------------------------- /img/gifs/TransferTicketEntity_EN.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Departement-de-Maine-et-Loire/transferticketentity/671bf72686ca0723250f4f9153a69bec837b08cd/img/gifs/TransferTicketEntity_EN.gif -------------------------------------------------------------------------------- /img/gifs/TransferTicketEntity_FR.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Departement-de-Maine-et-Loire/transferticketentity/671bf72686ca0723250f4f9153a69bec837b08cd/img/gifs/TransferTicketEntity_FR.gif -------------------------------------------------------------------------------- /img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Departement-de-Maine-et-Loire/transferticketentity/671bf72686ca0723250f4f9153a69bec837b08cd/img/logo.png -------------------------------------------------------------------------------- /inc/entity.class.php: -------------------------------------------------------------------------------- 1 | . 21 | 22 | @category Ticket 23 | @package Transferticketentity 24 | @author Yannick Comba 25 | @copyright 2015-2023 Département de Maine et Loire plugin team 26 | @license AGPL License 3.0 or (at your option) any later version 27 | https://www.gnu.org/licenses/gpl-3.0.html 28 | @link https://github.com/departement-maine-et-loire/ 29 | -------------------------------------------------------------------------- 30 | */ 31 | 32 | if (!defined('GLPI_ROOT')) { 33 | die("Sorry. You can't access directly to this file"); 34 | } 35 | 36 | class PluginTransferticketentityEntity extends Entity 37 | { 38 | /** 39 | * If category belong to ancestor, return it 40 | * 41 | * @return array 42 | */ 43 | public function availableCategories() 44 | { 45 | global $DB; 46 | $entity = $_REQUEST['id']; 47 | $allItilCategories = ['null' => 'null']; 48 | 49 | $result = $DB->request([ 50 | 'FROM' => 'glpi_entities', 51 | 'WHERE' => ['id' => $entity] 52 | ]); 53 | 54 | $ancestorsEntities = array(); 55 | 56 | foreach ($result as $data) { 57 | if ($data['ancestors_cache']) { 58 | $ancestorsEntities = $data['ancestors_cache']; 59 | $ancestorsEntities = json_decode($ancestorsEntities, true); 60 | array_push($ancestorsEntities, $entity); 61 | } else { 62 | array_push($ancestorsEntities, 0); 63 | } 64 | } 65 | 66 | foreach ($ancestorsEntities as $ancestorEntity) { 67 | if ($ancestorEntity == $entity) { 68 | $result = $DB->request([ 69 | 'FROM' => 'glpi_itilcategories', 70 | 'WHERE' => ['entities_id' => $ancestorEntity] 71 | ]); 72 | 73 | foreach ($result as $data) { 74 | $allItilCategories[$data['id']] = $data['name']; 75 | } 76 | } else { 77 | $result = $DB->request([ 78 | 'FROM' => 'glpi_itilcategories', 79 | 'WHERE' => ['entities_id' => $ancestorEntity, 'is_recursive' => 1] 80 | ]); 81 | 82 | foreach ($result as $data) { 83 | $allItilCategories[$data['id']] = $data['name']; 84 | } 85 | } 86 | } 87 | 88 | return $allItilCategories; 89 | } 90 | 91 | /** 92 | * If the profile is authorised, add an extra tab 93 | * 94 | * @param object $item Entity 95 | * @param int $withtemplate 0 96 | * 97 | * @return "Entity ticket transfer" 98 | */ 99 | public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) 100 | { 101 | if ($item->getType() == 'Entity') { 102 | return __("Transfer Ticket Entity", "transferticketentity"); 103 | } 104 | return ''; 105 | } 106 | 107 | /** 108 | * If we are on tickets, an additional tab is displayed 109 | * 110 | * @param object $item Ticket 111 | * @param int $tabnum 1 112 | * @param int $withtemplate 0 113 | * 114 | * @return true 115 | */ 116 | public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) 117 | { 118 | if ($item->getType() == 'Entity') { 119 | $profile = new self(); 120 | $ID = $item->getField('id'); 121 | $profile->showFormMcv($ID); 122 | } 123 | 124 | return true; 125 | } 126 | 127 | public function checkRights($ID) { 128 | global $DB; 129 | 130 | $result = $DB->request([ 131 | 'FROM' => 'glpi_plugin_transferticketentity_entities_settings', 132 | 'WHERE' => ['entities_id' => $ID] 133 | ]); 134 | 135 | $array = array(); 136 | 137 | foreach($result as $data){ 138 | $array['allow_entity_only_transfer'] = $data['allow_entity_only_transfer']; 139 | $array['justification_transfer'] = $data['justification_transfer']; 140 | $array['allow_transfer'] = $data['allow_transfer']; 141 | $array['keep_category'] = $data['keep_category']; 142 | $array['itilcategories_id'] = $data['itilcategories_id']; 143 | } 144 | 145 | return $array; 146 | } 147 | 148 | public static function addScript() 149 | { 150 | echo Html::script("/plugins/transferticketentity/js/entitySettings.js"); 151 | } 152 | 153 | /** 154 | * Display the ticket transfer form 155 | * 156 | * @return void 157 | */ 158 | public function showFormMcv($ID) 159 | { 160 | $checkRights = self::checkRights($ID); 161 | $theServer = explode("front/entity.form.php?",$_SERVER["HTTP_REFERER"]); 162 | $theServer = $theServer[0]; 163 | $availableCategories = self::availableCategories(); 164 | 165 | if(empty($checkRights)) { 166 | $checkRights['allow_entity_only_transfer'] = 0; 167 | $checkRights['justification_transfer'] = 0; 168 | $checkRights['allow_transfer'] = 0; 169 | $checkRights['keep_category'] = 0; 170 | $checkRights['itilcategories_id'] = null; 171 | } 172 | 173 | echo "
"; 174 | 175 | if ($canedit = Session::haveRightsOr(self::$rightname, [CREATE, UPDATE, PURGE])) { 176 | echo "
"; 177 | } 178 | 179 | echo ""; 180 | echo ""; 181 | echo ""; 182 | echo ""; 185 | echo ""; 186 | echo ""; 187 | echo ""; 193 | echo ""; 194 | echo ""; 195 | echo ""; 201 | echo ""; 202 | echo ""; 203 | echo ""; 209 | echo ""; 210 | echo ""; 211 | echo ""; 217 | echo ""; 218 | echo ""; 219 | echo ""; 225 | echo ""; 226 | echo ""; 227 | echo "
"; 183 | echo __("Settings Transfer Ticket Entity", "transferticketentity"); 184 | echo "
"; 188 | echo __('Allow Transfer function', 'transferticketentity'); 189 | echo " "; 190 | echo " "; 191 | echo Dropdown::showYesNo('allow_transfer', $checkRights['allow_transfer'], -1, ['display' => false, 'class' => 'allow_transfer']); 192 | echo "
"; 196 | echo __('Assigned group required', 'transferticketentity'); 197 | echo " "; 198 | echo " "; 199 | echo Dropdown::showYesNo('allow_entity_only_transfer', $checkRights['allow_entity_only_transfer'], -1, ['display' => false]); 200 | echo "
"; 204 | echo __('Justification required', 'transferticketentity'); 205 | echo " "; 206 | echo " "; 207 | echo Dropdown::showYesNo('justification_transfer', $checkRights['justification_transfer'], -1, ['display' => false]); 208 | echo "
"; 212 | echo __('Keep category after transfer', 'transferticketentity'); 213 | echo " "; 214 | echo " "; 215 | echo Dropdown::showYesNo('keep_category', $checkRights['keep_category'], -1, ['display' => false]); 216 | echo "
"; 220 | echo __('Default category', 'transferticketentity'); 221 | echo " "; 222 | echo " "; 223 | Dropdown::showFromArray('itilcategories_id', $availableCategories, ['value' => $checkRights['itilcategories_id'], 'class' => 'itilcategories_id']); 224 | echo "
"; 228 | echo Html::hidden("theServer", ["value" => "$theServer"]); 229 | echo Html::hidden("ID", ["value" => "$ID"]); 230 | 231 | if ($canedit) { 232 | echo "
"; 233 | echo Html::hidden('id', ['value' => $ID]); 234 | echo Html::submit(_sx('button', 'Save'), ['name' => 'transfertticket', 'class' => 'btn btn-primary']); 235 | echo "
\n"; 236 | Html::closeForm(); 237 | } 238 | 239 | echo "
"; 240 | 241 | self::addScript(); 242 | } 243 | } -------------------------------------------------------------------------------- /inc/profile.class.php: -------------------------------------------------------------------------------- 1 | . 21 | 22 | @category Ticket 23 | @package Transferticketentity 24 | @author Yannick Comba 25 | @copyright 2015-2023 Département de Maine et Loire plugin team 26 | @license AGPL License 3.0 or (at your option) any later version 27 | https://www.gnu.org/licenses/gpl-3.0.html 28 | @link https://github.com/departement-maine-et-loire/ 29 | -------------------------------------------------------------------------- 30 | */ 31 | 32 | if (!defined('GLPI_ROOT')) { 33 | die("Sorry. You can't access directly to this file"); 34 | } 35 | 36 | class PluginTransferticketentityProfile extends Profile 37 | { 38 | static $rightname = "profile"; 39 | 40 | static function getAllRights() { 41 | $rights = [ 42 | ['itemtype' => 'PluginTransferTicketEntityUse', 43 | 'label' => __('Authorized entity transfer', 'transferticketentity'), 44 | 'field' => 'plugin_transferticketentity_use', 45 | 'rights' => [ALLSTANDARDRIGHT => __('Active', 'transferticketentity')]], 46 | ['itemtype' => 'PluginTransferTicketEntityBypass', 47 | 'label' => __('Transfer authorized without assignment of technician or associated group', 'transferticketentity'), 48 | 'field' => 'plugin_transferticketentity_bypass', 49 | 'rights' => [ALLSTANDARDRIGHT => __('Active', 'transferticketentity')]] 50 | ]; 51 | 52 | return $rights; 53 | } 54 | 55 | function cleanProfiles($ID) 56 | { 57 | global $DB; 58 | 59 | $query = "DELETE FROM `glpi_profiles` 60 | WHERE `profiles_id`='$ID' 61 | AND `name` LIKE '%plugin_transferticketentity%'"; 62 | 63 | $DB->query($query); 64 | } 65 | 66 | /** 67 | * Add an additional tab 68 | * 69 | * @param object $item Ticket 70 | * @param int $withtemplate 0 71 | * 72 | * @return nametab 73 | */ 74 | public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) 75 | { 76 | if ($item->getType() == 'Profile') { 77 | return __("Transfer Ticket Entity", "transferticketentity"); 78 | } 79 | 80 | return ''; 81 | } 82 | 83 | /** 84 | * Get profiles authorised to use entity transfer 85 | * 86 | * @return array $allProfiles 87 | */ 88 | public static function canUseProfiles() 89 | { 90 | global $DB; 91 | 92 | $result = $DB->request([ 93 | 'SELECT' => ['profiles_id'], 94 | 'FROM' => 'glpi_profilerights', 95 | 'WHERE' => ['name' => 'plugin_transferticketentity_use', 'NOT' => ['rights' => 0]], 96 | 'ORDER' => 'name ASC' 97 | ]); 98 | 99 | $array = array(); 100 | 101 | foreach($result as $data){ 102 | array_push($array, $data['profiles_id']); 103 | } 104 | 105 | return $array; 106 | } 107 | 108 | /** 109 | * If we are on profiles, an additional tab is displayed 110 | * 111 | * @param object $item Ticket 112 | * @param int $tabnum 1 113 | * @param int $withtemplate 0 114 | * 115 | * @return true 116 | */ 117 | public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) 118 | { 119 | if ($item->getType() == 'Profile') { 120 | $profile = new self(); 121 | $ID = $item->getField('id'); 122 | 123 | $profile->showFormMcv($ID); 124 | } 125 | 126 | return true; 127 | } 128 | 129 | /** 130 | * @param $profile 131 | **/ 132 | static function addDefaultProfileInfos($profiles_id, $rights) 133 | { 134 | $profileRight = new ProfileRight(); 135 | 136 | foreach ($rights as $right => $value) { 137 | if (!countElementsInTable( 138 | 'glpi_profilerights', 139 | ['profiles_id' => $profiles_id, 'name' => $right] 140 | )) { 141 | $myright['profiles_id'] = $profiles_id; 142 | $myright['name'] = $right; 143 | $myright['rights'] = $value; 144 | $profileRight->add($myright); 145 | 146 | //Add right to the current session 147 | $_SESSION['glpiactiveprofile'][$right] = $value; 148 | } 149 | } 150 | } 151 | 152 | /** 153 | * @param $ID integer 154 | */ 155 | static function createFirstAccess($profiles_id) 156 | { 157 | include_once Plugin::getPhpDir('transferticketentity')."/inc/profile.class.php"; 158 | 159 | foreach (self::getAllRights() as $right) { 160 | self::addDefaultProfileInfos( 161 | $profiles_id, 162 | ['plugin_transferticketentity_use' => ALLSTANDARDRIGHT] 163 | ); 164 | } 165 | } 166 | 167 | public static function addScript() 168 | { 169 | echo Html::script("/plugins/transferticketentity/js/profileSettings.js"); 170 | } 171 | 172 | /** 173 | * Display the plugin configuration form 174 | * 175 | * @param int $ID id 176 | * 177 | * @return void 178 | */ 179 | public function showFormMcv($ID) 180 | { 181 | echo "
"; 182 | 183 | if ($canedit = Session::haveRightsOr(self::$rightname, [CREATE, UPDATE, PURGE])) { 184 | $profile = new Profile(); 185 | echo ""; 186 | } 187 | 188 | $profile = new Profile(); 189 | $profile->getFromDB($ID); 190 | 191 | $rights = self::getAllRights(); 192 | 193 | $profile->displayRightsChoiceMatrix( 194 | $rights, 195 | [ 196 | 'canedit' => $canedit, 197 | 'default_class' => 'tab_bg_2', 198 | 'title' => __('General') 199 | ] 200 | ); 201 | 202 | if ($canedit) { 203 | echo "
"; 204 | echo Html::hidden('id', ['value' => $ID]); 205 | echo Html::submit(_sx('button', 'Save'), ['name' => 'update', 'class' => 'btn btn-primary']); 206 | echo "
\n"; 207 | Html::closeForm(); 208 | } 209 | 210 | echo "
"; 211 | 212 | self::addScript(); 213 | } 214 | } -------------------------------------------------------------------------------- /inc/ticket.class.php: -------------------------------------------------------------------------------- 1 | . 21 | 22 | @category Ticket 23 | @package Transferticketentity 24 | @author Yannick Comba 25 | @copyright 2015-2023 Département de Maine et Loire plugin team 26 | @license AGPL License 3.0 or (at your option) any later version 27 | https://www.gnu.org/licenses/gpl-3.0.html 28 | @link https://github.com/departement-maine-et-loire/ 29 | -------------------------------------------------------------------------- 30 | */ 31 | 32 | if (!defined('GLPI_ROOT')) { 33 | die("Sorry. You can't access directly to this file"); 34 | } 35 | 36 | class PluginTransferticketentityTicket extends Ticket 37 | { 38 | /** 39 | * If the profile is authorised, add an extra tab 40 | * 41 | * @param object $item Ticket 42 | * @param int $withtemplate 0 43 | * 44 | * @return "Entity ticket transfer" 45 | */ 46 | public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) 47 | { 48 | $checkProfiles = PluginTransferticketentityProfile::canUseProfiles(); 49 | 50 | if (in_array($_SESSION['glpiactiveprofile']['id'], $checkProfiles)) { 51 | if ($item->getType() == 'Ticket') { 52 | return __("Transfer Ticket Entity", "transferticketentity"); 53 | } 54 | return ''; 55 | } 56 | } 57 | 58 | /** 59 | * Give the ticket entity 60 | * 61 | * @return $data 62 | */ 63 | public function getTicketEntity() 64 | { 65 | global $DB; 66 | 67 | $id_ticket = $_REQUEST['id']; 68 | 69 | $result = $DB->request([ 70 | 'SELECT' => ['glpi_entities.id', 'glpi_entities.name'], 71 | 'FROM' => 'glpi_tickets', 72 | 'LEFT JOIN' => ['glpi_entities' => ['FKEY' => ['glpi_tickets' => 'entities_id', 73 | 'glpi_entities' => 'id']]], 74 | 'WHERE' => ['glpi_tickets.id' => $id_ticket] 75 | ]); 76 | 77 | $array = array(); 78 | 79 | foreach($result as $data){ 80 | array_push($array, $data['id'], $data['name']); 81 | } 82 | 83 | return $array; 84 | } 85 | 86 | /** 87 | * Check that the ticket is not closed 88 | * 89 | * @return $data 90 | */ 91 | public function checkTicket() 92 | { 93 | global $DB; 94 | 95 | $id_ticket = $_REQUEST['id']; 96 | 97 | $result = $DB->request([ 98 | 'SELECT' => 'id', 99 | 'FROM' => 'glpi_tickets', 100 | 'WHERE' => ['status' => 6] 101 | ]); 102 | 103 | $array = array(); 104 | 105 | foreach($result as $data){ 106 | array_push($array, $data['id']); 107 | } 108 | 109 | if(!in_array($id_ticket, $array)) { 110 | return true; 111 | } else { 112 | return false; 113 | } 114 | } 115 | 116 | /** 117 | * Get the group assigned to the ticket 118 | * 119 | * @return $data 120 | */ 121 | public function getTicketGroup() 122 | { 123 | global $DB; 124 | 125 | $id_ticket = $_REQUEST['id']; 126 | 127 | $result = $DB->request([ 128 | 'FROM' => 'glpi_groups_tickets', 129 | 'WHERE' => ['tickets_id' => $id_ticket, 'type' => 2] 130 | ]); 131 | 132 | $array = array(); 133 | 134 | foreach($result as $data){ 135 | array_push($array, $data['groups_id']); 136 | } 137 | 138 | return $array; 139 | } 140 | 141 | /** 142 | * Get all the entities which aren't the current entity with their rights 143 | * 144 | * @return array 145 | */ 146 | public function getEntitiesRights() 147 | { 148 | global $DB; 149 | 150 | $getTicketEntity = self::getTicketEntity(); 151 | $theEntity = $getTicketEntity[0]; 152 | 153 | $result = $DB->request([ 154 | 'SELECT' => ['E.id', 'E.entities_id', 'E.name', 'TES.allow_entity_only_transfer', 'TES.justification_transfer', 'TES.allow_transfer'], 155 | 'FROM' => 'glpi_entities AS E', 156 | 'LEFT JOIN' => ['glpi_plugin_transferticketentity_entities_settings AS TES' => ['FKEY' => ['E' => 'id', 157 | 'TES' => 'entities_id']]], 158 | 'WHERE' => ['NOT' => ['E.id' => $theEntity]], 159 | 'GROUPBY' => 'E.id', 160 | 'ORDER' => 'E.entities_id ASC' 161 | ]); 162 | 163 | $array = array(); 164 | $temp_array = array(); 165 | 166 | foreach($result as $data){ 167 | $temp_array['id'] = $data['id']; 168 | $temp_array['entities_id'] = $data['entities_id']; 169 | $temp_array['name'] = $data['name']; 170 | $temp_array['allow_entity_only_transfer'] = $data['allow_entity_only_transfer']; 171 | $temp_array['justification_transfer'] = $data['justification_transfer']; 172 | $temp_array['allow_transfer'] = $data['allow_transfer']; 173 | array_push($array, $temp_array); 174 | } 175 | 176 | return $array; 177 | } 178 | 179 | /** 180 | * Get the groups to which tickets can be assigned 181 | * 182 | * @return array $allGroupsEntities 183 | */ 184 | public function getGroupEntities() 185 | { 186 | global $DB; 187 | 188 | $result = $DB->request([ 189 | 'FROM' => 'glpi_groups', 190 | 'WHERE' => ['is_assign' => 1], 191 | 'ORDER' => ['entities_id ASC', 'id ASC'] 192 | ]); 193 | 194 | $array = array(); 195 | 196 | foreach($result as $data){ 197 | array_push( 198 | $array, $data['id'], 199 | $data['entities_id'], $data['name'] 200 | ); 201 | } 202 | 203 | return $array; 204 | } 205 | 206 | /** 207 | * If we are on tickets, an additional tab is displayed 208 | * 209 | * @param object $item Ticket 210 | * @param int $tabnum 1 211 | * @param int $withtemplate 0 212 | * 213 | * @return true 214 | */ 215 | public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) 216 | { 217 | if ($item->getType() == 'Ticket') { 218 | $profile = new self(); 219 | $ID = $item->getField('id'); 220 | $profile->showFormMcv($ID); 221 | } 222 | 223 | return true; 224 | } 225 | 226 | public static function addStyleSheetAndScript() 227 | { 228 | echo Html::css("/plugins/transferticketentity/css/style.css"); 229 | echo Html::script("/plugins/transferticketentity/js/script.js"); 230 | } 231 | 232 | /** 233 | * Return parent's entity name 234 | * 235 | * @return string 236 | */ 237 | public function searchParentEntityName($id) 238 | { 239 | global $DB; 240 | 241 | $result = $DB->request([ 242 | 'FROM' => 'glpi_entities', 243 | ]); 244 | 245 | foreach ($result as $subArray) { 246 | if ($subArray['id'] == $id) { 247 | return $subArray['completename']; 248 | } 249 | } 250 | } 251 | 252 | /** 253 | * Display the ticket transfer form 254 | * 255 | * @return void 256 | */ 257 | public function showFormMcv() 258 | { 259 | global $CFG_GLPI; 260 | global $DB; 261 | 262 | $getGroupEntities = self::getGroupEntities(); 263 | $getEntitiesRights = self::getEntitiesRights(); 264 | 265 | $technician_profile = $_SESSION['glpiactiveprofile']['id']; 266 | 267 | $getAllEntities = array(); 268 | 269 | foreach ($getEntitiesRights as $entity) { 270 | if ($entity['allow_transfer'] == 1) { 271 | array_push($getAllEntities, $entity['entities_id'], $entity['id'], $entity['name']); 272 | } 273 | } 274 | 275 | if (!Session::haveRight('ticket', UPDATE)) { 276 | self::addStyleSheetAndScript(); 277 | echo "
"; 278 | echo "

". 279 | __("You don't have right to update tickets. Please contact your administrator.", "transferticketentity") 280 | ."

"; 281 | echo "
"; 282 | 283 | return false; 284 | } 285 | 286 | if (empty($getAllEntities)) { 287 | self::addStyleSheetAndScript(); 288 | echo "
"; 289 | echo "

". 290 | __("No entity available found, transfer impossible.", "transferticketentity") 291 | ."

"; 292 | echo "
"; 293 | 294 | return false; 295 | } 296 | 297 | $theServer = explode("front/profile.form.php?",$_SERVER["HTTP_REFERER"]); 298 | $theServer = $theServer[0]; 299 | 300 | $id_ticket = $_REQUEST['id']; 301 | 302 | $id_user = $_SESSION["glpiID"]; 303 | $checkTicket = self::checkTicket(); 304 | 305 | // Check if ticket is closed 306 | if ($checkTicket == false) { 307 | self::addStyleSheetAndScript(); 308 | echo "
"; 309 | echo "

". 310 | __("Unauthorized transfer on closed ticket.", "transferticketentity") 311 | ."

"; 312 | echo "
"; 313 | 314 | return false; 315 | } 316 | 317 | // In case JS is not functionnal 318 | echo "
"; 319 | echo ""; 320 | echo "
"; 321 | 322 | $previousEntity = null; 323 | 324 | echo" 325 | 326 |
327 | 328 | 349 |
"; 350 | 351 | echo "
" . 352 | __("No group found with « Assigned to » right while a group is required. Transfer impossible.", "transferticketentity") 353 | . "
"; 354 | 355 | echo"
356 |
357 | 358 | 365 | 366 |
"; 367 | echo Html::submit(__('Confirm', 'transferticketentity'), ['disabled' => true, 'id' => 'tt_btn_open_modal_form']); 368 | echo"
369 |
"; 370 | 371 | echo Html::hidden("technician_profile", ["value" => "$technician_profile"]); 372 | echo Html::hidden("id_ticket", ["value" => "$id_ticket"]); 373 | echo Html::hidden("id_user", ["value" => "$id_user"]); 374 | echo Html::hidden("theServer", ["value" => "$theServer"]); 375 | 376 | echo " 377 |
378 | 379 | 380 |

".__("Confirm transfer ?", "transferticketentity")."

381 |

".__("Once the transfer has been completed, the ticket will remain visible only if you have the required rights.", "transferticketentity")."

382 |
383 | 384 | 385 |
386 |

".__("Warning, category will be reset if it does not exist in the target entity.", "transferticketentity")."

387 | 388 |
"; 389 | echo Html::submit(__('Cancel'), ['name' => 'canceltransfert', 'id' => 'canceltransfert']); 390 | echo Html::submit(__('Confirm', 'transferticketentity'), ['name' => 'transfertticket', 'id' => 'transfertticket']); 391 | echo"
392 |
"; 393 | Html::closeForm(); 394 | self::addStyleSheetAndScript(); 395 | self::javascriptTranslate(); 396 | } 397 | 398 | /** 399 | * Translate text added with JavaScript 400 | * 401 | * @return $js 402 | */ 403 | public function javascriptTranslate() 404 | { 405 | $addText = __('optional', 'transferticketentity'); 406 | 407 | $jsPluginTTE = " 408 | $.ajax({ 409 | url: CFG_GLPI.root_doc + '/' + GLPI_PLUGINS_PATH.transferticketentity + '/ajax/getEntitiesRights.php', 410 | method: 'GET', 411 | success: function (data) { 412 | data = JSON.parse(data); 413 | 414 | if (document.querySelector('.tt_entity_choice') != null) { 415 | let explainText = document.getElementById('justification').previousElementSibling.innerHTML; 416 | 417 | $('#entity_choice').on('change', function (event) { 418 | let entityRights = data.filter(e => e.entities_id == entity_choice.value) 419 | let justificationRight = entityRights[0]['justification_transfer'] 420 | let addText = ''; 421 | 422 | if (justificationRight == 1) { 423 | addText = ':' 424 | document.getElementById('justification').previousElementSibling.innerHTML = explainText + addText; 425 | } else { 426 | addText = '($addText)' + ' :' 427 | document.getElementById('justification').previousElementSibling.innerHTML = explainText + addText; 428 | } 429 | }) 430 | } 431 | }, 432 | error: function (data) { 433 | console.log(data); 434 | } 435 | }); 436 | "; 437 | 438 | echo Html::scriptBlock($jsPluginTTE); 439 | } 440 | } -------------------------------------------------------------------------------- /js/entitySettings.js: -------------------------------------------------------------------------------- 1 | function displayValue() { 2 | if (document.querySelector('.allow_transfer').value == 0) { 3 | document.querySelector('#allow_entity_only_transfer').style.display = 'none' 4 | document.querySelector('#allow_entity_only_transfer').firstChild.childNodes[1][0].selected = true 5 | document.querySelector('#justification_transfer').style.display = 'none' 6 | document.querySelector('#justification_transfer').firstChild.childNodes[1][0].selected = true 7 | document.querySelector('#keep_category').style.display = 'none' 8 | document.querySelector('#keep_category').firstChild.childNodes[1][0].selected = true 9 | document.querySelector('#itilcategories_id').style.display = 'none' 10 | } else { 11 | document.querySelector('#allow_entity_only_transfer').style.display = '' 12 | document.querySelector('#justification_transfer').style.display = '' 13 | document.querySelector('#keep_category').style.display = '' 14 | if (document.querySelector('#keep_category').firstChild.childNodes[1][0].selected) { 15 | document.querySelector('#itilcategories_id').style.display = '' 16 | } else { 17 | document.querySelector('#itilcategories_id').style.display = 'none' 18 | } 19 | } 20 | } 21 | 22 | displayValue(); 23 | 24 | $('.transferticketentity').on('change', function(event) { 25 | displayValue(); 26 | }) -------------------------------------------------------------------------------- /js/profileSettings.js: -------------------------------------------------------------------------------- 1 | let activeRight = document.getElementsByName('_plugin_transferticketentity_use[31_0]')[1]; 2 | let bypassRight = document.getElementsByName('_plugin_transferticketentity_bypass[31_0]')[1]; 3 | 4 | activeRight.addEventListener('click', function(event) { 5 | if (!activeRight.checked) { 6 | bypassRight.checked = false; 7 | } 8 | }) 9 | 10 | bypassRight.addEventListener('click', function(event) { 11 | if (bypassRight.checked) { 12 | activeRight.checked = true; 13 | } 14 | }) -------------------------------------------------------------------------------- /js/script.js: -------------------------------------------------------------------------------- 1 | $.ajax({ 2 | url: CFG_GLPI.root_doc + '/' + GLPI_PLUGINS_PATH.transferticketentity + '/ajax/getEntitiesRights.php', 3 | method: "GET", 4 | success: function (data) { 5 | data = JSON.parse(data); 6 | 7 | // Check if the form is there 8 | if (document.querySelector('.tt_entity_choice') != null) { 9 | $('#entity_choice').select2(); 10 | $('#group_choice').select2(); 11 | 12 | document.querySelector('#tt_gest_error').style.display='none'; 13 | document.querySelector('.form_transfert').style.display='block'; 14 | document.querySelector('#nogroupfound').style.display = 'none'; 15 | 16 | let entity_choice = document.querySelector('#entity_choice') 17 | let tt_group_choice = document.querySelector('.tt_group_choice') 18 | let tt_btn_open_modal_form = document.querySelector('#tt_btn_open_modal_form') 19 | 20 | const clone_all_groups = document.querySelectorAll('#group_choice option') 21 | let all_groups = [] 22 | 23 | // Remove all groups not chosen 24 | let all_groups_unchoice = document.querySelectorAll('#group_choice option') 25 | all_groups_unchoice.forEach(function(all_group_unchoice) { 26 | all_group_unchoice.remove() 27 | }) 28 | 29 | $('#entity_choice').on('change', function (event) { 30 | // if value is empty, hide groups 31 | if (entity_choice.value == '') { 32 | tt_group_choice.style.display = 'none' 33 | tt_btn_open_modal_form.disabled = true 34 | tt_btn_open_modal_form.style.backgroundColor = '#D3D3D3' 35 | tt_btn_open_modal_form.style.color = '#FFFFFF' 36 | tt_btn_open_modal_form.style.cursor = 'not-allowed' 37 | } else { 38 | // if not, show them 39 | tt_group_choice.style.display = 'flex' 40 | document.querySelector('#div_confirmation').style.display = 'block' 41 | tt_btn_open_modal_form.disabled = true 42 | tt_btn_open_modal_form.style.backgroundColor = '#D3D3D3' 43 | tt_btn_open_modal_form.style.color = '#FFFFFF' 44 | tt_btn_open_modal_form.style.cursor = 'not-allowed' 45 | } 46 | }) 47 | 48 | $('#entity_choice').on('change', function (event) { 49 | all_groups = [] 50 | all_groups = clone_all_groups 51 | 52 | // Field is required or not depending on given rights 53 | let entityRights = data.filter(e => e.entities_id == entity_choice.value) 54 | let justificationRight = entityRights[0]['justification_transfer'] 55 | let groupRight = entityRights[0]['allow_entity_only_transfer'] 56 | let categoryRight = entityRights[0]['keep_category'] 57 | 58 | if (categoryRight) { 59 | document.querySelector('.adv-msg').style.display=''; 60 | } else { 61 | document.querySelector('.adv-msg').style.display='none'; 62 | } 63 | 64 | if (justificationRight == 1) { 65 | document.querySelector('#justification').required = true; 66 | } else { 67 | document.querySelector('#justification').required = false; 68 | } 69 | 70 | all_groups.forEach(function(all_group) { 71 | if (groupRight == 1 && all_group.id != 'tt_none') { 72 | all_group.remove(); 73 | } 74 | // Add groups of selected entity 75 | if ('tt_plugin_entity_' + entity_choice.value == all_group.className || all_group.value == '') { 76 | if (groupRight == 1 && all_group.id != 'tt_none') { 77 | document.querySelector('#group_choice').appendChild(all_group) 78 | } else if (groupRight == 0) { 79 | document.querySelector('#group_choice').appendChild(all_group) 80 | } else { 81 | all_group.remove(); 82 | } 83 | } else { 84 | // Delete previous groups 85 | all_group.remove() 86 | } 87 | }) 88 | 89 | if (groupRight == 0) { 90 | document.querySelector('#nogroupfound').style.display = 'none'; 91 | document.querySelector('.tt_flex').style.display = ''; 92 | } else { 93 | if (document.querySelector('#group_choice')[1].id == 'tt_none'){ 94 | document.querySelector('#nogroupfound').style.display = ''; 95 | document.querySelector('.tt_flex').style.display = 'none'; 96 | } 97 | } 98 | 99 | // if another entity is chosen, reset the selected group 100 | document.querySelector('#no_select').selected = true 101 | }) 102 | 103 | $('#group_choice').on('change', function (event) { 104 | // if no group selected, disable the confirm button 105 | if(document.querySelector('#no_select') !== null) { 106 | if (document.querySelector('#no_select').selected == true) { 107 | tt_btn_open_modal_form.disabled = true 108 | tt_btn_open_modal_form.style.backgroundColor = '#D3D3D3' 109 | tt_btn_open_modal_form.style.color = '#FFFFFF' 110 | tt_btn_open_modal_form.style.cursor = 'not-allowed' 111 | } else { 112 | // else, enable it 113 | tt_btn_open_modal_form.disabled = false 114 | tt_btn_open_modal_form.style.backgroundColor = '#80cead' 115 | tt_btn_open_modal_form.style.color = '#1e293b' 116 | tt_btn_open_modal_form.style.cursor = 'pointer' 117 | } 118 | } 119 | }) 120 | 121 | let modal_form_adder = document.getElementById('tt_modal_form_adder') 122 | 123 | // Open modal 124 | document.querySelector('#canceltransfert').addEventListener('click', function(event){ 125 | event.preventDefault() 126 | modal_form_adder.close(); 127 | }); 128 | 129 | // Close modal 130 | tt_btn_open_modal_form.addEventListener('click', function(event){ 131 | event.preventDefault() 132 | modal_form_adder.showModal(); 133 | }); 134 | } 135 | }, 136 | error: function (data) { 137 | console.log(data); 138 | } 139 | }); -------------------------------------------------------------------------------- /locales/en_GB.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Departement-de-Maine-et-Loire/transferticketentity/671bf72686ca0723250f4f9153a69bec837b08cd/locales/en_GB.mo -------------------------------------------------------------------------------- /locales/en_GB.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | # Yannick Comba , 2022 7 | # Yannick Comba, 2022,2023 8 | # Département de Maine et Loire 9 | msgid "" 10 | msgstr "" 11 | "Project-Id-Version: GLPI Plugin - admincolor\n" 12 | "Report-Msgid-Bugs-To: \n" 13 | "POT-Creation-Date: 2022-10-24 09:03+0000\n" 14 | "PO-Revision-Date: 2024-04-08 11:12+0200\n" 15 | "Last-Translator: Yannick Comba, 2022,2023\n" 16 | "Language-Team: English (United Kingdom) (Département de Maine et Loire)\n" 17 | "Language: en_GB\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 22 | "X-Generator: Poedit 3.3.2\n" 23 | 24 | #: inc/profile.class.php:74 inc/ticket.class.php:48 25 | msgid "Transfer Ticket Entity" 26 | msgstr "Transfer Ticket Entity" 27 | 28 | #: inc/profile.class.php:74 29 | msgid "Change rights" 30 | msgstr "Change rights" 31 | 32 | #: inc/profile.class.php:77 33 | msgid "Authorized entity transfer" 34 | msgstr "Authorized entity transfer" 35 | 36 | #: inc/profile.class.php:89 37 | msgid "Save" 38 | msgstr "Save" 39 | 40 | #: inc/profile.php:50 inc/profile.php:63 41 | msgid "Item successfully updated" 42 | msgstr "Item successfully updated" 43 | 44 | #: inc/ticket.class.php:210 45 | msgid "Error, please reload the page." 46 | msgstr "Error, please reload the page." 47 | 48 | #: inc/ticket.class.php:211 49 | msgid "If the problem persists, you can try to empty the cache by doing CTRL + F5." 50 | msgstr "If the problem persists, you can try to empty the cache by doing CTRL + F5." 51 | 52 | #: inc/ticket.class.php:216 53 | msgid "Select ticket entity to transfer" 54 | msgstr "Select ticket entity to transfer" 55 | 56 | #: inc/ticket.class.php:218 57 | msgid "Choose your entity" 58 | msgstr "Choose your entity" 59 | 60 | #: inc/ticket.class.php:227 61 | msgid "Select the group to assign" 62 | msgstr "Select the group to assign" 63 | 64 | #: inc/ticket.class.php:229 65 | msgid "Choose your group" 66 | msgstr "Choose your group" 67 | 68 | #: inc/ticket.class.php:250 69 | msgid "Confirm transfer ?" 70 | msgstr "Confirm transfer ?" 71 | 72 | #: inc/ticket.class.php:251 73 | msgid "Once the transfer has been completed, the ticket will remain visible only if you have the required rights." 74 | msgstr "Once the transfer has been completed, the ticket will remain visible only if you have the required rights." 75 | 76 | #: inc/ticket.class.php:252 77 | msgid "Cancel" 78 | msgstr "Cancel" 79 | 80 | #: inc/ticket.class.php:253 inc/ticket.class.php:244 81 | msgid "Confirm" 82 | msgstr "Confirm" 83 | 84 | #: front/ticket.form.php:125 85 | msgid "Please select a valid entity" 86 | msgstr "Please select a valid entity" 87 | 88 | #: front/ticket.form.php:135 89 | msgid "Please select a valid group" 90 | msgstr "Please select a valid group" 91 | 92 | #: front/ticket.form.php:181 93 | msgid "Escalation to" 94 | msgstr "Escalation to" 95 | 96 | #: front/ticket.form.php:181 97 | msgid "in the group" 98 | msgstr "in the group" 99 | 100 | #: front/ticket.form.php:185 101 | msgid "Successful transfer for ticket n° : " 102 | msgstr "Successful transfer for ticket n° : " 103 | 104 | #: front/ticket.form.php:197 105 | msgid "Transfer canceled" 106 | msgstr "Transfer canceled" 107 | 108 | #: inc/ticket.class.php:266 109 | msgid "Unauthorized transfer on closed ticket." 110 | msgstr "Unauthorized transfer on closed ticket." 111 | 112 | #: inc/ticket.class.php:436 front/ticket.form.php:357 113 | msgid "Please explain your transfer" 114 | msgstr "Please explain your transfer" 115 | 116 | #: front/ticket.form.php:266 117 | msgid "You must be assigned to the ticket to be able to transfer it" 118 | msgstr "You must be assigned to the ticket to be able to transfer it" 119 | 120 | #: inc/ticket.class.php:239 121 | msgid "No entity available found, transfer impossible." 122 | msgstr "No entity available found, transfer impossible." 123 | 124 | #: inc/ticket.class.php:305 125 | msgid "None" 126 | msgstr "None" 127 | 128 | #: inc/entity.class.php:118 129 | msgid "Settings Transfer Ticket Entity" 130 | msgstr "Settings Transfer Ticket Entity" 131 | 132 | #: inc/entity.class.php:123 133 | msgid "Assigned group required" 134 | msgstr "Assigned group required" 135 | 136 | #: inc/entity.class.php:130 137 | msgid "Justification required" 138 | msgstr "Justification required" 139 | 140 | #: inc/entity.class.php:137 141 | msgid "Allow Transfer function" 142 | msgstr "Allow Transfer function" 143 | 144 | #: inc/ticket.class.php:322 145 | msgid "No previous entity" 146 | msgstr "No previous entity" 147 | 148 | #: inc/ticket.class.php:342 149 | msgid "No group found with « Assigned to » right while a group is required. Transfer impossible." 150 | msgstr "No group found with « Assigned to » right while a group is required. Transfer impossible." 151 | 152 | #: inc/profile.class.php:45 153 | msgid "Active" 154 | msgstr "Active" 155 | 156 | #: inc/profile.class.php:47 157 | msgid "Transfer authorized without assignment of technician or associated group" 158 | msgstr "Transfer authorized without assignment of technician or associated group" 159 | 160 | #: inc/entity.class.php:153 161 | msgid "Keep category after transfer" 162 | msgstr "Keep category after transfer" 163 | 164 | #: inc/ticket.class.php:448 165 | msgid "Warning, category will be reset if it does not exist in the target entity." 166 | msgstr "Warning, category will be reset if it does not exist in the target entity." 167 | 168 | #: inc/ticket.class.php:303 169 | msgid "You don't have right to update tickets. Please contact your administrator." 170 | msgstr "You don't have right to update tickets. Please contact your administrator." 171 | 172 | #: inc/ticket.class.php:405 173 | msgid "optional" 174 | msgstr "optional" 175 | 176 | #: inc/entity.class.php:219 177 | msgid "Default category" 178 | msgstr "Default category" 179 | 180 | #: front/ticket.form.php:266 181 | msgid "Category will be set to null but its configured as mandatory in GLPIs template, please contact your administrator." 182 | msgstr "Category will be set to null but its configured as mandatory in GLPIs template, please contact your administrator." 183 | -------------------------------------------------------------------------------- /locales/es_VE.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Departement-de-Maine-et-Loire/transferticketentity/671bf72686ca0723250f4f9153a69bec837b08cd/locales/es_VE.mo -------------------------------------------------------------------------------- /locales/es_VE.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | # Yannick Comba , 2022 7 | # Yannick Comba, 2022,2023 8 | # Département de Maine et Loire 9 | msgid "" 10 | msgstr "" 11 | "Project-Id-Version: GLPI Plugin - admincolor\n" 12 | "Report-Msgid-Bugs-To: \n" 13 | "POT-Creation-Date: 2022-10-24 09:03+0000\n" 14 | "PO-Revision-Date: 2024-04-16 17:54-0400\n" 15 | "Last-Translator: \n" 16 | "Language-Team: English (United Kingdom) (Département de Maine et Loire)\n" 17 | "Language: es_VE\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 22 | "X-Generator: Poedit 3.0.1\n" 23 | 24 | #: inc/profile.class.php:74 inc/ticket.class.php:48 25 | msgid "Transfer Ticket Entity" 26 | msgstr "Transferir Caso a Entidad" 27 | 28 | #: inc/profile.class.php:74 29 | msgid "Change rights" 30 | msgstr "Cambiar derechos" 31 | 32 | #: inc/profile.class.php:77 33 | msgid "Authorized entity transfer" 34 | msgstr "Transferencia de entidad autorizada" 35 | 36 | #: inc/profile.class.php:89 37 | msgid "Save" 38 | msgstr "Guardar" 39 | 40 | #: inc/profile.php:50 inc/profile.php:63 41 | msgid "Item successfully updated" 42 | msgstr "Elemento actualizado exitosamente" 43 | 44 | #: inc/ticket.class.php:210 45 | msgid "Error, please reload the page." 46 | msgstr "Error, por favor recarga la página." 47 | 48 | #: inc/ticket.class.php:211 49 | msgid "" 50 | "If the problem persists, you can try to empty the cache by doing CTRL + F5." 51 | msgstr "" 52 | "Si el problema persiste, puedes intentar vaciar el caché presionando CTRL + " 53 | "F5." 54 | 55 | #: inc/ticket.class.php:216 56 | msgid "Select ticket entity to transfer" 57 | msgstr "Seleccione la entidad del caso para transferir" 58 | 59 | #: inc/ticket.class.php:218 60 | msgid "Choose your entity" 61 | msgstr "Elige tu entidad" 62 | 63 | #: inc/ticket.class.php:227 64 | msgid "Select the group to assign" 65 | msgstr "Seleccione el grupo a asignar" 66 | 67 | #: inc/ticket.class.php:229 68 | msgid "Choose your group" 69 | msgstr "Elige tu grupo" 70 | 71 | #: inc/ticket.class.php:250 72 | msgid "Confirm transfer ?" 73 | msgstr "¿Confirmar transferencia?" 74 | 75 | #: inc/ticket.class.php:251 76 | msgid "" 77 | "Once the transfer has been completed, the ticket will remain visible only if " 78 | "you have the required rights." 79 | msgstr "" 80 | "Una vez completada la transferencia, el caso permanecerá visible sólo si " 81 | "tienes los derechos requeridos." 82 | 83 | #: inc/ticket.class.php:252 84 | msgid "Cancel" 85 | msgstr "Anular" 86 | 87 | #: inc/ticket.class.php:253 inc/ticket.class.php:244 88 | msgid "Confirm" 89 | msgstr "Confirmar" 90 | 91 | #: front/ticket.form.php:125 92 | msgid "Please select a valid entity" 93 | msgstr "Por favor seleccione una entidad válida" 94 | 95 | #: front/ticket.form.php:135 96 | msgid "Please select a valid group" 97 | msgstr "Por favor seleccione un grupo válido" 98 | 99 | #: front/ticket.form.php:181 100 | msgid "Escalation to" 101 | msgstr "Escalamiento a" 102 | 103 | #: front/ticket.form.php:181 104 | msgid "in the group" 105 | msgstr "en el grupo" 106 | 107 | #: front/ticket.form.php:185 108 | msgid "Successful transfer for ticket n° : " 109 | msgstr "Transferencia exitosa para el caso n°: " 110 | 111 | #: front/ticket.form.php:197 112 | msgid "Transfer canceled" 113 | msgstr "Transferencia cancelada" 114 | 115 | #: inc/ticket.class.php:266 116 | msgid "Unauthorized transfer on closed ticket." 117 | msgstr "Traslado no autorizado en caso cerrado." 118 | 119 | #: inc/ticket.class.php:436 front/ticket.form.php:357 120 | msgid "Please explain your transfer" 121 | msgstr "Por favor explica tu transferencia" 122 | 123 | #: front/ticket.form.php:266 124 | msgid "You must be assigned to the ticket to be able to transfer it" 125 | msgstr "Debes estar asignado al caso para poder transferirlo" 126 | 127 | #: inc/ticket.class.php:239 128 | msgid "No entity available found, transfer impossible." 129 | msgstr "No se encontró ninguna entidad disponible, transferencia imposible." 130 | 131 | #: inc/ticket.class.php:305 132 | msgid "None" 133 | msgstr "Ninguno" 134 | 135 | #: inc/entity.class.php:118 136 | msgid "Settings Transfer Ticket Entity" 137 | msgstr "Configuración de entidad de caso de transferencia" 138 | 139 | #: inc/entity.class.php:123 140 | msgid "Assigned group required" 141 | msgstr "Se requiere grupo asignado" 142 | 143 | #: inc/entity.class.php:130 144 | msgid "Justification required" 145 | msgstr "Justificación requerida" 146 | 147 | #: inc/entity.class.php:137 148 | msgid "Allow Transfer function" 149 | msgstr "Permitir función de transferencia" 150 | 151 | #: inc/ticket.class.php:322 152 | msgid "No previous entity" 153 | msgstr "Ninguna entidad previa" 154 | 155 | #: inc/ticket.class.php:342 156 | msgid "" 157 | "No group found with « Assigned to » right while a group is required. " 158 | "Transfer impossible." 159 | msgstr "" 160 | "No se encontró ningún grupo con el derecho «Asignado a» mientras se requiere " 161 | "un grupo. Transferencia imposible." 162 | 163 | #: inc/profile.class.php:45 164 | msgid "Active" 165 | msgstr "Activo" 166 | 167 | #: inc/profile.class.php:47 168 | msgid "" 169 | "Transfer authorized without assignment of technician or associated group" 170 | msgstr "Traspaso autorizado sin asignación de técnico o grupo asociado" 171 | 172 | #: inc/entity.class.php:153 173 | msgid "Keep category after transfer" 174 | msgstr "Mantener categoría después de la transferencia" 175 | 176 | #: inc/ticket.class.php:448 177 | msgid "" 178 | "Warning, category will be reset if it does not exist in the target entity." 179 | msgstr "" 180 | "Advertencia, la categoría se restablecerá si no existe en la entidad de " 181 | "destino." 182 | 183 | #: inc/ticket.class.php:303 184 | msgid "" 185 | "You don't have right to update tickets. Please contact your administrator." 186 | msgstr "" 187 | "No tienes derecho a actualizar casos. Por favor contacte a su administrador." 188 | 189 | #: inc/ticket.class.php:405 190 | msgid "optional" 191 | msgstr "opcional" 192 | 193 | #: inc/entity.class.php:219 194 | msgid "Default category" 195 | msgstr "Categoría predeterminada" 196 | 197 | #: front/ticket.form.php:266 198 | msgid "" 199 | "Category will be set to null but its configured as mandatory in GLPIs " 200 | "template, please contact your administrator." 201 | msgstr "" 202 | "La categoría se establecerá como nula pero está configurada como obligatoria " 203 | "en la plantilla GLPI; comuníquese con su administrador." 204 | -------------------------------------------------------------------------------- /locales/fr.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Departement-de-Maine-et-Loire/transferticketentity/671bf72686ca0723250f4f9153a69bec837b08cd/locales/fr.mo -------------------------------------------------------------------------------- /locales/fr.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | # Nickyo0822, 2024 7 | # 8 | # 9 | # Département de Maine et Loire 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI Plugin - transferticketentity\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2022-10-24 09:03+0000\n" 15 | "PO-Revision-Date: 2024-04-17 11:32+0200\n" 16 | "Last-Translator: Nickyo0822, 2024\n" 17 | "Language-Team: French (https://app.transifex.com/departement-de-maine-et-" 18 | "loire/teams/190752/fr/)\n" 19 | "Language: fr\n" 20 | "MIME-Version: 1.0\n" 21 | "Content-Type: text/plain; charset=UTF-8\n" 22 | "Content-Transfer-Encoding: 8bit\n" 23 | "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " 24 | "1000000 == 0 ? 1 : 2;\n" 25 | "X-Generator: Poedit 3.3.2\n" 26 | 27 | #: inc/profile.class.php:74 inc/ticket.class.php:48 28 | msgid "Transfer Ticket Entity" 29 | msgstr "Transfert d'entité" 30 | 31 | #: inc/profile.class.php:74 32 | msgid "Change rights" 33 | msgstr "Modifier les droits" 34 | 35 | #: inc/profile.class.php:77 36 | msgid "Authorized entity transfer" 37 | msgstr "Transfert d'entité autorisé" 38 | 39 | #: inc/profile.class.php:89 40 | msgid "Save" 41 | msgstr "Sauvegarder" 42 | 43 | #: inc/profile.php:50 inc/profile.php:63 44 | msgid "Item successfully updated" 45 | msgstr "Élément modifié" 46 | 47 | #: inc/ticket.class.php:210 48 | msgid "Error, please reload the page." 49 | msgstr "Erreur, veuillez recharger la page." 50 | 51 | #: inc/ticket.class.php:211 52 | msgid "" 53 | "If the problem persists, you can try to empty the cache by doing CTRL + F5." 54 | msgstr "" 55 | "Si le problème persiste, vous pouvez tenter de vider le cache en faisant " 56 | "CTRL + F5." 57 | 58 | #: inc/ticket.class.php:216 59 | msgid "Select ticket entity to transfer" 60 | msgstr "Sélectionnez l'entité vers laquelle migrer le ticket" 61 | 62 | #: inc/ticket.class.php:218 63 | msgid "Choose your entity" 64 | msgstr "Choisissez votre entité" 65 | 66 | #: inc/ticket.class.php:227 67 | msgid "Select the group to assign" 68 | msgstr "Sélectionnez le groupe à assigner" 69 | 70 | #: inc/ticket.class.php:229 71 | msgid "Choose your group" 72 | msgstr "Choisissez votre groupe" 73 | 74 | #: inc/ticket.class.php:250 75 | msgid "Confirm transfer ?" 76 | msgstr "Confirmer le transfert ?" 77 | 78 | #: inc/ticket.class.php:251 79 | msgid "" 80 | "Once the transfer has been completed, the ticket will remain visible only " 81 | "if you have the required rights." 82 | msgstr "" 83 | "Une fois le transfert effectué, le ticket restera visible uniquement si " 84 | "vous avez les droits requis." 85 | 86 | #: inc/ticket.class.php:252 87 | msgid "Cancel" 88 | msgstr "Annuler" 89 | 90 | #: inc/ticket.class.php:253 inc/ticket.class.php:244 91 | msgid "Confirm" 92 | msgstr "Confirmer" 93 | 94 | #: front/ticket.form.php:125 95 | msgid "Please select a valid entity" 96 | msgstr "Veuillez sélectionner une entité valide" 97 | 98 | #: front/ticket.form.php:135 99 | msgid "Please select a valid group" 100 | msgstr "Veuillez sélectionner un groupe valide" 101 | 102 | #: front/ticket.form.php:181 103 | msgid "Escalation to" 104 | msgstr "Escalade vers" 105 | 106 | #: front/ticket.form.php:181 107 | msgid "in the group" 108 | msgstr "dans le groupe" 109 | 110 | #: front/ticket.form.php:185 111 | msgid "Successful transfer for ticket n° : " 112 | msgstr "Transfert réussi pour le ticket n° : " 113 | 114 | #: front/ticket.form.php:197 115 | msgid "Transfer canceled" 116 | msgstr "Transfert annulé" 117 | 118 | #: inc/ticket.class.php:266 119 | msgid "Unauthorized transfer on closed ticket." 120 | msgstr "Transfert non autorisé sur ticket clos." 121 | 122 | #: inc/ticket.class.php:436 front/ticket.form.php:357 123 | msgid "Please explain your transfer" 124 | msgstr "Veuillez expliquer la raison de votre transfert" 125 | 126 | #: front/ticket.form.php:266 127 | msgid "You must be assigned to the ticket to be able to transfer it" 128 | msgstr "" 129 | "Vous devez être assigné sur le ticket ou être membre du groupe assigné pour " 130 | "être autorisé à le transférer" 131 | 132 | #: inc/ticket.class.php:239 133 | msgid "No entity available found, transfer impossible." 134 | msgstr "Aucune entité disponible trouvée, transfert impossible." 135 | 136 | #: inc/ticket.class.php:305 137 | msgid "None" 138 | msgstr "Aucun" 139 | 140 | #: inc/entity.class.php:118 141 | msgid "Settings Transfer Ticket Entity" 142 | msgstr "Paramètres Transfert d'entité" 143 | 144 | #: inc/entity.class.php:123 145 | msgid "Assigned group required" 146 | msgstr "Groupe à assigner obligatoire" 147 | 148 | #: inc/entity.class.php:130 149 | msgid "Justification required" 150 | msgstr "Justification obligatoire" 151 | 152 | #: inc/entity.class.php:137 153 | msgid "Allow Transfer function" 154 | msgstr "Autoriser la fonction Transfert" 155 | 156 | #: inc/ticket.class.php:322 157 | msgid "No previous entity" 158 | msgstr "Pas de précédente entité" 159 | 160 | #: inc/ticket.class.php:342 161 | msgid "" 162 | "No group found with « Assigned to » right while a group is required. " 163 | "Transfer impossible." 164 | msgstr "" 165 | "Aucun groupe avec le droit « Assigné à » n'a été trouvé alors qu'un groupe " 166 | "est requit. Transfert impossible." 167 | 168 | #: inc/profile.class.php:45 169 | msgid "Active" 170 | msgstr "Actif" 171 | 172 | #: inc/profile.class.php:47 173 | msgid "" 174 | "Transfer authorized without assignment of technician or associated group" 175 | msgstr "Transfert autorisé sans affectation du technicien ou groupe associé" 176 | 177 | #: inc/entity.class.php:153 178 | msgid "Keep category after transfer" 179 | msgstr "Catégorie à conserver après le transfert" 180 | 181 | #: inc/ticket.class.php:448 182 | msgid "" 183 | "Warning, category will be reset if it does not exist in the target entity." 184 | msgstr "" 185 | "Attention, la catégorie sera remise à nulle si non existante dans l'entité " 186 | "cible." 187 | 188 | #: inc/ticket.class.php:303 189 | msgid "" 190 | "You don't have right to update tickets. Please contact your administrator." 191 | msgstr "" 192 | "Vous n'avez pas le droit de mettre à jour les tickets. Veuillez contacter " 193 | "votre administrateur." 194 | 195 | #: inc/ticket.class.php:405 196 | msgid "optional" 197 | msgstr "facultatif" 198 | 199 | #: inc/entity.class.php:219 200 | msgid "Default category" 201 | msgstr "Catégorie par défaut" 202 | 203 | #: front/ticket.form.php:266 204 | msgid "" 205 | "Category will be set to null but its configured as mandatory in GLPIs " 206 | "template, please contact your administrator." 207 | msgstr "" 208 | "La catégorie va être remise à null mais est configurée comme obligatoire " 209 | "dans les templates de GLPI, veuillez contacter votre administrateur." 210 | -------------------------------------------------------------------------------- /locales/fr_FR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Departement-de-Maine-et-Loire/transferticketentity/671bf72686ca0723250f4f9153a69bec837b08cd/locales/fr_FR.mo -------------------------------------------------------------------------------- /locales/fr_FR.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | # Yannick Comba , 2022 7 | # Yannick Comba, 2022,2023 8 | # Département de Maine et Loire 9 | msgid "" 10 | msgstr "" 11 | "Project-Id-Version: GLPI Plugin - Entity Ticket Transfer\n" 12 | "Report-Msgid-Bugs-To: \n" 13 | "POT-Creation-Date: 2022-10-24 09:03+0000\n" 14 | "PO-Revision-Date: 2024-04-08 11:12+0200\n" 15 | "Last-Translator: Yannick Comba, 2022,2023\n" 16 | "Language-Team: French (France) (Département de Maine et Loire)\n" 17 | "Language: fr_FR\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 22 | "X-Generator: Poedit 3.3.2\n" 23 | 24 | #: inc/profile.class.php:74 inc/ticket.class.php:48 25 | msgid "Transfer Ticket Entity" 26 | msgstr "Transfert d'entité" 27 | 28 | #: inc/profile.class.php:74 29 | msgid "Change rights" 30 | msgstr "Modifier les droits" 31 | 32 | #: inc/profile.class.php:77 33 | msgid "Authorized entity transfer" 34 | msgstr "Transfert d'entité autorisé" 35 | 36 | #: inc/profile.class.php:89 37 | msgid "Save" 38 | msgstr "Sauvegarder" 39 | 40 | #: inc/profile.php:50 inc/profile.php:63 41 | msgid "Item successfully updated" 42 | msgstr "Élément modifié" 43 | 44 | #: inc/ticket.class.php:210 45 | msgid "Error, please reload the page." 46 | msgstr "Erreur, veuillez recharger la page." 47 | 48 | #: inc/ticket.class.php:211 49 | msgid "If the problem persists, you can try to empty the cache by doing CTRL + F5." 50 | msgstr "Si le problème persiste, vous pouvez tenter de vider le cache en faisant CTRL + F5." 51 | 52 | #: inc/ticket.class.php:216 53 | msgid "Select ticket entity to transfer" 54 | msgstr "Sélectionnez l'entité vers laquelle migrer le ticket" 55 | 56 | #: inc/ticket.class.php:218 57 | msgid "Choose your entity" 58 | msgstr "Choisissez votre entité" 59 | 60 | #: inc/ticket.class.php:227 61 | msgid "Select the group to assign" 62 | msgstr "Sélectionnez le groupe à assigner" 63 | 64 | #: inc/ticket.class.php:229 65 | msgid "Choose your group" 66 | msgstr "Choisissez votre groupe" 67 | 68 | #: inc/ticket.class.php:250 69 | msgid "Confirm transfer ?" 70 | msgstr "Confirmer le transfert ?" 71 | 72 | #: inc/ticket.class.php:251 73 | msgid "Once the transfer has been completed, the ticket will remain visible only if you have the required rights." 74 | msgstr "Une fois le transfert effectué, le ticket restera visible uniquement si vous avez les droits requis." 75 | 76 | #: inc/ticket.class.php:252 77 | msgid "Cancel" 78 | msgstr "Annuler" 79 | 80 | #: inc/ticket.class.php:253 inc/ticket.class.php:244 81 | msgid "Confirm" 82 | msgstr "Confirmer" 83 | 84 | #: front/ticket.form.php:125 85 | msgid "Please select a valid entity" 86 | msgstr "Veuillez sélectionner une entité valide" 87 | 88 | #: front/ticket.form.php:135 89 | msgid "Please select a valid group" 90 | msgstr "Veuillez sélectionner un groupe valide" 91 | 92 | #: front/ticket.form.php:181 93 | msgid "Escalation to" 94 | msgstr "Escalade vers" 95 | 96 | #: front/ticket.form.php:181 97 | msgid "in the group" 98 | msgstr "dans le groupe" 99 | 100 | #: front/ticket.form.php:185 101 | msgid "Successful transfer for ticket n° : " 102 | msgstr "Transfert réussi pour le ticket n° : " 103 | 104 | #: front/ticket.form.php:197 105 | msgid "Transfer canceled" 106 | msgstr "Transfert annulé" 107 | 108 | #: inc/ticket.class.php:266 109 | msgid "Unauthorized transfer on closed ticket." 110 | msgstr "Transfert non autorisé sur ticket clos." 111 | 112 | #: inc/ticket.class.php:436 front/ticket.form.php:357 113 | msgid "Please explain your transfer" 114 | msgstr "Veuillez expliquer la raison de votre transfert" 115 | 116 | #: front/ticket.form.php:266 117 | msgid "You must be assigned to the ticket to be able to transfer it" 118 | msgstr "Vous devez être assigné sur le ticket ou être membre du groupe assigné pour être autorisé à le transférer" 119 | 120 | #: inc/ticket.class.php:239 121 | msgid "No entity available found, transfer impossible." 122 | msgstr "Aucune entité disponible trouvée, transfert impossible." 123 | 124 | #: inc/ticket.class.php:305 125 | msgid "None" 126 | msgstr "Aucun" 127 | 128 | #: inc/entity.class.php:118 129 | msgid "Settings Transfer Ticket Entity" 130 | msgstr "Paramètres Transfert d'entité" 131 | 132 | #: inc/entity.class.php:123 133 | msgid "Assigned group required" 134 | msgstr "Groupe à assigner obligatoire" 135 | 136 | #: inc/entity.class.php:130 137 | msgid "Justification required" 138 | msgstr "Justification obligatoire" 139 | 140 | #: inc/entity.class.php:137 141 | msgid "Allow Transfer function" 142 | msgstr "Autoriser la fonction Transfert" 143 | 144 | #: inc/ticket.class.php:322 145 | msgid "No previous entity" 146 | msgstr "Pas de précédente entité" 147 | 148 | #: inc/ticket.class.php:342 149 | msgid "No group found with « Assigned to » right while a group is required. Transfer impossible." 150 | msgstr "Aucun groupe avec le droit « Assigné à » n'a été trouvé alors qu'un groupe est requit. Transfert impossible." 151 | 152 | #: inc/profile.class.php:45 153 | msgid "Active" 154 | msgstr "Actif" 155 | 156 | #: inc/profile.class.php:47 157 | msgid "Transfer authorized without assignment of technician or associated group" 158 | msgstr "Transfert autorisé sans affectation du technicien ou groupe associé" 159 | 160 | #: inc/entity.class.php:153 161 | msgid "Keep category after transfer" 162 | msgstr "Catégorie à conserver après le transfert" 163 | 164 | #: inc/ticket.class.php:448 165 | msgid "Warning, category will be reset if it does not exist in the target entity." 166 | msgstr "Attention, la catégorie sera remise à nulle si non existante dans l'entité cible." 167 | 168 | #: inc/ticket.class.php:303 169 | msgid "You don't have right to update tickets. Please contact your administrator." 170 | msgstr "Vous n'avez pas le droit de mettre à jour les tickets. Veuillez contacter votre administrateur." 171 | 172 | #: inc/ticket.class.php:405 173 | msgid "optional" 174 | msgstr "facultatif" 175 | 176 | #: inc/entity.class.php:219 177 | msgid "Default category" 178 | msgstr "Catégorie par défaut" 179 | 180 | #: front/ticket.form.php:266 181 | msgid "Category will be set to null but its configured as mandatory in GLPIs template, please contact your administrator." 182 | msgstr "La catégorie va être remise à null mais est configurée comme obligatoire dans les templates de GLPI, veuillez contacter votre administrateur." 183 | -------------------------------------------------------------------------------- /locales/pt_BR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Departement-de-Maine-et-Loire/transferticketentity/671bf72686ca0723250f4f9153a69bec837b08cd/locales/pt_BR.mo -------------------------------------------------------------------------------- /locales/pt_BR.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | # Yannick Comba , 2022 7 | # Yannick Comba, 2022,2023 8 | # Département de Maine et Loire 9 | msgid "" 10 | msgstr "" 11 | "Project-Id-Version: GLPI Plugin - Transfer Ticket Entity\n" 12 | "Report-Msgid-Bugs-To: \n" 13 | "POT-Creation-Date: 2022-10-24 09:03+0000\n" 14 | "PO-Revision-Date: 2024-02-22 15:22-0300\n" 15 | "Last-Translator: Yannick Comba, 2022,2023\n" 16 | "Language-Team: Portuguese (Brasil)\n" 17 | "Language: pt_BR\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 22 | "X-Generator: Poedit 3.4.2\n" 23 | 24 | #: inc/profile.class.php:74 inc/ticket.class.php:48 25 | msgid "Transfer Ticket Entity" 26 | msgstr "Transferência de Entidade do Ticket" 27 | 28 | #: inc/profile.class.php:74 29 | msgid "Change rights" 30 | msgstr "Mudar permissões" 31 | 32 | #: inc/profile.class.php:77 33 | msgid "Using entity transfer" 34 | msgstr "Usando transferência de entidade" 35 | 36 | #: inc/profile.class.php:89 37 | msgid "Save" 38 | msgstr "Salvar" 39 | 40 | #: inc/profile.php:50 inc/profile.php:63 41 | msgid "Item successfully updated" 42 | msgstr "Item atualizado com sucesso" 43 | 44 | #: inc/ticket.class.php:210 45 | msgid "Error, please reload the page." 46 | msgstr "Erro, por favor atualizar a página." 47 | 48 | #: inc/ticket.class.php:211 49 | msgid "If the problem persists, you can try to empty the cache by doing CTRL + F5." 50 | msgstr "Se o problema persistir, você pode tentar esvaziar o cache através das teclas CTRL + F5." 51 | 52 | #: inc/ticket.class.php:216 53 | msgid "Select ticket entity to transfer" 54 | msgstr "Select ticket entity to transfer" 55 | 56 | #: inc/ticket.class.php:218 57 | msgid "Choose your entity" 58 | msgstr "Escolha sua entidade" 59 | 60 | #: inc/ticket.class.php:227 61 | msgid "Select the group to assign" 62 | msgstr "Selecione o grupo para atribuir" 63 | 64 | #: inc/ticket.class.php:229 65 | msgid "Choose your group" 66 | msgstr "Escolha seu grupo" 67 | 68 | #: inc/ticket.class.php:250 69 | msgid "Confirm transfer ?" 70 | msgstr "Conformar transferência?" 71 | 72 | #: inc/ticket.class.php:251 73 | msgid "Once the transfer has been completed, the ticket will remain visible only if you have the required rights." 74 | msgstr "Uma vez que a transferência tiver sido completa, o ticket será visível somente se você tiver as permissões corretas." 75 | 76 | #: inc/ticket.class.php:252 77 | msgid "Cancel" 78 | msgstr "Cancelar" 79 | 80 | #: inc/ticket.class.php:253 inc/ticket.class.php:244 81 | msgid "Confirm" 82 | msgstr "Confirmar" 83 | 84 | #: inc/ticket.php:125 85 | msgid "Please select a valid entity" 86 | msgstr "Por favor selecione uma entidade válida" 87 | 88 | #: inc/ticket.php:135 89 | msgid "Please select a valid group" 90 | msgstr "Por favor selecione um grupo válido" 91 | 92 | #: inc/ticket.php:181 93 | msgid "Escalation to" 94 | msgstr "Escalação para" 95 | 96 | #: inc/ticket.php:181 97 | msgid "in the group" 98 | msgstr "no grupo" 99 | 100 | #: inc/ticket.php:185 101 | msgid "Successful transfer for ticket n° : " 102 | msgstr "Transferência feita com sucesso para o ticket n° : " 103 | 104 | #: inc/ticket.php:197 105 | msgid "Transfer canceled" 106 | msgstr "Transferência cancelada" 107 | 108 | #: inc/ticket.class.php:266 109 | msgid "Unauthorized transfer on closed ticket." 110 | msgstr "Não é possível transferir um ticket cujo status é fechado." 111 | 112 | #: inc/ticket.class.php:436 inc/ticket.php:357 113 | msgid "Please explain your transfer" 114 | msgstr "Por favor apresentar mais dados sobre sua transferência" 115 | 116 | #: inc/ticket.php:266 117 | msgid "You must be assigned to the ticket to be able to transfer it" 118 | msgstr "Você precisa estar atribuído ao ticket para ser capaz de transferi-lo" 119 | -------------------------------------------------------------------------------- /locales/pt_PT.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Departement-de-Maine-et-Loire/transferticketentity/671bf72686ca0723250f4f9153a69bec837b08cd/locales/pt_PT.mo -------------------------------------------------------------------------------- /locales/pt_PT.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | # Département MaineEtLoire, 2024 7 | # 8 | # 9 | # Département de Maine et Loire 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI Plugin - transferticketentity\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2022-10-24 09:03+0000\n" 15 | "PO-Revision-Date: 2024-04-17 11:42+0200\n" 16 | "Last-Translator: Département MaineEtLoire, 2024\n" 17 | "Language-Team: Portuguese (Portugal) (https://app.transifex.com/departement-" 18 | "de-maine-et-loire/teams/190752/pt_PT/)\n" 19 | "Language: pt_PT\n" 20 | "MIME-Version: 1.0\n" 21 | "Content-Type: text/plain; charset=UTF-8\n" 22 | "Content-Transfer-Encoding: 8bit\n" 23 | "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " 24 | "1000000 == 0 ? 1 : 2;\n" 25 | "X-Generator: Poedit 3.3.2\n" 26 | 27 | #: inc/profile.class.php:74 inc/ticket.class.php:48 28 | msgid "Transfer Ticket Entity" 29 | msgstr "Transferência de Entidade do Ticket" 30 | 31 | #: inc/profile.class.php:74 32 | msgid "Change rights" 33 | msgstr "Mudar permissões" 34 | 35 | #: inc/profile.class.php:77 36 | msgid "Authorized entity transfer" 37 | msgstr "Permitir a transferência de entidade" 38 | 39 | #: inc/profile.class.php:89 40 | msgid "Save" 41 | msgstr "Gravar" 42 | 43 | #: inc/profile.php:50 inc/profile.php:63 44 | msgid "Item successfully updated" 45 | msgstr "Item atualizado com sucesso" 46 | 47 | #: inc/ticket.class.php:210 48 | msgid "Error, please reload the page." 49 | msgstr "Erro. Por favor, atualize a página." 50 | 51 | #: inc/ticket.class.php:211 52 | msgid "" 53 | "If the problem persists, you can try to empty the cache by doing CTRL + F5." 54 | msgstr "" 55 | "Caso o problema persista, pode tentar limpar a cache pressionando as teclas " 56 | "CTRL + F5." 57 | 58 | #: inc/ticket.class.php:216 59 | msgid "Select ticket entity to transfer" 60 | msgstr "Selecione a entidade para transferir o ticket" 61 | 62 | #: inc/ticket.class.php:218 63 | msgid "Choose your entity" 64 | msgstr "Escolha a sua entidade" 65 | 66 | #: inc/ticket.class.php:227 67 | msgid "Select the group to assign" 68 | msgstr "Selecione o grupo a atribuir" 69 | 70 | #: inc/ticket.class.php:229 71 | msgid "Choose your group" 72 | msgstr "Escolha o grupo" 73 | 74 | #: inc/ticket.class.php:250 75 | msgid "Confirm transfer ?" 76 | msgstr "Confirmar a transferência?" 77 | 78 | #: inc/ticket.class.php:251 79 | msgid "" 80 | "Once the transfer has been completed, the ticket will remain visible only " 81 | "if you have the required rights." 82 | msgstr "" 83 | "Quando a transferência for concluída, o ticket apenas ficará visível caso " 84 | "tenha as permissões necessárias." 85 | 86 | #: inc/ticket.class.php:252 87 | msgid "Cancel" 88 | msgstr "Cancelar" 89 | 90 | #: inc/ticket.class.php:253 inc/ticket.class.php:244 91 | msgid "Confirm" 92 | msgstr "Confirmar" 93 | 94 | #: front/ticket.form.php:125 95 | msgid "Please select a valid entity" 96 | msgstr "Selecione por favor uma entidade válida" 97 | 98 | #: front/ticket.form.php:135 99 | msgid "Please select a valid group" 100 | msgstr "Selecione por favor um grupo válido" 101 | 102 | #: front/ticket.form.php:181 103 | msgid "Escalation to" 104 | msgstr "Escalar para" 105 | 106 | #: front/ticket.form.php:181 107 | msgid "in the group" 108 | msgstr "no grupo" 109 | 110 | #: front/ticket.form.php:185 111 | msgid "Successful transfer for ticket n° : " 112 | msgstr "Transferência com sucesso para o ticket n° : " 113 | 114 | #: front/ticket.form.php:197 115 | msgid "Transfer canceled" 116 | msgstr "Transferência cancelada" 117 | 118 | #: inc/ticket.class.php:266 119 | msgid "Unauthorized transfer on closed ticket." 120 | msgstr "Não é permitido transferir tickets fechados." 121 | 122 | #: inc/ticket.class.php:436 front/ticket.form.php:357 123 | msgid "Please explain your transfer" 124 | msgstr "Justificação para a transferência" 125 | 126 | #: front/ticket.form.php:266 127 | msgid "You must be assigned to the ticket to be able to transfer it" 128 | msgstr "" 129 | "Para conseguir transferir o ticket, terá de estar atribuído como técnico" 130 | 131 | #: inc/ticket.class.php:239 132 | msgid "No entity available found, transfer impossible." 133 | msgstr "" 134 | "Não é possível transferir, porque não foi encontrada nenhuma entidade." 135 | 136 | #: inc/ticket.class.php:305 137 | msgid "None" 138 | msgstr "Nenhum" 139 | 140 | #: inc/entity.class.php:118 141 | msgid "Settings Transfer Ticket Entity" 142 | msgstr "Definições para Transferir Ticket de Entidade" 143 | 144 | #: inc/entity.class.php:123 145 | msgid "Assigned group required" 146 | msgstr "É obrigatório atribuir a um grupo" 147 | 148 | #: inc/entity.class.php:130 149 | msgid "Justification required" 150 | msgstr "Obrigatório preencher justificação" 151 | 152 | #: inc/entity.class.php:137 153 | msgid "Allow Transfer function" 154 | msgstr "Permitir a funcionalidade de Transferência" 155 | 156 | #: inc/ticket.class.php:322 157 | msgid "No previous entity" 158 | msgstr "Nenhuma entidade anterior encontrada" 159 | 160 | #: inc/ticket.class.php:342 161 | msgid "" 162 | "No group found with « Assigned to » right while a group is required. " 163 | "Transfer impossible." 164 | msgstr "" 165 | "Nenhum grupo encontrado com permissão \"Atribuído a\", embora um grupo seja " 166 | "necessário. Transferência impossível." 167 | 168 | #: inc/profile.class.php:45 169 | msgid "Active" 170 | msgstr "Ativado" 171 | 172 | #: inc/profile.class.php:47 173 | msgid "" 174 | "Transfer authorized without assignment of technician or associated group" 175 | msgstr "" 176 | "Transferência autorizada sem a atribuição de um técnico ou grupo ao ticket" 177 | 178 | #: inc/entity.class.php:153 179 | msgid "Keep category after transfer" 180 | msgstr "Manter a categoria após a transferência" 181 | 182 | #: inc/ticket.class.php:448 183 | msgid "" 184 | "Warning, category will be reset if it does not exist in the target entity." 185 | msgstr "" 186 | "Aviso: Caso a categoria do ticket não exista na entidade de destino, a " 187 | "mesma será removida." 188 | 189 | #: inc/ticket.class.php:303 190 | msgid "" 191 | "You don't have right to update tickets. Please contact your administrator." 192 | msgstr "" 193 | "Não tem permissão para atualizar tickets. Por favor contacte o " 194 | "administrador." 195 | 196 | #: inc/ticket.class.php:405 197 | msgid "optional" 198 | msgstr "opcional" 199 | 200 | #: inc/entity.class.php:219 201 | msgid "Default category" 202 | msgstr "Categoria por omissão" 203 | 204 | #: front/ticket.form.php:266 205 | msgid "" 206 | "Category will be set to null but its configured as mandatory in GLPIs " 207 | "template, please contact your administrator." 208 | msgstr "" 209 | "A categoria ficará definida como nula, mas está configurada como " 210 | "obrigatória no modelo do GLPI. Entre em contato com o seu administrador." 211 | -------------------------------------------------------------------------------- /locales/transferticketentity.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | # 7 | # 8 | # Département de Maine et Loire 9 | msgid "" 10 | msgstr "" 11 | "Project-Id-Version: GLPI Plugin - transferticketentity\n" 12 | "Report-Msgid-Bugs-To: \n" 13 | "POT-Creation-Date: 2022-10-24 09:03+0000\n" 14 | "PO-Revision-Date: 2024-04-08 11:12+0200\n" 15 | "Last-Translator: \n" 16 | "Language-Team: \n" 17 | "Language: \n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 22 | "X-Generator: Poedit 3.3.2\n" 23 | 24 | #: inc/profile.class.php:74 inc/ticket.class.php:48 25 | msgid "Transfer Ticket Entity" 26 | msgstr "" 27 | 28 | #: inc/profile.class.php:74 29 | msgid "Change rights" 30 | msgstr "" 31 | 32 | #: inc/profile.class.php:77 33 | msgid "Authorized entity transfer" 34 | msgstr "" 35 | 36 | #: inc/profile.class.php:89 37 | msgid "Save" 38 | msgstr "" 39 | 40 | #: inc/profile.php:50 inc/profile.php:63 41 | msgid "Item successfully updated" 42 | msgstr "" 43 | 44 | #: inc/ticket.class.php:210 45 | msgid "Error, please reload the page." 46 | msgstr "" 47 | 48 | #: inc/ticket.class.php:211 49 | msgid "If the problem persists, you can try to empty the cache by doing CTRL + F5." 50 | msgstr "" 51 | 52 | #: inc/ticket.class.php:216 53 | msgid "Select ticket entity to transfer" 54 | msgstr "" 55 | 56 | #: inc/ticket.class.php:218 57 | msgid "Choose your entity" 58 | msgstr "" 59 | 60 | #: inc/ticket.class.php:227 61 | msgid "Select the group to assign" 62 | msgstr "" 63 | 64 | #: inc/ticket.class.php:229 65 | msgid "Choose your group" 66 | msgstr "" 67 | 68 | #: inc/ticket.class.php:250 69 | msgid "Confirm transfer ?" 70 | msgstr "" 71 | 72 | #: inc/ticket.class.php:251 73 | msgid "Once the transfer has been completed, the ticket will remain visible only if you have the required rights." 74 | msgstr "" 75 | 76 | #: inc/ticket.class.php:252 77 | msgid "Cancel" 78 | msgstr "" 79 | 80 | #: inc/ticket.class.php:253 inc/ticket.class.php:244 81 | msgid "Confirm" 82 | msgstr "" 83 | 84 | #: front/ticket.form.php:125 85 | msgid "Please select a valid entity" 86 | msgstr "" 87 | 88 | #: front/ticket.form.php:135 89 | msgid "Please select a valid group" 90 | msgstr "" 91 | 92 | #: front/ticket.form.php:181 93 | msgid "Escalation to" 94 | msgstr "" 95 | 96 | #: front/ticket.form.php:181 97 | msgid "in the group" 98 | msgstr "" 99 | 100 | #: front/ticket.form.php:185 101 | msgid "Successful transfer for ticket n° : " 102 | msgstr "" 103 | 104 | #: front/ticket.form.php:197 105 | msgid "Transfer canceled" 106 | msgstr "" 107 | 108 | #: inc/ticket.class.php:266 109 | msgid "Unauthorized transfer on closed ticket." 110 | msgstr "" 111 | 112 | #: inc/ticket.class.php:436 front/ticket.form.php:357 113 | msgid "Please explain your transfer" 114 | msgstr "" 115 | 116 | #: front/ticket.form.php:266 117 | msgid "You must be assigned to the ticket to be able to transfer it" 118 | msgstr "" 119 | 120 | #: inc/ticket.class.php:239 121 | msgid "No entity available found, transfer impossible." 122 | msgstr "" 123 | 124 | #: inc/ticket.class.php:305 125 | msgid "None" 126 | msgstr "" 127 | 128 | #: inc/entity.class.php:118 129 | msgid "Settings Transfer Ticket Entity" 130 | msgstr "" 131 | 132 | #: inc/entity.class.php:123 133 | msgid "Assigned group required" 134 | msgstr "" 135 | 136 | #: inc/entity.class.php:130 137 | msgid "Justification required" 138 | msgstr "" 139 | 140 | #: inc/entity.class.php:137 141 | msgid "Allow Transfer function" 142 | msgstr "" 143 | 144 | #: inc/ticket.class.php:322 145 | msgid "No previous entity" 146 | msgstr "" 147 | 148 | #: inc/ticket.class.php:342 149 | msgid "No group found with « Assigned to » right while a group is required. Transfer impossible." 150 | msgstr "" 151 | 152 | #: inc/profile.class.php:45 153 | msgid "Active" 154 | msgstr "" 155 | 156 | #: inc/profile.class.php:47 157 | msgid "Transfer authorized without assignment of technician or associated group" 158 | msgstr "" 159 | 160 | #: inc/entity.class.php:153 161 | msgid "Keep category after transfer" 162 | msgstr "" 163 | 164 | #: inc/ticket.class.php:448 165 | msgid "Warning, category will be reset if it does not exist in the target entity." 166 | msgstr "" 167 | 168 | #: inc/ticket.class.php:303 169 | msgid "You don't have right to update tickets. Please contact your administrator." 170 | msgstr "" 171 | 172 | #: inc/ticket.class.php:405 173 | msgid "optional" 174 | msgstr "" 175 | 176 | #: inc/entity.class.php:219 177 | msgid "Default category" 178 | msgstr "" 179 | 180 | #: front/ticket.form.php:266 181 | msgid "Category will be set to null but its configured as mandatory in GLPIs template, please contact your administrator." 182 | msgstr "" 183 | -------------------------------------------------------------------------------- /setup.php: -------------------------------------------------------------------------------- 1 | . 21 | 22 | @category Ticket 23 | @package Transferticketentity 24 | @author Yannick Comba 25 | @copyright 2015-2023 Département de Maine et Loire plugin team 26 | @license AGPL License 3.0 or (at your option) any later version 27 | https://www.gnu.org/licenses/gpl-3.0.html 28 | @link https://github.com/departement-maine-et-loire/ 29 | -------------------------------------------------------------------------- 30 | */ 31 | 32 | define('TRANSFERTICKETENTITY_VERSION', '1.1.3'); 33 | 34 | function plugin_init_transferticketentity() 35 | { 36 | global $PLUGIN_HOOKS; 37 | 38 | // Add a tab for profiles and tickets 39 | Plugin::registerClass('PluginTransferticketentityProfile', ['addtabon' => 'Profile']); 40 | Plugin::registerClass('PluginTransferticketentityTicket', ['addtabon' => 'Ticket']); 41 | Plugin::registerClass('PluginTransferticketentityEntity', ['addtabon' => 'Entity']); 42 | 43 | $PLUGIN_HOOKS['csrf_compliant']['transferticketentity'] = true; 44 | } 45 | 46 | function plugin_version_transferticketentity() 47 | { 48 | return [ 49 | 'name' => 'TransferTicketEntity', 50 | 'version' => TRANSFERTICKETENTITY_VERSION, 51 | 'author' => 'Yannick COMBA', 52 | 'license' => 'GPLv3+', 53 | 'homepage' => 'https://github.com/departement-maine-et-loire/', 54 | 'requirements' => [ 55 | 'glpi' => [ 56 | 'min' => '10.0' 57 | ] 58 | ] 59 | ]; 60 | } 61 | 62 | function plugin_transferticketentity_check_prerequisites() 63 | { 64 | $version = preg_replace('/^((\d+\.?)+).*$/', '$1', GLPI_VERSION); 65 | 66 | if (version_compare($version, '10.0', '<')) { 67 | echo "This plugin requires GLPI >= 10.0"; 68 | return false; 69 | } 70 | 71 | return true; 72 | } 73 | 74 | function plugin_transferticketentity_check_config($verbose = false) 75 | { 76 | if (true) { 77 | return true; 78 | } 79 | 80 | if ($verbose) { 81 | echo "Installed, but not configured"; 82 | } 83 | 84 | return false; 85 | } 86 | 87 | function plugin_transferticketentity_options() 88 | { 89 | return [ 90 | Plugin::OPTION_AUTOINSTALL_DISABLED => true, 91 | ]; 92 | } -------------------------------------------------------------------------------- /transferticketentity.xml: -------------------------------------------------------------------------------- 1 | 2 | Transfer Ticket Entity 3 | transferticketentity 4 | stable 5 | https://raw.githubusercontent.com/departement-maine-et-loire/transferticketentity/master/img/logo.png 6 | 7 | 8 | Ce plugin permet aux profils autorisés d'envoyer les tickets à une entité où ils n'ont aucun droit d'accès. 9 | This plugin allows authorized profiles to send tickets to an entity where they have no access rights. 10 | 11 | 12 | Ce plugin permet, pour les profils autorisés, de transférer des tickets d'une entité à une autre sur laquelle ils n'ont pas les accès. Il s'adresse aux organisations qui ont configurés, dans GLPI, leurs périmètres d'activités par entité (DRH, Comptabilité, SI, ...). L'intérêt étant de pouvoir transférer un ticket entre techniciens "GLPI" d'entités différentes et de continuer à assurer la confidentialité des données entre entités. 13 | This plugin enables authorized profiles to transfer tickets from one entity to another to which they do not have access. It is designed for organizations that have configured their GLPI activity perimeters by entity (HR, Accounting, IS, etc.). The aim is to be able to transfer a ticket between "GLPI" technicians from different entities, and to continue to ensure the confidentiality of data between entities. 14 | 15 | 16 | https://github.com/departement-maine-et-loire/transferticketentity 17 | https://github.com/departement-maine-et-loire/transferticketentity/releases 18 | https://github.com/departement-maine-et-loire/transferticketentity/issues 19 | https://raw.githubusercontent.com/departement-maine-et-loire/transferticketentity/master/README.md 20 | 21 | Département de Maine-et-Loire 22 | Yannick COMBA 23 | 24 | 25 | 26 | 1.1.3 27 | ~10.0.0 28 | 29 | 30 | 31 | fr_FR 32 | en_GB 33 | es_VE 34 | pt_BR 35 | 36 | 37 | 38 | 39 | Ticket 40 | 41 | 42 | Ticket 43 | 44 | 45 | 46 | https://raw.githubusercontent.com/departement-maine-et-loire/transferticketentity/master/img/gifs/TransferTicketEntity_EN.gif 47 | https://raw.githubusercontent.com/departement-maine-et-loire/transferticketentity/master/img/gifs/TransferTicketEntity_FR.gif 48 | 49 | 50 | -------------------------------------------------------------------------------- /transifex.yaml: -------------------------------------------------------------------------------- 1 | git: 2 | filters: 3 | - filter_type: file 4 | file_format: PO 5 | source_file: locales/transferticketentity.pot 6 | source_language: en 7 | translation_files_expression: 'locales/.po' --------------------------------------------------------------------------------