mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 16:03:47 +01:00
Added name2id() and id2name() functions
This commit is contained in:
parent
371b4bd374
commit
665e72f75a
@ -303,13 +303,17 @@
|
|||||||
. "$cat_data', cat_parent='$cat_parent', cat_access='$cat_access' where cat_appname='"
|
. "$cat_data', cat_parent='$cat_parent', cat_access='$cat_access' where cat_appname='"
|
||||||
. $this->app_name . "' and cat_id='$cat_id'",__LINE__,__FILE__);
|
. $this->app_name . "' and cat_id='$cat_id'",__LINE__,__FILE__);
|
||||||
}
|
}
|
||||||
/*!
|
|
||||||
@function return_name
|
function name2id($cat_name)
|
||||||
@abstract return category name given $cat_id
|
{
|
||||||
@param $cat_id
|
$this->db->query("select cat_id from phpgw_categories where cat_name='"
|
||||||
@result cat_name category name
|
. "$cat_name'",__LINE__,__FILE__);
|
||||||
*/
|
$this->db->next_record();
|
||||||
function return_name($cat_id)
|
|
||||||
|
return $this->db->f('cat_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
function id2name($cat_id)
|
||||||
{
|
{
|
||||||
$this->db->query("select cat_name from phpgw_categories where cat_id='"
|
$this->db->query("select cat_name from phpgw_categories where cat_id='"
|
||||||
. "$cat_id'",__LINE__,__FILE__);
|
. "$cat_id'",__LINE__,__FILE__);
|
||||||
@ -322,8 +326,21 @@
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
return '--';
|
return '--';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
@function return_name
|
||||||
|
@abstract return category name given $cat_id
|
||||||
|
@param $cat_id
|
||||||
|
@result cat_name category name
|
||||||
|
*/
|
||||||
|
// NOTE: This is only a temp wrapper, use id2name() to keep things matching across the board. (jengo)
|
||||||
|
function return_name($cat_id)
|
||||||
|
{
|
||||||
|
return $this->id2name($cat_id);
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@function exists
|
@function exists
|
||||||
@abstract used for checking if a category name exists
|
@abstract used for checking if a category name exists
|
||||||
|
Loading…
Reference in New Issue
Block a user