From 4a012c13b2553da3a1704531b9b6c18075d25105 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 26 Mar 2020 19:46:36 +0100 Subject: [PATCH 1/7] FIX Translation of tooltips of extrafields --- htdocs/core/class/commonobject.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c193ae977dc..0d3ab9162dd 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6638,9 +6638,10 @@ abstract class CommonObject if (($mode == 'create' || $mode == 'edit') && abs($visibility) != 1 && abs($visibility) != 3) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list elseif ($mode == 'view' && empty($visibility)) continue; if (empty($perms)) continue; - // Load language if required - if (!empty($extrafields->attributes[$this->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]); + if (!empty($extrafields->attributes[$this->table_element]['langfile'][$key])) { + $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]); + } $colspan = ''; if (is_array($params) && count($params) > 0) { @@ -6739,8 +6740,8 @@ abstract class CommonObject { $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix) ?price2num(GETPOST($keyprefix.'options_'.$key.$keysuffix, 'alpha', 3)) : $this->array_options['options_'.$key]; } - $labeltoshow = $langs->trans($label); + $helptoshow = $langs->trans($extrafields->attributes[$this->table_element]['help'][$key]); $out .= 'attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]); + if (!empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $helptoshow); else $out .= $labeltoshow; if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) $out .= ' *'; } else { if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) $out .= ' fieldrequired'; - $out .= '"'; - $out .= '>'; - if (!empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]); + $out .= '">'; + if (!empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $helptoshow); else $out .= $labeltoshow; } $out .= ''; From 9379f6fa9d3ff43da33d1e88e5e1ae0174e8ad12 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 26 Mar 2020 20:05:17 +0100 Subject: [PATCH 2/7] Fix duplicate tooltip --- htdocs/core/class/extrafields.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 57debc1311b..cf439f210be 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1577,9 +1577,9 @@ class ExtraFields if ($type == 'date') $out.=' (YYYY-MM-DD)'; elseif ($type == 'datetime') $out.=' (YYYY-MM-DD HH:MM:SS)'; */ - if (! empty($help) && $keyprefix != 'search_options_') { + /*if (! empty($help) && $keyprefix != 'search_options_') { $out .= $form->textwithpicto('', $help, 1, 'help', '', 0, 3); - } + }*/ return $out; } From 259f23e96bc47092bb80d0767be28361d4874fe9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Mar 2020 11:15:38 +0100 Subject: [PATCH 3/7] Look and feel v11 --- htdocs/bom/bom_list.php | 5 +++-- htdocs/modulebuilder/template/myobject_list.php | 3 ++- htdocs/mrp/mo_list.php | 5 +++-- htdocs/theme/md/style.css.php | 1 - 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 12602f9744a..446d629f090 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -482,7 +482,7 @@ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfi $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table -print ''."\n"; +print '
'."\n"; // Fields title search @@ -502,7 +502,7 @@ foreach ($object->fields as $key => $val) elseif (strpos($val['type'], 'integer:') === 0) { print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); } - elseif (! preg_match('/^(date|timestamp)/', $val['type'])) print ''; + elseif (!preg_match('/^(date|timestamp)/', $val['type'])) print ''; print ''; } } @@ -582,6 +582,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) elseif ($key == 'ref') $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') $cssforfield .= ($cssforfield ? ' ' : '').'right'; + if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; if (!empty($arrayfields['t.'.$key]['checked'])) { diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 46f347618f4..827eb430b84 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -409,7 +409,7 @@ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfi $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table -print '
'."\n"; +print '
'."\n"; // Fields title search @@ -509,6 +509,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) elseif ($key == 'ref') $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') $cssforfield .= ($cssforfield ? ' ' : '').'right'; + //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; if (!empty($arrayfields['t.'.$key]['checked'])) { diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 1b7849992a0..d2c2bdcf0ef 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -398,7 +398,7 @@ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfi $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table -print '
'."\n"; +print '
'."\n"; // Fields title search @@ -418,7 +418,7 @@ foreach ($object->fields as $key => $val) elseif (strpos($val['type'], 'integer:') === 0) { print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); } - elseif (! preg_match('/^(date|timestamp)/', $val['type'])) print ''; + elseif (!preg_match('/^(date|timestamp)/', $val['type'])) print ''; print ''; } } @@ -498,6 +498,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) elseif ($key == 'ref') $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') $cssforfield .= ($cssforfield ? ' ' : '').'right'; + if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; if (!empty($arrayfields['t.'.$key]['checked'])) { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 0293513109d..e800689b15d 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2886,7 +2886,6 @@ table.paddingtopbottomonly tr td { background: rgb() !important; } tr.liste_titre_filter td.liste_titre { - border-bottom: 1px solid #FDFFFF; padding-top: 4px; padding-bottom: 3px; } From 3a9cc532d70f040138d7d6b0da99b1d284b3c5b6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Mar 2020 11:52:08 +0100 Subject: [PATCH 4/7] FIX Use getNomURL instead of hard coded link. Fix limit. --- htdocs/product/stock/index.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index 35e16e5c840..beeb7155a51 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -70,13 +70,14 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele print "

"; } +$max = 15; -$sql = "SELECT e.ref as label, e.rowid, e.statut"; +$sql = "SELECT e.rowid, e.ref as label, e.lieu, e.statut as status"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= " WHERE e.statut in (0,1)"; $sql.= " AND e.entity IN (".getEntity('stock').")"; $sql.= $db->order('e.statut', 'DESC'); -$sql.= $db->plimit(15, 0); +$sql.= $db->plimit($max + 1, 0); $result = $db->query($sql); @@ -92,20 +93,31 @@ if ($result) if ($num) { - $entrepot=new Entrepot($db); + $warehouse=new Entrepot($db); - while ($i < $num) + while ($i < min($max, $num)) { $objp = $db->fetch_object($result); + $warehouse->id = $objp->rowid; + $warehouse->statut = $objp->status; + $warehouse->label = $objp->label; + $warehouse->lieu = $objp->lieu; + print ''; - print "rowid\">".img_object($langs->trans("ShowStock"), "stock")." ".$objp->label."\n"; - print ''.$entrepot->LibStatut($objp->statut, 5).''; + print ''; + print $warehouse->getNomUrl(1); + print ''."\n"; + print ''.$warehouse->getLibStatut(5).''; print "\n"; $i++; } $db->free($result); } + if ($num > $max) { + print ''.$langs->trans("More").'...'; + } + print ""; print ''; } From f512e0d161fc113dcfd9ff07d31b916f61e2ce4e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Mar 2020 12:06:18 +0100 Subject: [PATCH 5/7] Fix popup --- htdocs/product/stock/index.php | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index beeb7155a51..93c6e65ad49 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -45,6 +45,7 @@ $result=restrictedArea($user, 'stock'); */ $producttmp=new Product($db); +$warehouse=new Entrepot($db); $help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'; llxHeader("", $langs->trans("Stocks"), $help_url); @@ -93,8 +94,6 @@ if ($result) if ($num) { - $warehouse=new Entrepot($db); - while ($i < min($max, $num)) { $objp = $db->fetch_object($result); @@ -108,7 +107,9 @@ if ($result) print ''; print $warehouse->getNomUrl(1); print ''."\n"; - print ''.$warehouse->getLibStatut(5).''; + print ''; + print $warehouse->getLibStatut(5); + print ''; print "\n"; $i++; } @@ -134,7 +135,7 @@ print '
'; // Last movements $max=10; $sql = "SELECT p.rowid, p.label as produit, p.tobatch, p.tosell, p.tobuy,"; -$sql.= " e.ref as stock, e.rowid as entrepot_id,"; +$sql.= " e.ref as warehouse_ref, e.rowid as warehouse_id, e.ref as warehouse_label, e.lieu, e.statut as warehouse_status,"; $sql.= " m.value as qty, m.datem, m.batch, m.eatby, m.sellby"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= ", ".MAIN_DB_PREFIX."stock_mouvement as m"; @@ -178,6 +179,12 @@ if ($resql) $producttmp->status_sell = $objp->tosell; $producttmp->status_buy = $objp->tobuy; + $warehouse->id = $objp->warehouse_id; + $warehouse->ref = $objp->warehouse_ref; + $warehouse->statut = $objp->warehouse_status; + $warehouse->label = $objp->warehouse_label; + $warehouse->lieu = $objp->lieu; + print ''; print ''.dol_print_date($db->jdate($objp->datem), 'dayhour').''; print ''; @@ -189,9 +196,9 @@ if ($resql) print ''.dol_print_date($db->jdate($objp->sellby), 'day').''; print ''.dol_print_date($db->jdate($objp->eatby), 'day').''; } - print ''; - print img_object($langs->trans("ShowWarehouse"), "stock").' '.$objp->stock; - print "\n"; + print ''; + print $warehouse->getNomUrl(1); + print "\n"; print ''; if ($objp->qty > 0) print '+'; print $objp->qty.''; @@ -202,6 +209,8 @@ if ($resql) print ""; print '
'; +} else { + dol_print_error($db); } //print ''; From 4207d94f53c7687d4ef5fd8155f12ffa129c6d0e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Mar 2020 19:08:39 +0100 Subject: [PATCH 6/7] FIX Bad position of total in column Conflicts: htdocs/fourn/facture/paiement.php --- htdocs/comm/propal/card.php | 2 +- htdocs/commande/card.php | 4 ++-- htdocs/don/card.php | 6 +++--- htdocs/fourn/facture/card.php | 2 +- htdocs/fourn/facture/paiement.php | 4 ++-- htdocs/product/card.php | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index ad3af8c799d..1f5927f260a 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1675,7 +1675,7 @@ if ($action == 'create') $langs->load("projects"); print ''; print ''.$langs->trans("Project").''; - $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1); + $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); print ' id).'">'; print ''; print ''; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 3e9c1a2b0ca..9b389bccb5b 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1734,7 +1734,7 @@ if ($action == 'create' && $usercancreate) $langs->load("projects"); print ''; print ''.$langs->trans("Project").''; - $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0); + $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth500'); print ' id).'">'; print ''; print ''; @@ -2100,7 +2100,7 @@ if ($action == 'create' && $usercancreate) $morehtmlref .= '
'; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500'); $morehtmlref .= ''; $morehtmlref .= '
'; } else { diff --git a/htdocs/don/card.php b/htdocs/don/card.php index bba65463bb6..faa6693bce8 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -445,7 +445,7 @@ if ($action == 'create') if (!empty($conf->projet->enabled)) { print "".$langs->trans("Project").""; - $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1); + $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); print "\n"; } @@ -579,7 +579,7 @@ if (!empty($id) && $action == 'edit') $langs->load('projects'); print ''.$langs->trans('Project').''; - $formproject->select_projects(-1, $object->fk_project, 'fk_project', 0, 0, 1, 1); + $formproject->select_projects(-1, $object->fk_project, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); print ''; } @@ -652,7 +652,7 @@ if (!empty($id) && $action != 'edit') $morehtmlref.='
'; $morehtmlref.=''; $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500'); $morehtmlref.=''; $morehtmlref.='
'; } else { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 329ee266362..703a97fe11a 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2077,7 +2077,7 @@ if ($action == 'create') $langs->load('projects'); print ''.$langs->trans('Project').''; - $formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1); + $formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); print ''; } diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 19fed7a3387..ed5a7d244f5 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -916,7 +916,7 @@ if (empty($action) || $action == 'list') $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields print '
'; - print ''."\n"; + print '
'."\n"; // Lines for filters fields print ''; @@ -1018,7 +1018,7 @@ if (empty($action) || $action == 'list') // Amount print ''; if (!$i) $totalarray['nbfield']++; - $totalarray['pos'][7] = 'amount'; + if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'amount'; $totalarray['val']['amount'] += $objp->pamount; // Ref invoice diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 01da1eb741f..f4e959a9459 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1440,7 +1440,7 @@ else // Default warehouse print ''; /* print "".'
'.price($objp->pamount).'
'.$langs->trans("DefaultWarehouse").''; print $formproduct->selectWarehouses($object->fk_default_warehouse, 'fk_default_warehouse', 'warehouseopen', 1); - print ' '.$langs->trans("AddWarehouse").''; + print ' '; print '
'.$langs->trans("StockLimit").''; From 9b2da5bdaea11ec48165165b3e853ce576913294 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 29 Mar 2020 00:53:35 +0100 Subject: [PATCH 7/7] FIX Missing token --- htdocs/ticket/index.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php index 92a931bf15d..180f1a6f4dc 100644 --- a/htdocs/ticket/index.php +++ b/htdocs/ticket/index.php @@ -203,7 +203,8 @@ $stringtoshow = ''; $stringtoshow .= '
'; // hideobject is to start hidden $stringtoshow .= '
'; -$stringtoshow .= ''; +$stringtoshow .= ''; +$stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= $langs->trans("Year").' '; $stringtoshow .= ''; @@ -212,7 +213,7 @@ $stringtoshow .= '
'; print '
'; print ''; -print ''; +print ''; print '
'.$langs->trans("Statistics").' '.img_picto('', 'filter.png', 'id="idsubimgDOLUSERCOOKIE_ticket_by_status" class="linkobject"').'
'.$langs->trans("Statistics").' '.$endyear.' '.img_picto('', 'filter.png', 'id="idsubimgDOLUSERCOOKIE_ticket_by_status" class="linkobject"').'
'; print $stringtoshow;