[LON-CAPA-cvs] cvs: loncom /interface lonmeta.pm
banghart
lon-capa-cvs@mail.lon-capa.org
Mon, 15 Jan 2007 20:51:56 -0000
banghart Mon Jan 15 15:51:56 2007 EDT
Modified files:
/loncom/interface lonmeta.pm
Log:
Allow student to select 'nothing' in restricted metadata.
Bug 5138.
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.196 loncom/interface/lonmeta.pm:1.197
--- loncom/interface/lonmeta.pm:1.196 Fri Jan 12 17:13:51 2007
+++ loncom/interface/lonmeta.pm Mon Jan 15 15:51:52 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Metadata display handler
#
-# $Id: lonmeta.pm,v 1.196 2007/01/12 22:13:51 albertel Exp $
+# $Id: lonmeta.pm,v 1.197 2007/01/15 20:51:52 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -601,6 +601,10 @@
$cur_values_stu .= $item.',';
}
}
+ my @key_order = sort(keys(%meta_options));
+ unshift (@key_order,'Not Specified');
+ $meta_options{'Not Specified'} = 'Not Specified';
+ $meta_options{'select_form_order'} = \@key_order;
} else {
$cur_values_stu = $value;
}
@@ -613,6 +617,7 @@
|| ($type eq 'author')||($type eq 'notes')
|| ($type eq 'abstract')|| ($type eq 'title')|| ($type eq 'standards')
|| (exists($env{'course.'.$env{'request.course.id'}.'.metadata.'.$type.'.added'}))) {
+
if ($values) {
if ($only_one) {
$output .= (&Apache::loncommon::select_form($cur_values_inst[0],'new_'.$type,%meta_options));
@@ -750,7 +755,6 @@
%Apache::lonpublisher::metadatakeys=();
my $result=&Apache::lonnet::getfile($fn);
&Apache::lonpublisher::metaeval($result);
- &Apache::lonnet::logthis("restricted is: ".$Apache::lonpublisher::metadatafields{'courserestricted'});
if ((!$Apache::lonpublisher::metadatafields{'courserestricted'}) ||
($env{'form.changecourse'} eq 'true')) {
&pre_select_course($r,$uri);
@@ -1253,8 +1257,8 @@
$Apache::lonpublisher::metadatafields{'owner'} =
$env{'user.name'}.':'.$env{'user.domain'};
}
-
if ($Apache::lonpublisher::metadatafields{'courserestricted'} ne 'none') {
+
if ($file_type eq 'portfolio') {
$r->print(&mt('Associated with course [_1]',
'<strong><a href="'.$uri.'?changecourse=true">'.