34 public $table_element =
'workstation_workstation_resource';
37 public $element =
'workstationresource';
42 public $fields = array(
43 'fk_workstation' => array(
'type' =>
'integer',
'label' =>
'Workstation',
'enabled' => 1,
'position' => 10,
'visible' => 1),
44 'fk_resource' => array(
'type' =>
'integer',
'label' =>
'UserGroup',
'enabled' => 1,
'position' => 20,
'visible' => 1),
50 public $fk_workstation;
70 foreach ($this->fields as $key => $val) {
71 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
72 unset($this->fields[$key]);
77 if (is_object($langs)) {
78 foreach ($this->fields as $key => $val) {
79 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
80 foreach ($val[
'arrayofkeyval'] as $key2 => $val2) {
81 $this->fields[$key][
'arrayofkeyval'][$key2] = $langs->trans($val2);
98 return parent::getAllItemsLinkedByObjectID($fk_workstation,
'fk_resource',
'fk_workstation', $obj->table_element);
110 $obj =
new self($db);
111 return parent::deleteAllItemsLinkedByObjectID($fk_workstation,
'fk_workstation', $obj->table_element);
Parent class of all other business classes (invoices, contracts, proposals, orders,...
Class to link resource with Workstations.
static getAllResourcesOfWorkstation($fk_workstation)
Function used to get an array with all resources linked to a workstation.
__construct($db)
WorkstationResource constructor.
static deleteAllResourcesOfWorkstation($fk_workstation)
Function used to remove all resources linked to a workstation.