From 0432727ace5babe5099726d88c563def4fda3feb Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Thu, 9 Dec 2021 11:07:57 +0100 Subject: [PATCH 1/2] :art: Reformat itop-tickets XML --- .../itop-tickets/datamodel.itop-tickets.xml | 3365 +++++++++-------- 1 file changed, 1683 insertions(+), 1682 deletions(-) diff --git a/datamodels/2.x/itop-tickets/datamodel.itop-tickets.xml b/datamodels/2.x/itop-tickets/datamodel.itop-tickets.xml index 0fd72e1d5..9fba41021 100755 --- a/datamodels/2.x/itop-tickets/datamodel.itop-tickets.xml +++ b/datamodels/2.x/itop-tickets/datamodel.itop-tickets.xml @@ -1,205 +1,206 @@ - - service_id AND sc.org_id = :this->org_id AND slt.request_type = :request_type AND slt.priority = :this->priority]]> - - - - cmdbAbstractObject - - _Ticket - - - + service_id AND sc.org_id = :this->org_id AND slt.request_type = :request_type AND slt.priority = :this->priority]]> + + + + cmdbAbstractObject + + _Ticket + + + - bizmodel,searchable,structure - true - autoincrement - ticket - id - finalclass - - - - - - - - - - - - - - - - - - - - - - - - - - false - - - - - - - ongoing - resolved - closed - - operational_status - ongoing - - - status - - - - - - - - - - - - - - - - - - ref - - true - - - org_id - Organization - false - DEL_AUTO - - - org_id - name - - - org_id]]> - - - - caller_id - Person - true - DEL_AUTO - - - caller_id - name - - - team_id - Team - true - DEL_AUTO - - - team_id - email - - - team_id]]> - - - - agent_id - Person - true - DEL_AUTO - false - - - agent_id - name - - - title - - false - - - description - - false - html - - - true - start_date - - true - - - end_date - - true - - - last_update - - true - none - - - close_date - - true - - - private_log - - true - - - lnkContactToTicket - ticket_id - 0 - 0 - contact_id - - - - lnkFunctionalCIToTicket - ticket_id - 0 - 0 - functionalci_id - - - - WorkOrder - ticket_id - 0 - 0 - - - - - false - public - Overload-DBObject - bizmodel,searchable,structure + true + autoincrement + ticket + id + finalclass + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + ongoing + resolved + closed + + operational_status + ongoing + + + status + + + + + + + + + + + + + + + + + + ref + + true + + + org_id + Organization + false + DEL_AUTO + + + org_id + name + + + org_id]]> + + + + caller_id + Person + true + DEL_AUTO + + + caller_id + name + + + team_id + Team + true + DEL_AUTO + + + team_id + email + + + team_id]]> + + + + agent_id + Person + true + DEL_AUTO + false + + + agent_id + name + + + title + + false + + + description + + false + html + + + true + start_date + + true + + + end_date + + true + + + last_update + + true + none + + + close_date + + true + + + private_log + + true + + + lnkContactToTicket + ticket_id + 0 + 0 + contact_id + + + + lnkFunctionalCIToTicket + ticket_id + 0 + 0 + functionalci_id + + + + WorkOrder + ticket_id + 0 + 0 + + + + + false + public + Overload-DBObject + - - - false - protected - Overload-DBObject - + + false + protected + Overload-DBObject + - - - true - public - Overload-DBObject - + + true + public + Overload-DBObject + - - - -
- - - 10 - - - 20 - - - 30 - - - 40 - - - 50 - - - 60 - - - 70 - - - 75 - - - 80 - - - 90 - - - 100 - - - 110 - - - 120 - - - 130 - - - 140 - - - 150 - - -
- - - - 10 - - - 20 - - - 30 - - - 35 - - - - - - - 10 - - - 20 - - - 30 - - - 35 - - - 40 - - - 50 - - - 60 - - - 70 - - - - - - - 10 - - - 20 - - - 30 - - - 40 - - - 50 - - - 60 - - - 65 - - - 70 - - - -
-
- - cmdbAbstractObject - - 1 - bizmodel - false - autoincrement - lnkcontacttoticket - id - - - - - - - - - - - - - - - - - - - ticket_id - Ticket - false - DEL_AUTO - - - ticket_id - ref - - - contact_id - Contact - false - DEL_AUTO - - - contact_id - email - - - role - - true - - - - manual - computed - do_not_notify - - impact_code - manual - false - list - - - - -
- - - 10 - - - 20 - - - 30 - - -
- - - - 10 - - - 20 - - - 30 - - - - - - - 10 - - - 20 - - - 30 - - - -
-
- - cmdbAbstractObject - - 1 - bizmodel - false - autoincrement - lnkfunctionalcitoticket - id - - - - - - - - - - - - - - - - - - - ticket_id - Ticket - false - DEL_AUTO - - - ticket_id - ref - - - ticket_id - title - - - functionalci_id - FunctionalCI - false - DEL_AUTO - - - functionalci_id - name - - - impact - - true - - - - manual - computed - not_impacted - - impact_code - manual - false - list - - - - -
- - - 10 - - - 20 - - - 30 - - -
- - - - 10 - - - 20 - - - 30 - - - - - - - 10 - - - 20 - - - 30 - - - -
-
- - cmdbAbstractObject - - bizmodel,searchable,incidentmgmt,requestmgmt,changemgmt,m2prequest - false - autoincrement - workorder - id - - - - - - - - images/workorder.png - - - - - - - - - - name - - false - - - - open - closed - - status - open - false - list - - - description - - false - - - ticket_id - Ticket - false - DEL_AUTO - - - ticket_id - ref - - - SELECT Team - team_id - Team - false - DEL_MANUAL - - - team_id - email - - - team_id]]> - - - - owner_id - Person - true - DEL_MANUAL - false - - - agent_id - email - - - start_date - - false - - - end_date - - false - - - log - - true - - - - status - - - - - - - - - closed - - - - - - - - - - - - - false - public - StimulusUserAction - - - + + +
+ + + 10 + + + 20 + + + 30 + + + 40 + + + 50 + + + 60 + + + 70 + + + 75 + + + 80 + + + 90 + + + 100 + + + 110 + + + 120 + + + 130 + + + 140 + + + 150 + + +
+ + + + 10 + + + 20 + + + 30 + + + 35 + + + + + + + 10 + + + 20 + + + 30 + + + 35 + + + 40 + + + 50 + + + 60 + + + 70 + + + + + + + 10 + + + 20 + + + 30 + + + 40 + + + 50 + + + 60 + + + 65 + + + 70 + + + +
+
+ + cmdbAbstractObject + + 1 + bizmodel + false + autoincrement + lnkcontacttoticket + id + + + + + + + + + + + + + + + + + + + ticket_id + Ticket + false + DEL_AUTO + + + ticket_id + ref + + + contact_id + Contact + false + DEL_AUTO + + + contact_id + email + + + role + + true + + + + manual + computed + do_not_notify + + impact_code + manual + false + list + + + + +
+ + + 10 + + + 20 + + + 30 + + +
+ + + + 10 + + + 20 + + + 30 + + + + + + + 10 + + + 20 + + + 30 + + + +
+
+ + cmdbAbstractObject + + 1 + bizmodel + false + autoincrement + lnkfunctionalcitoticket + id + + + + + + + + + + + + + + + + + + + ticket_id + Ticket + false + DEL_AUTO + + + ticket_id + ref + + + ticket_id + title + + + functionalci_id + FunctionalCI + false + DEL_AUTO + + + functionalci_id + name + + + impact + + true + + + + manual + computed + not_impacted + + impact_code + manual + false + list + + + + +
+ + + 10 + + + 20 + + + 30 + + +
+ + + + 10 + + + 20 + + + 30 + + + + + + + 10 + + + 20 + + + 30 + + + +
+
+ + cmdbAbstractObject + + bizmodel,searchable,incidentmgmt,requestmgmt,changemgmt,m2prequest + false + autoincrement + workorder + id + + + + + + + + images/workorder.png + + + + + + + + + + name + + false + + + + open + closed + + status + open + false + list + + + description + + false + + + ticket_id + Ticket + false + DEL_AUTO + + + ticket_id + ref + + + SELECT Team + team_id + Team + false + DEL_MANUAL + + + team_id + email + + + team_id]]> + + + + owner_id + Person + true + DEL_MANUAL + false + + + agent_id + email + + + start_date + + false + + + end_date + + false + + + log + + true + + + + status + + + + + + + + + closed + + + + + + + + + + + + + false + public + StimulusUserAction + + + Get('log'); $sLog = $oLog->GetModifiedEntry('html'); @@ -714,1024 +715,1024 @@ } } }]]> - - - false - protected - Overload-DBObject - + + false + protected + Overload-DBObject + UpdateParentTicketLog(); }]]> - - - -
- - - 10 - - - 20 - - - 30 - - - 40 - - - 50 - - - 60 - - - 70 - - - 80 - - -
- - - - 10 - - - 20 - - - 30 - - - 40 - - - 50 - - - 60 - - - 70 - - - - - - - 10 - - - 20 - - - 30 - - - 40 - - - 50 - - - 60 - - - -
-
-
- - - - - - - - attcode - true - - deny - - - - - - - - - - - - - string - true - - - - - - - attcode - true - - deny - - - - - - - - - - - - - string - true - - - - - - - attcode - true - - allow - - - - - - - - - - - - - attcode - true - - allow - - - - - - - - - - - - - attcode - true - - allow - - - - - - - - - - - - - attcode - true - - allow - - - - - - - attcode - true - - allow - - - - - - - - string - false - - - - - - - attcode - true - - deny - - - - - - - - - - - - - attcode - true - - allow - - - - - - - - - - - attcode - true - - deny - - - - - - - - - attcode - true - - - - - - - string - true - - - - - - - reference - true - - - - - - - reference - true - - - - - - - reference - true - - - - - - - - - - - - - - - - - - - - - portal:itop-portal - - - - - - - - - - - - - iTopPortalViewUrlMaker - - - - - true - - - - tab - - - - - - - 1 - - - <!-- Can be either a <default> tag for both home page and navigation menu or distinct <home> or/and <navigation_menu> tags--> - <default>Brick:Portal:UserProfile:Navigation:Dropdown:MyProfil</default> - - - fas fa-user fa-2x - - - - - -
- - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
- - true - 6 - - 10 - - - <default>Brick:Portal:NewRequest:Title</default> - - Brick:Portal:NewRequest:Title+ - - fc fc-new-request fc-2x - - - - - ServiceFamily - icon - - - - - Service - - servicefamily_id - - - - description - - - description - - - icon - - Class:Service - - - - - - - - - - - - service_id - - description - description - Class:ServiceSubcategory - - - - - UserRequest - - - - - fc fc-new-request fc-1-6x fc-flip-horizontal - - - - - - - - - - - - - - - - - - - - - - - - list - - - - auto - - - - true - - 20 - - 6 - - <default>Brick:Portal:OngoingRequests:Title</default> - - - - - - - - - - - - - - - Brick:Portal:OngoingRequests:Title+ - - fc fc-ongoing-request fc-2x - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - 1 - Brick:Portal:OngoingRequests:Tab:OnGoing - - - - - - 2 - Brick:Portal:OngoingRequests:Tab:Resolved - - - - - - - - - full - - true - - - - true - - 50 - - - false - - 12 - - <default>Brick:Portal:ClosedRequests:Title</default> - - - - fc fc-closed-request fc-2x - - - - - - - - - - - - - - - - - - - - 1 - Brick:Portal:ClosedRequests:Title - - - - - - - auto - - true - - -
- -
- Service - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - -
-
- ServiceSubcategory - - - - -
-
- -
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
- Ticket - - - - go-to-open-requests - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - - - -
- Ticket - - - - - - - + + + +
+ + + 10 + + + 20 + + + 30 + + + 40 + + + 50 + + + 60 + + + 70 + + + 80 + + +
+ + + + 10 + + + 20 + + + 30 + + + 40 + + + 50 + + + 60 + + + 70 + + + + + + + 10 + + + 20 + + + 30 + + + 40 + + + 50 + + + 60 + + + +
+ + + + + + + + + + attcode + true + + deny + + + + + + + + + + + + + string + true + + + + + + + attcode + true + + deny + + + + + + + + + + + + + string + true + + + + + + + attcode + true + + allow + + + + + + + + + + + + + attcode + true + + allow + + + + + + + + + + + + + attcode + true + + allow + + + + + + + + + + + + + attcode + true + + allow + + + + + + + attcode + true + + allow + + + + + + + + string + false + + + + + + + attcode + true + + deny + + + + + + + + + + + + + attcode + true + + allow + + + + + + + + + + + attcode + true + + deny + + + + + + + + + attcode + true + + + + + + + string + true + + + + + + + reference + true + + + + + + + reference + true + + + + + + + reference + true + + + + + + + + + + + + + + + + + + + + + portal:itop-portal + + + + + + + + + + + + + iTopPortalViewUrlMaker + + + + + true + + + + tab + + + + + + + 1 + + + <!-- Can be either a <default> tag for both home page and navigation menu or distinct <home> or/and <navigation_menu> tags--> + <default>Brick:Portal:UserProfile:Navigation:Dropdown:MyProfil</default> + + + fas fa-user fa-2x + + + + + + + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ + true + 6 + + 10 + + + <default>Brick:Portal:NewRequest:Title</default> + + Brick:Portal:NewRequest:Title+ + + fc fc-new-request fc-2x + + + + + ServiceFamily + icon + + + + + Service + + servicefamily_id + + + + description + + + description + + + icon + + Class:Service + + + + + + + + + + + + service_id + + description + description + Class:ServiceSubcategory + + + + + UserRequest + + + + + fc fc-new-request fc-1-6x fc-flip-horizontal + + + + + + + + + + + + + + + + + + + + + + + + list + + + + auto + + + + true + + 20 + + 6 + + <default>Brick:Portal:OngoingRequests:Title</default> + + + + + + + + + + + + + + + Brick:Portal:OngoingRequests:Title+ + + fc fc-ongoing-request fc-2x + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + 1 + Brick:Portal:OngoingRequests:Tab:OnGoing + + + + + + 2 + Brick:Portal:OngoingRequests:Tab:Resolved + + + + + + + + + full + + true + + + + true + + 50 + + + false + + 12 + + <default>Brick:Portal:ClosedRequests:Title</default> + + + + fc fc-closed-request fc-2x + + + + + + + + + + + + + + + + + + + + 1 + Brick:Portal:ClosedRequests:Title + + + + + + + auto + + true + + +
+ +
+ Service + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + +
+
+ ServiceSubcategory + + + + +
+
+ +
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ Ticket + + go-to-open-requests - - - -
-
-
- {{'Ticket:baseinfo'|dict_s}} -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{'Ticket:Type'|dict_s}} & {{'Ticket:date'|dict_s}} -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - - -
-
- Ticket - - + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + + +
+ Ticket + + + + + + + go-to-open-requests - - - -
-
-
-
-
-
- - - - - - - - -
- Ticket - - + + + +
+
+
+ {{'Ticket:baseinfo'|dict_s}} +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{'Ticket:Type'|dict_s}} & {{'Ticket:date'|dict_s}} +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + +
+
+ Ticket + + go-to-open-requests - - - - - - - -
- Person - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
- - - - - - - - - - - - - - - - - - - - - org_id]]> - - - - - - - org_id]]> - - - - - - - org_id]]> - - - - - - - - - - - - - 10 - - - 20 - - - 50 - - - - - - - - - org_id]]> - true - - - - - - - org_id AND s.status != 'obsolete']]> - true - - - - - - - org_id AND ssc.status != 'obsolete']]> - true - - - - - - - - - - - org_id AND T.finalclass IN ('UserRequest', 'Incident')]]> - - - - - - - - - - - - - - - set(caller_id, $current_contact_id$) - copy(org_id, org_id) - set(origin, portal) - - - - - Service - - copy(id, service_id) - - - - ServiceSubcategory - - copy(id, servicesubcategory_id) - copy(service_id, service_id) - - - - - - ongoing-tickets-for-portal-user - - - - - - - - - - - - ongoing-tickets-for-portal-user - - - - - - - - - - - services - - - - - - - - - - - - - - - - - -
-
- - -500 - - +
+ + +
+
+
+
+
+
+ + + + + + + + +
+ Ticket + + + + go-to-open-requests + + + + + + + + + +
+ Person + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + org_id]]> + + + + + + + org_id]]> + + + + + + + org_id]]> + + + + + + + + + + + + + 10 + + + 20 + + + 50 + + + + + + + + + org_id]]> + true + + + + + + + org_id AND s.status != 'obsolete']]> + true + + + + + + + org_id AND ssc.status != 'obsolete']]> + true + + + + + + + + + + + org_id AND T.finalclass IN ('UserRequest', 'Incident')]]> + + + + + + + + + + + + + + + set(caller_id, $current_contact_id$) + copy(org_id, org_id) + set(origin, portal) + + + + + Service + + copy(id, service_id) + + + + ServiceSubcategory + + copy(id, servicesubcategory_id) + copy(service_id, service_id) + + + + + + ongoing-tickets-for-portal-user + + + + + + + + + + + + ongoing-tickets-for-portal-user + + + + + + + + + + + services + + + + + + + + + + + + + + + + + +
+
+ + + 500 + +
From eb2a615bd28100442c7f6171707bb40884af2305 Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Thu, 9 Dec 2021 11:57:20 +0100 Subject: [PATCH 2/2] =?UTF-8?q?N=C2=B04384=20Security=20hardening=20Module?= =?UTF-8?q?=20parameter=20flag=20for=20extensions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../portal/src/Form/ObjectFormManager.php | 17 +++++++++++------ .../2.x/itop-tickets/datamodel.itop-tickets.xml | 1 + 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php b/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php index 4ae7dde85..724e68f07 100644 --- a/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php +++ b/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php @@ -85,16 +85,19 @@ class ObjectFormManager extends FormManager protected $aHiddenFieldsId = array(); /** - * Creates an instance of \Combodo\iTop\Portal\Form\ObjectFormManager from JSON data that must contain at least : - * - formobject_class : The class of the object that is being edited/viewed - * - formmode : view|edit|create - * - values for parent + * @param string $sJson JSON data that must contain at least : + * - formobject_class : The class of the object that is being edited/viewed + * - formmode : view|edit|create + * - values for parent + * @param bool $bTrustContent if false then won't allow modified TWIG content * - * @param bool $bTrustContent if false then won't allow TWIG content + * @return \Combodo\iTop\Portal\Form\ObjectFormManager new instance init from JSON data * * @inheritDoc * @throws \Exception * @throws \SecurityException if twig content is present and $bTrustContent is false + * + * @since 2.7.6 3.0.0 N°4384 new $bTrustContent parameter */ public static function FromJSON($sJson, $bTrustContent = false) { @@ -104,7 +107,9 @@ class ObjectFormManager extends FormManager $aJson = json_decode($sJson, true); } - if (false === $bTrustContent) { + $oConfig = utils::GetConfig(); + $bIsContentCheckEnabled = $oConfig->GetModuleSetting(PORTAL_ID, 'enable_formmanager_content_check', true); + if ($bIsContentCheckEnabled && (false === $bTrustContent)) { /** @noinspection NestedPositiveIfStatementsInspection */ if (isset($aJson['formproperties']['layout']['type']) && ($aJson['formproperties']['layout']['type'] === 'twig')) { // There will be an IssueLog above in the hierarchy due to the exception, but we are logging here so that we can output the JSON data ! diff --git a/datamodels/2.x/itop-tickets/datamodel.itop-tickets.xml b/datamodels/2.x/itop-tickets/datamodel.itop-tickets.xml index 9fba41021..9f2c0b0f4 100755 --- a/datamodels/2.x/itop-tickets/datamodel.itop-tickets.xml +++ b/datamodels/2.x/itop-tickets/datamodel.itop-tickets.xml @@ -1733,6 +1733,7 @@ 500 + true