Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.6
This commit is contained in:
commit
bdaf83a653
@ -65,13 +65,15 @@ abstract class CommonObject
|
|||||||
*/
|
*/
|
||||||
static function isExistingObject($element, $id, $ref='', $ref_ext='')
|
static function isExistingObject($element, $id, $ref='', $ref_ext='')
|
||||||
{
|
{
|
||||||
global $db;
|
global $db,$conf;
|
||||||
|
|
||||||
$sql = "SELECT rowid, ref, ref_ext";
|
$sql = "SELECT rowid, ref, ref_ext";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$element;
|
$sql.= " FROM ".MAIN_DB_PREFIX.$element;
|
||||||
if ($id > 0) $sql.= " WHERE rowid = ".$db->escape($id);
|
$sql.= " WHERE entity IN (".getEntity($element).")" ;
|
||||||
else if ($ref) $sql.= " WHERE ref = '".$db->escape($ref)."'";
|
|
||||||
else if ($ref_ext) $sql.= " WHERE ref_ext = '".$db->escape($ref_ext)."'";
|
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)."'";
|
||||||
else {
|
else {
|
||||||
$error='ErrorWrongParameters';
|
$error='ErrorWrongParameters';
|
||||||
dol_print_error(get_class()."::isExistingObject ".$error, LOG_ERR);
|
dol_print_error(get_class()."::isExistingObject ".$error, LOG_ERR);
|
||||||
|
|||||||
@ -190,7 +190,7 @@ if ($resql)
|
|||||||
$texte.=' ('.$langs->trans("Stocks").')';
|
$texte.=' ('.$langs->trans("Stocks").')';
|
||||||
|
|
||||||
|
|
||||||
llxHeader("",$title,$helpurl,$texte);
|
llxHeader("",$texte,$helpurl);
|
||||||
|
|
||||||
if ($sref || $snom || $sall || GETPOST('search'))
|
if ($sref || $snom || $sall || GETPOST('search'))
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user