- removed forgotten break

- restored feature 'delete person'
This commit is contained in:
Andreas Moik
2016-11-23 16:26:58 +01:00
parent c33871ec2d
commit c4ed2d05f1
2 changed files with 49 additions and 2 deletions
+1 -2
View File
@@ -837,7 +837,6 @@ class MessageLib
{
$this->ci->db->trans_rollback();
$result = $this->_error($result->msg, EXIT_ERROR);
break;
}
else
{
@@ -863,4 +862,4 @@ class MessageLib
{
return success($retval, $code, MessageLib::MSG_INDX_PREFIX);
}
}
}
+48
View File
@@ -1149,6 +1149,33 @@ function casDeletePerson($db, $person_id, $trans=true)
$error = true;
}
if(!$error)
{
$qry = '
DELETE FROM public.tbl_msg_recipient
WHERE message_id IN (SELECT message_id FROM tbl_msg_message WHERE person_id='.$db->db_add_param($person_id, FHC_INTEGER) . ')';
if(!$db->db_query($qry))
$error = true;
}
if(!$error)
{
$qry = '
DELETE FROM public.tbl_msg_status
WHERE message_id IN (SELECT message_id FROM tbl_msg_message WHERE person_id='.$db->db_add_param($person_id, FHC_INTEGER) . ')';
if(!$db->db_query($qry))
$error = true;
}
if(!$error)
{
$qry = '
DELETE FROM public.tbl_msg_message
WHERE person_id='.$db->db_add_param($person_id, FHC_INTEGER);
if(!$db->db_query($qry))
$error = true;
}
if(!$error)
{
$qry = '
@@ -1158,6 +1185,27 @@ function casDeletePerson($db, $person_id, $trans=true)
$error = true;
}
if(!$error)
{
$tqry = "SELECT 1
FROM INFORMATION_SCHEMA.TABLES
WHERE table_type='BASE TABLE'
AND table_schema='addon'
AND table_name='tbl_lvinfostatus_zuordnung';";
if(!$result = $db->db_query($tqry))
$error = true;
if($db->db_num_rows($result))
{
$qry = '
DELETE FROM addon.tbl_lvinfostatus_zuordnung
WHERE uid IN (SELECT uid FROM public.tbl_benutzer WHERE person_id='.$db->db_add_param($person_id, FHC_INTEGER).')';
if(!$db->db_query($qry))
$error = true;
}
}
if(!$error)
{
$tqry = "SELECT 1