Add more php5 scope keywords to class methods.
This commit is contained in:
@@ -43,7 +43,7 @@ class Application {
|
|||||||
/**
|
/**
|
||||||
* constructor, fetches the data.
|
* constructor, fetches the data.
|
||||||
*/
|
*/
|
||||||
function Application($iAppId = null, $oRow = null)
|
public function Application($iAppId = null, $oRow = null)
|
||||||
{
|
{
|
||||||
// we are working on an existing application
|
// we are working on an existing application
|
||||||
if(!$iAppId && !$oRow)
|
if(!$iAppId && !$oRow)
|
||||||
@@ -96,7 +96,7 @@ class Application {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function _internal_retrieve_all_versions($bIncludeObsolete = TRUE)
|
private function _internal_retrieve_all_versions($bIncludeObsolete = TRUE)
|
||||||
{
|
{
|
||||||
if(!$bIncludeObsolete)
|
if(!$bIncludeObsolete)
|
||||||
$sObsolete = " AND obsoleteBy = '0'";
|
$sObsolete = " AND obsoleteBy = '0'";
|
||||||
@@ -109,7 +109,7 @@ class Application {
|
|||||||
return $hResult;
|
return $hResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
function _internal_retrieve_unqueued_versions()
|
private function _internal_retrieve_unqueued_versions()
|
||||||
{
|
{
|
||||||
$sQuery = "SELECT versionId FROM appVersion WHERE
|
$sQuery = "SELECT versionId FROM appVersion WHERE
|
||||||
queued = 'false' AND
|
queued = 'false' AND
|
||||||
@@ -121,7 +121,7 @@ class Application {
|
|||||||
/**
|
/**
|
||||||
* Creates a new application.
|
* Creates a new application.
|
||||||
*/
|
*/
|
||||||
function create()
|
public function create()
|
||||||
{
|
{
|
||||||
if(!$_SESSION['current']->canCreateApplication())
|
if(!$_SESSION['current']->canCreateApplication())
|
||||||
return false;
|
return false;
|
||||||
@@ -165,7 +165,7 @@ class Application {
|
|||||||
* Update application.
|
* Update application.
|
||||||
* Returns true on success and false on failure.
|
* Returns true on success and false on failure.
|
||||||
*/
|
*/
|
||||||
function update($bSilent=false)
|
public function update($bSilent=false)
|
||||||
{
|
{
|
||||||
$sWhatChanged = "";
|
$sWhatChanged = "";
|
||||||
|
|
||||||
@@ -236,7 +236,7 @@ class Application {
|
|||||||
* Deletes the application from the database.
|
* Deletes the application from the database.
|
||||||
* and request the deletion of linked elements.
|
* and request the deletion of linked elements.
|
||||||
*/
|
*/
|
||||||
function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
$bSuccess = true;
|
$bSuccess = true;
|
||||||
|
|
||||||
@@ -264,7 +264,7 @@ class Application {
|
|||||||
/**
|
/**
|
||||||
* Move application out of the queue.
|
* Move application out of the queue.
|
||||||
*/
|
*/
|
||||||
function unQueue()
|
public function unQueue()
|
||||||
{
|
{
|
||||||
if(!$_SESSION['current']->canUnQueueApplication())
|
if(!$_SESSION['current']->canUnQueueApplication())
|
||||||
return;
|
return;
|
||||||
@@ -288,7 +288,7 @@ class Application {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Reject()
|
public function Reject()
|
||||||
{
|
{
|
||||||
if(!$_SESSION['current']->canRejectApplication($this))
|
if(!$_SESSION['current']->canRejectApplication($this))
|
||||||
return;
|
return;
|
||||||
@@ -310,14 +310,14 @@ class Application {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetItemsPerPage($bQueued = false)
|
public static function objectGetItemsPerPage($bQueued = false)
|
||||||
{
|
{
|
||||||
$aItemsPerPage = array(25, 50, 100, 200);
|
$aItemsPerPage = array(25, 50, 100, 200);
|
||||||
$iDefaultPerPage = 25;
|
$iDefaultPerPage = 25;
|
||||||
return array($aItemsPerPage, $iDefaultPerPage);
|
return array($aItemsPerPage, $iDefaultPerPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
function ReQueue()
|
public function ReQueue()
|
||||||
{
|
{
|
||||||
if(!$_SESSION['current']->canRequeueApplication($this))
|
if(!$_SESSION['current']->canRequeueApplication($this))
|
||||||
return false;
|
return false;
|
||||||
@@ -334,17 +334,17 @@ class Application {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetSubmitterId()
|
public function objectGetSubmitterId()
|
||||||
{
|
{
|
||||||
return $this->iSubmitterId;
|
return $this->iSubmitterId;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetMailOptions($sAction, $bMailSubmitter, $bParentAction)
|
public function objectGetMailOptions($sAction, $bMailSubmitter, $bParentAction)
|
||||||
{
|
{
|
||||||
return new mailOptions();
|
return new mailOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetMail($sAction, $bMailSubmitter, $bParentAction)
|
public function objectGetMail($sAction, $bMailSubmitter, $bParentAction)
|
||||||
{
|
{
|
||||||
if($bMailSubmitter)
|
if($bMailSubmitter)
|
||||||
{
|
{
|
||||||
@@ -371,7 +371,7 @@ class Application {
|
|||||||
return array($sSubject, $sMsg, $aMailTo);
|
return array($sSubject, $sMsg, $aMailTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
function mailSubmitter($sAction="add")
|
private function mailSubmitter($sAction="add")
|
||||||
{
|
{
|
||||||
global $aClean;
|
global $aClean;
|
||||||
if(!isset($aClean['sReplyText']))
|
if(!isset($aClean['sReplyText']))
|
||||||
@@ -407,7 +407,7 @@ class Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function countWithRating($sRating)
|
public static function countWithRating($sRating)
|
||||||
{
|
{
|
||||||
$sQuery = "SELECT DISTINCT count(appId) as total
|
$sQuery = "SELECT DISTINCT count(appId) as total
|
||||||
FROM appVersion
|
FROM appVersion
|
||||||
@@ -421,7 +421,7 @@ class Application {
|
|||||||
return $oRow->total;
|
return $oRow->total;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWithRating($sRating, $iOffset, $iItemsPerPage)
|
public static function getWithRating($sRating, $iOffset, $iItemsPerPage)
|
||||||
{
|
{
|
||||||
$aApps = array();
|
$aApps = array();
|
||||||
$sQuery = "SELECT DISTINCT appId
|
$sQuery = "SELECT DISTINCT appId
|
||||||
@@ -440,7 +440,7 @@ class Application {
|
|||||||
return $aApps;
|
return $aApps;
|
||||||
}
|
}
|
||||||
|
|
||||||
function SendNotificationMail($sAction="add",$sMsg=null)
|
private function SendNotificationMail($sAction="add",$sMsg=null)
|
||||||
{
|
{
|
||||||
global $aClean;
|
global $aClean;
|
||||||
if(!isset($aClean['sReplyText']))
|
if(!isset($aClean['sReplyText']))
|
||||||
@@ -502,7 +502,7 @@ class Application {
|
|||||||
|
|
||||||
|
|
||||||
/* output a html table and this applications values to the fields for editing */
|
/* output a html table and this applications values to the fields for editing */
|
||||||
function outputEditor($sVendorName = "")
|
public function outputEditor($sVendorName = "")
|
||||||
{
|
{
|
||||||
HtmlAreaLoaderScript(array("app_editor"));
|
HtmlAreaLoaderScript(array("app_editor"));
|
||||||
|
|
||||||
@@ -591,7 +591,7 @@ class Application {
|
|||||||
echo html_frame_end();
|
echo html_frame_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
function CheckOutputEditorInput($aValues)
|
public function CheckOutputEditorInput($aValues)
|
||||||
{
|
{
|
||||||
$errors = "";
|
$errors = "";
|
||||||
|
|
||||||
@@ -616,7 +616,7 @@ class Application {
|
|||||||
|
|
||||||
/* retrieves values from $aValues that were output by outputEditor() */
|
/* retrieves values from $aValues that were output by outputEditor() */
|
||||||
/* $aValues can be $_REQUEST or any array with the values from outputEditor() */
|
/* $aValues can be $_REQUEST or any array with the values from outputEditor() */
|
||||||
function GetOutputEditorValues($aValues)
|
public function GetOutputEditorValues($aValues)
|
||||||
{
|
{
|
||||||
$this->iAppId = $aValues['iAppId'];
|
$this->iAppId = $aValues['iAppId'];
|
||||||
$this->sName = $aValues['sAppName'];
|
$this->sName = $aValues['sAppName'];
|
||||||
@@ -631,7 +631,7 @@ class Application {
|
|||||||
/**
|
/**
|
||||||
* Displays the SUB apps that belong to this application.
|
* Displays the SUB apps that belong to this application.
|
||||||
*/
|
*/
|
||||||
function displayBundle()
|
public function displayBundle()
|
||||||
{
|
{
|
||||||
$hResult = query_parameters("SELECT appFamily.appId, appName, description FROM appBundle, appFamily ".
|
$hResult = query_parameters("SELECT appFamily.appId, appName, description FROM appBundle, appFamily ".
|
||||||
"WHERE appFamily.queued='false' AND bundleId = '?' AND appBundle.appId = appFamily.appId",
|
"WHERE appFamily.queued='false' AND bundleId = '?' AND appBundle.appId = appFamily.appId",
|
||||||
@@ -666,7 +666,7 @@ class Application {
|
|||||||
echo html_frame_end();
|
echo html_frame_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetCustomTitle($sAction)
|
public function objectGetCustomTitle($sAction)
|
||||||
{
|
{
|
||||||
switch($sAction)
|
switch($sAction)
|
||||||
{
|
{
|
||||||
@@ -679,7 +679,7 @@ class Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* display this application */
|
/* display this application */
|
||||||
function display()
|
public function display()
|
||||||
{
|
{
|
||||||
/* is this user supposed to view this version? */
|
/* is this user supposed to view this version? */
|
||||||
if(!$_SESSION['current']->canViewApplication($this))
|
if(!$_SESSION['current']->canViewApplication($this))
|
||||||
@@ -805,7 +805,7 @@ class Application {
|
|||||||
$this->displayBundle();
|
$this->displayBundle();
|
||||||
}
|
}
|
||||||
|
|
||||||
function lookup_name($appId)
|
public static function lookup_name($appId)
|
||||||
{
|
{
|
||||||
if(!$appId) return null;
|
if(!$appId) return null;
|
||||||
$result = query_parameters("SELECT appName FROM appFamily WHERE appId = '?'",
|
$result = query_parameters("SELECT appName FROM appFamily WHERE appId = '?'",
|
||||||
@@ -817,7 +817,7 @@ class Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* List applications submitted by a given user */
|
/* List applications submitted by a given user */
|
||||||
function listSubmittedBy($iUserId, $bQueued = true)
|
public static function listSubmittedBy($iUserId, $bQueued = true)
|
||||||
{
|
{
|
||||||
$hResult = query_parameters("SELECT appId, appName, vendorId, description,
|
$hResult = query_parameters("SELECT appId, appName, vendorId, description,
|
||||||
submitTime FROM appFamily
|
submitTime FROM appFamily
|
||||||
@@ -861,20 +861,20 @@ class Application {
|
|||||||
return $oTable->GetString();
|
return $oTable->GetString();
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectMakeUrl()
|
public function objectMakeUrl()
|
||||||
{
|
{
|
||||||
$sUrl = APPDB_ROOT."objectManager.php?sClass=application&iId=$this->iAppId";
|
$sUrl = APPDB_ROOT."objectManager.php?sClass=application&iId=$this->iAppId";
|
||||||
return $sUrl;
|
return $sUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectMakeLink()
|
public function objectMakeLink()
|
||||||
{
|
{
|
||||||
$sLink = "<a href=\"".$this->objectMakeUrl()."\">".
|
$sLink = "<a href=\"".$this->objectMakeUrl()."\">".
|
||||||
$this->sName."</a>";
|
$this->sName."</a>";
|
||||||
return $sLink;
|
return $sLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetEntries($bQueued, $bRejected, $iRows = 0, $iStart = 0, $sOrderBy = "appId")
|
public static function objectGetEntries($bQueued, $bRejected, $iRows = 0, $iStart = 0, $sOrderBy = "appId")
|
||||||
{
|
{
|
||||||
$sLimit = "";
|
$sLimit = "";
|
||||||
|
|
||||||
@@ -930,7 +930,7 @@ class Application {
|
|||||||
return $hResult;
|
return $hResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetHeader()
|
public static function objectGetHeader()
|
||||||
{
|
{
|
||||||
$oTableRow = new TableRow();
|
$oTableRow = new TableRow();
|
||||||
$oTableRow->AddTextCell("Submission Date");
|
$oTableRow->AddTextCell("Submission Date");
|
||||||
@@ -940,7 +940,7 @@ class Application {
|
|||||||
return $oTableRow;
|
return $oTableRow;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetTableRow()
|
public function objectGetTableRow()
|
||||||
{
|
{
|
||||||
$oUser = new user($this->iSubmitterId);
|
$oUser = new user($this->iSubmitterId);
|
||||||
$oVendor = new vendor($this->iVendorId);
|
$oVendor = new vendor($this->iVendorId);
|
||||||
@@ -957,7 +957,7 @@ class Application {
|
|||||||
return $oOMTableRow;
|
return $oOMTableRow;
|
||||||
}
|
}
|
||||||
|
|
||||||
function canEdit()
|
public function canEdit()
|
||||||
{
|
{
|
||||||
if($_SESSION['current']->hasPriv("admin"))
|
if($_SESSION['current']->hasPriv("admin"))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -978,7 +978,7 @@ class Application {
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
function mustBeQueued()
|
public function mustBeQueued()
|
||||||
{
|
{
|
||||||
if($_SESSION['current']->hasPriv("admin"))
|
if($_SESSION['current']->hasPriv("admin"))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -986,7 +986,7 @@ class Application {
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectDisplayQueueProcessingHelp()
|
public function objectDisplayQueueProcessingHelp()
|
||||||
{
|
{
|
||||||
echo "<p>This is the list of applications waiting for your approval, ".
|
echo "<p>This is the list of applications waiting for your approval, ".
|
||||||
"or to be rejected.</p>\n";
|
"or to be rejected.</p>\n";
|
||||||
@@ -994,7 +994,7 @@ class Application {
|
|||||||
"From that page you can edit, delete or approve it into the AppDB.</p>\n";
|
"From that page you can edit, delete or approve it into the AppDB.</p>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectDisplayAddItemHelp()
|
public function objectDisplayAddItemHelp()
|
||||||
{
|
{
|
||||||
/* We don't display the full help on the page where you only input the app name */
|
/* We don't display the full help on the page where you only input the app name */
|
||||||
if(!$this->sName)
|
if(!$this->sName)
|
||||||
@@ -1032,7 +1032,7 @@ class Application {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetEntriesCount($bQueued, $bRejected)
|
public static function objectGetEntriesCount($bQueued, $bRejected)
|
||||||
{
|
{
|
||||||
$sQueued = objectManager::getQueueString($bQueued, $bRejected);
|
$sQueued = objectManager::getQueueString($bQueued, $bRejected);
|
||||||
|
|
||||||
@@ -1063,7 +1063,7 @@ class Application {
|
|||||||
return $oRow->count;
|
return $oRow->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getVersions($bIncludeObsolete = TRUE)
|
public function getVersions($bIncludeObsolete = TRUE)
|
||||||
{
|
{
|
||||||
$aVersions = array();
|
$aVersions = array();
|
||||||
|
|
||||||
@@ -1077,7 +1077,7 @@ class Application {
|
|||||||
|
|
||||||
/* Make a drop-down list of this application's versions. Optionally set the default
|
/* Make a drop-down list of this application's versions. Optionally set the default
|
||||||
versionId, a version to exclude and whether to not show obsolete versions */
|
versionId, a version to exclude and whether to not show obsolete versions */
|
||||||
function makeVersionDropDownList($sVarName, $iCurrentId = null, $iExclude = null, $bIncludeObsolete = TRUE)
|
public function makeVersionDropDownList($sVarName, $iCurrentId = null, $iExclude = null, $bIncludeObsolete = TRUE)
|
||||||
{
|
{
|
||||||
$sMsg = "<select name=\"$sVarName\">\n";
|
$sMsg = "<select name=\"$sVarName\">\n";
|
||||||
foreach($this->getVersions() as $oVersion)
|
foreach($this->getVersions() as $oVersion)
|
||||||
@@ -1098,7 +1098,7 @@ class Application {
|
|||||||
return $sMsg;
|
return $sMsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetChildren()
|
public function objectGetChildren()
|
||||||
{
|
{
|
||||||
$aChildren = array();
|
$aChildren = array();
|
||||||
|
|
||||||
@@ -1140,7 +1140,7 @@ class Application {
|
|||||||
return $aChildren;
|
return $aChildren;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectMoveChildren($iNewId)
|
public function objectMoveChildren($iNewId)
|
||||||
{
|
{
|
||||||
/* Keep track of how many children we have moved */
|
/* Keep track of how many children we have moved */
|
||||||
$iCount = 0;
|
$iCount = 0;
|
||||||
@@ -1159,17 +1159,17 @@ class Application {
|
|||||||
return $iCount;
|
return $iCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
function allowAnonymousSubmissions()
|
public static function allowAnonymousSubmissions()
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetId()
|
public function objectGetId()
|
||||||
{
|
{
|
||||||
return $this->iAppId;
|
return $this->iAppId;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectShowAddEntry()
|
public function objectShowAddEntry()
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,18 +60,10 @@ class queuedEntries
|
|||||||
//TODO: would like to rely on the constructor but we might be a user with 'admin'
|
//TODO: would like to rely on the constructor but we might be a user with 'admin'
|
||||||
// privileges and that would mean we would end up retrieved queued versions for
|
// privileges and that would mean we would end up retrieved queued versions for
|
||||||
// this application or unqueued versions depending on which user we were
|
// this application or unqueued versions depending on which user we were
|
||||||
$hResult = $oApp->_internal_retrieve_all_versions();
|
$aVersions = $oApp->getVersions();
|
||||||
|
|
||||||
while($oVersionRow = query_fetch_object($hResult))
|
foreach($aVersions as $oVersion)
|
||||||
{
|
{
|
||||||
if($bDebugOutputEnabled)
|
|
||||||
{
|
|
||||||
echo "oVersionRow is: ";
|
|
||||||
print_r($oVersionRow);
|
|
||||||
}
|
|
||||||
|
|
||||||
$oVersion = new Version($oVersionRow->versionId);
|
|
||||||
|
|
||||||
if($bDebugOutputEnabled)
|
if($bDebugOutputEnabled)
|
||||||
{
|
{
|
||||||
echo "Processing version: ";
|
echo "Processing version: ";
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class version {
|
|||||||
/**
|
/**
|
||||||
* constructor, fetches the data.
|
* constructor, fetches the data.
|
||||||
*/
|
*/
|
||||||
function Version($iVersionId = null, $oRow = null)
|
public function Version($iVersionId = null, $oRow = null)
|
||||||
{
|
{
|
||||||
// we are working on an existing version
|
// we are working on an existing version
|
||||||
if(!$iVersionId && !$oRow)
|
if(!$iVersionId && !$oRow)
|
||||||
@@ -82,7 +82,7 @@ class version {
|
|||||||
/**
|
/**
|
||||||
* Creates a new version.
|
* Creates a new version.
|
||||||
*/
|
*/
|
||||||
function create()
|
public function create()
|
||||||
{
|
{
|
||||||
if(!$_SESSION['current']->canCreateVersion())
|
if(!$_SESSION['current']->canCreateVersion())
|
||||||
return;
|
return;
|
||||||
@@ -130,7 +130,7 @@ class version {
|
|||||||
/**
|
/**
|
||||||
* Update version.
|
* Update version.
|
||||||
*/
|
*/
|
||||||
function update($bSilent=false)
|
public function update($bSilent=false)
|
||||||
{
|
{
|
||||||
$sWhatChanged = "";
|
$sWhatChanged = "";
|
||||||
|
|
||||||
@@ -232,7 +232,7 @@ class version {
|
|||||||
* Deletes the version from the database.
|
* Deletes the version from the database.
|
||||||
* and request the deletion of linked elements.
|
* and request the deletion of linked elements.
|
||||||
*/
|
*/
|
||||||
function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
/* We need the versionId to continue */
|
/* We need the versionId to continue */
|
||||||
if(!$this->iVersionId)
|
if(!$this->iVersionId)
|
||||||
@@ -263,7 +263,7 @@ class version {
|
|||||||
/**
|
/**
|
||||||
* Move version out of the queue.
|
* Move version out of the queue.
|
||||||
*/
|
*/
|
||||||
function unQueue()
|
public function unQueue()
|
||||||
{
|
{
|
||||||
if(!$_SESSION['current']->canUnQueueVersion($this))
|
if(!$_SESSION['current']->canUnQueueVersion($this))
|
||||||
return;
|
return;
|
||||||
@@ -294,7 +294,7 @@ class version {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Reject($bSilent=false)
|
public function Reject($bSilent=false)
|
||||||
{
|
{
|
||||||
if(!$_SESSION['current']->canRejectVersion($this))
|
if(!$_SESSION['current']->canRejectVersion($this))
|
||||||
return;
|
return;
|
||||||
@@ -318,7 +318,7 @@ class version {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function ReQueue()
|
public function ReQueue()
|
||||||
{
|
{
|
||||||
if(!$_SESSION['current']->canRequeueVersion($this))
|
if(!$_SESSION['current']->canRequeueVersion($this))
|
||||||
return;
|
return;
|
||||||
@@ -335,17 +335,18 @@ class version {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetSubmitterId()
|
public function objectGetSubmitterId()
|
||||||
{
|
{
|
||||||
return $this->iSubmitterId;
|
return $this->iSubmitterId;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetMailOptions($sAction, $bMailSubmitter, $bParentAction)
|
public static function objectGetMailOptions($sAction, $bMailSubmitter,
|
||||||
|
$bParentAction)
|
||||||
{
|
{
|
||||||
return new mailOptions();
|
return new mailOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetMail($sAction, $bMailSubmitter, $bParentAction)
|
public function objectGetMail($sAction, $bMailSubmitter, $bParentAction)
|
||||||
{
|
{
|
||||||
$oApp = new application($this->iAppId);
|
$oApp = new application($this->iAppId);
|
||||||
|
|
||||||
@@ -375,7 +376,7 @@ class version {
|
|||||||
return array($sSubject, $sMsg, $aMailTo);
|
return array($sSubject, $sMsg, $aMailTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
function mailSubmitter($sAction="add")
|
private function mailSubmitter($sAction="add")
|
||||||
{
|
{
|
||||||
global $aClean; //FIXME: we should pass the sReplyText value in
|
global $aClean; //FIXME: we should pass the sReplyText value in
|
||||||
|
|
||||||
@@ -411,7 +412,7 @@ class version {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function SendNotificationMail($sAction="add",$sMsg=null)
|
private function SendNotificationMail($sAction="add",$sMsg=null)
|
||||||
{
|
{
|
||||||
global $aClean;
|
global $aClean;
|
||||||
|
|
||||||
@@ -485,7 +486,7 @@ class version {
|
|||||||
mail_appdb($sEmail, $sSubject ,$sMsg);
|
mail_appdb($sEmail, $sSubject ,$sMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_buglink_ids()
|
public function get_buglink_ids()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* We fetch Bug linkIds.
|
* We fetch Bug linkIds.
|
||||||
@@ -508,7 +509,7 @@ class version {
|
|||||||
|
|
||||||
/* Makes a frame with title 'Mark as obsolete' and info about what it means, plus
|
/* Makes a frame with title 'Mark as obsolete' and info about what it means, plus
|
||||||
caller-defined content */
|
caller-defined content */
|
||||||
function makeObsoleteFrame($sContent = "")
|
private static function makeObsoleteFrame($sContent = "")
|
||||||
{
|
{
|
||||||
$sMsg = html_frame_start("Mark as obsolete", "90%", "", 0);
|
$sMsg = html_frame_start("Mark as obsolete", "90%", "", 0);
|
||||||
|
|
||||||
@@ -530,7 +531,7 @@ class version {
|
|||||||
/* if $editParentApplication is true that means we need to display fields */
|
/* if $editParentApplication is true that means we need to display fields */
|
||||||
/* to let the user change the parent application of this version */
|
/* to let the user change the parent application of this version */
|
||||||
/* otherwise, if $editParentAppliation is false, we leave them out */
|
/* otherwise, if $editParentAppliation is false, we leave them out */
|
||||||
function outputEditor()
|
public function outputEditor()
|
||||||
{
|
{
|
||||||
HtmlAreaLoaderScript(array("version_editor"));
|
HtmlAreaLoaderScript(array("version_editor"));
|
||||||
echo html_frame_start("Version Form", "90%", "", 0);
|
echo html_frame_start("Version Form", "90%", "", 0);
|
||||||
@@ -687,7 +688,7 @@ class version {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function CheckOutputEditorInput($aValues)
|
public function CheckOutputEditorInput($aValues)
|
||||||
{
|
{
|
||||||
$errors = "";
|
$errors = "";
|
||||||
|
|
||||||
@@ -702,7 +703,7 @@ class version {
|
|||||||
|
|
||||||
/* retrieves values from $aValues that were output by outputEditor() */
|
/* retrieves values from $aValues that were output by outputEditor() */
|
||||||
/* $aValues can be $_REQUEST or any array with the values from outputEditor() */
|
/* $aValues can be $_REQUEST or any array with the values from outputEditor() */
|
||||||
function GetOutputEditorValues($aValues)
|
public function GetOutputEditorValues($aValues)
|
||||||
{
|
{
|
||||||
$this->iAppId = $aValues['iAppId'];
|
$this->iAppId = $aValues['iAppId'];
|
||||||
$this->iVersionId = $aValues['iVersionId'];
|
$this->iVersionId = $aValues['iVersionId'];
|
||||||
@@ -719,7 +720,7 @@ class version {
|
|||||||
$this->iObsoleteBy = 0;
|
$this->iObsoleteBy = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetCustomTitle($sAction)
|
public function objectGetCustomTitle($sAction)
|
||||||
{
|
{
|
||||||
switch($sAction)
|
switch($sAction)
|
||||||
{
|
{
|
||||||
@@ -731,7 +732,7 @@ class version {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetCustomVars($sAction)
|
public static function objectGetCustomVars($sAction)
|
||||||
{
|
{
|
||||||
switch($sAction)
|
switch($sAction)
|
||||||
{
|
{
|
||||||
@@ -745,7 +746,7 @@ class version {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function display($aVars)
|
public function display($aVars)
|
||||||
{
|
{
|
||||||
/* is this user supposed to view this version? */
|
/* is this user supposed to view this version? */
|
||||||
if(!$_SESSION['current']->canViewVersion($this))
|
if(!$_SESSION['current']->canViewVersion($this))
|
||||||
@@ -1040,7 +1041,7 @@ class version {
|
|||||||
Comment::view_app_comments($this->iVersionId);
|
Comment::view_app_comments($this->iVersionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
function lookup_name($versionId)
|
public static function lookup_name($versionId)
|
||||||
{
|
{
|
||||||
if(!$versionId) return null;
|
if(!$versionId) return null;
|
||||||
$result = query_parameters("SELECT versionName FROM appVersion WHERE versionId = '?'",
|
$result = query_parameters("SELECT versionName FROM appVersion WHERE versionId = '?'",
|
||||||
@@ -1070,7 +1071,7 @@ class version {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Creates a link to the version labelled with the full application name */
|
/* Creates a link to the version labelled with the full application name */
|
||||||
function fullNameLink($iVersionId)
|
public static function fullNameLink($iVersionId)
|
||||||
{
|
{
|
||||||
$oVersion = new version($iVersionId);
|
$oVersion = new version($iVersionId);
|
||||||
$sLink = "<a href=\"".$oVersion->objectMakeUrl()."\">".
|
$sLink = "<a href=\"".$oVersion->objectMakeUrl()."\">".
|
||||||
@@ -1079,7 +1080,7 @@ class version {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// display the versions
|
// display the versions
|
||||||
function displayList($aVersionsIds)
|
public static function displayList($aVersionsIds)
|
||||||
{
|
{
|
||||||
if ($aVersionsIds)
|
if ($aVersionsIds)
|
||||||
{
|
{
|
||||||
@@ -1190,7 +1191,7 @@ class version {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* returns the maintainers of this version in an array */
|
/* returns the maintainers of this version in an array */
|
||||||
function getMaintainersUserIds()
|
public function getMaintainersUserIds()
|
||||||
{
|
{
|
||||||
$aMaintainers = array();
|
$aMaintainers = array();
|
||||||
|
|
||||||
@@ -1210,7 +1211,7 @@ class version {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* List the versions submitted by a user. Ignore versions for queued applications */
|
/* List the versions submitted by a user. Ignore versions for queued applications */
|
||||||
function listSubmittedBy($iUserId, $bQueued = true)
|
public static function listSubmittedBy($iUserId, $bQueued = true)
|
||||||
{
|
{
|
||||||
$hResult = query_parameters("SELECT appFamily.appName, appVersion.versionName, appVersion.description, appVersion.versionId, appVersion.submitTime FROM appFamily, appVersion WHERE appFamily.appId = appVersion.appId AND appVersion.submitterId = '?' AND appVersion.queued = '?' AND appFamily.queued = '?'", $iUserId, $bQueued ? "true" : "false", "false");
|
$hResult = query_parameters("SELECT appFamily.appName, appVersion.versionName, appVersion.description, appVersion.versionId, appVersion.submitTime FROM appFamily, appVersion WHERE appFamily.appId = appVersion.appId AND appVersion.submitterId = '?' AND appVersion.queued = '?' AND appFamily.queued = '?'", $iUserId, $bQueued ? "true" : "false", "false");
|
||||||
|
|
||||||
@@ -1244,7 +1245,7 @@ class version {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// returns a string containing the html for a selection list
|
// returns a string containing the html for a selection list
|
||||||
function makeLicenseList($sLicense = NULL)
|
private function makeLicenseList($sLicense = NULL)
|
||||||
{
|
{
|
||||||
if(!$sLicense)
|
if(!$sLicense)
|
||||||
$sLicense = $this->sLicense;
|
$sLicense = $this->sLicense;
|
||||||
@@ -1272,7 +1273,7 @@ class version {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* In order to prevent MySQL injections. Returns matched license */
|
/* In order to prevent MySQL injections. Returns matched license */
|
||||||
function checkLicense($sLicense)
|
public static function checkLicense($sLicense)
|
||||||
{
|
{
|
||||||
$aLicense = array(LICENSE_RETAIL, LICENSE_OPENSOURCE, LICENSE_FREEWARE,
|
$aLicense = array(LICENSE_RETAIL, LICENSE_OPENSOURCE, LICENSE_FREEWARE,
|
||||||
LICENSE_DEMO, LICENSE_SHAREWARE);
|
LICENSE_DEMO, LICENSE_SHAREWARE);
|
||||||
@@ -1286,19 +1287,19 @@ class version {
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectMakeUrl()
|
public function objectMakeUrl()
|
||||||
{
|
{
|
||||||
return APPDB_ROOT."objectManager.php?sClass=version&iId=$this->iVersionId";
|
return APPDB_ROOT."objectManager.php?sClass=version&iId=$this->iVersionId";
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectMakeLink()
|
public function objectMakeLink()
|
||||||
{
|
{
|
||||||
$sLink = "<a href=\"".$this->objectMakeUrl()."\">".
|
$sLink = "<a href=\"".$this->objectMakeUrl()."\">".
|
||||||
$this->sName."</a>";
|
$this->sName."</a>";
|
||||||
return $sLink;
|
return $sLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetEntriesCount($bQueued, $bRejected)
|
public static function objectGetEntriesCount($bQueued, $bRejected)
|
||||||
{
|
{
|
||||||
$sQueued = objectManager::getQueueString($bQueued, $bRejected);
|
$sQueued = objectManager::getQueueString($bQueued, $bRejected);
|
||||||
|
|
||||||
@@ -1366,7 +1367,7 @@ class version {
|
|||||||
return $oRow->count;
|
return $oRow->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
function canEdit()
|
public function canEdit()
|
||||||
{
|
{
|
||||||
if($_SESSION['current']->hasPriv("admin"))
|
if($_SESSION['current']->hasPriv("admin"))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -1385,7 +1386,7 @@ class version {
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
function mustBeQueued()
|
public function mustBeQueued()
|
||||||
{
|
{
|
||||||
if($_SESSION['current']->hasPriv("admin"))
|
if($_SESSION['current']->hasPriv("admin"))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -1415,7 +1416,7 @@ class version {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetHeader()
|
public static function objectGetHeader()
|
||||||
{
|
{
|
||||||
$oTableRow = new TableRow();
|
$oTableRow = new TableRow();
|
||||||
$oTableRow->AddTextCell("Submission Date");
|
$oTableRow->AddTextCell("Submission Date");
|
||||||
@@ -1426,14 +1427,14 @@ class version {
|
|||||||
return $oTableRow;
|
return $oTableRow;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetItemsPerPage($bQueued = false)
|
public static function objectGetItemsPerPage($bQueued = false)
|
||||||
{
|
{
|
||||||
$aItemsPerPage = array(25, 50, 100, 200);
|
$aItemsPerPage = array(25, 50, 100, 200);
|
||||||
$iDefaultPerPage = 25;
|
$iDefaultPerPage = 25;
|
||||||
return array($aItemsPerPage, $iDefaultPerPage);
|
return array($aItemsPerPage, $iDefaultPerPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetEntries($bQueued, $bRejected, $iRows = 0, $iStart = 0, $sOrderBy = "versionId")
|
public static function objectGetEntries($bQueued, $bRejected, $iRows = 0, $iStart = 0, $sOrderBy = "versionId")
|
||||||
{
|
{
|
||||||
$sQueued = objectManager::getQueueString($bQueued, $bRejected);
|
$sQueued = objectManager::getQueueString($bQueued, $bRejected);
|
||||||
|
|
||||||
@@ -1526,7 +1527,7 @@ class version {
|
|||||||
return $hResult;
|
return $hResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetTableRow()
|
public function objectGetTableRow()
|
||||||
{
|
{
|
||||||
$oUser = new user($this->iSubmitterId);
|
$oUser = new user($this->iSubmitterId);
|
||||||
$oApp = new application($this->iAppId);
|
$oApp = new application($this->iAppId);
|
||||||
@@ -1543,7 +1544,7 @@ class version {
|
|||||||
return $oOMTableRow;
|
return $oOMTableRow;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectDisplayQueueProcessingHelp()
|
public function objectDisplayQueueProcessingHelp()
|
||||||
{
|
{
|
||||||
echo "<p>This is the list of versions waiting for your approval, ".
|
echo "<p>This is the list of versions waiting for your approval, ".
|
||||||
"or to be rejected.</p>\n";
|
"or to be rejected.</p>\n";
|
||||||
@@ -1551,7 +1552,7 @@ class version {
|
|||||||
"From that page you can edit, delete or approve it into the AppDB.</p>\n";
|
"From that page you can edit, delete or approve it into the AppDB.</p>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetChildren()
|
public function objectGetChildren()
|
||||||
{
|
{
|
||||||
$aChildren = array();
|
$aChildren = array();
|
||||||
|
|
||||||
@@ -1678,7 +1679,7 @@ class version {
|
|||||||
return $aChildren;
|
return $aChildren;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectMoveChildren($iNewId)
|
public function objectMoveChildren($iNewId)
|
||||||
{
|
{
|
||||||
/* Keep track of how many items we have updated */
|
/* Keep track of how many items we have updated */
|
||||||
$iCount = 0;
|
$iCount = 0;
|
||||||
@@ -1721,12 +1722,12 @@ class version {
|
|||||||
return $iCount;
|
return $iCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
function allowAnonymousSubmissions()
|
public static function allowAnonymousSubmissions()
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetId()
|
public function objectGetId()
|
||||||
{
|
{
|
||||||
return $this->iVersionId;
|
return $this->iVersionId;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user