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

raeburn raeburn@source.lon-capa.org
Mon, 03 Jan 2011 18:04:56 -0000


raeburn		Mon Jan  3 18:04:56 2011 EDT

  Modified files:              
    /loncom/interface	slotrequest.pm 
  Log:
  - Clarification of slot reservation change process by student.
  - "Make no change" on screen displayed after clicking "Change reservation"  button for an existing reservation, allows student to exit.
  - Record that student made no change if slot is configured to send messages.
  
  
Index: loncom/interface/slotrequest.pm
diff -u loncom/interface/slotrequest.pm:1.109 loncom/interface/slotrequest.pm:1.110
--- loncom/interface/slotrequest.pm:1.109	Sun Oct 31 15:32:10 2010
+++ loncom/interface/slotrequest.pm	Mon Jan  3 18:04:56 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler for requesting to have slots added to a students record
 #
-# $Id: slotrequest.pm,v 1.109 2010/10/31 15:32:10 raeburn Exp $
+# $Id: slotrequest.pm,v 1.110 2011/01/03 18:04:56 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -641,16 +641,19 @@
    <input type="hidden" name="releaseslot" value="$slot_name" />
    <input type="hidden" name="command" value="change" />
 STUFF
-            $r->print('<p class="LC_error">'.&mt('Reservation currently unchanged').'</p>'.
-                      '<p class="LC_warning">');
+            $r->print('<p class="LC_error">'.&mt('Reservation currently unchanged').'</p>');
             if ($slot_name ne '') {
-                $r->print(&mt('To complete the transaction you [_1]must[_2] confirm you want the change to [_3] to be processed.'
-                         ,'<b>','</b>','<b>'.$description2.'</b>').'<br />'
-                         .'<input type="submit" name="change" value="'.&mt('Process change').'" /></p>' 
-                         .&mt('or').'<br /><p>'.&mt('you will continue with the reservation you already had: [_1]'
-                         ,'<b>'.$description1.'</b>').'</p>');
+                $r->print('<p>'.&mt('To complete the transaction you [_1]must confirm[_2] you want to [_3]process the change[_4] to [_5].'
+                         ,'<b>','</b>','<i>','</i>','<b>'.$description2.'</b>')
+                         .'<br />'
+                         .&mt('Or you can choose to [_1]make no change[_2] and continue[_2] with the reservation you already had: [_3].'
+                         ,'<i>','</i>','<b>'.$description1.'</b>')
+                         .'</p><p><span class="LC_nobreak">'
+                         .'<input type="submit" name="change" value="'.&mt('Process the change').'" />' 
+                         .('&nbsp;'x3)
+                         .'<input type="submit" name="nochange" value="'.&mt('Make no change').'" />'
+                         .'</span></p>');
             }
-	    &return_link($r);
 	    $r->print(<<STUFF);
 </form>
 STUFF
@@ -2163,6 +2166,8 @@
             $msgtitle = &mt('Status of messages about saved reservation');
         } elsif ($action eq 'release') {
             $msgtitle = &mt('Status of messages about dropped reservation');
+        } elsif ($action eq 'nochange') {
+            $msgtitle = &mt('Status of messages about unchanged existing reservation');
         }
         return '<span class="LC_info">'.$msgtitle.'</span>'
                .'<ul>'
@@ -2625,7 +2630,26 @@
 	} elsif ($env{'form.command'} eq 'get') {
 	    &get_slot($r,$symb);
 	} elsif ($env{'form.command'} eq 'change') {
-	    if (&get_slot($r,$symb,$env{'form.releaseslot'},1)) {
+            if ($env{'form.nochange'}) {
+                my $slot_name = $env{'form.releaseslot'};
+                my @slots = &check_for_reservation($symb,'allslots');
+                my $msg;
+                if (($slot_name ne '') && (grep(/^\Q$slot_name\E/,@slots))) { 
+                     my %slot=&Apache::lonnet::get_slot($env{'form.releaseslot'});
+                     my $description=&get_description($slot_name,\%slot);
+                     $msg = '<span style="font-weight: bold;">'.
+                            &mt('Unchanged reservation: [_1]',$description).'</span><br /><br />';
+                     my $person = 
+                         &Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'});
+                     my $subject = &mt('Reservation unchanged: [_1]',$description);
+                     my $msgbody = &mt('No change to existing registration by [_1] for [_2].',$person,$description);
+                     $msg .= &slot_change_messaging($slot{'reservationmsg'},$subject,$msgbody,'nochange');
+                } else {
+                    $msg = '<span class="LC_warning">'.&mt('Reservation no longer reported as available.').'</span>';
+                }
+                $r->print($msg);
+                &return_link($r);
+	    } elsif (&get_slot($r,$symb,$env{'form.releaseslot'},1)) {
 		&release_slot($r,$symb,$env{'form.releaseslot'});
 	    }
 	} else {