Merge pull request #25 from marcoAntonioNina/BUG-9218

BUG 9218 Con el plugin ldap v.1.4.26, haciendo upgrade... SOLVED
This commit is contained in:
julceslauhub
2012-06-01 13:15:42 -07:00
7 changed files with 230 additions and 95 deletions

View File

@@ -95,11 +95,11 @@ try {
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
if ($aFields['AUTH_SOURCE_PROVIDER'] != 'ldap') {
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'authSources/ldapSearchResults', $oCriteria,' ',array('Checkbox' => G::LoadTranslation('ID_MSG_CONFIRM_DELETE_CASE_SCHEDULER')));
$G_PUBLISH->AddContent('propeltable', 'pagedTableLdap', 'authSources/ldapSearchResults', $oCriteria,' ',array('Checkbox' => G::LoadTranslation('ID_MSG_CONFIRM_DELETE_CASE_SCHEDULER')));
}
else {
if (file_exists(PATH_XMLFORM . 'authSources/' . $aFields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) {
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'authSources/' . $aFields['AUTH_SOURCE_PROVIDER'] . 'SearchResults', $oCriteria,' ',array('Checkbox' => G::LoadTranslation('ID_MSG_CONFIRM_DELETE_CASE_SCHEDULER')));
$G_PUBLISH->AddContent('propeltable', 'pagedTableLdap', 'authSources/' . $aFields['AUTH_SOURCE_PROVIDER'] . 'SearchResults', $oCriteria,' ',array('Checkbox' => G::LoadTranslation('ID_MSG_CONFIRM_DELETE_CASE_SCHEDULER')));
}
else {
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', array('MESSAGE' => 'File: ' . $aFields['AUTH_SOURCE_PROVIDER'] . 'SearchResults.xml' . ' doesn\'t exist.'));

View File

@@ -0,0 +1,144 @@
<!-- START BLOCK : headBlock -->
<table cellpadding="0" cellspacing="0" border="0"><tr><td>
<div class="boxTop"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="pagedTableDefault">
<table id="pagedtable[{pagedTable_Id}]" name="pagedtable[{pagedTable_Name}]" border="0" cellspacing="0" cellpadding="0" class="Default">
<tr >
<td valign="top">
<div class='subtitle'>{title}</div>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<!-- START BLOCK : headerBlock -->
<tr><td class="headerContent">{content}</td></tr>
<!-- END BLOCK : headerBlock -->
</table>
<table id="table[{pagedTable_Id}]" name="table[{pagedTable_Name}]" cellspacing="0" cellpadding="0" width="100%" class="pagedTable">
<!-- END BLOCK : headBlock -->
<!-- START BLOCK : contentBlock -->
<script type="text/javascript">{pagedTable_JS}</script>
<tr>
<!-- START BLOCK : headers -->
<td class="pagedTableHeader"><img style="{displaySeparator}" src="/js/maborak/core/images/separatorTable.gif" /></td>
<td width="{width}" style="{align}" class="pagedTableHeader" >
<a href="{href}" onclick="{onclick}{onsort}">{header}</a>
</td>
<!-- END BLOCK : headers -->
</tr>
<!-- START BLOCK : row -->
<!-- START BLOCK : rowMaster -->
<tr class='{masterRowClass}' id="{masterRowName}">
<!-- START BLOCK : fieldMaster -->
<td class="pagedTableHeader1"><a href="#" ><img src="/images/minus.gif" onclick="toggleMasterDetailGroup('table[{pagedTable_Name}]','{masterRowName}',this);return false;" border="0"></a><b>{value1}</b></td><td class="pagedTableHeader1" {alignAttr}><b>{value}</b>&nbsp;</td>
<!-- END BLOCK : fieldMaster -->
</tr>
<!-- END BLOCK : rowMaster -->
<tr class='{class}' onmouseover="setRowClass(this, 'RowPointer' )" onmouseout="setRowClass(this, '{class}')" name="{rowName}" id="{rowName}">
<!-- START BLOCK : field -->
<td{classAttr}></td><td{classAttr}{alignAttr}>{value}</td>
<!-- END BLOCK : field -->
</tr>
<!-- END BLOCK : row -->
<!-- START BLOCK : rowTag -->
<!-- END BLOCK : rowTag -->
<!-- START BLOCK : norecords -->
<tr class='Row2'>
<td nowrap colspan="{columnCount}" align='center' >&nbsp;
{noRecordsFound}<br>&nbsp;
</td>
</tr>
<!-- END BLOCK : norecords -->
<!-- START BLOCK : bottomFooter -->
<tr>
<td nowrap colspan="{columnCount}">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr class="pagedTableFooter">
<td width="110px" style="{indexStyle}">
{labels:ID_ROWS}&nbsp;{firstRow}-{lastRow}/{totalRows}&nbsp;
</td>
<!--<td style="text-align:center;{fastSearchStyle}"><!--{labels:ID_SEARCH}
<input type="text" class="FormField" onkeypress="if (event.keyCode===13){pagedTableId}.doFastSearch(this.value);if (event.keyCode===13)return false;" value="{fastSearchValue}" onfocus="this.select();" size="10" style="{fastSearchStyle}"/>
</td>-->
<td style="text-align:center;">
{first}&nbsp;{prev}&nbsp;{next}&nbsp;{last}
</td>
<td width="60px" style="text-align:right;padding-right:8px;{indexStyle}">{labels:ID_PAGE}&nbsp;{currentPage}/{totalPages}</td>
</tr>
</table>
</td>
</tr>
<!-- END BLOCK : bottomFooter -->
<!-- END BLOCK : contentBlock -->
<!-- START BLOCK : closeBlock -->
</table>
</td>
</tr>
</table>
</div>
<div class="boxBottom"><div class="a"></div><div class="b"></div><div class="c"></div></div>
</td></tr></table>
<!-- END BLOCK : closeBlock -->
<!-- START IGNORE -->
<script type="text/javascript">
if (typeof(document.getElementById("form[SelectAll]")) != undefined) {
document.getElementById("form[SelectAll]").innerHTML = '[SELECT-ALL]';
}
function toggleMasterDetailGroup(tablename,groupName,imgicon){
alert("ingresa");
groupNameArray=groupName.split(",");
table=getElementByName(tablename);
var rows = table.getElementsByTagName('tr');
for(i=0;i<rows.length;i++){
if(rows[i].id!=""){
currentRowArray=rows[i].id.split(",");
sw=false;
//alert(groupNameArray);
//alert(currentRowArray);
tempVar=currentRowArray[0].split("_MD_");
if(tempVar[0]==""){
if(currentRowArray.length>groupNameArray.length){
currentRowArray[0]=tempVar[1];
}
}
for(j=0;j<groupNameArray.length;j++){
if(currentRowArray[j]==groupNameArray[j]){
sw=true;
}else{
sw=false;
}
}
//alert(sw);
if(sw){
if (rows[i].style.display == '') {
rows[i].style.display = 'none';
imgicon.src="/images/plus_red.gif";
}else{
rows[i].style.display = '';
imgicon.src="/images/minus.gif";
}
}
}
}
}
</script>
<!-- END IGNORE -->

View File

@@ -24,9 +24,6 @@
<tr>
<td valign='top'>
<table cellspacing="0" cellpadding="0" border="0" width="95%">
<tr>
<td align="left" valign="baseline">&nbsp; &nbsp; {$form.CheckboxSelectAll} <span id="AgeLabel"><span> </td>
</tr>
<tr>
<td align="center">
<span id="spanUsers" />

View File

@@ -23,47 +23,41 @@
<en>Cancel</en>
</BTN_CANCEL>
<CheckboxSelectAll type="Checkbox">
<en></en>
</CheckboxSelectAll>
<JS type="javascript"><![CDATA[
getField('CheckboxSelectAll').style.visibility = 'hidden';
getField('btnImport').style.visibility = 'hidden';
function disableEnterKey(e)
{
var key;
if(window.event)
key = window.event.keyCode; //IE
else
key = e.which; //firefox
var key;
if(window.event)
key = window.event.keyCode; //IE
else
key = e.which; //firefox
if(key == 13) {
searchUsers();
e.cancelBubble = true;
e.returnValue = false;
if (e.stopPropagation) {
e.stopPropagation();
e.preventDefault();
}
return false;
} else {
return true;
}
if(key == 13) {
searchUsers();
e.cancelBubble = true;
e.returnValue = false;
if (e.stopPropagation) {
e.stopPropagation();
e.preventDefault();
}
return false;
} else {
return true;
}
}
getField('btnImport').style.visibility = 'hidden';
var searchUsers = function() {
var oRPC = new leimnud.module.rpc.xmlhttp({
url : 'authSources_Ajax',
args: 'action=searchUsers&sUID=' + getField('AUTH_SOURCE_UID').value + '&sKeyword=' + getField('KEYWORD').value
url : 'authSources_Ajax',
args : 'action=searchUsers&sUID=' + getField('AUTH_SOURCE_UID').value + "&sKeyword=" + getField('KEYWORD').value
});
oRPC.callback = function(rpc){
document.getElementById('spanUsers').innerHTML = rpc.xmlhttp.responseText;
if (document.getElementById('aUsers[0]')) {
if (checkInfo()) {
getField('btnImport').style.visibility = 'visible';
getField('CheckboxSelectAll').style.visibility = 'visible';
document.getElementById("AgeLabel").innerHTML = '[SELECT-ALL]';
}
else {
getField('btnImport').style.visibility = 'hidden';
@@ -76,6 +70,17 @@ var searchUsers = function() {
};
function checkInfo() {
var input_obj = document.getElementsByTagName("input");
for (i = 0; i < input_obj.length; i++) {
if (input_obj.item(i).type == 'checkbox')
{
return true;
}
}
return false;
}
var importUsers = function(oForm) {
var bContinue = false;
var i = 0;
@@ -94,42 +99,13 @@ var importUsers = function(oForm) {
}
};
var selectAll = function(bChecked) {
var oAux;
var i = 0;
while (oAux = document.getElementById('aUsers[' + i + ']')) {
oAux.checked = true;
i++;
}
};
function cancel(){
window.location = 'authSources_List';
window.location = 'authSources_List';
}
leimnud.event.add(getField('KEYWORD'), 'keypress', function(event) {
return disableEnterKey(event);
});
leimnud.event.add(getField('CheckboxSelectAll'), 'click', function() {
var oAux;
var i = 0;
if (document.getElementById('form[CheckboxSelectAll]').checked)
{
document.getElementById("AgeLabel").innerHTML = '[DESELECT-ALL]';
while (oAux = document.getElementById('aUsers[' + i + ']')) {
oAux.checked = true;
i++;
}
}
else
{
document.getElementById("AgeLabel").innerHTML = '[SELECT-ALL]';
while (oAux = document.getElementById('aUsers[' + i + ']')) {
oAux.checked = false;
i++;
}
}
});
]]></JS>

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm type="xmlmenu">
<SelectAll type="link" value='[SELECT-ALL]' link="#" onclick="selectAll(); return false;" colAlign="left" colWidth="100">
<en></en>
</SelectAll>
<PAGE type="hidden" value="1"/>
<PAGED_TABLE_ID type="private"/>
<js type="javascript" replaceTags="1"><![CDATA[
function selectAll(){
var oAux;
var i = 0;
var input_obj = document.getElementsByTagName("input");
if (document.getElementById("form[SelectAll]").innerHTML == '[SELECT-ALL]') {
document.getElementById("form[SelectAll]").innerHTML = '[DESELECT-ALL]';
for (i = 0; i < input_obj.length; i++) {
if (input_obj.item(i).type == 'checkbox')
{
input_obj.item(i).checked = true;
}
}
}
else
{
document.getElementById("form[SelectAll]").innerHTML = '[SELECT-ALL]';
for (i = 0; i < input_obj.length; i++) {
if (input_obj.item(i).type == 'checkbox')
{
input_obj.item(i).checked = false;
}
}
}
}
]]></js>
</dynaForm>

View File

@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm width="90%" rowsPerPage="1000">
<dynaForm menu="authSources/authSources_SearchUsersMenu" width="90%" rowsPerPage="1000">
<Checkbox type="text" titleAlign="center" align="left" enableHtml="1" onclick="return false;">
<Checkbox type="text" titleAlign="center" align="left" colWidth="20%" enableHtml="1" onclick="return false;">
<en><![CDATA[<span id="spanSelectAll"></span>]]></en>
</Checkbox>
<FullName type="text" colWidth="20%" titleAlign="center" align="left">
<FullName type="text" colWidth="15%" titleAlign="center" align="left">
<en>Name</en>
</FullName>
<Email type="text" colWidth="20%" titleAlign="center" align="left">
<Email type="text" colWidth="15%" titleAlign="center" align="left">
<en><![CDATA[<span style="width:40px; display:block;">E-Mail</span>]]></en>
</Email>