├── databases.png ├── locales ├── cs_CZ.mo ├── en_GB.mo ├── es_AR.mo ├── es_ES.mo ├── fi_FI.mo ├── fr_FR.mo ├── pl_PL.mo ├── pt_BR.mo ├── pt_PT.mo ├── ro_RO.mo ├── tr_TR.mo ├── uk_UA.mo ├── zh_CN.mo ├── zh_CN.po ├── glpi.pot ├── en_GB.po ├── tr_TR.po ├── fi_FI.po ├── es_AR.po ├── es_ES.po ├── fr_FR.po ├── pt_PT.po ├── pt_BR.po ├── ro_RO.po ├── cs_CZ.po ├── pl_PL.po └── uk_UA.po ├── sql ├── update-1.2.1.sql ├── update-1.5.0.sql ├── update-2.2.2.sql ├── update-1.2.0.sql ├── update-1.1.sql ├── empty-1.0.sql ├── empty-1.1.sql ├── empty-1.2.0.sql ├── empty-1.2.1.sql ├── update-1.3.0.sql ├── empty-2.1.0.sql ├── empty-2.2.2.sql ├── empty-2.3.2.sql ├── empty-1.7.0.sql ├── empty-1.3.0.sql └── empty-1.5.0.sql ├── tools ├── extract_template.sh ├── update_mo.pl └── update_po.pl ├── ISSUE_TEMPLATE.md ├── .github └── workflows │ ├── updatepot.yml │ ├── generatemo.yml │ └── release.yml ├── README.md ├── front ├── scripttype.php ├── servertype.php ├── databasetype.php ├── databasecategory.php ├── scripttype.form.php ├── servertype.form.php ├── databasetype.form.php ├── databasecategory.form.php ├── database.php ├── script.form.php ├── instance.form.php └── database.form.php ├── inc ├── servertype.class.php ├── scripttype.class.php ├── databasecategory.class.php ├── menu.class.php ├── databasetype.class.php ├── databaseinjection.class.php ├── profile.class.php ├── instance.class.php └── script.class.php ├── ajax └── dropdownTypeDatabases.php ├── setup.php └── databases.xml /databases.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/databases/master/databases.png -------------------------------------------------------------------------------- /locales/cs_CZ.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/databases/master/locales/cs_CZ.mo -------------------------------------------------------------------------------- /locales/en_GB.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/databases/master/locales/en_GB.mo -------------------------------------------------------------------------------- /locales/es_AR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/databases/master/locales/es_AR.mo -------------------------------------------------------------------------------- /locales/es_ES.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/databases/master/locales/es_ES.mo -------------------------------------------------------------------------------- /locales/fi_FI.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/databases/master/locales/fi_FI.mo -------------------------------------------------------------------------------- /locales/fr_FR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/databases/master/locales/fr_FR.mo -------------------------------------------------------------------------------- /locales/pl_PL.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/databases/master/locales/pl_PL.mo -------------------------------------------------------------------------------- /locales/pt_BR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/databases/master/locales/pt_BR.mo -------------------------------------------------------------------------------- /locales/pt_PT.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/databases/master/locales/pt_PT.mo -------------------------------------------------------------------------------- /locales/ro_RO.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/databases/master/locales/ro_RO.mo -------------------------------------------------------------------------------- /locales/tr_TR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/databases/master/locales/tr_TR.mo -------------------------------------------------------------------------------- /locales/uk_UA.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/databases/master/locales/uk_UA.mo -------------------------------------------------------------------------------- /locales/zh_CN.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/databases/master/locales/zh_CN.mo -------------------------------------------------------------------------------- /sql/update-1.2.1.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `glpi_plugin_sgbd` 2 | ADD `helpdesk_visible` INT(11) NOT NULL DEFAULT '1', 3 | ADD `date_mod` DATETIME DEFAULT NULL; -------------------------------------------------------------------------------- /sql/update-1.5.0.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `glpi_plugin_databases_databases` 2 | CHANGE `groups_id` `groups_id_tech` INT(11) NOT NULL DEFAULT '0', 3 | CHANGE `users_id` `users_id_tech` INT(11) NOT NULL DEFAULT '0'; -------------------------------------------------------------------------------- /sql/update-2.2.2.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `glpi_plugin_databases_databases` 2 | CHANGE `groups_id_tech` `groups_id` INT(11) NOT NULL DEFAULT '0', 3 | CHANGE `users_id_tech` `users_id` INT(11) NOT NULL DEFAULT '0'; 4 | 5 | ALTER TABLE `glpi_plugin_databases_databases` ADD `link` VARCHAR(255) NOT NULL DEFAULT '' AFTER `comment`; -------------------------------------------------------------------------------- /tools/extract_template.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Only strings with domain specified are extracted (use Xt args of keyword param to set number of args needed) 4 | 5 | xgettext *.php */*.php --copyright-holder='Databases Development Team' --package-name='GLPI - Databases plugin' -o locales/glpi.pot -L PHP --add-comments=TRANS --from-code=UTF-8 --force-po \ 6 | --keyword=_n:1,2,4t --keyword=__s:1,2t --keyword=__:1,2t --keyword=_e:1,2t --keyword=_x:1c,2,3t \ 7 | --keyword=_ex:1c,2,3t --keyword=_nx:1c,2,3,5t --keyword=_sx:1c,2,3t 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Dear GLPi user. 2 | 3 | BEFORE SUBMITTING YOUR ISSUE, please make sure to read and follow these steps : 4 | 5 | * Verify that your question has not already been asked 6 | * Please use the below template. 7 | * Delete this text before submiting your issue. 8 | 9 | The Plugin team. 10 | 11 | ------------ 12 | * Version of the plugin : 13 | 14 | 15 | * Version of your GLPI : 16 | 17 | 18 | * Steps to reproduce (which actions have you made) : 19 | 20 | 21 | * Expected result : 22 | 23 | 24 | * Actual result : 25 | 26 | 27 | * URL of the page : 28 | 29 | 30 | * Screenshot of the problem (if pertinent) : 31 | 32 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.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@v2 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 | 27 | - name: Commit changes 28 | uses: EndBug/add-and-commit@v5.1.0 29 | with: 30 | message: "Update POT" 31 | - name: Push changes 32 | 33 | uses: actions-go/push@v1 34 | 35 | -------------------------------------------------------------------------------- /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_databases/resource/glpi/translation/$lang/?file=$_`; 22 | } 23 | } 24 | 25 | } 26 | } 27 | closedir DIRHANDLE; 28 | 29 | # 30 | # 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # databases 2 | Plugin databases pour GLPI 3 | 4 | Attention 5 | Ce plugin est intégré dans GLPI 10. Un script de migration existe : 6 | ``php bin/console glpi:migration:databases_plugin_to_core`` 7 | 8 | 9 | Ce plugin est sur Transifex - Aidez-nous à le traduire : 10 | https://www.transifex.com/infotelGLPI/GLPI_databases/ 11 | 12 | This plugin is on Transifex - Help us to translate : 13 | https://www.transifex.com/infotelGLPI/GLPI_databases/ 14 | 15 | Ce plugin vous permet de gérer les bases de données de votre réseau et de les associer à des éléments de l'inventaire. 16 | > * Inventaire des instances 17 | > * Inventaire des scripts. 18 | > * Utilisable depuis le helpdesk 19 | > * Peut être intégré au plugin "environment":https://github.com/InfotelGLPI/environment. 20 | 21 | This plugin enables you to manage the databases of your network and associate them with elements of the inventory. 22 | > * Instances inventory 23 | > * Scripts inventory. 24 | > * Can be used with helpdesk 25 | > * Can be used with "environment":https://github.com/InfotelGLPI/environment plugin 26 | -------------------------------------------------------------------------------- /.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@v2 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.7.2 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@v5.1.0 31 | with: 32 | 33 | message: "Generate mo" 34 | - name: Push changes 35 | 36 | uses: actions-go/push@v1 37 | 38 | -------------------------------------------------------------------------------- /sql/update-1.2.0.sql: -------------------------------------------------------------------------------- 1 | RENAME TABLE 2 | `glpi_dropdown_plugin_sgbd_type` TO `glpi_dropdown_plugin_sgbd_category`; 3 | 4 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_sgbd_type`; 5 | CREATE TABLE `glpi_dropdown_plugin_sgbd_type` ( 6 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 7 | `FK_entities` INT(11) NOT NULL DEFAULT '0', 8 | `name` VARCHAR(255) 9 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 10 | `comments` TEXT, 11 | PRIMARY KEY (`ID`), 12 | KEY `name` (`name`) 13 | ) 14 | ENGINE = MyISAM 15 | DEFAULT CHARSET = utf8 16 | COLLATE = utf8_unicode_ci; 17 | 18 | ALTER TABLE `glpi_plugin_sgbd_profiles` 19 | ADD `open_ticket` CHAR(1) DEFAULT NULL; 20 | 21 | ALTER TABLE `glpi_plugin_sgbd` 22 | CHANGE `type` `category` INT(4) NOT NULL DEFAULT '0'; 23 | ALTER TABLE `glpi_plugin_sgbd` 24 | ADD `type` INT(4) NOT NULL 25 | AFTER `category`; 26 | ALTER TABLE `glpi_plugin_sgbd` 27 | ADD `FK_users` INT(4) NOT NULL 28 | AFTER `type`; 29 | ALTER TABLE `glpi_plugin_sgbd` 30 | ADD `FK_groups` INT(11) NOT NULL 31 | AFTER `FK_users`; 32 | ALTER TABLE `glpi_plugin_sgbd_profiles` 33 | DROP COLUMN `interface`, 34 | DROP COLUMN `is_default`; -------------------------------------------------------------------------------- /front/scripttype.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | 32 | $dropdown = new PluginDatabasesScriptType(); 33 | include(GLPI_ROOT . "/front/dropdown.common.php"); 34 | -------------------------------------------------------------------------------- /front/servertype.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | 32 | $dropdown = new PluginDatabasesServerType(); 33 | include(GLPI_ROOT . "/front/dropdown.common.php"); 34 | -------------------------------------------------------------------------------- /front/databasetype.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | 32 | $dropdown = new PluginDatabasesDatabaseType(); 33 | include(GLPI_ROOT . "/front/dropdown.common.php"); 34 | -------------------------------------------------------------------------------- /front/databasecategory.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | 32 | $dropdown = new PluginDatabasesDatabaseCategory(); 33 | include(GLPI_ROOT . "/front/dropdown.common.php"); 34 | -------------------------------------------------------------------------------- /front/scripttype.form.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | 32 | $dropdown = new PluginDatabasesScriptType(); 33 | include(GLPI_ROOT . "/front/dropdown.common.form.php"); 34 | -------------------------------------------------------------------------------- /front/servertype.form.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | 32 | $dropdown = new PluginDatabasesServerType(); 33 | include(GLPI_ROOT . "/front/dropdown.common.form.php"); 34 | -------------------------------------------------------------------------------- /front/databasetype.form.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | 32 | $dropdown = new PluginDatabasesDatabaseType(); 33 | include(GLPI_ROOT . "/front/dropdown.common.form.php"); 34 | -------------------------------------------------------------------------------- /front/databasecategory.form.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | 32 | $dropdown = new PluginDatabasesDatabaseCategory(); 33 | include(GLPI_ROOT . "/front/dropdown.common.form.php"); 34 | -------------------------------------------------------------------------------- /inc/servertype.class.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | if (!defined('GLPI_ROOT')) { 31 | die("Sorry. You can't access directly to this file"); 32 | } 33 | 34 | /** 35 | * Class PluginDatabasesServerType 36 | */ 37 | class PluginDatabasesServerType extends CommonDropdown { 38 | 39 | static $rightname = "dropdown"; 40 | var $can_be_translated = true; 41 | 42 | /** 43 | * @param int $nb 44 | * 45 | * @return translated 46 | */ 47 | static function getTypeName($nb = 0) { 48 | return _n('Engine', 'Engines', $nb, 'databases'); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /inc/scripttype.class.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | if (!defined('GLPI_ROOT')) { 31 | die("Sorry. You can't access directly to this file"); 32 | } 33 | 34 | /** 35 | * Class PluginDatabasesScriptType 36 | */ 37 | class PluginDatabasesScriptType extends CommonDropdown { 38 | 39 | static $rightname = "dropdown"; 40 | var $can_be_translated = true; 41 | 42 | /** 43 | * @param int $nb 44 | * 45 | * @return translated 46 | */ 47 | static function getTypeName($nb = 0) { 48 | 49 | return _n('Type of script', 'Types of script', $nb, 'databases'); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /inc/databasecategory.class.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | if (!defined('GLPI_ROOT')) { 31 | die("Sorry. You can't access directly to this file"); 32 | } 33 | 34 | /** 35 | * Class PluginDatabasesDatabaseCategory 36 | */ 37 | class PluginDatabasesDatabaseCategory extends CommonDropdown { 38 | 39 | static $rightname = "dropdown"; 40 | var $can_be_translated = true; 41 | 42 | /** 43 | * @param int $nb 44 | * 45 | * @return translated 46 | */ 47 | static function getTypeName($nb = 0) { 48 | 49 | return _n('Category', 'Categories', $nb, 'databases'); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /front/database.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | 32 | 33 | $plugin = new Plugin(); 34 | if ($plugin->isActivated("environment")) { 35 | Html::header(PluginDatabasesDatabase::getTypeName(2), '', "assets", "pluginenvironmentdisplay", "databases"); 36 | } else { 37 | Html::header(PluginDatabasesDatabase::getTypeName(2), '', "assets", "plugindatabasesmenu"); 38 | } 39 | $database = new PluginDatabasesDatabase(); 40 | 41 | if ($database->canView() || Session::haveRight("config", UPDATE)) { 42 | Search::show('PluginDatabasesDatabase'); 43 | } else { 44 | Html::displayRightError(); 45 | } 46 | 47 | Html::footer(); 48 | -------------------------------------------------------------------------------- /sql/update-1.1.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `glpi_plugin_sgbd` 2 | ADD `recursive` TINYINT(1) NOT NULL DEFAULT '0' 3 | AFTER `FK_entities`; 4 | 5 | DROP TABLE IF EXISTS `glpi_plugin_sgbd_instances`; 6 | CREATE TABLE `glpi_plugin_sgbd_instances` ( 7 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 8 | `FK_sgbd` INT(11) NOT NULL DEFAULT '0', 9 | `name` VARCHAR(255) 10 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 11 | `port` INT(11) NOT NULL DEFAULT '0', 12 | `path` VARCHAR(255) 13 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 14 | PRIMARY KEY (`ID`) 15 | ) 16 | ENGINE = MyISAM 17 | DEFAULT CHARSET = utf8 18 | COLLATE = utf8_unicode_ci; 19 | 20 | DROP TABLE IF EXISTS `glpi_plugin_sgbd_scripts`; 21 | CREATE TABLE `glpi_plugin_sgbd_scripts` ( 22 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 23 | `FK_sgbd` INT(11) NOT NULL DEFAULT '0', 24 | `name` VARCHAR(255) 25 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 26 | `path` VARCHAR(255) 27 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 28 | `type` INT(11) NOT NULL DEFAULT '0', 29 | PRIMARY KEY (`ID`) 30 | ) 31 | ENGINE = MyISAM 32 | DEFAULT CHARSET = utf8 33 | COLLATE = utf8_unicode_ci; 34 | 35 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_sgbd_script_type`; 36 | CREATE TABLE `glpi_dropdown_plugin_sgbd_script_type` ( 37 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 38 | `name` VARCHAR(255) 39 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 40 | `comments` TEXT, 41 | PRIMARY KEY (`ID`), 42 | KEY `name` (`name`) 43 | ) 44 | ENGINE = MyISAM 45 | DEFAULT CHARSET = utf8 46 | COLLATE = utf8_unicode_ci; 47 | 48 | ALTER TABLE `glpi_plugin_sgbd_device` 49 | DROP INDEX `FK_compte`, 50 | ADD UNIQUE `FK_sgbd` (`FK_sgbd`, `FK_device`, `device_type`); -------------------------------------------------------------------------------- /locales/zh_CN.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Databases Development Team 3 | # This file is distributed under the same license as the GLPI - Databases plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # 孔南, 2022 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Databases plugin\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2021-09-22 09:50+0000\n" 15 | "PO-Revision-Date: 2020-11-02 16:00+0000\n" 16 | "Last-Translator: 孔南, 2022\n" 17 | "Language-Team: Chinese (China) (https://www.transifex.com/infotelGLPI/teams/12357/zh_CN/)\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Language: zh_CN\n" 22 | "Plural-Forms: nplurals=1; plural=0;\n" 23 | 24 | #: hook.php:611 25 | msgid "Associate to the database" 26 | msgstr "关联到数据库" 27 | 28 | #: setup.php:102 inc/database.class.php:52 inc/menu.class.php:41 29 | #: inc/profile.class.php:175 30 | msgid "Database" 31 | msgid_plural "Databases" 32 | msgstr[0] "数据库" 33 | 34 | #: inc/database.class.php:160 inc/database.class.php:381 35 | #: inc/database_item.class.php:541 36 | msgid "Editor" 37 | msgstr "编辑器" 38 | 39 | #: inc/database.class.php:596 40 | msgid "Database associated" 41 | msgid_plural "Databases associated" 42 | msgstr[0] "已关联数据库" 43 | 44 | #: inc/database_item.class.php:511 45 | msgctxt "button" 46 | msgid "Associate a database" 47 | msgstr "关联一个数据库" 48 | 49 | #: inc/databasecategory.class.php:49 50 | msgid "Category" 51 | msgid_plural "Categories" 52 | msgstr[0] "类别" 53 | 54 | #: inc/instance.class.php:52 55 | msgid "Instance" 56 | msgid_plural "Instances" 57 | msgstr[0] "实例" 58 | 59 | #: inc/instance.class.php:177 inc/instance.class.php:266 60 | #: inc/script.class.php:172 inc/script.class.php:263 61 | msgid "Path" 62 | msgstr "路径" 63 | 64 | #: inc/script.class.php:52 65 | msgid "Script" 66 | msgid_plural "Scripts" 67 | msgstr[0] "脚本" 68 | 69 | #: inc/scripttype.class.php:49 70 | msgid "Type of script" 71 | msgid_plural "Types of script" 72 | msgstr[0] "脚本类型" 73 | 74 | #: inc/servertype.class.php:48 75 | msgid "Engine" 76 | msgid_plural "Engines" 77 | msgstr[0] "引擎" 78 | -------------------------------------------------------------------------------- /locales/glpi.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Databases Development Team 3 | # This file is distributed under the same license as the GLPI - Databases plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: GLPI - Databases plugin\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2022-04-27 12:37+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 | #: hook.php:611 22 | msgid "Associate to the database" 23 | msgstr "" 24 | 25 | #: setup.php:102 inc/database.class.php:52 inc/menu.class.php:41 26 | #: inc/profile.class.php:175 27 | msgid "Database" 28 | msgid_plural "Databases" 29 | msgstr[0] "" 30 | msgstr[1] "" 31 | 32 | #: inc/database.class.php:160 inc/database.class.php:381 33 | #: inc/database_item.class.php:541 34 | msgid "Editor" 35 | msgstr "" 36 | 37 | #: inc/database.class.php:596 38 | msgid "Database associated" 39 | msgid_plural "Databases associated" 40 | msgstr[0] "" 41 | msgstr[1] "" 42 | 43 | #: inc/database_item.class.php:511 44 | msgctxt "button" 45 | msgid "Associate a database" 46 | msgstr "" 47 | 48 | #: inc/databasecategory.class.php:49 49 | msgid "Category" 50 | msgid_plural "Categories" 51 | msgstr[0] "" 52 | msgstr[1] "" 53 | 54 | #: inc/instance.class.php:52 55 | msgid "Instance" 56 | msgid_plural "Instances" 57 | msgstr[0] "" 58 | msgstr[1] "" 59 | 60 | #: inc/instance.class.php:177 inc/instance.class.php:266 61 | #: inc/script.class.php:172 inc/script.class.php:263 62 | msgid "Path" 63 | msgstr "" 64 | 65 | #: inc/script.class.php:52 66 | msgid "Script" 67 | msgid_plural "Scripts" 68 | msgstr[0] "" 69 | msgstr[1] "" 70 | 71 | #: inc/scripttype.class.php:49 72 | msgid "Type of script" 73 | msgid_plural "Types of script" 74 | msgstr[0] "" 75 | msgstr[1] "" 76 | 77 | #: inc/servertype.class.php:48 78 | msgid "Engine" 79 | msgid_plural "Engines" 80 | msgstr[0] "" 81 | msgstr[1] "" 82 | -------------------------------------------------------------------------------- /locales/en_GB.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Databases Development Team 3 | # This file is distributed under the same license as the GLPI - Databases plugin package. 4 | # 5 | # Translators: 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: GLPI Project - databases plugin\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2018-07-03 07:49+0200\n" 11 | "PO-Revision-Date: 2017-10-10 11:16+0000\n" 12 | "Last-Translator: Amandine Manceau\n" 13 | "Language-Team: English (United Kingdom) (http://www.transifex.com/tsmr/GLPI_databases/language/en_GB/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: en_GB\n" 18 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 19 | 20 | #: hook.php:599 21 | msgid "Associate to the database" 22 | msgstr "Associate to the database" 23 | 24 | #: setup.php:92 inc/database.class.php:52 inc/menu.class.php:41 25 | #: inc/profile.class.php:175 26 | msgid "Database" 27 | msgid_plural "Databases" 28 | msgstr[0] "Database" 29 | msgstr[1] "Databases" 30 | 31 | #: inc/databasecategory.class.php:49 32 | msgid "Category" 33 | msgid_plural "Categories" 34 | msgstr[0] "Category" 35 | msgstr[1] "Categories" 36 | 37 | #: inc/database.class.php:166 inc/database.class.php:377 38 | #: inc/database_item.class.php:537 39 | msgid "Editor" 40 | msgstr "Editor" 41 | 42 | #: inc/database.class.php:578 43 | msgid "Database associated" 44 | msgid_plural "Databases associated" 45 | msgstr[0] "Database associated" 46 | msgstr[1] "Databases associated" 47 | 48 | #: inc/database_item.class.php:508 49 | msgctxt "button" 50 | msgid "Associate a database" 51 | msgstr "Associate a database" 52 | 53 | #: inc/instance.class.php:52 54 | msgid "Instance" 55 | msgid_plural "Instances" 56 | msgstr[0] "Instance" 57 | msgstr[1] "Instances" 58 | 59 | #: inc/instance.class.php:177 inc/instance.class.php:266 60 | #: inc/script.class.php:172 inc/script.class.php:263 61 | msgid "Path" 62 | msgstr "Path" 63 | 64 | #: inc/script.class.php:52 65 | msgid "Script" 66 | msgid_plural "Scripts" 67 | msgstr[0] "Script" 68 | msgstr[1] "Scripts" 69 | 70 | #: inc/scripttype.class.php:49 71 | msgid "Type of script" 72 | msgid_plural "Types of script" 73 | msgstr[0] "Type of script" 74 | msgstr[1] "Types of script" 75 | 76 | #: inc/servertype.class.php:48 77 | msgid "Engine" 78 | msgid_plural "Engines" 79 | msgstr[0] "Engine" 80 | msgstr[1] "Engines" 81 | -------------------------------------------------------------------------------- /locales/tr_TR.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Databases Development Team 3 | # This file is distributed under the same license as the GLPI - Databases plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Databases plugin\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2020-11-02 17:39+0100\n" 15 | "PO-Revision-Date: 2020-11-02 16:00+0000\n" 16 | "Last-Translator: Xavier CAILLAUD , 2020\n" 17 | "Language-Team: Turkish (Turkey) (https://www.transifex.com/infotelGLPI/teams/12357/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:610 25 | msgid "Associate to the database" 26 | msgstr "Veritabanıyla ilişkilendirin" 27 | 28 | #: setup.php:99 inc/database.class.php:52 inc/menu.class.php:41 29 | #: inc/profile.class.php:175 30 | msgid "Database" 31 | msgid_plural "Databases" 32 | msgstr[0] "Veritabanı" 33 | msgstr[1] "Veritabanı" 34 | 35 | #: inc/database.class.php:160 inc/database.class.php:381 36 | #: inc/database_item.class.php:540 37 | msgid "Editor" 38 | msgstr "Düzenleyen" 39 | 40 | #: inc/database.class.php:596 41 | msgid "Database associated" 42 | msgid_plural "Databases associated" 43 | msgstr[0] "İlişkilendirilmiş veritabanı" 44 | msgstr[1] "İlişkilendirilmiş veritabanı" 45 | 46 | #: inc/database_item.class.php:511 47 | msgctxt "button" 48 | msgid "Associate a database" 49 | msgstr "Bir veritabanı ilişkilendirin" 50 | 51 | #: inc/databasecategory.class.php:49 52 | msgid "Category" 53 | msgid_plural "Categories" 54 | msgstr[0] "Kategori" 55 | msgstr[1] "Kategori" 56 | 57 | #: inc/instance.class.php:52 58 | msgid "Instance" 59 | msgid_plural "Instances" 60 | msgstr[0] "Kopya" 61 | msgstr[1] "Kopya" 62 | 63 | #: inc/instance.class.php:177 inc/instance.class.php:266 64 | #: inc/script.class.php:172 inc/script.class.php:263 65 | msgid "Path" 66 | msgstr "Yol" 67 | 68 | #: inc/script.class.php:52 69 | msgid "Script" 70 | msgid_plural "Scripts" 71 | msgstr[0] "Betik" 72 | msgstr[1] "Betik" 73 | 74 | #: inc/scripttype.class.php:49 75 | msgid "Type of script" 76 | msgid_plural "Types of script" 77 | msgstr[0] "Betik türü" 78 | msgstr[1] "Betik türü" 79 | 80 | #: inc/servertype.class.php:48 81 | msgid "Engine" 82 | msgid_plural "Engines" 83 | msgstr[0] "Motor" 84 | msgstr[1] "Motor" 85 | -------------------------------------------------------------------------------- /ajax/dropdownTypeDatabases.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | if (strpos($_SERVER['PHP_SELF'], "dropdownTypeDatabases.php")) { 31 | $AJAX_INCLUDE = 1; 32 | include('../../../inc/includes.php'); 33 | header("Content-Type: text/html; charset=UTF-8"); 34 | Html::header_nocache(); 35 | } 36 | 37 | Session::checkCentralAccess(); 38 | 39 | // Make a select box 40 | if (isset($_POST["databasetype"])) { 41 | $used = []; 42 | 43 | // Clean used array 44 | if (isset($_POST['used']) && is_array($_POST['used']) && (count($_POST['used']) > 0)) { 45 | $query = "SELECT `id` 46 | FROM `glpi_plugin_databases_databases` 47 | WHERE `id` IN (" . implode(',', $_POST['used']) . ") 48 | AND `plugin_databases_databasetypes_id` = '" . $_POST["databasetype"] . "'"; 49 | 50 | foreach ($DB->request($query) AS $data) { 51 | $used[$data['id']] = $data['id']; 52 | } 53 | } 54 | 55 | Dropdown::show('PluginDatabasesDatabase', 56 | ['name' => $_POST['myname'], 57 | 'used' => $used, 58 | 'width' => '50%', 59 | 'entity' => $_POST['entity'], 60 | 'rand' => $_POST['rand'], 61 | 'condition' => ["glpi_plugin_databases_databases.plugin_databases_databasetypes_id" => $_POST["databasetype"]]]); 62 | 63 | } 64 | -------------------------------------------------------------------------------- /locales/fi_FI.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Databases Development Team 3 | # This file is distributed under the same license as the GLPI - Databases plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Databases plugin\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2020-11-02 17:39+0100\n" 15 | "PO-Revision-Date: 2020-11-02 16:00+0000\n" 16 | "Last-Translator: Xavier CAILLAUD , 2020\n" 17 | "Language-Team: Finnish (Finland) (https://www.transifex.com/infotelGLPI/teams/12357/fi_FI/)\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Language: fi_FI\n" 22 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 23 | 24 | #: hook.php:610 25 | msgid "Associate to the database" 26 | msgstr "Liitä tietokantaan" 27 | 28 | #: setup.php:99 inc/database.class.php:52 inc/menu.class.php:41 29 | #: inc/profile.class.php:175 30 | msgid "Database" 31 | msgid_plural "Databases" 32 | msgstr[0] "Tietokanta" 33 | msgstr[1] "Tietokannat" 34 | 35 | #: inc/database.class.php:160 inc/database.class.php:381 36 | #: inc/database_item.class.php:540 37 | msgid "Editor" 38 | msgstr "Editori" 39 | 40 | #: inc/database.class.php:596 41 | msgid "Database associated" 42 | msgid_plural "Databases associated" 43 | msgstr[0] "Liitetty tietokanta" 44 | msgstr[1] "Liitetyt tietokannat" 45 | 46 | #: inc/database_item.class.php:511 47 | msgctxt "button" 48 | msgid "Associate a database" 49 | msgstr "Liitä tietokanta" 50 | 51 | #: inc/databasecategory.class.php:49 52 | msgid "Category" 53 | msgid_plural "Categories" 54 | msgstr[0] "Luokka" 55 | msgstr[1] "Luokat" 56 | 57 | #: inc/instance.class.php:52 58 | msgid "Instance" 59 | msgid_plural "Instances" 60 | msgstr[0] "Instanssi" 61 | msgstr[1] "Instanssit" 62 | 63 | #: inc/instance.class.php:177 inc/instance.class.php:266 64 | #: inc/script.class.php:172 inc/script.class.php:263 65 | msgid "Path" 66 | msgstr "Polku" 67 | 68 | #: inc/script.class.php:52 69 | msgid "Script" 70 | msgid_plural "Scripts" 71 | msgstr[0] "Skripti" 72 | msgstr[1] "Skriptit" 73 | 74 | #: inc/scripttype.class.php:49 75 | msgid "Type of script" 76 | msgid_plural "Types of script" 77 | msgstr[0] "Skriptin tyyppi" 78 | msgstr[1] "Skriptin tyypit" 79 | 80 | #: inc/servertype.class.php:48 81 | msgid "Engine" 82 | msgid_plural "Engines" 83 | msgstr[0] "Tietokantamoottori" 84 | msgstr[1] "Tietokantamoottorit" 85 | -------------------------------------------------------------------------------- /locales/es_AR.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Databases Development Team 3 | # This file is distributed under the same license as the GLPI - Databases plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Databases plugin\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2020-11-02 17:39+0100\n" 15 | "PO-Revision-Date: 2020-11-02 16:00+0000\n" 16 | "Last-Translator: Xavier CAILLAUD , 2020\n" 17 | "Language-Team: Spanish (Argentina) (https://www.transifex.com/infotelGLPI/teams/12357/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:610 25 | msgid "Associate to the database" 26 | msgstr "Asociar a Base de Datos" 27 | 28 | #: setup.php:99 inc/database.class.php:52 inc/menu.class.php:41 29 | #: inc/profile.class.php:175 30 | msgid "Database" 31 | msgid_plural "Databases" 32 | msgstr[0] "Base de Datos" 33 | msgstr[1] "Bases de Datos" 34 | 35 | #: inc/database.class.php:160 inc/database.class.php:381 36 | #: inc/database_item.class.php:540 37 | msgid "Editor" 38 | msgstr "Editor" 39 | 40 | #: inc/database.class.php:596 41 | msgid "Database associated" 42 | msgid_plural "Databases associated" 43 | msgstr[0] "Base de Datos asociada" 44 | msgstr[1] "Bases de Datos asociadas" 45 | 46 | #: inc/database_item.class.php:511 47 | msgctxt "button" 48 | msgid "Associate a database" 49 | msgstr "Asociar a Base de Datos" 50 | 51 | #: inc/databasecategory.class.php:49 52 | msgid "Category" 53 | msgid_plural "Categories" 54 | msgstr[0] "Categoría" 55 | msgstr[1] "Categorías" 56 | 57 | #: inc/instance.class.php:52 58 | msgid "Instance" 59 | msgid_plural "Instances" 60 | msgstr[0] "Instancia" 61 | msgstr[1] "Instancias" 62 | 63 | #: inc/instance.class.php:177 inc/instance.class.php:266 64 | #: inc/script.class.php:172 inc/script.class.php:263 65 | msgid "Path" 66 | msgstr "Camino" 67 | 68 | #: inc/script.class.php:52 69 | msgid "Script" 70 | msgid_plural "Scripts" 71 | msgstr[0] "Script" 72 | msgstr[1] "Scripts" 73 | 74 | #: inc/scripttype.class.php:49 75 | msgid "Type of script" 76 | msgid_plural "Types of script" 77 | msgstr[0] "Tipo de Script" 78 | msgstr[1] "Tipos de Scripts" 79 | 80 | #: inc/servertype.class.php:48 81 | msgid "Engine" 82 | msgid_plural "Engines" 83 | msgstr[0] "Motor" 84 | msgstr[1] "Motores" 85 | -------------------------------------------------------------------------------- /locales/es_ES.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Databases Development Team 3 | # This file is distributed under the same license as the GLPI - Databases plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Databases plugin\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2020-11-02 17:39+0100\n" 15 | "PO-Revision-Date: 2020-11-02 16:00+0000\n" 16 | "Last-Translator: Xavier CAILLAUD , 2020\n" 17 | "Language-Team: Spanish (Spain) (https://www.transifex.com/infotelGLPI/teams/12357/es_ES/)\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_ES\n" 22 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 23 | 24 | #: hook.php:610 25 | msgid "Associate to the database" 26 | msgstr "Asociar a la base de datos" 27 | 28 | #: setup.php:99 inc/database.class.php:52 inc/menu.class.php:41 29 | #: inc/profile.class.php:175 30 | msgid "Database" 31 | msgid_plural "Databases" 32 | msgstr[0] "Base de datos" 33 | msgstr[1] "Bases de datos" 34 | 35 | #: inc/database.class.php:160 inc/database.class.php:381 36 | #: inc/database_item.class.php:540 37 | msgid "Editor" 38 | msgstr "Editor" 39 | 40 | #: inc/database.class.php:596 41 | msgid "Database associated" 42 | msgid_plural "Databases associated" 43 | msgstr[0] "Base de datos asociada" 44 | msgstr[1] "Bases de datos asociadas" 45 | 46 | #: inc/database_item.class.php:511 47 | msgctxt "button" 48 | msgid "Associate a database" 49 | msgstr "Asociar una base de datos" 50 | 51 | #: inc/databasecategory.class.php:49 52 | msgid "Category" 53 | msgid_plural "Categories" 54 | msgstr[0] "Categoría" 55 | msgstr[1] "Categorías" 56 | 57 | #: inc/instance.class.php:52 58 | msgid "Instance" 59 | msgid_plural "Instances" 60 | msgstr[0] "Instancia" 61 | msgstr[1] "Instancias" 62 | 63 | #: inc/instance.class.php:177 inc/instance.class.php:266 64 | #: inc/script.class.php:172 inc/script.class.php:263 65 | msgid "Path" 66 | msgstr "Ruta" 67 | 68 | #: inc/script.class.php:52 69 | msgid "Script" 70 | msgid_plural "Scripts" 71 | msgstr[0] "Script" 72 | msgstr[1] "Scripts" 73 | 74 | #: inc/scripttype.class.php:49 75 | msgid "Type of script" 76 | msgid_plural "Types of script" 77 | msgstr[0] "Tipo de script" 78 | msgstr[1] "Tipos de script" 79 | 80 | #: inc/servertype.class.php:48 81 | msgid "Engine" 82 | msgid_plural "Engines" 83 | msgstr[0] "Motor" 84 | msgstr[1] "Motores" 85 | -------------------------------------------------------------------------------- /locales/fr_FR.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Databases Development Team 3 | # This file is distributed under the same license as the GLPI - Databases plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Databases plugin\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2020-11-02 17:39+0100\n" 15 | "PO-Revision-Date: 2020-11-02 16:00+0000\n" 16 | "Last-Translator: Xavier CAILLAUD , 2020\n" 17 | "Language-Team: French (France) (https://www.transifex.com/infotelGLPI/teams/12357/fr_FR/)\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Language: fr_FR\n" 22 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 23 | 24 | #: hook.php:610 25 | msgid "Associate to the database" 26 | msgstr "Associer à la base de données" 27 | 28 | #: setup.php:99 inc/database.class.php:52 inc/menu.class.php:41 29 | #: inc/profile.class.php:175 30 | msgid "Database" 31 | msgid_plural "Databases" 32 | msgstr[0] "Base de données" 33 | msgstr[1] "Bases de données" 34 | 35 | #: inc/database.class.php:160 inc/database.class.php:381 36 | #: inc/database_item.class.php:540 37 | msgid "Editor" 38 | msgstr "Editeur" 39 | 40 | #: inc/database.class.php:596 41 | msgid "Database associated" 42 | msgid_plural "Databases associated" 43 | msgstr[0] "Base de données associée" 44 | msgstr[1] "Bases de données associées" 45 | 46 | #: inc/database_item.class.php:511 47 | msgctxt "button" 48 | msgid "Associate a database" 49 | msgstr "Associer une base de données" 50 | 51 | #: inc/databasecategory.class.php:49 52 | msgid "Category" 53 | msgid_plural "Categories" 54 | msgstr[0] "Catégorie" 55 | msgstr[1] "Catégories" 56 | 57 | #: inc/instance.class.php:52 58 | msgid "Instance" 59 | msgid_plural "Instances" 60 | msgstr[0] "Instance" 61 | msgstr[1] "Instances" 62 | 63 | #: inc/instance.class.php:177 inc/instance.class.php:266 64 | #: inc/script.class.php:172 inc/script.class.php:263 65 | msgid "Path" 66 | msgstr "Chemin" 67 | 68 | #: inc/script.class.php:52 69 | msgid "Script" 70 | msgid_plural "Scripts" 71 | msgstr[0] "Script" 72 | msgstr[1] "Scripts" 73 | 74 | #: inc/scripttype.class.php:49 75 | msgid "Type of script" 76 | msgid_plural "Types of script" 77 | msgstr[0] "Type de script" 78 | msgstr[1] "Types de script" 79 | 80 | #: inc/servertype.class.php:48 81 | msgid "Engine" 82 | msgid_plural "Engines" 83 | msgstr[0] "Moteur" 84 | msgstr[1] "Moteurs" 85 | -------------------------------------------------------------------------------- /locales/pt_PT.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Databases Development Team 3 | # This file is distributed under the same license as the GLPI - Databases plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Databases plugin\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2020-11-02 17:39+0100\n" 15 | "PO-Revision-Date: 2020-11-02 16:00+0000\n" 16 | "Last-Translator: Xavier CAILLAUD , 2020\n" 17 | "Language-Team: Portuguese (Portugal) (https://www.transifex.com/infotelGLPI/teams/12357/pt_PT/)\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Language: pt_PT\n" 22 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 23 | 24 | #: hook.php:610 25 | msgid "Associate to the database" 26 | msgstr "Associado à base de dados" 27 | 28 | #: setup.php:99 inc/database.class.php:52 inc/menu.class.php:41 29 | #: inc/profile.class.php:175 30 | msgid "Database" 31 | msgid_plural "Databases" 32 | msgstr[0] "Base de dados" 33 | msgstr[1] "Bases de dados" 34 | 35 | #: inc/database.class.php:160 inc/database.class.php:381 36 | #: inc/database_item.class.php:540 37 | msgid "Editor" 38 | msgstr "Editor" 39 | 40 | #: inc/database.class.php:596 41 | msgid "Database associated" 42 | msgid_plural "Databases associated" 43 | msgstr[0] "Base de dados associadas" 44 | msgstr[1] "Bases de dados associadas" 45 | 46 | #: inc/database_item.class.php:511 47 | msgctxt "button" 48 | msgid "Associate a database" 49 | msgstr "Associar uma base de dados" 50 | 51 | #: inc/databasecategory.class.php:49 52 | msgid "Category" 53 | msgid_plural "Categories" 54 | msgstr[0] "Categoria" 55 | msgstr[1] "Categorias" 56 | 57 | #: inc/instance.class.php:52 58 | msgid "Instance" 59 | msgid_plural "Instances" 60 | msgstr[0] "Instância " 61 | msgstr[1] "Instâncias " 62 | 63 | #: inc/instance.class.php:177 inc/instance.class.php:266 64 | #: inc/script.class.php:172 inc/script.class.php:263 65 | msgid "Path" 66 | msgstr "Caminho" 67 | 68 | #: inc/script.class.php:52 69 | msgid "Script" 70 | msgid_plural "Scripts" 71 | msgstr[0] "Script" 72 | msgstr[1] "Scripts" 73 | 74 | #: inc/scripttype.class.php:49 75 | msgid "Type of script" 76 | msgid_plural "Types of script" 77 | msgstr[0] "Tipo de Script" 78 | msgstr[1] "Tipos de Scripts" 79 | 80 | #: inc/servertype.class.php:48 81 | msgid "Engine" 82 | msgid_plural "Engines" 83 | msgstr[0] "Motor" 84 | msgstr[1] "Motores" 85 | -------------------------------------------------------------------------------- /locales/pt_BR.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Databases Development Team 3 | # This file is distributed under the same license as the GLPI - Databases plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Databases plugin\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2020-11-02 17:39+0100\n" 15 | "PO-Revision-Date: 2020-11-02 16:00+0000\n" 16 | "Last-Translator: Xavier CAILLAUD , 2020\n" 17 | "Language-Team: Portuguese (Brazil) (https://www.transifex.com/infotelGLPI/teams/12357/pt_BR/)\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Language: pt_BR\n" 22 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 23 | 24 | #: hook.php:610 25 | msgid "Associate to the database" 26 | msgstr "Associar ao banco de dados" 27 | 28 | #: setup.php:99 inc/database.class.php:52 inc/menu.class.php:41 29 | #: inc/profile.class.php:175 30 | msgid "Database" 31 | msgid_plural "Databases" 32 | msgstr[0] "Banco de dados" 33 | msgstr[1] "Bancos de dados" 34 | 35 | #: inc/database.class.php:160 inc/database.class.php:381 36 | #: inc/database_item.class.php:540 37 | msgid "Editor" 38 | msgstr "Editor" 39 | 40 | #: inc/database.class.php:596 41 | msgid "Database associated" 42 | msgid_plural "Databases associated" 43 | msgstr[0] "Banco de dados associado" 44 | msgstr[1] "Bancos de dados associados" 45 | 46 | #: inc/database_item.class.php:511 47 | msgctxt "button" 48 | msgid "Associate a database" 49 | msgstr "Associar um banco de dados" 50 | 51 | #: inc/databasecategory.class.php:49 52 | msgid "Category" 53 | msgid_plural "Categories" 54 | msgstr[0] "Categoria" 55 | msgstr[1] "Categorias" 56 | 57 | #: inc/instance.class.php:52 58 | msgid "Instance" 59 | msgid_plural "Instances" 60 | msgstr[0] "Instância" 61 | msgstr[1] "Instâncias" 62 | 63 | #: inc/instance.class.php:177 inc/instance.class.php:266 64 | #: inc/script.class.php:172 inc/script.class.php:263 65 | msgid "Path" 66 | msgstr "Caminho" 67 | 68 | #: inc/script.class.php:52 69 | msgid "Script" 70 | msgid_plural "Scripts" 71 | msgstr[0] "Script" 72 | msgstr[1] "Scripts" 73 | 74 | #: inc/scripttype.class.php:49 75 | msgid "Type of script" 76 | msgid_plural "Types of script" 77 | msgstr[0] "Tipo de script" 78 | msgstr[1] "Tipos de script" 79 | 80 | #: inc/servertype.class.php:48 81 | msgid "Engine" 82 | msgid_plural "Engines" 83 | msgstr[0] "Mecanismo" 84 | msgstr[1] "Mecanismos" 85 | -------------------------------------------------------------------------------- /inc/menu.class.php: -------------------------------------------------------------------------------- 1 | . 28 | -------------------------------------------------------------------------- 29 | */ 30 | 31 | /** 32 | * Class PluginDatabasesMenu 33 | */ 34 | class PluginDatabasesMenu extends CommonGLPI { 35 | static $rightname = 'plugin_databases'; 36 | 37 | /** 38 | * @return translated 39 | */ 40 | static function getMenuName() { 41 | return _n('Database', 'Databases', 2, 'databases'); 42 | } 43 | 44 | /** 45 | * @return array 46 | */ 47 | static function getMenuContent() { 48 | 49 | $menu = []; 50 | $menu['title'] = self::getMenuName(); 51 | $menu['page'] = PLUGIN_DATABASES_DIR_NOFULL."/front/database.php"; 52 | $menu['links']['search'] = PluginDatabasesDatabase::getSearchURL(false); 53 | if (PluginDatabasesDatabase::canCreate()) { 54 | $menu['links']['add'] = PluginDatabasesDatabase::getFormURL(false); 55 | } 56 | $menu['icon'] = self::getIcon(); 57 | 58 | return $menu; 59 | } 60 | 61 | static function getIcon() { 62 | return "fas fa-database"; 63 | } 64 | 65 | static function removeRightsFromSession() { 66 | if (isset($_SESSION['glpimenu']['assets']['types']['PluginDatabasesMenu'])) { 67 | unset($_SESSION['glpimenu']['assets']['types']['PluginDatabasesMenu']); 68 | } 69 | if (isset($_SESSION['glpimenu']['assets']['content']['plugindatabasesmenu'])) { 70 | unset($_SESSION['glpimenu']['assets']['content']['plugindatabasesmenu']); 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /locales/ro_RO.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Databases Development Team 3 | # This file is distributed under the same license as the GLPI - Databases plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Databases plugin\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2020-11-02 17:39+0100\n" 15 | "PO-Revision-Date: 2020-11-02 16:00+0000\n" 16 | "Last-Translator: Xavier CAILLAUD , 2020\n" 17 | "Language-Team: Romanian (Romania) (https://www.transifex.com/infotelGLPI/teams/12357/ro_RO/)\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Language: ro_RO\n" 22 | "Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n" 23 | 24 | #: hook.php:610 25 | msgid "Associate to the database" 26 | msgstr "Asociază la baza de date" 27 | 28 | #: setup.php:99 inc/database.class.php:52 inc/menu.class.php:41 29 | #: inc/profile.class.php:175 30 | msgid "Database" 31 | msgid_plural "Databases" 32 | msgstr[0] "Bază de date" 33 | msgstr[1] "Baze de date" 34 | msgstr[2] "Baze de date" 35 | 36 | #: inc/database.class.php:160 inc/database.class.php:381 37 | #: inc/database_item.class.php:540 38 | msgid "Editor" 39 | msgstr "Editor" 40 | 41 | #: inc/database.class.php:596 42 | msgid "Database associated" 43 | msgid_plural "Databases associated" 44 | msgstr[0] "Bază de date asociată" 45 | msgstr[1] "Baze de date asociate" 46 | msgstr[2] "Baze de date asociate" 47 | 48 | #: inc/database_item.class.php:511 49 | msgctxt "button" 50 | msgid "Associate a database" 51 | msgstr "Asociază la baza de date" 52 | 53 | #: inc/databasecategory.class.php:49 54 | msgid "Category" 55 | msgid_plural "Categories" 56 | msgstr[0] "Categorie" 57 | msgstr[1] "Categorii" 58 | msgstr[2] "Categorii" 59 | 60 | #: inc/instance.class.php:52 61 | msgid "Instance" 62 | msgid_plural "Instances" 63 | msgstr[0] "Instanţă" 64 | msgstr[1] "Instanţe" 65 | msgstr[2] "Instanţe" 66 | 67 | #: inc/instance.class.php:177 inc/instance.class.php:266 68 | #: inc/script.class.php:172 inc/script.class.php:263 69 | msgid "Path" 70 | msgstr "Calea" 71 | 72 | #: inc/script.class.php:52 73 | msgid "Script" 74 | msgid_plural "Scripts" 75 | msgstr[0] "Script" 76 | msgstr[1] "Scripturi" 77 | msgstr[2] "Scripturi" 78 | 79 | #: inc/scripttype.class.php:49 80 | msgid "Type of script" 81 | msgid_plural "Types of script" 82 | msgstr[0] "Tip de script" 83 | msgstr[1] "Tipuri de scripturi" 84 | msgstr[2] "Tipuri de scripturi" 85 | 86 | #: inc/servertype.class.php:48 87 | msgid "Engine" 88 | msgid_plural "Engines" 89 | msgstr[0] "Engine" 90 | msgstr[1] "Engine" 91 | msgstr[2] "Engine" 92 | -------------------------------------------------------------------------------- /front/script.form.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | 32 | if (!isset($_GET["id"])) { 33 | $_GET["id"] = ""; 34 | } 35 | if (!isset($_GET["withtemplate"])) { 36 | $_GET["withtemplate"] = ""; 37 | } 38 | if (!isset($_GET["plugin_databases_databases_id"])) { 39 | $_GET["plugin_databases_databases_id"] = ""; 40 | } 41 | 42 | $script = new PluginDatabasesScript(); 43 | 44 | if (isset($_POST["add"])) { 45 | 46 | if ($script->canCreate()) { 47 | $script->add($_POST); 48 | } 49 | Html::back(); 50 | 51 | } else if (isset($_POST["update"])) { 52 | 53 | if ($script->canCreate()) { 54 | $script->update($_POST); 55 | } 56 | Html::back(); 57 | 58 | } else if (isset($_POST["delete"])) { 59 | 60 | if ($script->canCreate()) { 61 | $script->delete($_POST, 1); 62 | } 63 | Html::redirect(Toolbox::getItemTypeFormURL('PluginDatabasesDatabase') . "?id=" . $_POST["plugin_databases_databases_id"]); 64 | 65 | } else if (isset($_POST["delete_script"])) { 66 | if ($script->canCreate()) { 67 | foreach ($_POST["check"] as $ID => $value) { 68 | $script->delete(["id" => $ID], 1); 69 | } 70 | } 71 | Html::back(); 72 | 73 | } else { 74 | 75 | $script->checkGlobal(READ); 76 | 77 | $plugin = new Plugin(); 78 | if ($plugin->isActivated("environment")) { 79 | Html::header(PluginDatabasesDatabase::getTypeName(2), 80 | '', "assets", "pluginenvironmentdisplay", "databases"); 81 | } else { 82 | Html::header(PluginDatabasesDatabase::getTypeName(2), '', "assets", 83 | "plugindatabasesmenu"); 84 | } 85 | 86 | $script->display($_GET); 87 | 88 | Html::footer(); 89 | } 90 | -------------------------------------------------------------------------------- /front/instance.form.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | 32 | if (!isset($_GET["id"])) { 33 | $_GET["id"] = ""; 34 | } 35 | if (!isset($_GET["withtemplate"])) { 36 | $_GET["withtemplate"] = ""; 37 | } 38 | if (!isset($_GET["plugin_databases_databases_id"])) { 39 | $_GET["plugin_databases_databases_id"] = ""; 40 | } 41 | 42 | $instance = new PluginDatabasesInstance(); 43 | 44 | if (isset($_POST["add"])) { 45 | 46 | if ($instance->canCreate()) { 47 | $instance->add($_POST); 48 | } 49 | Html::back(); 50 | 51 | } else if (isset($_POST["update"])) { 52 | 53 | if ($instance->canCreate()) { 54 | $instance->update($_POST); 55 | } 56 | Html::back(); 57 | 58 | } else if (isset($_POST["delete"])) { 59 | 60 | if ($instance->canCreate()) { 61 | $instance->delete($_POST, 1); 62 | } 63 | Html::redirect(Toolbox::getItemTypeFormURL('PluginDatabasesDatabase') . "?id=" . $_POST["plugin_databases_databases_id"]); 64 | 65 | } else if (isset($_POST["delete_instance"])) { 66 | if ($instance->canCreate()) { 67 | foreach ($_POST["check"] as $ID => $value) { 68 | $instance->delete(["id" => $ID], 1); 69 | } 70 | } 71 | Html::back(); 72 | 73 | } else { 74 | 75 | $instance->checkGlobal(READ); 76 | 77 | $plugin = new Plugin(); 78 | if ($plugin->isActivated("environment")) { 79 | Html::header(PluginDatabasesDatabase::getTypeName(2), 80 | '', "assets", "pluginenvironmentdisplay", "databases"); 81 | } else { 82 | Html::header(PluginDatabasesDatabase::getTypeName(2), '', "assets", 83 | "plugindatabasesmenu"); 84 | } 85 | $instance->display($_GET); 86 | 87 | Html::footer(); 88 | } 89 | -------------------------------------------------------------------------------- /inc/databasetype.class.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | if (!defined('GLPI_ROOT')) { 31 | die("Sorry. You can't access directly to this file"); 32 | } 33 | 34 | // Class for a Dropdown 35 | 36 | /** 37 | * Class PluginDatabasesDatabaseType 38 | */ 39 | class PluginDatabasesDatabaseType extends CommonDropdown { 40 | 41 | static $rightname = "dropdown"; 42 | var $can_be_translated = true; 43 | 44 | /** 45 | * @param int $nb 46 | * 47 | * @return translated 48 | */ 49 | static function getTypeName($nb = 0) { 50 | 51 | return _n('Type', 'Types', $nb); 52 | } 53 | 54 | /** 55 | * @param $ID 56 | * @param $entity 57 | * 58 | * @return ID|int|the 59 | */ 60 | static function transfer($ID, $entity) { 61 | global $DB; 62 | 63 | if ($ID > 0) { 64 | // Not already transfer 65 | // Search init item 66 | $query = "SELECT * 67 | FROM `glpi_plugin_databases_databasetypes` 68 | WHERE `id` = '$ID'"; 69 | 70 | if ($result = $DB->query($query)) { 71 | if ($DB->numrows($result)) { 72 | $data = $DB->fetchAssoc($result); 73 | $data = Toolbox::addslashes_deep($data); 74 | $input['name'] = $data['name']; 75 | $input['entities_id'] = $entity; 76 | $temp = new self(); 77 | $newID = $temp->getID(); 78 | 79 | if ($newID < 0) { 80 | $newID = $temp->import($input); 81 | } 82 | 83 | return $newID; 84 | } 85 | } 86 | } 87 | return 0; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /.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 -zcvf glpi-$GITHUB_NAME-${GITHUB_REF/refs\/tags\//}.tar.gz $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.gz 47 | asset_name: glpi-${{ github.event.repository.name }}-${{ steps.build_.outputs.tag }}.tar.gz 48 | asset_content_type: application/zip 49 | 50 | -------------------------------------------------------------------------------- /locales/cs_CZ.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Databases Development Team 3 | # This file is distributed under the same license as the GLPI - Databases plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Databases plugin\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2020-11-02 17:39+0100\n" 15 | "PO-Revision-Date: 2020-11-02 16:00+0000\n" 16 | "Last-Translator: Xavier CAILLAUD , 2020\n" 17 | "Language-Team: Czech (Czech Republic) (https://www.transifex.com/infotelGLPI/teams/12357/cs_CZ/)\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Language: cs_CZ\n" 22 | "Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n" 23 | 24 | #: hook.php:610 25 | msgid "Associate to the database" 26 | msgstr "Přiřadit k databázi" 27 | 28 | #: setup.php:99 inc/database.class.php:52 inc/menu.class.php:41 29 | #: inc/profile.class.php:175 30 | msgid "Database" 31 | msgid_plural "Databases" 32 | msgstr[0] "Databáze" 33 | msgstr[1] "Databáze" 34 | msgstr[2] "Databází" 35 | msgstr[3] "Databáze" 36 | 37 | #: inc/database.class.php:160 inc/database.class.php:381 38 | #: inc/database_item.class.php:540 39 | msgid "Editor" 40 | msgstr "Editor" 41 | 42 | #: inc/database.class.php:596 43 | msgid "Database associated" 44 | msgid_plural "Databases associated" 45 | msgstr[0] "Přiřazená databáze" 46 | msgstr[1] "Přiřazené databáze" 47 | msgstr[2] "Přiřazených databází" 48 | msgstr[3] "Přiřazené databáze" 49 | 50 | #: inc/database_item.class.php:511 51 | msgctxt "button" 52 | msgid "Associate a database" 53 | msgstr "Přiřadit databázi" 54 | 55 | #: inc/databasecategory.class.php:49 56 | msgid "Category" 57 | msgid_plural "Categories" 58 | msgstr[0] "Kategorie" 59 | msgstr[1] "Kategorie" 60 | msgstr[2] "Kategorií" 61 | msgstr[3] "Kategorie" 62 | 63 | #: inc/instance.class.php:52 64 | msgid "Instance" 65 | msgid_plural "Instances" 66 | msgstr[0] "Instance" 67 | msgstr[1] "Instance" 68 | msgstr[2] "Instancí" 69 | msgstr[3] "Instance" 70 | 71 | #: inc/instance.class.php:177 inc/instance.class.php:266 72 | #: inc/script.class.php:172 inc/script.class.php:263 73 | msgid "Path" 74 | msgstr "Popis umístění" 75 | 76 | #: inc/script.class.php:52 77 | msgid "Script" 78 | msgid_plural "Scripts" 79 | msgstr[0] "Skript" 80 | msgstr[1] "Skripty" 81 | msgstr[2] "Skriptů" 82 | msgstr[3] "Skripty" 83 | 84 | #: inc/scripttype.class.php:49 85 | msgid "Type of script" 86 | msgid_plural "Types of script" 87 | msgstr[0] "Typ skriptu" 88 | msgstr[1] "Typy skriptů" 89 | msgstr[2] "Typů skriptů" 90 | msgstr[3] "Typy skriptů" 91 | 92 | #: inc/servertype.class.php:48 93 | msgid "Engine" 94 | msgid_plural "Engines" 95 | msgstr[0] "Engine" 96 | msgstr[1] "Enginy" 97 | msgstr[2] "Enginů" 98 | msgstr[3] "Enginy" 99 | -------------------------------------------------------------------------------- /locales/pl_PL.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Databases Development Team 3 | # This file is distributed under the same license as the GLPI - Databases plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Databases plugin\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2020-11-02 17:39+0100\n" 15 | "PO-Revision-Date: 2020-11-02 16:00+0000\n" 16 | "Last-Translator: Xavier CAILLAUD , 2020\n" 17 | "Language-Team: Polish (Poland) (https://www.transifex.com/infotelGLPI/teams/12357/pl_PL/)\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Language: pl_PL\n" 22 | "Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n" 23 | 24 | #: hook.php:610 25 | msgid "Associate to the database" 26 | msgstr "Połączenie z bazą danych" 27 | 28 | #: setup.php:99 inc/database.class.php:52 inc/menu.class.php:41 29 | #: inc/profile.class.php:175 30 | msgid "Database" 31 | msgid_plural "Databases" 32 | msgstr[0] "Baza danych" 33 | msgstr[1] "Bazy danych" 34 | msgstr[2] "Baz danych" 35 | msgstr[3] "Baz danych" 36 | 37 | #: inc/database.class.php:160 inc/database.class.php:381 38 | #: inc/database_item.class.php:540 39 | msgid "Editor" 40 | msgstr "Producent" 41 | 42 | #: inc/database.class.php:596 43 | msgid "Database associated" 44 | msgid_plural "Databases associated" 45 | msgstr[0] "Połączona baza danych" 46 | msgstr[1] "Połoączone bazy danych" 47 | msgstr[2] "Połączonych baz danych" 48 | msgstr[3] "Połączonych baz danych" 49 | 50 | #: inc/database_item.class.php:511 51 | msgctxt "button" 52 | msgid "Associate a database" 53 | msgstr "Dołącz bazę danych" 54 | 55 | #: inc/databasecategory.class.php:49 56 | msgid "Category" 57 | msgid_plural "Categories" 58 | msgstr[0] "Kategoria" 59 | msgstr[1] "Kategorie" 60 | msgstr[2] "Kategorii" 61 | msgstr[3] "Kategorii" 62 | 63 | #: inc/instance.class.php:52 64 | msgid "Instance" 65 | msgid_plural "Instances" 66 | msgstr[0] "Egzemplarz" 67 | msgstr[1] "Egzemplarze" 68 | msgstr[2] "Egzemplarzy" 69 | msgstr[3] "Egzemplarzy" 70 | 71 | #: inc/instance.class.php:177 inc/instance.class.php:266 72 | #: inc/script.class.php:172 inc/script.class.php:263 73 | msgid "Path" 74 | msgstr "Ścieżka" 75 | 76 | #: inc/script.class.php:52 77 | msgid "Script" 78 | msgid_plural "Scripts" 79 | msgstr[0] "Skrypt" 80 | msgstr[1] "Skrypty" 81 | msgstr[2] "Skryptów" 82 | msgstr[3] "Skryptów" 83 | 84 | #: inc/scripttype.class.php:49 85 | msgid "Type of script" 86 | msgid_plural "Types of script" 87 | msgstr[0] "Rodzaj skryptu" 88 | msgstr[1] "Rodzaje skryptów" 89 | msgstr[2] "Rodzaji skryptów" 90 | msgstr[3] "Rodzaji skryptów" 91 | 92 | #: inc/servertype.class.php:48 93 | msgid "Engine" 94 | msgid_plural "Engines" 95 | msgstr[0] "Silnik" 96 | msgstr[1] "Silniki" 97 | msgstr[2] "Silników" 98 | msgstr[3] "Silników" 99 | -------------------------------------------------------------------------------- /locales/uk_UA.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Databases Development Team 3 | # This file is distributed under the same license as the GLPI - Databases plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Databases plugin\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2020-11-02 17:39+0100\n" 15 | "PO-Revision-Date: 2020-11-02 16:00+0000\n" 16 | "Last-Translator: Xavier CAILLAUD , 2020\n" 17 | "Language-Team: Ukrainian (Ukraine) (https://www.transifex.com/infotelGLPI/teams/12357/uk_UA/)\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Language: uk_UA\n" 22 | "Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != 11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || (n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" 23 | 24 | #: hook.php:610 25 | msgid "Associate to the database" 26 | msgstr "Пов'язати з базою даних" 27 | 28 | #: setup.php:99 inc/database.class.php:52 inc/menu.class.php:41 29 | #: inc/profile.class.php:175 30 | msgid "Database" 31 | msgid_plural "Databases" 32 | msgstr[0] "База даних" 33 | msgstr[1] "Бази даних" 34 | msgstr[2] "Баз даних" 35 | msgstr[3] "Бази даних" 36 | 37 | #: inc/database.class.php:160 inc/database.class.php:381 38 | #: inc/database_item.class.php:540 39 | msgid "Editor" 40 | msgstr "Редактор" 41 | 42 | #: inc/database.class.php:596 43 | msgid "Database associated" 44 | msgid_plural "Databases associated" 45 | msgstr[0] "Пов'язана база даних" 46 | msgstr[1] "Пов'язані бази даних" 47 | msgstr[2] "Пов'язаних баз даних" 48 | msgstr[3] "Пов'язані бази даних" 49 | 50 | #: inc/database_item.class.php:511 51 | msgctxt "button" 52 | msgid "Associate a database" 53 | msgstr "Пов'язати базу даних" 54 | 55 | #: inc/databasecategory.class.php:49 56 | msgid "Category" 57 | msgid_plural "Categories" 58 | msgstr[0] "Категорія" 59 | msgstr[1] "Категорії" 60 | msgstr[2] "Категорій" 61 | msgstr[3] "Категорії" 62 | 63 | #: inc/instance.class.php:52 64 | msgid "Instance" 65 | msgid_plural "Instances" 66 | msgstr[0] "Екземпляр" 67 | msgstr[1] "Екземпляри" 68 | msgstr[2] "Екземплярів" 69 | msgstr[3] "Екземпляри" 70 | 71 | #: inc/instance.class.php:177 inc/instance.class.php:266 72 | #: inc/script.class.php:172 inc/script.class.php:263 73 | msgid "Path" 74 | msgstr "Шлях" 75 | 76 | #: inc/script.class.php:52 77 | msgid "Script" 78 | msgid_plural "Scripts" 79 | msgstr[0] "Скрипт" 80 | msgstr[1] "Скрипти" 81 | msgstr[2] "Скриптів" 82 | msgstr[3] "Скрипти" 83 | 84 | #: inc/scripttype.class.php:49 85 | msgid "Type of script" 86 | msgid_plural "Types of script" 87 | msgstr[0] "Тип скрипту" 88 | msgstr[1] "Типи скриптів" 89 | msgstr[2] "Типів скриптів" 90 | msgstr[3] "Типи скриптів" 91 | 92 | #: inc/servertype.class.php:48 93 | msgid "Engine" 94 | msgid_plural "Engines" 95 | msgstr[0] "СУБД" 96 | msgstr[1] "СУБД" 97 | msgstr[2] "СУБД" 98 | msgstr[3] "СУБД" 99 | -------------------------------------------------------------------------------- /front/database.form.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | 32 | if (!isset($_GET["id"])) { 33 | $_GET["id"] = ""; 34 | } 35 | if (!isset($_GET["withtemplate"])) { 36 | $_GET["withtemplate"] = ""; 37 | } 38 | 39 | $database = new PluginDatabasesDatabase(); 40 | $database_item = new PluginDatabasesDatabase_Item(); 41 | 42 | if (isset($_POST["add"])) { 43 | 44 | $database->check(-1, CREATE, $_POST); 45 | $newID = $database->add($_POST); 46 | if ($_SESSION['glpibackcreated']) { 47 | Html::redirect($database->getFormURL() . "?id=" . $newID); 48 | } 49 | Html::back(); 50 | 51 | } else if (isset($_POST["delete"])) { 52 | 53 | $database->check($_POST['id'], DELETE); 54 | $database->delete($_POST); 55 | $database->redirectToList(); 56 | 57 | } else if (isset($_POST["restore"])) { 58 | 59 | $database->check($_POST['id'], PURGE); 60 | $database->restore($_POST); 61 | $database->redirectToList(); 62 | 63 | } else if (isset($_POST["purge"])) { 64 | 65 | $database->check($_POST['id'], PURGE); 66 | $database->delete($_POST, 1); 67 | $database->redirectToList(); 68 | 69 | } else if (isset($_POST["update"])) { 70 | 71 | $database->check($_POST['id'], UPDATE); 72 | $database->update($_POST); 73 | Html::back(); 74 | 75 | } else if (isset($_POST["additem"])) { 76 | 77 | if (!empty($_POST['itemtype']) && $_POST['items_id'] > 0) { 78 | $database_item->check(-1, UPDATE, $_POST); 79 | $database_item->addItem($_POST); 80 | } 81 | Html::back(); 82 | 83 | } else if (isset($_POST["deleteitem"])) { 84 | 85 | foreach ($_POST["item"] as $key => $val) { 86 | $input = ['id' => $key]; 87 | if ($val == 1) { 88 | $database_item->check($key, UPDATE); 89 | $database_item->delete($input); 90 | } 91 | } 92 | Html::back(); 93 | 94 | } else if (isset($_POST["deletedatabases"])) { 95 | 96 | $input = ['id' => $_POST["id"]]; 97 | $database_item->check($_POST["id"], UPDATE); 98 | $database_item->delete($input); 99 | Html::back(); 100 | 101 | } else { 102 | 103 | $database->checkGlobal(READ); 104 | 105 | $plugin = new Plugin(); 106 | if ($plugin->isActivated("environment")) { 107 | Html::header(PluginDatabasesDatabase::getTypeName(2), 108 | '', "assets", "pluginenvironmentdisplay", "databases"); 109 | } else { 110 | Html::header(PluginDatabasesDatabase::getTypeName(2), '', "assets", 111 | "plugindatabasesmenu"); 112 | } 113 | $database->display($_GET); 114 | 115 | Html::footer(); 116 | } 117 | -------------------------------------------------------------------------------- /sql/empty-1.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_sgbd`; 2 | CREATE TABLE `glpi_plugin_sgbd` ( 3 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 4 | `FK_entities` INT(11) NOT NULL DEFAULT '0', 5 | `name` VARCHAR(255) 6 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 7 | `type` INT(4) NOT NULL DEFAULT '0', 8 | `server` INT(4) NOT NULL DEFAULT '0', 9 | `FK_enterprise` SMALLINT(6) NOT NULL DEFAULT '0', 10 | `FK_glpi_enterprise` SMALLINT(6) NOT NULL DEFAULT '0', 11 | `location` INT(4) NOT NULL DEFAULT '0', 12 | `notes` LONGTEXT, 13 | `comment` VARCHAR(255) 14 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 15 | `deleted` SMALLINT(6) NOT NULL DEFAULT '0', 16 | PRIMARY KEY (`ID`) 17 | ) 18 | ENGINE = MyISAM 19 | DEFAULT CHARSET = utf8 20 | COLLATE = utf8_unicode_ci; 21 | 22 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_sgbd_type`; 23 | CREATE TABLE `glpi_dropdown_plugin_sgbd_type` ( 24 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 25 | `FK_entities` INT(11) NOT NULL DEFAULT '0', 26 | `name` VARCHAR(255) 27 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 28 | `comments` TEXT, 29 | PRIMARY KEY (`ID`), 30 | KEY `name` (`name`) 31 | ) 32 | ENGINE = MyISAM 33 | DEFAULT CHARSET = utf8 34 | COLLATE = utf8_unicode_ci; 35 | 36 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_sgbd_server_type`; 37 | CREATE TABLE `glpi_dropdown_plugin_sgbd_server_type` ( 38 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 39 | `name` VARCHAR(255) 40 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 41 | `comments` TEXT, 42 | PRIMARY KEY (`ID`), 43 | KEY `name` (`name`) 44 | ) 45 | ENGINE = MyISAM 46 | DEFAULT CHARSET = utf8 47 | COLLATE = utf8_unicode_ci; 48 | 49 | INSERT INTO `glpi_dropdown_plugin_sgbd_server_type` (`ID`, `name`, `comments`) VALUES ('1', 'Mysql', ''); 50 | INSERT INTO `glpi_dropdown_plugin_sgbd_server_type` (`ID`, `name`, `comments`) VALUES ('2', 'Oracle', ''); 51 | INSERT INTO `glpi_dropdown_plugin_sgbd_server_type` (`ID`, `name`, `comments`) VALUES ('3', 'SQL', ''); 52 | 53 | DROP TABLE IF EXISTS `glpi_plugin_sgbd_device`; 54 | CREATE TABLE `glpi_plugin_sgbd_device` ( 55 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 56 | `FK_sgbd` INT(11) NOT NULL DEFAULT '0', 57 | `FK_device` INT(11) NOT NULL DEFAULT '0', 58 | `device_type` INT(11) NOT NULL DEFAULT '0', 59 | PRIMARY KEY (`ID`), 60 | UNIQUE KEY `FK_compte` (`FK_sgbd`, `FK_device`, `device_type`), 61 | KEY `FK_sgbd_2` (`FK_sgbd`), 62 | KEY `FK_device` (`FK_device`, `device_type`) 63 | ) 64 | ENGINE = MyISAM 65 | DEFAULT CHARSET = utf8 66 | COLLATE = utf8_unicode_ci; 67 | 68 | DROP TABLE IF EXISTS `glpi_plugin_sgbd_profiles`; 69 | CREATE TABLE `glpi_plugin_sgbd_profiles` ( 70 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 71 | `name` VARCHAR(255) 72 | COLLATE utf8_unicode_ci DEFAULT NULL, 73 | `interface` VARCHAR(50) 74 | COLLATE utf8_unicode_ci NOT NULL DEFAULT 'sgbd', 75 | `is_default` SMALLINT(6) NOT NULL DEFAULT '0', 76 | `sgbd` CHAR(1) DEFAULT NULL, 77 | PRIMARY KEY (`ID`), 78 | KEY `interface` (`interface`) 79 | ) 80 | ENGINE = MyISAM 81 | DEFAULT CHARSET = utf8 82 | COLLATE = utf8_unicode_ci; 83 | 84 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '2400', '2', '2', '0'); 85 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '2400', '6', '3', '0'); 86 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '2400', '7', '4', '0'); -------------------------------------------------------------------------------- /inc/databaseinjection.class.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | if (!defined('GLPI_ROOT')) { 31 | die("Sorry. You can't access directly to this file"); 32 | } 33 | 34 | /** 35 | * Class PluginDatabasesDatabaseInjection 36 | */ 37 | class PluginDatabasesDatabaseInjection extends PluginDatabasesDatabase 38 | implements PluginDatainjectionInjectionInterface { 39 | 40 | /** 41 | * @param null $classname 42 | * 43 | * @return mixed 44 | */ 45 | static function getTable($classname = null) { 46 | 47 | $parenttype = get_parent_class(); 48 | return $parenttype::getTable(); 49 | 50 | } 51 | 52 | /** 53 | * @return bool 54 | */ 55 | function isPrimaryType() { 56 | return true; 57 | } 58 | 59 | /** 60 | * @return array 61 | */ 62 | function connectedTo() { 63 | return []; 64 | } 65 | 66 | /** 67 | * @param string $primary_type 68 | * 69 | * @return array 70 | */ 71 | function getOptions($primary_type = '') { 72 | 73 | $tab = Search::getOptions(get_parent_class($this)); 74 | 75 | //Specific to location 76 | $tab[12]['linkfield'] = 'locations_id'; 77 | 78 | //$blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(); 79 | //Remove some options because some fields cannot be imported 80 | $notimportable = [7, 30, 80]; 81 | $options['ignore_fields'] = $notimportable; 82 | $options['displaytype'] = ["dropdown" => [2, 3, 4, 6, 10, 12], 83 | "user" => [11], 84 | "multiline_text" => [9], 85 | "date" => [14], 86 | "bool" => [8, 13]]; 87 | 88 | return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this); 89 | 90 | } 91 | 92 | /** 93 | * Standard method to delete an object into glpi 94 | * WILL BE INTEGRATED INTO THE CORE IN 0.80 95 | * 96 | * @param array $values 97 | * @param array|options $options 98 | * 99 | * @return an 100 | * @internal param fields $fields to add into glpi 101 | * @internal param options $options used during creation 102 | */ 103 | function deleteObject($values = [], $options = []) { 104 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options); 105 | $lib->deleteObject(); 106 | return $lib->getInjectionResults(); 107 | } 108 | 109 | /** 110 | * Standard method to add an object into glpi 111 | * WILL BE INTEGRATED INTO THE CORE IN 0.80 112 | * 113 | * @param array|fields $values 114 | * @param array|options $options 115 | * 116 | * @return an array of IDs of newly created objects : for example array(Computer=>1, Networkport=>10) 117 | * @internal param fields $values to add into glpi 118 | * @internal param options $options used during creation 119 | */ 120 | function addOrUpdateObject($values = [], $options = []) { 121 | $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options); 122 | $lib->processAddOrUpdate(); 123 | return $lib->getInjectionResults(); 124 | } 125 | 126 | } 127 | -------------------------------------------------------------------------------- /setup.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | define('PLUGIN_DATABASES_VERSION', '2.3.2'); 31 | 32 | if (!defined("PLUGIN_DATABASES_DIR")) { 33 | define("PLUGIN_DATABASES_DIR", Plugin::getPhpDir("databases")); 34 | define("PLUGIN_DATABASES_DIR_NOFULL", Plugin::getPhpDir("databases",false)); 35 | } 36 | // Init the hooks of the plugins -Needed 37 | function plugin_init_databases() { 38 | global $PLUGIN_HOOKS, $CFG_GLPI; 39 | 40 | $PLUGIN_HOOKS['csrf_compliant']['databases'] = true; 41 | $PLUGIN_HOOKS['change_profile']['databases'] = ['PluginDatabasesProfile', 'initProfile']; 42 | $PLUGIN_HOOKS['assign_to_ticket']['databases'] = true; 43 | 44 | //$PLUGIN_HOOKS['assign_to_ticket_dropdown']['databases'] = true; 45 | //$PLUGIN_HOOKS['assign_to_ticket_itemtype']['databases'] = array('PluginDatabasesDatabase_Item'); 46 | 47 | Plugin::registerClass('PluginDatabasesDatabase', [ 48 | 'linkgroup_types' => true, 49 | 'linkgroup_tech_types' => true, 50 | 'linkuser_tech_types' => true, 51 | 'document_types' => true, 52 | 'ticket_types' => true, 53 | 'helpdesk_visible_types' => true, 54 | 'addtabon' => 'Supplier' 55 | ]); 56 | 57 | $CFG_GLPI['impact_asset_types']['PluginDatabasesDatabase'] = "plugins/databases/databases.png"; 58 | 59 | Plugin::registerClass('PluginDatabasesProfile', 60 | ['addtabon' => 'Profile']); 61 | 62 | //Plugin::registerClass('PluginDatabasesDatabase_Item', 63 | // array('ticket_types' => true)); 64 | 65 | if (class_exists('PluginAccountsAccount')) { 66 | PluginAccountsAccount::registerType('PluginDatabasesDatabase'); 67 | } 68 | 69 | if (Session::getLoginUserID()) { 70 | 71 | $plugin = new Plugin(); 72 | if (!$plugin->isActivated('environment') 73 | && Session::haveRight("plugin_databases", READ) 74 | ) { 75 | 76 | $PLUGIN_HOOKS['menu_toadd']['databases'] = ['assets' => 'PluginDatabasesMenu']; 77 | } 78 | 79 | if (Session::haveRight("plugin_databases", UPDATE)) { 80 | $PLUGIN_HOOKS['use_massive_action']['databases'] = 1; 81 | } 82 | 83 | if (class_exists('PluginDatabasesDatabase_Item')) { // only if plugin activated 84 | $PLUGIN_HOOKS['plugin_datainjection_populate']['databases'] = 'plugin_datainjection_populate_databases'; 85 | } 86 | 87 | // End init, when all types are registered 88 | $PLUGIN_HOOKS['post_init']['databases'] = 'plugin_databases_postinit'; 89 | 90 | // Import from Data_Injection plugin 91 | $PLUGIN_HOOKS['migratetypes']['databases'] = 'plugin_datainjection_migratetypes_databases'; 92 | } 93 | } 94 | 95 | // Get the name and the version of the plugin - Needed 96 | /** 97 | * @return array 98 | */ 99 | function plugin_version_databases() { 100 | 101 | return [ 102 | 'name' => _n('Database', 'Databases', 2, 'databases'), 103 | 'version' => PLUGIN_DATABASES_VERSION, 104 | 'author' => "Infotel", 105 | 'oldname' => 'sgbd', 106 | 'license' => 'GPLv2+', 107 | 'homepage' => 'https://github.com/InfotelGLPI/databases', 108 | 'requirements' => [ 109 | 'glpi' => [ 110 | 'min' => '9.5', 111 | 'dev' => false 112 | ] 113 | ] 114 | ]; 115 | } 116 | 117 | // Optional : check prerequisites before install : may print errors or add to message after redirect 118 | /** 119 | * @return bool 120 | */ 121 | function plugin_databases_check_prerequisites() { 122 | if (version_compare(GLPI_VERSION, '9.5', 'lt') 123 | || version_compare(GLPI_VERSION, '9.6', 'ge')) { 124 | if (method_exists('Plugin', 'messageIncompatible')) { 125 | echo Plugin::messageIncompatible('core', '9.5'); 126 | } 127 | return false; 128 | } 129 | return true; 130 | } 131 | 132 | // Uninstall process for plugin : need to return true if succeeded : may display messages or add to message after redirect 133 | /** 134 | * @return bool 135 | */ 136 | function plugin_databases_check_config() { 137 | return true; 138 | } 139 | 140 | /** 141 | * @param $types 142 | * 143 | * @return mixed 144 | */ 145 | function plugin_datainjection_migratetypes_databases($types) { 146 | $types[2400] = 'PluginDatabasesDatabase'; 147 | return $types; 148 | } 149 | -------------------------------------------------------------------------------- /sql/empty-1.1.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_sgbd`; 2 | CREATE TABLE `glpi_plugin_sgbd` ( 3 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 4 | `FK_entities` INT(11) NOT NULL DEFAULT '0', 5 | `recursive` TINYINT(1) NOT NULL DEFAULT '0', 6 | `name` VARCHAR(255) 7 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 8 | `type` INT(4) NOT NULL DEFAULT '0', 9 | `server` INT(4) NOT NULL DEFAULT '0', 10 | `FK_enterprise` SMALLINT(6) NOT NULL DEFAULT '0', 11 | `FK_glpi_enterprise` SMALLINT(6) NOT NULL DEFAULT '0', 12 | `location` INT(4) NOT NULL DEFAULT '0', 13 | `notes` LONGTEXT, 14 | `comment` VARCHAR(255) 15 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 16 | `deleted` SMALLINT(6) NOT NULL DEFAULT '0', 17 | PRIMARY KEY (`ID`) 18 | ) 19 | ENGINE = MyISAM 20 | DEFAULT CHARSET = utf8 21 | COLLATE = utf8_unicode_ci; 22 | 23 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_sgbd_type`; 24 | CREATE TABLE `glpi_dropdown_plugin_sgbd_type` ( 25 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 26 | `FK_entities` INT(11) NOT NULL DEFAULT '0', 27 | `name` VARCHAR(255) 28 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 29 | `comments` TEXT, 30 | PRIMARY KEY (`ID`), 31 | KEY `name` (`name`) 32 | ) 33 | ENGINE = MyISAM 34 | DEFAULT CHARSET = utf8 35 | COLLATE = utf8_unicode_ci; 36 | 37 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_sgbd_server_type`; 38 | CREATE TABLE `glpi_dropdown_plugin_sgbd_server_type` ( 39 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 40 | `name` VARCHAR(255) 41 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 42 | `comments` TEXT, 43 | PRIMARY KEY (`ID`), 44 | KEY `name` (`name`) 45 | ) 46 | ENGINE = MyISAM 47 | DEFAULT CHARSET = utf8 48 | COLLATE = utf8_unicode_ci; 49 | 50 | INSERT INTO `glpi_dropdown_plugin_sgbd_server_type` (`ID`, `name`, `comments`) VALUES ('1', 'Mysql', ''); 51 | INSERT INTO `glpi_dropdown_plugin_sgbd_server_type` (`ID`, `name`, `comments`) VALUES ('2', 'Oracle', ''); 52 | INSERT INTO `glpi_dropdown_plugin_sgbd_server_type` (`ID`, `name`, `comments`) VALUES ('3', 'SQL', ''); 53 | 54 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_sgbd_script_type`; 55 | CREATE TABLE `glpi_dropdown_plugin_sgbd_script_type` ( 56 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 57 | `name` VARCHAR(255) 58 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 59 | `comments` TEXT, 60 | PRIMARY KEY (`ID`), 61 | KEY `name` (`name`) 62 | ) 63 | ENGINE = MyISAM 64 | DEFAULT CHARSET = utf8 65 | COLLATE = utf8_unicode_ci; 66 | 67 | DROP TABLE IF EXISTS `glpi_plugin_sgbd_instances`; 68 | CREATE TABLE `glpi_plugin_sgbd_instances` ( 69 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 70 | `FK_sgbd` INT(11) NOT NULL DEFAULT '0', 71 | `name` VARCHAR(255) 72 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 73 | `port` INT(11) NOT NULL DEFAULT '0', 74 | `path` VARCHAR(255) 75 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 76 | PRIMARY KEY (`ID`) 77 | ) 78 | ENGINE = MyISAM 79 | DEFAULT CHARSET = utf8 80 | COLLATE = utf8_unicode_ci; 81 | 82 | DROP TABLE IF EXISTS `glpi_plugin_sgbd_scripts`; 83 | CREATE TABLE `glpi_plugin_sgbd_scripts` ( 84 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 85 | `FK_sgbd` INT(11) NOT NULL DEFAULT '0', 86 | `name` VARCHAR(255) 87 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 88 | `path` VARCHAR(255) 89 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 90 | `type` INT(11) NOT NULL DEFAULT '0', 91 | PRIMARY KEY (`ID`) 92 | ) 93 | ENGINE = MyISAM 94 | DEFAULT CHARSET = utf8 95 | COLLATE = utf8_unicode_ci; 96 | 97 | DROP TABLE IF EXISTS `glpi_plugin_sgbd_device`; 98 | CREATE TABLE `glpi_plugin_sgbd_device` ( 99 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 100 | `FK_sgbd` INT(11) NOT NULL DEFAULT '0', 101 | `FK_device` INT(11) NOT NULL DEFAULT '0', 102 | `device_type` INT(11) NOT NULL DEFAULT '0', 103 | PRIMARY KEY (`ID`), 104 | UNIQUE KEY `FK_sgbd` (`FK_sgbd`, `FK_device`, `device_type`), 105 | KEY `FK_sgbd_2` (`FK_sgbd`), 106 | KEY `FK_device` (`FK_device`, `device_type`) 107 | ) 108 | ENGINE = MyISAM 109 | DEFAULT CHARSET = utf8 110 | COLLATE = utf8_unicode_ci; 111 | 112 | DROP TABLE IF EXISTS `glpi_plugin_sgbd_profiles`; 113 | CREATE TABLE `glpi_plugin_sgbd_profiles` ( 114 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 115 | `name` VARCHAR(255) 116 | COLLATE utf8_unicode_ci DEFAULT NULL, 117 | `interface` VARCHAR(50) 118 | COLLATE utf8_unicode_ci NOT NULL DEFAULT 'sgbd', 119 | `is_default` SMALLINT(6) NOT NULL DEFAULT '0', 120 | `sgbd` CHAR(1) DEFAULT NULL, 121 | PRIMARY KEY (`ID`), 122 | KEY `interface` (`interface`) 123 | ) 124 | ENGINE = MyISAM 125 | DEFAULT CHARSET = utf8 126 | COLLATE = utf8_unicode_ci; 127 | 128 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '2400', '2', '2', '0'); 129 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '2400', '6', '3', '0'); 130 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '2400', '7', '4', '0'); -------------------------------------------------------------------------------- /sql/empty-1.2.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_sgbd`; 2 | CREATE TABLE `glpi_plugin_sgbd` ( 3 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 4 | `FK_entities` INT(11) NOT NULL DEFAULT '0', 5 | `recursive` TINYINT(1) NOT NULL DEFAULT '0', 6 | `name` VARCHAR(255) 7 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 8 | `category` INT(4) NOT NULL DEFAULT '0', 9 | `type` INT(4) NOT NULL DEFAULT '0', 10 | `FK_users` INT(4) NOT NULL DEFAULT '0', 11 | `FK_groups` INT(11) NOT NULL DEFAULT '0', 12 | `server` INT(4) NOT NULL DEFAULT '0', 13 | `FK_enterprise` SMALLINT(6) NOT NULL DEFAULT '0', 14 | `FK_glpi_enterprise` SMALLINT(6) NOT NULL DEFAULT '0', 15 | `location` INT(4) NOT NULL DEFAULT '0', 16 | `notes` LONGTEXT, 17 | `comment` VARCHAR(255) 18 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 19 | `deleted` SMALLINT(6) NOT NULL DEFAULT '0', 20 | PRIMARY KEY (`ID`) 21 | ) 22 | ENGINE = MyISAM 23 | DEFAULT CHARSET = utf8 24 | COLLATE = utf8_unicode_ci; 25 | 26 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_sgbd_type`; 27 | CREATE TABLE `glpi_dropdown_plugin_sgbd_type` ( 28 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 29 | `FK_entities` INT(11) NOT NULL DEFAULT '0', 30 | `name` VARCHAR(255) 31 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 32 | `comments` TEXT, 33 | PRIMARY KEY (`ID`), 34 | KEY `name` (`name`) 35 | ) 36 | ENGINE = MyISAM 37 | DEFAULT CHARSET = utf8 38 | COLLATE = utf8_unicode_ci; 39 | 40 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_sgbd_category`; 41 | CREATE TABLE `glpi_dropdown_plugin_sgbd_category` ( 42 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 43 | `FK_entities` INT(11) NOT NULL DEFAULT '0', 44 | `name` VARCHAR(255) 45 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 46 | `comments` TEXT, 47 | PRIMARY KEY (`ID`), 48 | KEY `name` (`name`) 49 | ) 50 | ENGINE = MyISAM 51 | DEFAULT CHARSET = utf8 52 | COLLATE = utf8_unicode_ci; 53 | 54 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_sgbd_server_type`; 55 | CREATE TABLE `glpi_dropdown_plugin_sgbd_server_type` ( 56 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 57 | `name` VARCHAR(255) 58 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 59 | `comments` TEXT, 60 | PRIMARY KEY (`ID`), 61 | KEY `name` (`name`) 62 | ) 63 | ENGINE = MyISAM 64 | DEFAULT CHARSET = utf8 65 | COLLATE = utf8_unicode_ci; 66 | 67 | INSERT INTO `glpi_dropdown_plugin_sgbd_server_type` (`ID`, `name`, `comments`) VALUES ('1', 'Mysql', ''); 68 | INSERT INTO `glpi_dropdown_plugin_sgbd_server_type` (`ID`, `name`, `comments`) VALUES ('2', 'Oracle', ''); 69 | INSERT INTO `glpi_dropdown_plugin_sgbd_server_type` (`ID`, `name`, `comments`) VALUES ('3', 'SQL', ''); 70 | 71 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_sgbd_script_type`; 72 | CREATE TABLE `glpi_dropdown_plugin_sgbd_script_type` ( 73 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 74 | `name` VARCHAR(255) 75 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 76 | `comments` TEXT, 77 | PRIMARY KEY (`ID`), 78 | KEY `name` (`name`) 79 | ) 80 | ENGINE = MyISAM 81 | DEFAULT CHARSET = utf8 82 | COLLATE = utf8_unicode_ci; 83 | 84 | DROP TABLE IF EXISTS `glpi_plugin_sgbd_instances`; 85 | CREATE TABLE `glpi_plugin_sgbd_instances` ( 86 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 87 | `FK_sgbd` INT(11) NOT NULL DEFAULT '0', 88 | `name` VARCHAR(255) 89 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 90 | `port` INT(11) NOT NULL DEFAULT '0', 91 | `path` VARCHAR(255) 92 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 93 | PRIMARY KEY (`ID`) 94 | ) 95 | ENGINE = MyISAM 96 | DEFAULT CHARSET = utf8 97 | COLLATE = utf8_unicode_ci; 98 | 99 | DROP TABLE IF EXISTS `glpi_plugin_sgbd_scripts`; 100 | CREATE TABLE `glpi_plugin_sgbd_scripts` ( 101 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 102 | `FK_sgbd` INT(11) NOT NULL DEFAULT '0', 103 | `name` VARCHAR(255) 104 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 105 | `path` VARCHAR(255) 106 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 107 | `type` INT(11) NOT NULL DEFAULT '0', 108 | PRIMARY KEY (`ID`) 109 | ) 110 | ENGINE = MyISAM 111 | DEFAULT CHARSET = utf8 112 | COLLATE = utf8_unicode_ci; 113 | 114 | DROP TABLE IF EXISTS `glpi_plugin_sgbd_device`; 115 | CREATE TABLE `glpi_plugin_sgbd_device` ( 116 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 117 | `FK_sgbd` INT(11) NOT NULL DEFAULT '0', 118 | `FK_device` INT(11) NOT NULL DEFAULT '0', 119 | `device_type` INT(11) NOT NULL DEFAULT '0', 120 | PRIMARY KEY (`ID`), 121 | UNIQUE KEY `FK_sgbd` (`FK_sgbd`, `FK_device`, `device_type`), 122 | KEY `FK_sgbd_2` (`FK_sgbd`), 123 | KEY `FK_device` (`FK_device`, `device_type`) 124 | ) 125 | ENGINE = MyISAM 126 | DEFAULT CHARSET = utf8 127 | COLLATE = utf8_unicode_ci; 128 | 129 | DROP TABLE IF EXISTS `glpi_plugin_sgbd_profiles`; 130 | CREATE TABLE `glpi_plugin_sgbd_profiles` ( 131 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 132 | `name` VARCHAR(255) 133 | COLLATE utf8_unicode_ci DEFAULT NULL, 134 | `sgbd` CHAR(1) DEFAULT NULL, 135 | `open_ticket` CHAR(1) DEFAULT NULL, 136 | PRIMARY KEY (`ID`), 137 | KEY `name` (`name`) 138 | ) 139 | ENGINE = MyISAM 140 | DEFAULT CHARSET = utf8 141 | COLLATE = utf8_unicode_ci; 142 | 143 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '2400', '2', '2', '0'); 144 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '2400', '6', '3', '0'); 145 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '2400', '7', '4', '0'); -------------------------------------------------------------------------------- /sql/empty-1.2.1.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_sgbd`; 2 | CREATE TABLE `glpi_plugin_sgbd` ( 3 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 4 | `FK_entities` INT(11) NOT NULL DEFAULT '0', 5 | `recursive` TINYINT(1) NOT NULL DEFAULT '0', 6 | `name` VARCHAR(255) 7 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 8 | `category` INT(4) NOT NULL DEFAULT '0', 9 | `type` INT(4) NOT NULL DEFAULT '0', 10 | `FK_users` INT(4) NOT NULL DEFAULT '0', 11 | `FK_groups` INT(11) NOT NULL DEFAULT '0', 12 | `server` INT(4) NOT NULL DEFAULT '0', 13 | `FK_enterprise` SMALLINT(6) NOT NULL DEFAULT '0', 14 | `FK_glpi_enterprise` SMALLINT(6) NOT NULL DEFAULT '0', 15 | `location` INT(4) NOT NULL DEFAULT '0', 16 | `notes` LONGTEXT, 17 | `comment` VARCHAR(255) 18 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 19 | `helpdesk_visible` INT(11) NOT NULL DEFAULT '1', 20 | `date_mod` DATETIME DEFAULT NULL, 21 | `deleted` SMALLINT(6) NOT NULL DEFAULT '0', 22 | PRIMARY KEY (`ID`) 23 | ) 24 | ENGINE = MyISAM 25 | DEFAULT CHARSET = utf8 26 | COLLATE = utf8_unicode_ci; 27 | 28 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_sgbd_type`; 29 | CREATE TABLE `glpi_dropdown_plugin_sgbd_type` ( 30 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 31 | `FK_entities` INT(11) NOT NULL DEFAULT '0', 32 | `name` VARCHAR(255) 33 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 34 | `comments` TEXT, 35 | PRIMARY KEY (`ID`), 36 | KEY `name` (`name`) 37 | ) 38 | ENGINE = MyISAM 39 | DEFAULT CHARSET = utf8 40 | COLLATE = utf8_unicode_ci; 41 | 42 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_sgbd_category`; 43 | CREATE TABLE `glpi_dropdown_plugin_sgbd_category` ( 44 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 45 | `FK_entities` INT(11) NOT NULL DEFAULT '0', 46 | `name` VARCHAR(255) 47 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 48 | `comments` TEXT, 49 | PRIMARY KEY (`ID`), 50 | KEY `name` (`name`) 51 | ) 52 | ENGINE = MyISAM 53 | DEFAULT CHARSET = utf8 54 | COLLATE = utf8_unicode_ci; 55 | 56 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_sgbd_server_type`; 57 | CREATE TABLE `glpi_dropdown_plugin_sgbd_server_type` ( 58 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 59 | `name` VARCHAR(255) 60 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 61 | `comments` TEXT, 62 | PRIMARY KEY (`ID`), 63 | KEY `name` (`name`) 64 | ) 65 | ENGINE = MyISAM 66 | DEFAULT CHARSET = utf8 67 | COLLATE = utf8_unicode_ci; 68 | 69 | INSERT INTO `glpi_dropdown_plugin_sgbd_server_type` (`ID`, `name`, `comments`) VALUES ('1', 'Mysql', ''); 70 | INSERT INTO `glpi_dropdown_plugin_sgbd_server_type` (`ID`, `name`, `comments`) VALUES ('2', 'Oracle', ''); 71 | INSERT INTO `glpi_dropdown_plugin_sgbd_server_type` (`ID`, `name`, `comments`) VALUES ('3', 'SQL', ''); 72 | 73 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_sgbd_script_type`; 74 | CREATE TABLE `glpi_dropdown_plugin_sgbd_script_type` ( 75 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 76 | `name` VARCHAR(255) 77 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 78 | `comments` TEXT, 79 | PRIMARY KEY (`ID`), 80 | KEY `name` (`name`) 81 | ) 82 | ENGINE = MyISAM 83 | DEFAULT CHARSET = utf8 84 | COLLATE = utf8_unicode_ci; 85 | 86 | DROP TABLE IF EXISTS `glpi_plugin_sgbd_instances`; 87 | CREATE TABLE `glpi_plugin_sgbd_instances` ( 88 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 89 | `FK_sgbd` INT(11) NOT NULL DEFAULT '0', 90 | `name` VARCHAR(255) 91 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 92 | `port` INT(11) NOT NULL DEFAULT '0', 93 | `path` VARCHAR(255) 94 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 95 | PRIMARY KEY (`ID`) 96 | ) 97 | ENGINE = MyISAM 98 | DEFAULT CHARSET = utf8 99 | COLLATE = utf8_unicode_ci; 100 | 101 | DROP TABLE IF EXISTS `glpi_plugin_sgbd_scripts`; 102 | CREATE TABLE `glpi_plugin_sgbd_scripts` ( 103 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 104 | `FK_sgbd` INT(11) NOT NULL DEFAULT '0', 105 | `name` VARCHAR(255) 106 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 107 | `path` VARCHAR(255) 108 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 109 | `type` INT(11) NOT NULL DEFAULT '0', 110 | PRIMARY KEY (`ID`) 111 | ) 112 | ENGINE = MyISAM 113 | DEFAULT CHARSET = utf8 114 | COLLATE = utf8_unicode_ci; 115 | 116 | DROP TABLE IF EXISTS `glpi_plugin_sgbd_device`; 117 | CREATE TABLE `glpi_plugin_sgbd_device` ( 118 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 119 | `FK_sgbd` INT(11) NOT NULL DEFAULT '0', 120 | `FK_device` INT(11) NOT NULL DEFAULT '0', 121 | `device_type` INT(11) NOT NULL DEFAULT '0', 122 | PRIMARY KEY (`ID`), 123 | UNIQUE KEY `FK_sgbd` (`FK_sgbd`, `FK_device`, `device_type`), 124 | KEY `FK_sgbd_2` (`FK_sgbd`), 125 | KEY `FK_device` (`FK_device`, `device_type`) 126 | ) 127 | ENGINE = MyISAM 128 | DEFAULT CHARSET = utf8 129 | COLLATE = utf8_unicode_ci; 130 | 131 | DROP TABLE IF EXISTS `glpi_plugin_sgbd_profiles`; 132 | CREATE TABLE `glpi_plugin_sgbd_profiles` ( 133 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 134 | `name` VARCHAR(255) 135 | COLLATE utf8_unicode_ci DEFAULT NULL, 136 | `sgbd` CHAR(1) DEFAULT NULL, 137 | `open_ticket` CHAR(1) DEFAULT NULL, 138 | PRIMARY KEY (`ID`), 139 | KEY `name` (`name`) 140 | ) 141 | ENGINE = MyISAM 142 | DEFAULT CHARSET = utf8 143 | COLLATE = utf8_unicode_ci; 144 | 145 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '2400', '2', '2', '0'); 146 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '2400', '6', '3', '0'); 147 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '2400', '7', '4', '0'); -------------------------------------------------------------------------------- /databases.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Databases Inventory 4 | databases 5 | stable 6 | https://raw.githubusercontent.com/InfotelGLPI/databases/master/databases.png 7 | 8 | 9 | -Inventaire des instances
-Inventaire des scripts]]>
10 | -Instances inventory
-Scripts inventory]]>
11 | -Inventář instancí
-Inventář skriptů]]>
12 |
13 | 14 | - Inventaire des instances
- Inventaire des scripts.
- Utilisable depuis le helpdesk
- Peut être intégré au plugin environment.]]>
15 | - Instances inventory
- Scripts inventory.
- Can be used with helpdesk
-Can be integrated into Environment plugin.]]>
16 | -Inventář instancí
-Inventář skriptů.
- Je možné použít se službou podpory
-Je možné začlenit do zásuvného modulu Prostředí.]]>
17 |
18 |
19 | https://github.com/InfotelGLPI/databases 20 | https://github.com/InfotelGLPI/databases/releases 21 | https://github.com/InfotelGLPI/databases/issues 22 | https://raw.githubusercontent.com/InfotelGLPI/databases/master/README.md 23 | 24 | Xavier Caillaud 25 | Infotel 26 | 27 | 28 | 29 | 2.3.2 30 | ~9.5 31 | https://github.com/InfotelGLPI/databases/releases/download/2.3.2/glpi-databases-2.3.2.tar.gz 32 | 33 | 34 | 2.3.1 35 | ~9.5 36 | https://github.com/InfotelGLPI/databases/releases/download/2.3.1/glpi-databases-2.3.1.tar.gz 37 | 38 | 39 | 2.3.0 40 | ~9.5 41 | 42 | 43 | 2.2.1 44 | 9.4 45 | 46 | 47 | 2.2.0 48 | 9.4 49 | 50 | 51 | 2.1.1 52 | 9.3 53 | 54 | 55 | 2.1.0 56 | 9.3 57 | 58 | 59 | 2.0.0 60 | 9.2 61 | 62 | 63 | 1.9.0 64 | 9.1 65 | 66 | 67 | 1.8.1 68 | 0.90 69 | 70 | 71 | 1.8.0 72 | 0.90 73 | 74 | 75 | 1.7.0 76 | 0.85.3 77 | 78 | 79 | 1.6.0 80 | 0.84 81 | 82 | 83 | 1.5.2 84 | 0.83.3 85 | 86 | 87 | 1.5.1 88 | 0.83 89 | 90 | 91 | 1.5.0 92 | 0.83 93 | 94 | 95 | 1.4.0 96 | 0.80 97 | 98 | 99 | 1.3.0 100 | 0.78 101 | 102 | 103 | 1.2.3 104 | 0.72 105 | 106 | 107 | 1.2.2 108 | 0.72 109 | 110 | 111 | 1.2.1 112 | 0.72 113 | 114 | 115 | 1.2.0 116 | 0.72 117 | 118 | 119 | 1.1.1 120 | 0.71 121 | 122 | 123 | 1.1 124 | 0.71 125 | 126 | 127 | 1.0 128 | 0.70 129 | 130 | 131 | 132 | fr_FR 133 | en_GB 134 | cs_CZ 135 | es_ES 136 | es_AR 137 | pl_PL 138 | pt_BR 139 | pt_PT 140 | ro_RO 141 | tr_TR 142 | 143 | 144 | 145 | 146 | Databases 147 | Inventaire 148 | Gestion 149 | 150 | 151 | Databases 152 | Inventory 153 | Management 154 | 155 | 156 | Databáze 157 | Inventura 158 | Správa 159 | 160 | 161 |
162 | -------------------------------------------------------------------------------- /sql/update-1.3.0.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `glpi_plugin_sgbd` 2 | RENAME `glpi_plugin_databases_databases`; 3 | ALTER TABLE `glpi_dropdown_plugin_sgbd_type` 4 | RENAME `glpi_plugin_databases_databasetypes`; 5 | ALTER TABLE `glpi_dropdown_plugin_sgbd_category` 6 | RENAME `glpi_plugin_databases_databasecategories`; 7 | ALTER TABLE `glpi_dropdown_plugin_sgbd_server_type` 8 | RENAME `glpi_plugin_databases_servertypes`; 9 | ALTER TABLE `glpi_dropdown_plugin_sgbd_script_type` 10 | RENAME `glpi_plugin_databases_scripttypes`; 11 | ALTER TABLE `glpi_plugin_sgbd_instances` 12 | RENAME `glpi_plugin_databases_instances`; 13 | ALTER TABLE `glpi_plugin_sgbd_scripts` 14 | RENAME `glpi_plugin_databases_scripts`; 15 | ALTER TABLE `glpi_plugin_sgbd_device` 16 | RENAME `glpi_plugin_databases_databases_items`; 17 | ALTER TABLE `glpi_plugin_sgbd_profiles` 18 | RENAME `glpi_plugin_databases_profiles`; 19 | 20 | ALTER TABLE `glpi_plugin_databases_databases` 21 | CHANGE `ID` `id` INT(11) NOT NULL AUTO_INCREMENT, 22 | CHANGE `name` `name` VARCHAR(255) 23 | COLLATE utf8_unicode_ci DEFAULT NULL, 24 | CHANGE `FK_entities` `entities_id` INT(11) NOT NULL DEFAULT '0', 25 | CHANGE `recursive` `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 26 | CHANGE `category` `plugin_databases_databasecategories_id` INT(11) NOT NULL DEFAULT '0' 27 | COMMENT 'RELATION to glpi_plugin_databases_databasecategories (id)', 28 | CHANGE `type` `plugin_databases_databasetypes_id` INT(11) NOT NULL DEFAULT '0' 29 | COMMENT 'RELATION to glpi_plugin_databases_databasetypes (id)', 30 | CHANGE `FK_users` `users_id` INT(11) NOT NULL DEFAULT '0' 31 | COMMENT 'RELATION to glpi_users (id)', 32 | CHANGE `FK_groups` `groups_id` INT(11) NOT NULL DEFAULT '0' 33 | COMMENT 'RELATION to glpi_groups (id)', 34 | CHANGE `server` `plugin_databases_servertypes_id` INT(11) NOT NULL DEFAULT '0' 35 | COMMENT 'RELATION to glpi_plugin_databases_servertypes (id)', 36 | CHANGE `FK_enterprise` `suppliers_id` INT(11) NOT NULL DEFAULT '0' 37 | COMMENT 'RELATION to glpi_suppliers (id)', 38 | CHANGE `FK_glpi_enterprise` `manufacturers_id` INT(11) NOT NULL DEFAULT '0' 39 | COMMENT 'RELATION to glpi_manufacturers (id)', 40 | CHANGE `location` `locations_id` INT(11) NOT NULL DEFAULT '0' 41 | COMMENT 'RELATION to glpi_locations (id)', 42 | CHANGE `helpdesk_visible` `is_helpdesk_visible` INT(11) NOT NULL DEFAULT '1', 43 | CHANGE `notes` `notepad` LONGTEXT COLLATE utf8_unicode_ci, 44 | CHANGE `comment` `comment` TEXT COLLATE utf8_unicode_ci, 45 | CHANGE `deleted` `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', 46 | ADD INDEX (`name`), 47 | ADD INDEX (`entities_id`), 48 | ADD INDEX (`plugin_databases_databasecategories_id`), 49 | ADD INDEX (`plugin_databases_databasetypes_id`), 50 | ADD INDEX (`plugin_databases_servertypes_id`), 51 | ADD INDEX (`users_id`), 52 | ADD INDEX (`groups_id`), 53 | ADD INDEX (`suppliers_id`), 54 | ADD INDEX (`manufacturers_id`), 55 | ADD INDEX (`locations_id`), 56 | ADD INDEX (`date_mod`), 57 | ADD INDEX (`is_helpdesk_visible`), 58 | ADD INDEX (`is_deleted`); 59 | 60 | ALTER TABLE `glpi_plugin_databases_databasetypes` 61 | CHANGE `ID` `id` INT(11) NOT NULL AUTO_INCREMENT, 62 | CHANGE `FK_entities` `entities_id` INT(11) NOT NULL DEFAULT '0', 63 | CHANGE `name` `name` VARCHAR(255) 64 | COLLATE utf8_unicode_ci DEFAULT NULL, 65 | CHANGE `comments` `comment` TEXT COLLATE utf8_unicode_ci; 66 | 67 | ALTER TABLE `glpi_plugin_databases_databasecategories` 68 | CHANGE `ID` `id` INT(11) NOT NULL AUTO_INCREMENT, 69 | CHANGE `FK_entities` `entities_id` INT(11) NOT NULL DEFAULT '0', 70 | CHANGE `name` `name` VARCHAR(255) 71 | COLLATE utf8_unicode_ci DEFAULT NULL, 72 | CHANGE `comments` `comment` TEXT COLLATE utf8_unicode_ci; 73 | 74 | ALTER TABLE `glpi_plugin_databases_servertypes` 75 | CHANGE `ID` `id` INT(11) NOT NULL AUTO_INCREMENT, 76 | CHANGE `name` `name` VARCHAR(255) 77 | COLLATE utf8_unicode_ci DEFAULT NULL, 78 | CHANGE `comments` `comment` TEXT COLLATE utf8_unicode_ci; 79 | 80 | ALTER TABLE `glpi_plugin_databases_scripttypes` 81 | CHANGE `ID` `id` INT(11) NOT NULL AUTO_INCREMENT, 82 | CHANGE `name` `name` VARCHAR(255) 83 | COLLATE utf8_unicode_ci DEFAULT NULL, 84 | CHANGE `comments` `comment` TEXT COLLATE utf8_unicode_ci; 85 | 86 | ALTER TABLE `glpi_plugin_databases_instances` 87 | CHANGE `ID` `id` INT(11) NOT NULL AUTO_INCREMENT, 88 | ADD `entities_id` INT(11) NOT NULL DEFAULT '0', 89 | ADD `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 90 | CHANGE `FK_sgbd` `plugin_databases_databases_id` INT(11) NOT NULL DEFAULT '0' 91 | COMMENT 'RELATION to glpi_plugin_databases_databases (id)', 92 | CHANGE `name` `name` VARCHAR(255) 93 | COLLATE utf8_unicode_ci DEFAULT NULL, 94 | CHANGE `path` `path` VARCHAR(255) 95 | COLLATE utf8_unicode_ci DEFAULT NULL, 96 | ADD `comment` TEXT COLLATE utf8_unicode_ci, 97 | ADD INDEX (`name`), 98 | ADD INDEX (`plugin_databases_databases_id`); 99 | 100 | ALTER TABLE `glpi_plugin_databases_scripts` 101 | CHANGE `ID` `id` INT(11) NOT NULL AUTO_INCREMENT, 102 | ADD `entities_id` INT(11) NOT NULL DEFAULT '0', 103 | ADD `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 104 | CHANGE `FK_sgbd` `plugin_databases_databases_id` INT(11) NOT NULL DEFAULT '0' 105 | COMMENT 'RELATION to glpi_plugin_databases_databases (id)', 106 | CHANGE `type` `plugin_databases_scripttypes_id` INT(11) NOT NULL DEFAULT '0' 107 | COMMENT 'RELATION to glpi_plugin_databases_scripttypes (id)', 108 | CHANGE `name` `name` VARCHAR(255) 109 | COLLATE utf8_unicode_ci DEFAULT NULL, 110 | CHANGE `path` `path` VARCHAR(255) 111 | COLLATE utf8_unicode_ci DEFAULT NULL, 112 | ADD `comment` TEXT COLLATE utf8_unicode_ci, 113 | ADD INDEX (`name`), 114 | ADD INDEX (`plugin_databases_databases_id`), 115 | ADD INDEX (`plugin_databases_scripttypes_id`); 116 | 117 | ALTER TABLE `glpi_plugin_databases_databases_items` 118 | CHANGE `ID` `id` INT(11) NOT NULL AUTO_INCREMENT, 119 | CHANGE `FK_sgbd` `plugin_databases_databases_id` INT(11) NOT NULL DEFAULT '0', 120 | CHANGE `FK_device` `items_id` INT(11) NOT NULL DEFAULT '0' 121 | COMMENT 'RELATION to various tables, according to itemtype (id)', 122 | CHANGE `device_type` `itemtype` VARCHAR(100) 123 | COLLATE utf8_unicode_ci NOT NULL 124 | COMMENT 'see .class.php file', 125 | DROP INDEX `FK_sgbd`, 126 | DROP INDEX `FK_sgbd_2`, 127 | DROP INDEX `FK_device`, 128 | ADD UNIQUE `unicity` (`plugin_databases_databases_id`, `itemtype`, `items_id`), 129 | ADD INDEX `FK_device` (`items_id`, `itemtype`), 130 | ADD INDEX `item` (`itemtype`, `items_id`); 131 | 132 | ALTER TABLE `glpi_plugin_databases_profiles` 133 | CHANGE `ID` `id` INT(11) NOT NULL AUTO_INCREMENT, 134 | ADD `profiles_id` INT(11) NOT NULL DEFAULT '0' 135 | COMMENT 'RELATION to glpi_profiles (id)', 136 | CHANGE `sgbd` `databases` CHAR(1) 137 | COLLATE utf8_unicode_ci DEFAULT NULL, 138 | CHANGE `open_ticket` `open_ticket` CHAR(1) 139 | COLLATE utf8_unicode_ci DEFAULT NULL, 140 | ADD INDEX (`profiles_id`); -------------------------------------------------------------------------------- /sql/empty-2.1.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_databases_databases`; 2 | CREATE TABLE `glpi_plugin_databases_databases` ( 3 | `id` INT(11) NOT NULL AUTO_INCREMENT, 4 | `entities_id` INT(11) NOT NULL DEFAULT '0', 5 | `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 6 | `name` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 7 | `plugin_databases_databasecategories_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_plugin_databases_databasecategories (id)', 8 | `plugin_databases_databasetypes_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_plugin_databases_databasetypes (id)', 9 | `users_id_tech` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_users (id)', 10 | `groups_id_tech` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_groups (id)', 11 | `plugin_databases_servertypes_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_plugin_databases_servertypes (id)', 12 | `suppliers_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_suppliers (id)', 13 | `manufacturers_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_manufacturers (id)', 14 | `locations_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_locations (id)', 15 | `comment` TEXT COLLATE utf8_unicode_ci, 16 | `is_helpdesk_visible` INT(11) NOT NULL DEFAULT '1', 17 | `date_mod` DATETIME DEFAULT NULL, 18 | `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', 19 | PRIMARY KEY (`id`), 20 | KEY `name` (`name`), 21 | KEY `entities_id` (`entities_id`), 22 | KEY `plugin_databases_databasecategories_id` (`plugin_databases_databasecategories_id`), 23 | KEY `plugin_databases_databasetypes_id` (`plugin_databases_databasetypes_id`), 24 | KEY `plugin_databases_servertypes_id` (`plugin_databases_servertypes_id`), 25 | KEY `users_id_tech` (`users_id_tech`), 26 | KEY `groups_id_tech` (`groups_id_tech`), 27 | KEY `suppliers_id` (`suppliers_id`), 28 | KEY `manufacturers_id` (`manufacturers_id`), 29 | KEY `locations_id` (`locations_id`), 30 | KEY date_mod (date_mod), 31 | KEY is_helpdesk_visible (is_helpdesk_visible), 32 | KEY `is_deleted` (`is_deleted`) 33 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 34 | 35 | DROP TABLE IF EXISTS `glpi_plugin_databases_databasetypes`; 36 | CREATE TABLE `glpi_plugin_databases_databasetypes` ( 37 | `id` INT(11) NOT NULL AUTO_INCREMENT, 38 | `entities_id` INT(11) NOT NULL DEFAULT '0', 39 | `name` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 40 | `comment` TEXT COLLATE utf8_unicode_ci, 41 | PRIMARY KEY (`id`), 42 | KEY `name` (`name`) 43 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 44 | 45 | DROP TABLE IF EXISTS `glpi_plugin_databases_databasecategories`; 46 | CREATE TABLE `glpi_plugin_databases_databasecategories` ( 47 | `id` INT(11) NOT NULL AUTO_INCREMENT, 48 | `entities_id` INT(11) NOT NULL DEFAULT '0', 49 | `name` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 50 | `comment` TEXT COLLATE utf8_unicode_ci, 51 | PRIMARY KEY (`id`), 52 | KEY `name` (`name`) 53 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 54 | 55 | DROP TABLE IF EXISTS `glpi_plugin_databases_servertypes`; 56 | CREATE TABLE `glpi_plugin_databases_servertypes` ( 57 | `id` INT(11) NOT NULL AUTO_INCREMENT, 58 | `name` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 59 | `comment` TEXT COLLATE utf8_unicode_ci, 60 | PRIMARY KEY (`id`), 61 | KEY `name` (`name`) 62 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 63 | 64 | INSERT INTO `glpi_plugin_databases_servertypes` VALUES ('1', 'Mysql', ''); 65 | INSERT INTO `glpi_plugin_databases_servertypes` VALUES ('2', 'Oracle', ''); 66 | INSERT INTO `glpi_plugin_databases_servertypes` VALUES ('3', 'SQL', ''); 67 | 68 | DROP TABLE IF EXISTS `glpi_plugin_databases_scripttypes`; 69 | CREATE TABLE `glpi_plugin_databases_scripttypes` ( 70 | `id` INT(11) NOT NULL AUTO_INCREMENT, 71 | `name` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 72 | `comment` TEXT COLLATE utf8_unicode_ci, 73 | PRIMARY KEY (`id`), 74 | KEY `name` (`name`) 75 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 76 | 77 | DROP TABLE IF EXISTS `glpi_plugin_databases_instances`; 78 | CREATE TABLE `glpi_plugin_databases_instances` ( 79 | `id` INT(11) NOT NULL AUTO_INCREMENT, 80 | `entities_id` INT(11) NOT NULL DEFAULT '0', 81 | `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 82 | `plugin_databases_databases_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_plugin_databases_databases (id)', 83 | `name` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 84 | `port` INT(11) NOT NULL DEFAULT '0', 85 | `path` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 86 | `comment` TEXT COLLATE utf8_unicode_ci, 87 | PRIMARY KEY (`id`), 88 | KEY `name` (`name`), 89 | KEY `plugin_databases_databases_id` (`plugin_databases_databases_id`) 90 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 91 | 92 | DROP TABLE IF EXISTS `glpi_plugin_databases_scripts`; 93 | CREATE TABLE `glpi_plugin_databases_scripts` ( 94 | `id` INT(11) NOT NULL AUTO_INCREMENT, 95 | `entities_id` INT(11) NOT NULL DEFAULT '0', 96 | `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 97 | `plugin_databases_databases_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_plugin_databases_databases (id)', 98 | `plugin_databases_scripttypes_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_plugin_databases_scripttypes (id)', 99 | `name` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 100 | `port` INT(11) NOT NULL DEFAULT '0', 101 | `path` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 102 | `comment` TEXT COLLATE utf8_unicode_ci, 103 | PRIMARY KEY (`id`), 104 | KEY `name` (`name`), 105 | KEY `plugin_databases_databases_id` (`plugin_databases_databases_id`), 106 | KEY `plugin_databases_scripttypes_id` (`plugin_databases_scripttypes_id`) 107 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 108 | 109 | DROP TABLE IF EXISTS `glpi_plugin_databases_databases_items`; 110 | CREATE TABLE `glpi_plugin_databases_databases_items` ( 111 | `id` INT(11) NOT NULL AUTO_INCREMENT, 112 | `plugin_databases_databases_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_plugin_databases_databases (id)', 113 | `items_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to various tables, according to itemtype (id)', 114 | `itemtype` VARCHAR(100) COLLATE utf8_unicode_ci NOT NULL COMMENT 'see .class.php file', 115 | PRIMARY KEY (`id`), 116 | UNIQUE KEY `unicity` (`plugin_databases_databases_id`, `items_id`, `itemtype`), 117 | KEY `FK_device` (`items_id`, `itemtype`), 118 | KEY `item` (`itemtype`, `items_id`) 119 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 120 | 121 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginDatabasesDatabase', '2', '2', '0'); 122 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginDatabasesDatabase', '6', '3', '0'); 123 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginDatabasesDatabase', '7', '4', '0'); -------------------------------------------------------------------------------- /sql/empty-2.2.2.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_databases_databases`; 2 | CREATE TABLE `glpi_plugin_databases_databases` ( 3 | `id` INT(11) NOT NULL AUTO_INCREMENT, 4 | `entities_id` INT(11) NOT NULL DEFAULT '0', 5 | `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 6 | `name` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 7 | `plugin_databases_databasecategories_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_plugin_databases_databasecategories (id)', 8 | `plugin_databases_databasetypes_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_plugin_databases_databasetypes (id)', 9 | `users_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_users (id)', 10 | `groups_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_groups (id)', 11 | `plugin_databases_servertypes_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_plugin_databases_servertypes (id)', 12 | `suppliers_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_suppliers (id)', 13 | `manufacturers_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_manufacturers (id)', 14 | `locations_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_locations (id)', 15 | `comment` TEXT COLLATE utf8_unicode_ci, 16 | `link` VARCHAR(255) NOT NULL DEFAULT '', 17 | `is_helpdesk_visible` INT(11) NOT NULL DEFAULT '1', 18 | `date_mod` DATETIME DEFAULT NULL, 19 | `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', 20 | PRIMARY KEY (`id`), 21 | KEY `name` (`name`), 22 | KEY `entities_id` (`entities_id`), 23 | KEY `plugin_databases_databasecategories_id` (`plugin_databases_databasecategories_id`), 24 | KEY `plugin_databases_databasetypes_id` (`plugin_databases_databasetypes_id`), 25 | KEY `plugin_databases_servertypes_id` (`plugin_databases_servertypes_id`), 26 | KEY `users_id` (`users_id`), 27 | KEY `groups_id` (`groups_id`), 28 | KEY `suppliers_id` (`suppliers_id`), 29 | KEY `manufacturers_id` (`manufacturers_id`), 30 | KEY `locations_id` (`locations_id`), 31 | KEY date_mod (date_mod), 32 | KEY is_helpdesk_visible (is_helpdesk_visible), 33 | KEY `is_deleted` (`is_deleted`) 34 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 35 | 36 | DROP TABLE IF EXISTS `glpi_plugin_databases_databasetypes`; 37 | CREATE TABLE `glpi_plugin_databases_databasetypes` ( 38 | `id` INT(11) NOT NULL AUTO_INCREMENT, 39 | `entities_id` INT(11) NOT NULL DEFAULT '0', 40 | `name` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 41 | `comment` TEXT COLLATE utf8_unicode_ci, 42 | PRIMARY KEY (`id`), 43 | KEY `name` (`name`) 44 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 45 | 46 | DROP TABLE IF EXISTS `glpi_plugin_databases_databasecategories`; 47 | CREATE TABLE `glpi_plugin_databases_databasecategories` ( 48 | `id` INT(11) NOT NULL AUTO_INCREMENT, 49 | `entities_id` INT(11) NOT NULL DEFAULT '0', 50 | `name` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 51 | `comment` TEXT COLLATE utf8_unicode_ci, 52 | PRIMARY KEY (`id`), 53 | KEY `name` (`name`) 54 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 55 | 56 | DROP TABLE IF EXISTS `glpi_plugin_databases_servertypes`; 57 | CREATE TABLE `glpi_plugin_databases_servertypes` ( 58 | `id` INT(11) NOT NULL AUTO_INCREMENT, 59 | `name` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 60 | `comment` TEXT COLLATE utf8_unicode_ci, 61 | PRIMARY KEY (`id`), 62 | KEY `name` (`name`) 63 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 64 | 65 | INSERT INTO `glpi_plugin_databases_servertypes` VALUES ('1', 'Mysql', ''); 66 | INSERT INTO `glpi_plugin_databases_servertypes` VALUES ('2', 'Oracle', ''); 67 | INSERT INTO `glpi_plugin_databases_servertypes` VALUES ('3', 'SQL', ''); 68 | 69 | DROP TABLE IF EXISTS `glpi_plugin_databases_scripttypes`; 70 | CREATE TABLE `glpi_plugin_databases_scripttypes` ( 71 | `id` INT(11) NOT NULL AUTO_INCREMENT, 72 | `name` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 73 | `comment` TEXT COLLATE utf8_unicode_ci, 74 | PRIMARY KEY (`id`), 75 | KEY `name` (`name`) 76 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 77 | 78 | DROP TABLE IF EXISTS `glpi_plugin_databases_instances`; 79 | CREATE TABLE `glpi_plugin_databases_instances` ( 80 | `id` INT(11) NOT NULL AUTO_INCREMENT, 81 | `entities_id` INT(11) NOT NULL DEFAULT '0', 82 | `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 83 | `plugin_databases_databases_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_plugin_databases_databases (id)', 84 | `name` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 85 | `port` INT(11) NOT NULL DEFAULT '0', 86 | `path` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 87 | `comment` TEXT COLLATE utf8_unicode_ci, 88 | PRIMARY KEY (`id`), 89 | KEY `name` (`name`), 90 | KEY `plugin_databases_databases_id` (`plugin_databases_databases_id`) 91 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 92 | 93 | DROP TABLE IF EXISTS `glpi_plugin_databases_scripts`; 94 | CREATE TABLE `glpi_plugin_databases_scripts` ( 95 | `id` INT(11) NOT NULL AUTO_INCREMENT, 96 | `entities_id` INT(11) NOT NULL DEFAULT '0', 97 | `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 98 | `plugin_databases_databases_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_plugin_databases_databases (id)', 99 | `plugin_databases_scripttypes_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_plugin_databases_scripttypes (id)', 100 | `name` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 101 | `port` INT(11) NOT NULL DEFAULT '0', 102 | `path` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 103 | `comment` TEXT COLLATE utf8_unicode_ci, 104 | PRIMARY KEY (`id`), 105 | KEY `name` (`name`), 106 | KEY `plugin_databases_databases_id` (`plugin_databases_databases_id`), 107 | KEY `plugin_databases_scripttypes_id` (`plugin_databases_scripttypes_id`) 108 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 109 | 110 | DROP TABLE IF EXISTS `glpi_plugin_databases_databases_items`; 111 | CREATE TABLE `glpi_plugin_databases_databases_items` ( 112 | `id` INT(11) NOT NULL AUTO_INCREMENT, 113 | `plugin_databases_databases_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_plugin_databases_databases (id)', 114 | `items_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to various tables, according to itemtype (id)', 115 | `itemtype` VARCHAR(100) COLLATE utf8_unicode_ci NOT NULL COMMENT 'see .class.php file', 116 | PRIMARY KEY (`id`), 117 | UNIQUE KEY `unicity` (`plugin_databases_databases_id`, `items_id`, `itemtype`), 118 | KEY `FK_device` (`items_id`, `itemtype`), 119 | KEY `item` (`itemtype`, `items_id`) 120 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 121 | 122 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginDatabasesDatabase', '2', '2', '0'); 123 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginDatabasesDatabase', '6', '3', '0'); 124 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginDatabasesDatabase', '7', '4', '0'); -------------------------------------------------------------------------------- /sql/empty-2.3.2.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_databases_databases`; 2 | CREATE TABLE `glpi_plugin_databases_databases` ( 3 | `id` INT(11) NOT NULL AUTO_INCREMENT, 4 | `entities_id` INT(11) NOT NULL DEFAULT '0', 5 | `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 6 | `name` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 7 | `plugin_databases_databasecategories_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_plugin_databases_databasecategories (id)', 8 | `plugin_databases_databasetypes_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_plugin_databases_databasetypes (id)', 9 | `users_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_users (id)', 10 | `groups_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_groups (id)', 11 | `plugin_databases_servertypes_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_plugin_databases_servertypes (id)', 12 | `suppliers_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_suppliers (id)', 13 | `manufacturers_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_manufacturers (id)', 14 | `locations_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_locations (id)', 15 | `comment` TEXT COLLATE utf8_unicode_ci, 16 | `link` VARCHAR(255) NOT NULL DEFAULT '', 17 | `is_helpdesk_visible` INT(11) NOT NULL DEFAULT '1', 18 | `date_mod` timestamp NULL DEFAULT NULL, 19 | `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', 20 | PRIMARY KEY (`id`), 21 | KEY `name` (`name`), 22 | KEY `entities_id` (`entities_id`), 23 | KEY `plugin_databases_databasecategories_id` (`plugin_databases_databasecategories_id`), 24 | KEY `plugin_databases_databasetypes_id` (`plugin_databases_databasetypes_id`), 25 | KEY `plugin_databases_servertypes_id` (`plugin_databases_servertypes_id`), 26 | KEY `users_id` (`users_id`), 27 | KEY `groups_id` (`groups_id`), 28 | KEY `suppliers_id` (`suppliers_id`), 29 | KEY `manufacturers_id` (`manufacturers_id`), 30 | KEY `locations_id` (`locations_id`), 31 | KEY date_mod (date_mod), 32 | KEY is_helpdesk_visible (is_helpdesk_visible), 33 | KEY `is_deleted` (`is_deleted`) 34 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 35 | 36 | DROP TABLE IF EXISTS `glpi_plugin_databases_databasetypes`; 37 | CREATE TABLE `glpi_plugin_databases_databasetypes` ( 38 | `id` INT(11) NOT NULL AUTO_INCREMENT, 39 | `entities_id` INT(11) NOT NULL DEFAULT '0', 40 | `name` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 41 | `comment` TEXT COLLATE utf8_unicode_ci, 42 | PRIMARY KEY (`id`), 43 | KEY `name` (`name`) 44 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 45 | 46 | DROP TABLE IF EXISTS `glpi_plugin_databases_databasecategories`; 47 | CREATE TABLE `glpi_plugin_databases_databasecategories` ( 48 | `id` INT(11) NOT NULL AUTO_INCREMENT, 49 | `entities_id` INT(11) NOT NULL DEFAULT '0', 50 | `name` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 51 | `comment` TEXT COLLATE utf8_unicode_ci, 52 | PRIMARY KEY (`id`), 53 | KEY `name` (`name`) 54 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 55 | 56 | DROP TABLE IF EXISTS `glpi_plugin_databases_servertypes`; 57 | CREATE TABLE `glpi_plugin_databases_servertypes` ( 58 | `id` INT(11) NOT NULL AUTO_INCREMENT, 59 | `name` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 60 | `comment` TEXT COLLATE utf8_unicode_ci, 61 | PRIMARY KEY (`id`), 62 | KEY `name` (`name`) 63 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 64 | 65 | INSERT INTO `glpi_plugin_databases_servertypes` VALUES ('1', 'Mysql', ''); 66 | INSERT INTO `glpi_plugin_databases_servertypes` VALUES ('2', 'Oracle', ''); 67 | INSERT INTO `glpi_plugin_databases_servertypes` VALUES ('3', 'SQL', ''); 68 | 69 | DROP TABLE IF EXISTS `glpi_plugin_databases_scripttypes`; 70 | CREATE TABLE `glpi_plugin_databases_scripttypes` ( 71 | `id` INT(11) NOT NULL AUTO_INCREMENT, 72 | `name` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 73 | `comment` TEXT COLLATE utf8_unicode_ci, 74 | PRIMARY KEY (`id`), 75 | KEY `name` (`name`) 76 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 77 | 78 | DROP TABLE IF EXISTS `glpi_plugin_databases_instances`; 79 | CREATE TABLE `glpi_plugin_databases_instances` ( 80 | `id` INT(11) NOT NULL AUTO_INCREMENT, 81 | `entities_id` INT(11) NOT NULL DEFAULT '0', 82 | `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 83 | `plugin_databases_databases_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_plugin_databases_databases (id)', 84 | `name` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 85 | `port` INT(11) NOT NULL DEFAULT '0', 86 | `path` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 87 | `comment` TEXT COLLATE utf8_unicode_ci, 88 | PRIMARY KEY (`id`), 89 | KEY `name` (`name`), 90 | KEY `plugin_databases_databases_id` (`plugin_databases_databases_id`) 91 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 92 | 93 | DROP TABLE IF EXISTS `glpi_plugin_databases_scripts`; 94 | CREATE TABLE `glpi_plugin_databases_scripts` ( 95 | `id` INT(11) NOT NULL AUTO_INCREMENT, 96 | `entities_id` INT(11) NOT NULL DEFAULT '0', 97 | `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 98 | `plugin_databases_databases_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_plugin_databases_databases (id)', 99 | `plugin_databases_scripttypes_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_plugin_databases_scripttypes (id)', 100 | `name` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 101 | `port` INT(11) NOT NULL DEFAULT '0', 102 | `path` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 103 | `comment` TEXT COLLATE utf8_unicode_ci, 104 | PRIMARY KEY (`id`), 105 | KEY `name` (`name`), 106 | KEY `plugin_databases_databases_id` (`plugin_databases_databases_id`), 107 | KEY `plugin_databases_scripttypes_id` (`plugin_databases_scripttypes_id`) 108 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 109 | 110 | DROP TABLE IF EXISTS `glpi_plugin_databases_databases_items`; 111 | CREATE TABLE `glpi_plugin_databases_databases_items` ( 112 | `id` INT(11) NOT NULL AUTO_INCREMENT, 113 | `plugin_databases_databases_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_plugin_databases_databases (id)', 114 | `items_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to various tables, according to itemtype (id)', 115 | `itemtype` VARCHAR(100) COLLATE utf8_unicode_ci NOT NULL COMMENT 'see .class.php file', 116 | PRIMARY KEY (`id`), 117 | UNIQUE KEY `unicity` (`plugin_databases_databases_id`, `items_id`, `itemtype`), 118 | KEY `FK_device` (`items_id`, `itemtype`), 119 | KEY `item` (`itemtype`, `items_id`) 120 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; 121 | 122 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginDatabasesDatabase', '2', '2', '0'); 123 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginDatabasesDatabase', '6', '3', '0'); 124 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginDatabasesDatabase', '7', '4', '0'); 125 | -------------------------------------------------------------------------------- /sql/empty-1.7.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_databases_databases`; 2 | CREATE TABLE `glpi_plugin_databases_databases` ( 3 | `id` INT(11) NOT NULL AUTO_INCREMENT, 4 | `entities_id` INT(11) NOT NULL DEFAULT '0', 5 | `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 6 | `name` VARCHAR(255) 7 | COLLATE utf8_unicode_ci DEFAULT NULL, 8 | `plugin_databases_databasecategories_id` INT(11) NOT NULL DEFAULT '0' 9 | COMMENT 'RELATION to glpi_plugin_databases_databasecategories (id)', 10 | `plugin_databases_databasetypes_id` INT(11) NOT NULL DEFAULT '0' 11 | COMMENT 'RELATION to glpi_plugin_databases_databasetypes (id)', 12 | `users_id_tech` INT(11) NOT NULL DEFAULT '0' 13 | COMMENT 'RELATION to glpi_users (id)', 14 | `groups_id_tech` INT(11) NOT NULL DEFAULT '0' 15 | COMMENT 'RELATION to glpi_groups (id)', 16 | `plugin_databases_servertypes_id` INT(11) NOT NULL DEFAULT '0' 17 | COMMENT 'RELATION to glpi_plugin_databases_servertypes (id)', 18 | `suppliers_id` INT(11) NOT NULL DEFAULT '0' 19 | COMMENT 'RELATION to glpi_suppliers (id)', 20 | `manufacturers_id` INT(11) NOT NULL DEFAULT '0' 21 | COMMENT 'RELATION to glpi_manufacturers (id)', 22 | `locations_id` INT(11) NOT NULL DEFAULT '0' 23 | COMMENT 'RELATION to glpi_locations (id)', 24 | `comment` TEXT COLLATE utf8_unicode_ci, 25 | `is_helpdesk_visible` INT(11) NOT NULL DEFAULT '1', 26 | `date_mod` DATETIME DEFAULT NULL, 27 | `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', 28 | PRIMARY KEY (`id`), 29 | KEY `name` (`name`), 30 | KEY `entities_id` (`entities_id`), 31 | KEY `plugin_databases_databasecategories_id` (`plugin_databases_databasecategories_id`), 32 | KEY `plugin_databases_databasetypes_id` (`plugin_databases_databasetypes_id`), 33 | KEY `plugin_databases_servertypes_id` (`plugin_databases_servertypes_id`), 34 | KEY `users_id_tech` (`users_id_tech`), 35 | KEY `groups_id_tech` (`groups_id_tech`), 36 | KEY `suppliers_id` (`suppliers_id`), 37 | KEY `manufacturers_id` (`manufacturers_id`), 38 | KEY `locations_id` (`locations_id`), 39 | KEY date_mod (date_mod), 40 | KEY is_helpdesk_visible (is_helpdesk_visible), 41 | KEY `is_deleted` (`is_deleted`) 42 | ) 43 | ENGINE = MyISAM 44 | DEFAULT CHARSET = utf8 45 | COLLATE = utf8_unicode_ci; 46 | 47 | DROP TABLE IF EXISTS `glpi_plugin_databases_databasetypes`; 48 | CREATE TABLE `glpi_plugin_databases_databasetypes` ( 49 | `id` INT(11) NOT NULL AUTO_INCREMENT, 50 | `entities_id` INT(11) NOT NULL DEFAULT '0', 51 | `name` VARCHAR(255) 52 | COLLATE utf8_unicode_ci DEFAULT NULL, 53 | `comment` TEXT COLLATE utf8_unicode_ci, 54 | PRIMARY KEY (`id`), 55 | KEY `name` (`name`) 56 | ) 57 | ENGINE = MyISAM 58 | DEFAULT CHARSET = utf8 59 | COLLATE = utf8_unicode_ci; 60 | 61 | DROP TABLE IF EXISTS `glpi_plugin_databases_databasecategories`; 62 | CREATE TABLE `glpi_plugin_databases_databasecategories` ( 63 | `id` INT(11) NOT NULL AUTO_INCREMENT, 64 | `entities_id` INT(11) NOT NULL DEFAULT '0', 65 | `name` VARCHAR(255) 66 | COLLATE utf8_unicode_ci DEFAULT NULL, 67 | `comment` TEXT COLLATE utf8_unicode_ci, 68 | PRIMARY KEY (`id`), 69 | KEY `name` (`name`) 70 | ) 71 | ENGINE = MyISAM 72 | DEFAULT CHARSET = utf8 73 | COLLATE = utf8_unicode_ci; 74 | 75 | DROP TABLE IF EXISTS `glpi_plugin_databases_servertypes`; 76 | CREATE TABLE `glpi_plugin_databases_servertypes` ( 77 | `id` INT(11) NOT NULL AUTO_INCREMENT, 78 | `name` VARCHAR(255) 79 | COLLATE utf8_unicode_ci DEFAULT NULL, 80 | `comment` TEXT COLLATE utf8_unicode_ci, 81 | PRIMARY KEY (`id`), 82 | KEY `name` (`name`) 83 | ) 84 | ENGINE = MyISAM 85 | DEFAULT CHARSET = utf8 86 | COLLATE = utf8_unicode_ci; 87 | 88 | INSERT INTO `glpi_plugin_databases_servertypes` VALUES ('1', 'Mysql', ''); 89 | INSERT INTO `glpi_plugin_databases_servertypes` VALUES ('2', 'Oracle', ''); 90 | INSERT INTO `glpi_plugin_databases_servertypes` VALUES ('3', 'SQL', ''); 91 | 92 | DROP TABLE IF EXISTS `glpi_plugin_databases_scripttypes`; 93 | CREATE TABLE `glpi_plugin_databases_scripttypes` ( 94 | `id` INT(11) NOT NULL AUTO_INCREMENT, 95 | `name` VARCHAR(255) 96 | COLLATE utf8_unicode_ci DEFAULT NULL, 97 | `comment` TEXT COLLATE utf8_unicode_ci, 98 | PRIMARY KEY (`id`), 99 | KEY `name` (`name`) 100 | ) 101 | ENGINE = MyISAM 102 | DEFAULT CHARSET = utf8 103 | COLLATE = utf8_unicode_ci; 104 | 105 | DROP TABLE IF EXISTS `glpi_plugin_databases_instances`; 106 | CREATE TABLE `glpi_plugin_databases_instances` ( 107 | `id` INT(11) NOT NULL AUTO_INCREMENT, 108 | `entities_id` INT(11) NOT NULL DEFAULT '0', 109 | `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 110 | `plugin_databases_databases_id` INT(11) NOT NULL DEFAULT '0' 111 | COMMENT 'RELATION to glpi_plugin_databases_databases (id)', 112 | `name` VARCHAR(255) 113 | COLLATE utf8_unicode_ci DEFAULT NULL, 114 | `port` INT(11) NOT NULL DEFAULT '0', 115 | `path` VARCHAR(255) 116 | COLLATE utf8_unicode_ci DEFAULT NULL, 117 | `comment` TEXT COLLATE utf8_unicode_ci, 118 | PRIMARY KEY (`id`), 119 | KEY `name` (`name`), 120 | KEY `plugin_databases_databases_id` (`plugin_databases_databases_id`) 121 | ) 122 | ENGINE = MyISAM 123 | DEFAULT CHARSET = utf8 124 | COLLATE = utf8_unicode_ci; 125 | 126 | DROP TABLE IF EXISTS `glpi_plugin_databases_scripts`; 127 | CREATE TABLE `glpi_plugin_databases_scripts` ( 128 | `id` INT(11) NOT NULL AUTO_INCREMENT, 129 | `entities_id` INT(11) NOT NULL DEFAULT '0', 130 | `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 131 | `plugin_databases_databases_id` INT(11) NOT NULL DEFAULT '0' 132 | COMMENT 'RELATION to glpi_plugin_databases_databases (id)', 133 | `plugin_databases_scripttypes_id` INT(11) NOT NULL DEFAULT '0' 134 | COMMENT 'RELATION to glpi_plugin_databases_scripttypes (id)', 135 | `name` VARCHAR(255) 136 | COLLATE utf8_unicode_ci DEFAULT NULL, 137 | `port` INT(11) NOT NULL DEFAULT '0', 138 | `path` VARCHAR(255) 139 | COLLATE utf8_unicode_ci DEFAULT NULL, 140 | `comment` TEXT COLLATE utf8_unicode_ci, 141 | PRIMARY KEY (`id`), 142 | KEY `name` (`name`), 143 | KEY `plugin_databases_databases_id` (`plugin_databases_databases_id`), 144 | KEY `plugin_databases_scripttypes_id` (`plugin_databases_scripttypes_id`) 145 | ) 146 | ENGINE = MyISAM 147 | DEFAULT CHARSET = utf8 148 | COLLATE = utf8_unicode_ci; 149 | 150 | DROP TABLE IF EXISTS `glpi_plugin_databases_databases_items`; 151 | CREATE TABLE `glpi_plugin_databases_databases_items` ( 152 | `id` INT(11) NOT NULL AUTO_INCREMENT, 153 | `plugin_databases_databases_id` INT(11) NOT NULL DEFAULT '0' 154 | COMMENT 'RELATION to glpi_plugin_databases_databases (id)', 155 | `items_id` INT(11) NOT NULL DEFAULT '0' 156 | COMMENT 'RELATION to various tables, according to itemtype (id)', 157 | `itemtype` VARCHAR(100) 158 | COLLATE utf8_unicode_ci NOT NULL 159 | COMMENT 'see .class.php file', 160 | PRIMARY KEY (`id`), 161 | UNIQUE KEY `unicity` (`plugin_databases_databases_id`, `items_id`, `itemtype`), 162 | KEY `FK_device` (`items_id`, `itemtype`), 163 | KEY `item` (`itemtype`, `items_id`) 164 | ) 165 | ENGINE = MyISAM 166 | DEFAULT CHARSET = utf8 167 | COLLATE = utf8_unicode_ci; 168 | 169 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginDatabasesDatabase', '2', '2', '0'); 170 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginDatabasesDatabase', '6', '3', '0'); 171 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginDatabasesDatabase', '7', '4', '0'); -------------------------------------------------------------------------------- /sql/empty-1.3.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_databases_databases`; 2 | CREATE TABLE `glpi_plugin_databases_databases` ( 3 | `id` INT(11) NOT NULL AUTO_INCREMENT, 4 | `entities_id` INT(11) NOT NULL DEFAULT '0', 5 | `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 6 | `name` VARCHAR(255) 7 | COLLATE utf8_unicode_ci DEFAULT NULL, 8 | `plugin_databases_databasecategories_id` INT(11) NOT NULL DEFAULT '0' 9 | COMMENT 'RELATION to glpi_plugin_databases_databasecategories (id)', 10 | `plugin_databases_databasetypes_id` INT(11) NOT NULL DEFAULT '0' 11 | COMMENT 'RELATION to glpi_plugin_databases_databasetypes (id)', 12 | `users_id` INT(11) NOT NULL DEFAULT '0' 13 | COMMENT 'RELATION to glpi_users (id)', 14 | `groups_id` INT(11) NOT NULL DEFAULT '0' 15 | COMMENT 'RELATION to glpi_groups (id)', 16 | `plugin_databases_servertypes_id` INT(11) NOT NULL DEFAULT '0' 17 | COMMENT 'RELATION to glpi_plugin_databases_servertypes (id)', 18 | `suppliers_id` INT(11) NOT NULL DEFAULT '0' 19 | COMMENT 'RELATION to glpi_suppliers (id)', 20 | `manufacturers_id` INT(11) NOT NULL DEFAULT '0' 21 | COMMENT 'RELATION to glpi_manufacturers (id)', 22 | `locations_id` INT(11) NOT NULL DEFAULT '0' 23 | COMMENT 'RELATION to glpi_locations (id)', 24 | `notepad` LONGTEXT COLLATE utf8_unicode_ci, 25 | `comment` TEXT COLLATE utf8_unicode_ci, 26 | `is_helpdesk_visible` INT(11) NOT NULL DEFAULT '1', 27 | `date_mod` DATETIME DEFAULT NULL, 28 | `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', 29 | PRIMARY KEY (`id`), 30 | KEY `name` (`name`), 31 | KEY `entities_id` (`entities_id`), 32 | KEY `plugin_databases_databasecategories_id` (`plugin_databases_databasecategories_id`), 33 | KEY `plugin_databases_databasetypes_id` (`plugin_databases_databasetypes_id`), 34 | KEY `plugin_databases_servertypes_id` (`plugin_databases_servertypes_id`), 35 | KEY `users_id` (`users_id`), 36 | KEY `groups_id` (`groups_id`), 37 | KEY `suppliers_id` (`suppliers_id`), 38 | KEY `manufacturers_id` (`manufacturers_id`), 39 | KEY `locations_id` (`locations_id`), 40 | KEY date_mod (date_mod), 41 | KEY is_helpdesk_visible (is_helpdesk_visible), 42 | KEY `is_deleted` (`is_deleted`) 43 | ) 44 | ENGINE = MyISAM 45 | DEFAULT CHARSET = utf8 46 | COLLATE = utf8_unicode_ci; 47 | 48 | DROP TABLE IF EXISTS `glpi_plugin_databases_databasetypes`; 49 | CREATE TABLE `glpi_plugin_databases_databasetypes` ( 50 | `id` INT(11) NOT NULL AUTO_INCREMENT, 51 | `entities_id` INT(11) NOT NULL DEFAULT '0', 52 | `name` VARCHAR(255) 53 | COLLATE utf8_unicode_ci DEFAULT NULL, 54 | `comment` TEXT COLLATE utf8_unicode_ci, 55 | PRIMARY KEY (`id`), 56 | KEY `name` (`name`) 57 | ) 58 | ENGINE = MyISAM 59 | DEFAULT CHARSET = utf8 60 | COLLATE = utf8_unicode_ci; 61 | 62 | DROP TABLE IF EXISTS `glpi_plugin_databases_databasecategories`; 63 | CREATE TABLE `glpi_plugin_databases_databasecategories` ( 64 | `id` INT(11) NOT NULL AUTO_INCREMENT, 65 | `entities_id` INT(11) NOT NULL DEFAULT '0', 66 | `name` VARCHAR(255) 67 | COLLATE utf8_unicode_ci DEFAULT NULL, 68 | `comment` TEXT COLLATE utf8_unicode_ci, 69 | PRIMARY KEY (`id`), 70 | KEY `name` (`name`) 71 | ) 72 | ENGINE = MyISAM 73 | DEFAULT CHARSET = utf8 74 | COLLATE = utf8_unicode_ci; 75 | 76 | DROP TABLE IF EXISTS `glpi_plugin_databases_servertypes`; 77 | CREATE TABLE `glpi_plugin_databases_servertypes` ( 78 | `id` INT(11) NOT NULL AUTO_INCREMENT, 79 | `name` VARCHAR(255) 80 | COLLATE utf8_unicode_ci DEFAULT NULL, 81 | `comment` TEXT COLLATE utf8_unicode_ci, 82 | PRIMARY KEY (`id`), 83 | KEY `name` (`name`) 84 | ) 85 | ENGINE = MyISAM 86 | DEFAULT CHARSET = utf8 87 | COLLATE = utf8_unicode_ci; 88 | 89 | INSERT INTO `glpi_plugin_databases_servertypes` VALUES ('1', 'Mysql', ''); 90 | INSERT INTO `glpi_plugin_databases_servertypes` VALUES ('2', 'Oracle', ''); 91 | INSERT INTO `glpi_plugin_databases_servertypes` VALUES ('3', 'SQL', ''); 92 | 93 | DROP TABLE IF EXISTS `glpi_plugin_databases_scripttypes`; 94 | CREATE TABLE `glpi_plugin_databases_scripttypes` ( 95 | `id` INT(11) NOT NULL AUTO_INCREMENT, 96 | `name` VARCHAR(255) 97 | COLLATE utf8_unicode_ci DEFAULT NULL, 98 | `comment` TEXT COLLATE utf8_unicode_ci, 99 | PRIMARY KEY (`id`), 100 | KEY `name` (`name`) 101 | ) 102 | ENGINE = MyISAM 103 | DEFAULT CHARSET = utf8 104 | COLLATE = utf8_unicode_ci; 105 | 106 | DROP TABLE IF EXISTS `glpi_plugin_databases_instances`; 107 | CREATE TABLE `glpi_plugin_databases_instances` ( 108 | `id` INT(11) NOT NULL AUTO_INCREMENT, 109 | `entities_id` INT(11) NOT NULL DEFAULT '0', 110 | `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 111 | `plugin_databases_databases_id` INT(11) NOT NULL DEFAULT '0' 112 | COMMENT 'RELATION to glpi_plugin_databases_databases (id)', 113 | `name` VARCHAR(255) 114 | COLLATE utf8_unicode_ci DEFAULT NULL, 115 | `port` INT(11) NOT NULL DEFAULT '0', 116 | `path` VARCHAR(255) 117 | COLLATE utf8_unicode_ci DEFAULT NULL, 118 | `comment` TEXT COLLATE utf8_unicode_ci, 119 | PRIMARY KEY (`id`), 120 | KEY `name` (`name`), 121 | KEY `plugin_databases_databases_id` (`plugin_databases_databases_id`) 122 | ) 123 | ENGINE = MyISAM 124 | DEFAULT CHARSET = utf8 125 | COLLATE = utf8_unicode_ci; 126 | 127 | DROP TABLE IF EXISTS `glpi_plugin_databases_scripts`; 128 | CREATE TABLE `glpi_plugin_databases_scripts` ( 129 | `id` INT(11) NOT NULL AUTO_INCREMENT, 130 | `entities_id` INT(11) NOT NULL DEFAULT '0', 131 | `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 132 | `plugin_databases_databases_id` INT(11) NOT NULL DEFAULT '0' 133 | COMMENT 'RELATION to glpi_plugin_databases_databases (id)', 134 | `plugin_databases_scripttypes_id` INT(11) NOT NULL DEFAULT '0' 135 | COMMENT 'RELATION to glpi_plugin_databases_scripttypes (id)', 136 | `name` VARCHAR(255) 137 | COLLATE utf8_unicode_ci DEFAULT NULL, 138 | `port` INT(11) NOT NULL DEFAULT '0', 139 | `path` VARCHAR(255) 140 | COLLATE utf8_unicode_ci DEFAULT NULL, 141 | `comment` TEXT COLLATE utf8_unicode_ci, 142 | PRIMARY KEY (`id`), 143 | KEY `name` (`name`), 144 | KEY `plugin_databases_databases_id` (`plugin_databases_databases_id`), 145 | KEY `plugin_databases_scripttypes_id` (`plugin_databases_scripttypes_id`) 146 | ) 147 | ENGINE = MyISAM 148 | DEFAULT CHARSET = utf8 149 | COLLATE = utf8_unicode_ci; 150 | 151 | DROP TABLE IF EXISTS `glpi_plugin_databases_databases_items`; 152 | CREATE TABLE `glpi_plugin_databases_databases_items` ( 153 | `id` INT(11) NOT NULL AUTO_INCREMENT, 154 | `plugin_databases_databases_id` INT(11) NOT NULL DEFAULT '0' 155 | COMMENT 'RELATION to glpi_plugin_databases_databases (id)', 156 | `items_id` INT(11) NOT NULL DEFAULT '0' 157 | COMMENT 'RELATION to various tables, according to itemtype (id)', 158 | `itemtype` VARCHAR(100) 159 | COLLATE utf8_unicode_ci NOT NULL 160 | COMMENT 'see .class.php file', 161 | PRIMARY KEY (`id`), 162 | UNIQUE KEY `unicity` (`plugin_databases_databases_id`, `items_id`, `itemtype`), 163 | KEY `FK_device` (`items_id`, `itemtype`), 164 | KEY `item` (`itemtype`, `items_id`) 165 | ) 166 | ENGINE = MyISAM 167 | DEFAULT CHARSET = utf8 168 | COLLATE = utf8_unicode_ci; 169 | 170 | DROP TABLE IF EXISTS `glpi_plugin_databases_profiles`; 171 | CREATE TABLE `glpi_plugin_databases_profiles` ( 172 | `id` INT(11) NOT NULL AUTO_INCREMENT, 173 | `profiles_id` INT(11) NOT NULL DEFAULT '0' 174 | COMMENT 'RELATION to glpi_profiles (id)', 175 | `databases` CHAR(1) 176 | COLLATE utf8_unicode_ci DEFAULT NULL, 177 | `open_ticket` CHAR(1) 178 | COLLATE utf8_unicode_ci DEFAULT NULL, 179 | PRIMARY KEY (`id`), 180 | KEY `profiles_id` (`profiles_id`) 181 | ) 182 | ENGINE = MyISAM 183 | DEFAULT CHARSET = utf8 184 | COLLATE = utf8_unicode_ci; 185 | 186 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginDatabasesDatabase', '2', '2', '0'); 187 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginDatabasesDatabase', '6', '3', '0'); 188 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginDatabasesDatabase', '7', '4', '0'); -------------------------------------------------------------------------------- /sql/empty-1.5.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_databases_databases`; 2 | CREATE TABLE `glpi_plugin_databases_databases` ( 3 | `id` INT(11) NOT NULL AUTO_INCREMENT, 4 | `entities_id` INT(11) NOT NULL DEFAULT '0', 5 | `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 6 | `name` VARCHAR(255) 7 | COLLATE utf8_unicode_ci DEFAULT NULL, 8 | `plugin_databases_databasecategories_id` INT(11) NOT NULL DEFAULT '0' 9 | COMMENT 'RELATION to glpi_plugin_databases_databasecategories (id)', 10 | `plugin_databases_databasetypes_id` INT(11) NOT NULL DEFAULT '0' 11 | COMMENT 'RELATION to glpi_plugin_databases_databasetypes (id)', 12 | `users_id_tech` INT(11) NOT NULL DEFAULT '0' 13 | COMMENT 'RELATION to glpi_users (id)', 14 | `groups_id_tech` INT(11) NOT NULL DEFAULT '0' 15 | COMMENT 'RELATION to glpi_groups (id)', 16 | `plugin_databases_servertypes_id` INT(11) NOT NULL DEFAULT '0' 17 | COMMENT 'RELATION to glpi_plugin_databases_servertypes (id)', 18 | `suppliers_id` INT(11) NOT NULL DEFAULT '0' 19 | COMMENT 'RELATION to glpi_suppliers (id)', 20 | `manufacturers_id` INT(11) NOT NULL DEFAULT '0' 21 | COMMENT 'RELATION to glpi_manufacturers (id)', 22 | `locations_id` INT(11) NOT NULL DEFAULT '0' 23 | COMMENT 'RELATION to glpi_locations (id)', 24 | `notepad` LONGTEXT COLLATE utf8_unicode_ci, 25 | `comment` TEXT COLLATE utf8_unicode_ci, 26 | `is_helpdesk_visible` INT(11) NOT NULL DEFAULT '1', 27 | `date_mod` DATETIME DEFAULT NULL, 28 | `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', 29 | PRIMARY KEY (`id`), 30 | KEY `name` (`name`), 31 | KEY `entities_id` (`entities_id`), 32 | KEY `plugin_databases_databasecategories_id` (`plugin_databases_databasecategories_id`), 33 | KEY `plugin_databases_databasetypes_id` (`plugin_databases_databasetypes_id`), 34 | KEY `plugin_databases_servertypes_id` (`plugin_databases_servertypes_id`), 35 | KEY `users_id_tech` (`users_id_tech`), 36 | KEY `groups_id_tech` (`groups_id_tech`), 37 | KEY `suppliers_id` (`suppliers_id`), 38 | KEY `manufacturers_id` (`manufacturers_id`), 39 | KEY `locations_id` (`locations_id`), 40 | KEY date_mod (date_mod), 41 | KEY is_helpdesk_visible (is_helpdesk_visible), 42 | KEY `is_deleted` (`is_deleted`) 43 | ) 44 | ENGINE = MyISAM 45 | DEFAULT CHARSET = utf8 46 | COLLATE = utf8_unicode_ci; 47 | 48 | DROP TABLE IF EXISTS `glpi_plugin_databases_databasetypes`; 49 | CREATE TABLE `glpi_plugin_databases_databasetypes` ( 50 | `id` INT(11) NOT NULL AUTO_INCREMENT, 51 | `entities_id` INT(11) NOT NULL DEFAULT '0', 52 | `name` VARCHAR(255) 53 | COLLATE utf8_unicode_ci DEFAULT NULL, 54 | `comment` TEXT COLLATE utf8_unicode_ci, 55 | PRIMARY KEY (`id`), 56 | KEY `name` (`name`) 57 | ) 58 | ENGINE = MyISAM 59 | DEFAULT CHARSET = utf8 60 | COLLATE = utf8_unicode_ci; 61 | 62 | DROP TABLE IF EXISTS `glpi_plugin_databases_databasecategories`; 63 | CREATE TABLE `glpi_plugin_databases_databasecategories` ( 64 | `id` INT(11) NOT NULL AUTO_INCREMENT, 65 | `entities_id` INT(11) NOT NULL DEFAULT '0', 66 | `name` VARCHAR(255) 67 | COLLATE utf8_unicode_ci DEFAULT NULL, 68 | `comment` TEXT COLLATE utf8_unicode_ci, 69 | PRIMARY KEY (`id`), 70 | KEY `name` (`name`) 71 | ) 72 | ENGINE = MyISAM 73 | DEFAULT CHARSET = utf8 74 | COLLATE = utf8_unicode_ci; 75 | 76 | DROP TABLE IF EXISTS `glpi_plugin_databases_servertypes`; 77 | CREATE TABLE `glpi_plugin_databases_servertypes` ( 78 | `id` INT(11) NOT NULL AUTO_INCREMENT, 79 | `name` VARCHAR(255) 80 | COLLATE utf8_unicode_ci DEFAULT NULL, 81 | `comment` TEXT COLLATE utf8_unicode_ci, 82 | PRIMARY KEY (`id`), 83 | KEY `name` (`name`) 84 | ) 85 | ENGINE = MyISAM 86 | DEFAULT CHARSET = utf8 87 | COLLATE = utf8_unicode_ci; 88 | 89 | INSERT INTO `glpi_plugin_databases_servertypes` VALUES ('1', 'Mysql', ''); 90 | INSERT INTO `glpi_plugin_databases_servertypes` VALUES ('2', 'Oracle', ''); 91 | INSERT INTO `glpi_plugin_databases_servertypes` VALUES ('3', 'SQL', ''); 92 | 93 | DROP TABLE IF EXISTS `glpi_plugin_databases_scripttypes`; 94 | CREATE TABLE `glpi_plugin_databases_scripttypes` ( 95 | `id` INT(11) NOT NULL AUTO_INCREMENT, 96 | `name` VARCHAR(255) 97 | COLLATE utf8_unicode_ci DEFAULT NULL, 98 | `comment` TEXT COLLATE utf8_unicode_ci, 99 | PRIMARY KEY (`id`), 100 | KEY `name` (`name`) 101 | ) 102 | ENGINE = MyISAM 103 | DEFAULT CHARSET = utf8 104 | COLLATE = utf8_unicode_ci; 105 | 106 | DROP TABLE IF EXISTS `glpi_plugin_databases_instances`; 107 | CREATE TABLE `glpi_plugin_databases_instances` ( 108 | `id` INT(11) NOT NULL AUTO_INCREMENT, 109 | `entities_id` INT(11) NOT NULL DEFAULT '0', 110 | `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 111 | `plugin_databases_databases_id` INT(11) NOT NULL DEFAULT '0' 112 | COMMENT 'RELATION to glpi_plugin_databases_databases (id)', 113 | `name` VARCHAR(255) 114 | COLLATE utf8_unicode_ci DEFAULT NULL, 115 | `port` INT(11) NOT NULL DEFAULT '0', 116 | `path` VARCHAR(255) 117 | COLLATE utf8_unicode_ci DEFAULT NULL, 118 | `comment` TEXT COLLATE utf8_unicode_ci, 119 | PRIMARY KEY (`id`), 120 | KEY `name` (`name`), 121 | KEY `plugin_databases_databases_id` (`plugin_databases_databases_id`) 122 | ) 123 | ENGINE = MyISAM 124 | DEFAULT CHARSET = utf8 125 | COLLATE = utf8_unicode_ci; 126 | 127 | DROP TABLE IF EXISTS `glpi_plugin_databases_scripts`; 128 | CREATE TABLE `glpi_plugin_databases_scripts` ( 129 | `id` INT(11) NOT NULL AUTO_INCREMENT, 130 | `entities_id` INT(11) NOT NULL DEFAULT '0', 131 | `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 132 | `plugin_databases_databases_id` INT(11) NOT NULL DEFAULT '0' 133 | COMMENT 'RELATION to glpi_plugin_databases_databases (id)', 134 | `plugin_databases_scripttypes_id` INT(11) NOT NULL DEFAULT '0' 135 | COMMENT 'RELATION to glpi_plugin_databases_scripttypes (id)', 136 | `name` VARCHAR(255) 137 | COLLATE utf8_unicode_ci DEFAULT NULL, 138 | `port` INT(11) NOT NULL DEFAULT '0', 139 | `path` VARCHAR(255) 140 | COLLATE utf8_unicode_ci DEFAULT NULL, 141 | `comment` TEXT COLLATE utf8_unicode_ci, 142 | PRIMARY KEY (`id`), 143 | KEY `name` (`name`), 144 | KEY `plugin_databases_databases_id` (`plugin_databases_databases_id`), 145 | KEY `plugin_databases_scripttypes_id` (`plugin_databases_scripttypes_id`) 146 | ) 147 | ENGINE = MyISAM 148 | DEFAULT CHARSET = utf8 149 | COLLATE = utf8_unicode_ci; 150 | 151 | DROP TABLE IF EXISTS `glpi_plugin_databases_databases_items`; 152 | CREATE TABLE `glpi_plugin_databases_databases_items` ( 153 | `id` INT(11) NOT NULL AUTO_INCREMENT, 154 | `plugin_databases_databases_id` INT(11) NOT NULL DEFAULT '0' 155 | COMMENT 'RELATION to glpi_plugin_databases_databases (id)', 156 | `items_id` INT(11) NOT NULL DEFAULT '0' 157 | COMMENT 'RELATION to various tables, according to itemtype (id)', 158 | `itemtype` VARCHAR(100) 159 | COLLATE utf8_unicode_ci NOT NULL 160 | COMMENT 'see .class.php file', 161 | PRIMARY KEY (`id`), 162 | UNIQUE KEY `unicity` (`plugin_databases_databases_id`, `items_id`, `itemtype`), 163 | KEY `FK_device` (`items_id`, `itemtype`), 164 | KEY `item` (`itemtype`, `items_id`) 165 | ) 166 | ENGINE = MyISAM 167 | DEFAULT CHARSET = utf8 168 | COLLATE = utf8_unicode_ci; 169 | 170 | DROP TABLE IF EXISTS `glpi_plugin_databases_profiles`; 171 | CREATE TABLE `glpi_plugin_databases_profiles` ( 172 | `id` INT(11) NOT NULL AUTO_INCREMENT, 173 | `profiles_id` INT(11) NOT NULL DEFAULT '0' 174 | COMMENT 'RELATION to glpi_profiles (id)', 175 | `databases` CHAR(1) 176 | COLLATE utf8_unicode_ci DEFAULT NULL, 177 | `open_ticket` CHAR(1) 178 | COLLATE utf8_unicode_ci DEFAULT NULL, 179 | PRIMARY KEY (`id`), 180 | KEY `profiles_id` (`profiles_id`) 181 | ) 182 | ENGINE = MyISAM 183 | DEFAULT CHARSET = utf8 184 | COLLATE = utf8_unicode_ci; 185 | 186 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginDatabasesDatabase', '2', '2', '0'); 187 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginDatabasesDatabase', '6', '3', '0'); 188 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginDatabasesDatabase', '7', '4', '0'); -------------------------------------------------------------------------------- /inc/profile.class.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | if (!defined('GLPI_ROOT')) { 30 | die("Sorry. You can't access directly to this file"); 31 | } 32 | 33 | /** 34 | * Class PluginDatabasesProfile 35 | */ 36 | class PluginDatabasesProfile extends Profile { 37 | 38 | static $rightname = "profile"; 39 | 40 | /** 41 | * @param CommonGLPI $item 42 | * @param int $withtemplate 43 | * 44 | * @return string|translated 45 | */ 46 | function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { 47 | 48 | if ($item->getType() == 'Profile') { 49 | return PluginDatabasesDatabase::getTypeName(2); 50 | } 51 | return ''; 52 | } 53 | 54 | 55 | /** 56 | * @param CommonGLPI $item 57 | * @param int $tabnum 58 | * @param int $withtemplate 59 | * 60 | * @return bool 61 | */ 62 | static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { 63 | 64 | if ($item->getType() == 'Profile') { 65 | $ID = $item->getID(); 66 | $prof = new self(); 67 | 68 | self::addDefaultProfileInfos($ID, 69 | ['plugin_databases' => 0, 70 | 'plugin_databases_open_ticket' => 0]); 71 | $prof->showForm($ID); 72 | } 73 | return true; 74 | } 75 | 76 | /** 77 | * @param $ID 78 | */ 79 | static function createFirstAccess($ID) { 80 | //85 81 | self::addDefaultProfileInfos($ID, 82 | ['plugin_databases' => 127, 83 | 'plugin_databases_open_ticket' => 1], true); 84 | } 85 | 86 | /** 87 | * @param $profiles_id 88 | * @param $rights 89 | * @param bool $drop_existing 90 | * 91 | * @internal param $profile 92 | */ 93 | static function addDefaultProfileInfos($profiles_id, $rights, $drop_existing = false) { 94 | $dbu = new DbUtils(); 95 | $profileRight = new ProfileRight(); 96 | foreach ($rights as $right => $value) { 97 | if ($dbu->countElementsInTable('glpi_profilerights', 98 | ["profiles_id" => $profiles_id, "name" => $right]) && $drop_existing) { 99 | $profileRight->deleteByCriteria(['profiles_id' => $profiles_id, 'name' => $right]); 100 | } 101 | if (!$dbu->countElementsInTable('glpi_profilerights', 102 | ["profiles_id" => $profiles_id, "name" => $right])) { 103 | $myright['profiles_id'] = $profiles_id; 104 | $myright['name'] = $right; 105 | $myright['rights'] = $value; 106 | $profileRight->add($myright); 107 | 108 | //Add right to the current session 109 | $_SESSION['glpiactiveprofile'][$right] = $value; 110 | } 111 | } 112 | } 113 | 114 | 115 | /** 116 | * Show profile form 117 | * 118 | * @param int $profiles_id 119 | * @param bool $openform 120 | * @param bool $closeform 121 | * 122 | * @return void 123 | * @internal param int $items_id id of the profile 124 | * @internal param value $target url of target 125 | */ 126 | function showForm($profiles_id = 0, $openform = true, $closeform = true) { 127 | 128 | echo "
"; 129 | if (($canedit = Session::haveRightsOr(self::$rightname, [CREATE, UPDATE, PURGE])) 130 | && $openform) { 131 | $profile = new Profile(); 132 | echo "
"; 133 | } 134 | 135 | $profile = new Profile(); 136 | $profile->getFromDB($profiles_id); 137 | if ($profile->getField('interface') == 'central') { 138 | $rights = $this->getAllRights(); 139 | $profile->displayRightsChoiceMatrix($rights, ['canedit' => $canedit, 140 | 'default_class' => 'tab_bg_2', 141 | 'title' => __('General')]); 142 | } 143 | echo ""; 144 | echo "\n"; 145 | 146 | $effective_rights = ProfileRight::getProfileRights($profiles_id, ['plugin_databases_open_ticket']); 147 | echo ""; 148 | echo ""; 149 | echo "\n"; 153 | echo "
" . __('Helpdesk') . "
" . __('Associable items to a ticket') . ""; 150 | Html::showCheckbox(['name' => '_plugin_databases_open_ticket', 151 | 'checked' => $effective_rights['plugin_databases_open_ticket']]); 152 | echo "
"; 154 | 155 | if ($canedit 156 | && $closeform 157 | ) { 158 | echo "
"; 159 | echo Html::hidden('id', ['value' => $profiles_id]); 160 | echo Html::submit(_sx('button', 'Save'), ['name' => 'update']); 161 | echo "
\n"; 162 | Html::closeForm(); 163 | } 164 | echo "
"; 165 | } 166 | 167 | /** 168 | * @param bool $all 169 | * 170 | * @return array 171 | */ 172 | static function getAllRights($all = false) { 173 | $rights = [ 174 | ['itemtype' => 'PluginDatabasesDatabase', 175 | 'label' => _n('Database', 'Databases', 2, 'databases'), 176 | 'field' => 'plugin_databases' 177 | ], 178 | ]; 179 | 180 | if ($all) { 181 | $rights[] = ['itemtype' => 'PluginDatabasesDatabase', 182 | 'label' => __('Associable items to a ticket'), 183 | 'field' => 'plugin_databases_open_ticket']; 184 | } 185 | 186 | return $rights; 187 | } 188 | 189 | /** 190 | * Init profiles 191 | * 192 | * @param $old_right 193 | * 194 | * @return int 195 | */ 196 | 197 | static function translateARight($old_right) { 198 | switch ($old_right) { 199 | case '': 200 | return 0; 201 | case 'r' : 202 | return READ; 203 | case 'w': 204 | return ALLSTANDARDRIGHT + READNOTE + UPDATENOTE; 205 | case '0': 206 | case '1': 207 | return $old_right; 208 | 209 | default : 210 | return 0; 211 | } 212 | } 213 | 214 | /** 215 | * @since 0.85 216 | * Migration rights from old system to the new one for one profile 217 | * 218 | * @param $profiles_id the profile ID 219 | * 220 | * @return bool 221 | */ 222 | static function migrateOneProfile($profiles_id) { 223 | global $DB; 224 | //Cannot launch migration if there's nothing to migrate... 225 | if (!$DB->tableExists('glpi_plugin_databases_profiles')) { 226 | return true; 227 | } 228 | 229 | foreach ($DB->request('glpi_plugin_databases_profiles', 230 | "`profiles_id`='$profiles_id'") as $profile_data) { 231 | 232 | $matching = ['databases' => 'plugin_databases', 233 | 'open_ticket' => 'plugin_databases_open_ticket']; 234 | $current_rights = ProfileRight::getProfileRights($profiles_id, array_values($matching)); 235 | foreach ($matching as $old => $new) { 236 | if (!isset($current_rights[$old])) { 237 | $query = "UPDATE `glpi_profilerights` 238 | SET `rights`='" . self::translateARight($profile_data[$old]) . "' 239 | WHERE `name`='$new' AND `profiles_id`='$profiles_id'"; 240 | $DB->query($query); 241 | } 242 | } 243 | } 244 | } 245 | 246 | /** 247 | * Initialize profiles, and migrate it necessary 248 | */ 249 | static function initProfile() { 250 | global $DB; 251 | $profile = new self(); 252 | $dbu = new DbUtils(); 253 | //Add new rights in glpi_profilerights table 254 | foreach ($profile->getAllRights(true) as $data) { 255 | if ($dbu->countElementsInTable("glpi_profilerights", 256 | ["name" => $data['field']]) == 0) { 257 | ProfileRight::addProfileRights([$data['field']]); 258 | } 259 | } 260 | 261 | //Migration old rights in new ones 262 | foreach ($DB->request("SELECT `id` FROM `glpi_profiles`") as $prof) { 263 | self::migrateOneProfile($prof['id']); 264 | } 265 | foreach ($DB->request("SELECT * 266 | FROM `glpi_profilerights` 267 | WHERE `profiles_id`='" . $_SESSION['glpiactiveprofile']['id'] . "' 268 | AND `name` LIKE '%plugin_databases%'") as $prof) { 269 | $_SESSION['glpiactiveprofile'][$prof['name']] = $prof['rights']; 270 | } 271 | } 272 | 273 | 274 | static function removeRightsFromSession() { 275 | foreach (self::getAllRights(true) as $right) { 276 | if (isset($_SESSION['glpiactiveprofile'][$right['field']])) { 277 | unset($_SESSION['glpiactiveprofile'][$right['field']]); 278 | } 279 | } 280 | } 281 | } 282 | -------------------------------------------------------------------------------- /inc/instance.class.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | if (!defined('GLPI_ROOT')) { 31 | die("Sorry. You can't access directly to this file"); 32 | } 33 | 34 | /** 35 | * Class PluginDatabasesInstance 36 | */ 37 | class PluginDatabasesInstance extends CommonDBChild { 38 | 39 | static $rightname = "plugin_databases"; 40 | 41 | // From CommonDBChild 42 | static public $itemtype = 'PluginDatabasesDatabase'; 43 | static public $items_id = 'plugin_databases_databases_id'; 44 | 45 | /** 46 | * @param int $nb 47 | * 48 | * @return translated 49 | */ 50 | static function getTypeName($nb = 0) { 51 | 52 | return _n('Instance', 'Instances', $nb, 'databases'); 53 | } 54 | 55 | /** 56 | * @param CommonGLPI $item 57 | * @param int $withtemplate 58 | * 59 | * @return array|string|translated 60 | */ 61 | function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { 62 | 63 | if ($item->getType() == 'PluginDatabasesDatabase') { 64 | if ($_SESSION['glpishow_count_on_tabs']) { 65 | return self::createTabEntry(self::getTypeName(2), self::countForItem($item)); 66 | } 67 | return self::getTypeName(2); 68 | } 69 | return ''; 70 | } 71 | 72 | /** 73 | * @param CommonDBTM $item 74 | * 75 | * @return int 76 | */ 77 | static function countForItem(CommonDBTM $item) { 78 | $dbu = new DbUtils(); 79 | return $dbu->countElementsInTable('glpi_plugin_databases_instances', 80 | ["plugin_databases_databases_id" => $item->getID()]); 81 | } 82 | 83 | 84 | /** 85 | * @param CommonGLPI $item 86 | * @param int $tabnum 87 | * @param int $withtemplate 88 | * 89 | * @return bool 90 | */ 91 | static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { 92 | global $CFG_GLPI; 93 | 94 | if ($item->getType() == 'PluginDatabasesDatabase') { 95 | $self = new self(); 96 | 97 | $self->showInstances($item); 98 | $self->showForm("", ['plugin_databases_databases_id' => $item->getField('id'), 99 | 'target' => $CFG_GLPI["root_doc"].PLUGIN_DATABASES_DIR_NOFULL . "/front/instance.form.php"]); 100 | } 101 | return true; 102 | } 103 | 104 | /** 105 | * 106 | */ 107 | function post_getEmpty() { 108 | $this->fields["port"] = '0'; 109 | } 110 | 111 | /** 112 | * @param datas $input 113 | * 114 | * @return bool|datas 115 | */ 116 | function prepareInputForAdd($input) { 117 | // Not attached to reference -> not added 118 | if (!isset($input['plugin_databases_databases_id']) 119 | || $input['plugin_databases_databases_id'] <= 0 120 | ) { 121 | return false; 122 | } 123 | return $input; 124 | } 125 | 126 | /** 127 | * @param $ID 128 | * @param array $options 129 | * 130 | * @return bool 131 | */ 132 | function showForm($ID, $options = []) { 133 | 134 | if (!$this->canView()) { 135 | return false; 136 | } 137 | 138 | $plugin_databases_databases_id = -1; 139 | if (isset($options['plugin_databases_databases_id'])) { 140 | $plugin_databases_databases_id = $options['plugin_databases_databases_id']; 141 | } 142 | 143 | if ($ID > 0) { 144 | $this->check($ID, READ); 145 | } else { 146 | $database = new PluginDatabasesDatabase(); 147 | $database->getFromDB($plugin_databases_databases_id); 148 | // Create item 149 | $input = ['plugin_databases_databases_id' => $plugin_databases_databases_id, 150 | 'entities_id' => $database->getEntityID(), 151 | 'is_recursive' => $database->isRecursive()]; 152 | $this->check(-1, UPDATE, $input); 153 | } 154 | 155 | $this->showFormHeader($options); 156 | 157 | echo ""; 158 | echo ""; 159 | echo ""; 160 | 161 | echo ""; 162 | 163 | echo "" . __('Name') . ""; 164 | echo ""; 165 | Html::autocompletionTextField($this, "name"); 166 | echo ""; 167 | 168 | echo "" . __('Port') . ""; 169 | echo ""; 170 | Html::autocompletionTextField($this, "port"); 171 | echo ""; 172 | 173 | echo ""; 174 | 175 | echo ""; 176 | 177 | echo "" . __('Path', 'databases') . ""; 178 | echo ""; 179 | Html::autocompletionTextField($this, "path"); 180 | echo ""; 181 | 182 | echo ""; 183 | echo ""; 184 | 185 | echo ""; 186 | 187 | echo ""; 188 | 189 | echo ""; 190 | echo ""; 192 | echo ""; 193 | echo "
"; 191 | echo __('Comments') . "
"; 194 | echo ""; 195 | echo "
"; 196 | echo ""; 197 | 198 | echo ""; 199 | 200 | $options['candel'] = false; 201 | $this->showFormButtons($options); 202 | 203 | return true; 204 | } 205 | 206 | /** 207 | * @since version 0.84 208 | **/ 209 | function getForbiddenStandardMassiveAction() { 210 | 211 | $forbidden = parent::getForbiddenStandardMassiveAction(); 212 | $forbidden[] = 'update'; 213 | return $forbidden; 214 | } 215 | 216 | /** 217 | * @param PluginDatabasesDatabase $database 218 | * 219 | * @return bool 220 | */ 221 | function showInstances(PluginDatabasesDatabase $database) { 222 | global $DB, $CFG_GLPI; 223 | 224 | $instID = $database->fields['id']; 225 | 226 | if (!$database->can($instID, READ)) { 227 | return false; 228 | } 229 | 230 | $canedit = $database->can($instID, UPDATE); 231 | $rand = mt_rand(); 232 | 233 | $query = "SELECT `glpi_plugin_databases_instances`.`name`, 234 | `glpi_plugin_databases_instances`.`id`, 235 | `glpi_plugin_databases_instances`.`plugin_databases_databases_id`, 236 | `glpi_plugin_databases_instances`.`path`, 237 | `glpi_plugin_databases_instances`.`port`, 238 | `glpi_plugin_databases_instances`.`comment` 239 | FROM `glpi_plugin_databases_instances` "; 240 | $query .= " LEFT JOIN `glpi_plugin_databases_databases` 241 | ON (`glpi_plugin_databases_databases`.`id` = `glpi_plugin_databases_instances`.`plugin_databases_databases_id`)"; 242 | $query .= " WHERE `glpi_plugin_databases_instances`.`plugin_databases_databases_id` = '$instID' 243 | ORDER BY `glpi_plugin_databases_instances`.`name`"; 244 | 245 | $result = $DB->query($query); 246 | $number = $DB->numrows($result); 247 | 248 | echo "
"; 249 | 250 | if ($canedit && $number) { 251 | Html::openMassiveActionsForm('mass' . __CLASS__ . $rand); 252 | $massiveactionparams = []; 253 | Html::showMassiveActions($massiveactionparams); 254 | } 255 | 256 | if ($number != 0) { 257 | echo ""; 258 | echo ""; 259 | 260 | if ($canedit && $number) { 261 | echo ""; 262 | } 263 | 264 | echo ""; 265 | echo ""; 266 | echo ""; 267 | echo ""; 268 | 269 | echo ""; 270 | 271 | Session::initNavigateListItems($this->getType(), PluginDatabasesDatabase::getTypeName(2) . " = " . $database->fields["name"]); 272 | $i = 0; 273 | $row_num = 1; 274 | 275 | while ($data = $DB->fetchArray($result)) { 276 | 277 | Session::addToNavigateListItems($this->getType(), $data['id']); 278 | 279 | $i++; 280 | $row_num++; 281 | echo ""; 282 | echo ""; 287 | 288 | echo ""; 294 | 295 | echo ""; 296 | echo ""; 297 | echo ""; 298 | echo ""; 299 | } 300 | echo "
" . Html::getCheckAllAsCheckbox('mass' . __CLASS__ . $rand) . "" . __('Name') . "" . __('Port') . "" . __('Path', 'databases') . "" . __('Comments') . "
"; 283 | if ($canedit) { 284 | Html::showMassiveActionCheckBox(__CLASS__, $data["id"]); 285 | } 286 | echo ""; 289 | echo "" . $data["name"]; 290 | if ($_SESSION["glpiis_ids_visible"] || empty($data["name"])) { 291 | echo " (" . $data["id"] . ")"; 292 | } 293 | echo "" . $data["port"] . "" . $data["path"] . "" . nl2br($data["comment"]) . "
"; 301 | } 302 | 303 | if ($canedit && $number) { 304 | $paramsma['ontop'] = false; 305 | Html::showMassiveActions($paramsma); 306 | Html::closeForm(); 307 | } 308 | echo "
"; 309 | } 310 | } 311 | -------------------------------------------------------------------------------- /inc/script.class.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | if (!defined('GLPI_ROOT')) { 31 | die("Sorry. You can't access directly to this file"); 32 | } 33 | 34 | /** 35 | * Class PluginDatabasesScript 36 | */ 37 | class PluginDatabasesScript extends CommonDBChild { 38 | 39 | static $rightname = "plugin_databases"; 40 | 41 | // From CommonDBChild 42 | static public $itemtype = 'PluginDatabasesDatabase'; 43 | static public $items_id = 'plugin_databases_databases_id'; 44 | 45 | /** 46 | * @param int $nb 47 | * 48 | * @return translated 49 | */ 50 | static function getTypeName($nb = 0) { 51 | 52 | return _n('Script', 'Scripts', $nb, 'databases'); 53 | } 54 | 55 | /** 56 | * @param CommonGLPI $item 57 | * @param int $withtemplate 58 | * 59 | * @return array|string|translated 60 | */ 61 | function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { 62 | 63 | if ($item->getType() == 'PluginDatabasesDatabase') { 64 | if ($_SESSION['glpishow_count_on_tabs']) { 65 | return self::createTabEntry(self::getTypeName(2), self::countForItem($item)); 66 | } 67 | return self::getTypeName(2); 68 | } 69 | 70 | return ''; 71 | } 72 | 73 | /** 74 | * @param CommonDBTM $item 75 | * 76 | * @return int 77 | */ 78 | static function countForItem(CommonDBTM $item) { 79 | $dbu = new DbUtils(); 80 | return $dbu->countElementsInTable('glpi_plugin_databases_scripts', 81 | ["plugin_databases_databases_id" => $item->getID()]); 82 | } 83 | 84 | /** 85 | * @param CommonGLPI $item 86 | * @param int $tabnum 87 | * @param int $withtemplate 88 | * 89 | * @return bool 90 | */ 91 | static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { 92 | global $CFG_GLPI; 93 | 94 | if ($item->getType() == 'PluginDatabasesDatabase') { 95 | $self = new self(); 96 | 97 | $self->showScripts($item); 98 | $self->showForm("", ['plugin_databases_databases_id' => $item->getField('id'), 99 | 'target' => $CFG_GLPI["root_doc"].PLUGIN_DATABASES_DIR_NOFULL . "/front/script.form.php"]); 100 | } 101 | return true; 102 | } 103 | 104 | /** 105 | * @param datas $input 106 | * 107 | * @return bool|datas 108 | */ 109 | function prepareInputForAdd($input) { 110 | // Not attached to reference -> not added 111 | if (!isset($input['plugin_databases_databases_id']) 112 | || $input['plugin_databases_databases_id'] <= 0 113 | ) { 114 | return false; 115 | } 116 | return $input; 117 | } 118 | 119 | /** 120 | * @param $ID 121 | * @param array $options 122 | * 123 | * @return bool 124 | */ 125 | function showForm($ID, $options = []) { 126 | 127 | if (!$this->canView()) { 128 | return false; 129 | } 130 | 131 | $plugin_databases_databases_id = -1; 132 | if (isset($options['plugin_databases_databases_id'])) { 133 | $plugin_databases_databases_id = $options['plugin_databases_databases_id']; 134 | } 135 | 136 | if ($ID > 0) { 137 | $this->check($ID, READ); 138 | } else { 139 | $database = new PluginDatabasesDatabase(); 140 | $database->getFromDB($plugin_databases_databases_id); 141 | // Create item 142 | $input = ['plugin_databases_databases_id' => $plugin_databases_databases_id, 143 | 'entities_id' => $database->getEntityID(), 144 | 'is_recursive' => $database->isRecursive()]; 145 | $this->check(-1, UPDATE, $input); 146 | } 147 | 148 | $this->showFormHeader($options); 149 | 150 | echo ""; 151 | echo ""; 152 | echo ""; 153 | 154 | echo ""; 155 | 156 | echo "" . __('Name') . ""; 157 | echo ""; 158 | Html::autocompletionTextField($this, "name"); 159 | echo ""; 160 | 161 | echo "" . __('Type') . ""; 162 | echo ""; 163 | Dropdown::show('PluginDatabasesScriptType', 164 | ['name' => "plugin_databases_scripttypes_id", 165 | 'value' => $this->fields["plugin_databases_scripttypes_id"]]); 166 | echo ""; 167 | 168 | echo ""; 169 | 170 | echo ""; 171 | 172 | echo "" . __('Path', 'databases') . ""; 173 | echo ""; 174 | Html::autocompletionTextField($this, "path"); 175 | echo ""; 176 | 177 | echo ""; 178 | echo ""; 179 | 180 | echo ""; 181 | 182 | echo ""; 183 | 184 | echo ""; 185 | echo ""; 187 | echo ""; 188 | echo "
"; 186 | echo __('Comments') . "
"; 189 | echo ""; 190 | echo "
"; 191 | echo ""; 192 | 193 | echo ""; 194 | 195 | $options['candel'] = false; 196 | $this->showFormButtons($options); 197 | 198 | return true; 199 | } 200 | 201 | /** 202 | * @since version 0.84 203 | **/ 204 | function getForbiddenStandardMassiveAction() { 205 | 206 | $forbidden = parent::getForbiddenStandardMassiveAction(); 207 | $forbidden[] = 'update'; 208 | return $forbidden; 209 | } 210 | 211 | /** 212 | * @param PluginDatabasesDatabase $database 213 | * 214 | * @return bool 215 | */ 216 | function showScripts(PluginDatabasesDatabase $database) { 217 | global $DB, $CFG_GLPI; 218 | 219 | $instID = $database->fields['id']; 220 | 221 | if (!$database->can($instID, READ)) { 222 | return false; 223 | } 224 | 225 | $rand = mt_rand(); 226 | $canedit = $database->can($instID, UPDATE); 227 | 228 | $query = "SELECT `glpi_plugin_databases_scripts`.`name` AS name, 229 | `glpi_plugin_databases_scripts`.`id`, 230 | `glpi_plugin_databases_scripts`.`plugin_databases_databases_id`, 231 | `glpi_plugin_databases_scripts`.`path`, 232 | `glpi_plugin_databases_scripts`.`comment`, 233 | `glpi_plugin_databases_scripttypes`.`name` AS type 234 | FROM `glpi_plugin_databases_scripts` "; 235 | $query .= " LEFT JOIN `glpi_plugin_databases_scripttypes` 236 | ON (`glpi_plugin_databases_scripttypes`.`id` = `glpi_plugin_databases_scripts`.`plugin_databases_scripttypes_id`)"; 237 | $query .= " LEFT JOIN `glpi_plugin_databases_databases` 238 | ON (`glpi_plugin_databases_databases`.`id` = `glpi_plugin_databases_scripts`.`plugin_databases_databases_id`)"; 239 | $query .= " WHERE `glpi_plugin_databases_scripts`.`plugin_databases_databases_id` = '$instID' 240 | ORDER BY `glpi_plugin_databases_scripts`.`name`"; 241 | $result = $DB->query($query); 242 | $number = $DB->numrows($result); 243 | 244 | echo "
"; 245 | 246 | if ($canedit && $number) { 247 | Html::openMassiveActionsForm('mass' . __CLASS__ . $rand); 248 | $massiveactionparams = []; 249 | Html::showMassiveActions( 250 | $massiveactionparams); 251 | } 252 | 253 | if ($number != 0) { 254 | echo ""; 255 | echo ""; 256 | 257 | if ($canedit && $number) { 258 | echo ""; 259 | } 260 | 261 | echo ""; 262 | echo ""; 263 | echo ""; 264 | echo ""; 265 | 266 | echo ""; 267 | 268 | Session::initNavigateListItems($this->getType(), PluginDatabasesDatabase::getTypeName(2) . " = " . $database->fields["name"]); 269 | $i = 0; 270 | $row_num = 1; 271 | 272 | while ($data = $DB->fetchArray($result)) { 273 | 274 | Session::addToNavigateListItems($this->getType(), $data['id']); 275 | 276 | $i++; 277 | $row_num++; 278 | echo ""; 279 | echo ""; 284 | 285 | echo ""; 292 | 293 | echo ""; 294 | echo ""; 295 | echo ""; 296 | echo ""; 297 | } 298 | echo "
" . Html::getCheckAllAsCheckbox('mass' . __CLASS__ . $rand) . "" . __('Name') . "" . __('Type') . "" . __('Path', 'databases') . "" . __('Comments') . "
"; 280 | if ($canedit) { 281 | Html::showMassiveActionCheckBox(__CLASS__, $data["id"]); 282 | } 283 | echo ""; 286 | echo ""; 287 | echo $data["name"]; 288 | if ($_SESSION["glpiis_ids_visible"] || empty($data["name"])) { 289 | echo " (" . $data["id"] . ")"; 290 | } 291 | echo "" . $data["type"] . "" . $data["path"] . "" . nl2br($data["comment"]) . "
"; 299 | } 300 | 301 | if ($canedit && $number) { 302 | $paramsma['ontop'] = false; 303 | Html::showMassiveActions($paramsma); 304 | Html::closeForm(); 305 | } 306 | echo "
"; 307 | } 308 | } 309 | --------------------------------------------------------------------------------