Skip to content

Commit

Permalink
Update workstation_list.php (#25707)
Browse files Browse the repository at this point in the history
* Update workstation_list.php

* Update workstation_list.php

---------

Co-authored-by: Laurent Destailleur <[email protected]>
  • Loading branch information
dolibit-ut and eldy authored Nov 12, 2024
1 parent 66ee2a2 commit e5caa21
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions htdocs/workstation/workstation_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)


// Load variables for pagination
$id = GETPOSTINT('id');
$ref = GETPOST('ref', 'alpha');

Expand Down Expand Up @@ -159,6 +161,7 @@
$arrayfields = dol_sort_array($arrayfields, 'position');
'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan

// Permissions
$permissiontoread = $user->hasRight('workstation', 'workstation', 'read');
$permissiontoadd = $user->hasRight('workstation', 'workstation', 'write');
$permissiontodelete = $user->hasRight('workstation', 'workstation', 'delete');
Expand All @@ -167,6 +170,7 @@
restrictedArea($user, $object->element, 0, $object->table_element, 'workstation');



/*
* Actions
*/
Expand Down Expand Up @@ -229,6 +233,7 @@
$help_url = 'EN:Module_Workstation';
$morejs = array();
$morecss = array();
// llxHeader -> look down at section Output page


// Build and execute select
Expand All @@ -242,6 +247,7 @@
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
}
}

// Add fields from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
Expand All @@ -260,6 +266,7 @@
if (!empty($resources)) {
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'workstation_workstation_resource wr ON (wr.fk_workstation = t.rowid)';
}

// Add table from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
Expand Down Expand Up @@ -796,10 +803,12 @@

// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';

// Fields from hook
$parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;

// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="nowrap center">';
Expand Down

0 comments on commit e5caa21

Please sign in to comment.