You are not logged in.
Pages: 1
Dears,
I read much much topics here and elsewhere, but didn't find any answer to my question.
I achieved to create each page with data i wanted.
Except that data appear in a new tab, whereas i would like to be appearing in the same tab in a modal window/popup where each link clicked in this window would load in the background window.
function plugin_ETM_postinit() {
global $CFG_GLPI, $PLUGIN_HOOKS;
foreach ($PLUGIN_HOOKS['plugin_ETM'] as $type => $typeETM) {
CommonGLPI::registerStandardTab($type, $typeETM);
}
}
function plugin_ETM_MassiveActions($type) {
global $PLUGIN_HOOKS;
switch ($type) {
default :
if (isset($PLUGIN_HOOKS['plugin_ETM'][$type])) {
return ['PluginETMCommon'.MassiveAction::CLASS_ACTION_SEPARATOR.'DoIt'
=> __('Afficher le TM', 'ETM')];
}
}
return [];
}
function plugin_ETM_install() {
global $DB;
$migration = new Migration('1.0.0');
$DB->runFile(GLPI_ROOT . "/plugins/ETM/sql/empty-1.0.sql");
include_once(Plugin::getPhpDir('ETM')."/inc/profile.class.php");
return true;
}
static function showMassiveActionsSubForm(MassiveAction $ma) {
switch ($ma->getAction()) {
case 'DoIt':
$cont = $ma->POST['container'];
<...>
echo Html::submit(_sx('button', 'Post'), $opt);
return true;
}
}
static function processMassiveActionsForOneItemtype(MassiveAction $ma, CommonDBTM $item,
array $ids) {
global $DB;
switch ($ma->getAction()) {
case 'DoIt' :
$input = $ma->getInput();
<...php page generation with data from $ids>
}
I tried some addings in $opt variable with different modal options as 'modal' => true, but nothing worked well.
Would anyone have an idea to open such a modal window in PHP through GLPI plugin ?
Thanks a lot for your help.
technical : GLPI 9.5.11 / Php 7.2
Last edited by GLPIdev (2023-12-22 16:53:58)
Offline
Pages: 1