Exemple #1
0
    $AppUI->setState('UserIdxOrderby', w2PgetParam($_GET, 'orderby', null));
}
$orderby = $AppUI->getState('UserIdxOrderby') ? $AppUI->getState('UserIdxOrderby') : 'user_username';
$orderby = $tab == 3 || $orderby != 'date_time_in' && $orderby != 'user_ip' ? $orderby : 'user_username';
// Pull First Letters
$letters = CUser::getFirstLetters();
$letters = $letters . CContact::getFirstLetters($AppUI->user_id, true);
$a2z = '<a href="./index.php?m=users&stub=0">' . $AppUI->_('All') . '</a>&nbsp;&nbsp;&nbsp;&nbsp;';
for ($c = 65; $c < 91; $c++) {
    $cu = chr($c);
    $cell = !(mb_strpos($letters, $cu) === false) ? '<a href="?m=users&stub=' . $cu . '">' . $cu . '</a>' : '<font color="#999999">' . $cu . '</font>';
    $a2z .= $cell . '&nbsp;';
}
// setup the title block
$titleBlock = new w2p_Theme_TitleBlock('User Management', 'icon.png', $m);
$titleBlock->addSearchCell($where);
$titleBlock->addCell($a2z);
$titleBlock->addButton('New user', '?m=users&a=addedit');
$titleBlock->show();
?>
<script language="javascript" type="text/javascript">
<?php 
// security improvement:
// some javascript functions may not appear on client side in case of user not having write permissions
// else users would be able to arbitrarily run 'bad' functions
if ($canDelete) {
    ?>
function delMe( x, y ) {
	if (confirm( "<?php 
    echo $AppUI->_('doDelete', UI_OUTPUT_JS) . ' ' . $AppUI->_('User', UI_OUTPUT_JS);
    ?>
Exemple #2
0
    $AppUI->setState('CompIdxOrderDir', $orderdir);
}
$orderby = $AppUI->getState('CompIdxOrderBy') ? $AppUI->getState('CompIdxOrderBy') : 'company_name';
$orderdir = $AppUI->getState('CompIdxOrderDir') ? $AppUI->getState('CompIdxOrderDir') : 'asc';
$owner_filter_id = $AppUI->processIntState('owner_filter_id', $_POST, 'owner_filter_id', 0);
$search_string = w2PgetParam($_POST, 'search_string', '');
$search_string = w2PformSafe($search_string, true);
$company = new CCompany();
$canCreate = $company->canCreate();
$perms =& $AppUI->acl();
$baseArray = array(0 => $AppUI->_('All', UI_OUTPUT_RAW));
$allowedArray = $perms->getPermittedUsers('companies');
$owner_list = is_array($allowedArray) ? $baseArray + $allowedArray : $baseArray;
// setup the title block
$titleBlock = new w2p_Theme_TitleBlock('Companies', 'icon.png', $m);
$titleBlock->addSearchCell($search_string);
$titleBlock->addFilterCell('Owner', 'owner_filter_id', $owner_list, $owner_filter_id);
if ($canCreate) {
    $titleBlock->addButton('new company', '?m=companies&a=addedit');
}
$titleBlock->show();
// load the company types
$companyTypes = w2PgetSysVal('CompanyType');
$tabBox = new CTabBox('?m=companies', W2P_BASE_DIR . '/modules/companies/', $tab);
if ($tabBox->isTabbed()) {
    array_unshift($companyTypes, $AppUI->_('All Companies', UI_OUTPUT_RAW));
}
foreach ($companyTypes as $type_name) {
    $tabBox->add('vw_companies', $type_name);
}
$tabBox->show();