version 1.156, 2007/06/11 22:33:27
|
version 1.162, 2007/07/30 00:31:27
|
Line 65 use Apache::lonnet;
|
Line 65 use Apache::lonnet;
|
use Apache::loncommon; |
use Apache::loncommon; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::longroup; |
use Apache::longroup; |
use lib '/home/httpd/lib/perl/'; |
|
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
|
|
my $loginscript; # piece of javascript used in two separate instances |
my $loginscript; # piece of javascript used in two separate instances |
Line 194 END_SCRIPT
|
Line 193 END_SCRIPT
|
# =================================================================== Phase one |
# =================================================================== Phase one |
|
|
sub print_username_entry_form { |
sub print_username_entry_form { |
my ($r) = @_; |
my ($r,$response,$srch,$forcenewuser) = @_; |
my $defdom=$env{'request.role.domain'}; |
my $defdom=$env{'request.role.domain'}; |
my $domform = &Apache::loncommon::select_dom_form($defdom,'ccdomain'); |
my $formtoset = 'crtuser'; |
my $selscript=&Apache::loncommon::studentbrowser_javascript(); |
if (exists($env{'form.startrolename'})) { |
|
$formtoset = 'docustom'; |
|
$env{'form.rolename'} = $env{'form.startrolename'}; |
|
} |
|
|
|
my ($jsback,$elements) = &crumb_utilities(); |
|
|
|
my $jscript = &Apache::loncommon::studentbrowser_javascript()."\n". |
|
'<script type"text/javascript">'."\n". |
|
&Apache::lonhtmlcommon::set_form_elements($elements->{$formtoset}). |
|
'</script>'."\n"; |
|
|
|
my %loaditems = ( |
|
'onload' => "javascript:setFormElements(document.$formtoset)", |
|
); |
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page('Create Users, Change User Privileges', |
&Apache::loncommon::start_page('Create Users, Change User Privileges', |
$selscript); |
$jscript,{'add_entries' => \%loaditems,}); |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:backPage(document.crtuser)", |
|
text=>"User/custom role search", |
|
faq=>282,bug=>'Instructor Interface',}); |
|
|
my $sellink=&Apache::loncommon::selectstudent_link |
my $crumbs = &Apache::lonhtmlcommon::breadcrumbs('User Management'); |
('crtuser','ccuname','ccdomain'); |
|
my %existingroles=&my_custom_roles(); |
my %existingroles=&my_custom_roles(); |
my $choice=&Apache::loncommon::select_form('make new role','rolename', |
my $choice=&Apache::loncommon::select_form('make new role','rolename', |
('make new role' => 'Generate new role ...',%existingroles)); |
('make new role' => 'Generate new role ...',%existingroles)); |
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'siur' => "Set Individual User Roles", |
'srch' => "User Search", |
|
or => "or", |
|
'siur' => "Set Individual User Roles", |
'usr' => "Username", |
'usr' => "Username", |
'dom' => "Domain", |
'dom' => "Domain", |
'usrr' => "User Roles", |
|
'ecrp' => "Edit Custom Role Privileges", |
'ecrp' => "Edit Custom Role Privileges", |
'nr' => "Name of Role", |
'nr' => "Name of Role", |
'cre' => "Custom Role Editor" |
'cre' => "Custom Role Editor", |
); |
); |
my $help = &Apache::loncommon::help_open_menu(undef,undef,282,'Instructor Interface'); |
my $help = &Apache::loncommon::help_open_menu(undef,undef,282,'Instructor Interface'); |
my $helpsiur=&Apache::loncommon::help_open_topic('Course_Change_Privileges'); |
my $helpsiur=&Apache::loncommon::help_open_topic('Course_Change_Privileges'); |
my $helpecpr=&Apache::loncommon::help_open_topic('Course_Editing_Custom_Roles'); |
my $helpecpr=&Apache::loncommon::help_open_topic('Course_Editing_Custom_Roles'); |
$r->print(<<"ENDDOCUMENT"); |
my $sellink=&Apache::loncommon::selectstudent_link('crtuser','srchterm','srchdomain'); |
|
if ($sellink) { |
|
$sellink = "$lt{'or'} ".$sellink; |
|
} |
|
$r->print(" |
$start_page |
$start_page |
<form action="/adm/createuser" method="post" name="crtuser"> |
$crumbs |
<input type="hidden" name="phase" value="get_user_info"> |
|
<h2>$lt{siur}$helpsiur</h2> |
<h2>$lt{siur}$helpsiur</h2> |
<table> |
<h3>$lt{'srch'} $sellink</h3> |
<tr><td>$lt{usr}:</td><td><input type="text" size="15" name="ccuname"> |
$response"); |
</td><td rowspan="2">$sellink</td></tr><tr><td> |
$r->print(&entry_form($defdom,$srch,$forcenewuser)); |
$lt{'dom'}:</td><td>$domform</td></tr> |
if (&Apache::lonnet::allowed('mcr','/')) { |
</table> |
$r->print(<<ENDCUSTOM); |
<input name="userrole" type="submit" value="$lt{usrr}" /> |
|
</form> |
|
ENDDOCUMENT |
|
if (&Apache::lonnet::allowed('mcr','/')) { |
|
$r->print(<<ENDCUSTOM); |
|
<form action="/adm/createuser" method="post" name="docustom"> |
<form action="/adm/createuser" method="post" name="docustom"> |
<input type="hidden" name="phase" value="selected_custom_edit"> |
<input type="hidden" name="phase" value="selected_custom_edit" /> |
<h2>$lt{'ecrp'}$helpecpr</h2> |
<h2>$lt{'ecrp'}$helpecpr</h2> |
$lt{'nr'}: $choice <input type="text" size="15" name="newrolename" /><br /> |
$lt{'nr'}: $choice <input type="text" size="15" name="newrolename" /><br /> |
<input name="customeditor" type="submit" value="$lt{'cre'}" /> |
<input name="customeditor" type="submit" value="$lt{'cre'}" /> |
Line 245 ENDCUSTOM
|
Line 260 ENDCUSTOM
|
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
|
sub entry_form { |
|
my ($dom,$srch,$forcenewuser) = @_; |
|
my $userpicker = |
|
&Apache::loncommon::user_picker($dom,$srch,$forcenewuser); |
|
my $srchbutton = &mt('Search'); |
|
my $output = <<"ENDDOCUMENT"; |
|
<form action="/adm/createuser" method="post" name="crtuser"> |
|
<input type="hidden" name="phase" value="get_user_info" /> |
|
$userpicker |
|
<input name="userrole" type="button" value="$srchbutton" onclick="javascript:validateEntry()" /> |
|
</form> |
|
ENDDOCUMENT |
|
return $output; |
|
} |
|
|
sub user_modification_js { |
sub user_modification_js { |
my ($pjump_def,$dc_setcourse_code,$nondc_setsection_code,$groupslist)=@_; |
my ($pjump_def,$dc_setcourse_code,$nondc_setsection_code,$groupslist)=@_; |
Line 274 END
|
Line 303 END
|
} |
} |
|
|
# =================================================================== Phase two |
# =================================================================== Phase two |
sub print_user_modification_page { |
sub print_user_selection_page { |
my $r=shift; |
my ($r,$response,$srch,$srch_results) = @_; |
my $ccuname =&LONCAPA::clean_username($env{'form.ccuname'}); |
my @fields = ('username','domain','lastname','firstname','permanentemail'); |
my $ccdomain=&LONCAPA::clean_domain($env{'form.ccdomain'}); |
my $sortby = $env{'form.sortby'}; |
|
|
|
if (!grep(/^\Q$sortby\E$/,@fields)) { |
|
$sortby = 'lastname'; |
|
} |
|
|
|
my ($jsback,$elements) = &crumb_utilities(); |
|
|
|
my $jscript = (<<ENDSCRIPT); |
|
<script type="text/javascript"> |
|
function pickuser(uname,udom) { |
|
document.usersrchform.seluname.value=uname; |
|
document.usersrchform.seludom.value=udom; |
|
document.usersrchform.phase.value="userpicked"; |
|
document.usersrchform.submit(); |
|
} |
|
|
|
$jsback |
|
</script> |
|
ENDSCRIPT |
|
|
|
my %lt=&Apache::lonlocal::texthash( |
|
'srch' => "User Search", |
|
'username' => "username", |
|
'domain' => "domain", |
|
'lastname' => "last name", |
|
'firstname' => "first name", |
|
'permanentemail' => "permanent e-mail", |
|
); |
|
$r->print(&Apache::loncommon::start_page('Create Users, Change User Privileges',$jscript)); |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:backPage(document.usersrchform,'','')", |
|
text=>"User/custom role search", |
|
faq=>282,bug=>'Instructor Interface',}, |
|
{href=>"javascript:backPage(document.usersrchform,'get_user_info','select')", |
|
text=>"Select User", |
|
faq=>282,bug=>'Instructor Interface',}); |
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management')); |
|
$r->print("<b>$lt{'srch'}</b><br />"); |
|
$r->print(&entry_form($srch->{'srchdomain'},$srch)); |
|
$r->print('<h3>'.&mt('Select a user').'</h3>'); |
|
$r->print('<form name="usersrchform" method="post">'. |
|
&Apache::loncommon::start_data_table()."\n". |
|
&Apache::loncommon::start_data_table_header_row()."\n". |
|
' <th> </th>'."\n"); |
|
foreach my $field (@fields) { |
|
$r->print(' <th><a href="javascript:document.usersrchform.sortby.value='. |
|
"'".$field."'".';document.usersrchform.submit();">'. |
|
$lt{$field}.'</a></th>'."\n"); |
|
} |
|
$r->print(&Apache::loncommon::end_data_table_header_row()); |
|
|
|
my @sorted_users = sort { |
|
lc($srch_results->{$a}->{$sortby}) cmp lc($srch_results->{$b}->{$sortby}) |
|
|| |
|
lc($srch_results->{$a}->{lastname}) cmp lc($srch_results->{$b}->{lastname}) |
|
|| |
|
lc($srch_results->{$a}->{firstname}) cmp lc($srch_results->{$b}->{firstname}) |
|
} (keys(%$srch_results)); |
|
|
|
foreach my $user (@sorted_users) { |
|
my ($uname,$udom) = split(/:/,$user); |
|
$r->print(&Apache::loncommon::start_data_table_row(). |
|
'<td><input type="button" name="seluser" value="'.&mt('Select').'" onclick="javascript:pickuser('."'".$uname."'".','."'".$udom."'".')" /></td>'. |
|
'<td><tt>'.$uname.'</tt></td>'. |
|
'<td><tt>'.$udom.'</tt></td>'); |
|
foreach my $field ('lastname','firstname','permanentemail') { |
|
$r->print('<td>'.$srch_results->{$user}->{$field}.'</td>'); |
|
} |
|
$r->print(&Apache::loncommon::end_data_table_row()); |
|
} |
|
$r->print(&Apache::loncommon::end_data_table().'<br /><br />'); |
|
$r->print(&Apache::lonhtmlcommon::echo_form_input(['sortby','seluname','seludom','state','phase'])); |
|
$r->print(' <input type="hidden" name="sortby" value="'.$sortby.'" />'."\n". |
|
' <input type="hidden" name="seluname" value="" />'."\n". |
|
' <input type="hidden" name="seludom" value="" />'."\n". |
|
' <input type="hidden" name="state" value="select" />'."\n". |
|
' <input type="hidden" name="phase" value="get_user_info" />'."\n". |
|
'</form>'); |
|
$r->print($response); |
|
$r->print(&Apache::loncommon::end_page()); |
|
} |
|
|
|
sub print_user_query_page { |
|
my ($r) = @_; |
|
# FIXME - this is for a network-wide name search (similar to catalog search) |
|
# To use frames with similar behavior to catalog/portfolio search. |
|
# To be implemented. |
|
return; |
|
} |
|
|
|
sub print_user_modification_page { |
|
my ($r,$ccuname,$ccdomain,$srch,$response) = @_; |
unless (($ccuname) && ($ccdomain)) { |
unless (($ccuname) && ($ccdomain)) { |
&print_username_entry_form($r); |
&print_username_entry_form($r); |
return; |
return; |
} |
} |
|
if ($response) { |
|
$response = '<br />'.$response |
|
} |
my $defdom=$env{'request.role.domain'}; |
my $defdom=$env{'request.role.domain'}; |
|
|
my ($krbdef,$krbdefdom) = |
my ($krbdef,$krbdefdom) = |
Line 292 sub print_user_modification_page {
|
Line 414 sub print_user_modification_page {
|
my %param = ( formname => 'document.cu', |
my %param = ( formname => 'document.cu', |
kerb_def_dom => $krbdefdom, |
kerb_def_dom => $krbdefdom, |
kerb_def_auth => $krbdef |
kerb_def_auth => $krbdef |
); |
); |
$loginscript = &Apache::loncommon::authform_header(%param); |
$loginscript = &Apache::loncommon::authform_header(%param); |
$authformkrb = &Apache::loncommon::authform_kerberos(%param); |
$authformkrb = &Apache::loncommon::authform_kerberos(%param); |
|
|
$ccuname =&LONCAPA::clean_username($ccuname); |
|
$ccdomain=&LONCAPA::clean_domain($ccdomain); |
|
my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition(); |
my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition(); |
my $dc_setcourse_code = ''; |
my $dc_setcourse_code = ''; |
my $nondc_setsection_code = ''; |
my $nondc_setsection_code = ''; |
Line 429 ENDSCRIPT
|
Line 549 ENDSCRIPT
|
var checkcurr = str.match(re1); |
var checkcurr = str.match(re1); |
if (checkcurr != null) { |
if (checkcurr != null) { |
if (document.cu.elements[i-1].checked == true) { |
if (document.cu.elements[i-1].checked == true) { |
var re2 = /^currsec_[a-zA-Z0-9]+_[a-zA-Z0-9]+_(\\w+)\$/; |
var match = str.split('_'); |
match = re2.exec(str); |
var role = match[3]; |
var role = match[1]; |
|
if (role == 'cc') { |
if (role == 'cc') { |
alert("Section designations do not apply to Course Coordinator roles.\\nA course coordinator role will be added with access to all sections."); |
alert("Section designations do not apply to Course Coordinator roles.\\nA course coordinator role will be added with access to all sections."); |
} |
} |
Line 500 ENDSECCODE
|
Line 619 ENDSECCODE
|
} |
} |
my $js = &user_modification_js($pjump_def,$dc_setcourse_code, |
my $js = &user_modification_js($pjump_def,$dc_setcourse_code, |
$nondc_setsection_code,$groupslist); |
$nondc_setsection_code,$groupslist); |
|
|
|
my ($jsback,$elements) = &crumb_utilities(); |
|
|
|
$js .= "\n". |
|
'<script type="text/javascript">'."\n".$jsback."\n".'</script>'; |
|
|
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page('Create Users, Change User Privileges', |
&Apache::loncommon::start_page('Create Users, Change User Privileges', |
$js,{'add_entries' => \%loaditem,}); |
$js,{'add_entries' => \%loaditem,}); |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:backPage(document.cu)", |
|
text=>"User/custom role search", |
|
faq=>282,bug=>'Instructor Interface',}); |
|
|
|
if ($env{'form.phase'} eq 'userpicked') { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:backPage(document.cu,'get_user_info','select')", |
|
text=>"Select a user", |
|
faq=>282,bug=>'Instructor Interface',}); |
|
} |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:backPage(document.cu,'$env{'form.phase'}','modify')", |
|
text=>"Set user role", |
|
faq=>282,bug=>'Instructor Interface',}); |
|
my $crumbs = &Apache::lonhtmlcommon::breadcrumbs('User Management'); |
|
|
my $forminfo =<<"ENDFORMINFO"; |
my $forminfo =<<"ENDFORMINFO"; |
<form action="/adm/createuser" method="post" name="cu"> |
<form action="/adm/createuser" method="post" name="cu"> |
<input type="hidden" name="phase" value="update_user_data"> |
<input type="hidden" name="phase" value="update_user_data" /> |
<input type="hidden" name="ccuname" value="$ccuname"> |
<input type="hidden" name="ccuname" value="$ccuname" /> |
<input type="hidden" name="ccdomain" value="$ccdomain"> |
<input type="hidden" name="ccdomain" value="$ccdomain" /> |
<input type="hidden" name="pres_value" value="" > |
<input type="hidden" name="pres_value" value="" /> |
<input type="hidden" name="pres_type" value="" > |
<input type="hidden" name="pres_type" value="" /> |
<input type="hidden" name="pres_marker" value="" > |
<input type="hidden" name="pres_marker" value="" /> |
ENDFORMINFO |
ENDFORMINFO |
my $uhome=&Apache::lonnet::homeserver($ccuname,$ccdomain); |
my $uhome=&Apache::lonnet::homeserver($ccuname,$ccdomain); |
my %inccourses; |
my %inccourses; |
Line 521 ENDFORMINFO
|
Line 662 ENDFORMINFO
|
} |
} |
} |
} |
if ($uhome eq 'no_host') { |
if ($uhome eq 'no_host') { |
|
my $newuser; |
|
my $instsrch = { |
|
srchin => 'instd', |
|
srchby => 'uname', |
|
srchtype => 'exact', |
|
}; |
|
if ($env{'form.phase'} eq 'userpicked') { |
|
$instsrch->{'srchterm'} = $env{'form.seluname'}; |
|
$instsrch->{'srchdomain'} = $env{'form.seludom'}; |
|
} else { |
|
$instsrch->{'srchterm'} = $ccuname; |
|
$instsrch->{'srchdomain'} = $ccdomain, |
|
} |
|
if (($instsrch->{'srchterm'} ne '') && ($instsrch->{'srchdomain'} ne '')) { |
|
$newuser = $instsrch->{'srchterm'}.':'.$instsrch->{'srchdomain'}; |
|
} |
|
my (%dirsrch_results,%inst_results); |
|
if ($newuser) { |
|
if (&directorysrch_check($instsrch) eq 'ok') { |
|
%dirsrch_results = &Apache::lonnet::inst_directory_query($instsrch); |
|
if (ref($dirsrch_results{$newuser}) eq 'HASH') { |
|
%inst_results = %{$dirsrch_results{$newuser}}; |
|
} |
|
} |
|
} |
my $home_server_list= |
my $home_server_list= |
'<option value="default" selected>default</option>'."\n". |
'<option value="default" selected>default</option>'."\n". |
&Apache::loncommon::home_server_option_list($ccdomain); |
&Apache::loncommon::home_server_option_list($ccdomain); |
Line 534 ENDFORMINFO
|
Line 700 ENDFORMINFO
|
'mn' => "Middle Name", |
'mn' => "Middle Name", |
'ln' => "Last Name", |
'ln' => "Last Name", |
'gen' => "Generation", |
'gen' => "Generation", |
|
'mail' => "Permanent e-mail address", |
'idsn' => "ID/Student Number", |
'idsn' => "ID/Student Number", |
'hs' => "Home Server", |
'hs' => "Home Server", |
'lg' => "Login Data" |
'lg' => "Login Data" |
Line 547 ENDFORMINFO
|
Line 714 ENDFORMINFO
|
&initialize_authen_forms(); |
&initialize_authen_forms(); |
$r->print(<<ENDNEWUSER); |
$r->print(<<ENDNEWUSER); |
$start_page |
$start_page |
|
$crumbs |
<h1>$lt{'cnu'}</h1> |
<h1>$lt{'cnu'}</h1> |
|
$response |
$forminfo |
$forminfo |
<h2>$lt{'nu'} "$ccuname" $lt{'id'} $ccdomain</h2> |
<h2>$lt{'nu'} "$ccuname" $lt{'id'} $ccdomain</h2> |
<script type="text/javascript" language="Javascript"> |
<script type="text/javascript" language="Javascript"> |
Line 558 $loginscript
|
Line 727 $loginscript
|
<p> |
<p> |
<table> |
<table> |
<tr><td>$lt{'fn'} </td> |
<tr><td>$lt{'fn'} </td> |
<td><input type='text' name='cfirst' size='15' /></td></tr> |
<td><input type="text" name="cfirst" size="15" value="$inst_results{'firstname'}" /></td></tr> |
<tr><td>$lt{'mn'} </td> |
<tr><td>$lt{'mn'} </td> |
<td><input type='text' name='cmiddle' size='15' /></td></tr> |
<td><input type="text" name="cmiddle" size="15" value="$inst_results{'middlename'}" /></td></tr> |
<tr><td>$lt{'ln'} </td> |
<tr><td>$lt{'ln'} </td> |
<td><input type='text' name='clast' size='15' /></td></tr> |
<td><input type="text" name="clast" size="15" value="$inst_results{'lastname'}" /></td></tr> |
<tr><td>$lt{'gen'}$genhelp</td> |
<tr><td>$lt{'gen'}$genhelp</td> |
<td><input type='text' name='cgen' size='5' /></td></tr> |
<td><input type="text" name="cgen" size="5" value="$inst_results{'generation'}" /></td></tr> |
|
<tr><td>$lt{'mail'}</td> |
|
<td><input type="text" name="cemail" size="20" value="$inst_results{'permanentemail'}" /></td></tr> |
</table> |
</table> |
$lt{'idsn'} <input type='text' name='cstid' size='15' /></p> |
$lt{'idsn'} <input type="text" name="cstid" size="15" value="$inst_results{'id'}" /></p> |
$lt{'hs'}: <select name="hserver" size="1"> $home_server_list </select> |
$lt{'hs'}: <select name="hserver" size="1"> $home_server_list </select> |
<hr /> |
<hr /> |
<h3>$lt{'lg'}</h3> |
<h3>$lt{'lg'}</h3> |
Line 586 ENDNEWUSER
|
Line 757 ENDNEWUSER
|
'fn' => "first name", |
'fn' => "first name", |
'mn' => "middle name", |
'mn' => "middle name", |
'ln' => "last name", |
'ln' => "last name", |
'gen' => "generation" |
'gen' => "generation", |
|
'email' => "permanent e-mail", |
); |
); |
$r->print(<<ENDCHANGEUSER); |
$r->print(<<ENDCHANGEUSER); |
$start_page |
$start_page |
|
$crumbs |
<h1>$lt{'cup'}</h1> |
<h1>$lt{'cup'}</h1> |
$forminfo |
$forminfo |
<h2>$lt{'usr'} "$ccuname" $lt{'id'} "$ccdomain"</h2> |
<h2>$lt{'usr'} "$ccuname" $lt{'id'} "$ccdomain"</h2> |
ENDCHANGEUSER |
ENDCHANGEUSER |
# Get the users information |
# Get the users information |
my %userenv = &Apache::lonnet::get('environment', |
my %userenv = |
['firstname','middlename','lastname','generation', |
&Apache::lonnet::get('environment', |
'portfolioquota'],$ccdomain,$ccuname); |
['firstname','middlename','lastname','generation', |
|
'permanentemail','portfolioquota'],$ccdomain,$ccuname); |
my %rolesdump=&Apache::lonnet::dump('roles',$ccdomain,$ccuname); |
my %rolesdump=&Apache::lonnet::dump('roles',$ccdomain,$ccuname); |
$r->print(' |
$r->print(' |
<hr />'. |
<hr />'. |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table_header_row(). |
&Apache::loncommon::start_data_table_header_row(). |
'<th>'.$lt{'fn'}.'</th><th>'.$lt{'mn'}.'</th><th>'.$lt{'ln'}.'</th><th>'.$lt{'gen'}.'</th>'. |
'<th>'.$lt{'fn'}.'</th><th>'.$lt{'mn'}.'</th><th>'.$lt{'ln'}.'</th><th>'.$lt{'gen'}.'</th><th>'.$lt{'email'}.'</th>'. |
&Apache::loncommon::end_data_table_header_row(). |
&Apache::loncommon::end_data_table_header_row(). |
&Apache::loncommon::start_data_table_row()); |
&Apache::loncommon::start_data_table_row()); |
foreach my $item ('firstname','middlename','lastname','generation') { |
foreach my $item ('firstname','middlename','lastname','generation','permenanentemail') { |
if (&Apache::lonnet::allowed('mau',$ccdomain)) { |
if (&Apache::lonnet::allowed('mau',$ccdomain)) { |
$r->print(<<"END"); |
$r->print(<<"END"); |
<td><input type="text" name="c$item" value="$userenv{$item}" size="15" /></td> |
<td><input type="text" name="c$item" value="$userenv{$item}" size="15" /></td> |
Line 730 END
|
Line 904 END
|
my $active=1; |
my $active=1; |
$active=0 if (($role_end_time) && ($now>$role_end_time)); |
$active=0 if (($role_end_time) && ($now>$role_end_time)); |
if (($active) && ($allowed)) { |
if (($active) && ($allowed)) { |
$row.= '<input type="checkbox" name="rev:'.$thisrole.'">'; |
$row.= '<input type="checkbox" name="rev:'.$thisrole.'" />'; |
} else { |
} else { |
if ($active) { |
if ($active) { |
$row.=' '; |
$row.=' '; |
Line 740 END
|
Line 914 END
|
} |
} |
$row.='</td><td>'; |
$row.='</td><td>'; |
if ($allowed && !$active) { |
if ($allowed && !$active) { |
$row.= '<input type="checkbox" name="ren:'.$thisrole.'">'; |
$row.= '<input type="checkbox" name="ren:'.$thisrole.'" />'; |
} else { |
} else { |
$row.=' '; |
$row.=' '; |
} |
} |
$row.='</td><td>'; |
$row.='</td><td>'; |
if ($delallowed) { |
if ($delallowed) { |
$row.= '<input type="checkbox" name="del:'.$thisrole.'">'; |
$row.= '<input type="checkbox" name="del:'.$thisrole.'" />'; |
} else { |
} else { |
$row.=' '; |
$row.=' '; |
} |
} |
Line 999 ENDNOPRIV
|
Line 1173 ENDNOPRIV
|
$num_domain_level ++; |
$num_domain_level ++; |
$domaintext .= |
$domaintext .= |
&Apache::loncommon::start_data_table_row(). |
&Apache::loncommon::start_data_table_row(). |
'<td><input type=checkbox name="act_'.$thisdomain.'_'.$role.'"></td> |
'<td><input type=checkbox name="act_'.$thisdomain.'_'.$role.'" /></td> |
<td>'.$plrole.'</td> |
<td>'.$plrole.'</td> |
<td>'.$thisdomain.'</td> |
<td>'.$thisdomain.'</td> |
<td><input type=hidden name="start_'.$thisdomain.'_'.$role.'" value=""> |
<td><input type=hidden name="start_'.$thisdomain.'_'.$role.'" value="" /> |
<a href= |
<a href= |
"javascript:pjump('."'date_start','Start Date $plrole',document.cu.start_$thisdomain\_$role.value,'start_$thisdomain\_$role','cu.pres','dateset'".')">'.$lt{'ssd'}.'</a></td> |
"javascript:pjump('."'date_start','Start Date $plrole',document.cu.start_$thisdomain\_$role.value,'start_$thisdomain\_$role','cu.pres','dateset'".')">'.$lt{'ssd'}.'</a></td> |
<td><input type=hidden name="end_'.$thisdomain.'_'.$role.'" value=""> |
<td><input type=hidden name="end_'.$thisdomain.'_'.$role.'" value="" /> |
<a href= |
<a href= |
"javascript:pjump('."'date_end','End Date $plrole',document.cu.end_$thisdomain\_$role.value,'end_$thisdomain\_$role','cu.pres','dateset'".')">'.$lt{'sed'}.'</a></td>'. |
"javascript:pjump('."'date_end','End Date $plrole',document.cu.end_$thisdomain\_$role.value,'end_$thisdomain\_$role','cu.pres','dateset'".')">'.$lt{'sed'}.'</a></td>'. |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
Line 1022 ENDNOPRIV
|
Line 1196 ENDNOPRIV
|
|
|
if ($env{'request.role'} =~ m{^dc\./($match_domain)/$}) { |
if ($env{'request.role'} =~ m{^dc\./($match_domain)/$}) { |
$r->print(&course_level_dc($1,'Course')); |
$r->print(&course_level_dc($1,'Course')); |
$r->print('<hr /><input type="button" value="'.&mt('Modify User').'" onClick="setCourse()">'."\n"); |
$r->print('<hr /><input type="button" value="'.&mt('Modify User').'" onClick="setCourse()" />'."\n"); |
} else { |
} else { |
$r->print(&course_level_table(%inccourses)); |
$r->print(&course_level_table(%inccourses)); |
$r->print('<hr /><input type="button" value="'.&mt('Modify User').'" onClick="setSections()">'."\n"); |
$r->print('<hr /><input type="button" value="'.&mt('Modify User').'" onClick="setSections()" />'."\n"); |
} |
} |
|
$r->print(&Apache::lonhtmlcommon::echo_form_input(['phase','userrole','ccdomain','prevphase','state'])); |
|
$r->print('<input type="hidden" name="state" value="" />'); |
|
$r->print('<input type="hidden" name="prevphase" value="'.$env{'form.phase'}.'" />'); |
$r->print("</form>".&Apache::loncommon::end_page()); |
$r->print("</form>".&Apache::loncommon::end_page()); |
} |
} |
|
|
# ================================================================= Phase Three |
# ================================================================= Phase Three |
sub update_user_data { |
sub update_user_data { |
my $r=shift; |
my ($r) = @_; |
my $uhome=&Apache::lonnet::homeserver($env{'form.ccuname'}, |
my $uhome=&Apache::lonnet::homeserver($env{'form.ccuname'}, |
$env{'form.ccdomain'}); |
$env{'form.ccdomain'}); |
# Error messages |
# Error messages |
Line 1045 sub update_user_data {
|
Line 1222 sub update_user_data {
|
} else { |
} else { |
$title='Modify User Privileges'; |
$title='Modify User Privileges'; |
} |
} |
$r->print(&Apache::loncommon::start_page($title)); |
|
|
my ($jsback,$elements) = &crumb_utilities(); |
|
my $jscript = '<script type="text/javascript">'."\n". |
|
$jsback."\n".'</script>'."\n"; |
|
|
|
$r->print(&Apache::loncommon::start_page($title,$jscript)); |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:backPage(document.userupdate)", |
|
text=>"User/custom role search", |
|
faq=>282,bug=>'Instructor Interface',}); |
|
if ($env{'form.prevphase'} eq 'userpicked') { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:backPage(document.userupdate,'get_user_info','select')", |
|
text=>"Select a user", |
|
faq=>282,bug=>'Instructor Interface',}); |
|
} |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:backPage(document.userupdate,'$env{'form.prevphase'}','modify')", |
|
text=>"Set user role", |
|
faq=>282,bug=>'Instructor Interface',}, |
|
{href=>"/adm/createuser", |
|
text=>"Result", |
|
faq=>282,bug=>'Instructor Interface',}); |
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management')); |
|
|
my %disallowed; |
my %disallowed; |
# Check Inputs |
# Check Inputs |
if (! $env{'form.ccuname'} ) { |
if (! $env{'form.ccuname'} ) { |
Line 1055 sub update_user_data {
|
Line 1256 sub update_user_data {
|
if ( $env{'form.ccuname'} ne |
if ( $env{'form.ccuname'} ne |
&LONCAPA::clean_username($env{'form.ccuname'}) ) { |
&LONCAPA::clean_username($env{'form.ccuname'}) ) { |
$r->print($error.&mt('Invalid login name').'. '. |
$r->print($error.&mt('Invalid login name').'. '. |
&mt('Only letters, numbers, and underscores are valid').'.'. |
&mt('Only letters, numbers, periods, dashes, @, and underscores are valid').'.'. |
$end); |
$end); |
return; |
return; |
} |
} |
Line 1176 ENDMODIFYUSERHEAD
|
Line 1377 ENDMODIFYUSERHEAD
|
# Check for need to change |
# Check for need to change |
my %userenv = &Apache::lonnet::get |
my %userenv = &Apache::lonnet::get |
('environment',['firstname','middlename','lastname','generation', |
('environment',['firstname','middlename','lastname','generation', |
'portfolioquota','inststatus'],$env{'form.ccdomain'}, |
'permanentemail','portfolioquota','inststatus'], |
$env{'form.ccuname'}); |
$env{'form.ccdomain'},$env{'form.ccuname'}); |
my ($tmp) = keys(%userenv); |
my ($tmp) = keys(%userenv); |
if ($tmp =~ /^(con_lost|error)/i) { |
if ($tmp =~ /^(con_lost|error)/i) { |
%userenv = (); |
%userenv = (); |
} |
} |
# Check to see if we need to change user information |
# Check to see if we need to change user information |
foreach my $item ('firstname','middlename','lastname','generation') { |
foreach my $item ('firstname','middlename','lastname','generation','permanentemail') { |
# Strip leading and trailing whitespace |
# Strip leading and trailing whitespace |
$env{'form.c'.$item} =~ s/(\s+$|^\s+)//g; |
$env{'form.c'.$item} =~ s/(\s+$|^\s+)//g; |
} |
} |
Line 1241 ENDMODIFYUSERHEAD
|
Line 1442 ENDMODIFYUSERHEAD
|
($env{'form.cfirstname'} ne $userenv{'firstname'} || |
($env{'form.cfirstname'} ne $userenv{'firstname'} || |
$env{'form.cmiddlename'} ne $userenv{'middlename'} || |
$env{'form.cmiddlename'} ne $userenv{'middlename'} || |
$env{'form.clastname'} ne $userenv{'lastname'} || |
$env{'form.clastname'} ne $userenv{'lastname'} || |
$env{'form.cgeneration'} ne $userenv{'generation'} )) { |
$env{'form.cgeneration'} ne $userenv{'generation'} || |
|
$env{'form.cpermanentemail'} ne $userenv{'permanentemail'} )) { |
$namechanged = 1; |
$namechanged = 1; |
} |
} |
if ($namechanged) { |
if ($namechanged) { |
Line 1250 ENDMODIFYUSERHEAD
|
Line 1452 ENDMODIFYUSERHEAD
|
$changeHash{'middlename'} = $env{'form.cmiddlename'}; |
$changeHash{'middlename'} = $env{'form.cmiddlename'}; |
$changeHash{'lastname'} = $env{'form.clastname'}; |
$changeHash{'lastname'} = $env{'form.clastname'}; |
$changeHash{'generation'} = $env{'form.cgeneration'}; |
$changeHash{'generation'} = $env{'form.cgeneration'}; |
|
$changeHash{'permanentemail'} = $env{'form.permanentemail'}; |
my $putresult = &Apache::lonnet::put |
my $putresult = &Apache::lonnet::put |
('environment',\%changeHash, |
('environment',\%changeHash, |
$env{'form.ccdomain'},$env{'form.ccuname'}); |
$env{'form.ccdomain'},$env{'form.ccuname'}); |
Line 1261 ENDMODIFYUSERHEAD
|
Line 1464 ENDMODIFYUSERHEAD
|
'mddl' => "middle", |
'mddl' => "middle", |
'lst' => "last", |
'lst' => "last", |
'gen' => "generation", |
'gen' => "generation", |
|
'mail' => "permanent e-mail", |
'disk' => "disk space allocated to portfolio files", |
'disk' => "disk space allocated to portfolio files", |
'prvs' => "Previous", |
'prvs' => "Previous", |
'chto' => "Changed To" |
'chto' => "Changed To" |
Line 1279 ENDMODIFYUSERHEAD
|
Line 1483 ENDMODIFYUSERHEAD
|
<td>$userenv{'middlename'} </td> |
<td>$userenv{'middlename'} </td> |
<td>$userenv{'lastname'} </td> |
<td>$userenv{'lastname'} </td> |
<td>$userenv{'generation'} </td> |
<td>$userenv{'generation'} </td> |
|
<td>$userenv{'permanentemail'} </td> |
<td>$oldportfolioquota Mb</td> |
<td>$oldportfolioquota Mb</td> |
</tr> |
</tr> |
<tr><td>$lt{'chto'}</td> |
<tr><td>$lt{'chto'}</td> |
Line 1286 ENDMODIFYUSERHEAD
|
Line 1491 ENDMODIFYUSERHEAD
|
<td>$env{'form.cmiddlename'} </td> |
<td>$env{'form.cmiddlename'} </td> |
<td>$env{'form.clastname'} </td> |
<td>$env{'form.clastname'} </td> |
<td>$env{'form.cgeneration'} </td> |
<td>$env{'form.cgeneration'} </td> |
|
<td>$env{'form.cpermanentemail'} </td> |
<td>$newportfolioquota Mb $defquotatext </td></tr> |
<td>$newportfolioquota Mb $defquotatext </td></tr> |
</table> |
</table> |
END |
END |
Line 1315 END
|
Line 1521 END
|
'usr' => "User", |
'usr' => "User", |
'id' => "in domain", |
'id' => "in domain", |
'gen' => "Generation", |
'gen' => "Generation", |
|
'mail' => "Permanent e-mail", |
'disk' => "Disk space allocated to user's portfolio files", |
'disk' => "Disk space allocated to user's portfolio files", |
); |
); |
$r->print(<<"END"); |
$r->print(<<"END"); |
<h2>$lt{'usr'} "$env{'form.ccuname'}" $lt{'id'} "$env{'form.ccdomain'}"</h2> |
<h2>$lt{'usr'} "$env{'form.ccuname'}" $lt{'id'} "$env{'form.ccdomain'}"</h2> |
<h4>$userenv{'firstname'} $userenv{'middlename'} $userenv{'lastname'} </h4> |
<h4>$userenv{'firstname'} $userenv{'middlename'} $userenv{'lastname'} </h4> |
<h4>$lt{'gen'}: $userenv{'generation'}</h4> |
<h4>$lt{'gen'}: $userenv{'generation'}</h4> |
|
<h4>$lt{'mail'}: $userenv{'permanentemail'}</h4> |
END |
END |
if ($putresult eq 'ok') { |
if ($putresult eq 'ok') { |
if ($oldportfolioquota != $newportfolioquota) { |
if ($oldportfolioquota != $newportfolioquota) { |
Line 1346 END
|
Line 1554 END
|
if ($2 eq 'st') { |
if ($2 eq 'st') { |
$1=~m{^/($match_domain)/($match_courseid)}; |
$1=~m{^/($match_domain)/($match_courseid)}; |
my $cid=$1.'_'.$2; |
my $cid=$1.'_'.$2; |
$r->print(&mt('Drop from classlist').': <b>'. |
my $user = $env{'form.ccuname'}.':'.$env{'form.ccdomain'}; |
&Apache::lonnet::critical('put:'. |
my $result = |
$env{'course.'.$cid.'.domain'}.':'. |
&Apache::lonnet::cput('classlist', |
$env{'course.'.$cid.'.num'}.':classlist:'. |
{ $user => $now }, |
&escape($env{'form.ccuname'}.':'. |
$env{'course.'.$cid.'.domain'}, |
$env{'form.ccdomain'}).'='. |
$env{'course.'.$cid.'.num'}); |
&escape($now.':'), |
$r->print(&mt('Drop from classlist: [_1]', |
$env{'course.'.$cid.'.home'}).'</b><br />'); |
'<b>'.$result.'</b>').'<br />'); |
} |
} |
} |
} |
if ($key=~m{^form\.rev\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}) { |
if ($key=~m{^form\.rev\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}) { |
Line 1373 END
|
Line 1581 END
|
if ($2 eq 'st') { |
if ($2 eq 'st') { |
$1=~m{^/($match_domain)/($match_courseid)}; |
$1=~m{^/($match_domain)/($match_courseid)}; |
my $cid=$1.'_'.$2; |
my $cid=$1.'_'.$2; |
$r->print(&mt('Drop from classlist').': <b>'. |
my $user = $env{'form.ccuname'}.':'.$env{'form.ccdomain'}; |
&Apache::lonnet::critical('put:'. |
my $result = |
$env{'course.'.$cid.'.domain'}.':'. |
&Apache::lonnet::cput('classlist', |
$env{'course.'.$cid.'.num'}.':classlist:'. |
{ $user => $now }, |
&escape($env{'form.ccuname'}.':'. |
$env{'course.'.$cid.'.domain'}, |
$env{'form.ccdomain'}).'='. |
$env{'course.'.$cid.'.num'}); |
&escape($now.':'), |
$r->print(&mt('Drop from classlist: [_1]', |
$env{'course.'.$cid.'.home'}).'</b><br />'); |
'<b>'.$result.'</b>').'<br />'); |
} |
} |
} |
} |
if ($key=~m{^form\.del\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}) { |
if ($key=~m{^form\.del\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}) { |
Line 1548 END
|
Line 1756 END
|
# Flush the course logs so reverse user roles immediately updated |
# Flush the course logs so reverse user roles immediately updated |
&Apache::lonnet::flushcourselogs(); |
&Apache::lonnet::flushcourselogs(); |
$r->print('<p><a href="/adm/createuser">Create/Modify Another User</a></p>'); |
$r->print('<p><a href="/adm/createuser">Create/Modify Another User</a></p>'); |
|
$r->print('<form name="userupdate" method="post" />'."\n"); |
|
foreach my $item ('srchby','srchin','srchtype','srchterm','srchdomain','ccuname','ccdomain') { |
|
$r->print('<input type="hidden" name="'.$item.'" value="'.$env{'form.'.$item}.'" />'."\n"); |
|
} |
|
foreach my $item ('sortby','seluname','seludom') { |
|
if (exists($env{'form.'.$item})) { |
|
$r->print('<input type="hidden" name="'.$item.'" value="'.$env{'form.'.$item}.'" />'."\n"); |
|
} |
|
} |
|
$r->print('<input type="hidden" name="phase" value="" />'."\n". |
|
'<input type ="hidden" name="state" value="" />'."\n". |
|
'</form>'); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
Line 1598 sub build_roles {
|
Line 1818 sub build_roles {
|
# ========================================================== Custom Role Editor |
# ========================================================== Custom Role Editor |
|
|
sub custom_role_editor { |
sub custom_role_editor { |
my $r=shift; |
my ($r) = @_; |
my $rolename=$env{'form.rolename'}; |
my $rolename=$env{'form.rolename'}; |
|
|
if ($rolename eq 'make new role') { |
if ($rolename eq 'make new role') { |
Line 1664 sub custom_role_editor {
|
Line 1884 sub custom_role_editor {
|
} |
} |
$full{$priv}=1; |
$full{$priv}=1; |
} |
} |
|
my ($jsback,$elements) = &crumb_utilities(); |
my $button_code = "\n"; |
my $button_code = "\n"; |
my $head_script = "\n"; |
my $head_script = "\n"; |
$head_script .= '<script type="text/javascript">'."\n"; |
$head_script .= '<script type="text/javascript">'."\n"; |
Line 1672 sub custom_role_editor {
|
Line 1893 sub custom_role_editor {
|
$head_script .= &make_script_template($role); |
$head_script .= &make_script_template($role); |
$button_code .= &make_button_code($role); |
$button_code .= &make_button_code($role); |
} |
} |
$head_script .= '</script>'."\n"; |
$head_script .= "\n".$jsback."\n".'</script>'."\n"; |
$r->print(&Apache::loncommon::start_page('Custom Role Editor',$head_script)); |
$r->print(&Apache::loncommon::start_page('Custom Role Editor',$head_script)); |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:backPage(document.form1,'','')", |
|
text=>"User/custom role search", |
|
faq=>282,bug=>'Instructor Interface',}, |
|
{href=>"javascript:backPage(document.form1,'','')", |
|
text=>"Edit custom role", |
|
faq=>282,bug=>'Instructor Interface',}); |
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management')); |
|
|
$r->print($body_top); |
$r->print($body_top); |
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'prv' => "Privilege", |
'prv' => "Privilege", |
Line 1685 sub custom_role_editor {
|
Line 1915 sub custom_role_editor {
|
$r->print($button_code); |
$r->print($button_code); |
$r->print('</form>'); |
$r->print('</form>'); |
$r->print(<<ENDCCF); |
$r->print(<<ENDCCF); |
<form name=form1 method="post"> |
<form name="form1" method="post"> |
<input type="hidden" name="phase" value="set_custom_roles" /> |
<input type="hidden" name="phase" value="set_custom_roles" /> |
<input type="hidden" name="rolename" value="$rolename" /> |
<input type="hidden" name="rolename" value="$rolename" /> |
ENDCCF |
ENDCCF |
Line 1710 ENDCCF
|
Line 1940 ENDCCF
|
&Apache::loncommon::end_data_table_row()); |
&Apache::loncommon::end_data_table_row()); |
} |
} |
$r->print(&Apache::loncommon::end_data_table(). |
$r->print(&Apache::loncommon::end_data_table(). |
'<input type="reset" value="'.&mt("Reset").'" /><input type="submit" value="'.&mt('Define Role').'" /></form>'. |
'<input type="hidden" name="startrolename" value="'.$env{'form.rolename'}. |
|
'" />'."\n".'<input type="hidden" name="state" value="" />'."\n". |
|
'<input type="reset" value="'.&mt("Reset").'" />'."\n". |
|
'<input type="submit" value="'.&mt('Define Role').'" /></form>'. |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
} |
} |
# -------------------------------------------------------- |
# -------------------------------------------------------- |
Line 1798 sub set_custom_role {
|
Line 2031 sub set_custom_role {
|
return; |
return; |
} |
} |
|
|
$r->print(&Apache::loncommon::start_page('Save Custom Role').'<h2>'); |
my ($jsback,$elements) = &crumb_utilities(); |
|
my $jscript = '<script type="text/javascript">'.$jsback."\n".'</script>'; |
|
|
|
$r->print(&Apache::loncommon::start_page('Save Custom Role'),$jscript); |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:backPage(document.customresult,'','')", |
|
text=>"User/custom role search", |
|
faq=>282,bug=>'Instructor Interface',}, |
|
{href=>"javascript:backPage(document.customresult,'selected_custom_edit','')", |
|
text=>"Edit custom role", |
|
faq=>282,bug=>'Instructor Interface',}, |
|
{href=>"javascript:backPage(document.customresult,'set_custom_roles','')", |
|
text=>"Result", |
|
faq=>282,bug=>'Instructor Interface',}); |
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management')); |
|
|
my ($rdummy,$roledef)= |
my ($rdummy,$roledef)= |
&Apache::lonnet::get('roles',["rolesdef_$rolename"]); |
&Apache::lonnet::get('roles',["rolesdef_$rolename"]); |
|
|
# ------------------------------------------------------- Does this role exist? |
# ------------------------------------------------------- Does this role exist? |
|
$r->print('<h2>'); |
if (($rdummy ne 'con_lost') && ($roledef ne '')) { |
if (($rdummy ne 'con_lost') && ($roledef ne '')) { |
$r->print(&mt('Existing Role').' "'); |
$r->print(&mt('Existing Role').' "'); |
} else { |
} else { |
Line 1851 sub set_custom_role {
|
Line 2100 sub set_custom_role {
|
$env{'user.name'}, |
$env{'user.name'}, |
$rolename)); |
$rolename)); |
} |
} |
$r->print('<p><a href="/adm/createuser">Create another role, or Create/Modify a user.</a></p>'); |
$r->print('<p><a href="/adm/createuser">Create another role, or Create/Modify a user.</a></p><form name="customresult" method="post">'); |
|
$r->print(&Apache::lonhtmlcommon::echo_form_input([]).'</form>'); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
Line 1873 sub handler {
|
Line 2123 sub handler {
|
(&Apache::lonnet::allowed('mau',$env{'request.role.domain'}))) { |
(&Apache::lonnet::allowed('mau',$env{'request.role.domain'}))) { |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
if (!$env{'form.phase'}) { |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&print_username_entry_form($r); |
|
} |
my $phase = $env{'form.phase'}; |
if ($env{'form.phase'} eq 'get_user_info') { |
my @search = ('srchterm','srchby','srchin','srchtype','srchdomain'); |
&print_user_modification_page($r); |
|
|
if (($phase eq 'get_user_info') || ($phase eq 'userpicked')) { |
|
my $srch; |
|
foreach my $item (@search) { |
|
$srch->{$item} = $env{'form.'.$item}; |
|
} |
|
if ($env{'form.phase'} eq 'get_user_info') { |
|
my ($state,$response,$forcenewuser,$results) = |
|
&user_search_result($srch); |
|
print STDERR "Got $state,$response,$forcenewuser\n"; |
|
if ($state eq 'select') { |
|
&print_user_selection_page($r,$response,$srch,$results); |
|
} elsif ($state eq 'modify') { |
|
my ($ccuname,$ccdomain); |
|
if (($srch->{'srchby'} eq 'uname') && |
|
($srch->{'srchtype'} eq 'exact')) { |
|
$ccuname = $srch->{'srchterm'}; |
|
$ccdomain= $srch->{'srchdomain'}; |
|
} else { |
|
my @matchedunames = keys(%{$results}); |
|
($ccuname,$ccdomain) = split(/:/,$matchedunames[0]); |
|
} |
|
$ccuname =&LONCAPA::clean_username($ccuname); |
|
$ccdomain=&LONCAPA::clean_domain($ccdomain); |
|
&print_user_modification_page($r,$ccuname,$ccdomain,$srch, |
|
$response); |
|
} elsif ($state eq 'query') { |
|
&print_user_query_page($r); |
|
} else { |
|
&print_username_entry_form($r,$response,$srch,$forcenewuser); |
|
} |
|
} elsif ($env{'form.phase'} eq 'userpicked') { |
|
my $ccuname = &LONCAPA::clean_username($env{'form.seluname'}); |
|
my $ccdomain = &LONCAPA::clean_domain($env{'form.seludom'}); |
|
&print_user_modification_page($r,$ccuname,$ccdomain,$srch); |
|
} |
} elsif ($env{'form.phase'} eq 'update_user_data') { |
} elsif ($env{'form.phase'} eq 'update_user_data') { |
&update_user_data($r); |
&update_user_data($r); |
} elsif ($env{'form.phase'} eq 'selected_custom_edit') { |
} elsif ($env{'form.phase'} eq 'selected_custom_edit') { |
&custom_role_editor($r); |
&custom_role_editor($r); |
} elsif ($env{'form.phase'} eq 'set_custom_roles') { |
} elsif ($env{'form.phase'} eq 'set_custom_roles') { |
&set_custom_role($r); |
&set_custom_role($r); |
|
} else { |
|
&print_username_entry_form($r); |
} |
} |
} else { |
} else { |
$env{'user.error.msg'}= |
$env{'user.error.msg'}= |
Line 1891 sub handler {
|
Line 2178 sub handler {
|
return HTTP_NOT_ACCEPTABLE; |
return HTTP_NOT_ACCEPTABLE; |
} |
} |
return OK; |
return OK; |
} |
} |
|
|
#-------------------------------------------------- functions for &phase_two |
#-------------------------------------------------- functions for &phase_two |
|
sub user_search_result { |
|
my ($srch) = @_; |
|
my @alldomains = sort(&Apache::lonnet::all_domains()); |
|
my %allhomes; |
|
my %inst_matches; |
|
my %srch_results; |
|
my ($response,$state,$forcenewuser); |
|
|
|
if ($srch->{'srchby'} !~ /^(uname|lastname|lastfirst)$/) { |
|
$response = &mt('Invalid search.'); |
|
} |
|
if ($srch->{'srchin'} !~ /^(crs|dom|alc|instd)$/) { |
|
$response = &mt('Invalid search.'); |
|
} |
|
if ($srch->{'srchtype'} !~ /^(exact|contains)$/) { |
|
$response = &mt('Invalid search.'); |
|
} |
|
if ($srch->{'srchterm'} eq '') { |
|
$response = &mt('You must enter a search term.'); |
|
} |
|
if (($srch->{'srchin'} eq 'dom') || ($srch->{'srchin'} eq 'instd')) { |
|
if (($srch->{'srchdomain'} eq '') || |
|
(!(grep/^\Q$srch->{'srchdomain'}\E$/,@alldomains))) { |
|
$response = &mt('You must specify a valid domain when searching in a domain or institutional directory.') |
|
} |
|
} |
|
if (($srch->{'srchin'} eq 'dom') || ($srch->{'srchin'} eq 'crs') || |
|
($srch->{'srchin'} eq 'alc')) { |
|
if ($srch->{'srchterm'} !~ /^$match_username$/) { |
|
$response = &mt('You must specify a valid username. Only the following are allowed: letters numbers - . @'); |
|
} |
|
} |
|
if ($srch->{'srchin'} eq 'instd') { |
|
my $instd_chk = &directorysrch_check($srch); |
|
if ($instd_chk ne 'ok') { |
|
$response = $instd_chk; |
|
} |
|
} |
|
if ($response ne '') { |
|
return ($state,$response); |
|
} |
|
if ($srch->{'srchby'} eq 'uname') { |
|
if (($srch->{'srchin'} eq 'dom') || ($srch->{'srchin'} eq 'crs')) { |
|
if ($env{'form.forcenew'}) { |
|
if ($srch->{'srchdomain'} ne $env{'request.role.domain'}) { |
|
my $uhome=&Apache::lonnet::homeserver($srch->{'srchterm'},$srch->{'srchdomain'}); |
|
if ($uhome eq 'no_host') { |
|
my $domdesc = &Apache::lonnet::domain($env{'request.role.domain'},'description'); |
|
$response = &mt('New users can only be created in the domain to which you current role belongs - [_1].',$env{'request.role.domain'}.' ('.$domdesc.')'); |
|
} else { |
|
$state = 'modify'; |
|
} |
|
} else { |
|
$state = 'modify'; |
|
} |
|
} else { |
|
if ($srch->{'srchin'} eq 'dom') { |
|
if ($srch->{'srchtype'} eq 'exact') { |
|
my $uhome=&Apache::lonnet::homeserver($srch->{'srchterm'},$srch->{'srchdomain'}); |
|
if ($uhome eq 'no_host') { |
|
($state,$response,$forcenewuser) = |
|
&build_search_response($srch,%srch_results); |
|
} else { |
|
$state = 'modify'; |
|
} |
|
} else { |
|
%srch_results = &Apache::lonnet::usersearch($srch); |
|
($state,$response,$forcenewuser) = |
|
&build_search_response($srch,%srch_results); |
|
} |
|
} else { |
|
my %courseusers = &get_courseusers(); |
|
if ($srch->{'srchtype'} eq 'exact') { |
|
if (exists($courseusers{$srch->{'srchterm'}.':'.$srch->{'srchdomain'}})) { |
|
$state = 'modify'; |
|
} else { |
|
($state,$response,$forcenewuser) = |
|
&build_search_response($srch,%srch_results); |
|
} |
|
} else { |
|
foreach my $user (keys(%courseusers)) { |
|
my ($cuname,$cudomain) = split(/:/,$user); |
|
if ($cudomain eq $srch->{'srchdomain'}) { |
|
if ($cuname =~ /\Q$srch->{'srchterm'}\E/i) { |
|
$srch_results{$user} = ''; |
|
} |
|
} |
|
} |
|
($state,$response,$forcenewuser) = |
|
&build_search_response($srch,%srch_results); |
|
} |
|
} |
|
} |
|
} elsif ($srch->{'srchin'} eq 'alc') { |
|
$state = 'query'; |
|
} elsif ($srch->{'srchin'} eq 'instd') { |
|
%srch_results = &Apache::lonnet::inst_directory_query($srch); |
|
($state,$response,$forcenewuser) = |
|
&build_search_response($srch,%srch_results); |
|
} |
|
} else { |
|
if ($srch->{'srchin'} eq 'dom') { |
|
%srch_results = &Apache::lonnet::usersearch($srch); |
|
($state,$response,$forcenewuser) = |
|
&build_search_response($srch,%srch_results); |
|
} elsif ($srch->{'srchin'} eq 'crs') { |
|
my %courseusers = &get_courseusers(); |
|
foreach my $user (keys(%courseusers)) { |
|
my ($uname,$udom) = split(/:/,$user); |
|
my %names = &Apache::loncommon::getnames($uname,$udom); |
|
my %emails = &Apache::loncommon::getemails($uname,$udom); |
|
if ($srch->{'srchby'} eq 'lastname') { |
|
if ((($srch->{'srchtype'} eq 'exact') && |
|
($names{'lastname'} eq $srch->{'srchterm'})) || |
|
(($srch->{'srchtype'} eq 'contains') && |
|
($names{'lastname'} =~ /\Q$srch->{'srchterm'}\E/i))) { |
|
$srch_results{$user} = {firstname => $names{'firstname'}, |
|
lastname => $names{'lastname'}, |
|
permanentemail => $emails{'permanentemail'}, |
|
}; |
|
} |
|
} elsif ($srch->{'srchby'} eq 'lastfirst') { |
|
my ($srchlast,$srchfirst) = split(/,/,$srch->{'srchterm'}); |
|
if ($srch->{'srchtype'} eq 'exact') { |
|
if (($names{'lastname'} eq $srchlast) && |
|
($names{'firstname'} eq $srchfirst)) { |
|
$srch_results{$user} = {firstname => $names{'firstname'}, |
|
lastname => $names{'lastname'}, |
|
permanentemail => $emails{'permanentemail'}, |
|
|
|
}; |
|
} |
|
} elsif ($srch->{'srchtype'} eq 'contains') { |
|
if (($names{'lastname'} =~ /\Q$srchlast\E/i) && |
|
($names{'firstname'} =~ /\Q$srchfirst\E/i)) { |
|
$srch_results{$user} = {firstname => $names{'firstname'}, |
|
lastname => $names{'lastname'}, |
|
permanentemail => $emails{'permanentemail'}, |
|
}; |
|
} |
|
} |
|
} |
|
} |
|
($state,$response,$forcenewuser) = |
|
&build_search_response($srch,%srch_results); |
|
} elsif ($srch->{'srchin'} eq 'alc') { |
|
$state = 'query'; |
|
} elsif ($srch->{'srchin'} eq 'instd') { |
|
%srch_results = &Apache::lonnet::inst_directory_query($srch); |
|
($state,$response,$forcenewuser) = |
|
&build_search_response($srch,%srch_results); |
|
} |
|
} |
|
return ($state,$response,$forcenewuser,\%srch_results); |
|
} |
|
|
|
sub directorysrch_check { |
|
my ($srch) = @_; |
|
my $can_search = 0; |
|
my $response; |
|
my %dom_inst_srch = &Apache::lonnet::get_dom('configuration', |
|
['directorysrch'],$srch->{'srchdomain'}); |
|
if (ref($dom_inst_srch{'directorysrch'}) eq 'HASH') { |
|
if (!$dom_inst_srch{'directorysrch'}{'available'}) { |
|
return &mt('Directory search unavailable in domain: [_1]',$srch->{'srchdomain'}); |
|
} |
|
if ($dom_inst_srch{'directorysrch'}{'localonly'}) { |
|
if ($env{'request.role.domain'} ne $srch->{'srchdomain'}) { |
|
return &mt('Directory search in domain: [_1] is only allowed for users with a current role in the domain.',$srch->{'srchdomain'}); |
|
} |
|
my @usertypes = split(/:/,$env{'environment.inststatus'}); |
|
if (!@usertypes) { |
|
push(@usertypes,'default'); |
|
} |
|
if (ref($dom_inst_srch{'directorysrch'}{'cansearch'}) eq 'ARRAY') { |
|
foreach my $type (@usertypes) { |
|
if (grep(/^\Q$type\E$/,@{$dom_inst_srch{'directorysrch'}{'cansearch'}})) { |
|
$can_search = 1; |
|
last; |
|
} |
|
} |
|
} |
|
if (!$can_search) { |
|
my ($insttypes,$order) = &Apache::lonnet::retrieve_inst_usertypes($srch->{'srchdomain'}); |
|
my @longtypes; |
|
foreach my $item (@usertypes) { |
|
push (@longtypes,$insttypes->{$item}); |
|
} |
|
my $insttype_str = join(', ',@longtypes); |
|
return &mt('Directory search in domain: [_1] is unavailable to your user type: ',$srch->{'srchdomain'}).$insttype_str; |
|
} |
|
} else { |
|
$can_search = 1; |
|
} |
|
} else { |
|
return &mt('Directory search has not been configured for domain: [_1]',$srch->{'srchdomain'}); |
|
} |
|
my %longtext = &Apache::lonlocal::texthash ( |
|
uname => 'username', |
|
lastfirst => 'last name, first name', |
|
lastname => 'last name', |
|
contains => 'is contained in', |
|
exact => 'as exact match to' |
|
); |
|
if ($can_search) { |
|
if (ref($dom_inst_srch{'directorysrch'}{'searchby'}) eq 'ARRAY') { |
|
if (!grep(/^\Q$srch->{'srchby'}\E$/,@{$dom_inst_srch{'directorysrch'}{'searchby'}})) { |
|
return &mt('Directory search in domain: [_1] is not available for searching by [_2]',$srch->{'srchdomain'},$longtext{$srch->{'srchby'}}); |
|
} |
|
} else { |
|
return &mt('Directory search in domain: [_1] is not available.', $srch->{'srchdomain'}); |
|
} |
|
} |
|
if ($can_search) { |
|
if (($dom_inst_srch{'directorysrch'}{'searchtypes'} eq 'specify') || |
|
($dom_inst_srch{'directorysrch'}{'searchtypes'} eq $srch->{'srchtype'})) { |
|
return 'ok'; |
|
} else { |
|
return &mt('Directory search in domain [_1] is not available for the requested search type: [_2]',$srch->{'srchdomain'},$longtext{$srch->{'srchtype'}}); |
|
} |
|
} |
|
} |
|
|
|
|
|
sub get_courseusers { |
|
my %advhash; |
|
my %coursepersonnel=&Apache::lonnet::get_course_adv_roles(); |
|
foreach my $role (sort(keys(%coursepersonnel))) { |
|
foreach my $user (split(/\,/,$coursepersonnel{$role})) { |
|
$advhash{$user} = ''; |
|
} |
|
} |
|
my $classlist = &Apache::loncoursedata::get_classlist(); |
|
my %combined = (%advhash, %{$classlist}); |
|
return %combined; |
|
} |
|
|
|
sub build_search_response { |
|
my ($srch,%srch_results) = @_; |
|
my ($state,$response,$forcenewuser); |
|
my %names = ( |
|
'uname' => 'username', |
|
'lastname' => 'last name', |
|
'lastfirst' => 'last name, first name', |
|
'crs' => 'this course', |
|
'dom' => 'this domain', |
|
'instd' => "your institution's directory", |
|
); |
|
|
|
my %single = ( |
|
contains => 'A match', |
|
exact => 'An exact match', |
|
); |
|
my %nomatch = ( |
|
contains => 'No match', |
|
exact => 'No exact match', |
|
); |
|
if (keys(%srch_results) > 1) { |
|
$state = 'select'; |
|
} else { |
|
if (keys(%srch_results) == 1) { |
|
$state = 'modify'; |
|
$response = &mt("$single{$srch->{'srchtype'}} was found for this $names{$srch->{'srchby'}} ([_1]) in $names{$srch->{'srchin'}}.",$srch->{'srchterm'}); |
|
} else { |
|
$response = &mt("$nomatch{$srch->{'srchtype'}} found for this $names{$srch->{'srchby'}} ([_1]) in $names{$srch->{'srchin'}}.",$srch->{'srchterm'}); |
|
if ($srch->{'srchin'} ne 'alc') { |
|
$forcenewuser = 1; |
|
my $cansrchinst = 0; |
|
if ($srch->{'srchdomain'}) { |
|
my %domconfig = &Apache::lonnet::get_dom('configuration',['directorysrch'],$srch->{'srchdomain'}); |
|
if (ref($domconfig{'directorysrch'}) eq 'HASH') { |
|
if ($domconfig{'directorysrch'}{'available'}) { |
|
$cansrchinst = 1; |
|
} |
|
} |
|
} |
|
if (($srch->{'srchby'} eq 'lastfirst') || |
|
($srch->{'srchby'} eq 'lastname')) { |
|
if ($srch->{'srchin'} eq 'crs') { |
|
$response .= '<br />'.&mt('You may want to broaden your search to the whole domain.'); |
|
} elsif ($srch->{'srchin'} eq 'dom') { |
|
if ($cansrchinst) { |
|
$response .= '<br />'.&mt('You may want to broaden your search to a search of the institutional directory for this domain.'); |
|
} |
|
} |
|
} |
|
$response .= '<br />'.&mt("To add as a new user:").'<ul><li>'.&mt("Enter the proposed username in the <i>'Search for'</i> box").'</li><li>'.&mt("Set <i>'Make new user if no match found</i>' to <b>Yes</b>").'</li><li>'.&mt("Click <i>'Search'</i>").'</li></ul>'.&mt("Note: you can only create new users in the domain of your current role -".$env{'request.role.domain'}).'<br /><br />'; |
|
} |
|
} |
|
} |
|
return ($state,$response,$forcenewuser); |
|
} |
|
|
|
sub crumb_utilities { |
|
my %elements = ( |
|
crtuser => { |
|
srchterm => 'text', |
|
srchin => 'selectbox', |
|
srchby => 'selectbox', |
|
srchtype => 'selectbox', |
|
srchdomain => 'selectbox', |
|
}, |
|
docustom => { |
|
rolename => 'selectbox', |
|
newrolename => 'textbox', |
|
}, |
|
); |
|
|
|
my $jsback .= qq| |
|
function backPage(formname,prevphase,prevstate) { |
|
formname.phase.value = prevphase; |
|
formname.state.value = prevstate; |
|
formname.submit(); |
|
} |
|
|; |
|
return ($jsback,\%elements); |
|
} |
|
|
sub course_level_table { |
sub course_level_table { |
my (%inccourses) = @_; |
my (%inccourses) = @_; |
my $table = ''; |
my $table = ''; |
Line 1933 sub course_level_table {
|
Line 2538 sub course_level_table {
|
if (&Apache::lonnet::allowed('c'.$role,$thiscourse)) { |
if (&Apache::lonnet::allowed('c'.$role,$thiscourse)) { |
my $plrole=&Apache::lonnet::plaintext($role); |
my $plrole=&Apache::lonnet::plaintext($role); |
$table .= &Apache::loncommon::start_data_table_row(). |
$table .= &Apache::loncommon::start_data_table_row(). |
'<td><input type="checkbox" name="act_'.$protectedcourse.'_'.$role.'"></td> |
'<td><input type="checkbox" name="act_'.$protectedcourse.'_'.$role.'" /></td> |
<td>'.$plrole.'</td> |
<td>'.$plrole.'</td> |
<td>'.$area.'<br />Domain: '.$domain.'</td>'."\n"; |
<td>'.$area.'<br />Domain: '.$domain.'</td>'."\n"; |
if ($role ne 'cc') { |
if ($role ne 'cc') { |
Line 1946 sub course_level_table {
|
Line 2551 sub course_level_table {
|
$currsec.'</td>'. |
$currsec.'</td>'. |
'<td> </td>'. |
'<td> </td>'. |
'<td valign="top"> '.$lt{'new'}.'<br />'. |
'<td valign="top"> '.$lt{'new'}.'<br />'. |
'<input type="text" name="newsec_'.$protectedcourse.'_'.$role.'" value="" /></td>'. |
'<input type="text" name="newsec_'.$protectedcourse.'_'.$role.'" value="" />'. |
'<input type="hidden" '. |
'<input type="hidden" '. |
'name="sec_'.$protectedcourse.'_'.$role.'"></td>'. |
'name="sec_'.$protectedcourse.'_'.$role.'" /></td>'. |
'</tr></table></td>'; |
'</tr></table></td>'; |
} else { |
} else { |
$table .= '<td><input type="text" size="10" '. |
$table .= '<td><input type="text" size="10" '. |
'name="sec_'.$protectedcourse.'_'.$role.'"></td>'; |
'name="sec_'.$protectedcourse.'_'.$role.'" /></td>'; |
} |
} |
} else { |
} else { |
$table .= '<td> </td>'; |
$table .= '<td> </td>'; |
} |
} |
$table .= <<ENDTIMEENTRY; |
$table .= <<ENDTIMEENTRY; |
<td><input type=hidden name="start_$protectedcourse\_$role" value=''> |
<td><input type=hidden name="start_$protectedcourse\_$role" value='' /> |
<a href= |
<a href= |
"javascript:pjump('date_start','Start Date $plrole',document.cu.start_$protectedcourse\_$role.value,'start_$protectedcourse\_$role','cu.pres','dateset')">$lt{'ssd'}</a></td> |
"javascript:pjump('date_start','Start Date $plrole',document.cu.start_$protectedcourse\_$role.value,'start_$protectedcourse\_$role','cu.pres','dateset')">$lt{'ssd'}</a></td> |
<td><input type=hidden name="end_$protectedcourse\_$role" value=''> |
<td><input type=hidden name="end_$protectedcourse\_$role" value='' /> |
<a href= |
<a href= |
"javascript:pjump('date_end','End Date $plrole',document.cu.end_$protectedcourse\_$role.value,'end_$protectedcourse\_$role','cu.pres','dateset')">$lt{'sed'}</a></td> |
"javascript:pjump('date_end','End Date $plrole',document.cu.end_$protectedcourse\_$role.value,'end_$protectedcourse\_$role','cu.pres','dateset')">$lt{'sed'}</a></td> |
ENDTIMEENTRY |
ENDTIMEENTRY |
Line 1974 ENDTIMEENTRY
|
Line 2579 ENDTIMEENTRY
|
my $customrole=$protectedcourse.'_cr_cr_'.$env{'user.domain'}. |
my $customrole=$protectedcourse.'_cr_cr_'.$env{'user.domain'}. |
'_'.$env{'user.name'}.'_'.$plrole; |
'_'.$env{'user.name'}.'_'.$plrole; |
$table .= &Apache::loncommon::start_data_table_row(). |
$table .= &Apache::loncommon::start_data_table_row(). |
'<td><input type="checkbox" name="act_'.$customrole.'"></td> |
'<td><input type="checkbox" name="act_'.$customrole.'" /></td> |
<td>'.$plrole.'</td> |
<td>'.$plrole.'</td> |
<td>'.$area.'</td>'."\n"; |
<td>'.$area.'</td>'."\n"; |
if (%sections_count) { |
if (%sections_count) { |
Line 1987 ENDTIMEENTRY
|
Line 2592 ENDTIMEENTRY
|
'<td valign="top"> '.$lt{'new'}.'<br />'. |
'<td valign="top"> '.$lt{'new'}.'<br />'. |
'<input type="text" name="newsec_'.$customrole.'" value="" /></td>'. |
'<input type="text" name="newsec_'.$customrole.'" value="" /></td>'. |
'<input type="hidden" '. |
'<input type="hidden" '. |
'name="sec_'.$customrole.'"></td>'. |
'name="sec_'.$customrole.'" /></td>'. |
'</tr></table></td>'; |
'</tr></table></td>'; |
} else { |
} else { |
$table .= '<td><input type="text" size="10" '. |
$table .= '<td><input type="text" size="10" '. |
'name="sec_'.$customrole.'"></td>'; |
'name="sec_'.$customrole.'" /></td>'; |
} |
} |
$table .= <<ENDENTRY; |
$table .= <<ENDENTRY; |
<td><input type=hidden name="start_$customrole" value=''> |
<td><input type=hidden name="start_$customrole" value='' /> |
<a href= |
<a href= |
"javascript:pjump('date_start','Start Date $plrole',document.cu.start_$customrole.value,'start_$customrole','cu.pres','dateset')">$lt{'ssd'}</a></td> |
"javascript:pjump('date_start','Start Date $plrole',document.cu.start_$customrole.value,'start_$customrole','cu.pres','dateset')">$lt{'ssd'}</a></td> |
<td><input type=hidden name="end_$customrole" value=''> |
<td><input type=hidden name="end_$customrole" value='' /> |
<a href= |
<a href= |
"javascript:pjump('date_end','End Date $plrole',document.cu.end_$customrole.value,'end_$customrole','cu.pres','dateset')">$lt{'sed'}</a></td> |
"javascript:pjump('date_end','End Date $plrole',document.cu.end_$customrole.value,'end_$customrole','cu.pres','dateset')">$lt{'sed'}</a></td> |
ENDENTRY |
ENDENTRY |
Line 2014 ENDENTRY
|
Line 2619 ENDENTRY
|
'<th>'.$lt{'act'}.'</th><th>'.$lt{'rol'}.'</th><th>'.$lt{'ext'}.'</th> |
'<th>'.$lt{'act'}.'</th><th>'.$lt{'rol'}.'</th><th>'.$lt{'ext'}.'</th> |
<th>'.$lt{'grs'}.'</th><th>'.$lt{'sta'}.'</th><th>'.$lt{'end'}.'</th>'. |
<th>'.$lt{'grs'}.'</th><th>'.$lt{'sta'}.'</th><th>'.$lt{'end'}.'</th>'. |
&Apache::loncommon::end_data_table_header_row(). |
&Apache::loncommon::end_data_table_header_row(). |
&Apache::loncommon::start_data_table_row(). |
|
$table. |
$table. |
&Apache::loncommon::end_data_table_row(). |
|
&Apache::loncommon::end_data_table(); |
&Apache::loncommon::end_data_table(); |
return $result; |
return $result; |
} |
} |
Line 2091 sub course_level_dc {
|
Line 2694 sub course_level_dc {
|
'<input type="hidden" name="groups" value="" /></td>'. |
'<input type="hidden" name="groups" value="" /></td>'. |
'</tr></table></td>'; |
'</tr></table></td>'; |
$otheritems .= <<ENDTIMEENTRY; |
$otheritems .= <<ENDTIMEENTRY; |
<td><input type=hidden name="start" value=''> |
<td><input type=hidden name="start" value='' /> |
<a href= |
<a href= |
"javascript:pjump('date_start','Start Date',document.cu.start.value,'start','cu.pres','dateset')">$lt{'ssd'}</a></td> |
"javascript:pjump('date_start','Start Date',document.cu.start.value,'start','cu.pres','dateset')">$lt{'ssd'}</a></td> |
<td><input type=hidden name="end" value=''> |
<td><input type=hidden name="end" value='' /> |
<a href= |
<a href= |
"javascript:pjump('date_end','End Date',document.cu.end.value,'end','cu.pres','dateset')">$lt{'sed'}</a></td> |
"javascript:pjump('date_end','End Date',document.cu.end.value,'end','cu.pres','dateset')">$lt{'sed'}</a></td> |
ENDTIMEENTRY |
ENDTIMEENTRY |