From 101378b856539ddc35ae3b677047ddf57592535b Mon Sep 17 00:00:00 2001 From: AcceTT Soluciones Computacionales Date: Mon, 26 Jan 2015 20:56:36 -0600 Subject: [PATCH 01/22] Add MXN Add MXN to the array to use currency sing before. --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f8a43030dbc..ad468da0bb5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2954,7 +2954,7 @@ function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerou { if ($currency_code == 'auto') $currency_code=$conf->currency; - $listofcurrenciesbefore=array('USD','GBP','AUD'); + $listofcurrenciesbefore=array('USD','GBP','AUD','MXN'); if (in_array($currency_code,$listofcurrenciesbefore)) $cursymbolbefore.=$outlangs->getCurrencySymbol($currency_code); else { From a510a1ef5cd746336a7494125d790bde7a348332 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 27 Jan 2015 12:53:02 +0100 Subject: [PATCH 02/22] First step add contract lines extrafields --- htdocs/contrat/card.php | 44 ++++++- htdocs/contrat/class/contrat.class.php | 139 +++++++++++++++++----- htdocs/core/lib/contract.lib.php | 5 + htdocs/core/tpl/objectline_create.tpl.php | 5 +- 4 files changed, 160 insertions(+), 33 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 4770ff10e50..0095d474239 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -84,6 +84,10 @@ if ($id > 0 || ! empty($ref)) { // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); +// fetch optionals attributes lines and labels +$extrafieldsline = new ExtraFields($db); +$extralabelslines=$extrafieldsline->fetch_name_optionals_label($object->table_element_line); + $permissionnote=$user->rights->contrat->creer; // Used by the include of actions_setnotes.inc.php @@ -408,6 +412,18 @@ else if ($action == 'addline' && $user->rights->contrat->creer) $error++; } + // Extrafields + $extrafieldsline = new ExtraFields($db); + $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); + $array_option = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + // Unset extrafield + if (is_array($extralabelsline)) { + // Get extra fields + foreach ($extralabelsline as $key => $value) { + unset($_POST["options_" . $key]); + } + } + if (! $error) { // Clean parameters @@ -520,7 +536,8 @@ else if ($action == 'addline' && $user->rights->contrat->creer) $pu_ttc, $info_bits, $fk_fournprice, - $pa_ht + $pa_ht, + $array_option ); } @@ -617,6 +634,12 @@ else if ($action == 'updateligne' && $user->rights->contrat->creer && ! GETPOST( $objectline->fk_fournprice=$fk_fournprice; $objectline->pa_ht=$pa_ht; + // Extrafields + $extrafieldsline = new ExtraFields($db); + $extralabelsline = $extrafieldsline->fetch_name_optionals_label($objectline->table_element); + $array_option = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + $objectline->array_options=$array_option; + // TODO verifier price_min si fk_product et multiprix $result=$objectline->update($user); @@ -1391,6 +1414,16 @@ else print ''; print ''; } + + + //Display lines extrafields + if (is_array($extralabelslines) && count($extralabelslines)>0) { + print ''; + $line = new ContratLigne($db); + $line->fetch_optionals($objp->rowid,$extralabelslines); + print $line->showOptionals($extrafieldsline, 'view', array('style'=>$bc[$var], 'colspan'=>$colspan)); + print ''; + } } // Ligne en mode update else @@ -1448,6 +1481,15 @@ else print '
'.$langs->trans("DateEndPlanned").' '; $form->select_date($db->jdate($objp->date_fin),"date_end_update",$usehm,$usehm,($db->jdate($objp->date_fin)>0?0:1),"update"); print ''; + + if (is_array($extralabelslines) && count($extralabelslines)>0) { + print ''; + $line = new ContratLigne($db); + $line->fetch_optionals($objp->rowid,$extralabelslines); + print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var], 'colspan'=>$colspan)); + print ''; + } + print ''; } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 9619ae462f4..bbecab53a30 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -907,7 +907,8 @@ class Contrat extends CommonObject $modCodeContract = new $module(); } - if (!empty($modCodeContract->code_auto)) { + //Commerce Efficace - Debut : Modification r�f�rence Contrat + /*if (!empty($modCodeContract->code_auto)) { // Mise a jour ref $sql = 'UPDATE '.MAIN_DB_PREFIX."contrat SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id; if ($this->db->query($sql)) @@ -917,7 +918,8 @@ class Contrat extends CommonObject $this->ref="(PROV".$this->id.")"; } } - } + }*/ + //Commerce Efficace - Fin : Modification r�f�rence Contrat // Insert contacts commerciaux ('SALESREPSIGN','contrat') $result=$this->add_contact($this->commercial_signature_id,'SALESREPSIGN','internal'); @@ -1238,9 +1240,10 @@ class Contrat extends CommonObject * @param int $info_bits Bits de type de lignes * @param int $fk_fournprice Fourn price id * @param int $pa_ht Buying price HT + * @param array $array_option extrafields array * @return int <0 si erreur, >0 si ok */ - function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $date_start, $date_end, $price_base_type='HT', $pu_ttc=0.0, $info_bits=0, $fk_fournprice=null, $pa_ht = 0) + function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $date_start, $date_end, $price_base_type='HT', $pu_ttc=0.0, $info_bits=0, $fk_fournprice=null, $pa_ht = 0,$array_option=0) { global $user, $langs, $conf, $mysoc; @@ -1348,17 +1351,33 @@ class Contrat extends CommonObject $result=$this->update_statut($user); if ($result > 0) { - // Call trigger - $result=$this->call_trigger('LINECONTRACT_CREATE',$user); - if ($result < 0) - { - $this->db->rollback(); - return -1; - } - // End call triggers - - $this->db->commit(); - return 1; + + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_option) && count($array_option)>0) // For avoid conflicts if trigger used + { + $contractline = new ContratLigne($this->db); + $contractline->array_options=$array_option; + $contractline->id= $this->db->last_insert_id(MAIN_DB_PREFIX.$contractline->table_element); + $result=$contractline->insertExtraFields(); + if ($result < 0) + { + $this->error[]=$contractline->error; + $error++; + } + } + + if (empty($error)) { + // Call trigger + $result=$this->call_trigger('LINECONTRACT_CREATE',$user); + if ($result < 0) + { + $this->db->rollback(); + return -1; + } + // End call triggers + + $this->db->commit(); + return 1; + } } else { @@ -1399,9 +1418,10 @@ class Contrat extends CommonObject * @param int $info_bits Bits de type de lignes * @param int $fk_fournprice Fourn price id * @param int $pa_ht Buying price HT + * @param array $array_option extrafields array * @return int < 0 si erreur, > 0 si ok */ - function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $tvatx, $localtax1tx=0.0, $localtax2tx=0.0, $date_debut_reel='', $date_fin_reel='', $price_base_type='HT', $info_bits=0, $fk_fournprice=null, $pa_ht = 0) + function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $tvatx, $localtax1tx=0.0, $localtax2tx=0.0, $date_debut_reel='', $date_fin_reel='', $price_base_type='HT', $info_bits=0, $fk_fournprice=null, $pa_ht = 0,$array_option=0) { global $user, $conf, $langs, $mysoc; @@ -1501,17 +1521,33 @@ class Contrat extends CommonObject $result=$this->update_statut($user); if ($result >= 0) { - // Call trigger - $result=$this->call_trigger('LINECONTRACT_UPDATE',$user); - if ($result < 0) - { - $this->db->rollback(); - return -3; - } - // End call triggers - - $this->db->commit(); - return 1; + + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_option) && count($array_option)>0) // For avoid conflicts if trigger used + { + $contractline = new ContratLigne($this->db); + $contractline->array_options=$array_option; + $contractline->id= $this->db->last_insert_id(MAIN_DB_PREFIX.$contractline->table_element); + $result=$contractline->insertExtraFields(); + if ($result < 0) + { + $this->error[]=$contractline->error; + $error++; + } + } + + if (empty($error)) { + // Call trigger + $result=$this->call_trigger('LINECONTRACT_UPDATE',$user); + if ($result < 0) + { + $this->db->rollback(); + return -3; + } + // End call triggers + + $this->db->commit(); + return 1; + } } else { @@ -1560,12 +1596,32 @@ class Contrat extends CommonObject if (! $resql) { $this->error="Error ".$this->db->lasterror(); + $error++; + } + + if (empty($error)) { + // Remove extrafields + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $contractline = new ContratLigne($this->db); + $contractline->id= $idline; + $result=$contractline->deleteExtraFields(); + if ($result < 0) + { + $error++; + $this->error="Error ".get_class($this)."::delete deleteExtraFields error -4 ".$contractline->error; + } + } + } + + if (empty($error)) { + $this->db->commit(); + return 1; + } else { + dol_syslog(get_class($this)."::delete ERROR:".$this->error, LOG_ERR); $this->db->rollback(); return -1; } - - $this->db->commit(); - return 1; } else { @@ -2067,6 +2123,9 @@ class ContratLigne extends CommonObject var $statut; // 0 inactive, 4 active, 5 closed var $label; + public $element='contratdet'; + public $table_element='contratdet'; + /** * @var string * @deprecated Use $label instead @@ -2445,10 +2504,21 @@ class ContratLigne extends CommonObject else { $this->error="Error ".$this->db->lasterror(); - $this->db->rollback(); - return -1; + $error++; + //return -1; + } + + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options)>0) // For avoid conflicts if trigger used + { + + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } } + if (empty($error)) { if (! $notrigger) { // Call trigger @@ -2456,9 +2526,16 @@ class ContratLigne extends CommonObject if ($result < 0) { $error++; $this->db->rollback(); return -1; } // End call triggers } + } + if (empty($error)) { $this->db->commit(); return 1; + } else { + $this->db->rollback(); + $this->errors[]=$this->error; + return -1; + } } diff --git a/htdocs/core/lib/contract.lib.php b/htdocs/core/lib/contract.lib.php index b7e82c6dbf2..6fa99914229 100644 --- a/htdocs/core/lib/contract.lib.php +++ b/htdocs/core/lib/contract.lib.php @@ -112,6 +112,11 @@ function contract_admin_prepare_head() $head[$h][2] = 'attributes'; $h++; + $head[$h][0] = DOL_URL_ROOT.'/contrat/admin/contractdet_extrafields.php'; + $head[$h][1] = $langs->trans("ExtraFieldsLines"); + $head[$h][2] = 'attributeslines'; + $h++; + complete_head_from_modules($conf,$langs,null,$head,$h,'contract_admin','remove'); diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 0c345aee5ac..bce94c70a57 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -3,7 +3,7 @@ * Copyright (C) 2010-2014 Laurent Destailleur * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2012 Cédric Salvador - * Copyright (C) 2013 Florian Henry + * Copyright (C) 2014 Florian Henry * Copyright (C) 2014 Raphaël Doursenaud * * This program is free software; you can redistribute it and/or modify @@ -273,6 +273,9 @@ else { elseif ($this->table_element_line=='facturedet') { $newline = new FactureLigne($this->db); } + elseif ($this->table_element_line=='contratdet') { + $newline = new ContratLigne($this->db); + } if (is_object($newline)) { print $newline->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay+8)); } From 66c73ca33628d5bc6734c2be3afc7415d46b3f67 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 27 Jan 2015 12:57:36 +0100 Subject: [PATCH 03/22] add missing files for contract line extrafields --- .../contrat/admin/contractdet_extrafields.php | 159 ++++++++++++++++++ .../install/mysql/migration/3.7.0-3.8.0.sql | 12 ++ .../tables/llx_contratdet_extrafields.key.sql | 20 +++ .../tables/llx_contratdet_extrafields.sql | 25 +++ 4 files changed, 216 insertions(+) create mode 100644 htdocs/contrat/admin/contractdet_extrafields.php create mode 100644 htdocs/install/mysql/tables/llx_contratdet_extrafields.key.sql create mode 100644 htdocs/install/mysql/tables/llx_contratdet_extrafields.sql diff --git a/htdocs/contrat/admin/contractdet_extrafields.php b/htdocs/contrat/admin/contractdet_extrafields.php new file mode 100644 index 00000000000..21f27cee6d9 --- /dev/null +++ b/htdocs/contrat/admin/contractdet_extrafields.php @@ -0,0 +1,159 @@ + + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2014 Florian Henry + * Copyright (C) 2013 Philippe Grand + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/contrat/admin/contract_extrafields.php + * \ingroup contrat + * \brief Page to setup extra fields of contract + */ + + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + +$langs->load("companies"); +$langs->load("admin"); +$langs->load("contracts"); + +$extrafields = new ExtraFields($db); +$form = new Form($db); + +// List of supported format +$tmptype2label=ExtraFields::$type2label; +$type2label=array(''); +foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); + +$action=GETPOST('action', 'alpha'); +$attrname=GETPOST('attrname', 'alpha'); +$elementtype='contratdet'; //Must be the $element of the class that manage extrafield + +if (!$user->admin) accessforbidden(); + + +/* + * Actions + */ + +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; + + + +/* + * View + */ + + +llxHeader(); + + +$linkback=''.$langs->trans("BackToModuleList").''; +print_fiche_titre($langs->trans("ContractsSetup"),$linkback,'setup'); + +print '
'; +$head=contract_admin_prepare_head(); + +dol_fiche_head($head, 'attributeslines', $langs->trans("Contracts"), 0, 'contract'); + +$textobject = $langs->transnoentitiesnoconv('Contracts'); + +print $langs->trans("DefineHereComplementaryAttributes",$textobject).'
'."\n"; +print '
'; + +// Load attribute_label +$extrafields->fetch_name_optionals_label($elementtype); + +print ""; + +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; + +$var=True; +foreach($extrafields->attribute_type as $key => $value) +{ + $var=!$var; + print ""; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print '\n"; + print '\n"; + print '\n"; + print '\n"; + print ""; + // $i++; +} + +print "
'.$langs->trans("Position").''.$langs->trans("Label").''.$langs->trans("AttributeCode").''.$langs->trans("Type").''.$langs->trans("Size").''.$langs->trans("Unique").''.$langs->trans("Required").' 
".$extrafields->attribute_pos[$key]."".$extrafields->attribute_label[$key]."".$key."".$type2label[$extrafields->attribute_type[$key]]."'.$extrafields->attribute_size[$key]."'.yn($extrafields->attribute_unique[$key])."'.yn($extrafields->attribute_required[$key])."'.img_edit().''; + print "  ".img_delete()."
"; + +dol_fiche_end(); + + +// Buttons +if ($action != 'create' && $action != 'edit') +{ + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; +} + + +/* ************************************************************************** */ +/* */ +/* Creation d'un champ optionnel + /* */ +/* ************************************************************************** */ + +if ($action == 'create') +{ + print "
"; + print_titre($langs->trans('NewAttribute')); + + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; +} + +/* ************************************************************************** */ +/* */ +/* Edition d'un champ optionnel */ +/* */ +/* ************************************************************************** */ +if ($action == 'edit' && ! empty($attrname)) +{ + print "
"; + print_titre($langs->trans("FieldEdition", $attrname)); + + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; +} + +llxFooter(); + +$db->close(); diff --git a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql index cb70f85a32c..b5e3abc62c1 100755 --- a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql +++ b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql @@ -70,3 +70,15 @@ create table llx_bank_account_extrafields import_key varchar(14) -- import key ) ENGINE=innodb; +ALTER TABLE llx_bank_account_extrafields ADD INDEX idx_bank_account_extrafields (fk_object); + + +create table llx_contratdet_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, -- object id + import_key varchar(14) -- import key +)ENGINE=innodb; + +ALTER TABLE llx_contratdet_extrafields ADD INDEX idx_contratdet_extrafields (fk_object); diff --git a/htdocs/install/mysql/tables/llx_contratdet_extrafields.key.sql b/htdocs/install/mysql/tables/llx_contratdet_extrafields.key.sql new file mode 100644 index 00000000000..3d2f8546df7 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_contratdet_extrafields.key.sql @@ -0,0 +1,20 @@ +-- =================================================================== +-- Copyright (C) 2013 Florian Henry +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- =================================================================== + + +ALTER TABLE llx_contratdet_extrafields ADD INDEX idx_contratdet_extrafields (fk_object); diff --git a/htdocs/install/mysql/tables/llx_contratdet_extrafields.sql b/htdocs/install/mysql/tables/llx_contratdet_extrafields.sql new file mode 100644 index 00000000000..bc06733572e --- /dev/null +++ b/htdocs/install/mysql/tables/llx_contratdet_extrafields.sql @@ -0,0 +1,25 @@ +-- =================================================================== +-- Copyright (C) 2014 Florian Henry +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- =================================================================== + +create table llx_contratdet_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, -- object id + import_key varchar(14) -- import key +)ENGINE=innodb; From a560b582f5e8281ae110a8452649a91119933aa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 28 Jan 2015 00:02:57 +0100 Subject: [PATCH 04/22] Update functions2.lib.php --- htdocs/core/lib/functions2.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 8e3f7a7262f..9a26c727bd4 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -608,7 +608,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $maskraz=-1; $maskoffset=0; $resetEveryMonth=false; - if (dol_strlen($maskcounter) < 3 && empty($conf->global->MAIN_COUNTER_WITH_LESS_3_DIGITS)) return 'CounterMustHaveMoreThan3Digits'; + if (dol_strlen($maskcounter) < 3 && empty($conf->global->MAIN_COUNTER_WITH_LESS_3_DIGITS)) return 'ErrorCounterMustHaveMoreThan3Digits'; // Extract value for third party mask counter if (preg_match('/\{(c+)(0*)\}/i',$mask,$regClientRef)) From 7569b32281f3d896391a5ad109dd0e9fe12e177f Mon Sep 17 00:00:00 2001 From: "Ying-Chun Liu (PaulLiu)" Date: Thu, 29 Jan 2015 00:57:54 +0800 Subject: [PATCH 05/22] Fix: webservices productorservice not updating the price. The product.php.class provides another method updatePrice() to update the price of products or services. We should call updatePrice() when we found the SOAP client changes the price or price_net. Signed-off-by: Ying-Chun Liu (PaulLiu) --- .../webservices/server_productorservice.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index 6f36b664a3b..911b258536c 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -668,6 +668,25 @@ function updateProductOrService($authentication,$product) { $error++; } + if (! $error) + { + if ($newobject->price_base_type == 'HT') + { + $result=$newobject->updatePrice($newobject->price, $newobject->price_base_type,$fuser); + if ($result <= 0) + { + $error++; + } + } + elseif ($newobject->price_base_type == 'TTC') + { + $result=$newobject->updatePrice($newobject->price_ttc, $newobject->price_base_type); + if ($result <= 0) + { + $error++; + } + } + } if (! $error) { From 831bc5393db9c0dd4687aefcb168b59afaa0a3ef Mon Sep 17 00:00:00 2001 From: Drosis Nikos Date: Wed, 28 Jan 2015 23:17:46 +0200 Subject: [PATCH 06/22] translate UpdateServerOffline live last version --- htdocs/langs/en_US/admin.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index bca163db8bd..1f9f6286b1d 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -304,6 +304,7 @@ YouCanSubmitFile=Select module: CurrentVersion=Dolibarr current version CallUpdatePage=Go to the page that updates the database structure and datas: %s. LastStableVersion=Last stable version +UpdateServerOffline=Update server offline GenericMaskCodes=You may enter any numbering mask. In this mask, the following tags could be used:
{000000} corresponds to a number which will be incremented on each %s. Enter as many zeros as the desired length of the counter. The counter will be completed by zeros from the left in order to have as many zeros as the mask.
{000000+000} same as previous but an offset corresponding to the number to the right of the + sign is applied starting on first %s.
{000000@x} same as previous but the counter is reset to zero when month x is reached (x between 1 and 12, or 0 to use the early months of fiscal year defined in your configuration, or 99 to reset to zero every month). If this option is used and x is 2 or higher, then sequence {yy}{mm} or {yyyy}{mm} is also required.
{dd} day (01 to 31).
{mm} month (01 to 12).
{yy}, {yyyy} or {y} year over 2, 4 or 1 numbers.
GenericMaskCodes2={cccc} the client code on n characters
{cccc000} the client code on n characters is followed by a counter dedicated for customer. This counter dedicated to customer is reset at same time than global counter.
{tttt} The code of thirdparty type on n characters (see dictionary-thirdparty types).
GenericMaskCodes3=All other characters in the mask will remain intact.
Spaces are not allowed.
From 0d0c10be1ff8c5afb5591f7d6cbec2fa83a389f2 Mon Sep 17 00:00:00 2001 From: cla Date: Thu, 29 Jan 2015 18:17:43 +0100 Subject: [PATCH 07/22] ADD filter fields in list project page --- htdocs/projet/list.php | 81 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 72 insertions(+), 9 deletions(-) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index f00a6ef518b..f822eefc0a7 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -4,6 +4,7 @@ * Copyright (C) 2005 Marc Bariley / Ocebo * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2015 Claudio Aschieri * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,6 +29,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $langs->load('projects'); @@ -64,6 +66,14 @@ $search_label=GETPOST("search_label"); $search_societe=GETPOST("search_societe"); $search_year=GETPOST("search_year"); $search_all=GETPOST("search_all"); +$search_status=GETPOST("search_status",'int'); +$search_public=GETPOST("search_public",'int'); + +$day = GETPOST('day','int'); +$month = GETPOST('month','int'); +$year = GETPOST('year','int'); + + // Purge criteria if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers @@ -73,6 +83,11 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_societe=""; $search_year=""; $search_all=0; + $search_status=1; + $search_public=""; + $day=""; + $month=""; + $year=""; } /* @@ -81,6 +96,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $projectstatic = new Project($db); $socstatic = new Societe($db); +$form = new Form($db); +$formother = new FormOther($db); llxHeader("",$langs->trans("Projects"),"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"); @@ -109,14 +126,29 @@ if ($search_societe) { $sql .= natural_search('s.nom', $search_societe); } -if ($search_year) { - $sql .= " AND (p.dateo IS NULL OR p.dateo <= ".$db->idate(dol_get_last_day($search_year,12,false)).")"; - $sql .= " AND (p.datee IS NULL OR p.datee >= ".$db->idate(dol_get_first_day($search_year,1,false)).")"; +if ($month > 0) +{ + if ($year > 0 && empty($day)) + $sql.= " AND p.datee BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'"; + else if ($year > 0 && ! empty($day)) + $sql.= " AND p.datee BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'"; + else + $sql.= " AND date_format(p.datee, '%m') = '".$month."'"; } +else if ($year > 0) +{ + $sql.= " AND p.datee BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; +} + if ($search_all) { $sql .= natural_search(array('p.ref','p.title','s.nom'), $search_all); } + +if ($search_status!='') $sql .= " AND p.fk_statut = ".$db->escape($search_status); + +if ($search_public!='') $sql .= " AND p.public = ".$db->escape($search_public); + $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($conf->liste_limit+1, $offset); @@ -127,6 +159,16 @@ if ($resql) $var=true; $num = $db->num_rows($resql); $i = 0; + + $param=''; + if ($month) $param.='&month='.$month; + if ($year) $param.='&year=' .$year; + if ($search_ref != '') $param.='&search_ref='.$search_ref; + if ($search_label != '') $param.='&search_label='.$search_label; + if ($search_societe != '') $param.='&search_societe='.$search_societe; + if ($search_status != '') $param.='&search_status='.$search_status; + if ($search_public != '') $param.='&search_public='.$search_public; + $text=$langs->trans("Projects"); if ($mine) $text=$langs->trans('MyProjects'); @@ -144,11 +186,13 @@ if ($resql) print ''; print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"p.ref","","","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"p.title","","","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","","","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Visibility"),$_SERVER["PHP_SELF"],"p.public","","","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],'p.fk_statut',"","",'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"p.ref","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"p.title","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"p.datee","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Visibility"),$_SERVER["PHP_SELF"],"p.public","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],'p.fk_statut',"",$param,'align="right"',$sortfield,$sortorder); + print ''; print "\n"; print ''; @@ -161,7 +205,21 @@ if ($resql) print ''; - print ''; + print ''; + + print ''; + print ''; print ''; + // Date end + print ''; + // Visibility print ''; // Last modified date From 1e38227c2d74719480d0cd856e884326aae27331 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Feb 2015 00:54:26 +0100 Subject: [PATCH 17/22] Reduce number of new to save memory usage. Fight table to replace with div --- htdocs/societe/class/societe.class.php | 4 +++- htdocs/user/class/user.class.php | 27 +++++++++++++++----------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index fbba2bce18b..25242e4160f 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1709,6 +1709,8 @@ class Societe extends CommonObject $name=$this->name?$this->name:$this->nom; + if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; + if ($conf->global->SOCIETE_ADD_REF_IN_LIST && (!empty($withpicto))) { if (($this->client) && (! empty ( $this->code_client ))) { $code = $this->code_client . ' - '; @@ -1766,7 +1768,7 @@ class Societe extends CommonObject if (! empty($this->logo)) { - $label.= '

'; + $label.= '
'; //if (! is_object($form)) $form = new Form($db); $label.= Form::showphoto('societe', $this, 80); } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index ee43d8c48af..96d3a26e9a9 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1778,9 +1778,10 @@ class User extends CommonObject * @param int $withpicto Include picto in link (0=No picto, 1=Inclut le picto dans le lien, 2=Picto seul) * @param string $option On what the link point to * @param boolean $infologin Add connection info to the tooltip + * @param string $notooltip 1=Disable tooltip * @return string String with URL */ - function getNomUrl($withpicto=0, $option='', $infologin=0) + function getNomUrl($withpicto=0, $option='', $infologin=0, $notooltip=0) { global $langs, $conf, $db; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -1790,9 +1791,7 @@ class User extends CommonObject $companylink = ''; $label = '' . $langs->trans("User") . ''; - $label.= '
 
'; print ''; print ' '; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; + $formother->select_year($year?$year:-1,'year',1, 20, 5); + print ''; + $array=array(''=>'',0 => $langs->trans("PrivateProject"),1 => $langs->trans("SharedProject")); + print $form->selectarray('search_public',$array,$search_public); + print ''; + + print $form->selectarray('search_status', array(''=>'', '0'=>$langs->trans('Draft'),'1'=>$langs->trans('Opened'),'2'=>$langs->trans('Closed')),$search_status); + + print ''; print ''; print ''; @@ -207,6 +265,11 @@ if ($resql) } print ''; + print dol_print_date($db->jdate($objp->date_end),'day'); + print ''; if ($objp->public) print $langs->trans('SharedProject'); From 0501153835cfaedf36023b1c86db13676769eaf6 Mon Sep 17 00:00:00 2001 From: cla Date: Fri, 30 Jan 2015 11:08:49 +0100 Subject: [PATCH 08/22] Update list project page: add sales rapresentatives and linked user. --- htdocs/projet/list.php | 92 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 89 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index f822eefc0a7..5b1da5792f5 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -68,6 +68,8 @@ $search_year=GETPOST("search_year"); $search_all=GETPOST("search_all"); $search_status=GETPOST("search_status",'int'); $search_public=GETPOST("search_public",'int'); +$search_user=GETPOST('search_user','int'); +$search_sale=GETPOST('search_sale','int'); $day = GETPOST('day','int'); $month = GETPOST('month','int'); @@ -85,6 +87,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_all=0; $search_status=1; $search_public=""; + $search_sale=""; + $search_user=''; $day=""; $month=""; $year=""; @@ -109,6 +113,15 @@ $sql.= ", p.datec as date_create, p.dateo as date_start, p.datee as date_end"; $sql.= ", s.nom as name, s.rowid as socid"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; + +// We'll need this table joined to the select in order to filter by sale +if ($search_sale || (! $user->rights->societe->client->voir && ! $socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; +if ($search_user > 0) +{ + $sql.=", ".MAIN_DB_PREFIX."element_contact as c"; + $sql.=", ".MAIN_DB_PREFIX."c_type_contact as tc"; +} + $sql.= " WHERE p.entity = ".$conf->entity; if ($mine || ! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser @@ -149,6 +162,13 @@ if ($search_status!='') $sql .= " AND p.fk_statut = ".$db->escape($search_status if ($search_public!='') $sql .= " AND p.public = ".$db->escape($search_public); +if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale; +if ($search_user > 0) +{ + $sql.= " AND c.fk_c_type_contact = tc.rowid AND tc.element='project' AND tc.source='internal' AND c.element_id = p.rowid AND c.fk_socpeople = ".$search_user; +} + + $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($conf->liste_limit+1, $offset); @@ -168,12 +188,19 @@ if ($resql) if ($search_societe != '') $param.='&search_societe='.$search_societe; if ($search_status != '') $param.='&search_status='.$search_status; if ($search_public != '') $param.='&search_public='.$search_public; + if ($search_user > 0) $param.='&search_user='.$search_user; + if ($search_sale > 0) $param.='&search_sale='.$search_sale; $text=$langs->trans("Projects"); if ($mine) $text=$langs->trans('MyProjects'); print_barre_liste($text, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num); + print '
'; + + print ''; + + // Show description of content if ($mine) print $langs->trans("MyProjectsDesc").'

'; else @@ -181,14 +208,36 @@ if ($resql) if ($user->rights->projet->all->lire && ! $socid) print $langs->trans("ProjectsDesc").'

'; else print $langs->trans("ProjectsPublicDesc").'

'; } + + // If the user can view prospects other than his' + if ($user->rights->societe->client->voir || $socid) + { + $langs->load("commercial"); + $moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': '; + $moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user); + $moreforfilter.='       '; + } + // If the user can view prospects other than his' + + if (($user->rights->societe->client->voir || $socid) && !$mine) + { + $moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': '; + $moreforfilter.=$form->select_dolusers($search_user,'search_user',1); + } + if (! empty($moreforfilter)) + { + print ''; + print ''; + } + - print ''; - - print '
'; + print $moreforfilter; + print '
'; print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"p.ref","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"p.title","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("SalesRepresentative"),$_SERVER["PHP_SELF"],"","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"p.datee","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Visibility"),$_SERVER["PHP_SELF"],"p.public","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],'p.fk_statut',"",$param,'align="right"',$sortfield,$sortorder); @@ -205,6 +254,8 @@ if ($resql) print ''; + print ''; + print ''; + + // Sales Rapresentatives + print ''; + // Date end print ''; } diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index ee876aa87c6..8bb98b6cdaa 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -322,7 +322,7 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $ global $conf; //if (! empty($conf->browser->phone)) return ''; // combobox disabled for smartphones (does not works) - //if (! empty($conf->dol_use_jmobile)) return ''; // select2 works with jmobile + if (! empty($conf->dol_use_jmobile)) return ''; // select2 works with jmobile but it breaks the autosize feature of jmobile. if (! empty($conf->global->MAIN_DISABLE_AJAX_COMBOX)) return ''; if (empty($conf->use_javascript_ajax)) return ''; From 7501e0973871e21453d5eb3972c009816ee92ba2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 31 Jan 2015 22:29:31 +0100 Subject: [PATCH 15/22] Fix: Crazy change --- htdocs/societe/index.php | 41 +++++++++++----------------------------- 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index d92a28a08f1..e10d1c88680 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -295,45 +295,26 @@ if ($result) $thirdparty_static->datem=$db->jdate($objp->datem); $thirdparty_static->status=$objp->status; $thirdparty_static->canvas=$objp->canvas; - //print $thirdparty_static->getNomUrl(1); - //print "\n"; + print $thirdparty_static->getNomUrl(1); + print "\n"; // Type - //print '\n"; - // Type - print '\n"; - // Type - print '\n"; - // Type - print '\n"; - print ''; // Last modified date From 34cbcad9da821f7c37978e1291bfb4dc6f6b8ac8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Feb 2015 00:40:42 +0100 Subject: [PATCH 16/22] Reduce number of new to save memory usage. Fight table to replace with div --- htdocs/core/class/html.form.class.php | 2 +- htdocs/societe/class/societe.class.php | 27 ++++++++++++++------------ htdocs/societe/index.php | 6 +++--- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 38a2eee7555..21650cd62f6 100755 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4506,7 +4506,7 @@ class Form * @param int $width Width of photo * @return string HTML code to output photo */ - function showphoto($modulepart,$object,$width=100) + static function showphoto($modulepart,$object,$width=100) { global $conf; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 11ae1363ed6..fbba2bce18b 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1700,9 +1700,10 @@ class Societe extends CommonObject * @param int $withpicto Add picto into link (0=No picto, 1=Include picto with link, 2=Picto only) * @param string $option Target of link ('', 'customer', 'prospect', 'supplier') * @param int $maxlen Max length of text + * @param string $notooltip 1=Disable tooltip * @return string String with URL */ - function getNomUrl($withpicto=0,$option='',$maxlen=0) + function getNomUrl($withpicto=0,$option='',$maxlen=0,$notooltip=0) { global $conf,$langs; @@ -1718,11 +1719,10 @@ class Societe extends CommonObject $name =$code.' '.$name; } - $result=''; - $lien=$lienfin=''; - $label = '
'; print ''; print ' '; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; @@ -265,6 +316,41 @@ if ($resql) } print ''; + if($objp->socid) + { + $listsalesrepresentatives=$socstatic->getSalesRepresentatives($user); + $nbofsalesrepresentative=count($listsalesrepresentatives); + if ($nbofsalesrepresentative > 3) // We print only number + { + print ''; + print $nbofsalesrepresentative; + print ''; + } + else if ($nbofsalesrepresentative > 0) + { + $userstatic=new User($db); + $j=0; + foreach($listsalesrepresentatives as $val) + { + $userstatic->id=$val['id']; + $userstatic->lastname=$val['lastname']; + $userstatic->firstname=$val['firstname']; + print $userstatic->getNomUrl(1); + $j++; + if ($j < $nbofsalesrepresentative) print ', '; + } + } + else print $langs->trans("NoSalesRepresentativeAffected"); + } + else + { + print ' '; + } + print ''; print dol_print_date($db->jdate($objp->date_end),'day'); From a35bd9a3e45dcad59bb17dea904377ff13a43e58 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 31 Jan 2015 00:27:11 +0100 Subject: [PATCH 09/22] Fixed bad sql request --- htdocs/fourn/commande/list.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 4f0974abd10..54cc7b1964a 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -123,7 +123,7 @@ if ($search_user) } if ($search_ttc) { - $sql .= " AND total_ttc = '".$db->escape(price2num($search_ttc))."'"; + $sql .= " AND cf.total_ttc = '".$db->escape(price2num($search_ttc))."'"; } if ($sall) { @@ -134,7 +134,7 @@ if ($socid) $sql.= " AND s.rowid = ".$socid; //Required triple check because statut=0 means draft filter if (GETPOST('statut', 'int') !== '') { - $sql .= " AND fk_statut IN (".GETPOST('statut').")"; + $sql .= " AND cf.fk_statut IN (".GETPOST('statut').")"; } if ($search_refsupp) { @@ -142,8 +142,8 @@ if ($search_refsupp) } if ($search_status >= 0) { - if ($search_status == 6 || $search_status == 7) $sql.=" AND fk_statut IN (6,7)"; - else $sql.=" AND fk_statut = ".$search_status; + if ($search_status == 6 || $search_status == 7) $sql.=" AND cf.fk_statut IN (6,7)"; + else $sql.=" AND cf.fk_statut = ".$search_status; } $sql.= $db->order($sortfield,$sortorder); @@ -172,7 +172,7 @@ if ($resql) if ($search_refsupp) $param.="&search_refsupp=".$search_refsupp; if ($socid) $param.="&socid=".$socid; if ($search_status >= 0) $param.="&search_status=".$search_status; - + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords); print ''; print ''; @@ -268,7 +268,7 @@ if ($resql) } print "
\n"; print "\n"; - + print '
'.img_help(1,'').' '.$langs->trans("ToBillSeveralOrderSelectCustomer", $langs->transnoentitiesnoconv("CreateInvoiceForThisCustomer")).'
'; $db->free($resql); From 720caf8e31a3cf87282f35631426b8af65eb8842 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 31 Jan 2015 12:19:06 +0100 Subject: [PATCH 10/22] Missing XPF currency --- htdocs/install/mysql/data/llx_c_currencies.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/data/llx_c_currencies.sql b/htdocs/install/mysql/data/llx_c_currencies.sql index 70a3486f959..90785b52fc3 100644 --- a/htdocs/install/mysql/data/llx_c_currencies.sql +++ b/htdocs/install/mysql/data/llx_c_currencies.sql @@ -150,6 +150,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'VEF' INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'VND', '[8363]', 1, 'Viet Nam Dong'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XAF', NULL, 1, 'Communaute Financiere Africaine (BEAC) CFA Franc'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XOF', NULL, 1, 'Communaute Financiere Africaine (BCEAO) Franc'); +INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XPF', NULL, 1, 'Franc pacifique (XPF)'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'YER', '[65020]', 1, 'Yemen Rial'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ZWD', '[90,36]', 1, 'Zimbabwe Dollar'); From ce8ad39a8e59302ef7f01c9899229e137c873967 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 31 Jan 2015 13:00:51 +0100 Subject: [PATCH 11/22] Remove test code and restore prod code. --- htdocs/core/lib/pdf.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 129d32fc7d9..794ba7ac2af 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -520,7 +520,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default // Get format of bank account according to its country $usedetailedbban=$account->useDetailedBBAN(); - $onlynumber=0; $usedetailedbban=1; // For tests + //$onlynumber=0; $usedetailedbban=1; // For tests if ($usedetailedbban) { $savcurx=$curx; From d32f52cc506341766c81b5dc191253f749312091 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 31 Jan 2015 16:23:23 +0100 Subject: [PATCH 12/22] Fix date of delivery, and avoid duplicate tracking number. --- .../modules/expedition/doc/pdf_merou.modules.php | 16 ++++++++++++---- .../expedition/doc/pdf_rouget.modules.php | 15 +++++++++++---- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index fefe2f591fe..e861bff6169 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -560,7 +560,7 @@ class pdf_merou extends ModelePdfExpedition $pdf->SetXY($blSocX-80,$blSocY+17); $pdf->SetFont('','B', $default_font_size - 2); $pdf->SetTextColor(0,0,0); - $pdf->MultiCell(50, 8, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date_delivery,'day',false,$outputlangs,true), '', 'L'); + $pdf->MultiCell(50, 8, $outputlangs->transnoentities("DateDelivery")." : " . dol_print_date($object->date_delivery,'day',false,$outputlangs,true), '', 'L'); $pdf->SetXY($blSocX-80,$blSocY+20); $pdf->SetFont('','B', $default_font_size - 2); @@ -568,7 +568,7 @@ class pdf_merou extends ModelePdfExpedition $pdf->MultiCell(50, 8, $outputlangs->transnoentities("TrackingNumber")." : " . $object->tracking_number, '', 'L'); // Deliverer - $pdf->SetXY($blSocX-80,$blSocY+24); + $pdf->SetXY($blSocX-80,$blSocY+23); $pdf->SetFont('','', $default_font_size - 2); $pdf->SetTextColor(0,0,0); @@ -581,8 +581,16 @@ class pdf_merou extends ModelePdfExpedition { // Get code using getLabelFromKey $code=$outputlangs->getLabelFromKey($this->db,$object->shipping_method_id,'c_shipment_mode','rowid','code'); - $label=$outputlangs->trans("SendingMethod".strtoupper($code))." :"; - $pdf->writeHTMLCell(50, 8, '', '', $label." ".$object->tracking_url, '', 'L'); + $label=''; + $label.=$outputlangs->trans("SendingMethod").": ".$outputlangs->trans("SendingMethod".strtoupper($code)); + //var_dump($object->tracking_url != $object->tracking_number);exit; + if ($object->tracking_url != $object->tracking_number) + { + $label.=" : "; + $label.=$object->tracking_url; + } + $pdf->SetFont('','B', $default_font_size - 2); + $pdf->writeHTMLCell(50, 8, '', '', $label, '', 'L'); } } } diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index ef9db41254b..9c5dada3a72 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -212,10 +212,17 @@ class pdf_rouget extends ModelePdfExpedition { // Get code using getLabelFromKey $code=$outputlangs->getLabelFromKey($this->db,$object->shipping_method_id,'c_shipment_mode','rowid','code'); - $label=$outputlangs->trans("LinkToTrackYourPackage")."
"; - $label.=$outputlangs->trans("SendingMethod".strtoupper($code))." :"; + $label=''; + if ($object->tracking_url != $object->tracking_number) $label.=$outputlangs->trans("LinkToTrackYourPackage")."
"; + $label.=$outputlangs->trans("SendingMethod").": ".$outputlangs->trans("SendingMethod".strtoupper($code)); + //var_dump($object->tracking_url != $object->tracking_number);exit; + if ($object->tracking_url != $object->tracking_number) + { + $label.=" : "; + $label.=$object->tracking_url; + } $pdf->SetFont('','B', $default_font_size - 2); - $pdf->writeHTMLCell(60, 4, $this->posxdesc-1, $tab_top+6, $label." ".$object->tracking_url, 0, 1, false, true, 'L'); + $pdf->writeHTMLCell(60, 4, $this->posxdesc-1, $tab_top_alt, $label, 0, 1, false, true, 'L'); $tab_top_alt = $pdf->GetY(); } @@ -537,7 +544,7 @@ class pdf_rouget extends ModelePdfExpedition $posy+=4; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->date_creation,"daytext",false,$outputlangs,true), '', 'R'); + $pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->date_livraison,"daytext",false,$outputlangs,true), '', 'R'); if (! empty($object->client->code_client)) { From 2788a352cfdfa7b3bf2309e82e0b0324001228fa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 31 Jan 2015 19:00:00 +0100 Subject: [PATCH 13/22] Missing lang loading --- htdocs/core/lib/agenda.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 72c3214610a..174b1c79092 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -50,6 +50,8 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh global $conf, $user, $langs, $db, $hookmanager; global $begin_h, $end_h, $begin_d, $end_d; + $langs->load("companies"); + // Filters print '
'; print ''; From 9188be57ce963ecc95a11a108f244271e2e5ba31 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 31 Jan 2015 19:25:26 +0100 Subject: [PATCH 14/22] Select2 component creates problem of sizing with jmobile. --- htdocs/core/class/html.form.class.php | 22 ++++++++++++--------- htdocs/core/class/html.formother.class.php | 10 ++++++---- htdocs/core/class/html.formprojet.class.php | 5 +++-- htdocs/core/lib/agenda.lib.php | 2 +- htdocs/core/lib/ajax.lib.php | 2 +- 5 files changed, 24 insertions(+), 17 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 51a893832b1..38a2eee7555 100755 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -832,8 +832,9 @@ class Form if ($conf->use_javascript_ajax && ! $forcecombo) { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; - $out.= ajax_combobox($htmlname, $events, $conf->global->COMPANY_USE_SEARCH_TO_SELECT); - $nodatarole=' data-role="none"'; + $comboenhancement =ajax_combobox($htmlname, $events, $conf->global->COMPANY_USE_SEARCH_TO_SELECT); + $out.= $comboenhancement; + $nodatarole=($comboenhancement?' data-role="none"':''); } // Construct $out and $outarray @@ -1037,8 +1038,9 @@ class Form if ($conf->use_javascript_ajax && ! $forcecombo && ! $options_only) { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; - $out.= ajax_combobox($htmlname, $events, $conf->global->CONTACT_USE_SEARCH_TO_SELECT); - $nodatarole=' data-role="none"'; + $comboenhancement = ajax_combobox($htmlname, $events, $conf->global->CONTACT_USE_SEARCH_TO_SELECT); + $out.= $comboenhancement; + $nodatarole=($comboenhancement?' data-role="none"':''); } if ($htmlname != 'none' || $options_only) $out.= ''; @@ -4288,7 +4291,7 @@ class Form // Try also magic suggest - // Add data-role="none" to diable jmobile decoration + // Add data-role="none" to disable jmobile decoration $out = ''; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 68a7b677667..5bb491adf89 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -324,8 +324,9 @@ class FormOther if ($conf->use_javascript_ajax) { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; - $moreforfilter.= ajax_combobox('select_categ_'.$htmlname); - $nodatarole=' data-role="none"'; + $comboenhancement = ajax_combobox('select_categ_'.$htmlname); + $moreforfilter.=$comboenhancement; + $nodatarole=($comboenhancement?' data-role="none"':''); } // Print a select with each of them @@ -373,8 +374,9 @@ class FormOther if ($conf->use_javascript_ajax) { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; - $out.= ajax_combobox($htmlname); - $nodatarole=' data-role="none"'; + $comboenhancement = ajax_combobox($htmlname); + $out.=$comboenhancement; + $nodatarole=($comboenhancement?' data-role="none"':''); } // Select each sales and print them in a select input $out.='
'; print $langs->trans("Project").'   '; print ''; - $formproject->select_projects($socid?$socid:-1, $pid, 'projectid'); + $formproject->select_projects($socid?$socid:-1, $pid, 'projectid', 0); print '
'; + print ''; if ($thirdparty_static->client==1 || $thirdparty_static->client==3) { - print $thirdparty_static->getNomUrl(1, 'customer'); - print "'; - print $langs->trans("Customer"); - } - if ($thirdparty_static->client == 3 && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { - print $thirdparty_static->getNomUrl(1); - print "'; - print " / "; + $thirdparty_static->name=$langs->trans("Customer"); + print $thirdparty_static->getNomUrl(0,'customer'); } + if ($thirdparty_static->client == 3 && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) print " / "; if (($thirdparty_static->client==2 || $thirdparty_static->client==3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { - print $thirdparty_static->getNomUrl(1, 'prospect'); - print "'; - print $langs->trans("Prospect"); + $thirdparty_static->name=$langs->trans("Prospect"); + print $thirdparty_static->getNomUrl(0,'prospect'); } if (! empty($conf->fournisseur->enabled) && $thirdparty_static->fournisseur) { - if (! $thirdparty_static->client) { - print $thirdparty_static->getNomUrl(1, 'supplier'); - print "'; - print $langs->trans("Supplier"); - } else { - // Type - print " / "; - print $langs->trans("Supplier"); - } + if ($thirdparty_static->client) print " / "; + $thirdparty_static->name=$langs->trans("Supplier"); + print $thirdparty_static->getNomUrl(0,'supplier'); } print '
'; - $label.= ''; - $label.= ''; - if (! empty($this->logo)) { - $form = new Form($db); - $label .= ''; + if (! empty($this->logo)) + { + $label.= '

'; + //if (! is_object($form)) $form = new Form($db); + $label.= Form::showphoto('societe', $this, 80); } - $label.= '
'; + $result=''; $label=''; + $lien=''; $lienfin=''; + + $label.= '
'; if ($option == 'customer' || $option == 'compta') { @@ -1764,15 +1764,18 @@ class Societe extends CommonObject if (! empty($this->code_fournisseur)) $label.= '
' . $langs->trans('SupplierCode') . ': '. $this->code_fournisseur; - $label.= '
  ' . $form->showphoto('societe', $this, 80) . '
'; + $label.= ''; // Add type of canvas - $lien.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; + $lien.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'"'; + $lien.=($notooltip?'':' title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip"'); + $lien.='>'; $lienfin=''; if ($withpicto) $result.=($lien.img_object($label, 'company', 'class="classfortooltip"').$lienfin); diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index e10d1c88680..d675c0d0a5b 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -302,19 +302,19 @@ if ($result) if ($thirdparty_static->client==1 || $thirdparty_static->client==3) { $thirdparty_static->name=$langs->trans("Customer"); - print $thirdparty_static->getNomUrl(0,'customer'); + print $thirdparty_static->getNomUrl(0,'customer',0,1); } if ($thirdparty_static->client == 3 && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) print " / "; if (($thirdparty_static->client==2 || $thirdparty_static->client==3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { $thirdparty_static->name=$langs->trans("Prospect"); - print $thirdparty_static->getNomUrl(0,'prospect'); + print $thirdparty_static->getNomUrl(0,'prospect',0,1); } if (! empty($conf->fournisseur->enabled) && $thirdparty_static->fournisseur) { if ($thirdparty_static->client) print " / "; $thirdparty_static->name=$langs->trans("Supplier"); - print $thirdparty_static->getNomUrl(0,'supplier'); + print $thirdparty_static->getNomUrl(0,'supplier',0,1); } print '
'; - $label.= ''; - $label.= ''; + if (! empty($this->photo)) + { + $label.= '
'; + //if (! is_object($form)) $form = new Form($db); + $label.= Form::showphoto('userphoto', $this, 80); } - $label.= '
'; + $label.= ''; // Info Login - if ($infologin) { + if ($infologin) + { $label.= '
'; $label.= '
'.$langs->trans("Connection").''; $label.= '
'.$langs->trans("IPAddress").': '.$_SERVER["REMOTE_ADDR"]; @@ -1833,10 +1835,13 @@ class User extends CommonObject } - $lien = ''; + $lien = ' Date: Sun, 1 Feb 2015 01:28:15 +0100 Subject: [PATCH 18/22] Avoid tooltip into tooltip --- htdocs/core/ajax/ajaxdirtree.php | 2 +- htdocs/ecm/index.php | 2 +- htdocs/societe/class/societe.class.php | 2 +- htdocs/user/class/user.class.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index ae70d1a418a..76fc64b50cf 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -188,7 +188,7 @@ if (file_exists($fullpathselecteddir)) $userstatic->lastname=isset($val['login_c'])?$val['login_c']:0; $htmltooltip=''.$langs->trans("ECMSection").': '.$val['label'].'
'; $htmltooltip=''.$langs->trans("Type").': '.$langs->trans("ECMSectionManual").'
'; - $htmltooltip.=''.$langs->trans("ECMCreationUser").': '.$userstatic->getNomUrl(1).'
'; + $htmltooltip.=''.$langs->trans("ECMCreationUser").': '.$userstatic->getNomUrl(1, '', false, 1).'
'; $htmltooltip.=''.$langs->trans("ECMCreationDate").': '.(isset($val['date_c'])?dol_print_date($val['date_c'],"dayhour"):$langs->trans("NeedRefresh")).'
'; $htmltooltip.=''.$langs->trans("Description").': '.$val['description'].'
'; $htmltooltip.=''.$langs->trans("ECMNbOfFilesInDir").': '.((isset($val['cachenbofdoc']) && $val['cachenbofdoc'] >= 0)?$val['cachenbofdoc']:$langs->trans("NeedRefresh")).'
'; diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index d675542140c..a6dc5442aa7 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -664,7 +664,7 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti $userstatic->lastname=$val['login_c']; $htmltooltip=''.$langs->trans("ECMSection").': '.$val['label'].'
'; $htmltooltip=''.$langs->trans("Type").': '.$langs->trans("ECMSectionManual").'
'; - $htmltooltip.=''.$langs->trans("ECMCreationUser").': '.$userstatic->getNomUrl(1).'
'; + $htmltooltip.=''.$langs->trans("ECMCreationUser").': '.$userstatic->getNomUrl(1, '', false, 1).'
'; $htmltooltip.=''.$langs->trans("ECMCreationDate").': '.dol_print_date($val['date_c'],"dayhour").'
'; $htmltooltip.=''.$langs->trans("Description").': '.$val['description'].'
'; $htmltooltip.=''.$langs->trans("ECMNbOfFilesInDir").': '.$val['cachenbofdoc'].'
'; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 25242e4160f..77673b82ed3 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1780,7 +1780,7 @@ class Societe extends CommonObject $lien.='>'; $lienfin='
'; - if ($withpicto) $result.=($lien.img_object($label, 'company', 'class="classfortooltip"').$lienfin); + if ($withpicto) $result.=($lien.img_object(($notooltip?'':$label), 'company', ($notooltip?'':'class="classfortooltip"')).$lienfin); if ($withpicto && $withpicto != 2) $result.=' '; $result.=$lien.($maxlen?dol_trunc($name,$maxlen):$name).$lienfin; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 96d3a26e9a9..860b855d52a 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1842,7 +1842,7 @@ class User extends CommonObject if ($withpicto) { - $result.=($lien.img_object($label, 'user', 'class="classfortooltip"').$lienfin); + $result.=($lien.img_object(($notooltip?'':$label), 'user', ($notooltip?'':'class="classfortooltip"')).$lienfin); if ($withpicto != 2) $result.=' '; } $result.= $lien . $this->getFullName($langs,'','',24) . $companylink . $lienfin; From 968b2b433b747e4068299e682ee78f306cbebc9d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Feb 2015 01:43:19 +0100 Subject: [PATCH 19/22] Better position for username --- htdocs/main.inc.php | 39 +------------------------------- htdocs/user/class/user.class.php | 7 +++--- 2 files changed, 5 insertions(+), 41 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index a5eecd998e3..7be99f5e278 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1401,43 +1401,6 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $form=new Form($db); // Define link to login card - /* - $loginhtmltext=''; $logintext=''; - if ($user->societe_id) - { - $thirdpartystatic=new Societe($db); - $thirdpartystatic->fetch($user->societe_id); - $companylink=' ('.$thirdpartystatic->getNomUrl('','').')'; - $company=' ('.$langs->trans("Company").': '.$thirdpartystatic->name.')'; - } - $logintext=''; - $loginhtmltext.=''.$langs->trans("User").''; - $loginhtmltext.='
'.$langs->trans("Name").': '.$user->getFullName($langs); - $loginhtmltext.='
'.$langs->trans("Login").': '.$user->login; - $loginhtmltext.='
'.$langs->trans("EMail").': '.$user->email; - $loginhtmltext.='
'.$langs->trans("Administrator").': '.yn($user->admin); - $type=($user->societe_id?$langs->trans("External").$company:$langs->trans("Internal")); - $loginhtmltext.='
'.$langs->trans("Type").': '.$type; - $loginhtmltext.='
'; - $loginhtmltext.='
'.$langs->trans("Connection").''; - $loginhtmltext.='
'.$langs->trans("IPAddress").': '.$_SERVER["REMOTE_ADDR"]; - if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY)) $loginhtmltext.='
'.$langs->trans("ConnectedOnMultiCompany").': '.$conf->entity.' (user entity '.$user->entity.')'; - $loginhtmltext.='
'.$langs->trans("AuthenticationMode").': '.$_SESSION["dol_authmode"].(empty($dolibarr_main_demo)?'':' (demo)'); - $loginhtmltext.='
'.$langs->trans("ConnectedSince").': '.dol_print_date($user->datelastlogin,"dayhour"); - $loginhtmltext.='
'.$langs->trans("PreviousConnexion").': '.dol_print_date($user->datepreviouslogin,"dayhour"); - $loginhtmltext.='
'.$langs->trans("CurrentTheme").': '.$conf->theme; - $loginhtmltext.='
'.$langs->trans("CurrentMenuManager").': '.$menumanager->name; - $s=picto_from_langcode($langs->getDefaultLang()); - $loginhtmltext.='
'.$langs->trans("CurrentUserLanguage").': '.($s?$s.' ':'').$langs->getDefaultLang(); - $loginhtmltext.='
'.$langs->trans("Browser").': '.$conf->browser->name.($conf->browser->version?' '.$conf->browser->version:'').' ('.$_SERVER['HTTP_USER_AGENT'].')'; - if (! empty($conf->browser->phone)) $loginhtmltext.='
'.$langs->trans("Phone").': '.$conf->browser->phone; - if (! empty($_SESSION["disablemodules"])) $loginhtmltext.='
'.$langs->trans("DisabledModules").':
'.join(', ',explode(',',$_SESSION["disablemodules"])); - */ - $appli='Dolibarr'; if (! empty($conf->global->MAIN_APPLICATION_TITLE)) { @@ -1471,7 +1434,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $toprightmenu.=''; $toprightmenu.='