Use multipage controls for application lists
This commit is contained in:
committed by
WineHQ
parent
f37fa6e42f
commit
09107d7142
@@ -343,6 +343,14 @@ class Application {
|
|||||||
addmsg("The application has been rejected.", "green");
|
addmsg("The application has been rejected.", "green");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function objectGetItemsPerPage($bQueued = false)
|
||||||
|
{
|
||||||
|
$aItemsPerPage = array(25, 50, 100, 200);
|
||||||
|
$iDefaultPerPage = 25;
|
||||||
|
return array($aItemsPerPage, $iDefaultPerPage);
|
||||||
|
}
|
||||||
|
|
||||||
function ReQueue()
|
function ReQueue()
|
||||||
{
|
{
|
||||||
if(!$_SESSION['current']->canRequeueApplication($this))
|
if(!$_SESSION['current']->canRequeueApplication($this))
|
||||||
@@ -818,8 +826,21 @@ class Application {
|
|||||||
return $sLink;
|
return $sLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetEntries($bQueued, $bRejected, $sOrderBy = "appId")
|
function objectGetEntries($bQueued, $bRejected, $iRows = 0, $iStart = 0, $sOrderBy = "appId")
|
||||||
{
|
{
|
||||||
|
$sLimit = "";
|
||||||
|
|
||||||
|
/* Should we add a limit clause to the query? */
|
||||||
|
if($iRows || $iStart)
|
||||||
|
{
|
||||||
|
$sLimit = " LIMIT ?,?";
|
||||||
|
|
||||||
|
/* Selecting 0 rows makes no sense, so we assume the user wants to select all of them
|
||||||
|
after an offset given by iStart */
|
||||||
|
if(!$iRows)
|
||||||
|
$iRows = maintainer::objectGetEntriesCount($bQueued, $bRejected);
|
||||||
|
}
|
||||||
|
|
||||||
$sQuery = "SELECT * FROM appFamily WHERE
|
$sQuery = "SELECT * FROM appFamily WHERE
|
||||||
appFamily.queued = '?'";
|
appFamily.queued = '?'";
|
||||||
|
|
||||||
@@ -831,14 +852,29 @@ class Application {
|
|||||||
if(!$bRejected)
|
if(!$bRejected)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
$sQuery .= " AND appFamily.submitterId = '?' ORDER BY '?'";
|
$sQuery .= " AND appFamily.submitterId = '?' ORDER BY '?'$sLimit";
|
||||||
|
if($sLimit)
|
||||||
|
{
|
||||||
$hResult = query_parameters($sQuery, $sQueued,
|
$hResult = query_parameters($sQuery, $sQueued,
|
||||||
$_SESSION['current']->iUserId, $sOrderBy);
|
$_SESSION['current']->iUserId, $sOrderBy,
|
||||||
|
$iStart, $iRows);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
$hResult = query_parameters($sQuery, $sQueued,
|
||||||
|
$_SESSION['current']->iUserId, $sOrderBy);
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
$sQuery .= " ORDER BY '?'$sLimit";
|
||||||
|
if($sLimit)
|
||||||
|
{
|
||||||
|
$hResult = query_parameters($sQuery, $sQueued, $sOrderBy,
|
||||||
|
$iStart, $iRows);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
$sQuery .= " ORDER BY '?'";
|
|
||||||
$hResult = query_parameters($sQuery, $sQueued, $sOrderBy);
|
$hResult = query_parameters($sQuery, $sQueued, $sOrderBy);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|||||||
@@ -292,9 +292,20 @@ class application_queue
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetEntries($bQueued, $bRejected)
|
function objectGetItemsPerPage($bQueued = false)
|
||||||
{
|
{
|
||||||
return $this->oApp->objectGetEntries($bQueued, $bRejected);
|
return $this->oApp->objectGetItemsPerPage($bQueued);
|
||||||
|
}
|
||||||
|
|
||||||
|
function objectGetEntriesCount($bQueued, $bRejected)
|
||||||
|
{
|
||||||
|
return $this->oApp->objectGetEntriesCount($bQueued, $bRejected);
|
||||||
|
}
|
||||||
|
|
||||||
|
function objectGetEntries($bQueued, $bRejected, $iRows = 0, $iStart = 0, $sOrderBy = "appId")
|
||||||
|
{
|
||||||
|
return $this->oApp->objectGetEntries($bQueued, $bRejected, $iRows, $iStart,
|
||||||
|
$sOrderBy);
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetHeader()
|
function objectGetHeader()
|
||||||
|
|||||||
Reference in New Issue
Block a user