[LON-CAPA-cvs] cvs: loncom /interface lonparmset.pm

banghart lon-capa-cvs@mail.lon-capa.org
Mon, 15 Jan 2007 23:04:35 -0000


banghart		Mon Jan 15 18:04:35 2007 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
  Log:
  	Bug 5140. Add continue button after adding metadata field.
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.358 loncom/interface/lonparmset.pm:1.359
--- loncom/interface/lonparmset.pm:1.358	Mon Jan 15 17:53:00 2007
+++ loncom/interface/lonparmset.pm	Mon Jan 15 18:04:35 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.358 2007/01/15 22:53:00 banghart Exp $
+# $Id: lonparmset.pm,v 1.359 2007/01/15 23:04:35 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3323,6 +3323,13 @@
     $r->print('</table>');
     return 'ok';
 }
+sub continue {
+    my $output;
+    $output .= '<form action="" method="post">';
+    $output .= '<input type="hidden" name="action" value="setrestrictmeta" />';
+    $output .= '<input type="submit" value="Continue" />';
+    return ($output);
+}
 sub addmetafield {
     my ($r)=@_;
     $r->print(&Apache::loncommon::start_page('Add Metadata Field'));
@@ -3340,9 +3347,7 @@
                                         
             $r->print('Undeleted Metadata Field <strong>'.$env{'course.'.$env{'request.course.id'}.'.metadata.'.$meta_field.'.added'}."</strong> with result ".$put_result.'<br />');
         }
-        $r->print('<form action="" method="post">');
-        $r->print('<input type="hidden" name="action" value="setrestrictmeta" />');
-        $r->print('<input type="submit" value="Continue" />');
+        $r->print(&continue());
     } elsif (exists($env{'form.fieldname'})) {
         my $meta_field = $env{'form.fieldname'};
         my $display_field = $env{'form.fieldname'};
@@ -3352,7 +3357,8 @@
                             {'metadata.'.$meta_field.'.values'=>"",
                              'metadata.'.$meta_field.'.added'=>"$display_field",
                              'metadata.'.$meta_field.'.options'=>""},$dom,$crs);
-        $r->print('Added new Metadata Field '.$env{'form.fieldname'}." with result ".$put_result);
+        $r->print('Added new Metadata Field <strong>'.$env{'form.fieldname'}."</strong> with result ".$put_result.'<br />');
+        $r->print(&continue());
     } else {
         my $fields = &get_deleted_meta_fieldnames($env{'request.course.id'});
         if ($fields) {