Index: openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.tcl 22 May 2004 01:20:25 -0000 1.4 +++ openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.tcl 31 May 2004 17:04:58 -0000 1.5 @@ -14,225 +14,239 @@ upload_file.tmpfile:tmpfile,optional {mode "edit"} return_url + admin_groups_p:optional } set package_id [ad_conn package_id] if { [ad_form_new_p -key task_id] } { - set page_title "Add Task" + set page_title "Add Task" } else { - set page_title "Edit Task" + set page_title "Edit Task" } +if { [info exists admin_groups_p] } { + set div_visibility visible + set checked_p checked +} else { + set div_visibility hidden + set checked_p "" +} + db_1row get_grade_info { *SQL* } set context [list [list [export_vars -base grades { package_id }] "Grades"] $page_title] set attached_p "f" ad_form -html { enctype multipart/form-data } -name task -cancel_url $return_url -export { return_url item_id storage_type grade_id attached_p } -mode $mode -form { - task_id:key + task_id:key - {task_name:text - {label "Task Name"} - {html {size 30}} - } - + {task_name:text + {label "Task Name"} + {html {size 30}} + } + } if { ![ad_form_new_p -key task_id] } { - db_1row get_task_info { *SQL* } - - if { [string eq $storage_type "lob"] } { + db_1row get_task_info { *SQL* } + + if { [string eq $storage_type "lob"] } { - if { [string eq $mode "edit"] } { - set attached_p "t" - - ad_form -extend -name task -form { - {upload_file:file,optional - {label "File"} - {html "size 30"} - {help_text "Currently $title is attached to this task, but you can attach a different file/url just by adding it here"} - } - {unattach_p:text(checkbox),optional - {label "Unattach file?"} - {options {{"" "t"}}} - {help_text "Check this if you want to unattach the file"} - } - {url:text(text),optional - {label "URL"} - {value "http://"} - } - } - } else { - ad_form -extend -name task -form { - {upload_file:text,optional - {label "File"} - {html "size 30"} - {value "$title"} - } - {unattach_p:text(hidden) - } - {url:text(hidden) - } - } + if { [string eq $mode "edit"] } { + set attached_p "t" + + ad_form -extend -name task -form { + {upload_file:file,optional + {label "File"} + {html "size 30"} + {help_text "Currently $title is attached to this task, but you can attach a different file/url just by adding it here"} } - } elseif { [regexp "http://" $content] } { - - if { [string eq $mode "edit"] } { - - set attached_p "t" - - ad_form -extend -name task -form { - - {upload_file:file,optional - {label "File"} - {html "size 30"} - } - {url:text(text),optional - {label "URL"} - {value "http://"} - {help_text "Currently $content is associated to this task, but you can associate a different url/file just by adding it here"} - } - {unattach_p:text(checkbox), optional - {label "Unassociate url?"} - {options {{"" "t"}}} - {help_text "Check this if you want to unattach the file"} - } - } - } else { - ad_form -extend -name task -form { - - {upload_file:hidden - } - {url:text(text),optional - {label "URL"} - {value "$content"} - } - {unattach_p:text(hidden) - } - } + {unattach_p:text(checkbox),optional + {label "Unattach file?"} + {options {{"" "t"}}} + {help_text "Check this if you want to unattach the file"} } + {url:text(text),optional + {label "URL"} + {value "http://"} + } + } } else { - ad_form -extend -name task -form { - - {upload_file:file,optional - {label "File"} - {html "size 30"} - } - - {url:text(text),optional - {label "URL"} - {value "http://"} - } - - {unattach_p:text(hidden),optional - {value ""} - } + ad_form -extend -name task -form { + {upload_file:text,optional + {label "File"} + {html "size 30"} + {value "$title"} } - - } -} else { - - ad_form -extend -name task -form { - - {upload_file:file,optional - {label "File"} - {html "size 30"} + {unattach_p:text(hidden) } + {url:text(hidden) + } + } } + } elseif { [regexp "http://" $content] } { - ad_form -extend -name task -form { + if { [string eq $mode "edit"] } { + + set attached_p "t" + + ad_form -extend -name task -form { + {upload_file:file,optional + {label "File"} + {html "size 30"} + } {url:text(text),optional - {label "URL"} - {value "http://"} + {label "URL"} + {value "http://"} + {help_text "Currently $content is associated to this task, but you can associate a different url/file just by adding it here"} + } + {unattach_p:text(checkbox),optional + {label "Unassociate url?"} + {options {{"" "t"}}} + {help_text "Check this if you want to unattach the file"} } - - {unattach_p:text(hidden),optional - {value ""} + } + } else { + ad_form -extend -name task -form { + + {upload_file:hidden } + {url:text(text),optional + {label "URL"} + {value "$content"} + } + {unattach_p:text(hidden) + } + } } + } else { + ad_form -extend -name task -form { + + {upload_file:file,optional + {label "File"} + {html "size 30"} + {help_text "You can upload a file associated to this task by using the browse button (optional)"} + } + + {url:text(text),optional + {label "URL"} + {value "http://"} + {help_text "You can associate a link to this task by entering the absolute url here (also optional)"} + } + + {unattach_p:text(hidden),optional + {value ""} + } + } + + } +} else { + + ad_form -extend -name task -form { + + {upload_file:file,optional + {label "File"} + {html "size 30"} + {help_text "You can upload a file associated to this task by using the browse button and select the file from your computer (optional)"} + } + } + + ad_form -extend -name task -form { + + {url:text(text),optional + {label "URL"} + {value "http://"} + {help_text "You can associate a link to this task by entering the absolute url here (also optional)"} + } + + {unattach_p:text(hidden),optional + {value ""} + } + } } ad_form -extend -name task -form { - {description:richtext,optional - {label "Task's Description"} - {html {rows 4 cols 40 wrap soft}} - } + {description:richtext,optional + {label "Task's Description"} + {html {rows 4 cols 40 wrap soft}} + } - {due_date:date,to_sql(linear_date),from_sql(sql_date) - {label "Due Date"} - {format "MONTH DD YYYY"} - {today} - {help} - {value {[evaluation::now_plus_days -ndays 15]}} - } + {due_date:date,to_sql(linear_date),from_sql(sql_date) + {label "Due Date"} + {format "MONTH DD YYYY"} + {today} + {help} + {value {[evaluation::now_plus_days -ndays 15]}} + } - {weight:text - {label "Weight"} - {html {size 5}} - {help_text "over $grade_weight% of $grade_name"} - } + {number_of_members:text + {label "Number of Members"} + {value "1"} + {html {size 5 onChange TaskInGroups()}} + {help_text "1 = Individual"} + {after_html {