Ejemplo n.º 1
0
 $oSet->OptimizeColumnLoad($aAliasToFields);
 switch ($sFormat) {
     case 'html':
         $oP = new NiceWebPage("iTop - Export");
         $oP->add_style('body { overflow: auto; }');
         // Show scroll bars if needed
         // Integration within MS-Excel web queries + HTTPS + IIS:
         // MS-IIS set these header values with no-cache... while Excel fails to do the job if using HTTPS
         // Then the fix is to force the reset of header values Pragma and Cache-control
         header("Pragma:", true);
         header("Cache-control:", true);
         // The HTML output is made for pages located in the /pages/ folder
         // since this page is in a different folder, let's adjust the HTML 'base' attribute
         // to make the relative hyperlinks in the page work
         $sUrl = utils::GetAbsoluteUrlAppRoot();
         $oP->set_base($sUrl . 'pages/');
         if (count($aFields) > 0) {
             $iSearch = array_search('id', $aFields);
             if ($iSearch !== false) {
                 $bViewLink = true;
                 unset($aFields[$iSearch]);
             } else {
                 $bViewLink = false;
             }
             $sFields = implode(',', $aFields);
             $aExtraParams = array('menu' => false, 'toolkit_menu' => false, 'display_limit' => false, 'localize_values' => $bLocalize, 'zlist' => false, 'extra_fields' => $sFields, 'view_link' => $bViewLink);
         } else {
             $aExtraParams = array('menu' => false, 'toolkit_menu' => false, 'display_limit' => false, 'localize_values' => $bLocalize, 'zlist' => 'details');
         }
         $oResultBlock = new DisplayBlock($oFilter, 'list', false, $aExtraParams);
         $oResultBlock->Display($oP, 'expresult');