Skip to content

Commit

Permalink
Merge pull request #18 from delcroip/develop
Browse files Browse the repository at this point in the history
1.0.1.rc3
  • Loading branch information
delcroip authored Jun 18, 2021
2 parents 86595f7 + baef3c4 commit e49b7c1
Show file tree
Hide file tree
Showing 13 changed files with 564 additions and 589 deletions.
2 changes: 1 addition & 1 deletion hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,4 +357,4 @@ function plugin_openmedis_giveItem($type, $ID, array $data, $num) {
}
return "";

}
}
77 changes: 0 additions & 77 deletions inc/Item_DeviceMedicalaccessory.class.php

This file was deleted.

2 changes: 1 addition & 1 deletion inc/devicemedicalaccessory.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function getAdditionalFields() {
],
[
'name' => 'plugin_openmedis_medicalaccessorycategories_id',
'label' => _n('Model','Models', 1),
'label' => _n('Category','Categories', 1),
'type' => 'dropdownValue'
],
[
Expand Down
27 changes: 22 additions & 5 deletions inc/medicalaccessorycategory.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ function cleanDBonPurge() {
function getAdditionalFields() {

$tab = [['name' => 'code',
'label' => __('code of the category'),
'label' => __('Code'),
'type' => 'text',
'list' => true],
['name' => 'plugin_openmedis_medicalaccessorycategories_id',
'label' => __('Parent'),
'type' => 'dropdownValue'],
['name' => 'picture',
'label' => __('Picture'),
'type' => 'picture'],
'type' => 'picture']
];

if (!Session::haveRightsOr(PluginOpenmedisMedicalAccessoryCategory::$rightname, [CREATE, UPDATE, DELETE])) {
Expand All @@ -76,11 +76,28 @@ function getAdditionalFields() {
function rawSearchOptions() {
$tab = parent::rawSearchOptions();

$tab[] = [
'id' => '50',
'table' => $this->getTable(),
'field' => 'code',
'name' => __('Code'),
'datatype' => 'text',
'right' => PluginOpenmedisMedicalAccessoryCategory::$rightname
];
$tab[] = [
'id' => '80',
'table' => 'code',
'table' => $this->getTable(),
'field' => 'name',
'name' => __('Code'),
'name' => __('Name'),
'datatype' => 'text',
'right' => PluginOpenmedisMedicalAccessoryCategory::$rightname
];

$tab[] = [
'id' => '100',
'table' => $this->getTable(),
'field' => 'comment',
'name' => __('Comment'),
'datatype' => 'text',
'right' => PluginOpenmedisMedicalAccessoryCategory::$rightname
];
Expand All @@ -89,4 +106,4 @@ function rawSearchOptions() {



}
}
4 changes: 2 additions & 2 deletions inc/medicalconsumableitem.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* \see medical consumable
**/
class PluginOpenmedisMedicalConsumableItem extends CommonDBTM {

use Glpi\Features\DCBreadcrumb;
// From CommonDBTM
static protected $forward_entity_to = ['MedicalConsumable', 'Infocom'];
public $dohistory = true;
Expand Down Expand Up @@ -639,4 +639,4 @@ static function getIcon() {
return PluginOpenmedisMedicalConsumable::getIcon();
}

}
}
16 changes: 7 additions & 9 deletions inc/medicaldevice.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* PluginOpenmedisMedicalDevice Class
**/
class PluginOpenmedisMedicalDevice extends CommonDBTM {
use DCBreadcrumb;
use Glpi\Features\DCBreadcrumb;

// From CommonDBTM
public $dohistory = true;
Expand Down Expand Up @@ -178,7 +178,8 @@ function cleanDBonPurge() {
* - withtemplate boolean : template or basic item
*
* @return boolean item found
**/
**/

function showForm($ID, $options = []) {
global $CFG_GLPI;
$this->initForm($ID, $options);
Expand Down Expand Up @@ -286,14 +287,11 @@ function showForm($ID, $options = []) {
'entity' => $this->fields["entities_id"],
'right' => 'all']);
echo "</td>\n";
echo "<td>".__('Management type')."</td>\n";
echo "<td>".__('Utilization')."</td>\n";
echo "<td>";
/* Dropdown::showGlobalSwitch($this->fields["id"],
['withtemplate' => $withtemplate,
'value' => $this->fields["is_global"],
'management_restrict'
=> $CFG_GLPI["medicaldevices_management_restrict"],
'target' => $target]);*/

PluginOpenmedisUtilization::dropdown(['value' => $this->fields["plugin_openmedis_utilizations_id"]]);

echo "</td></tr>\n";

$rowspan = 2;
Expand Down
36 changes: 24 additions & 12 deletions inc/medicaldevicecategory.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,21 @@ static function getTypeName($nb = 0) {
}


function cleanDBonPurge() {
Rule::cleanForItemAction($this);
}

function getAdditionalFields() {

$tab = [['name' => 'code',
'label' => __('code of the category'),
'label' => __('Code'),
'type' => 'text',
'list' => true],
['name' => 'plugin_openmedis_medicaldevicecategories_id',
['name' => 'plugin_openmedis_medicalaccessorycategories_id',
'label' => __('Parent'),
'type' => 'dropdownValue'],
['name' => 'picture',
['name' => 'picture',
'label' => __('Picture'),
'type' => 'picture'],
];

if (!Session::haveRightsOr('plugin_openmedis_medicaldevicecategory', [CREATE, UPDATE, DELETE])) {
if (!Session::haveRightsOr(PluginOpenmedisMedicalDeviceCategory::$rightname, [CREATE, UPDATE, DELETE])) {

unset($tab[7]);
}
Expand All @@ -78,15 +74,31 @@ function rawSearchOptions() {

$tab[] = [
'id' => '80',
'table' => 'code',
'table' => $this->getTable(),
'field' => 'name',
'name' => __('Name'),
'datatype' => 'text',
'right' => PluginOpenmedisMedicalDeviceCategory::$rightname
];
$tab[] = [
'id' => '50',
'table' => $this->getTable(),
'field' => 'code',
'name' => __('Code'),
'datatype' => 'text',
'right' => 'plugin_openmedis'
'right' => PluginOpenmedisMedicalDeviceCategory::$rightname
];
$tab[] = [
'id' => '100',
'table' => $this->getTable(),
'field' => 'comment',
'name' => __('Comment'),
'datatype' => 'text',
'right' => PluginOpenmedisMedicalDeviceCategory::$rightname
];

return $tab;
}



}
}
Loading

0 comments on commit e49b7c1

Please sign in to comment.