Skip to content

Commit

Permalink
fix: improve visibility of icms_ipf_view_column (#1612)
Browse files Browse the repository at this point in the history
* fix: improve visibility of icms_ipf_view_column

* getCustomMethodForValue was empty, rectified
  • Loading branch information
fiammybe authored Jan 6, 2025
1 parent 1786435 commit 85cda0a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
21 changes: 12 additions & 9 deletions htdocs/libraries/icms/ipf/view/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,13 @@
*/
class icms_ipf_view_Column {

public $_keyname;
public $_align;
public $_width;
private $_keyname;
private $_align;
private $_width;
public $_customMethodForValue;
public $_extraParams;
public $_sortable;
public $_customCaption;
/**
* @var false|unknown_type
*/
private $_extraParams;
private $_sortable;
private $_customCaption;
private $_param;

/**
Expand Down Expand Up @@ -101,6 +98,12 @@ public function getWidth() {
public function getCustomCaption() {
return $this->_customCaption;
}
public function getParam() {
return $this->_param;
}

public function getCustomMethodForValue() {
return $this->_customMethodForValue;
}
}

14 changes: 7 additions & 7 deletions htdocs/libraries/icms/ipf/view/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,12 @@ public function createTableRows() {
if (method_exists($object, 'initiateCustomFields')) {
// $object->initiateCustomFields();
}
if ($column->_keyname == 'checked') {
if ($column->getKeyName() == 'checked') {
$value = '<input type ="checkbox" name="selected_icms_persistableobjects[]" value="' . $object->id() . '" />';
} elseif ($column->_customMethodForValue && method_exists($object, $column->_customMethodForValue)) {
$method = $column->_customMethodForValue;
if ($column->_param) {
$value = $object->$method($column->_param);
} elseif ($column->getCustomMethodForValue() && method_exists($object, $column->getCustomMethodForValue())) {
$method = $column->getCustomMethodForValue();
if ($column->getParam()) {
$value = $object->$method($column->getParam());
} else {
$value = $object->$method();
}
Expand Down Expand Up @@ -751,7 +751,7 @@ public function render($fetchOnly = false, $debug = false) {
$aColumn['align'] = $column->getAlign();
$aColumn['key'] = $column->getKeyName();

if ($column->_keyname == 'checked') {
if ($column->getKeyName() == 'checked') {
$aColumn['caption'] = '<input type ="checkbox" id="checkall_icmspersistableobjects" name="checkall_icmspersistableobjects"' . ' value="checkall_icmspersistableobjects" onclick="icms_checkall(window.document.form_' . $this->_id . ', \'selected_icmspersistableobjects\');" />';
} elseif ($column->getCustomCaption()) {
$aColumn['caption'] = $column->getCustomCaption();
Expand All @@ -768,7 +768,7 @@ public function render($fetchOnly = false, $debug = false) {
} else {
$qs_param = '';
}
if (!$this->_enableColumnsSorting || $column->_keyname == 'checked' || !$column->_sortable) {
if (!$this->_enableColumnsSorting || $column->getKeyName() == 'checked' || !$column->isSortable()) {
$aColumn['caption'] = $aColumn['caption'];
} elseif ($getSort) {
$aColumn['caption'] = '<a href="' . $current_url . '?' . $this->_objectHandler->_itemname . '_' . 'sortsel=' . $column->getKeyName() . '&amp;' . $this->_objectHandler->_itemname . '_' . 'ordersel=' . $orderArray[$order]['neworder'] . $qs_param . '&amp;' . $new_query_string . '">' . $aColumn['caption'] . ' <img src="' . ICMS_IMAGES_SET_URL . '/actions/' . $orderArray[$order]['image'] . '" alt="ASC" /></a>';
Expand Down

0 comments on commit 85cda0a

Please sign in to comment.