Fixed Trac #258: cleanup of application context parameters.

SVN:trunk[908]
This commit is contained in:
Denis Flaven
2010-10-20 15:55:30 +00:00
parent 1808e5fe65
commit adaf3a376c
14 changed files with 92 additions and 53 deletions

View File

@@ -899,7 +899,8 @@ EOF
}
$aOptions[MetaModel::GetName($sClassName)] = "<option selected value=\"$sClassName\">".MetaModel::GetName($sClassName)."</options>\n";
ksort($aOptions);
$sClassesCombo = "<select name=\"class\" onChange=\"ReloadSearchForm('$sSearchFormId', this.value, '$sRootClass')\">\n".implode('', $aOptions)."</select>\n";
$sContext = $oAppContext->GetForLink();
$sClassesCombo = "<select name=\"class\" onChange=\"ReloadSearchForm('$sSearchFormId', this.value, '$sRootClass', '$sContext')\">\n".implode('', $aOptions)."</select>\n";
}
else
{
@@ -919,7 +920,7 @@ EOF
$aList = MetaModel::GetZListItems($sClassName, 'standard_search');
foreach($aList as $sFilterCode)
{
$oAppContext->Reset($sFilterCode); // Make sure the same parameter will not be passed twice
//$oAppContext->Reset($sFilterCode); // Make sure the same parameter will not be passed twice
$sHtml .= '<span style="white-space: nowrap;padding:5px;display:inline-block;">';
$sFilterValue = '';
$sFilterValue = utils::ReadParam($sFilterCode, '');
@@ -1607,5 +1608,15 @@ EOF
}
return $aResult;
}
/**
* Maps the given context parameter name to the appropriate filter/search code for this class
* @param string $sContextParam Name of the context parameter, i.e. 'org_id'
* @return string Filter code, i.e. 'customer_id'
*/
public static function MapContextParam($sContextParam)
{
return $sContextParam;
}
}
?>