From 8542a4fd288233037961cb80a9318476005e4768 Mon Sep 17 00:00:00 2001 From: fhenry Date: Fri, 10 May 2013 16:34:14 +0200 Subject: [PATCH 1/8] Fix date extrafield message old datetimeformat use message in log --- htdocs/comm/propal.php | 2 +- htdocs/commande/fiche.php | 2 +- htdocs/compta/facture.php | 2 +- htdocs/core/class/commonobject.class.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 0c95d919d2f..821d1dd98b0 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1857,7 +1857,7 @@ else // Convert date into timestamp format if (in_array($extrafields->attribute_type[$key],array('date','datetime'))) { - $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$object->array_options['options_'.$key]; + $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]); } if ($action == 'edit_extras' && $user->rights->propal->creer) diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index a7d04670961..816df65ea85 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -2158,7 +2158,7 @@ else // Convert date into timestamp format if (in_array($extrafields->attribute_type[$key],array('date','datetime'))) { - $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$object->array_options['options_'.$key]; + $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]); } if ($action == 'edit_extras' && $user->rights->commande->creer) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 1d6909874b1..82205be3e7b 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3304,7 +3304,7 @@ else if ($id > 0 || ! empty($ref)) // Convert date into timestamp format if (in_array($extrafields->attribute_type[$key],array('date','datetime'))) { - $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$object->array_options['options_'.$key]; + $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]); } if ($action == 'edit_extras' && $user->rights->facture->creer) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b5dee2a3c76..e266062821d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2236,7 +2236,7 @@ abstract class CommonObject // Convert date into timestamp format if (in_array($extrafields->attribute_type[$key],array('date','datetime'))) { - $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$this->array_options['options_'.$key]; + $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$this->db->jdate($this->array_options['options_'.$key]); } $out .= ''.$label.''; $out .=''; From 3a05d6c641fdb197778ecf2ae4cb7aec076ed9ba Mon Sep 17 00:00:00 2001 From: fhenry Date: Fri, 10 May 2013 17:50:14 +0200 Subject: [PATCH 2/8] Remove warning if FetchObjectLinked call --- htdocs/core/class/commonobject.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e266062821d..fe58e17ae01 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -44,6 +44,9 @@ abstract class CommonObject public $civility_id; public $array_options=array(); + + public $linkedObjectsIds; + public $linkedObjects; // No constructor as it is an abstract class From 4bb6bd86974d065177fbf4f4986437e155e00729 Mon Sep 17 00:00:00 2001 From: fhenry Date: Fri, 10 May 2013 18:23:13 +0200 Subject: [PATCH 3/8] Order result fetchObjectLinked by sourcetype --- htdocs/core/class/commonobject.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index fe58e17ae01..f27f5b6a516 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1711,6 +1711,7 @@ abstract class CommonObject $sql.= "(fk_source = '".$sourceid."' AND sourcetype = '".$sourcetype."')"; $sql.= " ".$clause." (fk_target = '".$targetid."' AND targettype = '".$targettype."')"; } + $sql = ' ORDER BY sourcetype'; //print $sql; dol_syslog(get_class($this)."::fetchObjectLink sql=".$sql); From 0d13b8d194c849cf5f5611c8c466d54f676aea9c Mon Sep 17 00:00:00 2001 From: fhenry Date: Fri, 10 May 2013 18:35:19 +0200 Subject: [PATCH 4/8] Fix previous bug --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f27f5b6a516..49ee3f471cd 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1711,7 +1711,7 @@ abstract class CommonObject $sql.= "(fk_source = '".$sourceid."' AND sourcetype = '".$sourcetype."')"; $sql.= " ".$clause." (fk_target = '".$targetid."' AND targettype = '".$targettype."')"; } - $sql = ' ORDER BY sourcetype'; + $sql .= ' ORDER BY sourcetype'; //print $sql; dol_syslog(get_class($this)."::fetchObjectLink sql=".$sql); From 1a7a8817be8d0a0d6562e4688c0356ce20280ce5 Mon Sep 17 00:00:00 2001 From: fhenry Date: Fri, 10 May 2013 18:40:19 +0200 Subject: [PATCH 5/8] Update wrong comment --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 49ee3f471cd..e283c977f5f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1652,7 +1652,7 @@ abstract class CommonObject } /** - * Fetch array of objects linked to current object. Links are loaded into this->linked_object array. + * Fetch array of objects linked to current object. Links are loaded into this->linkedObjects array. * * @param int $sourceid Object source id * @param string $sourcetype Object source type From 111fc3153bd04b957e40e30d11770c5ad5631bc6 Mon Sep 17 00:00:00 2001 From: fhenry Date: Sun, 12 May 2013 15:45:23 +0200 Subject: [PATCH 6/8] Fix Extrafield selllist bug in PgSQL --- 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 17226e7d461..6c6a9de1e99 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -825,7 +825,7 @@ class ExtraFields $sql = 'SELECT '.$InfoFieldList[1]; $sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[0]; - $sql.= ' WHERE '.$keyList.'="'.$this->db->escape($value).'"'; + $sql.= ' WHERE '.$keyList.'=\''.$this->db->escape($value).'\''; //$sql.= ' AND entity = '.$conf->entity; dol_syslog(get_class($this).':showOutputField:$type=sellist sql='.$sql); $resql = $this->db->query($sql); From a78b3149fe1eb0463f7984f54618fda050af709e Mon Sep 17 00:00:00 2001 From: fhenry Date: Sun, 12 May 2013 17:15:45 +0200 Subject: [PATCH 7/8] Remove debug lines --- htdocs/societe/note.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php index 8fbd6c6187f..372177c0c89 100644 --- a/htdocs/societe/note.php +++ b/htdocs/societe/note.php @@ -25,10 +25,6 @@ * \ingroup societe */ -error_reporting(E_ALL); -ini_set('display_errors', true); -ini_set('html_errors', false); - require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; From 757c22a204410c49b5996202cc0130bdf45e670f Mon Sep 17 00:00:00 2001 From: fhenry Date: Sun, 12 May 2013 17:54:30 +0200 Subject: [PATCH 8/8] Fix bug intervention numbering on validation --- htdocs/fichinter/class/fichinter.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index b2c4884cf3e..a748ef0f549 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -372,7 +372,7 @@ class Fichinter extends CommonObject // Define new ref if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref))) { - $num = $this->getNextNumRef($soc); + $num = $this->getNextNumRef($this->thirdparty); } else {