Thank you. That point is resolved....
I started modifying the script by adding a NUMERIC option after the DATEINTERVAL.
It's more complex then I thought
Steps I've made so far:
1.
oc-includes/osclass/installer/struct.sql
I put
e_type ENUM('TEXT','TEXTAREA','DROPDOWN','RADIO','CHECKBOX','URL', 'DATE', 'DATEINTERVAL','NUMERIC') NOT NULL DEFAULT 'TEXT',
instead of
e_type ENUM('TEXT','TEXTAREA','DROPDOWN','RADIO','CHECKBOX','URL', 'DATE', 'DATEINTERVAL') NOT NULL DEFAULT 'TEXT',
AND I MANUALY edited "t_meta_fields" in DB to contain also 'NUMERIC'2.
oc-includes/osclass/controller/search.php
I put
EDITED I must convert to number with CAST(string AS SIGNED) in order to compare and I removed the a. line because is useless. $this->mSearch->addConditions(DB_TABLE_PREFIX.'t_item.pk_i_id IN ('.$sql_interval.')');
}
break;
case 'NUMERIC':
if( is_array($aux)) {
if(!empty($aux['to']) && empty($aux['from'])) $aux['from'] = '-1000000';
if(!empty($aux['from']) && empty($aux['to'])) $aux['to'] = '10000000';
$from = $aux['from'];
$to = $aux['to'];
$start = Search::newInstance()->dao->escape($from);
$end = Search::newInstance()->dao->escape($to);
$sql = "SELECT fk_i_item_id FROM $table WHERE ";
$sql .= $table.'.fk_i_field_id = '.$key.' AND CAST(';
$sql .= $start." AS SIGNED) <= CAST(".$table.".s_value AS SIGNED) AND CAST(".$end." AS SIGNED) >= CAST(".$table.".s_value AS SIGNED)";
$this->mSearch->addConditions(DB_TABLE_PREFIX.'t_item.pk_i_id IN ('.$sql.')');
}
break;
instead of
$this->mSearch->addConditions(DB_TABLE_PREFIX.'t_item.pk_i_id IN ('.$sql_interval.')');
}
break;
3. This is not needed -> REMOVED
oc-includes/osclass/model/Search.php
4
oc-includes/osclass/frm/Field.form.class.php
I put
<option value="DATEINTERVAL" <?php if($field['e_type']=="DATEINTERVAL") { echo 'selected="selected"';};?>><?php _e('DATE INTERVAL'); ?></option>
<option value="NUMERIC" <?php if($field['e_type']=="NUMERIC") { echo 'selected="selected"';};?>><?php _e('NUMERIC'); ?></option>
instead of
<option value="DATEINTERVAL" <?php if($field['e_type']=="DATEINTERVAL") { echo 'selected="selected"';};?>><?php _e('DATE INTERVAL'); ?></option>
and
foreach($aCustomFields as $field) {
if($field['e_type']=='DATEINTERVAL' || $field['e_type']=='NUMERIC') {
instead of
foreach($aCustomFields as $field) {
if($field['e_type']=='DATEINTERVAL') {
Any other suggestion that may ease may work are welcomed.