Index: openacs-4/packages/scholarship-fund/www/one-fund.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/scholarship-fund/www/one-fund.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/scholarship-fund/www/one-fund.tcl 19 Jun 2005 06:05:09 -0000 1.2 +++ openacs-4/packages/scholarship-fund/www/one-fund.tcl 3 Aug 2005 22:58:58 -0000 1.3 @@ -32,6 +32,42 @@ set edit_url [export_vars -base "fund-add-edit" {item_id}] +ad_form -name one -mode display -export { item_id } -has_edit 1 -form { + {title:text {label "Fund Title"}} + {description:text(textarea) {label "Description"}} + {account_code:text {label "Account Code"}} + {amount:text {label "Amount"}} +} -on_request { + db_1row get_fund "select sf.title, sf.description, sf.account_code, sf.amount from scholarship_fundi sf, cr_items ci where sf.revision_id=ci.live_revision and sf.item_id=:item_id" +} + +template::list::create \ + -name grants \ + -multirow grants \ + -no_data "No grants from this fund" \ + -actions [list Grant scholarship-grant?fund_id=$fund(fund_id) Grant] \ + -elements { + person__name { + label "User" + } + grant_date { + label "Date Granted" + } + grant_amount { + label "Amount" + } + } + +db_multirow grants grants { + select person__name(user_id), to_char(grant_date, 'Month dd, yyyy hh:miam') as grant_date, grant_amount + from scholarship_fund_grants + where fund_id in (select fund_id + from scholarship_fundi + where item_id = :item_id) + group by person__name, grant_date, grant_amount + order by scholarship_fund_grants.grant_date +} + set page_title "One Scholarship Fund" set context [list $page_title] set header_stuff ""