├── locales ├── cs_CZ.mo ├── en_GB.mo ├── es_ES.mo ├── et_EE.mo ├── fr_FR.mo ├── hu_HU.mo ├── it_IT.mo ├── ms_MY.mo ├── pl_PL.mo ├── pt_BR.mo ├── pt_PT.mo ├── ro_RO.mo ├── ru_RU.mo ├── tr_TR.mo ├── glpi.pot ├── et_EE.po ├── pt_BR.po ├── ms_MY.po ├── tr_TR.po ├── it_IT.po ├── pt_PT.po ├── es_EC.po ├── es_ES.po ├── hu_HU.po ├── pl_PL.po ├── en_GB.po ├── fr_FR.po ├── ru_RU.po ├── ro_RO.po └── cs_CZ.po ├── sql ├── update-3.0.3.sql ├── update-3.0.0.sql ├── update-1.5.0.sql ├── update-3.0.2.sql ├── update-1.2.0.sql ├── update-1.8.0.sql ├── update-1.7.1.sql ├── empty-1.7.0.sql ├── empty-1.0.sql ├── empty-1.5.0.sql ├── empty-1.2.0.sql ├── empty-3.0.0.sql ├── empty-1.3.0.sql ├── empty-2.1.2.sql ├── update-1.3.0.sql ├── empty-2.4.0.sql ├── empty-1.7.1.sql ├── empty-1.8.0.sql ├── empty-1.9.0.sql └── empty-2.1.0.sql ├── additionalalerts.png ├── tools ├── extract_template.sh ├── update_mo.pl └── update_po.pl ├── ISSUE_TEMPLATE.md ├── .github └── workflows │ ├── updatepot.yml │ ├── generatemo.yml │ └── release.yml ├── README.md ├── front ├── additionalalert.form.php ├── config.form.php ├── infocomalert.form.php ├── ticketunresolved.form.php └── inkalert.form.php ├── src ├── Menu.php ├── InkThreshold.php ├── InkPrinterState.php ├── NotificationState.php ├── NotificationTargetTicketUnresolved.php ├── NotificationTargetInkAlert.php ├── Config.php ├── NotificationTargetInfocomAlert.php ├── NotificationType.php ├── AdditionalAlert.php ├── Profile.php └── TicketUnresolved.php ├── setup.php └── additionalalerts.xml /locales/cs_CZ.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/additionalalerts/master/locales/cs_CZ.mo -------------------------------------------------------------------------------- /locales/en_GB.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/additionalalerts/master/locales/en_GB.mo -------------------------------------------------------------------------------- /locales/es_ES.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/additionalalerts/master/locales/es_ES.mo -------------------------------------------------------------------------------- /locales/et_EE.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/additionalalerts/master/locales/et_EE.mo -------------------------------------------------------------------------------- /locales/fr_FR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/additionalalerts/master/locales/fr_FR.mo -------------------------------------------------------------------------------- /locales/hu_HU.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/additionalalerts/master/locales/hu_HU.mo -------------------------------------------------------------------------------- /locales/it_IT.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/additionalalerts/master/locales/it_IT.mo -------------------------------------------------------------------------------- /locales/ms_MY.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/additionalalerts/master/locales/ms_MY.mo -------------------------------------------------------------------------------- /locales/pl_PL.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/additionalalerts/master/locales/pl_PL.mo -------------------------------------------------------------------------------- /locales/pt_BR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/additionalalerts/master/locales/pt_BR.mo -------------------------------------------------------------------------------- /locales/pt_PT.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/additionalalerts/master/locales/pt_PT.mo -------------------------------------------------------------------------------- /locales/ro_RO.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/additionalalerts/master/locales/ro_RO.mo -------------------------------------------------------------------------------- /locales/ru_RU.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/additionalalerts/master/locales/ru_RU.mo -------------------------------------------------------------------------------- /locales/tr_TR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/additionalalerts/master/locales/tr_TR.mo -------------------------------------------------------------------------------- /sql/update-3.0.3.sql: -------------------------------------------------------------------------------- 1 | DELETE FROM `glpi_crontasks` WHERE `itemtype` LIKE 'PluginAdditionalalerts%'; 2 | -------------------------------------------------------------------------------- /additionalalerts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/additionalalerts/master/additionalalerts.png -------------------------------------------------------------------------------- /sql/update-3.0.0.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `glpi_plugin_additionalalerts_inkthresholds` CHANGE `cartridges_id` `printers_id` INT UNSIGNED NOT NULL DEFAULT '0'; 2 | -------------------------------------------------------------------------------- /sql/update-1.5.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_reminderalerts`; 2 | ALTER TABLE `glpi_plugin_additionalalerts_configs` DROP `delay_reminder`; -------------------------------------------------------------------------------- /sql/update-3.0.2.sql: -------------------------------------------------------------------------------- 1 | UPDATE `glpi_crontasks` SET `itemtype` = 'GlpiPlugin\\Additionalalerts\\TicketUnresolved' WHERE `itemtype` = 'PluginAdditionalalertsTicketUnresolved'; 2 | UPDATE `glpi_crontasks` SET `itemtype` = 'GlpiPlugin\\Additionalalerts\\InkAlert' WHERE `itemtype` = 'PluginAdditionalalertsInkAlert'; 3 | UPDATE `glpi_crontasks` SET `itemtype` = 'GlpiPlugin\\Additionalalerts\\InfocomAlert' WHERE `itemtype` = 'PluginAdditionalalertsInfocomAlert'; 4 | -------------------------------------------------------------------------------- /tools/extract_template.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Only strings with domain specified are extracted (use Xt args of keyword param to set number of args needed) 4 | 5 | xgettext *.php */*.php --copyright-holder='Additionalalerts Development Team' --package-name='GLPI - Additionalalerts plugin' -o locales/glpi.pot -L PHP --add-comments=TRANS --from-code=UTF-8 --force-po \ 6 | --keyword=_n:1,2,4t --keyword=__s:1,2t --keyword=__:1,2t --keyword=_e:1,2t --keyword=_x:1c,2,3t \ 7 | --keyword=_ex:1c,2,3t --keyword=_nx:1c,2,3,5t --keyword=_sx:1c,2,3t 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Dear GLPi user. 2 | 3 | BEFORE SUBMITTING YOUR ISSUE, please make sure to read and follow these steps : 4 | 5 | * Verify that your question has not already been asked 6 | * Please use the below template. 7 | * Delete this text before submiting your issue. 8 | 9 | The Plugin team. 10 | 11 | ------------ 12 | * Version of the plugin : 13 | 14 | 15 | * Version of your GLPI : 16 | 17 | 18 | * Steps to reproduce (which actions have you made) : 19 | 20 | 21 | * Expected result : 22 | 23 | 24 | * Actual result : 25 | 26 | 27 | * URL of the page : 28 | 29 | 30 | * Screenshot of the problem (if pertinent) : 31 | 32 | -------------------------------------------------------------------------------- /sql/update-1.2.0.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `glpi_plugin_alerting_profiles` DROP COLUMN `interface` , DROP COLUMN `is_default`; 2 | INSERT INTO glpi_plugin_alerting_mailing VALUES ('5','newocs','1','1'); 3 | ALTER TABLE `glpi_plugin_alerting_config` ADD `alerting_new_ocs` SMALLINT( 6 ) NOT NULL AFTER `delay_ocs`; 4 | INSERT INTO glpi_plugin_alerting_mailing VALUES ('6','notinfocom','1','1'); 5 | ALTER TABLE `glpi_plugin_alerting_config` ADD `alerting_not_infocom` SMALLINT( 6 ) NOT NULL AFTER `alerting_new_ocs`; 6 | 7 | CREATE TABLE `glpi_plugin_alerting_type` ( 8 | `ID` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , 9 | `type` INT( 11 ) NOT NULL 10 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -------------------------------------------------------------------------------- /sql/update-1.8.0.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `glpi_plugin_additionalalerts_configs` ADD `delay_ticket_alert` int(11) NOT NULL DEFAULT '0'; 2 | 3 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_ticketunresolveds`; 4 | CREATE TABLE `glpi_plugin_additionalalerts_ticketunresolveds` ( 5 | `id` int(11) NOT NULL auto_increment, 6 | `entities_id` int(11) NOT NULL default '0', 7 | `delay_ticket_alert` int(11) NOT NULL DEFAULT '-1', 8 | PRIMARY KEY (`id`) 9 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 10 | 11 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert Ticket Unresolved', 'PluginAdditionalalertsTicketUnresolved', '2010-03-13 10:44:46','',NULL, '2010-03-13 10:44:46'); 12 | -------------------------------------------------------------------------------- /tools/update_mo.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | #!/usr/bin/perl -w 3 | 4 | if (@ARGV!=0){ 5 | print "USAGE update_mo.pl\n\n"; 6 | 7 | exit(); 8 | } 9 | 10 | 11 | opendir(DIRHANDLE,'locales')||die "ERROR: can not read current directory\n"; 12 | foreach (readdir(DIRHANDLE)){ 13 | if ($_ ne '..' && $_ ne '.'){ 14 | 15 | if(!(-l "$dir/$_")){ 16 | if (index($_,".po",0)==length($_)-3) { 17 | $lang=$_; 18 | $lang=~s/\.po//; 19 | 20 | `msgfmt locales/$_ -o locales/$lang.mo`; 21 | } 22 | } 23 | 24 | } 25 | } 26 | closedir DIRHANDLE; 27 | 28 | # 29 | # 30 | -------------------------------------------------------------------------------- /.github/workflows/updatepot.yml: -------------------------------------------------------------------------------- 1 | name: Update POT 2 | on: 3 | push: 4 | branches: [ master ] 5 | paths-ignore: 6 | - 'locales/**' 7 | 8 | env: 9 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 10 | jobs: 11 | run: 12 | 13 | name: Update POT 14 | 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Checkout repo 18 | uses: actions/checkout@v2 19 | 20 | - name: install xgettext 21 | 22 | run: sudo apt-get install gettext; 23 | - name: Update POT 24 | run: sh tools/extract_template.sh; 25 | 26 | 27 | - name: Commit changes 28 | uses: EndBug/add-and-commit@v5.1.0 29 | with: 30 | message: "Update POT" 31 | - name: Push changes 32 | 33 | uses: actions-go/push@v1 34 | 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # additionalalerts 2 | 3 | Plugin Additionalalerts pour GLPI 4 | 5 | Ce plugin est sur Transifex - Aidez-nous à le traduire : 6 | https://www.transifex.com/infotelGLPI/GLPI_additionalalerts/ 7 | 8 | This plugin is on Transifex - Help us to translate : 9 | https://www.transifex.com/infotelGLPI/GLPI_additionalalerts/ 10 | 11 | ### Français 12 | 13 | Ce plugin vous permet d'envoyer les alertes email supplémentaires 14 | * Matériels ayant une date d'achat vide (Choix des types pris en charge : pour ne pas prendre en compte les matériels non achetés), 15 | * Niveaux des cartouches bas (information provenant de Fusion Inventory). 16 | 17 | ### English 18 | 19 | This plugin enables you to send email supplementary alerts 20 | * Items with empty buy date (Choice of supported types : for not taking into account the equipment not purchased), 21 | * Cartridges whose level is low (fusion Inventory information) 22 | -------------------------------------------------------------------------------- /tools/update_po.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | #!/usr/bin/perl -w 3 | 4 | if (@ARGV!=2){ 5 | print "USAGE update_po.pl transifex_login transifex_password\n\n"; 6 | 7 | exit(); 8 | } 9 | $user = $ARGV[0]; 10 | $password = $ARGV[1]; 11 | 12 | opendir(DIRHANDLE,'locales')||die "ERROR: can not read current directory\n"; 13 | foreach (readdir(DIRHANDLE)){ 14 | if ($_ ne '..' && $_ ne '.'){ 15 | 16 | if(!(-l "$dir/$_")){ 17 | if (index($_,".po",0)==length($_)-3) { 18 | $lang=$_; 19 | $lang=~s/\.po//; 20 | 21 | `wget --user=$user --password=$password --output-document=locales/$_ http://www.transifex.com/api/2/project/GLPI_additionalalerts/resource/glpi/translation/$lang/?file=$_`; 22 | } 23 | } 24 | 25 | } 26 | } 27 | closedir DIRHANDLE; 28 | 29 | # 30 | # 31 | -------------------------------------------------------------------------------- /.github/workflows/generatemo.yml: -------------------------------------------------------------------------------- 1 | name: Generate MO 2 | on: 3 | push: 4 | branches: [ master ] 5 | paths: 6 | - '**.po' 7 | env: 8 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 9 | jobs: 10 | run: 11 | 12 | name: Generate mo 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout repo 16 | uses: actions/checkout@v2 17 | 18 | - name: Setup Perl environment 19 | # You may pin to the exact commit or the version. 20 | # uses: shogo82148/actions-setup-perl@8d2e3d59a9516b785ed32169d48a4888eaa9b514 21 | uses: shogo82148/actions-setup-perl@v1.7.2 22 | - name: msgfmt 23 | # You may pin to the exact commit or the version. 24 | # uses: whtsky/msgfmt-action@6b2181f051b002182d01a1e1f1aff216230c5a4d 25 | uses: whtsky/msgfmt-action@20190305 26 | - name: Generate mo 27 | run: perl tools/update_mo.pl; 28 | 29 | - name: Commit changes 30 | uses: EndBug/add-and-commit@v5.1.0 31 | with: 32 | 33 | message: "Generate mo" 34 | - name: Push changes 35 | 36 | uses: actions-go/push@v1 37 | 38 | -------------------------------------------------------------------------------- /sql/update-1.7.1.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `glpi_plugin_additionalalerts_configs` ADD `use_ink_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1'; 2 | 3 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkalerts`; 4 | CREATE TABLE `glpi_plugin_additionalalerts_inkalerts` ( 5 | `id` int(11) NOT NULL auto_increment, 6 | `entities_id` int(11) NOT NULL default '0', 7 | `use_ink_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 8 | PRIMARY KEY (`id`) 9 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 10 | 11 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkthresholds`; 12 | CREATE TABLE `glpi_plugin_additionalalerts_inkthresholds` ( 13 | `id` int(11) NOT NULL AUTO_INCREMENT, 14 | `cartridges_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_cartridgeitems (id)', 15 | `threshold` int(3) NOT NULL default '10', 16 | PRIMARY KEY (`id`) 17 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 18 | 19 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkprinterstates`; 20 | CREATE TABLE `glpi_plugin_additionalalerts_inkprinterstates` ( 21 | `id` INT( 11 ) NOT NULL AUTO_INCREMENT, 22 | `states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)', 23 | PRIMARY KEY (`id`) 24 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 25 | 26 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert ink level', 'PluginAdditionalalertsInkAlert', '2010-03-13 10:44:46','',NULL, '2010-03-13 10:44:46'); -------------------------------------------------------------------------------- /front/additionalalert.form.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | use Glpi\Exception\Http\AccessDeniedHttpException; 31 | use GlpiPlugin\Additionalalerts\AdditionalAlert; 32 | use GlpiPlugin\Additionalalerts\Menu; 33 | 34 | 35 | Html::header(AdditionalAlert::getTypeName(2), '', "admin", Menu::class); 36 | 37 | $alert = new AdditionalAlert(); 38 | if (Session::haveRight("plugin_additionalalerts", READ) 39 | || Session::haveRight("config", CREATE)) { 40 | 41 | AdditionalAlert::displayAlerts(); 42 | 43 | } else { 44 | throw new AccessDeniedHttpException(); 45 | } 46 | 47 | Html::footer(); 48 | -------------------------------------------------------------------------------- /front/config.form.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | use GlpiPlugin\Additionalalerts\AdditionalAlert; 31 | use GlpiPlugin\Additionalalerts\Config; 32 | use GlpiPlugin\Additionalalerts\Menu; 33 | 34 | if (Plugin::isPluginActive("additionalalerts")) { 35 | 36 | $config = new Config(); 37 | if (isset($_POST["update"])) { 38 | $config->update($_POST); 39 | Html::back(); 40 | } else { 41 | Html::header(AdditionalAlert::getTypeName(2), '', "admin", Menu::class); 42 | $config = new Config(); 43 | $config->showConfigForm(); 44 | Html::footer(); 45 | } 46 | } else { 47 | Html::header(__('Setup'), '', "config", "plugins"); 48 | echo "
"; 49 | echo "" . __('Please activate the plugin', 'additionalalerts') . "
"; 50 | Html::footer(); 51 | } 52 | -------------------------------------------------------------------------------- /front/infocomalert.form.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | use GlpiPlugin\Additionalalerts\InfocomAlert; 31 | use GlpiPlugin\Additionalalerts\NotificationType; 32 | 33 | $type = new NotificationType(); 34 | $infocom = new InfocomAlert(); 35 | 36 | if (isset($_POST["add"])) { 37 | 38 | if ($infocom->canUpdate()) { 39 | $newID = $infocom->add($_POST); 40 | } 41 | Html::back(); 42 | 43 | } else if (isset($_POST["update"])) { 44 | 45 | if ($infocom->canUpdate()) { 46 | $infocom->update($_POST); 47 | } 48 | Html::back(); 49 | 50 | } else if (isset($_POST["add_type"])) { 51 | 52 | if ($infocom->canUpdate()) { 53 | $newID = $type->add($_POST); 54 | } 55 | Html::back(); 56 | 57 | } else if (isset($_POST["delete_type"])) { 58 | 59 | if ($infocom->canUpdate()) { 60 | $type->getFromDB($_POST["id"]); 61 | foreach ($_POST["item"] as $key => $val) { 62 | if ($val == 1) { 63 | $type->delete(['id' => $key]); 64 | } 65 | } 66 | } 67 | Html::back(); 68 | 69 | } 70 | -------------------------------------------------------------------------------- /front/ticketunresolved.form.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | 31 | use GlpiPlugin\Additionalalerts\NotificationType; 32 | use GlpiPlugin\Additionalalerts\TicketUnresolved; 33 | 34 | $type = new NotificationType(); 35 | $ticket = new TicketUnresolved(); 36 | 37 | if (isset($_POST["add"])) { 38 | 39 | if ($ticket->canUpdate()) { 40 | $newID = $ticket->add($_POST); 41 | } 42 | Html::back(); 43 | 44 | } else if (isset($_POST["update"])) { 45 | 46 | if ($ticket->canUpdate()) { 47 | $ticket->update($_POST); 48 | } 49 | Html::back(); 50 | 51 | } else if (isset($_POST["add_type"])) { 52 | 53 | if ($ticket->canUpdate()) { 54 | $newID = $type->add($_POST); 55 | } 56 | Html::back(); 57 | 58 | } else if (isset($_POST["delete_type"])) { 59 | 60 | if ($ticket->canUpdate()) { 61 | $type->getFromDB($_POST["id"]); 62 | foreach ($_POST["item"] as $key => $val) { 63 | if ($val == 1) { 64 | $type->delete(['id' => $key]); 65 | } 66 | } 67 | } 68 | Html::back(); 69 | 70 | } 71 | -------------------------------------------------------------------------------- /sql/empty-1.7.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_configs`; 2 | CREATE TABLE `glpi_plugin_additionalalerts_configs` ( 3 | `id` int(11) NOT NULL auto_increment, 4 | `delay_ocs` int(11) NOT NULL default '-1', 5 | `use_infocom_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 6 | `use_newocs_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 7 | PRIMARY KEY (`id`) 8 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 9 | 10 | INSERT INTO `glpi_plugin_additionalalerts_configs` ( `id`,`delay_ocs`,`use_infocom_alert`,`use_newocs_alert`) VALUES ('1','-1','-1','-1'); 11 | 12 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_ocsalerts`; 13 | CREATE TABLE `glpi_plugin_additionalalerts_ocsalerts` ( 14 | `id` int(11) NOT NULL auto_increment, 15 | `entities_id` int(11) NOT NULL default '0', 16 | `delay_ocs` int(11) NOT NULL default '-1', 17 | `use_newocs_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 18 | PRIMARY KEY (`id`) 19 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 20 | 21 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_infocomalerts`; 22 | CREATE TABLE `glpi_plugin_additionalalerts_infocomalerts` ( 23 | `id` int(11) NOT NULL auto_increment, 24 | `entities_id` int(11) NOT NULL default '0', 25 | `use_infocom_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 26 | PRIMARY KEY (`id`) 27 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 28 | 29 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_notificationstates`; 30 | CREATE TABLE `glpi_plugin_additionalalerts_notificationstates` ( 31 | `id` int(11) NOT NULL auto_increment, 32 | `states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)', 33 | PRIMARY KEY (`id`) 34 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 35 | 36 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_notificationtypes`; 37 | CREATE TABLE `glpi_plugin_additionalalerts_notificationtypes` ( 38 | `id` INT( 11 ) NOT NULL AUTO_INCREMENT , 39 | `types_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_computertypes (id)', 40 | PRIMARY KEY (`id`) 41 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 42 | 43 | 44 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert infocoms', 'PluginAdditionalalertsInfocomAlert', '2010-03-13 10:44:46','',NULL); 45 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert machines ocs', 'PluginAdditionalalertsOcsAlert', '2010-03-13 10:44:46','',NULL); -------------------------------------------------------------------------------- /front/inkalert.form.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | use Glpi\Exception\Http\AccessDeniedHttpException; 31 | use GlpiPlugin\Additionalalerts\InkAlert; 32 | use GlpiPlugin\Additionalalerts\InkPrinterState; 33 | use GlpiPlugin\Additionalalerts\InkThreshold; 34 | 35 | 36 | $state = new InkPrinterState(); 37 | $alert = new InkAlert(); 38 | 39 | if (isset($_POST["add"])) { 40 | if ($alert->canUpdate()) { 41 | $newID = $alert->add($_POST); 42 | } 43 | } else if (isset($_POST["update"])) { 44 | if ($alert->canUpdate()) { 45 | $alert->update($_POST); 46 | } 47 | } else if (isset($_POST["add_state"])) { 48 | if ($alert->canUpdate()) { 49 | $newID = $state->add($_POST); 50 | } 51 | } else if (isset($_POST["delete_state"])) { 52 | if ($alert->canUpdate()) { 53 | $state->getFromDB($_POST["id"]); 54 | 55 | foreach ($_POST["item"] as $key => $val) { 56 | if ($val == 1) { 57 | $state->delete(['id' => $key]); 58 | } 59 | } 60 | } 61 | 62 | } else if (isset($_POST["update_threshold"])) { 63 | 64 | $InkThreshold = new InkThreshold(); 65 | if ($alert->canUpdate()) { 66 | $InkThreshold->update($_POST); 67 | } else { 68 | throw new AccessDeniedHttpException(); 69 | 70 | } 71 | } 72 | Html::back(); 73 | -------------------------------------------------------------------------------- /sql/empty-1.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_alerting_config`; 2 | CREATE TABLE `glpi_plugin_alerting_config` ( 3 | `ID` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , 4 | `alerting_tickets` smallint(6) NOT NULL default '0', 5 | `delay_tickets` int(11) NOT NULL default '30', 6 | `alerting_reservations` smallint(6) NOT NULL default '0', 7 | `delay_reminder` int(11) NOT NULL default '5', 8 | `alerting_reminder` smallint(6) NOT NULL default '0', 9 | `delay_reservations` int(11) NOT NULL default '5', 10 | `alerting_ocs` smallint(6) NOT NULL default '0', 11 | `delay_ocs` int(11) NOT NULL default '90' 12 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 13 | 14 | INSERT INTO `glpi_plugin_alerting_config` ( `ID`, `alerting_tickets`, `delay_tickets`,`alerting_reservations`,`delay_reservations`,`alerting_reminder`,`delay_reminder`,`alerting_ocs`, `delay_ocs`) VALUES ('1','0','30','0','5','0','5','0','90'); 15 | 16 | DROP TABLE IF EXISTS `glpi_plugin_alerting_state`; 17 | CREATE TABLE `glpi_plugin_alerting_state` ( 18 | `ID` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , 19 | `state` INT( 11 ) NOT NULL 20 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 21 | 22 | DROP TABLE IF EXISTS `glpi_plugin_alerting_profiles`; 23 | CREATE TABLE `glpi_plugin_alerting_profiles` ( 24 | `ID` int(11) NOT NULL auto_increment, 25 | `name` varchar(255) default NULL, 26 | `interface` varchar(50) NOT NULL default 'alerting', 27 | `is_default` smallint(6) NOT NULL default '0', 28 | `alerting` char(1) default NULL, 29 | PRIMARY KEY (`ID`), 30 | KEY `interface` (`interface`) 31 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 32 | 33 | DROP TABLE IF EXISTS `glpi_plugin_alerting_mailing`; 34 | CREATE TABLE `glpi_plugin_alerting_mailing` ( 35 | `ID` int(11) NOT NULL auto_increment, 36 | `type` varchar(255) collate utf8_unicode_ci default NULL, 37 | `FK_item` int(11) NOT NULL default '0', 38 | `item_type` int(11) NOT NULL default '0', 39 | PRIMARY KEY (`ID`), 40 | UNIQUE KEY `mailings` (`type`,`FK_item`,`item_type`), 41 | KEY `type` (`type`), 42 | KEY `FK_item` (`FK_item`), 43 | KEY `item_type` (`item_type`), 44 | KEY `items` (`item_type`,`FK_item`) 45 | ) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 46 | 47 | INSERT INTO glpi_plugin_alerting_mailing VALUES ('1','tickets','1','1'); 48 | INSERT INTO glpi_plugin_alerting_mailing VALUES ('2','ocs','1','1'); 49 | INSERT INTO glpi_plugin_alerting_mailing VALUES ('3','reservations','1','1'); 50 | INSERT INTO glpi_plugin_alerting_mailing VALUES ('4','reminder','1','1'); -------------------------------------------------------------------------------- /src/Menu.php: -------------------------------------------------------------------------------- 1 | . 28 | -------------------------------------------------------------------------- 29 | */ 30 | 31 | namespace GlpiPlugin\Additionalalerts; 32 | 33 | use CommonGLPI; 34 | 35 | /** 36 | * Class Menu 37 | */ 38 | class Menu extends CommonGLPI { 39 | static $rightname = 'plugin_additionalalerts'; 40 | 41 | /** 42 | * @return string 43 | */ 44 | static function getMenuName() { 45 | return _n('Other alert', 'Others alerts', 2, 'additionalalerts'); 46 | } 47 | 48 | /** 49 | * @return array 50 | */ 51 | static function getMenuContent() { 52 | 53 | $menu = []; 54 | $menu['title'] = self::getMenuName(); 55 | $menu['page'] = PLUGIN_ADDITIONALALERTS_WEBDIR."/front/additionalalert.form.php"; 56 | $menu['links']['search'] = AdditionalAlert::getFormURL(false); 57 | 58 | $menu['links']['config'] = PLUGIN_ADDITIONALALERTS_WEBDIR.'/front/config.form.php'; 59 | $menu['icon'] = self::getIcon(); 60 | return $menu; 61 | } 62 | 63 | static function getIcon() { 64 | return "ti ti-bell-ringing"; 65 | } 66 | 67 | static function removeRightsFromSession() { 68 | if (isset($_SESSION['glpimenu']['admin']['types'][Menu::class])) { 69 | unset($_SESSION['glpimenu']['admin']['types'][Menu::class]); 70 | } 71 | if (isset($_SESSION['glpimenu']['admin']['content'][Menu::class])) { 72 | unset($_SESSION['glpimenu']['admin']['content'][Menu::class]); 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /locales/glpi.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Additionalalerts Development Team 3 | # This file is distributed under the same license as the GLPI - Additionalalerts plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: GLPI - Additionalalerts plugin\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2025-12-05 11:18+0000\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "Language: \n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=CHARSET\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 20 | 21 | #: setup.php:96 src/AdditionalAlert.php:58 src/Menu.php:45 src/Profile.php:116 22 | msgid "Other alert" 23 | msgid_plural "Others alerts" 24 | msgstr[0] "" 25 | msgstr[1] "" 26 | 27 | #: front/config.form.php:49 28 | msgid "Please activate the plugin" 29 | msgstr "" 30 | 31 | #: src/AdditionalAlert.php:120 32 | msgid "No used alerts" 33 | msgstr "" 34 | 35 | #: src/AdditionalAlert.php:149 36 | msgid "No computers with no buy date" 37 | msgstr "" 38 | 39 | #: src/AdditionalAlert.php:167 src/Config.php:135 src/InkAlert.php:68 40 | #: src/InkAlert.php:125 src/InkAlert.php:305 src/InkAlert.php:376 41 | #: src/NotificationTargetInkAlert.php:54 src/NotificationTargetInkAlert.php:124 42 | msgid "Cartridges whose level is low" 43 | msgstr "" 44 | 45 | #: src/AdditionalAlert.php:174 46 | msgid "Ink level" 47 | msgstr "" 48 | 49 | #: src/AdditionalAlert.php:181 50 | msgid "No cartridge is below the threshold" 51 | msgstr "" 52 | 53 | #: src/AdditionalAlert.php:197 54 | msgid "Tickets unresolved since more" 55 | msgstr "" 56 | 57 | #: src/AdditionalAlert.php:213 58 | msgid "No tickets unresolved since more" 59 | msgstr "" 60 | 61 | #: src/Config.php:56 src/InfocomAlert.php:84 src/InkAlert.php:86 62 | msgid "Plugin setup" 63 | msgstr "" 64 | 65 | #: src/Config.php:141 66 | msgid "Unresolved Ticket Alerts" 67 | msgstr "" 68 | 69 | #: src/InfocomAlert.php:66 70 | msgid "Computer with no buy date" 71 | msgid_plural "Computers with no buy date" 72 | msgstr[0] "" 73 | msgstr[1] "" 74 | 75 | #: src/InkPrinterState.php:59 src/NotificationType.php:64 76 | msgid "Parameter" 77 | msgstr "" 78 | 79 | #: src/InkPrinterState.php:60 80 | msgid "Statutes used for the ink level" 81 | msgstr "" 82 | 83 | #: src/InkThreshold.php:62 src/InkThreshold.php:64 84 | msgid "Ink level alerts" 85 | msgstr "" 86 | 87 | #: src/NotificationType.php:65 88 | msgid "Type not used for check of buy date" 89 | msgstr "" 90 | 91 | #: src/TicketUnresolved.php:65 92 | msgid "Ticket unresolved" 93 | msgid_plural "Tickets unresolved" 94 | msgstr[0] "" 95 | msgstr[1] "" 96 | -------------------------------------------------------------------------------- /sql/empty-1.5.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_configs`; 2 | CREATE TABLE `glpi_plugin_additionalalerts_configs` ( 3 | `id` int(11) NOT NULL auto_increment, 4 | `delay_ocs` int(11) NOT NULL default '-1', 5 | `use_infocom_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 6 | `use_newocs_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 7 | PRIMARY KEY (`id`) 8 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 9 | 10 | INSERT INTO `glpi_plugin_additionalalerts_configs` ( `id`,`delay_ocs`,`use_infocom_alert`,`use_newocs_alert`) VALUES ('1','-1','-1','-1'); 11 | 12 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_ocsalerts`; 13 | CREATE TABLE `glpi_plugin_additionalalerts_ocsalerts` ( 14 | `id` int(11) NOT NULL auto_increment, 15 | `entities_id` int(11) NOT NULL default '0', 16 | `delay_ocs` int(11) NOT NULL default '-1', 17 | `use_newocs_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 18 | PRIMARY KEY (`id`) 19 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 20 | 21 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_infocomalerts`; 22 | CREATE TABLE `glpi_plugin_additionalalerts_infocomalerts` ( 23 | `id` int(11) NOT NULL auto_increment, 24 | `entities_id` int(11) NOT NULL default '0', 25 | `use_infocom_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 26 | PRIMARY KEY (`id`) 27 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 28 | 29 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_notificationstates`; 30 | CREATE TABLE `glpi_plugin_additionalalerts_notificationstates` ( 31 | `id` int(11) NOT NULL auto_increment, 32 | `states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)', 33 | PRIMARY KEY (`id`) 34 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 35 | 36 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_notificationtypes`; 37 | CREATE TABLE `glpi_plugin_additionalalerts_notificationtypes` ( 38 | `id` INT( 11 ) NOT NULL AUTO_INCREMENT , 39 | `types_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_computertypes (id)', 40 | PRIMARY KEY (`id`) 41 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 42 | 43 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_profiles`; 44 | CREATE TABLE `glpi_plugin_additionalalerts_profiles` ( 45 | `id` int(11) NOT NULL auto_increment, 46 | `profiles_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_profiles (id)', 47 | `additionalalerts` char(1) collate utf8_unicode_ci default NULL, 48 | PRIMARY KEY (`id`), 49 | KEY `profiles_id` (`profiles_id`) 50 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 51 | 52 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert infocoms', 'PluginAdditionalalertsInfocomAlert', '2010-03-13 10:44:46','',NULL); 53 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert machines ocs', 'PluginAdditionalalertsOcsAlert', '2010-03-13 10:44:46','',NULL); -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | 2 | on: 3 | push: 4 | # Sequence of patterns matched against refs/tags 5 | tags: 6 | - '*.*.*' # Push events to matching ex:20.15.10 7 | 8 | name: Create release with tag 9 | env: 10 | TAG_VALUE: ${GITHUB_REF/refs\/tags\//} 11 | jobs: 12 | build: 13 | name: Upload Release Asset 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Checkout code 17 | uses: actions/checkout@v2 18 | - name: Build project # This would actually build your project, using zip for an example artifact 19 | id: build_ 20 | env: 21 | GITHUB_NAME: ${{ github.event.repository.name }} 22 | 23 | 24 | run: sudo apt-get install libxml-xpath-perl;echo $(xpath -e '/root/versions/version[num="'${GITHUB_REF/refs\/tags\//}'"]/compatibility/text()' $GITHUB_NAME.xml);echo ::set-output name=version_glpi::$(xpath -e '/root/versions/version[num="'${GITHUB_REF/refs\/tags\//}'"]/compatibility/text()' $GITHUB_NAME.xml); rm -rf $GITHUB_NAME.xml tools wiki screenshots test .git .github ISSUE_TEMPLATE.md TODO.txt $GITHUB_NAME.png;cd ..; tar jcvf glpi-$GITHUB_NAME-${GITHUB_REF/refs\/tags\//}.tar.bz2 $GITHUB_NAME;ls -al;echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//};echo ${{ steps.getxml.outputs.info }}; 25 | # run: rm -rf $GITHUB_NAME.xml tools wiki screenshots test ISSUE_TEMPLATE.md TODO.txt $GITHUB_NAME.png; tar -zcvf glpi-$GITHUB_NAME-$GITHUB_TAG.tar.gz $GITHUB_NAME 26 | - name: Create Release 27 | id: create_release 28 | uses: actions/create-release@v1 29 | env: 30 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 31 | with: 32 | tag_name: ${{ github.ref }} 33 | release_name: | 34 | GLPI ${{ steps.build_.outputs.version_glpi }} : Version ${{ github.ref }} disponible / available 35 | body : Version ${{ steps.build_.outputs.tag }} released for GLPI ${{ steps.build_.outputs.version_glpi }} 36 | draft: false 37 | prerelease: true 38 | - name: Upload Release Asset 39 | id: upload-release-asset 40 | uses: actions/upload-release-asset@v1 41 | env: 42 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 43 | GITHUB_NAME: ${{ github.event.repository.name }} 44 | with: 45 | upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps 46 | asset_path: /home/runner/work/${{ github.event.repository.name }}/glpi-${{ github.event.repository.name }}-${{ steps.build_.outputs.tag }}.tar.bz2 47 | asset_name: glpi-${{ github.event.repository.name }}-${{ steps.build_.outputs.tag }}.tar.bz2 48 | asset_content_type: application/zip 49 | 50 | -------------------------------------------------------------------------------- /src/InkThreshold.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | namespace GlpiPlugin\Additionalalerts; 31 | 32 | use CommonDBTM; 33 | use Html; 34 | 35 | if (!defined('GLPI_ROOT')) { 36 | die("Sorry. You can't access directly to this file"); 37 | } 38 | 39 | /** 40 | * Class InkThreshold 41 | */ 42 | class InkThreshold extends CommonDBTM 43 | { 44 | /** 45 | * @param $target 46 | * @param $id 47 | */ 48 | function showSetupForm($target, $id) 49 | { 50 | 51 | $threshold = new InkThreshold(); 52 | $inkthresholds = $threshold->find(["printers_id" => $id]); 53 | 54 | if (count($inkthresholds) == 0) { 55 | $this->add(["printers_id" => $id]); 56 | } 57 | $threshold = new InkThreshold(); 58 | $threshold->getFromDBByCrit(["printers_id" => $id]); 59 | 60 | echo "
"; 61 | echo ""; 62 | echo ""; 63 | echo ""; 64 | echo ""; 65 | echo ""; 69 | echo ""; 70 | 71 | echo ""; 72 | echo ""; 75 | echo ""; 76 | 77 | echo "
" . __('Ink level alerts', 'additionalalerts') . "
" . __('Ink level alerts', 'additionalalerts') . ""; 66 | echo Html::input('threshold', ['value' => $threshold->fields["threshold"], 'size' => 3]); 67 | echo " %"; 68 | echo "
"; 73 | echo Html::submit(_sx('button', 'Save'), ['name' => 'update_threshold', 'class' => 'btn btn-primary']); 74 | echo "
"; 78 | echo Html::hidden('id', ['value' => $threshold->fields["id"]]); 79 | Html::closeForm(); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /sql/empty-1.2.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_alerting_config`; 2 | CREATE TABLE `glpi_plugin_alerting_config` ( 3 | `ID` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , 4 | `alerting_tickets` smallint(6) NOT NULL default '0', 5 | `delay_tickets` int(11) NOT NULL default '30', 6 | `alerting_reservations` smallint(6) NOT NULL default '0', 7 | `delay_reminder` int(11) NOT NULL default '5', 8 | `alerting_reminder` smallint(6) NOT NULL default '0', 9 | `delay_reservations` int(11) NOT NULL default '5', 10 | `alerting_ocs` smallint(6) NOT NULL default '0', 11 | `delay_ocs` int(11) NOT NULL default '90', 12 | `alerting_new_ocs` SMALLINT( 6 ) NOT NULL default '0', 13 | `alerting_not_infocom` SMALLINT( 6 ) NOT NULL 14 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 15 | 16 | INSERT INTO `glpi_plugin_alerting_config` ( `ID`, `alerting_tickets`, `delay_tickets`,`alerting_reservations`,`delay_reservations`,`alerting_reminder`,`delay_reminder`,`alerting_ocs`, `delay_ocs`,`alerting_new_ocs`,`alerting_not_infocom`) VALUES ('1','0','30','0','5','0','5','0','90','0','0'); 17 | 18 | DROP TABLE IF EXISTS `glpi_plugin_alerting_state`; 19 | CREATE TABLE `glpi_plugin_alerting_state` ( 20 | `ID` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , 21 | `state` INT( 11 ) NOT NULL 22 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 23 | 24 | DROP TABLE IF EXISTS `glpi_plugin_alerting_type`; 25 | CREATE TABLE `glpi_plugin_alerting_type` ( 26 | `ID` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , 27 | `type` INT( 11 ) NOT NULL 28 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 29 | 30 | DROP TABLE IF EXISTS `glpi_plugin_alerting_profiles`; 31 | CREATE TABLE `glpi_plugin_alerting_profiles` ( 32 | `ID` int(11) NOT NULL auto_increment, 33 | `name` varchar(255) default NULL, 34 | `alerting` char(1) default NULL, 35 | PRIMARY KEY (`ID`), 36 | KEY `name` (`name`) 37 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 38 | 39 | DROP TABLE IF EXISTS `glpi_plugin_alerting_mailing`; 40 | CREATE TABLE `glpi_plugin_alerting_mailing` ( 41 | `ID` int(11) NOT NULL auto_increment, 42 | `type` varchar(255) collate utf8_unicode_ci default NULL, 43 | `FK_item` int(11) NOT NULL default '0', 44 | `item_type` int(11) NOT NULL default '0', 45 | PRIMARY KEY (`ID`), 46 | UNIQUE KEY `mailings` (`type`,`FK_item`,`item_type`), 47 | KEY `type` (`type`), 48 | KEY `FK_item` (`FK_item`), 49 | KEY `item_type` (`item_type`), 50 | KEY `items` (`item_type`,`FK_item`) 51 | ) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 52 | 53 | INSERT INTO glpi_plugin_alerting_mailing VALUES ('1','tickets','1','1'); 54 | INSERT INTO glpi_plugin_alerting_mailing VALUES ('2','ocs','1','1'); 55 | INSERT INTO glpi_plugin_alerting_mailing VALUES ('3','reservations','1','1'); 56 | INSERT INTO glpi_plugin_alerting_mailing VALUES ('4','reminder','1','1'); 57 | INSERT INTO glpi_plugin_alerting_mailing VALUES ('5','newocs','1','1'); 58 | INSERT INTO glpi_plugin_alerting_mailing VALUES ('6','notinfocom','1','1'); -------------------------------------------------------------------------------- /sql/empty-3.0.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_configs`; 2 | CREATE TABLE `glpi_plugin_additionalalerts_configs` ( 3 | `id` int unsigned NOT NULL auto_increment, 4 | `use_infocom_alert` tinyint NOT NULL DEFAULT '0', 5 | `use_ink_alert` tinyint NOT NULL DEFAULT '0', 6 | `delay_ticket_alert` int unsigned NOT NULL default '0', 7 | PRIMARY KEY (`id`) 8 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 9 | 10 | INSERT INTO `glpi_plugin_additionalalerts_configs` ( `id`, `use_infocom_alert`, `use_ink_alert`, `delay_ticket_alert`) 11 | VALUES ('1','0','0','0'); 12 | 13 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_infocomalerts`; 14 | CREATE TABLE `glpi_plugin_additionalalerts_infocomalerts` ( 15 | `id` int unsigned NOT NULL auto_increment, 16 | `entities_id` int unsigned NOT NULL default '0', 17 | `use_infocom_alert` tinyint NOT NULL DEFAULT '0', 18 | PRIMARY KEY (`id`) 19 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 20 | 21 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_ticketunresolveds`; 22 | CREATE TABLE `glpi_plugin_additionalalerts_ticketunresolveds` ( 23 | `id` int unsigned NOT NULL auto_increment, 24 | `entities_id` int unsigned NOT NULL default '0', 25 | `delay_ticket_alert` int unsigned NOT NULL DEFAULT '0', 26 | PRIMARY KEY (`id`) 27 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 28 | 29 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkalerts`; 30 | CREATE TABLE `glpi_plugin_additionalalerts_inkalerts` ( 31 | `id` int unsigned NOT NULL auto_increment, 32 | `entities_id` int unsigned NOT NULL default '0', 33 | `use_ink_alert` tinyint NOT NULL DEFAULT '0', 34 | PRIMARY KEY (`id`) 35 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 36 | 37 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_notificationtypes`; 38 | CREATE TABLE `glpi_plugin_additionalalerts_notificationtypes` ( 39 | `id` int unsigned NOT NULL AUTO_INCREMENT , 40 | `types_id` int unsigned NOT NULL default '0' COMMENT 'RELATION to glpi_computertypes (id)', 41 | PRIMARY KEY (`id`) 42 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 43 | 44 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkthresholds`; 45 | CREATE TABLE `glpi_plugin_additionalalerts_inkthresholds` ( 46 | `id` int unsigned NOT NULL AUTO_INCREMENT, 47 | `printers_id` int unsigned NOT NULL default '0', 48 | `threshold` int unsigned NOT NULL default '10', 49 | PRIMARY KEY (`id`) 50 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 51 | 52 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkprinterstates`; 53 | CREATE TABLE `glpi_plugin_additionalalerts_inkprinterstates` ( 54 | `id` int unsigned NOT NULL AUTO_INCREMENT, 55 | `states_id` int unsigned NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)', 56 | PRIMARY KEY (`id`) 57 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 58 | -------------------------------------------------------------------------------- /locales/et_EE.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Additionalalerts Development Team 3 | # This file is distributed under the same license as the GLPI - Additionalalerts plugin package. 4 | # 5 | # Translators: 6 | # pexy , 2014 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: GLPI Project - additionalalerts plugin\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2018-10-11 12:28+0200\n" 12 | "PO-Revision-Date: 2018-10-11 10:30+0000\n" 13 | "Last-Translator: Amandine Manceau\n" 14 | "Language-Team: Estonian (Estonia) (http://www.transifex.com/tsmr/GLPI_additionalalerts/language/et_EE/)\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Language: et_EE\n" 19 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 20 | 21 | #: setup.php:74 inc/additionalalert.class.php:48 inc/menu.class.php:41 22 | #: inc/profile.class.php:92 23 | msgid "Other alert" 24 | msgid_plural "Others alerts" 25 | msgstr[0] "Muu teavitus" 26 | msgstr[1] "Muud teavitused" 27 | 28 | #: front/config.form.php:49 29 | msgid "Please activate the plugin" 30 | msgstr "" 31 | 32 | #: inc/additionalalert.class.php:110 33 | msgid "No used alerts" 34 | msgstr "" 35 | 36 | #: inc/additionalalert.class.php:142 37 | msgid "No computers with no buy date" 38 | msgstr "" 39 | 40 | #: inc/additionalalert.class.php:163 inc/config.class.php:122 41 | #: inc/inkalert.class.php:48 inc/inkalert.class.php:98 42 | #: inc/inkalert.class.php:276 inc/inkalert.class.php:397 43 | #: inc/notificationtargetinkalert.class.php:45 44 | #: inc/notificationtargetinkalert.class.php:104 45 | msgid "Cartridges whose level is low" 46 | msgstr "" 47 | 48 | #: inc/additionalalert.class.php:170 49 | msgid "Ink level" 50 | msgstr "" 51 | 52 | #: inc/additionalalert.class.php:177 53 | msgid "No cartridge is below the threshold" 54 | msgstr "" 55 | 56 | #: inc/additionalalert.class.php:181 inc/inkthreshold.class.php:55 57 | #: inc/inkthreshold.class.php:58 58 | msgid "Ink level alerts" 59 | msgstr "" 60 | 61 | #: inc/additionalalert.class.php:181 inc/config.class.php:128 62 | #: inc/inkalert.class.php:404 inc/inkthreshold.class.php:69 63 | msgid "Fusioninventory plugin is not installed" 64 | msgstr "" 65 | 66 | #: inc/additionalalert.class.php:197 67 | msgid "Tickets unresolved since more" 68 | msgstr "" 69 | 70 | #: inc/additionalalert.class.php:213 71 | msgid "No tickets unresolved since more" 72 | msgstr "" 73 | 74 | #: inc/config.class.php:46 inc/infocomalert.class.php:60 75 | #: inc/inkalert.class.php:60 76 | msgid "Plugin setup" 77 | msgstr "Lisaprogrammi seadistus" 78 | 79 | #: inc/config.class.php:133 80 | msgid "Unresolved Ticket Alerts" 81 | msgstr "" 82 | 83 | #: inc/infocomalert.class.php:48 84 | msgid "Computer with no buy date" 85 | msgid_plural "Computers with no buy date" 86 | msgstr[0] "" 87 | msgstr[1] "" 88 | 89 | #: inc/infocomalert.class.php:351 inc/inkalert.class.php:331 90 | msgid "Parameter" 91 | msgstr "" 92 | 93 | #: inc/infocomalert.class.php:352 94 | msgid "Type not used for check of buy date" 95 | msgstr "" 96 | 97 | #: inc/inkalert.class.php:332 98 | msgid "Statutes used for the ink level" 99 | msgstr "" 100 | 101 | #: inc/ticketunresolved.class.php:48 102 | msgid "Ticket unresolved" 103 | msgid_plural "Tickets unresolved" 104 | msgstr[0] "" 105 | msgstr[1] "" 106 | -------------------------------------------------------------------------------- /sql/empty-1.3.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_configs`; 2 | CREATE TABLE `glpi_plugin_additionalalerts_configs` ( 3 | `id` int(11) NOT NULL auto_increment, 4 | `delay_reminder` int(11) NOT NULL default '-1', 5 | `delay_ocs` int(11) NOT NULL default '-1', 6 | `use_infocom_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 7 | `use_newocs_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 8 | PRIMARY KEY (`id`) 9 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 10 | 11 | INSERT INTO `glpi_plugin_additionalalerts_configs` ( `id`,`delay_reminder`,`delay_ocs`,`use_infocom_alert`,`use_newocs_alert`) VALUES ('1','-1','-1','-1','-1'); 12 | 13 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_reminderalerts`; 14 | CREATE TABLE `glpi_plugin_additionalalerts_reminderalerts` ( 15 | `id` int(11) NOT NULL auto_increment, 16 | `entities_id` int(11) NOT NULL default '0', 17 | `delay_reminder` int(11) NOT NULL default '-1', 18 | PRIMARY KEY (`id`) 19 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 20 | 21 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_ocsalerts`; 22 | CREATE TABLE `glpi_plugin_additionalalerts_ocsalerts` ( 23 | `id` int(11) NOT NULL auto_increment, 24 | `entities_id` int(11) NOT NULL default '0', 25 | `delay_ocs` int(11) NOT NULL default '-1', 26 | `use_newocs_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 27 | PRIMARY KEY (`id`) 28 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 29 | 30 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_infocomalerts`; 31 | CREATE TABLE `glpi_plugin_additionalalerts_infocomalerts` ( 32 | `id` int(11) NOT NULL auto_increment, 33 | `entities_id` int(11) NOT NULL default '0', 34 | `use_infocom_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 35 | PRIMARY KEY (`id`) 36 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 37 | 38 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_notificationstates`; 39 | CREATE TABLE `glpi_plugin_additionalalerts_notificationstates` ( 40 | `id` int(11) NOT NULL auto_increment, 41 | `states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)', 42 | PRIMARY KEY (`id`) 43 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 44 | 45 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_notificationtypes`; 46 | CREATE TABLE `glpi_plugin_additionalalerts_notificationtypes` ( 47 | `id` INT( 11 ) NOT NULL AUTO_INCREMENT , 48 | `types_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_computertypes (id)', 49 | PRIMARY KEY (`id`) 50 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 51 | 52 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_profiles`; 53 | CREATE TABLE `glpi_plugin_additionalalerts_profiles` ( 54 | `id` int(11) NOT NULL auto_increment, 55 | `profiles_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_profiles (id)', 56 | `additionalalerts` char(1) collate utf8_unicode_ci default NULL, 57 | PRIMARY KEY (`id`), 58 | KEY `profiles_id` (`profiles_id`) 59 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 60 | 61 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert infocoms', 'PluginAdditionalalertsInfocomAlert', '2010-03-13 10:44:46','',NULL); 62 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert machines ocs', 'PluginAdditionalalertsOcsAlert', '2010-03-13 10:44:46','',NULL); 63 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert reminders', 'PluginAdditionalalertsReminderAlert', '2010-03-13 10:44:46','',NULL); -------------------------------------------------------------------------------- /locales/pt_BR.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Additionalalerts Development Team 3 | # This file is distributed under the same license as the GLPI - Additionalalerts plugin package. 4 | # 5 | # Translators: 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: GLPI Project - additionalalerts plugin\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2018-10-11 12:28+0200\n" 11 | "PO-Revision-Date: 2018-10-11 10:30+0000\n" 12 | "Last-Translator: Amandine Manceau\n" 13 | "Language-Team: Portuguese (Brazil) (http://www.transifex.com/tsmr/GLPI_additionalalerts/language/pt_BR/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: pt_BR\n" 18 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 19 | 20 | #: setup.php:74 inc/additionalalert.class.php:48 inc/menu.class.php:41 21 | #: inc/profile.class.php:92 22 | msgid "Other alert" 23 | msgid_plural "Others alerts" 24 | msgstr[0] "Outro alerta" 25 | msgstr[1] "Outros alertas" 26 | 27 | #: front/config.form.php:49 28 | msgid "Please activate the plugin" 29 | msgstr "" 30 | 31 | #: inc/additionalalert.class.php:110 32 | msgid "No used alerts" 33 | msgstr "Nenhum alerta usado" 34 | 35 | #: inc/additionalalert.class.php:142 36 | msgid "No computers with no buy date" 37 | msgstr "Nenhum computador sem data de compra" 38 | 39 | #: inc/additionalalert.class.php:163 inc/config.class.php:122 40 | #: inc/inkalert.class.php:48 inc/inkalert.class.php:98 41 | #: inc/inkalert.class.php:276 inc/inkalert.class.php:397 42 | #: inc/notificationtargetinkalert.class.php:45 43 | #: inc/notificationtargetinkalert.class.php:104 44 | msgid "Cartridges whose level is low" 45 | msgstr "" 46 | 47 | #: inc/additionalalert.class.php:170 48 | msgid "Ink level" 49 | msgstr "" 50 | 51 | #: inc/additionalalert.class.php:177 52 | msgid "No cartridge is below the threshold" 53 | msgstr "" 54 | 55 | #: inc/additionalalert.class.php:181 inc/inkthreshold.class.php:55 56 | #: inc/inkthreshold.class.php:58 57 | msgid "Ink level alerts" 58 | msgstr "" 59 | 60 | #: inc/additionalalert.class.php:181 inc/config.class.php:128 61 | #: inc/inkalert.class.php:404 inc/inkthreshold.class.php:69 62 | msgid "Fusioninventory plugin is not installed" 63 | msgstr "" 64 | 65 | #: inc/additionalalert.class.php:197 66 | msgid "Tickets unresolved since more" 67 | msgstr "" 68 | 69 | #: inc/additionalalert.class.php:213 70 | msgid "No tickets unresolved since more" 71 | msgstr "" 72 | 73 | #: inc/config.class.php:46 inc/infocomalert.class.php:60 74 | #: inc/inkalert.class.php:60 75 | msgid "Plugin setup" 76 | msgstr "Configuração do plugin" 77 | 78 | #: inc/config.class.php:133 79 | msgid "Unresolved Ticket Alerts" 80 | msgstr "" 81 | 82 | #: inc/infocomalert.class.php:48 83 | msgid "Computer with no buy date" 84 | msgid_plural "Computers with no buy date" 85 | msgstr[0] "Computador sem data de compra" 86 | msgstr[1] "Computadores sem data de compra" 87 | 88 | #: inc/infocomalert.class.php:351 inc/inkalert.class.php:331 89 | msgid "Parameter" 90 | msgstr "Parâmetro" 91 | 92 | #: inc/infocomalert.class.php:352 93 | msgid "Type not used for check of buy date" 94 | msgstr "Tipo não usado para verificação da data de compra" 95 | 96 | #: inc/inkalert.class.php:332 97 | msgid "Statutes used for the ink level" 98 | msgstr "" 99 | 100 | #: inc/ticketunresolved.class.php:48 101 | msgid "Ticket unresolved" 102 | msgid_plural "Tickets unresolved" 103 | msgstr[0] "" 104 | msgstr[1] "" 105 | -------------------------------------------------------------------------------- /locales/ms_MY.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Additionalalerts Development Team 3 | # This file is distributed under the same license as the GLPI - Additionalalerts plugin package. 4 | # 5 | # Translators: 6 | # punkrawkoholic , 2015 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: GLPI Project - additionalalerts plugin\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2018-10-11 12:28+0200\n" 12 | "PO-Revision-Date: 2018-10-11 10:30+0000\n" 13 | "Last-Translator: Amandine Manceau\n" 14 | "Language-Team: Malay (Malaysia) (http://www.transifex.com/tsmr/GLPI_additionalalerts/language/ms_MY/)\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Language: ms_MY\n" 19 | "Plural-Forms: nplurals=1; plural=0;\n" 20 | 21 | #: setup.php:74 inc/additionalalert.class.php:48 inc/menu.class.php:41 22 | #: inc/profile.class.php:92 23 | msgid "Other alert" 24 | msgid_plural "Others alerts" 25 | msgstr[0] "Amaran lain" 26 | 27 | #: front/config.form.php:49 28 | msgid "Please activate the plugin" 29 | msgstr "" 30 | 31 | #: inc/additionalalert.class.php:110 32 | msgid "No used alerts" 33 | msgstr "" 34 | 35 | #: inc/additionalalert.class.php:142 36 | msgid "No computers with no buy date" 37 | msgstr "Tiada komputer dengan tarikh pembelian" 38 | 39 | #: inc/additionalalert.class.php:163 inc/config.class.php:122 40 | #: inc/inkalert.class.php:48 inc/inkalert.class.php:98 41 | #: inc/inkalert.class.php:276 inc/inkalert.class.php:397 42 | #: inc/notificationtargetinkalert.class.php:45 43 | #: inc/notificationtargetinkalert.class.php:104 44 | msgid "Cartridges whose level is low" 45 | msgstr "Katrij yang ukuranya rendah" 46 | 47 | #: inc/additionalalert.class.php:170 48 | msgid "Ink level" 49 | msgstr "Ukuran dakwat" 50 | 51 | #: inc/additionalalert.class.php:177 52 | msgid "No cartridge is below the threshold" 53 | msgstr "Tiada katrij di bawah ukuruan" 54 | 55 | #: inc/additionalalert.class.php:181 inc/inkthreshold.class.php:55 56 | #: inc/inkthreshold.class.php:58 57 | msgid "Ink level alerts" 58 | msgstr "Amaran ukuran dakwat" 59 | 60 | #: inc/additionalalert.class.php:181 inc/config.class.php:128 61 | #: inc/inkalert.class.php:404 inc/inkthreshold.class.php:69 62 | msgid "Fusioninventory plugin is not installed" 63 | msgstr "" 64 | 65 | #: inc/additionalalert.class.php:197 66 | msgid "Tickets unresolved since more" 67 | msgstr "Tiket tiada penyelesaian sejak lebih" 68 | 69 | #: inc/additionalalert.class.php:213 70 | msgid "No tickets unresolved since more" 71 | msgstr "" 72 | 73 | #: inc/config.class.php:46 inc/infocomalert.class.php:60 74 | #: inc/inkalert.class.php:60 75 | msgid "Plugin setup" 76 | msgstr "" 77 | 78 | #: inc/config.class.php:133 79 | msgid "Unresolved Ticket Alerts" 80 | msgstr "" 81 | 82 | #: inc/infocomalert.class.php:48 83 | msgid "Computer with no buy date" 84 | msgid_plural "Computers with no buy date" 85 | msgstr[0] "Komputer dengan tiada tarikh beli" 86 | 87 | #: inc/infocomalert.class.php:351 inc/inkalert.class.php:331 88 | msgid "Parameter" 89 | msgstr "" 90 | 91 | #: inc/infocomalert.class.php:352 92 | msgid "Type not used for check of buy date" 93 | msgstr "Jenis tidak digunakan untuk periksa tarikh beli" 94 | 95 | #: inc/inkalert.class.php:332 96 | msgid "Statutes used for the ink level" 97 | msgstr "" 98 | 99 | #: inc/ticketunresolved.class.php:48 100 | msgid "Ticket unresolved" 101 | msgid_plural "Tickets unresolved" 102 | msgstr[0] "" 103 | -------------------------------------------------------------------------------- /sql/empty-2.1.2.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_configs`; 2 | CREATE TABLE `glpi_plugin_additionalalerts_configs` ( 3 | `id` int(11) NOT NULL auto_increment, 4 | `use_infocom_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 5 | `use_ink_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 6 | `delay_ticket_alert` int(11) NOT NULL default '0', 7 | PRIMARY KEY (`id`) 8 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 9 | 10 | INSERT INTO `glpi_plugin_additionalalerts_configs` ( `id`, `use_infocom_alert`, `use_ink_alert`, `delay_ticket_alert`) 11 | VALUES ('1','-1','-1','-1'); 12 | 13 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_infocomalerts`; 14 | CREATE TABLE `glpi_plugin_additionalalerts_infocomalerts` ( 15 | `id` int(11) NOT NULL auto_increment, 16 | `entities_id` int(11) NOT NULL default '0', 17 | `use_infocom_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 18 | PRIMARY KEY (`id`) 19 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 20 | 21 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_ticketunresolveds`; 22 | CREATE TABLE `glpi_plugin_additionalalerts_ticketunresolveds` ( 23 | `id` int(11) NOT NULL auto_increment, 24 | `entities_id` int(11) NOT NULL default '0', 25 | `delay_ticket_alert` int(11) NOT NULL DEFAULT '-1', 26 | PRIMARY KEY (`id`) 27 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 28 | 29 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkalerts`; 30 | CREATE TABLE `glpi_plugin_additionalalerts_inkalerts` ( 31 | `id` int(11) NOT NULL auto_increment, 32 | `entities_id` int(11) NOT NULL default '0', 33 | `use_ink_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 34 | PRIMARY KEY (`id`) 35 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 36 | 37 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_notificationtypes`; 38 | CREATE TABLE `glpi_plugin_additionalalerts_notificationtypes` ( 39 | `id` INT( 11 ) NOT NULL AUTO_INCREMENT , 40 | `types_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_computertypes (id)', 41 | PRIMARY KEY (`id`) 42 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 43 | 44 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkthresholds`; 45 | CREATE TABLE `glpi_plugin_additionalalerts_inkthresholds` ( 46 | `id` int(11) NOT NULL AUTO_INCREMENT, 47 | `cartridges_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_cartridgeitems (id)', 48 | `threshold` int(3) NOT NULL default '10', 49 | PRIMARY KEY (`id`) 50 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 51 | 52 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkprinterstates`; 53 | CREATE TABLE `glpi_plugin_additionalalerts_inkprinterstates` ( 54 | `id` INT( 11 ) NOT NULL AUTO_INCREMENT, 55 | `states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)', 56 | PRIMARY KEY (`id`) 57 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 58 | 59 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert infocoms', 'PluginAdditionalalertsInfocomAlert', '2010-03-13 10:44:46','',NULL, '2010-03-13 10:44:46'); 60 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert machines ocs', 'PluginAdditionalalertsOcsAlert', '2010-03-13 10:44:46','',NULL, '2010-03-13 10:44:46'); 61 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert ink level', 'PluginAdditionalalertsInkAlert', '2010-03-13 10:44:46','',NULL, '2010-03-13 10:44:46'); 62 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert Ticket Unresolved', 'PluginAdditionalalertsTicketUnresolved', '2010-03-13 10:44:46','',NULL, '2010-03-13 10:44:46'); -------------------------------------------------------------------------------- /locales/tr_TR.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Additionalalerts Development Team 3 | # This file is distributed under the same license as the GLPI - Additionalalerts plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # Kaya Zeren , 2025 9 | # 10 | #, fuzzy 11 | msgid "" 12 | msgstr "" 13 | "Project-Id-Version: GLPI - Additionalalerts plugin\n" 14 | "Report-Msgid-Bugs-To: \n" 15 | "POT-Creation-Date: 2025-10-02 07:19+0000\n" 16 | "PO-Revision-Date: 2020-11-02 15:40+0000\n" 17 | "Last-Translator: Kaya Zeren , 2025\n" 18 | "Language-Team: Turkish (Turkey) (https://app.transifex.com/infotelGLPI/teams/12353/tr_TR/)\n" 19 | "MIME-Version: 1.0\n" 20 | "Content-Type: text/plain; charset=UTF-8\n" 21 | "Content-Transfer-Encoding: 8bit\n" 22 | "Language: tr_TR\n" 23 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 24 | 25 | #: setup.php:96 src/Additionalalert.php:58 src/Menu.php:45 src/Profile.php:116 26 | msgid "Other alert" 27 | msgid_plural "Others alerts" 28 | msgstr[0] "Diğer uyarı" 29 | msgstr[1] "Diğer uyarılar" 30 | 31 | #: front/config.form.php:49 32 | msgid "Please activate the plugin" 33 | msgstr "Lütfen eklentiyi etkinleştirin" 34 | 35 | #: src/Additionalalert.php:120 36 | msgid "No used alerts" 37 | msgstr "Kullanılmıyor uyarıları" 38 | 39 | #: src/Additionalalert.php:149 40 | msgid "No computers with no buy date" 41 | msgstr "Satın alma tarihi olmayan bilgisayar yok" 42 | 43 | #: src/Additionalalert.php:167 src/Config.php:135 src/InkAlert.php:68 44 | #: src/InkAlert.php:125 src/InkAlert.php:305 src/InkAlert.php:376 45 | #: src/NotificationTargetInkAlert.php:54 46 | #: src/NotificationTargetInkAlert.php:124 47 | msgid "Cartridges whose level is low" 48 | msgstr "Düzeyi düşmüş kartuşlar" 49 | 50 | #: src/Additionalalert.php:174 51 | msgid "Ink level" 52 | msgstr "Mürekkep düzeyi" 53 | 54 | #: src/Additionalalert.php:181 55 | msgid "No cartridge is below the threshold" 56 | msgstr "Eşik değerin altında olan bir kartuş yok" 57 | 58 | #: src/Additionalalert.php:197 59 | msgid "Tickets unresolved since more" 60 | msgstr "Şu kadar gündür çözümlenmemiş destek kayıtları" 61 | 62 | #: src/Additionalalert.php:213 63 | msgid "No tickets unresolved since more" 64 | msgstr "Şu kadar gündür çözümlenmemiş bir destek kaydı yok" 65 | 66 | #: src/Config.php:56 src/InfocomAlert.php:84 src/InkAlert.php:86 67 | msgid "Plugin setup" 68 | msgstr "Eklenti ayarları" 69 | 70 | #: src/Config.php:141 71 | msgid "Unresolved Ticket Alerts" 72 | msgstr "Çözümlenmemiş destek kaydı uyarıları" 73 | 74 | #: src/InfocomAlert.php:66 75 | msgid "Computer with no buy date" 76 | msgid_plural "Computers with no buy date" 77 | msgstr[0] "Satın alma tarihi olmayan bilgisayar" 78 | msgstr[1] "Satın alma tarihi olmayan bilgisayarlar" 79 | 80 | #: src/InkPrinterState.php:59 src/NotificationType.php:64 81 | msgid "Parameter" 82 | msgstr "Parametre" 83 | 84 | #: src/InkPrinterState.php:60 85 | msgid "Statutes used for the ink level" 86 | msgstr "Mürekkep düzeyi için kullanılan durumlar" 87 | 88 | #: src/InkThreshold.php:62 src/InkThreshold.php:64 89 | msgid "Ink level alerts" 90 | msgstr "Mürekkep düzeyi uyarıları" 91 | 92 | #: src/NotificationType.php:65 93 | msgid "Type not used for check of buy date" 94 | msgstr "Tür satın alma tarihini denetlemek için kullanılmıyor" 95 | 96 | #: src/TicketUnresolved.php:65 97 | msgid "Ticket unresolved" 98 | msgid_plural "Tickets unresolved" 99 | msgstr[0] "Çözümlenmemiş destek kaydı" 100 | msgstr[1] "Çözümlenmemiş destek kayıtları" 101 | -------------------------------------------------------------------------------- /locales/it_IT.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Additionalalerts Development Team 3 | # This file is distributed under the same license as the GLPI - Additionalalerts plugin package. 4 | # 5 | # Translators: 6 | # Pietro Lombardo , 2016 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: GLPI Project - additionalalerts plugin\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2018-10-11 12:28+0200\n" 12 | "PO-Revision-Date: 2018-10-11 10:30+0000\n" 13 | "Last-Translator: Amandine Manceau\n" 14 | "Language-Team: Italian (Italy) (http://www.transifex.com/tsmr/GLPI_additionalalerts/language/it_IT/)\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Language: it_IT\n" 19 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 20 | 21 | #: setup.php:74 inc/additionalalert.class.php:48 inc/menu.class.php:41 22 | #: inc/profile.class.php:92 23 | msgid "Other alert" 24 | msgid_plural "Others alerts" 25 | msgstr[0] "Altra notifica" 26 | msgstr[1] "Altre notifiche " 27 | 28 | #: front/config.form.php:49 29 | msgid "Please activate the plugin" 30 | msgstr "" 31 | 32 | #: inc/additionalalert.class.php:110 33 | msgid "No used alerts" 34 | msgstr "Nessuna notifica abilitata
(puoi impostarle dal menù Configurazione->Notifche)" 35 | 36 | #: inc/additionalalert.class.php:142 37 | msgid "No computers with no buy date" 38 | msgstr "Nessun computer senza data di acquisto" 39 | 40 | #: inc/additionalalert.class.php:163 inc/config.class.php:122 41 | #: inc/inkalert.class.php:48 inc/inkalert.class.php:98 42 | #: inc/inkalert.class.php:276 inc/inkalert.class.php:397 43 | #: inc/notificationtargetinkalert.class.php:45 44 | #: inc/notificationtargetinkalert.class.php:104 45 | msgid "Cartridges whose level is low" 46 | msgstr "" 47 | 48 | #: inc/additionalalert.class.php:170 49 | msgid "Ink level" 50 | msgstr "Livello inchiostro" 51 | 52 | #: inc/additionalalert.class.php:177 53 | msgid "No cartridge is below the threshold" 54 | msgstr "" 55 | 56 | #: inc/additionalalert.class.php:181 inc/inkthreshold.class.php:55 57 | #: inc/inkthreshold.class.php:58 58 | msgid "Ink level alerts" 59 | msgstr "" 60 | 61 | #: inc/additionalalert.class.php:181 inc/config.class.php:128 62 | #: inc/inkalert.class.php:404 inc/inkthreshold.class.php:69 63 | msgid "Fusioninventory plugin is not installed" 64 | msgstr "Il plugin Fusioninvenctory non è installato" 65 | 66 | #: inc/additionalalert.class.php:197 67 | msgid "Tickets unresolved since more" 68 | msgstr "" 69 | 70 | #: inc/additionalalert.class.php:213 71 | msgid "No tickets unresolved since more" 72 | msgstr "" 73 | 74 | #: inc/config.class.php:46 inc/infocomalert.class.php:60 75 | #: inc/inkalert.class.php:60 76 | msgid "Plugin setup" 77 | msgstr "Plugin setup" 78 | 79 | #: inc/config.class.php:133 80 | msgid "Unresolved Ticket Alerts" 81 | msgstr "" 82 | 83 | #: inc/infocomalert.class.php:48 84 | msgid "Computer with no buy date" 85 | msgid_plural "Computers with no buy date" 86 | msgstr[0] "" 87 | msgstr[1] "" 88 | 89 | #: inc/infocomalert.class.php:351 inc/inkalert.class.php:331 90 | msgid "Parameter" 91 | msgstr "Parameter" 92 | 93 | #: inc/infocomalert.class.php:352 94 | msgid "Type not used for check of buy date" 95 | msgstr "Tipo non usato per la verifica della data di acquisto" 96 | 97 | #: inc/inkalert.class.php:332 98 | msgid "Statutes used for the ink level" 99 | msgstr "" 100 | 101 | #: inc/ticketunresolved.class.php:48 102 | msgid "Ticket unresolved" 103 | msgid_plural "Tickets unresolved" 104 | msgstr[0] "" 105 | msgstr[1] "" 106 | -------------------------------------------------------------------------------- /sql/update-1.3.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_alerting_config`; 2 | ALTER TABLE `glpi_plugin_alerting_state` RENAME `glpi_plugin_additionalalerts_notificationstates`; 3 | ALTER TABLE `glpi_plugin_alerting_type` RENAME `glpi_plugin_additionalalerts_notificationtypes`; 4 | ALTER TABLE `glpi_plugin_alerting_profiles` RENAME `glpi_plugin_additionalalerts_profiles`; 5 | DROP TABLE IF EXISTS `glpi_plugin_alerting_mailing`; 6 | 7 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_configs`; 8 | CREATE TABLE `glpi_plugin_additionalalerts_configs` ( 9 | `id` int(11) NOT NULL auto_increment, 10 | `delay_reminder` int(11) NOT NULL default '-1', 11 | `delay_ocs` int(11) NOT NULL default '-1', 12 | `use_infocom_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 13 | `use_newocs_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 14 | PRIMARY KEY (`id`) 15 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 16 | 17 | INSERT INTO `glpi_plugin_additionalalerts_configs` ( `id`,`delay_reminder`,`delay_ocs`,`use_infocom_alert`,`use_newocs_alert`) VALUES ('1','-1','-1','-1','-1'); 18 | 19 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_reminderalerts`; 20 | CREATE TABLE `glpi_plugin_additionalalerts_reminderalerts` ( 21 | `id` int(11) NOT NULL auto_increment, 22 | `entities_id` int(11) NOT NULL default '0', 23 | `delay_reminder` int(11) NOT NULL default '-1', 24 | PRIMARY KEY (`id`) 25 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 26 | 27 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_ocsalerts`; 28 | CREATE TABLE `glpi_plugin_additionalalerts_ocsalerts` ( 29 | `id` int(11) NOT NULL auto_increment, 30 | `entities_id` int(11) NOT NULL default '0', 31 | `delay_ocs` int(11) NOT NULL default '-1', 32 | `use_newocs_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 33 | PRIMARY KEY (`id`) 34 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 35 | 36 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_infocomalerts`; 37 | CREATE TABLE `glpi_plugin_additionalalerts_infocomalerts` ( 38 | `id` int(11) NOT NULL auto_increment, 39 | `entities_id` int(11) NOT NULL default '0', 40 | `use_infocom_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 41 | PRIMARY KEY (`id`) 42 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 43 | 44 | ALTER TABLE `glpi_plugin_additionalalerts_notificationstates` 45 | CHANGE `ID` `id` int(11) NOT NULL auto_increment, 46 | CHANGE `state` `states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)'; 47 | 48 | ALTER TABLE `glpi_plugin_additionalalerts_notificationtypes` 49 | CHANGE `ID` `id` int(11) NOT NULL auto_increment, 50 | CHANGE `type` `types_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_computertypes (id)'; 51 | 52 | ALTER TABLE `glpi_plugin_additionalalerts_profiles` 53 | CHANGE `ID` `id` int(11) NOT NULL auto_increment, 54 | ADD `profiles_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_profiles (id)', 55 | CHANGE `alerting` `additionalalerts` char(1) collate utf8_unicode_ci default NULL, 56 | ADD INDEX (`profiles_id`); 57 | 58 | UPDATE `glpi_plugin_additionalalerts_profiles` SET `additionalalerts`='w' WHERE `additionalalerts` ='r'; 59 | 60 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert infocoms', 'PluginAdditionalalertsInfocomAlert', '2010-03-13 10:44:46','',NULL, '2010-03-13 10:44:46'); 61 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert machines ocs', 'PluginAdditionalalertsOcsAlert', '2010-03-13 10:44:46','',NULL, '2010-03-13 10:44:46'); 62 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert reminders', 'PluginAdditionalalertsReminderAlert', '2010-03-13 10:44:46','',NULL, '2010-03-13 10:44:46'); -------------------------------------------------------------------------------- /locales/pt_PT.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Additionalalerts Development Team 3 | # This file is distributed under the same license as the GLPI - Additionalalerts plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Additionalalerts plugin\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2025-09-28 13:44+0000\n" 15 | "PO-Revision-Date: 2020-11-02 15:40+0000\n" 16 | "Last-Translator: Xavier CAILLAUD , 2020\n" 17 | "Language-Team: Portuguese (Portugal) (https://app.transifex.com/infotelGLPI/teams/12353/pt_PT/)\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Language: pt_PT\n" 22 | "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" 23 | 24 | #: setup.php:96 src/Additionalalert.php:58 src/Menu.php:45 src/Profile.php:116 25 | msgid "Other alert" 26 | msgid_plural "Others alerts" 27 | msgstr[0] "Outro alerta" 28 | msgstr[1] "Outros alertas" 29 | msgstr[2] "Outros alertas" 30 | 31 | #: front/config.form.php:49 32 | msgid "Please activate the plugin" 33 | msgstr "Por favor active o plugin" 34 | 35 | #: src/Additionalalert.php:120 36 | msgid "No used alerts" 37 | msgstr "Sem alertas usados" 38 | 39 | #: src/Additionalalert.php:149 40 | msgid "No computers with no buy date" 41 | msgstr "Sem computadores sem data de compra" 42 | 43 | #: src/Additionalalert.php:167 src/Config.php:135 src/Inkalert.php:68 44 | #: src/Inkalert.php:125 src/Inkalert.php:304 src/Inkalert.php:400 45 | #: src/Notificationtargetinkalert.php:54 46 | #: src/Notificationtargetinkalert.php:124 47 | msgid "Cartridges whose level is low" 48 | msgstr "Cartuchos cujo nível é baixo" 49 | 50 | #: src/Additionalalert.php:174 51 | msgid "Ink level" 52 | msgstr "Nível de tinta" 53 | 54 | #: src/Additionalalert.php:181 55 | msgid "No cartridge is below the threshold" 56 | msgstr "Nenhum cartucho está abaixo do limite" 57 | 58 | #: src/Additionalalert.php:197 59 | msgid "Tickets unresolved since more" 60 | msgstr "Tickets não resolvidos desde mais" 61 | 62 | #: src/Additionalalert.php:213 63 | msgid "No tickets unresolved since more" 64 | msgstr "Sem tickets não resolvidos desde mais" 65 | 66 | #: src/Config.php:56 src/Infocomalert.php:84 src/Inkalert.php:86 67 | msgid "Plugin setup" 68 | msgstr "Setup do plugin" 69 | 70 | #: src/Config.php:141 71 | msgid "Unresolved Ticket Alerts" 72 | msgstr "Alerta de Ticket não resolvido" 73 | 74 | #: src/Infocomalert.php:66 75 | msgid "Computer with no buy date" 76 | msgid_plural "Computers with no buy date" 77 | msgstr[0] "Computador sem data de compra" 78 | msgstr[1] "Computadores sem data de compra" 79 | msgstr[2] "Computadores sem data de compra" 80 | 81 | #: src/Inkprinterstate.php:59 src/Notificationtype.php:64 82 | msgid "Parameter" 83 | msgstr "Parâmetros " 84 | 85 | #: src/Inkprinterstate.php:60 86 | msgid "Statutes used for the ink level" 87 | msgstr "Estados de utilização do nível de tinta" 88 | 89 | #: src/Inkthreshold.php:62 src/Inkthreshold.php:64 90 | msgid "Ink level alerts" 91 | msgstr "Alerta nível de tinta" 92 | 93 | #: src/Notificationtype.php:65 94 | msgid "Type not used for check of buy date" 95 | msgstr "Tipo não usado de confirmação da data de compra" 96 | 97 | #: src/Ticketunresolved.php:65 98 | msgid "Ticket unresolved" 99 | msgid_plural "Tickets unresolved" 100 | msgstr[0] "Ticket não resolvido" 101 | msgstr[1] "Tickets não resolvidos" 102 | msgstr[2] "Tickets não resolvidos" 103 | -------------------------------------------------------------------------------- /locales/es_EC.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Additionalalerts Development Team 3 | # This file is distributed under the same license as the GLPI - Additionalalerts plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Soporte Infraestructura Standby, 2023 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Additionalalerts plugin\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2025-09-28 13:44+0000\n" 15 | "PO-Revision-Date: 2020-11-02 15:40+0000\n" 16 | "Last-Translator: Soporte Infraestructura Standby, 2023\n" 17 | "Language-Team: Spanish (Ecuador) (https://app.transifex.com/infotelGLPI/teams/12353/es_EC/)\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Language: es_EC\n" 22 | "Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" 23 | 24 | #: setup.php:96 src/Additionalalert.php:58 src/Menu.php:45 src/Profile.php:116 25 | msgid "Other alert" 26 | msgid_plural "Others alerts" 27 | msgstr[0] "Otras alertas" 28 | msgstr[1] "Otras alertas" 29 | msgstr[2] "Otras descripciones" 30 | 31 | #: front/config.form.php:49 32 | msgid "Please activate the plugin" 33 | msgstr "Por favor, active el plugin" 34 | 35 | #: src/Additionalalert.php:120 36 | msgid "No used alerts" 37 | msgstr "No se han utilizado las descripciones" 38 | 39 | #: src/Additionalalert.php:149 40 | msgid "No computers with no buy date" 41 | msgstr "No hay ordenadores sin fecha de compra" 42 | 43 | #: src/Additionalalert.php:167 src/Config.php:135 src/Inkalert.php:68 44 | #: src/Inkalert.php:125 src/Inkalert.php:304 src/Inkalert.php:400 45 | #: src/Notificationtargetinkalert.php:54 46 | #: src/Notificationtargetinkalert.php:124 47 | msgid "Cartridges whose level is low" 48 | msgstr "Cartuchos cuyo nivel es bajo" 49 | 50 | #: src/Additionalalert.php:174 51 | msgid "Ink level" 52 | msgstr "Nivel de tinta" 53 | 54 | #: src/Additionalalert.php:181 55 | msgid "No cartridge is below the threshold" 56 | msgstr "Ningún cartucho está por debajo del umbral" 57 | 58 | #: src/Additionalalert.php:197 59 | msgid "Tickets unresolved since more" 60 | msgstr "Tickets sin resolver desde más" 61 | 62 | #: src/Additionalalert.php:213 63 | msgid "No tickets unresolved since more" 64 | msgstr "No hay tickets sin resolver desde hace más" 65 | 66 | #: src/Config.php:56 src/Infocomalert.php:84 src/Inkalert.php:86 67 | msgid "Plugin setup" 68 | msgstr "Configuración del plugin" 69 | 70 | #: src/Config.php:141 71 | msgid "Unresolved Ticket Alerts" 72 | msgstr "Unresolved Ticket Alerts" 73 | 74 | #: src/Infocomalert.php:66 75 | msgid "Computer with no buy date" 76 | msgid_plural "Computers with no buy date" 77 | msgstr[0] "Ordenadores sin fecha de compra" 78 | msgstr[1] "Ordenadores sin fecha de compra" 79 | msgstr[2] "Ordenadores sin fecha de compra" 80 | 81 | #: src/Inkprinterstate.php:59 src/Notificationtype.php:64 82 | msgid "Parameter" 83 | msgstr "Parámetro" 84 | 85 | #: src/Inkprinterstate.php:60 86 | msgid "Statutes used for the ink level" 87 | msgstr "Estatutos utilizados para el nivel de tinta" 88 | 89 | #: src/Inkthreshold.php:62 src/Inkthreshold.php:64 90 | msgid "Ink level alerts" 91 | msgstr "Alertas de nivel de tinta" 92 | 93 | #: src/Notificationtype.php:65 94 | msgid "Type not used for check of buy date" 95 | msgstr "Tipo no utilizado para la comprobación de la fecha de compra" 96 | 97 | #: src/Ticketunresolved.php:65 98 | msgid "Ticket unresolved" 99 | msgid_plural "Tickets unresolved" 100 | msgstr[0] "Tickets sin resolver" 101 | msgstr[1] "Tickets sin resolver" 102 | msgstr[2] "Tickets sin resolver" 103 | -------------------------------------------------------------------------------- /locales/es_ES.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Additionalalerts Development Team 3 | # This file is distributed under the same license as the GLPI - Additionalalerts plugin package. 4 | # 5 | # Translators: 6 | # Le Rohellec Benoit , 2015 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: GLPI Project - additionalalerts plugin\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2018-10-11 12:28+0200\n" 12 | "PO-Revision-Date: 2018-10-11 10:30+0000\n" 13 | "Last-Translator: Amandine Manceau\n" 14 | "Language-Team: Spanish (Spain) (http://www.transifex.com/tsmr/GLPI_additionalalerts/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 | #: setup.php:74 inc/additionalalert.class.php:48 inc/menu.class.php:41 22 | #: inc/profile.class.php:92 23 | msgid "Other alert" 24 | msgid_plural "Others alerts" 25 | msgstr[0] "Otra alerta" 26 | msgstr[1] "Otras alertas" 27 | 28 | #: front/config.form.php:49 29 | msgid "Please activate the plugin" 30 | msgstr "" 31 | 32 | #: inc/additionalalert.class.php:110 33 | msgid "No used alerts" 34 | msgstr "Sin alertas in uso" 35 | 36 | #: inc/additionalalert.class.php:142 37 | msgid "No computers with no buy date" 38 | msgstr "No hay equipos sin fecha de compra" 39 | 40 | #: inc/additionalalert.class.php:163 inc/config.class.php:122 41 | #: inc/inkalert.class.php:48 inc/inkalert.class.php:98 42 | #: inc/inkalert.class.php:276 inc/inkalert.class.php:397 43 | #: inc/notificationtargetinkalert.class.php:45 44 | #: inc/notificationtargetinkalert.class.php:104 45 | msgid "Cartridges whose level is low" 46 | msgstr "Cartuchos con nivel bajo de tinta" 47 | 48 | #: inc/additionalalert.class.php:170 49 | msgid "Ink level" 50 | msgstr "Nivel de tinta" 51 | 52 | #: inc/additionalalert.class.php:177 53 | msgid "No cartridge is below the threshold" 54 | msgstr "Ningún cartucho por debajo del limite" 55 | 56 | #: inc/additionalalert.class.php:181 inc/inkthreshold.class.php:55 57 | #: inc/inkthreshold.class.php:58 58 | msgid "Ink level alerts" 59 | msgstr "Alertas de nivel de tinta" 60 | 61 | #: inc/additionalalert.class.php:181 inc/config.class.php:128 62 | #: inc/inkalert.class.php:404 inc/inkthreshold.class.php:69 63 | msgid "Fusioninventory plugin is not installed" 64 | msgstr "El plugin FusionInventory no esta instalado" 65 | 66 | #: inc/additionalalert.class.php:197 67 | msgid "Tickets unresolved since more" 68 | msgstr "" 69 | 70 | #: inc/additionalalert.class.php:213 71 | msgid "No tickets unresolved since more" 72 | msgstr "" 73 | 74 | #: inc/config.class.php:46 inc/infocomalert.class.php:60 75 | #: inc/inkalert.class.php:60 76 | msgid "Plugin setup" 77 | msgstr "Configuración del plugin" 78 | 79 | #: inc/config.class.php:133 80 | msgid "Unresolved Ticket Alerts" 81 | msgstr "" 82 | 83 | #: inc/infocomalert.class.php:48 84 | msgid "Computer with no buy date" 85 | msgid_plural "Computers with no buy date" 86 | msgstr[0] "Equipo sin fecha de compra" 87 | msgstr[1] "Equipos sin fecha de compra" 88 | 89 | #: inc/infocomalert.class.php:351 inc/inkalert.class.php:331 90 | msgid "Parameter" 91 | msgstr "Parámetro" 92 | 93 | #: inc/infocomalert.class.php:352 94 | msgid "Type not used for check of buy date" 95 | msgstr "Tipo no tenido en cuenta para comprobar la fecha de compra" 96 | 97 | #: inc/inkalert.class.php:332 98 | msgid "Statutes used for the ink level" 99 | msgstr "Estados utilizados por OCS-NG" 100 | 101 | #: inc/ticketunresolved.class.php:48 102 | msgid "Ticket unresolved" 103 | msgid_plural "Tickets unresolved" 104 | msgstr[0] "" 105 | msgstr[1] "" 106 | -------------------------------------------------------------------------------- /locales/hu_HU.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Additionalalerts Development Team 3 | # This file is distributed under the same license as the GLPI - Additionalalerts plugin package. 4 | # 5 | # Translators: 6 | # Laszlo Czirbesz , 2015 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: GLPI Project - additionalalerts plugin\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2018-10-11 12:28+0200\n" 12 | "PO-Revision-Date: 2018-10-11 10:30+0000\n" 13 | "Last-Translator: Amandine Manceau\n" 14 | "Language-Team: Hungarian (Hungary) (http://www.transifex.com/tsmr/GLPI_additionalalerts/language/hu_HU/)\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Language: hu_HU\n" 19 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 20 | 21 | #: setup.php:74 inc/additionalalert.class.php:48 inc/menu.class.php:41 22 | #: inc/profile.class.php:92 23 | msgid "Other alert" 24 | msgid_plural "Others alerts" 25 | msgstr[0] "Egyéb riasztás" 26 | msgstr[1] "Egyéb riasztások" 27 | 28 | #: front/config.form.php:49 29 | msgid "Please activate the plugin" 30 | msgstr "" 31 | 32 | #: inc/additionalalert.class.php:110 33 | msgid "No used alerts" 34 | msgstr "Nincs használt riasztás" 35 | 36 | #: inc/additionalalert.class.php:142 37 | msgid "No computers with no buy date" 38 | msgstr "Nincs számítógép vásárlási dátum nélkül" 39 | 40 | #: inc/additionalalert.class.php:163 inc/config.class.php:122 41 | #: inc/inkalert.class.php:48 inc/inkalert.class.php:98 42 | #: inc/inkalert.class.php:276 inc/inkalert.class.php:397 43 | #: inc/notificationtargetinkalert.class.php:45 44 | #: inc/notificationtargetinkalert.class.php:104 45 | msgid "Cartridges whose level is low" 46 | msgstr "Patronok amelyek szintje alacsony" 47 | 48 | #: inc/additionalalert.class.php:170 49 | msgid "Ink level" 50 | msgstr "Tinta szint" 51 | 52 | #: inc/additionalalert.class.php:177 53 | msgid "No cartridge is below the threshold" 54 | msgstr "Nincs patron a küszöbérték alatt" 55 | 56 | #: inc/additionalalert.class.php:181 inc/inkthreshold.class.php:55 57 | #: inc/inkthreshold.class.php:58 58 | msgid "Ink level alerts" 59 | msgstr "Tinta szint riasztások" 60 | 61 | #: inc/additionalalert.class.php:181 inc/config.class.php:128 62 | #: inc/inkalert.class.php:404 inc/inkthreshold.class.php:69 63 | msgid "Fusioninventory plugin is not installed" 64 | msgstr "A Fusioninventory bővítmény nincs telepítve" 65 | 66 | #: inc/additionalalert.class.php:197 67 | msgid "Tickets unresolved since more" 68 | msgstr "" 69 | 70 | #: inc/additionalalert.class.php:213 71 | msgid "No tickets unresolved since more" 72 | msgstr "" 73 | 74 | #: inc/config.class.php:46 inc/infocomalert.class.php:60 75 | #: inc/inkalert.class.php:60 76 | msgid "Plugin setup" 77 | msgstr "Bővítmény beállításai" 78 | 79 | #: inc/config.class.php:133 80 | msgid "Unresolved Ticket Alerts" 81 | msgstr "" 82 | 83 | #: inc/infocomalert.class.php:48 84 | msgid "Computer with no buy date" 85 | msgid_plural "Computers with no buy date" 86 | msgstr[0] "Számítógép vásárlás dátuma nélkül" 87 | msgstr[1] "Számítógépek vásárlás dátuma nélkül" 88 | 89 | #: inc/infocomalert.class.php:351 inc/inkalert.class.php:331 90 | msgid "Parameter" 91 | msgstr "Paraméter" 92 | 93 | #: inc/infocomalert.class.php:352 94 | msgid "Type not used for check of buy date" 95 | msgstr "Nem használt típus a vásárlás dátumának ellenőrzésekor" 96 | 97 | #: inc/inkalert.class.php:332 98 | msgid "Statutes used for the ink level" 99 | msgstr "Tintaszinthez használt státuszok" 100 | 101 | #: inc/ticketunresolved.class.php:48 102 | msgid "Ticket unresolved" 103 | msgid_plural "Tickets unresolved" 104 | msgstr[0] "" 105 | msgstr[1] "" 106 | -------------------------------------------------------------------------------- /locales/pl_PL.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Additionalalerts Development Team 3 | # This file is distributed under the same license as the GLPI - Additionalalerts plugin package. 4 | # 5 | # Translators: 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: GLPI Project - additionalalerts plugin\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2018-10-11 12:28+0200\n" 11 | "PO-Revision-Date: 2018-10-11 10:30+0000\n" 12 | "Last-Translator: Amandine Manceau\n" 13 | "Language-Team: Polish (Poland) (http://www.transifex.com/tsmr/GLPI_additionalalerts/language/pl_PL/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: pl_PL\n" 18 | "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" 19 | 20 | #: setup.php:74 inc/additionalalert.class.php:48 inc/menu.class.php:41 21 | #: inc/profile.class.php:92 22 | msgid "Other alert" 23 | msgid_plural "Others alerts" 24 | msgstr[0] "Inny alarm" 25 | msgstr[1] "Inne alarmy" 26 | msgstr[2] "Innych alarmów" 27 | msgstr[3] "Innych alarmów" 28 | 29 | #: front/config.form.php:49 30 | msgid "Please activate the plugin" 31 | msgstr "" 32 | 33 | #: inc/additionalalert.class.php:110 34 | msgid "No used alerts" 35 | msgstr "Nieużywane alarmy" 36 | 37 | #: inc/additionalalert.class.php:142 38 | msgid "No computers with no buy date" 39 | msgstr "Brak komputerów bez daty zakupu" 40 | 41 | #: inc/additionalalert.class.php:163 inc/config.class.php:122 42 | #: inc/inkalert.class.php:48 inc/inkalert.class.php:98 43 | #: inc/inkalert.class.php:276 inc/inkalert.class.php:397 44 | #: inc/notificationtargetinkalert.class.php:45 45 | #: inc/notificationtargetinkalert.class.php:104 46 | msgid "Cartridges whose level is low" 47 | msgstr "" 48 | 49 | #: inc/additionalalert.class.php:170 50 | msgid "Ink level" 51 | msgstr "" 52 | 53 | #: inc/additionalalert.class.php:177 54 | msgid "No cartridge is below the threshold" 55 | msgstr "" 56 | 57 | #: inc/additionalalert.class.php:181 inc/inkthreshold.class.php:55 58 | #: inc/inkthreshold.class.php:58 59 | msgid "Ink level alerts" 60 | msgstr "" 61 | 62 | #: inc/additionalalert.class.php:181 inc/config.class.php:128 63 | #: inc/inkalert.class.php:404 inc/inkthreshold.class.php:69 64 | msgid "Fusioninventory plugin is not installed" 65 | msgstr "" 66 | 67 | #: inc/additionalalert.class.php:197 68 | msgid "Tickets unresolved since more" 69 | msgstr "" 70 | 71 | #: inc/additionalalert.class.php:213 72 | msgid "No tickets unresolved since more" 73 | msgstr "" 74 | 75 | #: inc/config.class.php:46 inc/infocomalert.class.php:60 76 | #: inc/inkalert.class.php:60 77 | msgid "Plugin setup" 78 | msgstr "Konfiguracja wtyczki" 79 | 80 | #: inc/config.class.php:133 81 | msgid "Unresolved Ticket Alerts" 82 | msgstr "" 83 | 84 | #: inc/infocomalert.class.php:48 85 | msgid "Computer with no buy date" 86 | msgid_plural "Computers with no buy date" 87 | msgstr[0] "Komputer bez daty zakupu" 88 | msgstr[1] "Komputery bez daty zakupu" 89 | msgstr[2] "Komputerów bez daty zakupu" 90 | msgstr[3] "Komputerów bez daty zakupu" 91 | 92 | #: inc/infocomalert.class.php:351 inc/inkalert.class.php:331 93 | msgid "Parameter" 94 | msgstr "Parametr" 95 | 96 | #: inc/infocomalert.class.php:352 97 | msgid "Type not used for check of buy date" 98 | msgstr "" 99 | 100 | #: inc/inkalert.class.php:332 101 | msgid "Statutes used for the ink level" 102 | msgstr "" 103 | 104 | #: inc/ticketunresolved.class.php:48 105 | msgid "Ticket unresolved" 106 | msgid_plural "Tickets unresolved" 107 | msgstr[0] "" 108 | msgstr[1] "" 109 | msgstr[2] "" 110 | msgstr[3] "" 111 | -------------------------------------------------------------------------------- /locales/en_GB.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Additionalalerts Development Team 3 | # This file is distributed under the same license as the GLPI - Additionalalerts plugin package. 4 | # 5 | # Translators: 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: GLPI Project - additionalalerts plugin\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2018-10-11 12:28+0200\n" 11 | "PO-Revision-Date: 2018-10-11 10:30+0000\n" 12 | "Last-Translator: Amandine Manceau\n" 13 | "Language-Team: English (United Kingdom) (http://www.transifex.com/tsmr/GLPI_additionalalerts/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 | #: setup.php:74 inc/additionalalert.class.php:48 inc/menu.class.php:41 21 | #: inc/profile.class.php:92 22 | msgid "Other alert" 23 | msgid_plural "Others alerts" 24 | msgstr[0] "Other alert" 25 | msgstr[1] "Others alerts" 26 | 27 | #: front/config.form.php:49 28 | msgid "Please activate the plugin" 29 | msgstr "Please activate the plugin" 30 | 31 | #: inc/additionalalert.class.php:110 32 | msgid "No used alerts" 33 | msgstr "No used alerts" 34 | 35 | #: inc/additionalalert.class.php:142 36 | msgid "No computers with no buy date" 37 | msgstr "No computers with no buy date" 38 | 39 | #: inc/additionalalert.class.php:163 inc/config.class.php:122 40 | #: inc/inkalert.class.php:48 inc/inkalert.class.php:98 41 | #: inc/inkalert.class.php:276 inc/inkalert.class.php:397 42 | #: inc/notificationtargetinkalert.class.php:45 43 | #: inc/notificationtargetinkalert.class.php:104 44 | msgid "Cartridges whose level is low" 45 | msgstr "Cartridges whose level is low" 46 | 47 | #: inc/additionalalert.class.php:170 48 | msgid "Ink level" 49 | msgstr "Ink level" 50 | 51 | #: inc/additionalalert.class.php:177 52 | msgid "No cartridge is below the threshold" 53 | msgstr "No cartridge is below the threshold" 54 | 55 | #: inc/additionalalert.class.php:181 inc/inkthreshold.class.php:55 56 | #: inc/inkthreshold.class.php:58 57 | msgid "Ink level alerts" 58 | msgstr "Ink level alerts" 59 | 60 | #: inc/additionalalert.class.php:181 inc/config.class.php:128 61 | #: inc/inkalert.class.php:404 inc/inkthreshold.class.php:69 62 | msgid "Fusioninventory plugin is not installed" 63 | msgstr "Fusioninventory plugin is not installed" 64 | 65 | #: inc/additionalalert.class.php:197 66 | msgid "Tickets unresolved since more" 67 | msgstr "Tickets unresolved since more" 68 | 69 | #: inc/additionalalert.class.php:213 70 | msgid "No tickets unresolved since more" 71 | msgstr "No tickets unresolved since more" 72 | 73 | #: inc/config.class.php:46 inc/infocomalert.class.php:60 74 | #: inc/inkalert.class.php:60 75 | msgid "Plugin setup" 76 | msgstr "Plugin setup" 77 | 78 | #: inc/config.class.php:133 79 | msgid "Unresolved Ticket Alerts" 80 | msgstr "Unresolved Ticket Alerts" 81 | 82 | #: inc/infocomalert.class.php:48 83 | msgid "Computer with no buy date" 84 | msgid_plural "Computers with no buy date" 85 | msgstr[0] "Computer with no buy date" 86 | msgstr[1] "Computers with no buy date" 87 | 88 | #: inc/infocomalert.class.php:351 inc/inkalert.class.php:331 89 | msgid "Parameter" 90 | msgstr "Parameter" 91 | 92 | #: inc/infocomalert.class.php:352 93 | msgid "Type not used for check of buy date" 94 | msgstr "Type not used for check of buy date" 95 | 96 | #: inc/inkalert.class.php:332 97 | msgid "Statutes used for the ink level" 98 | msgstr "Statutes used for the ink level" 99 | 100 | #: inc/ticketunresolved.class.php:48 101 | msgid "Ticket unresolved" 102 | msgid_plural "Tickets unresolved" 103 | msgstr[0] "Ticket unresolved" 104 | msgstr[1] "Tickets unresolved" 105 | -------------------------------------------------------------------------------- /sql/empty-2.4.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_configs`; 2 | CREATE TABLE `glpi_plugin_additionalalerts_configs` ( 3 | `id` int unsigned NOT NULL auto_increment, 4 | `use_infocom_alert` tinyint NOT NULL DEFAULT '0', 5 | `use_ink_alert` tinyint NOT NULL DEFAULT '0', 6 | `delay_ticket_alert` int unsigned NOT NULL default '0', 7 | PRIMARY KEY (`id`) 8 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 9 | 10 | INSERT INTO `glpi_plugin_additionalalerts_configs` ( `id`, `use_infocom_alert`, `use_ink_alert`, `delay_ticket_alert`) 11 | VALUES ('1','0','0','0'); 12 | 13 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_infocomalerts`; 14 | CREATE TABLE `glpi_plugin_additionalalerts_infocomalerts` ( 15 | `id` int unsigned NOT NULL auto_increment, 16 | `entities_id` int unsigned NOT NULL default '0', 17 | `use_infocom_alert` tinyint NOT NULL DEFAULT '0', 18 | PRIMARY KEY (`id`) 19 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 20 | 21 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_ticketunresolveds`; 22 | CREATE TABLE `glpi_plugin_additionalalerts_ticketunresolveds` ( 23 | `id` int unsigned NOT NULL auto_increment, 24 | `entities_id` int unsigned NOT NULL default '0', 25 | `delay_ticket_alert` int unsigned NOT NULL DEFAULT '0', 26 | PRIMARY KEY (`id`) 27 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 28 | 29 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkalerts`; 30 | CREATE TABLE `glpi_plugin_additionalalerts_inkalerts` ( 31 | `id` int unsigned NOT NULL auto_increment, 32 | `entities_id` int unsigned NOT NULL default '0', 33 | `use_ink_alert` tinyint NOT NULL DEFAULT '0', 34 | PRIMARY KEY (`id`) 35 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 36 | 37 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_notificationtypes`; 38 | CREATE TABLE `glpi_plugin_additionalalerts_notificationtypes` ( 39 | `id` int unsigned NOT NULL AUTO_INCREMENT , 40 | `types_id` int unsigned NOT NULL default '0' COMMENT 'RELATION to glpi_computertypes (id)', 41 | PRIMARY KEY (`id`) 42 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 43 | 44 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkthresholds`; 45 | CREATE TABLE `glpi_plugin_additionalalerts_inkthresholds` ( 46 | `id` int unsigned NOT NULL AUTO_INCREMENT, 47 | `cartridges_id` int unsigned NOT NULL default '0' COMMENT 'RELATION to glpi_cartridgeitems (id)', 48 | `threshold` int unsigned NOT NULL default '10', 49 | PRIMARY KEY (`id`) 50 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 51 | 52 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkprinterstates`; 53 | CREATE TABLE `glpi_plugin_additionalalerts_inkprinterstates` ( 54 | `id` int unsigned NOT NULL AUTO_INCREMENT, 55 | `states_id` int unsigned NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)', 56 | PRIMARY KEY (`id`) 57 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 58 | 59 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert infocoms', 'PluginAdditionalalertsInfocomAlert', '2010-03-13 10:44:46','',NULL, '2010-03-13 10:44:46'); 60 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert machines ocs', 'PluginAdditionalalertsOcsAlert', '2010-03-13 10:44:46','',NULL, '2010-03-13 10:44:46'); 61 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert ink level', 'PluginAdditionalalertsInkAlert', '2010-03-13 10:44:46','',NULL, '2010-03-13 10:44:46'); 62 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert Ticket Unresolved', 'PluginAdditionalalertsTicketUnresolved', '2010-03-13 10:44:46','',NULL, '2010-03-13 10:44:46'); 63 | -------------------------------------------------------------------------------- /locales/fr_FR.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Additionalalerts Development Team 3 | # This file is distributed under the same license as the GLPI - Additionalalerts plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Additionalalerts plugin\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2025-09-28 13:44+0000\n" 15 | "PO-Revision-Date: 2020-11-02 15:40+0000\n" 16 | "Last-Translator: Xavier CAILLAUD , 2020\n" 17 | "Language-Team: French (France) (https://app.transifex.com/infotelGLPI/teams/12353/fr_FR/)\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Language: fr_FR\n" 22 | "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" 23 | 24 | #: setup.php:96 src/Additionalalert.php:58 src/Menu.php:45 src/Profile.php:116 25 | msgid "Other alert" 26 | msgid_plural "Others alerts" 27 | msgstr[0] "Alerte supplémentaire" 28 | msgstr[1] "Alertes supplémentaires" 29 | msgstr[2] "Alertes supplémentaires" 30 | 31 | #: front/config.form.php:49 32 | msgid "Please activate the plugin" 33 | msgstr "Veuillez activer le plugin" 34 | 35 | #: src/Additionalalert.php:120 36 | msgid "No used alerts" 37 | msgstr "Aucune alerte utilisée" 38 | 39 | #: src/Additionalalert.php:149 40 | msgid "No computers with no buy date" 41 | msgstr "Aucune machine ayant une date d'achat vide" 42 | 43 | #: src/Additionalalert.php:167 src/Config.php:135 src/Inkalert.php:68 44 | #: src/Inkalert.php:125 src/Inkalert.php:304 src/Inkalert.php:400 45 | #: src/Notificationtargetinkalert.php:54 46 | #: src/Notificationtargetinkalert.php:124 47 | msgid "Cartridges whose level is low" 48 | msgstr "Cartouches dont le niveau d'encre est bas" 49 | 50 | #: src/Additionalalert.php:174 51 | msgid "Ink level" 52 | msgstr "Niveau d'encre" 53 | 54 | #: src/Additionalalert.php:181 55 | msgid "No cartridge is below the threshold" 56 | msgstr "Aucune cartouche n'est en dessous du niveau requis" 57 | 58 | #: src/Additionalalert.php:197 59 | msgid "Tickets unresolved since more" 60 | msgstr "Tickets non résolus depuis" 61 | 62 | #: src/Additionalalert.php:213 63 | msgid "No tickets unresolved since more" 64 | msgstr "Pas de tickets non résolus depuis" 65 | 66 | #: src/Config.php:56 src/Infocomalert.php:84 src/Inkalert.php:86 67 | msgid "Plugin setup" 68 | msgstr "Configuration du plugin" 69 | 70 | #: src/Config.php:141 71 | msgid "Unresolved Ticket Alerts" 72 | msgstr "Alerte sur les tickets non résolus par technicien" 73 | 74 | #: src/Infocomalert.php:66 75 | msgid "Computer with no buy date" 76 | msgid_plural "Computers with no buy date" 77 | msgstr[0] "Machine ayant une date d'achat vide" 78 | msgstr[1] "Machines ayant une date d'achat vide" 79 | msgstr[2] "Machines ayant une date d'achat vide" 80 | 81 | #: src/Inkprinterstate.php:59 src/Notificationtype.php:64 82 | msgid "Parameter" 83 | msgstr "Paramètre" 84 | 85 | #: src/Inkprinterstate.php:60 86 | msgid "Statutes used for the ink level" 87 | msgstr "Statuts utilisés pour le niveau d'encre" 88 | 89 | #: src/Inkthreshold.php:62 src/Inkthreshold.php:64 90 | msgid "Ink level alerts" 91 | msgstr "Alertes sur les niveaux d'encre de cartouche" 92 | 93 | #: src/Notificationtype.php:65 94 | msgid "Type not used for check of buy date" 95 | msgstr "Type non pris en compte pour le check de la date d'achat" 96 | 97 | #: src/Ticketunresolved.php:65 98 | msgid "Ticket unresolved" 99 | msgid_plural "Tickets unresolved" 100 | msgstr[0] "Ticket non résolu par technicien" 101 | msgstr[1] "Tickets non résolus par technicien" 102 | msgstr[2] "Tickets non résolus par technicien" 103 | -------------------------------------------------------------------------------- /sql/empty-1.7.1.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_configs`; 2 | CREATE TABLE `glpi_plugin_additionalalerts_configs` ( 3 | `id` int(11) NOT NULL auto_increment, 4 | `delay_ocs` int(11) NOT NULL default '-1', 5 | `use_infocom_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 6 | `use_newocs_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 7 | `use_ink_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 8 | PRIMARY KEY (`id`) 9 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 10 | 11 | INSERT INTO `glpi_plugin_additionalalerts_configs` ( `id`,`delay_ocs`,`use_infocom_alert`,`use_newocs_alert`,`use_ink_alert`) VALUES ('1','-1','-1','-1','-1'); 12 | 13 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_ocsalerts`; 14 | CREATE TABLE `glpi_plugin_additionalalerts_ocsalerts` ( 15 | `id` int(11) NOT NULL auto_increment, 16 | `entities_id` int(11) NOT NULL default '0', 17 | `delay_ocs` int(11) NOT NULL default '-1', 18 | `use_newocs_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 19 | PRIMARY KEY (`id`) 20 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 21 | 22 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_infocomalerts`; 23 | CREATE TABLE `glpi_plugin_additionalalerts_infocomalerts` ( 24 | `id` int(11) NOT NULL auto_increment, 25 | `entities_id` int(11) NOT NULL default '0', 26 | `use_infocom_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 27 | PRIMARY KEY (`id`) 28 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 29 | 30 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkalerts`; 31 | CREATE TABLE `glpi_plugin_additionalalerts_inkalerts` ( 32 | `id` int(11) NOT NULL auto_increment, 33 | `entities_id` int(11) NOT NULL default '0', 34 | `use_ink_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 35 | PRIMARY KEY (`id`) 36 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 37 | 38 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_notificationstates`; 39 | CREATE TABLE `glpi_plugin_additionalalerts_notificationstates` ( 40 | `id` int(11) NOT NULL auto_increment, 41 | `states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)', 42 | PRIMARY KEY (`id`) 43 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 44 | 45 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_notificationtypes`; 46 | CREATE TABLE `glpi_plugin_additionalalerts_notificationtypes` ( 47 | `id` INT( 11 ) NOT NULL AUTO_INCREMENT , 48 | `types_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_computertypes (id)', 49 | PRIMARY KEY (`id`) 50 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 51 | 52 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkthresholds`; 53 | CREATE TABLE `glpi_plugin_additionalalerts_inkthresholds` ( 54 | `id` int(11) NOT NULL AUTO_INCREMENT, 55 | `cartridges_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_cartridgeitems (id)', 56 | `threshold` int(3) NOT NULL default '10', 57 | PRIMARY KEY (`id`) 58 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 59 | 60 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkprinterstates`; 61 | CREATE TABLE `glpi_plugin_additionalalerts_inkprinterstates` ( 62 | `id` INT( 11 ) NOT NULL AUTO_INCREMENT, 63 | `states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)', 64 | PRIMARY KEY (`id`) 65 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 66 | 67 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert infocoms', 'PluginAdditionalalertsInfocomAlert', '2010-03-13 10:44:46','',NULL); 68 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert machines ocs', 'PluginAdditionalalertsOcsAlert', '2010-03-13 10:44:46','',NULL); 69 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert ink level', 'PluginAdditionalalertsInkAlert', '2010-03-13 10:44:46','',NULL); 70 | -------------------------------------------------------------------------------- /locales/ru_RU.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Additionalalerts Development Team 3 | # This file is distributed under the same license as the GLPI - Additionalalerts plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Additionalalerts plugin\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2025-09-28 13:44+0000\n" 15 | "PO-Revision-Date: 2020-11-02 15:40+0000\n" 16 | "Last-Translator: Xavier CAILLAUD , 2020\n" 17 | "Language-Team: Russian (Russia) (https://app.transifex.com/infotelGLPI/teams/12353/ru_RU/)\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Language: ru_RU\n" 22 | "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" 23 | 24 | #: setup.php:96 src/Additionalalert.php:58 src/Menu.php:45 src/Profile.php:116 25 | msgid "Other alert" 26 | msgid_plural "Others alerts" 27 | msgstr[0] "Другое уведомление" 28 | msgstr[1] "Другие уведомления" 29 | msgstr[2] "Другие уведомления" 30 | msgstr[3] "Другие уведомления" 31 | 32 | #: front/config.form.php:49 33 | msgid "Please activate the plugin" 34 | msgstr "Пожалуйста, активируйте плагин" 35 | 36 | #: src/Additionalalert.php:120 37 | msgid "No used alerts" 38 | msgstr "Не используемые предупреждения" 39 | 40 | #: src/Additionalalert.php:149 41 | msgid "No computers with no buy date" 42 | msgstr "Нет компьютеров с отсутствующей датой покупки" 43 | 44 | #: src/Additionalalert.php:167 src/Config.php:135 src/Inkalert.php:68 45 | #: src/Inkalert.php:125 src/Inkalert.php:304 src/Inkalert.php:400 46 | #: src/Notificationtargetinkalert.php:54 47 | #: src/Notificationtargetinkalert.php:124 48 | msgid "Cartridges whose level is low" 49 | msgstr "Картриджи, с малым содержанием тонера" 50 | 51 | #: src/Additionalalert.php:174 52 | msgid "Ink level" 53 | msgstr "Уровень чернил" 54 | 55 | #: src/Additionalalert.php:181 56 | msgid "No cartridge is below the threshold" 57 | msgstr "Нет картриджей ниже данного порога" 58 | 59 | #: src/Additionalalert.php:197 60 | msgid "Tickets unresolved since more" 61 | msgstr "Нерешенных заявок более чем" 62 | 63 | #: src/Additionalalert.php:213 64 | msgid "No tickets unresolved since more" 65 | msgstr "Нерешенных заявок не более чем" 66 | 67 | #: src/Config.php:56 src/Infocomalert.php:84 src/Inkalert.php:86 68 | msgid "Plugin setup" 69 | msgstr "Настройки плагина" 70 | 71 | #: src/Config.php:141 72 | msgid "Unresolved Ticket Alerts" 73 | msgstr "Оповещения о нерешенной заявке" 74 | 75 | #: src/Infocomalert.php:66 76 | msgid "Computer with no buy date" 77 | msgid_plural "Computers with no buy date" 78 | msgstr[0] "ПК без даты покупки" 79 | msgstr[1] "ПК без даты покупки" 80 | msgstr[2] "ПК без даты покупки" 81 | msgstr[3] "Компьютеры без даты покупки" 82 | 83 | #: src/Inkprinterstate.php:59 src/Notificationtype.php:64 84 | msgid "Parameter" 85 | msgstr "Параметр" 86 | 87 | #: src/Inkprinterstate.php:60 88 | msgid "Statutes used for the ink level" 89 | msgstr "Статусы для уровня чернил" 90 | 91 | #: src/Inkthreshold.php:62 src/Inkthreshold.php:64 92 | msgid "Ink level alerts" 93 | msgstr "Уровень чернил для предупреждения" 94 | 95 | #: src/Notificationtype.php:65 96 | msgid "Type not used for check of buy date" 97 | msgstr "Тип не используется для проверки даты покупки" 98 | 99 | #: src/Ticketunresolved.php:65 100 | msgid "Ticket unresolved" 101 | msgid_plural "Tickets unresolved" 102 | msgstr[0] "Нерешенная заявка" 103 | msgstr[1] "Нерешенные заявки" 104 | msgstr[2] "Нерешенных заявок" 105 | msgstr[3] "Нерешенные заявки" 106 | -------------------------------------------------------------------------------- /locales/ro_RO.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Additionalalerts Development Team 3 | # This file is distributed under the same license as the GLPI - Additionalalerts plugin package. 4 | # 5 | # Translators: 6 | # Doru DEACONU , 2014-2015 7 | # Doru DEACONU , 2013 8 | msgid "" 9 | msgstr "" 10 | "Project-Id-Version: GLPI Project - additionalalerts plugin\n" 11 | "Report-Msgid-Bugs-To: \n" 12 | "POT-Creation-Date: 2018-10-11 12:28+0200\n" 13 | "PO-Revision-Date: 2018-10-11 10:30+0000\n" 14 | "Last-Translator: Amandine Manceau\n" 15 | "Language-Team: Romanian (Romania) (http://www.transifex.com/tsmr/GLPI_additionalalerts/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 | #: setup.php:74 inc/additionalalert.class.php:48 inc/menu.class.php:41 23 | #: inc/profile.class.php:92 24 | msgid "Other alert" 25 | msgid_plural "Others alerts" 26 | msgstr[0] "Altă alertă" 27 | msgstr[1] "Alte alerte" 28 | msgstr[2] "Alte alerte" 29 | 30 | #: front/config.form.php:49 31 | msgid "Please activate the plugin" 32 | msgstr "" 33 | 34 | #: inc/additionalalert.class.php:110 35 | msgid "No used alerts" 36 | msgstr "Nu utiliza alerte" 37 | 38 | #: inc/additionalalert.class.php:142 39 | msgid "No computers with no buy date" 40 | msgstr "Nici un calculator fără dată de cumpărare " 41 | 42 | #: inc/additionalalert.class.php:163 inc/config.class.php:122 43 | #: inc/inkalert.class.php:48 inc/inkalert.class.php:98 44 | #: inc/inkalert.class.php:276 inc/inkalert.class.php:397 45 | #: inc/notificationtargetinkalert.class.php:45 46 | #: inc/notificationtargetinkalert.class.php:104 47 | msgid "Cartridges whose level is low" 48 | msgstr "Cartușe al căror nivel este scăzut" 49 | 50 | #: inc/additionalalert.class.php:170 51 | msgid "Ink level" 52 | msgstr "Nivel Ink" 53 | 54 | #: inc/additionalalert.class.php:177 55 | msgid "No cartridge is below the threshold" 56 | msgstr "Niciun cartuș nu este sub prag" 57 | 58 | #: inc/additionalalert.class.php:181 inc/inkthreshold.class.php:55 59 | #: inc/inkthreshold.class.php:58 60 | msgid "Ink level alerts" 61 | msgstr "Alerta nivel Ink" 62 | 63 | #: inc/additionalalert.class.php:181 inc/config.class.php:128 64 | #: inc/inkalert.class.php:404 inc/inkthreshold.class.php:69 65 | msgid "Fusioninventory plugin is not installed" 66 | msgstr "Fusioninventory plugin nu este instalat" 67 | 68 | #: inc/additionalalert.class.php:197 69 | msgid "Tickets unresolved since more" 70 | msgstr "" 71 | 72 | #: inc/additionalalert.class.php:213 73 | msgid "No tickets unresolved since more" 74 | msgstr "" 75 | 76 | #: inc/config.class.php:46 inc/infocomalert.class.php:60 77 | #: inc/inkalert.class.php:60 78 | msgid "Plugin setup" 79 | msgstr "Setare plugin" 80 | 81 | #: inc/config.class.php:133 82 | msgid "Unresolved Ticket Alerts" 83 | msgstr "" 84 | 85 | #: inc/infocomalert.class.php:48 86 | msgid "Computer with no buy date" 87 | msgid_plural "Computers with no buy date" 88 | msgstr[0] "Calculator fără dată de cumpărare" 89 | msgstr[1] "Calculatoare fără dată de cumpărare" 90 | msgstr[2] "Calculatoare fără dată de cumpărare" 91 | 92 | #: inc/infocomalert.class.php:351 inc/inkalert.class.php:331 93 | msgid "Parameter" 94 | msgstr "Parametru" 95 | 96 | #: inc/infocomalert.class.php:352 97 | msgid "Type not used for check of buy date" 98 | msgstr "Tip nefolosit pentru verificarea datei de cumpărare" 99 | 100 | #: inc/inkalert.class.php:332 101 | msgid "Statutes used for the ink level" 102 | msgstr "Statusuri folosite pentru nivelul ink" 103 | 104 | #: inc/ticketunresolved.class.php:48 105 | msgid "Ticket unresolved" 106 | msgid_plural "Tickets unresolved" 107 | msgstr[0] "" 108 | msgstr[1] "" 109 | msgstr[2] "" 110 | -------------------------------------------------------------------------------- /locales/cs_CZ.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Additionalalerts Development Team 3 | # This file is distributed under the same license as the GLPI - Additionalalerts plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # David Stepan , 2020 9 | # 10 | #, fuzzy 11 | msgid "" 12 | msgstr "" 13 | "Project-Id-Version: GLPI - Additionalalerts plugin\n" 14 | "Report-Msgid-Bugs-To: \n" 15 | "POT-Creation-Date: 2025-09-28 13:44+0000\n" 16 | "PO-Revision-Date: 2020-11-02 15:40+0000\n" 17 | "Last-Translator: David Stepan , 2020\n" 18 | "Language-Team: Czech (Czech Republic) (https://app.transifex.com/infotelGLPI/teams/12353/cs_CZ/)\n" 19 | "MIME-Version: 1.0\n" 20 | "Content-Type: text/plain; charset=UTF-8\n" 21 | "Content-Transfer-Encoding: 8bit\n" 22 | "Language: cs_CZ\n" 23 | "Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n" 24 | 25 | #: setup.php:96 src/Additionalalert.php:58 src/Menu.php:45 src/Profile.php:116 26 | msgid "Other alert" 27 | msgid_plural "Others alerts" 28 | msgstr[0] "Další upozornění" 29 | msgstr[1] "Další upozornění" 30 | msgstr[2] "Dalších upozornění" 31 | msgstr[3] "Další upozornění" 32 | 33 | #: front/config.form.php:49 34 | msgid "Please activate the plugin" 35 | msgstr "Zapněte zásuvný modul" 36 | 37 | #: src/Additionalalert.php:120 38 | msgid "No used alerts" 39 | msgstr "Nepoužívá se žádné upozorňování" 40 | 41 | #: src/Additionalalert.php:149 42 | msgid "No computers with no buy date" 43 | msgstr "Žádné počítače s nevyplněným datem nákupu" 44 | 45 | #: src/Additionalalert.php:167 src/Config.php:135 src/Inkalert.php:68 46 | #: src/Inkalert.php:125 src/Inkalert.php:304 src/Inkalert.php:400 47 | #: src/Notificationtargetinkalert.php:54 48 | #: src/Notificationtargetinkalert.php:124 49 | msgid "Cartridges whose level is low" 50 | msgstr "Náplně ve kterých je málo inkoustu/toneru" 51 | 52 | #: src/Additionalalert.php:174 53 | msgid "Ink level" 54 | msgstr "Úroveň množství inkoustu/toneru" 55 | 56 | #: src/Additionalalert.php:181 57 | msgid "No cartridge is below the threshold" 58 | msgstr "Žádná náplň není pod hranicí" 59 | 60 | #: src/Additionalalert.php:197 61 | msgid "Tickets unresolved since more" 62 | msgstr "Požadavky nevyřešené déle než" 63 | 64 | #: src/Additionalalert.php:213 65 | msgid "No tickets unresolved since more" 66 | msgstr "Žádné požadavky nevyřešené déle než" 67 | 68 | #: src/Config.php:56 src/Infocomalert.php:84 src/Inkalert.php:86 69 | msgid "Plugin setup" 70 | msgstr "Nastavení zásuvného modulu" 71 | 72 | #: src/Config.php:141 73 | msgid "Unresolved Ticket Alerts" 74 | msgstr "Upozornění na nevyřešené požadavky" 75 | 76 | #: src/Infocomalert.php:66 77 | msgid "Computer with no buy date" 78 | msgid_plural "Computers with no buy date" 79 | msgstr[0] "Počítač s nevyplněným datem nákupu" 80 | msgstr[1] "Počítače s nevyplněným datem nákupu" 81 | msgstr[2] "Počítačů s nevyplněným datem nákupu" 82 | msgstr[3] "Počítače s nevyplněným datem nákupu" 83 | 84 | #: src/Inkprinterstate.php:59 src/Notificationtype.php:64 85 | msgid "Parameter" 86 | msgstr "Parametr" 87 | 88 | #: src/Inkprinterstate.php:60 89 | msgid "Statutes used for the ink level" 90 | msgstr "Pravidla použitá pro stav inkoustu/toneru" 91 | 92 | #: src/Inkthreshold.php:62 src/Inkthreshold.php:64 93 | msgid "Ink level alerts" 94 | msgstr "Upozorňování na úrovně inkoustu/toneru" 95 | 96 | #: src/Notificationtype.php:65 97 | msgid "Type not used for check of buy date" 98 | msgstr "Typ, který se nepoužívá pro kontrolu data nákupu" 99 | 100 | #: src/Ticketunresolved.php:65 101 | msgid "Ticket unresolved" 102 | msgid_plural "Tickets unresolved" 103 | msgstr[0] "Nevyřešený požadavek" 104 | msgstr[1] "Nevyřešené požadavky" 105 | msgstr[2] "Nevyřešených požadavků" 106 | msgstr[3] "Nevyřešené požadavky" 107 | -------------------------------------------------------------------------------- /setup.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | use GlpiPlugin\Additionalalerts\Config; 31 | use GlpiPlugin\Additionalalerts\InfocomAlert; 32 | use GlpiPlugin\Additionalalerts\InkAlert; 33 | use GlpiPlugin\Additionalalerts\Menu; 34 | use GlpiPlugin\Additionalalerts\Profile; 35 | use GlpiPlugin\Additionalalerts\TicketUnresolved; 36 | 37 | define('PLUGIN_ADDITIONALALERTS_VERSION', '3.0.3'); 38 | 39 | global $CFG_GLPI; 40 | 41 | if (!defined("PLUGIN_ADDITIONALALERTS_DIR")) { 42 | define("PLUGIN_ADDITIONALALERTS_DIR", Plugin::getPhpDir("additionalalerts")); 43 | $root = $CFG_GLPI['root_doc'] . '/plugins/additionalalerts'; 44 | define("PLUGIN_ADDITIONALALERTS_WEBDIR", $root); 45 | } 46 | 47 | // Init the hooks of the plugins -Needed 48 | function plugin_init_additionalalerts() 49 | { 50 | global $PLUGIN_HOOKS; 51 | 52 | $PLUGIN_HOOKS['csrf_compliant']['additionalalerts'] = true; 53 | $PLUGIN_HOOKS['change_profile']['additionalalerts'] = [Profile::class, 'initProfile']; 54 | 55 | Plugin::registerClass(InfocomAlert::class, [ 56 | 'notificationtemplates_types' => true, 57 | 'addtabon' => 'CronTask' 58 | ]); 59 | 60 | Plugin::registerClass(TicketUnresolved::class, [ 61 | 'notificationtemplates_types' => true 62 | ]); 63 | 64 | Plugin::registerClass(InkAlert::class, [ 65 | 'notificationtemplates_types' => true, 66 | 'addtabon' => ['Printer', 'CronTask'] 67 | ]); 68 | 69 | Plugin::registerClass( 70 | Profile::class, 71 | ['addtabon' => 'Profile'] 72 | ); 73 | 74 | Plugin::registerClass( 75 | Config::class, 76 | ['addtabon' => ['NotificationMailingSetting', 'Entity']] 77 | ); 78 | 79 | if (Session::getLoginUserID()) { 80 | // Display a menu entry ? 81 | if (Session::haveRight("plugin_additionalalerts", READ)) { 82 | $PLUGIN_HOOKS['config_page']['additionalalerts'] = 'front/config.form.php'; 83 | $PLUGIN_HOOKS["menu_toadd"]['additionalalerts']['admin'] = Menu::class; 84 | } 85 | } 86 | } 87 | 88 | // Get the name and the version of the plugin - Needed 89 | /** 90 | * @return array 91 | */ 92 | function plugin_version_additionalalerts() 93 | { 94 | 95 | return [ 96 | 'name' => _n('Other alert', 'Others alerts', 2, 'additionalalerts'), 97 | 'version' => PLUGIN_ADDITIONALALERTS_VERSION, 98 | 'license' => 'GPLv2+', 99 | 'oldname' => 'alerting', 100 | 'author' => "Infotel / Konstantin Kabassanov", 101 | 'oldname' => 'alerting', 102 | 'homepage' => 'https://github.com/InfotelGLPI/additionalalerts', 103 | 'requirements' => [ 104 | 'glpi' => [ 105 | 'min' => '11.0', 106 | 'max' => '12.0', 107 | 'dev' => false 108 | ] 109 | ] 110 | ]; 111 | } 112 | -------------------------------------------------------------------------------- /src/InkPrinterState.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | namespace GlpiPlugin\Additionalalerts; 31 | 32 | use Dropdown; 33 | use Html; 34 | 35 | if (!defined('GLPI_ROOT')) { 36 | die("Sorry. You can't access directly to this file"); 37 | } 38 | 39 | /** 40 | * Class InkPrinterState 41 | */ 42 | class InkPrinterState extends NotificationState { 43 | static $rightname = "plugin_additionalalerts"; 44 | 45 | function configState() 46 | { 47 | $target = PLUGIN_ADDITIONALALERTS_WEBDIR . "/front/inkalert.form.php"; 48 | $state = new InkPrinterState(); 49 | $states = $state->find(); 50 | $used = []; 51 | foreach ($states as $data) { 52 | $used[] = $data['states_id']; 53 | } 54 | 55 | echo "
"; 56 | echo ""; 57 | echo ""; 58 | echo ""; 59 | echo ""; 60 | echo ""; 66 | echo ""; 67 | echo "
" . __('Parameter', 'additionalalerts') . "" . __('Statutes used for the ink level', 'additionalalerts') . " : "; 61 | Dropdown::show('State', ['name' => "states_id", 62 | 'used' => $used]); 63 | echo " "; 64 | echo Html::submit(_sx('button', 'Update'), ['name' => 'add_state', 'class' => 'btn btn-primary']); 65 | echo "
"; 68 | Html::closeForm(); 69 | echo "
"; 70 | 71 | $rand = mt_rand(); 72 | 73 | $data = $this->find([], ["states_id ASC"]); 74 | 75 | if (count($data) != 0) { 76 | Html::openMassiveActionsForm('mass' . "InkPrinterState" . $rand); 77 | $massiveactionparams = [ 78 | 'item' => __CLASS__, 79 | 'container' => 'mass' . "InkPrinterState" . $rand 80 | ]; 81 | Html::showMassiveActions($massiveactionparams); 82 | 83 | echo "
"; 84 | echo ""; 85 | echo ""; 86 | echo ""; 87 | echo ""; 88 | echo ""; 89 | echo ""; 90 | foreach ($data as $ligne) { 91 | echo ""; 92 | echo ""; 95 | echo ""; 96 | echo ""; 97 | } 98 | 99 | $massiveactionparams['ontop'] = false; 100 | 101 | echo "
" . Html::getCheckAllAsCheckbox('mass' . "InkPrinterState" . $rand) . "" . _n('State', 'States', 2) . "
"; 93 | Html::showMassiveActionCheckBox(__CLASS__, $ligne["id"]); 94 | echo "" . Dropdown::getDropdownName("glpi_states", $ligne["states_id"]) . "
"; 102 | Html::closeForm(); 103 | echo "
"; 104 | 105 | Html::showMassiveActions($massiveactionparams); 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /sql/empty-1.8.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_configs`; 2 | CREATE TABLE `glpi_plugin_additionalalerts_configs` ( 3 | `id` int(11) NOT NULL auto_increment, 4 | `delay_ocs` int(11) NOT NULL default '-1', 5 | `use_infocom_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 6 | `use_newocs_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 7 | `use_ink_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 8 | `delay_ticket_alert` int(11) NOT NULL default '-1', 9 | PRIMARY KEY (`id`) 10 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 11 | 12 | INSERT INTO `glpi_plugin_additionalalerts_configs` ( `id`,`delay_ocs`,`use_infocom_alert`,`use_newocs_alert`,`use_ink_alert`, `delay_ticket_alert`) VALUES ('1','-1','-1','-1','-1', '-1'); 13 | 14 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_ocsalerts`; 15 | CREATE TABLE `glpi_plugin_additionalalerts_ocsalerts` ( 16 | `id` int(11) NOT NULL auto_increment, 17 | `entities_id` int(11) NOT NULL default '0', 18 | `delay_ocs` int(11) NOT NULL default '-1', 19 | `use_newocs_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 20 | PRIMARY KEY (`id`) 21 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 22 | 23 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_infocomalerts`; 24 | CREATE TABLE `glpi_plugin_additionalalerts_infocomalerts` ( 25 | `id` int(11) NOT NULL auto_increment, 26 | `entities_id` int(11) NOT NULL default '0', 27 | `use_infocom_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 28 | PRIMARY KEY (`id`) 29 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 30 | 31 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_ticketunresolveds`; 32 | CREATE TABLE `glpi_plugin_additionalalerts_ticketunresolveds` ( 33 | `id` int(11) NOT NULL auto_increment, 34 | `entities_id` int(11) NOT NULL default '0', 35 | `delay_ticket_alert` int(11) NOT NULL DEFAULT '-1', 36 | PRIMARY KEY (`id`) 37 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 38 | 39 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkalerts`; 40 | CREATE TABLE `glpi_plugin_additionalalerts_inkalerts` ( 41 | `id` int(11) NOT NULL auto_increment, 42 | `entities_id` int(11) NOT NULL default '0', 43 | `use_ink_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 44 | PRIMARY KEY (`id`) 45 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 46 | 47 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_notificationstates`; 48 | CREATE TABLE `glpi_plugin_additionalalerts_notificationstates` ( 49 | `id` int(11) NOT NULL auto_increment, 50 | `states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)', 51 | PRIMARY KEY (`id`) 52 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 53 | 54 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_notificationtypes`; 55 | CREATE TABLE `glpi_plugin_additionalalerts_notificationtypes` ( 56 | `id` INT( 11 ) NOT NULL AUTO_INCREMENT , 57 | `types_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_computertypes (id)', 58 | PRIMARY KEY (`id`) 59 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 60 | 61 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkthresholds`; 62 | CREATE TABLE `glpi_plugin_additionalalerts_inkthresholds` ( 63 | `id` int(11) NOT NULL AUTO_INCREMENT, 64 | `cartridges_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_cartridgeitems (id)', 65 | `threshold` int(3) NOT NULL default '10', 66 | PRIMARY KEY (`id`) 67 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 68 | 69 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkprinterstates`; 70 | CREATE TABLE `glpi_plugin_additionalalerts_inkprinterstates` ( 71 | `id` INT( 11 ) NOT NULL AUTO_INCREMENT, 72 | `states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)', 73 | PRIMARY KEY (`id`) 74 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 75 | 76 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert infocoms', 'PluginAdditionalalertsInfocomAlert', '2010-03-13 10:44:46','',NULL); 77 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert machines ocs', 'PluginAdditionalalertsOcsAlert', '2010-03-13 10:44:46','',NULL); 78 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert ink level', 'PluginAdditionalalertsInkAlert', '2010-03-13 10:44:46','',NULL); 79 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert Ticket Unresolved', 'PluginAdditionalalertsTicketUnresolved', '2010-03-13 10:44:46','',NULL); -------------------------------------------------------------------------------- /sql/empty-1.9.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_configs`; 2 | CREATE TABLE `glpi_plugin_additionalalerts_configs` ( 3 | `id` int(11) NOT NULL auto_increment, 4 | `delay_ocs` int(11) NOT NULL default '-1', 5 | `use_infocom_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 6 | `use_newocs_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 7 | `use_ink_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 8 | `delay_ticket_alert` int(11) NOT NULL default '0', 9 | PRIMARY KEY (`id`) 10 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 11 | 12 | INSERT INTO `glpi_plugin_additionalalerts_configs` ( `id`,`delay_ocs`,`use_infocom_alert`,`use_newocs_alert`,`use_ink_alert`, `delay_ticket_alert`) 13 | VALUES ('1','-1','-1','-1','-1', '0'); 14 | 15 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_ocsalerts`; 16 | CREATE TABLE `glpi_plugin_additionalalerts_ocsalerts` ( 17 | `id` int(11) NOT NULL auto_increment, 18 | `entities_id` int(11) NOT NULL default '0', 19 | `delay_ocs` int(11) NOT NULL default '-1', 20 | `use_newocs_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 21 | PRIMARY KEY (`id`) 22 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 23 | 24 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_infocomalerts`; 25 | CREATE TABLE `glpi_plugin_additionalalerts_infocomalerts` ( 26 | `id` int(11) NOT NULL auto_increment, 27 | `entities_id` int(11) NOT NULL default '0', 28 | `use_infocom_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 29 | PRIMARY KEY (`id`) 30 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 31 | 32 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_ticketunresolveds`; 33 | CREATE TABLE `glpi_plugin_additionalalerts_ticketunresolveds` ( 34 | `id` int(11) NOT NULL auto_increment, 35 | `entities_id` int(11) NOT NULL default '0', 36 | `delay_ticket_alert` int(11) NOT NULL DEFAULT '-1', 37 | PRIMARY KEY (`id`) 38 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 39 | 40 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkalerts`; 41 | CREATE TABLE `glpi_plugin_additionalalerts_inkalerts` ( 42 | `id` int(11) NOT NULL auto_increment, 43 | `entities_id` int(11) NOT NULL default '0', 44 | `use_ink_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 45 | PRIMARY KEY (`id`) 46 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 47 | 48 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_notificationstates`; 49 | CREATE TABLE `glpi_plugin_additionalalerts_notificationstates` ( 50 | `id` int(11) NOT NULL auto_increment, 51 | `states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)', 52 | PRIMARY KEY (`id`) 53 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 54 | 55 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_notificationtypes`; 56 | CREATE TABLE `glpi_plugin_additionalalerts_notificationtypes` ( 57 | `id` INT( 11 ) NOT NULL AUTO_INCREMENT , 58 | `types_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_computertypes (id)', 59 | PRIMARY KEY (`id`) 60 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 61 | 62 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkthresholds`; 63 | CREATE TABLE `glpi_plugin_additionalalerts_inkthresholds` ( 64 | `id` int(11) NOT NULL AUTO_INCREMENT, 65 | `cartridges_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_cartridgeitems (id)', 66 | `threshold` int(3) NOT NULL default '10', 67 | PRIMARY KEY (`id`) 68 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 69 | 70 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkprinterstates`; 71 | CREATE TABLE `glpi_plugin_additionalalerts_inkprinterstates` ( 72 | `id` INT( 11 ) NOT NULL AUTO_INCREMENT, 73 | `states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)', 74 | PRIMARY KEY (`id`) 75 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 76 | 77 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert infocoms', 'PluginAdditionalalertsInfocomAlert', '2010-03-13 10:44:46','',NULL, '2010-03-13 10:44:46'); 78 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert machines ocs', 'PluginAdditionalalertsOcsAlert', '2010-03-13 10:44:46','',NULL, '2010-03-13 10:44:46'); 79 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert ink level', 'PluginAdditionalalertsInkAlert', '2010-03-13 10:44:46','',NULL, '2010-03-13 10:44:46'); 80 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert Ticket Unresolved', 'PluginAdditionalalertsTicketUnresolved', '2010-03-13 10:44:46','',NULL, '2010-03-13 10:44:46'); -------------------------------------------------------------------------------- /sql/empty-2.1.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_configs`; 2 | CREATE TABLE `glpi_plugin_additionalalerts_configs` ( 3 | `id` int(11) NOT NULL auto_increment, 4 | `delay_ocs` int(11) NOT NULL default '-1', 5 | `use_infocom_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 6 | `use_newocs_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 7 | `use_ink_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 8 | `delay_ticket_alert` int(11) NOT NULL default '0', 9 | PRIMARY KEY (`id`) 10 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 11 | 12 | INSERT INTO `glpi_plugin_additionalalerts_configs` ( `id`,`delay_ocs`,`use_infocom_alert`,`use_newocs_alert`,`use_ink_alert`, `delay_ticket_alert`) 13 | VALUES ('1','-1','-1','-1','-1', '0'); 14 | 15 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_ocsalerts`; 16 | CREATE TABLE `glpi_plugin_additionalalerts_ocsalerts` ( 17 | `id` int(11) NOT NULL auto_increment, 18 | `entities_id` int(11) NOT NULL default '0', 19 | `delay_ocs` int(11) NOT NULL default '-1', 20 | `use_newocs_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 21 | PRIMARY KEY (`id`) 22 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 23 | 24 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_infocomalerts`; 25 | CREATE TABLE `glpi_plugin_additionalalerts_infocomalerts` ( 26 | `id` int(11) NOT NULL auto_increment, 27 | `entities_id` int(11) NOT NULL default '0', 28 | `use_infocom_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 29 | PRIMARY KEY (`id`) 30 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 31 | 32 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_ticketunresolveds`; 33 | CREATE TABLE `glpi_plugin_additionalalerts_ticketunresolveds` ( 34 | `id` int(11) NOT NULL auto_increment, 35 | `entities_id` int(11) NOT NULL default '0', 36 | `delay_ticket_alert` int(11) NOT NULL DEFAULT '-1', 37 | PRIMARY KEY (`id`) 38 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 39 | 40 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkalerts`; 41 | CREATE TABLE `glpi_plugin_additionalalerts_inkalerts` ( 42 | `id` int(11) NOT NULL auto_increment, 43 | `entities_id` int(11) NOT NULL default '0', 44 | `use_ink_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', 45 | PRIMARY KEY (`id`) 46 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 47 | 48 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_notificationstates`; 49 | CREATE TABLE `glpi_plugin_additionalalerts_notificationstates` ( 50 | `id` int(11) NOT NULL auto_increment, 51 | `states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)', 52 | PRIMARY KEY (`id`) 53 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 54 | 55 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_notificationtypes`; 56 | CREATE TABLE `glpi_plugin_additionalalerts_notificationtypes` ( 57 | `id` INT( 11 ) NOT NULL AUTO_INCREMENT , 58 | `types_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_computertypes (id)', 59 | PRIMARY KEY (`id`) 60 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 61 | 62 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkthresholds`; 63 | CREATE TABLE `glpi_plugin_additionalalerts_inkthresholds` ( 64 | `id` int(11) NOT NULL AUTO_INCREMENT, 65 | `cartridges_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_cartridgeitems (id)', 66 | `threshold` int(3) NOT NULL default '10', 67 | PRIMARY KEY (`id`) 68 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 69 | 70 | DROP TABLE IF EXISTS `glpi_plugin_additionalalerts_inkprinterstates`; 71 | CREATE TABLE `glpi_plugin_additionalalerts_inkprinterstates` ( 72 | `id` INT( 11 ) NOT NULL AUTO_INCREMENT, 73 | `states_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_states (id)', 74 | PRIMARY KEY (`id`) 75 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 76 | 77 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert infocoms', 'PluginAdditionalalertsInfocomAlert', '2010-03-13 10:44:46','',NULL, '2010-03-13 10:44:46'); 78 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert machines ocs', 'PluginAdditionalalertsOcsAlert', '2010-03-13 10:44:46','',NULL, '2010-03-13 10:44:46'); 79 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert ink level', 'PluginAdditionalalertsInkAlert', '2010-03-13 10:44:46','',NULL, '2010-03-13 10:44:46'); 80 | INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert Ticket Unresolved', 'PluginAdditionalalertsTicketUnresolved', '2010-03-13 10:44:46','',NULL, '2010-03-13 10:44:46'); -------------------------------------------------------------------------------- /src/NotificationState.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | namespace GlpiPlugin\Additionalalerts; 31 | 32 | use CommonDBTM; 33 | use Dropdown; 34 | use Html; 35 | use MassiveAction; 36 | 37 | if (!defined('GLPI_ROOT')) { 38 | die("Sorry. You can't access directly to this file"); 39 | } 40 | 41 | /** 42 | * Class NotificationState 43 | */ 44 | class NotificationState extends CommonDBTM 45 | { 46 | 47 | static $rightname = "plugin_additionalalerts"; 48 | 49 | 50 | /** 51 | * Get the standard massive actions which are forbidden 52 | * 53 | * @since version 0.84 54 | * 55 | * @return array of massive actions 56 | **/ 57 | public function getForbiddenStandardMassiveAction() 58 | { 59 | 60 | $forbidden = parent::getForbiddenStandardMassiveAction(); 61 | $forbidden[] = 'update'; 62 | return $forbidden; 63 | } 64 | 65 | /** 66 | * Get the specific massive actions 67 | * 68 | * @since version 0.84 69 | * 70 | * @param $checkitem link item to check right (default NULL) 71 | * 72 | * @return an $array of massive actions 73 | */ 74 | public function getSpecificMassiveActions($checkitem = null) 75 | { 76 | 77 | 78 | $actions[NotificationState::class . MassiveAction::CLASS_ACTION_SEPARATOR . 'purge'] = __('Delete'); 79 | 80 | return $actions; 81 | } 82 | 83 | /** 84 | * @param MassiveAction $ma 85 | * 86 | * @return bool|false 87 | */ 88 | /** 89 | * @param MassiveAction $ma 90 | * 91 | * @return bool|false 92 | */ 93 | static function showMassiveActionsSubForm(MassiveAction $ma) 94 | { 95 | 96 | switch ($ma->getAction()) { 97 | case 'purge': 98 | echo Html::submit(_x('button', 'Post'), ['name' => 'massiveaction', 'class' => 'btn btn-primary']); 99 | return true; 100 | } 101 | return parent::showMassiveActionsSubForm($ma); 102 | } 103 | 104 | /** 105 | * @since version 0.85 106 | * 107 | * @see CommonDBTM::processMassiveActionsForOneItemtype() 108 | * 109 | * @param MassiveAction $ma 110 | * @param CommonDBTM $item 111 | * @param array $ids 112 | * 113 | * @return nothing|void 114 | */ 115 | static function processMassiveActionsForOneItemtype( 116 | MassiveAction $ma, 117 | CommonDBTM $item, 118 | array $ids 119 | ) { 120 | 121 | switch ($ma->getAction()) { 122 | case "purge": 123 | foreach ($ids as $key) { 124 | if ($item->can($key, UPDATE)) { 125 | if ($item->delete(['id' => $key])) { 126 | $ma->itemDone($item->getType(), $key, MassiveAction::ACTION_OK); 127 | } else { 128 | $ma->itemDone($item->getType(), $key, MassiveAction::ACTION_KO); 129 | } 130 | } else { 131 | $ma->itemDone($item->getType(), $key, MassiveAction::ACTION_NORIGHT); 132 | $ma->addMessage($item->getErrorMessage(ERROR_RIGHT)); 133 | } 134 | } 135 | break; 136 | } 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /src/NotificationTargetTicketUnresolved.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | namespace GlpiPlugin\Additionalalerts; 31 | 32 | use Notification; 33 | use NotificationTarget; 34 | use Ticket; 35 | use User; 36 | 37 | if (!defined('GLPI_ROOT')) { 38 | die("Sorry. You can't access directly to this file"); 39 | } 40 | 41 | /** 42 | * Class NotificationTargetTicketUnresolved 43 | */ 44 | class NotificationTargetTicketUnresolved extends NotificationTarget { 45 | 46 | static $rightname = "plugin_additionalalerts"; 47 | 48 | /** 49 | * @return array 50 | */ 51 | function getEvents() { 52 | return ['ticketunresolved' => TicketUnresolved::getTypeName(2)]; 53 | } 54 | 55 | /** 56 | * Get tags 57 | */ 58 | function getTags() { 59 | 60 | // Get ticket tags 61 | $notificationTargetTicket = NotificationTarget::getInstance(new Ticket(), 'alertnotclosed', []); 62 | $notificationTargetTicket->getTags(); 63 | $this->tag_descriptions = $notificationTargetTicket->tag_descriptions; 64 | 65 | asort($this->tag_descriptions); 66 | } 67 | 68 | /** 69 | * Get datas for template 70 | * 71 | * @param $event 72 | * @param array $options 73 | */ 74 | function addDataForTemplate($event, $options = []) { 75 | 76 | // Add ticket translation 77 | $ticket = new Ticket(); 78 | $ticket->getEmpty(); 79 | 80 | $notificationTargetTicket = NotificationTarget::getInstance($ticket, 'ticketunresolved', $options); 81 | $notificationTargetTicket->obj->fields['id'] = 0; 82 | $notificationTargetTicket->addDataForTemplate('alertnotclosed', $options); 83 | 84 | $this->data = $notificationTargetTicket->data; 85 | 86 | } 87 | 88 | /** 89 | * Get additionnals targets for ITIL objects 90 | * 91 | * @param $event (default '') 92 | **/ 93 | function addAdditionalTargets($event = '') { 94 | $this->notification_targets = []; 95 | $this->notification_targets_labels = []; 96 | 97 | $this->addTarget(Notification::SUPERVISOR_ASSIGN_GROUP, 98 | __('Manager of the group in charge of the ticket')); 99 | 100 | $this->addTarget(Notification::ASSIGN_TECH, __('Technician in charge of the ticket')); 101 | } 102 | 103 | /** 104 | * @param $data 105 | * @param $options 106 | */ 107 | public function addSpecificTargets($data, $options) { 108 | 109 | $items = reset($options['items']); 110 | //Look for all targets whose type is Notification::ITEM_USER 111 | switch ($data['items_id']) { 112 | 113 | case Notification::SUPERVISOR_ASSIGN_GROUP : 114 | case Notification::ASSIGN_TECH : 115 | return $this->addUserByID("users_id", $items); 116 | } 117 | } 118 | 119 | public function addUserByID($field, $items = []) { 120 | global $DB; 121 | 122 | if (!empty($items[$field])) { 123 | //Look for the user by his id 124 | $criteria = $this->getDistinctUserCriteria() + $this->getProfileJoinCriteria(); 125 | $criteria['FROM'] = User::getTable(); 126 | $criteria['WHERE'][User::getTable() . '.id'] = $items[$field]; 127 | $iterator = $DB->request($criteria); 128 | 129 | foreach ($iterator as $data) { 130 | //Add the user email and language in the notified users list 131 | $this->addToRecipientsList($data); 132 | $iterator->next(); 133 | } 134 | } 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /src/NotificationTargetInkAlert.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | namespace GlpiPlugin\Additionalalerts; 31 | 32 | use Cartridge; 33 | use CartridgeItem; 34 | use Dropdown; 35 | use NotificationTarget; 36 | use Printer; 37 | use Printer_CartridgeInfo; 38 | 39 | if (!defined('GLPI_ROOT')) { 40 | die("Sorry. You can't access directly to this file"); 41 | } 42 | 43 | /** 44 | * Class NotificationTargetInkAlert 45 | */ 46 | class NotificationTargetInkAlert extends NotificationTarget 47 | { 48 | 49 | /** 50 | * @return array 51 | */ 52 | function getEvents() 53 | { 54 | return ['ink' => __('Cartridges whose level is low', 'additionalalerts')]; 55 | } 56 | 57 | /** 58 | * @param $event 59 | * @param array $options 60 | */ 61 | function addDataForTemplate($event, $options = []) 62 | { 63 | global $CFG_GLPI; 64 | 65 | $this->data['##ink.entity##'] = Dropdown::getDropdownName('glpi_entities', $options['entities_id']); 66 | $this->data['##lang.ink.entity##'] = __('Entity'); 67 | 68 | $events = $this->getAllEvents(); 69 | 70 | $this->data['##lang.ink.title##'] = $events[$event]; 71 | 72 | $this->data['##lang.ink.printer##'] = _n('Printer', 'Printers', 2); 73 | $this->data['##lang.ink.cartridge##'] = _n('Cartridge', 'Cartridges', 2); 74 | $this->data['##lang.ink.state##'] = __('State'); 75 | 76 | foreach ($options['ink'] as $id => $ink) { 77 | $snmp = new Printer_CartridgeInfo(); 78 | $snmp->getFromDB($ink["id"]); 79 | 80 | $printer = new Printer(); 81 | $printer->getFromDB($snmp->fields["printers_id"]); 82 | 83 | $tmp = []; 84 | 85 | $tmp['##ink.urlprinter##'] = urldecode($CFG_GLPI["url_base"] . "/index.php?redirect=printer_" . $printer->fields['id']); 86 | $tmp['##ink.printer##'] = $printer->fields['name']; 87 | $color_translated = ""; 88 | 89 | $color_translations = [ 90 | 'black' => __('Black'), 91 | 'cyan' => __('Cyan'), 92 | 'magenta' => __('Magenta'), 93 | 'yellow' => __('Yellow'), 94 | ]; 95 | if (isset($snmp->fields['property'], $snmp->fields['value']) 96 | && str_starts_with($snmp->fields['property'], 'toner')) { 97 | $color = str_replace('toner', '', $snmp->fields['property']); 98 | $color_translated = $color_translations[$color] ?? ucwords($color); 99 | } 100 | $tmp['##ink.property##'] = __('Toner')." ".$color_translated; 101 | 102 | $tmp['##ink.value##'] = $snmp->fields['value']. '%'; 103 | 104 | $this->data['inks'][] = $tmp; 105 | } 106 | } 107 | 108 | /** 109 | * 110 | */ 111 | function getTags() 112 | { 113 | 114 | $tags = ['ink.printer' => __('Printers'), 115 | 'ink.printerurl' => 'URL ' . __('Printers'), 116 | 'ink.property' => __('Toner percentage'), 117 | 'ink.value' => __('Value')]; 118 | foreach ($tags as $tag => $label) { 119 | $this->addTagToList(['tag' => $tag, 'label' => $label, 120 | 'value' => true]); 121 | } 122 | 123 | $this->addTagToList(['tag' => 'additionalalerts', 124 | 'label' => __('Cartridges whose level is low', 'additionalalerts'), 125 | 'value' => false, 126 | 'foreach' => true, 127 | 'events' => ['ink']]); 128 | 129 | asort($this->tag_descriptions); 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /src/Config.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | namespace GlpiPlugin\Additionalalerts; 31 | 32 | use Alert; 33 | use CommonDBTM; 34 | use CommonGLPI; 35 | use Html; 36 | use Plugin; 37 | 38 | if (!defined('GLPI_ROOT')) { 39 | die("Sorry. You can't access directly to this file"); 40 | } 41 | 42 | /** 43 | * Class Config 44 | */ 45 | class Config extends CommonDBTM 46 | { 47 | 48 | static $rightname = "plugin_additionalalerts"; 49 | 50 | /** 51 | * @param int $nb 52 | * @return string 53 | */ 54 | static function getTypeName($nb = 0) 55 | { 56 | return __('Plugin setup', 'additionalalerts'); 57 | } 58 | 59 | public static function getConfig() 60 | { 61 | static $config = null; 62 | 63 | if (is_null($config)) { 64 | $config = new self(); 65 | } 66 | $config->getFromDB(1); 67 | 68 | return $config; 69 | } 70 | 71 | static function getIcon() 72 | { 73 | return "ti ti-bell-ringing"; 74 | } 75 | 76 | /** 77 | * @param CommonGLPI $item 78 | * @param int $withtemplate 79 | * @return string|translated 80 | */ 81 | function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) 82 | { 83 | global $CFG_GLPI; 84 | 85 | if ($item->getType()=='NotificationMailingSetting' 86 | && $item->getField('id') 87 | && $CFG_GLPI["notifications_mailing"] 88 | ) { 89 | return self::createTabEntry(AdditionalAlert::getTypeName(2)); 90 | } elseif ($item->getType()=='Entity') { 91 | return self::createTabEntry(AdditionalAlert::getTypeName(2)); 92 | } 93 | return ''; 94 | } 95 | 96 | /** 97 | * @param CommonGLPI $item 98 | * @param int $tabnum 99 | * @param int $withtemplate 100 | * @return bool 101 | */ 102 | static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) 103 | { 104 | 105 | if ($item->getType()=='NotificationMailingSetting') { 106 | $conf = new self(); 107 | $conf->showConfigForm(); 108 | } elseif ($item->getType()=='Entity') { 109 | InfocomAlert::showNotificationOptions($item); 110 | InkAlert::showNotificationOptions($item); 111 | TicketUnresolved::showNotificationOptions($item); 112 | } 113 | return true; 114 | } 115 | 116 | /** 117 | * @param array $options 118 | * @return bool 119 | */ 120 | function showConfigForm() 121 | { 122 | $target = PLUGIN_ADDITIONALALERTS_WEBDIR."/front/config.form.php"; 123 | 124 | $this->getFromDB(1); 125 | $options['colspan'] = 1; 126 | $this->showFormHeader($options); 127 | 128 | echo ""; 129 | echo "" . InfocomAlert::getTypeName(2) . ""; 130 | Alert::dropdownYesNo(['name'=>"use_infocom_alert", 131 | 'value'=>$this->fields["use_infocom_alert"]]); 132 | echo ""; 133 | 134 | echo ""; 135 | echo "" . __('Cartridges whose level is low', 'additionalalerts') . ""; 136 | Alert::dropdownYesNo(['name'=>"use_ink_alert", 137 | 'value'=>$this->fields["use_ink_alert"]]); 138 | echo ""; 139 | 140 | echo ""; 141 | echo "" . __('Unresolved Ticket Alerts', 'additionalalerts') . ""; 142 | 143 | Alert::dropdownIntegerNever( 144 | 'delay_ticket_alert', 145 | $this->fields["delay_ticket_alert"], 146 | ['max'=>99] 147 | ); 148 | echo " "._n('Day', 'Days', 2).""; 149 | echo ""; 150 | 151 | echo ""; 152 | echo Html::hidden('id', ['value' => 1]); 153 | echo ""; 154 | 155 | $this->showFormButtons($options); 156 | 157 | return true; 158 | } 159 | 160 | 161 | //----------------- Getters and setters -------------------// 162 | 163 | public function useInfocomAlert() 164 | { 165 | return $this->fields['use_infocom_alert']; 166 | } 167 | 168 | public function useInkAlert() 169 | { 170 | return $this->fields['use_ink_alert']; 171 | } 172 | 173 | public function getDelayTicketAlert() 174 | { 175 | return $this->fields['delay_ticket_alert']; 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /src/NotificationTargetInfocomAlert.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | namespace GlpiPlugin\Additionalalerts; 31 | 32 | use DbUtils; 33 | use Dropdown; 34 | use NotificationTarget; 35 | 36 | if (!defined('GLPI_ROOT')) { 37 | die("Sorry. You can't access directly to this file"); 38 | } 39 | 40 | /** 41 | * Class NotificationTargetInfocomAlert 42 | */ 43 | class NotificationTargetInfocomAlert extends NotificationTarget 44 | { 45 | 46 | static $rightname = "plugin_additionalalerts"; 47 | 48 | /** 49 | * @return array 50 | */ 51 | function getEvents() { 52 | return ['notinfocom' => InfocomAlert::getTypeName(2)]; 53 | } 54 | 55 | /** 56 | * @param $event 57 | * @param array $options 58 | */ 59 | function addDataForTemplate($event, $options = []) { 60 | global $CFG_GLPI; 61 | 62 | $this->data['##notinfocom.entity##'] = 63 | Dropdown::getDropdownName('glpi_entities', 64 | $options['entities_id']); 65 | $this->data['##lang.notinfocom.entity##'] = __('Entity'); 66 | 67 | $events = $this->getAllEvents(); 68 | 69 | $this->data['##lang.notinfocom.title##'] = $events[$event]; 70 | 71 | $this->data['##lang.notinfocom.name##'] = __('Name'); 72 | $this->data['##lang.notinfocom.urlname##'] = __('URL'); 73 | $this->data['##lang.notinfocom.computertype##'] = __('Type'); 74 | $this->data['##lang.notinfocom.operatingsystem##'] = __('Operating system'); 75 | $this->data['##lang.notinfocom.state##'] = __('Status'); 76 | $this->data['##lang.notinfocom.location##'] = __('Location'); 77 | $this->data['##lang.notinfocom.urluser##'] = __('URL'); 78 | $this->data['##lang.notinfocom.urlgroup##'] = __('URL'); 79 | $this->data['##lang.notinfocom.user##'] = __('User'); 80 | $this->data['##lang.notinfocom.group##'] = __('Group'); 81 | 82 | foreach ($options['notinfocoms'] as $id => $notinfocom) { 83 | $tmp = []; 84 | 85 | $tmp['##notinfocom.urlname##'] = urldecode($CFG_GLPI["url_base"] . "/index.php?redirect=computer_" . 86 | $notinfocom['id']); 87 | $tmp['##notinfocom.name##'] = $notinfocom['name']; 88 | $tmp['##notinfocom.computertype##'] = Dropdown::getDropdownName("glpi_computertypes", $notinfocom['computertypes_id']); 89 | $tmp['##notinfocom.operatingsystem##'] = Dropdown::getDropdownName("glpi_operatingsystems", $notinfocom['operatingsystems_id']); 90 | $tmp['##notinfocom.state##'] = Dropdown::getDropdownName("glpi_states", $notinfocom['states_id']); 91 | $tmp['##notinfocom.location##'] = Dropdown::getDropdownName("glpi_locations", $notinfocom['locations_id']); 92 | 93 | $tmp['##notinfocom.urluser##'] = urldecode($CFG_GLPI["url_base"] . "/index.php?redirect=user_" . 94 | $notinfocom['users_id']); 95 | 96 | $tmp['##notinfocom.urlgroup##'] = urldecode($CFG_GLPI["url_base"] . "/index.php?redirect=group_" . 97 | $notinfocom['groups_id']); 98 | 99 | $tmp['##notinfocom.user##'] = getUserName($notinfocom['users_id']); 100 | $tmp['##notinfocom.group##'] = Dropdown::getDropdownName("glpi_groups", $notinfocom['groups_id']); 101 | $tmp['##notinfocom.contact##'] = $notinfocom['contact']; 102 | 103 | $this->data['notinfocoms'][] = $tmp; 104 | } 105 | } 106 | 107 | /** 108 | * 109 | */ 110 | function getTags() { 111 | 112 | $tags = ['notinfocom.name' => __('Name'), 113 | 'notinfocom.urlname' => __('URL') . " " . __('Name'), 114 | 'notinfocom.computertype' => __('Type'), 115 | 'notinfocom.operatingsystem' => __('Operating system'), 116 | 'notinfocom.state' => __('Status'), 117 | 'notinfocom.location' => __('Location'), 118 | 'notinfocom.user' => __('User'), 119 | 'notinfocom.urluser' => __('URL') . " " . __('User'), 120 | 'notinfocom.group' => __('Group'), 121 | 'notinfocom.urlgroup' => __('URL') . " " . __('Group'), 122 | 'notinfocom.contact' => __('Alternate username')]; 123 | foreach ($tags as $tag => $label) { 124 | $this->addTagToList(['tag' => $tag, 'label' => $label, 125 | 'value' => true]); 126 | } 127 | 128 | $this->addTagToList(['tag' => 'additionalalerts', 129 | 'label' => InfocomAlert::getTypeName(2), 130 | 'value' => false, 131 | 'foreach' => true, 132 | 'events' => ['notinfocom']]); 133 | 134 | asort($this->tag_descriptions); 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /additionalalerts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Additional Alerts 4 | additionalalerts 5 | stable 6 | https://raw.githubusercontent.com/InfotelGLPI/additionalalerts/master/additionalalerts.png 7 | 8 | 9 | 10 | 11 | 12 | 13 | - Matériels ayant une date d'achat vide (Choix des types pris en charge : pour ne pas prendre en compte les matériels non achetés),
- Niveaux de cartouches faible (fusion Inventory).]]>
14 | - Items with empty buy date (Choice of supported types : for not taking into account the equipment not purchased),
- Cartridges whose level is low (fusion Inventory).]]>
15 |
16 |
17 | https://github.com/InfotelGLPI/additionalalerts 18 | https://github.com/InfotelGLPI/additionalalerts/releases 19 | https://github.com/InfotelGLPI/additionalalerts/issues 20 | https://raw.githubusercontent.com/InfotelGLPI/additionalalerts/master/README.md 21 | 22 | Xavier Caillaud / Infotel 23 | 24 | 25 | 26 | 3.0.3 27 | ~11.0 28 | https://github.com/InfotelGLPI/additionalalerts/releases/download/3.0.3/glpi-additionalalerts-3.0.3.tar.bz2 29 | 30 | 31 | 3.0.2 32 | ~11.0 33 | https://github.com/InfotelGLPI/additionalalerts/releases/download/3.0.2/glpi-additionalalerts-3.0.2.tar.bz2 34 | 35 | 36 | 3.0.1 37 | ~11.0 38 | https://github.com/InfotelGLPI/additionalalerts/releases/download/3.0.1/glpi-additionalalerts-3.0.1.tar.bz2 39 | 40 | 41 | 3.0.0 42 | ~11.0 43 | https://github.com/InfotelGLPI/additionalalerts/releases/download/3.0.0/glpi-additionalalerts-3.0.0.tar.bz2 44 | 45 | 46 | 2.4.0 47 | ~10.0 48 | https://github.com/InfotelGLPI/additionalalerts/releases/download/2.4.0/glpi-additionalalerts-2.4.0.tar.bz2 49 | 50 | 51 | 2.3.0 52 | 9.5 53 | 54 | 55 | 2.2.0 56 | 9.4 57 | 58 | 59 | 2.1.2 60 | 9.3 61 | 62 | 63 | 2.1.1 64 | 9.3 65 | 66 | 67 | 2.1.0 68 | 9.3 69 | 70 | 71 | 2.0.0 72 | 9.2 73 | 74 | 75 | 1.9.0 76 | 9.1 77 | 78 | 79 | 1.8.0 80 | 0.90 81 | 82 | 83 | 1.7.0 84 | 0.85 85 | 86 | 87 | 1.6.1 88 | 0.84 89 | 90 | 91 | 1.6.0 92 | 0.84 93 | 94 | 95 | 1.5.2 96 | 0.83.3 97 | 98 | 99 | 1.5.1 100 | 0.83 101 | 102 | 103 | 1.5.0 104 | 0.83 105 | 106 | 107 | 1.4.0 108 | 0.80 109 | 110 | 111 | 1.3.0 112 | 0.78 113 | 114 | 115 | 1.2.1 116 | 0.72 117 | 118 | 119 | 1.2.0 120 | 0.72 121 | 122 | 123 | 1.1 124 | 0.71 125 | 126 | 127 | 1.0 128 | 0.70 129 | 130 | 131 | 132 | cs_CZ 133 | en_GB 134 | es_ES 135 | et_EE 136 | fr_FR 137 | hu_HU 138 | it_IT 139 | ms_MY 140 | pl_PL 141 | pt_BR 142 | pt_PT 143 | ro_RO 144 | ru_RU 145 | tr_TR 146 | 147 | 148 | 149 | 150 | Helpdesk 151 | OCS-NG 152 | Achats 153 | Réservations 154 | Alertes 155 | 156 | 157 | Helpdesk 158 | OCS-NG 159 | Buying 160 | Reservations 161 | Alerts 162 | 163 | 164 |
165 | -------------------------------------------------------------------------------- /src/NotificationType.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | namespace GlpiPlugin\Additionalalerts; 31 | 32 | use CommonDBTM; 33 | use Dropdown; 34 | use Html; 35 | use MassiveAction; 36 | 37 | if (!defined('GLPI_ROOT')) { 38 | die("Sorry. You can't access directly to this file"); 39 | } 40 | 41 | /** 42 | * Class NotificationType 43 | */ 44 | class NotificationType extends CommonDBTM { 45 | 46 | static $rightname = "plugin_additionalalerts"; 47 | 48 | 49 | function configType() { 50 | 51 | $target = PLUGIN_ADDITIONALALERTS_WEBDIR . "/front/infocomalert.form.php"; 52 | $type = new NotificationType(); 53 | $types = $type->find(); 54 | $used = []; 55 | foreach ($types as $data) { 56 | $used[] = $data['types_id']; 57 | } 58 | 59 | echo "
"; 60 | echo ""; 61 | echo ""; 62 | 63 | echo ""; 64 | echo ""; 65 | echo ""; 71 | echo ""; 72 | 73 | echo "
" . __('Parameter', 'additionalalerts') . "" . __('Type not used for check of buy date', 'additionalalerts'); 66 | Dropdown::show('ComputerType', ['name' => "types_id", 67 | 'used' => $used]); 68 | echo " "; 69 | echo Html::submit(_sx('button', 'Add'), ['name' => 'add_type', 'class' => 'btn btn-primary']); 70 | echo "
"; 74 | Html::closeForm(); 75 | 76 | echo "
"; 77 | 78 | $rand = mt_rand(); 79 | 80 | $data = $this->find([], ["types_id ASC"]); 81 | 82 | if (count($data) != 0) { 83 | Html::openMassiveActionsForm('mass' . "NotificationType" . $rand); 84 | $massiveactionparams = ['item' => __CLASS__, 'container' => 'mass' . "NotificationType" . $rand]; 85 | Html::showMassiveActions($massiveactionparams); 86 | 87 | echo "
"; 88 | echo ""; 89 | echo ""; 90 | echo ""; 91 | echo ""; 92 | echo ""; 93 | echo ""; 94 | foreach ($data as $ligne) { 95 | echo ""; 96 | echo ""; 99 | echo ""; 100 | echo ""; 101 | } 102 | 103 | $massiveactionparams['ontop'] = false; 104 | 105 | echo "
" . Html::getCheckAllAsCheckbox('mass' . "NotificationType" . $rand) . "" . __('Type') . "
"; 97 | Html::showMassiveActionCheckBox(__CLASS__, $ligne["id"]); 98 | echo "" . Dropdown::getDropdownName("glpi_computertypes", $ligne["types_id"]) . "
"; 106 | Html::closeForm(); 107 | echo "
"; 108 | 109 | Html::showMassiveActions($massiveactionparams); 110 | } 111 | } 112 | 113 | /** 114 | * Get the standard massive actions which are forbidden 115 | * 116 | * @since version 0.84 117 | * 118 | * @return array of massive actions 119 | **/ 120 | public function getForbiddenStandardMassiveAction() 121 | { 122 | 123 | $forbidden = parent::getForbiddenStandardMassiveAction(); 124 | $forbidden[] = 'update'; 125 | return $forbidden; 126 | } 127 | 128 | 129 | 130 | /** 131 | * Get the specific massive actions 132 | * 133 | * @since version 0.84 134 | * 135 | * @param $checkitem link item to check right (default NULL) 136 | * 137 | * @return array $array of massive actions 138 | */ 139 | public function getSpecificMassiveActions($checkitem = null) 140 | { 141 | 142 | 143 | $actions[__CLASS__ . MassiveAction::CLASS_ACTION_SEPARATOR . 'purge'] = __('Delete'); 144 | 145 | return $actions; 146 | } 147 | 148 | /** 149 | * @param MassiveAction $ma 150 | * 151 | * @return bool|false 152 | */ 153 | /** 154 | * @param MassiveAction $ma 155 | * 156 | * @return bool|false 157 | */ 158 | public static function showMassiveActionsSubForm(MassiveAction $ma) 159 | { 160 | 161 | switch ($ma->getAction()) { 162 | case 'purge': 163 | echo Html::submit(_x('button', 'Post'), ['name' => 'massiveaction', 'class' => 'btn btn-primary']); 164 | return true; 165 | } 166 | return parent::showMassiveActionsSubForm($ma); 167 | } 168 | 169 | /** 170 | * @since version 0.85 171 | * 172 | * @see CommonDBTM::processMassiveActionsForOneItemtype() 173 | * 174 | * @param MassiveAction $ma 175 | * @param CommonDBTM $item 176 | * @param array $ids 177 | * 178 | * @return void 179 | */ 180 | public static function processMassiveActionsForOneItemtype( 181 | MassiveAction $ma, 182 | CommonDBTM $item, 183 | array $ids 184 | ) { 185 | 186 | $type = new self(); 187 | 188 | switch ($ma->getAction()) { 189 | case "purge": 190 | 191 | foreach ($ids as $key) { 192 | if ($item->can($key, UPDATE)) { 193 | if ($type->delete(['id' => $key])) { 194 | $ma->itemDone($item->getType(), $key, MassiveAction::ACTION_OK); 195 | } else { 196 | $ma->itemDone($item->getType(), $key, MassiveAction::ACTION_KO); 197 | } 198 | } else { 199 | $ma->itemDone($item->getType(), $key, MassiveAction::ACTION_NORIGHT); 200 | $ma->addMessage($item->getErrorMessage(ERROR_RIGHT)); 201 | } 202 | } 203 | break; 204 | } 205 | } 206 | } 207 | -------------------------------------------------------------------------------- /src/AdditionalAlert.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | namespace GlpiPlugin\Additionalalerts; 31 | 32 | use CommonDBTM; 33 | use CronTask; 34 | use Dropdown; 35 | use Plugin; 36 | use Session; 37 | 38 | if (!defined('GLPI_ROOT')) { 39 | die("Sorry. You can't access directly to this file"); 40 | } 41 | 42 | /** 43 | * Class AdditionalAlert 44 | */ 45 | class AdditionalAlert extends CommonDBTM 46 | { 47 | 48 | static $rightname = "plugin_additionalalerts"; 49 | 50 | /** 51 | * @param int $nb 52 | * 53 | * @return translated 54 | */ 55 | static function getTypeName($nb = 0) 56 | { 57 | 58 | return _n('Other alert', 'Others alerts', $nb, 'additionalalerts'); 59 | } 60 | 61 | static function displayAlerts() 62 | { 63 | global $DB; 64 | 65 | $CronTask = new CronTask(); 66 | 67 | $config = Config::getConfig(); 68 | 69 | $infocom = new InfocomAlert(); 70 | $infocom->getFromDBByCrit(['entities_id' => $_SESSION["glpiactive_entity"]]); 71 | if (isset($infocom->fields["use_infocom_alert"]) 72 | && $infocom->fields["use_infocom_alert"] > 0) { 73 | $use_infocom_alert = $infocom->fields["use_infocom_alert"]; 74 | } else { 75 | $use_infocom_alert = $config->useInfocomAlert(); 76 | } 77 | 78 | $ticketunresolved = new TicketUnresolved(); 79 | $ticketunresolved->getFromDBByCrit(['entities_id' => $_SESSION["glpiactive_entity"]]); 80 | if (isset($ticketunresolved->fields["delay_ticket_alert"]) 81 | && $ticketunresolved->fields["delay_ticket_alert"] > 0) { 82 | $delay_ticket_alert = $ticketunresolved->fields["delay_ticket_alert"]; 83 | } else { 84 | $delay_ticket_alert = $config->getDelayTicketAlert(); 85 | } 86 | 87 | $inkalert = new InkAlert(); 88 | $inkalert->getFromDBByCrit(['entities_id' => $_SESSION["glpiactive_entity"]]); 89 | if (isset($inkalert->fields["use_ink_alert"]) 90 | && $inkalert->fields["use_ink_alert"] > 0) { 91 | $use_ink_alert = $inkalert->fields["use_ink_alert"]; 92 | } else { 93 | $use_ink_alert = $config->useInkAlert(); 94 | } 95 | 96 | $additionalalerts_ink = 0; 97 | if ($CronTask->getFromDBbyName(InkAlert::class, "AdditionalalertsInk")) { 98 | if ($CronTask->fields["state"] != CronTask::STATE_DISABLE && $use_ink_alert > 0) { 99 | $additionalalerts_ink = 1; 100 | } 101 | } 102 | 103 | $additionalalerts_not_infocom = 0; 104 | if ($CronTask->getFromDBbyName(InfocomAlert::class, "AdditionalalertsNotInfocom")) { 105 | if ($CronTask->fields["state"] != CronTask::STATE_DISABLE && $use_infocom_alert > 0) { 106 | $additionalalerts_not_infocom = 1; 107 | } 108 | } 109 | 110 | $additionalalerts_ticket_unresolved = 0; 111 | if ($CronTask->getFromDBbyName(TicketUnresolved::class, "AdditionalalertsTicketUnresolved")) { 112 | if ($CronTask->fields["state"] != CronTask::STATE_DISABLE && $delay_ticket_alert > 0) { 113 | $additionalalerts_ticket_unresolved = 1; 114 | } 115 | } 116 | 117 | if ($additionalalerts_not_infocom == 0 118 | && $additionalalerts_ink == 0 119 | && $additionalalerts_ticket_unresolved == 0) { 120 | echo "
" . __('No used alerts', 'additionalalerts') . "
"; 121 | } 122 | if ($additionalalerts_not_infocom != 0) { 123 | if (Session::haveRight("infocom", READ)) { 124 | $query = InfocomAlert::query($_SESSION["glpiactive_entity"]); 125 | $result = $DB->doQuery($query); 126 | 127 | if ($DB->numrows($result) > 0) { 128 | if (Session::isMultiEntitiesMode()) { 129 | $nbcol = 7; 130 | } else { 131 | $nbcol = 6; 132 | } 133 | echo "
"; 135 | echo ""; 136 | if (Session::isMultiEntitiesMode()) { 137 | echo ""; 138 | } 139 | echo ""; 140 | echo ""; 141 | echo ""; 142 | echo ""; 143 | echo ""; 144 | while ($data = $DB->fetchArray($result)) { 145 | echo InfocomAlert::displayBody($data); 146 | } 147 | echo "
"; 134 | echo InfocomAlert::getTypeName(2) . "
" . __('Name') . "" . __('Entity') . "" . __('Type') . "" . __('Operating system') . "" . __('Status') . "" . __('Location') . "" . __('User') . " / " . __('Group') . " / " . __('Alternate username') . "
"; 148 | } else { 149 | echo "
" . __('No computers with no buy date', 'additionalalerts') . "
"; 150 | } 151 | echo "
"; 152 | } 153 | } 154 | 155 | if ($additionalalerts_ink != 0) { 156 | if (Session::haveRight("cartridge", READ)) { 157 | $query = InkAlert::query($_SESSION["glpiactive_entity"]); 158 | $result = $DB->doQuery($query); 159 | 160 | if ($DB->numrows($result) > 0) { 161 | if (Session::isMultiEntitiesMode()) { 162 | $nbcol = 4; 163 | } else { 164 | $nbcol = 3; 165 | } 166 | echo "
"; 167 | echo ""; 168 | echo ""; 169 | echo ""; 170 | if (Session::isMultiEntitiesMode()) { 171 | echo ""; 172 | } 173 | echo ""; 174 | echo ""; 175 | 176 | while ($data = $DB->fetchArray($result)) { 177 | echo InkAlert::displayBody($data); 178 | } 179 | echo "
" . __('Cartridges whose level is low', 'additionalalerts') . "
" . __('Printer') . "" . __('Entity') . "" . __('Cartridge') . "" . __('Ink level', 'additionalalerts') . "
"; 180 | } else { 181 | echo "
" . __('No cartridge is below the threshold', 'additionalalerts') . "
"; 182 | } 183 | } 184 | } 185 | 186 | if ($additionalalerts_ticket_unresolved != 0) { 187 | $entities = TicketUnresolved::getEntitiesToNotify('delay_ticket_alert'); 188 | 189 | foreach ($entities as $entity => $delay_ticket_alert) { 190 | $query = TicketUnresolved::query($delay_ticket_alert, $entity); 191 | $result = $DB->doQuery($query); 192 | $nbcol = 7; 193 | 194 | 195 | if ($DB->numrows($result) > 0) { 196 | echo "
"; 198 | echo ""; 199 | echo ""; 200 | echo ""; 201 | echo ""; 202 | echo ""; 203 | echo ""; 204 | echo ""; 205 | 206 | while ($data = $DB->fetchArray($result)) { 207 | echo TicketUnresolved::displayBody($data); 208 | } 209 | 210 | 211 | echo "
"; 197 | echo __('Tickets unresolved since more', 'additionalalerts') . " " . $delay_ticket_alert . " " . _n('Day', 'Days', 2) . ", " . __('Entity') . " : " . Dropdown::getDropdownName("glpi_entities", $entity) . "
" . __('Title') . "" . __('Entity') . "" . __('Status') . "" . __('Opening date') . "" . __('Last update') . "" . __('Technician') . "" . __('Manager') . "
"; 212 | } else { 213 | echo "
" . __('No tickets unresolved since more', 'additionalalerts') . " " . 214 | $delay_ticket_alert . " " . _n('Day', 'Days', 2) . ", " . __('Entity') . " : " . Dropdown::getDropdownName("glpi_entities", $entity) . "
"; 215 | } 216 | 217 | echo "
"; 218 | } 219 | } 220 | } 221 | } 222 | -------------------------------------------------------------------------------- /src/Profile.php: -------------------------------------------------------------------------------- 1 | . 28 | -------------------------------------------------------------------------- 29 | */ 30 | 31 | namespace GlpiPlugin\Additionalalerts; 32 | 33 | use CommonGLPI; 34 | use DbUtils; 35 | use Html; 36 | use ProfileRight; 37 | use Session; 38 | 39 | if (!defined('GLPI_ROOT')) { 40 | die("Sorry. You can't access directly to this file"); 41 | } 42 | 43 | /** 44 | * Class Profile 45 | */ 46 | class Profile extends \Profile 47 | { 48 | public static $rightname = "profile"; 49 | 50 | 51 | static function getIcon() { 52 | return "ti ti-bell-ringing"; 53 | } 54 | 55 | 56 | /** 57 | * @param CommonGLPI $item 58 | * @param int $withtemplate 59 | * 60 | * @return string|translated 61 | */ 62 | public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) 63 | { 64 | if ($item->getType() == 'Profile' 65 | && $item->getField('interface') != 'helpdesk') { 66 | return self::createTabEntry(AdditionalAlert::getTypeName(2)); 67 | } 68 | return ''; 69 | } 70 | 71 | 72 | /** 73 | * @param CommonGLPI $item 74 | * @param int $tabnum 75 | * @param int $withtemplate 76 | * 77 | * @return bool 78 | */ 79 | public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) 80 | { 81 | if ($item->getType() == 'Profile') { 82 | $ID = $item->getField('id'); 83 | $prof = new self(); 84 | 85 | self::addDefaultProfileInfos( 86 | $ID, 87 | ['plugin_additionalalerts' => 0] 88 | ); 89 | $prof->showForm($ID); 90 | } 91 | return true; 92 | } 93 | 94 | 95 | /** 96 | * @param $ID 97 | */ 98 | public static function createFirstAccess($ID) 99 | { 100 | //85 101 | self::addDefaultProfileInfos( 102 | $ID, 103 | ['plugin_additionalalerts' => READ + UPDATE], 104 | true 105 | ); 106 | } 107 | 108 | /** 109 | * @return array 110 | */ 111 | public static function getAllRights() 112 | { 113 | return [ 114 | [ 115 | 'itemtype' => Config::class, 116 | 'label' => _n('Other alert', 'Others alerts', 2, 'additionalalerts'), 117 | 'field' => 'plugin_additionalalerts', 118 | 'rights' => [READ => __('Read'), UPDATE => __('Update')], 119 | ], 120 | ]; 121 | } 122 | 123 | /** 124 | * Init profiles 125 | * 126 | * @param $old_right 127 | * 128 | * @return int 129 | */ 130 | 131 | public static function translateARight($old_right) 132 | { 133 | switch ($old_right) { 134 | case '': 135 | return 0; 136 | case 'r': 137 | return READ; 138 | case 'w': 139 | return READ + UPDATE; 140 | case '0': 141 | case '1': 142 | return $old_right; 143 | 144 | default: 145 | return 0; 146 | } 147 | } 148 | 149 | /** 150 | * @param $profiles_id the profile ID 151 | * 152 | * @return bool 153 | * @since 0.85 154 | * Migration rights from old system to the new one for one profile 155 | * 156 | */ 157 | public static function migrateOneProfile($profiles_id) 158 | { 159 | global $DB; 160 | //Cannot launch migration if there's nothing to migrate... 161 | if (!$DB->tableExists('glpi_plugin_additionalalerts_profiles')) { 162 | return true; 163 | } 164 | 165 | $it = $DB->request([ 166 | 'FROM' => 'glpi_plugin_accounts_profiles', 167 | 'WHERE' => ['profiles_id' => $profiles_id], 168 | ]); 169 | foreach ($it as $profile_data) { 170 | $matching = ['additionalalerts' => 'plugin_additionalalerts']; 171 | $current_rights = ProfileRight::getProfileRights($profiles_id, array_values($matching)); 172 | foreach ($matching as $old => $new) { 173 | if (!isset($current_rights[$old])) { 174 | $DB->update('glpi_profilerights', ['rights' => self::translateARight($profile_data[$old])], [ 175 | 'name' => $new, 176 | 'profiles_id' => $profiles_id, 177 | ]); 178 | } 179 | } 180 | } 181 | } 182 | 183 | /** 184 | * Initialize profiles, and migrate it necessary 185 | */ 186 | public static function initProfile() 187 | { 188 | global $DB; 189 | $profile = new self(); 190 | $dbu = new DbUtils(); 191 | //Add new rights in glpi_profilerights table 192 | foreach ($profile->getAllRights(true) as $data) { 193 | if ($dbu->countElementsInTable( 194 | "glpi_profilerights", 195 | ["name" => $data['field']] 196 | ) == 0) { 197 | ProfileRight::addProfileRights([$data['field']]); 198 | } 199 | } 200 | 201 | //Migration old rights in new ones 202 | $it = $DB->request([ 203 | 'SELECT' => ['id'], 204 | 'FROM' => 'glpi_profiles', 205 | ]); 206 | foreach ($it as $prof) { 207 | self::migrateOneProfile($prof['id']); 208 | } 209 | $it = $DB->request([ 210 | 'FROM' => 'glpi_profilerights', 211 | 'WHERE' => [ 212 | 'profiles_id' => $_SESSION['glpiactiveprofile']['id'], 213 | 'name' => ['LIKE', '%plugin_additionalalerts%'], 214 | ], 215 | ]); 216 | foreach ($it as $prof) { 217 | if (isset($_SESSION['glpiactiveprofile'])) { 218 | $_SESSION['glpiactiveprofile'][$prof['name']] = $prof['rights']; 219 | } 220 | } 221 | } 222 | 223 | public static function removeRightsFromSession() 224 | { 225 | foreach (self::getAllRights() as $right) { 226 | if (isset($_SESSION['glpiactiveprofile'][$right['field']])) { 227 | unset($_SESSION['glpiactiveprofile'][$right['field']]); 228 | } 229 | } 230 | } 231 | 232 | /** 233 | * @param $profiles_id 234 | * @param $rights 235 | * @param bool $drop_existing 236 | * 237 | * @internal param $profile 238 | */ 239 | public static function addDefaultProfileInfos($profiles_id, $rights, $drop_existing = false) 240 | { 241 | $dbu = new DbUtils(); 242 | $profileRight = new ProfileRight(); 243 | foreach ($rights as $right => $value) { 244 | if ($dbu->countElementsInTable( 245 | 'glpi_profilerights', 246 | [ 247 | "profiles_id" => $profiles_id, 248 | "name" => $right, 249 | ] 250 | ) && $drop_existing) { 251 | $profileRight->deleteByCriteria(['profiles_id' => $profiles_id, 'name' => $right]); 252 | } 253 | if (!$dbu->countElementsInTable( 254 | 'glpi_profilerights', 255 | [ 256 | "profiles_id" => $profiles_id, 257 | "name" => $right, 258 | ] 259 | )) { 260 | $myright['profiles_id'] = $profiles_id; 261 | $myright['name'] = $right; 262 | $myright['rights'] = $value; 263 | $profileRight->add($myright); 264 | 265 | //Add right to the current session 266 | $_SESSION['glpiactiveprofile'][$right] = $value; 267 | } 268 | } 269 | } 270 | 271 | /** 272 | * Show profile form 273 | * 274 | * @param int $profiles_id 275 | * @param bool $openform 276 | * @param bool $closeform 277 | * 278 | * @return nothing 279 | * @internal param int $items_id id of the profile 280 | * @internal param value $target url of target 281 | */ 282 | public function showForm($profiles_id = 0, $openform = true, $closeform = true) 283 | { 284 | echo "
"; 285 | if (($canedit = Session::haveRightsOr(self::$rightname, [CREATE, UPDATE, PURGE])) 286 | && $openform) { 287 | $profile = new \Profile(); 288 | echo ""; 289 | } 290 | 291 | $profile = new \Profile(); 292 | $profile->getFromDB($profiles_id); 293 | 294 | $rights = $this->getAllRights(); 295 | $profile->displayRightsChoiceMatrix($rights, [ 296 | 'canedit' => $canedit, 297 | 'default_class' => 'tab_bg_2', 298 | 'title' => __('General'), 299 | ]); 300 | 301 | if ($canedit 302 | && $closeform) { 303 | echo "
"; 304 | echo Html::hidden('id', ['value' => $profiles_id]); 305 | echo Html::submit(_sx('button', 'Save'), ['name' => 'update', 'class' => 'btn btn-primary']); 306 | echo "
\n"; 307 | Html::closeForm(); 308 | } 309 | echo "
"; 310 | } 311 | } 312 | -------------------------------------------------------------------------------- /src/TicketUnresolved.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | namespace GlpiPlugin\Additionalalerts; 31 | 32 | use Alert; 33 | use CommonDBTM; 34 | use CronTask; 35 | use DbUtils; 36 | use Dropdown; 37 | use Entity; 38 | use Html; 39 | use Notification; 40 | use NotificationEvent; 41 | use Plugin; 42 | use Session; 43 | use Ticket; 44 | use Toolbox; 45 | 46 | if (!defined('GLPI_ROOT')) { 47 | die("Sorry. You can't access directly to this file"); 48 | } 49 | 50 | /** 51 | * Class TicketUnresolved 52 | */ 53 | class TicketUnresolved extends CommonDBTM 54 | { 55 | 56 | static $rightname = "plugin_additionalalerts"; 57 | 58 | /** 59 | * @param int $nb 60 | * 61 | * @return string 62 | */ 63 | static function getTypeName($nb = 0) 64 | { 65 | return _n('Ticket unresolved', 'Tickets unresolved', $nb, 'additionalalerts'); 66 | } 67 | 68 | // Cron action 69 | 70 | /** 71 | * @param $name 72 | * 73 | * @return array 74 | */ 75 | static function cronInfo($name) 76 | { 77 | switch ($name) { 78 | case 'AdditionalalertsTicketUnresolved': 79 | return [ 80 | 'description' => TicketUnresolved::getTypeName(2) 81 | ]; // Optional 82 | break; 83 | } 84 | return []; 85 | } 86 | 87 | 88 | /** 89 | * @param $delay_ticket_alert 90 | * @param $entity 91 | * 92 | * @return string 93 | */ 94 | static function query($delay_ticket_alert, $entity) 95 | { 96 | $delay_stamp = mktime(0, 0, 0, date("m"), date("d") - $delay_ticket_alert, date("y")); 97 | $date = date("Y-m-d", $delay_stamp); 98 | $date = $date . " 00:00:00"; 99 | 100 | $query = "SELECT `glpi_tickets`.*,`glpi_tickets_users`.users_id, `glpi_groups_users`.`users_id` as supervisor 101 | FROM `glpi_tickets` 102 | LEFT JOIN `glpi_tickets_users` ON `glpi_tickets`.`id` = `glpi_tickets_users`.`tickets_id` 103 | AND `glpi_tickets_users`.`type` = 2 104 | LEFT JOIN `glpi_groups_tickets` ON `glpi_tickets`.`id` = `glpi_groups_tickets`.`tickets_id` 105 | AND `glpi_groups_tickets`.`type` = 2 106 | LEFT JOIN `glpi_groups_users` ON `glpi_groups_users`.`groups_id` = `glpi_groups_tickets`.`groups_id` 107 | AND `glpi_groups_users`.`is_manager` = 1 108 | WHERE `glpi_tickets`.`date` <= '" . $date . "' 109 | AND `glpi_tickets`.`status` <= 4 110 | AND `glpi_tickets`.`is_deleted` = 0 111 | AND `glpi_tickets`.`entities_id` = '" . $entity . "' 112 | ORDER BY `glpi_tickets`.`id`"; 113 | 114 | return $query; 115 | } 116 | 117 | 118 | /** 119 | * @param $data 120 | * 121 | * @return string 122 | */ 123 | static function displayBody($data) 124 | { 125 | global $CFG_GLPI; 126 | 127 | $dbu = new DbUtils(); 128 | 129 | $body = "" . $data["name"]; 130 | $body .= ""; 131 | 132 | $body .= "" . Dropdown::getDropdownName("glpi_entities", $data["entities_id"]) . ""; 133 | $body .= "" . Ticket::getStatus($data["status"]) . ""; 134 | $body .= "" . Html::convDateTime($data["date"]) . ""; 135 | $body .= "" . Html::convDateTime($data["date_mod"]) . ""; 136 | $body .= ""; 137 | if (!empty($data["users_id"])) { 138 | $body .= "" . 139 | $dbu->getUserName($data["users_id"]) . ""; 140 | } 141 | $body .= ""; 142 | $body .= ""; 143 | if (!empty($data["supervisor"])) { 144 | $body .= "" . 145 | $dbu->getUserName($data["supervisor"]) . ""; 146 | } 147 | if (!empty($data["contact"])) { 148 | $body .= " - " . $data["contact"]; 149 | } 150 | 151 | $body .= ""; 152 | $body .= ""; 153 | 154 | return $body; 155 | } 156 | 157 | 158 | /** 159 | * @param $field 160 | * @param bool $with_value 161 | * 162 | * @return array 163 | */ 164 | static function getEntitiesToNotify($field, $with_value = false) 165 | { 166 | global $DB; 167 | 168 | $criteria = [ 169 | 'SELECT' => ['entities_id as entity',$field], 170 | 'FROM' => 'glpi_plugin_additionalalerts_ticketunresolveds', 171 | 'ORDERBY' => 'entities_id ASC' 172 | ]; 173 | $iterator = $DB->request($criteria); 174 | 175 | $entities = []; 176 | if (count($iterator) > 0) { 177 | foreach ($iterator as $entitydatas) { 178 | TicketUnresolved::getDefaultValueForNotification($field, $entities, $entitydatas); 179 | } 180 | } else { 181 | $config = new Config(); 182 | $config->getFromDB(1); 183 | $dbu = new DbUtils(); 184 | foreach ($dbu->getAllDataFromTable('glpi_entities') as $entity) { 185 | $entities[$entity['id']] = $config->fields[$field]; 186 | } 187 | } 188 | 189 | return $entities; 190 | } 191 | 192 | /** 193 | * @param $field 194 | * @param $entities 195 | * @param $entitydatas 196 | */ 197 | static function getDefaultValueForNotification($field, &$entities, $entitydatas) 198 | { 199 | $config = new Config(); 200 | $config->getFromDB(1); 201 | //If there's a configuration for this entity & the value is not the one of the global config 202 | if (isset($entitydatas[$field]) && $entitydatas[$field] > 0) { 203 | $entities[$entitydatas['entity']] = $entitydatas[$field]; 204 | } //No configuration for this entity : if global config allows notification then add the entity 205 | //to the array of entities to be notified 206 | elseif ((!isset($entitydatas[$field]) 207 | || (isset($entitydatas[$field]) && $entitydatas[$field] == -1)) 208 | && $config->fields[$field]) { 209 | $dbu = new DbUtils(); 210 | foreach ($dbu->getAllDataFromTable('glpi_entities') as $entity) { 211 | $entities[$entity['id']] = $config->fields[$field]; 212 | } 213 | } 214 | } 215 | 216 | 217 | /** 218 | * Cron action 219 | * 220 | * @param $task for log, if NULL display 221 | * 222 | * @return int 223 | */ 224 | static function cronAdditionalalertsTicketUnresolved($task = null) 225 | { 226 | global $DB, $CFG_GLPI; 227 | 228 | if (!$CFG_GLPI["notifications_mailing"]) { 229 | return 0; 230 | } 231 | 232 | $CronTask = new CronTask(); 233 | if ($CronTask->getFromDBbyName(TicketUnresolved::class, "AdditionalalertsTicketUnresolved")) { 234 | if ($CronTask->fields["state"] == CronTask::STATE_DISABLE) { 235 | return 0; 236 | } 237 | } else { 238 | return 0; 239 | } 240 | $entities = self::getEntitiesToNotify('delay_ticket_alert'); 241 | $ticket = new TicketUnresolved(); 242 | 243 | $cron_status = 0; 244 | foreach ($entities as $entity => $delay_ticket_alert) { 245 | $query = self::query($delay_ticket_alert, $entity); 246 | 247 | //Foreach notification 248 | $notifications = Notification::getNotificationsByEventAndType( 249 | 'ticketunresolved', 250 | TicketUnresolved::class, 251 | $entity 252 | ); 253 | 254 | $dbu = new DbUtils(); 255 | 256 | foreach ($notifications as $notif) { 257 | $targets = $dbu->getAllDataFromTable( 258 | 'glpi_notificationtargets', 259 | ["notifications_id" => $notif['id']] 260 | ); 261 | 262 | $list_ticket = []; 263 | foreach ($DB->request($query) as $tick) { 264 | foreach ($targets as $target) { 265 | if ($target['type'] == Notification::USER_TYPE 266 | && $target['items_id'] == Notification::ASSIGN_TECH) { 267 | $list_ticket[$tick['users_id']][$tick['id']] = $tick; 268 | } 269 | 270 | if ($target['type'] == Notification::USER_TYPE 271 | && $target['items_id'] == Notification::SUPERVISOR_ASSIGN_GROUP) { 272 | $list_ticket[$tick['supervisor']][$tick['id']] = $tick; 273 | $list_ticket[$tick['supervisor']][$tick['id']]['users_id'] = $tick['supervisor']; 274 | } 275 | } 276 | } 277 | foreach ($list_ticket as $tickets) { 278 | Plugin::loadLang('additionalalerts'); 279 | 280 | if (NotificationEvent::raiseEvent( 281 | 'ticketunresolved', 282 | $ticket, 283 | [ 284 | 'entities_id' => $entity, 285 | 'items' => $tickets 286 | ] 287 | )) { 288 | $task->addVolume(1); 289 | $cron_status = 1; 290 | } 291 | } 292 | } 293 | } 294 | 295 | return $cron_status; 296 | } 297 | 298 | 299 | /** 300 | * @param Entity $entity 301 | * 302 | * @return bool 303 | */ 304 | static function showNotificationOptions(Entity $entity) 305 | { 306 | $ID = $entity->getField('id'); 307 | if (!$entity->can($ID, READ)) { 308 | return false; 309 | } 310 | 311 | // Notification right applied 312 | $canedit = Session::haveRight('notification', UPDATE) && Session::haveAccessToEntity($ID); 313 | 314 | // Get data 315 | $entitynotification = new TicketUnresolved(); 316 | 317 | if (!$entitynotification->getFromDBByCrit(['entities_id' => $ID])) { 318 | $entitynotification->getEmpty(); 319 | } 320 | if (empty($entitynotification->fields["delay_ticket_alert"])) { 321 | $entitynotification->fields["delay_ticket_alert"] = 0; 322 | } 323 | if ($canedit) { 324 | echo ""; 325 | } 326 | echo ""; 327 | 328 | echo ""; 336 | 337 | if ($canedit) { 338 | echo ""; 339 | echo ""; 349 | echo "
" . TicketUnresolved::getTypeName(2) . ""; 329 | Alert::dropdownIntegerNever( 330 | 'delay_ticket_alert', 331 | $entitynotification->fields["delay_ticket_alert"], 332 | ['max' => 99] 333 | ); 334 | 335 | echo "
"; 340 | echo Html::hidden('entities_id', ['value' => $ID]); 341 | 342 | if ($entitynotification->fields["id"]) { 343 | echo Html::hidden('id', ['value' => $entitynotification->fields["id"]]); 344 | echo Html::submit(_sx('button', 'Save'), ['name' => 'update', 'class' => 'btn btn-primary']); 345 | } else { 346 | echo Html::submit(_sx('button', 'Save'), ['name' => 'add', 'class' => 'btn btn-primary']); 347 | } 348 | echo "
"; 350 | Html::closeForm(); 351 | } else { 352 | echo ""; 353 | } 354 | } 355 | 356 | } 357 | --------------------------------------------------------------------------------