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/filter/Filter_SetConfig.class.php b/html/maple/filter/Filter_SetConfig.class.php index 637e1bc..eb017b0 100644 --- a/html/maple/filter/Filter_SetConfig.class.php +++ b/html/maple/filter/Filter_SetConfig.class.php @@ -243,7 +243,7 @@ function _prefilter() } // 言語セット - $_lang = $this->_request->getParameter('lang'); + $_lang = trim($this->_request->getParameter('lang')); if(!empty($_lang)) { $languages = $this->_languagesView->getLanguages(array("lang_dirname"=>$_lang)); if (!isset($languages[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 ac84a6d..8258c9e 100644 --- a/html/maple/nccore/db/DbObjectAdodb.class.php +++ b/html/maple/nccore/db/DbObjectAdodb.class.php @@ -55,7 +55,7 @@ class DbObjectAdodb /** * DSNをセットする - *  + * * @param string $dsn DSN $driver://$username:$password@hostname/$database * @access public */ @@ -65,7 +65,7 @@ function setDsn($dsn) { /** * DSNをゲットする - *  + * * @return string $dsn DSN $driver://$username:$password@hostname/$database * @access public */ @@ -75,7 +75,7 @@ function getDsn() { /** * Prefixをセットする - *  + * * @param string $prefix * @access public */ @@ -85,7 +85,7 @@ function setPrefix($prefix) { /** * Prefixをゲットする - *  + * * @return string $prefix * @access public */ @@ -106,7 +106,7 @@ function setOption($key, $value) { /** * 接続時のoptionをゲットする - *  + * * @return array $option * @access public */ @@ -130,7 +130,7 @@ function setDebugMode($debugMode=true) { /** * デバッグモードをゲットする - *  + * * @return bool $debugMode デバッグモードをセットする * @access public */ @@ -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); + } } } @@ -236,7 +240,7 @@ function setSql($sql) { /** * デバッグモードをゲットする - *  + * * @return string $sql 実行するSQL文 * @access public */ @@ -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) : ""); @@ -620,7 +637,7 @@ function &selectExecute($tableName, $where_params=null, $order_params=null, $lim /** * テーブルInsert - *  + * * @param string $tableName 対象テーブル名称 * @param array $params キー名称配列、パラメータ配列 * @param boolean true or false insert_time-update_user_nameを自動的に付与する @@ -647,7 +664,7 @@ function insertExecute($tableName, $params=array(), $footer_flag=false, $create_ /** * テーブルUpdate - *  + * * @param string $tableName 対象テーブル名称 * @param array $params キー名称配列、更新カラム配列 * @param array $where_params キー名称配列、whereデータ配列 @@ -667,7 +684,7 @@ function updateExecute($tableName, $params=array(), $where_params=array(), $foot /** * テーブルDelete - *  + * * @param string $tableName 対象テーブル名称 * @param array $where_params キー名称配列、whereデータ配列 * @return boolean true or false @@ -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 if (defined('_INVALID_INPUT')) { + $errorList->add($this->ErrorNo(), _INVALID_INPUT); } else { - $errorList->add($this->ErrorNo(), "SQL Error!"); + $errorList->add($this->ErrorNo(), "Security Error! Unauthorized input."); } } else { $errorList->add($error_no, $error_mes); @@ -909,7 +928,7 @@ function addError($error_no=null, $error_mes=null) /** * MATCH AGAINST用の文字列に変換する - *  + * * @return bool $debugMode デバッグモードをセットする * @access public */ 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 b58970e..d974e04 --- a/html/webapp/components/uploads/View.class.php +++ b/html/webapp/components/uploads/View.class.php @@ -337,9 +337,9 @@ function _headerOutput($filename, $pathname, $filesize, $mimetype, $cache_flag = if (!isset($_SERVER['HTTP_USER_AGENT'])) { //HTTP_USER_AGENTがない場合、 header("Content-disposition: inline; filename=\"".$filename."\""); - } elseif (stristr($_SERVER['HTTP_USER_AGENT'], "MSIE")) { + } 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 cbe70f3..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,25 @@ 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) { + s = "rv:"; + i = ua.indexOf(s); + this.isIE = true; + this.version = parseFloat(ua.substr(i + s.length)); + return; + } + s = "Netscape"; if ((i = ua.indexOf(s)) >= 0) { this.isGecko = true; 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/comp_textarea.js b/html/webapp/modules/comp/files/js/comp_textarea.js index 308dd99..a387f97 100644 --- a/html/webapp/modules/comp/files/js/comp_textarea.js +++ b/html/webapp/modules/comp/files/js/comp_textarea.js @@ -96,7 +96,9 @@ compTextarea.prototype = { // addFocusの別名 focusEditor : function(now, callback) { - this.textarea.addFocus(now, callback); + if (this.textarea != null || this.textarea != undefined) { + this.textarea.addFocus(now, callback); + } }, setOptions : function() { 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 60d4a3e..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 @@ -163,7 +163,8 @@ function execute() $handles = explode(" ", trim(preg_replace("/[ \s]+/u", " ", $this->handle))); if(is_array($handles)) { foreach (array_keys($handles) as $i) { - $handlesql[] = " {multidatabase_content}.insert_user_name LIKE '%".$handles[$i]."%' "; + $handlesql[] = " {multidatabase_content}.insert_user_name LIKE ? "; + $keywordBindValues[] = '%' . $handles[$i] . '%'; } } $sqlwhere .= " AND (".join(" OR ", $handlesql).")"; @@ -171,7 +172,7 @@ function execute() if($this->status != "") { if($this->status != MULTIDATABASE_STATUS_ALL) { - $sqlwhere .= " AND {multidatabase_content}.agree_flag=".$this->status." "; + $sqlwhere .= " AND {multidatabase_content}.agree_flag=".intval($this->status)." "; } } @@ -182,16 +183,14 @@ 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; } } - if(empty($this->sort_metadata) || $this->sort_metadata == MULTIDATABASE_DEFAULT_SEQUENCE_SORT) { - $order_params = array( - "{multidatabase_content}.display_sequence" => "ASC", - "{multidatabase_content}.insert_time" => "DESC" - ); - }else if($this->sort_metadata == MULTIDATABASE_DEFAULT_DATE_SORT) { + if($this->sort_metadata == MULTIDATABASE_DEFAULT_DATE_SORT) { $order_params = array( "{multidatabase_content}.insert_time" => "DESC" ); @@ -217,11 +216,16 @@ function execute() $order_params = array( "{multidatabase_content}.update_time" => "ASC" ); - }else { + }elseif (isset($this->sort_metadatas[$this->sort_metadata])) { $order_params = array( "m_content".$this->sort_metadata.".content" => "ASC", "{multidatabase_content}.insert_time" => "DESC" ); + }else { + $order_params = array( + "{multidatabase_content}.display_sequence" => "ASC", + "{multidatabase_content}.insert_time" => "DESC" + ); } $this->result_count = $this->mdbView->getMDBListCount($this->multidatabase_id, 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/language/chinese/main.ini b/html/webapp/modules/pm/language/chinese/main.ini index 227b6bc..26525bf 100644 --- a/html/webapp/modules/pm/language/chinese/main.ini +++ b/html/webapp/modules/pm/language/chinese/main.ini @@ -168,10 +168,6 @@ pm_body = PM_MESSAGE_BODY pm_message_address_no_exist = "这个收件人地址不存在。" pm_message_required = "必须输入" define:PM_MAIL_SUBJECT = "[{X-SITE_NAME}]短消息的通知" -; define:PM_MAIL_BODY = "Researchmapの上で、あなたへのプライベートメッセージが届きました。\n\n件名:{X-TITLE}\n差出人:{X-USER}\n差出日時;; -; :{X-INPUT_TIME}\n\n{X-BODY}\n\nこのプライベートメッセージを確認するには、下記アドレスへ\n{X-URL}" -;define:PM_MAIL_BODY = "あなたへのプライベートメッセージが届きましたので、お知らせします。\n\n件名:{X-TITLE}\n差出人:{X-USER}\n差出日時 -;:{X-INPUT_TIME}\n\n{X-BODY}\n\nこのプライベートメッセージを見るには、下記アドレスへ\n{X-URL}" define:PM_MAIL_BODY = "您有新的短消息。\n\n主题:{X-TITLE}\n发件人:{X-USER}\n发送日期:{X-INPUT_TIME}\n\n{X-BODY}\n\n浏览详细信息,请点击下面的链接\n{X-URL}" define:PM_SUBJECT_FORMAT = "Fw%s: %s" diff --git a/html/webapp/modules/pm/language/english/main.ini b/html/webapp/modules/pm/language/english/main.ini index f946e38..4d72ffc 100644 --- a/html/webapp/modules/pm/language/english/main.ini +++ b/html/webapp/modules/pm/language/english/main.ini @@ -168,10 +168,6 @@ pm_body = PM_MESSAGE_BODY pm_message_address_no_exist = "This address does not exist." pm_message_required = "is required" define:PM_MAIL_SUBJECT = "[{X-SITE_NAME}]Private message notifications" -; define:PM_MAIL_BODY = "Researchmapの上で、あなたへのプライベートメッセージが届きました。\n\n件名:{X-TITLE}\n差出人:{X-USER}\n差出日時;; -; :{X-INPUT_TIME}\n\n{X-BODY}\n\nこのプライベートメッセージを確認するには、下記アドレスへ\n{X-URL}" -;define:PM_MAIL_BODY = "あなたへのプライベートメッセージが届きましたので、お知らせします。\n\n件名:{X-TITLE}\n差出人:{X-USER}\n差出日時 -;:{X-INPUT_TIME}\n\n{X-BODY}\n\nこのプライベートメッセージを見るには、下記アドレスへ\n{X-URL}" define:PM_MAIL_BODY = "You have a new private message\n\n:Subject{X-TITLE}\nFrom:{X-USER}\nDate:{X-INPUT_TIME}\n\n{X-BODY}\n\nTo verify this private message, please click the following url\n{X-URL}" define:PM_SUBJECT_FORMAT = "Fw%s: %s" diff --git a/html/webapp/modules/pm/language/japanese/main.ini b/html/webapp/modules/pm/language/japanese/main.ini index 04a4edf..f574507 100644 --- a/html/webapp/modules/pm/language/japanese/main.ini +++ b/html/webapp/modules/pm/language/japanese/main.ini @@ -168,10 +168,6 @@ pm_body = PM_MESSAGE_BODY pm_message_address_no_exist = "この宛先は存在しません。" pm_message_required = "を入力してください" define:PM_MAIL_SUBJECT = "[{X-SITE_NAME}]プライベートメッセージの通知" -; define:PM_MAIL_BODY = "Researchmapの上で、あなたへのプライベートメッセージが届きました。\n\n件名:{X-TITLE}\n差出人:{X-USER}\n差出日時;; -; :{X-INPUT_TIME}\n\n{X-BODY}\n\nこのプライベートメッセージを確認するには、下記アドレスへ\n{X-URL}" -;define:PM_MAIL_BODY = "あなたへのプライベートメッセージが届きましたので、お知らせします。\n\n件名:{X-TITLE}\n差出人:{X-USER}\n差出日時 -;:{X-INPUT_TIME}\n\n{X-BODY}\n\nこのプライベートメッセージを見るには、下記アドレスへ\n{X-URL}" define:PM_MAIL_BODY = "あなたへのプライベートメッセージが届きましたので、お知らせします。\n\n件名:{X-TITLE}\n差出人:{X-USER}\n差出日時:{X-INPUT_TIME}\n\n{X-BODY}\n\nこのプライベートメッセージを確認するには、下記アドレスへ\n{X-URL}" define:PM_SUBJECT_FORMAT = "Fw%s: %s" 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/language/chinese/main.ini b/html/webapp/modules/reservation/language/chinese/main.ini index 84f18ca..d1f0531 100644 --- a/html/webapp/modules/reservation/language/chinese/main.ini +++ b/html/webapp/modules/reservation/language/chinese/main.ini @@ -327,11 +327,11 @@ reservation_all_delete_mess1 = "選択している施設に対して、全ての reservation_all_delete_mess2 = "選択している施設・利用するグループに対して、予約を削除してインポートします。\n本当によろしいですか。" reservation_duplication = "重複した件名と予約日時は無視する" reservation_select_upload = "请指定您要导入的CSV文件。" -researchmap_file_name = "CSV文件: " -researchmap_download_format = "下载格式" -researchmap_download_format_title = "CSVファイルからデータを取り込みます。" -researchmap_download_desc = "各項目の説明" -researchmap_download_desc_title = "各項目を説明します。" +reservation_file_name = "CSV文件: " +reservation_download_format = "下载格式" +reservation_download_format_title = "CSVファイルからデータを取り込みます。" +reservation_download_desc = "各項目の説明" +reservation_download_desc_title = "各項目を説明します。" reservation_import = "导入" reservation_help_desc = "インポートファイルへの設定項目の詳細は、下記を参照ください。

なお、各項目を無指定とする場合、空白の代わりに文字列「null」を設定してください。

また、無指定(「null」指定)または指定外の設定をした場合、未設定 とします。" reservation_help_header_item = "选项" diff --git a/html/webapp/modules/reservation/language/english/main.ini b/html/webapp/modules/reservation/language/english/main.ini index 0ed8d01..2b31be1 100644 --- a/html/webapp/modules/reservation/language/english/main.ini +++ b/html/webapp/modules/reservation/language/english/main.ini @@ -328,11 +328,11 @@ reservation_all_delete_mess1 = "Delete all reservation items and import.\nAre yo reservation_all_delete_mess2 = "Delete reservation items and import.\nAre you sure?" reservation_duplication = "The duplicate subject name and reservation time are disregarded. " reservation_select_upload = "Please designate CSV file for import." -researchmap_file_name = "CSV file " -researchmap_download_format = "Download format" -researchmap_download_format_title = "Import from CSV file." -researchmap_download_desc = "Explanations of items" -researchmap_download_desc_title = "Explain items." +reservation_file_name = "CSV file " +reservation_download_format = "Download format" +reservation_download_format_title = "Import from CSV file." +reservation_download_desc = "Explanations of items" +reservation_download_desc_title = "Explain items." reservation_import = "Import" reservation_help_desc = "To see details of import file item settings, please see below.

Further, for itesm that have no settings, enter 'null' instead of blank spaces.

Also, in the case of no setting (setting of 'null') or outside range setting, it is changed to 'no setting'." reservation_help_header_item = "Item" diff --git a/html/webapp/modules/reservation/language/japanese/main.ini b/html/webapp/modules/reservation/language/japanese/main.ini index 8575a0f..fc8cfb3 100644 --- a/html/webapp/modules/reservation/language/japanese/main.ini +++ b/html/webapp/modules/reservation/language/japanese/main.ini @@ -327,11 +327,11 @@ reservation_all_delete_mess1 = "選択している施設に対して、全予約 reservation_all_delete_mess2 = "選択している施設・利用グループに対して、全予約を削除してインポートします。\n本当によろしいですか。" reservation_duplication = "件名と予約日時が一致するデータは無視する" reservation_select_upload = "インポートファイルを指定してください。" -researchmap_file_name = "CSVファイル " -researchmap_download_format = "フォーマットのダウンロード" -researchmap_download_format_title = "CSVファイルからデータを取り込みます。" -researchmap_download_desc = "各項目の説明" -researchmap_download_desc_title = "各項目を説明します。" +reservation_file_name = "CSVファイル " +reservation_download_format = "フォーマットのダウンロード" +reservation_download_format_title = "CSVファイルからデータを取り込みます。" +reservation_download_desc = "各項目の説明" +reservation_download_desc_title = "各項目を説明します。" reservation_import = "取り込み" reservation_help_desc = "インポートファイルへの設定項目の詳細は、下記を参照ください。

なお、各項目を無指定とする場合、空白の代わりに文字列「null」を設定してください。

また、無指定(「null」指定)または指定外の設定をした場合、未設定 とします。" reservation_help_header_item = "項目" diff --git a/html/webapp/modules/reservation/templates/default/reservation_view_edit_import_init.html b/html/webapp/modules/reservation/templates/default/reservation_view_edit_import_init.html index 6c1b384..6cd6268 100644 --- a/html/webapp/modules/reservation/templates/default/reservation_view_edit_import_init.html +++ b/html/webapp/modules/reservation/templates/default/reservation_view_edit_import_init.html @@ -49,7 +49,7 @@
<{* CSVファイル *}>
@@ -57,13 +57,13 @@ @@ -78,7 +78,7 @@ <{* 各項目の説明 *}>