Beispiel #1
0
 /**
  * Function to check whether we can reserve the resource we are trying to
  *
  * @return boolean indicating state
  * @todo cache results
  */
 function verify_can_reserve()
 {
     if (empty($this->resource)) {
         debug_add("Resource is set to empty value returning true");
         return true;
     }
     try {
         $resource = new org_openpsa_calendar_resource_dba($this->resource);
     } catch (midcom_error $e) {
         debug_add("Cannot fetch resource #{$this->resource} returning false", MIDCOM_LOG_INFO);
         return false;
     }
     $stat = $resource->can_do('org.openpsa.calendar:reserve');
     if (!$stat) {
         debug_add("\$resource->can_do('org.openpsa.calendar:reserve'), returned false, so will we", MIDCOM_LOG_INFO);
     }
     return $stat;
 }