| … | |
… | |
| 70 | my $file = $r->param('download'); |
70 | my $file = $r->param('download'); |
| 71 | $self->downloadFile($file) if (defined $file); |
71 | $self->downloadFile($file) if (defined $file); |
| 72 | my $ce = $r->ce; |
72 | my $ce = $r->ce; |
| 73 | my $urlpath = $r->urlpath; |
73 | my $urlpath = $r->urlpath; |
| 74 | my $courseID = $r->urlpath->arg("courseID"); |
74 | my $courseID = $r->urlpath->arg("courseID"); |
|
|
75 | # removed archived_course_ prefix -- it is important that path matches the $courseID for consitency with the database dump |
| 75 | my $archive_path = $ce->{webworkDirs}{courses} . "/$courseID/templates/archived_course_$courseID.tar.gz"; |
76 | my $archive_path = $ce->{webworkDirs}{courses} . "/$courseID/templates/$courseID.tar.gz"; |
| 76 | my %options = (courseID => $courseID, archive_path => $archive_path, ce=>$ce ); |
77 | my %options = (courseID => $courseID, archive_path => $archive_path, ce=>$ce ); |
| 77 | $self->{archive_options}= \%options; |
78 | $self->{archive_options}= \%options; |
| 78 | |
79 | |
| 79 | } |
80 | } |
| 80 | |
81 | |
| … | |
… | |
| 169 | $self->Refresh; |
170 | $self->Refresh; |
| 170 | } |
171 | } |
| 171 | if ($r->param('archiveCourse') ) { |
172 | if ($r->param('archiveCourse') ) { |
| 172 | my %options = %{$self->{archive_options}}; |
173 | my %options = %{$self->{archive_options}}; |
| 173 | my $courseID = $options{courseID}; |
174 | my $courseID = $options{courseID}; |
| 174 | $self->addgoodmessage("Archiving course at archived_course_$courseID.tar.gz. Reload FileManager to see it."); |
175 | $self->addgoodmessage("Archiving course as $courseID.tar.gz. Reload FileManager to see it."); |
| 175 | WeBWorK::Utils::CourseManagement::archiveCourse(%options); |
176 | WeBWorK::Utils::CourseManagement::archiveCourse(%options); |
| 176 | $self->addgoodmessage("Course archived."); |
177 | $self->addgoodmessage("Course archived."); |
| 177 | |
178 | |
| 178 | } |
179 | } |
| 179 | print CGI::hidden({name=>'pwd',value=>$self->{pwd}}); |
180 | print CGI::hidden({name=>'pwd',value=>$self->{pwd}}); |