Skip to content

Commit

Permalink
Merge branch 'release/2.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne committed Feb 7, 2020
2 parents 264b1ec + 23728af commit c7f6ff5
Show file tree
Hide file tree
Showing 45 changed files with 313 additions and 188 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelogs for Tag plugin
=========================

GLPI Tag 2.6.0
-------------------------------

+ Show tags on Kanban view.

GLPI Tag 2.5.0
-------------------------------

Expand Down
141 changes: 71 additions & 70 deletions composer.lock

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,10 @@ function plugin_tag_getAddSearchOptionsNew($itemtype) {
'table' => PluginTagTag::getTable(),
'field' => 'name',
'name' => PluginTagTag::getTypeName(2),
'datatype' => 'string',
'searchtype' => 'contains',
'datatype' => 'dropdown',
'searchtype' => ['equals','notequals','contains'],
'massiveaction' => false,
'forcegroupby' => true,
'usehaving' => true,
'joinparams' => [
'beforejoin' => [
'table' => 'glpi_plugin_tag_tagitems',
Expand Down
60 changes: 58 additions & 2 deletions inc/tag.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,62 @@ static function preItemForm($params = []) {
}
}

/**
* Display the current tags before the Kanban item content.
*
* @param array $params should contains theses keys:
* - itemtype The item type
* - items_id The item's id
* - content postKanbanContent content
* @return array Array of params passed in in addition to the new content.
*/
static function preKanbanContent($params = []) {
global $DB;

if (!Session::haveRight(PluginTagTag::$rightname, READ)) {
return null;
}

if (isset($params['itemtype']) && isset($params['items_id'])) {
if (!isset($params['content'])) {
$params['content'] = "";
}
$iterator = $DB->request([
'SELECT' => [
'name',
'comment',
'color'
],
'FROM' => PluginTagTagItem::getTable(),
'LEFT JOIN' => [
PluginTagTag::getTable() => [
'FKEY' => [
PluginTagTag::getTable() => 'id',
PluginTagTagItem::getTable() => 'plugin_tag_tags_id'
]
]
],
'WHERE' => [
'itemtype' => $params['itemtype'],
'items_id' => $params['items_id']
]
]);

$content = "<div style='display: flex; flex-wrap: wrap;'>";
while ($data = $iterator->next()) {
$title = htmlentities($data['comment']);
$name = htmlentities($data['name']);
$textcolor = idealTextColor($data['color']);
$style = "background-color: {$data['color']}; color: {$textcolor};";
$content .= "<span class='tag_choice' style='{$style}' title='{$title}'>{$name}</span>&nbsp;&nbsp;";
}
$content .= "</div>";
$params['content'] .= $content;
return $params;
}
return null;
}

/**
* Display the tag dropdowns
* @param array $params could contains theses keys:
Expand Down Expand Up @@ -664,14 +720,14 @@ public static function getCurrentItemtype() {
$itemtype = '';
if (preg_match('/\/plugins\/([a-zA-Z]+)\/front\/([a-zA-Z]+).form.php/',
$_SERVER['PHP_SELF'], $matches)) {
$itemtype = 'plugin'.$matches[1].$matches[2];
$itemtype = 'Plugin'.ucfirst($matches[1]).ucfirst($matches[2]);

} else if (preg_match('/([a-zA-Z]+).form.php/', $_SERVER['PHP_SELF'], $matches)) {
$itemtype = $matches[1];

} else if (preg_match('/\/plugins\/([a-zA-Z]+)\/front\/([a-zA-Z]+).php/',
$_SERVER['PHP_SELF'], $matches)) {
$itemtype = 'plugin'.$matches[1].$matches[2];
$itemtype = 'Plugin'.ucfirst($matches[1]).ucfirst($matches[2]);

} else if (preg_match('/([a-zA-Z]+).php/', $_SERVER['PHP_SELF'], $matches)) {
$itemtype = $matches[1];
Expand Down
Binary file modified locales/cs_CZ.mo
Binary file not shown.
18 changes: 9 additions & 9 deletions locales/cs_CZ.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@
#
# Translators:
# David Stepan <[email protected]>, 2016
# Pavel Borecki <[email protected]>, 2018
# Pavel Borecki <[email protected]>, 2018-2019
msgid ""
msgstr ""
"Project-Id-Version: GLPI Plugin - Tag\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-09-12 12:09+0000\n"
"PO-Revision-Date: 2019-09-12 12:10+0000\n"
"Last-Translator: Cédric Anne\n"
"POT-Creation-Date: 2020-02-07 10:06+0000\n"
"PO-Revision-Date: 2019-09-13 13:38+0000\n"
"Last-Translator: Pavel Borecki <[email protected]>\n"
"Language-Team: Czech (Czech Republic) (http://www.transifex.com/teclib/glpi-plugin-tag/language/cs_CZ/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"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:181
#: hook.php:180
msgid "Add tags"
msgstr "Přidat štítky"

#: hook.php:183
#: hook.php:182
msgid "Remove tags"
msgstr "Odebrat štítky"

#: inc/profile.class.php:5 inc/profile.class.php:39
msgid "Tag management"
msgstr ""
msgstr "Správa štítků"

#: inc/tag.class.php:11 inc/tag.class.php:430
msgid "Tag"
Expand All @@ -43,10 +43,10 @@ msgstr[3] "Štítky"
msgid "HTML color"
msgstr "Barva v HTML zápisu"

#: inc/tag.class.php:562
#: inc/tag.class.php:618
msgid "View all tags"
msgstr "Zobrazit všechny štítky"

#: setup.php:128
#: setup.php:138
msgid "Tag Management"
msgstr "Správa štítků"
Binary file modified locales/en_GB.mo
Binary file not shown.
10 changes: 5 additions & 5 deletions locales/en_GB.po
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: GLPI Plugin - Tag\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-09-12 12:09+0000\n"
"POT-Creation-Date: 2020-02-07 10:06+0000\n"
"PO-Revision-Date: 2019-09-12 12:10+0000\n"
"Last-Translator: Cédric Anne\n"
"Language-Team: English (United Kingdom) (http://www.transifex.com/teclib/glpi-plugin-tag/language/en_GB/)\n"
Expand All @@ -20,11 +20,11 @@ msgstr ""
"Language: en_GB\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: hook.php:181
#: hook.php:180
msgid "Add tags"
msgstr "Add tags"

#: hook.php:183
#: hook.php:182
msgid "Remove tags"
msgstr "Remove tags"

Expand All @@ -42,10 +42,10 @@ msgstr[1] "Tags"
msgid "HTML color"
msgstr "HTML color"

#: inc/tag.class.php:562
#: inc/tag.class.php:618
msgid "View all tags"
msgstr "View all tags"

#: setup.php:128
#: setup.php:138
msgid "Tag Management"
msgstr "Tag Management"
Binary file modified locales/en_US.mo
Binary file not shown.
10 changes: 5 additions & 5 deletions locales/en_US.po
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: GLPI Plugin - Tag\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-09-12 12:09+0000\n"
"POT-Creation-Date: 2020-02-07 10:06+0000\n"
"PO-Revision-Date: 2019-09-12 12:10+0000\n"
"Last-Translator: Cédric Anne\n"
"Language-Team: English (United States) (http://www.transifex.com/teclib/glpi-plugin-tag/language/en_US/)\n"
Expand All @@ -19,11 +19,11 @@ msgstr ""
"Language: en_US\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: hook.php:181
#: hook.php:180
msgid "Add tags"
msgstr "Add tags"

#: hook.php:183
#: hook.php:182
msgid "Remove tags"
msgstr "Remove tags"

Expand All @@ -41,10 +41,10 @@ msgstr[1] "Tags"
msgid "HTML color"
msgstr "HTML color"

#: inc/tag.class.php:562
#: inc/tag.class.php:618
msgid "View all tags"
msgstr "View all tags"

#: setup.php:128
#: setup.php:138
msgid "Tag Management"
msgstr "Tag Management"
Binary file modified locales/es_419.mo
Binary file not shown.
10 changes: 5 additions & 5 deletions locales/es_419.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: GLPI Plugin - Tag\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-09-12 12:09+0000\n"
"POT-Creation-Date: 2020-02-07 10:06+0000\n"
"PO-Revision-Date: 2019-09-12 12:10+0000\n"
"Last-Translator: Cédric Anne\n"
"Language-Team: Spanish (Latin America) (http://www.transifex.com/teclib/glpi-plugin-tag/language/es_419/)\n"
Expand All @@ -18,11 +18,11 @@ msgstr ""
"Language: es_419\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: hook.php:181
#: hook.php:180
msgid "Add tags"
msgstr "Agregar etiquetas"

#: hook.php:183
#: hook.php:182
msgid "Remove tags"
msgstr "Eliminar etiquetas"

Expand All @@ -40,10 +40,10 @@ msgstr[1] "Etiquetas"
msgid "HTML color"
msgstr "Color HTML"

#: inc/tag.class.php:562
#: inc/tag.class.php:618
msgid "View all tags"
msgstr "Ver todas las etiquetas"

#: setup.php:128
#: setup.php:138
msgid "Tag Management"
msgstr "Administración de etiquetas"
Binary file modified locales/es_ES.mo
Binary file not shown.
10 changes: 5 additions & 5 deletions locales/es_ES.po
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: GLPI Plugin - Tag\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-09-12 12:09+0000\n"
"POT-Creation-Date: 2020-02-07 10:06+0000\n"
"PO-Revision-Date: 2019-09-12 12:10+0000\n"
"Last-Translator: Cédric Anne\n"
"Language-Team: Spanish (Spain) (http://www.transifex.com/teclib/glpi-plugin-tag/language/es_ES/)\n"
Expand All @@ -19,11 +19,11 @@ msgstr ""
"Language: es_ES\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: hook.php:181
#: hook.php:180
msgid "Add tags"
msgstr "Agregar etiquetas"

#: hook.php:183
#: hook.php:182
msgid "Remove tags"
msgstr "Eliminar etiquetas"

Expand All @@ -41,10 +41,10 @@ msgstr[1] "Etiquetas"
msgid "HTML color"
msgstr "Color HTML"

#: inc/tag.class.php:562
#: inc/tag.class.php:618
msgid "View all tags"
msgstr "Ver todas las etiquetas"

#: setup.php:128
#: setup.php:138
msgid "Tag Management"
msgstr "Administración de etiquetas"
Binary file modified locales/es_MX.mo
Binary file not shown.
10 changes: 5 additions & 5 deletions locales/es_MX.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: GLPI Plugin - Tag\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-09-12 12:09+0000\n"
"POT-Creation-Date: 2020-02-07 10:06+0000\n"
"PO-Revision-Date: 2019-09-12 12:10+0000\n"
"Last-Translator: Cédric Anne\n"
"Language-Team: Spanish (Mexico) (http://www.transifex.com/teclib/glpi-plugin-tag/language/es_MX/)\n"
Expand All @@ -18,11 +18,11 @@ msgstr ""
"Language: es_MX\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: hook.php:181
#: hook.php:180
msgid "Add tags"
msgstr "Agregar etiquetas"

#: hook.php:183
#: hook.php:182
msgid "Remove tags"
msgstr "Eliminar etiquetas"

Expand All @@ -40,10 +40,10 @@ msgstr[1] "Etiquetas"
msgid "HTML color"
msgstr "Color HTML"

#: inc/tag.class.php:562
#: inc/tag.class.php:618
msgid "View all tags"
msgstr "Ver todas las etiquetas"

#: setup.php:128
#: setup.php:138
msgid "Tag Management"
msgstr "Administración de etiquetas"
Binary file modified locales/fi_FI.mo
Binary file not shown.
10 changes: 5 additions & 5 deletions locales/fi_FI.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: GLPI Plugin - Tag\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-09-12 12:09+0000\n"
"POT-Creation-Date: 2020-02-07 10:06+0000\n"
"PO-Revision-Date: 2019-09-12 12:10+0000\n"
"Last-Translator: Cédric Anne\n"
"Language-Team: Finnish (Finland) (http://www.transifex.com/teclib/glpi-plugin-tag/language/fi_FI/)\n"
Expand All @@ -18,11 +18,11 @@ msgstr ""
"Language: fi_FI\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: hook.php:181
#: hook.php:180
msgid "Add tags"
msgstr "Lisää tunnisteita"

#: hook.php:183
#: hook.php:182
msgid "Remove tags"
msgstr "Poista tunnisteita"

Expand All @@ -40,10 +40,10 @@ msgstr[1] "Tunnisteet"
msgid "HTML color"
msgstr "HTML-väri"

#: inc/tag.class.php:562
#: inc/tag.class.php:618
msgid "View all tags"
msgstr "Näytä kaikki tunnisteet"

#: setup.php:128
#: setup.php:138
msgid "Tag Management"
msgstr "Tunnisteiden hallinta"
Binary file modified locales/fr_FR.mo
Binary file not shown.
Loading

0 comments on commit c7f6ff5

Please sign in to comment.