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

raeburn lon-capa-cvs@mail.lon-capa.org
Fri, 10 Feb 2006 02:59:05 -0000


raeburn		Thu Feb  9 21:59:05 2006 EDT

  Modified files:              
    /loncom/interface	lonpopulate.pm 
  Log:
  Display an appropriate message instead of a button when update of student photos via Automated Enrollment Manager is disabled.
  
  
Index: loncom/interface/lonpopulate.pm
diff -u loncom/interface/lonpopulate.pm:1.39 loncom/interface/lonpopulate.pm:1.40
--- loncom/interface/lonpopulate.pm:1.39	Thu Feb  9 08:45:54 2006
+++ loncom/interface/lonpopulate.pm	Thu Feb  9 21:59:02 2006
@@ -1,5 +1,5 @@
 # automated enrollment configuration handler
-# $Id: lonpopulate.pm,v 1.39 2006/02/09 13:45:54 albertel Exp $
+# $Id: lonpopulate.pm,v 1.40 2006/02/10 02:59:02 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1029,13 +1029,17 @@
       if ($enrollvar{'showphoto'}) {
           my ($update,$commentary) = &Apache::lonnet::auto_photochoice($crs,
 								       $dom);
-          $r->print('<br />'.$commentary.'<br /><br />
+          if ($update) { 
+              $r->print('<br />'.$commentary.'<br /><br />
 <form name="photoupdate" method="post">
 <input type ="button" name="retrieve" value="'.&mt('Update photo repository').'"
 onclick="javascript:document.photoupdate.submit()" />
 <input type ="hidden" name="action" value="'.$action.'" />
 <input type ="hidden" name="state" value="process" />
 </form>');
+          } else {
+              $r->print(&mt('Update of photos via the Automated Enrollment Manager is unavailable in this domain.').'<br /><br /><input type="button" name=mainmenu" value="Go back" onclick="javascript:history.go(-1);" />');
+          }
       } else {
           $r->print('Update of photos is unavailable, as import of student photos is currently disabled.<br />Enable this first via: <a href="/adm/populate?action=photos">'.$$tasktitleref{'photos'}.'</a>');
       }