Merge branch 'master' of github.com:engelsystem/engelsystem
This commit is contained in:
commit
f199c1f08a
|
@ -39,13 +39,13 @@ function Shift_update($shift) {
|
||||||
* Update a shift by its external id.
|
* Update a shift by its external id.
|
||||||
*/
|
*/
|
||||||
function Shift_update_by_psid($shift) {
|
function Shift_update_by_psid($shift) {
|
||||||
return sql_query("UPDATE `Shifts` SET
|
$shift_source = sql_select("SELECT `SID` FROM `Shifts` WHERE `PSID`=" . $shift['PSID']);
|
||||||
`start`=" . sql_escape($shift['start']) . ",
|
if ($shift_source === false)
|
||||||
`end`=" . sql_escape($shift['end']) . ",
|
return false;
|
||||||
`RID`=" . sql_escape($shift['RID']) . ",
|
if (count($shift_source) == 0)
|
||||||
`name`=" . sql_null($shift['name']) . ",
|
return null;
|
||||||
`URL`=" . sql_null($shift['URL']) . "
|
$shift['SID'] = $shift_source['SID'];
|
||||||
WHERE `PSID`=" . sql_escape($shift['PSID']));
|
return Shift_update($shift);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue