├── TODO.txt ├── locales ├── cs_CZ.mo ├── de_DE.mo ├── en_GB.mo ├── es_AR.mo ├── es_EC.mo ├── es_ES.mo ├── fi_FI.mo ├── fr_FR.mo ├── ja_JP.mo ├── pl_PL.mo ├── pt_BR.mo ├── ro_RO.mo ├── ru_RU.mo ├── tr_TR.mo ├── fi_FI.po ├── es_ES.po ├── en_GB.po ├── de_DE.po ├── ro_RO.po ├── es_AR.po ├── ru_RU.po ├── pt_BR.po └── pl_PL.po ├── webapplications.png ├── screenshots ├── entities.png ├── kbitems.png ├── servers.png ├── streams.png ├── appliances.png ├── processes.png ├── databaseinstances.png └── logicalinfrastructure.png ├── sql ├── update-1.9.0.sql ├── update-1.5.1.sql ├── update-1.8.0.sql ├── update-1.5.0.sql ├── update-1.4.sql ├── update-3.0.0.sql ├── update-1.3.sql ├── empty-3.0.0.sql ├── empty-4.0.0.sql ├── update-1.1.sql ├── update-1.6.0.sql ├── empty-1.3.sql ├── update-5.0.0.sql ├── empty-1.5.0.sql ├── empty-1.5.1.sql ├── empty-1.4.sql ├── empty-2.0.0.sql ├── empty-2.5.0.sql ├── empty-2.6.0.sql └── empty-1.6.0.sql ├── templates ├── webapplication_dashboard_summary.html.twig ├── webapplication_dashboard_generic_form.html.twig ├── webapplication_dashboard_support.html.twig ├── webapplication_entity_form.html.twig ├── webapplication_stream_form.html.twig ├── webapplication_form.html.twig ├── webapplication_database_form.html.twig └── webapplication_process_form.html.twig ├── public ├── lib │ └── jquery-ui │ │ └── images │ │ ├── ui-icons_444444_256x240.png │ │ ├── ui-icons_555555_256x240.png │ │ ├── ui-icons_777620_256x240.png │ │ ├── ui-icons_777777_256x240.png │ │ ├── ui-icons_cc0000_256x240.png │ │ └── ui-icons_ffffff_256x240.png ├── scripts │ ├── securityneedscolor.js │ └── securityneedscolor.js.php └── css │ └── webapplications.css ├── ISSUE_TEMPLATE.md ├── tools ├── update_mo.pl ├── update_po.pl └── extract_template.sh ├── .github └── workflows │ ├── updatepot.yml │ ├── generatemo.yml │ └── release.yml ├── index.php ├── front ├── index.php ├── stream.php ├── entity.php ├── process.php ├── appliance.form.php ├── stream_item.form.php ├── databaseinstance.form.php ├── process_entity.form.php ├── entity.form.php ├── process.form.php ├── stream.form.php └── dashboard.php ├── ajax └── getLists.php ├── src ├── Webapplication.php ├── Webapplicationtype.php ├── Webapplicationtechnic.php ├── Webapplicationservertype.php ├── Webapplicationexternalexposition.php ├── Certificate.php ├── Knowbase.php └── Stream_Item.php ├── README.md └── setup.php /TODO.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /locales/cs_CZ.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/locales/cs_CZ.mo -------------------------------------------------------------------------------- /locales/de_DE.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/locales/de_DE.mo -------------------------------------------------------------------------------- /locales/en_GB.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/locales/en_GB.mo -------------------------------------------------------------------------------- /locales/es_AR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/locales/es_AR.mo -------------------------------------------------------------------------------- /locales/es_EC.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/locales/es_EC.mo -------------------------------------------------------------------------------- /locales/es_ES.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/locales/es_ES.mo -------------------------------------------------------------------------------- /locales/fi_FI.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/locales/fi_FI.mo -------------------------------------------------------------------------------- /locales/fr_FR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/locales/fr_FR.mo -------------------------------------------------------------------------------- /locales/ja_JP.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/locales/ja_JP.mo -------------------------------------------------------------------------------- /locales/pl_PL.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/locales/pl_PL.mo -------------------------------------------------------------------------------- /locales/pt_BR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/locales/pt_BR.mo -------------------------------------------------------------------------------- /locales/ro_RO.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/locales/ro_RO.mo -------------------------------------------------------------------------------- /locales/ru_RU.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/locales/ru_RU.mo -------------------------------------------------------------------------------- /locales/tr_TR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/locales/tr_TR.mo -------------------------------------------------------------------------------- /webapplications.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/webapplications.png -------------------------------------------------------------------------------- /screenshots/entities.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/screenshots/entities.png -------------------------------------------------------------------------------- /screenshots/kbitems.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/screenshots/kbitems.png -------------------------------------------------------------------------------- /screenshots/servers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/screenshots/servers.png -------------------------------------------------------------------------------- /screenshots/streams.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/screenshots/streams.png -------------------------------------------------------------------------------- /screenshots/appliances.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/screenshots/appliances.png -------------------------------------------------------------------------------- /screenshots/processes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/screenshots/processes.png -------------------------------------------------------------------------------- /screenshots/databaseinstances.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/screenshots/databaseinstances.png -------------------------------------------------------------------------------- /sql/update-1.9.0.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `glpi_plugin_webapplications_webapplicationtypes` ADD `is_recursive` TINYINT(1) NOT NULL DEFAULT '0'; -------------------------------------------------------------------------------- /screenshots/logicalinfrastructure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/screenshots/logicalinfrastructure.png -------------------------------------------------------------------------------- /sql/update-1.5.1.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `glpi_plugin_appweb` 2 | ADD `helpdesk_visible` INT(11) NOT NULL DEFAULT '1', 3 | ADD `date_mod` DATETIME DEFAULT NULL; -------------------------------------------------------------------------------- /templates/webapplication_dashboard_summary.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "generic_show_form.html.twig" %} 2 | {% import 'components/form/fields_macros.html.twig' as fields %} 3 | -------------------------------------------------------------------------------- /public/lib/jquery-ui/images/ui-icons_444444_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/public/lib/jquery-ui/images/ui-icons_444444_256x240.png -------------------------------------------------------------------------------- /public/lib/jquery-ui/images/ui-icons_555555_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/public/lib/jquery-ui/images/ui-icons_555555_256x240.png -------------------------------------------------------------------------------- /public/lib/jquery-ui/images/ui-icons_777620_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/public/lib/jquery-ui/images/ui-icons_777620_256x240.png -------------------------------------------------------------------------------- /public/lib/jquery-ui/images/ui-icons_777777_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/public/lib/jquery-ui/images/ui-icons_777777_256x240.png -------------------------------------------------------------------------------- /public/lib/jquery-ui/images/ui-icons_cc0000_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/public/lib/jquery-ui/images/ui-icons_cc0000_256x240.png -------------------------------------------------------------------------------- /public/lib/jquery-ui/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/webapplications/master/public/lib/jquery-ui/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /templates/webapplication_dashboard_generic_form.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "generic_show_form.html.twig" %} 2 | {% import 'components/form/fields_macros.html.twig' as fields %} 3 | -------------------------------------------------------------------------------- /sql/update-1.8.0.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `glpi_plugin_webapplications_webapplications` 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-1.5.0.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `glpi_plugin_appweb_profiles` 2 | DROP COLUMN `interface`, 3 | DROP COLUMN `is_default`; 4 | ALTER TABLE `glpi_plugin_appweb` 5 | DROP COLUMN `target`, 6 | DROP COLUMN `link_name`, 7 | DROP COLUMN `port`, 8 | DROP COLUMN `protocol`; 9 | ALTER TABLE `glpi_plugin_appweb` 10 | ADD `FK_groups` INT(11) NOT NULL DEFAULT '0'; 11 | DROP TABLE `glpi_dropdown_plugin_appweb_protocol`; 12 | ALTER TABLE `glpi_plugin_appweb` 13 | ADD `FK_users` INT(4); 14 | ALTER TABLE `glpi_plugin_appweb_profiles` 15 | ADD `open_ticket` CHAR(1) DEFAULT NULL; -------------------------------------------------------------------------------- /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) : -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /sql/update-1.4.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `glpi_plugin_appweb` 2 | ADD `recursive` TINYINT(1) NOT NULL DEFAULT '0' 3 | AFTER `FK_entities`; 4 | 5 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_appweb_protocol`; 6 | CREATE TABLE `glpi_dropdown_plugin_appweb_protocol` ( 7 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 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 | INSERT INTO `glpi_dropdown_plugin_appweb_protocol` (`ID`, `name`, `comments`) VALUES ('1', 'http', ''); 19 | INSERT INTO `glpi_dropdown_plugin_appweb_protocol` (`ID`, `name`, `comments`) VALUES ('2', 'https', ''); -------------------------------------------------------------------------------- /.github/workflows/updatepot.yml: -------------------------------------------------------------------------------- 1 | name: Update POT 2 | on: 3 | push: 4 | branches: [ master ] 5 | paths-ignore: 6 | - 'locales/**' 7 | 8 | env: 9 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 10 | jobs: 11 | run: 12 | 13 | name: Update POT 14 | 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Checkout repo 18 | uses: actions/checkout@v4 19 | 20 | - name: install xgettext 21 | 22 | run: sudo apt-get install gettext; 23 | - name: Update POT 24 | run: sh tools/extract_template.sh; 25 | 26 | - name: Commit changes 27 | uses: EndBug/add-and-commit@v9 28 | with: 29 | message: "Update POT" 30 | 31 | - name: Push changes 32 | uses: actions-go/push@master 33 | with: 34 | commit-message: '' 35 | 36 | -------------------------------------------------------------------------------- /tools/update_po.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | #!/usr/bin/perl -w 3 | 4 | if (@ARGV!=2){ 5 | print "USAGE update_po.pl transifex_login transifex_password\n\n"; 6 | 7 | exit(); 8 | } 9 | $user = $ARGV[0]; 10 | $password = $ARGV[1]; 11 | 12 | opendir(DIRHANDLE,'locales')||die "ERROR: can not read current directory\n"; 13 | foreach (readdir(DIRHANDLE)){ 14 | if ($_ ne '..' && $_ ne '.'){ 15 | 16 | if(!(-l "$dir/$_")){ 17 | if (index($_,".po",0)==length($_)-3) { 18 | $lang=$_; 19 | $lang=~s/\.po//; 20 | 21 | `wget --no-check-certificate --user=$user --password=$password --output-document=locales/$_ http://www.transifex.com/api/2/project/GLPI_webapplications/resource/glpi/translation/$lang/?file=$_`; 22 | } 23 | } 24 | 25 | } 26 | } 27 | closedir DIRHANDLE; 28 | 29 | # 30 | # 31 | -------------------------------------------------------------------------------- /sql/update-3.0.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_appliances`; 2 | CREATE TABLE `glpi_plugin_webapplications_appliances` ( 3 | `id` int(11) NOT NULL auto_increment, 4 | `appliances_id` int(11) NOT NULL, 5 | `webapplicationtypes_id` INT(11) NOT NULL DEFAULT '0' 6 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationtypes (id)', 7 | `webapplicationservertypes_id` INT(11) NOT NULL DEFAULT '0' 8 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationservertypes (id)', 9 | `webapplicationtechnics_id` INT(11) NOT NULL DEFAULT '0' 10 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationtechnics (id)', 11 | `address` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 12 | `backoffice` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 13 | PRIMARY KEY (`id`), 14 | KEY `appliances_id` (`appliances_id`) 15 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 16 | -------------------------------------------------------------------------------- /.github/workflows/generatemo.yml: -------------------------------------------------------------------------------- 1 | name: Generate MO 2 | on: 3 | push: 4 | branches: [ master ] 5 | paths: 6 | - '**.po' 7 | env: 8 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 9 | jobs: 10 | run: 11 | 12 | name: Generate mo 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout repo 16 | uses: actions/checkout@v4 17 | 18 | - name: Setup Perl environment 19 | # You may pin to the exact commit or the version. 20 | # uses: shogo82148/actions-setup-perl@8d2e3d59a9516b785ed32169d48a4888eaa9b514 21 | uses: shogo82148/actions-setup-perl@v1 22 | - name: msgfmt 23 | # You may pin to the exact commit or the version. 24 | # uses: whtsky/msgfmt-action@6b2181f051b002182d01a1e1f1aff216230c5a4d 25 | uses: whtsky/msgfmt-action@20190305 26 | - name: Generate mo 27 | run: perl tools/update_mo.pl; 28 | 29 | - name: Commit changes 30 | uses: EndBug/add-and-commit@v9 31 | with: 32 | 33 | message: "Generate mo" 34 | - name: Push changes 35 | 36 | uses: actions-go/push@master 37 | 38 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | -------------------------------------------------------------------------------- /front/index.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | -------------------------------------------------------------------------------- /templates/webapplication_dashboard_support.html.twig: -------------------------------------------------------------------------------- 1 | {#{% extends "generic_show_form.html.twig" %}#} 2 | {% import 'components/form/fields_macros.html.twig' as fields %} 3 | {% set params = params ?? [] %} 4 | {% set field_options = { 5 | 'full_width': true, 6 | 'add_field_class': (is_expanded ? 'col-sm-12' : ''), 7 | } %} 8 | 9 | {% block more_fields %} 10 | 11 | {% set editor_item = get_item(params['itemtype'], params['items_id']) %} 12 | {{ fields.htmlField( 13 | 'editor', 14 | editor_item.getLink(), 15 | __("Referent editor", 'webapplications'), 16 | field_options|merge({ 17 | 'add_field_class': 'col-sm-12', 18 | }) 19 | ) }} 20 | 21 | {{ fields.htmlField( 22 | "email", 23 | params['editoremail'], 24 | __("Mail support", 'webapplications'), 25 | field_options|merge({ 26 | 'add_field_class': 'col-sm-12', 27 | }) 28 | ) }} 29 | 30 | {{ fields.htmlField( 31 | "phonenumber", 32 | params['editorephonenumber'], 33 | __("Phone support", 'webapplications'), 34 | field_options|merge({ 35 | 'add_field_class': 'col-sm-12', 36 | }) 37 | ) }} 38 | 39 | {% endblock %} 40 | -------------------------------------------------------------------------------- /templates/webapplication_entity_form.html.twig: -------------------------------------------------------------------------------- 1 | {% import "components/form/fields_macros.html.twig" as fields %} 2 | 3 | 4 | {% extends "generic_show_form.html.twig" %} 5 | 6 | {% block more_fields %} 7 | 8 | {% if item.isField('owner') %} 9 | {{ fields.dropdownField( 10 | 'User', 11 | 'owner', 12 | item.fields['owner'], 13 | __('Owner', 'webapplications'), 14 | field_options|merge({ 15 | 'right': 'all', 16 | }) 17 | )}} 18 | {% endif %} 19 | 20 | {% if item.isField('security_contact') %} 21 | {{ fields.dropdownField( 22 | 'User', 23 | 'security_contact', 24 | item.fields['security_contact'], 25 | __('Security Contact', 'webapplications'), 26 | field_options|merge({ 27 | 'right': 'all', 28 | }) 29 | ) }} 30 | {% endif %} 31 | 32 | 33 | {% if item.isField('relation_nature') %} 34 | {{ fields.autoNameField( 35 | 'relation_nature', 36 | item, 37 | __('Relation nature', 'webapplications'), 38 | withtemplate 39 | ) }} 40 | {% endif %} 41 | 42 | 43 | 44 | {% endblock %} 45 | 46 | -------------------------------------------------------------------------------- /public/scripts/securityneedscolor.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | $(document).ajaxComplete(function () { 3 | document.querySelectorAll('[name="webapplicationavailabilities"], [name="webapplicationintegrities"], ' + 4 | '[name="webapplicationconfidentialities"], [name="webapplicationtraceabilities"]').forEach(function (e) { 5 | 6 | let select2id = e.id; 7 | let select2obj = "#" + select2id; 8 | 9 | var childSpan = $(select2obj).next('span').find('span:first-child'); 10 | 11 | if (typeof (childSpan.children()[0]) !== 'undefined') { 12 | childSpan.children()[0].style = "color: black; font-weight: bold"; 13 | } 14 | 15 | switch ($(select2obj).text()) { 16 | case '1': 17 | childSpan.css("background-color", "#00FF00"); 18 | break; 19 | case '2': 20 | childSpan.css("background-color", "#FFFF00"); 21 | break; 22 | case '3': 23 | childSpan.css("background-color", "#FF9900"); 24 | break; 25 | case '4': 26 | childSpan.css("background-color", "#FF0000"); 27 | break; 28 | default: 29 | childSpan.css("background-color", "#999999"); 30 | break; 31 | } 32 | }); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /front/stream.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | 31 | use GlpiPlugin\Webapplications\Stream; 32 | 33 | Session::checkRight("plugin_webapplications_streams", READ); 34 | 35 | Html::header(Stream::getTypeName(2), $_SERVER['PHP_SELF'], "appliancedashboard", Stream::class); 36 | 37 | Search::show(Stream::class); 38 | 39 | Html::footer(); 40 | -------------------------------------------------------------------------------- /front/entity.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | 31 | use GlpiPlugin\Webapplications\Entity; 32 | 33 | Session::checkRight("plugin_webapplications_entities", READ); 34 | 35 | Html::header(Entity::getTypeName(2), $_SERVER['PHP_SELF'], "appliancedashboard", Entity::class); 36 | 37 | Search::show(Entity::class); 38 | 39 | Html::footer(); 40 | 41 | -------------------------------------------------------------------------------- /front/process.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | use GlpiPlugin\Webapplications\Process; 31 | 32 | Session::checkRight("plugin_webapplications_processes", READ); 33 | 34 | Html::header(Process::getTypeName(2), $_SERVER['PHP_SELF'], "appliancedashboard", Process::class); 35 | 36 | Search::show(Process::class); 37 | 38 | Html::footer(); 39 | 40 | -------------------------------------------------------------------------------- /ajax/getLists.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | 31 | use GlpiPlugin\Webapplications\Dashboard; 32 | 33 | header("Content-Type: text/html; charset=UTF-8"); 34 | Html::header_nocache(); 35 | 36 | Session::checkLoginUser(); 37 | 38 | if (isset($_POST['value']) 39 | && $_POST['value'] > 0) { 40 | $_SESSION['plugin_webapplications_loaded_appliances_id'] = $_POST['value']; 41 | $dashboard = new Dashboard(); 42 | $dashboard->display(['id' => 1, 'appliances_id' => $_SESSION['plugin_webapplications_loaded_appliances_id']]); 43 | } 44 | -------------------------------------------------------------------------------- /front/appliance.form.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | Session::checkLoginUser(); 31 | 32 | use GlpiPlugin\Webapplications\Appliance; 33 | 34 | if (!isset($_GET["id"])) { 35 | $_GET["id"] = ""; 36 | } 37 | if (!isset($_GET["withtemplate"])) { 38 | $_GET["withtemplate"] = ""; 39 | } 40 | 41 | $instance = new Appliance(); 42 | 43 | if (isset($_GET['_in_modal'])) { 44 | Html::popHeader(Appliance::getTypeName(2), $_SERVER['PHP_SELF']); 45 | $_SESSION['reload']=true; 46 | \Appliance::displayFullPageForItem($_GET['id'] ); 47 | Html::popFooter(); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/Webapplication.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | namespace GlpiPlugin\Webapplications; 31 | 32 | use CommonDBTM; 33 | 34 | if (!defined('GLPI_ROOT')) { 35 | die("Sorry. You can't access directly to this file"); 36 | } 37 | 38 | /** 39 | * Class Webapplication 40 | */ 41 | class Webapplication extends CommonDBTM 42 | { 43 | public $dohistory = true; 44 | public static $rightname = "plugin_webapplications_appliances"; 45 | 46 | /** 47 | * @param int $nb 48 | * 49 | * @return string 50 | */ 51 | public static function getTypeName($nb = 0) 52 | { 53 | return __('Appliance dashboard', 'webapplications'); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/Webapplicationtype.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | namespace GlpiPlugin\Webapplications; 31 | 32 | use CommonDropdown; 33 | 34 | if (!defined('GLPI_ROOT')) { 35 | die("Sorry. You can't access directly to this file"); 36 | } 37 | 38 | // Class for a Dropdown 39 | 40 | /** 41 | * Class Type 42 | */ 43 | class Webapplicationtype extends CommonDropdown 44 | { 45 | public static $rightname = "plugin_webapplications_appliances"; 46 | public $can_be_translated = true; 47 | 48 | /** 49 | * @param int $nb 50 | * 51 | * @return string 52 | */ 53 | public static function getTypeName($nb = 0) 54 | { 55 | return _n('Category', 'Categories', $nb, 'webapplications'); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/Webapplicationtechnic.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | namespace GlpiPlugin\Webapplications; 31 | 32 | use CommonDropdown; 33 | 34 | if (!defined('GLPI_ROOT')) { 35 | die("Sorry. You can't access directly to this file"); 36 | } 37 | 38 | /** 39 | * Class Webapplicationtechnic 40 | */ 41 | class Webapplicationtechnic extends CommonDropdown 42 | { 43 | public static $rightname = "plugin_webapplications_appliances"; 44 | public $can_be_translated = true; 45 | 46 | /** 47 | * @param int $nb 48 | * 49 | * @return string 50 | */ 51 | public static function getTypeName($nb = 0) 52 | { 53 | return _n('Language of treatment', 'Languages of treatment', $nb, 'webapplications'); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/Webapplicationservertype.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | namespace GlpiPlugin\Webapplications; 31 | 32 | use CommonDropdown; 33 | 34 | if (!defined('GLPI_ROOT')) { 35 | die("Sorry. You can't access directly to this file"); 36 | } 37 | 38 | /** 39 | * Class Webapplicationservertype 40 | */ 41 | class Webapplicationservertype extends CommonDropdown 42 | { 43 | public static $rightname = "plugin_webapplications_appliances"; 44 | public $can_be_translated = true; 45 | 46 | /** 47 | * @param int $nb 48 | * 49 | * @return string 50 | */ 51 | public static function getTypeName($nb = 0) 52 | { 53 | return _n('Type of treatment server', 'Types of treatment server', $nb, 'webapplications'); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/Webapplicationexternalexposition.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | namespace GlpiPlugin\Webapplications; 31 | 32 | use CommonDropdown; 33 | 34 | if (!defined('GLPI_ROOT')) { 35 | die("Sorry. You can't access directly to this file"); 36 | } 37 | 38 | /** 39 | * Class Webapplicationexternalexposition 40 | */ 41 | class Webapplicationexternalexposition extends CommonDropdown 42 | { 43 | public static $rightname = "plugin_webapplications_appliances"; 44 | public $can_be_translated = true; 45 | 46 | /** 47 | * @param int $nb 48 | * 49 | * @return string 50 | */ 51 | public static function getTypeName($nb = 0) 52 | { 53 | return _n('External exposition', 'External exposition', $nb, 'webapplications'); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /front/stream_item.form.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | Session::checkLoginUser(); 31 | 32 | use GlpiPlugin\Webapplications\Stream; 33 | use GlpiPlugin\Webapplications\Stream_Item; 34 | 35 | if (!isset($_GET["id"])) { 36 | $_GET["id"] = ""; 37 | } 38 | if (!isset($_GET["withtemplate"])) { 39 | $_GET["withtemplate"] = ""; 40 | } 41 | 42 | $stream = new Stream(); 43 | $streamItem = new Stream_Item(); 44 | 45 | if (isset($_POST["add"])) { 46 | $stream->check(-1, CREATE, $_POST); 47 | $newID = $streamItem->add($_POST); 48 | if ($_SESSION['glpibackcreated']) { 49 | Html::redirect($streamItem->getFormURL() . "?id=" . $newID); 50 | } 51 | Html::back(); 52 | } elseif (isset($_POST["update"])) { 53 | $stream->check($_POST['id'], UPDATE); 54 | $streamItem->update($_POST); 55 | Html::back(); 56 | } 57 | -------------------------------------------------------------------------------- /front/databaseinstance.form.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | 31 | Session::checkLoginUser(); 32 | 33 | if (!isset($_GET["id"])) { 34 | $_GET["id"] = ""; 35 | } 36 | if (!isset($_GET["withtemplate"])) { 37 | $_GET["withtemplate"] = ""; 38 | } 39 | 40 | if (isset($_GET['_in_modal'])) { 41 | Html::popHeader(\DatabaseInstance::getTypeName(2), $_SERVER['PHP_SELF']); 42 | $_SESSION['reload']=true; 43 | 44 | $options = ['withtemplate' => $_GET["withtemplate"], 'formoptions' => "data-track-changes=true"]; 45 | if(isset($_GET['appliance_id'])) { 46 | $options['appliances_id'] = $_GET['appliance_id']; 47 | } 48 | \DatabaseInstance::displayFullPageForItem($_GET['id'], $options ); 49 | 50 | 51 | Html::popFooter(); 52 | 53 | } 54 | else { 55 | 56 | \DatabaseInstance::displayFullPageForItem($_GET['id']); 57 | } 58 | -------------------------------------------------------------------------------- /front/process_entity.form.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | Session::checkLoginUser(); 31 | 32 | use GlpiPlugin\Webapplications\Process; 33 | use GlpiPlugin\Webapplications\Process_Entity; 34 | 35 | if (!isset($_GET["id"])) { 36 | $_GET["id"] = ""; 37 | } 38 | if (!isset($_GET["withtemplate"])) { 39 | $_GET["withtemplate"] = ""; 40 | } 41 | 42 | $process = new Process(); 43 | $processEntity = new Process_Entity(); 44 | 45 | if (isset($_POST["add"])) { 46 | $process->check(-1, CREATE, $_POST); 47 | $newID = $processEntity->add($_POST); 48 | if ($_SESSION['glpibackcreated']) { 49 | Html::redirect($processEntity->getFormURL() . "?id=" . $newID); 50 | } 51 | Html::back(); 52 | } elseif (isset($_POST["update"])) { 53 | $process->check($_POST['id'], UPDATE); 54 | $processEntity->update($_POST); 55 | Html::back(); 56 | } 57 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # webapplications 2 | Plugin webapplications pour GLPI 3 | 4 | Ce plugin vous permet d'afficher vos applications métiers de votre réseau sous forme de dashboard. 5 | 6 | > * Informations générales 7 | 8 | ![alt text](https://github.com/InfotelGLPI/webapplications/blob/master/screenshots/appliances.png?raw=true) 9 | 10 | > * Ecosystème 11 | 12 | ![alt text](https://github.com/InfotelGLPI/webapplications/blob/master/screenshots/entities.png?raw=true) 13 | 14 | > * Processus 15 | 16 | ![alt text](https://github.com/InfotelGLPI/webapplications/blob/master/screenshots/processes.png?raw=true) 17 | 18 | > * Infrastructure physique 19 | 20 | ![alt text](https://github.com/InfotelGLPI/webapplications/blob/master/screenshots/servers.png?raw=true) 21 | 22 | > * Infrastructure logique 23 | 24 | ![alt text](https://github.com/InfotelGLPI/webapplications/blob/master/screenshots/logicalinfrastructure.png?raw=true) 25 | 26 | > * Bases de données 27 | 28 | ![alt text](https://github.com/InfotelGLPI/webapplications/blob/master/screenshots/databaseinstances.png?raw=true) 29 | 30 | > * Flux 31 | 32 | ![alt text](https://github.com/InfotelGLPI/webapplications/blob/master/screenshots/streams.png?raw=true) 33 | 34 | > * Base de connaissance associée 35 | 36 | ![alt text](https://github.com/InfotelGLPI/webapplications/blob/master/screenshots/kbitems.png?raw=true) 37 | 38 | Si besoin de définir l'environnement en GLPI 10 : 39 | https://github.com/glpi-project/glpi/pull/18288 40 | 41 | Ce plugin est sur Transifex - Aidez-nous à le traduire : 42 | https://www.transifex.com/infotelGLPI/GLPI_webapplications/ 43 | 44 | *********************** 45 | 46 | This plugin allows you to display your business applications of your network in the form of a dashboard. 47 | 48 | > * General information 49 | > * Ecosystem 50 | > * Processes 51 | > * Physical infrastructure 52 | > * Logical infrastructure 53 | > * Databases 54 | > * Flows 55 | > * Associated knowledge base 56 | 57 | This plugin is on Transifex - Help us to translate : 58 | https://www.transifex.com/infotelGLPI/GLPI_webapplications/ 59 | 60 | 61 | -------------------------------------------------------------------------------- /tools/extract_template.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | 4 | # --- Étape 1 : Extraction des chaînes PHP --- 5 | find . -name '*.php' > php_files.list 6 | 7 | xgettext --files-from=php_files.list \ 8 | --copyright-holder='Webapplications Development Team' \ 9 | --package-name='Webapplications plugin' \ 10 | -o locales/glpi.pot \ 11 | -L PHP \ 12 | --add-comments=TRANS \ 13 | --from-code=UTF-8 \ 14 | --force-po \ 15 | --sort-output \ 16 | --keyword=_n:1,2,4t \ 17 | --keyword=__s:1,2t \ 18 | --keyword=__:1,2t \ 19 | --keyword=_e:1,2t \ 20 | --keyword=_x:1c,2,3t \ 21 | --keyword=_ex:1c,2,3t \ 22 | --keyword=_nx:1c,2,3,5t \ 23 | --keyword=_sx:1c,2,3t 24 | 25 | rm php_files.list 26 | 27 | # --- Étape 2 : Extraction des chaînes Twig --- 28 | 29 | # Append locales from Twig templates 30 | SCRIPT_DIR=$(dirname $0) 31 | WORKING_DIR=$(readlink -f "$SCRIPT_DIR/..") # Script will be executed from "vendor/bin" directory 32 | # Define translate function args 33 | F_ARGS_N="1,2" 34 | F_ARGS__S="1" 35 | F_ARGS__="1" 36 | F_ARGS_X="1c,2" 37 | F_ARGS_SX="1c,2" 38 | F_ARGS_NX="1c,2,3" 39 | F_ARGS_SN="1,2" 40 | 41 | for file in $(cd $WORKING_DIR && find -regextype posix-egrep -not -regex $EXCLUDE_REGEX "$SCRIPT_DIR/.." -name "*.twig") 42 | do 43 | # 1. Convert file content to replace "{{ function(.*) }}" by "" and extract strings via std input 44 | # 2. Replace "standard input:line_no" by file location in po file comments 45 | contents=`cat $file | sed -r "s|\{\{\s*([a-z0-9_]+\(.*\))\s*\}\}||gi"` 46 | cat $file | perl -0pe "s/\{\{(.*?)\}\}//gism" | xgettext - \ 47 | -o locales/glpi.pot \ 48 | -L PHP \ 49 | --add-comments=TRANS \ 50 | --from-code=UTF-8 \ 51 | --force-po \ 52 | --join-existing \ 53 | --sort-output \ 54 | --keyword=_n:$F_ARGS_N \ 55 | --keyword=__:$F_ARGS__ \ 56 | --keyword=_x:$F_ARGS_X \ 57 | --keyword=_nx:$F_ARGS_NX 58 | sed -i -r "s|standard input:([0-9]+)|`echo $file | sed "s|./||"`:\1|g" locales/glpi.pot 59 | done 60 | -------------------------------------------------------------------------------- /locales/fi_FI.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Webapplications Development Team 3 | # This file is distributed under the same license as the GLPI - Webapplications plugin package. 4 | # 5 | # Translators: 6 | # Markku Vepsä, 2018 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: GLPI Project - webapplications plugin\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2020-07-23 08:39+0200\n" 12 | "PO-Revision-Date: 2020-07-23 06:48+0000\n" 13 | "Last-Translator: Xavier CAILLAUD \n" 14 | "Language-Team: Finnish (Finland) (http://www.transifex.com/infotelGLPI/GLPI_webapplications/language/fi_FI/)\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Language: fi_FI\n" 19 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 20 | 21 | #: hook.php:281 inc/appliance.class.php:57 22 | msgid "Backoffice URL" 23 | msgstr "Tuki URL" 24 | 25 | #: setup.php:72 inc/profile.class.php:175 inc/webapplication.class.php:48 26 | msgid "Web application" 27 | msgid_plural "Web applications" 28 | msgstr[0] "Web-sovellus" 29 | msgstr[1] "Web-sovellukset" 30 | 31 | #: front/webapplication.php:42 front/webapplication.php:45 32 | msgid "Core migration" 33 | msgstr "" 34 | 35 | #: front/webapplication.php:47 36 | msgid "Are you sure you want to do core migration ??" 37 | msgstr "" 38 | 39 | #: front/webapplication.php:58 40 | msgid "Data migration" 41 | msgstr "" 42 | 43 | #: front/webapplication.php:100 44 | msgid "Tables purge" 45 | msgstr "" 46 | 47 | #: front/webapplication.php:122 48 | msgid "Link with core purge" 49 | msgstr "" 50 | 51 | #: front/webapplication.php:143 52 | msgid "Migration was successful" 53 | msgstr "" 54 | 55 | #: inc/appliance.class.php:81 56 | msgid "Editor" 57 | msgstr "Muokkausohjelma" 58 | 59 | #: inc/webapplicationservertype.class.php:49 60 | msgid "Type of treatment server" 61 | msgid_plural "Types of treatment server" 62 | msgstr[0] "Käsittelypalvelimen tyyppi" 63 | msgstr[1] "Käsittelypalvelimen tyypit" 64 | 65 | #: inc/webapplicationtechnic.class.php:49 66 | msgid "Language of treatment" 67 | msgid_plural "Languages of treatment" 68 | msgstr[0] "Palvelun kielet" 69 | msgstr[1] "Palvelun kielet" 70 | 71 | #: inc/webapplicationtype.class.php:50 72 | msgid "Category" 73 | msgid_plural "Categories" 74 | msgstr[0] "Luokka" 75 | msgstr[1] "Luokat" 76 | -------------------------------------------------------------------------------- /locales/es_ES.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Webapplications Development Team 3 | # This file is distributed under the same license as the GLPI - Webapplications plugin package. 4 | # 5 | # Translators: 6 | # cbc5204086c375034e77848ef6290ebe, 2015 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: GLPI Project - webapplications plugin\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2020-07-23 08:39+0200\n" 12 | "PO-Revision-Date: 2020-07-23 06:48+0000\n" 13 | "Last-Translator: Xavier CAILLAUD \n" 14 | "Language-Team: Spanish (Spain) (http://www.transifex.com/infotelGLPI/GLPI_webapplications/language/es_ES/)\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Language: es_ES\n" 19 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 20 | 21 | #: hook.php:281 inc/appliance.class.php:57 22 | msgid "Backoffice URL" 23 | msgstr "URL de administración" 24 | 25 | #: setup.php:72 inc/profile.class.php:175 inc/webapplication.class.php:48 26 | msgid "Web application" 27 | msgid_plural "Web applications" 28 | msgstr[0] "Aplicativo web" 29 | msgstr[1] "Aplicativos web" 30 | 31 | #: front/webapplication.php:42 front/webapplication.php:45 32 | msgid "Core migration" 33 | msgstr "" 34 | 35 | #: front/webapplication.php:47 36 | msgid "Are you sure you want to do core migration ??" 37 | msgstr "" 38 | 39 | #: front/webapplication.php:58 40 | msgid "Data migration" 41 | msgstr "" 42 | 43 | #: front/webapplication.php:100 44 | msgid "Tables purge" 45 | msgstr "" 46 | 47 | #: front/webapplication.php:122 48 | msgid "Link with core purge" 49 | msgstr "" 50 | 51 | #: front/webapplication.php:143 52 | msgid "Migration was successful" 53 | msgstr "" 54 | 55 | #: inc/appliance.class.php:81 56 | msgid "Editor" 57 | msgstr "Editor" 58 | 59 | #: inc/webapplicationservertype.class.php:49 60 | msgid "Type of treatment server" 61 | msgid_plural "Types of treatment server" 62 | msgstr[0] "Tipo de servidor de procesamiento" 63 | msgstr[1] "Tipos de servidor de procesamiento" 64 | 65 | #: inc/webapplicationtechnic.class.php:49 66 | msgid "Language of treatment" 67 | msgid_plural "Languages of treatment" 68 | msgstr[0] "Lenguaje de procesamiento" 69 | msgstr[1] "Lenguajes de procesamiento" 70 | 71 | #: inc/webapplicationtype.class.php:50 72 | msgid "Category" 73 | msgid_plural "Categories" 74 | msgstr[0] "Categoría" 75 | msgstr[1] "Categorías" 76 | -------------------------------------------------------------------------------- /templates/webapplication_stream_form.html.twig: -------------------------------------------------------------------------------- 1 | {% import "components/form/fields_macros.html.twig" as fields %} 2 | 3 | {% extends "generic_show_form.html.twig" %} 4 | 5 | {% block more_fields %} 6 | 7 | {{ fields.noLabelField( 8 | html_side 9 | ) }} 10 | 11 | 12 | {% if readlonly == true %} 13 | {{ fields.htmlField( 14 | 'transmitter', 15 | linkTransmitter, 16 | __('Source', 'webapplications'), 17 | ) }} 18 | {% else %} 19 | {{ fields.dropdownItemsFromItemtypes( 20 | 'transmitter', 21 | __('Source', 'webapplications'), 22 | {'items_id_name': 'transmitter', 23 | 'itemtype_name': 'transmitter_type', 24 | 'itemtypes': params['stream_types']} 25 | ) }} 26 | {{ fields.htmlField( 27 | 'transmitter', 28 | params['linkTransmitter'], 29 | __('') 30 | ) }} 31 | {% endif %} 32 | 33 | {% if readlonly == true %} 34 | {{ fields.htmlField( 35 | 'receiver', 36 | linkReceiver, 37 | __('Destination', 'webapplications'), 38 | ) }} 39 | {% else %} 40 | {{ fields.dropdownItemsFromItemtypes( 41 | 'receiver', 42 | __('Destination', 'webapplications'), 43 | {'items_id_name': 'receiver', 44 | 'itemtype_name': 'receiver_type', 45 | 'itemtypes': params['stream_types']} 46 | ) }} 47 | {{ fields.htmlField( 48 | 'receiver', 49 | params['linkReceiver'], 50 | __('') 51 | ) }} 52 | {% endif %} 53 | 54 | {{ fields.dropdownYesNo( 55 | "encryption", 56 | item.fields['encryption'], 57 | __('Encryption', 'webapplications'), 58 | ) }} 59 | 60 | {{ fields.autoNameField( 61 | 'encryption_type', 62 | item, 63 | __('Encryption type', 'webapplications'), 64 | withtemplate 65 | ) }} 66 | 67 | {{ fields.autoNameField( 68 | 'port', 69 | item, 70 | __('Port', 'webapplications'), 71 | withtemplate 72 | ) }} 73 | 74 | {{ fields.autoNameField( 75 | 'protocol', 76 | item, 77 | __('Protocol', 'webapplications'), 78 | withtemplate 79 | ) }} 80 | 81 | 82 | {% endblock %} 83 | 84 | -------------------------------------------------------------------------------- /locales/en_GB.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Webapplications Development Team 3 | # This file is distributed under the same license as the GLPI - Webapplications plugin package. 4 | # 5 | # Translators: 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: GLPI Project - webapplications plugin\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2020-07-23 08:39+0200\n" 11 | "PO-Revision-Date: 2020-07-23 06:48+0000\n" 12 | "Last-Translator: Xavier CAILLAUD \n" 13 | "Language-Team: English (United Kingdom) (http://www.transifex.com/infotelGLPI/GLPI_webapplications/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:281 inc/appliance.class.php:57 21 | msgid "Backoffice URL" 22 | msgstr "Backoffice URL" 23 | 24 | #: setup.php:72 inc/profile.class.php:175 inc/webapplication.class.php:48 25 | msgid "Web application" 26 | msgid_plural "Web applications" 27 | msgstr[0] "Web application" 28 | msgstr[1] "Web applications" 29 | 30 | #: front/webapplication.php:42 front/webapplication.php:45 31 | msgid "Core migration" 32 | msgstr "Core migration" 33 | 34 | #: front/webapplication.php:47 35 | msgid "Are you sure you want to do core migration ??" 36 | msgstr "Are you sure you want to do core migration ??" 37 | 38 | #: front/webapplication.php:58 39 | msgid "Data migration" 40 | msgstr "Data migration" 41 | 42 | #: front/webapplication.php:100 43 | msgid "Tables purge" 44 | msgstr "Tables purge" 45 | 46 | #: front/webapplication.php:122 47 | msgid "Link with core purge" 48 | msgstr "Link with core purge" 49 | 50 | #: front/webapplication.php:143 51 | msgid "Migration was successful" 52 | msgstr "Migration was successful" 53 | 54 | #: inc/appliance.class.php:81 55 | msgid "Editor" 56 | msgstr "Editor" 57 | 58 | #: inc/webapplicationservertype.class.php:49 59 | msgid "Type of treatment server" 60 | msgid_plural "Types of treatment server" 61 | msgstr[0] "Type of treatment server" 62 | msgstr[1] "Types of treatment server" 63 | 64 | #: inc/webapplicationtechnic.class.php:49 65 | msgid "Language of treatment" 66 | msgid_plural "Languages of treatment" 67 | msgstr[0] "Language of treatment" 68 | msgstr[1] "Languages of treatment" 69 | 70 | #: inc/webapplicationtype.class.php:50 71 | msgid "Category" 72 | msgid_plural "Categories" 73 | msgstr[0] "Category" 74 | msgstr[1] "Categories" 75 | -------------------------------------------------------------------------------- /locales/de_DE.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Webapplications Development Team 3 | # This file is distributed under the same license as the GLPI - Webapplications plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # Michael Schieferer, 2022 9 | # 10 | #, fuzzy 11 | msgid "" 12 | msgstr "" 13 | "Project-Id-Version: GLPI - Webapplications plugin\n" 14 | "Report-Msgid-Bugs-To: \n" 15 | "POT-Creation-Date: 2022-06-02 07:46+0000\n" 16 | "PO-Revision-Date: 2020-11-02 16:31+0000\n" 17 | "Last-Translator: Michael Schieferer, 2022\n" 18 | "Language-Team: German (Germany) (https://www.transifex.com/infotelGLPI/teams/12376/de_DE/)\n" 19 | "MIME-Version: 1.0\n" 20 | "Content-Type: text/plain; charset=UTF-8\n" 21 | "Content-Transfer-Encoding: 8bit\n" 22 | "Language: de_DE\n" 23 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 24 | 25 | #: hook.php:279 26 | msgid "Backoffice URL" 27 | msgstr "Administrations-URL" 28 | 29 | #: setup.php:79 inc/appliance.class.php:44 inc/profile.class.php:175 30 | #: inc/webapplication.class.php:48 31 | msgid "Web application" 32 | msgid_plural "Web applications" 33 | msgstr[0] "Webanwendung" 34 | msgstr[1] "Webanwendungen" 35 | 36 | #: front/webapplication.php:42 front/webapplication.php:45 37 | msgid "Core migration" 38 | msgstr "Core-Migration" 39 | 40 | #: front/webapplication.php:47 41 | msgid "Are you sure you want to do core migration ?" 42 | msgstr "Soll die Core-Migration wirklich gestartet werden?" 43 | 44 | #: front/webapplication.php:58 45 | msgid "Data migration" 46 | msgstr "Datenmigration" 47 | 48 | #: front/webapplication.php:144 49 | msgid "Tables purge" 50 | msgstr "Tabellen leeren" 51 | 52 | #: front/webapplication.php:166 53 | msgid "Link with core purge" 54 | msgstr "Mit Kernbereinigung verlinken" 55 | 56 | #: front/webapplication.php:187 57 | msgid "Migration was successful" 58 | msgstr "Datenmigration erfolgreich" 59 | 60 | #: inc/webapplicationservertype.class.php:49 61 | msgid "Type of treatment server" 62 | msgid_plural "Types of treatment server" 63 | msgstr[0] "Art des Webservers" 64 | msgstr[1] "Arten von Webservern" 65 | 66 | #: inc/webapplicationtechnic.class.php:49 67 | msgid "Language of treatment" 68 | msgid_plural "Languages of treatment" 69 | msgstr[0] "Programmiersprache" 70 | msgstr[1] "Programmiersprachen" 71 | 72 | #: inc/webapplicationtype.class.php:50 73 | msgid "Category" 74 | msgid_plural "Categories" 75 | msgstr[0] "Kategorie" 76 | msgstr[1] "Kategorien" 77 | -------------------------------------------------------------------------------- /locales/ro_RO.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Webapplications Development Team 3 | # This file is distributed under the same license as the GLPI - Webapplications plugin package. 4 | # 5 | # Translators: 6 | # Doru DEACONU , 2013 7 | # Doru DEACONU , 2012 8 | msgid "" 9 | msgstr "" 10 | "Project-Id-Version: GLPI Project - webapplications plugin\n" 11 | "Report-Msgid-Bugs-To: \n" 12 | "POT-Creation-Date: 2020-07-23 08:39+0200\n" 13 | "PO-Revision-Date: 2020-07-23 06:48+0000\n" 14 | "Last-Translator: Xavier CAILLAUD \n" 15 | "Language-Team: Romanian (Romania) (http://www.transifex.com/infotelGLPI/GLPI_webapplications/language/ro_RO/)\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Language: ro_RO\n" 20 | "Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n" 21 | 22 | #: hook.php:281 inc/appliance.class.php:57 23 | msgid "Backoffice URL" 24 | msgstr "URL de administrare" 25 | 26 | #: setup.php:72 inc/profile.class.php:175 inc/webapplication.class.php:48 27 | msgid "Web application" 28 | msgid_plural "Web applications" 29 | msgstr[0] "Aplicaţie web" 30 | msgstr[1] "Aplicaţii web" 31 | msgstr[2] "Aplicaţii web" 32 | 33 | #: front/webapplication.php:42 front/webapplication.php:45 34 | msgid "Core migration" 35 | msgstr "" 36 | 37 | #: front/webapplication.php:47 38 | msgid "Are you sure you want to do core migration ??" 39 | msgstr "" 40 | 41 | #: front/webapplication.php:58 42 | msgid "Data migration" 43 | msgstr "" 44 | 45 | #: front/webapplication.php:100 46 | msgid "Tables purge" 47 | msgstr "" 48 | 49 | #: front/webapplication.php:122 50 | msgid "Link with core purge" 51 | msgstr "" 52 | 53 | #: front/webapplication.php:143 54 | msgid "Migration was successful" 55 | msgstr "" 56 | 57 | #: inc/appliance.class.php:81 58 | msgid "Editor" 59 | msgstr "Editor" 60 | 61 | #: inc/webapplicationservertype.class.php:49 62 | msgid "Type of treatment server" 63 | msgid_plural "Types of treatment server" 64 | msgstr[0] "Tip server de tratare" 65 | msgstr[1] "Tipuri de servere de tratare" 66 | msgstr[2] "Tipuri de servere de tratare" 67 | 68 | #: inc/webapplicationtechnic.class.php:49 69 | msgid "Language of treatment" 70 | msgid_plural "Languages of treatment" 71 | msgstr[0] "Limba de tratare" 72 | msgstr[1] "Limbi de tratare" 73 | msgstr[2] "Limbi de tratare" 74 | 75 | #: inc/webapplicationtype.class.php:50 76 | msgid "Category" 77 | msgid_plural "Categories" 78 | msgstr[0] "Categorie" 79 | msgstr[1] "Categorii" 80 | msgstr[2] "Categorii" 81 | -------------------------------------------------------------------------------- /locales/es_AR.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Webapplications Development Team 3 | # This file is distributed under the same license as the GLPI - Webapplications plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # Luis Angel Uriarte , 2020 9 | # 10 | #, fuzzy 11 | msgid "" 12 | msgstr "" 13 | "Project-Id-Version: GLPI - Webapplications plugin\n" 14 | "Report-Msgid-Bugs-To: \n" 15 | "POT-Creation-Date: 2020-11-03 13:03+0000\n" 16 | "PO-Revision-Date: 2020-11-02 16:31+0000\n" 17 | "Last-Translator: Luis Angel Uriarte , 2020\n" 18 | "Language-Team: Spanish (Argentina) (https://www.transifex.com/infotelGLPI/teams/12376/es_AR/)\n" 19 | "MIME-Version: 1.0\n" 20 | "Content-Type: text/plain; charset=UTF-8\n" 21 | "Content-Transfer-Encoding: 8bit\n" 22 | "Language: es_AR\n" 23 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 24 | 25 | #: hook.php:279 inc/appliance.class.php:57 26 | msgid "Backoffice URL" 27 | msgstr "URL de ingreso" 28 | 29 | #: setup.php:72 inc/profile.class.php:175 inc/webapplication.class.php:48 30 | msgid "Web application" 31 | msgid_plural "Web applications" 32 | msgstr[0] "Aplicación Web" 33 | msgstr[1] "Aplicaciones Web" 34 | 35 | #: front/webapplication.php:42 front/webapplication.php:45 36 | msgid "Core migration" 37 | msgstr "Migración de núcleo" 38 | 39 | #: front/webapplication.php:47 40 | msgid "Are you sure you want to do core migration ??" 41 | msgstr "¿Está seguro que desea seguir con migración de núcleo?" 42 | 43 | #: front/webapplication.php:58 44 | msgid "Data migration" 45 | msgstr "Migración de dato" 46 | 47 | #: front/webapplication.php:100 48 | msgid "Tables purge" 49 | msgstr "Purga de tablas" 50 | 51 | #: front/webapplication.php:122 52 | msgid "Link with core purge" 53 | msgstr "Vínculo con purga de núcleo" 54 | 55 | #: front/webapplication.php:143 56 | msgid "Migration was successful" 57 | msgstr "La migración fue exitosa" 58 | 59 | #: inc/appliance.class.php:81 60 | msgid "Editor" 61 | msgstr "Editor" 62 | 63 | #: inc/webapplicationservertype.class.php:49 64 | msgid "Type of treatment server" 65 | msgid_plural "Types of treatment server" 66 | msgstr[0] "Tipo de servicio" 67 | msgstr[1] "Tipos de servicios" 68 | 69 | #: inc/webapplicationtechnic.class.php:49 70 | msgid "Language of treatment" 71 | msgid_plural "Languages of treatment" 72 | msgstr[0] "Lenguaje de programación" 73 | msgstr[1] "Lenguajes de programación" 74 | 75 | #: inc/webapplicationtype.class.php:50 76 | msgid "Category" 77 | msgid_plural "Categories" 78 | msgstr[0] "Categoría" 79 | msgstr[1] "Categorías" 80 | -------------------------------------------------------------------------------- /templates/webapplication_form.html.twig: -------------------------------------------------------------------------------- 1 | {% import "components/form/fields_macros.html.twig" as fields %} 2 | 3 | {% set bg = "" %} 4 | {% if item.isDeleted() %} 5 | {% set bg = "asset-deleted" %} 6 | {% endif %} 7 | 8 | {% set rand = random() %} 9 | {% set params = params ?? [] %} 10 | {% set target = params['target'] ?? item.getFormURL() %} 11 | {% set withtemplate = params['withtemplate'] ?? "" %} 12 | {% set item_type = item.getType() %} 13 | 14 |
15 |
16 |
17 |
18 |
19 | {% if item.isField('address') %} 20 | {{ fields.autoNameField( 21 | 'address', 22 | item, 23 | __('URL'), 24 | withtemplate 25 | ) }} 26 | {% endif %} 27 | 28 | {% if item.isField('backoffice') %} 29 | {{ fields.autoNameField( 30 | 'backoffice', 31 | item, 32 | __('Backoffice URL', 'webapplications'), 33 | withtemplate 34 | ) }} 35 | {% endif %} 36 | 37 | {% if item.isField('webapplicationservertypes_id') %} 38 | {{ fields.dropdownField( 39 | "GlpiPlugin\Webapplications\Webapplicationservertype", 40 | "webapplicationservertypes_id", 41 | item.fields['webapplicationservertypes_id'], 42 | "GlpiPlugin\Webapplications\Webapplicationservertype"|itemtype_name, 43 | ) }} 44 | {% endif %} 45 | 46 | {% if item.isField('webapplicationtechnics_id') %} 47 | {{ fields.dropdownField( 48 | "GlpiPlugin\Webapplications\Webapplicationtechnic", 49 | "webapplicationtechnics_id", 50 | item.fields['webapplicationtechnics_id'], 51 | "GlpiPlugin\Webapplications\Webapplicationtechnic"|itemtype_name, 52 | ) }} 53 | {% endif %} 54 | 55 |
{# .row #} 56 |
{# .row #} 57 |
{# .flex-row #} 58 |
59 |
{# .card-body #} 60 | -------------------------------------------------------------------------------- /public/css/webapplications.css: -------------------------------------------------------------------------------- 1 | /* 2 | * @version $Id: HEADER 15930 2011-10-30 15:47:55Z tsmr $ 3 | ------------------------------------------------------------------------- 4 | webapplications plugin for GLPI 5 | Copyright (C) 2009-2023 by the webapplications Development Team. 6 | 7 | https://github.com/InfotelGLPI/webapplications 8 | ------------------------------------------------------------------------- 9 | 10 | LICENSE 11 | 12 | This file is part of webapplications. 13 | 14 | webapplications is free software; you can redistribute it and/or modify 15 | it under the terms of the GNU General Public License as published by 16 | the Free Software Foundation; either version 2 of the License, or 17 | (at your option) any later version. 18 | 19 | webapplications is distributed in the hope that it will be useful, 20 | but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | GNU General Public License for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with webapplications. If not, see . 26 | -------------------------------------------------------------------------- 27 | */ 28 | 29 | .accordionhead { 30 | border: 2px grey solid; 31 | text-align: left; 32 | padding: 15px !important; 33 | } 34 | 35 | .ui-accordion-header { 36 | background-color: #7d91a1; 37 | color: white; 38 | font-size: 16px !important; 39 | } 40 | 41 | 42 | .ui-accordion-header:hover { 43 | background-color: #b1a7a7; 44 | } 45 | 46 | .panel { 47 | background-color: inherit; 48 | color: inherit; 49 | } 50 | 51 | #list { 52 | border: 1px solid grey; 53 | width: 100%; 54 | color: inherit; 55 | font: inherit !important; 56 | background-color: inherit; 57 | } 58 | 59 | /*option {*/ 60 | /* background-color: inherit !important;*/ 61 | /* color: inherit;*/ 62 | /* padding: 5px;*/ 63 | /* border: none !important;*/ 64 | /*}*/ 65 | 66 | .dict { 67 | text-align: left; 68 | white-space: nowrap; 69 | width: 1%; 70 | } 71 | 72 | ::-webkit-scrollbar-thumb { 73 | background: darkgrey !important; 74 | } 75 | 76 | .card-web-header { 77 | background-color: rgba(0, 0, 0, .03); 78 | border-bottom: 1px solid rgba(0, 0, 0, .125); 79 | margin-bottom: 15px; 80 | min-height: 68px; 81 | } 82 | 83 | .child50 { 84 | flex: 1 0 50% !important; 85 | } 86 | 87 | .child33 { 88 | flex: 1 0 33%; 89 | border: 0 !important; 90 | } 91 | 92 | .dict-min { 93 | padding-left: 10px; 94 | padding-right: 10px; 95 | text-align: center; 96 | font-size: 14px; 97 | border: 1px solid #ededed; 98 | } 99 | -------------------------------------------------------------------------------- /locales/ru_RU.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Webapplications Development Team 3 | # This file is distributed under the same license as the GLPI - Webapplications plugin package. 4 | # 5 | # Translators: 6 | # Roman O , 2017 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: GLPI Project - webapplications plugin\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2020-07-23 08:39+0200\n" 12 | "PO-Revision-Date: 2020-07-23 06:48+0000\n" 13 | "Last-Translator: Xavier CAILLAUD \n" 14 | "Language-Team: Russian (Russia) (http://www.transifex.com/infotelGLPI/GLPI_webapplications/language/ru_RU/)\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Language: ru_RU\n" 19 | "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" 20 | 21 | #: hook.php:281 inc/appliance.class.php:57 22 | msgid "Backoffice URL" 23 | msgstr "URL Бэк-офиса" 24 | 25 | #: setup.php:72 inc/profile.class.php:175 inc/webapplication.class.php:48 26 | msgid "Web application" 27 | msgid_plural "Web applications" 28 | msgstr[0] "Веб-приложение" 29 | msgstr[1] "Веб-приложений" 30 | msgstr[2] "Веб-приложений" 31 | msgstr[3] "Веб-приложение" 32 | 33 | #: front/webapplication.php:42 front/webapplication.php:45 34 | msgid "Core migration" 35 | msgstr "" 36 | 37 | #: front/webapplication.php:47 38 | msgid "Are you sure you want to do core migration ??" 39 | msgstr "" 40 | 41 | #: front/webapplication.php:58 42 | msgid "Data migration" 43 | msgstr "" 44 | 45 | #: front/webapplication.php:100 46 | msgid "Tables purge" 47 | msgstr "" 48 | 49 | #: front/webapplication.php:122 50 | msgid "Link with core purge" 51 | msgstr "" 52 | 53 | #: front/webapplication.php:143 54 | msgid "Migration was successful" 55 | msgstr "" 56 | 57 | #: inc/appliance.class.php:81 58 | msgid "Editor" 59 | msgstr "Редактор" 60 | 61 | #: inc/webapplicationservertype.class.php:49 62 | msgid "Type of treatment server" 63 | msgid_plural "Types of treatment server" 64 | msgstr[0] "Тип обслуживающего сервера" 65 | msgstr[1] "Типов обслуживающего сервера" 66 | msgstr[2] "Типов обслуживающего сервера" 67 | msgstr[3] "Тип обслуживающего сервера" 68 | 69 | #: inc/webapplicationtechnic.class.php:49 70 | msgid "Language of treatment" 71 | msgid_plural "Languages of treatment" 72 | msgstr[0] "Язык обслуживания" 73 | msgstr[1] "Языков обслуживания" 74 | msgstr[2] "Языков обслуживания" 75 | msgstr[3] "Язык обслуживания" 76 | 77 | #: inc/webapplicationtype.class.php:50 78 | msgid "Category" 79 | msgid_plural "Categories" 80 | msgstr[0] "Категории" 81 | msgstr[1] "Категорий" 82 | msgstr[2] "Категорий" 83 | msgstr[3] "Категория" 84 | -------------------------------------------------------------------------------- /sql/update-1.3.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `glpi_plugin_appweb_profiles` 2 | DROP `create_appweb`; 3 | ALTER TABLE `glpi_plugin_appweb_profiles` 4 | DROP `update_appweb`; 5 | ALTER TABLE `glpi_plugin_appweb_profiles` 6 | DROP `delete_appweb`; 7 | ALTER TABLE `glpi_plugin_appweb_profiles` 8 | CHANGE `is_default` `is_default` SMALLINT(6) NOT NULL DEFAULT '0'; 9 | UPDATE `glpi_plugin_appweb_profiles` 10 | SET `is_default` = '0' 11 | WHERE `is_default` = '1'; 12 | UPDATE `glpi_plugin_appweb_profiles` 13 | SET `is_default` = '1' 14 | WHERE `is_default` = '2'; 15 | 16 | ALTER TABLE `glpi_plugin_appweb` 17 | ADD `location` INT(4) NOT NULL DEFAULT '0'; 18 | ALTER TABLE `glpi_plugin_appweb` 19 | ADD `FK_entities` INT(11) NOT NULL DEFAULT '0' 20 | AFTER `ID`; 21 | ALTER TABLE `glpi_plugin_appweb` 22 | CHANGE `id_editor` `FK_enterprise` SMALLINT(6) NOT NULL DEFAULT '0'; 23 | ALTER TABLE `glpi_plugin_appweb` 24 | CHANGE `notes` `notes` LONGTEXT; 25 | ALTER TABLE `glpi_plugin_appweb` 26 | CHANGE `deleted` `deleted` SMALLINT(6) NOT NULL DEFAULT '0'; 27 | ALTER TABLE `glpi_plugin_appweb` 28 | CHANGE `target` `target` SMALLINT(6) NOT NULL DEFAULT '0'; 29 | 30 | UPDATE `glpi_plugin_appweb` 31 | SET `deleted` = '0' 32 | WHERE `deleted` = '1'; 33 | UPDATE `glpi_plugin_appweb` 34 | SET `deleted` = '1' 35 | WHERE `deleted` = '2'; 36 | UPDATE `glpi_plugin_appweb` 37 | SET `target` = '0' 38 | WHERE `target` = '1'; 39 | UPDATE `glpi_plugin_appweb` 40 | SET `target` = '1' 41 | WHERE `target` = '2'; 42 | 43 | DROP TABLE `glpi_plugin_appweb_setup`; 44 | 45 | ALTER TABLE `glpi_dropdown_plugin_appweb_type` 46 | ADD `FK_entities` INT(11) NOT NULL DEFAULT '0' 47 | AFTER `ID`; 48 | 49 | INSERT INTO glpi_documents_items (documents_id, items_id, itemtype) SELECT 50 | FK_documents, 51 | FK_applications, 52 | '1300' 53 | FROM glpi_plugin_appweb_documents; 54 | 55 | DROP TABLE `glpi_plugin_appweb_documents`; 56 | 57 | ALTER TABLE `glpi_plugin_appweb_device` 58 | CHANGE `device_type` `device_type` INT(11) NOT NULL DEFAULT '0'; 59 | 60 | ALTER TABLE `glpi_plugin_appweb` 61 | ADD `FK_glpi_enterprise` SMALLINT(6) NOT NULL DEFAULT '0' 62 | AFTER `FK_enterprise`; 63 | 64 | 65 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, '1300', '2', '2', '0'); 66 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, '1300', '6', '3', '0'); 67 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, '1300', '7', '4', '0'); 68 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, '1300', '8', '5', '0'); 69 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, '1300', '12', '6', '0'); -------------------------------------------------------------------------------- /locales/pt_BR.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Webapplications Development Team 3 | # This file is distributed under the same license as the GLPI - Webapplications plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2022 8 | # Maykon Henrique Facincani , 2022 9 | # 10 | #, fuzzy 11 | msgid "" 12 | msgstr "" 13 | "Project-Id-Version: GLPI - Webapplications plugin\n" 14 | "Report-Msgid-Bugs-To: \n" 15 | "POT-Creation-Date: 2022-06-02 07:46+0000\n" 16 | "PO-Revision-Date: 2020-11-02 16:31+0000\n" 17 | "Last-Translator: Maykon Henrique Facincani , 2022\n" 18 | "Language-Team: Portuguese (Brazil) (https://www.transifex.com/infotelGLPI/teams/12376/pt_BR/)\n" 19 | "MIME-Version: 1.0\n" 20 | "Content-Type: text/plain; charset=UTF-8\n" 21 | "Content-Transfer-Encoding: 8bit\n" 22 | "Language: pt_BR\n" 23 | "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" 24 | 25 | #: hook.php:279 26 | msgid "Backoffice URL" 27 | msgstr "URL de retaguarda" 28 | 29 | #: setup.php:79 inc/appliance.class.php:44 inc/profile.class.php:175 30 | #: inc/webapplication.class.php:48 31 | msgid "Web application" 32 | msgid_plural "Web applications" 33 | msgstr[0] "Aplicação web" 34 | msgstr[1] "Aplicações web" 35 | msgstr[2] "Aplicações web" 36 | 37 | #: front/webapplication.php:42 front/webapplication.php:45 38 | msgid "Core migration" 39 | msgstr "Migração do núcleo" 40 | 41 | #: front/webapplication.php:47 42 | msgid "Are you sure you want to do core migration ?" 43 | msgstr "Você tem certeza de que quer fazer a migração do núcleo?" 44 | 45 | #: front/webapplication.php:58 46 | msgid "Data migration" 47 | msgstr "Migração de dados" 48 | 49 | #: front/webapplication.php:144 50 | msgid "Tables purge" 51 | msgstr "Limpeza de tabelas" 52 | 53 | #: front/webapplication.php:166 54 | msgid "Link with core purge" 55 | msgstr "Ligar com a limpeza do núcleo" 56 | 57 | #: front/webapplication.php:187 58 | msgid "Migration was successful" 59 | msgstr "Migração realizada com sucesso" 60 | 61 | #: inc/webapplicationservertype.class.php:49 62 | msgid "Type of treatment server" 63 | msgid_plural "Types of treatment server" 64 | msgstr[0] "Tipo de servidor de tratamento" 65 | msgstr[1] "Tipos de servidores de tratamento" 66 | msgstr[2] "Tipos de servidores de tratamento" 67 | 68 | #: inc/webapplicationtechnic.class.php:49 69 | msgid "Language of treatment" 70 | msgid_plural "Languages of treatment" 71 | msgstr[0] "Idioma de tratamento" 72 | msgstr[1] "Idiomas de tratamento" 73 | msgstr[2] "Idiomas de tratamento" 74 | 75 | #: inc/webapplicationtype.class.php:50 76 | msgid "Category" 77 | msgid_plural "Categories" 78 | msgstr[0] "Categoria" 79 | msgstr[1] "Categorias" 80 | msgstr[2] "Categorias" 81 | -------------------------------------------------------------------------------- /locales/pl_PL.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Webapplications Development Team 3 | # This file is distributed under the same license as the GLPI - Webapplications plugin package. 4 | # 5 | # Translators: 6 | # Ryszard Jeziorski , 2015 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: GLPI Project - webapplications plugin\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2020-07-23 08:39+0200\n" 12 | "PO-Revision-Date: 2020-07-23 06:48+0000\n" 13 | "Last-Translator: Xavier CAILLAUD \n" 14 | "Language-Team: Polish (Poland) (http://www.transifex.com/infotelGLPI/GLPI_webapplications/language/pl_PL/)\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Language: pl_PL\n" 19 | "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" 20 | 21 | #: hook.php:281 inc/appliance.class.php:57 22 | msgid "Backoffice URL" 23 | msgstr "Administracyjny URL" 24 | 25 | #: setup.php:72 inc/profile.class.php:175 inc/webapplication.class.php:48 26 | msgid "Web application" 27 | msgid_plural "Web applications" 28 | msgstr[0] "Aplikacja internetowa" 29 | msgstr[1] "Aplikacje internetowe" 30 | msgstr[2] "Aplikacji internetowych" 31 | msgstr[3] "Aplikacji internetowych" 32 | 33 | #: front/webapplication.php:42 front/webapplication.php:45 34 | msgid "Core migration" 35 | msgstr "" 36 | 37 | #: front/webapplication.php:47 38 | msgid "Are you sure you want to do core migration ??" 39 | msgstr "" 40 | 41 | #: front/webapplication.php:58 42 | msgid "Data migration" 43 | msgstr "" 44 | 45 | #: front/webapplication.php:100 46 | msgid "Tables purge" 47 | msgstr "" 48 | 49 | #: front/webapplication.php:122 50 | msgid "Link with core purge" 51 | msgstr "" 52 | 53 | #: front/webapplication.php:143 54 | msgid "Migration was successful" 55 | msgstr "" 56 | 57 | #: inc/appliance.class.php:81 58 | msgid "Editor" 59 | msgstr "Producent" 60 | 61 | #: inc/webapplicationservertype.class.php:49 62 | msgid "Type of treatment server" 63 | msgid_plural "Types of treatment server" 64 | msgstr[0] "Typ serwera aplikacyjnego" 65 | msgstr[1] "Typy serwera aplikacyjnego" 66 | msgstr[2] "Typów serwera aplikacyjnego" 67 | msgstr[3] "Typów serwera aplikacyjnego" 68 | 69 | #: inc/webapplicationtechnic.class.php:49 70 | msgid "Language of treatment" 71 | msgid_plural "Languages of treatment" 72 | msgstr[0] "Język serwera aplikacyjnego" 73 | msgstr[1] "Języki serwera aplikacyjnego" 74 | msgstr[2] "Języków serwera aplikacyjnego" 75 | msgstr[3] "Języków serwera aplikacyjnego" 76 | 77 | #: inc/webapplicationtype.class.php:50 78 | msgid "Category" 79 | msgid_plural "Categories" 80 | msgstr[0] "Kategoria" 81 | msgstr[1] "Kategorie" 82 | msgstr[2] "Kategorii" 83 | msgstr[3] "Kategorii" 84 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | 2 | on: 3 | push: 4 | # Sequence of patterns matched against refs/tags 5 | tags: 6 | - '*.*.*' # Push events to matching ex:20.15.10 7 | 8 | name: Create release with tag 9 | env: 10 | TAG_VALUE: ${GITHUB_REF/refs\/tags\//} 11 | jobs: 12 | build: 13 | name: Upload Release Asset 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Checkout code 17 | uses: actions/checkout@v2 18 | - name: Build project # This would actually build your project, using zip for an example artifact 19 | id: build_ 20 | env: 21 | GITHUB_NAME: ${{ github.event.repository.name }} 22 | 23 | 24 | run: sudo apt-get install libxml-xpath-perl;echo $(xpath -e '/root/versions/version[num="'${GITHUB_REF/refs\/tags\//}'"]/compatibility/text()' $GITHUB_NAME.xml);echo ::set-output name=version_glpi::$(xpath -e '/root/versions/version[num="'${GITHUB_REF/refs\/tags\//}'"]/compatibility/text()' $GITHUB_NAME.xml); rm -rf $GITHUB_NAME.xml tools wiki screenshots test .git .github ISSUE_TEMPLATE.md TODO.txt $GITHUB_NAME.png;cd ..; tar jcvf glpi-$GITHUB_NAME-${GITHUB_REF/refs\/tags\//}.tar.bz2 $GITHUB_NAME;ls -al;echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//};echo ${{ steps.getxml.outputs.info }}; 25 | # run: rm -rf $GITHUB_NAME.xml tools wiki screenshots test ISSUE_TEMPLATE.md TODO.txt $GITHUB_NAME.png; tar -zcvf glpi-$GITHUB_NAME-$GITHUB_TAG.tar.gz $GITHUB_NAME 26 | - name: Create Release 27 | id: create_release 28 | uses: actions/create-release@v1 29 | env: 30 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 31 | with: 32 | tag_name: ${{ github.ref }} 33 | release_name: | 34 | GLPI ${{ steps.build_.outputs.version_glpi }} : Version ${{ github.ref }} disponible / available 35 | body : Version ${{ steps.build_.outputs.tag }} released for GLPI ${{ steps.build_.outputs.version_glpi }} 36 | draft: false 37 | prerelease: true 38 | - name: Upload Release Asset 39 | id: upload-release-asset 40 | uses: actions/upload-release-asset@v1 41 | env: 42 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 43 | GITHUB_NAME: ${{ github.event.repository.name }} 44 | with: 45 | upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps 46 | asset_path: /home/runner/work/${{ github.event.repository.name }}/glpi-${{ github.event.repository.name }}-${{ steps.build_.outputs.tag }}.tar.bz2 47 | asset_name: glpi-${{ github.event.repository.name }}-${{ steps.build_.outputs.tag }}.tar.bz2 48 | asset_content_type: application/zip 49 | 50 | -------------------------------------------------------------------------------- /front/entity.form.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | Session::checkLoginUser(); 31 | 32 | use GlpiPlugin\Webapplications\Entity; 33 | 34 | if (!isset($_GET["id"])) { 35 | $_GET["id"] = ""; 36 | } 37 | if (!isset($_GET["withtemplate"])) { 38 | $_GET["withtemplate"] = ""; 39 | } 40 | 41 | 42 | $entity = new Entity(); 43 | 44 | if (isset($_POST["add"])) { 45 | $entity->check(-1, CREATE, $_POST); 46 | $newID = $entity->add($_POST); 47 | if ($_SESSION['glpibackcreated']) { 48 | Html::redirect($entity->getFormURL() . "?id=" . $newID); 49 | } 50 | Html::back(); 51 | } elseif (isset($_POST["delete"])) { 52 | $entity->check($_POST['id'], DELETE); 53 | $entity->delete($_POST); 54 | $entity->redirectToList(); 55 | } elseif (isset($_POST["restore"])) { 56 | $entity->check($_POST['id'], PURGE); 57 | $entity->restore($_POST); 58 | $entity->redirectToList(); 59 | } elseif (isset($_POST["purge"])) { 60 | $entity->check($_POST['id'], PURGE); 61 | $entity->delete($_POST, 1); 62 | $entity->redirectToList(); 63 | } elseif (isset($_POST["update"])) { 64 | $entity->check($_POST['id'], UPDATE); 65 | $entity->update($_POST); 66 | Html::back(); 67 | } elseif (isset($_GET['_in_modal'])) { 68 | $_SESSION['reload']=true; 69 | Html::popHeader(Entity::getTypeName(2), $_SERVER['PHP_SELF']); 70 | $options = ['withtemplate' => $_GET["withtemplate"], 'formoptions' => "data-track-changes=true"]; 71 | if (isset($_GET['appliance_id'])) { 72 | $options['appliances_id'] = $_GET['appliance_id']; 73 | } 74 | $menus = ["appliancedashboard", "entity"]; 75 | Entity::displayFullPageForItem($_GET['id'], $menus, $options); 76 | Html::popFooter(); 77 | } else { 78 | if (Session::getCurrentInterface() == "central") { 79 | Html::header(Entity::getTypeName(2), $_SERVER['PHP_SELF'], "appliancedashboard", Entity::class, "config"); 80 | $entity->display(['id' => $_GET["id"]]); 81 | } 82 | Html::footer(); 83 | } 84 | -------------------------------------------------------------------------------- /front/process.form.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | Session::checkLoginUser(); 31 | 32 | use Glpi\Event; 33 | use GlpiPlugin\Webapplications\Process; 34 | 35 | if (!isset($_GET["id"])) { 36 | $_GET["id"] = ""; 37 | } 38 | if (!isset($_GET["withtemplate"])) { 39 | $_GET["withtemplate"] = ""; 40 | } 41 | 42 | 43 | $process = new Process(); 44 | 45 | if (isset($_POST["add"])) { 46 | $process->check(-1, CREATE, $_POST); 47 | $newID = $process->add($_POST); 48 | if ($_SESSION['glpibackcreated']) { 49 | Html::redirect($process->getFormURL() . "?id=" . $newID); 50 | } 51 | Html::back(); 52 | } elseif (isset($_POST["delete"])) { 53 | $process->check($_POST['id'], DELETE); 54 | $process->delete($_POST); 55 | $process->redirectToList(); 56 | } elseif (isset($_POST["restore"])) { 57 | $process->check($_POST['id'], PURGE); 58 | $process->restore($_POST); 59 | $process->redirectToList(); 60 | } elseif (isset($_POST["purge"])) { 61 | $process->check($_POST['id'], PURGE); 62 | $process->delete($_POST, 1); 63 | $process->redirectToList(); 64 | } elseif (isset($_POST["update"])) { 65 | $process->check($_POST['id'], UPDATE); 66 | $process->update($_POST); 67 | Html::back(); 68 | } elseif (isset($_GET['_in_modal'])) { 69 | $_SESSION['reload']=true; 70 | Html::popHeader(Process::getTypeName(2), $_SERVER['PHP_SELF']); 71 | $options = ['withtemplate' => $_GET["withtemplate"], 'formoptions' => "data-track-changes=true"]; 72 | if (isset($_GET['appliance_id'])) { 73 | $options['appliances_id'] = $_GET['appliance_id']; 74 | } 75 | $menus = ["appliancedashboard", "process"]; 76 | Process::displayFullPageForItem($_GET['id'], $menus, $options); 77 | Html::popFooter(); 78 | } else { 79 | if (Session::getCurrentInterface() == "central") { 80 | Html::header(Process::getTypeName(2), $_SERVER['PHP_SELF'], "appliancedashboard", Process::class, "config"); 81 | $process->display(['id' => $_GET["id"]]); 82 | } 83 | Html::footer(); 84 | } 85 | -------------------------------------------------------------------------------- /front/stream.form.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | 32 | 33 | Session::checkLoginUser(); 34 | 35 | use Glpi\Event; 36 | use GlpiPlugin\Webapplications\Stream; 37 | 38 | if (!isset($_GET["id"])) { 39 | $_GET["id"] = ""; 40 | } 41 | if (!isset($_GET["withtemplate"])) { 42 | $_GET["withtemplate"] = ""; 43 | } 44 | global $CFG_GLPI; 45 | 46 | 47 | $stream = new Stream(); 48 | 49 | if (isset($_POST["add"])) { 50 | $stream->check(-1, CREATE, $_POST); 51 | $newID = $stream->add($_POST); 52 | if ($_SESSION['glpibackcreated']) { 53 | Html::redirect($stream->getFormURL() . "?id=" . $newID); 54 | } 55 | Html::back(); 56 | } elseif (isset($_POST["delete"])) { 57 | $stream->check($_POST['id'], DELETE); 58 | $stream->delete($_POST); 59 | $stream->redirectToList(); 60 | } elseif (isset($_POST["restore"])) { 61 | $stream->check($_POST['id'], PURGE); 62 | $stream->restore($_POST); 63 | $stream->redirectToList(); 64 | } elseif (isset($_POST["purge"])) { 65 | $stream->check($_POST['id'], PURGE); 66 | $stream->delete($_POST, 1); 67 | $stream->redirectToList(); 68 | } elseif (isset($_POST["update"])) { 69 | $stream->check($_POST['id'], UPDATE); 70 | $stream->pre_update(); 71 | $stream->update($_POST); 72 | Html::back(); 73 | } elseif (isset($_GET['_in_modal'])) { 74 | Html::popHeader(Stream::getTypeName(2), $_SERVER['PHP_SELF']); 75 | $_SESSION['reload']=true; 76 | $options = ['withtemplate' => $_GET["withtemplate"], 'formoptions' => "data-track-changes=true", 'stream_types' => $CFG_GLPI['stream_types']]; 77 | if (isset($_GET['appliance_id'])) { 78 | $options['appliances_id'] = $_GET['appliance_id']; 79 | } 80 | $menus = ["appliancedashboard", "stream"]; 81 | Stream::displayFullPageForItem($_GET['id'], $menus, $options); 82 | 83 | Html::popFooter(); 84 | } else { 85 | if (Session::getCurrentInterface() == "central") { 86 | Html::header(Stream::getTypeName(2), $_SERVER['PHP_SELF'], "appliancedashboard", "pluginwebapplicationsstream", "config"); 87 | $stream->display(['id' => $_GET["id"], 'stream_types' => $CFG_GLPI['stream_types']]); 88 | } 89 | Html::footer(); 90 | } 91 | -------------------------------------------------------------------------------- /sql/empty-3.0.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplicationservertypes`; 2 | CREATE TABLE `glpi_plugin_webapplications_webapplicationservertypes` ( 3 | `id` INT(11) NOT NULL AUTO_INCREMENT, 4 | `name` VARCHAR(255) 5 | COLLATE utf8_unicode_ci DEFAULT NULL, 6 | `comment` TEXT COLLATE utf8_unicode_ci, 7 | PRIMARY KEY (`id`), 8 | KEY `name` (`name`) 9 | ) 10 | ENGINE = InnoDB 11 | DEFAULT CHARSET = utf8 12 | COLLATE = utf8_unicode_ci; 13 | 14 | INSERT INTO `glpi_plugin_webapplications_webapplicationservertypes` VALUES ('1', 'Apache', ''); 15 | INSERT INTO `glpi_plugin_webapplications_webapplicationservertypes` VALUES ('2', 'IIS', ''); 16 | INSERT INTO `glpi_plugin_webapplications_webapplicationservertypes` VALUES ('3', 'Nginx', ''); 17 | INSERT INTO `glpi_plugin_webapplications_webapplicationservertypes` VALUES ('4', 'PRTG', ''); 18 | INSERT INTO `glpi_plugin_webapplications_webapplicationservertypes` VALUES ('5', 'Tomcat', ''); 19 | 20 | 21 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplicationtypes`; 22 | CREATE TABLE `glpi_plugin_webapplications_webapplicationtypes` ( 23 | `id` INT(11) NOT NULL AUTO_INCREMENT, 24 | `entities_id` INT(11) NOT NULL DEFAULT '0', 25 | `name` VARCHAR(255) 26 | COLLATE utf8_unicode_ci DEFAULT NULL, 27 | `comment` TEXT COLLATE utf8_unicode_ci, 28 | `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 29 | PRIMARY KEY (`id`), 30 | KEY `name` (`name`), 31 | KEY `entities_id` (`entities_id`) 32 | ) 33 | ENGINE = InnoDB 34 | DEFAULT CHARSET = utf8 35 | COLLATE = utf8_unicode_ci; 36 | 37 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplicationtechnics`; 38 | CREATE TABLE `glpi_plugin_webapplications_webapplicationtechnics` ( 39 | `id` INT(11) NOT NULL AUTO_INCREMENT, 40 | `name` VARCHAR(255) 41 | COLLATE utf8_unicode_ci DEFAULT NULL, 42 | `comment` TEXT COLLATE utf8_unicode_ci, 43 | PRIMARY KEY (`id`), 44 | KEY `name` (`name`) 45 | ) 46 | ENGINE = InnoDB 47 | DEFAULT CHARSET = utf8 48 | COLLATE = utf8_unicode_ci; 49 | 50 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('1', 'Asp', ''); 51 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('2', 'Cgi', ''); 52 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('3', 'Java', ''); 53 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('4', 'Perl', ''); 54 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('5', 'Php', ''); 55 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('6', '.Net', ''); 56 | 57 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_appliances`; 58 | CREATE TABLE `glpi_plugin_webapplications_appliances` ( 59 | `id` int(11) NOT NULL auto_increment, 60 | `appliances_id` int(11) NOT NULL, 61 | `webapplicationtypes_id` INT(11) NOT NULL DEFAULT '0' 62 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationtypes (id)', 63 | `webapplicationservertypes_id` INT(11) NOT NULL DEFAULT '0' 64 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationservertypes (id)', 65 | `webapplicationtechnics_id` INT(11) NOT NULL DEFAULT '0' 66 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationtechnics (id)', 67 | `address` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 68 | `backoffice` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL, 69 | PRIMARY KEY (`id`), 70 | KEY `appliances_id` (`appliances_id`) 71 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 72 | 73 | -------------------------------------------------------------------------------- /templates/webapplication_database_form.html.twig: -------------------------------------------------------------------------------- 1 | {% import "components/form/fields_macros.html.twig" as fields %} 2 | 3 | {% set bg = "" %} 4 | {% if item.isDeleted() %} 5 | {% set bg = "asset-deleted" %} 6 | {% endif %} 7 | 8 | {% set rand = random() %} 9 | {% set params = params ?? [] %} 10 | {% set target = params['target'] ?? item.getFormURL() %} 11 | {% set withtemplate = params['withtemplate'] ?? "" %} 12 | {% set item_type = item.getType() %} 13 | 14 | 15 | {{ fields.dropdownField( 16 | "GlpiPlugin\Webapplications\Webapplicationexternalexposition", 17 | "webapplicationexternalexpositions_id", 18 | item.fields['webapplicationexternalexpositions_id'], 19 | "GlpiPlugin\Webapplications\Webapplicationexternalexposition"|itemtype_name, 20 | {'align_label_right' : false,} 21 | ) }} 22 | 23 | 24 | {{ fields.smallTitle(__('Security Needs', 'webapplications')) }} 25 | 26 | 27 | 28 | 43 | 58 | 73 | 87 | 88 | 89 | 90 | 91 |
29 | {{ fields.dropdownNumberField( 30 | 'webapplicationavailabilities', 31 | item.fields['webapplicationavailabilities'], 32 | __('Availability', 'webapplications'), 33 | { 34 | 'min' : 1, 35 | 'max' : 4, 36 | 'step' : 1, 37 | 'field_class': 'col-12', 38 | 'label_class': 'col-xxl-8', 39 | 'input_class': 'col-xxl-4',} 40 | ) }} 41 | 42 | 44 | {{ fields.dropdownNumberField( 45 | 46 | 'webapplicationintegrities', 47 | item.fields['webapplicationintegrities'], 48 | __('Integrity', 'webapplications'), 49 | { 50 | 'min' : 1, 51 | 'max' : 4, 52 | 'step' : 1, 53 | 'field_class' : 'col-12', 54 | 'label_class' : 'col-xxl-8', 55 | 'input_class' : 'col-xxl-4',} 56 | ) }} 57 | 59 | {{ fields.dropdownNumberField( 60 | 'webapplicationconfidentialities', 61 | item.fields['webapplicationconfidentialities'], 62 | __('Confidentiality', 'webapplications'), 63 | { 64 | 'min' : 0, 65 | 'max' : 4, 66 | 'step' : 1, 67 | 'field_class': 'col-12', 68 | 'label_class': 'col-xxl-8', 69 | 'input_class': 'col-xxl-4',} 70 | ) }} 71 | 72 | 74 | {{ fields.dropdownNumberField( 75 | 'webapplicationtraceabilities', 76 | item.fields['webapplicationtraceabilities'], 77 | __('Traceability', 'webapplications'), 78 | { 79 | 'min' : 1, 80 | 'max' : 4, 81 | 'step' : 1, 82 | 'field_class': 'col-12', 83 | 'label_class': 'col-xxl-8', 84 | 'input_class': 'col-xxl-4',} 85 | ) }} 86 |
92 | -------------------------------------------------------------------------------- /sql/empty-4.0.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplicationservertypes`; 2 | CREATE TABLE `glpi_plugin_webapplications_webapplicationservertypes` ( 3 | `id` int unsigned NOT NULL AUTO_INCREMENT, 4 | `name` VARCHAR(255) 5 | COLLATE utf8mb4_unicode_ci DEFAULT NULL, 6 | `comment` TEXT COLLATE utf8mb4_unicode_ci, 7 | PRIMARY KEY (`id`), 8 | KEY `name` (`name`) 9 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 10 | 11 | INSERT INTO `glpi_plugin_webapplications_webapplicationservertypes` VALUES ('1', 'Apache', ''); 12 | INSERT INTO `glpi_plugin_webapplications_webapplicationservertypes` VALUES ('2', 'IIS', ''); 13 | INSERT INTO `glpi_plugin_webapplications_webapplicationservertypes` VALUES ('3', 'Nginx', ''); 14 | INSERT INTO `glpi_plugin_webapplications_webapplicationservertypes` VALUES ('4', 'PRTG', ''); 15 | INSERT INTO `glpi_plugin_webapplications_webapplicationservertypes` VALUES ('5', 'Tomcat', ''); 16 | 17 | 18 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplicationtypes`; 19 | CREATE TABLE `glpi_plugin_webapplications_webapplicationtypes` ( 20 | `id` int unsigned NOT NULL AUTO_INCREMENT, 21 | `entities_id` int unsigned NOT NULL DEFAULT '0', 22 | `name` VARCHAR(255) 23 | COLLATE utf8mb4_unicode_ci DEFAULT NULL, 24 | `comment` TEXT COLLATE utf8mb4_unicode_ci, 25 | `is_recursive` tinyint NOT NULL DEFAULT '0', 26 | PRIMARY KEY (`id`), 27 | KEY `name` (`name`), 28 | KEY `entities_id` (`entities_id`) 29 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 30 | 31 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplicationtechnics`; 32 | CREATE TABLE `glpi_plugin_webapplications_webapplicationtechnics` ( 33 | `id` int unsigned NOT NULL AUTO_INCREMENT, 34 | `name` VARCHAR(255) 35 | COLLATE utf8mb4_unicode_ci DEFAULT NULL, 36 | `comment` TEXT COLLATE utf8mb4_unicode_ci, 37 | PRIMARY KEY (`id`), 38 | KEY `name` (`name`) 39 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 40 | 41 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('1', 'Asp', ''); 42 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('2', 'Cgi', ''); 43 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('3', 'Java', ''); 44 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('4', 'Perl', ''); 45 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('5', 'Php', ''); 46 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('6', '.Net', ''); 47 | 48 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_appliances`; 49 | CREATE TABLE `glpi_plugin_webapplications_appliances` ( 50 | `id` int unsigned NOT NULL auto_increment, 51 | `appliances_id` int unsigned NOT NULL, 52 | `webapplicationtypes_id` int unsigned NOT NULL DEFAULT '0' 53 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationtypes (id)', 54 | `webapplicationservertypes_id` int unsigned NOT NULL DEFAULT '0' 55 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationservertypes (id)', 56 | `webapplicationtechnics_id` int unsigned NOT NULL DEFAULT '0' 57 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationtechnics (id)', 58 | `address` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 59 | `backoffice` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 60 | PRIMARY KEY (`id`), 61 | KEY `appliances_id` (`appliances_id`) 62 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 63 | 64 | -------------------------------------------------------------------------------- /public/scripts/securityneedscolor.js.php: -------------------------------------------------------------------------------- 1 | 7 | 8 | (function ($) { 9 | $.fn.webapplications_change_securityneedscolor = function () { 10 | 11 | 12 | init(); 13 | 14 | // Start the plugin 15 | function init() { 16 | $(document).ajaxStop(function () { 17 | var dictfields = document.querySelectorAll('[name="webapplicationavailabilities"], [name="webapplicationintegrities"], ' + 18 | '[name="webapplicationconfidentialities"], [name="webapplicationtraceabilities"]'); 19 | 20 | $.each(dictfields, function () { 21 | window.addEventListener('DOMContentLoaded', function() { 22 | switchColor; 23 | }); 24 | 25 | this.onchange = switchColor; 26 | var event = new Event('change'); 27 | this.dispatchEvent(event); 28 | 29 | }); 30 | 31 | 32 | function switchColor(e) { 33 | 34 | if (e.target.type == 'select-one') { 35 | var field = $("span[aria-labelledby='select2-" + e.target.id + "-container']"); 36 | if (typeof (field.children()[0]) !== 'undefined') { 37 | field.children()[0].style = "color: black; font-weight: bold"; 38 | } 39 | 40 | switch (field.text()) { 41 | case '1': 42 | field.css("background-color", "#00FF00"); 43 | break; 44 | case '2': 45 | field.css("background-color", "#FFFF00"); 46 | break; 47 | case '3': 48 | field.css("background-color", "#FF9900"); 49 | break; 50 | case '4': 51 | field.css("background-color", "#FF0000"); 52 | break; 53 | default: 54 | field.css("background-color", "#999999"); 55 | break; 56 | } 57 | } else { 58 | switch (e.target.innerText) { 59 | case '1': 60 | e.target.style = "background-color: #00FF00; color: black; font-weight: bold; width: 29px"; 61 | break; 62 | case '2': 63 | e.target.style = "background-color: #FFFF00; color: black; font-weight: bold; width: 29px"; 64 | break; 65 | case '3': 66 | e.target.style = "background-color: #FF9900; color: black; font-weight: bold; width: 29px"; 67 | break; 68 | case '4': 69 | e.target.style = "background-color: #FF0000; color: black; font-weight: bold; width: 29px"; 70 | break; 71 | default: 72 | e.target.style = "background-color: #999999; color: black; font-weight: bold; width: 29px"; 73 | break; 74 | } 75 | } 76 | 77 | } 78 | }); 79 | } 80 | 81 | return this; 82 | }; 83 | }(jQuery)); 84 | 85 | $(document).webapplications_change_securityneedscolor(); 86 | -------------------------------------------------------------------------------- /templates/webapplication_process_form.html.twig: -------------------------------------------------------------------------------- 1 | {% import "components/form/fields_macros.html.twig" as fields %} 2 | 3 | {% extends "generic_show_form.html.twig" %} 4 | 5 | {% block more_fields %} 6 | 7 | 8 | {{ fields.dropdownField( 9 | 'User', 10 | 'owner', 11 | item.fields['owner'], 12 | __('Owner', 'webapplications'), 13 | field_options|merge({ 14 | 'right': 'all', 15 | }) 16 | )}} 17 | 18 | {{ fields.largeTitle(__('Security Needs', 'webapplications')) }} 19 | 20 | 21 | 22 | 39 | 55 | 72 | 88 | 89 | 90 | 91 | 92 |
23 | {% if item.isField('webapplicationavailabilities') %} 24 | {{ fields.dropdownNumberField( 25 | 'webapplicationavailabilities', 26 | item.fields['webapplicationavailabilities'], 27 | __('Availability', 'webapplications'), 28 | { 29 | 'min' : 1, 30 | 'max' : 4, 31 | 'step' : 1, 32 | 'field_class': 'col-12', 33 | 'label_class': 'col-xxl-8', 34 | 'input_class': 'col-xxl-4',} 35 | ) }} 36 | {% endif %} 37 | 38 | 40 | {% if item.isField('webapplicationintegrities') %} 41 | {{ fields.dropdownNumberField( 42 | 'webapplicationintegrities', 43 | item.fields['webapplicationintegrities'], 44 | __('Integrity', 'webapplications'), 45 | { 46 | 'min' : 1, 47 | 'max' : 4, 48 | 'step' : 1, 49 | 'field_class' : 'col-12', 50 | 'label_class' : 'col-xxl-8', 51 | 'input_class' : 'col-xxl-4',} 52 | ) }} 53 | {% endif %} 54 | 56 | {% if item.isField('webapplicationconfidentialities') %} 57 | {{ fields.dropdownNumberField( 58 | 'webapplicationconfidentialities', 59 | item.fields['webapplicationconfidentialities'], 60 | __('Confidentiality', 'webapplications'), 61 | { 62 | 'min' : 0, 63 | 'max' : 4, 64 | 'step' : 1, 65 | 'field_class': 'col-12', 66 | 'label_class': 'col-xxl-8', 67 | 'input_class': 'col-xxl-4',} 68 | ) }} 69 | {% endif %} 70 | 71 | 73 | {% if item.isField('webapplicationtraceabilities') %} 74 | {{ fields.dropdownNumberField( 75 | 'webapplicationtraceabilities', 76 | item.fields['webapplicationtraceabilities'], 77 | __('Traceability', 'webapplications'), 78 | { 79 | 'min' : 1, 80 | 'max' : 4, 81 | 'step' : 1, 82 | 'field_class': 'col-12', 83 | 'label_class': 'col-xxl-8', 84 | 'input_class': 'col-xxl-4',} 85 | ) }} 86 | {% endif %} 87 |
93 | 94 | {% endblock %} 95 | -------------------------------------------------------------------------------- /src/Certificate.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | namespace GlpiPlugin\Webapplications; 31 | 32 | use Ajax; 33 | use CommonDBTM; 34 | use CommonGLPI; 35 | use Glpi\Application\View\TemplateRenderer; 36 | use Html; 37 | 38 | if (!defined('GLPI_ROOT')) { 39 | die("Sorry. You can't access directly to this file"); 40 | } 41 | 42 | /** 43 | * Class Certificate 44 | */ 45 | class Certificate extends CommonDBTM 46 | { 47 | public static $rightname = "plugin_webapplications_appliances"; 48 | 49 | public static function getTypeName($nb = 0) 50 | { 51 | return _n("Certificate", 'Certificates', $nb); 52 | } 53 | 54 | public static function getIcon() 55 | { 56 | return "ti ti-certificate"; 57 | } 58 | 59 | public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) 60 | { 61 | if ($_SESSION['glpishow_count_on_tabs']) { 62 | $ApplianceId = $_SESSION['plugin_webapplications_loaded_appliances_id'] ?? 0;; 63 | $self = new \Certificate(); 64 | $nb = count(Dashboard::getObjects($self, $ApplianceId)); 65 | return self::createTabEntry(self::getTypeName($nb), $nb); 66 | } 67 | return self::getTypeName(); 68 | } 69 | 70 | public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) 71 | { 72 | $obj = new \Certificate(); 73 | Dashboard::showList($obj); 74 | return true; 75 | } 76 | 77 | 78 | public function showForm($ID, $options = []) 79 | { 80 | $instance = new \Certificate(); 81 | $instance->showForm($ID, $options); 82 | 83 | return true; 84 | } 85 | 86 | public static function showListObjects($list) 87 | { 88 | $object = new \Certificate(); 89 | 90 | echo "
"; 91 | 92 | foreach ($list as $field) { 93 | $name = $field['name']; 94 | $id = $field['id']; 95 | $object->getFromDB($id); 96 | 97 | echo "
"; 98 | echo "
"; 99 | echo "
"; 100 | echo ""; 101 | echo "
"; 102 | echo "
"; 103 | echo "
" . $object->getLink() . "
"; 104 | 105 | 106 | echo "

"; 107 | echo Html::convDateTime($object->fields['date_expiration']); 108 | echo "

"; 109 | 110 | $link = $object::getFormURLWithID($id); 111 | $link .= "&forcetab=main"; 112 | $rand = mt_rand(); 113 | echo ""; 114 | if ($object->canUpdate()) { 115 | echo Html::submit( 116 | _sx('button', 'Edit'), 117 | [ 118 | 'name' => 'edit', 119 | 'class' => 'btn btn-secondary right', 120 | 'icon' => 'ti ti-edit', 121 | 'form' => '', 122 | 'data-bs-toggle' => 'modal', 123 | 'data-bs-target' => '#edit' . $id . $rand 124 | ] 125 | ); 126 | 127 | echo Ajax::createIframeModalWindow( 128 | 'edit' . $id . $rand, 129 | $link, 130 | [ 131 | 'display' => false, 132 | 'reloadonclose' => true 133 | ] 134 | ); 135 | } 136 | echo ""; 137 | echo "
"; 138 | echo "
"; 139 | echo "
"; 140 | 141 | } 142 | echo "
"; 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /sql/update-1.1.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `glpi_application` 2 | RENAME `glpi_plugin_appweb`; 3 | ALTER TABLE `glpi_dropdown_application_type` 4 | RENAME `glpi_dropdown_plugin_appweb_type`; 5 | ALTER TABLE `glpi_application_setup` 6 | RENAME `glpi_plugin_appweb_setup`; 7 | 8 | CREATE TABLE `glpi_dropdown_plugin_appweb_server_type` ( 9 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 10 | `name` VARCHAR(255) NOT NULL DEFAULT '', 11 | `comments` TEXT, 12 | PRIMARY KEY (`ID`), 13 | KEY `name` (`name`) 14 | ) 15 | ENGINE = MyISAM 16 | DEFAULT CHARSET = utf8 17 | COLLATE = utf8_unicode_ci; 18 | 19 | INSERT INTO `glpi_dropdown_plugin_appweb_server_type` (`ID`, `name`, `comments`) VALUES ('1', 'Apache', ''); 20 | INSERT INTO `glpi_dropdown_plugin_appweb_server_type` (`ID`, `name`, `comments`) VALUES ('2', 'IIS', ''); 21 | INSERT INTO `glpi_dropdown_plugin_appweb_server_type` (`ID`, `name`, `comments`) VALUES ('3', 'Tomcat', ''); 22 | 23 | CREATE TABLE `glpi_dropdown_plugin_appweb_technic` ( 24 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 25 | `name` VARCHAR(255) NOT NULL DEFAULT '', 26 | `comments` TEXT, 27 | PRIMARY KEY (`ID`), 28 | KEY `name` (`name`) 29 | ) 30 | ENGINE = MyISAM 31 | DEFAULT CHARSET = utf8 32 | COLLATE = utf8_unicode_ci; 33 | 34 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('1', 'Asp', ''); 35 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('2', 'Cgi', ''); 36 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('3', 'Java', ''); 37 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('4', 'Perl', ''); 38 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('5', 'Php', ''); 39 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('6', '.Net', ''); 40 | 41 | ALTER TABLE `glpi_plugin_appweb` 42 | ADD `server` INT(4) NOT NULL DEFAULT '0'; 43 | ALTER TABLE `glpi_plugin_appweb` 44 | ADD `technic` INT(4) NOT NULL DEFAULT '0'; 45 | ALTER TABLE `glpi_plugin_appweb` 46 | ADD `version` VARCHAR(255) NOT NULL DEFAULT ''; 47 | ALTER TABLE `glpi_plugin_appweb` 48 | ADD `port` VARCHAR(255) NOT NULL DEFAULT ''; 49 | ALTER TABLE `glpi_plugin_appweb` 50 | ADD `protocol` INT(4) NOT NULL DEFAULT '0'; 51 | ALTER TABLE `glpi_plugin_appweb` 52 | ADD `link_name` VARCHAR(255) NOT NULL DEFAULT ''; 53 | ALTER TABLE `glpi_plugin_appweb` 54 | ADD `id_editor` SMALLINT(6) NOT NULL; 55 | ALTER TABLE `glpi_plugin_appweb` 56 | ADD `notes` LONGTEXT NOT NULL; 57 | ALTER TABLE `glpi_plugin_appweb` 58 | ADD `target` ENUM ('0', '1') NOT NULL DEFAULT '0'; 59 | ALTER TABLE `glpi_plugin_appweb` 60 | ADD `FK_glpi_enterprise` SMALLINT(6) NOT NULL DEFAULT '0' 61 | AFTER `FK_enterprise`; 62 | 63 | CREATE TABLE `glpi_plugin_appweb_device` ( 64 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 65 | `FK_appweb` INT(11) NOT NULL DEFAULT '0', 66 | `FK_device` INT(11) NOT NULL DEFAULT '0', 67 | `device_type` TINYINT(4) NOT NULL DEFAULT '0', 68 | PRIMARY KEY (`ID`), 69 | UNIQUE KEY `FK_compte` (`FK_appweb`, `FK_device`, `device_type`), 70 | KEY `FK_appweb_2` (`FK_appweb`), 71 | KEY `FK_device` (`FK_device`, `device_type`) 72 | ) 73 | ENGINE = MyISAM 74 | DEFAULT CHARSET = utf8 75 | COLLATE = utf8_unicode_ci; 76 | 77 | CREATE TABLE `glpi_plugin_appweb_documents` ( 78 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 79 | `FK_documents` INT(11) NOT NULL DEFAULT '0', 80 | `FK_applications` INT(11) NOT NULL DEFAULT '0', 81 | PRIMARY KEY (`ID`), 82 | UNIQUE KEY `FK_documents` (`FK_documents`, `FK_applications`), 83 | KEY `FK_documents_2` (`FK_documents`), 84 | KEY `FK_applications` (`FK_applications`) 85 | ) 86 | ENGINE = MyISAM 87 | DEFAULT CHARSET = utf8 88 | COLLATE = utf8_unicode_ci; 89 | 90 | CREATE TABLE `glpi_plugin_appweb_profiles` ( 91 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 92 | `name` VARCHAR(255) DEFAULT NULL, 93 | `interface` VARCHAR(50) NOT NULL DEFAULT 'appweb', 94 | `is_default` ENUM ('0', '1') NOT NULL DEFAULT '0', 95 | `appweb` CHAR(1) DEFAULT NULL, 96 | `create_appweb` CHAR(1) DEFAULT NULL, 97 | `update_appweb` CHAR(1) DEFAULT NULL, 98 | `delete_appweb` CHAR(1) DEFAULT NULL, 99 | PRIMARY KEY (`ID`), 100 | KEY `interface` (`interface`) 101 | ) 102 | ENGINE = MyISAM 103 | DEFAULT CHARSET = utf8 104 | COLLATE = utf8_unicode_ci; 105 | 106 | INSERT INTO `glpi_plugin_appweb_profiles` (`ID`, `name`, `interface`, `is_default`, `appweb`, `create_appweb`, `update_appweb`, `delete_appweb`) 107 | VALUES ('1', 'post-only', 'appweb', '1', NULL, NULL, NULL, NULL); 108 | INSERT INTO `glpi_plugin_appweb_profiles` (`ID`, `name`, `interface`, `is_default`, `appweb`, `create_appweb`, `update_appweb`, `delete_appweb`) 109 | VALUES ('2', 'normal', 'appweb', '0', 'r', NULL, NULL, NULL); 110 | INSERT INTO `glpi_plugin_appweb_profiles` (`ID`, `name`, `interface`, `is_default`, `appweb`, `create_appweb`, `update_appweb`, `delete_appweb`) 111 | VALUES ('3', 'admin', 'appweb', '0', 'w', '1', '1', '0'); 112 | INSERT INTO `glpi_plugin_appweb_profiles` (`ID`, `name`, `interface`, `is_default`, `appweb`, `create_appweb`, `update_appweb`, `delete_appweb`) 113 | VALUES ('4', 'super-admin', 'appweb', '0', 'w', '1', '1', '1'); -------------------------------------------------------------------------------- /sql/update-1.6.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_appweb_protocol`; 2 | 3 | ALTER TABLE `glpi_plugin_appweb` 4 | RENAME `glpi_plugin_webapplications_webapplications`; 5 | ALTER TABLE `glpi_dropdown_plugin_appweb_type` 6 | RENAME `glpi_plugin_webapplications_webapplicationtypes`; 7 | ALTER TABLE `glpi_dropdown_plugin_appweb_server_type` 8 | RENAME `glpi_plugin_webapplications_webapplicationservertypes`; 9 | ALTER TABLE `glpi_dropdown_plugin_appweb_technic` 10 | RENAME `glpi_plugin_webapplications_webapplicationtechnics`; 11 | ALTER TABLE `glpi_plugin_appweb_device` 12 | RENAME `glpi_plugin_webapplications_webapplications_items`; 13 | ALTER TABLE `glpi_plugin_appweb_profiles` 14 | RENAME `glpi_plugin_webapplications_profiles`; 15 | 16 | UPDATE `glpi_plugin_webapplications_webapplications` 17 | SET `FK_users` = '0' 18 | WHERE `FK_users` IS NULL; 19 | 20 | ALTER TABLE `glpi_plugin_webapplications_webapplications` 21 | CHANGE `ID` `id` INT(11) NOT NULL AUTO_INCREMENT, 22 | CHANGE `FK_entities` `entities_id` INT(11) NOT NULL DEFAULT '0', 23 | CHANGE `recursive` `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 24 | CHANGE `name` `name` VARCHAR(255) 25 | COLLATE utf8_unicode_ci DEFAULT NULL, 26 | CHANGE `address` `address` VARCHAR(255) 27 | COLLATE utf8_unicode_ci DEFAULT NULL, 28 | ADD `backoffice` VARCHAR(255) 29 | COLLATE utf8_unicode_ci DEFAULT NULL, 30 | CHANGE `type` `plugin_webapplications_webapplicationtypes_id` INT(11) NOT NULL DEFAULT '0' 31 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationtypes (id)', 32 | CHANGE `server` `plugin_webapplications_webapplicationservertypes_id` INT(11) NOT NULL DEFAULT '0' 33 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationservertypes (id)', 34 | CHANGE `technic` `plugin_webapplications_webapplicationtechnics_id` INT(11) NOT NULL DEFAULT '0' 35 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationtechnics (id)', 36 | CHANGE `version` `version` VARCHAR(255) 37 | COLLATE utf8_unicode_ci DEFAULT NULL, 38 | CHANGE `FK_users` `users_id` INT(11) DEFAULT '0' 39 | COMMENT 'RELATION to glpi_users (id)', 40 | CHANGE `FK_groups` `groups_id` INT(11) NOT NULL DEFAULT '0' 41 | COMMENT 'RELATION to glpi_groups (id)', 42 | CHANGE `FK_enterprise` `suppliers_id` INT(11) NOT NULL DEFAULT '0' 43 | COMMENT 'RELATION to glpi_suppliers (id)', 44 | CHANGE `FK_glpi_enterprise` `manufacturers_id` INT(11) NOT NULL DEFAULT '0' 45 | COMMENT 'RELATION to glpi_manufacturers (id)', 46 | CHANGE `location` `locations_id` INT(11) NOT NULL DEFAULT '0' 47 | COMMENT 'RELATION to glpi_locations (id)', 48 | CHANGE `helpdesk_visible` `is_helpdesk_visible` INT(11) NOT NULL DEFAULT '1', 49 | CHANGE `notes` `notepad` LONGTEXT COLLATE utf8_unicode_ci, 50 | CHANGE `comment` `comment` TEXT COLLATE utf8_unicode_ci, 51 | CHANGE `deleted` `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', 52 | ADD INDEX (`name`), 53 | ADD INDEX (`entities_id`), 54 | ADD INDEX (`plugin_webapplications_webapplicationtypes_id`), 55 | ADD INDEX (`plugin_webapplications_webapplicationservertypes_id`), 56 | ADD INDEX (`plugin_webapplications_webapplicationtechnics_id`), 57 | ADD INDEX (`users_id`), 58 | ADD INDEX (`groups_id`), 59 | ADD INDEX (`suppliers_id`), 60 | ADD INDEX (`manufacturers_id`), 61 | ADD INDEX (`locations_id`), 62 | ADD INDEX (`date_mod`), 63 | ADD INDEX (`is_helpdesk_visible`), 64 | ADD INDEX (`is_deleted`); 65 | 66 | ALTER TABLE `glpi_plugin_webapplications_webapplicationtypes` 67 | CHANGE `ID` `id` INT(11) NOT NULL AUTO_INCREMENT, 68 | CHANGE `FK_entities` `entities_id` INT(11) NOT NULL DEFAULT '0', 69 | CHANGE `name` `name` VARCHAR(255) 70 | COLLATE utf8_unicode_ci DEFAULT NULL, 71 | CHANGE `comments` `comment` TEXT COLLATE utf8_unicode_ci; 72 | 73 | ALTER TABLE `glpi_plugin_webapplications_webapplicationservertypes` 74 | CHANGE `ID` `id` INT(11) NOT NULL AUTO_INCREMENT, 75 | CHANGE `name` `name` VARCHAR(255) 76 | COLLATE utf8_unicode_ci DEFAULT NULL, 77 | CHANGE `comments` `comment` TEXT COLLATE utf8_unicode_ci; 78 | 79 | ALTER TABLE `glpi_plugin_webapplications_webapplicationtechnics` 80 | CHANGE `ID` `id` INT(11) NOT NULL AUTO_INCREMENT, 81 | CHANGE `name` `name` VARCHAR(255) 82 | COLLATE utf8_unicode_ci DEFAULT NULL, 83 | CHANGE `comments` `comment` TEXT COLLATE utf8_unicode_ci; 84 | 85 | ALTER TABLE `glpi_plugin_webapplications_webapplications_items` 86 | CHANGE `ID` `id` INT(11) NOT NULL AUTO_INCREMENT, 87 | CHANGE `FK_appweb` `plugin_webapplications_webapplications_id` INT(11) NOT NULL DEFAULT '0', 88 | CHANGE `FK_device` `items_id` INT(11) NOT NULL DEFAULT '0' 89 | COMMENT 'RELATION to various tables, according to itemtype (id)', 90 | CHANGE `device_type` `itemtype` VARCHAR(100) 91 | COLLATE utf8_unicode_ci NOT NULL 92 | COMMENT 'see .class.php file', 93 | DROP INDEX `FK_appweb_2`, 94 | DROP INDEX `FK_device`, 95 | ADD UNIQUE `unicity` (`plugin_webapplications_webapplications_id`, `itemtype`, `items_id`), 96 | ADD INDEX `FK_device` (`items_id`, `itemtype`), 97 | ADD INDEX `item` (`itemtype`, `items_id`); 98 | 99 | ALTER TABLE `glpi_plugin_webapplications_profiles` 100 | CHANGE `ID` `id` INT(11) NOT NULL AUTO_INCREMENT, 101 | ADD `profiles_id` INT(11) NOT NULL DEFAULT '0' 102 | COMMENT 'RELATION to glpi_profiles (id)', 103 | CHANGE `appweb` `webapplications` CHAR(1) 104 | COLLATE utf8_unicode_ci DEFAULT NULL, 105 | CHANGE `open_ticket` `open_ticket` CHAR(1) 106 | COLLATE utf8_unicode_ci DEFAULT NULL, 107 | ADD INDEX (`profiles_id`); 108 | -------------------------------------------------------------------------------- /setup.php: -------------------------------------------------------------------------------- 1 | . 28 | -------------------------------------------------------------------------- 29 | */ 30 | 31 | define('PLUGIN_WEBAPPLICATIONS_VERSION', '5.1.3'); 32 | 33 | global $CFG_GLPI; 34 | 35 | use Glpi\Plugin\Hooks; 36 | use GlpiPlugin\Webapplications\Appliance; 37 | use GlpiPlugin\Webapplications\Dashboard; 38 | use GlpiPlugin\Webapplications\DatabaseInstance; 39 | use GlpiPlugin\Webapplications\Entity; 40 | use GlpiPlugin\Webapplications\Process; 41 | use GlpiPlugin\Webapplications\Profile; 42 | use GlpiPlugin\Webapplications\Stream; 43 | 44 | if (!defined("PLUGIN_WEBAPPLICATIONS_DIR")) { 45 | define("PLUGIN_WEBAPPLICATIONS_DIR", Plugin::getPhpDir("webapplications")); 46 | $root = $CFG_GLPI['root_doc'] . '/plugins/webapplications'; 47 | define("PLUGIN_WEBAPPLICATIONS_WEBDIR", $root); 48 | } 49 | 50 | 51 | // Init the hooks of the plugins -Needed 52 | function plugin_init_webapplications() 53 | { 54 | global $PLUGIN_HOOKS, $CFG_GLPI; 55 | 56 | $PLUGIN_HOOKS['csrf_compliant']['webapplications'] = true; 57 | 58 | $PLUGIN_HOOKS['change_profile']['webapplications'] = [ 59 | Profile::class, 60 | 'initProfile', 61 | ]; 62 | 63 | Plugin::registerClass(Profile::class, ['addtabon' => ['Profile']]); 64 | if (Session::getLoginUserID()) { 65 | if (Session::haveRight("plugin_webapplications_appliances", READ)) { 66 | $PLUGIN_HOOKS['menu_toadd']['webapplications']['appliancedashboard'] = [ 67 | Dashboard::class, 68 | Entity::class, 69 | Process::class, 70 | Stream::class, 71 | ]; 72 | } 73 | } 74 | 75 | $PLUGIN_HOOKS['post_item_form']['webapplications'] = [Appliance::class, 'addFields']; 76 | 77 | $PLUGIN_HOOKS['item_purge']['webapplications']['Appliance'] = [ 78 | Appliance::class, 79 | 'cleanRelationToAppliance', 80 | ]; 81 | $PLUGIN_HOOKS['item_purge']['webapplications']['DatabaseInstance'] = [ 82 | DatabaseInstance::class, 83 | 'cleanRelationToDatabase', 84 | ]; 85 | 86 | // Other fields inherited from webapplications 87 | $PLUGIN_HOOKS['item_add']['webapplications'] = [ 88 | 'Appliance' => [ 89 | Appliance::class, 90 | 'applianceAdd', 91 | ], 92 | 'DatabaseInstance' => [ 93 | DatabaseInstance::class, 94 | 'databaseAdd', 95 | ], 96 | 'Appliance_Item' => [ 97 | DatabaseInstance::class, 98 | 'databaseLink', 99 | ], 100 | ]; 101 | 102 | $PLUGIN_HOOKS['pre_item_update']['webapplications'] = [ 103 | 'Appliance' => [ 104 | Appliance::class, 105 | 'applianceUpdate', 106 | ], 107 | 'DatabaseInstance' => [ 108 | DatabaseInstance::class, 109 | 'databaseUpdate', 110 | ], 111 | ]; 112 | 113 | 114 | array_push( 115 | $CFG_GLPI['appliance_types'], 116 | Process::class, 117 | Entity::class, 118 | Stream::class, 119 | 'Appliance' 120 | ); 121 | $CFG_GLPI['stream_types'] = ['DatabaseInstance', 'Computer', 'NetworkEquipment', 'Appliance']; 122 | 123 | 124 | if (isset($_SERVER['REQUEST_URI']) 125 | && (strpos($_SERVER['REQUEST_URI'], "front/appliance.form.php") == true 126 | || strpos($_SERVER['REQUEST_URI'], "front/databaseinstance.form.php") == true 127 | || strpos($_SERVER['REQUEST_URI'], "front/process.form.php") == true 128 | || strpos($_SERVER['REQUEST_URI'], "front/dashboard.php") == true)) { 129 | $PLUGIN_HOOKS[Hooks::ADD_JAVASCRIPT]['webapplications'][] = 'scripts/securityneedscolor.js'; 130 | } 131 | 132 | $PLUGIN_HOOKS[Hooks::ADD_CSS]['webapplications'] = ['css/webapplications.css']; 133 | } 134 | 135 | 136 | /** 137 | * Get the name and the version of the plugin - Needed 138 | * 139 | * @return array 140 | */ 141 | function plugin_version_webapplications() 142 | { 143 | return [ 144 | 'name' => __('Appliance dashboard', 'webapplications'), 145 | 'version' => PLUGIN_WEBAPPLICATIONS_VERSION, 146 | 'license' => 'GPLv2+', 147 | 'oldname' => 'appweb', 148 | 'author' => "Infotel, Xavier CAILLAUD", 149 | 'homepage' => 'https://github.com/InfotelGLPI/webapplications', 150 | 'requirements' => [ 151 | 'glpi' => [ 152 | 'min' => '11.0', 153 | 'max' => '12.0', 154 | 'dev' => false, 155 | ], 156 | ], 157 | ]; 158 | } 159 | -------------------------------------------------------------------------------- /sql/empty-1.3.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_appweb`; 2 | CREATE TABLE `glpi_plugin_appweb` ( 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 | `address` VARCHAR(255) 8 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 9 | `type` INT(4) NOT NULL DEFAULT '0', 10 | `server` INT(4) NOT NULL DEFAULT '0', 11 | `technic` INT(4) NOT NULL DEFAULT '0', 12 | `version` VARCHAR(255) 13 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 14 | `port` VARCHAR(255) 15 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 16 | `protocol` INT(4) NOT NULL DEFAULT '0', 17 | `link_name` VARCHAR(255) 18 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 19 | `FK_enterprise` SMALLINT(6) NOT NULL DEFAULT '0', 20 | `FK_glpi_enterprise` SMALLINT(6) NOT NULL DEFAULT '0', 21 | `target` SMALLINT(6) NOT NULL DEFAULT '0', 22 | `location` INT(4) NOT NULL DEFAULT '0', 23 | `notes` LONGTEXT, 24 | `comment` VARCHAR(255) 25 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 26 | `deleted` SMALLINT(6) NOT NULL DEFAULT '0', 27 | PRIMARY KEY (`ID`) 28 | ) 29 | ENGINE = MyISAM 30 | DEFAULT CHARSET = utf8 31 | COLLATE = utf8_unicode_ci; 32 | 33 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_appweb_type`; 34 | CREATE TABLE `glpi_dropdown_plugin_appweb_type` ( 35 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 36 | `FK_entities` INT(11) NOT NULL DEFAULT '0', 37 | `name` VARCHAR(255) 38 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 39 | `comments` TEXT, 40 | PRIMARY KEY (`ID`), 41 | KEY `name` (`name`) 42 | ) 43 | ENGINE = MyISAM 44 | DEFAULT CHARSET = utf8 45 | COLLATE = utf8_unicode_ci; 46 | 47 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_appweb_server_type`; 48 | CREATE TABLE `glpi_dropdown_plugin_appweb_server_type` ( 49 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 50 | `name` VARCHAR(255) 51 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 52 | `comments` TEXT, 53 | PRIMARY KEY (`ID`), 54 | KEY `name` (`name`) 55 | ) 56 | ENGINE = MyISAM 57 | DEFAULT CHARSET = utf8 58 | COLLATE = utf8_unicode_ci; 59 | 60 | INSERT INTO `glpi_dropdown_plugin_appweb_server_type` (`ID`, `name`, `comments`) VALUES ('1', 'Apache', ''); 61 | INSERT INTO `glpi_dropdown_plugin_appweb_server_type` (`ID`, `name`, `comments`) VALUES ('2', 'IIS', ''); 62 | INSERT INTO `glpi_dropdown_plugin_appweb_server_type` (`ID`, `name`, `comments`) VALUES ('3', 'Tomcat', ''); 63 | 64 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_appweb_technic`; 65 | CREATE TABLE `glpi_dropdown_plugin_appweb_technic` ( 66 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 67 | `name` VARCHAR(255) 68 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 69 | `comments` TEXT, 70 | PRIMARY KEY (`ID`), 71 | KEY `name` (`name`) 72 | ) 73 | ENGINE = MyISAM 74 | DEFAULT CHARSET = utf8 75 | COLLATE = utf8_unicode_ci; 76 | 77 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('1', 'Asp', ''); 78 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('2', 'Cgi', ''); 79 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('3', 'Java', ''); 80 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('4', 'Perl', ''); 81 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('5', 'Php', ''); 82 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('6', '.Net', ''); 83 | 84 | DROP TABLE IF EXISTS `glpi_plugin_appweb_device`; 85 | CREATE TABLE `glpi_plugin_appweb_device` ( 86 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 87 | `FK_appweb` INT(11) NOT NULL DEFAULT '0', 88 | `FK_device` INT(11) NOT NULL DEFAULT '0', 89 | `device_type` INT(11) NOT NULL DEFAULT '0', 90 | PRIMARY KEY (`ID`), 91 | UNIQUE KEY `FK_compte` (`FK_appweb`, `FK_device`, `device_type`), 92 | KEY `FK_appweb_2` (`FK_appweb`), 93 | KEY `FK_device` (`FK_device`, `device_type`) 94 | ) 95 | ENGINE = MyISAM 96 | DEFAULT CHARSET = utf8 97 | COLLATE = utf8_unicode_ci; 98 | 99 | DROP TABLE IF EXISTS `glpi_plugin_appweb_profiles`; 100 | CREATE TABLE `glpi_plugin_appweb_profiles` ( 101 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 102 | `name` VARCHAR(255) 103 | COLLATE utf8_unicode_ci DEFAULT NULL, 104 | `interface` VARCHAR(50) 105 | COLLATE utf8_unicode_ci NOT NULL DEFAULT 'appweb', 106 | `is_default` SMALLINT(6) NOT NULL DEFAULT '0', 107 | `appweb` CHAR(1) DEFAULT NULL, 108 | PRIMARY KEY (`ID`), 109 | KEY `interface` (`interface`) 110 | ) 111 | ENGINE = MyISAM 112 | DEFAULT CHARSET = utf8 113 | COLLATE = utf8_unicode_ci; 114 | 115 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '1300', '2', '2', '0'); 116 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '1300', '6', '3', '0'); 117 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '1300', '7', '4', '0'); 118 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '1300', '8', '5', '0'); 119 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '1300', '12', '6', '0'); -------------------------------------------------------------------------------- /sql/update-5.0.0.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `glpi_plugin_webapplications_webapplicationexternalexpositions` 2 | ( 3 | `id` int unsigned NOT NULL AUTO_INCREMENT, 4 | `name` VARCHAR(255) 5 | COLLATE utf8mb4_unicode_ci DEFAULT NULL, 6 | `comment` TEXT COLLATE utf8mb4_unicode_ci, 7 | PRIMARY KEY (`id`), 8 | KEY `name` (`name`) 9 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 10 | 11 | ALTER TABLE `glpi_plugin_webapplications_appliances` 12 | ADD `webapplicationexternalexpositions_id` int unsigned NOT NULL DEFAULT '0', 13 | ADD `webapplicationreferringdepartmentvalidation` tinyint NOT NULL default '0', 14 | ADD `webapplicationciovalidation` tinyint NOT NULL default '0', 15 | ADD `webapplicationavailabilities` int unsigned NOT NULL DEFAULT '1', 16 | ADD `webapplicationintegrities` int unsigned NOT NULL DEFAULT '1', 17 | ADD `webapplicationconfidentialities` int unsigned NOT NULL DEFAULT '0', 18 | ADD `webapplicationtraceabilities` int unsigned NOT NULL DEFAULT '1', 19 | ADD `editor` int unsigned NOT NULL default '0', 20 | ADD `version` VARCHAR (255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 21 | ADD `number_users` int unsigned NOT NULL default '0'; 22 | 23 | CREATE TABLE `glpi_plugin_webapplications_databaseinstances` 24 | ( 25 | `id` int unsigned NOT NULL auto_increment, 26 | `databaseinstances_id` int unsigned NOT NULL DEFAULT '0', 27 | `webapplicationexternalexpositions_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationexternalexpositions (id)', 28 | `webapplicationavailabilities` int unsigned NOT NULL DEFAULT '1', 29 | `webapplicationintegrities` int unsigned NOT NULL DEFAULT '1', 30 | `webapplicationconfidentialities` int unsigned NOT NULL DEFAULT '0', 31 | `webapplicationtraceabilities` int unsigned NOT NULL DEFAULT '1', 32 | PRIMARY KEY (`id`), 33 | KEY `databaseinstances_id` (`databaseinstances_id`) 34 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 35 | 36 | CREATE TABLE `glpi_plugin_webapplications_streams` 37 | ( 38 | `id` int unsigned NOT NULL auto_increment, 39 | `entities_id` int unsigned NOT NULL DEFAULT '0', 40 | `name` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 41 | `transmitter` int unsigned NOT NULL default '0', 42 | `transmitter_type` VARCHAR(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 43 | `receiver` int unsigned NOT NULL default '0', 44 | `receiver_type` VARCHAR(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 45 | `encryption` tinyint NOT NULL default '0', 46 | `encryption_type` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 47 | `port` int(5) unsigned NOT NULL, 48 | `protocol` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 49 | PRIMARY KEY (`id`), 50 | KEY `entities_id` (`entities_id`) 51 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 52 | 53 | CREATE TABLE `glpi_plugin_webapplications_entities` 54 | ( 55 | `id` int unsigned NOT NULL auto_increment, 56 | `entities_id` int unsigned NOT NULL, 57 | `name` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 58 | `owner` int unsigned NOT NULL default '0', 59 | `security_contact` int unsigned NOT NULL default '0', 60 | `relation_nature` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 61 | PRIMARY KEY (`id`), 62 | KEY `entities_id` (`entities_id`) 63 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 64 | 65 | CREATE TABLE `glpi_plugin_webapplications_processes` 66 | ( 67 | `id` int unsigned NOT NULL auto_increment, 68 | `entities_id` int unsigned NOT NULL DEFAULT '0', 69 | `name` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, 70 | `owner` int unsigned NOT NULL default '0', 71 | `webapplicationavailabilities` int unsigned NOT NULL DEFAULT '1', 72 | `webapplicationintegrities` int unsigned NOT NULL DEFAULT '1', 73 | `webapplicationconfidentialities` int unsigned NOT NULL DEFAULT '0', 74 | `webapplicationtraceabilities` int unsigned NOT NULL DEFAULT '1', 75 | `is_recursive` tinyint NOT NULL DEFAULT '0', 76 | `comment` varchar(255) DEFAULT NULL, 77 | PRIMARY KEY (`id`), 78 | KEY `entities_id` (`entities_id`) 79 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 80 | 81 | 82 | CREATE TABLE `glpi_plugin_webapplications_processes_entities` 83 | ( 84 | `id` int unsigned NOT NULL auto_increment, 85 | `plugin_webapplications_entities_id` int unsigned NOT NULL default '0', 86 | `plugin_webapplications_processes_id` int unsigned NOT NULL default '0', 87 | PRIMARY KEY (`id`), 88 | UNIQUE KEY `unicity` (`plugin_webapplications_entities_id`,`plugin_webapplications_processes_id`) 89 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 90 | 91 | CREATE TABLE `glpi_plugin_webapplications_dashboards` 92 | ( 93 | `id` int unsigned NOT NULL auto_increment, 94 | `entities_id` int unsigned NOT NULL DEFAULT '0', 95 | `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 96 | `users_id` int unsigned NOT NULL DEFAULT '0', 97 | PRIMARY KEY (`id`) 98 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 99 | 100 | INSERT INTO `glpi_plugin_webapplications_dashboards` 101 | VALUES ('1', 0, 1, 0); 102 | -------------------------------------------------------------------------------- /front/dashboard.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | use GlpiPlugin\Webapplications\Dashboard; 31 | 32 | include('../../../inc/includes.php'); 33 | 34 | Session::checkLoginUser(); 35 | 36 | if (!isset($_GET["id"])) { 37 | $_GET["id"] = "1"; 38 | } 39 | if (!isset($_GET["withtemplate"])) { 40 | $_GET["withtemplate"] = ""; 41 | } 42 | 43 | $iapp = new \Appliance_Item(); 44 | 45 | if (isset($_POST['add'])) { 46 | $iapp->check(-1, CREATE, $_POST); 47 | $iapp->add($_POST); 48 | 49 | if ($_POST['itemtype'] == 'Computer') { 50 | $item = new \Appliance(); 51 | $item->getFromDB($_POST['appliances_id']); 52 | 53 | $instances = getAllDataFromTable( 54 | \DatabaseInstance::getTable(), 55 | [ 56 | 'WHERE' => [ 57 | 'items_id' => $_POST['items_id'], 58 | 'itemtype' => $_POST['itemtype'], 59 | ], 60 | ] 61 | ); 62 | foreach ($instances as $row) { 63 | $input['appliances_id'] = $_POST['appliances_id']; 64 | $input['items_id'] = $row['id']; 65 | $input['itemtype'] = "DatabaseInstance"; 66 | if ($iapp->add($input)) { 67 | 68 | $i_items = getAllDataFromTable( 69 | ImpactItem::getTable(), 70 | [ 71 | 'WHERE' => [ 72 | 'itemtype' => 'Appliance', 73 | 'items_id' => $_POST['appliances_id'], 74 | ] 75 | ] 76 | ); 77 | 78 | foreach ($i_items as $i_item) { 79 | $impact = new ImpactItem(); 80 | $impact->add([ 81 | 'impactcontexts_id' => $i_item['impactcontexts_id'], 82 | 'itemtype' => 'DatabaseInstance', 83 | 'items_id' => $row['id'] 84 | ]); 85 | $impactr = new ImpactRelation(); 86 | $impactr->add([ 87 | 'itemtype_source' => $_POST['itemtype'], 88 | 'items_id_source' => $_POST['items_id'], 89 | 'itemtype_impacted' => 'DatabaseInstance', 90 | 'items_id_impacted' => $row['id'], 91 | ]); 92 | } 93 | } 94 | } 95 | } 96 | 97 | $i_items = getAllDataFromTable( 98 | ImpactItem::getTable(), 99 | [ 100 | 'WHERE' => [ 101 | 'itemtype' => 'Appliance', 102 | 'items_id' => $_POST['appliances_id'], 103 | ] 104 | ] 105 | ); 106 | 107 | foreach ($i_items as $i_item) { 108 | $impact = new ImpactItem(); 109 | $impact->add([ 110 | 'impactcontexts_id' => $i_item['impactcontexts_id'], 111 | 'itemtype' => $_POST['itemtype'], 112 | 'items_id' => $_POST['items_id'] 113 | ]); 114 | $impactr = new ImpactRelation(); 115 | $impactr->add([ 116 | 'itemtype_source' => 'Appliance', 117 | 'items_id_source' => $_POST['appliances_id'], 118 | 'itemtype_impacted' => $_POST['itemtype'], 119 | 'items_id_impacted' => $_POST['items_id'], 120 | ]); 121 | } 122 | 123 | 124 | Html::back(); 125 | } elseif (isset($_POST['reset'])) { 126 | $itemsAppDBTM = new Appliance_Item(); 127 | 128 | $appliances_id = 0; 129 | if ($itemsAppDBTM->getFromDBByCrit([ 130 | 'items_id' => $_POST['items_id'], 131 | 'itemtype' => $_POST['itemtype'] 132 | ])) { 133 | $appliances_id = $itemsAppDBTM->fields['appliances_id']; 134 | } 135 | $itemsAppDBTM->deleteByCriteria([ 136 | 'items_id' => $_POST['items_id'], 137 | 'itemtype' => $_POST['itemtype'] 138 | ]); 139 | 140 | if ($_POST['itemtype'] == 'Computer' && $appliances_id > 0) { 141 | $instances = getAllDataFromTable( 142 | DatabaseInstance::getTable(), 143 | [ 144 | 'WHERE' => [ 145 | 'items_id' => $_POST['items_id'], 146 | 'itemtype' => $_POST['itemtype'], 147 | ], 148 | ] 149 | ); 150 | foreach ($instances as $row) { 151 | $input['appliances_id'] = $appliances_id; 152 | $input['items_id'] = $row['id']; 153 | $input['itemtype'] = "DatabaseInstance"; 154 | $itemsAppDBTM->deleteByCriteria($input); 155 | } 156 | } 157 | 158 | Html::back(); 159 | } 160 | 161 | $dashboard = new Dashboard; 162 | 163 | Html::header( 164 | Dashboard::getTypeName(2), 165 | $_SERVER['PHP_SELF'], 166 | "appliancedashboard", 167 | Dashboard::class 168 | ); 169 | 170 | $id = 0; 171 | if (isset($_SESSION['plugin_webapplications_loaded_appliances_id'])) { 172 | $id = $_SESSION['plugin_webapplications_loaded_appliances_id']; 173 | } 174 | 175 | Dashboard::selectAppliance($id); 176 | 177 | Html::footer(); 178 | -------------------------------------------------------------------------------- /sql/empty-1.5.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_appweb`; 2 | CREATE TABLE `glpi_plugin_appweb` ( 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 | `address` VARCHAR(255) 9 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 10 | `type` INT(4) NOT NULL DEFAULT '0', 11 | `server` INT(4) NOT NULL DEFAULT '0', 12 | `technic` INT(4) NOT NULL DEFAULT '0', 13 | `version` VARCHAR(255) 14 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 15 | `FK_users` INT(4) NOT NULL, 16 | `FK_groups` INT(11) NOT NULL DEFAULT '0', 17 | `FK_enterprise` SMALLINT(6) NOT NULL DEFAULT '0', 18 | `FK_glpi_enterprise` SMALLINT(6) NOT NULL DEFAULT '0', 19 | `location` INT(4) NOT NULL DEFAULT '0', 20 | `notes` LONGTEXT, 21 | `comment` VARCHAR(255) 22 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 23 | `deleted` SMALLINT(6) NOT NULL DEFAULT '0', 24 | PRIMARY KEY (`ID`) 25 | ) 26 | ENGINE = MyISAM 27 | DEFAULT CHARSET = utf8 28 | COLLATE = utf8_unicode_ci; 29 | 30 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_appweb_type`; 31 | CREATE TABLE `glpi_dropdown_plugin_appweb_type` ( 32 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 33 | `FK_entities` INT(11) NOT NULL DEFAULT '0', 34 | `name` VARCHAR(255) 35 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 36 | `comments` TEXT, 37 | PRIMARY KEY (`ID`), 38 | KEY `name` (`name`) 39 | ) 40 | ENGINE = MyISAM 41 | DEFAULT CHARSET = utf8 42 | COLLATE = utf8_unicode_ci; 43 | 44 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_appweb_server_type`; 45 | CREATE TABLE `glpi_dropdown_plugin_appweb_server_type` ( 46 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 47 | `name` VARCHAR(255) 48 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 49 | `comments` TEXT, 50 | PRIMARY KEY (`ID`), 51 | KEY `name` (`name`) 52 | ) 53 | ENGINE = MyISAM 54 | DEFAULT CHARSET = utf8 55 | COLLATE = utf8_unicode_ci; 56 | 57 | INSERT INTO `glpi_dropdown_plugin_appweb_server_type` (`ID`, `name`, `comments`) VALUES ('1', 'Apache', ''); 58 | INSERT INTO `glpi_dropdown_plugin_appweb_server_type` (`ID`, `name`, `comments`) VALUES ('2', 'IIS', ''); 59 | INSERT INTO `glpi_dropdown_plugin_appweb_server_type` (`ID`, `name`, `comments`) VALUES ('3', 'Tomcat', ''); 60 | 61 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_appweb_technic`; 62 | CREATE TABLE `glpi_dropdown_plugin_appweb_technic` ( 63 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 64 | `name` VARCHAR(255) 65 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 66 | `comments` TEXT, 67 | PRIMARY KEY (`ID`), 68 | KEY `name` (`name`) 69 | ) 70 | ENGINE = MyISAM 71 | DEFAULT CHARSET = utf8 72 | COLLATE = utf8_unicode_ci; 73 | 74 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('1', 'Asp', ''); 75 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('2', 'Cgi', ''); 76 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('3', 'Java', ''); 77 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('4', 'Perl', ''); 78 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('5', 'Php', ''); 79 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('6', '.Net', ''); 80 | 81 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_appweb_protocol`; 82 | CREATE TABLE `glpi_dropdown_plugin_appweb_protocol` ( 83 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 84 | `name` VARCHAR(255) 85 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 86 | `comments` TEXT, 87 | PRIMARY KEY (`ID`), 88 | KEY `name` (`name`) 89 | ) 90 | ENGINE = MyISAM 91 | DEFAULT CHARSET = utf8 92 | COLLATE = utf8_unicode_ci; 93 | 94 | INSERT INTO `glpi_dropdown_plugin_appweb_protocol` (`ID`, `name`, `comments`) VALUES ('1', 'http', ''); 95 | INSERT INTO `glpi_dropdown_plugin_appweb_protocol` (`ID`, `name`, `comments`) VALUES ('2', 'https', ''); 96 | 97 | DROP TABLE IF EXISTS `glpi_plugin_appweb_device`; 98 | CREATE TABLE `glpi_plugin_appweb_device` ( 99 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 100 | `FK_appweb` 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_appweb` (`FK_appweb`, `FK_device`, `device_type`), 105 | KEY `FK_appweb_2` (`FK_appweb`), 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_appweb_profiles`; 113 | CREATE TABLE `glpi_plugin_appweb_profiles` ( 114 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 115 | `name` VARCHAR(255) 116 | COLLATE utf8_unicode_ci DEFAULT NULL, 117 | `appweb` CHAR(1) DEFAULT NULL, 118 | `open_ticket` CHAR(1) DEFAULT NULL, 119 | PRIMARY KEY (`ID`), 120 | KEY `name` (`name`) 121 | ) 122 | ENGINE = MyISAM 123 | DEFAULT CHARSET = utf8 124 | COLLATE = utf8_unicode_ci; 125 | 126 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '1300', '2', '2', '0'); 127 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '1300', '3', '4', '0'); 128 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '1300', '6', '5', '0'); 129 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '1300', '7', '6', '0'); 130 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '1300', '8', '7', '0'); -------------------------------------------------------------------------------- /sql/empty-1.5.1.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_appweb`; 2 | CREATE TABLE `glpi_plugin_appweb` ( 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 | `address` VARCHAR(255) 9 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 10 | `type` INT(4) NOT NULL DEFAULT '0', 11 | `server` INT(4) NOT NULL DEFAULT '0', 12 | `technic` INT(4) NOT NULL DEFAULT '0', 13 | `version` VARCHAR(255) 14 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 15 | `FK_users` INT(4) NOT NULL, 16 | `FK_groups` INT(11) NOT NULL DEFAULT '0', 17 | `FK_enterprise` SMALLINT(6) NOT NULL DEFAULT '0', 18 | `FK_glpi_enterprise` SMALLINT(6) NOT NULL DEFAULT '0', 19 | `location` INT(4) NOT NULL DEFAULT '0', 20 | `date_mod` DATETIME DEFAULT NULL, 21 | `helpdesk_visible` INT(11) NOT NULL DEFAULT '1', 22 | `notes` LONGTEXT, 23 | `comment` VARCHAR(255) 24 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 25 | `deleted` SMALLINT(6) NOT NULL DEFAULT '0', 26 | PRIMARY KEY (`ID`) 27 | ) 28 | ENGINE = MyISAM 29 | DEFAULT CHARSET = utf8 30 | COLLATE = utf8_unicode_ci; 31 | 32 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_appweb_type`; 33 | CREATE TABLE `glpi_dropdown_plugin_appweb_type` ( 34 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 35 | `FK_entities` INT(11) NOT NULL DEFAULT '0', 36 | `name` VARCHAR(255) 37 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 38 | `comments` TEXT, 39 | PRIMARY KEY (`ID`), 40 | KEY `name` (`name`) 41 | ) 42 | ENGINE = MyISAM 43 | DEFAULT CHARSET = utf8 44 | COLLATE = utf8_unicode_ci; 45 | 46 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_appweb_server_type`; 47 | CREATE TABLE `glpi_dropdown_plugin_appweb_server_type` ( 48 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 49 | `name` VARCHAR(255) 50 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 51 | `comments` TEXT, 52 | PRIMARY KEY (`ID`), 53 | KEY `name` (`name`) 54 | ) 55 | ENGINE = MyISAM 56 | DEFAULT CHARSET = utf8 57 | COLLATE = utf8_unicode_ci; 58 | 59 | INSERT INTO `glpi_dropdown_plugin_appweb_server_type` (`ID`, `name`, `comments`) VALUES ('1', 'Apache', ''); 60 | INSERT INTO `glpi_dropdown_plugin_appweb_server_type` (`ID`, `name`, `comments`) VALUES ('2', 'IIS', ''); 61 | INSERT INTO `glpi_dropdown_plugin_appweb_server_type` (`ID`, `name`, `comments`) VALUES ('3', 'Tomcat', ''); 62 | 63 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_appweb_technic`; 64 | CREATE TABLE `glpi_dropdown_plugin_appweb_technic` ( 65 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 66 | `name` VARCHAR(255) 67 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 68 | `comments` TEXT, 69 | PRIMARY KEY (`ID`), 70 | KEY `name` (`name`) 71 | ) 72 | ENGINE = MyISAM 73 | DEFAULT CHARSET = utf8 74 | COLLATE = utf8_unicode_ci; 75 | 76 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('1', 'Asp', ''); 77 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('2', 'Cgi', ''); 78 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('3', 'Java', ''); 79 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('4', 'Perl', ''); 80 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('5', 'Php', ''); 81 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('6', '.Net', ''); 82 | 83 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_appweb_protocol`; 84 | CREATE TABLE `glpi_dropdown_plugin_appweb_protocol` ( 85 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 86 | `name` VARCHAR(255) 87 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 88 | `comments` TEXT, 89 | PRIMARY KEY (`ID`), 90 | KEY `name` (`name`) 91 | ) 92 | ENGINE = MyISAM 93 | DEFAULT CHARSET = utf8 94 | COLLATE = utf8_unicode_ci; 95 | 96 | INSERT INTO `glpi_dropdown_plugin_appweb_protocol` (`ID`, `name`, `comments`) VALUES ('1', 'http', ''); 97 | INSERT INTO `glpi_dropdown_plugin_appweb_protocol` (`ID`, `name`, `comments`) VALUES ('2', 'https', ''); 98 | 99 | DROP TABLE IF EXISTS `glpi_plugin_appweb_device`; 100 | CREATE TABLE `glpi_plugin_appweb_device` ( 101 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 102 | `FK_appweb` INT(11) NOT NULL DEFAULT '0', 103 | `FK_device` INT(11) NOT NULL DEFAULT '0', 104 | `device_type` INT(11) NOT NULL DEFAULT '0', 105 | PRIMARY KEY (`ID`), 106 | UNIQUE KEY `FK_appweb` (`FK_appweb`, `FK_device`, `device_type`), 107 | KEY `FK_appweb_2` (`FK_appweb`), 108 | KEY `FK_device` (`FK_device`, `device_type`) 109 | ) 110 | ENGINE = MyISAM 111 | DEFAULT CHARSET = utf8 112 | COLLATE = utf8_unicode_ci; 113 | 114 | DROP TABLE IF EXISTS `glpi_plugin_appweb_profiles`; 115 | CREATE TABLE `glpi_plugin_appweb_profiles` ( 116 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 117 | `name` VARCHAR(255) 118 | COLLATE utf8_unicode_ci DEFAULT NULL, 119 | `appweb` CHAR(1) DEFAULT NULL, 120 | `open_ticket` CHAR(1) DEFAULT NULL, 121 | PRIMARY KEY (`ID`), 122 | KEY `name` (`name`) 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, '1300', '2', '2', '0'); 129 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '1300', '3', '4', '0'); 130 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '1300', '6', '5', '0'); 131 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '1300', '7', '6', '0'); 132 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '1300', '8', '7', '0'); -------------------------------------------------------------------------------- /sql/empty-1.4.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_appweb`; 2 | CREATE TABLE `glpi_plugin_appweb` ( 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 | `address` VARCHAR(255) 9 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 10 | `type` INT(4) NOT NULL DEFAULT '0', 11 | `server` INT(4) NOT NULL DEFAULT '0', 12 | `technic` INT(4) NOT NULL DEFAULT '0', 13 | `version` VARCHAR(255) 14 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 15 | `port` VARCHAR(255) 16 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 17 | `protocol` INT(4) NOT NULL DEFAULT '0', 18 | `link_name` VARCHAR(255) 19 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 20 | `FK_enterprise` SMALLINT(6) NOT NULL DEFAULT '0', 21 | `FK_glpi_enterprise` SMALLINT(6) NOT NULL DEFAULT '0', 22 | `target` SMALLINT(6) NOT NULL DEFAULT '0', 23 | `location` INT(4) NOT NULL DEFAULT '0', 24 | `notes` LONGTEXT, 25 | `comment` VARCHAR(255) 26 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 27 | `deleted` SMALLINT(6) NOT NULL DEFAULT '0', 28 | PRIMARY KEY (`ID`) 29 | ) 30 | ENGINE = MyISAM 31 | DEFAULT CHARSET = utf8 32 | COLLATE = utf8_unicode_ci; 33 | 34 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_appweb_type`; 35 | CREATE TABLE `glpi_dropdown_plugin_appweb_type` ( 36 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 37 | `FK_entities` INT(11) NOT NULL DEFAULT '0', 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 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_appweb_server_type`; 49 | CREATE TABLE `glpi_dropdown_plugin_appweb_server_type` ( 50 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 51 | `name` VARCHAR(255) 52 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 53 | `comments` TEXT, 54 | PRIMARY KEY (`ID`), 55 | KEY `name` (`name`) 56 | ) 57 | ENGINE = MyISAM 58 | DEFAULT CHARSET = utf8 59 | COLLATE = utf8_unicode_ci; 60 | 61 | INSERT INTO `glpi_dropdown_plugin_appweb_server_type` (`ID`, `name`, `comments`) VALUES ('1', 'Apache', ''); 62 | INSERT INTO `glpi_dropdown_plugin_appweb_server_type` (`ID`, `name`, `comments`) VALUES ('2', 'IIS', ''); 63 | INSERT INTO `glpi_dropdown_plugin_appweb_server_type` (`ID`, `name`, `comments`) VALUES ('3', 'Tomcat', ''); 64 | 65 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_appweb_technic`; 66 | CREATE TABLE `glpi_dropdown_plugin_appweb_technic` ( 67 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 68 | `name` VARCHAR(255) 69 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 70 | `comments` TEXT, 71 | PRIMARY KEY (`ID`), 72 | KEY `name` (`name`) 73 | ) 74 | ENGINE = MyISAM 75 | DEFAULT CHARSET = utf8 76 | COLLATE = utf8_unicode_ci; 77 | 78 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('1', 'Asp', ''); 79 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('2', 'Cgi', ''); 80 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('3', 'Java', ''); 81 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('4', 'Perl', ''); 82 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('5', 'Php', ''); 83 | INSERT INTO `glpi_dropdown_plugin_appweb_technic` (`ID`, `name`, `comments`) VALUES ('6', '.Net', ''); 84 | 85 | DROP TABLE IF EXISTS `glpi_dropdown_plugin_appweb_protocol`; 86 | CREATE TABLE `glpi_dropdown_plugin_appweb_protocol` ( 87 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 88 | `name` VARCHAR(255) 89 | COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 90 | `comments` TEXT, 91 | PRIMARY KEY (`ID`), 92 | KEY `name` (`name`) 93 | ) 94 | ENGINE = MyISAM 95 | DEFAULT CHARSET = utf8 96 | COLLATE = utf8_unicode_ci; 97 | 98 | INSERT INTO `glpi_dropdown_plugin_appweb_protocol` (`ID`, `name`, `comments`) VALUES ('1', 'http', ''); 99 | INSERT INTO `glpi_dropdown_plugin_appweb_protocol` (`ID`, `name`, `comments`) VALUES ('2', 'https', ''); 100 | 101 | DROP TABLE IF EXISTS `glpi_plugin_appweb_device`; 102 | CREATE TABLE `glpi_plugin_appweb_device` ( 103 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 104 | `FK_appweb` INT(11) NOT NULL DEFAULT '0', 105 | `FK_device` INT(11) NOT NULL DEFAULT '0', 106 | `device_type` INT(11) NOT NULL DEFAULT '0', 107 | PRIMARY KEY (`ID`), 108 | UNIQUE KEY `FK_compte` (`FK_appweb`, `FK_device`, `device_type`), 109 | KEY `FK_appweb_2` (`FK_appweb`), 110 | KEY `FK_device` (`FK_device`, `device_type`) 111 | ) 112 | ENGINE = MyISAM 113 | DEFAULT CHARSET = utf8 114 | COLLATE = utf8_unicode_ci; 115 | 116 | DROP TABLE IF EXISTS `glpi_plugin_appweb_profiles`; 117 | CREATE TABLE `glpi_plugin_appweb_profiles` ( 118 | `ID` INT(11) NOT NULL AUTO_INCREMENT, 119 | `name` VARCHAR(255) 120 | COLLATE utf8_unicode_ci DEFAULT NULL, 121 | `interface` VARCHAR(50) 122 | COLLATE utf8_unicode_ci NOT NULL DEFAULT 'appweb', 123 | `is_default` SMALLINT(6) NOT NULL DEFAULT '0', 124 | `appweb` CHAR(1) DEFAULT NULL, 125 | PRIMARY KEY (`ID`), 126 | KEY `interface` (`interface`) 127 | ) 128 | ENGINE = MyISAM 129 | DEFAULT CHARSET = utf8 130 | COLLATE = utf8_unicode_ci; 131 | 132 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '1300', '2', '2', '0'); 133 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '1300', '6', '3', '0'); 134 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '1300', '7', '4', '0'); 135 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '1300', '8', '5', '0'); 136 | INSERT INTO `glpi_display` (`ID`, `type`, `num`, `rank`, `FK_users`) VALUES (NULL, '1300', '12', '6', '0'); -------------------------------------------------------------------------------- /src/Knowbase.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | namespace GlpiPlugin\Webapplications; 31 | 32 | use CommonDBTM; 33 | use CommonGLPI; 34 | use KnowbaseItem; 35 | use KnowbaseItem_Item; 36 | 37 | if (!defined('GLPI_ROOT')) { 38 | die("Sorry. You can't access directly to this file"); 39 | } 40 | 41 | /** 42 | * Class Knowbase 43 | */ 44 | class Knowbase extends CommonDBTM 45 | { 46 | public static $rightname = "plugin_webapplications_appliances"; 47 | 48 | public static function getTypeName($nb = 0) 49 | { 50 | return __('Knowledge base'); 51 | } 52 | 53 | public static function getIcon() 54 | { 55 | return "ti ti-lifebuoy"; 56 | } 57 | 58 | public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) 59 | { 60 | if ($_SESSION['glpishow_count_on_tabs']) { 61 | $ApplianceId = $_SESSION['plugin_webapplications_loaded_appliances_id'] ?? 0;; 62 | $kbAppDBTM = new KnowbaseItem_Item(); 63 | $kbApp = $kbAppDBTM->find(['items_id' => $ApplianceId, 64 | 'itemtype' => 'Appliance']); 65 | 66 | $nbEntities = count($kbApp); 67 | return self::createTabEntry(self::getTypeName($nbEntities), $nbEntities); 68 | } 69 | return self::getTypeName(); 70 | } 71 | 72 | public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) 73 | { 74 | self::showLists(); 75 | return true; 76 | } 77 | 78 | public static function showLists() 79 | { 80 | 81 | $ApplianceId = $_SESSION['plugin_webapplications_loaded_appliances_id'] ?? 0;; 82 | $item = new \Appliance(); 83 | $item->getFromDB($ApplianceId); 84 | 85 | Dashboard::showHeaderDashboard($ApplianceId); 86 | 87 | $icon = ""; 88 | 89 | echo "

$icon"; 90 | echo " ".__( 91 | 'Knowledge base' 92 | ).""; 93 | echo "

"; 94 | 95 | echo "
"; 96 | 97 | $withtemplate = 0; 98 | KnowbaseItem_Item::showForItem($item, $withtemplate); 99 | 100 | echo "
"; 101 | } 102 | 103 | private static function getCountForItem(CommonDBTM $item): int 104 | { 105 | if ($item->getType() == KnowbaseItem::getType()) { 106 | $criteria['WHERE'] = [ 107 | 'glpi_knowbaseitems_items.knowbaseitems_id' => $item->getID(), 108 | ]; 109 | } else { 110 | $criteria = self::getVisibilityCriteriaForItem($item); 111 | $criteria['WHERE'][] = [ 112 | 'glpi_knowbaseitems_items.itemtype' => $item::getType(), 113 | 'glpi_knowbaseitems_items.items_id' => $item->getId(), 114 | ]; 115 | } 116 | 117 | return countElementsInTable('glpi_knowbaseitems_items', $criteria); 118 | } 119 | 120 | /** 121 | * Return visibility criteria that must be used to find KB items related to given item. 122 | */ 123 | private static function getVisibilityCriteriaForItem(CommonDBTM $item): array 124 | { 125 | $criteria = array_merge_recursive( 126 | [ 127 | 'INNER JOIN' => [ 128 | 'glpi_knowbaseitems' => [ 129 | 'ON' => [ 130 | 'glpi_knowbaseitems_items' => 'knowbaseitems_id', 131 | 'glpi_knowbaseitems' => 'id' 132 | ] 133 | ] 134 | ] 135 | ], 136 | KnowbaseItem::getVisibilityCriteria() 137 | ); 138 | 139 | $entity_criteria = getEntitiesRestrictCriteria($item->getTable(), '', '', $item->maybeRecursive()); 140 | if (!empty($entity_criteria)) { 141 | $criteria['INNER JOIN'][$item->getTable()] = [ 142 | 'ON' => [ 143 | 'glpi_knowbaseitems_items' => 'items_id', 144 | $item->getTable() => 'id' 145 | ] 146 | ]; 147 | $criteria['WHERE'][] = $entity_criteria; 148 | } 149 | 150 | return $criteria; 151 | } 152 | 153 | public static function showFromDashboard($appliance) 154 | { 155 | global $CFG_GLPI; 156 | 157 | echo "
"; 158 | 159 | $ApplianceId = $appliance->getField('id'); 160 | 161 | $title = self::getTypeName(); 162 | $know_item = new KnowbaseItem(); 163 | 164 | Dashboard::showTitleforDashboard($title, $ApplianceId, $know_item, ""); 165 | 166 | $number = self::getCountForItem($appliance); 167 | 168 | 169 | 170 | if ($number > 0) { 171 | 172 | echo "
"; 173 | $start = 0; 174 | foreach (KnowbaseItem_Item::getItems($appliance, $start, $_SESSION['glpilist_limit']) as $data) { 175 | $know_item->getFromDB($data['knowbaseitems_id']); 176 | $name = $know_item->getName(); 177 | $open = $CFG_GLPI["root_doc"] . "/front/knowbaseitem.form.php"; 178 | $open .= (strpos($open, '?') ? '&' : '?') . 'id=' . $data['knowbaseitems_id']; 179 | echo "$name"; 180 | } 181 | 182 | echo "
"; 183 | 184 | } 185 | 186 | 187 | echo "
"; 188 | } 189 | } 190 | -------------------------------------------------------------------------------- /src/Stream_Item.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | namespace GlpiPlugin\Webapplications; 31 | 32 | use CommonDBTM; 33 | use CommonGLPI; 34 | use DbUtils; 35 | use Dropdown; 36 | use Glpi\Application\View\TemplateRenderer; 37 | use Glpi\Features\Inventoriable; 38 | use Html; 39 | use Toolbox; 40 | 41 | if (!defined('GLPI_ROOT')) { 42 | die("Sorry. You can't access directly to this file"); 43 | } 44 | 45 | /** 46 | * Class Stream_Item 47 | */ 48 | class Stream_Item extends CommonDBTM 49 | { 50 | 51 | 52 | public static $rightname = "plugin_webapplications_streams"; 53 | 54 | public static function getTypeName($nb = 0) 55 | { 56 | return _n('Item', 'Items', $nb); 57 | } 58 | 59 | 60 | public static function getIcon() 61 | { 62 | return Stream::getIcon(); 63 | } 64 | 65 | 66 | public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) 67 | { 68 | switch ($item::getType()) { 69 | case Stream::class: 70 | if ($_SESSION['glpishow_count_on_tabs']) { 71 | $dbu = new DbUtils(); 72 | $nbItems = $dbu->countElementsInTable( 73 | $this->getTable(), 74 | ["plugin_webapplications_streams_id" => $item->getID()] 75 | ); 76 | return self::createTabEntry(self::getTypeName($nbItems), $nbItems); 77 | } 78 | return _n("Database", 'Databases', 2); 79 | break; 80 | } 81 | return ''; 82 | } 83 | 84 | public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) 85 | { 86 | $field = new self(); 87 | 88 | if ($item->getType() == Stream::class) { 89 | $field->showForStream($item); 90 | } 91 | return true; 92 | } 93 | 94 | public function showForStream($item) 95 | { 96 | global $DB; 97 | $ID = $item->fields['id']; 98 | $rand = mt_rand(); 99 | 100 | if (!$this->canView()) { 101 | return false; 102 | } 103 | if (!$this->canCreate()) { 104 | return false; 105 | } 106 | 107 | $items = $DB->request([ 108 | 'FROM' => self::getTable(), 109 | 'WHERE' => [ 110 | 'plugin_webapplications_streams_id' => $ID 111 | ] 112 | ]); 113 | 114 | $stream = new Stream(); 115 | $canedit = $stream->can($item->fields['id'], UPDATE); 116 | if ($canedit) { 117 | echo "
"; 119 | 120 | echo "
"; 121 | echo ""; 122 | 123 | echo ""; 124 | echo ""; 133 | echo ""; 137 | echo ""; 138 | echo "
" . __('Add an item') . "
"; 125 | Dropdown::showSelectItemFromItemtypes( 126 | [ 127 | 'items_id_name' => 'items_id', 128 | 'itemtypes' => 'Assets', 129 | 'checkright' => true, 130 | ] 131 | ); 132 | echo ""; 134 | echo Html::hidden('plugin_webapplications_streams_id', ['value' => $item->getID()]); 135 | echo Html::submit(_sx('button', 'Add'), ['name' => 'add', 'class' => 'btn btn-primary']); 136 | echo "
"; 139 | Html::closeForm(); 140 | } 141 | 142 | 143 | $items = iterator_to_array($items); 144 | 145 | if (!count($items)) { 146 | echo ""; 147 | echo "
" . __('No results found') . "
"; 148 | } else { 149 | if ($canedit) { 150 | Html::openMassiveActionsForm('mass' . __CLASS__ . $rand); 151 | $massiveactionparams = [ 152 | 'num_displayed' => min($_SESSION['glpilist_limit'], count($items)), 153 | 'container' => 'mass' . __CLASS__ . $rand 154 | ]; 155 | Html::showMassiveActions($massiveactionparams); 156 | } 157 | 158 | echo ""; 159 | $header = ""; 160 | if ($canedit) { 161 | $header .= ""; 164 | } 165 | $header .= ""; 166 | $header .= ""; 167 | $header .= ""; 168 | echo $header; 169 | 170 | foreach ($items as $row) { 171 | $it = new $row['itemtype'](); 172 | $it->getFromDB($row['items_id']); 173 | echo ""; 174 | if ($canedit) { 175 | echo ""; 178 | } 179 | echo ""; 180 | echo ""; 181 | echo ""; 182 | } 183 | echo $header; 184 | echo "
"; 162 | $header .= Html::getCheckAllAsCheckbox('mass' . __CLASS__ . $rand); 163 | $header .= "" . __('Itemtype') . "" . _n('Item', 'Items', 1) . "
"; 176 | Html::showMassiveActionCheckBox(__CLASS__, $row["id"]); 177 | echo "" . $it->getTypeName(1) . "" . $it->getLink() . "
"; 185 | 186 | if ($canedit && count($items)) { 187 | $massiveactionparams['ontop'] = false; 188 | Html::showMassiveActions($massiveactionparams); 189 | } 190 | if ($canedit) { 191 | Html::closeForm(); 192 | } 193 | } 194 | } 195 | } 196 | -------------------------------------------------------------------------------- /sql/empty-2.0.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplications`; 2 | CREATE TABLE `glpi_plugin_webapplications_webapplications` ( 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 | `address` VARCHAR(255) 9 | COLLATE utf8_unicode_ci DEFAULT NULL, 10 | `backoffice` VARCHAR(255) 11 | COLLATE utf8_unicode_ci DEFAULT NULL, 12 | `plugin_webapplications_webapplicationtypes_id` INT(11) NOT NULL DEFAULT '0' 13 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationtypes (id)', 14 | `plugin_webapplications_webapplicationservertypes_id` INT(11) NOT NULL DEFAULT '0' 15 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationservertypes (id)', 16 | `plugin_webapplications_webapplicationtechnics_id` INT(11) NOT NULL DEFAULT '0' 17 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationtechnics (id)', 18 | `version` VARCHAR(255) 19 | COLLATE utf8_unicode_ci DEFAULT NULL, 20 | `users_id_tech` INT(11) NOT NULL DEFAULT '0' 21 | COMMENT 'RELATION to glpi_users (id)', 22 | `groups_id_tech` INT(11) NOT NULL DEFAULT '0' 23 | COMMENT 'RELATION to glpi_groups (id)', 24 | `suppliers_id` INT(11) NOT NULL DEFAULT '0' 25 | COMMENT 'RELATION to glpi_suppliers (id)', 26 | `manufacturers_id` INT(11) NOT NULL DEFAULT '0' 27 | COMMENT 'RELATION to glpi_manufacturers (id)', 28 | `locations_id` INT(11) NOT NULL DEFAULT '0' 29 | COMMENT 'RELATION to glpi_locations (id)', 30 | `date_mod` DATETIME DEFAULT NULL, 31 | `is_helpdesk_visible` INT(11) NOT NULL DEFAULT '1', 32 | `comment` TEXT COLLATE utf8_unicode_ci, 33 | `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', 34 | PRIMARY KEY (`id`), 35 | KEY `name` (`name`), 36 | KEY `entities_id` (`entities_id`), 37 | KEY `plugin_webapplications_webapplicationtypes_id` (`plugin_webapplications_webapplicationtypes_id`), 38 | KEY `plugin_webapplications_webapplicationservertypes_id` (`plugin_webapplications_webapplicationservertypes_id`), 39 | KEY `plugin_webapplications_webapplicationtechnics_id` (`plugin_webapplications_webapplicationtechnics_id`), 40 | KEY `users_id_tech` (`users_id_tech`), 41 | KEY `groups_id_tech` (`groups_id_tech`), 42 | KEY `suppliers_id` (`suppliers_id`), 43 | KEY `manufacturers_id` (`manufacturers_id`), 44 | KEY `locations_id` (`locations_id`), 45 | KEY date_mod (date_mod), 46 | KEY is_helpdesk_visible (is_helpdesk_visible), 47 | KEY `is_deleted` (`is_deleted`) 48 | ) 49 | ENGINE = MyISAM 50 | DEFAULT CHARSET = utf8 51 | COLLATE = utf8_unicode_ci; 52 | 53 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplicationtypes`; 54 | CREATE TABLE `glpi_plugin_webapplications_webapplicationtypes` ( 55 | `id` INT(11) NOT NULL AUTO_INCREMENT, 56 | `entities_id` INT(11) NOT NULL DEFAULT '0', 57 | `name` VARCHAR(255) 58 | COLLATE utf8_unicode_ci DEFAULT NULL, 59 | `comment` TEXT COLLATE utf8_unicode_ci, 60 | PRIMARY KEY (`id`), 61 | KEY `name` (`name`), 62 | KEY `entities_id` (`entities_id`) 63 | ) 64 | ENGINE = MyISAM 65 | DEFAULT CHARSET = utf8 66 | COLLATE = utf8_unicode_ci; 67 | 68 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplicationservertypes`; 69 | CREATE TABLE `glpi_plugin_webapplications_webapplicationservertypes` ( 70 | `id` INT(11) NOT NULL AUTO_INCREMENT, 71 | `name` VARCHAR(255) 72 | COLLATE utf8_unicode_ci DEFAULT NULL, 73 | `comment` TEXT COLLATE utf8_unicode_ci, 74 | PRIMARY KEY (`id`), 75 | KEY `name` (`name`) 76 | ) 77 | ENGINE = MyISAM 78 | DEFAULT CHARSET = utf8 79 | COLLATE = utf8_unicode_ci; 80 | 81 | INSERT INTO `glpi_plugin_webapplications_webapplicationservertypes` VALUES ('1', 'Apache', ''); 82 | INSERT INTO `glpi_plugin_webapplications_webapplicationservertypes` VALUES ('2', 'IIS', ''); 83 | INSERT INTO `glpi_plugin_webapplications_webapplicationservertypes` VALUES ('3', 'Tomcat', ''); 84 | 85 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplicationtechnics`; 86 | CREATE TABLE `glpi_plugin_webapplications_webapplicationtechnics` ( 87 | `id` INT(11) NOT NULL AUTO_INCREMENT, 88 | `name` VARCHAR(255) 89 | COLLATE utf8_unicode_ci DEFAULT NULL, 90 | `comment` TEXT COLLATE utf8_unicode_ci, 91 | PRIMARY KEY (`id`), 92 | KEY `name` (`name`) 93 | ) 94 | ENGINE = MyISAM 95 | DEFAULT CHARSET = utf8 96 | COLLATE = utf8_unicode_ci; 97 | 98 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('1', 'Asp', ''); 99 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('2', 'Cgi', ''); 100 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('3', 'Java', ''); 101 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('4', 'Perl', ''); 102 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('5', 'Php', ''); 103 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('6', '.Net', ''); 104 | 105 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplications_items`; 106 | CREATE TABLE `glpi_plugin_webapplications_webapplications_items` ( 107 | `id` INT(11) NOT NULL AUTO_INCREMENT, 108 | `plugin_webapplications_webapplications_id` INT(11) NOT NULL DEFAULT '0' 109 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplications (id)', 110 | `items_id` INT(11) NOT NULL DEFAULT '0' 111 | COMMENT 'RELATION to various tables, according to itemtype (id)', 112 | `itemtype` VARCHAR(100) 113 | COLLATE utf8_unicode_ci NOT NULL 114 | COMMENT 'see .class.php file', 115 | PRIMARY KEY (`id`), 116 | UNIQUE KEY `unicity` (`plugin_webapplications_webapplications_id`, `items_id`, `itemtype`), 117 | KEY `FK_device` (`items_id`, `itemtype`), 118 | KEY `item` (`itemtype`, `items_id`) 119 | ) 120 | ENGINE = MyISAM 121 | DEFAULT CHARSET = utf8 122 | COLLATE = utf8_unicode_ci; 123 | 124 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginWebapplicationsWebapplication', '2', '2', '0'); 125 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginWebapplicationsWebapplication', '3', '4', '0'); 126 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginWebapplicationsWebapplication', '6', '5', '0'); 127 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginWebapplicationsWebapplication', '7', '6', '0'); 128 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginWebapplicationsWebapplication', '8', '7', '0'); -------------------------------------------------------------------------------- /sql/empty-2.5.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplications`; 2 | CREATE TABLE `glpi_plugin_webapplications_webapplications` ( 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 | `address` VARCHAR(255) 9 | COLLATE utf8_unicode_ci DEFAULT NULL, 10 | `backoffice` VARCHAR(255) 11 | COLLATE utf8_unicode_ci DEFAULT NULL, 12 | `plugin_webapplications_webapplicationtypes_id` INT(11) NOT NULL DEFAULT '0' 13 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationtypes (id)', 14 | `plugin_webapplications_webapplicationservertypes_id` INT(11) NOT NULL DEFAULT '0' 15 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationservertypes (id)', 16 | `plugin_webapplications_webapplicationtechnics_id` INT(11) NOT NULL DEFAULT '0' 17 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationtechnics (id)', 18 | `version` VARCHAR(255) 19 | COLLATE utf8_unicode_ci DEFAULT NULL, 20 | `users_id_tech` INT(11) NOT NULL DEFAULT '0' 21 | COMMENT 'RELATION to glpi_users (id)', 22 | `groups_id_tech` INT(11) NOT NULL DEFAULT '0' 23 | COMMENT 'RELATION to glpi_groups (id)', 24 | `suppliers_id` INT(11) NOT NULL DEFAULT '0' 25 | COMMENT 'RELATION to glpi_suppliers (id)', 26 | `manufacturers_id` INT(11) NOT NULL DEFAULT '0' 27 | COMMENT 'RELATION to glpi_manufacturers (id)', 28 | `locations_id` INT(11) NOT NULL DEFAULT '0' 29 | COMMENT 'RELATION to glpi_locations (id)', 30 | `date_mod` DATETIME DEFAULT NULL, 31 | `is_helpdesk_visible` INT(11) NOT NULL DEFAULT '1', 32 | `comment` TEXT COLLATE utf8_unicode_ci, 33 | `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', 34 | PRIMARY KEY (`id`), 35 | KEY `name` (`name`), 36 | KEY `entities_id` (`entities_id`), 37 | KEY `plugin_webapplications_webapplicationtypes_id` (`plugin_webapplications_webapplicationtypes_id`), 38 | KEY `plugin_webapplications_webapplicationservertypes_id` (`plugin_webapplications_webapplicationservertypes_id`), 39 | KEY `plugin_webapplications_webapplicationtechnics_id` (`plugin_webapplications_webapplicationtechnics_id`), 40 | KEY `users_id_tech` (`users_id_tech`), 41 | KEY `groups_id_tech` (`groups_id_tech`), 42 | KEY `suppliers_id` (`suppliers_id`), 43 | KEY `manufacturers_id` (`manufacturers_id`), 44 | KEY `locations_id` (`locations_id`), 45 | KEY date_mod (date_mod), 46 | KEY is_helpdesk_visible (is_helpdesk_visible), 47 | KEY `is_deleted` (`is_deleted`) 48 | ) 49 | ENGINE = InnoDB 50 | DEFAULT CHARSET = utf8 51 | COLLATE = utf8_unicode_ci; 52 | 53 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplicationtypes`; 54 | CREATE TABLE `glpi_plugin_webapplications_webapplicationtypes` ( 55 | `id` INT(11) NOT NULL AUTO_INCREMENT, 56 | `entities_id` INT(11) NOT NULL DEFAULT '0', 57 | `name` VARCHAR(255) 58 | COLLATE utf8_unicode_ci DEFAULT NULL, 59 | `comment` TEXT COLLATE utf8_unicode_ci, 60 | PRIMARY KEY (`id`), 61 | KEY `name` (`name`), 62 | KEY `entities_id` (`entities_id`) 63 | ) 64 | ENGINE = InnoDB 65 | DEFAULT CHARSET = utf8 66 | COLLATE = utf8_unicode_ci; 67 | 68 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplicationservertypes`; 69 | CREATE TABLE `glpi_plugin_webapplications_webapplicationservertypes` ( 70 | `id` INT(11) NOT NULL AUTO_INCREMENT, 71 | `name` VARCHAR(255) 72 | COLLATE utf8_unicode_ci DEFAULT NULL, 73 | `comment` TEXT COLLATE utf8_unicode_ci, 74 | PRIMARY KEY (`id`), 75 | KEY `name` (`name`) 76 | ) 77 | ENGINE = InnoDB 78 | DEFAULT CHARSET = utf8 79 | COLLATE = utf8_unicode_ci; 80 | 81 | INSERT INTO `glpi_plugin_webapplications_webapplicationservertypes` VALUES ('1', 'Apache', ''); 82 | INSERT INTO `glpi_plugin_webapplications_webapplicationservertypes` VALUES ('2', 'IIS', ''); 83 | INSERT INTO `glpi_plugin_webapplications_webapplicationservertypes` VALUES ('3', 'Tomcat', ''); 84 | 85 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplicationtechnics`; 86 | CREATE TABLE `glpi_plugin_webapplications_webapplicationtechnics` ( 87 | `id` INT(11) NOT NULL AUTO_INCREMENT, 88 | `name` VARCHAR(255) 89 | COLLATE utf8_unicode_ci DEFAULT NULL, 90 | `comment` TEXT COLLATE utf8_unicode_ci, 91 | PRIMARY KEY (`id`), 92 | KEY `name` (`name`) 93 | ) 94 | ENGINE = InnoDB 95 | DEFAULT CHARSET = utf8 96 | COLLATE = utf8_unicode_ci; 97 | 98 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('1', 'Asp', ''); 99 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('2', 'Cgi', ''); 100 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('3', 'Java', ''); 101 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('4', 'Perl', ''); 102 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('5', 'Php', ''); 103 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('6', '.Net', ''); 104 | 105 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplications_items`; 106 | CREATE TABLE `glpi_plugin_webapplications_webapplications_items` ( 107 | `id` INT(11) NOT NULL AUTO_INCREMENT, 108 | `plugin_webapplications_webapplications_id` INT(11) NOT NULL DEFAULT '0' 109 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplications (id)', 110 | `items_id` INT(11) NOT NULL DEFAULT '0' 111 | COMMENT 'RELATION to various tables, according to itemtype (id)', 112 | `itemtype` VARCHAR(100) 113 | COLLATE utf8_unicode_ci NOT NULL 114 | COMMENT 'see .class.php file', 115 | PRIMARY KEY (`id`), 116 | UNIQUE KEY `unicity` (`plugin_webapplications_webapplications_id`, `items_id`, `itemtype`), 117 | KEY `FK_device` (`items_id`, `itemtype`), 118 | KEY `item` (`itemtype`, `items_id`) 119 | ) 120 | ENGINE = InnoDB 121 | DEFAULT CHARSET = utf8 122 | COLLATE = utf8_unicode_ci; 123 | 124 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginWebapplicationsWebapplication', '2', '2', '0'); 125 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginWebapplicationsWebapplication', '3', '4', '0'); 126 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginWebapplicationsWebapplication', '6', '5', '0'); 127 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginWebapplicationsWebapplication', '7', '6', '0'); 128 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginWebapplicationsWebapplication', '8', '7', '0'); -------------------------------------------------------------------------------- /sql/empty-2.6.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplications`; 2 | CREATE TABLE `glpi_plugin_webapplications_webapplications` ( 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 | `address` VARCHAR(255) 9 | COLLATE utf8_unicode_ci DEFAULT NULL, 10 | `backoffice` VARCHAR(255) 11 | COLLATE utf8_unicode_ci DEFAULT NULL, 12 | `plugin_webapplications_webapplicationtypes_id` INT(11) NOT NULL DEFAULT '0' 13 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationtypes (id)', 14 | `plugin_webapplications_webapplicationservertypes_id` INT(11) NOT NULL DEFAULT '0' 15 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationservertypes (id)', 16 | `plugin_webapplications_webapplicationtechnics_id` INT(11) NOT NULL DEFAULT '0' 17 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationtechnics (id)', 18 | `version` VARCHAR(255) 19 | COLLATE utf8_unicode_ci DEFAULT NULL, 20 | `users_id_tech` INT(11) NOT NULL DEFAULT '0' 21 | COMMENT 'RELATION to glpi_users (id)', 22 | `groups_id_tech` INT(11) NOT NULL DEFAULT '0' 23 | COMMENT 'RELATION to glpi_groups (id)', 24 | `suppliers_id` INT(11) NOT NULL DEFAULT '0' 25 | COMMENT 'RELATION to glpi_suppliers (id)', 26 | `manufacturers_id` INT(11) NOT NULL DEFAULT '0' 27 | COMMENT 'RELATION to glpi_manufacturers (id)', 28 | `locations_id` INT(11) NOT NULL DEFAULT '0' 29 | COMMENT 'RELATION to glpi_locations (id)', 30 | `date_mod` DATETIME DEFAULT NULL, 31 | `is_helpdesk_visible` INT(11) NOT NULL DEFAULT '1', 32 | `comment` TEXT COLLATE utf8_unicode_ci, 33 | `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', 34 | PRIMARY KEY (`id`), 35 | KEY `name` (`name`), 36 | KEY `entities_id` (`entities_id`), 37 | KEY `plugin_webapplications_webapplicationtypes_id` (`plugin_webapplications_webapplicationtypes_id`), 38 | KEY `plugin_webapplications_webapplicationservertypes_id` (`plugin_webapplications_webapplicationservertypes_id`), 39 | KEY `plugin_webapplications_webapplicationtechnics_id` (`plugin_webapplications_webapplicationtechnics_id`), 40 | KEY `users_id_tech` (`users_id_tech`), 41 | KEY `groups_id_tech` (`groups_id_tech`), 42 | KEY `suppliers_id` (`suppliers_id`), 43 | KEY `manufacturers_id` (`manufacturers_id`), 44 | KEY `locations_id` (`locations_id`), 45 | KEY date_mod (date_mod), 46 | KEY is_helpdesk_visible (is_helpdesk_visible), 47 | KEY `is_deleted` (`is_deleted`) 48 | ) 49 | ENGINE = InnoDB 50 | DEFAULT CHARSET = utf8 51 | COLLATE = utf8_unicode_ci; 52 | 53 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplicationtypes`; 54 | CREATE TABLE `glpi_plugin_webapplications_webapplicationtypes` ( 55 | `id` INT(11) NOT NULL AUTO_INCREMENT, 56 | `entities_id` INT(11) NOT NULL DEFAULT '0', 57 | `name` VARCHAR(255) 58 | COLLATE utf8_unicode_ci DEFAULT NULL, 59 | `comment` TEXT COLLATE utf8_unicode_ci, 60 | `is_recursive` TINYINT(1) NOT NULL DEFAULT '0', 61 | PRIMARY KEY (`id`), 62 | KEY `name` (`name`), 63 | KEY `entities_id` (`entities_id`) 64 | ) 65 | ENGINE = InnoDB 66 | DEFAULT CHARSET = utf8 67 | COLLATE = utf8_unicode_ci; 68 | 69 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplicationservertypes`; 70 | CREATE TABLE `glpi_plugin_webapplications_webapplicationservertypes` ( 71 | `id` INT(11) NOT NULL AUTO_INCREMENT, 72 | `name` VARCHAR(255) 73 | COLLATE utf8_unicode_ci DEFAULT NULL, 74 | `comment` TEXT COLLATE utf8_unicode_ci, 75 | PRIMARY KEY (`id`), 76 | KEY `name` (`name`) 77 | ) 78 | ENGINE = InnoDB 79 | DEFAULT CHARSET = utf8 80 | COLLATE = utf8_unicode_ci; 81 | 82 | INSERT INTO `glpi_plugin_webapplications_webapplicationservertypes` VALUES ('1', 'Apache', ''); 83 | INSERT INTO `glpi_plugin_webapplications_webapplicationservertypes` VALUES ('2', 'IIS', ''); 84 | INSERT INTO `glpi_plugin_webapplications_webapplicationservertypes` VALUES ('3', 'Tomcat', ''); 85 | 86 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplicationtechnics`; 87 | CREATE TABLE `glpi_plugin_webapplications_webapplicationtechnics` ( 88 | `id` INT(11) NOT NULL AUTO_INCREMENT, 89 | `name` VARCHAR(255) 90 | COLLATE utf8_unicode_ci DEFAULT NULL, 91 | `comment` TEXT COLLATE utf8_unicode_ci, 92 | PRIMARY KEY (`id`), 93 | KEY `name` (`name`) 94 | ) 95 | ENGINE = InnoDB 96 | DEFAULT CHARSET = utf8 97 | COLLATE = utf8_unicode_ci; 98 | 99 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('1', 'Asp', ''); 100 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('2', 'Cgi', ''); 101 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('3', 'Java', ''); 102 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('4', 'Perl', ''); 103 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('5', 'Php', ''); 104 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('6', '.Net', ''); 105 | 106 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplications_items`; 107 | CREATE TABLE `glpi_plugin_webapplications_webapplications_items` ( 108 | `id` INT(11) NOT NULL AUTO_INCREMENT, 109 | `plugin_webapplications_webapplications_id` INT(11) NOT NULL DEFAULT '0' 110 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplications (id)', 111 | `items_id` INT(11) NOT NULL DEFAULT '0' 112 | COMMENT 'RELATION to various tables, according to itemtype (id)', 113 | `itemtype` VARCHAR(100) 114 | COLLATE utf8_unicode_ci NOT NULL 115 | COMMENT 'see .class.php file', 116 | PRIMARY KEY (`id`), 117 | UNIQUE KEY `unicity` (`plugin_webapplications_webapplications_id`, `items_id`, `itemtype`), 118 | KEY `FK_device` (`items_id`, `itemtype`), 119 | KEY `item` (`itemtype`, `items_id`) 120 | ) 121 | ENGINE = InnoDB 122 | DEFAULT CHARSET = utf8 123 | COLLATE = utf8_unicode_ci; 124 | 125 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginWebapplicationsWebapplication', '2', '2', '0'); 126 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginWebapplicationsWebapplication', '3', '4', '0'); 127 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginWebapplicationsWebapplication', '6', '5', '0'); 128 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginWebapplicationsWebapplication', '7', '6', '0'); 129 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginWebapplicationsWebapplication', '8', '7', '0'); -------------------------------------------------------------------------------- /sql/empty-1.6.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplications`; 2 | CREATE TABLE `glpi_plugin_webapplications_webapplications` ( 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 | `address` VARCHAR(255) 9 | COLLATE utf8_unicode_ci DEFAULT NULL, 10 | `backoffice` VARCHAR(255) 11 | COLLATE utf8_unicode_ci DEFAULT NULL, 12 | `plugin_webapplications_webapplicationtypes_id` INT(11) NOT NULL DEFAULT '0' 13 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationtypes (id)', 14 | `plugin_webapplications_webapplicationservertypes_id` INT(11) NOT NULL DEFAULT '0' 15 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationservertypes (id)', 16 | `plugin_webapplications_webapplicationtechnics_id` INT(11) NOT NULL DEFAULT '0' 17 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplicationtechnics (id)', 18 | `version` VARCHAR(255) 19 | COLLATE utf8_unicode_ci DEFAULT NULL, 20 | `users_id` INT(11) NOT NULL DEFAULT '0' 21 | COMMENT 'RELATION to glpi_users (id)', 22 | `groups_id` INT(11) NOT NULL DEFAULT '0' 23 | COMMENT 'RELATION to glpi_groups (id)', 24 | `suppliers_id` INT(11) NOT NULL DEFAULT '0' 25 | COMMENT 'RELATION to glpi_suppliers (id)', 26 | `manufacturers_id` INT(11) NOT NULL DEFAULT '0' 27 | COMMENT 'RELATION to glpi_manufacturers (id)', 28 | `locations_id` INT(11) NOT NULL DEFAULT '0' 29 | COMMENT 'RELATION to glpi_locations (id)', 30 | `date_mod` DATETIME DEFAULT NULL, 31 | `is_helpdesk_visible` INT(11) NOT NULL DEFAULT '1', 32 | `notepad` LONGTEXT COLLATE utf8_unicode_ci, 33 | `comment` TEXT COLLATE utf8_unicode_ci, 34 | `is_deleted` TINYINT(1) NOT NULL DEFAULT '0', 35 | PRIMARY KEY (`id`), 36 | KEY `name` (`name`), 37 | KEY `entities_id` (`entities_id`), 38 | KEY `plugin_webapplications_webapplicationtypes_id` (`plugin_webapplications_webapplicationtypes_id`), 39 | KEY `plugin_webapplications_webapplicationservertypes_id` (`plugin_webapplications_webapplicationservertypes_id`), 40 | KEY `plugin_webapplications_webapplicationtechnics_id` (`plugin_webapplications_webapplicationtechnics_id`), 41 | KEY `users_id` (`users_id`), 42 | KEY `groups_id` (`groups_id`), 43 | KEY `suppliers_id` (`suppliers_id`), 44 | KEY `manufacturers_id` (`manufacturers_id`), 45 | KEY `locations_id` (`locations_id`), 46 | KEY date_mod (date_mod), 47 | KEY is_helpdesk_visible (is_helpdesk_visible), 48 | KEY `is_deleted` (`is_deleted`) 49 | ) 50 | ENGINE = MyISAM 51 | DEFAULT CHARSET = utf8 52 | COLLATE = utf8_unicode_ci; 53 | 54 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplicationtypes`; 55 | CREATE TABLE `glpi_plugin_webapplications_webapplicationtypes` ( 56 | `id` INT(11) NOT NULL AUTO_INCREMENT, 57 | `entities_id` INT(11) NOT NULL DEFAULT '0', 58 | `name` VARCHAR(255) 59 | COLLATE utf8_unicode_ci DEFAULT NULL, 60 | `comment` TEXT COLLATE utf8_unicode_ci, 61 | PRIMARY KEY (`id`), 62 | KEY `name` (`name`), 63 | KEY `entities_id` (`entities_id`) 64 | ) 65 | ENGINE = MyISAM 66 | DEFAULT CHARSET = utf8 67 | COLLATE = utf8_unicode_ci; 68 | 69 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplicationservertypes`; 70 | CREATE TABLE `glpi_plugin_webapplications_webapplicationservertypes` ( 71 | `id` INT(11) NOT NULL AUTO_INCREMENT, 72 | `name` VARCHAR(255) 73 | COLLATE utf8_unicode_ci DEFAULT NULL, 74 | `comment` TEXT COLLATE utf8_unicode_ci, 75 | PRIMARY KEY (`id`), 76 | KEY `name` (`name`) 77 | ) 78 | ENGINE = MyISAM 79 | DEFAULT CHARSET = utf8 80 | COLLATE = utf8_unicode_ci; 81 | 82 | INSERT INTO `glpi_plugin_webapplications_webapplicationservertypes` VALUES ('1', 'Apache', ''); 83 | INSERT INTO `glpi_plugin_webapplications_webapplicationservertypes` VALUES ('2', 'IIS', ''); 84 | INSERT INTO `glpi_plugin_webapplications_webapplicationservertypes` VALUES ('3', 'Tomcat', ''); 85 | 86 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplicationtechnics`; 87 | CREATE TABLE `glpi_plugin_webapplications_webapplicationtechnics` ( 88 | `id` INT(11) NOT NULL AUTO_INCREMENT, 89 | `name` VARCHAR(255) 90 | COLLATE utf8_unicode_ci DEFAULT NULL, 91 | `comment` TEXT COLLATE utf8_unicode_ci, 92 | PRIMARY KEY (`id`), 93 | KEY `name` (`name`) 94 | ) 95 | ENGINE = MyISAM 96 | DEFAULT CHARSET = utf8 97 | COLLATE = utf8_unicode_ci; 98 | 99 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('1', 'Asp', ''); 100 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('2', 'Cgi', ''); 101 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('3', 'Java', ''); 102 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('4', 'Perl', ''); 103 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('5', 'Php', ''); 104 | INSERT INTO `glpi_plugin_webapplications_webapplicationtechnics` VALUES ('6', '.Net', ''); 105 | 106 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_webapplications_items`; 107 | CREATE TABLE `glpi_plugin_webapplications_webapplications_items` ( 108 | `id` INT(11) NOT NULL AUTO_INCREMENT, 109 | `plugin_webapplications_webapplications_id` INT(11) NOT NULL DEFAULT '0' 110 | COMMENT 'RELATION to glpi_plugin_webapplications_webapplications (id)', 111 | `items_id` INT(11) NOT NULL DEFAULT '0' 112 | COMMENT 'RELATION to various tables, according to itemtype (id)', 113 | `itemtype` VARCHAR(100) 114 | COLLATE utf8_unicode_ci NOT NULL 115 | COMMENT 'see .class.php file', 116 | PRIMARY KEY (`id`), 117 | UNIQUE KEY `unicity` (`plugin_webapplications_webapplications_id`, `items_id`, `itemtype`), 118 | KEY `FK_device` (`items_id`, `itemtype`), 119 | KEY `item` (`itemtype`, `items_id`) 120 | ) 121 | ENGINE = MyISAM 122 | DEFAULT CHARSET = utf8 123 | COLLATE = utf8_unicode_ci; 124 | 125 | DROP TABLE IF EXISTS `glpi_plugin_webapplications_profiles`; 126 | CREATE TABLE `glpi_plugin_webapplications_profiles` ( 127 | `id` INT(11) NOT NULL AUTO_INCREMENT, 128 | `profiles_id` INT(11) NOT NULL DEFAULT '0' 129 | COMMENT 'RELATION to glpi_profiles (id)', 130 | `webapplications` CHAR(1) 131 | COLLATE utf8_unicode_ci DEFAULT NULL, 132 | `open_ticket` CHAR(1) 133 | COLLATE utf8_unicode_ci DEFAULT NULL, 134 | PRIMARY KEY (`id`), 135 | KEY `profiles_id` (`profiles_id`) 136 | ) 137 | ENGINE = MyISAM 138 | DEFAULT CHARSET = utf8 139 | COLLATE = utf8_unicode_ci; 140 | 141 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginWebapplicationsWebapplication', '2', '2', '0'); 142 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginWebapplicationsWebapplication', '3', '4', '0'); 143 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginWebapplicationsWebapplication', '6', '5', '0'); 144 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginWebapplicationsWebapplication', '7', '6', '0'); 145 | INSERT INTO `glpi_displaypreferences` VALUES (NULL, 'PluginWebapplicationsWebapplication', '8', '7', '0'); --------------------------------------------------------------------------------