Project

General

Profile

Bug #2196 ยป 2196.patch

krileon, 25 January 2011 16:19

View differences:

components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php
$minHtml = moscomprofilerHTML::selectList( $choices, $minNam, $additional, 'text', 'value', $minVal, 2 );
$maxHtml = moscomprofilerHTML::selectList( $choices, $maxNam, $additional, 'text', 'value', $maxVal, 2 );
} else {
if ( $minVal !== null ) {
$minVal = date( 'Y-m-d', strtotime( $minVal ) );
}
if ( $maxVal !== null ) {
$maxVal = date( 'Y-m-d', strtotime( $maxVal ) );
}
// Search by date range:
$minHtml = $calendars->cbAddCalendar( $minNam, _UE_SEARCH_FROM . ' ' . $this->getFieldTitle( $field, $user, 'text', $reason ), false, $minVal, false, false, $yMin, $yMax );
$maxHtml = $calendars->cbAddCalendar( $maxNam, _UE_SEARCH_TO . ' ' . $this->getFieldTitle( $field, $user, 'text', $reason ), false, $maxVal, false, false, $yMin, $yMax );
......
$maxVal = null;
}
} else {
$minValIn = $this->_displayDateToSql( stripslashes( cbGetParam( $postdata, $minNam ) ) );
$maxValIn = $this->_displayDateToSql( stripslashes( cbGetParam( $postdata, $maxNam ) ) );
$minVal = $minValIn;
$maxVal = $maxValIn;
$minVal = $this->_displayDateToSql( stripslashes( cbGetParam( $postdata, $minNam ) ) );
$maxVal = $this->_displayDateToSql( stripslashes( cbGetParam( $postdata, $maxNam ) ) );
$minValIn = cbFormatDate( $minVal );
$maxValIn = cbFormatDate( $maxVal );
}
if ( $minVal && ( $minVal !== '0000-00-00' ) ) {
$query[] = $this->_dateToSql( $field, $col, $minVal, '>=', $searchMode );
// Finally store the selected drop-down values so they can be pre-selected on display:
$searchVals->$minNam = cbFormatDate( $minValIn );
$searchVals->$minNam = $minValIn;
if ( ( ! $maxVal ) && $maxValIn ) {
$searchVals->$maxNam = cbFormatDate( $maxValIn );
$searchVals->$maxNam = $maxValIn;
}
}
......
}
// Finally store the selected drop-down values so they can be pre-selected on display:
if ( ( ! $minVal ) && $minValIn ) {
$searchVals->$minNam = cbFormatDate( $minValIn );
$searchVals->$minNam = $minValIn;
}
$searchVals->$maxNam = cbFormatDate( $maxValIn );
$searchVals->$maxNam = $maxValIn;
}
}
}
    (1-1/1)