Permalink
Browse files

Add clone button to backups #477

  • Loading branch information...
1 parent 4f386dd commit 16c4ca37405add47ad25e366296bd77994eb9700 @jcameron jcameron committed Jan 10, 2017
Showing with 14 additions and 1 deletion.
  1. +8 −1 fsdump/edit_dump.cgi
  2. +2 −0 fsdump/lang/en
  3. +4 −0 fsdump/save_dump.cgi
@@ -45,7 +45,13 @@ else {
$dump = &get_dump($in{'id'});
$access{'edit'} && &can_edit_dir($dump) ||
&error($text{'dump_ecannot2'});
- &ui_print_header(undef, $text{'edit_title2'}, "", "create");
+ if ($in{'clone'}) {
+ &ui_print_header(undef, $text{'edit_title3'}, "", "create");
+ delete($in{'id'});
+ }
+ else {
+ &ui_print_header(undef, $text{'edit_title2'}, "", "create");
+ }
}
@tds = ( "width=30%" );
@@ -162,6 +168,7 @@ if ($in{'id'}) {
print &ui_form_end([ [ "save", $text{'save'} ],
[ "savenow", $text{'edit_savenow'} ],
[ "restore", $text{'edit_restore'} ],
+ [ "clone", $text{'edit_clone'} ],
[ "delete", $text{'delete'} ] ]);
}
else {
View
@@ -115,6 +115,7 @@ edit_edir=Missing backup directory
edit_efs=Filesystems of type $1 cannot be backed up by this module
edit_title=Add New Backup
edit_title2=Edit Backup
+edit_title3=Clone Backup
edit_header=$1 filesystem backup details
edit_header2=Backup schedule
edit_header3=Backup options
@@ -132,6 +133,7 @@ edit_to=$1 to $2
edit_tolevel=$1 to $2 (level $3)
edit_special=Backup schedule
edit_when=When to backup
+edit_clone=Clone
save_err=Failed to save backup
save_edir=Missing or invalid backup directory
@@ -40,6 +40,10 @@ elsif ($in{'restore'}) {
# Redirect to restore form
&redirect("restore_form.cgi?fs=$dump->{'fs'}&id=$in{'id'}");
}
+elsif ($in{'clone'}) {
+ # Redirect to create form, but in clone mode
+ &redirect("edit_dump.cgi?id=$in{'id'}&clone=1");
+ }
else {
# Validate and store inputs
if (&multiple_directory_support($in{'fs'})) {

0 comments on commit 16c4ca3

Please sign in to comment.