/**
  * Overloading the doActions function : replacing the parent's function with the one below
  *
  * @param   array()         $parameters     Hook metadatas (context, etc...)
  * @param   CommonObject    &$object        The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
  * @param   string          &$action        Current action (if set). Generally create or edit or null
  * @param   HookManager     $hookmanager    Hook manager propagated to allow calling another hook
  * @return  int                             < 0 on error, 0 on success, 1 to replace standard code
  */
 function doActions($parameters, &$object, &$action, $hookmanager)
 {
     global $conf, $user;
     dol_include_once('/grapefruit/class/grapefruit.class.php');
     $TContext = explode(':', $parameters['context']);
     $actionATM = GETPOST('actionATM');
     if ($parameters['currentcontext'] == 'ordercard' && $object->statut >= 1 && !empty($conf->global->GRAPEFRUIT_ALLOW_CREATE_BILL_EXPRESS)) {
         if ($actionATM === 'create_bill_express' && !empty($conf->global->GRAPEFRUIT_ALLOW_CREATE_BILL_EXPRESS) && $object->statut > Commande::STATUS_DRAFT && !$object->billed && !empty($conf->facture->enabled) && $user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) {
             TGrappeFruit::createFactureFromObject($object);
         }
     }
     if ($parameters['currentcontext'] == 'ordersuppliercard') {
         if ($action == 'builddoc' && !empty($conf->global->GRAPEFRUIT_FORCE_VAR_HIDEREF_ON_SUPPLIER_ORDER)) {
             global $hideref;
             $hideref = 0;
         }
     }
     // Bypass des confirmation
     if (in_array('globalcard', $TContext)) {
         $actionList = explode(',', $conf->global->GRAPEFRUIT_BYPASS_CONFIRM_ACTIONS);
         if (in_array($action, $actionList)) {
             global $confirm;
             $confirm = 'yes';
             $action = 'confirm_' . $action;
         }
     }
     return 0;
 }