var resultsStr = "";
var filterStatus = false;
var filterFields = arguments.filterCriteria;
// Filter local vars
var textStr = "";
var searchType = "";
var termID = "";
var deptID = "";
if ( StructKeyExists(filterFields,"dsFilterTextStr") )
textStr = filterFields.dsFilterTextStr;
if ( LEN(TRIM(textStr)) )
filterStatus = true;
if ( StructKeyExists(filterFields,"dsFilterSearchType") )
searchType = filterFields.dsFilterSearchType;
if ( LEN(TRIM(searchType)) )
filterStatus = true;
if ( StructKeyExists(filterFields,"dsFilterTermID") AND LEN(TRIM(filterFields.dsFilterTermID)) )
termID = filterFields.dsFilterTermID;
if ( LEN(TRIM(termID)) )
filterStatus = true;
if ( StructKeyExists(filterFields,"dsFilterDeptID") AND LEN(TRIM(filterFields.dsFilterDeptID)) )
deptID = filterFields.dsFilterDeptID;
if ( LEN(TRIM(deptID)) )
filterStatus = true;
// Pass the filters to the the Search DAO to get back the story ID list
resultsStr = variables.courseSearchDAO.getCourseIDListByCriteria(
searchStr=textStr
,searchType=searchType
,termIDlist=termID
,deptIDlist=deptID
);
retStruct.filterIDlist = resultsStr;
retStruct.filterStatus = filterStatus;
return retStruct;
var filterFields = arguments.filterCriteria;
var key = "";
if ( NOT StructKeyExists(session,"ptCourseCatalog") )
session.ptCourseCatalog = StructNew();
if ( NOT StructKeyExists(session.ptCourseCatalog,"courseSearch") )
session.ptCourseCatalog.courseSearch = StructNew();
if ( NOT StructKeyExists(session.ptCourseCatalog.courseSearch,"filterCriteria") )
session.ptCourseCatalog.courseSearch.filterCriteria = StructNew();
// Loop over the passed in filter keys
for ( key IN filterFields )
{
if ( FindNoCase("dsFilter",key) )
session.ptCourseCatalog.courseSearch.filterCriteria[key] = filterFields[key];
}
var retStruct = StructNew();
var storedData = StructNew();
if ( StructKeyExists(session,"ptCourseCatalog")
AND StructKeyExists(session.ptCourseCatalog,"courseSearch")
AND StructKeyExists(session.ptCourseCatalog.courseSearch,"filterCriteria") )
{
storedData = session.ptCourseCatalog.courseSearch.filterCriteria;
// Loop over the passed in filter keys
for ( key IN storedData )
{
if ( FindNoCase("dsFilter",key) )
{
retStruct[key] = storedData[key];
// Use this to filter out extra criteria fields
//if ( ListFindNoCase("dsFilterStartDate,dsFilterEndDate",key) EQ 0 )
// retStruct[key] = storedData[key];
}
}
}
return retStruct;
var retResult = false;
if ( StructKeyExists(session,"ptCourseCatalog")
AND StructKeyExists(session.ptCourseCatalog,"courseSearch")
AND StructKeyExists(session.ptCourseCatalog.courseSearch,"filterCriteria") )
{
StructDelete(session.ptCourseCatalog.courseSearch,"filterCriteria");
retResult = true;
}
return retResult;