mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-17 06:18:44 +02:00
Compiler: added "constants"
SVN:trunk[2955]
This commit is contained in:
@@ -1,5 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
|
||||
<constants>
|
||||
<constant id="PORTAL_POWER_USER_PROFILE" xsi:type="string" _delta="define"><![CDATA[Portal power user]]></constant>
|
||||
<constant id="PORTAL_SERVICECATEGORY_QUERY" xsi:type="string" _delta="define"><![CDATA[SELECT Service AS s JOIN SLA AS sla ON sla.service_id=s.id JOIN lnkContractToSLA AS ln ON ln.sla_id=sla.id JOIN CustomerContract AS cc ON ln.contract_id=cc.id WHERE cc.org_id = :org_id]]></constant>
|
||||
<constant id="PORTAL_SERVICE_SUBCATEGORY_QUERY" xsi:type="string" _delta="define"><![CDATA[SELECT ServiceSubcategory WHERE service_id = :svc_id]]></constant>
|
||||
<constant id="PORTAL_VALIDATE_SERVICECATEGORY_QUERY" xsi:type="string" _delta="define"><![CDATA[SELECT Service AS s JOIN SLA AS sla ON sla.service_id=s.id JOIN lnkContractToSLA AS ln ON ln.sla_id=sla.id JOIN CustomerContract AS cc ON ln.contract_id=cc.id WHERE cc.org_id = :org_id AND s.id = :id]]></constant>
|
||||
<constant id="PORTAL_VALIDATE_SERVICESUBCATEGORY_QUERY" xsi:type="string" _delta="define"><![CDATA[SELECT ServiceSubcategory AS Sub JOIN Service AS Svc ON Sub.service_id = Svc.id WHERE Sub.id=:id]]></constant>
|
||||
<constant id="PORTAL_ALL_PARAMS" xsi:type="string" _delta="define"><![CDATA[from_service_id,org_id,caller_id,service_id,servicesubcategory_id,title,description,impact,urgency,workgroup_id,moreinfo,caller_id,start_date,end_date,duration,impact_duration]]></constant>
|
||||
<constant id="PORTAL_ATTCODE_LOG" xsi:type="string" _delta="define"><![CDATA[ticket_log]]></constant>
|
||||
<constant id="PORTAL_ATTCODE_COMMENT" xsi:type="string" _delta="define"><![CDATA[user_commment]]></constant>
|
||||
<constant id="PORTAL_REQUEST_FORM_ATTRIBUTES" xsi:type="string" _delta="define"><![CDATA[title,description,impact,urgency,workgroup_id,ticket_log]]></constant>
|
||||
<constant id="PORTAL_ATTCODE_TYPE" xsi:type="string" _delta="define"><![CDATA[]]></constant>
|
||||
<constant id="PORTAL_SET_TYPE_FROM" xsi:type="string" _delta="define"><![CDATA[]]></constant>
|
||||
<constant id="PORTAL_TICKETS_LIST_ZLIST" xsi:type="string" _delta="define"><![CDATA[finalclass,title,start_date,status,servicesubcategory_id,priority,caller_id]]></constant>
|
||||
<constant id="PORTAL_TICKETS_SEARCH_CRITERIA" xsi:type="string" _delta="define"><![CDATA[ref,start_date,close_date,service_id,caller_id]]></constant>
|
||||
<constant id="PORTAL_TICKETS_CLOSED_ZLIST" xsi:type="string" _delta="define"><![CDATA[title,start_date,close_date,servicesubcategory_id]]></constant>
|
||||
<constant id="PORTAL_TICKET_DETAILS_ZLIST" xsi:type="string" _delta="define"><![CDATA[{"col:left":["ref","caller_id","servicesubcategory_id","title","description","solution"],"col:right":["status","priority","start_date","resolution_date","last_update","agent_id"]}]]></constant>
|
||||
</constants>
|
||||
<classes>
|
||||
<class id="UserRequest" _delta="define">
|
||||
<parent>ResponseTicket</parent>
|
||||
|
||||
@@ -1,43 +1 @@
|
||||
<?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/>
|
||||
|
||||
define('PORTAL_POWER_USER_PROFILE', 'Portal power user');
|
||||
|
||||
define('PORTAL_SERVICECATEGORY_QUERY', 'SELECT Service AS s JOIN SLA AS sla ON sla.service_id=s.id JOIN lnkContractToSLA AS ln ON ln.sla_id=sla.id JOIN CustomerContract AS cc ON ln.contract_id=cc.id WHERE cc.org_id = :org_id');
|
||||
define('PORTAL_SERVICE_SUBCATEGORY_QUERY', 'SELECT ServiceSubcategory WHERE service_id = :svc_id');
|
||||
|
||||
define('PORTAL_VALIDATE_SERVICECATEGORY_QUERY', 'SELECT Service AS s JOIN SLA AS sla ON sla.service_id=s.id JOIN lnkContractToSLA AS ln ON ln.sla_id=sla.id JOIN CustomerContract AS cc ON ln.contract_id=cc.id WHERE cc.org_id = :org_id AND s.id = :id');
|
||||
define('PORTAL_VALIDATE_SERVICESUBCATEGORY_QUERY', 'SELECT ServiceSubcategory AS Sub JOIN Service AS Svc ON Sub.service_id = Svc.id WHERE Sub.id=:id');
|
||||
|
||||
define('PORTAL_ALL_PARAMS', 'from_service_id,org_id,caller_id,service_id,servicesubcategory_id,title,description,impact,urgency,workgroup_id,moreinfo,caller_id,start_date,end_date,duration,impact_duration');
|
||||
|
||||
define('PORTAL_ATTCODE_LOG', 'ticket_log');
|
||||
define('PORTAL_ATTCODE_COMMENT', 'user_commment');
|
||||
define('PORTAL_REQUEST_FORM_ATTRIBUTES', 'title,description,impact,urgency,workgroup_id,ticket_log');
|
||||
|
||||
define('PORTAL_ATTCODE_TYPE', ''); // optional if the type has to be set
|
||||
define('PORTAL_SET_TYPE_FROM', ''); // The attribute to get the type from (Subcategory)
|
||||
|
||||
define('PORTAL_TICKETS_LIST_ZLIST', 'finalclass,title,start_date,status,servicesubcategory_id,priority,caller_id');
|
||||
define('PORTAL_TICKETS_SEARCH_CRITERIA','ref,start_date,close_date,service_id,caller_id');
|
||||
define('PORTAL_TICKETS_CLOSED_ZLIST', 'title,start_date,close_date,servicesubcategory_id');
|
||||
// json encoded lists for the portal...
|
||||
define('PORTAL_TICKET_DETAILS_ZLIST', '{"col:left":["ref","caller_id","servicesubcategory_id","title","description","solution"],"col:right":["status","priority","start_date","resolution_date","last_update","agent_id"]}');
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,5 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
|
||||
<constants>
|
||||
<constant id="PORTAL_POWER_USER_PROFILE" xsi:type="string" _delta="define"><![CDATA[Portal power user]]></constant>
|
||||
<constant id="PORTAL_SERVICECATEGORY_QUERY" xsi:type="string" _delta="define"><![CDATA[SELECT Service AS s JOIN lnkCustomerContractToService AS l1 ON l1.service_id=s.id JOIN CustomerContract AS cc ON l1.customercontract_id=cc.id WHERE cc.org_id = :org_id AND s.status != 'obsolete']]></constant>
|
||||
<constant id="PORTAL_SERVICE_SUBCATEGORY_QUERY" xsi:type="string" _delta="define"><![CDATA[SELECT ServiceSubcategory WHERE service_id = :svc_id AND request_type="service_request" AND ServiceSubcategory.status != "obsolete"]]></constant>
|
||||
<constant id="PORTAL_VALIDATE_SERVICECATEGORY_QUERY" xsi:type="string" _delta="define"><![CDATA[SELECT Service AS s JOIN lnkCustomerContractToService AS l1 ON l1.service_id=s.id JOIN CustomerContract AS cc ON l1.customercontract_id=cc.id WHERE cc.org_id = :org_id AND s.id = :id AND s.status != 'obsolete']]></constant>
|
||||
<constant id="PORTAL_VALIDATE_SERVICESUBCATEGORY_QUERY" xsi:type="string" _delta="define"><![CDATA[SELECT ServiceSubcategory AS Sub JOIN Service AS Svc ON Sub.service_id = Svc.id WHERE Sub.id=:id AND Sub.status != 'obsolete']]></constant>
|
||||
<constant id="PORTAL_ALL_PARAMS" xsi:type="string" _delta="define"><![CDATA[from_service_id,org_id,caller_id,service_id,servicesubcategory_id,title,description,impact,emergency,moreinfo,caller_id,start_date,end_date,duration,impact_duration]]></constant>
|
||||
<constant id="PORTAL_ATTCODE_LOG" xsi:type="string" _delta="define"><![CDATA[public_log]]></constant>
|
||||
<constant id="PORTAL_ATTCODE_COMMENT" xsi:type="string" _delta="define"><![CDATA[user_comment]]></constant>
|
||||
<constant id="PORTAL_REQUEST_FORM_ATTRIBUTES" xsi:type="string" _delta="define"><![CDATA[title,description,impact,urgency]]></constant>
|
||||
<constant id="PORTAL_ATTCODE_TYPE" xsi:type="string" _delta="define"><![CDATA[]]></constant>
|
||||
<constant id="PORTAL_SET_TYPE_FROM" xsi:type="string" _delta="define"><![CDATA[]]></constant>
|
||||
<constant id="PORTAL_TICKETS_LIST_ZLIST" xsi:type="string" _delta="define"><![CDATA[finalclass,title,start_date,status,servicesubcategory_id,priority,caller_id]]></constant>
|
||||
<constant id="PORTAL_TICKETS_SEARCH_CRITERIA" xsi:type="string" _delta="define"><![CDATA[ref,start_date,close_date,service_id,caller_id]]></constant>
|
||||
<constant id="PORTAL_TICKETS_CLOSED_ZLIST" xsi:type="string" _delta="define"><![CDATA[title,start_date,close_date,servicesubcategory_id]]></constant>
|
||||
<constant id="PORTAL_TICKET_DETAILS_ZLIST" xsi:type="string" _delta="define"><![CDATA[{"col:left":["ref","caller_id","servicesubcategory_id","title","description","solution"],"col:right":["status","priority","start_date","resolution_date","last_update","agent_id"]}]]></constant>
|
||||
</constants>
|
||||
<classes>
|
||||
<class id="UserRequest" _delta="define">
|
||||
<parent>Ticket</parent>
|
||||
|
||||
@@ -1,41 +1 @@
|
||||
<?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/>
|
||||
|
||||
define('PORTAL_POWER_USER_PROFILE', 'Portal power user');
|
||||
|
||||
define('PORTAL_SERVICECATEGORY_QUERY', "SELECT Service AS s JOIN lnkCustomerContractToService AS l1 ON l1.service_id=s.id JOIN CustomerContract AS cc ON l1.customercontract_id=cc.id WHERE cc.org_id = :org_id AND s.status != 'obsolete'");
|
||||
define('PORTAL_SERVICE_SUBCATEGORY_QUERY', 'SELECT ServiceSubcategory WHERE service_id = :svc_id AND request_type="service_request" AND ServiceSubcategory.status != "obsolete"');
|
||||
|
||||
define('PORTAL_VALIDATE_SERVICECATEGORY_QUERY', "SELECT Service AS s JOIN lnkCustomerContractToService AS l1 ON l1.service_id=s.id JOIN CustomerContract AS cc ON l1.customercontract_id=cc.id WHERE cc.org_id = :org_id AND s.id = :id AND s.status != 'obsolete'");
|
||||
define('PORTAL_VALIDATE_SERVICESUBCATEGORY_QUERY', "SELECT ServiceSubcategory AS Sub JOIN Service AS Svc ON Sub.service_id = Svc.id WHERE Sub.id=:id AND Sub.status != 'obsolete'");
|
||||
|
||||
define('PORTAL_ALL_PARAMS', 'from_service_id,org_id,caller_id,service_id,servicesubcategory_id,title,description,impact,emergency,moreinfo,caller_id,start_date,end_date,duration,impact_duration');
|
||||
|
||||
define('PORTAL_ATTCODE_LOG', 'public_log');
|
||||
define('PORTAL_ATTCODE_COMMENT', 'user_comment');
|
||||
define('PORTAL_REQUEST_FORM_ATTRIBUTES', 'title,description,impact,urgency');
|
||||
|
||||
define('PORTAL_ATTCODE_TYPE', ''); // optional if the type has to be set
|
||||
define('PORTAL_SET_TYPE_FROM', ''); // The attribute to get the type from (Subcategory)
|
||||
|
||||
define('PORTAL_TICKETS_LIST_ZLIST', 'finalclass,title,start_date,status,servicesubcategory_id,priority,caller_id');
|
||||
define('PORTAL_TICKETS_SEARCH_CRITERIA','ref,start_date,close_date,service_id,caller_id');
|
||||
define('PORTAL_TICKETS_CLOSED_ZLIST', 'title,start_date,close_date,servicesubcategory_id');
|
||||
// json encoded lists for the portal...
|
||||
define('PORTAL_TICKET_DETAILS_ZLIST', '{"col:left":["ref","caller_id","servicesubcategory_id","title","description","solution"],"col:right":["status","priority","start_date","resolution_date","last_update","agent_id"]}');
|
||||
?>
|
||||
|
||||
@@ -1,5 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
|
||||
<constants>
|
||||
<constant id="PORTAL_POWER_USER_PROFILE" xsi:type="string" _delta="define"><![CDATA[Portal power user]]></constant>
|
||||
<constant id="PORTAL_SERVICECATEGORY_QUERY" xsi:type="string" _delta="define"><![CDATA[SELECT Service AS s JOIN lnkCustomerContractToService AS l1 ON l1.service_id=s.id JOIN CustomerContract AS cc ON l1.customercontract_id=cc.id WHERE cc.org_id = :org_id AND s.status != 'obsolete']]></constant>
|
||||
<constant id="PORTAL_SERVICE_SUBCATEGORY_QUERY" xsi:type="string" _delta="define"><![CDATA[SELECT ServiceSubcategory WHERE service_id = :svc_id AND ServiceSubcategory.status != 'obsolete']]></constant>
|
||||
<constant id="PORTAL_VALIDATE_SERVICECATEGORY_QUERY" xsi:type="string" _delta="define"><![CDATA[SELECT Service AS s JOIN lnkCustomerContractToService AS l1 ON l1.service_id=s.id JOIN CustomerContract AS cc ON l1.customercontract_id=cc.id WHERE cc.org_id = :org_id AND s.id = :id AND s.status != 'obsolete']]></constant>
|
||||
<constant id="PORTAL_VALIDATE_SERVICESUBCATEGORY_QUERY" xsi:type="string" _delta="define"><![CDATA[SELECT ServiceSubcategory AS Sub JOIN Service AS Svc ON Sub.service_id = Svc.id WHERE Sub.id=:id AND Sub.status != 'obsolete']]></constant>
|
||||
<constant id="PORTAL_ALL_PARAMS" xsi:type="string" _delta="define"><![CDATA[from_service_id,org_id,caller_id,service_id,servicesubcategory_id,title,description,impact,emergency,moreinfo,caller_id,start_date,end_date,duration,impact_duration]]></constant>
|
||||
<constant id="PORTAL_ATTCODE_LOG" xsi:type="string" _delta="define"><![CDATA[public_log]]></constant>
|
||||
<constant id="PORTAL_ATTCODE_COMMENT" xsi:type="string" _delta="define"><![CDATA[user_comment]]></constant>
|
||||
<constant id="PORTAL_REQUEST_FORM_ATTRIBUTES" xsi:type="string" _delta="define"><![CDATA[title,description,impact,urgency,public_log]]></constant>
|
||||
<constant id="PORTAL_ATTCODE_TYPE" xsi:type="string" _delta="define"><![CDATA[request_type]]></constant>
|
||||
<constant id="PORTAL_SET_TYPE_FROM" xsi:type="string" _delta="define"><![CDATA[request_type]]></constant>
|
||||
<constant id="PORTAL_TICKETS_LIST_ZLIST" xsi:type="string" _delta="define"><![CDATA[finalclass,title,start_date,status,servicesubcategory_id,priority,caller_id]]></constant>
|
||||
<constant id="PORTAL_TICKETS_SEARCH_CRITERIA" xsi:type="string" _delta="define"><![CDATA[ref,start_date,close_date,service_id,caller_id]]></constant>
|
||||
<constant id="PORTAL_TICKETS_CLOSED_ZLIST" xsi:type="string" _delta="define"><![CDATA[title,start_date,close_date,servicesubcategory_id]]></constant>
|
||||
<constant id="PORTAL_TICKET_DETAILS_ZLIST" xsi:type="string" _delta="define"><![CDATA[{"col:left":["ref","caller_id","servicesubcategory_id","title","description","solution"],"col:right":["status","priority","start_date","resolution_date","last_update","agent_id"]}]]></constant>
|
||||
</constants>
|
||||
<classes>
|
||||
<class id="UserRequest" _delta="define">
|
||||
<parent>Ticket</parent>
|
||||
|
||||
@@ -1,41 +1 @@
|
||||
<?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/>
|
||||
|
||||
define('PORTAL_POWER_USER_PROFILE', 'Portal power user');
|
||||
|
||||
define('PORTAL_SERVICECATEGORY_QUERY', "SELECT Service AS s JOIN lnkCustomerContractToService AS l1 ON l1.service_id=s.id JOIN CustomerContract AS cc ON l1.customercontract_id=cc.id WHERE cc.org_id = :org_id AND s.status != 'obsolete'");
|
||||
define('PORTAL_SERVICE_SUBCATEGORY_QUERY', "SELECT ServiceSubcategory WHERE service_id = :svc_id AND ServiceSubcategory.status != 'obsolete'");
|
||||
|
||||
define('PORTAL_VALIDATE_SERVICECATEGORY_QUERY', "SELECT Service AS s JOIN lnkCustomerContractToService AS l1 ON l1.service_id=s.id JOIN CustomerContract AS cc ON l1.customercontract_id=cc.id WHERE cc.org_id = :org_id AND s.id = :id AND s.status != 'obsolete'");
|
||||
define('PORTAL_VALIDATE_SERVICESUBCATEGORY_QUERY', "SELECT ServiceSubcategory AS Sub JOIN Service AS Svc ON Sub.service_id = Svc.id WHERE Sub.id=:id AND Sub.status != 'obsolete'");
|
||||
|
||||
define('PORTAL_ALL_PARAMS', 'from_service_id,org_id,caller_id,service_id,servicesubcategory_id,title,description,impact,emergency,moreinfo,caller_id,start_date,end_date,duration,impact_duration');
|
||||
|
||||
define('PORTAL_ATTCODE_LOG', 'public_log');
|
||||
define('PORTAL_ATTCODE_COMMENT', 'user_comment');
|
||||
define('PORTAL_REQUEST_FORM_ATTRIBUTES', 'title,description,impact,urgency,public_log');
|
||||
|
||||
define('PORTAL_ATTCODE_TYPE', 'request_type'); // optional if the type has to be set
|
||||
define('PORTAL_SET_TYPE_FROM', 'request_type'); // The attribute to get the type from (Subcategory)
|
||||
|
||||
define('PORTAL_TICKETS_LIST_ZLIST', 'finalclass,title,start_date,status,servicesubcategory_id,priority,caller_id');
|
||||
define('PORTAL_TICKETS_SEARCH_CRITERIA','ref,start_date,close_date,service_id,caller_id');
|
||||
define('PORTAL_TICKETS_CLOSED_ZLIST', 'title,start_date,close_date,servicesubcategory_id');
|
||||
// json encoded lists for the portal...
|
||||
define('PORTAL_TICKET_DETAILS_ZLIST', '{"col:left":["ref","caller_id","servicesubcategory_id","title","description","solution"],"col:right":["status","priority","start_date","resolution_date","last_update","agent_id"]}');
|
||||
?>
|
||||
|
||||
@@ -153,6 +153,15 @@ class MFCompiler
|
||||
|
||||
$sCompiledCode = '';
|
||||
|
||||
$oConstants = $this->oFactory->ListConstants($sModuleName);
|
||||
if ($oConstants->length > 0)
|
||||
{
|
||||
foreach($oConstants as $oConstant)
|
||||
{
|
||||
$sCompiledCode .= $this->CompileConstant($oConstant)."\n";
|
||||
}
|
||||
}
|
||||
|
||||
$oClasses = $this->oFactory->ListClasses($sModuleName);
|
||||
$iClassCount = $oClasses->length;
|
||||
if ($iClassCount == 0)
|
||||
@@ -546,6 +555,58 @@ EOF;
|
||||
return $sRet;
|
||||
}
|
||||
|
||||
protected function CompileConstant($oConstant)
|
||||
{
|
||||
$sName = $oConstant->getAttribute('id');
|
||||
$sType = $oConstant->getAttribute('xsi:type');
|
||||
$sText = $oConstant->GetText(null);
|
||||
|
||||
switch ($sType)
|
||||
{
|
||||
case 'integer':
|
||||
if (is_null($sText))
|
||||
{
|
||||
// No data given => null
|
||||
$sScalar = 'null';
|
||||
}
|
||||
else
|
||||
{
|
||||
$sScalar = (string)(int)$sText;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'float':
|
||||
if (is_null($sText))
|
||||
{
|
||||
// No data given => null
|
||||
$sScalar = 'null';
|
||||
}
|
||||
else
|
||||
{
|
||||
$sScalar = (string)(float)$sText;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'bool':
|
||||
if (is_null($sText))
|
||||
{
|
||||
// No data given => null
|
||||
$sScalar = 'null';
|
||||
}
|
||||
else
|
||||
{
|
||||
$sScalar = ($sText == 'true') ? 'true' : 'false';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'string':
|
||||
default:
|
||||
$sScalar = $this->QuoteForPHP($sText, true);
|
||||
}
|
||||
$sPHPDefine = "define('$sName', $sScalar);";
|
||||
return $sPHPDefine;
|
||||
}
|
||||
|
||||
protected function CompileClass($oClass, $sTempTargetDir, $sFinalTargetDir, $sModuleRelativeDir, $oP)
|
||||
{
|
||||
$sClass = $oClass->getAttribute('id');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// Copyright (C) 2010-2012 Combodo SARL
|
||||
// Copyright (C) 2010-2013 Combodo SARL
|
||||
//
|
||||
// This file is part of iTop.
|
||||
//
|
||||
@@ -400,6 +400,14 @@ class ModelFactory
|
||||
$oNode->SetAttribute('_created_in', $sModuleName);
|
||||
}
|
||||
}
|
||||
$oNodeList = $oXPath->query('/itop_design/constants/constant');
|
||||
foreach($oNodeList as $oNode)
|
||||
{
|
||||
if ($oNode->getAttribute('_created_in') == '')
|
||||
{
|
||||
$oNode->SetAttribute('_created_in', $sModuleName);
|
||||
}
|
||||
}
|
||||
$oNodeList = $oXPath->query('/itop_design/menus/menu');
|
||||
foreach($oNodeList as $oNode)
|
||||
{
|
||||
@@ -752,9 +760,26 @@ $sHeader
|
||||
EOF
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* List all constants from the DOM, for a given module
|
||||
* @param string $sModuleName
|
||||
* @param bool $bFlattenLayers
|
||||
* @throws Exception
|
||||
*/
|
||||
public function ListConstants($sModuleName, $bFlattenLayers = true)
|
||||
{
|
||||
$sXPath = "/itop_design/constants/constant[@_created_in='$sModuleName']";
|
||||
if ($bFlattenLayers)
|
||||
{
|
||||
$sXPath = "/itop_design/constants/constant[@_created_in='$sModuleName' and (not(@_alteration) or @_alteration!='removed')]";
|
||||
}
|
||||
return $this->GetNodes($sXPath);
|
||||
}
|
||||
|
||||
/**
|
||||
* List all classes from the DOM, for a given module
|
||||
* @param string $sModuleNale
|
||||
* @param string $sModuleName
|
||||
* @param bool $bFlattenLayers
|
||||
* @throws Exception
|
||||
*/
|
||||
@@ -1503,7 +1528,7 @@ class MFElement extends DOMElement
|
||||
}
|
||||
|
||||
/**
|
||||
* For debugging purposes - but this is currently buggy: the whole document is rendered
|
||||
* For debugging purposes
|
||||
*/
|
||||
public function Dump($bReturnRes = false)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user