@@ -106,19 +106,19 @@ static function updateAttachment(){
106106 //on parcours les items linké
107107 while ($ row = $ res ->fetch_assoc ()) {
108108
109- $ itemType = $ row ['itemType ' ];
109+ $ itemType = $ row ['itemtype ' ];
110110
111111 //on créer l'objet Ticket
112112 $ item = new $ itemType ();
113- $ item ->getFromDB ($ row ['idTicket ' ]);
113+ $ item ->getFromDB ($ row ['items_id ' ]);
114114
115115 if ($ item ->fields ['status ' ] == 5 || $ item ->fields ['status ' ] == 6 ){
116- Toolbox::logInFile ("mantis " , "CRON MANTIS : " .$ itemType ." " .$ itemType ." " .$ row ['idTicket ' ]." is already solve or closed. " );
116+ Toolbox::logInFile ("mantis " , "CRON MANTIS : " .$ itemType ." " .$ itemType ." " .$ row ['items_id ' ]." is already solve or closed. " );
117117 }else {
118- Toolbox::logInFile ("mantis " , "CRON MANTIS : Checking " .$ itemType ." ticket " .$ row ['idTicket ' ].". " );
118+ Toolbox::logInFile ("mantis " , "CRON MANTIS : Checking " .$ itemType ." ticket " .$ row ['items_id ' ].". " );
119119
120120 //on recupere les lien entre le ticket glpi et les ticket mantis
121- $ list_link = self ::getLinkBetweenItemGlpiAndTicketMantis ($ row ['idTicket ' ],$ itemType );
121+ $ list_link = self ::getLinkBetweenItemGlpiAndTicketMantis ($ row ['items_id ' ],$ itemType );
122122
123123 //pour chaque lien glpi -> mantis
124124 while ($ line = $ list_link ->fetch_assoc ()){
@@ -129,7 +129,7 @@ static function updateAttachment(){
129129 $ attachmentsMantisBT = $ issue ->attachments ;
130130
131131 //on recupere les document de l'item
132- $ documents = self ::getDocumentFromItem ($ row ['idTicket ' ],$ itemType );
132+ $ documents = self ::getDocumentFromItem ($ row ['items_id ' ],$ itemType );
133133
134134 //pour chaque document
135135 foreach ($ documents as $ doc ){
@@ -197,21 +197,21 @@ static function updateTicket() {
197197
198198 while ($ row = $ res ->fetch_assoc ()) {
199199
200- $ itemType = $ row ['itemType ' ];
200+ $ itemType = $ row ['itemtype ' ];
201201 $ item = new $ itemType ();
202- $ item ->getFromDB ($ row ['idTicket ' ]);
202+ $ item ->getFromDB ($ row ['items_id ' ]);
203203
204- Toolbox::logInFile ("mantis " , "CRON MANTIS : Checking Glpi " .$ itemType ." " .$ row ['idTicket ' ].". " );
204+ Toolbox::logInFile ("mantis " , "CRON MANTIS : Checking Glpi " .$ itemType ." " .$ row ['items_id ' ].". " );
205205
206206 //si le ticket est deja resolus ou clos
207207 if ($ item ->fields ['status ' ] == 5 || $ item ->fields ['status ' ] == 6 ){
208208
209- Toolbox::logInFile ("mantis " , "CRON MANTIS : Glpi " .$ itemType ." " .$ row ['idTicket ' ]." is already solve or closed. " );
209+ Toolbox::logInFile ("mantis " , "CRON MANTIS : Glpi " .$ itemType ." " .$ row ['items_id ' ]." is already solve or closed. " );
210210
211211 }else {
212212
213213 //on recupere tout les tickets mantis lié
214- $ list_link = self ::getLinkBetweenItemGlpiAndTicketMantis ($ row ['idTicket ' ],$ itemType );
214+ $ list_link = self ::getLinkBetweenItemGlpiAndTicketMantis ($ row ['items_id ' ],$ itemType );
215215
216216 $ list_ticket_mantis = array ();
217217 while ($ line = $ list_link ->fetch_assoc ()){
@@ -230,7 +230,7 @@ static function updateTicket() {
230230 $ item ->fields ['solvedate ' ] = date ("Y-m-d " );
231231 $ item ->fields ['solution ' ] = $ info_solved ;
232232 $ item ->update ($ item ->fields );
233- Toolbox::logInFile ("mantis " , "CRON MANTIS : Update glpi " .$ row ['idTicket ' ]." status in BDD " );
233+ Toolbox::logInFile ("mantis " , "CRON MANTIS : Update glpi " .$ row ['items_id ' ]." status in BDD " );
234234
235235 }else {
236236 Toolbox::logInFile ("mantis " , "CRON MANTIS : All status MantisBT have not the same as status choice by user -> " .$ etat_mantis .". " );
@@ -336,9 +336,9 @@ private static function getAllSameStatusChoiceByUser($list_ticket_mantis,$status
336336 */
337337 private static function getItemWhichIsLinked () {
338338 global $ DB ;
339- return $ DB ->query ("SELECT `glpi_plugin_mantis_mantis`.`idTicket `,`glpi_plugin_mantis_mantis`.`itemType `
339+ return $ DB ->query ("SELECT `glpi_plugin_mantis_mantis`.`items_id `,`glpi_plugin_mantis_mantis`.`itemtype `
340340 FROM `glpi_plugin_mantis_mantis`
341- GROUP BY `glpi_plugin_mantis_mantis`.`idTicket `,`glpi_plugin_mantis_mantis`.`itemType ` " );
341+ GROUP BY `glpi_plugin_mantis_mantis`.`items_id `,`glpi_plugin_mantis_mantis`.`itemtype ` " );
342342 }
343343
344344
@@ -352,7 +352,7 @@ private static function getLinkBetweenItemGlpiAndTicketMantis($idItem,$itemType)
352352 global $ DB ;
353353 return $ DB ->query ("SELECT `glpi_plugin_mantis_mantis`.*
354354 FROM `glpi_plugin_mantis_mantis` WHERE `glpi_plugin_mantis_mantis`
355- .`idTicket ` = ' " . Toolbox::cleanInteger ($ idItem )."' and `glpi_plugin_mantis_mantis`.`itemType ` = ' " .$ itemType ."' " );
355+ .`items_id ` = ' " . Toolbox::cleanInteger ($ idItem )."' and `glpi_plugin_mantis_mantis`.`itemtype ` = ' " .$ itemType ."' " );
356356 }
357357
358358
@@ -889,7 +889,7 @@ private function getFormForDisplayInfo($item,$itemType) {
889889
890890 Ajax::createModalWindow ('popupToDelete ' . $ row ['id ' ],
891891 $ CFG_GLPI ['root_doc ' ].'/plugins/mantis/front/mantis.form.php?action=deleteIssue&id= ' .
892- $ row ['id ' ] . '&idTicket= ' . $ row ['idTicket ' ] . '&idMantis= ' . $ row ['idMantis ' ].'&itemType= ' .$ itemType ,
892+ $ row ['id ' ] . '&idTicket= ' . $ row ['items_id ' ] . '&idMantis= ' . $ row ['idMantis ' ].'&itemType= ' .$ itemType ,
893893 array ('title ' => __ ("Delete " , "mantis " ),'width ' => 550 ,'height ' => $ height ));
894894
895895 if (!$ issue ) {
@@ -956,9 +956,9 @@ private function getFormForDisplayInfo($item,$itemType) {
956956 * @return true if succeed else false
957957 */
958958 public function IfExistLink ($ idItem , $ id_mantis ,$ itemType ) {
959- return $ this ->getFromDBByQuery ($ this ->getTable () . " WHERE ` " . "`.`idTicket ` = ' " .
959+ return $ this ->getFromDBByQuery ($ this ->getTable () . " WHERE ` " . "`.`items_id ` = ' " .
960960 Toolbox::cleanInteger ($ idItem ) . "' AND ` " . "`.`idMantis` = ' " .
961- Toolbox::cleanInteger ($ id_mantis ) . "' AND ` " . "`.`itemType ` = ' " .$ itemType . "' " );
961+ Toolbox::cleanInteger ($ id_mantis ) . "' AND ` " . "`.`itemtype ` = ' " .$ itemType . "' " );
962962 }
963963
964964 /**
@@ -971,8 +971,8 @@ public function getLinkBetweenGlpiAndMantis($item,$itemType){
971971 global $ DB ;
972972 return $ DB ->query ("SELECT `glpi_plugin_mantis_mantis`.*
973973 FROM `glpi_plugin_mantis_mantis` WHERE `glpi_plugin_mantis_mantis`
974- .`idTicket ` = ' " . Toolbox::cleanInteger ($ item ->getField ('id ' )) . "'
975- and `glpi_plugin_mantis_mantis`.`itemType ` = ' " .$ itemType ."' order by `glpi_plugin_mantis_mantis`.`dateEscalade` " );
974+ .`items_id ` = ' " . Toolbox::cleanInteger ($ item ->getField ('id ' )) . "'
975+ and `glpi_plugin_mantis_mantis`.`itemtype ` = ' " .$ itemType ."' order by `glpi_plugin_mantis_mantis`.`dateEscalade` " );
976976 }
977977
978978 /**
0 commit comments