ChangeSet ID: 31315
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner(a)winehq.org 2007/08/05 15:14:07
Modified files:
include : objectManager.php
Log message:
Chris Morgan <cmorgan(a)alum.wpi.edu>
Clean up error handling in processForm() to only check for errors when submitting an entry.
This enables the deletion or rejection of entries that produce errors. While we can't always
know why errors in objects make it this far we don't want to make it impossible to delete or
reject malformed entries.
Patch: http://cvs.winehq.org/patch.py?id=31315
Old revision New revision Changes Path
1.46 1.47 +21 -4 appdb/include/objectManager.php
Index: appdb/include/objectManager.php
diff -u -p appdb/include/objectManager.php:1.46 appdb/include/objectManager.php:1.47
--- appdb/include/objectManager.php:1.46 5 Aug 2007 20:14: 7 -0000
+++ appdb/include/objectManager.php 5 Aug 2007 20:14: 7 -0000
@@ -524,13 +524,20 @@ class ObjectManager
if(method_exists(new $this->sClass, "checkOutputEditorInput"))
{
$sErrors = $oObject->checkOutputEditorInput($aClean);
- if($sErrors)
- return $sErrors;
}
+ // NOTE: we only check for errors when submitting
+ // because there is always the possibility that we can
+ // get into some error state but we don't want to be stuck, unable
+ // to delete an entry because of an error that we don't want to
+ // have to correct
switch($aClean['sSubmit'])
{
case "Submit":
+ // if we have errors, return them
+ if($sErrors)
+ return $sErrors;
+
// if we have a valid iId then we are displaying an existing entry
// otherwise we should create the entry in the 'else' case
if($this->iId)
@@ -551,16 +558,24 @@ class ObjectManager
$oObject->create();
}
- break;
+ break;
case "Reject":
if(!$oObject->canEdit())
return FALSE;
$oObject->reject();
- break;
+ break;
+
case "Delete":
$this->delete_entry();
+ break;
+
+ default:
+ // shouldn't end up here, log the submit type that landed us here
+ error_log::log_error(ERROR_GENERAL, "processForm() received ".
+ "unknown aClean[sSubmit] of: ".$aClean['sSubmit']);
+ return false;
}
/* Displaying the entire un-queued list for a class is not a good idea,
@@ -762,7 +777,9 @@ class ObjectManager
echo "</font><br />";
return TRUE;
} else
+ {
return FALSE;
+ }
}
}
ChangeSet ID: 31313
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner(a)winehq.org 2007/08/05 14:02:59
Modified files:
include : objectManager.php
Log message:
Chris Morgan <cmorgan(a)alum.wpi.edu>
Limit the current page to the available pages
Patch: http://cvs.winehq.org/patch.py?id=31313
Old revision New revision Changes Path
1.44 1.45 +5 -0 appdb/include/objectManager.php
Index: appdb/include/objectManager.php
diff -u -p appdb/include/objectManager.php:1.44 appdb/include/objectManager.php:1.45
--- appdb/include/objectManager.php:1.44 5 Aug 2007 19: 2:59 -0000
+++ appdb/include/objectManager.php 5 Aug 2007 19: 2:59 -0000
@@ -709,6 +709,11 @@ class ObjectManager
$iPage = isset($aClean['iPage']) ? $aClean['iPage'] : 1;
$iCurrentPage = min($iPage, $iNumPages);
+ // if iPage is beyond the maximum number of pages, make it the
+ // highest page number
+ if($iPage > $iNumPages)
+ $iPage = $iNumPages;
+
/* Display selectors and info */
echo '<div align="center">';
echo "<b>Page $iPage of $iNumPages</b><br />";
ChangeSet ID: 31312
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner(a)winehq.org 2007/08/05 12:34:42
Modified files:
include : maintainer.php
Log message:
Chris Morgan <cmorgan(a)alum.wpi.edu>
Maintainer notification improvements. Add some spaces to the notification emails, fix the url
for the test results queue and screenshots queue. Add an email for the third level where we are
removing the maintainership for the user to explain to the user why we are removing their
maintainership. Factor out a few lines of common code.
Patch: http://cvs.winehq.org/patch.py?id=31312
Old revision New revision Changes Path
1.53 1.54 +32 -17 appdb/include/maintainer.php
Index: appdb/include/maintainer.php
diff -u -p appdb/include/maintainer.php:1.53 appdb/include/maintainer.php:1.54
--- appdb/include/maintainer.php:1.53 5 Aug 2007 17:34:42 -0000
+++ appdb/include/maintainer.php 5 Aug 2007 17:34:42 -0000
@@ -938,13 +938,13 @@ class maintainer
{
$oApp = new Application($this->iAppId);
$sSubject.= $oApp->sName;
- $sMsg.='application, '.$oApp->sName.'('.$oApp->objectMakeUrl().'), that you maintain.'."\n";
+ $sMsg.='application, '.$oApp->sName.'('.$oApp->objectMakeUrl().'), that you maintain.'."\n\n";
} else
{
$sFullname = version::fullName($this->iVersionId);
$oVersion = new Version($this->iVersionId);
$sSubject.= $sFullname;
- $sMsg.='version, '.$sFullname.'('.$oVersion->objectMakeUrl().'), that you maintain.'."\n";
+ $sMsg.='version, '.$sFullname.'('.$oVersion->objectMakeUrl().'), that you maintain.'."\n\n";
}
$sSubject.=" ready for your processing";
@@ -983,7 +983,7 @@ class maintainer
// FIXME: should use a function to generate these urls and use it here and
// in sidebar_maintainer.php and sidebar_admin.php
$sMsg = 'Please visit the test data queue ('.APPDB_ROOT."objectManager.php?sClass=version_queue&bIsQueue=true&sTitle=".
- "Version%20Queue".') to process queued versions for applications you maintain.\n';
+ 'Version%20Queue) to process queued versions for applications you maintain.'."\n";
}
//////////////////
@@ -1022,8 +1022,10 @@ class maintainer
// FIXME: should use a function to generate these urls and use it here and
// in sidebar_maintainer.php and sidebar_admin.php
- $sMsg .= 'Please visit <a href="'.BASE."objectManager.php?sClass=testData_queue&bIsQueue=true&sTitle=".
- "Test%20Results%20Queue".'">AppDB Test Data queue</a> to process queued test data for versions you maintain.\r\n';
+ $sMsg .= 'Please visit the AppDB Test Data Queue'.
+ '('.APPDB_ROOT.'objectManager.php?sClass=testData_queue&'.
+ 'bIsQueue=true&sTitle=Test%20Results%20Queue)'.
+ ' to process queued test data for versions you maintain.'."\n";
}
// queued testdata
//////////////////
@@ -1057,8 +1059,9 @@ class maintainer
{
// FIXME: should use a function to generate these urls and use it here and
// in sidebar_maintainer.php and sidebar_admin.php
- $sMsg .= 'Please visit <a href="'.BASE."objectManager.php?sClass=screenshot_queue&bIsQueue=true&sTitle=".
- "Screenshot%20Queue".'">Screenshot queue</a> to process queued screenshots for versions you maintain.\r\n';
+ $sMsg.= 'Please visit the screenshot queue(';
+ $sMsg.= APPDB_ROOT.'objectManager.php?sClass=screenshot_queue&bIsQueue=true&sTitle=Screenshot%20Queue) ';
+ $sMsg.= 'to process queued screenshots for versions you maintain.'."\n";
}
// queued screenshots
@@ -1121,24 +1124,34 @@ class maintainer
break;
case 1: // send the first notification
// nothing to do here, the first notification is just a reminder
- $oNotificationUpdate->sMsg.= "\n\nThanks,\n";
- $oNotificationUpdate->sMsg.= "Appdb Admins";
break;
case 2: // send the second notification, notify them that if the queued entries aren't
// processed after another $iNotificationIntervalDays that
// we'll have to remove their maintainership for this application/version
// so a more active person can fill the spot
- $oNotificationUpdate->sMsg.= "\nThis your second notification of queued entries. If the queued entries are";
- $oNotificationUpdate->sMsg.= " not processed within the next ".iNotificationIntervalDays. "we will remove";
- $oNotificationUpdate->sMsg.= " your maintainership for this application/version so a more active person";
- $oNotificationUpdate->sMsg.= " can fill the spot.";
- $oNotificationUpdate->sMsg.= "\n\nThanks,\n";
- $oNotificationUpdate->sMsg.= "Appdb Admins";
+ $oNotificationUpdate->sMsg.= "\nThis your second notification of queued entries.";
+ $oNotificationUpdate->sMsg.= " If the queued entries are not processsed within";
+ $oNotificationUpdate->sMsg.= " the next ".iNotificationIntervalDays. "we will remove";
+ $oNotificationUpdate->sMsg.= " your maintainership for this application/version";
+ $oNotificationUpdate->sMsg.= " so a more active person can fill the spot.";
break;
- case 3: // remove their maintainership
+ case 3: // remove their maintainership and notify the maintainer why we are doing so
+ $oNotificationUpdate->sMsg.= "\nThis your third notification of queued entries.";
+ $oNotificationUpdate->sMsg.= " Because your queued entries have not been processed";
+ $oNotificationUpdate->sMsg.= " after two notifications we are removing your maintainer";
+ $oNotificationUpdate->sMsg.= " role for this application/version. Removing inactive";
+ $oNotificationUpdate->sMsg.= " maintainers lets us free up slots for other potential";
+ $oNotificationUpdate->sMsg.= " maintainers.\n";
+ $oNotificationUpdate->sMsg.= " If you are still interested in being a maintainer please";
+ $oNotificationUpdate->sMsg.= " submit a maintainer request.";
$this->delete(); // delete ourselves from the database
break;
}
+
+ // common end of our message
+ $oNotificationUpdate->sMsg.= "\n\nThanks,\n";
+ $oNotificationUpdate->sMsg.= "Appdb Admins\n";
+ $oNotificationUpdate->sMsg.= "<appdb(a)winehq.org>";
// save the notification level and notification time back into the database
$sQuery = "update appMaintainers set notificationLevel = '?', notificationTime = ?".
@@ -1148,6 +1161,7 @@ class maintainer
//TODO: we probably want to copy the mailing list on each of these emails
$oNotificationUpdate->sEmail.=" cmorgan(a)alum.wpi.edu"; // FIXME: for debug append my email address
+ // we don't send any emails if the notification level is zero
if($this->iNotificationLevel == 0)
{
if($bDebugOutputEnabled)
@@ -1161,7 +1175,8 @@ class maintainer
echo "Msg: ".$oNotificationUpdate->sMsg."\n\n";
}
- mail_appdb($oNotificationUpdate->sEmail, $oNotificationUpdate->sSubject, $oNotificationUpdate->sMsg);
+ mail_appdb($oNotificationUpdate->sEmail, $oNotificationUpdate->sSubject,
+ $oNotificationUpdate->sMsg);
}
}