View Issue Details

IDProjectCategoryView StatusLast Update
0023631mantisbtprintingpublic2019-04-17 12:47
Reporteratrol Assigned To 
Status confirmedResolutionopen 
Summary0023631: Wrong status color when printing

The status square is always black when printing.

TagsNo tags attached.




2017-11-13 08:57


print-status-colors.PNG (21,576 bytes)   
print-status-colors.PNG (21,576 bytes)   


2017-11-14 05:18

reporter   ~0058195

From my point of view, this problem occurs when the selected printer is black and white.



2017-11-14 07:16

developer   ~0058196

this problem occurs when the selected printer is black and white.

I don't hink so. At least the avatars are colored.

PrintMyView.PNG (41,069 bytes)   
PrintMyView.PNG (41,069 bytes)   


2019-04-17 09:43

reporter   ~0061947

Yes, the status colors are black even with a color printer and Print to PDF in Chrome. As @atrol mentioned, the avatars are just fine. Needs a fix since 2.5!



2019-04-17 10:59

developer   ~0061948

The problem is caused by bootstrap, which forces black color for print media.

We would need to override that somehow. I'm not a CSS expert though, so not sure what the best approach would be. Since the CSS is generated dynamically, this would probably have to be done in css/status_config.php, but currently that is loaded before bootstrap so that might have to be changed.



2019-04-17 12:42

developer   ~0061949

Last edited: 2019-04-17 12:47

View 2 revisions

I made some tests which lead me to think that this should be possible, but I'm confused with the results. Maybe someone more qualified than me with CSS can shed some light.

In status_config.php, add the following line in the foreach loop

echo "@media print { ." . html_get_status_css_fg( $t_id ) . ":before { color: green !important; } }\n";

In print preview, this causes all status boxes to show in green. So far, so good. BUT:

echo "@media print { ." . html_get_status_css_fg( $t_id ) . ":before { color: {$t_color} !important; } }\n";

Shows the boxes with faded colors unrelated to the defined RGB values for MantisBT status colors !

I found that by adding non-standard CSS property -webkit-print-color-adjust: exact; allows Chrome to render color as expected. It still does not work for Firefox though. Have not tried any other browsers.

Issue History

Date Modified Username Field Change
2017-11-13 08:57 atrol New Issue
2017-11-13 08:57 atrol File Added: print-status-colors.PNG
2017-11-14 05:18 lexlogos Note Added: 0058195
2017-11-14 07:16 atrol File Added: PrintMyView.PNG
2017-11-14 07:16 atrol Note Added: 0058196
2019-04-17 09:43 stevecharon Note Added: 0061947
2019-04-17 10:59 dregad Status new => confirmed
2019-04-17 10:59 dregad Note Added: 0061948
2019-04-17 12:42 dregad Note Added: 0061949
2019-04-17 12:47 dregad Note Edited: 0061949 View Revisions