Skip to content

Commit

Permalink
Evarisk#37 [KanbanCard] add: propale kanban card
Browse files Browse the repository at this point in the history
  • Loading branch information
theodaviddd committed Dec 24, 2024
1 parent 4a229ea commit 0a8dc88
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions class/kanban.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,28 @@ public function getObjectKanbanView($object, $objectMetadata) {
global $langs;

$userAffected = new User($this->db);
$projectAffected = new Project($this->db);

$objectTitle = method_exists($object, 'getNomUrl') ? $object->getNomUrl(1) : $object->ref;
$objectSubtitle = htmlspecialchars($object->label ?? '');
$moreFooterData = '';
$moreBodyData = '';
$moreHeaderData = '';

$nameField = $objectMetadata['name_field'];
if (strstr($nameField, ',')) {
$nameFields = explode(', ', $nameField);
if (is_array($nameFields) && !empty($nameFields)) {
foreach ($nameFields as $subnameField) {
if ($subnameField != 'ref') {
$objectSubtitle .= $object->$subnameField . ' ';
}
}
}
} else {
$objectSubtitle = $object->$nameField;
}

if ($object->element == 'project') {
$object->getLinesArray($user);
$tasksCounter = is_array($object->lines) ? count($object->lines) : 0;
Expand All @@ -208,21 +223,14 @@ public function getObjectKanbanView($object, $objectMetadata) {
$userAffected->fetch($object->fk_user_assign);
$moreFooterData .= '<span class="kanban-data"> ' . $userAffected->getNomUrl(1) . '</span>';
$moreBodyData = '<br><span class="kanban-data"> ' . $object->type_label . '</span>';
} else if ($object->element == 'propal') {
$moreHeaderData .= '<span class="kanban-data"> ' . $object->getLibStatut(2) . '</span>';
$projectAffected->fetch($object->fk_project);
$moreBodyData = '<br><span class="kanban-data"> ' . $projectAffected->getNomUrl(1) . '</span>';
$moreFooterData = '<span class="kanban-data"><i class="fas fa-calendar"></i> ' . dol_print_date($object->date_creation, 'day') . '</span>';
$moreFooterData .= '<span class="kanban-data"><i class="fas fa-euro-sign"></i> ' . price($object->total_ht) . '</span>';
}

$nameField = $objectMetadata['name_field'];
if (strstr($nameField, ',')) {
$nameFields = explode(', ', $nameField);
if (is_array($nameFields) && !empty($nameFields)) {
foreach ($nameFields as $subnameField) {
if ($subnameField != 'ref') {
$objectSubtitle .= $object->$subnameField . ' ';
}
}
}
} else {
$objectSubtitle = $object->$nameField;
}

$selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']);
$actionsButton = '
Expand Down

0 comments on commit 0a8dc88

Please sign in to comment.