update internal forms (#4873)
All checks were successful
continuous-integration/drone/push Build is passing

Reviewed-on: #4873
Co-authored-by: Tobias Diekershoff <tobiasd@fsfe.org>
Co-committed-by: Tobias Diekershoff <tobiasd@fsfe.org>
This commit was merged in pull request #4873.
This commit is contained in:
2025-03-05 14:22:51 +00:00
committed by tobiasd
parent 2d7034b890
commit 40e4d96d2b
3 changed files with 8 additions and 10 deletions

View File

@@ -268,7 +268,7 @@ foreach ($use as $d => $day) { // calculate for each day
foreach ($csv as $fields) {
fputcsv($csvfile, $fields, ';', '"', '"');
}
$email->addAttachment($csvfile_path, filter_filename("perdiem" ."-". $who ."-". $activity_tag ."-". $description . ".csv"));
$email->addAttachment($csvfile_path, filter_filename($date[$d]."-"."pd" ."-". $who ."-". $activity_tag ."-". $description . ".csv"));
// Prepare email body
$email_body = "Hi,

View File

@@ -128,7 +128,6 @@ $html .= "<p>This <strong>$type_verbose</strong> is made by <strong>$who_verbose
<th>Category ID</th>
<th>Category Text</th>
<th>Description</th>
<th></th>
<th>Receipt Name</th>
<th></th>
</tr>";
@@ -170,10 +169,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];
$activity_tag[$key] = explode("||", $activity[$key])[0];
$activity_text[$key] = explode("||", $activity[$key])[1];
$category_id[$key] = explode(":", $category[$key])[0];
$category_text[$key] = explode(":", $category[$key])[1];
// Sanity checks for receipt: upload, size, mime type
if (! $receipt_tmp) {
@@ -189,7 +188,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 ."-". $activity_tag .".". "$receipt_ext");
$receipt_rename = filter_filename($type_date ."-". $type ."-". $who ."-receipt-". $receipt_no ."-". $activity_tag[$key] .".". "$receipt_ext");
$receipt_dest[$key] = "/tmp/" . $receipt_rename;
// Try to move file to temporary destination
@@ -221,7 +220,6 @@ foreach ($entry as $key => $date) { // run over each row
<td></td>
</tr>";
// CSV for this receipt
$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, "");

View File

@@ -145,10 +145,10 @@
<td><input type="date" name="entry[]" class="form-control" required="required" /></td>
<td><input type="text" name="amount[]" class="form-control" pattern="-?\d{0,5},\d{2}" placeholder="12,34" required="required" /></td>
<td><input type="text" name="recipient[]" class="form-control" required="required" /></td>
<td><select class="form-control col-sm-3" name="activity" id="activity" size="1" required="required">
<td><select class="form-control col-sm-3" name="activity[]" id="activity" size="1" required="required">
<module id="fsfe-activities-options" />
</select></td>
<td><select class="form-control col-sm-3" name="category" id="category" size="1">
<td><select class="form-control col-sm-3" name="category[]" id="category" size="1">
<option value="????:Other / I don't know">Other / I don't know</option>
<option value="6815:Office material">Office material</option>
<option value="6710:Packaging material">Packaging material</option>