From 08eaff729ff90a0beb51a5665d7ed35b5b703912 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Fri, 3 Mar 2017 14:00:38 +0100 Subject: [PATCH] FIX #6461 --- htdocs/contrat/card.php | 9 ++++----- htdocs/contrat/class/contrat.class.php | 13 ++++++++----- htdocs/theme/eldy/style.css.php | 6 ++++-- htdocs/theme/md/style.css.php | 6 ++++-- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 911d1556225..2f2da5bd876 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -62,13 +62,12 @@ $origin=GETPOST('origin','alpha'); $originid=GETPOST('originid','int'); $datecontrat=''; +$usehm=(! empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE:0); // Security check if ($user->societe_id) $socid=$user->societe_id; $result=restrictedArea($user,'contrat',$id); -$usehm=(! empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE:0); - // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('contractcard','globalcard')); @@ -1700,7 +1699,7 @@ else if ($object->statut > 0) { print '<tr '.$bcnd[$var].'>'; - print '<td colspan="'.($conf->margin->enabled?7:6).'"><hr class="opacitymedium"></td>'; + print '<td class="tdhrthin" colspan="'.($conf->margin->enabled?7:6).'"><hr class="opacitymedium tdhrthin"></td>'; print "</tr>\n"; } @@ -1862,7 +1861,7 @@ else print $form->select_date($dateactend,"end",$usehm,$usehm,'',"active",1,0,1); print '</td>'; - print '<td align="center nohover" rowspan="2" valign="middle" class="nohover">'; + print '<td class="center nohover" rowspan="2" valign="middle" class="nohover">'; print '<input type="submit" class="button" name="activate" value="'.$langs->trans("Activate").'"><br>'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '</td>'; @@ -1917,7 +1916,7 @@ else } print '</td>'; - print '<td align="right" rowspan="2" class="nohover">'; + print '<td rowspan="2" class="center nohover">'; print '<input type="submit" class="button" name="close" value="'.$langs->trans("Unactivate").'"><br>'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '</td></tr>'; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 1e442aec41a..12265d55166 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -608,7 +608,8 @@ class Contrat extends CommonObject $extralabelsline=$extrafieldsline->fetch_name_optionals_label($line->table_element,true); $this->lines=array(); - + $pos = 0; + // Selectionne les lignes contrats liees a un produit $sql = "SELECT p.label as product_label, p.description as product_desc, p.ref as product_ref,"; $sql.= " d.rowid, d.fk_contrat, d.statut, d.description, d.price_ht, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.qty, d.remise_percent, d.subprice, d.fk_product_fournisseur_price as fk_fournprice, d.buy_price_ht as pa_ht,"; @@ -693,8 +694,8 @@ class Contrat extends CommonObject // fetch optionals attributes and labels $line->fetch_optionals($line->id,$extralabelsline); - $this->lines[$i] = $line; - $this->lines_id_index_mapper[$line->id] = $i; + $this->lines[$pos] = $line; + $this->lines_id_index_mapper[$line->id] = $pos; //dol_syslog("1 ".$line->desc); //dol_syslog("2 ".$line->product_desc); @@ -709,6 +710,7 @@ class Contrat extends CommonObject $total_ht+=$objp->total_ht; $i++; + $pos++; } $this->db->free($result); } @@ -798,14 +800,15 @@ class Contrat extends CommonObject $line->fetch_optionals($line->id,$extralabelsline); - $this->lines[] = $line; - $this->lines_id_index_mapper[$line->id] = key($this->lines); + $this->lines[$pos] = $line; + $this->lines_id_index_mapper[$line->id] = $pos; $total_ttc+=$objp->total_ttc; $total_vat+=$objp->total_tva; $total_ht+=$objp->total_ht; $i++; + $pos++; } $this->db->free($result); diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 558d793cc50..0a802475f01 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1047,7 +1047,6 @@ div.photoref { vertical-align:middle; text-align:center; } - img.photorefnoborder { padding: 2px; height: 48px; @@ -1060,7 +1059,10 @@ img.photorefnoborder { .underbanner { border-bottom: <?php echo $borderwith ?>px solid rgb(<?php echo $colortopbordertitle1 ?>); } - +.tdhrthin { + margin: 0; + padding-bottom: 0 !important; +} /* ============================================================================== */ /* Menu top et 1ere ligne tableau */ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index d855baeb966..df3e374b565 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1069,7 +1069,6 @@ div.photoref { vertical-align:middle; text-align:center; } - img.photorefnoborder { padding: 2px; height: 48px; @@ -1077,12 +1076,15 @@ img.photorefnoborder { object-fit: contain; border: 1px solid #CCC; } - .underrefbanner { } .underbanner { border-bottom: <?php echo $borderwith; ?>px solid rgb(<?php echo $colortopbordertitle1 ?>); } +.tdhrthin { + margin: 0; + padding-bottom: 0 !important; +} /* ============================================================================== */ -- GitLab