Exemplo n.º 1
0
 public function actionIndex()
 {
     $op = EnvUtil::getRequest("op");
     if (!in_array($op, array("personal"))) {
         $date = "yesterday";
         if (array_key_exists("date", $_GET)) {
             $date = $_GET["date"];
         }
         if ($date == "today") {
             $time = strtotime(date("Y-m-d"));
             $date = date("Y-m-d");
         } elseif ($date == "yesterday") {
             $time = strtotime(date("Y-m-d")) - 24 * 60 * 60;
             $date = date("Y-m-d", $time);
         } else {
             $time = strtotime($date);
             $date = date("Y-m-d", $time);
         }
         $uid = Ibos::app()->user->uid;
         $condition = "FIND_IN_SET('{$uid}',shareuid) AND uid NOT IN({$uid}) AND diarytime={$time}";
         $paginationData = Diary::model()->fetchAllByPage($condition);
         $params = array("dateWeekDay" => DiaryUtil::getDateAndWeekDay(date("Y-m-d", strtotime($date))), "pagination" => $paginationData["pagination"], "data" => ICDiary::processShareListData($uid, $paginationData["data"]), "dashboardConfig" => $this->getDiaryConfig(), "attentionSwitch" => $this->issetAttention());
         $params["prevAndNextDate"] = array("prev" => date("Y-m-d", strtotime($date) - 24 * 60 * 60), "next" => date("Y-m-d", strtotime($date) + 24 * 60 * 60), "prevTime" => strtotime($date) - 24 * 60 * 60, "nextTime" => strtotime($date) + 24 * 60 * 60);
         $this->setPageTitle(Ibos::lang("Share diary"));
         $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Personal Office")), array("name" => Ibos::lang("Work diary"), "url" => $this->createUrl("default/index")), array("name" => Ibos::lang("Share diary"))));
         $this->render("index", $params);
     } else {
         $this->{$op}();
     }
 }
Exemplo n.º 2
0
 public function actionIndex()
 {
     $op = EnvUtil::getRequest("op");
     if (empty($op) || !in_array($op, array("default", "personal"))) {
         $op = "default";
     }
     if ($op == "default") {
         $date = "yesterday";
         if (array_key_exists("date", $_GET)) {
             $date = $_GET["date"];
         }
         if ($date == "today") {
             $time = strtotime(date("Y-m-d"));
             $date = date("Y-m-d");
         } elseif ($date == "yesterday") {
             $time = strtotime(date("Y-m-d")) - 24 * 60 * 60;
             $date = date("Y-m-d", $time);
         } else {
             $time = strtotime($date);
             $date = date("Y-m-d", $time);
         }
         $uid = Ibos::app()->user->uid;
         $attentions = DiaryAttention::model()->fetchAllByAttributes(array("uid" => $uid));
         $auidArr = ConvertUtil::getSubByKey($attentions, "auid");
         $hanAuidArr = $this->handleAuid($uid, $auidArr);
         $subUidStr = implode(",", $hanAuidArr["subUid"]);
         $auidStr = implode(",", $hanAuidArr["aUid"]);
         $condition = "(FIND_IN_SET(uid, '{$subUidStr}') OR (FIND_IN_SET('{$uid}', shareuid) AND FIND_IN_SET(uid, '{$auidStr}') ) ) AND diarytime={$time}";
         $paginationData = Diary::model()->fetchAllByPage($condition);
         $params = array("dateWeekDay" => DiaryUtil::getDateAndWeekDay(date("Y-m-d", strtotime($date))), "pagination" => $paginationData["pagination"], "data" => ICDiary::processShareListData($uid, $paginationData["data"]), "shareCommentSwitch" => $this->issetSharecomment(), "attentionSwitch" => $this->issetAttention());
         $params["prevAndNextDate"] = array("prev" => date("Y-m-d", strtotime($date) - 24 * 60 * 60), "next" => date("Y-m-d", strtotime($date) + 24 * 60 * 60), "prevTime" => strtotime($date) - 24 * 60 * 60, "nextTime" => strtotime($date) + 24 * 60 * 60);
         $this->setPageTitle(Ibos::lang("Attention diary"));
         $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Personal Office")), array("name" => Ibos::lang("Work diary"), "url" => $this->createUrl("default/index")), array("name" => Ibos::lang("Attention diary"))));
         $this->render("index", $params);
     } else {
         $this->{$op}();
     }
 }
Exemplo n.º 3
0
 public function actionAttention()
 {
     $date = "yesterday";
     if (array_key_exists("date", $_GET)) {
         $date = $_GET["date"];
     }
     if ($date == "today") {
         $time = strtotime(date("Y-m-d"));
         $date = date("Y-m-d");
     } elseif ($date == "yesterday") {
         $time = strtotime(date("Y-m-d")) - 24 * 60 * 60;
         $date = date("Y-m-d", $time);
     } else {
         $time = strtotime($date);
         $date = date("Y-m-d", $time);
     }
     $uid = Ibos::app()->user->uid;
     $attentions = DiaryAttention::model()->fetchAllByAttributes(array("uid" => $uid));
     $auidArr = ConvertUtil::getSubByKey($attentions, "auid");
     $hanAuidArr = $this->handleAuid($uid, $auidArr);
     $subUidStr = implode(",", $hanAuidArr["subUid"]);
     $auidStr = implode(",", $hanAuidArr["aUid"]);
     $condition = "(FIND_IN_SET(uid, '{$subUidStr}') OR (FIND_IN_SET('{$uid}', shareuid) AND FIND_IN_SET(uid, '{$auidStr}') ) ) AND diarytime={$time}";
     $paginationData = Diary::model()->fetchAllByPage($condition, 100);
     $params = array("dateWeekDay" => DiaryUtil::getDateAndWeekDay(date("Y-m-d", strtotime($date))), "pagination" => $paginationData["pagination"], "data" => ICDiary::processShareListData($uid, $paginationData["data"]), "shareCommentSwitch" => 0, "attentionSwitch" => 1);
     $params["prevAndNextDate"] = array("prev" => date("Y-m-d", strtotime($date) - 24 * 60 * 60), "next" => date("Y-m-d", strtotime($date) + 24 * 60 * 60), "prevTime" => strtotime($date) - 24 * 60 * 60, "nextTime" => strtotime($date) + 24 * 60 * 60);
     $this->ajaxReturn($params, "JSONP");
 }