From e93cefbbf01aa5ad992605123cd05ece1b17bd02 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Jun 2017 10:37:58 +0200 Subject: [PATCH] FIX #6985 --- htdocs/adherents/card.php | 2 + htdocs/adherents/type.php | 2 + htdocs/categories/card.php | 3 +- htdocs/categories/edit.php | 1 + htdocs/comm/action/card.php | 6 +- htdocs/comm/mailing/advtargetemailing.php | 3 +- htdocs/comm/mailing/card.php | 2 + htdocs/comm/propal/card.php | 1 + htdocs/commande/card.php | 1 + htdocs/commande/orderstoinvoice.php | 1 + htdocs/compta/bank/card.php | 2 + htdocs/compta/bank/various_payment/card.php | 1 + htdocs/compta/deplacement/card.php | 2 + htdocs/compta/facture/card.php | 1 + htdocs/compta/localtax/card.php | 2 + htdocs/compta/salaries/card.php | 2 + htdocs/compta/tva/card.php | 2 + htdocs/contact/card.php | 2 + htdocs/contrat/card.php | 1 + htdocs/core/tpl/extrafields_view.tpl.php | 1 + htdocs/don/card.php | 2 + htdocs/expedition/card.php | 1 + htdocs/expensereport/card.php | 198 +++++++++--------- htdocs/fichinter/card.php | 45 ++-- htdocs/fourn/commande/card.php | 1 + htdocs/fourn/commande/orderstoinvoice.php | 1 + htdocs/fourn/facture/card.php | 1 + htdocs/product/card.php | 2 + htdocs/product/document.php | 1 + htdocs/product/fournisseurs.php | 43 ++-- htdocs/product/stats/commande.php | 15 +- htdocs/product/stats/commande_fournisseur.php | 18 +- htdocs/product/stats/contrat.php | 21 +- htdocs/product/stats/facture.php | 23 +- htdocs/product/stats/facture_fournisseur.php | 13 +- htdocs/product/stats/propal.php | 19 +- htdocs/product/stock/product.php | 17 +- htdocs/projet/card.php | 2 + htdocs/projet/tasks.php | 53 ++--- htdocs/projet/tasks/task.php | 1 + htdocs/resource/add.php | 1 + htdocs/resource/card.php | 1 + htdocs/societe/commerciaux.php | 3 +- htdocs/supplier_proposal/card.php | 1 + htdocs/user/card.php | 1 + htdocs/user/group/card.php | 2 + 46 files changed, 293 insertions(+), 231 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 147040fbf67..78969a8df14 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -943,6 +943,7 @@ else // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); @@ -1185,6 +1186,7 @@ else // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit',$parameters); diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 50c464596fd..f54c89ffeba 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -278,6 +278,7 @@ if ($action == 'create') // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); @@ -668,6 +669,7 @@ if ($rowid > 0) // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index ed497cbbb7f..55bf400ea3a 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -268,7 +268,8 @@ if ($user->rights->categorie->creer) $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook)) + print $hookmanager->resPrint; + if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); } diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index c2f93c17ccd..59bee88b75b 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -175,6 +175,7 @@ print ''; $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 1bb35fe7fe8..60486ac6f01 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -833,7 +833,8 @@ if ($action == 'create') // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook) && ! empty($extrafields->attribute_label)) + print $hookmanager->resPrint; + if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); } @@ -1164,7 +1165,8 @@ if ($id > 0) // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook) && ! empty($extrafields->attribute_label)) + print $hookmanager->resPrint; + if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); } diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index 832cefa5774..81c29f687ce 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -777,8 +777,9 @@ if ($object->fetch($id) >= 0) { if (! empty($advTarget->id)) { $parameters = array('array_query' => $advTarget->filtervalue); } - // Module extrafield feature + // Other attributes $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $std_soc, $action_search); + print $hookmanager->resPrint; } // State Contact diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 353117f5fa3..17d4d066569 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -718,6 +718,7 @@ if ($action == 'create') // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); @@ -1153,6 +1154,7 @@ else // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index d58f2223adb..3e8580d5350 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1527,6 +1527,7 @@ if ($action == 'create') // Other attributes $parameters = array(); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields, 'edit'); } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index eeea825c1e5..e2db47a6c9d 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1609,6 +1609,7 @@ if ($action == 'create' && $user->rights->commande->creer) // Other attributes $parameters = array('objectsrc' => $objectsrc, 'socid'=>$socid); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields, 'edit'); } diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index e76adb2a67c..fa9f810b036 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -471,6 +471,7 @@ if ($action == 'create' && !$error) // Other attributes $parameters=array('objectsrc' => $objectsrc, 'idsrc' => $listoforders); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { $object=new Facture($db); diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 7267769379e..06918ff2846 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -409,6 +409,7 @@ if ($action == 'create') // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit',$parameters); @@ -946,6 +947,7 @@ else // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 9444c0585f7..e19deca91c9 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -284,6 +284,7 @@ if ($action == 'create') // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; print ''; diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index 555ea52b4e0..979ef5960e0 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -300,6 +300,7 @@ if ($action == 'create') // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; print ''; @@ -396,6 +397,7 @@ else if ($id) // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; print ''; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index c79beaac4f3..fa9bdf60dc5 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2591,6 +2591,7 @@ if ($action == 'create') // Other attributes $parameters = array('objectsrc' => $objectsrc,'colspan' => ' colspan="2"', 'cols'=>2); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields, 'edit'); } diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php index bd1f83d7f43..317d3ae813d 100644 --- a/htdocs/compta/localtax/card.php +++ b/htdocs/compta/localtax/card.php @@ -202,6 +202,7 @@ if ($action == 'create') // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; print ''; @@ -271,6 +272,7 @@ if ($id) // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$vatpayment,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; print ''; diff --git a/htdocs/compta/salaries/card.php b/htdocs/compta/salaries/card.php index 20079ad18ee..45bde4bcd32 100644 --- a/htdocs/compta/salaries/card.php +++ b/htdocs/compta/salaries/card.php @@ -302,6 +302,7 @@ if ($action == 'create') // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; print ''; @@ -389,6 +390,7 @@ if ($id) // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; print ''; diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index ea26d2c55a8..6f7e250f4f5 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -284,6 +284,7 @@ if ($action == 'create') // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; print ''; @@ -351,6 +352,7 @@ if ($id) // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; print ''; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index ae13bb44a3a..fbd27b0d841 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -666,6 +666,7 @@ else // Other attributes $parameters=array('colspan' => ' colspan="3"','cols'=>3); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); @@ -934,6 +935,7 @@ else // Other attributes $parameters=array('colspan' => ' colspan="3"', 'cols'=>3); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 4e19d6109b8..58b1608f44b 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1211,6 +1211,7 @@ if ($action == 'create') // Other attributes $parameters=array('objectsrc' => $objectsrc,'colspan' => ' colspan="3"', 'cols'=>3); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; // Other attributes if (empty($reshook) && ! empty($extrafields->attribute_label)) { diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 9c9813e18ca..0f1d581c99f 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -34,6 +34,7 @@ if (! empty($cols)) $parameters['cols'] = $cols; if (! empty($object->fk_soc)) $parameters['socid'] = $object->fk_soc; $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); +print $hookmanager->resPrint; if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook) && ! empty($extrafields->attributes[$object->table_element]['label'])) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 33f2375a1bf..3f58982624d 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -373,6 +373,7 @@ if ($action == 'create') // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit',$parameters); @@ -498,6 +499,7 @@ if (! empty($id) && $action == 'edit') // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index e3a1b0bc3fa..72044d68fcf 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -774,6 +774,7 @@ if ($action == 'create') // Other attributes $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'socid'=>$socid); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$expe,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $expe->showOptionals($extrafields, 'edit'); diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index d9c195f4ca9..c4aa6caccd8 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -125,7 +125,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { - if ($cancel) + if ($cancel) { $action=''; $fk_projet=''; @@ -158,7 +158,7 @@ if (empty($reshook)) { // Because createFromClone modifies the object, we must clone it so that we can restore it later if it fails $orig = clone $object; - + $result=$object->createFromClone(GETPOST('fk_user_author','int')); if ($result > 0) { @@ -174,7 +174,7 @@ if (empty($reshook)) } } } - + if ($action == 'confirm_delete' && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->supprimer) { $object = new ExpenseReport($db); @@ -190,20 +190,20 @@ if (empty($reshook)) setEventMessages($object->error, $object->errors, 'errors'); } } - + if ($action == 'add' && $user->rights->expensereport->creer) { $object = new ExpenseReport($db); - + $object->date_debut = $date_start; $object->date_fin = $date_end; - + $object->fk_user_author = GETPOST('fk_user_author','int'); if (! ($object->fk_user_author > 0)) $object->fk_user_author = $user->id; - + $fuser=new User($db); $fuser->fetch($object->fk_user_author); - + $object->fk_statut = 1; $object->fk_c_paiement = GETPOST('fk_c_paiement','int'); $object->fk_user_validator = GETPOST('fk_user_validator','int'); @@ -215,20 +215,20 @@ if (empty($reshook)) $ret = $extrafields->setOptionalsFromPost($extralabels, $object); if ($ret < 0) $error++; } - + if ($object->periode_existe($fuser,$object->date_debut,$object->date_fin)) { $error++; setEventMessages($langs->trans("ErrorDoubleDeclaration"), null, 'errors'); $action='create'; } - + if (! $error) { $db->begin(); - + $id = $object->create($user); - + if ($id > 0) { $db->commit(); @@ -243,25 +243,25 @@ if (empty($reshook)) } } } - + if ($action == 'update' && $user->rights->expensereport->creer) { $object = new ExpenseReport($db); $object->fetch($id); - + $object->date_debut = $date_start; $object->date_fin = $date_end; - + if($object->fk_statut < 3) { $object->fk_user_validator = GETPOST('fk_user_validator','int'); } - + $object->fk_c_paiement = GETPOST('fk_c_paiement','int'); $object->note_public = GETPOST('note_public'); $object->note_private = GETPOST('note_private'); $object->fk_user_modif = $user->id; - + $result = $object->update($user); if ($result > 0) { @@ -273,14 +273,14 @@ if (empty($reshook)) setEventMessages($object->error, $object->errors, 'errors'); } } - + if ($action == 'update_extras') { // Fill array 'array_options' with data from update form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); if ($ret < 0) $error++; - + if (! $error) { // Actions on extra fields (by external module or standard code) @@ -296,17 +296,17 @@ if (empty($reshook)) } else if ($reshook < 0) $error++; } - + if ($error) $action = 'edit_extras'; } - + if ($action == "confirm_validate" && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->creer) { $object = new ExpenseReport($db); $object->fetch($id); $result = $object->setValidate($user); - + if ($result > 0) { // Define output language @@ -322,51 +322,51 @@ if (empty($reshook)) } $model=$object->modelpdf; $ret = $object->fetch($id); // Reload to get new records - + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } - + if ($result > 0 && $object->fk_user_validator > 0) { $langs->load("mails"); - + // TO $destinataire = new User($db); $destinataire->fetch($object->fk_user_validator); $emailTo = $destinataire->email; - + // FROM $expediteur = new User($db); $expediteur->fetch($object->fk_user_author); $emailFrom = $expediteur->email; - + if ($emailTo && $emailFrom) { $filename=array(); $filedir=array(); $mimetype=array(); - + // SUBJECT $subject = $langs->transnoentities("ExpenseReportWaitingForApproval"); - + // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; $message = $langs->transnoentities("ExpenseReportWaitingForApprovalMessage", $expediteur->getFullName($langs), get_date_range($object->date_debut,$object->date_fin,'',$langs), $link); - + // Rebuild pdf /* $object->setDocModel($user,""); $resultPDF = expensereport_pdf_create($db,$id,'',"",$langs); - + if($resultPDF): // ATTACHMENT array_push($filename,dol_sanitizeFileName($object->ref).".pdf"); array_push($filedir,$conf->expensereport->dir_output . "/" . dol_sanitizeFileName($object->ref) . "/" . dol_sanitizeFileName($object->ref).".pdf"); array_push($mimetype,"application/pdf"); */ - + // PREPARE SEND $mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message,$filedir,$mimetype,$filename); - + if ($mailfile) { // SEND @@ -411,13 +411,13 @@ if (empty($reshook)) setEventMessages($object->error, $object->errors, 'errors'); } } - + if ($action == "confirm_save_from_refuse" && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->creer) { $object = new ExpenseReport($db); $object->fetch($id); $result = $object->set_save_from_refuse($user); - + if ($result > 0) { // Define output language @@ -433,11 +433,11 @@ if (empty($reshook)) } $model=$object->modelpdf; $ret = $object->fetch($id); // Reload to get new records - + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } - + if ($result > 0) { // Send mail @@ -446,7 +446,7 @@ if (empty($reshook)) $destinataire = new User($db); $destinataire->fetch($object->fk_user_validator); $emailTo = $destinataire->email; - + // FROM $expediteur = new User($db); $expediteur->fetch($object->fk_user_author); @@ -455,10 +455,10 @@ if (empty($reshook)) if ($emailFrom && $emailTo) { $filename=array(); $filedir=array(); $mimetype=array(); - + // SUBJECT $subject = $langs->transnoentities("ExpenseReportWaitingForReApproval"); - + // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; $dateRefusEx = explode(" ",$object->date_refuse); @@ -481,7 +481,7 @@ if (empty($reshook)) // PREPARE SEND $mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message,$filedir,$mimetype,$filename); - + if ($mailfile) { // SEND @@ -526,15 +526,15 @@ if (empty($reshook)) setEventMessages($object->error, $object->errors, 'errors'); } } - + // Approve if ($action == "confirm_approve" && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->approve) { $object = new ExpenseReport($db); $object->fetch($id); - + $result = $object->setApproved($user); - + if ($result > 0) { // Define output language @@ -550,11 +550,11 @@ if (empty($reshook)) } $model=$object->modelpdf; $ret = $object->fetch($id); // Reload to get new records - + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } - + if ($result > 0) { // Send mail @@ -576,19 +576,19 @@ if (empty($reshook)) if ($emailFrom && $emailTo) { $filename=array(); $filedir=array(); $mimetype=array(); - + // SUBJECT $subject = $langs->transnoentities("ExpenseReportApproved"); - + // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; $message = $langs->transnoentities("ExpenseReportApprovedMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $link); - + // Rebuilt pdf /* $object->setDocModel($user,""); $resultPDF = expensereport_pdf_create($db,$object,'',"",$langs); - + if($resultPDF { // ATTACHMENT @@ -600,7 +600,7 @@ if (empty($reshook)) */ $mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message,$filedir,$mimetype,$filename); - + if ($mailfile) { // SEND @@ -673,7 +673,7 @@ if (empty($reshook)) } $model=$object->modelpdf; $ret = $object->fetch($id); // Reload to get new records - + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } @@ -686,28 +686,28 @@ if (empty($reshook)) $destinataire = new User($db); $destinataire->fetch($object->fk_user_author); $emailTo = $destinataire->email; - + // FROM $expediteur = new User($db); $expediteur->fetch($object->fk_user_refuse); $emailFrom = $expediteur->email; - + if ($emailFrom && $emailTo) { $filename=array(); $filedir=array(); $mimetype=array(); - + // SUBJECT $subject = $langs->transnoentities("ExpenseReportRefused"); - + // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; $message = $langs->transnoentities("ExpenseReportRefusedMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $_POST['detail_refuse'], $link); - + // Rebuilt pdf /* $object->setDocModel($user,""); $resultPDF = expensereport_pdf_create($db,$object,'',"",$langs); - + if($resultPDF { // ATTACHMENT @@ -796,7 +796,7 @@ if (empty($reshook)) } $model=$object->modelpdf; $ret = $object->fetch($id); // Reload to get new records - + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } @@ -814,23 +814,23 @@ if (empty($reshook)) $expediteur = new User($db); $expediteur->fetch($object->fk_user_cancel); $emailFrom = $expediteur->email; - + if ($emailFrom && $emailTo) { $filename=array(); $filedir=array(); $mimetype=array(); - + // SUBJECT $subject = $langs->transnoentities("ExpenseReportCanceled"); - + // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; $message = $langs->transnoentities("ExpenseReportCanceledMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $_POST['detail_cancel'], $link); - + // Rebuilt pdf /* $object->setDocModel($user,""); $resultPDF = expensereport_pdf_create($db,$object,'',"",$langs); - + if($resultPDF { // ATTACHMENT @@ -840,10 +840,10 @@ if (empty($reshook)) array_push($mimetype,"application/pdf"); } */ - + // PREPARE SEND $mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message,$filedir,$mimetype,$filename); - + if ($mailfile) { // SEND @@ -881,7 +881,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("NoEmailSentBadSenderOrRecipientEmail"), null, 'warnings'); $action=''; - } + } } else { @@ -918,7 +918,7 @@ if (empty($reshook)) } $model=$object->modelpdf; $ret = $object->fetch($id); // Reload to get new records - + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } @@ -961,7 +961,7 @@ if (empty($reshook)) } $model=$object->modelpdf; $ret = $object->fetch($id); // Reload to get new records - + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } @@ -983,7 +983,7 @@ if (empty($reshook)) if ($emailFrom && $emailTo) { $filename=array(); $filedir=array(); $mimetype=array(); - + // SUBJECT $subject = $langs->transnoentities("ExpenseReportPaid"); @@ -1154,7 +1154,7 @@ if (empty($reshook)) { $object = new ExpenseReport($db); $object->fetch($id); - + $object_ligne = new ExpenseReportLine($db); $object_ligne->fetch(GETPOST("rowid")); $total_ht = $object_ligne->total_ht; @@ -1178,11 +1178,11 @@ if (empty($reshook)) } $model=$object->modelpdf; $ret = $object->fetch($id); // Reload to get new records - + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } - + $object->update_totaux_del($object_ligne->total_ht,$object_ligne->total_tva); header("Location: ".$_SERVER["PHP_SELF"]."?id=".$_GET['id']); exit; @@ -1244,13 +1244,13 @@ if (empty($reshook)) } $model=$object->modelpdf; $ret = $object->fetch($id); // Reload to get new records - + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } - + $result = $object->recalculer($id); - + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } @@ -1296,7 +1296,7 @@ if ($action == 'create') print ''; print ''; - + // Date start print ''; print ''; @@ -1304,7 +1304,7 @@ if ($action == 'create') $form->select_date($date_start?$date_start:-1,'date_debut',0,0,0,'',1,1); print ''; print ''; - + // Date end print ''; print ''; @@ -1312,7 +1312,7 @@ if ($action == 'create') $form->select_date($date_end?$date_end:-1,'date_fin',0,0,0,'',1,1); print ''; print ''; - + print ''; print ''; print ''; print ''; - + // Payment mode if (! empty($conf->global->EXPENSEREPORT_ASK_PAYMENTMODE_ON_CREATION)) { @@ -1376,7 +1376,7 @@ if ($action == 'create') // Other attributes $parameters = array('colspan' => ' colspan="3"'); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by - // hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields, 'edit'); } @@ -1400,7 +1400,7 @@ else $result = $object->fetch($id, $ref); $res = $object->fetch_optionals($object->id, $extralabels); - + if ($result > 0) { if (! in_array($object->fk_user_author, $user->getAllChildIds(1))) @@ -1698,7 +1698,7 @@ else $userfee=new User($db); $result = $userfee->fetch($object->fk_user_validator); if ($result > 0) print $userfee->getNomUrl(-1); - if (empty($userfee->email) || ! isValidEmail($userfee->email)) + if (empty($userfee->email) || ! isValidEmail($userfee->email)) { $langs->load("errors"); print img_warning($langs->trans("ErrorBadEMail", $userfee->email)); @@ -1902,9 +1902,9 @@ else { print ''; print ''; - + $remaintopay = $object->total_ttc - $totalpaid; - + print ''; print ''; } @@ -1984,7 +1984,7 @@ else if ($action != 'editline' || $objp->rowid != GETPOST('rowid')) { print ''; - + print ''; @@ -2006,7 +2006,7 @@ else print ''; print ''; print ''; - + if ($action != 'editline') { print ''; @@ -2034,7 +2034,7 @@ else if ($action == 'editline' && $objp->rowid == GETPOST('rowid')) { print ''; - + print ''; // Select date @@ -2049,7 +2049,7 @@ else $formproject->select_projects(-1, $objp->fk_projet,'fk_projet', 0, 0, 1, 1); print ''; } - + // Select type print ''; - + print ''; } // Fin si c'est payé/validé print '
'.$langs->trans("DateStart").'
'.$langs->trans("DateEnd").'
'.$langs->trans("User").''; @@ -1341,7 +1341,7 @@ if ($action == 'create') } print '
'.$langs->trans("AlreadyPaid").':'.price($totalpaid).'
'.$langs->trans("AmountExpected").':'.price($object->total_ttc).'
'.$langs->trans("RemainderToPay").':'.price($remaintopay).'
'; print img_picto($langs->trans("Document"), "object_generic"); print ' '.$piece_comptable.''.vatrate($objp->vatrate,true).''.price($objp->value_unit).''.$objp->qty.''.price($objp->total_ht).'
'; select_type_fees_id($objp->type_fees_code,'fk_c_type_fees'); @@ -2168,13 +2168,13 @@ else } print '
'; print ''; - + print ''; } else @@ -2290,7 +2290,7 @@ if ($action != 'create' && $action != 'edit') // If status is Appoved // -------------------- - + if ($user->rights->expensereport->approve && $object->fk_statut == 5) { print '
id.'">'.$langs->trans('Deny').'
'; @@ -2309,7 +2309,7 @@ if ($action != 'create' && $action != 'edit') print '
' . $langs->trans('DoPayment') . '
'; } } - + // If bank module is not used if (($user->rights->expensereport->to_paid || empty($conf->banque->enabled)) && $object->fk_statut == 5) { @@ -2319,26 +2319,26 @@ if ($action != 'create' && $action != 'edit') print '
'.$langs->trans("ClassifyPaid")."
"; } } - + if ($user->rights->expensereport->creer && ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) && $object->fk_statut == 5) { // Cancel print '
id.'">'.$langs->trans('Cancel').'
'; } - + // TODO Replace this. It should be SetUnpaid and should go back to status unpaid not canceled. if (($user->rights->expensereport->approve || $user->rights->expensereport->to_paid) && $object->fk_statut == 6) { // Cancel print '
id.'">'.$langs->trans('Cancel').'
'; } - + // Clone if ($user->rights->expensereport->creer) { print '
' . $langs->trans("ToClone") . '
'; } - - /* If draft, validated, cancel, and user can create, he can always delete its card before it is approved */ + + /* If draft, validated, cancel, and user can create, he can always delete its card before it is approved */ if ($user->rights->expensereport->creer && $user->id == $object->fk_user_author && $object->fk_statut <= 4) { // Delete @@ -2389,7 +2389,7 @@ if ($action != 'create' && $action != 'edit' && ($id || $ref)) $object->fetch_thirdparty(); $result = $object->add_object_linked('fichinter', GETPOST('LinkedFichinter')); } - + // Show links to link elements $linktoelements=array(); if (! empty($conf->global->EXPENSES_LINK_TO_INTERVENTION)) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 9e463eb8ac4..c084806c4a6 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -581,7 +581,7 @@ if (empty($reshook)) setEventMessages($object->error, $object->errors, 'errors'); } } - + /* * Mise a jour d'une ligne d'intervention */ @@ -997,7 +997,8 @@ if ($action == 'create') // Other attributes $parameters=array('colspan' => ' colspan="2"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook) && ! empty($extrafields->attribute_label)) + print $hookmanager->resPrint; + if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); } @@ -1147,11 +1148,11 @@ else if ($id > 0 || ! empty($ref)) // Print form confirm print $formconfirm; - + // Intervention card $linkback = ''.$langs->trans("BackToList").''; - - + + $morehtmlref='
'; // Ref customer //$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->fichinter->creer, 'string', '', 0, 1); @@ -1191,16 +1192,16 @@ else if ($id > 0 || ! empty($ref)) } } $morehtmlref.='
'; - + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - - + + print '
'; print '
'; print '
'; - + print ''; - + if (! empty($conf->global->FICHINTER_USE_PLANNED_AND_DONE_DATES)) { // Date Start @@ -1279,14 +1280,14 @@ else if ($id > 0 || ! empty($ref)) include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; print '
'; - + print '
'; print '
'; print '
'; print '
'; - + print ''; - + if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) { // Duration @@ -1294,15 +1295,15 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; } - + print "
'.convertSecondToTime($object->duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY).'
"; - + print '
'; print '
'; print '
'; - + print '

'; - + if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) { @@ -1367,7 +1368,7 @@ else if ($id > 0 || ! empty($ref)) while ($i < $num) { $objp = $db->fetch_object($resql); - + // Ligne en mode visu if ($action != 'editline' || GETPOST('line_id','int') != $objp->rowid) @@ -1488,7 +1489,7 @@ else if ($id > 0 || ! empty($ref)) // Add new line if ($object->statut == 0 && $user->rights->ficheinter->creer && $action <> 'editline' && empty($conf->global->FICHINTER_DISABLE_DETAILS)) { - if (! $num) + if (! $num) { print '
'; @@ -1501,7 +1502,7 @@ else if ($id > 0 || ! empty($ref)) print ''; print "\n"; } - + print ''."\n"; print '
 
'; // editeur wysiwyg @@ -1655,7 +1656,7 @@ else if ($id > 0 || ! empty($ref)) { print ''; } - + // Clone if ($user->rights->ficheinter->creer) { print ''; @@ -1698,7 +1699,7 @@ else if ($id > 0 || ! empty($ref)) // Show links to link elements $linktoelem = $form->showLinkToObjectBlock($object, null, array('fichinter')); $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); - + print '
'; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 2137e7ca747..dda4a0d7254 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1572,6 +1572,7 @@ if ($action=='create') // Other options $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php index a503776b653..86c177c4313 100644 --- a/htdocs/fourn/commande/orderstoinvoice.php +++ b/htdocs/fourn/commande/orderstoinvoice.php @@ -370,6 +370,7 @@ if ($action == 'create' && !$error) { 'cols'=>2 ); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 306ad62d69b..e67cb74d1ea 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1824,6 +1824,7 @@ if ($action == 'create') // Other options $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; // Bouton "Create Draft" print "
\n"; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index d42dc87b4b9..dc75ee54bb5 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1047,6 +1047,7 @@ else // Other attributes $parameters=array('cols' => 3); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit',$parameters); @@ -1366,6 +1367,7 @@ else // Other attributes $parameters=array('colspan' => ' colspan="3"', 'cols'=>3); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); diff --git a/htdocs/product/document.php b/htdocs/product/document.php index 2b76fb0a111..a7c7b4f22be 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -193,6 +193,7 @@ if ($object->id) $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); // Construit liste des fichiers diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 84532ad219e..46db7f69b91 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -98,7 +98,7 @@ if (empty($reshook)) if ($id) { $result=$object->fetch($id); - $object->cost_price = price2num($cost_price); + $object->cost_price = price2num($cost_price); $result=$object->update($object->id, $user); if ($result > 0) { @@ -112,7 +112,7 @@ if (empty($reshook)) } } } - + if ($action == 'confirm_remove_pf') { if ($rowid) // id of product supplier price to remove @@ -299,21 +299,21 @@ if ($id > 0 || $ref) $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $id . '&rowid=' . $rowid, $langs->trans('DeleteProductBuyPrice'), $langs->trans('ConfirmDeleteProductBuyPrice'), 'confirm_remove_pf', '', 0, 1); echo $formconfirm; } - + if ($action <> 'edit' && $action <> 're-edit') { $head=product_prepare_head($object); $titre=$langs->trans("CardProduct".$object->type); $picto=($object->type== Product::TYPE_SERVICE?'service':'product'); - + dol_fiche_head($head, 'suppliers', $titre, -1, $picto); - + $linkback = ''.$langs->trans("BackToList").''; - $object->next_prev_filter=" fk_product_type = ".$object->type; + $object->next_prev_filter=" fk_product_type = ".$object->type; dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref'); - + print '
'; - + print '
'; print ''; @@ -338,14 +338,14 @@ if ($id > 0 || $ref) print ''; - + print '
'; print $form->editfieldval($text,'cost_price',$object->cost_price,$object,$user->rights->produit->creer||$user->rights->service->creer,'amount:6'); print '
'; print '
'; print '
'; - + dol_fiche_end(); - + // Form to add or update a price if (($action == 'add_price' || $action == 'updateprice' ) && ($user->rights->produit->creer || $user->rights->service->creer)) @@ -365,7 +365,7 @@ if ($id > 0 || $ref) print '
'; print ''; print ''; - + dol_fiche_head(); print ''; @@ -450,11 +450,11 @@ if ($id > 0 || $ref) $default_vat=get_default_tva($mysoc2, $mysoc, $object->id, 0); $default_npr=get_default_npr($mysoc2, $mysoc, $object->id, 0); if (empty($default_vat)) $default_npr=$default_vat; - + print ''; print '
'.$langs->trans("VATRateForSupplierProduct").''; //print $form->load_tva('tva_tx',$object->tva_tx,$supplier,$mysoc); // Do not use list here as it may be any vat rates for any country - if (! empty($rowid)) // If we have a supplier, it is an update, we must show the vat of current supplier price + if (! empty($rowid)) // If we have a supplier, it is an update, we must show the vat of current supplier price { $tmpproductsupplier=new ProductFournisseur($db); $tmpproductsupplier->fetch_product_fournisseur_price($rowid, 1); @@ -463,7 +463,7 @@ if ($id > 0 || $ref) } else { - if (empty($default_vat)) + if (empty($default_vat)) { $default_vat=$object->tva_tx; } @@ -546,6 +546,7 @@ if ($id > 0 || $ref) { $parameters=array('id_fourn'=>$id_fourn,'prod_id'=>$object->id); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); + print $hookmanager->resPrint; } print '
'; @@ -589,7 +590,7 @@ if ($id > 0 || $ref) $product_fourn_list = $product_fourn->list_product_fournisseur_price($object->id, $sortfield, $sortorder); $nbtotalofrecords = count($product_fourn_list); print_barre_liste($langs->trans('SupplierPrices'), $page, $_SERVEUR ['PHP_SELF'], $option, $sortfield, $sortorder, '', count($product_fourn_list), $nbtotalofrecords, 'title_accountancy.png'); - + // Suppliers list title print '
'; print ''; @@ -608,7 +609,7 @@ if ($id > 0 || $ref) print_liste_field_titre($langs->trans("DiscountQtyMin"),$_SERVER["PHP_SELF"],'','',$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("NbDaysToDelivery"),$_SERVER["PHP_SELF"],"pfp.delivery_time_days","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("ReputationForThisProduct"),$_SERVER["PHP_SELF"],"pfp.supplier_reputation","",$param,'align="center"',$sortfield,$sortorder); - + // Charges ???? if ($conf->global->PRODUCT_CHARGES) { @@ -623,13 +624,13 @@ if ($id > 0 || $ref) foreach($product_fourn_list as $productfourn) { - + print ''; // Supplier print ''; - + // Supplier print ''; @@ -675,8 +676,8 @@ if ($id > 0 || $ref) // Reputation print ''; // Charges ???? diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index f4c0c66cdec..fe6f92bffec 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -82,7 +82,7 @@ if ($id > 0 || ! empty($ref)) $result = $product->fetch($id, $ref); $object = $product; - + $parameters=array('id'=>$id); $reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -97,14 +97,15 @@ if ($id > 0 || ! empty($ref)) dol_fiche_head($head, 'referers', $titre, -1, $picto); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$product,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); $linkback = ''.$langs->trans("BackToList").''; - + dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref'); - + print '
'; - + print '
'; print '
'.$productfourn->getSocNomUrl(1,'supplier').''.$productfourn->fourn_ref.''; if (!empty($productfourn->supplier_reputation) && !empty($object->reputations[$productfourn->supplier_reputation])) { - print $object->reputations[$productfourn->supplier_reputation]; - } + print $object->reputations[$productfourn->supplier_reputation]; + } print'
'; @@ -114,9 +115,9 @@ if ($id > 0 || ! empty($ref)) print ''; print '
'; - + dol_fiche_end(); - + if ($user->rights->commande->lire) { @@ -211,7 +212,7 @@ if ($id > 0 || ! empty($ref)) while ($i < $num && $i < $conf->liste_limit) { $objp = $db->fetch_object($result); - + print ''; print '
'; diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index dafb2b5aafd..2d9bccbcca4 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -88,7 +88,7 @@ if ($id > 0 || ! empty($ref)) { $result = $product->fetch($id, $ref); $object = $product; - + $parameters = array ('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $product, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) @@ -96,7 +96,7 @@ if ($id > 0 || ! empty($ref)) { llxHeader("", "", $langs->trans("CardProduct" . $product->type)); - if ($result > 0) + if ($result > 0) { $head = product_prepare_head($product); $titre = $langs->trans("CardProduct" . $product->type); @@ -104,15 +104,15 @@ if ($id > 0 || ! empty($ref)) { dol_fiche_head($head, 'referers', $titre, -1, $picto); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $product, $action); // Note that $action and $object may have been modified by hook - if ($reshook < 0) - setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + print $hookmanager->resPrint; + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); $linkback = ''.$langs->trans("BackToList").''; - + dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref'); - + print '
'; - + print '
'; print ''; @@ -122,9 +122,9 @@ if ($id > 0 || ! empty($ref)) { print ''; print '
'; - + dol_fiche_end(); - + if ($user->rights->fournisseur->commande->lire) { diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index b5a8ec2b039..c4421aa21f3 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -72,7 +72,7 @@ if ($id > 0 || ! empty($ref)) $result = $product->fetch($id, $ref); $object = $product; - + $parameters=array('id'=>$id); $reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -87,14 +87,15 @@ if ($id > 0 || ! empty($ref)) dol_fiche_head($head, 'referers', $titre, -1, $picto); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$product,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); $linkback = ''.$langs->trans("BackToList").''; - + dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref'); - + print '
'; - + print '
'; print '
'; @@ -104,9 +105,9 @@ if ($id > 0 || ! empty($ref)) print ''; print '
'; - + dol_fiche_end(); - + $now=dol_now(); @@ -141,7 +142,7 @@ if ($id > 0 || ! empty($ref)) $option .= '&search_month=' . $search_month; if (! empty($search_year)) $option .= '&search_year=' . $search_year; - + print '' . "\n"; if (! empty($sortfield)) print ''; @@ -151,7 +152,7 @@ if ($id > 0 || ! empty($ref)) print ''; $option .= '&page=' . $page; } - + print_barre_liste($langs->trans("Contrats"),$page,$_SERVER["PHP_SELF"],"&id=$product->id",$sortfield,$sortorder,'',$num,0,''); $i = 0; @@ -177,7 +178,7 @@ if ($id > 0 || ! empty($ref)) while ($i < $num && $i < $conf->liste_limit) { $objp = $db->fetch_object($result); - + print ''; print '
'.img_object($langs->trans("ShowContract"),"contract").' '; @@ -197,7 +198,7 @@ if ($id > 0 || ! empty($ref)) $i++; } } - + print '
'; print '
'; print ''; diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index d4f447128a1..3b3cfb37b1d 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -83,9 +83,9 @@ if ($id > 0 || ! empty($ref)) { $product = new Product($db); $result = $product->fetch($id, $ref); - + $object = $product; - + $parameters=array('id'=>$id); $reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -114,14 +114,15 @@ if ($id > 0 || ! empty($ref)) dol_fiche_head($head, 'referers', $titre, -1, $picto); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$product,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); $linkback = ''.$langs->trans("BackToList").''; - + dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref'); - + print '
'; - + print '
'; print ''; @@ -131,14 +132,14 @@ if ($id > 0 || ! empty($ref)) print ''; print '
'; - + dol_fiche_end(); if ($showmessage && $nboflines > 1) { print $langs->trans("ClinkOnALinkOfColumn", $langs->transnoentitiesnoconv("Referers")); } - elseif ($user->rights->facture->lire) + elseif ($user->rights->facture->lire) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,"; $sql.= " f.facnumber, f.datef, f.paye, f.fk_statut as statut, f.rowid as facid,"; @@ -164,13 +165,13 @@ if ($id > 0 || ! empty($ref)) $total_ht=0; $total_qty=0; $totalrecords=0; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) + if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); - if ($result) + if ($result) { $totalrecords = $db->num_rows($result); - while ($objp = $db->fetch_object($result)) + while ($objp = $db->fetch_object($result)) { $total_ht+=$objp->total_ht; $total_qty+=$objp->qty; @@ -234,7 +235,7 @@ if ($id > 0 || ! empty($ref)) while ($i < min($num,$conf->liste_limit)) { $objp = $db->fetch_object($result); - + print ''; print '
'; diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index 5701b8960e5..ba17b1b3265 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -84,7 +84,7 @@ if ($id > 0 || ! empty($ref)) $result = $product->fetch($id, $ref); $object = $product; - + $parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $product, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -99,14 +99,15 @@ if ($id > 0 || ! empty($ref)) dol_fiche_head($head, 'referers', $titre, -1, $picto); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $product, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); $linkback = ''.$langs->trans("BackToList").''; - + dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref'); - + print '
'; - + print '
'; print ''; @@ -116,9 +117,9 @@ if ($id > 0 || ! empty($ref)) print ''; print '
'; - + dol_fiche_end(); - + if ($user->rights->fournisseur->facture->lire) { diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index c9aa8fd85bc..616a54f67ff 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -82,7 +82,7 @@ if ($id > 0 || ! empty($ref)) $result = $product->fetch($id, $ref); $object = $product; - + $parameters = array ('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $product, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -97,14 +97,15 @@ if ($id > 0 || ! empty($ref)) dol_fiche_head($head, 'referers', $titre, -1, $picto); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $product, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); $linkback = ''.$langs->trans("BackToList").''; - + dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref'); - + print '
'; - + print '
'; print '
'; @@ -114,11 +115,11 @@ if ($id > 0 || ! empty($ref)) print ''; print '
'; - - dol_fiche_end(); - - if ($user->rights->propale->lire) + dol_fiche_end(); + + + if ($user->rights->propale->lire) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, d.total_ht as amount,"; $sql .= " p.ref_client,"; @@ -239,7 +240,7 @@ if ($id > 0 || ! empty($ref)) } } } - + print ''; print ''; print ''; diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 69421aa5624..b7b2b98baa8 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -568,7 +568,7 @@ if ($id > 0 || $ref) // Minimum Price print ''; - print ''; // Hook formObject - $parameters=array('cols'=>2); + $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; // Desired stock print ''; @@ -707,7 +708,7 @@ if ($id > 0 || $ref) { dol_print_error($db); } - print ''; print ''; print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; } diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index e8c48352120..7b0b448ef59 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -610,6 +610,7 @@ if ($action == 'create' && $user->rights->projet->creer) // Other options $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); @@ -834,6 +835,7 @@ elseif ($object->id > 0) // Other options $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index a9e50f96f91..41ae6d28364 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -42,7 +42,7 @@ $backtopage=GETPOST('backtopage','alpha'); $cancel=GETPOST('cancel'); $search_user_id = GETPOST('search_user_id', 'int'); - + //if (! $user->rights->projet->all->lire) $mine=1; // Special for projects $object = new Project($db); @@ -97,7 +97,7 @@ if ($action == 'createtask' && $user->rights->projet->creer) //$date_end = dol_mktime($_POST['dateehour'],$_POST['dateemin'],0,$_POST['dateemonth'],$_POST['dateeday'],$_POST['dateeyear'],'user'); $date_start = dol_mktime($_POST['dateohour'],$_POST['dateomin'],0,$_POST['dateomonth'],$_POST['dateoday'],$_POST['dateoyear']); $date_end = dol_mktime($_POST['dateehour'],$_POST['dateemin'],0,$_POST['dateemonth'],$_POST['dateeday'],$_POST['dateeyear']); - + if (! $cancel) { if (empty($taskref)) @@ -139,7 +139,7 @@ if ($action == 'createtask' && $user->rights->projet->creer) $task->date_start = $date_start; $task->date_end = $date_end; $task->progress = $progress; - + // Fill array 'array_options' with data from add form $ret = $extrafields_task->setOptionalsFromPost($extralabels_task,$task); @@ -224,26 +224,26 @@ if ($id > 0 || ! empty($ref)) if ($search_user_id > 0) $param.='&search_user_id='.dol_escape_htmltag($search_user_id); // Project card - + $linkback = ''.$langs->trans("BackToList").''; - + $morehtmlref='
'; // Title $morehtmlref.=$object->title; // Thirdparty - if ($object->thirdparty->id > 0) + if ($object->thirdparty->id > 0) { $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref.='
'; - + // Define a complementary filter for search of next/prev ref. if (! $user->rights->projet->all->lire) { $objectsListId = $object->getProjectsAuthorizedForUser($user,0,0); $object->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")"; } - + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); print '
'; @@ -286,7 +286,7 @@ if ($id > 0 || ! empty($ref)) print ($end?$end:'?'); if ($object->hasDelay()) print img_warning("Late"); print ''; - + // Budget print '
' . $langs->trans('Total') . '
'.$langs->trans("BuyingPriceMin").''; + print ''; $product_fourn = new ProductFournisseur($db); if ($product_fourn->find_min_price_product_fournisseur($object->id) > 0) { @@ -611,17 +611,18 @@ if ($id > 0 || $ref) } // Stock alert threshold - print '
'.$form->editfieldkey("StockLimit",'seuil_stock_alerte',$object->seuil_stock_alerte,$object,$user->rights->produit->creer).''; + print '
'.$form->editfieldkey("StockLimit",'seuil_stock_alerte',$object->seuil_stock_alerte,$object,$user->rights->produit->creer).''; print $form->editfieldval("StockLimit",'seuil_stock_alerte',$object->seuil_stock_alerte,$object,$user->rights->produit->creer,'string'); print '
'.$form->editfieldkey($form->textwithpicto($langs->trans("DesiredStock"), $langs->trans("DesiredStockDesc"), 1),'desiredstock',$object->desiredstock,$object,$user->rights->produit->creer); - print ''; + print ''; print $form->editfieldval("DesiredStock",'desiredstock',$object->desiredstock,$object,$user->rights->produit->creer,'string'); print '
'.$langs->trans("LastMovement").''; + print '
'.$langs->trans("LastMovement").''; if ($lastmovementdate) { print dol_print_date($lastmovementdate,'dayhour').' '; @@ -800,7 +801,11 @@ if ((! empty($conf->productbatch->enabled)) && $object->hasbatch()) print ''.$langs->trans("batch_number").''.$langs->trans("EatByDate").''.$langs->trans("SellByDate").'
'.$langs->trans("Budget").''; if (strcmp($object->budget_amount, '')) print price($object->budget_amount,'',$langs,1,0,0,$conf->currency); @@ -295,16 +295,16 @@ if ($id > 0 || ! empty($ref)) // Other attributes $cols = 2; include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; - + print '
'; - + print '
'; print '
'; print '
'; print '
'; - + print ''; - + // Description print '"; } - + print '
'.$langs->trans("Description").''; print nl2br($object->description); @@ -316,13 +316,13 @@ if ($id > 0 || ! empty($ref)) print $form->showCategories($object->id,'project',1); print "
'; - + print '
'; print '
'; print ''; - + print '
'; @@ -341,7 +341,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third print ''; print ''; if (! empty($object->id)) print ''; - + dol_fiche_head(''); print ''; @@ -413,6 +413,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third // Other options $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields_task->attribute_label)) { print $object->showOptionals($extrafields_task,'edit'); @@ -460,7 +461,7 @@ else if ($id > 0 || ! empty($ref)) print ''; - + print ''; if ($optioncss != '') print ''; print ''; @@ -470,12 +471,12 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; - + $title=$langs->trans("ListOfTasks"); $linktotasks=''.$langs->trans("GoToListOfTimeConsumed").''; //print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'title_generic.png', 0, '', '', 0, 1); print load_fiche_titre($title,$linktotasks,'title_generic.png'); - + // Get list of tasks in tasksarray and taskarrayfiltered // We need all tasks (even not limited to a user because a task to user can have a parent that is not affected to him). $filteronthirdpartyid = $socid; @@ -483,7 +484,7 @@ else if ($id > 0 || ! empty($ref)) // We load also tasks limited to a particular user $tmpuser=new User($db); if ($search_user_id > 0) $tmpuser->fetch($search_user_id); - + $tasksrole=($tmpuser->id > 0 ? $taskstatic->getUserRolesForProjectsOrTasks(0, $tmpuser, $object->id, 0) : ''); //var_dump($tasksarray); //var_dump($tasksrole); @@ -494,7 +495,7 @@ else if ($id > 0 || ! empty($ref)) } print '
'; - + if (count($tasksarray) > 0) { // Link to switch in "my task" / "all task" @@ -509,7 +510,7 @@ else if ($id > 0 || ! empty($ref)) print $searchpicto; print ''; } - + print ''; // print ''; print ''; @@ -522,7 +523,7 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; print "\n"; - + if (count($tasksarray) > 0) { // Show all lines in taskarray (recursive function to go down on tree) @@ -533,11 +534,11 @@ else if ($id > 0 || ! empty($ref)) { print ''; } - + print "
'.$langs->trans("Project").''.$langs->trans("RefTask").''.$langs->trans("ProgressDeclared").' 
'.$langs->trans("NoTasks").'
"; print ''; - + // Test if database is clean. If not we clean it. //print 'mode='.$_REQUEST["mode"].' $nboftaskshown='.$nboftaskshown.' count($tasksarray)='.count($tasksarray).' count($tasksrole)='.count($tasksrole).'
'; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 2d35be97f4a..df89cac3e83 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -408,6 +408,7 @@ if ($id > 0 || ! empty($ref)) // Other options $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); diff --git a/htdocs/resource/add.php b/htdocs/resource/add.php index 2e988d16025..a294dfb94db 100644 --- a/htdocs/resource/add.php +++ b/htdocs/resource/add.php @@ -177,6 +177,7 @@ if (! $action) // Other attributes $parameters=array('objectsrc' => $objectsrc); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index a286eb60097..02d38c2b924 100644 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -203,6 +203,7 @@ if ( $object->fetch($id) > 0 ) // Other attributes $parameters=array('objectsrc' => $objectsrc); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); diff --git a/htdocs/societe/commerciaux.php b/htdocs/societe/commerciaux.php index da9b7c4a8f3..e972aaa1091 100644 --- a/htdocs/societe/commerciaux.php +++ b/htdocs/societe/commerciaux.php @@ -174,7 +174,8 @@ if (! empty($socid)) $parameters=array('socid'=>$object->id); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$obj,$action); // Note that $action and $object may have been modified by hook - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + print $hookmanager->resPrint; + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); $tmpuser->id = $obj->rowid; $tmpuser->firstname = $obj->firstname; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index c7807d8c4e5..72c9793b40b 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1150,6 +1150,7 @@ if ($action == 'create') // Other attributes $parameters = array('colspan' => ' colspan="3"'); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields, 'edit'); } diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 9e9e2b09e28..8400a95d370 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1112,6 +1112,7 @@ if ($action == 'create' || $action == 'adduserldap') // Other attributes $parameters=array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 8be0276e6ee..e53080cea73 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -272,6 +272,7 @@ if ($action == 'create') // Other attributes $parameters=array('object' => $object, 'colspan' => ' colspan="2"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); @@ -562,6 +563,7 @@ else // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit');