Fixing style errors.
This commit is contained in:
parent
f05463b239
commit
50e5185297
@ -44,7 +44,7 @@ class Setup extends DolibarrApi
|
|||||||
global $db;
|
global $db;
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the list of ordering methods.
|
* Get the list of ordering methods.
|
||||||
*
|
*
|
||||||
@ -65,7 +65,7 @@ class Setup extends DolibarrApi
|
|||||||
public function getOrderingMethods($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
public function getOrderingMethods($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||||
{
|
{
|
||||||
$list = array();
|
$list = array();
|
||||||
|
|
||||||
$sql = "SELECT rowid, code, libelle as label, module";
|
$sql = "SELECT rowid, code, libelle as label, module";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_input_method as t";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_input_method as t";
|
||||||
$sql.= " WHERE t.active = ".$active;
|
$sql.= " WHERE t.active = ".$active;
|
||||||
@ -79,21 +79,21 @@ class Setup extends DolibarrApi
|
|||||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$sql.= $this->db->order($sortfield, $sortorder);
|
$sql.= $this->db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
if ($limit) {
|
if ($limit) {
|
||||||
if ($page < 0) {
|
if ($page < 0) {
|
||||||
$page = 0;
|
$page = 0;
|
||||||
}
|
}
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
|
|
||||||
$sql .= $this->db->plimit($limit, $offset);
|
$sql .= $this->db->plimit($limit, $offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$num = $this->db->num_rows($result);
|
$num = $this->db->num_rows($result);
|
||||||
$min = min($num, ($limit <= 0 ? $num : $limit));
|
$min = min($num, ($limit <= 0 ? $num : $limit));
|
||||||
@ -103,7 +103,7 @@ class Setup extends DolibarrApi
|
|||||||
} else {
|
} else {
|
||||||
throw new RestException(400, $this->db->lasterror());
|
throw new RestException(400, $this->db->lasterror());
|
||||||
}
|
}
|
||||||
|
|
||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user