diff options
Diffstat (limited to 'mayor-orig/www/include/modules/naplo/share')
-rw-r--r-- | mayor-orig/www/include/modules/naplo/share/ora.php | 2 | ||||
-rw-r--r-- | mayor-orig/www/include/modules/naplo/share/terem.php | 14 |
2 files changed, 12 insertions, 4 deletions
diff --git a/mayor-orig/www/include/modules/naplo/share/ora.php b/mayor-orig/www/include/modules/naplo/share/ora.php index 40b2650d..b41bc7b8 100644 --- a/mayor-orig/www/include/modules/naplo/share/ora.php +++ b/mayor-orig/www/include/modules/naplo/share/ora.php @@ -15,6 +15,7 @@ kit, ora.tankorId AS tankorId, teremId, + ".__INTEZMENYDBNEV.".terem.leiras AS teremLeiras, ora.leiras AS leiras, ora.tipus AS tipus, eredet, @@ -28,6 +29,7 @@ LEFT JOIN ".__INTEZMENYDBNEV.".tanar AS t1 ON ki=t1.tanarId LEFT JOIN ".__INTEZMENYDBNEV.".tanar AS t2 ON kit=t2.tanarId LEFT JOIN ".__INTEZMENYDBNEV.".feladatTipus USING (feladatTipusId) + LEFT JOIN ".__INTEZMENYDBNEV.".terem USING (teremId) WHERE oraId=%u AND (tanev=%u OR feladatTipusId IS NOT NULL)"; $v = array(tanevDbNev(__INTEZMENY, $tanev), $oraId, $tanev); return db_query($q, array('fv' => 'getOraAdatById', 'modul' => 'naplo_intezmeny', 'result' => 'record', 'values' => $v), $olr); diff --git a/mayor-orig/www/include/modules/naplo/share/terem.php b/mayor-orig/www/include/modules/naplo/share/terem.php index 954f5fbe..0c00c89a 100644 --- a/mayor-orig/www/include/modules/naplo/share/terem.php +++ b/mayor-orig/www/include/modules/naplo/share/terem.php @@ -124,19 +124,25 @@ if (is_array($ADAT['foglaltTermek'][ $ADAT['teremId'] ])) { $return = $ADAT['foglaltTermek'][ $ADAT['teremId'] ]['tanarId']; // A foglalt terem felszabadítása - $q = "UPDATE `%s`.orarendiOra SET teremId=NULL WHERE tolDt<='%s' AND '%s'<=igDt AND het=%u AND nap=%u AND ora=%u AND teremId=%u"; + $q = "UPDATE `%s`.orarendiOra SET teremId=NULL WHERE tolDt<='%s' AND ('%s'<=igDt OR igDt IS NULL) AND het=%u AND nap=%u AND ora=%u AND teremId=%u"; $v = array($tanevDb, $dt, $dt, $ADAT['het'], $ADAT['nap'], $ADAT['ora'], $ADAT['teremId']); db_query($q, array('fv' => 'teremModositas/foglalt terem felszabadítása', 'modul' => 'naplo', 'values' => $v)); } // teremhozzárendelés módosítása if ($ADAT['teremId']>0) { - $q = "UPDATE `%s`.orarendiOra SET teremId=%u WHERE tolDt <= '%s' AND '%s' <= igDt AND het=%u AND nap=%u AND ora=%u AND tanarId=%u"; + $q = "UPDATE `%s`.orarendiOra SET teremId=%u WHERE tolDt <= '%s' AND ('%s' <= igDt OR igDt IS NULL) AND het=%u AND nap=%u AND ora=%u AND tanarId=%u"; $v = array($tanevDb, $ADAT['teremId'], $dt, $dt, $ADAT['het'], $ADAT['nap'], $ADAT['ora'], $ADAT['tanarId']); } else { - $q = "UPDATE `%s`.orarendiOra SET teremId=NULL WHERE tolDt <= '%s' AND '%s' <= igDt AND het=%u AND nap=%u AND ora=%u AND tanarId=%u AND teremId IS NOT NULL"; + $q = "UPDATE `%s`.orarendiOra SET teremId=NULL WHERE tolDt <= '%s' AND ('%s' <= igDt OR igDt IS NULL) AND het=%u AND nap=%u AND ora=%u AND tanarId=%u AND teremId IS NOT NULL"; $v = array($tanevDb, $dt, $dt, $ADAT['het'], $ADAT['nap'], $ADAT['ora'], $ADAT['tanarId']); } - db_query($q, array('debug'=>true,'fv' => 'teremModositas/foglalt terem felszabadítása', 'modul' => 'naplo', 'values' => $v)); + db_query($q, array('debug'=>false,'fv' => 'teremModositas/foglalt terem felszabadítása', 'modul' => 'naplo', 'values' => $v)); + + if (MAYOR_SOCIAL === true && $ADAT['oraId']>0) { + $q = "UPDATE ora SET teremId = NULL WHERE ora=%u AND oraId=%u"; + $v = array($ADAT['ora'], $ADAT['oraId']); + db_query($q, array('fv' => 'teremModositas/foglalt terem felszabadítása', 'modul' => 'naplo', 'values' => $v)); + } return $return; |