diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt old mode 100644 new mode 100755 index 2a9eef1..0f85e08 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -1,6 +1,50 @@ - NetComomns2 Changelog + NetCommons2 Changelog =============================== +2015/03/19: Version 2.4.2.1 +- PHP5.6対応 +- 脆弱性に関する修正 +- IE11対応 +- IE10以上の場合は互換表示にする修正 +- IE7のとき、プルダウンメニューテンプレートのものを使用しているとJSエラーが発生する問題への対応 +- SQLエラー時のメッセージ変更 +- インポート・エクスポート・ダウンロード時に環境依存文字が文字化けする問題への対応 +- 日本語ファイルのダウンロード時に文字化けする問題の対応 +- action_nameの形式によってはNoticeが発生する問題への対応 +- PHP5.2.7以上の環境だとエラーログが表示されない問題への対応 +- トップページでページスタイルダイアログの設定ができない問題への対応 +- mysqli使用時でも正常に動作するように修正 +- smarty_cacheが溜まらない不具合の修正 +- リクエストパラメータのlangでNoticeが発生する不具合の修正 +- ファイルを削除する処理でwarningが発生する場合がある不具合の修正(XAMPPの場合のみ発生) +- WYSIWYGの箇条書きで全角入力すると、先頭の文字が2行目に表示される不具合の修正 +- WYSIWYGで、一般権限でyoutubeを貼り付けても消える問題の修正 +- バックアップのリストア時、メモリを節約するように修正 +- クリーンアップで削除するまでの期間を正しく計算していない不具合の修正 +- ルーム管理の設定をすることで、当該ルームに配置してあるグループ枠中の配置が全て消される不具合の対応 +- ルーム管理で公開中⇔準備中の切り替えがサブルームに反映されない不具合の修正 +- システム管理とページスタイル設定のページ/サイトの説明とキーワードの表示順を統一するように修正 +- キャビネットでファイル・フォルダがないときにソートするとjavascriptエラーとなる不具合の修正 +- カレンダーで時間順⇔会員順を切り替えるとエラーとなることがある不具合の修正 +- カレンダーで12/31の年単位の繰り返しが正常に登録されない不具合の修正 +- 回覧板でログインしていないと検索モジュールの検索でエラーが発生するため修正 +- 回覧板のtextのデータ型のDefault指定を削除 +- 日誌のトラックバックの不具合の修正 +- 日誌のラベルの「by:」を「by 」に修正 +- 汎用DBで、状態項目を数値化するように修正 +- 汎用DBの、重複している条件式を削除 +- 汎用DBの検索で、ハンドルに「?」を入力するとエラーになる不具合の修正 +- 汎用DBの検索で、ソート順判定処理の条件分岐の修正 +- プライベートメッセージの不要なコメントの削除 +- アンケートで質問の編集リンクが効かないことがある不具合の修正 +- 登録フォームで英語の一部言語が未定義だったため修正 +- 登録フォームでメールアドレス欄が複数ある場合の不具合の修正 +- 施設予約の変数名を一部修正 +- RSSでPHP5.3以上の環境でwarningが出る問題への対応 +- 新着情報でタイトルが入らない場合がある不具合の修正 + + + 2013/08/29: Version 2.4.2.0 - メニューでプルダウンテンプレートを追加 - メニューでパンくずリストテンプレートを追加 diff --git a/html/maple/logger/Logger_ViewDisplayManage.class.php b/html/maple/logger/Logger_ViewDisplayManage.class.php index 3898f57..6214939 100644 --- a/html/maple/logger/Logger_ViewDisplayManage.class.php +++ b/html/maple/logger/Logger_ViewDisplayManage.class.php @@ -147,7 +147,9 @@ function setLoggerHandle($errNo, $errStr, $errFile, $errLine=NULL) $write_flag = false; if($errNo != LEVEL_SQL) { - if (defined("PHP_DEBUG")) { + if ((version_compare(phpversion(), '5.2.7', '>=') && PHP_DEBUG==true) + || + (version_compare(phpversion(), '5.2.7', '<') && defined("PHP_DEBUG"))) { if(PHP_DEBUG) $php_debug = 1; else diff --git a/html/maple/nccore/RequestExtra.class.php b/html/maple/nccore/RequestExtra.class.php index a639fe2..4467165 100644 --- a/html/maple/nccore/RequestExtra.class.php +++ b/html/maple/nccore/RequestExtra.class.php @@ -102,7 +102,7 @@ function _rawurlDecode(&$params, $security_chk_flag = false) { } if(is_array($value)) { - $this->_rawurlDecode($params[$key]); + $this->_rawurlDecode($params[$key], $security_chk_flag); } else { if($security_chk_flag) { // ヌル文字列をスペースに変更する diff --git a/html/maple/nccore/SecurityManager.class.php b/html/maple/nccore/SecurityManager.class.php index 03fcff9..600a01d 100644 --- a/html/maple/nccore/SecurityManager.class.php +++ b/html/maple/nccore/SecurityManager.class.php @@ -126,7 +126,7 @@ function chkContamiAction($key) { // Variables contamination if( $this->_config[_SECURITY_CONF_CATID]['contami_action']['conf_value'] && - in_array($key, $this->bad_globals) ) { + in_array($key, $this->bad_globals, true) ) { $this->message = sprintf(_SECURITY_CONTAMI_ACTION_ERROR, $key); $user_id = $this->_session->getParameter("_user_id"); $this->outputLog( 'CONTAMI', $user_id) ; diff --git a/html/maple/nccore/SessionExtra.class.php b/html/maple/nccore/SessionExtra.class.php index 9955b86..679fdc5 100644 --- a/html/maple/nccore/SessionExtra.class.php +++ b/html/maple/nccore/SessionExtra.class.php @@ -230,7 +230,16 @@ function start($regenerate_flag = _ON) // smarty_cacheのセッションIDも同時に更新 // Cacheフィルターがうまく動作しなくなるため $adodb =& $this->_db->getAdoDbObject(); - if(is_object($adodb)) { + $container =& DIContainerFactory::getContainer(); + $actionChain =& $container->getComponent("ActionChain"); + if($actionChain->getCurActionName() == "login_action_main_init") { + $params = array( + "base_sess_id" => $_base_sess_id, + "sess_id" => $this->new_session_id, + ); + $result = $this->_db->execute("DELETE FROM {session} " . + " WHERE base_sess_id = ? AND sess_id != ? ",$params); + } else if(is_object($adodb)) { $this->_db->updateExecute("smarty_cache", array("session_id" => $this->new_session_id), array("session_id" => $this->old_session_id)); if(rand(0, $this->regenerate_session_num) == 0) { // regenerate_session_num分の1の確立で、regenerate前のセッションデータ削除 diff --git a/html/maple/nccore/SmartyTemplate.class.php b/html/maple/nccore/SmartyTemplate.class.php index 79d4ee5..c77153c 100644 --- a/html/maple/nccore/SmartyTemplate.class.php +++ b/html/maple/nccore/SmartyTemplate.class.php @@ -767,7 +767,7 @@ function smartyTemplateCacheHandler($action, &$smarty_obj, &$cache_content, $tpl $time = date("YmdHis",timezone_date(null, true, "U") - $renderer->cache_lifetime); $result = $db->execute("DELETE FROM {smarty_cache} " . - $where_str." OR update_time <'".$time."' ",$params); + $where_str." OR expire_time <'".$time."' ",$params); } else { $result = $db->execute("DELETE FROM {smarty_cache} " . $where_str,$params); diff --git a/html/maple/nccore/db/DbObjectAdodb.class.php b/html/maple/nccore/db/DbObjectAdodb.class.php index 0e2c1b1..8258c9e 100644 --- a/html/maple/nccore/db/DbObjectAdodb.class.php +++ b/html/maple/nccore/db/DbObjectAdodb.class.php @@ -186,7 +186,11 @@ function connect() { // http://php.net/manual/ja/function.mysql-set-charset.php if (version_compare(phpversion(), '5.2.3', '>=') && $server_info['version'] >= '5.0.7') { - mysql_set_charset(DATABASE_CHARSET); + if (strpos($this->_dsn, 'mysqli') === 0) { + $this->_conn->SetCharSet(DATABASE_CHARSET); + } else { + mysql_set_charset(DATABASE_CHARSET); + } } } @@ -295,6 +299,15 @@ function execute($sql, $params = array(), $limit = 0, $offset = 0, $key_flag = t else $this->_conn->SetFetchMode(ADODB_FETCH_NUM); + // paramsのvalueに配列の入力パラメータがはいった場合、adodb内で複数のSQLを実行しようとするため、ここで対処。 + if (is_array($params)) { + foreach($params as $param) { + if (is_array($param)) { + return false; + } + } + } + if ($limit || $offset) { $result =& $this->_conn->SelectLimit($sql, $limit, $offset, $params); } else { @@ -552,7 +565,7 @@ function &getSelectSQL($tableName, &$params, &$where_params, &$order_params) * パラメータよりwhere文を生成し返す * @param array $params WHERE句のデータ配列 * @param array $where_params キー名称配列、whereデータ配列 - * @param array $where_prefix_flag 接頭語句をANDでなくwhereにして返す場合、true defaut:true + * @param array $where_prefix_flag 接頭語句をANDでなくwhereにして返す場合、true default:true * @return string where文 * @access public */ @@ -579,15 +592,19 @@ function &getWhereSQL(&$params, &$where_params, $where_prefix_flag = true) /** * パラメータよりorder文を生成し返す * @param array $order_params キー名称配列、orderデータ配列 + * @param array $allow_keys キー名称で設定できるカラムの配列 * @return string order文 * @access public */ - function &getOrderSQL(&$order_params) + function &getOrderSQL(&$order_params, $allow_keys = array()) { $sql_order = ""; if (!empty($order_params)) { foreach ($order_params as $key=>$item) { - $sql_order .= ",".$key." ".(empty($item) ? "ASC" : $item); + if (!empty($allow_keys) && !in_array($key, $allow_keys)) { + $key = $allow_keys[0]; + } + $sql_order .= ",".$key." ".((empty($item) || ($item != 'DESC' && $item != 'desc')) ? "ASC" : $item); } } $sql_order = ($sql_order ? " ORDER BY ".substr($sql_order,1) : ""); @@ -899,8 +916,10 @@ function addError($error_no=null, $error_mes=null) $session =& $container->getComponent("Session"); if(isset($session) && $session->getParameter("_php_debug") == _ON) { $errorList->add($this->ErrorNo(), $this->ErrorMsg(). ":\n". $this->_bck_sql); - } else { + } else if (defined('_INVALID_INPUT')) { $errorList->add($this->ErrorNo(), _INVALID_INPUT); + } else { + $errorList->add($this->ErrorNo(), "Security Error! Unauthorized input."); } } else { $errorList->add($error_no, $error_mes); diff --git a/html/webapp/components/authcheck/Main.class.php b/html/webapp/components/authcheck/Main.class.php index 6f6643c..ced6aea 100644 --- a/html/webapp/components/authcheck/Main.class.php +++ b/html/webapp/components/authcheck/Main.class.php @@ -349,7 +349,7 @@ function AuthCheck($action_name, $page_id, $block_id) { $isMobileAction = ($pathList[0] == 'common' && $pathList[1] == 'mobile'); $isMobileAction = ($isMobileAction - || $pathList[2] == 'mobile'); + || isset($pathList[2]) && $pathList[2] == 'mobile'); if ($isMobileAction && empty($mobile_flag)) { return false; diff --git a/html/webapp/components/calendar/Action.class.php b/html/webapp/components/calendar/Action.class.php old mode 100644 new mode 100755 index a96a882..84a9a46 --- a/html/webapp/components/calendar/Action.class.php +++ b/html/webapp/components/calendar/Action.class.php @@ -713,6 +713,7 @@ function _insertYearly($params, &$rrule, $first=false, $bymonthday=0) $bymonthday = intval(substr($start_date,6,2)); } + $result = true; $current_month = intval(substr($start_date,4,2)); foreach ($rrule["BYMONTH"] as $i=>$month) { if ($first && $current_month > $month) { continue; } @@ -724,7 +725,8 @@ function _insertYearly($params, &$rrule, $first=false, $bymonthday=0) } else { $params["start_date"] = substr($start_date,0,4).sprintf("%02d",$month)."01"; $params["start_time"] = $start_time; - $params["end_date"] = substr($end_date,0,4).sprintf("%02d",$month).sprintf("%02d", 1 + $diff_num); + // end_dateにはstart_date + $diff_numの日付をセット(12/31の場合に翌年がセットされるため) + $params["end_date"] = substr($start_date,0,4) . sprintf("%02d", $month) . sprintf("%02d", 1 + $diff_num); $params["end_time"] = $end_time; } if (!empty($rrule["BYDAY"]) && count($rrule["BYDAY"]) > 0) { @@ -736,10 +738,16 @@ function _insertYearly($params, &$rrule, $first=false, $bymonthday=0) return false; } } - $params["start_date"] = timezone_date($start_date.$start_time, true, "Ymd"); - $params["start_time"] = timezone_date($start_date.$start_time, true, "His"); - $params["end_date"] = timezone_date($end_date.$end_time, true, "Ymd"); - $params["end_time"] = timezone_date($end_date.$end_time, true, "His"); + $startDate = $start_date.$start_time; + $endDate = $end_date.$end_time; + if (is_array($result)) { + list($startDate, $endDate) = $result; + } + + $params["start_date"] = timezone_date($startDate, true, "Ymd"); + $params["start_time"] = timezone_date($startDate, true, "His"); + $params["end_date"] = timezone_date($endDate, true, "Ymd"); + $params["end_time"] = timezone_date($endDate, true, "His"); if (!empty($rrule["BYDAY"]) && count($rrule["BYDAY"]) > 0) { return $this->_insertYearly($params, $rrule); @@ -749,8 +757,10 @@ function _insertYearly($params, &$rrule, $first=false, $bymonthday=0) } /** - * 登録処理 + * 登録処理(年単位-開始日と同日) * + * @return mixed boolean true:登録せず終了 false:失敗 + * array 登録成功: array(登録した開始年月日時分秒, 登録した終了年月日時分秒) * @access private */ function __insertYearlyByMonthday($params, &$rrule, $bymonthday, $first) @@ -798,13 +808,15 @@ function __insertYearlyByMonthday($params, &$rrule, $bymonthday, $first) if ($calendar_id === false) { return false; } else { - return true; + return array($start_date.$start_time, $end_date.$end_time); } } /** - * 登録処理 + * 登録処理(年単位-第○週○曜日) * + * @return mixed boolean true:登録せず終了 false:失敗 + * array 登録成功: array(登録した開始年月日時分秒, 登録した終了年月日時分秒) * @access private */ function __insertYearlyByday($params, &$rrule, $first=false) @@ -862,7 +874,7 @@ function __insertYearlyByday($params, &$rrule, $first=false) if ($calendar_id === false) { return false; } else { - return true; + return array($start_date.$start_time, $end_date.$end_time); } } diff --git a/html/webapp/components/common/Main.class.php b/html/webapp/components/common/Main.class.php old mode 100644 new mode 100755 index febd5c0..460b2c0 --- a/html/webapp/components/common/Main.class.php +++ b/html/webapp/components/common/Main.class.php @@ -187,7 +187,7 @@ function viewAssign(&$renderer) { $renderer->assign('module_id',$modules[$pathList[0]]['module_id']); } else { $module_id = 0; - $renderer->assign('module_obj',""); + $renderer->assign('module_obj', array()); $renderer->assign('module_id',0); } @@ -465,13 +465,11 @@ function redirectHeader($url="", $time = 2, $message = "") if($url == "") { $url = BASE_URL.INDEX_FILE_NAME."?".ACTION_KEY."=".DEFAULT_ACTION; } - //$url = htmlspecialchars(str_replace("?action=","?_sub_action=",str_replace("&","@",BASE_URL.INDEX_FILE_NAME.$this->_request->getStrParameters(false))), ENT_QUOTES); $renderer =& SmartyTemplate::getInstance(); $renderer->assign('header_field',$meta); $renderer->assign('time', $time); - $renderer->assign('url',$url); - $renderer->assign('lang_ifnotreload', sprintf(_IFNOTRELOAD,$url)); + $renderer->assign('redirect_url', $url); if($message != "") { $renderer->assign('redirect_message', $message); } else { diff --git a/html/webapp/components/csv/Main.class.php b/html/webapp/components/csv/Main.class.php index 90c8b4c..4b6c544 100644 --- a/html/webapp/components/csv/Main.class.php +++ b/html/webapp/components/csv/Main.class.php @@ -60,7 +60,7 @@ class Csv_Main */ function Csv_Main() { $this->_LE = "\n"; - $this->charSet = "SJIS"; + $this->charSet = _CLIENT_OS_CHARSET; $this->mimeType = "document/unknown"; $this->division = ","; $this->extension = ".csv"; diff --git a/html/webapp/components/escape/Text.class.php b/html/webapp/components/escape/Text.class.php index 85f158e..7572899 100644 --- a/html/webapp/components/escape/Text.class.php +++ b/html/webapp/components/escape/Text.class.php @@ -234,9 +234,9 @@ function escapeWysiwyg(&$string) { continue; } } else { - // ./ と ../ の許可 - if($attribute_split[2] != "#" && !preg_match("/^\.\//", $attribute_split[2]) && !preg_match("/^\.\.\//", $attribute_split[2])) { - $attribute_split[2] = "./".$attribute_split[2]; + // ./ と ../ とvideo の許可 + if($attribute_split[2] != "#" && !preg_match("/^\.\//", $attribute_split[2]) && !preg_match("/^\.\.\//", $attribute_split[2]) && !$this->_checkVideoURL($attribute_split[2], $allowable_video)) { + $attribute_split[2] = "./".$attribute_split[2]; } } } @@ -445,6 +445,11 @@ function _escapeWysiwygAllowHtmltag($string) { $script_flag = false; foreach ($parts as $part) { // script-/scriptまではそのまま連結 + if(preg_match("/<\/script>$/u", $part)) { + $script_flag = false; + $string .= $part; + continue; + } if(preg_match("/^/u", $part) || $script_flag == true) { $script_flag = true; if (preg_match("/<\!\-\-comment\-\->/u", $part)) { @@ -453,10 +458,6 @@ function _escapeWysiwygAllowHtmltag($string) { } $string .= $part; continue; - } else if(preg_match("/<\/script>$/u", $part)) { - $script_flag = false; - $string .= $part; - continue; } if (preg_match("/<\!\-\-comment\-\->/u", $part)) { diff --git a/html/webapp/components/holiday/View.class.php b/html/webapp/components/holiday/View.class.php index 2b544c1..2f81c74 100644 --- a/html/webapp/components/holiday/View.class.php +++ b/html/webapp/components/holiday/View.class.php @@ -116,6 +116,12 @@ function getYear($year=null, $lang=null, $sort_col="holiday", $sort_dir="ASC") $session =& $this->_container->getComponent("Session"); $lang = $session->getParameter("_lang"); } + if (!in_array($sort_col, array('holiday', 'summary'))) { + $sort_col = 'holiday'; + } + if ($sort_dir != 'DESC') { + $sort_dir = 'ASC'; + } $sql = "SELECT * FROM {holiday} "; $sql .= "WHERE lang_dirname = ? "; $sql .= "AND holiday >= ? "; diff --git a/html/webapp/components/monthlynumber/View.class.php b/html/webapp/components/monthlynumber/View.class.php index 2414e19..b7e8c9c 100644 --- a/html/webapp/components/monthlynumber/View.class.php +++ b/html/webapp/components/monthlynumber/View.class.php @@ -144,33 +144,33 @@ function getMonthlyNumberList($year, $room_id = null, $user_id = null, $role_aut } //$_user_auth_id = $session->getParameter("_user_auth_id"); - if($room_id != null) { - //ルーム管理:ルーム毎のSUM - $params = array( - //"user_id"=>$user_id, - "room_id"=>$room_id - //"sub_room_id"=>$room_id - ); - $sql = "SELECT {pages}.page_id,{pages}.root_id, {pages}.parent_id,{pages}.thread_num, {pages}.display_sequence, {pages}.page_name, {pages}.private_flag, {pages}.space_type, {monthly_number}.name, {monthly_number}.year, {monthly_number}.month, SUM({monthly_number}.number) AS number " . - " FROM {pages} "; + if($room_id != null) { + //ルーム管理:ルーム毎のSUM + $params = array( + //"user_id"=>$user_id, + "room_id"=>$room_id + //"sub_room_id"=>$room_id + ); + $sql = "SELECT {pages}.page_id,{pages}.root_id, {pages}.parent_id,{pages}.thread_num, {pages}.display_sequence, {pages}.page_name, {pages}.private_flag, {pages}.space_type, {monthly_number}.name, {monthly_number}.year, {monthly_number}.month, SUM({monthly_number}.number) AS number " . + " FROM {pages} "; $sql .= " LEFT JOIN {monthly_number} ON {pages}.room_id = {monthly_number}.room_id "; //$sql .= " LEFT JOIN {pages_users_link} ON {pages}.room_id = {pages_users_link}.room_id AND {pages_users_link}.room_id = ? "; - $sql .= " WHERE 1=1 "; + $sql .= " WHERE 1=1 "; - } else { - $params = array( - "user_id"=>$user_id, - "user_id_monthly"=>$user_id - ); + } else { + $params = array( + "user_id"=>$user_id, + "user_id_monthly"=>$user_id + ); $sql = "SELECT {pages}.page_id, {pages}.root_id, {pages}.parent_id, {pages}.thread_num, {pages}.display_sequence, {pages}.page_name, {pages}.private_flag, {pages}.space_type, {monthly_number}.name, {monthly_number}.year, {monthly_number}.month, {monthly_number}.number " . - " FROM {pages} "; + " FROM {pages} "; $sql .= " LEFT JOIN {monthly_number} ON {pages}.room_id = {monthly_number}.room_id AND {monthly_number}.user_id = ? "; - $sql .= " LEFT JOIN {pages_users_link} ON {pages}.room_id = {pages_users_link}.room_id AND {pages_users_link}.user_id = ? "; + $sql .= " LEFT JOIN {pages_users_link} ON {pages}.room_id = {pages_users_link}.room_id AND {pages_users_link}.user_id = ? "; - $sql .= " WHERE (({pages}.private_flag = "._ON." " . - "AND {pages_users_link}.user_id IS NOT NULL) OR ({pages}.private_flag = "._OFF." AND ({pages}.space_type = "._SPACE_TYPE_GROUP." OR {pages}.space_type ="._SPACE_TYPE_PUBLIC."))) "; - } + $sql .= " WHERE (({pages}.private_flag = "._ON." " . + "AND {pages_users_link}.user_id IS NOT NULL) OR ({pages}.private_flag = "._OFF." AND ({pages}.space_type = "._SPACE_TYPE_GROUP." OR {pages}.space_type ="._SPACE_TYPE_PUBLIC."))) "; + } //ルームのみ $sql .= " AND {pages}.node_flag = ". _ON . " AND {pages}.room_id = {pages}.page_id "; @@ -237,11 +237,11 @@ function _fetchcallbackMonthlyNumberList($result, $func_params) { // name, thread_num, parent_id, display_sequence $monthly_row_exists["nc".$row['name']][$row['page_id']] = true; - if(!empty($monthly_list["nc".$row['name']][$row['page_id']][$row['month']])) { - $monthly_list["nc".$row['name']][$row['page_id']][$row['month']] = $monthly_list["nc".$row['name']][$row['page_id']][$row['month']] + intval($row['number']); - } else { + //if(!empty($monthly_list["nc".$row['name']][$row['page_id']][$row['month']])) { + // $monthly_list["nc".$row['name']][$row['page_id']][$row['month']] = $monthly_list["nc".$row['name']][$row['page_id']][$row['month']] + intval($row['number']); + //} else { $monthly_list["nc".$row['name']][$row['page_id']][$row['month']] = intval($row['number']); - } + //} if($room_id == 0) { //root_id,parent_idしか考慮しないため、サブグループが2つ以上作れる仕様にしてしまうと diff --git a/html/webapp/components/uploads/Action.class.php b/html/webapp/components/uploads/Action.class.php index fce1a68..8b28673 100644 --- a/html/webapp/components/uploads/Action.class.php +++ b/html/webapp/components/uploads/Action.class.php @@ -550,16 +550,7 @@ function _setFileByPath($set_path, &$files) { } function getEncode() { - if (stristr($_SERVER['HTTP_USER_AGENT'], "Mac")) { - // Macの場合 - $encode = "UTF-8"; - } else if (stristr($_SERVER['HTTP_USER_AGENT'], "Windows")) { - // Windowsの場合 - $encode = "SJIS"; - } else { - $encode = _CHARSET; - } - return $encode; + return _CLIENT_OS_CHARSET; } function setFileTemporaryPath($file_path) { diff --git a/html/webapp/components/uploads/View.class.php b/html/webapp/components/uploads/View.class.php old mode 100644 new mode 100755 index eb03599..d974e04 --- a/html/webapp/components/uploads/View.class.php +++ b/html/webapp/components/uploads/View.class.php @@ -339,7 +339,7 @@ function _headerOutput($filename, $pathname, $filesize, $mimetype, $cache_flag = header("Content-disposition: inline; filename=\"".$filename."\""); } elseif (stristr($_SERVER['HTTP_USER_AGENT'], "MSIE") || stristr($_SERVER['HTTP_USER_AGENT'], "Trident")) { // IEの場合 - header("Content-disposition: inline; filename=\"".mb_convert_encoding($filename, "SJIS", _CHARSET)."\""); + header("Content-disposition: inline; filename=\"".mb_convert_encoding($filename, _CLIENT_OS_CHARSET, _CHARSET)."\""); } elseif (stristr($_SERVER['HTTP_USER_AGENT'], "Opera")) { // Operaの場合 header("Content-disposition: attachment; filename=\"".$filename."\""); @@ -350,17 +350,8 @@ function _headerOutput($filename, $pathname, $filesize, $mimetype, $cache_flag = } else { header("Content-disposition: attachment; filename=\"".$filename."\""); } - } elseif (stristr($_SERVER['HTTP_USER_AGENT'], "Chrome")) { - // GoogleChromeの場合 - if (stristr($_SERVER['HTTP_USER_AGENT'], "Windows")) { - // Windows版 - header("Content-disposition: inline; filename=\"".mb_convert_encoding($filename, "SJIS", _CHARSET)."\""); - } else { - // それ以外 - header("Content-disposition: inline; filename=\"".$filename."\""); - } } else { - // 上記以外(Mozilla, Firefox, NetScape) + // 上記以外(Mozilla, NetScape, GoogleChrome) header("Content-disposition: inline; filename=\"".$filename."\""); } if(!empty($pathname)) { diff --git a/html/webapp/components/users/View.class.php b/html/webapp/components/users/View.class.php old mode 100644 new mode 100755 index 76e19af..b55098f --- a/html/webapp/components/users/View.class.php +++ b/html/webapp/components/users/View.class.php @@ -540,8 +540,12 @@ function &getSendMailUsers($page_id=null, $more_than_authority_id=null, $type = $sql .= ")"; $func = array($this, '_fetchcallbackSendMail'); $authoritiesView =& $this->_container->getComponent("authoritiesView"); - $authorities = $authoritiesView->getAuthorities(null, null, null, null, true); - $func_params = array($more_than_authority_id, $authorities, $items); + $authorities = $authoritiesView->getAuthorities(null, null); + $authoritiesById = array(); + foreach ((array)$authorities as $authority) { + $authoritiesById[$authority['role_authority_id']] = $authority; + } + $func_params = array($more_than_authority_id, $authoritiesById, $items); } else { // ルームID指定なし // 会員の user_authority_idのみでメールを送信 diff --git a/html/webapp/config/define.inc.php b/html/webapp/config/define.inc.php index a4e3a1e..b78f962 100644 --- a/html/webapp/config/define.inc.php +++ b/html/webapp/config/define.inc.php @@ -3,6 +3,19 @@ define("_OFF",0); define('_CHARSET', 'UTF-8'); +if (stristr($_SERVER['HTTP_USER_AGENT'], 'Mac')) { + // Macの場合 + $encode = 'UTF-8'; +} else if (stristr($_SERVER['HTTP_USER_AGENT'], 'Windows')) { + // Windowsの場合 + $encode = 'SJIS-win'; + if (!extension_loaded('mbstring') && !function_exists("mb_convert_encoding")) { + $encode = 'SJIS'; + } +} else { + $encode = _CHARSET; +} +define('_CLIENT_OS_CHARSET', $encode); define("_SPACE_TYPE_UNDEFINED",0); //未定義 define("_SPACE_TYPE_PUBLIC",1); //パブリックスペース diff --git a/html/webapp/config/version.php b/html/webapp/config/version.php index 623cf8c..1086c60 100644 --- a/html/webapp/config/version.php +++ b/html/webapp/config/version.php @@ -1,4 +1,4 @@ \ No newline at end of file diff --git a/html/webapp/modules/assignment/components/View.class.php b/html/webapp/modules/assignment/components/View.class.php index 0f83b04..d47fc46 100644 --- a/html/webapp/modules/assignment/components/View.class.php +++ b/html/webapp/modules/assignment/components/View.class.php @@ -172,7 +172,7 @@ function &getAssignments() " ON (Assign.assignment_id = Submitter.assignment_id)". " WHERE Assign.room_id = ?" . " GROUP BY Assign.assignment_id". - " ".$this->_db->getOrderSQL($order); + " ".$this->_db->getOrderSQL($order, array('Assign.assignment_id', 'assignment_name', 'activity', 'insert_user_name', 'insert_time')); $assignments = $this->_db->execute($sql, $params, $limit, $offset, true); if ($assignments === false) { @@ -749,7 +749,7 @@ function &getSubmitters($yet_submit=false) $sort_col = "submit_time"; } $sort_dir = $this->_request->getParameter("sort_dir"); - if (empty($sort_dir)) { + if (empty($sort_dir) || $sort_dir != 'ASC') { $sort_dir = "DESC"; } diff --git a/html/webapp/modules/assignment/install.ini b/html/webapp/modules/assignment/install.ini old mode 100644 new mode 100755 index 31e0034..6fc6b7f --- a/html/webapp/modules/assignment/install.ini +++ b/html/webapp/modules/assignment/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.0" +version = "2.4.0.1" action_name = "assignment_view_main_init" edit_action_name = "assignment_view_edit_list" search_action = "assignment_view_admin_search" diff --git a/html/webapp/modules/backup/components/Restore.class.php b/html/webapp/modules/backup/components/Restore.class.php index ed18790..bd5e1c8 100644 --- a/html/webapp/modules/backup/components/Restore.class.php +++ b/html/webapp/modules/backup/components/Restore.class.php @@ -214,7 +214,11 @@ function getRestoreArray($upload_id, $backup_page_id, $module_id, $temporary_fil //$options = array ('parseAttributes' => true); 属性値を含める //$unserializer =& new XML_Unserializer($options); - $result = $unserializer->unserialize($xml); + // XML を読み込んだ変数から処理すると、環境によってはメモリを使いすぎてエラーになるケースがあった。 + // そのため、XML は再度、ファイルから取得するように修正し、メモリの消費を抑えた。 + // 2014-08-15 by nagahara@opensource-workshop.jp + // $result = $unserializer->unserialize($xml); + $result = $unserializer->unserialize($temporary_file_path.BACKUP_ROOM_XML_FILE_NAME, true); if($result !== true) { $this->_fileAction->delDir($temporary_file_path); $errorList->add("backup", BACKUP_FAILURE_UNSERIALIZE); diff --git a/html/webapp/modules/backup/install.ini b/html/webapp/modules/backup/install.ini old mode 100644 new mode 100755 index 90f8a1b..d4a005a --- a/html/webapp/modules/backup/install.ini +++ b/html/webapp/modules/backup/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.1" +version = "2.4.0.2" action_name="backup_view_main_init" module_icon="backup.gif" system_flag=1 diff --git a/html/webapp/modules/bbs/components/View.class.php b/html/webapp/modules/bbs/components/View.class.php index f50520d..32c1541 100644 --- a/html/webapp/modules/bbs/components/View.class.php +++ b/html/webapp/modules/bbs/components/View.class.php @@ -160,7 +160,7 @@ function &getBbses() $sql = "SELECT bbs_id, bbs_name, activity, insert_time, insert_user_id, insert_user_name ". "FROM {bbs} ". "WHERE room_id = ? ". - $this->_db->getOrderSQL($orderParams); + $this->_db->getOrderSQL($orderParams, array('bbs_name', 'activity', 'insert_user_name', 'insert_time')); $bbses = $this->_db->execute($sql, $params, $limit, $offset); if ($bbses === false) { $this->_db->addError(); diff --git a/html/webapp/modules/bbs/install.ini b/html/webapp/modules/bbs/install.ini old mode 100644 new mode 100755 index 4f27b34..4bc9d68 --- a/html/webapp/modules/bbs/install.ini +++ b/html/webapp/modules/bbs/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.1" +version = "2.4.0.2" action_name = "bbs_view_main_init" edit_action_name = "bbs_view_edit_list" search_action = "bbs_view_admin_search" diff --git a/html/webapp/modules/cabinet/action/main/decompress/Decompress.class.php b/html/webapp/modules/cabinet/action/main/decompress/Decompress.class.php index 1aadbd2..edbf63f 100644 --- a/html/webapp/modules/cabinet/action/main/decompress/Decompress.class.php +++ b/html/webapp/modules/cabinet/action/main/decompress/Decompress.class.php @@ -32,16 +32,8 @@ class Cabinet_Action_Main_Decompress extends Action */ function execute() { - if (stristr($_SERVER['HTTP_USER_AGENT'], "Mac")) { - // Macの場合 - $this->cabinetAction->encode = "UTF-8"; - } else if (stristr($_SERVER['HTTP_USER_AGENT'], "Windows")) { - // Windowsの場合 - $this->cabinetAction->encode = "SJIS"; - } else { - $this->cabinetAction->encode = _CHARSET; - } - + $this->cabinetAction->encode = _CLIENT_OS_CHARSET; + $decompress_new_folder = $this->cabinetView->getDecompressNewFolder(); if ($decompress_new_folder == _ON) { diff --git a/html/webapp/modules/cabinet/components/Action.class.php b/html/webapp/modules/cabinet/components/Action.class.php old mode 100644 new mode 100755 index 8efcf8e..4bc51af --- a/html/webapp/modules/cabinet/components/Action.class.php +++ b/html/webapp/modules/cabinet/components/Action.class.php @@ -522,15 +522,7 @@ function compressFile() $archive_file_name = $upload_id; $this->archive_full_path = FILEUPLOADS_DIR."/".$file_path."/".$archive_file_name.".".$extension; - if (stristr($_SERVER['HTTP_USER_AGENT'], "Mac")) { - // Macの場合 - $this->encode = "UTF-8"; - } else if (stristr($_SERVER['HTTP_USER_AGENT'], "Windows")) { - // Windowsの場合 - $this->encode = "SJIS"; - } else { - $this->encode = _CHARSET; - } + $this->encode = _CLIENT_OS_CHARSET; if ($file["file_type"] == CABINET_FILETYPE_FOLDER) { $result = $this->_compressFile($file["file_id"], mb_convert_encoding($file["org_file_name"], $this->encode, "auto")."/"); diff --git a/html/webapp/modules/cabinet/components/View.class.php b/html/webapp/modules/cabinet/components/View.class.php index 0c235fd..98faa62 100644 --- a/html/webapp/modules/cabinet/components/View.class.php +++ b/html/webapp/modules/cabinet/components/View.class.php @@ -201,7 +201,7 @@ function &getCabinets() $sort_col = "insert_time"; } $sort_dir = $this->_request->getParameter("sort_dir"); - if (empty($sort_dir)) { + if ((empty($sort_dir) || ($sort_dir != 'ASC' && $sort_dir != 'asc'))) { $sort_dir = "DESC"; } @@ -215,6 +215,9 @@ function &getCabinets() if ($sort_col == "total_size") { $sql .= " ORDER BY ".$sort_col." ".$sort_dir; } else { + if(!in_array($sort_col, array('cabinet_name', 'total_size', 'insert_user_name', 'insert_time'))) { + $sort_col = "insert_time"; + } $sql .= " ORDER BY manage.".$sort_col." ".$sort_dir; } $sql .= ", manage.cabinet_id DESC"; @@ -672,6 +675,10 @@ function getFileList($offset, $limit) $sort_dir = $this->_request->getParameter("sort_dir"); if (isset($sort_col)) { + if(!in_array($sort_col, array('file_name', 'size', 'insert_user_name', 'insert_time', 'update_user_name', 'update_time', 'comment'))) { + $sort_col = 'file_name'; + } + $sort_dir = (empty($sort_dir) || ($sort_dir != 'DESC' && $sort_dir != 'desc')) ? 'ASC' : 'DESC'; if ($sort_col == "comment") { $order_params = array( "F.file_type" => ($sort_dir == "ASC" ? "DESC" : "ASC"), diff --git a/html/webapp/modules/cabinet/files/js/default/cabinet.js b/html/webapp/modules/cabinet/files/js/default/cabinet.js old mode 100644 new mode 100755 index 2945245..8bd57d3 --- a/html/webapp/modules/cabinet/files/js/default/cabinet.js +++ b/html/webapp/modules/cabinet/files/js/default/cabinet.js @@ -105,6 +105,11 @@ clsCabinet.prototype = { }, sortBy: function(sort_col) { + var fileListEl = $("cabinet_file_list" + this.id); + if (!fileListEl) { + return; + } + if(this.sortCol == null) { this.sortDir = "DESC"; }else { @@ -121,8 +126,6 @@ clsCabinet.prototype = { } this.sortCol = sort_col; - $("cabinet_file_list" + this.id).innerHTML = ""; - var top_el = $(this.id); var params = new Object(); params["param"] = { @@ -134,7 +137,7 @@ clsCabinet.prototype = { "success":"html" }; params["top_el"] = top_el; - params["target_el"] = $("cabinet_file_list" + this.id); + params["target_el"] = fileListEl; params["callbackfunc"] = function(res) { var imgObj = $("cabinet_sort_img" + this.id + "_" + this.sortCol); if(this.sortDir == "ASC") { @@ -149,7 +152,7 @@ clsCabinet.prototype = { this.oldSortCol = null; } }.bind(this); - + commonCls.send(params); }, diff --git a/html/webapp/modules/cabinet/install.ini b/html/webapp/modules/cabinet/install.ini old mode 100644 new mode 100755 index 276732b..061634b --- a/html/webapp/modules/cabinet/install.ini +++ b/html/webapp/modules/cabinet/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.0" +version = "2.4.0.1" action_name="cabinet_view_main_init" edit_action_name="cabinet_view_edit_list" block_add_action="cabinet_view_edit_create" diff --git a/html/webapp/modules/calendar/files/js/default/calendar.js b/html/webapp/modules/calendar/files/js/default/calendar.js old mode 100644 new mode 100755 index a18397a..9953ff4 --- a/html/webapp/modules/calendar/files/js/default/calendar.js +++ b/html/webapp/modules/calendar/files/js/default/calendar.js @@ -633,21 +633,23 @@ clsCalendar.prototype = { if (!el) { switch (type) { case this.CALENDAR_YEARLY: - var el = $("calendar_yearly"+this.id); + el = $("calendar_yearly"+this.id); break; case this.CALENDAR_S_MONTHLY: - var el = $("calendar_s_monthly"+this.id); + el = $("calendar_s_monthly"+this.id); break; case this.CALENDAR_L_MONTHLY: - var el = $("calendar_l_monthly"+this.id); + el = $("calendar_l_monthly"+this.id); break; case this.CALENDAR_WEEKLY: - var el = $("calendar_weekly"+this.id); + el = $("calendar_weekly"+this.id); break; case this.CALENDAR_DAILY: - var el = $("calendar_daily"+this.id); + el = $("calendar_daily"+this.id); break; default: + // スケジュール表示の場合は処理終了 + return; } } if (!Element.hasClassName(el, "display-none")) { diff --git a/html/webapp/modules/calendar/install.ini b/html/webapp/modules/calendar/install.ini old mode 100644 new mode 100755 index 3bfe17d..0144c70 --- a/html/webapp/modules/calendar/install.ini +++ b/html/webapp/modules/calendar/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.2" +version = "2.4.2.1" action_name="calendar_view_main_init" edit_action_name="calendar_view_edit_init" search_action = "calendar_view_admin_search" diff --git a/html/webapp/modules/chat/files/js/default/chat.js b/html/webapp/modules/chat/files/js/default/chat.js old mode 100644 new mode 100755 index 1bec06a..ff8dfae --- a/html/webapp/modules/chat/files/js/default/chat.js +++ b/html/webapp/modules/chat/files/js/default/chat.js @@ -50,6 +50,9 @@ clsChat.prototype = { var top_el = $("chat_form" + this.id); var val_el = Element.getChildElementByClassName(top_el, "chat_text"); var chat_text = val_el ? val_el.value : null; + if (chat_text === '' || chat_text === null) { + return; + } var params = new Object(); params["method"] = "post"; params["top_el"] = top_el; diff --git a/html/webapp/modules/chat/install.ini b/html/webapp/modules/chat/install.ini old mode 100644 new mode 100755 index 5ed9258..82b3805 --- a/html/webapp/modules/chat/install.ini +++ b/html/webapp/modules/chat/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.1" +version = "2.4.0.2" action_name="chat_view_main_init" edit_action_name = "chat_view_edit_init" block_add_action = "chat_action_edit_create" diff --git a/html/webapp/modules/circular/action/main/add/maple.ini b/html/webapp/modules/circular/action/main/add/maple.ini old mode 100644 new mode 100755 index 6db5e47..035fe32 --- a/html/webapp/modules/circular/action/main/add/maple.ini +++ b/html/webapp/modules/circular/action/main/add/maple.ini @@ -11,7 +11,7 @@ circular_subject.required:g="1:lang._required,lang.circular_subject" circular_subject.maxlength = "1,_VALIDATOR_TITLE_LEN:lang._maxlength_error,lang.circular_subject,_VALIDATOR_TITLE_LEN" circular_body.required:g="1:lang._required,lang.circular_body" circular_body.maxlength = "1,_VALIDATOR_TEXTAREA_LEN:lang._maxlength_error,lang.circular_body,_VALIDATOR_TEXTAREA_LEN" -receive_user_ids.required:g="1:lang.circular_required_select" +receive_user_ids.circular.receiveUser = "1:lang.circular_required_select" key:choice_value,reply_type,choice_id.circular.circularChoice:choice = "1:lang.circular_choice_not_exist" period.date:period = "1:lang._invalid_date,lang.circular_period" key:period_checkbox,period.circular.period = "1:lang.circular_period_invalid" diff --git a/html/webapp/modules/circular/components/Action.class.php b/html/webapp/modules/circular/components/Action.class.php old mode 100644 new mode 100755 index ccac87b..fb31768 --- a/html/webapp/modules/circular/components/Action.class.php +++ b/html/webapp/modules/circular/components/Action.class.php @@ -149,7 +149,6 @@ function registCircular() $circularId = intval($circularId); $receiveUserIds = $this->_request->getParameter('receive_user_ids'); - $receiveUserIds = explode(",", $receiveUserIds); foreach ($receiveUserIds as $userID) { $insertParams = array( 'room_id' => $roomId, @@ -476,39 +475,39 @@ function updateUserSeen($type) return true; } - /** - * 新着情報にセットする - * + /** + * 新着情報にセットする + * * @param string $circularId 回覧ID * @return boolean (true:正常/false:異常) - * @access public - */ - function setWhatsnew($circularId) - { - $posts = $this->_db->selectExecute("circular", array("circular_id"=>$circularId)); - if (empty($posts)) { - return false; - } - + * @access public + */ + function setWhatsnew($circularId) + { + $posts = $this->_db->selectExecute("circular", array("circular_id"=>$circularId)); + if (empty($posts)) { + return false; + } + $pageId = $this->_request->getParameter("page_id"); - $whatsnewAction =& $this->_container->getComponent("whatsnewAction"); - - $whatsnew = array( - "unique_id" => $circularId, - "title" => $posts[0]["circular_subject"], - "description" => $posts[0]["circular_body"], - "action_name" => "circular_view_main_detail", - "parameters" => "circular_id=". $circularId . "&page_id=" . $pageId, - "insert_time" => $posts[0]["update_time"], - "update_time" => $posts[0]["update_time"] - ); - $result = $whatsnewAction->auto($whatsnew); - if ($result === false) { - return false; - } - - return true; - } + $whatsnewAction =& $this->_container->getComponent("whatsnewAction"); + + $whatsnew = array( + "unique_id" => $circularId, + "title" => $posts[0]["circular_subject"], + "description" => $posts[0]["circular_body"], + "action_name" => "circular_view_main_detail", + "parameters" => "circular_id=". $circularId . "&page_id=" . $pageId, + "insert_time" => $posts[0]["update_time"], + "update_time" => $posts[0]["update_time"] + ); + $result = $whatsnewAction->auto($whatsnew); + if ($result === false) { + return false; + } + + return true; + } /** * 期限を更新する diff --git a/html/webapp/modules/circular/install.ini b/html/webapp/modules/circular/install.ini old mode 100644 new mode 100755 index 8f51fda..b986437 --- a/html/webapp/modules/circular/install.ini +++ b/html/webapp/modules/circular/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.1" +version = "2.4.1.0" action_name = "circular_view_main_init" edit_action_name = "circular_view_edit_option" search_action = "circular_view_admin_search" diff --git a/html/webapp/modules/circular/language/chinese/main.ini b/html/webapp/modules/circular/language/chinese/main.ini index 9466fb5..f5a46d7 100644 --- a/html/webapp/modules/circular/language/chinese/main.ini +++ b/html/webapp/modules/circular/language/chinese/main.ini @@ -54,7 +54,7 @@ circulr_mobile_reply = "Reply" circulr_mobile_show_reply = "Show reply list" [Circular_View_Main_Detail:Circular_View_Main_Postscript_Add] -circular_postscript_from = "by:" +circular_postscript_from = "by " [Circular_View_Main_Reply] circular_mobile_reply = "Reply" diff --git a/html/webapp/modules/circular/language/english/main.ini b/html/webapp/modules/circular/language/english/main.ini index 9466fb5..f5a46d7 100644 --- a/html/webapp/modules/circular/language/english/main.ini +++ b/html/webapp/modules/circular/language/english/main.ini @@ -54,7 +54,7 @@ circulr_mobile_reply = "Reply" circulr_mobile_show_reply = "Show reply list" [Circular_View_Main_Detail:Circular_View_Main_Postscript_Add] -circular_postscript_from = "by:" +circular_postscript_from = "by " [Circular_View_Main_Reply] circular_mobile_reply = "Reply" diff --git a/html/webapp/modules/circular/language/japanese/main.ini b/html/webapp/modules/circular/language/japanese/main.ini index 6a11205..e8352f6 100644 --- a/html/webapp/modules/circular/language/japanese/main.ini +++ b/html/webapp/modules/circular/language/japanese/main.ini @@ -54,7 +54,7 @@ circulr_mobile_reply = "回答する" circulr_mobile_show_reply = "回答一覧を見る" [Circular_View_Main_Detail:Circular_View_Main_Postscript_Add] -circular_postscript_from = "by:" +circular_postscript_from = "by " [Circular_View_Main_Reply] circular_mobile_reply = "回答する" diff --git a/html/webapp/modules/circular/sql/mysql/table.sql b/html/webapp/modules/circular/sql/mysql/table.sql index 39f8356..cdd7715 100644 --- a/html/webapp/modules/circular/sql/mysql/table.sql +++ b/html/webapp/modules/circular/sql/mysql/table.sql @@ -87,7 +87,7 @@ CREATE TABLE `circular_config` ( `room_id` int(11) NOT NULL default '0', `create_authority` tinyint(1) NOT NULL default '0', `mail_subject` varchar(255) default '', - `mail_body` text NOT NULL default '', + `mail_body` text NOT NULL, `insert_time` varchar(14) NOT NULL default '', `insert_site_id` varchar(40) NOT NULL default '', `insert_user_id` varchar(40) NOT NULL default '', diff --git a/html/webapp/modules/circular/validator/Validator_ReceiveUser.class.php b/html/webapp/modules/circular/validator/Validator_ReceiveUser.class.php new file mode 100755 index 0000000..ddab603 --- /dev/null +++ b/html/webapp/modules/circular/validator/Validator_ReceiveUser.class.php @@ -0,0 +1,57 @@ +getComponent('ActionChain'); + $actionName = $actionChain->getCurActionName(); + + if (empty($attributes)) { + if ($actionName === 'circular_view_main_users') { + return; + } + return $errStr; + } + $db =& $container->getComponent('DbObject'); + + $params = explode(',', $attributes); + $inClauseValue = str_repeat(",?", count($params)); + $sql = "SELECT user_id" . + " FROM {users}" . + " WHERE user_id IN (" . substr($inClauseValue, 1) . ")"; + $users = $db->execute($sql, $params); + if ($users === false) { + return _INVALID_INPUT; + } + $receiveUserIdArr = array(); + foreach ($users as $user) { + $receiveUserIdArr[] = $user['user_id']; + } + $request =& $container->getComponent('Request'); + $request->setParameter('receive_user_ids', $receiveUserIdArr); + + return; + } +} +?> diff --git a/html/webapp/modules/circular/validator/Validator_UserAuthCheck.class.php b/html/webapp/modules/circular/validator/Validator_UserAuthCheck.class.php index e47b1e1..9b7d243 100644 --- a/html/webapp/modules/circular/validator/Validator_UserAuthCheck.class.php +++ b/html/webapp/modules/circular/validator/Validator_UserAuthCheck.class.php @@ -24,18 +24,17 @@ class Circular_Validator_UserAuthCheck extends Validator function validate($attributes, $errStr, $params) { $container =& DIContainerFactory::getContainer(); - $session =& $container->getComponent('Session'); - - if (!$session->getParameter('_user_id')) { - return $errStr; - } - $actionChain =& $container->getComponent('ActionChain'); $actionName = $actionChain->getCurActionName(); if ($actionName == "circular_view_admin_search") { return; } + $session =& $container->getComponent('Session'); + if (!$session->getParameter('_user_id')) { + return $errStr; + } + if ($session->getParameter('_auth_id') < _AUTH_GENERAL) { $filterChain =& $container->getComponent('FilterChain'); $smartyAssign =& $filterChain->getFilterByName('SmartyAssign'); diff --git a/html/webapp/modules/circular/view/admin/search/Search.class.php b/html/webapp/modules/circular/view/admin/search/Search.class.php index 9c01117..c42a15a 100644 --- a/html/webapp/modules/circular/view/admin/search/Search.class.php +++ b/html/webapp/modules/circular/view/admin/search/Search.class.php @@ -40,15 +40,14 @@ class Circular_View_Admin_Search extends Action */ function execute() { - if ($this->block_id_arr) { - $sqlwhere = ' WHERE block.block_id IN ('.implode(',', $this->block_id_arr).')'; - } else { + $user_id = $this->session->getParameter('_user_id'); + if ($user_id === '0' || $user_id === null || !$this->block_id_arr) { return 'success'; } + $sqlwhere = ' WHERE block.block_id IN ('.implode(',', $this->block_id_arr).')'; $sqlwhere .= $this->sqlwhere; $sqlwhere .= ' AND (circular.post_user_id = ? OR user.receive_user_id = ?)'; - $user_id = $this->session->getParameter('_user_id'); $this->params[] = $user_id; $this->params[] = $user_id; diff --git a/html/webapp/modules/circular/view/main/create/Create.class.php b/html/webapp/modules/circular/view/main/create/Create.class.php old mode 100644 new mode 100755 index dfdba8f..b12b7f7 --- a/html/webapp/modules/circular/view/main/create/Create.class.php +++ b/html/webapp/modules/circular/view/main/create/Create.class.php @@ -26,7 +26,7 @@ class Circular_View_Main_Create extends Action var $circularView = null; // 値をセットするため - var $circular_info = null; + var $circular_info = array(); var $circular_user_list = null; var $room_list_array = null; var $group_member_list = null; diff --git a/html/webapp/modules/circular/view/main/users/Users.class.php b/html/webapp/modules/circular/view/main/users/Users.class.php old mode 100644 new mode 100755 index e5e0135..62d01cd --- a/html/webapp/modules/circular/view/main/users/Users.class.php +++ b/html/webapp/modules/circular/view/main/users/Users.class.php @@ -31,7 +31,7 @@ class Circular_View_Main_Users extends Action */ function execute() { - $users = explode(',', $this->receive_user_ids); + $users = (array)$this->receive_user_ids; if (intval($this->selected_room_id) == 0) { $result = $this->circularView->getGroupInfo($this->selected_group_id, $users); if ($result === false) { diff --git a/html/webapp/modules/circular/view/main/users/maple.ini b/html/webapp/modules/circular/view/main/users/maple.ini old mode 100644 new mode 100755 index 4f50e6b..f1e7f72 --- a/html/webapp/modules/circular/view/main/users/maple.ini +++ b/html/webapp/modules/circular/view/main/users/maple.ini @@ -1,6 +1,9 @@ [TokenExtra] mode="nobuild" +[ValidateDef] +receive_user_ids.circular.receiveUser = "1:lang._invalid_input" + [View] define:theme = 0 success = "circular_select_user_list.html" \ No newline at end of file diff --git a/html/webapp/modules/cleanup/action/main/init/Init.class.php b/html/webapp/modules/cleanup/action/main/init/Init.class.php index 50e1cb1..bad5d57 100644 --- a/html/webapp/modules/cleanup/action/main/init/Init.class.php +++ b/html/webapp/modules/cleanup/action/main/init/Init.class.php @@ -75,9 +75,10 @@ function _fileCleanUp($module, $module_name, $cleanup_params) $error_flag = false; $sum_data_count = 0; $file_exists_name_arr = array(); + $delayTime = _CLEANUP_DEL_DAY * 24 * 60 * 60; if(count($uploads) > 0) { foreach($uploads as $upload) { - if($upload['update_time'] >= date("YmdHis",timezone_date(null, true, "U") - _CLEANUP_DEL_DAY*60*60)) { + if($upload['update_time'] >= date("YmdHis",timezone_date(null, true, "U") - $delayTime)) { // ファイルが使用されていたものを配列に格納 $file_exists_name_arr[FILEUPLOADS_DIR.$upload['file_path'] . $upload['physical_file_name']] = true; $file_exists_name_arr[FILEUPLOADS_DIR.$upload['file_path'] .$upload['upload_id']."_thumbnail.".$upload['extension']] = true; diff --git a/html/webapp/modules/cleanup/install.ini b/html/webapp/modules/cleanup/install.ini old mode 100644 new mode 100755 index dd4b11e..8c2c41a --- a/html/webapp/modules/cleanup/install.ini +++ b/html/webapp/modules/cleanup/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.0" +version = "2.4.0.1" action_name="cleanup_view_main_init" module_icon="cleanup.gif" system_flag=1 diff --git a/html/webapp/modules/common/files/js/common.js b/html/webapp/modules/common/files/js/common.js index b9caa57..c499616 100644 --- a/html/webapp/modules/common/files/js/common.js +++ b/html/webapp/modules/common/files/js/common.js @@ -1175,7 +1175,7 @@ clsCommon.prototype = { //} if(this['callbackfunc']){ - if (transport.getResponseHeader("Content-Type") == "text/xml" && transport.responseXML) { + if (transport.getResponseHeader("Content-Type").substring(0, 8) === "text/xml" && transport.responseXML) { res = transport.responseXML; } diff --git a/html/webapp/modules/common/files/js/prototype.js b/html/webapp/modules/common/files/js/prototype.js index 1999240..7f76192 100644 --- a/html/webapp/modules/common/files/js/prototype.js +++ b/html/webapp/modules/common/files/js/prototype.js @@ -343,7 +343,7 @@ var Enumerable = { } catch (e) { /* add Code 2011/04/21 Windows7 64bitOS IE9でWYSIWYGにカーソルを移動し、画面遷移し、再度、WYSIWYGを表示する際にエラーとなるため * こちらでエラーを表示しないようにして対応 */ - if(!(browser.isIE && browser.version >= 9)) { + if(!(browser.isIE && browser.version >= 9) && !browser.isEdge) { if (e != $break) throw e; } } @@ -2966,7 +2966,9 @@ function Browser() { this.isFirefox = false; // FireFox this.isOpera = false; this.isSafari = false; - this.version = null; + this.isEdge = false; + + this.version = null; ua = navigator.userAgent; @@ -2984,6 +2986,15 @@ function Browser() { return; } + s = "Edge"; + if ((i = ua.indexOf(s)) >= 0) { + this.isEdge = true; + this.isGecko = true; + this.isSafari = true; + //this.version = parseFloat(ua.substr(i + s.length)); + return; + } + // IE11 s = "Trident"; if ((i = ua.indexOf(s)) >= 0) { diff --git a/html/webapp/modules/comp/config/insertamazon/define.inc.php b/html/webapp/modules/comp/config/insertamazon/define.inc.php index dcde365..26d4a03 100644 --- a/html/webapp/modules/comp/config/insertamazon/define.inc.php +++ b/html/webapp/modules/comp/config/insertamazon/define.inc.php @@ -11,12 +11,15 @@ * @project NetCommons Project, supported by National Institute of Informatics * @access public */ +/* --- + * 2014-6-4 AWS ACCESS KEY 情報を削除しました define("COMP_XML_ENCODING", "UTF-8"); -define("COMP_AWS_ACCESS_KEY_ID", "AKIAILVYEX6M4DJCGHGA"); -define("COMP_AWS_SECRET_KEY_ID", "ndjGU+Nl0DFdDKPlzvLQsr5CZGduzMO1JtQwEhmJ"); -define("COMP_AWS_ASSOCIATE_TAG", "commonsnet109-22"); +define("COMP_AWS_ACCESS_KEY_ID", "****"); +define("COMP_AWS_SECRET_KEY_ID", "****"); +define("COMP_AWS_ASSOCIATE_TAG", "*****"); define("COMP_AWS_URL", "http://webservices.amazon.co.jp/onca/xml"); define("COMP_AWS_REST", "GET\nwebservices.amazon.co.jp\n/onca/xml\n%s"); //define("COMP_AWS_VISIBLE_ROW", 10); //Amazonでは固定 define("COMP_AWS_DEFAULT_PAGE_NEXT", 4); -?> \ No newline at end of file + */ +?> diff --git a/html/webapp/modules/comp/files/js/comp_popup.js b/html/webapp/modules/comp/files/js/comp_popup.js index dbb5ce2..a0e9606 100644 --- a/html/webapp/modules/comp/files/js/comp_popup.js +++ b/html/webapp/modules/comp/files/js/comp_popup.js @@ -364,7 +364,7 @@ compPopup.prototype = { } if((browser.isIE && browser.version < 9)) iframe.style.display = "none"; //safariの場合、再描画する時に描画処理がはしってしまうためコメント iframe.style.visibility = "hidden"; - if(browser.isOpera) { + if(browser.isOpera || browser.isEdge) { $(this.popupElement).remove(); this.src = null; this.popupElement = null; diff --git a/html/webapp/modules/comp/files/js/plugins/comp_textareamain.js b/html/webapp/modules/comp/files/js/plugins/comp_textareamain.js index 02d9af0..3c636c0 100644 --- a/html/webapp/modules/comp/files/js/plugins/comp_textareamain.js +++ b/html/webapp/modules/comp/files/js/plugins/comp_textareamain.js @@ -338,7 +338,7 @@ compTextareamain.prototype = { exec : function() { var self = this; - if(browser.isIE) { + if(browser.isIE || browser.isEdge) { var spans, font, loop_flag = true; var f = self.currentNode ? self.currentNode : self.getSelectNode(); // 選択NodeTopをselect @@ -358,7 +358,7 @@ compTextareamain.prototype = { return; } f = self.applyInlineStyle('font'); - } else if(f.style.color != '' || f.style.backgroundColor != '' || f.style.fonSize != '' || f.style.fontFamily != '') { + } else if(f.style.color || f.style.backgroundColor || f.style.fonSize || f.style.fontFamily) { font = this.editorDoc.createElement('font'); f = self.replace(font, f, true); } @@ -395,7 +395,7 @@ compTextareamain.prototype = { } } this.editorDoc.execCommand('removeFormat', false, []); - if(browser.isSafari && f.nodeName.toLowerCase() != "body") { + if(browser.isSafari && f.nodeName.toLowerCase() != "body" && !browser.isEdge) { // Class Apple-style-spanを検索し、削除 var remove_el_arr = []; var buf_f = f; @@ -460,7 +460,35 @@ compTextareamain.prototype = { } } else { var sel_n = null; - this.editorDoc.execCommand(name, false, []); + if(!browser.isEdge) + this.editorDoc.execCommand(name, false, []); + else { + var n = this.currentNode ? this.currentNode : this.getSelectNode(); + var r = this.getRange(); + if(n && n.nodeName.toLowerCase() != 'div') { + if(r.startContainer && r.endContainer && + r.startContainer == r.endContainer) { + + var br = r.startContainer.nextSibling; + if(!br) { + br = this.editorDoc.createTextNode(""); + r.insertNode(br); + br = br.nextSibling; + r.setStartBefore(br); + } else { + r.setStartBefore(r.startContainer); + } + r.setEndAfter(br); + this.setRange(r); + } + n = this.applyInlineStyle('div'); + if(n) { + this.rangeSelect(n, 1); + } + } + this.editorDoc.execCommand(name, false, []); + } + var r = this.getRange(); if(r.endContainer && r.endContainer.parentNode) { sel_n = r.endContainer.parentNode; @@ -488,7 +516,7 @@ compTextareamain.prototype = { value : { insertOrderedList : { visible : true, tags : ['ol'], exec : function(e) { - if(!browser.isIE) + if(!browser.isIE && !browser.isEdge) this.editorDoc.execCommand("insertOrderedList", false, []); else { var n = this.applyInlineStyle('div'); @@ -504,7 +532,7 @@ compTextareamain.prototype = { }, insertUnorderedList : { visible : true, tags : ['ul'], exec : function(e) { - if(!browser.isIE) + if(!browser.isIE && !browser.isEdge) this.editorDoc.execCommand("insertUnorderedList", false, []); else { var n = this.applyInlineStyle('div'); @@ -777,7 +805,6 @@ compTextareamain.prototype = { callback : function(args) { var a, bm, v; // リンク挿入 - self.removeDialog(self.dialog_id); self.addFocus(true); if(n && n.nodeName.toLowerCase() != 'a') { bm = self.bookmark; @@ -808,6 +835,7 @@ compTextareamain.prototype = { n.setAttribute(key,args[key],0); a = n; } + self.removeDialog(self.dialog_id); self.rangeSelect(a); self.addUndo(); @@ -1147,7 +1175,8 @@ compTextareamain.prototype = { Event.observe(this.editorDoc,"mouseup", function(e) { self.bookmark = self.getBookmark(); // IEはbookmarkを保持しないため - self.currentNode = self.getSelectNode(); + if (!browser.isEdge) + self.currentNode = self.getSelectNode(); self.checkTargets(Event.element(e)); self.addUndo(); self.closeDialogs(); @@ -1159,7 +1188,7 @@ compTextareamain.prototype = { }, false, this.id); Event.observe(this.editorDoc,"keydown", function(e) { - if(browser.isSafari && (e.keyCode == 46 || e.keyCode == 8)) { + if(browser.isSafari && (e.keyCode == 46 || e.keyCode == 8) && !browser.isEdge) { // 1行選択してdelete(backspace)ボタン、 // または、1行にわたるNodeを選択してdelete(backspace) // ボタンを押すと、そのelementが削除されないため対処 @@ -1274,7 +1303,8 @@ compTextareamain.prototype = { Event.observe(this.editorDoc,"keyup", function(e) { var k = e.keyCode; self.bookmark = self.getBookmark(); // IEはbookmarkを保持しないため - self.currentNode = self.getSelectNode(); + if (!browser.isEdge) + self.currentNode = self.getSelectNode(); if ((k >= 33 && k <= 36) || (k >= 37 && k <= 40) || k == 13 || k == 45 || k == 46 || k == 8 || (e.ctrlKey && (k == 86 || k == 88)) || k.ctrlKey || (this.is_mac && (k == 91 || k == 93))) { // enter、上下左右、baskspace, Delキー,カット&ペーストならば、checkTargetsを呼び出す @@ -1756,6 +1786,11 @@ compTextareamain.prototype = { self.resize.parentNode.removeChild(self.resize); Event.stopObserving(document,"mousemove", resizeMouseMove,false); Event.stopObserving(document,"mouseup", resizeMouseUp,false); + if (browser.isIE && document.removeEventListener) { + // 画像アップロードのポップアップを2度表示すると、イベントが止まらなくなるため、原因不明だが手動で停止 + document.removeEventListener("mousemove", resizeMouseMove,false); + document.removeEventListener("mouseup", resizeMouseUp,false); + } (mode != "html") ? Element.setStyle(self.editor, {display:'block'}) : Element.setStyle(self.original, {display:'block'}); self._setStyleWithCSS(); @@ -1959,11 +1994,14 @@ compTextareamain.prototype = { var path = document.getElementById('path_'+ this.top_id); path.innerHTML = ''; path.appendChild(spn); - var n_el = el, buf_n; + var n_el = el, buf_n,currentNode; do { nodeN = el.nodeName.toLowerCase(); - if ( el.nodeType != 1 || nodeN == 'body' || nodeN == 'html') + if ( el.nodeType != 1 || nodeN == 'body' || nodeN == 'html') break; + if(!currentNode) { + currentNode = el; + } if(nodeN == "b") nodeN = "strong"; @@ -2005,6 +2043,8 @@ compTextareamain.prototype = { pa = a; t++; } while ( el = el.parentNode ); + if (browser.isEdge) + self.currentNode = currentNode; }, checkTargets : function( element ) @@ -3643,14 +3683,18 @@ compTextareamain.prototype = { function replaceFonts() { var bm, c_el, r_el; - var tags = new Array('span', 'font', 'img'); + if (!browser.isEdge) { + var tags = new Array('span', 'font', 'img'); + } else { + var tags = new Array('span', 'font', 'img', 'a'); + } var tags_length = tags.length; for (var k = tags_length; k > 0; ) { var target_ar = t.editorDoc.getElementsByTagName(tags[--k]); var target_ar_length = target_ar.length; for (var i = target_ar_length; i > 0; i--) { var el = target_ar[i - 1]; - if (el.style.fontFamily == 'nc_wysiwygfont' || (el.face && el.face == 'nc_wysiwygfont') || (el.src && el.src.match(/nc_wysiwygurl$/))) { + if (el.style.fontFamily == 'nc_wysiwygfont' || (el.face && el.face == 'nc_wysiwygfont') || (el.src && el.src.match(/nc_wysiwygurl$/)) || (el.href && el.href.match(/nc_wysiwygurl$/))) { if (!bm) bm = t.getBookmark(); @@ -3661,8 +3705,9 @@ compTextareamain.prototype = { spn.innerHTML = na; c_el = spn.childNodes[0]; - } else + } else { c_el = t.editorDoc.createElement(na); + } if (!r_el) r_el = c_el; t.replace(t.attrs(c_el, at), el, 1); @@ -3758,10 +3803,17 @@ compTextareamain.prototype = { // Create inline elements t.addFocus(); - if(collapsed) + + var r = t.getRange(); + if (r.collapsed && browser.isEdge) { + t.editorDoc.execCommand('inserthtml', false, ''); + } else if (collapsed) { t.editorDoc.execCommand('insertImage', false, 'nc_wysiwygurl'); - else + } else if (browser.isEdge) { + t.editorDoc.execCommand('createLink', false, 'nc_wysiwygurl'); + } else { t.editorDoc.execCommand('fontName', false, 'nc_wysiwygfont'); + } r_el = replaceFonts(); if(t._keyhandler) { Event.stopObserving(this.editorDoc,"keyup",t._keyhandler); diff --git a/html/webapp/modules/dialog/files/js/default/pagestyle.js b/html/webapp/modules/dialog/files/js/default/pagestyle.js index d47fcd3..41edb87 100644 --- a/html/webapp/modules/dialog/files/js/default/pagestyle.js +++ b/html/webapp/modules/dialog/files/js/default/pagestyle.js @@ -1,533 +1,533 @@ -var clsPagestyle = Class.create(); - -clsPagestyle.prototype = { - initialize: function() { - this.id = null; - this.top_el = null; - - this.lang_down_arrow = null; - this.lang_right_arrow = null; - - this.lang_cancel_confirm = null; - - this.themefields = null; - this.theme_name = null; - this.header_flag = null; - this.leftcolumn_flag = null; - this.rightcolumn_flag = null; - - this.header_el = null; - this.header_id_el = null; - this.leftcolumn_el = null; - this.centercolumn_el = null; - this.rightcolumn_el = null; - this.footer_el = null; - - this.colorclick_flag = false; - - this.chg_flag = false; - this.initColorFlag = false; - this.initStr = ""; - this.tabset = null; - }, - init: function(id, page_id, theme_name, header_flag, leftcolumn_flag, rightcolumn_flag, active_tab, change_flag, lang_cancel_confirm, lang_style, lang_theme, lang_layout, lang_coloration, lang_down_arrow, lang_right_arrow, pages_action, permalink_prohibition, permalink_prohibition_replace) { - this.id = id; - this.page_id = page_id; - this.theme_name = theme_name; - this.header_flag = header_flag; - this.leftcolumn_flag = leftcolumn_flag; - this.rightcolumn_flag = rightcolumn_flag; - - this.pages_action = pages_action; - this.permalink_prohibition = permalink_prohibition; - this.permalink_prohibition_replace = permalink_prohibition_replace; - - var top_el = $(id); - this.top_el = top_el; - this.header_id_el = $("__headercolumn"); - this.header_el = $("_headercolumn"); - if(this.header_el) { - this.header_add_module_el = Element.getChildElementByClassName(this.header_el, "headercolumn_addmodule"); - } - this.leftcolumn_el = $("_leftcolumn"); - this.centercolumn_el = $("_centercolumn"); - this.rightcolumn_el =$("_rightcolumn"); - this.footer_el = $("_footercolumn"); - - /* タブ */ - tabset = new compTabset(top_el); - tabset.addTabset(lang_theme, null); - tabset.addTabset(lang_style,pagestyleCls.clkStyle.bind($(id))); - tabset.addTabset(lang_layout); - tabset.addTabset(lang_coloration, null, pagestyleCls.clkColor.bind(this)); - - tabset.setActiveIndex(valueParseInt(active_tab)); - - tabset.render(); - if(change_flag != "") { - this.chg_flag = true; - } else { - this.chg_flag = false; - } - this.tabset = tabset; - this.lang_cancel_confirm = lang_cancel_confirm; - this.lang_down_arrow = lang_down_arrow; - this.lang_right_arrow = lang_right_arrow; - - //Initに時間がかかる処理は後回し - //setTimeout(pagestyleCls.InitTimer.bind(this), 0); - }, - clkStyle: function() { - var top_el = this; - var form = top_el.getElementsByTagName("form")[0]; - commonCls.focus(form.page_name); - }, - clkColor: function() { - this.initColorFlag = true; - this.initStr = ""; - var coloration_el =$("_pagestyle_color"); - if(coloration_el != null) { - //配色取得 - this.setHighlightColor(document.body, "_pagestyle_body","backgroundColor"); - this.setHighlightColor(this.header_el, "_pagestyle_headercolumn","backgroundColor"); - this.setHighlightColor(this.leftcolumn_el, "_pagestyle_leftcolumn","backgroundColor"); - this.setHighlightColor(this.centercolumn_el, "_pagestyle_centercolumn","backgroundColor"); - this.setHighlightColor(this.rightcolumn_el, "_pagestyle_rightcolumn","backgroundColor"); - this.setHighlightColor(this.footer_el, "_pagestyle_footercolumn","backgroundColor"); - - this.setHighlightColor(this.header_el, "_pagestyle_headercolumn_border_top_color","borderTopColor"); - this.setHighlightColor(this.header_el, "_pagestyle_headercolumn_border_right_color","borderRightColor"); - this.setHighlightColor(this.header_el, "_pagestyle_headercolumn_border_bottom_color","borderBottomColor"); - this.setHighlightColor(this.header_el, "_pagestyle_headercolumn_border_left_color","borderLeftColor"); - - this.setHighlightColor(this.leftcolumn_el, "_pagestyle_leftcolumn_border_top_color","borderTopColor"); - this.setHighlightColor(this.leftcolumn_el, "_pagestyle_leftcolumn_border_right_color","borderRightColor"); - this.setHighlightColor(this.leftcolumn_el, "_pagestyle_leftcolumn_border_bottom_color","borderBottomColor"); - this.setHighlightColor(this.leftcolumn_el, "_pagestyle_leftcolumn_border_left_color","borderLeftColor"); - - this.setHighlightColor(this.centercolumn_el, "_pagestyle_centercolumn_border_top_color","borderTopColor"); - this.setHighlightColor(this.centercolumn_el, "_pagestyle_centercolumn_border_right_color","borderRightColor"); - this.setHighlightColor(this.centercolumn_el, "_pagestyle_centercolumn_border_bottom_color","borderBottomColor"); - this.setHighlightColor(this.centercolumn_el, "_pagestyle_centercolumn_border_left_color","borderLeftColor"); - - this.setHighlightColor(this.rightcolumn_el, "_pagestyle_rightcolumn_border_top_color","borderTopColor"); - this.setHighlightColor(this.rightcolumn_el, "_pagestyle_rightcolumn_border_right_color","borderRightColor"); - this.setHighlightColor(this.rightcolumn_el, "_pagestyle_rightcolumn_border_bottom_color","borderBottomColor"); - this.setHighlightColor(this.rightcolumn_el, "_pagestyle_rightcolumn_border_left_color","borderLeftColor"); - - this.setHighlightColor(this.footer_el, "_pagestyle_footercolumn_border_top_color","borderTopColor"); - this.setHighlightColor(this.footer_el, "_pagestyle_footercolumn_border_right_color","borderRightColor"); - this.setHighlightColor(this.footer_el, "_pagestyle_footercolumn_border_bottom_color","borderBottomColor"); - this.setHighlightColor(this.footer_el, "_pagestyle_footercolumn_border_left_color","borderLeftColor"); - } - this.initColorFlag = false; - if(this.initStr != "") { - var color_params = new Object(); - color_params["method"] = "post"; - color_params["param"] = "dialog_pagestyle_action_edit_change&page_id="+this.page_id+"&_pagestyle_flag=1"+this.initStr; - commonCls.send(color_params); - } - }, - setHighlightColor: function(el, child_class_name, property_name) { - if(el) { - //background-image対応 - var bgImageStyle = "none"; - if(property_name == "backgroundColor" || property_name == "background-color") { - bgImageStyle = Element.getStyle(el, "backgroundImage"); - } - - var color = commonCls.getColorCode(el,property_name); - var column_el = $(child_class_name); - ////var highlight_flag = false; - var count = 0; - for (var i = 0,column_len = column_el.childNodes.length; i < column_len; i++) { - var child_el = column_el.childNodes[i]; - if(child_el.nodeType == 1) { - if(child_el.tagName.toLowerCase() == "a" && child_el.title == color && bgImageStyle == "none") { - Element.addClassName(child_el, "highlight"); - //if(count != 0) { - child_el.onclick(); - //} - break; - } else if(child_el.tagName.toLowerCase() == "select") { - //background-image - if(bgImageStyle != "none") { - var selected_flag = false; - var select_el = child_el; - // urlの中身だけ残す - if(bgImageStyle.match("^url[(]{1}\"")) { - var repBgImageStyle = bgImageStyle.replace(_nc_base_url, "").replace("../", "").replace("url(\"", "").replace("\")", ""); - } else { - var repBgImageStyle = bgImageStyle.replace(_nc_base_url, "").replace("../", "").replace("url(", "").replace(")", ""); - } - for (var j = 0, option_len = select_el.childNodes.length; j < option_len; j++) { - var option_el = select_el.childNodes[j]; - if(option_el.value.match(repBgImageStyle)) { - option_el.selected = "selected"; - selected_flag = true; - select_el.onchange(); - break; - } - } - } - } else if(child_el.tagName.toLowerCase() == "input" && child_el.type != "hidden") { - if(color != "transparent") { - child_el.value = color; - child_el.onchange(); - } - //break; - } - count++; - } - } - - } else { - //レイアウトで表示していないカラム - commonCls.displayNone($(child_class_name)); - var sub_el = $(child_class_name + "_border"); - if(sub_el) { - commonCls.displayNone(sub_el); - } - } - }, - displayChange: function(this_el, el) { - var img_el = Element.getChildElement(this_el); - if(img_el.src.match("down_arrow.gif")) { - img_el.src = img_el.src.replace("down_arrow.gif","right_arrow.gif"); - img_el.alt = this.lang_right_arrow; - this_el.title = this.lang_right_arrow; - } else { - img_el.src = img_el.src.replace("right_arrow.gif","down_arrow.gif"); - img_el.alt = this.lang_down_arrow; - this_el.title = this.lang_down_arrow; - } - if(el == null || el == undefined) { - var next_el = this_el.nextSibling; - if(Element.hasClassName(next_el,"_blockstyle_custom_sample")) { - next_el = next_el.nextSibling; - } - commonCls.displayChange(next_el); - } else { - commonCls.displayChange($(el)); - } - }, - themeClick: function(this_el, theme_name) { - if(!this.themefields) { - var pagestyle_top = $("_pagestyle_top"); - this.themefields = Element.getElementsByClassName(pagestyle_top, "_pagestyle"); - } - var return_flag = false; - this.themefields.each(function(field) { - if(Element.hasClassName(field,"highlight")) { - if(field == this_el) { - /* 変更なし */ - return_flag = true; - return; - } else { - Element.removeClassName(field,"highlight"); - } - } - }.bind(this)); - if(return_flag) { - return; - } - Element.addClassName(this_el,"highlight"); - - /* send */ - var all_apply = 0; - var defultcolor_params = new Object(); - - defultcolor_params["method"] = "post"; - defultcolor_params["param"] = {"action":"dialog_pagestyle_action_edit_setdefault","page_id":this.page_id,"_pagestyle_flag":1,"all_apply":all_apply,"sesson_only":1}; - defultcolor_params["callbackfunc"] = function(){ - var theme_params = new Object(); - theme_params["method"] = "post"; - theme_params["param"] = {"action":"dialog_pagestyle_action_edit_change","page_id":this.page_id,"_pagestyle_flag":1,"theme_name": theme_name}; - theme_params["callbackfunc"] = function(){ - this.refresh(0); - }.bind(this); - commonCls.send(theme_params); - }.bind(this); - commonCls.send(defultcolor_params); - }, - /* 配色クリック */ - colorClick: function(class_name, property_name, color, this_el) { - if(this_el.tagName.toLowerCase() != "select" && (color == "" || color =="1px solid " || this.colorclick_flag == true || (color.length == 7 && color.indexOf('#') != 0))) { - return; - } - if(property_name == "backgroundColor" && color == null) color = this_el.title; - else if(color == null && this_el.title == "transparent") color = "0px none"; - else if(color == null) color = "1px solid " + this_el.title; - if(typeof class_name == "string") { - var el = Element.getChildElementByClassName(document.body, class_name); - var send_name = class_name+"_"+property_name; - } else { - var el = class_name; - var send_name = "body"+"_"+property_name; - } - if(!this.initColorFlag) { - this.colorclick_flag = true; - if(property_name == "backgroundColor") { - // backgroundクリア - el.style.background = "none" ; - } - if(property_name == "background" && color == "") { - color = "none"; - } - eval("el.style."+property_name + "=\"" + color+"\";"); - if(!(browser.isIE) && property_name.match("border")) { - //firefoxのborderの場合、すぐに反映されないため - $("_container").style.display = "none"; - } - var color_params = new Object(); - color_params["method"] = "post"; - color_params["param"] = "dialog_pagestyle_action_edit_change&page_id="+this.page_id+"&_pagestyle_flag=1&"+send_name+"="+encodeURIComponent(color); - color_params["callbackfunc"] = function(){ - this.colorclick_flag = false; - if(!(browser.isIE) && property_name.match("border") ) { - $("_container").style.display = "table"; - } - }.bind(this); - commonCls.send(color_params); - this.setHighlight(this_el); - this.chg_flag = true; - } else { - //pagestyle_list初期化文字列作成 - this.initStr += "&"+send_name+"="+encodeURIComponent(color); - } - }, - setHighlight: function(this_el) { - for (var i = 0; i < this_el.parentNode.childNodes.length; i++) { - var child_el = this_el.parentNode.childNodes[i]; - if(child_el.nodeType != 1) continue; - if(Element.hasClassName(child_el,"highlight")) { - Element.removeClassName(child_el,"highlight"); - } else if(this_el.tagName.toLowerCase() != "select" && child_el.tagName.toLowerCase() == "select") { - child_el.selectedIndex = 0; - } else if(this_el.tagName.toLowerCase() != "input" && child_el.tagName.toLowerCase() == "input" && child_el.type != "hidden") { - child_el.value = ""; - } - } - if(this_el.tagName.toLowerCase() != "input" && this_el.tagName.toLowerCase() != "select") { - Element.addClassName(this_el,"highlight"); - } - }, - /* 規定値に戻す */ - defaultColorClick: function() { - var top_el = $(this.id); - var form = top_el.getElementsByTagName("form")[0]; - if(form.pagestyle_all_apply) { - if(form.pagestyle_all_apply.checked) { - var all_apply = 1; - } else { - var all_apply = 0; - } - } else { - var all_apply = 0; - } - /* send */ - var defultcolor_params = new Object(); - - defultcolor_params["method"] = "post"; - defultcolor_params["param"] = {"action":"dialog_pagestyle_action_edit_setdefault","page_id":this.page_id,"_pagestyle_flag":1,"all_apply":all_apply}; - defultcolor_params["callbackfunc"] = function(){ - this.refresh(3); - }.bind(this); - commonCls.send(defultcolor_params); - }, - /* レイアウトクリック */ - layoutClick: function(el , header_flag, leftcolum_flag, rightcolumn_flag) { - if(Element.hasClassName(el,"highlight")) { - //変更なし - return; - } - this.chg_flag = true; - var pagestyle_layout_el = Element.getParentElementByClassName(el, "_pagestyle_layout"); - var highlight_el = Element.getChildElementByClassName(pagestyle_layout_el, "highlight"); - Element.removeClassName(highlight_el,"highlight"); - Element.addClassName(el,"highlight"); - var refresh_flag = false; - if(header_flag) { - if(this.header_id_el) { - if(this.header_add_module_el) commonCls.displayVisible(this.header_add_module_el); - commonCls.displayVisible(this.header_id_el); - } else { - refresh_flag = true; - } - this.header_flag = 1; - } else { - if(this.header_add_module_el) commonCls.displayNone(this.header_add_module_el); - if(this.header_id_el) commonCls.displayNone(this.header_id_el); - this.header_flag = 0; - } - var colspan = 1; - if(leftcolum_flag) { - colspan++; - if(this.leftcolumn_el) { - commonCls.displayVisible(this.leftcolumn_el); - } else { - refresh_flag = true; - } - this.leftcolumn_flag = 1; - } else { - if(this.leftcolumn_el) commonCls.displayNone(this.leftcolumn_el); - this.leftcolumn_flag = 0; - } - if(rightcolumn_flag) { - colspan++; - if(this.rightcolumn_el) { - commonCls.displayVisible(this.rightcolumn_el); - } else { - refresh_flag = true; - } - this.rightcolumn_flag = 1; - } else { - if(this.rightcolumn_el) commonCls.displayNone(this.rightcolumn_el); - this.rightcolumn_flag = 0; - } - if(this.header_id_el) { - this.header_id_el.colspan = colspan; - } - if(this.footer_el) { - this.footer_el.colspan = colspan; - } - var layout_params = new Object(); - layout_params["method"] = "post"; - layout_params["param"] = {"action":"dialog_pagestyle_action_edit_change","_pagestyle_flag":1,"page_id":this.page_id,"header_flag": this.header_flag,"leftcolumn_flag": this.leftcolumn_flag,"rightcolumn_flag": this.rightcolumn_flag}; - layout_params["callbackfunc"] = function(){ - if(refresh_flag != "" || !(browser.isIE)) { - this.refresh(2); - } - }.bind(this); - commonCls.send(layout_params); - }, - refresh: function(active_tab, append_str) { - var top_el = $(this.id); - append_str = (append_str == undefined || append_str == null) ? "" : append_str; - var str = "&_layoutmode=off"; - if(active_tab != undefined && active_tab != null) { - str += "&active_tab="+active_tab; - } - location.href = _nc_base_url + _nc_index_file_name + "?action="+ this.pages_action+"&page_id="+this.page_id+ - "&_pagestyle_flag=1&pagestyle_x="+top_el.parentNode.style.left+"&pagestyle_y="+top_el.parentNode.style.top+ - str + append_str; - }, - //行揃え変更 - chgGeneral: function(el) { - var top_el = $(this.id); - var form = top_el.getElementsByTagName("form")[0]; - var name = el.name; - var hidden_el = el.nextSibling; - if(hidden_el.value == el.value) { - // 変更なし - return; - } - this.chg_flag = true; - var container_el = $("_container"); - if(name == "align") { - if(el.value == "center") { - form.leftmargin.value = "0"; - form.rightmargin.value = "0"; - container_el.style.marginRight = ""; - container_el.style.marginLeft = ""; - var buf_hidden_el = form.leftmargin.nextSibling; - buf_hidden_el.value = "0"; - var buf_hidden_el = form.rightmargin.nextSibling; - buf_hidden_el.value = "0"; - } - container_el.align = el.value; - container_el.style.textAlign = el.value; - } else if(name == "topmargin") { - container_el.style.marginTop = el.value + "px"; - } else if(name == "rightmargin") { - container_el.style.marginRight = el.value + "px"; - } else if(name == "bottommargin") { - container_el.style.marginBottom = el.value + "px"; - } else if(name == "leftmargin") { - container_el.style.marginLeft = el.value + "px"; - } - if((name == "leftmargin" || name == "rightmargin") && el.value != "0" && form.align.value == "center") { - form.align.value = "left"; - container_el.align = "left"; - container_el.style.textAlign = "left"; - var buf_hidden_el = form.align.nextSibling; - buf_hidden_el.value = "left"; - } - if(name == "page_name") { - var robj = new RegExp(this.permalink_prohibition, "ig"); - if(hidden_el.value.replace(robj, this.permalink_prohibition_replace) == form.permalink.value.replace(robj, this.permalink_prohibition_replace)) { - form.permalink.value = el.value.replace(robj, this.permalink_prohibition_replace); - } - } - hidden_el.value = el.value; - //session情報に追記 - var general_params = new Object(); - general_params["method"] = "post"; - general_params["param"] = {"action":"dialog_pagestyle_action_edit_change","_pagestyle_flag":1,"page_id":this.page_id}; - general_params["param"][name] = el.value; - commonCls.send(general_params); - }, - /*OK*/ - okClick: function(id) { - var top_el = $(this.id); - var form = top_el.getElementsByTagName("form")[0]; - if(form.pagestyle_all_apply) { - if(form.pagestyle_all_apply.checked) { - var all_apply = 1; - } else { - var all_apply = 0; - } - } else { - var all_apply = 0; - } - if(this.chg_flag) { - setTimeout(function() { - var top_el = $(this.id); - var theme_params = new Object(); - if(typeof form.titletag != "undefined") { - var titletag = form.titletag.value; - } else { - var titletag = null; - } - if(typeof form.permalink != "undefined") { - var permalink = form.permalink.value; - } else { - var permalink = null; - } - - theme_params["method"] = "post"; - theme_params["top_el"] = $(this.id); - theme_params["param"] = {"action":"dialog_pagestyle_action_edit_init","page_id":this.page_id,"page_name":form.page_name.value,"permalink":permalink,"titletag":titletag,"meta_description":form.meta_description.value,"meta_keywords":form.meta_keywords.value,"_pagestyle_flag":1,"all_apply":all_apply,"prefix_id_name":"dialog_pagestyle"}; - theme_params["callbackfunc"] = function(res){ - if(form.permalink_url && form.permalink.value != undefined && form.permalink.value != '') { - location.href = form.permalink_url.value + form.permalink.value + '/'; - } else { - location.href = _nc_base_url + _nc_index_file_name + "?action=" + this.pages_action + "&page_id="+this.page_id; - } - }.bind(this); - theme_params["callbackfunc_error"] = function(res){ - commonCls.alert(res); - this.tabset.setActiveIndex(1); - this.tabset.refresh(); - }.bind(this); - commonCls.send(theme_params); - }.bind(this),300); - } else { - //変更なし - commonCls.removeBlock(id); - } - }, - /*キャンセル*/ - cancelClick: function(id) { - if(this.chg_flag) { - if(!commonCls.confirm(this.lang_cancel_confirm))return false; - location.href = _nc_base_url + _nc_index_file_name + "?action=pages_view_main&page_id="+this.page_id; - } else { - //変更なし - commonCls.removeBlock(id); - } - //location.href = _nc_base_url + _nc_index_file_name + "?action=pages_view_main&page_id="+this.page_id; - } -} - +var clsPagestyle = Class.create(); + +clsPagestyle.prototype = { + initialize: function() { + this.id = null; + this.top_el = null; + + this.lang_down_arrow = null; + this.lang_right_arrow = null; + + this.lang_cancel_confirm = null; + + this.themefields = null; + this.theme_name = null; + this.header_flag = null; + this.leftcolumn_flag = null; + this.rightcolumn_flag = null; + + this.header_el = null; + this.header_id_el = null; + this.leftcolumn_el = null; + this.centercolumn_el = null; + this.rightcolumn_el = null; + this.footer_el = null; + + this.colorclick_flag = false; + + this.chg_flag = false; + this.initColorFlag = false; + this.initStr = ""; + this.tabset = null; + }, + init: function(id, page_id, theme_name, header_flag, leftcolumn_flag, rightcolumn_flag, active_tab, change_flag, lang_cancel_confirm, lang_style, lang_theme, lang_layout, lang_coloration, lang_down_arrow, lang_right_arrow, pages_action, permalink_prohibition, permalink_prohibition_replace) { + this.id = id; + this.page_id = page_id; + this.theme_name = theme_name; + this.header_flag = header_flag; + this.leftcolumn_flag = leftcolumn_flag; + this.rightcolumn_flag = rightcolumn_flag; + + this.pages_action = pages_action; + this.permalink_prohibition = permalink_prohibition; + this.permalink_prohibition_replace = permalink_prohibition_replace; + + var top_el = $(id); + this.top_el = top_el; + this.header_id_el = $("__headercolumn"); + this.header_el = $("_headercolumn"); + if(this.header_el) { + this.header_add_module_el = Element.getChildElementByClassName(this.header_el, "headercolumn_addmodule"); + } + this.leftcolumn_el = $("_leftcolumn"); + this.centercolumn_el = $("_centercolumn"); + this.rightcolumn_el =$("_rightcolumn"); + this.footer_el = $("_footercolumn"); + + /* タブ */ + tabset = new compTabset(top_el); + tabset.addTabset(lang_theme, null); + tabset.addTabset(lang_style,pagestyleCls.clkStyle.bind($(id))); + tabset.addTabset(lang_layout); + tabset.addTabset(lang_coloration, null, pagestyleCls.clkColor.bind(this)); + + tabset.setActiveIndex(valueParseInt(active_tab)); + + tabset.render(); + if(change_flag != "") { + this.chg_flag = true; + } else { + this.chg_flag = false; + } + this.tabset = tabset; + this.lang_cancel_confirm = lang_cancel_confirm; + this.lang_down_arrow = lang_down_arrow; + this.lang_right_arrow = lang_right_arrow; + + //Initに時間がかかる処理は後回し + //setTimeout(pagestyleCls.InitTimer.bind(this), 0); + }, + clkStyle: function() { + var top_el = this; + var form = top_el.getElementsByTagName("form")[0]; + commonCls.focus(form.page_name); + }, + clkColor: function() { + this.initColorFlag = true; + this.initStr = ""; + var coloration_el =$("_pagestyle_color"); + if(coloration_el != null) { + //配色取得 + this.setHighlightColor(document.body, "_pagestyle_body","backgroundColor"); + this.setHighlightColor(this.header_el, "_pagestyle_headercolumn","backgroundColor"); + this.setHighlightColor(this.leftcolumn_el, "_pagestyle_leftcolumn","backgroundColor"); + this.setHighlightColor(this.centercolumn_el, "_pagestyle_centercolumn","backgroundColor"); + this.setHighlightColor(this.rightcolumn_el, "_pagestyle_rightcolumn","backgroundColor"); + this.setHighlightColor(this.footer_el, "_pagestyle_footercolumn","backgroundColor"); + + this.setHighlightColor(this.header_el, "_pagestyle_headercolumn_border_top_color","borderTopColor"); + this.setHighlightColor(this.header_el, "_pagestyle_headercolumn_border_right_color","borderRightColor"); + this.setHighlightColor(this.header_el, "_pagestyle_headercolumn_border_bottom_color","borderBottomColor"); + this.setHighlightColor(this.header_el, "_pagestyle_headercolumn_border_left_color","borderLeftColor"); + + this.setHighlightColor(this.leftcolumn_el, "_pagestyle_leftcolumn_border_top_color","borderTopColor"); + this.setHighlightColor(this.leftcolumn_el, "_pagestyle_leftcolumn_border_right_color","borderRightColor"); + this.setHighlightColor(this.leftcolumn_el, "_pagestyle_leftcolumn_border_bottom_color","borderBottomColor"); + this.setHighlightColor(this.leftcolumn_el, "_pagestyle_leftcolumn_border_left_color","borderLeftColor"); + + this.setHighlightColor(this.centercolumn_el, "_pagestyle_centercolumn_border_top_color","borderTopColor"); + this.setHighlightColor(this.centercolumn_el, "_pagestyle_centercolumn_border_right_color","borderRightColor"); + this.setHighlightColor(this.centercolumn_el, "_pagestyle_centercolumn_border_bottom_color","borderBottomColor"); + this.setHighlightColor(this.centercolumn_el, "_pagestyle_centercolumn_border_left_color","borderLeftColor"); + + this.setHighlightColor(this.rightcolumn_el, "_pagestyle_rightcolumn_border_top_color","borderTopColor"); + this.setHighlightColor(this.rightcolumn_el, "_pagestyle_rightcolumn_border_right_color","borderRightColor"); + this.setHighlightColor(this.rightcolumn_el, "_pagestyle_rightcolumn_border_bottom_color","borderBottomColor"); + this.setHighlightColor(this.rightcolumn_el, "_pagestyle_rightcolumn_border_left_color","borderLeftColor"); + + this.setHighlightColor(this.footer_el, "_pagestyle_footercolumn_border_top_color","borderTopColor"); + this.setHighlightColor(this.footer_el, "_pagestyle_footercolumn_border_right_color","borderRightColor"); + this.setHighlightColor(this.footer_el, "_pagestyle_footercolumn_border_bottom_color","borderBottomColor"); + this.setHighlightColor(this.footer_el, "_pagestyle_footercolumn_border_left_color","borderLeftColor"); + } + this.initColorFlag = false; + if(this.initStr != "") { + var color_params = new Object(); + color_params["method"] = "post"; + color_params["param"] = "dialog_pagestyle_action_edit_change&page_id="+this.page_id+"&_pagestyle_flag=1"+this.initStr; + commonCls.send(color_params); + } + }, + setHighlightColor: function(el, child_class_name, property_name) { + if(el) { + //background-image対応 + var bgImageStyle = "none"; + if(property_name == "backgroundColor" || property_name == "background-color") { + bgImageStyle = Element.getStyle(el, "backgroundImage"); + } + + var color = commonCls.getColorCode(el,property_name); + var column_el = $(child_class_name); + ////var highlight_flag = false; + var count = 0; + for (var i = 0,column_len = column_el.childNodes.length; i < column_len; i++) { + var child_el = column_el.childNodes[i]; + if(child_el.nodeType == 1) { + if(child_el.tagName.toLowerCase() == "a" && child_el.title == color && bgImageStyle == "none") { + Element.addClassName(child_el, "highlight"); + //if(count != 0) { + child_el.onclick(); + //} + break; + } else if(child_el.tagName.toLowerCase() == "select") { + //background-image + if(bgImageStyle != "none") { + var selected_flag = false; + var select_el = child_el; + // urlの中身だけ残す + if(bgImageStyle.match("^url[(]{1}\"")) { + var repBgImageStyle = bgImageStyle.replace(_nc_base_url, "").replace("../", "").replace("url(\"", "").replace("\")", ""); + } else { + var repBgImageStyle = bgImageStyle.replace(_nc_base_url, "").replace("../", "").replace("url(", "").replace(")", ""); + } + for (var j = 0, option_len = select_el.childNodes.length; j < option_len; j++) { + var option_el = select_el.childNodes[j]; + if(option_el.value.match(repBgImageStyle)) { + option_el.selected = "selected"; + selected_flag = true; + select_el.onchange(); + break; + } + } + } + } else if(child_el.tagName.toLowerCase() == "input" && child_el.type != "hidden") { + if(color != "transparent") { + child_el.value = color; + child_el.onchange(); + } + //break; + } + count++; + } + } + + } else { + //レイアウトで表示していないカラム + commonCls.displayNone($(child_class_name)); + var sub_el = $(child_class_name + "_border"); + if(sub_el) { + commonCls.displayNone(sub_el); + } + } + }, + displayChange: function(this_el, el) { + var img_el = Element.getChildElement(this_el); + if(img_el.src.match("down_arrow.gif")) { + img_el.src = img_el.src.replace("down_arrow.gif","right_arrow.gif"); + img_el.alt = this.lang_right_arrow; + this_el.title = this.lang_right_arrow; + } else { + img_el.src = img_el.src.replace("right_arrow.gif","down_arrow.gif"); + img_el.alt = this.lang_down_arrow; + this_el.title = this.lang_down_arrow; + } + if(el == null || el == undefined) { + var next_el = this_el.nextSibling; + if(Element.hasClassName(next_el,"_blockstyle_custom_sample")) { + next_el = next_el.nextSibling; + } + commonCls.displayChange(next_el); + } else { + commonCls.displayChange($(el)); + } + }, + themeClick: function(this_el, theme_name) { + if(!this.themefields) { + var pagestyle_top = $("_pagestyle_top"); + this.themefields = Element.getElementsByClassName(pagestyle_top, "_pagestyle"); + } + var return_flag = false; + this.themefields.each(function(field) { + if(Element.hasClassName(field,"highlight")) { + if(field == this_el) { + /* 変更なし */ + return_flag = true; + return; + } else { + Element.removeClassName(field,"highlight"); + } + } + }.bind(this)); + if(return_flag) { + return; + } + Element.addClassName(this_el,"highlight"); + + /* send */ + var all_apply = 0; + var defultcolor_params = new Object(); + + defultcolor_params["method"] = "post"; + defultcolor_params["param"] = {"action":"dialog_pagestyle_action_edit_setdefault","page_id":this.page_id,"_pagestyle_flag":1,"all_apply":all_apply,"sesson_only":1}; + defultcolor_params["callbackfunc"] = function(){ + var theme_params = new Object(); + theme_params["method"] = "post"; + theme_params["param"] = {"action":"dialog_pagestyle_action_edit_change","page_id":this.page_id,"_pagestyle_flag":1,"theme_name": theme_name}; + theme_params["callbackfunc"] = function(){ + this.refresh(0); + }.bind(this); + commonCls.send(theme_params); + }.bind(this); + commonCls.send(defultcolor_params); + }, + /* 配色クリック */ + colorClick: function(class_name, property_name, color, this_el) { + if(this_el.tagName.toLowerCase() != "select" && (color == "" || color =="1px solid " || this.colorclick_flag == true || (color.length == 7 && color.indexOf('#') != 0))) { + return; + } + if(property_name == "backgroundColor" && color == null) color = this_el.title; + else if(color == null && this_el.title == "transparent") color = "0px none"; + else if(color == null) color = "1px solid " + this_el.title; + if(typeof class_name == "string") { + var el = Element.getChildElementByClassName(document.body, class_name); + var send_name = class_name+"_"+property_name; + } else { + var el = class_name; + var send_name = "body"+"_"+property_name; + } + if(!this.initColorFlag) { + this.colorclick_flag = true; + if(property_name == "backgroundColor") { + // backgroundクリア + el.style.background = "none" ; + } + if(property_name == "background" && color == "") { + color = "none"; + } + eval("el.style."+property_name + "=\"" + color+"\";"); + if(!(browser.isIE) && property_name.match("border")) { + //firefoxのborderの場合、すぐに反映されないため + $("_container").style.display = "none"; + } + var color_params = new Object(); + color_params["method"] = "post"; + color_params["param"] = "dialog_pagestyle_action_edit_change&page_id="+this.page_id+"&_pagestyle_flag=1&"+send_name+"="+encodeURIComponent(color); + color_params["callbackfunc"] = function(){ + this.colorclick_flag = false; + if(!(browser.isIE) && property_name.match("border") ) { + $("_container").style.display = "table"; + } + }.bind(this); + commonCls.send(color_params); + this.setHighlight(this_el); + this.chg_flag = true; + } else { + //pagestyle_list初期化文字列作成 + this.initStr += "&"+send_name+"="+encodeURIComponent(color); + } + }, + setHighlight: function(this_el) { + for (var i = 0; i < this_el.parentNode.childNodes.length; i++) { + var child_el = this_el.parentNode.childNodes[i]; + if(child_el.nodeType != 1) continue; + if(Element.hasClassName(child_el,"highlight")) { + Element.removeClassName(child_el,"highlight"); + } else if(this_el.tagName.toLowerCase() != "select" && child_el.tagName.toLowerCase() == "select") { + child_el.selectedIndex = 0; + } else if(this_el.tagName.toLowerCase() != "input" && child_el.tagName.toLowerCase() == "input" && child_el.type != "hidden") { + child_el.value = ""; + } + } + if(this_el.tagName.toLowerCase() != "input" && this_el.tagName.toLowerCase() != "select") { + Element.addClassName(this_el,"highlight"); + } + }, + /* 規定値に戻す */ + defaultColorClick: function() { + var top_el = $(this.id); + var form = top_el.getElementsByTagName("form")[0]; + if(form.pagestyle_all_apply) { + if(form.pagestyle_all_apply.checked) { + var all_apply = 1; + } else { + var all_apply = 0; + } + } else { + var all_apply = 0; + } + /* send */ + var defultcolor_params = new Object(); + + defultcolor_params["method"] = "post"; + defultcolor_params["param"] = {"action":"dialog_pagestyle_action_edit_setdefault","page_id":this.page_id,"_pagestyle_flag":1,"all_apply":all_apply}; + defultcolor_params["callbackfunc"] = function(){ + this.refresh(3); + }.bind(this); + commonCls.send(defultcolor_params); + }, + /* レイアウトクリック */ + layoutClick: function(el , header_flag, leftcolum_flag, rightcolumn_flag) { + if(Element.hasClassName(el,"highlight")) { + //変更なし + return; + } + this.chg_flag = true; + var pagestyle_layout_el = Element.getParentElementByClassName(el, "_pagestyle_layout"); + var highlight_el = Element.getChildElementByClassName(pagestyle_layout_el, "highlight"); + Element.removeClassName(highlight_el,"highlight"); + Element.addClassName(el,"highlight"); + var refresh_flag = false; + if(header_flag) { + if(this.header_id_el) { + if(this.header_add_module_el) commonCls.displayVisible(this.header_add_module_el); + commonCls.displayVisible(this.header_id_el); + } else { + refresh_flag = true; + } + this.header_flag = 1; + } else { + if(this.header_add_module_el) commonCls.displayNone(this.header_add_module_el); + if(this.header_id_el) commonCls.displayNone(this.header_id_el); + this.header_flag = 0; + } + var colspan = 1; + if(leftcolum_flag) { + colspan++; + if(this.leftcolumn_el) { + commonCls.displayVisible(this.leftcolumn_el); + } else { + refresh_flag = true; + } + this.leftcolumn_flag = 1; + } else { + if(this.leftcolumn_el) commonCls.displayNone(this.leftcolumn_el); + this.leftcolumn_flag = 0; + } + if(rightcolumn_flag) { + colspan++; + if(this.rightcolumn_el) { + commonCls.displayVisible(this.rightcolumn_el); + } else { + refresh_flag = true; + } + this.rightcolumn_flag = 1; + } else { + if(this.rightcolumn_el) commonCls.displayNone(this.rightcolumn_el); + this.rightcolumn_flag = 0; + } + if(this.header_id_el) { + this.header_id_el.colspan = colspan; + } + if(this.footer_el) { + this.footer_el.colspan = colspan; + } + var layout_params = new Object(); + layout_params["method"] = "post"; + layout_params["param"] = {"action":"dialog_pagestyle_action_edit_change","_pagestyle_flag":1,"page_id":this.page_id,"header_flag": this.header_flag,"leftcolumn_flag": this.leftcolumn_flag,"rightcolumn_flag": this.rightcolumn_flag}; + layout_params["callbackfunc"] = function(){ + if(refresh_flag != "" || !(browser.isIE)) { + this.refresh(2); + } + }.bind(this); + commonCls.send(layout_params); + }, + refresh: function(active_tab, append_str) { + var top_el = $(this.id); + append_str = (append_str == undefined || append_str == null) ? "" : append_str; + var str = "&_layoutmode=off"; + if(active_tab != undefined && active_tab != null) { + str += "&active_tab="+active_tab; + } + location.href = _nc_base_url + _nc_index_file_name + "?action="+ this.pages_action+"&page_id="+this.page_id+ + "&_pagestyle_flag=1&pagestyle_x="+top_el.parentNode.style.left+"&pagestyle_y="+top_el.parentNode.style.top+ + str + append_str; + }, + //行揃え変更 + chgGeneral: function(el) { + var top_el = $(this.id); + var form = top_el.getElementsByTagName("form")[0]; + var name = el.name; + var hidden_el = el.nextSibling; + if(hidden_el.value == el.value) { + // 変更なし + return; + } + this.chg_flag = true; + var container_el = $("_container"); + if(name == "align") { + if(el.value == "center") { + form.leftmargin.value = "0"; + form.rightmargin.value = "0"; + container_el.style.marginRight = ""; + container_el.style.marginLeft = ""; + var buf_hidden_el = form.leftmargin.nextSibling; + buf_hidden_el.value = "0"; + var buf_hidden_el = form.rightmargin.nextSibling; + buf_hidden_el.value = "0"; + } + container_el.align = el.value; + container_el.style.textAlign = el.value; + } else if(name == "topmargin") { + container_el.style.marginTop = el.value + "px"; + } else if(name == "rightmargin") { + container_el.style.marginRight = el.value + "px"; + } else if(name == "bottommargin") { + container_el.style.marginBottom = el.value + "px"; + } else if(name == "leftmargin") { + container_el.style.marginLeft = el.value + "px"; + } + if((name == "leftmargin" || name == "rightmargin") && el.value != "0" && form.align.value == "center") { + form.align.value = "left"; + container_el.align = "left"; + container_el.style.textAlign = "left"; + var buf_hidden_el = form.align.nextSibling; + buf_hidden_el.value = "left"; + } + if(name == "page_name") { + var robj = new RegExp(this.permalink_prohibition, "ig"); + if(hidden_el.value.replace(robj, this.permalink_prohibition_replace) == form.permalink.value.replace(robj, this.permalink_prohibition_replace)) { + form.permalink.value = el.value.replace(robj, this.permalink_prohibition_replace); + } + } + hidden_el.value = el.value; + //session情報に追記 + var general_params = new Object(); + general_params["method"] = "post"; + general_params["param"] = {"action":"dialog_pagestyle_action_edit_change","_pagestyle_flag":1,"page_id":this.page_id}; + general_params["param"][name] = el.value; + commonCls.send(general_params); + }, + /*OK*/ + okClick: function(id) { + var top_el = $(this.id); + var form = top_el.getElementsByTagName("form")[0]; + if(form.pagestyle_all_apply) { + if(form.pagestyle_all_apply.checked) { + var all_apply = 1; + } else { + var all_apply = 0; + } + } else { + var all_apply = 0; + } + if(this.chg_flag) { + setTimeout(function() { + var top_el = $(this.id); + var theme_params = new Object(); + if(typeof form.titletag != "undefined") { + var titletag = form.titletag.value; + } else { + var titletag = null; + } + if(typeof form.permalink != "undefined") { + var permalink = form.permalink.value; + } else { + var permalink = null; + } + + theme_params["method"] = "post"; + theme_params["top_el"] = $(this.id); + theme_params["param"] = {"action":"dialog_pagestyle_action_edit_init","page_id":this.page_id,"page_name":form.page_name.value,"permalink":permalink,"titletag":titletag,"meta_description":form.meta_description.value,"meta_keywords":form.meta_keywords.value,"_pagestyle_flag":1,"all_apply":all_apply,"prefix_id_name":"dialog_pagestyle"}; + theme_params["callbackfunc"] = function(res){ + if(form.permalink_url && form.permalink.type != "hidden" && form.permalink.value != '') { + location.href = form.permalink_url.value + form.permalink.value + '/'; + } else { + location.href = _nc_base_url + _nc_index_file_name + "?action=" + this.pages_action + "&page_id="+this.page_id; + } + }.bind(this); + theme_params["callbackfunc_error"] = function(res){ + commonCls.alert(res); + this.tabset.setActiveIndex(1); + this.tabset.refresh(); + }.bind(this); + commonCls.send(theme_params); + }.bind(this),300); + } else { + //変更なし + commonCls.removeBlock(id); + } + }, + /*キャンセル*/ + cancelClick: function(id) { + if(this.chg_flag) { + if(!commonCls.confirm(this.lang_cancel_confirm))return false; + location.href = _nc_base_url + _nc_index_file_name + "?action=pages_view_main&page_id="+this.page_id; + } else { + //変更なし + commonCls.removeBlock(id); + } + //location.href = _nc_base_url + _nc_index_file_name + "?action=pages_view_main&page_id="+this.page_id; + } +} + pagestyleCls = new clsPagestyle(); \ No newline at end of file diff --git a/html/webapp/modules/dialog/pagestyle/view/edit/init/Init.class.php b/html/webapp/modules/dialog/pagestyle/view/edit/init/Init.class.php old mode 100644 new mode 100755 index e96e140..54925aa --- a/html/webapp/modules/dialog/pagestyle/view/edit/init/Init.class.php +++ b/html/webapp/modules/dialog/pagestyle/view/edit/init/Init.class.php @@ -213,23 +213,23 @@ function execute() } else { $this->background_color[$key] = ""; } - - foreach($border_array as $border => $border_value) { - if(isset($theme_list[$key][$border])) { - if($key == "general") { - $this->headercolumn[$border_value] = explode(",",$theme_list[$key][$border]); - $this->leftcolumn[$border_value] = explode(",",$theme_list[$key][$border]); - $this->rightcolumn[$border_value] = explode(",",$theme_list[$key][$border]); - $this->centercolumn[$border_value] = explode(",",$theme_list[$key][$border]); - $this->footercolumn[$border_value] = explode(",",$theme_list[$key][$border]); - } else { - $this->$key[$border_value] = explode(",",$theme_list[$key][$border]); - } + + foreach ($border_array as $border => $border_value) { + if (!isset($theme_list[$key][$border])) { + // 未定義の場合はセットせず、generalの値を使用する + continue; + } + if ($key == "general") { + $this->headercolumn[$border_value] = explode(",", $theme_list[$key][$border]); + $this->leftcolumn[$border_value] = explode(",", $theme_list[$key][$border]); + $this->rightcolumn[$border_value] = explode(",", $theme_list[$key][$border]); + $this->centercolumn[$border_value] = explode(",", $theme_list[$key][$border]); + $this->footercolumn[$border_value] = explode(",", $theme_list[$key][$border]); } else { - $this->$key[$border_value] = ""; + // 定義されている場合は定義内容をセットする + $this->{$key}[$border_value] = explode(",", $theme_list[$key][$border]); } } - } } } diff --git a/html/webapp/modules/dialog/templates/pagestyle.html b/html/webapp/modules/dialog/templates/pagestyle.html index 4417dde..aad9d92 100644 --- a/html/webapp/modules/dialog/templates/pagestyle.html +++ b/html/webapp/modules/dialog/templates/pagestyle.html @@ -1,401 +1,405 @@ -<{strip}> -<{* TODO:style属性、後にクラス化 *}> -
-
-<{*タブコンポーネント*}> -
-
-
- <{assign var="pagetheme_name" value=$action.theme_name}> -
- <{foreach from=$action.category_list|smarty:nodefaults key=key item=category_name}> - <{if $action.pagetheme_list.$key}> - <{if $action.act_category == $key}> - - /images/common/down_arrow.gif" alt="<{$lang.dialog_pagestyle_down_arrow}>" class="icon" /> <{$category_name}> - -
- <{else}> - - /images/common/right_arrow.gif" alt="<{$lang.dialog_pagestyle_right_arrow}>" class="icon" /> <{$category_name}> - -
- <{/if}> - <{foreach name=pagetheme_list from=$action.pagetheme_list.$key|smarty:nodefaults key=theme_name item=lang_theme_name}> - <{if $theme_name == $pagetheme_name}> - <{* 配色-カスタムのtheme_name取得用 *}> - <{assign var="current_theme_name" value=$lang_theme_name|smarty:nodefaults}> - <{/if}> -
- - <{$lang_theme_name}> - -
- <{if $smarty.foreach.pagetheme_list.iteration % 4 == 0}> - <{*4つで下の行へ*}> -
- <{/if}> - <{/foreach}> -
-
- <{/if}> - <{/foreach}> -
-
- - <{if $smarty.session._allow_layout_flag == _ON}> -
- <{* レイアウト *}> - - - - - - - - - - - - - -
highlight<{/if}>" style="display:block; padding:8px">/images/common/layout/layout_01.gif" alt="<{$lang.dialog_pagestyle_layout_none|smarty:nodefaults}>" title="<{$lang.dialog_pagestyle_layout_none|smarty:nodefaults}>" class="icon" />highlight<{/if}>" style="display:block; padding:8px">/images/common/layout/layout_02.gif" alt="<{$lang.dialog_pagestyle_layout_header|smarty:nodefaults}>" title="<{$lang.dialog_pagestyle_layout_header|smarty:nodefaults}>" class="icon" />highlight<{/if}>" style="display:block; padding:8px">/images/common/layout/layout_03.gif" alt="<{$lang.dialog_pagestyle_layout_headerleft|smarty:nodefaults}>" title="<{$lang.dialog_pagestyle_layout_headerleft|smarty:nodefaults}>" class="icon" />highlight<{/if}>" style="display:block; padding:8px">/images/common/layout/layout_04.gif" alt="<{$lang.dialog_pagestyle_layout_headerright|smarty:nodefaults}>" title="<{$lang.dialog_pagestyle_layout_headerright|smarty:nodefaults}>" class="icon" />
highlight<{/if}>" style="display:block; padding:8px">/images/common/layout/layout_05.gif" alt="<{$lang.dialog_pagestyle_layout_all|smarty:nodefaults}>" title="<{$lang.dialog_pagestyle_layout_all|smarty:nodefaults}>" class="icon" />highlight<{/if}>" style="display:block; padding:8px">/images/common/layout/layout_06.gif" alt="<{$lang.dialog_pagestyle_layout_left|smarty:nodefaults}>" title="<{$lang.dialog_pagestyle_layout_left|smarty:nodefaults}>" class="icon" />highlight<{/if}>" style="display:block; padding:8px">/images/common/layout/layout_07.gif" alt="<{$lang.dialog_pagestyle_layout_right|smarty:nodefaults}>" title="<{$lang.dialog_pagestyle_layout_right|smarty:nodefaults}>" class="icon" />highlight<{/if}>" style="display:block; padding:8px">/images/common/layout/layout_08.gif" alt="<{$lang.dialog_pagestyle_layout_leftright|smarty:nodefaults}>" title="<{$lang.dialog_pagestyle_layout_leftright|smarty:nodefaults}>" class="icon" />
-
- <{/if}> - <{if $action.background_color != "" && $smarty.session._allow_layout_flag == _ON}> -
- <{* 配色 *}> - <{$lang.dialog_coloration_desc|smarty:nodefaults}> - <{if $smarty.session._user_auth_id == _AUTH_ADMIN}> - <{$lang.pagestyle_custom_confirm|sprintf:$current_theme_name|smarty:nodefaults}> - <{/if}> -
- - - /images/common/down_arrow.gif" alt="<{$lang.dialog_pagestyle_down_arrow}>" title="<{$lang.dialog_pagestyle_down_arrow}>" class="icon" /> <{$lang.dialog_pagestyle_background}> - -
- <{foreach from=$action.background_color key=key item=color_list}> - <{if $key == "general"}> -
<{$lang.dialog_pagestyle_background}> - <{assign var="column_name" value="body"}> - <{elseif $key == "centercolumn"}> -
<{$lang.dialog_pagestyle_centercolumn}> - <{assign var="column_name" value="centercolumn"}> - <{elseif $key == "leftcolumn"}> -
<{$lang.dialog_pagestyle_leftcolumn}> - <{assign var="column_name" value="leftcolumn"}> - <{elseif $key == "rightcolumn"}> -
<{$lang.dialog_pagestyle_rightcolumn}> - <{assign var="column_name" value="rightcolumn"}> - <{elseif $key == "headercolumn"}> -
<{$lang.dialog_pagestyle_header}> - <{assign var="column_name" value="headercolumn"}> - <{elseif $key == "footercolumn"}> -
<{$lang.dialog_pagestyle_footer}> - <{assign var="column_name" value="footercolumn"}> - <{/if}> - <{foreach from=$color_list key=count item=color}> - <{if $color == "selection"}> - document.body<{else}>'<{$column_name}>'<{/if}>,'backgroundColor',this.value,this);" style="margin-top:5px; margin-left:5px;float:left; width:6em;" type="text" maxlength="7" value="" /> - <{elseif $color == "selection_image"}> - - <{elseif $color == "transparent" && $count == 0}> - document.body<{else}>'<{$column_name}>'<{/if}>,'backgroundColor','<{$color}>',this); return false;"/> -
- /images/dialog/transparence.gif" title="transparent" alt="transparent" /> -
-
- <{elseif $color == "transparent"}> - document.body<{else}>'<{$column_name}>'<{/if}>,'backgroundColor','<{$color}>',this); return false;" /> -
- /images/dialog/transparence_small.gif" title="transparent" alt="transparent" /> -
-
- <{elseif $count == 0}> - document.body<{else}>'<{$column_name}>'<{/if}>,'backgroundColor','<{$color}>',this); return false;" /> -
-
-
- <{else}> - document.body<{else}>'<{$column_name}>'<{/if}>,'backgroundColor','<{$color}>',this); return false;" /> -
-
-
- <{/if}> - <{/foreach}> -
- <{/foreach}> -
-
- - /images/common/down_arrow.gif" alt="<{$lang.dialog_pagestyle_down_arrow}>" title="<{$lang.dialog_pagestyle_down_arrow}>" class="icon" /> <{$lang.dialog_pagestyle_border}> - -
- <{section name=customer loop=5}> - <{if $action.headercolumn != ""}> - <{if $smarty.section.customer.index == 0}> -
<{$lang.dialog_pagestyle_header}> - <{assign var="column_name" value="headercolumn"}> - <{elseif $smarty.section.customer.index == 1}> -
<{$lang.dialog_pagestyle_leftcolumn}> - <{assign var="column_name" value="leftcolumn"}> - <{elseif $smarty.section.customer.index == 2}> -
<{$lang.dialog_pagestyle_centercolumn}> - <{assign var="column_name" value="centercolumn"}> - <{elseif $smarty.section.customer.index == 3}> -
<{$lang.dialog_pagestyle_rightcolumn}> - <{assign var="column_name" value="rightcolumn"}> - <{elseif $smarty.section.customer.index == 4}> -
<{$lang.dialog_pagestyle_footer}> - <{assign var="column_name" value="footercolumn"}> - <{/if}> - <{assign var="column" value=$action.$column_name}> -
- <{foreach from=$column key=key item=border_list}> - <{if $key == "border_top_color"}> -
<{$lang.dialog_pagestyle_pos_top}> - <{assign var="border_name" value="borderTop"}> - <{elseif $key == "border_right_color"}> -
<{$lang.dialog_pagestyle_pos_right}> - <{assign var="border_name" value="borderRight"}> - <{elseif $key == "border_bottom_color"}> -
<{$lang.dialog_pagestyle_pos_bottom}> - <{assign var="border_name" value="borderBottom"}> - <{elseif $key == "border_left_color"}> -
<{$lang.dialog_pagestyle_pos_left}> - <{assign var="border_name" value="borderLeft"}> - <{/if}> - <{foreach from=$border_list key=count item=color}> - <{if $color == "selection"}> - - <{elseif $color == "selection_image"}> - <{elseif $color == "transparent" && $count == 0}> - -
- /images/dialog/transparence.gif" title="transparent" alt="transparent" /> -
-
- <{elseif $color == "transparent"}> - -
- /images/dialog/transparence_small.gif" title="transparent" alt="transparent" /> -
-
- <{elseif $count == 0}> - -
-
-
- <{else}> - -
-
-
- <{/if}> - <{/foreach}> -
-
- <{/foreach}> -
- <{/if}> - <{/section}> -
-
-
- <{if $smarty.session._user_auth_id == _AUTH_ADMIN && BASE_URL == CORE_BASE_URL}> - <{* 設定中のページテーマすべてに適用 *}> - -
- <{/if}> - <{* 規定値に戻す:配色情報クリア *}> -
<{$lang.dialog_pagestyle_reset}>
-
-
- <{/if}> - -
-
- - -
- +<{strip}> +<{* TODO:style属性、後にクラス化 *}> +
+
+<{*タブコンポーネント*}> +
+
+
+ <{assign var="pagetheme_name" value=$action.theme_name}> +
+ <{foreach from=$action.category_list|smarty:nodefaults key=key item=category_name}> + <{if $action.pagetheme_list.$key}> + <{if $action.act_category == $key}> + + /images/common/down_arrow.gif" alt="<{$lang.dialog_pagestyle_down_arrow}>" class="icon" /> <{$category_name}> + +
+ <{else}> + + /images/common/right_arrow.gif" alt="<{$lang.dialog_pagestyle_right_arrow}>" class="icon" /> <{$category_name}> + +
+ <{/if}> + <{foreach name=pagetheme_list from=$action.pagetheme_list.$key|smarty:nodefaults key=theme_name item=lang_theme_name}> + <{if $theme_name == $pagetheme_name}> + <{* 配色-カスタムのtheme_name取得用 *}> + <{assign var="current_theme_name" value=$lang_theme_name|smarty:nodefaults}> + <{/if}> +
+ + <{$lang_theme_name}> + +
+ <{if $smarty.foreach.pagetheme_list.iteration % 4 == 0}> + <{*4つで下の行へ*}> +
+ <{/if}> + <{/foreach}> +
+
+ <{/if}> + <{/foreach}> +
+
+ + <{if $smarty.session._allow_layout_flag == _ON}> +
+ <{* レイアウト *}> + + + + + + + + + + + + + +
highlight<{/if}>" style="display:block; padding:8px">/images/common/layout/layout_01.gif" alt="<{$lang.dialog_pagestyle_layout_none|smarty:nodefaults}>" title="<{$lang.dialog_pagestyle_layout_none|smarty:nodefaults}>" class="icon" />highlight<{/if}>" style="display:block; padding:8px">/images/common/layout/layout_02.gif" alt="<{$lang.dialog_pagestyle_layout_header|smarty:nodefaults}>" title="<{$lang.dialog_pagestyle_layout_header|smarty:nodefaults}>" class="icon" />highlight<{/if}>" style="display:block; padding:8px">/images/common/layout/layout_03.gif" alt="<{$lang.dialog_pagestyle_layout_headerleft|smarty:nodefaults}>" title="<{$lang.dialog_pagestyle_layout_headerleft|smarty:nodefaults}>" class="icon" />highlight<{/if}>" style="display:block; padding:8px">/images/common/layout/layout_04.gif" alt="<{$lang.dialog_pagestyle_layout_headerright|smarty:nodefaults}>" title="<{$lang.dialog_pagestyle_layout_headerright|smarty:nodefaults}>" class="icon" />
highlight<{/if}>" style="display:block; padding:8px">/images/common/layout/layout_05.gif" alt="<{$lang.dialog_pagestyle_layout_all|smarty:nodefaults}>" title="<{$lang.dialog_pagestyle_layout_all|smarty:nodefaults}>" class="icon" />highlight<{/if}>" style="display:block; padding:8px">/images/common/layout/layout_06.gif" alt="<{$lang.dialog_pagestyle_layout_left|smarty:nodefaults}>" title="<{$lang.dialog_pagestyle_layout_left|smarty:nodefaults}>" class="icon" />highlight<{/if}>" style="display:block; padding:8px">/images/common/layout/layout_07.gif" alt="<{$lang.dialog_pagestyle_layout_right|smarty:nodefaults}>" title="<{$lang.dialog_pagestyle_layout_right|smarty:nodefaults}>" class="icon" />highlight<{/if}>" style="display:block; padding:8px">/images/common/layout/layout_08.gif" alt="<{$lang.dialog_pagestyle_layout_leftright|smarty:nodefaults}>" title="<{$lang.dialog_pagestyle_layout_leftright|smarty:nodefaults}>" class="icon" />
+
+ <{/if}> + <{if $action.background_color != "" && $smarty.session._allow_layout_flag == _ON}> +
+ <{* 配色 *}> + <{$lang.dialog_coloration_desc|smarty:nodefaults}> + <{if $smarty.session._user_auth_id == _AUTH_ADMIN}> + <{$lang.pagestyle_custom_confirm|sprintf:$current_theme_name|smarty:nodefaults}> + <{/if}> +
+ + + /images/common/down_arrow.gif" alt="<{$lang.dialog_pagestyle_down_arrow}>" title="<{$lang.dialog_pagestyle_down_arrow}>" class="icon" /> <{$lang.dialog_pagestyle_background}> + +
+ <{foreach from=$action.background_color key=key item=color_list}> + <{if $key == "general"}> +
<{$lang.dialog_pagestyle_background}> + <{assign var="column_name" value="body"}> + <{elseif $key == "centercolumn"}> +
<{$lang.dialog_pagestyle_centercolumn}> + <{assign var="column_name" value="centercolumn"}> + <{elseif $key == "leftcolumn"}> +
<{$lang.dialog_pagestyle_leftcolumn}> + <{assign var="column_name" value="leftcolumn"}> + <{elseif $key == "rightcolumn"}> +
<{$lang.dialog_pagestyle_rightcolumn}> + <{assign var="column_name" value="rightcolumn"}> + <{elseif $key == "headercolumn"}> +
<{$lang.dialog_pagestyle_header}> + <{assign var="column_name" value="headercolumn"}> + <{elseif $key == "footercolumn"}> +
<{$lang.dialog_pagestyle_footer}> + <{assign var="column_name" value="footercolumn"}> + <{/if}> + <{foreach from=$color_list key=count item=color}> + <{if $color == "selection"}> + document.body<{else}>'<{$column_name}>'<{/if}>,'backgroundColor',this.value,this);" style="margin-top:5px; margin-left:5px;float:left; width:6em;" type="text" maxlength="7" value="" /> + <{elseif $color == "selection_image"}> + + <{elseif $color == "transparent" && $count == 0}> + document.body<{else}>'<{$column_name}>'<{/if}>,'backgroundColor','<{$color}>',this); return false;"/> +
+ /images/dialog/transparence.gif" title="transparent" alt="transparent" /> +
+
+ <{elseif $color == "transparent"}> + document.body<{else}>'<{$column_name}>'<{/if}>,'backgroundColor','<{$color}>',this); return false;" /> +
+ /images/dialog/transparence_small.gif" title="transparent" alt="transparent" /> +
+
+ <{elseif $count == 0}> + document.body<{else}>'<{$column_name}>'<{/if}>,'backgroundColor','<{$color}>',this); return false;" /> +
+
+
+ <{else}> + document.body<{else}>'<{$column_name}>'<{/if}>,'backgroundColor','<{$color}>',this); return false;" /> +
+
+
+ <{/if}> + <{/foreach}> +
+ <{/foreach}> +
+
+ + /images/common/down_arrow.gif" alt="<{$lang.dialog_pagestyle_down_arrow}>" title="<{$lang.dialog_pagestyle_down_arrow}>" class="icon" /> <{$lang.dialog_pagestyle_border}> + +
+ <{section name=customer loop=5}> + <{if $action.headercolumn != ""}> + <{if $smarty.section.customer.index == 0}> +
<{$lang.dialog_pagestyle_header}> + <{assign var="column_name" value="headercolumn"}> + <{elseif $smarty.section.customer.index == 1}> +
<{$lang.dialog_pagestyle_leftcolumn}> + <{assign var="column_name" value="leftcolumn"}> + <{elseif $smarty.section.customer.index == 2}> +
<{$lang.dialog_pagestyle_centercolumn}> + <{assign var="column_name" value="centercolumn"}> + <{elseif $smarty.section.customer.index == 3}> +
<{$lang.dialog_pagestyle_rightcolumn}> + <{assign var="column_name" value="rightcolumn"}> + <{elseif $smarty.section.customer.index == 4}> +
<{$lang.dialog_pagestyle_footer}> + <{assign var="column_name" value="footercolumn"}> + <{/if}> + <{assign var="column" value=$action.$column_name}> +
+ <{foreach from=$column key=key item=border_list}> + <{if $key == "border_top_color"}> +
<{$lang.dialog_pagestyle_pos_top}> + <{assign var="border_name" value="borderTop"}> + <{elseif $key == "border_right_color"}> +
<{$lang.dialog_pagestyle_pos_right}> + <{assign var="border_name" value="borderRight"}> + <{elseif $key == "border_bottom_color"}> +
<{$lang.dialog_pagestyle_pos_bottom}> + <{assign var="border_name" value="borderBottom"}> + <{elseif $key == "border_left_color"}> +
<{$lang.dialog_pagestyle_pos_left}> + <{assign var="border_name" value="borderLeft"}> + <{/if}> + <{foreach from=$border_list key=count item=color}> + <{if $color == "selection"}> + + <{elseif $color == "selection_image"}> + <{elseif $color == "transparent" && $count == 0}> + +
+ /images/dialog/transparence.gif" title="transparent" alt="transparent" /> +
+
+ <{elseif $color == "transparent"}> + +
+ /images/dialog/transparence_small.gif" title="transparent" alt="transparent" /> +
+
+ <{elseif $count == 0}> + +
+
+
+ <{else}> + +
+
+
+ <{/if}> + <{/foreach}> +
+
+ <{/foreach}> +
+ <{/if}> + <{/section}> +
+
+
+ <{if $smarty.session._user_auth_id == _AUTH_ADMIN && BASE_URL == CORE_BASE_URL}> + <{* 設定中のページテーマすべてに適用 *}> + +
+ <{/if}> + <{* 規定値に戻す:配色情報クリア *}> +
<{$lang.dialog_pagestyle_reset}>
+
+
+ <{/if}> + +
+
+ + +
+ <{/strip}> \ No newline at end of file diff --git a/html/webapp/modules/holiday/sql/holiday.sql b/html/webapp/modules/holiday/sql/holiday.sql old mode 100644 new mode 100755 index 403a5c9..249b043 --- a/html/webapp/modules/holiday/sql/holiday.sql +++ b/html/webapp/modules/holiday/sql/holiday.sql @@ -992,6 +992,7 @@ INSERT INTO `holiday` (`holiday_id`, `rrule_id`, `lang_dirname`, `holiday`, `sum INSERT INTO `holiday` (`holiday_id`, `rrule_id`, `lang_dirname`, `holiday`, `summary`, `holiday_type`) VALUES (988, 172, 'japanese', '20310720150000', '海の日', 0); INSERT INTO `holiday` (`holiday_id`, `rrule_id`, `lang_dirname`, `holiday`, `summary`, `holiday_type`) VALUES (989, 172, 'japanese', '20320718150000', '海の日', 0); INSERT INTO `holiday` (`holiday_id`, `rrule_id`, `lang_dirname`, `holiday`, `summary`, `holiday_type`) VALUES (990, 172, 'japanese', '20330717150000', '海の日', 0); +INSERT INTO `holiday` (`holiday_id`, `rrule_id`, `lang_dirname`, `holiday`, `summary`, `holiday_type`) VALUES (991, 173, 'japanese', '20150921150000', '国民の休日', 0); -- -- テーブルのダンプデータ `holiday_rrule` @@ -1169,6 +1170,7 @@ INSERT INTO `holiday_rrule` (`rrule_id`, `varidable_flag`, `substitute_flag`, `s INSERT INTO `holiday_rrule` (`rrule_id`, `varidable_flag`, `substitute_flag`, `start_time`, `end_time`, `rrule`, `insert_time`, `insert_site_id`, `insert_user_id`, `insert_user_name`, `update_time`, `update_site_id`, `update_user_id`, `update_user_name`) VALUES (170, 0, 0, '20060503150000', '20060503150000', '', '', 0, 0, '', '', 0, 0, ''); INSERT INTO `holiday_rrule` (`rrule_id`, `varidable_flag`, `substitute_flag`, `start_time`, `end_time`, `rrule`, `insert_time`, `insert_site_id`, `insert_user_id`, `insert_user_name`, `update_time`, `update_site_id`, `update_user_id`, `update_user_name`) VALUES (171, 0, 1, '19960719150000', '20020719150000', 'FREQ=YEARLY;INTERVAL=1;BYMONTH=7;UNTIL=20020719T150000', '', 0, 0, '', '', 0, 0, ''); INSERT INTO `holiday_rrule` (`rrule_id`, `varidable_flag`, `substitute_flag`, `start_time`, `end_time`, `rrule`, `insert_time`, `insert_site_id`, `insert_user_id`, `insert_user_name`, `update_time`, `update_site_id`, `update_user_id`, `update_user_name`) VALUES (172, 1, 0, '20030720150000', '20330717150000', 'FREQ=YEARLY;INTERVAL=1;BYMONTH=7;BYDAY=3MO;UNTIL=20330717T150000', '', 0, 0, '', '', 0, 0, ''); +INSERT INTO `holiday_rrule` (`rrule_id`, `varidable_flag`, `substitute_flag`, `start_time`, `end_time`, `rrule`, `insert_time`, `insert_site_id`, `insert_user_id`, `insert_user_name`, `update_time`, `update_site_id`, `update_user_id`, `update_user_name`) VALUES (173, 0, 0, '20150921150000', '20150921150000', '', '', 0, 0, '', '', 0, 0, ''); -- -- テーブルのダンプデータ `holiday_seq_id` diff --git a/html/webapp/modules/install/sql/mysql/default/common_insert.data.php b/html/webapp/modules/install/sql/mysql/default/common_insert.data.php old mode 100644 new mode 100755 index 119597d..91f1d93 --- a/html/webapp/modules/install/sql/mysql/default/common_insert.data.php +++ b/html/webapp/modules/install/sql/mysql/default/common_insert.data.php @@ -558,6 +558,10 @@ INSERT INTO `textarea_video_url` (`url`, `action_name`, `insert_time`, `insert_site_id`, `insert_user_id`, `insert_user_name`, `update_time`, `update_site_id`, `update_user_id`, `update_user_name`) VALUES ('http://www.youtube.com/', '', '', '', '0', '', '', '', '0', ''); INSERT INTO `textarea_video_url` (`url`, `action_name`, `insert_time`, `insert_site_id`, `insert_user_id`, `insert_user_name`, `update_time`, `update_site_id`, `update_user_id`, `update_user_name`) VALUES ('', 'multimedia_view_main_play', '', '', '0', '', '', '', '0', ''); +INSERT INTO `textarea_video_url` (`url`, `action_name`, `insert_time`, `insert_site_id`, `insert_user_id`, `insert_user_name`, `update_time`, `update_site_id`, `update_user_id`, `update_user_name`) VALUES ('http://www.youtube-nocookie.com/', '', '', '', '0', '', '', '', '0', ''); +INSERT INTO `textarea_video_url` (`url`, `action_name`, `insert_time`, `insert_site_id`, `insert_user_id`, `insert_user_name`, `update_time`, `update_site_id`, `update_user_id`, `update_user_name`) VALUES ('//www.youtube.com/', '', '', '', '0', '', '', '', '0', ''); +INSERT INTO `textarea_video_url` (`url`, `action_name`, `insert_time`, `insert_site_id`, `insert_user_id`, `insert_user_name`, `update_time`, `update_site_id`, `update_user_id`, `update_user_name`) VALUES ('https://www.youtube.com/', '', '', '', '0', '', '', '', '0', ''); +INSERT INTO `textarea_video_url` (`url`, `action_name`, `insert_time`, `insert_site_id`, `insert_user_id`, `insert_user_name`, `update_time`, `update_site_id`, `update_user_id`, `update_user_name`) VALUES ('https://www.youtube-nocookie.com/', '', '', '', '0', '', '', '', '0', ''); "; ?> \ No newline at end of file diff --git a/html/webapp/modules/journal/action/main/comment/Comment.class.php b/html/webapp/modules/journal/action/main/comment/Comment.class.php old mode 100644 new mode 100755 index 2f18c1c..ffd3476 --- a/html/webapp/modules/journal/action/main/comment/Comment.class.php +++ b/html/webapp/modules/journal/action/main/comment/Comment.class.php @@ -47,7 +47,7 @@ function execute() }else { $agree_flag = JOURNAL_STATUS_AGREE_VALUE; } - + if(empty($this->comment_id)) { $params = array( "journal_id" => $this->journal_obj['journal_id'], @@ -75,8 +75,8 @@ function execute() if($result === false) { return 'error'; } - - if($comment_before_update[0]['agree_flag'] == JOURNAL_STATUS_WAIT_AGREE_VALUE && + + if($comment_before_update[0]['agree_flag'] == JOURNAL_STATUS_WAIT_AGREE_VALUE && $agree_flag == JOURNAL_STATUS_AGREE_VALUE && $this->journal_obj['comment_agree_mail_flag'] == _ON) { $this->session->setParameter("journal_confirm_mail_post_id", $this->comment_id); @@ -87,7 +87,7 @@ function execute() $this->session->setParameter("journal_mail_post_id", array("post_id" => $this->comment_id, "agree_flag" => JOURNAL_STATUS_WAIT_AGREE_VALUE)); } //--新着情報関連 Start-- - $result = $this->journalAction->setCommentWhatsnew($this->comment_id); + $result = $this->journalAction->setWhatsnew($this->post_id); if($result === false) { return 'error'; } diff --git a/html/webapp/modules/journal/action/main/confirm/Confirm.class.php b/html/webapp/modules/journal/action/main/confirm/Confirm.class.php old mode 100644 new mode 100755 index 560a6be..e69c586 --- a/html/webapp/modules/journal/action/main/confirm/Confirm.class.php +++ b/html/webapp/modules/journal/action/main/confirm/Confirm.class.php @@ -17,7 +17,7 @@ class Journal_Action_Main_Confirm extends Action // リクエストパラメータを受け取るため var $block_id = null; var $post_id = null; - + // バリデートによりセット var $journal_obj = null; @@ -27,19 +27,19 @@ class Journal_Action_Main_Confirm extends Action var $journalAction = null; // 値をセットするため - + /** * [[機能説明]] * * @access public */ function execute() - { + { $post_before_update = $this->db->selectExecute("journal_post", array("post_id" => $this->post_id)); if (empty($post_before_update)) { return 'error'; } - + $params = array( "agree_flag" => JOURNAL_STATUS_AGREE_VALUE ); @@ -52,28 +52,28 @@ function execute() if($this->journal_obj['mail_flag'] == _ON && empty($post_before_update[0]['parent_id'])) { $this->session->setParameter("journal_mail_post_id", array("post_id" => $this->post_id, "agree_flag" => JOURNAL_STATUS_AGREE_VALUE)); } - - if((empty($post_before_update[0]['parent_id']) && $this->journal_obj['agree_mail_flag'] == _ON) + + if((empty($post_before_update[0]['parent_id']) && $this->journal_obj['agree_mail_flag'] == _ON) || (!empty($post_before_update[0]['parent_id']) && $this->journal_obj['comment_agree_mail_flag'] == _ON && (empty($post_before_update[0]['direction_flag']) || (!empty($post_before_update[0]['direction_flag']) && strpos($post_before_update[0]['tb_url'], BASE_URL) !== false)))) { $this->session->setParameter("journal_confirm_mail_post_id", $this->post_id); } - + //トラックバックの処理 $this->journalAction->setTrackBack($this->journal_obj, $this->post_id, $post_before_update[0]); - + //--新着情報関連 Start-- if(empty($post_before_update[0]['parent_id'])) { $result = $this->journalAction->setWhatsnew($this->post_id); }else { - $result = $this->journalAction->setCommentWhatsnew($this->post_id); + $result = $this->journalAction->setWhatsnew($post_before_update[0]['parent_id']); } if($result === false) { return 'error'; } //--新着情報関連 End-- - + // --- 投稿回数更新 --- - + $before_post = isset($post_before_update[0]) ? $post_before_update[0] : null; $result = $this->journalAction->setMonthlynumber(_ON, JOURNAL_POST_STATUS_REREASED_VALUE, $before_post['status'], $before_post); if ($result === false) { diff --git a/html/webapp/modules/journal/action/main/delete/Delete.class.php b/html/webapp/modules/journal/action/main/delete/Delete.class.php old mode 100644 new mode 100755 index e5c0617..b6707ff --- a/html/webapp/modules/journal/action/main/delete/Delete.class.php +++ b/html/webapp/modules/journal/action/main/delete/Delete.class.php @@ -24,6 +24,7 @@ class Journal_Action_Main_Delete extends Action var $session = null; var $whatsnewAction = null; var $request = null; + var $journalAction = null; // 値をセットするため var $comment_flag = null; @@ -79,23 +80,10 @@ function execute() } } else { // コメント削除 - $count = $this->db->countExecute("journal_post", array("parent_id"=>$this->post_id)); - if ($count === false) { + $result = $this->journalAction->setWhatsnew($this->post_id); + if($result === false) { return 'error'; } - if($count == 0) { - $result = $this->whatsnewAction->delete($this->post_id, _ON); - } else { - $whatsnew = array( - "unique_id" => $this->post_id, - "count_num" => $count, - "child_flag" => _ON - ); - $result = $this->whatsnewAction->auto($whatsnew); - if($result === false) { - return 'error'; - } - } } //--新着情報関連 End-- diff --git a/html/webapp/modules/journal/action/main/delete/maple.ini b/html/webapp/modules/journal/action/main/delete/maple.ini old mode 100644 new mode 100755 index 667e6af..8239f4e --- a/html/webapp/modules/journal/action/main/delete/maple.ini +++ b/html/webapp/modules/journal/action/main/delete/maple.ini @@ -16,6 +16,7 @@ comment_id.journal.commentEditAuth:g = "1:lang._invalid_auth" session = "ref:Session" whatsnewAction = "ref:whatsnewAction" request = "ref:Request" +journalAction = "ref:journalAction" [View] post = "location_script:" diff --git a/html/webapp/modules/journal/action/main/deltrackback/Deltrackback.class.php b/html/webapp/modules/journal/action/main/deltrackback/Deltrackback.class.php old mode 100644 new mode 100755 index 9a0519c..f6d119d --- a/html/webapp/modules/journal/action/main/deltrackback/Deltrackback.class.php +++ b/html/webapp/modules/journal/action/main/deltrackback/Deltrackback.class.php @@ -23,7 +23,7 @@ class Journal_Action_Main_Deltrackback extends Action // 使用コンポーネントを受け取るため var $db = null; - var $whatsnewAction = null; + var $journalAction = null; // 値をセットするため @@ -44,26 +44,10 @@ function execute() } //--新着情報関連 Start-- - $count = $this->db->countExecute("journal_post", array("parent_id"=>$this->post_id, "direction_flag != " . JOURNAL_TRACKBACK_TRANSMIT => null)); - if ($count === false) { + $result = $this->journalAction->setWhatsnew($this->post_id); + if($result === false) { return 'error'; } - if($this->post['agree_flag'] != JOURNAL_STATUS_AGREE_VALUE) { - $whatsnew = array( - "unique_id" => $this->post_id, - "count_num" => $count, - "child_flag" => _ON - ); - $result = $this->whatsnewAction->auto($whatsnew); - if($result === false) { - return 'error'; - } - }else { - if($count == 0) { - $result = $this->whatsnewAction->delete($this->post_id, _ON); - } - } - //--新着情報関連 End-- return 'success'; diff --git a/html/webapp/modules/journal/action/main/deltrackback/maple.ini b/html/webapp/modules/journal/action/main/deltrackback/maple.ini old mode 100644 new mode 100755 index c88163f..6342291 --- a/html/webapp/modules/journal/action/main/deltrackback/maple.ini +++ b/html/webapp/modules/journal/action/main/deltrackback/maple.ini @@ -9,7 +9,7 @@ trackback_id.journal.existTrackback:g = "1:lang._invalid_input" key:trackback_id.journal.postEditAuth:g = "1:lang._invalid_auth" [Action] -whatsnewAction = "ref:whatsnewAction" +journalAction = "ref:journalAction" [View] success = "action:journal_view_main_detail" diff --git a/html/webapp/modules/journal/action/main/post/Post.class.php b/html/webapp/modules/journal/action/main/post/Post.class.php old mode 100644 new mode 100755 index 0720322..038d946 --- a/html/webapp/modules/journal/action/main/post/Post.class.php +++ b/html/webapp/modules/journal/action/main/post/Post.class.php @@ -41,7 +41,6 @@ class Journal_Action_Main_Post extends Action var $journalView = null; var $journalAction = null; var $db = null; - var $whatsnewAction = null; var $request = null; var $session = null; var $configView = null; diff --git a/html/webapp/modules/journal/action/main/trackback/Trackback.class.php b/html/webapp/modules/journal/action/main/trackback/Trackback.class.php index 5eb81d6..d1d0557 100644 --- a/html/webapp/modules/journal/action/main/trackback/Trackback.class.php +++ b/html/webapp/modules/journal/action/main/trackback/Trackback.class.php @@ -45,7 +45,7 @@ function execute() $params = array("post_id" => $this->post_id); $post = $this->db->selectExecute("journal_post", $params); - if($post === false || !isset($post[0])) { + if($post === false || !isset($post[0]) || intval($post[0]['root_id']) != 0) { exit(Net_TrackBack::getPingXML(false , "Invalid trackback ID")); } diff --git a/html/webapp/modules/journal/components/Action.class.php b/html/webapp/modules/journal/components/Action.class.php old mode 100644 new mode 100755 index c16b546..48ddb7d --- a/html/webapp/modules/journal/components/Action.class.php +++ b/html/webapp/modules/journal/components/Action.class.php @@ -234,41 +234,13 @@ function saveTrackback($trackback) { return false; } $block_id = isset($journal_block[0]) ? $journal_block[0]['block_id'] : 0; - $count = $this->_db->countExecute("journal_post", array("parent_id"=>$trackback['post_id'], "direction_flag != " . JOURNAL_TRACKBACK_TRANSMIT => null)); - if ($count === false) { + $commonMain =& $this->_container->getComponent("commonMain"); + $parameters = "post_id=". $trackback['post_id'] . "&trackback_flag=1&block_id=".$block_id."#".$commonMain->getTopId($block_id); + + $result = $this->setWhatsnew($trackback['post_id'], $parameters); + if ($result === false) { return false; } - if($agree_flag == JOURNAL_STATUS_AGREE_VALUE) { - $commonMain =& $this->_container->getComponent("commonMain"); - $time = timezone_date(); - if(intval($time) < intval($post[0]['journal_date'])) { - // 未来ならば、日誌の記事の時間をセット - $time = $post[0]['journal_date']; - } - $whatsnew = array( - "unique_id" => $trackback['post_id'], - "title" => $post[0]['title'], - "description" => $post[0]['content'], - "action_name" => "journal_view_main_detail", - "parameters" => "post_id=". $trackback['post_id'] . "&trackback_flag=1&block_id=".$block_id."#".$commonMain->getTopId($block_id), - "count_num" => $count, - "child_flag" => _ON, - "room_id" => $post[0]['room_id'], - "insert_time" => $time, - "insert_user_id" => $post[0]['insert_user_id'], - "insert_user_name" => $post[0]['insert_user_name'] - ); - $whatsnewAction =& $this->_container->getComponent("whatsnewAction"); - $result = $whatsnewAction->auto($whatsnew, _ON); - if($result === false) { - return false; - } - }else { - if($count == 0) { - $result = $whatsnewAction->delete($trackback['post_id'], _ON); - } - } - //--新着情報関連 End-- }else { @@ -481,7 +453,7 @@ function getWeblogMsg(){ * @return bool * @access public */ - function setWhatsnew($post_id) { + function setWhatsnew($post_id, $parameters="") { $params = array("post_id" => $post_id); $posts = $this->_db->selectExecute("journal_post", $params); @@ -492,46 +464,47 @@ function setWhatsnew($post_id) { $whatsnewAction =& $this->_container->getComponent("whatsnewAction"); if ($posts[0]["status"] == JOURNAL_POST_STATUS_REREASED_VALUE && $posts[0]["agree_flag"] == JOURNAL_STATUS_AGREE_VALUE) { + $commentParams = array( + "parent_id" => $post_id, + "direction_flag != " . JOURNAL_TRACKBACK_TRANSMIT => null, + "agree_flag" => JOURNAL_STATUS_AGREE_VALUE + ); + $count = $this->_db->countExecute("journal_post", $commentParams); + if ($count === false) { + return false; + } + + $time = timezone_date(); + if ($time < $posts[0]['journal_date'] || $count == 0) { + // 未来記事もしくは子記事が無いならば、日誌の記事の時間をセット + $child_update_time = $posts[0]['journal_date']; + } else { + //過去(現在)ならば、コメントのMAX日時と日誌の記事の日時の大きい方をセット + $child_update_time = $this->_db->maxExecute("journal_post", "insert_time", $commentParams); + if ($child_update_time < $posts[0]['journal_date']) { + $child_update_time = $posts[0]['journal_date']; + } + } + if ($parameters == "") { + $parameters = "post_id=". $post_id . "&comment_flag=1"; + } $whatsnew = array( "unique_id" => $post_id, "title" => $posts[0]["title"], "description" => $posts[0]["content"]."

".$posts[0]["more_content"], "action_name" => "journal_view_main_detail", - "parameters" => "post_id=". $post_id . "&comment_flag=1", + "parameters" => $parameters, "insert_time" => $posts[0]["journal_date"], "insert_user_id" => $posts[0]["insert_user_id"], "insert_user_name" => $posts[0]["insert_user_name"], - "update_time" => $posts[0]["journal_date"], - "child_update_time" => $posts[0]["journal_date"] + "count_num" => $count, + "child_update_time" => $child_update_time, + "room_id" => $posts[0]['room_id'], ); $result = $whatsnewAction->auto($whatsnew); if ($result === false) { return false; } - - // journal_dateが、未来かどうかを判断し、 - // 未来ならば、コメントの新着も未来に書き換え - // 未来でなければ、コメントのデータのMAXをとり、 - // その日付に更新 - $where_params = array( - "root_id" => $post_id - ); - $insert_time = $this->_db->maxExecute("journal_post", "insert_time", $where_params); - if(isset($insert_time)) { - // コメントあり - $time = timezone_date(); - $journal_date = $posts[0]["journal_date"]; - $whatsnew['child_flag'] = _ON; - if(intval($journal_date) < intval($time)) { - // 過去 - $whatsnew['insert_time'] = $journal_date; - $whatsnew['child_update_time'] = $insert_time; - } - $result = $whatsnewAction->auto($whatsnew, _OFF); - if ($result === false) { - return false; - } - } } else { $result = $whatsnewAction->delete($post_id); if($result === false) { @@ -541,61 +514,6 @@ function setWhatsnew($post_id) { return true; } - /** - * 新着情報にセットする(コメント) - * - * @return bool - * @access public - */ - function setCommentWhatsnew($comment_id) { - $params = array("post_id" => $comment_id); - $comment = $this->_db->selectExecute("journal_post", $params); - if (empty($comment)) { - return false; - } - $whatsnewAction =& $this->_container->getComponent("whatsnewAction"); - $count = $this->_db->countExecute("journal_post", array("parent_id"=>$comment[0]['parent_id'], "direction_flag != " . JOURNAL_TRACKBACK_TRANSMIT => null)); - if ($count === false) { - return false; - } - - if ($comment[0]["agree_flag"] == JOURNAL_STATUS_AGREE_VALUE) { - $journal_post = $this->_db->selectExecute("journal_post", array("post_id"=>$comment[0]['parent_id'])); - if ($journal_post === false && !isset($journal_post[0])) { - return false; - } - $time = timezone_date(); - if(intval($time) < intval($journal_post[0]['journal_date'])) { - // 未来ならば、日誌の記事の時間をセット - $time = $journal_post[0]['journal_date']; - } - - $whatsnew = array( - "unique_id" => $comment[0]['parent_id'], - "title" => $journal_post[0]['title'], - "description" => $journal_post[0]['content'], - "action_name" => "journal_view_main_detail", - "parameters" => "post_id=". $comment[0]['parent_id'] . "&comment_flag=1", - "count_num" => $count, - "child_flag" => _ON, - "child_update_time" => $time, - "insert_time" => $journal_post[0]['journal_date'], - "insert_user_id" => $journal_post[0]['insert_user_id'], - "insert_user_name" => $journal_post[0]['insert_user_name'] - ); - $result = $whatsnewAction->auto($whatsnew); - if($result === false) { - return false; - } - }else { - if($count == 0) { - $result = $whatsnewAction->delete($comment[0]['parent_id'], _ON); - } - } - - return true; - } - /** * 投稿回数をセットする * diff --git a/html/webapp/modules/journal/components/View.class.php b/html/webapp/modules/journal/components/View.class.php old mode 100644 new mode 100755 index af3afe3..67cfadd --- a/html/webapp/modules/journal/components/View.class.php +++ b/html/webapp/modules/journal/components/View.class.php @@ -98,7 +98,7 @@ function &getJournals() { $sql = "SELECT journal_id, journal_name, active_flag, insert_time, insert_user_id, insert_user_name ". "FROM {journal} ". "WHERE room_id = ? ". - $this->_db->getOrderSQL($orderParams); + $this->_db->getOrderSQL($orderParams, array('journal_name', 'active_flag', 'insert_user_name', 'insert_time')); $result = $this->_db->execute($sql, $params, $limit, $offset); if ($result === false) { $this->_db->addError(); @@ -448,7 +448,7 @@ function getPostList($journal_id, $category_id, $disp_cnt, $begin) { $params[] = ""; $request =& $this->_container->getComponent("Request"); - $module_id = $request->getParameter("module_id"); + $module_id = (int)$request->getParameter("module_id"); $sql = "SELECT P.*, C.category_name, URL.short_url ". "FROM {journal_post} P". @@ -484,7 +484,7 @@ function getPostDetail($post_id) { $params[] = $post_id; $request =& $this->_container->getComponent("Request"); - $module_id = $request->getParameter("module_id"); + $module_id = (int)$request->getParameter("module_id"); $sql = "SELECT P.*, C.category_name, URL.short_url ". "FROM {journal_post} P". @@ -564,7 +564,7 @@ function getPostDetailData($post_id) { $post_id ); - $module_id = $request->getParameter("module_id"); + $module_id = (int)$request->getParameter("module_id"); $sql = "SELECT P.*, C.category_name, URL.short_url ". "FROM {journal_post} P". diff --git a/html/webapp/modules/journal/install.ini b/html/webapp/modules/journal/install.ini old mode 100644 new mode 100755 index 5453878..52f09bd --- a/html/webapp/modules/journal/install.ini +++ b/html/webapp/modules/journal/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.1" +version = "2.4.0.2" action_name="journal_view_main_init" edit_action_name="journal_view_edit_list" block_add_action="journal_view_edit_create" diff --git a/html/webapp/modules/journal/language/english/main.ini b/html/webapp/modules/journal/language/english/main.ini index 7f284e4..3e5c836 100644 --- a/html/webapp/modules/journal/language/english/main.ini +++ b/html/webapp/modules/journal/language/english/main.ini @@ -32,11 +32,11 @@ journal_cat_add_title = "Add Category" journal_cat_name = "Category" journal_comment = "Comment" journal_cat_edit_readme = "You can edit the category by clicking it." -journal_from = "by:" +journal_from = "by " define:JOURNAL_NAME = "Journal" define:JOURNAL_NOCATEGORY = "Not specified" journal_nocategory = JOURNAL_NOCATEGORY -journal_add_user_title = "Posted by: %s" +journal_add_user_title = "Posted by %s" journal_mobile_post_category = "[Category]" journal_mobile_post_title = "[Title]" journal_mobile_post_date = "[Date]" diff --git a/html/webapp/modules/journal/language/japanese/main.ini b/html/webapp/modules/journal/language/japanese/main.ini index 615420b..bee5a56 100644 --- a/html/webapp/modules/journal/language/japanese/main.ini +++ b/html/webapp/modules/journal/language/japanese/main.ini @@ -32,7 +32,7 @@ journal_cat_add_title = "カテゴリを追加します。" journal_cat_name = "カテゴリ名" journal_comment = "コメント" journal_cat_edit_readme = "編集したいカテゴリ名は、クリックすると編集できます" -journal_from = "by:" +journal_from = "by " define:JOURNAL_NAME = "日誌" define:JOURNAL_NOCATEGORY = "カテゴリを指定しない" journal_nocategory = JOURNAL_NOCATEGORY diff --git a/html/webapp/modules/language/install.ini b/html/webapp/modules/language/install.ini old mode 100644 new mode 100755 index 6714ece..3d39b44 --- a/html/webapp/modules/language/install.ini +++ b/html/webapp/modules/language/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.0" +version = "2.4.0.1" action_name="language_view_main_init" edit_action_name="language_view_edit_init" block_add_action = "language_action_edit_create" diff --git a/html/webapp/modules/language/update/Update.class.php b/html/webapp/modules/language/update/Update.class.php old mode 100644 new mode 100755 index e05e363..a423a99 --- a/html/webapp/modules/language/update/Update.class.php +++ b/html/webapp/modules/language/update/Update.class.php @@ -42,7 +42,7 @@ function execute() } } - $sql = "SELECT {blocks}.*, {pages}.room_id FROM {blocks}, {pages} WHERE {blocks}.page_id={pages}.page_id AND {blocks}.module_id=".$this->module_id; + $sql = "SELECT {blocks}.*, {pages}.room_id FROM {blocks}, {pages} WHERE {blocks}.page_id={pages}.page_id AND {blocks}.module_id=".(int)$this->module_id; $blocks = $this->db->execute($sql); if($blocks === false) return false; if(!empty($blocks)) { diff --git a/html/webapp/modules/linklist/components/View.class.php b/html/webapp/modules/linklist/components/View.class.php index 14e4807..ec46065 100644 --- a/html/webapp/modules/linklist/components/View.class.php +++ b/html/webapp/modules/linklist/components/View.class.php @@ -151,7 +151,7 @@ function &getLinklists() $sql = "SELECT linklist_id, linklist_name, insert_time, insert_user_id, insert_user_name ". "FROM {linklist} ". "WHERE room_id = ? ". - $this->_db->getOrderSQL($orderParams); + $this->_db->getOrderSQL($orderParams, array('linklist_id', 'linklist_name', 'insert_user_name', 'insert_time')); $linklists = $this->_db->execute($sql, $params, $limit, $offset); if ($linklists === false) { $this->_db->addError(); diff --git a/html/webapp/modules/linklist/install.ini b/html/webapp/modules/linklist/install.ini old mode 100644 new mode 100755 index 11aa85e..2f08fe3 --- a/html/webapp/modules/linklist/install.ini +++ b/html/webapp/modules/linklist/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.1" +version = "2.4.0.2" action_name = "linklist_view_main_init" edit_action_name = "linklist_view_edit_list" block_add_action = "linklist_view_edit_entry" diff --git a/html/webapp/modules/login/install.ini b/html/webapp/modules/login/install.ini old mode 100644 new mode 100755 index 19ee237..501901e --- a/html/webapp/modules/login/install.ini +++ b/html/webapp/modules/login/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.2" +version = "2.4.2.1" action_name="login_view_main_init" [Mobile] diff --git a/html/webapp/modules/login/view/main/init/Init.class.php b/html/webapp/modules/login/view/main/init/Init.class.php old mode 100644 new mode 100755 diff --git a/html/webapp/modules/menu/files/js/menu.js b/html/webapp/modules/menu/files/js/menu.js index c75dec5..4cfb421 100644 --- a/html/webapp/modules/menu/files/js/menu.js +++ b/html/webapp/modules/menu/files/js/menu.js @@ -860,5 +860,84 @@ clsMenu.prototype = { } }.bind(this); commonCls.send(chg_params); + }, + // 未ログインのとき + // ログインinputのフォーカス&フォーカス外しの初期処理で + // onfocus & onblurのイベントが走る + // このイベント処理とJQロードのタイミングがちょうどかち合うとJSエラーが発生する + // このため、IE & < 9 & 未ログインのときに限り、JSロードを400MS待たせ、かつロード中はページ切り替え動作をキャンセルするよう + menuJqLoad: function(block_id, color) { + var jqload_func = this._menuJqLoad; + var cancel_func = this._menuCancelForJqload; + + // IEかつ未ログインだったら + if($('login_id_0') && browser.isIE && browser.version < 9) { + var els = Element.getElementsByClassName(this.id, "menu_jq_gnavi_pldwn_" + color + "_btn"); + els.each( + function(el){ + el.observe("click", cancel_func); + } + ); + + setTimeout(function(){ + jqload_func(block_id, color); + }, 400); + } + else { + jqload_func(block_id, color); + } + }, + _menuCancelForJqload : function(e) { + jcheck = new Function('return !(typeof jQuery !== "undefined" && window.$ === jQuery)'); + commonCls.wait(jcheck); + return false; + }, + _menuJqLoad : function(block_id, color) { + + var cancel_func = this._menuCancelForJqload; + + jqcheckCls.jqload("jquery-1.6.4.min", "window.jQuery", + function() { + var zindex = 900; + if(browser.isIE && browser.version <= 7) { + jQuery("#" + block_id + " ul.menu_jq_gnavi_pldwn_" + color + " > li").each(function(index,el) { + jQuery(el).attr("style","z-index:"+zindex); + zindex--; + }); + } + if(browser.isIE && browser.version < 7) { + jQuery("#" + block_id + " ul.menu_jq_gnavi_pldwn_" + color + " li").hover( + function() { jQuery(">a", this).addClass("menu_jq_gnavi_pldwn_" + color + "_actives"); jQuery(">ul.menu_jq_gnavi_pldwn_" + color + "_sub:not(:animated)", this).show(); }, + function() { jQuery(">a", this).removeClass("menu_jq_gnavi_pldwn_" + color + "_actives"); jQuery(">ul.menu_jq_gnavi_pldwn_" + color + "_sub", this).hide(); } + ); + } + else { + jQuery("#" + block_id + " ul.menu_jq_gnavi_pldwn_" + color + " li").hover( + function() { + jQuery(">a", this).addClass("menu_jq_gnavi_pldwn_" + color + "_actives"); + if(jQuery(this).closest("ul").hasClass("menu_jq_gnavi_pldwn_" + color + "_sub")) { + /*!browser.isIE && browser.version > 7 first view */ + if(jQuery(">ul.menu_jq_gnavi_pldwn_" + color + "_sub", this).css("left")=="0px" || jQuery(">ul.menu_jq_gnavi_pldwn_" + color + "_sub", this).css("left") == "auto"){ + jQuery(">ul.menu_jq_gnavi_pldwn_" + color + "_sub", this).css("left", jQuery(this).width()); + } + } + jQuery(">ul.menu_jq_gnavi_pldwn_" + color + "_sub:not(:animated)", this).slideDown("fast"); + }, + function() { + jQuery(">a", this).removeClass("menu_jq_gnavi_pldwn_" + color + "_actives"); + jQuery(">ul.menu_jq_gnavi_pldwn_" + color + "_sub", this).slideUp("fast"); + } + ); + } + if($('login_id_0') && browser.isIE && browser.version < 9) { + Element.getElementsByClassName(this.id, "menu_jq_gnavi_pldwn_" + color + "_btn").each( + function(el){ + el.stopObserving("click", cancel_func); + } + ); + } + + } + ); } } \ No newline at end of file diff --git a/html/webapp/modules/menu/install.ini b/html/webapp/modules/menu/install.ini old mode 100644 new mode 100755 index 8a001a3..986e725 --- a/html/webapp/modules/menu/install.ini +++ b/html/webapp/modules/menu/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.2" +version = "2.4.2.1" action_name="menu_view_main_init" edit_action_name="menu_view_edit_init" block_delete_action="auto" diff --git a/html/webapp/modules/menu/templates/jq_gnavi_pldwn_blue/menu_view_main_init.html b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_blue/menu_view_main_init.html index 2a547e3..f35764d 100644 --- a/html/webapp/modules/menu/templates/jq_gnavi_pldwn_blue/menu_view_main_init.html +++ b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_blue/menu_view_main_init.html @@ -11,40 +11,6 @@ <{include file="../menu_script.html"}> <{/strip}> diff --git a/html/webapp/modules/menu/templates/jq_gnavi_pldwn_gray/menu_view_main_init.html b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_gray/menu_view_main_init.html index cde7810..862a988 100644 --- a/html/webapp/modules/menu/templates/jq_gnavi_pldwn_gray/menu_view_main_init.html +++ b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_gray/menu_view_main_init.html @@ -11,40 +11,6 @@ <{include file="../menu_script.html"}> <{/strip}> diff --git a/html/webapp/modules/menu/templates/jq_gnavi_pldwn_green/menu_view_main_init.html b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_green/menu_view_main_init.html index 91e4476..33eb078 100644 --- a/html/webapp/modules/menu/templates/jq_gnavi_pldwn_green/menu_view_main_init.html +++ b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_green/menu_view_main_init.html @@ -11,40 +11,6 @@ <{include file="../menu_script.html"}> <{/strip}> diff --git a/html/webapp/modules/menu/templates/jq_gnavi_pldwn_orange/menu_view_main_init.html b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_orange/menu_view_main_init.html index f8522ef..7a1bacc 100644 --- a/html/webapp/modules/menu/templates/jq_gnavi_pldwn_orange/menu_view_main_init.html +++ b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_orange/menu_view_main_init.html @@ -11,40 +11,5 @@ <{include file="../menu_script.html"}> -<{/strip}> + Event.observe(window, "load", function() { menuCls['<{$id}>'].menuJqLoad("<{$id}>", "orange"); }, true); +<{/strip}> diff --git a/html/webapp/modules/menu/templates/jq_gnavi_pldwn_red/menu_view_main_init.html b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_red/menu_view_main_init.html index 5659bc1..c04356c 100644 --- a/html/webapp/modules/menu/templates/jq_gnavi_pldwn_red/menu_view_main_init.html +++ b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_red/menu_view_main_init.html @@ -11,40 +11,5 @@ <{include file="../menu_script.html"}> -<{/strip}> + Event.observe(window, "load", function() { menuCls['<{$id}>'].menuJqLoad("<{$id}>", "red"); }, true); +<{/strip}> diff --git a/html/webapp/modules/menu/templates/menu_view_edit_detail.html b/html/webapp/modules/menu/templates/menu_view_edit_detail.html old mode 100644 new mode 100755 index b748e27..22f9e36 --- a/html/webapp/modules/menu/templates/menu_view_edit_detail.html +++ b/html/webapp/modules/menu/templates/menu_view_edit_detail.html @@ -3,5 +3,7 @@ <{assign var="now_parent_id" value=$action.parent_id}> <{assign var="visibility_flag" value=$action.visibility_flag}> <{assign var="menus" value=$action.menus.$now_thread_num.$now_parent_id}> -<{include file="menu_view_edit_list.html"}> +<{if $menus}> + <{include file="menu_view_edit_list.html"}> +<{/if}> <{/strip}> \ No newline at end of file diff --git a/html/webapp/modules/mobile/install.ini b/html/webapp/modules/mobile/install.ini old mode 100644 new mode 100755 index affc2c7..9fbc0d4 --- a/html/webapp/modules/mobile/install.ini +++ b/html/webapp/modules/mobile/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.0" +version = "2.4.0.1" action_name = "mobile_view_admin_init" system_flag = 1 module_icon = "mobile.gif" diff --git a/html/webapp/modules/mobile/templates/default/mobile_view_admin_menu_detail.html b/html/webapp/modules/mobile/templates/default/mobile_view_admin_menu_detail.html old mode 100644 new mode 100755 index 9a9c9bc..0fdfcbf --- a/html/webapp/modules/mobile/templates/default/mobile_view_admin_menu_detail.html +++ b/html/webapp/modules/mobile/templates/default/mobile_view_admin_menu_detail.html @@ -6,5 +6,7 @@ <{assign var="alert_mess_disabled_menu" value=$lang.mobile_error_message_2|smarty:nodefaults|escape:"javascript"|escape:"html"}> <{assign var="alert_mess_disabled_node" value=$lang.mobile_error_message_3|smarty:nodefaults|escape:"javascript"|escape:"html"}> <{assign var="visibility_flag" value=$action.space_visibility_flag}> -<{include file="mobile_view_admin_menu_list.html"}> +<{if $menus}> + <{include file="mobile_view_admin_menu_list.html"}> +<{/if}> <{/strip}> diff --git a/html/webapp/modules/module/components/Compmain.class.php b/html/webapp/modules/module/components/Compmain.class.php old mode 100644 new mode 100755 index e8f71e4..026bbb8 --- a/html/webapp/modules/module/components/Compmain.class.php +++ b/html/webapp/modules/module/components/Compmain.class.php @@ -45,6 +45,9 @@ function Module_Components_Compmain() { * @access public */ function clearCacheByDirname($dirname) { + $currentErrorReporting = error_reporting(); + error_reporting($currentErrorReporting & ~E_WARNING); + // ---------------------------------------------- // --- キャッシュクリア --- // ---------------------------------------------- @@ -76,10 +79,13 @@ function clearCacheByDirname($dirname) { //キャッシュクリア $renderer->clear_cache(); $cache->setClearCache($clear_cache); //元に戻す - + + error_reporting($currentErrorReporting); return true; } } + + error_reporting($currentErrorReporting); return false; } diff --git a/html/webapp/modules/module/install.ini b/html/webapp/modules/module/install.ini old mode 100644 new mode 100755 index 645a691..3ef3931 --- a/html/webapp/modules/module/install.ini +++ b/html/webapp/modules/module/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.1" +version = "2.4.0.2" action_name = "module_view_admin_init" system_flag=1 ;disposition_flag=1 diff --git a/html/webapp/modules/module/update/Update.class.php b/html/webapp/modules/module/update/Update.class.php old mode 100644 new mode 100755 index 6fc5538..8840f90 --- a/html/webapp/modules/module/update/Update.class.php +++ b/html/webapp/modules/module/update/Update.class.php @@ -166,9 +166,14 @@ function execute() //lang_dirname項目の更新 // $config_lang =& $this->configView->getConfigByConfname(_SYS_CONF_MODID, 'language'); - $defualt_lang = empty($config_lang['conf_value'])?'japanese':$config_lang['conf_value']; - $result = $this->db->execute("UPDATE {pages} SET {pages}.lang_dirname='".$defualt_lang. - "' WHERE {pages}.space_type="._SPACE_TYPE_PUBLIC." AND {pages}.display_position="._DISPLAY_POSITION_CENTER." AND {pages}.thread_num!=0"); + $default_lang = empty($config_lang['conf_value']) ? 'japanese' : $config_lang['conf_value']; + $params = array('lang_dirname' => $default_lang); + $where_params = array( + 'space_type' => _SPACE_TYPE_PUBLIC, + 'display_position' => _DISPLAY_POSITION_CENTER, + 'thread_num!' => 0, + ); + $result = $this->db->updateExecute('pages', $params, $where_params); if($result === false) return false; } @@ -493,11 +498,23 @@ function execute() } } - // WYSIWYGの許可するVideoURLに「http://www.youtube-nocookie.com/」を追加 - $textarea_video_url = $this->db->selectExecute("textarea_video_url", array("url"=> 'http://www.youtube-nocookie.com/')); + // WYSIWYGの許可するVideoURLに「//www.youtube.com/」を追加 + $textarea_video_url = $this->db->selectExecute("textarea_video_url", array("url"=> '//www.youtube.com/')); if($textarea_video_url !== false && count($textarea_video_url) == 0) { $sql = "INSERT INTO `".$this->db->getPrefix()."textarea_video_url` (`url`, `action_name`, `insert_time`, `insert_site_id`, `insert_user_id`, `insert_user_name`, `update_time`, `update_site_id`, `update_user_id`, `update_user_name`) VALUES - ('http://www.youtube-nocookie.com/', '', '', '', '0', '', '', '', '0', '')"; + ('//www.youtube.com/', '', '', '', '0', '', '', '', '0', '')"; + $result = $this->db->execute($sql); + if ($result === false) { + return false; + } + } + + // WYSIWYGの許可するVideoURLに「https://www.youtube.com/」「https://www.youtube-nocookie.com/」を追加 + $textarea_video_url = $this->db->selectExecute("textarea_video_url", array("url"=> 'https://www.youtube.com/')); + if($textarea_video_url !== false && count($textarea_video_url) == 0) { + $sql = "INSERT INTO `".$this->db->getPrefix()."textarea_video_url` (`url`, `action_name`, `insert_time`, `insert_site_id`, `insert_user_id`, `insert_user_name`, `update_time`, `update_site_id`, `update_user_id`, `update_user_name`) VALUES + ('https://www.youtube.com/', '', '', '', '0', '', '', '', '0', ''), + ('https://www.youtube-nocookie.com/', '', '', '', '0', '', '', '', '0', '')"; $result = $this->db->execute($sql); if ($result === false) { return false; diff --git a/html/webapp/modules/module/view/admin/init/Init.class.php b/html/webapp/modules/module/view/admin/init/Init.class.php index 81ffa04..c6b10e0 100644 --- a/html/webapp/modules/module/view/admin/init/Init.class.php +++ b/html/webapp/modules/module/view/admin/init/Init.class.php @@ -19,7 +19,7 @@ class Module_View_Admin_Init extends Action // 値をセットするため var $sysmodules_obj = null; var $modules_obj = null; - var $installs_obj = null; + var $installs_obj = array(); var $maxNum = 0; var $sysMaxNum = 0; diff --git a/html/webapp/modules/multidatabase/action/main/addcontent/Addcontent.class.php b/html/webapp/modules/multidatabase/action/main/addcontent/Addcontent.class.php old mode 100644 new mode 100755 index ada91f5..348bf24 --- a/html/webapp/modules/multidatabase/action/main/addcontent/Addcontent.class.php +++ b/html/webapp/modules/multidatabase/action/main/addcontent/Addcontent.class.php @@ -213,7 +213,7 @@ function execute() if ($result === false) { return 'error'; } - }else { + } elseif (is_array($datas[$metadata_id])) { $params = array( "upload_id" => $datas[$metadata_id]['upload_id'], "file_name" => $datas[$metadata_id]['file_name'], diff --git a/html/webapp/modules/multidatabase/action/main/delcomment/Delcomment.class.php b/html/webapp/modules/multidatabase/action/main/delcomment/Delcomment.class.php index 95ac94f..5e4bac2 100644 --- a/html/webapp/modules/multidatabase/action/main/delcomment/Delcomment.class.php +++ b/html/webapp/modules/multidatabase/action/main/delcomment/Delcomment.class.php @@ -21,6 +21,7 @@ class Multidatabase_Action_Main_Delcomment extends Action // 使用コンポーネントを受け取るため var $db = null; var $whatsnewAction = null; + var $mdbAction = null; // バリデートによりセットするため @@ -45,8 +46,28 @@ function execute() if($count == 0) { $result = $this->whatsnewAction->delete($this->content_id, _ON); } else { + $params = array(); + $whereParams = array('content_id' => $this->content_id); + $sql = "SELECT M.multidatabase_id, M.title_metadata_id " + . "FROM {multidatabase_content} MC " + . "INNER JOIN {multidatabase} M " + . "ON MC.multidatabase_id = M.multidatabase_id" + . $this->db->getWhereSQL($params, $whereParams); + $multidatabase = $this->db->execute($sql, $params); + if (empty($multidatabase)) { + return 'error'; + } + + $whatsnewTitle = $this->mdbAction->getWhatsnewTitle($this->content_id, $multidatabase[0]['title_metadata_id']); + if ($whatsnewTitle === false) { + return 'error'; + } $whatsnew = array( "unique_id" => $this->content_id, + "title" => $whatsnewTitle["title"], + "description" => $whatsnewTitle["description"], + "action_name" => "multidatabase_view_main_detail", + "parameters" => "content_id=". $this->content_id . "&multidatabase_id=" . $multidatabase[0]["multidatabase_id"], "count_num" => $count, "child_flag" => _ON ); diff --git a/html/webapp/modules/multidatabase/action/main/delcomment/maple.ini b/html/webapp/modules/multidatabase/action/main/delcomment/maple.ini index 52b4ddb..442d754 100644 --- a/html/webapp/modules/multidatabase/action/main/delcomment/maple.ini +++ b/html/webapp/modules/multidatabase/action/main/delcomment/maple.ini @@ -10,6 +10,7 @@ comment_id.multidatabase.commentExists="1:lang._invalid_input" [Action] whatsnewAction = "ref:whatsnewAction" +mdbAction = "ref:mdbAction" [View] success = "action:multidatabase_view_main_detail" diff --git a/html/webapp/modules/multidatabase/components/View.class.php b/html/webapp/modules/multidatabase/components/View.class.php old mode 100644 new mode 100755 index 197ac45..382644a --- a/html/webapp/modules/multidatabase/components/View.class.php +++ b/html/webapp/modules/multidatabase/components/View.class.php @@ -351,7 +351,7 @@ function &getMdbs() { $sql = "SELECT multidatabase_id, multidatabase_name, active_flag, insert_time, insert_user_id, insert_user_name ". "FROM {multidatabase} ". "WHERE room_id = ? ". - $this->_db->getOrderSQL($orderParams); + $this->_db->getOrderSQL($orderParams, array('multidatabase_id', 'multidatabase_name', 'insert_user_name', 'insert_time')); $result = $this->_db->execute($sql, $params, $limit, $offset); if ($result === false) { $this->_db->addError(); @@ -1360,7 +1360,7 @@ function &_getSqlContentWhereStatement($multidatabaseId, $whereValues, $keywordB */ function &_getAbbreviateUrlJoinStatement() { $request =& $this->_container->getComponent('Request'); - $moduleId = $request->getParameter('module_id'); + $moduleId = (int)$request->getParameter('module_id'); $joinStatement = 'LEFT JOIN {abbreviate_url} URL ' . "ON URL.module_id = '" . $moduleId . "' " diff --git a/html/webapp/modules/multidatabase/install.ini b/html/webapp/modules/multidatabase/install.ini old mode 100644 new mode 100755 index 5ce72ac..7916fcf --- a/html/webapp/modules/multidatabase/install.ini +++ b/html/webapp/modules/multidatabase/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.1" +version = "2.4.0.2" action_name="multidatabase_view_main_init" edit_action_name="multidatabase_view_edit_list" block_add_action="multidatabase_view_edit_create" diff --git a/html/webapp/modules/multidatabase/templates/default/multidatabase_mobile_metadata_detail_feature.html b/html/webapp/modules/multidatabase/templates/default/multidatabase_mobile_metadata_detail_feature.html index 01e3c56..b13c76f 100644 --- a/html/webapp/modules/multidatabase/templates/default/multidatabase_mobile_metadata_detail_feature.html +++ b/html/webapp/modules/multidatabase/templates/default/multidatabase_mobile_metadata_detail_feature.html @@ -8,7 +8,7 @@ <{/if}> -<{if $metadata.type == $smarty.const.MULTIDATABASE_META_TYPE_TEXT || $metadata.type == MULTIDATABASE_META_TYPE_MAIL || $metadata.type == MULTIDATABASE_META_TYPE_MAIL}> +<{if $metadata.type == $smarty.const.MULTIDATABASE_META_TYPE_TEXT || $metadata.type == MULTIDATABASE_META_TYPE_MAIL}> <{* テキスト *}>
diff --git a/html/webapp/modules/multidatabase/validator/Validator_MetadataInput.class.php b/html/webapp/modules/multidatabase/validator/Validator_MetadataInput.class.php old mode 100644 new mode 100755 index aaab5fd..1c29538 --- a/html/webapp/modules/multidatabase/validator/Validator_MetadataInput.class.php +++ b/html/webapp/modules/multidatabase/validator/Validator_MetadataInput.class.php @@ -94,6 +94,8 @@ function validate($attributes, $errStr, $params) $metadata_id = $metadata['metadata_id']; $input_datas[$metadata_id] = ""; + + // ファイル・画像項目のアップロード情報 または エラー情報をセット if(isset($datas[$metadata_id])) { $input_datas[$metadata_id] = $datas[$metadata_id]; } @@ -154,9 +156,11 @@ function validate($attributes, $errStr, $params) if($pathinfo === false) { $errors['mdb_metadatas_'. $metadata_id] = _FILE_UPLOAD_ERR_IMAGETYPE; } - $size = $mdbView->getImageBlockSize($datas[$metadata_id]['physical_file_name']); - $input_datas[$metadata_id]['block_img_width'] = $size[0]; - $input_datas[$metadata_id]['block_img_height'] = $size[1]; + if (!isset($errors['mdb_metadatas_'. $metadata_id])) { + $size = $mdbView->getImageBlockSize($datas[$metadata_id]['physical_file_name']); + $input_datas[$metadata_id]['block_img_width'] = $size[0]; + $input_datas[$metadata_id]['block_img_height'] = $size[1]; + } } if($metadata['type'] == MULTIDATABASE_META_TYPE_FILE ) { @@ -205,9 +209,11 @@ function validate($attributes, $errStr, $params) $errors['mdb_metadatas_'. $metadata_id] = $metadata['name'].$datas[$metadata_id]['error_mes']; continue; - }else { - $input_datas[$metadata_id] = $session->getParameter(array("multidatabase_content", $attributes['block_id'], $metadata_id)); - if($metadata['type'] == MULTIDATABASE_META_TYPE_FILE && !empty($input_datas[$metadata_id])) { + } else { + if (!is_array($input_datas[$metadata_id]) || !isset($input_datas[$metadata_id]['upload_id'])) { + $input_datas[$metadata_id] = ''; + } + if($metadata['type'] === MULTIDATABASE_META_TYPE_FILE) { $this->_CheckDownloadPassword($metadata_id, $attributes, $objectName, $errorMsg, $errors); } } diff --git a/html/webapp/modules/multidatabase/validator/Validator_UploadCsv.class.php b/html/webapp/modules/multidatabase/validator/Validator_UploadCsv.class.php index f1c42ce..d42a174 100644 --- a/html/webapp/modules/multidatabase/validator/Validator_UploadCsv.class.php +++ b/html/webapp/modules/multidatabase/validator/Validator_UploadCsv.class.php @@ -64,7 +64,7 @@ function validate($attributes, $errStr, $params) while (($data = $mdbAction->fgetcsv_reg($handle)) !== FALSE) { $num = count($data); for ($c=0; $c < $num; $c++) { - $data[$c] = mb_convert_encoding($data[$c], "UTF-8", "SJIS"); + $data[$c] = mb_convert_encoding($data[$c], "UTF-8", _CLIENT_OS_CHARSET); } $row_data[] = $data; } diff --git a/html/webapp/modules/multidatabase/view/main/init/Init.class.php b/html/webapp/modules/multidatabase/view/main/init/Init.class.php index 17338e3..0fd92c0 100644 --- a/html/webapp/modules/multidatabase/view/main/init/Init.class.php +++ b/html/webapp/modules/multidatabase/view/main/init/Init.class.php @@ -104,6 +104,9 @@ function execute() $where_params = array(); if(!empty($this->sort_section)) { foreach($this->sort_section as $key => $val) { + if (!isset($this->section_metadatas[$key])) { + return 'error'; + } $where_params["m_content".$key.".content"] = $val; } } diff --git a/html/webapp/modules/multidatabase/view/main/search/result/Result.class.php b/html/webapp/modules/multidatabase/view/main/search/result/Result.class.php index 4e72509..23bee1f 100644 --- a/html/webapp/modules/multidatabase/view/main/search/result/Result.class.php +++ b/html/webapp/modules/multidatabase/view/main/search/result/Result.class.php @@ -183,6 +183,9 @@ function execute() $where_params = array(); if(!empty($this->sort_section)) { foreach($this->sort_section as $key => $val) { + if (!isset($this->section_metadatas[$key])) { + return 'error'; + } $where_params["m_content".$key.".content"]= $val; } } diff --git a/html/webapp/modules/pages/components/Compmain.class.php b/html/webapp/modules/pages/components/Compmain.class.php old mode 100644 new mode 100755 index baf3bde..6773625 --- a/html/webapp/modules/pages/components/Compmain.class.php +++ b/html/webapp/modules/pages/components/Compmain.class.php @@ -127,7 +127,7 @@ function setPageFetch(&$blocks_obj,&$pages_obj,&$html, $template_dir, $display_p $this->_renderer->assign('url',$block['full_path']); $this->_renderer->assign('encode_url',rawurlencode($block['full_path'])); $this->_renderer->assign('id',"_".$block['block_id']); - $this->_renderer->assign('module_obj',""); + $this->_renderer->assign('module_obj', array()); $this->_renderer->assign('headermenu',""); //最小広さ設定 diff --git a/html/webapp/modules/photoalbum/components/View.class.php b/html/webapp/modules/photoalbum/components/View.class.php index 065b012..8dfd431 100644 --- a/html/webapp/modules/photoalbum/components/View.class.php +++ b/html/webapp/modules/photoalbum/components/View.class.php @@ -174,7 +174,7 @@ function &getPhotoalbums() $sql = "SELECT photoalbum_id, photoalbum_name, insert_time, insert_user_id, insert_user_name ". "FROM {photoalbum} ". "WHERE room_id = ? ". - $this->_db->getOrderSQL($orderParams); + $this->_db->getOrderSQL($orderParams, array('photoalbum_id', 'photoalbum_name', 'insert_user_name', 'insert_time')); $photoalbums = $this->_db->execute($sql, $params, $limit, $offset); if ($photoalbums === false) { $this->_db->addError(); diff --git a/html/webapp/modules/photoalbum/install.ini b/html/webapp/modules/photoalbum/install.ini old mode 100644 new mode 100755 index 05911ef..0df141c --- a/html/webapp/modules/photoalbum/install.ini +++ b/html/webapp/modules/photoalbum/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.2" +version = "2.4.2.1" action_name = "photoalbum_view_main_init" edit_action_name = "photoalbum_view_edit_list" block_add_action = "photoalbum_view_edit_entry" diff --git a/html/webapp/modules/pm/components/Action.class.php b/html/webapp/modules/pm/components/Action.class.php old mode 100644 new mode 100755 index acb3289..eac672b --- a/html/webapp/modules/pm/components/Action.class.php +++ b/html/webapp/modules/pm/components/Action.class.php @@ -880,9 +880,14 @@ function setFilter() $filter_id, $user_id, ); + $actionIdArr = array(); + foreach ($actions as $actionId) { + $actionIdArr[] = (int)$actionId; + } + $sql = "DELETE FROM {pm_filter_action_link} ". "WHERE filter_id = ? AND insert_user_id = ? AND ". - "action_id NOT IN (" . join(",", $actions) . ")"; + "action_id NOT IN (" . join(",", $actionIdArr) . ")"; if (!$this->_db->execute($sql, $params)) { return false; diff --git a/html/webapp/modules/pm/components/View.class.php b/html/webapp/modules/pm/components/View.class.php old mode 100644 new mode 100755 index 0968380..d8ec749 --- a/html/webapp/modules/pm/components/View.class.php +++ b/html/webapp/modules/pm/components/View.class.php @@ -102,10 +102,10 @@ function &generateMessagesQuery($action = 'common', $count = false){ $sortColumn = $this->_request->getParameter("sort_col"); $sortDirection = $this->_request->getParameter("sort_dir"); - if (empty($sortColumn)) { + if (!in_array($sortColumn, array('r.insert_user_name', 'm.receivers_list', 'm.subject', 'm.sent_time'))) { $sortColumn = "m.sent_time"; } - if (empty($sortDirection)) { + if ((empty($sortDirection) || ($sortDirection != 'ASC' && $sortDirection != 'asc'))) { $sortDirection = "DESC"; } $orderParams[$sortColumn] = $sortDirection; @@ -819,7 +819,7 @@ function &_getFilterSql($filter) if (sizeof($tagFilter) == 2) { if ($tagFilter[0] == PM_FILTER_TAG) { $tag_id = $tagFilter[1]; - $filterSql = " AND receiver_id IN (SELECT receiver_id FROM {pm_message_tag_link} WHERE tag_id = " . $tag_id . ")"; + $filterSql = " AND receiver_id IN (SELECT receiver_id FROM {pm_message_tag_link} WHERE tag_id = " . (int)$tag_id . ")"; } } } diff --git a/html/webapp/modules/pm/install.ini b/html/webapp/modules/pm/install.ini old mode 100644 new mode 100755 index 130744f..8b90f23 --- a/html/webapp/modules/pm/install.ini +++ b/html/webapp/modules/pm/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.2" +version = "2.4.2.1" action_name="pm_view_main_init" delete_action = "pm_action_admin_operation" module_update_action="pm_update" diff --git a/html/webapp/modules/pm/validator/Validator_FilterActionRequired.class.php b/html/webapp/modules/pm/validator/Validator_FilterActionRequired.class.php old mode 100644 new mode 100755 index 208fa99..32f19a0 --- a/html/webapp/modules/pm/validator/Validator_FilterActionRequired.class.php +++ b/html/webapp/modules/pm/validator/Validator_FilterActionRequired.class.php @@ -14,25 +14,26 @@ */ class Pm_Validator_FilterActionRequired extends Validator { - /** - * フィルタ処理内容必須チェックバリデータ - * - * @param mixed $attributes チェックする値 - * @param string $errStr エラー文字列 - * @param array $params オプション引数 - * @return string エラー文字列(エラーの場合) - * @access public - */ - function validate($attributes, $errStr, $params) - { - - $filter_actions = $attributes["0"]; - - if ($filter_actions == null) { + /** + * フィルタ処理内容必須チェックバリデータ + * + * @param mixed $attributes チェックする値 + * @param string $errStr エラー文字列 + * @param array $params オプション引数 + * @return string エラー文字列(エラーの場合) + * @access public + */ + function validate($attributes, $errStr, $params) + { + if (empty($attributes)) { return $errStr; } - - return; - } + foreach ($attributes as $filterActionId) { + if (!is_numeric($filterActionId)) { + return _INVALID_INPUT; + } + } + return; + } } ?> \ No newline at end of file diff --git a/html/webapp/modules/questionnaire/components/View.class.php b/html/webapp/modules/questionnaire/components/View.class.php index 211d2f2..54eda84 100644 --- a/html/webapp/modules/questionnaire/components/View.class.php +++ b/html/webapp/modules/questionnaire/components/View.class.php @@ -176,7 +176,7 @@ function &getQuestionnaires() "WHERE Q.room_id = ? ". "GROUP BY Q.questionnaire_id, Q.questionnaire_name, Q.icon_name, Q.status, ". "Q.insert_time, Q.insert_user_id, Q.insert_user_name ". - $this->_db->getOrderSQL($orderParams); + $this->_db->getOrderSQL($orderParams, array('questionnaire_id', 'questionnaire_name', 'status', 'insert_user_name', 'insert_time')); $questionnaires = $this->_db->execute($sql, $params, $limit, $offset); if ($questionnaires === false) { $this->_db->addError(); @@ -831,12 +831,12 @@ function &getSummaries() $offset = $this->_request->getParameter("offset"); $sortColumn = $this->_request->getParameter("sort_col"); - if (empty($sortColumn)) { + if (empty($sortColumn) || !in_array($sortColumn, array('answer_number', 'answer_time'))) { $sortColumn = "summary_id"; } $sortDirection = $this->_request->getParameter("sort_dir"); - if (empty($sortDirection)) { - $sortDirection = ($mobile_flag==_ON ? "DESC" : "ASC"); + if (empty($sortDirection) || $sortDirection != 'DESC') { + $sortDirection = "ASC"; } $orderParams[$sortColumn] = $sortDirection; diff --git a/html/webapp/modules/questionnaire/install.ini b/html/webapp/modules/questionnaire/install.ini old mode 100644 new mode 100755 index 7534835..4d71333 --- a/html/webapp/modules/questionnaire/install.ini +++ b/html/webapp/modules/questionnaire/install.ini @@ -1,4 +1,4 @@ -version = "2.4.2.0" +version = "2.4.2.1" action_name = "questionnaire_view_main_init" edit_action_name = "questionnaire_view_edit_questionnaire_list" block_add_action = "questionnaire_view_edit_questionnaire_entry" diff --git a/html/webapp/modules/quiz/components/View.class.php b/html/webapp/modules/quiz/components/View.class.php index 14acf52..ae3bfcb 100644 --- a/html/webapp/modules/quiz/components/View.class.php +++ b/html/webapp/modules/quiz/components/View.class.php @@ -175,7 +175,7 @@ function &getQuizzes() "WHERE Q.room_id = ? ". "GROUP BY Q.quiz_id, Q.quiz_name, Q.icon_name, Q.status, ". "Q.insert_time, Q.insert_user_id, Q.insert_user_name ". - $this->_db->getOrderSQL($orderParams); + $this->_db->getOrderSQL($orderParams, array('quiz_id', 'quiz_name', 'status', 'insert_user_name', 'insert_time')); $quizzes = $this->_db->execute($sql, $params, $limit, $offset); if ($quizzes === false) { $this->_db->addError(); @@ -872,7 +872,7 @@ function &getSummaries($statistics = null) $offset = $this->_request->getParameter("offset"); $sortColumn = $this->_request->getParameter("sort_col"); - if (empty($sortColumn)) { + if (empty($sortColumn) || !in_array($sortColumn, array('answer_number', 'answer_time', 'summary_score'))) { $sortColumn = "summary_id"; } $sortDirection = $this->_request->getParameter("sort_dir"); diff --git a/html/webapp/modules/quiz/install.ini b/html/webapp/modules/quiz/install.ini old mode 100644 new mode 100755 index 067f34f..5642a1d --- a/html/webapp/modules/quiz/install.ini +++ b/html/webapp/modules/quiz/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.0" +version = "2.4.0.1" action_name = "quiz_view_main_init" edit_action_name = "quiz_view_edit_quiz_list" block_add_action = "quiz_view_edit_quiz_entry" diff --git a/html/webapp/modules/quiz/validator/Validator_AnswerFlag.class.php b/html/webapp/modules/quiz/validator/Validator_AnswerFlag.class.php old mode 100644 new mode 100755 index 2abc072..2f67452 --- a/html/webapp/modules/quiz/validator/Validator_AnswerFlag.class.php +++ b/html/webapp/modules/quiz/validator/Validator_AnswerFlag.class.php @@ -25,13 +25,21 @@ class Quiz_Validator_AnswerFlag extends Validator */ function validate($attributes, $errStr, $params) { - foreach (array_keys($attributes["answer_flag"]) as $index) { - if ($attributes["answer_flag"][$index] != QUIZ_ANSWER_NOT_MARK_VALUE && - $attributes["answer_flag"][$index] != QUIZ_ANSWER_CORRECT_VALUE && - $attributes["answer_flag"][$index] != QUIZ_ANSWER_WRONG_VALUE) { + $answerFlagArr = array(); + foreach ($attributes["answer_flag"] as $answerId => $answerValue) { + if (!is_numeric($answerId) || + ($answerValue !== QUIZ_ANSWER_NOT_MARK_VALUE && + $answerValue !== QUIZ_ANSWER_CORRECT_VALUE && + $answerValue !== QUIZ_ANSWER_WRONG_VALUE) + ) { return $errStr; } - } + $answerFlagArr[(int)$answerId] = $answerValue; + } + + $container =& DIContainerFactory::getContainer(); + $request =& $container->getComponent('Request'); + $request->setParameter('answer_flag', $answerFlagArr); return; } diff --git a/html/webapp/modules/registration/action/main/mail/Mail.class.php b/html/webapp/modules/registration/action/main/mail/Mail.class.php index a08ba2e..b4086be 100644 --- a/html/webapp/modules/registration/action/main/mail/Mail.class.php +++ b/html/webapp/modules/registration/action/main/mail/Mail.class.php @@ -61,7 +61,13 @@ function execute() $users = array(); if ($mail['regist_user_send'] && !empty($mail['regist_user_email'])) { - $users[]['email'] = $mail['regist_user_email']; + + // メールアドレス欄が複数ある場合の対応 by nagahara@opensource-workshop.jp + // $users[]['email'] = $mail['regist_user_email']; + foreach( $mail['regist_user_email'] as $mail_item ) { + $users[]['email'] = $mail_item; + } + $this->mailMain->setToUsers($users); $this->mailMain->send(); } diff --git a/html/webapp/modules/registration/components/View.class.php b/html/webapp/modules/registration/components/View.class.php index a87dd72..5c39cea 100644 --- a/html/webapp/modules/registration/components/View.class.php +++ b/html/webapp/modules/registration/components/View.class.php @@ -159,7 +159,7 @@ function &getRegistrations() "ON R.registration_id = D.registration_id ". "WHERE R.room_id = ? ". "GROUP BY R.registration_id, R.registration_name, R.active_flag, R.insert_time, R.insert_user_id, R.insert_user_name ". - $this->_db->getOrderSQL($orderParams); + $this->_db->getOrderSQL($orderParams, array('R.registration_id', 'R.registration_name', 'data_count', 'R.active_flag', 'R.insert_user_name', 'R.insert_time')); $registrations = $this->_db->execute($sql, $params, $limit, $offset); if ($registrations === false) { $this->_db->addError(); @@ -632,8 +632,14 @@ function &getDataList($limit = null, $offset = null) $sortColumn = "file_name". $sortItemID; $sortDirection = "ASC"; } else { - $sortColumn = "item_data_value". $sortItemID; - $sortDirection = "ASC"; + $items = $this->_request->getParameter("items"); + if (isset($items[$sortItemID])) { + $sortColumn = "item_data_value". $sortItemID; + $sortDirection = "ASC"; + } else { + $sortColumn = "D.insert_time"; + $sortDirection = "DESC"; + } } $orderParams[$sortColumn] = $sortDirection; @@ -741,7 +747,9 @@ function &_makeMail(&$recordSet) } if ($item['item_type'] == REGISTRATION_TYPE_EMAIL) { - $mail['regist_user_email'] = $row[$key]; + // メールアドレス欄が複数ある場合の対応 by nagahara@opensource-workshop.jp + // $mail['regist_user_email'] = $row[$key]; + $mail['regist_user_email'][] = $row[$key]; } $mail["data"] .= sprintf($dataFormat, htmlspecialchars($item["item_name"]), $value); diff --git a/html/webapp/modules/registration/install.ini b/html/webapp/modules/registration/install.ini old mode 100644 new mode 100755 index 8717f19..a063cd1 --- a/html/webapp/modules/registration/install.ini +++ b/html/webapp/modules/registration/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.1" +version = "2.4.0.2" action_name="registration_view_main_init" edit_action_name="registration_view_edit_registration_list" block_add_action="registration_view_edit_registration_entry" diff --git a/html/webapp/modules/registration/language/english/main.ini b/html/webapp/modules/registration/language/english/main.ini index 64a7ad6..e5f657e 100644 --- a/html/webapp/modules/registration/language/english/main.ini +++ b/html/webapp/modules/registration/language/english/main.ini @@ -140,6 +140,7 @@ registration_mobile_item_name = "[%s]" registration_not_open = "Registration is not in process." registration_entry_text = "Fill out the form on this page, and click the %s button.
The items marked by * are required to answer." registration_email_second = "to confirm" +registration_image_auth_readme = "Type the words" [Registration_View_Main_Confirm] registration_confirm_text = "Please check the information you have entered, diff --git a/html/webapp/modules/reservation/components/View.class.php b/html/webapp/modules/reservation/components/View.class.php old mode 100644 new mode 100755 index bbadea8..0ce0385 --- a/html/webapp/modules/reservation/components/View.class.php +++ b/html/webapp/modules/reservation/components/View.class.php @@ -498,7 +498,7 @@ function getLocations($category_id = null, $limit = null, $offset = null, $func= $sql .= "WHERE 1=1 "; } if (isset($category_id)) { - $sql .= "AND location.category_id = ".$category_id." "; + $sql .= "AND location.category_id = ".(int)$category_id." "; } $sql .= "ORDER BY category.display_sequence, location.display_sequence"; diff --git a/html/webapp/modules/reservation/install.ini b/html/webapp/modules/reservation/install.ini old mode 100644 new mode 100755 index 566ffd8..bb9ed73 --- a/html/webapp/modules/reservation/install.ini +++ b/html/webapp/modules/reservation/install.ini @@ -1,4 +1,4 @@ -version = "2.4.2.0" +version = "2.4.2.1" action_name = "reservation_view_main_init" edit_action_name = "reservation_view_edit_style_init" block_add_action = "reservation_action_edit_addblock" diff --git a/html/webapp/modules/reservation/validator/Validator_Import.class.php b/html/webapp/modules/reservation/validator/Validator_Import.class.php index b3ae981..79c9f12 100644 --- a/html/webapp/modules/reservation/validator/Validator_Import.class.php +++ b/html/webapp/modules/reservation/validator/Validator_Import.class.php @@ -50,6 +50,7 @@ function validate($attributes, $errStr, $params) //利用できるグループのチェック $attributes["reserve_room_id"] = intval($attributes["reserve_room_id"]); if ($attributes["reserve_room_id"] != 0 && !in_array($attributes["reserve_room_id"], $attributes["allow_add_rooms"])) { + fclose($handle); return _INVALID_INPUT; } @@ -57,12 +58,14 @@ function validate($attributes, $errStr, $params) $row_csv_header = $csvMain->fgets($handle); if (empty($row_csv_header)) { $uploadsAction->delUploadsById($filelist[0]["upload_id"]); + fclose($handle); return RESERVATION_ERR_FILE_FORMAT; } $header_format = explode("|", RESERVATION_IMPORT_FORMAT); foreach ($header_format as $i=>$val) { - if (mb_convert_encoding($row_csv_header[$i], "UTF-8", "SJIS") != $val) { + if (mb_convert_encoding($row_csv_header[$i], "UTF-8", _CLIENT_OS_CHARSET) != $val) { $uploadsAction->delUploadsById($filelist[0]["upload_id"]); + fclose($handle); return RESERVATION_ERR_FILE_FORMAT; } } @@ -72,9 +75,8 @@ function validate($attributes, $errStr, $params) $import = array(); $duplication_time = array(); while (($data = $csvMain->fgets($handle)) !== FALSE) { - //SJISからUTF-8に変換 for ($c=0; $caddError(); + fclose($handle); return false; } } + fclose($handle); //エラーがあれば出力する if (!empty($error)) { diff --git a/html/webapp/modules/room/action/admin/chgdisplay/Chgdisplay.class.php b/html/webapp/modules/room/action/admin/chgdisplay/Chgdisplay.class.php index 847a6c9..4e7ec24 100644 --- a/html/webapp/modules/room/action/admin/chgdisplay/Chgdisplay.class.php +++ b/html/webapp/modules/room/action/admin/chgdisplay/Chgdisplay.class.php @@ -53,10 +53,15 @@ function execute() // --- 準備中->公開中に変更した場合、そのサブグループも公開中にする // ---------------------------------------------------------------------- if($this->page['display_flag'] != $display_flag) { - $where_params = array ( - "room_id"=>intval($this->edit_current_page_id) - ); - $subgroup_pages_id_arr =& $this->pagesView->getPages($where_params, null, null, null, array($this, "_subpagesFetchcallback")); + $rooms_where_params = array( + "room_id = ".intval($this->edit_current_page_id)." OR parent_id = ".intval($this->edit_current_page_id) => null + ); + $rooms_id_arr =& $this->pagesView->getPages($rooms_where_params, null, null, null, array($this, "_roomsFetchcallback")); + $pages_where_params = array( + " room_id IN (". implode(",", $rooms_id_arr). ") " => null + ); + $subgroup_pages_id_arr =& $this->pagesView->getPages($pages_where_params, null, null, null, array($this, "_subpagesFetchcallback")); + if(count($subgroup_pages_id_arr) > 0) { $params = array( "display_flag" => $display_flag @@ -71,7 +76,22 @@ function execute() } } } - + + // add by mutaguchi@opensource-workshop.jp + /** + * fetch時コールバックメソッド + * @param result adodb object + * @return array items + * @access private + */ + function &_roomsFetchcallback($result) { + $ret = array(); + while ($row = $result->fetchRow()) { + $ret[$row['room_id']] = $row['room_id']; + } + return $ret; + } + /** * fetch時コールバックメソッド * @param result adodb object diff --git a/html/webapp/modules/room/action/admin/selmodules/Selmodules.class.php b/html/webapp/modules/room/action/admin/selmodules/Selmodules.class.php index 95f6152..769d9d0 100644 --- a/html/webapp/modules/room/action/admin/selmodules/Selmodules.class.php +++ b/html/webapp/modules/room/action/admin/selmodules/Selmodules.class.php @@ -76,30 +76,31 @@ function execute() $isError = true; } - $sql = "SELECT B.block_id, " - . "B.page_id " - . "FROM {blocks} B " - . "INNER JOIN {pages} P " - . "ON B.page_id = P.page_id " - . "WHERE P.room_id = ? " - . "AND B.module_id IN ('" . implode("','", $unusableModuleIds) . "')"; - $blocks =& $this->db->execute($sql, $roomId); - if ($blocks === false) { - $this->db->addError(); - } + if(count($unusableModuleIds) > 0) { + $sql = "SELECT B.block_id, " + . "B.page_id " + . "FROM {blocks} B " + . "INNER JOIN {pages} P " + . "ON B.page_id = P.page_id " + . "WHERE P.room_id = ? " + . "AND B.module_id IN ('" . implode("','", $unusableModuleIds) . "')"; + $blocks =& $this->db->execute($sql, $roomId); + if ($blocks === false) { + $this->db->addError(); + } - foreach($blocks as $block) { - $request = array( - 'block_id' => $block['block_id'], - 'page_id' => $block['page_id'] - ); - $result = $this->preexecuteMain->preExecute('pages_actionblock_deleteblock', $request); - if ($result === false - || $result === 'false') { - $isError = true; + foreach($blocks as $block) { + $request = array( + 'block_id' => $block['block_id'], + 'page_id' => $block['page_id'] + ); + $result = $this->preexecuteMain->preExecute('pages_actionblock_deleteblock', $request); + if ($result === false + || $result === 'false') { + $isError = true; + } } } - if($isError) { return 'error'; } diff --git a/html/webapp/modules/room/install.ini b/html/webapp/modules/room/install.ini old mode 100644 new mode 100755 index 1d9ca3d..39d426f --- a/html/webapp/modules/room/install.ini +++ b/html/webapp/modules/room/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.2" +version = "2.4.2.1" action_name="room_view_admin_init" module_icon="room.gif" system_flag=1 diff --git a/html/webapp/modules/room/view/admin/import/upload/Upload.class.php b/html/webapp/modules/room/view/admin/import/upload/Upload.class.php old mode 100644 new mode 100755 index 81d237f..4a776aa --- a/html/webapp/modules/room/view/admin/import/upload/Upload.class.php +++ b/html/webapp/modules/room/view/admin/import/upload/Upload.class.php @@ -112,24 +112,23 @@ function execute() // その後のファイルの内容を展開し // 1行ずつチェックしていく // 成功した行はセッション変数に覚えさせる - // エラーがあったら速攻リターン $chg_num = 0; $delete_num = 0; $line = -1; + $errorMessage = ''; while( ($row=$this->csvMain->fgets($handle)) != false ) { if($line>=ROOM_IMPORT_LINE_LIMIT) { - $errorList->add(get_class($this), sprintf(ROOM_IMPORT_UPLOAD_LINE_OVER_ERR."(%s)", ROOM_IMPORT_LINE_LIMIT, $filename)); - $this->cleanup($file); - return 'error'; + $errorMessage = sprintf(ROOM_IMPORT_UPLOAD_LINE_OVER_ERR."(%s)", ROOM_IMPORT_LINE_LIMIT, $filename); + break; } - // SJISで来るので文字コード変換 + // 文字コード変換 $row = $this->convertCsv($row); // CSVのカラム数チェック おかしな行が1行でもあれば処理を中断 if(count($row) != ROOM_IMPORT_ITEM_COLUMN) { - $errorList->add(get_class($this), sprintf(ROOM_IMPORT_UPLOAD_COLUMN_ERR."(%s)", $line+1, $filename)); - $this->cleanup($file); - return 'error'; + // FIXME おかしな行が1行でもあれば、1回目のループで条件に入ってくるため、どこがおかしいかがメッセージからわからない + $errorMessage = sprintf(ROOM_IMPORT_UPLOAD_COLUMN_ERR."(%s)", $line+1, $filename); + break; } $line++; @@ -139,9 +138,8 @@ function execute() else { // その人は会員情報に存在するのか? if(!isset($room_users[$row[0]])) { - $errorList->add(get_class($this), sprintf(ROOM_IMPORT_UPLOAD_NOUSER_ERR, $line+1, $row[0])); - $this->cleanup($file); - return 'error'; + $errorMessage = sprintf(ROOM_IMPORT_UPLOAD_NOUSER_ERR, $line+1, $row[0]); + break; } else { $target_user = $room_users[$row[0]]; @@ -186,15 +184,13 @@ function execute() else { // それは存在する権限IDか if(!isset($target_user['permitted_auth'][$row[1]])) { - $errorList->add(get_class($this), sprintf(ROOM_IMPORT_UPLOAD_NOAUTH_ERR, $line+1, $row[1])); - $this->cleanup($file); - return 'error'; + $errorMessage = sprintf(ROOM_IMPORT_UPLOAD_NOAUTH_ERR, $line+1, $row[1]); + break; } // このユーザーに許可された権限か if(!($target_user['permitted_auth'][$row[1]])) { - $errorList->add(get_class($this), sprintf(ROOM_IMPORT_UPLOAD_NOT_PERMIT_AUTH, $line+1, $row[0], $row[1])); - $this->cleanup($file); - return 'error'; + $errorMessage = sprintf(ROOM_IMPORT_UPLOAD_NOT_PERMIT_AUTH, $line+1, $row[0], $row[1]); + break; } // それは現在設定されている権限IDと一緒?それとも異なる? if($now_auth != $row[1]) { @@ -212,6 +208,12 @@ function execute() fclose($handle); $this->_delImportFile($file); + if ($errorMessage !== '') { + $errorList->add(get_class($this), $errorMessage); + $this->cleanup($file); + return 'error'; + } + // ファイルの中身が空エラー if($line<1) { $errorList->add(get_class($this), sprintf(ROOM_IMPORT_UPLOAD_NODATAS_ERR."(%s)", $filename)); @@ -258,7 +260,7 @@ function cleanup($file) { function convertCsv($row) { $ret = array(); foreach($row as $index=>$value) { - $ret[$index] = mb_convert_encoding($value, _CHARSET, 'SJIS'); + $ret[$index] = mb_convert_encoding($value, _CHARSET, _CLIENT_OS_CHARSET); } return $ret; } diff --git a/html/webapp/modules/room/view/admin/import/upload/maple.ini b/html/webapp/modules/room/view/admin/import/upload/maple.ini old mode 100644 new mode 100755 index e343b5a..a6c97d9 --- a/html/webapp/modules/room/view/admin/import/upload/maple.ini +++ b/html/webapp/modules/room/view/admin/import/upload/maple.ini @@ -20,5 +20,5 @@ roomView = "ref:roomView" [View] define:attachment = 1 +success = "main:true.html" error = "main:error.html" - diff --git a/html/webapp/modules/rss/components/Parse.class.php b/html/webapp/modules/rss/components/Parse.class.php old mode 100644 new mode 100755 index 2479dfd..8e3abc2 --- a/html/webapp/modules/rss/components/Parse.class.php +++ b/html/webapp/modules/rss/components/Parse.class.php @@ -55,7 +55,7 @@ function &parse($xml, $encoding) $unserializer->unserialize($xml); $xmlArray = $unserializer->getUnserializedData(); if (empty($xmlArray)) return $xmlArray; - if (strtolower(get_class($xmlArray)) == "pear_error") { + if (gettype($xmlArray) === 'object' && strtolower(get_class($xmlArray)) == "pear_error") { $container =& DIContainerFactory::getContainer(); $actionChain =& $container->getComponent("ActionChain"); $errorList =& $actionChain->getCurErrorList(); @@ -76,7 +76,6 @@ function &parse($xml, $encoding) "link" => !empty($xmlArray["link"]["href"]) ? $xmlArray["link"]["href"] : (!empty($xmlArray["link"][0]["href"]) ? $xmlArray["link"][0]["href"] : ""), "lastbuilddate" => !empty($xmlArray["updated"]) ? $xmlArray["updated"] : $xmlArray["modified"], "id" => !empty($xmlArray["id"]) ? $xmlArray["id"] : "", - "webmaster" => $xmlArray["author"]["name"], "generator" => !empty($xmlArray["generator"]) ? $xmlArray["generator"] : "", ); if (isset($xmlArray["entry"]["title"])) { diff --git a/html/webapp/modules/rss/install.ini b/html/webapp/modules/rss/install.ini old mode 100644 new mode 100755 index 421cdba..6ab8178 --- a/html/webapp/modules/rss/install.ini +++ b/html/webapp/modules/rss/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.1" +version = "2.4.0.2" action_name = "rss_view_main_init" edit_action_name = "rss_view_edit_init" block_delete_action = "auto" diff --git a/html/webapp/modules/system/action/development/maple.ini b/html/webapp/modules/system/action/development/maple.ini old mode 100644 new mode 100755 index cca3f8a..95e0944 --- a/html/webapp/modules/system/action/development/maple.ini +++ b/html/webapp/modules/system/action/development/maple.ini @@ -6,4 +6,4 @@ action="system_view_main_development" session = "ref:Session" [View] -success = "system_view_main_development.html" \ No newline at end of file +success = "main:true.html" \ No newline at end of file diff --git a/html/webapp/modules/system/action/general/maple.ini b/html/webapp/modules/system/action/general/maple.ini old mode 100644 new mode 100755 index a405650..4c57027 --- a/html/webapp/modules/system/action/general/maple.ini +++ b/html/webapp/modules/system/action/general/maple.ini @@ -25,4 +25,4 @@ add_private_space_name.EscapeText = closesite_text.EscapeText = [View] -success = "system_view_main_general.html" \ No newline at end of file +success = "main:true.html" \ No newline at end of file diff --git a/html/webapp/modules/system/action/mail/maple.ini b/html/webapp/modules/system/action/mail/maple.ini old mode 100644 new mode 100755 index b546f81..85f3852 --- a/html/webapp/modules/system/action/mail/maple.ini +++ b/html/webapp/modules/system/action/mail/maple.ini @@ -14,4 +14,4 @@ mode="check" action="system_view_main_mail" [View] -success = "system_view_main_mail.html" \ No newline at end of file +success = "main:true.html" \ No newline at end of file diff --git a/html/webapp/modules/system/action/membership/maple.ini b/html/webapp/modules/system/action/membership/maple.ini old mode 100644 new mode 100755 index 7315a4d..a8529f3 --- a/html/webapp/modules/system/action/membership/maple.ini +++ b/html/webapp/modules/system/action/membership/maple.ini @@ -14,4 +14,4 @@ action="system_view_main_membership" systemView = "ref:systemView" [View] -success = "system_view_main_membership.html" \ No newline at end of file +success = "main:true.html" \ No newline at end of file diff --git a/html/webapp/modules/system/action/meta/maple.ini b/html/webapp/modules/system/action/meta/maple.ini old mode 100644 new mode 100755 index 7f4547f..9ff371b --- a/html/webapp/modules/system/action/meta/maple.ini +++ b/html/webapp/modules/system/action/meta/maple.ini @@ -14,4 +14,4 @@ mode="check" action="system_view_main_meta" [View] -success = "system_view_main_meta.html" \ No newline at end of file +success = "main:true.html" \ No newline at end of file diff --git a/html/webapp/modules/system/action/pagestyle/maple.ini b/html/webapp/modules/system/action/pagestyle/maple.ini old mode 100644 new mode 100755 index 7301b0a..4cf63f8 --- a/html/webapp/modules/system/action/pagestyle/maple.ini +++ b/html/webapp/modules/system/action/pagestyle/maple.ini @@ -13,4 +13,4 @@ mode="check" action="system_view_main_pagestyle" [View] -success = "system_view_main_pagestyle.html" \ No newline at end of file +success = "main:true.html" \ No newline at end of file diff --git a/html/webapp/modules/system/action/server/maple.ini b/html/webapp/modules/system/action/server/maple.ini old mode 100644 new mode 100755 index cdc8581..5b9717f --- a/html/webapp/modules/system/action/server/maple.ini +++ b/html/webapp/modules/system/action/server/maple.ini @@ -29,4 +29,4 @@ mode="check" action="system_view_main_server" [View] -success = "system_view_main_server.html" \ No newline at end of file +success = "main:true.html" \ No newline at end of file diff --git a/html/webapp/modules/system/install.ini b/html/webapp/modules/system/install.ini old mode 100644 new mode 100755 index 17eb963..43fcb8b --- a/html/webapp/modules/system/install.ini +++ b/html/webapp/modules/system/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.1" +version = "2.4.0.2" action_name="system_view_main_general" system_flag=1 module_icon=system.gif diff --git a/html/webapp/modules/system/templates/default/system_view_main_development.html b/html/webapp/modules/system/templates/default/system_view_main_development.html index 3546e0e..8ef364a 100644 --- a/html/webapp/modules/system/templates/default/system_view_main_development.html +++ b/html/webapp/modules/system/templates/default/system_view_main_development.html @@ -3,9 +3,9 @@
<{$lang.system_debug_title|smarty:nodefaults}>
- <{if !$smarty.session._use_db_debug.conf_value}> checked="checked"<{/if}> /> + <{if !$smarty.session._use_db_debug}> checked="checked"<{/if}> /> - <{if $smarty.session._use_db_debug.conf_value}> checked="checked"<{/if}> /> + <{if $smarty.session._use_db_debug}> checked="checked"<{/if}> />

diff --git a/html/webapp/modules/system/templates/default/system_view_main_meta.html b/html/webapp/modules/system/templates/default/system_view_main_meta.html old mode 100644 new mode 100755 index 5db812e..86cca45 --- a/html/webapp/modules/system/templates/default/system_view_main_meta.html +++ b/html/webapp/modules/system/templates/default/system_view_main_meta.html @@ -16,17 +16,17 @@ - + - -
<{$lang.system_meta_keywords_note|smarty:nodefaults}>
+ +
<{$lang.system_meta_description_note|smarty:nodefaults}>
- + - -
<{$lang.system_meta_description_note|smarty:nodefaults}>
+ +
<{$lang.system_meta_keywords_note|smarty:nodefaults}>
diff --git a/html/webapp/modules/todo/action/dicon.ini b/html/webapp/modules/todo/action/dicon.ini index a22cc43..d94360c 100644 --- a/html/webapp/modules/todo/action/dicon.ini +++ b/html/webapp/modules/todo/action/dicon.ini @@ -1,3 +1,4 @@ [DIContainer] todoAction = "modules://todo.components.action" -todoView = "modules://todo.components.view" \ No newline at end of file +todoView = "modules://todo.components.view" +calendarPlanAction = "calendar.action" diff --git a/html/webapp/modules/todo/action/edit/delete/Delete.class.php b/html/webapp/modules/todo/action/edit/delete/Delete.class.php index bf49ca8..d2d0144 100644 --- a/html/webapp/modules/todo/action/edit/delete/Delete.class.php +++ b/html/webapp/modules/todo/action/edit/delete/Delete.class.php @@ -19,6 +19,7 @@ class Todo_Action_Edit_Delete extends Action // 使用コンポーネントを受け取るため var $todoAction = null; var $db = null; + var $calendarPlanAction = null; /** * Todo削除アクション @@ -27,6 +28,19 @@ class Todo_Action_Edit_Delete extends Action */ function execute() { + $whereParams = array( + "todo_id" => $this->todo_id, + "calendar_id!=0" => null + ); + $tasks = $this->db->selectExecute('todo_task', $whereParams); + if(!empty($tasks)) { + foreach($tasks as $task) { + if (!$this->calendarPlanAction->deletePlan($task["calendar_id"], CALENDAR_PLAN_EDIT_THIS)) { + return false; + } + } + } + $whereParams = array( "todo_id" => $this->todo_id ); diff --git a/html/webapp/modules/todo/action/edit/delete/maple.ini b/html/webapp/modules/todo/action/edit/delete/maple.ini index ba8de50..6bf5c35 100644 --- a/html/webapp/modules/todo/action/edit/delete/maple.ini +++ b/html/webapp/modules/todo/action/edit/delete/maple.ini @@ -6,6 +6,7 @@ key:room_id,block_id,todo_id.todo.todoExists = "1:lang._invalid_input" [Action] db = "ref:DbObject" +calendarPlanAction = "ref:calendarPlanAction" [View] success = "action:todo_view_edit_list" \ No newline at end of file diff --git a/html/webapp/modules/todo/components/View.class.php b/html/webapp/modules/todo/components/View.class.php index 97c12af..83b7c3c 100644 --- a/html/webapp/modules/todo/components/View.class.php +++ b/html/webapp/modules/todo/components/View.class.php @@ -271,7 +271,7 @@ function &getTodos() $sql = "SELECT todo_id, todo_name, insert_time, insert_user_id, insert_user_name ". "FROM {todo} ". "WHERE room_id = ? ". - $this->_db->getOrderSQL($orderParams); + $this->_db->getOrderSQL($orderParams, array('todo_id', 'todo_name', 'insert_user_name', 'insert_time')); $todos = $this->_db->execute($sql, $params); if ($todos === false) { $this->_db->addError(); @@ -508,7 +508,10 @@ function &getTasks() $sortColumn = "task_value"; } } - if (empty($sortDirection)) { + if (!in_array($sortColumn, array('task_sequence', 'priority', 'state', 'period', 'progress', 'task_value'))) { + $sortColumn = "task_sequence"; + } + if (empty($sortDirection) || $sortDirection != 'DESC') { $sortDirection = "ASC"; } $orderParams[$sortColumn] = $sortDirection; diff --git a/html/webapp/modules/todo/install.ini b/html/webapp/modules/todo/install.ini old mode 100644 new mode 100755 index 9ff33b3..4508b02 --- a/html/webapp/modules/todo/install.ini +++ b/html/webapp/modules/todo/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.1" +version = "2.4.0.2" action_name = "todo_view_main_init" edit_action_name = "todo_view_edit_list" block_add_action = "todo_view_edit_entry" diff --git a/html/webapp/modules/user/action/admin/seldelete/Seldelete.class.php b/html/webapp/modules/user/action/admin/seldelete/Seldelete.class.php index 730d879..440dd47 100644 --- a/html/webapp/modules/user/action/admin/seldelete/Seldelete.class.php +++ b/html/webapp/modules/user/action/admin/seldelete/Seldelete.class.php @@ -83,7 +83,9 @@ function execute() continue; } } - + if (!empty($this->select_user) && isset($this->delete_users[$user_id]) && $this->delete_users[$user_id] == _OFF) { + continue; + } if (!empty($this->delete_users[$user_id]) || !empty($this->select_user)) { $targetUsers[] = $user_id; diff --git a/html/webapp/modules/user/action/main/searchresult/Searchresult.class.php b/html/webapp/modules/user/action/main/searchresult/Searchresult.class.php old mode 100644 new mode 100755 index 2a4a2fa..5caa915 --- a/html/webapp/modules/user/action/main/searchresult/Searchresult.class.php +++ b/html/webapp/modules/user/action/main/searchresult/Searchresult.class.php @@ -51,6 +51,14 @@ function execute() //初期化 $this->sort_col = ($this->sort_col == null) ? $this->sort_col ="user_authority_id" : $this->sort_col; $this->sort_dir = ($this->sort_dir == null) ? $this->sort_dir ="DESC" : $this->sort_dir; + if (!in_array($this->sort_col, array( + 'handle', 'login_id', 'user_name', 'user_authority_id', 'active_flag', 'insert_time', 'last_login_time') + )) { + $this->sort_col = "user_authority_id"; + } + if ((empty($this->sort_dir) || ($this->sort_dir != 'ASC' && $this->sort_dir != 'asc'))) { + $this->sort_dir = "DESC"; + } $this->user_id = $this->session->getParameter("_user_id"); //$module_link_where_params = array( // "role_authority_id" => $this->session->getParameter("_role_auth_id"), diff --git a/html/webapp/modules/user/components/Csvmain.class.php b/html/webapp/modules/user/components/Csvmain.class.php index 1d5dee0..b659066 100644 --- a/html/webapp/modules/user/components/Csvmain.class.php +++ b/html/webapp/modules/user/components/Csvmain.class.php @@ -25,7 +25,7 @@ class User_Components_Csvmain extends Csv_Main */ function User_Components_Csvmain() { $this->_LE = "\n"; - $this->charSet = "SJIS"; + $this->charSet = _CLIENT_OS_CHARSET; $this->mimeType = "document/unknown"; $this->division = ","; $this->extension = ".csv"; diff --git a/html/webapp/modules/user/install.ini b/html/webapp/modules/user/install.ini old mode 100644 new mode 100755 index 674a5cf..d53c581 --- a/html/webapp/modules/user/install.ini +++ b/html/webapp/modules/user/install.ini @@ -1,4 +1,4 @@ -version = "2.4.0.2" +version = "2.4.2.1" action_name="user_view_main_search" system_flag=1 module_icon="user.gif" diff --git a/html/webapp/modules/user/validator/Validator_ItemsInputs.class.php b/html/webapp/modules/user/validator/Validator_ItemsInputs.class.php index 0d31c3e..dd70479 100644 --- a/html/webapp/modules/user/validator/Validator_ItemsInputs.class.php +++ b/html/webapp/modules/user/validator/Validator_ItemsInputs.class.php @@ -36,6 +36,7 @@ function validate($attributes, $errStr, $params) $container =& DIContainerFactory::getContainer(); $session =& $container->getComponent("Session"); $usersView =& $container->getComponent("usersView"); + $authoritiesView =& $container->getComponent("authoritiesView"); $_system_user_id = $session->getParameter("_system_user_id"); if(!isset($attributes['user_id'])) $attributes['user_id'] = "0"; @@ -131,6 +132,19 @@ function validate($attributes, $errStr, $params) //システム管理者の場合、変更不可 if($attributes['user_id'] == $_system_user_id && $content != _SYSTEM_ROLE_AUTH_ID) { return $err_prefix._INVALID_INPUT; + } else if ($content == _SYSTEM_ROLE_AUTH_ID && $session->getParameter("_user_auth_id") != _AUTH_ADMIN) { + // システム管理者へ権限を変更できるのは、管理者だけ + return $err_prefix._INVALID_INPUT; + } + $_user_auth_id = $session->getParameter("_user_auth_id"); + $_role_auth_id = $session->getParameter("_role_auth_id"); + $authority = $authoritiesView->getAuthorityByID($content); + if ($_user_auth_id == _AUTH_CHIEF && $authority["user_authority_id"] >= _AUTH_CHIEF) { + // 事務局が、主担、事務局以上 + return $err_prefix._INVALID_INPUT; + } else if ($_user_auth_id == _AUTH_ADMIN && $_role_auth_id != _ROLE_AUTH_ADMIN && $authority["role_authority_id"] == _ROLE_AUTH_ADMIN) { + // 管理者がシステム管理者へ + return $err_prefix._INVALID_INPUT; } } if($items['type'] == "email" || $items['type'] == "mobile_email") { diff --git a/html/webapp/modules/user/view/admin/import/download/Download.class.php b/html/webapp/modules/user/view/admin/import/download/Download.class.php old mode 100644 new mode 100755 index bf2fd0a..ce4eb6b --- a/html/webapp/modules/user/view/admin/import/download/Download.class.php +++ b/html/webapp/modules/user/view/admin/import/download/Download.class.php @@ -35,8 +35,8 @@ function execute() } else { return 'error'; } - - return 'success'; + + exit; } } ?> \ No newline at end of file diff --git a/html/webapp/modules/user/view/admin/import/export/Export.class.php b/html/webapp/modules/user/view/admin/import/export/Export.class.php old mode 100644 new mode 100755 index cbc22a9..2cde912 --- a/html/webapp/modules/user/view/admin/import/export/Export.class.php +++ b/html/webapp/modules/user/view/admin/import/export/Export.class.php @@ -41,6 +41,14 @@ function execute() /* データ */ $this->sort_col = ($this->sort_col == null) ? $this->sort_col ="user_authority_id" : $this->sort_col; $this->sort_dir = ($this->sort_dir == null) ? $this->sort_dir ="DESC" : $this->sort_dir; + if (!in_array($this->sort_col, array( + 'handle', 'login_id', 'user_name', 'user_authority_id', 'active_flag', 'insert_time', 'last_login_time') + )) { + $this->sort_col = "user_authority_id"; + } + if ((empty($this->sort_dir) || ($this->sort_dir != 'ASC' && $this->sort_dir != 'asc'))) { + $this->sort_dir = "DESC"; + } $order_params = array( $this->sort_col => $this->sort_dir, "{users}.system_flag" => "DESC", diff --git a/html/webapp/modules/user/view/admin/import/upload/Upload.class.php b/html/webapp/modules/user/view/admin/import/upload/Upload.class.php index 6b8bee9..bc8c0cb 100644 --- a/html/webapp/modules/user/view/admin/import/upload/Upload.class.php +++ b/html/webapp/modules/user/view/admin/import/upload/Upload.class.php @@ -79,17 +79,17 @@ function execute() } if (!isset($showitems) || !is_array($showitems)) { $errorList->add(get_class($this), sprintf("show items error")); - $this->_delImportFile($file); + $this->_delImportFile($file, $handle); return 'error'; } // データ取得 // ヘッダチェック $row_data_headers = fgets($handle); - $row_data_headers = mb_convert_encoding($row_data_headers, "UTF-8", "SJIS"); + $row_data_headers = mb_convert_encoding($row_data_headers, "UTF-8", _CLIENT_OS_CHARSET); if (empty($row_data_headers)) { $errorList->add(get_class($this), sprintf(USER_IMPORT_UPLOAD_NODATA."(%s)", $filelist[0]['file_name'])); - $this->_delImportFile($file); + $this->_delImportFile($file, $handle); return 'error'; } $row_data_headers = explode(",", $row_data_headers); @@ -161,7 +161,7 @@ function execute() $items = null; $items_public = null; $items_reception = null; $row_data_user_str = fgets($handle); if (empty($row_data_user_str)) continue; - $row_data_user_str = mb_convert_encoding($row_data_user_str, "UTF-8", "SJIS"); + $row_data_user_str = mb_convert_encoding($row_data_user_str, "UTF-8", _CLIENT_OS_CHARSET); $row_data_user_str_len = strlen($row_data_user_str); $row_data_user = null; $row_data_user_str_idx = 0; @@ -183,7 +183,7 @@ function execute() while (!feof($handle) && empty($row_data_user_str)) { $row_data_user_str = fgets($handle); } - $row_data_user_str = mb_convert_encoding($row_data_user_str, "UTF-8", "SJIS"); + $row_data_user_str = mb_convert_encoding($row_data_user_str, "UTF-8", _CLIENT_OS_CHARSET); $row_data_user_str_len = strlen($row_data_user_str); $row_data_user_str_idx = 0; } else { @@ -703,8 +703,18 @@ function dataCheck_infile_mail() return $errlist; } - function _delImportFile($file_path) { + /** + * インポートファイルの削除 + * @param string $file_path + * @param resource $handle ファイルハンドラ + * @return void + * @access private + */ + function _delImportFile($file_path, $handle = null) { if(file_exists($file_path)) { + if (!is_null($handle)) { + fclose($handle); + } @chmod($file_path, 0777); unlink($file_path); } diff --git a/html/webapp/templates/main/mobile_redirect.html b/html/webapp/templates/main/mobile_redirect.html old mode 100644 new mode 100755 index 8824282..69e6ce4 --- a/html/webapp/templates/main/mobile_redirect.html +++ b/html/webapp/templates/main/mobile_redirect.html @@ -23,14 +23,12 @@
-<{if (!empty($lang_ifnotreload|smarty:nodefaults)) }> - <{$lang_ifnotreload|smarty:nodefaults}> -<{elseif (!empty($action.redirect_url|smarty:nodefaults)) }> - <{$smarty.const._IFNOTRELOAD|sprintf:$action.redirect_url|smarty:nodefaults}> -<{else}> - <{assign var="redirect_url" value=$smarty.const.BASE_URL|cat:$smarty.const.INDEX_FILE_NAME|smarty:nodefaults}> - <{$smarty.const._IFNOTRELOAD|sprintf:$redirect_url|smarty:nodefaults}> +<{if isset($action.redirect_url|smarty:nodefaults)}> + <{assign var="redirect_url" value=$action.redirect_url|smarty:nodefaults}> +<{elseif empty($redirect_url|smarty:nodefaults)}> + <{assign var="redirect_url" value=$smarty.const.BASE_URL|cat:$smarty.const.INDEX_FILE_NAME}> <{/if}> +<{$smarty.const._IFNOTRELOAD|smarty:nodefaults|sprintf:$redirect_url}>
diff --git a/html/webapp/templates/main/mobile_smart.html b/html/webapp/templates/main/mobile_smart.html index 4329aed..f1ef9ec 100644 --- a/html/webapp/templates/main/mobile_smart.html +++ b/html/webapp/templates/main/mobile_smart.html @@ -7,6 +7,11 @@ <{$smarty.const.INDEX_FILE_NAME}>?action=common_download_css&dir_name=/comp/extension/jquery.mobile-1.0.1.min.css&header=0&vs=<{$smarty.const._CSS_VERSION}>" /> <{$smarty.const.INDEX_FILE_NAME}>?action=common_download_css&dir_name=/comp/extension/jquery.mobile_addition.css&header=0&vs=<{$smarty.const._CSS_VERSION}>" /> + diff --git a/html/webapp/templates/main/redirect.html b/html/webapp/templates/main/redirect.html old mode 100644 new mode 100755 index 0869964..79650e8 --- a/html/webapp/templates/main/redirect.html +++ b/html/webapp/templates/main/redirect.html @@ -2,8 +2,22 @@ +<{if isset($action.redirect_url|smarty:nodefaults)}> + <{assign var="redirect_url" value=$action.redirect_url|smarty:nodefaults}> +<{elseif empty($redirect_url|smarty:nodefaults)}> + <{assign var="redirect_url" value=$smarty.const.BASE_URL|cat:$smarty.const.INDEX_FILE_NAME}> +<{/if}> -<{else}><{$url|replace:"&":"&"}><{/if}>" /> + <{$header_field.sitename}> <{$smarty.const.INDEX_FILE_NAME}>?<{$smarty.const.ACTION_KEY}>=common_download_css" /> <{$header_field.script_header|smarty:nodefaults}> @@ -26,22 +40,14 @@   - <{if isset($lang_ifnotreload|smarty:nodefaults)}> - <{$lang_ifnotreload|smarty:nodefaults}> - <{elseif isset($action.redirect_url|smarty:nodefaults)}> - <{assign var="redirect_url" value=$action.redirect_url|smarty:nodefaults}> - <{$smarty.const._IFNOTRELOAD|smarty:nodefaults|sprintf:$redirect_url}> - <{else}> - <{assign var="redirect_url" value=$smarty.const.BASE_URL|cat:$smarty.const.INDEX_FILE_NAME}> - <{$smarty.const._IFNOTRELOAD|smarty:nodefaults|sprintf:$redirect_url}> - <{/if}> + <{$smarty.const._IFNOTRELOAD|smarty:nodefaults|sprintf:$redirect_url}> setTimeout( function(){ - var location_str = '<{if isset($redirect_url|smarty:nodefaults)}><{$redirect_url}><{else}><{$url}><{/if}>'; + var location_str = '<{$redirect_url|smarty:nodefaults|escape:"javascript"}>'; <{if $smarty.post.action == "login_action_main_init"}> top.location.href=location_str.replace(/&/ig,"&"); <{else}>