本文整理汇总了PHP中WebPage::PostedParamsToFilter方法的典型用法代码示例。如果您正苦于以下问题:PHP WebPage::PostedParamsToFilter方法的具体用法?PHP WebPage::PostedParamsToFilter怎么用?PHP WebPage::PostedParamsToFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebPage
的用法示例。
在下文中一共展示了WebPage::PostedParamsToFilter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ListClosedTickets
/**
* Lists all the currently closed tickets
* @param WebPage $oP The current web page
* @return void
*/
function ListClosedTickets(WebPage $oP)
{
$aAttSpecs = explode(',', PORTAL_TICKETS_SEARCH_CRITERIA);
// Remove the caller_id form the search criteria if the user is not a Portal Power User
// since the user is only allowed to see her/his own tickets
foreach ($aAttSpecs as $idx => $sAttCode) {
if ($sAttCode == 'caller_id' && !IsPowerUser()) {
unset($aAttSpecs[$idx]);
}
}
$aClasses = GetTicketClasses();
$sMainClass = reset($aClasses);
$oP->DisplaySearchForm($sMainClass, $aAttSpecs, array('operation' => 'show_closed'), 'search_', false);
$oUserOrg = GetUserOrg();
$oP->add("<h1>" . Dict::S('Portal:ClosedRequests') . "</h1>\n");
$aClassToSet = array();
foreach (GetTicketClasses() as $sClass) {
$oSearch = $oP->PostedParamsToFilter($sClass, $aAttSpecs, 'search_');
if (is_null($oSearch)) {
$oSearch = new DBObjectSearch($sClass);
}
$oSearch->AddCondition('org_id', $oUserOrg->GetKey());
$oSearch->AddCondition('status', 'closed');
$iUser = UserRights::GetContactId();
if ($iUser > 0 && !IsPowerUser()) {
$oSearch->AddCondition('caller_id', $iUser);
}
$aClassToSet[$sClass] = new CMDBObjectSet($oSearch);
}
DisplayRequestLists($oP, $aClassToSet);
}