diff --git a/dev/initdata/generate-invoice.php b/dev/initdata/generate-invoice.php index bfdda2896a1..0c754b1c874 100755 --- a/dev/initdata/generate-invoice.php +++ b/dev/initdata/generate-invoice.php @@ -152,7 +152,7 @@ while ($i < GEN_NUMBER_FACTURE && $result >= 0) $fuser = new User($db); $fuser->fetch(mt_rand(1, 2)); $fuser->getRights(); - + $result=$object->create($fuser); if ($result >= 0) { diff --git a/dev/initdata/generate-proposal.php b/dev/initdata/generate-proposal.php index 30c9471a281..ad8cf6025bb 100755 --- a/dev/initdata/generate-proposal.php +++ b/dev/initdata/generate-proposal.php @@ -176,7 +176,7 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0) $fuser = new User($db); $fuser->fetch(mt_rand(1, 2)); $fuser->getRights(); - + $object->contactid = $contids[$socids[$socid]][0]; $object->socid = $socids[$socid]; $object->datep = $dates[mt_rand(1, count($dates)-1)]; @@ -200,7 +200,7 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0) } $xnbp++; } - + $result=$object->valid($fuser); if ($result > 0) { diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index 32c44ce91e4..8c01eea6d99 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -201,7 +201,7 @@ - + diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 60f5a54eeba..6223744955e 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -197,13 +197,64 @@ class Setup extends DolibarrApi * @throws RestException */ public function getCountryByID($id, $lang = '') + { + return $this->_fetchCcountry($id, '', '', $lang); + } + + /** + * Get country by Code. + * + * @param string $code Code of country + * @param string $lang Code of the language the name of the + * country must be translated to + * @return array Array of cleaned object properties + * + * @url GET dictionary/countries/byCode/{code} + * + * @throws RestException + */ + public function getCountryByCode($code, $lang = '') + { + return $this->_fetchCcountry('', $code, '', $lang); + } + + /** + * Get country by Iso. + * + * @param string $iso ISO of country + * @param string $lang Code of the language the name of the + * country must be translated to + * @return array Array of cleaned object properties + * + * @url GET dictionary/countries/byISO/{iso} + * + * @throws RestException + */ + public function getCountryByISO($iso, $lang = '') + { + return $this->_fetchCcountry('', '', $iso, $lang); + } + + /** + * Get country. + * + * @param int $id ID of country + * @param string $code Code of country + * @param string $iso ISO of country + * @param string $lang Code of the language the name of the + * country must be translated to + * @return array Array of cleaned object properties + * + * @throws RestException + */ + private function _fetchCcountry($id, $code = '', $iso = '', $lang = '') { $country = new Ccountry($this->db); - if ($country->fetch($id) < 0) { + $result = $country->fetch($id, $code, $iso); + if ($result < 0) { throw new RestException(503, 'Error when retrieving country : '.$country->error); - } - elseif ($country->fetch($id) == 0) { + } elseif ($result == 0) { throw new RestException(404, 'country not found'); } @@ -320,6 +371,66 @@ class Setup extends DolibarrApi } } + /** + * Get the list of shipment methods. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number (starting from zero) + * @param int $active Payment term is active or not {@min 0} {@max 1} + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" + * + * @return array List of shipment methods + * + * @url GET dictionary/shipment_methods + * + * @throws RestException + */ + public function getListOfShipmentMethods($sortfield = "rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '') + { + $list = array(); + $sql = "SELECT t.code, t.libelle, t.description, t.tracking"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_shipment_mode as t"; + $sql.= " WHERE t.active = ".$active; + // Add sql filters + if ($sqlfilters) + { + if (! DolibarrApi::_checkFilters($sqlfilters)) + { + throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters); + } + $regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; + $sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; + } + + + $sql.= $this->db->order($sortfield, $sortorder); + + if ($limit) { + if ($page < 0) { + $page = 0; + } + $offset = $limit * $page; + + $sql .= $this->db->plimit($limit, $offset); + } + + $result = $this->db->query($sql); + + if ($result) { + $num = $this->db->num_rows($result); + $min = min($num, ($limit <= 0 ? $num : $limit)); + for ($i = 0; $i < $min; $i++) { + $list[] = $this->db->fetch_object($result); + } + } else { + throw new RestException(503, 'Error when retrieving list of shipment methods : '.$this->db->lasterror()); + } + + return $list; + } + /** * Get the list of events types. * diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 46473d52ddb..6e192a06545 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -454,12 +454,12 @@ while ($i < min($num, $limit)) $cssforfield=(empty($val['css'])?'':$val['css']); if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center'; elseif ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center'; - + if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; elseif ($key == 'ref') $cssforfield.=($cssforfield?' ':'').'nowrap'; - + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') $cssforfield.=($cssforfield?' ':'').'right'; - + if (! empty($arrayfields['t.'.$key]['checked'])) { print ''; diff --git a/htdocs/bom/class/api_boms.class.php b/htdocs/bom/class/api_boms.class.php index f6b25d0cca7..471fb4f2cce 100644 --- a/htdocs/bom/class/api_boms.class.php +++ b/htdocs/bom/class/api_boms.class.php @@ -100,7 +100,7 @@ class Boms extends DolibarrApi $obj_ret = array(); $tmpobject = new BOM($db); - + $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : ''; $restrictonsocid = 0; // Set to 1 if there is a field socid in table of object diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 1314463cd2a..871ec6b9ed2 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1543,7 +1543,7 @@ class ActionComm extends CommonObject $event['uid']='dolibarragenda-'.$this->db->database_name.'-'.$obj->id."@".$_SERVER["SERVER_NAME"]; $event['type']=$type; $datestart=$this->db->jdate($obj->datep)-(empty($conf->global->AGENDA_EXPORT_FIX_TZ)?0:($conf->global->AGENDA_EXPORT_FIX_TZ*3600)); - + // fix for -> Warning: A non-numeric value encountered if(is_numeric($this->db->jdate($obj->datep2))) { diff --git a/htdocs/comm/mailing/info.php b/htdocs/comm/mailing/info.php index 0dbc6fc07ab..7b270e460c8 100644 --- a/htdocs/comm/mailing/info.php +++ b/htdocs/comm/mailing/info.php @@ -58,11 +58,11 @@ if ($object->fetch($id) >= 0) $morehtmlright=''; if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') '; - + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright); - + print '

'; - + //print '
'; $object->user_creation=$object->user_creat; $object->date_creation=$object->date_creat; @@ -70,7 +70,7 @@ if ($object->fetch($id) >= 0) $object->date_validation=$object->date_valid; dol_print_object_info($object, 0); //print '
'; - + dol_fiche_end(); } diff --git a/htdocs/compta/deplacement/info.php b/htdocs/compta/deplacement/info.php index a0accd11a87..510675265a0 100644 --- a/htdocs/compta/deplacement/info.php +++ b/htdocs/compta/deplacement/info.php @@ -47,15 +47,15 @@ if ($id) $object = new Deplacement($db); $object->fetch($id); $object->info($id); - + $head = trip_prepare_head($object); - + dol_fiche_head($head, 'info', $langs->trans("TripCard"), 0, 'trip'); print '
'; dol_print_object_info($object); print '
'; - + print ''; } diff --git a/htdocs/compta/paiement/class/cpaiement.class.php b/htdocs/compta/paiement/class/cpaiement.class.php index a4e115dfdb0..37614f7e36e 100644 --- a/htdocs/compta/paiement/class/cpaiement.class.php +++ b/htdocs/compta/paiement/class/cpaiement.class.php @@ -34,7 +34,7 @@ class Cpaiement * @var string Id to identify managed objects */ public $element = 'cpaiement'; - + /** * @var string Name of table without prefix where object is stored */ diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index c81c013bc08..b14bc0f105e 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -71,7 +71,9 @@ if (! $error && $massaction == 'confirm_presend') $listofobjectid=array(); $listofobjectthirdparties=array(); + $listofobjectcontacts = array(); $listofobjectref=array(); + $contactidtosend=array(); $attachedfilesThirdpartyObj=array(); $oneemailperrecipient=(GETPOST('oneemailperrecipient')=='on'?1:0); @@ -97,11 +99,21 @@ if (! $error && $massaction == 'confirm_presend') if ($objecttmp->element == 'holiday') $thirdpartyid=$objecttmp->fk_user; if (empty($thirdpartyid)) $thirdpartyid=0; - $listofobjectthirdparties[$thirdpartyid]=$thirdpartyid; - $listofobjectref[$thirdpartyid][$toselectid]=$objecttmp; - } - } - } + if ($objectclass == 'Facture') { + $tmparraycontact = array(); + $tmparraycontact = $objecttmp->liste_contact(-1, 'external', 0, 'BILLING'); + if (is_array($tmparraycontact) && count($tmparraycontact) > 0) { + foreach ($tmparraycontact as $data_email) { + $listofobjectcontacts[$toselectid][$data_email['id']] = $data_email['email']; + } + } + } + + $listofobjectthirdparties[$thirdpartyid]=$thirdpartyid; + $listofobjectref[$thirdpartyid][$toselectid]=$objecttmp; + } + } + } // Check mandatory parameters if (GETPOST('fromtype', 'alpha') === 'user' && empty($user->email)) @@ -248,6 +260,22 @@ if (! $error && $massaction == 'confirm_presend') $fuser->fetch($objectobj->fk_user); $sendto = $fuser->email; } + elseif ($objectobj->element == 'facture' && !empty($listofobjectcontacts[$objectid])) + { + $emails_to_sends = array(); + $objectobj->fetch_thirdparty(); + $contactidtosend=array(); + foreach ($listofobjectcontacts[$objectid] as $contactemailid => $contactemailemail) { + + $emails_to_sends[] = $objectobj->thirdparty->contact_get_property($contactemailid, 'email'); + if (!in_array($contactemailid, $contactidtosend)) { + $contactidtosend[] = $contactemailid; + } + } + if (count($emails_to_sends) > 0) { + $sendto = implode(',', $emails_to_sends); + } + } else { $objectobj->fetch_thirdparty(); @@ -498,8 +526,8 @@ if (! $error && $massaction == 'confirm_presend') } $actionmsg2=''; - // Initialisation donnees - $objectobj2->sendtoid = 0; + // Initialisation donnees + $objectobj2->sendtoid = (empty($contactidtosend)?0:$contactidtosend); $objectobj2->actionmsg = $actionmsg; // Long text $objectobj2->actionmsg2 = $actionmsg2; // Short text $objectobj2->fk_element = $objid2; diff --git a/htdocs/core/class/ccountry.class.php b/htdocs/core/class/ccountry.class.php index 84defbfd163..edbceec50fd 100644 --- a/htdocs/core/class/ccountry.class.php +++ b/htdocs/core/class/ccountry.class.php @@ -163,22 +163,24 @@ class Ccountry // extends CommonObject /** * Load object in memory from database * - * @param int $id Id object - * @param string $code Code + * @param int $id Id object + * @param string $code Code + * @param string $code_iso Code ISO * @return int >0 if OK, 0 if not found, <0 if KO */ - public function fetch($id, $code = '') + public function fetch($id, $code = '', $code_iso = '') { global $langs; - $sql = "SELECT"; - $sql.= " t.rowid,"; - $sql.= " t.code,"; - $sql.= " t.code_iso,"; - $sql.= " t.label,"; - $sql.= " t.active"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_country as t"; - if ($id) $sql.= " WHERE t.rowid = ".$id; - elseif ($code) $sql.= " WHERE t.code = '".$this->db->escape($code)."'"; + $sql = "SELECT"; + $sql.= " t.rowid,"; + $sql.= " t.code,"; + $sql.= " t.code_iso,"; + $sql.= " t.label,"; + $sql.= " t.active"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_country as t"; + if ($id) $sql.= " WHERE t.rowid = ".$id; + elseif ($code) $sql.= " WHERE t.code = '".$this->db->escape($code)."'"; + elseif ($code_iso) $sql.= " WHERE t.code_iso = '".$this->db->escape($code_iso)."'"; dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 61558434105..6d26e585435 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5614,7 +5614,7 @@ class Form }; var d = new Date();"; } - + // Generate the date part, depending on the use or not of the javascript calendar if($addnowlink==1) // server time expressed in user time setup { diff --git a/htdocs/core/class/lessc.class.php b/htdocs/core/class/lessc.class.php index 396991b6612..2da23504440 100644 --- a/htdocs/core/class/lessc.class.php +++ b/htdocs/core/class/lessc.class.php @@ -3900,4 +3900,4 @@ class lessc_formatter_lessjs extends lessc_formatter_classic { public $breakSelectors = true; public $assignSeparator = ": "; public $selectorSeparator = ","; -} \ No newline at end of file +} diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index cd6f64c3242..d950f92b3c2 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -496,10 +496,10 @@ class SMTPs return $_retVal; } } - + // Default authentication method is LOGIN if (empty($conf->global->MAIL_SMTP_AUTH_TYPE)) $conf->global->MAIL_SMTP_AUTH_TYPE = 'LOGIN'; - + // Send Authentication to Server // Check for errors along the way switch ($conf->global->MAIL_SMTP_AUTH_TYPE) { diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 3780ab35b06..f3bc9daf24b 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -781,7 +781,7 @@ class Translate if (preg_match('/^[a-z]+_[A-Z]+/i', $dir)) { $this->load("languages"); - + if (! empty($conf->global->MAIN_LANGUAGES_ALLOWED) && ! in_array($dir, explode(',', $conf->global->MAIN_LANGUAGES_ALLOWED)) ) continue; if ($usecode == 2) diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 739e115efb1..0b06d21c95d 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -136,14 +136,14 @@ function invoice_admin_prepare_head() $head[$h][1] = $langs->trans("Payments"); $head[$h][2] = 'payment'; $h++; - + if($conf->global->INVOICE_USE_SITUATION){ $head[$h][0] = DOL_URL_ROOT.'/admin/facture_situation.php'; $head[$h][1] = $langs->trans("InvoiceSituation"); $head[$h][2] = 'situation'; $h++; } - + // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab diff --git a/htdocs/core/lib/loan.lib.php b/htdocs/core/lib/loan.lib.php index bc7b0034b35..4d47c79e6da 100644 --- a/htdocs/core/lib/loan.lib.php +++ b/htdocs/core/lib/loan.lib.php @@ -40,7 +40,7 @@ function loan_prepare_head($object) $head[$tab][1] = $langs->trans('Card'); $head[$tab][2] = 'card'; $tab++; - + $head[$tab][0] = DOL_URL_ROOT.'/loan/schedule.php?loanid='.$object->id; $head[$tab][1] = $langs->trans('FinancialCommitment'); $head[$tab][2] = 'FinancialCommitment'; diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index 93146738f66..6068246341e 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -127,7 +127,7 @@ function member_type_prepare_head(AdherentType $object) $head[$h][1] = $langs->trans("Card"); $head[$h][2] = 'card'; $h++; - + // Multilangs if (! empty($conf->global->MAIN_MULTILANGS)) { diff --git a/htdocs/core/lib/memory.lib.php b/htdocs/core/lib/memory.lib.php index d353cca0097..22e660b2e22 100644 --- a/htdocs/core/lib/memory.lib.php +++ b/htdocs/core/lib/memory.lib.php @@ -55,7 +55,7 @@ function dol_setcache($memoryid, $data) $result=$dolmemcache->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211); if (! $result) return -1; } - + $memoryid=session_name().'_'.$memoryid; //$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false); $dolmemcache->add($memoryid, $data); // This fails if key already exists @@ -79,7 +79,7 @@ function dol_setcache($memoryid, $data) $result=$dolmemcache->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211); if (! $result) return -1; } - + $memoryid=session_name().'_'.$memoryid; //$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false); $result=$dolmemcache->add($memoryid, $data); // This fails if key already exists @@ -122,7 +122,7 @@ function dol_getcache($memoryid) $result=$m->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211); if (! $result) return -1; } - + $memoryid=session_name().'_'.$memoryid; //$m->setOption(Memcached::OPT_COMPRESSION, false); //print "Get memoryid=".$memoryid; @@ -149,7 +149,7 @@ function dol_getcache($memoryid) $result=$m->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211); if (! $result) return -1; } - + $memoryid=session_name().'_'.$memoryid; //$m->setOption(Memcached::OPT_COMPRESSION, false); $data=$m->get($memoryid); diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php index b3c5814240c..adee27687dd 100644 --- a/htdocs/core/menus/standard/auguria_menu.php +++ b/htdocs/core/menus/standard/auguria_menu.php @@ -113,7 +113,7 @@ class MenuManager $menuArbo->menuLoad($mainmenu, $leftmenu, $this->type_user, 'auguria', $tabMenu); $this->tabMenu=$tabMenu; //var_dump($tabMenu); - + //if ($forcemainmenu == 'all') { var_dump($this->tabMenu); exit; } } @@ -152,7 +152,7 @@ class MenuManager if ($mode == 'top') print_left_auguria_menu($this->db, $this->menu_array, $this->menu_array_after, $this->tabMenu, $this->menu, 0); if ($mode == 'left') print_auguria_menu($this->db, $this->atarget, $this->type_user, $this->tabMenu, $this->menu, 0, $mode); } - + if ($mode == 'topnb') { print_auguria_menu($this->db, $this->atarget, $this->type_user, $this->tabMenu, $this->menu, 1, $mode); @@ -327,7 +327,7 @@ class MenuManager } unset($this->menu); - + //print 'xx'.$mode; return 0; } diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index 8389db029be..089194aec2a 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -65,7 +65,7 @@ class MenuManager public function loadMenu($forcemainmenu = '', $forceleftmenu = '') { global $conf, $user, $langs; - + // On sauve en session le menu principal choisi if (isset($_GET["mainmenu"])) $_SESSION["mainmenu"]=$_GET["mainmenu"]; if (isset($_GET["idmenu"])) $_SESSION["idmenu"]=$_GET["idmenu"]; diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 1db0db2e6f5..0729f4a71ef 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -85,7 +85,7 @@ class modProduct extends DolibarrModules $this->const[$r][3] = 'Module to control product codes'; $this->const[$r][4] = 0; $r++; - + $this->const[$r][0] = "PRODUCT_PRICE_UNIQ"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "1"; diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 0d4f86ca82a..319f563ad28 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -198,7 +198,7 @@ class pdf_cyan extends ModelePDFPropales if (! is_object($outputlangs)) $outputlangs=$langs; // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - + // Translations $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "propal")); diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 35aefb9f719..ca30eb5ae92 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -50,7 +50,7 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_ $value = dol_eval($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key], 1); //var_dump($value); } - + print $extrafields->showOutputField($key, $value, '', $extrafieldsobjectkey); print ''; if (! $i) $totalarray['nbfield']++; diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index f9d33495764..2e14d0c7f47 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -131,7 +131,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); $ret = 0; - + // First classify billed the order to allow the proposal classify process if (! empty($conf->commande->enabled) && ! empty($conf->workflow->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER)) { @@ -175,7 +175,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers } } } - + return $ret; } diff --git a/htdocs/hrm/admin/admin_hrm.php b/htdocs/hrm/admin/admin_hrm.php index 243a1ce3222..343e6fa54e9 100644 --- a/htdocs/hrm/admin/admin_hrm.php +++ b/htdocs/hrm/admin/admin_hrm.php @@ -42,15 +42,15 @@ $list = array ( */ if ($action == 'update') { $error = 0; - + foreach ($list as $constname) { $constvalue = GETPOST($constname, 'alpha'); - + if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { $error ++; } } - + if (! $error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -87,13 +87,13 @@ print "\n"; foreach ($list as $key) { $var = ! $var; - + print ''; - + // Param $label = $langs->trans($key); print ''; - + // Value print ''; print ''; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 5492f760407..f526c5e3c52 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -940,11 +940,11 @@ class Product extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."product"; $sql.= " SET label = '" . $this->db->escape($this->label) ."'"; - + if ($updatetype && ($this->isProduct() || $this->isService())) { $sql.= ", fk_product_type = " . $this->type; } - + $sql.= ", ref = '" . $this->db->escape($this->ref) ."'"; $sql.= ", ref_ext = ".(! empty($this->ref_ext)?"'".$this->db->escape($this->ref_ext)."'":"null"); $sql.= ", default_vat_code = ".($this->default_vat_code ? "'".$this->db->escape($this->default_vat_code)."'" : "null"); diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 59c81c83e29..0362a3767c3 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -440,12 +440,12 @@ while ($i < min($num, $limit)) $cssforfield=(empty($val['css'])?'':$val['css']); if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center'; elseif ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center'; - + if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; elseif ($key == 'ref') $cssforfield.=($cssforfield?' ':'').'nowrap'; - + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') $cssforfield.=($cssforfield?' ':'').'right'; - + if (! empty($arrayfields['t.'.$key]['checked'])) { print ''; diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index 3ee0cb5de1a..d14eba99fae 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -234,7 +234,7 @@ if ($id > 0 || ! empty($ref)) while ($i < min($num, $limit)) { $objp = $db->fetch_object($result); - + if ($objp->type == Facture::TYPE_CREDIT_NOTE) $objp->qty=-($objp->qty); $total_ht+=$objp->total_ht; diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 15670a2095d..1ed4916e3c9 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -72,10 +72,10 @@ class Thirdparties extends DolibarrApi * * @throws RestException */ - public function get($id) + public function get($id) { - return $this->_fetch($id); - } + return $this->_fetch($id); + } /** * Get properties of a thirdparty object by email. diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php index 92333394edc..ffa4bd6d13b 100644 --- a/htdocs/takepos/admin/receipt.php +++ b/htdocs/takepos/admin/receipt.php @@ -41,12 +41,12 @@ $langs->loadLangs(array("admin", "cashdesk", "commercial")); if (GETPOST('action', 'alpha') == 'set') { $db->begin(); - + $res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_RECEIPT_NAME", GETPOST('TAKEPOS_RECEIPT_NAME', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_SHOW_CUSTOMER", GETPOST('TAKEPOS_SHOW_CUSTOMER', 'alpha'), 'chaine', 0, '', $conf->entity); - + dol_syslog("admin/cashdesk: level ".GETPOST('level', 'alpha')); if (! $res > 0) $error++; diff --git a/test/phpunit/BOMTest.php b/test/phpunit/BOMTest.php index b69e59c6283..41cbdd9f247 100644 --- a/test/phpunit/BOMTest.php +++ b/test/phpunit/BOMTest.php @@ -79,7 +79,7 @@ class BOMTest extends PHPUnit\Framework\TestCase { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. - + print __METHOD__."\n"; }