Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F773148
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Feb 2, 3:47 AM
Size
11 KB
Mime Type
text/x-diff
Expires
Tue, Feb 4, 3:47 AM (1 d, 14 h)
Engine
blob
Format
Raw Data
Handle
556406
Attached To
rINP In-Portal
in-portal
View Options
Index: trunk/admin/users/user_groups.php
===================================================================
--- trunk/admin/users/user_groups.php (revision 627)
+++ trunk/admin/users/user_groups.php (revision 628)
@@ -1,289 +1,290 @@
<?php
##############################################################
##In-portal ##
##############################################################
## In-portal ##
## Intechnic Corporation ##
## All Rights Reserved, 1998-2002 ##
## ##
## No portion of this code may be copied, reproduced or ##
## otherwise redistributed without proper written ##
## consent of Intechnic Corporation. Violation will ##
## result in revocation of the license and support ##
## privileges along maximum prosecution allowed by law. ##
##############################################################
if(!strlen($pathtoroot))
{
$path=dirname(realpath(__FILE__));
if(strlen($path))
{
/* determine the OS type for path parsing */
$pos = strpos($path,":");
if ($pos === false)
{
$gOS_TYPE="unix";
$pathchar = "/";
}
else
{
$gOS_TYPE="win";
$pathchar="\\";
}
$p = $path.$pathchar;
/*Start looking for the root flag file */
while(!strlen($pathtoroot) && strlen($p))
{
$sub = substr($p,strlen($pathchar)*-1);
if($sub==$pathchar)
{
$filename = $p."root.flg";
}
else
$filename = $p.$pathchar."root.flg";
if(file_exists($filename))
{
$pathtoroot = $p;
}
else
{
$parent = realpath($p.$pathchar."..".$pathchar);
if($parent!=$p)
{
$p = $parent;
}
else
$p = "";
}
}
if(!strlen($pathtoroot))
$pathtoroot = ".".$pathchar;
}
else
{
$pathtoroot = ".".$pathchar;
}
}
$sub = substr($pathtoroot,strlen($pathchar)*-1);
if($sub!=$pathchar)
{
$pathtoroot = $pathtoroot.$pathchar;
}
//echo $pathtoroot;
require_once($pathtoroot."kernel/startup.php");
$admin = $objConfig->Get("AdminDirectory");
if(!strlen($admin))
$admin = "admin";
$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
$localURL=$rootURL."kernel/";
$adminURL = $rootURL.$admin;
$imagesURL = $adminURL."/images";
//admin only util
$pathtolocal = $pathtoroot."kernel/";
require_once ($pathtoroot.$admin."/include/elements.php");
require_once ($pathtoroot."kernel/admin/include/navmenu.php");
require_once ($pathtolocal."admin/include/navmenu.php");
require_once($pathtoroot.$admin."/toolbar.php");
require_once($pathtoroot.$admin."/listview/listview.php");
$pathtolocal = $pathtoroot;
/* -------------------------------------- Section configuration ------------------------------------------- */
$section = 'in-portal:user_groups';
$envar = "env=" . BuildEnv();
$SortFieldVar = "Group_SortField";
$SortOrderVar = "Group_SortOrder";
$DefaultSortField = "Name";
$PerPageVar = "Perpage_Groups";
$CurrentPageVar = "Page_Groups";
$CurrentFilterVar = "Group_View";
$ListForm = "grouplistform";
$CheckClass = "GroupChecks";
/* ------------------------------------- Configure the toolbar ------------------------------------------- */
$objListToolBar = new clsToolBar();
$objListToolBar->Set("section",$section);
$objListToolBar->Set("load_menu_func","");
$objListToolBar->Set("CheckClass",$CheckClass);
$objListToolBar->Set("CheckForm",$ListForm);
$listImages = array();
//$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick
$objListToolBar->Add("new_group", "la_ToolTip_NewGroup",$adminURL."/users/addgroup.php?".$envar."&new=1","swap('new_group','toolbar/tool_new_group_f2.gif');",
"swap('new_group', 'toolbar/tool_new_group.gif');","","tool_new_group.gif");
$objListToolBar->Add("group_edit","la_ToolTip_Edit","#", "if (GroupChecks.itemChecked()) swap('group_edit','toolbar/tool_edit_f2.gif');",
"if (GroupChecks.itemChecked()) swap('group_edit', 'toolbar/tool_edit.gif');","if (GroupChecks.itemChecked()) GroupChecks.check_submit('addgroup', '');",
"tool_edit.gif",TRUE,TRUE);
$listImages[] = "GroupChecks.addImage('group_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1); ";
$objListToolBar->Add("group_del","la_ToolTip_Delete","#", "if (GroupChecks.itemChecked()) swap('group_del','toolbar/tool_delete_f2.gif');",
"if (GroupChecks.itemChecked()) swap('group_del', 'toolbar/tool_delete.gif');","if (GroupChecks.itemChecked()) GroupChecks.check_submit('user_groups', 'm_delete_group');",
"tool_delete.gif",FALSE,TRUE);
$listImages[] = "GroupChecks.addImage('group_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1); ";
$objListToolBar->Add("divider");
$objListToolBar->Add("group_mail","la_ToolTip_SendMail","#", "if (GroupChecks.itemChecked()) swap('group_mail','toolbar/tool_e-mail_f2.gif');",
"if (GroupChecks.itemChecked()) swap('group_mail', 'toolbar/tool_e-mail.gif');","if (GroupChecks.itemChecked()) openEmailPopup('','sendmail',$CheckClass);",
"tool_e-mail.gif",FALSE,TRUE);
$listImages[] = "GroupChecks.addImage('group_mail','$imagesURL/toolbar/tool_e-mail.gif','$imagesURL/toolbar/tool_e-mail_f3.gif',1); ";
$objListToolBar->Add("user_print", "la_ToolTip_Print","#","swap('user_print','toolbar/tool_print_f2.gif');",
"swap('user_print', 'toolbar/tool_print.gif');","window.print();","tool_print.gif");
$objListToolBar->Add("viewmenubutton", "la_ToolTip_View","#","swap('viewmenubutton','toolbar/tool_view_f2.gif'); ",
"swap('viewmenubutton', 'toolbar/tool_view.gif');",
"ShowViewMenu();","tool_view.gif");
$objListToolBar->AddToInitScript($listImages);
/* ----------------------------------------- Set the View Filter ---------------------------------------- */
/* bit place holders for category view menu */
//$Bit_Pending=4;
$Bit_Disabled=2;
$Bit_Valid=1;
$Bit_All = 3; //7;
$FilterLabels = array();
$FilterLabels[0] = admin_language("la_Text_Enabled");
$FilterLabels[1] = admin_language("la_Text_Disabled");
//$FilterLabels[2] = admin_language("la_Text_Pending");
/* determine current view menu settings */
$GroupView = $objConfig->Get("Group_View");
$Status = Array();
if(!is_numeric($GroupView))
{
$GroupView = $Bit_All; //Set all bits ON
$GroupFilter = "";
}
else
{
if($GroupView & $Bit_Valid)
$Status[] = 1;
if($GroupView & $Bit_Disabled)
$Status[] = 0;
/* if($GroupView & $Bit_Pending)
$Status[] = 2;*/
if(count($Status)>0)
{
$GroupFilter = "Enabled IN (".implode(",",$Status).")";
}
else
$GroupFilter = "Enabled = -1";
}
$order = $objConfig->Get($SortOrderVar);
$SearchWords = $objSession->GetVariable("GroupSearchWord");
if(strlen($SearchWords))
{
$where = " Personal=0 AND ". $objGroups->AdminSearchWhereClause($SearchWords);
}
else
$where = " Personal=0 ";
if(strlen($GroupFilter))
$where .= " AND $GroupFilter ";
/* ------------------------------------ Build the SQL statement to populate the list ---------------------------*/
$orderBy = trim($objConfig->Get($SortFieldVar)." ".$order);
if(strlen($orderBy))
$orderBy = " ORDER BY ".$orderBy;
$prefix = GetTablePrefix();
-$sql = "SELECT g.GroupId as GroupId, g.name as GroupName,g.name as name, count(u.PortalUserId) as UserCount
- FROM ".$prefix."PortalGroup as g, ".$prefix.'UserGroup u
- WHERE g.GroupId=u.GroupId AND '.$where.'GROUP BY g.name'.$orderBy;;
+$sql = 'SELECT g.GroupId AS GroupId, g.name AS GroupName, g.name AS name, count(u.PortalUserId) AS UserCount
+ FROM '.$prefix.'PortalGroup AS g
+ LEFT JOIN '.$prefix.'UserGroup u ON u.GroupId = g.GroupId
+ WHERE '.$where.'GROUP BY g.name'.$orderBy;
if($objSession->HasSystemPermission("DEBUG.LIST"))
echo htmlentities($sql,ENT_NOQUOTES)."<br>\n";
$GroupList = new clsGroupList();
$GroupList->Clear();
$GroupList->Query_Item($sql);
$itemcount = TableCount(GetTablePrefix()."PortalGroup", $where,0);
if(strlen($SearchWords))
{
$title = prompt_language("la_Text_Search_Results")." (".$itemcount.")";
}
else
$title = prompt_language("la_Text_ShowingGroups")." (".$itemcount.")";
/* ---------------------------------------- Configure the list view ---------------------------------------- */
$objListView = new clsListView($objListToolBar,$GroupList);
$objListView->IdField = "GroupId";
$objListView->ColumnHeaders->Add("GroupName", admin_language("la_prompt_GroupName"),1,0,$order,"width=\"50%\"",$SortFieldVar,$SortOrderVar,"GroupName");
$objListView->ColumnHeaders->Add("UserCount",admin_language("la_prompt_UserCount"),1,0,$order,"width=\"50%\"",$SortFieldVar,$SortOrderVar,"UserCount");
$objListView->ColumnHeaders->SetSort($objConfig->Get("Group_SortField"),$order);
$objListView->PrintToolBar = FALSE;
$objListView->SearchBar = TRUE;
$objListView->SearchKeywords = $SearchWords;
$objListView->SearchAction="m_group_search";
$objListView->CurrentPageVar = $CurrentPageVar;
$objListView->PerPageVar = $PerPageVar;
$objListView->CheckboxName = "itemlist[]";
$objListView->TotalItemCount = $itemcount;
$objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField,
$CurrentFilterVar,$GroupView,$Bit_All);
foreach($FilterLabels as $Bit=>$Label)
{
$objListView->AddViewMenuFilter($Label,$Bit);
}
$objListToolBar->AddToInitScript("fwLoadMenus();");
$h = "\n\n<SCRIPT Language=\"JavaScript1.2\">\n".$objListView->GetViewMenu($imagesURL)."\n</SCRIPT>\n";
int_header($objListToolBar,NULL, $title,NULL,$h);
?>
<FORM method="POST" ACTION="" NAME="grouplistform" ID="grouplistform">
<?php
$objListView->PageLinks = $objListView->PrintPageLinks(); /* call this before we slice! */
$objListView->SliceItems();
print $objListView->PrintList();
?>
<input type="hidden" name="Action" value="">
</FORM>
<!-- CODE FOR VIEW MENU -->
<form method="post" action="<?php echo $_SERVER["PHP_SELF"]."?env=".BuildEnv(); ?>" name="viewmenu">
<input type="hidden" name="fieldname" value="">
<input type="hidden" name="varvalue" value="">
<input type="hidden" name="varvalue2" value="">
<input type="hidden" name="Action" value="">
</form>
<FORM method=POST NAME="sendmail" ID="sendmail" TARGET="sendmail" ACTION="<?php echo $adminURL."/email/sendmail.php?env=".BuildEnv(); ?>">
<INPUT TYPE="HIDDEN" NAME="idlist" ID="idlist" VALUE="">
<INPUT TYPE="hidden" NAME="idtype" ID="idtype" VALUE="group">
</FORM>
<FORM ID="ListSearchForm" NAME="ListSearchForm" method="POST" action="<?php echo $_SERVER["PHP_SELF"]."?env=".BuildEnv(); ?>">
<INPUT TYPE="HIDDEN" NAME="Action" VALUE="">
<INPUT TYPE="HIDDEN" NAME="list_search">
</FORM>
<script src="<?php echo $adminURL; ?>/listview/listview.js"></script>
<script>
initSelectiorContainers();
<?php echo $objListToolBar->Get("CheckClass").".setImages();"; ?>
</script>
<!-- END CODE-->
<?php int_footer(); ?>
Property changes on: trunk/admin/users/user_groups.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property
Event Timeline
Log In to Comment