table_name CDATA #REQUIRED
>
-<!ELEMENT field (name, name_visible?, description?, alias?, type, for_show, always_showed, for_where, available_where_type, where_default_not, where_default_type, for_order, always_ordered, order_default, decode)>
+<!ELEMENT field (name, name_visible?, description?, alias?, type, for_show, always_showed, for_where, available_where_type, where_default_not, where_default_type, where_default_from, where_default_to, for_order, always_ordered, order_default, decode)>
<!ELEMENT table_name (#PCDATA)>
<!ELEMENT name_visible (#PCDATA)>
<!ELEMENT available_where_type (#PCDATA)>
<!ELEMENT where_default_not (#PCDATA)>
<!ELEMENT where_default_type (#PCDATA)>
+<!ELEMENT where_default_from (w_value, w_visible, w_sql)>
+<!ELEMENT where_default_to (w_value, w_visible, w_sql)>
<!ELEMENT for_order (#PCDATA)>
<!ELEMENT always_ordered (#PCDATA)>
<!ELEMENT order_default (#PCDATA)>
+<!ELEMENT w_value (#PCDATA)>
+<!ELEMENT w_visible (#PCDATA)>
+<!ELEMENT w_sql (#PCDATA)>
+
<!ELEMENT decode (table_name, join_type, field_name_to_join, field_name_to_show, alias)>
<!ELEMENT join_type (#PCDATA)>
COL_WHERE_CONDITION_NOT,
COL_WHERE_CONDITION_TYPE,
COL_WHERE_CONDITION_TYPE_VISIBLE,
- COL_WHERE_CONDITION_FROM, /* column with exchange value from GtkTreeStore and GFtkWidget */
- COL_WHERE_CONDITION_FROM_VISIBLE, /* column with the visible eventually formatted value */
- COL_WHERE_CONDITION_FROM_SQL, /* columne with the value formatted useful for sql */
+ COL_WHERE_CONDITION_FROM, /* column with exchange value from GtkTreeStore and GtkWidget */
+ COL_WHERE_CONDITION_FROM_VISIBLE, /* column with the visible, eventually formatted, value */
+ COL_WHERE_CONDITION_FROM_SQL, /* column with the value formatted useful for sql */
COL_WHERE_CONDITION_TO,
COL_WHERE_CONDITION_TO_VISIBLE,
COL_WHERE_CONDITION_TO_SQL
field->for_where = TRUE;
field->for_order = TRUE;
+ field->where_default_from = g_strdup ("");
+ field->where_default_from_visible = g_strdup ("");
+ field->where_default_from_sql = g_strdup ("");
+ field->where_default_to = g_strdup ("");
+ field->where_default_to_visible = g_strdup ("");
+ field->where_default_to_sql = g_strdup ("");
+
cur = xfield->children;
while (cur != NULL)
{
{
field->where_default_type = gdaex_query_editor_str_to_where_type (xmlNodeGetContent (cur));
}
+ else if (xmlStrcmp (cur->name, "where_default_from") == 0)
+ {
+ xmlNode *wfrom;
+
+ wfrom = cur->children;
+ while (wfrom != NULL)
+ {
+ if (xmlStrcmp (wfrom->name, "w_value") == 0)
+ {
+ field->where_default_from = xmlNodeGetContent (wfrom);
+ }
+ else if (xmlStrcmp (wfrom->name, "w_visible") == 0)
+ {
+ field->where_default_from_visible = xmlNodeGetContent (wfrom);
+ }
+ else if (xmlStrcmp (wfrom->name, "w_sql") == 0)
+ {
+ field->where_default_from_sql = xmlNodeGetContent (wfrom);
+ }
+
+ wfrom = wfrom->next;
+ }
+ }
+ else if (xmlStrcmp (cur->name, "where_default_to") == 0)
+ {
+ xmlNode *wto;
+
+ wto = cur->children;
+ while (wto != NULL)
+ {
+ if (xmlStrcmp (wto->name, "w_value") == 0)
+ {
+ field->where_default_to = xmlNodeGetContent (wto);
+ }
+ else if (xmlStrcmp (wto->name, "w_visible") == 0)
+ {
+ field->where_default_to_visible = xmlNodeGetContent (wto);
+ }
+ else if (xmlStrcmp (wto->name, "w_sql") == 0)
+ {
+ field->where_default_to_sql = xmlNodeGetContent (wto);
+ }
+
+ wto = wto->next;
+ }
+ }
else if (xmlStrcmp (cur->name, "for_order") == 0)
{
field->for_order = zak_utils_string_to_boolean (xmlNodeGetContent (cur));
COL_WHERE_CONDITION_NOT, field->where_default_not,
COL_WHERE_CONDITION_TYPE, field->where_default_type,
COL_WHERE_CONDITION_TYPE_VISIBLE, gdaex_query_editor_get_where_type_str_from_type (field->where_default_type),
+ COL_WHERE_CONDITION_FROM, field->where_default_from,
+ COL_WHERE_CONDITION_FROM_VISIBLE, field->where_default_from_visible,
+ COL_WHERE_CONDITION_FROM_SQL, field->where_default_from_sql,
+ COL_WHERE_CONDITION_TO, field->where_default_to,
+ COL_WHERE_CONDITION_TO_VISIBLE, field->where_default_to_visible,
+ COL_WHERE_CONDITION_TO_SQL, field->where_default_to_sql,
-1);
if (with_parent)
<name_visible>Surname</name_visible>
<description>The client's surname</description>
<type>text</type>
- <available_where_type>string|is_null</available_where_type>
+ <available_where_type>string|is_null|between</available_where_type>
<where_default_not>t</where_default_not>
- <where_default_type>is_null</where_default_type>
+ <where_default_type>between</where_default_type>
+ <where_default_from>
+ <w_value>jon</w_value>
+ <w_visible>jon</w_visible>
+ <w_sql>'jon'</w_sql>
+ </where_default_from>
+ <where_default_to>
+ <w_value>jane</w_value>
+ <w_visible>jane</w_visible>
+ <w_sql>'jane'</w_sql>
+ </where_default_to>
<always_ordered>true</always_ordered>
<order_default>DESC</order_default>
</field>