version 1.576, 2007/08/31 03:21:27
|
version 1.580, 2007/09/07 19:51:41
|
Line 860 sub help_menu_js {
|
Line 860 sub help_menu_js {
|
'js_ready' => 1, |
'js_ready' => 1, |
'add_entries' => { |
'add_entries' => { |
'border' => '0', |
'border' => '0', |
'rows' => "105,*",},}); |
'rows' => "110,*",},}); |
my $end_page = |
my $end_page = |
&Apache::loncommon::end_page({'frameset' => 1, |
&Apache::loncommon::end_page({'frameset' => 1, |
'js_ready' => 1,}); |
'js_ready' => 1,}); |
Line 4330 table#LC_helpmenu_links a:hover {
|
Line 4330 table#LC_helpmenu_links a:hover {
|
border: 1px solid #8888FF; |
border: 1px solid #8888FF; |
background: #CCCCFF; |
background: #CCCCFF; |
} |
} |
|
|
table.LC_pick_box { |
table.LC_pick_box { |
width: 100%; |
|
border-collapse: separate; |
border-collapse: separate; |
background: white; |
background: white; |
border: 1px solid black; |
border: 1px solid black; |
Line 4345 table.LC_pick_box td.LC_pick_box_title {
|
Line 4343 table.LC_pick_box td.LC_pick_box_title {
|
width: 184px; |
width: 184px; |
padding: 8px; |
padding: 8px; |
} |
} |
|
table.LC_pick_box td.LC_pick_box_value { |
|
text-align: left; |
|
padding: 8px; |
|
} |
|
table.LC_pick_box td.LC_pick_box_select { |
|
text-align: left; |
|
padding: 8px; |
|
} |
table.LC_pick_box td.LC_pick_box_separator { |
table.LC_pick_box td.LC_pick_box_separator { |
padding: 0px; |
padding: 0px; |
height: 1px; |
height: 1px; |
Line 4353 table.LC_pick_box td.LC_pick_box_separat
|
Line 4359 table.LC_pick_box td.LC_pick_box_separat
|
table.LC_pick_box td.LC_pick_box_submit { |
table.LC_pick_box td.LC_pick_box_submit { |
text-align: right; |
text-align: right; |
} |
} |
|
table.LC_pick_box td.LC_evenrow_value { |
|
text-align: left; |
|
padding: 8px; |
|
background-color: $data_table_light; |
|
} |
|
table.LC_pick_box td.LC_oddrow_value { |
|
text-align: left; |
|
padding: 8px; |
|
background-color: $data_table_light; |
|
} |
|
table.LC_helpform_receipt { |
|
width: 620px; |
|
border-collapse: separate; |
|
background: white; |
|
border: 1px solid black; |
|
border-spacing: 1px; |
|
} |
|
table.LC_helpform_receipt td.LC_pick_box_title { |
|
background: $tabbg; |
|
font-weight: bold; |
|
text-align: right; |
|
width: 184px; |
|
padding: 8px; |
|
} |
|
table.LC_helpform_receipt td.LC_evenrow_value { |
|
text-align: left; |
|
padding: 8px; |
|
background-color: $data_table_light; |
|
} |
|
table.LC_helpform_receipt td.LC_oddrow_value { |
|
text-align: left; |
|
padding: 8px; |
|
background-color: $data_table_light; |
|
} |
|
table.LC_helpform_receipt td.LC_pick_box_separator { |
|
padding: 0px; |
|
height: 1px; |
|
background: black; |
|
} |
|
span.LC_helpform_receipt_cat { |
|
font-weight: bold; |
|
} |
table.LC_group_priv_box { |
table.LC_group_priv_box { |
background: white; |
background: white; |
border: 1px solid black; |
border: 1px solid black; |
Line 5604 sub user_picker {
|
Line 5651 sub user_picker {
|
my $currdom = $dom; |
my $currdom = $dom; |
my %curr_selected = ( |
my %curr_selected = ( |
srchin => 'dom', |
srchin => 'dom', |
srchby => 'uname', |
srchby => 'lastname', |
); |
); |
my $srchterm; |
my $srchterm; |
if (ref($srch) eq 'HASH') { |
if (ref($srch) eq 'HASH') { |
Line 5666 sub user_picker {
|
Line 5713 sub user_picker {
|
$srchinsel .= "\n </select>\n"; |
$srchinsel .= "\n </select>\n"; |
|
|
my $srchbysel = ' <select name="srchby">'; |
my $srchbysel = ' <select name="srchby">'; |
foreach my $option ('uname','lastname','lastfirst') { |
foreach my $option ('lastname','lastfirst','uname') { |
if ($curr_selected{'srchby'} eq $option) { |
if ($curr_selected{'srchby'} eq $option) { |
$srchbysel .= ' |
$srchbysel .= ' |
<option value="'.$option.'" selected="selected">'.$lt{$option}.'</option>'; |
<option value="'.$option.'" selected="selected">'.$lt{$option}.'</option>'; |
Line 5678 sub user_picker {
|
Line 5725 sub user_picker {
|
$srchbysel .= "\n </select>\n"; |
$srchbysel .= "\n </select>\n"; |
|
|
my $srchtypesel = ' <select name="srchtype">'; |
my $srchtypesel = ' <select name="srchtype">'; |
foreach my $option ('exact','begins','contains') { |
foreach my $option ('begins','contains','exact') { |
if ($curr_selected{'srchtype'} eq $option) { |
if ($curr_selected{'srchtype'} eq $option) { |
$srchtypesel .= ' |
$srchtypesel .= ' |
<option value="'.$option.'" selected="selected">'.$lt{$option}.'</option>'; |
<option value="'.$option.'" selected="selected">'.$lt{$option}.'</option>'; |
Line 5695 sub user_picker {
|
Line 5742 sub user_picker {
|
if (ref($srch) eq 'HASH') { |
if (ref($srch) eq 'HASH') { |
if ($srch->{'srchby'} eq 'uname' && $srch->{'srchtype'} eq 'exact' && $srch->{'srchin'} eq 'dom' && $srch->{'srchdomain'} eq $env{'request.role.domain'}) { |
if ($srch->{'srchby'} eq 'uname' && $srch->{'srchtype'} eq 'exact' && $srch->{'srchin'} eq 'dom' && $srch->{'srchdomain'} eq $env{'request.role.domain'}) { |
$new_user_create = '<p> <input type="submit" name="forcenew" value="'.&HTML::Entities::encode(&mt('Make new user "[_1]"',$srchterm),'<>&"').'" onclick="javascript:setSearch(\'1\','.$caller.');" /> </p>'; |
$new_user_create = '<p> <input type="submit" name="forcenew" value="'.&HTML::Entities::encode(&mt('Make new user "[_1]"',$srchterm),'<>&"').'" onclick="javascript:setSearch(\'1\','.$caller.');" /> </p>'; |
} else { |
|
$new_user_create = &newuser_radio($caller); |
|
} |
} |
} else { |
|
$new_user_create = &newuser_radio($caller); |
|
} |
} |
|
|
$newuserscript = <<"ENDSCRIPT"; |
$newuserscript = <<"ENDSCRIPT"; |
Line 5827 END_BLOCK
|
Line 5870 END_BLOCK
|
return $output; |
return $output; |
} |
} |
|
|
sub newuser_radio { |
|
my ($caller) = @_; |
|
return '<span class="LC_nobreak">'.&mt('Make new user if no match found: ').'<input type="radio" name="forcenew" value="1" onclick="javascript:setSearch(\'1\','.$caller.')" />'.&mt('Yes').' <input type="radio" name="forcenew" value="0" checked="checked" />'.&mt('No').'</span><br />'; |
|
} |
|
|
|
|
|
|
|
=pod |
=pod |
|
|
=back |
=back |
Line 6994 sub commit_studentrole {
|
Line 7030 sub commit_studentrole {
|
############################################################ |
############################################################ |
|
|
sub check_clone { |
sub check_clone { |
my ($args) = @_; |
my ($args,$linefeed) = @_; |
my $cloneid='/'.$args->{'clonedomain'}.'/'.$args->{'clonecourse'}; |
my $cloneid='/'.$args->{'clonedomain'}.'/'.$args->{'clonecourse'}; |
my ($clonecrsudom,$clonecrsunum)= &LONCAPA::split_courseid($cloneid); |
my ($clonecrsudom,$clonecrsunum)= &LONCAPA::split_courseid($cloneid); |
my $clonehome=&Apache::lonnet::homeserver($clonecrsunum,$clonecrsudom); |
my $clonehome=&Apache::lonnet::homeserver($clonecrsunum,$clonecrsudom); |
Line 7002 sub check_clone {
|
Line 7038 sub check_clone {
|
my $can_clone = 0; |
my $can_clone = 0; |
|
|
if ($clonehome eq 'no_host') { |
if ($clonehome eq 'no_host') { |
$clonemsg = &mt('Attempting to clone non-existing [_1]', |
$clonemsg = &mt('No new course created.').$linefeed.&mt('A new course could not be cloned from the specified original - [_1] - because it is a non-existent course.',$args->{'clonecourse'}.':'.$args->{'clonedomain'}); |
$args->{'crstype'}); |
|
} else { |
} else { |
my %clonedesc = &Apache::lonnet::coursedescription($cloneid,{'one_time' => 1}); |
my %clonedesc = &Apache::lonnet::coursedescription($cloneid,{'one_time' => 1}); |
if ($env{'request.role.domain'} eq $args->{'clonedomain'}) { |
if ($env{'request.role.domain'} eq $args->{'clonedomain'}) { |
Line 7012 sub check_clone {
|
Line 7047 sub check_clone {
|
my %clonehash = &Apache::lonnet::get('environment',['cloners'], |
my %clonehash = &Apache::lonnet::get('environment',['cloners'], |
$args->{'clonedomain'},$args->{'clonecourse'}); |
$args->{'clonedomain'},$args->{'clonecourse'}); |
my @cloners = split(/,/,$clonehash{'cloners'}); |
my @cloners = split(/,/,$clonehash{'cloners'}); |
my %roleshash = |
if (grep(/^\*$/,@cloners)) { |
&Apache::lonnet::get_my_roles($args->{'ccuname'}, |
$can_clone = 1; |
$args->{'ccdomain'},'userroles',['active'],['cc'], |
} elsif (grep(/^\*\:\Q$args->{'ccdomain'}\E$/,@cloners)) { |
[$args->{'clonedomain'}]); |
$can_clone = 1; |
if (($roleshash{$args->{'clonecourse'}.':'.$args->{'clonedomain'}.':cc'}) || (grep(/^\Q$args->{'ccuname'}\E:\Q$args->{'ccdomain'}\E$/,@cloners))) { |
} else { |
$can_clone = 1; |
my %roleshash = |
} else { |
&Apache::lonnet::get_my_roles($args->{'ccuname'}, |
$clonemsg = &mt('The new course was not cloned from an existing course because the new course owner ([_1]) does not have cloning rights in the existing course ([_2]).',$args->{'ccuname'}.':'.$args->{'ccdomain'},$clonedesc{'description'}); |
$args->{'ccdomain'}, |
|
'userroles',['active'],['cc'], |
|
[$args->{'clonedomain'}]); |
|
if (($roleshash{$args->{'clonecourse'}.':'.$args->{'clonedomain'}.':cc'}) || (grep(/^\Q$args->{'ccuname'}\E:\Q$args->{'ccdomain'}\E$/,@cloners))) { |
|
$can_clone = 1; |
|
} else { |
|
$clonemsg = &mt('No new course created.').$linefeed.&mt('The new course could not be cloned from the existing course because the new course owner ([_1]) does not have cloning rights in the existing course ([_2]).',$args->{'ccuname'}.':'.$args->{'ccdomain'},$clonedesc{'description'}); |
|
} |
} |
} |
} |
} |
} |
} |
|
|
return ($can_clone, $clonemsg, $cloneid, $clonehome); |
return ($can_clone, $clonemsg, $cloneid, $clonehome); |
} |
} |
|
|
Line 7040 sub construct_course {
|
Line 7081 sub construct_course {
|
# |
# |
my ($can_clone, $clonemsg, $cloneid, $clonehome); |
my ($can_clone, $clonemsg, $cloneid, $clonehome); |
if (($args->{'clonecourse'}) && ($args->{'clonedomain'})) { |
if (($args->{'clonecourse'}) && ($args->{'clonedomain'})) { |
($can_clone, $clonemsg, $cloneid, $clonehome) = &check_clone($args); |
($can_clone, $clonemsg, $cloneid, $clonehome) = &check_clone($args,$linefeed); |
if ($context ne 'auto') { |
if ($context ne 'auto') { |
$clonemsg = '<span class="LC_error">'.$clonemsg.'</span>'; |
if ($clonemsg ne '') { |
|
$clonemsg = '<span class="LC_error">'.$clonemsg.'</span>'; |
|
} |
} |
} |
$outcome .= $clonemsg.$linefeed; |
$outcome .= $clonemsg.$linefeed; |
|
|