[TYPO3] 'wfqbe' how to search date?

Junaid Mansoor Sootwala junaid.mansoor at rsgohar.com
Sun Sep 23 13:29:25 CEST 2007


Hi,

I am currently trying to integrate wfqbe in my custom made extension 
'graveyard'. Problem is that dates are stored in UNIX TIMESTAMP format 
while search string is a normal date e.g. dd-mm-yyyy. Through 
documentation I know that a hook is used for that purpose.

"ProcessSubstituteSearchParametersClass: this can be used to manipulate 
search parameters from a search form before executing the results query. 
For example, this is useful to convert a date parameter from a 
“dd-mm-yyyy” format to a timestamp before executing a query."

But unfortunatly I was unable to do it.

Here is what I done:

First of all I created an extension and to insereted the following line 
in the ext_localconf.php file:

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['wfqbe']['ProcessSubstituteSearchParametersClass'][] 
= 
'EXT:graveyard/res/class.tx_wfqbe_processsubstitutesearch.php:processSubstituteSearch';

(no line breaks)

Then i created a file in my extension folder 
typo3conf/ext/graveyard/res/class.tx_wfqbe_processsubstitutesearch.php

with the follwing contents:

<?php

class tx_wfqbe_processsubstitutesearch {
/*
First of all you have to create an extension and to put the following
line in the ext_localconf.php file:

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['wfqbe']['ProcessSubstituteSearchParametersClass'][] 
= 
'EXT:graveyard/res/class.tx_wfqbe_processsubstitutesearch.php:processSubstituteSearch';

*/
//..........................................................................
function tx_wfqbe_processsubstitutesearch() {
}


//..........................................................................
function processSubstituteSearch($wfqbe, $piVars, $query_uid, &$callingObj)
{
$remove = array();

// Query to be processed
// if ($query_uid==65) {
$markers = array(
"ISSUE_DATE"
);
foreach ($markers as $marcatore) {
if ($piVars[$marcatore]=='' ||
(is_array($piVars[$marcatore]) && $piVars[$marcatore][0]=='')) {
foreach ($wfqbe[0]['select'] as $key => $value) {
echo "Message by Junaid - The value of " .$key. " is " . $value;
}
}
}
// }
return $remove;
}
}

?>

By the ways issue_date is a field containing date in unix timestamp 
format. Please help me!

Thanks in advance

Junaid Mansoor Sootwala



More information about the TYPO3-english mailing list