pluginsGLPI / room

Room GLPI plugin
GNU General Public License v2.0
16 stars 13 forks source link

GLPI 9.2 #28

Closed machobymb closed 2 years ago

machobymb commented 6 years ago

I tried it in GLPI 9.2.

I viewed the source (room.class.php). The form rendering is incorrect, because in debug mode wrote this error message: "Fatal error: Call to undefined method Dropdown::showInteger() in /var/www/html/glpi/plugins/room/inc/room.class.php on line 315"

Dropdown::showInteger("size", $this->fields["size"],0, 500);

machobymb commented 6 years ago

Heureka!

I found this information in GitHub: the showInteger function is deprecated. I changed the line 315 in room.class.php:

if (version_compare(GLPI_VERSION, '9.2', '<')) { Dropdown::showInteger("size", $this->fields["size"],0, 500); } else { Dropdown::showNumber("size", array('value' => $this->fields["size"], 'min' => 0, 'max' => 500)); }

This code was perfect! I thought that showDateFormItem is deprecated too in line 331. I changed the line 331 (now 335) in room.class.php:

if (version_compare(GLPI_VERSION, '9.2', '<')) { Dropdown::showDateFormItem("buy", $this->fields["buy"],true, true); } else { Dropdown::showDateField("buy", array('value' => $this->fields["buy"], 'maybeempty' => true, 'canedit' => true, 'min' => '', 'max' => '')); }

The form is good now. Where can I found full documentation from GLPI functions. I'd like develop a specific event calendar plugin to my workplace.

jackburton79 commented 2 years ago

works in 9.4 now