Index: openacs-4/packages/user-tracking/www/admin/scheduling.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/user-tracking/www/admin/scheduling.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/user-tracking/www/admin/scheduling.tcl 1 Mar 2005 17:35:38 -0000 1.1 +++ openacs-4/packages/user-tracking/www/admin/scheduling.tcl 14 Apr 2005 15:44:28 -0000 1.2 @@ -9,7 +9,7 @@ } -set page_title "Programar carga de Datos" +set page_title "#user-tracking.lt_Program_Data_Charge#" set context [list $page_title] #Pages in this directory are only runnable by dotlrn-wide admins. @@ -19,40 +19,32 @@ ad_form -name ut_sched -form { {ut_sched_id:key} -# {start_date:date,to_sql(linear_date),to_html(sql_date) -# {label "Fecha de inicio"} -# } - {start_time:date - {label "Hora de inicio"} + {label "#user-tracking.init_time#"} {format {[lc_get formbuilder_time_format]}} } {perioricidad:text(radio) - {label "Perioricidad"} + {label "#user-tracking.perioricity#"} {html {onClick "javascript:TimePChanged(this);"}} - {options {{"Cada x horas" 1} - {"Diaria" 2} - {"Semanal" 3}}} + {options {{"#user-tracking.every_x_hours#" 1} + {"#user-tracking.Daily#" 2} + {"#user-tracking.weekly#" 3}}} } {horas:date,optional - {label "Cada cu�ntas horas?"} + {label "#user-tracking.every_how_many_hours#"} {format {[lc_get formbuilder_time_format]}} } {informes:text(checkbox),multiple - {label "Tipos de informes"} - {options {{"Todos los usuarios" 1} - {"Todas las comunidades" 2} - {"Todos los usuarios en todas la comunidades" 3} - {"Todo el sitio web" 4}}} + {label "#user-tracking.reports_types#"} + {options {{"#user-tracking.all_users#" 1} + {"#user-tracking.all_communities#" 2} + {"#user-tracking.every_user_in_every_comm#" 3} + {"#user-tracking.all_site#" 4}}} } - # {my_key:text(multiselect),multiple {label "select some values"} - # {options {first second third fourth fifth}} - # {html {size 4}}} - } #---------------------------------------------------------------------- # LARS: Hack to make enable/disable time widgets work with i18n @@ -97,22 +89,13 @@ set perioricidad 1 } -on_submit { - ns_log notice "He obtenido lo siguiente:\n \t\t \n\t\t Hora inicio= $start_time \n\t\t perioricidad=$perioricidad horas=$horas informes=$informes" - - #Programo la ejecuci�n del procedimiento - #user-tracking::do_data_load $informes - - #Borro programaciones anteriores + #deleting before progrmas db_foreach get_scheduled_processes {} { ns_unschedule_proc $process_id db_dml delete_scheduled_process {} - ns_log notice "Desprogramado proceso $process_id" + ns_log notice "Deleting process $process_id" } - - - - - + if {$perioricidad == 1 } { #estimating seconds to start_time @@ -125,31 +108,29 @@ set minutes_diff [expr [lindex $start_time 4] - $minutes] set diff [expr [expr [expr $hours_diff * 3600] + [expr $minutes_diff * 60]] - $seconds] - ns_log notice "El proceso se lanzar� dentro de $diff segundos" + ns_log notice "Process will be launched in $diff seconds" if {$diff < 0 } { #seconds in a day incr diff 86400 } #scheduling first execution set id [ad_schedule_proc -once "t" -thread "t" $diff user-tracking::launch_process $horas $informes] - ns_log notice "\n\nId del proc programado $id\n" + ns_log notice "\n\nScheduled proc id: $id\n" db_dml insert_scheduled_process_id {} ns_log notice "[ns_info scheduled]" } elseif {$perioricidad == 2} { set id [ad_schedule_proc -thread "t" -schedule_proc ns_schedule_daily [list [lindex $start_time 3] [lindex $start_time 4]] user-tracking::do_data_load $informes] - ns_log notice "\n\nId del proc programado $id\n" + ns_log notice "\n\nScheduled proc id: $id\n" db_dml insert_scheduled_process_id {} } else { #perioricidad=3 set id [ad_schedule_proc -thread "t" -schedule_proc ns_schedule_weekly [list [lindex $start_time 3] [lindex $start_time 4]] user-tracking::do_data_load $informes] - ns_log notice "\n\nId del proc programado $id\n" + ns_log notice "\n\nScheduled proc id: $id\n" db_dml insert_scheduled_process_id {} } - - #P�gina siguiente ad_returnredirect "" ad_script_abort } \ No newline at end of file