mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-27 13:22:06 +02:00
update function exists
This commit is contained in:
parent
6cd1089ca6
commit
d5343aee16
@ -317,25 +317,25 @@
|
|||||||
@param $cat_name category name
|
@param $cat_name category name
|
||||||
@result boolean true or false
|
@result boolean true or false
|
||||||
*/
|
*/
|
||||||
function exists($type,$cat_name,$cat_id)
|
function exists($type,$cat_name = '',$cat_id = '')
|
||||||
{
|
{
|
||||||
$filter = $this->filter($type);
|
$filter = $this->filter($type);
|
||||||
|
|
||||||
if ($cat_name)
|
if ($cat_name)
|
||||||
{
|
{
|
||||||
$cat_exists = " cat_name='" . addslashes($cat_name) . "' ";
|
$cat_exists = " AND cat_name='" . addslashes($cat_name) . "' ";
|
||||||
}
|
}
|
||||||
if ($cat_id)
|
if ($cat_id)
|
||||||
{
|
{
|
||||||
$cat_exists = " cat_parent='$cat_id' ";
|
$cat_exists = " AND cat_parent='$cat_id' ";
|
||||||
}
|
}
|
||||||
if ($cat_name && $cat_id)
|
if ($cat_name && $cat_id)
|
||||||
{
|
{
|
||||||
$cat_exists = " cat_name='" . addslashes($cat_name) . "' and cat_id != '$cat_id' ";
|
$cat_exists = " AND cat_name='" . addslashes($cat_name) . "' AND cat_id != '$cat_id' ";
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->db->query("select count(*) from phpgw_categories where $cat_exists and cat_appname='"
|
$this->db->query("select count(*) from phpgw_categories where cat_appname='"
|
||||||
. $this->app_name . "' $filter",__LINE__,__FILE__);
|
. $this->app_name . "' $cat_exists $filter",__LINE__,__FILE__);
|
||||||
|
|
||||||
$this->db->next_record();
|
$this->db->next_record();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user