Skip to content

Commit 59dfe06

Browse files
committed
#241 don't show links in print view
1 parent 49d102c commit 59dfe06

File tree

1 file changed

+46
-37
lines changed

1 file changed

+46
-37
lines changed

adm_program/modules/lists/lists_show.php

Lines changed: 46 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* 1 - Only show the list without any other html unnecessary elements
2121
*
2222
*****************************************************************************/
23-
23+
2424
require_once('../../system/common.php');
2525

2626
// Initialize and check the parameters
@@ -58,7 +58,7 @@
5858
{
5959
// set role default list configuration
6060
$getListId = $role->getDefaultList();
61-
61+
6262
if($getListId == 0)
6363
{
6464
$gMessage->show($gL10n->get('LST_DEFAULT_LIST_NOT_SET_UP'));
@@ -167,7 +167,7 @@
167167
{
168168
$datatable = false;
169169
$hoverRows = false;
170-
170+
171171
if($getShowMembers == 0)
172172
{
173173
$memberStatus = $gL10n->get('LST_ACTIVE_MEMBERS');
@@ -188,10 +188,10 @@
188188
$page->hideThemeHtml();
189189
$page->hideMenu();
190190
$page->setPrintMode();
191-
191+
192192
$page->setTitle($title);
193193
$page->setHeadline($headline);
194-
194+
195195
$table = new HtmlTable('adm_lists_table', $page, $hoverRows, $datatable, $classTable);
196196
}
197197
elseif($getMode == 'pdf')
@@ -210,7 +210,7 @@
210210
// set header and footer fonts
211211
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
212212
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
213-
213+
214214
// set auto page breaks
215215
$pdf->SetAutoPageBreak(true, PDF_MARGIN_BOTTOM);
216216
$pdf->SetMargins(10, 20, 10);
@@ -219,13 +219,13 @@
219219

220220
//headline for PDF
221221
$pdf->SetHeaderData('', '', $headline, '');
222-
222+
223223
// set font
224224
$pdf->SetFont('times', '', 10);
225225

226226
// add a page
227227
$pdf->AddPage();
228-
228+
229229
// Create table object for display
230230
$table = new HtmlTable('adm_lists_table', $pdf, $hoverRows, $datatable, $classTable);
231231
$table->addAttribute('border', '1');
@@ -251,7 +251,7 @@
251251

252252
$page->setTitle($title);
253253
$page->setHeadline($headline);
254-
254+
255255
$page->addHtml('<h5>'.$role->getValue('cat_name').' - '.$memberStatus.'</h5>');
256256
$page->addJavascript('
257257
$("#export_list_to").change(function () {
@@ -262,11 +262,11 @@
262262
"lst_id='. $getListId. '&rol_id='. $getRoleId. '&mode=" + result + "&show_members='.$getShowMembers.'";
263263
}
264264
});
265-
265+
266266
$("#menu_item_print_view").click(function () {
267267
window.open("'.$g_root_path.'/adm_program/modules/lists/lists_show.php?lst_id='.$getListId.'&mode=print&rol_id='.$getRoleId.'&show_members='.$getShowMembers.'", "_blank");
268268
});', true);
269-
269+
270270
// get module menu
271271
$listsMenu = $page->getMenu();
272272

@@ -282,17 +282,17 @@
282282
$listsMenu->addItem('menu_item_full_screen', $g_root_path.'/adm_program/modules/lists/lists_show.php?lst_id='.$getListId.'&amp;mode=html&amp;rol_id='.$getRoleId.'&amp;show_members='.$getShowMembers.'&amp;full_screen=1',
283283
$gL10n->get('SYS_FULL_SCREEN'), 'arrow_out.png');
284284
}
285-
285+
286286
// link to assign or remove members if you are allowed to do it
287287
if($role->allowedToAssignMembers($gCurrentUser))
288288
{
289289
$listsMenu->addItem('menu_item_assign_members', $g_root_path.'/adm_program/modules/lists/members_assignment.php?rol_id='. $role->getValue('rol_id'),
290290
$gL10n->get('SYS_ASSIGN_MEMBERS'), 'add.png');
291291
}
292-
292+
293293
// link to print overlay and exports
294294
$listsMenu->addItem('menu_item_print_view', '#', $gL10n->get('LST_PRINT_PREVIEW'), 'print.png');
295-
295+
296296
$form = new HtmlForm('navbar_export_to_form', '', $page, array('type' => 'navbar', 'setFocus' => false));
297297
$selectBoxEntries = array('' => $gL10n->get('LST_EXPORT_TO').' ...', 'csv-ms' => $gL10n->get('LST_MICROSOFT_EXCEL').' ('.$gL10n->get('SYS_ISO_8859_1').')', 'pdf' => $gL10n->get('SYS_PDF').' ('.$gL10n->get('SYS_PORTRAIT').')',
298298
'pdfl' => $gL10n->get('SYS_PDF').' ('.$gL10n->get('SYS_LANDSCAPE').')', 'csv-oo' => $gL10n->get('SYS_CSV').' ('.$gL10n->get('SYS_UTF8').')');
@@ -375,7 +375,7 @@
375375
{
376376
$table->addColumn($gL10n->get('SYS_ABR_NO'), array('style' => 'text-align: '.$columnAlign[$columnNumber-1].';font-size:14;background-color:#C7C7C7;'), 'th');
377377
}
378-
378+
379379
$table->addColumn($columnHeader, array('style' => 'text-align: '.$columnAlign[$columnNumber-1].';font-size:14;background-color:#C7C7C7;'), 'th');
380380
}
381381
elseif($getMode == 'html' || $getMode == 'print')
@@ -438,7 +438,7 @@
438438
$listRowNumber = 1;
439439
$title = $gL10n->get('SYS_PARTICIPANTS');
440440
}
441-
441+
442442
$table->addRowByArray(array($title), null, array('class' => 'admidio-group-heading'), 1, ($list->countColumns() + 1));
443443
$lastGroupHead = $row['mem_leader'];
444444
}
@@ -491,7 +491,7 @@
491491
{
492492
// die Laufende Nummer noch davorsetzen
493493
$columnValues[] = $listRowNumber;
494-
494+
495495
// in html mode we add an additional column with leader/member information to
496496
// enable the grouping function of jquery datatables
497497
if($getMode == 'html')
@@ -582,8 +582,17 @@
582582
}
583583
// create output in html layout
584584
else
585-
{
586-
$columnValues[] = $gProfileFields->getHtmlValue($gProfileFields->getPropertyById($usf_id, 'usf_name_intern'), $content, $row['usr_id']);
585+
{
586+
if($getMode == 'print'
587+
&& ( $gProfileFields->getPropertyById($usf_id, 'usf_type') == 'EMAIL'
588+
|| $gProfileFields->getPropertyById($usf_id, 'usf_type') == 'URL'))
589+
{
590+
$columnValues[] = $content;
591+
}
592+
else
593+
{
594+
$columnValues[] = $gProfileFields->getHtmlValue($gProfileFields->getPropertyById($usf_id, 'usf_name_intern'), $content, $row['usr_id']);
595+
}
587596
}
588597
}
589598
}
@@ -617,19 +626,19 @@
617626
{
618627
$filename = $gCurrentOrganization->getValue('org_shortname'). '-'. str_replace('.', '', $role->getValue('rol_name')).'.'.$getMode;
619628
}
620-
629+
621630
// for IE the filename must have special chars in hexadecimal
622631
if (preg_match('/MSIE/', $_SERVER['HTTP_USER_AGENT']))
623632
{
624633
$filename = urlencode($filename);
625634
}
626635

627636
header('Content-Disposition: attachment; filename="'.$filename.'"');
628-
637+
629638
// neccessary for IE6 to 8, because without it the download with SSL has problems
630639
header('Cache-Control: private');
631640
header('Pragma: public');
632-
641+
633642
}
634643

635644
if($getMode == 'csv')
@@ -651,10 +660,10 @@
651660
{
652661
// output the HTML content
653662
$pdf->writeHTML($table->getHtmlTable(), true, false, true, false, '');
654-
663+
655664
//Save PDF to file
656665
$pdf->Output(SERVER_PATH. '/adm_my_files/'.$filename, 'F');
657-
666+
658667
//Redirect
659668
header('Content-Type: application/pdf');
660669

@@ -667,12 +676,12 @@
667676
// add table list to the page
668677
$page->addHtml($table->show(false));
669678

670-
679+
671680
// create a infobox for the role
672681
if($getMode == 'html')
673682
{
674683
$htmlBox = '';
675-
684+
676685
// only show infobox if additional role information fields are filled
677686
if(strlen($role->getValue('rol_start_date')) > 0
678687
|| $role->getValue('rol_weekday') > 0
@@ -687,19 +696,19 @@
687696
<div class="panel-body">';
688697
$form = new HtmlForm('list_infobox_items', null);
689698
$form->addStaticControl('infobox_category', $gL10n->get('SYS_CATEGORY'), $role->getValue('cat_name'));
690-
699+
691700
//Beschreibung
692701
if(strlen($role->getValue('rol_description')) > 0)
693702
{
694703
$form->addStaticControl('infobox_description', $gL10n->get('SYS_DESCRIPTION'), $role->getValue('rol_description'));
695704
}
696-
705+
697706
//Zeitraum
698707
if(strlen($role->getValue('rol_start_date')) > 0)
699708
{
700709
$form->addStaticControl('infobox_period', $gL10n->get('SYS_PERIOD'), $gL10n->get('SYS_DATE_FROM_TO', $role->getValue('rol_start_date', $gPreferences['system_date']), $role->getValue('rol_end_date', $gPreferences['system_date'])));
701710
}
702-
711+
703712
//Termin
704713
if($role->getValue('rol_weekday') > 0 || strlen($role->getValue('rol_start_time')) > 0)
705714
{
@@ -711,28 +720,28 @@
711720
{
712721
$value = $gL10n->get('LST_FROM_TO', $role->getValue('rol_start_time', $gPreferences['system_time']), $role->getValue('rol_end_time', $gPreferences['system_time']));
713722
}
714-
723+
715724
$form->addStaticControl('infobox_date', $gL10n->get('DAT_DATE'), $value);
716725
}
717-
726+
718727
//Treffpunkt
719728
if(strlen($role->getValue('rol_location')) > 0)
720729
{
721730
$form->addStaticControl('infobox_location', $gL10n->get('SYS_LOCATION'), $role->getValue('rol_location'));
722731
}
723-
732+
724733
//Beitrag
725734
if(strlen($role->getValue('rol_cost')) > 0)
726735
{
727736
$form->addStaticControl('infobox_contribution', $gL10n->get('SYS_CONTRIBUTION'), $role->getValue('rol_cost'). ' '.$gPreferences['system_currency']);
728737
}
729-
738+
730739
//Beitragszeitraum
731740
if(strlen($role->getValue('rol_cost_period')) > 0 && $role->getValue('rol_cost_period') != 0)
732741
{
733742
$form->addStaticControl('infobox_contribution_period', $gL10n->get('SYS_CONTRIBUTION_PERIOD'), $role->getCostPeriods($role->getValue('rol_cost_period')));
734743
}
735-
744+
736745
//maximale Teilnehmerzahl
737746
if(strlen($role->getValue('rol_max_members')) > 0)
738747
{
@@ -742,12 +751,12 @@
742751
$htmlBox .= '</div>
743752
</div>';
744753
} // end of infobox
745-
754+
746755
$page->addHtml($htmlBox);
747756
}
748-
757+
749758
// show complete html page
750759
$page->show();
751760
}
752761

753-
?>
762+
?>

0 commit comments

Comments
 (0)