Compare commits

...

6 commits

Author SHA1 Message Date
alpcentaur
387f45588f Update README.md
added two steps
2022-08-29 22:07:21 +02:00
alpcentaur
ef7981af75 update form.php
added a line to do not have double header access, and changed echo variable syntax, more stable on multiple os
2022-08-29 22:02:24 +02:00
alpcentaur
9090b41c9e update index.php
added the assigning of php to js variables
2022-08-29 22:00:30 +02:00
alpcentaur
81a3640362 update kaform.js
added all the js related variables assigned to php variables of the locale.yaml file
2022-08-29 21:57:59 +02:00
alpcentaur
d906a8e539 Update locale.yaml
added the javascript related variables
2022-08-29 21:56:24 +02:00
alpcentaur
e8a6174b1a yaml en translation with double point within apostrophs to make it work - and no print of lang on website 2022-08-17 11:19:40 +00:00
8 changed files with 133 additions and 71 deletions

Binary file not shown.

Binary file not shown.

View file

@ -1,8 +1,8 @@
# Kostenerstattungsformular
## INSTALL
## INSTALL it
Install the following programs and PHP modules:
Install the following programs and PHP (7.4) modules:
* pdftk
* php-session
@ -11,7 +11,12 @@ Install the following programs and PHP modules:
* php-ctype
* php-filter
* php-fileinfo
* ImageMagick
Copy **config.sample.php** to **config.php**, and edit **config.php** to your needs.
Within config.php you'll have to state where the pdftk and (ImageMagick-)convert binaries are situated on the system.
Configure the php.ini according to php-production.ini.
Then you are ready to go.
Tha's it.

View file

@ -1,9 +1,9 @@
<h1>
<?php echo _($localeYaml['mainheader'][$loc])?>
<?php echo $localeYaml['mainheader'][$loc]?>
</h1>
<p>
<?php echo _($localeYaml['mainheader_subtext_1'][$loc])?><BR>
<?php echo _($localeYaml['mainheader_subtext_2'][$loc])?><BR><BR>
<?php echo $localeYaml['mainheader_subtext_1'][$loc]?><BR>
<?php echo $localeYaml['mainheader_subtext_2'][$loc]?><BR><BR>
<?php
$ct = @file_get_contents( "./locale/$loc/h1.php");
if ($ct==false)
@ -16,42 +16,40 @@
<form data-kube="kaform" name="theform" id="theform" action="submit.php" method="POST">
<fieldset> <legend><?php echo _($localeYaml['form_1_header'][$loc])?></legend>
<fieldset> <legend><?php echo $localeYaml['form_1_header'][$loc]?></legend>
<div class="is-row">
<div class="is-col">
<input required type="input"
size="32" id="projectid" name="project"
placeholder="<?php echo _($localeYaml['form_1_placeholder_1'][$loc])?>" />
placeholder="<?php echo $localeYaml['form_1_placeholder_1'][$loc]?>" />
</div>
</div>
<div class="is-row">
<div class="is-row">
<div class="is-col">
<input required type="input" size="32"
` id="realname" name="realname" placeholder="<?php echo _($localeYaml['form_1_placeholder_2'][$loc])?>" />
` id="realname" name="realname" placeholder="<?php echo $localeYaml['form_1_placeholder_2'][$loc]?>" />
</div>
<div class="is-col">
<input type="input" size="32"
` id="wmdecontact" name="wmdecontact"
placeholder="<?= _($localeYaml['form_1_placeholder_3'][$loc])?>" />
placeholder="<?= $localeYaml['form_1_placeholder_3'][$loc]?>" />
</div>
</div>
<div class="is-row">
<div class="is-col">
<input type="tel" size="32"
id="phone" name="phone"
placeholder="<?= _($localeYaml['form_1_placeholder_4'][$loc])?>" />
placeholder="<?= $localeYaml['form_1_placeholder_4'][$loc]?>" />
</div>
<div class="is-col">
</div>
</div>
<div class="is-row">
<div class="is-col">
<input required type="email" size="32" id="email"
name="email" placeholder="<?= _($localeYaml['form_1_placeholder_5'][$loc])?>" />
name="email" placeholder="<?= $localeYaml['form_1_placeholder_5'][$loc]?>" />
</div>
<div class="is-col">
</div>
@ -61,14 +59,14 @@
<div class="is-col">
<nav class="tabs" data-kube="tabs" data-equal="false">
<a href="#bank-eu" class="is-active"><?=_($localeYaml['form_1_SEPA'][$loc])?></a>
<a href="#bank-noneu"><?=_($localeYaml['form_1_noSEPA'][$loc])?></a>
<a href="#bank-eu" class="is-active"><?=$localeYaml['form_1_SEPA'][$loc]?></a>
<a href="#bank-noneu"><?=$localeYaml['form_1_noSEPA'][$loc]?></a>
</nav>
<section id="bank-eu">
<div class="is-row">
<div class="is-col">
<input type="input" size="32" name="sepa_owner" placeholder="<?=_($localeYaml['form_1_SEPA_placeholder_1'][$loc])?>" />
<input type="input" size="32" name="sepa_owner" placeholder="<?=$localeYaml['form_1_SEPA_placeholder_1'][$loc]?>" />
</div>
<div class="is-col">
</div>
@ -76,14 +74,14 @@
<div class="is-row">
<div class="is-col">
<input type="input" size="32" id="iban" name="iban" placeholder="<?=_($localeYaml['form_1_SEPA_placeholder_2'][$loc])?>" />
<input type="input" size="32" id="iban" name="iban" placeholder="<?=$localeYaml['form_1_SEPA_placeholder_2'][$loc]?>" />
</div>
<div class="is-col">
<input type="input" size="32" id="bic" name="bic" placeholder="<?=_($localeYaml['form_1_SEPA_placeholder_3'][$loc])?>" />
<input type="input" size="32" id="bic" name="bic" placeholder="<?=$localeYaml['form_1_SEPA_placeholder_3'][$loc]?>" />
</div>
</div>
<textarea id="comments" name="comments" style="resize:none;" cols="32" rows="4"
placeholder="<?=_($localeYaml['form_1_SEPA_placeholder_4'][$loc])?>"></textarea >
placeholder="<?=$localeYaml['form_1_SEPA_placeholder_4'][$loc]?>"></textarea >
</section>
@ -91,35 +89,35 @@
<section id="bank-noneu">
<div class="is-row">
<div class="is-col">
<input type="input" size="32" name="non_sepa_owner" placeholder="<?=_($localeYaml['form_1_noSEPA_placeholder_1'][$loc])?>" />
<input type="input" size="32" name="non_sepa_owner" placeholder="<?=$localeYaml['form_1_noSEPA_placeholder_1'][$loc]?>" />
</div>
<div class="is-col">
<input type="input" size="32" id="n_bic" name="n_bic" placeholder="<?=_($localeYaml['form_1_noSEPA_placeholder_2'][$loc])?>" />
<input type="input" size="32" id="n_bic" name="n_bic" placeholder="<?=$localeYaml['form_1_noSEPA_placeholder_2'][$loc]?>" />
</div>
</div>
<div class="is-row">
<div class="is-col">
<input type="input" size="32" id="n_iban" name="n_iban" placeholder="<?=_($localeYaml['form_1_noSEPA_placeholder_3'][$loc])?>" />
<input type="input" size="32" id="n_iban" name="n_iban" placeholder="<?=$localeYaml['form_1_noSEPA_placeholder_3'][$loc]?>" />
</div>
<div class="is-col">
<input type="input" size="32" id="n_routing" name="n_routing" placeholder="<?=_($localeYaml['form_1_noSEPA_placeholder_4'][$loc])?>" />
<input type="input" size="32" id="n_routing" name="n_routing" placeholder="<?=$localeYaml['form_1_noSEPA_placeholder_4'][$loc]?>" />
</div>
</div>
<input class="EU nonEU" type="input" size="32" id="n_bank" name="n_bankname" placeholder="<?=$localeYaml['form_1_noSEPA_placeholder_5'][$loc]?>" />
<textarea class="nonEU" name="n_bankaddress" id="n_bankaddress" style="resize:both;" cols="32" rows="4"
placeholder="<?=_($localeYaml['form_1_noSEPA_placeholder_6'][$loc])?>"></textarea>
placeholder="<?=$localeYaml['form_1_noSEPA_placeholder_6'][$loc]?>"></textarea>
<br>
<textarea name="n_address" lang="de" class="nonEU" id="n_address" style="resize:both;" cols="32" rows="4"
placeholder="<?=_($localeYaml['form_1_noSEPA_placeholder_7'][$loc])?>"></textarea>
placeholder="<?=$localeYaml['form_1_noSEPA_placeholder_7'][$loc]?>"></textarea>
<br>
<textarea id="n_comments" name="n_comments"
style="resize:both;" cols="32" rows="4"
placeholder="<?=_($localeYaml['form_1_noSEPA_placeholder_8'][$loc])?>"></textarea>
placeholder="<?=$localeYaml['form_1_noSEPA_placeholder_8'][$loc]?>"></textarea>
</section>
@ -129,10 +127,10 @@
</fieldset>
<fieldset id="fieldset2"> <legend><?=_($localeYaml['form_2_header'][$loc])?></legend>
<fieldset id="fieldset2"> <legend><?=$localeYaml['form_2_header'][$loc]?></legend>
<div class="is-row">
<div class="is-col">
<?=_($localeYaml['form_2_currency'][$loc])?>
<?=$localeYaml['form_2_currency'][$loc]?>
</div>
<div class="is-col">
<select onchange="renumberTableRows()" name='currency' id="currency" >
@ -149,13 +147,13 @@
<table id="tabtab" class="is-responsive is-bordered is-striped">
<thead>
<tr>
<th><?=_($localeYaml['form_2_table_1'][$loc])?></th>
<th><?=_($localeYaml['form_2_table_2'][$loc])?></th>
<th><?=_($localeYaml['form_2_table_3'][$loc])?></th>
<th><?=_($localeYaml['form_2_table_4'][$loc])?></th>
<th><?=_($localeYaml['form_2_table_5'][$loc])?></th>
<th><?=_($localeYaml['form_2_table_6'][$loc])?></th>
<th><?=_($localeYaml['form_2_table_7'][$loc])?></th>
<th><?=$localeYaml['form_2_table_1'][$loc]?></th>
<th><?=$localeYaml['form_2_table_2'][$loc]?></th>
<th><?=$localeYaml['form_2_table_3'][$loc]?></th>
<th><?=$localeYaml['form_2_table_4'][$loc]?></th>
<th><?=$localeYaml['form_2_table_5'][$loc]?></th>
<th><?=$localeYaml['form_2_table_6'][$loc]?></th>
<th><?=$localeYaml['form_2_table_7'][$loc]?></th>
</tr>
</thead>
<tbody id="tabbody">
@ -163,15 +161,15 @@
</table>
<div class="is-col">
<button id="add_issue" type="button" onclick="addRow();"
class="button is-green"><?=_($localeYaml['form_2_button'][$loc])?></button>
class="button is-green"><?=$localeYaml['form_2_button'][$loc]?></button>
</div>
</fieldset>
<br>
<fieldset> <legend><?=_($localeYaml['form_3_header'][$loc])?></legend>
<fieldset> <legend><?=$localeYaml['form_3_header'][$loc]?></legend>
<div class="is-row">
<div class="is-col valign="center"">
<?=_($localeYaml['form_3_subtext_1'][$loc])?>
<?=$localeYaml['form_3_subtext_1'][$loc]?>
</div>
<div class="is-col">
<input input name="advance" id="advance" type="text" placeholder="0,00 EUR"/>
@ -180,7 +178,7 @@
<div class="is-row">
<div class="is-col valign="center"">
<?=_($localeYaml['form_3_subtext_2'][$loc])?>*
<?=$localeYaml['form_3_subtext_2'][$loc]?>*
</div>
<div class="is-col">
<input id="agree" type="checkbox" />
@ -190,12 +188,12 @@
<div class="is-row">
<div class="is-col">
<button type="button" onclick="downloadDocument(false);"
class="button is-orange"><?=_($localeYaml['form_3_button_1'][$loc])?></button>
class="button is-orange"><?=$localeYaml['form_3_button_1'][$loc]?></button>
</div>
<div class="is-col">
<button type="button" onclick="downloadDocument(true);"
class="button is-green"><?=_($localeYaml['form_3_button_2'][$loc])?></button>
class="button is-green"><?=$localeYaml['form_3_button_2'][$loc]?></button>
</div>
</div>
@ -210,4 +208,3 @@
</form>
<?php

View file

@ -34,7 +34,7 @@
$loc = "de-DE";
//$loc = "en-US";
print "$loc $loc1";
//print "$loc $loc1";
$domain = "messages";
setlocale(LC_MESSAGES, $loc);
@ -42,7 +42,10 @@
$results = putenv("LC_ALL=$loc");
$results = putenv("LC_MESSAGES=$loc");
$results = bindtextdomain($domain,"./locale");
//$results = bindtextdomain($domain,"./locale");
?>
<html >
<head>
@ -88,18 +91,37 @@
</div>
</div>
<?php echo _($localeYaml['impressum'][$loc])?>: <a href="https://www.wikimedia.de/impressum/">https://www.wikimedia.de/impressum</a><br>
<?php echo _($localeYaml['privacy'][$loc])?>: <a href="https://www.wikimedia.de/datenschutz/">https://www.wikimedia.de/datenschutz</a>
<?php echo $localeYaml['impressum'][$loc]?>: <a href="https://www.wikimedia.de/impressum/">https://www.wikimedia.de/impressum</a><br>
<?php echo $localeYaml['privacy'][$loc]?>: <a href="https://www.wikimedia.de/datenschutz/">https://www.wikimedia.de/datenschutz</a>
</div>
</div>
<script src="js/kube.min.js"></script>
<script src="kaform.js"></script>
<script src="addons/upload/kube.upload.min.js"></script>
<script src="addons/kube-addons.min.js"></script>
<script src="kaform.js"></script>
<script src="iban.js/iban.js"></script>
<script>
error_alert_projectid = "<?php echo $localeYaml['error_alert_projectid'][$loc]?>";
error_alert_realname = "<?php echo $localeYaml['error_alert_realname'][$loc]?>";
error_alert_email = "<?php echo $localeYaml['error_alert_email'][$loc]?>";
error_alert_iban = "<?php echo $localeYaml['error_alert_iban'][$loc]?>";
error_alert_bic = "<?php echo $localeYaml['error_alert_bic'][$loc]?>";
error_alert_paypal = "<?php echo $localeYaml['error_alert_paypal'][$loc]?>";
error_alert_expenses = "<?php echo $localeYaml['error_alert_expenses'][$loc]?>";
error_alert_agreement = "<?php echo $localeYaml['error_alert_agreement'][$loc]?>";
error_alert_ismailable = "<?php echo $localeYaml['error_alert_ismailable'][$loc]?>";
error_alert_date = "<?php echo $localeYaml['error_alert_date'][$loc]?>";
error_alert_description = "<?php echo $localeYaml['error_alert_description'][$loc]?>";
error_alert_sum = "<?php echo $localeYaml['error_alert_sum'][$loc]?>";
expenses_table_description_placeholder = "<?php echo $localeYaml['expenses_table_description_placeholder'][$loc]?>";
expenses_table_file_placeholder = "<?php echo $localeYaml['expenses_table_file_placeholder'][$loc]?>";
</script>
</body>
</html>

View file

@ -1,4 +1,3 @@
var currentRowId=1;
var banktype = "bank-eu";
@ -23,7 +22,7 @@ function checkAllRows(){
var v =row.cells[f].firstElementChild.value;
if ( !v ){ // Datum
row.cells[f].firstElementChild.focus();
showAlert("Bitte gib ein g&uuml;ltiges Datum an!");
showAlert(error_alert_date);
return false;
}
@ -32,7 +31,7 @@ function checkAllRows(){
v =row.cells[f].firstElementChild.value;
if ( !v ){ // Datum
row.cells[f].firstElementChild.focus();
showAlert("Bitte gib ein Beschreibung ein!");
showAlert(error_alert_description);
return false;
}
@ -41,7 +40,7 @@ function checkAllRows(){
v =row.cells[f].firstElementChild.value;
if ( !isFloat(v) ){ // Amount
row.cells[f].firstElementChild.focus();
showAlert("Bitte gib einen g&uuml;ltigen Betrag ein!");
showAlert(error_alert_sum);
return false;
}
@ -148,7 +147,7 @@ function getUploadField(rid)
data-url="upload.php?row=${rid}" data-url-remove="delete.php"
data-progress="true"
data-size="40"
data-placeholder="Datei">
data-placeholder="` + expenses_table_file_placeholder + `">
</div>
<div id="upload-target${rid}" class="upload-target small"></div>
</div>
@ -168,7 +167,7 @@ function getRow(rid,num) {
+ `<input class="tab_input" name="date[${rid}]" value="" type="date" placeholder="Datum*"/>`
+ "</td>"
+ "<td data-label=\"Beschr.\">"
+ `<input class="tab_input" name="desc[${rid}]" type="text" placeholder="Beschreibung"/>`
+ `<input class="tab_input" name="desc[${rid}]" type="text" placeholder=` + expenses_table_description_placeholder + `/>`
+ "</td>"
+ "<td data-label=\"Betrag\">"
+ `<input class="tab_input" name="amount[${rid}] type="text" placeholder="0.00"/>`
@ -293,25 +292,25 @@ function downloadDocument(mail)
return;
if (!check_field("projectid", "Bitte gib einen Projektnamen/Zweck der Reise an!"))
if (!check_field("projectid", error_alert_projectid))
return;
if (!check_field("realname", "Bitte gib deinen Realnamen an!"))
if (!check_field("realname", error_alert_realname))
return;
if (!check_field("email", "Bitte gib deinen E-Mail-Adresse an!"))
if (!check_field("email", error_alert_email))
return;
if (banktype == "bank-eu"){
iban = document.getElementById('iban');
if (!IBAN.isValid(iban.value)){
document.getElementById("iban").focus();
showAlert("Bitte gib eine korrekte IBAN ein!");
showAlert(error_alert_iban);
return;
}
/* if (!document.getElementById('bic').value.trim().length){
document.getElementById("bic").focus();
showAlert("Bitte gib einen korrekte BIC an!");
showAlert(error_alert_bic);
return;
}
@ -322,7 +321,7 @@ function downloadDocument(mail)
ii = document.getElementById('paypal');
if (!document.getElementById('paypal').value.trim().length){
document.getElementById("paypal").focus();
showAlert("Bitte gib einen PayPal Account an!");
showAlert(error_alert_paypal);
return;
}
}
@ -330,20 +329,20 @@ function downloadDocument(mail)
if (countRows()==0){
document.getElementById("add_issue").focus();
showAlert("Bitte f&uuml;ge mind. eine Auslage hinzu!");
showAlert(error_alert_expenses);
return;
}
if (!document.getElementById("agree").checked){
document.getElementById("agree").focus();
showAlert("Bitte best&auml;tige, dass du alle Angaben nach bestem Wissen und Gewissen gemacht hast!");
showAlert(error_alert_agreement);
return;
};
if (mail){
if (!isMailable()){
showAlert("Um den Antrag elektronisch direkt an WMDE zu schicken, muss jeder Position ein Beleg beigef&uuml;gt sein.");
showAlert(error_alert_ismailable);
return;
}
@ -388,5 +387,3 @@ function checkIban()
}
*/

View file

@ -143,20 +143,61 @@ form_3_header:
en-US: 3. Advance payment and other
form_3_subtext_1:
de-DE: 'Ich habe bereits einen Vorschuss erhalten in H&ouml;he von:'
en-US: I have already received an advance in the amount of:
en-US: 'I have already received an advance in the amount of:'
form_3_subtext_2:
de-DE: 'Hiermit bestätige ich die Vollständig- und Richtigkeit meiner Angaben:'
en-US: Herewith I confirm the completeness and correctness of my data:
en-US: 'Herewith I confirm the completeness and correctness of my data:'
form_3_button_1:
de-DE: Antrag herunterladen und später einreichen
en-US: Download reimbursement claim and submit later
form_3_button_2:
de-DE: Antrag elektronisch direkt an WMDE schicken
en-US: Send reimbursement claim electronically directly to WMDE
error_alert_projectid:
de-DE: Bitte gib einen Projektnamen/ Grund der Reise an!
en-US: Please enter a project name / reason of travel!
error_alert_realname:
de-DE: Bitte gib deinen Realnamen an!
en-US: Please enter your realname!
error_alert_email:
de-DE: Bitte gib deine E-mail-Adresse an!
en-US: Please enter a valid email address!
error_alert_iban:
de-DE: Bitte gib eine korrekte IBAN ein!
en-US: Please enter a correct IBAN!
error_alert_bic:
de-DE: Bitte gib eine korrekte BIC an!
en-US: Please enter a correct BIC!
error_alert_paypal:
de-DE: Bitte gib einen PayPal Account an!
en-US: Please enter your PayPal account!
error_alert_expenses:
de-DE: Bitte füge mindestens eine Auslage hinzu!
en-US: Please add at least one expense!
error_alert_agreement:
de-DE: Bitte best&auml;tige, dass du alle Angaben nach bestem Wissen und Gewissen gemacht hast!
en-US: Please confirm that you have provided all information to the best of your knowledge and belief!
error_alert_ismailable:
de-DE: Um den Antrag elektronisch direkt an WMDE zu schicken, muss jeder Position ein Beleg beigef&uuml;gt sein.
en-US: To submit the application electronically directly to WMDE, a receipt must be attached to each line item.
error_alert_date:
de-DE: Bitte gib ein gültiges Datum an!
en-US: Please enter a valid date!
error_alert_description:
de-DE: Bitte gib eine Beschreibung ein!
en-US: Please enter a description!
error_alert_sum:
de-DE: Bitte gib einen gültigen Betrag ein!
en-US: Please enter a valid sum!
expenses_table_description_placeholder:
de-DE: Beschreibung
en-US: Description
expenses_table_file_placeholder:
de-DE: Datei
en-US: File
impressum:
de-DE: Impressum
en-US: Imprint
privacy:
de-DE: Datenschutz
en-US: Data Protection