?> </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"> <?php echo implode(',', $toid); ?>
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")); } }
private function save() { $uid = Ibos::app()->user->uid; $realname = User::model()->fetchRealnameByUid($uid); $originalPlan = $planOutside = array(); if (array_key_exists("originalPlan", $_POST)) { $originalPlan = $_POST["originalPlan"]; } if (array_key_exists("planOutside", $_POST)) { $planOutside = array_filter($_POST["planOutside"], create_function("\$v", "return !empty(\$v[\"content\"]);")); } if (!empty($originalPlan)) { foreach ($originalPlan as $key => $value) { DiaryRecord::model()->modify($key, array("schedule" => $value)); } } $date = $_POST["todayDate"] . " " . Ibos::lang("Weekday", "date") . DateTimeUtil::getWeekDay(strtotime($_POST["todayDate"])); $shareUidArr = isset($_POST["shareuid"]) ? StringUtil::getId($_POST["shareuid"]) : array(); $diary = array("uid" => $uid, "diarytime" => strtotime($_POST["todayDate"]), "nextdiarytime" => strtotime($_POST["plantime"]), "addtime" => TIMESTAMP, "content" => $_POST["diaryContent"], "shareuid" => implode(",", $shareUidArr), "readeruid" => "", "remark" => "", "attention" => ""); if (!empty($_POST["attachmentid"])) { AttachUtil::updateAttach($_POST["attachmentid"]); } $diary["attachmentid"] = $_POST["attachmentid"]; $diaryId = Diary::model()->add($diary, true); if (!empty($planOutside)) { DiaryRecord::model()->addRecord($planOutside, $diaryId, strtotime($_POST["todayDate"]), $uid, "outside"); } $plan = array_filter($_POST["plan"], create_function("\$v", "return !empty(\$v[\"content\"]);")); DiaryRecord::model()->addRecord($plan, $diaryId, strtotime($_POST["plantime"]), $uid, "new"); $wbconf = WbCommonUtil::getSetting(true); if (isset($wbconf["wbmovement"]["diary"]) && $wbconf["wbmovement"]["diary"] == 1) { $supUid = UserUtil::getSupUid($uid); if (0 < intval($supUid)) { $data = array("title" => Ibos::lang("Feed title", "", array("{subject}" => $realname . " " . $date . " " . Ibos::lang("Work diary"), "{url}" => Ibos::app()->urlManager->createUrl("diary/review/show", array("diaryid" => $diaryId)))), "body" => StringUtil::cutStr($diary["content"], 140), "actdesc" => Ibos::lang("Post diary"), "userid" => $supUid, "deptid" => "", "positionid" => ""); WbfeedUtil::pushFeed($uid, "diary", "diary", $diaryId, $data); } } UserUtil::updateCreditByAction("adddiary", $uid); $upUid = UserUtil::getSupUid($uid); if (!empty($upUid)) { $config = array("{sender}" => User::model()->fetchRealnameByUid($uid), "{title}" => Ibos::lang("New diary title", "", array("{sub}" => $realname, "{date}" => $date)), "{content}" => $this->renderPartial("remindcontent", array("realname" => $realname, "date" => $date, "lang" => Ibos::getLangSources(), "originalPlan" => array_values($originalPlan), "planOutside" => array_values($planOutside), "content" => StringUtil::cutStr(strip_tags($_POST["diaryContent"]), 200), "plantime" => $_POST["plantime"] . " " . Ibos::lang("Weekday", "date") . DateTimeUtil::getWeekDay(strtotime($_POST["plantime"])), "plan" => array_values($plan)), true), "{url}" => Ibos::app()->urlManager->createUrl("diary/review/show", array("diaryid" => $diaryId))); Notify::model()->sendNotify($upUid, "diary_message", $config, $uid); } $this->success(Ibos::lang("Save succeed", "message"), $this->createUrl("default/index")); }
</div> <div class="page-list-mainer"> <?php foreach ($datas as $finishDate => $assignments) { ?> <div> <div class="fill-sn"> <div class="mini-date"> <strong><?php echo date("d", $finishDate); ?> </strong> <div class="mini-date-body"> <p><?php echo $lang["Weekday"]; echo DateTimeUtil::getWeekDay($finishDate); ?> </p> <p><?php echo date("Y-m", $finishDate); ?> </p> </div> </div> </div> <table class="table table-hover" data-node-type="taskTable"> <tbody> <?php foreach ($assignments as $k => $assignment) { ?> <tr data-id="<?php