mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 08:34:42 +01:00
infolog now explicitly asks to deleted sub-entries and allows not to delete them
This commit is contained in:
parent
2e6114f9ce
commit
d4952f1a2b
@ -191,11 +191,11 @@
|
||||
return $err ? False : $data;
|
||||
}
|
||||
|
||||
function delete($info_id)
|
||||
function delete($info_id,$delete_children,$new_parent)
|
||||
{
|
||||
$this->link->unlink(0,'infolog',$info_id);
|
||||
|
||||
$this->so->delete($info_id);
|
||||
$this->so->delete($info_id,$delete_children,$new_parent);
|
||||
}
|
||||
|
||||
function write($values,$check_defaults=True,$touch_modified=True)
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - InfoLog *
|
||||
* http://www.phpgroupware.org *
|
||||
* eGroupWare - InfoLog *
|
||||
* http://www.eGroupWare.org *
|
||||
* Written by Ralf Becker <RalfBecker@outdoor-training.de> *
|
||||
* originaly based on todo written by Joseph Engo <jengo@phpgroupware.org> *
|
||||
* -------------------------------------------- *
|
||||
@ -284,11 +284,13 @@
|
||||
@function delete
|
||||
@abstract delete InfoLog entry $info_id AND the links to it
|
||||
@syntax delete( $info_id )
|
||||
@param $info_id id of log-entry
|
||||
@param int $delete_children delete the children, if not set there parent-id to 0
|
||||
@param int $info_id id of log-entry
|
||||
@param bool $delete_children delete the children, if not set there parent-id to $new_parent
|
||||
@param int new_parent new parent-id to set for subs
|
||||
*/
|
||||
function delete($info_id,$delete_children=True) // did _not_ ensure ACL
|
||||
function delete($info_id,$delete_children=True,$new_parent=0) // did _not_ ensure ACL
|
||||
{
|
||||
//echo "<p>soinfolog::delete($info_id,'$delete_children',$new_parent)</p>\n";
|
||||
if (($info_id = intval($info_id)) <= 0)
|
||||
{
|
||||
return;
|
||||
@ -311,8 +313,9 @@
|
||||
$this->delete($db2->f(0),$delete_children);
|
||||
}
|
||||
}
|
||||
// set parent_id to 0 for all not deleted children
|
||||
$this->db->query("UPDATE phpgw_infolog SET info_id_parent=0 WHERE info_id_parent=$info_id",__LINE__,__FILE__);
|
||||
// set parent_id to $new_parent for all not deleted children
|
||||
$new_parent = intval($new_parent);
|
||||
$this->db->query("UPDATE phpgw_infolog SET info_id_parent=$new_parent WHERE info_id_parent=$info_id",__LINE__,__FILE__);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -274,7 +274,7 @@
|
||||
{
|
||||
if ($values['delete'] && $info_id > 0 && $this->bo->check_access($info_id,PHPGW_ACL_DELETE))
|
||||
{
|
||||
$this->bo->delete($info_id);
|
||||
$this->bo->delete($info_id,$values['remove_subs'],$values['info_id_parent']);
|
||||
}
|
||||
return $referer ? $this->tmpl->location($referer) : $this->index();
|
||||
}
|
||||
@ -284,8 +284,10 @@
|
||||
$this->tmpl->read('infolog.delete');
|
||||
|
||||
$values['main']['no_actions'] = True;
|
||||
$values['remove_subs'] = $this->bo->anzSubs($info_id) > 0;
|
||||
$persist['info_id'] = $info_id;
|
||||
$persist['referer'] = $referer;
|
||||
$persist['info_id_parent'] = $values['main'][1]['info_id_parent'];
|
||||
|
||||
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('InfoLog').' - '.lang('Delete');
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -73,6 +73,7 @@ default filter for infolog infolog de Standard-Filter f
|
||||
default status for a new log entry infolog de Vorgabe für den Status eines neuen Eintrags
|
||||
delegation infolog de Delegation
|
||||
delete infolog de Löschen
|
||||
delete all subs (if not subs will be subs of this enties parent or have no parent) infolog de Alle Untereinträge löschen (wenn nicht werden diese Untereinträge des übergeordneten Eintrags oder sind keine Untereinträge mehr)
|
||||
delete the entry infolog de Eintrag löschen
|
||||
delete this entry infolog de diesen Eintrag löschen
|
||||
deletes the selected typ infolog de löscht den ausgewählten Typ
|
||||
|
@ -73,6 +73,7 @@ default filter for infolog infolog en Default Filter for InfoLog
|
||||
default status for a new log entry infolog en default status for a new log entry
|
||||
delegation infolog en Delegation
|
||||
delete infolog en Delete
|
||||
delete all subs (if not subs will be subs of this enties parent or have no parent) infolog en Delete all subs (if not subs will be subs of this enties parent or have no parent)
|
||||
delete the entry infolog en Delete the entry
|
||||
delete this entry infolog en delete this entry
|
||||
deletes the selected typ infolog en deletes the selected type
|
||||
|
Loading…
Reference in New Issue
Block a user