mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
- Make sure that the search form preserves it's "action" (i.e. target page) when reloading (when specifying a derived class). This was breaking the UniversalSearch page.
- Prepare for the style cleanup - Don't display the menu to create a new 'Email Notification" when listing the notifications sent on a ticket (in the Notifications tab) ! SVN:trunk[1182]
This commit is contained in:
@@ -319,7 +319,7 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
|
||||
// Display notifications regarding the object
|
||||
$iId = $this->GetKey();
|
||||
$oBlock = new DisplayBlock(DBObjectSearch::FromOQL("SELECT EventNotificationEmail AS Ev JOIN TriggerOnObject AS T ON Ev.trigger_id = T.id WHERE T.target_class IN ('$sClassList') AND Ev.object_id = $iId"), 'list', false);
|
||||
$oBlock->Display($oPage, 'notifications', array());
|
||||
$oBlock->Display($oPage, 'notifications', array('menu' => false));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1076,7 +1076,8 @@ EOF
|
||||
$sClassesCombo = MetaModel::GetName($sClassName);
|
||||
}
|
||||
$oUnlimitedFilter = new DBObjectSearch($sClassName);
|
||||
$sHtml .= "<form id=\"fs_{$sSearchFormId}\" action=\"../pages/UI.php\">\n"; // Don't use $_SERVER['SCRIPT_NAME'] since the form may be called asynchronously (from ajax.php)
|
||||
$sAction = (isset($aExtraParams['action'])) ? $aExtraParams['action'] : '../pages/UI.php';
|
||||
$sHtml .= "<form id=\"fs_{$sSearchFormId}\" action=\"{$sAction}\">\n"; // Don't use $_SERVER['SCRIPT_NAME'] since the form may be called asynchronously (from ajax.php)
|
||||
$sHtml .= "<h2>".Dict::Format('UI:SearchFor_Class_Objects', $sClassesCombo)."</h2>\n";
|
||||
$index = 0;
|
||||
$sHtml .= "<p>\n";
|
||||
@@ -1281,9 +1282,10 @@ EOF
|
||||
$aEventsList[] ='validate';
|
||||
$aEventsList[] ='keyup';
|
||||
$aEventsList[] ='change';
|
||||
$sHeader = '<div class="caselog_input_header"> '.Dict::S('UI:CaseLogTypeYourTextHere').'</div>';
|
||||
$sEditValue = $oAttDef->GetEditValue($value);
|
||||
$sPreviousLog = $oAttDef->GetAsHTML($value);
|
||||
$sHTMLValue = "<div style=\"overflow:auto;border:1px #999 solid; background:#fff;\"><table style=\"width:100%\"><tr><td><textarea class=\"resizable\" style=\"border:0;width:100%\" title=\"$sHelpText\" name=\"attr_{$sFieldPrefix}{$sAttCode}{$sNameSuffix}\" rows=\"8\" cols=\"40\" id=\"$iId\">$sEditValue</textarea>$sPreviousLog</td><td>{$sValidationField}</td></tr></table></div>";
|
||||
$sHTMLValue = "<div style=\"overflow:auto;border:1px #999 solid; background:#fff;\"><table style=\"width:100%\"><tr><td>$sHeader<textarea class=\"resizable\" style=\"border:0;width:100%\" title=\"$sHelpText\" name=\"attr_{$sFieldPrefix}{$sAttCode}{$sNameSuffix}\" rows=\"8\" cols=\"40\" id=\"$iId\">$sEditValue</textarea>$sPreviousLog</td><td>{$sValidationField}</td></tr></table></div>";
|
||||
break;
|
||||
|
||||
case 'HTML':
|
||||
|
||||
@@ -135,9 +135,10 @@ function ReloadSearchForm(divId, sClassName, sBaseClass, sContext)
|
||||
aSubmit [index ] = { data:oFormEvents.submit[index].data, namespace:oFormEvents.submit[index].namespace, handler: oFormEvents.submit[index].handler};
|
||||
}
|
||||
}
|
||||
sAction = $('#ds_'+divId+' form').attr('action');
|
||||
|
||||
$.post('../pages/ajax.render.php?'+sContext,
|
||||
{ operation: 'search_form', className: sClassName, baseClass: sBaseClass, currentId: divId },
|
||||
{ operation: 'search_form', className: sClassName, baseClass: sBaseClass, currentId: divId, action: sAction },
|
||||
function(data) {
|
||||
oDiv.empty();
|
||||
oDiv.append(data);
|
||||
|
||||
@@ -36,6 +36,13 @@ LoginWebPage::DoLogin(true); // Check user rights and prompt if needed (must be
|
||||
$oAppContext = new ApplicationContext();
|
||||
|
||||
$oP = new iTopWebPage(Dict::S('UI:UniversalSearchTitle'));
|
||||
$oP->add_linked_script("../js/json.js");
|
||||
$oP->add_linked_script("../js/forms-json-utils.js");
|
||||
$oP->add_linked_script("../js/wizardhelper.js");
|
||||
$oP->add_linked_script("../js/wizard.utils.js");
|
||||
$oP->add_linked_script("../js/linkswidget.js");
|
||||
$oP->add_linked_script("../js/extkeywidget.js");
|
||||
$oP->add_linked_script("../js/jquery.blockUI.js");
|
||||
|
||||
// From now on the context is limited to the the selected organization ??
|
||||
|
||||
@@ -98,6 +105,7 @@ if ($oFilter != null)
|
||||
$aExtraParams = $oAppContext->GetAsHash();
|
||||
$aExtraParams['open'] = true;
|
||||
$aExtraParams['baseClass'] = $sBaseClass;
|
||||
$aExtraParams['action'] = '../pages/UniversalSearch.php';
|
||||
//$aExtraParams['class'] = $sClassName;
|
||||
$oBlock->Display($oP, 0, $aExtraParams);
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ try
|
||||
{
|
||||
// Search form: no current object
|
||||
$oObj = null;
|
||||
$currentValue = 'eviV bulgroZ';
|
||||
$currentValue = '';
|
||||
}
|
||||
$aAllowedValues = MetaModel::GetAllowedValues_att($sClass, $sAttCode, array('this' => $oObj));
|
||||
$oWidget = new UIExtKeyWidget($sAttCode, $sClass, '', $aAllowedValues, $currentValue, $iInputId, false, $sSuffix, '');
|
||||
@@ -364,9 +364,10 @@ try
|
||||
$sClass = utils::ReadParam('className', '');
|
||||
$sRootClass = utils::ReadParam('baseClass', '');
|
||||
$currentId = utils::ReadParam('currentId', '');
|
||||
$sAction = utils::ReadParam('action', '');
|
||||
$oFilter = new DBObjectSearch($sClass);
|
||||
$oSet = new CMDBObjectSet($oFilter);
|
||||
$sHtml = cmdbAbstractObject::GetSearchForm($oPage, $oSet, array('currentId' => $currentId, 'baseClass' => $sRootClass));
|
||||
$sHtml = cmdbAbstractObject::GetSearchForm($oPage, $oSet, array('currentId' => $currentId, 'baseClass' => $sRootClass, 'action' => $sAction));
|
||||
$oPage->add($sHtml);
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user