Skip to content

Commit

Permalink
More automated SQL generation with fall-through support for resubmit.
Browse files Browse the repository at this point in the history
  • Loading branch information
nugget committed Feb 7, 2013
1 parent 9643c95 commit 811905c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion webroot/post.rvt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,17 @@
}
}

unset -nocomplain whereclauses
lappend whereclauses "deleted IS NULL"
lappend whereclauses "user_id = $::user(id)"

if {![info exists response(resubmit)]} {
lappend whereclauses "posted IS NULL"
}

puts "<ol>"
if {[info exists idlist]} {
pg_select $::db "SELECT * FROM activities WHERE posted IS NULL AND deleted IS NULL AND id IN ([join $idlist ","])" buf {
pg_select $::db "SELECT * FROM activities WHERE [join $whereclauses " AND "] AND id IN ([join $idlist ","])" buf {
set id $buf(id)

if {[info exists response(notes_$id)] && $response(notes_$id) != ""} {
Expand Down

0 comments on commit 811905c

Please sign in to comment.