1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-06-05 22:09:38 +02:00

Introdotta stampa attività con checklist

This commit is contained in:
Matteo
2022-04-04 17:58:46 +02:00
parent 319fd87091
commit 28d706410b
4 changed files with 58 additions and 1 deletions

View File

@@ -63,3 +63,28 @@ function renderChecklist($check, $level = 0)
return $result;
}
function renderChecklistHtml($check, $level = 0)
{
$user = auth()->getUser();
$enabled = $check->assignedUsers ? $check->assignedUsers->pluck('id')->search($user->id) !== false : true;
$width = 10+20*$level;
$result = '
<tr>
<td class="text-center" style="width:30px;">
'.(!empty($check->checked_at)?'<img src="'.ROOTDIR.'/templates/interventi/check.png" style="width:10px;">':'').'
</td>
<td style="padding-left:'.$width.'px;">
<span class="text">'.$check->content.'</span>
</td>
</tr>';
$children = $check->children;
foreach ($children as $child) {
$result .= renderChecklistHtml($child, $level + 1);
}
return $result;
}