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

main
Igor Scheller 8 years ago
commit ec45216899

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

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

@ -266,10 +266,6 @@ function Shift_signup_allowed_angel(
) {
$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) {
$user_shifts = Shifts_by_user($user);
}

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

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

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

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

Loading…
Cancel
Save