diff --git a/.gitignore b/.gitignore index 911ea7f9a1..4d47e72baa 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ global/data/topbanner/.topbanner.??.xml fsfe.org/search/index.js fsfe.org/tags/tagged-*.en.xhtml fsfe.org/tags/.tags.??.xml +global/data/modules/fsfe-activities-options.en.xml # Local build stuff output diff --git a/fsfe.org/cgi-bin/perdiem.php b/fsfe.org/cgi-bin/perdiem.php index a935f48458..ccbb4777b4 100755 --- a/fsfe.org/cgi-bin/perdiem.php +++ b/fsfe.org/cgi-bin/perdiem.php @@ -22,14 +22,18 @@ require 'PHPMailer/PHPMailer.php'; require 'PHPMailer/SMTP.php'; $html = ''; // create empty variable -$csv = array(array("Employee name", "Date", "Amount (EUR)", "Recipient name", "ER number", "Catchphrase", "Receipt number", "Remarks")); // create array for CSV +$csv = array(array("Employee name", "Date", "Amount (EUR)", "Recipient name", "Activity Tag", "Activity Text", "Category ID", "Category Text", "Description", "Receipt number", "Remarks")); // create array for CSV $csvfile = tmpfile(); $csvfile_path = stream_get_meta_data($csvfile)['uri']; $reimb_total = 0; // total reimbursement for early calculation $who = isset($_POST["who"]) ? $_POST["who"] : false; -$er = isset($_POST["er"]) ? $_POST["er"] : false; -$catch = isset($_POST["catch"]) ? $_POST["catch"] : false; +$activity = isset($_POST["activity"]) ? $_POST["activity"] : false; +$activity_tag = explode(":", $activity)[0]; +$activity_text = explode(":", $activity)[1]; +$category_id = "6664"; +$category_text = "Per diem"; +$description = isset($_POST["description"]) ? $_POST["description"] : false; $extra = isset($_POST["extra"]) ? $_POST["extra"] : false; $mailopt = isset($_POST["mailopt"]) ? $_POST["mailopt"] : false; $defaults = isset($_POST["defaults"]) ? $_POST["defaults"] : false; @@ -135,8 +139,11 @@ $html .= "
This per diem statement is made by $who_verbose.
Extra remarks:
$extra
This $type_verbose is made by $who_verbose
Date
Amount
Recipient
- ER number
- Catchphrase
+ Activity Tag
+ Activity Text
+ Category ID
+ Category Text
+ Description
+
Receipt Name
- Remarks
+
";
// Prepare email
@@ -143,7 +147,8 @@ $email->Port = 25;
//$email->Password = 'fsfe_pass';
//$email->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$email->SetFrom($who . "@fsfe.org", $who_verbose);
-$email->Subject = "$type_verbose for $type_date by $who_verbose";
+$email->CharSet = "UTF-8";
+$email->Subject = "=?UTF-8?B?" . base64_encode("$type_verbose for $type_date by $who_verbose") . "?=";
if ($mailopt === "normal") {
$email->addAddress("finance@lists.fsfe.org");
}
@@ -165,6 +170,10 @@ foreach ($entry as $key => $date) { // run over each row
$receipt_size = $_FILES["receipt"]["size"][$key];
$key1 = $key + 1;
$receipt_no = sprintf('%02d', $key1);
+ $activity_tag[$key] = explode(":", $activity)[0];
+ $activity_text[$key] = explode(":", $activity)[1];
+ $category_id[$key] = explode(":", $category)[0];
+ $category_text[$key] = explode(":", $category)[1];
// Sanity checks for receipt: upload, size, mime type
if (! $receipt_tmp) {
@@ -180,7 +189,7 @@ foreach ($entry as $key => $date) { // run over each row
// Set name and temporary destination for attached receipt
$receipt_ext = pathinfo($receipt_name)['extension'];
- $receipt_rename = filter_filename($type_date ."-". $type ."-". $who ."-receipt-". $receipt_no ."-". $er[$key] .".". "$receipt_ext");
+ $receipt_rename = filter_filename($type_date ."-". $type ."-". $who ."-receipt-". $receipt_no ."-". $activity_tag .".". "$receipt_ext");
$receipt_dest[$key] = "/tmp/" . $receipt_rename;
// Try to move file to temporary destination
@@ -193,8 +202,8 @@ foreach ($entry as $key => $date) { // run over each row
}
// Remove "-" when remark empty
- if ($remarks[$key] === "-") {
- $remarks[$key] = "";
+ if ($description[$key] === "-") {
+ $description[$key] = "";
}
// HTML output for this receipt
@@ -203,14 +212,19 @@ foreach ($entry as $key => $date) { // run over each row
$date
$amount[$key]
$recipient[$key]
- $er[$key]
- $catch[$key]
+ $activity_tag[$key]
+ $activity_text[$key]
+ $category_id[$key]
+ $category_text[$key]
+ $description[$key]
$receipt_name
- $remarks[$key]
+
+
";
+
// CSV for this receipt
- $csv[$receipt_no] = array($who_verbose, $date, $amount[$key], $recipient[$key], $er[$key], $catch[$key], $receipt_no, $remarks[$key]);
+ $csv[$receipt_no] = array($who_verbose, $date, $amount[$key], $recipient[$key], $activity_tag[$key], $activity_text[$key], $category_id[$key], $category_text[$key], $description[$key], "", $receipt_no, "");
// Add receipt as email attachment
$email->addAttachment($receipt_dest[$key], basename($receipt_dest[$key]));
diff --git a/fsfe.org/internal/internal.css b/fsfe.org/internal/internal.css
index 74972b40b5..cfe48c88f9 100644
--- a/fsfe.org/internal/internal.css
+++ b/fsfe.org/internal/internal.css
@@ -38,3 +38,18 @@ input[type="file"] {
label {
font-weight: normal;
}
+
+#category {
+ width: auto !important;
+ padding: inherit !important;
+ background: none !important;
+ margin-top: 0px !important;
+}
+#content input[type="radio"] {
+ margin: 0 0 0 -20px;
+}
+
+#description-help {
+ font-size: 0.8em;
+ color: #616161be;
+}
diff --git a/fsfe.org/internal/pd.en.xhtml b/fsfe.org/internal/pd.en.xhtml
index 386a756196..04b1a51f11 100644
--- a/fsfe.org/internal/pd.en.xhtml
+++ b/fsfe.org/internal/pd.en.xhtml
@@ -1,6 +1,6 @@
-