function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     $form = $form = $request->ACSGetParameters();
     // 対象となるコミュニティIDを取得
     $community_id = $request->ACSgetParameter('community_id');
     // コミュニティ情報
     $community_row = ACSCommunity::get_community_profile_row($community_id);
     // 承認が必要か
     $is_admission_required = ACSCommunity::is_admission_required_for_join_community($acs_user_info_row['user_community_id'], $community_id);
     // forward
     $done_obj = new ACSDone();
     $done_obj->set_message(ACSMsg::get_msg('Community', 'JoinCommunityAction.class.php', 'M003'));
     $done_obj->add_link($community_row['community_name'] . ' ' . ACSMsg::get_msg('Community', 'JoinCommunityAction.class.php', 'M004'), $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $community_row['community_id']);
     if ($is_admission_required) {
         // コミュニティ参加承認待ち登録
         $waiting_id = ACSWaiting::set_waiting_for_join_community($community_id, $acs_user_info_row['user_community_id'], $form['message']);
         // 参加承認依頼通知メール
         ACSWaiting::send_admission_request_notify_mail($waiting_id);
         $done_obj->set_title(ACSMsg::get_msg('Community', 'JoinCommunityAction.class.php', 'M001'));
     } else {
         // コミュニティメンバ登録
         $community_member_form = array();
         $community_member_form['community_id'] = $community_id;
         $community_member_form['user_community_id'] = $acs_user_info_row['user_community_id'];
         ACSCommunity::set_community_member($community_member_form);
         $done_obj->set_title(ACSMsg::get_msg('Community', 'JoinCommunityAction.class.php', 'M002'));
     }
     $request->setAttribute('done_obj', $done_obj);
     $controller->forward('Common', 'Done');
 }
Пример #2
0
 function execute()
 {
     $context =& $this->getContext();
     $controller = $context->getController();
     $user = $context->getUser();
     $request = $context->getRequest();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 対象となるコミュニティIDを取得
     $community_id = $request->ACSGetParameter('community_id');
     // コミュニティ存在チェック
     $community_row = ACSCommunity::get_community_row($community_id);
     if (!$community_row || $community_row['community_type_name'] != ACSMsg::get_mst('community_type_master', 'D40')) {
         return View::ERROR;
     }
     // 権限チェック
     if (!$this->get_execute_privilege()) {
         $controller->forward(SECURE_MODULE, SECURE_ACTION);
         return;
     }
     // コミュニティ情報
     $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);
     // コミュニティメンバ, コミュニティ管理者
     $community_member_user_info_row_array = ACSCommunity::get_community_member_user_info_row_array($community_id);
     $community_admin_user_info_row_array = ACSCommunity::get_community_admin_user_info_row_array($community_id);
     // 待機: コミュニティ参加 承認待ち
     $waiting_for_join_community_row_array = ACSWaiting::get_waiting_row_array($community_id, ACSMsg::get_mst('waiting_type_master', 'D20'), ACSMsg::get_mst('waiting_status_master', 'D10'));
     // 待機: 親コミュニティ追加, サブコミュニティ追加
     $waiting_for_parent_community_link_row_array = ACSWaiting::get_waiting_row_array($community_id, ACSMsg::get_mst('waiting_type_master', 'D40'), ACSMsg::get_mst('waiting_status_master', 'D10'));
     $waiting_for_sub_community_link_row_array = ACSWaiting::get_waiting_row_array($community_id, ACSMsg::get_mst('waiting_type_master', 'D50'), ACSMsg::get_mst('waiting_status_master', 'D10'));
     // 最新情報: BBS
     // 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']);
     }
     // set
     $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);
     $request->setAttribute('community_member_user_info_row_array', $community_member_user_info_row_array);
     $request->setAttribute('community_admin_user_info_row_array', $community_admin_user_info_row_array);
     $request->setAttribute('waiting_for_join_community_row_array', $waiting_for_join_community_row_array);
     $request->setAttribute('waiting_for_parent_community_link_row_array', $waiting_for_parent_community_link_row_array);
     $request->setAttribute('waiting_for_sub_community_link_row_array', $waiting_for_sub_community_link_row_array);
     $request->setAttribute('bbs_row_array', $bbs_row_array);
     return View::SUCCESS;
 }
 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;
     }
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     $form = $form = $request->ACSGetParameters();
     // 対象となるコミュニティIDを取得
     $community_id = $request->ACSgetParameter('community_id');
     // コミュニティ情報
     $community_row = ACSCommunity::get_community_profile_row($community_id);
     ACSDB::_do_query("BEGIN");
     // 生成されたwaiting_idの配列
     $waiting_id_array = array();
     foreach ($form['user_community_id_array'] as $invited_user_community_id) {
         // コミュニティ招待承認待ち登録
         $waiting_id = ACSWaiting::set_waiting_for_invite_to_community($invited_user_community_id, $community_id, $acs_user_info_row['user_community_id'], $form['message']);
         if (!$waiting_id) {
             ACSDB::_do_query("ROLLBACK");
             break;
         }
         // 生成されたwaiting情報を保持
         array_push($waiting_id_array, $waiting_id);
     }
     if ($waiting_id) {
         ACSDB::_do_query("COMMIT");
     }
     // 生成されたwaiting情報を元に複数メール送信
     foreach ($waiting_id_array as $waiting_id) {
         // コミュニティ招待承認依頼通知メール
         ACSWaiting::send_admission_request_notify_mail($waiting_id);
     }
     // forward
     $done_obj = new ACSDone();
     $done_obj->set_title(ACSMsg::get_msg('Community', 'InviteToCommunityAction.class.php', 'M001'));
     $done_obj->set_message(ACSMsg::get_msg('Community', 'InviteToCommunityAction.class.php', 'M002'));
     $done_obj->add_link(ACSMsg::get_tag_replace(ACSMsg::get_msg('Community', 'InviteToCommunityAction.class.php', 'BACK_TO_CM'), array("{COMMUNITY_NAME}" => $community_row['community_name'])), $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $community_row['community_id']);
     $request->setAttribute('done_obj', $done_obj);
     $controller->forward('Common', 'Done');
 }
Пример #4
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->getParameter('id');
     $form = $request->ACSGetParameters();
     // マイフレンズ追加 承認待ち を登録する
     $waiting_id = ACSWaiting::set_waiting_for_add_friends($user_community_id, $acs_user_info_row['user_community_id'], $form['message']);
     // マイフレンズ追加 承認依頼通知メール
     ACSWaiting::send_admission_request_notify_mail($waiting_id);
     // forward
     $done_obj = new ACSDone();
     $done_obj->set_title(ACSMsg::get_msg('User', 'AddFriendsAction.class.php', 'M001'));
     $done_obj->set_message(ACSMsg::get_msg('User', 'AddFriendsAction.class.php', 'M002'));
     $done_obj->add_link(ACSMsg::get_msg('User', 'AddFriendsAction.class.php', 'M003'), './');
     $request->setAttribute('done_obj', $done_obj);
     $controller->forward('Common', 'Done');
 }
 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;
     }
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 対象となるコミュニティIDを取得
     $community_id = $request->ACSgetParameter('community_id');
     $form = $request->ACSGetParameters();
     // コミュニティ情報
     $community_row = ACSCommunity::get_community_profile_row($community_id);
     // forward
     $done_obj = new ACSDone();
     ACSDB::_do_query("BEGIN");
     // 生成されたwaiting_idの配列
     $waiting_id_array = array();
     $ret = 1;
     // 1:成功 / 0:失敗
     foreach ($form['trusted_community_id_array'] as $link_community_id) {
         if (ACSCommunity::is_community_admin($acs_user_info_row['user_community_id'], $link_community_id)) {
             // リンク依頼先コミュニティの管理者である場合は承認待ち登録せずに、即座にリンクを追加する
             if ($form['link_type'] == 'parent') {
                 $ret = ACSCommunity::set_community_link($link_community_id, $community_id);
             } elseif ($form['link_type'] == 'sub') {
                 $ret = ACSCommunity::set_community_link($community_id, $link_community_id);
             }
         } else {
             if ($form['link_type'] == 'parent') {
                 // 親コミュニティ追加承認待ち登録
                 $waiting_id = ACSWaiting::set_waiting_for_parent_community_link($link_community_id, $community_id, $acs_user_info_row['user_community_id'], $form['message']);
             } elseif ($form['link_type'] == 'sub') {
                 // サブコミュニティ追加承認待ち登録
                 $waiting_id = ACSWaiting::set_waiting_for_sub_community_link($link_community_id, $community_id, $acs_user_info_row['user_community_id'], $form['message']);
             }
             if ($waiting_id) {
                 // 生成されたwaiting情報を保持
                 array_push($waiting_id_array, $waiting_id);
             } else {
                 $ret = 0;
             }
         }
         if (!$ret) {
             ACSDB::_do_query("ROLLBACK");
             break;
         }
     }
     if ($ret) {
         // COMMIT
         ACSDB::_do_query("COMMIT");
         // 生成されたwaiting情報を元に複数メール送信
         foreach ($waiting_id_array as $waiting_id) {
             // コミュニティ間リンク追加依頼通知メール
             ACSWaiting::send_admission_request_notify_mail($waiting_id);
         }
         $done_obj->set_title(ACSMsg::get_msg('Community', 'AddCommunityLinkAction.class.php', 'M001'));
         $done_obj->set_message(ACSMsg::get_msg('Community', 'AddCommunityLinkAction.class.php', 'M002'));
         $done_obj->add_link(ACSMsg::get_msg('Community', 'AddCommunityLinkAction.class.php', 'M003'), $this->getControllerPath('Community', 'CommunityLink') . '&community_id=' . $community_row['community_id']);
         $done_obj->add_link($community_row['community_name'] . ' ' . ACSMsg::get_msg('Community', 'AddCommunityLinkAction.class.php', 'M004'), $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $community_row['community_id']);
     } else {
         $done_obj->set_message('失敗しました。');
     }
     $request->setAttribute('done_obj', $done_obj);
     $controller->forward('Common', 'Done');
 }
 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を取得
     $form = $request->ACSgetParameters();
     // 待機情報
     $waiting_row = ACSWaiting::get_waiting_row($form['waiting_id']);
     // ACSDone
     $done_obj = new ACSDone();
     if ($form['accept_button']) {
         // 承認ボタン押下時 //
         ACSDB::_do_query("BEGIN");
         if ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D10')) {
             $ret = ACSUser::set_friends($waiting_row['community_id'], $waiting_row['waiting_community_id']);
         } elseif ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D30')) {
             $community_member_form = array('community_id' => $waiting_row['waiting_community_id'], 'user_community_id' => $waiting_row['community_id']);
             $ret = ACSCommunity::set_community_member($community_member_form);
         }
         if ($ret) {
             // 承認済みをセット
             $ret = ACSWaiting::update_waiting_waiting_status_code($form['waiting_id'], ACSMsg::get_mst('waiting_status_master', 'D20'), $acs_user_info_row['user_community_id'], $form['reply_message']);
             if ($ret) {
                 ACSDB::_do_query("COMMIT");
                 // 整合性保持
                 if ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D10')) {
                     // マイフレンズ追加の双方向の重複を解除
                     ACSWaiting::update_waiting_for_add_friends($waiting_row['community_id'], $waiting_row['waiting_community_id']);
                 } elseif ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D30')) {
                     // 招待の重複を解除
                     ACSWaiting::update_waiting_for_invite_to_community($waiting_row['community_id'], $waiting_row['waiting_community_id']);
                     // 参加の重複を解除
                     ACSWaiting::update_waiting_for_join_community($waiting_row['waiting_community_id'], $waiting_row['community_id']);
                 }
                 // 返信メッセージ
                 if ($form['reply_message'] != '') {
                     $ret = ACSWaiting::send_admission_accept_notify_mail($form['waiting_id']);
                 }
                 //$done_obj->set_title("$waiting_row[waiting_type_name] 承認完了");
                 $done_obj->set_title(ACSMsg::get_tag_replace(ACSMsg::get_msg('User', 'WaitingListAction.class.php', 'FIN_ADM'), array("{WAITING_TYPE_NAME}" => $waiting_row[waiting_type_name])));
                 $done_obj->set_message(ACSMsg::get_msg('User', 'WaitingListAction.class.php', 'M001'));
             } else {
                 $done_obj->set_message(ACSMsg::get_msg('User', 'WaitingListAction.class.php', 'M002'));
             }
         } else {
             ACSDB::_do_query("ROLLBACK");
         }
     } elseif ($form['reject_button']) {
         // 拒否ボタン押下時 //
         $ret = ACSWaiting::update_waiting_waiting_status_code($form['waiting_id'], ACSMsg::get_mst('waiting_status_master', 'D30'), $acs_user_info_row['user_community_id']);
         if ($ret) {
             //$done_obj->set_title("$waiting_row[waiting_type_name] 拒否完了");
             $done_obj->set_title(ACSMsg::get_tag_replace(ACSMsg::get_msg('User', 'WaitingListAction.class.php', 'FIN_DIS'), array("{WAITING_TYPE_NAME}" => $waiting_row[waiting_type_name])));
             $done_obj->set_message(ACSMsg::get_msg('User', 'WaitingListAction.class.php', 'M001'));
         } else {
             $done_obj->set_message(ACSMsg::get_msg('User', 'WaitingListAction.class.php', 'M002'));
         }
     }
     $done_obj->add_link(ACSMsg::get_msg('User', 'WaitingListAction.class.php', 'M003'), './');
     $request->setAttribute('done_obj', $done_obj);
     $controller->forward('Common', 'Done');
 }
 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を取得
     $form = $request->ACSgetParameters();
     // 待機種別マスタ
     $waiting_type_master_array = ACSDB::get_master_array('waiting_type');
     // 待機状態マスタ
     $waiting_status_master_array = ACSDB::get_master_array('waiting_status');
     // 待機情報
     $waiting_row = ACSWaiting::get_waiting_row($form['waiting_id']);
     // コミュニティ情報
     $community_row = ACSCommunity::get_community_row($waiting_row['community_id']);
     // forward
     $done_obj = new ACSDone();
     if ($form['accept_button']) {
         // 承認ボタン押下時 //
         ACSDB::_do_query("BEGIN");
         if ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D20')) {
             // コミュニティメンバ追加
             $community_member_form = array();
             $community_member_form['community_id'] = $waiting_row['community_id'];
             $community_member_form['user_community_id'] = $waiting_row['waiting_community_id'];
             $ret = ACSCommunity::set_community_member($community_member_form);
         } elseif ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D40')) {
             // コミュニティ間リンク設定
             $ret = ACSCommunity::set_community_link($waiting_row['community_id'], $waiting_row['waiting_community_id']);
         } elseif ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D50')) {
             // コミュニティ間リンク設定
             $ret = ACSCommunity::set_community_link($waiting_row['waiting_community_id'], $waiting_row['community_id']);
         }
         if ($ret) {
             // 承認済みをセット
             $ret = ACSWaiting::update_waiting_waiting_status_code($form['waiting_id'], ACSMsg::get_mst('waiting_status_master', 'D20'), $acs_user_info_row['user_community_id'], $form['reply_message']);
             if ($ret) {
                 ACSDB::_do_query("COMMIT");
                 // 整合性保持
                 if ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D20')) {
                     // 参加の重複を解除
                     ACSWaiting::update_waiting_for_join_community($waiting_row['community_id'], $waiting_row['waiting_community_id']);
                     // 招待の重複を解除
                     ACSWaiting::update_waiting_for_invite_to_community($waiting_row['waiting_community_id'], $waiting_row['community_id']);
                 } elseif ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D40')) {
                     // 親コミュニティ追加の重複解除
                     ACSWaiting::update_waiting_for_parent_community_link($waiting_row['community_id'], $waiting_row['waiting_community_id']);
                     // サブコミュニティ追加の重複解除
                     ACSWaiting::update_waiting_for_sub_community_link($waiting_row['waiting_community_id'], $waiting_row['community_id']);
                 } elseif ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D50')) {
                     // サブコミュニティ追加の重複解除
                     ACSWaiting::update_waiting_for_sub_community_link($waiting_row['community_id'], $waiting_row['waiting_community_id']);
                     // 親コミュニティ追加の重複解除
                     ACSWaiting::update_waiting_for_parent_community_link($waiting_row['waiting_community_id'], $waiting_row['community_id']);
                 }
                 // 返信メッセージ
                 if ($form['reply_message'] != '') {
                     $ret = ACSWaiting::send_admission_accept_notify_mail($form['waiting_id']);
                 }
                 $done_obj->set_title(ACSMsg::get_tag_replace(ACSMsg::get_msg('Community', 'WaitingListAction.class.php', 'FIN_ADM'), array("{WAITING_TYPE_NAME}" => $waiting_row[waiting_type_name])));
                 $done_obj->set_message(ACSMsg::get_msg('Community', 'WaitingListAction.class.php', 'M001'));
             } else {
                 $done_obj->set_message(ACSMsg::get_msg('Community', 'WaitingListAction.class.php', 'M002'));
             }
         } else {
             ACSDB::_do_query("ROLLBACK");
         }
     } elseif ($form['reject_button']) {
         // 拒否ボタン押下時
         $ret = ACSWaiting::update_waiting_waiting_status_code($form['waiting_id'], ACSMsg::get_mst('waiting_status_master', 'D30'), $acs_user_info_row['user_community_id']);
         if ($ret) {
             $done_obj->set_title(ACSMsg::get_tag_replace(ACSMsg::get_msg('Community', 'WaitingListAction.class.php', 'FIN_DIS'), array("{WAITING_TYPE_NAME}" => $waiting_row[waiting_type_name])));
             $done_obj->set_message(ACSMsg::get_msg('Community', 'WaitingListAction.class.php', 'M001'));
         } else {
             $done_obj->set_message(ACSMsg::get_msg('Community', 'WaitingListAction.class.php', 'M002'));
         }
     }
     $done_obj->add_link(ACSMsg::get_tag_replace(ACSMsg::get_msg('Community', 'WaitingListAction.class.php', 'BACK_TO_CM'), array("{COMMUNITY_NAME}" => $community_row['community_name'])), $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $community_row['community_id']);
     $request->setAttribute('done_obj', $done_obj);
     $controller->forward('Common', 'Done');
 }
Пример #8
0
 function execute()
 {
     $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');
     if (empty($user_community_id)) {
         $user_community_id = $acs_user_info_row['user_community_id'];
     }
     // 表示対象のユーザが存在しない場合は、エラーを表示
     if (!ACSUser::get_user_info_row_by_user_community_id($user_community_id)) {
         // 未ログインの時はPublic/Indexに遷移
         header("Location: ./index.php?module=Public&action=Index");
         //			return View::ERROR;
     }
     // 自身のページか
     if ($acs_user_info_row['user_community_id'] == $user_community_id) {
         $is_self_page = 1;
     } else {
         $is_self_page = 0;
     }
     // プロフィール
     $target_user_info_row = ACSUser::get_user_profile_row($user_community_id);
     // マイフレンズ
     $friends_row_array = ACSUser::get_simple_friends_row_array($user_community_id);
     // マイコミュニティ
     $community_row_array = ACSUser::get_community_row_array($user_community_id);
     // 最終ログイン
     // ログイン済みの場合
     if ($acs_user_info_row['is_login_user']) {
         $last_login_row = ACSCommunity::get_contents_row($user_community_id, ACSMsg::get_mst('contents_type_master', 'D52'));
     }
     // マイページデザインを取得する
     $selection_css_row = ACSCommunity::get_contents_row($user_community_id, ACSMsg::get_mst('contents_type_master', 'D53'));
     $selection_css = $selection_css_row['contents_value'] == '' ? ACS_DEFAULT_SELECTION_CSS_FILE : $selection_css_row['contents_value'];
     $waiting_for_join_community_row_array_array = array();
     $waiting_for_parent_community_link_row_array_array = array();
     $waiting_for_sub_community_link_row_array_array = array();
     foreach ($community_row_array as $index => $community_row) {
         $community_row_array[$index]['contents_row_array']['self'] = ACSCommunity::get_contents_row($community_row['community_id'], ACSMsg::get_mst('contents_type_master', 'D00'));
         $community_row_array[$index]['is_community_admin'] = ACSCommunity::is_community_admin($acs_user_info_row['user_community_id'], $community_row['community_id']);
         $community_row_array[$index]['is_community_member'] = ACSCommunity::is_community_member($acs_user_info_row['user_community_id'], $community_row['community_id']);
         if ($is_self_page) {
             // 待機: コミュニティ参加 承認待ち (自分のマイコミュニティ)
             if ($community_row['is_community_admin'] && ($waiting_row_array = ACSWaiting::get_waiting_row_array($community_row['community_id'], ACSMsg::get_mst('waiting_type_master', 'D20'), ACSMsg::get_mst('waiting_status_master', 'D10')))) {
                 $waiting_for_join_community_row_array['waiting_row_array'] = $waiting_row_array;
                 $waiting_for_join_community_row_array['community_row'] = $community_row;
                 array_push($waiting_for_join_community_row_array_array, $waiting_for_join_community_row_array);
             }
             // 待機: 親コミュニティ追加 承認待ち
             if ($community_row['is_community_admin'] && ($waiting_row_array = ACSWaiting::get_waiting_row_array($community_row['community_id'], ACSMsg::get_mst('waiting_type_master', 'D40'), ACSMsg::get_mst('waiting_status_master', 'D10')))) {
                 $waiting_for_parent_community_link_row_array['waiting_row_array'] = $waiting_row_array;
                 $waiting_for_parent_community_link_row_array['community_row'] = $community_row;
                 array_push($waiting_for_parent_community_link_row_array_array, $waiting_for_parent_community_link_row_array);
             }
             // 待機: サブコミュニティ追加 承認待ち
             if ($community_row['is_community_admin'] && ($waiting_row_array = ACSWaiting::get_waiting_row_array($community_row['community_id'], ACSMsg::get_mst('waiting_type_master', 'D50'), ACSMsg::get_mst('waiting_status_master', 'D10')))) {
                 $waiting_for_sub_community_link_row_array['waiting_row_array'] = $waiting_row_array;
                 $waiting_for_sub_community_link_row_array['community_row'] = $community_row;
                 array_push($waiting_for_sub_community_link_row_array_array, $waiting_for_sub_community_link_row_array);
             }
         }
     }
     if ($is_self_page) {
         // 待機: マイフレンズ追加 承認待ち
         $waiting_for_add_friends_row_array = ACSWaiting::get_waiting_row_array($user_community_id, ACSMsg::get_mst('waiting_type_master', 'D10'), ACSMsg::get_mst('waiting_status_master', 'D10'));
         // 待機: コミュニティ招待 承認待ち
         $waiting_for_invite_to_community_row_array = ACSWaiting::get_waiting_row_array($user_community_id, ACSMsg::get_mst('waiting_type_master', 'D30'), ACSMsg::get_mst('waiting_status_master', 'D10'));
         // マイダイアリーの新着コメント
         $new_comment_diary_row_array = ACSDiary::get_new_comment_diary_row_array($user_community_id);
         // 新着メッセージ
         $new_message_row_array = ACSMessage::get_new_message_row_array($user_community_id);
         // システムからのお知らせ
         $system_announce_row_array = ACSSystemAnnounce::get_valid_system_announce_row_array();
     }
     // set
     $request->setAttribute('user_community_id', $user_community_id);
     $request->setAttribute('target_user_info_row', $target_user_info_row);
     $request->setAttribute('is_self_page', $is_self_page);
     $request->setAttribute('friends_row_array', $friends_row_array);
     $request->setAttribute('community_row_array', $community_row_array);
     $request->setAttribute('waiting_for_add_friends_row_array', $waiting_for_add_friends_row_array);
     $request->setAttribute('waiting_for_join_community_row_array_array', $waiting_for_join_community_row_array_array);
     $request->setAttribute('waiting_for_parent_community_link_row_array_array', $waiting_for_parent_community_link_row_array_array);
     $request->setAttribute('waiting_for_sub_community_link_row_array_array', $waiting_for_sub_community_link_row_array_array);
     $request->setAttribute('waiting_for_invite_to_community_row_array', $waiting_for_invite_to_community_row_array);
     $request->setAttribute('new_comment_diary_row_array', $new_comment_diary_row_array);
     $request->setAttribute('system_announce_row_array', $system_announce_row_array);
     $request->setAttribute('last_login', $last_login_row['contents_value']);
     $request->setAttribute('selection_css', $selection_css);
     $request->setAttribute('new_message_row_array', $new_message_row_array);
     return View::SUCCESS;
 }
Пример #9
0
 /**
  * 依頼承諾メールを送信する
  *
  * @param $waiting_id 待機ID
  * @param $return 成功(true) / 失敗(false)
  * @return 
  */
 static function send_admission_accept_notify_mail($waiting_id)
 {
     // 待機情報
     $waiting_row = ACSWaiting::get_waiting_row($waiting_id);
     // システムURL
     $system_base_url = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_URL');
     // システムログインURL
     $system_base_login_url = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_LOGIN_URL');
     // システムのメールアドレス (From:)
     $system_mail_addr = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_MAIL_ADDR');
     // 利用者の言語設定を一時的に保存
     $org_lang = ACSMsg::get_lang();
     // 各言語のタイトルを取得
     $mail_titles = array();
     foreach (ACSMsg::get_lang_list_array() as $lang_key => $lang_name) {
         ACSMsg::set_lang($lang_key);
         $mail_titles[$lang_key] = ACSMsg::get_serial_msg('lib', 'ACSWaiting.class.php', 'MTL%03d') . "\n";
     }
     // 言語を一旦元に戻す
     ACSMsg::set_lang($org_lang);
     if ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D10')) {
         // 承認側のユーザ情報
         $user_info_row = ACSUser::get_user_profile_row($waiting_row['community_id']);
         // 承認される側のユーザ情報
         $target_user_info_row = ACSUser::get_user_profile_row($waiting_row['waiting_community_id']);
         $target_lang = ACSMsg::get_mail_lang_by_inforow($target_user_info_row);
         // 一旦依頼される側の言語に設定する
         ACSMsg::set_lang($target_lang);
         $body = $mail_titles[$target_lang];
         $body .= ACSMsg::get_tag_replace(ACSMsg::get_serial_msg('lib', 'ACSWaiting.class.php', 'AMF%03d'), array("{TARGET_USER_NAME}" => $target_user_info_row['user_name'], "{USER_NAME}" => $user_info_row['user_name'], "{USER_COMMUNITY_NAME}" => $user_info_row['community_name'], "{MESSAGE}" => trim($waiting_row['reply_message']), "{SYSTEM_BASE_URL}" => $system_base_url));
         $subject = ACSMsg::get_mdmsg(__FILE__, 'M006');
         $ret = ACSLib::send_mail($system_mail_addr, $target_user_info_row['mail_addr'], null, $subject, $body);
         // 言語を元に戻す
         ACSMsg::set_lang($org_lang);
     } elseif ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D20')) {
         // 承認側のコミュニティ情報
         $community_row = ACSCommunity::get_community_row($waiting_row['community_id']);
         // 承認される側のユーザ情報
         $target_user_info_row = ACSUser::get_user_profile_row($waiting_row['waiting_community_id']);
         // 待機承認URL
         $waiting_url = $system_base_login_url . SCRIPT_PATH;
         $waiting_url .= "?" . MODULE_ACCESSOR . "=Community";
         $waiting_url .= "&" . ACTION_ACCESSOR . "=WaitingList";
         $waiting_url .= "&community_id={$waiting_row['community_id']}";
         $waiting_url .= "&waiting_type_code={$waiting_row['waiting_type_code']}";
         $waiting_url .= "&waiting_status_code={$waiting_status_code}";
         $target_lang = ACSMsg::get_mail_lang_by_inforow($target_user_info_row);
         // 一旦依頼される側の言語に設定する
         ACSMsg::set_lang($target_lang);
         $body = $mail_titles[$target_lang];
         $body .= ACSMsg::get_tag_replace(ACSMsg::get_serial_msg('lib', 'ACSWaiting.class.php', 'ACM%03d'), array("{TARGET_USER_NAME}" => $target_user_info_row['user_name'], "{COMMUNITY_NAME}" => $community_row['community_name'], "{MESSAGE}" => trim($waiting_row['reply_message']), "{SYSTEM_BASE_URL}" => $system_base_url));
         $subject = ACSMsg::get_mdmsg(__FILE__, 'M007');
         // 言語を元に戻す
         ACSMsg::set_lang($org_lang);
         $ret = ACSLib::send_mail($system_mail_addr, $target_user_info_row['mail_addr'], null, $subject, $body);
     } elseif ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D30')) {
         // 招待されたコミュニティ情報
         $community_row = ACSCommunity::get_community_row($waiting_row['waiting_community_id']);
         // 承認側のユーザ情報
         $user_info_row = ACSUser::get_user_profile_row($waiting_row['community_id']);
         // 承認された側のユーザ情報
         $target_user_info_row = ACSUser::get_user_profile_row($waiting_row['entry_user_community_id']);
         // コミュニティトップページURL
         $community_top_page_url = $system_base_login_url . SCRIPT_PATH;
         $community_top_page_url .= "?" . MODULE_ACCESSOR . "=Community";
         $community_top_page_url .= "&" . ACTION_ACCESSOR . "=" . DEFAULT_ACTION;
         $community_top_page_url .= "&community_id=" . $community_row['community_id'];
         $target_lang = ACSMsg::get_mail_lang_by_inforow($target_user_info_row);
         // 一旦依頼される側の言語に設定する
         ACSMsg::set_lang($target_lang);
         $body = $mail_titles[$target_lang];
         $body .= ACSMsg::get_tag_replace(ACSMsg::get_serial_msg('lib', 'ACSWaiting.class.php', 'AIM%03d'), array("{TARGET_USER_NAME}" => $target_user_info_row['user_name'], "{USER_NAME}" => $user_info_row['user_name'], "{USER_COMMUNITY_NAME}" => $user_info_row['community_name'], "{COMMUNITY_NAME}" => $community_row['community_name'], "{COMMUNITY_URL}" => $community_top_page_url, "{MESSAGE}" => trim($waiting_row['reply_message']), "{SYSTEM_BASE_URL}" => $system_base_url));
         $subject = ACSMsg::get_mdmsg(__FILE__, 'M004');
         // 言語を元に戻す
         ACSMsg::set_lang($org_lang);
         $ret = ACSLib::send_mail($system_mail_addr, $target_user_info_row['mail_addr'], null, $subject, $body);
     } elseif ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D40') || $waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D50')) {
         // 承認側のコミュニティ情報
         $community_row = ACSCommunity::get_community_row($waiting_row['community_id']);
         // 承認される側コミュニティ情報
         $target_community_row = ACSCommunity::get_community_row($waiting_row['waiting_community_id']);
         // 承認される側のコミュニティ管理者情報の配列
         $community_admin_user_info_row_array = ACSCommunity::get_community_admin_user_info_row_array($target_community_row['community_id']);
         // コミュニティトップページURL
         $community_top_page_url = $system_base_login_url . SCRIPT_PATH;
         $community_top_page_url .= "?" . MODULE_ACCESSOR . "=Community";
         $community_top_page_url .= "&" . ACTION_ACCESSOR . "=" . DEFAULT_ACTION;
         $community_top_page_url .= "&community_id=" . $community_row['community_id'];
         foreach ($community_admin_user_info_row_array as $community_admin_user_info_row) {
             $community_admin_user_info_row = ACSUser::get_user_profile_row($community_admin_user_info_row['user_community_id']);
             $target_lang = ACSMsg::get_mail_lang_by_inforow($community_admin_user_info_row);
             // 一旦依頼される側の言語に設定する
             ACSMsg::set_lang($target_lang);
             $body = $mail_titles[$target_lang];
             $body .= ACSMsg::get_tag_replace(ACSMsg::get_serial_msg('lib', 'ACSWaiting.class.php', 'ACL%03d'), array("{TARGET_COMMUNITY_NAME}" => $target_community_row['community_name'], "{COMMUNITY_NAME}" => $community_row['community_name'], "{WAITING_TYPE_NAME}" => $waiting_row['waiting_type_name'], "{COMMUNITY_URL}" => $community_top_page_url, "{MESSAGE}" => trim($waiting_row['reply_message']), "{SYSTEM_BASE_URL}" => $system_base_url));
             $subject = ACSMsg::get_mdmsg(__FILE__, 'M009');
             $ret = ACSLib::send_mail($system_mail_addr, $community_admin_user_info_row['mail_addr'], null, $subject, $body);
         }
         // 言語を元に戻す
         ACSMsg::set_lang($org_lang);
     }
     return $ret;
 }