Index: openacs-4/packages/ecommerce/www/admin/customer-service/email-send.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/email-send.tcl,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/ecommerce/www/admin/customer-service/email-send.tcl 9 Mar 2004 00:59:47 -0000 1.7
+++ openacs-4/packages/ecommerce/www/admin/customer-service/email-send.tcl 20 Aug 2008 22:24:52 -0000 1.8
@@ -25,93 +25,34 @@
ad_script_abort
}
+set title "Send Email to Customer"
+set context [list [list index "Customer Service"] $title]
-set page_title "Send Email to Customer"
-append doc_body "[ad_admin_header $page_title]
-
$page_title
-
-[ad_context_bar [list "../index.tcl" "Ecommerce([ec_system_name])"] [list "index.tcl" "Customer Service Administration"] $page_title]
-
-
-"
-
# make sure this user_identification_id has an email address associated with it
-
db_1row get_user_information "
select u.email as user_email, id.email as id_email
from cc_users u, ec_user_identification id
where id.user_id = u.user_id(+)
- and id.user_identification_id=:user_identification_id
-"
+ and id.user_identification_id=:user_identification_id"
-
if { ![empty_string_p $user_email] } {
set email_to_use $user_email
} else {
set email_to_use $id_email
}
if { [empty_string_p $email_to_use] } {
- append doc_body "
-
- Sorry, we don't have the customer's email address on file.
-
- [ad_admin_footer]
- "
- doc_return 200 text/html $doc_body
- ad_script_abort
-}
+ set early_message "No email sent. Sorry, we don't have the customer's email address on file."
+} else {
+ set early_message "If you are not [db_string get_full_name "select first_names || ' ' || last_name from cc_users where user_id=:customer_service_rep"], please log in"
+ # generate action_id here for double-click protection
+ set action_id [db_nextval ec_action_id_sequence]
-# generate action_id here for double-click protection
-set action_id [db_nextval ec_action_id_sequence]
+ set export_form_vars_html "[ec_hidden_input var_to_spellcheck "message"]\
+ [ec_hidden_input target_url "[ec_url_concat [ec_url] /admin]/customer-service/email-send-2.tcl"]\
+ [export_form_vars email_to_use action_id issue_id customer_service_rep user_identification_id]"
-append doc_body "If you are not [db_string get_full_name "select first_names || ' ' || last_name from cc_users where user_id=:customer_service_rep"], please log in
-
-
-[ad_admin_footer]
-"
-
-doc_return 200 text/html $doc_body
-
+ set customer_service_email [parameter::get -package_id [ec_id] -parameter CustomerServiceEmailAddress]
+ set email_form_message [ec_canned_response_selector email_form message]
+}