* 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',
* @param object $user The User object.
* @param string $group_name The full name of the user.
* @param string $unix_name The Unix name of the user.
- * @param string $description The new group description.
+ * @param string $description The new group description.
* @param string $purpose The purpose of the group.
* @param string $unix_box
* @param string $scm_box
* @param bool $is_public
* @param bool $send_mail Whether to send an email or not
- * @param int $built_from_template The id of the project this new project is based on
+ * @param int $built_from_template The id of the project this new project is based on
* @return boolean success or not
*/
function create(&$user, $group_name, $unix_name, $description, $purpose, $unix_box = 'shell1',
*
* 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
*/
if ($res) {
$this->data_array['enable_pserver'] = $booleanparam;
db_commit();
+ return true;
} else {
db_rollback();
return false;
* 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) {
//
// 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 $user_identifier Unix name of the user to add OR integer user_id.
- * @param int $role_id The role_id this user should have.
+ * @param int $role_id The role_id this user should have.
* @return boolean success.
* @access public
*/
/**
* addHistory - Makes an audit trail entry for this project.
*
- * @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.
+ * @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 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 $response_id The id of the response to use.
+ * @param int $response_id The id of the response to use.
* @param string $message The rejection message.
* @return bool completion status.
* @access public
$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 .= "\n"
$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 %s Project Submitted'), forge_get_config ('forge_name')), $message);
setup_gettext_from_context();
* 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 $group_id 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 $group_id 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 $group_id The group ID
- * @return int
+ * @param int $group_id The group ID
+ * @return int
* @deprecated
*
*/