Compare commits

...

2066 Commits

Author SHA1 Message Date
Pierre Goiffon
aa9ab1ace5 Merge remote-tracking branch 'origin/support/2.7' into develop
# Conflicts:
#	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-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
2021-06-29 16:12:49 +02:00
acognet
bfe22b4ec0 3836 - Dashlet: Finish visual rework 2021-06-29 16:08:02 +02:00
Molkobain
f84bc9fbbc N°4063 - Fix dashboard attribute's actions menu's dropdown being hidden behind dashlets 2021-06-29 14:37:53 +02:00
Pierre Goiffon
0dc03de7b2 Log channels : switch 3.0.0 channels to constant also
Those channels constants were introduced in support/2.7 with 8259a79c
2021-06-29 11:59:34 +02:00
Molkobain
0cffd567c2 N°4110 - Fix JS error message when no provider for the newsroom 2021-06-29 10:04:40 +02:00
acognet
9d006c279b N°3905 - Polishing: CSV Import - manage friendlyname 2021-06-29 10:01:19 +02:00
Molkobain
f410bff309 Object details: Fix columns overlapping (regression from 11f6c88ac) 2021-06-28 23:04:07 +02:00
Molkobain
0e9ff71c0a SCSS: Fix rules from 108bc2fa
- Don't nest selectors when there is no need to
- Use SCSS variables instead of CSS3 variables in SCSS files, otherwise we can't use SCSS functions. CSS3 variables should be kept for the front-end manipulations
2021-06-28 22:07:34 +02:00
Molkobain
a599a5c5b7 Add PHPDoc 2021-06-28 17:35:54 +02:00
Molkobain
84dae0fb37 Object details: Fix icon / color lost since 27e68404 2021-06-28 17:35:54 +02:00
Pierre Goiffon
65e3ef32ed N°3575 Change curl extension check error message
Thanks @Hipska !
2021-06-28 17:04:48 +02:00
Eric
0396914068 N°3513 - Write object creation history within the same DB transaction for better consistency 2021-06-28 16:59:05 +02:00
Eric
0e55a30e5a Fix DB transaction tests 2021-06-28 16:54:44 +02:00
Eric
c0fbf0c735 Fix DBObject::EvaluateExpression() tests 2021-06-28 16:21:46 +02:00
Molkobain
e59d472cec N°4108 - Portal: Fix linkedset items not correctly saved on add/remove (follow-up of N°3914) 2021-06-28 16:10:01 +02:00
acognet
27e6840442 N°4068 - Polishing: Object Creation 2021-06-28 15:35:37 +02:00
Molkobain
fbb54c6d6d Add PHPDoc 2021-06-28 14:13:53 +02:00
acognet
95066fbc49 N°4085 - Polishing : bulk modify - remove console.warn 2021-06-28 14:02:18 +02:00
Molkobain
e2958bd43f Add missing quotes in JS selector 2021-06-28 14:01:38 +02:00
Eric
382135fde8 N°4106 - Deprecate usage of DBObject::GetName() 2021-06-28 14:00:44 +02:00
Eric
4d80235d89 🎨 add phpDoc 2021-06-28 13:58:12 +02:00
Molkobain
250d95c3eb N°4106 - Remove overloads of DBObject::GetName() 2021-06-28 13:19:41 +02:00
Molkobain
0997189969 N°4106 - Deprecate usage of DBObject::GetName() 2021-06-28 12:06:25 +02:00
Molkobain
410948fb4e Rename method to better match its usage 2021-06-28 10:36:43 +02:00
Molkobain
9f75fae33f Navigation menu: Restore user menu entries API 2021-06-28 10:36:42 +02:00
Pierre Goiffon
b1aebc6c7a DBObject : fix lines altered wrongly in merge commit 2021-06-28 09:12:18 +02:00
Pierre Goiffon
85526b1983 N°3575 Add curl as optional PHP ext 2021-06-28 09:04:50 +02:00
Pierre Goiffon
2a1e0b7429 Merge remote-tracking branch 'origin/support/2.7' into develop
# Conflicts:
#	core/dbobject.class.php
#	core/log.class.inc.php
#	setup/compiler.class.inc.php
2021-06-28 08:58:34 +02:00
jbostoen
3a73bd3b24 Version 2021-06-18 12:10:49
* support decimals in aggregate functions in dashlets
2021-06-25 17:43:37 +02:00
Eric
d7ba0aac82 N°4099 - remove unused DBObject::GetLoadedAttributes() method 2021-06-25 17:17:36 +02:00
Eric
de71d490c1 N°4099 - Fix object lists being very slow for classes with a overloaded GetName() function 2021-06-25 17:13:14 +02:00
acognet
60b015919d N°3912 - Polishing: Export - error message + ccs for pdf 2021-06-25 10:25:24 +02:00
acognet
2ca11aa2b7 N°3903 - Polishing: Query phrasebook 2021-06-25 10:15:40 +02:00
acognet
275daf3b0d N°4085 - Polishing : bulk modify 2021-06-25 10:11:57 +02:00
Eric
671d112452 Add Echoing for all pages KPI 2021-06-24 15:12:13 +02:00
Eric
2a9ce75db0 fix precompiled css 2021-06-23 12:22:11 +02:00
Pierre Goiffon
f8fcfc4d7d N°4083 - Polishing: Modal 2021-06-23 10:42:45 +02:00
Pierre Goiffon
663a9ab224 Fix code injection heredoc 2021-06-23 10:01:29 +02:00
acognet
f604821bdf N°4083 - Polishing: Modal 2021-06-23 09:38:22 +02:00
acognet
ac83c0334c N°3906 - Polishing: Users and profiles -> change size of datatable 2021-06-22 18:09:42 +02:00
acognet
457165b2fc N°4085 - Polishing : bulk modify 2021-06-22 17:34:14 +02:00
acognet
bce1bd8192 N°3912 - Polishing: Export 2021-06-22 12:24:32 +02:00
odain
4d123e1450 fix ci 2021-06-22 10:00:18 +02:00
acognet
1281d475e4 N°3912 - Polishing: Export : fix date entry + size of datatable 2021-06-21 16:50:19 +02:00
acognet
32ac999ff5 N°3912 - Polishing: Export - display of tabular fields 2021-06-21 16:47:02 +02:00
Pierre Goiffon
5db8bd06ba Merge remote-tracking branch 'origin/support/2.7' into develop
# Conflicts:
#	core/cmdbsource.class.inc.php
#	core/coreexception.class.inc.php
#	core/log.class.inc.php
2021-06-21 16:24:27 +02:00
acognet
d1e594e225 Fix precompiled themes 2021-06-21 11:59:08 +02:00
acognet
bcc2d7140e N°3905 - Polishing: CSV Import 2021-06-21 09:41:36 +02:00
acognet
ee5847ec82 N°3912 - Polishing: Export - export of impact analysis 2021-06-21 09:22:07 +02:00
Eric
108bc2fa1d N°3573 - Migrate backoffice pages to new UIBlock system : System Information 2021-06-18 17:16:22 +02:00
acognet
efb7f84ec4 Fix precompiled themes 2021-06-18 17:12:31 +02:00
acognet
224031e0d6 N°3905 - Polishing: CSV Import 2021-06-18 17:00:39 +02:00
Stephen Abello
e905838733 Revert layout changes from 11f6c88 as they break dashlet table 2021-06-18 13:54:54 +02:00
Stephen Abello
bc4f384948 N°4082 Add missing German translation (many thanks to ITOMIG!) 2021-06-18 10:02:09 +02:00
acognet
11f6c88ac7 N°3905 - Polishing: CSV Import 2021-06-17 11:16:31 +02:00
acognet
77cf879f4f N°3912 - Polishing: Export 2021-06-17 10:43:06 +02:00
acognet
13f6f6ebe6 N°3551 - Migrate module to new UIBlock system : Customer Survey 2021-06-17 09:42:28 +02:00
odain
c413ac989e fix ci: add anotations to be able to exclude tests 2021-06-16 18:25:10 +02:00
Stephen Abello
7a770b32ee N°4082 Update German translations (many thanks to ITOMIG!) 2021-06-16 14:44:51 +02:00
vdumas
9d8adae5c7 N°4079 fix FR dictionary typo 2021-06-15 18:10:54 +02:00
Stephen Abello
b0531597f0 Update precompiled themes 2021-06-15 15:22:28 +02:00
Stephen Abello
0bdf43b085 Fix "Enter iTop" button 2021-06-15 15:21:51 +02:00
Stephen Abello
27da8470b7 Harmonize setup look with backoffice one and force navigation buttons to remain at the same position at every setup step 🙉🙉🙉 2021-06-15 15:03:50 +02:00
Stephen Abello
c0be48ceee Remove deprecated import 2021-06-15 14:00:51 +02:00
Stephen Abello
6c561029e9 N°4074 Show date picker above object and display today's date / selected date 2021-06-15 10:38:29 +02:00
Pierre Goiffon
c417a454d6 New symlink flag set by the compiler, new compile with symlinks checkbox in the setup (#190)
The flag consists of the new `data/.compilation-symlinks` file, which is included in the code base (but not available in the Combodo packages).

It will be used and generated if and only if : 
* we are on a dev env (`\utils::IsDevelopmentEnvironment`)
* the `symlink` PHP function exists

The flag is generated low level in the compiler (\MFCompiler::DoCompile)

In the setup, if the flag is present and all conditions are met then a new option will be displayed in the "Miscellaneous Parameters" wizard step. When unchecking/checking the flag will be updated accordingly by an ajax query.

All other compiler consumers (Designer / Hub connectors, Core Update, scripts using `RunTimeEnvironment` class) will : 
* if they provide a value for the symlink option, it will be used
* otherwise the flag will be used instead, if conditions are met
2021-06-14 16:44:34 +02:00
Pierre Goiffon
d8e2a1cc7c Merge branch 'support/2.7' into develop
# Conflicts:
#	README.md
#	composer.json
#	composer.lock
#	core/cmdbsource.class.inc.php
#	core/dbobject.class.php
#	datamodels/2.x/combodo-db-tools/db_analyzer.class.inc.php
#	datamodels/2.x/combodo-db-tools/dbtools.php
#	datamodels/2.x/combodo-db-tools/dictionaries/zh_cn.dict.combodo-db-tools.php
#	datamodels/2.x/itop-attachments/dictionaries/zh_cn.dict.itop-attachments.php
#	datamodels/2.x/itop-core-update/dictionaries/zh_cn.dict.itop-core-update.php
#	dictionaries/zh_cn.dictionary.itop.core.php
#	dictionaries/zh_cn.dictionary.itop.ui.php
#	lib/composer/InstalledVersions.php
#	lib/composer/autoload_classmap.php
#	lib/composer/autoload_static.php
#	lib/composer/installed.php
#	lib/composer/platform_check.php
#	pages/ajax.render.php
#	pages/csvimport.php
#	setup/ajax.dataloader.php
#	setup/index.php
#	setup/setuputils.class.inc.php
#	test/application/UtilsTest.php
2021-06-14 16:19:56 +02:00
Stephen Abello
51e24a4e35 Replace htmlentitites() call with escapehtml() 2021-06-14 12:15:09 +02:00
Stephen Abello
a82f172ca4 Fix wrong id being used for datatables twig variable name 2021-06-14 12:01:29 +02:00
Stephen Abello
8ef43452f8 Fix multiple typo in datatables twig variables 2021-06-14 12:01:29 +02:00
Molkobain
18a4867b4d Accessibility: Add missing aria-label / tooltip attributes on the advanced search 2021-06-13 09:43:22 +02:00
Molkobain
ff05a1d35e Accessibility: Add missing alt attribute on decorative images
- Dashlet badge
- Dashlet header static
2021-06-12 22:52:48 +02:00
Molkobain
5a4c9393a4 Add missing viewport meta from webpage template
(Backoffice won't be responsive in iTop 3.0)
2021-06-12 19:26:25 +02:00
Molkobain
4b03b42494 Remove inline CSS from NavigationMenu 2021-06-12 19:13:41 +02:00
Molkobain
215dcfb465 Dictionaries: Group files by block for an easier navigation through them 2021-06-12 18:47:32 +02:00
Molkobain
b965138d57 Accessibility: Add missing aria-label to some UIBlock
- Button
- Global search
- Quick create
- Navigation menu
- Tab container
2021-06-12 18:35:55 +02:00
Molkobain
485262ec0a Accessibility: Add missing alt attribute on decorative images
- Quick create
- Global search
- Breadcrumbs
2021-06-12 18:35:54 +02:00
Stephen Abello
dd8a51ea1b N°3910 Correctly escape object tags (such as "synchronized") tooltip content 2021-06-11 13:54:43 +02:00
acognet
d85729803d N°3907 - Polishing: Run query 2021-06-11 11:42:11 +02:00
acognet
3132d665e0 forgot an addSubBlock 2021-06-11 11:42:11 +02:00
Stephen Abello
be03f3c6de N°4048 Fix default sorting on lists when using custom list settings without sort order 2021-06-11 10:48:06 +02:00
Stephen Abello
bcfdf76b71 N°4051 Make sure js dependencies are met before resuming ajax calls js code 2021-06-10 15:12:16 +02:00
Stephen Abello
679542eaaa N°4051 Add robustness 2021-06-10 15:12:16 +02:00
Stephen Abello
4d5ff22b60 Fix variable declaration in datatables 2021-06-10 15:12:16 +02:00
Eric
d54c5b5f55 🐛 fix parameters for OptimizeColumnLoad() 2021-06-09 14:43:38 +02:00
acognet
5bf6035bcf N°3592 - Migrate module to new UIBlock system : Customized request forms - fix input select 2021-06-08 18:40:49 +02:00
dependabot[bot]
73132f981e Bump pear/archive_tar from 1.4.10 to 1.4.12 (#219) 2021-06-08 16:06:48 +00:00
Stephen Abello
80e4a46a20 Fix Selectize being re-instantiated (and destroying extkey selectize plugin instance) when creating an inline object containi tagsets 2021-06-08 16:09:37 +02:00
Molkobain
95d9b845b6 SCSS: Enlarge pills max width 2021-06-04 17:16:05 +02:00
Eric
609d9c7a60 ♻️ rework of Select UIBlock with labels 2021-06-04 11:52:24 +02:00
Stephen Abello
3d338aff33 Fix block loader style for datatables 2021-06-04 11:44:28 +02:00
Stephen Abello
8a46900df9 Fix collapsible section widget being called before dependency was loaded 2021-06-04 11:17:57 +02:00
Molkobain
8efbfd13d0 Update precompiled themes 2021-06-04 11:10:46 +02:00
Molkobain
19264a7d64 Fix iTopWebPage::DisableBreadCrumb() not working since 3.0 rework 2021-06-04 11:01:51 +02:00
Molkobain
742e3a2a20 SCSS: Replace font global redefinition with more accurate overloads (only size, only weight, ...) to simplify styles inheritance 2021-06-04 11:01:50 +02:00
Molkobain
117bf3046d Attribute file: Fix delete button not on the same line as the filename 2021-06-04 11:01:50 +02:00
Molkobain
b072e1bb3d SCSS: Add font size variables / helpers 2021-06-04 11:01:50 +02:00
Molkobain
d405fc0675 SCSS: Fix base font 2021-06-04 11:01:50 +02:00
Molkobain
77527987ee SCSS: Add font weight variables / helpers 2021-06-04 11:01:49 +02:00
Stephen Abello
2e6b773ba4 Fix non existing variable usage 2021-06-04 10:57:06 +02:00
Stephen Abello
dd6a9fe16a Restyle block loader 2021-06-04 10:52:24 +02:00
Stephen Abello
d9ccc620c9 Remove trailing quote 2021-06-04 10:50:51 +02:00
Stephen Abello
b245275c7d N°3914 Fix configure this list button alignment and add background color to selected fields 2021-06-04 10:28:12 +02:00
Stephen Abello
bf22c8b67a N°3914 Fix highlighted rows highlighting following rows too 2021-06-04 10:28:11 +02:00
Stephen Abello
1b58d9b801 N°3914 Fix add criteria buttons style 2021-06-04 10:28:11 +02:00
Molkobain
74eabafe31 N°4022 - Fix scroll not working on search menu nodes 2021-06-03 16:19:06 +02:00
Molkobain
1b9eb2a6ad N°4022 - Rework search page to improve UX and usable height 2021-06-03 09:54:21 +02:00
Molkobain
94c37b2e14 Update CONTRIBUTING.md with thanks stickers (#213)
* Update CONTRIBUTING.md with thanks stickers

* Update CONTRIBUTING.md

Co-authored-by: Pierre Goiffon <pierre.goiffon@combodo.com>

Co-authored-by: Pierre Goiffon <pierre.goiffon@combodo.com>
2021-06-03 09:53:01 +02:00
Pierre Goiffon
71d2d61c4e 💡 Fix phpdoc for \MenuBlock::GetEnumAllowedActions 2021-06-03 09:04:26 +02:00
Stephen Abello
020dc8b819 N°4049 Remove dashlet list free will 👾 2021-06-02 16:59:14 +02:00
Stephen Abello
c11ad30134 N°4048 Correctly set default sorting on lists 2021-06-02 15:22:03 +02:00
Molkobain
dd614f5931 Fix regression introduced by c6b8526d: FormTable not working in edition 2021-06-02 10:22:24 +02:00
Stephen Abello
499d429a0e N°3927 Fix Attachments delete button 2021-06-02 10:01:37 +02:00
Pierre Goiffon
a395c1760a N°4047 skip test generating a PHP notice
Will be fixed later
2021-06-01 16:51:44 +02:00
Stephen Abello
4033773849 N°3932 Fix button style for hierarchical key selector 2021-06-01 15:43:42 +02:00
Stephen Abello
9fd6ba414d N°3914 Fix search from external key widget 2021-06-01 10:20:57 +02:00
Molkobain
2aee978790 Update precompiled themes 2021-06-01 09:11:30 +02:00
Molkobain
39efe1237e Fix regression in AJAX calls introduced by c6b8526d 2021-06-01 09:04:20 +02:00
Molkobain
e7c7ca76ac Switch page class to non deprecated 2021-05-31 17:41:06 +02:00
Molkobain
a6e5969201 N°4021 - Fix header jumping out of sticky positioning when getting near some tabs
Reason: DataTables' dynamic height cannot work we a static "duration" (height) based on the initial panel's height
2021-05-31 13:15:10 +02:00
Molkobain
1e99ad436f N°4021 - Add support for tab container for the sticky header 2021-05-31 09:32:37 +02:00
Molkobain
8580eb6d2b PHPDoc 2021-05-28 22:45:37 +02:00
Molkobain
c6b8526dc0 UIBlock: Add external JS/CSS files (optional) inheritance
This way we ensure that a block always have the external resources from its ancestors as this will be necessary most of the time. From now on, the JS widget of the blocks will inherit from a common ancestor to factorize some mechanisms that are duplicates at many levels.
This can be disabled in a particular block by overloading the INCLUDE_ANCESTORS_DEFAULT_XXX_FILES constants in which case, only the external files of the block itself will be included.
2021-05-28 22:45:37 +02:00
Molkobain
03c7d63588 JsonPage: Add option to output only the data, typically when feeding a third party lib that doesn't understand our structuration 2021-05-28 22:45:37 +02:00
Molkobain
32e714f4a6 Panel: Fix scrollable tabs with sticky header 2021-05-28 22:45:36 +02:00
Molkobain
b8ef4885e5 N°4021 - Change approach for sticky header, use the ScrollMagic lib as in the scrolling tabs to use the same abstraction level everywhere 2021-05-28 22:45:36 +02:00
Molkobain
e669cfcea1 SCSS: Add 2 helpers classes to make elements transparent or opaque 2021-05-28 22:45:36 +02:00
Molkobain
82f0cd5f3d SCSS: Improve container space occupation 2021-05-28 22:45:36 +02:00
Molkobain
b6661fde86 SCSS: Improve panel space occupation by removing unnecessary margins 2021-05-28 22:45:36 +02:00
Eric
e46480032e PHP doc 2021-05-28 18:04:11 +02:00
Thomas Casteleyn
aed1e7dfdc 🌐 Update Dutch dictionaries for 3.0 (#199)
* Update UI components

* Global cleanup

* Update UI layouts

* Update UI pages

* Update core dictionaries

* Minor change

* Fix newline

* Conform with English text

* Applied changes suggested by @jbostoen

* Changed to capital as in original English value
2021-05-28 17:17:08 +02:00
Stephen Abello
b32fd7e018 N°3914 Fix tagset taking too much space in lists 2021-05-28 11:15:50 +02:00
Stephen Abello
3ae8575c1d N°3914 Fix portal tables getting backoffice markup for enum attributes 2021-05-28 11:00:40 +02:00
Stephen Abello
cc4b307bc9 N°3914 Fix class friendlyname in lists using class aliases 2021-05-28 10:48:57 +02:00
Stephen Abello
6d004f83dd N°3914 Correctly remove entries from linksets' datatable 2021-05-28 10:21:41 +02:00
Stephen Abello
8f68ca3f67 N°3914 Display label on "Add criterion" button when there's no criterion. Add tooltips to "Add criterion" and "Refresh" button 2021-05-27 17:12:14 +02:00
Eric
96126d235f N°2214 Add PHP check in CLI scripts (fix some checks and title) 2021-05-27 16:31:15 +02:00
Stephen Abello
4de40e289f N°3914 Add row highlight colors to Datatables block when an object has a triggered tto/ttr 2021-05-27 16:14:29 +02:00
Stephen Abello
9ccd26a541 N°3914 Harmonize linkset display 2021-05-27 12:15:58 +02:00
Stephen Abello
6d57945bd1 N°3914 Hide lists pagination when there's only 1 page 2021-05-27 11:20:48 +02:00
Stephen Abello
0cb0f52b12 N°3914 Fix lists header and data being misaligned when resizing them 2021-05-27 09:59:31 +02:00
Molkobain
8f9a69fa60 SCSS: Fix field badge display being in 2 lines 2021-05-26 22:00:55 +02:00
Molkobain
1d94e12da8 Update precompiled themes 2021-05-26 16:57:31 +02:00
Molkobain
0a04fe5917 SCSS: Add fallback fonts to minimize visual glitch while Raleway is not loaded 2021-05-26 16:55:10 +02:00
Molkobain
b03389068e SCSS: Fix large field not taking whole width 2021-05-26 16:55:10 +02:00
Stephen Abello
c9171ef30e N°3923 Cleanup css files 2021-05-26 15:55:57 +02:00
Stephen Abello
3853d38d69 N°3923 Fix up, down, enter key usage in ext key widget 2021-05-26 15:43:32 +02:00
Stephen Abello
022887258f N°3923 Hide caret in autocomplete ext key input 2021-05-26 14:11:13 +02:00
Stephen Abello
3105a7ef77 N°3923 Vertical align ext key action buttons 2021-05-26 11:20:43 +02:00
Molkobain
f5ee19370c Update precompiled themes 2021-05-26 10:43:49 +02:00
Molkobain
923134d67d Code cleanup
- "v-resizable" class is not used anymore in the UI
- Logoff menu is now handled in a dedicated block
- Caselog headers are now handled in a dedicated block
2021-05-26 10:37:03 +02:00
Molkobain
3c2c2d7a51 Code cleanup: Remove unused methods from early implementation 2021-05-26 10:37:02 +02:00
Molkobain
3ee4a14c56 N°4021 - Introduce sticky header for panels and object details (tab container to be done) 2021-05-26 10:37:02 +02:00
Molkobain
dd284a6c1d SCSS: Fix base content layout not behaving the same way as the one with side content 2021-05-26 10:37:02 +02:00
Molkobain
c240a8991d SCSS: Fix import ordering of the custom root folders 2021-05-26 10:37:02 +02:00
Molkobain
0948c46dc7 SCSS: Add more variables for jQuery UI 2021-05-26 10:37:02 +02:00
Molkobain
d9755fe59d Code format 2021-05-26 10:37:02 +02:00
Stephen Abello
7f82e9262b N°3923 Fix date picker widget not initialized in ajax forms 2021-05-26 10:21:30 +02:00
Stephen Abello
14930fbab2 N°3914 Fix configure this list "sort fields" feature 2021-05-25 15:38:52 +02:00
Stephen Abello
2cbca93d77 N°3914 Fix modal backdrop on lists' "configure this list" modal 2021-05-25 14:54:54 +02:00
Molkobain
104cf9479c List: Remove vertical scrolling for all lists except dashlets 2021-05-21 17:06:12 +02:00
Molkobain
a36632def6 Fix modal title displaying behind closing "X" on long titles 2021-05-21 17:06:12 +02:00
Molkobain
6a1b1d7740 Code format 2021-05-21 17:06:11 +02:00
Molkobain
f544d53c36 List: Fix height / scroll for linkedsets add items modal 2021-05-21 17:06:10 +02:00
Pierre Goiffon
3188204d05 📝 CONTRIBUTING : add "allow edits from maintainers" PR option 2021-05-21 11:28:48 +02:00
Molkobain
a7294d48a6 Update precompiled themes 2021-05-20 19:08:46 +02:00
Molkobain
42be0c20cb Field: Rework on the SCSS file
- Fix button being too large on AttributeImage
- Reorganize the classes a bit
2021-05-20 18:18:29 +02:00
Molkobain
1c6ffab0e3 Remove index variable from foreach as it was misleading ($sClass does not contain classes but a numeric index) 2021-05-20 18:18:29 +02:00
Molkobain
095d61b6f9 N°3171 - Rollback on the AttributeExternalKey::GetPrerequisites() as it was introducing more regressions than fixes (acf0548c) 2021-05-20 18:18:29 +02:00
Stephen Abello
78b2824c13 N°3914 Harmonize advanced search's external key search buttons style and positions on modals and fix add button id 2021-05-20 15:38:31 +02:00
Stephen Abello
62f5eb5ae9 N°3914 Harmonize external key / linksets buttons style and positions on modals 2021-05-20 15:06:39 +02:00
Stephen Abello
7d9416cc81 Fix indirect links block height 2021-05-20 15:02:51 +02:00
Molkobain
a82a2df6aa N°1964 - Add informative message on dashboard when its container (eg. an object) is currently in edition 2021-05-20 10:32:28 +02:00
Molkobain
f1e4120364 Fix text decoration icon size being too big 2021-05-20 10:32:28 +02:00
Pierre Goiffon
3471d9d693 Protect \iApplicationUIExtension::EnumAllowedActions uses (#214)
Some impl just return null while we expect to have an array... This is causing PHP notices in lots of iTop instances with modules implementing this method incorrectly !

This modification get rid of the notice and : 
* add a log (warning level) indicating the impl classes
* if dev env, then throw an exception after browsing all impl (so you get a complete invalid impl list)

Note : since iTop 2.7.0 you should use \AbstractApplicationUIExtension instead of implementing the whole interface !
2021-05-19 14:58:55 +02:00
Molkobain
6d7bcb8a7c N°3956 - Fix AJAX error when creating an object which has a linkedset with a friendlyname composed of its own external keys' friendlynames 🤪 2021-05-18 17:58:37 +02:00
acognet
e9648ad75e N°3766 - Migrate module to new UIBlock system : Gantt view - fix error message when the class doesn't exist 2021-05-18 13:46:07 +02:00
Molkobain
e53da47647 UIBlock: Add MakeRaw to the HTML factory 2021-05-18 10:46:27 +02:00
Molkobain
1128490d47 N°2982 - Branding: Theme imports with no xsi:type are ignored 2021-05-17 17:51:08 +02:00
Molkobain
186ef1689e CI: Fix folder creation on Windows environments 2021-05-17 17:44:01 +02:00
Molkobain
0487cb8701 N°3914 - Fix single row selection in the portal's datatables 2021-05-17 13:49:17 +02:00
Molkobain
27b930c31c N°3914 - Fix rows selection in the portal's datatables 2021-05-17 13:47:41 +02:00
Molkobain
a8ef1c7899 N°3796 - Make designer compatible with iTop 3.0 2021-05-17 08:55:21 +02:00
Molkobain
644f0bc94c N°1964 - Fix missing parenthesis in previous commit 2021-05-14 11:31:35 +02:00
Eric
f3b0f79a59 N°3796 - Make designer compatible with iTop 3.0 2021-05-12 15:42:57 +02:00
Molkobain
eaae79a5f0 N°1964 - Fix focus moving to another tab on modification when one tab is readonly 2021-05-12 10:34:00 +02:00
Pierre Goiffon
bc10baed3e :bulb PHPDoc 2021-05-12 09:06:48 +02:00
Molkobain
c0ec7e02f8 N°3939 - Keep focus on current tab on object modification 2021-05-11 16:34:54 +02:00
Stephen Abello
5977c5dd9e N°4007 - When a search is on auto submit, auto submit it also on first display 2021-05-11 14:16:40 +02:00
Molkobain
1c2dcc7b9a Merge remote-tracking branch 'origin/support/2.7' into develop 2021-05-11 12:22:47 +02:00
Molkobain
cb61d85572 N°3990 - Forgot to update descending migration method so it applies _delta flag where its needed 2021-05-11 09:28:04 +02:00
Molkobain
626316e8d1 N°3990 - Compiler: Set "_delta" flag on moved node if no ancestors has one 2021-05-10 19:05:08 +02:00
Molkobain
ab30bae46a Tests: Rename test and move samples to dedicated directory 2021-05-10 19:05:07 +02:00
Molkobain
bd2c0d1121 Tests: Simplify XML sample 2021-05-10 19:05:07 +02:00
Molkobain
64764228a9 DownloadPage: Fix ->add() method replacing all existing content instead of appending 2021-05-10 10:32:50 +02:00
Molkobain
463593d6cf PHPDoc 2021-05-10 10:28:51 +02:00
Molkobain
85aac7bf52 N°3949 - Fix XSS vulnerability on file attribute 2021-05-10 10:23:56 +02:00
Molkobain
dc36b4648d Add spaces to avoid errors on concatenation when used with spaceless filter 2021-05-06 12:34:46 +02:00
Molkobain
25145a68af Fix disabled property on textarea input 2021-05-06 12:33:46 +02:00
Molkobain
dab522caca SCSS: WIP attempt to apply some of the UIBlocks style to bare HTML markup 2021-05-05 18:38:12 +02:00
Molkobain
88634bcd92 SCSS: Refactor .is-code by moving it to helper file and renaming it 2021-05-05 18:29:33 +02:00
Molkobain
6ab6930986 SCSS: Refactor code typography
- New variables to defines base / code font families
- New helpers for code typography in all sizes
2021-05-05 18:25:37 +02:00
Molkobain
1f3b467083 SCSS Doc 2021-05-05 18:23:16 +02:00
Molkobain
34647cc402 Fix MetaModel::EnumPlugins unit tests 2021-05-05 14:58:50 +02:00
Molkobain
2a9e16bd2c Fix PluginManager not returning plugin classes as keys of the array (broke iQueryModifier) 2021-05-05 14:27:19 +02:00
Molkobain
ed1fdfa830 Update precompiled stylesheets 2021-05-05 11:59:30 +02:00
Molkobain
1124a584cd Fix iPopupMenuExtension::MENU_OBJLIST_TOOLKIT being called in an object's details 2021-05-05 11:16:34 +02:00
Molkobain
d2c014f718 Remove deprecated / autoloaded files calls 2021-05-04 18:26:37 +02:00
Molkobain
e488ec8c38 N°3914 - Fix "toolkit" actions not being displayed in the menu 2021-05-04 18:26:37 +02:00
Molkobain
18b2e54581 N°3914 - Popover menu: Refactor PopoverMenuFactory::MakeMenuForActions() to benefit from the new PopoverMenuItemFactory methods 2021-05-04 18:26:37 +02:00
Molkobain
3c89313795 N°3914 - Popover menu: Add method to add several items in a section at once 2021-05-04 18:26:37 +02:00
Molkobain
11278d7ba5 N°3914 - Popover menu: Add 2 methods to the items factory
- Create a separator
- Create an item from the array data as prepared by \DisplayBlock
2021-05-04 18:26:37 +02:00
acognet
a6eeb3a50a N°3907 - Polishing: Run query - css -add precompiled themes 2021-05-04 12:58:39 +02:00
acognet
1f1028bbc0 Migrate CCS style of checkbox to new UIBlock system 2021-05-04 12:42:09 +02:00
acognet
08f973f8c0 N°3907 - Polishing: Run query - css 2021-05-04 12:42:09 +02:00
odain
ad22113881 add annotation to be able to exclude test 2021-05-04 12:28:07 +02:00
acognet
e5498e3292 Fix link on key in datatable 2021-05-04 11:58:05 +02:00
acognet
16c9599739 N°3819 - Input: Migrate request templates input to new UIBlock system 2021-05-04 11:55:20 +02:00
acognet
a7040a911d Value from search popup is now correctly selected 2021-05-04 11:19:33 +02:00
Pierre Goiffon
8227796c87 💄 N°3913 Setup : fix license content overflow in "license agreement" step
Added `white-space: pre-wrap;` in setup.scss as all pre tags inside the setup container are subject to this problem because this container has a specific width set.
2021-05-04 09:38:00 +02:00
odain
993dbed7e7 document IsDevelopmentEnvironment defensive behaviour 2021-05-04 08:55:46 +02:00
odain
390dc1c945 document IsDevelopmentEnvironment defensive behaviour 2021-05-04 08:55:20 +02:00
Pierre Goiffon
09b12bd06e 🎨 Add check to prevent setup crash when creating config
In a4782942 a !empty() test was added but this was useless
The problem that was causing the issue was an undefined index when doing $aAvailableModules[$sModuleId]
2021-05-03 16:56:33 +02:00
acognet
3a06f2eaa9 N°3988 - Investigate small list taking a very long time to load 2021-05-03 12:54:50 +02:00
acognet
a8e1db8b3c Fix render 2021-04-30 22:45:30 +02:00
acognet
2cc4448a15 extract methods for apply context on oql 2021-04-30 22:44:03 +02:00
Molkobain
d0d254ad59 Update test-red theme 2021-04-29 18:35:38 +02:00
Molkobain
8f62b63309 N°2788 - Improve HTML fields/caselogs content overlapping for corner cases 2021-04-29 18:17:58 +02:00
acognet
227c90b47f N°3988 - Investigate small list taking a very long time to load 2021-04-29 15:00:05 +02:00
acognet
6fc3033100 Migrate attribute RedundancySetting in new look 2021-04-29 12:15:24 +02:00
Molkobain
cfab20519e N°2922 - Revert 93a1f027 and add support for LabelField in the ConsoleFormRenderer (was already done in PortalFormRenderer) 2021-04-29 12:02:13 +02:00
Molkobain
cbc5bb70d0 Performance: Change theme signature check to be done only when necessary at runtime in a production environment 2021-04-28 19:35:03 +02:00
Molkobain
d5d3a7af47 Performance: Fix NavigationMenu being instantiated several times in the page 2021-04-28 19:35:03 +02:00
Molkobain
03fcc94b1f iTopWebPage: Move TopBar methods near other layouts' methods 2021-04-28 19:35:03 +02:00
Ben
4a28aa316f N°3217 Change module version to 3.0
In dependencies
2021-04-28 16:51:33 +02:00
Eric
88a615528f Add missing reference 2021-04-27 11:58:36 +02:00
acognet
b3e1b7124a N°3980 - Manage dictionary entries for JS script in AjaxPage 2021-04-27 10:45:04 +02:00
acognet
48d0fc6ddb N°3907 - Polishing: Run query 2021-04-27 10:18:32 +02:00
acognet
8bf9987174 N°3592 - Migrate module to new UIBlock system : Customized request forms : allow null for value in function AddMetadata 2021-04-27 10:16:43 +02:00
acognet
0f4c325aab Fix id of datatable 2021-04-26 09:03:11 +02:00
acognet
93a1f027cb N°2922 - Dependent fields in Request template - Error management 2021-04-26 09:03:11 +02:00
Molkobain
3e0971597b Medallion icon: Fix message log "Twig : missing file '' : Unable to find template "base/components/medallion-icon/layout.js.twig"" 2021-04-23 22:41:44 +02:00
Molkobain
fce3934977 Improve PHPDoc 2021-04-23 22:34:33 +02:00
Molkobain
d8feda89a5 N°2875 - Add return example in the PHPDoc 2021-04-23 17:03:29 +02:00
Molkobain
7aecdd0dc7 N°2875 - Extract method to find mentioned objects into utils so it can used by extensions, not only the trigger 2021-04-23 17:01:17 +02:00
odain
a478294211 cannot write itop conf error durring setup wizard: add preventive check when empty dependencies 2021-04-22 14:57:06 +02:00
Stephen Abello
9de1f1800d Add icons on PopoverMenu items and allow to add them through PopupMenu API 2021-04-21 14:45:32 +02:00
Stephen Abello
94c8dbac18 Update precompiled stylesheets 2021-04-21 11:15:46 +02:00
BenGrenoble
efc745f574 N°3217 Added OR dependency to ensure if the portal is loaded it's done before faq (according to Molkobain) 2021-04-21 10:50:36 +02:00
Stephen Abello
3e45dcdbb1 Update jQueryUi style 2021-04-21 10:37:47 +02:00
BenGrenoble
ae6e08d430 N°3217 add if_exists on FAQ itop_portal and removed knownerror-mgmt portal dependancies 2021-04-21 09:06:25 +02:00
BenGrenoble
473a49ab6b N°3217 Change itop-knownerror-light by itop-knownerror-mgmt. 2021-04-20 17:27:30 +02:00
BenGrenoble
0c58d67f41 N°3217 Autoindent datamodel and removed dependencies on itop-config-mgmt to fix ci error. 2021-04-20 17:08:46 +02:00
Molkobain
d2c4a6e2e9 UIContentBlock: Add PrependSubBlock() to add a block in first position 2021-04-20 16:32:57 +02:00
Molkobain
d1ccd5c8eb MenuBlock: Put ID prefix in a class constant to be able to reuse it 2021-04-20 16:32:56 +02:00
Molkobain
370a07f596 Use real indexes instead of numerics for the object header blocks (easier to manipulate them) 2021-04-20 16:32:56 +02:00
BenGrenoble
9ae056e663 N°3217 Renamed KnownErrorMgmtInstaller in FAQLightInstaller
Add itop-config-mgmt dependancies for Support.combodo.com compatibility
2021-04-20 15:46:47 +02:00
odain
ce596877a4 fix ci 2021-04-16 14:28:09 +02:00
odain
3d9540e895 Merge branch 'feature/2982-finalize' into develop 2021-04-16 14:04:17 +02:00
odain
27d8869665 N°3593 - rename xsi-type to utilities 2021-04-16 14:01:06 +02:00
odain
3b3fa7b1f8 N°2982 - rename imports_utility and imports_variable in precompilation signature 2021-04-16 11:56:16 +02:00
odain
135b5e8adb N°2982 - PR reviews 2021-04-16 11:46:14 +02:00
odain
52dbf23245 protect IsDevelopmentEnvironment function from warning 2021-04-16 11:33:14 +02:00
Purple Grape
6b899d3f77 🌐 improved chinese for 3.0 (#207) 2021-04-16 11:00:16 +02:00
Molkobain
46dc7709ab Merge remote-tracking branch 'origin/support/2.7' into develop
# Conflicts:
#	datamodels/2.x/itop-portal-base/portal/src/Controller/ObjectController.php
2021-04-15 12:02:23 +02:00
Molkobain
ddb5ffc11a N°3959 - Truncate vertical tabs label when too long, label can be read entirely through a tooltip 2021-04-15 09:30:22 +02:00
Molkobain
2a62e28c66 Code format 2021-04-15 09:30:21 +02:00
Molkobain
973133ce0b N°3959 - Fix vertical tabs inner alignment 2021-04-15 09:30:21 +02:00
BenGrenoble
be0a728f42 N°3913 fix additional ITIL tickets icon missing 2021-04-15 09:05:54 +02:00
Pierre Goiffon
1bb7d9947c N°2522 SetupPage log methods : fix phpdoc, remove deprecated methods calls 2021-04-14 12:18:06 +02:00
odain
65d94bd914 revert d951d0def 2021-04-13 23:48:32 +02:00
odain
d951d0def0 N°3593 - correct GetDefaultThemeInformation returned structure 2021-04-13 23:45:31 +02:00
odain
beadd9cd03 N°3593 - GetVariablesFromFile and precompilation signature fixes + tests 2021-04-13 23:42:53 +02:00
Pierre Goiffon
fac97324a3 🔇 N°3731 Remove some more depreciation notice for methods still used in iTop core 2021-04-13 18:28:39 +02:00
Pierre Goiffon
f33919c312 🔇 N°3731 Remove some more depreciation notice for methods still used in iTop core 2021-04-13 18:22:24 +02:00
Pierre Goiffon
74d8eda713 🔇 N°3731 Remove some more depreciation notice (...) for methods still used in iTop core 2021-04-13 18:13:30 +02:00
Pierre Goiffon
6790fdb9e8 🔇 N°3731 Remove some more depreciation notice for methods still used in iTop core 2021-04-13 18:07:43 +02:00
Pierre Goiffon
d545123ca7 🔇 N°3731 Remove some depreciation notice for methods still used in iTop core 2021-04-13 17:56:21 +02:00
Pierre Goiffon
59678ef8c6 🔊 N°3731 Log calls to deprecated files / PHP methods
POC for the log API was added in #193
2021-04-13 17:56:21 +02:00
Pierre Goiffon
a6d20ab648 N°3731 \DeprecatedCallsLog : always catch errors so that we won't crash the caller 2021-04-13 17:56:20 +02:00
Pierre Goiffon
e5559a1899 N°3731 Add DeprecatedCallsLog to autoloader 2021-04-13 17:42:04 +02:00
Pierre Goiffon
f8757c6d5d 🔇 Remove depreciation log in \WebPage::outputCollapsibleSectionInit as this call must be kept for compatibility
The log will be added but elsewhere, in methods only called by consumers and not by the API itself (like \WebPage::StartCollapsibleSection ?)
2021-04-13 15:45:55 +02:00
Pierre Goiffon
7f4ef12c04 🐛 Fix \DeprecatedCallsLog::NotifyDeprecatedPhpMethod log message
This was bringed by #193
The stack trace wasn't used correctly :/ This is now fixed !

Sample message for deprecated PHP method call :
`2021-04-13 15:31:47 | Warning | Call to WebPage:outputCollapsibleSectionInit in  C:\...\itop-dev\sources\application\WebPage\AjaxPage.php#L170 (AjaxPage::output) | deprecated-php-method`

Log message for deprecated PHP file remains the same :
`2021-04-13 10:31:12 | Warning | C:\...\itop-dev\sources\application\WebPage\WebPage.php L32 including/requiring C:\...\itop-dev\core\coreexception.class.inc.php : Classes were moved to /application/exceptions | deprecated-file`
2021-04-13 15:38:38 +02:00
Pierre Goiffon
2a90557782 💚 Move DeprecatedCallsLog activation from bootstrap to \MetaModel::LoadConfig, same as existing LogAPI impl
As this is called from \MetaModel::Startup, our log will be available everywhere !
\DeprecatedCallsLog::Enable call in bootstrap was causing some tests to fail
Modification from what was done in #193
2021-04-13 14:58:48 +02:00
Pierre Goiffon
7b3595357a 💚 Removing invalid provider for \Combodo\iTop\Test\UnitTest\Core\LogAPITest::LogApiProvider
Config can never be an array
Was working since now, but LogAPI was modified in f6d9d0f0 and it now correctly pick the config, so this provider was failing
2021-04-13 14:37:54 +02:00
Pierre Goiffon
f6d9d0f08b N°3731 Log deprecated calls (#193)
* New DeprecatedCallsLog logger enabled directly in bootstrap so that we can use it in the most situations
* Default Log level is now DEBUG for dev env, ERROR for others
* Logs the caller and the deprecated method called, like :
`2021-04-06 10:52:25 | Warning | AjaxPage::output L2857 calling WebPage:outputCollapsibleSectionInit | deprecated-method`
* Sample file consumer
* Sample php consumer
2021-04-13 13:55:25 +02:00
Molkobain
f3cf154969 N°3899 - Navigation menu: Filter hot key text now corresponds to the one defined in the user preferences 2021-04-13 11:46:35 +02:00
Molkobain
923a4048d3 Keyboard shortcuts: Add method to retrieve info about a particular shortcut 2021-04-13 11:46:34 +02:00
Molkobain
0816d27456 N°3899 - Navigation menu: Fix hotkey position across browsers 2021-04-13 11:46:34 +02:00
odain
d07199db7c N°2982 - add theme_precompilation_enabled to be able to deactivate precompilation from conf + update provided precompiled files when IsDevelopmentEnvironment 2021-04-13 00:49:08 +02:00
odain
903afff687 N°2982 - fix delta xml variables not used in themes 2021-04-12 22:14:00 +02:00
Molkobain
c0f5906dce Fix crash when accessing a backoffice page in maintenance mode (regression from e2f30182) 2021-04-12 12:08:33 +02:00
Molkobain
fa3140cc13 N°3916 - Attribute date: Fix picker's icon position 2021-04-12 12:08:33 +02:00
Molkobain
22aaba3c65 Update precompiled themes 2021-04-12 10:25:38 +02:00
Molkobain
5878b18b02 N°3921 - Attribute file: Simplify size format in the backoffice (similar to the portal) 2021-04-12 10:25:38 +02:00
Molkobain
530ec111ef N°3921 - Attribute file: Simplify open and download links text in the backoffice (similar to the portal) 2021-04-12 10:25:37 +02:00
Molkobain
430049d7c4 N°3921 - Attribute file: Fix "delete" button not displaying 2021-04-12 10:25:37 +02:00
Molkobain
e45fd92022 SCSS: Move depression/elevation variables to proper files 2021-04-12 10:25:37 +02:00
Molkobain
605165fc5a SCSS: Add font sizes CSS variables 2021-04-12 10:25:36 +02:00
Molkobain
644944c6fd SCSS: Add border radius placeholders 2021-04-12 10:25:36 +02:00
Molkobain
8313d61521 SCSS documentation 2021-04-12 10:25:36 +02:00
Molkobain
81d30ca9f4 N°3916 - Date(time) picker: Fix selects and buttons display. 2021-04-12 10:25:36 +02:00
Molkobain
6078ccc144 N°3916 - Attribute date(time): Remove browser autocompletion on focus in the input 2021-04-12 10:24:35 +02:00
Molkobain
7b9d89e485 Activity entry: Remove old markup from AttributeHTML change 2021-04-12 10:24:35 +02:00
Molkobain
48bc8b2341 Activity entry: Fix change description being displayed twice when only 1 attribute changed 2021-04-12 10:24:35 +02:00
Molkobain
8f03ac4aa3 Activity entry: Fix french dict. entry when more than 4 attributes changed 2021-04-12 10:24:34 +02:00
Molkobain
97f5f0b50d Activity entry: Fix "more" toggler being at the bottom of the entry with text attributes 2021-04-12 10:24:34 +02:00
Molkobain
05594ccdd6 N°3915 - Fix very long strings (typically URLs) overflowing from their containers in text attributes and activity panel entries. 2021-04-12 10:24:34 +02:00
Molkobain
e2f301827a N°3936 - Add protection to avoid crashes in certain conditions since d6695d3a 2021-04-12 09:06:56 +02:00
odain
067cbe2afa fix ci: DataSynchroTest adapted for Admin profile renaming 2021-04-09 12:03:20 +02:00
Eric
a99f4c0666 💚 Fix precompiled themes 2021-04-09 10:42:51 +02:00
Eric
d594f28ed9 N°3573 - Migrate backoffice pages to new UIBlock system : System Information 2021-04-09 09:55:58 +02:00
Molkobain
deed948f54 N°3936 - Remove 🌕 emoji from the theme label, it's was a bit too much 😁 2021-04-09 09:05:52 +02:00
Molkobain
25e88b889d N°3936 - Fix designation of the default theme 2021-04-09 09:05:52 +02:00
Molkobain
d6695d3ad8 N°3936 - Add config parameter to disable theme selection in the user preferences ("user_preferences.allow_backoffice_theme_override") 2021-04-09 09:05:52 +02:00
acognet
0bc9aed3fe Remove development logs 2021-04-08 22:23:01 +02:00
acognet
98ec4bba53 N°2738 - Remove unused dict keys - fix Lost translations author 2021-04-08 22:23:00 +02:00
Molkobain
e527324468 N°3936 - Update dictionaries 2021-04-08 18:26:18 +02:00
Molkobain
8ccada40d1 N°3936 - Add user preference to choose backoffice theme 2021-04-08 18:26:18 +02:00
BenGrenoble
80d974f2b4 N°3217 rollback itop-knownerror-light to itop-knownerror-mgmt 2021-04-08 16:27:49 +02:00
acognet
521c493fd1 N°3868 - "Error: Invalid filter parameter" on mass update - fix datatable after configure this list 2021-04-08 10:06:55 +02:00
Pierre Goiffon
b68ee1136e 📦 💚 Update compiled CSS for test-red
Modification was done in 3262ad70
Didn't add this one in previous commit 0f43b0a6 but was necessary too :/
2021-04-07 18:39:41 +02:00
Pierre Goiffon
0f43b0a6de 📦 💚 Update compiled CSS
Modification was done in 3262ad70
2021-04-07 18:16:27 +02:00
Pierre Goiffon
58d1a1d311 🚚 collapsibleSection JQuery widget renamed to collapsible_section
to match other widget naming convention
2021-04-07 17:14:44 +02:00
Molkobain
5b3ab2965f Activity panel: Mark polish translation as potentially dirty 2021-04-07 16:57:35 +02:00
Stephen Abello
f97f55bcca N°3896 - CKeditor icon for enhance WikiText URLs syntax 2021-04-07 16:20:01 +02:00
acognet
3262ad7029 N°3868 - "Error: Invalid filter parameter" on mass update 2021-04-07 12:22:02 +02:00
acognet
a5bb6a0c55 N°3886 - Mass delete : toggle all checkbox not working anymore 2021-04-07 12:01:20 +02:00
acognet
f0d6b41cee N°2738 - Remove unused dict keys - undo for some entries 2021-04-07 11:55:54 +02:00
Pierre Goiffon
5c01d222c9 DictionariesConsistencyTest : remove debug var_dump
Many thanks @Hipska !
2021-04-07 11:27:33 +02:00
Pierre Goiffon
7e65541d3c DictionariesConsistencyTest : simplify & comment sample dict files 2021-04-07 11:09:51 +02:00
Molkobain
83b8fbb6b5 Remove unused DisplayDetails() function 2021-04-07 10:47:37 +02:00
Molkobain
5b9e5f8de9 Activity panel: Reword english translation for better clarity 2021-04-07 10:02:39 +02:00
Stephen Abello
ddceeafc52 Display ajax tab placeholder when loading regular displayed ajax tab 2021-04-07 09:56:35 +02:00
Stephen Abello
56087d9686 Fix tab container when there is only ajax tabs 2021-04-07 09:46:13 +02:00
Stephen Abello
5aef6f209b Remove debug line 2021-04-07 09:46:13 +02:00
Pierre Goiffon
1b6d69037e DictionariesConsistencyTest : fix inspections warnings 2021-04-07 09:26:34 +02:00
Pierre Goiffon
3941f323c0 Dict syntax samples : make them smaller to ease comparisons 2021-04-07 09:12:51 +02:00
Molkobain
b19f9d4875 N°2875 - Mentions: Continue work on implementation
- Add context attribute to details zlist
- Update french dictionary
2021-04-06 22:28:19 +02:00
Molkobain
057bb1a296 Remove some of the unrelevant tooltips from DM dictionaries 2021-04-06 22:28:19 +02:00
Molkobain
192cb2df73 N°3894 - Activity panel: Add conf. param. to prefilter only on current log or all 2021-04-06 19:45:12 +02:00
Pierre Goiffon
47c797daba 🔨 Fix extensions doc generation script
There were some path problems, this wasn't consistent with the procedure (run from the .doc dir) and with the other script
2021-04-06 18:25:26 +02:00
Pierre Goiffon
33dcb35344 📝 .doc/README : fix generation procedure 2021-04-06 18:25:26 +02:00
Molkobain
68ab84716b N°2224 - Update standard portal compiled stylesheet 2021-04-06 18:14:53 +02:00
Pierre Goiffon
b60fb4fb99 N°3892 Setup : fix license text display
iTop license was the only one to contain HTML, so every other one needed to be contained in a "<pre>" tag :/ And... That wasn't true :(
Now iTop license is back in text (like in the license.txt file in this repo), and the `<pre>` tag is added in WizStepLicense::Display
2021-04-06 15:09:30 +02:00
Molkobain
8fb5a9acd0 N°3887 - Set max. height for autocomplete results list 2021-04-06 14:50:31 +02:00
Molkobain
4c289edac7 N°3887 - Harmonize number of autocomplete displayed results throughout the app 2021-04-06 14:50:31 +02:00
Molkobain
f6be3736fd N°3887 - Add config. param. "max_autocomplete_results" 2021-04-06 14:50:31 +02:00
Pierre Goiffon
f8f9c2d7bb 📄 Update Font Awesome license
Was duplicated...
And also not the correct license !
Source for new license text : https://github.com/FortAwesome/Font-Awesome/blob/master/LICENSE.txt
2021-04-06 14:39:21 +02:00
Molkobain
94fdc79be5 Update precompiled stylesheet for "test-red" theme 2021-04-06 08:53:43 +02:00
Molkobain
5fa2caac29 Mentions: Show initials when no picture for contact 2021-04-06 00:02:13 +02:00
Molkobain
8b25679df8 Extract function to get a person's initials to a dedicated ToAcronym function in \utils 2021-04-05 21:05:46 +02:00
Molkobain
a67bff3959 Reorder some methods by theme 2021-04-05 20:44:39 +02:00
Molkobain
24eec4aa21 PHPDoc 2021-04-05 17:44:37 +02:00
Molkobain
978e64d66c Button: Improve fix from 54b718e7 2021-04-05 14:58:18 +02:00
Molkobain
3dad90dbcf Update precompiled theme 2021-04-04 23:14:42 +02:00
Molkobain
17c4a18c94 Fix date picker icon floating around instead of being within the input 2021-04-04 23:12:07 +02:00
Molkobain
c8f709a4e6 Fix z-index for external key dropdown arrow 2021-04-04 23:12:07 +02:00
Molkobain
90cc08b920 Refactor IsElementVisibleToTheUser() JS helper within CombodoGlobalToolbox 2021-04-04 23:12:07 +02:00
Molkobain
54b718e7cd Button: Force content (icon + text) to be on 1 line 2021-04-04 23:12:06 +02:00
Molkobain
0bc2f2c818 Fix autocomplete / set attributes' dropdown being cut by its container 2021-04-04 23:12:06 +02:00
odain
c0b1581f0c fix ci: datasynchro test 2021-04-02 23:00:14 +02:00
odain-cbd
bf793fd989 fix temporarly ci: comment broken datasynchro tests 2021-04-02 20:23:05 +02:00
odain
711fe5607b ci: increase DataSynchro test coverage 2021-04-02 17:54:25 +02:00
odain
4fa259af14 ci: increase DataSynchro test coverage 2021-04-02 17:23:03 +02:00
odain
49fe8d0a0f N°2982 - small enhancement to fetch images in themes 2021-04-02 10:44:43 +02:00
Pierre Goiffon
e492d713c4 ThemeHandlerTest : add Windows compat 2021-04-02 10:39:09 +02:00
odain
77962d73eb N°2982 - fix provided precompiled styles 2021-04-02 08:53:52 +02:00
Pierre Goiffon
e53cab0d1d 🎨 fix param order for \CMDBSource::IsSameFieldTypes call + code formatting 2021-04-02 08:22:36 +02:00
odain
5816b22639 N°2982 - fix testthat validates provided precompiled stylesheets 2021-04-02 07:30:45 +02:00
Molkobain
5f8eb26bff Object details: Fix tabs left padding when class has no medallion icon 2021-04-01 23:37:45 +02:00
Molkobain
8b894bf96b Dashboard: Improve fix from previous commit as sListId can be null (which crashes the sanitize filter) 2021-04-01 23:22:27 +02:00
Molkobain
96021274cc Dashboard: Fix JS error on custom dashboard when trying to create a variable with dash in its name 2021-04-01 22:15:16 +02:00
odain
5f3fda95fc ci enhance DatasynchroTest 2021-04-01 18:32:02 +02:00
odain
3afa783ba8 PR #188 make sure data synchro does not change enum db type (default value) 2021-04-01 18:29:45 +02:00
denis.flaven@combodo.com
a997e528ec Internal regression, enum fields not created in data synchro tables 2021-04-01 18:13:24 +02:00
odain
9177982592 PR #188 add testcase to cover data synchro regression 2021-04-01 18:11:24 +02:00
odain
d32bfa3ef4 N°2982 - Speed up SCSS themes compilation during setup - preventive check before looping 2021-04-01 14:59:41 +02:00
Denis
78d82528fc Fix DBSchema update fails when an ENUM column contains values which are not / no longer part of the field definition (#188) 2021-04-01 12:13:52 +02:00
odain
216489ab2d fix ci temporarly 2021-04-01 10:25:21 +02:00
odain
d3d2820b4e 580 - DatasynchroTest fixed both in http and cli modes 2021-04-01 00:04:40 +02:00
odain
f75c660a45 2982 - restore precompiled styles in datamodel 2021-03-31 23:49:50 +02:00
odain
cb91d6f3c4 N°2982 - Speed up SCSS themes compilation during setup - fix infite loop when n signature inside precompiled file 2021-03-31 23:37:29 +02:00
Pierre Goiffon
6744147bf9 PHP syntax check for dictionnaries : change wrong file ext to avoid having errors in the IDE
I was hoping a @noinspection annotation could be the answer but I didn't find any corresponding inspection key to disable :/
2021-03-31 17:40:21 +02:00
Molkobain
fcb84423ea N°3634 - Lists: Fix list margin with its container panel when rendered as a dashlet 2021-03-31 17:32:57 +02:00
Pierre Goiffon
fa92c12b5a PHP syntax check for dictionnaries : execute beforeSetup 2021-03-31 17:27:08 +02:00
Eric
d3a857d9d3 N°580 - Fix CI temporarily 2021-03-31 17:00:38 +02:00
Pierre Goiffon
c843e13c58 New tests to check syntax of all dict files
We had some issues last week with invalid PHP syntax in dict files. The CI detects some of these, but having a larger check with a clearer message that is run immediately at commit will ease fixing such issues !
2021-03-31 16:49:50 +02:00
Eric
131ecd5e3b N°3251 - Restore 2.7 behaviour of ExecITopScript (hide passwords from commandline arguments) and allow tests to provide credentials 2021-03-31 16:36:40 +02:00
Molkobain
7a95ea407b N°2982 - Revert temporarily precompiled stylesheets from datamodel as it puts the setup in an infinite loop 2021-03-31 12:14:41 +02:00
acognet
efeedcad30 N°3868 - "Error: Invalid filter parameter" on mass update 2021-03-31 11:32:35 +02:00
Molkobain
5be3496c8f N°2982 - Restore precompiled stylesheets files 2021-03-31 10:22:54 +02:00
Molkobain
d465bf10fd N°2591 - Restore lost deprecation comment 2021-03-31 10:22:54 +02:00
acognet
2265d1641e N°3868 - "Error: Invalid filter parameter" on mass update 2021-03-31 09:20:53 +02:00
acognet
6f9b5b7c64 N°2737 - Migrate table to DataTables plugin in display objects 2021-03-31 09:20:53 +02:00
acognet
7d92ff65a2 N°3650 - fix image display when creating an object 2021-03-31 09:20:52 +02:00
acognet
1260a09c05 N°3582 - Migrate backoffice pages to new UIBlock system : Import CSV fix vertical tabs 2021-03-31 09:20:51 +02:00
Molkobain
95f328d2af N°3634 - Lists: Fix shortcut not being added "live" to navigation menu on creation 2021-03-30 18:19:51 +02:00
Molkobain
0c87bd9aad TwigHelper: Add constant for backoffice's templates base folder
Note: We might add more in the future for other GUIs
2021-03-30 18:19:51 +02:00
Molkobain
99f09127ea Shortcuts: Fix dialog's buttons style 2021-03-30 18:19:51 +02:00
vdumas
87987e1c2f N°463 - Load localized Query Phrases at Setup (German version) 2021-03-30 16:24:56 +02:00
Molkobain
9d98a494cb Update setup XML licenses file following 5940578e 2021-03-30 16:10:16 +02:00
Molkobain
4d74371e8e Advanced search: Add comment on its SCSS partial 2021-03-30 15:59:32 +02:00
Molkobain
20e41f21d9 N°3634 - Advanced search: Fix opened criterion display 2021-03-30 15:56:47 +02:00
Molkobain
5940578e3a Update setup licenses for NPM libs 2021-03-30 15:56:47 +02:00
Eric
94b52f8d9f N°580 - Check parent class config 2021-03-30 14:40:42 +02:00
Pierre Goiffon
8674ebb137 📝 updateLicenses.php : add solution for JQ on Windows, and also a known bug 2021-03-30 11:43:08 +02:00
odain
71e64cd1dc N°2713 - Allow read access to synchro errors for users with non-admin profile - fix when object not allowed 2021-03-30 10:34:44 +02:00
Pierre Goiffon
d0ea5e9e1c N°2330 Change MySQL min version
Reasons :
* the min version was announced on a public wiki page (https://www.itophub.io/wiki/page?id=2_7_0%3Ainstall%3Ainstalling_itop#software_requirements)
* MySQL 5.6 end of life was reached in feb. 2021 (https://endoflife.software/applications/databases/mysql)
2021-03-30 10:28:59 +02:00
Molkobain
d9ed2e6de9 Dashboard: Push file missing from last commit 2021-03-30 09:55:10 +02:00
Purple Grape
8a4372762e 🌐 ZH translations for iTop 3.0 (#198)
Many thanks @purplegrape !
2021-03-30 09:42:31 +02:00
Molkobain
82e67f27f7 Dashboard: Rename class to better match conventions 2021-03-30 09:36:20 +02:00
Molkobain
8124bea16f Lists: Fix JS error when dataTables widget is destroyed 2021-03-30 09:36:20 +02:00
odain
62165a2a0d N°2713 - Allow read access to synchro errors for users with non-admin profile - take into account allowed read action 2021-03-29 18:40:06 +02:00
Molkobain
31f6558710 N°3634 - Lists: Improve rendering to better match mockups and feedbacks from alpha version 2021-03-29 18:13:30 +02:00
Pierre Goiffon
afd9ddf46d ⬇️ Restore php-parser to its original version as tests are failing :/ 2021-03-29 16:51:10 +02:00
Pierre Goiffon
d62825c99b Improve test error message 2021-03-29 16:49:55 +02:00
Pierre Goiffon
a7e7e62245 ⬆️ Upgrade lib : nikic/php-parser
We were on v3 that is no longer maintained and compatibility is annonced for PHP 7.2.
v4 is active and supports PHP up to 8.0
No problem to update as this is only used in the config editor (\Combodo\iTop\Config\Validator\iTopConfigAstValidator)
2021-03-29 16:35:30 +02:00
Molkobain
c11fd4f0ab NPM libs: Update embedded package to avoid their dependencies to be retrieved as they are already their 2021-03-29 11:11:52 +02:00
Molkobain
a29dac2c60 NPM libs: Restore web.config file 2021-03-29 11:11:50 +02:00
Pierre Goiffon
8846a42bf4 👥 README : add DudekArtur
Submitted polish translations : #194, #195
Many thanks to him !
2021-03-29 10:30:54 +02:00
Pierre Goiffon
72805e5da9 🎨 Formatting for licenses file 2021-03-29 09:07:42 +02:00
Pierre Goiffon
8bbcf542b6 📄 Update licenses for Datatables
Added using NPM in 6f659a34
2021-03-29 09:07:03 +02:00
Pierre Goiffon
f01109bd18 💡 Fix command for additional NPM licenses 2021-03-29 08:56:11 +02:00
Molkobain
6f659a3431 Improve dataTables integration within the app:
- Manage lib through NPM
- Move portal / Bootstrap files back to the itop-portal-base module (not managed through NPM yet)
- Fix SCSS classes for the backoffice as it was based on the bootstrap CSS classes which are not there anymore

Note: jQuery is included as a dependency, will check with the team if we can force it not to be retrieved
2021-03-26 17:46:13 +01:00
Molkobain
2e8c0346d3 Fix NPM package.json not present in the repository 2021-03-26 17:44:23 +01:00
Molkobain
fbd46609ff Button: Revert "Improve display when text doesn't fit in the button's width" 2021-03-26 16:29:11 +01:00
vdumas
70620b96bc Revert "N°463 - Load localized Query Phrases at Setup (2)"
This reverts commit 6b5cbfb6
2021-03-26 16:05:56 +01:00
vdumas
daebfdd54b N°463 - Load localized Query Phrases at Setup (3) 2021-03-26 15:43:47 +01:00
vdumas
6b5cbfb64e N°463 - Load localized Query Phrases at Setup (2) 2021-03-26 15:43:47 +01:00
Pierre Goiffon
8fa9147dc1 📄 Add licenses for NPM packages
Our tooling isn't ready yet and will be updated with N°3862
I added a dedicated JSON file to ease comparisons in next releases
2021-03-26 12:18:50 +01:00
Pierre Goiffon
30542f6b27 ✏️ README fix typo 2021-03-26 11:34:54 +01:00
Pierre Goiffon
c2c0b6a1b0 👥 README : update contributor's list
- larhip was duplicated
- added Super-Visions
- added links to companies websites
- minor formatting changes
2021-03-26 11:09:33 +01:00
Stephen Abello
c2ffe58070 N°3857 Add French translation and replace 'iTop' by application constant 2021-03-26 10:46:51 +01:00
Molkobain
daa039cb85 Update polish translations to use app. name instead of "iTop" 2021-03-26 10:40:45 +01:00
Molkobain
6028a3e419 Update PHPDoc 2021-03-26 10:34:26 +01:00
Pierre Goiffon
082592fc22 ✏️ CONTRIBUTING : fix typo on branch model 2021-03-26 10:25:52 +01:00
Pierre Goiffon
5baa157d42 ✏️ CONTRIBUTING : fix typo 2021-03-26 10:24:15 +01:00
Pierre Goiffon
adafcabbb8 💚 Add missing dictionary language in DictionariesConsistencyTest
PL was added with 8f8e86a4 (#194)
2021-03-26 10:07:21 +01:00
Molkobain
9312fdb573 User picture: Fix wrong image displayed on other users without a contact 2021-03-26 10:03:13 +01:00
Molkobain
ba33cf98e3 User preferences: Open APIa bit so developer can retrieve a pref. from any user, not only the current one. 2021-03-26 10:03:13 +01:00
Eric
649bd2a170 Fix loading classes with apc extension 2021-03-26 10:02:01 +01:00
DudekArtur
8f8e86a4eb 🌐 Polish translations for 3.0.0 (#194)
Many thanks @DudekArtur !
2021-03-26 09:55:41 +01:00
Molkobain
532672b5d1 Fix ProblemManagement menu's icon 2021-03-26 08:54:47 +01:00
Molkobain
34c61f812a Button: Improve display when text doesn't fit in the button's width 2021-03-26 08:54:46 +01:00
Molkobain
b782f2f9b2 Move utils::GetUserPictureAbsUrl() with other user methods 2021-03-26 08:54:46 +01:00
Molkobain
58d2b1d3f4 Rename utils::GetContactPictureAbsUrl() to utils::GetUserPictureAbsUrl() 2021-03-26 08:54:46 +01:00
odain
7d1f5c91a7 N°463 - fix broken setup 2021-03-26 08:06:25 +01:00
vdumas
f53abf9a45 N°463 - Load localized Query Phrases at Setup 2021-03-25 18:41:00 +01:00
odain
407a651e44 N°2713 - Allow read accès to synchro errors for users with non-admin profile - removing comment 2021-03-25 18:05:59 +01:00
acognet
992541ed99 N°3582 - Migrate backoffice pages to new UIBlock system : Import CSV fix advanced mode 2021-03-25 17:59:45 +01:00
Eric
3a9228d8d3 N°3569 - Fix DB Tools queries display 2021-03-25 16:36:43 +01:00
Molkobain
aa9632a41b User picture: Use placeholder image from preferences when no contact attached to the user 2021-03-25 15:59:45 +01:00
Molkobain
ba994c91fc User picture: Update contact's image attribute with preferences' placeholder so it can be used elsewhere 2021-03-25 15:59:45 +01:00
Molkobain
5d3a829f65 Update PHPDoc 2021-03-25 15:59:44 +01:00
azana38
d4d1b8f513 N°3852 - Translate new keys in FR 2021-03-25 15:56:42 +01:00
Eric
67141eaeac N°3856 - Fix DisplayBlock error 2021-03-25 14:39:48 +01:00
Molkobain
43671629f0 Button group: Fix spacing with other siblings 2021-03-25 14:10:26 +01:00
acognet
66f7406148 N°3582 - Migrate backoffice pages to new UIBlock system : Import CSV fix config popup 2021-03-25 12:08:16 +01:00
acognet
dc0006bd76 N°3801 - Some queries not loaded in KPI with new datatable mode 2021-03-25 12:08:15 +01:00
acognet
0ab2f03064 Fix display header when there is an alert message 2021-03-25 12:08:15 +01:00
odain
89205a66ad N°2713 - Allow read accès to synchro errors for users with non-admin profile 2021-03-25 11:28:07 +01:00
azana38
50af948c9f N°3852 - Translate new keys in FR 2021-03-25 10:35:04 +01:00
Molkobain
5da5f5ac42 Activity panel: Try to improve "transitions" filter french dict. entry so it all fits nicely in the toolbar
Note: As there is a tooltip, the label can be relatively short. Any doubts from the user will be dismissed when they see the tooltip
2021-03-25 09:35:29 +01:00
Molkobain
0e062f51e9 Tests: Update render all blocks page 2021-03-25 00:04:38 +01:00
Molkobain
e0a655e102 Button factory: Fix name param. being mandatory on some methods 2021-03-24 23:59:47 +01:00
Molkobain
a5a771b242 Button group: Fix buttons' corners when 3+ elements 2021-03-24 23:56:56 +01:00
Molkobain
11f330cff6 Update dictionaries 2021-03-24 23:39:12 +01:00
Molkobain
e0b744183a Activity panel: Try other dict. entries that fit on the line 2021-03-24 20:09:15 +01:00
Molkobain
f6db3d5700 Activity panel: Fix transitions button not being disable during entries submission 2021-03-24 20:04:38 +01:00
Molkobain
94601efed2 Update dictionnaries 2021-03-24 19:48:39 +01:00
Molkobain
573a6d82fe N°3649 - Activity panel: Add transitions to the save button using the button group 2021-03-24 19:43:35 +01:00
Molkobain
318d8ce3c9 Add ButtonGroup block 2021-03-24 19:43:35 +01:00
Pierre Goiffon
85d3cc92c4 🌐 Align all dictionnaries with keys in EN dict
Was done in 0fd3cb01 but some new keys were added after :
* db-tools 69994471
* UI:WelcomeMenu:Text in dictionaries/en.dictionary.itop.ui.php with 8204dbb6
2021-03-24 18:52:18 +01:00
Pierre Goiffon
7aa0694eac 🌐 Remove propositions added in 4124e44a as keys were translated in b6b6d11a and 58018687 2021-03-24 18:37:02 +01:00
Pierre Goiffon
20af4921f8 💡 📝 updateLicenses.php : more documentation 2021-03-24 18:04:45 +01:00
Stephen Abello
8204dbb6ae N°3857 Replace old welcome popup 2021-03-24 17:18:55 +01:00
Pierre Goiffon
e759124bd8 🔖 Prepare 3.0.0-beta 2021-03-24 17:05:17 +01:00
azana38
41fc8de9c5 Fix grammatical mistake 2021-03-24 16:57:09 +01:00
Molkobain
b54a63a5f7 Update contributors list 2021-03-24 16:33:28 +01:00
Molkobain
a27eb8c63b Popover menu: Add SetTogglerFromId() and SetTogglerFromBlock() methods as shortcuts 2021-03-24 16:33:28 +01:00
Eric
572fce041b Fix core-update blank page 2021-03-24 16:30:08 +01:00
Stephen Abello
456f7f7c7d Rename test-red variables 2021-03-24 11:29:43 +01:00
Stephen Abello
5d6194e679 Revert new method in itopdesignformat 2021-03-24 11:29:43 +01:00
Stephen Abello
1d0da38d40 N°3593 Fix file import variable usage in theme compilation 2021-03-24 11:29:43 +01:00
acognet
b63f720e5d Add factory for MultiColumn and Column 2021-03-24 11:18:55 +01:00
Molkobain
64d5f52eae Activity panel: Remove markup committed by mistake 2021-03-24 11:07:05 +01:00
Molkobain
c1af4de1d4 Add icons8, unDraw and Freepik to embedded libs. licenses 2021-03-24 10:58:08 +01:00
Pierre Goiffon
7f72088736 💚 Fix syntax error in dict 2021-03-24 10:19:08 +01:00
azana38
38956503e1 N°3852 - Translate new keys in FR 2021-03-24 10:03:17 +01:00
azana38
47ff93cb5d N°3852 - Translate new keys in FR 2021-03-24 10:02:25 +01:00
Pierre Goiffon
212e34feac 💡 📝 Documentation of the update licenses script 2021-03-24 09:52:03 +01:00
azana38
f5ff1ce80b N°3852 - Translate new keys in FR 2021-03-24 09:39:15 +01:00
azana38
db4eefb759 N°3852 - Translate new keys in FR 2021-03-24 08:57:13 +01:00
azana38
58018687dd N°3852 - Translate new keys in FR 2021-03-24 08:53:31 +01:00
azana38
ec1fb06106 N°3852 - Translate new keys in FR 2021-03-24 08:44:38 +01:00
azana38
b6b6d11abc N°3852 - Translate new keys in FR 2021-03-24 08:40:03 +01:00
acognet
094a86cbbf N°3582 - Migrate backoffice pages to new UIBlock system : Improved display 2021-03-24 07:57:24 +01:00
Pierre Goiffon
fdf01b770a 🚚 Move dict files to dictionaries subdirectory
Affected modules in datamodels/2.x :
    - itop-bridge-cmdb-ticket
    - itop-portal
    - itop-structure
2021-03-23 19:12:13 +01:00
odain
262a815457 N°3805 - Collectors not working on itop 3.0 - activate data synchro test in ci + cover current bug with a specific one 2021-03-23 19:07:38 +01:00
Eric
699944711b N°3569 - Migrate backoffice pages to new UIBlock system : DB Tools 2021-03-23 18:30:40 +01:00
Eric
c7425558e7 Fix core-update blank page 2021-03-23 18:28:19 +01:00
Pierre Goiffon
4124e44a8d 🌐 Prepare 3.0.0-beta : FR translations for some of the new keys
2 keys were left untranslated but added in comment a proposition :
* UI:Layout:ActivityPanel:ComposeButton:Tooltip in dictionaries/ui/layouts/fr.dictionary.itop.activity-panel.php
* UI:Preferences:ActivityPanel:EntryFormOpened+ in dictionaries/ui/pages/fr.dictionary.itop.preferences.php
As I'm not sure yet of what will be adopted for "log" for example
2021-03-23 18:16:28 +01:00
Pierre Goiffon
41e8ce1c74 🌐 Update error.php message for beta and beyond
Note that this message only appears on certain conditions (see \ErrorPage::error)
2021-03-23 18:16:28 +01:00
Pierre Goiffon
238036ef48 🌐 No translation for shortcuts ! 2021-03-23 18:16:28 +01:00
Pierre Goiffon
da0ca3d440 🌐 Fix auto dict updates
Keys were added for enum values in EN and all corresponding files, although they were already declared !
See N°3850
2021-03-23 18:16:28 +01:00
Pierre Goiffon
0fd3cb01cf 🌐 Prepare 3.0.0-beta : align all dictionnaries with keys in EN dict 2021-03-23 18:16:27 +01:00
Molkobain
ab7cf49de0 N°3810 - Avoid syntax highlighting that shouldn't take place 2021-03-23 16:48:44 +01:00
Molkobain
cf5dffcd80 Merge remote-tracking branch 'origin/support/2.7' into develop
# Conflicts:
#	application/itopwebpage.class.inc.php
2021-03-23 16:48:14 +01:00
acognet
2834c2f86c N°3582 - Migrate backoffice pages to new UIBlock system : Import CSV fix buttons style 2021-03-23 16:18:53 +01:00
Molkobain
7bf1ef355f Panel factory: Remove SetClassColor() method as it has been move directly in the panel in a previous commit 2021-03-23 15:06:35 +01:00
odain
34c12b61cc N°2982 - Speed up SCSS themes compilation during setup - add method visibility 2021-03-23 14:41:32 +01:00
Eric
fc0bac6726 N°2982 - Speed up SCSS themes compilation during setup (removed dev bypass) 2021-03-23 14:38:08 +01:00
Eric
4534944b08 N°3536 - revert function and use GetSubBlocks() instead 2021-03-23 14:26:17 +01:00
Molkobain
1d6ad94694 N°3649 - Activity panel: Add menu to compose button to select the target log when on a readonly tab (activity, read only case log) 2021-03-23 12:09:37 +01:00
Molkobain
367197357c Popover menu: Add HTML data attributes in templates 2021-03-23 12:09:37 +01:00
Molkobain
ae416f2769 Popover menu: Add HasSection() and HasItems() methods 2021-03-23 12:09:37 +01:00
Molkobain
a19df34b79 UIBlock: Add hasDataAttributes() method 2021-03-23 12:09:37 +01:00
odain
7127c70ed6 N°2982 - Speed up SCSS themes compilation during setup - fix included files with same name and folder 2021-03-23 11:33:00 +01:00
acognet
80cc850112 N°3582 - Migrate backoffice pages to new UIBlock system : Import CSV 2021-03-23 11:23:55 +01:00
acognet
dfbb362330 N°3746 - Migrate modal to new UIBlock system - update fields when change class selection 2021-03-23 11:08:11 +01:00
acognet
ab5e5a7f4a Remove danger zone 2021-03-23 11:03:49 +01:00
Molkobain
a123f764e6 Fix crash introduced in 574d089c due to missing classes in autoloader 2021-03-22 18:57:35 +01:00
Molkobain
65ed5b3fce Popover menu: Refactor to remove the necessity of coupling JS and PHP code to instantiate it correctly 2021-03-22 18:53:15 +01:00
Molkobain
e8656e8504 Popover menu: Fix JS widget instantiation, now done automatically but the UIBlock system 2021-03-22 18:49:41 +01:00
Molkobain
86c614d56d Add HTML meta data to TWIG templates 2021-03-22 18:49:41 +01:00
Molkobain
093194f326 N°2844 - Object details: Improve transitions menu's tooltip depending on the presence of favorites or not 2021-03-22 18:49:41 +01:00
Molkobain
d3eaf6030d SCSS: Remove jQuery UI helper classes from vendor overloading to prevent them from messing with our reset 2021-03-22 18:49:34 +01:00
Eric
574d089c20 N°3536 - Dashboard: Add title, toggler and menu to AttributeDashboard 2021-03-22 16:46:45 +01:00
Pierre Goiffon
3a141def49 📝 js/README update recommendation text for leading semicolon
Thanks @Hipska !
2021-03-22 12:17:12 +01:00
Molkobain
8dac0a56c9 Hot fix: Temp. removal of this line as it crashed the menus closing on body click 2021-03-19 19:57:47 +01:00
Molkobain
8fade400b7 N°2844 - Object details: Add visual hint on the transition buttons' menu 2021-03-19 19:50:51 +01:00
Molkobain
8334b68285 Popover menu: Introduce option to add a visual hint on the menu toggler
This adds a visual hint (caret down) on the toggler to help the user understand that clicking on the toggler won't do something right away, but will open a menu instead
2021-03-19 19:50:50 +01:00
Molkobain
482bf2e523 N°2844 - Object details: Add separator between regular and transition buttons 2021-03-19 19:50:50 +01:00
Molkobain
10bdb57391 Introduce vertical separator for toolbar blocks 2021-03-19 19:50:50 +01:00
Molkobain
8717d6d75e N°2844 - Object details: Move transition buttons in front of all others 2021-03-19 19:50:49 +01:00
Molkobain
c2339dcb5c N°2844 - Object details: Extract transitions from the "other actions" menu to a dedicated "transitions" menu 2021-03-19 19:50:49 +01:00
Pierre Goiffon
de7ac4ba31 N°3833 Fix DashletBadge in Ajax causing JS error
* switch dashlet_badge widget init from js_template to js_on_ready_template
* add phpdoc on UIBlock::DEFAULT_JS_FILES_REL_PATH
* remove old code in \AjaxPage::output (after the return statement) that is already handled with the new Twig rendering
2021-03-19 11:49:39 +01:00
Molkobain
f1d05ae9b5 Fix missing use statement 2021-03-19 11:38:24 +01:00
Molkobain
2f73256c94 Improve PHPDoc on cmdbAbstractObject::GetShortcutActions() to flag it as an API to overload the 'shortcut_actions' config. param. 2021-03-19 11:19:02 +01:00
Stephen Abello
a353b1fdc1 N°3530 Fix "No new message" dict entry call 2021-03-19 10:35:28 +01:00
Eric
7d3992eeaf N°2677 - Datamodel: Consider hierarchy for classes style 2021-03-19 10:23:29 +01:00
Molkobain
7b8e551662 N°3581 - Dashlet badge: Add HTML tooltip to ease readability on truncated text 2021-03-19 09:42:23 +01:00
Molkobain
075470dabb Add title to config. management dashboard 2021-03-19 09:25:13 +01:00
Molkobain
f567f581c3 N°3581 - Dashlet plain text: Fix line returns while keeping XSS protection 2021-03-18 20:22:55 +01:00
Molkobain
b3e3a27555 Add title to welcome dashboard 2021-03-18 20:06:45 +01:00
Molkobain
28dcfcffd0 N°3581 - Dashlet header static: Fix separators length 2021-03-18 18:21:21 +01:00
acognet
c214d09e84 N°2841 - Error when trying to delete a user with a no admin 2021-03-18 18:20:34 +01:00
Pierre Goiffon
46680d3854 🎨 ITopCounter : use KeyValueStore::class where possible instead of class name hardcoded in a string 2021-03-18 17:50:39 +01:00
Molkobain
9a0ea60cd7 N°3581 - Dashlet: Fix max. width for DashletBadge 2021-03-18 17:10:59 +01:00
Molkobain
3d14aedcd8 N°3581 - Dashlet: Fix double-encoding on DashletPlainText 2021-03-18 16:50:33 +01:00
Molkobain
a28c9c896d N°3581 - Dashlet: Remove coupling with DashletText in DashletHeaderStatic 2021-03-18 16:50:33 +01:00
Molkobain
912f6bb376 N°3581 - Dashlet: Add dedicated block for DashletText 2021-03-18 16:50:33 +01:00
Stephen Abello
e23b60c203 Set maximum height/width on global search results class icons 2021-03-18 16:14:15 +01:00
Molkobain
547038aae8 N°3581 - Dashlet: Rename DashletHeaderStatic template to match conventions 2021-03-18 15:59:23 +01:00
Molkobain
8137bc0ca9 N°3581 - Dashlet: Rework header static look to match tabs separator 2021-03-18 15:59:22 +01:00
Pierre Goiffon
7a67218ad1 📦 Update setup.css 2021-03-18 15:45:46 +01:00
Stephen Abello
8471bdeffe N°3542 Separate JS buttons from URL buttons 2021-03-18 15:39:19 +01:00
acognet
82a5ab5aef N°3823 - Error on "Header with statistics dashlet" with autorefresh and filter on organization 2021-03-18 14:50:18 +01:00
Pierre Goiffon
3959ed505b 🎨 dashlet-badge.js : restore leading semicolon
See added info in js/README.md on reason why this semicolon has to be there
2021-03-18 12:12:08 +01:00
Molkobain
5320f3f5fd N°3581 - Panel: Fix titles font 2021-03-18 11:55:01 +01:00
Molkobain
72b2feb697 N°3581 - Dashlet: Add max-width and tooltip on pills 2021-03-18 11:55:01 +01:00
Molkobain
ac91bc8898 N°3581 - Dashlet: Fix pill not being completely clickable 2021-03-18 11:55:00 +01:00
Molkobain
ca2c66733c N°3581 - Dashlet: Rename Badge block to Pill as it can contain just a simple text and to avoid confusion with the DashletBadge 2021-03-18 11:55:00 +01:00
Molkobain
8ce2e43780 PHPDoc 2021-03-18 11:55:00 +01:00
Eric
118d6ff837 N°3648 - Fix Bulk modify 2021-03-18 11:41:57 +01:00
Eric
5869591167 N°2847 - Transform old itop datatable to jquery DataTable (fix dictionaries) 2021-03-18 10:51:55 +01:00
Eric
de5efe19b2 N°3536 - Dashboard: Finish integration of in the TopBar (rollback old css) 2021-03-18 10:42:45 +01:00
Stephen Abello
33d8bf07b1 Destroy previous tooltip when force initializing a new one 2021-03-18 10:41:59 +01:00
Eric
818690dba8 N°3825 - Export.php and export-v2.php errors on Excel 2021-03-18 10:27:21 +01:00
Eric
e35076f682 N°3536 - Button order in object details 2021-03-18 09:28:12 +01:00
Pierre Goiffon
de8761ea61 💡 Fix PHPDoc errors made in cd170be4
* fix typo in used-by (thanks @Molkobain !)
* add class before method name as needed for our phpdoc generator (see .doc/README.md)
2021-03-17 19:09:42 +01:00
Pierre Goiffon
0ad65691d3 🚧 AjaxPage::output add TODO 3.0.0 as there is lot of code we have disabled in 410a637598 2021-03-17 18:22:44 +01:00
Pierre Goiffon
cd170be44e 💡 Add UIBlock::Get*FilesRelPaths PHPDoc to indicate consumer 2021-03-17 18:22:44 +01:00
Stephen Abello
ecc9733623 N°3530 Correctly place the popup and limit its height 2021-03-17 17:35:16 +01:00
Stephen Abello
bab2febb24 N°3530 Replace hardcoded newsroom message indicator and add tooltip when menu is collapsed 2021-03-17 17:35:16 +01:00
Pierre Goiffon
610ff6494a Fix typo 2021-03-17 17:06:44 +01:00
Molkobain
be4012ea5d Fix missing images for jQuery treeview lib 2021-03-17 16:44:41 +01:00
Molkobain
7fec31e775 PHPDoc 2021-03-17 16:05:33 +01:00
BenGrenoble
52a939578c N°3814 add DashboardMenuNode delta if_exists in datamodel.itop-config-mgmt.xml 2021-03-17 15:51:55 +01:00
odain
8fce088e6f Merge branch 'support/2.7' into develop 2021-03-17 15:26:19 +01:00
Molkobain
5452286d8d Fix utils::GetClassesForInterface() not working on Windows env. (courtesy from @Steffunky) 2021-03-17 13:13:57 +01:00
Pierre Goiffon
50fc7f753e N°3566 Migrate Hub Connector land.php
* add html allowing to create send request
* change popup positionning (setup container was resized in 3.0.0 from 600px to 800px, with different padding/borders in children boxes)
2021-03-17 11:02:11 +01:00
Pierre Goiffon
8c2d54e6d3 🎨 code format : Hub connector land.php 2021-03-17 11:02:11 +01:00
Stephen Abello
a8ede8b857 N°3524 Add keyboard shortcuts to global actions 2021-03-17 11:00:16 +01:00
Stephen Abello
8dd8f98b61 Migrate method to get classes implementing specified interface to utils 2021-03-17 10:57:26 +01:00
Stephen Abello
fac6d1741e Allow inputs to be disabled and readonly 2021-03-17 10:57:26 +01:00
Stephen Abello
6b6db02567 Fix UIblock class extending interface collection 2021-03-17 10:57:26 +01:00
Molkobain
2a1b58e2c1 Deprecated old history APIs 2021-03-17 10:30:46 +01:00
Molkobain
19d61300bb Object details: Fix object class displayed as code instead of label 2021-03-17 10:10:22 +01:00
Molkobain
599c838fd9 Fix code highlighting instantiation for async (XHR) markup 2021-03-17 10:07:24 +01:00
Molkobain
b97e2839c5 N°3531 - Activity panel: Restore possibility to load extra history entries asynchroniously 2021-03-17 10:07:24 +01:00
Molkobain
190ac1a65a Fix tooltips instantiation for async (XHR) markup 2021-03-17 10:07:23 +01:00
Molkobain
6bc2d241fd Activity panel: Rename controller's method 2021-03-17 10:07:23 +01:00
acognet
a15903b5ef N°3823 - Error on "Header with statistics dashlet" with autorefresh and filter on organization 2021-03-17 09:57:03 +01:00
Eric
0da945ee29 N°3536 - Dashboard: Finish integration of in the TopBar 2021-03-16 18:28:18 +01:00
Molkobain
d2f6ac5015 Activity panel: Refactor to use the new JsonPage and a dedicated controller for more readability 👌 2021-03-16 16:40:34 +01:00
Molkobain
0d7302d530 JsonPage: Overload constructor to avoid passing a title 2021-03-16 16:40:34 +01:00
acognet
f02c8e94d7 Add comment on code 2021-03-16 14:17:42 +01:00
acognet
1aeee8b671 functions MakeForSelect and MakeForSelectWithLabel placed in SelectUIBlockFactory 2021-03-16 14:17:42 +01:00
Molkobain
4bcf03c6a1 Activity panel: Fix only showing the first of multiple edition in a linked set 2021-03-16 11:02:29 +01:00
Eric
7c8349f4f5 N°3804 - auto refresh on group by dashlet (and dashlet badge) lost user preferences on showing obsolete data 2021-03-16 10:25:18 +01:00
odain
168d3c5b75 fix ci after merge from branch 'feature/3588-precompil-fix' 2021-03-16 08:46:48 +01:00
Molkobain
0d020bb706 Fix dashboard editor SCSS classes 2021-03-15 20:08:22 +01:00
Molkobain
5e5277f38e N°3534 - Dashboard: Add missing HTML meta data 2021-03-15 20:08:22 +01:00
vdumas
11fb507df3 N°3822 - Datamodel: caselogs reordering for UserRequest and Incident 2021-03-15 19:15:05 +01:00
vdumas
d68e208325 N°3821 - UserRequest:OnInsert in full ITIL calls the parent's method 2021-03-15 17:56:18 +01:00
odain
3afc4e8185 Merge branch 'feature/3588-precompil-fix' into develop 2021-03-15 17:44:10 +01:00
vdumas
85935eb5fd N°3274 - Add "Service family" menu in Service Management for Providers 2021-03-15 17:16:52 +01:00
odain
fcbb691c0a fix tests 2021-03-15 16:25:57 +01:00
BenGrenoble
20c6b72a0c N°3440 Fix Known Error Banner. 2021-03-15 16:21:19 +01:00
odain
9abd8eb223 fix merge 2.7.4 2021-03-15 16:06:50 +01:00
odain
eacdfa4088 Merge branch 'support/2.7' into develop 2021-03-15 16:06:20 +01:00
Molkobain
a15cc8718e N°3626 - Remove Attachment class from the "quick create" autocomplete 2021-03-15 15:56:36 +01:00
Molkobain
21321c0599 Fix regression introduced in 370c08cd 2021-03-15 15:48:37 +01:00
Pierre Goiffon
fccc57458c N°3522 Fix IssueLog on Twig error in a Ajax context 2021-03-15 14:53:24 +01:00
Pierre Goiffon
8b47536835 N°3522 Handle twig errors nicely for AJAX calls
Whereas when called directly we are throwing an exception, in a Ajax context we are printing the error message and logging
2021-03-15 14:42:28 +01:00
Molkobain
8dd96ea636 Copyright year bump 2021-03-15 09:29:45 +01:00
Molkobain
04d7980789 N°3657 - Replace calls to deprecate jQuery methods (".keyup(callback)" to ".on('keyup', callback)") 2021-03-15 09:29:26 +01:00
Molkobain
370c08cd68 N°3657 - Replace calls to deprecate jQuery methods (".click(callback)" to ".on('click', callback)") 2021-03-15 09:29:09 +01:00
Molkobain
e143fa5e33 N°3657 - Replace calls to deprecate jQuery methods (".submit(callback)" to ".on('submit', callback)") 2021-03-15 09:28:44 +01:00
Molkobain
614ba55819 N°3657 - Replace calls to deprecate jQuery methods (".blur(callback)" to ".on('blur', callback)") 2021-03-15 09:28:22 +01:00
Molkobain
f1613c62a4 N°3657 - Replace calls to deprecate jQuery methods (".bind" and ".unbind") 2021-03-15 09:28:06 +01:00
Molkobain
ca7a9bdbe2 N°2847 - Fix (raw) text field size & style 2021-03-13 18:16:27 +01:00
Molkobain
1caa9a3e15 Code format on inputs 2021-03-13 18:01:53 +01:00
Molkobain
c3140c2db3 Copyright year bump 2021-03-12 18:48:46 +01:00
Molkobain
ebada5e866 N°2844 - Document file: Fix object details not displaying correctly 2021-03-12 18:32:56 +01:00
Molkobain
0902f2c32b Update TODO 2021-03-12 18:04:11 +01:00
Molkobain
dfa85df39c Set attribute: Fix items display 2021-03-12 16:31:06 +01:00
Molkobain
d175bca3cc Set attribute: Fix field always displayed in error in edition
Note: As mentioned in the commit introducing this, this attribute type does not fit well in the error reporting mechanism
2021-03-12 14:21:19 +01:00
Molkobain
1aa61fe29b N°3748 - Deprecation: old tooltip libs in the backoffice and the portal 2021-03-12 11:15:04 +01:00
Molkobain
c1eee655dd Activity panel: Improve debug messages 2021-03-12 10:35:06 +01:00
Molkobain
6b8acc4b2f Sample data: Add Lotfi and Nicolas, welcome aboard! 👋 2021-03-12 10:24:34 +01:00
Molkobain
4ab6ace9fd Sample data: Format code 2021-03-12 10:20:32 +01:00
Molkobain
ed04836a8d Sample data: Change Stephen's avatar and name 2021-03-12 10:06:06 +01:00
Molkobain
3e92e6675d Sample data: Fix persons' email 2021-03-12 09:57:04 +01:00
Molkobain
2710f945d8 PHPDoc 2021-03-12 09:48:35 +01:00
Molkobain
bdc8fe9db3 Session messages: Introduce severity constants 2021-03-12 09:46:34 +01:00
Molkobain
33d72890fa Fix warning session message colors 2021-03-12 09:35:54 +01:00
Molkobain
59b5092e3b Login: Fix forms' inputs width (reset pwd & change pwd) 2021-03-12 09:21:55 +01:00
Molkobain
9daaf4a9f7 Code cleanup 2021-03-12 09:02:29 +01:00
Molkobain
40d002d9e8 N°3649 - Activity panel: Add notifications 2021-03-12 09:02:29 +01:00
Molkobain
3380b8896a Fix UserRights::GetUserInitials() for login starting with a lower case letter 2021-03-12 09:02:29 +01:00
Molkobain
c1564fdcc6 Activity panel: Log debug message if an entry could not be created from a CMDBChangeOp 2021-03-12 09:02:29 +01:00
Molkobain
d7bab12542 Activity panel: Improve OQL to not process case log entries twice 2021-03-12 09:02:29 +01:00
Pierre Goiffon
21a6be1bda 🔊 N°3811 UI.php : update error log
We had 2 catch blocks that were doing almost the same thing... But the last IssueLog call !

Now we have only one catch block, and the last IssueLog call is for Debug instead of Error : ErrorPage::error is already doing IssueLog::Error, so those extra info are now logged only for debugging purpose (in the 'console' channel)
2021-03-11 15:21:32 +01:00
Pierre Goiffon
e49b0db58d N°3522 Handle twig errors nicely
Revert what was done in c5021721 : I then added a panel to be rendered instead of throwing an Exception. This was done because the exception was displayed in a blank page... But this was caused simply by a missing `use Exception` !!

So now we're back at throwing an exception, so that the standard mechanism for throwing the error page is triggered.

Handling Twig recursion is mandatory, and done in the beginning of the \Combodo\iTop\Application\TwigBase\Twig\TwigHelper::RenderTemplate catch block to avoid adding on each stack level a useless exception.
2021-03-11 15:20:41 +01:00
acognet
4932a2cfbd N°2284 - Manage button Clear and add placeholder 2021-03-11 10:41:41 +01:00
acognet
e376f13263 N°3787 - Use data loader for auto refresh 2021-03-11 10:40:04 +01:00
acognet
fe5d5f3869 N°3648 - FIx size of DataTable 2021-03-11 10:32:52 +01:00
acognet
710e6e49a8 Dict entries 2021-03-11 10:29:14 +01:00
acognet
ba1cc00d03 N°3787 - Use data loader for auto refresh 2021-03-11 10:07:48 +01:00
Pierre Goiffon
bd7837b14c N°3566 Hub connector migrate to UiBlock : launch page
Reset some iTop core styles to get back the previous rendering
Also use iTop classes for title and buttons
2021-03-10 18:15:14 +01:00
Pierre Goiffon
3ef307fada 🎨 HubConnectorPage : code formatting 2021-03-10 17:17:28 +01:00
Pierre Goiffon
979e73e376 N°3566 Hub connector migrate to UiBlock : deployed extensions page
Add Hub icon to the button 🤩
2021-03-10 17:02:27 +01:00
Pierre Goiffon
fe70db9af6 💡 PHPDoc : replace link by see
Thanks @Molkobain !
I wrote to much JavaDoc where it is the opposite :/
PhpDoc ref :
https://docs.phpdoc.org/3.0/guide/references/phpdoc/index.html
2021-03-10 15:59:33 +01:00
Pierre Goiffon
3501d39877 💡 N°3522 PHPDoc 2021-03-10 14:41:03 +01:00
Stephen Abello
233efa43c7 N°3560 Fix Impact analysis export popup menu 2021-03-10 11:24:03 +01:00
Stephen Abello
725e635016 N°3560 Fix Impact analysis focus indicator 2021-03-10 11:23:59 +01:00
Pierre Goiffon
a948c3c54e N°3566 Hub connector migrate to UiBlock : deployed extensions page
Hub button is back between fieldsets. it is also now primary and has a specific css class applied
2021-03-10 11:15:42 +01:00
Pierre Goiffon
a763ecbfc5 N°3566 Hub connector migrate to UiBlock : deployed extensions page
Change layout when no Hub extension present
Use warning alert for the no extension message, split the corersponding dict key
2021-03-10 11:07:37 +01:00
Pierre Goiffon
fab1c0bcf8 N°3566 Hub connector migrate to UiBlock : deployed extensions page
Notable changes :
* extensions lists were originally UL/LI but I replaced them with Alert neutral, collapsed by default
* the "Get extensions from iTop Hub..." button was located between both fieldset. I moved it on top of the page, just below page title
2021-03-09 17:53:59 +01:00
odain
377120aead fix merge 2021-03-09 15:48:34 +01:00
odain
577ae34b50 Merge branch 'support/2.7' into develop 2021-03-09 15:40:30 +01:00
Pierre Goiffon
fa7d316dbf N°3803 Fix error when opening dashboard page with non admin user 2021-03-09 12:32:18 +01:00
Pierre Goiffon
570b012000 N°3750 fix body data-ready-scripts attribute not visible
Was using .data() instead of .attr :(
Was already changed in 8efc688f for other attributes, but I forgot this one :/
2021-03-09 11:16:21 +01:00
Pierre Goiffon
9f06e82171 🎨 N°3566 Hub connector : code format 2021-03-09 09:56:06 +01:00
acognet
0f3df3a436 N°3746 - Fix CSV export 2021-03-08 17:00:41 +01:00
Pierre Goiffon
c5021721c6 N°3522 Display error alert for twig rendering errors 2021-03-08 16:41:58 +01:00
Pierre Goiffon
1a3e8c59c7 💡 Update PHPDoc for enums in \Combodo\iTop\Renderer\BlockRenderer::RenderJsInline 2021-03-08 16:41:58 +01:00
Pierre Goiffon
210051c12d 💡 Update deprecated comment in SetupPage
Just removed the unnecessary "since"
See https://docs.phpdoc.org/latest/guide/references/phpdoc/tags/deprecated.html#deprecated
2021-03-08 16:41:58 +01:00
Pierre Goiffon
998c3208f6 RenderAllUiBlocks : new alert collapsible but not closable 2021-03-08 16:41:57 +01:00
Stephen Abello
9c8b2328db N°3578 Display all attributes without pagination in datamodel viewer table 2021-03-08 16:15:18 +01:00
Stephen Abello
b300b76783 Add display options to static datatables 2021-03-08 16:15:17 +01:00
Stephen Abello
ef871fba7f N°3515 Update some classes icon to match 3.0 UI 2021-03-08 16:15:17 +01:00
Eric
1f90ccdb1f PHPDoc 2021-03-08 15:00:40 +01:00
acognet
5f217d75bb N°3746 - Migrate modal to new UIBlock system 2021-03-05 17:43:45 +01:00
Stephen Abello
a4d8fb0b4c Fix method name 2021-03-05 16:33:59 +01:00
Stephen Abello
fe0f57c00d Correct type hint and update PhpDoc 2021-03-05 16:33:59 +01:00
acognet
57bd868580 N°3746 - Migrate modal to new UIBlock system 2021-03-05 14:57:51 +01:00
acognet
e1b50c1dcd N°2844 - Fix Title display 2021-03-05 14:57:51 +01:00
Molkobain
256c01dff4 Panel: Fix panel icon being wrongly displayed as medallion when within a panel with in fact a medallion icon 2021-03-05 12:53:03 +01:00
Molkobain
085855cdc5 Revert fix for tooltips in AjaxPage as pages with "application/json" content type actually return the HTML templates... 🤦‍♂️(eg. breaks the autocomplete results)
- Fix only for ext. key modal
2021-03-05 12:40:19 +01:00
Molkobain
bbbc5e966b Fix tooltips not activated in AjaxPage 2021-03-05 12:33:24 +01:00
Molkobain
18d4685007 Code format 2021-03-05 12:29:57 +01:00
Stephen Abello
7f1b1ca662 N°3515 Update some classes icon to match 3.0 UI 2021-03-05 11:59:50 +01:00
Molkobain
b54918bb5e N°3649 - Fix object form display in modals 2021-03-05 11:57:40 +01:00
Molkobain
56b27897cf AjaxPage: Fix tabs handling UIBlocks incorrectly (put at the end of the flow, not in the tab container)
Note: Big part of the code was duplicated and still is... This should be but in a trait maybe to avoid this kind of error in the future?
2021-03-05 11:51:20 +01:00
Molkobain
1beae731bf Advanced search: Fix class selection dropdown displayed in raw HTML 2021-03-05 10:58:00 +01:00
Molkobain
30b691243b Panel: Fix type declaration for title and subtitle 2021-03-05 10:57:15 +01:00
Molkobain
4cb9cc7d68 Panel: Refactor title as a block container (like subtitle) 2021-03-05 10:53:24 +01:00
Molkobain
fc98bc781b Panel: Add SetSubtitleBlock() 2021-03-05 10:16:16 +01:00
Molkobain
a1b6f09115 Panel: Code formatting 2021-03-05 10:15:39 +01:00
Molkobain
642bb8b131 Object details: Fix "Call to a member function GetMainColor() on null" 2021-03-05 09:50:44 +01:00
Molkobain
1eae57a401 Code cleanup 2021-03-05 09:50:43 +01:00
acognet
5a18bfbd6f N°2844 - Fix Title display 2021-03-05 09:38:29 +01:00
Pierre Goiffon
bedc997c3f 📦 Update setup.css 2021-03-05 09:36:26 +01:00
Stephen Abello
fd991c951e Missing class import in portal's attachments 2021-03-05 09:27:11 +01:00
acognet
45beda3f26 N°2284 - Add tooltips on buttons in select and autocomplete box 2021-03-05 09:17:50 +01:00
acognet
7b4b9fb68c N°2284 - Add tooltips on buttons in select and autocomplete box 2021-03-05 09:17:08 +01:00
Molkobain
71db321570 N°3792 - Deprecate "buttons_position" config. param. 2021-03-04 19:27:25 +01:00
Molkobain
29bf4561e5 Change default color for classes (global pass will be done during beta) 2021-03-04 18:55:02 +01:00
Molkobain
377eb36509 Update PHPDoc and add todo for R&D review 2021-03-04 18:29:06 +01:00
Molkobain
2afbae9c89 Update autoloaders 2021-03-04 18:16:45 +01:00
Molkobain
1e64e0c741 Panel: Remove PanelEnhanced as the Panel now has all the necessary options 2021-03-04 18:16:45 +01:00
Molkobain
3bc130c802 Fix object details' panel highlight color 2021-03-04 18:00:28 +01:00
Molkobain
99295634a6 Migrate abstract class creation page 2021-03-04 18:00:27 +01:00
Molkobain
1d7bc7c8f7 N°2844 - Refactor Panel to include a configurable header
- TitleForObjectDetails no longer exists, use the ObjectDetails's properties instead
2021-03-04 18:00:26 +01:00
Molkobain
4e22906180 Move vertical tab container SCSS into blocks integration partial 2021-03-04 17:59:34 +01:00
Molkobain
9bdccb0fb3 N°2847 - Add method to add several blocks at once to a content area (tUIContentAreas) 2021-03-04 17:59:34 +01:00
Molkobain
cf956099ac N°2844 - Add iUIContentBlock::HasSubBlocks() helper 2021-03-04 17:59:34 +01:00
Molkobain
101a100c1f N°2844 - Toolbar: Remove margins from SCSS partial as they will be part of the block integration (post beta) 2021-03-04 17:59:34 +01:00
Molkobain
824fc19323 Code format 2021-03-04 17:59:33 +01:00
Molkobain
6c20f74b90 Code cleanup 2021-03-04 17:59:33 +01:00
Eric
b4ce1b7ae6 N°3790 - Class selection not working on UniversalSearch and Tags Configuration pages 2021-03-04 17:21:50 +01:00
Eric
e397cee40d N°3785 - Use DownloadPage to download documents 2021-03-04 17:15:25 +01:00
Eric
e3b7914759 N°3785 - Use DownloadPage to download documents 2021-03-04 17:00:17 +01:00
Pierre Goiffon
8efc688ff8 N°3750 data-input-type Ajax refresh : use .attr() only
This attributes value must be get using `.attr()` only, and never .data()
This is what we adopted in the rest of the application.

The `.data()` method must only be used when dealing with large data structure. When having only strings like here, it is OK to store them in the DOM
2021-03-04 16:57:39 +01:00
Eric
622b486d1f N°3785 - Use DownloadPage to download documents 2021-03-04 16:37:33 +01:00
Stephen Abello
226c301d92 N°3722 Hide field description tooltip if it has the same content as field label 2021-03-04 16:32:46 +01:00
Stephen Abello
61a7822db3 N°3560 Only zoom into impact analysis when it has mouse focus 2021-03-04 16:13:14 +01:00
Stephen Abello
9b15750b02 N°3560 Fix Impact analysis altering tabs height 2021-03-04 16:13:14 +01:00
Stephen Abello
64754f982c N°3560 Fix Impact analysis size flickering when refreshing 2021-03-04 16:13:13 +01:00
Pierre Goiffon
675dcda86d N°3750 Fix data-input-type modification not visible in the DOM 2021-03-04 15:52:48 +01:00
Pierre Goiffon
5748ea3a74 N°3750 Fix data-input-type refreshed to "" for autocomplete
The $sInputType var init was commited in 6a5c4788 but removed by accident in b2050a88
2021-03-04 15:44:40 +01:00
Eric
5ccd229092 N°3648 - Fix "Configure this list..." 2021-03-04 15:37:13 +01:00
Stephen Abello
88e502ad7a N°3706 Unescape fieldset labels 2021-03-04 14:46:02 +01:00
acognet
72f6305320 N°3648 - FIx click on link in datatable and display of buttons in search form 2021-03-04 11:47:49 +01:00
Stephen Abello
45981c1941 N°3571 Handle errors in Audit Category and Audit Rule in audit page 2021-03-04 11:42:12 +01:00
Stephen Abello
4d660cc3c8 N°3578 Migrate Datamodel viewer to new style 2021-03-04 10:55:23 +01:00
Stephen Abello
f231fa47a0 Add max height to panelenhanced icon 2021-03-04 10:55:23 +01:00
Stephen Abello
40ceccda46 Add jquery treeview style to vendors directory 2021-03-04 10:55:23 +01:00
Stephen Abello
866d6e829b Allow to add Html to side panel block 2021-03-04 10:55:23 +01:00
Stephen Abello
6d7d6e9531 Hide icon in Panel enhanced if no icon is provided 2021-03-04 10:55:22 +01:00
Stephen Abello
ad0fdfe921 Allow Select options to be disabled 2021-03-04 10:55:22 +01:00
Pierre Goiffon
c2c69d9f43 💡 N°3750 PHPDoc 2021-03-04 09:32:02 +01:00
Molkobain
133e5003cd Reorder some config. params. 2021-03-03 16:26:08 +01:00
Molkobain
f97eb794ba Rename config. param. "display_menus_count" to "navigation_menu.show_menus_count" 2021-03-03 16:24:49 +01:00
Molkobain
7a8a3cbce8 N°3649 - Activity panel: Show confirmation dialog when leaving page with draft entries 2021-03-03 15:59:12 +01:00
acognet
2fb8f21b58 Fix Css problems 2021-03-03 12:01:37 +01:00
acognet
c631f28e53 N°3528 - Finish silo selection migration - fix css of button 2021-03-03 10:59:24 +01:00
Stephen Abello
66909ce19a Fix typo in last partial import 2021-03-03 10:40:07 +01:00
Stephen Abello
eca3782bda Fix typo in SCSS partial name 2021-03-03 10:27:38 +01:00
Stephen Abello
a5c2e20a02 N°3570 Migrate Synchro replica page 2021-03-03 10:22:52 +01:00
Stephen Abello
05fff3b8aa Fix external key hyperlinks in datatables when outside of /pages directory 2021-03-03 10:22:52 +01:00
Stephen Abello
175aebaa14 N°3570 Migrate Synchro data source page 2021-03-03 10:22:52 +01:00
Molkobain
cf4e023695 Fix SCSS partial name 2021-03-03 10:12:34 +01:00
acognet
1d58e7d6f8 N°3634 - Remove orange arrow 2021-03-02 18:36:51 +01:00
Molkobain
282842fa2c Object details: Fix image being squashed 2021-03-02 18:30:02 +01:00
Molkobain
748a22c728 Fix SCSS compile error due to wrong import 2021-03-02 18:30:02 +01:00
acognet
bd47ca34df N°3634 - Add count for results 2021-03-02 17:22:11 +01:00
acognet
e27b6b2dde N°3785 - Fix corrupted attribute file on download 2021-03-02 16:39:51 +01:00
acognet
9a7074bcba N°2284 - Fix manual clear of autocomplete field. 2021-03-02 16:39:50 +01:00
Stephen Abello
bedd6b5fcc N°3571 Forgot to commit icons (again 🤦) 2021-03-02 16:28:24 +01:00
Stephen Abello
0638f79c2b Remove changes commited with abcf73f that were only meant to test obsolete/archived behavior 2021-03-02 16:00:18 +01:00
Stephen Abello
abcf73f233 N°2844 N°3570 Bring back Synchronized, Obsolete and Archived tags next to object name 2021-03-02 15:56:31 +01:00
Molkobain
52113233b8 N°2844 - Restore table style on final page of an object deletion 2021-03-02 14:50:35 +01:00
bruno-ds
9cbaced1f3 Merge remote-tracking branch 'origin/support/2.7' into develop
# Conflicts:
#	core/config.class.inc.php
#	datamodels/2.x/itop-core-update/view/SelectUpdateFile.html.twig
#	datamodels/2.x/itop-core-update/view/SelectUpdateFile.ready.js.twig
#	setup/setuputils.class.inc.php
#	test/setup/SetupUtilsTest.php
2021-03-02 14:34:19 +01:00
Pierre Goiffon
77d4613bd8 N°3750 Allow to detect when ready scripts are done processing
In iTop 3.0.0 there are sometimes lots of scripts launched after domReady, so we needed something to know when those scripts are done !
2021-03-02 12:18:45 +01:00
Pierre Goiffon
225c176f71 N°3750 data-input-type : change XHR detection method
I added WebPage::IsAjaxPage, but this wasn't a good idea as XHR isn't really related to the Page impl used !
Instead we're now using the new method \utils::IsXmlHttpRequest which is a copy of \Symfony\Component\HttpFoundation\Request::isXmlHttpRequest
Many thanks @Molkobain !
2021-03-02 12:13:27 +01:00
Stephen Abello
a850d3b67c N°3571 Fix audit errors title 2021-03-02 12:09:29 +01:00
Stephen Abello
74a434ab04 N°3571 Migrate audit page to new style 2021-03-02 12:04:56 +01:00
Stephen Abello
f8e0a28134 N°3650 Datatable within panels take all available space 2021-03-02 12:04:45 +01:00
Stephen Abello
d7d156303f Fix static datatables width not using available space 2021-03-02 12:04:32 +01:00
Stephen Abello
c30b1dd379 Add padding to title block 2021-03-02 12:02:09 +01:00
Stephen Abello
2daa1d93e9 Add style to block csv 2021-03-02 12:02:09 +01:00
Stephen Abello
556388f2f4 Delete unused scss file 2021-03-02 12:02:09 +01:00
Stephen Abello
752508b724 Make panels collapsible 2021-03-02 12:02:09 +01:00
Molkobain
cf72c2ef8f N°3649 - Activity panel: Add conf. param. 'activity_panel.entry_form_opened_by_default' as a default value for the user pref. 2021-03-02 11:33:52 +01:00
Molkobain
3b40728701 N°3649 - Activity panel: Add user pref. to define whether the entry form should be opened by default 2021-03-02 09:32:06 +01:00
Molkobain
e3015a284b N°3629 - Activity panel: Add possibility to close the panel 2021-03-02 09:32:06 +01:00
Molkobain
1cdedec33d Portal: Fix typo in log messages 2021-03-02 09:32:06 +01:00
acognet
291e1d0c30 N°3634 - Feedback alpha 3.0 : finish list - Fix css 2021-03-01 18:19:23 +01:00
acognet
c2dc2c6100 N°2284 - display results on first click on down arrow for autocomplete 2021-03-01 18:19:23 +01:00
acognet
65dbaf427c N°2284 - Fix select when there is only one option 2021-03-01 18:19:23 +01:00
acognet
0e146bf341 N°3634 - Feedback alpha 3.0 : finish list - add menu 2021-03-01 18:19:23 +01:00
acognet
fbb4455250 N°3634 - Feedback alpha 3.0 : finish list - order of buttons 2021-03-01 18:19:23 +01:00
acognet
b2050a8895 N°3648 - Feedback alpha 3.0 : finish relation edition - tabulation 2021-03-01 18:19:23 +01:00
acognet
d601e9608c N°3746 - Migrate modal to new UIBlock system 2021-03-01 18:19:22 +01:00
Pierre Goiffon
c679318d16 N°3750 data-input-type : refresh attribute on AJAX refresh 2021-03-01 16:48:12 +01:00
Pierre Goiffon
7a8a78d348 🙈 Add README files to exclude for build 2021-03-01 11:44:37 +01:00
acognet
cebbc215d7 N°3746 - Migrate modal to new UIBlock system 2021-03-01 09:07:09 +01:00
Pierre Goiffon
1060c0ca94 N°3750 Set input type for linkedset 2021-03-01 08:58:36 +01:00
Eric
fb321fa034 Fix ContextTag usage, and add some explanations on the declaration of ContextTag 2021-02-26 16:47:02 +01:00
Eric
925e45782c Fix indexation script and protection for concurrency with cron 2021-02-26 14:05:26 +01:00
Pierre Goiffon
6a5c47887a N°3750 New data-input-typeattribute to fields container
This will allow easiest DOM manipulation in BeHat tests !
2021-02-26 12:16:29 +01:00
Pierre Goiffon
267f3ec7ca 🎨 \UIExtKeyWidget 2021-02-26 11:13:54 +01:00
Pierre Goiffon
9907e4af58 Fix TODO 3.0 2021-02-26 11:01:41 +01:00
Stephen Abello
a505902ed5 Add string subtitle to panels 2021-02-26 10:27:49 +01:00
Stephen Abello
25c840e036 Rename subtitle block variable in PanelEnhanced 2021-02-26 10:27:49 +01:00
Eric
da4cf8b661 N°3739 - Change dashboard menu entries (Fix dashboard edition) 2021-02-26 09:33:56 +01:00
Stephen Abello
a7fde78105 Fix unmigrated Attachment constant in portal 2021-02-25 17:45:46 +01:00
Eric
39f30a059b N°3739 - Change dashboard menu entries 2021-02-25 16:29:25 +01:00
vdumas
a6f4b30004 N°3735 - New method AddValue on DBObject for Designer users 2021-02-25 16:09:21 +01:00
Stephen Abello
4ce3631e4b Rename some vendors variables to keep consistency 2021-02-25 10:09:06 +01:00
Stephen Abello
7ed906f1c3 Fix medallion image class name 2021-02-25 10:09:05 +01:00
Stephen Abello
1a43d5afd7 Move blocklist and medallion icon integration in a dedicated file 2021-02-25 10:09:05 +01:00
Molkobain
db0c796218 Activity panel: Fix click on "compose" button doing nothing when on a "read-only" case log tab
Note: The behavior is not implemented yet, but it's the following the same path as when the user is on the "activity" tab
2021-02-25 09:52:18 +01:00
Molkobain
1c7f72d1f8 Activity panel: Fix typos (thanks @jbostoen) 2021-02-25 09:52:18 +01:00
Molkobain
5770000e65 Caselog entry form: Fix event name 2021-02-25 09:52:18 +01:00
Molkobain
ad7b78b871 Activity panel: Set focus in input when clicking on "Compose" button 2021-02-25 09:52:17 +01:00
Pierre Goiffon
4d78f4b535 N°3750 Fix syntax for array key
Thanks @Molkobain !
2021-02-24 20:09:32 +01:00
Pierre Goiffon
30cddeae2d N°3750 Fix no data-input-id attribute for status attribute 2021-02-24 18:42:59 +01:00
Pierre Goiffon
c8911f1fa9 N°3750 Add data-input-id to field container
This will allow easiest DOM manipulation in BeHat tests
2021-02-24 17:19:55 +01:00
Molkobain
8295920c3c Preferences: Update translations 2021-02-24 17:01:12 +01:00
Molkobain
a284087460 Impact analysis: Use new tooltip API to allow interactions with their hyperlinks 2021-02-24 16:23:35 +01:00
Molkobain
c5a6f441aa CombodoTooltip: Improve API
- Add "data-tooltip-interaction-enabled" to allow user to interact with the tooltip content (select, click). Possible values "true"|"false"
- Add "data-tooltip-append-to" to choose to which element the tooltip should be append. Possible values "body"|"parent"|<JQUERY_SELECTOR>
2021-02-24 16:17:12 +01:00
Molkobain
9dc0a052bf Activity panel: Fix hard-coded localized sentence 2021-02-24 14:55:19 +01:00
Stephen Abello
61b5a3924e N°2844 Migrate Impact Analysis to new design 2021-02-24 14:46:17 +01:00
Stephen Abello
99cb5ffb37 Add sliders to jqueryui style 2021-02-24 14:46:17 +01:00
Stephen Abello
e0ae2706de Migrate jQuery multiselect style to 3.0 design 2021-02-24 14:46:17 +01:00
Stephen Abello
8dfdc4761e N°2844 Fix Impact Analysis pdf export 2021-02-24 14:46:16 +01:00
Molkobain
9723a346b6 Activity panel: Change "case log" to "log" in dictionary (fits best the general cases, not just the helpdesk world) 2021-02-24 14:26:44 +01:00
Molkobain
1667a0a6df Fix spacing / sizing for "obsolescence" icon on external keys 2021-02-24 13:28:39 +01:00
Molkobain
cdfdfc75ab Preferences: Regroup preferences relative to the UI into a single panel 2021-02-24 13:10:34 +01:00
Molkobain
a33b1303d2 CombodoTooltip: Enable interaction with tootlip's content (selection, click, ...) 2021-02-24 11:23:56 +01:00
Molkobain
56a1a82ec8 Fix typo 2021-02-24 09:00:33 +01:00
Molkobain
22ffb4ecee PanelFactory: Fix neutral panel default to color to proper constant 2021-02-23 19:39:23 +01:00
Molkobain
ad93d6dd41 N°3629 - Activity panel: Add "activity_panel.show_author_name_below_entries" config. param. to show the author friendlyname under the last entry 2021-02-23 15:24:20 +01:00
Molkobain
affb869116 Reformat parameter 2021-02-23 13:28:34 +01:00
Molkobain
fa39846cc8 N°3629 - Activity panel: Add "activity_panel.datetimes_reformat_limit" config. param. to define the limit after which all dates / times should be displayed in absolute format 2021-02-23 13:25:19 +01:00
Molkobain
3d4e63416f N°2847 - Title: Fix empty space on the left of the subtitle when no status 2021-02-23 13:11:56 +01:00
Molkobain
9586bd7dea N°3629 - Activity panel: Fix state attribute changes on a class without transition is now displayed as a "state change" instead of an "edit" 2021-02-23 13:05:52 +01:00
Molkobain
0f3eb53554 Update deprecation comment 2021-02-23 13:05:52 +01:00
Stephen Abello
c757b5051e Simplify medallion icon calls in cmdbabstract and fix an issue with notifications 2021-02-23 11:31:09 +01:00
Stephen Abello
fbe173444e Fix object details width when using vertical tabs 2021-02-23 11:26:46 +01:00
Stephen Abello
770d96cdec Fix medallion icon block scss variables 2021-02-23 11:23:21 +01:00
Stephen Abello
b0a1371122 Fix class icon being too big in displaybarerelations 2021-02-23 10:48:58 +01:00
Stephen Abello
defa1e40e1 Add medallion icon block 2021-02-23 10:48:58 +01:00
bruno-ds
c3cb4fbe75 Fix merge wrongfully performed
(thanks @molkobain & @piRGoif & @odain-cbd)
2021-02-23 10:24:49 +01:00
Molkobain
88f45a69b1 N°3649 - Activity panel: Show warning message when lock expired (/ was removed by an admin.) 2021-02-23 09:39:57 +01:00
Molkobain
1a44406d70 N°3649 - Activity panel: Fix compose button being under entries 2021-02-23 09:39:56 +01:00
Molkobain
837d1824b1 Code cleanup: Remove useless code 2021-02-23 09:39:56 +01:00
Molkobain
2bf23f0618 N°3629 - Activity panel: Fix case logs not saved during object creation 2021-02-23 09:39:56 +01:00
bruno-ds
26bbdc1a57 Merge remote-tracking branch 'origin/support/2.7' into develop
# Conflicts:
#	application/cmdbabstract.class.inc.php
#	application/utils.inc.php
#	dictionaries/en.dictionary.itop.core.php
#	dictionaries/fr.dictionary.itop.core.php
#	setup/setuputils.class.inc.php
2021-02-23 08:58:29 +01:00
Molkobain
933bddebe3 Image attribute: Migrate deprecated jQuery methods in JS widget 2021-02-22 16:25:55 +01:00
Molkobain
9c0966ff42 Image attribute: Add upload button 2021-02-22 16:23:45 +01:00
Molkobain
0b60079c07 Fix typo 2021-02-22 15:08:21 +01:00
Molkobain
083f50a5d4 Fix typo 2021-02-22 13:53:41 +01:00
Stephen Abello
c8ede0e8da Fix forced CombodoTooltip::InitAllNonInstantiatedTooltips instantiation when tooltip has already been instantiated 2021-02-22 13:42:28 +01:00
Stephen Abello
2b69ca2f04 Change da77439 events to use DataTables builtin events instead of custom ones 2021-02-22 13:37:35 +01:00
Molkobain
9bbec47976 Move tooltips JS helpers to dedicated class "CombodoGlobalToolbox => CombodoTooltip" 2021-02-22 13:02:52 +01:00
Molkobain
5bde218076 Code cleanup: Remove obsolete IE JS polyfills 2021-02-22 12:56:20 +01:00
Stephen Abello
a4a88cd63a Fix placeholder wrong nodes 2021-02-22 10:27:00 +01:00
Stephen Abello
da77439e1e Fix tooltips in datatables and add events to datatables init and draw actions 2021-02-22 09:51:12 +01:00
Stephen Abello
f61ec3179a Placeholders now keep their aspect ratio even when displaying in large screen 2021-02-20 10:53:03 +01:00
Molkobain
147e240035 Code cleanup: Remove migrated SCSS rules 2021-02-19 22:17:58 +01:00
Molkobain
cc747ebef7 Move style properties to SCSS variables 2021-02-19 22:15:14 +01:00
Molkobain
5e86183d40 Fix email/phone attribute decoration's spacing (whole thing still needs rework though) 2021-02-19 22:12:02 +01:00
Molkobain
f04a5dbfef N°2844 - Fix image attribute display and editing 2021-02-19 22:01:51 +01:00
Molkobain
1c0177f711 Add possibility to force tooltip re-instantiation on CombodoGlobalToolbox.InitAllNonInstantiatedTooltips() 2021-02-19 20:53:05 +01:00
Molkobain
a1893a115f Tabs: Fix scrollable tab's skeleton on very wide screens 2021-02-19 19:23:29 +01:00
Molkobain
4a227c7ed2 Tabs: Fix scrollable tab's separator width on very large screen 2021-02-19 19:14:09 +01:00
Molkobain
5e21ec03cd Rename constants according to @steffunky 's advice (better DX) 2021-02-19 18:35:20 +01:00
Stephen Abello
ea502e9c81 Allow to set a customized placeholder for ajax tabs in scrollable mode 2021-02-19 17:38:47 +01:00
Molkobain
e5d8c885bc N°2844 - Object details: Refine object's name, class and status size and placement 2021-02-19 16:21:35 +01:00
Stephen Abello
7327025aac N°3670 Move dictionary entry back to module 2021-02-19 14:42:15 +01:00
Stephen Abello
952280ecc6 N°3670 Fix drag and drop glitching in Chrome 2021-02-19 13:57:14 +01:00
Molkobain
4d8930832e N°3649 - Activity panel: Add concurrent lock mechanism 2021-02-19 12:34:42 +01:00
Molkobain
c59301ebc6 Attachments: Fix SSL certificate warning on edition 2021-02-19 12:34:42 +01:00
Molkobain
cb338e1ce5 Case log form entry: Protection against general form not found when in bridge mode 2021-02-19 12:34:42 +01:00
Molkobain
146089e021 Button: Add default name attribute for cancel button 2021-02-19 12:34:42 +01:00
Molkobain
6634f3981e Concurrent lock: Fix modal's button to match new convention 2021-02-19 12:34:41 +01:00
Molkobain
38c6f8c76f Concurrent lock: Fix ownership handler in the backoffice
- Lost lock message will only be displayed once instead of being stacked every 60s 🤪
- Action buttons (except "Cancel") are disabled when the lock expires (regression from 3.0.0)
- Modal window is now larger
2021-02-19 12:34:41 +01:00
Stephen Abello
00008528a6 N°3560 Remove useless code 2021-02-19 12:31:39 +01:00
Stephen Abello
cc4727ad95 N°3560 Avoid reloading remote tabs when clicking multiple times on its tab 2021-02-19 11:54:25 +01:00
Stephen Abello
e650297ded N°3560 Add placeholder and a button to load remote tabs in scroll mode 2021-02-19 11:45:06 +01:00
Stephen Abello
be38bca83d Fix bad HTML markup when having OnDisplayRelations in objects 2021-02-18 16:17:35 +01:00
Stephen Abello
8a13cdbcff Fix badly escaped line return 2021-02-18 15:41:12 +01:00
acognet
27ee6fec70 N°3634 - Feedback alpha 3.0 : finish list 2021-02-18 15:39:38 +01:00
acognet
4e0c21a2ac N°3634 - Feedback alpha 3.0 : finish list 2021-02-18 14:49:28 +01:00
Molkobain
1e18a5ce07 Revert line that wasn't supposed to be commited yet 🙈 2021-02-18 09:34:01 +01:00
Molkobain
10d5ca50fc Add "error" colors to the semantic palette 2021-02-18 09:10:59 +01:00
Molkobain
4770123be5 N°3549 - Activity panel: Fix crash when cancelling object modification 2021-02-17 18:10:14 +01:00
Stephen Abello
a6daa577e8 N°3560 Fix object's tabs not opening tab specified in url's hash 2021-02-17 17:34:27 +01:00
Stephen Abello
b7c7b05243 Fix dashlet sanitization 2021-02-17 17:34:27 +01:00
Molkobain
acf721befa Fix object's tabs IDs in the URL (regression introduced by 1fc54edf) 2021-02-17 17:24:22 +01:00
Molkobain
f297cdb8b2 N°3549 - Activity panel: Fix inline images in caselogs 2021-02-17 12:47:24 +01:00
Molkobain
b39b09c33c Code cleanup 2021-02-17 12:42:55 +01:00
Stephen Abello
bdec220d7e N°3723 Restyle attachment drag and drop and add a better user experience 2021-02-17 11:04:38 +01:00
Stephen Abello
666d0d418f Rename MAX_SIZE_FOR_PREVIEW const to DEFAULT_MAX_SIZE_FOR_PREVIEW 2021-02-17 10:54:17 +01:00
Stephen Abello
ea04a6e1c9 Add semicolon to button js 2021-02-17 10:24:44 +01:00
Stephen Abello
5e56a08768 Fix not showing filename next to upload buttons 2021-02-17 09:54:42 +01:00
acognet
6879cd762c N°2598 - When refreshing a list, loosing page and order - improvement of code 2021-02-16 15:05:06 +01:00
Stephen Abello
8f0e665c68 Refactor "sanitize_identifier" and "sanitize_variable_name"custom TWIG functions to "sanitize(FOO)" 2021-02-16 10:32:03 +01:00
Stephen Abello
aa326a1276 Revert wrongfully deleted file in 003d9107 2021-02-16 09:23:48 +01:00
Stephen Abello
e0127d330a N°3670 Remove tiff file from attachment previewable filetypes 2021-02-16 09:22:26 +01:00
acognet
32469b3421 Refactor "sanitize_identifier" and "sanitize_variable_name"custom TWIG functions to "sanitize(FOO)" 2021-02-16 09:16:19 +01:00
acognet
4cafd41944 Refactor "sanitize_identifier" and "sanitize_variable_name"custom TWIG functions to "sanitize(FOO)" 2021-02-16 09:09:02 +01:00
acognet
4f7760ed86 N°3540 - Migrate printable version of an object 2021-02-15 18:17:32 +01:00
acognet
c039d0f81d 2284 - Replace JQuery Autocompleter plugin by JQuery UI Autocomplete widget - Cleanup tableHover 2021-02-15 17:43:36 +01:00
odain
4870893fc2 N°2982 - Speed up SCSS themes compilation during setup : fix precompiled css theme generated 2021-02-15 17:26:17 +01:00
odain
e2940150c3 N°2982 - Speed up SCSS themes compilation during setup : create a php file dedicated to CompileCSSService/FindStylesheetObject 2021-02-15 17:26:17 +01:00
acognet
dbe747ea23 N°2598 - When refreshing a list, loosing page and order - change of dashboard refresh mecanism 2021-02-15 16:55:03 +01:00
acognet
4c23f1f32b N°3648 - Feedback alpha 3.0 : finish relation edition 2021-02-15 16:55:03 +01:00
acognet
c1c8fad97e N°3648 - Feedback alpha 3.0 : finish relation edition 2021-02-15 16:55:03 +01:00
Stephen Abello
bcdb6bdac8 N°3670 Display filetype icons in portal attachment display 2021-02-15 16:52:21 +01:00
Stephen Abello
36991a3d5b N°3670 Add more filetype to be displayed as preview icon 2021-02-15 16:52:21 +01:00
Stephen Abello
003d9107a4 N°3670 Remove attachment legacy filetype icons 2021-02-15 16:52:21 +01:00
Stephen Abello
e8f26bdf18 N°3670 Add a parameter to chose max file size to be displayed as a preview icon 2021-02-15 16:52:21 +01:00
Stephen Abello
a53485d08f N°3670 Replace attachment "delete" button with an icon button 2021-02-15 16:52:21 +01:00
Stephen Abello
7e46054f8b Add a destructive icon link factory for Button block 2021-02-15 16:52:20 +01:00
Stephen Abello
789ee8e2d1 N°3670 Revert tooltip preview behavior back to 2.7 one 2021-02-15 16:52:20 +01:00
Molkobain
eea8ceda63 Refactor "sanitize_identifier" and "sanitize_variable_name"custom TWIG functions to "sanitize(FOO)"
Note: FOO is one of \utils::ENUM_SANITIZATION_FILTER_XXX
2021-02-15 16:28:34 +01:00
Molkobain
44587663bb Add "get_module_setting" as a custom TWIG function 2021-02-15 16:21:39 +01:00
odain
c36d650d61 N°2982 - Speed up SCSS themes compilation during setup : fix broken style 3.0 after setup 2021-02-15 15:20:31 +01:00
Molkobain
f716e42672 Rename 'variable_name' TWIG filter to 'sanitize_variable_name' to keep consistency with other filters (eg. 'sanitize_identifier') 2021-02-15 13:50:57 +01:00
Molkobain
3b288ce5d6 Typo 2021-02-15 13:50:56 +01:00
Molkobain
e485853b08 N°3549 - Activity panel: Fix drag / drop of images during object edition 2021-02-15 13:50:56 +01:00
Eric
244de6915d N°3700 - Restyle SessionMessage 2021-02-12 17:40:31 +01:00
vdumas
874f2f63a8 Merge remote-tracking branch 'origin/develop' into develop 2021-02-12 11:25:59 +01:00
odain
71a65606a1 Revert "N°2982 - Speed up SCSS themes compilation during setup : take cascaded included imports in theme precompilation + class/method documentation cleanup"
This reverts commit c8dd19c22f.
2021-02-12 11:24:14 +01:00
vdumas
a8c834b1e9 N°3495 WorkOrder: on closure set end_date only if empty 2021-02-12 11:05:39 +01:00
odain
c8dd19c22f N°2982 - Speed up SCSS themes compilation during setup : take cascaded included imports in theme precompilation + class/method documentation cleanup 2021-02-12 09:46:30 +01:00
Eric
9ad204244a N°3565 - Migrate backoffice pages to new UIBlock system : Setup (fix some fonts) 2021-02-11 18:02:34 +01:00
nv35
a5052ef42b 🔊 Print data source id in synchro_exec output (#183)
As it is possible to execute multiple data source sync in one command run, print the corresponding data source name before its output.
2021-02-11 16:47:10 +01:00
Eric
68f7880d42 Force theme compilation in development environment 2021-02-11 14:31:52 +01:00
Eric
f4241142c5 Fix crash when a module is removed and some classes remains in the creation history 2021-02-11 14:31:52 +01:00
Pierre Goiffon
1cc48c8d8e 💄 iTop 3.0.0 badge dashlet : make whole badge clickable (#191)
Would be better to have only one handler on the dashboard side but we want to respect code responsibility !
So until we have a system for components to print "static" code (that will be printed only once whatever number of component instances we have in the page), we are doing it the "old" way : calling a JQuery widget in the component JS Twig.
2021-02-11 12:09:06 +01:00
Molkobain
ebb80a9b05 N°3649 - Activity panel: Fix case log entries truncated to first character in edit mode 2021-02-10 21:30:02 +01:00
Molkobain
8d8f6f7ed5 Typo 2021-02-10 21:17:49 +01:00
Molkobain
e6c0333915 N°3545 - Activity panel: Change caselogs order so it's defined by the details zlist 2021-02-10 18:20:04 +01:00
Stephen Abello
3be360dfb9 N°3670 Add new file upload button 2021-02-10 17:19:40 +01:00
Stephen Abello
d08adc43c1 N°3670 Fix useless slashes in tooltip 2021-02-10 17:19:39 +01:00
Stephen Abello
3361c9de29 PHPDoc 2021-02-10 17:19:39 +01:00
Eric
0eff37844b Add UIBlocks to twig (Fix deprecation warning) 2021-02-10 16:21:11 +01:00
vdumas
5f3d5a593c N°2639 - Enrich dictionary for notify flag on Contact 2021-02-10 16:17:57 +01:00
Stephen Abello
e74ee179af N°3670 Replace/add new Attachment type icons 2021-02-10 15:52:56 +01:00
Stephen Abello
d8006b160c N°3670 Migrate Attachment list to new UI 2021-02-10 15:52:56 +01:00
bruno-ds
f328e58c02 N°3721 - toolkit's "update iTop" with the "Create symbolic links" option checked now empty the compiled directory as expected 2021-02-10 15:35:38 +01:00
Eric
19270a9dde N°3563 - Migrate backoffice pages to new UIBlock system : Preferences (partial fix for favorite organizations and shortcuts) 2021-02-10 14:31:19 +01:00
Eric
91fd69e0bd N°3563 - Migrate backoffice pages to new UIBlock system : Preferences (fix newsroom icon) 2021-02-10 10:53:01 +01:00
Eric
3b220b6050 N°3676 - Fix Subnet creation (missing default values) 2021-02-10 09:21:33 +01:00
Eric
4ceccb3c41 Add setup.css for initial setup 2021-02-10 09:01:03 +01:00
Eric
47fdc47d33 enhance Application Updater 2021-02-09 18:18:11 +01:00
Eric
ed4cf4ff05 Fix File Select widget 2021-02-09 18:18:11 +01:00
Eric
d332787deb Provide font CSS classes 2021-02-09 18:18:11 +01:00
Eric
55a6f85252 Fix toolbar spacer 2021-02-09 18:18:11 +01:00
vdumas
aacf3700f4 Merge remote-tracking branch 'origin/develop' into develop 2021-02-09 17:48:04 +01:00
Eric
9ed2127530 Add File Select widget 2021-02-09 17:24:27 +01:00
vdumas
eac9d7adfb N°3495 - Simplify WorkOrder Data model 2021-02-09 16:51:42 +01:00
Eric
3c60e4f765 Add Toolbar factory, Use new factory entry for cancel buttons, better check of twig errors, fix fatal error page 2021-02-09 14:43:46 +01:00
Molkobain
e11252a2d6 PHPDoc 2021-02-08 22:41:45 +01:00
Molkobain
99564d75b7 N°3560 - Fix AJAX tabs not having correct spacing 2021-02-08 22:40:21 +01:00
Molkobain
26e54b8796 Typo 2021-02-08 19:17:07 +01:00
Eric
eaa507bc70 N°3245 - Move filter of trigger on object update after object update (fix attribute change detection) 2021-02-08 16:21:35 +01:00
Eric
91752b4068 N°3565 - Migrate backoffice pages to new UIBlock system : Setup (fix bad escaping) 2021-02-08 14:20:12 +01:00
Molkobain
82b7854d46 N°3649 - Activity panel: Refactor the way we access the CKEditor instance 2021-02-08 12:24:05 +01:00
Molkobain
08ea82cf05 N°3649 - Activity panel: Fix entries not being filtered on initialization 2021-02-08 12:24:05 +01:00
Molkobain
6e99701c47 N°3649 - Case log entry form: Change buttons text and style
- Change "Save" button to "Send"
- Change "Cancel" button to the new convention
2021-02-08 12:24:05 +01:00
Molkobain
aa0fb2b8f7 N°3649 - Activity panel: Move case log entry form above toolbar's actions 2021-02-08 12:24:05 +01:00
Molkobain
6710ffa334 N°3649 - Activity panel: Improve colors separation for case logs 2021-02-08 12:24:04 +01:00
Molkobain
0664a42f99 N°3649 - Activity panel: Fix toolbar wrapping with large labels 2021-02-08 12:24:04 +01:00
Molkobain
73f6c697b9 N°3649 - Activity panel: Fix wrong elapsed time displayed under entries after a new entry has been added 2021-02-08 12:24:04 +01:00
Molkobain
15c5a22d11 N°3649 - Activity panel: Add tooltip on compose button 2021-02-08 12:24:04 +01:00
Molkobain
40c112d47a N°3649 - Activity panel: Show confirmation dialog on multiple case logs entries submission 2021-02-08 12:24:04 +01:00
Molkobain
4a2cbc9be3 N°2847 - Navigation menu: Change default expanded/collapsed behavior
- Keep previous value (iTop 2.7 and older) if present
- Otherwise, collapsed by default
- Also renamed the user pref. to match new conventions
2021-02-08 12:24:04 +01:00
Molkobain
a91b6dbca3 Fix URL with special chars being output wrong (completes c98881671) 2021-02-08 12:24:03 +01:00
Molkobain
5c85af10c5 N°3649 - Activity panel: Reorganized methods for more readability 2021-02-08 12:24:03 +01:00
Molkobain
8026965915 N°3649 - Activity panel: Work on multiple caselogs edition at once 2021-02-08 12:24:03 +01:00
Molkobain
5f00362805 Add CombodoJSConsole JS helper to output messages in the different console channels without having to check it exists before.
Note: This could be used later as an entry point to manipulate the log and do something with it (format, persist, ...)
2021-02-08 12:24:03 +01:00
Molkobain
648a3cc430 N°3649 - Activity panel: Improve UX on "indeterminated" filters' checkboxes 2021-02-08 12:24:03 +01:00
Molkobain
977d1d0246 N°3649 - Activity panel: Continue improvement following the alpha feedbacks
- Add possibility to choose which caselogs are displayed in any tab
- Change case log entry form submit button label from "Add entry" to "Save"
2021-02-08 12:24:02 +01:00
Molkobain
222fab27d1 N°3649 - Activity panel: Continue improvement following the alpha feedbacks
- Update messages counters globally (not per caselog)
- Hide messages counter when no caselog
2021-02-08 12:24:02 +01:00
Molkobain
a48d850721 N°3649 - Activity panel: Code cleanup 2021-02-08 12:24:02 +01:00
Molkobain
599c4ebad8 N°3649 - Activity panel: Continue improvement following the alpha feedbacks
- Change caselog entry form, now 1 per caselog
- Remove entry form from activity tab
- Change entries filters, now present on all tabs but states are specific to each tab
2021-02-08 12:24:02 +01:00
Molkobain
4f9d133670 Activity panel: Rename some variables/methods for a better meaning 2021-02-08 12:24:01 +01:00
Molkobain
9a4f956153 N°3649 - Activity panel: Code cleanup
- Move entry form toggler SCSS to proper file
- Rename entry form toggler
2021-02-08 12:24:01 +01:00
Molkobain
927fd980f6 N°2844 - Make activity panel and object details scroll independently (generic page layout) 2021-02-08 12:24:01 +01:00
Molkobain
446512793b N°2847 - Simplify SCSS rules according to guidelines 2021-02-08 12:24:01 +01:00
Molkobain
7f55fd4bf6 N°3649 - Activity panel: Continue improvement following the alpha feedbacks
- Fix compose button visible when no editable caselog
- Fix "states" filter visible on object with no state attribute
- All tabs now have all the actions / filters
- Initial active tab is now the first one (caselog or activity)
2021-02-08 12:24:01 +01:00
Eric
0c7925cdfb N°3565 - Migrate backoffice pages to new UIBlock system : Setup (fix bad escaping) 2021-02-08 11:58:52 +01:00
Eric
96faad7539 N°3565 - Migrate backoffice pages to new UIBlock system : Setup (fix some fonts) 2021-02-08 11:30:25 +01:00
Eric
69189ab41a Merge branch 'support/2.7' into develop 2021-02-08 10:42:19 +01:00
bruno-ds
2ddeebdc78 Readonly alert now has an id
in order to be interacted with (browser side).
2021-02-05 09:59:52 +01:00
Pierre Goiffon
d312bf74b9 N°3537 run_query : fix fatal error class not found when running query with parameters
Factory weren't renamed in this file :/
Regression brought by 5fe8ca17
2021-02-04 16:08:59 +01:00
Pierre Goiffon
f83f606d92 💄 N°3227 Change Query.is_template look
From list to radio_horizontal
2021-02-04 15:57:00 +01:00
odain
857ae5fd95 N°2982: code cleanup following review 2021-02-04 15:44:14 +01:00
odain
265b5dd969 ci/testing work: categorize tests via phpunit @group tags 2021-02-04 15:28:36 +01:00
odain
d7c7ef8332 ci/testing work: categorize tests via phpunit @group tags 2021-02-04 15:07:44 +01:00
odain
54f8ef924f N°2982: theme precompilation fix work even when coming from /extensions or /datamodels/X.x 2021-02-04 14:20:35 +01:00
Pierre Goiffon
2e2b7f96f2 N°2334 Fix unable to display finalClass on remote class in view/edit lnk relations
Don't filter finalClass anymore when viewing object in \MetaModel::GetZListAttDefsFilteredForIndirectRemoteClass
Also added some type hinting
2021-02-04 11:57:02 +01:00
acognet
34d9eb2d96 Fix js files loading 2021-02-03 11:59:50 +01:00
acognet
f5d89de177 N°2737 - Migrate table to DataTables plugin to be iso with the end-users portal - fix popup direct link 2021-02-03 11:55:27 +01:00
acognet
53c4c14522 Fix js files loading 2021-02-03 11:07:07 +01:00
acognet
ff44fcdfe0 N°331 - L'ordre de tri des tickets change au rechargement auto - add ability to give to Menu how to refresh the panel 2021-02-03 11:07:07 +01:00
vdumas
2eae1e81d1 Enrich dictionary for notify flag on Contact 2021-02-02 18:59:52 +01:00
Pierre Goiffon
ecd282faf1 N°3253 setup redirection : update to be more accessible
Was only doing a redirection using JS
Now we also have a message with a link, plus a meta refresh.

JS redirection was kept as this is quicker than meta refresh (message isn't visible, whereas it is when having meta refresh only)
2021-02-02 18:16:46 +01:00
Stephen Abello
f1d047becf Add a Factory for 'Cancel' buttons, make 'Cancel' buttons alternative, make buttons uppercase 2021-02-02 16:17:03 +01:00
Stephen Abello
50af5d9af1 Add semi bold font to typography 2021-02-02 16:14:33 +01:00
Stephen Abello
494789c02e N°3669 Replace Monorale with Raleway (+ lining figures) 2021-02-02 15:30:33 +01:00
Stephen Abello
63929566d9 Remove debug line from setup 2021-02-02 15:30:33 +01:00
odain
ed3df37176 Merge branch 'feature/3606-twigbase-controller-basichtml' into develop 2021-02-02 11:27:06 +01:00
odain
c736615de1 N°3606: clean symfony useless import 2021-02-02 11:24:06 +01:00
odain
5121ed7c39 N°3606: move whitelist feature from itop core to cbd-mon extension 2021-02-02 10:49:55 +01:00
Eric
4f4ea5c6fa N°3565 - Migrate backoffice pages to new UIBlock system : Setup (move variable) 2021-02-02 08:50:48 +01:00
odain
29a1539379 N°3464: remove useless require in ItopDataTestCase and fix CIs 2021-02-01 18:29:39 +01:00
Eric
2a15fbae4d N°3567 - Migrate backoffice pages to new UIBlock system : App. upgrade (removed spinner) 2021-02-01 18:02:36 +01:00
Eric
7b5b1c58d3 N°3567 - Migrate backoffice pages to new UIBlock system : App. upgrade (fix backup status) 2021-02-01 17:58:14 +01:00
Eric
82bf2dab2c N°3567 - Migrate backoffice pages to new UIBlock system : App. upgrade (fix status) 2021-02-01 17:42:57 +01:00
Eric
694899980c N°3567 - Migrate backoffice pages to new UIBlock system : App. upgrade (fix last button) 2021-02-01 17:19:02 +01:00
Eric
749ab51651 N°3567 - Migrate backoffice pages to new UIBlock system : App. upgrade (fix last button) 2021-02-01 16:44:06 +01:00
Eric
fa973c5467 N°3567 - Migrate backoffice pages to new UIBlock system : App. upgrade (setup page look) 2021-02-01 16:29:31 +01:00
Eric
2f68be14f8 N°3565 - Migrate backoffice pages to new UIBlock system : Setup 2021-02-01 16:28:10 +01:00
annProg
664dd12241 use strlen() replace empty() 2021-02-01 12:11:31 +01:00
annProg
03190b95cf fix search error when search string '0' 2021-02-01 12:11:31 +01:00
Molkobain
da632c3f0f N°2847 - Improve panel integration regarding the mockups (not done yet) 2021-02-01 12:08:39 +01:00
Molkobain
43290c0ff5 Advanced search: Update unitary tests for PR #170 2021-02-01 12:08:39 +01:00
Pierre Goiffon
590b094ad5 N°3253 setup php check : only use Composer platform_check 2021-02-01 09:38:08 +01:00
Pierre Goiffon
b3e3fe2dc2 🎨 setup index : remove warnings at file end 2021-02-01 08:47:56 +01:00
Pierre Goiffon
d863881591 setup index : remove empty line at the beginning of file 2021-02-01 08:46:45 +01:00
Pierre Goiffon
3e5d0f53d2 N°3253 setup : now displays iTop error instead of Composer platform_check 2021-02-01 08:44:20 +01:00
Pierre Goiffon
29df7fda7e N°3253 setup : change require to trigger Composer's platform_check 2021-02-01 08:35:31 +01:00
Stephen Abello
9ebf0ce1e5 N°3535 Migrate dashboard editor modal to new design 2021-01-29 17:04:00 +01:00
odain
2bb1583995 N°3606: renaming 2021-01-29 10:39:41 +01:00
odain
b98ffc4b8b N°3606: add IP inside iTop error message 2021-01-29 10:01:46 +01:00
odain
818b3632ac N°3606: renaming 2021-01-29 09:24:17 +01:00
Molkobain
7d1a2668a1 N°2847 - Fix object details properties's margins 2021-01-27 21:23:03 +01:00
odain
7677bd7cfe N°3606: authorized_network configured as a list of ip address or networks (no more regexp, IpUtils::checkIp syntax) 2021-01-27 14:36:33 +01:00
acognet
c98881671b Fix name of files : in order to manage the use of "&" character in url 2021-01-27 11:14:54 +01:00
acognet
ef1b7ca82c Remove useless log 2021-01-27 11:14:54 +01:00
acognet
d39d634aba 2284 - Replace JQuery Autocompleter plugin by JQuery UI Autocomplete widget - fix autocomplete on short lists, tab and autoselect item when there is only one option 2021-01-27 11:14:53 +01:00
acognet
c65a760de7 Fix css file-input 2021-01-27 11:14:53 +01:00
Molkobain
8fba402016 N°3208 - Quick create: Fix error when choosing a class from another page than UI.php 2021-01-26 20:15:46 +01:00
Molkobain
0922baee7b Core update: Fix form CSS classes 2021-01-26 20:05:26 +01:00
Molkobain
2a68f13ade Core update: Fix container classes 2021-01-26 16:45:26 +01:00
Eric
2ba01bb408 N°3245 - Move filter of trigger on object update after object update 2021-01-26 16:40:04 +01:00
Molkobain
8c19bc66e4 Core update: Fix not fully fixed (!) regression crashing the confirmation step 2021-01-26 16:24:00 +01:00
Pierre Goiffon
87ee0b8893 📝 N°2329 add PHP bug reference 2021-01-26 16:14:28 +01:00
Eric
92c8af1b19 N°3468 - Fix extension.xml preventing extensions installation 2021-01-26 16:08:30 +01:00
Pierre Goiffon
b85b4d0067 N°3663 Group exception classes in /application/exceptions
Original files kept for compatibility issues :
- core/coreexception.class.inc.php

There are remaining exceptions in /core/oql, but those files are generated
2021-01-26 15:50:26 +01:00
Stephen Abello
5762ac38a7 Add a test (only handle bcrypt and legacy sha256 as we have to maintain PHP 7.1 compatibility) 2021-01-26 09:20:39 +01:00
Stephen Abello
dc804a90d4 Add a setter for config param, use a constant to hold the default hash algo value 2021-01-26 09:20:39 +01:00
Sam B
968720f774 Update core/ormpassword.class.inc.php
Co-authored-by: Thomas Casteleyn <thomas.casteleyn@me.com>
2021-01-26 09:20:39 +01:00
Sam B
7b5244b52d fix docu
Co-authored-by: Thomas Casteleyn <thomas.casteleyn@me.com>
2021-01-26 09:20:39 +01:00
SamB
30d4835fbb ormPassword: allow use of different password hash algo 2021-01-26 09:20:39 +01:00
bruno-ds
dd921e49b6 rollback unit test since the root cause was elsewhere 2021-01-25 10:44:14 +01:00
Molkobain
33a8372409 Core update: Fix regression crashing the confirmation step 2021-01-25 09:26:41 +01:00
Pierre Goiffon
5125a86f8b Merge remote-tracking branch 'origin/support/2.7' into develop 2021-01-25 09:21:36 +01:00
Eric
b241f03e76 N°3294 - Introduce counters in OQL menu entries (support shortcuts) 2021-01-22 17:43:33 +01:00
Eric
306452679e N°3294 - Introduce counters in OQL menu entries (add comment) 2021-01-22 17:24:26 +01:00
Molkobain
880b88a4ef Code formatting 2021-01-22 17:20:08 +01:00
Molkobain
16dc6b36ba Rename class to match used lib. 2021-01-22 17:20:08 +01:00
Molkobain
7e67661d5f N°3649 - Activity panel: Improve ActivityPanel::IsCaseLogsSubmitAutonomous() robustness 2021-01-22 17:20:08 +01:00
Eric
397cd9b946 N°3294 - Introduce counters in OQL menu entries (fix typo) 2021-01-22 17:19:10 +01:00
Eric
3d29a1e894 Add UIBlocks to twig (Add... methods can be called by specifying their name in the parameters) 2021-01-22 17:16:56 +01:00
Eric
2d93879e7a Add UIBlocks to twig (Add... methods can be called by specifying their name in the parameters) 2021-01-22 17:11:48 +01:00
Pierre Goiffon
4217fa8736 🔧 editor config : fix scss+twig indent
As decided during today's dev team meeting !
We had tab set in .editorConfig in those files, but most of the codebase had 2 spaces for scss and 4 spaces for twig => we decided to change .editorConfig rules to match existing code base

Also adds last PHPStorm version new options
2021-01-22 16:37:57 +01:00
Eric
ff69f9af89 N°3294 - Introduce counters in OQL menu entries (fix when org_id is empty) 2021-01-22 15:42:57 +01:00
Pierre Goiffon
1b2087e52e N°3568 Backup various improvements
- fix path not displayed if not existing
- fix HTML code in warnings & errors
2021-01-22 12:19:52 +01:00
Molkobain
3b31a36473 Navigation menu: Better fix for the previous regression 2021-01-22 12:12:34 +01:00
Molkobain
43fdcab528 Navigation menu: Fix regression introduced in previous commit 2021-01-22 12:08:52 +01:00
acognet
49c2d0c10e N°3528 - Finish silo selection migration 2021-01-22 12:02:44 +01:00
Eric
9db246eb42 N°3438 - Setup: Ignore vendor folder during setup extensions scan 2021-01-22 11:48:25 +01:00
acognet
f1cad5993b N°3528 - Finish silo selection migration 2021-01-22 11:47:17 +01:00
acognet
76fc4e3ee2 Remove development logs 2021-01-22 11:47:17 +01:00
Pierre Goiffon
86dbd8d7a6 N°3568 Update backup page for UiBlocks 2021-01-22 11:46:29 +01:00
Molkobain
36457da4f2 Navigation menu: Remove unnecessary condition 2021-01-22 11:39:49 +01:00
Molkobain
e646dc8a69 Code formatting 2021-01-22 11:39:49 +01:00
Molkobain
1bb6d62c17 PHPDoc and code conventions 2021-01-22 11:39:49 +01:00
Molkobain
2ed785fb06 Restore comment for future refactoring 2021-01-22 11:39:48 +01:00
Eric
01006e55c0 N°3294 - Introduce counters in OQL menu entries (fix when silo changes) 2021-01-22 11:19:14 +01:00
Stephen Abello
46b4990252 N°3632 Move tab's layout preference to preferences page 2021-01-22 10:30:12 +01:00
Eric
b3f1b0e610 N°2677 - Datamodel: Add style definition for class, enum (better tests) 2021-01-22 10:14:25 +01:00
Eric
14d8646734 N°2677 - Datamodel: Add style definition for class, enum (fix wrong conversions) 2021-01-22 09:56:28 +01:00
acognet
5dcddf2317 N°3294 - Introduce counters in OQL menu entries 2021-01-21 17:24:44 +01:00
Stephen Abello
b8aeef1d71 N°3538 * New design for modals
* Fix date picker style
* Move jQueryUI style to vendors/ stylesheet folder
2021-01-21 16:41:06 +01:00
Molkobain
fa0ea7ed77 N°3207 - Global search: Add possibility to open history items in a new tab 2021-01-21 15:52:36 +01:00
acognet
63c1a1d2d3 Fix multi reload of UI.php and js files 2021-01-21 15:35:48 +01:00
Eric
154156f4a1 N°3423 - Allow AttributeImage / AttributeDocument content to be cached by the browser (portal) 2021-01-21 15:24:26 +01:00
acognet
8f1d9fba57 N°3528 - Finish silo selection migration 2021-01-21 15:20:10 +01:00
Molkobain
26d25706f2 UIBlock: Use GetAdditionalCSSClassesAsString() instead of GetAdditionalCSSClasses()|join(' ') in TWIGs 2021-01-21 14:38:05 +01:00
Molkobain
574bd53c37 UIBlock: Fix typo introduced during refactor of the previous commit 2021-01-21 13:00:49 +01:00
Molkobain
1514cd83ab UIBlock: Change $aAdditionalCSSClasses methods to match app. conventions (parameters should be arrays, not space separated string)
Note: This had to be fixed on all calls to this, hence the number of modifications.
2021-01-21 12:59:30 +01:00
Molkobain
7c8019319a UIBlock: Update PHPDoc, fix typo in $aJsTemplatesRelPath property/methods name and fix $aAdditionalCSSClasses initialization 2021-01-21 12:40:42 +01:00
Pierre Goiffon
882fd761a6 🐛 Fix wrong display in dashboards and search pages
Was introduced by f723862d
2021-01-21 11:25:32 +01:00
Eric
3df48f69c6 fix typo 2021-01-21 10:50:24 +01:00
Pierre Goiffon
f723862def Pull up additionalCSSClasses from Button & UiContentBlock to UiBlock
This will allow to use this everywhere !

Before this commit we had :
UiContentBlock
  aCSSClasses
  GetCssClasses
  SetCssClasses // reset + add, existing callers
  AddCSSClasses
Button
  $aAdditionalCSSClasses
  GetAdditionalCSSClass
  AddCSSClasses

Now we have :
UiBlock
  aAdditionalCSSClasses
  AddCSSClasses
  SetCSSClasses
  GetAdditionalCSSClass

Note that there were also some methods in PopoverMenuItem :
PopoverMenuItem
  SetCssClasses
  AddCssClass
  GetCssClasses
As they are indirection to methods in the $oPopupMenuItem attribute, I added to them the "MenuItem" prefix :
  SetMenuItemCssClasses
  AddMenuItemCssClass
  GetMenuItemCssClasses
Didn't find any use to change.
2021-01-21 10:49:31 +01:00
Eric
26f800d488 N°3423 - Allow AttributeImage / AttributeDocument content to be cached by the browser (console) 2021-01-21 10:44:23 +01:00
Eric
1fb15a421a Move class in its own file 2021-01-21 09:56:03 +01:00
Molkobain
4816d1e943 N°2847 - Add style for scrollbars throughout the whole application, not only the nav. menu 2021-01-20 19:01:32 +01:00
Molkobain
e440667d69 N°3649 - Activity panel: Set first case log as the active instead of the activity one 2021-01-20 19:01:31 +01:00
Molkobain
cebc51e045 N°3649 - Activity panel: Remove entry form from the activity tab, only case log tabs will have one 2021-01-20 19:01:31 +01:00
Molkobain
16ca856996 N°3532 - Activity panel: Add support for readonly / hidden flags on caselogs 2021-01-20 19:01:31 +01:00
Molkobain
cb955ee84f Remove unnecessary overloaded constants 2021-01-20 19:01:31 +01:00
Molkobain
de45557635 Update autoloaders 2021-01-20 19:01:30 +01:00
Molkobain
6ac1cc4831 N°3567 - PHPDoc and coding conventions fixes 2021-01-20 19:01:30 +01:00
Eric
959cecf891 N°3567 - Migrate backoffice pages to new UIBlock system : App. upgrade (Fix default values and typos) 2021-01-20 15:01:27 +01:00
Molkobain
d54e156ec2 N°3207 - Global search: Keep input open and focus at the end of the query when running a search 2021-01-20 11:04:17 +01:00
Eric
54c5c8c016 Merge remote-tracking branch 'origin/develop' into feature/MVCTwigTags3.0 2021-01-20 10:43:12 +01:00
Eric
9b67f7beba N°3567 - Migrate backoffice pages to new UIBlock system : App. upgrade (use ibo-is-hidden class to hide blocks) 2021-01-20 10:41:04 +01:00
Molkobain
b4caa97e69 Replace utils::HtmlEntities() with utils::EscapeHtml() in the global search and quick create blocks 2021-01-20 09:57:23 +01:00
Molkobain
de7cd679ba PHPDoc 2021-01-20 09:35:48 +01:00
Eric
392cdf6058 N°3567 - Migrate backoffice pages to new UIBlock system : App. upgrade (display twig errors) 2021-01-19 18:09:58 +01:00
Molkobain
8ddbadacec N°3207 - Global search: Fix current search not displayed in the history results 2021-01-19 17:44:07 +01:00
Eric
6dd1807fca N°3567 - Migrate backoffice pages to new UIBlock system : App. upgrade (remove UIHtml from twig) 2021-01-19 17:24:09 +01:00
Eric
01c4dff035 Add UIBlocks to twig (Changed classes name) 2021-01-19 17:23:09 +01:00
Molkobain
cb6a8fccb9 N°3207 - Global search: Fix "Tab" navigation no longer passing over history items 2021-01-19 17:10:52 +01:00
Eric
c15a60170d remove build scripts from autoload 2021-01-19 16:53:00 +01:00
Eric
82f4f47cf3 N°2737 - ExtraParams check in DisplayBlock 2021-01-19 16:51:10 +01:00
Molkobain
aa2651ca71 N°3208 - Quick create: Fix several items:
- Tab navigation no longer passing over history items
- Autocomplete results selection can now be done via up/down arrows
2021-01-19 16:00:30 +01:00
Molkobain
cb28ca7941 N°2836 - Change bubbles colors to something more neutral 2021-01-18 17:10:40 +01:00
Molkobain
527154f0be N°1957 - Navigation menu: Update hint sentence 2021-01-18 15:41:08 +01:00
Molkobain
f4b9b0b313 N°3628 - Navigation menu: Add visual hint on toggler when silo applied 2021-01-18 15:41:08 +01:00
Molkobain
daba1d3bba N°3628 - Navigation menu: Menu drawer can now be closed by clicking again on the active menu group 2021-01-18 15:41:08 +01:00
Molkobain
d57e368b03 N°3628 - Navigation menu: App. logo URL redirects to the home page by default, but is still customizable through 'app_icon_url' 2021-01-18 15:41:07 +01:00
Molkobain
9f962eb40f Add Config::IsCustomValue($sPropCode) method to know if a parameter has been changed or not 2021-01-18 15:41:07 +01:00
Eric
79d0b9543a Add UIBlocks to twig 2021-01-18 15:27:20 +01:00
Pierre Goiffon
7d9f73f650 N°3537 run_query : add missing tooltip on evaluate button
This extra text contains the shortcut info, so we must print this !
2021-01-18 14:55:17 +01:00
Eric
ace0657b7d Add UIBlocks to twig (Use file cache) 2021-01-18 13:59:29 +01:00
Eric
4afb374f6a N°3567 - Migrate backoffice pages to new UIBlock system : App. upgrade 2021-01-18 13:59:29 +01:00
Eric
648cfd9af4 Add UIBlocks to twig (Generalize IsHidden parameter) 2021-01-18 13:59:29 +01:00
Eric
5fe8ca178e Add UIBlocks to twig (CollapsibleSection, FieldBadge, Panel) 2021-01-18 13:59:28 +01:00
Eric
63eb0f1530 Add UIBlocks to twig (Spinner) 2021-01-18 13:59:28 +01:00
Eric
21740123f4 Add UIBlocks to twig (generic parser and node)
# Conflicts:
#	pages/run_query.php
#	test/VisualTest/Backoffice/RenderAllUiBlocks.php
2021-01-18 12:09:07 +01:00
Eric
2aae6cd744 Add UIBlocks to twig (Use sub-blocks for alerts and fields) 2021-01-18 12:03:33 +01:00
Eric
d8316a090a Add UIBlocks to twig (DataTable, Form, Input) 2021-01-18 12:03:32 +01:00
Eric
e51fd028fa Add UIBlocks to twig (changed UIContentBlock params) 2021-01-18 12:03:32 +01:00
Eric
bffb7b5eab Add UIBlocks to twig (new blocks) 2021-01-18 12:03:32 +01:00
Eric
77808ecd41 Add UIBlocks to twig (WIP) 2021-01-18 12:03:31 +01:00
Stephen Abello
2b798baffc N°3560 Add title to scrollable tabs content 2021-01-18 11:56:04 +01:00
odain
07347663d6 N°3606: php doc + handle empty token/whiteliste param usecase 2021-01-18 09:37:19 +01:00
odain
9ab1a0d437 N°3606: provide a token access instead of login + network white list restriction 2021-01-18 09:37:19 +01:00
Molkobain
04b4749510 N°1957 - Navigation menu: Show (dismissable) hint for the menu filter 2021-01-18 09:28:17 +01:00
Molkobain
ad6646afaf N°1957 - Navigation menu: Fix several bugs with menus filter
- Placeholder font style
- Results do not scroll under the filter input anymore
2021-01-18 09:28:16 +01:00
Molkobain
7e3d414e9e Navigation menu: Fix menu counters being over the filter input 2021-01-18 09:28:16 +01:00
Molkobain
c117f8a5ab Navigation menu: Fix placeholder hint placement 2021-01-18 09:28:16 +01:00
Molkobain
b8d6918f71 N°1957 - Fix clear icon that was not longer shown 2021-01-18 09:28:15 +01:00
Pierre Goiffon
2f10f24317 Rename \Combodo\iTop\Application\UI\Base\Component\Html\HtmlFactory::MakeP to MakeParagraph 2021-01-15 13:50:47 +01:00
Pierre Goiffon
ec8a1af2a5 N°3537 fix run_query asking value when using :current_contact
:current_contact is a magic arg and value is set by iTop ORM, so we shouldn't ask the user to provide it !

It was working as expected with :current_user

This is a 3.0.0 regression
2021-01-15 12:05:53 +01:00
Stephen Abello
cd39d6a817 Use widget properties instead of hardcoded css classes in tab-container widget 2021-01-15 11:44:59 +01:00
Stephen Abello
ad08376f6e Move ScrollMagic under npm dependency 2021-01-15 11:18:34 +01:00
bruno-ds
71d3713950 N°3651 - add a (commented out) test to prove the bug
just uncomment to use the test.
2021-01-15 11:14:36 +01:00
Stephen Abello
137b4e55c4 N°3560 Allow to scroll vertically through tabs content. User can activate this feature in preference page 2021-01-15 11:03:08 +01:00
odain
b51d7409c1 N°3606: renaming 2021-01-15 11:02:37 +01:00
Pierre Goiffon
442e9598f8 N°3537 run_query : fix query suggestion button
Was throwing plain old HTML
Now use standard button component, and a new HtmlFactory to avoid calling \WebPage::GetP

Also change "use this query" behavior : now also submits the form directly

And : added a TODO 3.0.0 for the "query examples" buttons (will be done later)
2021-01-15 09:30:39 +01:00
Pierre Goiffon
a41229b223 N°3537 run_query : fix cannot set query arguments values 2021-01-14 17:37:38 +01:00
Pierre Goiffon
f1b972dde8 AbstractInput : add missing abstract keyword 2021-01-14 17:04:47 +01:00
Pierre Goiffon
9a5e86caea N°3617 User pref keys : add prefix and normalize naming
4 keys existing :
* notification help message => UI-Collapsible__notifications__home
* run_query "more info" section => UI-Collapsible__run_query__more-info
* RenderAllUiBlocks test page alert and section examples => UI-Collapsible__RenderAllUiBlocks__alert and UI-Collapsible__RenderAllUiBlocks__section
2021-01-14 10:08:15 +01:00
Molkobain
8df2f96dfe N°3627 - Fix "global search" results page URL not containing the query 2021-01-13 21:20:41 +01:00
Molkobain
0f72a35f48 N°3625 - Remove n:n classes from the "quick create" autocomplete 2021-01-13 21:00:20 +01:00
Molkobain
a4d52aa255 Add new MetaModel::IsLinkClass($sClass) to avoid iterating over MetaModel::GetLinkClasses() 2021-01-13 21:00:19 +01:00
Pierre Goiffon
09e531f11c N°3623 new \utils::EscapeHtml method 2021-01-13 16:10:43 +01:00
Pierre Goiffon
958566da61 Merge remote-tracking branch 'origin/support/2.7' into develop
# Conflicts:
#	application/webpage.class.inc.php
2021-01-13 15:25:24 +01:00
Molkobain
ace6215d20 N°3622 - Change "quick create" placeholder image to something with less orange 2021-01-13 11:29:22 +01:00
bruno-ds
97792ab0b1 N°3618 - add a (skipped by default) test to prove the bug
just uncomment the two 1st lines in order to use the test.
2021-01-13 11:12:34 +01:00
Molkobain
574b6609ba N°3622 - Change "quick create" and "global search" placeholders images to something less ambiguous 2021-01-13 11:11:52 +01:00
Molkobain
0a4db9bd50 N°3621 - Add config. parameter to disable "global search" history 2021-01-13 10:53:11 +01:00
Molkobain
9fccb6dd3f N°2847 - Global search: Fix wrong history results parameter (was using the one from "quick create") 2021-01-13 10:47:03 +01:00
Molkobain
9221899525 N°3620 - Add confg. parameter to disable "quick create" history 2021-01-13 10:40:51 +01:00
Pierre Goiffon
6a33fbc7b3 N°3617 run_query "more information" section : collapsible state is saved back again
The original key name was "runQuery" (f9511aba) but this was too vague and didn't follow naming conventions. SO I decided to renamed it "run_query__more-info", as anyway existing keys won't be used (see 790a675d)
2021-01-13 09:34:24 +01:00
Pierre Goiffon
790a675d90 N°3617 collapsible components state saving : use user pref instead of localStorage
No migration from existing localStorage keys (introduced in 2.5.0 with N°1030) as the console UI has dramatically change in 3.0.0 : will be useful to show all the collapsible sections content once again !

Note that an iTop instance identifier was used in the localStorage key, it is no longer needed as we're getting the user pref directly from the current instance.

Thanks @Molkobain for the help !
2021-01-13 09:33:44 +01:00
Pierre Goiffon
09da54ee56 N°3617 collapsible components state saving : use JQuery widget options instead of a method
This is the way JQuery widget are intended to work !
Thanks @Molkobain for the review !
2021-01-13 09:29:58 +01:00
Eric
028a3ccec8 N°2677 - Add style definition for classes (too much style) 2021-01-13 08:58:27 +01:00
Eric
503817e572 N°2737 - Migrate WebPage::table() to UIBlocks 2021-01-12 16:17:33 +01:00
Molkobain
e0fe657f27 N°2677 - Fix regression introduced in previous commit (itop-request-mgmt-itil DM not completely migrated) 2021-01-12 15:49:00 +01:00
acognet
3a83d2ad89 N°2737 - Migrate table to DataTables plugin to be iso with the end-users portal - fix actions doesn't work after class change 2021-01-12 11:00:46 +01:00
acognet
ccb6bb943c N°2737 - Migrate table to DataTables plugin to be iso with the end-users portal - fix actions doesn't work after class change 2021-01-12 10:34:24 +01:00
Eric
f0307afe2b N°2677 - Add style definition for classes (change code tag) 2021-01-12 10:20:59 +01:00
Eric
05b75cf98a N°2311 - deprecate 'cas_include_path' configuration parameter 2021-01-11 14:34:55 +01:00
Eric
24a6d6b6fd N°2677 - Add style definition for classes (change code tag) 2021-01-11 12:18:33 +01:00
acognet
cdaf431d24 N°2508 - Include Obsolescence icon within list and autocomplete - cleanup code never used 2021-01-08 10:57:30 +01:00
acognet
cf1f49ebc9 N°3604 - Auto refresh no more working on menu 3.0 2021-01-08 09:50:43 +01:00
acognet
06ecfb5814 N°2508 - Include Obsolescence icon within list and autocomplete - case of search filters 2021-01-08 09:48:35 +01:00
acognet
354fc1949b N°2737 - Migrate table to DataTables plugin to be iso with the end-users portal - fix test on $bShowObsoleteData for display message 2021-01-08 09:43:57 +01:00
Eric
fc2b220197 N°2311 - deprecate 'cas_include_path' configuration parameter 2021-01-07 15:58:12 +01:00
odain
acea2110ac N°3606 - Add a basic html page type to TwigBase Controller 2021-01-07 10:35:39 +01:00
acognet
176111794e N°2737 - Migrate table to DataTables plugin to be iso with the end-users portal - fix enable/disable add button 2021-01-07 09:58:36 +01:00
Eric
3e051e38c3 N°2677 - Add style definition for classes (fix XML migration) 2021-01-06 16:10:12 +01:00
Eric
d4aeb4b157 N°2677 - Add style definition for classes 2021-01-06 14:06:46 +01:00
Eric
fca123e127 Fix setup when maintenance mode is active 2021-01-06 14:06:46 +01:00
Molkobain
dc2f8fe9bb N°3594 - Fix label when an attribute is an external field on a remote external key 2021-01-06 13:59:49 +01:00
acognet
f10d3893f4 N°2737 - Migrate table to DataTables plugin to be iso with the end-users portal - fix change in "configure this list" 2021-01-06 11:30:08 +01:00
Stephen Abello
05cf1bc83a N°2847 Add JQueryUI modal CSS to modal SCSS file 2021-01-06 11:19:43 +01:00
acognet
3791306be7 3540 - Migrate printable version of an object - management of the activities of an object 2021-01-06 09:40:30 +01:00
Stephen Abello
1353917994 💚 Fix CI by removing precompile stylesheet 2021-01-05 17:51:34 +01:00
Stephen Abello
5ef75772f0 N°3516 Add Fullmoon 🌕 to theme mechanism, update test-red theme for 3.0 2021-01-05 17:16:30 +01:00
Eric
82e98ced85 N°2677 - Add style definition for enums (MetaModel::GetEnumStyle() API) 2021-01-05 13:45:23 +01:00
Eric
2dea5447b4 N°2677 - Add style definition for enums (Default values) 2021-01-05 11:07:18 +01:00
Molkobain
9aa379981e N°2847 - Remove unused SCSS files 2021-01-04 14:08:44 +01:00
Molkobain
050c00c791 N°2847 - Add SCSS shame file for hacks (https://sass-guidelin.es/#shame-file) 2021-01-04 10:20:52 +01:00
Eric
551689d445 N°2677 - Add style definition for enums (Fix CI) 2021-01-04 09:05:36 +01:00
Eric
dd4d40ce81 N°2677 - Add style definition for enums (Fix list display) 2020-12-31 17:02:44 +01:00
Eric
d77f374918 N°2677 - Add style definition for enums (refactor & fix CI) 2020-12-31 16:34:59 +01:00
Eric
640b6a7288 N°2677 - Add style definition for enums (fix CI) 2020-12-31 13:22:01 +01:00
Eric
5128833a62 N°2677 - Add style definition for enums (fix CI) 2020-12-31 12:02:43 +01:00
Eric
f1ad55c86c N°2677 - Add style definition for enums 2020-12-31 11:25:00 +01:00
Eric
e20f6d7564 N°3540 - Migrate printable version of an object (dashboard) 2020-12-29 18:31:59 +01:00
Eric
ec26a8d343 N°2737 - ExtraParams check in DisplayBlock 2020-12-29 18:31:09 +01:00
Eric
542be44740 N°2737 - ExtraParams check in DisplayBlock 2020-12-29 11:57:14 +01:00
denis.flaven@combodo.com
cdbb783ebc N°3584 - declare the TagSetFieldData class for information in the meta XML 2020-12-29 11:56:33 +01:00
Eric
e602a93829 N°2737 - ExtraParams check in DisplayBlock 2020-12-29 11:41:01 +01:00
Eric
b7bcd4fe7b N°2737 - Fix export dialog 2020-12-28 16:03:46 +01:00
Eric
f01bec4003 Fix Setup (remove double ajax calls) 2020-12-28 11:23:21 +01:00
Pierre Goiffon
9be3ff3cca N°3564 Use CollapsibleSectionState for help 2020-12-24 11:48:30 +01:00
Pierre Goiffon
2c0d001721 N°3564 Alert and CollapsibleSectionState can now be saved 2020-12-24 11:48:30 +01:00
Pierre Goiffon
d3efd3ea0e 🎨 N°3563 user preferences page : some formatting 2020-12-24 10:04:50 +01:00
Pierre Goiffon
e18df16387 N°3583 update max items per list from 10 to 20 2020-12-24 09:59:19 +01:00
Molkobain
4ddfbf6559 N°3477 - Rename methods of the new iPageUIBlockExtension API 2020-12-23 16:25:36 +01:00
Molkobain
1d02ada8dc Update other dictionaries to mark modified entry (other languages are already ok) 2020-12-23 15:48:02 +01:00
Molkobain
608c868b53 N°3561 - Fix all header messages (readonly, log kpi, app. messages, archive mode, ...) 2020-12-23 14:53:06 +01:00
Molkobain
65639517ff N°2847 - Alert: Fix layout when either title or body is empty 2020-12-23 14:38:34 +01:00
Molkobain
1f64e4eda4 Change dictionary for a simpler message 2020-12-23 10:54:53 +01:00
Molkobain
7a446941e0 N°3123 - Fix list dashlet not displaying object type anymore 2020-12-23 10:53:46 +01:00
Molkobain
0a87ccaa77 PHPDoc fixes 2020-12-23 09:53:01 +01:00
Molkobain
06a829ce35 N°2847 - Alert: Rework $bIsOpenedByDefault property integration 2020-12-22 18:22:59 +01:00
Molkobain
fc3f096823 N°2847 - Alert: Add properties to set if closable or collapsible 2020-12-22 18:22:59 +01:00
Molkobain
874bf38316 N°2844 - Fix object panel layout during a transition 2020-12-22 18:22:58 +01:00
Molkobain
27eb3a8509 N°3518 - Start refactor of object details to match block / template design 2020-12-22 18:22:58 +01:00
Molkobain
c14476ec73 N°3518 - Refactor some parts of the WebPage for a better overloading in derivated classes 2020-12-22 18:22:58 +01:00
Molkobain
c3b8abee47 N°2847 - Fix icon not displaying for global search and quick create boxes 2020-12-22 18:22:58 +01:00
Molkobain
ece8803259 N°2127 - Add possibility to exit fullscreen with "Esc" key 2020-12-22 18:22:58 +01:00
Pierre Goiffon
4541aa4446 N°3537 run_query : use H2 for content titles 2020-12-22 18:20:36 +01:00
Pierre Goiffon
679b25f3fb 🗑️ Deprecate WebPage collapsible section methods 2020-12-22 18:09:19 +01:00
Pierre Goiffon
337aebfed9 N°3537 run_query : use panel for OQL error 2020-12-22 17:47:10 +01:00
Pierre Goiffon
5e22c442ce N°3537 new CollapsibleSection component for run_query 2020-12-22 17:18:13 +01:00
Pierre Goiffon
4ebe3d2b2f Fix null returned by Field::IsHidden 2020-12-21 15:23:46 +01:00
odain
4089e853f8 N°3562 - Cleanup removed images - fix ci 2020-12-21 10:57:29 +01:00
odain
c1fc502916 N°3562 - Cleanup removed images in light-grey.scss 2020-12-21 10:27:23 +01:00
odain
a1030e3f81 clean light-grey.scss from non existing images 2020-12-21 10:08:36 +01:00
Eric
ffc0bd0a9c N°3540 - Migrate printable version of an object (fix js error) 2020-12-18 18:02:43 +01:00
Pierre Goiffon
8dddf90838 ♻️ new var_export filter for bolean values 2020-12-18 17:51:43 +01:00
Eric
2608c071d0 N°3540 - Migrate printable version of an object (change some css classes) 2020-12-18 16:06:51 +01:00
acognet
1f4d1d1959 N°3540 - Migrate printable version of an object 2020-12-18 11:46:05 +01:00
acognet
3876fb9d62 N°3540 - Migrate printable version of an object 2020-12-18 11:41:31 +01:00
Pierre Goiffon
c8dbf88c03 ♻️ new FieldFactory
Idea is to remove the aParams parameter from the Field object
And also allow to pass subblocks for the input value instead of only raw HTML
2020-12-18 11:32:13 +01:00
Molkobain
f8b8dd0bc6 Alert: Rename event callback to match conventions 2020-12-17 16:01:21 +01:00
Molkobain
efe61c7b14 N°2844 - Activity panel: Fix user medallion not displayed when filtering entries 2020-12-17 15:33:57 +01:00
Molkobain
d664c26fb7 N°2127 - Fix fullscreen closing on content click 2020-12-17 13:37:04 +01:00
Molkobain
47cebb8671 N°2127 - Fix visual glitch when several large fields in the form 2020-12-17 13:09:11 +01:00
Molkobain
f525e161a8 N°2127 - Fix field content overlapping on rest of the UI (Backoffice) 2020-12-17 12:12:04 +01:00
Molkobain
a00c573866 Add JS helpers to CombodoBackofficeToolbox to put/remove an element from fullscreen mode 2020-12-17 12:12:04 +01:00
Molkobain
745ffc7cd2 N°3379 - Improve hint display (not definitive) 2020-12-17 12:12:03 +01:00
Pierre Goiffon
dbece17235 Alert : use same data-role value for all collapsible actions 2020-12-17 09:08:45 +01:00
vdumas
ceb48c2ead Enrich dictionary for notify flag on Contact 2020-12-16 18:43:28 +01:00
Pierre Goiffon
9580a20f3f Alert component : title is now clickable to expand/collapse 2020-12-16 18:03:52 +01:00
Pierre Goiffon
85e9073228 N°3537 run_query : use Field instead of InputWithLabel 2020-12-16 17:45:13 +01:00
Pierre Goiffon
2b0691daa6 N°3537 run_query : exception message as an alert Component 2020-12-16 17:45:12 +01:00
Eric
c1e25b121e N°2737 - ExtraParams check in DisplayBlock 2020-12-16 17:44:08 +01:00
Eric
31f3bf9368 N°2847 - move console specific methods from BlockRenderer to ConsoleBlockRenderer 2020-12-16 17:44:08 +01:00
Thomas Casteleyn
42354ba794 Improve secure connection detection (#161)
The previous code broke the setup page when the iTop server is behind a proxy that handles SSL termination.
Now the detection also checks the `HTTP_X_FORWARDED_PROTO` and `HTTP_X_FORWARDED_PROTOCOL` HTTP headers. 
For any other page than the setup, the check is unchanged.

Many thanks @Hipska !
2020-12-16 15:37:48 +01:00
Eric
1b115624a2 N°2737 - RenderBlockTemplate enhancement, uilinkswidget UIBlock refactor 2020-12-16 11:05:30 +01:00
Eric
d2bc651fc6 N°3123 - ExtraParams check 2020-12-16 09:05:05 +01:00
Pierre Goiffon
a20fd2278f N°3537 Code review
Thanks @Molkobain !
2020-12-16 08:06:53 +01:00
Pierre Goiffon
cb4fb15b0a Alert : remove return type 2020-12-16 07:56:13 +01:00
Pierre Goiffon
102123441d Alert component : fix regression introduced in 3d27e592 2020-12-15 17:22:38 +01:00
Pierre Goiffon
4bb59548d0 N°3537 run_query : replace main form by components 2020-12-15 17:09:39 +01:00
Pierre Goiffon
3d27e59269 Alert component : allow to be closed by default 2020-12-15 17:08:54 +01:00
Pierre Goiffon
ebe30a88a1 N°3129 remove useless final keywords 2020-12-15 16:27:00 +01:00
Pierre Goiffon
a5d26b93e9 ThemeHandlerTest : rename source files
They are used solely in the test. And the test does the SCSS compilation and compares the results to expected files. So changing anything in the test source SCSS and we need to change the expected results too ! This isn"t necessary...

But there were some confusions as the css/light-grey.scss file is modified very often, and one of the test source file has the same name !
Adding the prefix DO_NOT_CHANGE should avoid such errors in the future O:)
2020-12-15 16:24:31 +01:00
Eric
afca91089a N°3123 - ExtraParams check 2020-12-15 14:57:06 +01:00
Eric
893787d7f9 Fix typo 2020-12-15 14:46:03 +01:00
Eric
a9bab22720 N°3123 - ExtraParams check (only in dev) 2020-12-15 14:46:02 +01:00
Molkobain
13018c9df7 Fix CI due to 64fca330 2020-12-15 13:23:27 +01:00
Eric
c451293370 N°3123 - ExtraParams check 2020-12-15 12:14:10 +01:00
Molkobain
64fca3306f N°3547 - Fix fullscreen button on HTML field not displaying correctly 2020-12-15 11:39:06 +01:00
Pierre Goiffon
3cce93be95 UIExtKeyWidget : Fix parameters that must be optionals 2020-12-15 10:24:59 +01:00
odain
916f9b367e Merge branch 'feature/restapi-pass-jsondata-asfile2' into develop 2020-12-14 23:22:52 +01:00
odain
c6816318a9 N°3455: test when no json_data is passed 2020-12-14 23:19:54 +01:00
Eric
9df80b9f79 N°3123 - Fix table counts on search results 2020-12-14 18:31:32 +01:00
odain
59e9cdbfe6 N°3455: review with Romain (new code documented) 2020-12-14 18:23:31 +01:00
odain
7f0e8abc09 N°3455: clean code + test after review 2020-12-14 18:22:15 +01:00
Eric
c106caf924 N°3123 - Fix dashlets GroupBy and Object List 2020-12-14 16:37:23 +01:00
Pierre Goiffon
c06e176d57 Templates : remove auto closing tags
We are not using XHTML anymore but HTML 5
2020-12-14 16:29:57 +01:00
Pierre Goiffon
62bb0b9b78 Improve RenderAllUiBlocks 2020-12-14 15:42:56 +01:00
Eric
70beeb726a N°3123 - Fix "view_link" parameter for shortcuts preferences 2020-12-14 09:54:01 +01:00
acognet
c173f0b5d6 N°3123 : Fix create shortcuts and set preferences 2020-12-14 09:23:12 +01:00
acognet
43a2b5cda6 N°3123 : Fix create shortcuts and set preferences 2020-12-11 19:23:35 +01:00
Pierre Goiffon
17cecde604 Fix errors in setup/modelfactory.class.inc.php 2020-12-11 10:49:41 +01:00
Pierre Goiffon
728c09d97d N°3129 Fix compatibility with PHP 8 for \MFElement::ReplaceWith
New method added in PHP 8 : \DOMChildNode::replaceWith with a different signature (both visibility and parameters)
2020-12-11 10:13:10 +01:00
acognet
eb89c52bae N°3123 : Fix create shortcuts 2020-12-11 10:08:57 +01:00
Pierre Goiffon
e3895f284b N°3512 fix setup crashing if env-production doesn't exist 2020-12-11 09:26:19 +01:00
Pierre Goiffon
50342b6dfe Update compiled CSS 2020-12-10 18:28:03 +01:00
Pierre Goiffon
96e7f57a34 Merge remote-tracking branch 'origin/support/2.7' into develop
# Conflicts:
#	application/ajaxwebpage.class.inc.php
#	application/csvpage.class.inc.php
#	application/itopwebpage.class.inc.php
#	application/webpage.class.inc.php
#	application/xmlpage.class.inc.php
#	core/config.class.inc.php
#	css/css-variables.scss
#	datamodels/2.x/version.xml
#	pages/ajax.document.php
#	pages/ajax.render.php
#	pages/ajax.searchform.php
#	sources/application/TwigBase/Controller/Controller.php
2020-12-10 18:08:11 +01:00
Molkobain
abf6d5422e Merge remote-tracking branch 'origin/feature/faf-cke-mentions' into develop 2020-12-10 17:50:07 +01:00
Eric
2bef89137e N°3123 - DataTables rework (WIP) 2020-12-10 17:13:15 +01:00
Stephen Abello
a0ac1c70a9 N°2847 * Update CKeditor to 4.15.1
* Add iTop default languages to ckeditor
* Change CKeditor skin from flat to Moono-Lisa
2020-12-10 12:12:13 +01:00
Stephen Abello
1ccabe645b N°2847 * Update CKeditor to 4.15.1
* Add iTop default languages to ckeditor
* Change CKeditor skin from flat to Moono-Lisa
2020-12-10 11:18:09 +01:00
Pierre Goiffon
b03c5232b0 N°3253 Fix setup error message
Thanks @Hipska and @Molkobain !
2020-12-10 10:31:58 +01:00
Molkobain
97c77b612e N°2875 - Add config. param. 'mentions.allowed_classes' to choose which classes (eg. Person / FunctionalCI) can be mentioned through which char. (eg. @ / #) 2020-12-10 10:27:34 +01:00
Molkobain
e96400c43b N°2875 - Improve global implementation and integration with the trigger system 2020-12-09 23:19:39 +01:00
Molkobain
c22f019ea1 N°2847 - Add data-[role|object-class|object-id] attributes to the HTML sanitizer white list for anchors 2020-12-09 22:23:37 +01:00
Molkobain
bc3c46b566 N°2847 - Rework ckeditor SCSS to proper files and variables 2020-12-09 22:08:46 +01:00
Molkobain
a8431c5810 N°2875 - Update branch to current develop branch state 2020-12-09 20:06:40 +01:00
Molkobain
68332896ad Merge branch 'develop' into feature/faf-cke-mentions
# Conflicts:
#	application/cmdbabstract.class.inc.php
#	css/css-variables.scss
#	css/light-grey.scss
#	datamodels/2.x/installation.xml
2020-12-09 19:58:26 +01:00
Stephen Abello
dbda9512e5 N°2560 Prevent double submit on forms 2020-12-09 15:48:06 +01:00
Eric
b8a42843e0 N°3123 - DisplayBock BlockCvs 2020-12-08 16:29:16 +01:00
acognet
10c3f9f633 N°3123 : Improved JavaScript management in web pages and ajax pages - fix for datatable 2020-12-08 11:04:46 +01:00
Eric
05e802b74a N°3123 - Fix create new object link 2020-12-08 10:13:05 +01:00
acognet
0c8d78d753 N°3123 : refactoring ajax call for datatables 2020-12-08 09:38:24 +01:00
acognet
5ccb12453a N°3123 : Improved JavaScript management in web pages and ajax pages 2020-12-08 08:59:25 +01:00
Eric
0808a76226 N°3123 - Fix empty popup menus 2020-12-07 14:29:01 +01:00
Molkobain
815b2e1670 N°2847 - Restore components/layouts SCSS files to keep matching SCSS conventions 2020-12-04 23:03:17 +01:00
Pierre Goiffon
c46b046254 N°3253 Fix setup always displaying an error
Woops this was a debug I forgot to change
2020-12-04 18:30:28 +01:00
Pierre Goiffon
70efa37109 N°3253 Fix setup crashing on incompatible PHP versions (#178)
We now have a new setup landing page. The old one is renamed setup/wizard.php

This contains revert for "🐛 Fix setup homepage error with PHP < 7.1.0" (91c6916d86) => it was one of the modifications that caused the setup to crash before this !
2020-12-04 18:28:39 +01:00
Stephen Abello
13d2699011 N°2629 Allow user to choose default expanded/collapsed toolbar for richtext editors 2020-12-04 10:53:22 +01:00
Stephen Abello
cc6e9492fd N°2847 Fix blocks import paths in notifications following directories refactor 2020-12-03 15:26:40 +01:00
Stephen Abello
7f97df02ce N°2847 Add TODO to datamodel viewer 2020-12-03 15:04:57 +01:00
Stephen Abello
f28fc15a8d N°2847 Replace Notifications page header by an Alert block 2020-12-03 15:04:56 +01:00
Thomas Casteleyn
59f9cd3694 🎨 Fix the filter icon on Data model page (#168)
Fix the filter icon on Data model page
2020-12-03 13:28:59 +01:00
Eric
2575fd6f4d N°3123 - Refactor default constants 2020-12-02 13:22:43 +01:00
Eric
15aa9e508c N°3123 - Refactor Directories 2020-12-02 13:18:01 +01:00
Stephen Abello
d1b12ee04b N°2251 Replace qtip calls by tippyjs calls 2020-12-02 10:06:24 +01:00
Pierre Goiffon
1252d760ab RenderAllUiBlocks improvements
* add call to ButtonFactory::MakeIconLink
* add some CSS customizations to h1, h2, HR
* add H2 with id to link to specific regions
* add @link PHPDoc in related components
* fix typo in alerts (title was using "alert" instead of "panel")
2020-12-02 10:03:40 +01:00
Stephen Abello
81b96b2430 N°2251 Migrate bulk modify field additional content tooltip from qtip to tippyjs 2020-12-02 09:42:20 +01:00
Stephen Abello
5dd6477cfc N°2847 Add field additional content (eg. for bulk modify) 2020-12-02 09:42:20 +01:00
Eric
5f30729127 N°3123 - Add variables for templates (html, js and css) 2020-12-01 19:09:49 +01:00
Eric
abb192eb0f N°3123 - Changed the variables in application UIBlocks 2020-12-01 19:08:49 +01:00
Pierre Goiffon
c701b518b8 Buttons component : add tooltip
Note that we will do later on a pass on accessibility, so we might add as well a title attribute, or a aria-* attribute
2020-12-01 18:34:57 +01:00
Pierre Goiffon
14ac58b999 N°3227 use Button components instead of hardcoded HTML 2020-12-01 18:19:40 +01:00
Pierre Goiffon
ae094f9bc6 N°3227 Fix typo in var names
Thanks @Molkobain (who commented in c117a23e0d)
2020-12-01 17:31:04 +01:00
Pierre Goiffon
e9d800794e ButtonFactory : new icon button method 2020-12-01 16:49:56 +01:00
BenGrenoble
7de427dc38 N°3440 Error loading module "itop-bridge-cmdb-ticket": /class[lnkFunctionalCIToProviderContract] at line 114: could not be added (already exists) with itop-service-mgmt-provider 2020-12-01 16:19:25 +01:00
Pierre Goiffon
c117a23e0d N°3227 For AttributeOQL add a new icon to pick a query from queries phrasebook
Add a new Query.is_template field (default value 'no') to filter queries usable as template.

Also lots of modifications in ExtKeyWidget, both JS and PHP objects :
* pass filter on dialog content generation (was using only targetClass, so search criteria weren't set - but search results were ok as they are made from another ajax query)
* fix loading still displayed after dialog close
* can now get the defined attribute value (was always returning the selected object id)
2020-12-01 09:40:55 +01:00
Pierre Goiffon
77b72a6eb1 📝 Add since on AttributeEnumSet 2020-11-30 18:48:33 +01:00
Pierre Goiffon
9f48de7774 🎨 extkeywidget change copyright format 2020-11-30 18:48:32 +01:00
Eric
5378361faa N°3123 - Add the possibility to create UIBlocks in extensions 2020-11-30 18:01:01 +01:00
Eric
d2d5a90637 N°3123 - Fix popup menus for lists 2020-11-30 16:47:27 +01:00
Eric
631a73e07d N°3123 - Fix breadcrumb for DisplayBlock(type: List) 2020-11-30 15:36:54 +01:00
Pierre Goiffon
c944cd29b1 📝 Fix \utils::Sanitize_Internal phpdoc
Thanks @Molkobain !
2020-11-30 15:01:09 +01:00
Pierre Goiffon
5d5a3183c0 📝 more PHPDoc for \utils::Sanitize_Internal
added more details about const that were introduced in e911290b3d
2020-11-30 14:27:52 +01:00
Pierre Goiffon
cdb97baa80 🐛 DataTableFactory : fix ajax.render URL generation
Was created without approot
2020-11-30 08:03:52 +01:00
denis.flaven@combodo.com
398b5f446c Protect against empty 'precompiled theme' entry in the XML 2020-11-27 17:57:09 +01:00
Eric
4099a8ef5a N°3123 - Moved Popup Menu Items JS parts to UIBlocks 2020-11-27 17:25:50 +01:00
Eric
fd5958b764 N°3123 - Code cleanup (removed unnecessary files) 2020-11-27 17:24:56 +01:00
Eric
8dda0f02f2 N°3123 - Create specific block for DisplayBlock(type: ChartAjaxPie and ChartAjaxBars) 2020-11-26 18:17:06 +01:00
Eric
efbd249e7f N°3123 - Create specific block for DisplayBlock(type: Chart) 2020-11-26 17:41:25 +01:00
Eric
cf4e8c65d2 N°3123 - Create specific block for DisplayBlock(type: List) 2020-11-26 16:50:58 +01:00
Eric
9a595e3178 N°3123 - Create specific block for DisplayBlock(type: List) 2020-11-26 16:49:43 +01:00
Vincent Dumas
14f8a5aa36 #3434 typo in FR dictionnary entry 2020-11-26 16:30:17 +01:00
Eric
a759380999 Migrates banner, header, footer in blocks for iTopWebPage 2020-11-26 15:33:49 +01:00
Stephen Abello
05ed58d741 N°2847 Reduce alerts minimized padding and add a min height to handle when there's no title and the alert is minimized 2020-11-26 14:47:29 +01:00
Stephen Abello
6b2eeeccf5 N°2847 Remove a debug line 2020-11-26 11:37:47 +01:00
Stephen Abello
340b9134c0 N°2847 Allow user to minimize/close alerts 2020-11-26 11:13:28 +01:00
odain
ba01ac715f N°3455 - Passing json_data as file to REST API 2020-11-25 18:32:54 +01:00
Eric
8f151b84c9 N°2847 - Code refactor 2020-11-25 15:27:47 +01:00
Eric
c5942a3ddd N°2847 - Code refactor 2020-11-25 15:24:27 +01:00
Eric
fc24746862 N°2847 - Fix "Add some criterion..." message on OQL menus 2020-11-24 15:38:04 +01:00
Eric
d0baf298be N°2847 - Datatable Fix n-n links 2020-11-24 14:54:32 +01:00
acognet
fb70026966 N°2847 - Tranform old itop datatable to jquery DataTable - Fix management of button "Add" step 2 2020-11-24 14:21:28 +01:00
Molkobain
ad19a89fc5 N°2847 - Fix iTopWebPage's header / footer API layout 2020-11-24 13:30:29 +01:00
Eric
7b937016d0 N°2847 - Datatable sortable columns tooltip 2020-11-24 11:37:23 +01:00
Eric
e8f7c7dafe N°2847 - Datatable cursor on sortable columns 2020-11-24 11:32:53 +01:00
Eric
d9264e5181 N°2847 - Datatable Fix external keys "undefined" 2020-11-24 11:25:26 +01:00
Pierre Goiffon
f893603332 🔧 editor config : else on same line in JS 2020-11-24 11:03:59 +01:00
Stephen Abello
a49a56def8 N°2847 Correctly center external key value on edition 2020-11-24 09:35:09 +01:00
Molkobain
2f138db4ac N°2847 - Work on object details structure 2020-11-23 23:17:12 +01:00
Molkobain
8d19958d6d N°2847 - ActivityPanel: Rework for new UX in edition/creation
- Hide main action buttons
- Remove activity tab entry form
- Send caselogs value with global form
2020-11-23 23:17:12 +01:00
acognet
11b6429e3c N°2847 - Tranform old itop datatable to jquery DataTable - Fix management of button "Add" 2020-11-23 19:59:55 +01:00
Eric
dccffc91b1 N°2847 - Datatable Fix preferences 2020-11-23 17:54:00 +01:00
Pierre Goiffon
6c5e1c429f 🎨 Remove auto closing tags for CSS
We have an HTML 5 Doctype, we're not using XHTML anymore
2020-11-23 15:09:45 +01:00
Molkobain
7d0f1f46d3 N°2847 - ActivityPanel: Rework for new UX
- Add MetaModel::GetCaseLogs($sClass) function
- Rename ActivityNewEntryForm to CaseLogEntryForm
- Rework ActivityPanel and CaseLogEntryForm markup / CSS
- Change for 1 CaseLogEntryForm per tab (caselogs and activity) with specific "Add entry..." choices
2020-11-23 11:11:05 +01:00
Molkobain
1e7d4e5c31 N°2847 - PopoverMenu: Fix quotes not being escaped in JS menu items 2020-11-23 10:08:21 +01:00
Molkobain
b12dadb0dc N°2847 - Button: Fix icon right margin and missing data role in markup 2020-11-23 10:08:20 +01:00
Molkobain
c6506c9f13 N°2847 - UIContentBlock: Rename AddDataAttributes method and fix PHPDoc 2020-11-23 10:08:18 +01:00
Molkobain
af11577450 N°2847 - iTopWebPage: Remove deprecated JS FixPaneVis() function (not used anymore since 3.0.0) 2020-11-23 10:08:17 +01:00
Molkobain
91ab66453b Remove jQuery Migrate "traces" logs, keeping only "warnings" 2020-11-23 10:08:16 +01:00
Stephen Abello
b1102bc68c N°2847 Re-generate precompiled css files 2020-11-20 10:45:16 +01:00
Stephen Abello
0443197c04 N°2847 Move Advance search css from light-grey to a dedicated file and tweak its style for 3.0 2020-11-20 10:32:52 +01:00
Eric
32e0c8f9bf N°2847 - Datatable modal dialogs 2020-11-19 17:45:46 +01:00
Eric
26d912f059 Fix breadcrumb 2020-11-19 16:02:11 +01:00
Molkobain
3cb5f3d07e N°2847 - Improve fatal error page message 2020-11-19 14:53:23 +01:00
Molkobain
675a408ab9 N°2847 - Activity panel: Pass host object display mode 2020-11-19 13:45:10 +01:00
Stephen Abello
2f938814e0 N°2847 Forgot to include aef77d8 illustration file in fatal errors alpha/development message 2020-11-19 13:43:05 +01:00
Stephen Abello
8042afa20f N°2847 Light fix to setup style 2020-11-19 13:39:27 +01:00
Stephen Abello
aef77d8f93 N°2847 Add message on alpha/development fatal error pages 🤫 2020-11-19 13:39:04 +01:00
Stephen Abello
05c53d35b7 N°2847 Update login screen style to better fit with iTop 3.0 2020-11-19 11:00:41 +01:00
Stephen Abello
ea169e8358 N°2847 Fix User menu not displaying on carret click 2020-11-19 10:45:39 +01:00
Stephen Abello
28e80e5568 N°2847 Finish style and refactor SCSS for datatables 2020-11-19 10:36:01 +01:00
BenGrenoble
487e0ad5a7 N°3440 Datamodel correction following Eric input 2020-11-18 16:19:16 +01:00
acognet
106dfc63d5 N°2847 - Tranform old itop datatable to jquery DataTable - manage popup "Configure this list" 2020-11-18 12:31:42 +01:00
acognet
5115db1b01 N°2847 - Tranform old itop datatable to jquery DataTable - add new style for MenuBlock 2020-11-17 15:18:05 +01:00
acognet
9621ff4d5e N°2847 - Tranform old itop datatable to jquery DataTable - fix diplay 2020-11-17 11:54:52 +01:00
Eric
1c5cb4e125 Fix datamodel 2020-11-17 10:50:49 +01:00
Stephen Abello
dc6a900f6d N°2847 Add css class to TagSet and Password input error message 2020-11-17 10:43:28 +01:00
Stephen Abello
0d23faba1c N°2847 Fix select input and duration input elements going to newline 2020-11-17 10:42:55 +01:00
Stephen Abello
c861941e92 N°2847 Fix input background color on error 2020-11-17 10:41:10 +01:00
Eric
313df4551f N°2847 - Datatable Fix selection 2020-11-17 09:42:26 +01:00
Pierre Goiffon
07cc8bf508 N°3436 fix Setup
Was blocked because using iTop 3.0.0 with datamodels/2.x dir : \SetupUtils::GetCompatibleDataModelDir wasn't ok with that :o)
This method is no more present, and we're calling \SetupUtils::GetLatestDataModelDir only
In other words, we're picking the latest datamodel/*.x dir (greatest number)
2020-11-16 17:51:52 +01:00
Pierre Goiffon
c2e31de263 🎨 SetupUtils fix methods modifiers + formatting 2020-11-16 17:39:32 +01:00
Eric
103b5bfd22 Merge remote-tracking branch 'origin/datatable' into feature/backoffice-full-moon-design 2020-11-16 15:24:07 +01:00
Eric
4c78ecab91 N°2847 - Datatables WIP 2020-11-16 15:02:02 +01:00
Pierre Goiffon
48bf954387 🔊 DisplayBlock add error message on error if user is admin
Previously only an IssueLog was made, which was confusing
The log is limited to admin users as it contains the exception message, which could expose sensitive info
2020-11-16 11:21:20 +01:00
Eric
89c35f0345 N°2847 - Datatables Fix external keys search 2020-11-16 11:04:16 +01:00
Eric
434c829f7e Fix update objects 2020-11-16 11:04:16 +01:00
Eric
4c8a8fc510 N°2847 - Datatables Fix external keys search 2020-11-16 11:04:16 +01:00
acognet
0a02c10287 N°2847 - Tranform old itop datatable to jquery DataTable - fix diplay 2020-11-16 10:40:35 +01:00
Molkobain
d4516c214c N°2847 - Input : Fix vertical alignment and horizontal padding 2020-11-15 17:56:32 +01:00
Molkobain
931225ed5a N°2847 - Activity panel: Work on the global UX
- Fix collapse/expand icon not toggling
2020-11-15 17:56:32 +01:00
Stephen Abello
18ed151e50 N°2847 Add placeholder to menu filter 2020-11-13 10:05:48 +01:00
acognet
0046834b2c N°2847 - Tranform old itop datatable to jquery DataTable - add sort 2020-11-13 08:51:16 +01:00
acognet
6835ebd11d N°2847 - Tranform old itop datatable to jquery DataTable - show + button in search box 2020-11-12 12:35:11 +01:00
Eric
62880b04eb N°2847 - Datatables pagination CSS 2020-11-12 11:59:56 +01:00
Eric
6d82a85b12 N°2847 - Datatables for forms 2020-11-12 11:44:06 +01:00
Stephen Abello
64134ff428 N°2847 Add silo selector to navigation menu 2020-11-12 11:00:59 +01:00
Stephen Abello
c7661bcfcf Update TODO format 2020-11-12 11:00:59 +01:00
Eric
291041610b set_time_limit accept only int in PHP7.4 2020-11-12 10:57:13 +01:00
Molkobain
a729c6c1e3 Fix typo (thanks @steffunky) 2020-11-12 09:42:39 +01:00
Eric
23452804aa N°2847 - Datatables for static data 2020-11-10 17:30:53 +01:00
Molkobain
1098182720 Update pre-compiled themes 2020-11-10 16:28:17 +01:00
Molkobain
77ecd055b4 N°2847 - Fix crash when object with state attribute has no state defined 2020-11-10 15:55:20 +01:00
Molkobain
38fbc49e51 N°2844 - Fix layout for object creation and edition pages (activity panel, title, ...) 2020-11-10 15:41:33 +01:00
Molkobain
f9b905403d N°3389 - Add integration test (XML version and app. core version must be aligned from now on) 2020-11-10 10:33:22 +01:00
Molkobain
96130735c4 N°3287 - Add french translations 2020-11-10 09:46:00 +01:00
Molkobain
448afc640d Internal: Change XML version from 1.8 to 3.0 as it will now follow iTop core version numbering 2020-11-09 19:48:28 +01:00
Molkobain
f2ff5a4e83 N°3203 - Datamodel: Add semantic for image & state attributes Part. II 2020-11-09 15:44:45 +01:00
Pierre Goiffon
b44e6a4a53 Fix ThemeHandlerTest
Regression introduced by f718b26b : the test expected SCSS file was modified in sync with modifications done in iTop SCSS files. No need to do that as this file is only used in this test.
2020-11-09 15:15:12 +01:00
Eric
866a93c0c8 Fix unit tests 2020-11-09 11:57:56 +01:00
Eric
d7b1e60219 Merge remote-tracking branch 'origin/feature/backoffice-full-moon-design' into datatable 2020-11-09 11:33:48 +01:00
Pierre Goiffon
63d52787f0 Commit CSS modified by d76e425 2020-11-09 09:37:29 +01:00
Eric
bc809b0f3b N°2847 - cleanup code 2020-11-09 08:00:26 +01:00
Eric
f64cad75cd Fix error when history contains a now invalid attribute 2020-11-06 14:55:59 +01:00
Eric
6237b5565c N°2847 - Fix panel toolbars 2020-11-06 09:08:12 +01:00
Molkobain
d76e4255f2 N°2950 - Fix syntax highlighting (CKEditor) not working on AttributeHTML
- Fix for not supported attributes (HTML)
- Migrate selectors for new backoffice markup
2020-11-04 17:25:25 +01:00
Molkobain
fa0bb2b466 N°3203 - Fix regression: PHP notice on object with no class icon 2020-11-04 16:15:18 +01:00
Molkobain
8954d02796 PHPDoc & warnings suppression 2020-11-04 16:15:17 +01:00
Eric
87a2d30c78 N°2847 - revert fieldset style for extensions before 3.0.0 2020-11-04 14:21:28 +01:00
acognet
f718b26b7b N°2847 - Tranform old itop datatable to jquery DataTable 2020-11-04 13:36:20 +01:00
Eric
7cfd888516 N°2847 - fieldset style for extensions before 3.0.0 2020-11-04 12:02:49 +01:00
Eric
cd10c41362 N°2847 - fieldset style for extensions before 3.0.0 2020-11-04 11:50:38 +01:00
Eric
eb391d52fc N°2847 - fieldset style for extensions before 3.0.0 2020-11-04 11:30:46 +01:00
Eric
1fc54edf21 N°2847 - Fix ajax tabs 2020-11-04 10:28:40 +01:00
Eric
cfbfaad154 N°2847 - Dashboards edition 2020-11-03 16:15:03 +01:00
Molkobain
b7543b54e8 N°2847 - Field: Restore HTML metadata lost during migration, add missing ID in template 2020-11-03 15:10:15 +01:00
Molkobain
10afd1cede N°2847 - Panel: Fix top padding being too small since integration with tab containers 2020-11-02 18:04:03 +01:00
Molkobain
b454958742 N°2847 - Refactor Button block for a better use of semantic colors, also change "primary" action color to something less flashy 2020-11-02 17:39:10 +01:00
Molkobain
680f522065 N°2847 - Refactor color palettes SCSS files for a better comprehension 2020-11-02 16:38:01 +01:00
Molkobain
50421f4753 N°3203 - Datamodel: Add semantic for image & state attributes Part. I 2020-11-02 14:51:25 +01:00
Pierre Goiffon
7864461d85 Merge remote-tracking branch 'origin/develop' into feature/backoffice-full-moon-design
# Conflicts:
#	core/cmdbobject.class.inc.php
#	datamodels/2.x/itop-bridge-cmdb-ticket/datamodel.itop-bridge-cmdb-ticket.xml
#	datamodels/2.x/itop-structure/datamodel.itop-structure.xml
2020-11-02 10:30:44 +01:00
Eric
be338e385b N°2847 - Dashboards 2020-11-02 09:59:31 +01:00
Pierre Goiffon
235b4be790 Merge remote-tracking branch 'origin/support/2.7' into develop 2020-10-30 18:09:44 +01:00
BenGrenoble
dfcc3b22a6 Location/physicaldevice_list from structure to bridge. 2020-10-30 16:47:19 +01:00
Eric
f3e47a15f6 N°2847 - Dashlet fix header dynamic 2020-10-30 10:39:58 +01:00
Stephen Abello
a70ed7fcc2 N°2847 Lighter error display on inputs firts validation
Note: Doesn't work with tagsets and enumsets
2020-10-30 10:13:59 +01:00
Eric
c43d52277c N°2847 - Dashlet header static and text 2020-10-29 18:06:04 +01:00
Eric
8a1d17551b N°2847 - Dashlet badge 2020-10-29 17:08:03 +01:00
Eric
6e584cded4 N°2847 - Dashlet group by 2020-10-29 16:15:24 +01:00
Eric
6c7efb2448 N°2847 - Dashlet header dynamic and badges 2020-10-29 15:20:44 +01:00
Stephen Abello
3548d5e264 N°2847 Fix inputs border color 2020-10-29 10:10:35 +01:00
Eric
bd606ca3f9 N°2847 - Move dashboard title and menu to the top bar 2020-10-28 15:43:42 +01:00
BenGrenoble
6c5c71a0ee Contracts_list/Services_list from structure to bridge cmdb ticket 2020-10-28 14:08:00 +01:00
BenGrenoble
dfd9dd3352 Move cis_list from DocumentNote, DocumentWeb, DocumentFile to bridge cmdb ticket 2020-10-28 10:01:55 +01:00
BenGrenoble
6583c9495a Translation Fieldset person 2020-10-28 09:17:58 +01:00
BenGrenoble
93132dc3b4 Person_list in location 2020-10-28 08:49:05 +01:00
BenGrenoble
f257dcfb85 ConfigManagementCI and CI+ in structure dict 2020-10-28 08:48:46 +01:00
Pierre Goiffon
776f32dbe1 🎨 Block ID generation : less risk of id collision
Reported by NonSecureUniqidUsageInspection : when calling \uniqid we should provide true as second parameter.

But was causing issues as the generated string could contain a dot, and this is used in CSS and JQuery selectors (for example a "my.id" cannot be used in #my.id selector)

So we're just replacing dots with hyphens !

Was discussed with @Molkobain in 0119f6c395
2020-10-27 16:58:25 +01:00
Eric
8502fa7721 N°3294 - Display and refresh counters in OQL menu entries 2020-10-27 15:11:30 +01:00
Eric
48b3716278 N°3294 - Fix CSS typo 2020-10-27 11:43:31 +01:00
Pierre Goiffon
5f9cdc0431 Merge remote-tracking branch 'origin/support/2.7' into develop
# Conflicts:
#	test/integration/iTopModulesPhpVersionChecklistTest.php
2020-10-27 10:48:39 +01:00
Pierre Goiffon
6df74073a7 🐛 Fix \Combodo\iTop\Application\UI\UIBlock::GenerateId 2020-10-27 08:42:25 +01:00
Stephen Abello
b59c40570b N°2847 WIP First iteration on form inputs 2020-10-26 17:05:57 +01:00
Pierre Goiffon
444f60c251 Merge remote-tracking branch 'origin/develop' into feature/backoffice-full-moon-design
# Conflicts:
#	core/cmdbobject.class.inc.php
2020-10-26 14:31:49 +01:00
Pierre Goiffon
2425ccb8f2 Merge remote-tracking branch 'origin/support/2.7' into develop
# Conflicts:
#	css/css-variables.scss
#	datamodels/2.x/version.xml
2020-10-26 14:30:33 +01:00
Eric
4fd65a8a62 N°3294 - WIP: Introduce counter in OQL menu entries 2020-10-26 13:37:32 +01:00
Eric
664d3251cc N°3294 - WIP: Introduce counter in OQL menu entries 2020-10-26 12:07:09 +01:00
Molkobain
f31f991365 N°2836 - Portal: Fix image coverage of the medallion 2020-10-25 15:37:07 +01:00
Molkobain
bb1a8a92dd N°2847 - Fix Quick create / Global search drawer position when closed and history full (10 items) 2020-10-25 00:01:58 +02:00
Molkobain
27e1f3d64b N°2836 - Portal: Introduce bubbles conversation as default caselog rendering 2020-10-24 15:22:42 +02:00
Molkobain
95a2ffa0f2 N°2224 - Portal: Enable tooltips for object's attributes description in dynamically added content as well (AJAX, forms, ...) 2020-10-22 21:29:53 +02:00
Molkobain
b1e29cbd81 Fix call to Field::AddMetadata() to remove $sValue as null (regression introduced in cfd9dba6) 2020-10-22 21:28:52 +02:00
Molkobain
2e97b3b593 N°2847 - Add reminders / info message for refactoring 2020-10-22 16:11:58 +02:00
Molkobain
e419060e8a Add type hinting to methods parameters 2020-10-22 16:06:00 +02:00
Molkobain
cfd9dba66e N°2224 - Portal: Enable tooltips for object's attributes description 2020-10-22 16:05:59 +02:00
Molkobain
f72ddd72f3 N°2847 - Tooltip: Add new "Tippy" and "Popper" libs to the portal 2020-10-22 16:05:59 +02:00
Molkobain
d85d29155f N°2847 - Tooltip: Improve mechanism to instantiate them only once 2020-10-22 16:05:59 +02:00
Molkobain
91ee5ebfeb N°2847 - Tooltip: Move new wrappers from CombodoBackofficeToolbox into CombodoGlobalToolbox so it can be used in any GUIs 2020-10-22 16:05:59 +02:00
Molkobain
a6ea75f5fe N°2847 - Rename backoffice.js into backoffice/toolbox.js for better consistency with other toolboxes 2020-10-22 16:05:58 +02:00
Molkobain
dc789f51e9 Warnings suppression 2020-10-22 16:05:58 +02:00
Molkobain
116c0c0138 Portal: Fix double HTML encoding of fields metadata (label, raw value) 2020-10-22 16:05:58 +02:00
Pierre Goiffon
7fa7ebb59c 📝 Fix 2.9.0 version present in deprecated mentions 2020-10-21 19:24:24 +02:00
Pierre Goiffon
0119f6c395 UiBlock : fix typo + inspections 2020-10-21 19:08:17 +02:00
Pierre Goiffon
c8a30b0ccb 📝 N°2286 jquery-layout not used in the whole console anymore 2020-10-21 16:06:06 +02:00
Pierre Goiffon
8e31d77afb N°2591 fix deprecated info 2020-10-21 12:09:06 +02:00
Pierre Goiffon
c7dce73116 Remove dataprovider in iTopModulesPhpVersionIntegrationTest::testITopModulesPhpVersion (#175)
Remove dataprovider in \Combodo\iTop\Test\UnitTest\Integration\iTopModulesPhpVersionIntegrationTest::testITopModulesPhpVersion
The dataprovider was slow, and was very fragile because it contained much PHP code : as seen in 2221e05 when an error appears here it is very difficult to trace :/
So now we have a traditional PHPUnit test method, and still we are testing everytime all modules (not stopping on the first error : we have only one assert at the end instead of an assert per module), and also we're getting the list of modules having errors at the end
2020-10-20 17:10:36 +02:00
Molkobain
71bb071f38 N°2907 - Keep (standard) read-only tabs visible in edit mode
Specifics:
    - User / Grant matrix
    - Subnet / IP Usage
    - Incident / Known errors
    - UserRequest (Simple/ITIL) / Known errors
Generics:
    - History (moved to activity panel)
    - Notifications
2020-10-19 22:21:33 +02:00
Molkobain
deda05351b N°3182 - Show menu group initials when no CSS decoration classes specified 2020-10-19 21:23:07 +02:00
Pierre Goiffon
5d1de543cc Merge remote-tracking branch 'origin/develop' into feature/backoffice-full-moon-design
# Conflicts:
#	core/metamodel.class.php
2020-10-19 15:46:16 +02:00
Pierre Goiffon
be9a428529 Merge remote-tracking branch 'origin/support/2.7' into develop 2020-10-19 15:38:11 +02:00
odain
e7360661be N°3381 - finish integrating healthcheck status.php page 2020-10-19 11:42:48 +02:00
Molkobain
6edb308480 N°3379 - Introduce more modern tooltip lib. in the backoffice
- Allow usage of quotes, especially in attributes description
- Allow line breaks, especially in attributes description
- Allow better positioning (automatic) when close to the screen limits
- Allow HTML (careful about XSS), content is sanitized by default
2020-10-16 11:10:51 +02:00
Pierre Goiffon
43a4d9fcd2 📝 PHPDoc for \cmdbAbstractObject::GetDisplaySet 2020-10-15 16:07:02 +02:00
Molkobain
9a47e3cf74 N°2844 - Continue work on object details: Quick fixes for alpha, will need to be refactored
- Improve display of details in creation/modification/transition modes
2020-10-15 15:55:05 +02:00
Molkobain
e7f01e7597 N°2847 - Alert: Improve spacing when followed by another alter or something else 2020-10-15 15:55:04 +02:00
Vincent Dumas
910358e04d #2639 Enrich tooltips for Action class 2020-10-15 13:12:59 +02:00
odain
4eebb538df 💚 add beforeSetup phpunit group to run test before setup 2020-10-14 18:09:23 +02:00
odain
d304284e36 💚 cleanup 2020-10-14 13:13:25 +02:00
odain
6e6557e909 💚 add beforeSetup phpunit group to run test before setup 2020-10-14 13:03:44 +02:00
Pierre Goiffon
548342159b Merge remote-tracking branch 'origin/develop' into feature/backoffice-full-moon-design 2020-10-14 11:41:58 +02:00
Pierre Goiffon
2221e0541c 🐛 Fix version methods throwing exceptions with version 3.0.0 2020-10-14 11:31:02 +02:00
Molkobain
b15ed80732 Internal: Replace references to iTop 2.8.0 with iTop 3.0.0 2020-10-14 10:16:49 +02:00
Molkobain
986c08aa81 Merge remote-tracking branch 'origin/develop' into feature/backoffice-full-moon-design 2020-10-14 10:09:14 +02:00
Molkobain
8e6351d346 Internal: Replace references to iTop 2.8.0 with iTop 3.0.0 2020-10-14 10:04:10 +02:00
Molkobain
9b19ae5944 Merge remote-tracking branch 'origin/support/2.7' into develop 2020-10-14 09:54:22 +02:00
Molkobain
e35965c065 N°2982 - Move precompiled files to proper module and update XML migration functions 2020-10-14 09:49:21 +02:00
Pierre Goiffon
5b2c279eac Merge remote-tracking branch 'origin/develop' into feature/backoffice-full-moon-design
# Conflicts:
#	js/components/breadcrumbs.js
2020-10-12 12:51:05 +02:00
Pierre Goiffon
72fc22c49a Merge remote-tracking branch 'origin/support/2.7' into develop 2020-10-12 12:49:17 +02:00
Molkobain
b7b1ef1a1f Fix double-encoded breadcrumbs entry introduced by 1e634a8bba 2020-10-09 20:54:51 +02:00
Molkobain
64a96ac001 N°2847 - Dashboard: Improve grid alignments and design of the badge dashlet 2020-10-09 18:42:53 +02:00
Thomas Casteleyn
eb3ad0999a Cleanup utils::GetSessionLog() (#172) 2020-10-09 15:59:24 +02:00
Molkobain
ecf678f39f N°2847 - Quick create: Refactor history truncation 2020-10-09 09:49:26 +02:00
Molkobain
5bc01d3950 N°2847 - Global search: Add config. parameter for max. history results ('global_search.max_history_results') 2020-10-09 09:49:26 +02:00
Stephen Abello
2ae50dfb06 N°2847 Fix Activity new entry form caselog picker disappearing after submitting once 2020-10-09 09:26:39 +02:00
Stephen Abello
b25a6a2f04 N°2847 Correctly open/close Activity new entry form 2020-10-09 09:26:39 +02:00
Molkobain
1bd9d35979 N°2847 - Quick create: Add config. parameter for max. history results ('quick_create.max_history_results') 2020-10-09 09:21:37 +02:00
Molkobain
1dd4d1479c N°2847 - Tab container: Fix min width (alignment with medallion) with short tab labels 2020-10-09 00:06:21 +02:00
Molkobain
00212e8127 N°2847 - Dashboard: Start rework for demo 2020-10-09 00:04:13 +02:00
Molkobain
061f3e9f51 N°2847 - Quick create: Add config. parameter for max. autocomplete results ('quick_create.max_autocomplete_results') 2020-10-08 18:17:35 +02:00
Stephen Abello
e6111609b0 N°3208 Finish Quick object creation component 2020-10-08 17:15:27 +02:00
Molkobain
3556a95f3b N°2847 - Tab container: Fix tab content horizontal alignment 2020-10-08 17:01:59 +02:00
Pierre Goiffon
82735254e7 Compiled CSS
As generated by the setup
2020-10-08 16:27:05 +02:00
Molkobain
44351784e6 N°2847 - Work on the tab container
- Fix CSS class names on vertical mode
- Add class constants
2020-10-08 16:25:45 +02:00
Molkobain
f87002dce3 Introduce CombodoBackofficeToolbox like in the portal to:
- Avoid name collision with other libs for our functions
- Document a set a function developers can use in their extensions, will be completed as things progress
2020-10-08 15:06:22 +02:00
Molkobain
c616e9b65f Remove swfobject.js from iTopWebPage as it was lost during previous merge 2020-10-08 14:38:34 +02:00
Stephen Abello
03418663f2 N°2847 Small scss fix to style JQuery UI modals 2020-10-08 13:30:31 +02:00
Stephen Abello
5a072c75eb N°2847 Fix object details width when using vertical tabs 2020-10-08 10:38:56 +02:00
Pierre Goiffon
10a945eb92 Merge remote-tracking branch 'origin/develop' into feature/backoffice-full-moon-design 2020-10-07 18:48:56 +02:00
Pierre Goiffon
6239c29422 Fix tests
3 files having wrong datamodel XML version
2020-10-07 18:48:46 +02:00
Pierre Goiffon
bb53aef09f Merge remote-tracking branch 'origin/support/2.7' into develop
# Conflicts:
#	application/datamodel.application.xml
2020-10-07 18:37:06 +02:00
Stephen Abello
6cbc7fdb20 N°2847 Fix hardcoded values for Activity New Entry object 2020-10-07 17:01:44 +02:00
Stephen Abello
6a87ce48e1 N°2847 Renamed and moved files for Activity New Entry (thanks to @Molkobain comment on 157e0a6) 2020-10-07 17:01:44 +02:00
Stephen Abello
7770cb31fb N°2847 Add vertical tab options to object details 2020-10-07 17:01:44 +02:00
Molkobain
3adcee6da8 Fix regression introduced in 3b6a03d703 2020-10-07 16:01:23 +02:00
Molkobain
ff3ade7d62 Missing parts of the previous merge 2020-10-07 15:32:18 +02:00
Molkobain
ad59e81144 N°2847 - Activity panel: Improve width when expanded 2020-10-07 13:33:38 +02:00
Molkobain
67ab33e727 Merge branch 'feature/backoffice-full-moon-design' of https://github.com/Combodo/iTop into feature/backoffice-full-moon-design 2020-10-07 13:25:12 +02:00
Molkobain
e81e3a0f1c Merge remote-tracking branch 'origin/develop' into feature/backoffice-full-moon-design 2020-10-07 13:18:14 +02:00
Stephen Abello
e89afa163e N°2847 Remove RichText from preferences 2020-10-07 11:36:44 +02:00
Molkobain
e48d257b00 Merge remote-tracking branch 'origin/develop' into feature/backoffice-full-moon-design
# Conflicts:
#	application/ajaxwebpage.class.inc.php
#	application/csvpage.class.inc.php
#	application/displayblock.class.inc.php
#	application/itopwebpage.class.inc.php
#	application/utils.inc.php
#	application/webpage.class.inc.php
#	application/xmlpage.class.inc.php
#	datamodels/2.x/itop-config-mgmt/datamodel.itop-config-mgmt.xml
#	datamodels/2.x/itop-knownerror-light/datamodel.itop-knownerror-light.xml
#	datamodels/2.x/itop-service-mgmt/datamodel.itop-service-mgmt.xml
#	datamodels/2.x/itop-tickets/datamodel.itop-tickets.xml
#	js/components/breadcrumbs.js
#	pages/navigator.php
#	test/core/DBSearchTest.php
2020-10-07 11:36:15 +02:00
BenGrenoble
51669d0479 Fix datamodel Navigation rules and module parameters 2020-10-07 11:08:11 +02:00
BenGrenoble
f983655c68 Fix datamodel Branding 2020-10-07 11:07:34 +02:00
Stephen Abello
157e0a6915 N°2847 Add backend for new entry form for activity panel 2020-10-07 09:46:23 +02:00
Pierre Goiffon
7d26b6092e Merge remote-tracking branch 'origin/support/2.7' into develop
# Conflicts:
#	.idea/codeStyles/codeStyleConfig.xml
#	.idea/inspectionProfiles/Combodo.xml
2020-10-06 10:42:55 +02:00
Molkobain
f5e92359d9 N°2847 - Form: Fix return type in Form::GetAction() 2020-10-05 17:13:32 +02:00
Molkobain
8994f82e0f N°2847 - Fieldset: Fix alignement/positionning with siblings, parent (also some renaming and variables extraction) 2020-10-05 17:03:17 +02:00
Molkobain
8551322cd7 N°2847 - Multi columns layout: Fix alignment with parent (also some renaming to match conventions) 2020-10-05 16:26:41 +02:00
Molkobain
be075dd695 N°2847 - Object details: Fix alert messages overlapping header and multicolumn layout 2020-10-05 15:53:45 +02:00
Molkobain
0691fca412 Add @since to newly created constants 2020-10-05 13:22:29 +02:00
Molkobain
3298966174 N°3279 - Change "user_id" from integer to external 2020-10-05 13:21:27 +02:00
Molkobain
79514358db N°2847 - Tab container: Fix some issues
- Fix extra tabs list being behind the tab content
- Sanitize tab ID in the HTML
2020-10-05 11:03:23 +02:00
Molkobain
aa38be4578 Improve JSDoc of IsElementVisibleToTheUser() 2020-10-05 11:03:22 +02:00
Molkobain
e911290b3d Improve utils::Sanitize()
- Add class constants for $sSanitizationFilter values (You should use them instead of hard-coding the value, for example: utils::ENUM_SANIZATION_FILTER_XXX)
- Fix "element_identifier" filter of utils::Sanitize() to keep "-" character
- Add 'sanitize_identifier' filter to TWIG
2020-10-05 11:03:22 +02:00
Molkobain
dc24bbcd97 N°2847 - Comment old history tab (waiting for decision on the DisplayBareHistory before removing it) 2020-10-05 08:45:12 +02:00
Molkobain
ea8a8e3afa N°2847 - Add lifecycle states default colors 2020-10-05 08:43:32 +02:00
Molkobain
6fb5d20971 N°2847 - Tab container: Improve global look & feel; responsive tabs. 2020-10-04 23:22:41 +02:00
Molkobain
b3522017e7 Add new JS helper to know if an element is visible to user 2020-10-04 18:37:12 +02:00
Molkobain
e5b22d270e N°2847 - Add SCSS helper for hyperlinks to inherit colors from their parent instead of being of the default color (brand primary) 2020-10-03 23:41:50 +02:00
Molkobain
b8af22baad N°2847 - Fix object details being too wide 2020-10-02 22:09:18 +02:00
Molkobain
5626da7a5e N°2847 - Object details: Preliminary work
- Add ObjectFactory for ObjectDetails, ObjectCard, ...
- Update SCSS files to integrate its components

Note: A big part of the CSS is hardcoded in cmdbAbstract for now as we still need to discuss / work on the migration of the cmdbAbstract APIs (DisplayBareHeader, DisplayBareProperties, ...)
2020-10-02 11:40:46 +02:00
Molkobain
79ad75a2c2 N°2847 - Panel: Fix padding / font size 2020-10-02 11:40:26 +02:00
Molkobain
41c833d0c6 N°2847 - Work on TabContainer: Move SCSS and HTML files to the layout folder 2020-10-02 11:40:26 +02:00
Molkobain
29f58103b0 N°2847 - Comment (temp) migrated parts of the iTopWebPage 2020-10-02 11:40:26 +02:00
Molkobain
15a9856f89 N°2847 - Rework of Panel block
- Add 2 separate content areas (main and toolbar)
- Improve HTML template with header
- Prepare ObjectDetails block based on a panel
2020-10-02 11:40:25 +02:00
Stephen Abello
b3bb77c8ee N°2847 Finish UX/UI for new caselog entry 2020-10-02 10:54:40 +02:00
Stephen Abello
c2fe1bc5cb N°2847 Add new entry form for activity panel (static atm) 2020-10-02 10:54:39 +02:00
Molkobain
7f56911f41 Code cleanup 2020-10-01 22:07:41 +02:00
Molkobain
83a547bbf4 N°2844 - Fix mixed up activity entries
Note: Re-display the history tab for now so we can check consistency between history tab and activity panel
2020-10-01 22:02:03 +02:00
Molkobain
8e16d537ff N°2847 - Fix crash on object edition due to TitleFactory::MakeForObjectDetails() refactor 2020-10-01 17:50:59 +02:00
Molkobain
d9fe4599ff N°2847 - Fix tabs being centered instead of being align on the left 2020-10-01 17:49:10 +02:00
Molkobain
50bf0c9a27 N°2847 - Rework of TabContainer / Tab
- Add JS widget to handle front-end logic and for better encapsulation
- Move SCSS files to match convention
- Update SCSS files
- Remove unused SCSS file
- Move HTML templates to match convention
- Remove unused HTML template
- Renamed codes and folders to match convention
- Update PHPDoc
- Reformat code
- Remove usage of return type hinting when using "self"
2020-10-01 17:33:27 +02:00
Molkobain
261131d6d7 PHPDoc and code cleanup 2020-10-01 17:33:26 +02:00
Molkobain
5276b48ed4 N°2847 - Rework of MultiColumn / Column
- Remove unused HTML template
- Move SCSS files to match convention
- Move Column under MultiColumn to match convention (eg. ActivityPanel, PopoverMenu)
- Update PHPDoc
2020-10-01 17:33:26 +02:00
Molkobain
6fd56f750e N°2847 - UIContentBlock: Change code from "contentblock" to "content-block" to match convention 2020-10-01 17:33:25 +02:00
Molkobain
57fda98981 Reformat code 2020-10-01 17:33:24 +02:00
Molkobain
ce001a8097 N°2847 - Rework on iUIContentBlock and PageContent
* Add new Trait tUIContentAreas to handle multiple content areas across UIBlock classes (extracted from PageContent)
* Remove return type hinting in some method when type was "self" or the class itself when it's meant to be overloaded (works only with PHP 7.4+)
* Update some PHPDoc
* Reformat some brackets
2020-10-01 17:33:24 +02:00
Molkobain
d49dd8b993 N°2847 - Start classes icon update 2020-10-01 17:33:23 +02:00
Molkobain
eeec5989d9 Visual tests: Fix panels title 2020-10-01 17:22:28 +02:00
Molkobain
f25ef7f5ac N°2847 - Prepare object details header for demo (will be reworked) 2020-10-01 17:22:27 +02:00
odain
5862ecde69 N°3117: force itop-structure loading during setup 2020-09-30 17:32:07 +02:00
Molkobain
f8129fab74 N°2899 - Setup: Fix "For CryptoEngine ..." mandatory PHP extension introduced in the previous commit 2020-09-30 16:22:35 +02:00
odain
ee9343cf40 N°3117: fix refactor regarding itop-structure setup 2020-09-30 16:00:36 +02:00
Molkobain
1b2dd04409 N°2899 - Setup: Remove mbstring from optional PHP extensions now that it is mandatory (7d1a61a2f) (Thanks @Hispka !) 2020-09-30 14:38:55 +02:00
Eric
40f3d6efbe N°2847 - fix newsroom target for links 2020-09-30 11:59:22 +02:00
Eric
5c07591519 N°2847 - fix newsroom target for links 2020-09-30 11:56:55 +02:00
Eric
f0f7653884 N°2847 - revert fix inline scripts 2020-09-30 10:54:34 +02:00
Stephen Abello
de54d28c6b N°2847 Fix newsroom not being displayed with block render changes 2020-09-30 10:40:41 +02:00
Eric
292457595c N°2847 - Fix inline scripts 2020-09-30 10:36:01 +02:00
Eric
a99f03e510 N°2847 - Edit/Create objects 2020-09-30 09:56:03 +02:00
Stephen Abello
fd3f972948 N°2847 Add RichText input 2020-09-30 09:42:36 +02:00
Stephen Abello
12bf77d9ca N°2847 Refactor Inputs components 2020-09-30 09:42:36 +02:00
Stephen Abello
c0337eaa23 N°2847 Fix twig missing templates (missing file or wrong case) 2020-09-30 09:42:36 +02:00
Eric
b8d71b2bfb N°2847 - Edit/Create objects 2020-09-29 17:35:02 +02:00
Thomas Casteleyn
5ef6b6c5d0 Cleanup references to Flash (#163)
All remaining Flash files are removed. Dependent Combodo extensions will me modified for iTop 2.8.0 (Combodo ref N°3344, N°3345)

Old swf_navigator operation in UI.php was kept for compatibility but is deprecated

Co-authored-by: Molkobain <guillaume.lajarige@combodo.com>
Co-authored-by: Pierre Goiffon <pierre.goiffon@combodo.com>
Co-authored-by: rquetiez <romain.quetiez@combodo.com>
2020-09-29 15:56:08 +02:00
Eric
078f81e853 N°2847 - Shortcut buttons look 2020-09-29 15:02:05 +02:00
Eric
11a79501da N°988 - Backoffice: Hide empty fieldsets in object details 2020-09-29 14:21:01 +02:00
Molkobain
3dc7b66f6f N°2847 - Code clean up
* Fix TWIG exceptions due non existent JS templates for ajax tab
* Fix DisplayBlock::GetRenderContent and HistoryBlock::GetRenderContent signature mismatch warning
* Add return type hinting on ButtonFactory methods
* Rename ButtonFactory::MakeAlternativeNeutralActionButton() to ButtonFactory::MakeLinkNeutral()
* Add ButtonFactory::MakeLinkNeutral() to visual test page
* Fix button spacing/padding when only icon or label
2020-09-29 10:35:16 +02:00
Eric
2b0bdda1e0 Fix type hinting 2020-09-29 09:23:13 +02:00
Molkobain
794ee89d12 N°2847 - Fix "quick create" history display 2020-09-28 17:14:46 +02:00
Molkobain
c37aabfc8c N°2847 - Fix TWIG exceptions due non existent JS templates 2020-09-28 17:14:13 +02:00
Molkobain
987ab4cbfb PHPDoc and code cleanup 2020-09-28 16:54:58 +02:00
Molkobain
0aaa0a33bf N°2847 - Remove history tab from object details 2020-09-28 16:37:39 +02:00
odain
3fd9aa01ed Merge branch 'feature/b3217-2dev' into develop 2020-09-28 16:35:22 +02:00
odain
97380fd5f4 N°3117 Refactor of datamodel and dictionnaries for the sake of modularity
- New module itop-bridge-cmdb-ticket to cope with the need to install only the CMDB or/and ticketing
	- New module itop-structure to hold declarations required by iTop independently from ITIL. Note that these declarations should ideally be moved to application/datamodel.application.xml or core/datamodel.core.xml. Anyhow, the compiler suffers a few limitations and it has been decided to create this module as a workaround.
	- Split of known-error module into itop-faq-light and itop-knownerror-light
2020-09-28 16:34:06 +02:00
odain
bcd41dfe96 Merge branch 'feature/b3217-squash' into develop 2020-09-28 15:08:57 +02:00
odain
54eb86a16b N°3117 Refactor of datamodel and dictionnaries for the sake of modularity
- New module itop-bridge-cmdb-ticket to cope with the need to install only the CMDB or/and ticketing
	- New module itop-structure to hold declarations required by iTop independently from ITIL. Note that these declarations should ideally be moved to application/datamodel.application.xml or core/datamodel.core.xml. Anyhow, the compiler suffers a few limitations and it has been decided to create this module as a workaround.
	- Split of known-error module into itop-faq-light and itop-knownerror-light
2020-09-28 15:08:21 +02:00
Eric
795b28263a N°2847 - Fixed unit tests 2020-09-28 11:23:31 +02:00
Eric
8306ce36a0 N°2847 - Fixed multi-column bottom margin 2020-09-25 18:21:23 +02:00
Eric
6c46c7ff3a N°2847 - Fixed configuration editor 2020-09-25 18:16:05 +02:00
Eric
bfd4ba16d9 N°2847 - Action buttons 2020-09-25 16:02:18 +02:00
Eric
6969e4db1b N°2847 - Title CSS 2020-09-24 15:12:25 +02:00
Pierre Goiffon
661d84fc77 ThemeHandlerTest : fix tmp dir clean up 2020-09-24 14:17:08 +02:00
Pierre Goiffon
9eac12bd9c Fix CSS precompilation signature check on non Linux OS
* fix images paths comparison
* fix MD5

Were depending on platform : \ThemeHandlerTest::testGetIncludedImages test passed on Linux, not on Windows due to different DIRECTORY_SEPARATOR
2020-09-24 12:38:16 +02:00
Eric
ecd5a7aadf N°2847 - FieldSet, MultiColumn, Tab for object details CSS 2020-09-24 10:45:14 +02:00
Eric
7bf473d2a3 N°2847 - FieldSet, MultiColumn, Tab CSS 2020-09-23 14:51:18 +02:00
Eric
98d2e42bad N°2847 - FieldSet and Fields 2020-09-23 08:55:58 +02:00
Pierre Goiffon
9e9b192b3c N°2214 Blocks execution for PHP < 7.0.0
As older PHP version can cause multiple problems, and we still use lots of requires that can generate PARSE_ERROR on such version, we chose to add this very low-level control. Therefore user will get a clear error message, and oldest PHP version will be blocked in the whole application.
2020-09-22 15:35:13 +02:00
Pierre Goiffon
98789f28bb N°3198 Relations Table Mode : control duplicates server side 2020-09-22 13:32:32 +02:00
Eric
33f11d2a43 N°2847 - Form and Input WIP 2020-09-22 13:26:14 +02:00
Eric
40efaf0360 N°2847 - Tab Management 2020-09-22 08:24:18 +02:00
Eric
74160d2447 N°2847 - Add Title component
* Add id to button factory
 * Rework of Configuration File Editor page
2020-09-18 18:16:09 +02:00
Eric
08eada82f4 N°2847 - Fix External key selection 2020-09-18 18:16:09 +02:00
Eric
9cd719ab56 N°2847 - Separate inline scripts and css from html in the rendering of pages 2020-09-18 18:16:09 +02:00
Eric
e83dfe5982 N°2847 - refactor twigs 2020-09-18 18:16:08 +02:00
Pierre Goiffon
077ac81208 Merge remote-tracking branch 'origin/develop' into feature/backoffice-full-moon-design 2020-09-18 14:24:19 +02:00
Pierre Goiffon
36f8344ec9 Merge remote-tracking branch 'origin/support/2.7' into develop
# Conflicts:
#	js/table-selectable-lines.js
2020-09-18 14:23:36 +02:00
Pierre Goiffon
745e4aa424 Merge remote-tracking branch 'origin/develop' into feature/backoffice-full-moon-design
# Conflicts:
#	webservices/import.php
2020-09-18 10:48:34 +02:00
Pierre Goiffon
5405ae1d91 Merge remote-tracking branch 'origin/support/2.7' into develop 2020-09-18 10:47:30 +02:00
Pierre Goiffon
ed1bb3e93a N°2214 Add PHP check in CLI scripts : 2nd code review with Romain
- fix wrong test in \SetupUtils::CheckPhpAndExtensions
- fix \SetupUtils::CheckGraphviz consumers in WizardStep : do not assume that only one CheckResult is returned... doing a for each loop instead !
- json_encode prb on Windows : pull up default messages from consumers to \SetupUtils::CheckGraphviz (was introduced in 6e754d4fa5)
2020-09-18 10:43:39 +02:00
Pierre Goiffon
0773660ef2 N°3198 Relations Table Mode : update table select line script
Was selecting line when clicking in the ext key widget (drop-down using Selectize, search/add widgets)
2020-09-17 14:48:00 +02:00
Eric
68b8490288 N°2847 - Refactor 2020-09-17 11:01:41 +02:00
Eric
f100e9bd09 N°2957 - allow empty class parameter 2020-09-16 17:57:38 +02:00
Eric
0ffe76e359 N°2847 - Fix Global search 2020-09-16 17:38:46 +02:00
Eric
e3739641b4 N°2847 - Ajax page javascripts 2020-09-16 17:16:01 +02:00
Eric
410a637598 N°2847 - Tab Management - iTop Pages refactoring - introduction of UIContentBlock as base block 2020-09-16 12:00:48 +02:00
Pierre Goiffon
eded4814a1 Merge remote-tracking branch 'origin/support/2.7' into develop 2020-09-14 14:27:18 +02:00
Pierre Goiffon
b9f9322418 N°2214 Remove type hinting in SetuUtils for compatibility issues
This file needs to be able to run on very old PHP versions !
2020-09-14 11:38:55 +02:00
Pierre Goiffon
4badb90344 N°2214 Cron : remove :void to keep compatibility with PHP < 7.1
see https://www.php.net/manual/fr/migration71.new-features.php#migration71.new-features.void-functions
2020-09-14 11:02:18 +02:00
Thomas Casteleyn
0542a8e4f8 Synchro cleanup (#157)
* Cleanup duplicate code
* Document undocumented parameter
* Removed duplicate code for consistency
2020-09-14 09:53:40 +02:00
Pierre Goiffon
f0434f9125 🎨 N°2214 In SetupUtils::Check* methods : replace debug SetupLog calls by CheckResult::TRACE objects
This is the caller responsibility to log using the correct classes !
Also we need to remove this dependency O:)

Modifications:
* reverts e8e259dde9 as SetupPage is no longer called since N°2522 / c4b7be5b6f
* \SetupUtils::Log : remove useless final, add PHPDoc and type hinting to modified methods
* add PHPDoc and type hinting to modified methods
* add \CheckResult::TRACE
* replace SetupLog::Log calls by CheckResult::TRACE
* modify SetupUtils::Check* callers to handle the new TRACE severity
2020-09-11 18:37:30 +02:00
Lars Kaltefleiter
43cadb0ede N°3287 - Set from display name / label in action email
Co-authored-by: Thomas Casteleyn <thomas.casteleyn@me.com>
2020-09-11 09:50:14 +02:00
Pierre Goiffon
11f00cc229 N°2214 PHP version check in CLI scripts : remove some checks in CLI, and various improvements
Initial commit : b7136c0b7a

Removed checks : see \SetupUtils::CheckPhpAndExtensions PHPDoc

Other improvements :
* add PhpDoc on new public method \SetupUtils::CheckPhpAndExtensions
* add type hinting and new format on SetupUtils new methods
* refactor CheckResult[] filter method to be more generic
2020-09-10 16:52:47 +02:00
Stephen Abello
163c1ebc91 N°2847 Add disabled state for Button component 2020-09-10 15:33:35 +02:00
Eric
580e8ffa08 N°2847 - Refactor Web Pages classes - add deprecated files for extensions compatibility 2020-09-10 11:35:21 +02:00
rquetiez
f5a3bb2baa N°3251 - Null in data synchro (fixes the regression introduced in a1f5d80)
- restore the initial behavior, thanks to hipska through PR#166
- refactor so as to make it clear that no SQL injection is possible (and will never be)
- add PHPUnit tests on the data synchronization => up to 20s to execute
- fix utils::ExeciTopScript to alow its usage within the automated test
2020-09-09 22:41:13 +02:00
Eric
63f8ec594c N°2847 - Refactor Web Pages classes - Add UIBlockManager to the WebPage 2020-09-09 18:10:06 +02:00
Eric
2df2392cc6 Fix images in form edition 2020-09-09 14:27:58 +02:00
odain
d2e5e96a63 💚 fix remaining failed tests after merge 2020-09-09 06:52:09 +02:00
Molkobain
8193ada159 Merge remote-tracking branch 'origin/develop' into feature/backoffice-full-moon-design
# Conflicts:
#	composer.json
#	css/light-grey.scss
#	lib/composer/autoload_classmap.php
#	lib/composer/autoload_static.php
2020-09-08 17:30:32 +02:00
Eric
46fe1661db Display modal 2020-09-08 17:20:13 +02:00
odain
2ff6658a56 Merge branch 'develop' into feature/b3217-2dev 2020-09-08 17:00:41 +02:00
Benjamin Planque
f25cd70e73 datamodel and dictionnaries refactoring/cleanup 2020-09-08 16:36:21 +02:00
odain
b5cfd1c61e 💚 uncomment test 2020-09-08 11:36:42 +02:00
Molkobain
3c9c3204ac N°2847 - Update folders order 2020-09-08 10:11:21 +02:00
odain
7ab274cb7b 💚 fix test after merge 2020-09-08 09:21:06 +02:00
Molkobain
7d1a61a2f9 N°2899 - Setup: Add mbstring as mandatory PHP extension 2020-09-08 09:12:43 +02:00
odain
3c299654e3 N°3265 - Log stacktrace when cron exception raised with debug enabled 2020-09-07 16:57:27 +02:00
odain
1eba8ba4ac Merge branch 'support/2.7' into develop 2020-09-07 16:48:15 +02:00
Thomas Casteleyn
9daf23576d Update the movie icon with a flat design 2020-09-07 15:20:08 +02:00
Thomas Casteleyn
b9f23177e7 Add attachment icon for movie files 2020-09-07 15:20:08 +02:00
Thomas Casteleyn
6542cf9d30 Add missing "
Co-authored-by: Eric Espié <eric.espie@combodo.com>
2020-09-06 20:30:36 +02:00
Thomas Casteleyn
610e74e642 Fix filename headers when downloading 2020-09-06 20:30:36 +02:00
OИUЯd da silva
c3ecd51153 Merge pull request #134 from itomig-de/feature/IsWriteAllowed
Enable external classes to use bypass function as well
2020-09-04 10:26:30 +02:00
Eric
ff722b579b Fix Dependent attributes update on DBObject::Set() 2020-09-03 12:57:01 +02:00
Eric
7e0fbd8c25 revert file 2020-09-02 15:42:44 +02:00
Eric
9f592223d9 Add Cron info to the report 2020-09-02 14:41:06 +02:00
Molkobain
99fc41a0f8 PHPDoc & code cleanup 2020-09-02 12:01:35 +02:00
Eric
76fbd3790f N°3123 - Update the list of required PHP extensions 2020-09-02 10:47:42 +02:00
Eric
d3b57c3bda N°3111 - Fix Portal export 2020-09-01 17:17:01 +02:00
acognet
a61ffaf3c0 N°3184 - Upgrade JQuery UI (iTop 2.8) 2020-09-01 16:36:49 +02:00
acognet
cc6ab8a7b7 N°3184 - Upgrade JQuery UI (iTop 2.8) 2020-09-01 09:06:14 +02:00
acognet
432a565221 N°2508 - Include Obsolescence icon within list and autocomplete 2020-09-01 09:06:14 +02:00
bruno-ds
7d8aaf91db :greenheart: test readability 2020-08-31 14:48:49 +02:00
Molkobain
eb99dc9f3f Add Lucas Mindêllo de Andrade (a.k.a @rokam) to the contributors list, huge thank you!
Note: We start to put GitHub aliases next to the full name of contributors. If you want yours to be added/updated, just comment this commit 🖖
2020-08-31 13:17:47 +02:00
Lucas Mindêllo de Andrade
f59f2b2109 Update PT BR translations (#159)
* Correct threshold translation
* Better translation for closed requests
* itop-portal better translation
* Fixed typo
* Missing PT-BR translations
* Removed ~~ from translated messages

Co-authored-by: Lucas Mindêllo de Andrade <lucas.rokam@gmail.com>
2020-08-31 13:12:20 +02:00
Molkobain
2840f6930b N°2847 - Navigation menu: Fix newsroom icon color on hover 2020-08-28 22:15:47 +02:00
Molkobain
c50b6c806a N°2847 - Navigation menu: Fix user picture size / position when image is taller than wide 2020-08-28 22:11:36 +02:00
odain
84cd18bcb8 💚 fix test to make conversion functions exist for any one found in datamodels files (itop pro version) 2020-08-28 21:05:04 +02:00
Molkobain
c2fcadd54d N°2847 - Add optional user_id to CMDBChange
Important: This can make the setup / toolkit to take a very long time on large databases as the "priv_change" table is one of the largest. SQL queries to run and/or a migration tool will be provided when 2.8.0 will be released.
2020-08-28 19:46:40 +02:00
odain
26ba45a8da 💚 fix test to make conversion functions exist for any one found in datamodels files 2020-08-28 18:35:05 +02:00
odain
4cc31bf941 💚 fix test to make conversion functions exist for any one found in datamodels files 2020-08-28 17:23:02 +02:00
odain
0d878a52a2 💚 fix test to make conversion functions exist for any one found in datamodels files 2020-08-28 16:48:04 +02:00
Eric
d1af851fcd N°2591 - API : deprecate \CMDBObject::CheckUserRights 2020-08-28 14:48:00 +02:00
Eric
ec72d1c767 N°3078 - Fix error on login while in maintenance mode
Fix infinite loop on login failure
2020-08-28 14:26:42 +02:00
Molkobain
3add77308a N°2847 - ActivityPanel: Fix entry's author info for CMDBChangeOp 2020-08-27 18:57:41 +02:00
Molkobain
d0ea3665be PHPDoc & code cleanup 2020-08-27 16:37:18 +02:00
Molkobain
ae19737472 PHPDoc & code cleanup 2020-08-27 16:23:29 +02:00
Molkobain
4c236b4422 N°2847 - Breadcrumbs: Fix type hint in SetNewEntry ($aNewEntry can be null) 2020-08-27 16:15:07 +02:00
acognet
c4b7be5b6f N°2522 - API : Deprecate SetupPage:log* 2020-08-27 11:17:42 +02:00
Eric
1afc6cd4c5 N°2363 - Fix typo 2020-08-27 10:50:34 +02:00
Eric
3b6a03d703 Fix warning if not countable 2020-08-27 09:57:00 +02:00
odain
a4842f9e5c N°2996 - Remove iTop version from css-variable.scss
Fix PCRE non backward compatibility between PHP 7.2 and 7.3
2020-08-27 09:37:10 +02:00
Molkobain
0bef32cf8d N°2847 - Alert & Panel: Add top spacing, fix border-radius and reorder some parts of the SCSS 2020-08-26 22:15:50 +02:00
Molkobain
825c70c001 Introduce type hinting in methods prototype (PHP >= 7.1) 2020-08-26 21:22:39 +02:00
Molkobain
77cd764b1c PHPDoc & code cleanup 2020-08-26 21:22:25 +02:00
Molkobain
2864d48fa7 N°2847 - Flag TODOs as 2.8.0 so we don't forget any 2020-08-26 20:37:22 +02:00
Molkobain
b5c97e35bf Add visibility to class constants (PHP >= 7.1) 2020-08-26 19:02:53 +02:00
odain
9a0d9d2c38 Merge branch 'feature/fast-theme-compilation2' into develop
N°2982 - speedup themes/scss compilation during setup
N°2996 - Remove iTop version from css-variable.scss
2020-08-26 17:59:31 +02:00
Molkobain
8bdaec0129 N°2847 - Alert & Panel: Improve factories, add color schemes, add visual tests 2020-08-26 17:45:22 +02:00
Molkobain
3b0ca9d771 N°2847 - Add "information" semantic to color palette, reorder colors like a rainbow 🌈 2020-08-26 17:45:22 +02:00
Molkobain
fa406c1f17 PHPDoc & code cleanup 2020-08-26 17:45:22 +02:00
odain
dd18430e70 remove GetCompiledModuleVersion deprecation 2020-08-26 16:33:49 +02:00
Molkobain
7f3c10b69d Merge remote-tracking branch 'origin/develop' into feature/backoffice-full-moon-design 2020-08-26 16:09:23 +02:00
Molkobain
0a5e4effc0 N°2847 - Fix Html and Panel namespaces 2020-08-26 16:05:33 +02:00
Molkobain
737e17066f N°2847 - Add page for visual testing of blocks 2020-08-26 16:03:34 +02:00
Molkobain
8108dc8803 N°2847 - Button: Reformat SCSS file 2020-08-26 16:03:34 +02:00
Molkobain
61ec7f8053 N°2847 - Button: Add factory, color constants and refactor existing code to use the factory 2020-08-26 16:03:33 +02:00
Molkobain
d5f44ffd7b N°2847 - Alert: Add factory and color constants 2020-08-26 16:03:33 +02:00
Molkobain
d2bf4de84c N°2847 - Refactor some early choices
- TWIG: Change calls to object methods from simple notation (eg. oObject.Id) to complete notation (eg. oObject.GetId()) to avoid confusion with use of arrays and variables (eg. aObject.sId)
- UIBlock: $sId should not be first parameter as most of the time it can be ignored and generated by the system
- NewsroomMenu: Rename method for something more less ambiguous
- Html: Embed content in <div /> so we can easily find all such HTML fragments in the UI
2020-08-26 16:03:33 +02:00
Molkobain
5320f69c44 PHPDoc & code cleanup 2020-08-26 16:03:32 +02:00
Molkobain
eb1322dc3e N°2847 - iTopWebPage: Continue cleanup of the legacy code 2020-08-26 16:03:32 +02:00
odain
e8e259dde9 N°2214 - Add a PHP version check in CLI PHP scripts- fix import.php script 2020-08-26 15:56:11 +02:00
Eric
5df7c8bb07 Add Async tasks info 2020-08-26 16:12:22 +02:00
Eric
bf142e5e07 Add Async tasks info 2020-08-26 13:11:04 +02:00
odain
8319d655b9 💚 renaming postbuild test folder + fix tests 2020-08-26 12:42:48 +02:00
odain
f5c8411a07 💚 ThemeHandlerTest: test fix + enhance failure messages 2020-08-26 12:09:55 +02:00
Eric
2ad4fd1707 N°580 - Autocomplete with namesakes. Complement for select. Fix error when no complement specified 2020-08-25 13:12:53 +02:00
Eric
761c2a46a3 N°3234 - Cron rework
* some timezone refactors occurred
2020-08-25 11:20:17 +02:00
odain
c986927de9 CI switching 2020-08-24 14:11:25 +02:00
Eric
e8eb6d0e31 N°3249 - N°2957 - Revert one file per class => generate all the classes in the same file: model.<module>.php to address forward declaration of classes 2020-08-24 12:41:49 +02:00
Eric
077772ea9c N°2969 - moved dictionaries 2020-08-24 09:31:34 +02:00
rquetiez
3119af6c29 N°3268 Add test to check dictionary files: make sure that the Dict::Add declarations match the file name 2020-08-21 17:43:40 +02:00
Molkobain
83ef7cff8a N°3267 - Webservices: Fix optional headers not being taken into account 2020-08-21 16:55:03 +02:00
Stephen Abello
93eace9e5b N°2847 Fix preference page width 2020-08-21 14:02:41 +02:00
acognet
2142ffedc3 Add PHP Warning for misused of the function OptimizeColumnLoad 2020-08-20 16:44:44 +02:00
acognet
23c0a67914 N°580 - Autocomplete with namesakes. Complement for select 2020-08-20 16:42:43 +02:00
Eric
3b00911f62 Merge branch 'GurneyHallack-feature/api-core_get' into develop 2020-08-20 15:46:19 +02:00
Eric
b9b1e436ec Merge branch 'feature/api-core_get' of https://github.com/GurneyHallack/iTop into GurneyHallack-feature/api-core_get 2020-08-20 15:44:52 +02:00
Eric
87312d4457 N°2969 - Fix relative path of dictionaries 2020-08-20 14:45:43 +02:00
Stephen Abello
9dcb4bbfe5 N°2847 First step to convert user preferences page to our new design 2020-08-20 11:14:15 +02:00
Stephen Abello
11f27019e4 N°2847 - Add Html component
- Fix icons on buttons
- Comment some rules from legacy css
2020-08-20 11:14:15 +02:00
Stephen Abello
dd81c76aaa N°2847 Add margin to panels and buttons siblings 2020-08-20 11:14:14 +02:00
Pierre Goiffon
4e5bbcde35 N°3198 n:n relations in edit mode : refresh remote class fields on extkey change 2020-08-19 16:06:37 +02:00
Pierre Goiffon
7d7270296e 🎨 📝 format & add comment 2020-08-19 16:06:37 +02:00
Pierre Goiffon
44e188fa2c N°3198 n:n relations in edit mode : extkey to remote class is now editable 2020-08-19 16:06:11 +02:00
Molkobain
e6bab46854 Add unit tests for XML migration from 1.8 > 1.7 and 1.7 > 1.6 2020-08-19 11:36:40 +02:00
Molkobain
0a4ce0865e Increase XML version to 1.8 2020-08-19 11:12:39 +02:00
Molkobain
da1d3db204 N°2847 - Activity panel: Fix filtering on CMDBChangeOp entries 2020-08-19 11:01:13 +02:00
Molkobain
880be200ae Revert "N°2847 Fix first and last popover menu item border radius"
This reverts commit 417008f5
2020-08-19 10:23:40 +02:00
Molkobain
c5b8d3fa72 Merge remote-tracking branch 'origin/develop' into feature/backoffice-full-moon-design
# Conflicts:
#	application/datamodel.application.xml
#	application/itopwebpage.class.inc.php
#	css/light-grey.scss
2020-08-19 10:20:37 +02:00
Stephen Abello
417008f549 N°2847 Fix first and last popover menu item border radius 2020-08-19 10:12:04 +02:00
Molkobain
8077e5aa62 PHPDoc & code cleanup 2020-08-19 10:09:02 +02:00
Molkobain
2ce1c2efec N°2847 - Work on the ActivityPanel and PopoverMenu features
- Deprecate cmdbAbstractObject::DisplayBareHistory() as history will be replace by ActivityPanel
- Rename illustrations to original filenames to find source more easily
- Remove unused "max_history_case_log_entry_length" config. parameter
- Activity panel: Introduce iCMDBChangeOp and iCMDBChangeOpSetAttribute interface for better dependency injection
- Activity panel: Add placeholder when no entry
- Activity panel: Fix tab toolbar icons color
- Activity panel: Add history entries (entries after the first 50 are not loaded yet)
- Popover menu: Fix no border-radius on first/last entries hover
2020-08-19 10:09:01 +02:00
Pierre Goiffon
c69e83f779 Merge remote-tracking branch 'origin/support/2.7' into develop 2020-08-18 17:50:39 +02:00
odain
91006351d3 Fix tests 💚 2020-08-18 17:20:47 +02:00
acognet
e43f55df03 N°2508 - Include Obsolescence icon within list and autocomplete 2020-08-18 15:55:03 +02:00
acognet
0f741f28f3 N°2508 - Include Obsolescence icon within list and autocomplete 2020-08-18 15:14:50 +02:00
acognet
4d2633a9ea N°2508 - Include Obsolescence icon within list and autocomplete 2020-08-18 14:19:36 +02:00
Eric
c5d265f66b N°3249 - Fix move To Production. Fix compiler code generation broken by N°2957 2020-08-18 14:17:01 +02:00
Eric
0311fe330b Fix setup CSS 2020-08-18 14:14:52 +02:00
acognet
4648e436ac N°2508 - Include Obsolescence icon within list and autocomplete 2020-08-18 12:42:48 +02:00
Stephen Abello
e39947f72c N°2847 Add semantic colors to alert and panel component 2020-08-18 12:06:18 +02:00
Stephen Abello
74db53d51d N°2847 Add alert component 2020-08-18 12:03:21 +02:00
odain
0b9ba4d053 Merge branch 'feature/release-checklist-2.7' into develop 2020-08-18 10:31:02 +02:00
acognet
700d11fa8f N°2508 - Include Obsolescence icon within list and autocomplete 2020-08-18 10:19:01 +02:00
acognet
f64e081c1f Remove file unused 2020-08-18 10:19:01 +02:00
acognet
54b6a29ba0 N°2393 - API : Font Awesome remove v4 compatibility 2020-08-18 10:19:00 +02:00
acognet
e0bf262343 N°2534 - dashboard: bug with autorefresh that deactivates filtering on organizations 2020-08-18 10:19:00 +02:00
Pierre Goiffon
3a276715d6 📝 SECURITY : fix typo 2020-08-18 09:18:37 +02:00
Stephen Abello
9516e7f023 N°2847 Add panel component 2020-08-17 17:02:57 +02:00
Stephen Abello
223b063c60 N°2847 Fix button component comment and trailing space 2020-08-17 17:02:57 +02:00
Molkobain
fabc92eb89 N°2847 - Activity panel: Fix glitch on closed case log entry 2020-08-17 10:00:44 +02:00
Pierre Goiffon
71848cb56b Merge branch 'support/2.7' into develop
# Conflicts:
#	.jenkins/bin/tests/phpunit.sh
#	Jenkinsfile
#	core/config.class.inc.php
#	core/dbobjectsearch.class.php
#	core/ormlinkset.class.inc.php
#	datamodels/2.x/combodo-db-tools/dbtools.php
#	dictionaries/nl.dictionary.itop.ui.php
2020-08-17 09:36:43 +02:00
Molkobain
d011c4e8f5 N°2847 - Global search: Fix past queries not displaying 2020-08-17 09:31:10 +02:00
Molkobain
46909c210c N°2847 - Activity panel: Display only necessary toolbar actions in the "Activity" tab 2020-08-17 08:38:44 +02:00
odain-cbd
71b725420a Merge branch 'develop' into feature/fast-theme-compilation2 2020-08-17 00:18:15 +02:00
rquetiez
fcd4ad6872 N°3052 add the core/application XML files and rewrite the test for two benefits:
a - the latest XML version is currently not correlated with the the version of iTop (though it seems to be)
b - see the converted XML... that could be saved to fix the report
2020-08-14 19:57:38 +02:00
Molkobain
e3f1deda00 N°2847 - Activity panel: Fix case log entries highlight strip when closed 2020-08-14 18:12:35 +02:00
odain
a538e3c1a2 N°2996 Remove iTop version from css variables
- $version does not exit anymore in css-variables.css. now its value is computed during setup and equals setup timestamp instead.
    - use precompiled files (declared in datamodels XML files) to check if theme compilation is required or not.
    - referenced images in scss files are included in precompiled file signatures just like scss files md5sum.
    - images declared in scss files with v=$version are reloaded automatically on browser side after each theme compilation (see xxx.png?v=timestamp)
    - precompiled files are replaced if theme compilation occurred. this will avoid same time consuming operation at next setup.
    - code cleanup: arrays / variables renamed
2020-08-14 17:03:16 +02:00
Stephen Abello
ac91c4d970 N°2847 Fix default action type value for Button constructor 2020-08-14 17:02:35 +02:00
Stephen Abello
3ffe3dd4bd N°2847 Add Button component 2020-08-14 16:26:16 +02:00
Stephen Abello
f70065b2fc N°2847 Add a border radius variable to scss 2020-08-14 16:26:16 +02:00
Stephen Abello
4b98f2ac25 N°2847 Add secondary color variables 2020-08-14 16:26:16 +02:00
Molkobain
398621693e N°2847 - Activity panel: Several improvements
- Improve display of code snippets
- Improve code structure for loops on case log colors
2020-08-14 12:18:47 +02:00
Molkobain
b9d7967c0e N°2847 - Activity panel: Add highlight color on case log entries 2020-08-14 10:41:51 +02:00
Molkobain
0c5c2eccad N°2847 - Navigation menu: Minor adjustments
- Adjust some sizes and colors on the navigation menu to match mockups
- Fix menu groups displaying over the user picture when menu is expanded
- Partially fix notification menu positioning
- Extract some sizes into variables for the popover menu
2020-08-13 23:34:18 +02:00
rquetiez
a1f5d8041e N°3251 (see also PR#152) - CSV data synchro allows "<NULL>" to be interpreted as "Let the attribute unchanged for the current row" 2020-08-13 21:49:30 +02:00
rquetiez
d679deba02 refactor CSV Parser unit tests from the old home-made framework into PHP Unit, and add new test to check that <NULL> is parsed as a real null value 2020-08-13 21:12:50 +02:00
Molkobain
df20d10afa N°2847 - Add activity panel to object details (and some variables renaming) 2020-08-13 18:57:07 +02:00
Molkobain
f2725c5a5c Add $bAllowDefaultPicture parameter to UserRights::GetContactPictureAbsUrl() to return null instead of the default picture 2020-08-13 17:46:48 +02:00
Pierre Goiffon
91c6916d86 🐛 Fix setup homepage error with PHP < 7.1.0
Was due to const visibility added in ormLinkSet class in commit b58a084d

This isn't supported before PHP 7.1.0, see https://www.php.net/manual/fr/language.oop5.constants.php :
> As of PHP 7.1.0 visibility modifiers are allowed for class constants.
2020-08-13 15:29:27 +02:00
Molkobain
f90a5b77ad Fix UserRights::GetContactPictureAbsUrl() when using optional $sLogin parameter 2020-08-13 14:47:07 +02:00
Molkobain
703161157b Fix UserRights::GetUserId() when using optional $sLogin parameter 2020-08-13 14:08:54 +02:00
Molkobain
55c896bcd3 Internal - Add parameter $aDesiredAttTypes to the MetaModel::GetAttributesList() to filter the result on some attribute types only 2020-08-13 14:08:54 +02:00
Molkobain
ef844c396e N°2847 - Add UIBlock::GetBlockCode() method to get the code within a TWIG no matter the object class (easier than calling the right class constant) 2020-08-13 14:08:54 +02:00
Molkobain
dfdeb21023 PHPDoc & code cleanup 2020-08-13 14:08:53 +02:00
Stephen Abello
47c0f946b3 N°2847 Better handle of weird shaped images for square logo and full logo 2020-08-12 15:07:33 +02:00
acognet
f90105c107 N°2534 - dashboard: bug with autorefresh that deactivates filtering on organizations 2020-08-12 14:18:05 +02:00
Stephen Abello
b0973263e3 N°2847 Add background color to user menu odd sections 2020-08-12 11:36:57 +02:00
Stephen Abello
4be0d8895d N°2847 Refactor newrooms with variables 2020-08-12 11:04:24 +02:00
Stephen Abello
6436e8cef4 N°2847 Add an indication on newsroom toggler when there is new messages 2020-08-12 09:30:19 +02:00
Stephen Abello
f8b6b37288 N°2847 Recolor svg illustrations with itop's primary color 2020-08-10 16:56:00 +02:00
Stephen Abello
8996117929 Allow additional paths for Twig Helper and add images/ to iTop webpage and block renderer paths 2020-08-10 16:56:00 +02:00
Molkobain
9be4743cf6 Internal - UserRights: Rename 1 var. and 1 method to something more meaningful 2020-08-10 14:49:19 +02:00
Stephen Abello
4195cd011c N°2847 * Fix wrong image name for default placeholder
* Close popupmenu when clicking on toggler a second time
* Fix an error in newsroom menu
2020-08-10 14:16:43 +02:00
Stephen Abello
440cda87b1 N°2847 Add full logo to expanded navigation menu 2020-08-10 12:14:09 +02:00
Molkobain
efb3f7f9cd Internal - Rework on User and UserRights classes:
- PHPDoc
- Add User::GetInitials() method
- Fix several calls to UserRights::FindUser()
- Add UserRights::GetUserInitials()
- Change usage of DBObject->Get('friendlyname') to DBObject->GetRawName()
2020-08-10 11:52:06 +02:00
odain
e5487edbfb Merge remote-tracking branch 'remotes/origin/feature/perf-serialization' into develop 2020-08-10 11:10:44 +02:00
odain-cbd
3cae585f78 Merge pull request #154 from Combodo/revert-136-feature/fast-theme-compilation
Revert "Faster compilation of themes"
2020-08-07 16:20:38 +02:00
odain-cbd
7b8c390a80 Revert "Faster compilation of themes" 2020-08-07 16:20:12 +02:00
odain-cbd
c3b9c6963e Merge pull request #136 from Combodo/feature/fast-theme-compilation
Faster compilation of themes
2020-08-07 16:13:09 +02:00
odain-cbd
e907c7825a Merge branch 'develop' into feature/fast-theme-compilation 2020-08-07 16:12:47 +02:00
Stephen Abello
ea7924663a N°2847 Add a user placeholder image selector in user preferences (poc, need to cleanup) 2020-08-07 15:42:10 +02:00
Stephen Abello
93871308d1 N°2847 Update newsroom templates with new variable in twig files 2020-08-07 09:25:33 +02:00
Molkobain
f20310b437 N°2847 - Change calls to methods in TWIG to something more meaningful to avoid consufion between methods, properties and array keys 2020-08-06 17:47:15 +02:00
Molkobain
af87a04d13 N°2847 - Add page content layout feature 2020-08-06 17:47:15 +02:00
Molkobain
521536526e N°2847 - GlobalSearch: Disable browser auto completion and fix past queries icon URL 2020-08-06 17:47:14 +02:00
Molkobain
1e3771dffa N°2847 - Fix content parameters (eg. aPage) not passed in subblocks 2020-08-06 17:47:14 +02:00
Molkobain
6666f3d033 N°2847 - Switch "AdminTools" and "ConfigTools" menu groups icon 2020-08-06 17:47:14 +02:00
Molkobain
470b566c1a N°2847 - Rework iTopWebPage layout (WIP Part X)
- iTopWebPage: Remove AddToMenu() method
- SCSS: Fix content areas height to occupy max. available space
2020-08-06 17:47:14 +02:00
Molkobain
c81f521d2e N°2847 - Uncomment some parts of the old CSS file to improve rendering while developing 2020-08-06 17:47:14 +02:00
Molkobain
3ed73ac020 N°2847 - Fix UI block var name being different across the different templates (painful when working with derivated block classes) 2020-08-06 17:47:14 +02:00
Molkobain
1604e233f9 PHPDoc & code cleanup 2020-08-06 17:47:14 +02:00
Pierre Goiffon
46f8fadac0 Merge remote-tracking branch 'origin/develop' into feature/backoffice-full-moon-design 2020-08-06 17:37:56 +02:00
Pierre Goiffon
001e937568 N°2330 / N°3009 update PHP version in composer.json 2020-08-06 17:36:23 +02:00
odain
94ffcf4207 💚 use proper namespace 2020-08-06 15:39:19 +02:00
Stephen Abello
7b139ea893 N°2847 Typo in dict + a bit of css for newroom menu toggler in user menu 2020-08-06 15:21:09 +02:00
odain
76274557a3 N°3061 - :green_hear fix test 2020-08-06 14:52:48 +02:00
Stephen Abello
1231528ab5 N°2847 Newsroom menu : Delete debug messages and update a bit of scss 2020-08-06 14:41:35 +02:00
Stephen Abello
a5216de232 N°2847 First iteration for newsroom menu:
* Kept old js widget but refactored/tweak'd it with some of our new conventions
* Added a newsroom menu component extending popupmenu
* Working as in 2.7
Still todo :
* Add variables for scss file
* Use wiget variables for most of js widget
* Correctly place the popup (absolute with <> containers ? poppers.js ? )
* Intialize toggler red bubble when new messages are in
* Replace hardcoded text in usermenu with correct dict entry updated with the nb of new message
* Only allow to open the popup when ajax calls are done
2020-08-06 14:36:07 +02:00
odain
87b027e3bf N°3054/3052 - rename exclusion group for CI to skipPostBuild 2020-08-06 11:02:57 +02:00
odain
b0609e86d1 N°3060 - filter modules autoinstalled in checklist test 2020-08-06 11:00:53 +02:00
odain
b9145ca996 N°3060 - filter modules autoinstalled in checklist test 2020-08-06 10:51:39 +02:00
bruno-ds
4e0c6e5614 move tests from
- within checklist test suite
 - to standard test suite + excluded from the checklist
2020-08-06 09:55:06 +02:00
bruno-ds
da34383363 fix checklist unit tests 2020-08-06 08:57:41 +02:00
odain
b628bb5e80 add a comment 2020-08-05 15:38:43 +02:00
odain
4c294cb09c N°3060 - :green_heart fix text name collision 2020-08-05 15:38:28 +02:00
odain
dc5ee13ed1 N°3060 - Check consistency between the list of modules and installation.xml 2020-08-05 15:25:15 +02:00
odain
8707ae6024 💚 fix StatusTest.php 2020-08-05 14:53:57 +02:00
odain
ec0f726c26 💚 fix tests 2020-08-05 14:39:00 +02:00
odain
66d6db5174 add detailed info inside StatusTest.php 2020-08-05 14:25:59 +02:00
odain
2493fd57b2 add detailed info inside StatusTest.php 2020-08-05 14:19:39 +02:00
odain
e3a653010a adapt StatusTests.php to work on both iTop repository and packaged zip 2020-08-05 12:03:35 +02:00
odain
c98c364714 adapt UtilsTests.php to work on both iTop repository and packaged zip 2020-08-05 11:38:27 +02:00
odain
a545bb8729 detailed unit test failure messages 2020-08-05 11:12:28 +02:00
Pierre Goiffon
c9dab08324 💚 Fix DBSearchTest::testSelectInWithVariableExpressions 2020-08-04 15:36:53 +02:00
Stephen Abello
18b653f641 N°2847 Handle no contact linked to user on usr menu icon hover 2020-08-04 14:44:42 +02:00
odain
56e2f63385 enhance phpunit test messages in case of failure 2020-08-04 14:13:41 +02:00
bruno-ds
4f04031183 .make builder robustness 2020-08-04 13:56:53 +02:00
bruno-ds
cdc3bbcb0c unitTest: better error message 2020-08-04 13:56:27 +02:00
Stephen Abello
2db7611368 N°2847 Fix wrong variable use in popover menu scss 2020-08-04 13:54:18 +02:00
Stephen Abello
f4f846496b N°2847 Add Separator item to popover menu items 2020-08-04 13:49:51 +02:00
Molkobain
d6ab310d24 N°3233 - Fix unit test and autoloader due to folders renaming in /sources 2020-08-04 13:26:58 +02:00
Molkobain
bc4b36fda6 N°3233 - Remove "display_template" from object details page 2020-08-04 13:26:57 +02:00
Molkobain
c61a66ca69 N°3233 - Remove "display_template" from datamodel classes 2020-08-04 13:26:57 +02:00
Molkobain
bd0480b5c5 N°3233 - Remove "display_template" from the metamodel and compiler 2020-08-04 13:26:57 +02:00
Molkobain
c93c53488d N°3185 - Rename tag to "main_logo_compact" and complete XML migration methods 2020-08-04 13:26:57 +02:00
Molkobain
19b5290e80 N°3231 - Allow browser access to static resources files in the /lib folder 2020-08-04 13:26:57 +02:00
Molkobain
a15235d522 N°2847 - Global Search: Fix class images URL, rename internal variable 2020-08-04 13:26:57 +02:00
Stephen Abello
c7e95676d2 N°2847 Fix first and last section border radius for popover menu 2020-08-04 12:13:39 +02:00
Stephen Abello
4aeb3ed448 N°2847 Cleanup scss with helpers 2020-08-04 12:00:03 +02:00
Stephen Abello
4e7b68aa9a N°2847 Open user menu when clicking user picture or user welcome message 2020-08-04 11:53:44 +02:00
Stephen Abello
e22c36c503 N°2847 Add tooltip to user menu picture and rework these dictionary entries 2020-08-04 10:02:56 +02:00
Stephen Abello
7264defc35 N°2847 Add padding to user menu message caret 2020-08-04 10:02:13 +02:00
Stephen Abello
baa2fb2906 Rename a NavigationMenu method (see ed1f3aa950 (r41148365)) 2020-08-04 09:27:55 +02:00
Stephen Abello
1d954b80a8 Rename a dictionnary entry (see ed1f3aa950 (r41148310)) 2020-08-04 09:27:12 +02:00
Stephen Abello
1d13181135 Split a scss variable in two (see ed1f3aa950 (r41148286)) 2020-08-04 09:26:12 +02:00
Stephen Abello
ed1f3aa950 N°2847 Add bottom menu part :
* Notifications icon
* User icon
* Extended user data
Still todo:
* Initialize Newsroom and feed infos to template
* Initialize User popover menu
2020-08-03 17:07:21 +02:00
Molkobain
e2e62eca5e N°2847 - Rework iTopWebPage layout (WIP Part IX)
- Refactor some CSS classes to something more semantic and cross app (.ibo-<COMPONENT>--is-<STATE> => .ibo-<STATE>)
- AjaxWebPage: Deprecated AddToMenu method
2020-08-03 11:27:06 +02:00
Stephen Abello
a85c7e9f8f Add Popover menu and subitems such as URL and JS items. 2020-08-03 11:16:54 +02:00
Molkobain
ac2280df50 N°2847 - Breadcrumbs: Rollback try to hide first elements when too many elements 2020-08-03 09:26:02 +02:00
Molkobain
61d611c136 N°2847 - Rework iTopWebPage layout (WIP Part VIII)
- Navigation menu: Change scrollbar color to something more visible
- Navigation menu: Close drawer when filter focused and "Escape" key hit
- Top bar: Fix element's ID in its standard delivery
- Top bar: Fix drawers opening under the top bar but above the main content
- iTopWebPage: Add AddUiBlock() method to easily add a layout/component in the page
- iTopWebPage: Fix Header/Footer parts (formerly North/South Panels) and Banner part
- WebPage: Handle duplicate stylesheets (like it was already doing for JS scripts)
2020-08-02 21:35:33 +02:00
Molkobain
f59de920c1 PHPDoc & code cleanup 2020-08-02 21:18:23 +02:00
Molkobain
7b13078bf9 N°2847 - Rework iTopWebPage layout (WIP Part VII)
- Breadcrumbs: Hide first elements when not enough space to show them all
- iTopWebPage: Temporary fix for modals in order to enable // dev. on the linkedsets refactoring
2020-07-30 17:57:36 +02:00
Molkobain
3406ebf1fd Merge remote-tracking branch 'origin/develop' into feature/backoffice-full-moon-design 2020-07-30 15:23:06 +02:00
Molkobain
1f0211b45a N°2847 - Rework iTopWebPage layout (WIP Part VI)
- iTopWebPage: Restore "open search" feature
- iTopWebPage: Change all resources URL to absolute in order to benefit from the "duplicate removal" benefits
- iTopWebPage: Remove obsolete method IsMenuPaneVisible()
- Config: Add new parameters quick_create.enabled / global_search.enabled / breadcrumb.enabled
- utils: Add new GetAppRevisionNumber() method
- Introduce iUIBlock interface for UI layouts, components, ...
- Introduce BlockRenderer to properly render blocks
- Add "render_block" function to TwigHelper to render blocks directly from TWIG
- Refactor layouts and components into proper block classes to fit the new architecture
2020-07-30 15:22:17 +02:00
Molkobain
b207ae1bb3 PHPDoc & code cleanup 2020-07-30 15:22:16 +02:00
Molkobain
e788a44382 TwigHelper: Add file type constants for an easier use by the service consumers 2020-07-30 15:22:16 +02:00
Molkobain
71dbccd034 N°3216 - Refactor form files to be part of the autoloader 2020-07-30 15:22:16 +02:00
Molkobain
3df3619b7c N°3215 - Refactor renderer files to be part of the autoloader 2020-07-30 15:22:16 +02:00
Molkobain
a969d352ec N°2847 - Rework iTopWebPage layout (WIP Part V)
- iTopWebPage: Restore "open search" feature
2020-07-30 15:22:16 +02:00
Molkobain
59b6dd735e Add helpers to retrieve some of the current contact data in UserRights 2020-07-30 15:22:16 +02:00
Molkobain
1766d42350 Internal: Refactor some harcoded attribute codes into constants in UserRights 2020-07-30 15:22:16 +02:00
Molkobain
3b6654588a N°2847 - Change images paths and names to something more functional 2020-07-30 15:22:16 +02:00
Pierre Goiffon
b58a084de5 N°2334 n:n relations : same fields displayed in EDIT and VIEW modes
Before we were only showing lnk fields in VIEW, and lnk+remote in EDIT (excluding some fields, see below).
Now by default (as this is customizable in VIEW mode) we have the same !

Rules to choose fields are moved from \UILinksWidget::__construct to :
  * \MetaModel::GetZListAttDefsFilteredForIndirectRemoteClass
  * \MetaModel::GetZListAttDefsFilteredForIndirectLinkClass
2020-07-30 11:40:54 +02:00
Pierre Goiffon
5d686d733f 🔧 Disable useless inspections 2020-07-30 11:33:57 +02:00
Pierre Goiffon
ea92973e9b 📝 PHPDoc for DisplayBlock 2020-07-29 12:23:15 +02:00
Pierre Goiffon
14505fc5e6 🔧 Change SlowArrayOperationsInLoopInspection from error to warning 2020-07-29 12:22:52 +02:00
Pierre Goiffon
90b60f90ae Update files version to 2.8.0 2020-07-28 11:40:16 +02:00
Pierre Goiffon
a26c2cbcdb 📝 Add phpdoc on DBObjectSearch method 2020-07-28 11:35:30 +02:00
Pierre Goiffon
cc708f6ccc 🙈 Add temp ignore rules 2020-07-28 11:03:59 +02:00
Molkobain
d4694b271f N°2847 - Rework iTopWebPage layout (WIP Part IV)
- iTopWebPage: Clean up some commented sections
- iTopWebPage: Marked some new methods as @internal
- iTopWebPage: Restore page content to allow // developments
- Quick create: Add quick object creation box to the top bar
- Global search: Improve cinematic with other widgets
- Components / Layouts: Move JS parts to iTopWebPage, will be put in dedicated PHP helpers later
2020-07-27 15:09:35 +02:00
Molkobain
d56f6e684a N°2847 - Add Bulma SCSS lib. 2020-07-27 15:09:35 +02:00
Molkobain
8999108fe3 Clean unwanted committed changes 2020-07-27 15:09:35 +02:00
Molkobain
929eccc88d Protect directory listing of /mode_modules 2020-07-27 15:09:34 +02:00
Molkobain
75812ca151 N°2847 - Rework iTopWebPage layout (WIP Part III)
- iTopWebPage: Fix top bar actions drawers opening under the advanced search widget
2020-07-27 15:09:34 +02:00
Molkobain
ec238569c4 Add method to get allowed classes for specific action (read/modify/...) and categories (bizmodel, ...) 2020-07-27 15:09:34 +02:00
Molkobain
b6117b157c PHPDoc & code cleanup 2020-07-27 15:09:34 +02:00
Molkobain
b3dcfea8dc N°3207 - Global search: Introduce new widget 2020-07-27 15:09:34 +02:00
Molkobain
00dc1d3f3b PHPDoc & code cleanup 2020-07-27 15:09:34 +02:00
Molkobain
da5d55a542 Fix appUserPreferences type hinting as it accepts more than just strings 2020-07-27 15:09:34 +02:00
Molkobain
6a3bbd8d49 N°2847 - SCSS: Refactor some variables names and some patterns into helpers 2020-07-27 15:09:34 +02:00
Molkobain
46deb9590d N°3199 - Add tippyjs / popper.js JS libs (introducing NPM dependencies management system for JS/CSS libs) 2020-07-27 15:09:34 +02:00
Molkobain
20ed4fe2d1 N°2847 - Theme: Add elevations as SCSS and CSS variables 2020-07-27 15:09:33 +02:00
Molkobain
87d7693be5 N°2847 - Rework iTopWebPage layout (WIP Part III)
- iTopWebPage: Extract processing in dedicated functions
- iTopWebPage: Add tooltips base feature
- iTopWebPage: Fix JS dictionaries
- iTopWebPage: Extract inline JS to dedicated file
- Top bar: Visual improvements
- Nav. menu: Visual improvements
- Nav. menu: Tooltip improvement
- Nav. menu: Toggle state preference saved
- Nav. menu: Add menus filter feature
- Breadcrumbs: Handle elements overflow
2020-07-27 15:09:33 +02:00
Molkobain
fa153d8504 N°3185 - Datamodel: Add square logo in branding 2020-07-27 15:09:33 +02:00
Molkobain
5d3009646a N°3182 - Datamodel: Add icon to menu groups 2020-07-27 15:09:33 +02:00
Molkobain
ec70d3546d PHPDoc & code cleanup 2020-07-27 15:09:33 +02:00
Molkobain
10a14a3844 N°3182 - Add support for MenuGroup CSS icon in the XML datamodel
- Introduce itop_design v1.8
- Default CSS classes are 'fas fa-ellipsis-v' from FontAwesome
- New tags <style><decoration_classes>xxx yyy</decoration_classes></style> under the <menu xsi:type="MenuGroup"> tag
2020-07-27 15:09:33 +02:00
Molkobain
0516862632 N°2847 - Rework of iTopWebPage: Preliminary work on the page content 2020-07-27 15:09:33 +02:00
Molkobain
ad379d3ef4 N°2847 - Rollback fix on pages <base> URL tag (to much consequences)
Fixing the base URL tag on WebPage and derivated classes would require to migrate all extensions which use the add_linked_script / add_linked_stylesheet functions with a relative URL, which is almost all extensions. So the benefit isn't worth the workload.

Note: We could have migrate extensions by replacing "../images|js|css/xxx.yyy" with utils::GetAbsoluteUrlAppRoot()."images|js|css/xxx.yyy" to make them compatible with iTop 2.8 and previous versions. But as said before, much work.
2020-07-27 15:09:33 +02:00
Molkobain
8efd8008fc N°2847 - Rework of the global iTopWebPage layout (Part II)
- Optimize TWIG templates includes (don't pass context to autonomous components)
- Preliminary work of the top bar and breadcrumbs features
- Removal of images dedicated to the breadcrumbs feature
2020-07-27 15:09:33 +02:00
Molkobain
6f9565d979 Remove duplicated entries from .gitignore 2020-07-27 15:09:32 +02:00
Molkobain
6f3ec99501 N°2847 - Update UI components dictionaries 2020-07-27 15:09:32 +02:00
Molkobain
ab681b0954 N°2847 - Rework of the global iTopWebPage layout (Part I)
- Rework of the iTopWebPage class
- Use of TWIG templates
- Preliminary work of the navigation menu
2020-07-27 15:09:32 +02:00
Molkobain
c9b80074f4 Add helper to know if we currently are in "debug" mode
Can be used to enable more features / debugging tools throughout the application.
2020-07-27 15:09:32 +02:00
Molkobain
f5df442e8b N°2847 - Improve SCSS files structure
- Refactor some mixins into helpers
- CSS3 variables set via SCSS variables are now using "interpolation" (#{$my-var} instead of just $my-var) to be compatible with more SCSS compiler
- Overloading some Bulma variables such as font-family
2020-07-27 15:09:32 +02:00
Molkobain
fab58d503b TwigBase: Change "add_itop_version" TWIG function to use cache buster timestamp 2020-07-27 15:09:32 +02:00
Molkobain
1a3411e99d TwigBase: Add 2 TWIG functions (get_absolute_url_app_root / get_absolute_url_modules_root) 2020-07-27 15:09:32 +02:00
Molkobain
ddcd6d4e91 N°2847 - Remove POC page 2020-07-27 15:09:32 +02:00
Molkobain
9eb826bb0b Add support for dictionaries in sub-folders of /dictionaries 2020-07-27 15:09:32 +02:00
Molkobain
a88df33167 Add SASS converter cache to .gitignore 2020-07-27 15:09:32 +02:00
Molkobain
ec48b397ad Code cleanup & PHPDoc 2020-07-27 15:09:31 +02:00
Molkobain
f8af900c73 N°2847 - WIP: Sync. commit 2020-07-27 15:09:31 +02:00
Molkobain
7d4455baf4 N°2847 - Start rework of the CSS/JS/TWIG files structure 2020-07-27 15:09:31 +02:00
Molkobain
e37c620d2d PHPDoc & code cleanup 2020-07-24 14:11:30 +02:00
Molkobain
dd4ef8f91a N°2870 - Portal: Fix "Notice: Undefined index: UI:PropertiesTab" on object form 2020-07-24 14:08:33 +02:00
bruno-ds
5edcc91182 CI: release checklist test suite config file 2020-07-24 09:10:04 +02:00
bruno-ds
e2b5992e80 n°3062 - css generator on build 2020-07-24 09:08:45 +02:00
bruno-ds
a2af061a34 n°3057 - bugfix & output improvement 2020-07-24 09:07:43 +02:00
bruno DA SILVA
a53ce32e54 N°3062 - setup.css file integrity test
this is for the task : "Generate setup.css at build time"
2020-07-22 17:09:51 +02:00
odain
08414296b6 tmp work: save timestamp + few fixes 2020-07-21 23:22:50 +02:00
Pierre Goiffon
06ee1f3a15 N°2284 add @since in old autocomplete widget file 2020-07-20 10:38:55 +02:00
Eric
27ed1f3307 N°2957 - Fix required files and generate files into src/Model 2020-07-20 09:58:51 +02:00
Thomas Casteleyn
4f72336301 Suggest correct filename on download 2020-07-17 13:17:18 +02:00
Thomas Casteleyn
868c157ae4 Change lifecycle generation to SVG instead of PNG 2020-07-17 13:17:18 +02:00
Thomas Casteleyn
c2b72c7688 More memory efficient image pass through 2020-07-17 13:17:18 +02:00
odain
307713d326 N°2996 - Remove iTop version from css-variable.scss
Include images in precompilation check
2020-07-16 18:41:55 +02:00
odain
2d8b888a18 N°2982 - speedup themes/scss compilation during setup 2020-07-16 18:41:01 +02:00
Denis Flaven
6b2b56cf72 Faster compilation of themes
- Ability to provided precompiled themes in the datamodel
- Check that a precompiled theme is still up-to-date based on a signature
2020-07-16 18:33:13 +02:00
bruno DA SILVA
52baed7960 3054 - whoop fix duplicated class name 2020-07-16 17:20:25 +02:00
bruno DA SILVA
7ae895d701 3054 - Check community modules version against major version 2020-07-16 16:56:49 +02:00
bruno DA SILVA
120452d2ee 3052 - follow 919a7a8ef5 folder renaming 2020-07-16 16:47:40 +02:00
bruno DA SILVA
25791a1d18 3052 - Check community modules XML version against latest version 2020-07-16 16:45:20 +02:00
odain
919a7a8ef5 PS-4 folder renaming 2020-07-16 16:43:43 +02:00
odain
da0e0a99c7 revert to no behat tests 2020-07-16 16:16:17 +02:00
bruno DA SILVA
82ba53d40b 3059 - Automatically set the documentation URLs 2020-07-16 16:11:46 +02:00
odain
7ed1feff3e test phpunit + behat 2020-07-16 15:47:20 +02:00
odain
6bdfdad09f test phpunit + behat 2020-07-16 15:44:47 +02:00
odain
8c3417adeb work locally 2020-07-16 15:38:23 +02:00
Eric
e4ab543aff Disable twig cache for developers (instead of having config flag) 2020-07-16 15:07:03 +02:00
Eric
11ef705816 N°2969 - change dictionaries folder from dictionary to dictionaries 2020-07-16 14:52:03 +02:00
odain
b3b440362a N°3057 - New build recipe: start only 2020-07-16 14:19:38 +02:00
odain
ee9e747b1c stop working/debugging locally 2020-07-16 09:46:31 +02:00
odain
1baf8a6424 use all phpunit as usual 2020-07-16 09:35:10 +02:00
odain
7a89bfc108 fix ci: force authent-local conf to be able to create admin in a test 2020-07-16 09:08:31 +02:00
odain
68c7b9a0e8 fix test that breaks config-itop.php 2020-07-15 19:56:25 +02:00
odain
9e3b1bfc78 use less tests + try sth 2020-07-15 19:47:35 +02:00
odain
01f9a6f758 fix test dependency: require admin user 2020-07-15 17:54:24 +02:00
odain
8e028753b7 without use config-itop.php inside backup 2020-07-15 17:38:18 +02:00
odain
343d626025 without backup again 2020-07-15 16:55:47 +02:00
odain
6078f39730 fix config_itop.php in backup 2020-07-15 16:51:47 +02:00
odain
78dc57bdb5 remove dump from backup 2020-07-15 16:40:14 +02:00
odain
94a468efc8 again 2020-07-15 16:34:42 +02:00
odain
864572c02a fix setup in freshinstall mode 2020-07-15 16:06:07 +02:00
odain
d353d56e7b add exception in test failed 2020-07-15 11:13:48 +02:00
odain
a3e6600195 try with a backup file 2020-07-15 11:04:16 +02:00
odain
51ab8706e8 fix setup file 2020-07-15 10:51:28 +02:00
odain
24f832de78 fix xml test file 2020-07-15 09:40:13 +02:00
Eric
7e970ee93c N°3015 - fix notice 2020-07-15 09:38:33 +02:00
Eric
e7fa9eda65 Use configuration for enabling twig cache 2020-07-15 09:33:54 +02:00
odain
e295226bd6 work locally 2020-07-15 08:08:11 +02:00
odain
78d23261ca use itop_infra ci 2020-07-13 17:02:32 +02:00
Eric
edefa4da4f N°2330 - set the php minimum version to 7.2 2020-07-13 15:35:18 +02:00
odain
4ba76f95b2 N°3053 - Check XML conversion methods 2020-07-13 10:56:45 +02:00
Eric
6320879fe1 Add a cleanup file to the database integrity report.
Use it for fast database cleanup (removal of all broken entries) when you don't want to try recovering inconsistent records.
Note that you may need multiple report to eliminate all the inconsistencies.
2020-07-10 17:57:13 +02:00
Romain Quetiez
acf0548c4c N°3171 - Friendly name and obsolescence flag not refreshed (#151)
- Compute any type of expression on server side
- Recompute friendly name and obsolescence flag on server side (DBOBject)
- Bonus : compute dependency for external keys
2020-07-10 17:26:37 +02:00
Eric
b1fa429234 N°2957 - Better check of the class parameter in requests 2020-07-10 14:41:38 +02:00
Eric
78516f437a N°2957 - Compile classes in separated files 2020-07-10 14:41:08 +02:00
Denis Flaven
ea75092bb3 N°3166 - fix for a crash in expressioncache
iTop was crashing if the expression/format for the name of a class contained a quote (')
2020-07-10 11:27:43 +02:00
acognet
df4dfe4803 N°2284 - Replace JQuery Autocompleter plugin by JQuery UI Autocomplete widget
N°2390 - Auto-complete - Relevant results in first
2020-07-09 09:14:44 +02:00
acognet
fddf30e6c3 N°2956 - Upgrade jQuery to v3.5.1 2020-07-09 09:07:11 +02:00
Eric
b718e26c7f N°2969 - Add support for dictionaries folder in modules 2020-07-08 15:21:07 +02:00
Eric
e564f71c14 N°2986 - Reintegrate application menus from "welcome itil" into application 2020-07-08 11:49:52 +02:00
Eric
4f3931e828 N°2370 - Remove MySQL views in iTop, moved to "combodo-views" extension 2020-07-08 10:33:15 +02:00
Eric
d73fdce3c5 Fix legacy regression 2020-07-07 13:58:36 +02:00
acognet
0787c622d4 N°2738 - Remove unused dict keys 2020-07-06 13:43:46 +02:00
annProg
4c11eb099b fix: Typology translation for zh_cn 2020-07-04 22:52:38 +02:00
acognet
9628a1d028 N°2284 - Replace JQuery Autocompleter plugin by JQuery UI Autocomplete widget and start of bug 2390 - Auto-complete - Relevant results in first 2020-07-02 11:46:51 +02:00
acognet
5585385d08 N°2393 - API : Font Awesome remove v4 compatibility 2020-07-02 11:03:05 +02:00
acognet
98870b06e3 2548 - API : remove \DBObject::GetRelationQueries overrides in default datamodel 2020-07-01 16:28:20 +02:00
bruno DA SILVA
46d91322c1 n°2556 - fix errors in the merge of support/2.7 into develop
The cherry picks resulted in an out of order apply of the commits, the result was that the wrong code was keeped
2020-07-01 15:41:46 +02:00
acognet
ca28f8f3c4 2393 - API : Font Awesome remove v4 compatibility 2020-06-30 16:28:15 +02:00
acognet
0aaa55b35b 3009 - PHP Minimum version raised to 7.1 2020-06-30 10:10:00 +02:00
acognet
e9a1167da6 N°2363 - API : deprecate old linkedset update pattern 2020-06-30 09:02:42 +02:00
acognet
a67fce66fc N°2999 - Optimize OQL 2020-06-26 16:42:03 +02:00
acognet
491d1d7d53 N°API : remove CMDBSource::GetNextInsertId 2020-06-26 16:20:15 +02:00
acognet
54b48dc908 N°2372 - API : remove \MetaModel::EnumLinksClasses and \MetaModel::EnumLinkingClasses 2020-06-26 16:17:04 +02:00
acognet
dadeab58eb N°852 - Cleanup: remove deprecated impact analysis algorithm and clean up old broken test 2020-06-26 15:03:10 +02:00
acognet
0ecdc6620b N°852 - Cleanup: remove deprecated impact analysis algorithm 2020-06-26 15:02:30 +02:00
acognet
80161b909e N°2362 - API : remove DBInsertTracked / DBUpdateTracked 2020-06-26 14:16:14 +02:00
Pierre Goiffon
888232e8c3 Merge remote-tracking branch 'origin/support/2.7' into develop
# Conflicts:
#	test/core/HTMLDOMSanitizerTest.php
2020-06-26 10:53:49 +02:00
Pierre Goiffon
d904883bdd 📝 CONTRIBUTING : fix release branch naming 2020-06-23 17:48:42 +02:00
bruno DA SILVA
35d2c3afac uses the conventionnal host 2020-06-23 15:10:09 +02:00
Molkobain
7cee8c3cd0 Update README.md 2020-06-23 15:05:41 +02:00
Molkobain
27622bbcec Update readme.txt 2020-06-23 15:05:38 +02:00
bruno DA SILVA
219270ce81 Removes latest versions to ease maintenance 2020-06-23 14:59:11 +02:00
OИUЯd da silva
16dd47a3b9 simplify the readme (#143)
Removes latest versions to ease maintenance
2020-06-23 14:51:52 +02:00
Molkobain
70835984de Add "software requirements" section to README
At first I added a complete section with a table and all currently supported versions of iTop, then @bruno-ds pointed out that it would only be redundant with the wiki page and just another source of information to maintain (which is totally true, thanks!). So instead it's just a simple link in the "resources" section.
2020-06-23 14:23:15 +02:00
Pierre Goiffon
d9224f43f2 AttributeImage : remove useless override
The previous code was removed in d5b0bb02, and until then the method was just calling the parent doing nothing more
2020-06-23 11:39:51 +02:00
Molkobain
5b9643d6fb Update PHPDoc 2020-06-22 16:06:21 +02:00
bruno DA SILVA
d3525190d5 N°2556 - Html sanitization preserve content of removed tags (except for a forbidden list)
forbidden list: see $aTagsContentRemovableList

(cherry picked from commit 746b47bb0e)
(cherry picked from commit 79909fadc0)
2020-06-22 11:40:38 +02:00
Pierre Goiffon
f20808d929 Merge remote-tracking branch 'origin/support/2.7' into develop 2020-06-22 11:39:44 +02:00
Pierre Goiffon
aee80e41ca N°2214 Fix typo in method name
Introduced in b7136c0b7a
Many Thanks @jbostoen !
2020-06-19 13:47:15 +02:00
Pierre Goiffon
56ea6c8848 N°2214 fix @since after cherry-pick 2020-06-15 16:22:04 +02:00
Pierre Goiffon
b7136c0b7a N°2214 Add PHP check in CLI scripts
It is quite common that the PHP interpreter that is launched in CLI is different that the one used by the webserver. So iTop code launched by CLI could run in a context that doesn't meet iTop requirements !

This adds in the following scripts the same control that is done on the setup wizard first step :
* cron.php
* backup, check-backup
* export, exportv2
* bulk import
* synchro-exec, synchro-import

If the check throws at least one error then the script is stopped with an appropriate message, and a log is made (IssueLog, Error level, CLI channel)

(cherry picked from commit c768e18e2b : no risk taken for 2.7.1, so cherry picked for 2.8.0)
2020-06-15 15:20:17 +02:00
Pierre Goiffon
ea94986247 Merge remote-tracking branch 'origin/support/2.7' into develop 2020-06-15 15:19:12 +02:00
odain
d8363067e6 ci 2 new options: coverture + run only one test 💚
try to have coverture option
2020-06-15 10:32:47 +02:00
odain
6e4f9a9b93 small fix 2020-06-12 09:14:09 +02:00
odain
29c4ca7e65 revert lib/composer/autoload unwanted commit 2020-06-11 21:33:54 +02:00
odain
4d3aefe2a4 fix all the tests 2020-06-11 21:29:03 +02:00
odain
c798e0a9cd fix absolute path test failure 2020-06-08 16:56:29 +02:00
odain
1b9c7b7766 fix test failed due to different absolute paths 2020-06-08 15:32:57 +02:00
odain
19ee8e4071 add recurseMkdir 2020-06-08 14:49:16 +02:00
Thomas Casteleyn
b302569feb Update Dutch SynchroAttribute::update_policy translation 2020-06-08 13:02:57 +02:00
odain
4741012fb9 debug testcase failed 2020-06-08 11:26:12 +02:00
odain
f5886f603b themehandler better test failure feedback 2020-06-08 10:57:57 +02:00
odain
d82086240b Merge branch 'feature/bug2996-checklist-compilation' into feature/fast-theme-compilation 2020-06-08 09:39:33 +02:00
odain
f47b16c571 adapt precompiled styles 2020-06-08 09:38:39 +02:00
odain
728b082a7d remove version from css-variables.scss 2020-06-08 09:35:12 +02:00
odain
31482ccef7 make sure GetCompiledModuleVersion returns timestamp 2020-06-08 09:34:45 +02:00
odain
ca99e612cf clean .make from css-variable version update 2020-06-08 09:33:51 +02:00
odain
c9c833a868 IssueLog instead of echo in ThemeHandler 2020-06-04 22:50:45 +02:00
odain
7cad4ac444 adapt testValidatePrecompiledStyles 2020-06-04 22:47:50 +02:00
odain
001680906d molkobain remarks in PR 2020-06-04 21:58:03 +02:00
odain-cbd
ed355cb8cf Update application/themehandler.class.inc.php
Co-authored-by: Molkobain <guillaume.lajarige@combodo.com>
2020-06-04 21:52:02 +02:00
odain-cbd
fa036ee724 Update application/themehandler.class.inc.php
Co-authored-by: Molkobain <guillaume.lajarige@combodo.com>
2020-06-04 21:47:02 +02:00
odain-cbd
e04548a61c Update application/themehandler.class.inc.php
Co-authored-by: Molkobain <guillaume.lajarige@combodo.com>
2020-06-04 21:45:29 +02:00
odain-cbd
25c55bdaf4 Update application/themehandler.class.inc.php
Co-authored-by: Molkobain <guillaume.lajarige@combodo.com>
2020-06-04 21:43:17 +02:00
odain-cbd
c1c43c7d5d Update application/themehandler.class.inc.php
Co-authored-by: Molkobain <guillaume.lajarige@combodo.com>
2020-06-04 21:43:00 +02:00
odain
b970d81272 Merge branch 'develop' into feature/fast-theme-compilation 2020-06-04 14:45:11 +02:00
odain
b7ffa9e3c0 bug2996: include images in precompiled signature 2020-06-04 08:55:28 +02:00
odain
e94d5418f4 Merge branch 'develop' into feature/bug2996-checklist-compilation 2020-06-03 11:32:26 +02:00
Pierre Goiffon
44008fc179 Merge remote-tracking branch 'origin/support/2.7' into develop 2020-05-26 12:26:44 +02:00
Thomas Casteleyn
c2f62a13e6 Fix duplicate version loading (#141) 2020-05-13 14:53:47 +02:00
odain
d13591ca85 create parameters.json folder when necessary 2020-05-04 15:24:45 +02:00
odain
f88f321d79 avoid to read SCSS signature when no file touched and itop theme loading only + create parameters.json folder when necessary 2020-05-04 15:16:50 +02:00
odain
c1b3cb1e7b avoid to read SCSS signature when no file touched and itop theme loading only + create parameters.json folder when necessary 2020-05-04 15:16:26 +02:00
odain
d43c72b3ac avoid to read SCSS signature when no file touched and itop theme loading only 2020-05-04 14:42:55 +02:00
odain
1457faa53a add precompiled themes validation test 2020-05-04 14:15:33 +02:00
odain
3ee4b564f0 add a test to always validate datamodel declared precompiled CSS 2020-05-04 11:16:51 +02:00
odain
0988c8ccbf Mock compiler caller for test + Cover with tests + small css compilation fixes 2020-05-02 00:45:15 +02:00
Pierre Goiffon
accda04a37 Hierarchical selection popup : now collapsed by default, and collapse all / expand all buttons (#132)
The collapse all / expand all is not printed if no child exists
Combodo implementation of PR #87
2020-04-27 11:21:37 +02:00
Pierre Goiffon
f364e7b043 N°2923 Datatable : fix var name typo
Thanks @bruno-ds !
2020-04-24 18:28:50 +02:00
Pierre Goiffon
42afe033ef N°2923 Datatable : use container id instead of externally generated id 2020-04-24 17:16:47 +02:00
Denis Flaven
5cfa06e36f Faster compilation of themes
- Ability to provided precompiled themes in the datamodel
- Check that a precompiled theme is still up-to-date based on a signature
2020-04-22 16:11:02 +02:00
Pierre Goiffon
8de4c0360d Merge remote-tracking branch 'origin/support/2.7' into develop 2020-04-20 16:08:15 +02:00
Molkobain
24130dd94f Change version number to 2.8.0-dev 2020-04-14 18:01:30 +02:00
Lars Hippler
427326d074 Enable external classes (i.e. iApplicationObjectExtension) to use bypass function as well 2020-04-08 17:24:12 +02:00
Pierre Goiffon
59cc6d3f76 📝 CONTRIBUTING : fix unecessary escape 2020-04-07 15:33:26 +02:00
Pierre Goiffon
ee37373cfa 📝 CONTRIBUTING : branch model paragraph small changes 2020-04-07 15:24:56 +02:00
Pierre Goiffon
56d9653f15 📝 CONTRIBUTING : modify branch model
We are renaming the master branch, so using a custom GitFlow branch model :)
2020-04-06 09:32:23 +02:00
Pierre Goiffon
d5670abdcc 📝 Fix PHPDoc for \MFElement::_FindNode
Introduced in 4688c92e
2020-04-06 08:57:23 +02:00
Pierre Goiffon
0360a3160d Merge remote-tracking branch 'origin/releases/germanium' into develop
# Conflicts:
#	setup/modelfactory.class.inc.php
2020-04-06 08:47:22 +02:00
Thomas Casteleyn
bcd21aefb4 📝 DBObject fix wrong PHPDoc (#133)
Thanks to @Hipska !
2020-04-06 08:32:31 +02:00
Pierre Goiffon
3cbcdd4f13 🎨 MFElement : fix access modifiers & PHPDoc 2020-03-31 08:53:22 +02:00
odain
c46d0f5662 N°2888 Impossibility to import iTop User with password policy 2020-03-30 17:48:01 +02:00
Pierre Goiffon
b2454d44ae 👥 Added @ousret to the contributor list
See #99
Thanks to him !
2020-03-30 08:39:35 +02:00
TAHRI Ahmed R
79cfb95f6e Support array for json_data posted in rest/json service (#99)
Previous syntax :
```
CURLOPT_POSTFIELDS => array(
	'auth_user' => 'admin',
	'auth_pwd' => 'admin',
	'json_data' => '{
	   "operation": "core/get",
	   "class": "Person",
	   "key": "SELECT Person", "limit": "10", "page": "1"
	}'
);
```

Now we can also use :
```
CURLOPT_POSTFIELDS => array(
	'auth_user' => 'admin',
	'auth_pwd' => 'admin',
	"json_data[operation]" => "core/get",
	"json_data[class]" => "Person",
	"json_data[key]" => "SELECT Person",
	"json_data[limit]" => 10,
	"json_data[page]" => 1
);
```
2020-03-27 18:11:09 +01:00
Pierre Goiffon
ff2e1a3507 Fix syntax error in core/email.class.inc.php
Missing ";" at the end of line :/
Introduced by 503afb98
2020-03-27 16:43:03 +01:00
Lars Hippler
503afb9831 Make it possible to add return path for mails (#95) 2020-03-27 16:20:59 +01:00
Pierre Goiffon
b6772917ae Merge branch 'release/2.7.0' into develop
# Conflicts:
#	.make/license/gen-community-license.sh
#	setup/licenses/community-licenses.xml
2020-03-27 15:20:08 +01:00
bruno DA SILVA
00971f9ec7 rollback on two composer options: adding them made no sense since this file is not meant to handle dependencies but just use the autoloader (dependencies are handled by the one a the root of the project) 2020-03-21 16:17:45 +01:00
bruno DA SILVA
a3a97fa228 added missing composer config for the portal's composer.json
- php 5.6+
 - dump the autoloader as optimized as possible
2020-03-21 16:13:28 +01:00
bruno DA SILVA
18c4ca9131 🐛 fix Cannot connect to the MySQL server for the CI's unattended_install 2020-03-20 15:15:29 +01:00
odain
466ddf768e Fix license generation tool 2020-03-17 18:59:29 +01:00
odain
76d26e8ef9 Fix license generation tool 2020-03-17 18:59:18 +01:00
odain
b526d6422b Adding a test to cover selectin/cmdb code
cleanup
2020-03-12 10:55:18 +01:00
Pierre Goiffon
63c02ff33d 📝 Fix PHPDoc typo 2020-03-09 16:00:15 +01:00
Molkobain
4688c92e7c Internal: PHPDoc and warnings suppression 2020-02-25 15:44:26 +01:00
odain
75ba9101a6 add tests to cover this change 2019-12-20 16:13:52 +01:00
odain
df64c184b6 Merge branch 'develop' into feature/perf-serialization 2019-12-20 10:49:29 +01:00
Molkobain
08449b7af5 Regression: Fix iTop Hub connector not being installed (caused by dd5ac38dd4) 2019-12-17 09:49:14 +01:00
Molkobain
a4ccd835bc 💄 FAF: Mentions in caselogs 2019-12-17 09:03:32 +01:00
Molkobain
97aa758123 FAF: Mention people in caselogs 2019-12-17 09:03:32 +01:00
bruno DA SILVA
1ab09702d9 [POC] reduce metamodel serialized size by storing class name instead of class instance. This could be extended to more properties 2019-03-26 14:49:19 +01:00
Guy Couronné
618326d01f Correction unknown attribute id
operation : "core/get"
class : "NetworkDevice"
output_fields : "id,friendlyname" 
key : "SELECT NetworkDevice"

Code 100 “Error: Unknown attribute id from class NetworkDevice”
2019-03-18 08:53:50 +01:00
Guy Couronné
9b8dace833 Optimize Column load when using api core/get
Getting in SQL only desired columns to show
Used when output_fields != '*' || '*+'

Signed-off-by: Guy Couronné <gcouronne@sapiens.biz>
2019-03-15 11:17:58 +01:00
3260 changed files with 295665 additions and 57491 deletions

View File

@@ -77,24 +77,20 @@ Then, **for a method** of an eligible class:
:notebook: as spaces are used to mark code, the templates (`.doc/phpdoc-templates/combodo-wiki/*`) have very few indentation, thus they are awful to read (sorry).
## Installation
```
cd .doc
composer require phpdocumentor/phpdocumentor:~2 --dev
```
## Generation
`./bin/build-doc-object-manipulation` and `./bin/build-doc-extensions` contains examples of doc. generation, beware: they have to be called from the .doc directory:
```shell
cd /path/to/itop/.doc
./bin/build-doc-object-manipulation
```
the resulting documentation is written into `data/phpdocumentor/output`
1. Switch to this directory : `cd /path/to/itop/.doc`
2. `composer install`
3. `./bin/build-doc-object-manipulation`
3. `./bin/build-doc-extensions`
4. Get the generated files from `/path/to/itop/data/phpdocumentor/output`
## Dokuwiki requirements
* the template uses the [wrap plugin](https://www.dokuwiki.org/plugin:wrap).

View File

@@ -1,6 +1,6 @@
#!/bin/sh -x
rm -rf /tmp/phpdoc-twig-cache/ && rm -rf data/phpdocumentor/output/extensions/ && rm -rf data/phpdocumentor/temp/extensions/ && .doc/vendor/bin/phpdoc -c .doc/phpdoc-extensions.dist.xml -vvv
rm -rf /tmp/phpdoc-twig-cache/ && rm -rf data/phpdocumentor/output/extensions/ && rm -rf data/phpdocumentor/temp/extensions/ && ./vendor/bin/phpdoc -c ./phpdoc-extensions.dist.xml -vvv
# now wee need to lowercase every generated file because dokuwiki can't handle uppercase
cd data/phpdocumentor/output/extensions/ && for i in $( ls | grep [A-Z] ); do mv -i $i `echo $i | tr 'A-Z' 'a-z'`; done
cd ../data/phpdocumentor/output/extensions/ && for i in $(ls | grep [A-Z]); do mv -i $i $(echo $i | tr 'A-Z' 'a-z'); done

20
.gitignore vendored
View File

@@ -1,4 +1,15 @@
################################### Temporary ignore rules during 2.8 UI/UX dev - START
/css/backoffice/main.css
# Sass converter
/**/.sass-cache/
################################### Temporary ignore rules during 2.8 UI/UX dev - END
# no slash at the end to handle also symlinks
/toolkit
/env-*
@@ -6,12 +17,6 @@
# maintenance mode (N°2240)
/.maintenance
# listing prevention in conf directory
/conf/**
!/conf/.htaccess
!/conf/index.php
!/conf/web.config
# composer reserver directory, from sources, populate/update using "composer install"
vendor/*
test/vendor/*
@@ -19,6 +24,7 @@ test/vendor/*
# all conf but listing prevention
/conf/**
!/conf/.htaccess
!/conf/index.php
!/conf/web.config
# all datas but listing prevention
@@ -26,6 +32,8 @@ test/vendor/*
!/data/.htaccess
!/data/index.php
!/data/web.config
!/data/exclude.txt
!/data/.compilation-symlinks
# iTop extensions
/extensions/**

View File

@@ -1,7 +1,7 @@
<?php
/**
* Copyright (C) 2010-2020 Combodo SARL
* Copyright (C) 2010-2021 Combodo SARL
*
* This file is part of iTop.
*

View File

@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2010-2020 Combodo SARL
* Copyright (C) 2010-2021 Combodo SARL
*
* This file is part of iTop.
*

View File

@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2010-2020 Combodo SARL
* Copyright (C) 2010-2021 Combodo SARL
*
* This file is part of iTop.
*

View File

@@ -42,7 +42,7 @@ If you want to use another license, you may [create an extension][wiki new ext].
When we first start with Git, we were using the [GitFlow](https://nvie.com/posts/a-successful-git-branching-model/) branch model. As
there was some confusions about branches to use for current developed release and previous maintained release, and also because we were
using just a very few of the GitFlow commands, we decided to add just a little modification to this branch model : since april 2020
we don't have anymore a `master` branch.
we don't have a `master` branch anymore.
Here are the branches we use and their meaning :
@@ -52,23 +52,23 @@ Here are the branches we use and their meaning :
For example, if no version is currently prepared for shipping we could have:
- `develop` containing future 2.8.0 version
- `develop` containing future 3.0.0 version
- `support/2.7`: 2.7.x maintenance version
- `support/2.6`: 2.6.x maintenance version
- `support/2.5`: 2.5.x maintenance version
In this example, when 2.8.0-beta is shipped that will become:
In this example, when 3.0.0-beta is shipped that will become:
- `develop`: future 2.9.0 version
- `release/2.8`: 2.8.0-beta
- `develop`: future 3.1.0 version
- `release/3.0.0`: 3.0.0-beta
- `support/2.7`: 2.7.x maintenance version
- `support/2.6`: 2.6.x maintenance version
- `support/2.5`: 2.5.x maintenance version
And when 2.8.0 final will be out:
And when 3.0.0 final will be out:
- `develop`: future 2.9.0 version
- `support/2.8`: 2.8.x maintenance version (will host developments for 2.8.1)
- `develop`: future 3.1.0 version
- `support/3.0`: 3.0.x maintenance version (will host developments for 3.0.1)
- `support/2.7`: 2.7.x maintenance version
- `support/2.6`: 2.6.x maintenance version
- `support/2.5`: 2.5.x maintenance version
@@ -125,8 +125,7 @@ Our tests are located in the `test/` directory, containing a PHPUnit config file
* ⬆️ `:arrow_up:` when upgrading dependencies
* ⬇️ `:arrow_down:` when downgrading dependencies
* ♻️ `:recycle:` code refactoring
* 💄 `:lipstick:` Updating the UI and style files.
* 💄 `:lipstick:` Updating the UI and style files.
## 👥 Pull request
@@ -137,3 +136,21 @@ When your code is working, please:
* create a pull request.
Detailed procedure to work on fork and create PR is available [in GitHub help pages](https://help.github.com/articles/creating-a-pull-request-from-a-fork/).
You might check the ["Allow edits from maintainers" PR checkbox][allow_edits_checkbox] to ease review.
[allow_edits_checkbox]: https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork#enabling-repository-maintainer-permissions-on-existing-pull-requests
### 🙏 We are thankful
We are thankful for all your contributions to the iTop universe! As a thank you gift, we will send stickers to every iTop (& extensions) contributors!
Stickers' design might change from one year to another. For the first year we wanted to try a "craft beer label" look, see examples below:
* Bug hunter: Fix a bug
* Translator: Add/update translations
* White hat: Find and/or fix a vulnerability
* Contributor: Contribute by finding a bug, making an extension or any other way
* Partner: For Combodo's official partners
![](documentation/contributing-guide/contributing-stickers-side-by-side.png)

145
README.md
View File

@@ -21,21 +21,35 @@ iTop also offers mass import tools and web services to integrate with your IT
- [Data synchronization][18] (for data federation)
## Latest release
- [Changes since the previous version][62]
- [New features][63]
- [Installation notes][64]
- [Download][65]
[62]: https://www.itophub.io/wiki/page?id=latest:release:change_log
[63]: https://www.itophub.io/wiki/page?id=latest:release:start
[64]: https://www.itophub.io/wiki/page?id=latest:install:start
[65]: https://sourceforge.net/projects/itop/files/latest/download
## Resources
- [iTop Forums][1]: community support
- [iTop Tickets][2]: for feature requests and bug reports
- [Releases download][3]
- [Documentation][4] covering both iTop and its official extensions
- [iTop Hub][5] : discover and install extensions !
- [Software requirements][4]
- [Documentation][5] covering both iTop and its official extensions
- [iTop Hub][6] : discover and install extensions !
[1]: https://sourceforge.net/p/itop/discussion/
[2]: https://sourceforge.net/p/itop/tickets/
[3]: https://sourceforge.net/projects/itop/files/itop/
[4]: https://www.itophub.io/wiki
[5]: https://store.itophub.io/en_US/
[4]: https://www.itophub.io/wiki/page?id=latest:install:upgrading_itop
[5]: https://www.itophub.io/wiki
[6]: https://store.itophub.io/en_US/
[10]: https://www.itophub.io/wiki/page?id=latest%3Adatamodel%3Astart#configuration_management_cmdb
[11]: https://www.itophub.io/wiki/page?id=latest%3Adatamodel%3Astart#ticketing
@@ -49,47 +63,6 @@ iTop also offers mass import tools and web services to integrate with your IT
## Last releases
### Versions 2.7.*
- 2.7.1 published on April 8, 2020
- [Changes since the previous version][62]
- [New features][63]
- [Migration notes][64]
- [Download iTop 2.7.0-2][65]
[62]: https://www.itophub.io/wiki/page?id=2_7_0:release:change_log
[63]: https://www.itophub.io/wiki/page?id=2_7_0:release:2_7_whats_new
[64]: https://www.itophub.io/wiki/page?id=2_7_0:install:260_to_270_migration_notes
[65]: https://sourceforge.net/projects/itop/files/itop/2.7.0-2
### Versions 2.6.*
- 2.6.0 published on January 9, 2019
- [Changes since the previous version][58]
- [New features][59]
- [Migration notes][60]
- [Download iTop 2.6.3][61]
[58]: https://www.itophub.io/wiki/page?id=2_6_0:release:change_log
[59]: https://www.itophub.io/wiki/page?id=2_6_0:release:2_6_whats_new
[60]: https://www.itophub.io/wiki/page?id=2_6_0:install:250_to_260_migration_notes
[61]: https://sourceforge.net/projects/itop/files/itop/2.6.3
### Versions 2.5.*
- 2.5.0 published on July 11, 2018
- [Changes since the previous version][54]
- [New features][55]
- [Migration notes][56]
- [Download iTop 2.5.1][57]
[54]: https://www.itophub.io/wiki/page?id=2_5_0:release:change_log
[55]: https://www.itophub.io/wiki/page?id=2_5_0:release:2_5_whats_new
[56]: https://www.itophub.io/wiki/page?id=2_5_0:install:240_to_250_migration_notes
[57]: https://sourceforge.net/projects/itop/files/itop/2.5.1
## About Us
iTop development is sponsored, led and supported by [Combodo][0].
@@ -99,51 +72,55 @@ iTop development is sponsored, led and supported by [Combodo][0].
## Contributors
We would like to give a special thank you to the people from the community who contributed to this project, including:
We would like to give a special thank you 🤗 to the people from the community who contributed to this project, including:
### Names
- Alves, David
- Beck, Pedro
- Bilger, Jean-François
- Bostoen, Jeffrey
- Cardoso, Anderson
- Cassaro, Bruno
- Casteleyn, Thomas
- Castro, Randall Badilla
- Colantoni, Maria Laura
- Couronné, Guy
- Dvořák, Lukáš
- Goethals, Stefan
- Gumble, David
- Hippler, Lars
- Khamit, Shamil
- Kincel, Martin
- Konečný, Kamil
- Kunin, Vladimir
- Lassiter, Dennis
- Lazcano, Federico
- Lucas, Jonathan
- Alves, David
- Beck, Pedro
- Bilger, Jean-François
- Bostoen, Jeffrey (a.k.a @jbostoen)
- Cardoso, Anderson
- Cassaro, Bruno
- Casteleyn, Thomas (a.k.a @Hipska)
- Castro, Randall Badilla
- Colantoni, Maria Laura
- Couronné, Guy
- Dvořák, Lukáš
- Goethals, Stefan
- Gumble, David
- Kaltefleiter, Lars (a.k.a @larhip)
- Khamit, Shamil
- Kincel, Martin
- Konečný, Kamil
- Kunin, Vladimir
- Lassiter, Dennis
- Lazcano, Federico
- Lucas, Jonathan
- Malik, Remie
- Mindêllo de Andrade, Lucas (a.k.a @rokam)
- Rosenke, Stephan
- Seki, Shoji
- Shilov, Vladimir
- Tulio, Marco
- Turrubiates, Miguel
- Seki, Shoji
- Shilov, Vladimir
- Tulio, Marco
- Turrubiates, Miguel
### Aliases
- chifu1234
- cprobst
- Karkoff1212
- larhip
- Laura
- Purple Grape
- Schlobinux
- theBigOne
- ulmerspatz
- chifu1234
- cprobst
- DudekArtur
- Karkoff1212
- Laura
- Purple Grape
- Schlobinux
- theBigOne
- ulmerspatz
### Companies
- Hardis
- ITOMIG
- Pimkie
- [Hardis](https://www.hardis-group.com/)
- [ITOMIG](https://www.itomig.de/)
- [Pimkie](https://www.pimkie.com/)
- [Super-Visions](https://www.super-visions.com/)

View File

@@ -9,7 +9,7 @@ responsible disclosure and will make every effort to acknowledge your contributi
### iTop vulnerabilities
Please send a procedure to reproduce iTop vulnerabilities to [itop-security@combodo.com](mailto:itop-security@combodo.com).
You can send us a standard "given / then / when" report, including iTop version, impacts, and maybe installed modules or data if they are
You can send us a standard "given / when / then" report, including iTop version, impacts, and maybe installed modules or data if they are
needed to reproduce.
### Dependencies vulnerabilities

View File

@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2010-2012 Combodo SARL
// Copyright (C) 2010-2021 Combodo SARL
//
// This file is part of iTop.
//
@@ -19,7 +19,7 @@
/**
* UserRightsMatrix (User management Module)
*
* @copyright Copyright (C) 2010-2012 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/

View File

@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2010-2012 Combodo SARL
// Copyright (C) 2010-2021 Combodo SARL
//
// This file is part of iTop.
//
@@ -20,7 +20,7 @@
* UserRightsNull
* User management Module - say Yeah! to everything
*
* @copyright Copyright (C) 2010-2012 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/

View File

@@ -1,20 +1,7 @@
<?php
/**
* Copyright (C) 2013-2020 Combodo SARL
*
* This file is part of iTop.
*
* iTop is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* iTop is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
define('ADMIN_PROFILE_NAME', 'Administrator');
@@ -55,7 +42,6 @@ class URP_Profiles extends UserRightsBaseClassGUI
"db_table" => "priv_urp_profiles",
"db_key_field" => "id",
"db_finalclass_field" => "",
"display_template" => "",
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();
@@ -170,11 +156,9 @@ class URP_Profiles extends UserRightsBaseClassGUI
function DisplayBareRelations(WebPage $oPage, $bEditMode = false)
{
parent::DisplayBareRelations($oPage, $bEditMode);
if (!$bEditMode)
{
$oPage->SetCurrentTab('UI:UserManagement:GrantMatrix');
$this->DoShowGrantSumary($oPage);
}
$oPage->SetCurrentTab('UI:UserManagement:GrantMatrix');
$this->DoShowGrantSumary($oPage);
}
public static function GetReadOnlyAttributes()
@@ -237,13 +221,12 @@ class URP_UserProfile extends UserRightsBaseClassGUI
(
"category" => "addon/userrights,grant_by_profile",
"key_type" => "autoincrement",
"name_attcode" => "userid",
"name_attcode" => array("userlogin", "profile"),
"state_attcode" => "",
"reconc_keys" => array(),
"db_table" => "priv_urp_userprofile",
"db_key_field" => "id",
"db_finalclass_field" => "",
"display_template" => "",
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();
@@ -263,24 +246,56 @@ class URP_UserProfile extends UserRightsBaseClassGUI
MetaModel::Init_SetZListItems('advanced_search', array('userid', 'profileid')); // Criteria of the advanced search form
}
public function GetName()
{
return Dict::Format('UI:UserManagement:LinkBetween_User_And_Profile', $this->Get('userlogin'), $this->Get('profile'));
}
public function CheckToDelete(&$oDeletionPlan)
{
if (MetaModel::GetConfig()->Get('demo_mode'))
{
if (MetaModel::GetConfig()->Get('demo_mode')) {
// Users deletion is NOT allowed in demo mode
$oDeletionPlan->AddToDelete($this, null);
$oDeletionPlan->SetDeletionIssues($this, array('deletion not allowed in demo mode.'), true);
$oDeletionPlan->ComputeResults();
return false;
}
try {
$this->CheckIfProfileIsAllowed(UR_ACTION_DELETE);
}
catch (SecurityException $e) {
// Users deletion is NOT allowed
$oDeletionPlan->AddToDelete($this, null);
$oDeletionPlan->SetDeletionIssues($this, [$e->getMessage()], true);
$oDeletionPlan->ComputeResults();
return false;
}
return parent::CheckToDelete($oDeletionPlan);
}
public function DoCheckToDelete(&$oDeletionPlan)
{
if (MetaModel::GetConfig()->Get('demo_mode')) {
// Users deletion is NOT allowed in demo mode
$oDeletionPlan->AddToDelete($this, null);
$oDeletionPlan->SetDeletionIssues($this, array('deletion not allowed in demo mode.'), true);
$oDeletionPlan->ComputeResults();
return false;
}
try {
$this->CheckIfProfileIsAllowed(UR_ACTION_DELETE);
}
catch (SecurityException $e) {
// Users deletion is NOT allowed
$oDeletionPlan->AddToDelete($this, null);
$oDeletionPlan->SetDeletionIssues($this, [$e->getMessage()], true);
$oDeletionPlan->ComputeResults();
return false;
}
return parent::DoCheckToDelete($oDeletionPlan);
}
protected function OnInsert()
{
$this->CheckIfProfileIsAllowed(UR_ACTION_CREATE);
@@ -293,7 +308,6 @@ class URP_UserProfile extends UserRightsBaseClassGUI
protected function OnDelete()
{
$this->CheckIfProfileIsAllowed(UR_ACTION_DELETE);
}
/**
@@ -343,13 +357,12 @@ class URP_UserOrg extends UserRightsBaseClassGUI
(
"category" => "addon/userrights,grant_by_profile",
"key_type" => "autoincrement",
"name_attcode" => "userid",
"name_attcode" => array("userlogin", "allowed_org_name"),
"state_attcode" => "",
"reconc_keys" => array(),
"db_table" => "priv_urp_userorg",
"db_key_field" => "id",
"db_finalclass_field" => "",
"display_template" => "",
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();
@@ -369,12 +382,6 @@ class URP_UserOrg extends UserRightsBaseClassGUI
MetaModel::Init_SetZListItems('advanced_search', array('userid', 'allowed_org_id')); // Criteria of the advanced search form
}
public function GetName()
{
return Dict::Format('UI:UserManagement:LinkBetween_User_And_Org', $this->Get('userlogin'), $this->Get('allowed_org_name'));
}
protected function OnInsert()
{
$this->CheckIfOrgIsAllowed();

View File

@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2013-2020 Combodo SARL
* Copyright (C) 2013-2021 Combodo SARL
*
* This file is part of iTop.
*
@@ -77,7 +77,6 @@ class URP_Profiles extends UserRightsBaseClassGUI
"db_table" => "priv_urp_profiles",
"db_key_field" => "id",
"db_finalclass_field" => "",
"display_template" => "",
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();
@@ -312,11 +311,9 @@ class URP_Profiles extends UserRightsBaseClassGUI
function DisplayBareRelations(WebPage $oPage, $bEditMode = false)
{
parent::DisplayBareRelations($oPage, $bEditMode);
if (!$bEditMode)
{
$oPage->SetCurrentTab('UI:UserManagement:GrantMatrix');
$this->DoShowGrantSumary($oPage);
}
$oPage->SetCurrentTab('UI:UserManagement:GrantMatrix');
$this->DoShowGrantSumary($oPage);
}
}
@@ -330,13 +327,12 @@ class URP_UserProfile extends UserRightsBaseClassGUI
(
"category" => "addon/userrights",
"key_type" => "autoincrement",
"name_attcode" => "userid",
"name_attcode" => array("userlogin", "profile"),
"state_attcode" => "",
"reconc_keys" => array(),
"db_table" => "priv_urp_userprofile",
"db_key_field" => "id",
"db_finalclass_field" => "",
"display_template" => "",
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();
@@ -355,11 +351,6 @@ class URP_UserProfile extends UserRightsBaseClassGUI
MetaModel::Init_SetZListItems('standard_search', array('userid', 'profileid')); // Criteria of the std search form
MetaModel::Init_SetZListItems('advanced_search', array('userid', 'profileid')); // Criteria of the advanced search form
}
public function GetName()
{
return Dict::Format('UI:UserManagement:LinkBetween_User_And_Profile', $this->Get('userlogin'), $this->Get('profile'));
}
}
class URP_UserOrg extends UserRightsBaseClassGUI
@@ -370,13 +361,12 @@ class URP_UserOrg extends UserRightsBaseClassGUI
(
"category" => "addon/userrights",
"key_type" => "autoincrement",
"name_attcode" => "userid",
"name_attcode" => array("userlogin", "allowed_org_name"),
"state_attcode" => "",
"reconc_keys" => array(),
"db_table" => "priv_urp_userorg",
"db_key_field" => "id",
"db_finalclass_field" => "",
"display_template" => "",
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();
@@ -395,11 +385,6 @@ class URP_UserOrg extends UserRightsBaseClassGUI
MetaModel::Init_SetZListItems('standard_search', array('userid', 'allowed_org_id')); // Criteria of the std search form
MetaModel::Init_SetZListItems('advanced_search', array('userid', 'allowed_org_id')); // Criteria of the advanced search form
}
public function GetName()
{
return Dict::Format('UI:UserManagement:LinkBetween_User_And_Org', $this->Get('userlogin'), $this->Get('allowed_org_name'));
}
}
@@ -417,7 +402,6 @@ class URP_ActionGrant extends UserRightsBaseClass
"db_table" => "priv_urp_grant_actions",
"db_key_field" => "id",
"db_finalclass_field" => "",
"display_template" => "",
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();
@@ -454,7 +438,6 @@ class URP_StimulusGrant extends UserRightsBaseClass
"db_table" => "priv_urp_grant_stimulus",
"db_key_field" => "id",
"db_finalclass_field" => "",
"display_template" => "",
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();
@@ -491,7 +474,6 @@ class URP_AttributeGrant extends UserRightsBaseClass
"db_table" => "priv_urp_grant_attributes",
"db_key_field" => "id",
"db_finalclass_field" => "",
"display_template" => "",
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();

View File

@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2013-2020 Combodo SARL
* Copyright (C) 2013-2021 Combodo SARL
*
* This file is part of iTop.
*
@@ -58,7 +58,6 @@ class URP_Profiles extends UserRightsBaseClass
"db_table" => "priv_urp_profiles",
"db_key_field" => "id",
"db_finalclass_field" => "",
"display_template" => "",
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();
@@ -144,11 +143,9 @@ class URP_Profiles extends UserRightsBaseClass
function DisplayBareRelations(WebPage $oPage, $bEditMode = false)
{
parent::DisplayBareRelations($oPage, $bEditMode);
if (!$bEditMode)
{
$oPage->SetCurrentTab('UI:UserManagement:GrantMatrix');
$this->DoShowGrantSumary($oPage);
}
$oPage->SetCurrentTab('UI:UserManagement:GrantMatrix');
$this->DoShowGrantSumary($oPage);
}
}
@@ -167,7 +164,6 @@ class URP_Dimensions extends UserRightsBaseClass
"db_table" => "priv_urp_dimensions",
"db_key_field" => "id",
"db_finalclass_field" => "",
"display_template" => "",
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();
@@ -274,13 +270,12 @@ class URP_UserProfile extends UserRightsBaseClass
(
"category" => "addon/userrights",
"key_type" => "autoincrement",
"name_attcode" => "userid",
"name_attcode" => array("userlogin", "profile"),
"state_attcode" => "",
"reconc_keys" => array(),
"db_table" => "priv_urp_userprofile",
"db_key_field" => "id",
"db_finalclass_field" => "",
"display_template" => "",
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();
@@ -299,11 +294,6 @@ class URP_UserProfile extends UserRightsBaseClass
MetaModel::Init_SetZListItems('standard_search', array('userid', 'profileid')); // Criteria of the std search form
MetaModel::Init_SetZListItems('advanced_search', array('userid', 'profileid')); // Criteria of the advanced search form
}
public function GetName()
{
return Dict::Format('UI:UserManagement:LinkBetween_User_And_Profile', $this->Get('userlogin'), $this->Get('profile'));
}
}
@@ -321,7 +311,6 @@ class URP_ProfileProjection extends UserRightsBaseClass
"db_table" => "priv_urp_profileprojection",
"db_key_field" => "id",
"db_finalclass_field" => "",
"display_template" => "",
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();
@@ -402,7 +391,6 @@ class URP_ClassProjection extends UserRightsBaseClass
"db_table" => "priv_urp_classprojection",
"db_key_field" => "id",
"db_finalclass_field" => "",
"display_template" => "",
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();
@@ -474,7 +462,6 @@ class URP_ActionGrant extends UserRightsBaseClass
"db_table" => "priv_urp_grant_actions",
"db_key_field" => "id",
"db_finalclass_field" => "",
"display_template" => "",
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();
@@ -511,7 +498,6 @@ class URP_StimulusGrant extends UserRightsBaseClass
"db_table" => "priv_urp_grant_stimulus",
"db_key_field" => "id",
"db_finalclass_field" => "",
"display_template" => "",
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();
@@ -548,7 +534,6 @@ class URP_AttributeGrant extends UserRightsBaseClass
"db_table" => "priv_urp_grant_attributes",
"db_key_field" => "id",
"db_finalclass_field" => "",
"display_template" => "",
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();

View File

@@ -0,0 +1,60 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* Class DBSearchHelper
*
* @since 3.0.0
*/
class DBSearchHelper
{
/**
* Add context filter to DBUnionSearch
*
* @param \DBSearch|null $oSearch
*
* @throws \Exception
* @since 3.0.0
*/
public static function AddContextFilter(?DBSearch $oSearch): void
{
$oAppContext = new ApplicationContext();
$sClass = $oSearch->GetClass();
foreach ($oAppContext->GetNames() as $key) {
// Find the value of the object corresponding to each 'context' parameter
$aCallSpec = [$sClass, 'MapContextParam'];
$sAttCode = '';
if (is_callable($aCallSpec)) {
$sAttCode = call_user_func($aCallSpec, $key); // Returns null when there is no mapping for this parameter
}
if (MetaModel::IsValidAttCode($sClass, $sAttCode)) {
// Add Hierarchical condition if hierarchical key
$oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
if (isset($oAttDef) && ($oAttDef->IsExternalKey())) {
$iDefaultValue = intval($oAppContext->GetCurrentValue($key));
if ($iDefaultValue != 0) {
try {
/** @var AttributeExternalKey $oAttDef */
$sTargetClass = $oAttDef->GetTargetClass();
$sHierarchicalKeyCode = MetaModel::IsHierarchicalClass($sTargetClass);
if ($sHierarchicalKeyCode !== false) {
$oFilter = new DBObjectSearch($sTargetClass);
$oFilter->AddCondition('id', $iDefaultValue);
$oHKFilter = new DBObjectSearch($sTargetClass);
$oHKFilter->AddCondition_PointingTo($oFilter, $sHierarchicalKeyCode, TREE_OPERATOR_BELOW);
$oSearch->AddCondition_PointingTo($oHKFilter, $sAttCode);
}
}
catch (Exception $e) {
// If filtering fails just ignore it
}
}
}
}
}
}
}

View File

@@ -30,8 +30,11 @@ function mb_str_replace($search, $replace, $subject, &$count = 0) {
$replacements = array_pad($replacements, count($searches), '');
foreach ($searches as $key => $search) {
$parts = mb_split(preg_quote($search), $subject);
$count += count($parts) - 1;
$subject = implode($replacements[$key], $parts);
if (is_array($parts))
{
$count += count($parts) - 1;
$subject = implode($replacements[$key], $parts);
}
}
} else {
// Call mb_str_replace for each subject in array, recursively

View File

@@ -1,415 +1,20 @@
<?php
/**
* Copyright (C) 2013-2020 Combodo SARL
*
* This file is part of iTop.
*
* iTop is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* iTop is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* @deprecated will be removed in 3.1.0 - moved to sources/application/WebPage/AjaxPage.php, now loadable using autoloader
* @license http://opensource.org/licenses/AGPL-3.0
* @copyright Copyright (C) 2010-2021 Combodo SARL
*/
require_once(APPROOT."/application/webpage.class.inc.php");
class ajax_page extends WebPage implements iTabbedPage
// cannot notify depreciation for now as this is still MASSIVELY used in iTop core !
//DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/application/WebPage/AjaxPage.php, now loadable using autoloader');
/**
* Class ajax_page
*
* @deprecated will be removed in 3.1.0 - moved to AjaxPage
*/
class ajax_page extends AjaxPage
{
/**
* Jquery style ready script
* @var array
*/
protected $m_sReadyScript;
protected $m_oTabs;
private $m_sMenu; // If set, then the menu will be updated
/**
* constructor for the web page
*
* @param string $s_title Not used
*/
function __construct($s_title) {
$sPrintable = utils::ReadParam('printable', '0');
$bPrintable = ($sPrintable == '1');
parent::__construct($s_title, $bPrintable);
$this->m_sReadyScript = "";
//$this->add_header("Content-type: text/html; charset=utf-8");
$this->no_cache();
$this->add_xframe_options();
$this->m_oTabs = new TabManager();
$this->sContentType = 'text/html';
$this->sContentDisposition = 'inline';
$this->m_sMenu = "";
utils::InitArchiveMode();
}
/**
* @inheritDoc
* @throws \Exception
*/
public function AddTabContainer($sTabContainer, $sPrefix = '')
{
$this->add($this->m_oTabs->AddTabContainer($sTabContainer, $sPrefix));
}
/**
* @inheritDoc
* @throws \Exception
*/
public function AddToTab($sTabContainer, $sTabCode, $sHtml)
{
$this->add($this->m_oTabs->AddToTab($sTabContainer, $sTabCode, $sHtml));
}
/**
* @inheritDoc
*/
public function SetCurrentTabContainer($sTabContainer = '')
{
return $this->m_oTabs->SetCurrentTabContainer($sTabContainer);
}
/**
* @inheritDoc
*/
public function SetCurrentTab($sTabCode = '', $sTabTitle = null)
{
return $this->m_oTabs->SetCurrentTab($sTabCode, $sTabTitle);
}
/**
* @inheritDoc
* @throws \Exception
*/
public function AddAjaxTab($sTabCode, $sUrl, $bCache = true, $sTabTitle = null)
{
$this->add($this->m_oTabs->AddAjaxTab($sTabCode, $sUrl, $bCache, $sTabTitle));
}
/**
* @inheritDoc
*/
public function GetCurrentTab()
{
return $this->m_oTabs->GetCurrentTab();
}
/**
* @inheritDoc
*/
public function RemoveTab($sTabCode, $sTabContainer = null)
{
$this->m_oTabs->RemoveTab($sTabCode, $sTabContainer);
}
/**
* @inheritDoc
*/
public function FindTab($sPattern, $sTabContainer = null)
{
return $this->m_oTabs->FindTab($sPattern, $sTabContainer);
}
/**
* Make the given tab the active one, as if it were clicked
* DOES NOT WORK: apparently in the *old* version of jquery
* that we are using this is not supported... TO DO upgrade
* the whole jquery bundle...
*/
public function SelectTab($sTabContainer, $sTabCode)
{
$this->add_ready_script($this->m_oTabs->SelectTab($sTabContainer, $sTabCode));
}
/**
* @param string $sHtml
*/
public function AddToMenu($sHtml)
{
$this->m_sMenu .= $sHtml;
}
/**
* @inheritDoc
*/
public function output()
{
if (!empty($this->sContentType))
{
$this->add_header('Content-type: '.$this->sContentType);
}
if (!empty($this->sContentDisposition))
{
$this->add_header('Content-Disposition: '.$this->sContentDisposition.'; filename="'.$this->sContentFileName.'"');
}
foreach($this->a_headers as $s_header)
{
header($s_header);
}
if ($this->m_oTabs->TabsContainerCount() > 0)
{
$this->add_ready_script(
<<<EOF
// The "tab widgets" to handle.
var tabs = $('div[id^=tabbedContent]');
// Ugly patch for a change in the behavior of jQuery UI:
// Before jQuery UI 1.9, tabs were always considered as "local" (opposed to Ajax)
// when their href was beginning by #. Starting with 1.9, a <base> tag in the page
// is taken into account and causes "local" tabs to be considered as Ajax
// unless their URL is equal to the URL of the page...
if ($('base').length > 0)
{
$('div[id^=tabbedContent] > ul > li > a').each(function() {
var sHash = location.hash;
var sCleanLocation = location.href.toString().replace(sHash, '').replace(/#$/, '');
$(this).attr("href", sCleanLocation+$(this).attr("href"));
});
}
if ($.bbq)
{
// This selector will be reused when selecting actual tab widget A elements.
var tab_a_selector = 'ul.ui-tabs-nav a';
// Enable tabs on all tab widgets. The `event` property must be overridden so
// that the tabs aren't changed on click, and any custom event name can be
// specified. Note that if you define a callback for the 'select' event, it
// will be executed for the selected tab whenever the hash changes.
tabs.tabs({ event: 'change' });
// Define our own click handler for the tabs, overriding the default.
tabs.find( tab_a_selector ).click(function()
{
var state = {};
// Get the id of this tab widget.
var id = $(this).closest( 'div[id^=tabbedContent]' ).attr( 'id' );
// Get the index of this tab.
var idx = $(this).parent().prevAll().length;
// Set the state!
state[ id ] = idx;
$.bbq.pushState( state );
});
}
else
{
tabs.tabs();
}
EOF
);
}
// Render the tabs in the page (if any)
$this->s_content = $this->m_oTabs->RenderIntoContent($this->s_content, $this);
// Additional UI widgets to be activated inside the ajax fragment
// Important: Testing the content type is not enough because some ajax handlers have not correctly positionned the flag (e.g json response corrupted by the script)
if (($this->sContentType == 'text/html') && (preg_match('/class="date-pick"/', $this->s_content) || preg_match('/class="datetime-pick"/', $this->s_content)) )
{
$this->add_ready_script(
<<<EOF
PrepareWidgets();
EOF
);
}
$this->outputCollapsibleSectionInit();
$oKPI = new ExecutionKPI();
$s_captured_output = $this->ob_get_clean_safe();
if (($this->sContentType == 'text/html') && ($this->sContentDisposition == 'inline'))
{
// inline content != attachment && html => filter all scripts for malicious XSS scripts
echo self::FilterXSS($this->s_content);
}
else
{
echo $this->s_content;
}
if (!empty($this->m_sMenu))
{
$uid = time();
echo "<div id=\"accordion_temp_$uid\">\n";
echo "<div id=\"accordion\">\n";
echo "<!-- Beginning of the accordion menu -->\n";
echo self::FilterXSS($this->m_sMenu);
echo "<!-- End of the accordion menu-->\n";
echo "</div>\n";
echo "</div>\n";
echo "<script type=\"text/javascript\">\n";
echo "$('#inner_menu').html($('#accordion_temp_$uid').html());\n";
echo "$('#accordion_temp_$uid').remove();\n";
echo "\n</script>\n";
}
//echo $this->s_deferred_content;
if (count($this->a_scripts) > 0)
{
echo "<script type=\"text/javascript\">\n";
echo implode("\n", $this->a_scripts);
echo "\n</script>\n";
}
if (count($this->a_linked_scripts) > 0)
{
echo "<script type=\"text/javascript\">\n";
foreach($this->a_linked_scripts as $sScriptUrl)
{
echo '$.getScript('.json_encode($sScriptUrl).");\n";
}
echo "\n</script>\n";
}
if (!empty($this->s_deferred_content))
{
echo "<script type=\"text/javascript\">\n";
echo "\$('body').append('".addslashes(str_replace("\n", '', $this->s_deferred_content))."');\n";
echo "\n</script>\n";
}
if (!empty($this->m_sReadyScript))
{
echo "<script type=\"text/javascript\">\n";
echo $this->m_sReadyScript; // Ready Scripts are output as simple scripts
echo "\n</script>\n";
}
if(count($this->a_linked_stylesheets) > 0)
{
echo "<script type=\"text/javascript\">";
foreach($this->a_linked_stylesheets as $aStylesheet)
{
$sStylesheetUrl = $aStylesheet['link'];
echo "if (!$('link[href=\"{$sStylesheetUrl}\"]').length) $('<link href=\"{$sStylesheetUrl}\" rel=\"stylesheet\">').appendTo('head');\n";
}
echo "\n</script>\n";
}
if (trim($s_captured_output) != "")
{
echo self::FilterXSS($s_captured_output);
}
$oKPI->ComputeAndReport('Echoing');
if (class_exists('DBSearch'))
{
DBSearch::RecordQueryTrace();
}
if (class_exists('ExecutionKPI'))
{
ExecutionKPI::ReportStats();
}
}
/**
* Adds a paragraph with a smaller font into the page
* NOT implemented (i.e does nothing)
* @param string $sText Content of the (small) paragraph
* @return void
*/
public function small_p($sText)
{
}
/**
* @inheritDoc
* @throws \Exception
*/
public function add($sHtml)
{
if (($this->m_oTabs->GetCurrentTabContainer() != '') && ($this->m_oTabs->GetCurrentTab() != ''))
{
$this->m_oTabs->AddToTab($this->m_oTabs->GetCurrentTabContainer(), $this->m_oTabs->GetCurrentTab(), $sHtml);
}
else
{
parent::add($sHtml);
}
}
/**
* @inheritDoc
*/
public function start_capture()
{
$sCurrentTabContainer = $this->m_oTabs->GetCurrentTabContainer();
$sCurrentTab = $this->m_oTabs->GetCurrentTab();
if (!empty($sCurrentTabContainer) && !empty($sCurrentTab))
{
$iOffset = $this->m_oTabs->GetCurrentTabLength();
return array('tc' => $sCurrentTabContainer, 'tab' => $sCurrentTab, 'offset' => $iOffset);
}
else
{
return parent::start_capture();
}
}
/**
* @inheritDoc
*/
public function end_capture($offset)
{
if (is_array($offset))
{
if ($this->m_oTabs->TabExists($offset['tc'], $offset['tab']))
{
$sCaptured = $this->m_oTabs->TruncateTab($offset['tc'], $offset['tab'], $offset['offset']);
}
else
{
$sCaptured = '';
}
}
else
{
$sCaptured = parent::end_capture($offset);
}
return $sCaptured;
}
/**
* @inheritDoc
*/
public function add_at_the_end($s_html, $sId = '')
{
if ($sId != '')
{
$this->add_script("$('#{$sId}').remove();"); // Remove any previous instance of the same Id
}
$this->s_deferred_content .= $s_html;
}
/**
* @inheritDoc
*/
public function add_ready_script($sScript)
{
$this->m_sReadyScript .= $sScript."\n";
}
/**
* @inheritDoc
*/
public function GetUniqueId()
{
assert(false);
return 0;
}
/**
* @inheritDoc
*/
public static function FilterXSS($sHTML)
{
return str_ireplace(array('<script', '</script>'), array('<!-- <removed-script', '</removed-script> -->'), $sHTML);
}
}

View File

@@ -1,27 +1,11 @@
<?php
// Copyright (C) 2010-2012 Combodo SARL
//
// This file is part of iTop.
//
// iTop is free software; you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// iTop is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with iTop. If not, see <http://www.gnu.org/licenses/>
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* Includes all the classes to have the application up and running
*
* @copyright Copyright (C) 2010-2012 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
require_once(APPROOT.'/application/applicationcontext.class.inc.php');
@@ -31,10 +15,4 @@ require_once(APPROOT.'/application/audit.category.class.inc.php');
require_once(APPROOT.'/application/audit.rule.class.inc.php');
require_once(APPROOT.'/application/query.class.inc.php');
require_once(APPROOT.'/setup/moduleinstallation.class.inc.php');
//require_once(APPROOT.'/application/menunode.class.inc.php');
require_once(APPROOT.'/application/utils.inc.php');
class ApplicationException extends CoreException
{
}
?>

View File

@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2010-2018 Combodo SARL
// Copyright (C) 2010-2021 Combodo SARL
//
// This file is part of iTop.
//
@@ -20,23 +20,27 @@
/**
* Class ApplicationContext
*
* @copyright Copyright (C) 2010-2018 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlock;
use Combodo\iTop\Application\UI\Base\UIBlock;
require_once(APPROOT."/application/utils.inc.php");
/**
* Interface for directing end-users to the relevant application
*/
*/
interface iDBObjectURLMaker
{
/**
* @param string $sClass
* @param string $iId
*
* @return string
*/
/**
* @param string $sClass
* @param string $iId
*
* @return string
*/
public static function MakeObjectURL($sClass, $iId);
}
@@ -200,23 +204,46 @@ class ApplicationContext
}
return implode("&", $aParams);
}
/**
* @since 3.0.0 N°2534 - dashboard: bug with autorefresh that deactivates filtering on organisation
* Returns the params as c[menu]:..., c[org_id]:....
* @return string The params
*/
public function GetForPostParams()
{
return json_encode($this->aValues);
}
/**
* Returns the context as sequence of input tags to be inserted inside a <form> tag
*
* @return string The context as a sequence of <input type="hidden" /> tags
*/
public function GetForForm()
{
$sContext = "";
foreach($this->aValues as $sName => $sValue)
{
foreach ($this->aValues as $sName => $sValue) {
$sContext .= "<input type=\"hidden\" name=\"c[$sName]\" value=\"".htmlentities($sValue, ENT_QUOTES, 'UTF-8')."\" />\n";
}
return $sContext;
}
/**
* Returns the context as sequence of input tags to be inserted inside a <form> tag
*
*/
public function GetForFormBlock(): UIBlock
{
$oContext = new UIContentBlock();
foreach ($this->aValues as $sName => $sValue) {
$oContext->AddSubBlock(InputUIBlockFactory::MakeForHidden('c[$sName]', utils::HtmlEntities($sValue)));
}
return $oContext;
}
/**
* Returns the context as a hash array 'parameter_name' => value
*
* @return array The context information
*/
public function GetAsHash()

View File

@@ -1,7 +1,7 @@
<?php
/**
* Copyright (C) 2013-2020 Combodo SARL
* Copyright (C) 2013-2021 Combodo SARL
*
* This file is part of iTop.
*
@@ -18,6 +18,7 @@
* You should have received a copy of the GNU Affero General Public License
*/
use Combodo\iTop\Application\UI\Base\iUIBlock;
use Symfony\Component\DependencyInjection\Container;
require_once(APPROOT.'application/newsroomprovider.class.inc.php');
@@ -29,7 +30,7 @@ require_once(APPROOT.'application/newsroomprovider.class.inc.php');
* You may implement such interfaces in a module file (e.g. main.mymodule.php)
*
* @api
* @copyright Copyright (C) 2010-2012 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
* @package Extensibility
* @since 2.7.0
@@ -429,7 +430,7 @@ interface iApplicationUIExtension
*
* @param DBObjectSet $oSet A set of persistent objects (DBObject)
*
* @return string[string]
* @return array
*/
public function EnumAllowedActions(DBObjectSet $oSet);
}
@@ -775,6 +776,10 @@ abstract class ApplicationPopupMenuItem
/** @ignore */
protected $sLabel;
/** @ignore */
protected $sTooltip;
/** @ignore */
protected $sIconClass;
/** @ignore */
protected $aCssClasses;
/**
@@ -789,6 +794,8 @@ abstract class ApplicationPopupMenuItem
{
$this->sUID = $sUID;
$this->sLabel = $sLabel;
$this->sTooltip = '';
$this->sIconClass = '';
$this->aCssClasses = array();
}
@@ -843,6 +850,47 @@ abstract class ApplicationPopupMenuItem
$this->aCssClasses[] = $sCssClass;
}
/**
* @param $sTooltip
*
* @since 3.0.0
*/
public function SetTooltip($sTooltip)
{
$this->sTooltip = $sTooltip;
}
/**
* @return string
*
* @since 3.0.0
*/
public function GetTooltip()
{
return $this->sTooltip;
}
/**
* @param $sIconClass
*
* @since 3.0.0
*/
public function SetIconClass($sIconClass)
{
$this->sIconClass = $sIconClass;
}
/**
* @return string
*
* @since 3.0.0
*/
public function GetIconClass()
{
return $this->sIconClass;
}
/**
* Returns the components to create a popup menu item in HTML
*
@@ -868,7 +916,7 @@ abstract class ApplicationPopupMenuItem
class URLPopupMenuItem extends ApplicationPopupMenuItem
{
/** @ignore */
protected $sURL;
protected $sUrl;
/** @ignore */
protected $sTarget;
@@ -877,20 +925,38 @@ class URLPopupMenuItem extends ApplicationPopupMenuItem
*
* @param string $sUID The unique identifier of this menu in iTop... make sure you pass something unique enough
* @param string $sLabel The display label of the menu (must be localized)
* @param string $sURL If the menu is an hyperlink, provide the absolute hyperlink here
* @param string $sUrl If the menu is an hyperlink, provide the absolute hyperlink here
* @param string $sTarget In case the menu is an hyperlink and a specific target is needed (_blank for example), pass it here
*/
public function __construct($sUID, $sLabel, $sURL, $sTarget = '_top')
public function __construct($sUID, $sLabel, $sUrl, $sTarget = '_top')
{
parent::__construct($sUID, $sLabel);
$this->sURL = $sURL;
$this->sUrl = $sUrl;
$this->sTarget = $sTarget;
}
/** @ignore */
public function GetMenuItem()
{
return array('label' => $this->GetLabel(), 'url' => $this->sURL, 'target' => $this->sTarget, 'css_classes' => $this->aCssClasses);
return array('label' => $this->GetLabel(),
'url' => $this->GetUrl(),
'target' => $this-> GetTarget(),
'css_classes' => $this->aCssClasses,
'icon_class' => $this->sIconClass,
'tooltip' => $this->sTooltip
);
}
/** @ignore */
public function GetUrl()
{
return $this->sUrl;
}
/** @ignore */
public function GetTarget()
{
return $this->sTarget;
}
}
@@ -904,7 +970,9 @@ class URLPopupMenuItem extends ApplicationPopupMenuItem
class JSPopupMenuItem extends ApplicationPopupMenuItem
{
/** @ignore */
protected $sJSCode;
protected $sJsCode;
/** @ignore */
protected $sUrl;
/** @ignore */
protected $aIncludeJSFiles;
@@ -922,7 +990,8 @@ class JSPopupMenuItem extends ApplicationPopupMenuItem
public function __construct($sUID, $sLabel, $sJSCode, $aIncludeJSFiles = array())
{
parent::__construct($sUID, $sLabel);
$this->sJSCode = $sJSCode;
$this->sJsCode = $sJSCode;
$this->sUrl = '#';
$this->aIncludeJSFiles = $aIncludeJSFiles;
}
@@ -932,9 +1001,11 @@ class JSPopupMenuItem extends ApplicationPopupMenuItem
// Note: the semicolumn is a must here!
return array(
'label' => $this->GetLabel(),
'onclick' => $this->sJSCode.'; return false;',
'url' => '#',
'css_classes' => $this->aCssClasses,
'onclick' => $this->GetJsCode().'; return false;',
'url' => $this->GetUrl(),
'css_classes' => $this->GetCssClasses(),
'icon_class' => $this->sIconClass,
'tooltip' => $this->sTooltip
);
}
@@ -943,6 +1014,18 @@ class JSPopupMenuItem extends ApplicationPopupMenuItem
{
return $this->aIncludeJSFiles;
}
/** @ignore */
public function GetJsCode()
{
return $this->sJsCode;
}
/** @ignore */
public function GetUrl()
{
return $this->sUrl;
}
}
/**
@@ -1014,11 +1097,12 @@ class JSButtonItem extends JSPopupMenuItem
* @api
* @package Extensibility
* @since 2.0
* @deprecated since 3.0.0 use iPageUIBlockExtension instead
*/
interface iPageUIExtension
{
/**
* Add content to the North pane
* Add content to the header of the page
*
* @param iTopWebPage $oPage The page to insert stuff into.
*
@@ -1027,7 +1111,7 @@ interface iPageUIExtension
public function GetNorthPaneHtml(iTopWebPage $oPage);
/**
* Add content to the South pane
* Add content to the footer of the page
*
* @param iTopWebPage $oPage The page to insert stuff into.
*
@@ -1045,12 +1129,56 @@ interface iPageUIExtension
public function GetBannerHtml(iTopWebPage $oPage);
}
/**
* Implement this interface to add content to any iTopWebPage
*
* There are 3 places where content can be added:
*
* * The north pane: (normaly empty/hidden) at the top of the page, spanning the whole
* width of the page
* * The south pane: (normaly empty/hidden) at the bottom of the page, spanning the whole
* width of the page
* * The admin banner (two tones gray background) at the left of the global search.
* Limited space, use it for short messages
*
* Each of the methods of this interface is supposed to return the HTML to be inserted at
* the specified place and can use the passed iTopWebPage object to add javascript or CSS definitions
*
* @api
* @package Extensibility
* @since 3.0.0
*/
interface iPageUIBlockExtension
{
/**
* Add content to the "admin banner"
*
* @return iUIBlock|null The Block to add into the page
*/
public function GetBannerBlock();
/**
* Add content to the header of the page
*
* @return iUIBlock|null The Block to add into the page
*/
public function GetHeaderBlock();
/**
* Add content to the footer of the page
*
* @return iUIBlock|null The Block to add into the page
*/
public function GetFooterBlock();
}
/**
* Extend this class instead of iPageUIExtension if you don't need to overload all methods
*
* @api
* @package Extensibility
* @since 2.7.0
* @deprecated since 3.0.0 use AbstractPageUIBlockExtension instead
*/
abstract class AbstractPageUIExtension implements iPageUIExtension
{
@@ -1059,6 +1187,8 @@ abstract class AbstractPageUIExtension implements iPageUIExtension
*/
public function GetNorthPaneHtml(iTopWebPage $oPage)
{
DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use iPageUIBlockExtension instead');
return '';
}
@@ -1067,6 +1197,8 @@ abstract class AbstractPageUIExtension implements iPageUIExtension
*/
public function GetSouthPaneHtml(iTopWebPage $oPage)
{
DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use iPageUIBlockExtension instead');
return '';
}
@@ -1075,11 +1207,47 @@ abstract class AbstractPageUIExtension implements iPageUIExtension
*/
public function GetBannerHtml(iTopWebPage $oPage)
{
DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use iPageUIBlockExtension instead');
return '';
}
}
/**
* Extend this class instead of iPageUIExtension if you don't need to overload all methods
*
* @api
* @package Extensibility
* @since 3.0.0
*/
abstract class AbstractPageUIBlockExtension implements iPageUIBlockExtension
{
/**
* @inheritDoc
*/
public function GetBannerBlock()
{
return null;
}
/**
* @inheritDoc
*/
public function GetHeaderBlock()
{
return null;
}
/**
* @inheritDoc
*/
public function GetFooterBlock()
{
return null;
}
}
/**
* Implement this interface to add content to any enhanced portal page
*

View File

@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2010-2012 Combodo SARL
// Copyright (C) 2010-2021 Combodo SARL
//
// This file is part of iTop.
//
@@ -22,7 +22,7 @@
* to check and is linked to a set of rules that determine the valid or invalid objects
* inside the set
*
* @copyright Copyright (C) 2010-2012 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/

View File

@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2010-2012 Combodo SARL
// Copyright (C) 2010-2021 Combodo SARL
//
// This file is part of iTop.
//
@@ -23,7 +23,7 @@
* or the "bad" ones. The core audit engines computes the complement to the definition
* set when needed to obtain either the valid objects, or the ones with an error
*
* @copyright Copyright (C) 2010-2012 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
@@ -43,7 +43,6 @@ class AuditRule extends cmdbAbstractObject
"db_table" => "priv_auditrule",
"db_key_field" => "id",
"db_finalclass_field" => "",
"display_template" => "",
);
MetaModel::Init_Params($aParams);
MetaModel::Init_AddAttribute(new AttributeString("name", array("allowed_values"=>null, "sql"=>"name", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));

View File

@@ -1,84 +1,8 @@
<?php
// Copyright (C) 2016 Combodo SARL
//
// This file is part of iTop.
//
// iTop is free software; you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// iTop is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with iTop. If not, see <http://www.gnu.org/licenses/>
/**
* Adapter class: when an API requires WebPage and you want to produce something else
*
* @copyright Copyright (C) 2016 Combodo SARL
* @deprecated will be removed in 3.1.0 - moved to sources/application/WebPage/CaptureWebPage.php, now loadable using autoloader
* @license http://opensource.org/licenses/AGPL-3.0
* @copyright Copyright (C) 2010-2021 Combodo SARL
*/
require_once(APPROOT."/application/webpage.class.inc.php");
class CaptureWebPage extends WebPage
{
protected $aReadyScripts;
function __construct()
{
parent::__construct('capture web page');
$this->aReadyScripts = array();
}
public function GetHtml()
{
$trash = $this->ob_get_clean_safe();
return $this->s_content;
}
public function GetJS()
{
$sRet = implode("\n", $this->a_scripts);
if (!empty($this->s_deferred_content))
{
$sRet .= "\n\$('body').append('".addslashes(str_replace("\n", '', $this->s_deferred_content))."');";
}
return $sRet;
}
public function GetReadyJS()
{
return "\$(document).ready(function() {\n".implode("\n", $this->aReadyScripts)."\n});";
}
public function GetCSS()
{
return $this->a_styles;
}
public function GetJSFiles()
{
return $this->a_linked_scripts;
}
public function GetCSSFiles()
{
return $this->a_linked_stylesheets;
}
public function output()
{
throw new Exception(__method__.' should not be called');
}
public function add_ready_script($sScript)
{
$this->aReadyScripts[] = $sScript;
}
}
DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/application/WebPage/CaptureWebPage.php, now loadable using autoloader');

View File

@@ -1,97 +1,8 @@
<?php
// Copyright (C) 2010-2015 Combodo SARL
//
// This file is part of iTop.
//
// iTop is free software; you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// iTop is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with iTop. If not, see <http://www.gnu.org/licenses/>
/**
* CLI page
* The page adds the content-type text/XML and the encoding into the headers
*
* @copyright Copyright (C) 2010-2015 Combodo SARL
* @deprecated will be removed in 3.1.0 - moved to sources/application/WebPage/CLIPage.php, now loadable using autoloader
* @license http://opensource.org/licenses/AGPL-3.0
* @copyright Copyright (C) 2010-2021 Combodo SARL
*/
require_once(APPROOT."/application/webpage.class.inc.php");
class CLIPage implements Page
{
function __construct($s_title)
{
}
public function output()
{
if (class_exists('DBSearch'))
{
DBSearch::RecordQueryTrace();
}
if (class_exists('ExecutionKPI'))
{
ExecutionKPI::ReportStats();
}
}
public function add($sText)
{
echo $sText;
}
public function p($sText)
{
echo $sText."\n";
}
public function pre($sText)
{
echo $sText."\n";
}
public function add_comment($sText)
{
echo "#".$sText."\n";
}
public function table($aConfig, $aData, $aParams = array())
{
$aCells = array();
foreach($aConfig as $sName=>$aDef)
{
if (strlen($aDef['description']) > 0)
{
$aCells[] = $aDef['label'].' ('.$aDef['description'].')';
}
else
{
$aCells[] = $aDef['label'];
}
}
echo implode(';', $aCells)."\n";
foreach($aData as $aRow)
{
$aCells = array();
foreach($aConfig as $sName=>$aAttribs)
{
$sValue = $aRow["$sName"];
$aCells[] = $sValue;
}
echo implode(';', $aCells)."\n";
}
}
}
?>
DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/application/WebPage/CLIPage.php, now loadable using autoloader');

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,38 @@
<?php
/**
* Copyright (C) 2013-2020 Combodo SARL
*
* This file is part of iTop.
*
* iTop is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* iTop is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
*/
/**
* Class CompileCSSService : used to ease testing ThemeHander class via mocks
*
* @author Olivier DAIN <olivier.dain@combodo.com>
* @since 3.0.0 N°2982
*/
class CompileCSSService
{
/**
* CompileCSSService constructor.
*/
public function __construct()
{
}
public function CompileCSSFromSASS($sSassContent, $aImportPaths = [], $aVariables = []){
return utils::CompileCSSFromSASS($sSassContent, $aImportPaths, $aVariables);
}
}

View File

@@ -1,111 +1,8 @@
<?php
// Copyright (C) 2010-2015 Combodo SARL
//
// This file is part of iTop.
//
// iTop is free software; you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// iTop is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with iTop. If not, see <http://www.gnu.org/licenses/>
/**
* Simple web page with no includes or fancy formatting, useful to generateXML documents
* The page adds the content-type text/XML and the encoding into the headers
*
* @copyright Copyright (C) 2010-2015 Combodo SARL
* @deprecated will be removed in 3.1.0 - moved to sources/application/WebPage/CSVPage.php, now loadable using autoloader
* @license http://opensource.org/licenses/AGPL-3.0
* @copyright Copyright (C) 2010-2021 Combodo SARL
*/
require_once(APPROOT."/application/webpage.class.inc.php");
class CSVPage extends WebPage
{
function __construct($s_title) {
parent::__construct($s_title);
$this->add_header("Content-type: text/plain; charset=".self::PAGES_CHARSET);
$this->no_cache();
$this->add_xframe_options();
//$this->add_header("Content-Transfer-Encoding: binary");
}
public function output()
{
$this->add_header("Content-Length: ".strlen(trim($this->s_content)));
// Get the unexpected output but do nothing with it
$sTrash = $this->ob_get_clean_safe();
foreach($this->a_headers as $s_header)
{
header($s_header);
}
echo trim($this->s_content);
echo "\n";
if (class_exists('DBSearch'))
{
DBSearch::RecordQueryTrace();
}
if (class_exists('ExecutionKPI'))
{
ExecutionKPI::ReportStats();
}
}
public function small_p($sText)
{
}
public function add($sText)
{
$this->s_content .= $sText;
}
public function p($sText)
{
$this->s_content .= $sText."\n";
}
public function add_comment($sText)
{
$this->s_content .= "#".$sText."\n";
}
public function table($aConfig, $aData, $aParams = array())
{
$aCells = array();
foreach($aConfig as $sName=>$aDef)
{
if (strlen($aDef['description']) > 0)
{
$aCells[] = $aDef['label'].' ('.$aDef['description'].')';
}
else
{
$aCells[] = $aDef['label'];
}
}
$this->s_content .= implode(';', $aCells)."\n";
foreach($aData as $aRow)
{
$aCells = array();
foreach($aConfig as $sName=>$aAttribs)
{
$sValue = $aRow["$sName"];
$aCells[] = $sValue;
}
$this->s_content .= implode(';', $aCells)."\n";
}
}
}
DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/application/WebPage/CSVPage.php, now loadable using autoloader');

View File

@@ -1,22 +1,15 @@
<?php
/**
* Copyright (C) 2013-2019 Combodo SARL
*
* This file is part of iTop.
*
* iTop is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* iTop is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
use Combodo\iTop\Application\UI\Base\Component\Button\ButtonUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableSettings;
use Combodo\iTop\Application\UI\Base\Component\PopoverMenu\PopoverMenu;
use Combodo\iTop\Application\UI\Base\Component\Toolbar\ToolbarUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardLayout as DashboardLayoutUIBlock;
require_once(APPROOT.'application/dashboardlayout.class.inc.php');
require_once(APPROOT.'application/dashlet.class.inc.php');
require_once(APPROOT.'core/modelreflection.class.inc.php');
@@ -438,22 +431,19 @@ abstract class Dashboard
public function RenderProperties($oPage, $aExtraParams = array())
{
// menu to pick a layout and edit other properties of the dashboard
$oPage->add('<div class="ui-widget-content ui-corner-all"><div class="ui-widget-header ui-corner-all" style="text-align:center; padding: 2px;">'.Dict::S('UI:DashboardEdit:Properties').'</div>');
$oPage->add('<div class="ui-widget-content ui-corner-all ibo-dashboard-editor--properties"><div class="ui-widget-header ui-corner-all ibo-dashboard-editor--properties-title">'.Dict::S('UI:DashboardEdit:Properties').'</div>');
$sUrl = utils::GetAbsoluteUrlAppRoot();
$oPage->add('<div style="text-align:center">'.Dict::S('UI:DashboardEdit:Layout').'</div>');
$oPage->add('<div id="select_layout" style="text-align:center">');
foreach( get_declared_classes() as $sLayoutClass)
{
if (is_subclass_of($sLayoutClass, 'DashboardLayout'))
{
$oPage->add('<div class="ibo-dashboard-editor--properties-subtitle" data-role="ibo-dashboard-editor--properties-subtitle">'.Dict::S('UI:DashboardEdit:Layout').'</div>');
$oPage->add('<div id="select_layout" class="ibo-dashboard-editor--layout-list" data-role="ibo-dashboard-editor--layout-list">');
foreach (get_declared_classes() as $sLayoutClass) {
if (is_subclass_of($sLayoutClass, 'DashboardLayout')) {
$oReflection = new ReflectionClass($sLayoutClass);
if (!$oReflection->isAbstract())
{
if (!$oReflection->isAbstract()) {
$aCallSpec = array($sLayoutClass, 'GetInfo');
$aInfo = call_user_func($aCallSpec);
$sChecked = ($this->sLayoutClass == $sLayoutClass) ? 'checked' : '';
$oPage->add('<input type="radio" name="layout_class" '.$sChecked.' value="'.$sLayoutClass.'" id="layout_'.$sLayoutClass.'"><label for="layout_'.$sLayoutClass.'"><img src="'.$sUrl.$aInfo['icon'].'" /></label>'); // title="" on either the img or the label does nothing !
$oPage->add('<input type="radio" name="layout_class" '.$sChecked.' value="'.$sLayoutClass.'" id="layout_'.$sLayoutClass.'"><label for="layout_'.$sLayoutClass.'"><img src="'.$sUrl.$aInfo['icon'].'" class="ibo-dashboard--properties--icon" data-role="ibo-dashboard--properties--icon"/></label>'); // title="" on either the img or the label does nothing !
}
}
}
@@ -484,14 +474,15 @@ abstract class Dashboard
$oPage->add_ready_script(
<<<EOF
// Note: the title gets deleted by the validation mechanism
$("#attr_auto_reload_sec").tooltip({items: 'input', content: '$sRateTitle'});
$("#attr_auto_reload_sec").attr('data-tooltip-content', '$sRateTitle');
CombodoTooltip.InitTooltipFromMarkup($("#attr_auto_reload_sec"));
$("#attr_auto_reload_sec").prop('disabled', !$('#attr_auto_reload').is(':checked'));
$('#attr_auto_reload').change( function(ev) {
$("#attr_auto_reload_sec").prop('disabled', !$(this).is(':checked'));
} );
$('#select_layout').buttonset();
$('#select_layout').controlgroup();
$('#select_dashlet').droppable({
accept: '.dashlet',
drop: function(event, ui) {
@@ -501,7 +492,7 @@ abstract class Dashboard
},
});
$('#event_bus').bind('dashlet-selected', function(event, data){
$('#event_bus').on('dashlet-selected', function(event, data){
var sDashletId = data.dashlet_id;
var sPropId = 'dashlet_properties_'+sDashletId;
$('.dashlet_properties').each(function() {
@@ -526,34 +517,55 @@ EOF
* @param bool $bEditMode
* @param array $aExtraParams
* @param bool $bCanEdit
*
* @return \Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardLayout
*/
public function Render($oPage, $bEditMode = false, $aExtraParams = array(), $bCanEdit = true)
{
if (!array_key_exists('dashboard_div_id', $aExtraParams))
{
if (!array_key_exists('dashboard_div_id', $aExtraParams)) {
$aExtraParams['dashboard_div_id'] = utils::Sanitize($this->GetId(), '', 'element_identifier');
}
$oPage->add('<div class="dashboard-title-line"><div class="dashboard-title">'.htmlentities(Dict::S($this->sTitle), ENT_QUOTES, 'UTF-8', false).'</div></div>');
/** @var \DashboardLayoutMultiCol $oLayout */
$oLayout = new $this->sLayoutClass();
foreach($this->aCells as $iCellIdx => $aDashlets)
{
foreach($aDashlets as $oDashlet)
{
foreach ($this->aCells as $iCellIdx => $aDashlets) {
foreach ($aDashlets as $oDashlet) {
$aDashletCoordinates = $oLayout->GetDashletCoordinates($iCellIdx);
$this->PrepareDashletForRendering($oDashlet, $aDashletCoordinates, $aExtraParams);
}
}
$oLayout->Render($oPage, $this->aCells, $bEditMode, $aExtraParams);
if (!$bEditMode)
{
$oDashboard = $oLayout->Render($oPage, $this->aCells, $bEditMode, $aExtraParams);
$oPage->AddUiBlock($oDashboard);
$bFromDasboardPage = isset($aExtraParams['from_dashboard_page']) ? isset($aExtraParams['from_dashboard_page']) : false;
if ($bFromDasboardPage) {
$sTitleForHTML = utils::HtmlEntities(Dict::S($this->sTitle));
$sHtml = "<div class=\"ibo-top-bar--toolbar-dashboard-title\">{$sTitleForHTML}</div>";
if ($oPage instanceof iTopWebPage) {
$oTopBar = $oPage->GetTopBarLayout();
$oToolbar = ToolbarUIBlockFactory::MakeStandard();
$oTopBar->SetToolbar($oToolbar);
$oToolbar->AddHtml($sHtml);
} else {
$oPage->add_script(<<<JS
$(".ibo-top-bar--toolbar-dashboard-title").html("$sTitleForHTML");
JS
);
}
} else {
$oDashboard->SetTitle(Dict::S($this->sTitle));
}
if (!$bEditMode) {
$oPage->add_linked_script('../js/dashlet.js');
$oPage->add_linked_script('../js/dashboard.js');
}
return $oDashboard;
}
/**
@@ -565,19 +577,18 @@ EOF
public function RenderDashletsSelection(WebPage $oPage)
{
// Toolbox/palette to drag and drop dashlets
$oPage->add('<div class="ui-widget-content ui-corner-all"><div class="ui-widget-header ui-corner-all" style="text-align:center; padding: 2px;">'.Dict::S('UI:DashboardEdit:Dashlets').'</div>');
$oPage->add('<div class="ui-widget-content ui-corner-all ibo-dashboard--available-dashlets"><div class="ui-widget-header ui-corner-all ibo-dashboard--available-dashlet--title">'.Dict::S('UI:DashboardEdit:Dashlets').'</div>');
$sUrl = utils::GetAbsoluteUrlAppRoot();
$oPage->add('<div id="select_dashlet" style="text-align:center; max-height:120px; overflow-y:auto;">');
$oPage->add('<div id="select_dashlet" class="ibo-dashboard--available-dashlets--list" data-role="ibo-dashboard--available-dashlets--list">');
$aAvailableDashlets = $this->GetAvailableDashlets();
foreach($aAvailableDashlets as $sDashletClass => $aInfo)
{
$oPage->add('<span dashlet_class="'.$sDashletClass.'" class="dashlet_icon ui-widget-content ui-corner-all" id="dashlet_'.$sDashletClass.'" title="'.$aInfo['label'].'" style="width:34px; height:34px; display:inline-block; margin:2px;"><img src="'.$sUrl.$aInfo['icon'].'" /></span>');
foreach ($aAvailableDashlets as $sDashletClass => $aInfo) {
$oPage->add('<span dashlet_class="'.$sDashletClass.'" class="ibo-dashboard-editor--available-dashlet-icon dashlet_icon ui-widget-content ui-corner-all" data-role="ibo-dashboard-editor--available-dashlet-icon" id="dashlet_'.$sDashletClass.'" title="'.$aInfo['label'].'"><img src="'.$sUrl.$aInfo['icon'].'" /></span>');
}
$oPage->add('</div>');
$oPage->add('</div>');
$oPage->add_ready_script("$('.dashlet_icon').draggable({helper: 'clone', appendTo: 'body', zIndex: 10000, revert:'invalid'});");
$oPage->add_ready_script("$('.dashlet_icon').draggable({cursor: 'move', helper: 'clone', appendTo: 'body', zIndex: 10000, revert:'invalid'});");
}
/**
@@ -587,12 +598,12 @@ EOF
public function RenderDashletsProperties(WebPage $oPage, $aExtraParams = array())
{
// Toolbox/palette to edit the properties of each dashlet
$oPage->add('<div class="ui-widget-content ui-corner-all"><div class="ui-widget-header ui-corner-all" style="text-align:center; padding: 2px;">'.Dict::S('UI:DashboardEdit:DashletProperties').'</div>');
$oPage->add('<div class="ui-widget-content ui-corner-all ibo-dashlet--properties"><div class="ui-widget-header ui-corner-all ibo-dashlet--properties--title">'.Dict::S('UI:DashboardEdit:DashletProperties').'</div>');
/** @var \DashboardLayoutMultiCol $oLayout */
$oLayout = new $this->sLayoutClass();
$oPage->add('<div id="dashlet_properties" style="text-align:center">');
$oPage->add('<div id="dashlet_properties">');
foreach($this->aCells as $iCellIdx => $aCell)
{
/** @var \Dashlet $oDashlet */
@@ -625,16 +636,13 @@ EOF
foreach( get_declared_classes() as $sDashletClass)
{
// DashletUnknown is not among the selection as it is just a fallback for dashlets that can't instanciated.
if ( is_subclass_of($sDashletClass, 'Dashlet') && !in_array($sDashletClass, array('DashletUnknown', 'DashletProxy')) )
{
// DashletUnknown is not among the selection as it is just a fallback for dashlets that can't instantiated.
if (is_subclass_of($sDashletClass, 'Dashlet') && !in_array($sDashletClass, array('DashletUnknown', 'DashletProxy'))) {
$oReflection = new ReflectionClass($sDashletClass);
if (!$oReflection->isAbstract())
{
if (!$oReflection->isAbstract()) {
$aCallSpec = array($sDashletClass, 'IsVisible');
$bVisible = call_user_func($aCallSpec);
if ($bVisible)
{
if ($bVisible) {
$aCallSpec = array($sDashletClass, 'GetInfo');
$aInfo = call_user_func($aCallSpec);
$aDashlets[$sDashletClass] = $aInfo;
@@ -882,11 +890,53 @@ class RuntimeDashboard extends Dashboard
$oDashboard->FromXml($sDashboardDefinition);
$oDashboard->SetCustomFlag($bCustomized);
$oDashboard->SetDefinitionFile($sDashboardFile);
}
else
{
} else {
$oDashboard = null;
}
return $oDashboard;
}
/**
* @param string $sDashboardFile file name relative to the current module folder
* @param string $sDashBoardId code of the dashboard either menu_id or <class>__<attcode>
*
* @return null|RuntimeDashboard
* @throws \CoreException
* @throws \CoreUnexpectedValue
* @throws \MissingQueryArgument
* @throws \MySQLException
* @throws \MySQLHasGoneAwayException
* @throws \Exception
*/
public static function GetDashboardToEdit($sDashboardFile, $sDashBoardId)
{
$bCustomized = false;
// Search for an eventual user defined dashboard
$oUDSearch = new DBObjectSearch('UserDashboard');
$oUDSearch->AddCondition('user_id', UserRights::GetUserId(), '=');
$oUDSearch->AddCondition('menu_code', $sDashBoardId, '=');
$oUDSet = new DBObjectSet($oUDSearch);
if ($oUDSet->Count() > 0) {
// Assuming there is at most one couple {user, menu}!
$oUserDashboard = $oUDSet->Fetch();
$sDashboardDefinition = $oUserDashboard->Get('contents');
$bCustomized = true;
} else {
$sDashboardDefinition = @file_get_contents($sDashboardFile);
}
if ($sDashboardDefinition !== false) {
$oDashboard = new RuntimeDashboard($sDashBoardId);
$oDashboard->FromXml($sDashboardDefinition);
$oDashboard->SetCustomFlag($bCustomized);
$oDashboard->SetDefinitionFile($sDashboardFile);
} else {
$oDashboard = null;
}
return $oDashboard;
}
@@ -896,40 +946,33 @@ class RuntimeDashboard extends Dashboard
*/
public function Render($oPage, $bEditMode = false, $aExtraParams = array(), $bCanEdit = true)
{
if (!isset($aExtraParams['query_params']) && isset($aExtraParams['this->class']))
{
if (!isset($aExtraParams['query_params']) && isset($aExtraParams['this->class'])) {
$oObj = MetaModel::GetObject($aExtraParams['this->class'], $aExtraParams['this->id']);
$aRenderParams = array('query_params' => $oObj->ToArgsForQuery());
}
else
{
} else {
$aRenderParams = $aExtraParams;
}
parent::Render($oPage, $bEditMode, $aRenderParams);
$oDashboard = parent::Render($oPage, $bEditMode, $aRenderParams);
if (isset($aExtraParams['query_params']['this->object()']))
{
if (isset($aExtraParams['query_params']['this->object()'])) {
/** @var \DBObject $oObj */
$oObj = $aExtraParams['query_params']['this->object()'];
$aAjaxParams = array('this->class' => get_class($oObj), 'this->id' => $oObj->GetKey());
}
else
{
if (isset($aExtraParams['from_dashboard_page'])) {
$aAjaxParams['from_dashboard_page'] = $aExtraParams['from_dashboard_page'];
}
} else {
$aAjaxParams = $aExtraParams;
}
if (!$bEditMode && !$oPage->IsPrintableVersion())
{
if (!$bEditMode && !$oPage->IsPrintableVersion()) {
$sId = $this->GetId();
$sDivId = utils::Sanitize($sId, '', 'element_identifier');
if ($this->GetAutoReload())
{
$sFile = addslashes($this->GetDefinitionFile());
$sExtraParams = json_encode($aAjaxParams);
if ($this->GetAutoReload()) {
$iReloadInterval = 1000 * $this->GetAutoReloadInterval();
$sReloadURL = $this->GetReloadURL();
$oPage->add_script(
<<<EOF
<<<JS
if (typeof(AutoReloadDashboardId$sDivId) !== 'undefined')
{
clearInterval(AutoReloadDashboardId$sDivId);
@@ -941,25 +984,18 @@ class RuntimeDashboard extends Dashboard
function ReloadDashboard$sDivId()
{
// Do not reload when a dialog box is active
if (!($('.ui-dialog:visible').length > 0) && $('.dashboard_contents#$sDivId').is(':visible'))
if (!($('.ui-dialog:visible').length > 0) && $('.ibo-dashboard#$sDivId').is(':visible'))
{
$('.dashboard_contents#$sDivId').block();
$.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php',
{ operation: 'reload_dashboard', dashboard_id: '$sId', file: '$sFile', extra_params: $sExtraParams, reload_url: '$sReloadURL'},
function(data){
$('.dashboard_contents#$sDivId').html(data);
$('.dashboard_contents#$sDivId').unblock();
}
);
updateDashboard$sDivId();
}
}
EOF
JS
);
}
else
{
$oPage->add_script(
<<<EOF
<<<EOF
if (typeof(AutoReloadDashboardId$sDivId) !== 'undefined')
{
clearInterval(AutoReloadDashboardId$sDivId);
@@ -969,60 +1005,75 @@ EOF
);
}
if ($bCanEdit)
{
$this->RenderSelector($oPage, $aAjaxParams);
$this->RenderEditionTools($oPage, $aAjaxParams);
if ($bCanEdit) {
$this->RenderSelector($oPage, $oDashboard, $aAjaxParams);
$this->RenderEditionTools($oPage, $oDashboard, $aAjaxParams);
}
}
}
/**
* @param \iTopWebPage $oPage
* @param WebPage $oPage
* @param \Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardLayout $oDashboard
* @param bool $bFromDashboardPage
* @param array $aAjaxParams
*
* @throws \CoreException
* @throws \CoreUnexpectedValue
* @throws \MySQLException
*/
protected function RenderSelector($oPage, $aAjaxParams = array())
protected function RenderSelector(WebPage $oPage, DashboardLayoutUIBlock $oDashboard, $aAjaxParams = array())
{
if (!$this->HasCustomDashboard()) {
return;
}
$sId = $this->GetId();
$sDivId = utils::Sanitize($sId, '', 'element_identifier');
$sExtraParams = json_encode($aAjaxParams);
$sSelectorHtml = '<div class="dashboard-selector">';
if ($this->HasCustomDashboard())
{
$bStandardSelected = appUserPreferences::GetPref('display_original_dashboard_'.$sId, false);
$sStandard = Dict::S('UI:Toggle:StandardDashboard');
$sSelectorHtml .= '<div class="selector-label">'.$sStandard.'</div>';
$sSelectorHtml .= '<label class="switch"><input type="checkbox" onchange="ToggleDashboardSelector'.$sDivId.'();" '.($bStandardSelected ? '' : 'checked').'><span class="slider round"></span></label></input></label>';
$sCustom = Dict::S('UI:Toggle:CustomDashboard');
$sSelectorHtml .= '<div class="selector-label">'.$sCustom.'</div>';
$sSwitchToStandard = Dict::S('UI:Toggle:SwitchToStandardDashboard');
$sSwitchToCustom = Dict::S('UI:Toggle:SwitchToCustomDashboard');
$bStandardSelected = appUserPreferences::GetPref('display_original_dashboard_'.$sId, false);
}
$sSelectorHtml = '<div id="ibo-dashboard-selector'.$sDivId.'" class="ibo-dashboard--selector" data-tooltip-content="'.($bStandardSelected ? $sSwitchToCustom : $sSwitchToStandard).'">';
$sSelectorHtml .= '<label class="ibo-dashboard--switch"><input type="checkbox" onchange="ToggleDashboardSelector'.$sDivId.'();" '.($bStandardSelected ? '' : 'checked').'><span class="ibo-dashboard--slider"></span></label></input></label>';
$sSelectorHtml .= '</div>';
$sSelectorHtml = addslashes($sSelectorHtml);
$sFile = addslashes($this->GetDefinitionFile());
$sReloadURL = $this->GetReloadURL();
$oPage->add_ready_script(
<<<EOF
$('.dashboard-title').after('$sSelectorHtml');
EOF
);
$bFromDashboardPage = isset($aAjaxParams['from_dashboard_page']) ? isset($aAjaxParams['from_dashboard_page']) : false;
if ($bFromDashboardPage) {
if ($oPage instanceof iTopWebPage) {
$oToolbar = $oPage->GetTopBarLayout()->GetToolbar();
$oToolbar->AddHtml($sSelectorHtml);
}
} else {
$oToolbar = $oDashboard->GetToolbar();
$oToolbar->AddHtml($sSelectorHtml);
}
$oPage->add_script(
<<<EOF
<<<JS
function ToggleDashboardSelector$sDivId()
{
$('.dashboard_contents#$sDivId').block();
var dashboard = $('.ibo-dashboard#$sDivId')
dashboard.block();
$.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php',
{ operation: 'toggle_dashboard', dashboard_id: '$sId', file: '$sFile', extra_params: $sExtraParams, reload_url: '$sReloadURL' },
function(data) {
$('.dashboard_contents#$sDivId').html(data);
$('.dashboard_contents#$sDivId').unblock();
dashboard.html(data);
dashboard.unblock();
if ($('#ibo-dashboard-selector$sDivId input').prop("checked")) {
$('#ibo-dashboard-selector$sDivId').data('tooltip-content', '$sSwitchToStandard');
} else {
$('#ibo-dashboard-selector$sDivId').data('tooltip-content', '$sSwitchToCustom');
}
CombodoTooltip.InitAllNonInstantiatedTooltips($('#ibo-dashboard-selector$sDivId').parent());
}
);
}
EOF
JS
);
}
@@ -1053,45 +1104,59 @@ EOF
*
* @throws \Exception
*/
protected function RenderEditionTools(WebPage $oPage, $aExtraParams)
protected function RenderEditionTools(WebPage $oPage, DashboardLayoutUIBlock $oDashboard, $aExtraParams)
{
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.iframe-transport.js');
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.fileupload.js');
$sEditMenu = "<div id=\"DashboardMenu\"><ul><li><i class=\"top-right-icon icon-additional-arrow fas fa-pencil-alt\"></i><ul>";
$sId = utils::Sanitize($this->GetId(), '', 'element_identifier');
$sMenuTogglerId = "ibo-dashboard-menu-toggler-{$sId}";
$sPopoverMenuId = "ibo-dashboard-menu-popover-{$sId}";
$sName = 'UI:Dashboard:Actions';
$bFromDashboardPage = isset($aExtraParams['from_dashboard_page']) ? isset($aExtraParams['from_dashboard_page']) : false;
if ($bFromDashboardPage) {
if (!($oPage instanceof iTopWebPage)) {
// TODO 3.0 change the menu
return;
}
$oToolbar = $oPage->GetTopBarLayout()->GetToolbar();
} else {
$oToolbar = $oDashboard->GetToolbar();
}
$oActionButton = ButtonUIBlockFactory::MakeIconAction('fas fa-ellipsis-v', Dict::S($sName), $sName, '', false, $sMenuTogglerId)
->AddCSSClass('ibo-top-bar--toolbar-dashboard-menu-toggler')
->AddCSSClass('ibo-action-button');
$oToolbar->AddSubBlock($oActionButton);
$aActions = array();
$sFile = addslashes($this->sDefinitionFile);
$sJSExtraParams = json_encode($aExtraParams);
$bCanEdit = true;
if ($this->HasCustomDashboard())
{
$bCanEdit = !appUserPreferences::GetPref('display_original_dashboard_'.$this->GetId(), false);
}
if ($bCanEdit)
{
$oEdit = new JSPopupMenuItem('UI:Dashboard:Edit', Dict::S('UI:Dashboard:Edit'), "return EditDashboard('{$this->sId}', '$sFile', $sJSExtraParams)");
if ($this->HasCustomDashboard()) {
$oEdit = new JSPopupMenuItem('UI:Dashboard:Edit', Dict::S('UI:Dashboard:EditCustom'), "return EditDashboard('{$this->sId}', '$sFile', $sJSExtraParams)");
$aActions[$oEdit->GetUID()] = $oEdit->GetMenuItem();
$oRevert = new JSPopupMenuItem('UI:Dashboard:RevertConfirm', Dict::S('UI:Dashboard:DeleteCustom'),
"if (confirm('".addslashes(Dict::S('UI:Dashboard:RevertConfirm'))."')) return RevertDashboard('{$this->sId}', $sJSExtraParams); else return false");
$aActions[$oRevert->GetUID()] = $oRevert->GetMenuItem();
} else {
$oEdit = new JSPopupMenuItem('UI:Dashboard:Edit', Dict::S('UI:Dashboard:CreateCustom'), "return EditDashboard('{$this->sId}', '$sFile', $sJSExtraParams)");
$aActions[$oEdit->GetUID()] = $oEdit->GetMenuItem();
}
if ($this->bCustomized)
{
$oRevert = new JSPopupMenuItem('UI:Dashboard:RevertConfirm', Dict::S('UI:Dashboard:Revert'),
"if (confirm('".addslashes(Dict::S('UI:Dashboard:RevertConfirm'))."')) return RevertDashboard('{$this->sId}', $sJSExtraParams); else return false");
$aActions[$oRevert->GetUID()] = $oRevert->GetMenuItem();
}
utils::GetPopupMenuItems($oPage, iPopupMenuExtension::MENU_DASHBOARD_ACTIONS, $this, $aActions);
$sEditMenu .= $oPage->RenderPopupMenuItems($aActions);
$sEditMenu = addslashes($sEditMenu);
$oActionsMenu = $oPage->GetPopoverMenu($sPopoverMenuId, $aActions)
->SetTogglerJSSelector("#$sMenuTogglerId")
->SetContainer(PopoverMenu::ENUM_CONTAINER_BODY);
$oToolbar->AddSubBlock($oActionButton)
->AddSubBlock($oActionsMenu);
$sReloadURL = $this->GetReloadURL();
$oPage->add_ready_script(
<<<EOF
$('.dashboard-title').after('$sEditMenu');
$('#DashboardMenu>ul').popupmenu();
EOF
);
$oPage->add_script(
<<<EOF
<<<EOF
function EditDashboard(sId, sDashboardFile, aExtraParams)
{
$.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php', {operation: 'dashboard_editor', id: sId, file: sDashboardFile, extra_params: aExtraParams, reload_url: '$sReloadURL'},
@@ -1125,7 +1190,7 @@ EOF
$oPage->add_ready_script(
<<<EOF
$('#select_layout input').click( function() {
$('#select_layout input').on('click', function() {
var sLayoutClass = $(this).val();
$('.itop-dashboard').runtimedashboard('option', {layout_class: sLayoutClass});
} );
@@ -1164,30 +1229,27 @@ EOF
*/
public function RenderEditor($oPage, $aExtraParams = array())
{
if (isset($aExtraParams['this->class']))
{
if (isset($aExtraParams['this->class'])) {
$oObj = MetaModel::GetObject($aExtraParams['this->class'], $aExtraParams['this->id']);
$aRenderParams = array('query_params' => $oObj->ToArgsForQuery());
}
else
{
} else {
$aRenderParams = $aExtraParams;
}
$aRenderParams['dashboard_div_id'] = $aExtraParams['dashboard_div_id'];
$sJSExtraParams = json_encode($aExtraParams);
$oPage->add('<div id="dashboard_editor">');
$oPage->add('<div id="dashboard_editor" class="ibo-dashboard-editor" data-role="ibo-dashboard-editor">');
$oPage->add('<div class="ui-layout-center">');
$this->SetCustomFlag(true);
$this->Render($oPage, true, $aRenderParams);
$oPage->add('</div>');
$oPage->add('<div class="ui-layout-east">');
$oPage->add('<div class="ui-layout-east ibo-dashboard-editor--pane" data-role="ibo-dashboard-editor--pane">');
$this->RenderProperties($oPage, $aExtraParams);
$this->RenderDashletsSelection($oPage);
$this->RenderDashletsProperties($oPage, $aExtraParams);
$oPage->add('</div>');
$oPage->add('<div id="event_bus"/>'); // For exchanging messages between the panes, same as in the designer
$oPage->add('</div>');
$sDialogTitle = Dict::S('UI:DashboardEdit:Title');
$sOkButtonLabel = Dict::S('UI:Button:Save');
$sCancelButtonLabel = Dict::S('UI:Button:Cancel');
@@ -1215,7 +1277,24 @@ $('#dashboard_editor').dialog({
modal: true,
title: '$sDialogTitle',
buttons: [
{ text: "$sOkButtonLabel", click: function() {
{ text: "$sCancelButtonLabel",
class: "ibo-is-alternative",
click: function() {
var oDashboard = $('.itop-dashboard').data('itopRuntimedashboard');
if (oDashboard.is_modified())
{
if (!confirm('$sCancelConfirmationMessage'))
{
return;
}
}
window.bLeavingOnUserAction = true;
$(this).dialog( "close" );
$(this).remove();
} },
{ text: "$sOkButtonLabel",
class: "ibo-is-primary",
click: function() {
var oDashboard = $('.itop-dashboard').data('itopRuntimedashboard');
if (oDashboard.is_dirty())
{
@@ -1231,19 +1310,6 @@ $('#dashboard_editor').dialog({
window.bLeavingOnUserAction = true;
oDashboard.save($(this));
} },
{ text: "$sCancelButtonLabel", click: function() {
var oDashboard = $('.itop-dashboard').data('itopRuntimedashboard');
if (oDashboard.is_modified())
{
if (!confirm('$sCancelConfirmationMessage'))
{
return;
}
}
window.bLeavingOnUserAction = true;
$(this).dialog( "close" );
$(this).remove();
} },
],
close: function() { $(this).remove(); }
});
@@ -1261,20 +1327,16 @@ $('#dashboard_editor .ui-layout-center').runtimedashboard({
new_dashlet_parameters: {operation: 'new_dashlet'}
});
dashboard_prop_size = GetUserPreference('dashboard_prop_size', 350);
$('#dashboard_editor').layout({
east: {
minSize: 200,
size: dashboard_prop_size,
togglerLength_open: 0,
togglerLength_closed: 0,
onresize_end: function(name, elt, state, options, layout)
{
if (state.isSliding == false)
{
SetUserPreference('dashboard_prop_size', state.size, true);
}
},
var dashboard_prop_size = GetUserPreference('dashboard_prop_size', 400);
$('#dashboard_editor > .itop-dashboard').width($('#dashboard_editor').width() - dashboard_prop_size);
// We check when we finish click on the pane with the resize slider
// if the pane size changed (% 5px), if it's the case we save the value in userpref
$('#dashboard_editor > .itop-dashboard').on('mouseup',function (){
var iWidthDiff = $(this).width() - ($('#dashboard_editor').width() - dashboard_prop_size);
if( Math.abs(iWidthDiff) > 5){
dashboard_prop_size = iWidthDiff;
SetUserPreference('dashboard_prop_size', $('#dashboard_editor').width() - $(this).width(), true);
}
});
@@ -1436,32 +1498,37 @@ JS
$sCancelButtonLabel = Dict::S('UI:Button:Cancel');
$oPage->add_ready_script(
<<<JS
<<<JS
$('#dashlet_creation_dlg').dialog({
width: 600,
modal: true,
title: '$sDialogTitle',
buttons: [
{ text: "$sOkButtonLabel", click: function() {
var oForm = $(this).find('form');
var sFormId = oForm.attr('id');
var oParams = null;
var aErrors = ValidateForm(sFormId, false);
if (aErrors.length == 0)
{
oParams = ReadFormParams(sFormId);
}
oParams.operation = 'add_dashlet';
var me = $(this);
$.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php', oParams, function(data) {
me.dialog( "close" );
me.remove();
$('body').append(data);
});
} },
{ text: "$sCancelButtonLabel", click: function() {
{ text: "$sCancelButtonLabel",
click: function() {
$(this).dialog( "close" ); $(this).remove();
} },
} ,
'class': 'ibo-button ibo-is-alternative ibo-is-neutral action cancel'
},
{ text: "$sOkButtonLabel",
click: function() {
var oForm = $(this).find('form');
var sFormId = oForm.attr('id');
var oParams = null;
var aErrors = ValidateForm(sFormId, false);
if (aErrors.length == 0)
{
oParams = ReadFormParams(sFormId);
}
oParams.operation = 'add_dashlet';
var me = $(this);
$.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php', oParams, function(data) {
me.dialog( "close" );
me.remove();
$('body').append(data);
});
},
'class': 'ibo-button ibo-is-regular ibo-is-primary action' }
],
close: function() { $(this).remove(); }
});
@@ -1575,12 +1642,10 @@ JS
{
$sDataTableId = Dashlet::APPUSERPREFERENCES_PREFIX.$sDashletId;
$aClassAliases = array();
try{
try {
$oFilter = $oDashlet->GetDBSearch($aExtraParams);
$aClassAliases = $oFilter->GetSelectedClasses();
}
catch (Exception $e)
{
} catch (Exception $e) {
//on error, return default value
return null;
}

View File

@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2010-2012 Combodo SARL
// Copyright (C) 2010-2021 Combodo SARL
//
// This file is part of iTop.
//
@@ -15,15 +15,17 @@
//
// You should have received a copy of the GNU Affero General Public License
// along with iTop. If not, see <http://www.gnu.org/licenses/>
use Combodo\iTop\Application\UI\Base\Component\Html\Html;
use Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardColumn;
use Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardLayout as DashboardLayoutUIBlock;
use Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardRow;
/**
* Dashboard presentation
*
* @copyright Copyright (C) 2010-2012 Combodo SARL
*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
*/
abstract class DashboardLayout
{
abstract public function Render($oPage, $aDashlets, $bEditMode = false);
@@ -114,61 +116,59 @@ abstract class DashboardLayoutMultiCol extends DashboardLayout
// Trim the list of cells to remove the invisible/empty ones at the end of the array
$aCells = $this->TrimCellsArray($aCells);
$oPage->add('<table style="width:100%;table-layout:fixed;"><tbody>');
$oDashboardLayout = new DashboardLayoutUIBlock();
//$oPage->AddUiBlock($oDashboardLayout);
$iCellIdx = 0;
$fColSize = 100 / $this->iNbCols;
$sStyle = $bEditMode ? 'border: 1px #ccc dashed; width:'.$fColSize.'%;' : 'width: '.$fColSize.'%;';
$sClass = $bEditMode ? 'layout_cell edit_mode' : 'dashboard';
$iNbRows = ceil(count($aCells) / $this->iNbCols);
for($iRows = 0; $iRows < $iNbRows; $iRows++)
{
$oPage->add("<tr data-dashboard-row-index=\"$iRows\">");
for($iCols = 0; $iCols < $this->iNbCols; $iCols++)
{
$sCellClass = ($iRows == $iNbRows-1) ? $sClass.' layout_last_used_rank' : $sClass;
$oPage->add("<td style=\"$sStyle\" class=\"$sCellClass\" data-dashboard-column-index=\"$iCols\" data-dashboard-cell-index=\"$iCellIdx\">");
if (array_key_exists($iCellIdx, $aCells))
{
//Js given by each dashlet to reload
$sJSReload = "";
for ($iRows = 0; $iRows < $iNbRows; $iRows++) {
$oDashboardRow = new DashboardRow();
$oDashboardLayout->AddDashboardRow($oDashboardRow);
for ($iCols = 0; $iCols < $this->iNbCols; $iCols++) {
$oDashboardColumn = new DashboardColumn($bEditMode);
$oDashboardColumn->SetCellIndex($iCellIdx);
$oDashboardRow->AddDashboardColumn($oDashboardColumn);
if (array_key_exists($iCellIdx, $aCells)) {
$aDashlets = $aCells[$iCellIdx];
if (count($aDashlets) > 0)
{
if (count($aDashlets) > 0) {
/** @var \Dashlet $oDashlet */
foreach($aDashlets as $oDashlet)
{
if ($oDashlet::IsVisible())
{
$oDashlet->DoRender($oPage, $bEditMode, true /* bEnclosingDiv */, $aExtraParams);
foreach ($aDashlets as $oDashlet) {
if ($oDashlet::IsVisible()) {
$oDashboardColumn->AddUIBlock($oDashlet->DoRender($oPage, $bEditMode, true /* bEnclosingDiv */, $aExtraParams));
}
}
} else {
$oDashboardColumn->AddUIBlock(new Html('&nbsp;'));
}
else
{
$oPage->add('&nbsp;');
}
} else {
$oDashboardColumn->AddUIBlock(new Html('&nbsp;'));
}
else
{
$oPage->add('&nbsp;');
}
$oPage->add('</td>');
$iCellIdx++;
}
$oPage->add('</tr>');
$sJSReload .= $oDashboardRow->GetJSRefreshCallback()." ";
}
$oPage->add_script("function updateDashboard".$aExtraParams['dashboard_div_id']."(){".$sJSReload."}");
if ($bEditMode) // Add one row for extensibility
{
$sStyle = 'style="border: 1px #ccc dashed; width:'.$fColSize.'%;" class="layout_cell edit_mode layout_extension" data-dashboard-cell-index="'.$iCellIdx.'"';
$oPage->add("<tr data-dashboard-row-index=\"$iRows\">");
for($iCols = 0; $iCols < $this->iNbCols; $iCols++)
{
$oPage->add("<td $sStyle data-dashboard-column-index=\"$iCols\">");
$oPage->add('&nbsp;');
$oPage->add('</td>');
$oDashboardRow = new DashboardRow();
$oDashboardLayout->AddDashboardRow($oDashboardRow);
for ($iCols = 0; $iCols < $this->iNbCols; $iCols++) {
$oDashboardColumn = new DashboardColumn($bEditMode, true);
$oDashboardRow->AddDashboardColumn($oDashboardColumn);
$oDashboardColumn->AddUIBlock(new Html('&nbsp;'));
}
$oPage->add('</tr>');
}
$oPage->add('</tbody></table>');
return $oDashboardLayout;
}
/**

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.7">
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.0">
<classes>
<class id="AbstractResource" _delta="define">
<parent>cmdbAbstractObject</parent>
<properties>
<comment>/* Resource access control abstraction. Can be herited by abstract resource access control classes. Generaly controlled using UR_ACTION_MODIFY access right. */</comment>
<abstract>true</abstract>
</properties>
<presentation/>
<methods/>
</class>
<class id="ResourceAdminMenu" _delta="define">
<parent>AbstractResource</parent>
<properties>
<comment>/* AdminTools menu access control. */</comment>
<abstract>true</abstract>
<category>grant_by_profile</category>
</properties>
<presentation/>
<methods/>
</class>
<class id="ResourceRunQueriesMenu" _delta="define">
<parent>AbstractResource</parent>
<properties>
<comment>/* RunQueriesMenu menu access control. */</comment>
<abstract>true</abstract>
<category>grant_by_profile</category>
</properties>
<presentation/>
<methods/>
</class>
<class id="ResourceSystemMenu" _delta="define">
<parent>AbstractResource</parent>
<properties>
<comment>/* System menu access control. */</comment>
<abstract>true</abstract>
<category>grant_by_profile</category>
</properties>
<presentation/>
<methods/>
</class>
</classes>
<portals>
<portal id="backoffice" _delta="define">
<url>pages/UI.php</url>
@@ -12,13 +53,388 @@
</portal>
</portals>
<menus>
<menu id="WelcomeMenu" xsi:type="MenuGroup" _delta="define">
<rank>10</rank>
<style>
<decoration_classes>fas fa-home</decoration_classes>
</style>
</menu>
<menu id="WelcomeMenuPage" xsi:type="DashboardMenuNode" _delta="define">
<rank>10</rank>
<parent>WelcomeMenu</parent>
<definition>
<layout>DashboardLayoutOneCol</layout>
<title>Menu:WelcomeMenuPage</title>
<cells>
<cell id="0">
<rank>0</rank>
<dashlets>
</dashlets>
</cell>
</cells>
</definition>
</menu>
<menu id="MyShortcuts" xsi:type="ShortcutContainerMenuNode" _delta="define">
<rank>20</rank>
<parent>WelcomeMenu</parent>
</menu>
<menu id="UserManagement" xsi:type="TemplateMenuNode" _delta="define">
<rank>10</rank>
<parent>AdminTools</parent>
<template_file/>
</menu>
<menu id="UserAccountsMenu" xsi:type="OQLMenuNode" _delta="define">
<rank>11</rank>
<parent>UserManagement</parent>
<oql><![CDATA[SELECT User]]></oql>
<do_search>1</do_search>
<search_form_open>1</search_form_open>
<enable_class>User</enable_class>
<enable_action>UR_ACTION_MODIFY</enable_action>
</menu>
<menu id="ProfilesMenu" xsi:type="OQLMenuNode" _delta="define">
<rank>12</rank>
<parent>UserManagement</parent>
<oql><![CDATA[SELECT URP_Profiles]]></oql>
<do_search>1</do_search>
<enable_class>URP_Profiles</enable_class>
<enable_action>UR_ACTION_MODIFY</enable_action>
</menu>
<menu id="AuditCategories" xsi:type="OQLMenuNode" _delta="define">
<rank>20</rank>
<parent>AdminTools</parent>
<oql><![CDATA[SELECT AuditCategory]]></oql>
<do_search>1</do_search>
<enable_class>AuditCategory</enable_class>
<enable_action>UR_ACTION_MODIFY</enable_action>
</menu>
<menu id="Queries" xsi:type="TemplateMenuNode" _delta="define">
<rank>30</rank>
<parent>AdminTools</parent>
<template_file/>
</menu>
<menu id="RunQueriesMenu" xsi:type="WebPageMenuNode" _delta="define">
<rank>31</rank>
<parent>Queries</parent>
<url>$pages/run_query.php</url>
<enable_class>ResourceRunQueriesMenu</enable_class>
<enable_action>UR_ACTION_MODIFY</enable_action>
</menu>
<menu id="QueryMenu" xsi:type="OQLMenuNode" _delta="define">
<rank>32</rank>
<parent>Queries</parent>
<oql><![CDATA[SELECT Query]]></oql>
<do_search>1</do_search>
<enable_class>Query</enable_class>
<enable_action>UR_ACTION_MODIFY</enable_action>
</menu>
<menu id="ExportMenu" xsi:type="WebPageMenuNode" _delta="define">
<rank>33</rank>
<parent>Queries</parent>
<url>$webservices/export-v2.php?interactive=1</url>
<enable_class>ResourceAdminMenu</enable_class>
<enable_action>UR_ACTION_MODIFY</enable_action>
</menu>
<menu id="DataModelMenu" xsi:type="WebPageMenuNode" _delta="define">
<rank>40</rank>
<parent>AdminTools</parent>
<url>$pages/schema.php</url>
<enable_class>ResourceRunQueriesMenu</enable_class>
<enable_action>UR_ACTION_MODIFY</enable_action>
</menu>
<menu id="UniversalSearchMenu" xsi:type="WebPageMenuNode" _delta="define">
<rank>35</rank>
<parent>Queries</parent>
<url>$pages/UniversalSearch.php</url>
<enable_class>ResourceAdminMenu</enable_class>
<enable_action>UR_ACTION_MODIFY</enable_action>
</menu>
<menu id="ConfigurationTools" xsi:type="MenuGroup" _delta="define_if_not_exists">
<rank>90</rank>
<style>
<decoration_classes>fas fa-cog</decoration_classes>
</style>
</menu>
<menu id="DataSources" xsi:type="OQLMenuNode" _delta="define">
<rank>20</rank>
<parent>ConfigurationTools</parent>
<oql><![CDATA[SELECT SynchroDataSource]]></oql>
<do_search>1</do_search>
<enable_class>SynchroDataSource</enable_class>
<enable_action>UR_ACTION_MODIFY</enable_action>
</menu>
<menu id="NotificationsMenu" xsi:type="WebPageMenuNode" _delta="define">
<rank>40</rank>
<parent>ConfigurationTools</parent>
<url>$pages/notifications.php</url>
<enable_class>Trigger</enable_class>
<enable_action>UR_ACTION_MODIFY</enable_action>
</menu>
<menu id="AdminTools" xsi:type="MenuGroup" _delta="define">
<rank>80</rank>
<style>
<decoration_classes>fas fa-tools</decoration_classes>
</style>
</menu>
<menu id="SystemTools" xsi:type="MenuGroup" _delta="define">
<rank>100</rank>
<enable_class>ResourceSystemMenu</enable_class>
<enable_action>UR_ACTION_MODIFY</enable_action>
<style>
<decoration_classes>fas fa-terminal</decoration_classes>
</style>
</menu>
</menus>
<meta>
<classes>
<class id="cmdbAbstractObject" _delta="define">
<methods>
<method id="Set">
<arguments>
<argument id="1">
<type>attcode</type>
<mandatory>true</mandatory>
<type_restrictions>
<operation>deny</operation>
<types>
<type id="AttributeStopWatch"/>
<type id="AttributeSubItem"/>
<type id="AttributeExternalField"/>
<type id="AttributeLinkedSetIndirect"/>
<type id="AttributeLinkedSet"/>
<type id="AttributeImage"/>
<type id="AttributeBlob"/>
</types>
</type_restrictions>
</argument>
<argument id="2">
<type>string</type>
<mandatory>true</mandatory>
</argument>
</arguments>
</method>
<method id="SetIfNull">
<arguments>
<argument id="1">
<type>attcode</type>
<mandatory>true</mandatory>
<type_restrictions>
<operation>deny</operation>
<types>
<type id="AttributeStopWatch"/>
<type id="AttributeSubItem"/>
<type id="AttributeExternalField"/>
<type id="AttributeLinkedSetIndirect"/>
<type id="AttributeLinkedSet"/>
<type id="AttributeImage"/>
<type id="AttributeBlob"/>
</types>
</type_restrictions>
</argument>
<argument id="2">
<type>string</type>
<mandatory>true</mandatory>
</argument>
</arguments>
</method>
<method id="AddValue">
<arguments>
<argument id="1">
<type>attcode</type>
<mandatory>true</mandatory>
<type_restrictions>
<operation>allow</operation>
<types>
<type id="AttributeInteger"/>
<type id="AttributeDecimal"/>
<type id="AttributePercentage"/>
<type id="AttributeDuration"/>
</types>
</type_restrictions>
</argument>
<argument id="2">
<type>string</type>
<mandatory>false</mandatory>
</argument>
</arguments>
</method>
<method id="SetCurrentDate">
<arguments>
<argument id="1">
<type>attcode</type>
<mandatory>true</mandatory>
<type_restrictions>
<operation>allow</operation>
<types>
<type id="AttributeDate"/>
<type id="AttributeDateTime"/>
<type id="AttributeString"/>
</types>
</type_restrictions>
</argument>
</arguments>
</method>
<method id="SetCurrentDateIfNull">
<arguments>
<argument id="1">
<type>attcode</type>
<mandatory>true</mandatory>
<type_restrictions>
<operation>allow</operation>
<types>
<type id="AttributeDate"/>
<type id="AttributeDateTime"/>
<type id="AttributeString"/>
</types>
</type_restrictions>
</argument>
</arguments>
</method>
<method id="SetCurrentUser">
<arguments>
<argument id="1">
<type>attcode</type>
<mandatory>true</mandatory>
<type_restrictions>
<operation>allow</operation>
<types>
<type id="AttributeExternalKey"/>
<type id="AttributeInteger"/>
<type id="AttributeString"/>
</types>
</type_restrictions>
</argument>
</arguments>
</method>
<method id="SetCurrentPerson">
<arguments>
<argument id="1">
<type>attcode</type>
<mandatory>true</mandatory>
<type_restrictions>
<operation>allow</operation>
<types>
<type id="AttributeExternalKey"/>
<type id="AttributeInteger"/>
<type id="AttributeString"/>
</types>
</type_restrictions>
</argument>
</arguments>
</method>
<method id="SetElapsedTime">
<arguments>
<argument id="1">
<type>attcode</type>
<mandatory>true</mandatory>
<type_restrictions>
<operation>allow</operation>
<types>
<type id="AttributeDuration"/>
</types>
</type_restrictions>
</argument>
<argument id="2">
<type>attcode</type>
<mandatory>true</mandatory>
<type_restrictions>
<operation>allow</operation>
<types>
<type id="AttributeDate"/>
<type id="AttributeDateTime"/>
</types>
</type_restrictions>
</argument>
<argument id="3">
<type>string</type>
<mandatory>false</mandatory>
</argument>
</arguments>
</method>
<method id="Reset">
<arguments>
<argument id="1">
<type>attcode</type>
<mandatory>true</mandatory>
<type_restrictions>
<operation>deny</operation>
<types>
<type id="AttributeStopWatch"/>
<type id="AttributeSubItem"/>
<type id="AttributeExternalField"/>
</types>
</type_restrictions>
</argument>
</arguments>
</method>
<method id="ResetStopWatch">
<arguments>
<argument id="1">
<type>attcode</type>
<mandatory>true</mandatory>
<type_restrictions>
<operation>allow</operation>
<types>
<type id="AttributeStopWatch"/>
</types>
</type_restrictions>
</argument>
</arguments>
</method>
<method id="Copy">
<arguments>
<argument id="1">
<type>attcode</type>
<mandatory>true</mandatory>
<type_restrictions>
<operation>deny</operation>
<types>
<type id="AttributeStopWatch"/>
<type id="AttributeSubItem"/>
<type id="AttributeExternalField"/>
</types>
</type_restrictions>
</argument>
<argument id="2">
<type>attcode</type>
<mandatory>true</mandatory>
</argument>
</arguments>
</method>
<method id="ApplyStimulus">
<arguments>
<argument id="1">
<type>string</type>
<mandatory>true</mandatory>
</argument>
</arguments>
</method>
<method id="PrefillCreationForm">
<arguments>
<argument id="1">
<type>reference</type>
<mandatory>true</mandatory>
</argument>
</arguments>
</method>
<method id="PrefillTransitionForm">
<arguments>
<argument id="1">
<type>reference</type>
<mandatory>true</mandatory>
</argument>
</arguments>
</method>
<method id="PrefillSearchForm">
<arguments>
<argument id="1">
<type>reference</type>
<mandatory>true</mandatory>
</argument>
</arguments>
</method>
</methods>
</class>
</classes>
</meta>
</itop_design>

View File

@@ -1,6 +1,9 @@
<?php
use Combodo\iTop\Renderer\Console\ConsoleBlockRenderer;
/**
* Copyright (C) 2013-2020 Combodo SARL
* Copyright (C) 2013-2021 Combodo SARL
*
* This file is part of iTop.
*
@@ -15,6 +18,8 @@
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
*
* @deprecated since 3.0.0 use Combodo\iTop\Application\UI\Base\Component\DataTable\Datatable
*/
class DataTable
@@ -25,7 +30,7 @@ class DataTable
protected $sTableId; // identifier for saving the settings (combined with the class aliases)
protected $oSet; // The set of objects to display
protected $aClassAliases; // The aliases (alias => class) inside the set
protected $iNbObjects; // Total number of objects inthe set
protected $iNbObjects; // Total number of objects in the set
protected $bUseCustomSettings; // Whether or not the current display uses custom settings
protected $oDefaultSettings; // the default settings for displaying such a list
protected $bShowObsoleteData;
@@ -43,6 +48,7 @@ class DataTable
*/
public function __construct($iListId, $oSet, $aClassAliases, $sTableId = null)
{
DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use Combodo\iTop\Application\UI\Base\Component\DataTable\Datatable');
$this->iListId = utils::GetSafeId($iListId); // Make a "safe" ID for jQuery
$this->sDatatableContainerId = 'datatable_'.utils::GetSafeId($iListId);
$this->oSet = $oSet;
@@ -110,8 +116,7 @@ class DataTable
// See if this column is a must to load
$sClass = $this->aClassAliases[$sAlias];
$oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
if ($oAttDef->alwaysLoadInTables())
{
if ($oAttDef->AlwaysLoadInTables()) {
$aColumnsToLoad[$sAlias][] = $sAttCode;
}
}
@@ -157,17 +162,17 @@ class DataTable
$sPager = $this->GetPager($oPage, $iPageSize, $iDefaultPageSize, $iPageIndex);
$sActionsMenu = '';
$sToolkitMenu = '';
if ($bActionsMenu)
{
if ($bActionsMenu) {
$sActionsMenu = $this->GetActionsMenu($oPage, $aExtraParams);
}
if ($bToolkitMenu)
{
$sToolkitMenu = $this->GetToolkitMenu($oPage, $aExtraParams);
}
// if ($bToolkitMenu)
// {
// $sToolkitMenu = $this->GetToolkitMenu($oPage, $aExtraParams);
// }
$sDataTable = $this->GetHTMLTable($oPage, $aColumns, $sSelectMode, $iPageSize, $bViewLink, $aExtraParams);
$sConfigDlg = $this->GetTableConfigDlg($oPage, $aColumns, $bViewLink, $iDefaultPageSize);
$sHtml = "<table id=\"{$this->sDatatableContainerId}\" class=\"datatable\">";
$sHtml .= "<tr><td>";
$sHtml .= "<table style=\"width:100%;\">";
@@ -208,7 +213,7 @@ class DataTable
return $sHtml;
}
/**
* When refreshing the body of a paginated table, get the rows of the table (inside the TBODY)
* return string The HTML rows to insert inside the <tbody> node
@@ -347,17 +352,26 @@ EOF;
* @param $aExtraParams
*
* @return string
* @throws \ApplicationException
* @throws \ArchivedObjectException
* @throws \CoreException
* @throws \CoreUnexpectedValue
* @throws \DictExceptionMissingString
* @throws \MissingQueryArgument
* @throws \MySQLException
* @throws \MySQLHasGoneAwayException
* @throws \OQLException
* @throws \ReflectionException
* @throws \Twig\Error\LoaderError
* @throws \Twig\Error\RuntimeError
* @throws \Twig\Error\SyntaxError
*/
protected function GetActionsMenu(WebPage $oPage, $aExtraParams)
{
$oMenuBlock = new MenuBlock($this->oSet->GetFilter(), 'list');
$sHtml = $oMenuBlock->GetRenderContent($oPage, $aExtraParams, $this->iListId);
return $sHtml;
$oBlock = $oMenuBlock->GetRenderContent($oPage, $aExtraParams, $this->iListId);
return ConsoleBlockRenderer::RenderBlockTemplateInPage($oPage, $oBlock);
}
/**
@@ -513,6 +527,7 @@ EOF;
return $aAttribs;
}
/**
* @param $aColumns
* @param $sSelectMode
@@ -860,396 +875,3 @@ class PrintableDataTable extends DataTable
return $sHtml;
}
}
class DataTableSettings implements Serializable
{
public $aClassAliases;
public $sTableId;
public $iDefaultPageSize;
public $aColumns;
/**
* DataTableSettings constructor.
*
* @param $aClassAliases
* @param null $sTableId
*/
public function __construct($aClassAliases, $sTableId = null)
{
$this->aClassAliases = $aClassAliases;
$this->sTableId = $sTableId;
$this->iDefaultPageSize = 10;
$this->aColumns = array();
}
/**
* @param $iDefaultPageSize
* @param $aSortOrder
* @param $aColumns
*/
protected function Init($iDefaultPageSize, $aSortOrder, $aColumns)
{
$this->iDefaultPageSize = $iDefaultPageSize;
$this->aColumns = $aColumns;
$this->FixVisibleColumns();
}
/**
* @return string
*/
public function serialize()
{
// Save only the 'visible' columns
$aColumns = array();
foreach($this->aClassAliases as $sAlias => $sClass)
{
$aColumns[$sAlias] = array();
foreach($this->aColumns[$sAlias] as $sAttCode => $aData)
{
unset($aData['label']); // Don't save the display name
unset($aData['alias']); // Don't save the alias (redundant)
unset($aData['code']); // Don't save the code (redundant)
if ($aData['checked'])
{
$aColumns[$sAlias][$sAttCode] = $aData;
}
}
}
return serialize(
array(
'iDefaultPageSize' => $this->iDefaultPageSize,
'aColumns' => $aColumns,
)
);
}
/**
* @param string $sData
*
* @throws \Exception
*/
public function unserialize($sData)
{
$aData = unserialize($sData);
$this->iDefaultPageSize = $aData['iDefaultPageSize'];
$this->aColumns = $aData['aColumns'];
foreach($this->aClassAliases as $sAlias => $sClass)
{
foreach($this->aColumns[$sAlias] as $sAttCode => $aData)
{
$aFieldData = false;
if ($sAttCode == '_key_')
{
$aFieldData = $this->GetFieldData($sAlias, $sAttCode, null, true /* bChecked */, $aData['sort']);
}
else if (MetaModel::isValidAttCode($sClass, $sAttCode))
{
$oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
$aFieldData = $this->GetFieldData($sAlias, $sAttCode, $oAttDef, true /* bChecked */, $aData['sort']);
}
if ($aFieldData)
{
$this->aColumns[$sAlias][$sAttCode] = $aFieldData;
}
else
{
unset($this->aColumns[$sAlias][$sAttCode]);
}
}
}
$this->FixVisibleColumns();
}
/**
* @param $aClassAliases
* @param $bViewLink
* @param $aDefaultLists
*
* @return \DataTableSettings
* @throws \CoreException
* @throws \DictExceptionMissingString
*/
static public function GetDataModelSettings($aClassAliases, $bViewLink, $aDefaultLists)
{
$oSettings = new DataTableSettings($aClassAliases);
// Retrieve the class specific settings for each class/alias based on the 'list' ZList
//TODO let the caller pass some other default settings (another Zlist, extre fields...)
$aColumns = array();
foreach($aClassAliases as $sAlias => $sClass)
{
if ($aDefaultLists == null)
{
$aList = cmdbAbstract::FlattenZList(MetaModel::GetZListItems($sClass, 'list'));
}
else
{
$aList = $aDefaultLists[$sAlias];
}
$aSortOrder = MetaModel::GetOrderByDefault($sClass);
if ($bViewLink)
{
$sSort = 'none';
if(array_key_exists('friendlyname', $aSortOrder))
{
$sSort = $aSortOrder['friendlyname'] ? 'asc' : 'desc';
}
$sNormalizedFName = MetaModel::NormalizeFieldSpec($sClass, 'friendlyname');
if(array_key_exists($sNormalizedFName, $aSortOrder))
{
$sSort = $aSortOrder[$sNormalizedFName] ? 'asc' : 'desc';
}
$aColumns[$sAlias]['_key_'] = $oSettings->GetFieldData($sAlias, '_key_', null, true /* bChecked */, $sSort);
}
foreach($aList as $sAttCode)
{
$sSort = 'none';
if(array_key_exists($sAttCode, $aSortOrder))
{
$sSort = $aSortOrder[$sAttCode] ? 'asc' : 'desc';
}
$oAttDef = Metamodel::GetAttributeDef($sClass, $sAttCode);
$aFieldData = $oSettings->GetFieldData($sAlias, $sAttCode, $oAttDef, true /* bChecked */, $sSort);
if ($aFieldData) $aColumns[$sAlias][$sAttCode] = $aFieldData;
}
}
$iDefaultPageSize = appUserPreferences::GetPref('default_page_size', MetaModel::GetConfig()->GetMinDisplayLimit());
$oSettings->Init($iDefaultPageSize, $aSortOrder, $aColumns);
return $oSettings;
}
/**
* @throws \CoreException
*/
protected function FixVisibleColumns()
{
foreach($this->aClassAliases as $sAlias => $sClass)
{
if (!isset($this->aColumns[$sAlias]))
{
continue;
}
foreach($this->aColumns[$sAlias] as $sAttCode => $aData)
{
// Remove non-existent columns
// TODO: check if the existing ones are still valid (in case their type changed)
if (($sAttCode != '_key_') && (!MetaModel::IsValidAttCode($sClass, $sAttCode)))
{
unset($this->aColumns[$sAlias][$sAttCode]);
}
}
$aList = MetaModel::ListAttributeDefs($sClass);
// Add the other (non visible ones), sorted in alphabetical order
$aTempData = array();
foreach($aList as $sAttCode => $oAttDef)
{
if ( (!array_key_exists($sAttCode, $this->aColumns[$sAlias])) && (!($oAttDef instanceof AttributeLinkedSet || $oAttDef instanceof AttributeDashboard)))
{
$aFieldData = $this->GetFieldData($sAlias, $sAttCode, $oAttDef, false /* bChecked */, 'none');
if ($aFieldData) $aTempData[$aFieldData['label']] = $aFieldData;
}
}
ksort($aTempData);
foreach($aTempData as $sLabel => $aFieldData)
{
$this->aColumns[$sAlias][$aFieldData['code']] = $aFieldData;
}
}
}
/**
* @param $aClassAliases
* @param null $sTableId
* @param bool $bOnlyOnTable
*
* @return \DataTableSettings|null
* @throws \Exception
*/
static public function GetTableSettings($aClassAliases, $sTableId = null, $bOnlyOnTable = false)
{
$pref = null;
$oSettings = new DataTableSettings($aClassAliases, $sTableId);
if ($sTableId != null)
{
// An identified table, let's fetch its own settings (if any)
$pref = appUserPreferences::GetPref($oSettings->GetPrefsKey($sTableId), null);
}
if ($pref == null)
{
if (!$bOnlyOnTable)
{
// Try the global preferred values for this class / set of classes
$pref = appUserPreferences::GetPref($oSettings->GetPrefsKey(null), null);
}
if ($pref == null)
{
// no such settings, use the default values provided by the data model
return null;
}
}
$oSettings->unserialize($pref);
return $oSettings;
}
/**
* @return array
*/
public function GetSortOrder()
{
$aSortOrder = array();
foreach($this->aColumns as $sAlias => $aColumns)
{
foreach($aColumns as $aColumn)
{
if ($aColumn['sort'] != 'none')
{
$sCode = ($aColumn['code'] == '_key_') ? 'friendlyname' : $aColumn['code'];
$aSortOrder[$sCode] = ($aColumn['sort']=='asc'); // true for ascending, false for descending
}
}
break; // TODO: For now the Set object supports only sorting on the first class of the set
}
return $aSortOrder;
}
/**
* @param null $sTargetTableId
*
* @return bool
*/
public function Save($sTargetTableId = null)
{
$sSaveId = is_null($sTargetTableId) ? $this->sTableId : $sTargetTableId;
if ($sSaveId == null) return false; // Cannot save, the table is not identified, use SaveAsDefault instead
$sSettings = $this->serialize();
appUserPreferences::SetPref($this->GetPrefsKey($sSaveId), $sSettings);
return true;
}
/**
* @return bool
*/
public function SaveAsDefault()
{
$sSettings = $this->serialize();
appUserPreferences::SetPref($this->GetPrefsKey(null), $sSettings);
return true;
}
/**
* Clear the preferences for this particular table
* @param $bResetAll boolean If true,the settings for all tables of the same class(es)/alias(es) are reset
*/
public function ResetToDefault($bResetAll)
{
if (($this->sTableId == null) && (!$bResetAll)) return false; // Cannot reset, the table is not identified, use force $bResetAll instead
if ($bResetAll)
{
// Turn the key into a suitable PCRE pattern
$sKey = $this->GetPrefsKey(null);
$sPattern = str_replace(array('|'), array('\\|'), $sKey); // escape the | character
$sPattern = '#^'.str_replace(array('*'), array('.*'), $sPattern).'$#'; // Don't use slash as the delimiter since it's used in our key to delimit aliases
appUserPreferences::UnsetPref($sPattern, true);
}
else
{
appUserPreferences::UnsetPref($this->GetPrefsKey($this->sTableId), false);
}
return true;
}
/**
* @param null $sTableId
*
* @return string
*/
protected function GetPrefsKey($sTableId = null)
{
return static::GetAppUserPreferenceKey($this->aClassAliases, $sTableId);
}
public static function GetAppUserPreferenceKey($aClassAliases, $sTableId)
{
if ($sTableId === null)
{
$sTableId = '*';
}
$aKeys = array();
foreach($aClassAliases as $sAlias => $sClass)
{
$aKeys[] = $sAlias.'-'.$sClass;
}
return implode('/', $aKeys).'|'.$sTableId;
}
/**
* @param $sAlias
* @param $sAttCode
* @param $oAttDef
* @param $bChecked
* @param $sSort
*
* @return array|bool
* @throws \CoreException
* @throws \DictExceptionMissingString
*/
protected function GetFieldData($sAlias, $sAttCode, $oAttDef, $bChecked, $sSort)
{
$ret = false;
if ($sAttCode == '_key_')
{
$sLabel = Dict::Format('UI:ExtKey_AsLink', MetaModel::GetName($this->aClassAliases[$sAlias]));
$ret = array(
'label' => $sLabel,
'checked' => true,
'disabled' => true,
'alias' => $sAlias,
'code' => $sAttCode,
'sort' => $sSort,
);
}
else if (!$oAttDef->IsLinkSet())
{
$sLabel = $oAttDef->GetLabel();
if ($oAttDef->IsExternalKey())
{
$sLabel = Dict::Format('UI:ExtKey_AsLink', $oAttDef->GetLabel());
}
else if ($oAttDef->IsExternalField())
{
if ($oAttDef->IsFriendlyName())
{
$sLabel = Dict::Format('UI:ExtKey_AsFriendlyName', $oAttDef->GetLabel());
}
else
{
$oExtAttDef = $oAttDef->GetExtAttDef();
$sLabel = Dict::Format('UI:ExtField_AsRemoteField', $oAttDef->GetLabel(), $oExtAttDef->GetLabel());
}
}
elseif ($oAttDef instanceof AttributeFriendlyName)
{
$sLabel = Dict::Format('UI:ExtKey_AsFriendlyName', $oAttDef->GetLabel());
}
$ret = array(
'label' => $sLabel,
'checked' => $bChecked,
'disabled' => false,
'alias' => $sAlias,
'code' => $sAttCode,
'sort' => $sSort,
);
}
return $ret;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,82 +1,8 @@
<?php
/**
* @copyright Copyright (C) 2010-2020 Combodo SARL
* @deprecated will be removed in 3.1.0 - moved to sources/application/WebPage/ErrorPage.php, now loadable using autoloader
* @license http://opensource.org/licenses/AGPL-3.0
* @copyright Copyright (C) 2010-2021 Combodo SARL
*/
class ErrorPage extends NiceWebPage
{
public function __construct($sTitle)
{
parent::__construct($sTitle);
$this->add_linked_script("../js/jquery.blockUI.js");
$this->add_linked_script("../setup/setup.js");
$this->add_saas("css/setup.scss");
}
public function info($sText)
{
$this->add("<p class=\"info\">$sText</p>\n");
$this->log_info($sText);
}
public function ok($sText)
{
$this->add("<div class=\"message message-valid\"><span class=\"message-title\">Success:</span>$sText</div>");
$this->log_ok($sText);
}
public function warning($sText)
{
$this->add("<div class=\"message message-warning\"><span class=\"message-title\">Warning:</span>$sText</div>");
$this->log_warning($sText);
}
public function error($sText)
{
$this->add("<div class=\"message message-error\">$sText</div>");
$this->log_error($sText);
}
public function output()
{
$sLogo = utils::GetAbsoluteUrlAppRoot().'/images/itop-logo.png';
$sTimeStamp = utils::GetCacheBusterTimestamp();
$sTitle = utils::HtmlEntities($this->s_title);
$this->s_content = <<<HTML
<div id="header" class="error_page">
<h1><a href="http://www.combodo.com/itop" target="_blank"><img title="iTop by Combodo" alt=" " src="{$sLogo}?t={$sTimeStamp}"></a>&nbsp;{$sTitle}</h1>
</div>
<div id="setup" class="error_page">
{$this->s_content}
</div>
HTML;
return parent::output();
}
public static function log_error($sText)
{
IssueLog::Error($sText);
}
public static function log_warning($sText)
{
IssueLog::Warning($sText);
}
public static function log_info($sText)
{
IssueLog::Info($sText);
}
public static function log_ok($sText)
{
IssueLog::Ok($sText);
}
public static function log($sText)
{
IssueLog::Ok($sText);
}
}
DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/application/WebPage/ErrorPage.php, now loadable using autoloader');

View File

@@ -0,0 +1,9 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class ApplicationException extends CoreException
{
}

View File

@@ -0,0 +1,14 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* Thrown when querying on an object that exists in the database but is archived
*
* @since 2.5.1 N°1108
*/
class ArchivedObjectException extends CoreException
{
}

View File

@@ -0,0 +1,9 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class BulkChangeException extends CoreException
{
}

View File

@@ -0,0 +1,9 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class CSVParserException extends CoreException
{
}

View File

@@ -0,0 +1,9 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class ConfigException extends CoreException
{
}

View File

@@ -0,0 +1,77 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* Class CoreCannotSaveObjectException
*
* Specialized exception to raise if {@link DBObject::CheckToWrite()} fails, which allow easy data retrieval
*
* @see \DBObject::DBInsertNoReload()
* @see \DBObject::DBUpdate()
*
* @since 2.6.0 N°659 uniqueness constraint
*/
class CoreCannotSaveObjectException extends CoreException
{
/** @var string[] */
private $aIssues;
/** @var int */
private $iObjectId;
/** @var string */
private $sObjectClass;
/**
* CoreCannotSaveObjectException constructor.
*
* @param array $aContextData containing at least those keys : issues, id, class
*/
public function __construct($aContextData, $oPrevious = null)
{
$this->aIssues = $aContextData['issues'];
$this->iObjectId = $aContextData['id'];
$this->sObjectClass = $aContextData['class'];
$sIssues = implode(', ', $this->aIssues);
parent::__construct($sIssues, $aContextData, '', $oPrevious);
}
/**
* @return string
*/
public function getHtmlMessage()
{
$sTitle = Dict::S('UI:Error:SaveFailed');
$sContent = "<span><strong>{$sTitle}</strong></span>";
if (count($this->aIssues) == 1) {
$sIssue = reset($this->aIssues);
$sContent .= " <span>{$sIssue}</span>";
} else {
$sContent .= '<ul>';
foreach ($this->aIssues as $sError) {
$sContent .= "<li>$sError</li>";
}
$sContent .= '</ul>';
}
return $sContent;
}
public function getIssues()
{
return $this->aIssues;
}
public function getObjectId()
{
return $this->iObjectId;
}
public function getObjectClass()
{
return $this->sObjectClass;
}
}

View File

@@ -0,0 +1,108 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class CoreException extends Exception
{
/**
* CoreException constructor.
*
* @param string $sIssue error message
* @param array|null $aContextData key/value array, value MUST implements _toString
* @param string $sImpact
* @param Exception|null $oPrevious
*/
public function __construct($sIssue, $aContextData = null, $sImpact = '', $oPrevious = null)
{
$this->m_sIssue = $sIssue;
$this->m_sImpact = $sImpact;
if (is_array($aContextData)) {
$this->m_aContextData = $aContextData;
} else {
$this->m_aContextData = [];
}
$sMessage = $sIssue;
if (!empty($sImpact)) {
$sMessage .= "($sImpact)";
}
if (count($this->m_aContextData) > 0) {
$sMessage .= ": ";
$aContextItems = array();
foreach ($this->m_aContextData as $sKey => $value) {
if (is_array($value)) {
$aPairs = array();
foreach ($value as $key => $val) {
if (is_array($val)) {
$aPairs[] = $key.'=>('.implode(', ', $val).')';
} else {
$aPairs[] = $key.'=>'.$val;
}
}
$sValue = '{'.implode('; ', $aPairs).'}';
} else {
$sValue = $value;
}
$aContextItems[] = "$sKey = $sValue";
}
$sMessage .= implode(', ', $aContextItems);
}
parent::__construct($sMessage, 0, $oPrevious);
}
/**
* @return string code and message for log purposes
*/
public function getInfoLog()
{
return 'error_code='.$this->getCode().', message="'.$this->getMessage().'"';
}
public function getHtmlDesc($sHighlightHtmlBegin = '<b>', $sHighlightHtmlEnd = '</b>')
{
return $this->getMessage();
}
/**
* getTraceAsString() cannot be overrided and it is limited as only current exception stack is returned.
* we need stack of all previous exceptions
*
* @uses __tostring() already does the work.
* @since 2.7.2/ 3.0.0
*/
public function getFullStackTraceAsString()
{
return "".$this;
}
public function getTraceAsHtml()
{
$aBackTrace = $this->getTrace();
return MyHelpers::get_callstack_html(0, $this->getTrace());
// return "<pre>\n".$this->getTraceAsString()."</pre>\n";
}
public function addInfo($sKey, $value)
{
$this->m_aContextData[$sKey] = $value;
}
public function getIssue()
{
return $this->m_sIssue;
}
public function getImpact()
{
return $this->m_sImpact;
}
public function getContextData()
{
return $this->m_aContextData;
}
}

View File

@@ -0,0 +1,13 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* @since 2.7.0 N°2555
*/
class CorePortalInvalidActionRuleException extends CoreException
{
}

View File

@@ -0,0 +1,17 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* @since 3.0.0 N°3522
*/
class CoreTemplateException extends CoreException
{
public function __construct(Exception $oTwigException, string $sTemplatePath)
{
$sMessage = "Twig Exception when rendering '$sTemplatePath' : ".$oTwigException->getMessage();
parent::__construct($sMessage, null, '', $oTwigException);
}
}

View File

@@ -0,0 +1,9 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class CoreUnexpectedValue extends CoreException
{
}

View File

@@ -0,0 +1,9 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class CoreWarning extends CoreException
{
}

View File

@@ -0,0 +1,9 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class DeleteException extends CoreException
{
}

View File

@@ -0,0 +1,14 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* A parameter stored in the {@link Config} is invalid
*
* @since 2.7.0
*/
class InvalidConfigParamException extends CoreException
{
}

View File

@@ -0,0 +1,14 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* Thrown when the password is not valid
*
* @since 2.7.0
*/
class InvalidPasswordAttributeOneWayPassword extends CoreException
{
}

View File

@@ -0,0 +1,13 @@
<?php
/**
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Application\TwigBase\Controller;
use Exception;
class PageNotFoundException extends Exception
{
}

View File

@@ -0,0 +1,9 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class SecurityException extends CoreException
{
}

View File

@@ -0,0 +1,9 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class SynchroExceptionNotStarted extends CoreException
{
}

View File

@@ -0,0 +1,9 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class UserRightException extends CoreException
{
}

View File

@@ -0,0 +1,9 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class DictException extends CoreException
{
}

View File

@@ -0,0 +1,16 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class DictExceptionMissingString extends DictException
{
public function __construct($sLanguageCode, $sStringCode)
{
$aContext = array();
$aContext['language_code'] = $sLanguageCode;
$aContext['string_code'] = $sStringCode;
parent::__construct('Missing localized string', $aContext);
}
}

View File

@@ -0,0 +1,15 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class DictExceptionUnknownLanguage extends DictException
{
public function __construct($sLanguageCode)
{
$aContext = array();
$aContext['language_code'] = $sLanguageCode;
parent::__construct('Unknown localization language', $aContext);
}
}

View File

@@ -0,0 +1,39 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class MySQLException extends CoreException
{
/**
* MySQLException constructor.
*
* @param string $sIssue
* @param array $aContext
* @param \Exception $oException
* @param \mysqli $oMysqli to use when working with a custom mysqli instance
*/
public function __construct($sIssue, $aContext, $oException = null, $oMysqli = null)
{
if ($oException != null) {
$aContext['mysql_errno'] = $oException->getCode();
$this->code = $oException->getCode();
$aContext['mysql_error'] = $oException->getMessage();
} else if ($oMysqli != null) {
$aContext['mysql_errno'] = $oMysqli->errno;
$this->code = $oMysqli->errno;
$aContext['mysql_error'] = $oMysqli->error;
} else {
$aContext['mysql_errno'] = CMDBSource::GetErrNo();
$this->code = CMDBSource::GetErrNo();
$aContext['mysql_error'] = CMDBSource::GetError();
}
parent::__construct($sIssue, $aContext);
//if is connection error, don't log the default message with password in
if (mysqli_connect_errno()) {
error_log($this->message);
error_reporting(0);
}
}
}

View File

@@ -0,0 +1,32 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* Class MySQLHasGoneAwayException
*
* @see https://dev.mysql.com/doc/refman/5.7/en/gone-away.html
* @since 2.5.0 N°1195
*/
class MySQLHasGoneAwayException extends MySQLException
{
/**
* can not be a constant before PHP 5.6 (http://php.net/manual/fr/language.oop5.constants.php)
*
* @return int[]
*/
public static function getErrorCodes()
{
return array(
2006,
2013,
);
}
public function __construct($sIssue, $aContext)
{
parent::__construct($sIssue, $aContext, null);
}
}

View File

@@ -0,0 +1,13 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* @since 2.7.0 N°679
*/
class MySQLNoTransactionException extends MySQLException
{
}

View File

@@ -0,0 +1,15 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* Class MySQLQueryHasNoResultException
*
* @since 2.5.0
*/
class MySQLQueryHasNoResultException extends MySQLException
{
}

View File

@@ -0,0 +1,13 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* @since 2.7.0 N°2555
*/
class CoreOqlException extends CoreException
{
}

View File

@@ -0,0 +1,13 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* @since 2.7.0 N°2555
*/
class CoreOqlMultipleResultsForbiddenException extends CoreOqlException
{
}

View File

@@ -0,0 +1,15 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* Exception for {@link iProcess} implementations.<br>
* An error happened during the processing but we can go on with the next implementations.
*
* @since 2.5.0 N°1195
*/
class ProcessException extends CoreException
{
}

View File

@@ -0,0 +1,16 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* Class ProcessFatalException
* Exception for iProcess implementations.<br>
* A big error occurred, we have to stop the iProcess processing.
*
* @since 2.5.0 N°1195
*/
class ProcessFatalException extends CoreException
{
}

View File

@@ -0,0 +1,12 @@
<?php
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* @since 2.7.0 PR #89
*/
class ProcessInvalidConfigException extends ProcessException
{
}

View File

@@ -0,0 +1,114 @@
<?php
/**
* Copyright (C) 2013-2020 Combodo SARL
*
* This file is part of iTop.
*
* iTop is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* iTop is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
*/
/**
* Class FindStylesheetObject: dedicated class to store computations made in method ThemeHandler::FindStylesheetFile.
* @author Olivier DAIN <olivier.dain@combodo.com>
* @since 3.0.0 N°3588
*/
class FindStylesheetObject{
//file URIs
private $aStylesheetFileURIs;
//fill paths
private $aStylesheetImportPaths;
private $aAllStylesheetFilePaths;
private $sLastStyleSheetPath;
private $iLastModified;
/**
* FindStylesheetObject constructor.
*/
public function __construct()
{
$this->aStylesheetFileURIs = [];
$this->aStylesheetImportPaths = [];
$this->aAllStylesheetFilePaths = [];
$this->sLastStyleSheetPath = "";
$this->iLastModified = 0;
}
public function GetLastStylesheetFile(): string
{
return $this->sLastStyleSheetPath;
}
public function GetImportPaths(): array
{
return $this->aStylesheetImportPaths;
}
/**
* @return array : main stylesheets URIs
*/
public function GetStylesheetFileURIs(): array
{
return $this->aStylesheetFileURIs;
}
public function GetLastModified() : int
{
return $this->iLastModified;
}
/**
* @return array : main stylesheets paths + included files paths
*/
public function GetAllStylesheetPaths(): array
{
return $this->aAllStylesheetFilePaths;
}
/**
* @return string : last found stylesheet URI
*/
public function GetLastStyleSheetPath(): string
{
return $this->sLastStyleSheetPath;
}
public function AddStylesheet(string $sStylesheetFileURI, string $sStylesheetFilePath): void
{
$this->aStylesheetFileURIs[] = $sStylesheetFileURI;
$this->aAllStylesheetFilePaths[] = $sStylesheetFilePath;
$this->sLastStyleSheetPath = $sStylesheetFilePath;
}
public function AlreadyFetched(string $sStylesheetFilePath) : bool {
return in_array($sStylesheetFilePath, $this->aAllStylesheetFilePaths);
}
public function AddImport(string $sStylesheetFileURI, string $sStylesheetFilePath): void
{
$this->aStylesheetImportPaths[$sStylesheetFileURI] = $sStylesheetFilePath;
$this->aAllStylesheetFilePaths[] = $sStylesheetFilePath;
}
public function UpdateLastModified(string $sStylesheetFile): void
{
$this->iLastModified = max($this->iLastModified, @filemtime($sStylesheetFile));
}
public function ResetLastStyleSheet(): void
{
$this->sLastStyleSheetPath = "";
}
}

View File

@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2010-2012 Combodo SARL
// Copyright (C) 2010-2021 Combodo SARL
//
// This file is part of iTop.
//
@@ -20,7 +20,7 @@
* Helper class to build interactive forms to be used either in stand-alone
* modal dialog or in "property-sheet" panes.
*
* @copyright Copyright (C) 2010-2012 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class DesignerForm
@@ -102,23 +102,19 @@ class DesignerForm
$sReturn .= '<fieldset>';
$sReturn .= '<legend>'.$sLabel.'</legend>';
}
foreach($aFields as $oField)
{
foreach($aFields as $oField) {
$aRow = $oField->Render($oP, $sFormId);
if ($oField->IsVisible())
{
$sValidation = '&nbsp;<span class="prop_apply">'.$this->GetValidationArea($oField->GetFieldId()).'</span>';
if ($oField->IsVisible()) {
$sValidation = '<span class="prop_apply ibo-prop--apply">'.$this->GetValidationArea($oField->GetFieldId()).'</span>';
$sField = $aRow['value'].$sValidation;
$aDetails[] = array('label' => $aRow['label'], 'value' => $sField);
}
else
{
} else {
$sHiddenFields .= $aRow['value'];
}
}
$sReturn .= $oP->GetDetails($aDetails);
if ($sLabel != '')
{
if ($sLabel != '') {
$sReturn .= '</fieldset>';
}
}
@@ -230,18 +226,18 @@ class DesignerForm
if ($oField->IsVisible())
{
$sFieldId = $this->GetFieldId($oField->GetCode());
$sValidation = $this->GetValidationArea($sFieldId, '<span title="Apply" class="ui-icon ui-icon-circle-check"/>');
$sValidationFields = '</td><td class="prop_icon prop_apply">'.$sValidation.'</td><td class="prop_icon prop_cancel"><span title="Revert" class="ui-icon ui-icon-circle-close"/></td>'.$this->EndRow();
$sValidation = $this->GetValidationArea($sFieldId, '<span data-tooltip-content="Apply"><i class="fas fa-check"></i></span>');
$sValidationFields = '</td><td class="prop_icon prop_apply ibo-prop--apply">'.$sValidation.'</td><td class="prop_icon prop_cancel ibo-prop--cancel"><span data-tooltip-content="Revert"><i class="fas fa-times"></i></span></td>'.$this->EndRow();
$sPath = $this->GetHierarchyPath().'/'.$oField->GetCode();
if (is_null($aRow['label']))
{
$sReturn .= $this->StartRow($sFieldId).'<td class="prop_value" colspan="2">'.$aRow['value'];
$sReturn .= $this->StartRow($sFieldId).'<td class="prop_value ibo-field--value" colspan="2">'.$aRow['value'];
}
else
{
$sReturn .= $this->StartRow($sFieldId).'<td class="prop_label">'.$aRow['label'].'</td><td class="prop_value">'.$aRow['value'];
$sReturn .= $this->StartRow($sFieldId).'<td class="prop_label ibo-field--label">'.$aRow['label'].'</td><td class="prop_value ibo-field--value">'.$aRow['value'];
}
if (!($oField instanceof DesignerFormSelectorField) && !($oField instanceof DesignerMultipleSubFormField))
{
@@ -266,6 +262,7 @@ class DesignerForm
$this->AddReadyScript(
<<<EOF
$('#row_$sFieldId').$sWidgetClass({parent_selector: $sNotifyParentSelectorJS, field_id: '$sFieldId', equals: $sHandlerEquals, get_field_value: $sHandlerGetValue, auto_apply: $sAutoApply, value: '', submit_to: '$sActionUrl', submit_parameters: $sJSSubmitParams $sJSExtraParams });
CombodoTooltip.InitTooltipFromMarkup($('#$sFormId [data-tooltip-content]'));
EOF
);
}
@@ -291,7 +288,6 @@ EOF
}
$this->AddReadyScript(
<<<EOF
$('.prop_table').tableHover();
var idx = 0;
$('.prop_table tbody tr').each(function() {
if ((idx % 2) == 0)
@@ -548,7 +544,7 @@ EOF
public function GetValidationArea($sId, $sContent = '')
{
return "<span style=\"display:inline-block;width:20px;\" id=\"v_{$sId}\"><span class=\"ui-icon ui-icon-alert\"></span>$sContent</span>";
return "<span id=\"v_{$sId}\">$sContent</span>";
}
public function GetAsyncActionClass()
{
@@ -716,7 +712,7 @@ class DesignerFormField
$this->bMandatory = false;
$this->bReadOnly = false;
$this->bAutoApply = false;
$this->aCSSClasses = array();
$this->aCSSClasses = array('ibo-input');
$this->bDisplayed = true;
$this->aWidgetExtraParams = array();
}
@@ -1020,10 +1016,10 @@ class DesignerTextField extends DesignerFormField
$sMandatory = $this->bMandatory ? 'true' : 'false';
$oP->add_ready_script(
<<<EOF
$('#$sId').bind('change keyup validate', function() { ValidateWithPattern('$sId', $sMandatory, '$sPattern', $(this).closest('form').attr('id'), $sForbiddenValues); } );
$('#$sId').on('change keyup validate', function() { ValidateWithPattern('$sId', $sMandatory, '$sPattern', $(this).closest('form').attr('id'), $sForbiddenValues); } );
{
var myTimer = null;
$('#$sId').bind('keyup', function() { clearTimeout(myTimer); myTimer = setTimeout(function() { $('#$sId').trigger('change', {} ); }, 100); });
$('#$sId').on('keyup', function() { clearTimeout(myTimer); myTimer = setTimeout(function() { $('#$sId').trigger('change', {} ); }, 100); });
}
EOF
);
@@ -1055,6 +1051,12 @@ EOF
class DesignerLongTextField extends DesignerTextField
{
public function __construct($sCode, $sLabel = '', $defaultValue = '')
{
parent::__construct($sCode, $sLabel, $defaultValue);
$this->aCSSClasses[] = 'ibo-input-text';
}
public function Render(WebPage $oP, $sFormId, $sRenderMode='dialog')
{
$sId = $this->oForm->GetFieldId($this->sCode);
@@ -1078,10 +1080,10 @@ class DesignerLongTextField extends DesignerTextField
{
$oP->add_ready_script(
<<<EOF
$('#$sId').bind('change keyup validate', function() { ValidateWithPattern('$sId', $sMandatory, '$sPattern', $(this).closest('form').attr('id'), $sForbiddenValues); } );
$('#$sId').on('change keyup validate', function() { ValidateWithPattern('$sId', $sMandatory, '$sPattern', $(this).closest('form').attr('id'), $sForbiddenValues); } );
{
var myTimer = null;
$('#$sId').bind('keyup', function() { clearTimeout(myTimer); myTimer = setTimeout(function() { $('#$sId').trigger('change', {} ); }, 100); });
$('#$sId').on('keyup', function() { clearTimeout(myTimer); myTimer = setTimeout(function() { $('#$sId').trigger('change', {} ); }, 100); });
}
EOF
);
@@ -1129,10 +1131,10 @@ class DesignerIntegerField extends DesignerFormField
$sMandatory = $this->bMandatory ? 'true' : 'false';
$oP->add_ready_script(
<<<EOF
$('#$sId').bind('change keyup validate', function() { ValidateInteger('$sId', $sMandatory, $(this).closest('form').attr('id'), $sMin, $sMax); } );
$('#$sId').on('change keyup validate', function() { ValidateInteger('$sId', $sMandatory, $(this).closest('form').attr('id'), $sMin, $sMax); } );
{
var myTimer = null;
$('#$sId').bind('keyup', function() { clearTimeout(myTimer); myTimer = setTimeout(function() { $('#$sId').trigger('change', {} ); }, 100); });
$('#$sId').on('keyup', function() { clearTimeout(myTimer); myTimer = setTimeout(function() { $('#$sId').trigger('change', {} ); }, 100); });
}
EOF
);
@@ -1178,6 +1180,7 @@ class DesignerComboField extends DesignerFormField
$this->bMultipleSelection = false;
$this->bOtherChoices = false;
$this->sNullLabel = Dict::S('UI:SelectOne');
$this->aCSSClasses[] = 'ibo-input-select';
$this->bAutoApply = true;
$this->bSorted = true; // Sorted by default
@@ -1292,11 +1295,12 @@ class DesignerComboField extends DesignerFormField
}
$oP->add_ready_script(
<<<EOF
$('#$sId').bind('change validate', function() { ValidateWithPattern('$sId', $sMandatory, '', $(this).closest('form').attr('id'), null, null); } );
$('#$sId').on('change validate', function() { ValidateWithPattern('$sId', $sMandatory, '', $(this).closest('form').attr('id'), null, null); } );
EOF
);
}
return array('label' => $this->sLabel, 'value' => $sHtml);
}
public function ReadParam(&$aValues)
@@ -1315,6 +1319,7 @@ class DesignerBooleanField extends DesignerFormField
{
parent::__construct($sCode, $sLabel, $defaultValue);
$this->bAutoApply = true;
$this->aCSSClasses[] = 'ibo-input-checkbox';
}
public function Render(WebPage $oP, $sFormId, $sRenderMode='dialog')
@@ -1597,6 +1602,7 @@ class DesignerFormSelectorField extends DesignerFormField
$this->defaultRealValue = $defaultValue;
$this->aSubForms = array();
$this->bSorted = true;
$this->aCSSClasses[] = 'ibo-input-select';
}
public function IsSorted()
@@ -1730,7 +1736,7 @@ class DesignerFormSelectorField extends DesignerFormField
{
$oP->add_ready_script(
<<<EOF
$('#$sId').bind('change reverted', function() { $('.subform_{$sId}').hide(); $('.{$sId}_'+this.value).show(); } );
$('#$sId').on('change reverted', function() { $('.subform_{$sId}').hide(); $('.{$sId}_'+this.value).show(); } );
EOF
);
}

View File

@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2010-2012 Combodo SARL
// Copyright (C) 2010-2021 Combodo SARL
//
// This file is part of iTop.
//
@@ -20,7 +20,7 @@
/**
* Persistent class InputOutputTask
*
* @copyright Copyright (C) 2010-2012 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
@@ -44,7 +44,6 @@ class InputOutputTask extends cmdbAbstractObject
"db_table" => "priv_iotask",
"db_key_field" => "id",
"db_finalclass_field" => "",
"display_template" => "",
);
MetaModel::Init_Params($aParams);
MetaModel::Init_AddAttribute(new AttributeString("name", array("allowed_values"=>null, "sql"=>"name", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));

File diff suppressed because it is too large Load Diff

View File

@@ -1,57 +1,8 @@
<?php
// Copyright (C) 2010-2012 Combodo SARL
//
// This file is part of iTop.
//
// iTop is free software; you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// iTop is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with iTop. If not, see <http://www.gnu.org/licenses/>
/**
* Class iTopWizardWebPage
*
* @copyright Copyright (C) 2010-2012 Combodo SARL
* @deprecated will be removed in 3.1.0 - moved to sources/application/WebPage/iTopWizardWebPage.php, now loadable using autoloader
* @license http://opensource.org/licenses/AGPL-3.0
* @copyright Copyright (C) 2010-2021 Combodo SARL
*/
require_once('itopwebpage.class.inc.php');
/**
* Web page to display a wizard in the iTop framework
*/
class iTopWizardWebPage extends iTopWebPage
{
var $m_iCurrentStep;
var $m_aSteps;
public function __construct($sTitle, $currentOrganization, $iCurrentStep, $aSteps)
{
parent::__construct($sTitle." - step $iCurrentStep of ".count($aSteps)." - ".$aSteps[$iCurrentStep - 1], $currentOrganization);
$this->m_iCurrentStep = $iCurrentStep;
$this->m_aSteps = $aSteps;
}
public function output()
{
$aSteps = array();
$iIndex = 0;
foreach($this->m_aSteps as $sStepTitle)
{
$iIndex++;
$sStyle = ($iIndex == $this->m_iCurrentStep) ? 'wizActiveStep' : 'wizStep';
$aSteps[] = "<div class=\"$sStyle\"><span>$sStepTitle</span></div>";
}
$sWizardHeader = "<div class=\"wizHeader\"><h1>".htmlentities($this->s_title, ENT_QUOTES, 'UTF-8')."</h1>\n".implode("<div class=\"wizSeparator\"><img align=\"bottom\" src=\"../images/wizArrow.gif\"></div>", $aSteps)."<br style=\"clear:both;\"/></div>\n";
$this->s_content = "$sWizardHeader<div class=\"wizContainer\">".$this->s_content."</div>";
parent::output();
}
}
?>
DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/application/WebPage/iTopWizardWebPage.php, now loadable using autoloader');

View File

@@ -2,7 +2,7 @@
/**
* Class LoginBasic
*
* @copyright Copyright (C) 2010-2019 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/

View File

@@ -1,6 +1,6 @@
<?php
/**
* @copyright Copyright (C) 2010-2019 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/

View File

@@ -3,7 +3,7 @@
/**
* Class LoginExternal
*
* @copyright Copyright (C) 2010-2019 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/

View File

@@ -1,7 +1,7 @@
<?php
/**
* @copyright Copyright (C) 2010-2019 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/

View File

@@ -2,7 +2,7 @@
/**
*
* @copyright Copyright (C) 2010-2019 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
@@ -224,7 +224,7 @@ class LoginTwigRenderer
}
$oCoreLoader = new Twig_Loader_Filesystem(array(), APPROOT.'templates');
$aCoreTemplatesPaths = array('login', 'login/password');
$aCoreTemplatesPaths = array('pages/login', 'pages/login/password');
// Having this path declared after the plugins let the plugins replace the core templates
$oCoreLoader->setPaths($aCoreTemplatesPaths);
// Having the core templates accessible within a different namespace offer the possibility to extend them while replacing them

View File

@@ -3,7 +3,7 @@
/**
* Class LoginURL
*
* @copyright Copyright (C) 2010-2019 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/

View File

@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2010-2017 Combodo SARL
// Copyright (C) 2010-2021 Combodo SARL
//
// This file is part of iTop.
//
@@ -20,7 +20,7 @@
/**
* Class LoginWebPage
*
* @copyright Copyright (C) 2010-2017 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
@@ -92,7 +92,6 @@ class LoginWebPage extends NiceWebPage
{
$this->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'css/login.css');
$this->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'css/font-awesome/css/all.min.css');
$this->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'css/font-awesome/css/v4-shims.min.css');
}
public static function SetLoginFailedMessage($sMessage)
@@ -100,6 +99,44 @@ class LoginWebPage extends NiceWebPage
self::$m_sLoginFailedMessage = $sMessage;
}
/**
* @param $oUser
* @param array $aProfiles
*
* @return array
* @throws \CoreException
* @throws \CoreUnexpectedValue
*/
public static function SynchronizeProfiles(&$oUser, array $aProfiles, $sOrigin)
{
$oProfilesSet = $oUser->Get(profile_list);
//delete old profiles
$aExistingProfiles = [];
while ($oProfile = $oProfilesSet->Fetch())
{
array_push($aExistingProfiles, $oProfile->Get('profileid'));
$iArrayKey = array_search($oProfile->Get('profileid'), $aProfiles);
if (!$iArrayKey)
{
$oProfilesSet->RemoveItem($oProfile->Get('profileid'));
}
else
{
unset($aProfiles[$iArrayKey]);
}
}
//add profiles not already linked with user
foreach ($aProfiles as $iProfileId)
{
$oLink = new URP_UserProfile();
$oLink->Set('profileid', $iProfileId);
$oLink->Set('reason', $sOrigin);
$oProfilesSet->AddItem(MetaModel::NewObject('URP_UserProfile', array('profileid' => $iProfileId, 'reason' => $sOrigin)));
}
$oUser->Set('profile_list', $oProfilesSet);
}
public function DisplayLoginHeader($bMainAppLogo = false)
{
$sLogo = 'itop-logo-external.png';
@@ -886,20 +923,12 @@ class LoginWebPage extends NiceWebPage
}
// Now synchronize the profiles
$oProfilesSet = DBObjectSet::FromScratch('URP_UserProfile');
$sOrigin = 'External User provisioning';
if (isset($_SESSION['login_mode']))
{
$sOrigin .= " ({$_SESSION['login_mode']})";
}
foreach ($aProfiles as $iProfileId)
{
$oLink = new URP_UserProfile();
$oLink->Set('profileid', $iProfileId);
$oLink->Set('reason', $sOrigin);
$oProfilesSet->AddObject($oLink);
}
$oUser->Set('profile_list', $oProfilesSet);
$aExistingProfiles = self::SynchronizeProfiles($oUser, $aProfiles, $sOrigin);
if ($oUser->IsModified())
{
$oUser->DBWrite();

View File

@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2013-2019 Combodo SARL
* Copyright (C) 2013-2021 Combodo SARL
*
* This file is part of iTop.
*

View File

@@ -1,22 +1,11 @@
<?php
/**
* Copyright (C) 2013-2019 Combodo SARL
*
* This file is part of iTop.
*
* iTop is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* iTop is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
use Combodo\iTop\Application\UI\Base\Component\Title\TitleUIBlockFactory;
require_once(APPROOT.'/application/utils.inc.php');
require_once(APPROOT.'/application/template.class.inc.php');
require_once(APPROOT."/application/user.dashboard.class.inc.php");
@@ -51,7 +40,10 @@ require_once(APPROOT."/application/user.dashboard.class.inc.php");
* new OQLMenuNode('PersonsMenu', 'SELECT bizPerson', $oContactsMenu->GetIndex(), 0);
*
*/
/**
* Class ApplicationMenu
*/
class ApplicationMenu
{
/**
@@ -71,7 +63,10 @@ class ApplicationMenu
*/
static $sFavoriteSiloQuery = 'SELECT Organization';
static public function LoadAdditionalMenus()
/**
* @return void
*/
public static function LoadAdditionalMenus()
{
if (!self::$bAdditionalMenusLoaded)
{
@@ -97,10 +92,10 @@ class ApplicationMenu
/**
* Set the query used to limit the list of displayed organizations in the drop-down menu
* @param $sOQL string The OQL query returning a list of Organization objects
* @param string $sOQL The OQL query returning a list of Organization objects
* @return void
*/
static public function SetFavoriteSiloQuery($sOQL)
public static function SetFavoriteSiloQuery($sOQL)
{
self::$sFavoriteSiloQuery = $sOQL;
}
@@ -109,7 +104,7 @@ class ApplicationMenu
* Get the query used to limit the list of displayed organizations in the drop-down menu
* @return string The OQL query returning a list of Organization objects
*/
static public function GetFavoriteSiloQuery()
public static function GetFavoriteSiloQuery()
{
return self::$sFavoriteSiloQuery;
}
@@ -117,11 +112,11 @@ class ApplicationMenu
/**
* Check whether a menu Id is enabled or not
*
* @param $sMenuId
* @param string $sMenuId
*
* @throws \Exception
*/
static public function CheckMenuIdEnabled($sMenuId)
public static function CheckMenuIdEnabled($sMenuId)
{
self::LoadAdditionalMenus();
$oMenuNode = self::GetMenuNode(self::GetMenuIndexById($sMenuId));
@@ -140,11 +135,11 @@ class ApplicationMenu
* Main function to add a menu entry into the application, can be called during the definition
* of the data model objects
* @param MenuNode $oMenuNode
* @param $iParentIndex
* @param $fRank
* @param int $iParentIndex
* @param float $fRank
* @return int
*/
static public function InsertMenu(MenuNode $oMenuNode, $iParentIndex, $fRank)
public static function InsertMenu(MenuNode $oMenuNode, $iParentIndex, $fRank)
{
$index = self::GetMenuIndexById($oMenuNode->GetMenuId());
if ($index == -1)
@@ -185,30 +180,166 @@ class ApplicationMenu
/**
* Reflection API - Get menu entries
*
* @return array
*/
static public function ReflectionMenuNodes()
public static function ReflectionMenuNodes()
{
self::LoadAdditionalMenus();
return self::$aMenusIndex;
}
/**
* Get entries count for all the menus
*
* @param array $aExtraParams
*
* @return array
* @throws \DictExceptionMissingString
* @since 3.0.0
*/
public static function GetMenusCount($aExtraParams = array())
{
$aMenuGroups = static::GetMenuGroups($aExtraParams);
$aMenusCount = [];
foreach ($aMenuGroups as $aMenuGroup) {
$aSubMenuNodes = $aMenuGroup['aSubMenuNodes'];
$aMenusCount = array_merge($aMenusCount, static::GetSubMenusCount($aSubMenuNodes));
}
return $aMenusCount;
}
/**
* Recurse sub menus for counts
*
* @param array $aSubMenuNodes
*
* @return array
* @since 3.0.0
*/
private static function GetSubMenusCount(array $aSubMenuNodes)
{
$aSubMenusCount = [];
foreach ($aSubMenuNodes as $aSubMenuNode) {
if ($aSubMenuNode['bHasCount']) {
$oMenuNode = static::GetMenuNode(static::GetMenuIndexById($aSubMenuNode['sId']));
$aSubMenusCount[$aSubMenuNode['sId']] = $oMenuNode->GetEntriesCount();
}
$aSubMenusCount = array_merge($aSubMenusCount, static::GetSubMenusCount($aSubMenuNode['aSubMenuNodes']));
}
return $aSubMenusCount;
}
/**
* Return an array of menu groups
*
* @param array $aExtraParams
*
* @return array
* @throws \DictExceptionMissingString
* @since 3.0.0
*/
public static function GetMenuGroups($aExtraParams = array())
{
self::LoadAdditionalMenus();
// Sort the root menu based on the rank
usort(self::$aRootMenus, array('ApplicationMenu', 'CompareOnRank'));
$aMenuGroups = [];
foreach(static::$aRootMenus as $aMenuGroup)
{
if(!static::CanDisplayMenu($aMenuGroup))
{
continue;
}
$sMenuGroupIdx = $aMenuGroup['index'];
/** @var \MenuGroup $oMenuNode */
$oMenuNode = static::GetMenuNode($sMenuGroupIdx);
$aMenuGroups[] = [
'sId' => $oMenuNode->GetMenuID(),
'sIconCssClasses' => $oMenuNode->GetDecorationClasses(),
'sInitials' => $oMenuNode->GetInitials(),
'sTitle' => $oMenuNode->GetTitle(),
'aSubMenuNodes' => static::GetSubMenuNodes($sMenuGroupIdx, $aExtraParams),
];
}
return $aMenuGroups;
}
/**
* Return an array of sub-menu nodes for $sMenuGroupIdx
*
* @param string $sMenuGroupIdx
* @param array $aExtraParams
*
* @return array
* @throws \DictExceptionMissingString
* @throws \Exception
* @since 3.0.0
*/
public static function GetSubMenuNodes($sMenuGroupIdx, $aExtraParams = array())
{
$aSubMenuItems = self::GetChildren($sMenuGroupIdx);
// Sort the children based on the rank
usort($aSubMenuItems, array('ApplicationMenu', 'CompareOnRank'));
$aSubMenuNodes = [];
foreach($aSubMenuItems as $aSubMenuItem)
{
if(!static::CanDisplayMenu($aSubMenuItem))
{
continue;
}
$sSubMenuItemIdx = $aSubMenuItem['index'];
$oSubMenuNode = static::GetMenuNode($sSubMenuItemIdx);
if(!$oSubMenuNode->IsEnabled())
{
continue;
}
$aSubMenuNodes[] = [
'sId' => $oSubMenuNode->GetMenuId(),
'sTitle' => $oSubMenuNode->GetTitle(),
'bHasCount' => $oSubMenuNode->HasCount(),
'sUrl' => $oSubMenuNode->GetHyperlink($aExtraParams),
'bOpenInNewWindow' => $oSubMenuNode->IsHyperLinkInNewWindow(),
'aSubMenuNodes' => static::GetSubMenuNodes($sSubMenuItemIdx, $aExtraParams),
];
}
return $aSubMenuNodes;
}
/**
* Entry point to display the whole menu into the web page, used by iTopWebPage
* @param \WebPage $oPage
* @param $aExtraParams
* @param array $aExtraParams
* @throws DictExceptionMissingString
*
* @deprecated Will be removed in 3.0.0, use static::GetMenuGroups() instead
*/
static public function DisplayMenu($oPage, $aExtraParams)
public static function DisplayMenu($oPage, $aExtraParams)
{
DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use static::GetMenuGroups() instead');
self::LoadAdditionalMenus();
// Sort the root menu based on the rank
usort(self::$aRootMenus, array('ApplicationMenu', 'CompareOnRank'));
$iAccordion = 0;
$iActiveAccordion = $iAccordion;
$iActiveMenu = self::GetMenuIndexById(self::GetActiveNodeId());
foreach(self::$aRootMenus as $aMenu)
{
if (!self::CanDisplayMenu($aMenu)) { continue; }
foreach (self::$aRootMenus as $aMenu) {
if (!self::CanDisplayMenu($aMenu)) {
continue;
}
$oMenuNode = self::GetMenuNode($aMenu['index']);
$oPage->AddToMenu('<h3 id="'.utils::GetSafeId('AccordionMenu_'.$oMenuNode->GetMenuID()).'" class="navigation-menu-group" data-menu-id="'.$oMenuNode->GetMenuId().'">'.$oMenuNode->GetTitle().'</h3>');
$oPage->AddToMenu('<div>');
@@ -237,7 +368,7 @@ EOF
* @param array $aMenu menu entry
* @return bool true if at least one menu is enabled
*/
static private function CanDisplayMenu($aMenu)
private static function CanDisplayMenu($aMenu)
{
$oMenuNode = self::GetMenuNode($aMenu['index']);
if ($oMenuNode->IsEnabled())
@@ -269,19 +400,19 @@ EOF
* @param array $aExtraParams
* @param int $iActiveMenu
*
* @return true if the currently selected menu is one of the submenus
* @return bool True if the currently selected menu is one of the submenus
* @throws DictExceptionMissingString
* @throws \Exception
* @deprecated Will be removed in 3.0.0, use static::GetSubMenuNodes() instead
*/
static protected function DisplaySubMenu($oPage, $aMenus, $aExtraParams, $iActiveMenu = -1)
protected static function DisplaySubMenu($oPage, $aMenus, $aExtraParams, $iActiveMenu = -1)
{
DeprecatedCallsLog::NotifyDeprecatedPhpMethod('use static::GetSubMenuNodes() instead');
// Sort the menu based on the rank
$bActive = false;
usort($aMenus, array('ApplicationMenu', 'CompareOnRank'));
foreach($aMenus as $aMenu)
{
if (!self::CanDisplayMenu($aMenu))
{
foreach ($aMenus as $aMenu) {
if (!self::CanDisplayMenu($aMenu)) {
continue;
}
$index = $aMenu['index'];
@@ -330,11 +461,11 @@ EOF
/**
* Helper function to sort the menus based on their rank
* @param $a
* @param $b
* @param array $a
* @param array $b
* @return int
*/
static public function CompareOnRank($a, $b)
public static function CompareOnRank($a, $b)
{
$result = 1;
if ($a['rank'] == $b['rank'])
@@ -353,7 +484,7 @@ EOF
* @param int $index
* @return MenuNode|null
*/
static public function GetMenuNode($index)
public static function GetMenuNode($index)
{
return isset(self::$aMenusIndex[$index]) ? self::$aMenusIndex[$index]['node'] : null;
}
@@ -363,7 +494,7 @@ EOF
* @param int $index
* @return array
*/
static public function GetChildren($index)
public static function GetChildren($index)
{
return self::$aMenusIndex[$index]['children'];
}
@@ -373,7 +504,7 @@ EOF
* @param string $sTitle Title of the menu (as passed when creating the menu)
* @return integer ID of the menu, or -1 if not found
*/
static public function GetMenuIndexById($sTitle)
public static function GetMenuIndexById($sTitle)
{
$index = -1;
/** @var MenuNode[] $aMenu */
@@ -392,7 +523,7 @@ EOF
* Retrieves the currently active menu (if any, otherwise the first menu is the default)
* @return string The Id of the currently active menu
*/
static public function GetActiveNodeId()
public static function GetActiveNodeId()
{
$oAppContext = new ApplicationContext();
$sMenuId = $oAppContext->GetCurrentValue('menu', null);
@@ -406,7 +537,7 @@ EOF
/**
* @return null|string
*/
static public function GetDefaultMenuId()
public static function GetDefaultMenuId()
{
static $sDefaultMenuId = null;
if (is_null($sDefaultMenuId))
@@ -426,7 +557,7 @@ EOF
* @param $sMenuId
* @return string
*/
static public function GetRootMenuId($sMenuId)
public static function GetRootMenuId($sMenuId)
{
$iMenuIndex = self::GetMenuIndexById($sMenuId);
if ($iMenuIndex == -1)
@@ -563,29 +694,61 @@ abstract class MenuNode
/**
* @return string
* @throws DictExceptionMissingString
*/
public function GetTitle()
{
return Dict::S("Menu:$this->sMenuId", str_replace('_', ' ', $this->sMenuId));
}
/**
* Indicates if the page corresponding to this menu node is countable
*
* @return bool true if corresponding page is countable
* @since 3.0.0
*/
public function HasCount()
{
return false;
}
protected function GetEntriesCountFromOQL(string $sOQL)
{
// Count the entries up to 99
$oSearch = DBSearch::FromOQL($sOQL);
DBSearchHelper::AddContextFilter($oSearch);
$oSet = new DBObjectSet($oSearch);
$iCount = $oSet->CountWithLimit(99);
if ($iCount > 99) {
$iCount = "99+";
}
return $iCount;
}
/**
* Get the number of entries of the page corresponding to this menu item.
*
* @return int the number of entries
* @since 3.0.0
*/
public function GetEntriesCount()
{
return 0;
}
/**
* @return string
* @throws DictExceptionMissingString
*/
public function GetLabel()
{
$sRet = Dict::S("Menu:$this->sMenuId+", "");
if ($sRet === '')
{
if ($this->iParentIndex != -1)
{
if ($sRet === '') {
if ($this->iParentIndex != -1) {
$oParentMenu = ApplicationMenu::GetMenuNode($this->iParentIndex);
$sRet = $oParentMenu->GetTitle().' / '.$this->GetTitle();
}
else
{
} else {
$sRet = $this->GetTitle();
}
//$sRet = $this->GetTitle();
@@ -600,7 +763,10 @@ abstract class MenuNode
{
return $this->index;
}
/**
* @return void
*/
public function PopulateChildMenus()
{
foreach (ApplicationMenu::GetChildren($this->GetIndex()) as $aMenu)
@@ -725,18 +891,64 @@ abstract class MenuNode
*/
class MenuGroup extends MenuNode
{
/** @var string DEFAULT_DECORATION_CLASSES Set to null by default so it is replaced by initials when none is specified */
const DEFAULT_DECORATION_CLASSES = null;
/** @var string The CSS classes used to display the menu group's icon */
protected $sDecorationClasses = self::DEFAULT_DECORATION_CLASSES;
/**
* Create a top-level menu group and inserts it into the application's main menu
*
* @param string $sMenuId Unique identifier of the menu (used to identify the menu for bookmarking, and for getting the labels from the dictionary)
* @param float $fRank Number used to order the list, the groups are sorted based on this value
* @param string|null $sDecorationClasses CSS classes used to display the menu group's icon
* @param string $sEnableClass Name of class of object
* @param integer $iActionCode Either UR_ACTION_READ, UR_ACTION_MODIFY, UR_ACTION_DELETE, UR_ACTION_BULKREAD, UR_ACTION_BULKMODIFY or UR_ACTION_BULKDELETE
* @param integer $iAllowedResults Expected "rights" for the action: either UR_ALLOWED_YES, UR_ALLOWED_NO, UR_ALLOWED_DEPENDS or a mix of them...
* @param string $sEnableStimulus
*/
public function __construct($sMenuId, $fRank, $sEnableClass = null, $iActionCode = null, $iAllowedResults = UR_ALLOWED_YES, $sEnableStimulus = null)
public function __construct($sMenuId, $fRank, $sDecorationClasses = null, $sEnableClass = null, $iActionCode = null, $iAllowedResults = UR_ALLOWED_YES, $sEnableStimulus = null)
{
parent::__construct($sMenuId, -1 /* no parent, groups are at root level */, $fRank, $sEnableClass, $iActionCode, $iAllowedResults, $sEnableStimulus);
if(!empty($sDecorationClasses))
{
$this->sDecorationClasses = $sDecorationClasses;
}
}
/**
* Return true if the menu group has some decoration classes
*
* @return bool
* @since 3.0.0
*/
public function HasDecorationClasses()
{
return (empty($this->GetDecorationClasses()) === false);
}
/**
* Return the CSS classes used for decorating the menu group (typically the icon in the navigation menu)
*
* @return string
* @since 3.0.0
*/
public function GetDecorationClasses()
{
return $this->sDecorationClasses;
}
/**
* Returns the initials of the menu group, used by the rendering in case there is no decoration classes
*
* @return string
* @since 3.0.0
*/
public function GetInitials()
{
return mb_substr($this->GetTitle(), 0, 1);
}
/**
@@ -913,30 +1125,43 @@ class OQLMenuNode extends MenuNode
{
$sUsageId = utils::GetSafeId($sUsageId);
$oSearch = DBObjectSearch::FromOQL($sOql);
$sIcon = MetaModel::GetClassIcon($oSearch->GetClass());
//$sIcon = MetaModel::GetClassIcon($oSearch->GetClass(), false);
if ($bSearchPane)
{
if ($bSearchPane) {
$aParams = array_merge(array('open' => $bSearchOpen, 'table_id' => $sUsageId), $aExtraParams);
$oBlock = new DisplayBlock($oSearch, 'search', false /* Asynchronous */, $aParams);
$oBlock->Display($oPage, 0);
}
$oPage->add("<p class=\"page-header\">$sIcon ".utils::HtmlEntities(Dict::S($sTitle))."</p>");
//$oPage->add("<p class=\"page-header\">$sIcon ".utils::HtmlEntities(Dict::S($sTitle))."</p>");
$oPage->add("<div class='sf_results_area' data-target='search_results'>");
$oTitle = TitleUIBlockFactory::MakeForPage($sTitle);
$oPage->AddUiBlock($oTitle);
$aParams = array_merge(array('table_id' => $sUsageId), $aExtraParams);
$oBlock = new DisplayBlock($oSearch, 'list', false /* Asynchronous */, $aParams);
$oBlock->Display($oPage, $sUsageId);
if ($bEnableBreadcrumb && ($oPage instanceof iTopWebPage))
{
$oPage->add("</div>");
if ($bEnableBreadcrumb && ($oPage instanceof iTopWebPage)) {
// Breadcrumb
//$iCount = $oBlock->GetDisplayedCount();
$sPageId = "ui-search-".$oSearch->GetClass();
$sLabel = MetaModel::GetName($oSearch->GetClass());
$oPage->SetBreadCrumbEntry($sPageId, $sLabel, $sTitle, '', '../images/breadcrumb-search.png');
$oPage->SetBreadCrumbEntry($sPageId, $sLabel, $sTitle, '', 'fas fa-list', iTopWebPage::ENUM_BREADCRUMB_ENTRY_ICON_TYPE_CSS_CLASSES);
}
}
public function HasCount()
{
return true;
}
public function GetEntriesCount()
{
return $this->GetEntriesCountFromOQL($this->sOQL);
}
}
/**
@@ -981,7 +1206,7 @@ class SearchMenuNode extends MenuNode
public function RenderContent(WebPage $oPage, $aExtraParams = array())
{
ApplicationMenu::CheckMenuIdEnabled($this->GetMenuId());
$oPage->SetBreadCrumbEntry("menu-".$this->sMenuId, $this->GetTitle(), '', '', utils::GetAbsoluteUrlAppRoot().'images/breadcrumb-search.png');
$oPage->SetBreadCrumbEntry("menu-".$this->sMenuId, $this->GetTitle(), '', '', 'fas fa-search', iTopWebPage::ENUM_BREADCRUMB_ENTRY_ICON_TYPE_CSS_CLASSES);
$oSearch = new DBObjectSearch($this->sClass);
$aParams = array_merge(array('table_id' => 'Menu_'.utils::GetSafeId($this->GetMenuId())), $aExtraParams);
@@ -1191,40 +1416,32 @@ class DashboardMenuNode extends MenuNode
if ($oDashboard != null)
{
$sDivId = utils::Sanitize($this->sMenuId, '', 'element_identifier');
$oPage->add('<div class="dashboard_contents" id="'.$sDivId.'">');
$oPage->add('<div id="'.$sDivId.'" class="ibo-dashboard" data-role="ibo-dashboard">');
$aExtraParams['dashboard_div_id'] = $sDivId;
$aExtraParams['from_dashboard_page'] = true;
$oDashboard->SetReloadURL($this->GetHyperlink($aExtraParams));
$oDashboard->Render($oPage, false, $aExtraParams);
$oPage->add('</div>');
$bEdit = utils::ReadParam('edit', false);
if ($bEdit)
{
if ($bEdit) {
$sId = addslashes($this->sMenuId);
$oPage->add_ready_script("EditDashboard('$sId');");
}
else
{
} else {
$oParentMenu = ApplicationMenu::GetMenuNode($this->iParentIndex);
$sParentTitle = $oParentMenu->GetTitle();
$sThisTitle = $this->GetTitle();
if ($sParentTitle != $sThisTitle)
{
if ($sParentTitle != $sThisTitle) {
$sDescription = $sParentTitle.' / '.$sThisTitle;
}
else
{
} else {
$sDescription = $sThisTitle;
}
if ($this->sMenuId == ApplicationMenu::GetDefaultMenuId())
{
$sIcon = '../images/breadcrumb_home.png';
if ($this->sMenuId == ApplicationMenu::GetDefaultMenuId()) {
$sIcon = 'fas fa-home';
} else {
$sIcon = 'fas fa-chart-pie';
}
else
{
$sIcon = '../images/breadcrumb-dashboard.png';
}
$oPage->SetBreadCrumbEntry("ui-dashboard-".$this->sMenuId, $this->GetTitle(), $sDescription, '', $sIcon);
$oPage->SetBreadCrumbEntry("ui-dashboard-".$this->sMenuId, $this->GetTitle(), $sDescription, '', $sIcon, iTopWebPage::ENUM_BREADCRUMB_ENTRY_ICON_TYPE_CSS_CLASSES);
}
}
else
@@ -1393,5 +1610,23 @@ class ShortcutMenuNode extends MenuNode
{
return $this->oShortcut->Get('name');
}
/**
* Indicates if the page corresponding to this menu node is countable
*
* @return bool true if corresponding page is countable
* @since 3.0.0
*/
public function HasCount()
{
return true;
}
public function GetEntriesCount()
{
return $this->GetEntriesCountFromOQL($this->oShortcut->Get('oql'));
}
}

View File

@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2010-2015 Combodo SARL
// Copyright (C) 2010-2021 Combodo SARL
//
// This file is part of iTop.
//

View File

@@ -1,262 +1,8 @@
<?php
/**
* Copyright (C) 2013-2020 Combodo SARL
*
* This file is part of iTop.
*
* iTop is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* iTop is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* @deprecated will be removed in 3.1.0 - moved to sources/application/WebPage/NiceWebPage.php, now loadable using autoloader
* @license http://opensource.org/licenses/AGPL-3.0
* @copyright Copyright (C) 2010-2021 Combodo SARL
*/
require_once(APPROOT."/application/webpage.class.inc.php");
/**
* Web page with some associated CSS and scripts (jquery) for a fancier display
*/
class NiceWebPage extends WebPage
{
var $m_aReadyScripts;
var $m_sRootUrl;
public function __construct($s_title, $bPrintable = false)
{
parent::__construct($s_title, $bPrintable);
$this->m_aReadyScripts = array();
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.min.js');
if(utils::IsDevelopmentEnvironment()) // Needed since many other plugins still rely on oldies like $.browser
{
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery-migrate.dev.js');
}
else
{
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery-migrate.prod.min.js');
}
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery-ui-1.11.4.custom.min.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/utils.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/hovertip.js');
// table sorting
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.tablesorter.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.tablesorter.pager.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.tablehover.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/table-selectable-lines.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/field_sorter.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/datatable.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.positionBy.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.popupmenu.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/searchformforeignkeys.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/latinise/latinise.min.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_handler.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_handler_history.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_criteria.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_criteria_raw.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_criteria_string.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_criteria_external_field.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_criteria_numeric.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_criteria_enum.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_criteria_tag_set.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_criteria_external_key.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_criteria_hierarchical_key.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_criteria_date_abstract.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_criteria_date.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_criteria_date_time.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/clipboard.min.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/clipboardwidget.js');
$this->add_dict_entries('UI:Combo');
$this->add_ready_script(
<<< EOF
//add new widget called TruncatedList to properly display truncated lists when they are sorted
$.tablesorter.addWidget({
// give the widget a id
id: "truncatedList",
// format is called when the on init and when a sorting has finished
format: function(table)
{
// Check if there is a "truncated" line
this.truncatedList = false;
if ($("tr td.truncated",table).length > 0)
{
this.truncatedList = true;
}
if (this.truncatedList)
{
$("tr td",table).removeClass('truncated');
$("tr:last td",table).addClass('truncated');
}
}
});
$.tablesorter.addWidget({
// give the widget a id
id: "myZebra",
// format is called when the on init and when a sorting has finished
format: function(table)
{
// Replace the 'red even' lines by 'red_even' since most browser do not support 2 classes selector in CSS, etc..
$("tbody tr:even",table).addClass('even');
$("tbody tr.red:even",table).removeClass('red').removeClass('even').addClass('red_even');
$("tbody tr.orange:even",table).removeClass('orange').removeClass('even').addClass('orange_even');
$("tbody tr.green:even",table).removeClass('green').removeClass('even').addClass('green_even');
// In case we sort again the table, we need to remove the added 'even' classes on odd rows
$("tbody tr:odd",table).removeClass('even');
$("tbody tr.red_even:odd",table).removeClass('even').removeClass('red_even').addClass('red');
$("tbody tr.orange_even:odd",table).removeClass('even').removeClass('orange_even').addClass('orange');
$("tbody tr.green_even:odd",table).removeClass('even').removeClass('green_even').addClass('green');
}
});
$("table.listResults").tableHover(); // hover tables
EOF
);
$this->LoadTheme();
$this->m_sRootUrl = $this->GetAbsoluteUrlAppRoot();
$sAbsURLAppRoot = addslashes($this->m_sRootUrl);
$sAbsURLModulesRoot = addslashes($this->GetAbsoluteUrlModulesRoot());
$sEnvironment = addslashes(utils::GetCurrentEnvironment());
$sAppContext = addslashes($this->GetApplicationContext());
$this->add_script(
<<<EOF
function GetAbsoluteUrlAppRoot()
{
return '$sAbsURLAppRoot';
}
function GetAbsoluteUrlModulesRoot()
{
return '$sAbsURLModulesRoot';
}
function GetAbsoluteUrlModulePage(sModule, sPage, aArguments)
{
// aArguments is optional, it default to an empty hash
aArguments = typeof aArguments !== 'undefined' ? aArguments : {};
var sUrl = '$sAbsURLAppRoot'+'pages/exec.php?exec_module='+sModule+'&exec_page='+sPage+'&exec_env='+'$sEnvironment';
for (var sArgName in aArguments)
{
if (aArguments.hasOwnProperty(sArgName))
{
sUrl = sUrl + '&'+sArgName+'='+aArguments[sArgname];
}
}
return sUrl;
}
function AddAppContext(sURL)
{
var sContext = '$sAppContext';
if (sContext.length > 0)
{
if (sURL.indexOf('?') == -1)
{
return sURL+'?'+sContext;
}
return sURL+'&'+sContext;
}
return sURL;
}
EOF
);
}
public function SetRootUrl($sRootUrl)
{
$this->m_sRootUrl = $sRootUrl;
}
public function small_p($sText)
{
$this->add("<p style=\"font-size:smaller\">$sText</p>\n");
}
public function GetAbsoluteUrlAppRoot()
{
return utils::GetAbsoluteUrlAppRoot();
}
public function GetAbsoluteUrlModulesRoot()
{
return utils::GetAbsoluteUrlModulesRoot();
}
function GetApplicationContext()
{
$oAppContext = new ApplicationContext();
return $oAppContext->GetForLink();
}
// By Rom, used by CSVImport and Advanced search
public function MakeClassesSelect($sName, $sDefaultValue, $iWidthPx, $iActionCode = null)
{
// $aTopLevelClasses = array('bizService', 'bizContact', 'logInfra', 'bizDocument');
// These are classes wich root class is cmdbAbstractObject !
$this->add("<select id=\"select_$sName\" name=\"$sName\">");
$aValidClasses = array();
foreach(MetaModel::GetClasses('bizmodel') as $sClassName)
{
if (is_null($iActionCode) || UserRights::IsActionAllowed($sClassName, $iActionCode))
{
$sSelected = ($sClassName == $sDefaultValue) ? " SELECTED" : "";
$sDescription = MetaModel::GetClassDescription($sClassName);
$sDisplayName = MetaModel::GetName($sClassName);
$aValidClasses[$sDisplayName] = "<option style=\"width: ".$iWidthPx." px;\" title=\"$sDescription\" value=\"$sClassName\"$sSelected>$sDisplayName</option>";
}
}
ksort($aValidClasses);
$this->add(implode("\n", $aValidClasses));
$this->add("</select>");
}
// By Rom, used by Advanced search
public function add_select($aChoices, $sName, $sDefaultValue, $iWidthPx)
{
$this->add("<select id=\"select_$sName\" name=\"$sName\">");
foreach($aChoices as $sKey => $sValue)
{
$sSelected = ($sKey == $sDefaultValue) ? " SELECTED" : "";
$this->add("<option style=\"width: ".$iWidthPx." px;\" value=\"".htmlspecialchars($sKey)."\"$sSelected>".htmlentities($sValue,
ENT_QUOTES, self::PAGES_CHARSET)."</option>");
}
$this->add("</select>");
}
public function add_ready_script($sScript)
{
$this->m_aReadyScripts[] = $sScript;
}
/**
* Outputs (via some echo) the complete HTML page by assembling all its elements
*/
public function output()
{
//$this->set_base($this->m_sRootUrl.'pages/');
if (count($this->m_aReadyScripts)>0)
{
$this->add_script("\$(document).ready(function() {\n".implode("\n", $this->m_aReadyScripts)."\n});");
}
parent::output();
}
/**
* @throws \Exception
* @since 2.7.0
*/
protected function LoadTheme()
{
$sCssThemeUrl = ThemeHandler::GetCurrentThemeUrl();
$this->add_linked_stylesheet($sCssThemeUrl);
}
}
DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/application/WebPage/NiceWebPage.php, now loadable using autoloader');

View File

@@ -1,248 +1,8 @@
<?php
/**
* Copyright (C) 2013-2019 Combodo SARL
*
* This file is part of iTop.
*
* iTop is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* iTop is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* @deprecated will be removed in 3.1.0 - moved to sources/application/WebPage/PDFPage.php, now loadable using autoloader
* @license http://opensource.org/licenses/AGPL-3.0
* @copyright Copyright (C) 2010-2021 Combodo SARL
*/
require_once(APPROOT.'application/utils.inc.php');
/**
* Custom class derived from TCPDF for providing custom headers and footers
*
* @author denis
*
*/
class iTopPDF extends TCPDF
{
protected $sDocumentTitle;
/**
* Shortcut for {@link TCPDF::SetFont}, to use the font configured
*
* @param string $style
* @param int $size
* @param string $fontfile
* @param string $subset
* @param bool $out
*
* @uses \TCPDF::SetFont()
* @uses \iTopPDF::GetPdfFont()
* @since 2.7.0
*/
public function SetFontParams($style, $size, $fontfile='', $subset='default', $out=true)
{
$siTopFont = self::GetPdfFont();
$this->SetFont($siTopFont, $style, $size, $fontfile, $subset, $out);
}
public function SetDocumentTitle($sDocumentTitle)
{
$this->sDocumentTitle = $sDocumentTitle;
}
/**
* Builds the custom header. Called for each new page.
*
* @see TCPDF::Header()
*/
public function Header()
{
// Title
// Set font
$this->SetFontParams('B', 10);
$iPageNumberWidth = 25;
$aMargins = $this->getMargins();
// Display the title (centered)
$this->SetXY($aMargins['left'] + $iPageNumberWidth, 0);
$this->MultiCell($this->getPageWidth() - $aMargins['left'] - $aMargins['right'] - 2 * $iPageNumberWidth, 15, $this->sDocumentTitle,
0, 'C', false, 0 /* $ln */, '', '', true, 0, false, true, 15, 'M' /* $valign */);
$this->SetFontParams('', 10);
// Display the page number (right aligned)
// Warning: the 'R'ight alignment does not work when using placeholders like $this->getAliasNumPage() or $this->getAliasNbPages()
$this->MultiCell($iPageNumberWidth, 15, Dict::Format('Core:BulkExport:PDF:PageNumber', $this->page), 0, 'R', false, 0 /* $ln */, '',
'', true, 0, false, true, 15, 'M' /* $valign */);
// Branding logo
$sBrandingIcon = APPROOT.'images/itop-logo.png';
if (file_exists(MODULESROOT.'branding/main-logo.png'))
{
$sBrandingIcon = MODULESROOT.'branding/main-logo.png';
}
$this->Image($sBrandingIcon, $aMargins['left'], 5, 0, 10);
}
// Page footer
public function Footer()
{
// No footer
}
/**
* dejavusans is a UTF-8 Unicode font. Standard PDF fonts like helvetica or times new roman are NOT UTF-8
* @return string font in the config file (export_pdf_font)
*/
public static function GetPdfFont()
{
$oConfig = utils::GetConfig();
$sPdfFont = $oConfig->Get('export_pdf_font');
return $sPdfFont;
}
}
/**
* Special class of WebPage for printing into a PDF document
*/
class PDFPage extends WebPage
{
/** @var \iTopPDF Instance of the TCPDF object for creating the PDF */
protected $oPdf;
public function __construct($s_title, $sPageFormat = 'A4', $sPageOrientation = 'L')
{
parent::__construct($s_title);
define(K_PATH_FONTS, APPROOT.'lib/combodo/tcpdf/fonts');
$this->oPdf = new iTopPDF($sPageOrientation, 'mm', $sPageFormat, true, self::PAGES_CHARSET, false);
// set document information
$this->oPdf->SetCreator(PDF_CREATOR);
$this->oPdf->SetAuthor('iTop');
$this->oPdf->SetTitle($s_title);
$this->oPdf->SetDocumentTitle($s_title);
$this->oPdf->setFontSubsetting(true);
// dejavusans is a UTF-8 Unicode font. Standard PDF fonts like helvetica or times new roman are NOT UTF-8
$this->oPdf->SetFontParams('', 10, '', true);
// set auto page breaks
$this->oPdf->SetAutoPageBreak(true, 15); // 15 mm break margin at the bottom
$this->oPdf->SetTopMargin(15);
// Add a page, we're ready to start
$this->oPdf->AddPage();
$this->SetContentDisposition('inline', $s_title.'.pdf');
$this->SetDefaultStyle();
}
/**
* Sets a default style (suitable for printing) to be included each time $this->oPdf->writeHTML() is called
*/
protected function SetDefaultStyle()
{
$this->add_style(
<<<EOF
table {
padding: 2pt;
}
table.listResults td {
border: 0.5pt solid #000 ;
}
table.listResults th {
background-color: #eee;
border: 0.5pt solid #000 ;
}
a {
text-decoration: none;
color: #000;
}
table.section td {
vertical-align: middle;
font-size: 10pt;
background-color:#eee;
}
td.icon {
width: 30px;
}
EOF
);
}
/**
* Get access to the underlying TCPDF object
*
* @return \iTopPDF
*/
public function get_tcpdf()
{
$this->flush();
return $this->oPdf;
}
/**
* Writes the currently buffered HTML content into the PDF. This can be useful:
* - to sync the flow in case you want to access the underlying TCPDF object for some specific/graphic output
* - to process the HTML by smaller chunks instead of processing the whole page at once for performance reasons
*/
public function flush()
{
if (strlen($this->s_content) > 0)
{
$sHtml = '';
if (count($this->a_styles) > 0)
{
$sHtml .= "<style>\n".implode("\n", $this->a_styles)."\n</style>\n";
}
$sHtml .= $this->s_content;
$this->oPdf->writeHTML($sHtml); // The style(s) must be supplied each time we call writeHtml
$this->s_content = '';
}
}
/**
* Whether or not the page is a PDF page
*
* @return boolean
*/
public function is_pdf()
{
return true;
}
/**
* Generates the PDF document and returns the PDF content as a string
*
* @return string
* @see WebPage::output()
*/
public function output()
{
$this->add_header('Content-type: application/x-pdf');
if (!empty($this->sContentDisposition))
{
$this->add_header('Content-Disposition: '.$this->sContentDisposition.'; filename="'.$this->sContentFileName.'"');
}
foreach ($this->a_headers as $s_header)
{
header($s_header);
}
$this->flush();
echo $this->oPdf->Output($this->s_title.'.pdf', 'S');
}
public function get_pdf()
{
$this->flush();
return $this->oPdf->Output($this->s_title.'.pdf', 'S');
}
}
DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/application/WebPage/PDFPage.php, now loadable using autoloader');

View File

@@ -1,33 +1,34 @@
<?php
// Copyright (C) 2010-2015 Combodo SARL
//
// This file is part of iTop.
//
// iTop is free software; you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// iTop is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with iTop. If not, see <http://www.gnu.org/licenses/>
/**
* Persistent class Event and derived
* Application internal events
* There is also a file log
/*
* Copyright (C) 2010-2021 Combodo SARL
*
* @copyright Copyright (C) 2010-2015 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
* This file is part of iTop.
*
* iTop is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* iTop is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
*/
use Combodo\iTop\Application\UI\Base\Component\Alert\AlertUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Field\Field;
use Combodo\iTop\Application\UI\Base\Component\Field\FieldUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Html\Html;
use Combodo\iTop\Application\UI\Base\Component\Input\TextArea;
abstract class Query extends cmdbAbstractObject
{
/**
* @throws \CoreException
* @since 3.0.0 N°3227 add is_template field for predefined queries
*/
public static function Init()
{
$aParams = array
@@ -40,20 +41,41 @@ abstract class Query extends cmdbAbstractObject
"db_table" => "priv_query",
"db_key_field" => "id",
"db_finalclass_field" => "realclass",
"display_template" => "",
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();
MetaModel::Init_AddAttribute(new AttributeString("name", array("allowed_values"=>null, "sql"=>"name", "default_value"=>null, "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeText("description", array("allowed_values"=>null, "sql"=>"description", "default_value"=>null, "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeString("name", array(
"allowed_values" => null,
"sql" => "name",
"default_value" => null,
"is_null_allowed" => false,
"depends_on" => array(),
)));
MetaModel::Init_AddAttribute(new AttributeText("description", array(
"allowed_values" => null,
"sql" => "description",
"default_value" => null,
"is_null_allowed" => false,
"depends_on" => array(),
)));
MetaModel::Init_AddAttribute(new AttributeEnum("is_template", array(
'allowed_values' => new ValueSetEnum('yes,no'),
'sql' => 'is_template',
'default_value' => 'no',
'is_null_allowed' => false,
'depends_on' => [],
'display_style' => 'radio_horizontal',
)));
// Display lists
MetaModel::Init_SetZListItems('details', array('name', 'description')); // Attributes to be displayed for the complete details
MetaModel::Init_SetZListItems('details',
array('name', 'is_template', 'description')); // Attributes to be displayed for the complete details
MetaModel::Init_SetZListItems('list', array('description')); // Attributes to be displayed for a list
// Search criteria
MetaModel::Init_SetZListItems('standard_search', array('name', 'description')); // Criteria of the std search form
MetaModel::Init_SetZListItems('default_search', array('name', 'description')); // Criteria of the default search form
MetaModel::Init_SetZListItems('standard_search', array('name', 'description', 'is_template')); // Criteria of the std search form
MetaModel::Init_SetZListItems('default_search',
array('name', 'description', 'is_template')); // Criteria of the default search form
// MetaModel::Init_SetZListItems('advanced_search', array('name')); // Criteria of the advanced search form
}
}
@@ -68,59 +90,73 @@ class QueryOQL extends Query
"key_type" => "autoincrement",
"name_attcode" => "name",
"state_attcode" => "",
"reconc_keys" => array(),
"reconc_keys" => array('oql', 'is_template'),
"db_table" => "priv_query_oql",
"db_key_field" => "id",
"db_finalclass_field" => "",
"display_template" => "",
);
MetaModel::Init_Params($aParams);
MetaModel::Init_InheritAttributes();
MetaModel::Init_AddAttribute(new AttributeOQL("oql", array("allowed_values"=>null, "sql"=>"oql", "default_value"=>null, "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeText("fields", array("allowed_values"=>null, "sql"=>"fields", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeOQL("oql", array(
"allowed_values" => null,
"sql" => "oql",
"default_value" => null,
"is_null_allowed" => false,
"depends_on" => array(),
)));
MetaModel::Init_AddAttribute(new AttributeText("fields", array(
"allowed_values" => null,
"sql" => "fields",
"default_value" => null,
"is_null_allowed" => true,
"depends_on" => array(),
)));
// Rolled back to AttributeText until AttributeQueryAttCodeSet can manage fields order correctly
//MetaModel::Init_AddAttribute(new AttributeQueryAttCodeSet("fields", array("allowed_values"=>null,"max_items" => 1000, "query_field" => "oql", "sql"=>"fields", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array('oql'))));
// Display lists
MetaModel::Init_SetZListItems('details', array('name', 'description', 'oql', 'fields')); // Attributes to be displayed for the complete details
MetaModel::Init_SetZListItems('details',
array('name', 'is_template', 'description', 'oql', 'fields')); // Attributes to be displayed for the complete details
MetaModel::Init_SetZListItems('list', array('description')); // Attributes to be displayed for a list
// Search criteria
MetaModel::Init_SetZListItems('standard_search', array('name', 'description', 'fields', 'oql')); // Criteria of the std search form
MetaModel::Init_SetZListItems('standard_search',
array('name', 'description', 'is_template', 'fields', 'oql')); // Criteria of the std search form
}
function DisplayBareProperties(WebPage $oPage, $bEditMode = false, $sPrefix = '', $aExtraParams = array())
{
$aFieldsMap = parent::DisplayBareProperties($oPage, $bEditMode, $sPrefix, $aExtraParams);
if (!$bEditMode)
{
$oPage->add_script("$('[name=\"attr_oql\"]').addClass('ibo-queryoql'); $('[data-attribute-code=\"oql\"]').addClass('ibo-queryoql');");
if (!$bEditMode) {
$sFields = trim($this->Get('fields'));
$bExportV1Recommended = ($sFields == '');
if ($bExportV1Recommended)
{
if ($bExportV1Recommended) {
$oFieldAttDef = MetaModel::GetAttributeDef('QueryOQL', 'fields');
$oPage->add('<div class="message message_error" style="padding-left: 30px;"><div style="padding: 10px;">'.Dict::Format('UI:Query:UrlV1', $oFieldAttDef->GetLabel()).'</div></div>');
$oAlert = AlertUIBlockFactory::MakeForFailure()
->SetIsClosable(false)
->SetIsCollapsible(false);
$oAlert->AddCSSClass('mb-5');
$oAlert->AddSubBlock(new Html(Dict::Format('UI:Query:UrlV1', '')));
$oPage->AddSubBlock($oAlert);
$sUrl = utils::GetAbsoluteUrlAppRoot().'webservices/export.php?format=spreadsheet&login_mode=basic&query='.$this->GetKey();
}
else
{
} else {
$sUrl = utils::GetAbsoluteUrlAppRoot().'webservices/export-v2.php?format=spreadsheet&login_mode=basic&date_format='.urlencode((string)AttributeDateTime::GetFormat()).'&query='.$this->GetKey();
}
$sOql = $this->Get('oql');
$sMessage = null;
try
{
try {
$oSearch = DBObjectSearch::FromOQL($sOql);
$aParameters = $oSearch->GetQueryParams();
foreach($aParameters as $sParam => $val)
{
foreach ($aParameters as $sParam => $val) {
$sUrl .= '&arg_'.$sParam.'=["'.$sParam.'"]';
}
$oPage->p(Dict::S('UI:Query:UrlForExcel').':<br/><textarea cols="80" rows="3" READONLY>'.$sUrl.'</textarea>');
$oTextArea = new TextArea("", $sUrl, null, 80, 3);
$oFieldUrl = FieldUIBlockFactory::MakeFromObject(Dict::S('UI:Query:UrlForExcel'), $oTextArea, Field::ENUM_FIELD_LAYOUT_LARGE);
$oPage->AddSubBlock($oFieldUrl);
if (count($aParameters) == 0)
{
if (count($aParameters) == 0) {
$oBlock = new DisplayBlock($oSearch, 'list');
$aExtraParams = array(
//'menu' => $sShowMenu,
@@ -130,10 +166,13 @@ class QueryOQL extends Query
$oBlock->Display($oPage, $sBlockId, $aExtraParams);
}
}
catch (OQLException $e)
{
$sMessage = '<div class="message message_error" style="padding-left: 30px;"><div style="padding: 10px;">'.Dict::Format('UI:RunQuery:Error', $e->getHtmlDesc()).'</div></div>';
$oPage->p($sMessage);
catch
(OQLException $e) {
$oAlert = AlertUIBlockFactory::MakeForFailure(Dict::Format('UI:RunQuery:Error'), $e->getHtmlDesc())
->SetIsClosable(false)
->SetIsCollapsible(false);
$oAlert->AddCSSClass('mb-5');
$oPage->AddSubBlock($oAlert);
}
}
return $aFieldsMap;

View File

@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2010-2016 Combodo SARL
// Copyright (C) 2010-2021 Combodo SARL
//
// This file is part of iTop.
//
@@ -15,13 +15,14 @@
//
// You should have received a copy of the GNU Affero General Public License
// along with iTop. If not, see <http://www.gnu.org/licenses/>
use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableSettings;
/**
* Persistent class Shortcut and derived
* Shortcuts of any kind
*
* @copyright Copyright (C) 2010-2016 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
@@ -39,7 +40,6 @@ abstract class Shortcut extends DBObject implements iDisplay
"db_table" => "priv_shortcut",
"db_key_field" => "id",
"db_finalclass_field" => "realclass",
"display_template" => "",
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();
@@ -101,7 +101,7 @@ function ShortcutRenameOK()
});
}
$('#shortcut_rename_dlg form').bind('submit', function() { return false; });
$('#shortcut_rename_dlg form').on('submit', function() { return false; });
$('#shortcut_rename_dlg').dialog({
width: 400,
@@ -161,7 +161,6 @@ class ShortcutOQL extends Shortcut
"db_table" => "priv_shortcut_oql",
"db_key_field" => "id",
"db_finalclass_field" => "",
"display_template" => "",
);
MetaModel::Init_Params($aParams);
MetaModel::Init_InheritAttributes();
@@ -287,8 +286,7 @@ class ShortcutOQL extends Shortcut
$sRateTitle = addslashes(Dict::Format('Class:ShortcutOQL/Attribute:auto_reload_sec/tip', MetaModel::GetConfig()->Get('min_reload_interval')));
$oPage->add_ready_script(
<<<EOF
<<<JS
// Note: the title gets deleted by the validation mechanism
$("#attr_auto_reload_sec").tooltip({items: 'input', content: '$sRateTitle'});
$("#attr_auto_reload_sec").prop('disabled', !$('#attr_auto_reload').is(':checked'));
@@ -316,23 +314,30 @@ function ShortcutCreationOK()
});
}
$('#shortcut_creation_dlg form').bind('submit', function() { ShortcutCreationOK(); return false; });
$('#shortcut_creation_dlg form').on('submit', function() { ShortcutCreationOK(); return false; });
$('#shortcut_creation_dlg').dialog({
width: 400,
modal: true,
title: '$sDialogTitle',
buttons: [
{ text: "$sOkButtonLabel", click: ShortcutCreationOK },
{ text: "$sCancelButtonLabel", click: function() {
$(this).dialog( "close" ); $(this).remove();
} },
{
text: "$sCancelButtonLabel",
class: "ibo-is-alternative",
click: function() {
$(this).dialog( "close" );
$(this).remove();
}
},
{
text: "$sOkButtonLabel",
class: "ibo-is-primary",
click: ShortcutCreationOK
},
],
close: function() { $(this).remove(); }
});
EOF
JS
);
}
}
?>

View File

@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2010-2016 Combodo SARL
// Copyright (C) 2010-2021 Combodo SARL
//
// This file is part of iTop.
//
@@ -23,7 +23,7 @@ require_once(APPROOT.'/core/contexttag.class.inc.php');
/**
* File to include to initialize the datamodel in memory
*
* @copyright Copyright (C) 2010-2019 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/

View File

@@ -1,6 +1,6 @@
<?php
/**
* Copyright (C) 2013-2020 Combodo SARL
* Copyright (C) 2013-2021 Combodo SARL
*
* This file is part of iTop.
*
@@ -20,6 +20,8 @@
require_once(APPROOT.'/application/displayblock.class.inc.php');
/**
* This class manages the special template format used internally to build the iTop web pages
*
* @deprecated 3.0.0
*/
class DisplayTemplate
{
@@ -29,14 +31,15 @@ class DisplayTemplate
public function __construct($sTemplate)
{
$this->m_aTags = array (
DeprecatedCallsLog::NotifyDeprecatedPhpMethod();
$this->m_aTags = array(
'itopblock',
'itopcheck',
'itoptabs',
'itoptab',
'itoptoggle',
'itopstring',
'sqlblock'
'sqlblock',
);
$this->m_sTemplate = $sTemplate;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,35 @@
<?php
/**
* Copyright (C) 2013-2020 Combodo SARL
*
* This file is part of iTop.
*
* iTop is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* iTop is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
*/
/**
* Class ThemeHandlerService : used to ease testing MFCompiler::CompileThemes class via mocks
*
* @author Olivier DAIN <olivier.dain@combodo.com>
* @since 3.0.0 N°2982
*/
class ThemeHandlerService
{
public function __construct()
{
}
public function CompileTheme($sThemeId, $bSetup = false, $sSetupCompilationTimestamp="", $aThemeParameters = null, $aImportsPaths = null, $sWorkingPath = null){
return ThemeHandler::CompileTheme($sThemeId, $bSetup, $sSetupCompilationTimestamp="", $aThemeParameters, $aImportsPaths, $sWorkingPath);
}
}

View File

@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2010-2015 Combodo SARL
// Copyright (C) 2010-2021 Combodo SARL
//
// This file is part of iTop.
//
@@ -23,7 +23,7 @@
* which choice is configured via the parameter 'transaction_storage'
*
* @package iTop
* @copyright Copyright (C) 2010-2012 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2010-2016 Combodo SARL
// Copyright (C) 2010-2021 Combodo SARL
//
// This file is part of iTop.
//
@@ -21,7 +21,7 @@
* UI wdiget for displaying and editing one-way encrypted passwords
*
* @author Romain Quetiez
* @copyright Copyright (C) 2010-2016 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
@@ -70,11 +70,7 @@ class UIHTMLEditorWidget
// To change the default settings of the editor,
// a) edit the file /js/ckeditor/config.js
// b) or override some of the configuration settings, using the second parameter of ckeditor()
$aConfig = array();
$sLanguage = strtolower(trim(UserRights::GetUserLanguage()));
$aConfig['language'] = $sLanguage;
$aConfig['contentsLanguage'] = $sLanguage;
$aConfig['extraPlugins'] = 'disabler,codesnippet';
$aConfig = utils::GetCkeditorPref();
$sWidthSpec = addslashes(trim($this->m_oAttDef->GetWidth()));
if ($sWidthSpec != '')
{
@@ -97,10 +93,10 @@ class UIHTMLEditorWidget
// The most relevant solution would be to implement a plugin to CKEdit, and handle the internal events like: setData, insertHtml, insertElement, loadSnapshot, key, afterUndo, afterRedo
// Could also be bound to 'instanceReady.ckeditor'
$oPage->add_ready_script("$('#$iId').bind('validate', function(evt, sFormId) { return ValidateCKEditField('$iId', '', {$this->m_sMandatory}, sFormId, '') } );\n");
$oPage->add_ready_script("$('#$iId').on('validate', function(evt, sFormId) { return ValidateCKEditField('$iId', '', {$this->m_sMandatory}, sFormId, '') } );\n");
$oPage->add_ready_script(
<<<EOF
$('#$iId').bind('update', function(evt){
$('#$iId').on('update', function(evt){
BlockField('cke_$iId', $('#$iId').prop('disabled'));
//Delayed execution - ckeditor must be properly initialized before setting readonly
var retryCount = 0;

View File

@@ -1,28 +1,18 @@
<?php
// Copyright (C) 2010-2017 Combodo SARL
//
// This file is part of iTop.
//
// iTop is free software; you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// iTop is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with iTop. If not, see <http://www.gnu.org/licenses/>
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlockUIBlockFactory;
/**
* Class UILinksWidgetDirect
*
* @copyright Copyright (C) 2010-2017 Combodo SARL
*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
*/
class UILinksWidgetDirect
{
protected $sClass;
@@ -184,7 +174,7 @@ class UILinksWidgetDirect
// For security reasons: check that the "proposed" class is actually a subclass of the linked class
// and that the current user is allowed to create objects of this class
$sRealClass = '';
$oPage->add('<div class="wizContainer" style="vertical-align:top;"><div>');
//$oPage->add('<div class="wizContainer" style="vertical-align:top;"><div>');
$aSubClasses = MetaModel::EnumChildClasses($this->sLinkedClass, ENUM_CHILD_CLASSES_ALL); // Including the specified class itself
$aPossibleClasses = array();
foreach($aSubClasses as $sCandidateClass)
@@ -243,23 +233,21 @@ class UILinksWidgetDirect
protected function DisplayEditInPlace(WebPage $oPage, $oValue, $aArgs = array(), $sFormPrefix, $oCurrentObj, $aButtons = array('create', 'delete'))
{
$aAttribs = $this->GetTableConfig();
$oValue->Rewind();
$oPage->add('<table class="listContainer" id="'.$this->sInputid.'"><tr><td>');
$aData = array();
while($oLinkObj = $oValue->Fetch())
{
while ($oLinkObj = $oValue->Fetch()) {
$aRow = array();
$aRow['form::select'] = '<input type="checkbox" class="selectList'.$this->sInputid.'" value="'.$oLinkObj->GetKey().'"/>';
foreach($this->aZlist as $sLinkedAttCode)
{
foreach ($this->aZlist as $sLinkedAttCode) {
$aRow[$sLinkedAttCode] = $oLinkObj->GetAsHTML($sLinkedAttCode);
}
$aData[] = $aRow;
}
$oPage->table($aAttribs, $aData);
$oPage->add('</td></tr></table>'); //listcontainer
$oDiv = UIContentBlockUIBlockFactory::MakeStandard($this->sInputid, ['listContainer']);
$oPage->AddSubBlock($oDiv);
$oDatatable = DataTableUIBlockFactory::MakeForForm($this->sInputid, $aAttribs, $aData);
$oDatatable->SetOptions(['select_mode' => 'custom']);
$oDiv->AddSubBlock($oDatatable);
$sInputName = $sFormPrefix.'attr_'.$this->sAttCode;
$aLabels = array(
'delete' => Dict::S('UI:Button:Delete'),
@@ -294,20 +282,17 @@ class UILinksWidgetDirect
*/
public function GetObjectsSelectionDlg($oPage, $oCurrentObj, $aAlreadyLinked, $aPrefillFormParam = array())
{
$sHtml = "<div class=\"wizContainer\" style=\"vertical-align:top;\">\n";
//$oPage->add("<div class=\"wizContainer\" style=\"vertical-align:top;\">\n");
$oHiddenFilter = new DBObjectSearch($this->sLinkedClass);
if (($oCurrentObj != null) && MetaModel::IsSameFamilyBranch($this->sLinkedClass, $this->sClass))
{
if (($oCurrentObj != null) && MetaModel::IsSameFamilyBranch($this->sLinkedClass, $this->sClass)) {
// Prevent linking to self if the linked object is of the same family
// and already present in the database
if (!$oCurrentObj->IsNew())
{
if (!$oCurrentObj->IsNew()) {
$oHiddenFilter->AddCondition('id', $oCurrentObj->GetKey(), '!=');
}
}
if (count($aAlreadyLinked) > 0)
{
if (count($aAlreadyLinked) > 0) {
$oHiddenFilter->AddCondition('id', $aAlreadyLinked, 'NOTIN');
}
$oHiddenCriteria = $oHiddenFilter->GetCriteria();
@@ -319,18 +304,14 @@ class UILinksWidgetDirect
if ($valuesDef === null)
{
$oFilter = new DBObjectSearch($this->sLinkedClass);
}
else
{
if (!$valuesDef instanceof ValueSetObjects)
{
} else {
if (!$valuesDef instanceof ValueSetObjects) {
throw new Exception('Error: only ValueSetObjects are supported for "allowed_values" in AttributeLinkedSet ('.$this->sClass.'/'.$this->sAttCode.').');
}
$oFilter = DBObjectSearch::FromOQL($valuesDef->GetFilterExpression());
}
if ($oCurrentObj != null)
{
if ($oCurrentObj != null) {
$this->SetSearchDefaultFromContext($oCurrentObj, $oFilter);
$aArgs = array_merge($oCurrentObj->ToArgs('this'), $oFilter->GetInternalParams());
@@ -339,7 +320,7 @@ class UILinksWidgetDirect
$oCurrentObj->PrefillForm('search', $aPrefillFormParam);
}
$oBlock = new DisplayBlock($oFilter, 'search', false);
$sHtml .= $oBlock->GetDisplay($oPage, "SearchFormToAdd_{$this->sInputid}",
$oPage->AddUiBlock($oBlock->GetDisplay($oPage, "SearchFormToAdd_{$this->sInputid}",
array(
'result_list_outer_selector' => "SearchResultsToAdd_{$this->sInputid}",
'table_id' => "add_{$this->sInputid}",
@@ -349,16 +330,20 @@ class UILinksWidgetDirect
'query_params' => $oFilter->GetInternalParams(),
'hidden_criteria' => $sHiddenCriteria,
)
);
$sHtml .= "<form id=\"ObjectsAddForm_{$this->sInputid}\">\n";
$sHtml .= "<div id=\"SearchResultsToAdd_{$this->sInputid}\" style=\"vertical-align:top;background: #fff;height:100%;overflow:auto;padding:0;border:0;\">\n";
$sHtml .= "<div style=\"background: #fff; border:0; text-align:center; vertical-align:middle;\"><p>".Dict::S('UI:Message:EmptyList:UseSearchForm')."</p></div>\n";
$sHtml .= "</div>\n";
$sHtml .= "<input type=\"hidden\" id=\"count_{$this->sInputid}\" value=\"0\"/>";
$sHtml .= "<button type=\"button\" class=\"cancel\">".Dict::S('UI:Button:Cancel')."</button>&nbsp;&nbsp;<button type=\"button\" class=\"ok\" disabled=\"disabled\">".Dict::S('UI:Button:Add')."</button>";
$sHtml .= "</div>\n";
$sHtml .= "</form>\n";
$oPage->add($sHtml);
));
$sEmptyList = Dict::S('UI:Message:EmptyList:UseSearchForm');
$sCancel = Dict::S('UI:Button:Cancel');
$sAdd = Dict::S('UI:Button:Add');
$oPage->add(<<<HTML
<form id="ObjectsAddForm_{$this->sInputid}">
<div id="SearchResultsToAdd_{$this->sInputid}">
<div style="background: #fff; border:0; text-align:center; vertical-align:middle;"><p>{$sEmptyList}</p></div>
</div>
<input type="hidden" id="count_{$this->sInputid}" value="0"/>
</form>
HTML
);
}
/**

View File

@@ -1,30 +1,15 @@
<?php
// Copyright (C) 2010-2017 Combodo SARL
//
// This file is part of iTop.
//
// iTop is free software; you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// iTop is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with iTop. If not, see <http://www.gnu.org/licenses/>
/**
* Class UILinksWidget
*
* @copyright Copyright (C) 2010-2017 Combodo SARL
/*
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
require_once(APPROOT.'application/webpage.class.inc.php');
use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\DataTable\StaticTable\FormTableRow\FormTableRow;
use Combodo\iTop\Application\UI\Links\Indirect\BlockIndirectLinksEdit\BlockIndirectLinksEdit;
use Combodo\iTop\Application\UI\Links\Indirect\BlockObjectPickerDialog\BlockObjectPickerDialog;
use Combodo\iTop\Renderer\Console\ConsoleBlockRenderer;
require_once(APPROOT.'application/displayblock.class.inc.php');
class UILinksWidget
@@ -39,6 +24,7 @@ class UILinksWidget
protected $m_sLinkedClass;
protected $m_sRemoteClass;
protected $m_bDuplicatesAllowed;
/** @var string[] list of editables attcodes */
protected $m_aEditableFields;
protected $m_aTableConfig;
@@ -46,7 +32,7 @@ class UILinksWidget
* UILinksWidget constructor.
*
* @param string $sClass
* @param string $sAttCode
* @param string $sAttCode AttributeLinkedSetIndirect attcode
* @param int $iInputId
* @param string $sNameSuffix
* @param bool $bDuplicatesAllowed
@@ -73,41 +59,35 @@ class UILinksWidget
/** @var AttributeExternalKey $oLinkingAttDef */
$oLinkingAttDef = MetaModel::GetAttributeDef($this->m_sLinkedClass, $this->m_sExtKeyToRemote);
$this->m_sRemoteClass = $oLinkingAttDef->GetTargetClass();
$sExtKeyToMe = $oAttDef->GetExtKeyToMe();
$sStateAttCode = MetaModel::GetStateAttributeCode($this->m_sClass);
$sDefaultState = MetaModel::GetDefaultState($this->m_sClass);
$this->m_aEditableFields = array();
$this->m_aTableConfig = array();
$this->m_aTableConfig['form::checkbox'] = array( 'label' => "<input class=\"select_all\" type=\"checkbox\" value=\"1\" onClick=\"CheckAll('#linkedset_{$this->m_sAttCode}{$this->m_sNameSuffix} .selection', this.checked); oWidget".$this->m_iInputId.".OnSelectChange();\">", 'description' => Dict::S('UI:SelectAllToggle+'));
$this->m_aTableConfig['form::checkbox'] = array(
'label' => "<input class=\"select_all\" type=\"checkbox\" value=\"1\" onClick=\"CheckAll('#linkedset_{$this->m_sAttCode}{$this->m_sNameSuffix} .selection', this.checked); oWidget".$this->m_iInputId.".OnSelectChange();\">",
'description' => Dict::S('UI:SelectAllToggle+'),
);
foreach(MetaModel::FlattenZList(MetaModel::GetZListItems($this->m_sLinkedClass, 'list')) as $sAttCode)
$aLnkAttDefsToDisplay = MetaModel::GetZListAttDefsFilteredForIndirectLinkClass($sClass, $sAttCode);
foreach ($aLnkAttDefsToDisplay as $oLnkAttDef)
{
$oAttDef = MetaModel::GetAttributeDef($this->m_sLinkedClass, $sAttCode);
if ($sStateAttCode == $sAttCode)
{
// State attribute is always hidden from the UI
}
else if ($oAttDef->IsWritable() && ($sAttCode != $sExtKeyToMe) && ($sAttCode != $this->m_sExtKeyToRemote) && ($sAttCode != 'finalclass'))
{
$iFlags = MetaModel::GetAttributeFlags($this->m_sLinkedClass, $sDefaultState, $sAttCode);
if ( !($iFlags & OPT_ATT_HIDDEN) && !($iFlags & OPT_ATT_READONLY) )
{
$this->m_aEditableFields[] = $sAttCode;
$this->m_aTableConfig[$sAttCode] = array( 'label' => $oAttDef->GetLabel(), 'description' => $oAttDef->GetDescription());
}
}
$sLnkAttCode = $oLnkAttDef->GetCode();
$this->m_aEditableFields[] = $sLnkAttCode;
$this->m_aTableConfig[$sLnkAttCode] = array('label' => $oLnkAttDef->GetLabel(), 'description' => $oLnkAttDef->GetDescription());
}
$this->m_aTableConfig['static::key'] = array( 'label' => MetaModel::GetName($this->m_sRemoteClass), 'description' => MetaModel::GetClassDescription($this->m_sRemoteClass));
foreach(MetaModel::GetZListItems($this->m_sRemoteClass, 'list') as $sFieldCode)
{
// TO DO: check the state of the attribute: hidden or visible ?
if ($sFieldCode != 'finalclass')
{
$oAttDef = MetaModel::GetAttributeDef($this->m_sRemoteClass, $sFieldCode);
$this->m_aTableConfig['static::'.$sFieldCode] = array( 'label' => $oAttDef->GetLabel(), 'description' => $oAttDef->GetDescription());
}
$this->m_aTableConfig['static::key'] = array(
'label' => MetaModel::GetName($this->m_sRemoteClass),
'description' => MetaModel::GetClassDescription($this->m_sRemoteClass),
);
$this->m_aEditableFields[] = $this->m_sExtKeyToRemote;
$aRemoteAttDefsToDisplay = MetaModel::GetZListAttDefsFilteredForIndirectRemoteClass($this->m_sRemoteClass);
foreach ($aRemoteAttDefsToDisplay as $oRemoteAttDef) {
$sRemoteAttCode = $oRemoteAttDef->GetCode();
$this->m_aTableConfig['static::'.$sRemoteAttCode] = array(
'label' => $oRemoteAttDef->GetLabel(),
'description' => $oRemoteAttDef->GetDescription(),
);
}
}
@@ -116,7 +96,7 @@ class UILinksWidget
*
* @param WebPage $oP Web page used for the ouput
* @param DBObject $oLinkedObj Remote object
* @param mixed $linkObjOrId Either the object linked or a unique number for new link records to add
* @param DBObject|int $linkObjOrId Either the lnk object or a unique number for new link records to add
* @param array $aArgs Extra context arguments
* @param DBObject $oCurrentObj The object to which all the elements of the linked set refer to
* @param int $iUniqueId A unique identifier of new links
@@ -134,43 +114,39 @@ class UILinksWidget
$aRow = array();
$aFieldsMap = array();
$iKey = 0;
if(is_object($linkObjOrId) && (!$linkObjOrId->IsNew()))
if (is_object($linkObjOrId) && (!$linkObjOrId->IsNew()))
{
$iKey = $linkObjOrId->GetKey();
$iRemoteObjKey = $linkObjOrId->Get($this->m_sExtKeyToRemote);
$iRemoteObjKey = $linkObjOrId->Get($this->m_sExtKeyToRemote);
$sPrefix .= "[$iKey][";
$sNameSuffix = "]"; // To make a tabular form
$aArgs['prefix'] = $sPrefix;
$aArgs['wizHelper'] = "oWizardHelper{$this->m_iInputId}{$iKey}";
$aArgs['this'] = $linkObjOrId;
if($bReadOnly)
{
$aRow['form::checkbox'] = "";
foreach($this->m_aEditableFields as $sFieldCode)
{
$sDisplayValue = $linkObjOrId->GetEditValue($sFieldCode);
$aRow[$sFieldCode] = $sDisplayValue;
}
}
else
{
$aRow['form::checkbox'] = "<input class=\"selection\" data-remote-id=\"$iRemoteObjKey\" data-link-id=\"$iKey\" data-unique-id=\"$iUniqueId\" type=\"checkbox\" onClick=\"oWidget".$this->m_iInputId.".OnSelectChange();\" value=\"$iKey\">";
foreach($this->m_aEditableFields as $sFieldCode)
{
$sFieldId = $this->m_iInputId.'_'.$sFieldCode.'['.$linkObjOrId->GetKey().']';
$sSafeId = utils::GetSafeId($sFieldId);
$sValue = $linkObjOrId->Get($sFieldCode);
$sDisplayValue = $linkObjOrId->GetEditValue($sFieldCode);
$oAttDef = MetaModel::GetAttributeDef($this->m_sLinkedClass, $sFieldCode);
$aRow[$sFieldCode] = '<div class="field_container" style="border:none;"><div class="field_data"><div class="field_value">'.
cmdbAbstractObject::GetFormElementForField($oP, $this->m_sLinkedClass, $sFieldCode, $oAttDef, $sValue, $sDisplayValue, $sSafeId, $sNameSuffix, 0, $aArgs).
'</div></div></div>';
$aFieldsMap[$sFieldCode] = $sSafeId;
}
}
if ($bReadOnly)
{
$aRow['form::checkbox'] = "";
foreach ($this->m_aEditableFields as $sFieldCode)
{
$sDisplayValue = $linkObjOrId->GetEditValue($sFieldCode);
$aRow[$sFieldCode] = $sDisplayValue;
}
}
else
{
$aRow['form::checkbox'] = "<input class=\"selection\" data-remote-id=\"$iRemoteObjKey\" data-link-id=\"$iKey\" data-unique-id=\"$iUniqueId\" type=\"checkbox\" onClick=\"oWidget".$this->m_iInputId.".OnSelectChange();\" value=\"$iKey\">";
foreach ($this->m_aEditableFields as $sFieldCode)
{
$sSafeFieldId = $this->GetFieldId($linkObjOrId->GetKey(), $sFieldCode);
$this->AddRowForFieldCode($aRow, $sFieldCode, $aArgs, $linkObjOrId, $oP, $sNameSuffix, $sSafeFieldId);
$aFieldsMap[$sFieldCode] = $sSafeFieldId;
}
}
$sState = $linkObjOrId->GetState();
$sRemoteKeySafeFieldId = $this->GetFieldId($aArgs['this']->GetKey(), $this->m_sExtKeyToRemote);;
}
else
{
@@ -180,15 +156,18 @@ class UILinksWidget
// New link existing only in memory
$oNewLinkObj = $linkObjOrId;
$iRemoteObjKey = $oNewLinkObj->Get($this->m_sExtKeyToRemote);
$oNewLinkObj->Set($this->m_sExtKeyToMe, $oCurrentObj); // Setting the extkey with the object also fills the related external fields
$oNewLinkObj->Set($this->m_sExtKeyToMe,
$oCurrentObj); // Setting the extkey with the object also fills the related external fields
}
else
{
$iRemoteObjKey = $linkObjOrId;
$oNewLinkObj = MetaModel::NewObject($this->m_sLinkedClass);
$oRemoteObj = MetaModel::GetObject($this->m_sRemoteClass, $iRemoteObjKey);
$oNewLinkObj->Set($this->m_sExtKeyToRemote, $oRemoteObj); // Setting the extkey with the object alsoo fills the related external fields
$oNewLinkObj->Set($this->m_sExtKeyToMe, $oCurrentObj); // Setting the extkey with the object also fills the related external fields
$oNewLinkObj->Set($this->m_sExtKeyToRemote,
$oRemoteObj); // Setting the extkey with the object alsoo fills the related external fields
$oNewLinkObj->Set($this->m_sExtKeyToMe,
$oCurrentObj); // Setting the extkey with the object also fills the related external fields
}
$sPrefix .= "[-$iUniqueId][";
$sNameSuffix = "]"; // To make a tabular form
@@ -222,113 +201,136 @@ EOF
foreach($this->m_aEditableFields as $sFieldCode)
{
$sFieldId = $this->m_iInputId.'_'.$sFieldCode.'['.-$iUniqueId.']';
$sSafeId = utils::GetSafeId($sFieldId);
$sSafeFieldId = $this->GetFieldId($iUniqueId, $sFieldCode);
$this->AddRowForFieldCode($aRow, $sFieldCode, $aArgs, $oNewLinkObj, $oP, $sNameSuffix, $sSafeFieldId);
$aFieldsMap[$sFieldCode] = $sSafeFieldId;
$sValue = $oNewLinkObj->Get($sFieldCode);
$sDisplayValue = $oNewLinkObj->GetEditValue($sFieldCode);
$oAttDef = MetaModel::GetAttributeDef($this->m_sLinkedClass, $sFieldCode);
$aRow[$sFieldCode] = '<div class="field_container" style="border:none;"><div class="field_data"><div class="field_value">'.
cmdbAbstractObject::GetFormElementForField($oP, $this->m_sLinkedClass, $sFieldCode, $oAttDef, $sValue, $sDisplayValue, $sSafeId /* id */, $sNameSuffix, 0, $aArgs).
'</div></div></div>';
$aFieldsMap[$sFieldCode] = $sSafeId;
$oP->add_ready_script(<<<EOF
$oP->add_ready_script(
<<<JS
oWidget{$this->m_iInputId}.OnValueChange($iKey, $iUniqueId, '$sFieldCode', '$sValue');
EOF
);
JS
);
}
$sState = '';
$sRemoteKeySafeFieldId = $this->GetFieldId($iUniqueId, $this->m_sExtKeyToRemote);
}
if(!$bReadOnly)
{
$sExtKeyToMeId = utils::GetSafeId($sPrefix.$this->m_sExtKeyToMe);
$aFieldsMap[$this->m_sExtKeyToMe] = $sExtKeyToMeId;
$aRow['form::checkbox'] .= "<input type=\"hidden\" id=\"$sExtKeyToMeId\" value=\"".$oCurrentObj->GetKey()."\">";
$sExtKeyToRemoteId = utils::GetSafeId($sPrefix.$this->m_sExtKeyToRemote);
$aFieldsMap[$this->m_sExtKeyToRemote] = $sExtKeyToRemoteId;
$aRow['form::checkbox'] .= "<input type=\"hidden\" id=\"$sExtKeyToRemoteId\" value=\"$iRemoteObjKey\">";
}
$iFieldsCount = count($aFieldsMap);
$sJsonFieldsMap = json_encode($aFieldsMap);
$oP->add_script(
<<<EOF
var {$aArgs['wizHelper']} = new WizardHelper('{$this->m_sLinkedClass}', '', '$sState');
{$aArgs['wizHelper']}.SetFieldsMap($sJsonFieldsMap);
{$aArgs['wizHelper']}.SetFieldsCount($iFieldsCount);
EOF
);
$aRow['static::key'] = $oLinkedObj->GetHyperLink();
foreach(MetaModel::GetZListItems($this->m_sRemoteClass, 'list') as $sFieldCode)
if (!$bReadOnly)
{
$aRow['static::'.$sFieldCode] = $oLinkedObj->GetAsHTML($sFieldCode);
$sExtKeyToMeId = utils::GetSafeId($sPrefix.$this->m_sExtKeyToMe);
$aFieldsMap[$this->m_sExtKeyToMe] = $sExtKeyToMeId;
$aRow['form::checkbox'] .= "<input type=\"hidden\" id=\"$sExtKeyToMeId\" value=\"".$oCurrentObj->GetKey()."\">";
$sExtKeyToRemoteId = utils::GetSafeId($sPrefix.$this->m_sExtKeyToRemote);
$aFieldsMap[$this->m_sExtKeyToRemote] = $sExtKeyToRemoteId;
$aRow['form::checkbox'] .= "<input type=\"hidden\" id=\"$sExtKeyToRemoteId\" value=\"$iRemoteObjKey\">";
}
// Adding fields from remote class
// all fields are embedded in a span + added to $aFieldsMap array so that we can refresh them after extkey change
$aRemoteFieldsMap = [];
foreach (MetaModel::GetZListItems($this->m_sRemoteClass, 'list') as $sFieldCode)
{
$sSafeFieldId = $this->GetFieldId($aArgs['this']->GetKey(), $sFieldCode);
$aRow['static::'.$sFieldCode] = "<span id='field_$sSafeFieldId'>".$oLinkedObj->GetAsHTML($sFieldCode).'</span>';
$aRemoteFieldsMap[$sFieldCode] = $sSafeFieldId;
}
// id field is needed so that remote object could be load server side
$aRemoteFieldsMap['id'] = $sRemoteKeySafeFieldId;
// Generate WizardHelper to update dependant fields
$this->AddWizardHelperInit($oP, $aArgs['wizHelper'], $this->m_sLinkedClass, $sState, $aFieldsMap);
//instantiate specific WizarHelper instance for remote class fields refresh
$bHasExtKeyUpdatingRemoteClassFields = (
array_key_exists('replaceDependenciesByRemoteClassFields', $aArgs)
&& ($aArgs['replaceDependenciesByRemoteClassFields'])
);
if ($bHasExtKeyUpdatingRemoteClassFields)
{
$this->AddWizardHelperInit($oP, $aArgs['wizHelperRemote'], $this->m_sRemoteClass, $sState, $aRemoteFieldsMap);
}
return $aRow;
}
/**
* Display one row of the whole form
* @param WebPage $oP
* @param array $aConfig
* @param array $aRow
* @param int $iRowId
* @return string
*/
protected function DisplayFormRow(WebPage $oP, $aConfig, $aRow, $iRowId)
private function AddRowForFieldCode(&$aRow, $sFieldCode, &$aArgs, $oLnk, $oP, $sNameSuffix, $sSafeFieldId): void
{
$sHtml = '';
$sHtml .= "<tr id=\"{$this->m_sAttCode}{$this->m_sNameSuffix}_row_$iRowId\">\n";
foreach($aConfig as $sName=>$void)
if (($sFieldCode === $this->m_sExtKeyToRemote))
{
$sHtml .= "<td>".$aRow[$sName]."</td>\n";
// current field is the lnk extkey to the remote class
$aArgs['replaceDependenciesByRemoteClassFields'] = true;
$sRowFieldCode = 'static::key';
$aArgs['wizHelperRemote'] = $aArgs['wizHelper'].'_remote';
$aRemoteAttDefs = MetaModel::GetZListAttDefsFilteredForIndirectRemoteClass($this->m_sRemoteClass);
$aRemoteCodes = array_map(
function ($value) {
return $value->GetCode();
},
$aRemoteAttDefs
);
$aArgs['remoteCodes'] = $aRemoteCodes;
}
$sHtml .= "</tr>\n";
return $sHtml;
else
{
$aArgs['replaceDependenciesByRemoteClassFields'] = false;
$sRowFieldCode = $sFieldCode;
}
$sValue = $oLnk->Get($sFieldCode);
$sDisplayValue = $oLnk->GetEditValue($sFieldCode);
$oAttDef = MetaModel::GetAttributeDef($this->m_sLinkedClass, $sFieldCode);
$aRow[$sRowFieldCode] = '<div class="field_container" style="border:none;"><div class="field_data"><div class="field_value">'
.cmdbAbstractObject::GetFormElementForField(
$oP,
$this->m_sLinkedClass,
$sFieldCode,
$oAttDef,
$sValue,
$sDisplayValue,
$sSafeFieldId,
$sNameSuffix,
0,
$aArgs
)
.'</div></div></div>';
}
private function GetFieldId($iLnkId, $sFieldCode, $bSafe = true)
{
$sFieldId = $this->m_iInputId.'_'.$sFieldCode.'['.$iLnkId.']';
return ($bSafe) ? utils::GetSafeId($sFieldId) : $sFieldId;
}
private function AddWizardHelperInit($oP, $sWizardHelperVarName, $sWizardHelperClass, $sState, $aFieldsMap): void
{
$iFieldsCount = count($aFieldsMap);
$sJsonFieldsMap = json_encode($aFieldsMap);
$oP->add_script(
<<<JS
var $sWizardHelperVarName = new WizardHelper('$sWizardHelperClass', '', '$sState');
$sWizardHelperVarName.SetFieldsMap($sJsonFieldsMap);
$sWizardHelperVarName.SetFieldsCount($iFieldsCount);
$sWizardHelperVarName.SetReturnNotEditableFields(true);
$sWizardHelperVarName.SetWizHelperJsVarName('$sWizardHelperVarName');
JS
);
}
/**
* Display the table with the form for editing all the links at once
* @param WebPage $oP The web page used for the output
*
* @param array $aConfig The table's header configuration
* @param array $aData The tabular data to be displayed
* @return string Html fragment representing the form table
*
* @return \Combodo\iTop\Application\UI\Base\Component\DataTable\StaticTable\FormTable\FormTable
*/
protected function DisplayFormTable(WebPage $oP, $aConfig, $aData)
protected function GetFormTableBlock($aConfig, $aData)
{
$sHtml = "<input type=\"hidden\" name=\"attr_{$this->m_sAttCode}{$this->m_sNameSuffix}\" value=\"\">";
$sHtml .= "<table class=\"listResults\">\n";
// Header
$sHtml .= "<thead>\n";
$sHtml .= "<tr>\n";
foreach($aConfig as $sName=>$aDef)
{
$sHtml .= "<th title=\"".$aDef['description']."\">".$aDef['label']."</th>\n";
}
$sHtml .= "</tr>\n";
$sHtml .= "</thead>\n";
// Content
$sHtml .= "</tbody>\n";
$sEmptyRowStyle = '';
if (count($aData) != 0)
{
$sEmptyRowStyle = 'style="display:none;"';
}
foreach($aData as $iRowId => $aRow)
{
$sHtml .= $this->DisplayFormRow($oP, $aConfig, $aRow, $iRowId);
}
$sHtml .= "<tr $sEmptyRowStyle id=\"{$this->m_sAttCode}{$this->m_sNameSuffix}_empty_row\"><td colspan=\"".count($aConfig)."\" style=\"text-align:center;\">".Dict::S('UI:Message:EmptyList:UseAdd')."</td></tr>";
$sHtml .= "</tbody>\n";
// Footer
$sHtml .= "</table>\n";
return $sHtml;
return DataTableUIBlockFactory::MakeForForm("{$this->m_sAttCode}{$this->m_sNameSuffix}", $aConfig, $aData);
}
@@ -343,63 +345,65 @@ EOF
*
* @return string The HTML fragment to be inserted into the page
* @throws \ArchivedObjectException
* @throws \ConfigException
* @throws \CoreException
* @throws \DictExceptionMissingString
* @throws \CoreUnexpectedValue
* @throws \MySQLException
* @throws \ReflectionException
* @throws \Twig\Error\LoaderError
* @throws \Twig\Error\RuntimeError
* @throws \Twig\Error\SyntaxError
*/
public function Display(WebPage $oPage, $oValue, $aArgs, $sFormPrefix, $oCurrentObj)
public function Display(WebPage $oPage, $oValue, $aArgs, $sFormPrefix, $oCurrentObj): string
{
$sHtmlValue = '';
$sHtmlValue .= "<div id=\"linkedset_{$this->m_sAttCode}{$this->m_sNameSuffix}\">\n";
$sHtmlValue .= "<input type=\"hidden\" id=\"{$sFormPrefix}{$this->m_iInputId}\">\n";
$sLinkedSetId = "{$this->m_sAttCode}{$this->m_sNameSuffix}";
$oBlock = new BlockIndirectLinksEdit("linkedset_{$sLinkedSetId}", ["ibo-block-indirect-links--edit"]);
$oBlock->sLinkedSetId = $sLinkedSetId;
$oBlock->sClass = $this->m_sClass;
$oBlock->sAttCode = $this->m_sAttCode;
$oBlock->iInputId = $this->m_iInputId;
$oBlock->sNameSuffix = $this->m_sNameSuffix;
$oBlock->bDuplicates = ($this->m_bDuplicatesAllowed) ? 'true' : 'false';
$oBlock->oWizHelper = 'oWizardHelper'.$sFormPrefix;
$oBlock->sExtKeyToRemote = $this->m_sExtKeyToRemote;
// Don't automatically launch the search if the table is huge
$oBlock->bJSDoSearch = utils::IsHighCardinality($this->m_sRemoteClass) ? 'false' : 'true';
$oBlock->sFormPrefix = $sFormPrefix;
$oBlock->sRemoteClass = $this->m_sRemoteClass;
$oValue->Rewind();
$aForm = array();
$iAddedId = -1; // Unique id for new links
$sDuplicates = ($this->m_bDuplicatesAllowed) ? 'true' : 'false';
// Don't automatically launch the search if the table is huge
$bDoSearch = !utils::IsHighCardinality($this->m_sRemoteClass);
$sJSDoSearch = $bDoSearch ? 'true' : 'false';
$sWizHelper = 'oWizardHelper'.$sFormPrefix;
$oPage->add_ready_script(<<<EOF
oWidget{$this->m_iInputId} = new LinksWidget('{$this->m_sAttCode}{$this->m_sNameSuffix}', '{$this->m_sClass}', '{$this->m_sAttCode}', '{$this->m_iInputId}', '{$this->m_sNameSuffix}', $sDuplicates, $sWizHelper, '{$this->m_sExtKeyToRemote}', $sJSDoSearch);
oWidget{$this->m_iInputId}.Init();
EOF
);
while($oCurrentLink = $oValue->Fetch())
while ($oCurrentLink = $oValue->Fetch())
{
// We try to retrieve the remote object as usual
$oLinkedObj = MetaModel::GetObject($this->m_sRemoteClass, $oCurrentLink->Get($this->m_sExtKeyToRemote), false /* Must not be found */);
// We try to retrieve the remote object as usual
$oLinkedObj = MetaModel::GetObject($this->m_sRemoteClass, $oCurrentLink->Get($this->m_sExtKeyToRemote),
false /* Must not be found */);
// If successful, it means that we can edit its link
if($oLinkedObj !== null)
{
$bReadOnly = false;
}
// Else we retrieve it without restrictions (silos) and will display its link as readonly
else
{
$bReadOnly = true;
$oLinkedObj = MetaModel::GetObject($this->m_sRemoteClass, $oCurrentLink->Get($this->m_sExtKeyToRemote), false /* Must not be found */, true);
}
if ($oLinkedObj !== null) {
$bReadOnly = false;
} // Else we retrieve it without restrictions (silos) and will display its link as readonly
else {
$bReadOnly = true;
$oLinkedObj = MetaModel::GetObject($this->m_sRemoteClass, $oCurrentLink->Get($this->m_sExtKeyToRemote), false /* Must not be found */, true);
}
if ($oCurrentLink->IsNew())
{
$key = $iAddedId--;
}
else
{
$key = $oCurrentLink->GetKey();
}
$aForm[$key] = $this->GetFormRow($oPage, $oLinkedObj, $oCurrentLink, $aArgs, $oCurrentObj, $key, $bReadOnly);
if ($oCurrentLink->IsNew()) {
$key = $iAddedId--;
} else {
$key = $oCurrentLink->GetKey();
}
$aForm[$key] = $this->GetFormRow($oPage, $oLinkedObj, $oCurrentLink, $aArgs, $oCurrentObj, $key, $bReadOnly);
}
$sHtmlValue .= $this->DisplayFormTable($oPage, $this->m_aTableConfig, $aForm);
$oDataTable = DataTableUIBlockFactory::MakeForForm("{$this->m_sAttCode}{$this->m_sNameSuffix}", $this->m_aTableConfig, $aForm);
$oDataTable->SetOptions(['select_mode' => 'custom']);
$oBlock->AddSubBlock($oDataTable);
$sHtmlValue .= "<span style=\"float:left;\">&nbsp;&nbsp;&nbsp;<img src=\"../images/tv-item-last.gif\">&nbsp;&nbsp;<input id=\"{$this->m_sAttCode}{$this->m_sNameSuffix}_btnRemove\" type=\"button\" value=\"".Dict::S('UI:RemoveLinkedObjectsOf_Class')."\" onClick=\"oWidget{$this->m_iInputId}.RemoveSelected();\" >";
$sHtmlValue .= "&nbsp;&nbsp;&nbsp;<input id=\"{$this->m_sAttCode}{$this->m_sNameSuffix}_btnAdd\" type=\"button\" value=\"".Dict::Format('UI:AddLinkedObjectsOf_Class', MetaModel::GetName($this->m_sRemoteClass))."\" onClick=\"oWidget{$this->m_iInputId}.AddObjects();\"><span id=\"{$this->m_sAttCode}{$this->m_sNameSuffix}_indicatorAdd\"></span></span>\n";
$sHtmlValue .= "<span style=\"clear:both;\"><p>&nbsp;</p></span>\n";
$sHtmlValue .= "</div>\n";
$oPage->add_at_the_end("<div id=\"dlg_{$this->m_sAttCode}{$this->m_sNameSuffix}\"></div>"); // To prevent adding forms inside the main form
return $sHtmlValue;
$oBlock->AddControls();
return ConsoleBlockRenderer::RenderBlockTemplateInPage($oPage, $oBlock);
}
/**
@@ -443,55 +447,49 @@ EOF
*/
public function GetObjectPickerDialog($oPage, $oCurrentObj, $sJson, $aAlreadyLinkedIds = array(), $aPrefillFormParam = array())
{
$sHtml = "<div class=\"wizContainer\" style=\"vertical-align:top;\">\n";
$oAlreadyLinkedFilter = new DBObjectSearch($this->m_sRemoteClass);
if (!$this->m_bDuplicatesAllowed && count($aAlreadyLinkedIds) > 0)
{
if (!$this->m_bDuplicatesAllowed && count($aAlreadyLinkedIds) > 0) {
$oAlreadyLinkedFilter->AddCondition('id', $aAlreadyLinkedIds, 'NOTIN');
$oAlreadyLinkedExpression = $oAlreadyLinkedFilter->GetCriteria();
$sAlreadyLinkedExpression = $oAlreadyLinkedExpression->Render();
}
else
{
$sAlreadyLinkedExpression = $oAlreadyLinkedExpression->RenderExpression();
} else {
$sAlreadyLinkedExpression = '';
}
$oFilter = new DBObjectSearch($this->m_sRemoteClass);
if(!empty($oCurrentObj))
{
if (!empty($oCurrentObj)) {
$this->SetSearchDefaultFromContext($oCurrentObj, $oFilter);
$aPrefillFormParam['filter'] = $oFilter;
$aPrefillFormParam['dest_class'] = $this->m_sRemoteClass;
$oCurrentObj->PrefillForm('search', $aPrefillFormParam);
}
$oBlock = new DisplayBlock($oFilter, 'search', false);
$sHtml .= $oBlock->GetDisplay($oPage, "SearchFormToAdd_{$this->m_sAttCode}{$this->m_sNameSuffix}",
$sLinkedSetId = "{$this->m_sAttCode}{$this->m_sNameSuffix}";
$oBlock = new BlockObjectPickerDialog();
$oPage->AddUiBlock($oBlock);
$oBlock->sLinkedSetId = $sLinkedSetId;
$oBlock->iInputId = $this->m_iInputId;
$oBlock->sLinkedClassName = MetaModel::GetName($this->m_sLinkedClass);
$oBlock->sClassName = MetaModel::GetName($this->m_sClass);
$oDisplayBlock = new DisplayBlock($oFilter, 'search', false);
$oBlock->AddSubBlock($oDisplayBlock->GetDisplay($oPage, "SearchFormToAdd_{$sLinkedSetId}",
array(
'menu' => false,
'result_list_outer_selector' => "SearchResultsToAdd_{$this->m_sAttCode}{$this->m_sNameSuffix}",
'table_id' => 'add_'.$this->m_sAttCode,
'table_inner_id' => "ResultsToAdd_{$this->m_sAttCode}{$this->m_sNameSuffix}",
'result_list_outer_selector' => "SearchResultsToAdd_{$sLinkedSetId}",
'table_id' => "add_{$sLinkedSetId}",
'table_inner_id' => "ResultsToAdd_{$sLinkedSetId}",
'selection_mode' => true,
'json' => $sJson,
'cssCount' => '#count_'.$this->m_sAttCode.$this->m_sNameSuffix,
'query_params' => $oFilter->GetInternalParams(),
'hidden_criteria' => $sAlreadyLinkedExpression,
));
$sHtml .= "<form id=\"ObjectsAddForm_{$this->m_sAttCode}{$this->m_sNameSuffix}\">\n";
$sHtml .= "<div id=\"SearchResultsToAdd_{$this->m_sAttCode}{$this->m_sNameSuffix}\" style=\"vertical-align:top;background: #fff;height:100%;overflow:auto;padding:0;border:0;\">\n";
$sHtml .= "<div style=\"background: #fff; border:0; text-align:center; vertical-align:middle;\"><p>".Dict::S('UI:Message:EmptyList:UseSearchForm')."</p></div>\n";
$sHtml .= "</div>\n";
$sHtml .= "<input type=\"hidden\" id=\"count_{$this->m_sAttCode}{$this->m_sNameSuffix}\" value=\"0\"/>";
$sHtml .= "<input type=\"button\" value=\"".Dict::S('UI:Button:Cancel')."\" onClick=\"$('#dlg_{$this->m_sAttCode}{$this->m_sNameSuffix}').dialog('close');\">&nbsp;&nbsp;<input id=\"btn_ok_{$this->m_sAttCode}{$this->m_sNameSuffix}\" disabled=\"disabled\" type=\"button\" onclick=\"return oWidget{$this->m_iInputId}.DoAddObjects(this.id);\" value=\"".Dict::S('UI:Button:Add')."\">";
$sHtml .= "</div>\n";
$sHtml .= "</form>\n";
$oPage->add($sHtml);
$oPage->add_ready_script("$('#dlg_{$this->m_sAttCode}{$this->m_sNameSuffix}').dialog({ width: $(window).width()*0.8, height: $(window).height()*0.8, autoOpen: false, modal: true, resizeStop: oWidget{$this->m_iInputId}.UpdateSizes });");
$oPage->add_ready_script("$('#dlg_{$this->m_sAttCode}{$this->m_sNameSuffix}').dialog('option', {title:'".addslashes(Dict::Format('UI:AddObjectsOf_Class_LinkedWith_Class', MetaModel::GetName($this->m_sLinkedClass), MetaModel::GetName($this->m_sClass)))."'});");
$oPage->add_ready_script("$('#SearchFormToAdd_{$this->m_sAttCode}{$this->m_sNameSuffix} form').bind('submit.uilinksWizard', oWidget{$this->m_iInputId}.SearchObjectsToAdd);");
$oPage->add_ready_script("$('#SearchFormToAdd_{$this->m_sAttCode}{$this->m_sNameSuffix}').resize(oWidget{$this->m_iInputId}.UpdateSizes);");
)));
$oBlock->AddForm();
}
/**
@@ -541,17 +539,44 @@ EOF
$aLinkedObjectIds = utils::ReadMultipleSelection($oFullSetFilter);
$iAdditionId = $iMaxAddedId + 1;
foreach($aLinkedObjectIds as $iObjectId)
{
foreach ($aLinkedObjectIds as $iObjectId) {
$oLinkedObj = MetaModel::GetObject($this->m_sRemoteClass, $iObjectId, false);
if (is_object($oLinkedObj))
{
if (is_object($oLinkedObj)) {
$aRow = $this->GetFormRow($oP, $oLinkedObj, $iObjectId, array(), $oCurrentObj, $iAdditionId); // Not yet created link get negative Ids
$oP->add($this->DisplayFormRow($oP, $this->m_aTableConfig, $aRow, -$iAdditionId));
$oRow = new FormTableRow("{$this->m_sAttCode}{$this->m_sNameSuffix}", $this->m_aTableConfig, $aRow, -$iAdditionId);
$oP->AddUiBlock($oRow);
$iAdditionId++;
} else {
$oP->p(Dict::Format('UI:Error:Object_Class_Id_NotFound', $this->m_sLinkedClass, $iObjectId));
}
else
{
}
}
/**
* @param WebPage $oP
* @param int $iMaxAddedId
* @param $oFullSetFilter
* @param DBObject $oCurrentObj
*
* @throws \ArchivedObjectException
* @throws \CoreException
*/
public function DoAddIndirectLinks(JsonPage $oP, $iMaxAddedId, $oFullSetFilter, $oCurrentObj)
{
$aLinkedObjectIds = utils::ReadMultipleSelection($oFullSetFilter);
$iAdditionId = $iMaxAddedId + 1;
foreach ($aLinkedObjectIds as $iObjectId) {
$oLinkedObj = MetaModel::GetObject($this->m_sRemoteClass, $iObjectId, false);
if (is_object($oLinkedObj)) {
$aRow = $this->GetFormRow($oP, $oLinkedObj, $iObjectId, array(), $oCurrentObj, $iAdditionId); // Not yet created link get negative Ids
$aData = [];
foreach ($aRow as $item) {
$aData[] = $item;
}
$oP->AddData($aData);
$iAdditionId++;
} else {
$oP->p(Dict::Format('UI:Error:Object_Class_Id_NotFound', $this->m_sLinkedClass, $iObjectId));
}
}

View File

@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2010-2012 Combodo SARL
// Copyright (C) 2010-2021 Combodo SARL
//
// This file is part of iTop.
//
@@ -20,11 +20,10 @@
* Class UIPasswordWidget
* UI wdiget for displaying and editing one-way encrypted passwords
*
* @copyright Copyright (C) 2010-2012 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
require_once(APPROOT.'/application/webpage.class.inc.php');
require_once(APPROOT.'/application/displayblock.class.inc.php');
class UIPasswordWidget
@@ -66,12 +65,12 @@ class UIPasswordWidget
$sHtmlValue .= '<input type="hidden" id="'.$this->iId.'_changed" name="attr_'.$sCode.'[changed]" value="'.$sChangedValue.'"/>';
$sHtmlValue .= '</div>';
$sHtmlValue .= '<span class="form_validation" id="v_'.$this->iId.'"></span><span class="field_status" id="fstatus_'.$this->iId.'"></span>';
$sHtmlValue .= '<span class="form_validation ibo-field-validation" id="v_'.$this->iId.'"></span><span class="field_status" id="fstatus_'.$this->iId.'"></span>';
$oPage->add_ready_script("$('#$this->iId').bind('keyup change', function(evt) { return PasswordFieldChanged('$this->iId') } );"); // Bind to a custom event: validate
$oPage->add_ready_script("$('#$this->iId').bind('keyup change validate', function(evt, sFormId) { return ValidatePasswordField('$this->iId', sFormId) } );"); // Bind to a custom event: validate
$oPage->add_ready_script("$('#{$this->iId}_confirm').bind('keyup change', function(evt, sFormId) { return ValidatePasswordField('$this->iId', sFormId) } );"); // Bind to a custom event: validate
$oPage->add_ready_script("$('#{$this->iId}').bind('update', function(evt, sFormId)
$oPage->add_ready_script("$('#$this->iId').on('keyup change', function(evt) { return PasswordFieldChanged('$this->iId') } );"); // Bind to a custom event: validate
$oPage->add_ready_script("$('#$this->iId').on('keyup change validate', function(evt, sFormId) { return ValidatePasswordField('$this->iId', sFormId) } );"); // Bind to a custom event: validate
$oPage->add_ready_script("$('#{$this->iId}_confirm').on('keyup change', function(evt, sFormId) { return ValidatePasswordField('$this->iId', sFormId) } );"); // Bind to a custom event: validate
$oPage->add_ready_script("$('#{$this->iId}').on('update', function(evt, sFormId)
{
if ($(this).prop('disabled'))
{

View File

@@ -1,7 +1,7 @@
<?php
/**
*
* Copyright (C) 2010-2018 Combodo SARL
* Copyright (C) 2010-2021 Combodo SARL
*
* This file is part of iTop.
*
@@ -21,7 +21,6 @@
*/
require_once(APPROOT.'/application/webpage.class.inc.php');
require_once(APPROOT.'/application/displayblock.class.inc.php');
class UISearchFormForeignKeys
@@ -41,12 +40,11 @@ class UISearchFormForeignKeys
*/
public function ShowModalSearchForeignKeys($oPage, $sTitle)
{
$sHtml = "<div class=\"wizContainer\" style=\"vertical-align:top;\">\n";
$oFilter = new DBObjectSearch($this->m_sRemoteClass);
$oBlock = new DisplayBlock($oFilter, 'search', false);
$sHtml .= $oBlock->GetDisplay($oPage, "SearchFormToAdd_{$this->m_iInputId}",
$oPage->AddUiBlock($oBlock->GetDisplay($oPage, "SearchFormToAdd_{$this->m_iInputId}",
array(
'menu' => false,
'result_list_outer_selector' => "SearchResultsToAdd_{$this->m_iInputId}",
@@ -55,20 +53,53 @@ class UISearchFormForeignKeys
'selection_mode' => true,
'cssCount' => "#count_{$this->m_iInputId}",
'query_params' => $oFilter->GetInternalParams(),
));
$sHtml .= "<form id=\"ObjectsAddForm_{$this->m_iInputId}\">\n";
$sHtml .= "<div id=\"SearchResultsToAdd_{$this->m_iInputId}\" style=\"vertical-align:top;background: #fff;height:100%;overflow:auto;padding:0;border:0;\">\n";
$sHtml .= "<div style=\"background: #fff; border:0; text-align:center; vertical-align:middle;\"><p>".Dict::S('UI:Message:EmptyList:UseSearchForm')."</p></div>\n";
$sHtml .= "</div>\n";
$sHtml .= "<input type=\"hidden\" id=\"count_{$this->m_iInputId}\" value=\"0\"/>";
$sHtml .= "<input type=\"button\" value=\"".Dict::S('UI:Button:Cancel')."\" onClick=\"$('#dlg_{$this->m_iInputId}').dialog('close');\">&nbsp;&nbsp;<input id=\"btn_ok_{$this->m_iInputId}\" disabled=\"disabled\" type=\"button\" onclick=\"return oForeignKeysWidget{$this->m_iInputId}.DoAddObjects(this.id);\" value=\"".Dict::S('UI:Button:Add')."\">";
$sHtml .= "</div>\n";
$sHtml .= "</form>\n";
$oPage->add($sHtml);
$oPage->add_ready_script("$('#dlg_{$this->m_iInputId}').dialog({ width: $(window).width()*0.8, height: $(window).height()*0.8, autoOpen: false, modal: true, resizeStop: oForeignKeysWidget{$this->m_iInputId}.UpdateSizes });");
$oPage->add_ready_script("$('#dlg_{$this->m_iInputId}').dialog('option', {title:'$sTitle'});");
$oPage->add_ready_script("$('#SearchFormToAdd_{$this->m_iInputId} form').bind('submit.uilinksWizard', oForeignKeysWidget{$this->m_iInputId}.SearchObjectsToAdd);");
$oPage->add_ready_script("$('#SearchFormToAdd_{$this->m_iInputId}').resize(oForeignKeysWidget{$this->m_iInputId}.UpdateSizes);");
)));
$sEmptyList = Dict::S('UI:Message:EmptyList:UseSearchForm');
$sCancel = Dict::S('UI:Button:Cancel');
$sAdd = Dict::S('UI:Button:Add');
$oPage->add(<<<HTML
<form id="ObjectsAddForm_{$this->m_iInputId}">
<div id="SearchResultsToAdd_{$this->m_iInputId}" style="vertical-align:top;background: #fff;height:100%;overflow:auto;padding:0;border:0;">
<div style="background: #fff; border:0; text-align:center; vertical-align:middle;"><p>{$sEmptyList}</p></div>
</div>
<input type="hidden" id="count_{$this->m_iInputId}" value="0"/>
</form>
HTML
);
$oPage->add_ready_script(
<<<JS
$('#dlg_{$this->m_iInputId}').dialog({
width: $(window).width()*0.8,
height: $(window).height()*0.8,
autoOpen: false,
modal: true,
resizeStop: oForeignKeysWidget{$this->m_iInputId}.UpdateSizes,
buttons: [
{
text: Dict.S('UI:Button:Cancel'),
class: "cancel ibo-is-alternative ibo-is-neutral",
click: function() {
$('#dlg_{$this->m_iInputId}').dialog('close');
}
},
{
text: Dict.S('UI:Button:Add'),
id: 'btn_ok_{$this->m_iInputId}',
class: "ok ibo-is-regular ibo-is-primary",
click: function() {
oForeignKeysWidget{$this->m_iInputId}.DoAddObjects(this.id);
}
},
],
});
$('#dlg_{$this->m_iInputId}').dialog('option', {title:'$sTitle'});
$('#SearchFormToAdd_{$this->m_iInputId} form').on('submit.uilinksWizard', oForeignKeysWidget{$this->m_iInputId}.SearchObjectsToAdd);
$('#SearchFormToAdd_{$this->m_iInputId}').resize(oForeignKeysWidget{$this->m_iInputId}.UpdateSizes);
JS
);
}
public function GetFullListForeignKeysFromSelection($oPage, $oFullSetFilter)
@@ -112,4 +143,4 @@ class UISearchFormForeignKeys
array('menu' => false, 'cssCount' => "#count_{$this->m_iInputId}", 'selection_mode' => true, 'table_id' => "add_{$this->m_iInputId}"));
}
}
}

View File

@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2010-2012 Combodo SARL
// Copyright (C) 2010-2021 Combodo SARL
//
// This file is part of iTop.
//
@@ -20,7 +20,7 @@
/**
* Class UIWizard
*
* @copyright Copyright (C) 2010-2012 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
@@ -270,23 +270,20 @@ $sJSHandlerCode
$aFields = array(); // reset
foreach(MetaModel::ListAttributeDefs($this->m_sClass) as $sAttCode=>$oAttDef)
{
$iOptions = (isset($aStates[$this->m_sTargetState]['attribute_list'][$sAttCode])) ? $aStates[$this->m_sTargetState]['attribute_list'][$sAttCode] : 0;
if ( ($sStateAttCode != $sAttCode) &&
(!$oAttDef->IsExternalField()) &&
(($iOptions & (OPT_ATT_HIDDEN | OPT_ATT_READONLY)) == 0) &&
(!isset($aFieldsDone[$sAttCode])) )
{
// 'State', external fields, read-only and hidden fields
$iOptions = (isset($aStates[$this->m_sTargetState]['attribute_list'][$sAttCode])) ? $aStates[$this->m_sTargetState]['attribute_list'][$sAttCode] : 0;
if (($sStateAttCode != $sAttCode) &&
(!$oAttDef->IsExternalField()) &&
($oAttDef->IsWritable()) &&
(($iOptions & (OPT_ATT_HIDDEN | OPT_ATT_READONLY)) == 0) &&
(!isset($aFieldsDone[$sAttCode]))) {
// 'State', external fields, read-only (both because of the flags or the attribute type) and hidden fields
// and fields that are already listed in the wizard
// are removed from the 'optional' part of the wizard
$oAttDef = MetaModel::GetAttributeDef($this->m_sClass, $sAttCode);
$aPrerequisites = $oAttDef->GetPrerequisiteAttributes();
$aFields[$sAttCode] = array();
foreach($aPrerequisites as $sCode)
{
if (!isset($aFieldsDone[$sCode]))
{
foreach ($aPrerequisites as $sCode) {
if (!isset($aFieldsDone[$sCode])) {
// retain only the dependencies that were not covered
// in the 'mandatory' part of the wizard
$aFields[$sAttCode][$sCode] = '';

View File

@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2010-2012 Combodo SARL
// Copyright (C) 2010-2021 Combodo SARL
//
// This file is part of iTop.
//
@@ -19,7 +19,7 @@
/**
* Store and retrieve user custom dashboards
*
* @copyright Copyright (C) 2010-2012 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
require_once(APPROOT.'/core/dbobject.class.php');

View File

@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2010-2017 Combodo SARL
// Copyright (C) 2010-2021 Combodo SARL
//
// This file is part of iTop.
//
@@ -19,7 +19,7 @@
/**
* Store and retrieve user's preferences (i.e persistent per user settings)
*
* @copyright Copyright (C) 2010-2017 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
require_once(APPROOT.'/core/dbobject.class.php');
@@ -34,165 +34,215 @@ require_once(APPROOT.'/core/userrights.class.inc.php');
*/
class appUserPreferences extends DBObject
{
private static $oUserPrefs = null; // Local cache
/** @var array Associative array of the prefs. of users: <USER_ID> => <PREFS> */
private static $aUsersPrefs = []; // Local cache
/**
* Get the value of the given property/preference
* If not set, the default value will be returned
*
* @param string $sCode Code/Name of the property to set
* @param string $sDefaultValue The default value
* @return string The value of the property for the current user
* @param mixed $defaultValue The default value
* @param string|null $sUserId Added in 3.0.0. ID of the user we want the pref. from, default is the current user
*
* @return mixed The value of the property for the current user
* @throws \CoreException
* @throws \CoreUnexpectedValue
* @throws \MySQLException
* @throws \OQLException
* @since 3.0.0 Added the $sUserId parameter
*/
public static function GetPref($sCode, $sDefaultValue)
public static function GetPref($sCode, $defaultValue, ?string $sUserId = null)
{
if (self::$oUserPrefs == null)
{
self::Load();
if (null === $sUserId) {
$sUserId = UserRights::GetUserId();
}
$aPrefs = self::$oUserPrefs->Get('preferences');
if (array_key_exists($sCode, $aPrefs))
{
if (false === array_key_exists($sUserId, self::$aUsersPrefs)) {
self::Load($sUserId);
}
$aPrefs = self::$aUsersPrefs[$sUserId]->Get('preferences');
if (array_key_exists($sCode, $aPrefs)) {
return $aPrefs[$sCode];
}
else
{
return $sDefaultValue;
} else {
return $defaultValue;
}
}
/**
* Set the value for a given preference, and stores it into the database
* Set the value for a given preference for the current user, and stores it into the database
*
* @param string $sCode Code/Name of the property/preference to set
* @param string $sValue Value to set
* @param mixed $value Value to set
*
* @return void
* @throws \CoreException
* @throws \CoreUnexpectedValue
* @throws \MySQLException
*/
public static function SetPref($sCode, $sValue)
public static function SetPref($sCode, $value)
{
if (self::$oUserPrefs == null)
{
self::Load();
$sUserId = UserRights::GetUserId();
if (false === array_key_exists($sUserId, self::$aUsersPrefs)) {
self::Load($sUserId);
}
$aPrefs = self::$oUserPrefs->Get('preferences');
if (array_key_exists($sCode, $aPrefs) && ($aPrefs[$sCode] === $sValue))
{
$aPrefs = self::$aUsersPrefs[$sUserId]->Get('preferences');
if (array_key_exists($sCode, $aPrefs) && ($aPrefs[$sCode] === $value)) {
// Do not write it again
}
else
{
$aPrefs[$sCode] = $sValue;
self::$oUserPrefs->Set('preferences', $aPrefs);
} else {
$aPrefs[$sCode] = $value;
self::$aUsersPrefs[$sUserId]->Set('preferences', $aPrefs);
self::Save();
}
}
/**
* Clears the value for a given preference (or list of preferences that matches a pattern), and updates the database
* Clears the value for a given preference (or list of preferences that matches a pattern) for the current user, and updates the database
*
* @param string $sCodeOrPattern Code/Pattern of the properties/preferences to reset
* @param boolean $bPattern Whether or not the supplied code is a PCRE pattern
*
* @return void
* @throws \CoreException
* @throws \CoreUnexpectedValue
* @throws \MySQLException
*/
public static function UnsetPref($sCodeOrPattern, $bPattern = false)
{
if (self::$oUserPrefs == null)
{
self::Load();
$sUserId = UserRights::GetUserId();
if (false === array_key_exists($sUserId, self::$aUsersPrefs)) {
self::Load($sUserId);
}
$aPrefs = self::$oUserPrefs->Get('preferences');
if ($bPattern)
{
$aPrefs = self::$aUsersPrefs[$sUserId]->Get('preferences');
if ($bPattern) {
// the supplied code is a pattern, clear all preferences that match
foreach($aPrefs as $sKey => $void)
{
if (preg_match($sCodeOrPattern, $sKey))
{
foreach ($aPrefs as $sKey => $void) {
if (preg_match($sCodeOrPattern, $sKey)) {
unset($aPrefs[$sKey]);
}
}
self::$oUserPrefs->Set('preferences', $aPrefs);
}
else
{
self::$aUsersPrefs[$sUserId]->Set('preferences', $aPrefs);
} else {
unset($aPrefs[$sCodeOrPattern]);
self::$oUserPrefs->Set('preferences', $aPrefs);
self::$aUsersPrefs[$sUserId]->Set('preferences', $aPrefs);
}
// Save only if needed
if (self::$oUserPrefs->IsModified())
{
if (self::$aUsersPrefs[$sUserId]->IsModified()) {
self::Save();
}
}
/**
* Call this function to get all the preferences for the user, packed as a JSON object
* Call this function to get all the preferences for the current user, packed as a JSON object
*
* @return string JSON representation of the preferences
* @throws \CoreException
* @throws \CoreUnexpectedValue
* @throws \MySQLException
*/
public static function GetAsJSON()
{
if (self::$oUserPrefs == null)
{
self::Load();
$sUserId = UserRights::GetUserId();
if (false === array_key_exists($sUserId, self::$aUsersPrefs)) {
self::Load($sUserId);
}
$aPrefs = self::$oUserPrefs->Get('preferences');
$aPrefs = self::$aUsersPrefs[$sUserId]->Get('preferences');
return json_encode($aPrefs);
}
/**
* Call this function if the user has changed (like when doing a logoff...)
*
* @return void
*/
public static function ResetPreferences()
{
self::$oUserPrefs = null;
self::$aUsersPrefs = [];
}
/**
* Call this function to ERASE all the preferences from the current user
* Call this function to ERASE all the preferences from the current user (only in memory, not in DB)
*
* @return void
*/
public static function ClearPreferences()
{
self::$oUserPrefs = null;
$sUserId = UserRights::GetUserId();
unset(self::$aUsersPrefs[$sUserId]);
}
/**
* Save preferences of the current user in the DB, for now we don't allow interfering with an other users preferences
*
* @return void;
*/
protected static function Save()
{
if (self::$oUserPrefs != null)
{
if (self::$oUserPrefs->IsModified())
{
$sUserId = UserRights::GetUserId();
if (array_key_exists($sUserId, self::$aUsersPrefs)) {
if (self::$aUsersPrefs[$sUserId]->IsModified()) {
utils::PushArchiveMode(false);
self::$oUserPrefs->DBUpdate();
self::$aUsersPrefs[$sUserId]->DBUpdate();
utils::PopArchiveMode();
}
}
}
/**
* Loads the preferences for the current user, creating the record in the database
* if needed
*
* @param string|null $sUserId Added in 3.0.0. ID of the user to load the prefs for, if null then current user will be used.
*
* @return void;
* @throws \CoreException
* @throws \CoreUnexpectedValue
* @throws \MySQLException
* @throws \OQLException
* @since 3.0.0 Added $sUserId parameter
*/
protected static function Load()
protected static function Load(?string $sUserId = null)
{
if (self::$oUserPrefs != null) return;
// Already in cache
if (array_key_exists($sUserId, self::$aUsersPrefs)) {
return;
}
if (null === $sUserId) {
$sUserId = UserRights::GetUserId();
}
$oSearch = new DBObjectSearch('appUserPreferences');
$oSearch->AddCondition('userid', UserRights::GetUserId(), '=');
$oSearch->AddCondition('userid', $sUserId, '=');
$oSet = new DBObjectSet($oSearch);
$oObj = $oSet->Fetch();
if ($oObj == null)
{
if ($oObj == null) {
// No prefs (yet) for this user, create the object
$oObj = new appUserPreferences();
$oObj->Set('userid', UserRights::GetUserId());
$oObj->Set('userid', $sUserId);
$oObj->Set('preferences', array()); // Default preferences: an empty array
try
{
try {
utils::PushArchiveMode(false);
$oObj->DBInsert();
utils::PopArchiveMode();
}
catch(Exception $e)
{
catch (Exception $e) {
// Ignore errors
}
}
self::$oUserPrefs = $oObj;
self::$aUsersPrefs[$sUserId] = $oObj;
}
/**
* @throws \CoreException
*/
public static function Init()
{
$aParams = array
@@ -213,9 +263,22 @@ class appUserPreferences extends DBObject
}
/**
* Overloading this function here to secure a fix done right before the release
* The real fix should be to implement this verb in DBObject
*/
* Overloading this function here to secure a fix done right before the release
* The real fix should be to implement this verb in DBObject
*
* @param \CMDBChange $oChange
* @param bool|null $bSkipStrongSecurity
* @param \DeletionPlan|null $oDeletionPlan
*
* @throws \ArchivedObjectException
* @throws \CoreCannotSaveObjectException
* @throws \CoreException
* @throws \CoreUnexpectedValue
* @throws \DeleteException
* @throws \MySQLException
* @throws \MySQLHasGoneAwayException
* @throws \OQLException
*/
public function DBDeleteTracked(CMDBChange $oChange, $bSkipStrongSecurity = null, &$oDeletionPlan = null)
{
utils::PushArchiveMode(false);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2010-2016 Combodo SARL
// Copyright (C) 2010-2021 Combodo SARL
//
// This file is part of iTop.
//
@@ -20,7 +20,7 @@
/**
* Class WizardHelper
*
* @copyright Copyright (C) 2010-2016 Combodo SARL
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
@@ -335,20 +335,41 @@ class WizardHelper
{
$sResult = $this->m_aData['m_oFieldsMap'][$sFieldName];
}
return $sResult;
}
public function GetReturnNotEditableFields()
{
return $this->m_aData['m_bReturnNotEditableFields'] ?? false;
}
/**
* @return string JS code to be executed for fields update
* @since 3.0.0 N°3198
*/
public function GetJsForUpdateFields()
{
$sWizardHelperJsVar = ($this->m_aData['m_sWizHelperJsVarName']) ?? 'oWizardHelper'.$this->GetFormPrefix();
$sWizardHelperJson = $this->ToJSON();
return <<<JS
{$sWizardHelperJsVar}.m_oData = {$sWizardHelperJson};
{$sWizardHelperJsVar}.UpdateFields();
JS;
}
static function ParseJsonSet($oMe, $sLinkClass, $sExtKeyToMe, $sJsonSet)
{
$aSet = json_decode($sJsonSet, true); // true means hash array instead of object
$oSet = CMDBObjectSet::FromScratch($sLinkClass);
foreach($aSet as $aLinkObj)
foreach ($aSet as $aLinkObj)
{
$oLink = MetaModel::NewObject($sLinkClass);
foreach($aLinkObj as $sAttCode => $value)
foreach ($aLinkObj as $sAttCode => $value)
{
$oAttDef = MetaModel::GetAttributeDef($sLinkClass, $sAttCode);
if (($oAttDef->IsExternalKey()) && ($value != '') && ($value > 0))
if (($oAttDef->IsExternalKey()) && ($value != '') && ($value > 0))
{
// For external keys: load the target object so that external fields
// get filled too

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