public function output()
 {
     $aSteps = array();
     $iIndex = 0;
     foreach ($this->m_aSteps as $sStepTitle) {
         $iIndex++;
         $sStyle = $iIndex == $this->m_iCurrentStep ? 'wizActiveStep' : 'wizStep';
         $aSteps[] = "<div class=\"{$sStyle}\"><span>{$sStepTitle}</span></div>";
     }
     $sWizardHeader = "<div class=\"wizHeader\"><h1>" . htmlentities($this->s_title, ENT_QUOTES, 'UTF-8') . "</h1>\n" . implode("<div class=\"wizSeparator\"><img align=\"bottom\" src=\"../images/wizArrow.gif\"></div>", $aSteps) . "<br style=\"clear:both;\"/></div>\n";
     $this->s_content = "{$sWizardHeader}<div class=\"wizContainer\">" . $this->s_content . "</div>";
     parent::output();
 }
Ejemplo n.º 2
0
            $sMessage = Dict::Format('config-parse-error', $sMessage, $sLine);
            throw new Exception($sMessage);
        } else {
            // Note: sNoise is an html output, but so far it was ok for me (e.g. showing the entire call stack)
            throw new Exception('Syntax error in configuration file: <tt>' . $sNoise . '</tt>');
        }
    }
}
/////////////////////////////////////////////////////////////////////
// Main program
//
LoginWebPage::DoLogin(true);
// Check user rights and prompt if needed (must be admin)
//$sOperation = utils::ReadParam('operation', 'menu');
//$oAppContext = new ApplicationContext();
$oP = new iTopWebPage(Dict::S('config-edit-title'));
$oP->set_base(utils::GetAbsoluteUrlAppRoot() . 'pages/');
try {
    $sOperation = utils::ReadParam('operation', '');
    $oP->add("<h1>" . Dict::S('config-edit-title') . "</h1>");
    if (MetaModel::GetConfig()->Get('demo_mode')) {
        $oP->add("<div class=\"header_message message_info\">Sorry, iTop is in <b>demonstration mode</b>: the configuration file cannot be edited.</div>");
    } else {
        $oP->add_style(<<<EOF
textarea {
\t-webkit-box-sizing: border-box;
\t-moz-box-sizing: border-box;
\tbox-sizing: border-box;

\twidth: 100%;
\theight: 550px;
Ejemplo n.º 3
0
/**
 * Page to configuration the notifications (triggers and actions)
 *
 * @copyright   Copyright (C) 2013 Combodo SARL
 * @license     http://opensource.org/licenses/AGPL-3.0
 */
require_once '../approot.inc.php';
require_once APPROOT . '/application/application.inc.php';
require_once APPROOT . '/application/itopwebpage.class.inc.php';
require_once APPROOT . '/application/startup.inc.php';
require_once APPROOT . '/application/loginwebpage.class.inc.php';
LoginWebPage::DoLogin(true);
// Check user rights and prompt if needed (must be admin)
// Main program
//
$oP = new iTopWebPage(Dict::S('Menu:NotificationsMenu+'));
$oP->add('<div class="page_header" style="padding:0.5em;">');
$oP->add('<h1>' . dict::S('UI:NotificationsMenu:Title') . '</h1>');
$oP->add('</div>');
$oP->StartCollapsibleSection(Dict::S('UI:NotificationsMenu:Help'), true);
$oP->add('<div style="padding: 1em; font-size:10pt;background:#E8F3CF;margin-top: 0.25em;">');
$oP->add('<img src="../images/bell.png" style="margin-top: -60px; margin-right: 10px; float: right;">');
$oP->add(Dict::S('UI:NotificationsMenu:HelpContent'));
$oP->add('</div>');
$oP->add('');
$oP->add('');
$oP->EndCollapsibleSection();
$oP->add('<p>&nbsp;</p>');
$oP->AddTabContainer('Tabs_0');
$oP->SetCurrentTabContainer('Tabs_0');
$oP->SetCurrentTab(Dict::S('UI:NotificationsMenu:Triggers'));
Ejemplo n.º 4
0
try {
    require_once '../approot.inc.php';
    require_once APPROOT . '/application/application.inc.php';
    require_once APPROOT . '/application/itopwebpage.class.inc.php';
    require_once APPROOT . '/application/wizardhelper.class.inc.php';
    require_once APPROOT . '/application/startup.inc.php';
    $operation = utils::ReadParam('operation', '');
    $oKPI = new ExecutionKPI();
    $oKPI->ComputeAndReport('Data model loaded');
    $oKPI = new ExecutionKPI();
    require_once APPROOT . '/application/loginwebpage.class.inc.php';
    $sLoginMessage = LoginWebPage::DoLogin();
    // Check user rights and prompt if needed
    $oAppContext = new ApplicationContext();
    $oKPI->ComputeAndReport('User login');
    $oP = new iTopWebPage(Dict::S('UI:WelcomeToITop'));
    $oP->SetMessage($sLoginMessage);
    // All the following actions use advanced forms that require more javascript to be loaded
    switch ($operation) {
        case 'new':
            // Form to create a new object
        // Form to create a new object
        case 'modify':
            // Form to modify an object
        // Form to modify an object
        case 'apply_new':
            // Creation of a new object
        // Creation of a new object
        case 'apply_modify':
            // Applying the modifications to an existing object
        // Applying the modifications to an existing object
Ejemplo n.º 5
0
                }
            }
            $oPage->add("</ul>\n");
            $oPage->add("</li>\n");
        }
    }
    $oPage->add_ready_script('$("#RelationshipDetails").treeview();');
}
// Display the menu on the left
$oAppContext = new ApplicationContext();
$sContext = $oAppContext->GetForLink();
if (!empty($sContext)) {
    $sContext = '&' . $sContext;
}
$operation = utils::ReadParam('operation', '');
$oPage = new iTopWebPage(Dict::S('UI:Schema:Title'));
$oPage->no_cache();
$operation = utils::ReadParam('operation', '');
switch ($operation) {
    case 'details_class':
        $sClass = utils::ReadParam('class', 'logRealObject', false, 'class');
        DisplayClassDetails($oPage, $sClass, $sContext);
        break;
    case 'details_relation':
        $sRelCode = utils::ReadParam('relcode', '');
        DisplayRelationDetails($oPage, $sRelCode, $sContext);
        break;
    case 'list':
    default:
        DisplayClassesList($oPage, $sContext);
}
Ejemplo n.º 6
0
/**
 * Analytical search
 *
 * @copyright   Copyright (C) 2010-2012 Combodo SARL
 * @license     http://opensource.org/licenses/AGPL-3.0
 */
require_once '../approot.inc.php';
require_once APPROOT . '/application/application.inc.php';
require_once APPROOT . '/application/itopwebpage.class.inc.php';
require_once APPROOT . '/application/applicationcontext.class.inc.php';
require_once APPROOT . '/application/startup.inc.php';
require_once APPROOT . '/application/loginwebpage.class.inc.php';
LoginWebPage::DoLogin(true);
// Check user rights and prompt if needed (must be admin)
$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 ??
// Now render the content of the page
$sBaseClass = utils::ReadParam('baseClass', 'Organization', false, 'class');
$sClass = utils::ReadParam('class', $sBaseClass, false, 'class');
$sOQLClause = utils::ReadParam('oql_clause', '', false, 'raw_data');
$sFilter = utils::ReadParam('filter', '', false, 'raw_data');
$sOperation = utils::ReadParam('operation', '');
// First part: select the class to search for
Ejemplo n.º 7
0
//
//   You should have received a copy of the GNU Affero General Public License
//   along with iTop. If not, see <http://www.gnu.org/licenses/>
/**
 * Display the Flash navigator, in the whole pane
 */
require_once '../approot.inc.php';
require_once APPROOT . '/application/application.inc.php';
require_once APPROOT . '/application/itopwebpage.class.inc.php';
require_once APPROOT . '/application/startup.inc.php';
require_once APPROOT . '/application/loginwebpage.class.inc.php';
LoginWebPage::DoLogin();
// Check user rights and prompt if needed
$sOperation = utils::ReadParam('operation', 'menu');
$oAppContext = new ApplicationContext();
$oP = new iTopWebPage("iTop - Navigator");
// Main program
$sClass = utils::ReadParam('class', '');
$id = utils::ReadParam('id', 0);
$sRelation = utils::ReadParam('relation', 'neighbours');
try {
    $width = 1000;
    $height = 700;
    $sDrillUrl = urlencode(utils::GetAbsoluteUrlAppRoot() . 'pages/UI.php?operation=details');
    //	$sParams = "pWidth=$width&pHeight=$height&drillUrl=".urlencode('../pages/UI.php?operation=details')."&displayController=false&xmlUrl=".urlencode("./xml.navigator.php")."&obj_class=$sClass&obj_id=$id&relation=$sRelation";
    //	$oP->add("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"$width\" height=\"$height\" id=\"navigator\" align=\"middle\">
    //	<param name=\"allowScriptAccess\" value=\"sameDomain\" />
    //	<param name=\"allowFullScreen\" value=\"false\" />
    //	<param name=\"FlashVars\" value=\"$sParams\" />
    //	<param name=\"movie\" value=\"../images/navigator.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#ffffff\" />
    //	<embed src=\"../images/navigator.swf\" flashVars=\"$sParams\" quality=\"high\" bgcolor=\"#ffffff\" width=\"$width\" height=\"$height\" name=\"navigator\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.adobe.com/go/getflashplayer\" />
Ejemplo n.º 8
0
}
if (!defined('APPROOT')) {
    require_once __DIR__ . '/../../approot.inc.php';
}
require_once APPROOT . 'application/application.inc.php';
require_once APPROOT . 'application/itopwebpage.class.inc.php';
require_once APPROOT . 'application/startup.inc.php';
require_once APPROOT . 'application/loginwebpage.class.inc.php';
/////////////////////////////////////////////////////////////////////
// Main program
//
LoginWebPage::DoLogin(true);
// Check user rights and prompt if needed (must be admin)
//$sOperation = utils::ReadParam('operation', 'menu');
//$oAppContext = new ApplicationContext();
$oP = new iTopWebPage(Dict::S('bkp-status-title'));
$oP->set_base(utils::GetAbsoluteUrlAppRoot() . 'pages/');
try {
    $oP->add("<h1>" . Dict::S('bkp-status-title') . "</h1>");
    if (MetaModel::GetConfig()->Get('demo_mode')) {
        $oP->add("<div class=\"header_message message_info\">iTop is in <b>demonstration mode</b>: the feature is disabled.</div>");
    }
    $sImgOk = '<img src="../images/validation_ok.png"> ';
    $sImgError = '<img src="../images/validation_error.png"> ';
    $oP->add("<fieldset>");
    $oP->add("<legend>" . Dict::S('bkp-status-checks') . "</legend>");
    // Availability of mysqldump
    //
    $sMySQLBinDir = MetaModel::GetConfig()->GetModuleSetting('itop-backup', 'mysql_bindir', '');
    $sMySQLBinDir = utils::ReadParam('mysql_bindir', $sMySQLBinDir, true);
    if (empty($sMySQLBinDir)) {
Ejemplo n.º 9
0
 /**
  * Display the details of an import
  */
 static function DisplayImportHistoryDetails(iTopWebPage $oPage, $iChange)
 {
     if ($iChange == 0) {
         throw new Exception("Missing parameter changeid");
     }
     $oChange = MetaModel::GetObject('CMDBChange', $iChange, false);
     if (is_null($oChange)) {
         throw new Exception("Unknown change: {$iChange}");
     }
     $oPage->add("<div><p><h1>" . Dict::Format('UI:History:BulkImportDetails', $oChange->Get('date'), $oChange->GetUserName()) . "</h1></p></div>\n");
     // Assumption : change made one single class of objects
     $aObjects = array();
     $aAttributes = array();
     // array of attcode => occurences
     $oOpSearch = DBObjectSearch::FromOQL("SELECT CMDBChangeOp WHERE change = :change_id");
     $oOpSet = new DBObjectSet($oOpSearch, array(), array('change_id' => $iChange));
     while ($oOperation = $oOpSet->Fetch()) {
         $sClass = $oOperation->Get('objclass');
         $iKey = $oOperation->Get('objkey');
         $iObjId = "{$sClass}::{$iKey}";
         if (!isset($aObjects[$iObjId])) {
             $aObjects[$iObjId] = array();
             $aObjects[$iObjId]['__class__'] = $sClass;
             $aObjects[$iObjId]['__id__'] = $iKey;
         }
         if (get_class($oOperation) == 'CMDBChangeOpCreate') {
             $aObjects[$iObjId]['__created__'] = true;
         } elseif ($oOperation instanceof CMDBChangeOpSetAttribute) {
             $sAttCode = $oOperation->Get('attcode');
             if (get_class($oOperation) == 'CMDBChangeOpSetAttributeScalar') {
                 $oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
                 if ($oAttDef->IsExternalKey()) {
                     $sOldValue = Dict::S('UI:UndefinedObject');
                     if ($oOperation->Get('oldvalue') != 0) {
                         $oOldTarget = MetaModel::GetObject($oAttDef->GetTargetClass(), $oOperation->Get('oldvalue'));
                         $sOldValue = $oOldTarget->GetHyperlink();
                     }
                     $sNewValue = Dict::S('UI:UndefinedObject');
                     if ($oOperation->Get('newvalue') != 0) {
                         $oNewTarget = MetaModel::GetObject($oAttDef->GetTargetClass(), $oOperation->Get('newvalue'));
                         $sNewValue = $oNewTarget->GetHyperlink();
                     }
                 } else {
                     $sOldValue = $oOperation->GetAsHTML('oldvalue');
                     $sNewValue = $oOperation->GetAsHTML('newvalue');
                 }
                 $aObjects[$iObjId][$sAttCode] = $sOldValue . ' -&gt; ' . $sNewValue;
             } else {
                 $aObjects[$iObjId][$sAttCode] = 'n/a';
             }
             if (isset($aAttributes[$sAttCode])) {
                 $aAttributes[$sAttCode]++;
             } else {
                 $aAttributes[$sAttCode] = 1;
             }
         }
     }
     $aDetails = array();
     foreach ($aObjects as $iUId => $aObjData) {
         $aRow = array();
         $oObject = MetaModel::GetObject($aObjData['__class__'], $aObjData['__id__'], false);
         if (is_null($oObject)) {
             $aRow['object'] = $aObjData['__class__'] . '::' . $aObjData['__id__'] . ' (deleted)';
         } else {
             $aRow['object'] = $oObject->GetHyperlink();
         }
         if (isset($aObjData['__created__'])) {
             $aRow['operation'] = Dict::S('Change:ObjectCreated');
         } else {
             $aRow['operation'] = Dict::S('Change:ObjectModified');
         }
         foreach ($aAttributes as $sAttCode => $iOccurences) {
             if (isset($aObjData[$sAttCode])) {
                 $aRow[$sAttCode] = $aObjData[$sAttCode];
             } elseif (!is_null($oObject)) {
                 // This is the current vaslue: $oObject->GetAsHtml($sAttCode)
                 // whereas we are displaying the value that was set at the time
                 // the object was created
                 // This requires addtional coding...let's do that later
                 $aRow[$sAttCode] = '';
             } else {
                 $aRow[$sAttCode] = '';
             }
         }
         $aDetails[] = $aRow;
     }
     $aConfig = array();
     $aConfig['object'] = array('label' => MetaModel::GetName($sClass), 'description' => MetaModel::GetClassDescription($sClass));
     $aConfig['operation'] = array('label' => Dict::S('UI:History:Changes'), 'description' => Dict::S('UI:History:Changes+'));
     foreach ($aAttributes as $sAttCode => $iOccurences) {
         $aConfig[$sAttCode] = array('label' => MetaModel::GetLabel($sClass, $sAttCode), 'description' => MetaModel::GetDescription($sClass, $sAttCode));
     }
     $oPage->table($aConfig, $aDetails);
 }