本文整理匯總了PHP中WebPage::DisplaySearchForm方法的典型用法代碼示例。如果您正苦於以下問題:PHP WebPage::DisplaySearchForm方法的具體用法?PHP WebPage::DisplaySearchForm怎麽用?PHP WebPage::DisplaySearchForm使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WebPage
的用法示例。
在下文中一共展示了WebPage::DisplaySearchForm方法的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);
}