PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.8.16
VikBooking Hotel Booking Engine & PMS v1.8.16
1.8.16 1.8.15 1.8.14 1.8.13 1.8.12 1.8.11 1.8.10 1.8.9 1.8.6 1.8.7 1.8.8 trunk 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 All 37 releases
← All changes | admin/helpers/availability.php +17 -5 1.8.7 → 1.8.16 View file →
@@ -998,9 +998,9 @@
998 998 return false;
999 999 }
1000 1000
1001 1001 // count injected rooms, if any
1002 - $tot_rooms = count($this->room_ids);
1002 + $tot_rooms = (int) (($params['rooms_count'] ?? 0) ?: count($this->room_ids));
1003 1003
1004 1004 // build options array for TACVBO
1005 1005 $options = [
1006 1006 'hash' => md5('vbo.e4j.vbo'),
@@ -1077,9 +1077,9 @@
1077 1077 }
1078 1078
1079 1079 // optional filter by room IDs will be applied on this flow
1080 1080 $found_rids = array_keys($website_rates);
1081 - $unwanted_rids = $tot_rooms ? array_diff($found_rids, $this->room_ids) : [];
1081 + $unwanted_rids = $this->room_ids ? array_diff($found_rids, $this->room_ids) : [];
1082 1082 foreach ($unwanted_rids as $rid) {
1083 1083 unset($website_rates[$rid]);
1084 1084 }
1085 1085
@@ -1086,8 +1086,20 @@
1086 1086 return $website_rates;
1087 1087 }
1088 1088
1089 1089 /**
1090 + * Returns the fully booked linear array of room IDs.
1091 + *
1092 + * @return array
1093 + *
1094 + * @since 1.18.8 (J) - 1.8.8 (WP)
1095 + */
1096 + public function getFullyBooked()
1097 + {
1098 + return (array) $this->fully_booked;
1099 + }
1100 +
1101 + /**
1090 1102 * Finds the available suggestions in case of no availability previously occurred
1091 1103 * while getting the rates. This method should be called after getRates() so that
1092 1104 * a valid errorCode to be analized will be available, unless code is forced.
1093 1105 * Suggestions can include closest booking dates and/or different room-guest parties.
@@ -1255,9 +1267,9 @@
1255 1267 }
1256 1268 }
1257 1269 }
1258 1270
1259 - if (!count($avroom_nights)) {
1271 + if (!$avroom_nights) {
1260 1272 // no rooms available at all, there's no way to do anything
1261 1273 return [];
1262 1274 }
1263 1275
@@ -1473,9 +1485,9 @@
1473 1485 }
1474 1486
1475 1487 // apply nights/transfers ratio limit (unless disabled)
1476 1488 $nights_transfers_ratio = $this->getNightsTransfersRatio();
1477 - if ($nights_transfers_ratio > 0 && $nights_transfers_ratio < 100) {
1489 + if ($nights_transfers_ratio > 0 && $nights_transfers_ratio <= 100) {
1478 1490 // count and apply limits
1479 1491 foreach ($split_stay_sols as $k => $split_stay_sol) {
1480 1492 // count nights and transfers
1481 1493 $split_stay_transfers = count($split_stay_sol) - 1;
@@ -1495,9 +1507,9 @@
1495 1507 // split stays have been disabled
1496 1508 $split_stay_sols = [];
1497 1509 }
1498 1510
1499 - if ($altered_sols && count($split_stay_sols)) {
1511 + if ($altered_sols && $split_stay_sols) {
1500 1512 // restore the array keys
1501 1513 $split_stay_sols = array_values($split_stay_sols);
1502 1514 }
1503 1515