From 23c6c0aca64df7b024988e889a98feec51d8d2a1 Mon Sep 17 00:00:00 2001 From: Christian Bayle Date: Fri, 26 Feb 2010 10:55:15 +0000 Subject: [PATCH] Make hook not specific to a plugin --- gforge/common/include/Group.class.php | 9 +++++---- .../webcalendar/common/webcalendarPlugin.class.php | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gforge/common/include/Group.class.php b/gforge/common/include/Group.class.php index 4ef741efb3..c9e0dd7c50 100644 --- a/gforge/common/include/Group.class.php +++ b/gforge/common/include/Group.class.php @@ -2180,12 +2180,13 @@ class Group extends Error { $this->sendApprovalEmail(); $this->addHistory('Approved', 'x'); - //plugin webcal - //change assistant for webcal - + // + // Plugin can make approve operation there + // + // $params[0] = $idadmin_group ; $params[1] = $this->getID(); - plugin_hook('change_cal_permission_default',$params); + plugin_hook('group_approve',$params); return true; } diff --git a/gforge/plugins/webcalendar/common/webcalendarPlugin.class.php b/gforge/plugins/webcalendar/common/webcalendarPlugin.class.php index a86e6e78c5..b63973fb6a 100644 --- a/gforge/plugins/webcalendar/common/webcalendarPlugin.class.php +++ b/gforge/plugins/webcalendar/common/webcalendarPlugin.class.php @@ -43,7 +43,7 @@ class webcalendarPlugin extends Plugin { $this->hooks[] = "add_cal_group"; //add a group user in calendar base $this->hooks[] = "del_cal_group"; //del a gforge user in calendar base $this->hooks[] = "change_cal_permission"; //change permission pour webcal user (admin or not) - $this->hooks[] = "change_cal_permission_default"; //change permission pour webcal user (admin or not) + $this->hooks[] = "group_approve"; //change permission pour webcal user (admin or not) $this->hooks[] = "change_cal_permission_auto"; //change permission pour webcal user when you modify role $this->hooks[] = "add_cal_link_father"; // add a link between son and father $this->hooks[] = "del_cal_link_father"; // del a link between son and father @@ -307,7 +307,7 @@ db_query_params ('UPDATE webcal_user SET cal_email = $1 WHERE cal_login = $2', $row_nom_boss['unix_group_name'])); } } - elseif ($hookname == "change_cal_permission_default") { + elseif ($hookname == "group_approve") { $res = db_query_params ('SELECT admin_flags FROM user_group WHERE user_id = $1 AND group_id = $2', array ($params[0], $params[1])); -- 2.30.2