-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add certificate links
- Loading branch information
Showing
11 changed files
with
209 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
|
||
traiter l'environnement | ||
utiliser $used | ||
|
||
lier des processus à des entités ? | ||
|
||
si ajout serveur - detecter si des instances de bdd existent et les ajouter automatiquement : ok | ||
et les ajouter directement dans l'infra logique : ok | ||
|
||
|
||
Si besoin de définir l'environnementen GLPI 10 : | ||
https://github.com/glpi-project/glpi/pull/18288 | ||
https://github.com/glpi-project/glpi/pull/18288 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
<?php | ||
/* | ||
* @version $Id: HEADER 15930 2011-10-30 15:47:55Z tsmr $ | ||
------------------------------------------------------------------------- | ||
webapplications plugin for GLPI | ||
Copyright (C) 2009-2023 by the webapplications Development Team. | ||
https://github.com/InfotelGLPI/webapplications | ||
------------------------------------------------------------------------- | ||
LICENSE | ||
This file is part of webapplications. | ||
webapplications 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. | ||
webapplications 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 webapplications. If not, see <http://www.gnu.org/licenses/>. | ||
-------------------------------------------------------------------------- | ||
*/ | ||
|
||
if (!defined('GLPI_ROOT')) { | ||
die("Sorry. You can't access directly to this file"); | ||
} | ||
|
||
use Glpi\Application\View\TemplateRenderer; | ||
|
||
/** | ||
* Class PluginWebapplicationsCertificate | ||
*/ | ||
class PluginWebapplicationsCertificate extends CommonDBTM | ||
{ | ||
public static $rightname = "plugin_webapplications_appliances"; | ||
|
||
public static function getTypeName($nb = 0) | ||
{ | ||
return _n("Certificate", 'Certificates', $nb); | ||
} | ||
|
||
public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) | ||
{ | ||
if ($_SESSION['glpishow_count_on_tabs']) { | ||
$ApplianceId = $_SESSION['plugin_webapplications_loaded_appliances_id']; | ||
$self = new Certificate(); | ||
$nb = count(PluginWebapplicationsDashboard::getObjects($self, $ApplianceId)); | ||
return self::createTabEntry(self::getTypeName($nb), $nb); | ||
} | ||
return self::getTypeName(); | ||
} | ||
|
||
public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) | ||
{ | ||
$obj = new Certificate(); | ||
PluginWebapplicationsDashboard::showList($obj); | ||
return true; | ||
} | ||
|
||
|
||
public function showForm($ID, $options = []) | ||
{ | ||
$instance = new Certificate(); | ||
$instance->showForm($ID, $options); | ||
|
||
return true; | ||
} | ||
|
||
public static function showListObjects($list) | ||
{ | ||
$object = new Certificate(); | ||
|
||
echo "<div style='display: flex;flex-wrap: wrap;'>"; | ||
|
||
foreach ($list as $field) { | ||
$name = $field['name']; | ||
$id = $field['id']; | ||
$object->getFromDB($id); | ||
|
||
echo "<div class='card w-33' style='margin-right: 10px;margin-top: 10px;'>"; | ||
echo "<div class='card-body'>"; | ||
echo "<div style='display: inline-block;margin: 40px;'>"; | ||
echo "<i class='fa-5x fas fa-certificate'></i>"; | ||
echo "</div>"; | ||
echo "<div style='display: inline-block;';>"; | ||
echo "<h5 class='card-title' style='font-size: 14px;'>" . $object->getLink() . "</h5>"; | ||
|
||
|
||
echo "<p class='card-text'>"; | ||
echo Html::convDateTime($object->fields['date_expiration']); | ||
echo "</p>"; | ||
|
||
$link = $object::getFormURLWithID($id); | ||
$link .= "&forcetab=main"; | ||
$rand = mt_rand(); | ||
echo "<span style='float: right'>"; | ||
if ($object->canUpdate()) { | ||
echo Html::submit( | ||
_sx('button', 'Edit'), | ||
[ | ||
'name' => 'edit', | ||
'class' => 'btn btn-secondary right', | ||
'icon' => 'fas fa-edit', | ||
'form' => '', | ||
'data-bs-toggle' => 'modal', | ||
'data-bs-target' => '#edit' . $id . $rand | ||
] | ||
); | ||
|
||
echo Ajax::createIframeModalWindow( | ||
'edit' . $id . $rand, | ||
$link, | ||
[ | ||
'display' => false, | ||
'reloadonclose' => true | ||
] | ||
); | ||
} | ||
|
||
echo "</div>"; | ||
echo "</div>"; | ||
echo "</div>"; | ||
echo "</span>"; | ||
} | ||
echo "</div>"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.