Skip to content

Commit

Permalink
remove error in glpi 10
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Delcroix committed Mar 13, 2022
1 parent 13ffd80 commit 53fbc3b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 31 deletions.
8 changes: 3 additions & 5 deletions hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ function plugin_openmedis_postinit() {
$plugin = new Plugin();
if ($plugin->isInstalled('order') && $plugin->isActivated('order')) {
array_push($ORDER_TYPES, 'PluginOpenmedisMedicalDevice');
array_push($ORDER_TYPES , 'PluginOpenmedisMedicalConsumableItem');
array_push($ORDER_TYPES , 'PluginOpenmedisDeviceMedicalAccessory');
}
if ($plugin->isInstalled('fields') && $plugin->isActivated('fields')) {
array_push($PLUGIN_HOOKS['plugin_fields'] , 'PluginOpenmedisMedicalDevice');
Expand All @@ -82,6 +84,7 @@ function plugin_openmedis_postinit() {


}

/**
* @param string $type
* @return array
Expand Down Expand Up @@ -179,9 +182,6 @@ function plugin_openmedis_getDropdown() {
}
}




function plugin_openmedis_getAddSearchOptions($itemtype) {
$sopt = [];

Expand Down Expand Up @@ -234,8 +234,6 @@ function plugin_openmedis_addLeftJoin($type, $ref_table, $new_table,
return "";
}



// Hook done on purge item case
function plugin_openmedis_item_purge($item) {
$type = get_class($item);
Expand Down
12 changes: 6 additions & 6 deletions inc/medicalconsumableitem.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ function cleanDBonPurge() {

function post_getEmpty() {

$this->fields["alarm_threshold"] = Entity::getUsedConfig("plugin_openmedis_medicalconsumables_alert_repeat",
/*FIXME $this->fields["alarm_threshold"] = Entity::getUsedConfig("plugin_openmedis_medicalconsumables_alert_repeat",
$this->fields["entities_id"],
"plugin_openmedis_default_medicalconsumables_alarm_threshold",
10);
10);*/
}


Expand Down Expand Up @@ -185,7 +185,7 @@ function showForm($ID, $options = []) {
echo "<tr class='tab_bg_1'>";
echo "<td>".__('Name')."</td>";
echo "<td>";
Html::autocompletionTextField($this, "name");
echo Html::input("name");
echo "</td>";
echo "<td>"._n('Type', 'Types', 1)."</td>";
echo "<td>";
Expand All @@ -195,7 +195,7 @@ function showForm($ID, $options = []) {
echo "<tr class='tab_bg_1'>";
echo "<td>".__('Reference')."</td>";
echo "<td>";
Html::autocompletionTextField($this, "ref");
echo Html::input("ref");
echo "</td>";
echo "<td>".Manufacturer::getTypeName(1)."</td>";
echo "<td>";
Expand Down Expand Up @@ -296,8 +296,8 @@ function rawSearchOptions() {
'massiveaction' => false,
'nosearch' => true,
'nosort' => true,
'additionalfields' => ['alarm_threshold']*/
];
'additionalfields' => ['alarm_threshold']
];*/

$tab[] = [
'id' => '17',
Expand Down
28 changes: 10 additions & 18 deletions inc/medicaldevice.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
**/
class PluginOpenmedisMedicalDevice extends CommonDBTM {
use Glpi\Features\DCBreadcrumb;

//use Glpi\Features\Clonable;
use Glpi\Features\Inventoriable;
// From CommonDBTM
public $dohistory = true;
// used to filter the categories
Expand Down Expand Up @@ -230,7 +231,7 @@ function showForm($ID, $options = []) {
]);
echo "</td></tr>\n";

$this->showDcBreadcrumb();


echo "<tr class='tab_bg_1'>";
$tplmark = $this->getAutofillMark('name', $options);
Expand All @@ -243,7 +244,7 @@ function showForm($ID, $options = []) {
$objectName = autoName($this->fields["name"], "name",
(isset($options['withtemplate']) && ($options['withtemplate'] == 2)),
$this->getType(), $this->fields["entities_id"]);
Html::autocompletionTextField($this, "name", ['value' => $objectName]);
echo Html::input( "name", ['value' => $objectName]);
echo "</td>\n";
echo "<td>".__('Location')."</td>\n";
echo "<td>";
Expand Down Expand Up @@ -289,17 +290,17 @@ function showForm($ID, $options = []) {
echo "<tr class='tab_bg_1'>";
echo "<td>".__('Alternate username number')."</td>\n";
echo "<td>";
Html::autocompletionTextField($this, "contact_num");
echo Html::input("contact_num");
echo "</td>";
echo "<td>".__('Serial number')."</td>\n";
echo "<td>";
Html::autocompletionTextField($this, "serial");
echo Html::input("serial");
echo "</td></tr>\n";

echo "<tr class='tab_bg_1'>";
echo "<td>".__('Alternate username')."</td>\n";
echo "<td>";
Html::autocompletionTextField($this, "contact");
echo Html::input("contact");
echo "</td>\n";

$tplmark = $this->getAutofillMark('otherserial', $options);
Expand All @@ -309,7 +310,7 @@ function showForm($ID, $options = []) {
$objectName = autoName($this->fields["otherserial"], "otherserial",
(isset($options['withtemplate']) && ($options['withtemplate'] == 2)),
$this->getType(), $this->fields["entities_id"]);
Html::autocompletionTextField($this, "otherserial", ['value' => $objectName]);
echo Html::input("otherserial", ['value' => $objectName]);
echo "</td></tr>\n";

echo "<tr class='tab_bg_1'>";
Expand Down Expand Up @@ -344,7 +345,7 @@ function showForm($ID, $options = []) {
echo "<tr class='tab_bg_1'>";
echo "<td>".__('Brand')."</td>\n";
echo "<td>";
Html::autocompletionTextField($this, "brand");
echo Html::input("brand");
echo "</td>\n";
echo "</tr>\n";

Expand All @@ -356,7 +357,7 @@ function showForm($ID, $options = []) {
$objectName = autoName($this->fields["barcode"], "barcode",
(isset($options['withtemplate']) && ($options['withtemplate'] == 2)),
$this->getType(), $this->fields["entities_id"]);
Html::autocompletionTextField($this, "barcode", ['value' => $objectName]);
echo Html::input("barcode", ['value' => $objectName]);
echo "</td></tr>\n";


Expand Down Expand Up @@ -527,15 +528,6 @@ function rawSearchOptions() {
'condition' => ['is_visible_medicaldevice' => 1]
];

$tab[] = [
'id' => '5',
'table' => $this->getTable(),
'field' => 'serial',
'name' => __('Serial number'),
'datatype' => 'string',
'autocomplete' => true,
];

$tab[] = [
'id' => '6',
'table' => $this->getTable(),
Expand Down
4 changes: 2 additions & 2 deletions inc/medicaldevicecategory.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,15 @@ function showForm($ID, $options = []) {
echo "<tr class='tab_bg_1'>";
echo "<td>".__('Code')."</td>\n";
echo "<td>";
Html::autocompletionTextField($this, "code");
echo Html::input("code");
echo "</td>\n";
echo "</tr>\n";


echo "<tr class='tab_bg_1'>";
echo "<td>".__('Label')."</td>\n";
echo "<td>";
Html::autocompletionTextField($this, "label");
echo Html::input("label");
echo "</td>\n";
echo "</tr>\n";

Expand Down

0 comments on commit 53fbc3b

Please sign in to comment.