diff --git a/htdocs/adherents/class/adherentstats.class.php b/htdocs/adherents/class/adherentstats.class.php index b3029a6bd55..c953d929442 100644 --- a/htdocs/adherents/class/adherentstats.class.php +++ b/htdocs/adherents/class/adherentstats.class.php @@ -68,7 +68,7 @@ class AdherentStats extends Stats $this->field = 'subscription'; - $this->where .= " m.statut != 0"; + $this->where .= " m.statut != -1"; $this->where .= " AND p.fk_adherent = m.rowid AND m.entity IN (".getEntity('adherent').")"; //if (!$user->rights->societe->client->voir && !$user->socid) $this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; if ($this->memberid) { diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index 8f9a46228c6..fa8e07ad053 100644 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -102,17 +102,17 @@ dol_fiche_head($head, 'statsbyproperties', $langs->trans("Statistics"), -1, 'use // Print title if (!count($data)) { - print $langs->trans("NoValidatedMemberYet").'
'; + print ''.$langs->trans("NoValidatedMemberYet").'
'; print '
'; } else { - print $langs->trans("MembersByNature").'
'; + print ''.$langs->trans("MembersByNature").'
'; print '
'; } // Print array print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index 62f4cd63dca..ae88b924ea6 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -204,12 +204,13 @@ if ($mode && !count($data)) { print $langs->trans("NoValidatedMemberYet").'
'; print '
'; } else { - if ($mode == 'memberbycountry') print $langs->trans("MembersByCountryDesc").'
'; - elseif ($mode == 'memberbystate') print $langs->trans("MembersByStateDesc").'
'; - elseif ($mode == 'memberbytown') print $langs->trans("MembersByTownDesc").'
'; - elseif ($mode == 'memberbyregion') print $langs->trans("MembersByRegion").'
'; //+ - else { - print $langs->trans("MembersStatisticsDesc").'
'; + if ($mode == 'memberbycountry') print ''.$langs->trans("MembersByCountryDesc").'
'; + elseif ($mode == 'memberbystate') print ''.$langs->trans("MembersByStateDesc").'
'; + elseif ($mode == 'memberbytown') print ''.$langs->trans("MembersByTownDesc").'
'; + elseif ($mode == 'memberbyregion') print ''.$langs->trans("MembersByRegion").'
'; //+ + else + { + print ''.$langs->trans("MembersStatisticsDesc").'
'; print '
'; print ''.$langs->trans("MembersStatisticsByCountries").'
'; print '
'; diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index 9177b4783a2..c6748538264 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -176,9 +176,9 @@ foreach ($data as $val) { $oldyear--; print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index fdf0f5aed1f..9288c2e2f1b 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -367,8 +367,7 @@ foreach ($configfileparameters as $key => $value) print "
'.$langs->trans("Nature").''.$langs->trans("MemberNature").''.$langs->trans("NbOfMembers").''.$langs->trans("LastMemberDate").''.$langs->trans("LatestSubscriptionDate").'
'; - print ''; + //print ''; print $oldyear; - print ''; + //print ''; print '00"; if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i', '*', ${$newkey}); elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/', ${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT'); - elseif ($newkey == 'dolibarr_main_document_root_alt') - { + elseif ($newkey == 'dolibarr_main_document_root_alt') { $tmparray = explode(',', ${$newkey}); $i = 0; foreach ($tmparray as $value2) @@ -382,8 +381,7 @@ foreach ($configfileparameters as $key => $value) } ++$i; } - } elseif ($newkey == 'dolibarr_main_instance_unique_id') - { + } elseif ($newkey == 'dolibarr_main_instance_unique_id') { //print $conf->file->instance_unique_id; global $dolibarr_main_cookie_cryptkey; $valuetoshow = ${$newkey} ? ${$newkey} : $dolibarr_main_cookie_cryptkey; // Use $dolibarr_main_instance_unique_id first then $dolibarr_main_cookie_cryptkey @@ -392,6 +390,13 @@ foreach ($configfileparameters as $key => $value) print img_warning("EditConfigFileToAddEntry", 'dolibarr_main_instance_unique_id'); } print '   ('.$langs->trans("HashForPing").'='.md5('dolibarr'.$valuetoshow).')'; + } elseif ($newkey == 'dolibarr_main_prod') { + print ${$newkey}; + + $valuetoshow = ${$newkey}; + if (empty($valuetoshow)) { + print img_warning($langs->trans('SwitchThisForABetterSecurity')); + } } else { print ${$newkey}; } diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index 148c9baa67e..c7e95aa1fbc 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -61,11 +61,11 @@ abstract class CommonObjectLine extends CommonObject } /** - * Returns the translation key from units dictionary. + * Returns the label, shot_label or code found in units dictionary from ->fk_unit. * A langs->trans() must be called on result to get translated value. * - * @param string $type Label type (long or short). This can be a translation key. - * @return string|int <0 if ko, label if ok + * @param string $type Label type ('long', 'short' or 'code'). This can be a translation key. + * @return string|int <0 if KO, label if OK (Example: 'long', 'short' or 'unitCODE') */ public function getLabelOfUnit($type = 'long') { @@ -79,17 +79,16 @@ abstract class CommonObjectLine extends CommonObject $label_type = 'label'; - if ($type == 'short') - { - $label_type = 'short_label'; - } + $label_type = 'label'; + if ($type == 'short') $label_type = 'short_label'; + elseif ($type == 'code') $label_type = 'code'; - $sql = 'select '.$label_type.',code from '.MAIN_DB_PREFIX.'c_units where rowid='.$this->fk_unit; + $sql = 'select '.$label_type.', code from '.MAIN_DB_PREFIX.'c_units where rowid='.$this->fk_unit; $resql = $this->db->query($sql); - if ($resql && $this->db->num_rows($resql) > 0) - { + if ($resql && $this->db->num_rows($resql) > 0) { $res = $this->db->fetch_array($resql); - $label = ($label_type == 'short' ? $res[$label_type] : 'unit'.$res['code']); + if ($label_type == 'code') $label = 'unit'.$res['code']; + else $label = $res[$label_type]; $this->db->free($resql); return $label; } else { diff --git a/htdocs/core/tpl/objectline_title.tpl.php b/htdocs/core/tpl/objectline_title.tpl.php index 886f921d4dd..375992be60d 100644 --- a/htdocs/core/tpl/objectline_title.tpl.php +++ b/htdocs/core/tpl/objectline_title.tpl.php @@ -59,7 +59,12 @@ if ($this->element == 'supplier_proposal' || $this->element == 'order_supplier' } // VAT -print ''.$langs->trans('VAT'); +print '' +if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || !empty($conf->global->FACTURE_LOCAL_TAX2_OPTION)) { + print $langs->trans('Taxes'); +} else { + print $langs->trans('VAT'); +} if (in_array($object->element, array('propal', 'commande', 'facture')) && $object->status == $object::STATUS_DRAFT) { global $mysoc; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index f407d69251d..9545335b378 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2056,3 +2056,4 @@ TemplateAdded=Template added TemplateUpdated=Template updated TemplateDeleted=Template deleted MailToSendEventPush=Template for event reminder emails +SwitchThisForABetterSecurity=Switching this value to 1 is recommended for more security diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index e59230427f3..8ae09ea45aa 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5204,15 +5204,17 @@ class Product extends CommonObject $this->barcode = -1; // Create barcode automatically } - /** - * Returns the text label from units dictionary - * - * @param string $type Label type (long or short) - * @return string|int <0 if ko, label if ok - */ - public function getLabelOfUnit($type = 'long') - { - global $langs; + /** + * Returns the label, shot_label or code found in units dictionary from ->fk_unit. + * A langs->trans() must be called on result to get translated value. + * + * @param string $type Label type (long, short or code) + * @return string|int <0 if KO, label if OK (Example: 'long', 'short', 'unitCODE') + * @see getLabelOfUnit() in CommonObjectLine + */ + public function getLabelOfUnit($type = 'long') + { + global $langs; if (!$this->fk_unit) { return ''; @@ -5220,25 +5222,24 @@ class Product extends CommonObject $langs->load('products'); - $label_type = 'label'; + $label_type = 'label'; + if ($type == 'short') $label_type = 'short_label'; + elseif ($type == 'code') $label_type = 'code'; - if ($type == 'short') { - $label_type = 'short_label'; - } - - $sql = 'select '.$label_type.', code from '.MAIN_DB_PREFIX.'c_units where rowid='.$this->fk_unit; - $resql = $this->db->query($sql); - if ($resql && $this->db->num_rows($resql) > 0) { - $res = $this->db->fetch_array($resql); - $label = ($label_type == 'short_label' ? $res[$label_type] : 'unit'.$res['code']); - $this->db->free($resql); - return $label; - } else { - $this->error = $this->db->error().' sql='.$sql; - dol_syslog(get_class($this)."::getLabelOfUnit Error ".$this->error, LOG_ERR); - return -1; - } - } + $sql = 'select '.$label_type.', code from '.MAIN_DB_PREFIX.'c_units where rowid='.$this->fk_unit; + $resql = $this->db->query($sql); + if ($resql && $this->db->num_rows($resql) > 0) { + $res = $this->db->fetch_array($resql); + if ($label_type == 'code') $label = 'unit'.$res['code']; + else $label = $res[$label_type]; + $this->db->free($resql); + return $label; + } else { + $this->error = $this->db->error().' sql='.$sql; + dol_syslog(get_class($this)."::getLabelOfUnit Error ".$this->error, LOG_ERR); + return -1; + } + } /** * Return if object has a sell-by date or eat-by date