From 281eaf2987df657006059d1d24acf73fda0a1607 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 3 Dec 2015 10:27:23 +0100 Subject: [PATCH 1/4] FIX : Use "WHERE true" instead of "WHERE 1" #4132 --- htdocs/core/class/extrafields.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 5d04b9c9317..8df0e0fcbc2 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -818,7 +818,7 @@ class ExtraFields } else { - $sqlwhere.= ' WHERE 1'; + $sqlwhere.= ' WHERE 1=1'; } if (in_array($InfoFieldList[0],array('tablewithentity'))) $sqlwhere.= ' AND entity = '.$conf->entity; // Some tables may have field, some other not. For the moment we disable it. $sql.=$sqlwhere; From b4160c7f81536d2f91afbfca528eac6f49017355 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 3 Dec 2015 10:58:06 +0100 Subject: [PATCH 2/4] Cannot change the date of a contract #4088 --- htdocs/comm/card.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index a9164676716..7b2cee3b91d 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -762,7 +762,7 @@ if ($id > 0) { $contratstatic=new Contrat($db); - $sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut, c.datec as dc"; + $sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut, c.datec as dc, c.date_contrat as dcon"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; $sql.= " WHERE c.fk_soc = s.rowid "; $sql.= " AND s.rowid = ".$object->id; @@ -779,7 +779,7 @@ if ($id > 0) print ''; print ''; - print '
'; + print ''; print ''; } @@ -797,6 +797,7 @@ if ($id > 0) print $contrat->getNomUrl(1,12); print "\n"; print '\n"; + print '\n"; print ''; print '
'.$langs->trans("LastContracts",($num<=$MAXLIST?"":$MAXLIST)).''; print '
'.$langs->trans("LastContracts",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllContracts").' '.$num.'
'.dol_print_date($db->jdate($objp->dc),'day')."'.dol_print_date($db->jdate($objp->dcon),'day')." '; $contrat->fetch_lines(); From ee08c4afc4ee134683638fbc2e8c11b401850f03 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 3 Dec 2015 11:03:40 +0100 Subject: [PATCH 3/4] Display the ref_supplier inside the contract list of /comm/card.php #4090 --- htdocs/comm/card.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 7b2cee3b91d..e5615aa66ba 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -762,7 +762,7 @@ if ($id > 0) { $contratstatic=new Contrat($db); - $sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut, c.datec as dc, c.date_contrat as dcon"; + $sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut, c.datec as dc, c.date_contrat as dcon, c.ref_supplier as refsup"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; $sql.= " WHERE c.fk_soc = s.rowid "; $sql.= " AND s.rowid = ".$object->id; @@ -779,7 +779,7 @@ if ($id > 0) print ''; print ''; - print '
'; + print ''; print ''; } @@ -796,6 +796,7 @@ if ($id > 0) $contrat->ref=$objp->ref?$objp->ref:$objp->id; print $contrat->getNomUrl(1,12); print "\n"; + print '\n"; print '\n"; print '\n"; print ''; From 10a925f7b4f0625b8c1353c44140588ee4794f47 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 3 Dec 2015 11:52:41 +0100 Subject: [PATCH 4/4] FIX: WHERE 1=1 --- htdocs/core/class/extrafields.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 8df0e0fcbc2..5f3caf18369 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -986,7 +986,7 @@ class ExtraFields $sqlwhere .= ' WHERE ' . $InfoFieldList[4]; } } else { - $sqlwhere .= ' WHERE 1'; + $sqlwhere .= ' WHERE 1=1'; } if (in_array($InfoFieldList[0], array ( 'tablewithentity'
'.$langs->trans("LastContracts",($num<=$MAXLIST?"":$MAXLIST)).''; print '
'.$langs->trans("LastContracts",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllContracts").' '.$num.'
'.dol_trunc($objp->refsup,12)."'.dol_print_date($db->jdate($objp->dc),'day')."'.dol_print_date($db->jdate($objp->dcon),'day')."