Пример #1
0
     $errObj = new ADA_Error($service_infoAr, translateFN("An error occurred."));
 }
 $service_name = translateFN($service_infoAr[1]);
 $date_data_Ar = explode('_', $_POST['date']);
 $date = $date_data_Ar[0];
 $time = $date_data_Ar[1];
 $time = "{$time}:00";
 $offset = 0;
 if ($tester === NULL) {
     $tester_TimeZone = SERVER_TIMEZONE;
 } else {
     $tester_TimeZone = MultiPort::getTesterTimeZone($tester);
     $offset = get_timezone_offset($tester_TimeZone, SERVER_TIMEZONE);
 }
 $data_ora = sumDateTimeFN(array($date, $time)) - $offset;
 $event_token = ADAEventProposal::extractEventToken($subject);
 $event_flag = 0;
 if (ADA_CHAT_EVENT & $practitioner_proposal['flags']) {
     $new_subject = translateFN('Appuntamento in chat');
     //$url = HTTP_ROOT_DIR.'/comunica/chat.php';
     $event_flag = ADA_CHAT_EVENT;
 } else {
     if (ADA_VIDEOCHAT_EVENT & $practitioner_proposal['flags']) {
         $new_subject = translateFN('Appuntamento in videochat');
         //$url = HTTP_ROOT_DIR.'/comunica/videochat.php';
         $event_flag = ADA_VIDEOCHAT_EVENT;
     } else {
         if (ADA_PHONE_EVENT & $practitioner_proposal['flags']) {
             $new_subject = translateFN('Appuntamento telefonico');
             //$url = NULL;
             $event_flag = ADA_PHONE_EVENT;
Пример #2
0
 public static function hasThisUserAVideochatAppointment(ADALoggableUser $userObj)
 {
     $id_course_instance = DataValidator::is_uinteger($_SESSION['sess_id_course_instance']);
     if ($id_course_instance === FALSE) {
         return FALSE;
     }
     $fields_list_Ar = array('id_mittente', 'data_ora', 'titolo', 'priorita', 'read_timestamp');
     $clause = '(flags & ' . ADA_VIDEOCHAT_EVENT . ') AND (flags & ' . ADA_EVENT_CONFIRMED . ')';
     $sort_field = 'data_ora desc';
     $mh = MessageHandler::instance(self::getDSN($_SESSION['sess_selected_tester']));
     $msgs_ha = $mh->find_messages($userObj->getId(), ADA_MSG_AGENDA, $fields_list_Ar, $clause, $sort_field);
     if (!AMA_DataHandler::isError($msgs_ha)) {
         $today_time = today_timeFN();
         $today_date = today_dateFN();
         $today_time_date = date(ADA_DATE_FORMAT);
         foreach ($msgs_ha as $one_date) {
             $time_2_add = 30 * 60;
             // 30 minuti di arrotondamento.
             $unix_date_app_rounded = $one_date[1] + $time_2_add;
             $udate_now = time();
             if ($udate_now >= $one_date[1] and $udate_now <= $unix_date_app_rounded) {
                 $event_token = ADAEventProposal::extractEventToken($one_date[2]);
                 return $event_token;
             }
         }
     }
     return FALSE;
 }