Beispiel #1
0
                 $last_date = strtotime("+1 days", MakeTimeStamp($arFields["DATE_TO"]));
                 $last_date = ConvertTimeStampForReport($last_date, "SHORT");
                 $tm_user->SetLastDate($arReport["USER_ID"], $last_date);
                 $tm_user->CancelDelay();
                 if (!$bSameUser) {
                     CReportNotifications::SendMessage($ID);
                 }
             }
         } else {
             if (is_array($_SESSION['report_files'])) {
                 $arFields['FILES'] = $_SESSION['report_files'];
             }
             $arManagers = CTimeMan::GetUserManagers($curUser);
             $res = CTimeManReportFull::Add($arFields);
             if ($res && $arFields["ACTIVE"] != "N" && !$bSameUser) {
                 CReportNotifications::SendMessage($res);
             }
         }
         $_SESSION['report_files'] = array();
         $CACHE_MANAGER->Clean(CUserReportFull::getInfoCacheId($curUser), 'timeman_report_info');
         $CACHE_MANAGER->Clean(CReportSettings::getSettingsCacheId($curUser), 'timeman_report_settings');
     }
     break;
 case "add_comment_full_report":
     $bReturnRes = true;
     $ID = intval($_POST["report_id"]);
     $dbReport = CTimeManReportFull::GetByID($ID);
     $report = $dbReport->Fetch();
     if ($report && CModule::IncludeModule("forum")) {
         $OWNER = intval($report["USER_ID"]);
         $CURRENT_USER = $USER->GetID();
 public static function AddCommentToLog($arFields)
 {
     global $DB, $USER;
     CModule::IncludeModule("socialnetwork");
     $result = false;
     $dbLog = CSocNetLog::GetList(array(), array("SOURCE_ID" => $arFields["REPORT_ID"], "EVENT_ID" => "report"));
     if (!($arLog = $dbLog->Fetch())) {
         $LOG_ID = CReportNotifications::SendMessage($arFields["REPORT_ID"], false);
     } else {
         $LOG_ID = $arLog["ID"];
     }
     $arMessFields = array("EVENT_ID" => "report_comment", "ENTITY_ID" => $arFields["REPORT_OWNER"], "TEXT_MESSAGE" => $arFields["COMMENT_TEXT"], "MESSAGE" => $arFields["COMMENT_TEXT"], "USER_ID" => $arFields["USER_ID"], "ENTITY_TYPE" => "R", "LOG_ID" => $LOG_ID, "=LOG_DATE" => $DB->CurrentTimeFunction());
     $result = CSocNetLogComments::Add($arMessFields, true, false);
     CSocNetLog::CounterIncrement($result, false, false, "LC");
     $curUser = $USER->GetID();
     $dbLogRights = CSocNetLogRights::GetList(array(), array("LOG_ID" => $LOG_ID));
     while ($arRight = $dbLogRights->Fetch()) {
         $arRights[] = $arRight["GROUP_CODE"];
     }
     if (!in_array("U" . $curUser, $arRights)) {
         CSocNetLogRights::Add($LOG_ID, "U" . $curUser);
     }
     return $result;
 }