[LON-CAPA-cvs] cvs: loncom /interface loncreateuser.pm /localize/localize de.pm
bisitz
bisitz at source.lon-capa.org
Fri Dec 21 09:49:55 EST 2012
bisitz Fri Dec 21 14:49:55 2012 EDT
Modified files:
/loncom/interface loncreateuser.pm
/loncom/localize/localize de.pm
Log:
- Don't loose error message in case of error (Improve rev. 1.367)
- Full qualified function call for "Deleting custom role" (rev. 1.367)
- Internationalization:
- Corrected confirm_succes function closures - exclude "<br />" from mt parameter (rev. 1.367)
- Error message
- Consistent usage username:domain (now: single parameter)
- Adjusted related phrases in de.pm and removed unused entry
-------------- next part --------------
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.368 loncom/interface/loncreateuser.pm:1.369
--- loncom/interface/loncreateuser.pm:1.368 Thu Dec 20 16:22:59 2012
+++ loncom/interface/loncreateuser.pm Fri Dec 21 14:49:50 2012
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.368 2012/12/20 16:22:59 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.369 2012/12/21 14:49:50 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -3343,8 +3343,13 @@
$env{'form.ccuname'},
$scope,$role,'','',$context);
$r->print(&Apache::lonhtmlcommon::confirm_success(
- &mt('Revoking [_1] in [_2]', &Apache::lonnet::plaintext($role), '"'.&cid_to_cname($scope).'"<br />'),
- $result ne "ok"));
+ &mt('Revoking [_1] in [_2]',
+ &Apache::lonnet::plaintext($role),
+ '"'.&cid_to_cname($scope).'"'),
+ $result ne "ok").'<br />');
+ if ($result ne "ok") {
+ $r->print(&mt('Error: [_1]',$result).'<br />');
+ }
if ($role eq 'st') {
my $result =
&Apache::lonuserutils::classlist_drop($scope,
@@ -3358,10 +3363,15 @@
}
if ($key=~m{^form\.rev\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}s) {
# Revoke custom role
+ my $result = &Apache::lonnet::revokecustomrole(
+ $env{'form.ccdomain'},$env{'form.ccuname'},$1,$2,$3,$4,'','',$context);
$r->print(&Apache::lonhtmlcommon::confirm_success(
- &mt('Revoking custom role [_1] by [_2]:[_3] in [_4]',$4,$3,$2,'"'.&cid_to_cname($1).'"<br />'),
- &Apache::lonnet::revokecustomrole($env{'form.ccdomain'},$env{'form.ccuname'},$1,$2,$3,$4,'','',$context) ne 'ok'));
-
+ &mt('Revoking custom role [_1] by [_2] in [_3]',
+ $4,$3.':'.$2,'"'.&cid_to_cname($1).'"'),
+ $result ne 'ok').'<br />');
+ if ($result ne "ok") {
+ $r->print(&mt('Error: [_1]',$result).'<br />');
+ }
if (!grep(/^cr$/, at rolechanges)) {
push(@rolechanges,'cr');
}
@@ -3377,14 +3387,19 @@
$context);
$r->print(&Apache::lonhtmlcommon::confirm_success(
&mt('Deleting [_1] in [_2]',
- &Apache::lonnet::plaintext($role),'"'.&cid_to_cname($scope).'"<br />'),$result ne 'ok'));
+ &Apache::lonnet::plaintext($role),
+ '"'.&cid_to_cname($scope).'"'),
+ $result ne 'ok').'<br />');
+ if ($result ne "ok") {
+ $r->print(&mt('Error: [_1]',$result).'<br />');
+ }
if ($role eq 'st') {
my $result =
&Apache::lonuserutils::classlist_drop($scope,
$env{'form.ccuname'},$env{'form.ccdomain'},
$now);
- $r->print($result);
+ $r->print(&Apache::lonhtmlcommon::confirm_success($result));
}
if (!grep(/^\Q$role\E$/, at rolechanges)) {
push(@rolechanges,$role);
@@ -3393,11 +3408,16 @@
if ($key=~m{^form\.del\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}) {
my ($url,$rdom,$rnam,$rolename) = ($1,$2,$3,$4);
# Delete custom role
- $r->print(&confirm_success(&mt('Deleting custom role [_1] by [_2] in [_3]',
- $rolename,$rnam.':'.$rdom,'"'.&cid_to_cname($1).'"').'<br />'));
- &Apache::lonnet::assigncustomrole($env{'form.ccdomain'},
- $env{'form.ccuname'},$url,$rdom,$rnam,$rolename,$now,
- 0,1,$context);
+ my $result =
+ &Apache::lonnet::assigncustomrole($env{'form.ccdomain'},
+ $env{'form.ccuname'},$url,$rdom,$rnam,$rolename,$now,
+ 0,1,$context);
+ $r->print(&Apache::lonhtmlcommon::confirm_success(&mt('Deleting custom role [_1] by [_2] in [_3]',
+ $rolename,$rnam.':'.$rdom,'"'.&cid_to_cname($1).'"'),
+ $result ne "ok").'<br />');
+ if ($result ne "ok") {
+ $r->print(&mt('Error: [_1]',$result).'<br />');
+ }
if (!grep(/^cr$/, at rolechanges)) {
push(@rolechanges,'cr');
@@ -3419,7 +3439,7 @@
if ($result eq 'refused' && $logmsg) {
$output = $logmsg;
} else {
- $output = "Error: $result\n";
+ $output = &mt('Error: [_1]',$result)."\n";
}
} else {
$output = &Apache::lonhtmlcommon::confirm_success(&mt('Assigning [_1] in [_2] starting [_3]',&Apache::lonnet::plaintext($role),
@@ -3431,8 +3451,11 @@
$env{'form.ccuname'},$url,$role,0,$now,'','',
$context);
$output = &Apache::lonhtmlcommon::confirm_success(&mt('Re-enabling [_1] in [_2]',
- &Apache::lonnet::plaintext($role),'"'.&cid_to_cname($url).'"').'<br />',$result ne "ok");
- }
+ &Apache::lonnet::plaintext($role),'"'.&cid_to_cname($url).'"'),$result ne "ok").'<br />';
+ if ($result ne "ok") {
+ $output .= &mt('Error: [_1]',$result).'<br />';
+ }
+ }
$r->print($output);
if (!grep(/^\Q$role\E$/, at rolechanges)) {
push(@rolechanges,$role);
@@ -3444,8 +3467,13 @@
my $result = &Apache::lonnet::assigncustomrole(
$env{'form.ccdomain'}, $env{'form.ccuname'},
$url,$rdom,$rnam,$rolename,0,$now,undef,$context);
- $r->print(&Apache::lonhtmlcommon::confirm_success(&mt('Re-enabling custom role [_1] by [_2] in [_3]',
- $rolename,$rnam.':'.$rdom,'"'.&cid_to_cname($1).'"').'<br />'),$result ne "ok");
+ $r->print(&Apache::lonhtmlcommon::confirm_success(
+ &mt('Re-enabling custom role [_1] by [_2] in [_3]',
+ $rolename,$rnam.':'.$rdom,'"'.&cid_to_cname($1).'"'),
+ $result ne "ok").'<br />');
+ if ($result ne "ok") {
+ $r->print(&mt('Error: [_1]',$result).'<br />');
+ }
if (!grep(/^cr$/, at rolechanges)) {
push(@rolechanges,'cr');
}
Index: loncom/localize/localize/de.pm
diff -u loncom/localize/localize/de.pm:1.475 loncom/localize/localize/de.pm:1.476
--- loncom/localize/localize/de.pm:1.475 Thu Dec 20 15:01:44 2012
+++ loncom/localize/localize/de.pm Fri Dec 21 14:49:54 2012
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# German Localization Lexicon
#
-# $Id: de.pm,v 1.475 2012/12/20 15:01:44 bisitz Exp $
+# $Id: de.pm,v 1.476 2012/12/21 14:49:54 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -10286,8 +10286,8 @@
'Revoking [_1] in [_2]'
=> 'Entziehe Rolle [_1] für [_2]',
- 'Revoking custom role [_1] by [_2]:[_3] in [_4]'
-=> 'Entziehe benutzerdefinierte Rolle [_1] von [_2]:[_3] in [_4]',
+ 'Revoking custom role [_1] by [_2] in [_3]'
+=> 'Entziehe benutzerdefinierte Rolle [_1] von [_2] in [_3]',
'Deleting [_1] in [_2]'
=> 'Entferne Rolle [_1] für [_2]',
@@ -10301,11 +10301,8 @@
'Re-enabling [_1] in [_2]'
=> 'Reaktivierung der Rolle [_1] für [_2]',
- 'Re-enabling custom role [_1] by [_2]:[_3] in [_4] : [_5]'
-=> 'Reaktivierung der benutzerdefinierten Rolle [_1] für [_2] in [_3]: [_4]',
-
- 'Re-enabling custom role [_1] by [_2] in [_3]: [_4]'
-=> 'Reaktivierung der benutzerdefinierten Rolle [_1] für [_2] in [_3]: [_4]',
+ 'Re-enabling custom role [_1] by [_2] in [_3]'
+=> 'Reaktivierung der benutzerdefinierten Rolle [_1] für [_2] in [_3]',
'Unknown command'
=> 'Unbekannter Befehl',
More information about the LON-CAPA-cvs
mailing list