[Mpuls-commits] r253 - in wasko/trunk: . waskaweb/controllers waskaweb/lib
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Feb 10 12:23:31 CET 2009
Author: torsten
Date: 2009-02-10 12:23:31 +0100 (Tue, 10 Feb 2009)
New Revision: 253
Modified:
wasko/trunk/ChangeLog.txt
wasko/trunk/waskaweb/controllers/case_overview.py
wasko/trunk/waskaweb/lib/search.py
Log:
First adoption of fieldnames in the case search
Modified: wasko/trunk/ChangeLog.txt
===================================================================
--- wasko/trunk/ChangeLog.txt 2009-02-10 11:19:30 UTC (rev 252)
+++ wasko/trunk/ChangeLog.txt 2009-02-10 11:23:31 UTC (rev 253)
@@ -11,6 +11,12 @@
genral check if the function is working as expected. (e.g cm_end_art
<> 1)
+ First adoption for the casesearch
+
+ * waskaweb/controllers/case_overview.py,
+ waskaweb/lib/search.py: Changed search query to new dbfieldnames.
+ Works now for basc querys (no extra options selected)
+
2009-02-09 Torsten Irlaender <torsten.irlaender at intevation.de>
Merged changes from Version 1.5.0
Modified: wasko/trunk/waskaweb/controllers/case_overview.py
===================================================================
--- wasko/trunk/waskaweb/controllers/case_overview.py 2009-02-10 11:19:30 UTC (rev 252)
+++ wasko/trunk/waskaweb/controllers/case_overview.py 2009-02-10 11:23:31 UTC (rev 253)
@@ -209,10 +209,10 @@
extended = True
session['EXTENDED_SEARCH'] = extended
session.save()
- return self.overview(0, 'name_1', 'asc')
+ return self.overview(0, 'name', 'asc')
@checkRole(('admin_ka', 'cm_ka', 'pt_dlr'))
- def overview(self, reset=0, sort_field="name_1", sort_order="asc"):
+ def overview(self, reset=0, sort_field="name", sort_order="asc"):
reset = self._checkBool(reset)
if reset:
session['CASE_OVERVIEW_SEARCHOPTIONS'] = {}
@@ -241,13 +241,13 @@
# Sorting of the cases
if sort_field == "name_1":
- search_options.append('sort_field:name_1')
+ search_options.append('sort_field:name')
if sort_field == "vorname_1":
- search_options.append('sort_field:vorname_1')
+ search_options.append('sort_field:vorname')
if sort_field == "zugriff":
search_options.append('sort_field:zugriff')
if sort_field == "kundennummer":
- search_options.append('sort_field:kundennummer')
+ search_options.append('sort_field:fn')
if sort_field == "bearbeiter_id":
search_options.append('sort_field:bearbeiter_id')
Modified: wasko/trunk/waskaweb/lib/search.py
===================================================================
--- wasko/trunk/waskaweb/lib/search.py 2009-02-10 11:19:30 UTC (rev 252)
+++ wasko/trunk/waskaweb/lib/search.py 2009-02-10 11:23:31 UTC (rev 253)
@@ -44,28 +44,28 @@
SEARCH_CASE_SQL = \
""" SELECT
m.id,
- m.name_1,
- m.vorname_1,
- m.kundennummer,
+ m.name,
+ m.vorname,
+ m.fn,
m.bearbeiter_id,
st.status,
st.zugriff,
st.id as s_id,
- m.zeitraum_nachbetreuung,
- m.art_beendigung,
- m.einverstaendniserklaerung
+ m.nbtr,
+ m.cm_end_art,
+ m.einwilligung
FROM master_tbl_view m
JOIN ka_status_tbl_view st ON
m.id = st.master_id
JOIN ka_benutzer_tbl b ON
m.bearbeiter_id = b.id
WHERE
- ((m.vorname_1 ~* %%(needle)s
- OR m.name_1 ~* %%(needle)s
- OR m.kundennummer ~* %%(needle)s)
- OR ( m.vorname_1 IS NULL
- AND m.name_1 IS NULL
- AND m.kundennummer IS NULL
+ ((m.vorname ~* %%(needle)s
+ OR m.name ~* %%(needle)s
+ OR m.fn ~* %%(needle)s)
+ OR ( m.vorname IS NULL
+ AND m.name IS NULL
+ AND m.fn IS NULL
))
AND st.status IN (%s)
AND %s
@@ -213,7 +213,7 @@
#(coalesce(%(end_field)s, now()) >= '%(start_date)s'::date)) OR \
#(st.zugriff >= '%(start_date)s'::date)))" % fields
- sort_field = options.get('sort_field', "name_1")
+ sort_field = options.get('sort_field', "name")
sort_order = options.get('sort_order', "desc")
fields['needle'] = " ".join(search)
SQL = SEARCH_AGENCY_SQL % (gender, time_interval, phases, sort_field, sort_order)
@@ -239,7 +239,7 @@
gender = options.get('gender') and "m.geschlecht = %s" % options.get('gender') or "TRUE"
allowed_viewer = h.hasRole(['admin_ka', 'pb_ka']) and "TRUE" or allowed_viewer
editor = options.has_key('editor') and "m.bearbeiter_id = %s" % options.get('editor') or "TRUE"
- sort_field = options.get('sort_field', "name_1")
+ sort_field = options.get('sort_field', "name")
sort_order = options.get('sort_order', "desc")
branch = options.get('branch') and "b.filiale = '%s'" % options.get('branch') or "TRUE"
fkz = options.get('fkz') and "m.fkz = '%s'" % options.get('fkz') or "TRUE"
More information about the Mpuls-commits
mailing list