|
@@ -573,13 +573,24 @@ class GenController {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ // ensure uid column is at the start
|
|
|
+ $columns = array_merge(['uid'], array_filter($columns, function($x) {
|
|
|
+ return $x !== 'uid';
|
|
|
+ }));
|
|
|
+
|
|
|
foreach ($columns as $column) {
|
|
|
|
|
|
+ if($column === 'id') continue;
|
|
|
+
|
|
|
$columnTitle = $this->snakeToTitleCase($column);
|
|
|
$columnValue = "<?= \$record->$column ?>";
|
|
|
$hasLink = $controller->hasView && $column === $method->viewLinkField;
|
|
|
$linkTarget = "/{$controller->name}/view/<?= \$record->uid ?>";
|
|
|
|
|
|
+ if(substr($column, -3) === '_at') {
|
|
|
+ $columnValue = "<?= friendly_date_time(\$record->$column) ?>";
|
|
|
+ }
|
|
|
+
|
|
|
// check if this column has column spec
|
|
|
if(isset($method->columns[$column])) {
|
|
|
$columnTitle = $method->columns[$column]["label"];
|
|
@@ -596,6 +607,11 @@ class GenController {
|
|
|
$linkTarget = $method->columns[$column]["link"];
|
|
|
}
|
|
|
}
|
|
|
+ else if($column === 'uid') {
|
|
|
+ $columnTitle = ' ';
|
|
|
+ $columnValue = '<i class="fas fa-share-square"></i>';
|
|
|
+ $hasLink = true;
|
|
|
+ }
|
|
|
|
|
|
$ths[] = "<th>$columnTitle</th>";
|
|
|
$tds[] = "<td>" .
|
|
@@ -750,13 +766,24 @@ class GenController {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ // ensure uid column is at the start
|
|
|
+ $columns = array_merge(['uid'], array_filter($columns, function($x) {
|
|
|
+ return $x !== 'uid';
|
|
|
+ }));
|
|
|
+
|
|
|
foreach ($columns as $column) {
|
|
|
|
|
|
+ if($column === 'id') continue;
|
|
|
+
|
|
|
$columnTitle = $this->snakeToTitleCase($column);
|
|
|
$columnValue = "<?= \$subRecord->$column ?>";
|
|
|
$hasLink = $method->exitURL && $column === $method->viewLinkField;
|
|
|
$linkTarget = $method->exitURL;
|
|
|
|
|
|
+ if(substr($column, -3) === '_at') {
|
|
|
+ $columnValue = "<?= friendly_date_time(\$record->$column) ?>";
|
|
|
+ }
|
|
|
+
|
|
|
// check if this column has column spec
|
|
|
if(isset($method->columns[$column])) {
|
|
|
$columnTitle = $method->columns[$column]["label"];
|
|
@@ -770,6 +797,11 @@ class GenController {
|
|
|
$linkTarget = $method->columns[$column]["link"];
|
|
|
}
|
|
|
}
|
|
|
+ else if($column === 'uid') {
|
|
|
+ $columnTitle = ' ';
|
|
|
+ $columnValue = '<i class="fas fa-share-square"></i>';
|
|
|
+ $hasLink = true;
|
|
|
+ }
|
|
|
|
|
|
$ths[] = "<th>$columnTitle</th>";
|
|
|
$tds[] = "<td>" .
|