function getDefaultView()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     if (!$this->get_execute_privilege()) {
         $controller->forward(SECURE_MODULE, SECURE_ACTION);
         return;
     }
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // get
     $bbs_open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D41'));
     $community_folder_open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D31'));
     $self_open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D00'));
     // カテゴリグループマスタ
     $category_group_master_row_array = ACSCommunity::get_category_group_master_row_array();
     foreach ($category_group_master_row_array as $index => $category_group_master_row) {
         // カテゴリグループごとのカテゴリマスタ
         $category_group_master_row_array[$index]['category_master_row_array'] = ACSCommunity::get_category_master_row_array_by_category_group_code($category_group_master_row['category_group_code']);
     }
     // set
     $request->setAttribute('bbs_open_level_master_row_array', $bbs_open_level_master_row_array);
     $request->setAttribute('community_folder_open_level_master_row_array', $community_folder_open_level_master_row_array);
     $request->setAttribute('category_group_master_row_array', $category_group_master_row_array);
     $request->setAttribute('self_open_level_master_row_array', $self_open_level_master_row_array);
     return View::INPUT;
 }
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 対象となるユーザコミュニティIDを取得
     $user_community_id = $request->ACSgetParameter('id');
     // 対象となるcontents_keyを取得
     $contents_key = $request->ACSgetParameter('contents_key');
     // 対象となるコンテンツ種別コードを取得
     $contents_type_code = $request->ACSgetParameter('contents_type_code');
     // コンテンツ種別マスタ
     $contents_type_master_array = ACSDB::get_master_array('contents_type');
     // 公開範囲
     $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D10'), $contents_type_master_array[$contents_type_code]);
     if ($acs_user_info_row['is_acs_user']) {
         // マイフレンズグループ
         $friends_group_row_array = ACSUser::get_friends_group_row_array($user_community_id);
     } else {
         $friends_group_row_array = array();
     }
     // set
     $request->setAttribute('contents_key', $contents_key);
     $request->setAttribute('contents_type_code', $contents_type_code);
     $request->setAttribute('open_level_master_row_array', $open_level_master_row_array);
     $request->setAttribute('friends_group_row_array', $friends_group_row_array);
     return View::SUCCESS;
 }
Exemplo n.º 3
0
 function getDefaultView()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 対象となるコミュニティIDを取得
     $community_id = $request->getParameter('community_id');
     // コミュニティ情報
     $community_row = ACSCommunity::get_community_profile_row($community_id);
     $community_row = ACSExternalRSS::add_contents_row_array($community_row);
     // BBS記事一覧
     $bbs_row_array = ACSBBS::get_bbs_row_array($community_id);
     foreach ($bbs_row_array as $index => $bbs_row) {
         // 信頼済みコミュニティ一覧
         $bbs_row_array[$index]['trusted_community_row_array'] = ACSBBS::get_bbs_trusted_community_row_array($bbs_row['bbs_id']);
         // 返信記事
         $bbs_row_array[$index]['bbs_res_row_array'] = ACSBBS::get_bbs_res_row_array($bbs_row['bbs_id']);
     }
     if ($community_row['contents_row_array']['self']['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D03')) {
         // 非公開コミュニティ
         $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D43'));
     } else {
         // 公開範囲
         $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D42'));
     }
     // set
     $request->setAttribute('community_row', $community_row);
     $request->setAttribute('bbs_row_array', $bbs_row_array);
     $request->setAttribute('open_level_master_row_array', $open_level_master_row_array);
     return View::INPUT;
 }
Exemplo n.º 4
0
 function getDefaultView()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 対象となるコミュニティIDを取得
     $community_id = $request->getParameter('community_id');
     // 対象となるbbs_idを取得
     $bbs_id = $request->getParameter('bbs_id');
     // コミュニティ情報
     $community_row = ACSCommunity::get_community_row($community_id);
     // BBS記事一覧
     $bbs_row = ACSBBS::get_bbs_row($bbs_id);
     // 信頼済みコミュニティ一覧
     $bbs_row['trusted_community_row_array'] = ACSBBS::get_bbs_trusted_community_row_array($bbs_row['bbs_id']);
     // 返信記事
     $bbs_row['bbs_res_row_array'] = ACSBBS::get_bbs_res_row_array($bbs_row['bbs_id']);
     // 公開範囲
     $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D42'));
     // 掲示板アクセス履歴
     if ($acs_user_info_row['is_acs_user']) {
         ACSBBS::set_bbs_access_history($acs_user_info_row['user_community_id'], $bbs_row['bbs_id']);
     }
     // set
     $request->setAttribute('community_row', $community_row);
     $request->setAttribute('bbs_row', $bbs_row);
     $request->setAttribute('open_level_master_row_array', $open_level_master_row_array);
     return View::INPUT;
 }
Exemplo n.º 5
0
 function getDefaultView()
 {
     $context =& $this->getContext();
     $user = $context->getUser();
     $request = $context->getRequest();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 表示対象となるユーザコミュニティIDを取得
     $user_community_id = $request->ACSgetParameter('id');
     // ユーザ情報
     $target_user_info_row = ACSUser::get_user_info_row_by_user_community_id($user_community_id);
     $year = $request->ACSgetParameter('year');
     // 年
     $month = $request->ACSgetParameter('month');
     // 月
     $day = $request->ACSgetParameter('day');
     // 日
     if (checkdate($month, $day, $year)) {
         // 年月日指定
         $diary_row_array = ACSDiary::get_diary_row_array_by_year_month_day($user_community_id, $year, $month, $day);
     } elseif (checkdate($month, 1, $year)) {
         // 年月指定
         $diary_row_array = ACSDiary::get_diary_row_array_by_year_month($user_community_id, $year, $month);
         unset($day);
     } else {
         // 全てのダイアリー
         $diary_row_array = ACSDiary::get_diary_row_array($user_community_id);
         unset($year);
         unset($month);
         unset($day);
     }
     // 公開範囲を最終登録と同じもので表示しておく
     if ($diary_row_array) {
         $last_open_level_code = $diary_row_array[0]['open_level_code'];
     }
     // 信頼済みコミュニティ情報
     foreach ($diary_row_array as $index => $diary_row) {
         if ($diary_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D05')) {
             $diary_row_array[$index]['trusted_community_row_array'] = ACSDiary::get_diary_trusted_community_row_array($diary_row['diary_id']);
         }
     }
     // 公開範囲
     $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D10'), ACSMsg::get_mst('contents_type_master', 'D21'));
     // マイフレンズグループ
     $friends_group_row_array = ACSUser::get_friends_group_row_array($user_community_id);
     // set
     $request->setAttribute('target_user_info_row', $target_user_info_row);
     $request->setAttribute('diary_row_array', $diary_row_array);
     $request->setAttribute('open_level_master_row_array', $open_level_master_row_array);
     $request->setAttribute('friends_group_row_array', $friends_group_row_array);
     $request->setAttribute('last_open_level_code', $last_open_level_code);
     return View::INPUT;
 }
 function getDefaultView()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     if (!$this->get_execute_privilege()) {
         $controller->forward(SECURE_MODULE, SECURE_ACTION);
         return;
     }
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // get
     $external_rss_url_open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D63'));
     // 対象となるコミュニティIDを取得
     $community_id = $request->ACSgetParameter('community_id');
     // コミュニティ情報
     $community_row = ACSCommunity::get_community_profile_row($community_id);
     $community_row = ACSExternalRSS::add_contents_row_array($community_row);
     // 入力エラー時の復元 //
     $form = $request->ACSGetParameters();
     if ($form['is_error']) {
         $community_row['contents_row_array']['external_rss_url']['contents_value'] = $form['external_rss_url'];
         $community_row['contents_row_array']['external_rss_url']['open_level_code'] = $form['external_rss_url_open_level_code'];
         $community_row['contents_row_array']['external_rss_url']['trusted_community_row_array'] = array();
         if (is_array($form['external_rss_url_trusted_community_id_array'])) {
             foreach ($form['external_rss_url_trusted_community_id_array'] as $trusted_community_id) {
                 array_push($community_row['contents_row_array']['external_rss_url']['trusted_community_row_array'], array('community_id' => $trusted_community_id));
             }
         }
         $community_row['contents_row_array']['external_rss_post_user']['contents_value'] = $form['external_rss_post_user'];
         $community_row['contents_row_array']['external_rss_public_release_expire_term']['contents_value'] = $form['external_rss_public_release_expire_term'];
         $community_row['contents_row_array']['external_rss_ml_send_flag']['contents_value'] = $form['external_rss_ml_send_flag'];
     }
     // 初期値 //
     // 投稿者
     if (!isset($community_row['contents_row_array']['external_rss_post_user']['contents_value'])) {
         $community_row['contents_row_array']['external_rss_post_user']['contents_value'] = $acs_user_info_row['user_community_id'];
     }
     // 公開範囲
     if (!isset($community_row['contents_row_array']['external_rss_url']['open_level_code'])) {
         $community_row['contents_row_array']['external_rss_url']['open_level_code'] = $community_row['contents_row_array']['bbs']['open_level_code'];
         $community_row['contents_row_array']['external_rss_url']['trusted_community_row_array'] = $community_row['contents_row_array']['bbs']['trusted_community_row_array'];
     }
     // コミュニティ管理者情報
     $community_admin_user_info_row_array = ACSCommunity::get_community_admin_user_info_row_array($community_row['community_id']);
     // set
     $request->setAttribute('community_row', $community_row);
     $request->setAttribute('community_admin_user_info_row_array', $community_admin_user_info_row_array);
     $request->setAttribute('external_rss_url_open_level_master_row_array', $external_rss_url_open_level_master_row_array);
     return View::INPUT;
 }
Exemplo n.º 7
0
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 表示対象となるコミュニティIDを取得
     $user_community_id = $request->ACSgetParameter('community_id');
     // ユーザ情報
     $target_user_info_row = ACSCommunity::get_community_profile_row($user_community_id);
     // 公開範囲のリストデータ
     $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D42'));
     // set
     $request->setAttribute('target_user_info_row', $target_user_info_row);
     $request->setAttribute('open_level_master_row_array', $open_level_master_row_array);
     return View::INPUT;
 }
 function getDefaultView()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     if (!$this->get_execute_privilege()) {
         $controller->forward(SECURE_MODULE, SECURE_ACTION);
         return;
     }
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // get
     $bbs_open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D41'));
     $community_folder_open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D31'));
     $self_open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D00'));
     // 対象となるコミュニティIDを取得
     $community_id = $request->ACSGetParameter('community_id');
     // コミュニティ情報
     $community_row = ACSCommunity::get_community_profile_row($community_id);
     // サブコミュニティ情報の一覧
     $sub_community_row_array = ACSCommunity::get_sub_community_row_array($community_id);
     // 親コミュニティ情報の一覧
     $parent_community_row_array = ACSCommunity::get_parent_community_row_array($community_id);
     $category_group_master_row_array = ACSCommunity::get_category_group_master_row_array();
     foreach ($category_group_master_row_array as $index => $category_group_master_row) {
         $category_group_master_row_array[$index]['category_master_row_array'] = ACSCommunity::get_category_master_row_array_by_category_group_code($category_group_master_row['category_group_code']);
     }
     // set
     $request->setAttribute('bbs_open_level_master_row_array', $bbs_open_level_master_row_array);
     $request->setAttribute('community_folder_open_level_master_row_array', $community_folder_open_level_master_row_array);
     $request->setAttribute('category_group_master_row_array', $category_group_master_row_array);
     $request->setAttribute('self_open_level_master_row_array', $self_open_level_master_row_array);
     $request->setAttribute('community_row', $community_row);
     $request->setAttribute('sub_community_row_array', $sub_community_row_array);
     $request->setAttribute('parent_community_row_array', $parent_community_row_array);
     return View::INPUT;
 }
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     // get
     $target_community_info_row = $request->getAttribute('target_community_info_row');
     $user_folder_obj = $request->getAttribute('user_folder_obj');
     $edit_folder_id = $request->getAttribute('edit_folder_id');
     $default_data_row = $request->getAttribute('default_data_row');
     // デフォルト値として表示する値
     $parent_community_row_array = $request->getAttribute('parent_community_row_array');
     $sub_community_row_array = $request->getAttribute('sub_community_row_array');
     $target_community_id = $target_community_info_row['community_id'];
     $view_mode = $request->getAttribute('view_mode');
     $target_community_info = '&community_id=' . $target_community_id;
     $folder_info = '&folder_id=' . $user_folder_obj->folder_obj->get_folder_id();
     if ($view_mode == 'update') {
         $edit_folder_info = '&edit_folder_id=' . $edit_folder_id;
     } else {
         $edit_folder_info = "";
     }
     // フォルダの所有者
     $_target_community_info_row['community_id'] = $target_community_info_row['community_id'];
     $_target_community_info_row['community_name'] = $target_community_info_row['community_name'];
     $_target_community_info_row['top_page_url'] = $this->getControllerPath('User', DEFAULT_ACTION);
     $_target_community_info_row['top_page_url'] .= $target_community_info;
     // 登録・更新処理URL
     $action_url = "";
     $action_url = $this->getControllerPath('Community', 'EditFolder');
     $action_url .= $target_community_info;
     $action_url .= $folder_info;
     $action_url .= $edit_folder_info;
     $action_url .= '&action_type=' . $view_mode;
     $cancel_url = "";
     if ($view_mode == 'create') {
         $cancel_url = $this->getControllerPath('Community', 'Folder');
         $cancel_url .= $target_community_info;
         $cancel_url .= $folder_info;
     } elseif ($view_mode == 'update') {
         $cancel_url = $this->getControllerPath('Community', 'FolderDetail');
         $cancel_url .= $target_community_info;
         $cancel_url .= $folder_info;
         $cancel_url .= '&detail_folder_id=' . $edit_folder_id;
     }
     // 公開範囲を設定できるかどうか
     $is_set_open_level_available = $user_folder_obj->is_set_open_level_available();
     // 公開範囲選択肢取得
     $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D32'));
     // デフォルト表示データがある場合、is_default を変更する
     if ($default_data_row) {
         $selected_open_level_code = $default_data_row['open_level_code'];
         $index_count = 0;
         foreach ($open_level_master_row_array as $open_level_master_row) {
             if ($open_level_master_row['open_level_code'] == $selected_open_level_code) {
                 $open_level_master_row_array[$index_count]['is_default'] = true;
             } else {
                 $open_level_master_row_array[$index_count]['is_default'] = false;
             }
             $index_count++;
         }
     }
     // -------------------------
     // 閲覧許可コミュニティ
     $trusted_community_row_array = array();
     // 親コミュニティ
     $parent_community_info_array = $this->make_trusted_community_row_array($controller, $parent_community_row_array);
     //array_push($trusted_community_row_array, $parent_community_row_array);
     // サブコミュニティ
     $sub_community_info_array = $this->make_trusted_community_row_array($controller, $sub_community_row_array);
     //array_push($trusted_community_row_array, $sub_community_row_array);
     // 選択されているコミュニティ
     $selected_trusted_community_row_array = ACSCommunity::get_each_community_row_array($default_data_row['trusted_community_id_array']);
     $selected_trusted_community_info_array = $this->make_trusted_community_row_array($controller, $selected_trusted_community_row_array);
     // デフォルトで表示する閲覧許可コミュニティを作成
     //$trusted_community_row_array = array_merge($parent_community_info_array, $sub_community_info_array, $selected_trusted_community_info_array);
     //$trusted_community_row_array = array_unique($trusted_community_row_array);
     // 閲覧許可コミュニティ追加URL
     #index.php?module=Community&action=SelectTrustedCommunity&form_name=folder_open_level_form
     $add_trusted_community_url = "";
     $add_trusted_community_url = $this->getControllerPath('Community', 'SelectTrustedCommunity');
     $add_trusted_community_url .= '&form_name=folder_info';
     // テンプレート
     $this->setScreenId("0001");
     $this->setTemplate('EditFolder.tpl.php');
     // set
     $this->setAttribute('target_community_info_row', $_target_community_info_row);
     $this->setAttribute('view_mode', $view_mode);
     $this->setAttribute('action_url', $action_url);
     $this->setAttribute('cancel_url', $cancel_url);
     $this->setAttribute('is_set_open_level_available', $is_set_open_level_available);
     $this->setAttribute('open_level_master_row_array', $open_level_master_row_array);
     $this->setAttribute('parent_community_info_array', $parent_community_info_array);
     $this->setAttribute('sub_community_info_array', $sub_community_info_array);
     $this->setAttribute('selected_trusted_community_info_array', $selected_trusted_community_info_array);
     $this->setAttribute('add_trusted_community_url', $add_trusted_community_url);
     //		$this->setAttribute('friends_group_row_array', $friends_group_row_array);
     $this->setAttribute('default_data_row', $default_data_row);
     // エラーメッセージ
     $this->setAttribute('error_message', $this->getErrorMessage($controller, $request, $user));
     return parent::execute();
 }
Exemplo n.º 10
0
 /**
  * フォルダ全体の公開範囲セット
  * ユーザのフォルダの場合は、一般公開
  *
  * @param $community_id
  */
 function set_contents_folder_open_level($community_id)
 {
     $open_level_code = "";
     $open_level_name = "";
     // フォルダ全体の公開範囲 一般公開を取得
     $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D10'), ACSMsg::get_mst('contents_type_master', 'D32'));
     foreach ($open_level_master_row_array as $open_level_master_row) {
         if ($open_level_master_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D01')) {
             $open_level_code = $open_level_master_row['open_level_code'];
             $open_level_name = $open_level_master_row['open_level_name'];
             break;
         }
     }
     $this->open_level_code = $open_level_code;
     $this->open_level_name = $open_level_name;
     // 閲覧許可コミュニティセット
     // 設定なし
     $this->set_contents_folder_trusted_community_row_array(array());
 }
Exemplo n.º 11
0
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     if (!$this->get_execute_privilege()) {
         $controller->forward(SECURE_MODULE, SECURE_ACTION);
         return;
     }
     //mode 画面の遷移を取得する
     $move_id = $request->getParameter('move_id');
     // 公開範囲
     $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D42'));
     // ユーザー情報
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 対象となるコミュニティIDを取得
     $community_id = $request->getParameter('community_id');
     $bbs_id = $request->getParameter('bbs_id');
     /* 入力画面より */
     if ($move_id == 1) {
         // 画面上のフォーム情報を取得する
         $form['subject'] = $request->getParameter('subject');
         //件名:subject
         // 本文
         $form['body'] = $request->getParameter('body');
         //内容:body
         $form['community_id'] = $community_id;
         //当コミュニティのID
         $form['user_community_id'] = $acs_user_info_row['user_community_id'];
         // 投稿者print "form_row:";
         $form['bbs_id'] = $bbs_id;
         // 投稿者print "form_row:";
         $user->setAttribute('new_form_obj', $form);
         return View::SUCCESS;
         /* 登録確定ボタン「はい」より */
     } else {
         if ($move_id == 2) {
             // 画面上のフォーム情報を取得する
             $form = $user->getAttribute('new_form_obj');
             // DBへの書き込み等
             $ret = ACSBBS::set_bbs_res($form);
             if ($ret) {
                 // 掲示板アクセス履歴へ記録
                 ACSBBS::set_bbs_access_history($acs_user_info_row['user_community_id'], $form['bbs_id']);
                 // bbs情報取得
                 $bbs_row = ACSBBS::get_bbs_row($request->getParameter('bbs_id'));
                 // MLオプションありの場合
                 if ($bbs_row['ml_send_flag'] == 't') {
                     // MLステータスの取得
                     $ml_status_row = ACSCommunity::get_contents_row($community_id, ACSMsg::get_mst('contents_type_master', 'D62'));
                     $ml_status = $ml_status_row['contents_value'];
                     // ML有りの場合メールを送信
                     if ($ml_status == 'ACTIVE') {
                         // "Re:"の削除
                         $subject_msg = mb_ereg_replace(ACS_COMMUNITY_ML_SUBJECT_PREFIX_CLEAR_REGEX, '', $form['subject']);
                         // 件名編集
                         $subject = "Re: " . str_replace('{BBSID}', $bbs_id, ACS_COMMUNITY_ML_SUBJECT_FORMAT) . $subject_msg;
                         // ML送信
                         ACSCommunityMail::send_community_mailing_list($community_id, $acs_user_info_row['mail_addr'], $subject, $form['body']);
                     }
                 }
             } else {
                 echo ACSMsg::get_msg('Community', 'BBSResPreAction.class.php', 'M001');
             }
             // 書き込み後、BBS Top 表示の処理へ
             $action_url = $this->getControllerPath('Community', 'BBS') . '&community_id=' . $community_id . '&move_id=4';
             header("Location: {$action_url}");
         }
     }
 }
Exemplo n.º 12
0
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     //mode 画面の遷移を取得する
     $move_id = $request->getParameter('move_id');
     // 公開範囲
     $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D10'), ACSMsg::get_mst('contents_type_master', 'D21'));
     // ユーザー情報
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 対象となるUserIDを取得
     $user_community_id = $request->getParameter('id');
     /* 入力画面より */
     if ($move_id == 1) {
         //☆☆ ここからほぼ同じ
         // 画面上のフォーム情報を取得する
         $form['subject'] = $request->getParameter('subject');
         //件名:subject
         $form['body'] = $request->getParameter('body');
         //内容:body
         $form['open_level_code'] = $request->getParameter('open_level_code');
         //公開範囲コード:open_level_code
         foreach ($open_level_master_row_array as $open_level_master_row) {
             if ($open_level_master_row['open_level_code'] == $form['open_level_code']) {
                 $form['open_level_name'] = htmlspecialchars($open_level_master_row['open_level_name']);
                 //公開範囲表示名:open_level_name
             }
         }
         $form['trusted_community_flag'] = $request->getParameter('trusted_community_flag');
         //マイフレンズグループを指定した場合
         $form['trusted_community_id_array'] = $request->getParameter('trusted_community_id_array');
         //選択したグループ群
         $form['new_file'] = $request->getParameter('new_file');
         //画像:new_file
         //ファイル情報のあるなしをチェックしておく
         if (!ini_get('mbstring.encoding_translation')) {
             $form['file_name'] = mb_convert_encoding($_FILES['new_file']['name'], mb_internal_encoding(), mb_http_output());
         } else {
             $form['file_name'] = $_FILES['new_file']['name'];
         }
         if ($form['file_name'] != '') {
             /* ディレクトリ存在チェック */
             // ない場合は作成する
             $to_dir = ACS_TEMPORARY_FILE_DIR;
             if (!file_exists($to_dir)) {
                 mkdir($to_dir);
                 chmod($to_dir, 0777);
             }
             //ファイルがある場合、仮置き場所を設定する
             $_FILES['new_file']['upload_tmp_dir'] = ACS_TEMPORARY_FILE_DIR;
             //仮置きのファイル名を設定する
             $type_name = session_id();
             $upload = $_FILES['new_file']['upload_tmp_dir'];
             $upload .= $type_name;
             if (!move_uploaded_file($_FILES['new_file']['tmp_name'], $upload)) {
                 echo "Read file failed.\n";
             }
             $_FILES['new_file']['tmp_name'] = $upload;
             $form['file_obj'] = $_FILES['new_file'];
             $user->setAttribute('new_file_info', $upload);
             $user->setAttribute('new_file_obj', $_FILES['new_file']);
         }
         $form['user_community_id'] = $user_community_id;
         $user->setAttribute('new_form_obj', $form);
         //☆☆ ここまでほぼ同じ
         return View::SUCCESS;
         /* 登録確定ボタン「はい」より */
     } else {
         if ($move_id == 2) {
             $user_community_id = $request->getParameter('id');
             //☆☆ ここからほぼ同じ
             // 画面上のフォーム情報を取得する
             $form = $user->getAttribute('new_form_obj');
             $new_file_obj = $form['file_obj'];
             // ☆☆ ここまでほぼ同じ
             // DBへの書き込み等
             ACSDB::_do_query("BEGIN");
             if ($form['file_name'] != "") {
                 //ファイル情報があった場合
                 //1.ファイル情報取得(新規)
                 $file_obj = ACSFile::get_upload_file_info_instance($user->getAttribute('new_file_obj'), $user_community_id, $form['user_community_id']);
                 if ($file_obj) {
                     //form情報へ登録
                     $form['new_file'] = $file_obj;
                 } else {
                     echo "Create file failed.";
                     return;
                 }
             }
             //2.Diaryテーブル情報
             $ret = ACSDiary::set_Diary($form);
             if ($ret) {
                 ACSDB::_do_query("COMMIT");
             } else {
                 ACSDB::_do_query("ROLLBACK");
             }
             // 書き込み後、GETの処理へ
             $diary_top_page_url = $this->getControllerPath('User', 'Diary') . '&id=' . $user_community_id;
             header("Location: {$diary_top_page_url}");
         }
     }
 }
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     // get
     $target_user_info_row = $request->getAttribute('target_user_info_row');
     $user_folder_obj = $request->getAttribute('user_folder_obj');
     $edit_folder_id = $request->getAttribute('edit_folder_id');
     $default_data_row = $request->getAttribute('default_data_row');
     // デフォルト値として表示する値
     $target_user_community_id = $target_user_info_row['user_community_id'];
     $view_mode = $request->getAttribute('view_mode');
     $target_user_info = '&id=' . $target_user_community_id;
     $folder_info = '&folder_id=' . $user_folder_obj->folder_obj->get_folder_id();
     if ($view_mode == 'update') {
         $edit_folder_info = '&edit_folder_id=' . $edit_folder_id;
     } else {
         $edit_folder_info = "";
     }
     // フォルダの所有者
     $_target_user_info_row['community_name'] = $target_user_info_row['community_name'];
     $_target_user_info_row['top_page_url'] = $this->getControllerPath('User', DEFAULT_ACTION);
     $_target_user_info_row['top_page_url'] .= $target_community_info;
     // 登録・更新処理URL
     $action_url = "";
     $action_url = $this->getControllerPath('User', 'EditFolder');
     $action_url .= $target_user_info;
     $action_url .= $folder_info;
     $action_url .= $edit_folder_info;
     $action_url .= '&action_type=' . $view_mode;
     $cancel_url = "";
     if ($view_mode == 'create') {
         $cancel_url = $this->getControllerPath('User', 'Folder');
         $cancel_url .= $target_user_info;
         $cancel_url .= $folder_info;
     } elseif ($view_mode == 'update') {
         $cancel_url = $this->getControllerPath('User', 'FolderDetail');
         $cancel_url .= $target_user_info;
         $cancel_url .= $folder_info;
         $cancel_url .= '&detail_folder_id=' . $edit_folder_id;
     }
     // 公開範囲を設定できるかどうか
     $is_set_open_level_available = $user_folder_obj->is_set_open_level_available();
     // 公開範囲選択肢取得
     $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D10'), ACSMsg::get_mst('contents_type_master', 'D32'));
     // デフォルト表示データがある場合、is_default を変更する
     if ($default_data_row) {
         $selected_open_level_code = $default_data_row['open_level_code'];
         $index_count = 0;
         foreach ($open_level_master_row_array as $open_level_master_row) {
             if ($open_level_master_row['open_level_code'] == $selected_open_level_code) {
                 $open_level_master_row_array[$index_count]['is_default'] = true;
             } else {
                 $open_level_master_row_array[$index_count]['is_default'] = false;
             }
             $index_count++;
         }
     }
     // マイフレンズグループ取得 (公開範囲「友人に公開」の選択肢)
     $friends_group_row_array = ACSUser::get_friends_group_row_array($target_user_info_row['user_community_id']);
     // 友人に公開の場合のオプションデフォルト値を追加
     // default_data_row に 'trusted_community_flag' を追加する
     $selected_trusted_community_id_array = $default_data_row['trusted_community_id_array'];
     // 「友人に公開」の 公開範囲コード取得
     foreach ($open_level_master_row_array as $open_level_master_row) {
         if ($open_level_master_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D05')) {
             $friends_open_level_code = $open_level_master_row['open_level_code'];
             break;
         }
     }
     if ($default_data_row['trusted_community_flag']) {
         // 選択された値がわかっている場合(エラーの場合)
         // そのままの値を使用する
     } elseif ($default_data_row['open_level_code'] != $friends_open_level_code) {
         // 全ての友人 をデフォルトにする
         $default_data_row['trusted_community_flag'] = '0';
     } elseif ($friends_group_row_array && $selected_trusted_community_id_array) {
         // 指定されているコミュニティIDが1つで、community_type がマイフレンズでないの場合
         //    マイフレンズグループ を選択する
         if (count($selected_trusted_community_id_array) == 1) {
             $_trusted_community_row = ACSCommunity::get_community_row($selected_trusted_community_id_array[0]);
             if ($_trusted_community_row['community_type_name'] != ACSMsg::get_mst('community_type_master', 'D20')) {
                 $default_data_row['trusted_community_flag'] = '1';
             } else {
                 $default_data_row['trusted_community_flag'] = '0';
             }
         } else {
             // 複数ある場合は、マイフレンズグループ
             $default_data_row['trusted_community_flag'] = '1';
         }
     } elseif ($default_data_row['open_level_code'] == $friends_open_level_code && !$selected_trusted_community_id_array) {
         // 友人に公開で、閲覧許可コミュニティがない場合は マイフレンズを選択
         $default_data_row['trusted_community_flag'] = '1';
     }
     // テンプレート
     $this->setScreenId("0001");
     $this->setTemplate('EditFolder.tpl.php');
     // set
     $this->setAttribute('target_user_info_row', $_target_user_info_row);
     $this->setAttribute('view_mode', $view_mode);
     $this->setAttribute('action_url', $action_url);
     $this->setAttribute('cancel_url', $cancel_url);
     $this->setAttribute('is_set_open_level_available', $is_set_open_level_available);
     $this->setAttribute('open_level_master_row_array', $open_level_master_row_array);
     $this->setAttribute('friends_group_row_array', $friends_group_row_array);
     $this->setAttribute('default_data_row', $default_data_row);
     // エラーメッセージ
     $this->setAttribute('error_message', $this->getErrorMessage($controller, $request, $user));
     return parent::execute();
 }
Exemplo n.º 14
0
 /**
  * フォルダ全体の公開範囲 (デフォルト) 取得
  *
  * @param  $community_type_name
  * @return open_level_row
  */
 static function select_folder_open_level_default_row($community_type_name)
 {
     $default_row = array();
     $row_array = ACSAccessControl::get_open_level_master_row_array($community_type_name, ACSMsg::get_mst('contents_type_master', 'D31'));
     foreach ($row_array as $row) {
         if ($row['is_default']) {
             $default_row = $row;
             break;
         }
     }
     return $default_row;
 }
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 表示対象となるコミュニティIDを取得
     $community_id = $request->ACSgetParameter('community_id');
     // コミュニティ情報
     $community_row = ACSCommunity::get_community_profile_row($community_id);
     //mode 画面の遷移を取得する
     $move_id = $request->getParameter('move_id');
     // 画面上のフォーム情報を取得する
     if ($move_id == 1) {
         $form = $request->getParameters('search_form_default');
     } else {
         if ($move_id == 2) {
             $form = $request->getParameters('search_form_new');
         }
     }
     // formの情報に従い検索を行う
     if ($move_id > 0) {
         $err_str = "";
         /*	Array
         			    [id] => 1000
         			    [move_id] => 2
         			    [q_text] => 検索条件					//条件(※必須)
         			    [search_title] => title_in_serch		//件名を選択
         			    [search_all] => subject_in_serch		//本文を選択
         			    [open_level_code] => 00					//公開範囲(00は選択なし)(※必須)
         			    [search_all_about] => all_in_serch		//すべてのBBSを選択
         			*/
         // ------------ 検索情報の取得(注意!バイト単位で処理)
         for ($i = 1; $i < 3; $i++) {
             $str_where_create[$i] = ACSBBS::set_bbs_where_list($form, $i);
             if ($str_where_create[$i]['err_str']) {
                 $err_str = $str_where_create[$i]['err_str'];
                 //where句の一部が作成できないオペレータミス
                 if ($err_str != '') {
                     break;
                 }
             } else {
                 $str_where[$i] = $str_where_create[$i]['like_sql'];
             }
         }
         //公開範囲は別指定
         $str_open_level_code = '00';
         if ($form['open_level_code'] != '00') {
             //公開範囲を選択している場合
             $str_open_level_code = $form['open_level_code'];
         }
         // ------------
         //db検索処理 and or 2回行う
         if (!$err_str) {
             $bbs_row_array_result = ACSBBS::get_bbs_where_array($str_where[1], $str_open_level_code, array());
             //複合条件のサマリ
             //and完全一致を省いた日記からor部分一致を検索する
             if ($str_where_create[1]['str_count'] == 2 || $str_where_create[2]['str_count'] == 2) {
                 $str_where_create['not_id'] = array();
                 foreach ($bbs_row_array_result as $index => $bbs_row) {
                     array_push($str_where_create['not_id'], $bbs_row['bbs_id']);
                 }
                 $bbs_row_array_not = ACSBBS::get_bbs_where_array($str_where[2], $str_open_level_code, $str_where_create['not_id']);
                 foreach ($bbs_row_array_not as $index => $bbs_row) {
                     array_push($bbs_row_array_result, $bbs_row);
                 }
             }
             if (!$bbs_row_array_result) {
                 $err_str = ACSMsg::get_msg('Community', 'SearchResultBBSAction.class.php', 'M001');
             } else {
                 // 信頼済みコミュニティ情報
                 foreach ($bbs_row_array_result as $index => $bbs_row) {
                     // 信頼済みコミュニティ一覧
                     $bbs_row_array[$index]['trusted_community_row_array'] = ACSBBS::get_bbs_trusted_community_row_array($bbs_row['bbs_id']);
                 }
             }
         }
     }
     $request->setAttribute('bbs_row_array_result', $bbs_row_array_result);
     $request->setAttribute('err_str', $err_str);
     $request->setAttribute('form_pre', $form);
     // 公開範囲
     $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D42'));
     // set
     $user->setAttribute('acs_user_info_row', $acs_user_info_row);
     $request->setAttribute('community_row', $community_row);
     $request->setAttribute('bbs_row_array', $bbs_row_array);
     $request->setAttribute('open_level_master_row_array', $open_level_master_row_array);
     //		$request->setAttribute('friends_group_row_array', $friends_group_row_array);
     return View::SUCCESS;
 }
Exemplo n.º 16
0
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     if (!$this->get_execute_privilege()) {
         $controller->forward(SECURE_MODULE, SECURE_ACTION);
         return;
     }
     //mode 画面の遷移を取得する
     $move_id = $request->getParameter('move_id');
     // 公開範囲
     $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D42'));
     // ユーザー情報
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 対象となるコミュニティIDを取得
     $community_id = $request->getParameter('community_id');
     //エラーの初期化
     /* 入力画面より */
     if ($move_id == 1) {
         $err = 'OK';
         //エラー値の初期化
         //☆☆ ここからほぼ同じ
         // 画面上のフォーム情報を取得する
         $form['subject'] = $request->getParameter('subject');
         //件名:subject
         $form['body'] = $request->getParameter('body');
         //内容:body
         $form['open_level_code'] = $request->getParameter('open_level_code');
         //公開範囲コード:open_level_code
         foreach ($open_level_master_row_array as $open_level_master_row) {
             if ($open_level_master_row['open_level_code'] == $form['open_level_code']) {
                 $form['open_level_name'] = htmlspecialchars($open_level_master_row['open_level_name']);
                 //公開範囲表示名:open_level_name
             }
         }
         $form['new_file'] = $request->getParameter('new_file');
         //画像:new_file
         //ファイル情報のあるなしをチェックしておく
         if (!ini_get('mbstring.encoding_translation')) {
             $form['file_name'] = mb_convert_encoding($_FILES['new_file']['name'], mb_internal_encoding(), mb_http_output());
         } else {
             $form['file_name'] = $_FILES['new_file']['name'];
         }
         if ($form['file_name'] != '') {
             /* ディレクトリ存在チェック */
             // ない場合は作成する
             $to_dir = ACS_TEMPORARY_FILE_DIR;
             if (!file_exists($to_dir)) {
                 mkdir($to_dir);
                 chmod($to_dir, 0777);
             }
             //ファイルがある場合、仮置き場所を設定する
             $_FILES['new_file']['upload_tmp_dir'] = ACS_TEMPORARY_FILE_DIR;
             //仮置きのファイル名を設定する
             $type_name = session_id();
             $upload = $_FILES['new_file']['upload_tmp_dir'];
             $upload .= $type_name;
             if (!move_uploaded_file($_FILES['new_file']['tmp_name'], $upload)) {
                 echo "ファイルの読み込みに失敗しました\n";
             }
             $_FILES['new_file']['tmp_name'] = $upload;
             $form['file_obj'] = $_FILES['new_file'];
             $user->setAttribute('new_file_info', $upload);
             $user->setAttribute('new_file_obj', $_FILES['new_file']);
         }
         $form['xdate'] = $request->getParameter('xdate');
         //掲載最終日:xdate
         //掲載最終日デフォルト値
         if ($form['xdate'] == '') {
             $form[xdate] = '';
         }
         //閲覧許可コミュニティ
         $form['trusted_community_id_array'] = $request->getParameter('trusted_community_id_array');
         $form['trusted_community_row_array'] = ACSCommunity::get_each_community_row_array($form['trusted_community_id_array']);
         $form['community_id'] = $community_id;
         //当コミュニティのID
         $form['user_community_id'] = $acs_user_info_row['user_community_id'];
         // 投稿者print "form_row:";
         // ML送信オプション
         $form['is_ml_send'] = $request->getParameter('is_ml_send');
         //画像:new_file
         //☆☆ ここまでほぼ同じ
         $user->setAttribute('new_form_obj', $form);
         return View::SUCCESS;
         /* 登録確定ボタン「はい」より */
     } else {
         if ($move_id == 2) {
             //☆☆ ここからほぼ同
             // 画面上のフォーム情報を取得する
             $form = $user->getAttribute('new_form_obj');
             $new_file_obj = $form['file_obj'];
             //☆☆ ここまでほぼ同じ
             // DBへの書き込み等
             ACSDB::_do_query("BEGIN");
             if ($form['file_name'] != "") {
                 //ファイル情報があった場合
                 //1.ファイル情報取得(新規)
                 $file_obj = ACSFile::get_upload_file_info_instance($user->getAttribute('new_file_obj'), $community_id, $form['user_community_id']);
                 //form情報へ登録
                 $form['new_file'] = $file_obj;
             }
             //2.bbsテーブル情報
             $ret = ACSBBS::set_bbs($form);
             if ($ret) {
                 ACSDB::_do_query("COMMIT");
                 // 掲示板アクセス履歴
                 ACSBBS::set_bbs_access_history($acs_user_info_row['user_community_id'], $ret);
             } else {
                 ACSDB::_do_query("ROLLBACK");
             }
             $bbs_id_seq = $ret;
             // MLオプションありの場合
             if ($form['is_ml_send'] == 't') {
                 // MLステータスの取得
                 $ml_status_row = ACSCommunity::get_contents_row($community_id, ACSMsg::get_mst('contents_type_master', 'D62'));
                 $ml_status = $ml_status_row['contents_value'];
                 // ML有りの場合メールを送信
                 if ($bbs_id_seq && $ml_status == 'ACTIVE') {
                     // 件名編集
                     $subject = str_replace('{BBSID}', $bbs_id_seq, ACS_COMMUNITY_ML_SUBJECT_FORMAT) . $form['subject'];
                     // ML送信
                     ACSCommunityMail::send_community_mailing_list($community_id, $acs_user_info_row['mail_addr'], $subject, $form['body']);
                 }
             }
             $action_url = $this->getControllerPath('Community', 'BBS') . '&community_id=' . $community_id . '&move_id=4';
             header("Location: {$action_url}");
         }
     }
 }