diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 09bc17792c0..1ad89847ea8 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1858,7 +1858,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..e283c977f5f 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 @@ -1649,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 @@ -1708,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); @@ -2236,7 +2240,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 .=''; 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); 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 { 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';