|
|
@ -11,6 +11,7 @@
|
|
|
|
require_once 'assets/room-icons.php';
|
|
|
|
require_once 'assets/room-icons.php';
|
|
|
|
require_once 'assets/room-invites.php';
|
|
|
|
require_once 'assets/room-invites.php';
|
|
|
|
require_once 'utils/numeric.php';
|
|
|
|
require_once 'utils/numeric.php';
|
|
|
|
|
|
|
|
require_once 'utils/read-config.php';
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Represents a Session Community.
|
|
|
|
* Represents a Session Community.
|
|
|
@ -399,6 +400,18 @@
|
|
|
|
));
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Return the number of unique Community staff.
|
|
|
|
|
|
|
|
* @return int
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
function get_staff_count(): int {
|
|
|
|
|
|
|
|
global $LOCAL_CONFIG;
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
$LOCAL_CONFIG->get_room_staff_count_override($this->get_room_identifier())
|
|
|
|
|
|
|
|
?? count($this->get_staff())
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Return duration in seconds since room was created.
|
|
|
|
* Return duration in seconds since room was created.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -691,7 +704,7 @@
|
|
|
|
* @return bool
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function has_good_staff_rating(): bool {
|
|
|
|
public function has_good_staff_rating(): bool {
|
|
|
|
$staff_count = count($this->get_staff());
|
|
|
|
$staff_count = $this->get_staff_count();
|
|
|
|
return $staff_count >= $this->get_recommended_staff_count();
|
|
|
|
return $staff_count >= $this->get_recommended_staff_count();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -702,7 +715,7 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function get_numeric_staff_rating(): float {
|
|
|
|
public function get_numeric_staff_rating(): float {
|
|
|
|
if (!$this->write || !$this->read) return 2;
|
|
|
|
if (!$this->write || !$this->read) return 2;
|
|
|
|
return min(2, count($this->get_staff()) / $this->get_recommended_staff_count());
|
|
|
|
return min(2, $this->get_staff_count() / $this->get_recommended_staff_count());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -720,7 +733,7 @@
|
|
|
|
* Estimate whether the Community does not have enough staff.
|
|
|
|
* Estimate whether the Community does not have enough staff.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function has_poor_staff_rating(): bool {
|
|
|
|
public function has_poor_staff_rating(): bool {
|
|
|
|
return count($this->get_staff()) < $this->get_minimal_staff_count();
|
|
|
|
return $this->get_staff_count() < $this->get_minimal_staff_count();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|