aboutsummaryrefslogtreecommitdiff
path: root/lib/models/resources
diff options
context:
space:
mode:
authorElmar Ludwig <elmar.ludwig@uni-osnabrueck.de>2022-11-15 09:58:43 +0000
committerElmar Ludwig <elmar.ludwig@uni-osnabrueck.de>2022-11-15 09:58:43 +0000
commit87027c8a9adc08da482af5bf765e629c2aa8be45 (patch)
tree83ee8af2306e8b9b630a9542b3ffec40b9bbc775 /lib/models/resources
parenta574a5c1b352b6c016cc132c561bebdbe0996f8d (diff)
remove unused column repeat_quantity from table resource_bookings, fixes #1142
Closes #1142 Merge request studip/studip!1158
Diffstat (limited to 'lib/models/resources')
-rw-r--r--lib/models/resources/Resource.class.php4
-rw-r--r--lib/models/resources/ResourceBooking.class.php11
2 files changed, 6 insertions, 9 deletions
diff --git a/lib/models/resources/Resource.class.php b/lib/models/resources/Resource.class.php
index 99d335f..0a04dc5 100644
--- a/lib/models/resources/Resource.class.php
+++ b/lib/models/resources/Resource.class.php
@@ -645,7 +645,7 @@ class Resource extends SimpleORMap implements StudipItem
* DateInterval object.
* In case repetitions are specified by their amount set this
* parameter to null.
- * @param int $repetition_amount
+ * @param int $repetition_amount (obsolete, has no effect)
* @param int $preparation_time The preparation time which is needed before
* the real start time. This will be substracted
* from the begin timestamp and stored in an extra column of the
@@ -841,8 +841,6 @@ class Resource extends SimpleORMap implements StudipItem
} else {
$booking->repeat_end = $repetition_end_date;
}
- } elseif ($repetition_amount) {
- $booking->repeat_quantity = $repetition_amount;
}
$booking->repetition_interval = $repetition_interval->format('P%YY%MM%DD');
diff --git a/lib/models/resources/ResourceBooking.class.php b/lib/models/resources/ResourceBooking.class.php
index a8e65dd..3d8ec28 100644
--- a/lib/models/resources/ResourceBooking.class.php
+++ b/lib/models/resources/ResourceBooking.class.php
@@ -41,7 +41,6 @@
* 3 = planned booking (reservation from external tools)
*
* @property int repeat_end database column
- * @property int repeat_quantity database column
* @property string repetition_interval database column
* The repetition_interval column contains a date interval string in a
* format that is accepted by the DateInterval class constructor.
@@ -469,12 +468,12 @@ class ResourceBooking extends SimpleORMap implements PrivacyObject, Studip\Calen
}
if ($this->repetition_interval) {
- if (!($this->repeat_quantity || $this->repeat_end)) {
+ if (!$this->repeat_end) {
throw new InvalidArgumentException(
_('Es wurde ein Wiederholungsintervall ohne Begrenzung angegeben!')
);
}
- if ((!$this->repeat_quantity) && ($this->real_begin > $this->repeat_end)) {
+ if ($this->real_begin > $this->repeat_end) {
throw new InvalidArgumentException(
_('Der Startzeitpunkt darf nicht hinter dem Ende der Wiederholungen liegen!')
);
@@ -717,12 +716,12 @@ class ResourceBooking extends SimpleORMap implements PrivacyObject, Studip\Calen
if ($this->repetition_interval) {
$repetition_interval = $this->getRepetitionInterval();
- if (!($this->repeat_quantity || $this->repeat_end)) {
+ if (!$this->repeat_end) {
throw new InvalidArgumentException(
_('Es wurde ein Wiederholungsintervall ohne Begrenzung angegeben!')
);
}
- if ((!$this->repeat_quantity) && ($this->real_begin > $this->repeat_end)) {
+ if ($this->real_begin > $this->repeat_end) {
throw new InvalidArgumentException(
_('Der Startzeitpunkt darf nicht hinter dem Ende der Wiederholungen liegen!')
);
@@ -1208,7 +1207,7 @@ class ResourceBooking extends SimpleORMap implements PrivacyObject, Studip\Calen
)
];
- if (($this->repeat_quantity > 0) || $this->repeat_end) {
+ if ($this->repeat_end) {
//Repetition: we must check which repetition interval has been
//selected and then create entries for each repetition.
//Repetition starts with the begin date and ends with the