<?php // Copyright (C) 2010-2012 Combodo SARL // // This file is part of iTop. // // iTop is free software; you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // iTop is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with iTop. If not, see <http://www.gnu.org/licenses/> MetaModel::RegisterRelation('impacts'); MetaModel::RegisterRelation('depends on'); // Starting with iTop 1.2 you can restrict the list of organizations displayed in the drop-down list // by specifying a query as shown below. Note that this is NOT a security settings, since the // choice 'All Organizations' will always be available in the menu ApplicationMenu::SetFavoriteSiloQuery('SELECT Organization');
if ($sPortalId === null) { return self::$aData; } if (!array_key_exists($sPortalId, self::$aData)) { return array(); } return self::$aData[$sPortalId]; } } /** * Modules parameters extracted from the XML definition at compile time */ class ModulesXMLParameters { protected static $aData = array('itop-tickets' => array('relation_context' => array('UserRequest' => array('impacts' => array('down' => array('items' => array(0 => array('oql' => 'SELECT FCI, C FROM FunctionalCI AS FCI JOIN lnkFunctionalCIToTicket AS L ON L.functionalci_id = FCI.id JOIN Change AS C ON L.ticket_id = C.id WHERE (C.outage = \'yes\') AND (C.status NOT IN (\'closed\', \'rejected\')) AND (L.impact_code != \'not_impacted\') AND (C.id != :this->id)', 'dict' => 'Tickets:Related:OpenChanges', 'icon' => 'itop-change-mgmt/images/change-ongoing.png', 'default' => 'yes'), 1 => array('oql' => 'SELECT FCI, C FROM FunctionalCI AS FCI JOIN lnkFunctionalCIToTicket AS L ON L.functionalci_id = FCI.id JOIN Change AS C ON L.ticket_id = C.id WHERE (C.outage = \'yes\') AND (C.status NOT IN (\'closed\')) AND (L.impact_code != \'not_impacted\') AND (C.id != :this->id) AND (DATE_ADD(C.end_date, INTERVAL 3 DAY) < NOW())', 'dict' => 'Tickets:Related:RecentChanges', 'icon' => 'itop-change-mgmt/images/change-done.png', 'default' => 'no'), 2 => array('oql' => 'SELECT FCI, R FROM FunctionalCI AS FCI JOIN lnkFunctionalCIToTicket AS L ON L.functionalci_id = FCI.id JOIN UserRequest AS R ON L.ticket_id = R.id WHERE (R.status NOT IN (\'closed\', \'resolved\')) AND (R.request_type=\'incident\') AND (L.impact_code != \'not_impacted\') AND (R.id != :this->id)', 'dict' => 'Tickets:Related:OpenIncidents', 'icon' => 'itop-request-mgmt/images/incident-red.png', 'default' => 'yes'))))), 'Incident' => array('impacts' => array('down' => array('items' => array(0 => array('oql' => 'SELECT FCI, C FROM FunctionalCI AS FCI JOIN lnkFunctionalCIToTicket AS L ON L.functionalci_id = FCI.id JOIN Change AS C ON L.ticket_id = C.id WHERE (C.outage = \'yes\') AND (C.status NOT IN (\'closed\', \'rejected\')) AND (L.impact_code != \'not_impacted\') AND (C.id != :this->id)', 'dict' => 'Tickets:Related:OpenChanges', 'icon' => 'itop-change-mgmt/images/change-ongoing.png', 'default' => 'yes'), 1 => array('oql' => 'SELECT FCI, C FROM FunctionalCI AS FCI JOIN lnkFunctionalCIToTicket AS L ON L.functionalci_id = FCI.id JOIN Change AS C ON L.ticket_id = C.id WHERE (C.outage = \'yes\') AND (C.status NOT IN (\'closed\')) AND (L.impact_code != \'not_impacted\') AND (C.id != :this->id) AND (DATE_ADD(C.end_date, INTERVAL 3 DAY) < NOW())', 'dict' => 'Tickets:Related:RecentChanges', 'icon' => 'itop-change-mgmt/images/change-done.png', 'default' => 'no'))))), 'Change' => array('impacts' => array('down' => array('items' => array(0 => array('oql' => 'SELECT FCI, C FROM FunctionalCI AS FCI JOIN lnkFunctionalCIToTicket AS L ON L.functionalci_id = FCI.id JOIN Change AS C ON L.ticket_id = C.id WHERE (C.outage = \'yes\') AND (C.status NOT IN (\'closed\', \'rejected\')) AND (L.impact_code != \'not_impacted\') AND (C.id != :this->id)', 'dict' => 'Tickets:Related:OpenChanges', 'icon' => 'itop-change-mgmt/images/change-ongoing.png', 'default' => 'yes'), 1 => array('oql' => 'SELECT FCI, C FROM FunctionalCI AS FCI JOIN lnkFunctionalCIToTicket AS L ON L.functionalci_id = FCI.id JOIN Change AS C ON L.ticket_id = C.id WHERE (C.outage = \'yes\') AND (C.status NOT IN (\'closed\')) AND (L.impact_code != \'not_impacted\') AND (C.id != :this->id) AND (DATE_ADD(C.end_date, INTERVAL 3 DAY) < NOW())', 'dict' => 'Tickets:Related:RecentChanges', 'icon' => 'itop-change-mgmt/images/change-done.png', 'default' => 'no'), 2 => array('oql' => 'SELECT FCI, R FROM FunctionalCI AS FCI JOIN lnkFunctionalCIToTicket AS L ON L.functionalci_id = FCI.id JOIN UserRequest AS R ON L.ticket_id = R.id WHERE (R.status NOT IN (\'closed\', \'resolved\')) AND (R.request_type=\'incident\') AND (L.impact_code != \'not_impacted\') AND (R.id != :this->id)', 'dict' => 'Tickets:Related:OpenIncidents', 'icon' => 'itop-request-mgmt/images/incident-red.png', 'default' => 'yes'))))))), 'itop-config-mgmt' => array('relation_context' => array('FunctionalCI' => array('impacts' => array('down' => array('items' => array(0 => array('oql' => 'SELECT FCI, C FROM FunctionalCI AS FCI JOIN lnkFunctionalCIToTicket AS L ON L.functionalci_id = FCI.id JOIN Change AS C ON L.ticket_id = C.id WHERE (C.outage = \'yes\') AND (C.status NOT IN (\'closed\', \'rejected\')) AND (L.impact_code != \'not_impacted\')', 'dict' => 'Tickets:Related:OpenChanges', 'icon' => 'itop-change-mgmt/images/change-ongoing.png', 'default' => 'yes'), 1 => array('oql' => 'SELECT FCI, C FROM FunctionalCI AS FCI JOIN lnkFunctionalCIToTicket AS L ON L.functionalci_id = FCI.id JOIN Change AS C ON L.ticket_id = C.id WHERE (C.outage = \'yes\') AND (C.status IN (\'closed\')) AND (L.impact_code != \'not_impacted\') AND (DATE_ADD(C.end_date, INTERVAL 3 DAY) < NOW())', 'dict' => 'Tickets:Related:RecentChanges', 'icon' => 'itop-change-mgmt/images/change-done.png', 'default' => 'no'), 2 => array('oql' => 'SELECT FCI, R FROM FunctionalCI AS FCI JOIN lnkFunctionalCIToTicket AS L ON L.functionalci_id = FCI.id JOIN UserRequest AS R ON L.ticket_id = R.id WHERE (R.status NOT IN (\'closed\', \'resolved\')) AND (R.request_type=\'incident\') AND (L.impact_code != \'not_impacted\')', 'dict' => 'Tickets:Related:OpenIncidents', 'icon' => 'itop-request-mgmt/images/incident-red.png', 'default' => 'yes'))), 'up' => array('items' => array(0 => array('oql' => 'SELECT FCI, C FROM FunctionalCI AS FCI JOIN lnkFunctionalCIToTicket AS L ON L.functionalci_id = FCI.id JOIN Change AS C ON L.ticket_id = C.id WHERE (C.outage = \'yes\') AND (C.status NOT IN (\'closed\', \'rejected\')) AND (L.impact_code != \'not_impacted\')', 'dict' => 'Tickets:Related:OpenChanges', 'icon' => 'itop-change-mgmt/images/change-ongoing.png', 'default' => 'yes'), 1 => array('oql' => 'SELECT FCI, C FROM FunctionalCI AS FCI JOIN lnkFunctionalCIToTicket AS L ON L.functionalci_id = FCI.id JOIN Change AS C ON L.ticket_id = C.id WHERE (C.outage = \'yes\') AND (C.status IN (\'closed\')) AND (L.impact_code != \'not_impacted\') AND (DATE_ADD(C.end_date, INTERVAL 3 DAY) < NOW())', 'dict' => 'Tickets:Related:RecentChanges', 'icon' => 'itop-change-mgmt/images/change-done.png', 'default' => 'no'), 2 => array('oql' => 'SELECT FCI, R FROM FunctionalCI AS FCI JOIN lnkFunctionalCIToTicket AS L ON L.functionalci_id = FCI.id JOIN UserRequest AS R ON L.ticket_id = R.id WHERE (R.status NOT IN (\'closed\', \'resolved\')) AND (R.request_type=\'incident\') AND (L.impact_code != \'not_impacted\')', 'dict' => 'Tickets:Related:OpenIncidents', 'icon' => 'itop-request-mgmt/images/incident-red.png', 'default' => 'yes')))))))); public static function GetData($sModuleId = null) { if ($sModuleId === null) { return self::$aData; } if (!array_key_exists($sModuleId, self::$aData)) { return array(); } return self::$aData[$sModuleId]; } } /** * Relations */ MetaModel::RegisterRelation('impacts');
<?php // Copyright (C) 2010-2012 Combodo SARL // // This file is part of iTop. // // iTop is free software; you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // iTop is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with iTop. If not, see <http://www.gnu.org/licenses/> MetaModel::RegisterRelation("impacts", array("description" => "Objects impacted by", "verb_down" => "impacts", "verb_up" => "depends on")); MetaModel::RegisterRelation("depends on", array("description" => "That impacts ", "verb_down" => "depends on", "verb_up" => "impacts")); // Starting with iTop 1.2 you can restrict the list of organizations displayed in the drop-down list // by specifying a query as shown below. Note that this is NOT a security settings, since the // choice 'All Organizations' will always be available in the menu ApplicationMenu::SetFavoriteSiloQuery('SELECT Organization');