diff --git a/.atoum.php b/.atoum.php
new file mode 100644
index 0000000000..b692eb3eed
--- /dev/null
+++ b/.atoum.php
@@ -0,0 +1,18 @@
+setRootUrl('file://' . realpath($coverage_dir));
+$script
+ ->addDefaultReport()
+ ->addField($coverageField);
+
+$runner->addTestsFromDirectory(__DIR__ . '/inc');
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000..ccef0560f5
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/vendor/
+.idea
\ No newline at end of file
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000000..41e28b47cb
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,8 @@
+{
+ "name": "infotel/moreticket",
+ "type": "project",
+ "license": "GPLv2+",
+ "require": {
+ "atoum/atoum": "^3.3"
+ }
+}
diff --git a/composer.lock b/composer.lock
new file mode 100644
index 0000000000..faec7f96d0
--- /dev/null
+++ b/composer.lock
@@ -0,0 +1,101 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+ "This file is @generated automatically"
+ ],
+ "content-hash": "44d653552982138444f97cb5b7cd3d8a",
+ "packages": [
+ {
+ "name": "atoum/atoum",
+ "version": "3.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/atoum/atoum.git",
+ "reference": "c5279d0ecd4e2d53af6b38815db2cafee8fc46b6"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/atoum/atoum/zipball/c5279d0ecd4e2d53af6b38815db2cafee8fc46b6",
+ "reference": "c5279d0ecd4e2d53af6b38815db2cafee8fc46b6",
+ "shasum": ""
+ },
+ "require": {
+ "ext-hash": "*",
+ "ext-json": "*",
+ "ext-tokenizer": "*",
+ "ext-xml": "*",
+ "php": "^5.6.0 || ^7.0.0 <7.4.0"
+ },
+ "replace": {
+ "mageekguy/atoum": "*"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "^2"
+ },
+ "suggest": {
+ "atoum/stubs": "Provides IDE support (like autocompletion) for atoum",
+ "ext-mbstring": "Provides support for UTF-8 strings",
+ "ext-xdebug": "Provides code coverage report (>= 2.3)"
+ },
+ "bin": [
+ "bin/atoum"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "classes/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Frédéric Hardy",
+ "email": "frederic.hardy@atoum.org",
+ "homepage": "http://blog.mageekbox.net"
+ },
+ {
+ "name": "François Dussert",
+ "email": "francois.dussert@atoum.org"
+ },
+ {
+ "name": "Gérald Croes",
+ "email": "gerald.croes@atoum.org"
+ },
+ {
+ "name": "Julien Bianchi",
+ "email": "julien.bianchi@atoum.org"
+ },
+ {
+ "name": "Ludovic Fleury",
+ "email": "ludovic.fleury@atoum.org"
+ }
+ ],
+ "description": "Simple modern and intuitive unit testing framework for PHP 5.3+",
+ "homepage": "http://www.atoum.org",
+ "keywords": [
+ "TDD",
+ "atoum",
+ "test",
+ "unit testing"
+ ],
+ "time": "2018-03-15T22:46:39+00:00"
+ }
+ ],
+ "packages-dev": [],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": [],
+ "platform-dev": []
+}
diff --git a/css/hide_task_duration.css b/css/hide_task_duration.css
new file mode 100644
index 0000000000..a3c08318bb
--- /dev/null
+++ b/css/hide_task_duration.css
@@ -0,0 +1,3 @@
+.actiontime{
+ display:none !important
+}
\ No newline at end of file
diff --git a/moreticket.css b/css/moreticket.css
similarity index 100%
rename from moreticket.css
rename to css/moreticket.css
diff --git a/inc/profile.class.php b/inc/profile.class.php
index f3fc599467..1fdc7c834c 100644
--- a/inc/profile.class.php
+++ b/inc/profile.class.php
@@ -45,7 +45,6 @@ class PluginMoreticketProfile extends CommonDBTM {
* @return string|translated
*/
function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) {
-
if ($item->getType() == 'Profile') {
return __('More ticket', 'moreticket');
}
@@ -68,6 +67,11 @@ static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtem
self::addDefaultProfileInfos($ID,
['plugin_moreticket' => 0,
'plugin_moreticket_justification' => 0]);
+
+ self::addDefaultProfileInfos($ID,
+ ['plugin_moreticket' => 0,
+ 'plugin_moreticket_hide_task_duration' => 0]);
+
$prof->showForm($ID);
}
@@ -82,6 +86,10 @@ static function createFirstAccess($ID) {
self::addDefaultProfileInfos($ID,
['plugin_moreticket' => 127,
'plugin_moreticket_justification' => 1], true);
+
+ self::addDefaultProfileInfos($ID,
+ ['plugin_moreticket' => 127,
+ 'plugin_moreticket_hide_task_duration' => 1], true);
}
/**
@@ -152,6 +160,15 @@ function showForm($profiles_id = 0, $openform = true, $closeform = true) {
Html::showCheckbox(['name' => '_plugin_moreticket_justification',
'checked' => $effective_rights['plugin_moreticket_justification']]);
echo "\n";
+
+ $effective_rights = ProfileRight::getProfileRights($profiles_id, ['plugin_moreticket_hide_task_duration']);
+ echo "
";
+ echo "" . __('Hide task duration in tickets', 'moreticket') . " | ";
+ echo "";
+ Html::showCheckbox(['name' => '_plugin_moreticket_hide_task_duration',
+ 'checked' => $effective_rights['plugin_moreticket_hide_task_duration']]);
+ echo " |
\n";
+
echo "";
if ($canedit
@@ -231,6 +248,7 @@ static function migrateOneProfile($profiles_id) {
foreach ($DB->request('glpi_plugin_moreticket_profiles',
"`profiles_id`='$profiles_id'") as $profile_data) {
+ // plugin_moreticket_justification
$matching = ['moreticket' => 'plugin_moreticket',
'justification' => 'plugin_moreticket_justification'];
$current_rights = ProfileRight::getProfileRights($profiles_id, array_values($matching));
@@ -242,6 +260,19 @@ static function migrateOneProfile($profiles_id) {
$DB->query($query);
}
}
+
+ // plugin_moreticket_hide_task_duration
+ $matching = ['moreticket' => 'plugin_moreticket',
+ 'justification' => 'plugin_moreticket_hide_task_duration'];
+ $current_rights = ProfileRight::getProfileRights($profiles_id, array_values($matching));
+ foreach ($matching as $old => $new) {
+ if (!isset($current_rights[$old])) {
+ $query = "UPDATE `glpi_profilerights`
+ SET `rights`='" . self::translateARight($profile_data[$old]) . "'
+ WHERE `name`='$new' AND `profiles_id`='$profiles_id'";
+ $DB->query($query);
+ }
+ }
}
}
diff --git a/locales/cs_CZ.po b/locales/cs_CZ.po
index ecaa1190c8..d5ac1e2c3a 100644
--- a/locales/cs_CZ.po
+++ b/locales/cs_CZ.po
@@ -8,9 +8,15 @@ msgid ""
msgstr ""
"Project-Id-Version: GLPI Project - moreticket plugin\n"
"Report-Msgid-Bugs-To: \n"
+<<<<<<< HEAD
"POT-Creation-Date: 2018-07-20 10:19+0200\n"
"PO-Revision-Date: 2018-07-09 10:18+0000\n"
"Last-Translator: Pavel Borecki \n"
+=======
+"POT-Creation-Date: 2019-02-26 15:54+0100\n"
+"PO-Revision-Date: 2019-02-26 15:09+0000\n"
+"Last-Translator: Mathieu Templier \n"
+>>>>>>> hide_time_task_by_profil
"Language-Team: Czech (Czech Republic) (http://www.transifex.com/tsmr/GLPI_moreticket/language/cs_CZ/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -18,18 +24,19 @@ msgstr ""
"Language: cs_CZ\n"
"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"
-#: hook.php:197 inc/waitingticket.class.php:138
-#: inc/waitingticket.class.php:237 inc/waitingticket.class.php:316
-#: inc/waitingticket.class.php:388
+#: hook.php:200 inc/waitingticket.class.php:139
+#: inc/waitingticket.class.php:238 inc/waitingticket.class.php:317
+#: inc/waitingticket.class.php:390
msgid "Reason"
msgstr "Důvod"
-#: hook.php:205 inc/waitingticket.class.php:130
-#: inc/waitingticket.class.php:252 inc/waitingticket.class.php:331
-#: inc/waitingticket.class.php:390
+#: hook.php:208 inc/waitingticket.class.php:131
+#: inc/waitingticket.class.php:253 inc/waitingticket.class.php:332
+#: inc/waitingticket.class.php:392
msgid "Postponement date"
msgstr "Datum na které odložit"
+<<<<<<< HEAD
#: hook.php:225 hook.php:232 hook.php:239 hook.php:246
#: inc/closeticket.class.php:74 inc/closeticket.class.php:116
#: inc/closeticket.class.php:171 inc/closeticket.class.php:299
@@ -38,32 +45,59 @@ msgid "Close ticket informations"
msgstr "Informace o uzavření požadavku"
#: setup.php:92 inc/profile.class.php:50 inc/profile.class.php:177
+=======
+#: hook.php:228 hook.php:235 hook.php:242 hook.php:249
+#: inc/closeticket.class.php:75 inc/closeticket.class.php:79
+#: inc/closeticket.class.php:121 inc/closeticket.class.php:178
+#: inc/closeticket.class.php:326 inc/closeticket.class.php:380
+#: inc/config.class.php:167
+msgid "Close ticket informations"
+msgstr "Informace o uzavření požadavku"
+
+#: setup.php:94 inc/profile.class.php:49 inc/profile.class.php:194
+>>>>>>> hide_time_task_by_profil
msgid "More ticket"
msgstr "Více k požadavku"
-#: front/config.form.php:65
+#: front/config.form.php:66
msgid "Please activate the plugin"
msgstr "Zapněte zásuvný modul"
+<<<<<<< HEAD
#: inc/closeticket.class.php:130 inc/closeticket.class.php:447
+=======
+#: inc/closeticket.class.php:135 inc/closeticket.class.php:479
+>>>>>>> hide_time_task_by_profil
msgid "Solution description"
msgstr "Popis řešení"
-#: inc/closeticket.class.php:149
+#: inc/closeticket.class.php:154
msgid "Ticket cannot be closed"
msgstr "Požadavek není možné uzavřít"
+<<<<<<< HEAD
#: inc/closeticket.class.php:527
+=======
+#: inc/closeticket.class.php:576
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s added closing informations"
msgstr "%1$s přidal informace o uzavření"
+<<<<<<< HEAD
#: inc/closeticket.class.php:543
+=======
+#: inc/closeticket.class.php:595
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s updated closing informations"
msgstr "%1$s aktualizoval informace o uzavření"
+<<<<<<< HEAD
#: inc/closeticket.class.php:559
+=======
+#: inc/closeticket.class.php:614
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s deleted closing informations"
msgstr "%1$s smazal informace o uzavření"
@@ -128,10 +162,14 @@ msgstr "Použít zdůvodnění kolonky naléhavost"
msgid "Urgency impacted justification for the field"
msgstr "Naléhavostí ovlivněné zdůvodnění pro tuto kolonku"
-#: inc/profile.class.php:150
+#: inc/profile.class.php:158
msgid "Adding a justification of urgency"
msgstr "Přidává se odůvodnění naléhavosti"
+#: inc/profile.class.php:166
+msgid "Hide task duration in tickets"
+msgstr ""
+
#: inc/urgencyticket.class.php:69 inc/urgencyticket.class.php:155
msgid "Justification"
msgstr "Odůvodnění"
@@ -140,7 +178,7 @@ msgstr "Odůvodnění"
msgid "Urgency ticket cannot be saved"
msgstr "Naléhavost požadavku se nedaří uložit"
-#: inc/urgencyticket.class.php:94 inc/waitingticket.class.php:170
+#: inc/urgencyticket.class.php:94 inc/waitingticket.class.php:171
msgid "Ticket cannot be saved"
msgstr "Požadavek není možné uložit"
@@ -152,27 +190,27 @@ msgstr[1] "Čekající požadavky"
msgstr[2] "Čekajících požadavků"
msgstr[3] "Čekající požadavky"
-#: inc/waitingticket.class.php:168
+#: inc/waitingticket.class.php:169
msgid "Waiting ticket cannot be saved"
msgstr "Čekající požadavek není možné uložit"
-#: inc/waitingticket.class.php:174
+#: inc/waitingticket.class.php:175
msgid "Report date is inferior of today's date"
msgstr "Datum odkladu je dřívější než to dnešní"
-#: inc/waitingticket.class.php:384 inc/waitingticket.class.php:424
+#: inc/waitingticket.class.php:386 inc/waitingticket.class.php:426
msgid "Ticket suspension history"
msgstr "Historie suspendování požadavku"
-#: inc/waitingticket.class.php:387
+#: inc/waitingticket.class.php:389
msgid "Suspension date"
msgstr "Datum suspendování"
-#: inc/waitingticket.class.php:391
+#: inc/waitingticket.class.php:393
msgid "Suspension end date"
msgstr "Datum konce suspendování"
-#: inc/waitingticket.class.php:741
+#: inc/waitingticket.class.php:751
msgid "End of standby ticket"
msgstr "Konec pohotovosti požadavku"
diff --git a/locales/en_GB.po b/locales/en_GB.po
index 04af816475..c6d51ac8a5 100644
--- a/locales/en_GB.po
+++ b/locales/en_GB.po
@@ -7,9 +7,15 @@ msgid ""
msgstr ""
"Project-Id-Version: GLPI Project - moreticket plugin\n"
"Report-Msgid-Bugs-To: \n"
+<<<<<<< HEAD
"POT-Creation-Date: 2018-07-20 10:19+0200\n"
"PO-Revision-Date: 2018-07-09 07:29+0000\n"
"Last-Translator: Amandine Manceau\n"
+=======
+"POT-Creation-Date: 2019-02-26 15:54+0100\n"
+"PO-Revision-Date: 2019-02-26 15:09+0000\n"
+"Last-Translator: Mathieu Templier \n"
+>>>>>>> hide_time_task_by_profil
"Language-Team: English (United Kingdom) (http://www.transifex.com/tsmr/GLPI_moreticket/language/en_GB/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -17,18 +23,19 @@ msgstr ""
"Language: en_GB\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: hook.php:197 inc/waitingticket.class.php:138
-#: inc/waitingticket.class.php:237 inc/waitingticket.class.php:316
-#: inc/waitingticket.class.php:388
+#: hook.php:200 inc/waitingticket.class.php:139
+#: inc/waitingticket.class.php:238 inc/waitingticket.class.php:317
+#: inc/waitingticket.class.php:390
msgid "Reason"
msgstr "Reason"
-#: hook.php:205 inc/waitingticket.class.php:130
-#: inc/waitingticket.class.php:252 inc/waitingticket.class.php:331
-#: inc/waitingticket.class.php:390
+#: hook.php:208 inc/waitingticket.class.php:131
+#: inc/waitingticket.class.php:253 inc/waitingticket.class.php:332
+#: inc/waitingticket.class.php:392
msgid "Postponement date"
msgstr "Postponement date"
+<<<<<<< HEAD
#: hook.php:225 hook.php:232 hook.php:239 hook.php:246
#: inc/closeticket.class.php:74 inc/closeticket.class.php:116
#: inc/closeticket.class.php:171 inc/closeticket.class.php:299
@@ -37,32 +44,59 @@ msgid "Close ticket informations"
msgstr "Close ticket informations"
#: setup.php:92 inc/profile.class.php:50 inc/profile.class.php:177
+=======
+#: hook.php:228 hook.php:235 hook.php:242 hook.php:249
+#: inc/closeticket.class.php:75 inc/closeticket.class.php:79
+#: inc/closeticket.class.php:121 inc/closeticket.class.php:178
+#: inc/closeticket.class.php:326 inc/closeticket.class.php:380
+#: inc/config.class.php:167
+msgid "Close ticket informations"
+msgstr "Close ticket informations"
+
+#: setup.php:94 inc/profile.class.php:49 inc/profile.class.php:194
+>>>>>>> hide_time_task_by_profil
msgid "More ticket"
msgstr "More ticket"
-#: front/config.form.php:65
+#: front/config.form.php:66
msgid "Please activate the plugin"
msgstr "Please activate the plugin"
+<<<<<<< HEAD
#: inc/closeticket.class.php:130 inc/closeticket.class.php:447
+=======
+#: inc/closeticket.class.php:135 inc/closeticket.class.php:479
+>>>>>>> hide_time_task_by_profil
msgid "Solution description"
msgstr "Solution description"
-#: inc/closeticket.class.php:149
+#: inc/closeticket.class.php:154
msgid "Ticket cannot be closed"
msgstr "Ticket cannot be closed"
+<<<<<<< HEAD
#: inc/closeticket.class.php:527
+=======
+#: inc/closeticket.class.php:576
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s added closing informations"
msgstr "%1$s added closing informations"
+<<<<<<< HEAD
#: inc/closeticket.class.php:543
+=======
+#: inc/closeticket.class.php:595
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s updated closing informations"
msgstr "%1$s updated closing informations"
+<<<<<<< HEAD
#: inc/closeticket.class.php:559
+=======
+#: inc/closeticket.class.php:614
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s deleted closing informations"
msgstr "%1$s deleted closing informations"
@@ -127,10 +161,14 @@ msgstr "Use a justification of the urgency field"
msgid "Urgency impacted justification for the field"
msgstr "Urgency impacted justification for the field"
-#: inc/profile.class.php:150
+#: inc/profile.class.php:158
msgid "Adding a justification of urgency"
msgstr "Adding a justification of urgency"
+#: inc/profile.class.php:166
+msgid "Hide task duration in tickets"
+msgstr "Hide task duration in tickets"
+
#: inc/urgencyticket.class.php:69 inc/urgencyticket.class.php:155
msgid "Justification"
msgstr "Justification"
@@ -139,7 +177,7 @@ msgstr "Justification"
msgid "Urgency ticket cannot be saved"
msgstr "Urgency ticket cannot be saved"
-#: inc/urgencyticket.class.php:94 inc/waitingticket.class.php:170
+#: inc/urgencyticket.class.php:94 inc/waitingticket.class.php:171
msgid "Ticket cannot be saved"
msgstr "Ticket cannot be saved"
@@ -149,27 +187,27 @@ msgid_plural "Waiting tickets"
msgstr[0] "Waiting ticket"
msgstr[1] "Waiting tickets"
-#: inc/waitingticket.class.php:168
+#: inc/waitingticket.class.php:169
msgid "Waiting ticket cannot be saved"
msgstr "Waiting ticket cannot be saved"
-#: inc/waitingticket.class.php:174
+#: inc/waitingticket.class.php:175
msgid "Report date is inferior of today's date"
msgstr "Report date is inferior of today's date"
-#: inc/waitingticket.class.php:384 inc/waitingticket.class.php:424
+#: inc/waitingticket.class.php:386 inc/waitingticket.class.php:426
msgid "Ticket suspension history"
msgstr "Ticket suspension history"
-#: inc/waitingticket.class.php:387
+#: inc/waitingticket.class.php:389
msgid "Suspension date"
msgstr "Suspension date"
-#: inc/waitingticket.class.php:391
+#: inc/waitingticket.class.php:393
msgid "Suspension end date"
msgstr "Suspension end date"
-#: inc/waitingticket.class.php:741
+#: inc/waitingticket.class.php:751
msgid "End of standby ticket"
msgstr "End of standby ticket"
diff --git a/locales/es_AR.po b/locales/es_AR.po
index 46e0d027a7..8754dc7bb7 100644
--- a/locales/es_AR.po
+++ b/locales/es_AR.po
@@ -9,9 +9,15 @@ msgid ""
msgstr ""
"Project-Id-Version: GLPI Project - moreticket plugin\n"
"Report-Msgid-Bugs-To: \n"
+<<<<<<< HEAD
"POT-Creation-Date: 2018-07-20 10:19+0200\n"
"PO-Revision-Date: 2018-12-12 14:25+0000\n"
"Last-Translator: Gustavo Plottier Pilotto \n"
+=======
+"POT-Creation-Date: 2019-02-26 15:54+0100\n"
+"PO-Revision-Date: 2019-02-26 15:09+0000\n"
+"Last-Translator: Mathieu Templier \n"
+>>>>>>> hide_time_task_by_profil
"Language-Team: Spanish (Argentina) (http://www.transifex.com/tsmr/GLPI_moreticket/language/es_AR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -19,18 +25,19 @@ msgstr ""
"Language: es_AR\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: hook.php:197 inc/waitingticket.class.php:138
-#: inc/waitingticket.class.php:237 inc/waitingticket.class.php:316
-#: inc/waitingticket.class.php:388
+#: hook.php:200 inc/waitingticket.class.php:139
+#: inc/waitingticket.class.php:238 inc/waitingticket.class.php:317
+#: inc/waitingticket.class.php:390
msgid "Reason"
msgstr "Motivo"
-#: hook.php:205 inc/waitingticket.class.php:130
-#: inc/waitingticket.class.php:252 inc/waitingticket.class.php:331
-#: inc/waitingticket.class.php:390
+#: hook.php:208 inc/waitingticket.class.php:131
+#: inc/waitingticket.class.php:253 inc/waitingticket.class.php:332
+#: inc/waitingticket.class.php:392
msgid "Postponement date"
msgstr "Posponer hasta"
+<<<<<<< HEAD
#: hook.php:225 hook.php:232 hook.php:239 hook.php:246
#: inc/closeticket.class.php:74 inc/closeticket.class.php:116
#: inc/closeticket.class.php:171 inc/closeticket.class.php:299
@@ -39,32 +46,59 @@ msgid "Close ticket informations"
msgstr "Informaciones del Req. Cerrado"
#: setup.php:92 inc/profile.class.php:50 inc/profile.class.php:177
+=======
+#: hook.php:228 hook.php:235 hook.php:242 hook.php:249
+#: inc/closeticket.class.php:75 inc/closeticket.class.php:79
+#: inc/closeticket.class.php:121 inc/closeticket.class.php:178
+#: inc/closeticket.class.php:326 inc/closeticket.class.php:380
+#: inc/config.class.php:167
+msgid "Close ticket informations"
+msgstr "Informaciones del Req. Cerrado"
+
+#: setup.php:94 inc/profile.class.php:49 inc/profile.class.php:194
+>>>>>>> hide_time_task_by_profil
msgid "More ticket"
msgstr "Más requerimientos"
-#: front/config.form.php:65
+#: front/config.form.php:66
msgid "Please activate the plugin"
msgstr "Por favor activar el complemento"
+<<<<<<< HEAD
#: inc/closeticket.class.php:130 inc/closeticket.class.php:447
+=======
+#: inc/closeticket.class.php:135 inc/closeticket.class.php:479
+>>>>>>> hide_time_task_by_profil
msgid "Solution description"
msgstr "Descripción"
-#: inc/closeticket.class.php:149
+#: inc/closeticket.class.php:154
msgid "Ticket cannot be closed"
msgstr "Requerimiento no se puede cerrar"
+<<<<<<< HEAD
#: inc/closeticket.class.php:527
+=======
+#: inc/closeticket.class.php:576
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s added closing informations"
msgstr "%1$s informaciones de cierres agregada"
+<<<<<<< HEAD
#: inc/closeticket.class.php:543
+=======
+#: inc/closeticket.class.php:595
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s updated closing informations"
msgstr "%1$s informaciones de cierres actualizadas"
+<<<<<<< HEAD
#: inc/closeticket.class.php:559
+=======
+#: inc/closeticket.class.php:614
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s deleted closing informations"
msgstr "%1$s informaciones de cierres borradas"
@@ -129,9 +163,16 @@ msgstr "Justifique la urgencia de la llamada"
msgid "Urgency impacted justification for the field"
msgstr "Impacto de la justificación de la llamada"
-#: inc/profile.class.php:150
+#: inc/profile.class.php:158
msgid "Adding a justification of urgency"
msgstr "Agregar la justificación de urgencia "
+<<<<<<< HEAD
+=======
+
+#: inc/profile.class.php:166
+msgid "Hide task duration in tickets"
+msgstr ""
+>>>>>>> hide_time_task_by_profil
#: inc/urgencyticket.class.php:69 inc/urgencyticket.class.php:155
msgid "Justification"
@@ -141,7 +182,7 @@ msgstr "Justificación"
msgid "Urgency ticket cannot be saved"
msgstr "Urgencia de la llamada no se puede grabar "
-#: inc/urgencyticket.class.php:94 inc/waitingticket.class.php:170
+#: inc/urgencyticket.class.php:94 inc/waitingticket.class.php:171
msgid "Ticket cannot be saved"
msgstr "Requerimiento no se puede guardar"
@@ -151,27 +192,27 @@ msgid_plural "Waiting tickets"
msgstr[0] "Esperando servicio"
msgstr[1] "Esperando servicios"
-#: inc/waitingticket.class.php:168
+#: inc/waitingticket.class.php:169
msgid "Waiting ticket cannot be saved"
msgstr "En espera no se puede guardar"
-#: inc/waitingticket.class.php:174
+#: inc/waitingticket.class.php:175
msgid "Report date is inferior of today's date"
msgstr "Fecha de informe es inferior a fecha de hoy"
-#: inc/waitingticket.class.php:384 inc/waitingticket.class.php:424
+#: inc/waitingticket.class.php:386 inc/waitingticket.class.php:426
msgid "Ticket suspension history"
msgstr "Historial de espera"
-#: inc/waitingticket.class.php:387
+#: inc/waitingticket.class.php:389
msgid "Suspension date"
msgstr "Fecha de suspención"
-#: inc/waitingticket.class.php:391
+#: inc/waitingticket.class.php:393
msgid "Suspension end date"
msgstr "Fecha fin de suspención"
-#: inc/waitingticket.class.php:741
+#: inc/waitingticket.class.php:751
msgid "End of standby ticket"
msgstr "Fin de servicio en espera"
diff --git a/locales/es_ES.po b/locales/es_ES.po
index fa40d8c0a5..31fea5b26b 100644
--- a/locales/es_ES.po
+++ b/locales/es_ES.po
@@ -9,9 +9,15 @@ msgid ""
msgstr ""
"Project-Id-Version: GLPI Project - moreticket plugin\n"
"Report-Msgid-Bugs-To: \n"
+<<<<<<< HEAD
"POT-Creation-Date: 2018-07-20 10:19+0200\n"
"PO-Revision-Date: 2018-12-10 13:11+0000\n"
"Last-Translator: Gustavo Plottier Pilotto \n"
+=======
+"POT-Creation-Date: 2019-02-26 15:54+0100\n"
+"PO-Revision-Date: 2019-02-26 15:09+0000\n"
+"Last-Translator: Mathieu Templier \n"
+>>>>>>> hide_time_task_by_profil
"Language-Team: Spanish (Spain) (http://www.transifex.com/tsmr/GLPI_moreticket/language/es_ES/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -19,6 +25,7 @@ msgstr ""
"Language: es_ES\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+<<<<<<< HEAD
#: hook.php:197 inc/waitingticket.class.php:138
#: inc/waitingticket.class.php:237 inc/waitingticket.class.php:316
#: inc/waitingticket.class.php:388
@@ -55,16 +62,63 @@ msgid "Ticket cannot be closed"
msgstr "La petición no puede ser cerrada"
#: inc/closeticket.class.php:527
+=======
+#: hook.php:200 inc/waitingticket.class.php:139
+#: inc/waitingticket.class.php:238 inc/waitingticket.class.php:317
+#: inc/waitingticket.class.php:390
+msgid "Reason"
+msgstr "Motivo"
+
+#: hook.php:208 inc/waitingticket.class.php:131
+#: inc/waitingticket.class.php:253 inc/waitingticket.class.php:332
+#: inc/waitingticket.class.php:392
+msgid "Postponement date"
+msgstr "Nueva fecha"
+
+#: hook.php:228 hook.php:235 hook.php:242 hook.php:249
+#: inc/closeticket.class.php:75 inc/closeticket.class.php:79
+#: inc/closeticket.class.php:121 inc/closeticket.class.php:178
+#: inc/closeticket.class.php:326 inc/closeticket.class.php:380
+#: inc/config.class.php:167
+msgid "Close ticket informations"
+msgstr "Informaciones del cierre de la petición"
+
+#: setup.php:94 inc/profile.class.php:49 inc/profile.class.php:194
+msgid "More ticket"
+msgstr "Más peticiones"
+
+#: front/config.form.php:66
+msgid "Please activate the plugin"
+msgstr "Por favor active el complemento"
+
+#: inc/closeticket.class.php:135 inc/closeticket.class.php:479
+msgid "Solution description"
+msgstr "Descripción de la solución "
+
+#: inc/closeticket.class.php:154
+msgid "Ticket cannot be closed"
+msgstr "La petición no puede ser cerrada"
+
+#: inc/closeticket.class.php:576
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s added closing informations"
msgstr "%1$s informaciones del cierre de la petición"
+<<<<<<< HEAD
#: inc/closeticket.class.php:543
+=======
+#: inc/closeticket.class.php:595
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s updated closing informations"
msgstr "%1$sactualizaciones del cierre de la petición"
+<<<<<<< HEAD
#: inc/closeticket.class.php:559
+=======
+#: inc/closeticket.class.php:614
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s deleted closing informations"
msgstr "%1$sinformaciones del cierre apagadas"
@@ -129,10 +183,21 @@ msgstr "Utilizar una justificación del campo de urgencia."
msgid "Urgency impacted justification for the field"
msgstr "Justificativa de la urgencia de impacto en un campo"
+<<<<<<< HEAD
#: inc/profile.class.php:150
msgid "Adding a justification of urgency"
msgstr "Añadiendo una justificación de urgencia"
+=======
+#: inc/profile.class.php:158
+msgid "Adding a justification of urgency"
+msgstr "Añadiendo una justificación de urgencia"
+
+#: inc/profile.class.php:166
+msgid "Hide task duration in tickets"
+msgstr ""
+
+>>>>>>> hide_time_task_by_profil
#: inc/urgencyticket.class.php:69 inc/urgencyticket.class.php:155
msgid "Justification"
msgstr "Justificación"
@@ -141,7 +206,11 @@ msgstr "Justificación"
msgid "Urgency ticket cannot be saved"
msgstr "Petición de urgencia no se puede guardar"
+<<<<<<< HEAD
#: inc/urgencyticket.class.php:94 inc/waitingticket.class.php:170
+=======
+#: inc/urgencyticket.class.php:94 inc/waitingticket.class.php:171
+>>>>>>> hide_time_task_by_profil
msgid "Ticket cannot be saved"
msgstr "La petición no se puede guardar"
@@ -151,6 +220,7 @@ msgid_plural "Waiting tickets"
msgstr[0] "Petición en espera"
msgstr[1] "Peticiones en espera"
+<<<<<<< HEAD
#: inc/waitingticket.class.php:168
msgid "Waiting ticket cannot be saved"
msgstr "Petición en espera no se puede guardar"
@@ -172,6 +242,29 @@ msgid "Suspension end date"
msgstr "Fecha de finalización de la suspensión"
#: inc/waitingticket.class.php:741
+=======
+#: inc/waitingticket.class.php:169
+msgid "Waiting ticket cannot be saved"
+msgstr "Petición en espera no se puede guardar"
+
+#: inc/waitingticket.class.php:175
+msgid "Report date is inferior of today's date"
+msgstr "La fecha del informe es inferior a la fecha de hoy."
+
+#: inc/waitingticket.class.php:386 inc/waitingticket.class.php:426
+msgid "Ticket suspension history"
+msgstr "Historial de suspensión de peticiones"
+
+#: inc/waitingticket.class.php:389
+msgid "Suspension date"
+msgstr "Fecha de suspensión"
+
+#: inc/waitingticket.class.php:393
+msgid "Suspension end date"
+msgstr "Fecha de finalización de la suspensión"
+
+#: inc/waitingticket.class.php:751
+>>>>>>> hide_time_task_by_profil
msgid "End of standby ticket"
msgstr "Fin de la petición de reserva"
diff --git a/locales/fi_FI.mo b/locales/fi_FI.mo
new file mode 100644
index 0000000000..b57fbea872
Binary files /dev/null and b/locales/fi_FI.mo differ
diff --git a/locales/fi_FI.po b/locales/fi_FI.po
new file mode 100644
index 0000000000..e45f51a03d
--- /dev/null
+++ b/locales/fi_FI.po
@@ -0,0 +1,186 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR MoreTicket Development Team
+# This file is distributed under the same license as the GLPI - MoreTicket plugin package.
+#
+# Translators:
+# Markku Vepsä, 2018
+msgid ""
+msgstr ""
+"Project-Id-Version: GLPI Project - moreticket plugin\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2019-02-26 15:54+0100\n"
+"PO-Revision-Date: 2019-02-26 15:09+0000\n"
+"Last-Translator: Mathieu Templier \n"
+"Language-Team: Finnish (Finland) (http://www.transifex.com/tsmr/GLPI_moreticket/language/fi_FI/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: fi_FI\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: hook.php:200 inc/waitingticket.class.php:139
+#: inc/waitingticket.class.php:238 inc/waitingticket.class.php:317
+#: inc/waitingticket.class.php:390
+msgid "Reason"
+msgstr "Syy"
+
+#: hook.php:208 inc/waitingticket.class.php:131
+#: inc/waitingticket.class.php:253 inc/waitingticket.class.php:332
+#: inc/waitingticket.class.php:392
+msgid "Postponement date"
+msgstr "Lykkäyspäivä"
+
+#: hook.php:228 hook.php:235 hook.php:242 hook.php:249
+#: inc/closeticket.class.php:75 inc/closeticket.class.php:79
+#: inc/closeticket.class.php:121 inc/closeticket.class.php:178
+#: inc/closeticket.class.php:326 inc/closeticket.class.php:380
+#: inc/config.class.php:167
+msgid "Close ticket informations"
+msgstr "Sulje tiketin tiedot"
+
+#: setup.php:94 inc/profile.class.php:49 inc/profile.class.php:194
+msgid "More ticket"
+msgstr "Lisää tiketöintiä"
+
+#: front/config.form.php:66
+msgid "Please activate the plugin"
+msgstr "Ole hyvä ja aktivoi liitännäinen"
+
+#: inc/closeticket.class.php:135 inc/closeticket.class.php:479
+msgid "Solution description"
+msgstr "Ratkaisun kuvaus"
+
+#: inc/closeticket.class.php:154
+msgid "Ticket cannot be closed"
+msgstr "Tikettiä ei voida sulkea"
+
+#: inc/closeticket.class.php:576
+#, php-format
+msgid "%1$s added closing informations"
+msgstr "%1$s lisätty sulkemista koskevat tiedot"
+
+#: inc/closeticket.class.php:595
+#, php-format
+msgid "%1$s updated closing informations"
+msgstr "%1$s päivitetty sulkemista koskevat tiedot"
+
+#: inc/closeticket.class.php:614
+#, php-format
+msgid "%1$s deleted closing informations"
+msgstr "%1$s poistettu sulkemista koskevat tiedot"
+
+#: inc/config.class.php:98
+msgid "Ticket waiting"
+msgstr "Odottava tiketti"
+
+#: inc/config.class.php:102
+msgid "Use waiting process"
+msgstr "Käytä odotus menetelmää"
+
+#: inc/config.class.php:120
+msgid "Report date is mandatory"
+msgstr "Raportin päivämäärä on pakollinen"
+
+#: inc/config.class.php:127
+msgid "Waiting type is mandatory"
+msgstr "Odotuksen tyyppi on pakollinen"
+
+#: inc/config.class.php:134
+msgid "Waiting reason is mandatory"
+msgstr "Odotuksen syy on pakollinen"
+
+#: inc/config.class.php:140
+msgid "Ticket resolution and close"
+msgstr "Tiketin ratkaisu ja sulkeminen"
+
+#: inc/config.class.php:142
+msgid "Use solution process"
+msgstr "Käytä ratkaisuprosessia"
+
+#: inc/config.class.php:160
+msgid "Solution type is mandatory"
+msgstr "Ratkaisun tyyppi on pakollinen"
+
+#: inc/config.class.php:173
+msgid "Status used to display solution bloc"
+msgstr "Tila, jota käytetään näyttämään ratkaisuryhmä"
+
+#: inc/config.class.php:186
+msgid "Add a followup on immediate ticket closing"
+msgstr "Lisää seuranta välittömään tiketin sulkemiseen"
+
+#: inc/config.class.php:192
+msgid "Use the 'Duration' field in the add solution interface"
+msgstr "Käytä Lisää ratkaisu -rajapinnan 'Kesto' -kenttää"
+
+#: inc/config.class.php:206
+msgid "Mandatory 'Duration' field"
+msgstr "Pakollinen 'Kesto' -kenttä"
+
+#: inc/config.class.php:211
+msgid "Ticket urgency"
+msgstr "Tiketin kiireellisyys"
+
+#: inc/config.class.php:213
+msgid "Use a justification of the urgency field"
+msgstr "Käytä kiireellisyyskentän perustelua"
+
+#: inc/config.class.php:229
+msgid "Urgency impacted justification for the field"
+msgstr "Kiireellisyys vaikutti kentän perusteluun"
+
+#: inc/profile.class.php:158
+msgid "Adding a justification of urgency"
+msgstr "Lisää perustelu kiireellisyydelle"
+
+#: inc/profile.class.php:166
+msgid "Hide task duration in tickets"
+msgstr ""
+
+#: inc/urgencyticket.class.php:69 inc/urgencyticket.class.php:155
+msgid "Justification"
+msgstr "Perustelu"
+
+#: inc/urgencyticket.class.php:92
+msgid "Urgency ticket cannot be saved"
+msgstr "Kiireellisyys tikettiä ei voida tallentaa"
+
+#: inc/urgencyticket.class.php:94 inc/waitingticket.class.php:171
+msgid "Ticket cannot be saved"
+msgstr "Tikettiä ei voida tallentaa"
+
+#: inc/waitingticket.class.php:65
+msgid "Waiting ticket"
+msgid_plural "Waiting tickets"
+msgstr[0] "Odottava tiketti"
+msgstr[1] "Odottavat tiketit"
+
+#: inc/waitingticket.class.php:169
+msgid "Waiting ticket cannot be saved"
+msgstr "Odottavaa tikettiä ei voida tallentaa"
+
+#: inc/waitingticket.class.php:175
+msgid "Report date is inferior of today's date"
+msgstr "Raportin päivämäärä on tätä päivää aiempi"
+
+#: inc/waitingticket.class.php:386 inc/waitingticket.class.php:426
+msgid "Ticket suspension history"
+msgstr "Tiketin keskeytys historia"
+
+#: inc/waitingticket.class.php:389
+msgid "Suspension date"
+msgstr "Keskeytyspäivä"
+
+#: inc/waitingticket.class.php:393
+msgid "Suspension end date"
+msgstr "Keskeytyksen päättymispäivä"
+
+#: inc/waitingticket.class.php:751
+msgid "End of standby ticket"
+msgstr "Tiketin valmiustilan loppu"
+
+#: inc/waitingtype.class.php:48
+msgid "Waiting type"
+msgid_plural "Waiting types"
+msgstr[0] "Odotuksen tyyppi"
+msgstr[1] "Odotuksien tyypit"
diff --git a/locales/fr_FR.po b/locales/fr_FR.po
index 366c42f314..cb465e1e5c 100644
--- a/locales/fr_FR.po
+++ b/locales/fr_FR.po
@@ -4,14 +4,21 @@
#
# Translators:
# Amandine Manceau, 2016,2018
+# Mathieu Templier , 2019
# Xavier CAILLAUD , 2015-2016
msgid ""
msgstr ""
"Project-Id-Version: GLPI Project - moreticket plugin\n"
"Report-Msgid-Bugs-To: \n"
+<<<<<<< HEAD
"POT-Creation-Date: 2018-07-20 10:19+0200\n"
"PO-Revision-Date: 2018-07-09 07:30+0000\n"
"Last-Translator: Amandine Manceau\n"
+=======
+"POT-Creation-Date: 2019-02-26 15:54+0100\n"
+"PO-Revision-Date: 2019-02-26 15:09+0000\n"
+"Last-Translator: Mathieu Templier \n"
+>>>>>>> hide_time_task_by_profil
"Language-Team: French (France) (http://www.transifex.com/tsmr/GLPI_moreticket/language/fr_FR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -19,18 +26,19 @@ msgstr ""
"Language: fr_FR\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-#: hook.php:197 inc/waitingticket.class.php:138
-#: inc/waitingticket.class.php:237 inc/waitingticket.class.php:316
-#: inc/waitingticket.class.php:388
+#: hook.php:200 inc/waitingticket.class.php:139
+#: inc/waitingticket.class.php:238 inc/waitingticket.class.php:317
+#: inc/waitingticket.class.php:390
msgid "Reason"
msgstr "Raison"
-#: hook.php:205 inc/waitingticket.class.php:130
-#: inc/waitingticket.class.php:252 inc/waitingticket.class.php:331
-#: inc/waitingticket.class.php:390
+#: hook.php:208 inc/waitingticket.class.php:131
+#: inc/waitingticket.class.php:253 inc/waitingticket.class.php:332
+#: inc/waitingticket.class.php:392
msgid "Postponement date"
msgstr "Date de report"
+<<<<<<< HEAD
#: hook.php:225 hook.php:232 hook.php:239 hook.php:246
#: inc/closeticket.class.php:74 inc/closeticket.class.php:116
#: inc/closeticket.class.php:171 inc/closeticket.class.php:299
@@ -39,32 +47,59 @@ msgid "Close ticket informations"
msgstr "Informations de clôture des tickets"
#: setup.php:92 inc/profile.class.php:50 inc/profile.class.php:177
+=======
+#: hook.php:228 hook.php:235 hook.php:242 hook.php:249
+#: inc/closeticket.class.php:75 inc/closeticket.class.php:79
+#: inc/closeticket.class.php:121 inc/closeticket.class.php:178
+#: inc/closeticket.class.php:326 inc/closeticket.class.php:380
+#: inc/config.class.php:167
+msgid "Close ticket informations"
+msgstr "Informations de clôture des tickets"
+
+#: setup.php:94 inc/profile.class.php:49 inc/profile.class.php:194
+>>>>>>> hide_time_task_by_profil
msgid "More ticket"
msgstr "More ticket"
-#: front/config.form.php:65
+#: front/config.form.php:66
msgid "Please activate the plugin"
msgstr "Merci d'activer le plugin"
+<<<<<<< HEAD
#: inc/closeticket.class.php:130 inc/closeticket.class.php:447
+=======
+#: inc/closeticket.class.php:135 inc/closeticket.class.php:479
+>>>>>>> hide_time_task_by_profil
msgid "Solution description"
msgstr "Description de la solution"
-#: inc/closeticket.class.php:149
+#: inc/closeticket.class.php:154
msgid "Ticket cannot be closed"
msgstr "Impossible de clore le ticket"
+<<<<<<< HEAD
#: inc/closeticket.class.php:527
+=======
+#: inc/closeticket.class.php:576
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s added closing informations"
msgstr "%1$s a ajouté des informations de clôture"
+<<<<<<< HEAD
#: inc/closeticket.class.php:543
+=======
+#: inc/closeticket.class.php:595
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s updated closing informations"
msgstr "%1$s a mis à jour des informations de clôture"
+<<<<<<< HEAD
#: inc/closeticket.class.php:559
+=======
+#: inc/closeticket.class.php:614
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s deleted closing informations"
msgstr "%1$s a supprimé des informations de clôture"
@@ -129,10 +164,14 @@ msgstr "Utiliser une zone de justification sur l'urgence"
msgid "Urgency impacted justification for the field"
msgstr "Urgences impactées pour la zone de justification"
-#: inc/profile.class.php:150
+#: inc/profile.class.php:158
msgid "Adding a justification of urgency"
msgstr "Ajout d'une zone de justification pour l'urgence"
+#: inc/profile.class.php:166
+msgid "Hide task duration in tickets"
+msgstr "Cacher la durée des tâches d'un ticket"
+
#: inc/urgencyticket.class.php:69 inc/urgencyticket.class.php:155
msgid "Justification"
msgstr "Justification"
@@ -141,7 +180,7 @@ msgstr "Justification"
msgid "Urgency ticket cannot be saved"
msgstr "Impossible d'enregistrer l'urgence du ticket"
-#: inc/urgencyticket.class.php:94 inc/waitingticket.class.php:170
+#: inc/urgencyticket.class.php:94 inc/waitingticket.class.php:171
msgid "Ticket cannot be saved"
msgstr "Impossible d'enregistrer le ticket"
@@ -151,27 +190,27 @@ msgid_plural "Waiting tickets"
msgstr[0] "Mise en attente"
msgstr[1] "Mises en attente"
-#: inc/waitingticket.class.php:168
+#: inc/waitingticket.class.php:169
msgid "Waiting ticket cannot be saved"
msgstr "Impossible d'enregistrer la mise en attente"
-#: inc/waitingticket.class.php:174
+#: inc/waitingticket.class.php:175
msgid "Report date is inferior of today's date"
msgstr "Date de report inférieure à la date d'aujourd'hui"
-#: inc/waitingticket.class.php:384 inc/waitingticket.class.php:424
+#: inc/waitingticket.class.php:386 inc/waitingticket.class.php:426
msgid "Ticket suspension history"
msgstr "Historique des suspensions de ticket"
-#: inc/waitingticket.class.php:387
+#: inc/waitingticket.class.php:389
msgid "Suspension date"
msgstr "Date de suspension"
-#: inc/waitingticket.class.php:391
+#: inc/waitingticket.class.php:393
msgid "Suspension end date"
msgstr "Date de fin de suspension"
-#: inc/waitingticket.class.php:741
+#: inc/waitingticket.class.php:751
msgid "End of standby ticket"
msgstr "Fin des mises en attente"
diff --git a/locales/glpi.pot b/locales/glpi.pot
index 1caf203972..511547b5d7 100644
--- a/locales/glpi.pot
+++ b/locales/glpi.pot
@@ -8,7 +8,11 @@ msgid ""
msgstr ""
"Project-Id-Version: GLPI - MoreTicket plugin 1.3.0\n"
"Report-Msgid-Bugs-To: \n"
+<<<<<<< HEAD
"POT-Creation-Date: 2019-02-24 15:32+0100\n"
+=======
+"POT-Creation-Date: 2019-02-26 15:54+0100\n"
+>>>>>>> hide_time_task_by_profil
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -36,7 +40,11 @@ msgstr ""
msgid "Close ticket informations"
msgstr ""
+<<<<<<< HEAD
#: setup.php:92 inc/profile.class.php:50 inc/profile.class.php:177
+=======
+#: setup.php:94 inc/profile.class.php:49 inc/profile.class.php:194
+>>>>>>> hide_time_task_by_profil
msgid "More ticket"
msgstr ""
@@ -127,10 +135,14 @@ msgstr ""
msgid "Urgency impacted justification for the field"
msgstr ""
-#: inc/profile.class.php:150
+#: inc/profile.class.php:158
msgid "Adding a justification of urgency"
msgstr ""
+#: inc/profile.class.php:166
+msgid "Hide task duration in tickets"
+msgstr ""
+
#: inc/urgencyticket.class.php:69 inc/urgencyticket.class.php:155
msgid "Justification"
msgstr ""
@@ -169,7 +181,11 @@ msgstr ""
msgid "Suspension end date"
msgstr ""
+<<<<<<< HEAD
#: inc/waitingticket.class.php:754
+=======
+#: inc/waitingticket.class.php:751
+>>>>>>> hide_time_task_by_profil
msgid "End of standby ticket"
msgstr ""
diff --git a/locales/pt_BR.po b/locales/pt_BR.po
index f3ffae6205..b2f37571d3 100644
--- a/locales/pt_BR.po
+++ b/locales/pt_BR.po
@@ -11,9 +11,15 @@ msgid ""
msgstr ""
"Project-Id-Version: GLPI Project - moreticket plugin\n"
"Report-Msgid-Bugs-To: \n"
+<<<<<<< HEAD
"POT-Creation-Date: 2018-07-20 10:19+0200\n"
"PO-Revision-Date: 2018-12-10 13:18+0000\n"
"Last-Translator: Gustavo Plottier Pilotto \n"
+=======
+"POT-Creation-Date: 2019-02-26 15:54+0100\n"
+"PO-Revision-Date: 2019-02-26 15:09+0000\n"
+"Last-Translator: Mathieu Templier \n"
+>>>>>>> hide_time_task_by_profil
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/tsmr/GLPI_moreticket/language/pt_BR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -21,18 +27,19 @@ msgstr ""
"Language: pt_BR\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-#: hook.php:197 inc/waitingticket.class.php:138
-#: inc/waitingticket.class.php:237 inc/waitingticket.class.php:316
-#: inc/waitingticket.class.php:388
+#: hook.php:200 inc/waitingticket.class.php:139
+#: inc/waitingticket.class.php:238 inc/waitingticket.class.php:317
+#: inc/waitingticket.class.php:390
msgid "Reason"
msgstr "Motivo"
-#: hook.php:205 inc/waitingticket.class.php:130
-#: inc/waitingticket.class.php:252 inc/waitingticket.class.php:331
-#: inc/waitingticket.class.php:390
+#: hook.php:208 inc/waitingticket.class.php:131
+#: inc/waitingticket.class.php:253 inc/waitingticket.class.php:332
+#: inc/waitingticket.class.php:392
msgid "Postponement date"
msgstr "Data de adiamento"
+<<<<<<< HEAD
#: hook.php:225 hook.php:232 hook.php:239 hook.php:246
#: inc/closeticket.class.php:74 inc/closeticket.class.php:116
#: inc/closeticket.class.php:171 inc/closeticket.class.php:299
@@ -41,32 +48,59 @@ msgid "Close ticket informations"
msgstr "Encerrar informações do ticket"
#: setup.php:92 inc/profile.class.php:50 inc/profile.class.php:177
+=======
+#: hook.php:228 hook.php:235 hook.php:242 hook.php:249
+#: inc/closeticket.class.php:75 inc/closeticket.class.php:79
+#: inc/closeticket.class.php:121 inc/closeticket.class.php:178
+#: inc/closeticket.class.php:326 inc/closeticket.class.php:380
+#: inc/config.class.php:167
+msgid "Close ticket informations"
+msgstr "Encerrar informações do ticket"
+
+#: setup.php:94 inc/profile.class.php:49 inc/profile.class.php:194
+>>>>>>> hide_time_task_by_profil
msgid "More ticket"
msgstr "More ticket"
-#: front/config.form.php:65
+#: front/config.form.php:66
msgid "Please activate the plugin"
msgstr "Por favor ative o plugin"
+<<<<<<< HEAD
#: inc/closeticket.class.php:130 inc/closeticket.class.php:447
+=======
+#: inc/closeticket.class.php:135 inc/closeticket.class.php:479
+>>>>>>> hide_time_task_by_profil
msgid "Solution description"
msgstr "Descrição da solução"
-#: inc/closeticket.class.php:149
+#: inc/closeticket.class.php:154
msgid "Ticket cannot be closed"
msgstr "Chamado não pode ser fechado"
+<<<<<<< HEAD
#: inc/closeticket.class.php:527
+=======
+#: inc/closeticket.class.php:576
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s added closing informations"
msgstr "%1$s adicionadas informações de fechamento"
+<<<<<<< HEAD
#: inc/closeticket.class.php:543
+=======
+#: inc/closeticket.class.php:595
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s updated closing informations"
msgstr "%1$s atualizadas informações de fechamento"
+<<<<<<< HEAD
#: inc/closeticket.class.php:559
+=======
+#: inc/closeticket.class.php:614
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s deleted closing informations"
msgstr "%1$s apagadas às informações de fechamento"
@@ -131,10 +165,14 @@ msgstr "Use a justificativa no campo de urgência"
msgid "Urgency impacted justification for the field"
msgstr "Use a justificativa no campo de urgência"
-#: inc/profile.class.php:150
+#: inc/profile.class.php:158
msgid "Adding a justification of urgency"
msgstr "A adicionar uma justificativa de urgência."
+#: inc/profile.class.php:166
+msgid "Hide task duration in tickets"
+msgstr ""
+
#: inc/urgencyticket.class.php:69 inc/urgencyticket.class.php:155
msgid "Justification"
msgstr "Justificativa"
@@ -143,7 +181,7 @@ msgstr "Justificativa"
msgid "Urgency ticket cannot be saved"
msgstr "Chamado de urgência não pode ser salvo"
-#: inc/urgencyticket.class.php:94 inc/waitingticket.class.php:170
+#: inc/urgencyticket.class.php:94 inc/waitingticket.class.php:171
msgid "Ticket cannot be saved"
msgstr "Chamado não pode ser salvo"
@@ -153,27 +191,27 @@ msgid_plural "Waiting tickets"
msgstr[0] "Chamado em espera"
msgstr[1] "Chamados em espera"
-#: inc/waitingticket.class.php:168
+#: inc/waitingticket.class.php:169
msgid "Waiting ticket cannot be saved"
msgstr "Chamado em espera não podem ser salvos"
-#: inc/waitingticket.class.php:174
+#: inc/waitingticket.class.php:175
msgid "Report date is inferior of today's date"
msgstr "Data do relatório é inferior a data de hoje"
-#: inc/waitingticket.class.php:384 inc/waitingticket.class.php:424
+#: inc/waitingticket.class.php:386 inc/waitingticket.class.php:426
msgid "Ticket suspension history"
msgstr "Histórico da suspensão do chamado"
-#: inc/waitingticket.class.php:387
+#: inc/waitingticket.class.php:389
msgid "Suspension date"
msgstr "Data da suspensão"
-#: inc/waitingticket.class.php:391
+#: inc/waitingticket.class.php:393
msgid "Suspension end date"
msgstr "Data fim da suspensão"
-#: inc/waitingticket.class.php:741
+#: inc/waitingticket.class.php:751
msgid "End of standby ticket"
msgstr "Fim do chamado pendente"
diff --git a/locales/pt_PT.po b/locales/pt_PT.po
index 20dde4ef53..df0b7f39d2 100644
--- a/locales/pt_PT.po
+++ b/locales/pt_PT.po
@@ -7,9 +7,15 @@ msgid ""
msgstr ""
"Project-Id-Version: GLPI Project - moreticket plugin\n"
"Report-Msgid-Bugs-To: \n"
+<<<<<<< HEAD
"POT-Creation-Date: 2018-07-20 10:19+0200\n"
"PO-Revision-Date: 2018-07-09 07:29+0000\n"
"Last-Translator: Amandine Manceau\n"
+=======
+"POT-Creation-Date: 2019-02-26 15:54+0100\n"
+"PO-Revision-Date: 2019-02-26 15:09+0000\n"
+"Last-Translator: Mathieu Templier \n"
+>>>>>>> hide_time_task_by_profil
"Language-Team: Portuguese (Portugal) (http://www.transifex.com/tsmr/GLPI_moreticket/language/pt_PT/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -17,18 +23,19 @@ msgstr ""
"Language: pt_PT\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: hook.php:197 inc/waitingticket.class.php:138
-#: inc/waitingticket.class.php:237 inc/waitingticket.class.php:316
-#: inc/waitingticket.class.php:388
+#: hook.php:200 inc/waitingticket.class.php:139
+#: inc/waitingticket.class.php:238 inc/waitingticket.class.php:317
+#: inc/waitingticket.class.php:390
msgid "Reason"
msgstr "Razão"
-#: hook.php:205 inc/waitingticket.class.php:130
-#: inc/waitingticket.class.php:252 inc/waitingticket.class.php:331
-#: inc/waitingticket.class.php:390
+#: hook.php:208 inc/waitingticket.class.php:131
+#: inc/waitingticket.class.php:253 inc/waitingticket.class.php:332
+#: inc/waitingticket.class.php:392
msgid "Postponement date"
msgstr "Data de adiamento"
+<<<<<<< HEAD
#: hook.php:225 hook.php:232 hook.php:239 hook.php:246
#: inc/closeticket.class.php:74 inc/closeticket.class.php:116
#: inc/closeticket.class.php:171 inc/closeticket.class.php:299
@@ -37,32 +44,59 @@ msgid "Close ticket informations"
msgstr "Fechar informações do ticket"
#: setup.php:92 inc/profile.class.php:50 inc/profile.class.php:177
+=======
+#: hook.php:228 hook.php:235 hook.php:242 hook.php:249
+#: inc/closeticket.class.php:75 inc/closeticket.class.php:79
+#: inc/closeticket.class.php:121 inc/closeticket.class.php:178
+#: inc/closeticket.class.php:326 inc/closeticket.class.php:380
+#: inc/config.class.php:167
+msgid "Close ticket informations"
+msgstr "Fechar informações do ticket"
+
+#: setup.php:94 inc/profile.class.php:49 inc/profile.class.php:194
+>>>>>>> hide_time_task_by_profil
msgid "More ticket"
msgstr "Mais incidência"
-#: front/config.form.php:65
+#: front/config.form.php:66
msgid "Please activate the plugin"
msgstr "Por favor active o plugin"
+<<<<<<< HEAD
#: inc/closeticket.class.php:130 inc/closeticket.class.php:447
+=======
+#: inc/closeticket.class.php:135 inc/closeticket.class.php:479
+>>>>>>> hide_time_task_by_profil
msgid "Solution description"
msgstr "Descrição da solução"
-#: inc/closeticket.class.php:149
+#: inc/closeticket.class.php:154
msgid "Ticket cannot be closed"
msgstr "Incidência não pode ser fechada"
+<<<<<<< HEAD
#: inc/closeticket.class.php:527
+=======
+#: inc/closeticket.class.php:576
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s added closing informations"
msgstr "%1$s adicionou informações de fecho"
+<<<<<<< HEAD
#: inc/closeticket.class.php:543
+=======
+#: inc/closeticket.class.php:595
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s updated closing informations"
msgstr "%1$s actualizou informações de fecho"
+<<<<<<< HEAD
#: inc/closeticket.class.php:559
+=======
+#: inc/closeticket.class.php:614
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s deleted closing informations"
msgstr "%1$s apagou informações de fecho"
@@ -127,10 +161,14 @@ msgstr "Usar um campo de justificação de urgência "
msgid "Urgency impacted justification for the field"
msgstr "Justificação de impacto da urgência para o campo"
-#: inc/profile.class.php:150
+#: inc/profile.class.php:158
msgid "Adding a justification of urgency"
msgstr "A adicionar uma justificação de urgência"
+#: inc/profile.class.php:166
+msgid "Hide task duration in tickets"
+msgstr ""
+
#: inc/urgencyticket.class.php:69 inc/urgencyticket.class.php:155
msgid "Justification"
msgstr "Justificação"
@@ -139,7 +177,7 @@ msgstr "Justificação"
msgid "Urgency ticket cannot be saved"
msgstr "Incidência de urgência não pode ser guardada"
-#: inc/urgencyticket.class.php:94 inc/waitingticket.class.php:170
+#: inc/urgencyticket.class.php:94 inc/waitingticket.class.php:171
msgid "Ticket cannot be saved"
msgstr "Incidência não pode ser guardada"
@@ -149,27 +187,27 @@ msgid_plural "Waiting tickets"
msgstr[0] "Incidência em espera"
msgstr[1] "Incidências em espera"
-#: inc/waitingticket.class.php:168
+#: inc/waitingticket.class.php:169
msgid "Waiting ticket cannot be saved"
msgstr "Incidência de espera não pode ser guardada"
-#: inc/waitingticket.class.php:174
+#: inc/waitingticket.class.php:175
msgid "Report date is inferior of today's date"
msgstr "Data de reporte é inferior à data de hoje"
-#: inc/waitingticket.class.php:384 inc/waitingticket.class.php:424
+#: inc/waitingticket.class.php:386 inc/waitingticket.class.php:426
msgid "Ticket suspension history"
msgstr "Histórico de suspensão da incidência"
-#: inc/waitingticket.class.php:387
+#: inc/waitingticket.class.php:389
msgid "Suspension date"
msgstr "Data de suspensão"
-#: inc/waitingticket.class.php:391
+#: inc/waitingticket.class.php:393
msgid "Suspension end date"
msgstr "Fim da data de suspensão"
-#: inc/waitingticket.class.php:741
+#: inc/waitingticket.class.php:751
msgid "End of standby ticket"
msgstr "Fim de espera da incidência"
diff --git a/locales/ru_RU.po b/locales/ru_RU.po
index cde8fff20f..4d2acb4b13 100644
--- a/locales/ru_RU.po
+++ b/locales/ru_RU.po
@@ -9,9 +9,15 @@ msgid ""
msgstr ""
"Project-Id-Version: GLPI Project - moreticket plugin\n"
"Report-Msgid-Bugs-To: \n"
+<<<<<<< HEAD
"POT-Creation-Date: 2018-07-20 10:19+0200\n"
"PO-Revision-Date: 2018-07-09 07:29+0000\n"
"Last-Translator: Amandine Manceau\n"
+=======
+"POT-Creation-Date: 2019-02-26 15:54+0100\n"
+"PO-Revision-Date: 2019-02-26 15:09+0000\n"
+"Last-Translator: Mathieu Templier \n"
+>>>>>>> hide_time_task_by_profil
"Language-Team: Russian (Russia) (http://www.transifex.com/tsmr/GLPI_moreticket/language/ru_RU/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -19,18 +25,19 @@ msgstr ""
"Language: ru_RU\n"
"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"
-#: hook.php:197 inc/waitingticket.class.php:138
-#: inc/waitingticket.class.php:237 inc/waitingticket.class.php:316
-#: inc/waitingticket.class.php:388
+#: hook.php:200 inc/waitingticket.class.php:139
+#: inc/waitingticket.class.php:238 inc/waitingticket.class.php:317
+#: inc/waitingticket.class.php:390
msgid "Reason"
msgstr "Причина"
-#: hook.php:205 inc/waitingticket.class.php:130
-#: inc/waitingticket.class.php:252 inc/waitingticket.class.php:331
-#: inc/waitingticket.class.php:390
+#: hook.php:208 inc/waitingticket.class.php:131
+#: inc/waitingticket.class.php:253 inc/waitingticket.class.php:332
+#: inc/waitingticket.class.php:392
msgid "Postponement date"
msgstr "Дата отсрочки"
+<<<<<<< HEAD
#: hook.php:225 hook.php:232 hook.php:239 hook.php:246
#: inc/closeticket.class.php:74 inc/closeticket.class.php:116
#: inc/closeticket.class.php:171 inc/closeticket.class.php:299
@@ -39,32 +46,59 @@ msgid "Close ticket informations"
msgstr "Информация о закрытии заявки"
#: setup.php:92 inc/profile.class.php:50 inc/profile.class.php:177
+=======
+#: hook.php:228 hook.php:235 hook.php:242 hook.php:249
+#: inc/closeticket.class.php:75 inc/closeticket.class.php:79
+#: inc/closeticket.class.php:121 inc/closeticket.class.php:178
+#: inc/closeticket.class.php:326 inc/closeticket.class.php:380
+#: inc/config.class.php:167
+msgid "Close ticket informations"
+msgstr "Информация о закрытии заявки"
+
+#: setup.php:94 inc/profile.class.php:49 inc/profile.class.php:194
+>>>>>>> hide_time_task_by_profil
msgid "More ticket"
msgstr "Еще заявка"
-#: front/config.form.php:65
+#: front/config.form.php:66
msgid "Please activate the plugin"
msgstr "Включите плагин"
+<<<<<<< HEAD
#: inc/closeticket.class.php:130 inc/closeticket.class.php:447
+=======
+#: inc/closeticket.class.php:135 inc/closeticket.class.php:479
+>>>>>>> hide_time_task_by_profil
msgid "Solution description"
msgstr "Описание решения"
-#: inc/closeticket.class.php:149
+#: inc/closeticket.class.php:154
msgid "Ticket cannot be closed"
msgstr "Заявка не может быть закрыта"
+<<<<<<< HEAD
#: inc/closeticket.class.php:527
+=======
+#: inc/closeticket.class.php:576
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s added closing informations"
msgstr "%1$s добавлена информация при закрытии"
+<<<<<<< HEAD
#: inc/closeticket.class.php:543
+=======
+#: inc/closeticket.class.php:595
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s updated closing informations"
msgstr "%1$s обновлена информация при закрытии"
+<<<<<<< HEAD
#: inc/closeticket.class.php:559
+=======
+#: inc/closeticket.class.php:614
+>>>>>>> hide_time_task_by_profil
#, php-format
msgid "%1$s deleted closing informations"
msgstr "%1$s удалена информация при закрытии"
@@ -129,10 +163,14 @@ msgstr "Использовать обоснование для поля сроч
msgid "Urgency impacted justification for the field"
msgstr "Обоснование влияния срочности для заявки"
-#: inc/profile.class.php:150
+#: inc/profile.class.php:158
msgid "Adding a justification of urgency"
msgstr "Добавлять обоснование срочности"
+#: inc/profile.class.php:166
+msgid "Hide task duration in tickets"
+msgstr ""
+
#: inc/urgencyticket.class.php:69 inc/urgencyticket.class.php:155
msgid "Justification"
msgstr "Обоснование"
@@ -141,7 +179,7 @@ msgstr "Обоснование"
msgid "Urgency ticket cannot be saved"
msgstr "Срочная заявка не может быть сохранена"
-#: inc/urgencyticket.class.php:94 inc/waitingticket.class.php:170
+#: inc/urgencyticket.class.php:94 inc/waitingticket.class.php:171
msgid "Ticket cannot be saved"
msgstr "Заявка не может быть сохранена"
@@ -153,27 +191,27 @@ msgstr[1] "Ожидающая заявка"
msgstr[2] "Ожидающая заявка"
msgstr[3] "Ожидающие заявки"
-#: inc/waitingticket.class.php:168
+#: inc/waitingticket.class.php:169
msgid "Waiting ticket cannot be saved"
msgstr "Ожидающая заявка не может быть сохранена"
-#: inc/waitingticket.class.php:174
+#: inc/waitingticket.class.php:175
msgid "Report date is inferior of today's date"
msgstr "Дата отчета позднее сегодняшней даты"
-#: inc/waitingticket.class.php:384 inc/waitingticket.class.php:424
+#: inc/waitingticket.class.php:386 inc/waitingticket.class.php:426
msgid "Ticket suspension history"
msgstr "История приостановки заявок"
-#: inc/waitingticket.class.php:387
+#: inc/waitingticket.class.php:389
msgid "Suspension date"
msgstr "Дата приостановки"
-#: inc/waitingticket.class.php:391
+#: inc/waitingticket.class.php:393
msgid "Suspension end date"
msgstr "Дата возобновления"
-#: inc/waitingticket.class.php:741
+#: inc/waitingticket.class.php:751
msgid "End of standby ticket"
msgstr "Конец ожидания заявки"
diff --git a/setup.php b/setup.php
index f84ef45b74..cc1c565a96 100644
--- a/setup.php
+++ b/setup.php
@@ -33,7 +33,7 @@
function plugin_init_moreticket() {
global $PLUGIN_HOOKS;
- $PLUGIN_HOOKS['add_css']['moreticket'] = 'moreticket.css';
+ $PLUGIN_HOOKS['add_css']['moreticket'][] = 'css/moreticket.css';
$PLUGIN_HOOKS['csrf_compliant']['moreticket'] = true;
$PLUGIN_HOOKS['change_profile']['moreticket'] = ['PluginMoreticketProfile', 'initProfile'];
@@ -74,6 +74,10 @@ function plugin_init_moreticket() {
$PLUGIN_HOOKS['item_update']['moreticket']['Ticket'] = ['PluginMoreticketTicket', 'afterUpdate'];
}
+ if (Session::haveRight("plugin_moreticket_hide_task_duration", READ)) {
+ $PLUGIN_HOOKS['add_css']['moreticket'][] = 'css/hide_task_duration.css';
+ }
+
if (Session::haveRight('plugin_moreticket', READ)) {
Plugin::registerClass('PluginMoreticketWaitingTicket', ['addtabon' => 'Ticket']);
Plugin::registerClass('PluginMoreticketCloseTicket', ['addtabon' => 'Ticket']);
diff --git a/tests/DbTestCase.php b/tests/DbTestCase.php
new file mode 100644
index 0000000000..8a412abbac
--- /dev/null
+++ b/tests/DbTestCase.php
@@ -0,0 +1,97 @@
+.
+ * ---------------------------------------------------------------------
+ */
+
+// Generic test classe, to be extended for CommonDBTM Object
+
+class DbTestCase extends \GLPITestCase {
+
+ public function beforeTestMethod($method) {
+ global $DB;
+ $DB->beginTransaction();
+ parent::beforeTestMethod($method);
+ }
+
+ public function afterTestMethod($method) {
+ global $DB;
+ $DB->rollback();
+ parent::afterTestMethod($method);
+ }
+
+
+ /**
+ * Connect (using the test user per default)
+ *
+ * @param string $user_name User name (defaults to TU_USER)
+ * @param string $user_pass user password (defaults to TU_PASS)
+ *
+ * @return void
+ */
+ protected function login($user_name = TU_USER, $user_pass = TU_PASS) {
+
+ $auth = new Auth();
+ $this->boolean($auth->login($user_name, $user_pass, true))->isTrue();
+ }
+
+ /**
+ * change current entity
+ *
+ * @param string $entityname Name of the entity
+ * @param boolean $subtree Recursive load
+ *
+ * @return void
+ */
+ protected function setEntity($entityname, $subtree) {
+ $res = Session::changeActiveEntities(getItemByTypeName('Entity', $entityname, true), $subtree);
+ $this->boolean($res)->isTrue();
+ }
+
+ /**
+ * Generic method to test if an added object is corretly inserted
+ *
+ * @param Object $object The object to test
+ * @param int $id The id of added object
+ * @param array $input the input used for add object (optionnal)
+ *
+ * @return nothing (do tests)
+ */
+ protected function checkInput(CommonDBTM $object, $id = 0, $input = []) {
+ $this->integer((int)$id)->isGreaterThan(0);
+ $this->boolean($object->getFromDB($id))->isTrue();
+ $this->variable($object->getField('id'))->isEqualTo($id);
+
+ if (count($input)) {
+ foreach ($input as $k => $v) {
+ $this->variable($object->getField($k))->isEqualTo($v);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/README.md b/tests/README.md
new file mode 100644
index 0000000000..11a6b5fb5b
--- /dev/null
+++ b/tests/README.md
@@ -0,0 +1,66 @@
+## moreticket test suite
+
+To run the moreticket test suite you need
+
+* [atoum](http://atoum.org/)
+
+Installing composer development dependencies
+----------------------
+
+Run the **composer install** command without --no-dev option in the top of moreticket tree:
+
+```bash
+$ composer install -o
+
+Loading composer repositories with package information
+Installing dependencies (including require-dev) from lock file
+[...]
+Generating optimized autoload files
+```
+
+Creating a dedicated database
+-----------------------------
+
+Use the **CliInstall** script to create a new database,
+only used for the test suite, using the `--tests` option:
+
+```bash
+$ ../../bin/console glpi:database:install --config-dir=./tests --db-name=glpitests --db-user=root --db-password=
++---------------+-----------+
+| Database host | localhost |
+| Database name | glpitests |
+| Database user | root |
++---------------+-----------+
+Do you want to continue ? [Yes/no]yes
+Installation done.
+```
+
+The configuration file is saved as `tests/config_db.php`.
+
+The database is created using the default schema for current version.
+
+If you need to recreate the database (e.g. for a new schema), you need to run
+**CliInstall** again with the `--force` option.
+
+
+Changing database configuration
+-------------------------------
+
+Using the same database than the web application is not recommended. Use the `tests/config_db.php` file to adjust connection settings.
+
+Running the test suite
+----------------------
+
+There are two directories for tests:
+- `tests/units` for main core tests;
+- `tests/api` for API tests.
+
+You can choose to run tests on a whole directory, on any file, or on any \. You have to specify a bootstrap file each time:
+
+```bash
+$ atoum -bf tests/bootstrap.php -mcn 1 -d tests/units/
+[...]
+$ atoum -bf tests/bootstrap.php -f tests/units/Html.php
+[...]
+$ atoum -bf tests/bootstrap.php -f tests/units/Html.php -m tests\units\Html::testConvDateTime
+```
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
new file mode 100644
index 0000000000..31a9732a1d
--- /dev/null
+++ b/tests/bootstrap.php
@@ -0,0 +1,581 @@
+.
+ * ---------------------------------------------------------------------
+ */
+
+define('GLPI_ROOT', __DIR__ . "/../../../");
+define("GLPI_CONFIG_DIR", GLPI_ROOT . "/tests");
+
+error_reporting(E_ALL);
+//define('GLPI_CONFIG_DIR', __DIR__);
+define('GLPI_LOG_DIR', __DIR__ . '/files/_log');
+define('GLPI_URI', (getenv('GLPI_URI') ?: 'http://localhost:8088'));
+define('TU_USER', '_test_user');
+define('TU_PASS', 'PhpUnit_4');
+
+if (!file_exists(GLPI_CONFIG_DIR . '/config_db.php')) {
+ die("\nConfiguration file for tests not found\n\nrun: php scripts/cliinstall.php --tests ...\n\n");
+}
+
+global $CFG_GLPI;
+include_once GLPI_ROOT . '/inc/includes.php';
+include_once GLPI_ROOT . '/tests/GLPITestCase.php';
+include_once GLPI_ROOT . '/tests/DbTestCase.php';
+include_once GLPI_ROOT . '/tests/APIBaseClass.php';
+
+echo "\n" . __DIR__ . "\n";
+
+// check folder exists instead of class_exists('\GuzzleHttp\Client'), to prevent global includes
+if (file_exists(__DIR__ . '../vendor/autoload.php')/* && !file_exists(__DIR__ . '/../vendor/guzzlehttp/guzzle')*/) {
+ die("\nDevelopment dependencies not found\n\nrun: composer install -o\n\n");
+}
+class GlpitestPHPerror extends Exception
+{
+}
+class GlpitestPHPwarning extends Exception
+{
+}
+class GlpitestPHPnotice extends Exception
+{
+}
+class GlpitestSQLError extends Exception
+{
+}
+function loadDataset() {
+ global $CFG_GLPI;
+ // Unit test data definition
+ $data = [
+ // bump this version to force reload of the full dataset, when content change
+ '_version' => '4.3',
+ // Type => array of entries
+ 'Entity' => [
+ [
+ 'name' => '_test_root_entity',
+ 'entities_id' => 0,
+ ], [
+ 'name' => '_test_child_1',
+ 'entities_id' => '_test_root_entity',
+ ], [
+ 'name' => '_test_child_2',
+ 'entities_id' => '_test_root_entity',
+ ]
+ ], 'Computer' => [
+ [
+ 'name' => '_test_pc01',
+ 'entities_id' => '_test_root_entity',
+ 'comment' => 'Comment for computer _test_pc01',
+ ], [
+ 'name' => '_test_pc02',
+ 'entities_id' => '_test_root_entity',
+ 'comment' => 'Comment for computer _test_pc02',
+ ], [
+ 'name' => '_test_pc03',
+ 'entities_id' => '_test_root_entity',
+ 'comment' => 'Comment for computer _test_pc03',
+ 'contact' => 'johndoe',
+ ], [
+ 'name' => '_test_pc11',
+ 'entities_id' => '_test_child_1',
+ ], [
+ 'name' => '_test_pc12',
+ 'entities_id' => '_test_child_1',
+ ], [
+ 'name' => '_test_pc13',
+ 'entities_id' => '_test_child_1',
+ 'comment' => 'Comment for computer _test_pc13',
+ 'contact' => 'johndoe',
+ ], [
+ 'name' => '_test_pc21',
+ 'entities_id' => '_test_child_2',
+ ], [
+ 'name' => '_test_pc22',
+ 'entities_id' => '_test_child_2',
+ ]
+ ], 'Software' => [
+ [
+ 'name' => '_test_soft',
+ 'entities_id' => '_test_root_entity',
+ 'is_recursive' => 1,
+ ], [
+ 'name' => '_test_soft2',
+ 'entities_id' => '_test_child_2',
+ 'is_recursive' => 0,
+ ], [
+ 'name' => '_test_soft_3',
+ 'entities_id' => '_test_root_entity',
+ 'is_recursive' => 1,
+ ]
+ ], 'SoftwareVersion' => [
+ [
+ 'name' => '_test_softver_1',
+ 'entities_id' => '_test_root_entity',
+ 'is_recursive' => 1,
+ 'softwares_id' => '_test_soft',
+ ], [
+ 'name' => '_test_softver_2',
+ 'entities_id' => '_test_root_entity',
+ 'is_recursive' => 1,
+ 'softwares_id' => '_test_soft',
+ ]
+ ], 'Printer' => [
+ [
+ 'name' => '_test_printer_all',
+ 'entities_id' => '_test_root_entity',
+ 'is_recursive' => 1,
+ ], [
+ 'name' => '_test_printer_ent0',
+ 'entities_id' => '_test_root_entity',
+ 'is_recursive' => 0,
+ ], [
+ 'name' => '_test_printer_ent1',
+ 'entities_id' => '_test_child_1',
+ 'is_recursive' => 0,
+ ], [
+ 'name' => '_test_printer_ent2',
+ 'entities_id' => '_test_child_2',
+ 'is_recursive' => 0,
+ ]
+ ], 'User' => [
+ [
+ 'name' => TU_USER,
+ 'password' => TU_PASS,
+ 'password2' => TU_PASS,
+ 'entities_id' => '_test_root_entity',
+ 'profiles_id' => 4, // TODO manage test profiles
+ '_entities_id' => '_test_root_entity',
+ '_profiles_id' => 4,
+ '_is_recursive' => 1,
+ ]
+ ], 'TaskCategory' => [
+ [
+ 'is_recursive' => 1,
+ 'name' => '_cat_1',
+ 'completename' => '_cat_1',
+ 'comment' => 'Comment for category _cat_1',
+ 'level' => 1,
+ ],
+ [
+ 'is_recursive' => 1,
+ 'taskcategories_id' => '_cat_1',
+ 'name' => '_subcat_1',
+ 'completename' => '_cat_1 > _subcat_1',
+ 'comment' => 'Comment for sub-category _subcat_1',
+ 'level' => 2,
+ ]
+ ], 'DropdownTranslation' => [
+ [
+ 'items_id' => '_cat_1',
+ 'itemtype' => 'TaskCategory',
+ 'language' => 'fr_FR',
+ 'field' => 'name',
+ 'value' => 'FR - _cat_1'
+ ],
+ [
+ 'items_id' => '_cat_1',
+ 'itemtype' => 'TaskCategory',
+ 'language' => 'fr_FR',
+ 'field' => 'comment',
+ 'value' => 'FR - Commentaire pour catégorie _cat_1'
+ ],
+ [
+ 'items_id' => '_subcat_1',
+ 'itemtype' => 'TaskCategory',
+ 'language' => 'fr_FR',
+ 'field' => 'name',
+ 'value' => 'FR - _subcat_1'
+ ],
+ [
+ 'items_id' => '_subcat_1',
+ 'itemtype' => 'TaskCategory',
+ 'language' => 'fr_FR',
+ 'field' => 'comment',
+ 'value' => 'FR - Commentaire pour sous-catégorie _subcat_1'
+ ]
+ ], 'Contact' => [
+ [
+ 'name' => '_contact01_name',
+ 'firstname' => '_contact01_firstname',
+ 'phone' => '0123456789',
+ 'phone2' => '0123456788',
+ 'mobile' => '0623456789',
+ 'fax' => '0123456787',
+ 'email' => '_contact01_firstname._contact01_name@glpi.com',
+ 'comment' => 'Comment for contact _contact01_name',
+ 'entities_id' => '_test_root_entity'
+ ]
+ ], 'Supplier' => [
+ [
+ 'name' => '_suplier01_name',
+ 'phonenumber' => '0123456789',
+ 'fax' => '0123456787',
+ 'email' => 'info@_supplier01_name.com',
+ 'comment' => 'Comment for supplier _suplier01_name',
+ 'entities_id' => '_test_root_entity'
+ ]
+ ], 'Location' => [
+ [
+ 'name' => '_location01',
+ 'comment' => 'Comment for location _location01'
+ ],
+ [
+ 'name' => '_location01 > _sublocation01',
+ 'comment' => 'Comment for location _sublocation01'
+ ],
+ [
+ 'name' => '_location02',
+ 'comment' => 'Comment for location _sublocation02'
+ ]
+ ], 'Netpoint' => [
+ [
+ 'name' => '_netpoint01',
+ 'locations_id' => '_location01',
+ 'comment' => 'Comment for netpoint _netpoint01'
+ ]
+ ], 'BudgetType' => [
+ [
+ 'name' => '_budgettype01',
+ 'comment' => 'Comment for budgettype _budgettype01'
+ ]
+ ], 'Budget' => [
+ [
+ 'name' => '_budget01',
+ 'comment' => 'Comment for budget _budget01',
+ 'locations_id' => '_location01',
+ 'budgettypes_id' => '_budgettype01',
+ 'begin_date' => '2016-10-18',
+ 'end_date' => '2016-12-31',
+ 'entities_id' => '_test_root_entity'
+ ]
+ ], 'Ticket' => [
+ [
+ 'name' => '_ticket01',
+ 'content' => 'Content for ticket _ticket01',
+ 'users_id_recipient' => TU_USER,
+ 'entities_id' => '_test_root_entity'
+ ],
+ [
+ 'name' => '_ticket02',
+ 'content' => 'Content for ticket _ticket02',
+ 'users_id_recipient' => TU_USER,
+ 'entities_id' => '_test_root_entity'
+ ],
+ [
+ 'name' => '_ticket03',
+ 'content' => 'Content for ticket _ticket03',
+ 'users_id_recipient' => TU_USER,
+ 'entities_id' => '_test_child_1'
+ ]
+ ], 'TicketTask' => [
+ [
+ 'tickets_id' => '_ticket01',
+ 'taskcategories_id' => '_subcat_1',
+ 'users_id' => TU_USER,
+ 'content' => 'Task to be done',
+ 'is_private' => 0,
+ 'users_id_tech' => TU_USER,
+ 'date' => '2016-10-19 11:50:50'
+ ]
+ ], 'UserEmail' => [
+ [
+ 'users_id' => TU_USER,
+ 'is_default' => '1',
+ 'is_dynamic' => '0',
+ 'email' => TU_USER.'@glpi.com'
+ ]
+ ], 'KnowbaseItem' => [
+ [
+ 'name' => '_knowbaseitem01',
+ 'answer' => 'Answer for Knowledge base entry _knowbaseitem01',
+ 'is_faq' => 0,
+ 'users_id' => TU_USER,
+ 'date' => '2016-11-17 12:27:48',
+ 'date_mod' => '2016-11-17 12:28:06'
+ ],
+ [
+ 'name' => '_knowbaseitem02',
+ 'answer' => 'Answer for Knowledge base entry _knowbaseitem02',
+ 'is_faq' => 0,
+ 'users_id' => TU_USER,
+ 'date' => '2016-11-17 12:27:48',
+ 'date_mod' => '2016-11-17 12:28:06'
+ ]
+ ], 'KnowbaseItem_Item' => [
+ [
+ 'knowbaseitems_id' => '_knowbaseitem01',
+ 'itemtype' => 'Ticket',
+ 'items_id' => '_ticket01',
+ 'date_creation' => '2016-11-17 14:27:28',
+ 'date_mod' => '2016-11-17 14:27:52'
+ ],
+ [
+ 'knowbaseitems_id' => '_knowbaseitem01',
+ 'itemtype' => 'Ticket',
+ 'items_id' => '_ticket02',
+ 'date_creation' => '2016-11-17 14:28:28',
+ 'date_mod' => '2016-11-17 14:28:52'
+ ],
+ [
+ 'knowbaseitems_id' => '_knowbaseitem01',
+ 'itemtype' => 'Ticket',
+ 'items_id' => '_ticket03',
+ 'date_creation' => '2016-11-17 14:29:28',
+ 'date_mod' => '2016-11-17 14:29:52'
+ ],
+ [
+ 'knowbaseitems_id' => '_knowbaseitem02',
+ 'itemtype' => 'Ticket',
+ 'items_id' => '_ticket03',
+ 'date_creation' => '2016-11-17 14:30:28',
+ 'date_mod' => '2016-11-17 14:30:52'
+ ],
+ [
+ 'knowbaseitems_id' => '_knowbaseitem02',
+ 'itemtype' => 'Computer',
+ 'items_id' => '_test_pc21',
+ 'date_creation' => '2016-11-17 14:31:28',
+ 'date_mod' => '2016-11-17 14:31:52'
+ ]
+ ], 'Entity_KnowbaseItem' => [
+ [
+ 'knowbaseitems_id' => '_knowbaseitem01',
+ 'entities_id' => '_test_root_entity'
+ ],
+ [
+ 'knowbaseitems_id' => '_knowbaseitem02',
+ 'entities_id' => '_test_child_1'
+ ]
+ ], 'DocumentType' => [
+ [
+ 'name' => 'markdown',
+ 'is_uploadable' => '1',
+ 'ext' => 'md'
+ ]
+ ], 'Manufacturer' => [
+ [
+ 'name' => 'My Manufacturer',
+ ]
+ ], 'SoftwareLicense' => [
+ [
+ 'name' => '_test_softlic_1',
+ 'completename' => '_test_softlic_1',
+ 'level' => 0,
+ 'entities_id' => '_test_root_entity',
+ 'is_recursive' => 1,
+ 'number' => 2,
+ 'softwares_id' => '_test_soft',
+ ],
+ [
+ 'name' => '_test_softlic_2',
+ 'completename' => '_test_softlic_2',
+ 'level' => 0,
+ 'entities_id' => '_test_root_entity',
+ 'is_recursive' => 1,
+ 'number' => 3,
+ 'softwares_id' => '_test_soft',
+ ],
+ [
+ 'name' => '_test_softlic_3',
+ 'completename' => '_test_softlic_3',
+ 'level' => 0,
+ 'entities_id' => '_test_root_entity',
+ 'is_recursive' => 1,
+ 'number' => 5,
+ 'softwares_id' => '_test_soft',
+ ],
+ [
+ 'name' => '_test_softlic_4',
+ 'completename' => '_test_softlic_4',
+ 'level' => 0,
+ 'entities_id' => '_test_root_entity',
+ 'is_recursive' => 1,
+ 'number' => 2,
+ 'softwares_id' => '_test_soft',
+ ],
+ [
+ 'name' => '_test_softlic_child',
+ 'completename' => '_test_softlic_child',
+ 'level' => 0,
+ 'entities_id' => '_test_root_entity',
+ 'is_recursive' => 1,
+ 'number' => 1,
+ 'softwares_id' => '_test_soft',
+ 'softwarelicenses_id' => '_test_softlic_1',
+ ],
+ ], 'Computer_SoftwareLicense' => [
+ [
+ 'softwarelicenses_id' => '_test_softlic_1',
+ 'computers_id' => '_test_pc21',
+ ], [
+ 'softwarelicenses_id' => '_test_softlic_1',
+ 'computers_id' => '_test_pc01',
+ ], [
+ 'softwarelicenses_id' => '_test_softlic_1',
+ 'computers_id' => '_test_pc02',
+ ], [
+ 'softwarelicenses_id' => '_test_softlic_2',
+ 'computers_id' => '_test_pc02',
+ ], [
+ 'softwarelicenses_id' => '_test_softlic_3',
+ 'computers_id' => '_test_pc02',
+ ], [
+ 'softwarelicenses_id' => '_test_softlic_3',
+ 'computers_id' => '_test_pc21',
+ ], [
+ 'softwarelicenses_id' => '_test_softlic_2',
+ 'computers_id' => '_test_pc21',
+ ]
+ ], 'devicesimcard' => [
+ [
+ 'designation' => '_test_simcard_1',
+ 'entities_id' => '_test_root_entity',
+ 'is_recursive' => 1,
+ ]
+ ], 'DeviceSensor' => [
+ [
+ 'designation' => '_test_sensor_1',
+ 'entities_id' => '_test_root_entity',
+ 'is_recursive' => 1
+ ]
+ ], 'AuthLdap' => [
+ [
+ 'name' => '_local_ldap',
+ 'host' => '127.0.0.1',
+ 'basedn' => 'dc=glpi,dc=org',
+ 'rootdn' => 'cn=Manager,dc=glpi,dc=org',
+ 'port' => '3890',
+ 'condition' => '(objectclass=inetOrgPerson)',
+ 'login_field' => 'uid',
+ 'rootdn_passwd' => 'insecure',
+ 'is_default' => 1,
+ 'is_active' => 0,
+ 'use_tls' => 0,
+ 'email1_field' => 'mail',
+ 'realname_field' => 'cn',
+ 'firstname_field' => 'sn',
+ 'phone_field' => 'telephonenumber',
+ 'comment_field' => 'description',
+ 'title_field' => 'title',
+ 'category_field' => 'businesscategory',
+ 'language_field' => 'preferredlanguage',
+ 'group_search_type' => \AuthLdap::GROUP_SEARCH_GROUP,
+ 'group_condition' => '(objectclass=groupOfNames)',
+ 'group_member_field' => 'member'
+ ]
+ ]
+ ];
+ // To bypass various right checks
+ $_SESSION['glpishowallentities'] = 1;
+ $_SESSION['glpicronuserrunning'] = "cron_phpunit";
+ $_SESSION['glpi_use_mode'] = Session::NORMAL_MODE;
+ $_SESSION['glpiactiveentities'] = [0];
+ $_SESSION['glpiactiveentities_string'] = "'0'";
+ $CFG_GLPI['root_doc'] = '/glpi';
+ // need to set theses in DB, because tests for API use http call and this bootstrap file is not called
+ Config::setConfigurationValues('core', ['url_base' => GLPI_URI,
+ 'url_base_api' => GLPI_URI . '/apirest.php']);
+ $CFG_GLPI['url_base'] = GLPI_URI;
+ $CFG_GLPI['url_base_api'] = GLPI_URI . '/apirest.php';
+ is_dir(GLPI_LOG_DIR) or mkdir(GLPI_LOG_DIR, 0755, true);
+ $conf = Config::getConfigurationValues('phpunit');
+ if (isset($conf['dataset']) && $conf['dataset']==$data['_version']) {
+ printf("\nGLPI dataset version %s already loaded\n\n", $data['_version']);
+ } else {
+ printf("\nLoading GLPI dataset version %s\n", $data['_version']);
+ $ids = [];
+ foreach ($data as $type => $inputs) {
+ if ($type[0] == '_') {
+ continue;
+ }
+ foreach ($inputs as $input) {
+ // Resolve FK
+ foreach ($input as $k => $v) {
+ // $foreigntype = $type; // by default same type than current type (is the case of the dropdowns)
+ $foreigntype = false;
+ $match = [];
+ if (isForeignKeyField($k) && (preg_match("/(.*s)_id$/", $k, $match) || preg_match("/(.*s)_id_/", $k, $match))) {
+ $foreigntypetxt = array_pop($match);
+ if (substr($foreigntypetxt, 0, 1) !== '_') {
+ $foreigntype = getItemTypeForTable("glpi_$foreigntypetxt");
+ }
+ }
+ if ($foreigntype && isset($ids[$foreigntype][$v]) && !is_numeric($v)) {
+ $input[$k] = $ids[$foreigntype][$v];
+ } else if ($k == 'items_id' && isset( $input['itemtype'] ) && isset($ids[$input['itemtype']][$v]) && !is_numeric($v)) {
+ $input[$k] = $ids[$input['itemtype']][$v];
+ } else if ($foreigntype && $foreigntype != 'UNKNOWN' && !is_numeric($v)) {
+ // not found in ids array, then must get it from DB
+ if ($obj = getItemByTypeName($foreigntype, $v)) {
+ $input[$k] = $obj->getID();
+ }
+ }
+ }
+ if (isset($input['name']) && $item = getItemByTypeName($type, $input['name'])) {
+ $input['id'] = $ids[$type][$input['name']] = $item->getField('id');
+ $item->update($input);
+ echo ".";
+ } else {
+ // Not found, create it
+ $item = getItemForItemtype($type);
+ $id = $item->add($input);
+ echo "+";
+ if (isset($input['name'])) {
+ $ids[$type][$input['name']] = $id;
+ }
+ }
+ }
+ }
+ Search::$search = [];
+ echo "\nDone\n\n";
+ Config::setConfigurationValues('phpunit', ['dataset' => $data['_version']]);
+ }
+}
+/**
+ * Test helper, search an item from its type and name
+ *
+ * @param string $type
+ * @param string $name
+ * @param boolean $onlyid
+ * @return the item, or its id
+ */
+function getItemByTypeName($type, $name, $onlyid = false) {
+ $item = getItemForItemtype($type);
+ $nameField = $type::getNameField();
+ if ($item->getFromDBByCrit([$nameField => $name])) {
+ return ($onlyid ? $item->getField('id') : $item);
+ }
+ return false;
+}
+// Cleanup log directory
+foreach (glob(GLPI_LOG_DIR . '/*.log') as $file) {
+ if (file_exists($file)) {
+ unlink($file);
+ }
+}
+loadDataset();
\ No newline at end of file
diff --git a/tests/units/PluginMoreTicketProfile.php b/tests/units/PluginMoreTicketProfile.php
new file mode 100644
index 0000000000..c73fb5ff14
--- /dev/null
+++ b/tests/units/PluginMoreTicketProfile.php
@@ -0,0 +1,129 @@
+newTestedInstance();
+ $this->string($this->testedInstance->getTabNameForItem($temp))
+ ->isEqualTo("");
+
+ // Test with instance of Profile with name equals to class name
+ $temp2 = new \Profile();
+
+ $this->newTestedInstance();
+ $this->string($this->testedInstance->getTabNameForItem($temp2))
+ // Don't test equality because the tab name can be translated
+ ->isNotEmpty();
+ }
+
+ public function test_displayTabContentForItem(){
+
+ }
+
+ public function test_createFirstAccess(){
+
+ }
+
+ public function test_addDefaultProfileInfos(){
+
+ }
+
+ /**
+ *
+ * @dataProvider haveUserRightProvider
+ */
+ public function test_showForm(){
+
+ global $DB;
+
+ $this->login('glpi', 'glpi');
+
+ $res = $DB->insert(
+ "glpi_profilerights", [
+ 'profiles_id' => 0,
+ 'name' => "plugin_moreticket_justification"
+ ]
+ );
+
+ $res = $DB->insert(
+ "glpi_profilerights", [
+ 'profiles_id' => 0,
+ 'name' => "plugin_moreticket_hide_task_duration"
+ ]
+ );
+
+ // intercept the text printed with echo
+ ob_start();
+
+ $this->newTestedInstance();
+ $this->variable($this->testedInstance->showForm(0));
+
+ // store the text in variable
+ $temp = ob_get_contents();
+
+ // Stop interception
+ ob_end_clean();
+
+ // Find moreticket justification div
+ $this->string($temp)->contains("_plugin_moreticket_justification");
+
+ // Find moreticket hide_task_duration div
+ $this->string($temp)->contains("_plugin_moreticket_hide_task_duration");
+ }
+
+ public function test_getAllRights(){
+ $this->newTestedInstance();
+ $this->array($this->testedInstance->getAllRights(true))
+ ->hasSize(2);
+ $this->array($this->testedInstance->getAllRights(false))
+ ->hasSize(1);
+ }
+
+ public function test_translateARight(){
+ $this->newTestedInstance();
+ $this->integer($this->testedInstance->translateARight(''))->isEqualTo(0);
+ $this->integer($this->testedInstance->translateARight('r'))->isEqualTo(READ);
+ $this->integer($this->testedInstance->translateARight('w'))->isEqualTo(ALLSTANDARDRIGHT + READNOTE + UPDATENOTE);
+ $this->string($this->testedInstance->translateARight('0'))->isEqualTo('0');
+ $this->string($this->testedInstance->translateARight('1'))->isEqualTo('1');
+ $this->integer($this->testedInstance->translateARight('FAKE'))->isEqualTo(0);
+ }
+
+ /**
+ * @see self::testHaveUserRight()
+ *
+ * @return array
+ */
+ protected function haveUserRightProvider() {
+
+ return [
+ [
+ 'user' => [
+ 'login' => 'post-only',
+ 'password' => 'postonly',
+ ],
+ 'rights' => [
+ ['name' => \Computer::$rightname, 'value' => CREATE, 'expected' => false],
+ ['name' => \Computer::$rightname, 'value' => DELETE, 'expected' => false],
+ ['name' => \Ticket::$rightname, 'value' => CREATE, 'expected' => true],
+ ['name' => \Ticket::$rightname, 'value' => DELETE, 'expected' => false],
+ ['name' => \ITILFollowup::$rightname, 'value' => \ITILFollowup::ADDMYTICKET, 'expected' => true],
+ ['name' => \ITILFollowup::$rightname, 'value' => \ITILFollowup::ADDALLTICKET, 'expected' => false],
+ ],
+ ]
+ ];
+ }
+
+}
\ No newline at end of file