diff --git a/htdocs/compta/compta-files.php b/htdocs/compta/compta-files.php index 23eff46da51..fa1aa068283 100644 --- a/htdocs/compta/compta-files.php +++ b/htdocs/compta/compta-files.php @@ -87,7 +87,7 @@ if ($user->societe_id > 0) $filesarray=array(); $result=false; -if(($action=="searchfiles"||$action=="dl" ) && $date_start && $date_stop){ +if(($action=="searchfiles" || $action=="dl" ) && $date_start && $date_stop) { $wheretail=" '".$db->idate($date_start)."' AND '".$db->idate($date_stop)."'"; $sql="SELECT rowid as id, ref as ref,paye as paid, total_ttc, fk_soc, datef as date, 'Invoice' as item FROM ".MAIN_DB_PREFIX."facture"; $sql.=" WHERE datef between ".$wheretail; diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index 4191563eaec..c39a23246e8 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -488,7 +488,7 @@ if ($sql_select) $description=(! empty($conf->global->PRODUIT_DESC_IN_FORM)?'':dol_htmlentitiesbr($objp->description)); } - if (($objp->info_bits & 2) == 2) { + if (($objp->info_bits & 2) == 2) { print ''; $txt=''; print img_object($langs->trans("ShowReduc"), 'reduc').' '; diff --git a/htdocs/core/class/cmeasuringunits.class.php b/htdocs/core/class/cmeasuringunits.class.php index e801969954b..718db8dab11 100644 --- a/htdocs/core/class/cmeasuringunits.class.php +++ b/htdocs/core/class/cmeasuringunits.class.php @@ -164,9 +164,11 @@ class CMeasuringUnits // extends CommonObject * Load object in memory from database * * @param int $id Id object + * @param string $unit_type unit type * @param string $code Code * @param string $label Label - * @return int <0 if KO, >0 if OK + * @param string $short_label Short Label + * @return int <0 if KO, >0 if OK */ function fetch($id, $unit_type='', $code = '', $short_label = '') { diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 235dde63096..98d7e720628 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -488,10 +488,10 @@ abstract class CommonDocGenerator if (empty($resarray[$array_key.'_total_vat_'.$vatformated])) $resarray[$array_key.'_total_vat_'.$vatformated]=0; $resarray[$array_key.'_total_vat_'.$vatformated]+=$line->total_tva; $resarray[$array_key.'_total_vat_locale_'.$vatformated]=price($resarray[$array_key.'_total_vat_'.$vatformated]); - + $totalUp += $line->subprice * $line->qty; } - + // @GS: Calculate total up and total discount percentage // Note that this added fields correspond to nothing in Dolibarr (Dolibarr manage discount on lines not globally) $resarray['object_total_up'] = $totalUp; @@ -501,7 +501,7 @@ abstract class CommonDocGenerator $resarray['object_total_discount_locale'] = price($resarray['object_total_discount'], 0, $outputlangs); } } - + // Retrieve extrafields if (is_array($object->array_options) && count($object->array_options)) { @@ -514,7 +514,7 @@ abstract class CommonDocGenerator $resarray = $this->fill_substitutionarray_with_extrafields($object, $resarray, $extrafields, $array_key, $outputlangs); } - + return $resarray; } @@ -585,7 +585,7 @@ abstract class CommonDocGenerator $extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey, true); $line->fetch_optionals(); - $resarray = $this->fill_substitutionarray_with_extrafields($line, $resarray, $extrafields, $array_key=$array_key, $outputlangs); + $resarray = $this->fill_substitutionarray_with_extrafields($line, $resarray, $extrafields, $array_key, $outputlangs); // Load product data optional fields to the line -> enables to use "line_options_{extrafield}" if (isset($line->fk_product) && $line->fk_product > 0) diff --git a/htdocs/core/class/cunits.class.php b/htdocs/core/class/cunits.class.php index 7afcb5ba8d2..351de8b7970 100644 --- a/htdocs/core/class/cunits.class.php +++ b/htdocs/core/class/cunits.class.php @@ -160,7 +160,7 @@ class CUnits // extends CommonObject * * @param int $id Id object * @param string $code Code - * @param string $label Label + * @param string $short_label Label * @return int <0 if KO, >0 if OK */ function fetch($id, $code = '', $short_label = '') diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 10107b37a01..1d4ca11c4d3 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -461,7 +461,6 @@ function show_stats_for_company($product, $socid) return $nblines++; } - /** * Return translation label of a unit key * @@ -476,6 +475,7 @@ function measuring_units_string($unit, $measuring_style = '') require_once DOL_DOCUMENT_ROOT.'/core/class/cmeasuringunits.class.php'; $measuringUnits= new CMeasuringUnits($db); $result=$measuringUnits->fetchAll('','', 0, 0, array('t.code'=> $unit,'t.unit_type'=>$measuring_style,'t.active'=>1)); + if ($result<0) { return -1; } else { diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 8bdbaac5861..8e5d0dc2b90 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -207,18 +207,18 @@ if ($result) print "
| '.$langs->trans("EstimatedStockValueShort").' | '; - print price((empty($calcproducts['value'])?'0':price2num($calcproducts['value'],'MT')), 0, $langs, 0, -1, -1, $conf->currency); + print price((empty($calcproducts['value'])?'0':price2num($calcproducts['value'], 'MT')), 0, $langs, 0, -1, -1, $conf->currency); print " | '.dol_print_date($db->jdate($objp->datem),'dayhour').' | '; + print ''.dol_print_date($db->jdate($objp->datem), 'dayhour').' | '; } if (! empty($arrayfields['p.ref']['checked'])) { // Product ref print ''; - print $productstatic->getNomUrl(1,'stock',16); + print $productstatic->getNomUrl(1, 'stock', 16); print " | \n"; } if (! empty($arrayfields['p.label']['checked'])) @@ -1007,11 +1013,11 @@ if ($resql) } if (! empty($arrayfields['pl.eatby']['checked'])) { - print ''. dol_print_date($objp->eatby,'day') .' | '; + print ''. dol_print_date($objp->eatby, 'day') .' | '; } if (! empty($arrayfields['pl.sellby']['checked'])) { - print ''. dol_print_date($objp->sellby,'day') .' | '; + print ''. dol_print_date($objp->sellby, 'day') .' | '; } // Warehouse if (! empty($arrayfields['e.ref']['checked'])) @@ -1114,20 +1120,20 @@ if ($resql) $productidselected=$key; $productlabelselected=$val; } - $datebefore=dol_get_first_day($year?$year:strftime("%Y",time()), $month?$month:1, true); - $dateafter=dol_get_last_day($year?$year:strftime("%Y",time()), $month?$month:12, true); + $datebefore=dol_get_first_day($year?$year:strftime("%Y", time()), $month?$month:1, true); + $dateafter=dol_get_last_day($year?$year:strftime("%Y", time()), $month?$month:12, true); $balancebefore=$movement->calculateBalanceForProductBefore($productidselected, $datebefore); $balanceafter=$movement->calculateBalanceForProductBefore($productidselected, $dateafter); //print '
| '; - print $langs->trans("NbOfProductBeforePeriod", $productlabelselected, dol_print_date($datebefore,'day','gmt')); + print $langs->trans("NbOfProductBeforePeriod", $productlabelselected, dol_print_date($datebefore, 'day', 'gmt')); //print ' | '; //print '';
print ': '.$balancebefore;
print " \n"; //print ' | |||||
| '; - print $langs->trans("NbOfProductAfterPeriod", $productlabelselected, dol_print_date($dateafter,'day','gmt')); + print $langs->trans("NbOfProductAfterPeriod", $productlabelselected, dol_print_date($dateafter, 'day', 'gmt')); //print ' | '; //print '';
print ': '.$balanceafter;
@@ -1169,7 +1175,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete' && $id>0)
$genallowed=$user->rights->stock->lire;
$delallowed=$user->rights->stock->creer;
- print $formfile->showdocuments($modulepart,$objectref,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang, '', $object);
+ print $formfile->showdocuments($modulepart, $objectref, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 28, 0, '', 0, '', $object->default_lang, '', $object);
$somethingshown=$formfile->numoffiles;
print ' ';
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index be87a52fcd9..e67545bbc3d 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -1045,7 +1045,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
$contactsofproject=$projectstatic->getListContactId('internal');
if (count($contactsofproject)>0)
{
- if (in_array($user->id, $userid=$contactsofproject)) $userid = $user->id;
+ if (in_array($user->id, $contactsofproject)) $userid = $user->id;
else $userid=$contactsofproject[0];
if ($projectstatic->public) $contactsofproject = array();
print $form->select_dolusers((GETPOST('userid')?GETPOST('userid'):$userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'maxwidth200');
diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php
index 39b789c2b7d..054a85211f7 100644
--- a/htdocs/resource/class/html.formresource.class.php
+++ b/htdocs/resource/class/html.formresource.class.php
@@ -85,7 +85,7 @@ class FormResource
$resourcestat = new Dolresource($this->db);
- $resources_used = $resourcestat->fetch_all('ASC', 't.rowid', $limit, $offset, $filter='');
+ $resources_used = $resourcestat->fetch_all('ASC', 't.rowid', $limit, $offset, '');
if ($outputmode != 2)
{
diff --git a/htdocs/webservices/server_category.php b/htdocs/webservices/server_category.php
index 74d175ac2c9..b670c0bf09d 100644
--- a/htdocs/webservices/server_category.php
+++ b/htdocs/webservices/server_category.php
@@ -209,6 +209,7 @@ function getCategory($authentication, $id)
{
$fuser->getrights();
+ $nbmax = 10;
if ($fuser->rights->categorie->lire)
{
$categorie=new Categorie($db);
@@ -228,7 +229,7 @@ function getCategory($authentication, $id)
//'visible'=>$categorie->visible,
'type' => $categorie->type,
'dir' => $pdir,
- 'photos' => $categorie->liste_photos($dir, $nbmax=10)
+ 'photos' => $categorie->liste_photos($dir, $nbmax)
);
$cats = $categorie->get_filles();
@@ -248,7 +249,7 @@ function getCategory($authentication, $id)
//'visible'=>$fille->visible,
'type'=>$fille->type,
'dir' => $pdir,
- 'photos' => $fille->liste_photos($dir, $nbmax=10)
+ 'photos' => $fille->liste_photos($dir, $nbmax)
);
}
}
diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php
index d49a76af117..05b05424b4f 100644
--- a/htdocs/webservices/server_productorservice.php
+++ b/htdocs/webservices/server_productorservice.php
@@ -364,6 +364,7 @@ function getProductOrService($authentication, $id = '', $ref = '', $ref_ext = ''
$fuser->getrights();
+ $nbmax = 10;
if ($fuser->rights->produit->lire || $fuser->rights->service->lire)
{
$product=new Product($db);
@@ -417,7 +418,7 @@ function getProductOrService($authentication, $id = '', $ref = '', $ref_ext = ''
'pmp' => $product->pmp,
'import_key' => $product->import_key,
'dir' => $pdir,
- 'images' => $product->liste_photos($dir, $nbmax=10)
+ 'images' => $product->liste_photos($dir, $nbmax)
);
//Retreive all extrafield for thirdsparty
@@ -1029,6 +1030,7 @@ function getProductsForCategory($authentication, $id, $lang = '')
$fuser->getrights();
+ $nbmax = 10;
if ($fuser->rights->produit->lire)
{
$categorie=new Categorie($db);
@@ -1086,7 +1088,7 @@ function getProductsForCategory($authentication, $id, $lang = '')
'pmp' => $obj->pmp,
'import_key' => $obj->import_key,
'dir' => $pdir,
- 'images' => $obj->liste_photos($dir, $nbmax=10)
+ 'images' => $obj->liste_photos($dir, $nbmax)
);
//Retreive all extrafield for thirdsparty
| |||||