* @return boolean success.
*/
function updateUser($user_id,$role_id) {
- global $SYS;
if (!forge_check_perm ('project_admin', $this->getID())) {
$this->setPermissionDeniedError();
plugin_hook_by_reference ('clone_project_from_template', $params) ;
} else {
// Disable everything
- $res = db_query_params ('UPDATE groups SET use_mail=0, use_survey=0, use_forum=0, use_pm=0, use_pm_depend_box=0, use_scm=0, use_news=0, use_docman=0, use_ftp=0, use_tracker=0, use_frs=0, use_stats=0 WHERE group_id=$1',
-
- array ($this->getID())) ;
+ db_query_params ('UPDATE groups SET use_mail=0, use_survey=0, use_forum=0, use_pm=0, use_pm_depend_box=0, use_scm=0, use_news=0, use_docman=0, use_ftp=0, use_tracker=0, use_frs=0, use_stats=0 WHERE group_id=$1',
+ array ($this->getID())) ;
}
$this->normalizeAllRoles();
$admin_email = $admin->getEmail () ;
setup_gettext_for_user ($admin) ;
- foreach ($submitters as $u) {
- $submitter_names[] = $u->getRealName() ;
- }
-
$message = sprintf(_('New %1$s Project Submitted
Project Full Name: %2$s
} else if (strlen(htmlspecialchars($group_name))>50) {
$this->setError(_('Group name is too long'));
return false;
- } else if ($group=group_get_object_by_publicname($group_name)) {
+ } else if (group_get_object_by_publicname($group_name)) {
$this->setError(_('Group name already taken'));
return false;
}
* ONLY OPTIONAL WHEN YOU PLAN TO IMMEDIATELY CALL ->create()
* @return boolean success.
*/
- function Artifact(&$ArtifactType, $data=false) {
+ function __construct(&$ArtifactType, $data=false) {
$this->Error();
$this->ArtifactType =& $ArtifactType;
* @param array (all fields from artifact_file_user_vw) OR id from database.
* @return boolean success.
*/
- function ArtifactBoxOptions(&$ArtifactType,$data=false) {
+ function __construct(&$ArtifactType,$data=false) {
$this->Error();
//was ArtifactType legit?
}
//did ArtifactType have an error?
if ($ArtifactType->isError()) {
- $this->setError('ArtifactSelectionBox: '.$Artifact->getErrorMessage());
+ $this->setError('ArtifactSelectionBox: '.$ArtifactType->getErrorMessage());
return false;
}
$this->ArtifactType =& $ArtifactType;
* @param array (all fields from artifact_file_user_vw) OR id from database.
* @return boolean success.
*/
- function ArtifactCanned(&$ArtifactType, $data=false) {
+ function __construct(&$ArtifactType, $data=false) {
$this->Error();
//was ArtifactType legit?
* @param array (all fields from artifact_file_user_vw) OR id from database.
* @return boolean success.
*/
- function ArtifactExtraField(&$ArtifactType, $data=false) {
+ function __construct(&$ArtifactType, $data=false) {
$this->Error();
//was ArtifactType legit?
* @param array (all fields from artifact_file_user_vw) OR id from database.
* @return boolean success.
*/
- function ArtifactExtraFieldElement(&$ArtifactExtraField,$data=false) {
+ function __construct(&$ArtifactExtraField,$data=false) {
$this->Error();
//was ArtifactExtraField legit?
* @param object The ArtifactType object to which this ArtifactFactory is associated.
* @return boolean success.
*/
- function ArtifactFactory(&$ArtifactType) {
+ function __construct(&$ArtifactType) {
$this->Error();
if (!$ArtifactType || !is_object($ArtifactType)) {
$this->setError('ArtifactFactory:: No Valid ArtifactType Object');
* @param array (all fields from artifact_file_user_vw) OR id from database.
* @return boolean success.
*/
- function ArtifactFile(&$Artifact, $data=false) {
+ function __construct(&$Artifact, $data=false) {
$this->Error();
//was Artifact legit?
var $ArtifactType;
var $Artifact;
- function ArtifactFromID($id, $data = false) {
+ function __construct($id, $data = false) {
if ($data) {
$art_arr =& $data;
} else {
* @param array (all fields from artifact_history_user_vw) OR id from database.
* @return boolean success.
*/
- function ArtifactHistory(&$Artifact, $data=false) {
+ function __construct(&$Artifact, $data=false) {
$this->Error();
//was Artifact legit?
* @param array (all fields from artifact_history_user_vw) OR id from database.
* @return boolean success.
*/
- function ArtifactMessage(&$Artifact, $data=false) {
+ function __construct(&$Artifact, $data=false) {
$this->Error();
//was Artifact legit?
* @param
* @return boolean success.
*/
- function ArtifactQuery(&$ArtifactType, $data = false) {
+ function __construct(&$ArtifactType, $data = false) {
$this->Error();
//was ArtifactType legit?
* @param object The Group object to which this ArtifactQueryFactory is associated
* @return boolean success.
*/
- function ArtifactQueryFactory(&$ArtifactType) {
+ function __construct(&$ArtifactType) {
$this->Error();
if (!$ArtifactType || !is_object($ArtifactType)) {
$this->setError('ArtifactQueryFactory:: No ArtifactType Object');
* @param array The associative array of data.
* @return boolean success.
*/
- function ArtifactType($Group,$artifact_type_id=false, $arr=false) {
+ function __construct($Group,$artifact_type_id=false, $arr=false) {
$this->Error();
if (!$Group || !is_object($Group)) {
$this->setError('No Valid Group Object');
* @param object The Group object to which this ArtifactTypeFactory is associated
* @return boolean success.
*/
- function ArtifactTypeFactory(&$Group) {
+ function __construct(&$Group) {
$this->Error();
if (!$Group || !is_object($Group)) {
$this->setError('ArtifactTypeFactory:: No Valid Group Object');
}
return $this->ArtifactTypes;
}
-
- /**
- * getPublicFlag - a utility method to load up the current user's permissions
- *
- * @return string The public_flag field to plug into a SQL string
- */
- function &getPublicFlag() {
- return $public_flag;
- }
-
}
// Local Variables:
* @param object The Group object.
* @return boolean success.
*/
- function ArtifactTypes(&$Group) {
+ function __construct(&$Group) {
$this->Error();
if (!$Group || !is_object($Group)) {
$this->setError('No Valid Group Object');
var $artifact_id;
var $field_id;
- function ArtifactWorkflow($artifact, $field_id) {
+ function __construct($artifact, $field_id) {
$this->ath = $artifact;
$this->artifact_id = (int)$artifact->getID();
$this->field_id = (int)$field_id;
* @param int (primary key from database).
* @return boolean success.
*/
- function Artifacts(&$ArtifactType) {
+ function __construct(&$ArtifactType) {
$this->Error();
$this->ArtifactType =& $ArtifactType;
*
* @param user the User object for which to collect artifacts
*/
- function ArtifactsForUser(&$user) {
+ function __construct(&$user) {
$this->User =& $user;
return true;
}
return $artifacts;
}
for ($i=0; $i < $rows; $i++) {
- $id = db_result($result,$i,'artifact_id');
+ $artifact_id = db_result($result,$i,'artifact_id');
$arr = db_fetch_array($result);
- $afi = new ArtifactFromID($id,$arr);
+ $afi = new ArtifactFromID($artifact_id,$arr);
if ($afi->isError()) {
$this->setError($afi->getErrorMessage());
} elseif($afi->Artifact->ArtifactType->Group->getStatus() == 'A') {
$group_artifact_id = db_result($result,$i,'group_artifact_id');
$group = group_get_object($group_id);
$artifact = new ArtifactType($group,$group_artifact_id);
- $ag = $artifact->getGroup();
if ($artifact->isError()) {
$this->setError($artifact->getErrorMessage());
} else {
var $data_array;
- function Roadmap($group, $roadmap_id=0, $data=false) {
+ function __construct($group, $roadmap_id=0, $data=false) {
$this->Error();
if (is_object($group)) {
var $roadmaps;
- function RoadmapFactory($group) {
+ function __construct($group) {
$this->Error();
if (is_object($group)) {
return $this->roadmaps;
}
- public function getRoadmapByID($id, $enable_only=false) {
+ public function getRoadmapByID($roadmap_id, $enable_only=false) {
$roadmaps = $this->getRoadmaps($enable_only);
foreach ($roadmaps as $roadmap) {
if($roadmap->isError()) {
$this->setError($roadmap->getErrorMessage());
} else {
- if ($roadmap->getID() == $id) {
+ if ($roadmap->getID() == $roadmap_id) {
return $roadmap;
}
}
class ArtifactFileHtml extends ArtifactFile {
- /**
- * ArtifactFileHtml() - constructor
- *
- * Use this constructor if you are modifying an existing artifact
- *
- * @param $Artifact object
- * @param $data associative array (all fields from artifact_file_user_vw) OR id from database
- * @return true/false
- */
- function ArtifactFileHtml(&$Artifact, $data=false) {
- return $this->ArtifactFile($Artifact,$data);
- }
-
function upload($input_file,$input_file_name,$input_file_type,$description) {
if (!util_check_fileupload($input_file)) {
$this->setError('ArtifactFile: Invalid filename');
class ArtifactHtml extends Artifact {
- /**
- * ArtifactHtml() - constructor
- *
- * Use this constructor if you are modifying an existing artifact
- *
- * @param $ArtifactType object
- * @param $artifact_id integer (primary key from database)
- * @return true/false
- */
- function ArtifactHtml(&$ArtifactType,$artifact_id=false) {
- return $this->Artifact($ArtifactType,$artifact_id);
- }
-
/**
* show details preformatted (like followups)
*/
class ArtifactTypeHtml extends ArtifactType {
- /**
- * ArtifactType() - constructor
- *
- * @param $group object
- * @param $artifact_type_id - the id # assigned to this artifact type in the db
- */
- function ArtifactTypeHtml(&$group,$artifact_type_id=false, $arr=false) {
- return $this->ArtifactType($group,$artifact_type_id,$arr);
- }
-
function header($params) {
global $HTML;
if (!forge_get_config('use_tracker')) {