- bei der warnung buchung vorhanden, name hinzugefuegt

This commit is contained in:
ma0048
2022-11-29 10:17:32 +01:00
parent 37ec8d84e5
commit 381fa2ed7e
3 changed files with 33 additions and 13 deletions
+16
View File
@@ -2499,7 +2499,23 @@ if(!$error)
} }
if($exists) if($exists)
{
$return = true; $return = true;
$zusatz = "\n";
if (count($exists) > 10)
{
$zusatz .= "und ";
$persons = implode("\n- ", array_slice($exists, 0, 10));
if (count($exists) === 11)
$zusatz .= "einer weiteren Person.";
else
$zusatz .= (count($exists) - 10) . " weiteren Personen.";
}
else
$persons = implode("\n- ", $exists);
$data = "Es ist bereits eine Buchung vorhanden:\n- ". $persons . $zusatz ." Trotzdem fortfahren?";
}
else else
$return = false; $return = false;
} }
+3 -3
View File
@@ -3102,9 +3102,9 @@ function StudentKontoNeuSpeichern(dialog, person_ids, studiengang_kz)
{ {
exists = StudentCheckBuchung(person_ids, studiensemester_kurzbz, buchungstyp_kurzbz, studiengang_kz); exists = StudentCheckBuchung(person_ids, studiensemester_kurzbz, buchungstyp_kurzbz, studiengang_kz);
} }
if (exists) if (exists.dbdml_return)
{ {
if(!confirm('Die Buchung ist bereits vorhanden. Trotzdem fortfahren?')) if(!confirm(exists.dbdml_data))
return false; return false;
} }
@@ -3159,7 +3159,7 @@ function StudentCheckBuchung(person_ids, studiensemester_kurzbz, buchungstyp_kur
var val = new ParseReturnValue(response); var val = new ParseReturnValue(response);
return(val.dbdml_return); return val;
} }
// ***** // *****
+14 -10
View File
@@ -967,19 +967,23 @@ class konto extends basis_db
public function checkDoppelteBuchung($person_ids, $stsem, $typ) public function checkDoppelteBuchung($person_ids, $stsem, $typ)
{ {
$qry = "SELECT betrag $qry = "SELECT person.vorname, person.nachname
FROM public.tbl_konto FROM public.tbl_konto konto
WHERE person_id IN (".$this->implode4SQL(array_filter($person_ids)).") JOIN public.tbl_person person USING(person_id)
AND studiensemester_kurzbz = ".$this->db_add_param($stsem)." WHERE konto.person_id IN (".$this->implode4SQL(array_filter($person_ids)).")
AND buchungstyp_kurzbz = ".$this->db_add_param($typ)." AND studiensemester_kurzbz = ".$this->db_add_param($stsem)."
GROUP BY buchungsnr"; AND buchungstyp_kurzbz = ".$this->db_add_param($typ)."
GROUP BY person.vorname, person.nachname
ORDER BY person.nachname, person.vorname";
if ($result = $this->db_query($qry)) if ($result = $this->db_query($qry))
{ {
if ($this->db_num_rows($result) > 0) $persons = array();
return true; while ($row = $this->db_fetch_object($result))
else {
return false; $persons[] = $row->nachname . ' ' . $row->vorname;
}
return $persons;
} }
else else
{ {