From cf857b712ab38ad19d51fc9a0112b85319136c78 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 14 Jun 2015 12:29:47 +0200 Subject: [PATCH 1/2] Fix: select date problem with mobile device (#3039) --- htdocs/compta/bank/virement.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/virement.php b/htdocs/compta/bank/virement.php index 9bf4fd9ea2e..66a61850ee8 100644 --- a/htdocs/compta/bank/virement.php +++ b/htdocs/compta/bank/virement.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur - * Copytight (C) 2005-2009 Regis Houssin + * Copytight (C) 2005-2015 Regis Houssin * Copytight (C) 2012 Juanjo Menent * Copyright (C) 2015 Marcos GarcĂ­a * @@ -180,7 +180,7 @@ print $form->select_comptes($account_to,'account_to',0,'',1); print "\n"; print ""; -$form->select_date($dateo,'','','','','add'); +$form->select_date((! empty($dateo)?$dateo:''),'','','','','add'); print "\n"; print ''; print ''; From 9e7cb70d63a5fcdcb9b073ec011f3b4af8b12c09 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 8 Jul 2015 16:03:15 +0200 Subject: [PATCH 2/2] Fix: missing shared parameters --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 03d044a2ee6..7111b2387bd 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -69,8 +69,8 @@ abstract class CommonObject $sql = "SELECT rowid, ref, ref_ext"; $sql.= " FROM ".MAIN_DB_PREFIX.$element; - $sql.= " WHERE entity IN (".getEntity($element).")" ; - + $sql.= " WHERE entity IN (".getEntity($element, true).")" ; + if ($id > 0) $sql.= " AND rowid = ".$db->escape($id); else if ($ref) $sql.= " AND ref = '".$db->escape($ref)."'"; else if ($ref_ext) $sql.= " AND ref_ext = '".$db->escape($ref_ext)."'";