Compare commits

..

262 Commits

Author SHA1 Message Date
Anne-Cath
891a7bcbdd N°7326 - JS error in editing object when a tab with list is deleted 2025-03-17 11:17:25 +01:00
Anne-Cath
60e54e6160 N°7326 - JS error in editing object when a tab with list is deleted 2025-03-17 11:17:20 +01:00
Tommaso Rossi
9a895a7fbd 🐛 N°8115 - Unattended Install: unable to connect to MySQL with TLS (#694)
🐛 Support TLS connections to MySQL in unattended-install process
2025-03-13 15:59:04 +01:00
jf-cbd
f5011bb200 N°8260 - Change format of REST logs when they are close to the SQL field size limit 2025-03-13 15:39:00 +01:00
jf-cbd
29c75f626b N°8259 - Problem with GetMaxSize on AttributeText 2025-03-13 15:29:00 +01:00
jf-cbd
0562563cbb Dump autoloader 2025-03-12 11:51:59 +01:00
jf-cbd
40068bd913 Merge remote-tracking branch 'origin/support/2.7' into support/3.2
# Conflicts:
#	lib/composer/autoload_classmap.php
#	lib/composer/autoload_static.php
2025-03-12 11:47:33 +01:00
jf-cbd
874a5fd2ce Dump autoloader 2025-03-12 11:36:06 +01:00
jf-cbd
1ec139782e Merge remote-tracking branch 'origin/support/3.1' into support/3.2 2025-03-06 16:24:40 +01:00
jf-cbd
056dce4d78 Merge remote-tracking branch 'origin/support/2.7' into support/3.1
# Conflicts:
#	webservices/rest.php
2025-03-06 16:12:15 +01:00
jf-cbd
063bb9680e N°8231 - Better variable fallback 2025-03-06 16:09:51 +01:00
jf-cbd
9b1395db03 Workaround for N°4459 doesn't work on 3.2 2025-03-06 15:23:38 +01:00
jf-cbd
8fd9eb6a84 Merge remote-tracking branch 'origin/support/3.1' into support/3.2 2025-03-06 14:58:24 +01:00
jf-cbd
1142bf327c Fix tests 2025-03-06 14:54:18 +01:00
jf-cbd
278496eaf6 Update tests for 3.1 2025-03-06 14:40:39 +01:00
jf-cbd
77ba0b398f Fix merge conflict 2025-03-06 12:11:20 +01:00
jf-cbd
04ca7bf603 Merge remote-tracking branch 'origin/support/2.7' into support/3.1
# Conflicts:
#	core/restservices.class.inc.php
#	datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php
#	tests/php-unit-tests/unitary-tests/core/Delta/delta_test_sanitize_output.xml
#	tests/php-unit-tests/unitary-tests/core/RestServicesSanitizeOutputTest.php
#	tests/php-unit-tests/unitary-tests/core/RestServicesTest.php
#	webservices/rest.php
2025-03-06 12:10:00 +01:00
jf-cbd
8f8ac46f55 N°8215 - When PHP warning are enabled, Global Request doesn't work 2025-03-06 11:59:08 +01:00
denis.flaven@combodo.com
07b904ee1b N°8231 - making rest api logs more readable 2025-03-06 11:59:08 +01:00
Eric Espie
5aee7f4722 N°8242 - When editing a dashboard the parameters do not refresh as expected 2025-03-05 11:02:19 +01:00
Eric Espie
292701b71c N°8242 - When editing a dashboard the parameters do not refresh as expected 2025-03-04 16:51:58 +01:00
jf-cbd
533b57ab99 Merge branch 'support/3.1' into support/3.2 2025-03-03 17:07:24 +01:00
jf-cbd
be8d348b25 N°8231 - Update tests 2025-03-03 16:49:27 +01:00
jf-cbd
6c7a98fe3d Merge remote-tracking branch 'origin/support/2.7' into support/3.1 2025-03-03 16:38:32 +01:00
denis.flaven@combodo.com
ec2203229b N°8231 - making rest api log more readable 2025-03-03 16:23:25 +01:00
jf-cbd
2f699d355a Merge remote-tracking branch 'origin/support/3.1' into support/3.2 2025-03-03 14:37:57 +01:00
jf-cbd
da4457f5b4 Merge remote-tracking branch 'origin/support/2.7' into support/3.1 2025-03-03 14:36:50 +01:00
denis.flaven@combodo.com
97848cea4f N°8231 - making rest api log more readable 2025-03-03 11:38:52 +01:00
jf-cbd
2ccd883c9a 👥 Update contributor list 2025-02-25 11:38:54 +01:00
jf-cbd
eabd68ff77 👥 Update contributor list 2025-02-25 11:38:14 +01:00
jf-cbd
2b493787b1 Update itop-version-history.md with 2.7.12, 3.1.3 and 3.2.1 2025-02-25 09:19:47 +01:00
jf-cbd
d74c850621 N°7870 - Tests: access the symfony service container to instantiate services 2025-02-21 15:28:38 +01:00
jf-cbd
4e575e17a3 Merge remote-tracking branch 'origin/support/3.1' into support/3.2 2025-02-21 13:23:57 +01:00
jf-cbd
94d6eca0c1 N°8215 - When PHP warning are enabled, Global Request doesn't work 2025-02-21 13:20:27 +01:00
jf-cbd
355da8ec0a Merge remote-tracking branch 'origin/support/2.7' into support/3.1
# Conflicts:
#	datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php
2025-02-21 13:18:19 +01:00
jf-cbd
5f006c45db N°8215 - When PHP warning are enabled, Global Request doesn't work 2025-02-21 13:16:07 +01:00
Eric Espie
a9bc4973b4 N°8139 - Fix ApplyStimulus during post update 2025-02-07 17:24:43 +01:00
Timothee
e93d909a38 🌐 Dictionaries update 2025-02-07 15:36:58 +01:00
Eric Espie
14346e0895 N°8139 - Avoid double writing in lifecycle action 2025-02-07 11:10:14 +01:00
Eric Espie
6985e366c2 N°8139 - Avoid double writing in lifecycle action 2025-02-07 10:58:13 +01:00
denis.flaven@combodo.com
cf57549370 Merge branch 'support/3.1' into support/3.2 2025-02-07 10:29:24 +01:00
denis.flaven@combodo.com
46aaeb4301 Merge branch 'support/2.7' into support/3.1 2025-02-07 10:24:18 +01:00
Eric Espie
7ddc593869 🔊 enhance crud logs 2025-02-07 10:14:39 +01:00
denis.flaven@combodo.com
affed69999 Version number bump. 2025-02-07 10:09:48 +01:00
jf-cbd
695f357054 N°8170 - Issue with Ckeditor and precanned reply
N°8152 - CKEditor : Style and list button are the same
2025-02-06 17:11:53 +01:00
Eric Espie
0088580798 Better specific delta detection for tests 2025-02-05 17:40:57 +01:00
Ben
f6298370a7 Adding new modules 2025-02-04 11:56:32 +01:00
jf-cbd
bd6ccc55f8 N°8150 - Better picture checking 2025-02-04 10:49:54 +01:00
XGUI
3a497524dc N°8129 - Fix unexpected identifier self 2025-02-04 10:48:28 +01:00
denis.flaven@combodo.com
4c1da328ce Merge support/3.1 into support/3.2 2025-01-31 17:20:33 +01:00
denis.flaven@combodo.com
64a216e0f6 Merge branch 'support/2.7' into support/3.1 2025-01-31 17:13:09 +01:00
denis.flaven@combodo.com
d5754fc568 N°8135 - Bump datamodel version. 2025-01-31 17:04:56 +01:00
XGUI
5851b2e1ff N°8129 - Fix missing namespace backslash 2025-01-30 15:06:00 +01:00
XGUI
803ebfbe33 N°8129 - Dont crash if date/time default value has a bad format 2025-01-30 14:14:31 +01:00
odain
d12c8a183c N°8143 - Setup page in error in support.combodo.com 2025-01-30 11:16:07 +01:00
Anne-Cath
7bbd4b4726 N°8144 - Issue using Organization filtering box 2025-01-30 10:10:36 +01:00
odain
c8754725b0 N°8143 - Setup page in error in support.combodo.com 2025-01-29 16:42:43 +01:00
Eric Espie
a3c911e93e N°8139 - Avoid double writing in lifecycle action 2025-01-29 09:32:21 +01:00
Eric Espie
38e0fb27f1 N°8131 - Issue on DBlinkchange event when object is deleted 2025-01-28 11:12:11 +01:00
Eric Espie
4b4197d910 N°8131 - Issue on DBlinkchange event when object is deleted 2025-01-28 11:09:31 +01:00
jf-cbd
c5189b7d33 N°8134 - Fix import after merge 2025-01-28 10:52:29 +01:00
jf-cbd
b0288bc08e Merge remote-tracking branch 'origin/support/3.1' into support/3.2
# Conflicts:
#	datamodels/2.x/itop-portal-base/portal/src/Controller/UserProfileBrickController.php
2025-01-28 10:44:35 +01:00
Eric Espie
52097f5e12 N°8131 - Issue on DBlinkchange event when object is deleted 2025-01-28 10:33:11 +01:00
jf-cbd
ccb1ca9d79 Merge remote-tracking branch 'origin/support/2.7' into support/3.1 2025-01-28 10:32:18 +01:00
jf-cbd
44290db312 N°8134 - Portal user profile is broken, regression from 7776 2025-01-28 10:23:44 +01:00
Eric Espie
65e49e2139 N°8139 - Avoid double writing in lifecycle action 2025-01-27 17:34:46 +01:00
Eric Espie
b1bf89807d Add CRUD logs 2025-01-27 15:06:11 +01:00
Eric Espie
39c59f46fd Merge remote-tracking branch 'origin/support/3.1' into support/3.2 2025-01-24 14:35:48 +01:00
Eric Espie
025af923ea N°8131 - Issue on DBlinkchange event when object is delete 2025-01-24 14:23:50 +01:00
Eric Espie
c2aecad9d2 Merge remote-tracking branch 'origin/support/3.1' into support/3.2 2025-01-24 12:06:49 +01:00
v-dumas
986e900a99 N°7145 - Inline & Attachment add default expire for MailToTicket 2025-01-24 12:03:16 +01:00
Eric Espie
858b12abaa N°8131 - Issue on DBlinkchange event when object is delete 2025-01-24 11:59:51 +01:00
Stephen Abello
bd93879ac4 Add yellow and purple SCSS variables 2025-01-23 11:27:36 +01:00
Timmy38
133a4a8533 N°8113 Fix global organization filter (#699) 2025-01-23 10:04:02 +01:00
Eric Espie
1163a20cdd Merge remote-tracking branch 'origin/support/3.1' into support/3.2
# Conflicts:
#	application/cmdbabstract.class.inc.php
2025-01-22 16:44:12 +01:00
Eric Espie
a7bc4bd411 Add new measure points for KPI logger 2025-01-22 16:34:31 +01:00
Benjamin Dalsass
6f3fddf9bf N°8122 - View or edit an object in portal in a new tab no more possible 2025-01-22 14:15:23 +01:00
jf-cbd
470f145747 N°6284 - fix regex 2025-01-21 17:41:53 +01:00
Timmy38
2852d8ce49 N°7662 Allowing indentation and de-indentation (#698) 2025-01-21 17:12:43 +01:00
jf-cbd
7e9a95fe93 Merge remote-tracking branch 'origin/support/3.1' into support/3.2
# Conflicts:
#	datamodels/2.x/itop-portal-base/portal/src/Controller/UserProfileBrickController.php
2025-01-21 16:55:04 +01:00
jf-cbd
a07f66c061 Merge remote-tracking branch 'origin/support/2.7' into support/3.1 2025-01-21 16:48:33 +01:00
jf-cbd
c49ceae75e Fix HandleForm call 2025-01-21 16:46:15 +01:00
jf-cbd
80244e2797 Merge remote-tracking branch 'origin/support/3.1' into support/3.2 2025-01-21 13:48:12 +01:00
jf-cbd
4da975cb64 Merge remote-tracking branch 'origin/support/2.7' into support/3.1 2025-01-21 12:15:06 +01:00
jf-cbd
8980f627e9 Fix format 2025-01-21 12:09:06 +01:00
jf-cbd
5ce1788d4a N°7776 remove twig from ajax calls, 3.2 edition 2025-01-20 16:34:46 +01:00
jf-cbd
38fe31c9fc Merge remote-tracking branch 'origin/support/3.1' into support/3.2
# Conflicts:
#	datamodels/2.x/itop-portal-base/portal/src/Controller/UserProfileBrickController.php
#	datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php
2025-01-20 16:33:35 +01:00
jf-cbd
ec61b52238 N°7776 remove twig from ajax calls, 3.1 edition 2025-01-20 16:02:26 +01:00
jf-cbd
072596a53b Merge remote-tracking branch 'origin/support/2.7' into support/3.1
# Conflicts:
#	datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php
2025-01-20 15:53:34 +01:00
jf-cbd
160bfd714b N°7776 remove twig from ajax calls 2025-01-20 15:41:22 +01:00
Eric Espie
3b51124f1c N°7927 - No context tag available on designer MTP 2025-01-17 10:06:20 +01:00
jf-cbd
19fa836758 Merge remote-tracking branch 'origin/support/3.1' into support/3.2 2025-01-16 17:16:31 +01:00
jf-cbd
1c5cb1547f Merge remote-tracking branch 'origin/support/2.7' into support/3.1 2025-01-16 17:15:12 +01:00
jf-cbd
8d58372074 Update unattended installation script documentation 2025-01-16 17:13:26 +01:00
Eric Espie
e98c6637ac N°8108 - EVENT_DB_AFTER_WRITE: $oEventData->Get('changes') missing previous values 2025-01-16 09:31:12 +01:00
odain
7d2a9d0bfc N°8066 - Polishing Webhook Oauth 2025-01-15 17:26:12 +01:00
odain
762d1162ca N°8066 - Polishing Webhook Oauth 2025-01-15 16:59:51 +01:00
odain
95dbe4c859 N°7873 - ci fix remove useless require_once 2025-01-14 07:52:07 +01:00
Benjamin Dalsass
ec6adee9c1 Remove useless require_once and replace it with inheritance 2025-01-13 14:32:06 +01:00
Benjamin Dalsass
baa8bba926 N°8031 - Make all portal bricks use custom templates for all templates
add missing templates
2025-01-13 12:50:58 +01:00
v-dumas
8dc5411717 N°7906 - User Preference: friendlyname, list, search criteria and reconciliation 2025-01-13 12:08:14 +01:00
Benjamin Dalsass
f1d448fd78 N°8031 - Make all portal bricks use custom templates for all templates
add missing templates
2025-01-13 11:53:44 +01:00
odain
a4490e2b5f N°7873 - Portal: Brick visible despite XML security tag allowed profiles 2025-01-13 11:06:27 +01:00
odain
efb7831a5a N°7111 - False link at the end of the setup 2025-01-13 08:30:23 +01:00
Benjamin Dalsass
9fadbb5eb1 N°8031 - Make all portal bricks use custom templates for all templates (#696)
Service implementation
2025-01-13 08:04:49 +01:00
Romain Quetiez
93dba0644d N°5791 - Handle NOT IN and NOT LIKE too 2025-01-10 16:21:12 +01:00
XGUI
ec324bb28e N°7746 - Caselog edition button active even if the user has a read-only access to the object 2025-01-10 11:12:03 +01:00
Eric Espie
dc8f521b12 N°7145 - UI - Init Value DateTime and Date with Day Time (Add default values on mandatory dates) 2025-01-09 11:56:55 +01:00
Eric Espie
bf6277fcd2 N°7145 - UI - Init Value DateTime and Date with Day Time (support raw date values) 2025-01-09 11:22:28 +01:00
Eric Espie
886db5d6ad N°7145 - UI - Init Value DateTime and Date with Day Time (use OQL syntax for default value) 2025-01-09 10:49:35 +01:00
Eric Espie
0e8ddf990c N°7145 - UI - Init Value DateTime and Date with Day Time (Fix Event class) 2025-01-07 13:21:13 +01:00
Eric Espie
346a8eadec N°5791 - Obsolescence condition containing IN makes object creation fail 2025-01-07 11:29:33 +01:00
Eric Espie
6948c594c2 N°7145 - UI - Init Value DateTime and Date with Day Time 2025-01-07 10:18:23 +01:00
Eric Espie
301a7a92a0 N°7145 - UI - Init Value DateTime and Date with Day Time 2025-01-06 16:52:32 +01:00
Eric Espie
73bb80ebea N°7206 - Force DBUpdate() when a transition is asked, and it leads to the same state 2025-01-06 11:31:36 +01:00
Timmy38
1e674d7bdc N°7383 Show data table even when there is no data after filtering (#695) 2025-01-06 11:06:18 +01:00
v-dumas
1225ee1e78 improve test 2025-01-03 17:18:24 +01:00
v-dumas
a91de9fb36 Add helpers for stopwatches manipulation 2025-01-03 17:04:41 +01:00
v-dumas
71b3a415a6 N°7206 - Add tests 2025-01-03 16:17:51 +01:00
Romain Quetiez
b97c7433c8 🎨 N°7633 Cosmetics on unit tests 2025-01-03 11:57:51 +01:00
jf-cbd
11fc958a7b 🐛 N°6284 - Add data-object-key 2024-12-31 15:01:36 +01:00
odain
a151e40b75 Merge branch 'support/3.1' into support/3.2 2024-12-27 11:13:50 +01:00
odain
5780f26817 N°7810: fix merge 2024-12-27 11:13:31 +01:00
odain
9a690861a3 Merge branch 'support/3.1' into support/3.2 2024-12-27 09:24:33 +01:00
odain
343f3286b8 Merge branch 'support/2.7' into support/3.1 2024-12-27 09:08:47 +01:00
Eric Espie
37fc1a5723 N°7810 - security hardening 2024-12-27 09:04:28 +01:00
Eric Espie
7a09b3effc 🐛 Don't display create mailbox if the corresponding class does not exist 2024-12-24 15:05:48 +01:00
Romain Quetiez
4f6d514694 N°8001 - Refactoring: instantiation of an ormDocument moved to... ormDocument 2024-12-20 10:36:25 +01:00
Stephen Abello
8f8b65a71d N°8031 - Add robustness if portal configuration doesn't go through 2024-12-20 10:15:22 +01:00
Timothee
49e72e83fe N°6282 Fix XSS vulnerability in wsdl 2024-12-19 15:34:43 +01:00
Stephen Abello
f0685e33e1 N°8031 - Add robustness and fix SF parameter binding being ambiguous in extensions bricks 2024-12-19 15:14:46 +01:00
Timmy38
42f391472b N°6282 Fix XSS vulnerability in soap (#690)
* N°6282 Fix XSS vulnerability in soap
2024-12-19 11:39:00 +01:00
Eric Espie
30ef2735b6 N°8001 - TriggerOnObjectMention : load of the icon failed 2024-12-18 16:03:39 +01:00
Stephen Abello
bbff0b72d3 N°8031 - Make all portal bricks use custom templates for all templates (#691)
* N°8031 - Make all portal bricks use custom templates for all templates

* Rename parameter following code review

* Add const variables following code review

* Modify method name following code review
2024-12-18 11:09:39 +01:00
jf-cbd
2dffab9ca0 🌐 Update ZH CN dictionaries 2024-12-18 10:39:25 +01:00
jf-cbd
1cbfa4f1b1 🌐 Update ZH CN dictionaries 2024-12-18 10:11:52 +01:00
odain-cbd
5f85757630 N°7633 - Reloads the same user multiple times if it no longer exists (#692)
* N°7633 - Reloads the same user multiple times if it no longer exists

* Update core/userrights.class.inc.php

good catch

Co-authored-by: Thomas Casteleyn <thomas.casteleyn@super-visions.com>

* Update core/userrights.class.inc.php

good catch (again)

Co-authored-by: Thomas Casteleyn <thomas.casteleyn@super-visions.com>

* Update core/userrights.class.inc.php

Co-authored-by: Thomas Casteleyn <thomas.casteleyn@super-visions.com>

* PR feedbacks from Romain

* ci: rename user logins

---------

Co-authored-by: Thomas Casteleyn <thomas.casteleyn@super-visions.com>
2024-12-17 17:27:49 +01:00
v-dumas
56d3ac668c N°8047 - SuperUser profile moved under iTop Community 3.2.1 2024-12-17 16:31:59 +01:00
jf-cbd
0a3b02bf45 🌐 Update ZH CN dictionaries 2024-12-16 18:30:22 +01:00
jf-cbd
74ebbc5fa4 🌐 Update ZH CN dictionaries 2024-12-16 18:19:17 +01:00
Eric Espie
a762b6a2bb Fix failing directory removal 2024-12-16 17:04:33 +01:00
Eric Espie
32ef639ce1 N°7803 - MTP from itophub/designer failing in itop 3.2.0 2024-12-16 16:44:59 +01:00
Purple Grape
8647a76dbf 🌐 Translations - improved translation for zh cn 20241108 (#679)
* improved translation for zh cn
2024-12-16 11:39:26 +01:00
jf-cbd
47cd8bce31 Security hardening 2024-12-16 11:05:16 +01:00
jf-cbd
86c677b2ca Merge remote-tracking branch 'origin/support/3.1' into support/3.2
# Conflicts:
#	datamodels/2.x/itop-portal-base/portal/src/Controller/ObjectController.php
2024-12-16 11:02:37 +01:00
Eric Espie
960129316d N°8050 - Fix regression due to directories filter changes 2024-12-16 10:56:06 +01:00
jf-cbd
1fa50f695d Security hardening 2024-12-16 10:47:06 +01:00
jf-cbd
692cf4f635 Merge branch 'support/2.7' into support/3.1 2024-12-16 10:27:00 +01:00
jf-cbd
95aa444ee6 Security hardening 2024-12-13 16:48:13 +01:00
jf-cbd
f5de808c7c Security hardening (#685)
* security hardening
2024-12-13 15:09:18 +01:00
Eric Espie
fc388313d7 N°8050 - Problems with interface discovery from itop 2024-12-13 10:14:17 +01:00
odain
d544ee5498 N°7750 - ci enhance test 2024-12-13 09:35:35 +01:00
odain
ce187550f6 N°7750 - Fix display regression 2024-12-12 12:21:57 +01:00
Eric Espie
5d15a08824 🥅 Fast setup error display 2024-12-12 09:55:16 +01:00
odain
8135316119 N°7750 - Bug with OQL set as Shortcut 2024-12-11 16:05:15 +01:00
Eric Espie
868c0ae836 N°7997 - Sharing Base incompatible with iTop >= 3.1 (code review) 2024-12-11 15:51:36 +01:00
Eric Espie
d03d4fce5f N°7997 - Sharing Base incompatible with iTop >= 3.1 2024-12-11 13:35:15 +01:00
Eric Espie
aa55c2b30f N°7997 - Sharing Base incompatible with iTop >= 3.1 2024-12-11 13:28:37 +01:00
Eric Espie
9d3b46b919 🥅 Fast setup error display 2024-12-11 11:40:03 +01:00
Eric Espie
01b4dbba71 🥅 Fast setup error display 2024-12-11 11:20:32 +01:00
Eric Espie
72ac4096c1 N°7854 - ⬆️ Bump twig version 2024-12-10 17:08:48 +01:00
Eric Espie
19559b08a7 N°7854 - ⬆️ Bump twig version 2024-12-10 10:52:30 +01:00
Eric Espie
346564ca0e N°7854 - ⬆️ Bump twig version 2024-12-10 10:11:28 +01:00
Eric Espie
1bf53bae2a N°7871 - unable to migrate to itop3.2 if a trigger on object mention without "mentioned filter" exists 2024-12-09 17:05:07 +01:00
Eric Espie
29ce042916 N°7867 - Issue with MTP offline (reset cache in metamodel) 2024-12-09 10:38:50 +01:00
odain
83539d6d4c N°7446 - Make ItopCustomDatamodelTestCase work with modules in production-modules 2024-12-05 11:29:05 +01:00
Eric Espie
e6a7b926f6 N°7852 - Issue on Class groups definition when checking EventNotification class 2024-12-05 11:14:19 +01:00
Eric Espie
b30e053236 N°8020 - Bugs MFA and designer incompatibility 2024-12-03 16:42:27 +01:00
Stephen Abello
afd96a0f49 N°7995 - Allow to redefine portal twig template for all bricks in a portal (#686)
* N°7995 - Allow to redefine portal twig template for all bricks in a portal

* Apply modifications from code review

* Fix variable name

* Apply changes from code review
2024-12-03 10:44:37 +01:00
Eric Espie
a77765ec7b N°8019 - Enrich event with transition information 2024-12-03 10:28:13 +01:00
jf-cbd
64b4b03ea9 Security hardening 2024-12-03 10:26:11 +01:00
jf-cbd
a797878b17 Security hardening 2024-12-03 09:54:31 +01:00
jf-cbd
1fa0f7bdd9 N°8007 - Security hardening 2024-12-02 17:45:39 +01:00
Eric Espie
f718b4173d N°7206 - TriggerOnStateEnter not called when using reassign transition (after review) 2024-12-02 17:28:15 +01:00
Eric Espie
e057c0f081 N°7777 - Click on tab "Last executions" during action creation crashs the form 2024-12-02 17:12:32 +01:00
Eric Espie
5a49fc7654 N°7206 - TriggerOnStateEnter not called when using reassign transition 2024-12-02 14:49:28 +01:00
Stephen Abello
6fca659c9d Fix portal not being able to use $common-* SCSS variables when recompiling stylesheets 2024-12-02 14:06:53 +01:00
Stephen Abello
eacd08f31e Fix SCSS comments type 2024-12-02 14:03:39 +01:00
jf-cbd
5f7d8f6cc0 Merge remote-tracking branch 'origin/support/3.1' into support/3.2 2024-11-29 16:43:13 +01:00
jf-cbd
cbb4281a37 N°7980 - security hardening 2024-11-29 16:40:34 +01:00
odain
d7a8d335d5 N°7446 - Fix in CI environment when class already loaded 2024-11-29 12:22:38 +01:00
odain
bd1d447677 N°7446 - Fix in CI environment 2024-11-29 12:08:16 +01:00
Eric Espie
bb405d5173 N°7429 - Create an MFA extension for iTop - Add support for AttributeClassSet 2024-11-27 14:57:51 +01:00
Benjamin Dalsass
4723fc885c Merge remote-tracking branch 'origin/support/3.1' into support/3.2
# Conflicts:
#	application/dashboard.class.inc.php
2024-11-27 09:55:15 +01:00
Benjamin Dalsass
06dcae1dd1 Merge remote-tracking branch 'origin/support/2.7' into support/3.1 2024-11-27 09:50:57 +01:00
Benjamin Dalsass
e03033ce52 N°7219 - Fatal error following dashboard modification when dashboard title contains an é 2024-11-27 09:40:22 +01:00
Timothee
19eae916f0 N°7792 Do not initialize CAS if already started 2024-11-22 09:59:41 +01:00
Lars Kaltefleiter
596e26a96f 🌐 N°7932 Translations - British English (#677)
* Translation into EN GB
2024-11-18 14:38:53 +01:00
Eric Espie
ef42a49009 Allow extensions to add extra datamodel for tests 2024-11-14 09:27:57 +01:00
Romain Quetiez
51e5f1e7de N°7962 Suppress warnings emitted by the parser/lexer generators and the runtime OQL lexer, with PHP 8.1+ 2024-11-13 15:28:29 +01:00
Timothee
9cffd17e19 N°7704 Fix missing namespace for constant EVENT_DOWNLOAD_DOCUMENT 2024-11-13 14:39:23 +01:00
Benjamin Dalsass
e9f16935b6 N°6613 - Fix user picture pushing invalid data 2024-11-13 13:20:27 +01:00
Timothee
e7488b2c89 N°7721 default configuration parameter 2024-11-12 14:48:58 +01:00
Stephen Abello
8ac4086e71 N°7793 Fix primary color being set to blue due to a mistake 2024-11-12 13:52:03 +01:00
Benjamin Dalsass
6b5273fa1c N°1000 - Portal: filter BrowseBrick result varies if in list or tree (#673)
* N°1000 - Portal: filter BrowseBrick result varies if in list or tree

* N°1000 - Portal: filter BrowseBrick result varies if in list or tree
- replace html separators by css class

* N°1000 - Portal: filter BrowseBrick result varies if in list or tree
- replace html separators by css class

* N°1000 - Portal: filter BrowseBrick result varies if in list or tree
- add alteration comment to Tree List Filter jQuery plugin 1.0
- remove display none to tree-item-filter-data
2024-11-12 11:02:43 +01:00
jf-cbd
9b1e854bf7 Update translations 2024-11-12 09:27:35 +01:00
Lars Kaltefleiter
926700856d Fix some typos in en translations (#678) 2024-11-08 10:56:10 +01:00
Stephen Abello
ab93d59a77 Merge branch 'support/3.1' into support/3.2
# Conflicts:
#	sources/Core/Email/EmailLaminas.php
2024-11-08 09:41:48 +01:00
Karel Vlk
c70d62a51e 🐛 N°7916 SF#2274 EmailLaminas.php: Keep charset with part header in multipart email (#672)
* 🐛 N°2274 EmailLaminas.php: Keep charset with part header in multipart email

* Add a unit test

---------

Co-authored-by: Stephen Abello <stephen.abello@combodo.com>
2024-11-08 09:38:57 +01:00
jf-cbd
82bc2f33f2 Merge remote-tracking branch 'origin/support/3.1' into support/3.2 2024-11-07 14:53:48 +01:00
jf-cbd
0d5ff261fe Merge remote-tracking branch 'origin/support/2.7' into support/3.1 2024-11-07 14:51:32 +01:00
jf-cbd
374b35f78a 🚀 Fix GitHub action 2024-11-07 14:50:46 +01:00
Eric Espie
f5c29edee4 N°7874 - Inline image deleted by garbage collector 2024-11-07 09:24:33 +01:00
Timothee
8fb450a6d4 🌐 ES localization, Fix encoding 2024-11-06 17:37:37 +01:00
Timothee
311c5d0d51 🌐 ES localization 2024-11-06 17:12:47 +01:00
Stephen Abello
f90bd81e15 N°7793 Add common SCSS variables between backoffice and end-user portal (#674)
* N°7793 Add common SCSS variables between backoffice and end-user portal

* Add shame & readme

* Move font face to common

* Inherit color functions

* Move font icon to common

* FIx breaking change introduced in lifecycle palette

* FIx breaking change introduced in base

* Move approot url to common

* Make highlightjs common variables more coherent with 3.2.1 commonization approach

* Deprecated and migrate the usage of ibo-adjust-alpha and ibo-adjust-lightness
2024-11-06 09:52:54 +01:00
Stephen Abello
a10e547420 N°7898 CKEditor content should be inserted at the cursor position. Thanks to @jbostoen 2024-11-04 15:57:44 +01:00
Stephen Abello
2519456c98 Merge branch 'support/3.1' into support/3.2 2024-11-04 14:39:37 +01:00
Stephen Abello
9371bc6d7b N°7925 Fix incorrectly formatted In-Reply-To email header 2024-11-04 14:38:31 +01:00
Karel Vlk
58e964fb8c 🐛 N°7917 SF#2272 EmailLaminas.php: Fix Message-ID format (#671)
* 🐛 N°2272 EmailLaminas.php: Fix Message-ID format

* EmailLaminas.php: Add MessageId import

as suggested by @steffunky in PR 671
2024-11-04 14:37:15 +01:00
v-dumas
57760528c9 N°7759 - Improve Delivery Model Tooltips 2024-11-04 12:21:17 +01:00
jf-cbd
561baf5771 update tests to comply with expected behavior 2024-10-31 09:32:58 +01:00
jf-cbd
f281fa7b14 Remove unnecessary reload 2024-10-29 11:21:04 +01:00
Eric Espie
6ae8a72a35 Add Fast setup for developers 2024-10-29 10:51:16 +01:00
Romain Quetiez
694711b3f4 📝 The OQL parser builder does not work for PHP8+ 2024-10-25 15:07:11 +02:00
Romain Quetiez
01d3f707e4 N°4517 Retrofit PHP 8.1 compatibility changes to the template so that the changes will be preserved next time the parser is rebuilt (and the parser has been rebuilt, resulting in different line numbers in the generated comments) 2024-10-25 15:03:44 +02:00
odain
4e28856015 ci: enhance DB cleanup in tearDown 2024-10-25 12:02:21 +02:00
jf-cbd
8bb456df53 Merge remote-tracking branch 'origin/support/3.1' into support/3.2 2024-10-23 17:55:12 +02:00
jf-cbd
4886e2a7dc 📝 Update itop-version-history.md 2024-10-23 17:54:26 +02:00
Romain Quetiez
674dfebb0d N°7803 Skip test if itop-hub-connector is not installed (new helper to handle this in any other tests) 2024-10-23 15:46:44 +02:00
jf-cbd
e8ecc85828 Merge remote-tracking branch 'origin/support/2.7' into support/3.1 2024-10-22 16:09:02 +02:00
jf-cbd
04bd8cc5ce 🚀 Update GitHub actions to improve PR classification 2024-10-22 16:07:47 +02:00
Romain Quetiez
764eddd9f8 N°7803 Fix test not working on a clean installation 2024-10-21 10:45:26 +02:00
Romain Quetiez
015ff8f179 A better illustration to show that the impact is propagated in one way 2024-10-18 17:29:50 +02:00
Romain Quetiez
9b651c2451 N°7803 Test iTop Hub move to production (compilation phase) 2024-10-18 17:23:46 +02:00
v-dumas
bb16f4ad57 N°7903 - On-going demand brick broken when adding Global Demand 1.5.0 (2) 2024-10-18 11:10:27 +02:00
v-dumas
7b3023ccce N°7820 - Tooltip Newsroom 2024-10-17 18:24:08 +02:00
v-dumas
e6a3a95ff9 N°7859 - French translation missing on newsroom 2024-10-17 18:16:48 +02:00
v-dumas
80e413c370 N°7906 - User Preference: missing list, search criteria and reconciliation 2024-10-17 17:43:18 +02:00
v-dumas
69fd9048fd N°7903 - On-going demand brick broken when adding Global Demand 1.5.0 2024-10-17 17:14:30 +02:00
odain-cbd
7254bb7a2f N°7433 - Allow MFA configuration in the portal (#670)
* N°7433 - Extension for MFA

* Portal user profile brick

* fix mfa tab display

* Portal user profile brick

* Portal user profile brick

* mfa portal action

* extensibility on portal to make mfa recovery mode work

* Portal user profile brick extension

* Portal user profile brick extension

* display alert section in user portal profile layout

* protect mfa via transaction_id mecanism

* Fix transaction ids

* Fix when no MFA

* N°7433 - Allow MFA configuration in the portal (refactor interfaces)

* N°7433 - Allow MFA configuration in the portal (revert unnecessary changes)

* N°7433 - Allow MFA configuration in the portal (finer style)

* N°7433 - Allow MFA configuration in the portal (PHPDoc update)

* N°7433 - PR review

---------

Co-authored-by: Eric Espie <eric.espie@combodo.com>
2024-10-16 16:41:58 +02:00
Romain Quetiez
7a4d29d561 N°7870 Prerequisites to test portal services (instantiate a symfony service) 2024-10-15 15:11:16 +02:00
Eric Espie
c54909f2a3 Fix comments for doc 2024-10-15 14:37:42 +02:00
Eric Espie
23af649d7f Merge remote-tracking branch 'origin/support/3.1' into support/3.2 2024-10-14 09:26:25 +02:00
Eric Espie
88756a443a Fix event listeners display when the listener is a static method 2024-10-14 09:25:05 +02:00
Eric Espie
4a78f8fb43 N°7847 - Extensions via interface not recognized
N°7803 - MTP from itophub/designer failing in itop 3.2.0
Fix setup
2024-10-11 11:01:02 +02:00
Eric Espie
6c8388ea5e N°7847 - Extensions via interface not recognized
N°7803 - MTP from itophub/designer failing in itop 3.2.0
2024-10-11 10:02:03 +02:00
Eric Espie
75520bfaf9 N°7847 - Extensions via interface not recognized
N°7803 - MTP from itophub/designer failing in itop 3.2.0
2024-10-10 17:59:50 +02:00
v-dumas
3a4d9e64f8 N°7886 - Remove deprecated datamodel methods (2) 2024-10-10 16:59:20 +02:00
denis.flaven@combodo.com
209e30f7ef Merge 'origin/support/3.1' into support/3.2 2024-10-03 12:43:44 +02:00
denis.flaven@combodo.com
052e2a1a42 🔖 Prepare 3.1.2 version 2024-10-03 12:14:32 +02:00
jf-cbd
3aadccc2e8 📝 Update itop-version-history.md 2024-09-30 11:44:25 +02:00
Romain Quetiez
5ae2fdee94 N°7858 Typo in backup config causing wrong scheduling of first occurrence of weekly backup (if on the same day as first execution) 2024-09-27 16:47:32 +02:00
Romain Quetiez
380512dcbe N°7845 Suppress risky syntax with DateTime::modify (at best, just a bad example, at worst, just a result that will vary wether PHP > 8.2 or not) 2024-09-26 17:51:52 +02:00
Eric Espie
8e2a68887c Merge remote-tracking branch 'origin/support/3.1' into support/3.2 2024-09-26 17:40:24 +02:00
Eric Espie
eb1ecff7d8 Merge remote-tracking branch 'origin/support/3.0' into support/3.1 2024-09-26 17:37:43 +02:00
Eric Espie
8141723869 Merge remote-tracking branch 'origin/support/2.7' into support/3.0
# Conflicts:
#	approot.inc.php
#	css/css-variables.scss
#	datamodels/2.x/authent-cas/module.authent-cas.php
#	datamodels/2.x/authent-external/module.authent-external.php
#	datamodels/2.x/authent-ldap/module.authent-ldap.php
#	datamodels/2.x/authent-local/module.authent-local.php
#	datamodels/2.x/combodo-db-tools/module.combodo-db-tools.php
#	datamodels/2.x/itop-attachments/module.itop-attachments.php
#	datamodels/2.x/itop-backup/module.itop-backup.php
#	datamodels/2.x/itop-bridge-virtualization-storage/module.itop-bridge-virtualization-storage.php
#	datamodels/2.x/itop-change-mgmt-itil/module.itop-change-mgmt-itil.php
#	datamodels/2.x/itop-change-mgmt/module.itop-change-mgmt.php
#	datamodels/2.x/itop-config-mgmt/module.itop-config-mgmt.php
#	datamodels/2.x/itop-config/module.itop-config.php
#	datamodels/2.x/itop-core-update/module.itop-core-update.php
#	datamodels/2.x/itop-datacenter-mgmt/module.itop-datacenter-mgmt.php
#	datamodels/2.x/itop-endusers-devices/module.itop-endusers-devices.php
#	datamodels/2.x/itop-files-information/module.itop-files-information.php
#	datamodels/2.x/itop-full-itil/module.itop-full-itil.php
#	datamodels/2.x/itop-hub-connector/module.itop-hub-connector.php
#	datamodels/2.x/itop-incident-mgmt-itil/module.itop-incident-mgmt-itil.php
#	datamodels/2.x/itop-knownerror-mgmt/module.itop-knownerror-mgmt.php
#	datamodels/2.x/itop-oauth-client/module.itop-oauth-client.php
#	datamodels/2.x/itop-portal-base/module.itop-portal-base.php
#	datamodels/2.x/itop-portal/module.itop-portal.php
#	datamodels/2.x/itop-problem-mgmt/module.itop-problem-mgmt.php
#	datamodels/2.x/itop-profiles-itil/module.itop-profiles-itil.php
#	datamodels/2.x/itop-request-mgmt-itil/module.itop-request-mgmt-itil.php
#	datamodels/2.x/itop-request-mgmt/module.itop-request-mgmt.php
#	datamodels/2.x/itop-service-mgmt-provider/module.itop-service-mgmt-provider.php
#	datamodels/2.x/itop-service-mgmt/module.itop-service-mgmt.php
#	datamodels/2.x/itop-sla-computation/module.itop-sla-computation.php
#	datamodels/2.x/itop-storage-mgmt/module.itop-storage-mgmt.php
#	datamodels/2.x/itop-tickets/module.itop-tickets.php
#	datamodels/2.x/itop-virtualization-mgmt/module.itop-virtualization-mgmt.php
#	datamodels/2.x/itop-welcome-itil/module.itop-welcome-itil.php
#	datamodels/2.x/version.xml
2024-09-26 17:37:07 +02:00
denis.flaven@combodo.com
8cb701bda3 🔖 Prepare 2.7.11 version 2024-09-26 16:53:24 +02:00
vdumas
a8f3c3054b N°7774 - Tooltip unscribe from News center to be improved 2024-09-23 17:39:10 +02:00
vdumas
c5fb4227bf N°7774 - Tooltip unscribe from News center to be improved 2024-09-23 17:27:55 +02:00
jf-cbd
1b29746806 Rename github token 2024-09-23 17:14:41 +02:00
vdumas
f98ad6ccab N°7658 - Issue with Date widget display on object search 2024-09-23 14:54:07 +02:00
jf-cbd
fb9c317256 Add an action in the workflow to automatically add pull requests to the Combodo PRs dashboard 2024-09-23 14:43:33 +02:00
Eric Espie
0f1f2875ff Allow searching unknown class 2024-09-20 14:37:29 +02:00
Timothee
a88b4ad06b N°5079 - Fix misleading "leave confirmation" alert after closing some custom forms in portal 2024-09-20 11:31:42 +02:00
Anne-Cath
172fda2157 N°7824 - Fix dictionnaries 2024-09-19 07:57:44 +02:00
Anne-Cath
4f0c45004a N°7824 - Fix dictionnaries 2024-09-19 07:43:04 +02:00
Anne-Cath
60de41e6fd N°7824 - Update czech translations for iTop3.2 thanks to @Stetinac 2024-09-18 11:54:51 +02:00
Anne-Catherine
cbbb4cdb8c N°7639 - Switching tab starts reloading the data table (#651) 2024-09-18 10:56:58 +02:00
Anne-Catherine
8c5b919e72 N°7744 - Import CLI : add the possibility to use the field 'id' as reconciliationkey (#663) 2024-09-18 10:43:25 +02:00
Eric Espie
47c05b75d0 Merge commit '2147ae9105f3d3255e4b0dbfe0c33de505175041' into support/3.2 2024-09-11 17:33:38 +02:00
Eric Espie
2147ae9105 N°7802 - MTP from itophub/designer failing in itop 3.2.0 2024-09-11 17:24:08 +02:00
1513 changed files with 142124 additions and 88728 deletions

View File

@@ -79,12 +79,26 @@ gitGraph
commit id: "2023-08-10" tag: "2.7.9"
checkout support/3.1
commit id: "2023-12-20" tag: "3.1.1"
checkout support/2.7
commit id: "2024-01-17" tag: "2.7.10"
checkout develop
commit id: "2024-06-25" tag: "3.2.0-beta1" type: HIGHLIGHT
commit id: "2024-01-15" tag: "Start 3.2" type: HIGHLIGHT
branch support/3.2 order: 830
checkout support/2.7
commit id: "2024-01-17a" tag: "2.7.10"
checkout support/3.0
commit id: "2024-01-17b" tag: "3.0.4"
checkout support/2.7
commit id: "2024-09-28" tag: "2.7.11"
checkout support/3.1
commit id: "2024-09-27" tag: "3.1.2"
checkout support/3.2
commit id: "2024-06-25" tag: "3.2.0-beta1" type: REVERSE
commit id: "2024-08-07" tag: "3.2.0"
checkout support/2.7
commit id: "2025-02-25" tag: "2.7.12"
checkout support/3.1
commit id: "2025-02-25 " tag: "3.1.3"
checkout support/3.2
commit id: "2025-02-25 " tag: "3.2.1"
```
To learn more, check the [iTop community versions history on the official wiki](https://www.itophub.io/wiki/page?id=latest:release:start).

43
.github/workflows/action.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: Add PRs to Combodo PRs Dashboard
on:
pull_request_target:
types:
- opened
jobs:
add-to-project:
name: Add PR to Combodo Project
runs-on: ubuntu-latest
steps:
- name: Check if author is a member of the organization
id: check-membership
run: |
ORG="Combodo"
AUTHOR=$(jq -r .pull_request.user.login "$GITHUB_EVENT_PATH")
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: token ${{ secrets.PR_AUTOMATICALLY_ADD_TO_PROJECT }}" \
"https://api.github.com/orgs/$ORG/members/$AUTHOR")
if [ "$RESPONSE" == "404" ]; then
echo "project_url=https://github.com/orgs/Combodo/projects/5" >> $GITHUB_ENV
echo "is_member=false" >> $GITHUB_ENV
else
echo "project_url=https://github.com/orgs/Combodo/projects/4" >> $GITHUB_ENV
echo "is_member=true" >> $GITHUB_ENV
fi
- name: Add internal tag if member
if: env.is_member == 'true'
run: |
curl -X POST -H "Authorization: token ${{ secrets.PR_AUTOMATICALLY_ADD_TO_PROJECT }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/Combodo/iTop/issues/${{ github.event.pull_request.number }}/labels \
-d '{"labels":["internal"]}'
env:
is_member: ${{ env.is_member }}
- name: Add PR to the appropriate project
uses: actions/add-to-project@v1.0.2
with:
project-url: ${{ env.project_url }}
github-token: ${{ secrets.PR_AUTOMATICALLY_ADD_TO_PROJECT }}

View File

@@ -106,6 +106,7 @@ We would like to give a special thank you 🤗 to the people from the community
- Raenker, Martin
- Roháč, Richard (a.k.a [@RohacRichard](https://github.com/RohacRichard))
- Rosenke, Stephan
- Rossi, Tommaso (a.k.a [@tomrss](https://www.github.com/tomrss))
- Rudner, Björn (a.k.a [@rudnerbjoern](https://github.com/rudnerbjoern))
- Šafránek, Jaroslav (a.k.a [jkcinik](https://sourceforge.net/u/jkcinik/profile/) on SourceForge)
- Seki, Shoji
@@ -115,6 +116,7 @@ We would like to give a special thank you 🤗 to the people from the community
- Tarjányi, Csaba (a.k.a [@tacsaby](https://github.com/tacsaby))
- Tulio, Marco
- Turrubiates, Miguel
- Vlk, Karel (a.k.a [@vlk-charles](https://www.github.com/vlk-charles))
### Aliases

View File

@@ -825,49 +825,38 @@ class UserRightsProfile extends UserRightsAddOnAPI
{
// We are protected by GetSelectFilter: the object set contains objects allowed or shared for reading
// We have to answer NO for objects shared for reading purposes
if (self::HasSharing())
{
$aClassProps = SharedObject::GetSharedClassProperties($sClass);
if ($aClassProps)
{
// This class is shared, GetSelectFilter may allow some objects for read only
// But currently we are checking wether the objects might be written...
// Let's exclude the objects based on the relevant criteria
if (self::HasSharing() && SharedObject::GetSharedClassProperties($sClass)) {
// This class is shared, GetSelectFilter may allow some objects for read only
// But currently we are checking whether the objects might be written...
// Let's exclude the objects based on the relevant criteria
$sOrgAttCode = self::GetOwnerOrganizationAttCode($sClass);
if (!is_null($sOrgAttCode))
{
$aUserOrgs = $this->GetUserOrgs($oUser, $sClass);
if (!is_null($aUserOrgs) && count($aUserOrgs) > 0)
{
$iCountNO = 0;
$iCountYES = 0;
$oInstanceSet->Rewind();
while($oObject = $oInstanceSet->Fetch())
{
$iOrg = $oObject->Get($sOrgAttCode);
if (in_array($iOrg, $aUserOrgs))
{
$iCountYES++;
}
else
{
$iCountNO++;
}
}
if ($iCountNO == 0)
{
$iPermission = UR_ALLOWED_YES;
}
elseif ($iCountYES == 0)
{
$iPermission = UR_ALLOWED_NO;
}
else
{
$iPermission = UR_ALLOWED_DEPENDS;
// Use $oInstanceSet only if sClass is the main class
if (!is_a($oInstanceSet->GetClass(), $sClass, true)) {
/** @var \DBObjectSet $oInstanceSet */
throw new CoreException(__FUNCTION__.': Expecting object set to be of class '.$sClass.' but it is of class '.$oInstanceSet->GetClass(), ['OQL_Query' => $oInstanceSet->GetFilter()->ToOQL(), 'classes' => $oInstanceSet->GetSelectedClasses()]);
}
$sOrgAttCode = self::GetOwnerOrganizationAttCode($sClass);
if (!is_null($sOrgAttCode)) {
$aUserOrgs = $this->GetUserOrgs($oUser, $sClass);
if (!is_null($aUserOrgs) && count($aUserOrgs) > 0) {
$iCountNO = 0;
$iCountYES = 0;
$oInstanceSet->Rewind();
while ($oObject = $oInstanceSet->Fetch()) {
$iOrg = $oObject->Get($sOrgAttCode);
if (in_array($iOrg, $aUserOrgs)) {
$iCountYES++;
} else {
$iCountNO++;
}
}
if ($iCountNO == 0) {
$iPermission = UR_ALLOWED_YES;
} elseif ($iCountYES == 0) {
$iPermission = UR_ALLOWED_NO;
} else {
$iPermission = UR_ALLOWED_DEPENDS;
}
}
}
}
@@ -982,4 +971,3 @@ class UserRightsProfile extends UserRightsAddOnAPI
UserRights::SelectModule('UserRightsProfile');
?>

View File

@@ -64,13 +64,13 @@ interface iLoginFSMExtension extends iLoginExtension
* If a page is displayed, the action must exit at this point
* if LoginWebPage::LOGIN_FSM_RETURN_ERROR is returned $iErrorCode must be set
* if LoginWebPage::LOGIN_FSM_RETURN_OK is returned then the login is OK and terminated
* if LoginWebPage::LOGIN_FSM_RETURN_IGNORE is returned then the FSM will proceed to next plugin or state
* if LoginWebPage::LOGIN_FSM_CONTINUE is returned then the FSM will proceed to next plugin or state
*
* @api
* @param string $sLoginState (see LoginWebPage::LOGIN_STATE_...)
* @param int $iErrorCode (see LoginWebPage::EXIT_CODE_...)
*
* @return int LoginWebPage::LOGIN_FSM_RETURN_ERROR, LoginWebPage::LOGIN_FSM_RETURN_OK or LoginWebPage::LOGIN_FSM_RETURN_IGNORE
* @return int LoginWebPage::LOGIN_FSM_RETURN_ERROR, LoginWebPage::LOGIN_FSM_RETURN_OK or LoginWebPage::LOGIN_FSM_CONTINUE
*/
public function LoginAction($sLoginState, &$iErrorCode);
}
@@ -83,7 +83,7 @@ interface iLoginFSMExtension extends iLoginExtension
* * If a page is displayed, the action must exit at this point
* * if LoginWebPage::LOGIN_FSM_RETURN_ERROR is returned $iErrorCode must be set
* * if LoginWebPage::LOGIN_FSM_RETURN_OK is returned then the login is OK and terminated
* * if LoginWebPage::LOGIN_FSM_RETURN_IGNORE is returned then the FSM will proceed to next plugin or to next state
* * if LoginWebPage::LOGIN_FSM_CONTINUE is returned then the FSM will proceed to next plugin or to next state
*
* @api
* @package LoginExtensibilityAPI
@@ -136,7 +136,7 @@ abstract class AbstractLoginFSMExtension implements iLoginFSMExtension
* @api
* @param int $iErrorCode (see LoginWebPage::EXIT_CODE_...)
*
* @return int LoginWebPage::LOGIN_FSM_RETURN_ERROR, LoginWebPage::LOGIN_FSM_RETURN_OK or LoginWebPage::LOGIN_FSM_RETURN_IGNORE
* @return int LoginWebPage::LOGIN_FSM_RETURN_ERROR, LoginWebPage::LOGIN_FSM_RETURN_OK or LoginWebPage::LOGIN_FSM_CONTINUE
*/
protected function OnStart(&$iErrorCode)
{
@@ -150,7 +150,7 @@ abstract class AbstractLoginFSMExtension implements iLoginFSMExtension
* @api
* @param int $iErrorCode (see LoginWebPage::EXIT_CODE_...)
*
* @return int LoginWebPage::LOGIN_FSM_RETURN_ERROR, LoginWebPage::LOGIN_FSM_RETURN_OK or LoginWebPage::LOGIN_FSM_RETURN_IGNORE
* @return int LoginWebPage::LOGIN_FSM_RETURN_ERROR, LoginWebPage::LOGIN_FSM_RETURN_OK or LoginWebPage::LOGIN_FSM_CONTINUE
*/
protected function OnModeDetection(&$iErrorCode)
{
@@ -167,7 +167,7 @@ abstract class AbstractLoginFSMExtension implements iLoginFSMExtension
* @api
* @param int $iErrorCode (see LoginWebPage::EXIT_CODE_...)
*
* @return int LoginWebPage::LOGIN_FSM_RETURN_ERROR, LoginWebPage::LOGIN_FSM_RETURN_OK or LoginWebPage::LOGIN_FSM_RETURN_IGNORE
* @return int LoginWebPage::LOGIN_FSM_RETURN_ERROR, LoginWebPage::LOGIN_FSM_RETURN_OK or LoginWebPage::LOGIN_FSM_CONTINUE
*/
protected function OnReadCredentials(&$iErrorCode)
{
@@ -181,7 +181,7 @@ abstract class AbstractLoginFSMExtension implements iLoginFSMExtension
* @api
* @param int $iErrorCode (see LoginWebPage::EXIT_CODE_...)
*
* @return int LoginWebPage::LOGIN_FSM_RETURN_ERROR, LoginWebPage::LOGIN_FSM_RETURN_OK or LoginWebPage::LOGIN_FSM_RETURN_IGNORE
* @return int LoginWebPage::LOGIN_FSM_RETURN_ERROR, LoginWebPage::LOGIN_FSM_RETURN_OK or LoginWebPage::LOGIN_FSM_CONTINUE
*/
protected function OnCheckCredentials(&$iErrorCode)
{
@@ -192,7 +192,7 @@ abstract class AbstractLoginFSMExtension implements iLoginFSMExtension
* @api
* @param int $iErrorCode (see LoginWebPage::EXIT_CODE_...)
*
* @return int LoginWebPage::LOGIN_FSM_RETURN_ERROR, LoginWebPage::LOGIN_FSM_RETURN_OK or LoginWebPage::LOGIN_FSM_RETURN_IGNORE
* @return int LoginWebPage::LOGIN_FSM_RETURN_ERROR, LoginWebPage::LOGIN_FSM_RETURN_OK or LoginWebPage::LOGIN_FSM_CONTINUE
*/
protected function OnCredentialsOK(&$iErrorCode)
{
@@ -203,7 +203,7 @@ abstract class AbstractLoginFSMExtension implements iLoginFSMExtension
* @api
* @param int $iErrorCode (see LoginWebPage::EXIT_CODE_...)
*
* @return int LoginWebPage::LOGIN_FSM_RETURN_ERROR, LoginWebPage::LOGIN_FSM_RETURN_OK or LoginWebPage::LOGIN_FSM_RETURN_IGNORE
* @return int LoginWebPage::LOGIN_FSM_RETURN_ERROR, LoginWebPage::LOGIN_FSM_RETURN_OK or LoginWebPage::LOGIN_FSM_CONTINUE
*/
protected function OnUsersOK(&$iErrorCode)
{
@@ -214,7 +214,7 @@ abstract class AbstractLoginFSMExtension implements iLoginFSMExtension
* @api
* @param int $iErrorCode (see LoginWebPage::EXIT_CODE_...)
*
* @return int LoginWebPage::LOGIN_FSM_RETURN_ERROR, LoginWebPage::LOGIN_FSM_RETURN_OK or LoginWebPage::LOGIN_FSM_RETURN_IGNORE
* @return int LoginWebPage::LOGIN_FSM_RETURN_ERROR, LoginWebPage::LOGIN_FSM_RETURN_OK or LoginWebPage::LOGIN_FSM_CONTINUE
*/
protected function OnConnected(&$iErrorCode)
{
@@ -225,7 +225,7 @@ abstract class AbstractLoginFSMExtension implements iLoginFSMExtension
* @api
* @param int $iErrorCode (see LoginWebPage::EXIT_CODE_...)
*
* @return int LoginWebPage::LOGIN_FSM_RETURN_ERROR, LoginWebPage::LOGIN_FSM_RETURN_OK or LoginWebPage::LOGIN_FSM_RETURN_IGNORE
* @return int LoginWebPage::LOGIN_FSM_RETURN_ERROR, LoginWebPage::LOGIN_FSM_RETURN_OK or LoginWebPage::LOGIN_FSM_CONTINUE
*/
protected function OnError(&$iErrorCode)
{
@@ -1711,6 +1711,11 @@ interface iRestServiceProvider
public function ExecOperation($sVersion, $sVerb, $aParams);
}
interface iRestInputSanitizer
{
public function SanitizeJsonInput(string $sJsonInput): string;
}
/**
* Minimal REST response structure. Derive this structure to add response data and error codes.
*
@@ -1802,6 +1807,14 @@ class RestResult
* @api
*/
public $message;
/**
* Sanitize the content of this result to hide sensitive information
*/
public function SanitizeContent()
{
// The default implementation does nothing
}
}
/**

File diff suppressed because it is too large Load Diff

View File

@@ -1266,13 +1266,12 @@ EOF
$sOkButtonLabel = Dict::S('UI:Button:Save');
$sCancelButtonLabel = Dict::S('UI:Button:Cancel');
$sId = utils::HtmlEntities($this->sId);
$sLayoutClass = utils::HtmlEntities($this->sLayoutClass);
$sId = json_encode($this->sId);
$sLayoutClass = json_encode($this->sLayoutClass);
$sAutoReload = $this->bAutoReload ? 'true' : 'false';
$sAutoReloadSec = (string) $this->iAutoReloadSec;
$sTitle = utils::HtmlEntities($this->sTitle);
$sFile = utils::HtmlEntities($this->GetDefinitionFile());
$sFileForJS = json_encode($this->GetDefinitionFile());
$sTitle = json_encode($this->sTitle);
$sFile = json_encode($this->GetDefinitionFile());
$sUrl = utils::GetAbsoluteUrlAppRoot().'pages/ajax.render.php';
$sReloadURL = $this->GetReloadURL();
@@ -1328,15 +1327,15 @@ $('#dashboard_editor').dialog({
});
$('#dashboard_editor .ui-layout-center').runtimedashboard({
dashboard_id: '$sId',
layout_class: '$sLayoutClass',
title: '$sTitle',
dashboard_id: $sId,
layout_class: $sLayoutClass,
title: $sTitle,
auto_reload: $sAutoReload,
auto_reload_sec: $sAutoReloadSec,
submit_to: '$sUrl',
submit_parameters: {operation: 'save_dashboard', file: {$sFileForJS}, extra_params: $sJSExtraParams, reload_url: '$sReloadURL'},
submit_parameters: {operation: 'save_dashboard', file: $sFile, extra_params: $sJSExtraParams, reload_url: '$sReloadURL'},
render_to: '$sUrl',
render_parameters: {operation: 'render_dashboard', file: {$sFileForJS}, extra_params: $sJSExtraParams, reload_url: '$sReloadURL'},
render_parameters: {operation: 'render_dashboard', file: $sFile, extra_params: $sJSExtraParams, reload_url: '$sReloadURL'},
new_dashlet_parameters: {operation: 'new_dashlet'}
});

View File

@@ -238,6 +238,10 @@ The object can be modified.]]></description>
<description>Creation flag</description>
<type>boolean</type>
</event_datum>
<event_datum id="stimulus_applied">
<description>Life cycle stimulus applied (null if not within a transition)</description>
<type>string</type>
</event_datum>
<event_datum id="debug_info">
<description>Debug string</description>
<type>string</type>
@@ -263,6 +267,10 @@ Call $this->AddCheckWarning($sWarningMessage) to display a warning.
<description>Creation flag</description>
<type>boolean</type>
</event_datum>
<event_datum id="stimulus_applied">
<description>Life cycle stimulus applied (null if not within a transition)</description>
<type>string</type>
</event_datum>
<event_datum id="debug_info">
<description>Debug string</description>
<type>string</type>
@@ -290,6 +298,10 @@ The modifications can be propagated to other objects.]]></description>
<description><![CDATA[For updates, the list of changes done during this operation]]></description>
<type>array</type>
</event_datum>
<event_datum id="stimulus_applied">
<description>Life cycle stimulus applied (null if not within a transition)</description>
<type>string</type>
</event_datum>
<event_datum id="debug_info">
<description>Debug string</description>
<type>string</type>
@@ -420,6 +432,14 @@ The only action allowed is to deny transitions with $this->DenyTransition($sTran
<description>The object inserted</description>
<type>DBObject</type>
</event_datum>
<event_datum id="is_new">
<description>Creation flag</description>
<type>boolean</type>
</event_datum>
<event_datum id="stimulus_applied">
<description>Life cycle stimulus applied (null if not within a transition)</description>
<type>string</type>
</event_datum>
<event_datum id="debug_info">
<description>Debug string</description>
<type>string</type>

View File

@@ -2024,8 +2024,8 @@ class MenuBlock extends DisplayBlock
$sSelectedClassName = MetaModel::GetName($sSelectedClass);
// Check rights on class
$bIsBulkModifyAllowed = (!MetaModel::IsAbstract($sSelectedClass)) && UserRights::IsActionAllowed($sSelectedClass, UR_ACTION_BULK_MODIFY, $oSet) && ($oReflectionClass->IsSubclassOf('cmdbAbstractObject'));
$bIsBulkDeleteAllowed = (bool) UserRights::IsActionAllowed($sSelectedClass, UR_ACTION_BULK_DELETE, $sSelectedClass);
$bIsBulkModifyAllowed = (!MetaModel::IsAbstract($sSelectedClass)) && UserRights::IsActionAllowed($sSelectedClass, UR_ACTION_BULK_MODIFY) && ($oReflectionClass->IsSubclassOf('cmdbAbstractObject'));
$bIsBulkDeleteAllowed = (bool) UserRights::IsActionAllowed($sSelectedClass, UR_ACTION_BULK_DELETE);
// Refine filter on selected class so bullk actions occur on the right class
$oSelectedClassFilter = $this->GetFilter()->DeepClone();

View File

@@ -1159,11 +1159,11 @@ class OQLMenuNode extends MenuNode
{
$sUsageId = utils::GetSafeId($sUsageId);
$oSearch = DBObjectSearch::FromOQL($sOql);
$sClass= $oSearch->GetClass();
$sClass= $oSearch->GetClass();
$sIcon = MetaModel::GetClassIcon($sClass, false);
if ($bSearchPane) {
$aParams = array_merge(['open' => $bSearchOpen, 'table_id' => $sUsageId, 'submit_on_load' => false], $aExtraParams);
$oBlock = new DisplayBlock($oSearch, 'search', false /* Asynchronous */, $aParams);
$oBlock = new DisplayBlock($oSearch, DisplayBlock::ENUM_STYLE_SEARCH, false /* Asynchronous */, $aParams);
$oBlock->Display($oPage, 0);
$oPage->add("<div class='sf_results_area ibo-add-margin-top-250' data-target='search_results'>");
}

View File

@@ -90,6 +90,27 @@ class UILinksWidgetDirect
return ConsoleBlockRenderer::RenderBlockTemplateInPage($oPage, $oBlock);
}
/**
* @param WebPage $oPage
* @param $oValue
* @param $aArgs
* @param $sFormPrefix
* @param $oCurrentObj
* @return BlockIndirectLinkSetEditTable
* @throws ArchivedObjectException
* @throws ConfigException
* @throws CoreException
* @throws CoreUnexpectedValue
* @since 3.2
*/
public function GetBlock(WebPage $oPage, $oValue, $aArgs, $sFormPrefix, $oCurrentObj)
{
$oBlock = new BlockDirectLinkSetEditTable($this, $this->sInputid);
$oBlock->InitTable($oPage, $oValue, $sFormPrefix, $oCurrentObj);
return $oBlock;
}
/**
* @param WebPage $oPage
* @param string $sProposedRealClass

View File

@@ -148,6 +148,27 @@ class UILinksWidget
return ConsoleBlockRenderer::RenderBlockTemplateInPage($oPage, $oBlock);
}
/**
* @param WebPage $oPage
* @param $oValue
* @param $aArgs
* @param $sFormPrefix
* @param $oCurrentObj
* @return BlockIndirectLinkSetEditTable
* @throws ArchivedObjectException
* @throws ConfigException
* @throws CoreException
* @throws CoreUnexpectedValue
* @since 3.2
*/
public function GetBlock(WebPage $oPage, $oValue, $aArgs, $sFormPrefix, $oCurrentObj): BlockIndirectLinkSetEditTable
{
$oBlock = new BlockIndirectLinkSetEditTable($this);
$oBlock->InitTable($oPage, $oValue, $aArgs, $sFormPrefix, $oCurrentObj, $this->m_aTableConfig);
return $oBlock;
}
/**
* @param WebPage $oPage
* @param DBObject $oCurrentObj

View File

@@ -249,9 +249,9 @@ class appUserPreferences extends DBObject
(
"category" => "gui",
"key_type" => "autoincrement",
"name_attcode" => "userid",
"name_attcode" => "login",
"state_attcode" => "",
"reconc_keys" => array(),
"reconc_keys" => array("userid","login"),
"db_table" => "priv_app_preferences",
"db_key_field" => "id",
"db_finalclass_field" => "",
@@ -260,6 +260,10 @@ class appUserPreferences extends DBObject
MetaModel::Init_Params($aParams);
MetaModel::Init_AddAttribute(new AttributeExternalKey("userid", array("targetclass"=>"User", "allowed_values"=>null, "sql"=>"userid", "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributePropertySet("preferences", array("allowed_values"=>null, "sql"=>"preferences", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeExternalField("org_id", array("allowed_values" => null, "extkey_attcode" => 'userid', "target_attcode" => "org_id")));
MetaModel::Init_AddAttribute(new AttributeExternalField("login", array("allowed_values" => null, "extkey_attcode" => 'userid', "target_attcode" => "login")));
MetaModel::Init_SetZListItems('list', array('org_id','preferences'));
MetaModel::Init_SetZListItems('default_search', array('userid','login','org_id'));
}
/**

View File

@@ -180,6 +180,7 @@ class utils
*/
private static $sAbsoluteUrlAppRootCache = null;
protected static function LoadParamFile($sParamFile)
{
if (!file_exists($sParamFile)) {
@@ -418,11 +419,26 @@ class utils
* @since 2.7.7, 3.0.2, 3.1.0 N°4899 - new 'url' filter
* @since 2.7.10 N°6606 use the utils::ENUM_SANITIZATION_* const
* @since 2.7.10 N°6606 new case for ENUM_SANITIZATION_FILTER_PHP_CLASS
* @since 3.2.1-1 N°8242 Allow value to be an array for every filter
*
* @link https://www.php.net/manual/en/filter.filters.sanitize.php PHP sanitization filters
*/
protected static function Sanitize_Internal($value, $sSanitizationFilter)
{
if (is_array($value))
{
$retValue = array();
foreach ($value as $key => $val)
{
$retValue[$key] = self::Sanitize_Internal($val, $sSanitizationFilter); // recursively check arrays
if ($retValue[$key] === false)
{
return false;
}
}
return $retValue;
}
switch ($sSanitizationFilter)
{
case static::ENUM_SANITIZATION_FILTER_INTEGER:
@@ -453,52 +469,36 @@ class utils
case static::ENUM_SANITIZATION_FILTER_PARAMETER:
case static::ENUM_SANITIZATION_FILTER_FIELD_NAME:
case static::ENUM_SANITIZATION_FILTER_TRANSACTION_ID:
if (is_array($value))
switch ($sSanitizationFilter)
{
$retValue = array();
foreach ($value as $key => $val)
{
$retValue[$key] = self::Sanitize_Internal($val, $sSanitizationFilter); // recursively check arrays
if ($retValue[$key] === false)
{
$retValue = false;
break;
}
}
}
else
{
switch ($sSanitizationFilter)
{
case static::ENUM_SANITIZATION_FILTER_TRANSACTION_ID:
// Same as parameter type but keep the dot character
// transaction_id, the dot is mostly for Windows servers when using file storage as the tokens are named *.tmp
// - See N°1835
// - Note: It must be included at the regexp beginning otherwise you'll get an invalid character error
$retValue = filter_var($value, FILTER_VALIDATE_REGEXP, array("options" => array("regexp" => '/^[\. A-Za-z0-9_=-]*$/')));
break;
case static::ENUM_SANITIZATION_FILTER_TRANSACTION_ID:
// Same as parameter type but keep the dot character
// transaction_id, the dot is mostly for Windows servers when using file storage as the tokens are named *.tmp
// - See N°1835
// - Note: It must be included at the regexp beginning otherwise you'll get an invalid character error
$retValue = filter_var($value, FILTER_VALIDATE_REGEXP, array("options" => array("regexp" => '/^[\. A-Za-z0-9_=-]*$/')));
break;
case static::ENUM_SANITIZATION_FILTER_ROUTE:
case static::ENUM_SANITIZATION_FILTER_OPERATION:
// - Routes should be of the "controller_namespace_code.controller_method_name" form
// - Operations should be allowed to be namespaced as well even though then don't have dedicated controller yet
$retValue = filter_var($value, FILTER_VALIDATE_REGEXP, array("options" => array("regexp" => '/^[\.A-Za-z0-9_-]*$/')));
break;
case static::ENUM_SANITIZATION_FILTER_ROUTE:
case static::ENUM_SANITIZATION_FILTER_OPERATION:
// - Routes should be of the "controller_namespace_code.controller_method_name" form
// - Operations should be allowed to be namespaced as well even though then don't have dedicated controller yet
$retValue = filter_var($value, FILTER_VALIDATE_REGEXP, array("options" => array("regexp" => '/^[\.A-Za-z0-9_-]*$/')));
break;
case static::ENUM_SANITIZATION_FILTER_PARAMETER:
$retValue = filter_var($value, FILTER_VALIDATE_REGEXP, array("options" => array("regexp" => '/^[ A-Za-z0-9_=-]*$/'))); // the '=', '%3D, '%2B', '%2F'
// Characters are used in serialized filters (starting 2.5, only the url encoded versions are presents, but the "=" is kept for BC)
break;
case static::ENUM_SANITIZATION_FILTER_PARAMETER:
$retValue = filter_var($value, FILTER_VALIDATE_REGEXP, array("options" => array("regexp" => '/^[ A-Za-z0-9_=-]*$/'))); // the '=', '%3D, '%2B', '%2F'
// Characters are used in serialized filters (starting 2.5, only the url encoded versions are presents, but the "=" is kept for BC)
break;
case static::ENUM_SANITIZATION_FILTER_FIELD_NAME:
$retValue = filter_var($value, FILTER_VALIDATE_REGEXP, array("options" => array("regexp" => '/^[A-Za-z0-9_]+(->[A-Za-z0-9_]+)*$/'))); // att_code or att_code->name or AttCode->Name or AttCode->Key2->Name
break;
case static::ENUM_SANITIZATION_FILTER_FIELD_NAME:
$retValue = filter_var($value, FILTER_VALIDATE_REGEXP, array("options" => array("regexp" => '/^[A-Za-z0-9_]+(->[A-Za-z0-9_]+)*$/'))); // att_code or att_code->name or AttCode->Name or AttCode->Key2->Name
break;
case static::ENUM_SANITIZATION_FILTER_CONTEXT_PARAM:
$retValue = filter_var($value, FILTER_VALIDATE_REGEXP, array("options" => array("regexp" => '/^[ A-Za-z0-9_=%:+-]*$/')));
break;
case static::ENUM_SANITIZATION_FILTER_CONTEXT_PARAM:
$retValue = filter_var($value, FILTER_VALIDATE_REGEXP, array("options" => array("regexp" => '/^[ A-Za-z0-9_=%:+-]*$/')));
break;
}
}
break;
@@ -1451,9 +1451,12 @@ class utils
* @return string A path to a folder into which any module can store cache data
* The corresponding folder is created or cleaned upon code compilation
*/
public static function GetCachePath()
public static function GetCachePath(string $sEnvironment = null): string
{
return static::GetDataPath().'cache-'.MetaModel::GetEnvironment().'/';
if (is_null($sEnvironment)) {
$sEnvironment = MetaModel::GetEnvironment();
}
return static::GetDataPath()."cache-$sEnvironment/";
}
/**
@@ -2390,53 +2393,75 @@ SQL;
return $bRet;
}
/**
* @param $sPath
*
* @return false|\ormDocument
* @throws \Exception
*
* @deprecated 3.2.1 use utils::GetDocumentFromSelfURL instead
*/
public static function IsSelfURL($sPath)
{
return self::GetDocumentFromSelfURL($sPath);
}
/**
* Check if the given URL is a link to download a document/image on the CURRENT iTop
* In such a case we can read the content of the file directly in the database (if the users rights allow) and return the ormDocument
*
* @Since 3.2.1 a local URL is transformed into a local file to read
*
* @param string $sPath
* @return false|ormDocument
* @throws Exception
*/
public static function IsSelfURL($sPath)
public static function GetDocumentFromSelfURL(string $sPath)
{
$result = false;
$sPageUrl = utils::GetAbsoluteUrlAppRoot().'pages/ajax.document.php';
if (substr($sPath, 0, strlen($sPageUrl)) == $sPageUrl)
{
if (utils::StartsWith($sPath, $sPageUrl)) {
// If the URL is an URL pointing to this instance of iTop, then
// extract the "query" part of the URL and analyze it
$sQuery = parse_url($sPath, PHP_URL_QUERY);
if ($sQuery !== null)
{
if ($sQuery !== null) {
$aParams = array();
foreach(explode('&', $sQuery) as $sChunk)
{
foreach (explode('&', $sQuery) as $sChunk) {
$aParts = explode('=', $sChunk ?? '');
if (count($aParts) != 2) continue;
if (count($aParts) != 2) {
continue;
}
$aParams[$aParts[0]] = urldecode($aParts[1]);
}
$result = array_key_exists('operation', $aParams) && array_key_exists('class', $aParams) && array_key_exists('id', $aParams) && array_key_exists('field', $aParams) && ($aParams['operation'] == 'download_document');
if ($result)
{
if ($result) {
// This is a 'download_document' operation, let's retrieve the document directly from the database
$sClass = $aParams['class'];
$iKey = $aParams['id'];
$sAttCode = $aParams['field'];
$oObj = MetaModel::GetObject($sClass, $iKey, false /* must exist */); // Users rights apply here !!
if ($oObj)
{
if ($oObj) {
/**
* @var ormDocument $result
*/
$result = clone $oObj->Get($sAttCode);
return $result;
return clone $oObj->Get($sAttCode);
}
}
}
throw new Exception('Invalid URL. This iTop URL is not pointing to a valid Document/Image.');
}
return $result;
if (utils::StartsWith($sPath, utils::GetAbsoluteUrlAppRoot())) {
$sFilePath = utils::LocalPath(APPROOT.substr($sPath, strlen(utils::GetAbsoluteUrlAppRoot())));
if (false === $sFilePath) {
return false;
}
$sFilePath = APPROOT.$sFilePath;
return ormDocument::FromFile($sFilePath);
}
return false;
}
/**
@@ -2444,68 +2469,28 @@ SQL;
* - an URL pointing to a blob (image/document) on the current iTop server
* - an http(s) URL
* - the local file system (but only if you are an administrator)
* @param string $sPath
*
* @param string|null $sPath
* @return ormDocument|null
* @throws Exception
*/
public static function FileGetContentsAndMIMEType($sPath)
{
$oUploadedDoc = null;
$aKnownExtensions = array(
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',
'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
'jpg' => 'image/jpeg',
'jpeg' => 'image/jpeg',
'gif' => 'image/gif',
'png' => 'image/png',
'pdf' => 'application/pdf',
'doc' => 'application/msword',
'dot' => 'application/msword',
'xls' => 'application/vnd.ms-excel',
'ppt' => 'application/vnd.ms-powerpoint',
'vsd' => 'application/x-visio',
'vdx' => 'application/visio.drawing',
'odt' => 'application/vnd.oasis.opendocument.text',
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
'odp' => 'application/vnd.oasis.opendocument.presentation',
'zip' => 'application/zip',
'txt' => 'text/plain',
'htm' => 'text/html',
'html' => 'text/html',
'exe' => 'application/octet-stream',
);
$sData = null;
$sMimeType = 'text/plain'; // Default MIME Type: treat the file as a bunch a characters...
$sFileName = 'uploaded-file'; // Default name for downloaded-files
$sExtension = '.txt'; // Default file extension in case we don't know the MIME Type
if(empty($sPath))
{
if (utils::IsNullOrEmptyString($sPath)) {
// Empty path (NULL or '') means that there is no input, making an empty document.
$oUploadedDoc = new ormDocument('', '', '');
return new ormDocument('', '', '');
}
elseif (static::IsURL($sPath))
{
if ($oUploadedDoc = static::IsSelfURL($sPath))
{
// Nothing more to do, we've got it !!
if (static::IsURL($sPath)) {
$oUploadedDoc = static::GetDocumentFromSelfURL($sPath);
if ($oUploadedDoc) {
return $oUploadedDoc;
}
else
{
// Remote file, let's use the HTTP headers to find the MIME Type
$sData = @file_get_contents($sPath);
if ($sData === false)
{
IssueLog::Error(<<<TXT
// Remote file, let's use the HTTP headers to find the MIME Type
$sData = @file_get_contents($sPath);
if ($sData === false) {
IssueLog::Error(<<<TXT
Failed to load the file from URL. This can happen for multiple reasons:
- Invalid URL
- URL using HTTPS with an untrusted certificate on the remote server
@@ -2514,54 +2499,40 @@ TXT
, LogChannels::CORE, [
'URL' => $sPath,
]);
throw new Exception("Failed to load the file from the URL '$sPath'.");
}
else
{
if (isset($http_response_header))
{
$aHeaders = static::ParseHeaders($http_response_header);
$sMimeType = array_key_exists('Content-Type', $aHeaders) ? strtolower($aHeaders['Content-Type']) : 'application/x-octet-stream';
// Compute the file extension from the MIME Type
foreach ($aKnownExtensions as $sExtValue => $sMime) {
if ($sMime === $sMimeType) {
$sExtension = '.'.$sExtValue;
break;
}
}
}
$sPathName = pathinfo($sPath, PATHINFO_FILENAME);
if (utils::IsNotNullOrEmptyString($sPathName)) {
$sFileName = $sPathName;
}
$sFileName .= $sExtension;
}
$oUploadedDoc = new ormDocument($sData, $sMimeType, $sFileName);
throw new Exception("Failed to load the file from the URL '$sPath'.");
}
}
else if (UserRights::IsAdministrator())
{
// Only administrators are allowed to read local files
$sData = @file_get_contents($sPath);
if ($sData === false)
{
throw new Exception("Failed to load the file '$sPath'. The file does not exist or the current process is not allowed to access it.");
}
$sExtension = strtolower(pathinfo($sPath, PATHINFO_EXTENSION));
$sFileName = basename($sPath);
if (array_key_exists($sExtension, $aKnownExtensions))
{
$sMimeType = $aKnownExtensions[$sExtension];
$sMimeType = 'text/plain'; // Default MIME Type: treat the file as a bunch a characters...
$sFileName = 'uploaded-file'; // Default name for downloaded-files
$sExtension = '.txt'; // Default file extension in case we don't know the MIME Type
if (isset($http_response_header)) {
$aHeaders = static::ParseHeaders($http_response_header);
$sMimeType = array_key_exists('Content-Type', $aHeaders) ? strtolower($aHeaders['Content-Type']) : 'application/x-octet-stream';
// Compute the file extension from the MIME Type
foreach (ormDocument::GetKnownExtensions() as $sExtValue => $sMime) {
if ($sMime === $sMimeType) {
$sExtension = '.'.$sExtValue;
break;
}
}
}
else if (extension_loaded('fileinfo'))
{
$finfo = new finfo(FILEINFO_MIME);
$sMimeType = $finfo->file($sPath);
$sPathName = pathinfo($sPath, PATHINFO_FILENAME);
if (utils::IsNotNullOrEmptyString($sPathName)) {
$sFileName = $sPathName;
}
$oUploadedDoc = new ormDocument($sData, $sMimeType, $sFileName);
$sFileName .= $sExtension;
return new ormDocument($sData, $sMimeType, $sFileName);
}
return $oUploadedDoc;
// Local file
if (UserRights::IsAdministrator()) {
// Only administrators are allowed to read local files
return ormDocument::FromFile($sPath);
}
return null;
}
protected static function ParseHeaders($aHeaders)
@@ -3132,30 +3103,13 @@ TXT
* @throws \Exception
* @since 3.0.0
*/
public static function GetMentionedObjectsFromText(string $sText, string $sFormat = self::ENUM_TEXT_FORMAT_HTML): array
public static function GetMentionedObjectsFromText(string $sText): array
{
// First transform text so it can be parsed
switch ($sFormat) {
case static::ENUM_TEXT_FORMAT_HTML:
$sText = static::HtmlToText($sText);
break;
default:
// Don't transform it
break;
}
// Then parse text to find objects
$aMentionedObjects = array();
$aMentionMatches = array();
// Note: As the sanitizer (or CKEditor autocomplete plugin? 🤔) removes data-* attributes from the hyperlink,
// - we can't use the following (simpler) regexp that only checks data attributes on hyperlinks, which would have worked for hyperlinks pointing to any GUIs: '/<a\s*([^>]*)data-object-class="([^"]*)"\s*data-object-id="([^"]*)">/i'
// - instead we use a regexp to match the following pattern '[Some object label](<APP_ROOT_URL>...&class=<OBJECT_CLASS>&id=<OBJECT_ID>...)' which only works for the backoffice
// If we change the sanitizer, we might want to switch to the other regexp as it's universal and easier to read
$sAppRootUrlForRegExp = addcslashes(utils::GetAbsoluteUrlAppRoot(), '/&');
preg_match_all("/\[([^\]]*)\]\({$sAppRootUrlForRegExp}[^\)]*\&class=([^\)\&]*)\&id=([\d]*)[^\)]*\)/i", $sText, $aMentionMatches);
$aMentionedObjects = [];
$aMentionMatches = [];
$sText = html_entity_decode($sText);
preg_match_all('/<a\s*([^>]*)data-object-class="([^"]*)"\s.*data-object-key="([^"]*)"/Ui', $sText, $aMentionMatches);
foreach ($aMentionMatches[0] as $iMatchIdx => $sCompleteMatch) {
$sMatchedClass = $aMentionMatches[2][$iMatchIdx];
$sMatchedId = $aMentionMatches[3][$iMatchIdx];

View File

@@ -23,7 +23,7 @@ define('ITOP_DESIGN_LATEST_VERSION', '3.2');
* @used-by utils::GetItopVersionWikiSyntax()
* @used-by iTopModulesPhpVersionIntegrationTest
*/
define('ITOP_CORE_VERSION', '3.2.0');
define('ITOP_CORE_VERSION', '3.2.1');
/**
* @var string

102
composer.lock generated
View File

@@ -3929,6 +3929,82 @@
],
"time": "2023-01-26T09:26:14+00:00"
},
{
"name": "symfony/polyfill-php81",
"version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php81.git",
"reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c",
"reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c",
"shasum": ""
},
"require": {
"php": ">=7.2"
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
}
},
"autoload": {
"files": [
"bootstrap.php"
],
"psr-4": {
"Symfony\\Polyfill\\Php81\\": ""
},
"classmap": [
"Resources/stubs"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/polyfill-php83",
"version": "v1.28.0",
@@ -4976,30 +5052,38 @@
},
{
"name": "twig/twig",
"version": "v3.8.0",
"version": "v3.16.0",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d"
"reference": "475ad2dc97d65d8631393e721e7e44fb544f0561"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/9d15f0ac07f44dc4217883ec6ae02fd555c6f71d",
"reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/475ad2dc97d65d8631393e721e7e44fb544f0561",
"reference": "475ad2dc97d65d8631393e721e7e44fb544f0561",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"php": ">=8.0.2",
"symfony/deprecation-contracts": "^2.5|^3",
"symfony/polyfill-ctype": "^1.8",
"symfony/polyfill-mbstring": "^1.3",
"symfony/polyfill-php80": "^1.22"
"symfony/polyfill-php81": "^1.29"
},
"require-dev": {
"phpstan/phpstan": "^2.0",
"psr/container": "^1.0|^2.0",
"symfony/phpunit-bridge": "^5.4.9|^6.3|^7.0"
"symfony/phpunit-bridge": "^5.4.9|^6.4|^7.0"
},
"type": "library",
"autoload": {
"files": [
"src/Resources/core.php",
"src/Resources/debug.php",
"src/Resources/escaper.php",
"src/Resources/string_loader.php"
],
"psr-4": {
"Twig\\": "src/"
}
@@ -5032,7 +5116,7 @@
],
"support": {
"issues": "https://github.com/twigphp/Twig/issues",
"source": "https://github.com/twigphp/Twig/tree/v3.8.0"
"source": "https://github.com/twigphp/Twig/tree/v3.16.0"
},
"funding": [
{
@@ -5044,7 +5128,7 @@
"type": "tidelift"
}
],
"time": "2023-11-21T18:54:41+00:00"
"time": "2024-11-29T08:27:05+00:00"
},
{
"name": "webmozart/assert",

View File

@@ -181,7 +181,7 @@ abstract class Action extends cmdbAbstractObject
{
parent::DisplayBareRelations($oPage, false);
if ($oPage instanceof iTopWebPage) {
if ($oPage instanceof iTopWebPage && !$this->IsNew()) {
$this->GenerateLastExecutionsTab($oPage, $bEditMode);
}
}

View File

@@ -89,7 +89,7 @@ abstract class AsyncTask extends DBObject
// The value is set from null to planned in the setup program
MetaModel::Init_AddAttribute(new AttributeEnum("status", array("allowed_values"=>new ValueSetEnum('planned,running,idle,error'), "sql"=>"status", "default_value"=>"planned", "is_null_allowed"=>true, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeDateTime("created", array("allowed_values"=>null, "sql"=>"created", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeDateTime("created", array("allowed_values"=>null, "sql"=>"created", "default_value"=>"NOW()", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeDateTime("started", array("allowed_values"=>null, "sql"=>"started", "default_value"=>"", "is_null_allowed"=>true, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeDateTime("planned", array("allowed_values"=>null, "sql"=>"planned", "default_value"=>"", "is_null_allowed"=>true, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeExternalKey("event_id", array("targetclass"=>"Event", "jointype"=> "", "allowed_values"=>null, "sql"=>"event_id", "is_null_allowed"=>true, "on_target_delete"=>DEL_SILENT, "depends_on"=>array())));
@@ -489,7 +489,7 @@ class AsyncSendNewsroom extends AsyncTask {
MetaModel::Init_AddAttribute(new AttributeInteger("object_id", array("allowed_values"=>null, "sql"=>"object_id", "default_value"=>null, "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeString("object_class", array("allowed_values"=>null, "sql"=>"object_class", "default_value"=>null, "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeText("url", array("allowed_values"=>null, "sql"=>"url", "default_value"=>null, "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeDateTime("date", array("allowed_values"=>null, "sql"=>"date", "default_value"=>null, "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeDateTime("date", array("allowed_values"=>null, "sql"=>"date", "default_value"=>'NOW()', "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
}

View File

@@ -142,7 +142,7 @@ abstract class AttributeDefinition
protected $aCSSClasses;
public function GetType()
public function GetType()
{
return Dict::S('Core:'.get_class($this));
}
@@ -1715,8 +1715,8 @@ class AttributeLinkedSet extends AttributeDefinition
public function GetEditMode()
{
return $this->GetOptional('edit_mode', LINKSET_EDITMODE_ACTIONS);
}
}
/**
* @return int see LINKSET_EDITWHEN_* constants
* @since 3.1.1 3.2.0 N°6385
@@ -1758,7 +1758,7 @@ class AttributeLinkedSet extends AttributeDefinition
{
return $this->GetOptional('with_php_computation', false);
}
public function GetLinkedClass()
{
return $this->Get('linked_class');
@@ -4193,7 +4193,7 @@ class AttributeFinalClass extends AttributeString
*/
class AttributePassword extends AttributeString implements iAttributeNoGroupBy
{
const SEARCH_WIDGET_TYPE = self::SEARCH_WIDGET_TYPE_RAW;
const SEARCH_WIDGET_TYPE = self::SEARCH_WIDGET_TYPE_RAW;
/**
* Useless constructor, but if not present PHP 7.4.0/7.4.1 is crashing :( (N°2329)
@@ -4270,7 +4270,7 @@ class AttributePassword extends AttributeString implements iAttributeNoGroupBy
*/
class AttributeEncryptedString extends AttributeString implements iAttributeNoGroupBy
{
const SEARCH_WIDGET_TYPE = self::SEARCH_WIDGET_TYPE_RAW;
const SEARCH_WIDGET_TYPE = self::SEARCH_WIDGET_TYPE_RAW;
protected function GetSQLCol($bFullSpec = false)
{
@@ -4440,7 +4440,7 @@ class AttributeText extends AttributeString
{
// Is there a way to know the current limitation for mysql?
// See mysql_field_len()
return 65535;
return 16383; // number of characters (that can be 1-4 bytes long), not of bytes
}
public static function RenderWikiHtml($sText, $bWikiOnly = false)
@@ -6346,9 +6346,6 @@ class AttributeDateTime extends AttributeDBField
$oFormField = parent::MakeFormField($oObject, $oFormField);
// After call to the parent as it sets the current value
$oFormField->SetCurrentValue($this->GetFormat()->Format($oObject->Get($this->GetCode())));
return $oFormField;
}
@@ -6433,8 +6430,26 @@ class AttributeDateTime extends AttributeDBField
public function GetDefaultValue(DBObject $oHostObject = null)
{
if (!$this->IsNullAllowed()) {
return date($this->GetInternalFormat());
$sDefaultValue = $this->Get('default_value');
if (utils::IsNotNullOrEmptyString($sDefaultValue)) {
try {
$sDefaultDate = Expression::FromOQL($sDefaultValue)->Evaluate([]);
} catch (Exception $e) {
try {
$sDefaultDate = Expression::FromOQL('"'.$sDefaultValue.'"')->Evaluate([]);
} catch (Exception $e) {
IssueLog::Error("Invalid default value '$sDefaultValue' for field '{$this->GetCode()}' on class '{$this->GetHostClass()}', defaulting to null");
return $this->GetNullValue();
}
}
try {
$oDate = new DateTimeImmutable($sDefaultDate);
} catch (Exception $e) {
IssueLog::Error("Invalid default value '$sDefaultValue' for field '{$this->GetCode()}' on class '{$this->GetHostClass()}', defaulting to null");
return $this->GetNullValue();
}
return $oDate->format($this->GetInternalFormat());
}
return $this->GetNullValue();
}
@@ -9433,8 +9448,13 @@ class AttributeStopWatch extends AttributeDefinition
case 'deadline':
if ($value)
{
$sDate = date(AttributeDateTime::GetInternalFormat(), $value);
$sRet = AttributeDeadline::FormatDeadline($sDate);
if (is_int($value))
{
$sDate = date(AttributeDateTime::GetInternalFormat(), $value);
$sRet = AttributeDeadline::FormatDeadline($sDate);
} else {
$sRet = $value;
}
}
else
{
@@ -9984,7 +10004,7 @@ class AttributeSubItem extends AttributeDefinition
*/
class AttributeOneWayPassword extends AttributeDefinition implements iAttributeNoGroupBy
{
const SEARCH_WIDGET_TYPE = self::SEARCH_WIDGET_TYPE_RAW;
const SEARCH_WIDGET_TYPE = self::SEARCH_WIDGET_TYPE_RAW;
/**
* Useless constructor, but if not present PHP 7.4.0/7.4.1 is crashing :( (N°2329)

View File

@@ -201,6 +201,7 @@ abstract class AbstractWeeklyScheduledProcess implements iScheduledProcess
static::MODULE_SETTING_TIME,
static::GetDefaultModuleSettingTime()
);
$sProcessTime = trim($sProcessTime);
if (!preg_match('/[0-2]\d:[0-5]\d/', $sProcessTime))
{
throw new ProcessInvalidConfigException($this->GetModuleName().": wrong format for setting '".static::MODULE_SETTING_TIME."' (found '$sProcessTime')");
@@ -230,7 +231,7 @@ abstract class AbstractWeeklyScheduledProcess implements iScheduledProcess
$iFirstDayOfWeek = $aDays[0];
$iDayMove = $oNow->format('N') - $iFirstDayOfWeek;
$oRet = clone $oNow;
$oRet->modify('-'.$iDayMove.' days');
$oRet->modify(-$iDayMove.' days');
$oRet->modify('+1 weeks');
}
else
@@ -238,7 +239,7 @@ abstract class AbstractWeeklyScheduledProcess implements iScheduledProcess
$iNextDayOfWeek = $aDays[$iNextPos];
$iMove = $iNextDayOfWeek - $oNow->format('N');
$oRet = clone $oNow;
$oRet->modify('+'.$iMove.' days');
$oRet->modify($iMove.' days');
}
list($sHours, $sMinutes) = explode(':', $sProcessTime);
$oRet->setTime((int)$sHours, (int)$sMinutes);

View File

@@ -70,7 +70,7 @@ class BulkExportResult extends DBObject
);
MetaModel::Init_Params($aParams);
MetaModel::Init_AddAttribute(new AttributeDateTime("created", array("allowed_values"=>null, "sql"=>"created", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeDateTime("created", array("allowed_values"=>null, "sql"=>"created", "default_value"=>"NOW()", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeInteger("user_id", array("allowed_values"=>null, "sql"=>"user_id", "default_value"=>0, "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeInteger("chunk_size", array("allowed_values"=>null, "sql"=>"chunk_size", "default_value"=>0, "is_null_allowed"=>true, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeString("format", array("allowed_values"=>null, "sql"=>"format", "default_value"=>'', "is_null_allowed"=>false, "depends_on"=>array())));

View File

@@ -33,7 +33,7 @@ class CMDBChange extends DBObject
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();
MetaModel::Init_AddAttribute(new AttributeDateTime("date", array("allowed_values"=>null, "sql"=>"date", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeDateTime("date", array("allowed_values"=>null, "sql"=>"date", "default_value"=>"NOW()", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeString("userinfo", array("allowed_values"=>null, "sql"=>"userinfo", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeExternalKey("user_id", array("allowed_values"=>null, "sql"=>"user_id", "targetclass"=>"User", "is_null_allowed"=>true, "on_target_delete"=>DEL_MANUAL, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeEnum("origin", array("allowed_values"=>new ValueSetEnum(implode(',', [CMDBChangeOrigin::INTERACTIVE, CMDBChangeOrigin::CSV_INTERACTIVE, CMDBChangeOrigin::CSV_IMPORT, CMDBChangeOrigin::WEBSERVICE_SOAP, CMDBChangeOrigin::WEBSERVICE_REST, CMDBChangeOrigin::SYNCHRO_DATA_SOURCE, CMDBChangeOrigin::EMAIL_PROCESSING, CMDBChangeOrigin::CUSTOM_EXTENSION])), "sql"=>"origin", "default_value"=>CMDBChangeOrigin::INTERACTIVE, "is_null_allowed"=>true, "depends_on"=>array())));

View File

@@ -108,7 +108,7 @@ class DefaultWorkingTimeComputer implements iWorkingTimeComputer
// Default implementation: 24x7, no holidays: to compute the deadline, just add
// the specified duration to the given date/time
$oResult = clone $oStartDate;
$oResult->modify('+'.$iDuration.' seconds');
$oResult->modify($iDuration.' seconds');
if (class_exists('WorkingTimeRecorder'))
{
WorkingTimeRecorder::SetValues($oStartDate->format('U'), $oResult->format('U'), $iDuration, WorkingTimeRecorder::COMPUTED_END);

View File

@@ -71,7 +71,7 @@ define('DEFAULT_MAX_DISPLAY_LIMIT', 30);
define('DEFAULT_STANDARD_RELOAD_INTERVAL', 5 * 60);
define('DEFAULT_FAST_RELOAD_INTERVAL', 1 * 60);
define('DEFAULT_SECURE_CONNECTION_REQUIRED', false);
define('DEFAULT_ALLOWED_LOGIN_TYPES', 'form|external|basic');
define('DEFAULT_ALLOWED_LOGIN_TYPES', 'form|external|basic|token');
define('DEFAULT_EXT_AUTH_VARIABLE', '$_SERVER[\'REMOTE_USER\']');
define('DEFAULT_ENCRYPTION_KEY', '@iT0pEncr1pti0n!'); // We'll use a random generated key later (if possible)
define('DEFAULT_ENCRYPTION_LIB', 'Mcrypt'); // We'll define the best encryption available later
@@ -1747,6 +1747,14 @@ class Config
'source_of_value' => '',
'show_in_conf_sample' => false,
],
'developer_mode.interface_cache.enabled' => [
'type' => 'bool',
'description' => 'If true then InterfaceDiscovery uses dynamic cache (in developer_mode)',
'default' => false,
'value' => false,
'source_of_value' => '',
'show_in_conf_sample' => false,
],
'theme.enable_precompilation' => [
'type' => 'bool',
'description' => 'If false, theme compilation will not use any precompiled file setup optimization.)',

View File

@@ -850,6 +850,18 @@
<field id="language" xsi:type="AttributeApplicationLanguage"/>
</fields>
</class>
<class id="Event" _delta="define">
<!-- Generated by toolkit/export-class-to-meta.php -->
<parent>DBObject</parent>
<properties>
<category>core/cmdb,view_in_gui</category>
</properties>
<fields>
<field id="message" xsi:type="AttributeText"/>
<field id="date" xsi:type="AttributeDateTime"/>
<field id="userinfo" xsi:type="AttributeString"/>
</fields>
</class>
<class id="EventNotification" _delta="define">
<!-- Generated by toolkit/export-class-to-meta.php -->
<parent>Event</parent>

View File

@@ -212,6 +212,8 @@ abstract class DBObject implements iDisplay
private $aEventListeners = [];
private array $aAllowedTransitions = [];
private ?string $sStimulusBeingApplied = null;
/**
* DBObject constructor.
*
@@ -758,10 +760,10 @@ abstract class DBObject implements iDisplay
*/
public function SetTrim($sAttCode, $sValue)
{
$oAttDef = MetaModel::GetAttributeDef(get_class($this), $sAttCode);
$iMaxSize = $oAttDef->GetMaxSize();
$sLength = mb_strlen($sValue);
if ($iMaxSize && ($sLength > $iMaxSize)) {
if (!$this->StringFitsInField($sAttCode, $sValue)) {
$oAttDef = MetaModel::GetAttributeDef(get_class($this), $sAttCode);
$iMaxSize = $oAttDef->GetMaxSize();
$sLength = mb_strlen($sValue);
$sMessage = " -truncated ($sLength chars)";
$sValue = mb_substr($sValue, 0, $iMaxSize - mb_strlen($sMessage)).$sMessage;
}
@@ -816,6 +818,24 @@ abstract class DBObject implements iDisplay
$oKPI->ComputeStatsForExtension($this, 'AfterDelete');
}
/**
* @param string $sAttCode
* @param string $sValue
*
* @return bool
* @throws \Exception
*
* @Since 3.2.2
*/
public function StringFitsInField(string $sAttCode, string $sValue): bool
{
$oAttDef = MetaModel::GetAttributeDef(get_class($this), $sAttCode);
$iMaxSize = $oAttDef->GetMaxSize();
$sLength = mb_strlen($sValue);
return !($iMaxSize && ($sLength > $iMaxSize));
}
/**
* Compute (and optionally start) the StopWatches deadlines
*
@@ -1206,7 +1226,7 @@ abstract class DBObject implements iDisplay
if ($aCallInfo["function"] != "ComputeValues") continue;
return; //skip!
}
$this->FireEventComputeValues();
$this->FireEventComputeValues($this->sStimulusBeingApplied);
$oKPI = new ExecutionKPI();
$this->ComputeValues();
$oKPI->ComputeStatsForExtension($this, 'ComputeValues');
@@ -2130,7 +2150,7 @@ abstract class DBObject implements iDisplay
return "Bad type";
}
elseif (($oAtt instanceof AttributeClassAttCodeSet) || ($oAtt instanceof AttributeEnumSet))
elseif ($oAtt instanceof AttributeSet)
{
if (is_string($toCheck))
{
@@ -2669,7 +2689,7 @@ abstract class DBObject implements iDisplay
// Ultimate check - ensure DB integrity
$this->SetReadOnly('No modification allowed during CheckToCreate');
$this->FireEventCheckToWrite();
$this->FireEventCheckToWrite($this->sStimulusBeingApplied);
$this->SetReadWrite();
$oKPI = new ExecutionKPI();
@@ -2865,6 +2885,14 @@ abstract class DBObject implements iDisplay
protected function ListChangedValues(array $aProposal)
{
$aDelta = array();
$sClass = get_class($this);
if (MetaModel::HasLifecycle($sClass) && utils::IsNotNullOrEmptyString($this->sStimulusBeingApplied)) {
$sStateAttCode = MetaModel::GetStateAttributeCode($sClass);
if (!in_array($sStateAttCode, $aProposal)) {
// Same state but the transition was asked, act as if the state was changed
$aDelta[$sStateAttCode] = $this->m_aCurrValues[$sStateAttCode];
}
}
foreach ($aProposal as $sAtt => $proposedValue)
{
if (!array_key_exists($sAtt, $this->m_aOrigValues))
@@ -3398,7 +3426,7 @@ abstract class DBObject implements iDisplay
$this->OnInsert();
$oKPI->ComputeStatsForExtension($this, 'OnInsert');
$this->FireEventBeforeWrite();
$this->FireEventBeforeWrite(null);
// If not automatically computed, then check that the key is given by the caller
if (!MetaModel::IsAutoIncrementKey($sRootClass)) {
@@ -3494,6 +3522,7 @@ abstract class DBObject implements iDisplay
$this->m_bIsInDB = true;
$this->m_bDirty = false;
$this->m_bFullyLoaded = true;
foreach ($this->m_aCurrValues as $sAttCode => $value) {
if (is_object($value)) {
$value = clone $value;
@@ -3532,7 +3561,7 @@ abstract class DBObject implements iDisplay
*/
protected function PostInsertActions(): void
{
$this->FireEventAfterWrite([], true);
$this->FireEventAfterWrite([], true, null);
$oKPI = new ExecutionKPI();
$this->AfterInsert();
$oKPI->ComputeStatsForExtension($this, 'AfterInsert');
@@ -3613,13 +3642,13 @@ abstract class DBObject implements iDisplay
*/
public function DBUpdate()
{
$this->LogCRUDEnter(__METHOD__);
if (!MetaModel::StartReentranceProtection($this)) {
$this->LogCRUDExit(__METHOD__, 'Rejected (reentrance)');
return false;
}
$this->LogCRUDEnter(__METHOD__);
if (!$this->m_bIsInDB)
{
throw new CoreException("DBUpdate: could not update a newly created object, please call DBInsert instead");
@@ -3640,7 +3669,7 @@ abstract class DBObject implements iDisplay
$this->OnUpdate();
$oKPI->ComputeStatsForExtension($this, 'OnUpdate');
$this->FireEventBeforeWrite();
$this->FireEventBeforeWrite($this->sStimulusBeingApplied);
// Freeze the changes at this point
$this->InitPreviousValuesForUpdatedAttributes();
@@ -3808,7 +3837,7 @@ abstract class DBObject implements iDisplay
}
try {
$this->PostUpdateActions($aChanges, $sClass);
$this->PostUpdateActions($this->m_aPreviousValuesForUpdatedAttributes, $sClass);
}
catch (Exception $e) {
$this->LogCRUDExit(__METHOD__, 'Error: '.$e->getMessage());
@@ -3851,7 +3880,9 @@ abstract class DBObject implements iDisplay
*/
protected function PostUpdateActions(array $aChanges): void
{
$this->FireEventAfterWrite($aChanges, false);
$sStimulusBeingApplied = $this->sStimulusBeingApplied;
$this->sStimulusBeingApplied = null;
$this->FireEventAfterWrite($aChanges, false, $sStimulusBeingApplied);
$oKPI = new ExecutionKPI();
$this->AfterUpdate();
$oKPI->ComputeStatsForExtension($this, 'AfterUpdate');
@@ -3863,39 +3894,37 @@ abstract class DBObject implements iDisplay
$this->ActivateOnObjectUpdateTriggersForTargetObjects();
$sClass = get_class($this);
if (MetaModel::HasLifecycle($sClass))
if (utils::IsNotNullOrEmptyString($sStimulusBeingApplied))
{
$sStateAttCode = MetaModel::GetStateAttributeCode($sClass);
if (isset($this->m_aPreviousValuesForUpdatedAttributes[$sStateAttCode])) {
$sPreviousState = $this->m_aPreviousValuesForUpdatedAttributes[$sStateAttCode];
// Change state triggers...
$aParams = array(
'class_list' => MetaModel::EnumParentClasses($sClass, ENUM_PARENT_CLASSES_ALL),
'previous_state' => $sPreviousState,
'new_state' => $this->Get($sStateAttCode),
);
$oSet = new DBObjectSet(DBObjectSearch::FromOQL('SELECT TriggerOnStateLeave AS t WHERE t.target_class IN (:class_list) AND t.state=:previous_state'), array(), $aParams);
while ($oTrigger = $oSet->Fetch()) {
/** @var \TriggerOnStateLeave $oTrigger */
try {
$oTrigger->DoActivate($this->ToArgs('this'));
}
catch (Exception $e) {
$oTrigger->LogException($e, $this);
utils::EnrichRaisedException($oTrigger, $e);
}
$sPreviousState = $this->m_aPreviousValuesForUpdatedAttributes[$sStateAttCode];
// Change state triggers...
$aParams = array(
'class_list' => MetaModel::EnumParentClasses($sClass, ENUM_PARENT_CLASSES_ALL),
'previous_state' => $sPreviousState,
'new_state' => $this->Get($sStateAttCode),
);
$oSet = new DBObjectSet(DBObjectSearch::FromOQL('SELECT TriggerOnStateLeave AS t WHERE t.target_class IN (:class_list) AND t.state=:previous_state'), array(), $aParams);
while ($oTrigger = $oSet->Fetch()) {
/** @var \TriggerOnStateLeave $oTrigger */
try {
$oTrigger->DoActivate($this->ToArgs('this'));
}
catch (Exception $e) {
$oTrigger->LogException($e, $this);
utils::EnrichRaisedException($oTrigger, $e);
}
}
$oSet = new DBObjectSet(DBObjectSearch::FromOQL('SELECT TriggerOnStateEnter AS t WHERE t.target_class IN (:class_list) AND t.state=:new_state'), array(), $aParams);
while ($oTrigger = $oSet->Fetch()) {
/** @var \TriggerOnStateEnter $oTrigger */
try {
$oTrigger->DoActivate($this->ToArgs('this'));
}
catch (Exception $e) {
$oTrigger->LogException($e, $this);
utils::EnrichRaisedException($oTrigger, $e);
}
$oSet = new DBObjectSet(DBObjectSearch::FromOQL('SELECT TriggerOnStateEnter AS t WHERE t.target_class IN (:class_list) AND t.state=:new_state'), array(), $aParams);
while ($oTrigger = $oSet->Fetch()) {
/** @var \TriggerOnStateEnter $oTrigger */
try {
$oTrigger->DoActivate($this->ToArgs('this'));
}
catch (Exception $e) {
$oTrigger->LogException($e, $this);
utils::EnrichRaisedException($oTrigger, $e);
}
}
}
@@ -4023,7 +4052,7 @@ abstract class DBObject implements iDisplay
foreach ($aUpdatedLogAttCodes as $sAttCode) {
/** @var \ormCaseLog $oUpdatedCaseLog */
$oUpdatedCaseLog = $this->Get($sAttCode);
$aMentionedObjects = array_merge_recursive($aMentionedObjects, utils::GetMentionedObjectsFromText($oUpdatedCaseLog->GetModifiedEntry()));
$aMentionedObjects = array_merge_recursive($aMentionedObjects, utils::GetMentionedObjectsFromText($oUpdatedCaseLog->GetModifiedEntry(ormCaseLog::ENUM_FORMAT_HTML)));
}
// 3 - Trigger for those objects
@@ -4500,6 +4529,8 @@ abstract class DBObject implements iDisplay
*/
public function ApplyStimulus($sStimulusCode, $bDoNotWrite = false)
{
$this->LogCRUDEnter(__METHOD__, "Code: $sStimulusCode");
$sClass = get_class($this);
if (!MetaModel::HasLifecycle($sClass))
{
@@ -4526,6 +4557,8 @@ abstract class DBObject implements iDisplay
} else {
$aBackupValues[$sAttCode] = $value;
}
} else {
$aBackupValues[$sAttCode] = $oAttDef->GetNullValue();
}
}
@@ -4533,7 +4566,6 @@ abstract class DBObject implements iDisplay
// Change the state before proceeding to the actions, this is necessary because an action might
// trigger another stimuli (alternative: push the stimuli into a queue)
$sPreviousState = $this->Get($sStateAttCode);
$sNewState = $aTransitionDef['target_state'];
$this->Set($sStateAttCode, $sNewState);
@@ -4541,67 +4573,71 @@ abstract class DBObject implements iDisplay
// array('target_state'=>..., 'actions'=>array of handlers procs, 'user_restriction'=>TBD
$bSuccess = true;
$sActionDesc = '';
foreach ($aTransitionDef['actions'] as $actionHandler)
{
if (is_string($actionHandler))
{
// Old (pre-2.1.0 modules) action definition without any parameter
$aActionCallSpec = array($this, $actionHandler);
$sActionDesc = $sClass.'::'.$actionHandler;
// Prevent current object from being updated by the actions
$this->AddCurrentObjectInCrudStack('APPLY_STIMULUS');
$bIsNewlyProtected = MetaModel::StartReentranceProtection($this);
try {
foreach ($aTransitionDef['actions'] as $actionHandler) {
if (is_string($actionHandler)) {
// Old (pre-2.1.0 modules) action definition without any parameter
$aActionCallSpec = array($this, $actionHandler);
$sActionDesc = $sClass.'::'.$actionHandler;
if (!is_callable($aActionCallSpec))
{
throw new CoreException("Unable to call action: $sClass::$actionHandler");
}
$bRet = call_user_func($aActionCallSpec, $sStimulusCode);
}
else // if (is_array($actionHandler))
{
// New syntax: 'verb' and typed parameters
$sAction = $actionHandler['verb'];
$sActionDesc = "$sClass::$sAction";
$aParams = array();
foreach($actionHandler['params'] as $aDefinition)
{
$sParamType = array_key_exists('type', $aDefinition) ? $aDefinition['type'] : 'string';
switch($sParamType)
{
case 'int':
$value = (int)$aDefinition['value'];
break;
case 'float':
$value = (float)$aDefinition['value'];
break;
case 'bool':
$value = (bool)$aDefinition['value'];
break;
case 'reference':
$value = ${$aDefinition['value']};
break;
case 'string':
default:
$value = (string)$aDefinition['value'];
if (!is_callable($aActionCallSpec)) {
throw new CoreException("Unable to call action: $sClass::$actionHandler");
}
$aParams[] = $value;
$bRet = call_user_func($aActionCallSpec, $sStimulusCode);
} else // if (is_array($actionHandler))
{
// New syntax: 'verb' and typed parameters
$sAction = $actionHandler['verb'];
$sActionDesc = "$sClass::$sAction";
$aParams = array();
foreach ($actionHandler['params'] as $aDefinition) {
$sParamType = array_key_exists('type', $aDefinition) ? $aDefinition['type'] : 'string';
switch ($sParamType) {
case 'int':
$value = (int)$aDefinition['value'];
break;
case 'float':
$value = (float)$aDefinition['value'];
break;
case 'bool':
$value = (bool)$aDefinition['value'];
break;
case 'reference':
$value = ${$aDefinition['value']};
break;
case 'string':
default:
$value = (string)$aDefinition['value'];
}
$aParams[] = $value;
}
$aCallSpec = array($this, $sAction);
$bRet = call_user_func_array($aCallSpec, $aParams);
}
// if one call fails, the whole is considered as failed
// (in case there is no returned value, null is obtained and means "ok")
if ($bRet === false) {
IssueLog::Info("Lifecycle action $sActionDesc returned false on object #$sClass:".$this->GetKey());
$bSuccess = false;
}
$aCallSpec = array($this, $sAction);
$bRet = call_user_func_array($aCallSpec, $aParams);
}
// if one call fails, the whole is considered as failed
// (in case there is no returned value, null is obtained and means "ok")
if ($bRet === false)
{
IssueLog::Info("Lifecycle action $sActionDesc returned false on object #$sClass:".$this->GetKey());
$bSuccess = false;
} finally {
if ($bIsNewlyProtected) {
// Stops protection only if the object was not already protected
MetaModel::StopReentranceProtection($this);
}
$this->RemoveCurrentObjectInCrudStack();
}
if ($bSuccess)
{
$this->sStimulusBeingApplied = $sStimulusCode;
// Stop watches
foreach(MetaModel::ListAttributeDefs($sClass) as $sAttCode => $oAttDef)
{
@@ -4630,6 +4666,7 @@ abstract class DBObject implements iDisplay
$this->m_aCurrValues[$sAttCode] = $aBackupValues[$sAttCode];
}
}
$this->LogCRUDExit(__METHOD__, 'Current State: '.$this->Get($sStateAttCode));
return $bSuccess;
}
@@ -6616,7 +6653,7 @@ abstract class DBObject implements iDisplay
* @return void
* @since 3.1.0
*/
protected function FireEventCheckToWrite(): void
protected function FireEventCheckToWrite(?string $sStimulusBeingApplied): void
{
}
@@ -6624,7 +6661,7 @@ abstract class DBObject implements iDisplay
* @return void
* @since 3.1.0
*/
protected function FireEventBeforeWrite()
protected function FireEventBeforeWrite(?string $sStimulusBeingApplied)
{
}
@@ -6634,7 +6671,7 @@ abstract class DBObject implements iDisplay
* @return void
* @since 3.1.0
*/
protected function FireEventAfterWrite(array $aChanges, bool $bIsNew): void
protected function FireEventAfterWrite(array $aChanges, bool $bIsNew, ?string $sStimulusBeingApplied): void
{
}
@@ -6672,7 +6709,7 @@ abstract class DBObject implements iDisplay
* @return void
* @since 3.1.0
*/
protected function FireEventComputeValues(): void
protected function FireEventComputeValues(?string $sStimulusBeingApplied): void
{
}
@@ -6714,12 +6751,13 @@ abstract class DBObject implements iDisplay
$oRootClass = MetaModel::GetRootClass($sClass);
foreach (self::$m_aCrudStack as $aCrudStackEntry) {
if (($oRootClass === $aCrudStackEntry['class'])
&& ($sConvertedId === $aCrudStackEntry['id'])) {
if (($oRootClass === $aCrudStackEntry['class']) && ($sConvertedId === $aCrudStackEntry['id'])) {
IssueLog::Trace('CRUD '.__METHOD__." $sClass:$sId IS in CRUD Stack", LogChannels::DM_CRUD);
return true;
}
}
IssueLog::Trace('CRUD '.__METHOD__." $sClass:$sId NOT in CRUD Stack", LogChannels::DM_CRUD);
return false;
}
@@ -6737,10 +6775,12 @@ abstract class DBObject implements iDisplay
$sRootClass = MetaModel::GetRootClass($sClass);
foreach (self::$m_aCrudStack as $aCrudStackEntry) {
if ($sRootClass === $aCrudStackEntry['class']) {
IssueLog::Trace("CRUD ".__METHOD__." $sClass IS in CRUD Stack", LogChannels::DM_CRUD);
return true;
}
}
IssueLog::Trace('CRUD '.__METHOD__." $sClass NOT in CRUD Stack", LogChannels::DM_CRUD);
return false;
}
@@ -6750,17 +6790,20 @@ abstract class DBObject implements iDisplay
* @param string $sCrudType
*
* @return void
* @throws \CoreException
* @since 3.1.0 N°5609
*/
private function AddCurrentObjectInCrudStack(string $sCrudType): void
{
$this->LogCRUDDebug(__METHOD__);
$sRootClass = MetaModel::GetRootClass(get_class($this));
$sKey = (string)$this->GetKey();
self::$m_aCrudStack[] = [
'type' => $sCrudType,
'class' => $sRootClass,
'id' => (string)$this->GetKey(), // GetKey() doesn't have type hinting, so forcing type to avoid getting an int
'id' => $sKey, // GetKey() doesn't have type hinting, so forcing type to avoid getting an int
];
$iCount = count(self::$m_aCrudStack);
$this->LogCRUDDebug(__METHOD__, "$sCrudType $sRootClass:$sKey count $iCount");
}
/**
@@ -6772,10 +6815,15 @@ abstract class DBObject implements iDisplay
*/
private function UpdateCurrentObjectInCrudStack(): void
{
$this->LogCRUDDebug(__METHOD__);
$aCurrentCrudStack = array_pop(self::$m_aCrudStack);
$aCurrentCrudStack['id'] = (string)$this->GetKey();
$sOldId = $aCurrentCrudStack['id'];
$sNewId = (string)$this->GetKey();
$aCurrentCrudStack['id'] = $sNewId;
self::$m_aCrudStack[] = $aCurrentCrudStack;
$sClass = $aCurrentCrudStack['class'];
$sType = $aCurrentCrudStack['type'];
$iCount = count(self::$m_aCrudStack);
$this->LogCRUDDebug(__METHOD__, "$sType $sClass:$sOldId => $sClass:$sNewId count $iCount");
}
/**
@@ -6787,7 +6835,11 @@ abstract class DBObject implements iDisplay
private function RemoveCurrentObjectInCrudStack(): void
{
$aRemoved = array_pop(self::$m_aCrudStack);
$this->LogCRUDDebug(__METHOD__, $aRemoved['class'].':'.$aRemoved['id']);
$sType = $aRemoved['type'];
$sClass = $aRemoved['class'];
$sId = $aRemoved['id'];
$iCount = count(self::$m_aCrudStack);
$this->LogCRUDDebug(__METHOD__, "$sType $sClass:$sId count $iCount");
}
/**
@@ -6804,37 +6856,53 @@ abstract class DBObject implements iDisplay
protected function LogCRUDEnter($sFunction, $sComment = '')
{
$sClass = get_class($this);
if (utils::StartsWith($sClass, 'CMDBChange')) {
return;
}
$sKey = $this->GetKey();
$sUUID = $this->m_sObjectUniqId;
$sPadding = str_pad('', count(self::$m_aCrudStack), '-');
IssueLog::Debug("CRUD +$sPadding> $sFunction $sClass:$sKey $sComment", LogChannels::DM_CRUD);
IssueLog::Debug("CRUD +$sPadding> $sFunction $sClass:$sKey ($sUUID) $sComment", LogChannels::DM_CRUD);
}
protected function LogCRUDExit($sFunction, $sComment = '')
{
$sClass = get_class($this);
if (utils::StartsWith($sClass, 'CMDBChange')) {
return;
}
$sKey = $this->GetKey();
$sUUID = $this->m_sObjectUniqId;
$sPadding = str_pad('', count(self::$m_aCrudStack), '-');
if (strlen($sComment) === 0) {
IssueLog::Trace("CRUD <$sPadding+ $sFunction $sClass:$sKey", LogChannels::DM_CRUD);
} else {
IssueLog::Debug("CRUD <$sPadding+ $sFunction $sClass:$sKey $sComment", LogChannels::DM_CRUD);
IssueLog::Debug("CRUD <$sPadding+ $sFunction $sClass:$sKey ($sUUID) $sComment", LogChannels::DM_CRUD);
}
}
protected function LogCRUDDebug($sFunction, $sComment = '')
{
$sClass = get_class($this);
if (utils::StartsWith($sClass, 'CMDBChange')) {
return;
}
$sKey = $this->GetKey();
$sUUID = $this->m_sObjectUniqId;
$sPadding = str_pad('', count(self::$m_aCrudStack), '-');
IssueLog::Debug("CRUD --$sPadding $sFunction $sClass:$sKey $sComment", LogChannels::DM_CRUD);
IssueLog::Debug("CRUD --$sPadding $sFunction $sClass:$sKey ($sUUID) $sComment", LogChannels::DM_CRUD);
}
protected function LogCRUDError($sFunction, $sComment = '')
{
$sClass = get_class($this);
if (utils::StartsWith($sClass, 'CMDBChange')) {
return;
}
$sKey = $this->GetKey();
$sUUID = $this->m_sObjectUniqId;
$sPadding = str_pad('', count(self::$m_aCrudStack), '!');
IssueLog::Error("CRUD !!$sPadding Error $sFunction $sClass:$sKey $sComment", LogChannels::DM_CRUD);
IssueLog::Error("CRUD !!$sPadding Error $sFunction $sClass:$sKey ($sUUID) $sComment", LogChannels::DM_CRUD);
}
/**

View File

@@ -51,7 +51,7 @@ class DBProperty extends DBObject
MetaModel::Init_AddAttribute(new AttributeString("description", array("allowed_values"=>null, "sql"=>"description", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeString("value", array("allowed_values"=>null, "sql"=>"value", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeDateTime("change_date", array("allowed_values"=>null, "sql"=>"change_date", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeDateTime("change_date", array("allowed_values"=>null, "sql"=>"change_date", "default_value"=>"NOW()", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeString("change_comment", array("allowed_values"=>null, "sql"=>"change_comment", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
}

View File

@@ -154,7 +154,7 @@ class EMail implements iEMail
*/
public function SetInReplyTo(string $sMessageId)
{
$this->AddToHeader('In-Reply-To', $sMessageId);
$this->oMailer->SetInReplyTo($sMessageId);
}
public function SetBody($sBody, $sMimeType = 'text/html', $sCustomStyles = null)

View File

@@ -39,7 +39,7 @@ class Event extends DBObject implements iDisplay
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();
MetaModel::Init_AddAttribute(new AttributeText("message", array("allowed_values"=>null, "sql"=>"message", "default_value"=>null, "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeDateTime("date", array("allowed_values"=>null, "sql"=>"date", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeDateTime("date", array("allowed_values"=>null, "sql"=>"date", "default_value"=>"NOW()", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeString("userinfo", array("allowed_values"=>null, "sql"=>"userinfo", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
// MetaModel::Init_AddAttribute(new AttributeString("userinfo", array("allowed_values"=>null, "sql"=>"userinfo", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));

View File

@@ -278,7 +278,7 @@ class HTMLDOMSanitizer extends DOMSanitizer
protected static $aTagsWhiteList = array(
'html' => array(),
'body' => array(),
'a' => array('href', 'name', 'style', 'class', 'target', 'title', 'data-role', 'data-object-class', 'data-object-id'),
'a' => array('href', 'name', 'style', 'class', 'target', 'title', 'data-role', 'data-object-class', 'data-object-id', 'data-object-key'),
'p' => array('style', 'class'),
'blockquote' => array('style', 'class'),
'br' => array(),
@@ -354,6 +354,8 @@ class HTMLDOMSanitizer extends DOMSanitizer
'font-style',
'height',
'margin',
'margin-left',
'margin-right',
'padding',
'text-align',
'vertical-align',

View File

@@ -54,7 +54,7 @@ class InlineImage extends DBObject
);
MetaModel::Init_Params($aParams);
MetaModel::Init_InheritAttributes();
MetaModel::Init_AddAttribute(new AttributeDateTime("expire", array("allowed_values"=>null, "sql"=>'expire', "default_value"=>'', "is_null_allowed"=>false, "depends_on"=>array(), "always_load_in_tables"=>false)));
MetaModel::Init_AddAttribute(new AttributeDateTime("expire", array("allowed_values" => null, "sql" => 'expire', "default_value" => 'DATE_ADD(NOW(), INTERVAL 1 DAY)', "is_null_allowed" => false, "depends_on" => array(), "always_load_in_tables" => false)));
MetaModel::Init_AddAttribute(new AttributeString("temp_id", array("allowed_values"=>null, "sql"=>'temp_id', "default_value"=>'', "is_null_allowed"=>true, "depends_on"=>array(), "always_load_in_tables"=>false)));
MetaModel::Init_AddAttribute(new AttributeString("item_class", array("allowed_values"=>null, "sql"=>'item_class', "default_value"=>'', "is_null_allowed"=>false, "depends_on"=>array(), "always_load_in_tables"=>false)));
MetaModel::Init_AddAttribute(new AttributeObjectKey("item_id", array("class_attcode"=>'item_class', "allowed_values"=>null, "sql"=>'item_id', "is_null_allowed"=>true, "depends_on"=>array(), "always_load_in_tables"=>false)));
@@ -541,80 +541,6 @@ JS
CombodoCKEditorHandler.EnableImageUpload('#' + $(this).attr('id'), '$sAbsoluteUrlAppRoot'+'pages/ajax.render.php?operation=cke_img_upload&temp_id=$sTempId&obj_class=$sObjClass&obj_key=$iObjKey');
});
JS;
return
<<<JS
// Hook the file upload of all CKEditor instances
$('.htmlEditor').each(function() {
var oEditor = $(this).ckeditorGet();
oEditor.config.filebrowserBrowseUrl = '$sAbsoluteUrlAppRoot'+'pages/ajax.render.php?operation=cke_browse&temp_id=$sTempId&obj_class=$sObjClass&obj_key=$iObjKey';
oEditor.on( 'fileUploadResponse', function( evt ) {
var fileLoader = evt.data.fileLoader;
var xhr = fileLoader.xhr;
var data = evt.data;
try {
var response = JSON.parse( xhr.responseText );
// Error message does not need to mean that upload finished unsuccessfully.
// It could mean that ex. file name was changes during upload due to naming collision.
if ( response.error && response.error.message ) {
data.message = response.error.message;
}
// But !uploaded means error.
if ( !response.uploaded ) {
evt.cancel();
} else {
data.fileName = response.fileName;
data.url = response.url;
// Do not call the default listener.
evt.stop();
}
} catch ( err ) {
// Response parsing error.
data.message = fileLoader.lang.filetools.responseError;
window.console && window.console.log( xhr.responseText );
evt.cancel();
}
} );
oEditor.on( 'fileUploadRequest', function( evt ) {
evt.data.fileLoader.uploadUrl += '?operation=cke_img_upload&temp_id=$sTempId&obj_class=$sObjClass';
}, null, null, 4 ); // Listener with priority 4 will be executed before priority 5.
oEditor.on( 'instanceReady', function() {
if(!CKEDITOR.env.iOS && $('#'+oEditor.id+'_toolbox .ibo-vendors-ckeditor--toolbar-fullscreen-button').length == 0)
{
$('#'+oEditor.id+'_toolbox').append('<span class="ibo-vendors-ckeditor--toolbar-fullscreen-button editor-fullscreen-button" data-role="ibo-vendors-ckeditor--toolbar-fullscreen-button" title="$sToggleFullScreen">&nbsp;</span>');
$('#'+oEditor.id+'_toolbox .ibo-vendors-ckeditor--toolbar-fullscreen-button').on('click', function() {
oEditor.execCommand('maximize');
if ($(this).closest('.cke_maximized').length != 0)
{
$('#'+oEditor.id+'_toolbar_collapser').trigger('click');
}
});
}
if (oEditor.widgets.registered.uploadimage)
{
oEditor.widgets.registered.uploadimage.onUploaded = function( upload ) {
var oData = JSON.parse(upload.xhr.responseText);
this.replaceWith( '<img src="' + upload.url + '" ' +
'width="' + oData.width + '" ' +
'height="' + oData.height + '">' );
}
}
});
});
JS
;
}
public static function EnableCKEditor5ImageUpload(DBObject $oObject, $sTempId){
return <<<JS
// Hook the file upload of all CKEditor instances
JS;
}

View File

@@ -7477,6 +7477,8 @@ abstract class MetaModel
* @param string|null $sFilterInstanceOf [optional] if given, only instance of this string will be returned
*
* @return array classes=>instance implementing the given interface
*
* @see \Combodo\iTop\Service\InterfaceDiscovery\InterfaceDiscovery::FindItopClasses() to add extensibility to modules
*/
public static function EnumPlugins($sInterface, $sFilterInstanceOf = null)
{
@@ -7530,8 +7532,41 @@ abstract class MetaModel
return $aEntries;
}
public static function ResetAllCaches($sEnvironment = null)
{
if (is_null($sEnvironment)) {
$sEnvironment = MetaModel::GetEnvironment();
}
$sEnvironmentId = md5(APPROOT).'-'.$sEnvironment;
$sAppIdentity = 'itop-'.$sEnvironmentId;
require_once(APPROOT.'/core/dict.class.inc.php');
Dict::ResetCache($sAppIdentity);
if (function_exists('apc_delete')) {
foreach (self::GetCacheEntries($sEnvironmentId) as $sKey => $aAPCInfo) {
$sAPCKey = $aAPCInfo['info'];
apc_delete($sAPCKey);
}
}
require_once(APPROOT.'core/userrights.class.inc.php');
UserRights::FlushPrivileges();
// Reset the opcache since otherwise the PHP "model" files may still be cached !!
if (function_exists('opcache_reset')) {
// Zend opcode cache
opcache_reset();
}
require_once(APPROOT.'setup/setuputils.class.inc.php');
SetupUtils::rrmdir(utils::GetCachePath($sEnvironment));
}
/**
* @internal
* @param string $sEnvironmentId
* @deprecated 3.2.1
*/
public static function ResetCache($sEnvironmentId = null)
{
@@ -7555,6 +7590,13 @@ abstract class MetaModel
require_once(APPROOT.'core/userrights.class.inc.php');
UserRights::FlushPrivileges();
// Reset the opcache since otherwise the PHP "model" files may still be cached !!
if (function_exists('opcache_reset'))
{
// Zend opcode cache
opcache_reset();
}
}
/**

View File

@@ -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]);
}

View File

@@ -182,14 +182,14 @@ class PHP_LexerGenerator_Lexer
$this->token = self::COMMENTEND;
return true;
}
if (preg_match('/\G%([a-z]+)/', $this->data, $token, null, $this->N)) {
if (preg_match('/\G%([a-z]+)/', $this->data, $token, 0, $this->N)) {
$this->value = $token[1];
$this->N += strlen($token[1]) + 1;
$this->state = 'DeclarePI';
$this->token = self::PI;
return true;
}
if (preg_match('/\G[a-zA-Z_][a-zA-Z0-9_]*/', $this->data, $token, null, $this->N)) {
if (preg_match('/\G[a-zA-Z_][a-zA-Z0-9_]*/', $this->data, $token, 0, $this->N)) {
$this->value = $token[0];
$this->token = self::PATTERN;
$this->N += strlen($token[0]);
@@ -216,7 +216,7 @@ class PHP_LexerGenerator_Lexer
if ($this->data[$this->N] == '{') {
return $this->lexCode();
}
if (!preg_match("/\G[^\n]+/", $this->data, $token, null, $this->N)) {
if (!preg_match("/\G[^\n]+/", $this->data, $token, 0, $this->N)) {
$this->error('Unexpected end of file');
return false;
}
@@ -242,7 +242,7 @@ class PHP_LexerGenerator_Lexer
if ($this->data[$this->N] == '{') {
return $this->lexCode();
}
if (!preg_match("/\G[^\n]+/", $this->data, $token, null, $this->N)) {
if (!preg_match("/\G[^\n]+/", $this->data, $token, 0, $this->N)) {
$this->error('Unexpected end of file');
return false;
}
@@ -406,7 +406,7 @@ class PHP_LexerGenerator_Lexer
if ($this->data[$this->N] == '\'') {
return $this->lexQuote('\'');
}
if (preg_match('/\G%([a-zA-Z_]+)/', $this->data, $token, null, $this->N)) {
if (preg_match('/\G%([a-zA-Z_]+)/', $this->data, $token, 0, $this->N)) {
$this->value = $token[1];
$this->N += strlen($token[1]) + 1;
$this->state = 'DeclarePIRule';
@@ -419,7 +419,7 @@ class PHP_LexerGenerator_Lexer
if ($this->data[$this->N] == '"') {
return $this->lexQuote();
}
if (preg_match('/\G[a-zA-Z_][a-zA-Z0-9_]*/', $this->data, $token, null, $this->N)) {
if (preg_match('/\G[a-zA-Z_][a-zA-Z0-9_]*/', $this->data, $token, 0, $this->N)) {
$this->value = $token[0];
$this->N += strlen($token[0]);
$this->token = self::SUBPATTERN;

View File

@@ -33,17 +33,19 @@ class PHP_LexerGenerator_ParseryyToken implements ArrayAccess
return $this->_string;
}
function offsetExists($offset)
function offsetExists($offset): bool
{
return isset($this->metadata[$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 PHP_LexerGenerator_ParseryyToken implements ArrayAccess
}
}
function offsetUnset($offset)
function offsetUnset($offset): void
{
unset($this->metadata[$offset]);
}
@@ -278,7 +280,7 @@ class PHP_LexerGenerator_Parser#line 171 "Parser.php"
$match = false;
foreach ($yy_yymore_patterns[' . $this->token . '] as $index => $rule) {
if (preg_match(\'/\' . $rule . \'/' . $this->patternFlags . '\',
' . $this->input . ', $yymatches, null, ' . $this->counter . ')) {
' . $this->input . ', $yymatches, 0, ' . $this->counter . ')) {
$yymatches = array_filter($yymatches, \'strlen\'); // remove empty sub-patterns
if ($match) {
if (strlen($yymatches[0]) > strlen($match[0][0])) {
@@ -350,7 +352,7 @@ class PHP_LexerGenerator_Parser#line 171 "Parser.php"
$pattern . '\';' . "\n");
fwrite($this->out, '
do {
if (preg_match($yy_global_pattern,' . $this->input . ', $yymatches, null, ' .
if (preg_match($yy_global_pattern,' . $this->input . ', $yymatches, 0, ' .
$this->counter .
')) {
$yysubmatches = $yymatches;
@@ -408,7 +410,7 @@ class PHP_LexerGenerator_Parser#line 171 "Parser.php"
}
$yysubmatches = array();
if (preg_match(\'/\' . $yy_yymore_patterns[' . $this->token . '][1] . \'/' . $this->patternFlags . '\',
' . $this->input . ', $yymatches, null, ' . $this->counter .')) {
' . $this->input . ', $yymatches, 0, ' . $this->counter .')) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, \'strlen\'); // remove empty sub-patterns
next($yymatches); // skip global match

View File

@@ -187,7 +187,7 @@ require_once 'PHP/LexerGenerator/Exception.php';
$match = false;
foreach ($yy_yymore_patterns[' . $this->token . '] as $index => $rule) {
if (preg_match(\'/\' . $rule . \'/' . $this->patternFlags . '\',
' . $this->input . ', $yymatches, null, ' . $this->counter . ')) {
' . $this->input . ', $yymatches, 0, ' . $this->counter . ')) {
$yymatches = array_filter($yymatches, \'strlen\'); // remove empty sub-patterns
if ($match) {
if (strlen($yymatches[0]) > strlen($match[0][0])) {
@@ -259,7 +259,7 @@ require_once 'PHP/LexerGenerator/Exception.php';
$pattern . '\';' . "\n");
fwrite($this->out, '
do {
if (preg_match($yy_global_pattern,' . $this->input . ', $yymatches, null, ' .
if (preg_match($yy_global_pattern,' . $this->input . ', $yymatches, 0, ' .
$this->counter .
')) {
$yysubmatches = $yymatches;
@@ -317,7 +317,7 @@ require_once 'PHP/LexerGenerator/Exception.php';
}
$yysubmatches = array();
if (preg_match(\'/\' . $yy_yymore_patterns[' . $this->token . '][1] . \'/' . $this->patternFlags . '\',
' . $this->input . ', $yymatches, null, ' . $this->counter .')) {
' . $this->input . ', $yymatches, 0, ' . $this->counter .')) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, \'strlen\'); // remove empty sub-patterns
next($yymatches); // skip global match

View File

@@ -110,7 +110,7 @@ class PHP_LexerGenerator_Regex_Lexer
$yy_global_pattern = '/\G(\\\\\\\\)|\G([^[\\\\^$.|()?*+{}]+)|\G(\\\\[][{}*.^$|?()+])|\G(\\[)|\G(\\|)|\G(\\\\[frnt]|\\\\x[0-9a-fA-F][0-9a-fA-F]?|\\\\[0-7][0-7][0-7]|\\\\x\\{[0-9a-fA-F]+\\})|\G(\\\\[0-9][0-9])|\G(\\\\[abBGcedDsSwW0C]|\\\\c\\\\)|\G(\\^)|\G(\\\\A)|\G(\\))|\G(\\$)|\G(\\*\\?|\\+\\?|[*?+]|\\{[0-9]+\\}|\\{[0-9]+,\\}|\\{[0-9]+,[0-9]+\\})|\G(\\\\[zZ])|\G(\\(\\?)|\G(\\()|\G(\\.)|\G(\\\\[1-9])|\G(\\\\p\\{\\^?..?\\}|\\\\P\\{..?\\}|\\\\X)|\G(\\\\p\\{C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|\G(\\\\p\\{\\^C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|\G(\\\\p[CLMNPSZ])|\G(\\\\)/';
do {
if (preg_match($yy_global_pattern,$this->input, $yymatches, null, $this->N)) {
if (preg_match($yy_global_pattern,$this->input, $yymatches, 0, $this->N)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
if (!count($yymatches)) {
@@ -180,7 +180,7 @@ class PHP_LexerGenerator_Regex_Lexer
}
$yysubmatches = array();
if (preg_match('/' . $yy_yymore_patterns[$this->token][1] . '/',
$this->input, $yymatches, null, $this->N)) {
$this->input, $yymatches, 0, $this->N)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
next($yymatches); // skip global match
@@ -360,7 +360,7 @@ class PHP_LexerGenerator_Regex_Lexer
$yy_global_pattern = '/\G(\\^)|\G(\\])|\G(.)/';
do {
if (preg_match($yy_global_pattern,$this->input, $yymatches, null, $this->N)) {
if (preg_match($yy_global_pattern,$this->input, $yymatches, 0, $this->N)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
if (!count($yymatches)) {
@@ -410,7 +410,7 @@ class PHP_LexerGenerator_Regex_Lexer
}
$yysubmatches = array();
if (preg_match('/' . $yy_yymore_patterns[$this->token][1] . '/',
$this->input, $yymatches, null, $this->N)) {
$this->input, $yymatches, 0, $this->N)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
next($yymatches); // skip global match
@@ -497,7 +497,7 @@ class PHP_LexerGenerator_Regex_Lexer
$yy_global_pattern = '/\G(\\\\\\\\)|\G(\\])|\G(\\\\[frnt]|\\\\x[0-9a-fA-F][0-9a-fA-F]?|\\\\[0-7][0-7][0-7]|\\\\x\\{[0-9a-fA-F]+\\})|\G(\\\\[bacedDsSwW0C]|\\\\c\\\\|\\\\x\\{[0-9a-fA-F]+\\}|\\\\[0-7][0-7][0-7]|\\\\x[0-9a-fA-F][0-9a-fA-F]?)|\G(\\\\[0-9][0-9])|\G(\\\\[1-9])|\G(\\\\[]\.\-\^])|\G(-(?!]))|\G([^\-\\\\])|\G(\\\\)|\G(.)/';
do {
if (preg_match($yy_global_pattern,$this->input, $yymatches, null, $this->N)) {
if (preg_match($yy_global_pattern,$this->input, $yymatches, 0, $this->N)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
if (!count($yymatches)) {
@@ -555,7 +555,7 @@ class PHP_LexerGenerator_Regex_Lexer
}
$yysubmatches = array();
if (preg_match('/' . $yy_yymore_patterns[$this->token][1] . '/',
$this->input, $yymatches, null, $this->N)) {
$this->input, $yymatches, 0, $this->N)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
next($yymatches); // skip global match
@@ -678,7 +678,7 @@ class PHP_LexerGenerator_Regex_Lexer
$yy_global_pattern = '/\G(\\\\\\\\)|\G(\\\\\\])|\G(\\\\[bacedDsSwW0C]|\\\\c\\\\|\\\\x\\{[0-9a-fA-F]+\\}|\\\\[0-7][0-7][0-7]|\\\\x[0-9a-fA-F][0-9a-fA-F]?)|\G(\\\\[0-9][0-9])|\G(\\\\[1-9])|\G([^\-\\\\])|\G(\\\\)/';
do {
if (preg_match($yy_global_pattern,$this->input, $yymatches, null, $this->N)) {
if (preg_match($yy_global_pattern,$this->input, $yymatches, 0, $this->N)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
if (!count($yymatches)) {
@@ -732,7 +732,7 @@ class PHP_LexerGenerator_Regex_Lexer
}
$yysubmatches = array();
if (preg_match('/' . $yy_yymore_patterns[$this->token][1] . '/',
$this->input, $yymatches, null, $this->N)) {
$this->input, $yymatches, 0, $this->N)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
next($yymatches); // skip global match
@@ -842,7 +842,7 @@ class PHP_LexerGenerator_Regex_Lexer
$yy_global_pattern = '/\G([imsxUX]+-[imsxUX]+|[imsxUX]+|-[imsxUX]+)|\G(:)|\G(\\))|\G(P<[^>]+>)|\G(<=)|\G(<!)|\G(=)|\G(!)|\G(>)|\G(\\(\\?)|\G(#[^)]+)|\G(R)|\G(.)/';
do {
if (preg_match($yy_global_pattern,$this->input, $yymatches, null, $this->N)) {
if (preg_match($yy_global_pattern,$this->input, $yymatches, 0, $this->N)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
if (!count($yymatches)) {
@@ -902,7 +902,7 @@ class PHP_LexerGenerator_Regex_Lexer
}
$yysubmatches = array();
if (preg_match('/' . $yy_yymore_patterns[$this->token][1] . '/',
$this->input, $yymatches, null, $this->N)) {
$this->input, $yymatches, 0, $this->N)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
next($yymatches); // skip global match

View File

@@ -33,17 +33,19 @@ class PHP_LexerGenerator_Regex_yyToken implements ArrayAccess
return $this->_string;
}
function offsetExists($offset)
function offsetExists($offset): bool
{
return isset($this->metadata[$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 PHP_LexerGenerator_Regex_yyToken implements ArrayAccess
}
}
function offsetUnset($offset)
function offsetUnset($offset): void
{
unset($this->metadata[$offset]);
}

View File

@@ -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
#

View File

@@ -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

View File

@@ -575,6 +575,15 @@ class BinaryExpression extends Expression
case 'LIKE':
$sType = 'like';
break;
case 'NOT LIKE':
$sType = 'notlike';
break;
case 'IN':
$sType = 'in';
break;
case 'NOT IN':
$sType = 'notin';
break;
default:
throw new Exception("Operator '$sOperator' not yet supported");
}
@@ -639,7 +648,26 @@ class BinaryExpression extends Expression
case 'like':
$sEscaped = preg_quote($mRight, '/');
$sEscaped = str_replace(array('%', '_', '\\\\.*', '\\\\.'), array('.*', '.', '%', '_'), $sEscaped);
$result = (int) preg_match("/$sEscaped/i", $mLeft);
$pregRes = preg_match("/$sEscaped/i", $mLeft);
if ($pregRes === false) {
throw new Exception("Error in regular expression '$sEscaped'");
}
$result = ($pregRes === 1);
break;
case 'notlike':
$sEscaped = preg_quote($mRight, '/');
$sEscaped = str_replace(array('%', '_', '\\\\.*', '\\\\.'), array('.*', '.', '%', '_'), $sEscaped);
$pregRes = preg_match("/$sEscaped/i", $mLeft);
if ($pregRes === false) {
throw new Exception("Error in regular expression '$sEscaped'");
}
$result = ($pregRes !== 1);
break;
case 'in':
$result = in_array($mLeft, $mRight);
break;
case 'notin':
$result = !in_array($mLeft, $mRight);
break;
}
return $result;
@@ -2250,7 +2278,12 @@ class ListExpression extends Expression
*/
public function Evaluate(array $aArgs)
{
throw new Exception('list expression not yet supported');
//throw new Exception('list expression not yet supported');
$aResult = [];
foreach ($this->m_aExpressions as $oExpressions) {
$aResult[] = $oExpressions->Evaluate($aArgs);
}
return $aResult;
}
/**

View File

@@ -235,7 +235,7 @@ class OQLLexerRaw
$match = false;
foreach ($yy_yymore_patterns[$this->token] as $index => $rule) {
if (preg_match('/' . $rule . '/',
$this->data, $yymatches, null, $this->count)) {
$this->data, $yymatches, 0, $this->count)) {
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
if ($match) {
if (strlen($yymatches[0]) > strlen($match[0][0])) {

View File

@@ -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"

View File

@@ -36,7 +36,13 @@ class UnknownClassOqlException extends OqlNormalizeException
{
public function __construct($sInput, OqlName $oName, $aExpecting = null)
{
parent::__construct('Unknown class', $sInput, $oName, $aExpecting);
$aAllowedClasses = [];
foreach ($aExpecting as $sClass) {
if (UserRights::IsActionAllowed($sClass, UR_ACTION_READ)) {
$aAllowedClasses[] = $sClass;
}
}
parent::__construct('Unknown class', $sInput, $oName, $aAllowedClasses);
}
public function GetUserFriendlyDescription()

View File

@@ -48,6 +48,42 @@ class ormDocument
* @since 3.1.0
*/
public const DEFAULT_DOWNLOADS_COUNT = 0;
private static $aKnownExtensions = [
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',
'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
'jpg' => 'image/jpeg',
'jpeg' => 'image/jpeg',
'gif' => 'image/gif',
'png' => 'image/png',
'pdf' => 'application/pdf',
'doc' => 'application/msword',
'dot' => 'application/msword',
'xls' => 'application/vnd.ms-excel',
'ppt' => 'application/vnd.ms-powerpoint',
'vsd' => 'application/x-visio',
'vdx' => 'application/visio.drawing',
'odt' => 'application/vnd.oasis.opendocument.text',
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
'odp' => 'application/vnd.oasis.opendocument.presentation',
'zip' => 'application/zip',
'txt' => 'text/plain',
'htm' => 'text/html',
'html' => 'text/html',
'exe' => 'application/octet-stream',
];
public static function GetKnownExtensions(): array
{
return self::$aKnownExtensions;
}
protected $m_data;
protected $m_sMimeType;
@@ -76,6 +112,36 @@ class ormDocument
$this->m_iDownloadsCount = $iDownloadsCount;
}
/**
* @param string $sPath Absolute path of the document to read
*
* @return \ormDocument
* @throws \Exception
*/
public static function FromFile(string $sPath): ormDocument
{
$sPath = utils::RealPath($sPath, APPROOT);
if (false === $sPath) {
throw new Exception("Failed to load the file '$sPath'. The file does not exist or the current process is not allowed to access it.");
}
$sData = @file_get_contents($sPath);
if (false === $sData) {
throw new Exception("Failed to load the file '$sPath'. The file does not exist or the current process is not allowed to access it.");
}
$sExtension = strtolower(pathinfo($sPath, PATHINFO_EXTENSION));
$sFileName = basename($sPath);
$sMimeType = 'text/plain';
if (array_key_exists($sExtension, ormDocument::$aKnownExtensions)) {
$sMimeType = ormDocument::$aKnownExtensions[$sExtension];
} else if (extension_loaded('fileinfo')) {
$fInfo = new finfo(FILEINFO_MIME);
$sMimeType = $fInfo->file($sPath);
}
return new ormDocument($sData, $sMimeType, $sFileName);
}
public function __toString()
{
if($this->IsEmpty()) return '';
@@ -314,7 +380,7 @@ class ormDocument
'document' => $oDocument,
'content_disposition' => $sContentDisposition,
);
EventService::FireEvent(new EventData(EVENT_DOWNLOAD_DOCUMENT, $sClass, $aEventData));
EventService::FireEvent(new EventData(\EVENT_DOWNLOAD_DOCUMENT, $sClass, $aEventData));
$oPage->TrashUnexpectedOutput();
$oPage->SetContentType($oDocument->GetMimeType());
$oPage->SetContentDisposition($sContentDisposition,$oDocument->GetFileName());

View File

@@ -42,8 +42,8 @@ class iTopOwnershipToken extends DBObject
);
MetaModel::Init_Params($aParams);
MetaModel::Init_InheritAttributes();
MetaModel::Init_AddAttribute(new AttributeDateTime("acquired", array("allowed_values"=>null, "sql"=>'acquired', "default_value"=>'', "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeDateTime("last_seen", array("allowed_values"=>null, "sql"=>'last_seen', "default_value"=>'', "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeDateTime("acquired", array("allowed_values"=>null, "sql"=>'acquired', "default_value"=>'NOW()', "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeDateTime("last_seen", array("allowed_values"=>null, "sql"=>'last_seen', "default_value"=>'NOW()', "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeString("obj_class", array("allowed_values"=>null, "sql"=>'obj_class', "default_value"=>'', "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeInteger("obj_key", array("allowed_values"=>null, "sql"=>'obj_key', "default_value"=>'', "is_null_allowed"=>true, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeString("token", array("allowed_values"=>null, "sql"=>'token', "default_value"=>'', "is_null_allowed"=>true, "depends_on"=>array())));

View File

@@ -44,6 +44,8 @@ class ObjectResult
* @var string
* @api
*/
use SanitizeTrait;
public $message;
/**
* @var mixed|null
@@ -156,6 +158,19 @@ class ObjectResult
{
$this->fields[$sAttCode] = $this->MakeResultValue($oObject, $sAttCode, $bExtendedOutput);
}
public function SanitizeContent()
{
foreach($this->fields as $sFieldAttCode => $fieldValue)
{
try {
$oAttDef = MetaModel::GetAttributeDef($this->class, $sFieldAttCode);
} catch (Exception $e) { // for special cases like ID
continue;
}
$this->SanitizeFieldIfSensitive($this->fields, $sFieldAttCode, $fieldValue, $oAttDef);
}
}
}
@@ -221,6 +236,16 @@ class RestResultWithObjects extends RestResult
$sObjKey = get_class($oObject).'::'.$oObject->GetKey();
$this->objects[$sObjKey] = $oObjRes;
}
public function SanitizeContent()
{
parent::SanitizeContent();
foreach($this->objects as $sObjKey => $oObjRes)
{
$oObjRes->SanitizeContent();
}
}
}
/**
@@ -308,9 +333,10 @@ class RestDelete
*
* @package Core
*/
class CoreServices implements iRestServiceProvider
class CoreServices implements iRestServiceProvider, iRestInputSanitizer
{
/**
use SanitizeTrait;
/**
* Enumerate services delivered by this class
*
* @param string $sVersion The version (e.g. 1.0) supported by the services
@@ -528,18 +554,18 @@ class CoreServices implements iRestServiceProvider
}
else
{
if (!$bExtendedOutput && RestUtils::GetOptionalParam($aParams, 'output_fields', '*') != '*')
if (!$bExtendedOutput && RestUtils::GetOptionalParam($aParams, 'output_fields', '*') != '*')
{
$aFields = $aShowFields[$sClass];
//Id is not a valid attribute to optimize
if (in_array('id', $aFields))
if (in_array('id', $aFields))
{
unset($aFields[array_search('id', $aFields)]);
}
$aAttToLoad = array($oObjectSet->GetClassAlias() => $aFields);
$oObjectSet->OptimizeColumnLoad($aAttToLoad);
}
while ($oObject = $oObjectSet->Fetch())
{
$oResult->AddObject(0, '', $oObject, $aShowFields, $bExtendedOutput);
@@ -737,6 +763,33 @@ class CoreServices implements iRestServiceProvider
return $oResult;
}
public function SanitizeJsonInput(string $sJsonInput): string
{
$sSanitizedJsonInput = $sJsonInput;
$aJsonData = json_decode($sSanitizedJsonInput, true);
$sOperation = $aJsonData['operation'];
switch ($sOperation) {
case 'core/check_credentials':
if (isset($aJsonData['password'])) {
$aJsonData['password'] = '*****';
}
break;
case 'core/update':
case 'core/create':
default :
$sClass = $aJsonData['class'];
if (isset($aJsonData['fields'])) {
foreach ($aJsonData['fields'] as $sFieldAttCode => $fieldValue) {
$oAttDef = MetaModel::GetAttributeDef($sClass, $sFieldAttCode);
$this->SanitizeFieldIfSensitive($aJsonData['fields'], $sFieldAttCode, $fieldValue, $oAttDef);
}
}
break;
}
return json_encode($aJsonData, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
}
/**
* Helper for object deletion
*/
@@ -875,3 +928,50 @@ class CoreServices implements iRestServiceProvider
return $iLimit * max(0, $iPage - 1);
}
}
trait SanitizeTrait
{
/**
* Sanitize a field if it is sensitive.
*
* @param array $fields The fields array
* @param string $sFieldAttCode The attribute code
* @param mixed $oAttDef The attribute definition
* @throws Exception
*/
private function SanitizeFieldIfSensitive(array &$fields, string $sFieldAttCode, $fieldValue, $oAttDef): void
{
// for simple attribute
if ($oAttDef instanceof iAttributeNoGroupBy) // iAttributeNoGroupBy is equivalent to sensitive attribute
{
$fields[$sFieldAttCode] = '*****';
return;
}
// for 1-n / n-n relation
if ($oAttDef instanceof AttributeLinkedSet) {
foreach ($fieldValue as $i => $aLnkValues) {
foreach ($aLnkValues as $sLnkAttCode => $sLnkValue) {
$oLnkAttDef = MetaModel::GetAttributeDef($oAttDef->GetLinkedClass(), $sLnkAttCode);
if ($oLnkAttDef instanceof iAttributeNoGroupBy) { // 1-n relation
$fields[$sFieldAttCode][$i][$sLnkAttCode] = '*****';
}
elseif ($oAttDef instanceof AttributeLinkedSetIndirect && $oLnkAttDef instanceof AttributeExternalField) { // for n-n relation
$oExtKeyAttDef = MetaModel::GetAttributeDef($oLnkAttDef->GetTargetClass(), $oLnkAttDef->GetExtAttCode());
if ($oExtKeyAttDef instanceof iAttributeNoGroupBy) {
$fields[$sFieldAttCode][$i][$sLnkAttCode] = '*****';
}
}
}
}
return;
}
// for external attribute
if ($oAttDef instanceof AttributeExternalField) {
$oExtKeyAttDef = MetaModel::GetAttributeDef($oAttDef->GetTargetClass(), $oAttDef->GetExtAttCode());
if ($oExtKeyAttDef instanceof iAttributeNoGroupBy) {
$fields[$sFieldAttCode] = '*****';
}
}
}
}

View File

@@ -1921,50 +1921,45 @@ class UserRights
*/
protected static function FindUser($sLogin, $sAuthentication = 'any', $bAllowDisabledUsers = false)
{
if ($sAuthentication == 'any')
{
$oUser = self::FindUser($sLogin, 'internal');
if ($oUser == null)
{
$oUser = self::FindUser($sLogin, 'external');
if ($sAuthentication === 'any') {
$oUser = self::FindUser($sLogin, 'internal', $bAllowDisabledUsers);
if ($oUser !== null) {
return $oUser;
}
return self::FindUser($sLogin, 'external', $bAllowDisabledUsers);
}
else
{
if (!isset(self::$m_aCacheUsers))
{
self::$m_aCacheUsers = array('internal' => array(), 'external' => array());
}
if (!isset(self::$m_aCacheUsers[$sAuthentication][$sLogin]))
{
switch($sAuthentication)
{
case 'external':
$sBaseClass = 'UserExternal';
break;
case 'internal':
$sBaseClass = 'UserInternal';
break;
default:
echo "<p>sAuthentication = $sAuthentication</p>\n";
assert(false); // should never happen
}
$oSearch = DBObjectSearch::FromOQL("SELECT $sBaseClass WHERE login = :login");
$oSearch->AllowAllData();
if (!$bAllowDisabledUsers)
{
$oSearch->AddCondition('status', 'enabled');
}
$oSet = new DBObjectSet($oSearch, array(), array('login' => $sLogin));
$oUser = $oSet->fetch();
self::$m_aCacheUsers[$sAuthentication][$sLogin] = $oUser;
}
$oUser = self::$m_aCacheUsers[$sAuthentication][$sLogin];
if (!isset(self::$m_aCacheUsers)) {
self::$m_aCacheUsers = [ 'internal' => [], 'external' => [] ];
}
return $oUser;
if (! isset(self::$m_aCacheUsers[$sAuthentication]) || ! array_key_exists($sLogin, self::$m_aCacheUsers[$sAuthentication])) {
switch($sAuthentication) {
case 'external':
$sBaseClass = 'UserExternal';
break;
case 'internal':
$sBaseClass = 'UserInternal';
break;
default:
echo "<p>sAuthentication = $sAuthentication</p>\n";
assert(false); // should never happen
}
$oSearch = DBObjectSearch::FromOQL("SELECT $sBaseClass WHERE login = :login");
$oSearch->AllowAllData();
if (!$bAllowDisabledUsers) {
$oSearch->AddCondition('status', 'enabled');
}
$oSet = new DBObjectSet($oSearch, array(), array('login' => $sLogin));
$oUser = $oSet->fetch();
self::$m_aCacheUsers[$sAuthentication][$sLogin] = $oUser;
}
return self::$m_aCacheUsers[$sAuthentication][$sLogin];
}
/**

View File

@@ -1,4 +1,4 @@
/*!
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/

View File

@@ -3,18 +3,18 @@
* @license http://opensource.org/licenses/AGPL-3.0
*/
$ibo-scrollbar--scrollbar-width: 8px !default;
$ibo-scrollbar--scrollbar-width: $common-scrollbar--scrollbar-width !default;
$ibo-scrollbar--scrollbar-height: $ibo-scrollbar--scrollbar-width !default; /* For horizontal scrollbars */
$ibo-scrollbar--scrollbar-track-background-color: $ibo-color-transparent !default;
$ibo-scrollbar--scrollbar-track-border-radius: $ibo-border-radius-500 !default;
$ibo-scrollbar--scrollbar-thumb-background-color: $ibo-color-grey-300 !default;
$ibo-scrollbar--scrollbar-track-background-color: $common-scrollbar--scrollbar-track-background-color !default;
$ibo-scrollbar--scrollbar-track-border-radius: $common-scrollbar--scrollbar-track-border-radius !default;
$ibo-scrollbar--scrollbar-thumb-background-color: $common-scrollbar--scrollbar-thumb-background-color !default;
$ibo-scrollbar--scrollbar-thumb-border: none !default;
$ibo-scrollbar--scrollbar-thumb-border-radius: $ibo-border-radius-500 !default;
$ibo-scrollbar--scrollbar-thumb-border-radius: $common-scrollbar--scrollbar-thumb-border-radius !default;
$ibo-svg-illustration--fill: $ibo-color-primary-500 !default;
$ibo-svg-illustration--fill: $common-svg-illustration--fill !default;
$ibo-content-block--background-color: $ibo-color-white-100 !default;
$ibo-content-block--border: 1px solid $ibo-color-grey-400 !default;
$ibo-content-block--background-color: $common-content-block--background-color !default;
$ibo-content-block--border: $common-content-block--border !default;
/* CSS variables */
:root{

View File

@@ -4,147 +4,3 @@
*/
/* This is an overload of the default lib. stylesheet to use local fonts instead of the CDN */
@font-face {
font-family: Raleway;
font-weight: 100;
font-style: normal;
font-display: swap;
src: local('Raleway Thin'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-100-normal.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 100;
font-style: italic;
font-display: swap;
src: local('Raleway Thin'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-100-italic.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 200;
font-style: normal;
font-display: swap;
src: local('Raleway ExtraLight'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-200-normal.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 200;
font-style: italic;
font-display: swap;
src: local('Raleway ExtraLight'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-200-italic.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 300;
font-style: normal;
font-display: swap;
src: local('Raleway Light'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-300-normal.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 300;
font-style: italic;
font-display: swap;
src: local('Raleway Light'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-300-italic.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 400;
font-style: normal;
font-display: swap;
src: local('Raleway'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-400-normal.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 400;
font-style: italic;
font-display: swap;
src: local('Raleway'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-400-italic.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 500;
font-style: normal;
font-display: swap;
src: local('Raleway Medium'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-500-normal.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 500;
font-style: italic;
font-display: swap;
src: local('Raleway Medium'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-500-italic.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 600;
font-style: normal;
font-display: swap;
src: local('Raleway SemiBold'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-600-normal.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 600;
font-style: italic;
font-display: swap;
src: local('Raleway SemiBold'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-600-italic.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 700;
font-style: normal;
font-display: swap;
src: local('Raleway'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-700-normal.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 700;
font-style: italic;
font-display: swap;
src: local('Raleway'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-700-italic.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 800;
font-style: normal;
font-display: swap;
src: local('Raleway ExtraBold'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-800-normal.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 800;
font-style: italic;
font-display: swap;
src: local('Raleway ExtraBold'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-800-italic.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 900;
font-style: normal;
font-display: swap;
src: local('Raleway Black'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-900-normal.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 900;
font-style: italic;
font-display: swap;
src: local('Raleway Black'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-900-italic.woff') format('woff'),
}

View File

@@ -14,8 +14,8 @@ $ibo-dm-class--Action--complementary-color: $ibo-color-white-100 !default;
.ibo-dm-class--Action {
--ibo-main-color: #{$ibo-dm-class--Action--main-color};
--ibo-main-color--100: #{ibo-adjust-alpha(ibo-adjust-lightness($ibo-dm-class--Action--main-color, $ibo-color-base-lightness-100), $ibo-color-base-opacity-for-lightness-100)};
--ibo-main-color--900: #{ibo-adjust-alpha(ibo-adjust-lightness($ibo-dm-class--Action--main-color, $ibo-color-base-lightness-900), $ibo-color-base-opacity-for-lightness-900)};
--ibo-main-color--100: #{common-adjust-alpha(common-adjust-lightness($ibo-dm-class--Action--main-color, $ibo-color-base-lightness-100), $ibo-color-base-opacity-for-lightness-100)};
--ibo-main-color--900: #{common-adjust-alpha(common-adjust-lightness($ibo-dm-class--Action--main-color, $ibo-color-base-lightness-900), $ibo-color-base-opacity-for-lightness-900)};
--ibo-complementary-color: #{$ibo-dm-class--Action--complementary-color};
}
@@ -35,8 +35,8 @@ $ibo-dm-enum--Action-status-enabled--complementary-color: $ibo-lifecycle-active-
.ibo-dm-enum--Action-status-enabled {
--ibo-main-color: #{$ibo-dm-enum--Action-status-enabled--main-color};
--ibo-main-color--100: #{ibo-adjust-alpha(ibo-adjust-lightness($ibo-dm-enum--Action-status-enabled--main-color, $ibo-color-base-lightness-100), $ibo-color-base-opacity-for-lightness-100)};
--ibo-main-color--900: #{ibo-adjust-alpha(ibo-adjust-lightness($ibo-dm-enum--Action-status-enabled--main-color, $ibo-color-base-lightness-900), $ibo-color-base-opacity-for-lightness-900)};
--ibo-main-color--100: #{common-adjust-alpha(common-adjust-lightness($ibo-dm-enum--Action-status-enabled--main-color, $ibo-color-base-lightness-100), $ibo-color-base-opacity-for-lightness-100)};
--ibo-main-color--900: #{common-adjust-alpha(common-adjust-lightness($ibo-dm-enum--Action-status-enabled--main-color, $ibo-color-base-lightness-900), $ibo-color-base-opacity-for-lightness-900)};
--ibo-complementary-color: #{$ibo-dm-enum--Action-status-enabled--complementary-color};
}
@@ -56,8 +56,8 @@ $ibo-dm-enum--Action-status-disabled--complementary-color: $ibo-lifecycle-frozen
.ibo-dm-enum--Action-status-disabled {
--ibo-main-color: #{$ibo-dm-enum--Action-status-disabled--main-color};
--ibo-main-color--100: #{ibo-adjust-alpha(ibo-adjust-lightness($ibo-dm-enum--Action-status-disabled--main-color, $ibo-color-base-lightness-100), $ibo-color-base-opacity-for-lightness-100)};
--ibo-main-color--900: #{ibo-adjust-alpha(ibo-adjust-lightness($ibo-dm-enum--Action-status-disabled--main-color, $ibo-color-base-lightness-900), $ibo-color-base-opacity-for-lightness-900)};
--ibo-main-color--100: #{common-adjust-alpha(common-adjust-lightness($ibo-dm-enum--Action-status-disabled--main-color, $ibo-color-base-lightness-100), $ibo-color-base-opacity-for-lightness-100)};
--ibo-main-color--900: #{common-adjust-alpha(common-adjust-lightness($ibo-dm-enum--Action-status-disabled--main-color, $ibo-color-base-lightness-900), $ibo-color-base-opacity-for-lightness-900)};
--ibo-complementary-color: #{$ibo-dm-enum--Action-status-disabled--complementary-color};
}
@@ -78,8 +78,8 @@ $ibo-dm-enum--Action-status-test--complementary-color: $ibo-lifecycle-inactive-s
.ibo-dm-enum--Action-status-test {
--ibo-main-color: #{$ibo-dm-enum--Action-status-test--main-color};
--ibo-main-color--100: #{ibo-adjust-alpha(ibo-adjust-lightness($ibo-dm-enum--Action-status-test--main-color, $ibo-color-base-lightness-100), $ibo-color-base-opacity-for-lightness-100)};
--ibo-main-color--900: #{ibo-adjust-alpha(ibo-adjust-lightness($ibo-dm-enum--Action-status-test--main-color, $ibo-color-base-lightness-900), $ibo-color-base-opacity-for-lightness-900)};
--ibo-main-color--100: #{common-adjust-alpha(common-adjust-lightness($ibo-dm-enum--Action-status-test--main-color, $ibo-color-base-lightness-100), $ibo-color-base-opacity-for-lightness-100)};
--ibo-main-color--900: #{common-adjust-alpha(common-adjust-lightness($ibo-dm-enum--Action-status-test--main-color, $ibo-color-base-lightness-900), $ibo-color-base-opacity-for-lightness-900)};
--ibo-complementary-color: #{$ibo-dm-enum--Action-status-test--complementary-color};
}

View File

@@ -14,8 +14,8 @@ $ibo-dm-class--User--complementary-color: $ibo-color-white-100 !default;
.ibo-dm-class--User {
--ibo-main-color: #{$ibo-dm-class--User--main-color};
--ibo-main-color--100: #{ibo-adjust-alpha(ibo-adjust-lightness($ibo-dm-class--User--main-color, $ibo-color-base-lightness-100), $ibo-color-base-opacity-for-lightness-100)};
--ibo-main-color--900: #{ibo-adjust-alpha(ibo-adjust-lightness($ibo-dm-class--User--main-color, $ibo-color-base-lightness-900), $ibo-color-base-opacity-for-lightness-900)};
--ibo-main-color--100: #{common-adjust-alpha(common-adjust-lightness($ibo-dm-class--User--main-color, $ibo-color-base-lightness-100), $ibo-color-base-opacity-for-lightness-100)};
--ibo-main-color--900: #{common-adjust-alpha(common-adjust-lightness($ibo-dm-class--User--main-color, $ibo-color-base-lightness-900), $ibo-color-base-opacity-for-lightness-900)};
--ibo-complementary-color: #{$ibo-dm-class--User--complementary-color};
}
.ibo-dm-class-alt--User {
@@ -34,8 +34,8 @@ $ibo-dm-enum--User-status-enabled--complementary-color: $ibo-lifecycle-active-st
.ibo-dm-enum--User-status-enabled {
--ibo-main-color: #{$ibo-dm-enum--User-status-enabled--main-color};
--ibo-main-color--100: #{ibo-adjust-alpha(ibo-adjust-lightness($ibo-dm-enum--User-status-enabled--main-color, $ibo-color-base-lightness-100), $ibo-color-base-opacity-for-lightness-100)};
--ibo-main-color--900: #{ibo-adjust-alpha(ibo-adjust-lightness($ibo-dm-enum--User-status-enabled--main-color, $ibo-color-base-lightness-900), $ibo-color-base-opacity-for-lightness-900)};
--ibo-main-color--100: #{common-adjust-alpha(common-adjust-lightness($ibo-dm-enum--User-status-enabled--main-color, $ibo-color-base-lightness-100), $ibo-color-base-opacity-for-lightness-100)};
--ibo-main-color--900: #{common-adjust-alpha(common-adjust-lightness($ibo-dm-enum--User-status-enabled--main-color, $ibo-color-base-lightness-900), $ibo-color-base-opacity-for-lightness-900)};
--ibo-complementary-color: #{$ibo-dm-enum--User-status-enabled--complementary-color};
}
.ibo-dm-enum-alt--User-status-enabled {
@@ -54,8 +54,8 @@ $ibo-dm-enum--User-status-disabled--complementary-color: $ibo-lifecycle-inactive
.ibo-dm-enum--User-status-disabled {
--ibo-main-color: #{$ibo-dm-enum--User-status-disabled--main-color};
--ibo-main-color--100: #{ibo-adjust-alpha(ibo-adjust-lightness($ibo-dm-enum--User-status-disabled--main-color, $ibo-color-base-lightness-100), $ibo-color-base-opacity-for-lightness-100)};
--ibo-main-color--900: #{ibo-adjust-alpha(ibo-adjust-lightness($ibo-dm-enum--User-status-disabled--main-color, $ibo-color-base-lightness-900), $ibo-color-base-opacity-for-lightness-900)};
--ibo-main-color--100: #{common-adjust-alpha(common-adjust-lightness($ibo-dm-enum--User-status-disabled--main-color, $ibo-color-base-lightness-100), $ibo-color-base-opacity-for-lightness-100)};
--ibo-main-color--900: #{common-adjust-alpha(common-adjust-lightness($ibo-dm-enum--User-status-disabled--main-color, $ibo-color-base-lightness-900), $ibo-color-base-opacity-for-lightness-900)};
--ibo-complementary-color: #{$ibo-dm-enum--User-status-disabled--complementary-color};
}
.ibo-dm-enum-alt--User-status-disabled {

View File

@@ -2,7 +2,7 @@
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
@import "../common/main";
@import "utils/all";
@import "vendors/all";
@import "base/all";

View File

@@ -7,28 +7,20 @@
* Adjust the lightness of $sColor to the absolute $fTargetLightness value.
* It is different than lighten() / darken() that shift the current lightness by X%
*
* @deprecated Use common-adjust-lightness() instead
* @return Modified color value in HSLA format
*/
@function ibo-adjust-lightness($sColor, $fTargetLightness) {
$iHue: hue($sColor);
$fSaturation: saturation($sColor);
$fLightness: lightness($sColor);
$fAlpha: alpha($sColor);
@return hsla($iHue, $fSaturation, $fTargetLightness, $fAlpha);
@return common-adjust-lightness($sColor, $fTargetLightness);
}
/**
* Adjust the alpha chanel (opacity) of $sColor to the absolute $fTargetAlpha value.
* It is different than opacify() / transparentize() that shift the current alpha value by X%
*
* @deprecated Use common-adjust-alpha() instead
* @return Modified color value in HSLA format
*/
@function ibo-adjust-alpha($sColor, $fTargetAlpha) {
$iHue: hue($sColor);
$fSaturation: saturation($sColor);
$fLightness: lightness($sColor);
$fAlpha: alpha($sColor);
@return hsla($iHue, $fSaturation, $fLightness, $fTargetAlpha);
@return common-adjust-alpha($sColor, $fTargetAlpha);
}

View File

@@ -3,9 +3,9 @@
* @license http://opensource.org/licenses/AGPL-3.0
*/
$ibo-class-icon--small--size: 32px !default;
$ibo-class-icon--medium--size: 48px !default;
$ibo-class-icon--large--size: 64px !default;
$ibo-class-icon--small--size: $common-class-icon--small--size !default;
$ibo-class-icon--medium--size: $common-class-icon--medium--size !default;
$ibo-class-icon--large--size: $common-class-icon--large--size !default;
.ibo-class-icon{
&.ibo-is-small{

View File

@@ -3,24 +3,7 @@
* @license http://opensource.org/licenses/AGPL-3.0
*/
$ibo-text-colors: (
'primary': $ibo-color-primary-800,
'secondary': $ibo-color-secondary-800,
'neutral': $ibo-color-secondary-800,
'information': $ibo-color-information-800,
'success': $ibo-color-success-800,
'failure': $ibo-color-danger-800,
'warning': $ibo-color-warning-800,
'danger': $ibo-color-danger-800,
'grey' : $ibo-color-grey-800,
'blue-grey': $ibo-color-blue-grey-800,
'blue': $ibo-color-blue-800,
'cyan': $ibo-color-cyan-800,
'green': $ibo-color-green-800,
'orange': $ibo-color-orange-800,
'red': $ibo-color-red-800,
'pink': $ibo-color-pink-800,
) !default;
$ibo-text-colors: $common-text-colors !default;
@each $sColor, $sColorValue in $ibo-text-colors {
.ibo-text.ibo-is-#{$sColor} {

View File

@@ -8,36 +8,3 @@
/* To use it, simply "@extend %fa-regular-base" in a rule and put the desired icon "content: '\f054'" */
/******************************************************************************************************************************/
%fa-regular-base{
font-family: "Font Awesome 5 Free";
font-weight: 400;
-webkit-font-smoothing: antialiased;
display: inline-block;
font-style: normal;
font-variant: normal;
text-rendering: auto;
line-height: 1;
}
%fa-solid-base{
font-family: "Font Awesome 5 Free";
font-weight: 900;
-webkit-font-smoothing: antialiased;
display: inline-block;
font-style: normal;
font-variant: normal;
text-rendering: auto;
line-height: 1;
}
%fc-regular-base{
display: inline-block;
font-family: CombodoRegular;
font-style: normal;
font-variant: normal;
font-weight: normal;
text-rendering: auto;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

View File

@@ -1,4 +1,4 @@
/*!
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/

View File

@@ -1,4 +1,4 @@
/*!
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
@@ -10,12 +10,12 @@
/***********************************************************************/
/* SCSS variables */
$ibo-sticky-sentinel--left: 0 !default;
$ibo-sticky-sentinel--right: 0 !default;
$ibo-sticky-sentinel--height: 0 !default;
$ibo-sticky-sentinel-top--top: 0 !default;
$ibo-sticky-sentinel--left: $common-sticky-sentinel--left !default;
$ibo-sticky-sentinel--right: $common-sticky-sentinel--right !default;
$ibo-sticky-sentinel--height: $common-sticky-sentinel--height !default;
$ibo-sticky-sentinel-top--top: $common-sticky-sentinel-top--top !default;
$ibo-sticky-sentinel-top--height: $ibo-sticky-sentinel--height !default;
$ibo-sticky-sentinel-bottom--bottom: 0 !default;
$ibo-sticky-sentinel-bottom--bottom: $common-sticky-sentinel-bottom--bottom !default;
$ibo-sticky-sentinel-bottom--height: $ibo-sticky-sentinel--height !default;
/* Rules */

View File

@@ -1,16 +1,16 @@
/*!
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
/* SCSS variables */
$ibo-has-description--content: "?" !default;
$ibo-has-description--padding-left: $ibo-spacing-200 !default;
$ibo-has-description--color: $ibo-color-grey-600 !default;
$ibo-has-description--font-size: 0.7em !default; /* Font size is em on purpose as we want it to be proportional to its context */
$ibo-has-description--content: $common-has-description--content !default;
$ibo-has-description--padding-left: $common-has-description--padding-left !default;
$ibo-has-description--color: $common-has-description--color !default;
$ibo-has-description--font-size: $common-has-description--font-size !default; /* Font size is em on purpose as we want it to be proportional to its context */
$ibo-is-code--background-color: $ibo-color-white-200 !default;
$ibo-is-code--padding: 1.25rem 1.5rem !default;
$ibo-is-code--background-color: $common-is-code--background-color !default;
$ibo-is-code--padding: $common-is-code--padding !default;
$ibo-hyperlink-color: $ibo-color-primary-700 !default;
$ibo-hyperlink-text-decoration: none !default;
@@ -19,8 +19,8 @@ $ibo-hyperlink-text-decoration--on-hover: $ibo-hyperlink-text-decoration !defaul
$ibo-hyperlink-color--on-active: $ibo-color-primary-900 !default;
$ibo-hyperlink-text-decoration--on-active: $ibo-hyperlink-text-decoration !default;
$ibo-figure--spacing-x: 2em !default; /* Mind that this matches Bulma rule for figure */
$ibo-figure--spacing-y: 2em !default;
$ibo-figure--spacing-x: $common-figure--spacing-x !default; /* Mind that this matches Bulma rule for figure */
$ibo-figure--spacing-y: $common-figure--spacing-y !default;
/* CSS variables */
:root{

View File

@@ -1,4 +1,4 @@
/*!
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/

View File

@@ -1,4 +1,4 @@
/*!
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/

View File

@@ -3,8 +3,8 @@
* @license http://opensource.org/licenses/AGPL-3.0
*/
$ibo-vertical-highlight--width: $ibo-size-100;
$ibo-vertical-highlight--height: 100%;
$ibo-vertical-highlight--width: $common-vertical-highlight--width;
$ibo-vertical-highlight--height: $common-vertical-highlight--height;
@mixin ibo-vertical-highlight {
display: block;

View File

@@ -3,18 +3,19 @@
* @license http://opensource.org/licenses/AGPL-3.0
*/
$ibo-selectable--background-color: transparent !default;
$ibo-selectable--background-color: $common-selectable--background-color !default;
$ibo-selectable--hover--color: $ibo-color-grey-100 !default;
$ibo-selectable--hover--background-color: $ibo-color-grey-600 !default;
$ibo-selectable--hover--background-opacity: 0.6 !default;
$ibo-selectable--hover--color: $common-selectable--hover--color !default;
$ibo-selectable--hover--background-color: $common-selectable--hover--background-color !default;
$ibo-selectable--hover--background-opacity: $common-selectable--hover--background-opacity !default;
$ibo-selected--color: $ibo-color-grey-100 !default;
$ibo-selected--background-color: $ibo-color-grey-900 !default;
$ibo-selected--background-opacity: 0.5 !default;
$ibo-selected--color: $common-selected--color !default;
$ibo-selected--background-color: $common-selected--background-color !default;
$ibo-selected--background-opacity: $common-selected--background-opacity !default;
$ibo-selected--hover--background-color: $common-selected--hover--background-color !default;
$ibo-selected--hover--background-opacity: $common-selected--hover--background-opacity !default;
$ibo-selected--hover--background-color: $ibo-color-grey-700 !default;
$ibo-selected--hover--background-opacity: 0.5 !default;
@mixin ibo-selectable {
content: ' ';
@extend %fa-solid-base;

View File

@@ -3,13 +3,13 @@
* @license http://opensource.org/licenses/AGPL-3.0
*/
$ibo-border-radius-100: 1px !default;
$ibo-border-radius-300: 3px !default;
$ibo-border-radius-400: 4px !default;
$ibo-border-radius-500: 5px !default;
$ibo-border-radius-700: 10px !default;
$ibo-border-radius-900: 16px !default;
$ibo-border-radius-full: 100% !default;
$ibo-border-radius-100: $common-border-radius-100 !default;
$ibo-border-radius-300: $common-border-radius-300 !default;
$ibo-border-radius-400: $common-border-radius-400!default;
$ibo-border-radius-500: $common-border-radius-500 !default;
$ibo-border-radius-700: $common-border-radius-700 !default;
$ibo-border-radius-900: $common-border-radius-900 !default;
$ibo-border-radius-full: $common-border-radius-full !default;
:root{
--ibo-border-radius-100: #{$ibo-border-radius-100};

View File

@@ -3,7 +3,7 @@
* @license http://opensource.org/licenses/AGPL-3.0
*/
$ibo-depression-100: inset 0 1px 1px 0 rgba(0, 0, 0, 0.15) !default;
$ibo-depression-100: $common-depression-100 !default;
:root{
--ibo-depression-100: #{$ibo-depression-100};

View File

@@ -3,11 +3,11 @@
* @license http://opensource.org/licenses/AGPL-3.0
*/
$ibo-elevation-100: 0 1px 2px rgba(0, 0, 0, 0.25), 0 1px 3px rgba(0, 0, 0, 0.12) !default;
$ibo-elevation-200: 0 2px 4px rgba(0, 0, 0, 0.12), 0 3px 6px rgba(0, 0, 0, 0.15) !default;
$ibo-elevation-300: 0 3px 6px rgba(0, 0, 0, 0.10), 0 10px 20px rgba(0, 0, 0, 0.15) !default;
$ibo-elevation-400: 0 5px 10px rgba(0, 0, 0, 0.05), 0 15px 25px rgba(0, 0, 0, 0.15) !default;
$ibo-elevation-500: 0 20px 40px rgba(0, 0, 0, 0.20) !default;
$ibo-elevation-100: $common-elevation-100 !default;
$ibo-elevation-200: $common-elevation-200 !default;
$ibo-elevation-300: $common-elevation-300 !default;
$ibo-elevation-400: $common-elevation-400 !default;
$ibo-elevation-500: $common-elevation-500 !default;
:root{
--ibo-elevation-100: #{$ibo-elevation-100};

View File

@@ -3,4 +3,3 @@
* @license http://opensource.org/licenses/AGPL-3.0
*/
$approot-relative: '../../../../' !default;

View File

@@ -3,25 +3,25 @@
* @license http://opensource.org/licenses/AGPL-3.0
*/
$ibo-size-0: 0 !default;
$ibo-size-50: 2px !default;
$ibo-size-100: 4px !default;
$ibo-size-150: 8px !default;
$ibo-size-200: 12px !default;
$ibo-size-250: 16px !default;
$ibo-size-300: 24px !default;
$ibo-size-350: 32px !default;
$ibo-size-400: 48px !default;
$ibo-size-450: 64px !default;
$ibo-size-500: 96px !default;
$ibo-size-550: 128px !default;
$ibo-size-600: 192px !default;
$ibo-size-650: 256px !default;
$ibo-size-700: 384px !default;
$ibo-size-750: 512px !default;
$ibo-size-800: 640px !default;
$ibo-size-850: 768px !default;
$ibo-size-900: 896px !default;
$ibo-size-0: $common-size-0 !default;
$ibo-size-50: $common-size-50 !default;
$ibo-size-100: $common-size-100 !default;
$ibo-size-150: $common-size-150 !default;
$ibo-size-200: $common-size-200 !default;
$ibo-size-250: $common-size-250 !default;
$ibo-size-300: $common-size-300 !default;
$ibo-size-350: $common-size-350 !default;
$ibo-size-400: $common-size-400 !default;
$ibo-size-450: $common-size-450 !default;
$ibo-size-500: $common-size-500 !default;
$ibo-size-550: $common-size-550 !default;
$ibo-size-600: $common-size-600 !default;
$ibo-size-650: $common-size-650 !default;
$ibo-size-700: $common-size-700 !default;
$ibo-size-750: $common-size-750 !default;
$ibo-size-800: $common-size-800 !default;
$ibo-size-850: $common-size-850 !default;
$ibo-size-900: $common-size-900 !default;
:root{
--ibo-size-0: #{$ibo-size-0};

View File

@@ -4,37 +4,37 @@
*/
/* Base size: html font-size 12px */
$ibo-font-size-20: 0.67rem !default; /* 8px */
$ibo-font-size-50: 0.83rem !default; /* 10px */
$ibo-font-size-100: 1rem !default; /* 12px */
$ibo-font-size-150: 1.17rem !default; /* 14px */
$ibo-font-size-200: 1.33rem !default; /* 16px */
$ibo-font-size-250: 1.5rem !default; /* 18px */
$ibo-font-size-300: 1.67rem !default; /* 20px */
$ibo-font-size-350: 1.83rem !default; /* 22px */
$ibo-font-size-400: 2rem !default; /* 24px */
$ibo-font-size-450: 2.5rem !default; /* 30px */
$ibo-font-size-500: 3rem !default; /* 36px */
$ibo-font-size-550: 4rem !default; /* 48px */
$ibo-font-size-600: 5rem !default; /* 60px */
$ibo-font-size-650: 6rem !default; /* 72px */
$ibo-font-size-700: 7rem !default; /* 84px */
$ibo-font-size-20: $common-font-size-20 !default; /* 8px */
$ibo-font-size-50: $common-font-size-50 !default; /* 10px */
$ibo-font-size-100: $common-font-size-100 !default; /* 12px */
$ibo-font-size-150: $common-font-size-150 !default; /* 14px */
$ibo-font-size-200: $common-font-size-200 !default; /* 16px */
$ibo-font-size-250: $common-font-size-250 !default; /* 18px */
$ibo-font-size-300: $common-font-size-300 !default; /* 20px */
$ibo-font-size-350: $common-font-size-350 !default; /* 22px */
$ibo-font-size-400: $common-font-size-400 !default; /* 24px */
$ibo-font-size-450: $common-font-size-450 !default; /* 30px */
$ibo-font-size-500: $common-font-size-500 !default; /* 36px */
$ibo-font-size-550: $common-font-size-550 !default; /* 48px */
$ibo-font-size-600: $common-font-size-600 !default; /* 60px */
$ibo-font-size-650: $common-font-size-650 !default; /* 72px */
$ibo-font-size-700: $common-font-size-700 !default; /* 84px */
/* Value Common weight name (https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight) */
$ibo-font-weight-100: 100 !default; /* 100 Thin (Harline) */
$ibo-font-weight-200: 200 !default; /* 200 Extra Light (Ultra Light) */
$ibo-font-weight-300: 300 !default; /* 300 Light */
$ibo-font-weight-400: 400 !default; /* 400 Normal (Regular) */
$ibo-font-weight-500: 500 !default; /* 500 Medium */
$ibo-font-weight-600: 600 !default; /* 600 Semi Bold (Demi Bold) */
$ibo-font-weight-700: 700 !default; /* 700 Bold */
$ibo-font-weight-800: 800 !default; /* 800 Extra Bold (Ultra Bold) */
$ibo-font-weight-900: 900 !default; /* 900 Black (Heavy) */
$ibo-font-weight-950: 950 !default; /* 950 Extra Black (Ultra Black) */
$ibo-font-weight-100: $common-font-weight-100 !default; /* 100 Thin (Harline) */
$ibo-font-weight-200: $common-font-weight-200 !default; /* 200 Extra Light (Ultra Light) */
$ibo-font-weight-300: $common-font-weight-300 !default; /* 300 Light */
$ibo-font-weight-400: $common-font-weight-400 !default; /* 400 Normal (Regular) */
$ibo-font-weight-500: $common-font-weight-500 !default; /* 500 Medium */
$ibo-font-weight-600: $common-font-weight-600 !default; /* 600 Semi Bold (Demi Bold) */
$ibo-font-weight-700: $common-font-weight-700 !default; /* 700 Bold */
$ibo-font-weight-800: $common-font-weight-800 !default; /* 800 Extra Bold (Ultra Bold) */
$ibo-font-weight-900: $common-font-weight-900 !default; /* 900 Black (Heavy) */
$ibo-font-weight-950: $common-font-weight-950 !default; /* 950 Extra Black (Ultra Black) */
$ibo-font-family-base: "Raleway" !default;
$ibo-font-family-fallbacks: "sans-serif", "system-ui" !default;
$ibo-font-family-monospace: monospace !default;
$ibo-font-family-base: $common-font-family-base !default;
$ibo-font-family-fallbacks: $common-font-family-fallbacks !default;
$ibo-font-family-monospace: $common-font-family-monospace !default;
$ibo-font-family-code: $ibo-font-family-monospace !default;
:root {

View File

@@ -4,102 +4,124 @@
*/
/* Base color palettes */
$ibo-color-white-100: hsla(0, 0%, 100%, 1) !default;
$ibo-color-white-200: hsla(0, 0%, 94.9%, 1) !default;
$ibo-color-transparent: hsla(0, 0%, 100%, 0) !default;
$ibo-color-white-100: $common-color-white-100 !default;
$ibo-color-white-200: $common-color-white-200 !default;
$ibo-color-transparent: $common-color-transparent !default;
$ibo-color-grey-50: hsla(240, 20%, 99%, 1) !default;
$ibo-color-grey-100: hsla(210, 16.7%, 97.6%, 1) !default;
$ibo-color-grey-200: hsla(207, 22.4%, 90.4%, 1) !default;
$ibo-color-grey-300: hsla(210, 23.5%, 86.7%, 1) !default;
$ibo-color-grey-400: hsla(208, 17.2%, 82.9%, 1) !default;
$ibo-color-grey-500: hsla(209, 23.7%, 74.3%, 1) !default;
$ibo-color-grey-600: hsla(215, 16.6%, 63.3%, 1) !default;
$ibo-color-grey-700: hsla(214, 11.3%, 48.6%, 1) !default;
$ibo-color-grey-800: hsla(215, 16.9%, 30.2%, 1) !default;
$ibo-color-grey-900: hsla(215, 22.4%, 16.7%, 1) !default;
$ibo-color-grey-950: hsla(215, 26.4%, 10.7%, 1) !default;
$ibo-color-grey-50: $common-color-grey-50 !default;
$ibo-color-grey-100: $common-color-grey-100 !default;
$ibo-color-grey-200: $common-color-grey-200 !default;
$ibo-color-grey-300: $common-color-grey-300 !default;
$ibo-color-grey-400: $common-color-grey-400 !default;
$ibo-color-grey-500: $common-color-grey-500 !default;
$ibo-color-grey-600: $common-color-grey-600 !default;
$ibo-color-grey-700: $common-color-grey-700 !default;
$ibo-color-grey-800: $common-color-grey-800 !default;
$ibo-color-grey-900: $common-color-grey-900 !default;
$ibo-color-grey-950: $common-color-grey-950 !default;
$ibo-color-blue-grey-50: hsla(210, 36%, 96%, 1) !default;
$ibo-color-blue-grey-100: hsla(198, 15.7%, 83.7%, 1) !default;
$ibo-color-blue-grey-200: hsla(200, 15.3%, 73.1%, 1) !default;
$ibo-color-blue-grey-300: hsla(200, 15.6%, 62.4%, 1) !default;
$ibo-color-blue-grey-400: hsla(200, 15.4%, 54.1%, 1) !default;
$ibo-color-blue-grey-500: hsla(200, 18.3%, 46.1%, 1) !default;
$ibo-color-blue-grey-600: hsla(199, 18.4%, 40.4%, 1) !default;
$ibo-color-blue-grey-700: hsla(199, 18.3%, 33.1%, 1) !default;
$ibo-color-blue-grey-800: hsla(200, 17.9%, 26.3%, 1) !default;
$ibo-color-blue-grey-900: hsla(200, 19.1%, 18.4%, 1) !default;
$ibo-color-blue-grey-950: hsla(200, 20.2%, 13.1%, 1) !default;
$ibo-color-blue-grey-50: $common-color-blue-grey-50 !default;
$ibo-color-blue-grey-100: $common-color-blue-grey-100 !default;
$ibo-color-blue-grey-200: $common-color-blue-grey-200 !default;
$ibo-color-blue-grey-300: $common-color-blue-grey-300 !default;
$ibo-color-blue-grey-400: $common-color-blue-grey-400 !default;
$ibo-color-blue-grey-500: $common-color-blue-grey-500 !default;
$ibo-color-blue-grey-600: $common-color-blue-grey-600 !default;
$ibo-color-blue-grey-700: $common-color-blue-grey-700 !default;
$ibo-color-blue-grey-800: $common-color-blue-grey-800 !default;
$ibo-color-blue-grey-900: $common-color-blue-grey-900 !default;
$ibo-color-blue-grey-950: $common-color-blue-grey-950 !default;
$ibo-color-blue-100: hsla(201, 100%, 96.1%, 1) !default;
$ibo-color-blue-200: hsla(202, 80.6%, 85.9%, 1) !default;
$ibo-color-blue-300: hsla(203, 82%, 76.1%, 1) !default;
$ibo-color-blue-400: hsla(205, 79.3%, 65.9%, 1) !default;
$ibo-color-blue-500: hsla(207, 72.6%, 57.1%, 1) !default;
$ibo-color-blue-600: hsla(209, 61.6%, 50%, 1) !default;
$ibo-color-blue-700: hsla(211, 60.7%, 42.9%, 1) !default;
$ibo-color-blue-800: hsla(213, 49.4%, 34.1%, 1) !default;
$ibo-color-blue-900: hsla(215, 41.3%, 28%, 1) !default;
$ibo-color-blue-950: hsla(215, 36.8%, 23%, 1) !default;
$ibo-color-blue-100: $common-color-blue-100 !default;
$ibo-color-blue-200: $common-color-blue-200 !default;
$ibo-color-blue-300: $common-color-blue-300 !default;
$ibo-color-blue-400: $common-color-blue-400 !default;
$ibo-color-blue-500: $common-color-blue-500 !default;
$ibo-color-blue-600: $common-color-blue-600 !default;
$ibo-color-blue-700: $common-color-blue-700 !default;
$ibo-color-blue-800: $common-color-blue-800 !default;
$ibo-color-blue-900: $common-color-blue-900 !default;
$ibo-color-blue-950: $common-color-blue-950 !default;
$ibo-color-cyan-100: hsla(186, 61.2%, 86.9%, 1) !default;
$ibo-color-cyan-200: hsla(187, 71.6%, 71%, 1) !default;
$ibo-color-cyan-300: hsla(187, 71.2%, 59.2%, 1) !default;
$ibo-color-cyan-400: hsla(187, 70.9%, 50.2%, 1) !default;
$ibo-color-cyan-500: hsla(187, 100%, 41.6%, 1) !default;
$ibo-color-cyan-600: hsla(187, 100%, 37.8%, 1) !default;
$ibo-color-cyan-700: hsla(186, 100%, 32.7%, 1) !default;
$ibo-color-cyan-800: hsla(185, 100%, 28%, 1) !default;
$ibo-color-cyan-900: hsla(182, 100%, 19.6%, 1) !default;
$ibo-color-cyan-950: hsla(180, 100%, 10.6%, 1) !default;
$ibo-color-cyan-100: $common-color-cyan-100 !default;
$ibo-color-cyan-200: $common-color-cyan-200 !default;
$ibo-color-cyan-300: $common-color-cyan-300 !default;
$ibo-color-cyan-400: $common-color-cyan-400 !default;
$ibo-color-cyan-500: $common-color-cyan-500 !default;
$ibo-color-cyan-600: $common-color-cyan-600 !default;
$ibo-color-cyan-700: $common-color-cyan-700 !default;
$ibo-color-cyan-800: $common-color-cyan-800 !default;
$ibo-color-cyan-900: $common-color-cyan-900 !default;
$ibo-color-cyan-950: $common-color-cyan-950 !default;
$ibo-color-green-100: hsla(88, 50.7%, 85.7%, 1) !default;
$ibo-color-green-200: hsla(88, 50%, 76.5%, 1) !default;
$ibo-color-green-300: hsla(88, 50%, 67.1%, 1) !default;
$ibo-color-green-400: hsla(88, 50.2%, 59.8%, 1) !default;
$ibo-color-green-500: hsla(88, 50.2%, 52.7%, 1) !default;
$ibo-color-green-600: hsla(89, 46.1%, 48%, 1) !default;
$ibo-color-green-700: hsla(92, 47.9%, 42.2%, 1) !default;
$ibo-color-green-800: hsla(95, 49.5%, 36.5%, 1) !default;
$ibo-color-green-900: hsla(103, 55.6%, 26.5%, 1) !default;
$ibo-color-green-950: hsla(108, 59.6%, 21.5%, 1) !default;
$ibo-color-green-100: $common-color-green-100 !default;
$ibo-color-green-200: $common-color-green-200 !default;
$ibo-color-green-300: $common-color-green-300 !default;
$ibo-color-green-400: $common-color-green-400 !default;
$ibo-color-green-500: $common-color-green-500 !default;
$ibo-color-green-600: $common-color-green-600 !default;
$ibo-color-green-700: $common-color-green-700 !default;
$ibo-color-green-800: $common-color-green-800 !default;
$ibo-color-green-900: $common-color-green-900 !default;
$ibo-color-green-950: $common-color-green-950 !default;
$ibo-color-orange-100: hsla(40, 100%, 97.1%, 1) !default;
$ibo-color-orange-200: hsla(39, 96.4%, 89%, 1) !default;
$ibo-color-orange-300: hsla(38, 93.2%, 76.9%, 1) !default;
$ibo-color-orange-400: hsla(33, 89.9%, 64.9%, 1) !default;
$ibo-color-orange-500: hsla(28, 82.9%, 51.8%, 1) !default;
$ibo-color-orange-600: hsla(24, 74.7%, 49.6%, 1) !default;
$ibo-color-orange-700: hsla(20, 70.7%, 44.1%, 1) !default;
$ibo-color-orange-800: hsla(16, 65.1%, 37.1%, 1) !default;
$ibo-color-orange-900: hsla(14, 60.8%, 30%, 1) !default;
$ibo-color-orange-950: hsla(14, 55.1%, 22%, 1) !default;
$ibo-color-orange-100: $common-color-orange-100 !default;
$ibo-color-orange-200: $common-color-orange-200 !default;
$ibo-color-orange-300: $common-color-orange-300 !default;
$ibo-color-orange-400: $common-color-orange-400 !default;
$ibo-color-orange-500: $common-color-orange-500 !default;
$ibo-color-orange-600: $common-color-orange-600 !default;
$ibo-color-orange-700: $common-color-orange-700 !default;
$ibo-color-orange-800: $common-color-orange-800 !default;
$ibo-color-orange-900: $common-color-orange-900 !default;
$ibo-color-orange-950: $common-color-orange-950 !default;
$ibo-color-red-100: hsla(0, 76.9%, 94.9%, 1) !default;
$ibo-color-red-200: hsla(0, 95.1%, 92%, 1) !default;
$ibo-color-red-300: hsla(0, 97.4%, 84.7%, 1) !default;
$ibo-color-red-400: hsla(0, 95.3%, 74.7%, 1) !default;
$ibo-color-red-500: hsla(0, 87.8%, 67.8%, 1) !default;
$ibo-color-red-600: hsla(0, 76.3%, 57.1%, 1) !default;
$ibo-color-red-700: hsla(0, 60.8%, 48%, 1) !default;
$ibo-color-red-800: hsla(0, 55.8%, 39%, 1) !default;
$ibo-color-red-900: hsla(0, 46.8%, 31%, 1) !default;
$ibo-color-red-950: hsla(0, 42.9%, 20%, 1) !default;
$ibo-color-red-100: $common-color-red-100 !default;
$ibo-color-red-200: $common-color-red-200 !default;
$ibo-color-red-300: $common-color-red-300 !default;
$ibo-color-red-400: $common-color-red-400 !default;
$ibo-color-red-500: $common-color-red-500 !default;
$ibo-color-red-600: $common-color-red-600 !default;
$ibo-color-red-700: $common-color-red-700 !default;
$ibo-color-red-800: $common-color-red-800 !default;
$ibo-color-red-900: $common-color-red-900 !default;
$ibo-color-red-950: $common-color-red-950 !default;
$ibo-color-pink-100: hsla(348, 100%, 98%, 1) !default;
$ibo-color-pink-200: hsla(343, 95%, 92%, 1) !default;
$ibo-color-pink-300: hsla(339, 90%, 85%, 1) !default;
$ibo-color-pink-400: hsla(336, 86%, 75%, 1) !default;
$ibo-color-pink-500: hsla(331, 79%, 66%, 1) !default;
$ibo-color-pink-600: hsla(329, 64%, 54%, 1) !default;
$ibo-color-pink-700: hsla(325, 57%, 46%, 1) !default;
$ibo-color-pink-800: hsla(322, 60%, 37%, 1) !default;
$ibo-color-pink-900: hsla(318, 51%, 29%, 1) !default;
$ibo-color-pink-950: hsla(318, 51%, 21%, 1) !default;
$ibo-color-pink-100: $common-color-pink-100 !default;
$ibo-color-pink-200: $common-color-pink-200 !default;
$ibo-color-pink-300: $common-color-pink-300 !default;
$ibo-color-pink-400: $common-color-pink-400 !default;
$ibo-color-pink-500: $common-color-pink-500 !default;
$ibo-color-pink-600: $common-color-pink-600 !default;
$ibo-color-pink-700: $common-color-pink-700 !default;
$ibo-color-pink-800: $common-color-pink-800 !default;
$ibo-color-pink-900: $common-color-pink-900 !default;
$ibo-color-pink-950: $common-color-pink-950 !default;
$ibo-colors: ('grey', 'blue-grey', 'blue', 'cyan', 'green', 'orange', 'red', 'pink', 'primary', 'secondary', 'information', 'success', 'warning', 'danger');
$ibo-color-yellow-100: $common-color-yellow-100 !default;
$ibo-color-yellow-200: $common-color-yellow-200 !default;
$ibo-color-yellow-300: $common-color-yellow-300 !default;
$ibo-color-yellow-400: $common-color-yellow-400 !default;
$ibo-color-yellow-500: $common-color-yellow-500 !default;
$ibo-color-yellow-600: $common-color-yellow-600 !default;
$ibo-color-yellow-700: $common-color-yellow-700 !default;
$ibo-color-yellow-800: $common-color-yellow-800 !default;
$ibo-color-yellow-900: $common-color-yellow-900 !default;
$ibo-color-yellow-950: $common-color-yellow-950 !default;
$ibo-color-purple-100: $common-color-purple-100 !default;
$ibo-color-purple-200: $common-color-purple-200 !default;
$ibo-color-purple-300: $common-color-purple-300 !default;
$ibo-color-purple-400: $common-color-purple-400 !default;
$ibo-color-purple-500: $common-color-purple-500 !default;
$ibo-color-purple-600: $common-color-purple-600 !default;
$ibo-color-purple-700: $common-color-purple-700 !default;
$ibo-color-purple-800: $common-color-purple-800 !default;
$ibo-color-purple-900: $common-color-purple-900 !default;
$ibo-color-purple-950: $common-color-purple-950 !default;
$ibo-colors: $common-colors;
/* CSS variables */
:root{
@@ -196,4 +218,26 @@ $ibo-colors: ('grey', 'blue-grey', 'blue', 'cyan', 'green', 'orange', 'red', 'pi
--ibo-color-pink-800: #{$ibo-color-pink-800};
--ibo-color-pink-900: #{$ibo-color-pink-900};
--ibo-color-pink-950: #{$ibo-color-pink-950};
--ibo-color-yellow-100: #{$ibo-color-yellow-100};
--ibo-color-yellow-200: #{$ibo-color-yellow-200};
--ibo-color-yellow-300: #{$ibo-color-yellow-300};
--ibo-color-yellow-400: #{$ibo-color-yellow-400};
--ibo-color-yellow-500: #{$ibo-color-yellow-500};
--ibo-color-yellow-600: #{$ibo-color-yellow-600};
--ibo-color-yellow-700: #{$ibo-color-yellow-700};
--ibo-color-yellow-800: #{$ibo-color-yellow-800};
--ibo-color-yellow-900: #{$ibo-color-yellow-900};
--ibo-color-yellow-950: #{$ibo-color-yellow-950};
--ibo-color-purple-100: #{$ibo-color-purple-100};
--ibo-color-purple-200: #{$ibo-color-purple-200};
--ibo-color-purple-300: #{$ibo-color-purple-300};
--ibo-color-purple-400: #{$ibo-color-purple-400};
--ibo-color-purple-500: #{$ibo-color-purple-500};
--ibo-color-purple-600: #{$ibo-color-purple-600};
--ibo-color-purple-700: #{$ibo-color-purple-700};
--ibo-color-purple-800: #{$ibo-color-purple-800};
--ibo-color-purple-900: #{$ibo-color-purple-900};
--ibo-color-purple-950: #{$ibo-color-purple-950};
}

View File

@@ -5,8 +5,8 @@
/* Base helpers for colors */
/* - These lightness vars are used to force a certain lightness on HSLA colors */
$ibo-color-base-lightness-100: 93% !default;
$ibo-color-base-lightness-900: 15% !default;
$ibo-color-base-lightness-100: $common-color-base-lightness-100 !default;
$ibo-color-base-lightness-900: $common-color-base-lightness-900 !default;
$ibo-color-base-opacity-for-lightness-100: 1 !default;
$ibo-color-base-opacity-for-lightness-900: 1 !default;
$ibo-color-base-opacity-for-lightness-100: $common-color-base-opacity-for-lightness-100 !default;
$ibo-color-base-opacity-for-lightness-900: $common-color-base-opacity-for-lightness-900 !default;

View File

@@ -6,8 +6,8 @@
/* Skeleton palette */
/* - Colors used by skeletons svg to display placeholders */
$ibo-skeleton-start-color: $ibo-color-grey-200 !default;
$ibo-skeleton-stop-color: $ibo-color-blue-grey-100 !default;
$ibo-skeleton-start-color: $common-skeleton-start-color !default;
$ibo-skeleton-stop-color: $common-skeleton-stop-color !default;
/* CSS variables */
/* Skeleton CSS3 variables are not ibo prefixed as they are not iTop backoffice exclusives*/

View File

@@ -2,44 +2,115 @@
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
@import "../../common/vendors/_highlightjs";
// Backoffice specific variables
$ibo-vendors-highlightjs--padding: 0.9rem !default;
$ibo-vendors-highlightjs--box-shadow: 0 0px 3px 2px inset rgba(0, 0, 0, 0.4) !default;
$ibo-vendors-highlightjs--border-radius: $ibo-border-radius-300 !default;
$ibo-vendors-highlightjs--code--padding-x: 5px !default;
$ibo-vendors-highlightjs--code--padding-y: 3px !default;
$ibo-vendors-highlightjs--padding: $common-vendors-highlightjs--padding !default;
$ibo-vendors-highlightjs--box-shadow: $common-vendors-highlightjs--box-shadow !default;
$ibo-vendors-highlightjs--border-radius: $common-vendors-highlightjs--border-radius !default;
$ibo-vendors-highlightjs--code--padding-x: $common-vendors-highlightjs--code--padding-x !default;
$ibo-vendors-highlightjs--code--padding-y: $common-vendors-highlightjs--code--padding-y !default;
$ibo-vendors-highlightjs--background-color: #282b2e !default;
$ibo-vendors-highlightjs--color: #e0e2e4 !default;
$ibo-vendors-highlightjs--keyword--color: #93c763 !default;
$ibo-vendors-highlightjs--number--color: #ffcd22 !default;
$ibo-vendors-highlightjs--attribute--color: #668bb0 !default;
$ibo-vendors-highlightjs--regexp--color: #d39745 !default;
$ibo-vendors-highlightjs--meta--color: #557182 !default;
$ibo-vendors-highlightjs--tag--color: #8cbbad !default;
$ibo-vendors-highlightjs--string--color: #ec7600 !default;
$ibo-vendors-highlightjs--comment--color: #818e96 !default;
$ibo-vendors-highlightjs--selector-class--color: #A082BD !default;
$ibo-vendors-highlightjs--code--color: white !default;
$ibo-vendors-highlightjs--background-color: $common-vendors-highlightjs--background-color !default;
$ibo-vendors-highlightjs--color: $common-vendors-highlightjs--color !default;
$ibo-vendors-highlightjs--keyword--color: $common-vendors-highlightjs--keyword--color !default;
$ibo-vendors-highlightjs--number--color: $common-vendors-highlightjs--number--color !default;
$ibo-vendors-highlightjs--attribute--color: $common-vendors-highlightjs--attribute--color !default;
$ibo-vendors-highlightjs--regexp--color: $common-vendors-highlightjs--regexp--color !default;
$ibo-vendors-highlightjs--meta--color: $common-vendors-highlightjs--meta--color !default;
$ibo-vendors-highlightjs--tag--color: $common-vendors-highlightjs--tag--color !default;
$ibo-vendors-highlightjs--string--color: $common-vendors-highlightjs--string--color !default;
$ibo-vendors-highlightjs--comment--color: $common-vendors-highlightjs--comment--color !default;
$ibo-vendors-highlightjs--selector-class--color: $common-vendors-highlightjs--selector-class--color !default;
$ibo-vendors-highlightjs--code--color: $common-vendors-highlightjs--code--color !default;
// Override common variables
$common-vendors-highlightjs--padding: $ibo-vendors-highlightjs--padding;
$common-vendors-highlightjs--box-shadow: $ibo-vendors-highlightjs--box-shadow;
$common-vendors-highlightjs--border-radius: $ibo-vendors-highlightjs--border-radius;
$common-vendors-highlightjs--code--padding-x: $ibo-vendors-highlightjs--code--padding-x;
$common-vendors-highlightjs--code--padding-y: $ibo-vendors-highlightjs--code--padding-y;
// Highlight.js stylesheets
/* Highlight JS */
.common-hljs-container{
padding: 0 !important;
border: none !important;
}
$common-vendors-highlightjs--background-color: $ibo-vendors-highlightjs--background-color;
$common-vendors-highlightjs--color: $ibo-vendors-highlightjs--color;
$common-vendors-highlightjs--keyword--color: $ibo-vendors-highlightjs--keyword--color;
$common-vendors-highlightjs--number--color: $ibo-vendors-highlightjs--number--color;
$common-vendors-highlightjs--attribute--color: $ibo-vendors-highlightjs--attribute--color;
$common-vendors-highlightjs--regexp--color: $ibo-vendors-highlightjs--regexp--color;
$common-vendors-highlightjs--meta--color: $ibo-vendors-highlightjs--meta--color;
$common-vendors-highlightjs--tag--color: $ibo-vendors-highlightjs--tag--color;
$common-vendors-highlightjs--string--color: $ibo-vendors-highlightjs--string--color;
$common-vendors-highlightjs--comment--color: $ibo-vendors-highlightjs--comment--color;
$common-vendors-highlightjs--selector-class--color: $ibo-vendors-highlightjs--selector-class--color;
$common-vendors-highlightjs--code--color: $ibo-vendors-highlightjs--code--color;
pre code.hljs {
display: block;
overflow-x: auto;
padding: $ibo-vendors-highlightjs--padding !important;
}
code.hljs {
padding: $ibo-vendors-highlightjs--code--padding-y $ibo-vendors-highlightjs--code--padding-x !important;
}
/**
* Obsidian style
* ported by Alexander Marenin (http://github.com/ioncreature)
*/
.hljs {
box-shadow: $ibo-vendors-highlightjs--box-shadow !important;
border-radius: $ibo-vendors-highlightjs--border-radius !important;
white-space: pre-wrap;
border: none !important;
color: $ibo-vendors-highlightjs--color !important;
background: $ibo-vendors-highlightjs--background-color !important;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-selector-id {
color: $ibo-vendors-highlightjs--keyword--color !important;
}
.hljs-number {
color: $ibo-vendors-highlightjs--number--color !important;
}
.hljs-attribute {
color: $ibo-vendors-highlightjs--attribute--color
}
.hljs-regexp,
.hljs-link {
color: $ibo-vendors-highlightjs--regexp--color !important;
}
.hljs-meta {
color: $ibo-vendors-highlightjs--meta--color !important;
}
.hljs-tag,
.hljs-name,
.hljs-bullet,
.hljs-subst,
.hljs-emphasis,
.hljs-type,
.hljs-built_in,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-addition,
.hljs-variable,
.hljs-template-tag,
.hljs-template-variable {
color: $ibo-vendors-highlightjs--tag--color !important;
}
.hljs-string,
.hljs-symbol {
color: $ibo-vendors-highlightjs--string--color !important;
}
.hljs-comment,
.hljs-quote,
.hljs-deletion {
color: $ibo-vendors-highlightjs--comment--color !important;
}
.hljs-selector-class {
color: $ibo-vendors-highlightjs--selector-class--color !important;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-doctag,
.hljs-title,
.hljs-section,
.hljs-type,
.hljs-name,
.hljs-strong {
font-weight: bold
}
.hljs-code,
.hljs-title.class_,
.hljs-class .hljs-title,
.hljs-section {
color: $ibo-vendors-highlightjs--code--color !important;
}

View File

@@ -1,4 +1,4 @@
/*!
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/

View File

@@ -1,4 +1,4 @@
/*!
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/

108
css/common/README.md Normal file
View File

@@ -0,0 +1,108 @@
# Description
This is a brief description of how the common theme is structured using both BEM and SASS 7-1 systems and how to use them.
* [7-1 pattern](#7-1-pattern)
* [File structure](#file-structure)
* [Usage](#usage)
* [BEM methodology](#bem-methodology)
* [Principles](#principles)
* [Examples](#examples)
# 7-1 pattern
## File structure
SCSS files are structured following the [7-1 pattern](https://sass-guidelin.es/#the-7-1-pattern). \
@rveitch made a great summary with the following, which can also be found [here](https://gist.github.com/rveitch/84cea9650092119527bc).
_Note: Folders with an * are customizations we made to the original 7-1 pattern to best fit our needs_
```
css/common/
|
| utils/
| | variables/ # Sass Variables used in Functions, Mixins, Helpers, ...
| | |- colors/
| | | |- _base.scss
| | | |- _base-palette.scss # Base colors used everywhere
| | | |- _lifecycle-palette.scss # Colors used for lifecycle of an object (e.g. representing states such as new, frozen, done, ...), based on the base colors
| | | |- _semantic-palette.scss # Colors used for semantic meaning (e.g. red for errors, green for success, ...), based on the base colors
| | | ...
| | |
| | |- _depression.scss
| | |- _elevation.scss
| | |- _size.scss # Base sizes used everywhere (spacings, ...)
| | |- _spacing.scss
| | |- _typography.scss # Typography sizes, weights, families, ...
| | ...
| |
| | functions/ # Sass Functions
| | |- _color.scss # Color manipulation functions
| |
| | mixins/ # Sass Mixins
| | helpers/ # Class & placeholders helpers
|
| vendors/ # Third-party libs, should be either:
| # - Overload of the lib SCSS variables (BEST way, but possible only if the lib exposes them. e.g. Bulma)
| # - Overload of the lib necessary CSS classes only (not great as it duplicates some rules in the browser, which add weight and computation. e.g. dataTables)
| # - Duplicate the lib CSS completly to insert SCSS variables (not great as it will be outdated when updating the lib itself. e.g. jQuery UI)
| | _bulma-variables-overload.scss # Bulma CSS framework
| | _jquery-ui.scss # jQuery UI
| ... # Etc…
|
| base/
| | _reset.scss # Reset/normalize
| | _typography.scss # Typography fonts imports
| ... # Etc…
|
|- _shame.scss # Shame file, should contain all the ugly hacks (https://sass-guidelin.es/#shame-file)
` main.scss # Main Sass file
```
## Usage
To avoid common errors, files should be imported in the final file in the following order. Again those are just following the SASS guidelines:
- Utils
- Variables
- Functions
- Mixins
- Helpers
- Vendors
- Base
- Shame file
# BEM methodology
## Principles
[BEM is a methodology](https://getbem.com/) that helps you to create reusable components and code sharing in frontend development. \
The main idea is to use discriminant classes instead of nested basic selectors for 2 main reasons:
* It's easier to understand the purpose of a specific class when seeing it in the HTML markup of the SCSS file
* It's easier to override a specific class when needed as you don't need to use a selector at least as precise/complex as the one you want to override
In our implementation, we start with the code of the UI block, followed by the sub-element, then the property or modifier. Separation is made of `--` instead of `__`.
## Examples
### Classes and CSS properties example
```scss
// SCSS variables:
// - For CSS properties: CSS class, followed by CSS property
$common-button--padding-y: 6px !default;
$common-button--padding-x: 9px !default;
$common-button--border: 0 !default;
$common-button--border-radius: $common-border-radius-400 !default;
$common-button--box-shadow-bottom: 0px 2px 0px !default;
$common-button--box-shadow-top: inset 0px 2px 0px !default;
$common-button--label--margin-left: $common-spacing-200 !default;
```
### States example
```scss
// SCSS variables:
// Same rule as before, but with a `--is-` or `--on--` suffix
$common-quick-create--input--padding: $common-spacing-0 default;
$common-quick-create--input--padding-x--is-opened: $common-spacing-300 !default;
$common-quick-create--input--padding-y--is-opened: $common-spacing-300 !default;
$common-quick-create--input--width: $common-size-0 !default;
$common-quick-create--input--width--is-opened: 245px !default;
$common-quick-create--input--background-color: $common-color-white-100 !default;
$common-quick-create--input--background-color--on-hover: $common-color-grey-200 !default;
```

40
css/common/_shame.scss Normal file
View File

@@ -0,0 +1,40 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
// ==========================================================================
// $Shame
// @see http://csswizardry.com/2013/04/shame-css/
// Thanks https://github.com/heroheman/shepherd/blob/master/sass/_shame.scss
// ==========================================================================
//
// ==========================================================================
// because hacks happen.
//
// be very specific about what each piece of code is doing, and
// how to better fix it later
// ==========================================================================
//
// Try: $ git blame _shame.scss
//
// Rules:
// ---------------
// 1. If its a hack, it goes in _shame.scss.
// 2. Document all hacks fully:
// 3. What part of the codebase does it relate to?
// 4. Why was this needed?
// 5. How does this fix it?
// 6. How might you fix it properly, given more time?
// 7. Do not blame the developer; if they explained why they had to do it then their reasons are probably (hopefully) valid.
// 8. Try and clean _shame.scss up when you have some down time.
// Example:
// ---------------
// Nav specificity fix.
//
// Someone used an ID in the header code (`#header a{}`) which trumps the
// nav selectors (`.site-nav a{}`). Use !important to override it until I
// have time to refactor the header stuff.
//
// .site-nav a { color:#BADA55!important; }

View File

@@ -0,0 +1,7 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
@import "base";
@import "typography";

View File

@@ -0,0 +1,17 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
$common-scrollbar--scrollbar-width: 8px !default;
$common-scrollbar--scrollbar-height: $common-scrollbar--scrollbar-width !default; /* For horizontal scrollbars */
$common-scrollbar--scrollbar-track-background-color: $common-color-transparent !default;
$common-scrollbar--scrollbar-track-border-radius: $common-border-radius-500 !default;
$common-scrollbar--scrollbar-thumb-background-color: $common-color-grey-300 !default;
$common-scrollbar--scrollbar-thumb-border: none !default;
$common-scrollbar--scrollbar-thumb-border-radius: $common-border-radius-500 !default;
$common-svg-illustration--fill: $common-color-primary-500 !default;
$common-content-block--background-color: $common-color-white-100 !default;
$common-content-block--border: 1px solid $common-color-grey-400 !default;

View File

@@ -0,0 +1,150 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
/* This is an overload of the default lib. stylesheet to use local fonts instead of the CDN */
@font-face {
font-family: Raleway;
font-weight: 100;
font-style: normal;
font-display: swap;
src: local('Raleway Thin'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-100-normal.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 100;
font-style: italic;
font-display: swap;
src: local('Raleway Thin'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-100-italic.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 200;
font-style: normal;
font-display: swap;
src: local('Raleway ExtraLight'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-200-normal.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 200;
font-style: italic;
font-display: swap;
src: local('Raleway ExtraLight'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-200-italic.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 300;
font-style: normal;
font-display: swap;
src: local('Raleway Light'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-300-normal.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 300;
font-style: italic;
font-display: swap;
src: local('Raleway Light'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-300-italic.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 400;
font-style: normal;
font-display: swap;
src: local('Raleway'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-400-normal.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 400;
font-style: italic;
font-display: swap;
src: local('Raleway'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-400-italic.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 500;
font-style: normal;
font-display: swap;
src: local('Raleway Medium'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-500-normal.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 500;
font-style: italic;
font-display: swap;
src: local('Raleway Medium'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-500-italic.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 600;
font-style: normal;
font-display: swap;
src: local('Raleway SemiBold'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-600-normal.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 600;
font-style: italic;
font-display: swap;
src: local('Raleway SemiBold'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-600-italic.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 700;
font-style: normal;
font-display: swap;
src: local('Raleway'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-700-normal.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 700;
font-style: italic;
font-display: swap;
src: local('Raleway'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-700-italic.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 800;
font-style: normal;
font-display: swap;
src: local('Raleway ExtraBold'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-800-normal.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 800;
font-style: italic;
font-display: swap;
src: local('Raleway ExtraBold'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-800-italic.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 900;
font-style: normal;
font-display: swap;
src: local('Raleway Black'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-900-normal.woff') format('woff'),
}
@font-face {
font-family: Raleway;
font-weight: 900;
font-style: italic;
font-display: swap;
src: local('Raleway Black'),
url($approot-relative + 'node_modules/@fontsource/raleway/files/raleway-all-900-italic.woff') format('woff'),
}

4
css/common/main.scss Normal file
View File

@@ -0,0 +1,4 @@
@import "utils/all";
@import "vendors/all";
@import "base/all";
@import "shame";

View File

@@ -0,0 +1,9 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
@import "variables/all";
@import "functions/all";
@import "mixins/all";
@import "helpers/all";

View File

@@ -0,0 +1,6 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
@import "color";

View File

@@ -0,0 +1,34 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* Adjust the lightness of $sColor to the absolute $fTargetLightness value.
* It is different than lighten() / darken() that shift the current lightness by X%
*
* @return Modified color value in HSLA format
*/
@function common-adjust-lightness($sColor, $fTargetLightness) {
$iHue: hue($sColor);
$fSaturation: saturation($sColor);
$fLightness: lightness($sColor);
$fAlpha: alpha($sColor);
@return hsla($iHue, $fSaturation, $fTargetLightness, $fAlpha);
}
/**
* Adjust the alpha chanel (opacity) of $sColor to the absolute $fTargetAlpha value.
* It is different than opacify() / transparentize() that shift the current alpha value by X%
*
* @return Modified color value in HSLA format
*/
@function common-adjust-alpha($sColor, $fTargetAlpha) {
$iHue: hue($sColor);
$fSaturation: saturation($sColor);
$fLightness: lightness($sColor);
$fAlpha: alpha($sColor);
@return hsla($iHue, $fSaturation, $fLightness, $fTargetAlpha);
}

View File

@@ -0,0 +1,15 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
@import "border-radius";
@import "color";
@import "class-icon";
@import "depression";
@import "elevation";
@import "font-icon";
@import "sticky-header";
@import "text-decoration";
@import "text-position";
@import "typography";

View File

@@ -0,0 +1,26 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
%common-border-radius-100{
border-radius: $common-border-radius-100;
}
%common-border-radius-300{
border-radius: $common-border-radius-300;
}
%common-border-radius-400{
border-radius: $common-border-radius-400;
}
%common-border-radius-500{
border-radius: $common-border-radius-500;
}
%common-border-radius-700{
border-radius: $common-border-radius-700;
}
%common-border-radius-900{
border-radius: $common-border-radius-900;
}
%common-border-radius-full{
border-radius: $common-border-radius-full;
}

View File

@@ -0,0 +1,8 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
$common-class-icon--small--size: 32px !default;
$common-class-icon--medium--size: 48px !default;
$common-class-icon--large--size: 64px !default;

View File

@@ -0,0 +1,23 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
$common-text-colors: (
'primary': $common-color-primary-800,
'secondary': $common-color-secondary-800,
'neutral': $common-color-secondary-800,
'information': $common-color-information-800,
'success': $common-color-success-800,
'failure': $common-color-danger-800,
'warning': $common-color-warning-800,
'danger': $common-color-danger-800,
'grey' : $common-color-grey-800,
'blue-grey': $common-color-blue-grey-800,
'blue': $common-color-blue-800,
'cyan': $common-color-cyan-800,
'green': $common-color-green-800,
'orange': $common-color-orange-800,
'red': $common-color-red-800,
'pink': $common-color-pink-800,
) !default;

View File

@@ -0,0 +1,8 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
%common-depression-100{
box-shadow: $common-depression-100;
}

View File

@@ -0,0 +1,20 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
%common-elevation-100{
box-shadow: $common-elevation-100;
}
%common-elevation-200{
box-shadow: $common-elevation-200;
}
%common-elevation-300{
box-shadow: $common-elevation-300;
}
%common-elevation-400{
box-shadow: $common-elevation-400;
}
%common-elevation-500{
box-shadow: $common-elevation-500;
}

View File

@@ -0,0 +1,43 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
/******************************************************************************************************************************/
/* NOTE: Those helpers allow to easily use an icon from libs. like FontAwesome or FontCombodo within a CSS rule (eg. ::after) */
/* To use it, simply "@extend %fa-regular-base" in a rule and put the desired icon "content: '\f054'" */
/******************************************************************************************************************************/
%fa-regular-base{
font-family: "Font Awesome 5 Free";
font-weight: 400;
-webkit-font-smoothing: antialiased;
display: inline-block;
font-style: normal;
font-variant: normal;
text-rendering: auto;
line-height: 1;
}
%fa-solid-base{
font-family: "Font Awesome 5 Free";
font-weight: 900;
-webkit-font-smoothing: antialiased;
display: inline-block;
font-style: normal;
font-variant: normal;
text-rendering: auto;
line-height: 1;
}
%fc-regular-base{
display: inline-block;
font-family: CombodoRegular;
font-style: normal;
font-variant: normal;
font-weight: normal;
text-rendering: auto;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

View File

@@ -0,0 +1,19 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
/***********************************************************************/
/* Sticky headers */
/* */
/* Used as a trigger to make an element stick to another during scroll */
/***********************************************************************/
/* SCSS variables */
$common-sticky-sentinel--left: 0 !default;
$common-sticky-sentinel--right: 0 !default;
$common-sticky-sentinel--height: 0 !default;
$common-sticky-sentinel-top--top: 0 !default;
$common-sticky-sentinel-top--height: $common-sticky-sentinel--height !default;
$common-sticky-sentinel-bottom--bottom: 0 !default;
$common-sticky-sentinel-bottom--height: $common-sticky-sentinel--height !default;

View File

@@ -0,0 +1,23 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
/* SCSS variables */
$common-has-description--content: "?" !default;
$common-has-description--padding-left: $common-spacing-200 !default;
$common-has-description--color: $common-color-grey-600 !default;
$common-has-description--font-size: 0.7em !default; /* Font size is em on purpose as we want it to be proportional to its context */
$common-is-code--background-color: $common-color-white-200 !default;
$common-is-code--padding: 1.25rem 1.5rem !default;
$common-hyperlink-color: $common-color-primary-700 !default;
$common-hyperlink-text-decoration: none !default;
$common-hyperlink-color--on-hover: $common-color-primary-800 !default;
$common-hyperlink-text-decoration--on-hover: $common-hyperlink-text-decoration !default;
$common-hyperlink-color--on-active: $common-color-primary-900 !default;
$common-hyperlink-text-decoration--on-active: $common-hyperlink-text-decoration !default;
$common-figure--spacing-x: 2em !default; /* Mind that this matches Bulma rule for figure */
$common-figure--spacing-y: 2em !default;

View File

@@ -0,0 +1,34 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
/****************************/
/* Disposition / alignement */
/****************************/
.common-is-fullwidth {
width: 100%;
}
%common-fully-centered-content {
display: flex;
justify-content: center;
align-items: center;
}
%common-vertically-centered-content {
display: flex;
align-items: center;
}
/* Typically to align icons and text as it is a good practice to align them on the baseline and not the "middle" */
%common-baseline-centered-content {
display: flex;
align-items: baseline;
}
/* Note: This might not be named correctly. The intention is to make an element occupy the full height of its parent and to be centered in it */
%common-full-height-content {
display: flex;
align-items: stretch;
}

View File

@@ -0,0 +1,745 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
/*
* SCSS helpers for font sizes (use in SCSS files)
*
* Use them to only redefine the font size instead of the global font defnition, this way if the container's font changes
* the other properties will be propagated (weight, style)
*
* Usage: @extend %common-font-size-XXX;
*/
%common-font-size-50 {
font-size: $common-font-size-50;
}
%common-font-size-100 {
font-size: $common-font-size-100;
}
%common-font-size-150 {
font-size: $common-font-size-150;
}
%common-font-size-200 {
font-size: $common-font-size-200;
}
%common-font-size-250 {
font-size: $common-font-size-250;
}
%common-font-size-300 {
font-size: $common-font-size-300;
}
%common-font-size-350 {
font-size: $common-font-size-350;
}
%common-font-size-400 {
font-size: $common-font-size-400;
}
%common-font-size-450 {
font-size: $common-font-size-450;
}
%common-font-size-500 {
font-size: $common-font-size-500;
}
%common-font-size-550 {
font-size: $common-font-size-550;
}
/*
* SCSS helpers for font weights (use in SCSS files)
*
* Use them to only redefine the font weight instead of the global font defnition, this way if the container's font changes
* the other properties will be propagated (size, style)
*
* Usage: @extend %common-font-weight-XXX;
*/
%common-font-weight-100 {
font-weight: $common-font-weight-100;
}
%common-font-weight-200 {
font-weight: $common-font-weight-200;
}
%common-font-weight-300 {
font-weight: $common-font-weight-300;
}
%common-font-weight-400 {
font-weight: $common-font-weight-400;
}
%common-font-weight-500 {
font-weight: $common-font-weight-500;
}
%common-font-weight-600 {
font-weight: $common-font-weight-600;
}
%common-font-weight-700 {
font-weight: $common-font-weight-700;
}
%common-font-weight-800 {
font-weight: $common-font-weight-800;
}
%common-font-weight-900 {
font-weight: $common-font-weight-900;
}
%common-font-weight-950 {
font-weight: $common-font-weight-950;
}
/*
* SCSS helpers for global font definition (use in SCSS files)
*
* Use this only when you want to completely redefine the font, otherwise use the other helpers above
*
* Usage: @extend %common-font-XXX-YYY;
*/
%common-font-ral-nor-50 {
font-size: $common-font-size-50;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-400;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-nor-100 {
font-size: $common-font-size-100;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-400;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-nor-150 {
font-size: $common-font-size-150;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-400;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-nor-200 {
font-size: $common-font-size-200;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-400;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-nor-250 {
font-size: $common-font-size-250;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-400;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-nor-300 {
font-size: $common-font-size-300;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-400;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-nor-350 {
font-size: $common-font-size-350;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-400;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-nor-400 {
font-size: $common-font-size-400;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-400;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-nor-450 {
font-size: $common-font-size-450;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-400;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-nor-500 {
font-size: $common-font-size-500;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-400;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-nor-550 {
font-size: $common-font-size-550;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-400;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-med-50 {
font-size: $common-font-size-50;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-500;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-med-100 {
font-size: $common-font-size-100;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-500;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-med-150 {
font-size: $common-font-size-150;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-500;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-med-200 {
font-size: $common-font-size-200;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-500;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-med-250 {
font-size: $common-font-size-250;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-500;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-med-300 {
font-size: $common-font-size-300;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-500;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-med-350 {
font-size: $common-font-size-350;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-500;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-med-400 {
font-size: $common-font-size-400;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-500;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-med-450 {
font-size: $common-font-size-450;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-500;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-med-500 {
font-size: $common-font-size-500;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-500;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-med-550 {
font-size: $common-font-size-550;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-500;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-bol-50 {
font-size: $common-font-size-50;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-700;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-bol-100 {
font-size: $common-font-size-100;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-700;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-bol-150 {
font-size: $common-font-size-150;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-700;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-bol-200 {
font-size: $common-font-size-200;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-700;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-bol-250 {
font-size: $common-font-size-250;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-700;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-bol-300 {
font-size: $common-font-size-300;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-700;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-bol-350 {
font-size: $common-font-size-350;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-700;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-bol-400 {
font-size: $common-font-size-400;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-700;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-bol-450 {
font-size: $common-font-size-450;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-700;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-bol-500 {
font-size: $common-font-size-500;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-700;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-bol-550 {
font-size: $common-font-size-550;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-700;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-sembol-50 {
font-size: $common-font-size-50;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-600;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-sembol-100 {
font-size: $common-font-size-100;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-600;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-sembol-150 {
font-size: $common-font-size-150;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-600;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-sembol-200 {
font-size: $common-font-size-200;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-600;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-sembol-250 {
font-size: $common-font-size-250;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-600;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-sembol-300 {
font-size: $common-font-size-300;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-600;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-sembol-350 {
font-size: $common-font-size-350;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-600;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-sembol-400 {
font-size: $common-font-size-400;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-600;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-sembol-450 {
font-size: $common-font-size-450;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-600;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-sembol-500 {
font-size: $common-font-size-500;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-600;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-sembol-550 {
font-size: $common-font-size-550;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-600;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-ita-50 {
font-size: $common-font-size-50;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-400;
font-style: italic;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-ita-100 {
font-size: $common-font-size-100;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-400;
font-style: italic;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-ita-150 {
font-size: $common-font-size-150;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-400;
font-style: italic;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-ita-200 {
font-size: $common-font-size-200;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-400;
font-style: italic;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-ita-250 {
font-size: $common-font-size-250;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-400;
font-style: italic;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-ita-300 {
font-size: $common-font-size-300;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-400;
font-style: italic;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-ita-350 {
font-size: $common-font-size-350;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-400;
font-style: italic;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-ita-400 {
font-size: $common-font-size-400;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-400;
font-style: italic;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-ita-450 {
font-size: $common-font-size-450;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-400;
font-style: italic;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-ita-500 {
font-size: $common-font-size-500;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-400;
font-style: italic;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-ral-ita-550 {
font-size: $common-font-size-550;
font-family: $common-font-family-base, $common-font-family-fallbacks;
font-weight: $common-font-weight-400;
font-style: italic;
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
}
%common-font-code-50 {
font-size: $common-font-size-50;
font-family: $common-font-family-code;
font-weight: $common-font-weight-400;
}
%common-font-code-100 {
font-size: $common-font-size-100;
font-family: $common-font-family-code;
font-weight: $common-font-weight-400;
}
%common-font-code-150 {
font-size: $common-font-size-150;
font-family: $common-font-family-code;
font-weight: $common-font-weight-400;
}
%common-font-code-200 {
font-size: $common-font-size-200;
font-family: $common-font-family-code;
font-weight: $common-font-weight-400;
}
%common-font-code-250 {
font-size: $common-font-size-250;
font-family: $common-font-family-code;
font-weight: $common-font-weight-400;
}
%common-font-code-300 {
font-size: $common-font-size-300;
font-family: $common-font-family-code;
font-weight: $common-font-weight-400;
}
%common-font-code-350 {
font-size: $common-font-size-350;
font-family: $common-font-family-code;
font-weight: $common-font-weight-400;
}
%common-font-code-400 {
font-size: $common-font-size-400;
font-family: $common-font-family-code;
font-weight: $common-font-weight-400;
}
%common-font-code-450 {
font-size: $common-font-size-450;
font-family: $common-font-family-code;
font-weight: $common-font-weight-400;
}
%common-font-code-500 {
font-size: $common-font-size-500;
font-family: $common-font-family-code;
font-weight: $common-font-weight-400;
}
%common-font-code-550 {
font-size: $common-font-size-550;
font-family: $common-font-family-code;
font-weight: $common-font-weight-400;
}
/*
* CSS classes for font sizes (use in HTML markup, JS scripts)
*
* Use them to only redefine the font size instead of the global font defnition, this way if the container's font changes
* the other properties will be propagated (weight, style)
*
* Usage: .common-font-size-XXX;
*/
$common-font-sizes: (
'common-font-size-50',
'common-font-size-100',
'common-font-size-150',
'common-font-size-200',
'common-font-size-250',
'common-font-size-300',
'common-font-size-350',
'common-font-size-400',
'common-font-size-450',
'common-font-size-500',
'common-font-size-550'
);
@each $sFontSize in $common-font-sizes {
.#{$sFontSize} {
@extend %#{$sFontSize};
}
}
/*
* CSS classes for font weights (use in HTML markup, JS scripts)
*
* Use them to only redefine the font weight instead of the global font defnition, this way if the container's font changes
* the other properties will be propagated (size, style)
*
* Usage: .common-font-weight-XXX;
*/
$common-font-weights: (
'common-font-weight-100',
'common-font-weight-200',
'common-font-weight-300',
'common-font-weight-400',
'common-font-weight-500',
'common-font-weight-600',
'common-font-weight-700',
'common-font-weight-800',
'common-font-weight-900',
'common-font-weight-950'
);
@each $sFontWeight in $common-font-weights {
.#{$sFontWeight} {
@extend %#{$sFontWeight};
}
}
/*
* CSS classes for global font wrappers (use in HTML markup, JS scripts)
*
* Use this only when you want to completely redefine the font, otherwise use the other helpers
*
* Usage: .common-font-XXX-YYY;
*/
$common-fonts-all: (
'common-font-ral-nor-50',
'common-font-ral-nor-100',
'common-font-ral-nor-150',
'common-font-ral-nor-200',
'common-font-ral-nor-250',
'common-font-ral-nor-300',
'common-font-ral-nor-350',
'common-font-ral-nor-400',
'common-font-ral-nor-450',
'common-font-ral-nor-500',
'common-font-ral-nor-550',
'common-font-ral-med-50',
'common-font-ral-med-100',
'common-font-ral-med-150',
'common-font-ral-med-200',
'common-font-ral-med-250',
'common-font-ral-med-300',
'common-font-ral-med-350',
'common-font-ral-med-400',
'common-font-ral-med-450',
'common-font-ral-med-500',
'common-font-ral-med-550',
'common-font-ral-bol-50',
'common-font-ral-bol-100',
'common-font-ral-bol-150',
'common-font-ral-bol-200',
'common-font-ral-bol-250',
'common-font-ral-bol-300',
'common-font-ral-bol-350',
'common-font-ral-bol-400',
'common-font-ral-bol-450',
'common-font-ral-bol-500',
'common-font-ral-bol-550',
'common-font-ral-sembol-50',
'common-font-ral-sembol-100',
'common-font-ral-sembol-150',
'common-font-ral-sembol-200',
'common-font-ral-sembol-250',
'common-font-ral-sembol-300',
'common-font-ral-sembol-350',
'common-font-ral-sembol-400',
'common-font-ral-sembol-450',
'common-font-ral-sembol-500',
'common-font-ral-sembol-550',
'common-font-ral-ita-50',
'common-font-ral-ita-100',
'common-font-ral-ita-150',
'common-font-ral-ita-200',
'common-font-ral-ita-250',
'common-font-ral-ita-300',
'common-font-ral-ita-350',
'common-font-ral-ita-400',
'common-font-ral-ita-450',
'common-font-ral-ita-500',
'common-font-ral-ita-550',
'common-font-code-50',
'common-font-code-100',
'common-font-code-150',
'common-font-code-200',
'common-font-code-250',
'common-font-code-300',
'common-font-code-350',
'common-font-code-400',
'common-font-code-450',
'common-font-code-500',
'common-font-code-550'
);
@each $sFont in $common-fonts-all {
.#{$sFont} {
@extend %#{$sFont};
}
}

View File

@@ -0,0 +1,7 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
@import "highlight";
@import "selectable";

View File

@@ -0,0 +1,17 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
$common-vertical-highlight--width: $common-size-100;
$common-vertical-highlight--height: 100%;
@mixin common-vertical-highlight {
display: block;
position: absolute;
top: 0;
left: 0;
content: "";
width: $common-vertical-highlight--width;
height: $common-vertical-highlight--height;
}

View File

@@ -0,0 +1,40 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
$common-selectable--background-color: transparent !default;
$common-selectable--hover--color: $common-color-grey-100 !default;
$common-selectable--hover--background-color: $common-color-grey-600 !default;
$common-selectable--hover--background-opacity: 0.6 !default;
$common-selected--color: $common-color-grey-100 !default;
$common-selected--background-color: $common-color-grey-900 !default;
$common-selected--background-opacity: 0.5 !default;
$common-selected--hover--background-color: $common-color-grey-700 !default;
$common-selected--hover--background-opacity: 0.5 !default;
@mixin common-selectable {
content: ' ';
@extend %fa-solid-base;
background-color: $common-selectable--background-color;
cursor: pointer;
}
@mixin common-selectable-hover {
@extend %fa-regular-base;
content: '\f058';
color: $common-selectable--hover--color;
background-color: transparentize($common-selectable--hover--background-color, $common-selectable--hover--background-opacity);
}
@mixin common-selected {
@extend %fa-solid-base;
content: '\f058';
color: $common-selected--color;
background-color: transparentize($common-selected--background-color, $common-selected--background-opacity);
}
@mixin common-selected-hover {
background-color: transparentize($common-selected--hover--background-color, $common-selected--hover--background-opacity);
}

Some files were not shown because too many files have changed in this diff Show More