version 1.2, 2023/11/04 01:33:47
|
version 1.3, 2023/11/04 01:56:04
|
Line 33 package Apache::lonviewcoauthors;
|
Line 33 package Apache::lonviewcoauthors;
|
use strict; |
use strict; |
use Apache::loncommon(); |
use Apache::loncommon(); |
use Apache::lonhtmlcommon(); |
use Apache::lonhtmlcommon(); |
use Apache::Constants qw(:common :http REDIRECT); |
use Apache::Constants qw(:common :http); |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonnet; |
use Apache::lonnet; |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
Line 214 sub edit_settings {
|
Line 214 sub edit_settings {
|
} else { |
} else { |
%viewsettings = &retrieve_view_settings($auname,$audom,$role); |
%viewsettings = &retrieve_view_settings($auname,$audom,$role); |
} |
} |
my %userenv = &Apache::lonnet::userenvironment($audom,$auname,'', |
my %userenv = &Apache::lonnet::userenvironment($audom,$auname, |
'coauthorlist','coauthoroptin'); |
'coauthorlist','coauthoroptin'); |
my %titles = &Apache::lonlocal::texthash ( |
my %titles = &Apache::lonlocal::texthash ( |
coauthorlist => 'List availability', |
coauthorlist => 'List availability', |
Line 380 sub print_coauthors {
|
Line 380 sub print_coauthors {
|
my $fullcount = 0; |
my $fullcount = 0; |
my $viewablecount = 0; |
my $viewablecount = 0; |
my $displaycount = 0; |
my $displaycount = 0; |
|
my $getmanagers = 1; |
my ($output,$roletype); |
my ($output,$roletype); |
my @showroles; |
my @showroles; |
if ($env{'request.role'} eq "au./$env{'user.domain'}/") { |
if ($env{'request.role'} eq "au./$env{'user.domain'}/") { |
Line 388 sub print_coauthors {
|
Line 389 sub print_coauthors {
|
($roletype) = ($env{'request.role'} =~ m{^(ca|aa)\./$audom/$auname$}); |
($roletype) = ($env{'request.role'} =~ m{^(ca|aa)\./$audom/$auname$}); |
if ($roletype ne '') { |
if ($roletype ne '') { |
@showroles = ($roletype); |
@showroles = ($roletype); |
|
if ($roletype eq 'aa') { |
|
undef($getmanagers); |
|
} |
} |
} |
} else { |
} else { |
@showroles = ('ca','aa'); |
@showroles = ('ca','aa'); |
Line 515 sub print_coauthors {
|
Line 519 sub print_coauthors {
|
} |
} |
$table .= &Apache::loncommon::end_data_table_header_row()."\n"; |
$table .= &Apache::loncommon::end_data_table_header_row()."\n"; |
my $count = 0; |
my $count = 0; |
|
my %camanagers; |
|
if ($getmanagers) { |
|
my %userenv = &Apache::lonnet::userenvironment($audom,$auname, |
|
'authormanagers'); |
|
map { $camanagers{$_} = 1; } split(/,/,$userenv{'authormanagers'}); |
|
} |
my @sorted = sort { |
my @sorted = sort { |
lc($showuser{$a}{fullname}) cmp lc($showuser{$b}{fullname}) |
lc($showuser{$a}{fullname}) cmp lc($showuser{$b}{fullname}) |
} (keys(%showuser)); |
} (keys(%showuser)); |
Line 523 sub print_coauthors {
|
Line 533 sub print_coauthors {
|
$count ++; |
$count ++; |
$table .= &Apache::loncommon::start_data_table_row()."\n". |
$table .= &Apache::loncommon::start_data_table_row()."\n". |
'<td>'.$count.'</td>'. |
'<td>'.$count.'</td>'. |
'<td>'.&Apache::loncommon::aboutmewrapper($showuser{$user}{fullname}, |
'<td>'; |
$username,$domain). |
if ($camanagers{$user}) { |
|
$table .= '<span style="font-face:bold;">*</span>'; |
|
} else { |
|
$table .= ' 'x2; |
|
} |
|
$table .= &Apache::loncommon::aboutmewrapper($showuser{$user}{fullname}, |
|
$username,$domain). |
'</td>'. |
'</td>'. |
'<td>'.&Apache::loncommon::messagewrapper |
'<td>'.&Apache::loncommon::messagewrapper |
('<img src="/adm/lonIcons/mailto.gif" border="0" /> '. |
('<img src="/adm/lonIcons/mailto.gif" border="0" /> '. |
Line 540 sub print_coauthors {
|
Line 556 sub print_coauthors {
|
} |
} |
$table .= &Apache::loncommon::end_data_table()."\n"; |
$table .= &Apache::loncommon::end_data_table()."\n"; |
$r->print($table); |
$r->print($table); |
|
if (keys(%camanagers)) { |
|
$r->print('<br /><span class="LC_fontsize_medium">'. |
|
&mt('[_1]*[_2] indicates co-author can add/revoke co-author roles', |
|
'<span style="font-face:bold;">','</span>'). |
|
'</span>'); |
|
} |
} else { |
} else { |
$r->print('<div class="LC_info">'.$output.'</div>'); |
$r->print('<div class="LC_info">'.$output.'</div>'); |
} |
} |