├── locales
├── cs_CZ.mo
├── en_GB.mo
├── es_AR.mo
├── es_EC.mo
├── fr_FR.mo
├── hu_HU.mo
├── ru_RU.mo
├── tr_TR.mo
├── glpi.pot
├── hu_HU.po
├── es_EC.po
├── en_GB.po
├── tr_TR.po
└── es_AR.po
├── public
├── pics
│ ├── iconCI.png
│ ├── nothing.png
│ └── service.png
└── js
│ ├── accordion.min.js
│ ├── changeCIMenu.min.js
│ ├── show_criticity.js.php
│ ├── show_fields.min.js
│ ├── changeCIMenu.js
│ ├── accordion.js
│ ├── show_fields.js
│ ├── function_form_CIType.min.js
│ ├── show_criticity.min.js
│ ├── function_form_CIType.js
│ ├── show_criticity.js
│ └── cmdb_impact.js.php
├── screenshots
└── service.png
├── install
├── sql
│ ├── update-1.1.0.sql
│ ├── update-2.2.0.sql
│ ├── update-3.0.0.sql
│ ├── update-1.1.2.sql
│ ├── update-2.2.1.sql
│ ├── update-3.1.4.sql
│ ├── update-3.1.0.sql
│ ├── empty-2.2.0.sql
│ ├── empty-2.2.1.sql
│ └── empty-3.0.0.sql
├── update_110_111.php
└── update_120.php
├── tools
├── update_mo.pl
├── update_po.pl
└── extract_template.sh
├── .github
└── workflows
│ ├── updatepot.yml
│ ├── generatemo.yml
│ └── release.yml
├── index.php
├── ajax
├── index.php
├── change_field.php
├── impact_item_infos.php
├── dropdownInfoFields.php
├── dropdownTypeByCIType.php
├── change_link.php
├── impact_infos_fields.php
├── criticity_values.php
├── impact_infos_fields_dropdown.php
├── dropdownStateOperationprocesses.php
├── reset_fields_citypes.php
└── impact_icon_criterias.php
├── front
├── index.php
├── impacticon.php
├── impactinfo.php
├── ci.php
├── operationprocess.php
├── menu.php
├── impacticon.send.php
├── icon.send.php
├── ci.form.php
├── impacticon.form.php
├── operationprocess.form.php
└── impactinfo.form.php
├── README.md
├── src
├── CiValues.php
├── CIType_Document.php
├── OperationProcessState.php
├── Autoloader.php
├── OperationProcessMenu.php
├── Menu.php
├── Cmdb.php
├── ImpactInfoField.php
└── Cmdb_Ticket.php
├── cmdb.xml
├── templates
└── Citype.tpl
└── setup.php
/locales/cs_CZ.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/InfotelGLPI/cmdb/master/locales/cs_CZ.mo
--------------------------------------------------------------------------------
/locales/en_GB.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/InfotelGLPI/cmdb/master/locales/en_GB.mo
--------------------------------------------------------------------------------
/locales/es_AR.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/InfotelGLPI/cmdb/master/locales/es_AR.mo
--------------------------------------------------------------------------------
/locales/es_EC.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/InfotelGLPI/cmdb/master/locales/es_EC.mo
--------------------------------------------------------------------------------
/locales/fr_FR.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/InfotelGLPI/cmdb/master/locales/fr_FR.mo
--------------------------------------------------------------------------------
/locales/hu_HU.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/InfotelGLPI/cmdb/master/locales/hu_HU.mo
--------------------------------------------------------------------------------
/locales/ru_RU.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/InfotelGLPI/cmdb/master/locales/ru_RU.mo
--------------------------------------------------------------------------------
/locales/tr_TR.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/InfotelGLPI/cmdb/master/locales/tr_TR.mo
--------------------------------------------------------------------------------
/public/pics/iconCI.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/InfotelGLPI/cmdb/master/public/pics/iconCI.png
--------------------------------------------------------------------------------
/public/pics/nothing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/InfotelGLPI/cmdb/master/public/pics/nothing.png
--------------------------------------------------------------------------------
/public/pics/service.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/InfotelGLPI/cmdb/master/public/pics/service.png
--------------------------------------------------------------------------------
/screenshots/service.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/InfotelGLPI/cmdb/master/screenshots/service.png
--------------------------------------------------------------------------------
/install/sql/update-1.1.0.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE `glpi_plugin_cmdb_criticity_items` RENAME `glpi_plugin_cmdb_criticities_items`;
--------------------------------------------------------------------------------
/install/sql/update-2.2.0.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE `glpi_plugin_cmdb_criticities_items` CHANGE `value` `plugin_cmdb_criticities_id` int(11) NOT NULL default '0';
--------------------------------------------------------------------------------
/install/sql/update-3.0.0.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE `glpi_plugin_cmdb_operationprocesses` ADD `users_id` int unsigned NOT NULL default '0' COMMENT 'RELATION to glpi_users (id)';
2 |
--------------------------------------------------------------------------------
/install/sql/update-1.1.2.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE `glpi_plugin_cmdb_links_items` ADD `plugin_cmdb_citypes_id` int(11) NOT NULL default '0';
2 | ALTER TABLE `glpi_plugin_cmdb_links_items` ADD `plugin_cmdb_id` int(11) NOT NULL default '0';
--------------------------------------------------------------------------------
/public/js/accordion.min.js:
--------------------------------------------------------------------------------
1 | function accordion(id,openall){if(id==undefined){id="accordion"}jQuery(document).ready(function(){$("#"+id).accordion({collapsible:true,heightStyle:"content"});if(openall){$("#"+id+" .ui-accordion-content").show()}})}
--------------------------------------------------------------------------------
/public/js/changeCIMenu.min.js:
--------------------------------------------------------------------------------
1 | var changeLink=function(idType){$.ajax({url:"../ajax/change_link.php",type:"POST",data:"id="+idType,dataType:"json",success:function(json){displayLink(json)}})};var displayLink=function(json){var link=json.link;$("a#linkDisplay").attr("href",link)};
--------------------------------------------------------------------------------
/install/sql/update-2.2.1.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE `glpi_plugin_cmdb_civalues` CHANGE `plugin_cmdb_cis_id` `items_id` INT(11) NOT NULL;
2 | ALTER TABLE `glpi_plugin_cmdb_civalues` ADD `itemtype` VARCHAR(255) NOT NULL;
3 | ALTER TABLE `glpi_plugin_cmdb_operationprocesses` ADD `date_creation` timestamp NULL DEFAULT NULL;
--------------------------------------------------------------------------------
/public/js/show_criticity.js.php:
--------------------------------------------------------------------------------
1 |
8 | var root = "";
9 | var citype = "";
10 |
11 | addCriticity(citype, root);
12 |
13 |
--------------------------------------------------------------------------------
/public/js/show_fields.min.js:
--------------------------------------------------------------------------------
1 | var changeField=function(idType,id){$.ajax({url:"../ajax/change_field.php",type:"POST",data:"idCIType="+idType.value+"&id="+id,dataType:"html",success:function(code_html){$("tr.field").remove();$("tr.fieldCI").after(code_html)},error:function(resultat,statut,erreur){alert(erreur)}})};var showDatepicker=function(){$(".datepicker").datepicker()};
--------------------------------------------------------------------------------
/public/js/changeCIMenu.js:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 |
7 |
8 | var changeLink = function (idType) {
9 | $.ajax({
10 | url: '../ajax/change_link.php',
11 | type: 'POST',
12 | data: 'id=' + idType,
13 | dataType: 'json',
14 | success: function (json) {
15 | displayLink(json);
16 | }
17 | });
18 | };
19 |
20 | var displayLink = function (json) {
21 | var link = json.link;
22 | $("a#linkDisplay").attr("href", link);
23 | };
24 |
--------------------------------------------------------------------------------
/install/sql/update-3.1.4.sql:
--------------------------------------------------------------------------------
1 | UPDATE `glpi_items_tickets` SET `itemtype` = 'GlpiPlugin\\Resources\\Resource' WHERE `itemtype` = 'PluginResourcesResource';
2 | UPDATE `glpi_items_problems` SET `itemtype` = 'GlpiPlugin\\Resources\\Resource' WHERE `itemtype` = 'PluginResourcesResource';
3 | UPDATE `glpi_changes_items` SET `itemtype` = 'GlpiPlugin\\Cmdb\\Operationprocess' WHERE `itemtype` = 'PluginCmdbOperationprocess';
4 | UPDATE `glpi_documents_items` SET `itemtype` = 'GlpiPlugin\\Cmdb\\Operationprocess' WHERE `itemtype` = 'PluginCmdbOperationprocess';
5 | UPDATE `glpi_documents_items` SET `itemtype` = 'GlpiPlugin\\Cmdb\\CIType' WHERE `itemtype` = 'PluginCmdbCIType';
6 |
--------------------------------------------------------------------------------
/public/js/accordion.js:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 |
7 |
8 | function accordion(id, openall) {
9 | if (id == undefined) {
10 | id = 'accordion';
11 | }
12 | jQuery(document).ready(function () {
13 | $("#"+id).accordion({
14 | collapsible: true,
15 | //active:[0, 1, 2, 3],
16 | heightStyle: "content"
17 | });
18 | if (openall) {
19 | $('#'+id +' .ui-accordion-content').show();
20 | }
21 | });
22 | };
--------------------------------------------------------------------------------
/tools/update_mo.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 | #!/usr/bin/perl -w
3 |
4 | if (@ARGV!=0){
5 | print "USAGE update_mo.pl\n\n";
6 |
7 | exit();
8 | }
9 |
10 |
11 | opendir(DIRHANDLE,'locales')||die "ERROR: can not read current directory\n";
12 | foreach (readdir(DIRHANDLE)){
13 | if ($_ ne '..' && $_ ne '.'){
14 |
15 | if(!(-l "$dir/$_")){
16 | if (index($_,".po",0)==length($_)-3) {
17 | $lang=$_;
18 | $lang=~s/\.po//;
19 |
20 | `msgfmt locales/$_ -o locales/$lang.mo`;
21 | }
22 | }
23 |
24 | }
25 | }
26 | closedir DIRHANDLE;
27 |
28 | #
29 | #
30 |
--------------------------------------------------------------------------------
/public/js/show_fields.js:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 |
7 |
8 | var changeField = function (idType, id) {
9 | $.ajax({
10 | url: '../ajax/change_field.php',
11 | type: 'POST',
12 | data: 'idCIType=' + idType.value + '&id=' + id,
13 | dataType: 'html',
14 | success: function (code_html) {
15 | $("tr.field").remove();
16 | $("tr.fieldCI").after(code_html);
17 | },
18 | error: function (resultat, statut, erreur) {
19 | alert(erreur);
20 | }
21 | });
22 | };
23 |
24 | var showDatepicker = function () {
25 | $(".datepicker").datepicker();
26 | };
--------------------------------------------------------------------------------
/.github/workflows/updatepot.yml:
--------------------------------------------------------------------------------
1 | name: Update POT
2 | on:
3 | push:
4 | branches: [ master ]
5 | paths-ignore:
6 | - 'locales/**'
7 |
8 | env:
9 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 | jobs:
11 | run:
12 |
13 | name: Update POT
14 |
15 | runs-on: ubuntu-latest
16 | steps:
17 | - name: Checkout repo
18 | uses: actions/checkout@v4
19 |
20 | - name: install xgettext
21 |
22 | run: sudo apt-get install gettext;
23 | - name: Update POT
24 | run: sh tools/extract_template.sh;
25 |
26 | - name: Commit changes
27 | uses: EndBug/add-and-commit@v9
28 | with:
29 | message: "Update POT"
30 |
31 | - name: Push changes
32 | uses: actions-go/push@master
33 | with:
34 | commit-message: ''
35 |
36 |
--------------------------------------------------------------------------------
/tools/update_po.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 | #!/usr/bin/perl -w
3 |
4 | if (@ARGV!=2){
5 | print "USAGE update_po.pl transifex_login transifex_password\n\n";
6 |
7 | exit();
8 | }
9 | $user = $ARGV[0];
10 | $password = $ARGV[1];
11 |
12 | opendir(DIRHANDLE,'locales')||die "ERROR: can not read current directory\n";
13 | foreach (readdir(DIRHANDLE)){
14 | if ($_ ne '..' && $_ ne '.'){
15 |
16 | if(!(-l "$dir/$_")){
17 | if (index($_,".po",0)==length($_)-3) {
18 | $lang=$_;
19 | $lang=~s/\.po//;
20 |
21 | `wget --user=$user --password=$password --output-document=locales/$_ http://www.transifex.com/api/2/project/GLPI_ocsinventoryng/resource/glpi_ocsinventoryng-version-100/translation/$lang/?file=$_`;
22 | }
23 | }
24 |
25 | }
26 | }
27 | closedir DIRHANDLE;
28 |
29 | #
30 | #
31 |
--------------------------------------------------------------------------------
/public/js/function_form_CIType.min.js:
--------------------------------------------------------------------------------
1 | var deleteField=function(id){$(function(){$("#"+id).remove()})};var addHiddenDeletedField=function(id){$("#fields").append("")};function checkboxAction(){$(function(){if($("#is_imported").is(":checked")){$(".newItem").hide();$("tr[name='importedItem']").each(function(){$(this).show()})}else{$("tr[name='importedItem']").each(function(){$(this).hide()});$(".newItem").show()}})}var resetFields=function(id,tabType){$("#fields tr.field").remove();$("#fields input[type='hidden']").remove();$.ajax({url:"../ajax/reset_fields_citypes.php",type:"POST",data:"id="+id+"&tabType="+tabType+"&action=reset",dataType:"html",success:function(code_html){$("#fields").append(code_html)}})};function getRandomInt(min,max){return Math.floor(Math.random()*(max-min))+min}var addField=function(tabType){var rows=getRandomInt(0,1e6);$.ajax({url:"../ajax/reset_fields_citypes.php",type:"POST",data:"rows="+rows+"&tabType="+tabType+"&action=add",dataType:"html",success:function(code_html){$("#newfields").append(code_html)}})};
--------------------------------------------------------------------------------
/public/js/show_criticity.min.js:
--------------------------------------------------------------------------------
1 | function addCriticity(param,root){$("document").ready(function(){$(document).ajaxComplete(function(event,xhr,option){var paramFinder=/[?&]?_glpi_tab=([^&]+)(&|$)/;var ajaxTab_param=paramFinder.exec(option.url);var is_good_tab=false;var itemtype;if(ajaxTab_param!=undefined){$.each(param,function(index,value){var nameTab=value.concat("$main");if(nameTab==ajaxTab_param[1]){is_good_tab=true;itemtype=value}})}if(is_good_tab){var urlAjax="";paramFinder=/[?&]?id=([^&]+)(&|$)/;var paramId=paramFinder.exec(option.url);var id;if(paramId==null){id=-1}else{id=paramId[1]}urlAjax=root+"/ajax/criticity_values.php";var hidden_fields=""+"";$.ajax({url:urlAjax+"?itemtype="+itemtype+"&id="+id,success:function(data){if($('tr[id="plugin_cmdb_tr"]').length==0){if(itemtype=="Computer"){$('input[name="autoupdatesystems_id"]').closest("tr").after(data+hidden_fields)}else{$("table#mainformtable tr.tab_bg_1").last().after(data+hidden_fields)}}}})}},this)})}
--------------------------------------------------------------------------------
/index.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
--------------------------------------------------------------------------------
/ajax/index.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
--------------------------------------------------------------------------------
/front/index.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
--------------------------------------------------------------------------------
/.github/workflows/generatemo.yml:
--------------------------------------------------------------------------------
1 | name: Generate MO
2 | on:
3 | push:
4 | branches: [ master ]
5 | paths:
6 | - '**.po'
7 | env:
8 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 | jobs:
10 | run:
11 |
12 | name: Generate mo
13 | runs-on: ubuntu-latest
14 | steps:
15 | - name: Checkout repo
16 | uses: actions/checkout@v4
17 |
18 | - name: Setup Perl environment
19 | # You may pin to the exact commit or the version.
20 | # uses: shogo82148/actions-setup-perl@8d2e3d59a9516b785ed32169d48a4888eaa9b514
21 | uses: shogo82148/actions-setup-perl@v1
22 | - name: msgfmt
23 | # You may pin to the exact commit or the version.
24 | # uses: whtsky/msgfmt-action@6b2181f051b002182d01a1e1f1aff216230c5a4d
25 | uses: whtsky/msgfmt-action@20190305
26 | - name: Generate mo
27 | run: perl tools/update_mo.pl;
28 |
29 | - name: Commit changes
30 | uses: EndBug/add-and-commit@v9
31 | with:
32 |
33 | message: "Generate mo"
34 | - name: Push changes
35 |
36 | uses: actions-go/push@master
37 | with:
38 | commit-message: ''
39 |
40 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # cmdb
2 | Plugin CMDB pour GLPI
3 |
4 | Ce plugin est sur Transifex - Aidez-nous à le traduire :
5 | https://www.transifex.com/infotelGLPI/GLPI_cmdb/
6 |
7 | Ce plugin vous permet :
8 |
9 | > * D'ajouter une icône personnalisée par type d'objets (exemple Type Serveur)
10 | > * D'ajouter une zone d'informations avec des champs personnalisés dans l'analyse d'impact
11 |
12 | Déprécié - Anciennes fonctionnalités (Objets personnalisés disponibles avec GLPI 11)
13 |
14 | > * D'ajouter un objet Service (pour l'utilisation avec l'analyse d'impact)
15 | > * D'ajouter des objets du coeur non géré par l'analyse d'impact
16 | > * D'ajouter des objets supplémentaires
17 |
18 | ***********************
19 |
20 | This plugin is on Transifex - Help us to translate :
21 | https://www.transifex.com/infotelGLPI/GLPI_cmdb/
22 |
23 | This plugin allows you to:
24 |
25 | > * Add a custom icon for each object type (e.g., Server Type)
26 | > * Add an information area with custom fields into impact analysis
27 |
28 | Deprecated - Legacy features (Custom objects available with GLPI 11)
29 |
30 | > * Add a Service object (for use with impact analysis)
31 | > * Add core objects not managed by the impact analysis
32 | > * Add additional objects
33 |
--------------------------------------------------------------------------------
/ajax/change_field.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | use GlpiPlugin\Cmdb\CiFields;
31 |
32 | Session::checkRight('plugin_cmdb_cis', UPDATE);
33 |
34 | $fields = new CiFields();
35 | $fields->setFieldByType($_POST["idCIType"], $_POST["id"]);
36 |
--------------------------------------------------------------------------------
/ajax/impact_item_infos.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | use GlpiPlugin\Cmdb\ImpactInfo;
31 |
32 | if (isset($_GET['itemtype']) && isset($_GET['itemId'])) {
33 | $impactInfo = new ImpactInfo();
34 | $impactInfo->showInfos($_GET['itemtype'], $_GET['itemId']);
35 | }
36 |
--------------------------------------------------------------------------------
/ajax/dropdownInfoFields.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | use GlpiPlugin\Cmdb\CIType;
31 |
32 | if (strpos($_SERVER['PHP_SELF'], "dropdownInfoFields.php")) {
33 | header("Content-Type: text/html; charset=UTF-8");
34 | Html::header_nocache();
35 | }
36 | Session::checkRight('plugin_cmdb_citypes', UPDATE);
37 | CIType::selectCriterias($_POST['itemtype']);
38 |
--------------------------------------------------------------------------------
/src/CiValues.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | namespace GlpiPlugin\Cmdb;
31 |
32 | use CommonDBTM;
33 |
34 | if (!defined('GLPI_ROOT')) {
35 | die("Sorry. You can't access directly to this file");
36 | }
37 |
38 | /**
39 | * Class CiValues
40 | */
41 | class CiValues extends CommonDBTM {
42 |
43 | static $rightname = "plugin_cmdb_cis";
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/CIType_Document.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | namespace GlpiPlugin\Cmdb;
31 |
32 | use CommonDBTM;
33 |
34 | if (!defined('GLPI_ROOT')) {
35 | die("Sorry. You can't access directly to this file");
36 | }
37 |
38 | /**
39 | * Class CIType_Document
40 | */
41 | class CIType_Document extends CommonDBTM {
42 |
43 | static $rightname = "plugin_cmdb_citypes";
44 | }
45 |
--------------------------------------------------------------------------------
/ajax/dropdownTypeByCIType.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | use GlpiPlugin\Cmdb\CIType;
31 |
32 | if (strpos($_SERVER['PHP_SELF'], "dropdownTypeByCIType.php")) {
33 | header("Content-Type: text/html; charset=UTF-8");
34 | Html::header_nocache();
35 | }
36 | Session::checkRight('plugin_cmdb_citypes', UPDATE);
37 | CIType::selectTypesByCIType($_POST['itemtype'], $_POST['id']);
38 |
--------------------------------------------------------------------------------
/front/impacticon.php:
--------------------------------------------------------------------------------
1 | .
28 | --------------------------------------------------------------------------
29 | */
30 |
31 | use Glpi\Exception\Http\AccessDeniedHttpException;
32 | use GlpiPlugin\Cmdb\ImpactIcon;
33 |
34 | Html::header(ImpactIcon::getTypeName(2), '', "config", ImpactIcon::class);
35 |
36 | $impactIcon = new ImpactIcon();
37 | $impactIcon->checkGlobal(READ);
38 |
39 | if ($impactIcon->canView()) {
40 | Search::show(ImpactIcon::getType());
41 | } else {
42 | throw new AccessDeniedHttpException();
43 | }
44 | Html::footer();
45 |
--------------------------------------------------------------------------------
/front/impactinfo.php:
--------------------------------------------------------------------------------
1 | .
28 | --------------------------------------------------------------------------
29 | */
30 |
31 | use Glpi\Exception\Http\AccessDeniedHttpException;
32 | use GlpiPlugin\Cmdb\ImpactInfo;
33 |
34 | Html::header(ImpactInfo::getTypeName(2), '', "config", ImpactInfo::class);
35 |
36 | $impactInfo = new ImpactInfo();
37 | $impactInfo->checkGlobal(READ);
38 |
39 | if ($impactInfo->canView()) {
40 | Search::show(ImpactInfo::getType());
41 | } else {
42 | throw new AccessDeniedHttpException();
43 | }
44 | Html::footer();
45 |
--------------------------------------------------------------------------------
/front/ci.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | use Glpi\Exception\Http\AccessDeniedHttpException;
31 | use GlpiPlugin\Cmdb\CI;
32 | use GlpiPlugin\Cmdb\Cmdb;
33 | use GlpiPlugin\Cmdb\Menu;
34 |
35 | Html::header(Cmdb::getTypeName(2), '', "plugins", Menu::class, 'ci');
36 |
37 | $op = new CI();
38 | $op->checkGlobal(READ);
39 |
40 | if ($op->canView()) {
41 | Search::show(CI::class);
42 |
43 | } else {
44 |
45 | throw new AccessDeniedHttpException();
46 | }
47 | Html::footer();
48 |
--------------------------------------------------------------------------------
/ajax/change_link.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | use GlpiPlugin\Cmdb\CIType;
31 |
32 | Session::checkRight('plugin_cmdb_citypes', UPDATE);
33 |
34 | $data = [];
35 | $citype = new CIType();
36 | $citype->getFromDB($_POST['id']);
37 | if (isset($citype->fields["is_imported"])
38 | && $citype->fields["is_imported"]) {
39 | $data["link"] = Toolbox::getItemTypeSearchURL($citype->fields["name"]);
40 | } else {
41 | $data["link"] = $citype->fields["name"]::getSearchURL();
42 | }
43 |
44 | echo json_encode($data);
45 |
--------------------------------------------------------------------------------
/ajax/impact_infos_fields.php:
--------------------------------------------------------------------------------
1 | .
28 | --------------------------------------------------------------------------
29 | */
30 |
31 | use GlpiPlugin\Cmdb\ImpactInfoField;
32 |
33 | header("Content-Type: text/html; charset=UTF-8");
34 | Html::header_nocache();
35 |
36 | Session::checkLoginUser();
37 |
38 | $itemtype = null;
39 | if (isset($_POST['itemtype']) && $_POST['itemtype']) {
40 | $itemtype = $_POST['itemtype'];
41 | }
42 |
43 | $id = 0;
44 | if (isset($_POST['id']) && $_POST['id']) {
45 | $id = $_POST['id'];
46 |
47 | $impactInfoField = new ImpactInfoField();
48 | $impactInfoField->showInfos($itemtype, $id);
49 | }
50 |
--------------------------------------------------------------------------------
/front/operationprocess.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | use Glpi\Exception\Http\AccessDeniedHttpException;
31 | use GlpiPlugin\Cmdb\OperationProcess;
32 | use GlpiPlugin\Cmdb\OperationProcessMenu;
33 |
34 | Session::checkRight("plugin_cmdb_operationprocesses", READ);
35 |
36 | Html::header(OperationProcess::getTypeName(2), '', "assets", OperationProcessMenu::class);
37 |
38 | $op = new OperationProcess();
39 |
40 | if ($op->canView()) {
41 | Search::show(OperationProcess::class);
42 |
43 | } else {
44 |
45 | throw new AccessDeniedHttpException();
46 | }
47 | Html::footer();
48 |
--------------------------------------------------------------------------------
/front/menu.php:
--------------------------------------------------------------------------------
1 | .
28 | --------------------------------------------------------------------------
29 | */
30 |
31 |
32 | use Glpi\Exception\Http\AccessDeniedHttpException;
33 | use GlpiPlugin\Cmdb\Cmdb;
34 | use GlpiPlugin\Cmdb\Menu;
35 |
36 | Html::header(Cmdb::getTypeName(2), '', "plugins", Menu::class);
37 |
38 | $cmdb = new Cmdb();
39 | $cmdb->checkGlobal(READ);
40 |
41 | if ($cmdb->canView()) {
42 | echo "
";
43 | echo "" . __("With GLPI 11, you can create new custom assets, so migrate your existing objets to core", 'cmdb') . "";
44 | echo "
";
45 | $cmdb->displayMenu();
46 | } else {
47 | throw new AccessDeniedHttpException();
48 | }
49 | Html::footer();
50 |
--------------------------------------------------------------------------------
/ajax/criticity_values.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | use GlpiPlugin\Cmdb\CI;
31 | use GlpiPlugin\Cmdb\Criticity;
32 | use GlpiPlugin\Cmdb\Criticity_Item;
33 |
34 | Session::checkRight('plugin_cmdb_cis', UPDATE);
35 | $class = ($_REQUEST['itemtype'] == 'ticket') ? "tab_bg_1" : '';
36 | $itemtype = $_REQUEST['itemtype'];
37 |
38 | echo "";
39 | echo "| " . Criticity_Item::getTypeName(1) . " | ";
40 | echo "";
41 | $crit = new Criticity();
42 | $crit->criticityDropdown(["itemtype" => $itemtype]);
43 | echo " | ";
44 | if ($itemtype != CI::class) {
45 | echo " | ";
46 | }
47 | echo "
";
48 |
--------------------------------------------------------------------------------
/src/OperationProcessState.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | namespace GlpiPlugin\Cmdb;
31 |
32 | use CommonDropdown;
33 |
34 | if (!defined('GLPI_ROOT')) {
35 | die("Sorry. You can't access directly to this file");
36 | }
37 |
38 | /**
39 | * Class OperationProcessState
40 | */
41 | class OperationProcessState extends CommonDropdown {
42 |
43 | static $rightname = "plugin_cmdb_operationprocesses";
44 |
45 | /**
46 | * @since version 0.85
47 | *
48 | * @param $nb
49 | *
50 | * @return string
51 | */
52 | static function getTypeName($nb = 0) {
53 |
54 | return _n('State of service', 'States of service', $nb, 'cmdb');
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/public/js/function_form_CIType.js:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 |
7 |
8 | var deleteField = function (id) {
9 | $(function () {
10 | $("#" + id).remove();
11 | });
12 | };
13 |
14 | var addHiddenDeletedField = function (id) {
15 | $("#fields").append("");
16 | };
17 |
18 | function checkboxAction() {
19 | $(function () {
20 | if ($("#is_imported").is(':checked')) {
21 | $(".newItem").hide();
22 | $("tr[name='importedItem']").each(function () {
23 | $(this).show();
24 | });
25 | } else {
26 | $("tr[name='importedItem']").each(function () {
27 | $(this).hide();
28 | });
29 | $(".newItem").show();
30 | }
31 | });
32 | }
33 |
34 |
35 | var resetFields = function (id, tabType) {
36 | $("#fields tr.field").remove();
37 | $("#fields input[type='hidden']").remove();
38 | $.ajax({
39 | url: '../ajax/reset_fields_citypes.php',
40 | type: 'POST',
41 | data: 'id=' + id + '&tabType=' + tabType + '&action=reset',
42 | dataType: 'html',
43 | success: function (code_html) {
44 | $("#fields").append(code_html);
45 | }
46 | });
47 | };
48 |
49 | function getRandomInt(min, max) {
50 | return Math.floor(Math.random() * (max - min)) + min;
51 | }
52 |
53 | var addField = function (tabType) {
54 | var rows = getRandomInt(0, 1000000);
55 | $.ajax({
56 | url: '../ajax/reset_fields_citypes.php',
57 | type: 'POST',
58 | data: 'rows=' + rows + '&tabType=' + tabType + '&action=add',
59 | dataType: 'html',
60 | success: function (code_html) {
61 | $("#newfields").append(code_html);
62 | }
63 | });
64 |
65 | };
66 |
--------------------------------------------------------------------------------
/front/impacticon.send.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 | use Glpi\Exception\Http\BadRequestHttpException;
30 |
31 | Session::checkLoginUser();
32 |
33 | $doc = new Document();
34 |
35 | if (isset($_GET['idDoc'])) { // docid for document
36 | if (!$doc->getFromDB($_GET['idDoc'])) {
37 | throw new BadRequestHttpException(__('Unknown file'));
38 | }
39 |
40 | if (!file_exists(GLPI_DOC_DIR . "/" . $doc->fields['filepath'])) {
41 | throw new BadRequestHttpException(__('File not found')); // Not found
42 | } else {
43 | if ($doc->fields['sha1sum'] && $doc->fields['sha1sum'] != sha1_file(GLPI_DOC_DIR . "/" . $doc->fields['filepath'])) {
44 | throw new BadRequestHttpException(__('File is altered (bad checksum)')); // Doc alterated
45 | } else {
46 | return $doc->getAsResponse();
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/install/sql/update-3.1.0.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_impacticons`;
2 | CREATE TABLE `glpi_plugin_cmdb_impacticons`
3 | (
4 | `id` int unsigned NOT NULL auto_increment,
5 | `itemtype` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
6 | `criteria` varchar(255) COLLATE utf8mb4_unicode_ci,
7 | `documents_id` int unsigned NOT NULL default '0',
8 | `name` varchar(255) collate utf8mb4_unicode_ci default '',
9 | PRIMARY KEY (`id`),
10 | UNIQUE (`itemtype`, `criteria`)
11 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
12 |
13 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_impactinfos`;
14 | CREATE TABLE `glpi_plugin_cmdb_impactinfos`
15 | (
16 | `id` int unsigned NOT NULL auto_increment,
17 | `itemtype` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
18 | PRIMARY KEY (`id`),
19 | UNIQUE (`itemtype`)
20 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
21 |
22 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_impactinfofields`;
23 | CREATE TABLE `glpi_plugin_cmdb_impactinfofields`
24 | (
25 | `id` int unsigned NOT NULL auto_increment,
26 | `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
27 | `field_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
28 | `plugin_cmdb_impactinfos_id` int unsigned NOT NULL default '0',
29 | `order` int unsigned NOT NULL,
30 | PRIMARY KEY (`id`),
31 | KEY `plugin_cmdb_impactinfos_id` (`plugin_cmdb_impactinfos_id`)
32 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
33 |
34 | INSERT INTO `glpi_displaypreferences` (`itemtype`, `num`, `rank`, `users_id`, `interface`)
35 | VALUES ('GlpiPlugin\\Cmdb\\Impactinfo', '2', '1', '0', 'central'),
36 | ('GlpiPlugin\\Cmdb\\Impactinfo', '3', '2', '0', 'central'),
37 | ('GlpiPlugin\\Cmdb\\Impactinfo', '4', '3', '0', 'central');
38 |
--------------------------------------------------------------------------------
/tools/extract_template.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 |
4 | # --- Étape 1 : Extraction des chaînes PHP ---
5 | find . -name '*.php' > php_files.list
6 |
7 | xgettext --files-from=php_files.list \
8 | --copyright-holder='Cmdb Development Team' \
9 | --package-name='Cmdb plugin' \
10 | -o locales/glpi.pot \
11 | -L PHP \
12 | --add-comments=TRANS \
13 | --from-code=UTF-8 \
14 | --force-po \
15 | --sort-output \
16 | --keyword=_n:1,2,4t \
17 | --keyword=__s:1,2t \
18 | --keyword=__:1,2t \
19 | --keyword=_e:1,2t \
20 | --keyword=_x:1c,2,3t \
21 | --keyword=_ex:1c,2,3t \
22 | --keyword=_nx:1c,2,3,5t \
23 | --keyword=_sx:1c,2,3t
24 |
25 | rm php_files.list
26 |
27 | # --- Étape 2 : Extraction des chaînes Twig ---
28 |
29 | # Append locales from Twig templates
30 | SCRIPT_DIR=$(dirname $0)
31 | WORKING_DIR=$(readlink -f "$SCRIPT_DIR/..") # Script will be executed from "vendor/bin" directory
32 | # Define translate function args
33 | F_ARGS_N="1,2"
34 | F_ARGS__S="1"
35 | F_ARGS__="1"
36 | F_ARGS_X="1c,2"
37 | F_ARGS_SX="1c,2"
38 | F_ARGS_NX="1c,2,3"
39 | F_ARGS_SN="1,2"
40 |
41 | for file in $(cd $WORKING_DIR && find -regextype posix-egrep -not -regex $EXCLUDE_REGEX "$SCRIPT_DIR/.." -name "*.twig")
42 | do
43 | # 1. Convert file content to replace "{{ function(.*) }}" by "" and extract strings via std input
44 | # 2. Replace "standard input:line_no" by file location in po file comments
45 | contents=`cat $file | sed -r "s|\{\{\s*([a-z0-9_]+\(.*\))\s*\}\}||gi"`
46 | cat $file | perl -0pe "s/\{\{(.*?)\}\}//gism" | xgettext - \
47 | -o locales/glpi.pot \
48 | -L PHP \
49 | --add-comments=TRANS \
50 | --from-code=UTF-8 \
51 | --force-po \
52 | --join-existing \
53 | --sort-output \
54 | --keyword=_n:$F_ARGS_N \
55 | --keyword=__:$F_ARGS__ \
56 | --keyword=_x:$F_ARGS_X \
57 | --keyword=_nx:$F_ARGS_NX
58 | sed -i -r "s|standard input:([0-9]+)|`echo $file | sed "s|./||"`:\1|g" locales/glpi.pot
59 | done
60 |
--------------------------------------------------------------------------------
/src/Autoloader.php:
--------------------------------------------------------------------------------
1 | setOptions($options);
12 | }
13 | }
14 |
15 | public function setOptions($options) {
16 | if (!is_array($options) && !($options instanceof \Traversable)) {
17 | throw new \InvalidArgumentException();
18 | }
19 |
20 | foreach ($options as $path) {
21 | if (!in_array($path, $this->paths)) {
22 | $this->paths[] = $path;
23 | }
24 | }
25 | return $this;
26 | }
27 |
28 | public function processClassname($classname) {
29 |
30 | preg_match("/^GlpiPlugin\\\\([A-Z][a-z0-9]+)\\\\([A-Z]\w+)$/", $classname, $matches);
31 |
32 | if (count($matches) < 3) {
33 | return false;
34 | } else {
35 | return $matches;
36 | }
37 |
38 | }
39 |
40 | public function autoload($classname) {
41 | $matches = $this->processClassname($classname);
42 |
43 | if ($matches !== false) {
44 |
45 | if (isset($matches[1]) && isset($matches[2])) {
46 | $plugin_name = $matches[1];
47 | $class_name = $matches[2];
48 |
49 | if ($plugin_name !== "Cmdb") {
50 | return false;
51 | }
52 |
53 | $filename = implode(".", [
54 | $class_name,
55 | "php"
56 | ]);
57 |
58 | foreach ($this->paths as $path) {
59 | $test = $path . DIRECTORY_SEPARATOR . $filename;
60 | if (file_exists($test)) {
61 | return include($test);
62 | }
63 | }
64 | }
65 | }
66 | return false;
67 | }
68 |
69 | public function register() {
70 | spl_autoload_register([$this, 'autoload']);
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/front/icon.send.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | use Glpi\Exception\Http\BadRequestHttpException;
31 |
32 | Session::checkLoginUser();
33 |
34 | $doc = new Document();
35 |
36 | if (isset($_GET['idDoc'])) { // docid for document
37 | if (!$doc->getFromDB($_GET['idDoc'])) {
38 | throw new BadRequestHttpException(__('Unknown file'), true);
39 | }
40 |
41 | if (!file_exists(GLPI_DOC_DIR . "/" . $doc->fields['filepath'])) {
42 | throw new BadRequestHttpException(__('File not found'));
43 | } else if ($doc->canViewFile($_GET)) {
44 | if ($doc->fields['sha1sum'] && $doc->fields['sha1sum'] != sha1_file(GLPI_DOC_DIR . "/" . $doc->fields['filepath'])) {
45 | throw new BadRequestHttpException(__('File is altered (bad checksum)'));
46 | } else {
47 | return $doc->getAsResponse();
48 | }
49 | } else {
50 | throw new BadRequestHttpException(__('Unauthorized access to this file'));
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/ajax/impact_infos_fields_dropdown.php:
--------------------------------------------------------------------------------
1 | .
28 | --------------------------------------------------------------------------
29 | */
30 |
31 | use GlpiPlugin\Cmdb\ImpactInfo;
32 |
33 | header("Content-Type: text/html; charset=UTF-8");
34 | Html::header_nocache();
35 |
36 | Session::checkLoginUser();
37 |
38 | $itemtype = null;
39 | if (isset($_POST['itemtype']) && $_POST['itemtype']) {
40 | $itemtype = $_POST['itemtype'];
41 | }
42 |
43 | $key = null;
44 | if (isset($_POST['key']) && $_POST['key']) {
45 | $key = $_POST['key'];
46 | }
47 |
48 | $used = [];
49 | if (isset($_POST['used']) && $_POST['used']) {
50 | $used = $_POST['used'];
51 | }
52 |
53 | $availableFields = ImpactInfo::getFieldsForItemtype($itemtype);
54 |
55 | $fields = $availableFields[$key];
56 | if ($used) {
57 | $tmp = [];
58 | foreach ($used as $field) {
59 | $tmp[$field] = $field;
60 | }
61 | $used = $tmp;
62 | }
63 | $unusedFields = count($used) ? array_diff_key($fields, $used) : $fields;
64 | ImpactInfo::makeDropdown($key, $unusedFields, $itemtype);
65 |
--------------------------------------------------------------------------------
/public/js/show_criticity.js:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 |
7 |
8 | function addCriticity(param, root) {
9 | $('document').ready(function () {
10 | $(document).ajaxComplete(function (event, xhr, option) {
11 |
12 | var paramFinder = /[?&]?_glpi_tab=([^&]+)(&|$)/;
13 |
14 | var ajaxTab_param = paramFinder.exec(option.url);
15 | var is_good_tab = false;
16 | var itemtype;
17 | if (ajaxTab_param != undefined) {
18 |
19 | $.each(param, function (index, value) {
20 | var nameTab = value.concat("$main");
21 |
22 | if (nameTab == ajaxTab_param[1]) {
23 | is_good_tab = true;
24 | itemtype = value;
25 | }
26 | });
27 | }
28 | if (is_good_tab) {
29 | var urlAjax = "";
30 | paramFinder = /[?&]?id=([^&]+)(&|$)/;
31 | var paramId = paramFinder.exec(option.url);
32 | var id;
33 | if (paramId == null) {
34 | id = -1;
35 | } else {
36 | id = paramId[1];
37 | }
38 |
39 | urlAjax = root + "/ajax/criticity_values.php";
40 |
41 | var hidden_fields = "" +
42 | "";
43 |
44 | $.ajax({
45 | url: urlAjax + "?itemtype=" + itemtype + "&id=" + id,
46 | success: function (data) {
47 |
48 | if ($('tr[id="plugin_cmdb_tr"]').length == 0) {
49 | if (itemtype == 'Computer') {
50 | $('input[name="autoupdatesystems_id"]').closest('tr').after(data + hidden_fields);
51 | } else {
52 | $('table#mainformtable tr.tab_bg_1').last().after(data + hidden_fields);
53 | }
54 | }
55 | }
56 | });
57 |
58 | }
59 |
60 | }, this);
61 | });
62 | }
63 |
--------------------------------------------------------------------------------
/src/OperationProcessMenu.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | namespace GlpiPlugin\Cmdb;
31 |
32 | use CommonGLPI;
33 |
34 | if (!defined('GLPI_ROOT')) {
35 | die("Sorry. You can't access directly to this file");
36 | }
37 |
38 | /**
39 | * Class OperationProcessMenu
40 | */
41 | class OperationProcessMenu extends CommonGLPI {
42 |
43 | static $rightname = 'plugin_cmdb_operationprocesses';
44 |
45 | /**
46 | * Get menu name
47 | *
48 | * @since version 0.85
49 | *
50 | * @return string menu shortcut key
51 | **/
52 | static function getMenuName() {
53 | return _n('Service', 'Services', 2, 'cmdb');
54 | }
55 |
56 |
57 | /**
58 | * get menu content
59 | *
60 | * @since version 0.85
61 | *
62 | * @return array for menu
63 | **/
64 | static function getMenuContent() {
65 |
66 | $menu = [];
67 | $menu['title'] = self::getMenuName();
68 | $menu['page'] = OperationProcess::getSearchURL(false);
69 | $menu['links']['search'] = OperationProcess::getSearchURL(false);
70 | if (OperationProcess::canCreate()) {
71 | $menu['links']['add'] = OperationProcess::getFormURL(false);
72 | }
73 | $menu['icon'] = OperationProcess::getIcon();
74 |
75 | return $menu;
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/ajax/dropdownStateOperationprocesses.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | global $DB;
31 |
32 | use GlpiPlugin\Cmdb\OperationProcess;
33 |
34 | if (strpos($_SERVER['PHP_SELF'], "dropdownStateOperationProcesses.php")) {
35 | header("Content-Type: text/html; charset=UTF-8");
36 | Html::header_nocache();
37 | }
38 |
39 | Session::checkCentralAccess();
40 |
41 | // Make a select box
42 | if (isset($_POST["operationprocessstate"])) {
43 | $used = [];
44 |
45 | // Clean used array
46 | if (isset($_POST['used'])
47 | && is_array($_POST['used'])
48 | && (count($_POST['used']) > 0)) {
49 | $criteria = [
50 | 'FROM' => 'glpi_plugin_cmdb_operationprocesses',
51 | 'WHERE' => [
52 | 'id' => $_POST['used'],
53 | 'plugin_cmdb_operationprocessstates_id' => $_POST["operationprocessstate"]
54 | ]
55 | ];
56 |
57 | foreach ($DB->request($criteria) AS $data) {
58 | $used[$data['id']] = $data['id'];
59 | }
60 | }
61 |
62 | Dropdown::show(OperationProcess::class,
63 | ['name' => $_POST['myname'],
64 | 'used' => $used,
65 | 'width' => '50%',
66 | 'entity' => $_POST['entity'],
67 | 'rand' => $_POST['rand'],
68 | 'condition' => ["plugin_cmdb_operationprocessstates_id" => $_POST["operationprocessstate"]]]);
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/front/ci.form.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 |
31 | use GlpiPlugin\Cmdb\CI;
32 | use GlpiPlugin\Cmdb\Cmdb;
33 | use GlpiPlugin\Cmdb\Menu;
34 |
35 | if (!isset($_GET["id"])) {
36 | $_GET["id"] = "";
37 | }
38 | if (!isset($_GET["withtemplate"])) {
39 | $_GET["withtemplate"] = "";
40 | }
41 |
42 | $ci = new CI();
43 |
44 | if (isset($_POST["add"])) {
45 |
46 | $ci->check(-1, CREATE, $_POST);
47 | $newID = $ci->add($_POST);
48 | if ($_SESSION['glpibackcreated']) {
49 | Html::redirect($ci->getFormURL() . "?id=" . $newID);
50 | }
51 | Html::back();
52 |
53 | } else if (isset($_POST["delete"])) {
54 |
55 | $ci->check($_POST['id'], DELETE);
56 | $ci->delete($_POST);
57 | $ci->redirectToList();
58 |
59 | } else if (isset($_POST["restore"])) {
60 |
61 | $ci->check($_POST['id'], PURGE);
62 | $ci->restore($_POST);
63 | $ci->redirectToList();
64 |
65 | } else if (isset($_POST["purge"])) {
66 |
67 | if ($ci->ciTypesUsed($_POST)) {
68 | Session::addMessageAfterRedirect(__("You can't delete this item, because this item is used on CMDB !", 'cmdb'),
69 | false, ERROR);
70 | Html::back();
71 | } else {
72 | $ci->check($_POST['id'], PURGE);
73 | $ci->delete($_POST, 1);
74 | $ci->redirectToList();
75 | }
76 |
77 | } else if (isset($_POST["update"])) {
78 |
79 | $ci->check($_POST['id'], UPDATE);
80 | $ci->update($_POST);
81 | Html::back();
82 |
83 | } else {
84 |
85 | $ci->checkGlobal(READ);
86 |
87 | Html::header(Cmdb::getTypeName(2), '', "plugins", Menu::class, 'ci');
88 |
89 | $ci->display($_GET);
90 |
91 | Html::footer();
92 | }
93 |
--------------------------------------------------------------------------------
/ajax/reset_fields_citypes.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | use GlpiPlugin\Cmdb\CiFields;
31 |
32 | $tabType = explode(",", $_POST['tabType']);
33 |
34 | if ($_POST["action"] == "reset") {
35 | $results = null;
36 | $tabType = explode(",", $_POST['tabType']);
37 | $tabFieldsTmp = [];
38 |
39 | if (isset($_POST['id'])) {
40 | $cifields = new CiFields();
41 | if ($cifields->getFromDBByCrit(['plugin_cmdb_citypes_id' => $_POST['id']])) {
42 | $tabFieldsTmp[] = $cifields->fields;
43 |
44 | foreach ($tabFieldsTmp as $k => $d) {
45 | $i = $d['id'];
46 | echo "";
47 | echo "| ";
48 | $name = "nameField[$i]";
49 | echo Html::input($name, ['value' => $d['name'], 'size' => 40, 'required' => 'required']);
50 | echo " | ";
51 | echo "";
52 | Dropdown::showFromArray("typeField[$i]", $tabType, ["value" => $d['typefield'], "width" => 125]);
53 | echo " | ";
54 | echo "";
55 | echo "
";
56 | }
57 | }
58 | }
59 | } elseif ($_POST["action"] == "add") {
60 | echo "";
61 | echo "| ";
62 | $name = "nameNewField[]";
63 | echo Html::input($name, ['value' => '', 'size' => 40, 'required' => 'required']);
64 | echo " | ";
65 | echo "";
66 | Dropdown::showFromArray("typeNewField[]", $tabType, ["width" => 125]);
67 | echo " | ";
68 | echo " | ";
69 | echo "
";
70 | }
71 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 |
2 | on:
3 | push:
4 | # Sequence of patterns matched against refs/tags
5 | tags:
6 | - '*.*.*' # Push events to matching ex:20.15.10
7 |
8 | name: Create release with tag
9 | env:
10 | TAG_VALUE: ${GITHUB_REF/refs\/tags\//}
11 | jobs:
12 | build:
13 | name: Upload Release Asset
14 | runs-on: ubuntu-latest
15 | steps:
16 | - name: Checkout code
17 | uses: actions/checkout@v2
18 | - name: Build project # This would actually build your project, using zip for an example artifact
19 | id: build_
20 | env:
21 | GITHUB_NAME: ${{ github.event.repository.name }}
22 |
23 |
24 | run: sudo apt-get install libxml-xpath-perl;echo $(xpath -e '/root/versions/version[num="'${GITHUB_REF/refs\/tags\//}'"]/compatibility/text()' $GITHUB_NAME.xml);echo ::set-output name=version_glpi::$(xpath -e '/root/versions/version[num="'${GITHUB_REF/refs\/tags\//}'"]/compatibility/text()' $GITHUB_NAME.xml); rm -rf $GITHUB_NAME.xml tools wiki screenshots test .git .github ISSUE_TEMPLATE.md TODO.txt $GITHUB_NAME.png;cd ..; tar jcvf glpi-$GITHUB_NAME-${GITHUB_REF/refs\/tags\//}.tar.bz2 $GITHUB_NAME;ls -al;echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//};echo ${{ steps.getxml.outputs.info }};
25 | # run: rm -rf $GITHUB_NAME.xml tools wiki screenshots test ISSUE_TEMPLATE.md TODO.txt $GITHUB_NAME.png; tar -zcvf glpi-$GITHUB_NAME-$GITHUB_TAG.tar.gz $GITHUB_NAME
26 | - name: Create Release
27 | id: create_release
28 | uses: actions/create-release@v1
29 | env:
30 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 | with:
32 | tag_name: ${{ github.ref }}
33 | release_name: |
34 | GLPI ${{ steps.build_.outputs.version_glpi }} : Version ${{ github.ref }} disponible / available
35 | body : Version ${{ steps.build_.outputs.tag }} released for GLPI ${{ steps.build_.outputs.version_glpi }}
36 | draft: false
37 | prerelease: true
38 | - name: Upload Release Asset
39 | id: upload-release-asset
40 | uses: actions/upload-release-asset@v1
41 | env:
42 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43 | GITHUB_NAME: ${{ github.event.repository.name }}
44 | with:
45 | upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
46 | asset_path: /home/runner/work/${{ github.event.repository.name }}/glpi-${{ github.event.repository.name }}-${{ steps.build_.outputs.tag }}.tar.bz2
47 | asset_name: glpi-${{ github.event.repository.name }}-${{ steps.build_.outputs.tag }}.tar.bz2
48 | asset_content_type: application/zip
49 |
50 |
--------------------------------------------------------------------------------
/src/Menu.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | namespace GlpiPlugin\Cmdb;
31 |
32 | use CommonGLPI;
33 |
34 | if (!defined('GLPI_ROOT')) {
35 | die("Sorry. You can't access directly to this file");
36 | }
37 |
38 | /**
39 | * Class Menu
40 | */
41 | class Menu extends CommonGLPI {
42 |
43 | static $rightname = 'plugin_cmdb_cis';
44 |
45 | /**
46 | * Return the localized name of the current Type
47 | *
48 | * @return string
49 | * */
50 | public static function getTypeName($nb = 0) {
51 | return __('CMDB', 'cmdb');
52 | }
53 |
54 |
55 | /**
56 | * get menu content
57 | *
58 | * @since version 0.85
59 | *
60 | * @return array for menu
61 | **/
62 | static function getMenuContent() {
63 |
64 | $menu = [];
65 | $menu['title'] = self::getTypeName();
66 |
67 | $menu['page'] = "/plugins/cmdb/front/menu.php";
68 | $menu['links']["".__('Configure Type of Item Configuration', 'cmdb')] = '/plugins/cmdb/front/citype.php';
69 | //ItemConfiguration
70 | $menu['options']['ci']['title'] = __s("Item Configuration", 'cmdb');
71 | $menu['options']['ci']['page'] = '/plugins/cmdb/front/ci.php';
72 | $menu['options']['ci']['links']['add'] = '/plugins/cmdb/front/ci.form.php';
73 | $menu['options']['ci']['links']['search'] = '/plugins/cmdb/front/ci.php';
74 |
75 | $menu['icon'] = OperationProcess::getIcon();
76 | //baseline
77 | // $menu['options']['baseline']['title'] = __('Baseline', 'cmdb');
78 | // $menu['options']['baseline']['page'] = PLUGIN_CMDB_NOTFULL_WEBDIR.'front/baseline.php';
79 | // $menu['options']['baseline']['links']['search'] = PLUGIN_CMDB_NOTFULL_WEBDIR.'front/baseline.php';
80 |
81 | return $menu;
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/ajax/impact_icon_criterias.php:
--------------------------------------------------------------------------------
1 | .
28 | --------------------------------------------------------------------------
29 | */
30 |
31 | use GlpiPlugin\Cmdb\ImpactIcon;
32 |
33 | header("Content-Type: text/html; charset=UTF-8");
34 | Html::header_nocache();
35 |
36 | Session::checkLoginUser();
37 |
38 | $itemtype = null;
39 | if (isset($_POST['itemtype']) && $_POST['itemtype']) {
40 | $itemtype = $_POST['itemtype'];
41 | }
42 |
43 | $id = 0;
44 | if (isset($_POST['id']) && $_POST['id']) {
45 | $id = $_POST['id'];
46 | }
47 | $impactIcon = new ImpactIcon();
48 | if ($id > 0) {
49 | $impactIcon->getFromDB($id);
50 | }
51 |
52 | if (in_array($itemtype, array_keys(ImpactIcon::getCriterias()))) {
53 | // label
54 | echo "";
55 | switch($itemtype) {
56 | case NetworkEquipment::getType() :
57 | echo NetworkEquipmentType::getTypeName();
58 | break;
59 | case Computer::getType() :
60 | echo ComputerType::getTypeName();
61 | break;
62 | case Appliance::getType() :
63 | echo ApplianceType::getTypeName();
64 | break;
65 | }
66 | echo " | ";
67 |
68 | // value
69 | echo "";
70 | $value = 0; // default value for new NetworkEquipment's networkequipmenttypes_id
71 | if ($id > 0) {
72 | // only set value if the saved itemtype correspond
73 | if ($impactIcon->fields['itemtype'] == $itemtype) {
74 | $value = $impactIcon->fields['criteria'];
75 | }
76 | }
77 | switch($itemtype) {
78 | case NetworkEquipment::getType() :
79 | NetworkEquipmentType::dropdown([
80 | 'value' => $value
81 | ]);
82 | break;
83 | case Computer::getType() :
84 | ComputerType::dropdown([
85 | 'value' => $value
86 | ]);
87 | break;
88 | case Appliance::getType() :
89 | ApplianceType::dropdown([
90 | 'value' => $value
91 | ]);
92 | break;
93 | }
94 | echo " | ";
95 | }
96 |
--------------------------------------------------------------------------------
/public/js/cmdb_impact.js.php:
--------------------------------------------------------------------------------
1 |
6 |
7 | function cmdbLoadInfos(event) {
8 | let itemtype = event.target.data('id')
9 | .split(GLPIImpact.NODE_ID_SEPERATOR)[0];
10 | let itemId = event.target.data('id')
11 | .split(GLPIImpact.NODE_ID_SEPERATOR)[1];
12 |
13 | let tooltipContainer = document.getElementById('cmdb-tooltip');
14 | if (!tooltipContainer) {
15 | tooltipContainer = document.createElement('div');
16 | tooltipContainer.id = 'cmdb-tooltip';
17 | tooltipContainer.style.position = 'absolute';
18 | tooltipContainer.style.maxWidth = '100%';
19 | tooltipContainer.style.backgroundColor = '#FFF';
20 | tooltipContainer.style.bottom = 0;
21 | tooltipContainer.style.left = 0;
22 | tooltipContainer.style.zIndex = 1052; // 1051 = value from the impact analysis sidebar when fullscreened
23 | tooltipContainer.classList = 'border rounded px-1';
24 | document.querySelector("td[class='network-parent']").append(tooltipContainer);
25 | }
26 | tooltipContainer.innerHTML = "";
27 | $.ajax({
28 | type: "GET",
29 | url: cmdbRootUrl + '/ajax/impact_item_infos.php',
30 | data: {
31 | 'itemtype': itemtype,
32 | 'itemId': itemId
33 | },
34 | success: function (data) {
35 | tooltipContainer.innerHTML = data;
36 | document.getElementById('close-cmdb-tooltip').addEventListener('click', e => {
37 | tooltipContainer.parentNode.removeChild(tooltipContainer);
38 | })
39 | // activate tooltips created for long lists (see Html::showToolTip)
40 | const scripts = tooltipContainer.getElementsByTagName('script');
41 | for (let i = 0; i < scripts.length; i++) {
42 | eval(scripts[i].text);
43 | }
44 | },
45 | error: function () {
46 | alert("error");
47 | }
48 | });
49 | }
50 |
51 | $(document).ajaxComplete(function (event, xhr, settings) {
52 | if (settings.url.includes('common.tabs.php')) {
53 | if (settings.url.includes('_glpi_tab=Impact')) {
54 | // let GLPIImpact the time to initiate cy before doing any modifications to it
55 | setTimeout(() => {
56 | let contextMenu = {
57 | menuItems: GLPIImpact.getContextMenuItems(),
58 | menuItemClasses: [],
59 | contextMenuClasses: []
60 | }
61 |
62 | contextMenu.menuItems.push({
63 | id: 'Test',
64 | content: '' + __("Informations", 'cmdb'),
65 | selector: 'node[link]',
66 | onClickFunction: cmdbLoadInfos
67 | });
68 |
69 | GLPIImpact.cy.contextMenus(contextMenu);
70 | }, 1000)
71 | }
72 | }
73 | });
74 |
75 |
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/install/update_110_111.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | /**
31 | * Update from 1.1.0 to 1.1.1
32 | *
33 | * @return bool for success (will die for most error)
34 | * */
35 | function update110to111() {
36 | global $DB;
37 |
38 | $migration = new Migration(111);
39 |
40 | $query = "CREATE TABLE IF NOT EXISTS `glpi_plugin_cmdb_criticities` (
41 | `id` int(11) NOT NULL auto_increment,
42 | `name` varchar(255) collate utf8_unicode_ci default '',
43 | `entities_id` int(11) NOT NULL default '0',
44 | `is_recursive` tinyint(1) NOT NULL default '0',
45 | `comment` text collate utf8_unicode_ci,
46 | `color` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
47 | `level` tinyint(1) NOT NULL DEFAULT '0',
48 | PRIMARY KEY (`id`),
49 | KEY `entities_id` (`entities_id`),
50 | KEY `is_recursive` (`is_recursive`)
51 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
52 | $DB->->doQuery($query, "add table criticities");
53 |
54 | $criticities = getAllCriticity();
55 | foreach ($criticities as $key => $value) {
56 |
57 | $migration->insertInTable('glpi_plugin_cmdb_criticities',
58 | ['id' => $key,
59 | 'name' => $value['name'],
60 | 'color' => $value['color'],
61 | 'is_recursive' => 1,
62 | 'level' => $key]);
63 | }
64 |
65 | $migration->dropTable('glpi_plugin_cmdb_preferences');
66 |
67 | $query = "SELECT *
68 | FROM `glpi_plugin_cmdb_criticities_items`;";
69 |
70 | $result = $DB->doQuery($query);
71 | while ($data = $DB->fetchArray($result)) {
72 | $DB->->doQuery("UPDATE `glpi_plugin_cmdb_criticities_items` SET `value` = '".($data['value']+1)."' WHERE `id` = ".$data['id'].";");
73 | }
74 |
75 | $migration->executeMigration();
76 |
77 | return true;
78 | }
79 |
80 |
81 | /**
82 | * @return array
83 | */
84 | function getAllCriticity() {
85 | $tabCriticity = [];
86 | $tabCriticity[1] = ['name' => __("very low", "cmdb"), 'color' => '#66FF00'];
87 | $tabCriticity[2] = ['name' => __("low", "cmdb"), 'color' => '#B9FF00'];
88 | $tabCriticity[3] = ['name' => __("medium", "cmdb"), 'color' => '#FFFD00'];
89 | $tabCriticity[4] = ['name' => __("high", "cmdb"), 'color' => '#FF7F00'];
90 | $tabCriticity[5] = ['name' => __("very high", "cmdb"), 'color' => '#FF1F00'];
91 | return $tabCriticity;
92 | }
93 |
--------------------------------------------------------------------------------
/front/impacticon.form.php:
--------------------------------------------------------------------------------
1 | .
28 | --------------------------------------------------------------------------
29 | */
30 |
31 | use GlpiPlugin\Cmdb\ImpactIcon;
32 |
33 | Session::checkLoginUser();
34 |
35 | $impactIcon = new ImpactIcon();
36 |
37 | $criterias = $impactIcon->getCriterias();
38 | foreach($criterias as $criteria) {
39 | if (isset($_POST[$criteria])) {
40 | $_POST['criteria'] = $_POST[$criteria];
41 | }
42 | }
43 |
44 | // TODO check new file's type
45 |
46 | if (isset($_POST["add"])) {
47 | $_POST['name'] = sprintf(__('Icon for itemtype %s', 'cmdb'), $_POST['itemtype']::getTypeName());
48 | $impactIcon->check(-1, CREATE, $_POST);
49 |
50 | if ($impactIcon->getFromDBByCrit([
51 | 'itemtype' => $_POST['itemtype'],
52 | 'criteria' => $_POST['criteria']
53 | ])) {
54 | Session::addMessageAfterRedirect(__('An icon already exist for this type', 'cmdb'), true, ERROR);
55 | Html::back();
56 | }
57 |
58 | if ($newID = $impactIcon->add($_POST)) {
59 | if ($_SESSION['glpibackcreated']) {
60 | Html::redirect($impactIcon->getFormURL() . "?id=" . $newID);
61 | }
62 | } else {
63 | Session::addMessageAfterRedirect(__('Creation failed', 'cmdb'), true, ERROR);
64 | }
65 | Html::back();
66 | } elseif (isset($_POST["delete"])) {
67 | $impactIcon->check($_POST['id'], DELETE);
68 | $impactIcon->delete($_POST);
69 | $impactIcon->redirectToList();
70 | } elseif (isset($_POST["restore"])) {
71 | $impactIcon->check($_POST['id'], PURGE);
72 | $impactIcon->restore($_POST);
73 | $impactIcon->redirectToList();
74 | } elseif (isset($_POST["purge"])) {
75 | $impactIcon->check($_POST['id'], PURGE);
76 | $impactIcon->delete($_POST, 1);
77 | $impactIcon->redirectToList();
78 | } elseif (isset($_POST["update"])) {
79 | $impactIcon->check($_POST['id'], UPDATE);
80 |
81 | if ($impactIcon->getFromDBByCrit([
82 | 'itemtype' => $_POST['itemtype'],
83 | 'criteria' => $_POST['criteria'],
84 | 'id' => ['!=', $_POST['id']]
85 | ])) {
86 | Session::addMessageAfterRedirect(__('An icon already exist for this type', 'cmdb'), true, ERROR);
87 | Html::back();
88 | }
89 |
90 | if (!$impactIcon->update($_POST)) {
91 | Session::addMessageAfterRedirect(__('Update failed', 'cmdb'), true, ERROR);
92 | }
93 | Html::back();
94 | } else {
95 | $impactIcon->checkGlobal(READ);
96 |
97 | Html::header(ImpactIcon::getTypeName(2), '', "config", ImpactIcon::class);
98 |
99 | $impactIcon->display($_GET);
100 |
101 | Html::footer();
102 | }
103 |
--------------------------------------------------------------------------------
/front/operationprocess.form.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 |
31 | use GlpiPlugin\Cmdb\OperationProcess;
32 | use GlpiPlugin\Cmdb\OperationProcess_Item;
33 | use GlpiPlugin\Cmdb\OperationProcessMenu;
34 |
35 | if (!isset($_GET["id"])) {
36 | $_GET["id"] = "";
37 | }
38 | if (!isset($_GET["withtemplate"])) {
39 | $_GET["withtemplate"] = "";
40 | }
41 |
42 | $operationprocess = new OperationProcess();
43 | $operationprocess_item = new OperationProcess_Item();
44 |
45 | if (isset($_POST["add"])) {
46 |
47 | $operationprocess->check(-1, CREATE, $_POST);
48 | $newID = $operationprocess->add($_POST);
49 | if ($_SESSION['glpibackcreated']) {
50 | Html::redirect($operationprocess->getFormURL() . "?id=" . $newID);
51 | }
52 | Html::back();
53 |
54 | } else if (isset($_POST["delete"])) {
55 |
56 | $operationprocess->check($_POST['id'], DELETE);
57 | $operationprocess->delete($_POST);
58 | $operationprocess->redirectToList();
59 |
60 | } else if (isset($_POST["restore"])) {
61 |
62 | $operationprocess->check($_POST['id'], PURGE);
63 | $operationprocess->restore($_POST);
64 | $operationprocess->redirectToList();
65 |
66 | } else if (isset($_POST["purge"])) {
67 |
68 | $operationprocess->check($_POST['id'], PURGE);
69 | $operationprocess->delete($_POST, 1);
70 | $operationprocess->redirectToList();
71 |
72 | } else if (isset($_POST["update"])) {
73 |
74 | $operationprocess->check($_POST['id'], UPDATE);
75 | $operationprocess->update($_POST);
76 | Html::back();
77 |
78 | } else if (isset($_POST["additem"])) {
79 |
80 | if (!empty($_POST['itemtype']) && $_POST['items_id'] > 0) {
81 | $operationprocess_item->check(-1, UPDATE, $_POST);
82 | $operationprocess_item->addItem($_POST);
83 | }
84 | Html::back();
85 |
86 | } else if (isset($_POST["deleteitem"])) {
87 |
88 | foreach ($_POST["item"] as $key => $val) {
89 | $input = ['id' => $key];
90 | if ($val == 1) {
91 | $operationprocess_item->check($key, UPDATE);
92 | $operationprocess_item->delete($input);
93 | }
94 | }
95 | Html::back();
96 |
97 | } else if (isset($_POST["deleteoperationprocesses"])) {
98 |
99 | $input = ['id' => $_POST["id"]];
100 | $operationprocess_item->check($_POST["id"], UPDATE);
101 | $operationprocess_item->delete($input);
102 | Html::back();
103 |
104 | } else {
105 |
106 | $operationprocess->checkGlobal(READ);
107 |
108 | Html::header(OperationProcess::getTypeName(2), '', "assets",
109 | OperationProcessMenu::class);
110 | $operationprocess->display($_GET);
111 |
112 | Html::footer();
113 | }
114 |
--------------------------------------------------------------------------------
/front/impactinfo.form.php:
--------------------------------------------------------------------------------
1 | .
28 | --------------------------------------------------------------------------
29 | */
30 |
31 | use GlpiPlugin\Cmdb\ImpactInfo;
32 | use GlpiPlugin\Cmdb\ImpactInfoField;
33 |
34 | Session::checkLoginUser();
35 |
36 | $impactInfo = new ImpactInfo();
37 | $impactInfoField = new ImpactInfoField();
38 | global $DB;
39 | if (isset($_POST["add"])) {
40 | $input = ['itemtype' => $_POST['itemtype']];
41 | $impactInfo->check(-1, CREATE, $input);
42 |
43 | if ($impactInfo->getFromDBByCrit($input)) {
44 | Session::addMessageAfterRedirect(__('Infos are already set for this type', 'cmdb'), true, ERROR);
45 | Html::back();
46 | }
47 |
48 | if ($newID = $impactInfo->add($input)) {
49 | if (isset($_POST['glpi-fields']) && is_array($_POST['glpi-fields'])) {
50 | foreach ($_POST['glpi-fields'] as $field) {
51 | $field['plugin_cmdb_impactinfos_id'] = $newID;
52 | $impactInfoField->add($field);
53 | }
54 | }
55 | if (isset($_POST['fields-fields']) && is_array($_POST['fields-fields'])) {
56 | foreach ($_POST['fields-fields'] as $field) {
57 | $field['plugin_cmdb_impactinfos_id'] = $newID;
58 | $impactInfoField->add($field);
59 | }
60 | }
61 | if (isset($_POST['cmdb-fields']) && is_array($_POST['cmdb-fields'])) {
62 | foreach ($_POST['cmdb-fields'] as $field) {
63 | $field['plugin_cmdb_impactinfos_id'] = $newID;
64 | $impactInfoField->add($field);
65 | }
66 | }
67 | if ($_SESSION['glpibackcreated']) {
68 | Html::redirect($impactInfo->getFormURL() . "?id=" . $newID);
69 | }
70 | } else {
71 | Session::addMessageAfterRedirect(__('Creation failed', 'cmdb'), true, ERROR);
72 | }
73 | Html::back();
74 | } elseif (isset($_POST["purge"])) {
75 | $impactInfo->check($_POST['id'], PURGE);
76 |
77 | $DB->delete(
78 | $impactInfoField->getTable(),
79 | ['plugin_cmdb_impactinfos_id' => $_POST['id']]
80 | );
81 |
82 | $impactInfo->delete($_POST, 1);
83 | $impactInfo->redirectToList();
84 | } elseif (isset($_POST["update"])) {
85 | $impactInfo->check($_POST['id'], UPDATE);
86 |
87 | $DB->delete(
88 | $impactInfoField->getTable(),
89 | ['plugin_cmdb_impactinfos_id' => $_POST['id']]
90 | );
91 |
92 | if (isset($_POST['glpi-fields']) && is_array($_POST['glpi-fields'])) {
93 | foreach ($_POST['glpi-fields'] as $field) {
94 | $field['plugin_cmdb_impactinfos_id'] = $_POST['id'];
95 | $impactInfoField->add($field);
96 | }
97 | }
98 | if (isset($_POST['fields-fields']) && is_array($_POST['fields-fields'])) {
99 | foreach ($_POST['fields-fields'] as $field) {
100 | $field['plugin_cmdb_impactinfos_id'] = $_POST['id'];
101 | $impactInfoField->add($field);
102 | }
103 | }
104 | if (isset($_POST['cmdb-fields']) && is_array($_POST['cmdb-fields'])) {
105 | foreach ($_POST['cmdb-fields'] as $field) {
106 | $field['plugin_cmdb_impactinfos_id'] = $_POST['id'];
107 | $impactInfoField->add($field);
108 | }
109 | }
110 |
111 | Html::back();
112 | } else {
113 | $impactInfo->checkGlobal(READ);
114 |
115 | Html::header(ImpactInfo::getTypeName(2), '', "config", ImpactInfo::class);
116 |
117 | $impactInfo->display($_GET);
118 |
119 | Html::footer();
120 | }
121 |
--------------------------------------------------------------------------------
/cmdb.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Cmdb
4 | cmdb
5 | stable
6 | https://raw.githubusercontent.com/InfotelGLPI/cmdb/master/public/pics/service.png
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | https://github.com/InfotelGLPI/cmdb
18 | https://github.com/InfotelGLPI/cmdb/releases
19 | https://github.com/InfotelGLPI/cmdb/issues
20 | https://github.com/InfotelGLPI/cmdb/wiki
21 |
22 | Xavier CAILLAUD
23 | Infotel
24 |
25 |
26 |
27 | 3.1.4
28 | ~11.0
29 | https://github.com/InfotelGLPI/cmdb/releases/download/3.1.4/glpi-cmdb-3.1.4.tar.bz2
30 |
31 |
32 | 3.1.3
33 | ~11.0
34 | https://github.com/InfotelGLPI/cmdb/releases/download/3.1.3/glpi-cmdb-3.1.3.tar.bz2
35 |
36 |
37 | 3.1.2
38 | ~11.0
39 | https://github.com/InfotelGLPI/cmdb/releases/download/3.1.2/glpi-cmdb-3.1.2.tar.bz2
40 |
41 |
42 | 3.1.1
43 | ~11.0
44 | https://github.com/InfotelGLPI/cmdb/releases/download/3.1.1/glpi-cmdb-3.1.1.tar.bz2
45 |
46 |
47 | 3.1.0
48 | ~11.0
49 | https://github.com/InfotelGLPI/cmdb/releases/download/3.1.0/glpi-cmdb-3.1.0.tar.bz2
50 |
51 |
52 | 3.0.3
53 | ~10.0
54 | https://github.com/InfotelGLPI/cmdb/releases/download/3.0.3/glpi-cmdb-3.0.3.tar.bz2
55 |
56 |
57 | 3.0.2
58 | ~10.0
59 | https://github.com/InfotelGLPI/cmdb/releases/download/3.0.2/glpi-cmdb-3.0.2.tar.bz2
60 |
61 |
62 | 3.0.1
63 | ~10.0
64 | https://github.com/InfotelGLPI/cmdb/releases/download/3.0.1/glpi-cmdb-3.0.1.tar.bz2
65 |
66 |
67 | 3.0.0
68 | ~10.0
69 | https://github.com/InfotelGLPI/cmdb/releases/download/3.0.0/glpi-cmdb-3.0.0.tar.bz2
70 |
71 |
72 | 3.0.0-rc2
73 | ~10.0
74 | https://github.com/InfotelGLPI/cmdb/releases/download/3.0.0-rc2/glpi-cmdb-3.0.0-rc2.tar.bz2
75 |
76 |
77 | 3.0.0-rc1
78 | ~10.0
79 | https://github.com/InfotelGLPI/cmdb/releases/download/3.0.0-rc1/glpi-cmdb-3.0.0-rc1.tar.bz2
80 |
81 |
82 | 2.2.1
83 | 9.5
84 |
85 |
86 |
87 | en_GB
88 | fr_FR
89 |
90 |
91 |
92 |
93 | Analyse
94 | Impact
95 | Inventaire
96 |
97 |
98 | Analyze
99 | Impact
100 | Inventory
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/install/update_120.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | /**
31 | * Update to 1.2.0
32 | *
33 | * @return bool for success (will die for most error)
34 | * */
35 | function update120() {
36 | global $DB, $CFG_GLPI;
37 |
38 | $migration = new Migration(120);
39 |
40 | //add colum
41 | $DB->->doQuery("ALTER TABLE `glpi_plugin_cmdb_criticities` ADD `businesscriticities_id` INT(11) NOT NULL DEFAULT '0';");
42 |
43 | $query = "SELECT *
44 | FROM `glpi_plugin_cmdb_criticities`;";
45 |
46 | $result = $DB->doQuery($query);
47 | while ($data = $DB->fetchArray($result)) {
48 | $name = $data['name'];
49 |
50 | $query_verif = "SELECT `name`
51 | FROM `glpi_businesscriticities`
52 | WHERE `name` LIKE '$name' AND `businesscriticities_id` = 0";
53 | $result_verif = $DB->doQuery($query_verif);
54 | if ($DB->numrows($result_verif) > 0) {
55 | $name .= '_migration' . $data['id'];
56 | }
57 |
58 | $DB->->doQuery("INSERT INTO `glpi_businesscriticities` (`id`, `name`, `entities_id`, `is_recursive`, `comment`, `businesscriticities_id`, `completename`, `level`)
59 | VALUES (NULL, '$name', " . $data['entities_id'] . ", " . $data['is_recursive'] . ", '" . $data['comment'] . "', 0, '$name', '1');");
60 |
61 | $query = "SELECT `id`
62 | FROM `glpi_businesscriticities`
63 | WHERE `name` LIKE '$name'
64 | AND `entities_id` = " . $data['entities_id'] . "
65 | AND `is_recursive` = " . $data['is_recursive'] . "
66 | AND `level` = 1;";
67 |
68 | $result_id = $DB->doQuery($query);
69 | $id = $DB->result($result_id, 0, "id");
70 |
71 | $DB->->doQuery("UPDATE `glpi_plugin_cmdb_criticities` SET `businesscriticities_id` = $id WHERE `id` = " . $data['id'] . ";");
72 | $DB->->doQuery("UPDATE `glpi_plugin_cmdb_criticities_items` SET `value` = $id WHERE `value` = " . $data['id'] . ";");
73 |
74 | }
75 |
76 | $DB->->doQuery("ALTER TABLE `glpi_plugin_cmdb_criticities` DROP `name`;");
77 | $DB->->doQuery("ALTER TABLE `glpi_plugin_cmdb_criticities` DROP `entities_id`;");
78 | $DB->->doQuery("ALTER TABLE `glpi_plugin_cmdb_criticities` DROP `is_recursive`;");
79 | $DB->->doQuery("ALTER TABLE `glpi_plugin_cmdb_criticities` DROP `comment`;");
80 |
81 | $query = "SELECT *
82 | FROM `glpi_plugin_cmdb_criticities_items`
83 | WHERE `itemtype` IN ('" . implode('\',\'', $CFG_GLPI['infocom_types']) . "');";
84 |
85 | $result = $DB->doQuery($query);
86 | while ($data = $DB->fetchArray($result)) {
87 | $items_id = $data['items_id'];
88 | $itemtype = $data['itemtype'];
89 | $value = $data['value'];
90 |
91 | if ($value != 0) {
92 |
93 | $query_verif = "SELECT `id`
94 | FROM `glpi_infocoms`
95 | WHERE `items_id` = $items_id AND `itemtype` = '$itemtype'";
96 |
97 | $result_verif = $DB->doQuery($query_verif);
98 | if ($DB->numrows($result_verif) > 0) {
99 | $id = $DB->result($result_verif, 0, "id");
100 | //update
101 | $DB->->doQuery("UPDATE `glpi_infocoms` SET `businesscriticities_id` = $value WHERE `id` = $id");
102 | } else {
103 | //add
104 | $DB->->doQuery("INSERT INTO `glpi_infocoms` (`items_id`, `itemtype`, `businesscriticities_id`)
105 | VALUES ($items_id, '$itemtype', $value)");
106 | }
107 | }
108 | $DB->->doQuery("DELETE FROM `glpi_plugin_cmdb_criticities_items` WHERE `id` = " . $data['id'] . ";");
109 |
110 | }
111 |
112 | $migration->executeMigration();
113 |
114 | return true;
115 | }
116 |
--------------------------------------------------------------------------------
/src/Cmdb.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | namespace GlpiPlugin\Cmdb;
31 |
32 | use CommonDBTM;
33 | use DbUtils;
34 | use Html;
35 | use Toolbox;
36 |
37 | if (!defined('GLPI_ROOT')) {
38 | die("Sorry. You can't access directly to this file");
39 | }
40 |
41 | /**
42 | * Class Cmdb
43 | */
44 | class Cmdb extends CommonDBTM
45 | {
46 |
47 | static $rightname = "plugin_cmdb_cis";
48 |
49 | /**
50 | * Return the localized name of the current Type
51 | *
52 | * @return string
53 | * */
54 | public static function getTypeName($nb = 0)
55 | {
56 | return __('CMDB', 'cmdb');
57 | }
58 |
59 | function displayMenu()
60 | {
61 | global $CFG_GLPI;
62 |
63 | Html::requireJs('cmdb');
64 |
65 | $dbu = new DbUtils();
66 |
67 | $item = new CIType();
68 | $where = [];
69 | if ($item->isEntityAssign()) {
70 | $entity = $_SESSION["glpiactive_entity"];
71 | /// Case of personal items : entity = -1 : create on active entity (Reminder case))
72 | if ($item->getEntityID() >= 0) {
73 | $entity = $item->getEntityID();
74 | }
75 |
76 | if ($item->maybeRecursive()) {
77 | $entities = $dbu->getSonsOf('glpi_entities', $entity);
78 | $recursive = true;
79 | } else {
80 | $entities = $entity;
81 | $recursive = false;
82 | }
83 | $where = $dbu->getEntitiesRestrictCriteria("glpi_plugin_cmdb_citypes", '', $entities, $recursive);
84 | }
85 |
86 | $ci_type = new CIType();
87 | $ciTypes = $ci_type->find($where);
88 |
89 | if (count($ciTypes) > 0) {
90 | echo "";
91 | echo "
";
92 | echo "";
93 | echo "| " . __("Display Item Configuration", 'cmdb') . " | ";
94 | echo "
";
95 | echo "";
96 |
97 | $tabCIType = [];
98 |
99 | foreach ($ciTypes as $data) {
100 | $id = $data["id"];
101 |
102 | if ($item = getItemForItemtype($data["name"])) {
103 | $name = $item::getTypeName(1);
104 | if (!array_search($name, $tabCIType)) {
105 | $tabCIType[$id] = $name;
106 | }
107 | }
108 | }
109 |
110 | if (count($tabCIType) > 0) {
111 |
112 | $i = 0;
113 | foreach ($tabCIType as $id => $val) {
114 | if ($i % 3 == 0) {
115 | echo "
";
116 | }
117 | $citype = new CIType();
118 | $citype->getFromDB($id);
119 | if (isset($citype->fields["is_imported"])
120 | && $citype->fields["is_imported"]) {
121 | $link = Toolbox::getItemTypeSearchURL($citype->fields["name"]);
122 | } else {
123 | $link = $citype->fields["name"]::getSearchURL();
124 | }
125 | $citype_doc = new CIType_Document();
126 | echo "";
127 | echo "";
128 | if ($citype_doc->getFromDBByCrit(['plugin_cmdb_citypes_id' => $id,
129 | 'types_id' => 0])) {
130 | echo " fields['documents_id'] . "'/>";
132 | } else {
133 | echo "";
134 | }
135 |
136 | echo " ";
137 | echo $val;
138 | echo "";
139 | echo " | ";
140 |
141 | $i++;
142 | if ($i % 3 == 0) {
143 | echo "
";
144 | }
145 | }
146 |
147 | if ($i % 3 != 0) {
148 | // $j = 0;
149 | // $rest = $i % 3;
150 | // for ($j = 0; $j < 3 - $rest; $j++) {
151 | // echo " | ";
152 | // }
153 | echo "";
154 | }
155 | }
156 | }
157 |
158 | echo "";
159 | echo "";
160 | echo "
";
161 | echo "
";
162 | }
163 | }
164 |
--------------------------------------------------------------------------------
/templates/Citype.tpl:
--------------------------------------------------------------------------------
1 | getTable();
33 |
34 | if (!$DB->tableExists($table)) {
35 | $query = "CREATE TABLE IF NOT EXISTS `$table` (
36 | `id` int unsigned NOT NULL auto_increment,
37 | `name` varchar(255) collate utf8mb4_unicode_ci default '',
38 | `entities_id` int unsigned NOT NULL default '0',
39 | `is_recursive` tinyint NOT NULL default '0',
40 | `comment` text collate utf8mb4_unicode_ci,
41 | PRIMARY KEY (`id`)
42 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;";
43 | $DB->doQuery($query);
44 | }
45 |
46 | }
47 |
48 | /**
49 | * @return bool|\mysqli_result
50 | * @throws \GlpitestSQLError
51 | */
52 | static function uninstall() {
53 | global $DB;
54 |
55 | $obj = new self();
56 | return $DB->doQuery("DROP TABLE IF EXISTS `" . $obj->getTable() . "`");
57 | }
58 |
59 | function defineTabs($options = []) {
60 | $ong = [];
61 | $this->addDefaultFormTab($ong);
62 | $this->addImpactTab($ong, $options);
63 | $this->addStandardTab('Notepad', $ong, $options);
64 | $this->addStandardTab('Log', $ong, $options);
65 |
66 | return $ong;
67 | }
68 |
69 | /**
70 | * Get default values to search engine to override
71 | **/
72 | static function getDefaultSearchRequest() {
73 | $plug = isPluginItemType(get_called_class());
74 | $search = ['addhidden' => ['ddtype' => strtolower($plug['class'])]];
75 | return $search;
76 | }
77 |
78 | /**
79 | * @param $ID
80 | * @param array $options
81 | *
82 | * @return bool
83 | */
84 | function showForm($ID, $options = []) {
85 |
86 | $this->initForm($ID, $options);
87 | $options["colspan"] = 1;
88 | $this->showFormHeader($options);
89 |
90 | echo "";
91 |
92 | echo "| " . __('Name') . " | ";
93 | echo "";
94 | echo Html::input('name', ['value' => $this->fields['name'], 'size' => 40]);
95 | echo " | ";
96 | echo "
";
97 |
98 | $cifields = new Cifields();
99 | $cifields->setFieldByType(%%TYPE%%, $ID, self::getType());
100 | $this->showFormButtons($options);
101 |
102 | return true;
103 | }
104 |
105 | /**
106 | * Prepare input datas for adding the item
107 | *
108 | * @param array $input datas used to add the item
109 | *
110 | * @return array the modified $input array
111 | **/
112 | function prepareInputForAdd($input) {
113 | if ($input['name'] == '') {
114 | Session::addMessageAfterRedirect(__('Invalid name !', 'cmdb'), true, ERROR);
115 | return false;
116 | }
117 | return $input;
118 | }
119 |
120 | function postAddCi($history, $item) {
121 |
122 | $civalue = new Civalues();
123 | $input['items_id'] = $item->getID();
124 | $input['itemtype'] = self::getType();
125 | foreach ($item->input["newfield"] as $key => $value) {
126 | $input['value'] = $value;
127 | $input['plugin_cmdb_cifields_id'] = $key;
128 | $civalue->add($input, [], $history);
129 | }
130 | }
131 |
132 | /**
133 | * @param int $history
134 | */
135 | function post_addItem($history = 1) {
136 |
137 | if (isset($this->input["newfield"])) {
138 |
139 | $this->postAddCi($history, $this);
140 |
141 | }
142 | }
143 |
144 | /**
145 | * Actions done after the UPDATE of the item in the database
146 | *
147 | * @param boolean $history store changes history ? (default 1)
148 | *
149 | * @return void
150 | **/
151 | function post_updateItem($history = 1) {
152 | global $DB;
153 |
154 |
155 | if (isset($this->input["field"])) {
156 | foreach ($this->input["field"] as $key => $value) {
157 | $temp = new Civalues();
158 |
159 | $temp->update(['value' => $value,
160 | 'id' => $key]);
161 | }
162 | }
163 | if (isset($this->input["newfield"])) {
164 | self::postAddCi($history, $this);
165 | }
166 |
167 | }
168 |
169 | /**
170 | * Actions done when item is deleted from the database
171 | *
172 | * @return void
173 | **/
174 | public
175 | function cleanDBonPurge() {
176 |
177 | $temp = new Civalues();
178 | $temp->deleteByCriteria(['items_id' => $this->fields['id'], 'itemtype'], 1);
179 |
180 | $impactitem = new ImpactItem();
181 | $impactitem->deleteByCriteria(["itemtype" => self::class, 'items_id' => $this->fields['id']]);
182 | $impactrelation = new ImpactRelation();
183 | $impactrelation->deleteByCriteria(["itemtype_source" => self::class, 'items_id_source' => $this->fields['id']]);
184 | $impactrelation->deleteByCriteria(["itemtype_impacted" => self::class, 'items_id_impacted' => $this->fields['id']]);
185 |
186 | $crit = new Criticity_Item();
187 | $crit->deleteByCriteria(['itemtype' => self::class, 'items_id' => $this->fields['id']], 1);
188 |
189 | }
190 | }
191 |
--------------------------------------------------------------------------------
/src/ImpactInfoField.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | namespace GlpiPlugin\Cmdb;
31 |
32 | use CommonDBTM;
33 | use Toolbox;
34 |
35 | class ImpactInfoField extends CommonDBTM
36 | {
37 | static $rightname = 'plugin_cmdb_impactinfos';
38 |
39 | function showInfos($itemtype, $id)
40 | {
41 | $impactInfo = new ImpactInfo();
42 | $impactInfoField = new ImpactInfoField();
43 | if ($id > 0) {
44 | $impactInfo->getFromDB($id);
45 | }
46 | $availableFields = ImpactInfo::getFieldsForItemtype($itemtype);
47 | $usedFields = $impactInfoField->find(
48 | ['plugin_cmdb_impactinfos_id' => $id],
49 | 'order ASC'
50 | );
51 |
52 | echo "";
53 | echo "";
54 | echo " ";
55 |
56 | // base fields
57 | $impactInfoField->createSelectionColumn(
58 | $availableFields,
59 | $usedFields,
60 | array_key_exists('cmdb', $availableFields) ? 'cmdb' : 'glpi',
61 | $itemtype
62 | );
63 |
64 | // plugin fields
65 | if (array_key_exists('fields', $availableFields)) {
66 | $impactInfoField->createSelectionColumn(
67 | $availableFields,
68 | $usedFields,
69 | 'fields',
70 | $itemtype
71 | );
72 | }
73 | echo " ";
74 | echo " ";
75 | echo " | ";
76 | }
77 |
78 | function createSelectionColumn($availableFields, $usedFields, $key, $itemtype) {
79 | echo "";
80 | echo "
";
81 | echo $key !== 'fields' ? '
' : '
';
82 | echo "
";
83 | $fields = $availableFields[$key];
84 | $comparaisonArray = [];
85 | if ($usedFields) {
86 | $usedFields = array_filter($usedFields, fn($e) => $e['type'] === $key);
87 | foreach ($usedFields as $field) {
88 | $comparaisonArray[$field['field_id']] = $field;
89 | }
90 | }
91 | $unusedFields = array_diff_key($fields, $comparaisonArray);
92 | ImpactInfo::makeDropdown($key, $unusedFields, $itemtype);
93 | echo "
"; // select
94 | echo "
"; // flex label+select
95 | echo "
";
96 | $index = 0;
97 | foreach ($usedFields as $field) {
98 | $fieldId = $field['field_id'];
99 | $label = $fields[$fieldId];
100 | $order = $field['order'];
101 | // if display is modified here, also modify JS in ImpactInfo::makeDropdown
102 | echo "
";
103 | echo "";
104 | echo "";
105 | echo "";
106 | echo "";
107 | echo "".$label."";
108 | echo "";
109 | echo "";
110 | echo "";
111 | echo "
";
112 | $url = PLUGIN_CMDB_WEBDIR . "/ajax/impact_infos_fields_dropdown.php";
113 | echo "
114 |
135 | ";
136 | $index++;
137 | }
138 | echo "
";
139 | echo '
'; // col
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/install/sql/empty-2.2.0.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_criticities_items`;
2 | CREATE TABLE IF NOT EXISTS `glpi_plugin_cmdb_criticities_items` (
3 | `id` int(11) NOT NULL auto_increment,
4 | `itemtype` varchar(100) collate utf8_unicode_ci NOT NULL COMMENT 'see .class.php file',
5 | `items_id` int(11) NOT NULL default '0' COMMENT 'RELATION to various tables, according to itemtype (id)',
6 | `plugin_cmdb_criticities_id` int(11) NOT NULL default '0',
7 | PRIMARY KEY (`id`),
8 | KEY `item` (`itemtype`,`items_id`)
9 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
10 |
11 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_operationprocesses`;
12 | CREATE TABLE IF NOT EXISTS `glpi_plugin_cmdb_operationprocesses` (
13 | `id` int(11) NOT NULL auto_increment,
14 | `name` varchar(255) collate utf8_unicode_ci default '',
15 | `entities_id` int(11) NOT NULL default '0',
16 | `is_recursive` tinyint(1) NOT NULL default '0',
17 | `plugin_cmdb_operationprocessstates_id` int(11) NOT NULL default '0',
18 | `users_id_tech` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_users (id)',
19 | `groups_id_tech` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_groups (id)',
20 | `locations_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_locations (id)',
21 | `date_mod` datetime default NULL,
22 | `is_deleted` tinyint(1) NOT NULL default '0',
23 | `is_helpdesk_visible` int(11) NOT NULL default '1',
24 | `comment` text collate utf8_unicode_ci,
25 | PRIMARY KEY (`id`),
26 | KEY `entities_id` (`entities_id`),
27 | KEY `is_recursive` (`is_recursive`),
28 | KEY `users_id_tech` (`users_id_tech`),
29 | KEY `groups_id_tech` (`groups_id_tech`),
30 | KEY `locations_id` (`locations_id`),
31 | KEY `is_deleted` (`is_deleted`),
32 | KEY `is_helpdesk_visible` (`is_helpdesk_visible`)
33 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
34 |
35 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_operationprocesses_items`;
36 | CREATE TABLE IF NOT EXISTS `glpi_plugin_cmdb_operationprocesses_items`(
37 | `id` int(11) NOT NULL auto_increment,
38 | `plugin_cmdb_operationprocesses_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_plugin_cmdb_operationprocesses (id)',
39 | `items_id` int(11) NOT NULL default '0' COMMENT 'RELATION to various tables, according to itemtype (id)',
40 | `itemtype` varchar(100) collate utf8_unicode_ci NOT NULL COMMENT 'see .class.php file',
41 | PRIMARY KEY (`id`),
42 | KEY `plugin_cmdb_operationprocesses_id` (`plugin_cmdb_operationprocesses_id`),
43 | KEY `item` (`itemtype`,`items_id`)
44 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
45 |
46 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_operationprocessstates`;
47 | CREATE TABLE IF NOT EXISTS `glpi_plugin_cmdb_operationprocessstates` (
48 | `id` int(11) NOT NULL auto_increment,
49 | `name` varchar(255) collate utf8_unicode_ci default '',
50 | `comment` text collate utf8_unicode_ci,
51 | PRIMARY KEY (`id`)
52 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
53 |
54 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_citypes`;
55 | CREATE TABLE IF NOT EXISTS `glpi_plugin_cmdb_citypes` (
56 | `id` int(11) NOT NULL auto_increment,
57 | `name` varchar(255) collate utf8_unicode_ci default '',
58 | `entities_id` int(11) NOT NULL default '0',
59 | `is_recursive` tinyint(1) NOT NULL default '0',
60 | `is_imported` tinyint(1) NOT NULL default '0',
61 | `fields` text collate utf8_unicode_ci NOT NULL,
62 | PRIMARY KEY (`id`),
63 | KEY `entities_id` (`entities_id`),
64 | KEY `is_recursive` (`is_recursive`),
65 | KEY `is_imported` (`is_imported`)
66 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
67 |
68 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_cis`;
69 | CREATE TABLE IF NOT EXISTS `glpi_plugin_cmdb_cis` (
70 | `id` int(11) NOT NULL auto_increment,
71 | `name` varchar(255) collate utf8_unicode_ci default '',
72 | `entities_id` int(11) NOT NULL default '0',
73 | `is_recursive` tinyint(1) NOT NULL default '0',
74 | `plugin_cmdb_citypes_id` int(11) NOT NULL,
75 | PRIMARY KEY (`id`),
76 | KEY `entities_id` (`entities_id`),
77 | KEY `is_recursive` (`is_recursive`),
78 | KEY `plugin_cmdb_citypes_id` (`plugin_cmdb_citypes_id`)
79 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
80 |
81 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_cifields`;
82 | CREATE TABLE IF NOT EXISTS `glpi_plugin_cmdb_cifields` (
83 | `id` int(11) NOT NULL auto_increment,
84 | `name` varchar(255) collate utf8_unicode_ci default '',
85 | `typefield` int(11) NOT NULL,
86 | `plugin_cmdb_citypes_id` int(11) NOT NULL,
87 | PRIMARY KEY (`id`),
88 | KEY `plugin_cmdb_citypes_id` (`plugin_cmdb_citypes_id`)
89 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
90 |
91 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_civalues`;
92 | CREATE TABLE IF NOT EXISTS `glpi_plugin_cmdb_civalues` (
93 | `id` int(11) NOT NULL auto_increment,
94 | `value` varchar(255) collate utf8_unicode_ci default '',
95 | `plugin_cmdb_cis_id` int(11) NOT NULL,
96 | `plugin_cmdb_cifields_id` int(11) NOT NULL,
97 | PRIMARY KEY (`id`),
98 | KEY `plugin_cmdb_cis_id` (`plugin_cmdb_cis_id`),
99 | KEY `plugin_cmdb_cifields_id` (`plugin_cmdb_cifields_id`)
100 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
101 |
102 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_citypes_documents`;
103 | CREATE TABLE IF NOT EXISTS `glpi_plugin_cmdb_citypes_documents` (
104 | `id` int(11) NOT NULL auto_increment,
105 | `plugin_cmdb_citypes_id` int(11) NOT NULL default '0',
106 | `types_id` int(11) NOT NULL default '0',
107 | `documents_id` int(11) NOT NULL default '0',
108 | PRIMARY KEY (`id`),
109 | KEY `plugin_cmdb_citypes_id` (`plugin_cmdb_citypes_id`),
110 | KEY `types_id` (`types_id`),
111 | KEY `documents_id` (`documents_id`)
112 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
113 |
114 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_criticities`;
115 | CREATE TABLE IF NOT EXISTS `glpi_plugin_cmdb_criticities` (
116 | `id` int(11) NOT NULL auto_increment,
117 | `businesscriticities_id` int(11) NOT NULL default '0',
118 | `color` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
119 | `level` tinyint(1) NOT NULL DEFAULT '0',
120 | PRIMARY KEY (`id`),
121 | KEY `businesscriticities_id` (`businesscriticities_id`)
122 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
123 |
124 | INSERT INTO `glpi_displaypreferences` (`id`, `itemtype`, `num`, `rank`, `users_id`)
125 | VALUES (NULL, 'PluginCmdbOperationprocess', 2, 4, 0),
126 | (NULL, 'PluginCmdbOperationprocess', 9, 5, 0),
127 | (NULL, 'PluginCmdbOperationprocess', 10, 6, 0),
128 | (NULL, 'PluginCmdbOperationprocess', 16, 7, 0),
129 | (NULL, 'PluginCmdbCIType', '9', '5', '0');
--------------------------------------------------------------------------------
/install/sql/empty-2.2.1.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_criticities_items`;
2 | CREATE TABLE IF NOT EXISTS `glpi_plugin_cmdb_criticities_items` (
3 | `id` int(11) NOT NULL auto_increment,
4 | `itemtype` varchar(100) collate utf8_unicode_ci NOT NULL COMMENT 'see .class.php file',
5 | `items_id` int(11) NOT NULL default '0' COMMENT 'RELATION to various tables, according to itemtype (id)',
6 | `plugin_cmdb_criticities_id` int(11) NOT NULL default '0',
7 | PRIMARY KEY (`id`),
8 | KEY `item` (`itemtype`,`items_id`)
9 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
10 |
11 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_operationprocesses`;
12 | CREATE TABLE IF NOT EXISTS `glpi_plugin_cmdb_operationprocesses` (
13 | `id` int(11) NOT NULL auto_increment,
14 | `name` varchar(255) collate utf8_unicode_ci default '',
15 | `entities_id` int(11) NOT NULL default '0',
16 | `is_recursive` tinyint(1) NOT NULL default '0',
17 | `plugin_cmdb_operationprocessstates_id` int(11) NOT NULL default '0',
18 | `users_id_tech` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_users (id)',
19 | `groups_id_tech` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_groups (id)',
20 | `locations_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_locations (id)',
21 | `date_creation` timestamp NULL DEFAULT NULL,
22 | `date_mod` timestamp NULL DEFAULT NULL,
23 | `is_deleted` tinyint(1) NOT NULL default '0',
24 | `is_helpdesk_visible` int(11) NOT NULL default '1',
25 | `comment` text collate utf8_unicode_ci,
26 | PRIMARY KEY (`id`),
27 | KEY `entities_id` (`entities_id`),
28 | KEY `is_recursive` (`is_recursive`),
29 | KEY `users_id_tech` (`users_id_tech`),
30 | KEY `groups_id_tech` (`groups_id_tech`),
31 | KEY `locations_id` (`locations_id`),
32 | KEY `is_deleted` (`is_deleted`),
33 | KEY `is_helpdesk_visible` (`is_helpdesk_visible`)
34 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
35 |
36 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_operationprocesses_items`;
37 | CREATE TABLE IF NOT EXISTS `glpi_plugin_cmdb_operationprocesses_items`(
38 | `id` int(11) NOT NULL auto_increment,
39 | `plugin_cmdb_operationprocesses_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_plugin_cmdb_operationprocesses (id)',
40 | `items_id` int(11) NOT NULL default '0' COMMENT 'RELATION to various tables, according to itemtype (id)',
41 | `itemtype` varchar(100) collate utf8_unicode_ci NOT NULL COMMENT 'see .class.php file',
42 | PRIMARY KEY (`id`),
43 | KEY `plugin_cmdb_operationprocesses_id` (`plugin_cmdb_operationprocesses_id`),
44 | KEY `item` (`itemtype`,`items_id`)
45 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
46 |
47 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_operationprocessstates`;
48 | CREATE TABLE IF NOT EXISTS `glpi_plugin_cmdb_operationprocessstates` (
49 | `id` int(11) NOT NULL auto_increment,
50 | `name` varchar(255) collate utf8_unicode_ci default '',
51 | `comment` text collate utf8_unicode_ci,
52 | PRIMARY KEY (`id`)
53 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
54 |
55 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_citypes`;
56 | CREATE TABLE IF NOT EXISTS `glpi_plugin_cmdb_citypes` (
57 | `id` int(11) NOT NULL auto_increment,
58 | `name` varchar(255) collate utf8_unicode_ci default '',
59 | `entities_id` int(11) NOT NULL default '0',
60 | `is_recursive` tinyint(1) NOT NULL default '0',
61 | `is_imported` tinyint(1) NOT NULL default '0',
62 | `fields` text collate utf8_unicode_ci NOT NULL,
63 | PRIMARY KEY (`id`),
64 | KEY `entities_id` (`entities_id`),
65 | KEY `is_recursive` (`is_recursive`),
66 | KEY `is_imported` (`is_imported`)
67 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
68 |
69 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_cis`;
70 | CREATE TABLE IF NOT EXISTS `glpi_plugin_cmdb_cis` (
71 | `id` int(11) NOT NULL auto_increment,
72 | `name` varchar(255) collate utf8_unicode_ci default '',
73 | `entities_id` int(11) NOT NULL default '0',
74 | `is_recursive` tinyint(1) NOT NULL default '0',
75 | `plugin_cmdb_citypes_id` int(11) NOT NULL,
76 | PRIMARY KEY (`id`),
77 | KEY `entities_id` (`entities_id`),
78 | KEY `is_recursive` (`is_recursive`),
79 | KEY `plugin_cmdb_citypes_id` (`plugin_cmdb_citypes_id`)
80 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
81 |
82 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_cifields`;
83 | CREATE TABLE IF NOT EXISTS `glpi_plugin_cmdb_cifields` (
84 | `id` int(11) NOT NULL auto_increment,
85 | `name` varchar(255) collate utf8_unicode_ci default '',
86 | `typefield` int(11) NOT NULL,
87 | `plugin_cmdb_citypes_id` int(11) NOT NULL,
88 | PRIMARY KEY (`id`),
89 | KEY `plugin_cmdb_citypes_id` (`plugin_cmdb_citypes_id`)
90 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
91 |
92 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_civalues`;
93 | CREATE TABLE IF NOT EXISTS `glpi_plugin_cmdb_civalues` (
94 | `id` int(11) NOT NULL auto_increment,
95 | `value` varchar(255) collate utf8_unicode_ci default '',
96 | `itemtype` varchar(255) NOT NULL,
97 | `items_id` int(11) NOT NULL,
98 | `plugin_cmdb_cifields_id` int(11) NOT NULL,
99 | PRIMARY KEY (`id`),
100 | KEY `items_id` (`items_id`),
101 | KEY `plugin_cmdb_cifields_id` (`plugin_cmdb_cifields_id`)
102 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
103 |
104 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_citypes_documents`;
105 | CREATE TABLE IF NOT EXISTS `glpi_plugin_cmdb_citypes_documents` (
106 | `id` int(11) NOT NULL auto_increment,
107 | `plugin_cmdb_citypes_id` int(11) NOT NULL default '0',
108 | `types_id` int(11) NOT NULL default '0',
109 | `documents_id` int(11) NOT NULL default '0',
110 | PRIMARY KEY (`id`),
111 | KEY `plugin_cmdb_citypes_id` (`plugin_cmdb_citypes_id`),
112 | KEY `types_id` (`types_id`),
113 | KEY `documents_id` (`documents_id`)
114 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
115 |
116 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_criticities`;
117 | CREATE TABLE IF NOT EXISTS `glpi_plugin_cmdb_criticities` (
118 | `id` int(11) NOT NULL auto_increment,
119 | `businesscriticities_id` int(11) NOT NULL default '0',
120 | `color` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
121 | `level` tinyint(1) NOT NULL DEFAULT '0',
122 | PRIMARY KEY (`id`),
123 | KEY `businesscriticities_id` (`businesscriticities_id`)
124 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
125 |
126 | INSERT INTO `glpi_displaypreferences` (`id`, `itemtype`, `num`, `rank`, `users_id`)
127 | VALUES (NULL, 'PluginCmdbOperationprocess', 2, 4, 0),
128 | (NULL, 'PluginCmdbOperationprocess', 9, 5, 0),
129 | (NULL, 'PluginCmdbOperationprocess', 10, 6, 0),
130 | (NULL, 'PluginCmdbOperationprocess', 16, 7, 0),
131 | (NULL, 'PluginCmdbCIType', '9', '5', '0');
--------------------------------------------------------------------------------
/setup.php:
--------------------------------------------------------------------------------
1 | .
28 | --------------------------------------------------------------------------
29 | */
30 |
31 | global $CFG_GLPI;
32 |
33 | use Glpi\Plugin\Hooks;
34 | use GlpiPlugin\Cmdb\Autoloader;
35 | use GlpiPlugin\Cmdb\CiFields;
36 | use GlpiPlugin\Cmdb\CIType;
37 | use GlpiPlugin\Cmdb\Cmdb;
38 | use GlpiPlugin\Cmdb\Criticity;
39 | use GlpiPlugin\Cmdb\ImpactIcon;
40 | use GlpiPlugin\Cmdb\ImpactInfo;
41 | use GlpiPlugin\Cmdb\Menu;
42 | use GlpiPlugin\Cmdb\Profile;
43 | use function Safe\mkdir;
44 |
45 | define('PLUGIN_CMDB_VERSION', '3.1.4');
46 |
47 | if (!defined("PLUGIN_CMDB_DIR")) {
48 | define("PLUGIN_CMDB_DIR", Plugin::getPhpDir("cmdb"));
49 | $root = $CFG_GLPI['root_doc'] . '/plugins/cmdb';
50 | define("PLUGIN_CMDB_WEBDIR", $root);
51 | }
52 |
53 | if (!defined("PLUGINCMDB_DOC_DIR")) {
54 | define("PLUGINCMDB_DOC_DIR", GLPI_PLUGIN_DOC_DIR . "/cmdb");
55 | }
56 | if (!file_exists(PLUGINCMDB_DOC_DIR)) {
57 | mkdir(PLUGINCMDB_DOC_DIR);
58 | }
59 |
60 | if (!defined("PLUGINCMDB_CLASS_PATH")) {
61 | define("PLUGINCMDB_CLASS_PATH", PLUGINCMDB_DOC_DIR . "/src");
62 | }
63 | if (!file_exists(PLUGINCMDB_CLASS_PATH)) {
64 | mkdir(PLUGINCMDB_CLASS_PATH);
65 | }
66 |
67 |
68 | function plugin_init_cmdb()
69 | {
70 | global $PLUGIN_HOOKS, $CFG_GLPI;
71 |
72 | $PLUGIN_HOOKS['csrf_compliant']['cmdb'] = true;
73 | $PLUGIN_HOOKS['change_profile']['cmdb'] = [Profile::class, 'initProfile'];
74 | $PLUGIN_HOOKS['assign_to_ticket']['cmdb'] = true;
75 | // include_once(PLUGIN_CMDB_DIR . "/src/Autoloader.php");
76 | $plugincmdb_autoloader = new Autoloader([PLUGINCMDB_CLASS_PATH]);
77 | $plugincmdb_autoloader->register();
78 |
79 | // Plugin::registerClass(CIType_Document::class);
80 | // Plugin::registerClass(OperationProcess::class, ['ticket_types' => true,
81 | // 'helpdesk_visible_types' => true]);
82 | // Plugin::registerClass(Cmdb_Ticket::class, ['addtabon' => 'Ticket']);
83 | // Plugin::registerClass(Criticity::class, ['addtabon' => ['BusinessCriticity']]);
84 |
85 | if (Session::getLoginUserID()) {
86 |
87 | Plugin::registerClass(
88 | Profile::class,
89 | array('addtabon' => 'Profile')
90 | );
91 | // $PLUGIN_HOOKS['plugin_fields']['cmdb'] = OperationProcess::class;
92 |
93 | // $CFG_GLPI['impact_asset_types'][OperationProcess::class] = PLUGIN_CMDB_WEBDIR."/pics/service.png";
94 |
95 | //Define impact_asset_types for ci types
96 | // include_once(PLUGIN_CMDB_DIR . "/src/CiType.php");
97 | $citype = new CIType();
98 | if (Plugin::isPluginActive('cmdb')) {
99 | $citype->showInAssetTypes();
100 | }
101 |
102 | //Change link from menu.php
103 | $PLUGIN_HOOKS["javascript"]['cmdb'] = ["/plugins/cmdb/js/changeCIMenu.js",
104 | "/plugins/cmdb/js/accordion.js",
105 | "/plugins/cmdb/js/function_form_CIType.js",
106 | "/plugins/cmdb/js/show_fields.js"];
107 |
108 | $PLUGIN_HOOKS['post_item_form']['cmdb'] = [Criticity::class, 'addFieldCriticity'];
109 |
110 | if (preg_match_all("/.*\/(.*)\.form\.php/", $_SERVER['REQUEST_URI'], $matches) !== false) {
111 | if (isset($matches[1][0])) {
112 | $itemtype = $matches[1][0];
113 | if ($itemtype == "ticket" && $_SESSION["glpiactiveprofile"]["interface"] != "helpdesk") {
114 | $PLUGIN_HOOKS[Hooks::ADD_JAVASCRIPT]['cmdb'][] = 'js/accordion.js';
115 | }
116 |
117 | if ($itemtype == "citype") {
118 | //actions for additional fields
119 | $PLUGIN_HOOKS[Hooks::ADD_JAVASCRIPT]['cmdb'][] = 'js/accordion.js';
120 | $PLUGIN_HOOKS[Hooks::ADD_JAVASCRIPT]['cmdb'][] = 'js/function_form_CIType.js';
121 | }
122 |
123 | if ($itemtype == "ci") {
124 | //Show additional fields if type of CI is changed
125 | $PLUGIN_HOOKS[Hooks::ADD_JAVASCRIPT]['cmdb'][] = 'js/show_fields.js';
126 | }
127 | }
128 | }
129 |
130 | // if (class_exists(OperationProcess::class)
131 | // && OperationProcess::canView()) {
132 | // $PLUGIN_HOOKS['menu_toadd']['cmdb']['assets'] = [OperationProcessMenu::class];
133 | // }
134 | if (class_exists(Cmdb::class)
135 | && Cmdb::canView()) {
136 | $PLUGIN_HOOKS['menu_toadd']['cmdb']['plugins'] = [Menu::class];
137 | }
138 |
139 | $PLUGIN_HOOKS['set_item_impact_icon']['cmdb'] = [
140 | ImpactIcon::class,
141 | 'getItemIcon'
142 | ];
143 |
144 | if (ImpactIcon::canView()) {
145 | $PLUGIN_HOOKS['menu_toadd']['cmdb']['config'][] = ImpactIcon::class;
146 | }
147 | if (ImpactInfo::canView()) {
148 | $PLUGIN_HOOKS['menu_toadd']['cmdb']['config'][] = ImpactInfo::class;
149 | }
150 |
151 | $PLUGIN_HOOKS['item_add']['cmdb'][ImpactIcon::class] = 'plugin_cmdb_item_add';
152 | $PLUGIN_HOOKS['item_update']['cmdb'][ImpactIcon::class] = 'plugin_cmdb_item_update';
153 | $PLUGIN_HOOKS['item_purge']['cmdb'][ImpactIcon::class] = 'plugin_cmdb_item_purge';
154 | $PLUGIN_HOOKS['item_purge']['cmdb'][ImpactInfo::class] = 'plugin_cmdb_item_purge';
155 | $PLUGIN_HOOKS['item_purge']['cmdb'][CiFields::class] = 'plugin_cmdb_item_purge';
156 | $PLUGIN_HOOKS['item_purge']['cmdb'][PluginFieldsField::class] = 'plugin_cmdb_item_purge';
157 |
158 | $PLUGIN_HOOKS['add_javascript']['cmdb'][] = 'js/cmdb_impact.js.php';
159 |
160 |
161 | $PLUGIN_HOOKS['post_init']['cmdb'] = 'plugin_cmdb_postinit';
162 | }
163 | }
164 |
165 | /**
166 | * @return array
167 | */
168 | function plugin_version_cmdb()
169 | {
170 | return [
171 | 'name' => __('CMDB', 'cmdb'),
172 | 'version' => PLUGIN_CMDB_VERSION,
173 | 'license' => 'GPLv2+',
174 | 'author' => "Infotel, Xavier CAILLAUD",
175 | 'homepage' => 'https://github.com/InfotelGLPI/cmdb',
176 | 'requirements' => [
177 | 'glpi' => [
178 | 'min' => '11.0',
179 | 'max' => '12.0',
180 | 'dev' => false,
181 | ],
182 | ]];
183 | }
184 |
--------------------------------------------------------------------------------
/locales/glpi.pot:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR Cmdb Development Team
3 | # This file is distributed under the same license as the Cmdb plugin package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | #, fuzzy
7 | msgid ""
8 | msgstr ""
9 | "Project-Id-Version: Cmdb plugin\n"
10 | "Report-Msgid-Bugs-To: \n"
11 | "POT-Creation-Date: 2025-12-08 11:41+0000\n"
12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 | "Last-Translator: FULL NAME \n"
14 | "Language-Team: LANGUAGE \n"
15 | "Language: \n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=CHARSET\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
20 |
21 | #: src/CIType.php:991
22 | msgid "Add New Field"
23 | msgstr ""
24 |
25 | #: src/Criticity.php:147
26 | msgid "All levels have already been added"
27 | msgstr ""
28 |
29 | #: front/impacticon.form.php:54 front/impacticon.form.php:86
30 | msgid "An icon already exist for this type"
31 | msgstr ""
32 |
33 | #: src/CIType.php:76
34 | msgid "Area Text"
35 | msgstr ""
36 |
37 | #: src/OperationProcess_Item.php:502
38 | msgctxt "button"
39 | msgid "Associate a service"
40 | msgstr ""
41 |
42 | #: src/OperationProcess_Item.php:102 src/OperationProcess_Item.php:104
43 | msgid "Attached service"
44 | msgid_plural "Attached services"
45 | msgstr[0] ""
46 | msgstr[1] ""
47 |
48 | #: src/ImpactInfoField.php:81
49 | msgid "Base fields"
50 | msgstr ""
51 |
52 | #: src/CIType.php:363
53 | msgid "Be careful the name cannot be changed after creation"
54 | msgstr ""
55 |
56 | #: setup.php:171 src/CI_Cmdb.php:56 src/Profile.php:60 src/Menu.php:51
57 | #: src/Cmdb.php:56
58 | msgid "CMDB"
59 | msgstr ""
60 |
61 | #: src/Ci.php:62
62 | msgid "Configuration Item"
63 | msgid_plural "Configuration Items"
64 | msgstr[0] ""
65 | msgstr[1] ""
66 |
67 | #: src/Menu.php:68
68 | msgid "Configure Type of Item Configuration"
69 | msgstr ""
70 |
71 | #: src/CI_Cmdb.php:84
72 | msgid "Create Link"
73 | msgstr ""
74 |
75 | #: front/impactinfo.form.php:71 front/impacticon.form.php:63
76 | msgid "Creation failed"
77 | msgstr ""
78 |
79 | #: src/ImpactIcon.php:124
80 | msgid "Criteria"
81 | msgstr ""
82 |
83 | #: src/Criticity.php:59 src/Criticity.php:128 src/Criticity_Item.php:57
84 | msgid "Criticity"
85 | msgid_plural "Criticities"
86 | msgstr[0] ""
87 | msgstr[1] ""
88 |
89 | #: src/ImpactIcon.php:267
90 | msgid "Current icon"
91 | msgstr ""
92 |
93 | #: src/CIType.php:711
94 | msgid "Default icon"
95 | msgstr ""
96 |
97 | #: src/CI_Cmdb.php:86
98 | msgid "Delete Link"
99 | msgstr ""
100 |
101 | #: src/Cmdb_Ticket.php:206
102 | msgid "Direct impact"
103 | msgstr ""
104 |
105 | #: src/Cmdb.php:93
106 | msgid "Display Item Configuration"
107 | msgstr ""
108 |
109 | #: src/CIType.php:367
110 | msgid "Do not use a classname with spaces (like 'my objects')"
111 | msgstr ""
112 |
113 | #: src/CIType.php:365
114 | msgid "Do not use a plural classname (like 'myobjects')"
115 | msgstr ""
116 |
117 | #: src/Cmdb_Ticket.php:104
118 | msgid "Elements linked to the ticket aren't imported in CMDB"
119 | msgstr ""
120 |
121 | #: src/CIType.php:1041
122 | msgid "Existing fields for this type of CI"
123 | msgstr ""
124 |
125 | #: src/CI_Cmdb.php:90
126 | msgid "Export PNG"
127 | msgstr ""
128 |
129 | #: src/CIType.php:312
130 | msgid "Go to custom assets"
131 | msgstr ""
132 |
133 | #: src/CIType.php:671 src/ImpactIcon.php:64
134 | msgid "Icon"
135 | msgid_plural "Icons"
136 | msgstr[0] ""
137 | msgstr[1] ""
138 |
139 | #. TRANS: Default document to files attached to tickets : %d is the ticket id
140 | #: src/CIType.php:1127
141 | #, php-format
142 | msgid "Icon CIType %d"
143 | msgstr ""
144 |
145 | #: src/ImpactIcon.php:276
146 | msgid "Icon file"
147 | msgstr ""
148 |
149 | #: front/impacticon.form.php:47
150 | #, php-format
151 | msgid "Icon for itemtype %s"
152 | msgstr ""
153 |
154 | #: src/Cmdb_Ticket.php:124 src/Cmdb_Ticket.php:162
155 | msgid "Impacted items"
156 | msgstr ""
157 |
158 | #: src/CIType.php:620
159 | msgid "Import CI"
160 | msgstr ""
161 |
162 | #: front/impactinfo.form.php:44
163 | msgid "Infos are already set for this type"
164 | msgstr ""
165 |
166 | #: src/Ci.php:217
167 | msgid "Invalid name !"
168 | msgstr ""
169 |
170 | #: src/CIType.php:346
171 | msgid "Is this item presents in glpi ?"
172 | msgstr ""
173 |
174 | #: src/Profile.php:131 src/Menu.php:70
175 | msgid "Item Configuration"
176 | msgstr ""
177 |
178 | #: src/Profile.php:208 src/Profile.php:241
179 | msgid "Item configuration"
180 | msgid_plural "Items configuration"
181 | msgstr[0] ""
182 | msgstr[1] ""
183 |
184 | #: src/Cmdb_Ticket.php:109
185 | msgid "No elements of CMDB linked to the ticket"
186 | msgstr ""
187 |
188 | #: src/ImpactInfo.php:568
189 | #, php-format
190 | msgid "No tooltip content set for itemtype %s"
191 | msgstr ""
192 |
193 | #: src/ImpactInfo.php:578
194 | #, php-format
195 | msgid "No tooltip set for itemtype %s"
196 | msgstr ""
197 |
198 | #: src/ImpactInfoField.php:104
199 | msgid "Order"
200 | msgstr ""
201 |
202 | #: src/Criticity.php:197
203 | msgid "Please choose a level for criticality"
204 | msgstr ""
205 |
206 | #: src/ImpactInfoField.php:81
207 | msgid "Plugin additional fields fields"
208 | msgstr ""
209 |
210 | #: src/Cmdb_Ticket.php:163
211 | msgid "Proximity"
212 | msgstr ""
213 |
214 | #: src/CI_Cmdb.php:92
215 | msgid "Purge CMDB"
216 | msgstr ""
217 |
218 | #: src/CIType.php:1045
219 | msgid "Reset Existing fields"
220 | msgstr ""
221 |
222 | #: src/CI_Cmdb.php:89
223 | msgid "Reset Zoom"
224 | msgstr ""
225 |
226 | #: src/CI_Cmdb.php:83
227 | msgid "See CI"
228 | msgstr ""
229 |
230 | #: src/CI_Cmdb.php:91
231 | msgid "See associated tickets"
232 | msgstr ""
233 |
234 | #: src/OperationProcess.php:67 src/OperationProcessMenu.php:53
235 | msgid "Service"
236 | msgid_plural "Services"
237 | msgstr[0] ""
238 | msgstr[1] ""
239 |
240 | #: src/OperationProcessState.php:54
241 | msgid "State of service"
242 | msgid_plural "States of service"
243 | msgstr[0] ""
244 | msgstr[1] ""
245 |
246 | #: src/CIType.php:75
247 | msgid "String"
248 | msgstr ""
249 |
250 | #: src/CIType.php:1388 src/CIType.php:1405
251 | msgctxt "button"
252 | msgid "Transfer"
253 | msgstr ""
254 |
255 | #: src/CIType.php:89
256 | msgid "Type CI"
257 | msgid_plural "Types CIs"
258 | msgstr[0] ""
259 | msgstr[1] ""
260 |
261 | #: src/Profile.php:245
262 | msgid "Type of Item Configuration"
263 | msgid_plural "Types of item configuration"
264 | msgstr[0] ""
265 | msgstr[1] ""
266 |
267 | #: src/Profile.php:135 src/Profile.php:221
268 | msgid "Type of item configuration"
269 | msgid_plural "Types of item configuration"
270 | msgstr[0] ""
271 | msgstr[1] ""
272 |
273 | #: src/CI_Cmdb.php:85
274 | msgid "Update Link"
275 | msgstr ""
276 |
277 | #: front/impacticon.form.php:91
278 | msgid "Update failed"
279 | msgstr ""
280 |
281 | #: src/CIType.php:1014
282 | msgid "Upload icon"
283 | msgstr ""
284 |
285 | #: front/menu.php:43
286 | msgid ""
287 | "With GLPI 11, you can create new custom assets, so migrate your existing "
288 | "objets to core"
289 | msgstr ""
290 |
291 | #: src/CIType.php:310
292 | msgid "With GLPI 11, you can create now custom assets"
293 | msgstr ""
294 |
295 | #: src/CIType.php:79
296 | msgid "Yes/No"
297 | msgstr ""
298 |
299 | #: front/ci.form.php:68
300 | msgid "You can't delete this item, because this item is used on CMDB !"
301 | msgstr ""
302 |
303 | #: src/CI_Cmdb.php:87
304 | msgid "Zoom in"
305 | msgstr ""
306 |
307 | #: src/CI_Cmdb.php:88
308 | msgid "Zoom out"
309 | msgstr ""
310 |
311 | #: install/update_110_111.php:89
312 | msgid "high"
313 | msgstr ""
314 |
315 | #: src/CIType.php:203
316 | msgid "is already present in GLPI"
317 | msgstr ""
318 |
319 | #: hook.php:442
320 | msgid "item not found or disabled"
321 | msgstr ""
322 |
323 | #: install/update_110_111.php:87
324 | msgid "low"
325 | msgstr ""
326 |
327 | #: install/update_110_111.php:88
328 | msgid "medium"
329 | msgstr ""
330 |
331 | #: install/update_110_111.php:90
332 | msgid "very high"
333 | msgstr ""
334 |
335 | #: install/update_110_111.php:86
336 | msgid "very low"
337 | msgstr ""
338 |
--------------------------------------------------------------------------------
/install/sql/empty-3.0.0.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_criticities_items`;
2 | CREATE TABLE `glpi_plugin_cmdb_criticities_items`
3 | (
4 | `id` int unsigned NOT NULL auto_increment,
5 | `itemtype` varchar(100) collate utf8mb4_unicode_ci NOT NULL COMMENT 'see .class.php file',
6 | `items_id` int unsigned NOT NULL default '0' COMMENT 'RELATION to various tables, according to itemtype (id)',
7 | `plugin_cmdb_criticities_id` int unsigned NOT NULL default '0',
8 | PRIMARY KEY (`id`),
9 | KEY `item` (`itemtype`,`items_id`)
10 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
11 |
12 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_operationprocesses`;
13 | CREATE TABLE `glpi_plugin_cmdb_operationprocesses`
14 | (
15 | `id` int unsigned NOT NULL auto_increment,
16 | `name` varchar(255) collate utf8mb4_unicode_ci default '',
17 | `entities_id` int unsigned NOT NULL default '0',
18 | `is_recursive` tinyint NOT NULL default '0',
19 | `plugin_cmdb_operationprocessstates_id` int unsigned NOT NULL default '0',
20 | `users_id` int unsigned NOT NULL default '0' COMMENT 'RELATION to glpi_users (id)',
21 | `users_id_tech` int unsigned NOT NULL default '0' COMMENT 'RELATION to glpi_users (id)',
22 | `groups_id_tech` int unsigned NOT NULL default '0' COMMENT 'RELATION to glpi_groups (id)',
23 | `locations_id` int unsigned NOT NULL default '0' COMMENT 'RELATION to glpi_locations (id)',
24 | `date_creation` timestamp NULL DEFAULT NULL,
25 | `date_mod` timestamp NULL DEFAULT NULL,
26 | `is_deleted` tinyint NOT NULL default '0',
27 | `is_helpdesk_visible` int unsigned NOT NULL default '1',
28 | `comment` text collate utf8mb4_unicode_ci,
29 | PRIMARY KEY (`id`),
30 | KEY `entities_id` (`entities_id`),
31 | KEY `is_recursive` (`is_recursive`),
32 | KEY `users_id_tech` (`users_id_tech`),
33 | KEY `groups_id_tech` (`groups_id_tech`),
34 | KEY `locations_id` (`locations_id`),
35 | KEY `is_deleted` (`is_deleted`),
36 | KEY `is_helpdesk_visible` (`is_helpdesk_visible`)
37 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
38 |
39 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_operationprocesses_items`;
40 | CREATE TABLE `glpi_plugin_cmdb_operationprocesses_items`
41 | (
42 | `id` int unsigned NOT NULL auto_increment,
43 | `plugin_cmdb_operationprocesses_id` int unsigned NOT NULL default '0' COMMENT 'RELATION to glpi_plugin_cmdb_operationprocesses (id)',
44 | `items_id` int unsigned NOT NULL default '0' COMMENT 'RELATION to various tables, according to itemtype (id)',
45 | `itemtype` varchar(100) collate utf8mb4_unicode_ci NOT NULL COMMENT 'see .class.php file',
46 | PRIMARY KEY (`id`),
47 | KEY `plugin_cmdb_operationprocesses_id` (`plugin_cmdb_operationprocesses_id`),
48 | KEY `item` (`itemtype`,`items_id`)
49 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
50 |
51 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_operationprocessstates`;
52 | CREATE TABLE `glpi_plugin_cmdb_operationprocessstates`
53 | (
54 | `id` int unsigned NOT NULL auto_increment,
55 | `name` varchar(255) collate utf8mb4_unicode_ci default '',
56 | `comment` text collate utf8mb4_unicode_ci,
57 | PRIMARY KEY (`id`)
58 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
59 |
60 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_citypes`;
61 | CREATE TABLE `glpi_plugin_cmdb_citypes`
62 | (
63 | `id` int unsigned NOT NULL auto_increment,
64 | `name` varchar(255) collate utf8mb4_unicode_ci default '',
65 | `entities_id` int unsigned NOT NULL default '0',
66 | `is_recursive` tinyint NOT NULL default '0',
67 | `is_imported` tinyint NOT NULL default '0',
68 | `fields` text collate utf8mb4_unicode_ci NOT NULL,
69 | PRIMARY KEY (`id`),
70 | KEY `entities_id` (`entities_id`),
71 | KEY `is_recursive` (`is_recursive`),
72 | KEY `is_imported` (`is_imported`)
73 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
74 |
75 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_cis`;
76 | CREATE TABLE `glpi_plugin_cmdb_cis`
77 | (
78 | `id` int unsigned NOT NULL auto_increment,
79 | `name` varchar(255) collate utf8mb4_unicode_ci default '',
80 | `entities_id` int unsigned NOT NULL default '0',
81 | `is_recursive` tinyint NOT NULL default '0',
82 | `plugin_cmdb_citypes_id` int unsigned NOT NULL,
83 | PRIMARY KEY (`id`),
84 | KEY `entities_id` (`entities_id`),
85 | KEY `is_recursive` (`is_recursive`),
86 | KEY `plugin_cmdb_citypes_id` (`plugin_cmdb_citypes_id`)
87 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
88 |
89 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_cifields`;
90 | CREATE TABLE `glpi_plugin_cmdb_cifields`
91 | (
92 | `id` int unsigned NOT NULL auto_increment,
93 | `name` varchar(255) collate utf8mb4_unicode_ci default '',
94 | `typefield` int unsigned NOT NULL,
95 | `plugin_cmdb_citypes_id` int unsigned NOT NULL,
96 | PRIMARY KEY (`id`),
97 | KEY `plugin_cmdb_citypes_id` (`plugin_cmdb_citypes_id`)
98 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
99 |
100 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_civalues`;
101 | CREATE TABLE `glpi_plugin_cmdb_civalues`
102 | (
103 | `id` int unsigned NOT NULL auto_increment,
104 | `value` varchar(255) collate utf8mb4_unicode_ci default '',
105 | `itemtype` varchar(255) NOT NULL,
106 | `items_id` int unsigned NOT NULL,
107 | `plugin_cmdb_cifields_id` int unsigned NOT NULL,
108 | PRIMARY KEY (`id`),
109 | KEY `items_id` (`items_id`),
110 | KEY `plugin_cmdb_cifields_id` (`plugin_cmdb_cifields_id`)
111 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
112 |
113 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_citypes_documents`;
114 | CREATE TABLE `glpi_plugin_cmdb_citypes_documents`
115 | (
116 | `id` int unsigned NOT NULL auto_increment,
117 | `plugin_cmdb_citypes_id` int unsigned NOT NULL default '0',
118 | `types_id` int unsigned NOT NULL default '0',
119 | `documents_id` int unsigned NOT NULL default '0',
120 | PRIMARY KEY (`id`),
121 | KEY `plugin_cmdb_citypes_id` (`plugin_cmdb_citypes_id`),
122 | KEY `types_id` (`types_id`),
123 | KEY `documents_id` (`documents_id`)
124 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
125 |
126 | DROP TABLE IF EXISTS `glpi_plugin_cmdb_criticities`;
127 | CREATE TABLE `glpi_plugin_cmdb_criticities`
128 | (
129 | `id` int unsigned NOT NULL auto_increment,
130 | `businesscriticities_id` int unsigned NOT NULL default '0',
131 | `color` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
132 | `level` tinyint NOT NULL DEFAULT '0',
133 | PRIMARY KEY (`id`),
134 | KEY `businesscriticities_id` (`businesscriticities_id`)
135 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
136 |
137 | INSERT INTO `glpi_displaypreferences` (`id`, `itemtype`, `num`, `rank`, `users_id`)
138 | VALUES (NULL, 'PluginCmdbOperationprocess', 2, 4, 0),
139 | (NULL, 'PluginCmdbOperationprocess', 9, 5, 0),
140 | (NULL, 'PluginCmdbOperationprocess', 10, 6, 0),
141 | (NULL, 'PluginCmdbOperationprocess', 16, 7, 0),
142 | (NULL, 'PluginCmdbCIType', '9', '5', '0');
143 |
--------------------------------------------------------------------------------
/locales/hu_HU.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR CMDB Development Team
3 | # This file is distributed under the same license as the GLPI - CMDB plugin package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | # Translators:
7 | # Árpád Bögöthy, 2024
8 | #
9 | #, fuzzy
10 | msgid ""
11 | msgstr ""
12 | "Project-Id-Version: GLPI - CMDB plugin\n"
13 | "Report-Msgid-Bugs-To: \n"
14 | "POT-Creation-Date: 2022-07-26 13:54+0000\n"
15 | "PO-Revision-Date: 2020-11-02 15:46+0000\n"
16 | "Last-Translator: Árpád Bögöthy, 2024\n"
17 | "Language-Team: Hungarian (Hungary) (https://app.transifex.com/infotelGLPI/teams/124557/hu_HU/)\n"
18 | "MIME-Version: 1.0\n"
19 | "Content-Type: text/plain; charset=UTF-8\n"
20 | "Content-Transfer-Encoding: 8bit\n"
21 | "Language: hu_HU\n"
22 | "Plural-Forms: nplurals=2; plural=(n != 1);\n"
23 |
24 | #: hook.php:328
25 | msgid "item not found or disabled"
26 | msgstr "elem nem található vagy tiltva van"
27 |
28 | #: setup.php:141 inc/ci_cmdb.class.php:49 inc/cmdb.class.php:47
29 | #: inc/menu.class.php:47 inc/profile.class.php:50
30 | msgid "CMDB"
31 | msgstr "CMDB"
32 |
33 | #: front/ci.form.php:66
34 | msgid "You can't delete this item, because this item is used on CMDB !"
35 | msgstr "Nem törölheted ezt az elemet, mert használatban van."
36 |
37 | #: inc/ci.class.php:49
38 | msgid "Configuration Item"
39 | msgid_plural "Configuration Items"
40 | msgstr[0] "Konfigurációs elem"
41 | msgstr[1] "Konfigurációs elemek"
42 |
43 | #: inc/ci.class.php:199
44 | msgid "Invalid name !"
45 | msgstr "Érvénytelen név!"
46 |
47 | #: inc/ci_cmdb.class.php:74
48 | msgid "See CI"
49 | msgstr "Lásd CI"
50 |
51 | #: inc/ci_cmdb.class.php:75
52 | msgid "Create Link"
53 | msgstr "Link létrehozása"
54 |
55 | #: inc/ci_cmdb.class.php:76
56 | msgid "Update Link"
57 | msgstr "Link frissítése"
58 |
59 | #: inc/ci_cmdb.class.php:77
60 | msgid "Delete Link"
61 | msgstr "Link törlése"
62 |
63 | #: inc/ci_cmdb.class.php:78
64 | msgid "Zoom in"
65 | msgstr "Nagyítás"
66 |
67 | #: inc/ci_cmdb.class.php:79
68 | msgid "Zoom out"
69 | msgstr "Kicsinyítés"
70 |
71 | #: inc/ci_cmdb.class.php:80
72 | msgid "Reset Zoom"
73 | msgstr "Nagyítás visszaállítása"
74 |
75 | #: inc/ci_cmdb.class.php:81
76 | msgid "Export PNG"
77 | msgstr "Export PNG"
78 |
79 | #: inc/ci_cmdb.class.php:82
80 | msgid "See associated tickets"
81 | msgstr "Kapcsolódó jegyek megtekintése"
82 |
83 | #: inc/ci_cmdb.class.php:83
84 | msgid "Purge CMDB"
85 | msgstr "CMDB törlése"
86 |
87 | #: inc/ci_cmdb.class.php:84
88 | msgid "Create baseline"
89 | msgstr "Alapvonal létrehozása"
90 |
91 | #: inc/citype.class.php:53
92 | msgid "String"
93 | msgstr "String"
94 |
95 | #: inc/citype.class.php:54
96 | msgid "Area Text"
97 | msgstr "Szöveg mező"
98 |
99 | #: inc/citype.class.php:57
100 | msgid "Yes/No"
101 | msgstr "Igen/Nem"
102 |
103 | #: inc/citype.class.php:66
104 | msgid "Type CI"
105 | msgid_plural "Types CIs"
106 | msgstr[0] "CI típus"
107 | msgstr[1] "CI Típusai"
108 |
109 | #: inc/citype.class.php:175
110 | msgid "is already present in GLPI"
111 | msgstr "már létezik a GLPI-ben"
112 |
113 | #: inc/citype.class.php:302
114 | msgid "Is this item presents in glpi ?"
115 | msgstr "Ez az elem jelen van a glpi-ben?"
116 |
117 | #: inc/citype.class.php:319
118 | msgid "Be careful the name cannot be changed after creation"
119 | msgstr "Vigyázz, a név nem változtatható meg a létrehozás után."
120 |
121 | #: inc/citype.class.php:321
122 | msgid "Do not use a plural classname (like 'myobjects')"
123 | msgstr "Ne használjon többes számot osztálynevenél (pl. 'myobjects')"
124 |
125 | #: inc/citype.class.php:323
126 | msgid "Do not use a classname with spaces (like 'my objects')"
127 | msgstr "Ne használjon szóközt az osztálynevekben (pl. 'saját objektumok')."
128 |
129 | #: inc/citype.class.php:389
130 | msgid "Please, choose an imported CI !"
131 | msgstr "Kérlek, válassz egy importált CI-t!"
132 |
133 | #: inc/citype.class.php:394
134 | msgid "There is already an existing name or the name is invalid"
135 | msgstr "Már létezik ilyen név, vagy a név érvénytelen."
136 |
137 | #: inc/citype.class.php:582
138 | msgid "Import CI"
139 | msgstr "CI importálása"
140 |
141 | #: inc/citype.class.php:622
142 | msgid "Icon"
143 | msgstr "Ikon"
144 |
145 | #: inc/citype.class.php:661
146 | msgid "Default icon"
147 | msgstr "Alapértelmezett ikon"
148 |
149 | #: inc/citype.class.php:947
150 | msgid "Add New Field"
151 | msgstr "Új mező hozzáadása"
152 |
153 | #: inc/citype.class.php:971
154 | msgid "Upload icon"
155 | msgstr "Ikon feltöltése"
156 |
157 | #: inc/citype.class.php:997
158 | msgid "Existing fields for this type of CI"
159 | msgstr "Meglévő mezők ehhez a CI típushoz"
160 |
161 | #: inc/citype.class.php:1001
162 | msgid "Reset Existing fields"
163 | msgstr "Már létező mezők visszaállítása"
164 |
165 | #. TRANS: Default document to files attached to tickets : %d is the ticket id
166 | #: inc/citype.class.php:1084
167 | #, php-format
168 | msgid "Icon CIType %d"
169 | msgstr "CIType ikon %d"
170 |
171 | #: inc/citype.class.php:1328 inc/citype.class.php:1343
172 | msgctxt "button"
173 | msgid "Transfer"
174 | msgstr "Átvitel"
175 |
176 | #: inc/cmdb.class.php:84
177 | msgid "Display Item Configuration"
178 | msgstr "Elem konfigurációjának megjelenítése"
179 |
180 | #: inc/cmdb.class.php:169 inc/cmdb.class.php:172
181 | msgid "No Types of CI found. Please create Types of CI before display CIs"
182 | msgstr ""
183 | "Nem található CI típus. Kérjük, hozd létre CI típusokat a CI-k megjelenítése"
184 | " előtt."
185 |
186 | #: inc/cmdb_ticket.class.php:94
187 | msgid "Elements linked to the ticket aren't imported in CMDB"
188 | msgstr "A jeggyel összekapcsolt elemek nem kerülnek importálásra a CMDB-be."
189 |
190 | #: inc/cmdb_ticket.class.php:99
191 | msgid "No elements of CMDB linked to the ticket"
192 | msgstr "Nincsenek CMDB elemek a jegyhez kapcsolva"
193 |
194 | #: inc/cmdb_ticket.class.php:113 inc/cmdb_ticket.class.php:151
195 | msgid "Impacted items"
196 | msgstr "Érintett elemek"
197 |
198 | #: inc/cmdb_ticket.class.php:152
199 | msgid "Proximity"
200 | msgstr "Közelség"
201 |
202 | #: inc/cmdb_ticket.class.php:194
203 | msgid "Direct impact"
204 | msgstr "Közvetlen hatás"
205 |
206 | #: inc/criticity.class.php:51 inc/criticity.class.php:118
207 | #: inc/criticity_item.class.php:49
208 | msgid "Criticity"
209 | msgid_plural "Criticities"
210 | msgstr[0] "Kritikusság"
211 | msgstr[1] "Kritikusság"
212 |
213 | #: inc/criticity.class.php:137
214 | msgid "All levels have already been added"
215 | msgstr "Már minden szint hozzá lett adva"
216 |
217 | #: inc/criticity.class.php:187
218 | msgid "Please choose a level for criticality"
219 | msgstr "Kérjük, válaszd ki a kritikusság szintjét"
220 |
221 | #: inc/menu.class.php:67
222 | msgid "Configure Type of Item Configuration"
223 | msgstr "Konfiguráld az elem konfigurációjának típusát."
224 |
225 | #: inc/menu.class.php:69 inc/profile.class.php:109
226 | msgid "Item Configuration"
227 | msgstr "Elem konfiguráció"
228 |
229 | #: inc/operationprocess.class.php:51 inc/operationprocessmenu.class.php:49
230 | #: inc/profile.class.php:117 inc/profile.class.php:149
231 | #: inc/profile.class.php:187
232 | msgid "Service"
233 | msgid_plural "Services"
234 | msgstr[0] "Szolgáltatások"
235 | msgstr[1] "Szolgáltatások"
236 |
237 | #: inc/operationprocess_item.class.php:87
238 | #: inc/operationprocess_item.class.php:89
239 | msgid "Attached service"
240 | msgid_plural "Attached services"
241 | msgstr[0] "Kapcsolódó szolgáltatások"
242 | msgstr[1] "Kapcsolódó szolgáltatások"
243 |
244 | #: inc/operationprocess_item.class.php:485
245 | msgctxt "button"
246 | msgid "Associate a service"
247 | msgstr "Egy szolgáltatás hozzárendelése"
248 |
249 | #: inc/operationprocessstate.class.php:50
250 | msgid "State of service"
251 | msgid_plural "States of service"
252 | msgstr[0] "Szolgáltatás állapota"
253 | msgstr[1] "Szolgáltatás állapotai"
254 |
255 | #: inc/profile.class.php:113 inc/profile.class.php:172
256 | msgid "Type of item configuration"
257 | msgid_plural "Types of item configuration"
258 | msgstr[0] "Az elem konfiguráció típusa"
259 | msgstr[1] "Az elem konfiguráció típusai"
260 |
261 | #: inc/profile.class.php:160 inc/profile.class.php:191
262 | msgid "Item configuration"
263 | msgid_plural "Items configuration"
264 | msgstr[0] "Elem konfiguráció"
265 | msgstr[1] "Elemek konfigurációja"
266 |
267 | #: inc/profile.class.php:195
268 | msgid "Type of Item Configuration"
269 | msgid_plural "Types of item configuration"
270 | msgstr[0] "Az elem konfiguráció típusa"
271 | msgstr[1] "Az elem konfiguráció típusai"
272 |
273 | #: install/update_110_111.php:86
274 | msgid "very low"
275 | msgstr "nagyon alacsony"
276 |
277 | #: install/update_110_111.php:87
278 | msgid "low"
279 | msgstr "alacsony"
280 |
281 | #: install/update_110_111.php:88
282 | msgid "medium"
283 | msgstr "közepes"
284 |
285 | #: install/update_110_111.php:89
286 | msgid "high"
287 | msgstr "magas"
288 |
289 | #: install/update_110_111.php:90
290 | msgid "very high"
291 | msgstr "nagyon magas"
292 |
--------------------------------------------------------------------------------
/src/Cmdb_Ticket.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | namespace GlpiPlugin\Cmdb;
31 |
32 | use CommonDBRelation;
33 | use CommonDBTM;
34 | use CommonGLPI;
35 | use Item_Ticket;
36 |
37 | if (!defined('GLPI_ROOT')) {
38 | die("Sorry. You can't access directly to this file");
39 | }
40 |
41 | /**
42 | * Class Cmdb_Ticket
43 | */
44 | class Cmdb_Ticket extends CommonDBRelation
45 | {
46 |
47 | static $rightname = "plugin_cmdb_cis";
48 |
49 | /**
50 | * Get Tab Name used for itemtype
51 | *
52 | * NB : Only called for existing object
53 | * Must check right on what will be displayed + template
54 | *
55 | * @since version 0.83
56 | *
57 | * @param $item CommonDBTM object for which the tab need to be displayed
58 | * @param $withtemplate boolean is a template object ? (default 0)
59 | *
60 | * @return string tab name
61 | **/
62 | //TODO MAJ COEUR
63 | // public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) {
64 | // if ($item->getType() == "Ticket"
65 | // && Session::haveRight(self::$rightname, READ)
66 | // && Session::getCurrentInterface() == "central") {
67 | // return __("Criticities impact", 'cmdb');
68 | // }
69 | // }
70 |
71 | /**
72 | * show Tab content
73 | *
74 | * @since version 0.83
75 | *
76 | * @param $item CommonGLPI object for which the tab need to be displayed
77 | * @param $tabnum integer tab number (default 1)
78 | * @param $withtemplate boolean is a template object ? (default 0)
79 | *
80 | * @return true
81 | * */
82 | public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0)
83 | {
84 |
85 | self::showImpactCMDB($item);
86 |
87 | return true;
88 | }
89 |
90 | /**
91 | * @param \CommonGLPI $item
92 | */
93 | static function showImpactCMDB(CommonGLPI $item)
94 | {
95 |
96 | $idTicket = $item->fields['id'];
97 | $items_ticket = new Item_Ticket();
98 | if ($items = $items_ticket->find(['tickets_id' => $idTicket])) {
99 | $impactedItems = self::getImpactedItems($items);
100 | if (!empty($impactedItems['nodes'])) {
101 | self::showImpactedItems($impactedItems);
102 | } else {
103 | echo "";
104 | echo __("Elements linked to the ticket aren't imported in CMDB", "cmdb");
105 | echo "
";
106 | }
107 | } else {
108 | echo "";
109 | echo __("No elements of CMDB linked to the ticket", "cmdb");
110 | echo "
";
111 | }
112 | }
113 |
114 | /**
115 | * @param $impactedItems
116 | */
117 | static function showImpactedItems($impactedItems)
118 | {
119 |
120 | $ci = new CI();
121 |
122 | echo "";
123 | echo "";
126 | echo "";
127 | $rand = mt_rand();
128 | echo "";
129 |
130 | $criticities = Criticity::getAllCriticityWithColor();
131 |
132 | $itemsSortByCriticity = [1 => [],
133 | 2 => [],
134 | 3 => [],
135 | 4 => [],
136 | 5 => []];
137 |
138 | foreach ($impactedItems['nodes'] as $key => $node) {
139 | $levelMin = -1;
140 | if ($levelMin == -1 || $node['level'] < $levelMin) {
141 | $items_id_ref = $node['items_id_ref'];
142 | $itemtype_ref = $node['citypes_id_ref'];
143 | $criticity_id = $node['criticity'];
144 | $levelMin = $node['level'];
145 | }
146 |
147 | $itemsSortByCriticity[$criticity_id][] = ['idItem' => $node['idItem'],
148 | 'idItemtype' => $node['idItemtype'],
149 | 'items_id_ref' => $items_id_ref,
150 | 'itemtype_ref' => $itemtype_ref,
151 | 'level' => $levelMin];
152 | }
153 |
154 | foreach ($criticities as $value => $data) {
155 | if (!empty($itemsSortByCriticity[$value])) {
156 | $color = $data['color'];
157 | $name = $data['name'];
158 | echo " " . Criticity_Item::getTypeName(1) . " : $name";
159 | echo " ";
160 | echo " ";
161 | echo "";
165 | usort($itemsSortByCriticity[$value], function ($a, $b) {
166 | return $a['level'] - $b['level'];
167 | });
168 | foreach ($itemsSortByCriticity[$value] as $info) {
169 | echo "";
170 | echo "| ";
171 |
172 | $citype = new CIType();
173 | $citype->getFromDB($info['idItemtype']);
174 | $citype_name = $ci->getTypeName2($citype);
175 | $ci_name = $ci->getNameCI($citype, $info['idItem']);
176 | $url = $ci->getLinkCI($citype, $info['idItem']);
177 | echo "" . $citype_name . " : " . $ci_name . "";
178 | echo " | ";
179 |
180 | echo "";
181 | echo self::getImpactName($info['level']);
182 | echo " | ";
183 | echo " ";
184 | }
185 | echo " ";
186 | echo " ";
187 | }
188 | }
189 | echo " ";
190 | echo " |
";
191 | echo "
";
192 | echo "";
195 | }
196 |
197 | /**
198 | * @param $level
199 | *
200 | * @return string
201 | */
202 | static function getImpactName($level)
203 | {
204 |
205 | if ($level == 1) {
206 | return __('Direct impact', 'cmdb');
207 | }
208 | return $level;
209 | }
210 |
211 | /**
212 | * @param $items
213 | *
214 | * @return array
215 | */
216 | static function getImpactedItems($items)
217 | {
218 |
219 | $impactedItems = ['nodes' => []];
220 | $itemCiCmdb = new CI_Cmdb();
221 |
222 | foreach ($items as $item) {
223 | $id = $item['items_id'];
224 | $itemtype = $item['itemtype'];
225 | $citypes = new CIType();
226 |
227 | if ($citype = $citypes->find(['name' => $itemtype])) {
228 | $citype = current($citype);
229 | $citypes->getFromDB($citype['id']);
230 |
231 | // Construct first item
232 | $impactedItems['nodes'][] = $itemCiCmdb->constructItem($id, $citype['id'], $id, $citype['id']);
233 |
234 | // Set item links recusively
235 | $itemCiCmdb->setItem(
236 | $id,
237 | $citype['id'],
238 | $id,
239 | $citype['id'],
240 | $impactedItems,
241 | 0,
242 | ['firstItem' => true, 'setLinks' => false]
243 | );
244 | }
245 | }
246 |
247 | return $impactedItems;
248 | }
249 | }
250 |
--------------------------------------------------------------------------------
/locales/es_EC.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR CMDB Development Team
3 | # This file is distributed under the same license as the GLPI - CMDB plugin package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | # Translators:
7 | # Soporte Infraestructura Standby, 2023
8 | #
9 | #, fuzzy
10 | msgid ""
11 | msgstr ""
12 | "Project-Id-Version: GLPI - CMDB plugin\n"
13 | "Report-Msgid-Bugs-To: \n"
14 | "POT-Creation-Date: 2022-07-26 13:54+0000\n"
15 | "PO-Revision-Date: 2020-11-02 15:46+0000\n"
16 | "Last-Translator: Soporte Infraestructura Standby, 2023\n"
17 | "Language-Team: Spanish (Ecuador) (https://app.transifex.com/infotelGLPI/teams/124557/es_EC/)\n"
18 | "MIME-Version: 1.0\n"
19 | "Content-Type: text/plain; charset=UTF-8\n"
20 | "Content-Transfer-Encoding: 8bit\n"
21 | "Language: es_EC\n"
22 | "Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
23 |
24 | #: hook.php:328
25 | msgid "item not found or disabled"
26 | msgstr "elemento no encontrado o deshabilitado"
27 |
28 | #: setup.php:141 inc/ci_cmdb.class.php:49 inc/cmdb.class.php:47
29 | #: inc/menu.class.php:47 inc/profile.class.php:50
30 | msgid "CMDB"
31 | msgstr "CMDB"
32 |
33 | #: front/ci.form.php:66
34 | msgid "You can't delete this item, because this item is used on CMDB !"
35 | msgstr "¡No puede eliminar este element, porque se utiliza en la CMDB!"
36 |
37 | #: inc/ci.class.php:49
38 | msgid "Configuration Item"
39 | msgid_plural "Configuration Items"
40 | msgstr[0] "Elementos de configuración"
41 | msgstr[1] "Elementos de configuración"
42 | msgstr[2] "Elementos de configuración"
43 |
44 | #: inc/ci.class.php:199
45 | msgid "Invalid name !"
46 | msgstr "¡Nombre inválido!"
47 |
48 | #: inc/ci_cmdb.class.php:74
49 | msgid "See CI"
50 | msgstr "Ver CI"
51 |
52 | #: inc/ci_cmdb.class.php:75
53 | msgid "Create Link"
54 | msgstr "Crear enlace"
55 |
56 | #: inc/ci_cmdb.class.php:76
57 | msgid "Update Link"
58 | msgstr "Actualizar enlace"
59 |
60 | #: inc/ci_cmdb.class.php:77
61 | msgid "Delete Link"
62 | msgstr "Borrar enlace"
63 |
64 | #: inc/ci_cmdb.class.php:78
65 | msgid "Zoom in"
66 | msgstr "Ampliar"
67 |
68 | #: inc/ci_cmdb.class.php:79
69 | msgid "Zoom out"
70 | msgstr "Reducir"
71 |
72 | #: inc/ci_cmdb.class.php:80
73 | msgid "Reset Zoom"
74 | msgstr "Restablecer zoom"
75 |
76 | #: inc/ci_cmdb.class.php:81
77 | msgid "Export PNG"
78 | msgstr "Exportar PNG"
79 |
80 | #: inc/ci_cmdb.class.php:82
81 | msgid "See associated tickets"
82 | msgstr "Ver casos asociados"
83 |
84 | #: inc/ci_cmdb.class.php:83
85 | msgid "Purge CMDB"
86 | msgstr "Depurar CMDB"
87 |
88 | #: inc/ci_cmdb.class.php:84
89 | msgid "Create baseline"
90 | msgstr "Crear una base de referencia"
91 |
92 | #: inc/citype.class.php:53
93 | msgid "String"
94 | msgstr "Cadena"
95 |
96 | #: inc/citype.class.php:54
97 | msgid "Area Text"
98 | msgstr "Área del texto"
99 |
100 | #: inc/citype.class.php:57
101 | msgid "Yes/No"
102 | msgstr "Sí/No"
103 |
104 | #: inc/citype.class.php:66
105 | msgid "Type CI"
106 | msgid_plural "Types CIs"
107 | msgstr[0] "Tipo de CI"
108 | msgstr[1] "Tipos de CIs"
109 | msgstr[2] "Tipos de CIs"
110 |
111 | #: inc/citype.class.php:175
112 | msgid "is already present in GLPI"
113 | msgstr "ya está presente en GLPI"
114 |
115 | #: inc/citype.class.php:302
116 | msgid "Is this item presents in glpi ?"
117 | msgstr "¿Este elemento está presente en glpi?"
118 |
119 | #: inc/citype.class.php:319
120 | msgid "Be careful the name cannot be changed after creation"
121 | msgstr "Tenga cuidado, el nombre no se puede cambiar después de la creación"
122 |
123 | #: inc/citype.class.php:321
124 | msgid "Do not use a plural classname (like 'myobjects')"
125 | msgstr "No utilice un nombre de clase en plural (como \"misobjetos\")"
126 |
127 | #: inc/citype.class.php:323
128 | msgid "Do not use a classname with spaces (like 'my objects')"
129 | msgstr "No utilice un nombre de clase con espacios (como \"mis objetos\")"
130 |
131 | #: inc/citype.class.php:389
132 | msgid "Please, choose an imported CI !"
133 | msgstr "¡Por favor, elija un CI importado!"
134 |
135 | #: inc/citype.class.php:394
136 | msgid "There is already an existing name or the name is invalid"
137 | msgstr "Ya existe un nombre o el nombre no es válido"
138 |
139 | #: inc/citype.class.php:582
140 | msgid "Import CI"
141 | msgstr "Importar CI"
142 |
143 | #: inc/citype.class.php:622
144 | msgid "Icon"
145 | msgstr "Icono"
146 |
147 | #: inc/citype.class.php:661
148 | msgid "Default icon"
149 | msgstr "Icono predeterminado"
150 |
151 | #: inc/citype.class.php:947
152 | msgid "Add New Field"
153 | msgstr "Agregar Nuevo Campo"
154 |
155 | #: inc/citype.class.php:971
156 | msgid "Upload icon"
157 | msgstr "Subir icono"
158 |
159 | #: inc/citype.class.php:997
160 | msgid "Existing fields for this type of CI"
161 | msgstr "Campos existentes para este tipo de CI"
162 |
163 | #: inc/citype.class.php:1001
164 | msgid "Reset Existing fields"
165 | msgstr "Restablecer campos existentes"
166 |
167 | #. TRANS: Default document to files attached to tickets : %d is the ticket id
168 | #: inc/citype.class.php:1084
169 | #, php-format
170 | msgid "Icon CIType %d"
171 | msgstr "Icono CIType 1%d"
172 |
173 | #: inc/citype.class.php:1328 inc/citype.class.php:1343
174 | msgctxt "button"
175 | msgid "Transfer"
176 | msgstr "Transferir"
177 |
178 | #: inc/cmdb.class.php:84
179 | msgid "Display Item Configuration"
180 | msgstr "Configuración de elementos de visualización"
181 |
182 | #: inc/cmdb.class.php:169 inc/cmdb.class.php:172
183 | msgid "No Types of CI found. Please create Types of CI before display CIs"
184 | msgstr ""
185 | "No se han encontrado Tipos de CI. Por favor, cree Tipos de CI antes de "
186 | "mostrar los CIs"
187 |
188 | #: inc/cmdb_ticket.class.php:94
189 | msgid "Elements linked to the ticket aren't imported in CMDB"
190 | msgstr "Los elementos vinculados al caso no se importan en la CMDB"
191 |
192 | #: inc/cmdb_ticket.class.php:99
193 | msgid "No elements of CMDB linked to the ticket"
194 | msgstr "No hay elementos de CMDB vinculados al caso"
195 |
196 | #: inc/cmdb_ticket.class.php:113 inc/cmdb_ticket.class.php:151
197 | msgid "Impacted items"
198 | msgstr "Elementos afectados"
199 |
200 | #: inc/cmdb_ticket.class.php:152
201 | msgid "Proximity"
202 | msgstr "Proximidad"
203 |
204 | #: inc/cmdb_ticket.class.php:194
205 | msgid "Direct impact"
206 | msgstr "Impacto directo"
207 |
208 | #: inc/criticity.class.php:51 inc/criticity.class.php:118
209 | #: inc/criticity_item.class.php:49
210 | msgid "Criticity"
211 | msgid_plural "Criticities"
212 | msgstr[0] "Criticidad"
213 | msgstr[1] "Criticidades"
214 | msgstr[2] "Criticidades"
215 |
216 | #: inc/criticity.class.php:137
217 | msgid "All levels have already been added"
218 | msgstr "Ya se han añadido todos los niveles"
219 |
220 | #: inc/criticity.class.php:187
221 | msgid "Please choose a level for criticality"
222 | msgstr "Por favor elija un nivel de criticidad"
223 |
224 | #: inc/menu.class.php:67
225 | msgid "Configure Type of Item Configuration"
226 | msgstr "Configurar el Tipo de Configuración del elemento"
227 |
228 | #: inc/menu.class.php:69 inc/profile.class.php:109
229 | msgid "Item Configuration"
230 | msgstr "Configuración de elementos"
231 |
232 | #: inc/operationprocess.class.php:51 inc/operationprocessmenu.class.php:49
233 | #: inc/profile.class.php:117 inc/profile.class.php:149
234 | #: inc/profile.class.php:187
235 | msgid "Service"
236 | msgid_plural "Services"
237 | msgstr[0] "Servicio"
238 | msgstr[1] "Servicios"
239 | msgstr[2] "Servicios"
240 |
241 | #: inc/operationprocess_item.class.php:87
242 | #: inc/operationprocess_item.class.php:89
243 | msgid "Attached service"
244 | msgid_plural "Attached services"
245 | msgstr[0] "Servicio adjunto"
246 | msgstr[1] "Servicios adjuntos"
247 | msgstr[2] "Servicios adjuntos"
248 |
249 | #: inc/operationprocess_item.class.php:485
250 | msgctxt "button"
251 | msgid "Associate a service"
252 | msgstr "Asociar un servicio"
253 |
254 | #: inc/operationprocessstate.class.php:50
255 | msgid "State of service"
256 | msgid_plural "States of service"
257 | msgstr[0] "Estado del servicio"
258 | msgstr[1] "Estados de los servicios"
259 | msgstr[2] "Estados de los servicios"
260 |
261 | #: inc/profile.class.php:113 inc/profile.class.php:172
262 | msgid "Type of item configuration"
263 | msgid_plural "Types of item configuration"
264 | msgstr[0] "Tipo de configuración del elemento"
265 | msgstr[1] "Tipos de configuración de elementos"
266 | msgstr[2] "Tipos de configuración de elementos"
267 |
268 | #: inc/profile.class.php:160 inc/profile.class.php:191
269 | msgid "Item configuration"
270 | msgid_plural "Items configuration"
271 | msgstr[0] "Configuración del elemento"
272 | msgstr[1] "Configuración de elementos"
273 | msgstr[2] "Configuración de elementos"
274 |
275 | #: inc/profile.class.php:195
276 | msgid "Type of Item Configuration"
277 | msgid_plural "Types of item configuration"
278 | msgstr[0] "Tipos de configuración de elementos"
279 | msgstr[1] "Tipos de configuración de elementos"
280 | msgstr[2] "Tipos de configuración de elementos"
281 |
282 | #: install/update_110_111.php:86
283 | msgid "very low"
284 | msgstr "muy bajo"
285 |
286 | #: install/update_110_111.php:87
287 | msgid "low"
288 | msgstr "bajo"
289 |
290 | #: install/update_110_111.php:88
291 | msgid "medium"
292 | msgstr "medio"
293 |
294 | #: install/update_110_111.php:89
295 | msgid "high"
296 | msgstr "alta"
297 |
298 | #: install/update_110_111.php:90
299 | msgid "very high"
300 | msgstr "muy alto"
301 |
--------------------------------------------------------------------------------
/locales/en_GB.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR CMDB Development Team
3 | # This file is distributed under the same license as the GLPI - CMDB plugin package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | msgid ""
7 | msgstr ""
8 | "Project-Id-Version: GLPI - CMDB plugin 1.1.0\n"
9 | "Report-Msgid-Bugs-To: \n"
10 | "POT-Creation-Date: 2020-07-20 09:11+0200\n"
11 | "PO-Revision-Date: 2020-07-30 14:44+0200\n"
12 | "MIME-Version: 1.0\n"
13 | "Content-Type: text/plain; charset=UTF-8\n"
14 | "Content-Transfer-Encoding: 8bit\n"
15 | "Language: en_GB\n"
16 | "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17 | "Last-Translator: \n"
18 | "Language-Team: \n"
19 | "X-Generator: Poedit 2.3\n"
20 |
21 | #: hook.php:326 inc/ci_cmdb.class.php:337 inc/ci_cmdb.class.php:352
22 | msgid "item not found or disabled"
23 | msgstr "item not found or disabled"
24 |
25 | #: setup.php:139 inc/ci_cmdb.class.php:49 inc/cmdb.class.php:47
26 | #: inc/menu.class.php:47 inc/profile.class.php:50
27 | msgid "CMDB"
28 | msgstr "CMDB"
29 |
30 | #: front/ci.form.php:66
31 | msgid "You can't delete this item, because this item is used on CMDB !"
32 | msgstr "You can't delete this item, because this item is used on CMDB !"
33 |
34 | #: inc/ci.class.php:49
35 | msgid "Configuration Item"
36 | msgid_plural "Configuration Items"
37 | msgstr[0] "Configuration Item"
38 | msgstr[1] "Configuration Items"
39 |
40 | #: inc/ci.class.php:199
41 | msgid "Invalid name !"
42 | msgstr "Invalid name !"
43 |
44 | #: inc/ci_cmdb.class.php:74
45 | msgid "See CI"
46 | msgstr "See CI"
47 |
48 | #: inc/ci_cmdb.class.php:75
49 | msgid "Create Link"
50 | msgstr "Create Link"
51 |
52 | #: inc/ci_cmdb.class.php:76
53 | msgid "Update Link"
54 | msgstr "Update Link"
55 |
56 | #: inc/ci_cmdb.class.php:77
57 | msgid "Delete Link"
58 | msgstr "Delete Link"
59 |
60 | #: inc/ci_cmdb.class.php:78
61 | msgid "Zoom in"
62 | msgstr "Zoom in"
63 |
64 | #: inc/ci_cmdb.class.php:79
65 | msgid "Zoom out"
66 | msgstr "Zoom out"
67 |
68 | #: inc/ci_cmdb.class.php:80
69 | msgid "Reset Zoom"
70 | msgstr "Reset Zoom"
71 |
72 | #: inc/ci_cmdb.class.php:81
73 | msgid "Export PNG"
74 | msgstr "Export PNG"
75 |
76 | #: inc/ci_cmdb.class.php:82
77 | msgid "See associated tickets"
78 | msgstr "See associated tickets"
79 |
80 | #: inc/ci_cmdb.class.php:83
81 | msgid "Purge CMDB"
82 | msgstr "Purge CMDB"
83 |
84 | #: inc/ci_cmdb.class.php:84
85 | msgid "Create baseline"
86 | msgstr "Create baseline"
87 |
88 | #: inc/ci_cmdb.class.php:204
89 | msgid "Preferences"
90 | msgstr "Preferences"
91 |
92 | #: inc/ci_cmdb.class.php:210
93 | msgid "View links"
94 | msgstr "View links"
95 |
96 | #: inc/ci_cmdb.class.php:222
97 | msgid "Refresh"
98 | msgstr "Refresh"
99 |
100 | #: inc/ci_cmdb.class.php:225
101 | msgid "Save positions"
102 | msgstr "Save positions"
103 |
104 | #: inc/ci_cmdb.class.php:250
105 | msgid "Add new type of CI to the CMDB"
106 | msgstr "Add new type of CI to the CMDB"
107 |
108 | #: inc/ci_cmdb.class.php:255
109 | msgid "Add new type of link to the CMDB"
110 | msgstr "Add new type of link to the CMDB"
111 |
112 | #: inc/ci_cmdb.class.php:261
113 | msgid "Manage type of CI to the CMDB"
114 | msgstr "Manage type of CI to the CMDB"
115 |
116 | #: inc/ci_cmdb.class.php:266
117 | msgid "Manage type of links to the CMDB"
118 | msgstr "Manage type of links to the CMDB"
119 |
120 | #: inc/ci_cmdb.class.php:283 inc/ci_cmdb.class.php:290
121 | msgid "Existing links"
122 | msgstr "Existing links"
123 |
124 | #: inc/ci_cmdb.class.php:307
125 | msgid "Linked element"
126 | msgstr "Linked element"
127 |
128 | #: inc/ci_cmdb.class.php:425
129 | msgid "CMDB depth"
130 | msgstr "CMDB depth"
131 |
132 | #: inc/citype.class.php:53
133 | msgid "String"
134 | msgstr "String"
135 |
136 | #: inc/citype.class.php:54
137 | msgid "Area Text"
138 | msgstr "Area Text"
139 |
140 | #: inc/citype.class.php:57
141 | msgid "Yes/No"
142 | msgstr "Yes/No"
143 |
144 | #: inc/citype.class.php:66
145 | msgid "Type CI"
146 | msgid_plural "Types CIs"
147 | msgstr[0] "Type CI"
148 | msgstr[1] "Types CIs"
149 |
150 | #: inc/citype.class.php:178
151 | msgid "is already present in GLPI"
152 | msgstr "is already present in GLPI"
153 |
154 | #: inc/citype.class.php:305
155 | msgid "Is this item presents in glpi ?"
156 | msgstr "Is this item presents in glpi ?"
157 |
158 | #: inc/citype.class.php:315
159 | msgid "Be careful the name cannot be changed after creation"
160 | msgstr "Be careful the name cannot be changed after creation"
161 |
162 | #: inc/citype.class.php:317
163 | msgid "Do not use a plural classname (like 'myobjects')"
164 | msgstr "Do not use a plural classname (like 'myobjects')"
165 |
166 | #: inc/citype.class.php:319
167 | msgid "Do not use a classname with spaces (like 'my objects')"
168 | msgstr "Do not use a classname with spaces (like 'my objects')"
169 |
170 | #: inc/citype.class.php:385
171 | msgid "Please, choose an imported CI !"
172 | msgstr "Please, choose an imported CI !"
173 |
174 | #: inc/citype.class.php:390
175 | msgid "There is already an existing name or the name is invalid"
176 | msgstr "There is already an existing name or the name is invalid"
177 |
178 | #: inc/citype.class.php:578
179 | msgid "Import CI"
180 | msgstr "Import CI"
181 |
182 | #: inc/citype.class.php:618
183 | msgid "Icon by types"
184 | msgstr "Icon by types"
185 |
186 | #: inc/citype.class.php:657
187 | msgid "Default icon"
188 | msgstr "Default icon"
189 |
190 | #: inc/citype.class.php:940
191 | msgid "Add New Field"
192 | msgstr "Add New Field"
193 |
194 | #: inc/citype.class.php:964
195 | msgid "Upload icon"
196 | msgstr "Upload icon"
197 |
198 | #: inc/citype.class.php:990
199 | msgid "Existing fields for this type of CI"
200 | msgstr "Existing fields for this type of CI"
201 |
202 | #: inc/citype.class.php:994
203 | msgid "Reset Existing fields"
204 | msgstr "Reset Existing fields"
205 |
206 | #. TRANS: Default document to files attached to tickets : %d is the ticket id
207 | #: inc/citype.class.php:1076
208 | #, php-format
209 | msgid "Icon CIType %d"
210 | msgstr "Icon CIType %d"
211 |
212 | #: inc/citype.class.php:1320 inc/citype.class.php:1335
213 | msgctxt "button"
214 | msgid "Transfer"
215 | msgstr "Transfer"
216 |
217 | #: inc/cmdb.class.php:88
218 | msgid "Display Item Configuration"
219 | msgstr "Display Item Configuration"
220 |
221 | #: inc/cmdb.class.php:173 inc/cmdb.class.php:176
222 | msgid "No Types of CI found. Please create Types of CI before display CIs"
223 | msgstr "No Types of CI found. Please create Types of CI before display CIs"
224 |
225 | #: inc/cmdb_ticket.class.php:94
226 | msgid "Elements linked to the ticket aren't imported in CMDB"
227 | msgstr "Elements linked to the ticket aren't imported in CMDB"
228 |
229 | #: inc/cmdb_ticket.class.php:99
230 | msgid "No elements of CMDB linked to the ticket"
231 | msgstr "No elements of CMDB linked to the ticket"
232 |
233 | #: inc/cmdb_ticket.class.php:113 inc/cmdb_ticket.class.php:151
234 | msgid "Impacted items"
235 | msgstr "Impacted items"
236 |
237 | #: inc/cmdb_ticket.class.php:152
238 | msgid "Proximity"
239 | msgstr "Proximity"
240 |
241 | #: inc/cmdb_ticket.class.php:194
242 | msgid "Direct impact"
243 | msgstr "Direct impact"
244 |
245 | #: inc/criticity.class.php:51 inc/criticity.class.php:118
246 | #: inc/criticity_item.class.php:49
247 | msgid "Criticity"
248 | msgid_plural "Criticities"
249 | msgstr[0] "Criticity"
250 | msgstr[1] "Criticities"
251 |
252 | #: inc/criticity.class.php:137
253 | msgid "All levels have already been added"
254 | msgstr "All levels have already been added"
255 |
256 | #: inc/criticity.class.php:187
257 | msgid "Please choose a level for criticality"
258 | msgstr "Please choose a level for criticality"
259 |
260 | #: inc/menu.class.php:64
261 | msgid "Configure Type of Item Configuration"
262 | msgstr "Configure Type of Item Configuration"
263 |
264 | #: inc/menu.class.php:66 inc/profile.class.php:109
265 | msgid "Item Configuration"
266 | msgstr "Item Configuration"
267 |
268 | #: inc/operationprocess.class.php:51 inc/operationprocessmenu.class.php:49
269 | #: inc/profile.class.php:117 inc/profile.class.php:149
270 | #: inc/profile.class.php:187
271 | msgid "Service"
272 | msgid_plural "Services"
273 | msgstr[0] "Service"
274 | msgstr[1] "Services"
275 |
276 | #: inc/operationprocess_item.class.php:87
277 | #: inc/operationprocess_item.class.php:89
278 | msgid "Attached service"
279 | msgid_plural "Attached services"
280 | msgstr[0] "Attached service"
281 | msgstr[1] "Attached services"
282 |
283 | #: inc/operationprocess_item.class.php:483
284 | msgctxt "button"
285 | msgid "Associate a service"
286 | msgstr "Associate a service"
287 |
288 | #: inc/operationprocessstate.class.php:50
289 | msgid "State of service"
290 | msgid_plural "States of service"
291 | msgstr[0] "State of service"
292 | msgstr[1] "States of service"
293 |
294 | #: inc/profile.class.php:113 inc/profile.class.php:172
295 | msgid "Type of item configuration"
296 | msgid_plural "Types of item configuration"
297 | msgstr[0] "Type of item configuration"
298 | msgstr[1] "Types of item configuration"
299 |
300 | #: inc/profile.class.php:160 inc/profile.class.php:191
301 | msgid "Item configuration"
302 | msgid_plural "Items configuration"
303 | msgstr[0] "Item configuration"
304 | msgstr[1] "Items configuration"
305 |
306 | #: inc/profile.class.php:195
307 | msgid "Type of Item Configuration"
308 | msgid_plural "Types of item configuration"
309 | msgstr[0] "Type of Item Configuration"
310 | msgstr[1] "Types of item configuration"
311 |
312 | #: install/update_110_111.php:86
313 | msgid "very low"
314 | msgstr "very low"
315 |
316 | #: install/update_110_111.php:87
317 | msgid "low"
318 | msgstr "low"
319 |
320 | #: install/update_110_111.php:88
321 | msgid "medium"
322 | msgstr "medium"
323 |
324 | #: install/update_110_111.php:89
325 | msgid "high"
326 | msgstr "high"
327 |
328 | #: install/update_110_111.php:90
329 | msgid "very high"
330 | msgstr "very high"
331 |
--------------------------------------------------------------------------------
/locales/tr_TR.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR CMDB Development Team
3 | # This file is distributed under the same license as the GLPI - CMDB plugin package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | # Translators:
7 | # Kaya Zeren , 2021
8 | #
9 | #, fuzzy
10 | msgid ""
11 | msgstr ""
12 | "Project-Id-Version: GLPI - CMDB plugin\n"
13 | "Report-Msgid-Bugs-To: \n"
14 | "POT-Creation-Date: 2021-01-06 10:33+0000\n"
15 | "PO-Revision-Date: 2020-11-02 15:46+0000\n"
16 | "Last-Translator: Kaya Zeren , 2021\n"
17 | "Language-Team: Turkish (Turkey) (https://www.transifex.com/infotelGLPI/teams/12376/tr_TR/)\n"
18 | "MIME-Version: 1.0\n"
19 | "Content-Type: text/plain; charset=UTF-8\n"
20 | "Content-Transfer-Encoding: 8bit\n"
21 | "Language: tr_TR\n"
22 | "Plural-Forms: nplurals=2; plural=(n > 1);\n"
23 |
24 | #: hook.php:326 inc/ci_cmdb.class.php:337 inc/ci_cmdb.class.php:352
25 | msgid "item not found or disabled"
26 | msgstr "Öge bulunamadı ya da devre dışı bırakılmış"
27 |
28 | #: setup.php:139 inc/ci_cmdb.class.php:49 inc/cmdb.class.php:47
29 | #: inc/menu.class.php:47 inc/profile.class.php:50
30 | msgid "CMDB"
31 | msgstr "CMDB"
32 |
33 | #: front/ci.form.php:66
34 | msgid "You can't delete this item, because this item is used on CMDB !"
35 | msgstr "Bu öge CMD üzerinde kullanıldığından silinemez!"
36 |
37 | #: inc/ci.class.php:49
38 | msgid "Configuration Item"
39 | msgid_plural "Configuration Items"
40 | msgstr[0] "Yapılandırma Ögesi"
41 | msgstr[1] "Yapılandırma Ögeleri"
42 |
43 | #: inc/ci.class.php:199
44 | msgid "Invalid name !"
45 | msgstr "Ad geçersiz!"
46 |
47 | #: inc/ci_cmdb.class.php:74
48 | msgid "See CI"
49 | msgstr "CI bak"
50 |
51 | #: inc/ci_cmdb.class.php:75
52 | msgid "Create Link"
53 | msgstr "Bağlantı Ekle"
54 |
55 | #: inc/ci_cmdb.class.php:76
56 | msgid "Update Link"
57 | msgstr "Bağlantıyı Güncelle"
58 |
59 | #: inc/ci_cmdb.class.php:77
60 | msgid "Delete Link"
61 | msgstr "Bağlantıyı Sil"
62 |
63 | #: inc/ci_cmdb.class.php:78
64 | msgid "Zoom in"
65 | msgstr "Yakınlaştır"
66 |
67 | #: inc/ci_cmdb.class.php:79
68 | msgid "Zoom out"
69 | msgstr "Uzaklaştır"
70 |
71 | #: inc/ci_cmdb.class.php:80
72 | msgid "Reset Zoom"
73 | msgstr "Yakınlaştırmayı Sıfırla"
74 |
75 | #: inc/ci_cmdb.class.php:81
76 | msgid "Export PNG"
77 | msgstr "PNG Olarak Dışa Aktar"
78 |
79 | #: inc/ci_cmdb.class.php:82
80 | msgid "See associated tickets"
81 | msgstr "İlgili destek kayıtlarını görüntüle"
82 |
83 | #: inc/ci_cmdb.class.php:83
84 | msgid "Purge CMDB"
85 | msgstr "CMDB Boşalt"
86 |
87 | #: inc/ci_cmdb.class.php:84
88 | msgid "Create baseline"
89 | msgstr "Temel çizgisi oluştur"
90 |
91 | #: inc/ci_cmdb.class.php:204
92 | msgid "Preferences"
93 | msgstr "Ayarlar"
94 |
95 | #: inc/ci_cmdb.class.php:210
96 | msgid "View links"
97 | msgstr "Bağlantıları görüntüle"
98 |
99 | #: inc/ci_cmdb.class.php:222
100 | msgid "Refresh"
101 | msgstr "Yenile"
102 |
103 | #: inc/ci_cmdb.class.php:225
104 | msgid "Save positions"
105 | msgstr "Konumları kaydet"
106 |
107 | #: inc/ci_cmdb.class.php:250
108 | msgid "Add new type of CI to the CMDB"
109 | msgstr "CMDB üzerine yeni bir CI türü ekle"
110 |
111 | #: inc/ci_cmdb.class.php:255
112 | msgid "Add new type of link to the CMDB"
113 | msgstr "CMDB üzerine yeni bir bağlantı türü ekle"
114 |
115 | #: inc/ci_cmdb.class.php:261
116 | msgid "Manage type of CI to the CMDB"
117 | msgstr "CMDB CI türleri yönetimi"
118 |
119 | #: inc/ci_cmdb.class.php:266
120 | msgid "Manage type of links to the CMDB"
121 | msgstr "CMDB bağlantı türleri yönetimi"
122 |
123 | #: inc/ci_cmdb.class.php:283 inc/ci_cmdb.class.php:290
124 | msgid "Existing links"
125 | msgstr "Var olan bağlantılar"
126 |
127 | #: inc/ci_cmdb.class.php:307
128 | msgid "Linked element"
129 | msgstr "Bağlantılı bileşen"
130 |
131 | #: inc/ci_cmdb.class.php:425
132 | msgid "CMDB depth"
133 | msgstr "CMDB derinliği"
134 |
135 | #: inc/citype.class.php:53
136 | msgid "String"
137 | msgstr "Dizge"
138 |
139 | #: inc/citype.class.php:54
140 | msgid "Area Text"
141 | msgstr "Metin Alanı"
142 |
143 | #: inc/citype.class.php:57
144 | msgid "Yes/No"
145 | msgstr "Evet/Hayır"
146 |
147 | #: inc/citype.class.php:66
148 | msgid "Type CI"
149 | msgid_plural "Types CIs"
150 | msgstr[0] "CI Türü"
151 | msgstr[1] "CI Türleri"
152 |
153 | #: inc/citype.class.php:178
154 | msgid "is already present in GLPI"
155 | msgstr "zaten GLPI üzerinde var"
156 |
157 | #: inc/citype.class.php:305
158 | msgid "Is this item presents in glpi ?"
159 | msgstr "Bu öge GLPI üzerinde var mı?"
160 |
161 | #: inc/citype.class.php:315
162 | msgid "Be careful the name cannot be changed after creation"
163 | msgstr "Ad oluşturulduktan sonra değiştirilemeyeceğinden dikkatli olun"
164 |
165 | #: inc/citype.class.php:317
166 | msgid "Do not use a plural classname (like 'myobjects')"
167 | msgstr "Sınıf adında çoğul kullanmayın ('nesnelerim' gibi)"
168 |
169 | #: inc/citype.class.php:319
170 | msgid "Do not use a classname with spaces (like 'my objects')"
171 | msgstr "Sınıf adında boşluk kullanmayın ('bu nesne' gibi)"
172 |
173 | #: inc/citype.class.php:385
174 | msgid "Please, choose an imported CI !"
175 | msgstr "Lütfen içe aktarılmış bir CI seçin!"
176 |
177 | #: inc/citype.class.php:390
178 | msgid "There is already an existing name or the name is invalid"
179 | msgstr "Bu ad zaten var ya da geçersiz"
180 |
181 | #: inc/citype.class.php:578
182 | msgid "Import CI"
183 | msgstr "CI İçe Aktar"
184 |
185 | #: inc/citype.class.php:618
186 | msgid "Icon"
187 | msgstr "Simge"
188 |
189 | #: inc/citype.class.php:657
190 | msgid "Default icon"
191 | msgstr "Varsayılan simge"
192 |
193 | #: inc/citype.class.php:940
194 | msgid "Add New Field"
195 | msgstr "Alan Ekle"
196 |
197 | #: inc/citype.class.php:964
198 | msgid "Upload icon"
199 | msgstr "Yükleme simgesi"
200 |
201 | #: inc/citype.class.php:990
202 | msgid "Existing fields for this type of CI"
203 | msgstr "I türü için var olan alanlar"
204 |
205 | #: inc/citype.class.php:994
206 | msgid "Reset Existing fields"
207 | msgstr "Var olan alanları sıfırla"
208 |
209 | #. TRANS: Default document to files attached to tickets : %d is the ticket id
210 | #: inc/citype.class.php:1076
211 | #, php-format
212 | msgid "Icon CIType %d"
213 | msgstr "%d CI Türü Simgesi "
214 |
215 | #: inc/citype.class.php:1320 inc/citype.class.php:1335
216 | msgctxt "button"
217 | msgid "Transfer"
218 | msgstr "Aktarım"
219 |
220 | #: inc/cmdb.class.php:88
221 | msgid "Display Item Configuration"
222 | msgstr "Öge Yapılandırmasını Görüntüle"
223 |
224 | #: inc/cmdb.class.php:173 inc/cmdb.class.php:176
225 | msgid "No Types of CI found. Please create Types of CI before display CIs"
226 | msgstr ""
227 | "Herhangi bir CI türü bulunamadı. Lütfen CI görüntülemeden önce CU türlerini "
228 | "ekleyin"
229 |
230 | #: inc/cmdb_ticket.class.php:94
231 | msgid "Elements linked to the ticket aren't imported in CMDB"
232 | msgstr "Destek kaydı ile ilişkili bileşenler CMDB içine aktarılmamış"
233 |
234 | #: inc/cmdb_ticket.class.php:99
235 | msgid "No elements of CMDB linked to the ticket"
236 | msgstr "Destek kaydı ile ilişkili bir CMDB bileşeni yok"
237 |
238 | #: inc/cmdb_ticket.class.php:113 inc/cmdb_ticket.class.php:151
239 | msgid "Impacted items"
240 | msgstr "Etkilenen ögeler"
241 |
242 | #: inc/cmdb_ticket.class.php:152
243 | msgid "Proximity"
244 | msgstr "Yakınlık"
245 |
246 | #: inc/cmdb_ticket.class.php:194
247 | msgid "Direct impact"
248 | msgstr "Doğrudan etki"
249 |
250 | #: inc/criticity.class.php:51 inc/criticity.class.php:118
251 | #: inc/criticity_item.class.php:49
252 | msgid "Criticity"
253 | msgid_plural "Criticities"
254 | msgstr[0] "Kritiklik"
255 | msgstr[1] "Kritiklikler"
256 |
257 | #: inc/criticity.class.php:137
258 | msgid "All levels have already been added"
259 | msgstr "Tüm düzeyler zaten eklenmiş"
260 |
261 | #: inc/criticity.class.php:187
262 | msgid "Please choose a level for criticality"
263 | msgstr "Lütfen bir kritiklik düzeyi seçin"
264 |
265 | #: inc/menu.class.php:64
266 | msgid "Configure Type of Item Configuration"
267 | msgstr "Öge Yapılandırması Türünü Yapılandırın"
268 |
269 | #: inc/menu.class.php:66 inc/profile.class.php:109
270 | msgid "Item Configuration"
271 | msgstr "Öge Yapılandırması"
272 |
273 | #: inc/operationprocess.class.php:51 inc/operationprocessmenu.class.php:49
274 | #: inc/profile.class.php:117 inc/profile.class.php:149
275 | #: inc/profile.class.php:187
276 | msgid "Service"
277 | msgid_plural "Services"
278 | msgstr[0] "Hizmet"
279 | msgstr[1] "Hizmetler"
280 |
281 | #: inc/operationprocess_item.class.php:87
282 | #: inc/operationprocess_item.class.php:89
283 | msgid "Attached service"
284 | msgid_plural "Attached services"
285 | msgstr[0] "Bağlantılı hizmet"
286 | msgstr[1] "Bağlantılı hizmetler"
287 |
288 | #: inc/operationprocess_item.class.php:483
289 | msgctxt "button"
290 | msgid "Associate a service"
291 | msgstr "Bir hizmete bağla"
292 |
293 | #: inc/operationprocessstate.class.php:50
294 | msgid "State of service"
295 | msgid_plural "States of service"
296 | msgstr[0] "Hizmet durumu"
297 | msgstr[1] "Hizmet durumları"
298 |
299 | #: inc/profile.class.php:113 inc/profile.class.php:172
300 | msgid "Type of item configuration"
301 | msgid_plural "Types of item configuration"
302 | msgstr[0] "Öge yapılandırması türü"
303 | msgstr[1] "Öge yapılandırması türleri"
304 |
305 | #: inc/profile.class.php:160 inc/profile.class.php:191
306 | msgid "Item configuration"
307 | msgid_plural "Items configuration"
308 | msgstr[0] "Öge yapılandırması"
309 | msgstr[1] "Öge yapılandırmaları"
310 |
311 | #: inc/profile.class.php:195
312 | msgid "Type of Item Configuration"
313 | msgid_plural "Types of item configuration"
314 | msgstr[0] "Öge yapılandırması türü"
315 | msgstr[1] "Öge yapılandırması türleri"
316 |
317 | #: install/update_110_111.php:86
318 | msgid "very low"
319 | msgstr "çok düşük"
320 |
321 | #: install/update_110_111.php:87
322 | msgid "low"
323 | msgstr "düşük"
324 |
325 | #: install/update_110_111.php:88
326 | msgid "medium"
327 | msgstr "orta"
328 |
329 | #: install/update_110_111.php:89
330 | msgid "high"
331 | msgstr "yüksek"
332 |
333 | #: install/update_110_111.php:90
334 | msgid "very high"
335 | msgstr "çok yüksek"
336 |
--------------------------------------------------------------------------------
/locales/es_AR.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR CMDB Development Team
3 | # This file is distributed under the same license as the GLPI - CMDB plugin package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | # Translators:
7 | # Xavier CAILLAUD , 2021
8 | #
9 | #, fuzzy
10 | msgid ""
11 | msgstr ""
12 | "Project-Id-Version: GLPI - CMDB plugin\n"
13 | "Report-Msgid-Bugs-To: \n"
14 | "POT-Creation-Date: 2021-04-06 16:16+0000\n"
15 | "PO-Revision-Date: 2020-11-02 15:46+0000\n"
16 | "Last-Translator: Xavier CAILLAUD , 2021\n"
17 | "Language-Team: Spanish (Argentina) (https://www.transifex.com/infotelGLPI/teams/124557/es_AR/)\n"
18 | "MIME-Version: 1.0\n"
19 | "Content-Type: text/plain; charset=UTF-8\n"
20 | "Content-Transfer-Encoding: 8bit\n"
21 | "Language: es_AR\n"
22 | "Plural-Forms: nplurals=2; plural=(n != 1);\n"
23 |
24 | #: hook.php:326 inc/ci_cmdb.class.php:337 inc/ci_cmdb.class.php:352
25 | msgid "item not found or disabled"
26 | msgstr "artículo no encontrado o inhabilitado"
27 |
28 | #: setup.php:139 inc/ci_cmdb.class.php:49 inc/cmdb.class.php:47
29 | #: inc/menu.class.php:47 inc/profile.class.php:50
30 | msgid "CMDB"
31 | msgstr "CMDB"
32 |
33 | #: front/ci.form.php:66
34 | msgid "You can't delete this item, because this item is used on CMDB !"
35 | msgstr ""
36 | "¡No puede eliminar este elemento, porque este elemento se usa en CMDB!"
37 |
38 | #: inc/ci.class.php:49
39 | msgid "Configuration Item"
40 | msgid_plural "Configuration Items"
41 | msgstr[0] "Configuración de Elemento"
42 | msgstr[1] "Configuración de Elementos"
43 |
44 | #: inc/ci.class.php:199
45 | msgid "Invalid name !"
46 | msgstr "Nombre inválido !"
47 |
48 | #: inc/ci_cmdb.class.php:74
49 | msgid "See CI"
50 | msgstr "Ver CI"
51 |
52 | #: inc/ci_cmdb.class.php:75
53 | msgid "Create Link"
54 | msgstr "Crear enlace"
55 |
56 | #: inc/ci_cmdb.class.php:76
57 | msgid "Update Link"
58 | msgstr "Actualizar Enlace"
59 |
60 | #: inc/ci_cmdb.class.php:77
61 | msgid "Delete Link"
62 | msgstr "Borrar enlace"
63 |
64 | #: inc/ci_cmdb.class.php:78
65 | msgid "Zoom in"
66 | msgstr "Zoom +"
67 |
68 | #: inc/ci_cmdb.class.php:79
69 | msgid "Zoom out"
70 | msgstr "Zoom -"
71 |
72 | #: inc/ci_cmdb.class.php:80
73 | msgid "Reset Zoom"
74 | msgstr "Restablecer zoom"
75 |
76 | #: inc/ci_cmdb.class.php:81
77 | msgid "Export PNG"
78 | msgstr "Exportar PNG"
79 |
80 | #: inc/ci_cmdb.class.php:82
81 | msgid "See associated tickets"
82 | msgstr "Ver tickets asociados"
83 |
84 | #: inc/ci_cmdb.class.php:83
85 | msgid "Purge CMDB"
86 | msgstr "Purgar CMDB"
87 |
88 | #: inc/ci_cmdb.class.php:84
89 | msgid "Create baseline"
90 | msgstr "Crear baseline"
91 |
92 | #: inc/ci_cmdb.class.php:204
93 | msgid "Preferences"
94 | msgstr "Preferencias"
95 |
96 | #: inc/ci_cmdb.class.php:210
97 | msgid "View links"
98 | msgstr "Ver enlaces"
99 |
100 | #: inc/ci_cmdb.class.php:222
101 | msgid "Refresh"
102 | msgstr "Actualizar"
103 |
104 | #: inc/ci_cmdb.class.php:225
105 | msgid "Save positions"
106 | msgstr "Guardar posiciones"
107 |
108 | #: inc/ci_cmdb.class.php:250
109 | msgid "Add new type of CI to the CMDB"
110 | msgstr "Agregue un nuevo tipo de CI a la CMDB"
111 |
112 | #: inc/ci_cmdb.class.php:255
113 | msgid "Add new type of link to the CMDB"
114 | msgstr "Agregar un nuevo tipo de enlace a la CMDB"
115 |
116 | #: inc/ci_cmdb.class.php:261
117 | msgid "Manage type of CI to the CMDB"
118 | msgstr "Administrar el tipo de CI en la CMDB"
119 |
120 | #: inc/ci_cmdb.class.php:266
121 | msgid "Manage type of links to the CMDB"
122 | msgstr "Administrar tipo de enlaces a la CMDB"
123 |
124 | #: inc/ci_cmdb.class.php:283 inc/ci_cmdb.class.php:290
125 | msgid "Existing links"
126 | msgstr "Enlaces existentes"
127 |
128 | #: inc/ci_cmdb.class.php:307
129 | msgid "Linked element"
130 | msgstr "Elemento vinculado"
131 |
132 | #: inc/ci_cmdb.class.php:425
133 | msgid "CMDB depth"
134 | msgstr "Profundidad de CMDB"
135 |
136 | #: inc/citype.class.php:53
137 | msgid "String"
138 | msgstr "String"
139 |
140 | #: inc/citype.class.php:54
141 | msgid "Area Text"
142 | msgstr "Texto de área"
143 |
144 | #: inc/citype.class.php:57
145 | msgid "Yes/No"
146 | msgstr "Sí/No"
147 |
148 | #: inc/citype.class.php:66
149 | msgid "Type CI"
150 | msgid_plural "Types CIs"
151 | msgstr[0] "Tipo CI"
152 | msgstr[1] "Tipos CI"
153 |
154 | #: inc/citype.class.php:178
155 | msgid "is already present in GLPI"
156 | msgstr "ya está presente en GLPI"
157 |
158 | #: inc/citype.class.php:305
159 | msgid "Is this item presents in glpi ?"
160 | msgstr "¿Este artículo se presenta en glpi?"
161 |
162 | #: inc/citype.class.php:315
163 | msgid "Be careful the name cannot be changed after creation"
164 | msgstr "Tenga cuidado el nombre no se puede cambiar después de la creación"
165 |
166 | #: inc/citype.class.php:317
167 | msgid "Do not use a plural classname (like 'myobjects')"
168 | msgstr "No use un nombre de clase en plural (como 'myobjects')"
169 |
170 | #: inc/citype.class.php:319
171 | msgid "Do not use a classname with spaces (like 'my objects')"
172 | msgstr "No use un nombre de clase con espacios (como 'mis objetos')"
173 |
174 | #: inc/citype.class.php:385
175 | msgid "Please, choose an imported CI !"
176 | msgstr "Por favor, elija un CI importado!"
177 |
178 | #: inc/citype.class.php:390
179 | msgid "There is already an existing name or the name is invalid"
180 | msgstr "Ya existe un nombre o el nombre no es válido"
181 |
182 | #: inc/citype.class.php:578
183 | msgid "Import CI"
184 | msgstr "Importar CI"
185 |
186 | #: inc/citype.class.php:618
187 | msgid "Icon"
188 | msgstr "icono"
189 |
190 | #: inc/citype.class.php:657
191 | msgid "Default icon"
192 | msgstr "Icono predeterminado"
193 |
194 | #: inc/citype.class.php:940
195 | msgid "Add New Field"
196 | msgstr "Agregar nuevo campo"
197 |
198 | #: inc/citype.class.php:964
199 | msgid "Upload icon"
200 | msgstr "Subir icono"
201 |
202 | #: inc/citype.class.php:990
203 | msgid "Existing fields for this type of CI"
204 | msgstr "Campos existentes para este tipo de CI"
205 |
206 | #: inc/citype.class.php:994
207 | msgid "Reset Existing fields"
208 | msgstr "Restablecer campos existentes"
209 |
210 | #. TRANS: Default document to files attached to tickets : %d is the ticket id
211 | #: inc/citype.class.php:1076
212 | #, php-format
213 | msgid "Icon CIType %d"
214 | msgstr "Icono CITipo %d"
215 |
216 | #: inc/citype.class.php:1320 inc/citype.class.php:1335
217 | msgctxt "button"
218 | msgid "Transfer"
219 | msgstr "Transferir"
220 |
221 | #: inc/cmdb.class.php:88
222 | msgid "Display Item Configuration"
223 | msgstr "Mostrar configuración del elemento"
224 |
225 | #: inc/cmdb.class.php:173 inc/cmdb.class.php:176
226 | msgid "No Types of CI found. Please create Types of CI before display CIs"
227 | msgstr ""
228 | "No se encontraron tipos de CI. Cree tipos de CI antes de mostrar los CI"
229 |
230 | #: inc/cmdb_ticket.class.php:94
231 | msgid "Elements linked to the ticket aren't imported in CMDB"
232 | msgstr "Los elementos vinculados al ticket no se importaron en CMDB"
233 |
234 | #: inc/cmdb_ticket.class.php:99
235 | msgid "No elements of CMDB linked to the ticket"
236 | msgstr "No hay elementos de CMDB vinculados al ticket"
237 |
238 | #: inc/cmdb_ticket.class.php:113 inc/cmdb_ticket.class.php:151
239 | msgid "Impacted items"
240 | msgstr "Elementos afectados"
241 |
242 | #: inc/cmdb_ticket.class.php:152
243 | msgid "Proximity"
244 | msgstr "Proximidad"
245 |
246 | #: inc/cmdb_ticket.class.php:194
247 | msgid "Direct impact"
248 | msgstr "Impacto directo"
249 |
250 | #: inc/criticity.class.php:51 inc/criticity.class.php:118
251 | #: inc/criticity_item.class.php:49
252 | msgid "Criticity"
253 | msgid_plural "Criticities"
254 | msgstr[0] "Criticidad"
255 | msgstr[1] "Criticidad"
256 |
257 | #: inc/criticity.class.php:137
258 | msgid "All levels have already been added"
259 | msgstr "Ya se han agregado todos los niveles"
260 |
261 | #: inc/criticity.class.php:187
262 | msgid "Please choose a level for criticality"
263 | msgstr "Elija un nivel de criticidad"
264 |
265 | #: inc/menu.class.php:64
266 | msgid "Configure Type of Item Configuration"
267 | msgstr "Configurar la configuración del tipo de elemento"
268 |
269 | #: inc/menu.class.php:66 inc/profile.class.php:109
270 | msgid "Item Configuration"
271 | msgstr "Configuración del elmento"
272 |
273 | #: inc/operationprocess.class.php:51 inc/operationprocessmenu.class.php:49
274 | #: inc/profile.class.php:117 inc/profile.class.php:149
275 | #: inc/profile.class.php:187
276 | msgid "Service"
277 | msgid_plural "Services"
278 | msgstr[0] "Servicio"
279 | msgstr[1] "Servicios"
280 |
281 | #: inc/operationprocess_item.class.php:87
282 | #: inc/operationprocess_item.class.php:89
283 | msgid "Attached service"
284 | msgid_plural "Attached services"
285 | msgstr[0] "Servicio adjunto"
286 | msgstr[1] "Servicios adjuntos"
287 |
288 | #: inc/operationprocess_item.class.php:483
289 | msgctxt "button"
290 | msgid "Associate a service"
291 | msgstr "Asociar un servicio"
292 |
293 | #: inc/operationprocessstate.class.php:50
294 | msgid "State of service"
295 | msgid_plural "States of service"
296 | msgstr[0] "Estado del servicio"
297 | msgstr[1] "Estados de los servicios"
298 |
299 | #: inc/profile.class.php:113 inc/profile.class.php:172
300 | msgid "Type of item configuration"
301 | msgid_plural "Types of item configuration"
302 | msgstr[0] "Tipo de configuración del elemento"
303 | msgstr[1] "Tipos de configuración de elementos"
304 |
305 | #: inc/profile.class.php:160 inc/profile.class.php:191
306 | msgid "Item configuration"
307 | msgid_plural "Items configuration"
308 | msgstr[0] "Configuración del elemento"
309 | msgstr[1] "Configuraciones de elementos"
310 |
311 | #: inc/profile.class.php:195
312 | msgid "Type of Item Configuration"
313 | msgid_plural "Types of item configuration"
314 | msgstr[0] "Tipo de configuración de artículo"
315 | msgstr[1] "Tipos de configuración de artículos"
316 |
317 | #: install/update_110_111.php:86
318 | msgid "very low"
319 | msgstr "muy baja"
320 |
321 | #: install/update_110_111.php:87
322 | msgid "low"
323 | msgstr "baja"
324 |
325 | #: install/update_110_111.php:88
326 | msgid "medium"
327 | msgstr "medio"
328 |
329 | #: install/update_110_111.php:89
330 | msgid "high"
331 | msgstr "alto"
332 |
333 | #: install/update_110_111.php:90
334 | msgid "very high"
335 | msgstr "muy alto"
336 |
--------------------------------------------------------------------------------