mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 23:32:17 +02:00
N°1476 : Fixed a regression introduced in 2.5 where on changing final class on a n-n object selection form, checkboxes were lost.
SVN:trunk[5830]
This commit is contained in:
20
js/utils.js
20
js/utils.js
@@ -250,7 +250,7 @@ function UpdateFileName(id, sNewFileName) {
|
|||||||
/**
|
/**
|
||||||
* Reload a search form for the specified class
|
* Reload a search form for the specified class
|
||||||
*/
|
*/
|
||||||
function ReloadSearchForm(divId, sClassName, sBaseClass, sContext, sTableId) {
|
function ReloadSearchForm(divId, sClassName, sBaseClass, sContext, sTableId, sExtraParams) {
|
||||||
var oDiv = $('#ds_'+divId);
|
var oDiv = $('#ds_'+divId);
|
||||||
oDiv.block();
|
oDiv.block();
|
||||||
// deprecated in jQuery 1.8
|
// deprecated in jQuery 1.8
|
||||||
@@ -278,7 +278,23 @@ function ReloadSearchForm(divId, sClassName, sBaseClass, sContext, sTableId) {
|
|||||||
oMap.currentId = divId;
|
oMap.currentId = divId;
|
||||||
oMap._table_id_ = sTableId;
|
oMap._table_id_ = sTableId;
|
||||||
oMap.action = sAction;
|
oMap.action = sAction;
|
||||||
|
if(sExtraParams['selection_mode'])
|
||||||
|
{
|
||||||
|
oMap.selection_mode = sExtraParams['selection_mode'];
|
||||||
|
}
|
||||||
|
if(sExtraParams['result_list_outer_selector'])
|
||||||
|
{
|
||||||
|
oMap.result_list_outer_selector = sExtraParams['result_list_outer_selector'];
|
||||||
|
}
|
||||||
|
if(sExtraParams['cssCount'])
|
||||||
|
{
|
||||||
|
oMap.css_count = sExtraParams['cssCount'];
|
||||||
|
$(sExtraParams['cssCount']).val(0).trigger('change');
|
||||||
|
}
|
||||||
|
if(sExtraParams['table_inner_id'])
|
||||||
|
{
|
||||||
|
oMap.table_inner_id = sExtraParams['table_inner_id'];
|
||||||
|
}
|
||||||
$.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php?'+sContext, oMap,
|
$.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php?'+sContext, oMap,
|
||||||
function (data) {
|
function (data) {
|
||||||
oDiv.empty();
|
oDiv.empty();
|
||||||
|
|||||||
@@ -861,9 +861,21 @@ try
|
|||||||
$currentId = utils::ReadParam('currentId', '');
|
$currentId = utils::ReadParam('currentId', '');
|
||||||
$sTableId = utils::ReadParam('_table_id_', null, false, 'raw_data');
|
$sTableId = utils::ReadParam('_table_id_', null, false, 'raw_data');
|
||||||
$sAction = utils::ReadParam('action', '');
|
$sAction = utils::ReadParam('action', '');
|
||||||
|
$sSelectionMode = utils::ReadParam('selection_mode', null,false,'raw_data');
|
||||||
|
$sResultListOuterSelector = utils::ReadParam('result_list_outer_selector', null,false,'raw_data');
|
||||||
|
$scssCount = utils::ReadParam('css_count', null,false,'raw_data');
|
||||||
|
$sTableInnerId = utils::ReadParam('table_inner_id', null,false,'raw_data');
|
||||||
|
|
||||||
$oFilter = new DBObjectSearch($sClass);
|
$oFilter = new DBObjectSearch($sClass);
|
||||||
$oSet = new CMDBObjectSet($oFilter);
|
$oSet = new CMDBObjectSet($oFilter);
|
||||||
$sHtml = cmdbAbstractObject::GetSearchForm($oPage, $oSet, array('currentId' => $currentId, 'baseClass' => $sRootClass, 'action' => $sAction, 'table_id' => $sTableId));
|
$sHtml = cmdbAbstractObject::GetSearchForm($oPage, $oSet, array('currentId' => $currentId,
|
||||||
|
'baseClass' => $sRootClass,
|
||||||
|
'action' => $sAction,
|
||||||
|
'table_id' => $sTableId,
|
||||||
|
'selection_mode' => $sSelectionMode,
|
||||||
|
'result_list_outer_selector' => $sResultListOuterSelector,
|
||||||
|
'cssCount' => $scssCount,
|
||||||
|
'table_inner_id' => $sTableInnerId));
|
||||||
$oPage->add($sHtml);
|
$oPage->add($sHtml);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -135,7 +135,8 @@ class SearchForm
|
|||||||
$aOptions[MetaModel::GetName($sClassName)] = "<option selected value=\"$sClassName\">".MetaModel::GetName($sClassName)."</options>\n";
|
$aOptions[MetaModel::GetName($sClassName)] = "<option selected value=\"$sClassName\">".MetaModel::GetName($sClassName)."</options>\n";
|
||||||
ksort($aOptions);
|
ksort($aOptions);
|
||||||
$sContext = $oAppContext->GetForLink();
|
$sContext = $oAppContext->GetForLink();
|
||||||
$sClassesCombo = "<select name=\"class\" onChange=\"ReloadSearchForm('$sSearchFormId', this.value, '$sRootClass', '$sContext', '{$aExtraParams['result_list_outer_selector']}')\">\n".implode('',
|
$sJsonExtraParams = htmlentities(json_encode($aListParams), ENT_QUOTES);
|
||||||
|
$sClassesCombo = "<select name=\"class\" onChange=\"ReloadSearchForm('$sSearchFormId', this.value, '$sRootClass', '$sContext', '{$aExtraParams['result_list_outer_selector']}', $sJsonExtraParams)\">\n".implode('',
|
||||||
$aOptions)."</select>\n";
|
$aOptions)."</select>\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -218,19 +219,20 @@ class SearchForm
|
|||||||
}
|
}
|
||||||
$sBaseOQL = str_replace(' WHERE 1', '', $oBaseSearch->ToOQL());
|
$sBaseOQL = str_replace(' WHERE 1', '', $oBaseSearch->ToOQL());
|
||||||
|
|
||||||
if (isset($aExtraParams['table_inner_id']))
|
|
||||||
{
|
|
||||||
$sDataConfigListSelector = $aExtraParams['table_inner_id'];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$sDataConfigListSelector = $aExtraParams['result_list_outer_selector'];
|
|
||||||
}
|
|
||||||
if (!isset($aExtraParams['table_inner_id']))
|
if (!isset($aExtraParams['table_inner_id']))
|
||||||
{
|
{
|
||||||
$aListParams['table_inner_id'] = "table_inner_id_{$sSearchFormId}";
|
$aListParams['table_inner_id'] = "table_inner_id_{$sSearchFormId}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($aExtraParams['result_list_outer_selector']))
|
||||||
|
{
|
||||||
|
$sDataConfigListSelector = $aExtraParams['result_list_outer_selector'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sDataConfigListSelector = $aExtraParams['table_inner_id'];
|
||||||
|
}
|
||||||
|
|
||||||
$sDebug = utils::ReadParam('debug', 'false', false, 'parameter');
|
$sDebug = utils::ReadParam('debug', 'false', false, 'parameter');
|
||||||
if ($sDebug == 'true')
|
if ($sDebug == 'true')
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user