Subversion Repositories VORC

Rev

Rev 217 | Rev 229 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 217 Rev 218
Line 30... Line 30...
30
sub byfield { $colOrderHash{$a} <=> $colOrderHash{$b}; }
30
sub byfield { $colOrderHash{$a} <=> $colOrderHash{$b}; }
Line 31... Line 31...
31
 
31
 
32
sub exportExcel {
32
sub exportExcel {
33
  my $listref = shift;
33
  my $listref = shift;
-
 
34
  my $FN_Prefix = shift // "VORC_Export";
Line 34... Line 35...
34
  my $FN_Prefix = shift // "VORC_Export";
35
  my $displayFields = shift // "";
Line 35... Line 36...
35
  
36
  
36
  use Spreadsheet::WriteExcel;
37
  use Spreadsheet::WriteExcel;
Line 53... Line 54...
53
  my $format = $workbook->add_format();
54
  my $format = $workbook->add_format();
54
  $format->set_bold();
55
  $format->set_bold();
Line 55... Line 56...
55
  
56
  
Line 56... Line 57...
56
  my $col = $row = 0;
57
  my $col = $row = 0;
57
  
58
  
Line 58... Line 59...
58
  foreach $f (@displayFields)
59
  foreach $f (@$displayFields)
59
    { $worksheet->write($row, $col++, "$NAME{$f}", $format); }
60
    { $worksheet->write($row, $col++, "$NAME{$f}", $format); }
60
  
61
  
61
  foreach $t (sort @{ $listref })     # Unt now we print the tickets!
62
  foreach $t (sort @{ $listref })     # Unt now we print the tickets!
62
  {
63
  {
63
    $col = 0;
64
    $col = 0;
64
    $row++;
65
    $row++;
65
    foreach $f (@displayFields) {
66
    foreach $f (@$displayFields) {
66
      if ($f eq "derby_name") {
67
      if ($f eq "derby_name") {
67
        if ($user->{department}->{"OFF"} < 2 and $t->{derby_name} and $t->{RCid} != $RCid and $LVL < 5) {
68
        if ($user->{department}->{"OFF"} < 2 and $t->{derby_name} and $t->{RCid} != $RCid and $LVL < 5) {
Line 446... Line 447...
446
  my $x = scalar @ProductList; # How many results were returned?
447
  my $x = scalar @ProductList; # How many results were returned?
Line 447... Line 448...
447
  
448
  
448
  # If the user is trying to download the Excel file, send it to them and then exit out.
449
  # If the user is trying to download the Excel file, send it to them and then exit out.
449
  if ($FORM{excel}) {
450
  if ($FORM{excel}) {
450
    (my $filename = $pageTitle) =~ s/\s+/_/g;
451
    (my $filename = $pageTitle) =~ s/\s+/_/g;
451
    exportExcel (\@ProductList, $filename);
452
    exportExcel (\@ProductList, $filename, \@displayFields);
452
    exit;
453
    exit;
Line 453... Line 454...
453
  }
454
  }
454
  
455