version 1.623, 2025/06/30 20:29:03
|
version 1.624, 2025/06/30 21:12:21
|
Line 6396 sub newoverview {
|
Line 6396 sub newoverview {
|
$r->print($start_page.$breadcrumbs); |
$r->print($start_page.$breadcrumbs); |
&startSettingsScreen($r,'parmset',$crstype); |
&startSettingsScreen($r,'parmset',$crstype); |
$r->print(<<ENDOVER); |
$r->print(<<ENDOVER); |
<form method="post" action="/adm/parmset?action=newoverview" name="parmform" onsubmit="return validateParms();"> |
<form method="post" action="/adm/parmset?action=newoverview" name="parmform" id="newoverviewform"> |
|
<input type="hidden" name="newoverviewsubm" value="dis" id="newoverviewsubm" /> |
ENDOVER |
ENDOVER |
my @ids=(); |
my @ids=(); |
my %typep=(); |
my %typep=(); |
Line 6504 ENDOVER
|
Line 6505 ENDOVER
|
&sortmenu($r,$sortorder,'newoverview'); |
&sortmenu($r,$sortorder,'newoverview'); |
$r->print('</div></div>'); |
$r->print('</div></div>'); |
|
|
$r->print('<p><input type="submit" name="dis" value="'.&mt('Display').'" /></p>'); |
$r->print('<p><input type="submit" name="dis" value="'.&mt('Display').'" id="newoverviewdis" /></p>'); |
|
|
# Build the list data hash from the specified parms |
# Build the list data hash from the specified parms |
|
|
Line 6516 ENDOVER
|
Line 6517 ENDOVER
|
&secgroup_lister($cat,$pschp,$parmlev,$listdata,\@psprt,\@selected_groups,\%defkeytype,\%allmaps,\@ids,\%symbp); |
&secgroup_lister($cat,$pschp,$parmlev,$listdata,\@psprt,\@selected_groups,\%defkeytype,\%allmaps,\@ids,\%symbp); |
} |
} |
|
|
if (($env{'form.store'}) || ($env{'form.dis'})) { |
my $foundkeys; |
|
if ($env{'form.newoverviewsubm'}) { |
|
|
if ($env{'form.store'}) { &storedata($r,$crs,$dom); } |
if ($env{'form.newoverviewsubm'} eq 'store') { &storedata($r,$crs,$dom); } |
|
|
# Read modified data |
# Read modified data |
|
|
Line 6534 ENDOVER
|
Line 6536 ENDOVER
|
$hash_for_realm->{$symbp{$ids[$i]}} = $i; |
$hash_for_realm->{$symbp{$ids[$i]}} = $i; |
} |
} |
} |
} |
&listdata($r,$resourcedata,$listdata,$sortorder,'newoverview',undef,$readonly,$parmlev,$hash_for_realm,$pschp); |
$foundkeys = &listdata($r,$resourcedata,$listdata,$sortorder,'newoverview',undef,$readonly,$parmlev,$hash_for_realm,$pschp); |
} |
} |
$r->print(&tableend()); |
$r->print(&tableend()); |
unless ($readonly) { |
if ((!$readonly) && ($foundkeys)) { |
$r->print( ((($env{'form.store'}) || ($env{'form.dis'}))?'<p><input type="submit" name="store" value="'.&mt('Save').'" /></p>':'') ); |
$r->print( ($env{'form.newoverviewsubm'}? '<p><input type="submit" name="store" id="newoverviewstore" value="'.&mt('Save').'" /></p>':'') ); |
} |
} |
$r->print('</form>'); |
$r->print('</form>'); |
|
if ($env{'form.newoverviewsubm'}) { |
|
$r->print(<<"END"); |
|
<script type="text/javascript"> |
|
const form = document.getElementById('newoverviewform'); |
|
const storebutton = document.getElementById('newoverviewstore'); |
|
const disbutton = document.getElementById('newoverviewdis'); |
|
const submethod = document.getElementById('newoverviewsubm'); |
|
if (storebutton) { |
|
storebutton.addEventListener('keydown', (e) => { |
|
if (e.key === 'Enter') { |
|
if (validateParms()) { |
|
if (form) { |
|
if (submethod) { |
|
submethod.value='store'; |
|
} |
|
form.submit(); |
|
} |
|
} |
|
e.preventDefault(); |
|
return; |
|
} |
|
}); |
|
storebutton.addEventListener('click', (e) => { |
|
if (validateParms()) { |
|
if (form) { |
|
if (submethod) { |
|
submethod.value='store'; |
|
} |
|
form.submit(); |
|
} |
|
} |
|
e.preventDefault(); |
|
return; |
|
}); |
|
} |
|
if (disbutton) { |
|
disbutton.addEventListener('keydown', (e) => { |
|
if (e.key === 'Enter') { |
|
if (form) { |
|
if (submethod) { |
|
submethod.value='dis'; |
|
} |
|
form.submit(); |
|
} |
|
e.preventDefault(); |
|
} |
|
}); |
|
disbutton.addEventListener('click', (e) => { |
|
if (form) { |
|
if (submethod) { |
|
submethod.value='dis'; |
|
} |
|
form.submit(); |
|
return; |
|
} |
|
e.preventDefault(); |
|
}); |
|
} |
|
|
|
</script> |
|
|
|
END |
|
} |
&endSettingsScreen($r); |
&endSettingsScreen($r); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |