diff --git a/core/oql/build/PHP/Lempar.php b/core/oql/build/PHP/Lempar.php index 23ba300fd..74f557a15 100644 --- a/core/oql/build/PHP/Lempar.php +++ b/core/oql/build/PHP/Lempar.php @@ -33,17 +33,19 @@ class ParseyyToken implements ArrayAccess return $this->string; } - function offsetExists($offset) + function offsetExists($offset): bool { return isset($this->metadata[$offset]); } - function offsetGet($offset) + // Return type mixed is not supported by PHP 7.4, we can remove the following PHP attribute and add the return type once iTop min PHP version is PHP 8.0+ + #[\ReturnTypeWillChange] + function offsetGet($offset) { return $this->metadata[$offset]; } - function offsetSet($offset, $value) + function offsetSet($offset, $value): void { if ($offset === null) { if (isset($value[0])) { @@ -66,7 +68,7 @@ class ParseyyToken implements ArrayAccess } } - function offsetUnset($offset) + function offsetUnset($offset): void { unset($this->metadata[$offset]); } diff --git a/core/oql/build/build.bash b/core/oql/build/build.bash index c6c006d4e..6e83dbd49 100644 --- a/core/oql/build/build.bash +++ b/core/oql/build/build.bash @@ -2,6 +2,7 @@ # # Rebuild the iTop Lexer / Parser # PEAR is required to build (really?) +# PHP 8.0+ is not supported by the parser generator # Launch this batch from the core/oql/build directory # with ./build.bash # diff --git a/core/oql/build/build.cmd b/core/oql/build/build.cmd index dea9c8781..779e9b87e 100644 --- a/core/oql/build/build.cmd +++ b/core/oql/build/build.cmd @@ -1,5 +1,6 @@ rem must be run with current directory = the directory of the batch rem PEAR is required to build +rem PHP 8.0+ is not supported by the parser generator php -d include_path=".;C:\iTop\PHP\PEAR" ".\PHP\LexerGenerator\cli.php" ..\oql-lexer.plex php ".\PHP\ParserGenerator\cli.php" ..\oql-parser.y php -r "echo date('Y-m-d');" > ..\version.txt diff --git a/core/oql/oql-parser.php b/core/oql/oql-parser.php index 5bd6d1577..6986bada6 100644 --- a/core/oql/oql-parser.php +++ b/core/oql/oql-parser.php @@ -40,7 +40,7 @@ class OQLParser_yyToken implements ArrayAccess // Return type mixed is not supported by PHP 7.4, we can remove the following PHP attribute and add the return type once iTop min PHP version is PHP 8.0+ #[\ReturnTypeWillChange] - function offsetGet($offset) + function offsetGet($offset) { return $this->metadata[$offset]; } @@ -99,7 +99,7 @@ class OQLParser_yyStackEntry // declare_class is output here #line 24 "..\oql-parser.y" -class OQLParserRaw#line 102 "..\oql-parser.php" +class OQLParserRaw#line 104 "..\oql-parser.php" { /* First off, code is included which follows the "include_class" declaration ** in the input file. */ @@ -1180,7 +1180,7 @@ static public $yy_action = array( #line 30 "..\oql-parser.y" throw new OQLParserStackOverFlowException($this->m_sSourceQuery, $this->m_iLine, $this->m_iCol); -#line 1186 "..\oql-parser.php" +#line 1188 "..\oql-parser.php" return; } $yytos = new OQLParser_yyStackEntry; @@ -1482,49 +1482,49 @@ throw new OQLParserStackOverFlowException($this->m_sSourceQuery, $this->m_iLine, */ #line 37 "..\oql-parser.y" function yy_r0(){ $this->my_result = $this->yystack[$this->yyidx + 0]->minor; } -#line 1488 "..\oql-parser.php" +#line 1490 "..\oql-parser.php" #line 41 "..\oql-parser.y" function yy_r3(){ $this->_retvalue = new OqlUnionQuery($this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor); } -#line 1493 "..\oql-parser.php" +#line 1495 "..\oql-parser.php" #line 48 "..\oql-parser.y" function yy_r5(){ $this->_retvalue = new OqlObjectQuery($this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, $this->yystack[$this->yyidx + -1]->minor, array($this->yystack[$this->yyidx + -2]->minor)); } -#line 1498 "..\oql-parser.php" +#line 1500 "..\oql-parser.php" #line 51 "..\oql-parser.y" function yy_r6(){ $this->_retvalue = new OqlObjectQuery($this->yystack[$this->yyidx + -4]->minor, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, $this->yystack[$this->yyidx + -1]->minor, array($this->yystack[$this->yyidx + -2]->minor)); } -#line 1503 "..\oql-parser.php" +#line 1505 "..\oql-parser.php" #line 55 "..\oql-parser.y" function yy_r7(){ $this->_retvalue = new OqlObjectQuery($this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, $this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + -4]->minor); } -#line 1508 "..\oql-parser.php" +#line 1510 "..\oql-parser.php" #line 58 "..\oql-parser.y" function yy_r8(){ $this->_retvalue = new OqlObjectQuery($this->yystack[$this->yyidx + -4]->minor, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, $this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + -6]->minor); } -#line 1513 "..\oql-parser.php" +#line 1515 "..\oql-parser.php" #line 63 "..\oql-parser.y" function yy_r9(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); } -#line 1518 "..\oql-parser.php" +#line 1520 "..\oql-parser.php" #line 66 "..\oql-parser.y" function yy_r10(){ array_push($this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor); $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor; } -#line 1524 "..\oql-parser.php" +#line 1526 "..\oql-parser.php" #line 71 "..\oql-parser.y" function yy_r11(){ $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; } -#line 1527 "..\oql-parser.php" +#line 1529 "..\oql-parser.php" #line 72 "..\oql-parser.y" function yy_r12(){ $this->_retvalue = null; } -#line 1530 "..\oql-parser.php" +#line 1532 "..\oql-parser.php" #line 74 "..\oql-parser.y" function yy_r13(){ // insert the join statement on top of the existing list @@ -1532,63 +1532,63 @@ throw new OQLParserStackOverFlowException($this->m_sSourceQuery, $this->m_iLine, // and return the updated array $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; } -#line 1538 "..\oql-parser.php" +#line 1540 "..\oql-parser.php" #line 80 "..\oql-parser.y" function yy_r14(){ $this->_retvalue = Array($this->yystack[$this->yyidx + 0]->minor); } -#line 1543 "..\oql-parser.php" +#line 1545 "..\oql-parser.php" #line 86 "..\oql-parser.y" function yy_r16(){ // create an array with one single item $this->_retvalue = new OqlJoinSpec($this->yystack[$this->yyidx + -4]->minor, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor); } -#line 1549 "..\oql-parser.php" +#line 1551 "..\oql-parser.php" #line 91 "..\oql-parser.y" function yy_r17(){ // create an array with one single item $this->_retvalue = new OqlJoinSpec($this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor); } -#line 1555 "..\oql-parser.php" +#line 1557 "..\oql-parser.php" #line 96 "..\oql-parser.y" function yy_r18(){ $this->_retvalue = new BinaryOqlExpression($this->yystack[$this->yyidx + -2]->minor, '=', $this->yystack[$this->yyidx + 0]->minor); } -#line 1558 "..\oql-parser.php" +#line 1560 "..\oql-parser.php" #line 97 "..\oql-parser.y" function yy_r19(){ $this->_retvalue = new BinaryOqlExpression($this->yystack[$this->yyidx + -2]->minor, 'BELOW', $this->yystack[$this->yyidx + 0]->minor); } -#line 1561 "..\oql-parser.php" +#line 1563 "..\oql-parser.php" #line 98 "..\oql-parser.y" function yy_r20(){ $this->_retvalue = new BinaryOqlExpression($this->yystack[$this->yyidx + -2]->minor, 'BELOW_STRICT', $this->yystack[$this->yyidx + 0]->minor); } -#line 1564 "..\oql-parser.php" +#line 1566 "..\oql-parser.php" #line 99 "..\oql-parser.y" function yy_r21(){ $this->_retvalue = new BinaryOqlExpression($this->yystack[$this->yyidx + -2]->minor, 'NOT_BELOW', $this->yystack[$this->yyidx + 0]->minor); } -#line 1567 "..\oql-parser.php" +#line 1569 "..\oql-parser.php" #line 100 "..\oql-parser.y" function yy_r22(){ $this->_retvalue = new BinaryOqlExpression($this->yystack[$this->yyidx + -2]->minor, 'NOT_BELOW_STRICT', $this->yystack[$this->yyidx + 0]->minor); } -#line 1570 "..\oql-parser.php" +#line 1572 "..\oql-parser.php" #line 101 "..\oql-parser.y" function yy_r23(){ $this->_retvalue = new BinaryOqlExpression($this->yystack[$this->yyidx + -2]->minor, 'ABOVE', $this->yystack[$this->yyidx + 0]->minor); } -#line 1573 "..\oql-parser.php" +#line 1575 "..\oql-parser.php" #line 102 "..\oql-parser.y" function yy_r24(){ $this->_retvalue = new BinaryOqlExpression($this->yystack[$this->yyidx + -2]->minor, 'ABOVE_STRICT', $this->yystack[$this->yyidx + 0]->minor); } -#line 1576 "..\oql-parser.php" +#line 1578 "..\oql-parser.php" #line 103 "..\oql-parser.y" function yy_r25(){ $this->_retvalue = new BinaryOqlExpression($this->yystack[$this->yyidx + -2]->minor, 'NOT_ABOVE', $this->yystack[$this->yyidx + 0]->minor); } -#line 1579 "..\oql-parser.php" +#line 1581 "..\oql-parser.php" #line 104 "..\oql-parser.y" function yy_r26(){ $this->_retvalue = new BinaryOqlExpression($this->yystack[$this->yyidx + -2]->minor, 'NOT_ABOVE_STRICT', $this->yystack[$this->yyidx + 0]->minor); } -#line 1582 "..\oql-parser.php" +#line 1584 "..\oql-parser.php" #line 106 "..\oql-parser.y" function yy_r27(){ $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; } -#line 1585 "..\oql-parser.php" +#line 1587 "..\oql-parser.php" #line 111 "..\oql-parser.y" function yy_r31(){ $this->_retvalue = new FunctionOqlExpression($this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + -1]->minor); } -#line 1588 "..\oql-parser.php" +#line 1590 "..\oql-parser.php" #line 112 "..\oql-parser.y" function yy_r32(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; } -#line 1591 "..\oql-parser.php" +#line 1593 "..\oql-parser.php" #line 113 "..\oql-parser.y" function yy_r33(){ $this->_retvalue = new BinaryOqlExpression($this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + 0]->minor); } -#line 1594 "..\oql-parser.php" +#line 1596 "..\oql-parser.php" #line 119 "..\oql-parser.y" function yy_r37(){ if ($this->yystack[$this->yyidx + -1]->minor == 'MATCHES') @@ -1600,43 +1600,43 @@ throw new OQLParserStackOverFlowException($this->m_sSourceQuery, $this->m_iLine, $this->_retvalue = new BinaryOqlExpression($this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + 0]->minor); } } -#line 1606 "..\oql-parser.php" +#line 1608 "..\oql-parser.php" #line 136 "..\oql-parser.y" function yy_r42(){ $this->_retvalue = new ListOqlExpression($this->yystack[$this->yyidx + -1]->minor); } -#line 1611 "..\oql-parser.php" +#line 1613 "..\oql-parser.php" #line 139 "..\oql-parser.y" function yy_r43(){ $this->_retvalue = new NestedQueryOqlExpression($this->yystack[$this->yyidx + -1]->minor); } -#line 1616 "..\oql-parser.php" +#line 1618 "..\oql-parser.php" #line 154 "..\oql-parser.y" function yy_r47(){ $this->_retvalue = array(); } -#line 1621 "..\oql-parser.php" +#line 1623 "..\oql-parser.php" #line 165 "..\oql-parser.y" function yy_r51(){ $this->_retvalue = new IntervalOqlExpression($this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + 0]->minor); } -#line 1624 "..\oql-parser.php" +#line 1626 "..\oql-parser.php" #line 178 "..\oql-parser.y" function yy_r61(){ $this->_retvalue = new ScalarOqlExpression($this->yystack[$this->yyidx + 0]->minor); } -#line 1627 "..\oql-parser.php" +#line 1629 "..\oql-parser.php" #line 180 "..\oql-parser.y" function yy_r63(){ $this->_retvalue = new ScalarOqlExpression(null); } -#line 1630 "..\oql-parser.php" +#line 1632 "..\oql-parser.php" #line 182 "..\oql-parser.y" function yy_r64(){ $this->_retvalue = new FieldOqlExpression($this->yystack[$this->yyidx + 0]->minor); } -#line 1633 "..\oql-parser.php" +#line 1635 "..\oql-parser.php" #line 183 "..\oql-parser.y" function yy_r65(){ $this->_retvalue = new FieldOqlExpression($this->yystack[$this->yyidx + 0]->minor, $this->yystack[$this->yyidx + -2]->minor); } -#line 1636 "..\oql-parser.php" +#line 1638 "..\oql-parser.php" #line 184 "..\oql-parser.y" function yy_r66(){ $this->_retvalue=$this->yystack[$this->yyidx + 0]->minor; } -#line 1639 "..\oql-parser.php" +#line 1641 "..\oql-parser.php" #line 187 "..\oql-parser.y" function yy_r67(){ $this->_retvalue = new VariableOqlExpression(substr($this->yystack[$this->yyidx + 0]->minor, 1)); } -#line 1642 "..\oql-parser.php" +#line 1644 "..\oql-parser.php" #line 189 "..\oql-parser.y" function yy_r68(){ if ($this->yystack[$this->yyidx + 0]->minor[0] == '`') @@ -1649,22 +1649,22 @@ throw new OQLParserStackOverFlowException($this->m_sSourceQuery, $this->m_iLine, } $this->_retvalue = new OqlName($name, $this->m_iColPrev); } -#line 1655 "..\oql-parser.php" +#line 1657 "..\oql-parser.php" #line 200 "..\oql-parser.y" function yy_r69(){$this->_retvalue=(int)$this->yystack[$this->yyidx + 0]->minor; } -#line 1658 "..\oql-parser.php" +#line 1660 "..\oql-parser.php" #line 201 "..\oql-parser.y" function yy_r70(){$this->_retvalue=(int)-$this->yystack[$this->yyidx + 0]->minor; } -#line 1661 "..\oql-parser.php" +#line 1663 "..\oql-parser.php" #line 202 "..\oql-parser.y" function yy_r71(){$this->_retvalue=new OqlHexValue($this->yystack[$this->yyidx + 0]->minor); } -#line 1664 "..\oql-parser.php" +#line 1666 "..\oql-parser.php" #line 203 "..\oql-parser.y" function yy_r72(){$this->_retvalue=stripslashes(substr($this->yystack[$this->yyidx + 0]->minor, 1, strlen($this->yystack[$this->yyidx + 0]->minor) - 2)); } -#line 1667 "..\oql-parser.php" +#line 1669 "..\oql-parser.php" #line 206 "..\oql-parser.y" function yy_r73(){$this->_retvalue=$this->yystack[$this->yyidx + 0]->minor; } -#line 1670 "..\oql-parser.php" +#line 1672 "..\oql-parser.php" /** * placeholder for the left hand side in a reduce operation. @@ -1768,7 +1768,7 @@ throw new OQLParserStackOverFlowException($this->m_sSourceQuery, $this->m_iLine, #line 33 "..\oql-parser.y" throw new OQLParserParseFailureException($this->m_sSourceQuery, $this->m_iLine, $this->m_iCol); -#line 1775 "..\oql-parser.php" +#line 1777 "..\oql-parser.php" } /** @@ -1783,7 +1783,7 @@ throw new OQLParserParseFailureException($this->m_sSourceQuery, $this->m_iLine, #line 25 "..\oql-parser.y" throw new OQLParserSyntaxErrorException($this->m_sSourceQuery, $this->m_iLine, $this->m_iCol, $this->tokenName($yymajor), $TOKEN); -#line 1791 "..\oql-parser.php" +#line 1793 "..\oql-parser.php" } /** @@ -2043,4 +2043,4 @@ class OQLParser extends OQLParserRaw } } -#line 2052 "..\oql-parser.php" +#line 2054 "..\oql-parser.php" diff --git a/datamodels/2.x/itop-core-update/dictionaries/cs.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/cs.dict.itop-core-update.php index 3d0f5521d..f9816ce58 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/cs.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/cs.dict.itop-core-update.php @@ -67,6 +67,7 @@ Dict::Add('CS CZ', 'Czech', 'Čeština', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunch' => 'Launch '.ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunchConfirm' => 'This will launch '.ITOP_APPLICATION_SHORT.' setup, are you sure?~~', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Database backup~~', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Check application upgrade~~', 'iTopUpdate:UI:SetupMessage:Compile' => 'Upgrade application~~', diff --git a/datamodels/2.x/itop-core-update/dictionaries/da.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/da.dict.itop-core-update.php index f09f5d441..321ebb88a 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/da.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/da.dict.itop-core-update.php @@ -67,6 +67,7 @@ Dict::Add('DA DA', 'Danish', 'Dansk', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunch' => 'Launch '.ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunchConfirm' => 'This will launch '.ITOP_APPLICATION_SHORT.' setup, are you sure?~~', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Database backup~~', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Check application upgrade~~', 'iTopUpdate:UI:SetupMessage:Compile' => 'Upgrade application~~', diff --git a/datamodels/2.x/itop-core-update/dictionaries/de.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/de.dict.itop-core-update.php index 46484382a..8c4aaaaf9 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/de.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/de.dict.itop-core-update.php @@ -67,6 +67,7 @@ Dict::Add('DE DE', 'German', 'Deutsch', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup', 'iTopUpdate:UI:SetupLaunch' => 'Starte '.ITOP_APPLICATION_SHORT.' Setup', 'iTopUpdate:UI:SetupLaunchConfirm' => 'Hiermit wird der '.ITOP_APPLICATION_SHORT.' Setup, sind Sie sicher?', + 'iTopUpdate:UI:FastSetupLaunch' => 'Schnelles Setup', 'iTopUpdate:UI:SetupMessage:Backup' => 'Datenbankbackup', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Prüfung des Anwendungsupgrades', 'iTopUpdate:UI:SetupMessage:Compile' => 'Upgrade von Anwendung und Datenbank', diff --git a/datamodels/2.x/itop-core-update/dictionaries/en.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/en.dict.itop-core-update.php index 6b0f0b62d..1d41b246a 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/en.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/en.dict.itop-core-update.php @@ -83,6 +83,7 @@ Dict::Add('EN US', 'English', 'English', array( 'iTopUpdate:UI:SetupLaunch' => 'Launch '.ITOP_APPLICATION_SHORT.' Setup', 'iTopUpdate:UI:SetupLaunchConfirm' => 'This will launch '.ITOP_APPLICATION_SHORT.' setup, are you sure?', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup', // Setup Messages 'iTopUpdate:UI:SetupMessage:Ready' => 'Ready to start', diff --git a/datamodels/2.x/itop-core-update/dictionaries/es_cr.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/es_cr.dict.itop-core-update.php index 293e47fae..603707083 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/es_cr.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/es_cr.dict.itop-core-update.php @@ -68,6 +68,7 @@ Dict::Add('ES CR', 'Spanish', 'Español, Castellano', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunch' => 'Launch '.ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunchConfirm' => 'This will launch '.ITOP_APPLICATION_SHORT.' setup, are you sure?~~', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Respaldo de base de datos', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Revisar actualización de aplicación', 'iTopUpdate:UI:SetupMessage:Compile' => 'Actualizar aplicación y base de datos', diff --git a/datamodels/2.x/itop-core-update/dictionaries/fr.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/fr.dict.itop-core-update.php index 5ba2551b6..1ec33722f 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/fr.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/fr.dict.itop-core-update.php @@ -66,6 +66,7 @@ Dict::Add('FR FR', 'French', 'Français', [ 'iTopUpdate:UI:ServerFile' => 'Chemin d\'un package présent sur le serveur', 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup', 'iTopUpdate:UI:SetupLaunch' => 'Lancer le Setup', + 'iTopUpdate:UI:FastSetupLaunch' => 'Setup rapide', 'iTopUpdate:UI:SetupLaunchConfirm' => 'This will launch '.ITOP_APPLICATION_SHORT.' setup, are you sure?', 'iTopUpdate:UI:SetupMessage:Backup' => 'Sauvegarde des fichiers de l\'application', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Contrôle de la mise à jour', diff --git a/datamodels/2.x/itop-core-update/dictionaries/hu.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/hu.dict.itop-core-update.php index 23f95f6d6..946c564cd 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/hu.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/hu.dict.itop-core-update.php @@ -67,6 +67,7 @@ Dict::Add('HU HU', 'Hungarian', 'Magyar', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunch' => 'Launch '.ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunchConfirm' => 'This will launch '.ITOP_APPLICATION_SHORT.' setup, are you sure?~~', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Adatbázis biztonsági mentése', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Alkalmazásfrissítés ellenőrzése', 'iTopUpdate:UI:SetupMessage:Compile' => 'Az alkalmazás és az adatbázis frissítése', diff --git a/datamodels/2.x/itop-core-update/dictionaries/it.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/it.dict.itop-core-update.php index 472599580..80d6d1b9c 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/it.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/it.dict.itop-core-update.php @@ -67,6 +67,7 @@ Dict::Add('IT IT', 'Italian', 'Italiano', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup', 'iTopUpdate:UI:SetupLaunch' => 'Avvia '.ITOP_APPLICATION_SHORT.' Setup', 'iTopUpdate:UI:SetupLaunchConfirm' => 'Questo avvierà '.ITOP_APPLICATION_SHORT.' setup, sei sicuro?', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Backup del Database', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Verifica aggiornamento dell\'applicazione', 'iTopUpdate:UI:SetupMessage:Compile' => 'Aggiornamento dell\'applicazione e del database', diff --git a/datamodels/2.x/itop-core-update/dictionaries/ja.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/ja.dict.itop-core-update.php index 880b4a562..95931272f 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/ja.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/ja.dict.itop-core-update.php @@ -67,6 +67,7 @@ Dict::Add('JA JP', 'Japanese', '日本語', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunch' => 'Launch '.ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunchConfirm' => 'This will launch '.ITOP_APPLICATION_SHORT.' setup, are you sure?~~', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Database backup~~', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Check application upgrade~~', 'iTopUpdate:UI:SetupMessage:Compile' => 'Upgrade application~~', diff --git a/datamodels/2.x/itop-core-update/dictionaries/nl.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/nl.dict.itop-core-update.php index b3b8e24c8..36634d7af 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/nl.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/nl.dict.itop-core-update.php @@ -69,6 +69,7 @@ Dict::Add('NL NL', 'Dutch', 'Nederlands', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' setup', 'iTopUpdate:UI:SetupLaunch' => 'Start de '.ITOP_APPLICATION_SHORT.' setup', 'iTopUpdate:UI:SetupLaunchConfirm' => 'Dit zal de '.ITOP_APPLICATION_SHORT.' setup uitvoeren, ben je zeker?', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Maken van backup database', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Controleren van de upgrade van de toepassing', 'iTopUpdate:UI:SetupMessage:Compile' => 'Upgraden van toepassing en database', diff --git a/datamodels/2.x/itop-core-update/dictionaries/pl.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/pl.dict.itop-core-update.php index 19734ed72..bf9b6cbf6 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/pl.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/pl.dict.itop-core-update.php @@ -68,6 +68,7 @@ Dict::Add('PL PL', 'Polish', 'Polski', [ 'iTopUpdate:UI:Setup' => 'Konfiguracja '.ITOP_APPLICATION_SHORT, 'iTopUpdate:UI:SetupLaunch' => 'Uruchom konfigurację '.ITOP_APPLICATION_SHORT, 'iTopUpdate:UI:SetupLaunchConfirm' => 'Zostanie uruchomiona '.ITOP_APPLICATION_SHORT.' konfiguracja, jesteś pewien?', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Kopia zapasowa bazy danych', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Sprawdzenie aktualizacji aplikacji', 'iTopUpdate:UI:SetupMessage:Compile' => 'Aktualizacja aplikacji', diff --git a/datamodels/2.x/itop-core-update/dictionaries/pt_br.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/pt_br.dict.itop-core-update.php index db40220a2..bc471c832 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/pt_br.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/pt_br.dict.itop-core-update.php @@ -68,6 +68,7 @@ Dict::Add('PT BR', 'Brazilian', 'Brazilian', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunch' => 'Launch '.ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunchConfirm' => 'This will launch '.ITOP_APPLICATION_SHORT.' setup, are you sure?~~', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Backup do banco de dados', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Verificar atualização da aplicação', 'iTopUpdate:UI:SetupMessage:Compile' => 'Atualizar aplicação e banco de dados', diff --git a/datamodels/2.x/itop-core-update/dictionaries/ru.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/ru.dict.itop-core-update.php index eeea1203c..10aee87f3 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/ru.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/ru.dict.itop-core-update.php @@ -68,6 +68,7 @@ Dict::Add('RU RU', 'Russian', 'Русский', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunch' => 'Launch '.ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunchConfirm' => 'This will launch '.ITOP_APPLICATION_SHORT.' setup, are you sure?~~', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Резервное копирование базы данных', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Проверка обновления', 'iTopUpdate:UI:SetupMessage:Compile' => 'Обновление приложения', diff --git a/datamodels/2.x/itop-core-update/dictionaries/sk.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/sk.dict.itop-core-update.php index 6e6152bc6..28d32c7a0 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/sk.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/sk.dict.itop-core-update.php @@ -67,6 +67,7 @@ Dict::Add('SK SK', 'Slovak', 'Slovenčina', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunch' => 'Launch '.ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunchConfirm' => 'This will launch '.ITOP_APPLICATION_SHORT.' setup, are you sure?~~', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Database backup~~', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Check application upgrade~~', 'iTopUpdate:UI:SetupMessage:Compile' => 'Upgrade application~~', diff --git a/datamodels/2.x/itop-core-update/dictionaries/tr.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/tr.dict.itop-core-update.php index 31cbde266..822ed6292 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/tr.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/tr.dict.itop-core-update.php @@ -67,6 +67,7 @@ Dict::Add('TR TR', 'Turkish', 'Türkçe', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunch' => 'Launch '.ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunchConfirm' => 'This will launch '.ITOP_APPLICATION_SHORT.' setup, are you sure?~~', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Database backup~~', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Check application upgrade~~', 'iTopUpdate:UI:SetupMessage:Compile' => 'Upgrade application~~', diff --git a/datamodels/2.x/itop-core-update/dictionaries/zh_cn.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/zh_cn.dict.itop-core-update.php index 45be58cfe..3ca3d6575 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/zh_cn.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/zh_cn.dict.itop-core-update.php @@ -67,6 +67,7 @@ Dict::Add('ZH CN', 'Chinese', '简体中文', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.'安装', 'iTopUpdate:UI:SetupLaunch' => '启动'.ITOP_APPLICATION_SHORT.'安装', 'iTopUpdate:UI:SetupLaunchConfirm' => '将启动'.ITOP_APPLICATION_SHORT.'安装, 确定吗?', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => '数据库备份', 'iTopUpdate:UI:SetupMessage:CheckCompile' => '检查更新', 'iTopUpdate:UI:SetupMessage:Compile' => '升级应用程序和数据库', diff --git a/datamodels/2.x/itop-core-update/src/Controller/AjaxController.php b/datamodels/2.x/itop-core-update/src/Controller/AjaxController.php index 6cbfd9ddf..6199dcab5 100644 --- a/datamodels/2.x/itop-core-update/src/Controller/AjaxController.php +++ b/datamodels/2.x/itop-core-update/src/Controller/AjaxController.php @@ -7,17 +7,20 @@ namespace Combodo\iTop\CoreUpdate\Controller; +require_once APPROOT.'setup/runtimeenv.class.inc.php'; use Combodo\iTop\Application\TwigBase\Controller\Controller; use Combodo\iTop\CoreUpdate\Service\CoreUpdater; use Combodo\iTop\DBTools\Service\DBToolsUtils; use Combodo\iTop\FilesInformation\Service\FileNotExistException; use Combodo\iTop\FilesInformation\Service\FilesInformation; +use Config; use ContextTag; use Dict; use Exception; use IssueLog; use MetaModel; +use RunTimeEnvironment; use SecurityException; use SetupUtils; use utils; @@ -258,6 +261,30 @@ class AjaxController extends Controller $this->DisplayJSONPage($aParams, $iResponseCode); } + function OperationRebuildToolkitEnvironment() + { + $sTransactionId = utils::GetNewTransactionId(); + $aParams = []; + $aParams['sTransactionId'] = $sTransactionId; + $aParams['bStatus'] = true; + + $iResponseCode = 200; + try { + $aParams['sAjaxURL'] = utils::GetAbsoluteUrlAppRoot().'/pages/UI.php'; + $oConfig = new Config(APPCONF.'production'.'/'.ITOP_CONFIG_FILE); + $oEnvironment = new RunTimeEnvironment('production'); + $oEnvironment->WriteConfigFileSafe($oConfig); + $oEnvironment->CompileFrom('production'); + } + catch (Exception $e) { + IssueLog::Error('RebuildToolkitEnvironment: '.$e->getMessage()); + $aParams['sError'] = $e->getMessage(); + $iResponseCode = 500; + $aParams['bStatus'] = false; + } + $this->DisplayJSONPage($aParams, $iResponseCode); + } + /** * @throws \SecurityException if CSRF token invalid * diff --git a/datamodels/2.x/itop-core-update/templates/SelectUpdateFile.html.twig b/datamodels/2.x/itop-core-update/templates/SelectUpdateFile.html.twig index 5b3deddee..33d68114e 100644 --- a/datamodels/2.x/itop-core-update/templates/SelectUpdateFile.html.twig +++ b/datamodels/2.x/itop-core-update/templates/SelectUpdateFile.html.twig @@ -90,6 +90,13 @@ {% UIForm Standard {'sId':'launch-setup-form', Action:sLaunchSetupUrl} %} {% UIButton ForDestructiveAction {'sLabel':'iTopUpdate:UI:SetupLaunch'|dict_s, 'sName':'launch-setup', 'sValue':'launch-setup', 'bIsSubmit':true, 'sId':'launch-setup'} %} {% EndUIForm %} + {% UIAlert ForInformation {sId:'fast-setup-alert', AddCSSClass:'ibo-is-hidden'} %} + {% UIContentBlock Standard {sId:'fast-setup-content', aContainerClasses:['ibo-fast-setup-content']} %} + {{ 'iTopUpdate:UI:SetupMessage:Compile'|dict_s }} + {% EndUIContentBlock %} + {% EndUIAlert %} + {% UIButton ForDestructiveAction {sLabel:'iTopUpdate:UI:FastSetupLaunch'|dict_s, sName:'launch-fast-setup', sValue:'launch-fast-setup', sId:'launch-fast-setup'} %} + {% UISpinner Standard {sId:'fast-setup-wait', IsHidden:true} %} {% EndUIFieldSet %} {% endif %} diff --git a/datamodels/2.x/itop-core-update/templates/SelectUpdateFile.ready.js.twig b/datamodels/2.x/itop-core-update/templates/SelectUpdateFile.ready.js.twig index 40232213e..1e731f6c4 100644 --- a/datamodels/2.x/itop-core-update/templates/SelectUpdateFile.ready.js.twig +++ b/datamodels/2.x/itop-core-update/templates/SelectUpdateFile.ready.js.twig @@ -114,4 +114,42 @@ $("#check-update").on("click", function(e) { $("#launch-setup-form").on("submit", function () { return window.confirm("{{ 'iTopUpdate:UI:SetupLaunchConfirm'|dict_s }}"); -}); \ No newline at end of file +}); + +$("#launch-fast-setup").on("click", function(e) { + var oMessage = $("#fast-setup-alert"); + var oContent = $("#fast-setup-content"); + oMessage.removeClass("ibo-is-hidden"); + oMessage.addClass("ibo-is-information"); + oContent.html("{{ 'iTopUpdate:UI:SetupMessage:Compile'|dict_s }}"); + + let fast_setup_wait = $("#fast-setup-wait"); + fast_setup_wait.removeClass("ibo-is-hidden"); + $(this).prop("disabled", true); + + $.ajax({ + method: "POST", + url: "{{ sAjaxURL|raw }}", + data: { + route: "core_update_ajax.rebuild_toolkit_environment" + }, + dataType: "json", + success: function (data) { + oMessage.removeClass("ibo-is-information"); + + if (data.bStatus) { + oMessage.addClass("ibo-is-success"); + oContent.html("{{ 'iTopUpdate:UI:SetupMessage:UpdateDone'|dict_s }}"); + } else { + oMessage.addClass("ibo-is-failure"); + oContent.html(data.sError); + } + + $("#fast-setup-wait").addClass("ibo-is-hidden"); + $("#launch-fast-setup").prop("disabled", false); + fast_setup_wait.addClass("ibo-is-hidden"); + } + }); + +}); + diff --git a/tests/php-unit-tests/src/BaseTestCase/ItopDataTestCase.php b/tests/php-unit-tests/src/BaseTestCase/ItopDataTestCase.php index 8502e52fd..c682070cf 100644 --- a/tests/php-unit-tests/src/BaseTestCase/ItopDataTestCase.php +++ b/tests/php-unit-tests/src/BaseTestCase/ItopDataTestCase.php @@ -151,6 +151,10 @@ abstract class ItopDataTestCase extends ItopTestCase static::SetNonPublicStaticProperty(\cmdbAbstractObject::class, 'aObjectsAwaitingEventDbLinksChanged', []); \cmdbAbstractObject::SetEventDBLinksChangedBlocked(false); + // disconnection before object deletions. make sure to have enough rights to proceed (especially with user object) + if (UserRights::IsLoggedIn()) { + UserRights::Logoff(); + } if (static::USE_TRANSACTION) { $this->debug("ROLLBACK !!!"); CMDBSource::Query('ROLLBACK'); @@ -175,10 +179,6 @@ abstract class ItopDataTestCase extends ItopTestCase // As soon as a rollback has been performed, each object memoized should be discarded CMDBObject::SetCurrentChange(null); - // Leave the place clean - if (UserRights::IsLoggedIn()) { - UserRights::Logoff(); - } $this->SetNonPublicStaticProperty(UserRights::class, 'm_aCacheUsers', []); // we could have cached rollbacked instances if ($this->bIsUsingSilo) { $this->ResetMetaModelQueyCacheGetObject();