From 983f707553132edb0dddc2c0e3633c7324f143e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Jan 2017 11:35:25 +0100 Subject: [PATCH 01/27] Add comment --- htdocs/api/class/api_login.class.php | 2 +- test/soapui/Dolibarr-soapui-project.xml | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/api/class/api_login.class.php b/htdocs/api/class/api_login.class.php index 305bc7cafe6..439308fcaea 100644 --- a/htdocs/api/class/api_login.class.php +++ b/htdocs/api/class/api_login.class.php @@ -34,7 +34,7 @@ class Login /** * Login * - * Log user with username and password + * Log user with username and password. Using method POST is recommanded for security reasons (method GET is often logged by default by web servers with parameters so with login and pass) * * @param string $login Username * @param string $password User password diff --git a/test/soapui/Dolibarr-soapui-project.xml b/test/soapui/Dolibarr-soapui-project.xml index b5de27fbf31..4556cebeca2 100755 --- a/test/soapui/Dolibarr-soapui-project.xml +++ b/test/soapui/Dolibarr-soapui-project.xml @@ -1889,7 +1889,7 @@ -]]>http://schemas.xmlsoap.org/wsdl/http://localhostdolibarr/webservices/server_user.php<xml-fragment/>UTF-8http://localhostdolibarr/webservices/server_user.php +]]>http://schemas.xmlsoap.org/wsdl/http://localhostdolibarr/webservices/server_user.phphttp://pchome-ld.hd.free.fr:801/dolibarr_5.0/htdocs/webservices/server_user.php<xml-fragment/>UTF-8http://pchome-ld.hd.free.fr:801/dolibarr_5.0/htdocs/webservices/server_user.php @@ -1901,8 +1901,7 @@ admin - 1 - + admin From 4f949bea29f7dcb86caf3bddbaf900902123b20a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Jan 2017 11:46:30 +0100 Subject: [PATCH 02/27] FIX #6273 --- htdocs/contrat/class/contrat.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 202a3dc2a0d..958f14f8911 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -693,8 +693,8 @@ class Contrat extends CommonObject // fetch optionals attributes and labels $line->fetch_optionals($line->id,$extralabelsline); - $this->lines[] = $line; - $this->lines_id_index_mapper[$line->id] = key($this->lines); + $this->lines[$i] = $line; + $this->lines_id_index_mapper[$line->id] = $i; //dol_syslog("1 ".$line->desc); //dol_syslog("2 ".$line->product_desc); From c01baf1223275a7d71b2bd1d0f2a4dfb398624fc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Jan 2017 12:16:49 +0100 Subject: [PATCH 03/27] FIX #6255 --- htdocs/compta/prelevement/class/bonprelevement.class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 5bc09419666..1354d2c06eb 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1272,7 +1272,7 @@ class BonPrelevement extends CommonObject * section Debiteur (sepa Debiteurs bloc lines) */ - $tmp_invoices = array(); + /*$tmp_invoices = array(); $sql = "SELECT f.facnumber as fac FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."prelevement_facture as pf, ".MAIN_DB_PREFIX."societe as soc, ".MAIN_DB_PREFIX."c_country as p, ".MAIN_DB_PREFIX."societe_rib as rib WHERE pl.fk_prelevement_bons = ".$this->id." AND pl.rowid = pf.fk_prelevement_lignes AND pf.fk_facture = f.rowid AND soc.fk_pays = p.rowid AND soc.rowid = f.fk_soc AND rib.fk_soc = f.fk_soc AND rib.default_rib = 1"; $resql=$this->db->query($sql); @@ -1280,9 +1280,7 @@ class BonPrelevement extends CommonObject while ($objfac = $this->db->fetch_object($resql)) { $tmp_invoices[] = $objfac->fac; } - } - - $ListOfFactures = implode($tmp_invoices); + }*/ $sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,"; $sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,"; @@ -1310,7 +1308,7 @@ class BonPrelevement extends CommonObject while ($i < $num) { $obj = $this->db->fetch_object($resql); - $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $ListOfFactures, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum); + $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum); $this->total = $this->total + $obj->somme; $i++; } From 43cb9c30b26e58769bccfda515aeed20502886f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Jan 2017 12:21:37 +0100 Subject: [PATCH 04/27] Fix var_dump --- htdocs/compta/prelevement/class/bonprelevement.class.php | 6 +++--- htdocs/compta/prelevement/create.php | 1 + htdocs/core/lib/bank.lib.php | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 1354d2c06eb..9373527e20c 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -813,7 +813,7 @@ class BonPrelevement extends CommonObject dol_syslog(__METHOD__."::Read invoices error ".$this->db->error(), LOG_ERR); } } - + if (! $error) { require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; @@ -834,7 +834,7 @@ class BonPrelevement extends CommonObject { $bac = new CompanyBankAccount($this->db); $bac->fetch(0,$soc->id); - + if ($bac->verif() >= 1) //if (true) { @@ -867,7 +867,7 @@ class BonPrelevement extends CommonObject } $ok=0; - + // Withdraw invoices in factures_prev array $out=count($factures_prev)." invoices will be withdrawn."; //print $out."\n"; diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 8be897990ed..bcc6cc9450e 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -60,6 +60,7 @@ if ($action == 'modify') } if ($action == 'create') { + // $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->PRELEVEMENT_CODE_GUICHET should be empty $bprev = new BonPrelevement($db); $result=$bprev->create($conf->global->PRELEVEMENT_CODE_BANQUE, $conf->global->PRELEVEMENT_CODE_GUICHET); diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index 1df180452c3..47d3539e3ba 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -197,7 +197,7 @@ function checkBanForAccount($account) $rib = strtr($rib, "abcdefghijklmnopqrstuvwxyz", "12345678912345678923456789"); // Separation du rib en 3 groupes de 7 + 1 groupe de 2. // Multiplication de chaque groupe par les coef du tableau -var_dump($rib); + for ($i = 0, $s = 0; $i < 3; $i++) { $code = substr($rib, 7 * $i, 7); $s += (0 + (int) $code) * $coef[$i]; From c1d6ad90b33043f49e76bd329b711dfe3b73c50a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Jan 2017 12:35:19 +0100 Subject: [PATCH 05/27] FIX #6255 --- htdocs/compta/prelevement/create.php | 2 +- htdocs/societe/rib.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index bcc6cc9450e..8a6f4bb7ecc 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -60,7 +60,6 @@ if ($action == 'modify') } if ($action == 'create') { - // $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->PRELEVEMENT_CODE_GUICHET should be empty $bprev = new BonPrelevement($db); $result=$bprev->create($conf->global->PRELEVEMENT_CODE_BANQUE, $conf->global->PRELEVEMENT_CODE_GUICHET); @@ -73,6 +72,7 @@ if ($action == 'create') $mesg=''; $mesg=$langs->trans("NoInvoiceCouldBeWithdrawed"); setEventMessages($mesg, null, 'errors'); + $mesg.='
'."\n"; foreach($bprev->invoice_in_error as $key => $val) { $mesg.=$val."
\n"; diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php index 8a6a9b87209..4d3e32e326f 100644 --- a/htdocs/societe/rib.php +++ b/htdocs/societe/rib.php @@ -376,7 +376,7 @@ if ($socid && $action != 'edit' && $action != "create") $content = $account->code_guichet; } elseif ($val == 'BankAccountNumber') { $content = $account->number; - if (! empty($account->label)) { + if (! empty($account->label) && $account->number) { if (! checkBanForAccount($account)) { $content.= ' '.img_picto($langs->trans("ValueIsNotValid"),'warning'); } else { @@ -482,7 +482,7 @@ if ($socid && $action != 'edit' && $action != "create") $string .= $rib->iban.' ';*/ } } - if (! empty($rib->label)) { + if (! empty($rib->label) && $rib->number) { if (! checkBanForAccount($rib)) { $string.= ' '.img_picto($langs->trans("ValueIsNotValid"),'warning'); } else { From 7ebb5f7d92aca7a72996e242c53eb6bd17ecd7ff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Jan 2017 13:06:26 +0100 Subject: [PATCH 06/27] FIX #6270 --- htdocs/core/actions_sendmails.inc.php | 37 +++++++++++++++------------ 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 9ec3bfcb3b7..28799231fdd 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -337,24 +337,27 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO } // Initialisation of datas - $object->socid = $sendtosocid; // To link to a company - $object->sendtoid = $sendtoid; // To link to a contact/address - $object->actiontypecode = $actiontypecode; - $object->actionmsg = $actionmsg; // Long text - $object->actionmsg2 = $actionmsg2; // Short text - $object->trackid = $trackid; - $object->fk_element = $object->id; - $object->elementtype = $object->element; - - // Call of triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($db); - $result=$interface->run_triggers($trigger_name,$object,$user,$langs,$conf); - if ($result < 0) { - $error++; $errors=$interface->errors; + if (is_object($object)) + { + $object->socid = $sendtosocid; // To link to a company + $object->sendtoid = $sendtoid; // To link to a contact/address + $object->actiontypecode = $actiontypecode; + $object->actionmsg = $actionmsg; // Long text + $object->actionmsg2 = $actionmsg2; // Short text + $object->trackid = $trackid; + $object->fk_element = $object->id; + $object->elementtype = $object->element; + + // Call of triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers($trigger_name,$object,$user,$langs,$conf); + if ($result < 0) { + $error++; $errors=$interface->errors; + } + // End call of triggers } - // End call of triggers - + if ($error) { dol_print_error($db); From 1ded1bd52ae22097a7467a915e08699bfaeb7495 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Jan 2017 10:34:35 +0100 Subject: [PATCH 07/27] Fix: missing email --- htdocs/core/modules/modProjet.class.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index 8bdc35efd4f..fe3c3a1d1c2 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -218,18 +218,23 @@ class modProjet extends DolibarrModules $this->export_dependencies_array[$r]=array('projecttask'=>'pt.rowid', 'task_time'=>'ptt.rowid'); $this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_country:label', - 's.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text', - 'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.title'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','cls.code'=>"Text",'p.opp_percent'=>'Numeric','p.description'=>"Text", + 's.phone'=>'Text','s.email'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text', + 'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.title'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','cls.code'=>"Text",'p.opp_percent'=>'Numeric','p.description'=>"Text", 'p.entity'=>'Numeric', 'pt.rowid'=>'Text','pt.label'=>'Text','pt.dateo'=>"Date",'pt.datee'=>"Date",'pt.duration_effective'=>"Duree",'pt.planned_workload'=>"Numeric",'pt.progress'=>"Numeric",'pt.description'=>"Text", 'ptt.rowid'=>'Numeric','ptt.task_date'=>'Date','ptt.task_duration'=>"Duree",'ptt.fk_user'=>"List:user:CONCAT(lastname,' ',firstname)",'ptt.note'=>"Text"); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company', - 's.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company'); + 's.phone'=>'company','s.email'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company'); $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country', - 's.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode', + 's.phone'=>'Phone','s.email'=>'Email','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode', 'p.rowid'=>"ProjectId",'p.ref'=>"RefProject",'p.title'=>'ProjectLabel', 'p.datec'=>"DateCreation",'p.dateo'=>"DateStart",'p.datee'=>"DateEnd",'p.fk_statut'=>'ProjectStatus','cls.code'=>'OpportunityStatus','p.opp_percent'=>'OpportunityProbability','p.description'=>"Description"); - + // Add multicompany field + if (! empty($conf->global->MULTICOMPANY_ENTITY_IN_EXPORT)) + { + $nbofallowedentities=count(explode(',',getEntity('project'))); // If project are shared, nb will be > 1 + if (! empty($conf->multicompany->enabled) && $nbofallowedentities > 1) $this->export_fields_array[$r]+=array('p.entity'=>'Entity'); + } // Add fields for project $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array()); $keyforselect='projet'; $keyforelement='project'; $keyforaliasextra='extra'; From ce37a855ce088dad2263c777b1bbd5dc55190f58 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Jan 2017 10:44:48 +0100 Subject: [PATCH 08/27] Fix translation --- htdocs/langs/en_US/exports.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/exports.lang b/htdocs/langs/en_US/exports.lang index 7c95f12a30d..0393ae72b4f 100644 --- a/htdocs/langs/en_US/exports.lang +++ b/htdocs/langs/en_US/exports.lang @@ -110,7 +110,7 @@ Enclosure=Enclosure SpecialCode=Special code ExportStringFilter=%% allows replacing one or more characters in the text ExportDateFilter=YYYY, YYYYMM, YYYYMMDD : filters by one year/month/day
YYYY+YYYY, YYYYMM+YYYYMM, YYYYMMDD+YYYYMMDD : filters over a range of years/months/days
> YYYY, > YYYYMM, > YYYYMMDD : filters on all following years/months/days
< YYYY, < YYYYMM, < YYYYMMDD : filters on all previous years/months/days -ExportNumericFilter='NNNNN' filters by one value
'NNNNN+NNNNN' filters over a range of values
'>NNNNN' filters by lower values
'>NNNNN' filters by higher values +ExportNumericFilter='NNNNN' filters by one value
'NNNNN+NNNNN' filters over a range of values
'<NNNNN' filters by lower values
'>NNNNN' filters by higher values ImportFromLine=Import starting from line number EndAtLineNb=End at line number SetThisValueTo2ToExcludeFirstLine=For example, set this value to 3 to exclude the 2 first lines From c9ca35ebd156529fc59316df4ce206252c2d0a9c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Jan 2017 10:48:38 +0100 Subject: [PATCH 09/27] Fix translation --- htdocs/langs/en_US/exports.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/exports.lang b/htdocs/langs/en_US/exports.lang index 0393ae72b4f..47b6fde9840 100644 --- a/htdocs/langs/en_US/exports.lang +++ b/htdocs/langs/en_US/exports.lang @@ -110,7 +110,7 @@ Enclosure=Enclosure SpecialCode=Special code ExportStringFilter=%% allows replacing one or more characters in the text ExportDateFilter=YYYY, YYYYMM, YYYYMMDD : filters by one year/month/day
YYYY+YYYY, YYYYMM+YYYYMM, YYYYMMDD+YYYYMMDD : filters over a range of years/months/days
> YYYY, > YYYYMM, > YYYYMMDD : filters on all following years/months/days
< YYYY, < YYYYMM, < YYYYMMDD : filters on all previous years/months/days -ExportNumericFilter='NNNNN' filters by one value
'NNNNN+NNNNN' filters over a range of values
'<NNNNN' filters by lower values
'>NNNNN' filters by higher values +ExportNumericFilter=NNNNN filters by one value
NNNNN+NNNNN filters over a range of values
< NNNNN filters by lower values
> NNNNN filters by higher values ImportFromLine=Import starting from line number EndAtLineNb=End at line number SetThisValueTo2ToExcludeFirstLine=For example, set this value to 3 to exclude the 2 first lines From 16779be162cbf927eba59eb84c90f54cdae1ada8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Jan 2017 10:50:19 +0100 Subject: [PATCH 10/27] Fix missing email/multicompany field --- htdocs/core/modules/modProjet.class.php | 4 ++-- htdocs/core/modules/modSociete.class.php | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index fe3c3a1d1c2..9b980d6d415 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -230,9 +230,9 @@ class modProjet extends DolibarrModules 's.phone'=>'Phone','s.email'=>'Email','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode', 'p.rowid'=>"ProjectId",'p.ref'=>"RefProject",'p.title'=>'ProjectLabel', 'p.datec'=>"DateCreation",'p.dateo'=>"DateStart",'p.datee'=>"DateEnd",'p.fk_statut'=>'ProjectStatus','cls.code'=>'OpportunityStatus','p.opp_percent'=>'OpportunityProbability','p.description'=>"Description"); // Add multicompany field - if (! empty($conf->global->MULTICOMPANY_ENTITY_IN_EXPORT)) + if (! empty($conf->global->MULTICOMPANY_ENTITY_IN_EXPORT_IF_SHARED)) { - $nbofallowedentities=count(explode(',',getEntity('project'))); // If project are shared, nb will be > 1 + $nbofallowedentities=count(explode(',',getEntity('project',1))); // If project are shared, nb will be > 1 if (! empty($conf->multicompany->enabled) && $nbofallowedentities > 1) $this->export_fields_array[$r]+=array('p.entity'=>'Entity'); } // Add fields for project diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index b217d452a86..a80a6877729 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -260,11 +260,17 @@ class modSociete extends DolibarrModules $this->export_permission[$r]=array(array("societe","export")); $this->export_fields_array[$r]=array('s.rowid'=>"Id",'s.nom'=>"Name",'s.status'=>"Status",'s.client'=>"Customer",'s.fournisseur'=>"Supplier",'s.datec'=>"DateCreation",'s.tms'=>"DateLastModification",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode",'s.code_compta'=>"AccountancyCode",'s.code_compta_fournisseur'=>"SupplierAccountancyCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'d.nom'=>'State','c.label'=>"Country",'c.code'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.default_lang'=>"DefaultLang",'s.siren'=>"ProfId1",'s.siret'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.idprof5'=>"ProfId5",'s.idprof6'=>"ProfId6",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note_private'=>"NotePrivate",'s.note_public'=>"NotePublic",'t.libelle'=>"ThirdPartyType",'ce.code'=>"Staff","cfj.libelle"=>"JuridicalStatus",'s.fk_prospectlevel'=>'ProspectLevel','st.code'=>'ProspectStatus','payterm.libelle'=>'PaymentConditions','paymode.libelle'=>'PaymentMode'); if (! empty($conf->global->SOCIETE_USEPREFIX)) $this->export_fields_array[$r]['s.prefix']='Prefix'; + // Add multicompany field + if (! empty($conf->global->MULTICOMPANY_ENTITY_IN_EXPORT_IF_SHARED)) + { + $nbofallowedentities=count(explode(',',getEntity('societe',1))); // If project are shared, nb will be > 1 + if (! empty($conf->multicompany->enabled) && $nbofallowedentities > 1) $this->export_fields_array[$r]+=array('s.entity'=>'Entity'); + } $keyforselect='societe'; $keyforelement='company'; $keyforaliasextra='extra'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; $this->export_fields_array[$r]+=array('u.login'=>'SaleRepresentativeLogin','u.firstname'=>'SaleRepresentativeFirstname', 'u.lastname'=>'SaleRepresentativeLastname'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Text",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'c.label'=>"List:c_country:label:label",'c.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Numeric",'s.note'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code','d.nom'=>'List:c_departements:nom:rowid'); - $this->export_TypeFields_array[$r]=array('s.nom'=>"Text",'s.status'=>"Numeric",'s.client'=>"Numeric",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.code_compta'=>"Text",'s.code_compta_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'c.label'=>"List:c_country:label:label",'c.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Numeric",'s.note_private'=>"Text",'s.note_public'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','st.code'=>'List:c_stcomm:libelle:code','d.nom'=>'Text','u.login'=>'Text','u.firstname'=>'Text','u.lastname'=>'Text','payterm.libelle'=>'Text','paymode.libelle'=>'Text'); + $this->export_TypeFields_array[$r]=array('s.nom'=>"Text",'s.status'=>"Numeric",'s.client'=>"Numeric",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.code_compta'=>"Text",'s.code_compta_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'c.label'=>"List:c_country:label:label",'c.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Numeric",'s.note_private'=>"Text",'s.note_public'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','st.code'=>'List:c_stcomm:libelle:code','d.nom'=>'Text','u.login'=>'Text','u.firstname'=>'Text','u.lastname'=>'Text','payterm.libelle'=>'Text','paymode.libelle'=>'Text','s.entity'=>'Numeric'); $this->export_entities_array[$r]=array('u.login'=>'user','u.firstname'=>'user','u.lastname'=>'user'); // We define here only fields that use another picto $this->export_examplevalues_array[$r]=array('s.client'=>'0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'0 (not a supplier) or 1 (supplier)'); From ec5c4ebf6bd1a6787ac7123f7e0b2dc450cce843 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Jan 2017 11:20:56 +0100 Subject: [PATCH 11/27] FIX timeout during export (can be solved only if safe_mode is off) --- htdocs/exports/export.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 7b51aa02f15..604af215581 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -244,6 +244,13 @@ if ($step == 1 || $action == 'cleanselect') if ($action == 'builddoc') { + $max_execution_time_for_export = (empty($conf->global->EXPORT_MAX_EXECUTION_TIME)?300:$conf->global->EXPORT_MAX_EXECUTION_TIME); // 5mn if not defined + $max_time = @ini_get("max_execution_time"); + if ($max_time && $max_time < $max_execution_time_for_export) + { + @ini_set("max_execution_time", $max_execution_time_for_export); // This work only if safe mode is off. also web servers has timeout of 300 + } + // Build export file $result=$objexport->build_file($user, GETPOST('model','alpha'), $datatoexport, $array_selected, $array_filtervalue); if ($result < 0) From 86e690a064bc63484a956b006ce08a2237eb7ecf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Jan 2017 11:35:38 +0100 Subject: [PATCH 12/27] Fix translation --- htdocs/langs/en_US/compta.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index c3bfaa08110..c4cd1b53d71 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -194,7 +194,7 @@ CloneTax=Clone a social/fiscal tax ConfirmCloneTax=Confirm the clone of a social/fiscal tax payment CloneTaxForNextMonth=Clone it for next month SimpleReport=Simple report -AddExtraReport=Extra reports +AddExtraReport=Extra reports (add foreign and national customer report) OtherCountriesCustomersReport=Foreign customers report BasedOnTwoFirstLettersOfVATNumberBeingDifferentFromYourCompanyCountry=Based on the two first letters of the VAT number being different from your own company's country code SameCountryCustomersWithVAT=National customers report From 7a0d388073d7ffcb8e261c614b177b3f5cab3da4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Jan 2017 11:53:08 +0100 Subject: [PATCH 13/27] Fix if not defined, set default value from constant --- htdocs/fourn/commande/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index fbf06bd8b25..d54a477aeee 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1415,7 +1415,8 @@ if ($action=='create') // If not defined, set default value from constant if (empty($cond_reglement_id) && ! empty($conf->global->SUPPLIER_ORDER_DEFAULT_PAYMENT_TERM_ID)) $cond_reglement_id=$conf->global->SUPPLIER_ORDER_DEFAULT_PAYMENT_TERM_ID; - + if (empty($mode_reglement_id) && ! empty($conf->global->SUPPLIER_ORDER_DEFAULT_PAYMENT_MODE_ID)) $mode_reglement_id=$conf->global->SUPPLIER_ORDER_DEFAULT_PAYMENT_MODE_ID; + print '
'; print ''; print ''; From 13d01a7010d5e32a7220b04791e2c3aded997019 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Jan 2017 17:49:49 +0100 Subject: [PATCH 14/27] Fix css --- htdocs/theme/eldy/style.css.php | 52 ++++++++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 1b5c36bb000..b077c79a992 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -260,10 +260,22 @@ input, input.flat, textarea, textarea.flat, form.flat select, select, select.fla background-color: #FFF; } -input:focus, textarea:focus, button:focus, select:focus { - box-shadow: 0 0 4px #8091BF; - /* TODO Remove shadow on focus. Use instead border-bottom: 1px solid #aaa !important; To disable with select2 too. */ +textarea:focus, button:focus { + /* v6 box-shadow: 0 0 4px #8091BF; */ + border: 1px solid #aaa !important; } +input:focus, select:focus { + /* box-shadow: 0 0 4px #8091BF; */ + border-bottom: 1px solid #666; +} +input.select2-input { + border-bottom: none ! important; +} +.select2-choice { + border: none; + border-bottom: 1px solid #aaa !important; +} + textarea.cke_source:focus { box-shadow: none; @@ -272,16 +284,32 @@ textarea.cke_source:focus input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select { font-size: px; font-family: ; + border: 1px solid #C0C0C0; + /* v6 border: none; + border-bottom: 1px solid #C0C0C0; + outline: none !important;*/ margin: 0px 0px 0px 0px; } -input, textarea, select { +input, select { + /* v6 border-bottom: solid 1px rgba(0,0,0,.2);*/ border-radius: 2px; - border:solid 1px rgba(0,0,0,.3); + border: solid 1px rgba(0,0,0,.3); border-top:solid 1px rgba(0,0,0,.3); border-bottom:solid 1px rgba(0,0,0,.2); - /* box-shadow: 1px 1px 1px rgba(0,0,0,.2) inset;*/ + + padding:4px; + margin-left:0px; + margin-bottom:1px; + margin-top:1px; + } +textarea { + border-radius: 2px; + border: solid 1px rgba(0,0,0,.3); + border-top:solid 1px rgba(0,0,0,.3); + border-bottom:solid 1px rgba(0,0,0,.2); + padding:4px; margin-left:0px; margin-bottom:1px; @@ -4026,7 +4054,14 @@ div.dataTables_length select { background: #FFFFFF !important; } -.select2-choice, +.select2-choice +{ + border: 1px solid #aaa; + /* v6 border-top: none !important; + border-left: none !important; + border-right: none !important; + border-bottom: 1px solid #aaa;*/ +} .select2-drop.select2-drop-above.select2-drop-active, .select2-container-active .select2-choice, .select2-container-active .select2-choices, @@ -4035,6 +4070,7 @@ div.dataTables_length select { .select2-container-multi.select2-container-active .select2-choices { border: 1px solid #aaa; + /* v6 */ } .select2-disabled { @@ -4055,7 +4091,7 @@ a span.select2-chosen line-height: 24px; } .select2-choices .select2-search-choice { - border: 1px solid #aaa !important; + /* border: 1px solid #aaa !important; */ } .select2-results .select2-no-results, .select2-results .select2-searching, .select2-results .select2-ajax-error, .select2-results .select2-selection-limit { From bb95f139a861d50295b4b14e8b7f806350d9a134 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Jan 2017 20:04:41 +0100 Subject: [PATCH 15/27] Fix responsive --- htdocs/adherents/list.php | 2 +- htdocs/admin/boxes.php | 15 ++++-- htdocs/admin/const.php | 3 ++ htdocs/admin/perms.php | 5 +- htdocs/admin/system/about.php | 4 +- htdocs/admin/system/browser.php | 3 +- htdocs/admin/system/database-tables.php | 13 +++-- htdocs/admin/system/database.php | 7 ++- htdocs/admin/system/dolibarr.php | 13 ++++- htdocs/admin/system/modules.php | 3 ++ htdocs/admin/system/phpinfo.php | 8 +-- htdocs/admin/tools/listevents.php | 7 ++- htdocs/admin/triggers.php | 2 + htdocs/core/lib/cron.lib.php | 6 ++- htdocs/cron/list.php | 3 +- htdocs/theme/eldy/style.css.php | 6 ++- htdocs/theme/md/style.css.php | 6 ++- htdocs/user/group/index.php | 65 +++++++++++++++++++++++-- 18 files changed, 142 insertions(+), 29 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index c3499bb000a..28968a849fc 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -375,7 +375,7 @@ if (! empty($moreforfilter)) $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields -print '
'; +print '
'; print ''."\n"; print ''; if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 9e09bf87b1d..9785e945a6a 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -329,7 +329,10 @@ print load_fiche_titre($langs->trans("BoxesAvailable")); print ''."\n"; print ''."\n"; print ''."\n"; -print '
'."\n"; + +print '
'; +print '
'."\n"; + print ''; print ''; print ''; @@ -375,6 +378,8 @@ foreach($boxtoadd as $box) } print '
'.$langs->trans("Box").''.$langs->trans("Note").'/'.$langs->trans("Parameters").'
'."\n"; +print '
'; + print '
'; print ''; print '
'."\n"; @@ -388,7 +393,9 @@ $boxactivated=InfoBox::listBoxes($db,'activated',-1,null); print "
\n\n"; print load_fiche_titre($langs->trans("BoxesActivated")); -print ''; +print '
'; +print '
'."\n"; + print ''; print ''; print ''; @@ -441,7 +448,9 @@ foreach($boxactivated as $key => $box) print ''."\n"; } -print '
'.$langs->trans("Box").''.$langs->trans("Note").'/'.$langs->trans("Parameters").'

'; +print ''; +print '
'; +print '
'; // Other parameters diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 5749fbbb4fb..7fa47724c3d 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -182,6 +182,7 @@ print 'entity) && $debug)?'? print ''; print ''; +print '
'; print ''; print ''; print ''; @@ -297,6 +298,7 @@ if ($result) print '
'.$langs->trans("Name").'
'; +print '
'; if ($conf->use_javascript_ajax) { @@ -311,6 +313,7 @@ if ($conf->use_javascript_ajax) print "\n"; + llxFooter(); $db->close(); diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index e023af90067..4302222630c 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -124,7 +124,7 @@ dol_fiche_head($head, 'default', $langs->trans("Security")); // Show warning about external users print info_admin(showModulesExludedForExternal($modules)).'
'."\n"; - +print '
'; print ''; // Affiche lignes des permissions @@ -215,8 +215,9 @@ if ($result) } print '
'; - print '
'; +dol_fiche_end(); + llxFooter(); $db->close(); diff --git a/htdocs/admin/system/about.php b/htdocs/admin/system/about.php index a558a473957..32532f61f50 100644 --- a/htdocs/admin/system/about.php +++ b/htdocs/admin/system/about.php @@ -86,12 +86,12 @@ if ($sfurl) } print ')'; } - print ' / GNU-GPL v3+'; } else { - print $langs->trans("LastStableVersion").' : ' .$langs->trans("UpdateServerOffline").'
'; + print ' ('.$langs->trans("LastStableVersion").' : ' .$langs->trans("UpdateServerOffline").')
'; } +print ' / GNU-GPL v3+'; print ''; diff --git a/htdocs/admin/system/browser.php b/htdocs/admin/system/browser.php index 30ecc448e4d..b2b5499d298 100644 --- a/htdocs/admin/system/browser.php +++ b/htdocs/admin/system/browser.php @@ -48,6 +48,7 @@ $tmp=getBrowserInfo($_SERVER["HTTP_USER_AGENT"]); // Browser $var=true; +print '
'; print ''; print ''."\n"; $var=!$var; @@ -71,10 +72,10 @@ print ''."\n"; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Screen").'
'; +print '
'; print '
'; - llxFooter(); $db->close(); diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php index 31d35d3f01d..6e528c73094 100644 --- a/htdocs/admin/system/database-tables.php +++ b/htdocs/admin/system/database-tables.php @@ -81,7 +81,8 @@ else { if ($base == 1) { - print ''; + print '
'; + print '
'; print ''; print ''; print ''; @@ -134,11 +135,13 @@ else } } print '
'.$langs->trans("TableName").''.$langs->trans("Type").'
'; + print ''; } if ($base == 2) { - print ''; + print '
'; + print '
'; print ''; print ''; print ''; @@ -173,12 +176,14 @@ else } } print '
'.$langs->trans("TableName").'Nb of tuples
'; + print ''; } if ($base == 4) { // Sqlite by PDO or by Sqlite3 - print ''; + print '
'; + print '
'; print ''; print ''; print ''; @@ -207,6 +212,8 @@ else } } + print '
'.$langs->trans("TableName").''.$langs->trans("NbOfRecord").'
'; + print ''; } } diff --git a/htdocs/admin/system/database.php b/htdocs/admin/system/database.php index ff7a16d1893..c50e6ca9e4c 100644 --- a/htdocs/admin/system/database.php +++ b/htdocs/admin/system/database.php @@ -42,6 +42,7 @@ llxHeader(); print load_fiche_titre($langs->trans("InfoDatabase"),'','title_setup'); // Database +print '
'; print ''; print ''."\n"; print ''."\n"; @@ -54,14 +55,16 @@ print ''."\n"; print ''."\n"; print '
'.$langs->trans("Database").'
'.$langs->trans("Version").''.$db::LABEL.' '.$db->getVersion().'
'.$langs->trans("Password").''.pr print '
'.$langs->trans("DBStoringCharset").''.$db->getDefaultCharacterSetDatabase().'
'.$langs->trans("DBSortingCharset").''.$db->getDefaultCollationDatabase().'
'; +print '
'; // Tables print '
'; +print '
'; print ''; print ''."\n"; print ''."\n"; print '
'.$langs->trans("Tables").'
'.$langs->trans("List").'
'; - +print '
'; $listofvars=$db->getServerParametersValues(); $listofstatus=$db->getServerStatusValues(); @@ -76,6 +79,7 @@ else foreach($arraylist as $listname) { print '
'; + print '
'; print ''; print ''; print ''; @@ -120,6 +124,7 @@ else print ''."\n"; } print '
'.$langs->trans("Parameters").'
'."\n"; + print '
'; } } diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 21b79bcd7a1..3117256e3d6 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -48,6 +48,7 @@ print load_fiche_titre($title,'','title_setup'); // Version $var=true; +print '
'; print ''; print ''."\n"; $var=!$var; @@ -69,10 +70,12 @@ else } print ''."\n"; print '
'.$langs->trans("Version").''.$langs->trans("Value").'
'; +print '
'; print '
'; // Session $var=true; +print '
'; print ''; print ''."\n"; $var=!$var; @@ -107,6 +110,7 @@ foreach($_SESSION as $key => $val) } print ''."\n"; print '
'.$langs->trans("Session").''.$langs->trans("Value").'
'; +print '
'; print '
'; @@ -116,6 +120,7 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S $shmoparray=dol_listshmop(); $var=true; + print '
'; print ''; print ''; print ''; @@ -133,12 +138,14 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S } print '
'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").'
'; + print '
'; print '
'; } // Localisation $var=true; +print '
'; print ''; print ''."\n"; $var=!$var; @@ -234,6 +241,7 @@ if (! empty($conf->global->MAIN_FILESYSTEM_ENCODING)) $tmp=$conf->global->MAIN_F print ''."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php print '
'.$langs->trans("LocalisationDolibarrParameters").''.$langs->trans("Value").'
  => '.$langs->trans("File encoding").''.$tmp.'
'; +print '
'; print '
'; @@ -292,6 +300,7 @@ $configfileparameters=array( ); $var=true; +print '
'; print ''; print ''; print '
'.$langs->trans("Parameters").' '; @@ -353,11 +362,13 @@ foreach($configfileparameters as $key => $value) } } print '
'; +print '
'; print '
'; // Parameters in database +print '
'; print ''; print ''; print ''; @@ -407,7 +418,7 @@ if ($resql) } print '
'.$langs->trans("Parameters").' '.$langs->trans("Database").'
'; - +print '
'; llxFooter(); diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index d812f6c29ed..706e0215059 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -102,6 +102,8 @@ foreach($modulesdir as $dir) closedir($handle); } } + +print '
'; print ''; print ''; print ''; @@ -148,6 +150,7 @@ foreach($sortorder as $numero=>$name) print "\n"; } print '
'.$langs->trans("Modules").'
'; +print '
'; print '
'; sort($rights_ids); $old=''; diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index ffba92fd4fa..3e9ccbc895f 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -68,8 +68,8 @@ print '
'; $phparray=phpinfo_array(); foreach($phparray as $key => $value) { - //print load_fiche_titre($key); - print ''; + print '
'; + print '
'; print ''; //print ''; print ''; @@ -114,7 +114,9 @@ foreach($phparray as $key => $value) print ''; } } - print '
'.$langs->trans("Parameter").''.$key.'

'; + print ''; + print ''; + print '
'; } diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index c44932655ed..4e0651597ee 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -213,6 +213,8 @@ if ($result) } print '
'; + + print '
'; print ''; print ''; print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"e.dateevent","","",'align="left"',$sortfield,$sortorder); @@ -312,7 +314,10 @@ if ($result) if ($usefilter) print ''; else print ''; } - print "
'.$langs->trans("NoEventFoundWithCriteria").'
'.$langs->trans("NoEventOrNoAuditSetup").'
"; + print ""; + print "
"; + + print ""; $db->free($result); } else diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php index de59c9136b2..d0d3c117be6 100644 --- a/htdocs/admin/triggers.php +++ b/htdocs/admin/triggers.php @@ -52,6 +52,7 @@ $template_dir = DOL_DOCUMENT_ROOT.'/core/tpl/'; $interfaces = new Interfaces($db); $triggers = $interfaces->getTriggersList(); +print '
'; print ' @@ -78,6 +79,7 @@ foreach ($triggers as $trigger) } print '
'.$langs->trans("File").'
'; +print '
'; llxFooter(); diff --git a/htdocs/core/lib/cron.lib.php b/htdocs/core/lib/cron.lib.php index 9afd0e7835b..3392785a571 100644 --- a/htdocs/core/lib/cron.lib.php +++ b/htdocs/core/lib/cron.lib.php @@ -92,14 +92,16 @@ function dol_print_cron_urls() //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current // Cron launch + print '
'; print ''.$langs->trans("URLToLaunchCronJobs").':
'; $url=$urlwithroot.'/public/cron/cron_run_jobs.php?'.(empty($conf->global->CRON_KEY)?'':'securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login; print img_picto('','object_globe.png').' '.$url."
\n"; print ' '.$langs->trans("OrToLaunchASpecificJob").'
'; $url=$urlwithroot.'/public/cron/cron_run_jobs.php?'.(empty($conf->global->CRON_KEY)?'':'securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login.'&id=cronjobid'; print img_picto('','object_globe.png').' '.$url."
\n"; - print '
'; - + print '
'; + print '
'; + $logintouse = 'firstadmin'; if ($user->admin) $logintouse = $user->login; diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 5ca0fc61cf2..880235a9a17 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -294,6 +294,7 @@ if (! empty($conf->global->CRON_WARNING_DELAY_HOURS)) print info_admin($langs->t print '
'; +print '
'; print ''; print ''; print_liste_field_titre($langs->trans("ID"),$_SERVER["PHP_SELF"],"t.rowid","",$param,'',$sortfield,$sortorder); @@ -472,6 +473,7 @@ else } print '
'; +print '
'; print ''; @@ -481,7 +483,6 @@ print '

'; dol_print_cron_urls(); - llxFooter(); $db->close(); diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index b077c79a992..249a77a2258 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -619,13 +619,15 @@ div.myavailability { -ms-overflow-style: -ms-autohiding-scrollbar; }*/ /* Style used for most tables */ -.div-table-responsive { +.div-table-responsive, .div-table-responsive-no-min { overflow-x: auto; min-height: 0.01%; } /* Style used for full page tables with field selector and no content after table (priority before previous for such tables) */ -div.fiche>form>div.div-table-responsive { +div.fiche>form>div.div-table-responsive, div.fiche>form>div.div-table-responsive-no-min { overflow-x: auto; +} +div.fiche>form>div.div-table-responsive { min-height: 350px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 7a0d16e4743..07d02674611 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -596,13 +596,15 @@ div.myavailability { -ms-overflow-style: -ms-autohiding-scrollbar; }*/ /* Style used for most tables */ -.div-table-responsive { +.div-table-responsive, .div-table-responsive-no-min { overflow-x: auto; min-height: 0.01%; } /* Style used for full page tables with field selector and no content after table (priority before previous for such tables) */ -div.fiche>form>div.div-table-responsive { +div.fiche>form>div.div-table-responsive, div.fiche>form>div.div-table-responsive-no-min { overflow-x: auto; +} +div.fiche>form>div.div-table-responsive { min-height: 350px; } diff --git a/htdocs/user/group/index.php b/htdocs/user/group/index.php index af46fd39d21..c2dd4936ea8 100644 --- a/htdocs/user/group/index.php +++ b/htdocs/user/group/index.php @@ -38,11 +38,13 @@ $sall=GETPOST('sall'); $search_group=GETPOST('search_group'); $optioncss = GETPOST('optioncss','alpha'); +// Load variable for pagination +$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $sortfield = GETPOST('sortfield','alpha'); $sortorder = GETPOST('sortorder','alpha'); $page = GETPOST('page','int'); if ($page == -1) { $page = 0; } -$offset = $conf->liste_limit * $page; +$offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -56,14 +58,40 @@ $fieldstosearchall = array( ); +/* + * Actions + */ + +if (GETPOST('cancel')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction=''; } + +$parameters=array(); +$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +if (empty($reshook)) +{ + // Selection of new fields + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + + // Purge search criteria + if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All test are required to be compatible with all browsers + { + $search_label=""; + $search_date_creation=""; + $search_date_update=""; + $search_array_options=array(); + } +} + + + /* * View */ llxHeader(); -print load_fiche_titre($langs->trans("ListOfGroups")); - $sql = "SELECT g.rowid, g.nom as name, g.entity, g.datec, COUNT(DISTINCT ugu.fk_user) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."usergroup as g"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_usergroup = g.rowid"; @@ -87,11 +115,33 @@ $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); + + $nbtotalofrecords = $num; + $i = 0; $param="&search_group=".urlencode($search_group)."&sall=".urlencode($sall); if ($optioncss != '') $param.='&optioncss='.$optioncss; + $text = $langs->trans("ListOfGroups"); + + print '
'."\n"; + if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $nbtotalofrecords, 'title_generic', 0, '', '', $limit); + + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); + } + if ($sall) { foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); @@ -103,7 +153,9 @@ if ($resql) //$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; //$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - print ''; + print '
'; + print '
'."\n"; + print ''; print_liste_field_titre($langs->trans("Group"),$_SERVER["PHP_SELF"],"g.nom",$param,"","",$sortfield,$sortorder); //multicompany @@ -114,6 +166,7 @@ if ($resql) print_liste_field_titre($langs->trans("NbOfUsers"),$_SERVER["PHP_SELF"],"nb",$param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateCreationShort"),$_SERVER["PHP_SELF"],"g.datec",$param,"",'align="right"',$sortfield,$sortorder); print "\n"; + $var=True; while ($i < $num) { @@ -139,6 +192,10 @@ if ($resql) $i++; } print "
"; + + print ''; + print "
\n"; + $db->free(); } else From 82492dc023269bdb62a983501baee59aaf7577d0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Jan 2017 20:05:10 +0100 Subject: [PATCH 16/27] Fix oauth2 token generation for Google. The refresh token was not received. --- .../core/modules/oauth/google_oauthcallback.php | 3 +++ htdocs/core/modules/printing/printgcp.modules.php | 4 +++- htdocs/includes/OAuth/OAuth2/Service/Google.php | 15 ++++++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/oauth/google_oauthcallback.php b/htdocs/core/modules/oauth/google_oauthcallback.php index c69493ed9a5..001db7320a0 100644 --- a/htdocs/core/modules/oauth/google_oauthcallback.php +++ b/htdocs/core/modules/oauth/google_oauthcallback.php @@ -84,8 +84,11 @@ if ($action != 'delete' && empty($requestedpermissionsarray)) $apiService = $serviceFactory->createService('Google', $credentials, $storage, $requestedpermissionsarray); // access type needed to have oauth provider refreshing token +// alos note that a refresh token is sent only after a prompt $apiService->setAccessType('offline'); +$apiService->setApprouvalPrompt('force'); + $langs->load("oauth"); diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index baa5106ae93..ebcb9f3cebf 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -450,6 +450,7 @@ class printing_printgcp extends PrintingDriver } $responsedata = json_decode($response, true); //$html .= '
'.print_r($responsedata,true).'
'; + $html .= '
'; $html .= ''; $html .= ''; $html .= ''; @@ -483,10 +484,11 @@ class printing_printgcp extends PrintingDriver else { $html .= ''; - $html .= ''; + $html .= ''; $html .= ''; } $html .= '
'.$langs->trans("Id").'
'.$langs->trans("None").''.$langs->trans("None").'
'; + $html .= '
'; $this->resprint = $html; diff --git a/htdocs/includes/OAuth/OAuth2/Service/Google.php b/htdocs/includes/OAuth/OAuth2/Service/Google.php index a8bb44d8238..0d49609dccb 100644 --- a/htdocs/includes/OAuth/OAuth2/Service/Google.php +++ b/htdocs/includes/OAuth/OAuth2/Service/Google.php @@ -140,12 +140,25 @@ class Google extends AbstractService $this->accessType = $accessType; } + // LDR CHANGE Add approval_prompt to force the prompt if value is set to 'force' so it force return of a "refresh token" in addition to "standard token" + public $approvalPrompt='auto'; + public function setApprouvalPrompt($prompt) + { + if (!in_array($prompt, array('auto', 'force'), true)) { + // @todo Maybe could we rename this exception + throw new InvalidAccessTypeException('Invalid approuvalPrompt, expected either auto or force.'); + } + $this->approvalPrompt = $prompt; + } + /** * {@inheritdoc} */ public function getAuthorizationEndpoint() { - return new Uri('https://accounts.google.com/o/oauth2/auth?access_type=' . $this->accessType); + // LDR CHANGE Add approval_prompt to force the prompt if value is set to 'force' so it force return of a "refresh token" in addition to "standard token" + //return new Uri('https://accounts.google.com/o/oauth2/auth?access_type='.$this->accessType); + return new Uri('https://accounts.google.com/o/oauth2/auth?'.($this->approvalPrompt?'approval_prompt='.$this->approvalPrompt.'&':'').'access_type='.$this->accessType); } /** From c8957a9184130132d1ca2d6a40c6a136d3a26626 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Jan 2017 12:49:36 +0100 Subject: [PATCH 17/27] Prepare rc2 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 9eefb515b4c..fbb09a73b31 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','5.0.0-rc1'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION','5.0.0-rc2'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO',chr(128)); From 6f3677a3221ddee7c191e79e861c810fa58340a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Jan 2017 13:21:34 +0100 Subject: [PATCH 18/27] FIX total payed wrong --- htdocs/compta/sociales/card.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 77393b78f4e..92cb36059e4 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -521,9 +521,6 @@ if ($id > 0) print ''; } - // Status - //print ''.$langs->trans("Status").''.$object->getLibStatut(4, $totalpaye).''; - print ''; print ''; @@ -548,6 +545,8 @@ if ($id > 0) $resql = $db->query($sql); if ($resql) { + $totalpaye = 0; + $num = $db->num_rows($resql); $i = 0; $total = 0; print ''; @@ -582,8 +581,8 @@ if ($id > 0) print ''; } - if ($object->paye == 0) - { + //if ($object->status == ChargeSociales::STATUS_DRAFT) + //{ print "\n"; print "\n"; @@ -592,7 +591,7 @@ if ($id > 0) print ""; print '\n"; - } + //} print "
'.$langs->trans("None").'
".$langs->trans("AlreadyPaid")." :".price($totalpaye)."
".$langs->trans("AmountExpected")." :".price($object->amount)."
".$langs->trans("RemainderToPay")." :'.price($resteapayer)."
"; $db->free($resql); } From 8f577b0754dcf7ffd8e262dbdbb318d2d6bc1936 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Jan 2017 15:19:17 +0100 Subject: [PATCH 19/27] Fix bad link --- htdocs/compta/bank/bankentries.php | 12 ++++++------ htdocs/fourn/facture/paiement.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php index f13b650eff2..54c77ed6e73 100644 --- a/htdocs/compta/bank/bankentries.php +++ b/htdocs/compta/bank/bankentries.php @@ -621,7 +621,7 @@ if ($resql) $last_ok=1; } $i++; - $liste=''.$objr->num_releve.'   '.$liste; + $liste=''.$objr->num_releve.'   '.$liste; } if ($numr >= $nbmax) $liste="...   ".$liste; print $liste; @@ -1208,7 +1208,7 @@ if ($resql) { if ($objp->rappro) // If line not conciliated and account can be conciliated { - print ''.$objp->num_releve.''; + print ''.$objp->num_releve.''; } else if ($action == 'reconcile') { @@ -1224,7 +1224,7 @@ if ($resql) // Transaction reconciliated or edit link if ($objp->rappro && $bankaccount->canBeConciliated() > 0) // If line not conciliated and account can be conciliated { - print ''; + print ''; print img_edit(); print ''; } @@ -1232,13 +1232,13 @@ if ($resql) { if ($user->rights->banque->modifier || $user->rights->banque->consolidate) { - print ''; + print ''; print img_edit(); print ''; } else { - print ''; + print ''; print img_view(); print ''; } @@ -1252,7 +1252,7 @@ if ($resql) print ' '; if ($user->rights->banque->modifier) { - print 'rowid.'&id='.$object->id.'&page='.$page.'">'; + print 'rowid.'&id='.$objp->bankid.'&page='.$page.'">'; print img_delete(); print ''; } diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 2400992b250..1032b8b20ba 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -422,7 +422,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ' '."\n"; } - print '
'; + print '
'; print ''."\n"; print ''; From b6383399aaf64a535b4d3a824c949bf5b15304a7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Jan 2017 15:23:37 +0100 Subject: [PATCH 20/27] Fix bad colspan --- htdocs/compta/bank/releve.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index ddd86e414fa..34fec13aba7 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -348,8 +348,10 @@ else $i = 0; // Ligne Solde debut releve - print ""; - print "\n"; + print ""; + print ""; + print ''; + print "\n"; while ($i < $numrows) { @@ -552,7 +554,9 @@ else print "\n".'"; // Line Balance - print "\n\n"; + print "\n"; + print ""; + print "\n"; print "
id."\"> ".$langs->trans("InitialBankBalance")." :".price($total)." 
".$langs->trans("InitialBankBalance")." :'.price($total).' 
'.$langs->trans("Total")." :".price($totald)."".price($totalc)."  
 ".$langs->trans("EndBankBalance")." :".price($total)." 
 ".$langs->trans("EndBankBalance")." :".price($total)." 
\n"; } From ddbb7ee1f402dd90fc3017a76b3bb616e6301e53 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Jan 2017 15:26:50 +0100 Subject: [PATCH 21/27] Fix bad alignement --- htdocs/compta/bank/releve.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 34fec13aba7..01ec6e22127 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -349,7 +349,7 @@ else // Ligne Solde debut releve print ""; - print "".$langs->trans("InitialBankBalance")." :"; + print "".$langs->trans("InitialBankBalance")." :"; print ''.price($total).' '; print "\n"; @@ -554,7 +554,7 @@ else print "\n".''.$langs->trans("Total")." :".price($totald)."".price($totalc)."  "; // Line Balance - print "\n ".$langs->trans("EndBankBalance")." :"; + print "\n ".$langs->trans("EndBankBalance")." :"; print "".price($total)." "; print "\n"; print "\n"; From d48f2507b50edac397fe2e4b4f8bcc21b2ca241d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Jan 2017 15:37:45 +0100 Subject: [PATCH 22/27] Fix link attachment on bank document page --- htdocs/commande/document.php | 1 + htdocs/compta/bank/document.php | 82 ++++----------------------------- 2 files changed, 10 insertions(+), 73 deletions(-) diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 5175c4c85c5..5ce456fe8e0 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -182,6 +182,7 @@ if ($id > 0 || ! empty($ref)) else { header('Location: index.php'); + exit; } diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php index 0878474dcb5..db70acc7373 100644 --- a/htdocs/compta/bank/document.php +++ b/htdocs/compta/bank/document.php @@ -81,59 +81,13 @@ if ($id) * Actions */ -// Envoi fichier -if ($_POST["sendit"] && !empty($conf->global->MAIN_UPLOAD_DOC)) { - if ($object->fetch($id)) { - - $upload_dir = $conf->bank->dir_output . "/" . $object->ref; - - if (dol_mkdir($upload_dir) >= 0) { - $resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], - $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']), - 0, 0, $_FILES['userfile']['error']); - if (is_numeric($resupload) && $resupload > 0) { - if (image_format_supported($upload_dir . "/" . $_FILES['userfile']['name']) == 1) - { - // Create thumbs - $object->addThumbs($upload_dir . "/" . $_FILES['userfile']['name']); - } - $mesg = '
' . $langs->trans("FileTransferComplete") . '
'; - } - else { - $langs->load("errors"); - if ($resupload < 0) { // Unknown error - $mesg = '
' . $langs->trans("ErrorFileNotUploaded") . '
'; - } - else if (preg_match('/ErrorFileIsInfectedWithAVirus/', - $resupload)) { // Files infected by a virus - $mesg = '
' . $langs->trans("ErrorFileIsInfectedWithAVirus") . '
'; - } - else { // Known error - $mesg = '
' . $langs->trans($resupload) . '
'; - } - } - } - } +if ($object->id > 0) +{ + $object->fetch_thirdparty(); + $upload_dir = $conf->bank->dir_output . "/" . dol_sanitizeFileName($object->ref); } -// Delete -else if ($action == 'confirm_deletefile' && $confirm == 'yes') { - if ($object->fetch($id)) { - - $upload_dir = $conf->bank->dir_output; - $file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - - $ret = dol_delete_file($file, 0, 0, 0, $object); - if ($ret) { - setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); - } else { - setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); - } - - Header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id); - exit; - } -} +include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; /* @@ -182,30 +136,12 @@ if ($id > 0 || !empty($ref)) { dol_fiche_end(); - dol_htmloutput_mesg($mesg, $mesgs); - - /* - * Confirmation suppression fichier - */ - if ($action == 'delete') { - $ret = $form->form_confirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode($_GET["urlfile"]), - $langs->trans('DeleteFile'), - $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', - '', 0, 1); - if ($ret == 'html') - print '
'; - } - - // Affiche formulaire upload - $formfile = new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT . '/compta/bank/document.php?id=' . $object->id, - '', 0, 0, $user->rights->banque, 50, $object); - - - // List of document + $modulepart = 'bank'; + $permission = $user->rights->banque->modifier; + $permtoedit = $user->rights->banque->modifier; $param = '&id=' . $object->id; - $formfile->list_of_documents($filearray, $object, 'bank', $param); + include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; } else { dol_print_error($db); From 3336943ff2c1d089a7daabf9a8d5a852b96d03ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Jan 2017 15:49:12 +0100 Subject: [PATCH 23/27] Fix responsive --- htdocs/compta/bank/annuel.php | 6 +++--- htdocs/compta/bank/releve.php | 6 +++++- htdocs/compta/bank/treso.php | 7 +++---- htdocs/core/lib/functions.lib.php | 2 +- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index f82177e0b21..95a5323252c 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -188,7 +188,7 @@ print ''; print ''; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { - print ''; + print ''; } print ''; @@ -196,7 +196,7 @@ print ''; print ''; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { - print ''; + print ''; } print ''; @@ -218,7 +218,7 @@ for ($mois = 1 ; $mois < 13 ; $mois++) } print ""; - print '
'.$langs->trans("Month").''.$annee.''.$annee.'
 '.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("Debit").''.$langs->trans("Credit").'
 '; + print ' '; if ($encaiss[$case]>0) { print price($encaiss[$case]); diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 01ec6e22127..ffadceafb2e 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -299,6 +299,7 @@ else print ''; print ""; + print '
'; print ''; print ''; print ''; @@ -557,7 +558,10 @@ else print "\n"; print ""; print "\n"; - print "
'.$langs->trans("DateOperationShort").'
 ".$langs->trans("EndBankBalance")." :".price($total)." 
\n"; + print "
"; + print "
"; + + print "\n"; } diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 7cc31e576f6..e889b4dff19 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -93,15 +93,14 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) $head=bank_prepare_head($object); dol_fiche_head($head,'cash',$langs->trans("FinancialAccount"),0,'account'); - print ''; - $linkback = ''.$langs->trans("BackToList").''; - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); dol_fiche_end(); - + print '
'; + $solde = $object->solde(0); // Show next coming entries diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 72762db4f84..f0ecb0e5b13 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -967,7 +967,7 @@ function dol_get_fiche_end($notab=0) * @param int $nodbprefix Do not include DB prefix to forge table name * @param string $morehtmlleft More html code to show before ref * @param string $morehtmlstatus More html code to show under navigation arrows - * @param int $onlybanner Put this to 1, if the card will contains only a banner + * @param int $onlybanner Put this to 1, if the card will contains only a banner (add css 'arearefnobottom' on div) * @param string $morehtmlright More html code to show before navigation arrows * @return void */ From 9d6f84c3a0ae667805174064abf568e6f3f3c7d2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Jan 2017 16:27:23 +0100 Subject: [PATCH 24/27] FIX Try a better fif for #6074 --- htdocs/core/menus/standard/eldy.lib.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index a88e180b16a..d484ef8bc19 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -797,16 +797,16 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->facture->enabled)) { $langs->load("bills"); - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills",$langs->trans("BillsCustomers"),0,$user->rights->facture->lire, '', $mainmenu, 'customers_bills'); - $newmenu->add("/compta/facture.php?action=create&leftmenu=customers_bills",$langs->trans("NewBill"),1,$user->rights->facture->creer); + $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills",$langs->trans("BillsCustomers"),0,$user->rights->facture->lire); + $newmenu->add("/compta/facture.php?action=create",$langs->trans("NewBill"),1,$user->rights->facture->creer); $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills",$langs->trans("List"),1,$user->rights->facture->lire); - if ($usemenuhider || empty($leftmenu) || ($leftmenu == 'customers_bills')) + if ($usemenuhider || empty($leftmenu) || preg_match('/customers_bills/', $leftmenu)) { - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills&search_status=0",$langs->trans("BillShortStatusDraft"),2,$user->rights->facture->lire); - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills&search_status=1",$langs->trans("BillShortStatusNotPaid"),2,$user->rights->facture->lire); - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills&search_status=2",$langs->trans("BillShortStatusPaid"),2,$user->rights->facture->lire); - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills&search_status=3",$langs->trans("BillShortStatusCanceled"),2,$user->rights->facture->lire); + $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_draft&search_status=0",$langs->trans("BillShortStatusDraft"),2,$user->rights->facture->lire); + $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_notpaid&search_status=1",$langs->trans("BillShortStatusNotPaid"),2,$user->rights->facture->lire); + $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_paid&search_status=2",$langs->trans("BillShortStatusPaid"),2,$user->rights->facture->lire); + $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_canceled&search_status=3",$langs->trans("BillShortStatusCanceled"),2,$user->rights->facture->lire); } $newmenu->add("/compta/facture/fiche-rec.php",$langs->trans("ListOfTemplates"),1,$user->rights->facture->lire); @@ -829,15 +829,15 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/fourn/facture/card.php?action=create",$langs->trans("NewBill"),1,$user->rights->fournisseur->facture->creer); $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"),1,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills'); - if ($usemenuhider || empty($leftmenu) || ($leftmenu == 'suppliers_bills')) { - $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills&search_status=0", $langs->trans("BillShortStatusDraft"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills'); - $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills&search_status=1", $langs->trans("BillShortStatusNotPaid"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills'); - $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills&search_status=2", $langs->trans("BillShortStatusPaid"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills'); + if ($usemenuhider || empty($leftmenu) || preg_match('/suppliers_bills/', $leftmenu)) { + $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_draft&search_status=0", $langs->trans("BillShortStatusDraft"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_draft'); + $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_notpaid&search_status=1", $langs->trans("BillShortStatusNotPaid"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_notpaid'); + $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_paid&search_status=2", $langs->trans("BillShortStatusPaid"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_paid'); } $newmenu->add("/fourn/facture/paiement.php", $langs->trans("Payments"),1,$user->rights->fournisseur->facture->lire); - $newmenu->add("/compta/facture/stats/index.php?leftmenu=suppliers_bills&mode=supplier", $langs->trans("Statistics"),1,$user->rights->fournisseur->facture->lire); + $newmenu->add("/compta/facture/stats/index.php?mode=supplier", $langs->trans("Statistics"),1,$user->rights->fournisseur->facture->lire); } // Orders From 8ec1784e41d948d95d496384c885d5ce538e6ee3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Jan 2017 09:46:36 +0100 Subject: [PATCH 25/27] Better translation --- htdocs/langs/en_US/admin.lang | 4 ++-- htdocs/langs/en_US/errors.lang | 1 + htdocs/projet/activity/perday.php | 2 +- htdocs/projet/activity/perweek.php | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index f53bb7f10f6..3ed88e8e29e 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -519,8 +519,8 @@ Module2200Name=Dynamic Prices Module2200Desc=Enable the usage of math expressions for prices Module2300Name=Cron Module2300Desc=Scheduled job management -Module2400Name=Agenda/Events -Module2400Desc=Follow events or rendez-vous. Record manual events into Agendas or let application logs automatic events for tracking purposes. +Module2400Name=Events/Agenda +Module2400Desc=Follow done and upcoming events. Let application logs automatic events for tracking purposes or record manual events or rendez-vous. Module2500Name=Electronic Content Management Module2500Desc=Save and share documents Module2600Name=API/Web services (SOAP server) diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 465db427f6c..edbf603e8fc 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -180,6 +180,7 @@ ErrorFieldAccountNotDefinedForBankLine=Value for Accounting account not defined ErrorBankStatementNameMustFollowRegex=Error, bank statement name must follow the following syntax rule %s ErrorPhpMailDelivery=Check that you don't use a too high number of recipients and that your email content is not similar to a Spam. Ask also your administrator to check firewall and server logs files for a more complete information. ErrorUserNotAssignedToTask=User must be assigned to task to be able to enter time consumed. +ErrorTaskAlreadyAssigned=Task already assigned to user # Warnings WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user. diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 4a1200d9e13..e694d6630a9 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -164,7 +164,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask') if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); - setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'warnings'); + setEventMessages($langs->trans("ErrorTaskAlreadyAssigned"), null, 'warnings'); } else { diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index fcfc3f8e9a6..584923636f0 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -179,7 +179,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask') if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); - setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'warnings'); + setEventMessages($langs->trans("ErrorTaskAlreadyAssigned"), null, 'warnings'); } else { @@ -195,7 +195,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask') $action=''; } -if ($weclickonassign && $action == 'addtime' && $user->rights->projet->lire) +if ($action == 'addtime' && $user->rights->projet->lire) { $timetoadd=$_POST['task']; if (empty($timetoadd)) From 4047de82bdead67aa80e881b52fce8ecd31ab7a1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Jan 2017 10:27:37 +0100 Subject: [PATCH 26/27] Fix navigation on projects --- htdocs/core/class/html.form.class.php | 13 +++++++++---- htdocs/core/lib/files.lib.php | 28 +++++++++++++-------------- htdocs/projet/tasks/contact.php | 2 +- htdocs/projet/tasks/document.php | 2 +- htdocs/projet/tasks/note.php | 2 +- htdocs/projet/tasks/task.php | 6 +++--- htdocs/projet/tasks/time.php | 2 +- 7 files changed, 29 insertions(+), 26 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 591402bbdea..e4049dd85ff 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5658,10 +5658,15 @@ class Form //print "paramid=$paramid,morehtml=$morehtml,shownav=$shownav,$fieldid,$fieldref,$morehtmlref,$moreparam"; $object->load_previous_next_ref((isset($object->next_prev_filter)?$object->next_prev_filter:''),$fieldid,$nodbprefix); - //$previous_ref = $object->ref_previous?''.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Previous"),'previous.png'):' ').'':''; - //$next_ref = $object->ref_next?''.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Next"),'next.png'):' ').'':''; - $previous_ref = $object->ref_previous?''.(($conf->dol_use_jmobile != 4)?'<':' ').'':''.(($conf->dol_use_jmobile != 4)?'<':' ').''; - $next_ref = $object->ref_next?''.(($conf->dol_use_jmobile != 4)?'>':' ').'':''.(($conf->dol_use_jmobile != 4)?'>':' ').''; + $navurl = $_SERVER["PHP_SELF"]; + // Special case for project/task page + if ($paramid == 'project_ref') + { + $navurl = preg_replace('/\/tasks\/(task|contact|time|note|document).php/','/tasks.php',$navurl); + $paramid='ref'; + } + $previous_ref = $object->ref_previous?''.(($conf->dol_use_jmobile != 4)?'<':' ').'':''.(($conf->dol_use_jmobile != 4)?'<':' ').''; + $next_ref = $object->ref_next?''.(($conf->dol_use_jmobile != 4)?'>':' ').'':''.(($conf->dol_use_jmobile != 4)?'>':' ').''; //print "xx".$previous_ref."x".$next_ref; $ret.='
'; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 2744946e215..ed0e0725bed 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1091,21 +1091,19 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio } } elseif ($link) { - if (dol_mkdir($upload_dir) >= 0) { - require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; - $linkObject = new Link($db); - $linkObject->entity = $conf->entity; - $linkObject->url = $link; - $linkObject->objecttype = GETPOST('objecttype', 'alpha'); - $linkObject->objectid = GETPOST('objectid', 'int'); - $linkObject->label = GETPOST('label', 'alpha'); - $res = $linkObject->create($user); - $langs->load('link'); - if ($res > 0) { - setEventMessages($langs->trans("LinkComplete"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("ErrorFileNotLinked"), null, 'errors'); - } + require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; + $linkObject = new Link($db); + $linkObject->entity = $conf->entity; + $linkObject->url = $link; + $linkObject->objecttype = GETPOST('objecttype', 'alpha'); + $linkObject->objectid = GETPOST('objectid', 'int'); + $linkObject->label = GETPOST('label', 'alpha'); + $res = $linkObject->create($user); + $langs->load('link'); + if ($res > 0) { + setEventMessages($langs->trans("LinkComplete"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("ErrorFileNotLinked"), null, 'errors'); } } else diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index ebc486fec7e..060155d6507 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -212,7 +212,7 @@ if ($id > 0 || ! empty($ref)) $projectstatic->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")"; } - dol_banner_tab($projectstatic, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref); print '
'; print '
'; diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 0108f754293..d985454119d 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -155,7 +155,7 @@ if ($object->id > 0) $projectstatic->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")"; } - dol_banner_tab($projectstatic, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref); print '
'; print '
'; diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index 0c4ab4b707f..f595f43bc2b 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -134,7 +134,7 @@ if ($object->id > 0) $projectstatic->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")"; } - dol_banner_tab($projectstatic, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref); print '
'; print '
'; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 3c6f9bb7e6e..cc0eb0fed6f 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -37,8 +37,8 @@ $langs->load("projects"); $langs->load("companies"); $id=GETPOST('id','int'); -$ref=GETPOST("ref",'alpha',1); -$taskref=GETPOST("taskref",'alpha'); +$ref=GETPOST("ref",'alpha',1); // task ref +$taskref=GETPOST("taskref",'alpha'); // task ref $action=GETPOST('action','alpha'); $confirm=GETPOST('confirm','alpha'); $withproject=GETPOST('withproject','int'); @@ -246,7 +246,7 @@ if ($id > 0 || ! empty($ref)) $projectstatic->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")"; } - dol_banner_tab($projectstatic, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref); print '
'; print '
'; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 49d57ae946e..6cb52588a89 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -324,7 +324,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $projectstatic->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")"; } - dol_banner_tab($projectstatic, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref); print '
'; print '
'; From 9bb9d4d36e728c6ce562646cbf002b29bf800beb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Jan 2017 12:08:33 +0100 Subject: [PATCH 27/27] Fix position of field and tooltip --- htdocs/comm/card.php | 32 +++++++++++++++---------------- htdocs/core/lib/functions.lib.php | 2 +- htdocs/langs/en_US/main.lang | 1 + 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 6f6a5516aab..a639fea53ea 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -366,6 +366,21 @@ if ($id > 0) print ''; print ''; + // Max outstanding bill + if ($object->client) + { + print '
'; + print ''; + print ''; + } + // Multiprice level if (! empty($conf->global->PRODUIT_MULTIPRICES)) { @@ -511,23 +526,8 @@ if ($id > 0) print ''; print ''; - // Max outstanding bill - if ($object->client) - { - print ''; - print ''; - print ''; - } - // Outstanding bill - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f0ecb0e5b13..08afbc283f4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3316,7 +3316,7 @@ function print_fleche_navigation($page, $file, $options='', $nextpage=0, $betwee if (! empty($conf->global->MAIN_PAGESIZE_CHOICES)) $pagesizechoices=$conf->global->MAIN_PAGESIZE_CHOICES; print '
'; + print $form->editfieldkey("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer); + print ''; + $limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount'; + print $form->editfieldval("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer,$limit_field_type,($object->outstanding_limit != '' ? price($object->outstanding_limit) : '')); + //if (empty($object->outstanding_limit)) print $langs->trans("NoLimit"); + + print '
'.$langs->trans("ShowCustomerPreview").'
'; - print $form->editfieldkey("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer); - print ''; - $limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount'; - print $form->editfieldval("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer,$limit_field_type,($object->outstanding_limit != '' ? price($object->outstanding_limit) : '')); - //if (empty($object->outstanding_limit)) print $langs->trans("NoLimit"); - - print '
'.$langs->trans("CurrentOutstandingBill").''.price($outstandingBills).$warn.'