[opw-web] Change file naming in the PDF archive to be more informative



commit 00af8a97245f16ea6e95736a2543e2cc72b9a340
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Mon Nov 16 23:48:32 2015 -0500

    Change file naming in the PDF archive to be more informative
    
    Instead of just naming the contact PDF files after usernames, use a
    specific format as requested by the Software Freedom Conservancy.

 modules/mod_contract.php |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/modules/mod_contract.php b/modules/mod_contract.php
index 3d17bd0..8baa57c 100644
--- a/modules/mod_contract.php
+++ b/modules/mod_contract.php
@@ -174,14 +174,15 @@ if ($action == 'edit_student' || $action == 'edit_mentor') {
 
         // Insert into the archive
 
+        // Software Freedom Conservancy wants contract files named in a very specific fashion
         // YYYY-MM-DD_FULL-NAME_Outreachy-2015-05_TYPE-agreement.pdf
-        $file_name = date('Y-M-d', $row['contract_accepted_time']);
+        $file_name = date('Y-m-d', $row['contract_accepted_time']);
         $file_name .= '_';
-        //        $file_name .= preg_replace('/[^a-zA-Z]+/', '-', $row['contract_entered_name']);
-        $file_name .= $row['contract_entered_name'];
+        $file_name .= preg_replace('/[^a-zA-Z]+/', '-', $row['contract_entered_name']);
         $file_name .= '_Outreachy-';
         $file_name .= date('Y-n', $program_data['start_time']);
-        $file_name .= $role_string;
+        $file_name .= '-';
+        $file_name .= strtolower($role_string);
         $file_name .= '-agreement.pdf';
 
         $zipfile->addFromString($folder_name . "/" . $file_name, $pdf->Output('', 'S'));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]