├── .github
├── ISSUE_TEMPLATE
│ └── bug_report.yml
├── dependabot.yml
├── label-commenter-config.yml
├── pull_request_template.md
└── workflows
│ ├── auto-tag-new-version.yml
│ ├── close_stale_issue.yml
│ ├── continuous-integration.yml
│ ├── label-commenter.yml
│ ├── locales-sync.yml
│ ├── locales-update-source.yml
│ └── release.yml
├── .gitignore
├── .phpcs.xml
├── .tx
└── config
├── CHANGELOG.md
├── LICENSE
├── README.md
├── SECURITY.md
├── ajax
├── dropdownChooseField.php
├── dropdownMandatory.php
├── dropdownSelectModel.php
├── injection.php
└── results.php
├── composer.json
├── composer.lock
├── css
└── datainjection.css
├── datainjection.png
├── datainjection.xml
├── front
├── clientinjection.form.php
├── export.csv.php
├── export.pdf.php
├── info.form.php
├── mapping.form.php
├── model.form.php
├── model.php
└── popup.php
├── glpi_network.png
├── hook.php
├── inc
├── applianceinjection.class.php
├── autoupdatesysteminjection.class.php
├── backend.class.php
├── backendcsv.class.php
├── backendinterface.class.php
├── budgetinjection.class.php
├── cartridgeiteminjection.class.php
├── certificateinjection.class.php
├── clientinjection.class.php
├── commoninjectionlib.class.php
├── computer_iteminjection.class.php
├── computerinjection.class.php
├── computermodelinjection.class.php
├── computertypeinjection.class.php
├── consumableiteminjection.class.php
├── contact_supplierinjection.class.php
├── contactinjection.class.php
├── contacttypeinjection.class.php
├── contract_iteminjection.class.php
├── contract_supplierinjection.class.php
├── contractinjection.class.php
├── contracttypeinjection.class.php
├── data.class.php
├── databaseinjection.class.php
├── databaseinstanceinjection.class.php
├── devicecaseinjection.class.php
├── devicecasetypeinjection.class.php
├── devicecontrolinjection.class.php
├── devicedriveinjection.class.php
├── deviceecasetypeinjection.class.php
├── deviceharddriveinjection.class.php
├── devicememoryinjection.class.php
├── devicememorytypeinjection.class.php
├── devicemotherboardinjection.class.php
├── devicenetworkcardinjection.class.php
├── deviceprocessorinjection.class.php
├── documentinjection.class.php
├── documenttypeinjection.class.php
├── domaininjection.class.php
├── dropdown.class.php
├── engine.class.php
├── entityinjection.class.php
├── filesystemtypeinjection.class.php
├── group_userinjection.class.php
├── groupinjection.class.php
├── info.class.php
├── infocollection.class.php
├── infocominjection.class.php
├── injectioninterface.class.php
├── injectiontype.class.php
├── interfacetypeinjection.class.php
├── item_operatingsysteminjection.class.php
├── item_softwarelicenseinjection.class.php
├── item_softwareversioninjection.class.php
├── itilcategoryinjection.class.php
├── itilfollowuptemplateinjection.class.php
├── knowbaseitemcategoryinjection.class.php
├── knowbaseiteminjection.class.php
├── locationinjection.class.php
├── manufacturerinjection.class.php
├── mapping.class.php
├── mappingcollection.class.php
├── menu.class.php
├── model.class.php
├── modelcsv.class.php
├── monitorinjection.class.php
├── monitormodelinjection.class.php
├── monitortypeinjection.class.php
├── netpointinjection.class.php
├── networkequipmentinjection.class.php
├── networkequipmentmodelinjection.class.php
├── networkequipmenttypeinjection.class.php
├── networkinjection.class.php
├── networkinterfaceinjection.class.php
├── networknameinjection.class.php
├── networkport_vlaninjection.class.php
├── networkportinjection.class.php
├── notepadinjection.class.php
├── operatingsystemarchitectureinjection.class.php
├── operatingsystemeditioninjection.class.php
├── operatingsysteminjection.class.php
├── operatingsystemkernelinjection.class.php
├── operatingsystemkernelversioninjection.class.php
├── operatingsystemservicepackinjection.class.php
├── operatingsystemversioninjection.class.php
├── peripheralinjection.class.php
├── peripheralmodelinjection.class.php
├── peripheraltypeinjection.class.php
├── phoneinjection.class.php
├── phonemodelinjection.class.php
├── phonepowersupplytypeinjection.class.php
├── phonetypeinjection.class.php
├── printerinjection.class.php
├── printermodelinjection.class.php
├── printertypeinjection.class.php
├── profile.class.php
├── profile_userinjection.class.php
├── profileinjection.class.php
├── requesttypeinjection.class.php
├── session.class.php
├── softwareinjection.class.php
├── softwarelicenseinjection.class.php
├── softwarelicensetypeinjection.class.php
├── softwareversioninjection.class.php
├── solutiontemplateinjection.class.php
├── solutiontypeinjection.class.php
├── stateinjection.class.php
├── supplierinjection.class.php
├── suppliertypeinjection.class.php
├── taskcategoryinjection.class.php
├── tasktemplateinjection.class.php
├── userinjection.class.php
├── virtualmachinestateinjection.class.php
├── virtualmachinesysteminjection.class.php
├── virtualmachinetypeinjection.class.php
├── vlaninjection.class.php
└── webservice.class.php
├── js
└── datainjection.js
├── locales
├── cs_CZ.mo
├── cs_CZ.po
├── datainjection.pot
├── en_GB.mo
├── en_GB.po
├── es_AR.mo
├── es_AR.po
├── es_EC.mo
├── es_EC.po
├── fi_FI.mo
├── fi_FI.po
├── fr_FR.mo
├── fr_FR.po
├── hr_HR.mo
├── hr_HR.po
├── it_IT.mo
├── it_IT.po
├── ja_JP.mo
├── ja_JP.po
├── ko_KR.mo
├── ko_KR.po
├── pt_BR.mo
├── pt_BR.po
├── pt_PT.mo
├── pt_PT.po
├── ru_RU.mo
├── ru_RU.po
├── sk_SK.mo
├── sk_SK.po
├── tr_TR.mo
├── tr_TR.po
├── zh_CN.mo
└── zh_CN.po
├── phpstan.neon
├── pics
├── danger.jpg
├── danger.png
├── datainjection.png
├── failedcsv.png
├── fd_logo.JPG
├── fleche.png
├── logo.png
├── minus.png
├── notok.jpg
├── notok.png
├── ok.jpg
├── ok.png
├── plus.png
├── reportpdf.png
└── seereport.png
├── screenshots
├── datainjection.gif
├── datainjection_conf.png
├── datainjection_import_success.png
└── datainjection_mapping.png
├── setup.php
├── testwebservice.php
└── tools
└── HEADER
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | # Ensure GitHub Actions are used in their latest version
4 | - package-ecosystem: "github-actions"
5 | directory: "/"
6 | schedule:
7 | interval: "monthly"
8 |
9 | # Strategy for composer dependencies
10 | - package-ecosystem: "composer"
11 | directory: "/"
12 | schedule:
13 | interval: "monthly"
14 | allow:
15 | - dependency-type: "direct"
16 | open-pull-requests-limit: 100
17 | versioning-strategy: "increase"
18 | groups:
19 | dev-dependencies:
20 | dependency-type: "development"
21 |
--------------------------------------------------------------------------------
/.github/label-commenter-config.yml:
--------------------------------------------------------------------------------
1 | labels:
2 | - name: "invalid"
3 | labeled:
4 | issue:
5 | body: |
6 | This issue has been closed because you did not provide the requested information.
7 | action: "close"
8 | - name: "support"
9 | labeled:
10 | issue:
11 | body: |
12 | This issue has been closed as we only track bugs here.
13 |
14 | You can get community support on [forums](https://forum.glpi-project.org/) or you can consider [taking a subscription](https://glpi-project.org/subscriptions/) to get professional support.
15 | You can also [contact GLPI editor team](https://portal.glpi-network.com/contact-us) directly.
16 | action: close
17 | - name: "feature suggestion"
18 | labeled:
19 | issue:
20 | body: |
21 | This issue has been closed as we only track bugs here.
22 |
23 | You can open a topic to discuss with community about this enhancement on [suggestion website](https://glpi.userecho.com/).
24 | You can also [contact GLPI editor team](https://portal.glpi-network.com/contact-us) directly if you are willing to sponsor this feature.
25 | action: close
26 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | ## Checklist before requesting a review
2 |
3 | *Please delete options that are not relevant.*
4 |
5 | - [ ] I have performed a self-review of my code.
6 | - [ ] I have added tests (when available) that prove my fix is effective or that my feature works.
7 | - [ ] I have updated the CHANGELOG with a short functional description of the fix or new feature.
8 | - [ ] This change requires a documentation update.
9 |
10 | ## Description
11 |
12 | - It fixes # (issue number, if applicable)
13 | - Here is a brief description of what this PR does
14 |
15 | ## Screenshots (if appropriate):
16 |
--------------------------------------------------------------------------------
/.github/workflows/auto-tag-new-version.yml:
--------------------------------------------------------------------------------
1 | name: "Automatically tag new version"
2 |
3 | on:
4 | push:
5 | branches:
6 | - "main"
7 | paths:
8 | - "setup.php"
9 |
10 | jobs:
11 | auto-tag-new-version:
12 | name: "Automatically tag new version"
13 | uses: "glpi-project/plugin-release-workflows/.github/workflows/auto-tag-new-version.yml@v1"
14 | secrets:
15 | github-token: "${{ secrets.AUTOTAG_TOKEN }}"
16 |
--------------------------------------------------------------------------------
/.github/workflows/close_stale_issue.yml:
--------------------------------------------------------------------------------
1 | name: 'Close stale issues'
2 | on:
3 | schedule:
4 | - cron: '0 8 * * *'
5 |
6 | jobs:
7 | stale:
8 | if: github.repository == 'pluginsGLPI/datainjection'
9 | permissions:
10 | issues: write # for actions/stale to close stale issues
11 | runs-on: ubuntu-latest
12 | steps:
13 | - uses: actions/stale@v9
14 | with:
15 | stale-issue-message: >-
16 | There has been no activity on this issue for some time and therefore it is considered stale
17 | and will be closed automatically in 10 days.
18 |
19 |
20 | If this issue is related to a bug, please try to reproduce on latest release. If the problem persist,
21 | feel free to add a comment to revive this issue.
22 |
23 | If it is related to a new feature, please open a topic to discuss with community about this enhancement
24 | on [suggestion website](https://glpi.userecho.com/).
25 |
26 |
27 | You may also consider taking a [subscription](https://glpi-project.org/subscriptions/) to get professionnal
28 | support or [contact GLPI editor team](https://portal.glpi-network.com/contact-us) directly.
29 | days-before-issue-stale: 15
30 | days-before-pr-stale: -1 # PR will be marked as stale manually.
31 | days-before-close: 5
32 | exempt-issue-labels: "bug,enhancement,question,security" # Issues with "bug", "enhancement", "question" or "security" labels will not be marked as stale
33 | exempt-all-milestones: true # Do not check issues/PR with defined milestone.
34 | ascending: true # First check older issues/PR.
35 | operations-per-run: 750 # Max API calls per run.
36 |
--------------------------------------------------------------------------------
/.github/workflows/continuous-integration.yml:
--------------------------------------------------------------------------------
1 | name: "Continuous integration"
2 |
3 | on:
4 | push:
5 | branches:
6 | - "main"
7 | tags:
8 | - "*"
9 | pull_request:
10 | schedule:
11 | - cron: "0 0 * * *"
12 | workflow_dispatch:
13 |
14 | concurrency:
15 | group: "${{ github.workflow }}-${{ github.ref }}"
16 | cancel-in-progress: true
17 |
18 | jobs:
19 | generate-ci-matrix:
20 | name: "Generate CI matrix"
21 | uses: "glpi-project/plugin-ci-workflows/.github/workflows/generate-ci-matrix.yml@v1"
22 | with:
23 | glpi-version: "10.0.x"
24 | ci:
25 | name: "GLPI ${{ matrix.glpi-version }} - php:${{ matrix.php-version }} - ${{ matrix.db-image }}"
26 | needs: "generate-ci-matrix"
27 | strategy:
28 | fail-fast: false
29 | matrix: ${{ fromJson(needs.generate-ci-matrix.outputs.matrix) }}
30 | uses: "glpi-project/plugin-ci-workflows/.github/workflows/continuous-integration.yml@v1"
31 | with:
32 | plugin-key: "datainjection"
33 | glpi-version: "${{ matrix.glpi-version }}"
34 | php-version: "${{ matrix.php-version }}"
35 | db-image: "${{ matrix.db-image }}"
36 |
--------------------------------------------------------------------------------
/.github/workflows/label-commenter.yml:
--------------------------------------------------------------------------------
1 | name: "Label commenter"
2 |
3 | on:
4 | issues:
5 | types:
6 | - "labeled"
7 | - "unlabeled"
8 |
9 | jobs:
10 | comment:
11 | permissions:
12 | contents: "read"
13 | issues: "write"
14 | runs-on: "ubuntu-latest"
15 | steps:
16 | - name: "Checkout"
17 | uses: "actions/checkout@v4"
18 |
19 | - name: "Label commenter"
20 | uses: "peaceiris/actions-label-commenter@v1"
21 |
--------------------------------------------------------------------------------
/.github/workflows/locales-sync.yml:
--------------------------------------------------------------------------------
1 | name: "Synchronize locales"
2 |
3 | on:
4 | schedule:
5 | - cron: "0 0 * * 1-5"
6 | workflow_dispatch:
7 |
8 | jobs:
9 | sync-with-transifex:
10 | name: "Sync with transifex"
11 | uses: "glpi-project/plugin-translation-workflows/.github/workflows/transifex-sync.yml@v1"
12 | secrets:
13 | github-token: "${{ secrets.LOCALES_SYNC_TOKEN }}"
14 | transifex-token: "${{ secrets.TRANSIFEX_TOKEN }}"
15 |
--------------------------------------------------------------------------------
/.github/workflows/locales-update-source.yml:
--------------------------------------------------------------------------------
1 | name: "Update locales sources"
2 |
3 | on:
4 | push:
5 | branches:
6 | - "main"
7 |
8 | jobs:
9 | push-on-transifex:
10 | name: "Push locales sources"
11 | uses: "glpi-project/plugin-translation-workflows/.github/workflows/transifex-push-sources.yml@v1"
12 | secrets:
13 | transifex-token: "${{ secrets.TRANSIFEX_TOKEN }}"
14 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: "Publish release"
2 |
3 | on:
4 | push:
5 | tags:
6 | - '*'
7 |
8 | jobs:
9 | publish-release:
10 | permissions:
11 | contents: "write"
12 | name: "Publish release"
13 | uses: "glpi-project/plugin-release-workflows/.github/workflows/publish-release.yml@v1"
14 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | dist/
2 | vendor/
3 | .gh_token
4 | *.min.*
5 |
6 |
--------------------------------------------------------------------------------
/.phpcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 | /.git/
5 | ^node_modules/
6 | ^vendor/
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.tx/config:
--------------------------------------------------------------------------------
1 | [main]
2 | host = https://www.transifex.com
3 |
4 | [o:teclib:p:glpi-plugin-datainjection:r:datainjection-pot]
5 | file_filter = locales/.po
6 | source_file = locales/datainjection.pot
7 | source_lang = en
8 | type = PO
9 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 |
3 | All notable changes to this project will be documented in this file.
4 |
5 | The format is based on [Keep a Changelog](http://keepachangelog.com/)
6 | and this project adheres to [Semantic Versioning](http://semver.org/).
7 |
8 | ## [Unreleased]
9 |
10 | ### Fixed
11 |
12 | - Use `global` configuration for injection links
13 | - Escape data when check if already exist
14 |
15 | ## [Unreleased]
16 |
17 | ### Added
18 |
19 | - Add option to `replace` (instead of `append`) the value of multiline text fields (e.g. `comment`)
20 |
21 | ## [2.14.1] - 2024-12-27
22 |
23 | ### Added
24 |
25 | - Add injection of the ```Itemtype```, ```Item``` and ```Path``` for the database instance
26 |
27 | ### Fixed
28 |
29 | - Fix relation (`CommonDBRelation`) insertion
30 | - Fix default entity insertion for a user
31 | - Fixed `SQL` error when creating new injection model
32 | - Fixed issue with missing dropdown options
33 |
34 | ## [2.14.0] - 2024-10-10
35 |
36 | ### Added
37 |
38 | - Display max upload size
39 | - Add ```default_entity``` to ```User``` injection mapping
40 |
41 | ### Fixed
42 |
43 | - Fix network port unicity
44 | - Fix visibility of injection models
45 | - Fix ```CommonDBRelation``` import
46 | - Fix ```IPAddress``` import which adds a ```lock``` on ```last_update``` field
47 | - Fix ```Agent``` lost when update dynamic asset
48 |
49 | ## [2.13.5] - 2024-02-22
50 |
51 |
52 | ### Fixed
53 |
54 | - Allow lockedfield update
55 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Datainjection GLPI plugin
2 |
3 | [](https://github.com/pluginsGLPI/datainjection/blob/develop/LICENSE)
4 | [](https://twitter.com/teclib)
5 | [](https://t.me/glpien)
6 | [](http://www.repostatus.org/#active)
7 | [](https://github.com/pluginsGLPI/datainjection/releases)
8 | [](https://travis-ci.org/pluginsGLPI/datainjection/)
9 |
10 |
11 | 
12 |
13 |
14 | This plugin allows data import into [GLPI](http://glpi-project.org) using CSV files.
15 |
16 | It allows to create models of injection for a future re-use. It's been created in order to:
17 |
18 | - import data coming from others asset management softwares
19 | - inject electronic delivery forms
20 |
21 | Data to be imported using the plugins are:
22 |
23 | - inventory data (except softwares and licenses),
24 | - management data (contract, contact, supplier),
25 | - configuration data (user, group, entity).
26 |
27 | ## Documentation
28 |
29 | We maintain a detailed documentation here -> [Documentation](https://glpi-plugins.readthedocs.io/en/latest/datainjection/index.html)
30 |
31 | ## Contact
32 |
33 | For notices about major changes and general discussion of datainjection, subscribe to the [/r/glpi](https://www.reddit.com/r/glpi/) subreddit.
34 | You can also chat with us via IRC in [#glpi on freenode](http://webchat.freenode.net/?channels=glpi) or [@glpi on Telegram](https://t.me/glpien).
35 |
36 | ## Professional Services
37 |
38 | 
39 |
40 | The GLPI Network services are available through our [Partner's Network](http://www.teclib-edition.com/en/partners/). We provide special training, bug fixes with editor subscription, contributions for new features, and more.
41 |
42 | Obtain a personalized service experience, associated with benefits and opportunities.
43 |
44 | ## Contributing
45 |
46 | * Open a ticket for each bug/feature so it can be discussed
47 | * Follow [development guidelines](http://glpi-developer-documentation.readthedocs.io/en/latest/plugins/index.html)
48 | * Refer to [GitFlow](http://git-flow.readthedocs.io/) process for branching
49 | * Work on a new branch on your own fork
50 | * Open a PR that will be reviewed by a developer
51 |
52 | ## Copying
53 |
54 | * **Code**: you can redistribute it and/or modify
55 | it under the terms of the GNU General Public License ([GPL-2.0](https://www.gnu.org/licenses/gpl-2.0.en.html)).
56 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | **⚠️ Please never use standard issues to report security problems; vulnerabilities are published once a fix release is available. ⚠️**
4 |
5 | ## Reporting a Vulnerability
6 |
7 | If you found a security issue, please contact us by:
8 |
9 | - [our huntr page](https://huntr.dev/repos/pluginsGLPI/datainjection/)
10 | - a mail to \[glpi-security AT ow2.org\]
11 |
12 | You should provide us all details about the issue and the way to reproduce it.
13 | You may also provide a script that can be used to check the issue exists.
14 |
15 | Once the report will be handled, and if the issue is not yet fixed (or in progress)
16 | we'll add it to the GitHub security tab, and add you as observer. Meanwhile,
17 | you will reserve a CVE for the issue.
18 |
19 | Thank you for improving the security of GLPI and its plugins.
20 |
21 | ## Supported Versions
22 |
23 | We follow the same version support policy as GLPI.
24 | This means that we provide security patches to versions of the plugin that target a version of GLPI itself maintained from a security point of view.
25 |
--------------------------------------------------------------------------------
/ajax/dropdownChooseField.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | // Direct access to file
32 | if (strpos($_SERVER['PHP_SELF'], "dropdownChooseField.php")) {
33 | include '../../../inc/includes.php';
34 | header("Content-Type: text/html; charset=UTF-8");
35 | Html::header_nocache();
36 | }
37 |
38 | Session::checkCentralAccess();
39 | PluginDatainjectionInjectionType::dropdownFields($_POST);
40 |
--------------------------------------------------------------------------------
/ajax/dropdownMandatory.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | // Direct access to file
32 | if (strpos($_SERVER['PHP_SELF'], "dropdownMandatory.php")) {
33 | include '../../../inc/includes.php';
34 | header("Content-Type: text/html; charset=UTF-8");
35 | Html::header_nocache();
36 | }
37 |
38 | Session::checkCentralAccess();
39 | PluginDatainjectionInjectionType::showMandatoryCheckbox($_POST);
40 |
--------------------------------------------------------------------------------
/ajax/dropdownSelectModel.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | // Direct access to file
32 | if (strpos($_SERVER['PHP_SELF'], "dropdownSelectModel.php")) {
33 | include '../../../inc/includes.php';
34 | header("Content-Type: text/html; charset=UTF-8");
35 | Html::header_nocache();
36 | }
37 |
38 | Session::checkCentralAccess();
39 |
40 | if (
41 | isset($_SESSION['datainjection']['models_id'])
42 | && $_SESSION['datainjection']['models_id'] != $_POST['models_id']
43 | ) {
44 | PluginDatainjectionModel::cleanSessionVariables();
45 | }
46 |
47 | $_SESSION['datainjection']['step'] = PluginDatainjectionClientInjection::STEP_UPLOAD;
48 | $model = new PluginDatainjectionModel();
49 |
50 | if (
51 | ($_POST['models_id'] > 0)
52 | && $model->can($_POST['models_id'], READ)
53 | ) {
54 | PluginDatainjectionInfo::showAdditionalInformationsForm($model);
55 | }
56 |
--------------------------------------------------------------------------------
/ajax/injection.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | // Direct access to file
32 | if (strpos($_SERVER['PHP_SELF'], "injection.php")) {
33 | include '../../../inc/includes.php';
34 | header("Content-Type: text/html; charset=UTF-8");
35 | Html::header_nocache();
36 | }
37 |
38 | Session::checkCentralAccess();
39 | $model = unserialize($_SESSION['datainjection']['currentmodel']);
40 | PluginDatainjectionClientInjection::showInjectionForm($model, $_SESSION['glpiactive_entity']);
41 |
--------------------------------------------------------------------------------
/ajax/results.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | // Direct access to file
32 | if (strpos($_SERVER['PHP_SELF'], "results.php")) {
33 | include '../../../inc/includes.php';
34 | header("Content-Type: text/html; charset=UTF-8");
35 | Html::header_nocache();
36 | }
37 |
38 | Session::checkCentralAccess();
39 | $model = unserialize($_SESSION['datainjection']['currentmodel']);
40 | PluginDatainjectionClientInjection::showResultsForm($model);
41 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "require": {
3 | "php": ">=7.4"
4 | },
5 | "require-dev": {
6 | "glpi-project/tools": "^0.7.5",
7 | "php-parallel-lint/php-parallel-lint": "^1.4",
8 | "phpstan/extension-installer": "^1.4",
9 | "phpstan/phpstan": "^2.1",
10 | "phpstan/phpstan-deprecation-rules": "^2.0",
11 | "squizlabs/php_codesniffer": "^3.13"
12 | },
13 | "config": {
14 | "optimize-autoloader": true,
15 | "platform": {
16 | "php": "7.4.0"
17 | },
18 | "sort-packages": true,
19 | "allow-plugins": {
20 | "phpstan/extension-installer": true
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/datainjection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/datainjection.png
--------------------------------------------------------------------------------
/front/export.csv.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | require '../../../inc/includes.php';
32 |
33 | Session::checkRight(PluginDatainjectionClientInjection::$rightname, READ);
34 |
35 | PluginDatainjectionClientInjection::exportErrorsInCSV();
36 |
--------------------------------------------------------------------------------
/front/export.pdf.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | require '../../../inc/includes.php';
32 |
33 | Session::checkRight(PluginDatainjectionClientInjection::$rightname, READ);
34 |
35 | PluginDatainjectionModel::exportAsPDF($_GET['models_id']);
36 |
--------------------------------------------------------------------------------
/front/info.form.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | require '../../../inc/includes.php';
32 | Session::checkLoginUser();
33 |
34 | /* Update mappings */
35 | if (isset($_POST["update"])) {
36 | PluginDatainjectionInfo::manageInfos($_POST['models_id'], $_POST);
37 | } else if (isset($_POST["delete"])) {
38 | $info = new PluginDatainjectionInfo();
39 | foreach ($_POST["item"] as $key => $val) {
40 | $input = ['id' => $key];
41 | if ($val == 1) {
42 | $info->check($key, UPDATE);
43 | $info->delete($input);
44 | }
45 | }
46 | Html::back();
47 | }
48 | Session::setActiveTab('PluginDatainjectionModel', 'PluginDatainjectionModel$5');
49 | Html::back();
50 |
--------------------------------------------------------------------------------
/front/model.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | require '../../../inc/includes.php';
32 | Session::checkLoginUser();
33 |
34 | Html::header(
35 | PluginDatainjectionModel::getTypeName(),
36 | '',
37 | "tools",
38 | "plugindatainjectionmenu",
39 | "model"
40 | );
41 |
42 | $model = new PluginDatainjectionModel();
43 | $model->checkGlobal(READ);
44 |
45 | Search::show('PluginDatainjectionModel');
46 |
47 | Html::footer();
48 |
--------------------------------------------------------------------------------
/front/popup.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | require '../../../inc/includes.php';
32 |
33 | Session::checkLoginUser();
34 |
35 | switch ($_GET["popup"]) {
36 | case "preview":
37 | Html::popHeader(__('See the file', 'datainjection'), $_SERVER['PHP_SELF']);
38 | PluginDatainjectionModel::showPreviewMappings($_GET['models_id']);
39 | Html::popFooter();
40 | break;
41 |
42 | case "log":
43 | Html::popHeader(__('Data injection report', 'datainjection'), $_SERVER['PHP_SELF']);
44 | PluginDatainjectionModel::showLogResults($_GET['models_id']);
45 | Html::popFooter();
46 | break;
47 | }
48 |
--------------------------------------------------------------------------------
/glpi_network.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/glpi_network.png
--------------------------------------------------------------------------------
/inc/applianceinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionApplianceInjection extends Appliance implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 | $parenttype = get_parent_class(__CLASS__);
40 | return $parenttype::getTable();
41 | }
42 |
43 | public function isPrimaryType()
44 | {
45 | return true;
46 | }
47 |
48 | public function connectedTo()
49 | {
50 | return [];
51 | }
52 |
53 | /**
54 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
55 | **/
56 | public function getOptions($primary_type = '')
57 | {
58 |
59 | $tab = Search::getOptions(get_parent_class($this));
60 |
61 | //Remove some options because some fields cannot be imported
62 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
63 | $notimportable = [5, 9, 31];
64 |
65 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
66 | $options['displaytype'] = [
67 | "multiline_text" => [4],
68 | "dropdown" => [8, 10, 11, 32, 49],
69 | "user" => [6, 24],
70 | "bool" => [7, 61]
71 | ];
72 |
73 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
74 | }
75 |
76 | /**
77 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
78 | **/
79 | public function addOrUpdateObject($values = [], $options = [])
80 | {
81 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
82 | $lib->processAddOrUpdate();
83 | return $lib->getInjectionResults();
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/inc/autoupdatesysteminjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionAutoUpdateSystemInjection extends AutoUpdateSystem implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | public function getOptions($primary_type = '')
60 | {
61 |
62 | $tab = Search::getOptions(get_parent_class($this));
63 |
64 | //Remove some options because some fields cannot be imported
65 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
66 | $notimportable = [];
67 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
68 |
69 | $options['displaytype'] = ["multiline_text" => [16]];
70 |
71 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
72 | }
73 |
74 |
75 | /**
76 | * Standard method to add an object into glpi
77 | *
78 | * @param array $values array fields to add into glpi
79 | * @param array $options array options used during creation
80 | *
81 | * @return array of IDs of newly created objects : for example array(Computer=>1, Networkport=>10)
82 | **/
83 | public function addOrUpdateObject($values = [], $options = [])
84 | {
85 |
86 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
87 | $lib->processAddOrUpdate();
88 | return $lib->getInjectionResults();
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/inc/backendinterface.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | /**
32 | * Interface to be implemented for each injection backend
33 | **/
34 | interface PluginDatainjectionBackendInterface
35 | {
36 | /**
37 | * Read from file
38 | *
39 | * @param integer $numberOfLines (default 1)
40 | **/
41 | public function read($numberOfLines = 1);
42 |
43 |
44 | /**
45 | * Delete file
46 | **/
47 | public function deleteFile();
48 |
49 |
50 | /**
51 | * Export results to a file
52 | **/
53 | //function export($file, PluginDatainjectionModel $model, $tab_result);
54 |
55 |
56 | /**
57 | * Store the number of lines red from the file
58 | **/
59 | public function storeNumberOfLines();
60 |
61 |
62 | /**
63 | * Get the number of lines in the file
64 | **/
65 | public function getNumberOfLines();
66 | }
67 |
--------------------------------------------------------------------------------
/inc/computermodelinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionComputerModelInjection extends ComputerModel implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 |
73 | $options['displaytype'] = ["multiline_text" => [16]];
74 |
75 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
76 | }
77 |
78 |
79 | /**
80 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
81 | **/
82 | public function addOrUpdateObject($values = [], $options = [])
83 | {
84 |
85 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
86 | $lib->processAddOrUpdate();
87 | return $lib->getInjectionResults();
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/inc/computertypeinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionComputerTypeInjection extends ComputerType implements PluginDatainjectionInjectionInterface
36 | {
37 | public function isPrimaryType()
38 | {
39 |
40 | return true;
41 | }
42 |
43 |
44 | public function connectedTo()
45 | {
46 |
47 | return [];
48 | }
49 |
50 |
51 | public static function getTable($classname = null)
52 | {
53 |
54 | $parenttype = get_parent_class(__CLASS__);
55 | return $parenttype::getTable();
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 |
73 | $options['displaytype'] = ["multiline_text" => [16]];
74 |
75 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
76 | }
77 |
78 |
79 | /**
80 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
81 | **/
82 | public function addOrUpdateObject($values = [], $options = [])
83 | {
84 |
85 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
86 | $lib->processAddOrUpdate();
87 | return $lib->getInjectionResults();
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/inc/contactinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionContactInjection extends Contact implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return ['Supplier'];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [8];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 |
73 | $options['displaytype'] = ["dropdown" => [8, 9],
74 | "bool" => [86],
75 | "multiline_text" => [16, 82, 90]
76 | ];
77 |
78 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
79 | }
80 |
81 |
82 | /**
83 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
84 | **/
85 | public function addOrUpdateObject($values = [], $options = [])
86 | {
87 |
88 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
89 | $lib->processAddOrUpdate();
90 | return $lib->getInjectionResults();
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/inc/contacttypeinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionContactTypeInjection extends ContactType implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 |
73 | $options['displaytype'] = ["multiline_text" => [16]];
74 |
75 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
76 | }
77 |
78 |
79 | /**
80 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
81 | **/
82 | public function addOrUpdateObject($values = [], $options = [])
83 | {
84 |
85 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
86 | $lib->processAddOrUpdate();
87 | return $lib->getInjectionResults();
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/inc/contracttypeinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionContractTypeInjection extends ContractType implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/data.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | class PluginDatainjectionData
32 | {
33 | private $injectionData;
34 |
35 |
36 | public function __construct()
37 | {
38 |
39 | $injectionData = [];
40 | }
41 |
42 |
43 | /**
44 | * @param array $newData
45 | **/
46 | public function addToData($newData)
47 | {
48 |
49 | $this->injectionData[] = $newData;
50 | }
51 |
52 |
53 | public function getData()
54 | {
55 |
56 | return $this->injectionData;
57 | }
58 |
59 |
60 | /**
61 | * @param integer $line_id
62 | **/
63 | public function getDataAtLine($line_id)
64 | {
65 |
66 | if (count($this->injectionData) >= $line_id) {
67 | return $this->injectionData[$line_id][0];
68 | }
69 | return [];
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/inc/devicecasetypeinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionDeviceCaseTypeInjection extends DeviceCaseType implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/deviceecasetypeinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionDeviceCaseTypeInjection extends DeviceCaseType implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/devicememorytypeinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionDeviceMemoryTypeInjection extends DeviceMemoryType implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/documentinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionDocumentInjection extends Document implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 | return Search::getOptions(get_parent_class($this));
65 | }
66 |
67 |
68 | /**
69 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
70 | **/
71 | public function addOrUpdateObject($values = [], $options = [])
72 | {
73 |
74 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
75 | $lib->processAddOrUpdate();
76 | return $lib->getInjectionResults();
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/inc/documenttypeinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionDocumentTypeInjection extends DocumentType implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/domaininjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionDomainInjection extends Domain implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/filesystemtypeinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionFilesystemTypeInjection extends Filesystem implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/groupinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionGroupInjection extends Group implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [14, 70, 71];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["bool" => [11, 12, 13, 14 ,15, 17],
73 | "multiline_text" => [16]
74 | ];
75 |
76 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
77 | }
78 |
79 |
80 | /**
81 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
82 | **/
83 | public function addOrUpdateObject($values = [], $options = [])
84 | {
85 |
86 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
87 | $lib->processAddOrUpdate();
88 | return $lib->getInjectionResults();
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/inc/infocollection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | class PluginDatainjectionInfoCollection
32 | {
33 | public $infosCollection;
34 |
35 |
36 | public function __construct()
37 | {
38 |
39 | $this->infosCollection = [];
40 | }
41 |
42 |
43 | //---- Getter ----//
44 |
45 | /**
46 | * Load all the mappings for a specified model
47 | *
48 | * @param integer $models_id the model ID
49 | **/
50 | public function load($models_id)
51 | {
52 | /** @var DBmysql $DB */
53 | global $DB;
54 |
55 | $query = "SELECT *
56 | FROM `glpi_plugin_datainjection_infos`
57 | WHERE `models_id` = '" . $models_id . "'
58 | ORDER BY `itemtype` ASC";
59 |
60 | foreach ($DB->request($query) as $data) {
61 | $infos = new PluginDatainjectionInfo();
62 | $infos->fields = $data;
63 | $this->infosCollection[] = $infos;
64 | }
65 | }
66 |
67 | /**
68 | * Return all the mappings for this model
69 | *
70 | * @return array the list of all the mappings for this model
71 | **/
72 | public function getAllInfos()
73 | {
74 |
75 | return $this->infosCollection;
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/inc/itilfollowuptemplateinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionITILFollowupTemplateInjection extends ITILFollowupTemplate implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 |
73 | $options['displaytype'] = ["bool" => [86],
74 | "dropdown" => [5],
75 | "multiline_text" => [4, 16]
76 | ];
77 |
78 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
79 | }
80 |
81 |
82 | /**
83 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
84 | **/
85 | public function addOrUpdateObject($values = [], $options = [])
86 | {
87 |
88 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
89 | $lib->processAddOrUpdate();
90 | return $lib->getInjectionResults();
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/inc/knowbaseitemcategoryinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionKnowbaseItemCategoryInjection extends KnowbaseItemCategory implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [14];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/locationinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionLocationInjection extends Location implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | */
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [14];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/manufacturerinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionManufacturerInjection extends Manufacturer implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | */
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 |
73 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
74 | }
75 |
76 |
77 | /**
78 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
79 | **/
80 | public function addOrUpdateObject($values = [], $options = [])
81 | {
82 |
83 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
84 | $lib->processAddOrUpdate();
85 | return $lib->getInjectionResults();
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/inc/monitormodelinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionMonitorModelInjection extends MonitorModel implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/monitortypeinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionMonitorTypeInjection extends MonitorType implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/networkequipmentmodelinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionNetworkEquipmentModelInjection extends NetworkEquipmentModel implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/networkequipmenttypeinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionNetworkequipmentTypeInjection extends NetworkEquipmentType implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/networkinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionNetworkInjection extends Network implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/networkinterfaceinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionNetworkInterfaceInjection extends NetworkInterface implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/operatingsystemarchitectureinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionOperatingSystemArchitectureInjection extends OperatingSystemArchitecture implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/operatingsystemeditioninjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionOperatingSystemEditionInjection extends OperatingSystemEdition implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return ['Computer'];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/operatingsysteminjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionOperatingSystemInjection extends OperatingSystem implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/operatingsystemkernelinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionOperatingSystemKernelInjection extends OperatingSystemKernel implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/operatingsystemkernelversioninjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionOperatingSystemKernelVersionInjection extends OperatingSystemKernelVersion implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/operatingsystemservicepackinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionOperatingSystemServicePackInjection extends OperatingSystemServicePack implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/operatingsystemversioninjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionOperatingSystemVersionInjection extends OperatingSystemVersion implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/peripheralmodelinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionPeripheralModelInjection extends PeripheralModel implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/peripheraltypeinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionPeripheralTypeInjection extends PeripheralType implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/phonemodelinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionPhoneModelInjection extends PhoneModel implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/phonepowersupplytypeinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionPhonePowerSupplyTypeInjection extends PhonePowerSupply implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/phonetypeinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionPhoneTypeInjection extends PhoneType implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/printermodelinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionPrinterModelInjection extends PrinterModel implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/printertypeinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionPrinterTypeInjection extends PrinterType implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/requesttypeinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionRequestTypeInjection extends RequestType implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 |
73 | $options['displaytype'] = ["bool" => [14, 15],
74 | "multiline_text" => [16]
75 | ];
76 |
77 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
78 | }
79 |
80 |
81 | /**
82 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
83 | **/
84 | public function addOrUpdateObject($values = [], $options = [])
85 | {
86 |
87 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
88 | $lib->processAddOrUpdate();
89 | return $lib->getInjectionResults();
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/inc/session.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | class PluginDatainjectionSession
32 | {
33 | /**
34 | * Get a parameter from the HTTP session
35 | *
36 | * @param string $param the parameter to get
37 | *
38 | * @return mixed the param's value
39 | **/
40 | public static function getParam($param)
41 | {
42 |
43 | if (!isset($_SESSION['datainjection'][$param])) {
44 | return false;
45 | }
46 | if (in_array($param, ['results', 'error_lines'])) {
47 | $fic = $_SESSION['datainjection'][$param];
48 | return file_get_contents(GLPI_TMP_DIR . '/' . $fic);
49 | }
50 | return $_SESSION['datainjection'][$param];
51 | }
52 |
53 |
54 | /**
55 | * Set a parameter in the HTTP session
56 | *
57 | * @param string $param the parameter
58 | * @param array|string|false $results the value to store
59 | *
60 | * @return void
61 | **/
62 | public static function setParam($param, $results): void
63 | {
64 |
65 | if (in_array($param, ['results', 'error_lines'])) {
66 | $fic = Session::getLoginUserID() . '_' . $param . '_' . microtime(true);
67 | file_put_contents(GLPI_TMP_DIR . '/' . $fic, $results);
68 | $_SESSION['datainjection'][$param] = $fic;
69 | } else {
70 | $_SESSION['datainjection'][$param] = $results;
71 | }
72 | }
73 |
74 |
75 | /**
76 | * Remove all parameters from the HTTP session
77 | *
78 | * @return void
79 | */
80 | public static function removeParams(): void
81 | {
82 |
83 | if (isset($_SESSION['datainjection']['results'])) {
84 | unlink(GLPI_TMP_DIR . '/' . $_SESSION['datainjection']['results']);
85 | }
86 | if (isset($_SESSION['datainjection']['error_lines'])) {
87 | unlink(GLPI_TMP_DIR . '/' . $_SESSION['datainjection']['error_lines']);
88 | }
89 | unset($_SESSION['datainjection']);
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/inc/softwarelicensetypeinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionSoftwareLicenseTypeInjection extends SoftwareLicenseType implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/solutiontemplateinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionSolutionTemplateInjection extends SolutionTemplate implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [4, 16],
73 | "dropdown" => [3],
74 | "bool" => [86]
75 | ];
76 |
77 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
78 | }
79 |
80 |
81 | /**
82 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
83 | **/
84 | public function addOrUpdateObject($values = [], $options = [])
85 | {
86 |
87 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
88 | $lib->processAddOrUpdate();
89 | return $lib->getInjectionResults();
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/inc/solutiontypeinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionSolutionTypeInjection extends SolutionType implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 |
73 | $options['displaytype'] = ["multiline_text" => [16],
74 | "bool" => [86]
75 | ];
76 |
77 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
78 | }
79 |
80 |
81 | /**
82 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
83 | **/
84 | public function addOrUpdateObject($values = [], $options = [])
85 | {
86 |
87 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
88 | $lib->processAddOrUpdate();
89 | return $lib->getInjectionResults();
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/inc/stateinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionStateInjection extends State implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [14];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/supplierinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionSupplierInjection extends Supplier implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [8, 29];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 |
73 | $options['displaytype'] = ["dropdown" => [9],
74 | "multiline_text" => [3, 16, 90],
75 | "bool" => [86]
76 | ];
77 |
78 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
79 | }
80 |
81 |
82 | /**
83 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
84 | **/
85 | public function addOrUpdateObject($values = [], $options = [])
86 | {
87 |
88 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
89 | $lib->processAddOrUpdate();
90 | return $lib->getInjectionResults();
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/inc/suppliertypeinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionSupplierTypeInjection extends SupplierType implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/taskcategoryinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionTaskCategoryInjection extends TaskCategory implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [14];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 |
73 | $options['displaytype'] = ["bool" => [86],
74 | "multiline_text" => [16]
75 | ];
76 |
77 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
78 | }
79 |
80 |
81 | /**
82 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
83 | **/
84 | public function addOrUpdateObject($values = [], $options = [])
85 | {
86 |
87 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
88 | $lib->processAddOrUpdate();
89 | return $lib->getInjectionResults();
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/inc/tasktemplateinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionTaskTemplateInjection extends TaskTemplate implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 |
73 | $options['displaytype'] = ["bool" => [86],
74 | "dropdown" => [3],
75 | "multiline_text" => [4, 16]
76 | ];
77 |
78 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
79 | }
80 |
81 |
82 | /**
83 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
84 | **/
85 | public function addOrUpdateObject($values = [], $options = [])
86 | {
87 |
88 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
89 | $lib->processAddOrUpdate();
90 | return $lib->getInjectionResults();
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/inc/virtualmachinestateinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionVirtualMachineStateInjection extends VirtualMachineState implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/virtualmachinesysteminjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionVirtualMachineSystemInjection extends VirtualMachineSystem implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/virtualmachinetypeinjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionVirtualMachineTypeInjection extends VirtualMachineType implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 | $options['displaytype'] = ["multiline_text" => [16]];
73 |
74 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
75 | }
76 |
77 |
78 | /**
79 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
80 | **/
81 | public function addOrUpdateObject($values = [], $options = [])
82 | {
83 |
84 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
85 | $lib->processAddOrUpdate();
86 | return $lib->getInjectionResults();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/inc/vlaninjection.class.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/datainjection
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | class PluginDatainjectionVlanInjection extends Vlan implements PluginDatainjectionInjectionInterface
36 | {
37 | public static function getTable($classname = null)
38 | {
39 |
40 | $parenttype = get_parent_class(__CLASS__);
41 | return $parenttype::getTable();
42 | }
43 |
44 |
45 | public function isPrimaryType()
46 | {
47 |
48 | return true;
49 | }
50 |
51 |
52 | public function connectedTo()
53 | {
54 |
55 | return [];
56 | }
57 |
58 |
59 | /**
60 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions()
61 | **/
62 | public function getOptions($primary_type = '')
63 | {
64 |
65 | $tab = Search::getOptions(get_parent_class($this));
66 |
67 | //Remove some options because some fields cannot be imported
68 | $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this));
69 | $notimportable = [];
70 |
71 | $options['ignore_fields'] = array_merge($blacklist, $notimportable);
72 |
73 | $options['displaytype'] = [
74 | "bool" => [86],
75 | "multiline_text" => [16]
76 | ];
77 |
78 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this);
79 | }
80 |
81 |
82 | /**
83 | * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject()
84 | **/
85 | public function addOrUpdateObject($values = [], $options = [])
86 | {
87 |
88 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options);
89 | $lib->processAddOrUpdate();
90 | return $lib->getInjectionResults();
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/js/datainjection.js:
--------------------------------------------------------------------------------
1 | /**
2 | * -------------------------------------------------------------------------
3 | * DataInjection plugin for GLPI
4 | * -------------------------------------------------------------------------
5 | *
6 | * LICENSE
7 | *
8 | * This file is part of DataInjection.
9 | *
10 | * DataInjection is free software; you can redistribute it and/or modify
11 | * it under the terms of the GNU General Public License as published by
12 | * the Free Software Foundation; either version 2 of the License, or
13 | * (at your option) any later version.
14 | *
15 | * DataInjection is distributed in the hope that it will be useful,
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | * GNU General Public License for more details.
19 | *
20 | * You should have received a copy of the GNU General Public License
21 | * along with DataInjection. If not, see .
22 | * -------------------------------------------------------------------------
23 | * @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
24 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
25 | * @link https://github.com/pluginsGLPI/datainjection
26 | * -------------------------------------------------------------------------
27 | */
28 |
29 | /**
30 | * @param num
31 | */
32 | function show_log(num) {
33 |
34 | if (document.getElementById('log'+num+'_table').style.display == 'none') {
35 | document.getElementById('log'+num).src = '../pics/minus.png';
36 | document.getElementById('log'+num+'_table').style.display = 'block';
37 | } else {
38 | document.getElementById('log'+num).src = '../pics/plus.png';
39 | document.getElementById('log'+num+'_table').style.display = 'none';
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/locales/cs_CZ.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/locales/cs_CZ.mo
--------------------------------------------------------------------------------
/locales/en_GB.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/locales/en_GB.mo
--------------------------------------------------------------------------------
/locales/es_AR.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/locales/es_AR.mo
--------------------------------------------------------------------------------
/locales/es_EC.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/locales/es_EC.mo
--------------------------------------------------------------------------------
/locales/fi_FI.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/locales/fi_FI.mo
--------------------------------------------------------------------------------
/locales/fr_FR.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/locales/fr_FR.mo
--------------------------------------------------------------------------------
/locales/hr_HR.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/locales/hr_HR.mo
--------------------------------------------------------------------------------
/locales/it_IT.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/locales/it_IT.mo
--------------------------------------------------------------------------------
/locales/ja_JP.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/locales/ja_JP.mo
--------------------------------------------------------------------------------
/locales/ko_KR.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/locales/ko_KR.mo
--------------------------------------------------------------------------------
/locales/pt_BR.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/locales/pt_BR.mo
--------------------------------------------------------------------------------
/locales/pt_PT.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/locales/pt_PT.mo
--------------------------------------------------------------------------------
/locales/ru_RU.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/locales/ru_RU.mo
--------------------------------------------------------------------------------
/locales/sk_SK.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/locales/sk_SK.mo
--------------------------------------------------------------------------------
/locales/tr_TR.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/locales/tr_TR.mo
--------------------------------------------------------------------------------
/locales/zh_CN.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/locales/zh_CN.mo
--------------------------------------------------------------------------------
/phpstan.neon:
--------------------------------------------------------------------------------
1 | parameters:
2 | parallel:
3 | maximumNumberOfProcesses: 2
4 | level: 5
5 | bootstrapFiles:
6 | - ../../inc/based_config.php
7 | paths:
8 | - ajax
9 | - front
10 | - inc
11 | - hook.php
12 | - setup.php
13 | excludePaths:
14 | - inc/webservice.class.php
15 | scanDirectories:
16 | - ../../inc
17 | - ../../src
18 | stubFiles:
19 | - ../../stubs/glpi_constants.php
20 | rules:
21 | - GlpiProject\Tools\PHPStan\Rules\GlobalVarTypeRule
22 |
--------------------------------------------------------------------------------
/pics/danger.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/pics/danger.jpg
--------------------------------------------------------------------------------
/pics/danger.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/pics/danger.png
--------------------------------------------------------------------------------
/pics/datainjection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/pics/datainjection.png
--------------------------------------------------------------------------------
/pics/failedcsv.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/pics/failedcsv.png
--------------------------------------------------------------------------------
/pics/fd_logo.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/pics/fd_logo.JPG
--------------------------------------------------------------------------------
/pics/fleche.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/pics/fleche.png
--------------------------------------------------------------------------------
/pics/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/pics/logo.png
--------------------------------------------------------------------------------
/pics/minus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/pics/minus.png
--------------------------------------------------------------------------------
/pics/notok.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/pics/notok.jpg
--------------------------------------------------------------------------------
/pics/notok.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/pics/notok.png
--------------------------------------------------------------------------------
/pics/ok.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/pics/ok.jpg
--------------------------------------------------------------------------------
/pics/ok.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/pics/ok.png
--------------------------------------------------------------------------------
/pics/plus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/pics/plus.png
--------------------------------------------------------------------------------
/pics/reportpdf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/pics/reportpdf.png
--------------------------------------------------------------------------------
/pics/seereport.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/pics/seereport.png
--------------------------------------------------------------------------------
/screenshots/datainjection.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/screenshots/datainjection.gif
--------------------------------------------------------------------------------
/screenshots/datainjection_conf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/screenshots/datainjection_conf.png
--------------------------------------------------------------------------------
/screenshots/datainjection_import_success.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/screenshots/datainjection_import_success.png
--------------------------------------------------------------------------------
/screenshots/datainjection_mapping.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pluginsGLPI/datainjection/8c99641cebe51c544e9cc6cef2a746e1ff0fbd85/screenshots/datainjection_mapping.png
--------------------------------------------------------------------------------
/tools/HEADER:
--------------------------------------------------------------------------------
1 | -------------------------------------------------------------------------
2 | DataInjection plugin for GLPI
3 | -------------------------------------------------------------------------
4 |
5 | LICENSE
6 |
7 | This file is part of DataInjection.
8 |
9 | DataInjection is free software; you can redistribute it and/or modify
10 | it under the terms of the GNU General Public License as published by
11 | the Free Software Foundation; either version 2 of the License, or
12 | (at your option) any later version.
13 |
14 | DataInjection is distributed in the hope that it will be useful,
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | GNU General Public License for more details.
18 |
19 | You should have received a copy of the GNU General Public License
20 | along with DataInjection. If not, see .
21 | -------------------------------------------------------------------------
22 | @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
23 | @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
24 | @link https://github.com/pluginsGLPI/datainjection
25 | -------------------------------------------------------------------------
26 |
--------------------------------------------------------------------------------