diff --git a/include/maintainer.php b/include/maintainer.php index 43d3ced..badf981 100644 --- a/include/maintainer.php +++ b/include/maintainer.php @@ -209,7 +209,7 @@ class maintainer function create() { /* user id, appid, and maintain reason must be valid to continue */ - if(!$this->iUserId || !$this->iAppId || !$this->sMaintainReason) + if(!$this->iAppId || !$this->sMaintainReason) { return NULL; } @@ -218,7 +218,7 @@ class maintainer "userId, maintainReason, superMaintainer, submitTime, queued) ". "VALUES ('?', '?', '?', '?', '?', ?, '?')", $this->iAppId, $this->iVersionId, - $this->iUserId, $this->sMaintainReason, + $_SESSION['current']->iUserId, $this->sMaintainReason, $this->bSuperMaintainer, "NOW()", $this->mustBeQueued() ? "true" : "false"); /* this objects id is the insert id returned by the database */ @@ -677,6 +677,22 @@ class maintainer return $oOMTableRow; } + function objectDisplayAddItemHelp() + { + echo "

This page is for submitting a request to become an application maintainer.\n"; + echo "An application maintainer is someone who runs the application \n"; + echo "regularly and who is willing to be active in reporting regressions with newer \n"; + echo "versions of Wine and to help other users run this application under Wine.

"; + echo "

Being an application maintainer comes with new rights and new responsibilities; please be sure to read the maintainer's guidelines before to proceed.

"; + echo "

We ask that all maintainers explain why they want to be an application maintainer,\n"; + echo "why they think they will do a good job and a little about their experience\n"; + echo "with Wine. This is both to give you time to\n"; + echo "think about whether you really want to be an application maintainer and also for the\n"; + echo "appdb admins to identify people that are best suited for the job. Your request\n"; + echo "may be denied if there are already a handful of maintainers for this application or if you\n"; + echo "don't have the experience with Wine that is necessary to help other users out.

\n"; + } + function ObjectDisplayQueueProcessingHelp() { echo "
\n\n"; @@ -693,111 +709,161 @@ class maintainer return FALSE; } - function outputEditor() + function objectGetCustomVars($sAction) { - //view application details - echo html_frame_start("New Maintainer Form",600,"",0); - echo "\n"; - echo "iMaintainerId\" />"; - - /* User name */ - $oSubmitter = new user($this->iUserId); - echo html_tr(array( - array("User name", 'style="text-align:right" class="color0"'), - $oSubmitter->objectMakeLink() - )); - - /** - * Show the other maintainers of this application, if there are any - */ - echo '',"\n"; - - /* Fetch maintainers and super maintainers */ - $oVersion = new Version($this->iVersionId); - $aOtherMaintainers = $oVersion->getMaintainersUserIds(); - $aOtherSuperMaintainers = - Maintainer::getSuperMaintainersUserIdsFromAppId($this->iAppId); - - if($aOtherMaintainers || $aOtherSuperMaintainers) - $bFoundMaintainers = true; - else - $bFoundMaintainers = false; - - echo "\n"; - - // Show which other apps the user maintains - echo '\n"; - - $oApp = new Application($this->iAppId); - $oVersion = new Version($this->iVersionId); - - //app name - echo '',"\n"; - echo "\n"; - - //version - echo '',"\n"; - echo "\n"; - - //maintainReason - echo '',"\n"; - echo '',"\n"; - echo '
Other maintainers of this app:\n"; - /* display maintainers for the version */ - if($aOtherMaintainers) + switch($sAction) { - while(list($index, $iUserId) = each($aOtherMaintainers)) - { - $oUser = new User($iUserId); + case "add": + return array("iAppId","iVersionId"); - // because Version::getMaintainersUserIds() includes super maintainers - // we need to exclude these from the list of maintainers that we are - // building - if(!maintainer::isUserSuperMaintainer($oUser, $oVersion->iAppId)) - echo "$oUser->sRealname
\n"; - } + default: + return null; } + } - /* display super maintainers for the given app */ - - if($aOtherSuperMaintainers) + function outputEditor($aClean = null) + { + if(!$this->iMaintainerId) { - while(list($index, $iUserId) = each($aOtherSuperMaintainers)) + if($aClean['iVersionId']) { - $oUser = new User($iUserId); - echo "$oUser->sRealname*
\n"; - } - } - - if(!$bFoundMaintainers) - { - echo "No other maintainers"; - } - - echo "
This user also maintains these apps:',"\n"; - - $oUser = new User($this->iUserId); - $aOtherApps = Maintainer::getAppsMaintained($oUser); - if($aOtherApps) - { - while(list($index, list($iAppIdOther, $iVersionIdOther, $bSuperMaintainerOther)) = each($aOtherApps)) + $oVersion = new version($aClean['iVersionId']); + $iAppId = $oVersion->iAppId; + } else { - $oApp = new Application($iAppIdOther); - - if($bSuperMaintainerOther) - echo $oApp->objectMakeLink()."*
\n"; - else - echo $oVersion->fullNameLink($iVersionIdOther)."
\n"; + $iAppId = $aClean['iAppId']; } + + $oApp = new application($iAppId); + + echo "\n"; + echo "',"\n"; + if($aClean['iVersionId']) + { + echo "',"\n"; + } + + $iSuperMaintainer = $aClean['iVersionId'] ? 0 : 1; + echo ""; + echo ""; + echo ""; + + if($aClean['iSuperMaintainer']) + echo '',"\n"; + else + echo '',"\n"; + + echo '
"; + echo 'Application'.$oApp->sName; + echo '
"; + echo 'Version'.$oVersion->sName; + echo '
Why you want to and should
be an application super maintainer
Why you want to and should
be an application maintainer
',"\n"; } else { - echo "User maintains no other applications"; + + //view application details + echo html_frame_start("New Maintainer Form",600,"",0); + echo "\n"; + echo "iMaintainerId\" />"; + + /* User name */ + $oSubmitter = new user($this->iUserId); + echo html_tr(array( + array("User name", 'style="text-align:right" class="color0"'), + $oSubmitter->objectMakeLink() + )); + + /** + * Show the other maintainers of this application, if there are any + */ + echo '\n"; + + // Show which other apps the user maintains + echo '\n"; + + $oApp = new Application($this->iAppId); + $oVersion = new Version($this->iVersionId); + + //app name + echo '',"\n"; + echo "\n"; + + //version + echo '',"\n"; + echo "\n"; + + //maintainReason + echo '',"\n"; + echo '',"\n"; + echo '
Other maintainers'; + /* Fetch maintainers and super maintainers */ + $oVersion = new Version($this->iVersionId); + $aOtherMaintainers = $oVersion->getMaintainersUserIds(); + $aOtherSuperMaintainers = + Maintainer::getSuperMaintainersUserIdsFromAppId($this->iAppId); + + if($aOtherMaintainers || $aOtherSuperMaintainers) + $bFoundMaintainers = true; + else + $bFoundMaintainers = false; + + echo "\n"; + /* display maintainers for the version */ + if($aOtherMaintainers) + { + while(list($index, $iUserId) = each($aOtherMaintainers)) + { + $oUser = new User($iUserId); + + // because Version::getMaintainersUserIds() includes super maintainers + // we need to exclude these from the list of maintainers that we are + // building + if(!maintainer::isUserSuperMaintainer($oUser, $oVersion->iAppId)) + echo "$oUser->sRealname
\n"; + } + } + + /* display super maintainers for the given app */ + + if($aOtherSuperMaintainers) + { + while(list($index, $iUserId) = each($aOtherSuperMaintainers)) + { + $oUser = new User($iUserId); + echo "$oUser->sRealname*
\n"; + } + } + + if(!$bFoundMaintainers) + { + echo "No other maintainers"; + } + + echo "
This user also maintains these apps:',"\n"; + + $oUser = new User($this->iUserId); + $aOtherApps = Maintainer::getAppsMaintained($oUser); + if($aOtherApps) + { + while(list($index, list($iAppIdOther, $iVersionIdOther, $bSuperMaintainerOther)) = each($aOtherApps)) + { + $oApp = new Application($iAppIdOther); + + if($bSuperMaintainerOther) + echo $oApp->objectMakeLink()."*
\n"; + else + echo $oVersion->fullNameLink($iVersionIdOther)."
\n"; + } + } else + { + echo "User maintains no other applications"; + } + + echo "
App Name:".$oApp->objectMakeLink()."
App Version:".$oVersion->objectMakeLink()."
Maintainer request reason:
'; + + echo html_frame_end(" "); } - - echo "
App Name:".$oApp->objectMakeLink()."
App Version:".$oVersion->objectMakeLink()."
Maintainer request reason:
'; - - echo html_frame_end(" "); } function ObjectGetId() @@ -807,7 +873,10 @@ class maintainer function getOutputEditorValues($aClean) { + $this->iAppId = $aClean['iAppId']; + $this->iVersionId = $aClean['iVersionId']; $this->sReplyText = $aClean['sReplyText']; + $this->sMaintainReason = $aClean['sMaintainReason']; return TRUE; } diff --git a/include/objectManager.php b/include/objectManager.php index b75c879..686e6eb 100644 --- a/include/objectManager.php +++ b/include/objectManager.php @@ -663,9 +663,6 @@ class ObjectManager else $oObject->outputEditor(); - echo "\n"; - echo "sTitle\" />\n"; - echo "
"; echo "\n"; diff --git a/include/version.php b/include/version.php index 7ba53d4..7b9c436 100644 --- a/include/version.php +++ b/include/version.php @@ -864,7 +864,7 @@ class version { echo "\n"; } else /* nope */ { - echo '
'."\n"; + echo 'iVersionId)).'&sReturnTo='.urlencode($this->objectMakeUrl()).'">'."\n"; echo "\t".''."\n"; echo "\t"."iAppId."\">\n"; echo "\t"."iVersionId."\">\n";