protected function showDetail() { $repid = intval(EnvUtil::getRequest("repid")); $isShowTitle = EnvUtil::getRequest("isShowTitle"); $fromController = EnvUtil::getRequest("fromController"); $report = Report::model()->fetchByPk($repid); $uid = Ibos::app()->user->uid; Report::model()->addReaderuid($report, $uid); $record = ReportRecord::model()->fetchAllRecordByRep($report); $attachs = array(); if (!empty($report["attachmentid"])) { $attachs = AttachUtil::getAttach($report["attachmentid"], true, true, false, false, true); } $readers = array(); if (!empty($report["readeruid"])) { $readerArr = explode(",", $report["readeruid"]); $readers = User::model()->fetchAllByPk($readerArr); } $stampUrl = ""; if ($report["stamp"] != 0) { $stamp = Stamp::model()->fetchStampById($report["stamp"]); $stampUrl = FileUtil::fileName(Stamp::STAMP_PATH) . $stamp; } $report["addtime"] = ConvertUtil::formatDate($report["addtime"], "u"); $params = array("lang" => Ibos::getLangSource("report.default"), "repid" => $repid, "report" => $report, "uid" => $uid, "orgPlanList" => $record["orgPlanList"], "outSidePlanList" => $record["outSidePlanList"], "nextPlanList" => $record["nextPlanList"], "attachs" => $attachs, "readers" => $readers, "stampUrl" => $stampUrl, "fromController" => $fromController, "isShowTitle" => $isShowTitle, "allowComment" => $this->getIsAllowComment($fromController)); $detailAlias = "application.modules.report.views.detail"; $detailView = $this->renderPartial($detailAlias, $params, true); $this->ajaxReturn(array("data" => $detailView, "isSuccess" => true)); }
protected function handleList($runProcess) { foreach ($runProcess as &$run) { $run["user"] = User::model()->fetchByUid($run["beginuser"]); $run["begintime"] = ConvertUtil::formatDate($run["begintime"], "u"); $param = array("runid" => $run["runid"], "flowid" => $run["flowid"]); $run["key"] = WfCommonUtil::param($param); } return array("list" => $runProcess); }
public function fetchAllByDocid($docid) { $versionData = $this->fetchAll("docid=:docid ORDER BY version DESC", array(":docid" => $docid)); if (!empty($versionData)) { $users = Yii::app()->setting->get("cache/users"); foreach ($versionData as $key => $version) { $versionData[$key]["uptime"] = ConvertUtil::formatDate($version["uptime"], "u"); $versionData[$key]["editor"] = isset($users[$version["editor"]]) ? $users[$version["editor"]]["realname"] : "--"; $versionData[$key]["showVersion"] = OfficialdocUtil::changeVersion($version["version"]); } } return $versionData; }
public function fetchUserList($feedId, $nums, $offset = 0, $order = "ctime DESC") { $criteria = array("select" => "uid,ctime", "condition" => sprintf("feedid = %d", $feedId), "order" => $order, "offset" => $offset, "limit" => $nums); $result = $this->fetchAll($criteria); if ($result) { foreach ($result as &$res) { $res["user"] = User::model()->fetchByUid($res["uid"]); $res["diggtime"] = ConvertUtil::formatDate($res["ctime"]); } } else { $result = array(); } return $result; }
public static function processShareListData($uid, $data) { $result = array(); $attentions = DiaryAttention::model()->fetchAllByAttributes(array("uid" => $uid)); $auidArr = ConvertUtil::getSubByKey($attentions, "auid"); foreach ($data as $diary) { $diary["content"] = StringUtil::cutStr(strip_tags($diary["content"]), 255); $diary["realname"] = User::model()->fetchRealnameByUid($diary["uid"]); $diary["addtime"] = ConvertUtil::formatDate($diary["addtime"], "u"); $isattention = in_array($diary["uid"], $auidArr); $diary["isattention"] = $isattention ? 1 : 0; $diary["user"] = User::model()->fetchByUid($diary["uid"]); $result[] = $diary; } return $result; }
public static function handelListData($reports) { $return = array(); foreach ($reports as $report) { $report["cutSubject"] = StringUtil::cutStr(strip_tags($report["subject"]), 60); $report["user"] = User::model()->fetchByUid($report["uid"]); $readeruid = $report["readeruid"]; $report["readercount"] = empty($readeruid) ? 0 : count(explode(",", trim($readeruid, ","))); $report["content"] = StringUtil::cutStr(strip_tags($report["content"]), 255); $report["addtime"] = ConvertUtil::formatDate($report["addtime"], "u"); if ($report["stamp"] != 0) { $path = Stamp::model()->fetchIconById($report["stamp"]); $report["stampPath"] = FileUtil::fileName(Stamp::STAMP_PATH . $path); } $return[] = $report; } return $return; }
public static function getListData($datas, $uid) { $listDatas = array(); $checkTime = 3 * 86400; $readArtIds = ArticleReader::model()->fetchReadArtIdsByUid($uid); foreach ($datas as $data) { $data["subject"] = StringUtil::cutStr($data["subject"], 50); $data["readStatus"] = in_array($data["articleid"], $readArtIds) ? 1 : -1; if ($data["readStatus"] === -1 && TIMESTAMP - $checkTime < $data["uptime"]) { $data["readStatus"] = 2; } $data["author"] = User::model()->fetchRealnameByUid($data["author"]); if (empty($data["uptime"])) { $data["uptime"] = $data["addtime"]; } $data["uptime"] = ConvertUtil::formatDate($data["uptime"], "u"); $keyword = EnvUtil::getRequest("keyword"); if (!empty($keyword)) { $data["subject"] = preg_replace("|({$keyword})|i", "<span style='color:red'>\$1</span>", $data["subject"]); } if ($data["ishighlight"] == "1") { $highLightStyle = $data["highlightstyle"]; $hiddenInput = "<input type='hidden' id='{$data["articleid"]}_hlstyle' value='{$highLightStyle}'/>"; $data["subject"] .= $hiddenInput; $highLightStyleArr = explode(",", $highLightStyle); $color = $highLightStyleArr[1]; $isB = $highLightStyleArr[0]; $isI = $highLightStyleArr[2]; $isU = $highLightStyleArr[3]; $isB && ($data["subject"] = "<b>{$data["subject"]}</b>"); $isU && ($data["subject"] = "<u>{$data["subject"]}</u>"); $fontStyle = ""; $color != "" && ($fontStyle .= "color:{$color};"); $isI && ($fontStyle .= "font-style:italic;"); $fontStyle != "" && ($data["subject"] = "<font style='{$fontStyle}'>{$data["subject"]}</font>"); } $listDatas[] = $data; } return $listDatas; }
" width="60" height="60"> </a> </div> <div class="cmt-body"> <p class="mbs xcm"> <strong class="xcn"><?php echo $user_info['realname']; ?> :</strong> <?php echo $body; ?> </p> <div class="mbs fss"> <span><?php echo ConvertUtil::formatDate($ctime, 'u'); ?> </span> <a href="javascript:;" data-act="getreply" data-param="name=<?php echo $user_info['realname']; ?> &module=message&table=feed&rowid=<?php echo $feedid; ?> " class="pull-right"><?php echo $lang['Reply']; ?> </a> </div> <div class="well well-small well-lightblue" style="display: none;"> <textarea class="mbs"><?php
public static function getViewFlowData($runId, $flowId, $uid, &$remindUid) { $fl = array(); $flow = new ICFlowType(intval($flowId)); $pMaxId = FlowRunProcess::model()->fetchMaxIDByRunID($runId); $process = WfCommonUtil::loadProcessCache($flowId); for ($processId = 1; $processId <= $pMaxId; $processId++) { foreach (FlowRunProcess::model()->fetchAllProcessByProcessID($runId, $processId) as $rp) { $temp = array("flowprocess" => $rp["flowprocess"], "parent" => $rp["parent"], "runid" => $rp["runid"], "processid" => $rp["processid"]); if (FlowRunProcess::model()->getIsAgent($runId, $processId, $uid, $rp["flowprocess"])) { $temp["isprocuser"] = 1; } else { $temp["isprocuser"] = 0; } $op = FlowRunProcess::model()->fetchOpUserByUniqueID($runId, $processId, $rp["flowprocess"]); if (!empty($op)) { $temp["opuser"] = !empty($op["uid"]) ? User::model()->fetchRealnameByUid($op["uid"]) : ""; $temp["opprocessflag"] = $op["flag"]; } else { $temp["opuser"] = User::model()->fetchRealnameByUid($rp["uid"]); $temp["opprocessflag"] = $rp["flag"]; } if ($flow->isFixed()) { if (isset($process[$rp["flowprocess"]])) { $temp["name"] = $process[$rp["flowprocess"]]["name"]; $temp["timeout"] = $process[$rp["flowprocess"]]["timeout"]; $temp["signlook"] = $process[$rp["flowprocess"]]["signlook"]; } else { $temp["name"] = Ibos::lang("Process steps already deleted", "workflow.default"); } } else { $temp["timeout"] = 0; } foreach (FlowRunProcess::model()->fetchAllProcessByFlowProcess($runId, $processId, $rp["flowprocess"]) as $arp) { $temp["prcsuid"] = $arp["uid"]; $temp["opflag"] = $arp["opflag"]; $temp["flag"] = $arp["flag"]; $temp["processtime"] = ConvertUtil::formatDate($arp["processtime"], "u"); $temp["delivertime"] = $arp["delivertime"] != 0 ? ConvertUtil::formatDate($arp["delivertime"], "u") : $arp["delivertime"]; if ($arp["flag"] == "1") { $temp["timeused"] = 0; } elseif ($arp["flag"] == "2") { $temp["timeused"] = TIMESTAMP - $arp["processtime"]; } elseif ($arp["delivertime"] == 0) { $temp["timeused"] = 0; } else { $temp["timeused"] = $arp["delivertime"] - $arp["processtime"]; } if ($arp["processtime"] == "") { $temp["timeused"] = 0; } $temp["timestr"] = WfCommonUtil::getTime($temp["timeused"]); $temp["timeoutflag"] = 0; if ($arp["flag"] == "2" && $arp["processtime"] != "" && $temp["timeout"] != 0) { if ($temp["timeout"] * 3600 < $temp["timeused"]) { $temp["timeoutflag"] = 1; $temp["timeused"] = WfCommonUtil::getTime($temp["timeused"] - $temp["timeout"] * 3600); } } if ($arp["flag"] == 1 || $temp["timeoutflag"] == 1) { $remindUid[] = $arp["uid"]; } $temp["redo"] = false; if ($temp["opuser"] == $uid && $arp["uid"] != $uid && ($temp["opprocessflag"] == 1 || $temp["opprocessflag"] == 2) && ($arp["flag"] == 3 || $arp["flag"] == 4)) { $temp["redo"] = true; } $temp["log"] = FlowRunLog::model()->fetchLog($temp["runid"], $temp["processid"], $temp["flowprocess"], 8); } $fl[count($fl) + 1] = $temp; } } return $fl; }
</strong><?php } else { ?> <span class="<?php echo $importantClass; ?> "><?php echo $data['subject']; ?> </span><?php } ?> </a> </td> <td width="120"><div class="fss"><?php echo ConvertUtil::formatDate($data['sendtime'], 'u'); ?> </div></td> <td width="10" class="j-mark"> <a href="javascript:;" title="<?php echo $lang['Click to mark this message']; ?> " class="<?php if ($data['ismark'] == 1) { ?> o-mark<?php } else { ?> o-unmark<?php } ?>
" width="60" height="60"> </a> </div> <div class="cmt-body"> <p class="mbs xcm"> <strong class="xcn"><?php echo $comment['user_info']['realname']; ?> :</strong> <?php echo StringUtil::parseHtml($comment['content']); ?> </p> <div class="mbs fss"> <span><?php echo ConvertUtil::formatDate($comment['ctime'], 'u'); ?> </span> <div class="pull-right"> <a href="javascript:;" data-act="getreply" data-param='{"type":"reply","module":"message","table":"comment","rowid":"<?php echo $comment['cid']; ?> ","name":"<?php echo $comment['user_info']['realname']; ?> ","type":"reply"}'><?php echo $lang['Reply']; ?> (<?php echo $comment['replys']; ?>
echo $lang["Not receive"]; ?> </span> <?php } ?> </td> <td> <span class="fss tcm"><?php echo $val["user"]["realname"]; ?> </span> </td> <td> <span class="fss tcm"><?php echo ConvertUtil::formatDate($val["time"]); ?> </span> </td> </tr> <?php } ?> </tbody> </table> <?php } else { ?> <div class="no-data-tip"></div> <?php }
public static function exportExcel($id) { $data = Email::model()->fetchById($id); if ($data) { $users = UserUtil::loadUser(); header("Cache-control: private"); header("Content-type: application/vnd.ms-excel"); header("Content-Disposition: attachment; filename=" . ConvertUtil::iIconv($data["subject"], CHARSET, "GBK") . "(" . date("Y-m-d") . ").xls"); //$html = " <html xmlns:o=\"urn:schemas-microsoft-com:office:office\"\r\n\t\txmlns:x=\"urn:schemas-microsoft-com:office:excel\"\r\n\t\txmlns=\"http://www.w3.org/TR/REC-html40\">\r\n\t\t<head>\r\n\t\t<title></title>\r\n\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n\t\t</head>\r\n\t\t<body topmargin=\"5\">\r\n\t\t <table border=\"1\" cellspacing=\"1\" width=\"95%\" class=\"small\" cellpadding=\"3\">\r\n\t\t\t<tr style=\"BACKGROUND: #D3E5FA; color: #000000; font-weight: bold;\">\r\n\t\t\t <td align=\"center\">收件人:</td>\r\n\t\t\t <td align=\"center\">发件人:</td>\r\n\t\t\t <td align=\"center\">抄送:</td>\r\n\t\t\t <td align=\"center\">重要性:</td>\r\n\t\t\t <td align=\"center\">标题:</td>\r\n\t\t\t <td align=\"center\">发送时间:</td>\r\n\t\t\t <td align=\"center\">内容:</td>\r\n\t\t\t <td align=\"center\">附件名称:</td>\r\n\t\t\t</tr> "; $html = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body topmargin="5"> <table border="1" cellspacing="1" width="95%" class="small" cellpadding="3"> <tr style="BACKGROUND: #D3E5FA; color: #000000; font-weight: bold;"> <td align="center">收件人:</td> <td align="center">发件人:</td> <td align="center">抄送:</td> <td align="center">重要性:</td> <td align="center">标题:</td> <td align="center">发送时间:</td> <td align="center">内容:</td> <td align="center">附件名称:</td> </tr>'; $data["toname"] = self::joinStringByArray($data["toids"], $users, "realname", ";"); $data["content"] = str_replace(" ", " ", $data["content"]); $data["content"] = str_replace("\n", "<br>", $data["content"]); $data["fromname"] = isset($users[$data["fromid"]]) ? $users[$data["fromid"]]["realname"] : ""; $data["copytoname"] = self::joinStringByArray($data["copytoids"], $users, "realname", ";"); $important_desc = ""; if ($data["important"] == "0") { $important_desc = ""; } elseif ($data["important"] == "1") { $important_desc = "<font color=\"#ff6600\">一般邮件</font>"; } elseif ($data["important"] == "2") { $important_desc = "<font color=\"#FF0000\">重要邮件</font>"; } $attachmentname = ""; if ($data["attachmentid"] !== "") { $tempdata = AttachUtil::getAttach($data["attachmentid"]); foreach ($tempdata as $value) { $attachmentname .= $value["filename"] . "; "; } } $data["sendtime"] = ConvertUtil::formatDate($data["sendtime"]); //$html .= "\r\n <tr>\r\n <td nowrap align=\"center\">" . $data["toname"] . "</td>\r\n <td nowrap align=\"center\">" . $data["fromname"] . "</td>\r\n <td>" . $data["copytoname"] . "</td>\r\n <td nowrap align=\"center\">" . $important_desc . "</td>\r\n <td nowrap>" . $data["subject"] . "</td>\r\n <td nowrap align=\"center\" x:str=\"" . $data["sendtime"] . "\">" . $data["sendtime"] . "</td>\r\n <td>" . $data["content"] . "</td>\r\n <td>" . $attachmentname . "</td>\r\n </tr>\r\n </table>"; $html .= '<tr> <td nowrap align="center">' . $data["toname"] . '</td> <td nowrap align="center">' . $data["fromname"] . '</td> <td>' . $data["copytoname"] . '</td> <td nowrap align="center">' . $important_desc . '</td> <td nowrap>' . $data["subject"] . '</td> <td nowrap align="center" x:str="' . $data["sendtime"] . '">' . $data["sendtime"] . '</td> <td>' . $data["content"] . '</td> <td>' . $attachmentname . '</td> </tr></table>'; echo $html; } }
" width="60" height="60"> </a> </div> <div class="cmt-body"> <p class="mbs xcm"> <strong class="xcn"><?php echo $comment["user_info"]["realname"]; ?> :</strong> <?php echo StringUtil::parseHtml($comment["content"]); ?> </p> <div class="mbs fss"> <span><?php echo ConvertUtil::formatDate($comment["ctime"], "u"); ?> </span> <div class="pull-right"> <a href="javascript:;" data-act="getreply" data-param='{"type":"reply","module":"message","table":"comment","rowid":"<?php echo $comment["cid"]; ?> ","name":"<?php echo $comment["user_info"]["realname"]; ?> ","type":"reply"}'><?php echo $lang["Reply"]; ?> (<?php echo $comment["replys"]; ?>
public function execRule($action, $uid = 0, $needle = "", $coef = 1, $update = 1) { $this->_coef = $coef; $uid = intval($uid); $rule = $this->getRule($action); $updateCredit = false; $timestamp = TIMESTAMP; $enabled = false; if ($rule) { for ($i = 1; $i <= 5; $i++) { if (!empty($rule["extcredits" . $i])) { $enabled = true; break; } } } if ($enabled) { $ruleLog = $this->getRuleLog($rule["rid"], $uid); if ($ruleLog && $rule["norepeat"]) { $ruleLog = array_merge($ruleLog, $this->getCheckLogByClId($ruleLog["clid"], $uid)); $ruleLog["norepeat"] = $rule["norepeat"]; } if ($rule["rewardnum"] && $rule["rewardnum"] < $coef) { $coef = $rule["rewardnum"]; } if (empty($ruleLog)) { $logArr = array("uid" => $uid, "rid" => $rule["rid"], "total" => $coef, "cyclenum" => $coef, "dateline" => $timestamp); if (in_array($rule["cycletype"], array(2))) { $logArr["starttime"] = $timestamp; } else { $logArr["starttime"] = 0; } $logArr = $this->addLogArr($logArr, $rule, false); if ($update) { $clid = CreditRuleLog::model()->add($logArr, true); if ($rule["norepeat"]) { $ruleLog["isnew"] = 1; $ruleLog["clid"] = $clid; $ruleLog["uid"] = $uid; $ruleLog["norepeat"] = $rule["norepeat"]; $this->updateCheating($ruleLog, $needle, true); } } $updateCredit = true; } else { $newCycle = false; $logArr = array(); switch ($rule["cycletype"]) { case 1: break; case 2: $nextCycle = 0; if ($ruleLog["starttime"]) { if ($rule["cycletype"] == 2) { $start = strtotime(ConvertUtil::formatDate($ruleLog["starttime"], "Y-m-d H:00:00")); $nextCycle = $start + $rule["cycletime"] * 3600; } else { $nextCycle = $ruleLog["starttime"] + $rule["cycletime"] * 60; } } if ($timestamp <= $nextCycle && $ruleLog["cyclenum"] < $rule["rewardnum"]) { if ($rule["norepeat"]) { $repeat = $this->checkCheating($ruleLog, $needle, $rule["norepeat"]); if ($repeat && !$newCycle) { return false; } } if ($rule["rewardnum"]) { $remain = $rule["rewardnum"] - $ruleLog["cyclenum"]; if ($remain < $coef) { $coef = $remain; } } $logArr = array("cyclenum" => "cyclenum=cyclenum+'{$coef}'", "total" => "total=total+'{$coef}'", "dateline" => "dateline='{$timestamp}'"); $updateCredit = true; } elseif ($nextCycle <= $timestamp) { $newCycle = true; $logArr = array("cyclenum" => "cyclenum={$coef}", "total" => "total=total+'{$coef}'", "dateline" => "dateline='{$timestamp}'", "starttime" => "starttime='{$timestamp}'"); $updateCredit = true; } break; case 3: if ($rule["cycletype"] == 3) { $today = strtotime(date("Y-m-d", $timestamp)); if ($ruleLog["dateline"] < $today && $rule["rewardnum"]) { $ruleLog["cyclenum"] = 0; $newCycle = true; } } if (empty($rule["rewardnum"]) || $ruleLog["cyclenum"] < $rule["rewardnum"]) { if ($rule["norepeat"]) { $repeat = $this->checkCheating($ruleLog, $needle, $rule["norepeat"]); if ($repeat && !$newCycle) { return false; } } if ($rule["rewardnum"]) { $remain = $rule["rewardnum"] - $ruleLog["cyclenum"]; if ($remain < $coef) { $coef = $remain; } } $cyclenunm = $newCycle ? $coef : "cyclenum+'{$coef}'"; $logArr = array("cyclenum" => "cyclenum={$cyclenunm}", "total" => "total=total+'{$coef}'", "dateline" => "dateline='{$timestamp}'"); $updateCredit = true; } break; } if ($update) { if ($rule["norepeat"] && $needle) { $this->updateCheating($ruleLog, $needle, $newCycle); } if ($logArr) { $logArr = $this->addLogArr($logArr, $rule, true); CreditRuleLog::model()->increase($ruleLog["clid"], $logArr); } } } } if ($update && ($updateCredit || $this->_extraSql)) { if (!$updateCredit) { $extcredits = $this->getExtCredits(); for ($i = 1; $i <= 5; $i++) { if (isset($extcredits[$i]) && !empty($extcredits[$i])) { $rule["extcredits" . $i] = 0; } } } $this->updateCreditByRule($rule, $uid, $coef); } $rule["updateCredit"] = $updateCredit; return $rule; }
public static function getAttach($aid, $down = true, $officeDown = true, $edit = false, $delete = false, $getRealAddress = false) { $attach = array(); if (!empty($aid)) { $data = self::getAttachData($aid); } $urlManager = Ibos::app()->urlManager; foreach ($data as $id => &$val) { $val["date"] = ConvertUtil::formatDate($val["dateline"], "u"); $val["filetype"] = StringUtil::getFileExt($val["filename"]); $val["filesize"] = ConvertUtil::sizeCount($val["filesize"]); if ($getRealAddress) { $val["attachment"] = FileUtil::getAttachUrl() . "/" . $val["attachment"]; } $val["filename"] = trim($val["filename"]); $val["delete"] = $delete; $val["down"] = $down; $val["down_office"] = $officeDown; $val["edit"] = $edit; $val["iconsmall"] = self::attachType($val["filetype"], "smallicon"); $val["iconbig"] = self::attachType($val["filetype"], "bigicon"); $idString = self::getAttachStr($id, $val["tableid"]); $val["openurl"] = $urlManager->createUrl("main/attach/open", array("id" => $idString)); if ($val["down"]) { $val["downurl"] = $urlManager->createUrl("main/attach/download", array("id" => $idString)); } $inOfficeRange = in_array(self::attachType($val["filetype"], "id"), range(3, 5)); if ($inOfficeRange && $val["down_office"]) { $val["officereadurl"] = "http://view.officeapps.live.com/op/view.aspx?src=" . urlencode(Ibos::app()->setting->get("siteurl") . FileUtil::getAttachUrl() . "/" . $val["attachment"]); } if ($inOfficeRange && $val["edit"]) { $val["officeediturl"] = $urlManager->createUrl("main/attach/office", array("id" => self::getAttachStr($aid, $val["tableid"], array("filetype" => $val["filetype"], "op" => "edit")))); } } return $data; }
private function showdiary() { $diaryid = intval($_GET["diaryid"]); $isShowDiarytime = EnvUtil::getRequest("isShowDiarytime"); $fromController = EnvUtil::getRequest("fromController"); $uid = Ibos::app()->user->uid; if (empty($diaryid)) { $this->error(Ibos::lang("Parameters error", "error"), $this->createUrl("default/index")); } $diary = Diary::model()->fetchByPk($diaryid); if (empty($diary)) { $this->error(Ibos::lang("No data found", "error"), $this->createUrl("default/index")); } if (!ICDiary::checkScope($uid, $diary)) { $this->ajaxReturn(array("isSuccess" => false, "msg" => Ibos::lang("You do not have permission to view the log"))); } Diary::model()->addReaderuidByPK($diary, $uid); $data = Diary::model()->fetchDiaryRecord($diary); $data["tomorrowPlanList"] = $this->handelRemindTime($data["tomorrowPlanList"]); $attachs = array(); if (!empty($diary["attachmentid"])) { $attachs = AttachUtil::getAttach($diary["attachmentid"], true, true, false, false, true); } $readers = array(); if (!empty($diary["readeruid"])) { $readerArr = explode(",", $diary["readeruid"]); $readers = User::model()->fetchAllByPk($readerArr); } $stampUrl = ""; if ($diary["stamp"] != 0) { $stamp = Stamp::model()->fetchStampById($diary["stamp"]); $stampUrl = FileUtil::fileName(Stamp::STAMP_PATH) . $stamp; } $diary["diarytime"] = DiaryUtil::getDateAndWeekDay(date("Y-m-d", $diary["diarytime"])); $diary["nextdiarytime"] = DiaryUtil::getDateAndWeekDay(date("Y-m-d", $diary["nextdiarytime"])); $diary["addtime"] = ConvertUtil::formatDate($diary["addtime"], "u"); $params = array("lang" => Ibos::getLangSource("diary.default"), "diaryid" => $diaryid, "diary" => $diary, "uid" => $uid, "data" => $data, "attachs" => $attachs, "readers" => $readers, "stampUrl" => $stampUrl, "fromController" => $fromController, "isShowDiarytime" => $isShowDiarytime, "allowComment" => $this->getIsAllowComment($fromController, $uid, $diary)); $detailAlias = "application.modules.diary.views.detail"; $detailView = $this->renderPartial($detailAlias, $params, true); $this->ajaxReturn(array("data" => $detailView, "isSuccess" => true)); }
public function actionShow() { $id = is_null($_GET["id"]) ? 0 : intval($_GET["id"]); if ($id) { $data = array(); $email = Email::model()->fetchById($id, $this->archiveId); if (!$email) { $this->error(Ibos::lang("Parameters error", "error"), $this->createUrl("list/index")); } $isReceiver = $email["toid"] == $this->uid || $email["fromid"] == $this->uid || StringUtil::findIn($email["copytoids"], $this->uid) || StringUtil::findIn($email["toids"], $this->uid); if (!$isReceiver) { $this->error(Ibos::lang("View access invalid"), $this->createUrl("list/index")); } if (EnvUtil::getRequest("op") == "showframe") { echo $email["content"]; exit; } if (($email["toid"] == $this->uid || StringUtil::findIn($email["toids"], $this->uid)) && $email["isread"] == 0) { Email::model()->setRead($id, $this->uid); } $email["dateTime"] = ConvertUtil::formatDate($email["sendtime"]); if ($this->uid == $email["fromid"]) { $email["fromName"] = Ibos::lang("Me"); } elseif (!empty($email["fromid"])) { $email["fromName"] = User::model()->fetchRealnameByUid($email["fromid"]); } else { $email["fromName"] = $email["fromwebmail"]; } $allIds = StringUtil::filterStr($email["toids"] . "," . $email["copytoids"]); $copyToId = explode(",", $email["copytoids"]); $toId = explode(",", $email["toids"]); $allUsers = $copyToUsers = $toUsers = array(); foreach (explode(",", $allIds) as $key => $uid) { if (!empty($uid)) { $tempUid = strpos($uid, "@"); if (!$tempUid) { if ($this->uid == $uid) { $name = Ibos::lang("Self"); } else { $name = User::model()->fetchRealnameByUid($uid); } } else { $name = $uid; } if (in_array($uid, $copyToId)) { $copyToUsers[$key] = $allUsers[$key] = $name; } elseif (in_array($uid, $toId)) { $allUsers[$key] = $toUsers[$uid] = $name; } else { $allUsers[$key] = $name; } } } if (!empty($email["towebmail"])) { $towebmails = explode(";", $email["towebmail"]); while (!empty($towebmails)) { $toUsers[] = $allUsers[] = array_pop($towebmails); } $toUsers = array_unique($toUsers); $allUsers = array_unique($allUsers); } $data["allUsers"] = $allUsers; $data["toUsers"] = $toUsers; $data["copyToUsers"] = $copyToUsers; $data["isSecretUser"] = StringUtil::findIn($this->uid, $email["secrettoids"]); !empty($email["attachmentid"]) && ($data["attach"] = AttachUtil::getAttach($email["attachmentid"])); $data["next"] = Email::model()->fetchNext($id, $this->uid, $email["fid"], $this->archiveId); $data["prev"] = Email::model()->fetchPrev($id, $this->uid, $email["fid"], $this->archiveId); $data["email"] = $email; $data["weekDay"] = DateTimeUtil::getWeekDay($email["sendtime"]); $this->setPageTitle(Ibos::lang("Show email")); $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Personal Office")), array("name" => Ibos::lang("Email center"), "url" => $this->createUrl("list/index")), array("name" => Ibos::lang("Show email")))); $this->render("show", $data); } else { $this->error(Ibos::lang("Parameters error"), $this->createUrl("list/index")); } }
<?php } ?> </li> <?php } ?> </ul> </div> </div> </div> <?php } else { ?> <?php $time = ConvertUtil::formatDate($data['latest']['ctime'], 'u'); ?> <div class="mb"> <p> <strong><?php echo $modules[$module]['name']; ?> :</strong> <?php if (empty($data['latest']['url'])) { ?> <?php echo $data['latest']['title']; ?> <?php } else {
if ($row['fromuid'] == $uid) { ?> msg-box-inverse bglb<?php } else { } ?> "> <span class="msg-box-arrow"> <i></i></span> <div class="msg-box-body"> <p class="xcm mb"><?php echo StringUtil::parseHtml($row['content']); ?> </p> <div> <span class="tcm fss"><?php echo ConvertUtil::formatDate($row['mtime'], 'u'); ?> </span> <div class="pull-right"> <!-- <a href="javascript:;" onclick="replyMessage('<?php echo $row['fromuser']['realname']; ?> ')">回复</a> --> </div> </div> </div> </div> </div> </div>
<td valign="top" style="border-color:#ffffff;background-color:#efefef;" width="571"> <?php echo !empty($body['fromwebmail']) ? $body['fromwebmail'] : User::model()->fetchRealnameByUid($body['fromid']); ?> </td> </tr> <tr> <td valign="top" style="word-break:break-all;border-color:#ffffff;background-color:#efefef;" width="92"> <?php echo $lang['Send time']; ?> <br /> </td> <td valign="top" style="border-color:#ffffff;background-color:#efefef;" width="571"> <?php echo ConvertUtil::formatDate($body['sendtime']); ?> ( <?php echo $lang['Week'] . DateTimeUtil::getWeekDay($body['sendtime']); ?> ) </td> </tr> <tr> <td valign="top" style="word-break:break-all;border-color:#ffffff;background-color:#efefef;" colspan="1" rowspan="1" width="92"> <?php echo $lang['Recipient']; ?> <br /> </td> <td valign="top" style="word-break:break-all;border-color:#ffffff;background-color:#efefef;" colspan="1" rowspan="1" width="571">
?> </th> </tr> </thead> <tbody> <?php foreach ($creditLog as $log) { ?> <tr> <td><?php echo $log["operation"]; ?> </td> <td>+1</td> <td><?php echo ConvertUtil::formatDate($log["dateline"], "Y-m-d H:i"); ?> </td> <td><?php echo $log["curcredits"]; ?> </td> </tr> <?php } ?> </tbody> <?php if (!empty($pages)) { ?> <tfoot>
</a> </div> <div class="cmt-body fss"> <p class="xcm"> <a href="<?php echo $reply['user_info']['space_url']; ?> " class="anchor"><?php echo $reply['user_info']['realname']; ?> :</a> <?php echo $reply['content']; ?> <span class="tcm ilsep">(<?php echo ConvertUtil::formatDate($reply['ctime'], 'u'); ?> )</span> </p> <div class="xar"> <a href="javascript:;" data-action="reply" data-param='{"name":"<?php echo $reply['user_info']['realname']; ?> ","touid":<?php echo $reply['user_info']['uid']; ?> ,"tocid":<?php echo $reply['cid']; ?> }'>回复</a> <?php
?> </a> </span> <?php } else { ?> <?php echo $run["stepname"]; ?> <?php } ?> </td> <td class="posr"> <span class="art-list-time"><?php echo ConvertUtil::formatDate($run["begintime"]); ?> </span> <div class="right-btnbar"> <div class="btn-toolbar pull-right"> <div class="btn-group"> <button type="button" class="btn dropdown-toggle btn-small" data-toggle="dropdown"> <?php echo $lang["More"]; ?> <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu"> <?php if (isset($run["turn"])) { ?>
</a> </div> <div class="cmt-body fss"> <p class="xcm"> <a href="<?php echo $rp["user"]["space_url"]; ?> " class="anchor"><?php echo $rp["user"]["realname"]; ?> :</a> <?php echo $rp["content"]; ?> <span class="tcm ilsep">(<?php echo ConvertUtil::formatDate($rp["edittime"], "u"); ?> )</span> </p> </div> </li> <?php } ?> </ul> </div> <?php } ?> </div> </div>
<?php echo stripslashes($fd['body']); ?> </div> <!--地图定位--> <!--<div> <i class="glyphicon-map-marker"></i> <span>暨南大学科技产业大厦</span> <span> - </span> <a href="#" class="wb-source">查看地图</a> </div>--> <!--来源信息--> <div class="wb-info-ads clearfix"> <div class="wb-info-from pull-left"> <span><?php echo ConvertUtil::formatDate($fd['ctime'], 'n月d日H:i'); ?> </span> <span> <?php echo $fd['from']; ?> </span> <?php if (!empty($fd['view'])) { ?> <a href="javascript:;" class="o-wbi-lock mls" data-action="openAllowedUserDialog" data-param='{"feedid": <?php echo $fd['feedid']; ?> }' data-toggle="tooltip" title="<?php echo $viewDesc[$fd['view']]; ?>
<tbody> <?php $terminal = array("web" => $lang["Web login"], "app" => $lang["App login"]); ?> <?php foreach ($history as $log) { ?> <?php $row = json_decode($log["message"], true); ?> <tr> <td> <?php echo ConvertUtil::formatDate($log["logtime"], "u"); ?> </td> <td> <?php echo StringUtil::cutStr(!empty($row["address"]) ? $row["address"] : ConvertUtil::convertIp($row["ip"]), 7); ?> </td> <td> <?php echo $row["ip"]; ?> </td> <td> <?php echo $terminal[$row["terminal"]];
public static function getExportData($list, $param) { $lang = Ibos::getLangSources(array("workflow.default")); $data = $titles = $sum = array(); $group = ""; $flow = new ICFlowType($param["flowid"]); $structure = $flow->form->parser->structure; foreach ($list as $index => $row) { if (!empty($param["condition"])) { $formData = WfHandleUtil::getFormData($row["flowid"], $row["runid"]); $notPass = WfHandleUtil::checkCondition($formData, $param["condition"], ""); if ($notPass !== "") { continue; } } $queryHidden = Ibos::app()->db->createCommand()->select("hiddenitem")->from("{{flow_process}} fp")->leftJoin("{{flow_run_process}} frp", "fp.processid = frp.flowprocess")->where(sprintf("fp.flowid = %d AND frp.runid = %d AND frp.uid = %d", $param["flowid"], $row["runid"], $param["uid"]))->queryAll(); $hidden = ConvertUtil::getSubByKey($queryHidden, "hiddenitem"); $itemData = FlowDataN::model()->fetch($param["flowid"], $row["runid"]); $processor = new ICPrintViewProcessor(array("itemData" => $itemData)); foreach (explode(",", $param["viewextfields"]) as $key => $field) { if (strpos($field, ".") !== false) { list(, $itemID) = explode(".", $field); $item = isset($structure[$itemID]) ? $structure[$itemID] : array(); if (empty($item)) { continue; } if ($item["data-type"] == "sign" || $item["data-type"] == "label") { continue; } if (in_array($item["data-title"], $hidden)) { $value = ""; } else { $itemValue = $itemData[$itemID]; switch ($item["data-type"]) { case "checkbox": if ($itemValue == "on") { $value = $lang["Yes"]; } else { $value = $lang["No"]; } break; case "user": case "auto": $method = $item["data-type"] . "Processor"; if (method_exists($processor, $method)) { $value = $processor->{$method}($item, true); } break; case "listview": $sumflag = 0; $lv_subject = $item["data-lv-title"]; $lv_sum = $item["data-lv-sum"]; $lv_sum_array = explode("`", $lv_sum); if (strstr($lv_sum, "1")) { $sumflag = 1; } $lv_value = $itemValue; $item_value = "<table class='commonTable2' ><tr>\n"; $my_array = explode("`", $lv_subject); $array_count_title = sizeof($my_array); if ($my_array[$array_count_title - 1] == "") { $array_count_title--; } for ($i = 0; $i < $array_count_title; $i++) { $item_value .= "<td>" . $my_array[$i] . "</td>\n"; } $item_value .= "</tr>\n"; $my_array = explode("\r\n", $lv_value); $array_count = sizeof($my_array); if ($my_array[$array_count - 1] == "") { $array_count--; } $sum_data = array(); for ($i = 0; $i < $array_count; $i++) { $item_value .= "<tr>\n"; $tr_data = $my_array[$i]; $my_array1 = explode("`", $tr_data); for ($j = 0; $j < $array_count_title; $j++) { if ($lv_sum_array[$j] == 1) { $sum_data[$j] += $my_array1[$j]; } $td_data = $my_array1[$j]; if ($td_data == "") { $td_data = " "; } $item_value .= "<td>" . $td_data . "</td>\n"; } $item_value .= "</tr>\n"; } if ($sumflag == 1 && 0 < $array_count) { $item_value .= "<tr style='font-weight:bold;'>\n"; for ($j = 0; $j < $array_count_title; $j++) { if ($sum_data[$j] == "") { $sumvalue = " "; } else { $sumvalue = "合计:" . $sum_data[$j]; } $item_value .= "<td align=right>" . $sumvalue . "</td>\n"; } $item_value .= "</tr>\n"; } $item_value .= "</table>\n"; break; default: $value = isset($itemData[$itemID]) ? $itemData[$itemID] : ""; break; } } $title = $item["data-title"]; } else { switch ($field) { case "runid": $value = $row["runid"]; $title = $lang["Flow no"]; break; case "runname": $value = $row["runName"]; $title = $lang["Flow subject/num"]; break; case "runstatus": if ($param["flowconditions"]["flowstatus"] == "all") { if ($row["endtime"] == 0) { $status = "<span class=\"red\">{$lang["Perform"]}</span>"; } else { $status = $lang["Has ended"]; } } elseif ($param["flowconditions"]["flowstatus"] == "0") { $status = "<span class=\"red\">{$lang["Perform"]}</span>"; } else { $status = $lang["Has ended"]; } $value = $status; $title = $lang["Flow status"]; break; case "rundate": $value = date("Y-m-d", $row["begintime"]); $title = $lang["Flow begin date"]; break; case "runtime": $value = ConvertUtil::formatDate($row["begintime"]); $title = $lang["Flow begin time"]; break; default: break; } } if (StringUtil::findIn($param["sumfields"], $field)) { $sum[] = $key; } $data[$index][$key] = $value; if ($index == 0) { if (strcmp($param["groupbyfields"]["field"], $field) == 0) { $group = $key; } $titles[$key] = $title; } } } return array("title" => $titles, "data" => $data, "sum" => $sum, "group" => $group, "sum_data" => isset($sum_data) ? $sum_data : array()); }
private function handleCronList(&$list) { foreach ($list as &$cron) { $cron["disabled"] = $cron["weekday"] == -1 && $cron["day"] == -1 && $cron["hour"] == -1 && $cron["minute"] == "" ? true : false; if (0 < $cron["day"] && $cron["day"] < 32) { $cron["time"] = Ibos::lang("Per mensem") . $cron["day"] . Ibos::lang("Cron day"); } else { if (0 <= $cron["weekday"] && $cron["weekday"] < 7) { $cron["time"] = Ibos::lang("Weekly") . Ibos::lang("Cron week day " . $cron["weekday"]); } else { if (0 <= $cron["hour"] && $cron["hour"] < 24) { $cron["time"] = Ibos::lang("Cron perday"); } else { $cron["time"] = Ibos::lang("Per hour"); } } } $cron["time"] .= 0 <= $cron["hour"] && $cron["hour"] < 24 ? sprintf("%02d", $cron["hour"]) . Ibos::lang("Cron hour") : ""; if (!in_array($cron["minute"], array(-1, ""))) { foreach ($cron["minute"] = explode("\t", $cron["minute"]) as $k => $v) { $cron["minute"][$k] = sprintf("%02d", $v); } $cron["minute"] = implode(",", $cron["minute"]); $cron["time"] .= $cron["minute"] . Ibos::lang("Cron minute"); } else { $cron["time"] .= "00" . Ibos::lang("Cron minute"); } $cron["lastrun"] = $cron["lastrun"] ? ConvertUtil::formatDate($cron["lastrun"], Ibos::app()->setting->get("setting/dateformat") . "<\\b\\r />" . Ibos::app()->setting->get("setting/timeformat")) : "<b>N/A</b>"; $cron["nextrun"] = $cron["nextrun"] ? ConvertUtil::formatDate($cron["nextrun"], Ibos::app()->setting->get("setting/dateformat") . "<\\b\\r />" . Ibos::app()->setting->get("setting/timeformat")) : "<b>N/A</b>"; } }
public static function getListDatas($datas) { $listDatas = array(); $users = Ibos::app()->setting->get("cache/users"); $uid = Ibos::app()->user->uid; $checkTime = 3 * 86400; $readDocIds = OfficialdocReader::model()->fetchReadArtIdsByUid($uid); $signedDocIds = OfficialdocReader::model()->fetchSignArtIdsByUid($uid); foreach ($datas as $data) { $data["subject"] = StringUtil::cutStr($data["subject"], 50); $data["readStatus"] = in_array($data["docid"], $readDocIds) ? 1 : -1; if ($data["readStatus"] === -1 && TIMESTAMP - $checkTime < $data["uptime"]) { $data["readStatus"] = 2; } $data["signNum"] = OfficialdocReader::model()->count("issign = 1 AND docid = {$data["docid"]}"); $data["signStatus"] = in_array($data["docid"], $signedDocIds) ? 1 : 0; $data["author"] = isset($users[$data["author"]]) ? $users[$data["author"]]["realname"] : ""; $data["uptime"] = empty($data["uptime"]) ? $data["addtime"] : $data["uptime"]; $data["uptime"] = ConvertUtil::formatDate($data["uptime"], "u"); $keyword = EnvUtil::getRequest("keyword"); if (!empty($keyword)) { $data["subject"] = preg_replace("|({$keyword})|i", "<span style='color:red'>\$1</span>", $data["subject"]); } if ($data["ishighlight"] == "1") { $highLightStyle = $data["highlightstyle"]; $hiddenInput = "<input type='hidden' id='{$data["docid"]}_hlstyle' value='{$highLightStyle}'/>"; $data["subject"] .= $hiddenInput; $highLightStyleArr = explode(",", $highLightStyle); $color = $highLightStyleArr[1]; $isB = $highLightStyleArr[0]; $isI = $highLightStyleArr[2]; $isU = $highLightStyleArr[3]; $isB && ($data["subject"] = "<b>{$data["subject"]}</b>"); $isU && ($data["subject"] = "<u>{$data["subject"]}</u>"); $fontStyle = ""; $color != "" && ($fontStyle .= "color:{$color};"); $isI && ($fontStyle .= "font-style:italic;"); $fontStyle != "" && ($data["subject"] = "<font style='{$fontStyle}'>{$data["subject"]}</font>"); } $listDatas[] = $data; } return $listDatas; }