diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index 2e96a5451d4..64ac19fe1ad 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -334,7 +334,7 @@ if ($resql) print ''; print ''; - if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && max($db->jdate($objp->date_valid),$db->jdate($objp->date_livraison)) < ($now - $conf->commande->client->warning_delay)) + if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && max($db->jdate($objp->date_commande),$db->jdate($objp->date_livraison)) < ($now - $conf->commande->client->warning_delay)) print img_picto($langs->trans("Late"),"warning"); if(!empty($objp->note_private)) { diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 1c735d787b4..234dff307a6 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -172,11 +172,11 @@ if (strlen($search_phone)) } if (strlen($search_phoneper)) { - $sql .= " AND p.phone LIKE '%".$db->escape($search_phoneper)."%'"; + $sql .= " AND p.phone_perso LIKE '%".$db->escape($search_phoneper)."%'"; } if (strlen($search_phonepro)) { - $sql .= " AND p.phone_perso LIKE '%".$db->escape($search_phonepro)."%'"; + $sql .= " AND p.phone LIKE '%".$db->escape($search_phonepro)."%'"; } if (strlen($search_phonemob)) { diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 6f8c3bc1920..0a15fa1bdae 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -399,7 +399,7 @@ if (empty($action)) { $sql .= ' AND p.rowid='.$db->escape($search_ref); } - if (! empty($search_account)) + if (! empty($search_account) && $search_account > 0) { $sql .= ' AND b.fk_account='.$db->escape($search_account); } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 4457e627976..7fba7f50247 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -446,7 +446,7 @@ if (! defined('NOLOGIN')) $dol_authmode=$conf->authmode; // This properties is defined only when logged, to say what mode was successfully used $dol_tz=$_POST["tz"]; $dol_tz_string=$_POST["tz_string"]; - $dol_tz_string=preg_replace('/\s*\(.+\)/$','',$dol_tz_string); + $dol_tz_string=preg_replace('/\s*\(.+\)$/','',$dol_tz_string); $dol_tz_string=preg_replace('/,/','/',$dol_tz_string); $dol_tz_string=preg_replace('/\s/','_',$dol_tz_string); $dol_dst=0; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 7ceb6a8438c..d42262ffe4f 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -204,9 +204,9 @@ class Project extends CommonObject $sql.= ", fk_soc = " . ($this->socid > 0 ? $this->socid : "null"); $sql.= ", fk_statut = " . $this->statut; $sql.= ", public = " . ($this->public ? 1 : 0); - $sql.= ", datec=" . ($this->date_c != '' ? $this->db->idate($this->date_c) : 'null'); - $sql.= ", dateo=" . ($this->date_start != '' ? $this->db->idate($this->date_start) : 'null'); - $sql.= ", datee=" . ($this->date_end != '' ? $this->db->idate($this->date_end) : 'null'); + $sql.= ", datec=" . ($this->date_c != '' ? "'".$this->db->idate($this->date_c)."'" : 'null'); + $sql.= ", dateo=" . ($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : 'null'); + $sql.= ", datee=" . ($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : 'null'); $sql.= " WHERE rowid = " . $this->id; dol_syslog(get_class($this)."::Update sql=" . $sql, LOG_DEBUG); @@ -263,6 +263,7 @@ class Project extends CommonObject else { $this->error = $this->db->lasterror(); + $this->errors[] = $this->error; dol_syslog(get_class($this)."::Update error -2 " . $this->error, LOG_ERR); $result = -2; } @@ -513,10 +514,9 @@ class Project extends CommonObject $sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet_extrafields"; $sql.= " WHERE fk_object=" . $this->id; - dol_syslog(get_class($this) . "::delete sql=" . $sql, LOG_DEBUG); $resql = $this->db->query($sql); - if (!$resql) + if (! $resql) { $this->errors[] = $this->db->lasterror(); $error++; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index edc633a7fc8..62bbf9ae642 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -209,13 +209,13 @@ foreach ($listofreferent as $key => $value) $classname=$value['class']; $tablename=$value['table']; $qualified=$value['test']; - + if ($qualified) { print '
'; print_titre($langs->trans($title)); - + $selectList=$formproject->select_element($tablename,$project->societe->id); if (!$selectList || ($selectList<0)) {