mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-29 19:33:54 +01:00
All group activities are working
This commit is contained in:
parent
45522f2a0f
commit
0a1494dde1
@ -12,60 +12,60 @@
|
|||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
$phpgw_info = array();
|
$phpgw_info = array();
|
||||||
$phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True, "currentapp" => "admin");
|
$phpgw_info['flags'] = array('noheader' => True, 'nonavbar' => True, 'currentapp' => 'admin');
|
||||||
|
|
||||||
if (! $group_id) {
|
if (! $group_id) {
|
||||||
Header("Location: " . $phpgw->link("groups.php"));
|
Header('Location: ' . $phpgw->link('groups.php'));
|
||||||
}
|
}
|
||||||
include("../header.inc.php");
|
include('../header.inc.php');
|
||||||
$p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('admin'));
|
$p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('admin'));
|
||||||
$p->set_file(array("body" => "delete_common.tpl"));
|
$p->set_file(array('body' => 'delete_common.tpl',
|
||||||
|
'message_row' => 'message_row.tpl'));
|
||||||
|
|
||||||
if ((($group_id) && ($confirm)) || $removeusers) {
|
if ((($group_id) && ($confirm)) || $removeusers) {
|
||||||
if ($removeusers) {
|
if ($removeusers) {
|
||||||
$old_group_list = $phpgw->acl->get_ids_for_location("$group_id",1,"phpgw_group","u");
|
$old_group_list = $phpgw->acl->get_ids_for_location(intval($group_id),1,'phpgw_group');
|
||||||
@reset($old_group_list);
|
@reset($old_group_list);
|
||||||
while($old_group_list && $id = each($old_group_list)) {
|
while($old_group_list && $id = each($old_group_list)) {
|
||||||
$phpgw->acl->delete("phpgw_group","$group_id",intval($id[1]),"u");
|
$phpgw->acl->delete_repository('phpgw_group',$group_id,intval($id[1]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$phpgw->db->query("select group_name from groups where group_id=$group_id",__LINE__,__FILE__);
|
$group_name = $phpgw->accounts->id2name($group_id);
|
||||||
$phpgw->db->next_record();
|
|
||||||
|
|
||||||
$group_name = $phpgw->db->f("group_name");
|
$old_group_list = $phpgw->acl->get_ids_for_location(intval($group_id),1,'phpgw_group');
|
||||||
|
|
||||||
$old_group_list = $phpgw->acl->get_ids_for_location("$group_id",1,"phpgw_group","u");
|
|
||||||
if ($old_group_list) {
|
if ($old_group_list) {
|
||||||
$phpgw->common->phpgw_header();
|
$phpgw->common->phpgw_header();
|
||||||
echo parse_navbar();
|
echo parse_navbar();
|
||||||
|
|
||||||
echo '<p><center>';
|
$p->set_var('message_display','<tr><td>'
|
||||||
echo lang("Sorry, the follow users are still a member of the group x",$group_name)
|
. lang('Sorry, the follow users are still a member of the group x',$group_name)
|
||||||
. '<br>' . lang("They must be removed before you can continue")
|
. '<br>' . lang('They must be removed before you can continue') . '</td></td>');
|
||||||
. '</td></tr>';
|
$p->parse('messages','message_row',True);
|
||||||
|
|
||||||
echo '<table border="0"><tr><td>';
|
$p->set_var('message_display','<tr><td><table border="0">');
|
||||||
|
$p->parse('messages','message_row',True);
|
||||||
|
|
||||||
while (list(,$id) = each($old_group_list)) {
|
while (list(,$id) = each($old_group_list)) {
|
||||||
echo '<tr><td><a href="' . $phpgw->link("editaccount.php","account_=" . $id) . '">' . $phpgw->common->grab_owner_name($id) . '</a></tr></td>';
|
$p->set_var('message_display','<tr><td><a href="' . $phpgw->link('editaccount.php','account_=' . $id) . '">' . $phpgw->common->grab_owner_name($id) . '</a></tr></td>');
|
||||||
|
$p->parse('messages','message_row',True);
|
||||||
}
|
}
|
||||||
echo "</table></center>";
|
$p->set_var('message_display','</table></center></td></tr><tr><td>'
|
||||||
echo "<a href=\"" . $phpgw->link("deletegroup.php","group_id=" . $group_id . "&removeusers=True")
|
. '<a href="' . $phpgw->link('deletegroup.php','group_id=' . $group_id . '&removeusers=True')
|
||||||
. "\">" . lang("Remove all users from this group") . "</a>";
|
. '">' . lang('Remove all users from this group') . '</a></td></tr>');
|
||||||
|
$p->parse('messages','message_row',True);
|
||||||
|
$p->set_var('yes','');
|
||||||
|
$p->set_var('no','');
|
||||||
|
$p->pparse('out','body');
|
||||||
$phpgw->common->phpgw_exit();
|
$phpgw->common->phpgw_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($confirm) {
|
if ($confirm) {
|
||||||
$phpgw->db->query("select group_name from groups where group_id=$group_id",__LINE__,__FILE__);
|
$phpgw->db->lock(array('phpgw_accounts','phpgw_acl'));
|
||||||
$phpgw->db->next_record();
|
$phpgw->db->query('DELETE FROM phpgw_accounts WHERE account_id='.$group_id,__LINE__,__FILE__);
|
||||||
$group_name = $phpgw->db->f("group_name");
|
$phpgw->acl->delete_repository('%%','run',intval($group_id));
|
||||||
|
|
||||||
$phpgw->db->query("delete from groups where group_id=$group_id",__LINE__,__FILE__);
|
$basedir = $phpgw_info['server']['files_dir'] . SEP . 'groups' . SEP;
|
||||||
|
|
||||||
$sep = $phpgw->common->filesystem_separator();
|
|
||||||
|
|
||||||
$basedir = $phpgw_info["server"]["files_dir"] . $sep . "groups" . $sep;
|
|
||||||
|
|
||||||
if (! @rmdir($basedir . $group_name)) {
|
if (! @rmdir($basedir . $group_name)) {
|
||||||
$cd = 38;
|
$cd = 38;
|
||||||
@ -73,7 +73,9 @@
|
|||||||
$cd = 32;
|
$cd = 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
Header("Location: " . $phpgw->link("groups.php","cd=$cd"));
|
$phpgw->db->unlock();
|
||||||
|
|
||||||
|
Header('Location: ' . $phpgw->link('groups.php','cd='.$cd));
|
||||||
$phpgw->common->phpgw_exit();
|
$phpgw->common->phpgw_exit();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -81,12 +83,12 @@
|
|||||||
$phpgw->common->phpgw_header();
|
$phpgw->common->phpgw_header();
|
||||||
echo parse_navbar();
|
echo parse_navbar();
|
||||||
|
|
||||||
$p->set_var("message_display",lang("Are you sure you want to delete this group ?"));
|
$p->set_var('message_display',lang('Are you sure you want to delete this group ?'));
|
||||||
$p->parse("messages","message_row");
|
$p->parse('messages','message_row');
|
||||||
$p->set_var("yes",'<a href="' . $phpgw->link("deletegroup.php","group_id=$group_id&confirm=true") . '">' . lang("Yes") . '</a>');
|
$p->set_var('yes','<a href="' . $phpgw->link('deletegroup.php',"group_id=$group_id&confirm=true") . '">' . lang('Yes') . '</a>');
|
||||||
$p->set_var("no",'<a href="' . $phpgw->link("groups.php") . '">' . lang("No") . '</a>');
|
$p->set_var('no','<a href="' . $phpgw->link('groups.php') . '">' . lang('No') . '</a>');
|
||||||
|
|
||||||
$p->pparse("out","body");
|
$p->pparse('out','body');
|
||||||
|
|
||||||
$phpgw->common->phpgw_footer();
|
$phpgw->common->phpgw_footer();
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
|
<!-- BEGIN form -->
|
||||||
<center>
|
<center>
|
||||||
<table border="0" with="65%">
|
<table border="0" with="65%">
|
||||||
<tr colspan="2">
|
{messages}
|
||||||
<td align="center">{message}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>{no}</td>
|
<td>{no}</td>
|
||||||
<td>{yes}</td>
|
<td>{yes}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</center>
|
</center>
|
||||||
|
<!-- END form -->
|
||||||
|
|
||||||
|
5
admin/templates/default/message_row.tpl
Executable file
5
admin/templates/default/message_row.tpl
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
<!-- BEGIN message_row -->
|
||||||
|
<tr colspan="2">
|
||||||
|
<td align="center">{message_display}<td>
|
||||||
|
</tr>
|
||||||
|
<!-- END message_row -->
|
@ -10,8 +10,3 @@
|
|||||||
</center>
|
</center>
|
||||||
<!-- END form -->
|
<!-- END form -->
|
||||||
|
|
||||||
<!-- BEGIN message_row -->
|
|
||||||
<tr colspan="2">
|
|
||||||
<td align="center">{message_display}<td>
|
|
||||||
</tr>
|
|
||||||
<!-- END message_row -->
|
|
||||||
|
5
admin/templates/verdilak/message_row.tpl
Executable file
5
admin/templates/verdilak/message_row.tpl
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
<!-- BEGIN message_row -->
|
||||||
|
<tr colspan="2">
|
||||||
|
<td align="center">{message_display}<td>
|
||||||
|
</tr>
|
||||||
|
<!-- END message_row -->
|
Loading…
Reference in New Issue
Block a user