Skip to content

Commit

Permalink
GH-638 apply billboard in conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
eynimeni committed Oct 24, 2024
1 parent 6ef3c89 commit d15b1d0
Show file tree
Hide file tree
Showing 24 changed files with 115 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,10 @@ public function render_button(
* @return string
*/
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}
global $DB;

if ($isavailable) {
Expand Down
6 changes: 5 additions & 1 deletion classes/bo_availability/conditions/alreadybooked.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,11 @@ public function render_button(
* @param booking_option_settings $settings
* @return string
*/
private function get_description_string($isavailable, $full, $settings) {
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}
if ($isavailable) {
$description = $full ? get_string('bocondalreadybookedfullavailable', 'mod_booking') :
get_string('bocondalreadybookedavailable', 'mod_booking');
Expand Down
6 changes: 5 additions & 1 deletion classes/bo_availability/conditions/alreadyreserved.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,11 @@ public function render_button(
* @param booking_option_settings $settings
* @return string
*/
private function get_description_string($isavailable, $full, $settings) {
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}
if ($isavailable) {
$description = $full ? get_string('bocondalreadyreservedfullavailable', 'mod_booking') :
get_string('bocondalreadyreservedavailable', 'mod_booking');
Expand Down
6 changes: 5 additions & 1 deletion classes/bo_availability/conditions/booking_time.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,11 @@ public function render_button(booking_option_settings $settings,
* @param booking_option_settings $settings
* @return string
*/
private function get_description_string($isavailable, $full, $settings) {
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}
if ($isavailable) {
$description = get_string('bocondbookingtimeavailable', 'mod_booking');
} else {
Expand Down
6 changes: 5 additions & 1 deletion classes/bo_availability/conditions/bookingpolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,11 @@ public function render_button(
* @param booking_option_settings $settings
* @return string
*/
private function get_description_string($isavailable, $full, $settings) {
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}
if ($isavailable) {
$description = $full ? get_string('bocondalreadybookedfullavailable', 'mod_booking') :
get_string('bocondalreadybookedavailable', 'mod_booking');
Expand Down
6 changes: 5 additions & 1 deletion classes/bo_availability/conditions/bookondetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,11 @@ public function render_button(
* @param booking_option_settings $settings
* @return string
*/
private function get_description_string($isavailable, $full, $settings) {
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}
if ($isavailable) {
$description = $full ? get_string('bocondalreadybookedfullavailable', 'mod_booking') :
get_string('bocondalreadybookedavailable', 'mod_booking');
Expand Down
4 changes: 4 additions & 0 deletions classes/bo_availability/conditions/campaign_blockbooking.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ public function render_button(
* @return string
*/
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}
if ($isavailable) {
$description = '';
} else {
Expand Down
6 changes: 5 additions & 1 deletion classes/bo_availability/conditions/customform.php
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,11 @@ public function render_button(booking_option_settings $settings,
* @param booking_option_settings $settings
* @return string
*/
private function get_description_string($isavailable, $full, $settings) {
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}
if ($isavailable) {
$description = $full ? get_string('boconduserprofilefieldfullavailable', 'mod_booking') :
get_string('boconduserprofilefieldavailable', 'mod_booking');
Expand Down
4 changes: 4 additions & 0 deletions classes/bo_availability/conditions/enrolledincohorts.php
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,10 @@ public function render_button(
* @return string
*/
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}
global $DB;

if ($isavailable) {
Expand Down
4 changes: 4 additions & 0 deletions classes/bo_availability/conditions/enrolledincourse.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,10 @@ public function render_button(
* @return string
*/
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}
global $DB;

if ($isavailable) {
Expand Down
6 changes: 5 additions & 1 deletion classes/bo_availability/conditions/fullybooked.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,11 @@ public function render_button(
* @param booking_option_settings $settings
* @return string
*/
private function get_description_string($isavailable, $full, $settings) {
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}
if ($isavailable) {
$description = $full ? get_string('bocondfullybookedfullavailable', 'mod_booking') :
get_string('bocondfullybookedavailable', 'mod_booking');
Expand Down
6 changes: 5 additions & 1 deletion classes/bo_availability/conditions/isbookable.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,11 @@ public function render_button(
* @param booking_option_settings $settings
* @return string
*/
private function get_description_string($isavailable, $full, $settings) {
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}
if ($isavailable) {
$description = $full ? get_string('bocondisbookablefullavailable', 'mod_booking') :
get_string('bocondisbookableavailable', 'mod_booking');
Expand Down
6 changes: 5 additions & 1 deletion classes/bo_availability/conditions/isbookableinstance.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,11 @@ public function render_button(
* @param booking_option_settings $settings
* @return string
*/
private function get_description_string($isavailable, $full, $settings) {
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}
if ($isavailable) {
$description = $full ? get_string('bocondisbookablefullavailable', 'mod_booking') :
get_string('bocondisbookableavailable', 'mod_booking');
Expand Down
6 changes: 5 additions & 1 deletion classes/bo_availability/conditions/iscancelled.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ public function render_button(
* @param booking_option_settings $settings
* @return string
*/
private function get_description_string($isavailable, $full, $settings) {
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}
if ($isavailable) {
$description = $full ? get_string('bocondiscancelledfullavailable', 'mod_booking') :
get_string('bocondiscancelledavailable', 'mod_booking');
Expand Down
6 changes: 5 additions & 1 deletion classes/bo_availability/conditions/isloggedin.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,11 @@ public function render_button(
* @param booking_option_settings $settings
* @return string
*/
private function get_description_string($isavailable, $full, $settings) {
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}
if ($isavailable) {
$description = $full ? get_string('bocondisloggedinfullavailable', 'mod_booking') :
get_string('bocondisloggedinavailable', 'mod_booking');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,11 @@ public function render_button(
* @param booking_option_settings $settings
* @return string
*/
private function get_description_string($isavailable, $full, $settings) {
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}
if ($isavailable) {
$description = $full ? get_string('bocondmaxnumberofbookingsfullavailable', 'mod_booking') :
get_string('bocondmaxnumberofbookingsavailable', 'mod_booking');
Expand Down
6 changes: 5 additions & 1 deletion classes/bo_availability/conditions/notifymelist.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,11 @@ public function render_button(
* @param booking_option_settings $settings
* @return string
*/
private function get_description_string($isavailable, $full, $settings) {
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}
if ($isavailable) {
$description = $full ? get_string('bocondalreadybookedfullavailable', 'mod_booking') :
get_string('bocondalreadybookedavailable', 'mod_booking');
Expand Down
6 changes: 5 additions & 1 deletion classes/bo_availability/conditions/optionhasstarted.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,11 @@ public function render_button(
* @param booking_option_settings $settings
* @return string
*/
private function get_description_string($isavailable, $full, $settings) {
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}
if ($isavailable) {
$description = $full ? get_string('bocondoptionhasstartedfullavailable', 'mod_booking') :
get_string('bocondoptionhasstartedavailable', 'mod_booking');
Expand Down
4 changes: 4 additions & 0 deletions classes/bo_availability/conditions/previouslybooked.php
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,10 @@ public function render_button(
*/
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}

if ($isavailable) {
$description = $full ? get_string('bocondpreviouslybookedfullavailable', 'mod_booking') :
get_string('bocondpreviouslybookedavailable', 'mod_booking');
Expand Down
6 changes: 5 additions & 1 deletion classes/bo_availability/conditions/selectusers.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,11 @@ public function render_button(booking_option_settings $settings,
* @param booking_option_settings $settings
* @return string
*/
private function get_description_string($isavailable, $full, $settings) {
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}
global $DB;
if ($isavailable) {
$description = $full ? get_string('bocondselectusersfullavailable', 'mod_booking') :
Expand Down
6 changes: 5 additions & 1 deletion classes/bo_availability/conditions/subbooking.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,11 @@ public function render_button(
* @param booking_option_settings $settings
* @return string
*/
private function get_description_string($isavailable, $full, $settings) {
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}
if ($isavailable) {
$description = $full ? get_string('bocondsubbookingfullavailable', 'mod_booking') :
get_string('bocondsubbookingavailable', 'mod_booking');
Expand Down
6 changes: 5 additions & 1 deletion classes/bo_availability/conditions/subbooking_blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,11 @@ public function render_button(
* @param booking_option_settings $settings
* @return string
*/
private function get_description_string($isavailable, $full, $settings) {
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}
if ($isavailable) {
$description = $full ? get_string('bocondisbookablefullavailable', 'mod_booking') :
get_string('bocondisbookableavailable', 'mod_booking');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,11 @@ public function render_button(booking_option_settings $settings,
* @param booking_option_settings $settings
* @return string
*/
private function get_description_string($isavailable, $full, $settings) {
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}
if ($isavailable) {
$description = $full ? get_string('boconduserprofilefieldfullavailable', 'mod_booking') :
get_string('boconduserprofilefieldavailable', 'mod_booking');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,11 @@ public function render_button(booking_option_settings $settings,
* @param booking_option_settings $settings
* @return string
*/
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings, booking_option_settings $settings) {
private function get_description_string(bool $isavailable, bool $full, booking_option_settings $settings) {

if (!$isavailable && !empty($desc = bo_info::apply_billboard($this, $settings))) {
return $desc;
}
if ($isavailable) {
$description = $full ? get_string('bocondcustomuserprofilefieldfullavailable', 'mod_booking') :
get_string('bocondcustomuserprofilefieldavailable', 'mod_booking');
Expand Down

0 comments on commit d15b1d0

Please sign in to comment.