diff --git a/pages/advanced_search.php b/pages/advanced_search.php deleted file mode 100644 index cb2a4ec6b0..0000000000 --- a/pages/advanced_search.php +++ /dev/null @@ -1,310 +0,0 @@ -no_cache(); - - -MetaModel::CheckDefinitions(); -// new API - MetaModel::DBCheckFormat(); -// not necessary, and time consuming! -// MetaModel::DBCheckIntegrity(); - - -function ReadParam($sName, $defaultValue = "") -{ - return isset($_REQUEST[$sName]) ? $_REQUEST[$sName] : $defaultValue; -} - - - -function Page1_AskClass($oPage) -{ - $oPage->add("
\n"); -} - - -function Page2_ConfigFilters($oPage, $oFilter) -{ - $sClass = $oFilter->GetClass(); - - $oPage->p("Objects of class $sClass"); - $oPage->add("\n"); -} - -function MakeFilterFromArgs() -{ - $sClass = ReadParam("class"); - $sFilterFullText = ReadParam("flt_fulltext", ""); - $aFilterOps = ReadParam("flt_ops", array()); - $aFilterValues = ReadParam("flt_values", array()); - $aPointTo = ReadParam("flt_pointto", array()); - $aRefedBy = ReadParam("flt_refedby", array()); - $aLinkedWith = ReadParam("flt_linkedwith", array()); - - $oFilter = new CMDBSearchFilter($sClass); - - if (!empty($sFilterFullText)) - { - $oFilter->AddCondition_FullText($sFilterFullText); - } - - foreach($aFilterOps as $sFltCode=>$sOpCode) - { - if ($sOpCode == "__none__") continue; - $oFilter->AddCondition($sFltCode, $aFilterValues[$sFltCode], $sOpCode); - } - - foreach($aPointTo as $sExtKeyAttCode=>$sFilterShortcut) - { - $oSubFilter = CMDBSearchFilter::unserialize($sFilterShortcut); - $oFilter->AddCondition_PointingTo($oSubFilter, $sExtKeyAttCode); - } - - foreach($aRefedBy as $sForeignClass=>$aExtKeys) - { - foreach($aExtKeys as $sForeignExtKey=>$sFilterShortcut) - { - //MyHelpers::var_dump_html("$sForeignClass / $sForeignExtKey / $sFilterShortcut"); - $oSubFilter = CMDBSearchFilter::unserialize($sFilterShortcut); - //MyHelpers::var_dump_html($oSubFilter); - $oFilter->AddCondition_ReferencedBy($oSubFilter, $sForeignExtKey); - } - } - -// $oFilter->AddCondition_LinkedTo(DBObjectSearch $oLinkFilter, $sExtKeyAttCodeToMe, $sExtKeyAttCodeTarget, DBObjectSearch $oFilterTarget); - - return $oFilter; -} - -function Page3_ViewResults($oPage, $oFilter) -{ - // Output results in various forms... - // - if ($oFilter->IsAny()) - { - $oPage->p("You are considering the ENTIRE set of objects..."); - } - else - { - $oPage->p($oFilter->__DescribeHTML()); - - $oSet = new CMDBObjectSet($oFilter); - $oPage->p("Found ".$oSet->Count()." items"); - - $sFilterPhrase = urlencode($oFilter->serialize()); - $oPage->p("See detailed results"); - } -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// -// M a i n P r o g r a m -// -/////////////////////////////////////////////////////////////////////////////////////////////////// - - -$oPage->p("Applying the package '.$sPackageName.'
'); - if($oArchive->ImportSQL($sPackageName)) - { - $oP->p('Done.'); - } - else - { - $oP->p('Sorry, an error occured while applying the package...'); - } - $oP->p('Apply another package from the same archive'); - $oP->p('Select another archive'); - $oP->p('Back to the menu'); - break; - - case 'menu': - default: - $oP->add('Database backup & restore
'); - $oP->add('Select one of the actions below:
'); - $oP->add(''); - $oP->add(''); -} - -$oP->output(); -?>