コード例 #1
0
 /**
  * タスクデータを削除する
  *
  * @return boolean	true or false
  * @access	public
  */
 function deleteTask()
 {
     $calendarAction =& $this->_container->getComponent("calendarAction");
     $task = $this->_request->getParameter("task");
     if (!empty($task["calendar_id"]) && !$calendarAction->deletePlan($task["calendar_id"], CALENDAR_PLAN_EDIT_THIS)) {
         return false;
     }
     $params = array("task_id" => $task["task_id"]);
     $sql = "SELECT task_sequence " . "FROM {todo_task} " . "WHERE task_id = ?";
     $sequences = $this->_db->execute($sql, $params, 1, null, false);
     if ($sequences === false) {
         $this->_db->addError();
         return false;
     }
     $sequence = $sequences[0][0];
     if (!$this->_db->deleteExecute("todo_task", $params)) {
         return false;
     }
     $params = array("todo_id" => $task["todo_id"]);
     $sequenceParam = array("task_sequence" => $sequence);
     if (!$this->_db->seqExecute("todo_task", $params, $sequenceParam)) {
         return false;
     }
     // -- 新着情報関連 Start --
     $whatsnewAction =& $this->_container->getComponent("whatsnewAction");
     $result = $whatsnewAction->delete($task["task_id"]);
     if ($result === false) {
         return false;
     }
     // -- 新着情報関連 End --
     return true;
 }
コード例 #2
0
 /**
  * カテゴリデータを取得する
  *
  * @return array	カテゴリデータ配列
  * @access	public
  */
 function &getCategories($todo_id)
 {
     $params = array($todo_id);
     $sql = "SELECT category_id, category_name " . "FROM {todo_category} " . "WHERE todo_id = ? " . "ORDER BY display_sequence";
     $result = $this->_db->execute($sql, $params);
     if ($result === false) {
         $this->_db->addError();
         return false;
     }
     if (empty($result)) {
         $commonMain =& $this->_container->getComponent("commonMain");
         $todoAction =& $commonMain->registerClass(WEBAPP_DIR . '/modules/todo/components/Action.class.php', "Todo_Components_Action", "todoAction");
         $result = $todoAction->setDefaultCategory($todo_id);
         if ($result == false) {
             return $result;
         }
         $result = array();
         $result[0] = array("category_id" => 0, "category_name" => "");
     }
     return $result;
 }
コード例 #3
0
 /**
  * _open_private_spaceがonならば、他人のプライベートスペースを見ている場合、他人の会員IDを返す(他人のプライベートスペースのリストをメニューに表示するため)
  * @param  string $current_user_id
  * @return string $user_id
  * @access	private
  */
 function _getUserIdByOpenPrivateSpace($current_user_id)
 {
     $session =& $this->_container->getComponent("Session");
     $getdata =& $this->_container->getComponent("GetData");
     $pages =& $getdata->getParameter("pages");
     $_open_private_space = $session->getParameter("_open_private_space");
     if ($_open_private_space == _OFF || !isset($pages[$session->getParameter("_main_page_id")]) || $pages[$session->getParameter("_main_page_id")]['private_flag'] == _OFF) {
         return $current_user_id;
     }
     if (!isset($pages[$pages[$session->getParameter("_main_page_id")]['room_id']])) {
         $pagesView =& $this->_container->getComponent("pagesView");
         $pages[$pages[$session->getParameter("_main_page_id")]['room_id']] = $pagesView->getPageById($pages[$session->getParameter("_main_page_id")]['room_id']);
     }
     if ($pages[$session->getParameter("_main_room_id")]['default_entry_flag'] == _ON) {
         // マイポータル
         return $pages[$pages[$session->getParameter("_main_room_id")]['room_id']]['insert_user_id'];
     } else {
         // マイルーム
         if ($current_user_id == "0" && ($_open_private_space == _OPEN_PRIVATE_SPACE_PUBLIC || $_open_private_space == _OPEN_PRIVATE_SPACE_MYPORTAL_PUBLIC) || $current_user_id != "0" && ($_open_private_space == _OPEN_PRIVATE_SPACE_GROUP || $_open_private_space == _OPEN_PRIVATE_SPACE_MYPORTAL_GROUP)) {
             return $pages[$pages[$session->getParameter("_main_room_id")]['room_id']]['insert_user_id'];
         }
     }
     return $current_user_id;
 }