diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-01-21 13:23:33 -0500 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-01-21 13:23:33 -0500 |
commit | 2622141eb59fceb4365f018326301d2d2837b771 (patch) | |
tree | e1cd3ba3ba46d38aead30cb71064b141bbcb4b5c | |
parent | f059317298728cd34e74af6ff2fdadc1d6fe3c8a (diff) | |
download | GradeBook-2622141eb59fceb4365f018326301d2d2837b771.tar.gz GradeBook-2622141eb59fceb4365f018326301d2d2837b771.zip |
code for hide unhide columns is implemented
Ignore-this: ad44247de16319116d283f9116052eca
darcs-hash:20110121182333-067c0-614bee212507a7bfa8c0d40ee90df8b4bd2ecfc1.gz
-rwxr-xr-x | GradeBook.tcl | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/GradeBook.tcl b/GradeBook.tcl index c1d472a..bb414a1 100755 --- a/GradeBook.tcl +++ b/GradeBook.tcl @@ -158,6 +158,8 @@ proc htmlDBout {db permission_list user {sort_col {}}} { guest { set hidden_columns $column_list } default { set hidden_columns $column_list } } + # add user hidden columns + set hidden_columns [concat $hidden_columns [SelectColValue4User UserHiddenColums $user]] # remove hidden columns from sql request foreach col $hidden_columns { set column_list [removeElementFromList $col $column_list] @@ -377,13 +379,16 @@ proc ChoseAction {action permission_list user} { proc UserHideColumn { permission_list user } { set columnname [::ncgi::value columnname {}] - set currently_hidden_colimns [SelectColValue4User UserHiddenColums $user] - lappend currently_hidden_colimns $columnname - UpdateColValue4UserNameNonWeb UserHiddenColums $user $currently_hidden_colimns + set currently_hidden_columns [SelectColValue4User UserHiddenColums $user] + lappend currently_hidden_columns $columnname + UpdateColValue4UserNameNonWeb UserHiddenColums $user $currently_hidden_columns } proc UserUnHideColumn { permission_list user } { set columnname [::ncgi::value columnname {}] + set currently_hidden_columns [SelectColValue4User UserHiddenColums $user] + set currently_hidden_columns [removeElementFromList $columnname $currently_hidden_columns] + UpdateColValue4UserNameNonWeb UserHiddenColums $user $currently_hidden_columns } proc ChangeColumn { permission_list user } { @@ -684,7 +689,15 @@ proc ShowControls { permission_list user } { puts -nonewline "$separator<span class=\"controls\"><a href=$script_name?action=$act>$act_label</a></span>" } } - puts "" + puts "<br>" + # unhide user hidden columns actions + set currently_hidden_columns [SelectColValue4User UserHiddenColums $user] + if { $currently_hidden_columns ne "" } { + puts {Unhide columns: } + foreach col $currently_hidden_columns { + puts "<span class=\"controls\"><a href=\"$script_name?action=userunhidecolumn&columnname=[::ncgi::encode $col]\">$col</a></span>" + } + } puts "</div>" } |