From c3179963ca3079a53141a1fd4e27a2a5dd817e18 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 14:59:57 +0100 Subject: [PATCH 01/11] Fix search fails under certain circumstances. --- htdocs/admin/modules.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 341cdd00ebc..d4e9b8b7ea0 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -390,6 +390,7 @@ if ($mode != 'marketplace') // Check filters $modulename=$objMod->getName(); + $moduletechnicalname=$objMod->name; $moduledesc=$objMod->getDesc(); $moduledesclong=$objMod->getDescLong(); $moduleauthor=$objMod->getPublisher(); @@ -399,6 +400,7 @@ if ($mode != 'marketplace') { $qualified=0; if (preg_match('/'.preg_quote($search_keyword).'/i', $modulename) + || preg_match('/'.preg_quote($search_keyword).'/i', $moduletechnicalname) || preg_match('/'.preg_quote($search_keyword).'/i', $moduledesc) || preg_match('/'.preg_quote($search_keyword).'/i', $moduledesclong) || preg_match('/'.preg_quote($search_keyword).'/i', $moduleauthor) From 8f338a155a5a8d1d1063b17e8fadbebbee8989bd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 15:19:15 +0100 Subject: [PATCH 02/11] Fix last_insert_id at a better place --- htdocs/core/db/Database.interface.php | 2 +- htdocs/core/modules/import/import_csv.modules.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/db/Database.interface.php b/htdocs/core/db/Database.interface.php index ab38cdf378c..28623f780a5 100644 --- a/htdocs/core/db/Database.interface.php +++ b/htdocs/core/db/Database.interface.php @@ -195,7 +195,7 @@ interface Database * Execute a SQL request and return the resultset * * @param string $query SQL query string - * @param int $usesavepoint 0=Default mode, 1=Run a savepoint before and a rollbock to savepoint if error (this allow to have some request with errors inside global transactions). + * @param int $usesavepoint 0=Default mode, 1=Run a savepoint before and a rollback to savepoint if error (this allow to have some request with errors inside global transactions). * Note that with Mysql, this parameter is not used as Myssql can already commit a transaction even if one request is in error, without using savepoints. * @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...) * @return resource Resultset of answer diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 3e3ec91dd60..96f0dca04fa 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -588,9 +588,9 @@ class ImportCsv extends ModeleImports { $updatedone = false; $insertdone = false; - if(!empty($updatekeys)) { + if (!empty($updatekeys)) { // We do SELECT to get the rowid, if we already have the rowid, it's to be used below for related tables (extrafields) - if(empty($lastinsertid)) { + if (empty($lastinsertid)) { $sqlSelect = 'SELECT rowid FROM '.$tablename; $data = array_combine($listfields, $listvalues); @@ -627,7 +627,7 @@ class ImportCsv extends ModeleImports } } - if(!empty($lastinsertid)) { + if (!empty($lastinsertid)) { // Build SQL UPDATE request $sqlstart = 'UPDATE '.$tablename; @@ -660,7 +660,7 @@ class ImportCsv extends ModeleImports } // Update not done, we do insert - if(!$error && !$updatedone) { + if (!$error && !$updatedone) { // Build SQL INSERT request $sqlstart = 'INSERT INTO '.$tablename.'('.implode(', ', $listfields).', import_key'; $sqlend = ') VALUES('.implode(', ', $listvalues).", '".$importid."'"; @@ -679,10 +679,10 @@ class ImportCsv extends ModeleImports if ($sql) { $resql=$this->db->query($sql); - $last_insert_id_array[$tablename] = $this->db->last_insert_id($tablename); // store the last inserted auto_increment id for each table, so that dependent tables can be inserted with the appropriate id. This must be done just after the INSERT request, else we risk losing the id (because another sql query will be issued somewhere in Dolibarr). if ($resql) { - $insertdone = true; + $last_insert_id_array[$tablename] = $this->db->last_insert_id($tablename); // store the last inserted auto_increment id for each table, so that child tables can be inserted with the appropriate id. This must be done just after the INSERT request, else we risk losing the id (because another sql query will be issued somewhere in Dolibarr). + $insertdone = true; } else { From a9b39f302812465c5cb4ca4c0b17a80f9ac79472 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 16:19:18 +0100 Subject: [PATCH 03/11] Fix dol_banner for agenda --- htdocs/core/class/html.form.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 51d24f7c729..9a5aadd2148 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5745,7 +5745,13 @@ class Form { $ret.=dol_htmlentities($object->getFullName($langs)); } + else if (in_array($object->element, array('action', 'agenda'))) + { + $ret.=$object->label; + } else if ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref); + + if ($morehtmlref) { $ret.=' '.$morehtmlref; From 2a3d3b4b50cac7d5e843bbf74e03fd60cf1fea08 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 16:40:38 +0100 Subject: [PATCH 04/11] Fix dol_banner for agenda --- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/tpl/resource_add.tpl.php | 2 +- htdocs/theme/eldy/style.css.php | 10 ++++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 9a5aadd2148..60ff30c6433 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5747,7 +5747,7 @@ class Form } else if (in_array($object->element, array('action', 'agenda'))) { - $ret.=$object->label; + $ret.=$object->ref.'
'.$object->label; } else if ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref); diff --git a/htdocs/core/tpl/resource_add.tpl.php b/htdocs/core/tpl/resource_add.tpl.php index 97cb933bcf7..68fccf6e540 100644 --- a/htdocs/core/tpl/resource_add.tpl.php +++ b/htdocs/core/tpl/resource_add.tpl.php @@ -8,7 +8,7 @@ $formresources = new FormResource($db); $out = '
'; -$out .= '
'; +$out .= ''; $out .= ''; $out .= ''; $out .= ''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 5d03c087f06..7c699c31e7f 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2742,11 +2742,12 @@ div.pagination li.paginationafterarrows { } */ + /* Set the color for hover lines */ .odd:hover, .impair:hover, .even:hover, .pair:hover, .even:hover, .pair:hover, table.dataTable tr.even:hover, table.dataTable tr.odd:hover, .box_pair:hover, .box_impair:hover { - background: rgb() !important; + background-color: rgb() !important; } @@ -2757,10 +2758,10 @@ div.pagination li.paginationafterarrows { color: #202020; min-height: 18px; /* seems to not be used */ - background: #; + background-color: #; } #GanttChartDIV { - background: #; + background-color: #; } .even, .pair, .nohover .even:hover, .nohover .pair:hover, tr.even td.nohover, tr.pair td.nohover { @@ -2776,13 +2777,14 @@ table.dataTable tr.odd { } /* For no hover style */ -table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.impair td, table.nohover tr.pair td, tr.nohover td { +table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.impair td, table.nohover tr.pair td, tr.nohover td, form.nohover, form.nohover:hover { background-color: # !important; } tr.nohoverpair td { background-color: # !important; } + table.dataTable td { padding: 5px 2px 5px 3px !important; } From b6bdd985997bbb7be6839212ff5e5fd61a2ad27b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 16:44:30 +0100 Subject: [PATCH 05/11] Fix css --- htdocs/core/tpl/resource_add.tpl.php | 2 +- htdocs/theme/md/style.css.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/resource_add.tpl.php b/htdocs/core/tpl/resource_add.tpl.php index 68fccf6e540..b521445701b 100644 --- a/htdocs/core/tpl/resource_add.tpl.php +++ b/htdocs/core/tpl/resource_add.tpl.php @@ -6,7 +6,7 @@ require_once(DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php'); $form = new Form($db); $formresources = new FormResource($db); -$out = '
'; +$out = '
'; $out .= ''; $out .= ''; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index df3e374b565..4c5016268a8 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2648,7 +2648,7 @@ table.dataTable tr.odd { } /* For no hover style */ -table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.impair td, table.nohover tr.pair td, tr.nohover td { +table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.impair td, table.nohover tr.pair td, tr.nohover td, form.nohover, form.nohover:hover { background-color: # !important; } tr.nohoverpair td { From 209bd0b3e4cd7c09cf4794c70f88ebe18af2cc80 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 16:53:26 +0100 Subject: [PATCH 06/11] 2nd try to fix better compatibility --- htdocs/core/class/commonobject.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2fc6d22fd62..7b812e7ee36 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1223,11 +1223,11 @@ abstract class CommonObject * @param int $id To force other object id (should not be used) * @param string $format Data format ('text', 'date'). 'text' is used if not defined * @param string $id_field To force rowid field name. 'rowid' is used if not defined - * @param User|string $user Update last update fields also if user object provided. If not provided, current user is used. + * @param User|string $fuser Update the user of last update field with this user. If not provided, current user is used except if value is 'none' * @param string $trigkey Trigger key to run (in most cases something like 'XXX_MODIFY') * @return int <0 if KO, >0 if OK */ - function setValueFrom($field, $value, $table='', $id=null, $format='', $id_field='', $user='', $trigkey='') + function setValueFrom($field, $value, $table='', $id=null, $format='', $id_field='', $fuser=null, $trigkey='') { global $user,$langs,$conf; @@ -1247,7 +1247,8 @@ abstract class CommonObject if ($format == 'text') $sql.= $field." = '".$this->db->escape($value)."'"; else if ($format == 'int') $sql.= $field." = ".$this->db->escape($value); else if ($format == 'date') $sql.= $field." = ".($value ? "'".$this->db->idate($value)."'" : "null"); - if (empty($user) && is_object($user)) $sql.=", fk_user_modif = ".$user->id; + if (! empty($fuser) && is_object($fuser)) $sql.=", fk_user_modif = ".$fuser->id; + elseif (empty($fuser) || $fuser != 'none') $sql.=", fk_user_modif = ".$user->id; $sql.= " WHERE ".$id_field." = ".$id; dol_syslog(get_class($this)."::".__FUNCTION__."", LOG_DEBUG); @@ -1256,7 +1257,7 @@ abstract class CommonObject { if ($trigkey) { - $result=$this->call_trigger($trigkey, $user); // This may set this->errors + $result=$this->call_trigger($trigkey, (! empty($fuser) && is_object($fuser)) ? $fuser : $user); // This may set this->errors if ($result < 0) $error++; } From 29c66b43a34d2933b619f8df3a0517dd639311a0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 00:07:14 +0100 Subject: [PATCH 07/11] Fix responsive --- htdocs/core/lib/company.lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 2e809fa6c3b..b010f8143b4 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -531,6 +531,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin print "\n"; print load_fiche_titre($langs->trans("ProjectsDedicatedToThisThirdParty"),$buttoncreate,''); + print '
'; print "\n".''; $sql = "SELECT p.rowid as id, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status"; @@ -597,7 +598,8 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin dol_print_error($db); } print "
"; - + print '
'; + print "
\n"; } From c0b3219c7258e7f6ee2ed65c8b6b798a797e6a7f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 00:33:04 +0100 Subject: [PATCH 08/11] Missing translation --- htdocs/langs/en_US/loan.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/loan.lang b/htdocs/langs/en_US/loan.lang index de0a6fd0295..a26e23bbbc2 100644 --- a/htdocs/langs/en_US/loan.lang +++ b/htdocs/langs/en_US/loan.lang @@ -43,6 +43,7 @@ LoanCalcDesc=This mortgage calculator can be used to figure out monthly p GoToInterest=%s will go towards INTEREST GoToPrincipal=%s will go towards PRINCIPAL YouWillSpend=You will spend %s in year %s +AddLoan=Create loan # Admin ConfigLoan=Configuration of the module loan LOAN_ACCOUNTING_ACCOUNT_CAPITAL=Accounting account capital by default From 67300f2a4eea0f54f823b1451b1075bcae125b44 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 00:50:31 +0100 Subject: [PATCH 09/11] FIX choice of category was lost if an error occurs during creation --- htdocs/projet/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 661272631bc..f69b54cffdc 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -591,6 +591,7 @@ if ($action == 'create' && $user->rights->projet->creer) // Categories print ''.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1); + $arrayselected=GETPOST('categories', 'array'); print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, '100%'); print ""; } From 4737c62394f1a5654f2ade30f71df66953eae6d1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 00:50:55 +0100 Subject: [PATCH 10/11] FIX Avoid flash on screen --- htdocs/core/class/html.formprojet.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index ffce8300a0c..47706d90d7f 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -586,7 +586,7 @@ class FormProjets if ($num > 0) { $sellist = '