glpi-project / glpi

GLPI is a Free Asset and IT Management Software package, Data center management, ITIL Service Desk, licenses tracking and software auditing.
https://glpi-project.org
GNU General Public License v3.0
4.07k stars 1.27k forks source link

[GLPI 10] can't add rack when we have background picture #10179

Closed ASLLR closed 2 years ago

ASLLR commented 2 years ago

Code of Conduct

Is there an existing issue for this?

Version

V10 Beta 1

Bug description

Hi everyone,

in Home/Management/Data centers/ Server rooms i can't add rack on grid. The "+ Insert a rack here" doesn't aswer to click.

And when i add a background picture in the server room, i don't have the grid, i see the background picture but i've only the error message you can see under and no possibility to add racks.

Thank you,

Relevant log output

+ getBijectiveIndex(x) + ''); } for (var y = 1; y <= 11; y++) { $('.indexes-y').append('
' + y + '
'); } // append cells for adding racks for (var y = 1; y <= 11; y++) { for (var x = 1; x <= 15; x++) { $('.racks_add') .append('
'); } } var x_before_drag = 0; var y_before_drag = 0; var dirty = false; $('.grid-stack') .on('change', function(event, items) { if (dirty) { return; } var grid = $(event.target).data('gridstack'); $.each(items, function(index, item) { $.post('/glpi-test/ajax/rack.php', { id: item.id, dcrooms_id: 1, action: 'move_rack', x: $(item.el).attr('gs-x') + 1, y: $(item.el).attr('gs-y') + 1, }, function(answer) { var answer = jQuery.parseJSON(answer); // revert to old position if (!answer.status) { dirty = true; grid.update(item.el, { 'x': x_before_drag, 'y': y_before_drag }); dirty = false; displayAjaxMessageAfterRedirect(); } }); }); }) .on('dragstart', function(event, ui) { var element = $(event.target); var node = element.data('_gridstack_node'); // store position before drag x_before_drag = Number(node.x); y_before_drag = Number(node.y); // disable qtip element.qtip('hide', true); }) .on('click', function(event, ui) { var grid = this; var element = $(event.target); var el_url = element.find('a').attr('href'); if (el_url) { window.location = el_url; } }); $('#viewgraph .cell_add').on('click', function(){ var _this = $(this); if (_this.find('div').length == 0) { var _x = _this.data('x'); var _y = _this.data('y'); glpi_ajax_dialog({ url : "/glpi-test/front/rack.form.php", params: { room: 1, position: _x + ',' + _y, ajax: true } }); } }); $('#viewgraph .cell_add, #viewgraph .grid-stack-item').each(function() { var tipcontent = $(this).find('.tipcontent'); if (tipcontent.length) { $(this).qtip({ position: { my: 'left center', at: 'right center', }, content: { text: tipcontent }, style: { classes: 'qtip-shadow qtip-bootstrap rack_tipcontent' } }); } }); }); //]]>

Page URL

$SRV/glpi/front/dcroom.form.php?id=1

Steps To reproduce

  1. go to Home/Management/Data centers/ Server rooms
  2. Create the Data Center and The server room
  3. try to add rack
  4. try to add a background picture.

Your GLPI setup information

GLPI 10.0.0-dev Installation mode: TARBALL Current language:en_GB

Anything else?

Capture

cconard96 commented 2 years ago

Can you test #10180?

ASLLR commented 2 years ago

Hello cconard96, that's good for error message on the background picture with your correction and i can see grid.

But the grid always no react on click for add rack.

Thank you

cconard96 commented 2 years ago

Do any errors show in the browser console (F12 key to open it usually)?

ASLLR commented 2 years ago

Yes, i've got warnings : (that is trad from french)

And errors :

Capture Capture

Thank you,

ASLLR commented 2 years ago

That's not resolved we can't add a rack when we try to click with or without background picture.

Thank you,

cconard96 commented 2 years ago

It was automatically closed when the PR for the missing quote was merged.ive reopened since it is only partially resolved

cconard96 commented 2 years ago

I made a change and tested and this seems to finally resolve the issue. Can you confirm? https://github.com/cconard96/glpi/commit/b7ae02108fa733d5e3fdbdf53afec10e8191a699

ASLLR commented 2 years ago

Hello, that's all right with or without background. I've no errors in the debug juste this warning

But that's works !

Thank for all.

cconard96 commented 2 years ago

I can't recreate the font warning in Chrome or Firefox, but it looks like the icons are showing properly in the interface.