Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Fri, Jul 18, 7:12 AM

in-portal

Index: trunk/admin/users/group_select.php
===================================================================
--- trunk/admin/users/group_select.php (revision 3682)
+++ trunk/admin/users/group_select.php (revision 3683)
@@ -1,152 +1,155 @@
<?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. ##
##############################################################
define('IS_POPUP', 1);
// new startup: begin
define('REL_PATH', 'admin/users');
$relation_level = count( explode('/', REL_PATH) );
define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
require_once FULL_PATH.'/kernel/startup.php';
// new startup: end
$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;
//Set Section
$section = 'in-portal:groupselect';
//Set Environment Variable
$envar = "env=" . BuildEnv();
//Display header
$objListToolBar = new clsToolBar();
$objListToolBar->Set("section",$section);
$objListToolBar->Set("load_menu_func","");
$objListToolBar->Set("CheckClass","GroupChecks");
$listImages = array();
//$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick
$objListToolBar->Add("select", "la_ToolTip_Select","#","swap('select','toolbar/tool_select_f2.gif');",
"swap('select', 'toolbar/tool_select.gif');",
"SelectSubmit();",
"tool_select.gif");
$objListToolBar->Add("cancel", "la_ToolTip_Stop","#","swap('cancel','toolbar/tool_stop_f2.gif');",
"swap('cancel', 'toolbar/tool_stop.gif');","window.close();","tool_stop.gif");
/*$objListToolBar->Add("divider");
$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);
$objListToolBar->AddToInitScript("fwLoadMenus();");
$order = $objConfig->Get("GroupSelect_SortOrder");
$SelectorType = GetVar('Selector');
if(!$SelectorType) $SelectorType = 'checkbox';
$source = GetVar('source');
$objGroups->Page = GetVar('lpn');
// NEW: begin
$application =& kApplication::Instance();
$db =& $application->GetADODBConnection();
switch ($source) {
case 'addcategory_permissions':
$SelectorType = 'radio';
- $sql = 'SELECT DISTINCT(GroupId)
+ $exclude_sql = 'SELECT DISTINCT(GroupId)
FROM '.TABLE_PREFIX.'Permissions
WHERE CatId = '.$application->GetVar('CatId');
break;
case 'adduser_groups':
$SelectorType = 'radio';
- $sql = 'SELECT GroupId
+ $exclude_sql = 'SELECT GroupId
FROM '.$objSession->GetEditTable('UserGroup').'
WHERE PortalUserId = '.$application->GetVar('UserId');
break;
+ default:
+ $exclude_sql = '';
+ break;
}
- $skip_groups = $db->GetCol($sql);
+ $skip_groups = $exclude_sql ? $db->GetCol($exclude_sql) : Array();
$where_clause = $skip_groups ? 'GroupId NOT IN ('.implode(',', $skip_groups).')' : '1';
$objGroups->LoadGroups('(Personal = 0) AND ('.$where_clause.')', trim($objConfig->Get('GroupSelect_SortField').' '.$order));
// NEW: end
$objListView = new clsListView($objListToolBar,$objGroups);
$objListView->IdField = "ResourceId";
$objListView->PageLinkTemplate = $pathtoroot.$admin."/templates/user_page_link.tpl";
$objListView->ColumnHeaders->Add("Name", admin_language("la_prompt_Name"),1,0,$order,"width=\"20%\"","GroupSelect_SortField","GroupSelect_SortOrder","Name");
$objListView->ColumnHeaders->Add("Description", admin_language("la_prompt_Description"),1,0,$order,"width=\"30%\"","GroupSelect_SortField","GroupSelect_SortOrder","Description");
$objListView->ColumnHeaders->SetSort($objConfig->Get("GroupSelect_SortField"),$order);
$objListView->PrintToolBar = FALSE;
$objListView->CurrentPageVar = "Page_Grouplist";
$objListView->PerPageVar = "Perpage_Grouplist";
$objListView->CheckboxName = "itemlist[]";
$objListView->TotalItemCount = $objGroups->QueryItemCount;
$objListView->SelectorType = $SelectorType;
$objListView->extra_env = 'destform='.GetVar('destform').'&destfield='.GetVar('destfield').'&Selector='.GetVar('Selector');
$title = 'Select Group';
int_header($objListToolBar,NULL,$title);
$values = GetVar('values');
if($values) $current_value = explode(',', $values);
?>
<FORM method="POST" ACTION="" NAME="grouplistform" ID="grouplistform">
<?php
print $objListView->PrintList();
?>
<input type="hidden" name="Action" value="">
</FORM>
<!-- CODE FOR VIEW MENU -->
<form method="post" action="<?php echo $_SERVER["PHP_SELF"]."?".$_SERVER["QUERY_STRING"]; ?>" 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>
<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/group_select.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.12
\ No newline at end of property
+1.13
\ No newline at end of property

Event Timeline