diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 0fe21564346..52b7761adbe 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1102,6 +1102,14 @@ else if ($action == 'remove_file') } } +// Print file +else if ($action == 'print_file' AND $user->rights->printipp->use) +{ + require_once DOL_DOCUMENT_ROOT.'/core/class/dolprintipp.class.php'; + $printer = new dolPrintIPP($db,$conf->global->PRINTIPP_HOST,$conf->global->PRINTIPP_PORT,$user->login,$conf->global->PRINTIPP_USER,$conf->global->PRINTIPP_PASSWORD); + $printer->print_file(GETPOST('file',alpha),GETPOST('printer',alpha)); +} + /* * Add file in email form */ @@ -2354,8 +2362,9 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; $genallowed=$user->rights->commande->creer; $delallowed=$user->rights->commande->supprimer; - - $somethingshown=$formfile->show_documents('commande',$comref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang); + $printer = false; + if ($user->rights->printipp->use AND $conf->printipp->enabled) $printer = true; + $somethingshown=$formfile->show_documents('commande',$comref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang,$printer); /* * Linked object block