From a458d986884397ff12cb6b3c2591406fc359317a Mon Sep 17 00:00:00 2001 From: vdumas Date: Fri, 5 Apr 2024 15:57:49 +0200 Subject: [PATCH 1/5] =?UTF-8?q?N=C2=B07399=20-=20Remove=20deprecated=20dat?= =?UTF-8?q?amodel=20methods?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datamodel.itop-change-mgmt-itil.xml | 28 ----- .../datamodel.itop-change-mgmt.xml | 42 ------- .../datamodel.itop-incident-mgmt-itil.xml | 119 ------------------ .../datamodel.itop-problem-mgmt.xml | 42 ------- .../datamodel.itop-request-mgmt-itil.xml | 107 ---------------- .../datamodel.itop-request-mgmt.xml | 107 ---------------- .../itop-tickets/datamodel.itop-tickets.xml | 1 - 7 files changed, 446 deletions(-) diff --git a/datamodels/2.x/itop-change-mgmt-itil/datamodel.itop-change-mgmt-itil.xml b/datamodels/2.x/itop-change-mgmt-itil/datamodel.itop-change-mgmt-itil.xml index cc7b33734..f395eb843 100755 --- a/datamodels/2.x/itop-change-mgmt-itil/datamodel.itop-change-mgmt-itil.xml +++ b/datamodels/2.x/itop-change-mgmt-itil/datamodel.itop-change-mgmt-itil.xml @@ -993,34 +993,6 @@ } ]]> - - - false - public - StimulusUserAction - Set('close_date', time()); - return true; - }]]> - - - - false - public - LifecycleAction - Set('reason', ''); - return true; - }]]> - false protected diff --git a/datamodels/2.x/itop-change-mgmt/datamodel.itop-change-mgmt.xml b/datamodels/2.x/itop-change-mgmt/datamodel.itop-change-mgmt.xml index fcd38726c..48973d78b 100755 --- a/datamodels/2.x/itop-change-mgmt/datamodel.itop-change-mgmt.xml +++ b/datamodels/2.x/itop-change-mgmt/datamodel.itop-change-mgmt.xml @@ -535,48 +535,6 @@ } ]]> - - - false - public - LifecycleAction - Set('approval_date', time()); - return true; - }]]> - - - - false - public - LifecycleAction - Set('reject_reason', ''); - return true; - }]]> - - - - false - public - LifecycleAction - Set('close_date', time()); - return true; - }]]> - false protected diff --git a/datamodels/2.x/itop-incident-mgmt-itil/datamodel.itop-incident-mgmt-itil.xml b/datamodels/2.x/itop-incident-mgmt-itil/datamodel.itop-incident-mgmt-itil.xml index f7ecb63bc..6be747b4c 100755 --- a/datamodels/2.x/itop-incident-mgmt-itil/datamodel.itop-incident-mgmt-itil.xml +++ b/datamodels/2.x/itop-incident-mgmt-itil/datamodel.itop-incident-mgmt-itil.xml @@ -1083,64 +1083,6 @@ } ]]> - - - false - public - LifecycleAction - Set('assignment_date', time()); - return true; - }]]> - - - - false - public - LifecycleAction - Set('last_pending_date', time()); - return true; - }]]> - - - - false - public - LifecycleAction - Set('resolution_date', time()); - $iTimeSpent = time() - AttributeDateTime::GetAsUnixSeconds($this->Get('start_date')); - $this->Set('time_spent', $iTimeSpent); - return true; - }]]> - - - - false - public - LifecycleAction - Set('close_date', time()); - return true; - }]]> - false public @@ -1238,67 +1180,6 @@ } }]]> - - - false - public - LifecycleAction - $this->GetKey(), - ) - ); - //automatically resolve child requests - while($oRequest = $oChildRequestSet->Fetch()) - { - if ( $oRequest->Get('status') != 'resolved') - { - $oRequest->set('servicesubcategory_id',$this->Get('servicesubcategory_id')); - $oRequest->set('service_id',$this->Get('service_id')); - $oRequest->set('team_id',$this->Get('team_id')); - $oRequest->set('agent_id',$this->Get('agent_id')); - $oRequest->set('resolution_code',$this->Get('resolution_code')); - $oRequest->set('solution','Automatically resolved by incident:[[Incident:'.$this->Get('ref').']]'); - $oRequest->ApplyStimulus('ev_autoresolve'); - $oRequest->DBUpdate(); - } - } - } - - //automatically resolve child incidents - $sOQL = "SELECT Incident WHERE parent_incident_id=:ticket"; - $oChildIncidentSet = new DBObjectSet(DBObjectSearch::FromOQL($sOQL), - array(), - array( - 'ticket' => $this->GetKey(), - ) - ); - while($oIncident = $oChildIncidentSet->Fetch()) - { - if ( $oIncident->Get('status') != 'resolved') - { - $oIncident->set('servicesubcategory_id',$this->Get('servicesubcategory_id')); - $oIncident->set('service_id',$this->Get('service_id')); - $oIncident->set('team_id',$this->Get('team_id')); - $oIncident->set('agent_id',$this->Get('agent_id')); - $oIncident->set('resolution_code',$this->Get('resolution_code')); - $oIncident->set('solution','Automatically resolved by incident:[[Incident:'.$this->Get('ref').']]'); - $oIncident->ApplyStimulus('ev_autoresolve'); - $oIncident->DBUpdate(); - } - } - return true; - - }]]> - - - - false - public - LifecycleAction - Set('assignment_date', time()); - return true; - }]]> - - - - false - public - LifecycleAction - Set('resolution_date', time()); - return true; - }]]> - - - - false - public - LifecycleAction - Set('close_date', time()); - return true; - }]]> - /** Compute the priority of the ticket based on its impact and urgency * @return integer The priority of the ticket 1(high) .. 3(low) diff --git a/datamodels/2.x/itop-request-mgmt-itil/datamodel.itop-request-mgmt-itil.xml b/datamodels/2.x/itop-request-mgmt-itil/datamodel.itop-request-mgmt-itil.xml index 514b6543e..60a2c938e 100755 --- a/datamodels/2.x/itop-request-mgmt-itil/datamodel.itop-request-mgmt-itil.xml +++ b/datamodels/2.x/itop-request-mgmt-itil/datamodel.itop-request-mgmt-itil.xml @@ -1231,78 +1231,6 @@ } ]]> - - - false - public - LifecycleAction - Set('assignment_date', time()); - return true; - }]]> - - - - false - public - LifecycleAction - Set('last_pending_date', time()); - return true; - }]]> - - - - false - public - LifecycleAction - Set('resolution_date', time()); - $iTimeSpent = time() - AttributeDateTime::GetAsUnixSeconds($this->Get('start_date')); - $this->Set('time_spent', $iTimeSpent); - return true; - }]]> - - - - false - public - LifecycleAction - Set('close_date', time()); - return true; - }]]> - - - - false - public - LifecycleAction - Set('approver_id', UserRights::GetUserId()); - return true; - }]]> - false public @@ -1399,41 +1327,6 @@ } }]]> - - - false - public - LifecycleAction - $this->GetKey(), - ) - ); - while($oRequest = $oChildRequestSet->Fetch()) - { - if ( $oRequest->Get('status') != 'resolved') - { - $oRequest->set('servicesubcategory_id',$this->Get('servicesubcategory_id')); - $oRequest->set('service_id',$this->Get('service_id')); - $oRequest->set('team_id',$this->Get('team_id')); - $oRequest->set('agent_id',$this->Get('agent_id')); - $oRequest->set('resolution_code',$this->Get('resolution_code')); - $oRequest->set('solution','Automatically resolved by request:[[UserRequest:'.$this->Get('ref').']]'); - $oRequest->ApplyStimulus('ev_autoresolve'); - $oRequest->DBUpdate(); - } - } - return true; - - }]]> - - - - false - public - LifecycleAction - Set('assignment_date', time()); - return true; - }]]> - - - - false - public - LifecycleAction - Set('last_pending_date', time()); - return true; - }]]> - - - - false - public - LifecycleAction - Set('resolution_date', time()); - $iTimeSpent = time() - AttributeDateTime::GetAsUnixSeconds($this->Get('start_date')); - $this->Set('time_spent', $iTimeSpent); - return true; - }]]> - - - - false - public - LifecycleAction - Set('close_date', time()); - return true; - }]]> - - - - false - public - LifecycleAction - Set('approver_id', UserRights::GetUserId()); - return true; - }]]> - false public @@ -1439,41 +1367,6 @@ 'panel_title_tooltip' => Dict::S($sTabCode."+"), ]); } - }]]> - - - - false - public - LifecycleAction - $this->GetKey(), - ) - ); - while($oRequest = $oChildRequestSet->Fetch()) - { - if ( $oRequest->Get('status') != 'resolved') - { - $oRequest->set('servicesubcategory_id',$this->Get('servicesubcategory_id')); - $oRequest->set('service_id',$this->Get('service_id')); - $oRequest->set('team_id',$this->Get('team_id')); - $oRequest->set('agent_id',$this->Get('agent_id')); - $oRequest->set('resolution_code',$this->Get('resolution_code')); - $oRequest->set('solution','Automatically resolved by request:[[UserRequest:'.$this->Get('ref').']]'); - $oRequest->ApplyStimulus('ev_autoresolve'); - $oRequest->DBUpdate(); - } - } - return true; - }]]> diff --git a/datamodels/2.x/itop-tickets/datamodel.itop-tickets.xml b/datamodels/2.x/itop-tickets/datamodel.itop-tickets.xml index cb4ca344e..211141752 100755 --- a/datamodels/2.x/itop-tickets/datamodel.itop-tickets.xml +++ b/datamodels/2.x/itop-tickets/datamodel.itop-tickets.xml @@ -1469,7 +1469,6 @@ copy(service_id, service_id) - ongoing-tickets-for-portal-user From efe61201e5bd11694284256855337997ba8a0e01 Mon Sep 17 00:00:00 2001 From: vdumas Date: Fri, 5 Apr 2024 18:20:19 +0200 Subject: [PATCH 2/5] =?UTF-8?q?N=C2=B07417=20-=20Improve=20error=20message?= =?UTF-8?q?=20when=20a=20Root=20Menu=20is=20not=20a=20MenuGroup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/menunode.class.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/menunode.class.inc.php b/application/menunode.class.inc.php index 244209db6..a47a495a4 100644 --- a/application/menunode.class.inc.php +++ b/application/menunode.class.inc.php @@ -280,9 +280,11 @@ class ApplicationMenu $oMenuNode = static::GetMenuNode($sMenuGroupIdx); if (!($oMenuNode instanceof MenuGroup)) { - IssueLog::Error('Menu node was not displayed as a menu group as it is actually not a menu group', LogChannels::CONSOLE, [ + IssueLog::Error('Menu node without parent (root menu) must be of type menu group. Parent menu is missing or not visible to user.', LogChannels::CONSOLE, [ 'menu_node_class' => get_class($oMenuNode), + 'menu_node_id' => $oMenuNode->GetMenuID(), 'menu_node_label' => $oMenuNode->GetLabel(), + 'current_user_id' => UserRights::GetUserId(), ]); continue; } From d48b5d7d214b1aedb56441694a874311cc1a71ec Mon Sep 17 00:00:00 2001 From: Molkobain Date: Fri, 5 Apr 2024 16:32:59 +0200 Subject: [PATCH 3/5] =?UTF-8?q?N=C2=B07416=20-=20Setup:=20Add=20warning=20?= =?UTF-8?q?for=20optionnal=20PHP=20extension=20"APCu"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 3 ++- setup/setuputils.class.inc.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 14db1f5cf..e5c33b6bd 100644 --- a/composer.json +++ b/composer.json @@ -44,9 +44,10 @@ "ext-libsodium": "Required to use the AttributeEncryptedString.", "ext-openssl": "Can be used as a polyfill if libsodium is not installed", "ext-mcrypt": "Can be used as a polyfill if either libsodium and openssl are not installed (libsodium and openssl are more secure)", + "ext-apcu": "For better performance and stability", + "ext-imap": "Required by the extension \"Mail to ticket automation\"" "ext-ldap": "Required to use LDAP as an identity provider", "ext-posix": "Not required by the core, but some extensions uses it.", - "ext-imap": "Required by the extension \"Mail to ticket automation\"" }, "config": { "platform": { diff --git a/setup/setuputils.class.inc.php b/setup/setuputils.class.inc.php index 59d28e428..eb2089255 100644 --- a/setup/setuputils.class.inc.php +++ b/setup/setuputils.class.inc.php @@ -2169,6 +2169,7 @@ JS 'sodium' => 'Strong encryption will not be used.', 'openssl' => 'Strong encryption will not be used.', ], + 'apcu' => 'Performances will be slightly degraded.', 'ldap' => 'LDAP authentication will be disabled.', ]; From 8357c86361f5f2080f8a2c4fc4ce801e958772bf Mon Sep 17 00:00:00 2001 From: jf-cbd Date: Mon, 8 Apr 2024 11:10:12 +0200 Subject: [PATCH 4/5] :bug: Fix php 7.4 compatibility in bulkchange.class.inc.php (for itop 3.1) --- core/bulkchange.class.inc.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/bulkchange.class.inc.php b/core/bulkchange.class.inc.php index 755843841..330eeaca7 100644 --- a/core/bulkchange.class.inc.php +++ b/core/bulkchange.class.inc.php @@ -276,12 +276,21 @@ class CellStatus_NullIssue extends CellStatus_Issue */ class ReportValue { + protected DBObject $oObject; + protected string $sAttCode; + protected bool $bOriginal; + /** * @param DBObject $oObject * @param string $sAttCode * @param bool $bOriginal */ - public function __construct(protected DBObject $oObject, protected string $sAttCode, protected bool $bOriginal){} + public function __construct(DBObject $oObject, string $sAttCode, bool $bOriginal) + { + $this->oObject = $oObject; + $this->sAttCode = $sAttCode; + $this->bOriginal = $bOriginal; + } public function GetAsHTML(bool $bLocalizedValues) { From cd34f8b5eb3836b2b19e793ad3bedddd18b01bd8 Mon Sep 17 00:00:00 2001 From: jf-cbd Date: Mon, 8 Apr 2024 12:19:43 +0200 Subject: [PATCH 5/5] Removed namespaces in 3.1 --- pages/csvimport.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pages/csvimport.php b/pages/csvimport.php index d372d83e6..2091cc1fd 100644 --- a/pages/csvimport.php +++ b/pages/csvimport.php @@ -25,10 +25,6 @@ use Combodo\iTop\Application\UI\Base\Layout\MultiColumn\MultiColumnUIBlockFactor use Combodo\iTop\Application\UI\Base\Layout\TabContainer\Tab\AjaxTab; use Combodo\iTop\Application\UI\Base\Layout\TabContainer\TabContainer; use Combodo\iTop\Application\UI\Base\Layout\UIContentBlockUIBlockFactory; -use Combodo\iTop\Application\WebPage\AjaxPage; -use Combodo\iTop\Application\WebPage\ErrorPage; -use Combodo\iTop\Application\WebPage\iTopWebPage; -use Combodo\iTop\Application\WebPage\WebPage; use Combodo\iTop\Service\Import\CSVImportPageProcessor; use Combodo\iTop\Core\CMDBChange\CMDBChangeOrigin; use Combodo\iTop\Renderer\BlockRenderer;