[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm loncreateuser.pm
raeburn
lon-capa-cvs-allow@mail.lon-capa.org
Fri, 31 Aug 2007 17:58:48 -0000
raeburn Fri Aug 31 13:58:48 2007 EDT
Modified files:
/loncom/interface loncreateuser.pm loncommon.pm
Log:
Alternative approach to response to "other valid matchless searches".
loncommon.pm
- Eliminate "Make new user if no match found" radio buttons, and triggered automatic setting of select boxes defining search criteria.
loncreateuser.pm
- explicitly require user to select "username is .... in selected LON-CAPA domain" search in valid domain to be able to add a new user.
- update the text to tell the user what needs to be done to add a new user when no matches found in other types of valid matchless searches.
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.181 loncom/interface/loncreateuser.pm:1.182
--- loncom/interface/loncreateuser.pm:1.181 Fri Aug 31 08:33:32 2007
+++ loncom/interface/loncreateuser.pm Fri Aug 31 13:58:47 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.181 2007/08/31 12:33:32 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.182 2007/08/31 17:58:47 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2568,7 +2568,8 @@
}
}
if (!($srch->{'srchby'} eq 'uname' && $srch->{'srchin'} eq 'dom' && $srch->{'srchtype'} eq 'exact' && $srch->{'srchdomain'} eq $env{'request.role.domain'})) {
- $response .= '<br />'.&mt("<b>To add a new user</b> (you can only create new users in your current role's domain - <span class=\"LC_cusr_emph\">[_1]</span>) ...",$env{'request.role.domain'}).'<ul><li>'.&mt("Set '<span class=\"LC_cusr_emph\">Make new user if no match found</span>' to '<b>Yes</b>'").'</li><li>'.&mt('Provide the proposed username').'</li><li>'.&mt('Search').'</li></ul><br />';
+ my $showdom = &display_domain_info($env{'request.role.domain'});
+ $response .= '<br /><br />'.&mt("<b>To add a new user</b> (you can only create new users in your current role's domain - <span class=\"LC_cusr_emph\">[_1]</span>):",$env{'request.role.domain'}).'<ul><li>'.&mt("Set 'Domain/institution to search' to: <span class=\"LC_cusr_emph\">[_1]</span>",$showdom).'<li>'.&mt("Set 'Search criteria' to: <span class=\"LC_cusr_emph\">'username is ...... in selected LON-CAPA domain'").'</span></li><li>'.&mt('Provide the proposed username').'</li><li>'.&mt('Search').'</li></ul><br />';
}
}
}
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.576 loncom/interface/loncommon.pm:1.577
--- loncom/interface/loncommon.pm:1.576 Thu Aug 30 23:21:27 2007
+++ loncom/interface/loncommon.pm Fri Aug 31 13:58:47 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.576 2007/08/31 03:21:27 raeburn Exp $
+# $Id: loncommon.pm,v 1.577 2007/08/31 17:58:47 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -5695,11 +5695,7 @@
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'}) {
$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";
@@ -5827,13 +5823,6 @@
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
=back