You are not logged in.
Hello, it is possible to reassign a ticket by making a popup or modal window call as in the following example:
I want to create a popup window similar to the example, with additional information and to be able to call it when clicking on any button or image.
I have reviewed the classes ajax.class.php, html.class.php which contain some functions that make calls to this type of windows, however I do not get it to work a window that I created in my own function.
Offline
It's prefer to create a plugin to do that instead of changing the core
CentOS 6.5 - CentOS 7
PHP 5.6 - PHP 7 - MySQL 5.6 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)
Offline
Can you provide an example about, how to create an modal window in glpi? In the class ajax.class.php there are some functions to create modal windows like this:
/**
* Create modal window
* After display it using $name.dialog("open");
*
* @since version 0.84
*
* @param $name name of the js object
* @param $url URL to display in modal
* @param $options array of possible options:
* - width (default 800)
* - height (default 400)
* - modal is a modal window ? (default true)
* - container specify a html element to render (default empty to html.body)
* - title window title (default empty)
* - display display or get string ? (default true)
**/
static function createModalWindow($name, $url, $options=array() ) {
$param = array('width' => 800,
'height' => 400,
'modal' => true,
'container' => '',
'title' => '',
'extraparams' => array(),
'display' => true,
'js_modal_fields' => '');
...
I tried to create my own windows but when I call them they just do not show up on the screen...
Offline
Version of GLPI used?
CentOS 6.5 - CentOS 7
PHP 5.6 - PHP 7 - MySQL 5.6 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)
Offline
I'm usign version 9.1.4
Offline
I have analyzed some classes
Load Bookmarks in html.class.php
<script type="text/javascript">
$('#loadbookmark').dialog({
modal: true,
autoOpen: false,
height: 500,
width: 1050,
draggable: true,
resizeable: true,
open: function(ev, ui){
$('#Iframeloadbookmark').attr('src','/glpi914/front/bookmark.php?action=load&_in_modal=1');},close: function(ev, ui) { window.location.reload() },title: "Cargar un marcador"});
</script>
<a href="#" onclick="$('#loadbookmark').dialog('open');"><span id="bookmark_icon" title="Cargar un marcador" alt="Cargar un marcador" class="button-icon"></span></a>
Ajax::createIframeModalWindow('loadbookmark',
$CFG_GLPI["root_doc"]."/front/bookmark.php?action=load",
array('title' => __('Load a bookmark'),
'reloadonclose' => true));
echo "<a href='#' onClick=\"".Html::jsGetElementbyID('loadbookmark').".dialog('open');\">";
Show menu in html.class.php
<script type="text/javascript">
//<![CDATA[
$( document ).ready(function() {
$('#show_all_menu').dialog({
height: 'auto',
width: 'auto',
modal: true,
autoOpen: false
});
});
//]]>
</script>
<a href="#" onclick="$('#show_all_menu').dialog('open');" id="menu_all_button" class="button-icon"></a>
Add dropdown in Knowledge Base
<img alt="" title="Añadir" src="/glpi914/pics/add_dropdown.png" style="cursor:pointer; margin-left:2px;" onclick="$('#add_dropdown1843132794').dialog('open');">
<script type="text/javascript">
$('#add_dropdown1843132794').dialog({
modal: true,
autoOpen: false,
height: 500,
width: 1050,
draggable: true,
resizeable: true,
open: function(ev, ui){
$('#Iframeadd_dropdown1843132794').attr('src','/glpi914/front/knowbaseitemcategory.form.php?_in_modal=1');},title: ""});
</script>
In ajax.class.php exist 3 functions:
static function createModalWindow($name, $url, $options=array() ) { ... }
static function createFixedModalWindow($name, $options=array() ) { ... }
static function createIframeModalWindow($domid, $url, $options=array() ) { ... }
Could you share an example?
Offline
Anyone???
Last edited by lexcorp (2017-10-05 05:42:20)
Offline
A little help here please!..
Offline