/** * 期限を更新する * * @param string $circularId 回覧ID * @return boolean (true:正常/false:異常) * @access public */ function extendPeriod() { $columns = array('circular_id' => $this->_request->getParameter('circular_id'), 'period' => $this->_request->getParameter('period')); if (!$this->_db->updateExecute('circular', $columns, 'circular_id', true)) { return false; } return true; }
/** * ポータル(自分が作成者 または 回覧者の回覧を一覧表示する)画面用のデータを取得 * * @access public */ function getPortalCircular() { $moduleId = $this->_request->getParameter('module_id'); $fromStatement = "FROM {circular} C " . "LEFT JOIN {circular_user} U " . "ON C.circular_id = U.circular_id " . "AND U.receive_user_id = ? " . "AND U.reply_flag = ? " . "INNER JOIN {pages} P " . "ON C.room_id = P.room_id " . "INNER JOIN {blocks} B " . "ON P.page_id = B.page_id " . "AND B.module_id = ? " . "WHERE (C.post_user_id = ? " . "OR U.receive_user_id = ?) " . "AND (C.period = '' " . "OR C.period >= ? ) "; $sql = "SELECT MIN(B.block_id) AS block_id " . $fromStatement . "GROUP BY C.room_id"; $params = array($this->_user_id, CIRCULAR_LIST_TYPE_UNSEEN, $moduleId, $this->_user_id, $this->_user_id, timezone_date()); $blockIdString = $this->_db->execute($sql, $params, null, null, false, array($this, '_makeImplodeString')); if ($blockIdString === false) { $this->_db->addError(); return false; } if (empty($blockIdString)) { return array(); } $sql = "SELECT C.circular_id, " . "C.circular_subject, " . "C.icon_name, " . "C.period, " . "C.insert_user_name, " . "C.update_time, " . "B.block_id " . $fromStatement . "AND B.block_id IN (" . $blockIdString . ") " . "ORDER BY C.update_time DESC "; $result = $this->_db->execute($sql, $params, CIRCULAR_PORTAL_LIST_COUNT, null, true, array($this, "_callbackGetPortalCircular")); if ($result === false) { $this->_db->addError(); return false; } return $result; }