Revision: 1936
http://mrbs.svn.sourceforge.net/mrbs/?rev=1936&view=rev
Author: cimorrison
Date: 2011-09-08 08:55:56 +0000 (Thu, 08 Sep 2011)
Log Message:
-----------
Removed the privacy radio buttons from the Report form when the user is not
logged in as they're then redundant because only the "user" will only be able
to see public bookings. Thanks to a suggestion from J?\195?\182rg Wiemann in
SF Tracker ID: 3405402
Modified Paths:
--------------
mrbs/trunk/web/report.php
Modified: mrbs/trunk/web/report.php
===================================================================
--- mrbs/trunk/web/report.php 2011-09-08 08:28:49 UTC (rev 1935)
+++ mrbs/trunk/web/report.php 2011-09-08 08:55:56 UTC (rev 1936)
@@ -832,7 +832,8 @@
// Also need to know whether they have admin rights
$user = getUserName();
-$is_admin = (isset($user) && authGetUserLevel($user)>=2) ;
+$user_level = authGetUserLevel($user);
+$is_admin = ($user_level >= 2);
// Set some defaults
if (!isset($match_approved))
@@ -1252,20 +1253,31 @@
// Only show this part of the form if there are areas that allow
private bookings
if ($private_somewhere)
{
- echo "<div id=\"div_privacystatus\">\n";
- echo "<label>" . get_vocab("privacy_status") . ":</label>\n";
- echo "<div class=\"group\">\n";
- $options = array(PRIVATE_BOTH => 'both', PRIVATE_NO =>
'default_public', PRIVATE_YES => 'default_private');
- foreach ($options as $option => $token)
+ // If they're not logged in then there's no point in showing this
part of the form because
+ // they'll only be able to see public bookings anyway (and we don't
want to alert them to
+ // the existence of porivate bookings)
+ if (empty($user_level))
{
- echo "<label>";
- echo "<input class=\"radio\" type=\"radio\" name=\"match_private\"
value=\"$option\"" .
- (($match_private == $option) ? " checked=\"checked\"" : "") .
- ">" . get_vocab($token);
- echo "</label>\n";
+ echo "<input type=\"hidden\" name=\"match_private\" value=\"" .
PRIVATE_NO . "\">\n";
}
- echo "</div>\n";
- echo "</div>\n";
+ // Otherwise give them the radio buttons
+ else
+ {
+ echo "<div id=\"div_privacystatus\">\n";
+ echo "<label>" . get_vocab("privacy_status") . ":</label>\n";
+ echo "<div class=\"group\">\n";
+ $options = array(PRIVATE_BOTH => 'both', PRIVATE_NO =>
'default_public', PRIVATE_YES => 'default_private');
+ foreach ($options as $option => $token)
+ {
+ echo "<label>";
+ echo "<input class=\"radio\" type=\"radio\"
name=\"match_private\" value=\"$option\"" .
+ (($match_private == $option) ? " checked=\"checked\"" : "")
.
+ ">" . get_vocab($token);
+ echo "</label>\n";
+ }
+ echo "</div>\n";
+ echo "</div>\n";
+ }
}
// Confirmation status
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops? How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits