[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: phpgwapi/inc class.categories.inc.php,1.109,1.11
From: |
Bettina Gille <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: phpgwapi/inc class.categories.inc.php,1.109,1.110 |
Date: |
Tue, 17 Jun 2003 09:23:44 -0400 |
Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv4758
Modified Files:
class.categories.inc.php
Log Message:
fix
Index: class.categories.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.categories.inc.php,v
retrieving revision 1.109
retrieving revision 1.110
diff -C2 -r1.109 -r1.110
*** class.categories.inc.php 21 May 2003 22:59:21 -0000 1.109
--- class.categories.inc.php 17 Jun 2003 13:23:42 -0000 1.110
***************
*** 535,542 ****
function add($values)
{
! if ($values['parent'] && $values['parent'] != 0)
{
! $values['main'] =
intval($this->id2item(array('cat_id' => $values['parent'],'item' => 'main')));
! $values['level'] =
intval($this->id2item(array('cat_id' => $values['parent'],'item' =>
'level'))+1);
}
--- 535,545 ----
function add($values)
{
! $values['cat_id'] = intval($values['cat_id']);
! $values['parent'] = intval($values['parent']);
!
! if ($values['parent'] > 0)
{
! $values['main'] =
$this->id2item(array('cat_id' => $values['parent'],'item' => 'main'));
! $values['level'] =
$this->id2item(array('cat_id' => $values['parent'],'item' => 'level'))+1;
}
***************
*** 544,548 ****
$values['name'] =
$this->db->db_addslashes($values['name']);
! if (isset($values['cat_id']))
{
$id_col = 'cat_id,';
--- 547,551 ----
$values['name'] =
$this->db->db_addslashes($values['name']);
! if ($values['cat_id'] > 0)
{
$id_col = 'cat_id,';
***************
*** 550,562 ****
}
$this->db->query("INSERT INTO phpgw_categories
(${id_col}cat_parent,cat_owner,cat_access,cat_appname,cat_name,cat_description,cat_data,"
! . "cat_main,cat_level,last_mod) VALUES
($id_val" . intval($values['parent']) . "," . $this->account_id . ",'" .
$values['access']
. "','" . $this->app_name . "','" .
$values['name'] . "','" . $values['descr'] . "','" . $values['data']
! . "'," . $values['main'] . "," .
$values['level'] . "," . time() . ")",__LINE__,__FILE__);
$max =
$this->db->get_last_insert_id('phpgw_categories','cat_id');
!
! if (!$values['parent'] || $values['parent'] == 0)
{
! $this->db->query("UPDATE phpgw_categories SET
cat_main=" . $max . " WHERE cat_id=" . $max,__LINE__,__FILE__);
}
return $max;
--- 553,565 ----
}
$this->db->query("INSERT INTO phpgw_categories
(${id_col}cat_parent,cat_owner,cat_access,cat_appname,cat_name,cat_description,cat_data,"
! . 'cat_main,cat_level,last_mod) VALUES (' .
$id_val . $values['parent'] . ',' . $this->account_id . ",'" . $values['access']
. "','" . $this->app_name . "','" .
$values['name'] . "','" . $values['descr'] . "','" . $values['data']
! . "'," . intval($values['main']) . ',' .
intval($values['level']) . ',' . time() . ')',__LINE__,__FILE__);
$max =
$this->db->get_last_insert_id('phpgw_categories','cat_id');
! $max = intval($max);
! if ($values['parent'] == 0)
{
! $this->db->query('UPDATE phpgw_categories SET
cat_main=' . $max . ' WHERE cat_id=' . $max,__LINE__,__FILE__);
}
return $max;
***************
*** 695,698 ****
--- 698,704 ----
function edit($values)
{
+ $values['cat_id'] = intval($values['id']);
+ $values['parent'] = intval($values['parent']);
+
if (isset($values['old_parent']) &&
$values['old_parent'] != $values['parent'])
{
***************
*** 704,708 ****
if (!isset($values['main']) || !isset($values['level']))
{
! if ($values['parent'] && ($values['parent'] !=
0))
{
$values['main'] =
intval($this->id2item(array('cat_id' => $values['parent'],'item' => 'main')));
--- 710,714 ----
if (!isset($values['main']) || !isset($values['level']))
{
! if ($values['parent'] > 0)
{
$values['main'] =
intval($this->id2item(array('cat_id' => $values['parent'],'item' => 'main')));
***************
*** 711,716 ****
else
{
! $values['main'] =
intval($values['cat_id']);
! $values['parent'] =
$values['level'] = 0; // parent need to be set to 0, as it can be ''
}
}
--- 717,722 ----
else
{
! $values['main'] =
$values['cat_id'];
! $values['level'] = 0;
}
}
***************
*** 720,728 ****
$sql = "UPDATE phpgw_categories SET cat_name='" .
$values['name'] . "', cat_description='" . $values['descr']
! . "', cat_data='" . $values['data'] .
"', cat_parent=" . intval($values['parent']) . ", cat_access='"
! . $values['access'] . "', cat_main=" .
$values['main'] . ", cat_level=" . $values['level'] . ", last_mod=" . time()
! . " WHERE cat_appname='" .
$this->app_name . "' AND cat_id=" . intval($values['cat_id']);
$this->db->query($sql,__LINE__,__FILE__);
! return intval($values['cat_id']);
}
--- 726,734 ----
$sql = "UPDATE phpgw_categories SET cat_name='" .
$values['name'] . "', cat_description='" . $values['descr']
! . "', cat_data='" . $values['data'] .
"', cat_parent=" . $values['parent'] . ", cat_access='"
! . $values['access'] . "', cat_main=" .
$values['main'] . ', cat_level=' . $values['level'] . ', last_mod=' . time()
! . " WHERE cat_appname='" .
$this->app_name . "' AND cat_id=" . $values['cat_id'];
$this->db->query($sql,__LINE__,__FILE__);
! return $values['cat_id'];
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: phpgwapi/inc class.categories.inc.php,1.109,1.110,
Bettina Gille <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: projects/inc class.bodeliveries.inc.php,1.16,1.17 class.boprojecthours.inc.php,1.9,1.10class.boprojects.inc.php,1.50,1.51 class.sobilling.inc.php,1.13,1.14class.sodeliveries.inc.php,1.17,1.18 class.soprojecthours.inc.php,1.9,1.10class.soprojects.inc.php,1.41,1.42 class.sostatistics.inc.php,1.8,1.9class.uibilling.inc.php,1.29,1.30 class.uideliveries.inc.php,1.29,1.30class.uiprojecthours.inc.php,1.30,1.31 class.uiprojects.inc.php,1.63,1.64class.uistatistics.inc.php,1.17,1.18 hook_add_def_pref.inc.php,1.4,1.5hook_deleteaccount.inc.php,1.3,1.4
- Next by Date:
[Phpgroupware-cvs] CVS: phpgroupware login.php,1.96,1.97
- Previous by thread:
[Phpgroupware-cvs] CVS: projects/inc class.bodeliveries.inc.php,1.16,1.17 class.boprojecthours.inc.php,1.9,1.10class.boprojects.inc.php,1.50,1.51 class.sobilling.inc.php,1.13,1.14class.sodeliveries.inc.php,1.17,1.18 class.soprojecthours.inc.php,1.9,1.10class.soprojects.inc.php,1.41,1.42 class.sostatistics.inc.php,1.8,1.9class.uibilling.inc.php,1.29,1.30 class.uideliveries.inc.php,1.29,1.30class.uiprojecthours.inc.php,1.30,1.31 class.uiprojects.inc.php,1.63,1.64class.uistatistics.inc.php,1.17,1.18 hook_add_def_pref.inc.php,1.4,1.5hook_deleteaccount.inc.php,1.3,1.4
- Next by thread:
[Phpgroupware-cvs] CVS: phpgroupware login.php,1.96,1.97
- Index(es):