/** Overloading the doActions function : replacing the parent's function with the one below 
  *  @param      parameters  meta datas of the hook (context, etc...) 
  *  @param      object             the object you want to process (an invoice if you are in invoice module, a propale in propale's module, etc...) 
  *  @param      action             current action (if set). Generally create or edit or null 
  *  @return       void 
  */
 function formObjectOptions($parameters, &$object, &$action, $hookmanager)
 {
     global $db, $langs;
     if (in_array('ordercard', explode(':', $parameters['context'])) && $object->statut < 3) {
         dol_include_once('/shippableorder/class/shippableorder.class.php');
         $shippableOrder = new ShippableOrder($db);
         $shippableOrder->isOrderShippable($object->id);
         echo '<tr><td>' . $langs->trans('ShippableStatus') . '</td>';
         echo '<td>' . $shippableOrder->orderStockStatus(false) . '</td></tr>';
         $object->shippableorder = $shippableOrder;
     }
     return 0;
 }
 print '</td>';
 print '<td class="liste_titre" align="center">';
 print '<a href="#" id="checkall">' . $langs->trans("All") . '</a> / <a href="#" id="checknone">' . $langs->trans("None") . '</a>';
 print '</td>';
 print '</tr>';
 print '</form>';
 print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
 $var = true;
 $total = 0;
 $totaltoship = 0;
 $subtotal = 0;
 while ($objp = $db->fetch_object($resql)) {
     $BdisplayLine = true;
     $generic_commande->id = $objp->rowid;
     $generic_commande->ref = $objp->ref;
     $shippableOrder->isOrderShippable($objp->rowid);
     if (!empty($search_status)) {
         $result = $shippableOrder->orderStockStatus(true, 'code');
         if (!in_array($result, $search_status)) {
             $BdisplayLine = false;
         }
     }
     if ($BdisplayLine == true) {
         $var = !$var;
         print '<tr ' . $bc[$var] . '>';
         print '<td class="nowrap">';
         print '<table class="nobordernopadding"><tr class="nocellnopadd">';
         print '<td class="nobordernopadding nowrap">';
         print $generic_commande->getNomUrl(1);
         print '</td>';
         print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
 /**
  * Function called when a Dolibarrr business event is done.
  * All functions "run_trigger" are triggered if file
  * is inside directory core/triggers
  *
  * 	@param		string		$action		Event action code
  * 	@param		Object		$object		Object
  * 	@param		User		$user		Object user
  * 	@param		Translate	$langs		Object langs
  * 	@param		conf		$conf		Object conf
  * 	@return		int						<0 if KO, 0 if no triggered ran, >0 if OK
  */
 public function run_trigger($action, $object, $user, $langs, $conf)
 {
     if ($action == 'SHIPPING_VALIDATE') {
         // Classer délivrée la commande si totalement expédiée
         if ($conf->global->SHIPPABLEORDER_CLOSE_ORDER) {
             dol_include_once('/commande/class/commande.class.php');
             dol_include_once('/shippableorder/class/shippableorder.class.php');
             $object->fetchObjectLinked(0, 'commande');
             if (!empty($object->linkedObjects['commande'])) {
                 $commande = array_pop($object->linkedObjects['commande']);
                 $orderShippable = new ShippableOrder($this->db);
                 $orderShippable->isOrderShippable($commande->id);
                 if ($orderShippable->nbProduct == 0) {
                     $commande->cloture($user);
                     setEventMessage($langs->trans('OrderClosed', $commande->ref));
                 }
             }
         }
         dol_syslog("Trigger '" . $this->name . "' for action '{$action}' launched by " . __FILE__ . ". id=" . $object->id);
     }
     return 0;
 }