Index: openacs-4/packages/recruiting/tcl/recruiting-email-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/tcl/recruiting-email-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/tcl/recruiting-email-procs.tcl 20 Aug 2002 19:34:55 -0000 1.1 @@ -0,0 +1,39 @@ +namespace eval recruiting { + namespace eval email { + + ad_proc -public get_body { + {-package_id:required} + } { + return the email body that gets sent to + interviewers for this package + } { + set default_email_defined_p [db_string default_email_defined_p {}] + + if {$default_email_defined_p} { + set default_email [db_string get_this_package_email {}] + } else { + set default_email [db_string get_default_email {}] + } + + return $default_email + + } + + ad_proc -public set_email { + {-package_id:required} + {-email_body:required} + } { + set the email that gets sent to + interviewers for this package + } { + set default_email_defined_p [db_string default_email_defined_p {}] + + if {$default_email_defined_p} { + db_dml set_default_email {} + } else { + db_dml new_default_email {} + } + } + + } +} Index: openacs-4/packages/recruiting/tcl/recruiting-email-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/tcl/recruiting-email-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/tcl/recruiting-email-procs.xql 20 Aug 2002 19:34:55 -0000 1.1 @@ -0,0 +1,54 @@ + + + + + + select count(*) + from recruiting_assignment_emails + where package_id = :package_id + + + + + + select email_body + from recruiting_assignment_emails + where package_id = :package_id + + + + + + select email_body + from recruiting_assignment_emails + where package_id is null + + + + + + select count(*) + from recruiting_assignment_emails + where package_id = :package_id + + + + + + update recruiting_assignment_emails + set email_body = :email_body + where package_id = :package_id + + + + + + insert into recruiting_assignment_emails + (package_id, + email_body) + values (:package_id, + :email_body); + + + + Index: openacs-4/packages/recruiting/www/admin/email-options.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/email-options.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/email-options.adp 20 Aug 2002 19:34:56 -0000 1.1 @@ -0,0 +1,5 @@ + +@context_bar@ + + + Index: openacs-4/packages/recruiting/www/admin/email-options.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/email-options.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/email-options.tcl 20 Aug 2002 19:34:56 -0000 1.1 @@ -0,0 +1,37 @@ +ad_page_contract { + recruiting admin interface + access admin function such as: criteria specification + and interviewee status types + + @author chak (chak@openforce.net) + @creation-date 2002-07-30 + @version $Id: email-options.tcl,v 1.1 2002/08/20 19:34:56 chak Exp $ +} + +set package_id [ad_conn package_id] +set user_id [ad_verify_and_get_user_id] + +form create email + +element create email default_email \ + -label "
This email gets sent to users to whom you assign recruiting candidate interviews. You may edit the default email here.

The following variables are available to you:
\$interviewer_name
\$candidate_name
\$sender_name (you)
\$url
" \ + -datatype text \ + -widget textarea \ + -html {cols 60 rows 10} \ + -value [recruiting::email::get_body -package_id $package_id] + +if {[form is_valid email]} { + form get_values email \ + default_email + + recruiting::email::set_email \ + -email_body $default_email \ + -package_id $package_id + + ns_returnredirect index +} + +set context_bar [list [list "../" "Recruiting"] [list "index" "Admin"] "Default Email"] + +ad_return_template + Index: openacs-4/packages/recruiting/www/admin/email-options.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/email-options.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/email-options.xql 20 Aug 2002 19:34:56 -0000 1.1 @@ -0,0 +1,46 @@ + + + + + + select count(*) + from recruiting_assignment_emails + where package_id = :package_id + + + + + + select email_body + from recruiting_assignment_emails + where package_id = :package_id + + + + + + select email_body + from recruiting_assignment_emails + where package_id is null + + + + + + update recruiting_assignment_emails + set email_body = :default_email + where package_id = :package_id + + + + + + insert into recruiting_assignment_emails + (package_id, + email_body) + values (:package_id, + :default_email); + + + +