summaryrefslogtreecommitdiff
path: root/includes/model/Room_model.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2019-12-08 11:48:58 +0100
committerGitHub <noreply@github.com>2019-12-08 11:48:58 +0100
commita3a938a1210f1bfb2680c25b2bcf53e47444bdba (patch)
treefd4c13fd9b714c0d8c60b6d3fe3e2fc88b82b717 /includes/model/Room_model.php
parentb540ac93856065ce6e145930b6611e0a0946d646 (diff)
parent064a1750279be244f86cf24f29749b391b11f1dd (diff)
Merge pull request #685 from MyIgel/schedule-import
Rebuild Schedule import
Diffstat (limited to 'includes/model/Room_model.php')
-rw-r--r--includes/model/Room_model.php30
1 files changed, 5 insertions, 25 deletions
diff --git a/includes/model/Room_model.php b/includes/model/Room_model.php
index b29f68fe..f9eaf31d 100644
--- a/includes/model/Room_model.php
+++ b/includes/model/Room_model.php
@@ -62,35 +62,20 @@ function Room_delete($room_id)
}
/**
- * Delete a room by its name
- *
- * @param string $name
- */
-function Room_delete_by_name($name)
-{
- DB::delete('DELETE FROM `Room` WHERE `Name` = ?', [
- $name
- ]);
- engelsystem_log('Room deleted: ' . $name);
-}
-
-/**
* Create a new room
*
* @param string $name Name of the room
- * @param boolean $from_frab Is this a frab imported room?
* @param string $map_url URL to a map tha can be displayed in an iframe
* @param string description Markdown description
* @return false|int
*/
-function Room_create($name, $from_frab, $map_url, $description)
+function Room_create($name, $map_url, $description)
{
DB::insert('
- INSERT INTO `Room` (`Name`, `from_frab`, `map_url`, `description`)
- VALUES (?, ?, ?, ?)
+ INSERT INTO `Room` (`Name`, `map_url`, `description`)
+ VALUES (?, ?, ?)
', [
$name,
- (int)$from_frab,
$map_url,
$description
]);
@@ -98,7 +83,6 @@ function Room_create($name, $from_frab, $map_url, $description)
engelsystem_log(
'Room created: ' . $name
- . ', frab import: ' . ($from_frab ? 'Yes' : '')
. ', map_url: ' . $map_url
. ', description: ' . $description
);
@@ -107,28 +91,25 @@ function Room_create($name, $from_frab, $map_url, $description)
}
/**
- * update a room
+ * Update a room
*
* @param int $room_id The rooms id
* @param string $name Name of the room
- * @param boolean $from_frab Is this a frab imported room?
* @param string $map_url URL to a map tha can be displayed in an iframe
* @param string $description Markdown description
* @return int
*/
-function Room_update($room_id, $name, $from_frab, $map_url, $description)
+function Room_update($room_id, $name, $map_url, $description)
{
$result = DB::update('
UPDATE `Room`
SET
`Name`=?,
- `from_frab`=?,
`map_url`=?,
`description`=?
WHERE `RID`=?
LIMIT 1', [
$name,
- (int)$from_frab,
$map_url,
$description,
$room_id
@@ -136,7 +117,6 @@ function Room_update($room_id, $name, $from_frab, $map_url, $description)
engelsystem_log(
'Room updated: ' . $name .
- ', frab import: ' . ($from_frab ? 'Yes' : '') .
', map_url: ' . $map_url .
', description: ' . $description
);