Index: openacs-4/packages/evaluation/www/admin/evaluations/one-evaluation-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/one-evaluation-edit.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/evaluation/www/admin/evaluations/one-evaluation-edit.tcl 19 May 2004 17:33:09 -0000 1.2 +++ openacs-4/packages/evaluation/www/admin/evaluations/one-evaluation-edit.tcl 10 Jun 2004 21:08:53 -0000 1.3 @@ -14,14 +14,14 @@ set return_url "student-list?[export_vars -url { task_id }]" -set page_title "View/Edit Evaluation" +set page_title "[_ evaluation.ViewEdit_Evaluation_]" -set context [list [list [export_vars -base student-list { task_id }] "Students List"] $page_title] +set context [list [list [export_vars -base student-list { task_id }] "[_ evaluation.Students_List_]"] $page_title] if { [ad_form_new_p -key evaluation_id] || [string eq $evaluation_mode "display"] } { - set comment_label "Comments" + set comment_label "[_ evaluation.Comments_]" } else { - set comment_label "Edit Reason" + set comment_label "[_ evaluation.Edit_Reason_]" } db_1row get_evaluation_info { *SQL* } @@ -31,13 +31,13 @@ evaluation_id:key {party_name:text - {label "Name"} + {label "[_ evaluation.Name_]"} {html {size 30}} {mode display} } {grade:text - {label "Grade"} + {label "[_ evaluation.Grade_]"} {html {size 5}} } @@ -47,43 +47,43 @@ } {show_student_p:text(radio) - {label "Will the student be able to see the grade?"} - {options {{Yes t} {No f}}} + {label "[_ evaluation.lt_Will_the_student_be_a_1]"} + {options {{"[_ evaluation.Yes_]" t} {"[_ evaluation.No_]" f}}} } } -edit_request { db_1row evaluation_info { *SQL* } - set grade [format %.2f $grade] + set grade [format %.2f [lc_numeric $grade]] } -validate { {grade { [ad_var_type_check_number_p $grade] } - { The grade must be a valid number } + { [_ evaluation.lt_The_grade_must_be_a_v_1] } } {comments { [string length $comments] < 4000 } - { The edit reason must be less than 4000 characteras long } + { [_ evaluation.lt_The_edit_reason_must_] } } } -on_submit { - db_transaction { - - set revision_id [evaluation::new_evaluation -new_item_p 0 -item_id $item_id -content_type evaluation_student_evals \ - -content_table evaluation_student_evals -content_id evaluation_id -description $comments \ - -show_student_p $show_student_p -grade $grade -task_id $task_id -party_id $party_id] - - evaluation::set_live -revision_id $revision_id - - } - - # send the notification to everyone suscribed - evaluation::notification::do_notification -task_id $task_id -evaluation_id $revision_id -package_id [ad_conn package_id] -notif_type one_evaluation_notif - - ad_returnredirect "$return_url" - ad_script_abort + db_transaction { + + set revision_id [evaluation::new_evaluation -new_item_p 0 -item_id $item_id -content_type evaluation_student_evals \ + -content_table evaluation_student_evals -content_id evaluation_id -description $comments \ + -show_student_p $show_student_p -grade $grade -task_id $task_id -party_id $party_id] + + evaluation::set_live -revision_id $revision_id + + } + + # send the notification to everyone suscribed + evaluation::notification::do_notification -task_id $task_id -evaluation_id $revision_id -package_id [ad_conn package_id] -notif_type one_evaluation_notif + + ad_returnredirect "$return_url" + ad_script_abort } - + ad_return_template