/**
  * ファイル履歴情報を登録する
  *
  * @param $file_info_row ファイル情報
  * @param $update_user_community_id 登録/更新者のユーザコミュニティID
  * @param $comment コメント
  * @param $file_history_operation_name ファイル履歴操作名
  * @return 成功(file_history_id) / 失敗(false)
  */
 static function set_file_history($file_info_row, $update_user_community_id, $comment, $file_history_operation_name)
 {
     $file_history_operation_master_array = ACSDB::get_master_array('file_history_operation');
     $file_history_id_seq = ACSDB::get_next_seq('file_history_id_seq');
     $file_history_operation_code = array_search($file_history_operation_name, $file_history_operation_master_array);
     ACSLib::escape_sql_array($file_info_row);
     ACSLib::get_sql_value_array($file_info_row);
     // ファイル履歴を登録
     $sql = "INSERT INTO file_history";
     $sql .= " (file_history_id, file_id, display_file_name, server_file_name, thumbnail_server_file_name, mime_type, file_size, update_date, update_user_community_id, file_history_operation_code)";
     $sql .= " VALUES ({$file_history_id_seq}, {$file_info_row['file_id']}, {$file_info_row['display_file_name']}, {$file_info_row['server_file_name']}, {$file_info_row['thumbnail_server_file_name']}, {$file_info_row['mime_type']}, {$file_info_row['file_size']}, {$file_info_row['update_date']}, '{$update_user_community_id}', '{$file_history_operation_code}')";
     $ret = ACSDB::_do_query($sql);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         return $ret;
     }
     // ファイル履歴コメントを登録
     $ret = ACSFileHistoryComment::set_file_history_comment($file_history_id_seq, $update_user_community_id, $comment);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         return $ret;
     }
     // trueの場合はファイル履歴IDをセット
     if ($ret) {
         $ret = $file_history_id_seq;
     }
     return $ret;
 }
 /**
  * file_access_history UPDATE
  *
  * @param $form ファイルアクセス履歴情報
  * @return 成功(true) / 失敗(false)
  */
 static function update_file_access_history($form)
 {
     ACSLib::escape_sql_array($form);
     ACSLib::get_sql_value_array($form);
     $sql = "UPDATE file_access_history" . " SET" . "  access_date = " . $form['access_date'] . " WHERE user_community_id = " . $form['user_community_id'] . "  AND file_id = " . $form['file_id'];
     $ret = ACSDB::_do_query($sql);
     return $ret;
 }
 /**
  * waiting INSERT
  *
  * @param $form 待機コミュニティメンバ情報
  * @return 成功(true) / 失敗(false)
  */
 static function insert_waiting($form)
 {
     ACSLib::escape_sql_array($form);
     ACSLib::get_sql_value_array($form);
     $sql = "INSERT INTO waiting";
     $sql .= " (waiting_id, community_id, waiting_community_id, waiting_type_code, waiting_status_code, message, entry_user_community_id)";
     $sql .= " VALUES ({$form['waiting_id']}, {$form['community_id']}, {$form['waiting_community_id']}, {$form['waiting_type_code']}, {$form['waiting_status_code']}, {$form['message']}, {$form['entry_user_community_id']})";
     $ret = ACSDB::_do_query($sql);
     return $ret;
 }
 static function insert_community_member($form)
 {
     ACSLib::escape_sql_array($form);
     ACSLib::get_sql_value_array($form);
     $sql = "INSERT INTO community_member";
     $sql .= " (community_id, user_community_id, community_member_type_code)";
     $sql .= " VALUES ({$form['community_id']}, {$form['user_community_id']}, {$form['community_member_type_code']})";
     $ret = ACSDB::_do_query($sql);
     return $ret;
 }
 /**
  * システムアナウンスを登録する
  *
  * @param システムアナウンス情報
  * @return 成功(true) / 失敗(false)
  */
 static function set_system_announce($form)
 {
     ACSLib::escape_sql_array($form);
     ACSLib::get_sql_value_array($form);
     $system_announce_id_seq = ACSDB::get_next_seq('system_announce_id_seq');
     $sql = "INSERT INTO system_announce";
     $sql .= " (system_announce_id, user_community_id, subject, body, expire_date)";
     $sql .= " VALUES ({$system_announce_id_seq}, {$form['user_community_id']}, {$form['subject']}, {$form['body']}, {$form['expire_date']})";
     ACSDB::_do_query($sql);
     return $ret;
 }
 /**
  * bbs_access_history UPDATE
  *
  * @param $form 掲示板アクセス履歴情報
  * @return 成功(true) / 失敗(false)
  */
 static function update_bbs_access_history($form)
 {
     ACSLib::escape_sql_array($form);
     ACSLib::get_sql_value_array($form);
     $sql = "UPDATE bbs_access_history";
     $sql .= " SET";
     $sql .= "  access_date = {$form['access_date']}";
     $sql .= " WHERE user_community_id = {$form['user_community_id']}";
     $sql .= "  AND bbs_id = {$form['bbs_id']}";
     $ret = ACSDB::_do_query($sql);
     return $ret;
 }
 /**
  * ファイルコンテンツを登録する
  *
  * @param 
  * @param 
  * @return 
  */
 static function set_file_detail_info($file_id, $file_category_code, $file_contents_form_array)
 {
     $file_id = pg_escape_string($file_id);
     $file_category_code = pg_escape_string($file_category_code);
     ACSDB::_do_query("BEGIN");
     // DELETE: file_detail_info
     $sql = "DELETE";
     $sql .= " FROM file_detail_info";
     $sql .= " WHERE file_id = '{$file_id}'";
     $ret = ACSDB::_do_query($sql);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         return $ret;
     }
     // DELETE: file_contents
     $sql = "DELETE";
     $sql .= " FROM file_contents";
     $sql .= " WHERE file_id = '{$file_id}'";
     $ret = ACSDB::_do_query($sql);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         return $ret;
     }
     // INSERT: detail_file_info
     $sql = "INSERT INTO file_detail_info";
     $sql .= " (file_id, file_category_code)";
     $sql .= " VALUES ('{$file_id}', '{$file_category_code}')";
     $ret = ACSDB::_do_query($sql);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         return $ret;
     }
     // INSERT: file_contents
     foreach ($file_contents_form_array as $file_contents_form) {
         ACSLib::escape_sql_array($file_contents_form);
         ACSLib::get_sql_value_array($file_contents_form);
         $sql = "INSERT INTO file_contents";
         $sql .= " (file_id, file_contents_type_code, file_contents_value)";
         $sql .= " VALUES ({$file_contents_form['file_id']}, {$file_contents_form['file_contents_type_code']}, {$file_contents_form['file_contents_value']})";
         $ret = ACSDB::_do_query($sql);
         if (!$ret) {
             ACSDB::_do_query("ROLLBACK");
             return $ret;
         }
     }
     ACSDB::_do_query("COMMIT");
     return $ret;
 }
示例#8
0
 /**
  * ユーザ情報を更新する(管理者)
  * name,password,mail_addr のみ更新対象となる
  * @param $form 変更情報
  * @return true(成功) / false(失敗)
  */
 static function update_user_info($form)
 {
     // コンテンツ種別マスタ
     $contents_type_master_array = ACSDB::get_master_array('contents_type');
     // コンテンツ種別コード
     $user_name_contents_type_code = array_search(ACSMsg::get_mst('contents_type_master', 'D01'), $contents_type_master_array);
     $mail_addr_contents_type_code = array_search(ACSMsg::get_mst('contents_type_master', 'D02'), $contents_type_master_array);
     $org_form = $form;
     ACSLib::escape_sql_array($form);
     ACSLib::get_sql_value_array($form);
     // BEGIN
     ACSDB::_do_query("BEGIN");
     // ユーザIDが変更された場合
     if ($form['old_user_id'] != $form['user_id']) {
         // (0) ユーザID
         $sql = "UPDATE user_info";
         $sql .= " SET user_id = {$form['user_id']}";
         $sql .= " WHERE user_community_id = {$form['user_community_id']}";
         $ret = ACSDB::_do_query($sql);
         if (!$ret) {
             ACSDB::_do_query("ROLLBACK");
             return $ret;
         }
         // パスワードユーザの場合
         if (ACSSystem::is_htpasswd_user($org_form['old_user_id'])) {
             $ret = ACSSystem::update_passwd_with_userid($org_form['user_id'], $org_form['old_user_id']);
             if (!$ret) {
                 ACSDB::_do_query("ROLLBACK");
                 return $ret;
             }
         }
     }
     // (1) 氏名
     $sql = "UPDATE contents";
     $sql .= " SET contents_value = {$form['user_name']}";
     $sql .= " WHERE community_id = {$form['user_community_id']}";
     $sql .= " AND contents_type_code = '{$user_name_contents_type_code}'";
     $ret = ACSDB::_do_query($sql);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         return $ret;
     }
     // (2) メールアドレス
     $sql = "UPDATE contents";
     $sql .= " SET contents_value = {$form['mail_addr']}";
     $sql .= " WHERE community_id = {$form['user_community_id']}";
     $sql .= " AND contents_type_code = '{$mail_addr_contents_type_code}'";
     $ret = ACSDB::_do_query($sql);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         return $ret;
     }
     // COMMIT
     ACSDB::_do_query("COMMIT");
     // (3) パスワードファイル
     if ($org_form['passwd_change'] == 'change_on') {
         $ret = ACSSystem::update_passwd($org_form['user_id'], $org_form['passwd']);
     }
     return $ret;
 }
示例#9
0
 /**
  * BBSファイル情報array取得
  * @param $where_list 検索用条件指定
  */
 static function get_bbs_where_array($where_list, $open_lebel_cd, $no_array)
 {
     $sql = "SELECT *";
     $sql .= " FROM bbs INNER JOIN open_level_master ON bbs.open_level_code = open_level_master.open_level_code";
     $sql .= " WHERE bbs.bbs_delete_flag = 'f'";
     if ($open_lebel_cd != '00') {
         $sql .= "  AND bbs.open_level_code ='{$open_lebel_cd}'";
     }
     if ($where_list != '') {
         $sql .= $where_list;
     }
     if (count($no_array) > 0) {
         $no_array = ACSLib::get_sql_value_array($no_array);
         $sql .= " AND bbs.bbs_id NOT IN (" . implode(", ", $no_array) . ")";
     }
     $sql .= " ORDER BY bbs.post_date DESC";
     $row_array = ACSDB::_get_row_array($sql);
     return $row_array;
 }
示例#10
0
 /**
  * フォルダ挿入
  *
  * @param  $folder_row
  * @param  $trusted_community_id_array
  * @return true / false
  */
 static function insert_folder($folder_row, $trusted_community_id_array = '')
 {
     ACSLib::escape_sql_array($folder_row);
     ACSLib::get_sql_value_array($folder_row);
     $sql = "INSERT INTO folder";
     $sql .= " (folder_id, community_id, folder_name, comment, parent_folder_id, ";
     $sql .= "entry_user_community_id, entry_date, ";
     $sql .= "update_user_community_id, update_date, open_level_code)";
     $sql .= " VALUES (";
     $sql .= $folder_row['folder_id'] . ",";
     $sql .= $folder_row['community_id'] . ",";
     $sql .= $folder_row['folder_name'] . ",";
     $sql .= $folder_row['comment'] . ",";
     $sql .= $folder_row['parent_folder_id'] . ",";
     $sql .= $folder_row['entry_user_community_id'] . ",";
     $sql .= $folder_row['entry_date'] . ",";
     $sql .= $folder_row['update_user_community_id'] . ",";
     $sql .= $folder_row['update_date'] . ",";
     $sql .= $folder_row['open_level_code'];
     $sql .= ")";
     $ret = ACSDB::_do_query($sql);
     if (!$ret) {
         return $ret;
     }
     // フォルダ閲覧許可コミュニティ挿入
     if ($trusted_community_id_array) {
         $ret = ACSFolderModel::insert_folder_trusted_community($folder_row['folder_id'], $trusted_community_id_array);
         if (!$ret) {
             return $ret;
         }
     }
     return $ret;
 }
示例#11
0
 /**
  * ログを登録する
  *
  * @param $acs_user_info_row ACSユーザ情報
  * @param $operation_type_name 操作名
  * @param $operation_result 操作結果 (true/false)
  * @param $message メッセージ
  * @return 成功(true) / 失敗(false)
  */
 static function set_log_debug($user_community_id, $message)
 {
     // ログIDのシーケンス取得
     $log_id_seq = ACSDB::get_next_seq('log_id_seq');
     // INSERTデータ
     $form['log_id'] = $log_id_seq;
     $form['log_date'] = 'now';
     $form['user_id'] = 'debug';
     $form['user_name'] = 'anonymous';
     $form['user_community_id'] = $user_community_id;
     $form['community_name'] = 'DEBUG';
     $form['administrator_flag'] = false;
     $form['operation_code'] = '9999';
     $form['operation_result'] = true;
     $form['message'] = $message;
     // escape
     ACSLib::escape_sql_array($form);
     ACSLib::get_sql_value_array($form);
     $sql = "INSERT INTO log (log_id, log_date, user_id, user_name, user_community_id, community_name, administrator_flag, operation_code, operation_result, message)";
     $sql .= " VALUES ( {$log_id_seq}, 'now', 'debug', 'anonymous', {$user_community_id}, 'DEBUG', false, '9999', true, '{$message}')";
     $ret = ACSDB::_do_query($sql);
     //		return $ret;
     return null;
 }
示例#12
0
 /**
  * RSS情報を登録する
  *
  * @param $form フォーム情報
  * @param $rss_channel_row <channel>
  * @param $rss_item_row <item>
  * @return 成功(true) / 失敗(false)
  */
 static function set_bbs_and_external_rss($form, $rss_channel_row, $rss_item_row)
 {
     $org_form = $form;
     ACSLib::escape_sql_array($form);
     ACSLib::get_sql_value_array($form);
     // BEGIN
     ACSDB::_do_query("BEGIN");
     $bbs_id_seq = ACSDB::get_next_seq('bbs_id_seq');
     // bbs
     $sql = "INSERT INTO bbs";
     $sql .= " (bbs_id, community_id, user_community_id, subject, body, open_level_code, expire_date, ml_send_flag)";
     $sql .= " VALUES ({$bbs_id_seq}, {$form['community_id']}, {$form['user_community_id']}, {$form['subject']}, {$form['body']}, {$form['open_level_code']}, ";
     $sql .= ($org_form['expire_date'] != NULL ? $org_form['expire_date'] : "null") . ", {$form['ml_send_flag']})";
     $ret = ACSDB::_do_query($sql);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         return $ret;
     }
     $form = $org_form;
     // bbs_trusted_community
     $open_level_master_array = ACSDB::get_master_array('open_level');
     // 非公開 (メンバのみ)
     if ($open_level_master_array[$form['open_level_code']] == ACSMsg::get_mst('open_level_master', 'D04')) {
         foreach ($form['trusted_community_row_array'] as $trusted_community_row) {
             $trusted_community_id = pg_escape_string($trusted_community_row['community_id']);
             $sql = "INSERT INTO bbs_trusted_community";
             $sql .= " (bbs_id, trusted_community_id)";
             $sql .= " VALUES ({$bbs_id_seq}, {$trusted_community_id})";
             $ret = ACSDB::_do_query($sql);
             if (!$ret) {
                 ACSDB::_do_query("ROLLBACK");
                 return $ret;
             }
         }
     }
     // external_rss
     ACSLib::escape_sql_array($rss_item_row);
     ACSLib::get_sql_value_array($rss_item_row);
     ACSLib::escape_sql_array($rss_channel_row);
     ACSLib::get_sql_value_array($rss_channel_row);
     $sql = "INSERT INTO external_rss";
     $sql .= " (bbs_id, rss_url, rss_channel_title, rss_item_title, rss_item_content, rss_item_date, rss_item_link)";
     $sql .= " VALUES ({$bbs_id_seq}, {$rss_channel_row['rss_url']}, {$rss_channel_row['rss_channel_title']}, {$rss_item_row['rss_item_title']}, {$rss_item_row['rss_item_content']}, {$rss_item_row['rss_item_date']}, {$rss_item_row['rss_item_link']})";
     $ret = ACSDB::_do_query($sql);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         return $ret;
     }
     if ($ret) {
         $ret = $bbs_id_seq;
     }
     // COMMIT
     ACSDB::_do_query("COMMIT");
     return $ret;
 }
示例#13
0
 /**
  * メッセージを登録する
  *
  * @param $form メッセージ情報の配列
  * @return 成功(登録されたメッセージID) / 失敗(false)
  */
 static function set_message($form)
 {
     $org_form = $form;
     ACSLib::escape_sql_array($form);
     ACSLib::get_sql_value_array($form);
     // BEGIN
     //ACSDB::_do_query("BEGIN");
     $message_id_seq = ACSDB::get_next_seq('message_id_seq');
     $message_sender_id_seq = ACSDB::get_next_seq('message_sender_id_seq');
     $message_receiver_id_seq = ACSDB::get_next_seq('message_receiver_id_seq');
     // messege
     $sql1 = "INSERT INTO message";
     $sql1 .= " (message_id, subject, body)";
     $sql1 .= " VALUES ({$message_id_seq}, {$form['subject']}, {$form['body']})";
     $ret = ACSDB::_do_query($sql1);
     if (!$ret) {
         //ACSDB::_do_query("ROLLBACK");
         echo "ERROR: insert message error";
         return $ret;
     }
     $form = $org_form;
     // messege_sender
     $sql2 = "INSERT INTO message_sender";
     $sql2 .= " (message_sender_id, message_id, community_id, message_delete_flag)";
     $sql2 .= " VALUES ({$message_sender_id_seq}, {$message_id_seq}, {$form['acs_user_info_id']}, 'f')";
     $ret = ACSDB::_do_query($sql2);
     if (!$ret) {
         //ACSDB::_do_query("ROLLBACK");
         echo "ERROR: insert message_sender error";
         return $ret;
     }
     $form = $org_form;
     // messege_receiver
     $sql3 = "INSERT INTO message_receiver";
     $sql3 .= " (message_receiver_id, message_id, community_id, read_flag, message_delete_flag)";
     $sql3 .= " VALUES ({$message_receiver_id_seq}, {$message_id_seq}, {$form['user_community_id']}, 'f', 'f')";
     $ret = ACSDB::_do_query($sql3);
     if (!$ret) {
         //ACSDB::_do_query("ROLLBACK");
         echo "ERROR: insert message_receiver error";
         return $ret;
     }
     if ($ret) {
         return $message_id_seq;
     } else {
         return false;
     }
 }
示例#14
0
 /**
  * ダイアリーコメントを登録する
  *
  * @param $form ダイアリーコメント情報の配列
  * @return 成功(true) / 失敗(false)
  */
 static function set_diary_comment($form)
 {
     ACSLib::escape_sql_array($form);
     ACSLib::get_sql_value_array($form);
     //一意指定のためのコメントID
     $diary_comment_id_seq = ACSDB::get_next_seq('diary_comment_id_seq');
     $sql = "INSERT INTO diary_comment";
     $sql .= " (diary_comment_id, diary_id, user_community_id, body,diary_comment_delete_flag)";
     $sql .= " VALUES ({$diary_comment_id_seq}, {$form['diary_id']}, {$form['user_community_id']}, {$form['body']},'f')";
     $ret = ACSDB::_do_query($sql);
     return $ret;
 }
示例#15
0
 /**
  * コミュニティを更新する
  * 2006/3/9
  * @param $form コミュニティ情報
  * return 成功(コミュニティID) / 失敗(false)
  */
 static function update_community($form)
 {
     // コミュニティ種別マスタ
     $community_type_master_array = ACSDB::get_master_array('community_type');
     $community_type_code = array_search(ACSMsg::get_mst('community_type_master', 'D40'), $community_type_master_array);
     // コンテンツ種別マスタ
     $contents_type_master_array = ACSDB::get_master_array('contents_type');
     // コミュニティメンバ種別マスタ
     $community_member_type_master_array = ACSDB::get_master_array('community_member_type');
     $community_id_seq = $form['community_id'];
     $org_form = $form;
     ACSLib::escape_sql_array($form);
     ACSLib::get_sql_value_array($form);
     // BEGIN
     ACSDB::_do_query("BEGIN");
     // (1) コミュニティ (community)
     $admission_flag = ACSLib::get_pg_boolean($org_form['admission_flag']);
     $sql = "UPDATE community";
     $sql .= " SET community_name = {$form['community_name']},";
     $sql .= " category_code = {$form['category_code']},";
     $sql .= " admission_flag = {$form['admission_flag']}";
     $sql .= " WHERE community_id = {$community_id_seq}";
     $ret = ACSDB::_do_query($sql);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         return $ret;
     }
     // (2) コミュニティプロフィール
     $contents_form = array();
     $contents_form['community_id'] = $community_id_seq;
     $contents_form['contents_type_code'] = array_search(ACSMsg::get_mst('contents_type_master', 'D07'), $contents_type_master_array);
     $contents_form['contents_value'] = $org_form['community_profile'];
     $contents_form['open_level_code'] = ACSAccessControl::get_default_open_level_code(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D07'));
     $ret = ACSCommunity::set_contents($contents_form);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         return $ret;
     }
     // (3) 参加資格 (join_trusted_community)
     $join_trusted_community_form = array();
     $join_trusted_community_form['community_id'] = $community_id_seq;
     // join_trusted_community 前準備 旧データの一括削除
     $ret = ACSCommunity::delete_join_trusted_community($join_trusted_community_form);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         return $ret;
     }
     //登録
     if (is_array($org_form['join_trusted_community_id_array'])) {
         foreach ($org_form['join_trusted_community_id_array'] as $trusted_community_id) {
             $join_trusted_community_form['trusted_community_id'] = $trusted_community_id;
             $ret = ACSCommunity::set_join_trusted_community($join_trusted_community_form);
             if (!$ret) {
                 ACSDB::_do_query("ROLLBACK");
                 return $ret;
             }
         }
     }
     // (4) 公開範囲 電子掲示板
     // contents
     $contents_form = array();
     $contents_form['community_id'] = $community_id_seq;
     $contents_form['contents_type_code'] = array_search(ACSMsg::get_mst('contents_type_master', 'D41'), $contents_type_master_array);
     $contents_form['contents_value'] = '';
     $contents_form['open_level_code'] = $org_form['bbs_open_level_code'];
     $ret = ACSCommunity::set_contents($contents_form);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         return $ret;
     }
     // contents_trusted_community
     if (is_array($org_form['bbs_trusted_community_id_array'])) {
         $contents_trusted_community_form = array();
         $contents_trusted_community_form['community_id'] = $community_id_seq;
         $contents_trusted_community_form['contents_type_code'] = array_search(ACSMsg::get_mst('contents_type_master', 'D41'), $contents_type_master_array);
         $contents_trusted_community_form['open_level_code'] = $org_form['bbs_open_level_code'];
         // contents_trusted_community 前準備 旧データの一括削除
         $ret = ACSCommunity::update_contents_trusted_community($contents_trusted_community_form);
         if (!$ret) {
             ACSDB::_do_query("ROLLBACK");
             return $ret;
         }
         //登録
         foreach ($org_form['bbs_trusted_community_id_array'] as $trusted_community_id) {
             $contents_trusted_community_form['trusted_community_id'] = $trusted_community_id;
             $ret = ACSCommunity::set_contents_trusted_community($contents_trusted_community_form);
             if (!$ret) {
                 ACSDB::_do_query("ROLLBACK");
                 return $ret;
             }
         }
     }
     // (5) 公開範囲 コミュニティフォルダ (cotents)
     // contents
     $contents_form = array();
     $contents_form['community_id'] = $community_id_seq;
     $contents_form['contents_type_code'] = array_search(ACSMsg::get_mst('contents_type_master', 'D31'), $contents_type_master_array);
     $contents_form['contents_value'] = '';
     $contents_form['open_level_code'] = $org_form['community_folder_open_level_code'];
     $ret = ACSCommunity::set_contents($contents_form);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         return $ret;
     }
     // contents_trusted_community
     if (is_array($org_form['community_folder_trusted_community_id_array'])) {
         $contents_trusted_community_form = array();
         $contents_trusted_community_form['community_id'] = $community_id_seq;
         $contents_trusted_community_form['contents_type_code'] = array_search(ACSMsg::get_mst('contents_type_master', 'D31'), $contents_type_master_array);
         $contents_trusted_community_form['open_level_code'] = $org_form['community_folder_open_level_code'];
         // contents_trusted_community 前準備 旧データの一括削除
         $ret = ACSCommunity::update_contents_trusted_community($contents_trusted_community_form);
         if (!$ret) {
             ACSDB::_do_query("ROLLBACK");
             return $ret;
         }
         // 登録
         foreach ($org_form['community_folder_trusted_community_id_array'] as $trusted_community_id) {
             $contents_trusted_community_form['trusted_community_id'] = $trusted_community_id;
             $ret = ACSCommunity::set_contents_trusted_community($contents_trusted_community_form);
             if (!$ret) {
                 ACSDB::_do_query("ROLLBACK");
                 return $ret;
             }
         }
     }
     // (6) 公開範囲 全体
     // contents
     $contents_form = array();
     $contents_form['community_id'] = $community_id_seq;
     $contents_form['contents_type_code'] = array_search(ACSMsg::get_mst('contents_type_master', 'D00'), $contents_type_master_array);
     $contents_form['contents_value'] = '';
     $contents_form['open_level_code'] = $org_form['self_open_level_code'];
     $ret = ACSCommunity::set_contents($contents_form);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         return $ret;
     }
     // (7) コミュニティML
     // contents
     // コミュニティMLアドレス
     if ($org_form['community_ml_address']) {
         $contents_form = array();
         $contents_form['community_id'] = $community_id_seq;
         $contents_form['contents_type_code'] = array_search(ACSMsg::get_mst('contents_type_master', 'D61'), $contents_type_master_array);
         $contents_form['contents_value'] = $org_form['community_ml_address'];
         $contents_form['open_level_code'] = ACSAccessControl::get_default_open_level_code(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D61'));
         $ret = ACSCommunity::set_contents($contents_form);
         if (!$ret) {
             ACSDB::_do_query("ROLLBACK");
             return $ret;
         }
         // コミュニティMLステータス
         $contents_form = array();
         $contents_form['community_id'] = $community_id_seq;
         $contents_form['contents_type_code'] = array_search(ACSMsg::get_mst('contents_type_master', 'D62'), $contents_type_master_array);
         $contents_form['contents_value'] = 'QUEUE';
         $contents_form['open_level_code'] = ACSAccessControl::get_default_open_level_code(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D62'));
         $ret = ACSCommunity::set_contents($contents_form);
         if (!$ret) {
             ACSDB::_do_query("ROLLBACK");
             return $ret;
         }
     }
     // COMMIT
     ACSDB::_do_query("COMMIT");
     return $community_id_seq;
 }