--- loncom/interface/loncommon.pm	2011/05/04 01:49:08	1.1005
+++ loncom/interface/loncommon.pm	2011/07/04 09:24:58	1.1014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1005 2011/05/04 01:49:08 www Exp $
+# $Id: loncommon.pm,v 1.1014 2011/07/04 09:24:58 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -475,7 +475,7 @@ sub selectstudent_link {
               &mt('Select User').'</a></span>';
    }
    if ($env{'request.role'}=~/^(au|dc|su)/) {
-       $callargs .= ",1"; 
+       $callargs .= ",'',1"; 
        return '<span class="LC_nobreak">'.
               '<a href="javascript:openstdbrowser('.$callargs.');">'.
               &mt('Select User').'</a></span>';
@@ -1758,7 +1758,7 @@ sub create_workbook {
         return (undef);
     }
     #
-    $workbook->set_tempdir('/home/httpd/perl/tmp');
+    $workbook->set_tempdir(LONCAPA::tempdir());
     #
     my $format = &Apache::loncommon::define_excel_formats($workbook);
     return ($workbook,$filename,$format);
@@ -3459,6 +3459,7 @@ sub get_previous_attempt {
 	  my $data=$parts[-1];
           next if ($data eq 'foilorder');
 	  pop(@parts);
+          $prevattempts.='<th>'.&mt('Part ').join('.',@parts).'<br />'.$data.'&nbsp;</th>';
           if ($data eq 'type') {
               unless ($showsurv) {
                   my $id = join(',',@parts);
@@ -3467,10 +3468,7 @@ sub get_previous_attempt {
                       $lasthidden{$ign.'.'.$id} = 1;
                   }
               }
-              delete($lasthash{$key});
-          } else {
-	      $prevattempts.='<th>'.&mt('Part ').join('.',@parts).'<br />'.$data.'&nbsp;</th>';
-          }
+          } 
 	} else {
 	  if ($#parts == 0) {
 	    $prevattempts.='<th>'.$parts[0].'</th>';
@@ -3587,7 +3585,7 @@ sub get_previous_attempt {
 
 sub format_previous_attempt_value {
     my ($key,$value) = @_;
-    if ($key =~ /timestamp/) {
+    if (($key =~ /timestamp/) || ($key=~/duedate/)) {
 	$value = &Apache::lonlocal::locallocaltime($value);
     } elsif (ref($value) eq 'ARRAY') {
 	$value = '('.join(', ', @{ $value }).')';
@@ -4308,8 +4306,7 @@ sub get_domainconf {
                     if (ref($domconfig{'login'}{$key}) eq 'HASH') {
                         if ($key eq 'loginvia') {
                             if (ref($domconfig{'login'}{'loginvia'}) eq 'HASH') {
-                                my @ids = &Apache::lonnet::current_machine_ids();
-                                foreach my $hostname (@ids) {
+                                foreach my $hostname (keys(%{$domconfig{'login'}{'loginvia'}})) {
                                     if (ref($domconfig{'login'}{'loginvia'}{$hostname}) eq 'HASH') {
                                         if ($domconfig{'login'}{'loginvia'}{$hostname}{'server'}) {
                                             my $server = $domconfig{'login'}{'loginvia'}{$hostname}{'server'};
@@ -4318,7 +4315,7 @@ sub get_domainconf {
 
                                                 $designhash{$udom.'.login.loginvia_'.$hostname} = $server.':'.$domconfig{'login'}{'loginvia'}{$hostname}{'custompath'};
                                             } else {
-                                                 $designhash{$udom.'.login.loginvia_'.$hostname} = $server.':'.$domconfig{'login'}{'loginvia'}{$hostname}{'serverpath'};
+                                                $designhash{$udom.'.login.loginvia_'.$hostname} = $server.':'.$domconfig{'login'}{'loginvia'}{$hostname}{'serverpath'};
                                             }
                                             if ($domconfig{'login'}{'loginvia'}{$hostname}{'exempt'}) {
                                                 $designhash{$udom.'.login.loginvia_exempt_'.$hostname} = $domconfig{'login'}{'loginvia'}{$hostname}{'exempt'};
@@ -4961,6 +4958,10 @@ form, .inline {
   text-decoration:none;
 }
 
+.LC_setting {
+  text-decoration:underline;
+}
+
 .LC_error {
   color: red;
   font-size: larger;
@@ -5205,14 +5206,6 @@ table.LC_nested {
   width: 100%;
 }
 
-.ui-accordion,
-.ui-accordion table.LC_data_table,
-.ui-accordion table.LC_nested_outer{
-  border: 0px;
-  border-spacing: 0px;
-  margin: 3px;
-}
-
 table.LC_data_table tr th,
 table.LC_calendar tr th,
 table.LC_prior_tries tr th,
@@ -5328,22 +5321,6 @@ table.LC_nested tr td.LC_right_item {
   text-align: right;
 }
 
-.ui-accordion table.LC_nested tr.LC_odd_row td.LC_left_item,
-.ui-accordion table.LC_nested tr.LC_even_row td.LC_left_item {
-  text-align: right;
-  width: 40%;
-  padding-right:10px;
-  vertical-align: top;
-  padding: 5px;
-}
-
-.ui-accordion table.LC_nested tr.LC_odd_row td.LC_right_item,
-.ui-accordion table.LC_nested tr.LC_even_row td.LC_right_item {
-  text-align: left;
-  width: 60%;
-  padding: 2px 4px;
-}
-
 table.LC_nested tr.LC_odd_row td {
   background-color: #EEEEEE;
 }
@@ -6572,12 +6549,6 @@ ul.LC_funclist li {
   line-height: 150%;
 }
 
-.ui-accordion .LC_advanced_toggle {
-  float: right;
-  font-size: 90%;
-  padding: 0px 4px
-}
-
 .LC_hidden {
   display: none;
 }
@@ -8929,7 +8900,7 @@ sub modify_html_refs {
                 if ($allfiles{$ref}) {
                     my $newname =  $orig;
                     my ($attrib_regexp,$codebase);
-                    my $attrib_regexp = &unescape($env{'form.embedded_attrib_'.$i});
+                    $attrib_regexp = &unescape($env{'form.embedded_attrib_'.$i});
                     if ($attrib_regexp =~ /:/) {
                         $attrib_regexp =~ s/\:/|/g;
                     }
@@ -8938,7 +8909,7 @@ sub modify_html_refs {
                         $count += $numchg;
                     }
                     if ($env{'form.embedded_codebase_'.$i} ne '') {
-                        my $codebase = &unescape($env{'form.embedded_codebase_'.$i});
+                        $codebase = &unescape($env{'form.embedded_codebase_'.$i});
                         my $numchg = ($content =~ s/(codebase\s*=\s*["']?)\Q$codebase\E(["']?)/$1.$2/i); #' stupid emacs
                         $codebasecount ++;
                     }
@@ -9007,7 +8978,7 @@ sub check_for_upload {
                   &mt('Unable to upload [_1]. (size = [_2] bytes)', 
                       '<span class="LC_filename">'.$fname.'</span>',
                       $filesize).'<br />'.
-                  &mt('Either the file you attempted to upload was empty, or your web browser was unable to read its contents.').'<br />';
+                  &mt('Either the file you attempted to upload was empty, or your web browser was unable to read its contents.').'<br />'.
                   '</span>';
         return ('zero_bytes',$msg);
     }