You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2020-12-01 11:11:37

joergd
Member
Registered: 2020-12-01
Posts: 2

Add costs to solved tickets

Hi,

is it possible to add costs even for tickets that have already been solved? Unfortunately I cannot find a setting for this.

Offline

#2 2022-06-01 16:23:50

danielbarbieri
Member
Registered: 2022-06-01
Posts: 4

Re: Add costs to solved tickets

Hi, I have the same problem. Did you get any solution?

Offline

#3 2022-06-01 19:29:34

makeijan
Member
From: Pontevedra, Galicia
Registered: 2008-01-29
Posts: 774
Website

Re: Add costs to solved tickets

I don't think it is possible.
But maybe you will fix your problem by using this plugin: https://tic.gal/en/project/costs-control-plugin-glpi/
Regards,

Offline

#4 2022-06-02 13:36:47

joergd
Member
Registered: 2020-12-01
Posts: 2

Re: Add costs to solved tickets

danielbarbieri wrote:

Hi, I have the same problem. Did you get any solution?

Yes, with this hack:

diff -Naur tickets.orig/inc/commonitilcost.class.php tickets/inc/commonitilcost.class.php
--- tickets.orig/inc/commonitilcost.class.php   2020-10-07 08:42:12.000000000 +0200
+++ tickets/inc/commonitilcost.class.php        2020-12-08 10:25:55.446125641 +0100
@@ -511,8 +511,7 @@
       $rand   = mt_rand();
 
       if ($canedit
-          && !in_array($item->fields['status'], array_merge($item->getClosedStatusArray(),
-                                                         $item->getSolvedStatusArray()))) {
+          && !in_array($item->fields['status'], array_merge($item->getClosedStatusArray()))) {
          echo "<div id='viewcost".$ID."_$rand'></div>\n";
          echo "<script type='text/javascript' >\n";
          echo "function viewAddCost".$ID."_$rand() {\n";
diff -Naur tickets.orig/inc/item_ticket.class.php tickets/inc/item_ticket.class.php
--- tickets.orig/inc/item_ticket.class.php      2020-10-07 08:42:12.000000000 +0200
+++ tickets/inc/item_ticket.class.php   2020-12-08 10:27:00.222281682 +0100
@@ -381,8 +381,7 @@
       $number = count($types_iterator);
 
       if ($canedit
-          && !in_array($ticket->fields['status'], array_merge($ticket->getClosedStatusArray(),
-                                                              $ticket->getSolvedStatusArray()))) {
+          && !in_array($ticket->fields['status'], array_merge($ticket->getClosedStatusArray()))) {
          echo "<div class='firstbloc'>";
          echo "<form name='ticketitem_form$rand' id='ticketitem_form$rand' method='post'
                 action='".Toolbox::getItemTypeFormURL(__CLASS__)."'>";
diff -Naur tickets.orig/inc/knowbaseitem_item.class.php tickets/inc/knowbaseitem_item.class.php
--- tickets.orig/inc/knowbaseitem_item.class.php        2020-10-07 08:42:12.000000000 +0200
+++ tickets/inc/knowbaseitem_item.class.php     2020-12-08 10:27:58.850422541 +0100
@@ -132,8 +132,7 @@
          $ok_state = !in_array(
             $item->fields['status'],
             array_merge(
-               $item->getClosedStatusArray(),
-               $item->getSolvedStatusArray()
+               $item->getClosedStatusArray()
             )
          );
       }

This works at least for GLPI version 9.5.2

Offline

#5 2022-06-02 15:21:38

danielbarbieri
Member
Registered: 2022-06-01
Posts: 4

Re: Add costs to solved tickets

sorry to ask, but where should i put this text, i'm newbie, if you can help me i really appreciate it

Offline

#6 2022-06-02 15:39:50

danielbarbieri
Member
Registered: 2022-06-01
Posts: 4

Re: Add costs to solved tickets

I noticed that the commonitilcost.class.php file doesn't exist in version 10

Offline

Board footer

Powered by FluxBB