* IMPORTANT! That db result must contain all fields
* from groups table or you will have problems
*
- * @param int $group_id Required
- * @param int|bool $res Result set handle ("SELECT * FROM groups WHERE group_id=xx")
- * @return Group|bool A group object or false on failure
+ * @param int $group_id Required
+ * @param int|bool $res Result set handle ("SELECT * FROM groups WHERE group_id=xx")
+ * @return Group|bool A group object or false on failure
*/
function &group_get_object($group_id, $res = false) {
//create a common set of group objects
foreach ($id_arr as $id) {
//
- // See if this ID already has been fetched in the cache
+ // See if this ID already has been fetched in the cache
//
if (!isset($GROUP_OBJ["_".$id."_"])) {
$fetch[] = $id;
/**
* get_public_active_projects_asc() - Get a list of rows for public active projects (initially in trove/full_list)
*
- * @param int Opional Maximum number of rows to limit query length
+ * @param int $max_query_limit Optional Maximum number of rows to limit query length
+ * @return array List of public active projects
*/
function get_public_active_projects_asc($max_query_limit = -1) {
/**
* Group - Group object constructor - use group_get_object() to instantiate.
*
- * @param int|bool $id Required - Id of the group you want to instantiate.
- * @param int|bool $res Database result from select query OR associative array of all columns.
+ * @param int|bool $id Required - Id of the group you want to instantiate.
+ * @param int|bool $res Database result from select query OR associative array of all columns.
*/
function __construct($id = false, $res = false) {
$this->Error();
/**
* fetchData - May need to refresh database fields if an update occurred.
*
- * @param int $group_id The group_id.
- * @return boolean success or not
+ * @param int $group_id The group_id.
+ * @return boolean success or not
*/
function fetchData($group_id) {
$res = db_query_params ('SELECT * FROM groups WHERE group_id=$1',
*
* This function require site admin privilege.
*
- * @param object $user User requesting operation (for access control).
- * @param int $type_id Group type (1-project, 2-foundry).
- * @param string $unix_box Machine on which group's home directory located.
+ * @param object $user User requesting operation (for access control).
+ * @param int $type_id Group type (1-project, 2-foundry).
+ * @param string $unix_box Machine on which group's home directory located.
* @param string $http_domain Domain which serves group's WWW.
- * @return bool status.
+ * @return bool status.
* @access public
*/
function updateAdmin(&$user, $type_id, $unix_box, $http_domain) {
*
* Unlike updateAdmin(), this function accessible to project admin.
*
- * @param object $user User requesting operation (for access control).
+ * @param object $user User requesting operation (for access control).
* @param string $group_name
* @param string $homepage
* @param string $short_description
* @param bool $use_stats
* @param $tags
* @param bool $use_activity
- * @param bool $is_public group is publicly accessible
+ * @param bool $is_public group is publicly accessible
* @return int status.
* @access public
*/
* I: Incomplete
* D: Deleted
*
- * @param object User requesting operation (for access control).
- * @param string Status value.
+ * @param object $user User requesting operation (for access control).
+ * @param string $status Status value.
* @return boolean success.
* @access public
*/
/**
* setAsTemplate - Set the template status of a project
*
- * @param boolean is_template.
+ * @param boolean $booleanparam is_template.
* @return bool
*/
function setAsTemplate($booleanparam) {
/**
* setSCMBox - the hostname of the scm box where this project is located.
*
- * @param string The name of the new SCM_BOX
+ * @param string $scm_box The name of the new SCM_BOX
* @return bool
*/
function setSCMBox($scm_box) {
if ($res) {
$this->data_array['enable_pserver'] = $booleanparam;
db_commit();
+ return true;
} else {
db_rollback();
return false;
/**
* setUseSCM - Set the SCM usage
*
- * @param boolean enabled/disabled
+ * @param boolean $booleanparam enabled/disabled
* @return bool
*/
function setUseSCM($booleanparam) {
/**
* setUseMail - Set the mailing-list usage
*
- * @param boolean enabled/disabled
+ * @param boolean $booleanparam enabled/disabled
* @return bool
*/
function setUseMail($booleanparam) {
/**
* setUseForum - Set the forum usage
*
- * @param boolean enabled/disabled
+ * @param boolean $booleanparam enabled/disabled
* @return bool
*/
function setUseForum($booleanparam) {
/**
* setUseFRS - Set the FRS usage
*
- * @param boolean enabled/disabled
+ * @param boolean $booleanparam enabled/disabled
* @return bool
*/
function setUseFRS($booleanparam) {
/**
* setUseTracker - Set the tracker usage
*
- * @param boolean enabled/disabled
+ * @param boolean $booleanparam enabled/disabled
* @return bool
*/
function setUseTracker ($booleanparam) {
/**
* setUseDocman - Set the docman usage
*
- * @param boolean enabled/disabled
+ * @param boolean $booleanparam enabled/disabled
* @return bool
*/
function setUseDocman($booleanparam) {
/**
* setUsePM - Set the PM usage
*
- * @param boolean enabled/disabled
+ * @param boolean $booleanparam enabled/disabled
* @return bool
*/
function setUsePM($booleanparam) {
* added for Codendi compatibility
* usesServices - returns true if the group uses a particular plugin or feature
*
- * @param string name of the plugin
+ * @param string $feature name of the plugin
* @return boolean whether plugin is being used or not
*/
function usesService($feature) {
/**
* setPluginUse - enables/disables plugins for the group
*
- * @param string name of the plugin
- * @param boolean the new state
+ * @param string $pluginname name of the plugin
+ * @param boolean $val the new state
* @return string database result
*/
function setPluginUse($pluginname, $val=true) {
//
// Delete reporting
//
- $res = db_query_params('DELETE FROM rep_group_act_monthly WHERE group_id=$1',
+ db_query_params('DELETE FROM rep_group_act_monthly WHERE group_id=$1',
array($this->getID()));
//echo 'rep_group_act_monthly'.db_error();
- $res = db_query_params('DELETE FROM rep_group_act_weekly WHERE group_id=$1',
+ db_query_params('DELETE FROM rep_group_act_weekly WHERE group_id=$1',
array($this->getID()));
//echo 'rep_group_act_weekly'.db_error();
- $res = db_query_params('DELETE FROM rep_group_act_daily WHERE group_id=$1',
+ db_query_params('DELETE FROM rep_group_act_daily WHERE group_id=$1',
array($this->getID()));
//echo 'rep_group_act_daily'.db_error();
unset($this->data_array);
/**
* addUser - controls adding a user to a group.
*
- * @param string Unix name of the user to add OR integer user_id.
- * @param int The role_id this user should have.
+ * @param string $user_identifier Unix name of the user to add OR integer user_id.
+ * @param int $role_id The role_id this user should have.
* @return boolean success.
* @access public
*/
- function addUser($user_identifier,$role_id) {
+ function addUser($user_identifier, $role_id) {
global $SYS;
/*
Admins can add users to groups
*
* Users can remove themselves.
*
- * @param int The ID of the user to remove.
+ * @param int $user_id The ID of the user to remove.
* @return boolean success.
*/
function removeUser($user_id) {
/**
* updateUser - controls updating a user's role in this group.
*
- * @param int The ID of the user.
- * @param int The role_id to set this user to.
+ * @param int $user_id The ID of the user.
+ * @param int $role_id The role_id to set this user to.
* @return boolean success.
*/
- function updateUser($user_id,$role_id) {
+ function updateUser($user_id, $role_id) {
if (!forge_check_perm ('project_admin', $this->getID())) {
$this->setPermissionDeniedError();
/**
* addHistory - Makes an audit trail entry for this project.
*
- * @param string The name of the field.
- * @param string The Old Value for this $field_name.
- * @return database result handle.
+ * @param string $field_name The name of the field.
+ * @param string $old_value The Old Value for this $field_name.
+ * @return resource database result handle.
* @access public
*/
function addHistory($field_name, $old_value) {
}
/**
- * getMembers - returns array of User objects for this project
+ * getMembers - returns array of User objects for this project
*
- * @return array of User objects for this group.
+ * @return array of User objects for this group.
*/
function getMembers() {
return $this->getUsers (true);
}
/**
- * replaceTemplateStrings - fill-in some blanks with project name
+ * replaceTemplateStrings - fill-in some blanks with project name
*
- * @param string Template string
- * @return string String after replacements
+ * @param string $string Template string
+ * @return string String after replacements
*/
function replaceTemplateStrings($string) {
$string = str_replace ('UNIXNAME', $this->getUnixName(), $string);
}
/**
- * approve - Approve pending project.
+ * approve - Approve pending project.
*
- * @param User $user The User object who is doing the updating.
- * @return bool
- * @access public
+ * @param object $user The User object who is doing the updating.
+ * @return bool
+ * @access public
*/
function approve(&$user) {
global $gfcommon,$gfwww;
util_make_url ('/project/admin/?group_id='.$this->getID()),
forge_get_config ('forge_name'));
- util_send_message($admin->getEmail(), sprintf(_('%1$s Project Approved'), forge_get_config ('forge_name')), $message);
+ util_send_message($admin->getEmail(), sprintf(_('%s Project Approved'), forge_get_config ('forge_name')), $message);
setup_gettext_from_context();
}
* This function sends out a rejection message to a user who
* registered a project.
*
- * @param int The id of the response to use.
- * @param string The rejection message.
- * @return boolean completion status.
+ * @param int $response_id The id of the response to use.
+ * @param string $message The rejection message.
+ * @return bool completion status.
* @access public
*/
function sendRejectionEmail($response_id, $message="zxcv") {
setup_gettext_for_user($admin);
$response = sprintf(_('Your project registration for %s has been denied.'), forge_get_config('forge_name')) . "\n\n"
- . _('Project Full Name')._(': '). $this->getPublicName() . "\n"
- . _('Project Unix Name')._(': '). $this->getUnixName() . "\n\n"
+ . _('Project Full Name')._(': '). $this->getPublicName() . "\n"
+ . _('Project Unix Name')._(': '). $this->getUnixName() . "\n\n"
. _('Reasons for negative decision')._(': ') . "\n\n";
// Check to see if they want to send a custom rejection response
$admin_email = $admin->getEmail();
setup_gettext_for_user ($admin);
- $message = sprintf(_('New %1$s Project Submitted
-
-Project Full Name: %2$s
-Submitted Description: %3$s
-'),
- forge_get_config ('forge_name'),
- htmlspecialchars_decode($this->getPublicName()),
- htmlspecialchars_decode($this->getRegistrationPurpose()));
+ $message = sprintf(_('New %s Project Submitted'), forge_get_config ('forge_name')) . "\n\n"
+ . _('Project Full Name')._(': ').htmlspecialchars_decode($this->getPublicName()) . "\n"
+ . _('Submitted Description')._(': ').htmlspecialchars_decode($this->getRegistrationPurpose()) . "\n";
foreach ($submitters as $submitter) {
- $message .= sprintf(_('Submitter: %1$s (%2$s)
-'),
- $submitter->getRealName(),
- $submitter->getUnixName());
+ $message .= _('Submitter')._(': ').$submitter->getRealName().' ('.$submitter->getUnixName().')' . "\n\n";
}
- $message .= sprintf (_('
-Please visit the following URL to approve or reject this project:
-%1$s'),
- util_make_url ('/admin/approve-pending.php'));
- util_send_message($admin_email, sprintf(_('New %1$s Project Submitted'), forge_get_config ('forge_name')), $message);
+ $message .= "\n"
+ . _('Please visit the following URL to approve or reject this project')._(': '). "\n"
+ . util_make_url('/admin/approve-pending.php');
+ util_send_message($admin_email, sprintf(_('New %s Project Submitted'), forge_get_config('forge_name')), $message);
setup_gettext_from_context();
}
$email = $submitter->getEmail();
setup_gettext_for_user ($submitter);
- $message = sprintf(_('New %1$s Project Submitted
-
-Project Full Name: %2$s
-Submitted Description: %3$s
-
-The %1$s admin team will now examine your project submission. You will be notified of their decision.'), forge_get_config ('forge_name'), $this->getPublicName(), util_unconvert_htmlspecialchars($this->getRegistrationPurpose()), forge_get_config('web_host'));
+ $message = sprintf(_('New %s Project Submitted'), forge_get_config ('forge_name')) . "\n\n"
+ . _('Project Full Name')._(': ') . $this->getPublicName() . "\n"
+ . _('Submitted Description')._(': ') . util_unconvert_htmlspecialchars($this->getRegistrationPurpose()) . "\n\n"
+ . sprintf(_('The %s admin team will now examine your project submission. You will be notified of their decision.'),
+ forge_get_config ('web_host'));
- util_send_message($email, sprintf(_('New %1$s Project Submitted'), forge_get_config ('forge_name')), $message);
+ util_send_message($email, sprintf(_('New %s Project Submitted'), forge_get_config ('forge_name')), $message);
setup_gettext_from_context();
return true;
* setUnixStatus - Sets status of activation of unix account.
*
* @param string $status The unix status.
- * N no_unix_account
- * A active
- * S suspended
- * D deleted
+ * N no_unix_account
+ * A active
+ * S suspended
+ * D deleted
*
* @return boolean success.
*/
/**
* getUsers - Get the users of a group
*
+ * @param bool $onlylocal
* @return array of user's objects.
*/
function getUsers($onlylocal = true) {
/**
* group_getname() - get the group name
*
- * @param int The group ID
- * @return string
+ * @param int $group_id The group ID
+ * @return string
* @deprecated
*
*/
/**
* group_getunixname() - get the unixname for a group
*
- * @param int The group ID
- * @return string
+ * @param int $group_id The group ID
+ * @return string
* @deprecated
*
*/
/**
* group_get_result() - Get the group object result ID.
*
- * @param int The group ID
- * @return int
+ * @param int $group_id The group ID
+ * @return int
* @deprecated
*
*/