From be13602c7176ef13fdb54c2aa947b35f7988fc28 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 15 Sep 2012 09:02:20 +0200 Subject: [PATCH] Fix: use getDocumentsLink method --- htdocs/admin/modules.php | 20 +++--- htdocs/comm/index.php | 2 +- htdocs/comm/propal/index.php | 8 +-- htdocs/comm/propal/list.php | 3 +- htdocs/commande/class/commande.class.php | 2 +- htdocs/commande/index.php | 6 +- htdocs/commande/liste.php | 2 +- htdocs/commande/orderstoinvoice.php | 56 ++++++++-------- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/compta/facture/fiche-rec.php | 8 +-- htdocs/compta/facture/impayees.php | 8 ++- htdocs/compta/facture/list.php | 2 +- htdocs/compta/index.php | 13 ++-- htdocs/core/admin_extrafields.inc.php | 14 ++-- htdocs/core/class/html.form.class.php | 4 +- htdocs/core/class/html.formfile.class.php | 66 ++++++++++--------- htdocs/core/lib/functions.lib.php | 12 ++-- htdocs/core/lib/price.lib.php | 28 ++++---- .../doc/pdf_expedition_merou.modules.php | 40 +++++------ .../doc/pdf_expedition_rouget.modules.php | 8 +-- .../fichinter/doc/pdf_soleil.modules.php | 18 ++--- .../livraison/pdf/pdf_typhon.modules.php | 6 +- .../modules/propale/doc/pdf_azur.modules.php | 34 +++++----- .../pdf/pdf_canelle.modules.php | 8 +-- htdocs/fourn/commande/index.php | 4 +- htdocs/holiday/admin/holiday.php | 4 +- htdocs/margin/admin/margin.php | 2 +- htdocs/product/admin/product_extrafields.php | 4 +- 28 files changed, 194 insertions(+), 190 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index bc3c0d53760..e072807a6ca 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -251,19 +251,19 @@ if (! empty($categ[$categidx])) if ($conf->global->MAIN_FEATURES_LEVEL >= 1) { $form = new Form($db); - $categidx='expdev'; + $categidx='expdev'; $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx; - $head[$h][1] = $form->textwithpicto($langs->trans("ModuleFamilyExperimental"), $langs->trans('DoNotUseInProduction'), 1, 'warning', '', 0, 3); - $head[$h][2] = 'expdev'; - $h++; + $head[$h][1] = $form->textwithpicto($langs->trans("ModuleFamilyExperimental"), $langs->trans('DoNotUseInProduction'), 1, 'warning', '', 0, 3); + $head[$h][2] = 'expdev'; + $h++; } -$categidx='marketplace'; -$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx; -$head[$h][1] = $langs->trans("ModulesMarketPlaces"); -$head[$h][2] = 'marketplace'; -$h++; - +$categidx='marketplace'; +$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx; +$head[$h][1] = $langs->trans("ModulesMarketPlaces"); +$head[$h][2] = 'marketplace'; +$h++; + dol_fiche_head($head, $mode, $langs->trans("Modules")); diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index b46d47c57da..7ba7a2412fb 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -516,7 +516,7 @@ if ($conf->propal->enabled && $user->rights->propal->lire) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->propalid; - $formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir); print ''; print ""; diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 831970d2e14..b341e8a9c11 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -257,7 +257,7 @@ if ($resql) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir); print ''; print ''; @@ -334,7 +334,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->propalid; - $formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir); print ''; print ""; @@ -418,7 +418,7 @@ if ($conf->propal->enabled) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir); print ''; print ''; @@ -490,7 +490,7 @@ if ($conf->propal->enabled) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir); print ''; print ''; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 7092e8dc180..8603f0a7394 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -320,8 +320,7 @@ if ($result) $filename=dol_sanitizeFileName($objp->ref); $filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($objp->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->propalid; - //$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1); - print $formfile->getDocumentsLink('propal', $filename, $filedir); + print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); print ''; if ($objp->client == 1) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 71a863b6e07..091701aeeac 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3140,7 +3140,7 @@ class OrderLine $sql.= " , total_ht=".price2num($this->total_ht).""; $sql.= " , total_tva=".price2num($this->total_tva).""; $sql.= " , total_ttc=".price2num($this->total_ttc).""; - $sql.= " , total_localtax1=".price2num($this->total_localtax1); + $sql.= " , total_localtax1=".price2num($this->total_localtax1); $sql.= " , total_localtax2=".price2num($this->total_localtax2); } $sql.= " , fk_product_fournisseur_price=".(! empty($this->fk_fournprice)?$this->fk_fournprice:"null"); diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 0c7a40d2ac8..7b5e3391330 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -262,7 +262,7 @@ if ($resql) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir); print ''; print ''; @@ -331,7 +331,7 @@ if ($conf->commande->enabled) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir); print ''; print ''; @@ -402,7 +402,7 @@ if ($conf->commande->enabled) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir); print ''; print ''; diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index 08c68939903..641d13f8643 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -308,7 +308,7 @@ if ($resql) $filename=dol_sanitizeFileName($objp->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir); print ''; print ''; diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index c0ef16db6fb..ec94022d853 100755 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -469,10 +469,10 @@ if ($action == 'create') while ($i < $n) { print ''; - + $i++; } - + print "\n"; // Button "Create Draft" print '
'; @@ -496,7 +496,7 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs)) }); escape($sall)."%' OR c.note LIKE '%".$db->escape($sall)."%')"; } - + //Date filter if ($date_start && $date_end) $sql.= " AND c.date_commande >= '".$db->idate($date_start)."' AND c.date_commande <= '".$db->idate($date_end)."'"; if ($date_starty && $date_endy) $sql.= " AND c.date_livraison >= '".$db->idate($date_starty)."' AND c.date_livraison <= '".$db->idate($date_endy)."'"; - + if (!empty($sref_client)) { $sql.= ' AND c.ref_client LIKE \'%'.$db->escape($sref_client).'%\''; } $sql.= ' ORDER BY '.$sortfield.' '.$sortorder; $resql = $db->query($sql); - + if ($resql) { if ($socid) @@ -569,7 +569,7 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs)) print '

'; $companystatic->id=$socid; $companystatic->nom=$soc->nom; - + print $companystatic->getNomUrl(1,'customer'); print '

'; print ''; @@ -581,7 +581,7 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs)) print_liste_field_titre($langs->trans('Status'),'','','','','align="right"'); print_liste_field_titre($langs->trans('GenerateBill'),'','','','','align="center"'); print ''; - + // Lignes des champs de filtre print ''; print ''; @@ -593,88 +593,88 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs)) //print ''; - + //DATE DELIVERY print ''; - + //SEARCH BUTTON print ''; - + print ''; print ''; - + print ''; $var=True; $generic_commande = new Commande($db); - + while ($i < $num) { $objp = $db->fetch_object($resql); $var=!$var; print ''; print ''; - + print ''; - + // Order date print ''; - + //Delivery date print ''; - + // Statut print ''; - + // Checkbox print '' ; - + print ''; - + $total = $total + $objp->price; $subtotal = $subtotal + $objp->price; $i++; } print '
'; print ''; print ''; - + //DATE ORDER print ''; print $period; print ''; print $periodely; print ''; print ''; - + //ALL/NONE print ''; if ($conf->use_javascript_ajax) print ''.$langs->trans("All").' / '.$langs->trans("None").''; print '
'; - + $generic_commande->id=$objp->rowid; $generic_commande->ref=$objp->ref; - + print ''; print ''; - + print ''; - + print '
'; print $generic_commande->getNomUrl(1,$objp->fk_statut); print ''; if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && $db->jdate($objp->date_valid) < ($now - $conf->commande->client->warning_delay)) print img_picto($langs->trans("Late"),"warning"); print ''; $filename=dol_sanitizeFileName($objp->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir); print '
'; print '
'.$objp->ref_client.''; print dol_print_date($db->jdate($objp->date_commande),'day'); print ''; print dol_print_date($db->jdate($objp->date_livraison),'day'); print ''.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).''; print ''; print '
'; - + /* * Boutons actions */ diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 3ec0b1576e7..054b2a13760 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3446,7 +3446,7 @@ class FactureLigne $sql.= ",total_ht=".price2num($this->total_ht).""; $sql.= ",total_tva=".price2num($this->total_tva).""; $sql.= ",total_ttc=".price2num($this->total_ttc).""; - $sql.= ",total_localtax1=".price2num($this->total_localtax1).""; + $sql.= ",total_localtax1=".price2num($this->total_localtax1).""; $sql.= ",total_localtax2=".price2num($this->total_localtax2).""; } $sql.= " , fk_product_fournisseur_price='".$this->fk_fournprice."'"; diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 1f014a65aaf..a0173e74fa4 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -301,10 +301,10 @@ if ($action == 'create') $prodprice=$product_static->price; // price HT print ''.price($prodprice)."\n"; } - else - { - print ' '; - } + else + { + print ' '; + } } print ""; diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 6cd4850ddd8..f81252e39e6 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -340,7 +340,7 @@ if ($resql) print ''; $filename=dol_sanitizeFileName($objp->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber); - $foundpdf=$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1,$param); + print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir); print ''; print ''; @@ -365,8 +365,10 @@ if ($resql) // Checkbox print ''; - if ($foundpdf) print ''; - else print ' '; + if (! empty($formfile->numoffiles)) + print ''; + else + print ' '; print '' ; print "\n"; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 8a19de20180..9d668723f34 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -341,7 +341,7 @@ if ($resql) $filename=dol_sanitizeFileName($objp->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber); $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->facid; - $formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir); print ''; print ''; print ''; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index bf2c773265b..a0ffe2b9035 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -320,7 +320,7 @@ print ''; print ''; // Last modified customer invoices -if ($conf->facture->enabled && $user->rights->facture->lire) +if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { $langs->load("boxes"); $facstatic=new Facture($db); @@ -378,7 +378,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire) $filename=dol_sanitizeFileName($obj->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber); $urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid; - $formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir); print ''; print ''; @@ -709,7 +709,7 @@ if ($conf->tax->enabled && $user->rights->tax->charges->lire) /* * Customers orders to be billed */ -if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->commande->lire) +if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $user->rights->commande->lire) { $commandestatic=new Commande($db); $langs->load("orders"); @@ -770,7 +770,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir); print ''; print ''; @@ -813,7 +813,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman /* * Unpaid customers invoices */ -if ($conf->facture->enabled && $user->rights->facture->lire) +if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { $facstatic=new Facture($db); @@ -853,7 +853,6 @@ if ($conf->facture->enabled && $user->rights->facture->lire) { $obj = $db->fetch_object($resql); - print ''; print ''; @@ -871,7 +870,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire) $filename=dol_sanitizeFileName($obj->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber); $urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid; - $formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir); print ''; print ''; diff --git a/htdocs/core/admin_extrafields.inc.php b/htdocs/core/admin_extrafields.inc.php index 5384c3c4490..35492db4fdc 100644 --- a/htdocs/core/admin_extrafields.inc.php +++ b/htdocs/core/admin_extrafields.inc.php @@ -25,9 +25,9 @@ $maxsizestring=255; $maxsizeint=10; $extrasize=GETPOST('size'); -if (GETPOST('type')=='double' && strpos($extrasize,',')===false) $extrasize='24,8'; -if (GETPOST('type')=='date') $extrasize=''; -if (GETPOST('type')=='datetime') $extrasize=''; +if (GETPOST('type')=='double' && strpos($extrasize,',')===false) $extrasize='24,8'; +if (GETPOST('type')=='date') $extrasize=''; +if (GETPOST('type')=='datetime') $extrasize=''; // Add attribute @@ -38,10 +38,10 @@ if ($action == 'add') // Check values if (! GETPOST('type')) { - $error++; - $langs->load("errors"); - $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Type")); - $action = 'create'; + $error++; + $langs->load("errors"); + $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Type")); + $action = 'create'; } if (GETPOST('type')=='varchar' && $extrasize > $maxsizestring) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d2eb3c0f4af..299df8afdf1 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -369,8 +369,8 @@ class Form else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag $s=""; if (empty($notabs)) $s.=''; - if ($direction < 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.''; - if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?' ':'').$text.(($direction > 0)?' ':'').''; + if ($direction < 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.''; + if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?' ':'').$text.(($direction > 0)?' ':'').''; if ($direction > 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.''; if (empty($notabs)) $s.='
'; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index edef760ec00..b7f3bb0e6b4 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -199,9 +199,9 @@ class FormFile global $langs,$bc,$conf; - // For backward compatibility - if (! empty($iconPDF)) { - return $this->getDocumentsLink($modulepart, $filename, $filedir); + // For backward compatibility + if (! empty($iconPDF)) { + return $this->getDocumentsLink($modulepart, $filename, $filedir); } $forname='builddoc'; @@ -470,15 +470,15 @@ class FormFile if (preg_match('/text/',$mime)) $out.= ' target="_blank"'; $out.= '>'; $out.= img_mime($file["name"],$langs->trans("File").': '.$file["name"]).' '.dol_trunc($file["name"],$maxfilenamelength); - $out.= ''."\n"; + $out.= ''."\n"; $out.= ''; - + // Show file size - $size=(! empty($file['size'])?$file['size']:dol_filesize($filedir."/".$file["name"])); + $size=(! empty($file['size'])?$file['size']:dol_filesize($filedir."/".$file["name"])); $out.= ''.dol_print_size($size).''; - + // Show file date - $date=(! empty($file['date'])?$file['date']:dol_filemtime($filedir."/".$file["name"])); + $date=(! empty($file['date'])?$file['date']:dol_filemtime($filedir."/".$file["name"])); $out.= ''.dol_print_date($date, 'dayhour').''; if ($delallowed) @@ -526,35 +526,39 @@ class FormFile } $out=''; - + + $this->numoffiles=0; + $file_list=dol_dir_list($filedir, 'files', 0, $filename.'.pdf', '\.meta$|\.png$'); - // For ajax treatment + // For ajax treatment $out.= '
'.img_picto('', 'refresh').'
'."\n"; if (! empty($file_list)) { - // Loop on each file found - foreach($file_list as $file) - { - // Define relative path for download link (depends on module) - $relativepath=$file["name"]; // Cas general - if ($filename) $relativepath=$filename."/".$file["name"]; // Cas propal, facture... - // Autre cas - if ($modulepart == 'donation') { - $relativepath = get_exdir($filename,2).$file["name"]; - } - if ($modulepart == 'export') { - $relativepath = $file["name"]; - } - - // Show file name with link to download - $out.= 'numoffiles++; } } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 160970b3aae..73b8541ac2a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -739,12 +739,12 @@ function dol_format_address($object) } else if (in_array($object->country_code,array('GB'))) // UK: title firstname name \n address lines \n town state \n zip \n country { - $ret .= ($ret ? "\n" : '' ).$object->town; - if ($object->state && in_array($object->country_code,$countriesusingstate)) - { - $ret.=", ".$object->departement; - } - if ($object->zip) $ret .= ($ret ? "\n" : '' ).$object->zip; + $ret .= ($ret ? "\n" : '' ).$object->town; + if ($object->state && in_array($object->country_code,$countriesusingstate)) + { + $ret.=", ".$object->departement; + } + if ($object->zip) $ret .= ($ret ? "\n" : '' ).$object->zip; } else // Other: title firstname name \n address lines \n zip town \n country { diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index 189e02b2cd0..78a357cd71b 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -56,16 +56,16 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $localtax1 $result=array(); // TODO Remove this code. Added for backward compatibility. To remove once localtaxX_type is provided by caller. - if ($localtax1_type == '?') - { - if ($mysoc->country_code=='ES') $localtax1_type='1'; - else $localtax1_type='0'; - } - if ($localtax2_type == '?') - { - if ($mysoc->country_code=='ES') $localtax2_type='1'; - else $localtax2_type='0'; - } + if ($localtax1_type == '?') + { + if ($mysoc->country_code=='ES') $localtax1_type='1'; + else $localtax1_type='0'; + } + if ($localtax2_type == '?') + { + if ($mysoc->country_code=='ES') $localtax2_type='1'; + else $localtax2_type='0'; + } // initialize total (may be HT or TTC depending on price_base_type) $tot_sans_remise = $pu * $qty; @@ -166,10 +166,10 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $localtax1 $apply_tax = false; //If price is 'TTC' we need to have the totals without VAT for a correct calculation - if ($price_base_type=='TTC') - { - $tot_sans_remise= price2num($tot_sans_remise / (1 + ($txtva / 100)),'MU'); - $tot_avec_remise= price2num($tot_avec_remise / (1 + ($txtva / 100)),'MU'); + if ($price_base_type=='TTC') + { + $tot_sans_remise= price2num($tot_sans_remise / (1 + ($txtva / 100)),'MU'); + $tot_avec_remise= price2num($tot_avec_remise / (1 + ($txtva / 100)),'MU'); } switch($localtax1_type) { diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php index bd09ce8cd17..906a1a74e37 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php @@ -162,7 +162,7 @@ class pdf_expedition_merou extends ModelePdfExpedition $pagenb=0; $pdf->SetDrawColor(128,128,128); - $pdf->AliasNbPages(); + $pdf->AliasNbPages(); $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); $pdf->SetSubject($outputlangs->transnoentities("Sending")); @@ -182,9 +182,9 @@ class pdf_expedition_merou extends ModelePdfExpedition $pdf->SetTextColor(0,0,0); $tab_top = 52; - $tab_top_newpage = 10; + $tab_top_newpage = 10; $tab_height = $this->page_hauteur - $tab_top - $heightforfooter; - $tab_height_newpage = $this->page_hauteur - $tab_top_newpage - $heightforfooter; + $tab_height_newpage = $this->page_hauteur - $tab_top_newpage - $heightforfooter; $pdf->SetFillColor(240,240,240); $pdf->SetTextColor(0,0,0); @@ -219,13 +219,13 @@ class pdf_expedition_merou extends ModelePdfExpedition $pdf->SetFont('','', $default_font_size - 3); - //Creation des cases a cocher - $pdf->Rect(10+3, $curY, 3, 3); - $pdf->Rect(20+3, $curY, 3, 3); - //Insertion de la reference du produit - $pdf->SetXY(30, $curY); - $pdf->SetFont('','B', $default_font_size - 3); - $pdf->MultiCell(24, 3, $outputlangs->convToOutputCharset($object->lines[$i]->ref), 0, 'L', 0); + //Creation des cases a cocher + $pdf->Rect(10+3, $curY, 3, 3); + $pdf->Rect(20+3, $curY, 3, 3); + //Insertion de la reference du produit + $pdf->SetXY(30, $curY); + $pdf->SetFont('','B', $default_font_size - 3); + $pdf->MultiCell(24, 3, $outputlangs->convToOutputCharset($object->lines[$i]->ref), 0, 'L', 0); $pdf->SetXY(140, $curY); $pdf->MultiCell(30, 3, $object->lines[$i]->qty_asked, 0, 'C', 0); @@ -269,16 +269,16 @@ class pdf_expedition_merou extends ModelePdfExpedition } } - // Show square - if ($pagenb == 1) - { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 0); - $bottomlasttab=$this->page_hauteur - $heightforinfotot + 1; - } - else - { - $this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 0); - $bottomlasttab=$this->page_hauteur - $heightforinfotot + 1; + // Show square + if ($pagenb == 1) + { + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 0); + $bottomlasttab=$this->page_hauteur - $heightforinfotot + 1; + } + else + { + $this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 0); + $bottomlasttab=$this->page_hauteur - $heightforinfotot + 1; } // Pied de page diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php index cd4af15d121..f30b676cfc0 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php @@ -240,10 +240,10 @@ class pdf_expedition_rouget extends ModelePdfExpedition $pdf->setPage($pageposbefore); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. - // We suppose that a too long description is moved completely on next page - if ($pageposafter > $pageposbefore) { - $pdf->setPage($pageposafter); $curY = $tab_top_newpage; - } + // We suppose that a too long description is moved completely on next page + if ($pageposafter > $pageposbefore) { + $pdf->setPage($pageposafter); $curY = $tab_top_newpage; + } $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index e71db402c7a..653ec0d4344 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -243,8 +243,8 @@ class pdf_soleil extends ModelePDFFicheinter { $curY = $nexY; - $pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. - $pageposbefore=$pdf->getPage(); + $pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pageposbefore=$pdf->getPage(); $pdf->SetFont('','B', $default_font_size - 1); $pdf->SetXY($this->marge_gauche, $curY); @@ -273,16 +273,16 @@ class pdf_soleil extends ModelePDFFicheinter $nexY+=2; // Passe espace entre les lignes - $pageposafter=$pdf->getPage(); - $pdf->setPage($pageposbefore); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pageposafter=$pdf->getPage(); + $pdf->setPage($pageposbefore); + $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. - // We suppose that a too long description is moved completely on next page - if ($pageposafter > $pageposbefore) { - $pdf->setPage($pageposafter); $curY = $tab_top_newpage; + // We suppose that a too long description is moved completely on next page + if ($pageposafter > $pageposbefore) { + $pdf->setPage($pageposafter); $curY = $tab_top_newpage; } - $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut // Detect if some page were added automatically and output _tableau for past pages while ($pagenb < $pageposafter) diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php index 7f5a25550a4..eebe473fd1e 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php @@ -254,9 +254,9 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->setPage($pageposbefore); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. - // We suppose that a too long description is moved completely on next page - if ($pageposafter > $pageposbefore) { - $pdf->setPage($pageposafter); $curY = $tab_top_newpage; + // We suppose that a too long description is moved completely on next page + if ($pageposafter > $pageposbefore) { + $pdf->setPage($pageposafter); $curY = $tab_top_newpage; } $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 7cd7d972796..6213ed5fd3a 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -36,21 +36,21 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; */ class pdf_azur extends ModelePDFPropales { - var $db; - var $name; - var $description; - var $type; - - var $phpmin = array(4,3,0); // Minimum version of PHP required by module - var $version = 'dolibarr'; - - var $page_largeur; - var $page_hauteur; - var $format; - var $marge_gauche; - var $marge_droite; - var $marge_haute; - var $marge_basse; + var $db; + var $name; + var $description; + var $type; + + var $phpmin = array(4,3,0); // Minimum version of PHP required by module + var $version = 'dolibarr'; + + var $page_largeur; + var $page_hauteur; + var $format; + var $marge_gauche; + var $marge_droite; + var $marge_haute; + var $marge_basse; var $emetteur; // Objet societe qui emet @@ -279,7 +279,7 @@ class pdf_azur extends ModelePDFPropales // We suppose that a too long description is moved completely on next page if ($pageposafter > $pageposbefore) { $pdf->setPage($pageposafter); $curY = $tab_top_newpage; - } + } $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut @@ -1057,7 +1057,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetXY($posx,$posy); $pdf->SetFillColor(230,230,230); $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); - $pdf->SetTextColor(0,0,60); + $pdf->SetTextColor(0,0,60); // Show sender name $pdf->SetXY($posx+2,$posy+3); diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 756d94726e5..652082cc57a 100755 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -273,10 +273,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->setPage($pageposbefore); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. -// We suppose that a too long description is moved completely on next page -if ($pageposafter > $pageposbefore) { - $pdf->setPage($pageposafter); $curY = $tab_top_newpage; -} +// We suppose that a too long description is moved completely on next page +if ($pageposafter > $pageposbefore) { + $pdf->setPage($pageposafter); $curY = $tab_top_newpage; +} $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index 5d31d8317d7..a8281927c2b 100755 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -348,7 +348,7 @@ if ($resql) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir); print ''; print ''; @@ -416,7 +416,7 @@ print ''; $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; -$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); +print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir); print ''; print ''; diff --git a/htdocs/holiday/admin/holiday.php b/htdocs/holiday/admin/holiday.php index df5fdd52384..b73694e187e 100644 --- a/htdocs/holiday/admin/holiday.php +++ b/htdocs/holiday/admin/holiday.php @@ -33,8 +33,8 @@ require_once DOL_DOCUMENT_ROOT. '/user/class/usergroup.class.php'; $action=GETPOST('action'); -$langs->load("admin"); -$langs->load("holiday"); +$langs->load("admin"); +$langs->load("holiday"); // Si pas administrateur if (! $user->admin) accessforbidden(); diff --git a/htdocs/margin/admin/margin.php b/htdocs/margin/admin/margin.php index 69d3c574dd0..f04cda7f072 100644 --- a/htdocs/margin/admin/margin.php +++ b/htdocs/margin/admin/margin.php @@ -248,7 +248,7 @@ print ''; print ''; -dol_fiche_end(); +dol_fiche_end(); print '
'; diff --git a/htdocs/product/admin/product_extrafields.php b/htdocs/product/admin/product_extrafields.php index 4d979c9e493..67dea9bb7a9 100755 --- a/htdocs/product/admin/product_extrafields.php +++ b/htdocs/product/admin/product_extrafields.php @@ -37,8 +37,8 @@ $extrafields = new ExtraFields($db); $form = new Form($db); // List of supported format -$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); -$type2label=array(''); +$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$type2label=array(''); foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); $action=GETPOST('action', 'alpha');