Skip to content

Commit

Permalink
Merge pull request #9 from AntoineLemarchand/stable
Browse files Browse the repository at this point in the history
Responsive status labels
  • Loading branch information
AntoineLemarchand authored Mar 6, 2024
2 parents c48b6a8 + 28407f6 commit 3829952
Show file tree
Hide file tree
Showing 11 changed files with 1,560 additions and 53 deletions.
102 changes: 55 additions & 47 deletions css/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -700,62 +700,66 @@ tr[data-itemtype="PluginFormcreatorCondition"] ~ tr[data-itemtype="PluginFormcre
margin-top: 10px;
}

.toggle_menu #formcreator_servicecatalogue_ticket_summary {
left: 100px;
}

#formcreator_servicecatalogue_ticket_summary {
margin: 5px 60px 0 5px;
height: inherit;
position: absolute;
display: flex;
align-items: center;
z-index: 15;
left: 150px;
width: 260px;
top: 10px;
transition: .4s;
height: 1rem;
}
height: 45px;

.toggle_menu #formcreator_servicecatalogue_ticket_summary {
left: 100px;
}
.status {
min-width: 2.3rem;
max-height: 45px;
display: inline-block;
margin-right: 5px;
padding: 5px;
text-align: center;
background-color: rgba(0, 0, 0, .15);
vertical-align: top;
box-sizing: border-box;
}

#formcreator_servicecatalogue_ticket_summary .status {
min-width: 2.3rem;
display: inline-block;
margin-right: 5px;
margin-top: -5px;
padding: 5px;
text-align: center;
background-color: rgba(0, 0, 0, .15);
vertical-align: top;
box-sizing: border-box;
}
#formcreator_servicecatalogue_ticket_summary .status:hover {
background-color: rgba(0, 0, 0, .3);
}
#formcreator_servicecatalogue_ticket_summary .status_number {
font-size: 2em;
}
#formcreator_servicecatalogue_ticket_summary .status_label {
font-size: .7em;
display: none;
}
#formcreator_servicecatalogue_ticket_summary .status:hover .status_label {
display: block;
line-height: 0;
}
#formcreator_servicecatalogue_ticket_summary .status_incoming,
#formcreator_servicecatalogue_ticket_summary .status_incoming a {
color: #c8ffc8;
}
#formcreator_servicecatalogue_ticket_summary .status_waiting,
#formcreator_servicecatalogue_ticket_summary .status_waiting a {
color: #f7c976;
}
#formcreator_servicecatalogue_ticket_summary .status_validate,
#formcreator_servicecatalogue_ticket_summary .status_validate a {
color: #9B9BE9;
}
#formcreator_servicecatalogue_ticket_summary .status_solved,
#formcreator_servicecatalogue_ticket_summary .status_solved a {
color: #ffffff;
.status:hover {
background-color: rgba(0, 0, 0, .3);
}

.status_number {
font-size: 2em;
}
.status_label {
font-size: .7em;
display: none;
}

.status:hover .status_label {
display: block;
line-height: 0;
}

.status_incoming, .status_incoming a {
color: #c8ffc8;
}

.status_waiting, .status_waiting a {
color: #f7c976;
}

.status_validate, .status_validate a {
color: #9B9BE9;
}

.status_solved, .status_solved a {
color: #ffffff;
}
}


Expand Down Expand Up @@ -1358,7 +1362,7 @@ a.plugin_formcreator_formTile_title {
.plugin_formcreator_leftHeader a, .plugin_formcreator_myname {
color: #FFF;
height: 35px;
line-height: 35px;
// line-height: 35px;
}


Expand Down Expand Up @@ -1651,6 +1655,10 @@ span.fc_list_icon {
#formcreator_servicecatalogue_ticket_summary {
width: 100%;
display: block;

.status_label {
display: block;
}
}

.plugin_formcreator_container #footer {
Expand Down
1,429 changes: 1,428 additions & 1 deletion css_compiled/styles.min.css

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions inc/config.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ public function showConfigForm() {

$updateLabel = __('Update');

$counterLabel = __('Enable ticket status counter', 'formcreator');
$counterCheck = $config['enable_ticket_status_counter'] == 1 ? 'checked' : '';

echo <<<HTML
<div class="center vertical ui-tabs">
<form action="$action" method="post">
Expand Down Expand Up @@ -127,6 +130,11 @@ public function showConfigForm() {
<input type="hidden" name="collapse_menu" value="0">
<input type="checkbox" name="collapse_menu" value="1" {$collapseChecked}/>
</td>
<td>$counterLabel</td>
<td>
<input type="hidden" name="enable_ticket_status_counter" value="0">
<input type="checkbox" name="enable_ticket_status_counter" value="1" {$counterCheck}/>
</td>
</tr>
</tbody>
</table>
Expand Down
6 changes: 4 additions & 2 deletions inc/wizard.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ public static function header($title) {
echo "<input type='checkbox' id='formcreator-toggle-nav-desktop'>";
echo "<label for='formcreator-toggle-nav-desktop' class='formcreator-nav-button'></label>";

self::showTicketSummary();
if ($config['enable_ticket_status_counter'] == 1) {
self::showTicketSummary();
}

echo '<div id="header_top">';
echo '<div id="c_logo"></div>';
Expand Down Expand Up @@ -256,7 +258,7 @@ public static function showTicketSummary() {
<a href='".$link."?".
Toolbox::append_params(PluginFormcreatorIssue::getWaitingCriteria(), '&amp;')."'>
<span class='status_number'><i class='fas fa-spinner fa-spin'></i></span>
<label class='status_label'>".__('Pending')."</label>
<label class='status_label'>".__('Pending', 'formcreator')."</label>
</a>
</span>";

Expand Down
1 change: 1 addition & 0 deletions install/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class PluginFormcreatorInstall {
'2.12.1' => '2.12.5',
'2.12.5' => '2.13',
'2.13' => '2.14',
'2.14' => '2.15',
];

/**
Expand Down
3 changes: 2 additions & 1 deletion install/mysql/plugin_formcreator_empty.sql
Original file line number Diff line number Diff line change
Expand Up @@ -331,4 +331,5 @@ INSERT IGNORE INTO `glpi_plugin_formcreator_configs` (`name`, `value`) VALUES
('collapse_menu', 0),
('default_categories_id', 0),
('enable_saved_search', 1),
('see_all', 1);
('see_all', 1),
('enable_ticket_status_counter', 1);
44 changes: 44 additions & 0 deletions install/upgrade_to_2.15.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* ---------------------------------------------------------------------
* Formcreator is a plugin which allows creation of custom forms of
* easy access.
* ---------------------------------------------------------------------
* LICENSE
*
* This file is part of Formcreator.
*
* Formcreator is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Formcreator is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Formcreator. If not, see <http://www.gnu.org/licenses/>.
* ---------------------------------------------------------------------
* @copyright Copyright © 2011 - 2021 Teclib'
* @license http://www.gnu.org/licenses/gpl.txt GPLv3+
* @link https://github.com/pluginsGLPI/formcreator/
* @link https://pluginsglpi.github.io/formcreator/
* @link http://plugins.glpi-project.org/#/plugin/formcreator
* ---------------------------------------------------------------------
*/
class PluginFormcreatorUpgradeTo2_15 {
/** @var Migration */
protected $migration;

/**
* @param Migration $migration
*/
public function upgrade(Migration $migration) {
$migration->insertInTable("glpi_plugin_formcreator_configs", [
'name' => 'enable_ticket_status_counter',
'value' => '1'
]);
}
}
Binary file modified locales/fr_FR.mo
Binary file not shown.
8 changes: 8 additions & 0 deletions locales/fr_FR.po
Original file line number Diff line number Diff line change
Expand Up @@ -1768,3 +1768,11 @@ msgstr "Catégorie par défaut"
#: inc/config.class.php:82
msgid "Enable See all tab"
msgstr "Activer l'onglet Voir tous"

#: inc/config.class.php:92
msgid "Enable ticket status counter"
msgstr "Activer le compteur de statut de ticket"

#: inc/wizard.class.php:261
msgid "Pending"
msgstr "En attente"
8 changes: 8 additions & 0 deletions locales/glpi.pot
Original file line number Diff line number Diff line change
Expand Up @@ -1704,4 +1704,12 @@ msgstr ""

#: inc/config.class.php:82
msgid "Enable See all tab"
msgstr ""

#: inc/config.class.php:92
msgid "Enable ticket status counter"
msgstr ""

#: inc/wizard.class.php:261
msgid "Pending"
msgstr ""
4 changes: 2 additions & 2 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@

global $CFG_GLPI;
// Version of the plugin (major.minor.bugfix)
define('PLUGIN_FORMCREATOR_VERSION', '2.14.2');
define('PLUGIN_FORMCREATOR_VERSION', '2.14.3');
// Schema version of this version (major.minor only)
define('PLUGIN_FORMCREATOR_SCHEMA_VERSION', '2.14');
define('PLUGIN_FORMCREATOR_SCHEMA_VERSION', '2.15');
// is or is not an official release of the plugin
define('PLUGIN_FORMCREATOR_IS_OFFICIAL_RELEASE', true);

Expand Down

0 comments on commit 3829952

Please sign in to comment.