Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

- Fixed table formatting and border in PDF
- Fixed table cell size in PDF generation
- Fixed approval comments rendering as raw HTML in PDF
- Fixed PDF crash when exporting Problems with linked items lacking serial/inventory fields
- Fixed PHP warnings flood when exporting Changes with linked items lacking serial/inventory fields
- Fixed Change and Problem description exported as a single unstructured text block
- Fixed Change analysis and plan fields rendering as raw HTML in PDF

## [4.0.2] - 2025-09-30

Expand Down
31 changes: 11 additions & 20 deletions inc/change.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public static function pdfMain(PluginPdfSimplePDF $pdf, Change $job)

$pdf->displayText(
'<b><i>' . sprintf(__('%1$s: %2$s') . '</i></b>', __('Description'), ''),
Toolbox::stripTags($job->fields['content']),
$job->fields['content'],
1,
);

Expand All @@ -311,45 +311,36 @@ public static function pdfAnalysis(PluginPdfSimplePDF $pdf, Change $job)
$pdf->setColumnsSize(100);
$pdf->displayTitle('<b>' . __('Analysis') . '</b>');

$pdf->setColumnsSize(10, 90);

$pdf->displayText(sprintf(
__('%1$s: %2$s'),
$pdf->displayText(
'<b><i>' . __('Impacts') . '</i></b>',
$job->fields['impactcontent'],
));
);

$pdf->displayText(sprintf(
__('%1$s: %2$s'),
$pdf->displayText(
'<b><i>' . __('Control list') . '</i></b>',
$job->fields['controlistcontent'],
));
);
}

public static function pdfPlan(PluginPdfSimplePDF $pdf, Change $job)
{
$pdf->setColumnsSize(100);
$pdf->displayTitle('<b>' . __('Plans') . '</b>');

$pdf->setColumnsSize(10, 90);

$pdf->displayText(sprintf(
__('%1$s: %2$s'),
$pdf->displayText(
'<b><i>' . __('Deployment plan') . '</i></b>',
$job->fields['rolloutplancontent'],
));
);

$pdf->displayText(sprintf(
__('%1$s: %2$s'),
$pdf->displayText(
'<b><i>' . __('Backup plan') . '</i></b>',
$job->fields['backoutplancontent'],
));
);

$pdf->displayText(sprintf(
__('%1$s: %2$s'),
$pdf->displayText(
'<b><i>' . __('Checklist') . '</i></b>',
$job->fields['checklistcontent'],
));
);
}

public static function pdfStat(PluginPdfSimplePDF $pdf, Change $job)
Expand Down
8 changes: 4 additions & 4 deletions inc/change_item.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,17 @@ public static function pdfForChange(PluginPdfSimplePDF $pdf, Change $change)
Toolbox::stripTags(sprintf(__('%1$s: %2$s'), $typename, $nb)),
Toolbox::stripTags($name),
Dropdown::getDropdownName('glpi_entities', $data['entity']),
Toolbox::stripTags((string) $data["serial"]),
Toolbox::stripTags((string) $data["otherserial"]),
Toolbox::stripTags($data['serial'] ?? ''),
Toolbox::stripTags($data['otherserial'] ?? ''),
$nb,
);
} else {
$pdf->displayLine(
'',
Toolbox::stripTags($name),
Dropdown::getDropdownName('glpi_entities', $data['entity']),
Toolbox::stripTags((string) $data["serial"]),
Toolbox::stripTags((string) $data["otherserial"]),
Toolbox::stripTags($data['serial'] ?? ''),
Toolbox::stripTags($data['otherserial'] ?? ''),
$nb,
);
}
Expand Down
8 changes: 4 additions & 4 deletions inc/item_problem.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,17 @@ public static function pdfForProblem(PluginPdfSimplePDF $pdf, Problem $problem)
Toolbox::stripTags(sprintf(__('%1$s: %2$s'), $typename, $nb)),
Toolbox::stripTags($name),
Dropdown::getDropdownName('glpi_entities', $data['entity']),
Toolbox::stripTags($data['serial']),
Toolbox::stripTags($data['otherserial']),
Toolbox::stripTags($data['serial'] ?? ''),
Toolbox::stripTags($data['otherserial'] ?? ''),
$nb,
);
} else {
$pdf->displayLine(
'',
Toolbox::stripTags($name),
Dropdown::getDropdownName('glpi_entities', $data['entity']),
Toolbox::stripTags($data['serial']),
Toolbox::stripTags($data['otherserial']),
Toolbox::stripTags($data['serial'] ?? ''),
Toolbox::stripTags($data['otherserial'] ?? ''),
$nb,
);
}
Expand Down
2 changes: 1 addition & 1 deletion inc/problem.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public static function pdfMain(PluginPdfSimplePDF $pdf, Problem $job)

$pdf->displayText(
'<b><i>' . sprintf(__('%1$s: %2$s'), __('Description') . '</i></b>', ''),
Toolbox::stripTags($job->fields['content']),
$job->fields['content'],
1,
);

Expand Down
4 changes: 2 additions & 2 deletions inc/ticketvalidation.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ public static function pdfForTicket(PluginPdfSimplePDF $pdf, Ticket $ticket)
Html::convDateTime($row['validation_date']),
$dbu->getUserName($row['users_id_validate']),
);
$tmp = trim($row['comment_submission']);
$tmp = trim(html_entity_decode($row['comment_submission'] ?? '', ENT_QUOTES, 'UTF-8'));
$pdf->displayText('<b><i>' . sprintf(
__('%1$s: %2$s'),
__('Request comments') . '</i></b>',
'',
), (empty($tmp) ? __('None') : $tmp), 1);

if ($row['validation_date']) {
$tmp = trim($row['comment_validation']);
$tmp = trim(html_entity_decode($row['comment_validation'] ?? '', ENT_QUOTES, 'UTF-8'));
$pdf->displayText(
'<b><i>' . sprintf(
__('%1$s: %2$s'),
Expand Down
1 change: 1 addition & 0 deletions tools/move_to_po.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

chdir(dirname($_SERVER['SCRIPT_FILENAME']));

$argv = $argv ?? [];
for ($i = 1 ; $i < count($argv) ; $i++) {
//To be able to use = in search filters, enter \= instead in command line
//Replace the \= by ° not to match the split function
Expand Down