Merge remote-tracking branch 'engelsystem/feature-igel-rewrite'

This commit is contained in:
Igor Scheller 2017-07-19 23:35:20 +02:00
commit ec45216899
7 changed files with 24 additions and 32 deletions

View File

@ -64,7 +64,7 @@ function EventConfig_update(
); );
} }
return (bool)DB::update(' return DB::update('
UPDATE `EventConfig` SET UPDATE `EventConfig` SET
`event_name` = ?, `event_name` = ?,
`buildup_start_date` = ?, `buildup_start_date` = ?,

View File

@ -9,12 +9,6 @@ namespace Engelsystem;
*/ */
class ShiftsFilter class ShiftsFilter
{ {
/**
* How long can the time interval be?
* 86400 = one day
*/
const MAX_DURATION = 86400;
/** /**
* Shift is completely full. * Shift is completely full.
*/ */
@ -98,9 +92,6 @@ class ShiftsFilter
*/ */
public function setEndTime($endTime) public function setEndTime($endTime)
{ {
if ($endTime - $this->startTime > ShiftsFilter::MAX_DURATION) {
$endTime = $this->startTime + ShiftsFilter::MAX_DURATION;
}
$this->endTime = $endTime; $this->endTime = $endTime;
} }

View File

@ -266,10 +266,6 @@ function Shift_signup_allowed_angel(
) { ) {
$free_entries = Shift_free_entries($needed_angeltype, $shift_entries); $free_entries = Shift_free_entries($needed_angeltype, $shift_entries);
if ($user['Gekommen'] == 0) {
return new ShiftSignupState(ShiftSignupState::SHIFT_ENDED, $free_entries);
}
if ($user_shifts == null) { if ($user_shifts == null) {
$user_shifts = Shifts_by_user($user); $user_shifts = Shifts_by_user($user);
} }

View File

@ -16,6 +16,7 @@
<whitelist> <whitelist>
<directory>./include/</directory> <directory>./include/</directory>
<directory>./public/</directory> <directory>./public/</directory>
<directory>./src/</directory>
</whitelist> </whitelist>
</filter> </filter>
<php> <php>

View File

@ -81,31 +81,31 @@ class Db
} }
/** /**
* Run a insert query * Run an insert query
* *
* @param string $query * @param string $query
* @param array $bindings * @param array $bindings
* @return bool * @return int|bool
*/ */
public static function insert($query, array $bindings = []) public static function insert($query, array $bindings = [])
{ {
self::query($query, $bindings); self::query($query, $bindings);
return self::$lastStatus; return (self::$lastStatus ? self::$stm->rowCount() : false);
} }
/** /**
* Run a update query * Run an update query
* *
* @param string $query * @param string $query
* @param array $bindings * @param array $bindings
* @return int|null * @return int|bool
*/ */
public static function update($query, array $bindings = []) public static function update($query, array $bindings = [])
{ {
self::query($query, $bindings); self::query($query, $bindings);
return (self::$lastStatus ? self::$stm->rowCount() : null); return (self::$lastStatus ? self::$stm->rowCount() : false);
} }
/** /**
@ -113,13 +113,13 @@ class Db
* *
* @param string $query * @param string $query
* @param array $bindings * @param array $bindings
* @return int|null * @return int|bool
*/ */
public static function delete($query, array $bindings = []) public static function delete($query, array $bindings = [])
{ {
self::query($query, $bindings); self::query($query, $bindings);
return (self::$lastStatus ? self::$stm->rowCount() : null); return (self::$lastStatus ? self::$stm->rowCount() : false);
} }
/** /**

View File

@ -1,9 +1,11 @@
<?php <?php
namespace Engelsystem\Test; namespace Engelsystem\Test;
class LogEntriesModelTest extends \PHPUnit_Framework_TestCase use \PHPUnit\Framework\TestCase;
class LogEntriesModelTest extends TestCase
{ {
public function create_LogEntry() public function create_LogEntry()
{ {
LogEntry_create('test', 'test'); LogEntry_create('test', 'test');

View File

@ -1,9 +1,11 @@
<?php <?php
namespace Engelsystem\Test; namespace Engelsystem\Test;
class RoomModelTest extends \PHPUnit_Framework_TestCase use \PHPUnit\Framework\TestCase;
class RoomModelTest extends TestCase
{ {
private $room_id = null; private $room_id = null;
public function create_Room() public function create_Room()