Skip to content

Commit

Permalink
New: Uniformize hooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 27, 2013
1 parent a22d39a commit 6c1bbd3
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions htdocs/fourn/facture/fiche.php
Expand Up @@ -749,7 +749,7 @@
{
$mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)); // Must not contain "
setEventMessage($mesg);

$error=0;

// Initialisation donnees
Expand Down Expand Up @@ -1177,7 +1177,8 @@
if (1==2 && ! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE))
{
print '<tr class="liste_titre">';
print '<td>&nbsp;</td><td>'.$langs->trans('Label').'</td>';
print '<td>&nbsp;</td>';
print '<td>'.$langs->trans('Label').'</td>';
print '<td align="right">'.$langs->trans('PriceUHT').'</td>';
print '<td align="right">'.$langs->trans('VAT').'</td>';
print '<td align="right">'.$langs->trans('Qty').'</td>';
Expand All @@ -1201,7 +1202,7 @@
}

// Other options
$parameters=array();
$parameters=array('colspan' => ' colspan="6"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook

// Bouton "Create Draft"
Expand Down Expand Up @@ -1571,7 +1572,7 @@
}

// Other options
$parameters=array('colspan' => ' colspan="3"');
$parameters=array('colspan' => ' colspan="4"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook

print '</table>';
Expand Down Expand Up @@ -1736,6 +1737,12 @@
// Show range
print_date_range($date_start,$date_end);
}

if (is_object($hookmanager))
{
$parameters=array('fk_parent_line'=>$line->fk_parent_line, 'line'=>$object->lines[$i],'var'=>$var,'num'=>$num,'i'=>$i);
$reshook=$hookmanager->executeHooks('formViewProductSupplierOptions',$parameters,$object,$action);
}
print '</td>';

// VAT
Expand Down Expand Up @@ -1808,7 +1815,7 @@
if (is_object($hookmanager))
{
$parameters=array();
$reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action);
$reshook=$hookmanager->executeHooks('formCreateSupplierProductOptions',$parameters,$object,$action);
}

// Editor wysiwyg
Expand Down Expand Up @@ -2036,7 +2043,7 @@
* Show mail form
*/
if ($action == 'presend')
{
{
$ref = dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref, preg_quote($object->ref,'/'));
Expand Down Expand Up @@ -2092,12 +2099,12 @@
$formmail->substit['__SIGNATURE__']=$user->signature;
$formmail->substit['__PERSONALIZED__']='';
$formmail->substit['__CONTACTCIVNAME__']='';

//Find the good contact adress
$custcontact='';
$contactarr=array();
$contactarr=$object->liste_contact(-1,'external');

if (is_array($contactarr) && count($contactarr)>0) {
foreach($contactarr as $contact) {
if ($contact['libelle']==$langs->trans('TypeContact_invoice_supplier_external_BILLING')) {
Expand All @@ -2107,12 +2114,12 @@
$custcontact=$contactstatic->getFullName($langs,1);
}
}

if (!empty($custcontact)) {
$formmail->substit['__CONTACTCIVNAME__']=$custcontact;
}
}

// Tableau des parametres complementaires
$formmail->param['action']='send';
$formmail->param['models']='invoice_supplier_send';
Expand Down

0 comments on commit 6c1bbd3

Please sign in to comment.