예제 #1
0
 /**
  * 回覧先グループを登録する
  *
  * @return  boolean (true:正常/false:異常)
  * @access	public
  */
 function entryGroupMember()
 {
     $groupId = $this->_request->getParameter('group_id');
     $groupName = $this->_request->getParameter('group_name');
     $groupMember = $this->_request->getParameter('group_member');
     $returnVal = "";
     if ($groupId) {
         $setParams = array('group_name' => $groupName, 'group_member' => $groupMember);
         $whereParams = array('user_id' => $this->_user_id, 'group_id' => $groupId);
         $result = $this->_db->updateExecute('circular_group', $setParams, $whereParams, true);
         if ($result === false) {
             $this->_db->addError();
             return false;
         }
         return true;
     } else {
         $myRoomPage = $this->_session->getParameter('_self_myroom_page');
         $insertParams = array('user_id' => $this->_user_id, 'group_name' => $groupName, 'group_member' => $groupMember, 'room_id' => $myRoomPage['page_id']);
         $groupId = $this->_db->insertExecute('circular_group', $insertParams, true, 'group_id');
         if ($groupId === false) {
             $this->_db->addError();
             return false;
         }
         return $groupId;
     }
 }
예제 #2
0
 /**
  * 権限判断用のSQL文WHERE句を取得する
  * パラメータ用配列に必要な値を追加する
  *
  * @param	array	$params	パラメータ用配列
  * @return string	権限判断用のSQL文WHERE句
  * @access	public
  */
 function &_getAuthorityWhereSQL(&$params)
 {
     $authID = $this->_session->getParameter("_auth_id");
     $sql = "";
     if ($authID >= _AUTH_CHIEF) {
         return $sql;
     }
     $sql .= "AND (A.hierarchy < ? OR C.insert_user_id = ?";
     $defaultEntry = $this->_session->getParameter("_default_entry_flag");
     $hierarchy = $this->_session->getParameter("_hierarchy");
     if ($defaultEntry == _ON && $hierarchy > $this->_session->getParameter("_default_entry_hierarchy")) {
         $sql .= " OR A.hierarchy IS NULL) ";
     } else {
         $sql .= ") ";
     }
     $params[] = $hierarchy;
     $params[] = $this->_session->getParameter("_user_id");
     return $sql;
 }