miguelm
committed
on 18 Oct 05
adding new filter to show tasks of an organization and all it's employees or just the tasks of the organization
/tcl/file-storage-procs.tcl (+2 -2)
570 570         }
571 571         default {
572 572             set result [publish_versioned_object_to_file_system \
573 573                             -object_id $object_id \
574 574                             -path $path \
575 575                             -file_name $file_name]
576 576         }
577 577     }
578 578     return $result
579 579 }
580 580
581 581 ad_proc -public fs::publish_folder_to_file_system {
582 582     {-folder_id:required}
583 583     {-path ""}
584 584     {-folder_name ""}
585 585     {-user_id ""}
586 586 } {
587 587     publish the contents of a file storage folder to the filesystem
588 588 } {
589 589     if {$path eq ""} {
590           set path [ad_tmpnam]
  590         set path [ad_mktmpdir]
591 591     }
592 592
593 593     if {$folder_name eq ""} {
594 594         set folder_name [get_object_name -object_id $folder_id]
595 595     }
596 596     set folder_name [ad_sanitize_filename \
597 597                          -collapse_spaces \
598 598                          -tolower \
599 599                          $folder_name]
600 600
601 601     set dir [ad_file join $path $folder_name]
602 602     # set dir [ad_file join $path "download"]
603 603     file mkdir $dir
604 604
605 605     db_foreach get_folder_contents {
606 606         select object_id,
607 607                name
608 608           from fs_objects
609 609          where parent_id = :folder_id
610 610            and acs_permission.permission_p(object_id, :user_id, 'read') = 't'