From c1c80b98c8927c58b5db37ae4032b314cfc09b71 Mon Sep 17 00:00:00 2001 From: lo-lan-do <> Date: Tue, 11 Dec 2007 09:32:10 +0000 Subject: [PATCH 1/1] Include submitter's name in project registration email --- gforge/ChangeLog | 5 +++ gforge/common/include/Group.class.php | 58 +++++++++++++-------------- 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/gforge/ChangeLog b/gforge/ChangeLog index 0e467d182d..d3e9643ae2 100644 --- a/gforge/ChangeLog +++ b/gforge/ChangeLog @@ -1,3 +1,8 @@ +2007-12-11 Roland Mas + + * common/include/Group.class.php: Include realname and username of + the person who requests a project in the email sent to the admins. + 2007-12-06 Roland Mas * plugins/scmsvn/cronjobs/snapshots.sh: Change interpreter to bash diff --git a/gforge/common/include/Group.class.php b/gforge/common/include/Group.class.php index b0451e4616..ddd7caf134 100644 --- a/gforge/common/include/Group.class.php +++ b/gforge/common/include/Group.class.php @@ -2146,6 +2146,18 @@ Reasons for negative decision: * @access public. */ function sendNewProjectNotificationEmail() { + // Get the user who wants to register the project + $res = db_query("SELECT u.user_id + FROM users u, user_group ug + WHERE ug.group_id='".$this->getID()."' AND u.user_id=ug.user_id;"); + + if (db_numrows($res) < 1) { + $this->setError(_("Could not find user who has submitted the project.")); + return false; + } + + $submitter =& user_get_object(db_result($res,0,'user_id')); + $res = db_query("SELECT users.email, users.language, users.user_id FROM users,user_group @@ -2156,40 +2168,31 @@ Reasons for negative decision: if (db_numrows($res) < 1) { $this->setError(_("There is no administrator to send the mail.")); return false; - } else { - for ($i=0; $igetPublicName(), util_unconvert_htmlspecialchars($this->getRegistrationPurpose()), $this->getLicenseName(), $GLOBALS['sys_default_domain'])); - util_send_message($admin_email, sprintf(_('New %1$s Project Submitted'), $GLOBALS['sys_name']), $message); - setup_gettext_from_browser () ; - } +http://%5$s/admin/approve-pending.php'), $GLOBALS['sys_name'], $this->getPublicName(), util_unconvert_htmlspecialchars($this->getRegistrationPurpose()), $this->getLicenseName(), $GLOBALS['sys_default_domain'], $submitter->getRealName(), $submitter->getUnixName())); + util_send_message($admin_email, sprintf(_('New %1$s Project Submitted'), $GLOBALS['sys_name']), $message); + setup_gettext_from_browser () ; } - // Get the email of the user who wants to register the project - $res = db_query("SELECT u.email, u.language, u.user_id - FROM users u, user_group ug - WHERE ug.group_id='".$this->getID()."' AND u.user_id=ug.user_id;"); - if (db_numrows($res) < 1) { - $this->setError(_("Cound not find user who has submitted the project.")); - return false; - } else { - for ($i=0; $igetEmail() ; + setup_gettext_for_user ($submitter) ; - $message=stripcslashes(sprintf(_('New %1$s Project Submitted + $message=stripcslashes(sprintf(_('New %1$s Project Submitted Project Full Name: %2$s Submitted Description: %3$s @@ -2197,13 +2200,10 @@ License: %4$s The %1$s admin team will now examine your project submission. You will be notified of their decision.'), $GLOBALS['sys_name'], $this->getPublicName(), util_unconvert_htmlspecialchars($this->getRegistrationPurpose()), $this->getLicenseName(), $GLOBALS['sys_default_domain'])); - util_send_message($email, sprintf(_('New %1$s Project Submitted'), $GLOBALS['sys_name']), $message); - setup_gettext_from_browser () ; - } - } + util_send_message($email, sprintf(_('New %1$s Project Submitted'), $GLOBALS['sys_name']), $message); + setup_gettext_from_browser () ; - - return true; + return true; } } -- 2.30.2