mirror of
https://github.com/pluginsGLPI/example.git
synced 2025-12-27 12:25:04 +01:00
Feature GLP11 (#88)
* Feature GLP11 * phpstan * enable CI and fix phstanneon * Update .github/workflows/continuous-integration.yml Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com> * Update phpstan.neon Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com> * Pass all paramters to parent call * move query -> doQuery * fix direct query * release GLPI 11.0 * Clean composer.json * psalm + rector * fix --------- Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com> Co-authored-by: Johan Cwiklinski <johan@x-tnd.be> Co-authored-by: Rom1-B <rom1.biot@gmail.com>
This commit is contained in:
@@ -37,23 +37,17 @@ namespace GlpiPlugin\Example;
|
||||
|
||||
use CommonDBTM;
|
||||
|
||||
// Class of the defined type
|
||||
|
||||
if (!defined('GLPI_ROOT')) {
|
||||
die("Sorry. You can't access directly to this file");
|
||||
}
|
||||
|
||||
class Computer extends CommonDBTM
|
||||
{
|
||||
public static function showInfo()
|
||||
{
|
||||
echo '<table class="tab_glpi" width="100%">';
|
||||
echo '<tr>';
|
||||
echo '<th>' . __('More information') . '</th>';
|
||||
echo '<th>' . __s('More information') . '</th>';
|
||||
echo '</tr>';
|
||||
echo '<tr class="tab_bg_1">';
|
||||
echo '<td>';
|
||||
echo __('Test successful');
|
||||
echo __s('Test successful');
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
echo '</table>';
|
||||
@@ -71,7 +65,7 @@ class Computer extends CommonDBTM
|
||||
|
||||
public static function add_default_where($in)
|
||||
{
|
||||
list($itemtype, $condition) = $in;
|
||||
[$itemtype, $condition] = $in;
|
||||
if ($itemtype == 'Computer') {
|
||||
$table = getTableForItemType($itemtype);
|
||||
$condition .= ' (' . $table . '.groups_id NOT IN (' . implode(',', $_SESSION['glpigroups']) . '))';
|
||||
|
||||
Reference in New Issue
Block a user