g_object_unref (dm);
}
- lstore = GTK_TREE_STORE (gtk_list_store_newv (4 + rows, gtype));
+ lstore = GTK_LIST_STORE (gtk_list_store_newv (4 + rows, gtype));
gtk_tree_view_set_model (tview, GTK_TREE_MODEL (lstore));
/* find the last action
{
gtk_list_store_append (lstore, &iter);
gtk_list_store_set (lstore, &iter,
- COL_CHANGES_ID, gdaex_data_model_get_value_integer_at (dm, 0, "id"),
+ COL_CHANGES_ID, gdaex_data_model_get_field_value_integer_at (dm, 0, "id"),
COL_CHANGES_DATE, g_date_time_format (gdaex_data_model_get_field_value_gdatetime_at (dm, 0, "date"), "%d/%m/%Y %H.%M.%S"),
COL_CHANGES_OPERATION, gdaex_data_model_get_field_value_integer_at (dm, 0, "type") == ZAK_AUDIT_ACTION_DELETE ? "Delete" :
gdaex_data_model_get_field_value_integer_at (dm, 0, "type") == ZAK_AUDIT_ACTION_AFTER_UPDATE ? "Edit" :
if (field_value == NULL) break;
/* TODO the db field can be other type than string */
- g_string_append_printf (sql_where, " AND v.id_fields = %d"
- " AND v.value = '%s'",
+ g_string_append_printf (sql_where,
+ " AND EXISTS (SELECT v.id_actions"
+ " FROM values AS v WHERE a.id = v.id_actions"
+ " AND v.id_fields = %d"
+ " AND v.value = '%s')",
field->id,
- field_value,
field_value);
}
sql = g_strdup_printf ("SELECT a.username"
" FROM actions AS a"
- " INNER JOIN values AS v ON a.id = v.id_actions"
" WHERE a.type = %d"
" AND a.id_tables = %d"
"%s",
return 0;
}
gda_connection_statement_execute_non_select (conn, stmt, NULL, NULL, NULL);
- zak_audit_action_from_gdastatement (audit, ZAK_AUDIT_ACTION_INSERT, "I", "audit_test1", stmt);
+ zak_audit_action_from_gdastatement (audit, ZAK_AUDIT_ACTION_INSERT, "Y", "audit_test1", stmt);
stmt = gda_sql_parser_parse_string (parser, "UPDATE test1 SET income=99999999.99 WHERE id = 2", NULL, NULL);
if (stmt == NULL)
gda_connection_statement_execute_non_select (conn, stmt, NULL, NULL, NULL);
g_warning ("User insertion: %s",
- zak_audit_get_user_insertion (audit, "audit_test1", "test1", g_strsplit ("id|2", "|", -1)));
+ zak_audit_get_user_insertion (audit, "audit_test1", "test1", (const gchar **)g_strsplit ("id|2", "|", -1)));
zak_audit_destroy (audit);