From 33438aa6fba1807c1c2c793038ad1e0830120ac5 Mon Sep 17 00:00:00 2001
From: kteraguchi
Date: Tue, 22 Jan 2013 15:12:46 +0900
Subject: [PATCH 01/61] =?UTF-8?q?Ver.2.4.0.0=E3=83=AA=E3=83=AA=E3=83=BC?=
=?UTF-8?q?=E3=82=B9=E3=81=8B=E3=82=892013/1/21=E3=81=BE=E3=81=A7=E3=81=AE?=
=?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=88=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../maple/filter/Filter_AllowIdList.class.php | 2 +-
html/maple/filter/Filter_FileUpload.class.php | 1299 +++++++++--------
html/maple/filter/Filter_Mobile.class.php | 836 +++++------
html/maple/nccore/common_func.php | 9 +
html/webapp/components/mobile/View.class.php | 11 +-
html/webapp/components/uploads/View.class.php | 1174 +++++++--------
html/webapp/components/users/View.class.php | 51 +
.../components/whatsnew/Action.class.php | 235 ++-
html/webapp/config/define.inc.php | 2 +-
html/webapp/config/global-config.ini | 8 +
html/webapp/language/chinese/global.ini | 2 +
html/webapp/language/english/global.ini | 2 +
html/webapp/language/english/items.ini | 12 +-
html/webapp/language/english/lang_common.js | 20 +-
html/webapp/language/japanese/global.ini | 2 +
html/webapp/language/japanese/lang_common.js | 14 +-
.../authority_view_admin_selectmodules.html | 2 +-
.../restoreresult/Restoreresult.class.php | 1294 ++++++++--------
.../templates/default/bbs_mobile_thread.html | 3 +
.../modules/chat/update/Update.class.php | 29 +
.../action/main/postscript/add/maple.ini | 2 +-
.../main/postscript/mail/Mail.class.php | 5 +-
.../circular/files/css/default/style.css | 15 +-
.../circular/files/js/default/circular.js | 7 +-
.../circular/language/chinese/main.ini | 5 +-
.../circular/language/english/main.ini | 5 +-
.../circular/language/japanese/main.ini | 5 +-
.../circular_view_main_postscript.html | 11 +-
.../circular_view_main_postscript_list.html | 2 +-
.../view/main/postscript/init/maple.ini | 4 +
.../modules/common/files/js/prototype.js | 4 +-
.../operation/common_operation_view_init.html | 12 +-
.../modules/comp/files/js/comp_calendar.js | 104 +-
.../files/js/plugins/comp_textareamain.js | 2 +-
.../comp/language/chinese/textarea.ini | 7 +
.../comp/language/english/textarea.ini | 7 +
.../comp/language/japanese/textarea.ini | 7 +
.../comp/templates/textarea/insert_image.html | 23 +-
.../modules/install/sql/mysql/table.sql | 2 +-
.../modules/journal/components/View.class.php | 12 +-
.../journal_mobile_detail_feature.html | 2 +-
.../default/journal_mobile_detail_smart.html | 2 +-
.../journal/view/main/detail/Detail.class.php | 179 +--
.../linklist/components/View.class.php | 2 +-
.../default/linklist_view_edit_style.html | 13 +-
.../main/autoregist/Autoregist.class.php | 272 ++--
.../login/action/main/forgetpass/maple.ini | 1 +
.../validator/Validator_Forgetpass.class.php | 144 +-
.../validator/Validator_ItemsInputs.class.php | 325 ++---
.../login/view/main/init/Init.class.php | 154 +-
.../menu/action/edit/addpage/maple.ini | 2 +-
.../templates/default/menu_mobile_detail.html | 178 ++-
.../default/menu_mobile_recursive_block.html | 115 +-
.../menu/validator/Validator_Regist.class.php | 26 +-
.../menu/view/mobile/init/Init.class.php | 17 +
.../modules/module/update/Update.class.php | 68 -
.../edit/addmetadata/Addmetadata.class.php | 56 +-
.../photoalbum/files/css/default/style.css | 2 +-
.../photoalbum/language/chinese/main.ini | 2 +-
.../photoalbum/language/english/main.ini | 2 +-
.../photoalbum/language/japanese/main.ini | 2 +-
.../default/photoalbum_mobile_view_photo.html | 8 +-
.../photoalbum_mobile_view_photo_list.html | 2 +-
.../photoalbum/view/main/init/maple.ini | 2 +-
.../view/mobile/list/List.class.php | 2 -
.../modules/pm/components/View.class.php | 2 +-
.../modules/pm/language/english/main.ini | 8 +-
.../validator/Validator_ItemData.class.php | 6 +-
.../reservation/components/Action.class.php | 1177 +++++++--------
.../reservation/components/View.class.php | 640 ++++----
.../modules/reservation/config/main.ini | 3 +
.../reservation/language/chinese/main.ini | 4 +-
.../reservation/language/english/main.ini | 14 +-
.../reservation/language/japanese/main.ini | 10 +-
.../modules/reservation/sql/mysql/table.sql | 3 +-
...reservation_location_regist_authority.html | 41 +-
...rvation_location_regist_location_name.html | 8 -
...reservation_view_edit_location_regist.html | 4 +-
.../reservation_view_main_list_location.html | 2 +-
.../reservation_view_main_list_monthly.html | 2 +-
.../reservation_view_main_list_weekly.html | 2 +-
.../reservation_view_recursive_room.html | 6 +-
.../reservation/update/Update.class.php | 9 +
.../Validator_LocationView.class.php | 35 +-
.../view/edit/import/init/Init.class.php | 38 +-
.../view/main/reserve/add/Add.class.php | 4 -
.../view/main/reserve/modify/Modify.class.php | 4 -
.../modules/rss/components/Parse.class.php | 15 +-
html/webapp/modules/user/install.ini | 1 +
.../validator/Validator_ItemsInputs.class.php | 272 ++--
.../view/admin/import/upload/Upload.class.php | 404 +++--
.../user/view/admin/import/upload/maple.ini | 1 -
html/webapp/style/css/common.css | 2 +-
html/webapp/templates/main/mobile_smart.html | 2 +-
94 files changed, 4886 insertions(+), 4659 deletions(-)
diff --git a/html/maple/filter/Filter_AllowIdList.class.php b/html/maple/filter/Filter_AllowIdList.class.php
index a21ca1a..483fe6d 100644
--- a/html/maple/filter/Filter_AllowIdList.class.php
+++ b/html/maple/filter/Filter_AllowIdList.class.php
@@ -418,7 +418,7 @@ function _showpages_fetchcallback($result, $func_param) {
$row['page_name'] = _SPACE_TYPE_NAME_PUBLIC;
} else if($row['space_type'] ==_SPACE_TYPE_GROUP && $row['private_flag'] ==_ON){
if($row['default_entry_flag'] ==_ON)
- $row['page_name'] = RMAP_MYPOTAL;
+ $row['page_name'] = _SPACE_TYPE_NAME_MYPORTAL;
else
$row['page_name'] = _SPACE_TYPE_NAME_PRIVATE;
} else {
diff --git a/html/maple/filter/Filter_FileUpload.class.php b/html/maple/filter/Filter_FileUpload.class.php
index 4de8642..72d5a04 100644
--- a/html/maple/filter/Filter_FileUpload.class.php
+++ b/html/maple/filter/Filter_FileUpload.class.php
@@ -45,11 +45,11 @@
//include_once MAPLE_DIR.'/core/Token.class.php';
if (!defined('UPLOAD_ERR_OK')) {
- define('UPLOAD_ERR_OK', 0);
- define('UPLOAD_ERR_INI_SIZE', 1);
- define('UPLOAD_ERR_FORM_SIZE', 2);
- define('UPLOAD_ERR_PARTIAL', 3);
- define('UPLOAD_ERR_NO_FILE', 4);
+ define('UPLOAD_ERR_OK', 0);
+ define('UPLOAD_ERR_INI_SIZE', 1);
+ define('UPLOAD_ERR_FORM_SIZE', 2);
+ define('UPLOAD_ERR_PARTIAL', 3);
+ define('UPLOAD_ERR_NO_FILE', 4);
}
/**
@@ -66,118 +66,118 @@
class Filter_FileUpload extends Filter
{
/**
- * コンストラクター
- *
- * @access public
- * @since 3.1.0
- */
- function Filter_FileUpload()
- {
- parent::Filter();
- }
-
- /**
- * ファイルアップロード処理を行う
- *
- * @access public
- * @since 3.1.0
- */
- function execute()
- {
- $log =& LogFactory::getLog();
- $log->trace("Filter_FileUploadの前処理が実行されました", "Filter_FileUpload#execute");
-
- $container =& DIContainerFactory::getContainer();
+ * コンストラクター
+ *
+ * @access public
+ * @since 3.1.0
+ */
+ function Filter_FileUpload()
+ {
+ parent::Filter();
+ }
+
+ /**
+ * ファイルアップロード処理を行う
+ *
+ * @access public
+ * @since 3.1.0
+ */
+ function execute()
+ {
+ $log =& LogFactory::getLog();
+ $log->trace("Filter_FileUploadの前処理が実行されました", "Filter_FileUpload#execute");
+
+ $container =& DIContainerFactory::getContainer();
$fileUpload =& new FileUpload;
$container->register($fileUpload, 'FileUpload');
- $actionChain =& $container->getComponent("ActionChain");
- $errorList =& $actionChain->getCurErrorList();
- if ($errorList->isExists()) {
- $filterChain =& $container->getComponent("FilterChain");
- $filterChain->execute();
- return;
- }
-
- $session =& $container->getComponent("Session");
- $request =& $container->getComponent("Request");
- $configView =& $container->getComponent("configView");
- $commonMain =& $container->getComponent("commonMain");
- $fileView =& $commonMain->registerClass(WEBAPP_DIR.'/components/file/View.class.php', "File_View", "fileView");
-
-
- //パラメータをセット
- $upload_params = $request->getParameter("upload_params");
- $fileUpload->setPageid(intval($request->getParameter("page_id")));
- $fileUpload->setModuleid(intval($request->getParameter("module_id")));
- $unique_id = $request->getParameter("unique_id");
- if(!isset($unique_id)) {
- $unique_id = "0";
- }
- $fileUpload->setUniqueid($unique_id);
- $fileUpload->setDownLoadactionName($request->getParameter("download_action_name"));
-
- $attributes = $this->getAttributes();
-
- if (isset($attributes["name"])) {
- $fileUpload->setName($attributes["name"]);
-
- if (isset($attributes["filemode"])) {
- if (defined($attributes["filemode"])) $attributes["filemode"] = $this->constantDef($attributes["filemode"]);
- $fileUpload->setFilemode($attributes["filemode"]);
- } else {
- //default
- $fileUpload->setFilemode(_UPLOAD_FILE_MODE);
- }
-
- //maple.iniを分析
- $maxsize_ini = array();
- $maxwidth_ini = array();
- $maxheight_ini = array();
- $type_ini = array();
- $extension_ini = array();
- $sizeError_ini = array();
- $widthError_ini = array();
- $heightError_ini = array();
- $typeError_ini = array();
- $extensionError_ini = array();
- $noFileError_ini = array();
- $resize = true; // default:画像の枠が範囲を超えていればリサイズ
- if(isset($attributes["stopper"]) && ($attributes["stopper"] === 0 || $attributes["stopper"] === "0" || $attributes["stopper"] === false || $attributes["stopper"] === "false")) {
- $stopper = false;
- } else {
- //stopper default:true
- $stopper = true;
- }
- if (isset($attributes["allow_attachment"])) {
- //configの権限でアップロード可能かどうかをセット
- $allow_attachment_flag = $session->getParameter("_allow_attachment_flag");
- $attributes_allow_attachment_flag = $this->constantDef($attributes["allow_attachment"]);
- } else {
- $allow_attachment_flag = _ALLOW_ATTACHMENT_ALL;
- $attributes_allow_attachment_flag = _ALLOW_ATTACHMENT_ALL;
- }
-
- //エラーメッセージdefault値指定
- $sizeError_ini["default"] = _FILE_UPLOAD_ERR_SIZE; //vsprintf(_FILE_UPLOAD_ERR_SIZE,_UPLOAD_MAX_SIZE_IMAGE);
- $widthError_ini["default"] = _FILE_UPLOAD_ERR_UPLOAD_WIDTHLARGE; //vsprintf(_FILE_UPLOAD_ERR_UPLOAD_WIDTHLARGE,_UPLOAD_MAX_WIDTH_IMAGE);
- $heightError_ini["default"] = _FILE_UPLOAD_ERR_UPLOAD_HEIGHTLARGE; //vsprintf(_FILE_UPLOAD_ERR_UPLOAD_HEIGHTLARGE,_UPLOAD_MAX_HEIGHT_IMAGE);
- $typeError_ini["default"] = _FILE_UPLOAD_ERR_MIMETYPE;
-
- $noFileError_ini["whether"] = _FILE_UPLOAD_ERR_UPLOAD_NOFILE;
- $noFileError_whether = 0;
- $maxsize_ini["default"] = _UPLOAD_MAX_SIZE_ATTACHMENT;
-
- foreach($attributes as $key => $value) {
- //start_add code
-
- if ((!((strlen($key) == 4 && substr($key,0,4) == "type") || (substr($key,0,4) == "type" && is_numeric(substr($key,5,strlen($key)-6))))) &&
- (!((strlen($key) == 9 && substr($key,0,9) == "extension") || (substr($key,0,9) == "extension" && is_numeric(substr($key,10,strlen($key)-11)))))) {
- $valueArray = explode(",", $value);
- if (count($valueArray) > 1) {
- $printParams = array_slice($valueArray, 1);
- $count = 0;
+ $actionChain =& $container->getComponent("ActionChain");
+ $errorList =& $actionChain->getCurErrorList();
+ if ($errorList->isExists()) {
+ $filterChain =& $container->getComponent("FilterChain");
+ $filterChain->execute();
+ return;
+ }
+
+ $session =& $container->getComponent("Session");
+ $request =& $container->getComponent("Request");
+ $configView =& $container->getComponent("configView");
+ $commonMain =& $container->getComponent("commonMain");
+ $fileView =& $commonMain->registerClass(WEBAPP_DIR.'/components/file/View.class.php', "File_View", "fileView");
+
+
+ //パラメータをセット
+ $upload_params = $request->getParameter("upload_params");
+ $fileUpload->setPageid(intval($request->getParameter("page_id")));
+ $fileUpload->setModuleid(intval($request->getParameter("module_id")));
+ $unique_id = $request->getParameter("unique_id");
+ if(!isset($unique_id)) {
+ $unique_id = "0";
+ }
+ $fileUpload->setUniqueid($unique_id);
+ $fileUpload->setDownLoadactionName($request->getParameter("download_action_name"));
+
+ $attributes = $this->getAttributes();
+
+ if (isset($attributes["name"])) {
+ $fileUpload->setName($attributes["name"]);
+
+ if (isset($attributes["filemode"])) {
+ if (defined($attributes["filemode"])) $attributes["filemode"] = $this->constantDef($attributes["filemode"]);
+ $fileUpload->setFilemode($attributes["filemode"]);
+ } else {
+ //default
+ $fileUpload->setFilemode(_UPLOAD_FILE_MODE);
+ }
+
+ //maple.iniを分析
+ $maxsize_ini = array();
+ $maxwidth_ini = array();
+ $maxheight_ini = array();
+ $type_ini = array();
+ $extension_ini = array();
+ $sizeError_ini = array();
+ $widthError_ini = array();
+ $heightError_ini = array();
+ $typeError_ini = array();
+ $extensionError_ini = array();
+ $noFileError_ini = array();
+ $resize = true; // default:画像の枠が範囲を超えていればリサイズ
+ if(isset($attributes["stopper"]) && ($attributes["stopper"] === 0 || $attributes["stopper"] === "0" || $attributes["stopper"] === false || $attributes["stopper"] === "false")) {
+ $stopper = false;
+ } else {
+ //stopper default:true
+ $stopper = true;
+ }
+ if (isset($attributes["allow_attachment"])) {
+ //configの権限でアップロード可能かどうかをセット
+ $allow_attachment_flag = $session->getParameter("_allow_attachment_flag");
+ $attributes_allow_attachment_flag = $this->constantDef($attributes["allow_attachment"]);
+ } else {
+ $allow_attachment_flag = _ALLOW_ATTACHMENT_ALL;
+ $attributes_allow_attachment_flag = _ALLOW_ATTACHMENT_ALL;
+ }
+
+ //エラーメッセージdefault値指定
+ $sizeError_ini["default"] = _FILE_UPLOAD_ERR_SIZE; //vsprintf(_FILE_UPLOAD_ERR_SIZE,_UPLOAD_MAX_SIZE_IMAGE);
+ $widthError_ini["default"] = _FILE_UPLOAD_ERR_UPLOAD_WIDTHLARGE; //vsprintf(_FILE_UPLOAD_ERR_UPLOAD_WIDTHLARGE,_UPLOAD_MAX_WIDTH_IMAGE);
+ $heightError_ini["default"] = _FILE_UPLOAD_ERR_UPLOAD_HEIGHTLARGE; //vsprintf(_FILE_UPLOAD_ERR_UPLOAD_HEIGHTLARGE,_UPLOAD_MAX_HEIGHT_IMAGE);
+ $typeError_ini["default"] = _FILE_UPLOAD_ERR_MIMETYPE;
+
+ $noFileError_ini["whether"] = _FILE_UPLOAD_ERR_UPLOAD_NOFILE;
+ $noFileError_whether = 0;
+ $maxsize_ini["default"] = _UPLOAD_MAX_SIZE_ATTACHMENT;
+
+ foreach($attributes as $key => $value) {
+ //start_add code
+
+ if ((!((strlen($key) == 4 && substr($key,0,4) == "type") || (substr($key,0,4) == "type" && is_numeric(substr($key,5,strlen($key)-6))))) &&
+ (!((strlen($key) == 9 && substr($key,0,9) == "extension") || (substr($key,0,9) == "extension" && is_numeric(substr($key,10,strlen($key)-11)))))) {
+ $valueArray = explode(",", $value);
+ if (count($valueArray) > 1) {
+ $printParams = array_slice($valueArray, 1);
+ $count = 0;
foreach ($printParams as $subValue) {
if (defined($subValue)) {
$printParams[$count] = $this->constantDef($subValue);
@@ -186,526 +186,569 @@ function execute()
}
if (defined($valueArray[0])) $valueArray[0] = $this->constantDef($valueArray[0]);
$value = vsprintf($valueArray[0],$printParams);
- } else {
- if (defined($value)) $value = $this->constantDef($value);
- }
- } else {
- $valueArray = explode(",", $value);
- if (count($valueArray) == 1) {
- if (defined($value)) $value = $this->constantDef($value);
- }
- }
- if (substr($key,0,11) == "action_name") {
- $fileUpload->setDownLoadactionName($value);
- }
- if (substr($key,0,8) == "maxwidth") {
- if (strlen($key) == 8) {
- $maxwidth_ini["default"] = $value;
- } else if (is_numeric(substr($key,9,strlen($key)-10))) {
- $maxwidth_ini[substr($key,9,strlen($key)-10)] = $value;
- }
- }
- if (substr($key,0,9) == "maxheight") {
- if (strlen($key) == 9) {
- $maxheight_ini["default"] = $value;
- } else if (is_numeric(substr($key,10,strlen($key)-11))) {
- $maxheight_ini[substr($key,10,strlen($key)-11)] = $value;
- }
- }
- if ($key == "resize") {
- if(($value === 1 || $value === "1" || $value === "true" || $value === true)) {
- $resize = true;
- } else {
- $resize = false;
- }
- }
- //
- // 解凍してアップロード
- //
- if ($key == "decompression") {
- if(($value === 1 || $value === "1" || $value === "true" || $value === true)) {
- $this->_decompression($attributes["name"], $fileUpload);
- }
- }
-
- if (substr($key,0,10) == "summaxsize") {
- $summaxsize_ini = $value;
- //if (strlen($key) == 10) {
- // $summaxsize_ini["default"] = $value;
- //} else if (is_numeric(substr($key,11,strlen($key)-12))) {
- // $summaxsize_ini[substr($key,11,strlen($key)-12)] = $value;
- //}
- }
-
+ } else {
+ if (defined($value)) $value = $this->constantDef($value);
+ }
+ } else {
+ $valueArray = explode(",", $value);
+ if (count($valueArray) == 1) {
+ if (defined($value)) $value = $this->constantDef($value);
+ }
+ }
+ if (substr($key,0,11) == "action_name") {
+ $fileUpload->setDownLoadactionName($value);
+ }
+ if (substr($key,0,8) == "maxwidth") {
+ if (strlen($key) == 8) {
+ $maxwidth_ini["default"] = $value;
+ } else if (is_numeric(substr($key,9,strlen($key)-10))) {
+ $maxwidth_ini[substr($key,9,strlen($key)-10)] = $value;
+ }
+ }
+ if (substr($key,0,9) == "maxheight") {
+ if (strlen($key) == 9) {
+ $maxheight_ini["default"] = $value;
+ } else if (is_numeric(substr($key,10,strlen($key)-11))) {
+ $maxheight_ini[substr($key,10,strlen($key)-11)] = $value;
+ }
+ }
+ if ($key == "resize") {
+ if(($value === 1 || $value === "1" || $value === "true" || $value === true)) {
+ $resize = true;
+ } else {
+ $resize = false;
+ }
+ }
+ //
+ // 解凍してアップロード
+ //
+ if ($key == "decompression") {
+ if(($value === 1 || $value === "1" || $value === "true" || $value === true)) {
+ $this->_decompression($attributes["name"], $fileUpload);
+ }
+ }
+
+ if (substr($key,0,10) == "summaxsize") {
+ $summaxsize_ini = $value;
+ //if (strlen($key) == 10) {
+ // $summaxsize_ini["default"] = $value;
+ //} else if (is_numeric(substr($key,11,strlen($key)-12))) {
+ // $summaxsize_ini[substr($key,11,strlen($key)-12)] = $value;
+ //}
+ }
+
//end_add code
-
- if (substr($key,0,7) == "maxsize") {
- if (strlen($key) == 7) {
- $maxsize_ini["default"] = $value;
- } else if (is_numeric(substr($key,8,strlen($key)-9))) {
- $maxsize_ini[substr($key,8,strlen($key)-9)] = $value;
- }
- }
-
- if (substr($key,0,4) == "type") {
- $typeArray = array();
- if (strlen($key) == 4) {
- $typeArray = explode(",", $value);
- $type_ini["default"] = $typeArray;
- } else if (is_numeric(substr($key,5,strlen($key)-6))) {
- $typeArray = explode(",", $value);
- $type_ini[substr($key,5,strlen($key)-6)] = $typeArray;
- }
- }
- //start_add code
- if (substr($key,0,9) == "extension") {
- $extensionArray = array();
- if (strlen($key) == 9) {
- $extensionArray = explode(",", strtolower($value));
- $extension_ini["default"] = $extensionArray;
- } else if (is_numeric(substr($key,10,strlen($key)-11))) {
- $extensionArray = explode(",", strtolower($value));
- $extension_ini[substr($key,10,strlen($key)-11)] = $extensionArray;
- }
- }
- //if ($allow_attachment_flag==_ALLOW_ATTACHMENT_ALL && substr($key,0,14) == "allow_mimetype" && ($value === _ON || $value === "true")) {
- if (($key == "allow_extension" || $key == "allow_mimetype") && ($value === 1 || $value === "1" || $value === "true" || $value === true)) {
- if(!isset($config)) {
- $config = $configView->getConfigByConfname(_SYS_CONF_MODID, "allow_extension");
- }
- if(isset($config["conf_value"])) {
- $allow_extension = $config["conf_value"];
- if($allow_extension != "" && $allow_extension != null) {
- $typeSubArray = array();
- $extensionSubArray = explode(",", strtolower($allow_extension));
- if ($key == "allow_mimetype") {
- $count = 0;
- //$uploadsView =& $this->_container->getComponent("uploadsView");
+
+ if (substr($key,0,7) == "maxsize") {
+ if (strlen($key) == 7) {
+ $maxsize_ini["default"] = $value;
+ } else if (is_numeric(substr($key,8,strlen($key)-9))) {
+ $maxsize_ini[substr($key,8,strlen($key)-9)] = $value;
+ }
+ }
+
+ if (substr($key,0,4) == "type") {
+ $typeArray = array();
+ if (strlen($key) == 4) {
+ $typeArray = explode(",", $value);
+ $type_ini["default"] = $typeArray;
+ } else if (is_numeric(substr($key,5,strlen($key)-6))) {
+ $typeArray = explode(",", $value);
+ $type_ini[substr($key,5,strlen($key)-6)] = $typeArray;
+ }
+ }
+ //start_add code
+ if (substr($key,0,9) == "extension") {
+ $extensionArray = array();
+ if (strlen($key) == 9) {
+ $extensionArray = explode(",", strtolower($value));
+ $extension_ini["default"] = $extensionArray;
+ } else if (is_numeric(substr($key,10,strlen($key)-11))) {
+ $extensionArray = explode(",", strtolower($value));
+ $extension_ini[substr($key,10,strlen($key)-11)] = $extensionArray;
+ }
+ }
+ //if ($allow_attachment_flag==_ALLOW_ATTACHMENT_ALL && substr($key,0,14) == "allow_mimetype" && ($value === _ON || $value === "true")) {
+ if (($key == "allow_extension" || $key == "allow_mimetype") && ($value === 1 || $value === "1" || $value === "true" || $value === true)) {
+ if(!isset($config)) {
+ $config = $configView->getConfigByConfname(_SYS_CONF_MODID, "allow_extension");
+ }
+ if(isset($config["conf_value"])) {
+ $allow_extension = $config["conf_value"];
+ if($allow_extension != "" && $allow_extension != null) {
+ $typeSubArray = array();
+ $extensionSubArray = explode(",", strtolower($allow_extension));
+ if ($key == "allow_mimetype") {
+ $count = 0;
+ //$uploadsView =& $this->_container->getComponent("uploadsView");
if(!class_exists("Uploads_View")) {
include_once WEBAPP_DIR .'/components/uploads/View.class.php';
}
$uploadsView =& new Uploads_View;
- foreach($extensionSubArray as $extensionValue) {
- $typeSubArray[$count] = $uploadsView->mimeinfo("type", "." . $extensionValue);
- $count++;
- }
- //if (strlen($key) == 14) {
- if(isset($type_ini["default"]) && is_array($type_ini["default"]) && count($type_ini["default"]) > 0) {
- $type_ini["default"] = array_merge($type_ini["default"], $typeSubArray);
- } else {
- $type_ini["default"] = $typeSubArray;
- }
- //} else if (is_numeric(substr($key,15,strlen($key)-16))) {
- // if(count($typeArray) > 0) {
- // $type_ini[substr($key,15,strlen($key)-16)] = array_merge($typeArray, $typeSubArray);
- // } else {
- // $type_ini[substr($key,15,strlen($key)-16)] = $typeSubArray;
- // }
- //}
- } else {
- // 拡張子
- if(isset($extension_ini["default"]) && is_array($extension_ini["default"]) && count($extension_ini["default"]) > 0) {
- $extension_ini["default"] = array_merge($extension_ini["default"], $extensionSubArray);
- } else {
- $extension_ini["default"] = $extensionSubArray;
- }
- }
- }
- }
- }
- if(defined($value)) {
- $value = constant($value);
- }
- if (substr($key,0,10) == "widthError") {
- if (strlen($key) == 10) {
- $widthError_ini["default"] = $value;
- } else if (is_numeric(substr($key,11,strlen($key)-12))) {
- $widthError_ini[substr($key,11,strlen($key)-12)] = $value;
- }
- }
- if (substr($key,0,11) == "heightError") {
- if (strlen($key) == 11) {
- $heightError_ini["default"] = $value;
- } else if (is_numeric(substr($key,12,strlen($key)-13))) {
- $heightError_ini[substr($key,12,strlen($key)-13)] = $value;
- }
- }
- if (substr($key,0,12) == "sumsizeError") {
- $sumsizeError_ini = $value;
- //if (strlen($key) == 12) {
- // $sumsizeError_ini["default"] = $value;
- //} else if (is_numeric(substr($key,13,strlen($key)-14))) {
- // $sumsizeError_ini[substr($key,13,strlen($key)-14)] = $value;
- //}
- }
- //end_add code
- if (substr($key,0,9) == "sizeError") {
- if (strlen($key) == 9) {
- $sizeError_ini["default"] = $value;
- } else if (is_numeric(substr($key,10,strlen($key)-11))) {
- $sizeError_ini[substr($key,10,strlen($key)-11)] = $value;
- }
- }
-
- if (substr($key,0,9) == "typeError") {
- if (strlen($key) == 9) {
- $typeError_ini["default"] = $value;
- } else if (is_numeric(substr($key,10,strlen($key)-11))) {
- $typeError_ini[substr($key,10,strlen($key)-11)] = $value;
- }
- }
-
- if (substr($key,0,14) == "extensionError") {
- if (strlen($key) == 14) {
- $extensionError_ini["default"] = $value;
- } else if (is_numeric(substr($key,15,strlen($key)-16))) {
- $extensionError_ini[substr($key,15,strlen($key)-16)] = $value;
- }
- }
-
- if (substr($key,0,11) == "noFileError") {
- if (strlen($key) == 11) {
- $noFileError_ini["default"] = $value;
- } else if (is_numeric(substr($key,12,strlen($key)-13))) {
- $noFileError_ini[substr($key,12,strlen($key)-13)] = $value;
- } else if (substr($key,12,7) == "whether") {
- $noFileError_ini["whether"] = $value;
- $noFileError_whether = 0;
- }
- }
- }
-
- //関連配列
- $error = $fileUpload->getError();
- $extension_check = $fileUpload->checkExtension($extension_ini);
-
- $mime_type_check = $fileUpload->checkMimeType($type_ini);
-
- if($resize) {
- // リサイズ処理
- $fileUpload->resizeFile($maxwidth_ini, $maxheight_ini);
- }
-
- $filesize_check = $fileUpload->checkFilesize($maxsize_ini);
-
- $filewidth_check = $fileUpload->checkFilewidth($maxwidth_ini);
-
- $fileheight_check = $fileUpload->checkFileheight($maxheight_ini);
-
- $message = "";
- //以下はforeachで各ファイルでエラーチェックを行う
- $first_key = null;
- foreach ($error as $key => $val) {
- if($first_key === null) {
- $first_key = $key;
- }
- if ($val != UPLOAD_ERR_OK) {// PHP自体が感知するエラーが発生した場合
- if ($val == UPLOAD_ERR_INI_SIZE) {
- //$errorList->setType(UPLOAD_ERROR_TYPE);
- if (isset($attributes["iniSizeError"])) {
- $message = $attributes["iniSizeError"];
- } else {
- //start_change code
- $message = _FILE_UPLOAD_ERR_MAX_FILESIZE_INI;
- //end_change code
- }
- $fileUpload->setErrorMes($key, $message);
- //$errorList->add($fileUpload->getName()."[".$key."]", $message);
- break;
- } else if ($val == UPLOAD_ERR_FORM_SIZE) {
- //$errorList->setType(UPLOAD_ERROR_TYPE);
- if (isset($attributes["formSizeError"])) {
- $message = $attributes["formSizeError"];
- } else {
- $message = _FILE_UPLOAD_ERR_MAX_FILESIZE;
- }
- $fileUpload->setErrorMes($key, $message);
- //$errorList->add($fileUpload->getName()."[".$key."]", $message);
- break;
- } else if ($val == UPLOAD_ERR_PARTIAL) {
- //$errorList->setType(UPLOAD_ERROR_TYPE);
- if (isset($attributes["partialError"])) {
- $message = $attributes["partialError"];
- } else {
- $message = _FILE_UPLOAD_ERR_PART_OF_FILE;
- }
- //$errorList->add($fileUpload->getName()."[".$key."]", $message);
- $fileUpload->setErrorMes($key, $message);
- break;
- } else if ($val == UPLOAD_ERR_NO_FILE) {
- if (isset($noFileError_ini[$key])) {
- //$errorList->setType(UPLOAD_ERROR_TYPE);
- $message = $noFileError_ini[$key];
- $fileUpload->setErrorMes($key, $message);
- //$errorList->add($fileUpload->getName()."[".$key."]", $message);
- }else if (isset($noFileError_ini["default"])) {
- //$errorList->setType(UPLOAD_ERROR_TYPE);
- $message = $noFileError_ini["default"];
- $fileUpload->setErrorMes($key, $message);
- //$errorList->add($fileUpload->getName()."[".$key."]", $message);
- //break;
- } else if (isset($noFileError_ini["whether"])) {
- $noFileError_whether = $noFileError_whether +1;
- }
- }
- }else {// PHP自体が感知するエラーは発生していない場合
- //
- //アップロード不可
- //
- if($allow_attachment_flag == _ALLOW_ATTACHMENT_NO ||
- ($allow_attachment_flag == _ALLOW_ATTACHMENT_IMAGE && $attributes_allow_attachment_flag ==_ALLOW_ATTACHMENT_ALL)) {
- //var_dump($allow_attachment_flag);
- //var_dump($attributes_allow_attachment_flag);
- $message = _FILE_UPLOAD_ERR_FAILURE;
- $fileUpload->setErrorMes($key, $message);
- continue;
- }
-
- //
- // maple.iniで設定されたサイズを超えていた場合
- //
- if (count($maxsize_ini) > 0) {
- if (!$filesize_check[$key]) {
- //$errorList->setType(UPLOAD_ERROR_TYPE);
- if (isset($sizeError_ini[$key])) {
- $message = vsprintf($sizeError_ini[$key],$maxsize_ini[$key]); //$sizeError_ini[$key];
- }else if (isset($sizeError_ini["default"])) {
- $message = vsprintf($sizeError_ini["default"],$maxsize_ini["default"]);
- } else {
- $message = _FILE_UPLOAD_ERR_FAILURE;
- }
- $fileUpload->setErrorMes($key, $message);
- continue;
- //$errorList->add($fileUpload->getName()."[".$key."]", $message);
- }
- }
-
- //
- // maple.iniで設定されたMIME-Typeではなかった場合
- //
- if (count($type_ini) > 0) {
- if (!$mime_type_check[$key]) {
- //$errorList->setType(UPLOAD_ERROR_TYPE);
- if (isset($typeError_ini[$key])) {
- $message = $typeError_ini[$key];
- }else if (isset($typeError_ini["default"])) {
- $message = $typeError_ini["default"];
- } else {
- $message = _FILE_UPLOAD_ERR_FILENAME_REJECRED;
- }
- $fileUpload->setErrorMes($key, $message);
- continue;
- //$errorList->add($fileUpload->getName()."[".$key."]", $message);
- }
- }
-
-
- //
- // maple.iniで設定された拡張子ではなかった場合
- //
- if (count($extension_ini) > 0) {
- if (!$extension_check[$key]) {
- //$errorList->setType(UPLOAD_ERROR_TYPE);
- if (isset($extensionError_ini[$key])) {
- $message = $extensionError_ini[$key];
- }else if (isset($extensionError_ini["default"])) {
- $message = $extensionError_ini["default"];
- } else {
- $message = _FILE_UPLOAD_ERR_FILENAME_REJECRED;
- }
- $fileUpload->setErrorMes($key, $message);
- continue;
- //$errorList->add($fileUpload->getName()."[".$key."]", $message);
- }
- }
-
- //
- // maple.iniで設定されたWidthを超えていた場合
- //
- if (count($maxwidth_ini) > 0) {
- if (!$filewidth_check[$key]) {
- //$errorList->setType(UPLOAD_ERROR_TYPE);
- if (isset($widthError_ini[$key])) {
- $message = vsprintf($widthError_ini[$key],$maxwidth_ini[$key]);
- }else if (isset($widthError_ini["default"])) {
- $message = vsprintf($widthError_ini["default"],$maxwidth_ini["default"]);
- } else {
- $message = _FILE_UPLOAD_ERR_FAILURE;
- }
- $fileUpload->setErrorMes($key, $message);
- continue;
- //$errorList->add($fileUpload->getName()."[".$key."]", $message);
- }
- }
-
- //
- // maple.iniで設定されたHeightを超えていた場合
- //
- if (count($maxheight_ini) > 0) {
- if (!$fileheight_check[$key]) {
- //$errorList->setType(UPLOAD_ERROR_TYPE);
- if (isset($heightError_ini[$key])) {
- $message = vsprintf($heightError_ini[$key],$maxheight_ini[$key]);
- }else if (isset($heightError_ini["default"])) {
- $message = vsprintf($heightError_ini["default"],$maxheight_ini["default"]);
- } else {
- $message = _FILE_UPLOAD_ERR_FAILURE;
- }
- $fileUpload->setErrorMes($key, $message);
- continue;
- //$errorList->add($fileUpload->getName()."[".$key."]", $message);
- }
- }
- }
- }
- if (isset($noFileError_whether) && count($error) == $noFileError_whether) {
- //$errorList->setType(UPLOAD_ERROR_TYPE);
- $message = $noFileError_ini["whether"];
- //少なくとも1つファイルを指定しないとならないエラーの場合、先頭のfileのエラーリストに追加する key=0固定
- $fileUpload->setErrorMes($first_key, $message);
- //$errorList->add($fileUpload->getName(), $message);
- }
-
- //
- // start_add code
- // ルーム毎の最大容量チェック
- //
- $room_id = intval($request->getParameter("room_id"));
- if($room_id != 0) {
- $getdata =& $container->getComponent("GetData");
- $pages = $getdata->getParameter("pages");
- if(!isset($pages[$room_id])) {
+ foreach($extensionSubArray as $extensionValue) {
+ $typeSubArray[$count] = $uploadsView->mimeinfo("type", "." . $extensionValue);
+ $count++;
+ }
+ //if (strlen($key) == 14) {
+ if(isset($type_ini["default"]) && is_array($type_ini["default"]) && count($type_ini["default"]) > 0) {
+ $type_ini["default"] = array_merge($type_ini["default"], $typeSubArray);
+ } else {
+ $type_ini["default"] = $typeSubArray;
+ }
+ //} else if (is_numeric(substr($key,15,strlen($key)-16))) {
+ // if(count($typeArray) > 0) {
+ // $type_ini[substr($key,15,strlen($key)-16)] = array_merge($typeArray, $typeSubArray);
+ // } else {
+ // $type_ini[substr($key,15,strlen($key)-16)] = $typeSubArray;
+ // }
+ //}
+ } else {
+ // 拡張子
+ if(isset($extension_ini["default"]) && is_array($extension_ini["default"]) && count($extension_ini["default"]) > 0) {
+ $extension_ini["default"] = array_merge($extension_ini["default"], $extensionSubArray);
+ } else {
+ $extension_ini["default"] = $extensionSubArray;
+ }
+ }
+ }
+ }
+ }
+ if(defined($value)) {
+ $value = constant($value);
+ }
+ if (substr($key,0,10) == "widthError") {
+ if (strlen($key) == 10) {
+ $widthError_ini["default"] = $value;
+ } else if (is_numeric(substr($key,11,strlen($key)-12))) {
+ $widthError_ini[substr($key,11,strlen($key)-12)] = $value;
+ }
+ }
+ if (substr($key,0,11) == "heightError") {
+ if (strlen($key) == 11) {
+ $heightError_ini["default"] = $value;
+ } else if (is_numeric(substr($key,12,strlen($key)-13))) {
+ $heightError_ini[substr($key,12,strlen($key)-13)] = $value;
+ }
+ }
+ if (substr($key,0,12) == "sumsizeError") {
+ $sumsizeError_ini = $value;
+ //if (strlen($key) == 12) {
+ // $sumsizeError_ini["default"] = $value;
+ //} else if (is_numeric(substr($key,13,strlen($key)-14))) {
+ // $sumsizeError_ini[substr($key,13,strlen($key)-14)] = $value;
+ //}
+ }
+ //end_add code
+ if (substr($key,0,9) == "sizeError") {
+ if (strlen($key) == 9) {
+ $sizeError_ini["default"] = $value;
+ } else if (is_numeric(substr($key,10,strlen($key)-11))) {
+ $sizeError_ini[substr($key,10,strlen($key)-11)] = $value;
+ }
+ }
+
+ if (substr($key,0,9) == "typeError") {
+ if (strlen($key) == 9) {
+ $typeError_ini["default"] = $value;
+ } else if (is_numeric(substr($key,10,strlen($key)-11))) {
+ $typeError_ini[substr($key,10,strlen($key)-11)] = $value;
+ }
+ }
+
+ if (substr($key,0,14) == "extensionError") {
+ if (strlen($key) == 14) {
+ $extensionError_ini["default"] = $value;
+ } else if (is_numeric(substr($key,15,strlen($key)-16))) {
+ $extensionError_ini[substr($key,15,strlen($key)-16)] = $value;
+ }
+ }
+
+ if (substr($key,0,11) == "noFileError") {
+ if (strlen($key) == 11) {
+ $noFileError_ini["default"] = $value;
+ } else if (is_numeric(substr($key,12,strlen($key)-13))) {
+ $noFileError_ini[substr($key,12,strlen($key)-13)] = $value;
+ } else if (substr($key,12,7) == "whether") {
+ $noFileError_ini["whether"] = $value;
+ $noFileError_whether = 0;
+ }
+ }
+ }
+
+ //関連配列
+ $error = $fileUpload->getError();
+ $extension_check = $fileUpload->checkExtension($extension_ini);
+
+ $mime_type_check = $fileUpload->checkMimeType($type_ini);
+
+ if($resize) {
+ //指定された大きさ(解像度)を取得
+ $resolution = $request->getParameter('resolution');
+
+ $maxwidth = array();
+ $maxheight = array();
+
+ //解像度により maxwidthを設定(maxheightは自動設定)
+ switch ($resolution) {
+ //「実寸大」の場合はリサイズしない
+ case 'asis':
+ break;
+
+ //「大」の場合
+ case 'large':
+ // 幅、高さ設定値を取得
+ $maxwidth['default'] = _UPLOAD_RESOLUTION_IMAGE_LARGE_WIDTH;
+ $maxheight['default'] = _UPLOAD_RESOLUTION_IMAGE_LARGE_HEIGHT;
+ //リサイズ処理
+ $fileUpload->resizeFile($maxwidth, $maxheight);
+ break;
+
+ //「中」の場合
+ case 'middle':
+ // 幅、高さ設定値を取得
+ $maxwidth['default'] = _UPLOAD_RESOLUTION_IMAGE_MIDDLE_WIDTH;
+ $maxheight['default'] = _UPLOAD_RESOLUTION_IMAGE_MIDDLE_HEIGHT;
+ //リサイズ処理
+ $fileUpload->resizeFile($maxwidth, $maxheight);
+ break;
+
+ //「小」の場合
+ case 'small':
+ // 幅、高さ設定値を取得
+ $maxwidth['default'] = _UPLOAD_RESOLUTION_IMAGE_SMALL_WIDTH;
+ $maxheight['default'] = _UPLOAD_RESOLUTION_IMAGE_SMALL_HEIGHT;
+ //リサイズ処理
+ $fileUpload->resizeFile($maxwidth, $maxheight);
+ break;
+
+ //「標準」、指定なしの場合
+ default:
+ //各モジュールのmaple.iniに定義されたサイズでリサイズ処理
+ $fileUpload->resizeFile($maxwidth_ini, $maxheight_ini);
+ break;
+ }
+ }
+
+ $filesize_check = $fileUpload->checkFilesize($maxsize_ini);
+
+ $filewidth_check = $fileUpload->checkFilewidth($maxwidth_ini);
+
+ $fileheight_check = $fileUpload->checkFileheight($maxheight_ini);
+
+ $message = "";
+ //以下はforeachで各ファイルでエラーチェックを行う
+ $first_key = null;
+ foreach ($error as $key => $val) {
+ if($first_key === null) {
+ $first_key = $key;
+ }
+ if ($val != UPLOAD_ERR_OK) {// PHP自体が感知するエラーが発生した場合
+ if ($val == UPLOAD_ERR_INI_SIZE) {
+ //$errorList->setType(UPLOAD_ERROR_TYPE);
+ if (isset($attributes["iniSizeError"])) {
+ $message = $attributes["iniSizeError"];
+ } else {
+ //start_change code
+ $message = _FILE_UPLOAD_ERR_MAX_FILESIZE_INI;
+ //end_change code
+ }
+ $fileUpload->setErrorMes($key, $message);
+ //$errorList->add($fileUpload->getName()."[".$key."]", $message);
+ break;
+ } else if ($val == UPLOAD_ERR_FORM_SIZE) {
+ //$errorList->setType(UPLOAD_ERROR_TYPE);
+ if (isset($attributes["formSizeError"])) {
+ $message = $attributes["formSizeError"];
+ } else {
+ $message = _FILE_UPLOAD_ERR_MAX_FILESIZE;
+ }
+ $fileUpload->setErrorMes($key, $message);
+ //$errorList->add($fileUpload->getName()."[".$key."]", $message);
+ break;
+ } else if ($val == UPLOAD_ERR_PARTIAL) {
+ //$errorList->setType(UPLOAD_ERROR_TYPE);
+ if (isset($attributes["partialError"])) {
+ $message = $attributes["partialError"];
+ } else {
+ $message = _FILE_UPLOAD_ERR_PART_OF_FILE;
+ }
+ //$errorList->add($fileUpload->getName()."[".$key."]", $message);
+ $fileUpload->setErrorMes($key, $message);
+ break;
+ } else if ($val == UPLOAD_ERR_NO_FILE) {
+ if (isset($noFileError_ini[$key])) {
+ //$errorList->setType(UPLOAD_ERROR_TYPE);
+ $message = $noFileError_ini[$key];
+ $fileUpload->setErrorMes($key, $message);
+ //$errorList->add($fileUpload->getName()."[".$key."]", $message);
+ }else if (isset($noFileError_ini["default"])) {
+ //$errorList->setType(UPLOAD_ERROR_TYPE);
+ $message = $noFileError_ini["default"];
+ $fileUpload->setErrorMes($key, $message);
+ //$errorList->add($fileUpload->getName()."[".$key."]", $message);
+ //break;
+ } else if (isset($noFileError_ini["whether"])) {
+ $noFileError_whether = $noFileError_whether +1;
+ }
+ }
+ }else {// PHP自体が感知するエラーは発生していない場合
+ //
+ //アップロード不可
+ //
+ if($allow_attachment_flag == _ALLOW_ATTACHMENT_NO ||
+ ($allow_attachment_flag == _ALLOW_ATTACHMENT_IMAGE && $attributes_allow_attachment_flag ==_ALLOW_ATTACHMENT_ALL)) {
+ //var_dump($allow_attachment_flag);
+ //var_dump($attributes_allow_attachment_flag);
+ $message = _FILE_UPLOAD_ERR_FAILURE;
+ $fileUpload->setErrorMes($key, $message);
+ continue;
+ }
+
+ //
+ // maple.iniで設定されたサイズを超えていた場合
+ //
+ if (count($maxsize_ini) > 0) {
+ if (!$filesize_check[$key]) {
+ //$errorList->setType(UPLOAD_ERROR_TYPE);
+ if (isset($sizeError_ini[$key])) {
+ $message = vsprintf($sizeError_ini[$key],$maxsize_ini[$key]); //$sizeError_ini[$key];
+ }else if (isset($sizeError_ini["default"])) {
+ $message = vsprintf($sizeError_ini["default"],$maxsize_ini["default"]);
+ } else {
+ $message = _FILE_UPLOAD_ERR_FAILURE;
+ }
+ $fileUpload->setErrorMes($key, $message);
+ continue;
+ //$errorList->add($fileUpload->getName()."[".$key."]", $message);
+ }
+ }
+
+ //
+ // maple.iniで設定されたMIME-Typeではなかった場合
+ //
+ if (count($type_ini) > 0) {
+ if (!$mime_type_check[$key]) {
+ //$errorList->setType(UPLOAD_ERROR_TYPE);
+ if (isset($typeError_ini[$key])) {
+ $message = $typeError_ini[$key];
+ }else if (isset($typeError_ini["default"])) {
+ $message = $typeError_ini["default"];
+ } else {
+ $message = _FILE_UPLOAD_ERR_FILENAME_REJECRED;
+ }
+ $fileUpload->setErrorMes($key, $message);
+ continue;
+ //$errorList->add($fileUpload->getName()."[".$key."]", $message);
+ }
+ }
+
+
+ //
+ // maple.iniで設定された拡張子ではなかった場合
+ //
+ if (count($extension_ini) > 0) {
+ if (!$extension_check[$key]) {
+ //$errorList->setType(UPLOAD_ERROR_TYPE);
+ if (isset($extensionError_ini[$key])) {
+ $message = $extensionError_ini[$key];
+ }else if (isset($extensionError_ini["default"])) {
+ $message = $extensionError_ini["default"];
+ } else {
+ $message = _FILE_UPLOAD_ERR_FILENAME_REJECRED;
+ }
+ $fileUpload->setErrorMes($key, $message);
+ continue;
+ //$errorList->add($fileUpload->getName()."[".$key."]", $message);
+ }
+ }
+
+ //
+ // maple.iniで設定されたWidthを超えていた場合
+ //
+ if (count($maxwidth_ini) > 0) {
+ if (!$filewidth_check[$key]) {
+ //$errorList->setType(UPLOAD_ERROR_TYPE);
+ if (isset($widthError_ini[$key])) {
+ $message = vsprintf($widthError_ini[$key],$maxwidth_ini[$key]);
+ }else if (isset($widthError_ini["default"])) {
+ $message = vsprintf($widthError_ini["default"],$maxwidth_ini["default"]);
+ } else {
+ $message = _FILE_UPLOAD_ERR_FAILURE;
+ }
+ $fileUpload->setErrorMes($key, $message);
+ continue;
+ //$errorList->add($fileUpload->getName()."[".$key."]", $message);
+ }
+ }
+
+ //
+ // maple.iniで設定されたHeightを超えていた場合
+ //
+ if (count($maxheight_ini) > 0) {
+ if (!$fileheight_check[$key]) {
+ //$errorList->setType(UPLOAD_ERROR_TYPE);
+ if (isset($heightError_ini[$key])) {
+ $message = vsprintf($heightError_ini[$key],$maxheight_ini[$key]);
+ }else if (isset($heightError_ini["default"])) {
+ $message = vsprintf($heightError_ini["default"],$maxheight_ini["default"]);
+ } else {
+ $message = _FILE_UPLOAD_ERR_FAILURE;
+ }
+ $fileUpload->setErrorMes($key, $message);
+ continue;
+ //$errorList->add($fileUpload->getName()."[".$key."]", $message);
+ }
+ }
+ }
+ }
+ if (isset($noFileError_whether) && count($error) == $noFileError_whether) {
+ //$errorList->setType(UPLOAD_ERROR_TYPE);
+ $message = $noFileError_ini["whether"];
+ //少なくとも1つファイルを指定しないとならないエラーの場合、先頭のfileのエラーリストに追加する key=0固定
+ $fileUpload->setErrorMes($first_key, $message);
+ //$errorList->add($fileUpload->getName(), $message);
+ }
+
+ //
+ // start_add code
+ // ルーム毎の最大容量チェック
+ //
+ $room_id = intval($request->getParameter("room_id"));
+ if($room_id != 0) {
+ $getdata =& $container->getComponent("GetData");
+ $pages = $getdata->getParameter("pages");
+ if(!isset($pages[$room_id])) {
$pagesView =& $container->getComponent("pagesView");
$page = $pagesView->getPageById($room_id);
- } else {
- $page =& $pages[$room_id];
- }
- $max_capacity = 0;
- if($page['private_flag'] == _ON) {
- $max_capacity = $session->getParameter("_private_max_size");
- } else if($page['space_type'] == _SPACE_TYPE_GROUP) {
- $upload_max_capacity_group = $configView->getConfigByConfname(_SYS_CONF_MODID, "upload_max_capacity_group");
+ } else {
+ $page =& $pages[$room_id];
+ }
+ $max_capacity = 0;
+ if($page['private_flag'] == _ON) {
+ $max_capacity = $session->getParameter("_private_max_size");
+ } else if($page['space_type'] == _SPACE_TYPE_GROUP) {
+ $upload_max_capacity_group = $configView->getConfigByConfname(_SYS_CONF_MODID, "upload_max_capacity_group");
if(isset($upload_max_capacity_group['conf_value'])) {
$max_capacity = intval($upload_max_capacity_group['conf_value']);
} else {
$max_capacity = 0;
}
- } else {
- $upload_max_capacity_public = $configView->getConfigByConfname(_SYS_CONF_MODID, "upload_max_capacity_public");
+ } else {
+ $upload_max_capacity_public = $configView->getConfigByConfname(_SYS_CONF_MODID, "upload_max_capacity_public");
if(isset($upload_max_capacity_public['conf_value'])) {
$max_capacity = intval($upload_max_capacity_public['conf_value']);
} else {
$max_capacity = 0;
}
- }
- if($max_capacity != 0) {
- $filesize = $fileUpload->getFilesize();
- $sum_size = 0;
- foreach($filesize as $size) {
- $sum_size = $size;
- }
- $db =& $container->getComponent("DbObject");
- $db_sum_size = intval($db->sumExecute("uploads", "file_size", array("room_id"=>$room_id)));
- $sum_size += $db_sum_size;
- if ($max_capacity < $sum_size) {
- if($max_capacity-$db_sum_size < 0) {
- $rest_size = 0;
- } else {
- $rest_size = $max_capacity-$db_sum_size;
- }
- // エラー
- $message = sprintf(_FILE_UPLOAD_ERR_MAX_CAPACITY, $page['page_name'], $fileView->formatSize($max_capacity), $fileView->formatSize($rest_size));
-
- // key=0固定
- $stopper = _ON;
- $fileUpload->setErrorMes($first_key, $message);
- }
- }
-
- }
- // 合計サイズチェック
- if(isset($summaxsize_ini)) {
- $filesize = $fileUpload->getFilesize();
- $sum_size = 0;
- foreach($filesize as $size) {
- $sum_size = $size;
- }
- if ($summaxsize_ini < $sum_size) {
- // エラー
- if(isset($sumsizeError_ini)) {
- $message = $sumsizeError_ini;
- } else {
- $message = sprintf(_FILE_UPLOAD_ERR_SUMSIZE_SIZE, $fileView->formatSize($summaxsize_ini));
- }
- // key=0固定
- $stopper = _ON;
- $fileUpload->setErrorMes($first_key, $message);
- }
- }
-
- //end_add code
-
-
- if($message != "" && $stopper == _ON) {
- //stopperがONならば、エラーリストに追加し、アクションを呼ばない(エラーリスト追加)
- //最後に発生したエラーをエラーリストへ追加
- $errorList->setType(UPLOAD_ERROR_TYPE);
- $errorList->add($fileUpload->getName(), $message);
- }
- } else {
- $log->trace("フィールド名が指定されていません", "Filter_FileUpload#execute");
- }
-
- $filterChain =& $container->getComponent("FilterChain");
- $filterChain->execute();
-
- $log->trace("Filter_FileUploadの後処理が実行されました", "Filter_FileUpload#execute");
- }
-
- function constantDef($str) {
- if(defined($str)) {
- return constant($str);
- } else {
- return $str;
- }
- }
-
- function _decompression($name, &$fileUpload) {
- $container =& DIContainerFactory::getContainer();
- $actionChain =& $container->getComponent("ActionChain");
- $session =& $container->getComponent("Session");
- $file_extra =& $container->getComponent("File");
-
- $commonMain =& $container->getComponent("commonMain");
- $fileAction =& $commonMain->registerClass(WEBAPP_DIR.'/components/file/Action.class.php', "File_Action", "fileAction");
-
- $action_name = $actionChain->getCurActionName();
- $pathList = explode("_", $action_name);
-
- $cur_sess_id = $session->getID();
-
- require_once "File/Archive.php";
-
- //
- // テンポラリーディレクトリ作成
- //
- if(!file_exists(FILEUPLOADS_DIR.$pathList[0])) {
- mkdir(FILEUPLOADS_DIR.$pathList[0], octdec(_UPLOAD_FOLDER_MODE));
- }
- $file_path = $pathList[0]."/".strtolower($cur_sess_id);
+ }
+ if($max_capacity != 0) {
+ $filesize = $fileUpload->getFilesize();
+ $sum_size = 0;
+ foreach($filesize as $size) {
+ $sum_size = $size;
+ }
+ $db =& $container->getComponent("DbObject");
+ $db_sum_size = intval($db->sumExecute("uploads", "file_size", array("room_id"=>$room_id)));
+ $sum_size += $db_sum_size;
+ if ($max_capacity < $sum_size) {
+ if($max_capacity-$db_sum_size < 0) {
+ $rest_size = 0;
+ } else {
+ $rest_size = $max_capacity-$db_sum_size;
+ }
+ // エラー
+ $message = sprintf(_FILE_UPLOAD_ERR_MAX_CAPACITY, $page['page_name'], $fileView->formatSize($max_capacity), $fileView->formatSize($rest_size));
+
+ // key=0固定
+ $stopper = _ON;
+ $fileUpload->setErrorMes($first_key, $message);
+ }
+ }
+
+ }
+ // 合計サイズチェック
+ if(isset($summaxsize_ini)) {
+ $filesize = $fileUpload->getFilesize();
+ $sum_size = 0;
+ foreach($filesize as $size) {
+ $sum_size = $size;
+ }
+ if ($summaxsize_ini < $sum_size) {
+ // エラー
+ if(isset($sumsizeError_ini)) {
+ $message = $sumsizeError_ini;
+ } else {
+ $message = sprintf(_FILE_UPLOAD_ERR_SUMSIZE_SIZE, $fileView->formatSize($summaxsize_ini));
+ }
+ // key=0固定
+ $stopper = _ON;
+ $fileUpload->setErrorMes($first_key, $message);
+ }
+ }
+
+ //end_add code
+
+
+ if($message != "" && $stopper == _ON) {
+ //stopperがONならば、エラーリストに追加し、アクションを呼ばない(エラーリスト追加)
+ //最後に発生したエラーをエラーリストへ追加
+ $errorList->setType(UPLOAD_ERROR_TYPE);
+ $errorList->add($fileUpload->getName(), $message);
+ }
+ } else {
+ $log->trace("フィールド名が指定されていません", "Filter_FileUpload#execute");
+ }
+
+ $filterChain =& $container->getComponent("FilterChain");
+ $filterChain->execute();
+
+ $log->trace("Filter_FileUploadの後処理が実行されました", "Filter_FileUpload#execute");
+ }
+
+ function constantDef($str) {
+ if(defined($str)) {
+ return constant($str);
+ } else {
+ return $str;
+ }
+ }
+
+ function _decompression($name, &$fileUpload) {
+ $container =& DIContainerFactory::getContainer();
+ $actionChain =& $container->getComponent("ActionChain");
+ $session =& $container->getComponent("Session");
+ $file_extra =& $container->getComponent("File");
+
+ $commonMain =& $container->getComponent("commonMain");
+ $fileAction =& $commonMain->registerClass(WEBAPP_DIR.'/components/file/Action.class.php', "File_Action", "fileAction");
+
+ $action_name = $actionChain->getCurActionName();
+ $pathList = explode("_", $action_name);
+
+ $cur_sess_id = $session->getID();
+
+ require_once "File/Archive.php";
+
+ //
+ // テンポラリーディレクトリ作成
+ //
+ if(!file_exists(FILEUPLOADS_DIR.$pathList[0])) {
+ mkdir(FILEUPLOADS_DIR.$pathList[0], octdec(_UPLOAD_FOLDER_MODE));
+ }
+ $file_path = $pathList[0]."/".strtolower($cur_sess_id);
if (file_exists(FILEUPLOADS_DIR.$file_path)) {
- $result = $fileAction->delDir(FILEUPLOADS_DIR.$file_path);
- if ($result === false) {
- return false;
- }
- }
-
- mkdir(FILEUPLOADS_DIR.$file_path, octdec(_UPLOAD_FOLDER_MODE));
-
- //
- // 圧縮ファイル取得
- //
- $files = $file_extra->getParameterRef($name);
+ $result = $fileAction->delDir(FILEUPLOADS_DIR.$file_path);
+ if ($result === false) {
+ return false;
+ }
+ }
+
+ mkdir(FILEUPLOADS_DIR.$file_path, octdec(_UPLOAD_FOLDER_MODE));
+
+ //
+ // 圧縮ファイル取得
+ //
+ $files = $file_extra->getParameterRef($name);
$file_name = FILEUPLOADS_DIR.$file_path."/".$files['name'];
//
@@ -713,24 +756,24 @@ function _decompression($name, &$fileUpload) {
// $fileUpload->moveで移動してしまうとエラーとなる。
//
$fileUpload->move(0, $file_name);
-
- //
- // 圧縮ファイル解凍
- //
+
+ //
+ // 圧縮ファイル解凍
+ //
File_Archive::extract(File_Archive::read($file_name."/"), $dest = FILEUPLOADS_DIR.$file_path);
-
+
+ //
+ // 圧縮ファイル削除
//
- // 圧縮ファイル削除
- //
$fileAction->delDir($file_name);
-
+
+ //
+ // 解凍したファイルをアップロードファイルとしてセット
//
- // 解凍したファイルをアップロードファイルとしてセット
- //
- $commonMain =& $container->getComponent("commonMain");
+ $commonMain =& $container->getComponent("commonMain");
$uploadsAction =& $commonMain->registerClass(WEBAPP_DIR.'/components/uploads/Action.class.php', "Uploads_Action", "uploadsAction");
-
+
$uploadsAction->setFileByPath(FILEUPLOADS_DIR.$file_path, $name);
- }
+ }
}
?>
\ No newline at end of file
diff --git a/html/maple/filter/Filter_Mobile.class.php b/html/maple/filter/Filter_Mobile.class.php
index 6e32614..8912b07 100644
--- a/html/maple/filter/Filter_Mobile.class.php
+++ b/html/maple/filter/Filter_Mobile.class.php
@@ -1,418 +1,418 @@
-_container =& DIContainerFactory::getContainer();
- $this->_log =& LogFactory::getLog();
- $this->_filterChain =& $this->_container->getComponent("FilterChain");
- $this->_actionChain =& $this->_container->getComponent("ActionChain");
- $this->_db =& $this->_container->getComponent("DbObject");
- $this->_session =& $this->_container->getComponent("Session");
- $this->_request =& $this->_container->getComponent("Request");
- $this->_modulesView =& $this->_container->getComponent("modulesView");
- //$this->_mobile_obj = $this->_modulesView->getModuleByDirname("mobile");
- $this->_usersView =& $this->_container->getComponent("usersView");
-
- //mb_stringがロードされているかどうか
- if (!extension_loaded('mbstring') && !function_exists("mb_convert_encoding")) {
- include_once MAPLE_DIR . '/includes/mbstring.php';
- } else if(function_exists("mb_detect_order")){
- mb_detect_order(_MB_DETECT_ORDER_VALUE);
- }
- if (function_exists("mb_internal_encoding")) {
- mb_internal_encoding(INTERNAL_CODE);
- }
- if (function_exists("mb_language")) {
- mb_language("Japanese");
- }
-
- $this->_log->trace("{$this->_classname}の前処理が実行されました", "{$this->_classname}#execute");
- $this->_preFilter();
-
- $this->_filterChain->execute();
-
- $this->_log->trace("{$this->_classname}の後処理が実行されました", "{$this->_classname}#execute");
- $this->_postFilter();
- }
-
- /**
- * プレフィルタ
- *
- * @access private
- */
- function _preFilter()
- {
- require_once( WEBAPP_DIR . "/config/mobile.inc.php" );
-
- $this->_session->setParameter("_mobile_flag", _OFF);
- $this->_session->setParameter("_smartphone_flag", _OFF);
- //if (!$this->_mobile_obj) { return; }
-
- // 読み上げソフト対応
- $actionName = $this->_actionChain->getCurActionName();
- if ($actionName == DEFAULT_MOBILE_ACTION) {
- $reader_flag = $this->_request->getParameter("reader_flag");
- if (isset($reader_flag)) {
- $reader_flag = intval($reader_flag);
- } else {
- $reader_flag = intval($this->_session->getParameter("_reader_flag"));
- }
- } else {
- $reader_flag = intval($this->_session->getParameter("_reader_flag"));
- }
- // スマートフォンPCビューアー切り替え対応
- if($actionName == DEFAULT_ACTION) {
- $pcviewer_flag = $this->_request->getParameter('pcviewer_flag');
- if (isset($pcviewer_flag)) {
- $pcviewer_flag = intval($pcviewer_flag);
- $this->_session->setParameter('_pcviewer_flag', $pcviewer_flag);
- } else {
- $pcviewer_flag = intval($this->_session->getParameter('_pcviewer_flag'));
- }
- } else {
- $pcviewer_flag = intval($this->_session->getParameter('_pcviewer_flag'));
- }
- if($pcviewer_flag == _ON){
- return;
- }
-
- if (in_array($actionName, $this->_clear_page_id)) {
- $this->_session->removeParameter("_mobile_page_id");
- $this->_session->removeParameter("_mobile_room_id");
- $this->_session->removeParameter("_mobile_module_id");
- }
- if (in_array($actionName, $this->_clear_reader)) {
- $this->_session->removeParameter("_reader_flag");
- } else {
- $this->_session->setParameter("_reader_flag", $reader_flag);
- }
-
- $mobileCheck =& MobileCheck::getInstance();
- if ($mobileCheck->isMobile() == _OFF) { return; }
- $mobile_info = $mobileCheck->getMobileInfo();
- $mobile_obj = $this->_modulesView->getModuleByDirname("mobile");
-
- $configView =& $this->_container->getComponent("configView");
- $config = $configView->getConfig($mobile_obj["module_id"], false);
- if ($config == false) { return; }
- if ($config["allow_emulator"]["conf_value"] == _OFF && !$mobile_info["proper_route"]) { return; }
-
- // この人物が携帯をどのようなモードで見ようとしているかを取得
- $texthtml_mode = -1;
- $imgdsp_size = -1;
- $user_id = $this->_session->getParameter("_user_id");
- if( $user_id != '0' ) {
- $texthtml_mode_item_id = $this->_usersView->getItemIdByTagName( "mobile_texthtml_mode" );
- $imgdsp_size_item_id = $this->_usersView->getItemIdByTagName( "mobile_imgdsp_size" );
- $user_items = $this->_usersView->getUserItemLinkById( $user_id );
- if( isset( $user_items[ $texthtml_mode_item_id ] ) && $user_items[ $texthtml_mode_item_id ]['content'] != "" ) {
- $texthtml_mode = constant( str_replace( "USER_ITEM", "MOBILE", trim( $user_items[ $texthtml_mode_item_id ]['content'], "|" ) ) );
- }
- if( isset( $user_items[ $imgdsp_size_item_id ] ) && $user_items[ $imgdsp_size_item_id ]['content'] != "" ) {
- $imgdsp_size = constant( str_replace( "USER_ITEM", "MOBILE", trim( $user_items[ $imgdsp_size_item_id ]['content'], "|" ) ) );
- }
- }
- if( $texthtml_mode == -1 ) {
- $texthtml_mode = $config["mobile_text_html_mode"]["conf_value"];
- }
- if( $imgdsp_size == -1 ) {
- $imgdsp_size = $config["mobile_imgdsp_size"]["conf_value"];
- }
- $this->_session->setParameter("_mobile_text_html_mode", $texthtml_mode);
- $this->_session->setParameter("_mobile_imgdsp_size", $imgdsp_size);
-
- $this->_session->setParameter("_mobile_info", $mobile_info);
- $this->_session->setParameter("_mobile_flag", _ON);
- if($mobileCheck->isSmartPhone() == true) {
- $this->_session->setParameter('_smartphone_flag', _ON);
- }
-
- $action_name = $this->_request->getParameter("action");
- $page_id = intval($this->_request->getParameter("page_id"));
- $room_id = intval($this->_request->getParameter("room_id"));
- if (!isset($page_id)) {
- $page_id = intval($this->_session->getParameter("_mobile_page_id"));
- }
- $room_id = $this->_request->getParameter("room_id");
- if (!isset($room_id)) {
- $room_id = intval($this->_session->getParameter("_mobile_room_id"));
- }
- $block_id = intval($this->_request->getParameter("block_id"));
-
-
- $mobileView =& $this->_container->getComponent("mobileView");
- $getdata =& $this->_container->getComponent("GetData");
-
- $mobile_modules = $mobileView->getModules(null, array($this,"_callbackFunc"));
- $getdata->setParameter("mobile_modules", $mobile_modules);
-
- $active_action = $this->_request->getParameter("active_action");
- if ($active_action != "") {
- $params = $this->_request->getParameters();
-
- $this->_request->setParameter("action", $active_action);
- $this->_request->setParameter("active_action", null);
- $this->_request->setParameter(_ABBREVIATE_URL_REQUEST_KEY, null);
-
- $params = $this->_request->getParameters();
- $str_params = "";
- foreach($params as $key => $value) {
- if (empty($value) || is_array($value)) { continue; }
- if (substr($key, 0, 1) == "_") { continue; }
-
- $key = htmlspecialchars($key, ENT_QUOTES);
- if ($key == session_name()) {
- $value = session_id();
- } else {
- $value = rawurlencode($value);
- }
- $str_params .= "&" . $key."=".$value;
- }
-
- if ($this->_session->getParameter("_user_id") == "" && $block_id > 0) {
- $blocksView =& $this->_container->getComponent("blocksView");
- $blocks = $blocksView->getBlockById($block_id);
- if (empty($blocks)) {
- header('Location: '.BASE_URL.INDEX_FILE_NAME);
- exit;
- }
-
- $authCheck =& $this->_container->getComponent("authCheck");
- $result = $authCheck->getPageAuthId(null, $blocks["page_id"]);
- if ($result == _AUTH_OTHER) {
- if ($reader_flag == _ON) {
- $session_param = "";
- } else {
- $session_param = "&".session_name()."=".session_id();
- }
- $this->_session->setParameter("_mobile_redirect_url", $str_params);
- header('Location: '.BASE_URL.INDEX_FILE_NAME."?".ACTION_KEY."=".$mobile_modules[_DISPLAY_POSITION_HEADER]["login"]["mobile_action_name"].$session_param);
- exit;
- }
- }
-
- $this->_session->removeParameter("_mobile_redirect_url");
- header('Location: '.BASE_URL.INDEX_FILE_NAME."?".substr($str_params, 1));
- exit;
-
- } elseif ($action_name == DEFAULT_ACTION) {
- $parameters = (!empty($page_id) ? "&page_id=".$page_id."&room_id=".intval($room_id) : "").(!empty($block_id) ? "&block_id=".$block_id : "");
- if ($reader_flag == _OFF) {
- $parameters .= "&".session_name()."=".session_id();
- }
- $action_name = DEFAULT_MOBILE_ACTION;
- if (!empty($block_id)) {
- $blocksView =& $this->_container->getComponent("blocksView");
- $modulesView =& $this->_container->getComponent("modulesView");
- $blocks = $blocksView->getBlockById($block_id);
- if (!empty($blocks)) {
- $modules = $modulesView->getModulesById($blocks["module_id"]);
- if (!empty($modules)) {
- $action_name = $modules["action_name"];
- }
- }
- }
- header('Location: '.BASE_URL.INDEX_FILE_NAME."?".ACTION_KEY."=".$action_name.$parameters);
- exit;
- }
-
- $this->_session->setParameter("_mobile_default_module", $config["default_module"]["conf_value"]);
-
- /*
- * リクエストの変換
- */
- $action =& $this->_actionChain->getCurAction();
- $attributes = $this->getAttributes();
- //if (empty($attributes)) { return; }
-
- $params = $this->_request->getParameters();
- $this->_strtoconvert($params);
- $this->_request->clear();
- $this->_request->setParameters($params);
-
- foreach ($attributes as $key=>$value) {
- $keyArr = explode(":", $key);
- $parameter = null;
- if ($keyArr[0] == "date" || $keyArr[0] == "input_date" || $keyArr[0] == "time" || $keyArr[0] == "time12" || $keyArr[0] == "full_date" || $keyArr[0] == "full_time") {
- $valArr = explode(",", $keyArr[1]);
- if (($keyArr[0] == "date" || $keyArr[0] == "input_date") && count($valArr) == 3 ||
- $keyArr[0] == "time" && count($valArr) <= 3 ||
- $keyArr[0] == "time12" && count($valArr) > 0 && count($valArr) <= 4 && (strtolower($valArr[0]) == "am" || strtolower($valArr[0]) == "pm") ||
- ($keyArr[0] == "full_date" || $keyArr[0] == "full_time") && count($valArr) == 6) {
-
- foreach ($valArr as $i=>$val) {
- $valArr[$i] = $this->_request->getParameter($val);
- }
- if ($keyArr[0] == "date") {
- list($month, $day, $year) = $valArr;
- list($hour, $min, $sec) = array(0,0,0);
- } elseif ($keyArr[0] == "input_date") {
- list($month, $day, $year) = $valArr;
- list($hour, $min, $sec) = array(0,0,0);
- } elseif ($keyArr[0] == "time") {
- list($month, $day, $year) = array(date("m"), date("d"), date("Y"));
- if (count($valArr) < 1) { $valArr[0] = 0; }
- if (count($valArr) < 2) { $valArr[1] = 0; }
- if (count($valArr) < 3) { $valArr[2] = 0; }
- list($hour, $min, $sec) = $valArr;
- } elseif ($keyArr[0] == "time12") {
- list($month, $day, $year) = array(date("m"), date("d"), date("Y"));
- if (count($valArr) < 2) { $valArr[1] = 0; }
- if (count($valArr) < 3) { $valArr[2] = 0; }
- if (count($valArr) < 4) { $valArr[3] = 0; }
- list($am_pm, $hour, $min, $sec) = $valArr;
- if (strtolower($am_pm) == "pm") {
- $hour = intval($hour) + 12;
- }
- } else {
- list($hour, $min, $sec, $month, $day, $year) = $valArr;
- }
- if ($keyArr[0] == "time" || $keyArr[0] == "time12" || $keyArr[0] != "time" && $keyArr[0] != "time12" && checkdate(intval($month),intval($day),intval($year))) {
- if ($keyArr[0] == "date" && empty($keyArr[2])) { $keyArr[2] = _DATE_FORMAT; }
- if ($keyArr[0] == "input_date" && empty($keyArr[2])) { $keyArr[2] = _INPUT_DATE_FORMAT; }
- if (($keyArr[0] == "time" || $keyArr[0] == "time12") && empty($keyArr[2])) { $keyArr[2] = _TIME_FORMAT; }
- if (($keyArr[0] == "full_date" || $keyArr[0] == "full_time") && empty($keyArr[2])) { $keyArr[2] = _FULL_DATE_FORMAT; }
- $parameter = date($keyArr[2], mktime(intval($hour), intval($min), intval($sec), intval($month), intval($day), intval($year)));
- $this->_request->setParameter($value, $parameter);
- continue;
- } else {
- $paramArr = explode(",", $keyArr[1]);
- }
- } else {
- $paramArr = explode(",", $keyArr[1]);
- }
- } else {
- $paramArr = explode(",", $key);
- }
- foreach ($paramArr as $i=>$keyVal) {
- $str = $this->_request->getParameter($keyVal);
- if (!isset($str)) { continue; }
- $parameter .= $str;
- }
- if (!isset($parameter)) { continue; }
- $this->_request->setParameter($value, $parameter);
- }
-
- }
- /**
- * 携帯モジュール取得
- *
- * @access private
- */
- function _callbackFunc(&$recordSet)
- {
- $result = array();
- while ($row = $recordSet->fetchRow()) {
- $pathList = explode("_", $row["mobile_action_name"]);
- $row["dir_name"] = $pathList[0];
- $row["module_name"] = $this->_modulesView->loadModuleName($row["dir_name"]);
- $result[$row["display_position"]][$row["dir_name"]] = $row;
- }
- return $result;
- }
- /**
- * 携帯モジュール取得
- *
- * @access private
- */
- function _strtoconvert(&$params)
- {
- foreach (array_keys($params) as $key) {
- if (is_array($params[$key])) {
- $this->_strtoconvert($params[$key]);
- } else {
- $params[$key] = mb_convert_encoding($params[$key], "utf-8", "auto");
- }
- }
- }
-
- /**
- * ポストフィルタ
- *
- * @access private
- */
- function _postFilter()
- {
- //if (!$this->_mobile_obj) { return true; }
-
- $tel_id = $this->_session->getParameter("_mobile_tel_id");
- if (!empty($tel_id)) {
- $user_id = $this->_session->getParameter("_user_id");
- $result = $this->_db->updateExecute("mobile_users", array(), array("user_id"=>$user_id), true);
- if ($result === false) {
- return false;
- }
-
- if (rand(0, 10) != 0) {
- $maxlifetime = $this->_session->getParameter('_session_gc_maxlifetime');
- $time = timezone_date();
- $timestamp = mktime(intval(substr($time,8,2)),intval(substr($time,10,2))-$maxlifetime,intval(substr($time,12,2)),
- intval(substr($time,4,2)),intval(substr($time,6,2)),intval(substr($time,0,4)));
- $sql = "DELETE FROM {mobile_users} WHERE update_time < ?";
- $result = $this->_db->execute($sql, array("update_time"=>date("YmdHis", $timestamp)));
- if ($result === false) {
- $this->_db->addError();
- return false;
- }
- }
- }
-
- $page_id = intval($this->_request->getParameter("page_id"));
- if ($page_id > 0) {
- $this->_session->setParameter("_mobile_page_id", $page_id);
- }
- $room_id = intval($this->_request->getParameter("room_id"));
- if ($room_id > 0) {
- $this->_session->setParameter("_mobile_room_id", $room_id);
- }
- $module_id = intval($this->_request->getParameter("module_id"));
- if ($module_id > 0) {
- $this->_session->setParameter("_mobile_module_id", $module_id);
- }
- }
-}
-?>
+_container =& DIContainerFactory::getContainer();
+ $this->_log =& LogFactory::getLog();
+ $this->_filterChain =& $this->_container->getComponent("FilterChain");
+ $this->_actionChain =& $this->_container->getComponent("ActionChain");
+ $this->_db =& $this->_container->getComponent("DbObject");
+ $this->_session =& $this->_container->getComponent("Session");
+ $this->_request =& $this->_container->getComponent("Request");
+ $this->_modulesView =& $this->_container->getComponent("modulesView");
+ //$this->_mobile_obj = $this->_modulesView->getModuleByDirname("mobile");
+ $this->_usersView =& $this->_container->getComponent("usersView");
+
+ //mb_stringがロードされているかどうか
+ if (!extension_loaded('mbstring') && !function_exists("mb_convert_encoding")) {
+ include_once MAPLE_DIR . '/includes/mbstring.php';
+ } else if(function_exists("mb_detect_order")){
+ mb_detect_order(_MB_DETECT_ORDER_VALUE);
+ }
+ if (function_exists("mb_internal_encoding")) {
+ mb_internal_encoding(INTERNAL_CODE);
+ }
+ if (function_exists("mb_language")) {
+ mb_language("Japanese");
+ }
+
+ $this->_log->trace("{$this->_classname}の前処理が実行されました", "{$this->_classname}#execute");
+ $this->_preFilter();
+
+ $this->_filterChain->execute();
+
+ $this->_log->trace("{$this->_classname}の後処理が実行されました", "{$this->_classname}#execute");
+ $this->_postFilter();
+ }
+
+ /**
+ * プレフィルタ
+ *
+ * @access private
+ */
+ function _preFilter()
+ {
+ require_once( WEBAPP_DIR . "/config/mobile.inc.php" );
+
+ $this->_session->setParameter("_mobile_flag", _OFF);
+ $this->_session->setParameter("_smartphone_flag", _OFF);
+ //if (!$this->_mobile_obj) { return; }
+
+ // 読み上げソフト対応
+ $actionName = $this->_actionChain->getCurActionName();
+ if ($actionName == DEFAULT_MOBILE_ACTION) {
+ $reader_flag = $this->_request->getParameter("reader_flag");
+ if (isset($reader_flag)) {
+ $reader_flag = intval($reader_flag);
+ } else {
+ $reader_flag = intval($this->_session->getParameter("_reader_flag"));
+ }
+ } else {
+ $reader_flag = intval($this->_session->getParameter("_reader_flag"));
+ }
+ // スマートフォンPCビューアー切り替え対応
+ if($actionName == DEFAULT_ACTION) {
+ $pcviewer_flag = $this->_request->getParameter('pcviewer_flag');
+ if (isset($pcviewer_flag)) {
+ $pcviewer_flag = intval($pcviewer_flag);
+ $this->_session->setParameter('_pcviewer_flag', $pcviewer_flag);
+ } else {
+ $pcviewer_flag = intval($this->_session->getParameter('_pcviewer_flag'));
+ }
+ } else {
+ $pcviewer_flag = intval($this->_session->getParameter('_pcviewer_flag'));
+ }
+ if($pcviewer_flag == _ON){
+ return;
+ }
+
+ if (in_array($actionName, $this->_clear_page_id)) {
+ $this->_session->removeParameter("_mobile_page_id");
+ $this->_session->removeParameter("_mobile_room_id");
+ $this->_session->removeParameter("_mobile_module_id");
+ }
+ if (in_array($actionName, $this->_clear_reader)) {
+ $this->_session->removeParameter("_reader_flag");
+ } else {
+ $this->_session->setParameter("_reader_flag", $reader_flag);
+ }
+
+ $mobileCheck =& MobileCheck::getInstance();
+ if ($mobileCheck->isMobile() == _OFF) { return; }
+ $mobile_info = $mobileCheck->getMobileInfo();
+ $mobile_obj = $this->_modulesView->getModuleByDirname("mobile");
+
+ $configView =& $this->_container->getComponent("configView");
+ $config = $configView->getConfig($mobile_obj["module_id"], false);
+ if ($config == false) { return; }
+ if ($config["allow_emulator"]["conf_value"] == _OFF && !$mobile_info["proper_route"]) { return; }
+
+ // この人物が携帯をどのようなモードで見ようとしているかを取得
+ $texthtml_mode = -1;
+ $imgdsp_size = -1;
+ $user_id = $this->_session->getParameter("_user_id");
+ if( $user_id != '0' ) {
+ $texthtml_mode_item_id = $this->_usersView->getItemIdByTagName( "mobile_texthtml_mode" );
+ $imgdsp_size_item_id = $this->_usersView->getItemIdByTagName( "mobile_imgdsp_size" );
+ $user_items = $this->_usersView->getUserItemLinkById( $user_id );
+ if( isset( $user_items[ $texthtml_mode_item_id ] ) && $user_items[ $texthtml_mode_item_id ]['content'] != "" ) {
+ $texthtml_mode = constant( str_replace( "USER_ITEM", "MOBILE", trim( $user_items[ $texthtml_mode_item_id ]['content'], "|" ) ) );
+ }
+ if( isset( $user_items[ $imgdsp_size_item_id ] ) && $user_items[ $imgdsp_size_item_id ]['content'] != "" ) {
+ $imgdsp_size = constant( str_replace( "USER_ITEM", "MOBILE", trim( $user_items[ $imgdsp_size_item_id ]['content'], "|" ) ) );
+ }
+ }
+ if( $texthtml_mode == -1 ) {
+ $texthtml_mode = $config["mobile_text_html_mode"]["conf_value"];
+ }
+ if( $imgdsp_size == -1 ) {
+ $imgdsp_size = $config["mobile_imgdsp_size"]["conf_value"];
+ }
+ $this->_session->setParameter("_mobile_text_html_mode", $texthtml_mode);
+ $this->_session->setParameter("_mobile_imgdsp_size", $imgdsp_size);
+
+ $this->_session->setParameter("_mobile_info", $mobile_info);
+ $this->_session->setParameter("_mobile_flag", _ON);
+ if($mobileCheck->isSmartPhone() == true) {
+ $this->_session->setParameter('_smartphone_flag', _ON);
+ }
+
+ $action_name = $this->_request->getParameter("action");
+ $page_id = intval($this->_request->getParameter("page_id"));
+ $room_id = intval($this->_request->getParameter("room_id"));
+ if (!isset($page_id)) {
+ $page_id = intval($this->_session->getParameter("_mobile_page_id"));
+ }
+ $room_id = $this->_request->getParameter("room_id");
+ if (!isset($room_id)) {
+ $room_id = intval($this->_session->getParameter("_mobile_room_id"));
+ }
+ $block_id = intval($this->_request->getParameter("block_id"));
+
+
+ $mobileView =& $this->_container->getComponent("mobileView");
+ $getdata =& $this->_container->getComponent("GetData");
+
+ $mobile_modules = $mobileView->getModules(null, array($this,"_callbackFunc"));
+ $getdata->setParameter("mobile_modules", $mobile_modules);
+
+ $active_action = $this->_request->getParameter("active_action");
+ if ($active_action != "") {
+ $params = $this->_request->getParameters();
+
+ $this->_request->setParameter("action", $active_action);
+ $this->_request->setParameter("active_action", null);
+ $this->_request->setParameter(_ABBREVIATE_URL_REQUEST_KEY, null);
+
+ $params = $this->_request->getParameters();
+ $str_params = "";
+ foreach($params as $key => $value) {
+ if (empty($value) || is_array($value)) { continue; }
+ if (substr($key, 0, 1) == "_") { continue; }
+
+ $key = htmlspecialchars($key, ENT_QUOTES);
+ if ($key == session_name()) {
+ $value = session_id();
+ } else {
+ $value = rawurlencode($value);
+ }
+ $str_params .= "&" . $key."=".$value;
+ }
+
+ if ($this->_session->getParameter("_user_id") == "" && $block_id > 0) {
+ $blocksView =& $this->_container->getComponent("blocksView");
+ $blocks = $blocksView->getBlockById($block_id);
+ if (empty($blocks)) {
+ header('Location: '.BASE_URL.INDEX_FILE_NAME);
+ exit;
+ }
+
+ $authCheck =& $this->_container->getComponent("authCheck");
+ $result = $authCheck->getPageAuthId(null, $blocks["page_id"]);
+ if ($result == _AUTH_OTHER) {
+ if ($reader_flag == _ON) {
+ $session_param = "";
+ } else {
+ $session_param = "&".session_name()."=".session_id();
+ }
+ $this->_session->setParameter("_mobile_redirect_url", $str_params);
+ header('Location: '.BASE_URL.INDEX_FILE_NAME."?".ACTION_KEY."=".$mobile_modules[_DISPLAY_POSITION_HEADER]["login"]["mobile_action_name"].$session_param);
+ exit;
+ }
+ }
+
+ $this->_session->removeParameter("_mobile_redirect_url");
+ header('Location: '.BASE_URL.INDEX_FILE_NAME."?".substr($str_params, 1));
+ exit;
+
+ } elseif ($action_name == DEFAULT_ACTION) {
+ $parameters = (!empty($page_id) ? "&page_id=".$page_id."&room_id=".intval($room_id) : "").(!empty($block_id) ? "&block_id=".$block_id : "");
+ if ($reader_flag == _OFF) {
+ $parameters .= "&".session_name()."=".session_id();
+ }
+ $action_name = DEFAULT_MOBILE_ACTION;
+ if (!empty($block_id)) {
+ $blocksView =& $this->_container->getComponent("blocksView");
+ $modulesView =& $this->_container->getComponent("modulesView");
+ $blocks = $blocksView->getBlockById($block_id);
+ if (!empty($blocks)) {
+ $modules = $modulesView->getModulesById($blocks["module_id"]);
+ if (!empty($modules)) {
+ $action_name = $modules["action_name"];
+ }
+ }
+ }
+ header('Location: '.BASE_URL.INDEX_FILE_NAME."?".ACTION_KEY."=".$action_name.$parameters);
+ exit;
+ }
+
+ $this->_session->setParameter("_mobile_default_module", $config["default_module"]["conf_value"]);
+
+ /*
+ * リクエストの変換
+ */
+ $action =& $this->_actionChain->getCurAction();
+ $attributes = $this->getAttributes();
+ //if (empty($attributes)) { return; }
+
+ $params = $this->_request->getParameters();
+ $this->_strtoconvert($params);
+ $this->_request->clear();
+ $this->_request->setParameters($params);
+
+ foreach ($attributes as $key=>$value) {
+ $keyArr = explode(":", $key);
+ $parameter = null;
+ if ($keyArr[0] == "date" || $keyArr[0] == "input_date" || $keyArr[0] == "time" || $keyArr[0] == "time12" || $keyArr[0] == "full_date" || $keyArr[0] == "full_time") {
+ $valArr = explode(",", $keyArr[1]);
+ if (($keyArr[0] == "date" || $keyArr[0] == "input_date") && count($valArr) == 3 ||
+ $keyArr[0] == "time" && count($valArr) <= 3 ||
+ $keyArr[0] == "time12" && count($valArr) > 0 && count($valArr) <= 4 && (strtolower($valArr[0]) == "am" || strtolower($valArr[0]) == "pm") ||
+ ($keyArr[0] == "full_date" || $keyArr[0] == "full_time") && count($valArr) == 6) {
+
+ foreach ($valArr as $i=>$val) {
+ $valArr[$i] = $this->_request->getParameter($val);
+ }
+ if ($keyArr[0] == "date") {
+ list($month, $day, $year) = $valArr;
+ list($hour, $min, $sec) = array(0,0,0);
+ } elseif ($keyArr[0] == "input_date") {
+ list($month, $day, $year) = $valArr;
+ list($hour, $min, $sec) = array(0,0,0);
+ } elseif ($keyArr[0] == "time") {
+ list($month, $day, $year) = array(date("m"), date("d"), date("Y"));
+ if (count($valArr) < 1) { $valArr[0] = 0; }
+ if (count($valArr) < 2) { $valArr[1] = 0; }
+ if (count($valArr) < 3) { $valArr[2] = 0; }
+ list($hour, $min, $sec) = $valArr;
+ } elseif ($keyArr[0] == "time12") {
+ list($month, $day, $year) = array(date("m"), date("d"), date("Y"));
+ if (count($valArr) < 2) { $valArr[1] = 0; }
+ if (count($valArr) < 3) { $valArr[2] = 0; }
+ if (count($valArr) < 4) { $valArr[3] = 0; }
+ list($am_pm, $hour, $min, $sec) = $valArr;
+ if (strtolower($am_pm) == "pm") {
+ $hour = intval($hour) + 12;
+ }
+ } else {
+ list($hour, $min, $sec, $month, $day, $year) = $valArr;
+ }
+ if ($keyArr[0] == "time" || $keyArr[0] == "time12" || $keyArr[0] != "time" && $keyArr[0] != "time12" && checkdate(intval($month),intval($day),intval($year))) {
+ if ($keyArr[0] == "date" && empty($keyArr[2])) { $keyArr[2] = _DATE_FORMAT; }
+ if ($keyArr[0] == "input_date" && empty($keyArr[2])) { $keyArr[2] = _INPUT_DATE_FORMAT; }
+ if (($keyArr[0] == "time" || $keyArr[0] == "time12") && empty($keyArr[2])) { $keyArr[2] = _TIME_FORMAT; }
+ if (($keyArr[0] == "full_date" || $keyArr[0] == "full_time") && empty($keyArr[2])) { $keyArr[2] = _FULL_DATE_FORMAT; }
+ $parameter = date($keyArr[2], mktime(intval($hour), intval($min), intval($sec), intval($month), intval($day), intval($year)));
+ $this->_request->setParameter($value, $parameter);
+ continue;
+ } else {
+ $paramArr = explode(",", $keyArr[1]);
+ }
+ } else {
+ $paramArr = explode(",", $keyArr[1]);
+ }
+ } else {
+ $paramArr = explode(",", $key);
+ }
+ foreach ($paramArr as $i=>$keyVal) {
+ $str = $this->_request->getParameter($keyVal);
+ if (!isset($str)) { continue; }
+ $parameter .= $str;
+ }
+ if (!isset($parameter)) { continue; }
+ $this->_request->setParameter($value, $parameter);
+ }
+
+ }
+ /**
+ * 携帯モジュール取得
+ *
+ * @access private
+ */
+ function _callbackFunc(&$recordSet)
+ {
+ $result = array();
+ while ($row = $recordSet->fetchRow()) {
+ $pathList = explode("_", $row["mobile_action_name"]);
+ $row["dir_name"] = $pathList[0];
+ $row["module_name"] = $this->_modulesView->loadModuleName($row["dir_name"]);
+ $result[$row["display_position"]][$row["dir_name"]] = $row;
+ }
+ return $result;
+ }
+ /**
+ * 携帯モジュール取得
+ *
+ * @access private
+ */
+ function _strtoconvert(&$params)
+ {
+ foreach (array_keys($params) as $key) {
+ if (is_array($params[$key])) {
+ $this->_strtoconvert($params[$key]);
+ } else {
+ $params[$key] = mb_convert_encoding($params[$key], "utf-8", "auto");
+ }
+ }
+ }
+
+ /**
+ * ポストフィルタ
+ *
+ * @access private
+ */
+ function _postFilter()
+ {
+ //if (!$this->_mobile_obj) { return true; }
+
+ $tel_id = $this->_session->getParameter("_mobile_tel_id");
+ if (!empty($tel_id)) {
+ $user_id = $this->_session->getParameter("_user_id");
+ $result = $this->_db->updateExecute("mobile_users", array(), array("user_id"=>$user_id), true);
+ if ($result === false) {
+ return false;
+ }
+
+ if (rand(0, 10) != 0) {
+ $maxlifetime = $this->_session->getParameter('_session_gc_maxlifetime');
+ $time = timezone_date();
+ $timestamp = mktime(intval(substr($time,8,2)),intval(substr($time,10,2))-$maxlifetime,intval(substr($time,12,2)),
+ intval(substr($time,4,2)),intval(substr($time,6,2)),intval(substr($time,0,4)));
+ $sql = "DELETE FROM {mobile_users} WHERE update_time < ?";
+ $result = $this->_db->execute($sql, array("update_time"=>date("YmdHis", $timestamp)));
+ if ($result === false) {
+ $this->_db->addError();
+ return false;
+ }
+ }
+ }
+
+ $page_id = intval($this->_request->getParameter("page_id"));
+ if ($page_id > 0) {
+ $this->_session->setParameter("_mobile_page_id", $page_id);
+ }
+ $room_id = intval($this->_request->getParameter("room_id"));
+ if ($room_id > 0) {
+ $this->_session->setParameter("_mobile_room_id", $room_id);
+ }
+ $module_id = intval($this->_request->getParameter("module_id"));
+ if ($module_id > 0) {
+ $this->_session->setParameter("_mobile_module_id", $module_id);
+ }
+ }
+}
+?>
diff --git a/html/maple/nccore/common_func.php b/html/maple/nccore/common_func.php
index a20d94c..884ab95 100644
--- a/html/maple/nccore/common_func.php
+++ b/html/maple/nccore/common_func.php
@@ -198,6 +198,15 @@ function wysiwig_convert_url($str) {
} else {
$str = preg_replace("/".sprintf(_WYSIWYG_CONVERT_OUTER, 'BASE_URL')."/iu", BASE_URL, $str);
}
+
+ $container =& DIContainerFactory::getContainer();
+ $session =& $container->getComponent('Session');
+ $isSmartphone = $session->getParameter('_smartphone_flag');
+ if ($isSmartphone) {
+ $str = preg_replace('/()/iU', '\\1 onclick="$.mobile.silentScroll(0);"\\3', $str);
+ $str = preg_replace('/()/iU', '\\1\\3\\4', $str);
+ }
+
return $str;
}
diff --git a/html/webapp/components/mobile/View.class.php b/html/webapp/components/mobile/View.class.php
index b50eaea..e0709c1 100644
--- a/html/webapp/components/mobile/View.class.php
+++ b/html/webapp/components/mobile/View.class.php
@@ -88,6 +88,8 @@ function _callbackBlockByPage(&$recordSet)
{
$result = array();
$i = 0;
+ $this->_session->setParameter('mobileDisplayTextHtml', _OFF);
+ $isSmartphone = $this->_session->getParameter('_smartphone_flag');
while ($row = $recordSet->fetchRow()) {
if( !is_null( $row['display_position'] ) && $row['display_position'] != _DISPLAY_POSITION_CENTER ) {
continue;
@@ -99,6 +101,13 @@ function _callbackBlockByPage(&$recordSet)
$row["module_name"] = $this->_modulesView->loadModuleName($row["dir_name"]);
}
+ if (!$isSmartphone
+ && !empty($row['module_id'])
+ && empty($row['block_name'])
+ && !empty($row['content'])) {
+ $this->_session->setParameter('mobileDisplayTextHtml', _ON);
+ }
+
$result[ $row['parent_id'] ][ $row['block_id'] ] = $row;
}
return $result;
@@ -493,7 +502,7 @@ function &_fetchPageTree(&$recordSet, &$params)
}
foreach ($mobileModuleChecks as $childPage) {
if ($childPage['mobileModule']
- || $childPage['visible']) {
+ && $childPage['visible']) {
$pageTree[$parentID][$mobileModuleCheckParentId]['mobileModule'] = true;
break;
}
diff --git a/html/webapp/components/uploads/View.class.php b/html/webapp/components/uploads/View.class.php
index 6e10f42..b58970e 100644
--- a/html/webapp/components/uploads/View.class.php
+++ b/html/webapp/components/uploads/View.class.php
@@ -1,584 +1,590 @@
-_container =& DIContainerFactory::getContainer();
- $this->_db =& $this->_container->getComponent("DbObject");
- }
-
- /**
- * アップロードIDからアップロードオブジェクトを取得
- * @param int upload_id
- * @return array uploads_object
- * @access public
- */
- function getUploadById($id) {
- $params = array(
- "upload_id" => $id
- );
- $sql = "SELECT * FROM {uploads}" .
- " WHERE {uploads}.upload_id = ?" .
- " ";
- $result = $this->_db->execute($sql,$params);
- if($result === false) {
- //エラーが発生した場合、エラーリストに追加
- $db->addError();
- return false;
- }
- if(isset($result[0]))
- return $result;
- else
- return null;
- }
-
- /**
- * モジュールIDからアップロードオブジェクトを取得
- * @param int module_id
- * @return array uploads_object
- * @access public
- */
- function getUploadByModuleid($module_id) {
- $params = array(
- "module_id" => $module_id
- );
- $sql = "SELECT * FROM {uploads}" .
- " WHERE {uploads}.module_id = ?" .
- " ";
- $result = $this->_db->execute($sql,$params);
- if($result === false) {
- //エラーが発生した場合、エラーリストに追加
- $db->addError();
- return false;
- }
- if(isset($result[0]))
- return $result;
- else
- return null;
- }
-
-
- /**
- * 画像表示できるかどうかのチェック
- * @param int $upload_id
- * @param int $show_auth_id 見ることができるルーム権限(主担以上など)
- * @param int $thumbnail_flag 1 or 0 サムネイル表示するかどうか
- * @param string $action_name
- * @return array(string pathname, string file_name)
- * @access public
- */
- function downloadCheck($upload_id, $show_auth_id = null, $thumbnail_flag = 0, $action_name = null, $force_resize=null) {
- $pathname = null;
- $file_name = null;
- $session =& $this->_container->getComponent("Session");
- $pagesView =& $this->_container->getComponent("pagesView");
- $actionChain =& $this->_container->getComponent("ActionChain");
- $action_name = isset($action_name) ? $action_name : $actionChain->getCurActionName();
- $user_id = $session->getParameter("_user_id");
- $physical_file_name = null;
- $cache_flag = false;
- $space_type = _SPACE_TYPE_GROUP;
-
- // add by AllCreator 2010.10.13
- $mobile_imgdsp_size = 0;
- $needThumb = false;
- $mobile_flag = $session->getParameter( "_mobile_flag" );
- if( $mobile_flag == _ON ) {
- $mobile_imgdsp_size = $session->getParameter( "_mobile_imgdsp_size" );
- }
-
-
- if( $force_resize === null ) {
- if( $mobile_imgdsp_size != 0 ) {
- $resize_spec = array( $mobile_imgdsp_size, 0 );
- }
- else {
- $resize_spec = 0;
- }
- }
- else if( $force_resize === 0 ) {
- $resize_spec = 0;
- }
- else {
- $resize_spec = $force_resize;
- }
-
-
- if($upload_id != null) {
- //権限チェック
- $uploads_obj = $this->getUploadById($upload_id);
- if(is_array($uploads_obj)) {
- foreach($uploads_obj as $upload_obj) { // Loop, but here is only one data
-
- if( is_array($resize_spec) ) {
- $needThumb = $this->_needThumb( $upload_obj, $resize_spec );
- }
- //
- // ActionNameチェック
- //
- if($action_name != $upload_obj['action_name']) {
- break;
- }
-
- $room_id = $upload_obj['room_id'];
- $file_name = $upload_obj['file_name'];
-
- // thumbnail_flagを最優先で見ることにした AllCreator 2010.10.13
- if($thumbnail_flag) {
- $physical_file_name = $upload_obj['upload_id']."_thumbnail.".$upload_obj['extension'];
- //$normal_physical_file_name = $upload_obj['physical_file_name'];
- }
- else if( $force_resize !== null && $needThumb==true ) {
- $physical_file_name = $upload_obj['upload_id']."_resize_".$resize_spec[0]."_".$resize_spec[1].".".$upload_obj['extension'];
- }
- // mod by AllCreator 2010.10.13
- else if( $mobile_imgdsp_size!=0 && $needThumb==true ) {
- $physical_file_name = $upload_obj['upload_id']."_mobile_".$mobile_imgdsp_size.".".$upload_obj['extension'];
- }
- else {
- $physical_file_name = $upload_obj['physical_file_name'];
- }
- if($room_id == 0) {
- //room_id=0ならば、誰でも閲覧可能
- $pathname = FILEUPLOADS_DIR.$upload_obj['file_path'];
- $cache_flag = true;
- break;
- } else {
- $page =& $pagesView->getPageById($room_id);
- if(isset($page)) {
- $space_type = $page['space_type'];
- if($space_type == _SPACE_TYPE_PUBLIC) {
- //
- //パブリックスペース
- //
- $auth_id = isset($page['authority_id']) ? $page['authority_id'] : $session->getParameter("_default_entry_auth_public");
- if($show_auth_id != null && $show_auth_id > $auth_id) {
- // 見せれる権限より小さい
- break;
- }
- $pathname = FILEUPLOADS_DIR.$upload_obj['file_path'];
- $cache_flag = true;
- break;
- } else if($space_type == _SPACE_TYPE_GROUP && $page['private_flag'] == _ON) {
- //
- // プライベートスペース
- //
- $cache_flag = ($page['default_entry_flag'] == _ON) ? true : false;
-
- $err_flag = false;
- switch($session->getParameter("_open_private_space")) {
- case _OPEN_PRIVATE_SPACE_GROUP:
- $err_flag = ($user_id != "0") ? false : true;
- break;
- case _OPEN_PRIVATE_SPACE_PUBLIC:
- break;
- case _OPEN_PRIVATE_SPACE_MYPORTAL_GROUP:
- $err_flag = (($user_id != "0" && $page['default_entry_flag'] == _ON) || $user_id == $upload_obj['update_user_id']) ? false : true;
- break;
- case _OPEN_PRIVATE_SPACE_MYPORTAL_PUBLIC:
- $err_flag = (($page['default_entry_flag'] == _ON) || $user_id == $upload_obj['update_user_id']) ? false : true;
- break;
- default:
- $err_flag = ($user_id == $upload_obj['update_user_id']) ? false : true;
- }
- if($err_flag) break;
-
- $auth_id = isset($page['authority_id']) ? $page['authority_id'] : _AUTH_OTHER;
- if($show_auth_id != null && $show_auth_id > $auth_id) {
- // 見せれる権限より小さい
- break;
- }
-
- $pathname = FILEUPLOADS_DIR.$upload_obj['file_path'];
- break;
- } else if($space_type == _SPACE_TYPE_GROUP && $page['default_entry_flag'] == _ON) {
- //
- //グループスペース(すべての会員にデフォルトで参加させる)
- //
- $auth_id = isset($page['authority_id']) ? $page['authority_id'] : $session->getParameter("_default_entry_auth_group");
- if($show_auth_id != null && $show_auth_id > $auth_id) {
- // 見せれる権限より小さい
- break;
- }
- if($user_id != "0" && $auth_id != _AUTH_OTHER) {
- $pathname = FILEUPLOADS_DIR.$upload_obj['file_path'];
- break;
- }
- } else if($space_type == _SPACE_TYPE_GROUP) {
- //
- //グループスペース
- //
- $auth_id = isset($page['authority_id']) ? $page['authority_id'] : _AUTH_OTHER;
- if($show_auth_id != null && $show_auth_id > $auth_id) {
- // 見せれる権限より小さい
- break;
- }
- if($auth_id == _AUTH_OTHER) {
- break;
- }
- //if($auth_id != 0) {
- $pathname = FILEUPLOADS_DIR.$upload_obj['file_path'];
- break;
- //}
- }
- }
- }
- }
- }
- }
- // Thumbnail 最優先
- if($thumbnail_flag && !file_exists($pathname.$physical_file_name)) {
- //
- // common/avatar_thumbnail.gifを使用
- //
- $pathname = MODULE_DIR."/common/files/images/";
- $physical_file_name = "thumbnail.gif";
- }
- // add by AllCreator 2010.10.13
- if( $resize_spec!=0 && $needThumb==true && !file_exists($pathname.$physical_file_name) ) {
- include_once MAPLE_DIR . '/core/FileUpload.class.php';
- $fileUpload =& new FileUpload;
- $result = $fileUpload->resize( $pathname.$upload_obj['physical_file_name'], $resize_spec[0], $resize_spec[1], $pathname.$physical_file_name);
- if( $result == false ) {
- $physical_file_name = $upload_obj['physical_file_name'];
- }
- }
- return array($pathname, $file_name, $physical_file_name, $cache_flag);
- }
-
- /**
- * モバイル用サムネイルを取得すべきアップロード画像か
- * @param int mobile_imgdsp_size
- * @param array uploadsObj
- * @access public
- * @return false:no_need true:need
- */
- function _needThumb( $uploadsObj, $resize_spec )
- {
- // 無条件にオリジナル画像が欲しいという指示だったら
- if( $resize_spec == 0 ) {
- return false; // そのままでいいという判断を返す
- }
-
- //拡張子はgif,png,jpgのみ受け付ける
- switch( strtolower($uploadsObj['extension']) ) {
- case 'jpg':
- case 'png':
- case 'gif':
- break;
- default:
- return false;
- }
- //実サイズが希望サイズを超えているか
- $file_path = FILEUPLOADS_DIR . "/" . $uploadsObj['file_path'] . "/" . $uploadsObj['physical_file_name'];
- $dimension = @getimagesize($file_path);
- if ($dimension === false) {
- return false;
- }
- if( $dimension[0] > $resize_spec[0] || $dimension[1] > $resize_spec[1] ) {
- return true;
- }
- return false;
- }
-
- /**
- * ヘッダー出力
- * @param string pathname
- * @param string filename
- * @access public
- */
- function headerOutput($pathname, $filename, $physical_file_name = null, $cache_flag = false) {
- if($physical_file_name == null) $physical_file_name = $filename;
- $pathname = $pathname.$physical_file_name; //urlencode($filename);
- if ($pathname != null && file_exists($pathname)) {
- $mimetype = $this->mimeinfo("type", $filename);
- if($this->_headerOutput($filename, $pathname, filesize($pathname), $mimetype, $cache_flag) == "200") {
- readfile($pathname);
- }else{
- exit;
- }
- } else {
- header("HTTP/1.0 404 not found");
- }
- }
-
- function _headerOutput($filename, $pathname, $filesize, $mimetype, $cache_flag = false) {
- $status_code = "200";
- $etag = null;
-
- if (!isset($_SERVER['HTTP_USER_AGENT'])) {
- //HTTP_USER_AGENTがない場合、
- header("Content-disposition: inline; filename=\"".$filename."\"");
- } elseif (stristr($_SERVER['HTTP_USER_AGENT'], "MSIE")) {
- // IEの場合
- header("Content-disposition: inline; filename=\"".mb_convert_encoding($filename, "SJIS", _CHARSET)."\"");
- } elseif (stristr($_SERVER['HTTP_USER_AGENT'], "Opera")) {
- // Operaの場合
- header("Content-disposition: attachment; filename=\"".$filename."\"");
- } elseif (stristr($_SERVER['HTTP_USER_AGENT'], "Firefox")) {
- // FireFoxの場合
- if ($mimetype == "application/x-shockwave-flash") {
- header("Content-disposition: inline; filename=\"".$filename."\"");
- } 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)
- header("Content-disposition: inline; filename=\"".$filename."\"");
- }
- if(!empty($pathname)) {
- $stats = stat( $pathname );
- $etag = sprintf( '"%x-%x-%x"', $stats['ino'], $stats['size'], $stats['mtime'] );
- header('Etag: '.$etag);
- }
-
- //header("Content-disposition: inline; filename=\"".$filename."\"");
- // パブリックの画像ならばキャッシュを取るように修正
- if($cache_flag == true) {
- // 1Week
- header("Cache-Control: max-age=604800, public");
- header('Pragma: cache'); //no-cache以外の文字列をセット
- $offset = 60 * 60 * 24 * 7; // 1Week
- header('Expires: '.gmdate('D, d M Y H:i:s', time() + $offset).' GMT');
- if (isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) &&
- stripcslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) == $etag ) {
- header( 'HTTP/1.1 304 Not Modified' );
- $status_code = "304";
- }
- //} else if (isset($_SERVER['HTTPS']) && stristr($_SERVER['HTTP_USER_AGENT'], "MSIE")) {
- // // IE + サイト全体SSLの場合、ダウンロードが正常に行われない。
- // // ダウンロードさせるためには、以下コメントをはずす必要があるが、
- // // アップロードした画像ファイル等をローカルキャッシュにとられてしまう弊害がある。
- // // 1Week
- // header("Cache-Control: max-age=604800, public");
- // header('Pragma: cache'); //no-cache以外の文字列をセット
- // $offset = 60 * 60 * 24 * 7; // 1Week
- // header('Expires: '.gmdate('D, d M Y H:i:s', time() + $offset).' GMT');
- } else {
- header("Cache-Control: no-store, no-cache, must-revalidate");
- header("Pragma: no-cache");
- }
- //header("Cache-Control: public");//キャッシュを有効にする設定(private or public)
-
- header("Content-length: ".$filesize);
- header("Content-type: ".$mimetype);
- return $status_code;
-
- //header("Content-type: application/force-download");
- //header("Content-type: ForceType application/octet-stream");
- //header("Content-type: AddType application/octet-stream");
- //header("Content-type: application/octet-stream");
- }
-
- /**
- * PHPで作られたファイルダウンロードメソッド
- * @param string $data
- * @param string $filename (hogehoge.csv等)
- * @param string $mime_type (document/unknown等)
- * @access public
- */
- function download($data, $filename, $mimetype = null) {
- if($mimetype == null) {
- $mimetype = $this->mimeinfo("type", $filename);
- }
- $this->_headerOutput($filename, null, strlen($data), $mimetype);
-
- echo $data;
- }
-
- /**
- * Mimeタイプ取得
- * @param int key(type or icon)
- * @return string mime_type
- * @access public
- */
- function mimeinfo($key, $filename) {
- $mimeinfo = array (
- "xxx" => array ("type"=>"document/unknown", "icon"=>"unknown.gif"),
- "3gp" => array ("type"=>"video/quicktime", "icon"=>"video.gif"),
- "ai" => array ("type"=>"application/postscript", "icon"=>"image.gif"),
- "aif" => array ("type"=>"audio/x-aiff", "icon"=>"audio.gif"),
- "aiff" => array ("type"=>"audio/x-aiff", "icon"=>"audio.gif"),
- "aifc" => array ("type"=>"audio/x-aiff", "icon"=>"audio.gif"),
- "applescript" => array ("type"=>"text/plain", "icon"=>"text.gif"),
- "asc" => array ("type"=>"text/plain", "icon"=>"text.gif"),
- "au" => array ("type"=>"audio/au", "icon"=>"audio.gif"),
- "avi" => array ("type"=>"video/x-ms-wm", "icon"=>"avi.gif"),
- "bmp" => array ("type"=>"image/bmp", "icon"=>"image.gif"),
- "cs" => array ("type"=>"application/x-csh", "icon"=>"text.gif"),
- "css" => array ("type"=>"text/css", "icon"=>"text.gif"),
- "csv" => array ("type"=>"text/plain", "icon"=>"csv.gif"),
- "dv" => array ("type"=>"video/x-dv", "icon"=>"video.gif"),
- "doc" => array ("type"=>"application/msword", "icon"=>"word.gif"),
- "docx" => array ("type"=>"application/vnd.openxmlformats-officedocument.wordprocessingml.document", "icon"=>"word.gif"),
- "dif" => array ("type"=>"video/x-dv", "icon"=>"video.gif"),
- "eps" => array ("type"=>"application/postscript", "icon"=>"pdf.gif"),
- "gif" => array ("type"=>"image/gif", "icon"=>"image.gif"),
- "gtar" => array ("type"=>"application/x-gtar", "icon"=>"zip.gif"),
- "gz" => array ("type"=>"application/g-zip", "icon"=>"zip.gif"),
- "gzip" => array ("type"=>"application/g-zip", "icon"=>"zip.gif"),
- "h" => array ("type"=>"text/plain", "icon"=>"text.gif"),
- "hqx" => array ("type"=>"application/mac-binhex40", "icon"=>"zip.gif"),
- "html" => array ("type"=>"text/html", "icon"=>"html.gif"),
- "htm" => array ("type"=>"text/html", "icon"=>"html.gif"),
- "jpe" => array ("type"=>"image/jpeg", "icon"=>"image.gif"),
- "jpeg" => array ("type"=>"image/jpeg", "icon"=>"image.gif"),
- "jpg" => array ("type"=>"image/jpeg", "icon"=>"image.gif"),
- "js" => array ("type"=>"application/x-javascript", "icon"=>"text.gif"),
- "latex"=> array ("type"=>"application/x-latex", "icon"=>"text.gif"),
- "m" => array ("type"=>"text/plain", "icon"=>"text.gif"),
- "flv" => array ("type"=>"video/x-flv", "icon"=>"video.gif"),
- "mov" => array ("type"=>"video/quicktime", "icon"=>"video.gif"),
- "movie"=> array ("type"=>"video/x-sgi-movie", "icon"=>"video.gif"),
- "m3u" => array ("type"=>"audio/x-mpegurl", "icon"=>"audio.gif"),
- "mp3" => array ("type"=>"audio/mp3", "icon"=>"audio.gif"),
- "mp4" => array ("type"=>"video/mp4", "icon"=>"video.gif"),
- "mpeg" => array ("type"=>"video/mpeg", "icon"=>"video.gif"),
- "mpe" => array ("type"=>"video/mpeg", "icon"=>"video.gif"),
- "mpg" => array ("type"=>"video/mpeg", "icon"=>"video.gif"),
- "pct" => array ("type"=>"image/pict", "icon"=>"image.gif"),
- "pdf" => array ("type"=>"application/pdf", "icon"=>"pdf.gif"),
- "php" => array ("type"=>"text/plain", "icon"=>"text.gif"),
- "pic" => array ("type"=>"image/pict", "icon"=>"image.gif"),
- "pict" => array ("type"=>"image/pict", "icon"=>"image.gif"),
- "png" => array ("type"=>"image/png", "icon"=>"image.gif"),
- "pps" => array ("type"=>"application/vnd.ms-powerpoint", "icon"=>"powerpoint.gif"),
- "ppt" => array ("type"=>"application/vnd.ms-powerpoint", "icon"=>"powerpoint.gif"),
- "pptx" => array ("type"=>"application/vnd.openxmlformats-officedocument.presentationml.presentation", "icon"=>"powerpoint.gif"),
- "ps" => array ("type"=>"application/postscript", "icon"=>"pdf.gif"),
- "qt" => array ("type"=>"video/quicktime", "icon"=>"video.gif"),
- "ra" => array ("type"=>"audio/x-realaudio", "icon"=>"audio.gif"),
- "ram" => array ("type"=>"audio/x-pn-realaudio", "icon"=>"audio.gif"),
- "rm" => array ("type"=>"audio/x-pn-realaudio", "icon"=>"audio.gif"),
- "rtf" => array ("type"=>"text/rtf", "icon"=>"text.gif"),
- "rtx" => array ("type"=>"text/richtext", "icon"=>"text.gif"),
- "sh" => array ("type"=>"application/x-sh", "icon"=>"text.gif"),
- "sit" => array ("type"=>"application/x-stuffit", "icon"=>"zip.gif"),
- "smi" => array ("type"=>"application/smil", "icon"=>"text.gif"),
- "smil" => array ("type"=>"application/smil", "icon"=>"text.gif"),
- "swf" => array ("type"=>"application/x-shockwave-flash", "icon"=>"flash.gif"),
- "tar" => array ("type"=>"application/x-tar", "icon"=>"zip.gif"),
- "tgz" => array ("type"=>"application/x-tar", "icon"=>"zip.gif"),
- "tif" => array ("type"=>"image/tiff", "icon"=>"image.gif"),
- "tiff" => array ("type"=>"image/tiff", "icon"=>"image.gif"),
- "tex" => array ("type"=>"application/x-tex", "icon"=>"text.gif"),
- "texi" => array ("type"=>"application/x-texinfo", "icon"=>"text.gif"),
- "texinfo" => array ("type"=>"application/x-texinfo", "icon"=>"text.gif"),
- "tsv" => array ("type"=>"text/tab-separated-values", "icon"=>"text.gif"),
- "txt" => array ("type"=>"text/plain", "icon"=>"text.gif"),
- "wav" => array ("type"=>"audio/wav", "icon"=>"audio.gif"),
- "wmv" => array ("type"=>"video/x-ms-wmv", "icon"=>"avi.gif"),
- "asf" => array ("type"=>"video/x-ms-asf", "icon"=>"avi.gif"),
- "xls" => array ("type"=>"application/vnd.ms-excel", "icon"=>"excel.gif"),
- "xlsx" => array ("type"=>"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "icon"=>"excel.gif"),
- "xml" => array ("type"=>"text/xml", "icon"=>"xml.gif"),
- "xsl" => array ("type"=>"text/xml", "icon"=>"xml.gif"),
- "zip" => array ("type"=>"application/zip", "icon"=>"zip.gif"),
- "tex" => array ("type"=>"application/x-tex", "icon"=>"text.gif"),
- "dvi" => array ("type"=>"application/x-dvi", "icon"=>"text.gif"),
- "ps" => array ("type"=>"application/postscript", "icon"=>"text.gif"),
- "ics" => array ("type"=>"application/octet-stream", "icon"=>"outlook.gif"),
- "jtd" => array ("type"=>"application/x-js-taro", "icon"=>"unknown.gif"),
- "jbw" => array ("type"=>"application/x-js-taro", "icon"=>"unknown.gif"),
- "jtt" => array ("type"=>"application/x-js-taro", "icon"=>"unknown.gif"),
- "jfw" => array ("type"=>"application/x-js-taro", "icon"=>"unknown.gif"),
- "jvw" => array ("type"=>"application/x-js-taro", "icon"=>"unknown.gif"),
- "juw" => array ("type"=>"application/x-js-taro", "icon"=>"unknown.gif"),
- "jaw" => array ("type"=>"application/x-js-taro", "icon"=>"unknown.gif"),
- "jtw" => array ("type"=>"application/x-js-taro", "icon"=>"unknown.gif"),
- "jsw" => array ("type"=>"application/x-js-taro", "icon"=>"unknown.gif"),
- "jxw" => array ("type"=>"application/x-js-taro", "icon"=>"unknown.gif"),
- "odt" => array ("type"=>"application/vnd.oasis.opendocument.text", "icon"=>"unknown.gif"),
- "odg" => array ("type"=>"application/vnd.oasis.opendocument.graphic", "icon"=>"unknown.gif"),
- "ods" => array ("type"=>"application/vnd.oasis.opendocument.spreadsheet", "icon"=>"unknown.gif"),
- "odp" => array ("type"=>"application/vnd.oasis.opendocument.presentation", "icon"=>"unknown.gif"),
- "odb" => array ("type"=>"application/vnd.oasis.opendocument.database", "icon"=>"unknown.gif"),
- "odf" => array ("type"=>"application/vnd.oasis.opendocument.formula", "icon"=>"unknown.gif")
- );
-
- if (eregi("\.([a-z0-9]+)$", $filename, $match)) {
- if(isset($mimeinfo[strtolower($match[1])][$key])) {
- return $mimeinfo[strtolower($match[1])][$key];
- } else {
- return $mimeinfo["xxx"][$key]; // By default
- }
- } else {
- return $mimeinfo["xxx"][$key]; // By default
- }
- }
-
- /**
- * 指定された拡張子になっているか?
- *
- * @param string $file_name
- * @param string $allow_extension 拡張子文字列(「,」区切りで複数指定可)
- * 指定しない場合、configのallow_extensionの中にあるかどうかのチェック
- * @return array pathInfo or false
- * @access public
- */
- function checkExtension($file_name, $allow_extension = null)
- {
- $pathinfo = pathinfo($file_name);
- if(isset($pathinfo['extension'])) {
- $extension_str = strtolower($pathinfo['extension']);
- } else {
- $extension_str = "";
- }
-
- if($allow_extension == null) {
- $configView =& $this->_container->getComponent("configView");
- $config = $configView->getConfigByConfname(_SYS_CONF_MODID, "allow_extension");
- if(!isset($config["conf_value"])) {
- return false;
- }
- $allow_extension = $config["conf_value"];
- }
-
- if($allow_extension != "") {
- $extensionArray = explode(",", strtolower($allow_extension));
- if(!in_array($extension_str, $extensionArray)) {
- return false;
- }
- }
- //
- // tar.gzの対応
- // tar.gzのほかにも同じような拡張子があるかも
- //
- if(preg_match("/.+\.tar\.gz$/i", $file_name)) {
- $pathinfo['extension'] = "tar.gz";
- }
- return $pathinfo;
- }
-}
-?>
+_container =& DIContainerFactory::getContainer();
+ $this->_db =& $this->_container->getComponent("DbObject");
+ }
+
+ /**
+ * アップロードIDからアップロードオブジェクトを取得
+ * @param int upload_id
+ * @return array uploads_object
+ * @access public
+ */
+ function getUploadById($id) {
+ $params = array(
+ "upload_id" => $id
+ );
+ $sql = "SELECT * FROM {uploads}" .
+ " WHERE {uploads}.upload_id = ?" .
+ " ";
+ $result = $this->_db->execute($sql,$params);
+ if($result === false) {
+ //エラーが発生した場合、エラーリストに追加
+ $db->addError();
+ return false;
+ }
+ if(isset($result[0]))
+ return $result;
+ else
+ return null;
+ }
+
+ /**
+ * モジュールIDからアップロードオブジェクトを取得
+ * @param int module_id
+ * @return array uploads_object
+ * @access public
+ */
+ function getUploadByModuleid($module_id) {
+ $params = array(
+ "module_id" => $module_id
+ );
+ $sql = "SELECT * FROM {uploads}" .
+ " WHERE {uploads}.module_id = ?" .
+ " ";
+ $result = $this->_db->execute($sql,$params);
+ if($result === false) {
+ //エラーが発生した場合、エラーリストに追加
+ $db->addError();
+ return false;
+ }
+ if(isset($result[0]))
+ return $result;
+ else
+ return null;
+ }
+
+
+ /**
+ * 画像表示できるかどうかのチェック
+ * @param int $upload_id
+ * @param int $show_auth_id 見ることができるルーム権限(主担以上など)
+ * @param int $thumbnail_flag 1 or 0 サムネイル表示するかどうか
+ * @param string $action_name
+ * @return array(string pathname, string file_name)
+ * @access public
+ */
+ function downloadCheck($upload_id, $show_auth_id = null, $thumbnail_flag = 0, $action_name = null, $force_resize=null) {
+ $pathname = null;
+ $file_name = null;
+ $session =& $this->_container->getComponent("Session");
+ $pagesView =& $this->_container->getComponent("pagesView");
+ $actionChain =& $this->_container->getComponent("ActionChain");
+ $action_name = isset($action_name) ? $action_name : $actionChain->getCurActionName();
+ $user_id = $session->getParameter("_user_id");
+ $physical_file_name = null;
+ $cache_flag = false;
+ $space_type = _SPACE_TYPE_GROUP;
+
+ // add by AllCreator 2010.10.13
+ $mobile_imgdsp_size = 0;
+ $needThumb = false;
+ $mobile_flag = $session->getParameter( "_mobile_flag" );
+ if( $mobile_flag == _ON ) {
+ $mobile_imgdsp_size = $session->getParameter( "_mobile_imgdsp_size" );
+ }
+
+
+ if( $force_resize === null ) {
+ if( $mobile_imgdsp_size != 0 ) {
+ $resize_spec = array( $mobile_imgdsp_size, 0 );
+ }
+ else {
+ $resize_spec = 0;
+ }
+ }
+ else if( $force_resize === 0 ) {
+ $resize_spec = 0;
+ }
+ else {
+ $resize_spec = $force_resize;
+ }
+
+
+ if($upload_id != null) {
+ //権限チェック
+ $uploads_obj = $this->getUploadById($upload_id);
+ if(is_array($uploads_obj)) {
+ foreach($uploads_obj as $upload_obj) { // Loop, but here is only one data
+
+ if( is_array($resize_spec) ) {
+ $needThumb = $this->_needThumb( $upload_obj, $resize_spec );
+ }
+ //
+ // ActionNameチェック
+ //
+ if($action_name != $upload_obj['action_name']) {
+ break;
+ }
+
+ $room_id = $upload_obj['room_id'];
+ $file_name = $upload_obj['file_name'];
+
+ // thumbnail_flagを最優先で見ることにした AllCreator 2010.10.13
+ if($thumbnail_flag) {
+ $physical_file_name = $upload_obj['upload_id']."_thumbnail.".$upload_obj['extension'];
+ //$normal_physical_file_name = $upload_obj['physical_file_name'];
+ }
+ else if( $force_resize !== null && $needThumb==true ) {
+ $physical_file_name = $upload_obj['upload_id']."_resize_".$resize_spec[0]."_".$resize_spec[1].".".$upload_obj['extension'];
+ }
+ // mod by AllCreator 2010.10.13
+ else if( $mobile_imgdsp_size!=0 && $needThumb==true ) {
+ $physical_file_name = $upload_obj['upload_id']."_mobile_".$mobile_imgdsp_size.".".$upload_obj['extension'];
+ }
+ else {
+ $physical_file_name = $upload_obj['physical_file_name'];
+ }
+ if($room_id == 0) {
+ //room_id=0ならば、誰でも閲覧可能
+ $pathname = FILEUPLOADS_DIR.$upload_obj['file_path'];
+ $cache_flag = true;
+ break;
+ } else {
+ $page =& $pagesView->getPageById($room_id);
+ if(isset($page)) {
+ $space_type = $page['space_type'];
+ if($space_type == _SPACE_TYPE_PUBLIC) {
+ //
+ //パブリックスペース
+ //
+ $auth_id = isset($page['authority_id']) ? $page['authority_id'] : $session->getParameter("_default_entry_auth_public");
+ if($show_auth_id != null && $show_auth_id > $auth_id) {
+ // 見せれる権限より小さい
+ break;
+ }
+ $pathname = FILEUPLOADS_DIR.$upload_obj['file_path'];
+ $cache_flag = true;
+ break;
+ } else if($space_type == _SPACE_TYPE_GROUP && $page['private_flag'] == _ON) {
+ //
+ // プライベートスペース
+ //
+ $cache_flag = ($page['default_entry_flag'] == _ON) ? true : false;
+
+ $err_flag = false;
+ switch($session->getParameter("_open_private_space")) {
+ case _OPEN_PRIVATE_SPACE_GROUP:
+ $err_flag = ($user_id != "0") ? false : true;
+ break;
+ case _OPEN_PRIVATE_SPACE_PUBLIC:
+ break;
+ case _OPEN_PRIVATE_SPACE_MYPORTAL_GROUP:
+ $err_flag = (($user_id != "0" && $page['default_entry_flag'] == _ON) || $user_id == $upload_obj['update_user_id']) ? false : true;
+ break;
+ case _OPEN_PRIVATE_SPACE_MYPORTAL_PUBLIC:
+ $err_flag = (($page['default_entry_flag'] == _ON) || $user_id == $upload_obj['update_user_id']) ? false : true;
+ break;
+ default:
+ $err_flag = ($user_id == $upload_obj['update_user_id']) ? false : true;
+ }
+ if($err_flag) break;
+
+ $auth_id = isset($page['authority_id']) ? $page['authority_id'] : _AUTH_OTHER;
+ if($show_auth_id != null && $show_auth_id > $auth_id) {
+ // 見せれる権限より小さい
+ break;
+ }
+
+ $pathname = FILEUPLOADS_DIR.$upload_obj['file_path'];
+ break;
+ } else if($space_type == _SPACE_TYPE_GROUP && $page['default_entry_flag'] == _ON) {
+ //
+ //グループスペース(すべての会員にデフォルトで参加させる)
+ //
+ $auth_id = isset($page['authority_id']) ? $page['authority_id'] : $session->getParameter("_default_entry_auth_group");
+ if($show_auth_id != null && $show_auth_id > $auth_id) {
+ // 見せれる権限より小さい
+ break;
+ }
+ if($user_id != "0" && $auth_id != _AUTH_OTHER) {
+ $pathname = FILEUPLOADS_DIR.$upload_obj['file_path'];
+ break;
+ }
+ } else if($space_type == _SPACE_TYPE_GROUP) {
+ //
+ //グループスペース
+ //
+ $auth_id = isset($page['authority_id']) ? $page['authority_id'] : _AUTH_OTHER;
+ if($show_auth_id != null && $show_auth_id > $auth_id) {
+ // 見せれる権限より小さい
+ break;
+ }
+ if($auth_id == _AUTH_OTHER) {
+ break;
+ }
+ //if($auth_id != 0) {
+ $pathname = FILEUPLOADS_DIR.$upload_obj['file_path'];
+ break;
+ //}
+ }
+ }
+ }
+ }
+ }
+ }
+ // Thumbnail 最優先
+ if($thumbnail_flag && !file_exists($pathname.$physical_file_name)) {
+ //
+ // common/avatar_thumbnail.gifを使用
+ //
+ $pathname = MODULE_DIR."/common/files/images/";
+ $physical_file_name = "thumbnail.gif";
+ }
+ // add by AllCreator 2010.10.13
+ if( $resize_spec!=0 && $needThumb==true && !file_exists($pathname.$physical_file_name) ) {
+ include_once MAPLE_DIR . '/core/FileUpload.class.php';
+ $fileUpload =& new FileUpload;
+ $result = $fileUpload->resize( $pathname.$upload_obj['physical_file_name'], $resize_spec[0], $resize_spec[1], $pathname.$physical_file_name);
+ if( $result == false ) {
+ $physical_file_name = $upload_obj['physical_file_name'];
+ }
+ }
+ return array($pathname, $file_name, $physical_file_name, $cache_flag);
+ }
+
+ /**
+ * モバイル用サムネイルを取得すべきアップロード画像か
+ * @param int mobile_imgdsp_size
+ * @param array uploadsObj
+ * @access public
+ * @return false:no_need true:need
+ */
+ function _needThumb( $uploadsObj, $resize_spec )
+ {
+ // 無条件にオリジナル画像が欲しいという指示だったら
+ if( $resize_spec == 0 ) {
+ return false; // そのままでいいという判断を返す
+ }
+
+ //拡張子はgif,png,jpgのみ受け付ける
+ switch( strtolower($uploadsObj['extension']) ) {
+ case 'jpg':
+ case 'png':
+ case 'gif':
+ break;
+ default:
+ return false;
+ }
+ //実サイズが希望サイズを超えているか
+ $file_path = FILEUPLOADS_DIR . "/" . $uploadsObj['file_path'] . "/" . $uploadsObj['physical_file_name'];
+ $dimension = @getimagesize($file_path);
+ if ($dimension === false) {
+ return false;
+ }
+ if( $dimension[0] > $resize_spec[0] || $dimension[1] > $resize_spec[1] ) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * ヘッダー出力
+ * @param string pathname
+ * @param string filename
+ * @access public
+ */
+ function headerOutput($pathname, $filename, $physical_file_name = null, $cache_flag = false) {
+ if($physical_file_name == null) $physical_file_name = $filename;
+ $pathname = $pathname.$physical_file_name; //urlencode($filename);
+ if ($pathname != null && file_exists($pathname)) {
+ $mimetype = $this->mimeinfo("type", $filename);
+ if($this->_headerOutput($filename, $pathname, filesize($pathname), $mimetype, $cache_flag) == "200") {
+ $handle = fopen($pathname, 'rb');
+ while (!feof($handle)) {
+ echo fread($handle, 1 * (1024 * 1024));
+ ob_flush();
+ flush();
+ }
+ fclose($handle);
+ }else{
+ exit;
+ }
+ } else {
+ header("HTTP/1.0 404 not found");
+ }
+ }
+
+ function _headerOutput($filename, $pathname, $filesize, $mimetype, $cache_flag = false) {
+ $status_code = "200";
+ $etag = null;
+
+ if (!isset($_SERVER['HTTP_USER_AGENT'])) {
+ //HTTP_USER_AGENTがない場合、
+ header("Content-disposition: inline; filename=\"".$filename."\"");
+ } elseif (stristr($_SERVER['HTTP_USER_AGENT'], "MSIE")) {
+ // IEの場合
+ header("Content-disposition: inline; filename=\"".mb_convert_encoding($filename, "SJIS", _CHARSET)."\"");
+ } elseif (stristr($_SERVER['HTTP_USER_AGENT'], "Opera")) {
+ // Operaの場合
+ header("Content-disposition: attachment; filename=\"".$filename."\"");
+ } elseif (stristr($_SERVER['HTTP_USER_AGENT'], "Firefox")) {
+ // FireFoxの場合
+ if ($mimetype == "application/x-shockwave-flash") {
+ header("Content-disposition: inline; filename=\"".$filename."\"");
+ } 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)
+ header("Content-disposition: inline; filename=\"".$filename."\"");
+ }
+ if(!empty($pathname)) {
+ $stats = stat( $pathname );
+ $etag = sprintf( '"%x-%x-%x"', $stats['ino'], $stats['size'], $stats['mtime'] );
+ header('Etag: '.$etag);
+ }
+
+ //header("Content-disposition: inline; filename=\"".$filename."\"");
+ // パブリックの画像ならばキャッシュを取るように修正
+ if($cache_flag == true) {
+ // 1Week
+ header("Cache-Control: max-age=604800, public");
+ header('Pragma: cache'); //no-cache以外の文字列をセット
+ $offset = 60 * 60 * 24 * 7; // 1Week
+ header('Expires: '.gmdate('D, d M Y H:i:s', time() + $offset).' GMT');
+ if (isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) &&
+ stripcslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) == $etag ) {
+ header( 'HTTP/1.1 304 Not Modified' );
+ $status_code = "304";
+ }
+ //} else if (isset($_SERVER['HTTPS']) && stristr($_SERVER['HTTP_USER_AGENT'], "MSIE")) {
+ // // IE + サイト全体SSLの場合、ダウンロードが正常に行われない。
+ // // ダウンロードさせるためには、以下コメントをはずす必要があるが、
+ // // アップロードした画像ファイル等をローカルキャッシュにとられてしまう弊害がある。
+ // // 1Week
+ // header("Cache-Control: max-age=604800, public");
+ // header('Pragma: cache'); //no-cache以外の文字列をセット
+ // $offset = 60 * 60 * 24 * 7; // 1Week
+ // header('Expires: '.gmdate('D, d M Y H:i:s', time() + $offset).' GMT');
+ } else {
+ header("Cache-Control: no-store, no-cache, must-revalidate");
+ header("Pragma: no-cache");
+ }
+ //header("Cache-Control: public");//キャッシュを有効にする設定(private or public)
+
+ header("Content-length: ".$filesize);
+ header("Content-type: ".$mimetype);
+ return $status_code;
+
+ //header("Content-type: application/force-download");
+ //header("Content-type: ForceType application/octet-stream");
+ //header("Content-type: AddType application/octet-stream");
+ //header("Content-type: application/octet-stream");
+ }
+
+ /**
+ * PHPで作られたファイルダウンロードメソッド
+ * @param string $data
+ * @param string $filename (hogehoge.csv等)
+ * @param string $mime_type (document/unknown等)
+ * @access public
+ */
+ function download($data, $filename, $mimetype = null) {
+ if($mimetype == null) {
+ $mimetype = $this->mimeinfo("type", $filename);
+ }
+ $this->_headerOutput($filename, null, strlen($data), $mimetype);
+
+ echo $data;
+ }
+
+ /**
+ * Mimeタイプ取得
+ * @param int key(type or icon)
+ * @return string mime_type
+ * @access public
+ */
+ function mimeinfo($key, $filename) {
+ $mimeinfo = array (
+ "xxx" => array ("type"=>"document/unknown", "icon"=>"unknown.gif"),
+ "3gp" => array ("type"=>"video/quicktime", "icon"=>"video.gif"),
+ "ai" => array ("type"=>"application/postscript", "icon"=>"image.gif"),
+ "aif" => array ("type"=>"audio/x-aiff", "icon"=>"audio.gif"),
+ "aiff" => array ("type"=>"audio/x-aiff", "icon"=>"audio.gif"),
+ "aifc" => array ("type"=>"audio/x-aiff", "icon"=>"audio.gif"),
+ "applescript" => array ("type"=>"text/plain", "icon"=>"text.gif"),
+ "asc" => array ("type"=>"text/plain", "icon"=>"text.gif"),
+ "au" => array ("type"=>"audio/au", "icon"=>"audio.gif"),
+ "avi" => array ("type"=>"video/x-ms-wm", "icon"=>"avi.gif"),
+ "bmp" => array ("type"=>"image/bmp", "icon"=>"image.gif"),
+ "cs" => array ("type"=>"application/x-csh", "icon"=>"text.gif"),
+ "css" => array ("type"=>"text/css", "icon"=>"text.gif"),
+ "csv" => array ("type"=>"text/plain", "icon"=>"csv.gif"),
+ "dv" => array ("type"=>"video/x-dv", "icon"=>"video.gif"),
+ "doc" => array ("type"=>"application/msword", "icon"=>"word.gif"),
+ "docx" => array ("type"=>"application/vnd.openxmlformats-officedocument.wordprocessingml.document", "icon"=>"word.gif"),
+ "dif" => array ("type"=>"video/x-dv", "icon"=>"video.gif"),
+ "eps" => array ("type"=>"application/postscript", "icon"=>"pdf.gif"),
+ "gif" => array ("type"=>"image/gif", "icon"=>"image.gif"),
+ "gtar" => array ("type"=>"application/x-gtar", "icon"=>"zip.gif"),
+ "gz" => array ("type"=>"application/g-zip", "icon"=>"zip.gif"),
+ "gzip" => array ("type"=>"application/g-zip", "icon"=>"zip.gif"),
+ "h" => array ("type"=>"text/plain", "icon"=>"text.gif"),
+ "hqx" => array ("type"=>"application/mac-binhex40", "icon"=>"zip.gif"),
+ "html" => array ("type"=>"text/html", "icon"=>"html.gif"),
+ "htm" => array ("type"=>"text/html", "icon"=>"html.gif"),
+ "jpe" => array ("type"=>"image/jpeg", "icon"=>"image.gif"),
+ "jpeg" => array ("type"=>"image/jpeg", "icon"=>"image.gif"),
+ "jpg" => array ("type"=>"image/jpeg", "icon"=>"image.gif"),
+ "js" => array ("type"=>"application/x-javascript", "icon"=>"text.gif"),
+ "latex"=> array ("type"=>"application/x-latex", "icon"=>"text.gif"),
+ "m" => array ("type"=>"text/plain", "icon"=>"text.gif"),
+ "flv" => array ("type"=>"video/x-flv", "icon"=>"video.gif"),
+ "mov" => array ("type"=>"video/quicktime", "icon"=>"video.gif"),
+ "movie"=> array ("type"=>"video/x-sgi-movie", "icon"=>"video.gif"),
+ "m3u" => array ("type"=>"audio/x-mpegurl", "icon"=>"audio.gif"),
+ "mp3" => array ("type"=>"audio/mp3", "icon"=>"audio.gif"),
+ "mp4" => array ("type"=>"video/mp4", "icon"=>"video.gif"),
+ "mpeg" => array ("type"=>"video/mpeg", "icon"=>"video.gif"),
+ "mpe" => array ("type"=>"video/mpeg", "icon"=>"video.gif"),
+ "mpg" => array ("type"=>"video/mpeg", "icon"=>"video.gif"),
+ "pct" => array ("type"=>"image/pict", "icon"=>"image.gif"),
+ "pdf" => array ("type"=>"application/pdf", "icon"=>"pdf.gif"),
+ "php" => array ("type"=>"text/plain", "icon"=>"text.gif"),
+ "pic" => array ("type"=>"image/pict", "icon"=>"image.gif"),
+ "pict" => array ("type"=>"image/pict", "icon"=>"image.gif"),
+ "png" => array ("type"=>"image/png", "icon"=>"image.gif"),
+ "pps" => array ("type"=>"application/vnd.ms-powerpoint", "icon"=>"powerpoint.gif"),
+ "ppt" => array ("type"=>"application/vnd.ms-powerpoint", "icon"=>"powerpoint.gif"),
+ "pptx" => array ("type"=>"application/vnd.openxmlformats-officedocument.presentationml.presentation", "icon"=>"powerpoint.gif"),
+ "ps" => array ("type"=>"application/postscript", "icon"=>"pdf.gif"),
+ "qt" => array ("type"=>"video/quicktime", "icon"=>"video.gif"),
+ "ra" => array ("type"=>"audio/x-realaudio", "icon"=>"audio.gif"),
+ "ram" => array ("type"=>"audio/x-pn-realaudio", "icon"=>"audio.gif"),
+ "rm" => array ("type"=>"audio/x-pn-realaudio", "icon"=>"audio.gif"),
+ "rtf" => array ("type"=>"text/rtf", "icon"=>"text.gif"),
+ "rtx" => array ("type"=>"text/richtext", "icon"=>"text.gif"),
+ "sh" => array ("type"=>"application/x-sh", "icon"=>"text.gif"),
+ "sit" => array ("type"=>"application/x-stuffit", "icon"=>"zip.gif"),
+ "smi" => array ("type"=>"application/smil", "icon"=>"text.gif"),
+ "smil" => array ("type"=>"application/smil", "icon"=>"text.gif"),
+ "swf" => array ("type"=>"application/x-shockwave-flash", "icon"=>"flash.gif"),
+ "tar" => array ("type"=>"application/x-tar", "icon"=>"zip.gif"),
+ "tgz" => array ("type"=>"application/x-tar", "icon"=>"zip.gif"),
+ "tif" => array ("type"=>"image/tiff", "icon"=>"image.gif"),
+ "tiff" => array ("type"=>"image/tiff", "icon"=>"image.gif"),
+ "tex" => array ("type"=>"application/x-tex", "icon"=>"text.gif"),
+ "texi" => array ("type"=>"application/x-texinfo", "icon"=>"text.gif"),
+ "texinfo" => array ("type"=>"application/x-texinfo", "icon"=>"text.gif"),
+ "tsv" => array ("type"=>"text/tab-separated-values", "icon"=>"text.gif"),
+ "txt" => array ("type"=>"text/plain", "icon"=>"text.gif"),
+ "wav" => array ("type"=>"audio/wav", "icon"=>"audio.gif"),
+ "wmv" => array ("type"=>"video/x-ms-wmv", "icon"=>"avi.gif"),
+ "asf" => array ("type"=>"video/x-ms-asf", "icon"=>"avi.gif"),
+ "xls" => array ("type"=>"application/vnd.ms-excel", "icon"=>"excel.gif"),
+ "xlsx" => array ("type"=>"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "icon"=>"excel.gif"),
+ "xml" => array ("type"=>"text/xml", "icon"=>"xml.gif"),
+ "xsl" => array ("type"=>"text/xml", "icon"=>"xml.gif"),
+ "zip" => array ("type"=>"application/zip", "icon"=>"zip.gif"),
+ "tex" => array ("type"=>"application/x-tex", "icon"=>"text.gif"),
+ "dvi" => array ("type"=>"application/x-dvi", "icon"=>"text.gif"),
+ "ps" => array ("type"=>"application/postscript", "icon"=>"text.gif"),
+ "ics" => array ("type"=>"application/octet-stream", "icon"=>"outlook.gif"),
+ "jtd" => array ("type"=>"application/x-js-taro", "icon"=>"unknown.gif"),
+ "jbw" => array ("type"=>"application/x-js-taro", "icon"=>"unknown.gif"),
+ "jtt" => array ("type"=>"application/x-js-taro", "icon"=>"unknown.gif"),
+ "jfw" => array ("type"=>"application/x-js-taro", "icon"=>"unknown.gif"),
+ "jvw" => array ("type"=>"application/x-js-taro", "icon"=>"unknown.gif"),
+ "juw" => array ("type"=>"application/x-js-taro", "icon"=>"unknown.gif"),
+ "jaw" => array ("type"=>"application/x-js-taro", "icon"=>"unknown.gif"),
+ "jtw" => array ("type"=>"application/x-js-taro", "icon"=>"unknown.gif"),
+ "jsw" => array ("type"=>"application/x-js-taro", "icon"=>"unknown.gif"),
+ "jxw" => array ("type"=>"application/x-js-taro", "icon"=>"unknown.gif"),
+ "odt" => array ("type"=>"application/vnd.oasis.opendocument.text", "icon"=>"unknown.gif"),
+ "odg" => array ("type"=>"application/vnd.oasis.opendocument.graphic", "icon"=>"unknown.gif"),
+ "ods" => array ("type"=>"application/vnd.oasis.opendocument.spreadsheet", "icon"=>"unknown.gif"),
+ "odp" => array ("type"=>"application/vnd.oasis.opendocument.presentation", "icon"=>"unknown.gif"),
+ "odb" => array ("type"=>"application/vnd.oasis.opendocument.database", "icon"=>"unknown.gif"),
+ "odf" => array ("type"=>"application/vnd.oasis.opendocument.formula", "icon"=>"unknown.gif")
+ );
+
+ if (eregi("\.([a-z0-9]+)$", $filename, $match)) {
+ if(isset($mimeinfo[strtolower($match[1])][$key])) {
+ return $mimeinfo[strtolower($match[1])][$key];
+ } else {
+ return $mimeinfo["xxx"][$key]; // By default
+ }
+ } else {
+ return $mimeinfo["xxx"][$key]; // By default
+ }
+ }
+
+ /**
+ * 指定された拡張子になっているか?
+ *
+ * @param string $file_name
+ * @param string $allow_extension 拡張子文字列(「,」区切りで複数指定可)
+ * 指定しない場合、configのallow_extensionの中にあるかどうかのチェック
+ * @return array pathInfo or false
+ * @access public
+ */
+ function checkExtension($file_name, $allow_extension = null)
+ {
+ $pathinfo = pathinfo($file_name);
+ if(isset($pathinfo['extension'])) {
+ $extension_str = strtolower($pathinfo['extension']);
+ } else {
+ $extension_str = "";
+ }
+
+ if($allow_extension == null) {
+ $configView =& $this->_container->getComponent("configView");
+ $config = $configView->getConfigByConfname(_SYS_CONF_MODID, "allow_extension");
+ if(!isset($config["conf_value"])) {
+ return false;
+ }
+ $allow_extension = $config["conf_value"];
+ }
+
+ if($allow_extension != "") {
+ $extensionArray = explode(",", strtolower($allow_extension));
+ if(!in_array($extension_str, $extensionArray)) {
+ return false;
+ }
+ }
+ //
+ // tar.gzの対応
+ // tar.gzのほかにも同じような拡張子があるかも
+ //
+ if(preg_match("/.+\.tar\.gz$/i", $file_name)) {
+ $pathinfo['extension'] = "tar.gz";
+ }
+ return $pathinfo;
+ }
+}
+?>
diff --git a/html/webapp/components/users/View.class.php b/html/webapp/components/users/View.class.php
index 6ececb4..a1a68a1 100644
--- a/html/webapp/components/users/View.class.php
+++ b/html/webapp/components/users/View.class.php
@@ -1075,5 +1075,56 @@ function &_fetchRoomUser($result, $func_params)
// 不参加者を返す
return $absence_users;
}
+
+ /**
+ * メールアドレスからユーザーIDを取得する
+ *
+ * @param string $mail メールアドレス
+ * @param boolean $isActive 利用可能ユーザー対象フラグ
+ * @return ユーザーID
+ * @access private
+ */
+ function &getUserIdByMail($mail, $isActive = false) {
+ $userId = null;
+ if (empty($mail)) {
+ return $userId;
+ }
+
+ $sql = "SELECT UI.user_id "
+ . "FROM {items} I "
+ . "INNER JOIN {users_items_link} UI "
+ . "ON I.item_id = UI.item_id ";
+
+ if ($isActive) {
+ $sql .= "INNER JOIN {users} U "
+ . "ON UI.user_id = U.user_id ";
+ }
+
+ $sql .= "WHERE (I.type = ? "
+ . "OR I.type = ?) "
+ . "AND UI.content = ? ";
+
+ $bindValues = array(
+ USER_TYPE_EMAIL,
+ USER_TYPE_MOBILE_EMAIL,
+ $mail
+ );
+
+ if ($isActive) {
+ $sql .= "AND U.active_flag = ? ";
+ $bindValues[] = _USER_ACTIVE_FLAG_ON;
+ }
+
+ $users = $this->_db->execute($sql, $bindValues);
+ if ($users === false) {
+ $this->_db->addError();
+ }
+
+ if (!empty($users)) {
+ $userId = $users[0]['user_id'];
+ }
+
+ return $userId;
+ }
}
?>
\ No newline at end of file
diff --git a/html/webapp/components/whatsnew/Action.class.php b/html/webapp/components/whatsnew/Action.class.php
index 1e71a4e..c1aad0f 100644
--- a/html/webapp/components/whatsnew/Action.class.php
+++ b/html/webapp/components/whatsnew/Action.class.php
@@ -407,102 +407,175 @@ function _deleteUser(&$recordSet)
}
/**
- * 新着情報の削除
- *
+ * ルーム、モジュール毎で、指定件数以上の古いデータを削除する
+ *
+ * @param string $moduleId モジュールID
+ * @param mixed $roomIds ルームID、ルームID配列
+ * @return boolean true or false
* @access public
*/
- function _deletePeriod($module_id, $arr_room_id)
+ function _deletePeriod($moduleId, $roomIds)
{
- if (rand(0, 10) != 0) { return true; }
+ //if (rand(0, 10) != 0) { return true; }
- $modulesView =& $this->_container->getComponent("modulesView");
- $module = $modulesView->getModuleByDirname("whatsnew");
+ $modulesView =& $this->_container->getComponent('modulesView');
+ $module = $modulesView->getModuleByDirname('whatsnew');
- $configView =& $this->_container->getComponent("configView");
- $config = $configView->getConfig($module["module_id"], false);
+ $configView =& $this->_container->getComponent('configView');
+ $config = $configView->getConfig($module['module_id'], false);
if ($config === false) {
- return false;
- }
- $whatsnew_period = $config["whatsnew_period"]["conf_value"];
- $offset = $config["whatsnew_delete_number"]["conf_value"];
- $limit = 1;
- $time = timezone_date();
- $timestamp = mktime(intval(substr($time,8,2)),intval(substr($time,10,2)),intval(substr($time,12,2)),
- intval(substr($time,4,2)),intval(substr($time,6,2))-intval($whatsnew_period),intval(substr($time,0,4)));
- $timestamp = date("YmdHis", $timestamp);
-
- $array_room = array();
- if(is_array($arr_room_id)){
- $array_room = $arr_room_id;
- }else{
- $array_room[0] = $arr_room_id;
- }
- foreach($array_room as $room_id){
- $sql = "SELECT insert_time, child_update_time, room_id FROM {whatsnew}" .
- " WHERE module_id = ".$module_id.
- " AND room_id = ".$room_id.
- " ORDER BY child_update_time desc";
- $result = $this->_db->execute($sql, null, $limit, $offset);
- if ($result === false) {
- $this->_db->addError();
- return false;
- }
- //一定の件数以前の新着情報で一定の期間を過ぎている新着情報を削除する。
- if(isset($result[0]["insert_time"]) && ($result[0]["insert_time"] < $timestamp)){
- $max_time = ($result[0]["insert_time"] > $result[0]["child_update_time"]) ? $result[0]["insert_time"] : $result[0]["child_update_time"];
- $sql = "SELECT whatsnew_id FROM {whatsnew}" .
- " WHERE insert_time < ? AND child_update_time < ?".
- " AND module_id = ".$module_id.
- " AND room_id = ".$result[0]["room_id"];
- $in_str = $this->_db->execute($sql, array("insert_time"=>$max_time, "child_update_time"=>$max_time),null,null,false,array($this,"_deletePeriodCallback"));
- if ($in_str === false) {
- $this->_db->addError();
- return false;
- }
- if($in_str != "") {
- $sql = "DELETE FROM {whatsnew}" .
- " WHERE 1 = 1".
- $in_str;
- $result = $this->_db->execute($sql);
- if ($result === false) {
- $this->_db->addError();
- return false;
- }
-
- $sql = "DELETE FROM {whatsnew_user}" .
- " WHERE 1 = 1".
- $in_str;
- $result = $this->_db->execute($sql);
- if ($result === false) {
- $this->_db->addError();
- return false;
- }
+ return false;
+ }
+ $period = $config['whatsnew_period']['conf_value'];
+ $maximumNumber = $config['whatsnew_delete_number']['conf_value'];
+
+ $periodTime = timezone_date();
+ $periodTime = mktime(intval(substr($periodTime, 8, 2)),
+ intval(substr($periodTime, 10, 2)),
+ intval(substr($periodTime, 12, 2)),
+ intval(substr($periodTime, 4, 2)),
+ intval(substr($periodTime, 6, 2)) - intval($period),
+ intval(substr($periodTime,0,4)));
+ $periodTime = date('YmdHis', $periodTime);
+
+ if (!is_array($roomIds)) {
+ $roomIds = array(
+ $roomIds
+ );
+ }
+
+ $sql = "SELECT room_id, COUNT(*) count "
+ . "FROM {whatsnew} "
+ . "WHERE room_id IN ('" . implode("','", $roomIds) . "') "
+ . "AND module_id = ? "
+ . "GROUP BY room_id "
+ . "HAVING count > ?";
+ $bindValues = array(
+ $moduleId,
+ $maximumNumber
+ );
+ $whatsnews = $this->_db->execute($sql, $bindValues);
+
+ $inValue = '';
+ foreach($whatsnews as $whatsnew){
+ $sql = "SELECT whatsnew_id "
+ . "FROM {whatsnew} "
+ . "WHERE insert_time < ? "
+ . "AND child_update_time < ? "
+ . "AND module_id = ? "
+ . "AND room_id = ? "
+ . "ORDER BY child_update_time";
+ $bindValues = array(
+ $periodTime,
+ $periodTime,
+ $moduleId,
+ $whatsnew['room_id']
+ );
+ $oldWhatsnews = $this->_db->execute($sql, $bindValues);
+
+ $deleteNumber = $whatsnew['count'] - $maximumNumber;
+ foreach ($oldWhatsnews as $oldWhatsnew) {
+ $inValue .= $oldWhatsnew['whatsnew_id'] . ',';
+ $deleteNumber--;
+ if ($deleteNumber <= 0) {
+ break;
}
}
+ }
+
+ if (empty($inValue)) {
+ return true;
+ }
+ $inValue = substr($inValue, 0, -1);
+
+ if (!$this->_deleteByInOperator('whatsnew_user', $inValue)) {
+ return false;
}
+ if (!$this->_deleteByInOperator('whatsnew', $inValue)) {
+ return false;
+ }
+
return true;
}
-/**
- * 新着情報の削除
+ /**
+ * ルームIDで新着データを削除する
*
- * @access public
+ * @param string $roomId ルームID
+ * @return boolean true or false
+ * @access public
*/
- function _deletePeriodCallback(&$recordSet)
+ function deleteByRoomId($roomId)
{
- $ret = "";
- $str = "";
- $first = true;
- while ($row = $recordSet->fetchRow()) {
- if($first == false) {
- $str .= ",";
- }
- $str .= $row[0];
- $first = false;
+ $module =& $this->_modulesView->getModuleByDirname('whatsnew');
+ if (!$module) {
+ return true;
}
- if($str != "")
- $ret = " AND whatsnew_id IN (".$str.")";
- return $ret;
+
+ $sql = "SELECT whatsnew_id "
+ . "FROM {whatsnew} "
+ . "WHERE room_id = ? ";
+ $inValue = $this->_db->execute($sql, $roomId, null, null, false, array($this, '_createDelimitedString'));
+ if ($inValue == false) {
+ $this->_db->addError();
+ return false;
+ }
+
+ if (!$this->_deleteByInOperator('whatsnew_user', $inValue)) {
+ return false;
+ }
+
+ $sql = "DELETE FROM {whatsnew} "
+ . "WHERE room_id = ? ";
+ if (!$this->_db->execute($sql, $roomId)) {
+ $this->_db->addError();
+ return false;
+ }
+ }
+
+ /**
+ * ADORecordSetの1カラム目(ID)を指定文字区切りの文字列にする
+ *
+ * @param object $recordSet ADORecordSetオブジェクト
+ * @param string $glue 区切り文字
+ * @return string 指定文字区切りの文字列
+ * @access private
+ */
+ function &_createDelimitedIdString(&$recordSet, $glue = ',')
+ {
+ $string = '';
+ while ($whatsnew = $recordSet->fetchRow()) {
+ $string .= $whatsnew[0]. $glue;
+ }
+ if (!strlen($glue)) {
+ $string = substr($string, 0, strlen($glue) * -1);
+ }
+
+ return $string;
+ }
+
+ /**
+ * IN演算子でデータを削除する。
+ *
+ * @param string $tableName 対象テーブル名称
+ * @param string $inValue IN演算子の値(カンマ区切り文字列)
+ * @return boolean true or false
+ * @access public
+ */
+ function _deleteByInOperator($tableName, $inValue)
+ {
+ if (!strlen($inValue)) {
+ return true;
+ }
+
+ $sql = "DELETE FROM {" . $tableName . "} "
+ . "WHERE whatsnew_id IN (" . $inValue . ")";
+ if (!$this->_db->execute($sql)) {
+ $this->_db->addError();
+ return false;
+ }
+
+ return true;
}
}
-?>
+?>
\ No newline at end of file
diff --git a/html/webapp/config/define.inc.php b/html/webapp/config/define.inc.php
index 94ca8d5..a4e3a1e 100644
--- a/html/webapp/config/define.inc.php
+++ b/html/webapp/config/define.inc.php
@@ -219,7 +219,7 @@
define('_PERMALINK_PRIVATE_PREFIX_NAME', 'private');
define('_PERMALINK_GROUP_PREFIX_NAME', 'group');
-define('_PERMALINK_CONTENT', '(%| |#|<|>|\+|\\\\|\"|\'|&|\?|\.|=|\/|~|:|;|,|\$|@)');
+define('_PERMALINK_CONTENT', '(%| |#|<|>|\+|\\\\|\"|\'|&|\?|\.$|=|\/|~|:|;|,|\$|@|^\.|\||\]|\[|\!|\(|\)|\*)');
define('_PERMALINK_PROHIBITION', "/"._PERMALINK_CONTENT."/i");
define('_PERMALINK_PROHIBITION_REPLACE', "-");
define('_PERMALINK_DIR_CONTENT', "^(install|css|js|images|themes|htdocs|webapp|maple|".
diff --git a/html/webapp/config/global-config.ini b/html/webapp/config/global-config.ini
index 7f72f3b..7846f86 100644
--- a/html/webapp/config/global-config.ini
+++ b/html/webapp/config/global-config.ini
@@ -57,6 +57,14 @@ _UPLOAD_AVATAR_MAX_HEIGHT_IMAGE = 180
_UPLOAD_THUMBNAIL_MAX_WIDTH_IMAGE = 66
_UPLOAD_THUMBNAIL_MAX_HEIGHT_IMAGE = 66
+;-----------------画像アップロード後解像度---------------------------------
+_UPLOAD_RESOLUTION_IMAGE_LARGE_WIDTH = 800
+_UPLOAD_RESOLUTION_IMAGE_LARGE_HEIGHT = 600
+_UPLOAD_RESOLUTION_IMAGE_MIDDLE_WIDTH = 640
+_UPLOAD_RESOLUTION_IMAGE_MIDDLE_HEIGHT = 480
+_UPLOAD_RESOLUTION_IMAGE_SMALL_WIDTH = 480
+_UPLOAD_RESOLUTION_IMAGE_SMALL_HEIGHT = 360
+
;-----------------アップロードのパーミッション-----------------------------
_UPLOAD_FOLDER_MODE = 0777
_UPLOAD_FILE_MODE = 0666
diff --git a/html/webapp/language/chinese/global.ini b/html/webapp/language/chinese/global.ini
index cbb8195..6f199e9 100644
--- a/html/webapp/language/chinese/global.ini
+++ b/html/webapp/language/chinese/global.ini
@@ -149,6 +149,7 @@ _CANCEL="取消"
_GUEST = "访客" ;//ログインしていないハンドル名
_SPACE_TYPE_NAME_PUBLIC = "公共空间"
+_SPACE_TYPE_NAME_MYPORTAL = "我的空间"
_SPACE_TYPE_NAME_PRIVATE = "个人空间"
_SPACE_TYPE_NAME_GROUP = "群组空间"
@@ -260,6 +261,7 @@ _cancel_grouping_title="拆分选中的区块"
;_cancel_grouping_confirm="您确定要拆分%s?"
_audio_browser="语音浏览器用户"
_pc_viewer = "切换到PC浏览器"
+_confirm_pc_view="您切换到PC浏览器?"
_move_center="移动到文本输入区"
_invalid_auth=_INVALID_AUTH
_invalid_input=_INVALID_INPUT
diff --git a/html/webapp/language/english/global.ini b/html/webapp/language/english/global.ini
index dec5c4d..5e0abbe 100644
--- a/html/webapp/language/english/global.ini
+++ b/html/webapp/language/english/global.ini
@@ -149,6 +149,7 @@ _CANCEL="Cancell"
_GUEST = "Guest" ;//ログインしていないハンドル名
_SPACE_TYPE_NAME_PUBLIC = "Public Space"
+_SPACE_TYPE_NAME_MYPORTAL = "My Portal"
_SPACE_TYPE_NAME_PRIVATE = "Private Space"
_SPACE_TYPE_NAME_GROUP = "Group Space"
@@ -260,6 +261,7 @@ _cancel_grouping_title="Ungrouping the selected blocks"
;_cancel_grouping_confirm="You are ungrouping %s. Are you sure?"
_audio_browser="For the audio browser users"
_pc_viewer="Switch to PC Viewer"
+_confirm_pc_view="Switch to PC Viewer.\nAre you sure?"
_move_center="Move to the content area"
_invalid_auth=_INVALID_AUTH
_invalid_input=_INVALID_INPUT
diff --git a/html/webapp/language/english/items.ini b/html/webapp/language/english/items.ini
index 6a20737..8bd423d 100644
--- a/html/webapp/language/english/items.ini
+++ b/html/webapp/language/english/items.ini
@@ -15,7 +15,7 @@ USER_ITEM_ACTIVE_FLAG="Status"
USER_ITEM_ACTIVE_FLAG_OFF="nonactive"
USER_ITEM_ACTIVE_FLAG_ON="active"
USER_ITEM_ACTIVE_FLAG_PENDING="waiting"
-USER_ITEM_ACTIVE_FLAG_MAILED="not yet logged-in"
+USER_ITEM_ACTIVE_FLAG_MAILED="not yet logged-in"
USER_ITEM_LANG_DIRNAME="Language"
USER_ITEM_TIMEZONE_OFFSET="TimeZone"
USER_ITEM_AVATAR="Avatar"
@@ -27,8 +27,8 @@ USER_ITEM_INSERT_TIME="Registered"
USER_ITEM_INSERT_USER_NAME="Creator"
USER_ITEM_UPDATE_TIME="Last modified"
USER_ITEM_UPDATE_USER_NAME="Updater"
-USER_ITEM_EMAIL="e-mail"
-USER_ITEM_MOBILE_EMAIL="mobile mail"
+USER_ITEM_EMAIL="E-mail"
+USER_ITEM_MOBILE_EMAIL="Mobile mail"
USER_ITEM_GENDER="Sex"
USER_ITEM_COUNTRY_CODE="Nationality"
USER_ITEM_ADDRESS="Location"
@@ -38,8 +38,8 @@ USER_ITEM_TEXTHTML_MODE = "Display format on mobile"
USER_ITEM_IMGDSP_SIZE = "Image size on mobile"
;//アイテム項目-詳細
-USER_ITEM_GENDER_MAN="male"
-USER_ITEM_GENDER_WOMAN="female"
+USER_ITEM_GENDER_MAN="Male"
+USER_ITEM_GENDER_WOMAN="Female"
USER_ITEM_TEXTHTML_MODE_TEXT = "TEXT format"
USER_ITEM_TEXTHTML_MODE_HTML = "HTML format"
@@ -48,7 +48,7 @@ USER_ITEM_IMGDSP_SIZE_240 = "width 240px"
USER_ITEM_IMGDSP_SIZE_480 = "width 480px"
;//アイテム項目-説明
-USER_ITEM_MES_CHAR_DESCRIPTION="Minimum 4 characters. No space or special character."
+USER_ITEM_MES_CHAR_DESCRIPTION="Please choose at least 4 characters string. No space or special character is allowed."
USER_ITEM_MES_AUTH_DESCRIPTION="If set to the administrator, it will be set to the room manager of all rooms and join these rooms."
USER_ITEM_MES_TEXTHTML_MODE_DESCRIPTION = "Set initial display format on mobile phone. If you select HTML format, 'Display image size' set to 'reduce the width 240px' we strongly recommend that you."
diff --git a/html/webapp/language/english/lang_common.js b/html/webapp/language/english/lang_common.js
index 2ace85f..9f12ebf 100644
--- a/html/webapp/language/english/lang_common.js
+++ b/html/webapp/language/english/lang_common.js
@@ -16,7 +16,7 @@ compCalendarLang = {
summary : "Calendar",
icon_alt : "Calendar",
icon_title : "Show Calendar",
- year : "Year",
+ year : "",
month : "Month",
week_sun : "Sun",
week_mon : "Mon",
@@ -34,7 +34,19 @@ compCalendarLang = {
btn_prev_year : "«",
btn_next_year : "»",
btn_prev_month : "‹",
- btn_next_month : "›"
+ btn_next_month : "›",
+ month_jan : "Jan",
+ month_feb : "Feb",
+ month_mar : "Mar",
+ month_apr : "Apr",
+ month_may : "May",
+ month_jun : "Jun",
+ month_jul : "Jul",
+ month_aug : "Aug",
+ month_sep : "Sep",
+ month_oct : "Oct",
+ month_nov : "Nov",
+ month_dec : "Dec"
};
/*WYSIWYG用定義ファイル*/
compTextareaLang = {
@@ -128,7 +140,7 @@ compInsertLinkLang = {
url : "URL(href=)",
title : "Title(title=)",
target : "Target(target=)",
- target_none : "No specification",
+ target_none : "Not specified",
target_blank : "New window(_blank)",
target_other : "Other",
ok : "Insert Link",
@@ -210,7 +222,7 @@ compTableBorderLang = {
row : "Row",
col : "Col",
cell : "Cell",
- none : "No specification",
+ none : "Not specified",
outer : "Borders",
top : "Overline",
bottom : "Underline",
diff --git a/html/webapp/language/japanese/global.ini b/html/webapp/language/japanese/global.ini
index 30ce7ca..e08c405 100644
--- a/html/webapp/language/japanese/global.ini
+++ b/html/webapp/language/japanese/global.ini
@@ -149,6 +149,7 @@ _CANCEL="キャンセル"
_GUEST = "ゲスト" ;//ログインしていないハンドル名
_SPACE_TYPE_NAME_PUBLIC = "パブリックスペース"
+_SPACE_TYPE_NAME_MYPORTAL = "マイポータル"
_SPACE_TYPE_NAME_PRIVATE = "プライベートスペース"
_SPACE_TYPE_NAME_GROUP = "グループスペース"
@@ -260,6 +261,7 @@ _cancel_grouping_title="選択したブロックのグループ化を解除し
;_cancel_grouping_confirm="%sのグループ化を解除します よろしいですか?"
_audio_browser="音声ブラウザ対応ページへ"
_pc_viewer="PCビューアーに切り替える"
+_confirm_pc_view="PC表示に切り替えます。\nよろしいですか?"
_move_center="コンテンツエリアへ"
_invalid_auth=_INVALID_AUTH
_invalid_input=_INVALID_INPUT
diff --git a/html/webapp/language/japanese/lang_common.js b/html/webapp/language/japanese/lang_common.js
index b6c2b7d..4d2a0fb 100644
--- a/html/webapp/language/japanese/lang_common.js
+++ b/html/webapp/language/japanese/lang_common.js
@@ -33,7 +33,19 @@ compCalendarLang = {
btn_prev_year : "«",
btn_next_year : "»",
btn_prev_month : "‹",
- btn_next_month : "›"
+ btn_next_month : "›",
+ month_jan : " 1月",
+ month_feb : " 2月",
+ month_mar : " 3月",
+ month_apr : " 4月",
+ month_may : " 5月",
+ month_jun : " 6月",
+ month_jul : " 7月",
+ month_aug : " 8月",
+ month_sep : " 9月",
+ month_oct : "10月",
+ month_nov : "11月",
+ month_dec : "12月"
};
/*WYSIWYG用定義ファイル*/
compTextareaLang = {
diff --git a/html/webapp/modules/authority/templates/default/authority_view_admin_selectmodules.html b/html/webapp/modules/authority/templates/default/authority_view_admin_selectmodules.html
index 17ec2d3..6182c94 100644
--- a/html/webapp/modules/authority/templates/default/authority_view_admin_selectmodules.html
+++ b/html/webapp/modules/authority/templates/default/authority_view_admin_selectmodules.html
@@ -95,7 +95,7 @@
<{* 戻るボタン *}>
<{* 次へボタン *}>
-
+
<{* キャンセルボタン *}>
diff --git a/html/webapp/modules/backup/action/main/restoreresult/Restoreresult.class.php b/html/webapp/modules/backup/action/main/restoreresult/Restoreresult.class.php
index b5f1dde..024531d 100644
--- a/html/webapp/modules/backup/action/main/restoreresult/Restoreresult.class.php
+++ b/html/webapp/modules/backup/action/main/restoreresult/Restoreresult.class.php
@@ -17,32 +17,32 @@
class Backup_Action_Main_Restoreresult extends Action
{
//
- // リクエストパラメータを受け取るため
- //
- var $upload_id = null;
- var $backup_page_id = null;
- var $module_id = null;
-
- // 状態 (restore_type != "top")
- // バブリックのTop or プライベートのTopならば、必ず公開
- var $display_flag = null;
-
- // バックアップされた会員を参加させる(restore_type != "top" && restore_type != "subgroup")
- // サブグループならば、必ず初期化
- // パブリックスペース、プライベートスペースならば、参加者は変更しない
- // パブリックスペース内のルームについては、初期化する
- var $entry_user = null;
-
- // サブグループならばリストア位置を変更できる(restore_type == "subgroup")
- var $regist_location = null;
-
- // リストアするモジュール
- var $entry_modules = null;
-
- // 使用コンポーネントを受け取るため
- var $backupRestore = null;
- var $fileAction = null;
- var $pagesView = null;
+ // リクエストパラメータを受け取るため
+ //
+ var $upload_id = null;
+ var $backup_page_id = null;
+ var $module_id = null;
+
+ // 状態 (restore_type != "top")
+ // バブリックのTop or プライベートのTopならば、必ず公開
+ var $display_flag = null;
+
+ // バックアップされた会員を参加させる(restore_type != "top" && restore_type != "subgroup")
+ // サブグループならば、必ず初期化
+ // パブリックスペース、プライベートスペースならば、参加者は変更しない
+ // パブリックスペース内のルームについては、初期化する
+ var $entry_user = null;
+
+ // サブグループならばリストア位置を変更できる(restore_type == "subgroup")
+ var $regist_location = null;
+
+ // リストアするモジュール
+ var $entry_modules = null;
+
+ // 使用コンポーネントを受け取るため
+ var $backupRestore = null;
+ var $fileAction = null;
+ var $pagesView = null;
var $configView = null;
var $db = null;
var $usersView = null;
@@ -54,71 +54,71 @@ class Backup_Action_Main_Restoreresult extends Action
//var $room_arr_flat = null;
- // 値をセットするため
- var $transfer_id_arr = array();
- var $del_physical_file_name_arr = array();
- var $temporary_file_path = "";
-
- var $_self_flag = false;
-
- // 手動ロールバックは、メモリが大量に使う可能性があるため、別ファイルに吐き出すほうがよい
- var $deleteParams = array(); // 手動ロールバック用
- var $insertParams = array(); // 手動ロールバック用
- var $uploadParams = array(); // 手動ロールバック用
- var $uploadWhereParams = array(); // 手動ロールバック用
- var $selectParams = array(); // 手動ロールバック用
-
- /**
- * バックアップファイル-リストア処理(実行)
- *
- * @access public
- */
- function execute()
- {
- $temporary_file_path = FILEUPLOADS_DIR."backup/".BACKUP_TEMPORARY_DIR_NAME."/".BACKUP_RESTORE_DIR_NAME."/" . $this->backup_page_id. "/";
+ // 値をセットするため
+ var $transfer_id_arr = array();
+ var $del_physical_file_name_arr = array();
+ var $temporary_file_path = "";
+
+ var $_self_flag = false;
+
+ // 手動ロールバックは、メモリが大量に使う可能性があるため、別ファイルに吐き出すほうがよい
+ var $deleteParams = array(); // 手動ロールバック用
+ var $insertParams = array(); // 手動ロールバック用
+ var $uploadParams = array(); // 手動ロールバック用
+ var $uploadWhereParams = array(); // 手動ロールバック用
+ var $selectParams = array(); // 手動ロールバック用
+
+ /**
+ * バックアップファイル-リストア処理(実行)
+ *
+ * @access public
+ */
+ function execute()
+ {
+ $temporary_file_path = FILEUPLOADS_DIR."backup/".BACKUP_TEMPORARY_DIR_NAME."/".BACKUP_RESTORE_DIR_NAME."/" . $this->backup_page_id. "/";
$this->backupRestore->mkdirTemporary(BACKUP_RESTORE_DIR_NAME);
- $ret = $this->backupRestore->getRestoreArray($this->upload_id, $this->backup_page_id, $this->module_id, $temporary_file_path);
-
- if($ret === false) {
- return 'error';
- }
- $backup_uploads = $this->db->selectExecute("backup_uploads", array("upload_id" => $this->upload_id));
- if($backup_uploads === false && !isset($backup_uploads[0])) {
- return 'error';
- }
- $this->temporary_file_path = $temporary_file_path;
-
- list($room_inf, $restore_modules, $version_arr, $modules) = $ret;
-
- $restore_data = $this->backupRestore->getRoomArray();
-
- $restore_type = $restore_modules["system"]['restore_type'];
- if(!isset($restore_data['system']['room'])) {
- // 現状、未処理
- $this->fileAction->delDir($this->temporary_file_path);
- return 'error';
- }
- $this->_self_flag = $restore_modules["system"]['self_flag'];
-
-
- //--------------------------------------------------
- // システム関連テーブルリストア
- // - PKを振りなおす -
- // XMLは、改竄されていないとして処理(電子認証)
- //--------------------------------------------------
- $pages_buf = array();
- $page_id_arr = array();
- $pages_users_link_room_id = array();
- $normal_block_col_arr = array();
- $err_block_row_arr = array();
- $upload_id_arr = array();
- $physical_file_name_arr = array();
- $this->del_physical_file_name_arr = array();
- //$insert_blocks = array();
- $login_user_id = $this->session->getParameter("_user_id");
-
- // room_idで削除できる項目は、はじめに削除
- if($restore_type == "top") {
+ $ret = $this->backupRestore->getRestoreArray($this->upload_id, $this->backup_page_id, $this->module_id, $temporary_file_path);
+
+ if($ret === false) {
+ return 'error';
+ }
+ $backup_uploads = $this->db->selectExecute("backup_uploads", array("upload_id" => $this->upload_id));
+ if($backup_uploads === false && !isset($backup_uploads[0])) {
+ return 'error';
+ }
+ $this->temporary_file_path = $temporary_file_path;
+
+ list($room_inf, $restore_modules, $version_arr, $modules) = $ret;
+
+ $restore_data = $this->backupRestore->getRoomArray();
+
+ $restore_type = $restore_modules["system"]['restore_type'];
+ if(!isset($restore_data['system']['room'])) {
+ // 現状、未処理
+ $this->fileAction->delDir($this->temporary_file_path);
+ return 'error';
+ }
+ $this->_self_flag = $restore_modules["system"]['self_flag'];
+
+
+ //--------------------------------------------------
+ // システム関連テーブルリストア
+ // - PKを振りなおす -
+ // XMLは、改竄されていないとして処理(電子認証)
+ //--------------------------------------------------
+ $pages_buf = array();
+ $page_id_arr = array();
+ $pages_users_link_room_id = array();
+ $normal_block_col_arr = array();
+ $err_block_row_arr = array();
+ $upload_id_arr = array();
+ $physical_file_name_arr = array();
+ $this->del_physical_file_name_arr = array();
+ //$insert_blocks = array();
+ $login_user_id = $this->session->getParameter("_user_id");
+
+ // room_idで削除できる項目は、はじめに削除
+ if($restore_type == "top") {
// Topのものは置き換える対象なので
// 現在のものを削除する
// RollBackのため、SelectしてDelete
@@ -131,10 +131,10 @@ function execute()
$top_page = $this->pagesView->getPrivateSpaceByUserId($login_user_id, 0, 0, false);
if($top_page === false) return 'error';
if($room_inf['default_entry_flag'] == _ON && isset($top_page[1])) {
- $index_count = 1;
- } else {
- $index_count = 0;
- }
+ $index_count = 1;
+ } else {
+ $index_count = 0;
+ }
} else {
// パブリックスペース
$where_params = array(
@@ -158,21 +158,21 @@ function execute()
}
}
- //$adodb = $this->db->getAdoDbObject();
- foreach($restore_data['system']['room'] as $room_id => $restore_table_arr) {
- //
- // room_id毎にリストアしていく
- //
- foreach($restore_table_arr as $table_name => $rec_sets) {
- foreach($rec_sets as $rec_set) {
- if($restore_type == "top" && !$this->_self_flag) {
- if(isset($rec_set['page_id']) && $rec_set['page_id'] == $pre_top_page_id) {
- $rec_set['page_id'] = $room_inf['page_id'];
- }
- if(isset($rec_set['room_id']) && $rec_set['room_id'] == $pre_top_room_id) {
- $rec_set['room_id'] = $room_inf['room_id'];
- }
- }
+ //$adodb = $this->db->getAdoDbObject();
+ foreach($restore_data['system']['room'] as $room_id => $restore_table_arr) {
+ //
+ // room_id毎にリストアしていく
+ //
+ foreach($restore_table_arr as $table_name => $rec_sets) {
+ foreach($rec_sets as $rec_set) {
+ if($restore_type == "top" && !$this->_self_flag) {
+ if(isset($rec_set['page_id']) && $rec_set['page_id'] == $pre_top_page_id) {
+ $rec_set['page_id'] = $room_inf['page_id'];
+ }
+ if(isset($rec_set['room_id']) && $rec_set['room_id'] == $pre_top_room_id) {
+ $rec_set['room_id'] = $room_inf['room_id'];
+ }
+ }
if ($restore_type == "top" && $room_inf['private_flag'] == _ON) {
if (isset($rec_set['insert_site_id'])) {
$rec_set['insert_site_id'] = $this->session->getParameter("_site_id");
@@ -188,152 +188,152 @@ function execute()
}
}
- if($table_name == "pages") {
- //-------------------------------------------------------------------------
- // ページテーブル
- //-------------------------------------------------------------------------
- $prev_page_id = $rec_set['page_id'];
- $prev_thread_num = $rec_set['thread_num'];
- if($restore_type == "top" && $rec_set['thread_num'] == 0) {
- // パブリックスペース、プライベートスペースならば、ID変更なし
- // Insertも行わない
- $this->_transferId($table_name, $rec_set, "page_id", null, $rec_set['page_id']);
- } else if($rec_set['display_position'] != _DISPLAY_POSITION_CENTER){
- // 左右カラム、ヘッダー、フッターならばID変更なし
- // Insertも行わない
- $this->_transferId($table_name, $rec_set, "page_id", null, $rec_set['page_id']);
- } else {
- // サブグループならばリストア位置を変更
- if($this->regist_location != null && $restore_type == "subgroup") {
- $restore_page = $this->pagesView->getPageById(intval($this->regist_location));
- if($restore_page === false || !isset($restore_page['page_id'])) {
- $this->_rollBack();
- return 'error';
- }
- if((($this->backup_page_id == 0 && $backup_uploads[0]['thread_num'] == $prev_thread_num) || $this->backup_page_id == $prev_page_id) &&
- $restore_page['authority_id'] >= _AUTH_CHIEF && $restore_page['createroom_flag'] == _ON) {
- // リストアOKなルームID
- $rec_set['parent_id'] = intval($this->regist_location);
- }
- }
-
- // ページ名称
- if($restore_type != "top" && ($this->backup_page_id == $rec_set['page_id'] || ($this->backup_page_id == 0 && $backup_uploads[0]['thread_num'] == $prev_thread_num))) {
- $rec_set['page_name'] = $room_inf['page_name'];
- $display_sequence = $this->pagesView->getMaxChildPage($rec_set['parent_id'], $rec_set['lang_dirname']);
- $display_sequence = intval($display_sequence) + 1;
- $rec_set['display_sequence'] = $display_sequence;
- }
-
- // page_id振替
- $this->_transferId($table_name, $rec_set, "page_id");
-
- //if($restore_type != "top") {
- // room_id振替
- $this->_transferId($table_name, $rec_set, "page_id", "room_id");
- //}
- if(isset($this->transfer_id_arr['page_id'][$rec_set['root_id']])) {
- // root_id振替
- $this->_transferId($table_name, $rec_set, "page_id", "root_id");
- }
- if(isset($this->transfer_id_arr['page_id'][$rec_set['parent_id']])) {
- // parent_id振替
- //if($this->regist_location != null && $restore_type == "subgroup") {
- // $this->_transferId($table_name, $rec_set, "page_id", "parent_id", $rec_set['parent_id']);
- //} else {
- $this->_transferId($table_name, $rec_set, "page_id", "parent_id");
- //}
- }
- // display_flagを_PAGES_DISPLAY_FLAG_DISABLEDにしておく
- // TODO:準備中のルームも最終的に公開中にされてしまうが、仕様とする
- if($rec_set['page_id'] == $rec_set['room_id']) {
- $rec_set['display_flag'] = _PAGES_DISPLAY_FLAG_DISABLED;
- } else {
- $rec_set['display_flag'] = _ON;
- }
- $rec_set['site_id'] = $this->session->getParameter("_site_id");
- $result = $this->db->insertExecute($table_name, $rec_set, false);
- if ($result === false) {
- $this->_rollBack();
- return 'error';
+ if($table_name == "pages") {
+ //-------------------------------------------------------------------------
+ // ページテーブル
+ //-------------------------------------------------------------------------
+ $prev_page_id = $rec_set['page_id'];
+ $prev_thread_num = $rec_set['thread_num'];
+ if($restore_type == "top" && $rec_set['thread_num'] == 0) {
+ // パブリックスペース、プライベートスペースならば、ID変更なし
+ // Insertも行わない
+ $this->_transferId($table_name, $rec_set, "page_id", null, $rec_set['page_id']);
+ } else if($rec_set['display_position'] != _DISPLAY_POSITION_CENTER){
+ // 左右カラム、ヘッダー、フッターならばID変更なし
+ // Insertも行わない
+ $this->_transferId($table_name, $rec_set, "page_id", null, $rec_set['page_id']);
+ } else {
+ // サブグループならばリストア位置を変更
+ if($this->regist_location != null && $restore_type == "subgroup") {
+ $restore_page = $this->pagesView->getPageById(intval($this->regist_location));
+ if($restore_page === false || !isset($restore_page['page_id'])) {
+ $this->_rollBack();
+ return 'error';
+ }
+ if((($this->backup_page_id == 0 && $backup_uploads[0]['thread_num'] == $prev_thread_num) || $this->backup_page_id == $prev_page_id) &&
+ $restore_page['authority_id'] >= _AUTH_CHIEF && $restore_page['createroom_flag'] == _ON) {
+ // リストアOKなルームID
+ $rec_set['parent_id'] = intval($this->regist_location);
+ }
+ }
+
+ // ページ名称
+ if($restore_type != "top" && ($this->backup_page_id == $rec_set['page_id'] || ($this->backup_page_id == 0 && $backup_uploads[0]['thread_num'] == $prev_thread_num))) {
+ $rec_set['page_name'] = $room_inf['page_name'];
+ $display_sequence = $this->pagesView->getMaxChildPage($rec_set['parent_id'], $rec_set['lang_dirname']);
+ $display_sequence = intval($display_sequence) + 1;
+ $rec_set['display_sequence'] = $display_sequence;
+ }
+
+ // page_id振替
+ $this->_transferId($table_name, $rec_set, "page_id");
+
+ //if($restore_type != "top") {
+ // room_id振替
+ $this->_transferId($table_name, $rec_set, "page_id", "room_id");
+ //}
+ if(isset($this->transfer_id_arr['page_id'][$rec_set['root_id']])) {
+ // root_id振替
+ $this->_transferId($table_name, $rec_set, "page_id", "root_id");
+ }
+ if(isset($this->transfer_id_arr['page_id'][$rec_set['parent_id']])) {
+ // parent_id振替
+ //if($this->regist_location != null && $restore_type == "subgroup") {
+ // $this->_transferId($table_name, $rec_set, "page_id", "parent_id", $rec_set['parent_id']);
+ //} else {
+ $this->_transferId($table_name, $rec_set, "page_id", "parent_id");
+ //}
+ }
+ // display_flagを_PAGES_DISPLAY_FLAG_DISABLEDにしておく
+ // TODO:準備中のルームも最終的に公開中にされてしまうが、仕様とする
+ if($rec_set['page_id'] == $rec_set['room_id']) {
+ $rec_set['display_flag'] = _PAGES_DISPLAY_FLAG_DISABLED;
+ } else {
+ $rec_set['display_flag'] = _ON;
+ }
+ $rec_set['site_id'] = $this->session->getParameter("_site_id");
+ $result = $this->db->insertExecute($table_name, $rec_set, false);
+ if ($result === false) {
+ $this->_rollBack();
+ return 'error';
}
$this->deleteParams[$table_name][] = $rec_set;
- }
- // permalink
- if(($this->backup_page_id == 0 && $backup_uploads[0]['thread_num'] == $prev_thread_num) || $this->backup_page_id == $prev_page_id) {
- $pages_permalink = $rec_set;
- }
- // Bufferセット
- $page_id_arr[] = $rec_set['page_id'];
- $pages_buf[$rec_set['page_id']] = $rec_set;
- } else if($table_name == "pages_modules_link") {
- //-------------------------------------------------------------------------
- // ページモジュールリンクテーブル
- // module_idからリストア先のmodule_idに変換
- // エラーがあったモジュールはリストアしない
- //-------------------------------------------------------------------------
- if($restore_type == "top" && $room_inf['page_id'] == $rec_set['room_id']) {
- // パブリックスペース、プライベートスペースならば、ID変更なし
- // Insertも行わない
- $this->_transferId($table_name, $rec_set, "page_id", "room_id", $rec_set['room_id']);
- } else {
- // dirname取得
- if(isset($version_arr['__'.$rec_set['module_id']])) {
- $dirname = $version_arr['__'.$rec_set['module_id']];
- if(!isset($restore_modules[$dirname]['error_mes'])) {
- // エラーなし
- // module_id振替
- $this->_transferId($table_name, $rec_set, "module_id", null, $modules[$dirname]['module_id']);
-
- // room_id振替
- $this->_transferId($table_name, $rec_set, "page_id", "room_id");
-
- $result = $this->db->insertExecute($table_name, $rec_set, false);
- if ($result === false) {
- $this->_rollBack();
- return 'error';
+ }
+ // permalink
+ if(($this->backup_page_id == 0 && $backup_uploads[0]['thread_num'] == $prev_thread_num) || $this->backup_page_id == $prev_page_id) {
+ $pages_permalink = $rec_set;
+ }
+ // Bufferセット
+ $page_id_arr[] = $rec_set['page_id'];
+ $pages_buf[$rec_set['page_id']] = $rec_set;
+ } else if($table_name == "pages_modules_link") {
+ //-------------------------------------------------------------------------
+ // ページモジュールリンクテーブル
+ // module_idからリストア先のmodule_idに変換
+ // エラーがあったモジュールはリストアしない
+ //-------------------------------------------------------------------------
+ if($restore_type == "top" && $room_inf['page_id'] == $rec_set['room_id']) {
+ // パブリックスペース、プライベートスペースならば、ID変更なし
+ // Insertも行わない
+ $this->_transferId($table_name, $rec_set, "page_id", "room_id", $rec_set['room_id']);
+ } else {
+ // dirname取得
+ if(isset($version_arr['__'.$rec_set['module_id']])) {
+ $dirname = $version_arr['__'.$rec_set['module_id']];
+ if(!isset($restore_modules[$dirname]['error_mes'])) {
+ // エラーなし
+ // module_id振替
+ $this->_transferId($table_name, $rec_set, "module_id", null, $modules[$dirname]['module_id']);
+
+ // room_id振替
+ $this->_transferId($table_name, $rec_set, "page_id", "room_id");
+
+ $result = $this->db->insertExecute($table_name, $rec_set, false);
+ if ($result === false) {
+ $this->_rollBack();
+ return 'error';
}
$this->deleteParams[$table_name][] = $rec_set;
- }
-
- }
- }
- } else if($table_name == "pages_users_link") {
- //-------------------------------------------------------------------------
- // ページユーザーリンクテーブル
- //
- // バックアップされた会員を参加させる(restore_type != "top" && restore_type != "subgroup")
- // サブグループならば、必ず初期化
- // パブリックスペース、プライベートスペースならば、参加者は変更しない
- // パブリックスペース内のルームについては、初期化する
- //-------------------------------------------------------------------------
- if($restore_type == "top" && $room_inf['page_id'] == $rec_set['room_id']) {
- // 参加者情報はリストアしない(現状のまま)
- } else{
- // room_id振替
- $this->_transferId($table_name, $rec_set, "page_id", "room_id");
-
- if ($restore_type != "top" && $restore_type != "subgroup" && $this->entry_user == _ON &&
- (!isset($admin_users) || !isset($admin_users[$rec_set['user_id']]))) {
+ }
+
+ }
+ }
+ } else if($table_name == "pages_users_link") {
+ //-------------------------------------------------------------------------
+ // ページユーザーリンクテーブル
+ //
+ // バックアップされた会員を参加させる(restore_type != "top" && restore_type != "subgroup")
+ // サブグループならば、必ず初期化
+ // パブリックスペース、プライベートスペースならば、参加者は変更しない
+ // パブリックスペース内のルームについては、初期化する
+ //-------------------------------------------------------------------------
+ if($restore_type == "top" && $room_inf['page_id'] == $rec_set['room_id']) {
+ // 参加者情報はリストアしない(現状のまま)
+ } else{
+ // room_id振替
+ $this->_transferId($table_name, $rec_set, "page_id", "room_id");
+
+ if ($restore_type != "top" && $restore_type != "subgroup" && $this->entry_user == _ON &&
+ (!isset($admin_users) || !isset($admin_users[$rec_set['user_id']]))) {
// バックアップされた会員を参加させる
- // 登録されていない会員がいれば、INSERTしない
- $pages_users_link_user = $this->usersView->getUserById($rec_set['user_id']);
- if(isset($pages_users_link_user['user_id'])) {
-
- $result = $this->db->insertExecute($table_name, $rec_set, false);
- if ($result === false) {
- $this->_rollBack();
- return 'error';
+ // 登録されていない会員がいれば、INSERTしない
+ $pages_users_link_user = $this->usersView->getUserById($rec_set['user_id']);
+ if(isset($pages_users_link_user['user_id'])) {
+
+ $result = $this->db->insertExecute($table_name, $rec_set, false);
+ if ($result === false) {
+ $this->_rollBack();
+ return 'error';
}
$this->deleteParams[$table_name][] = $rec_set;
- }
- }
+ }
+ }
- //
- // リストアを行った会員、管理者は少なくとも参加
- //
- // 管理者一覧取得
+ //
+ // リストアを行った会員、管理者は少なくとも参加
+ //
+ // 管理者一覧取得
if(!isset($admin_users)) {
if($pages_buf[$rec_set['room_id']]['private_flag'] == _OFF) {
// プライベートルームは自分自身のみ
@@ -379,117 +379,117 @@ function execute()
}
$result = $this->db->insertExecute($table_name, $rec_set, false);
if ($result === false) {
- $this->_rollBack();
- return 'error';
+ $this->_rollBack();
+ return 'error';
}
$this->deleteParams[$table_name][] = $rec_set;
}
}
- }
- } else if($table_name == "pages_meta_inf") {
- //-------------------------------------------------------------------------
- // pages_meta_infテーブル
- //-------------------------------------------------------------------------
- // page_id振替
- $this->_transferId($table_name, $rec_set, "page_id");
+ }
+ } else if($table_name == "pages_meta_inf") {
+ //-------------------------------------------------------------------------
+ // pages_meta_infテーブル
+ //-------------------------------------------------------------------------
+ // page_id振替
+ $this->_transferId($table_name, $rec_set, "page_id");
$result = $this->db->insertExecute($table_name, $rec_set, false);
- if ($result === false) {
- $this->_rollBack();
- return 'error';
+ if ($result === false) {
+ $this->_rollBack();
+ return 'error';
}
$this->deleteParams[$table_name][] = $rec_set;
- } else if($table_name == "pages_style") {
- //-------------------------------------------------------------------------
- // ページスタイルテーブル
- // 自サイトでないならば、本テーブルは、デフォルトに強制的に戻す
- // header_flag,leftcolumn_flag等が、権限によっては変更できなくなるおそれがあるため
- // 権限毎で、レイアウトを変更できるかどうかをもっているので
- // レイアウト変更できる権限の場合のみリストアすることも可能だが、現状、しない
- //-------------------------------------------------------------------------
- if($restore_modules["system"]['self_flag']) {
- // set_page_id振替
- $this->_transferId($table_name, $rec_set, "page_id", "set_page_id");
-
- $result = $this->db->insertExecute($table_name, $rec_set, false);
- if ($result === false) {
- $this->_rollBack();
- return 'error';
+ } else if($table_name == "pages_style") {
+ //-------------------------------------------------------------------------
+ // ページスタイルテーブル
+ // 自サイトでないならば、本テーブルは、デフォルトに強制的に戻す
+ // header_flag,leftcolumn_flag等が、権限によっては変更できなくなるおそれがあるため
+ // 権限毎で、レイアウトを変更できるかどうかをもっているので
+ // レイアウト変更できる権限の場合のみリストアすることも可能だが、現状、しない
+ //-------------------------------------------------------------------------
+ if($restore_modules["system"]['self_flag']) {
+ // set_page_id振替
+ $this->_transferId($table_name, $rec_set, "page_id", "set_page_id");
+
+ $result = $this->db->insertExecute($table_name, $rec_set, false);
+ if ($result === false) {
+ $this->_rollBack();
+ return 'error';
}
$this->deleteParams[$table_name][] = $rec_set;
- }
- } else if($table_name == "monthly_number") {
- //-------------------------------------------------------------------------
- // 月別一覧テーブル
- //-------------------------------------------------------------------------
- $insert_flag = false;
-
- if($rec_set['module_id'] == 0) {
- // アクセス数等
- $insert_flag = true;
- } else if(isset($version_arr['__'.$rec_set['module_id']])) {
- $dirname = $version_arr['__'.$rec_set['module_id']];
- if(!isset($restore_modules[$dirname]['error_mes'])) {
- // エラーなし
- // module_id振替
- $this->_transferId($table_name, $rec_set, "module_id", null, $modules[$dirname]['module_id']);
- if(isset($this->entry_modules[$dirname]) &&
- $this->entry_modules[$dirname] == _ON) {
- // リストアするモジュールに含まれている
- $insert_flag = true;
- }
-
- }
- }
- /* ループ前に行うので、ここはコメント 後に削除
- if($restore_type == "top" && $room_inf['page_id'] == $rec_set['room_id']) {
- // Topのものは置き換える対象なので
- // 現在のものを削除する
- // RollBackのため、SelectしてDelete
- $sel_where_params = array(
- "room_id" => $rec_set['room_id']
- );
- //$sel_where_params = array(
- // "user_id" => $rec_set['user_id'],
- // "room_id" => $rec_set['room_id'],
- // "module_id" => $rec_set['module_id']
- //);
- if(!$this->_selectDelete($table_name, $sel_where_params)) {
- return 'error';
- }
- }
- */
- if($insert_flag == true) {
- // room_id振替
- $this->_transferId($table_name, $rec_set, "page_id", "room_id");
+ }
+ } else if($table_name == "monthly_number") {
+ //-------------------------------------------------------------------------
+ // 月別一覧テーブル
+ //-------------------------------------------------------------------------
+ $insert_flag = false;
+
+ if($rec_set['module_id'] == 0) {
+ // アクセス数等
+ $insert_flag = true;
+ } else if(isset($version_arr['__'.$rec_set['module_id']])) {
+ $dirname = $version_arr['__'.$rec_set['module_id']];
+ if(!isset($restore_modules[$dirname]['error_mes'])) {
+ // エラーなし
+ // module_id振替
+ $this->_transferId($table_name, $rec_set, "module_id", null, $modules[$dirname]['module_id']);
+ if(isset($this->entry_modules[$dirname]) &&
+ $this->entry_modules[$dirname] == _ON) {
+ // リストアするモジュールに含まれている
+ $insert_flag = true;
+ }
+
+ }
+ }
+ /* ループ前に行うので、ここはコメント 後に削除
+ if($restore_type == "top" && $room_inf['page_id'] == $rec_set['room_id']) {
+ // Topのものは置き換える対象なので
+ // 現在のものを削除する
+ // RollBackのため、SelectしてDelete
+ $sel_where_params = array(
+ "room_id" => $rec_set['room_id']
+ );
+ //$sel_where_params = array(
+ // "user_id" => $rec_set['user_id'],
+ // "room_id" => $rec_set['room_id'],
+ // "module_id" => $rec_set['module_id']
+ //);
+ if(!$this->_selectDelete($table_name, $sel_where_params)) {
+ return 'error';
+ }
+ }
+ */
+ if($insert_flag == true) {
+ // room_id振替
+ $this->_transferId($table_name, $rec_set, "page_id", "room_id");
$result = $this->db->insertExecute($table_name, $rec_set, false);
- if ($result === false) {
- $this->_rollBack();
- return 'error';
+ if ($result === false) {
+ $this->_rollBack();
+ return 'error';
}
$this->deleteParams[$table_name][] = $rec_set;
- }
- } else if($table_name == "blocks") {
- //-------------------------------------------------------------------------
- // ブロックテーブル
- //-------------------------------------------------------------------------
- if($rec_set['module_id'] == 0) {
- // グループ化されたブロック
- // 内部にモジュールがあるかどうかチェック
- // なければリストア対象としない
- if(!isset($normal_block_col_arr[$rec_set['page_id']][$rec_set['block_id']])) {
- $dirname = "";
- } else {
- $dirname = "_grouping";
- }
- } else if(isset($version_arr['__'.$rec_set['module_id']])) {
- $dirname = $version_arr['__'.$rec_set['module_id']];
- } else {
- $dirname = "";
- }
- if(($dirname != "_grouping" &&
- (!isset($this->entry_modules[$dirname]) ||
+ }
+ } else if($table_name == "blocks") {
+ //-------------------------------------------------------------------------
+ // ブロックテーブル
+ //-------------------------------------------------------------------------
+ if($rec_set['module_id'] == 0) {
+ // グループ化されたブロック
+ // 内部にモジュールがあるかどうかチェック
+ // なければリストア対象としない
+ if(!isset($normal_block_col_arr[$rec_set['page_id']][$rec_set['block_id']])) {
+ $dirname = "";
+ } else {
+ $dirname = "_grouping";
+ }
+ } else if(isset($version_arr['__'.$rec_set['module_id']])) {
+ $dirname = $version_arr['__'.$rec_set['module_id']];
+ } else {
+ $dirname = "";
+ }
+ if(($dirname != "_grouping" &&
+ (!isset($this->entry_modules[$dirname]) ||
$this->entry_modules[$dirname] == _OFF ||
$dirname == "" ||
isset($restore_modules[$dirname]['error_mes'])
@@ -500,39 +500,39 @@ function execute()
$err_block_row_arr[$rec_set['page_id']][$rec_set['parent_id']][$rec_set['col_num']][$rec_set['row_num']] = true;
} else {
- // エラーなし
- $normal_block_col_arr[$rec_set['page_id']][$rec_set['parent_id']][$rec_set['col_num']] = true;
- // 詰めるかどうかチェック
- if($rec_set['row_num'] > 1 && isset($err_block_row_arr[$rec_set['page_id']][$rec_set['parent_id']])) {
- $set_row_num = $rec_set['row_num'];
- $chk_row_num = intval($set_row_num) - 1;
- while(1) {
- if($chk_row_num == 0) break;
- if(isset($err_block_row_arr[$rec_set['page_id']][$rec_set['parent_id']][$rec_set['col_num']][$chk_row_num])) {
- $set_row_num--;
- }
- $chk_row_num--;
- }
- $rec_set['row_num'] = $set_row_num;
- }
- if($rec_set['col_num'] > 1) {
- $set_col_num = $rec_set['col_num'];
- $chk_col_num = intval($set_col_num) - 1;
- while(1) {
- if($chk_col_num == 0) break;
- if(!isset($normal_block_col_arr[$rec_set['page_id']][$rec_set['parent_id']][$chk_col_num])) {
- $set_col_num--;
- }
- $chk_col_num--;
- }
- $rec_set['col_num'] = $set_col_num;
- }
-
- // block_id振替
- $this->_transferId($table_name, $rec_set, "block_id");
-
- // page_id振替
- $this->_transferId($table_name, $rec_set, "page_id");
+ // エラーなし
+ $normal_block_col_arr[$rec_set['page_id']][$rec_set['parent_id']][$rec_set['col_num']] = true;
+ // 詰めるかどうかチェック
+ if($rec_set['row_num'] > 1 && isset($err_block_row_arr[$rec_set['page_id']][$rec_set['parent_id']])) {
+ $set_row_num = $rec_set['row_num'];
+ $chk_row_num = intval($set_row_num) - 1;
+ while(1) {
+ if($chk_row_num == 0) break;
+ if(isset($err_block_row_arr[$rec_set['page_id']][$rec_set['parent_id']][$rec_set['col_num']][$chk_row_num])) {
+ $set_row_num--;
+ }
+ $chk_row_num--;
+ }
+ $rec_set['row_num'] = $set_row_num;
+ }
+ if($rec_set['col_num'] > 1) {
+ $set_col_num = $rec_set['col_num'];
+ $chk_col_num = intval($set_col_num) - 1;
+ while(1) {
+ if($chk_col_num == 0) break;
+ if(!isset($normal_block_col_arr[$rec_set['page_id']][$rec_set['parent_id']][$chk_col_num])) {
+ $set_col_num--;
+ }
+ $chk_col_num--;
+ }
+ $rec_set['col_num'] = $set_col_num;
+ }
+
+ // block_id振替
+ $this->_transferId($table_name, $rec_set, "block_id");
+
+ // page_id振替
+ $this->_transferId($table_name, $rec_set, "page_id");
// root_id振替
if($rec_set['root_id'] != 0) {
@@ -547,53 +547,53 @@ function execute()
$this->_transferId($table_name, $rec_set, "module_id", null, $modules[$dirname]['module_id']);
}
$result = $this->db->insertExecute($table_name, $rec_set, false);
- if ($result === false) {
- $this->_rollBack();
- return 'error';
+ if ($result === false) {
+ $this->_rollBack();
+ return 'error';
}
$this->deleteParams[$table_name][] = $rec_set;
- }
- } else if($table_name == "uploads") {
- //-------------------------------------------------------------------------
- // アップロードテーブル
- // アップロードする実ファイルは、リストアが完全に終わった後
- // コピー or 削除を行う
- // 現状、アップロードできる拡張子以外のものがあってもリストアしている
- //-------------------------------------------------------------------------
- $insert_flag = false;
-
- if(isset($version_arr['__'.$rec_set['module_id']])) {
- $dirname = $version_arr['__'.$rec_set['module_id']];
- if(!isset($restore_modules[$dirname]['error_mes'])) {
- // エラーなし
- // module_id振替
- $this->_transferId($table_name, $rec_set, "module_id", null, $modules[$dirname]['module_id']);
-
- if(isset($this->entry_modules[$dirname]) &&
- $this->entry_modules[$dirname] == _ON) {
- // リストアするモジュールに含まれている
- $insert_flag = true;
- }
- }
- }
- /* ループ前に行うので、ここはコメント 後に削除
- if($restore_type == "top" && $room_inf['page_id'] == $rec_set['room_id']) {
- // Topのものは置き換える対象なので
- // 現在のものを削除する
- // RollBackのため、SelectしてDelete
- $sel_where_params = array(
- "room_id" => $rec_set['room_id']
- );
- if(!$this->_selectDelete($table_name, $sel_where_params)) {
- return 'error';
- }
- }
- */
- if($insert_flag == true) {
- //$old_upload_id = $rec_set['upload_id'];
- $old_physical_file_name = $rec_set['file_path'] . $rec_set['physical_file_name'];
- // upload_id振替
- $this->_transferId($table_name, $rec_set, "upload_id");
+ }
+ } else if($table_name == "uploads") {
+ //-------------------------------------------------------------------------
+ // アップロードテーブル
+ // アップロードする実ファイルは、リストアが完全に終わった後
+ // コピー or 削除を行う
+ // 現状、アップロードできる拡張子以外のものがあってもリストアしている
+ //-------------------------------------------------------------------------
+ $insert_flag = false;
+
+ if(isset($version_arr['__'.$rec_set['module_id']])) {
+ $dirname = $version_arr['__'.$rec_set['module_id']];
+ if(!isset($restore_modules[$dirname]['error_mes'])) {
+ // エラーなし
+ // module_id振替
+ $this->_transferId($table_name, $rec_set, "module_id", null, $modules[$dirname]['module_id']);
+
+ if(isset($this->entry_modules[$dirname]) &&
+ $this->entry_modules[$dirname] == _ON) {
+ // リストアするモジュールに含まれている
+ $insert_flag = true;
+ }
+ }
+ }
+ /* ループ前に行うので、ここはコメント 後に削除
+ if($restore_type == "top" && $room_inf['page_id'] == $rec_set['room_id']) {
+ // Topのものは置き換える対象なので
+ // 現在のものを削除する
+ // RollBackのため、SelectしてDelete
+ $sel_where_params = array(
+ "room_id" => $rec_set['room_id']
+ );
+ if(!$this->_selectDelete($table_name, $sel_where_params)) {
+ return 'error';
+ }
+ }
+ */
+ if($insert_flag == true) {
+ //$old_upload_id = $rec_set['upload_id'];
+ $old_physical_file_name = $rec_set['file_path'] . $rec_set['physical_file_name'];
+ // upload_id振替
+ $this->_transferId($table_name, $rec_set, "upload_id");
// room_id振替
$this->_transferId($table_name, $rec_set, "page_id", "room_id");
@@ -607,22 +607,23 @@ function execute()
// insert
$result = $this->db->insertExecute($table_name, $rec_set, false);
- if ($result === false) {
- $this->_rollBack();
- return 'error';
+ if ($result === false) {
+ $this->_rollBack();
+ return 'error';
}
- $this->deleteParams[$table_name][] = $rec_set;
+ $key = $rec_set['upload_id'];
+ $this->deleteParams[$table_name][$key] = $rec_set;
// upload_id保存
- $upload_id_arr[$dirname][$rec_set['upload_id']] = $rec_set['unique_id'];
+ $upload_id_arr[$dirname][$key] = $rec_set['unique_id'];
$physical_file_name_arr[$old_physical_file_name] = $rec_set['file_path'] . $rec_set['physical_file_name'];
- }
- }
- }
- }
- }
+ }
+ }
+ }
+ }
+ }
- // permalink
+ // permalink
if(isset($pages_permalink)) {
$permalink = $pages_permalink['permalink'];
$buf_permalink = $permalink;
@@ -649,19 +650,19 @@ function execute()
}
}
- //--------------------------------------------------
- // 一般系テーブルリストア
- //--------------------------------------------------
- $all_transfer_id_arr = array();
- $transfer_user_id_arr = array();
- foreach($restore_data as $dirname => $modules_restore_arr) {
- if($dirname == "system") {
- continue;
- }
- //
- // リストア対象かどうかチェック
- //
- if(isset($restore_modules[$dirname]['error_mes'])) {
+ //--------------------------------------------------
+ // 一般系テーブルリストア
+ //--------------------------------------------------
+ $all_transfer_id_arr = array();
+ $transfer_user_id_arr = array();
+ foreach($restore_data as $dirname => $modules_restore_arr) {
+ if($dirname == "system") {
+ continue;
+ }
+ //
+ // リストア対象かどうかチェック
+ //
+ if(isset($restore_modules[$dirname]['error_mes'])) {
// エラーあり
continue;
}
@@ -742,146 +743,146 @@ function execute()
}
//
- // room_id毎にリストアしていく
- //
- foreach($modules_restore_arr['room'] as $room_id => $restore_table_arr) {
- foreach($restore_table_arr as $table_name => $rec_sets) {
- if(isset($transfer_module_id_arr[$table_name]["*"]) &&
- $transfer_module_id_arr[$table_name]["*"] == "none_transfer") {
- // 本テーブルは振替対象外
- continue;
- }
- // ハンドル名が重複する可能性があるため、
- // ハンドル名称を振り替える
- $this->_transferIdHandle($transfer_user_id_arr, $rec_sets);
-
- foreach($rec_sets as $rec_set) {
- if($restore_type == "top" && !$this->_self_flag) {
- if(isset($rec_set['page_id']) && $rec_set['page_id'] == $pre_top_page_id) {
- $rec_set['page_id'] = $room_inf['page_id'];
- }
- if(isset($rec_set['room_id']) && $rec_set['room_id'] == $pre_top_room_id) {
- $rec_set['room_id'] = $room_inf['room_id'];
- }
- }
-
- if($rec_set["room_id"] && $rec_set["room_id"] == BACKUP_NULL_COLUMN) {
- //if($this->_self_flag && $rec_set["room_id"] && $rec_set["room_id"] == BACKUP_NULL_COLUMN) {
- //
- // room_idがnullのカラムがあった場合
- //
- continue;
- }
-
- foreach($rec_set as $column_name => $value) {
- // null表記
- if($value == BACKUP_NULL_COLUMN) {
- $rec_set[$column_name] = null;
- $value = null;
- }
- if($value != "0") {
- $transfer_column_name = "";
- if(isset($transfer_module_id_arr["all"][$column_name])) {
- $transfer_column_name = $transfer_module_id_arr["all"][$column_name];
- $set_key = "all";
- } else if(isset($transfer_module_id_arr[$table_name][$column_name])) {
- $transfer_column_name = $transfer_module_id_arr[$table_name][$column_name];
- $set_key = $table_name;
- }
- $mode = "";
- if(isset($set_key) && isset($transfer_core_id_arr[$set_key][$column_name])) {
- $mode = $transfer_core_id_arr[$set_key][$column_name];
- }
- $other_module = "";
- if(isset($set_key) && isset($transfer_other_module_id_arr[$set_key][$column_name])) {
- $other_module = $transfer_other_module_id_arr[$set_key][$column_name];
- }
- $separator = "";
- if(isset($set_key) && isset($transfer_separator_id_arr[$set_key][$column_name])) {
- $separator = $transfer_separator_id_arr[$set_key][$column_name];
- }
-
- if($transfer_column_name == "none_transfer") {
- // 振替ない
- } else if($transfer_column_name != "") {
- if($mode != "" && $mode != "wysiwyg" && $mode != "text" && $mode != "physical_file_name" && !isset($this->transfer_id_arr[$transfer_column_name][$rec_set[$column_name]])) {
- // Coreから振替
- continue;
- }
- if($separator == "") {
- if($mode != "") {
- // Coreから振替
- if($transfer_column_name == "module_id") {
- if(isset($version_arr['__'.$rec_set[$column_name]])) {
- // module_idに対応したモジュールあり
- $this->_transferId($table_name, $rec_set, $transfer_column_name, $column_name, $modules[$version_arr['__'.$rec_set[$column_name]]]['module_id'], $mode);
- }
- } else {
- $this->_transferId($table_name, $rec_set, $transfer_column_name, $column_name, null, $mode);
- }
- } else if($other_module != "") {
- $this->_transferIdModules($dirname, $all_transfer_id_arr[$other_module], $table_name, $rec_set, $transfer_column_name, $column_name);
- } else {
- $this->_transferIdModules($dirname, $transfer_id_arr, $table_name, $rec_set, $transfer_column_name, $column_name);
- }
- } else {
- $rec_set_column_arr = explode($separator, $rec_set[$column_name]);
- $rec_set_column_str = "";
- foreach($rec_set_column_arr as $rec_set_column) {
- if($rec_set_column_str != "") {
- $rec_set_column_str .= ",";
- }
- if($rec_set_column != "") {
- $rec_set[$column_name] = $rec_set_column;
- if($mode != "") {
- // Coreから振替
- if($transfer_column_name == "module_id") {
- if(isset($version_arr['__'.$rec_set[$column_name]])) {
- // module_idに対応したモジュールあり
- $this->_transferId($table_name, $rec_set, $transfer_column_name, $column_name, $modules[$version_arr['__'.$rec_set[$column_name]]]['module_id'], $mode);
- }
- } else {
- $this->_transferId($table_name, $rec_set, $transfer_column_name, $column_name, null, $mode);
- }
- } else if($other_module != "") {
- $this->_transferIdModules($dirname, $all_transfer_id_arr[$other_module], $table_name, $rec_set, $transfer_column_name, $column_name);
- } else {
- $this->_transferIdModules($dirname, $transfer_id_arr, $table_name, $rec_set, $transfer_column_name, $column_name);
- }
- $rec_set_column_str .= $rec_set[$column_name];
- }
- }
- $rec_set[$column_name] = $rec_set_column_str;
- }
- }
-
- }
- }
-
- $result = $this->db->insertExecute($table_name, $rec_set, false);
- if ($result === false) {
- $this->_rollBack();
- return 'error';
+ // room_id毎にリストアしていく
+ //
+ foreach($modules_restore_arr['room'] as $room_id => $restore_table_arr) {
+ foreach($restore_table_arr as $table_name => $rec_sets) {
+ if(isset($transfer_module_id_arr[$table_name]["*"]) &&
+ $transfer_module_id_arr[$table_name]["*"] == "none_transfer") {
+ // 本テーブルは振替対象外
+ continue;
+ }
+ // ハンドル名が重複する可能性があるため、
+ // ハンドル名称を振り替える
+ $this->_transferIdHandle($transfer_user_id_arr, $rec_sets);
+
+ foreach($rec_sets as $rec_set) {
+ if($restore_type == "top" && !$this->_self_flag) {
+ if(isset($rec_set['page_id']) && $rec_set['page_id'] == $pre_top_page_id) {
+ $rec_set['page_id'] = $room_inf['page_id'];
+ }
+ if(isset($rec_set['room_id']) && $rec_set['room_id'] == $pre_top_room_id) {
+ $rec_set['room_id'] = $room_inf['room_id'];
+ }
+ }
+
+ if($rec_set["room_id"] && $rec_set["room_id"] == BACKUP_NULL_COLUMN) {
+ //if($this->_self_flag && $rec_set["room_id"] && $rec_set["room_id"] == BACKUP_NULL_COLUMN) {
+ //
+ // room_idがnullのカラムがあった場合
+ //
+ continue;
+ }
+
+ foreach($rec_set as $column_name => $value) {
+ // null表記
+ if($value == BACKUP_NULL_COLUMN) {
+ $rec_set[$column_name] = null;
+ $value = null;
+ }
+ if($value != "0") {
+ $transfer_column_name = "";
+ if(isset($transfer_module_id_arr["all"][$column_name])) {
+ $transfer_column_name = $transfer_module_id_arr["all"][$column_name];
+ $set_key = "all";
+ } else if(isset($transfer_module_id_arr[$table_name][$column_name])) {
+ $transfer_column_name = $transfer_module_id_arr[$table_name][$column_name];
+ $set_key = $table_name;
+ }
+ $mode = "";
+ if(isset($set_key) && isset($transfer_core_id_arr[$set_key][$column_name])) {
+ $mode = $transfer_core_id_arr[$set_key][$column_name];
+ }
+ $other_module = "";
+ if(isset($set_key) && isset($transfer_other_module_id_arr[$set_key][$column_name])) {
+ $other_module = $transfer_other_module_id_arr[$set_key][$column_name];
+ }
+ $separator = "";
+ if(isset($set_key) && isset($transfer_separator_id_arr[$set_key][$column_name])) {
+ $separator = $transfer_separator_id_arr[$set_key][$column_name];
+ }
+
+ if($transfer_column_name == "none_transfer") {
+ // 振替ない
+ } else if($transfer_column_name != "") {
+ if($mode != "" && $mode != "wysiwyg" && $mode != "text" && $mode != "physical_file_name" && !isset($this->transfer_id_arr[$transfer_column_name][$rec_set[$column_name]])) {
+ // Coreから振替
+ continue;
+ }
+ if($separator == "") {
+ if($mode != "") {
+ // Coreから振替
+ if($transfer_column_name == "module_id") {
+ if(isset($version_arr['__'.$rec_set[$column_name]])) {
+ // module_idに対応したモジュールあり
+ $this->_transferId($table_name, $rec_set, $transfer_column_name, $column_name, $modules[$version_arr['__'.$rec_set[$column_name]]]['module_id'], $mode);
+ }
+ } else {
+ $this->_transferId($table_name, $rec_set, $transfer_column_name, $column_name, null, $mode);
+ }
+ } else if($other_module != "") {
+ $this->_transferIdModules($dirname, $all_transfer_id_arr[$other_module], $table_name, $rec_set, $transfer_column_name, $column_name);
+ } else {
+ $this->_transferIdModules($dirname, $transfer_id_arr, $table_name, $rec_set, $transfer_column_name, $column_name);
+ }
+ } else {
+ $rec_set_column_arr = explode($separator, $rec_set[$column_name]);
+ $rec_set_column_str = "";
+ foreach($rec_set_column_arr as $rec_set_column) {
+ if($rec_set_column_str != "") {
+ $rec_set_column_str .= ",";
+ }
+ if($rec_set_column != "") {
+ $rec_set[$column_name] = $rec_set_column;
+ if($mode != "") {
+ // Coreから振替
+ if($transfer_column_name == "module_id") {
+ if(isset($version_arr['__'.$rec_set[$column_name]])) {
+ // module_idに対応したモジュールあり
+ $this->_transferId($table_name, $rec_set, $transfer_column_name, $column_name, $modules[$version_arr['__'.$rec_set[$column_name]]]['module_id'], $mode);
+ }
+ } else {
+ $this->_transferId($table_name, $rec_set, $transfer_column_name, $column_name, null, $mode);
+ }
+ } else if($other_module != "") {
+ $this->_transferIdModules($dirname, $all_transfer_id_arr[$other_module], $table_name, $rec_set, $transfer_column_name, $column_name);
+ } else {
+ $this->_transferIdModules($dirname, $transfer_id_arr, $table_name, $rec_set, $transfer_column_name, $column_name);
+ }
+ $rec_set_column_str .= $rec_set[$column_name];
+ }
+ }
+ $rec_set[$column_name] = $rec_set_column_str;
+ }
+ }
+
+ }
+ }
+
+ $result = $this->db->insertExecute($table_name, $rec_set, false);
+ if ($result === false) {
+ $this->_rollBack();
+ return 'error';
}
$this->deleteParams[$table_name][] = $rec_set;
- }
- }
- }
- //
- // uploadsテーブルのunique_idの振替
- //
- if(isset($transfer_module_id_arr['uploads']['unique_id']) && isset($upload_id_arr[$dirname]) && $upload_id_arr[$dirname]) {
- $other_module = "";
+ }
+ }
+ }
+ //
+ // uploadsテーブルのunique_idの振替
+ //
+ if(isset($transfer_module_id_arr['uploads']['unique_id']) && isset($upload_id_arr[$dirname]) && $upload_id_arr[$dirname]) {
+ $other_module = "";
if(isset($transfer_other_module_id_arr['uploads']['unique_id'])) {
$other_module = $transfer_other_module_id_arr['uploads']['unique_id'];
}
$transfer_column_name = $transfer_module_id_arr['uploads']['unique_id'];
- foreach($upload_id_arr[$dirname] as $new_upload_id => $unique_id) {
- if($unique_id != "0") {
- $buf_rec_set['unique_id'] = $unique_id;
- // 振替対象
- // Coreからの振替はないものとして処理
- if($other_module != "") {
+ foreach($upload_id_arr[$dirname] as $new_upload_id => $unique_id) {
+ if($unique_id != "0") {
+ $buf_rec_set['unique_id'] = $unique_id;
+ // 振替対象
+ // Coreからの振替はないものとして処理
+ if($other_module != "") {
$this->_transferIdModules($dirname, $all_transfer_id_arr[$other_module], 'uploads', $buf_rec_set, $transfer_column_name, 'unique_id');
} else {
$this->_transferIdModules($dirname, $transfer_id_arr, 'uploads', $buf_rec_set, $transfer_column_name, 'unique_id');
@@ -889,67 +890,66 @@ function execute()
$upd_params = array("unique_id" => $buf_rec_set['unique_id']);
$upd_where_params = array("upload_id" => $new_upload_id);
$result = $this->db->updateExecute('uploads', $upd_params, $upd_where_params, false);
- if ($result === false) {
- $this->_rollBack();
- return false;
+ if ($result === false) {
+ $this->_rollBack();
+ return false;
}
- $upd_params = array("unique_id" => $unique_id);
- $this->uploadParams['uploads'][] = $upd_params;
- $this->uploadWhereParams['uploads'][] = $upd_where_params;
- }
- }
- }
-
- //
- // 振替たIDをセット
- // モジュール間の振替が必要なモジュールがあるため(施設予約、TODOのカレンダーID等)
- //
- $all_transfer_id_arr[$dirname] = $transfer_id_arr;
- }
+
+ $this->deleteParams['uploads'][$new_upload_id]['unique_id'] = $buf_rec_set['unique_id'];
+ }
+ }
+ }
+
+ //
+ // 振替たIDをセット
+ // モジュール間の振替が必要なモジュールがあるため(施設予約、TODOのカレンダーID等)
+ //
+ $all_transfer_id_arr[$dirname] = $transfer_id_arr;
+ }
// test
- //$this->_rollBack();
-
- //---------------------------------------------------------
- // 画像コピー・削除
- //---------------------------------------------------------
- //$this->del_physical_file_name_arr
- foreach($this->del_physical_file_name_arr as $del_name) {
- if(file_exists(FILEUPLOADS_DIR.$del_name)) {
- // エラー処理は行わない
- $this->fileAction->delDir(FILEUPLOADS_DIR.$del_name);
- }
- }
- //$physical_file_name_arr
- foreach($physical_file_name_arr as $old_name => $new_name) {
- if(file_exists($temporary_file_path. "uploads/".$old_name)) {
- $this->fileAction->copyFile($temporary_file_path. "uploads/".$old_name, FILEUPLOADS_DIR . $new_name);
- }
- }
- $this->fileAction->delDir($this->temporary_file_path);
- //---------------------------------------------------------
- // 正常終了
- //---------------------------------------------------------
- $this->display_flag = ($this->display_flag == _OFF && $this->display_flag != null) ? _OFF : _ON;
- // display_flag=_PAGES_DISPLAY_FLAG_DISABLEDを元に戻す
- $params = array(
- "display_flag" => $this->display_flag
- );
- $where_params = array(
- "page_id IN (". implode(",", $page_id_arr). ") " => null,
- "{pages}.page_id = {pages}.room_id" => null
- );
- //page_id IN (". implode(",", $page_id_arr). ") ";
- $result = $this->db->updateExecute("pages", $params, $where_params, false);
-
- // 正常終了
- $errorList =& $this->actionChain->getCurErrorList();
- $errorList->add("backup", BACKUP_RESTORE_SUCCESS_MES);
-
- return 'success';
- }
-
- // 手動ロールバック
- function _rollBack()
+ //$this->_rollBack();
+
+ //---------------------------------------------------------
+ // 画像コピー・削除
+ //---------------------------------------------------------
+ //$this->del_physical_file_name_arr
+ foreach($this->del_physical_file_name_arr as $del_name) {
+ if(file_exists(FILEUPLOADS_DIR.$del_name)) {
+ // エラー処理は行わない
+ $this->fileAction->delDir(FILEUPLOADS_DIR.$del_name);
+ }
+ }
+ //$physical_file_name_arr
+ foreach($physical_file_name_arr as $old_name => $new_name) {
+ if(file_exists($temporary_file_path. "uploads/".$old_name)) {
+ $this->fileAction->copyFile($temporary_file_path. "uploads/".$old_name, FILEUPLOADS_DIR . $new_name);
+ }
+ }
+ $this->fileAction->delDir($this->temporary_file_path);
+ //---------------------------------------------------------
+ // 正常終了
+ //---------------------------------------------------------
+ $this->display_flag = ($this->display_flag == _OFF && $this->display_flag != null) ? _OFF : _ON;
+ // display_flag=_PAGES_DISPLAY_FLAG_DISABLEDを元に戻す
+ $params = array(
+ "display_flag" => $this->display_flag
+ );
+ $where_params = array(
+ "page_id IN (". implode(",", $page_id_arr). ") " => null,
+ "{pages}.page_id = {pages}.room_id" => null
+ );
+ //page_id IN (". implode(",", $page_id_arr). ") ";
+ $result = $this->db->updateExecute("pages", $params, $where_params, false);
+
+ // 正常終了
+ $errorList =& $this->actionChain->getCurErrorList();
+ $errorList->add("backup", BACKUP_RESTORE_SUCCESS_MES);
+
+ return 'success';
+ }
+
+ // 手動ロールバック
+ function _rollBack()
{
foreach($this->deleteParams as $table_name => $params) {
if(is_array($params)) {
@@ -1021,16 +1021,16 @@ function _selectDelete($table_name, $sel_where_params = array())
$sel_result = $this->db->selectExecute($table_name, $sel_where_params);
if ($sel_result === false) {
- $this->_rollBack();
- return false;
+ $this->_rollBack();
+ return false;
}
$this->selectParams[$table_name][$whereStr] = $sel_where_params;
if(is_array($sel_result) && count($sel_result) > 0) {
$result = $this->db->deleteExecute($table_name, $sel_where_params);
if ($result === false) {
- $this->_rollBack();
- return false;
+ $this->_rollBack();
+ return false;
}
foreach($sel_result as $row) {
if($table_name == "uploads") {
@@ -1051,7 +1051,7 @@ function _selectDelete($table_name, $sel_where_params = array())
* @param array column_records
* @param string 変換配列保存キー
* @param string 変換カラム名称
- * @param int 変換ID 指定がなければ振りなおす(nextSeq)
+ * @param int 変換ID 指定がなければ振りなおす(nextSeq)
* @param string core or wysiwyg
* @access private
*/
@@ -1133,7 +1133,7 @@ function _transferId($table_name, &$rec_set, $transfer_column_name, $column_name
* @param array column_records
* @param string 変換配列保存キー
* @param string 変換カラム名称
- * @param int 変換ID 指定がなければ振りなおす(nextSeq)
+ * @param int 変換ID 指定がなければ振りなおす(nextSeq)
* @access private
*/
function _transferIdModules($dirname, &$transfer_id_arr, $table_name, &$rec_set, $transfer_column_name, $column_name = null, $transfer_id = null) {
@@ -1271,9 +1271,9 @@ function _delRoomDb($top_room_id) {
$upd_params = array("display_flag" => _PAGES_DISPLAY_FLAG_DISABLED);
$upd_where_params = array("page_id" => $page['page_id']);
$result = $this->db->updateExecute($table_name, $upd_params, $upd_where_params, false);
- if ($result === false) {
- $this->_rollBack();
- return false;
+ if ($result === false) {
+ $this->_rollBack();
+ return false;
}
$upd_params = array("display_flag" => _ON);
$this->uploadParams[$table_name][] = $upd_params;
diff --git a/html/webapp/modules/bbs/templates/default/bbs_mobile_thread.html b/html/webapp/modules/bbs/templates/default/bbs_mobile_thread.html
index 3ac2503..8e9dcdf 100644
--- a/html/webapp/modules/bbs/templates/default/bbs_mobile_thread.html
+++ b/html/webapp/modules/bbs/templates/default/bbs_mobile_thread.html
@@ -8,6 +8,9 @@
<{foreach from=$parents|smarty:nodefaults key=postID item=post}>
+ <{if $smarty.session._smartphone_flag != _ON}>
+ <{" "|str_repeat:$depth}>
+ <{/if}>
<{include file = "bbs_mobile_subject.html" display_type="list"}>
diff --git a/html/webapp/modules/chat/update/Update.class.php b/html/webapp/modules/chat/update/Update.class.php
index c453f7d..a15a6c8 100644
--- a/html/webapp/modules/chat/update/Update.class.php
+++ b/html/webapp/modules/chat/update/Update.class.php
@@ -92,6 +92,35 @@ function execute()
$result = $this->db->execute($sql);
if($result === false) return false;
}
+
+ $sql = "SELECT block_id "
+ . "FROM " . $this->db->getPrefix() . "chat_contents "
+ . "GROUP BY block_id "
+ . "HAVING COUNT(chat_id) != MAX(chat_id)";
+ $chatBlocks = $this->db->execute($sql);
+ foreach ($chatBlocks as $chatBlock) {
+ $chatId = 1;
+ $sql = "SELECT chat_id "
+ . "FROM " . $this->db->getPrefix() . "chat_contents "
+ . "WHERE block_id = ? "
+ . "ORDER BY chat_id";
+ $chatContents = $this->db->execute($sql, $chatBlock['block_id']);
+ foreach ($chatContents as $chatContent) {
+ $updateColumns = array(
+ 'chat_id' => $chatId
+ );
+ $whereColumns = array(
+ 'block_id' => $chatBlock['block_id'],
+ 'chat_id' => $chatContent['chat_id']
+ );
+ $result = $this->db->updateExecute('chat_contents', $updateColumns, $whereColumns, false);
+ if ($result === false) {
+ return false;
+ }
+ $chatId++;
+ }
+ }
+
return true;
}
}
diff --git a/html/webapp/modules/circular/action/main/postscript/add/maple.ini b/html/webapp/modules/circular/action/main/postscript/add/maple.ini
index a0f3c3e..f642b59 100644
--- a/html/webapp/modules/circular/action/main/postscript/add/maple.ini
+++ b/html/webapp/modules/circular/action/main/postscript/add/maple.ini
@@ -3,7 +3,7 @@ mode="check"
action="circular_view_main_postscript_init"
[Convert]
-postscript_body.EscapeText =
+postscript_body.EscapeTextarea =
[ValidateDef]
postscript_body.required:g="1:lang._required,lang.circular_body"
diff --git a/html/webapp/modules/circular/action/main/postscript/mail/Mail.class.php b/html/webapp/modules/circular/action/main/postscript/mail/Mail.class.php
index 05b637a..d83e625 100644
--- a/html/webapp/modules/circular/action/main/postscript/mail/Mail.class.php
+++ b/html/webapp/modules/circular/action/main/postscript/mail/Mail.class.php
@@ -15,6 +15,7 @@ class Circular_Action_Main_Postscript_Mail extends Action
// リクエストパラメータを受け取るため
var $block_id = null;
var $circular_id = null;
+ var $mail_subject = null;
var $mail_body = null;
// 使用コンポーネントを受け取るため
@@ -33,7 +34,7 @@ function execute()
return "success";
}
- $this->mailMain->setSubject(CIRCULAR_MAIL_SUBJECT);
+ $this->mailMain->setSubject($this->mail_subject);
$this->mailMain->setBody($this->mail_body);
$circularInfo = $this->circularView->getCircularInfo($this->circular_id);
@@ -48,7 +49,7 @@ function execute()
$tags['X-CIRCULAR_SUBJECT'] = htmlspecialchars($circularInfo['circular_subject']);
$tags['X-CIRCULAR_BODY'] = $circularInfo['circular_body'];
- $tags['X-POSTSCRIPT_BODY'] = htmlspecialchars($sendPostscript['postscript_value']);
+ $tags['X-POSTSCRIPT_BODY'] = $sendPostscript['postscript_value'];
$tags['X-POSTSCRIPT_DATE'] = timezone_date($sendPostscript['insert_time'], false, _FULL_DATE_FORMAT);
$tags['X-CIRCULAR_URL'] = BASE_URL. INDEX_FILE_NAME .
'?action=' . DEFAULT_ACTION .
diff --git a/html/webapp/modules/circular/files/css/default/style.css b/html/webapp/modules/circular/files/css/default/style.css
index 290d959..21aae58 100644
--- a/html/webapp/modules/circular/files/css/default/style.css
+++ b/html/webapp/modules/circular/files/css/default/style.css
@@ -120,10 +120,19 @@ div.circular_detail_date {
div.circular_postscript {
margin:10px;
}
-
+
div.circular_postscript textarea {
- width:300px;
- height:100px;
+ height:150px;
+}
+
+div.circular_postscript_mail {
+ width:530px;
+}
+div.circular_postscript_mail input {
+ width:400px;
+}
+div.circular_postscript_mail textarea {
+ width:99%;
}
table.circular_create_frame {
diff --git a/html/webapp/modules/circular/files/js/default/circular.js b/html/webapp/modules/circular/files/js/default/circular.js
index a993137..0c5db31 100644
--- a/html/webapp/modules/circular/files/js/default/circular.js
+++ b/html/webapp/modules/circular/files/js/default/circular.js
@@ -323,6 +323,8 @@ clsCircular.prototype = {
addPostscript: function() {
var form_el = $("postscript_circular_form" + this.id);
+ form_el.postscript_body.value = this.textarea.getTextArea();
+
var viewParams = new Object();
viewParams["action"] = "circular_view_main_postscript_add";
viewParams["circular_id"] = form_el.circular_id.value;
@@ -342,14 +344,15 @@ clsCircular.prototype = {
parameter["callbackfunc"] = function(){
for (i=0; i {X-CIRCULAR_BODY},{X-POSTSCRIPT_BODY}, {X-POSTSCRIPT_DATE},{X-CIRCULAR_URL} at body. Each keywords are converted to [circular body],[postscript body], [postscript_date],[circular_url]." +circular_postscript_setting_note="You can use keywords {X-CIRCULAR_BODY},{X-POSTSCRIPT_BODY}, {X-POSTSCRIPT_DATE},{X-CIRCULAR_URL} at subject and body. Each keywords are converted to [circular body],[postscript body], [postscript_date],[circular_url]." [Circular_View_Main_Postscript_Init -circular_postscript_mail_body="The circular is updated at [{X-POSTSCRIPT_DATE}]. Add postscript Comment {X-POSTSCRIPT_BODY} The circular can be confirmed from the following URL links {X-CIRCULAR_URL}
+circular_postscript_mail_subject = " [{X-SITE_NAME}]【Postscript】{X-CIRCULAR_SUBJECT +circular_postscript_mail_body="The circular is updated at [{X-POSTSCRIPT_DATE}]. {X-POSTSCRIPT_BODY} The circular can be confirmed from the following URL links {X-CIRCULAR_URL}
[Circular_Action_Main_Postscript_Mail]
define:CIRCULAR_MAIL_SUBJECT = " [{X-SITE_NAME}]【Circular Postscript】{X-CIRCULAR_SUBJECT diff --git a/html/webapp/modules/circular/language/english/main.ini b/html/webapp/modules/circular/language/english/main.ini index a7baa01..9466fb5 100644 - a/html/webapp/modules/circular/language/english/main.ini + b/html/webapp/modules/circular/language/english/main.ini @ -88,10 +88,11 @ circular_delete_choice="Choices are deleted." [Circular_View_Main_Create:Circular_View_Main_Postscript_Init circular_mail_notice="yes" circular_mail_notice_no="no" -circular_postscript_setting_note="You can use keywords {X-CIRCULAR_BODY},{X-POSTSCRIPT_BODY}, {X-POSTSCRIPT_DATE},{X-CIRCULAR_URL} at body. Each keywords are converted to [circular body],[postscript body], [postscript_date],[circular_url]." +circular_postscript_setting_note="You can use keywords {X-CIRCULAR_BODY},{X-POSTSCRIPT_BODY}, {X-POSTSCRIPT_DATE},{X-CIRCULAR_URL} at subject and body. Each keywords are converted to [circular body],[postscript body], [postscript_date],[circular_url]." [Circular_View_Main_Postscript_Init -circular_postscript_mail_body="The circular is updated at [{X-POSTSCRIPT_DATE}]. Add postscript Comment {X-POSTSCRIPT_BODY} The circular can be confirmed from the following URL links {X-CIRCULAR_URL}
+circular_postscript_mail_subject = " [{X-SITE_NAME}]【Postscript】{X-CIRCULAR_SUBJECT +circular_postscript_mail_body="The circular is updated at [{X-POSTSCRIPT_DATE}]. {X-POSTSCRIPT_BODY} The circular can be confirmed from the following URL links {X-CIRCULAR_URL}
[Circular_Action_Main_Postscript_Mail]
define:CIRCULAR_MAIL_SUBJECT = " [{X-SITE_NAME}]【Circular Postscript】{X-CIRCULAR_SUBJECT diff --git a/html/webapp/modules/circular/language/japanese/main.ini b/html/webapp/modules/circular/language/japanese/main.ini index 13debf5..6a11205 100644 - a/html/webapp/modules/circular/language/japanese/main.ini + b/html/webapp/modules/circular/language/japanese/main.ini @ -88,10 +88,11 @ circular_delete_choice="選択肢を削除します" [Circular_View_Main_Create:Circular_View_Main_Postscript_Init circular_mail_notice="メールで通知する" circular_mail_notice_no="メールで通知しない" -circular_postscript_setting_note="メールの本文には、 {X-CIRCULAR_BODY}、{X-POSTSCRIPT_BODY}、 {X-POSTSCRIPT_DATE}、{X-CIRCULAR_URL} というキーワードを使用することができます。 それぞれのキーワードは、 回覧内容、追記内容、追記日時、回覧内容確認URL に変換されて送信されます。" +circular_postscript_setting_note="メールの件名と本文には、 {X-SITE_NAME}、{X-CIRCULAR_SUBJECT} {X-CIRCULAR_BODY}、{X-POSTSCRIPT_BODY}、 {X-POSTSCRIPT_DATE}、{X-CIRCULAR_URL} というキーワードを使用することができます。 それぞれのキーワードは、 回覧内容、追記内容、追記日時、回覧内容確認URL に変換されて送信されます。" [Circular_View_Main_Postscript_Init -circular_postscript_mail_body="[{X-POSTSCRIPT_DATE}]に回覧が更新されました。 追加コメント {X-POSTSCRIPT_BODY} 回覧は以下のURLリンクから確認できます。 {X-CIRCULAR_URL}" +circular_postscript_mail_subject="[{X-SITE_NAME}]【回覧追記】{X-CIRCULAR_SUBJECT}" +circular_postscript_mail_body="[{X-POSTSCRIPT_DATE}]に回覧が更新されました。 {X-POSTSCRIPT_BODY} 回覧は以下のURLリンクから確認できます。 {X-CIRCULAR_URL}" [Circular_Action_Main_Postscript_Mail define:CIRCULAR_MAIL_SUBJECT="[{X-SITE_NAME}]【回覧追記】{X-CIRCULAR_SUBJECT}" diff --git a/html/webapp/modules/circular/templates/default/circular_view_main_postscript.html b/html/webapp/modules/circular/templates/default/circular_view_main_postscript.html index 572cd21..85c9d2b 100644 - a/html/webapp/modules/circular/templates/default/circular_view_main_postscript.html + b/html/webapp/modules/circular/templates/default/circular_view_main_postscript.html @ -5,7 +5,7 @>
-
+
@@ -15,10 +15,10 @@
<{$lang.circular_mail_notice_no|smarty:nodefaults}>
-
-
-
-
+
+
+
+
<{$lang.circular_postscript_setting_note|smarty:nodefaults}>
@@ -31,6 +31,7 @@
<{include file="../circular_script.html"}>
<{/strip}>
\ No newline at end of file
diff --git a/html/webapp/modules/circular/templates/default/circular_view_main_postscript_list.html b/html/webapp/modules/circular/templates/default/circular_view_main_postscript_list.html
index f18f6e2..38293c0 100644
--- a/html/webapp/modules/circular/templates/default/circular_view_main_postscript_list.html
+++ b/html/webapp/modules/circular/templates/default/circular_view_main_postscript_list.html
@@ -9,7 +9,7 @@
<{$postscript.insert_user_name}>
-
<{$postscript.postscript_value|nl2br}>
+
<{$postscript.postscript_value|smarty:nodefaults}>
diff --git a/html/webapp/modules/circular/view/main/postscript/init/maple.ini b/html/webapp/modules/circular/view/main/postscript/init/maple.ini
index ce77367..263b757 100644
--- a/html/webapp/modules/circular/view/main/postscript/init/maple.ini
+++ b/html/webapp/modules/circular/view/main/postscript/init/maple.ini
@@ -1,6 +1,10 @@
[TokenExtra]
mode="build"
+[HeaderInc]
+textarea_css = "comp:{$theme_name}/comp_textarea.css"
+titleicon_css = "comp:{$theme_name}/comp_titleicon.css"
+
[View]
define:theme = 1
define:theme_name = "system"
diff --git a/html/webapp/modules/common/files/js/prototype.js b/html/webapp/modules/common/files/js/prototype.js
index 3fc93dc..cbe70f3 100644
--- a/html/webapp/modules/common/files/js/prototype.js
+++ b/html/webapp/modules/common/files/js/prototype.js
@@ -217,7 +217,7 @@ Object.extend(String.prototype, {
escapeHTML: function() {
//IEの場合、テキストノードに含まれる\nが空白になってしまうため修正
- return this.replace(/&/g, "&").replace(/"/g, """).replace(//g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/ /g, " ");
+ return String(this).replace(/&/g, "&").replace(/"/g, """).replace(//g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/ /g, " ");
//var div = document.createElement('div');
//var text = document.createTextNode(this);
@@ -227,7 +227,7 @@ Object.extend(String.prototype, {
unescapeHTML: function() {
//escapeHTMLを修正したため、同様に修正
- return this.replace(/"/g,'"').replace(/</g,'<').replace(/>/g,'>').replace(/"/g, '"').replace(/'/g, "'").replace(/'/g, "'").replace(/ /g, " ").replace(/&/g,'&');
+ return String(this).replace(/"/g,'"').replace(/</g,'<').replace(/>/g,'>').replace(/"/g, '"').replace(/'/g, "'").replace(/'/g, "'").replace(/ /g, " ").replace(/&/g,'&');
//var div = document.createElement('div');
//div.innerHTML = this.stripTags();
//return div.childNodes[0] ? (div.childNodes.length > 1 ?
diff --git a/html/webapp/modules/common/templates/operation/common_operation_view_init.html b/html/webapp/modules/common/templates/operation/common_operation_view_init.html
index 058ce4b..e665b48 100644
--- a/html/webapp/modules/common/templates/operation/common_operation_view_init.html
+++ b/html/webapp/modules/common/templates/operation/common_operation_view_init.html
@@ -34,9 +34,9 @@
<{assign var="pages_list" value=$action.pages_list.0.0}>
<{include file="operation/common_operation_view_pageslist.html"}>
-
-
-
+
+
+
<{if $action.headercolumn_page_id != null}>
<{if $action.column_space_type_use == _OFF}>
@@ -53,7 +53,7 @@
<{$lang.header_column|smarty:nodefaults}>
<{if $key == 0}>
- (<{$smarty.const._SPACE_TYPE_NAME_PRIVATE}>)
+ (<{$smarty.const._SPACE_TYPE_NAME_PUBLIC}>)
<{elseif $key == 1}>
(<{$smarty.const._SPACE_TYPE_NAME_PRIVATE}>)
<{elseif $key == 2}>
@@ -65,7 +65,7 @@
<{$lang.left_column|smarty:nodefaults}>
<{if $key == 0}>
- (<{$smarty.const._SPACE_TYPE_NAME_PRIVATE}>)
+ (<{$smarty.const._SPACE_TYPE_NAME_PUBLIC}>)
<{elseif $key == 1}>
(<{$smarty.const._SPACE_TYPE_NAME_PRIVATE}>)
<{elseif $key == 2}>
@@ -77,7 +77,7 @@
<{$lang.right_column|smarty:nodefaults}>
<{if $key == 0}>
- (<{$smarty.const._SPACE_TYPE_NAME_PRIVATE}>)
+ (<{$smarty.const._SPACE_TYPE_NAME_PUBLIC}>)
<{elseif $key == 1}>
(<{$smarty.const._SPACE_TYPE_NAME_PRIVATE}>)
<{elseif $key == 2}>
diff --git a/html/webapp/modules/comp/files/js/comp_calendar.js b/html/webapp/modules/comp/files/js/comp_calendar.js
index abe7652..6e1a4c6 100644
--- a/html/webapp/modules/comp/files/js/comp_calendar.js
+++ b/html/webapp/modules/comp/files/js/comp_calendar.js
@@ -6,17 +6,17 @@ var calendarComp = Array();
モジュール側のjavascriptクラスから
this.calendar = new compCalendar(id, text_el, options);
@param string top_id
- @param text_el or string text_el_id
+ @param text_el or string text_el_id
text_elの後ろにカレンダーアイコンを挿入する
@param object options
onClickCallback 日付選択時コールバック関数
parentFrame text_elがあるFrame(default:document)
designatedDate 日付指定(20070101のように指定)
日付指定されていれば、テキストエリアの日付に有無にかかわらず優先される
- calendarImgPath カレンダーImgPath(themes/images/icons)
- calendarColorDir カレンダーColorDir(default)
+ calendarImgPath カレンダーImgPath(themes/images/icons)
+ calendarColorDir カレンダーColorDir(default)
calendarImg テキスト横につくカレンダーアイコンimage(style/images/icons/下)
- calendarThemeDir カレンダーCSSの定義ファイルDir(htdocs/css/comp/XXX/comp_calendar.css) default: default
+ calendarThemeDir カレンダーCSSの定義ファイルDir(htdocs/css/comp/XXX/comp_calendar.css) default: default
*/
compCalendar.prototype = {
initialize: function(id, text_el, options) {
@@ -24,7 +24,7 @@ compCalendar.prototype = {
this.popup = null;
this.text_el = null;
this.calendarIcon_el = null;
-
+
this.options = {
onClickCallback: null,
parentFrame: "",
@@ -38,26 +38,26 @@ compCalendar.prototype = {
calendarThemeDir: "default"
};
Object.extend(this.options, options || {});
-
+
// private
this.date = null;
-
+
this.todayYear = null;
this.todayMonth = null;
this.todayDay = null;
-
+
this.selectedYear = null;
this.selectedMonth = null;
this.selectedDay = null;
-
+
this.currentYear = null;
this.currentMonth = null;
this.currentDay = null;
this.currentDate = null;
this.setDesignatedDateFlag = false;
-
+
this.Mdays = {"01":"31", "02":"28", "03":"31", "04":"30", "05":"31", "06":"30", "07":"31", "08":"31", "09":"30", "10":"31", "11":"30", "12":"31"};
-
+
// 1ブロック内に複数、カレンダーコンポーネントを張ってあった場合の対応
var key = id;
var count = 1;
@@ -67,9 +67,9 @@ compCalendar.prototype = {
}
calendarComp[key] = this;
this.key = key;
-
+
////calendarComp[id + this.calendar_classname] = this;
-
+
this._showCalendarImg(text_el);
},
//------------------------------
@@ -86,7 +86,7 @@ compCalendar.prototype = {
this.currentMonth = yyyymmdd.substr(4, 2);
this.currentDay = yyyymmdd.substr(6, 2);
this.currentDate = yyyymmdd;
-
+
var popup_el = this.popup.getPopupElement();
popup_el.contentWindow.document.body.innerHTML = this._render();
this.popup.resize();
@@ -127,7 +127,7 @@ compCalendar.prototype = {
//------------------------------
// カレンダーボタン表示処理
//------------------------------
- _showCalendarImg: function(text_el) {
+ _showCalendarImg: function(text_el) {
if(typeof text_el == 'string') {
if(this.options.parentFrame == "" || this.options.parentFrame == null) {
text_el = $(text_el);
@@ -136,17 +136,17 @@ compCalendar.prototype = {
}
}
if(typeof text_el != 'object') return;
-
+
if(this.options.parentFrame == "" || this.options.parentFrame == null) {
var calendarA_el = document.createElement("a");
var calendarImg_el = document.createElement("img");
} else {
var calendarA_el = this.options.parentFrame.contentWindow.document.createElement("a");
var calendarImg_el = this.options.parentFrame.contentWindow.document.createElement("img");
- }
+ }
calendarA_el.href = "#";
-
- calendarImg_el.src = this.options.calendarImgPath + "/" + this.options.calendarColorDir + "/" + this.options.calendarImg;
+
+ calendarImg_el.src = this.options.calendarImgPath + "/" + this.options.calendarColorDir + "/" + this.options.calendarImg;
Element.addClassName(calendarA_el, "comp_calendar_icon");
if(text_el.tagName.toLowerCase() == 'input' && text_el.type.toLowerCase() == 'text') {
Element.addClassName(text_el, "comp_calendar_text");
@@ -156,13 +156,13 @@ compCalendar.prototype = {
text_el.parentNode.insertBefore(calendarA_el, text_el);
text_el.parentNode.insertBefore(text_el, calendarA_el);
calendarA_el.appendChild(calendarImg_el);
-
- Event.observe(calendarA_el, "click",
+
+ Event.observe(calendarA_el, "click",
function(event){
this._showCalendar();
Event.stop(event);
}.bindAsEventListener(this), false, this.id);
-
+
this.text_el = text_el;
this.calendarIcon_el = calendarA_el;
},
@@ -175,13 +175,13 @@ compCalendar.prototype = {
this.todayYear = this._getFormat(this.date.getFullYear()); //文字列変換
this.todayMonth = this._getFormat(this.date.getMonth() + 1);
this.todayDay = this._getFormat(this.date.getDate());
-
+
if(this.setDesignatedDateFlag == true) {
// 初期化
- this.options.designatedDate = null;
+ this.options.designatedDate = null;
this.setDesignatedDateFlag = false;
}
-
+
if((this.options.designatedDate == null || this.options.designatedDate == "") &&
this.text_el.tagName.toLowerCase() == 'input' && this.text_el.type.toLowerCase() == 'text') {
var sel_date = this.text_el.value;
@@ -197,30 +197,30 @@ compCalendar.prototype = {
}
}
}
-
+
// 指定した日付
if(this.options.designatedDate == null || this.options.designatedDate == "") {
this.selectedYear = null;
this.selectedMonth = null;
this.selectedDay = null;
-
+
this.currentYear = this.todayYear;
this.currentMonth = this.todayMonth;
this.currentDay = "01";
-
+
} else {
this.selectedYear = this.options.designatedDate.substr(0, 4);
this.selectedMonth = this.options.designatedDate.substr(4, 2);
this.selectedDay = this.options.designatedDate.substr(6, 2);
-
+
this.currentYear = this.selectedYear;
this.currentMonth = this.selectedMonth;
this.currentDay = "01";
}
this.currentDate = this.currentYear + this.currentMonth + this.currentDay;
-
+
var html = this._render();
-
+
if(!this.popup) {
this.popup = new compPopup(this.id, "compCalendar");
var new_dir_name ="/comp/"+this.options.calendarThemeDir+"/comp_calendar.css";
@@ -228,7 +228,7 @@ compCalendar.prototype = {
this.popup.addCSSFiles(css_name);
this.popup.observer = function(event) {this._popupClose(); }.bind(this);
//this.popup.loadObserver = function(event) {
- // this.popup.resize();
+ // this.popup.resize();
//}.bind(this);
}
if(this.options.parentFrame) {
@@ -240,7 +240,7 @@ compCalendar.prototype = {
},
_getNextYear: function(yyyy, mm, dd) {
yyyy = valueParseInt(yyyy) + 1;
-
+
// 文字列として連結
return this._getFormat(yyyy) + this._getFormat(mm) + this._getFormat(dd);
},
@@ -248,7 +248,7 @@ compCalendar.prototype = {
yyyy = valueParseInt(yyyy) - 1;
if(yyyy < 1900) {
yyyy = 1900;
- }
+ }
// 文字列として連結
return this._getFormat(yyyy) + this._getFormat(mm) + this._getFormat(dd);
},
@@ -257,7 +257,7 @@ compCalendar.prototype = {
if(mm == 13) {
mm = 1;
yyyy = valueParseInt(yyyy) + 1;
- }
+ }
// 文字列として連結
return this._getFormat(yyyy) + this._getFormat(mm) + this._getFormat(dd);
},
@@ -266,7 +266,7 @@ compCalendar.prototype = {
if(mm <= 0) {
mm = 12;
yyyy = valueParseInt(yyyy) - 1;
- }
+ }
// 文字列として連結
return this._getFormat(yyyy) + this._getFormat(mm) + this._getFormat(dd);
},
@@ -297,10 +297,10 @@ compCalendar.prototype = {
var prev_year = this._getPrevYear(this.currentYear, this.currentMonth, this.currentDay);
var next_month = this._getNextDate(this.currentYear, this.currentMonth, this.currentDay);
var prev_month = this._getPrevDate(this.currentYear, this.currentMonth, this.currentDay);
-
+
var pre_end_date = this._getMonthDays(prev_month.substr(2, 2), prev_month.substr(4, 2));
var end_date = this._getMonthDays(this.currentYear.substr(2, 2), this.currentMonth);
-
+
var start_w = this._getWeekDays(this.currentYear, this.currentMonth, this.currentDay);
if(start_w == 0) {
if(this.options.pre_show_week != 0) {
@@ -310,12 +310,27 @@ compCalendar.prototype = {
}
} else {
var pre_start_date = pre_end_date - 7*this.options.pre_show_week - (start_w - 1);
- }
+ }
var loop_week = valueParseInt(Math.ceil((valueParseInt(end_date) + start_w + 7*this.options.pre_show_week + 7*this.options.next_show_week) / 7));
-
+
var currentMonth = valueParseInt(this.currentMonth);
- if(currentMonth < 10) currentMonth = " " + currentMonth;
- var html =
+ //if(currentMonth < 10) currentMonth = " " + currentMonth;
+ switch (currentMonth) {
+ case 1: currentMonth = compCalendarLang.month_jan; break;
+ case 2: currentMonth = compCalendarLang.month_feb; break;
+ case 3: currentMonth = compCalendarLang.month_mar; break;
+ case 4: currentMonth = compCalendarLang.month_apr; break;
+ case 5: currentMonth = compCalendarLang.month_may; break;
+ case 6: currentMonth = compCalendarLang.month_jun; break;
+ case 7: currentMonth = compCalendarLang.month_jul; break;
+ case 8: currentMonth = compCalendarLang.month_aug; break;
+ case 9: currentMonth = compCalendarLang.month_sep; break;
+ case 10: currentMonth = compCalendarLang.month_oct; break;
+ case 11: currentMonth = compCalendarLang.month_nov; break;
+ case 12: currentMonth = compCalendarLang.month_dec; break;
+ default:
+ }
+ var html =
"" +
"" +
"" +
@@ -324,7 +339,6 @@ compCalendar.prototype = {
compCalendarLang.year +
" " +
currentMonth +
- compCalendarLang.month +
"" +
" " +
"" +
@@ -389,7 +403,7 @@ compCalendar.prototype = {
compCalendarLang.week_sat +
"" +
" ";
-
+
var pre_outside_day = pre_start_date;
var current_day = 1;
var post_end_date = 1;
@@ -445,7 +459,7 @@ compCalendar.prototype = {
}
html += "
" +
"
";
-
+
return html;
},
_popupClose: 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 2d25d4f..02d9af0 100644
--- a/html/webapp/modules/comp/files/js/plugins/comp_textareamain.js
+++ b/html/webapp/modules/comp/files/js/plugins/comp_textareamain.js
@@ -2361,7 +2361,7 @@ compTextareamain.prototype = {
} catch(e){}
}
if(name=="value" || name=="alt" || name=="title") {
- value = value.escapeHTML();
+ value = String(value).escapeHTML();
}
if(name=="style" && value == "")
continue;
diff --git a/html/webapp/modules/comp/language/chinese/textarea.ini b/html/webapp/modules/comp/language/chinese/textarea.ini
index af97c9d..e44d1f3 100644
--- a/html/webapp/modules/comp/language/chinese/textarea.ini
+++ b/html/webapp/modules/comp/language/chinese/textarea.ini
@@ -27,6 +27,13 @@ insert_image_size = "大小"
insert_image_width = "宽度 " ;//Width
insert_image_height = "高度 " ;//Height
+insert_image_resolution_input = "的图片的大小" ;//Resolution of this image
+insert_image_resolution_size_normal = "标准"
+insert_image_resolution_size_asis = "实际的大小"
+insert_image_resolution_size_large = "大"
+insert_image_resolution_size_middle = "中"
+insert_image_resolution_size_small = "小"
+
insert_image_message1 = "请输入图片的URL"
insert_image_message2 = "请在开始时输入图片的URL"
insert_image_message3 = "文件没有被上传。"
diff --git a/html/webapp/modules/comp/language/english/textarea.ini b/html/webapp/modules/comp/language/english/textarea.ini
index 9bccb15..062913f 100644
--- a/html/webapp/modules/comp/language/english/textarea.ini
+++ b/html/webapp/modules/comp/language/english/textarea.ini
@@ -27,6 +27,13 @@ insert_image_size = "大きさ"
insert_image_width = "広さ " ;//Width
insert_image_height = "高さ " ;//Height
+insert_image_resolution_input = "イメージの大きさ" ;//Resolution of this image
+insert_image_resolution_size_normal = "標準"
+insert_image_resolution_size_asis = "実寸大"
+insert_image_resolution_size_large = "大"
+insert_image_resolution_size_middle = "中"
+insert_image_resolution_size_small = "小"
+
insert_image_message1 = "画像のURLを入力してください"
insert_image_message2 = "URLをはじめに入力してください"
insert_image_message3 = "ファイルはアップロードされませんでした。"
diff --git a/html/webapp/modules/comp/language/japanese/textarea.ini b/html/webapp/modules/comp/language/japanese/textarea.ini
index 5155dbb..8ce249f 100644
--- a/html/webapp/modules/comp/language/japanese/textarea.ini
+++ b/html/webapp/modules/comp/language/japanese/textarea.ini
@@ -27,6 +27,13 @@ insert_image_size = "大きさ"
insert_image_width = "広さ " ;//Width
insert_image_height = "高さ " ;//Height
+insert_image_resolution_input = "イメージの大きさ" ;//Resolution of this image
+insert_image_resolution_size_normal = "標準"
+insert_image_resolution_size_asis = "実寸大"
+insert_image_resolution_size_large = "大"
+insert_image_resolution_size_middle = "中"
+insert_image_resolution_size_small = "小"
+
insert_image_message1 = "画像のURLを入力してください"
insert_image_message2 = "URLをはじめに入力してください"
insert_image_message3 = "ファイルはアップロードされませんでした。"
diff --git a/html/webapp/modules/comp/templates/textarea/insert_image.html b/html/webapp/modules/comp/templates/textarea/insert_image.html
index 0836c4c..e58b2fb 100644
--- a/html/webapp/modules/comp/templates/textarea/insert_image.html
+++ b/html/webapp/modules/comp/templates/textarea/insert_image.html
@@ -60,7 +60,7 @@
<{$lang.insert_image_align_absbottom}>
-
+
<{$lang.insert_image_size}>
<{$lang.insert_image_width|smarty:nodefaults}>
@@ -73,6 +73,16 @@
px
+
+ <{$lang.insert_image_size}>
+
+ <{$lang.insert_image_resolution_size_normal}>
+ <{$lang.insert_image_resolution_size_asis}>
+ <{$lang.insert_image_resolution_size_large}>
+ <{$lang.insert_image_resolution_size_middle}>
+ <{$lang.insert_image_resolution_size_small}>
+
+
<{$lang.insert_image_border}>
@@ -228,6 +238,17 @@
}
function changeTabDisplay(tab_name) {
+ <{*// 「大きさ」内容の切り替え *}>
+ var resolution_obj = document.getElementById("resolution_f");
+ var size_obj = document.getElementById("size_f");
+ if(tab_name == "upload_tab") {
+ resolution_obj.style.display = "block";
+ size_obj.style.display = "none";
+ } else {
+ resolution_obj.style.display = "none";
+ size_obj.style.display = "block";
+ }
+
g_tab_name = tab_name;
<{* 詳細移動 *}>
var el = document.getElementById(tab_name+ "_detail");
diff --git a/html/webapp/modules/install/sql/mysql/table.sql b/html/webapp/modules/install/sql/mysql/table.sql
index 8c583b7..e5ad4d5 100644
--- a/html/webapp/modules/install/sql/mysql/table.sql
+++ b/html/webapp/modules/install/sql/mysql/table.sql
@@ -199,7 +199,7 @@ CREATE TABLE `users_items_link` (
`content` text,
PRIMARY KEY (`user_id`,`item_id`),
KEY `item_id` (`item_id`,`email_reception_flag`),
- FULLTEXT KEY `content` (`content`)
+ KEY `content` (`content`(255))
) ENGINE=MyISAM;
-- -
diff --git a/html/webapp/modules/journal/components/View.class.php b/html/webapp/modules/journal/components/View.class.php
index d7b8f6c..af3afe3 100644
--- a/html/webapp/modules/journal/components/View.class.php
+++ b/html/webapp/modules/journal/components/View.class.php
@@ -593,11 +593,7 @@ function getPostDetailData($post_id) {
$sql_common .= "WHERE P.root_id = 0 AND P.parent_id = 0 AND P.journal_id = ".$post[0]['journal_id']." ";
$sql_common .= $this->_getAuthorityWhereSQL($params);
- $where_params = array(
- "P.journal_date <= ".$post[0]['journal_date'] => null,
- "P.post_id < ".$post[0]['post_id'] => null
- );
- $sql_where = $this->_db->getWhereSQL($params, $where_params, false);
+ $sql_where = " AND (P.journal_date < '".$post[0]['journal_date']."' OR P.journal_date = '".$post[0]['journal_date']."' AND P.post_id < ".$post[0]['post_id'].")";
$sql_order = " ORDER BY P.journal_date DESC, P.post_id DESC";
$sql = $sql_common.$sql_where.$sql_order;
@@ -609,11 +605,7 @@ function getPostDetailData($post_id) {
$post[0]['older_post_id'] = empty($result) ? "":$result[0]['post_id'];
$post[0]['older_short_url'] = empty($result) ? "":$result[0]['short_url'];
- $where_params = array(
- "P.journal_date >= ".$post[0]['journal_date'] => null,
- "P.post_id > ".$post[0]['post_id'] => null
- );
- $sql_where = $this->_db->getWhereSQL($params, $where_params, false);
+ $sql_where = " AND (P.journal_date > '".$post[0]['journal_date']."' OR P.journal_date = '".$post[0]['journal_date']."' AND P.post_id > ".$post[0]['post_id'].")";
$sql_order = " ORDER BY P.journal_date ASC, P.post_id ASC";
$sql = $sql_common.$sql_where.$sql_order;
diff --git a/html/webapp/modules/journal/templates/default/journal_mobile_detail_feature.html b/html/webapp/modules/journal/templates/default/journal_mobile_detail_feature.html
index e4ce9ee..4bbf579 100644
--- a/html/webapp/modules/journal/templates/default/journal_mobile_detail_feature.html
+++ b/html/webapp/modules/journal/templates/default/journal_mobile_detail_feature.html
@@ -54,7 +54,7 @@
<{/if}>
<{if ($action.journal_obj.comment_flag == $smarty.const._ON) }>
-
+
<{$lang.journal_comment|smarty:nodefaults}>(<{$action.post.comment_count}>)
<{/if}>
diff --git a/html/webapp/modules/journal/templates/default/journal_mobile_detail_smart.html b/html/webapp/modules/journal/templates/default/journal_mobile_detail_smart.html
index b1c1e7b..2c3ddf7 100644
--- a/html/webapp/modules/journal/templates/default/journal_mobile_detail_smart.html
+++ b/html/webapp/modules/journal/templates/default/journal_mobile_detail_smart.html
@@ -21,7 +21,7 @@ <{$action.post.more_title}>
<{/if}>
<{$lang.journal_mobile_er_post_empty|smarty:nodefaults}>
<{if ($action.journal_obj.comment_flag == $smarty.const._ON) }>
-
+
<{$lang.journal_comment|smarty:nodefaults}>(<{$action.post.comment_count}>)
<{/if}>
diff --git a/html/webapp/modules/journal/view/main/detail/Detail.class.php b/html/webapp/modules/journal/view/main/detail/Detail.class.php
index 79a888d..02ada56 100644
--- a/html/webapp/modules/journal/view/main/detail/Detail.class.php
+++ b/html/webapp/modules/journal/view/main/detail/Detail.class.php
@@ -1,90 +1,91 @@
-session->getParameter("_mobile_flag");
-
- $this->trackback_url = BASE_URL. INDEX_FILE_NAME.
- "?action=".JOURNAL_DEFAULT_TRACKBACK_URL.
- "&post_id=". $this->post_id;
-
- $this->category = $this->journalView->getCatByPostId($this->post_id);
-
- if ($mobile_flag == _OFF || ($this->journal_obj['comment_flag'] == _ON && $this->comment_flag == _ON)) {
- $this->comments = $this->journalView->getChildDetail($this->post_id);
- if($this->comments === false) {
- return 'error';
- }
- }
-
- if($mobile_flag == _OFF || $this->trackback_flag == _ON) {
- $this->trackbacks = $this->journalView->getChildDetail($this->post_id, JOURNAL_TRACKBACK_RECEIVE);
- if($this->trackbacks === false) {
- return 'error';
- }
- }
- // タイトル設定
- if(isset($this->active_action) || isset($this->active_center)) {
- $this->session->setParameter("_page_title", $this->post['title']);
- }
-
- if ($mobile_flag == _ON ) {
- if( $this->comment_flag == _ON) {
- return 'comment';
- }
- else {
- $this->html_flag = $this->mobileView->getTextHtmlMode( $this->html_flag );
- return 'success';
- }
- } else {
- return 'success';
- }
- }
-}
+session->getParameter("_mobile_flag");
+
+ $this->trackback_url = BASE_URL. INDEX_FILE_NAME.
+ "?action=".JOURNAL_DEFAULT_TRACKBACK_URL.
+ "&post_id=". $this->post_id;
+
+ $this->category = $this->journalView->getCatByPostId($this->post_id);
+
+ if ($mobile_flag == _OFF || ($this->journal_obj['comment_flag'] == _ON && $this->mobile_comment_flag == _ON)) {
+ $this->comments = $this->journalView->getChildDetail($this->post_id);
+ if($this->comments === false) {
+ return 'error';
+ }
+ }
+
+ if($mobile_flag == _OFF || $this->trackback_flag == _ON) {
+ $this->trackbacks = $this->journalView->getChildDetail($this->post_id, JOURNAL_TRACKBACK_RECEIVE);
+ if($this->trackbacks === false) {
+ return 'error';
+ }
+ }
+ // タイトル設定
+ if(isset($this->active_action) || isset($this->active_center)) {
+ $this->session->setParameter("_page_title", $this->post['title']);
+ }
+
+ if ($mobile_flag == _ON ) {
+ if( $this->mobile_comment_flag == _ON) {
+ return 'comment';
+ }
+ else {
+ $this->html_flag = $this->mobileView->getTextHtmlMode( $this->html_flag );
+ return 'success';
+ }
+ } else {
+ return 'success';
+ }
+ }
+}
?>
\ No newline at end of file
diff --git a/html/webapp/modules/linklist/components/View.class.php b/html/webapp/modules/linklist/components/View.class.php
index 75d5c7e..14e4807 100644
--- a/html/webapp/modules/linklist/components/View.class.php
+++ b/html/webapp/modules/linklist/components/View.class.php
@@ -170,7 +170,7 @@ function &getLinklists()
function &_getMarkStyle($mark)
{
if(preg_match("/[.gif|.jpg|.png|bmp]$/i", $mark)) {
- $style = "list-style-image:url('".CORE_BASE_URL."/images/common/mark/". $mark. "');";
+ $style = "list-style-image:url('".get_image_url()."/images/common/mark/". $mark. "');";
} else {
$style = "list-style-type:". $mark. ";";
}
diff --git a/html/webapp/modules/linklist/templates/default/linklist_view_edit_style.html b/html/webapp/modules/linklist/templates/default/linklist_view_edit_style.html
index 85d0b13..173ec98 100644
--- a/html/webapp/modules/linklist/templates/default/linklist_view_edit_style.html
+++ b/html/webapp/modules/linklist/templates/default/linklist_view_edit_style.html
@@ -50,10 +50,10 @@
<{$lang.linklist_target_blank_flag_on|smarty:nodefaults}>
-
+
-
-
+
+
<{$lang.linklist_view_count_flag|smarty:nodefaults}>
@@ -65,9 +65,9 @@
<{$lang.linklist_view_count_flag_on|smarty:nodefaults}>
-
+
- <{* TODO:タブで次のエレメント、PgUp,PgDnで選択できるように修正すること *}>
+ <{* TODO:タブで次のエレメント、PgUp,PgDnで選択できるように修正すること *}>
@@ -144,6 +144,7 @@
<{/strip}>
\ No newline at end of file
diff --git a/html/webapp/modules/login/action/main/autoregist/Autoregist.class.php b/html/webapp/modules/login/action/main/autoregist/Autoregist.class.php
index 1c39960..15251fb 100644
--- a/html/webapp/modules/login/action/main/autoregist/Autoregist.class.php
+++ b/html/webapp/modules/login/action/main/autoregist/Autoregist.class.php
@@ -14,8 +14,8 @@
*/
class Login_Action_Main_Autoregist extends Action
{
- // リクエストパラメータを受け取るため
- var $items = null;
+ // リクエストパラメータを受け取るため
+ var $items = null;
var $items_public = null;
var $items_reception = null;
//var $files = null;
@@ -28,37 +28,37 @@ class Login_Action_Main_Autoregist extends Action
var $filelist = null;
var $config = null;
- // 使用コンポーネントを受け取るため
- var $pagesView = null;
- var $usersView = null;
- var $pagesAction = null;
- var $usersAction = null;
- var $configView = null;
- var $db = null;
- var $uploadsAction = null;
- var $actionChain = null;
- var $monthlynumberAction = null;
- var $fileUpload = null;
- var $timezoneMain = null;
- var $mailMain = null;
- var $session = null;
- var $authoritiesView = null;
- var $blocksAction = null;
-
- // 値をセットするため
- var $error_flag = true;
- var $post_mail_body = "";
- //var $_attachment_list = null;
- var $use_ssl = 0;
-
- /**
- * 会員受付登録
- *
- * @access public
- */
- function execute()
- {
- // ----------------------------------------------------------------------
+ // 使用コンポーネントを受け取るため
+ var $pagesView = null;
+ var $usersView = null;
+ var $pagesAction = null;
+ var $usersAction = null;
+ var $configView = null;
+ var $db = null;
+ var $uploadsAction = null;
+ var $actionChain = null;
+ var $monthlynumberAction = null;
+ var $fileUpload = null;
+ var $timezoneMain = null;
+ var $mailMain = null;
+ var $session = null;
+ var $authoritiesView = null;
+ var $blocksAction = null;
+
+ // 値をセットするため
+ var $error_flag = true;
+ var $post_mail_body = "";
+ //var $_attachment_list = null;
+ var $use_ssl = 0;
+
+ /**
+ * 会員受付登録
+ *
+ * @access public
+ */
+ function execute()
+ {
+ // ----------------------------------------------------------------------
// --- 基本項目(usersテーブル) ---
// ----------------------------------------------------------------------
if($this->autoregist_approver == _AUTOREGIST_SELF) {
@@ -148,7 +148,7 @@ function execute()
if($item['type'] == "radio" || $item['type'] == "checkbox" ||
$item['type'] == "select") {
if(is_array($this->items[$item_id])) {
- $users_items_link[$item_id]['content'] = implode("|", $this->items[$item_id]);
+ $users_items_link[$item_id]['content'] = implode("|", $this->items[$item_id]) . '|';
$post_mail_body = "";
foreach ($this->items[$item_id] as $i=>$choice) {
if (defined($choice)) {
@@ -196,11 +196,11 @@ function execute()
// ----------------------------------------------------------------------
//$email = "";
$email_arr = array();
- foreach($users_items_link as $item_id => $users_item_link) {
- //$users_item_link[]
- // users_items_linkが変更ないか、users_items_linkがなく初期値であれば
- if($users_items_link_flag_arr[$item_id] == true) {
- if(($users_items_link[$item_id]['content'] == '' &&
+ foreach($users_items_link as $item_id => $users_item_link) {
+ //$users_item_link[]
+ // users_items_linkが変更ないか、users_items_linkがなく初期値であれば
+ if($users_items_link_flag_arr[$item_id] == true) {
+ if(($users_items_link[$item_id]['content'] == '' &&
$users_items_link[$item_id]['public_flag'] == _OFF &&
$users_items_link[$item_id]['email_reception_flag'] == _OFF
)) {
@@ -211,14 +211,14 @@ function execute()
// 新規追加
$users_item_link['user_id'] = $new_user_id;
- $content = $users_item_link['content'];
+ $content = $users_item_link['content'];
- $result = $this->usersAction->insUserItemLink($users_item_link);
- if($result === false) return 'error';
+ $result = $this->usersAction->insUserItemLink($users_item_link);
+ if($result === false) return 'error';
- if($this->show_items[$item_id]['type'] == "file") {
- // アバターの画像のunique_id セット
- $upload_id = $this->filelist[$item_id]['upload_id'];
+ if($this->show_items[$item_id]['type'] == "file") {
+ // アバターの画像のunique_id セット
+ $upload_id = $this->filelist[$item_id]['upload_id'];
$upload_params = array(
"unique_id" => $new_user_id
);
@@ -227,25 +227,25 @@ function execute()
);
$upload_result = $this->uploadsAction->updUploads($upload_params, $upload_where_params);
if ($upload_result === false) return 'error';
- //} else if($this->show_items[$item_id]['tag_name'] == "email") {
- } else if($this->show_items[$item_id]['type'] == "email" || $this->show_items[$item_id]['type'] == "mobile_email") {
- $email_arr[] = $content;
- }
+ //} else if($this->show_items[$item_id]['tag_name'] == "email") {
+ } else if($this->show_items[$item_id]['type'] == "email" || $this->show_items[$item_id]['type'] == "mobile_email") {
+ $email_arr[] = $content;
+ }
}
- }
- $authoritiy = $this->authoritiesView->getAuthorityById(intval($this->autoregist_author));
- if($authoritiy !== false && $authoritiy['myroom_use_flag'] == _ON) {
- $myroom_display_flag = _ON;
- } else {
- $myroom_display_flag = _PAGES_DISPLAY_FLAG_DISABLED;
- }
-
- if($this->autoregist_defroom == _OFF) {
- // ----------------------------------------------------------------------
- // ---参加ルーム(pages_users_link登録) ---
+ }
+ $authoritiy = $this->authoritiesView->getAuthorityById(intval($this->autoregist_author));
+ if($authoritiy !== false && $authoritiy['myroom_use_flag'] == _ON) {
+ $myroom_display_flag = _ON;
+ } else {
+ $myroom_display_flag = _PAGES_DISPLAY_FLAG_DISABLED;
+ }
+
+ if($this->autoregist_defroom == _OFF) {
+ // ----------------------------------------------------------------------
+ // ---参加ルーム(pages_users_link登録) ---
// ----------------------------------------------------------------------
// 自動登録時にデフォルトのルームに参加するかどうか
- // 参加させない場合、不参加で登録する
+ // 参加させない場合、不参加で登録する
$where_params = array(
"default_entry_flag" => _ON,
@@ -259,21 +259,21 @@ function execute()
foreach($pages as $page) {
// 不参加として登録
$params = array(
- "room_id" => $page['page_id'],
- "user_id" => $new_user_id,
- "role_authority_id" => _ROLE_AUTH_OTHER,
- "createroom_flag" => _OFF
- );
+ "room_id" => $page['page_id'],
+ "user_id" => $new_user_id,
+ "role_authority_id" => _ROLE_AUTH_OTHER,
+ "createroom_flag" => _OFF
+ );
$result = $this->pagesAction->insPageUsersLink($params);
- if ($result === false) return 'error';
+ if ($result === false) return 'error';
}
- } else {
- // ----------------------------------------------------------------------
- // ---参加ルーム(pages_users_link登録) ---
+ } else {
+ // ----------------------------------------------------------------------
+ // ---参加ルーム(pages_users_link登録) ---
// ----------------------------------------------------------------------
// 自動登録時にデフォルトのルームに参加し、デフォルトの参加が一般で、登録会員のベース権限がゲスト権限の場合、
// ゲストとして参加させる必要がある。
- if($authoritiy !== false && $authoritiy['user_authority_id'] == _AUTH_GUEST) {
+ if($authoritiy !== false && $authoritiy['user_authority_id'] == _AUTH_GUEST) {
// ゲストとして登録
$where_params = null;
//$this->session->getParameter("_default_entry_auth_private")
@@ -308,22 +308,22 @@ function execute()
}
foreach($pages as $page) {
$params = array(
- "room_id" => $page['page_id'],
- "user_id" => $new_user_id,
- "role_authority_id" => _ROLE_AUTH_GUEST,
- "createroom_flag" => _OFF
- );
+ "room_id" => $page['page_id'],
+ "user_id" => $new_user_id,
+ "role_authority_id" => _ROLE_AUTH_GUEST,
+ "createroom_flag" => _OFF
+ );
$result = $this->pagesAction->insPageUsersLink($params);
- if ($result === false) return 'error';
+ if ($result === false) return 'error';
}
}
}
- }
+ }
- // ----------------------------------------------------------------------
+ // ----------------------------------------------------------------------
// --- プライベートスペース作成 ---
// ----------------------------------------------------------------------
- //権限テーブルのmyroom_use_flagにかかわらずプライベートスペース作成
+ //権限テーブルのmyroom_use_flagにかかわらずプライベートスペース作成
//
// ページテーブル追加
@@ -356,31 +356,31 @@ function execute()
//}
$permalink_handle = preg_replace(_PERMALINK_PROHIBITION, _PERMALINK_PROHIBITION_REPLACE, $handle);
if(_PERMALINK_PRIVATE_PREFIX_NAME != '') {
- $permalink = _PERMALINK_PRIVATE_PREFIX_NAME.'/'.$permalink_handle;
- } else {
- $permalink = $permalink_handle;
- }
- $permalink = $this->pagesAction->getRenamePermaLink($permalink);
+ $permalink = _PERMALINK_PRIVATE_PREFIX_NAME.'/'.$permalink_handle;
+ } else {
+ $permalink = $permalink_handle;
+ }
+ $permalink = $this->pagesAction->getRenamePermaLink($permalink);
$params = array(
- "site_id" => $this->session->getParameter("_site_id"),
- "root_id" => 0,
- "parent_id" => 0,
- "thread_num" => 0,
- "display_sequence" => $display_sequence,
- "action_name" => DEFAULT_ACTION,
- "parameters" => "",
- "page_name" => $private_space_name,
- "permalink" => $permalink,
- "show_count" => 0,
- "private_flag" => _ON,
- "default_entry_flag" => $default_entry_flag,
- "space_type" => _SPACE_TYPE_GROUP,
- "node_flag" => _ON,
- "shortcut_flag" => _OFF,
- "copyprotect_flag" => _OFF,
- "display_scope" => _DISPLAY_SCOPE_NONE,
- "display_position" => _DISPLAY_POSITION_CENTER,
- "display_flag" => $myroom_display_flag,
+ "site_id" => $this->session->getParameter("_site_id"),
+ "root_id" => 0,
+ "parent_id" => 0,
+ "thread_num" => 0,
+ "display_sequence" => $display_sequence,
+ "action_name" => DEFAULT_ACTION,
+ "parameters" => "",
+ "page_name" => $private_space_name,
+ "permalink" => $permalink,
+ "show_count" => 0,
+ "private_flag" => _ON,
+ "default_entry_flag" => $default_entry_flag,
+ "space_type" => _SPACE_TYPE_GROUP,
+ "node_flag" => _ON,
+ "shortcut_flag" => _OFF,
+ "copyprotect_flag" => _OFF,
+ "display_scope" => _DISPLAY_SCOPE_NONE,
+ "display_position" => _DISPLAY_POSITION_CENTER,
+ "display_flag" => $myroom_display_flag,
"insert_time" =>$time,
"insert_site_id" => $this->session->getParameter("_site_id"),
"insert_user_id" => $new_user_id,
@@ -389,10 +389,10 @@ function execute()
"update_site_id" => $this->session->getParameter("_site_id"),
"update_user_id" => $new_user_id,
"update_user_name" => $user["handle"]
- );
- $private_page_id = $this->pagesAction->insPage($params, true, false);
- if ($private_page_id === false) return 'error';
- //
+ );
+ $private_page_id = $this->pagesAction->insPage($params, true, false);
+ if ($private_page_id === false) return 'error';
+ //
// ページユーザリンクテーブル追加
//
$params = array(
@@ -402,10 +402,10 @@ function execute()
"createroom_flag" => _OFF
);
$result = $this->pagesAction->insPageUsersLink($params);
- if ($result === false) return 'error';
+ if ($result === false) return 'error';
- // ----------------------------------------------------------------------
- // --- 月別アクセス回数初期値登録 ---
+ // ----------------------------------------------------------------------
+ // --- 月別アクセス回数初期値登録 ---
// ----------------------------------------------------------------------
$name = "_hit_number";
$time = timezone_date();
@@ -422,19 +422,19 @@ function execute()
);
$result = $this->monthlynumberAction->insMonthlynumber($params);
if($result === false) {
- return 'error';
- }
+ return 'error';
+ }
- // ----------------------------------------------------------------------
- // --- 初期ページ追加 ---
+ // ----------------------------------------------------------------------
+ // --- 初期ページ追加 ---
// ----------------------------------------------------------------------
$result = $this->blocksAction->defaultPrivateRoomInsert($private_page_id, $new_user_id, $handle);
if($result === false) {
- return 'error';
- }
+ return 'error';
+ }
- // ----------------------------------------------------------------------
- // --- マイポータル作成 ---
+ // ----------------------------------------------------------------------
+ // --- マイポータル作成 ---
// ----------------------------------------------------------------------
if($config['open_private_space']['conf_value'] == _OPEN_PRIVATE_SPACE_MYPORTAL_GROUP ||
$config['open_private_space']['conf_value'] == _OPEN_PRIVATE_SPACE_MYPORTAL_PUBLIC) {
@@ -467,38 +467,38 @@ function execute()
//
$pages_params['page_name'] = $user["handle"];
if(_PERMALINK_MYPORTAL_PREFIX_NAME != '') {
- $permalink = _PERMALINK_MYPORTAL_PREFIX_NAME.'/'.$permalink_handle;
- } else {
- $permalink = $permalink_handle;
- }
- $permalink = $this->pagesAction->getRenamePermaLink($permalink);
- $pages_params['permalink'] = $permalink;
+ $permalink = _PERMALINK_MYPORTAL_PREFIX_NAME.'/'.$permalink_handle;
+ } else {
+ $permalink = $permalink_handle;
+ }
+ $permalink = $this->pagesAction->getRenamePermaLink($permalink);
+ $pages_params['permalink'] = $permalink;
$pages_params['default_entry_flag'] = _ON;
$pages_params['display_flag'] = $display_flag;
$pages_params['display_sequence'] = $display_sequence;
$private_page_id = $this->pagesAction->insPage($pages_params, true, false);
- if ($private_page_id === false) return 'error';
+ if ($private_page_id === false) return 'error';
- //
+ //
// ページユーザリンクテーブル追加
//
$pages_users_link_params['room_id'] = $private_page_id;
$result = $this->pagesAction->insPageUsersLink($pages_users_link_params);
- if ($result === false) return 'error';
+ if ($result === false) return 'error';
//
// 月別アクセス回数初期値登録
//
$monthlynumber_params['room_id'] = $private_page_id;
$result = $this->monthlynumberAction->insMonthlynumber($monthlynumber_params);
- if($result === false) {
- return 'error';
- }
+ if($result === false) {
+ return 'error';
+ }
}
- // ----------------------------------------------------------------------
- // --- メール送信処理 ---
+ // ----------------------------------------------------------------------
+ // --- メール送信処理 ---
// ----------------------------------------------------------------------
if($mail_autoregist_subject == "" || count($email_arr) == 0) {
$this->error_flag = false;
@@ -536,13 +536,13 @@ function execute()
$this->mailMain->send();
- $this->error_flag = false;
+ $this->error_flag = false;
return 'success';
- }
+ }
- /**
+ /**
* アクティベーションキーを取得
*
* @param string $length 生成するアクティベーションキーの桁数
diff --git a/html/webapp/modules/login/action/main/forgetpass/maple.ini b/html/webapp/modules/login/action/main/forgetpass/maple.ini
index c9e8669..b4ad834 100644
--- a/html/webapp/modules/login/action/main/forgetpass/maple.ini
+++ b/html/webapp/modules/login/action/main/forgetpass/maple.ini
@@ -1,5 +1,6 @@
[SmartyAssign]
module = main.ini
+global_config = user.ini
[ValidateDef]
email.required ="1:lang._required,lang.login_email"
diff --git a/html/webapp/modules/login/validator/Validator_Forgetpass.class.php b/html/webapp/modules/login/validator/Validator_Forgetpass.class.php
index 21c7a11..0e70db5 100644
--- a/html/webapp/modules/login/validator/Validator_Forgetpass.class.php
+++ b/html/webapp/modules/login/validator/Validator_Forgetpass.class.php
@@ -15,112 +15,72 @@
*/
class Login_Validator_Forgetpass extends Validator
{
- /**
- * validate実行
- *
- * @param mixed $attributes チェックする値(emai, code_date)
- *
- * @param string $errStr エラー文字列(未使用:エラーメッセージ固定)
- * @param array $params オプション引数
- * @return string エラー文字列(エラーの場合)
- * @access public
- */
- function validate($attributes, $errStr, $params)
- {
- // container取得
+ /**
+ * validate実行
+ *
+ * @param mixed $attributes チェックする値(emai, code_date)
+ *
+ * @param string $errStr エラー文字列(未使用:エラーメッセージ固定)
+ * @param array $params オプション引数
+ * @return string エラー文字列(エラーの場合)
+ * @access public
+ */
+ function validate($attributes, $errStr, $params)
+ {
+ // container取得
$container =& DIContainerFactory::getContainer();
- $session =& $container->getComponent("Session");
+ $session =& $container->getComponent("Session");
$usersView =& $container->getComponent("usersView");
$db =& $container->getComponent("DbObject");
- //$user_id = $session->getParameter("_user_id");
-
- $email = $attributes[0];
- $code_date = $attributes[1];
- $login_forgetpass_count = $session->getParameter("login_forgetpass_count");
- if(isset($login_forgetpass_count) && $login_forgetpass_count >= 3) {
- // 入力を受け付けない
- return LOGIN_MISS_EMAIL;
- }
+ $email = preg_replace("/[ \s]+/u", "", $attributes[0]);
+ $code_date = $attributes[1];
+ $login_forgetpass_count = $session->getParameter("login_forgetpass_count");
+ if(isset($login_forgetpass_count) && $login_forgetpass_count >= 3) {
+ // 入力を受け付けない
+ return LOGIN_MISS_EMAIL;
+ }
// 入力文字チェック
if ( $email != "" && !strpos($email, "@") ) {
return sprintf(_FORMAT_WRONG_ERROR, "e-mail");
}
// 存在チェック
- if($email != "") {
- $sql = "SELECT item_id, type FROM {items}".
- " WHERE ({items}.type='email' OR {items}.type='mobile_email')";
- $email_items = $db->execute($sql);
- if(count($email_items) > 0) {
- $sql = "SELECT {users_items_link}.user_id, {users_items_link}.item_id, {users_items_link}.content".
- " FROM {users_items_link}".
- " INNER JOIN {users} ON {users}.user_id={users_items_link}.user_id AND {users}.active_flag="._USER_ACTIVE_FLAG_ON.
- " WHERE {users_items_link}.item_id IN (";
- $first = true;
- $types = array();
- foreach($email_items as $email_item) {
- if($first == false)
- $sql .= ",";
- $sql .= $email_item['item_id'];
- $types[$email_item['item_id']] = $email_item['type'];
- $first = false;
- }
- $where_params = array();
- if (mb_strlen($email) < _MYSQL_FT_MIN_WORD_LEN) {
- $sql .= ")".
- " AND {users_items_link}.content=? ";
- $where_params = array(
- "{users_items_link}.content" => $email
- );
- } else {
- //$sql .= ")".
- // " AND MATCH({users_items_link}.content) AGAINST ('\"".$db->stringMatchAgainst($email)."\"' IN BOOLEAN MODE)";
- $sql .= ")".
- " AND MATCH({users_items_link}.content) AGAINST (? IN BOOLEAN MODE)";
- $where_params = array(
- "{users_items_link}.content" => '"'.$email.'"'
- );
- }
- $chk_items =& $db->execute($sql, $where_params);
- $count = !empty($chk_items) ? count($chk_items) : 0;
+ $userIdByMail = $usersView->getUserIdByMail($email, true);
+ if (empty($userIdByMail)) {
+ if(!isset($login_forgetpass_count) || !is_int($login_forgetpass_count)) {
+ $login_forgetpass_count = 1;
+ } else {
+ $login_forgetpass_count++;
}
+ $session->setParameter("login_forgetpass_count", $login_forgetpass_count);
+ if($login_forgetpass_count >= 3) {
+ //3回目以降
+ return LOGIN_MISS_EMAIL;
+ } else {
+ return LOGIN_INCORRECT_EMAIL;
+ }
+ }
- if(count($email_items) == 0 || !isset($chk_items[0]['user_id'])) {
- // 存在しない
- if(!isset($login_forgetpass_count) || !is_int($login_forgetpass_count)) {
- $login_forgetpass_count = 1;
- } else {
- $login_forgetpass_count++;
- }
- $session->setParameter("login_forgetpass_count", $login_forgetpass_count);
- if($login_forgetpass_count >= 3) {
- //3回目以降
- return LOGIN_MISS_EMAIL;
- } else {
- return LOGIN_INCORRECT_EMAIL;
- }
- }
- // 存在しているものでも何度も送信されるのを防ぐ必要があるかも
- // 現状、処理しない
- $user =& $usersView->getUserById($chk_items[0]['user_id']);
- if($user === false || !isset($user['user_id'])) return sprintf(_INVALID_SELECTDB, "users");
-
- if(isset($code_date)) {
- if($code_date != substr($user['password'], 0, 10)) {
- // 正しくないcode_dataがきた場合
- return LOGIN_MISS_CODEDATA;
- }
- }
+ // 存在しているものでも何度も送信されるのを防ぐ必要があるかも
+ // 現状、処理しない
+ $user =& $usersView->getUserById($userIdByMail);
+ if($user === false || !isset($user['user_id'])) return sprintf(_INVALID_SELECTDB, "users");
- // Actionにデータセット
- $actionChain =& $container->getComponent("ActionChain");
- $action =& $actionChain->getCurAction();
- BeanUtils::setAttributes($action, array("user"=>$user));
- BeanUtils::setAttributes($action, array("send_email"=>$chk_items[0]['content']));
+ if(isset($code_date)) {
+ if($code_date != substr($user['password'], 0, 10)) {
+ // 正しくないcode_dataがきた場合
+ return LOGIN_MISS_CODEDATA;
+ }
}
- return;
- }
+ // Actionにデータセット
+ $actionChain =& $container->getComponent("ActionChain");
+ $action =& $actionChain->getCurAction();
+ BeanUtils::setAttributes($action, array("user"=>$user));
+ BeanUtils::setAttributes($action, array("send_email"=>$email));
+
+ return;
+ }
}
?>
diff --git a/html/webapp/modules/login/validator/Validator_ItemsInputs.class.php b/html/webapp/modules/login/validator/Validator_ItemsInputs.class.php
index 1916853..1db03d2 100644
--- a/html/webapp/modules/login/validator/Validator_ItemsInputs.class.php
+++ b/html/webapp/modules/login/validator/Validator_ItemsInputs.class.php
@@ -19,21 +19,21 @@
*/
class Login_Validator_ItemsInputs extends Validator
{
- /**
- * validate実行
- *
- * @param mixed $attributes チェックする値(user_id, items, items_public, items_reception)
- *
- * @param string $errStr エラー文字列(未使用:エラーメッセージ固定)
- * @param array $params オプション引数
- * @return string エラー文字列(エラーの場合)
- * @access public
- */
- function validate($attributes, $errStr, $params)
- {
- // container取得
+ /**
+ * validate実行
+ *
+ * @param mixed $attributes チェックする値(user_id, items, items_public, items_reception)
+ *
+ * @param string $errStr エラー文字列(未使用:エラーメッセージ固定)
+ * @param array $params オプション引数
+ * @return string エラー文字列(エラーの場合)
+ * @access public
+ */
+ function validate($attributes, $errStr, $params)
+ {
+ // container取得
$container =& DIContainerFactory::getContainer();
- $session =& $container->getComponent("Session");
+ $session =& $container->getComponent("Session");
$usersView =& $container->getComponent("usersView");
$configView =& $container->getComponent("configView");
$fileUpload =& $container->getComponent("FileUpload");
@@ -44,43 +44,43 @@ function validate($attributes, $errStr, $params)
$config = $configView->getConfigByCatid(_SYS_CONF_MODID, _ENTER_EXIT_CONF_CATID);
- if($config['autoregist_use']['conf_value'] != _ON) {
- return $errStr;
- }
-
- $where_params = array(
- "user_authority_id" => _AUTH_ADMIN // 管理者固定
- );
- $show_items =& $usersView->getItems($where_params, null, null, null, array($this, "_getItemsFetchcallback"));
- if($show_items === false) {
- return $errStr;
- }
- $autoregist_use_items = explode("|", $config['autoregist_use_items']['conf_value']);
- foreach($autoregist_use_items as $autoregist_use_item) {
- $buf_arr = explode(":", $autoregist_use_item);
- if(isset($buf_arr[0]) && $buf_arr[0] != "") {
- $autoregist_use_items[$buf_arr[0]] = $buf_arr[0];
- $autoregist_use_items_req[$buf_arr[0]] = $buf_arr[1];
- }
- }
-
- $files = $fileUpload->getOriginalName();
- $files_key = array_keys($files);
-
- foreach($show_items as $show_items_key => $items) {
-
- if(!isset($autoregist_use_items[$items['item_id']])) {
- // 自動ログインの項目ではない
- if(isset($attributes['items']) && isset($attributes['items'][$items['item_id']])) {
- return $errStr;
- }
- continue;
- }
- $err_prefix = $items['item_id'].":";
- if($items['define_flag'] == _ON && defined($items['item_name'])) {
- $items['item_name'] = constant($items['item_name']);
- $show_items[$show_items_key]['item_name'] = $items['item_name'];
- }
+ if($config['autoregist_use']['conf_value'] != _ON) {
+ return $errStr;
+ }
+
+ $where_params = array(
+ "user_authority_id" => _AUTH_ADMIN // 管理者固定
+ );
+ $show_items =& $usersView->getItems($where_params, null, null, null, array($this, "_getItemsFetchcallback"));
+ if($show_items === false) {
+ return $errStr;
+ }
+ $autoregist_use_items = explode("|", $config['autoregist_use_items']['conf_value']);
+ foreach($autoregist_use_items as $autoregist_use_item) {
+ $buf_arr = explode(":", $autoregist_use_item);
+ if(isset($buf_arr[0]) && $buf_arr[0] != "") {
+ $autoregist_use_items[$buf_arr[0]] = $buf_arr[0];
+ $autoregist_use_items_req[$buf_arr[0]] = $buf_arr[1];
+ }
+ }
+
+ $files = $fileUpload->getOriginalName();
+ $files_key = array_keys($files);
+
+ foreach($show_items as $show_items_key => $items) {
+
+ if(!isset($autoregist_use_items[$items['item_id']])) {
+ // 自動ログインの項目ではない
+ if(isset($attributes['items']) && isset($attributes['items'][$items['item_id']])) {
+ return $errStr;
+ }
+ continue;
+ }
+ $err_prefix = $items['item_id'].":";
+ if($items['define_flag'] == _ON && defined($items['item_name'])) {
+ $items['item_name'] = constant($items['item_name']);
+ $show_items[$show_items_key]['item_name'] = $items['item_name'];
+ }
if($items['type'] == "file") {
// File
// 必須入力チェック
@@ -109,65 +109,65 @@ function validate($attributes, $errStr, $params)
continue;
}
- if(isset($attributes['items']) && isset($attributes['items'][$items['item_id']])) {
- $content = $attributes['items'][$items['item_id']];
- } else {
- $content = "";
- }
+ if(isset($attributes['items']) && isset($attributes['items'][$items['item_id']])) {
+ $content = $attributes['items'][$items['item_id']];
+ } else {
+ $content = "";
+ }
- // 必須入力チェック
- if($items['require_flag'] == _ON || (isset($autoregist_use_items_req[$items['item_id']]) && $autoregist_use_items_req[$items['item_id']] == _ON)) {
- // 必須項目
- if($content == "") {
+ // 必須入力チェック
+ if($items['require_flag'] == _ON || (isset($autoregist_use_items_req[$items['item_id']]) && $autoregist_use_items_req[$items['item_id']] == _ON)) {
+ // 必須項目
+ if($content == "") {
return $err_prefix.sprintf(_REQUIRED, $items['item_name']);
- }
- }
-
- if($items['tag_name'] == "login_id") {
- // 入力文字チェック
- $login_id = $content;
- $login_len = strlen($content);
- if($login_len < USER_LOGIN_ID_MINSIZE || $login_len > USER_LOGIN_ID_MAXSIZE) {
- return $err_prefix.sprintf(_MAXRANGE_ERROR, USER_ITEM_LOGIN, USER_LOGIN_ID_MINSIZE, USER_LOGIN_ID_MAXSIZE);
- }
-
- // 半角英数または、記号
- if(preg_match(_REGEXP_ALLOW_HALFSIZE_SYMBOL, $login_id)) {
- return $err_prefix.sprintf(_HALFSIZESYMBOL_ERROR, USER_ITEM_LOGIN);
- }
-
- // 重複チェック
- $where_params = array("login_id" => $login_id);
- $users =& $usersView->getUsers($where_params);
- $count = count($users);
- if($count >= 1) {
- return $err_prefix.sprintf(LOGIN_MES_ERROR_DUPLICATE, USER_ITEM_LOGIN, USER_ITEM_LOGIN);
- }
- } else if($items['tag_name'] == "password") {
- $new_password = $content;
- // 入力文字チェック
- $pass_len = strlen($new_password);
- if($pass_len < USER_PASSWORD_MINSIZE || $pass_len > USER_PASSWORD_MAXSIZE) {
- return $err_prefix.sprintf(_MAXRANGE_ERROR, USER_ITEM_PASSWORD, USER_PASSWORD_MINSIZE, USER_PASSWORD_MAXSIZE);
- }
-
- if(!isset($attributes['items_password_confirm'][$items['item_id']]) || $new_password != $attributes['items_password_confirm'][$items['item_id']]) {
- return $err_prefix.LOGIN_ERR_PASS_DISACCORD;
- }
- // 半角英数または、記号
- if(preg_match(_REGEXP_ALLOW_HALFSIZE_SYMBOL, $new_password)) {
- return $err_prefix.sprintf(_HALFSIZESYMBOL_ERROR, USER_ITEM_PASSWORD);
- }
- } else if($items['tag_name'] == "handle") {
- // 重複チェック
- $handle = $content;
- $where_params = array("handle" => $handle);
- $users =& $usersView->getUsers($where_params);
- $count = count($users);
- if($count >= 1) {
- return $err_prefix.sprintf(LOGIN_MES_ERROR_DUPLICATE, USER_ITEM_HANDLE, USER_ITEM_HANDLE);
- }
- }
+ }
+ }
+
+ if($items['tag_name'] == "login_id") {
+ // 入力文字チェック
+ $login_id = $content;
+ $login_len = strlen($content);
+ if($login_len < USER_LOGIN_ID_MINSIZE || $login_len > USER_LOGIN_ID_MAXSIZE) {
+ return $err_prefix.sprintf(_MAXRANGE_ERROR, USER_ITEM_LOGIN, USER_LOGIN_ID_MINSIZE, USER_LOGIN_ID_MAXSIZE);
+ }
+
+ // 半角英数または、記号
+ if(preg_match(_REGEXP_ALLOW_HALFSIZE_SYMBOL, $login_id)) {
+ return $err_prefix.sprintf(_HALFSIZESYMBOL_ERROR, USER_ITEM_LOGIN);
+ }
+
+ // 重複チェック
+ $where_params = array("login_id" => $login_id);
+ $users =& $usersView->getUsers($where_params);
+ $count = count($users);
+ if($count >= 1) {
+ return $err_prefix.sprintf(LOGIN_MES_ERROR_DUPLICATE, USER_ITEM_LOGIN, USER_ITEM_LOGIN);
+ }
+ } else if($items['tag_name'] == "password") {
+ $new_password = $content;
+ // 入力文字チェック
+ $pass_len = strlen($new_password);
+ if($pass_len < USER_PASSWORD_MINSIZE || $pass_len > USER_PASSWORD_MAXSIZE) {
+ return $err_prefix.sprintf(_MAXRANGE_ERROR, USER_ITEM_PASSWORD, USER_PASSWORD_MINSIZE, USER_PASSWORD_MAXSIZE);
+ }
+
+ if(!isset($attributes['items_password_confirm'][$items['item_id']]) || $new_password != $attributes['items_password_confirm'][$items['item_id']]) {
+ return $err_prefix.LOGIN_ERR_PASS_DISACCORD;
+ }
+ // 半角英数または、記号
+ if(preg_match(_REGEXP_ALLOW_HALFSIZE_SYMBOL, $new_password)) {
+ return $err_prefix.sprintf(_HALFSIZESYMBOL_ERROR, USER_ITEM_PASSWORD);
+ }
+ } else if($items['tag_name'] == "handle") {
+ // 重複チェック
+ $handle = $content;
+ $where_params = array("handle" => $handle);
+ $users =& $usersView->getUsers($where_params);
+ $count = count($users);
+ if($count >= 1) {
+ return $err_prefix.sprintf(LOGIN_MES_ERROR_DUPLICATE, USER_ITEM_HANDLE, USER_ITEM_HANDLE);
+ }
+ }
if($items['type'] == "email" || $items['type'] == "mobile_email") {
$email = $content;
@@ -175,53 +175,28 @@ function validate($attributes, $errStr, $params)
if ( $email != "" && !strpos($email, "@") ) {
return $err_prefix.sprintf(_FORMAT_WRONG_ERROR, $items['item_name']);
}
- if($email != "") {
- // 入力の確認
- if(!isset($attributes['items_mail_confirm'][$items['item_id']]) || $email != $attributes['items_mail_confirm'][$items['item_id']]) {
- if ($items['type'] == "email") {
- $err_msg = LOGIN_ERR_EMAIL_DISACCORD;
- } else if ($items['type'] == "mobile_email") {
- $err_msg = LOGIN_ERR_MOBILE_EMAIL_DISACCORD;
- }
- return $err_prefix.$err_msg;
- }
- // 重複チェック
- $sql = "SELECT item_id, type FROM {items}".
- " WHERE ({items}.type='email' OR {items}.type='mobile_email')";
- $email_items = $db->execute($sql);
- if(count($email_items) > 0) {
- $sql = "SELECT {users_items_link}.user_id, {users_items_link}.item_id, {users_items_link}.content".
- " FROM {users_items_link}".
- " WHERE {users_items_link}.item_id IN (";
- $first = true;
- foreach($email_items as $email_item) {
- if($first == false)
- $sql .= ",";
- $sql .= $email_item['item_id'];
- $first = false;
- }
- $where_params = array();
- if (mb_strlen($email) < _MYSQL_FT_MIN_WORD_LEN) {
- $sql .= ")".
- " AND {users_items_link}.content=? ";
- $where_params = array(
- "{users_items_link}.content" => $email
- );
- } else {
- $sql .= ")".
- " AND MATCH({users_items_link}.content) AGAINST (? IN BOOLEAN MODE)";
- $where_params = array(
- "{users_items_link}.content" => '"'.$email.'"'
- );
- }
- $chk_items =& $db->execute($sql, $where_params);
- $count = !empty($chk_items) ? count($chk_items) : 0;
- }
- if(count($email_items) == 0 || $count >= 1) {
- return $err_prefix.sprintf(LOGIN_MES_ERROR_DUPLICATE, $items['item_name'] , $items['item_name'] );
+ // 確認用アドレスチェック
+ if ($email != $attributes['items_mail_confirm'][$items['item_id']]) {
+ $errorMessage = $err_prefix;
+
+ if ($items['type'] == "email") {
+ $errorMessage .= LOGIN_ERR_EMAIL_DISACCORD;
+ } else if ($items['type'] == "mobile_email") {
+ $errorMessage .= LOGIN_ERR_MOBILE_EMAIL_DISACCORD;
}
+
+ return $errorMessage;
+ }
+
+ // 重複チェック
+ $userIdByMail = $usersView->getUserIdByMail($email);
+ if (!empty($userIdByMail)) {
+ $errorMessage = $err_prefix
+ . sprintf(LOGIN_MES_ERROR_DUPLICATE, $items['item_name'], $items['item_name']);
+ return $errorMessage;
}
+
// メール受信可否
if(isset($attributes['items_reception']) && isset($attributes['items_reception'][$items['item_id']])) {
if($items['allow_email_reception_flag'] == _OFF ||
@@ -233,27 +208,27 @@ function validate($attributes, $errStr, $params)
}
- // 公開設定
- if(isset($attributes['items_public']) && isset($attributes['items_public'][$items['item_id']])) {
- if($items['allow_public_flag'] == _OFF ||
- !($attributes['items_public'][$items['item_id']] == _ON ||
- $attributes['items_public'][$items['item_id']] == _OFF)) {
- return $err_prefix._INVALID_INPUT;
- }
- }
- }
+ // 公開設定
+ if(isset($attributes['items_public']) && isset($attributes['items_public'][$items['item_id']])) {
+ if($items['allow_public_flag'] == _OFF ||
+ !($attributes['items_public'][$items['item_id']] == _ON ||
+ $attributes['items_public'][$items['item_id']] == _OFF)) {
+ return $err_prefix._INVALID_INPUT;
+ }
+ }
+ }
- // 利用許諾
- if(!isset($attributes['autoregist_disclaimer_ok'])) {
- return LOGIN_ERR_MES_DISCLAIMER;
- }
+ // 利用許諾
+ if(!isset($attributes['autoregist_disclaimer_ok'])) {
+ return LOGIN_ERR_MES_DISCLAIMER;
+ }
- // 入力キー
- if ($config['autoregist_use_input_key']['conf_value'] == _ON &&
- $config['autoregist_input_key']['conf_value'] != $attributes['autoregist_input_key']) {
+ // 入力キー
+ if ($config['autoregist_use_input_key']['conf_value'] == _ON &&
+ $config['autoregist_input_key']['conf_value'] != $attributes['autoregist_input_key']) {
- return LOGIN_ERR_MES_INPUT_KEY;
- }
+ return LOGIN_ERR_MES_INPUT_KEY;
+ }
// File
$garbage_flag = _OFF;
@@ -263,14 +238,14 @@ function validate($attributes, $errStr, $params)
if(isset($file['error_mes']) && $file['error_mes'] != "" && $file['error_mes'] != _FILE_UPLOAD_ERR_UPLOAD_NOFILE) {
$err_prefix = $key.":";
return $err_prefix.$file['error_mes'];
- }
+ }
}
- // actionChain取得
+ // actionChain取得
$actionChain =& $container->getComponent("ActionChain");
$action =& $actionChain->getCurAction();
- if(isset($params[0])) {
- BeanUtils::setAttributes($action, array($params[0]=>$show_items));
+ if(isset($params[0])) {
+ BeanUtils::setAttributes($action, array($params[0]=>$show_items));
} else {
BeanUtils::setAttributes($action, array("show_items"=>$show_items));
}
@@ -282,7 +257,7 @@ function validate($attributes, $errStr, $params)
BeanUtils::setAttributes($action, array("filelist"=>$filelist));
return;
- }
+ }
/**
* fetch時コールバックメソッド
diff --git a/html/webapp/modules/login/view/main/init/Init.class.php b/html/webapp/modules/login/view/main/init/Init.class.php
index 1f96c92..66d37a8 100644
--- a/html/webapp/modules/login/view/main/init/Init.class.php
+++ b/html/webapp/modules/login/view/main/init/Init.class.php
@@ -3,7 +3,7 @@
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
-* ログインモジュール
+ * ログインモジュール
*
* @package NetCommons
* @author Noriko Arai,Ryuji Masukawa
@@ -15,19 +15,19 @@
class Login_View_Main_Init extends Action
{
// リクエストパラメータを受け取るため
- var $error_mes = null;
- var $block_id = null;
- var $http = null;
-
- var $prefix_id_name = null;
-
+ var $error_mes = null;
+ var $block_id = null;
+ var $http = null;
+
+ var $prefix_id_name = null;
+
// コンポーネントを使用するため
var $session = null;
var $configView = null;
var $token = null;
var $filterChain = null;
var $request = null;
-
+
// 値をセットするため
var $login_id = "";
var $autologin = _OFF;
@@ -41,87 +41,87 @@ class Login_View_Main_Init extends Action
var $iframeSsl = null;
var $dialog_name = null;
var $autocomplete = null;
-
- /**
- * ログインモジュール
- *
- * @access public
- */
- function execute()
- {
- $this->redirect_url = $this->request->getParameter('_redirect_url');
- $this->redirect_url = str_replace("#", "@@", $this->redirect_url);
- $this->redirect_url = str_replace("&", "@", $this->redirect_url);
- $this->redirect_url = str_replace("?action=", "?_sub_action=", $this->redirect_url);
-
- //if(!isset($_SERVER['HTTPS']) && $this->session->getParameter("_user_id")) {
- if($this->session->getParameter("_user_id")
- && $this->block_id != 0) {
- return 'success_login';
- } else {
- $config = $this->configView->getConfigByCatid(_SYS_CONF_MODID, _GENERAL_CONF_CATID);
- $this->use_ssl = $config['use_ssl']['conf_value'];
- if($config['autologin_use']['conf_value'] != _AUTOLOGIN_NO) {
- // ログインIDのみ取得
- $autologin_login_cookie_name = $config['autologin_login_cookie_name']['conf_value'];
- $this->login_id = isset($_COOKIE[$autologin_login_cookie_name]) ? $_COOKIE[$autologin_login_cookie_name] : "";
- }
- if($config['autologin_use']['conf_value'] == _AUTOLOGIN_OK) {
- $this->autologin = _ON;
- }
- if (empty($this->block_id)) {
- $this->formClassName = 'login_popup';
- } else {
- $this->formClassName = 'login_block';
- }
- if ($this->autologin==1) {
- $this->sslOuterClassName = 'login_ssl_outer_rememberme';
- } else {
- $this->sslOuterClassName = 'login_ssl_outer';
- }
- $this->autocomplete = 'off';
- if (!empty($config['login_autocomplete']['conf_value'])) {
- $this->autocomplete = 'on';
-
- if (!ereg('Chrome', $_SERVER['HTTP_USER_AGENT'])
- && ereg('Safari', $_SERVER['HTTP_USER_AGENT'])) {
- $this->login_id = '';
- }
- }
+ /**
+ * ログインモジュール
+ *
+ * @access public
+ */
+ function execute()
+ {
+ $this->redirect_url = $this->request->getParameter('_redirect_url');
+ $this->redirect_url = str_replace("#", "@@", $this->redirect_url);
+ $this->redirect_url = str_replace("&", "@", $this->redirect_url);
+ $this->redirect_url = str_replace("?action=", "?_sub_action=", $this->redirect_url);
- $smartyAssign =& $this->filterChain->getFilterByName('SmartyAssign');
- $this->dialog_name = $smartyAssign->getLang('login');
- $this->closesite = $config['closesite']['conf_value'];
- $this->token_value = $this->token->getValue();
+ //if(!isset($_SERVER['HTTPS']) && $this->session->getParameter("_user_id")) {
+ if($this->session->getParameter("_user_id")
+ && $this->block_id != 0) {
+ return 'success_login';
+ }
- $isBaseUrlHttps = preg_match("/^https:\/\//i", BASE_URL);
- $view =& $this->filterChain->getFilterByName("View");
+ $config = $this->configView->getConfigByCatid(_SYS_CONF_MODID, _GENERAL_CONF_CATID);
+ $this->use_ssl = $config['use_ssl']['conf_value'];
+ if($config['autologin_use']['conf_value'] != _AUTOLOGIN_NO) {
+ // ログインIDのみ取得
+ $autologin_login_cookie_name = $config['autologin_login_cookie_name']['conf_value'];
+ $this->login_id = isset($_COOKIE[$autologin_login_cookie_name]) ? $_COOKIE[$autologin_login_cookie_name] : "";
+ }
+ if($config['autologin_use']['conf_value'] == _AUTOLOGIN_OK) {
+ $this->autologin = _ON;
+ }
+ if (empty($this->block_id)) {
+ $this->formClassName = 'login_popup';
+ } else {
+ $this->formClassName = 'login_block';
+ }
+ if ($this->autologin == _ON) {
+ $this->sslOuterClassName = 'login_ssl_outer_rememberme';
+ } else {
+ $this->sslOuterClassName = 'login_ssl_outer';
+ }
- if (!empty($this->http)) {
- $this->iframeSsl = true;
- $view->setAttribute('define:theme', 0);
+ $this->autocomplete = 'off';
+ if (!empty($config['login_autocomplete']['conf_value'])) {
+ $this->autocomplete = 'on';
- return 'success';
+ if (!ereg('Chrome', $_SERVER['HTTP_USER_AGENT'])
+ && ereg('Safari', $_SERVER['HTTP_USER_AGENT'])) {
+ $this->login_id = '';
}
+ }
- if (!empty($this->error_mes)) {
- $view->setAttribute('define:close_popup_func',
- 'location.href=\'' . BASE_URL . INDEX_FILE_NAME . '\';'
- . 'return false;');
- }
+ $smartyAssign =& $this->filterChain->getFilterByName('SmartyAssign');
+ $this->dialog_name = $smartyAssign->getLang('login');
+ $this->closesite = $config['closesite']['conf_value'];
+ $this->token_value = $this->token->getValue();
- if ($config['use_ssl']['conf_value'] != 0
- && !$isBaseUrlHttps
- && empty($this->http)) {
- $this->ssl_base_url = preg_replace("/^http:\/\//i","https://", BASE_URL);
- return 'success_ssl';
- }
+ $isBaseUrlHttps = preg_match("/^https:\/\//i", BASE_URL);
+ $view =& $this->filterChain->getFilterByName("View");
- $this->sslOuterClassName = '';
+ if (!empty($this->http)) {
+ $this->iframeSsl = true;
+ $view->setAttribute('define:theme', 0);
return 'success';
}
+
+ if (!empty($this->error_mes)) {
+ $view->setAttribute('define:close_popup_func',
+ 'location.href=\'' . BASE_URL . INDEX_FILE_NAME . '\';'
+ . 'return false;');
+ }
+
+ if ($config['use_ssl']['conf_value'] != 0
+ && !$isBaseUrlHttps
+ && empty($this->http)) {
+ $this->ssl_base_url = preg_replace("/^http:\/\//i","https://", BASE_URL);
+ return 'success_ssl';
+ }
+
+ $this->sslOuterClassName = '';
+
+ return 'success';
}
}
?>
\ No newline at end of file
diff --git a/html/webapp/modules/menu/action/edit/addpage/maple.ini b/html/webapp/modules/menu/action/edit/addpage/maple.ini
index 0ef899a..b1b56f8 100644
--- a/html/webapp/modules/menu/action/edit/addpage/maple.ini
+++ b/html/webapp/modules/menu/action/edit/addpage/maple.ini
@@ -1,6 +1,6 @@
[ValidateDef]
main_page_id.required ="1:lang._required,lang._page_id"
-main_page_id.menu.regist = "1:lang._invalid_auth"
+main_page_id.menu.regist = "1,add:lang._invalid_auth"
[Action]
session = "ref:Session"
diff --git a/html/webapp/modules/menu/templates/default/menu_mobile_detail.html b/html/webapp/modules/menu/templates/default/menu_mobile_detail.html
index db3f7b0..8a37e60 100644
--- a/html/webapp/modules/menu/templates/default/menu_mobile_detail.html
+++ b/html/webapp/modules/menu/templates/default/menu_mobile_detail.html
@@ -1,82 +1,98 @@
-<{strip}>
-<{* 携帯詳細表示用テンプレート *}>
- <{assign var="page_id" value=$action.page_id}>
-
- <{$smarty.session._page_title}>
-
-<{if ($action.count > 0) }>
-
- <{assign var="blocks" value=$action.blocks.0}>
- <{include file="menu_mobile_recursive_block.html"}>
-
-<{else}>
- <{$lang.menu_no_page|smarty:nodefaults}>
-<{/if}>
-
-
-<{if ( $action.page_id == $action.room_id && $action.each_room_flag == _ON ) }>
-
- <{if !empty($action.pageTree|smarty:nodefaults)}>
- <{ if $action.pageCount > 0 }>
-
- <{$lang.menu_in_room_select|smarty:nodefaults}>
-
- <{assign var="pages" value=$action.topPage}>
- <{assign var="minusIndentFirstCheckLevel" value=1}>
- <{assign var="minusIndentFirst" value=0}>
- <{if ($smarty.session._smartphone_flag == _ON) }>
-
- <{if $action.menu_display_type==$smarty.const.MOBILE_MENU_DISPLAY_TREE }>
- <{include file="menu_mobile_recursive_page_smart_tree.html"}>
- <{else}>
- <{include file="menu_mobile_recursive_page_smart_flat.html"}>
- <{/if}>
-
- <{else}>
- <{include file="menu_mobile_recursive_page_feature.html"}>
- <{/if}>
- <{/if}>
- <{/if}>
-
-<{/if}>
-
-
-
-
-
-
-<{if $action.each_room_flag == $smarty.const._ON }>
- <{if ($smarty.session._smartphone_flag == _ON) }>
-
-
- <{$lang.menu_room_select|smarty:nodefaults}>
-
- <{else}>
-
- <{$lang.menu_room_select|smarty:nodefaults}>
-
-
- <{/if}>
-
- <{assign var="menu_redirect_action" value=$conf.menu_redirect_action}>
- <{assign var="next_thread_num" value=0}>
- <{assign var="next_parent_id" value=0}>
- <{assign var="room_list" value=$action.room_arr.$next_thread_num.$next_parent_id}>
- <{if ($smarty.session._smartphone_flag == _ON) }>
- <{include file="menu_mobile_recursive_room_smart.html"}>
-
- <{else}>
- <{include file="menu_mobile_recursive_room_feature.html"}>
-
- <{/if}>
-
-<{/if}>
+<{strip}>
+<{* 携帯詳細表示用テンプレート *}>
+ <{assign var="page_id" value=$action.page_id}>
+
+ <{$smarty.session._page_title}>
+
+<{if ($action.count > 0) }>
+
+ <{assign var="blocks" value=$action.blocks.0}>
+ <{include file="menu_mobile_recursive_block.html"}>
+
+<{else}>
+ <{$lang.menu_no_page|smarty:nodefaults}>
+<{/if}>
+
+
+<{if $smarty.session.mobileDisplayTextHtml == _ON}>
+
+
+<{/if}>
+
+<{if ( $action.page_id == $action.room_id && $action.each_room_flag == _ON ) }>
+
+ <{if !empty($action.pageTree|smarty:nodefaults)}>
+ <{ if $action.pageCount > 0 }>
+
+ <{$lang.menu_in_room_select|smarty:nodefaults}>
+
+ <{assign var="pages" value=$action.topPage}>
+ <{assign var="minusIndentFirstCheckLevel" value=1}>
+ <{assign var="minusIndentFirst" value=0}>
+ <{if ($smarty.session._smartphone_flag == _ON) }>
+
+ <{if $action.menu_display_type==$smarty.const.MOBILE_MENU_DISPLAY_TREE }>
+ <{include file="menu_mobile_recursive_page_smart_tree.html"}>
+ <{else}>
+ <{include file="menu_mobile_recursive_page_smart_flat.html"}>
+ <{/if}>
+
+ <{else}>
+ <{include file="menu_mobile_recursive_page_feature.html"}>
+ <{/if}>
+ <{/if}>
+ <{/if}>
+
+<{/if}>
+
+
+
+
+
+<{if $action.each_room_flag == $smarty.const._ON }>
+ <{if ($smarty.session._smartphone_flag == _ON) }>
+
+
+ <{$lang.menu_room_select|smarty:nodefaults}>
+
+ <{else}>
+
+ <{$lang.menu_room_select|smarty:nodefaults}>
+
+
+ <{/if}>
+
+ <{assign var="menu_redirect_action" value=$conf.menu_redirect_action}>
+ <{assign var="next_thread_num" value=0}>
+ <{assign var="next_parent_id" value=0}>
+ <{assign var="room_list" value=$action.room_arr.$next_thread_num.$next_parent_id}>
+ <{if ($smarty.session._smartphone_flag == _ON) }>
+ <{include file="menu_mobile_recursive_room_smart.html"}>
+
+ <{else}>
+ <{include file="menu_mobile_recursive_room_feature.html"}>
+
+ <{/if}>
+
+<{/if}>
<{/strip}>
\ No newline at end of file
diff --git a/html/webapp/modules/menu/templates/default/menu_mobile_recursive_block.html b/html/webapp/modules/menu/templates/default/menu_mobile_recursive_block.html
index 0dd699e..cab8b2a 100644
--- a/html/webapp/modules/menu/templates/default/menu_mobile_recursive_block.html
+++ b/html/webapp/modules/menu/templates/default/menu_mobile_recursive_block.html
@@ -1,66 +1,51 @@
-<{strip}>
-<{* ブロック一覧表示用テンプレート *}>
-
-<{foreach name="block" key="block_id" key=blockId item="block" from=$blocks}>
- <{if $block.module_id != 0 }>
- <{if ($block.block_name == "" )}>
- <{if ( $block.content != "" ) }>
-
-
-
- <{if ($smarty.session._smartphone_flag != _ON) }>
- <{if ($action.html_flag == _ON) }>
-
-
- <{$block.content|smarty:nodefaults|img_style_rgb_to_hex|wysiwig_convert_url}>
- <{else}>
-
-
- <{$block.content|html_to_text|smarty:nodefaults|nl2br}>
- <{/if}>
- <{else}>
- <{$block.content|smarty:nodefaults|img_style_rgb_to_hex|wysiwig_convert_url}>
- <{/if}>
-
- <{if ( $block.more_title != "" ) }>
-
-
-
- <{$block.more_title}>
-
-
- <{/if}>
-
-
- <{else}>
-
-
- <{$block.module_name}>
-
-
- <{/if}>
- <{else}>
-
-
- <{$block.block_name}>
-
-
- <{/if}>
-
- <{/if}>
-
- <{if !empty($action.blocks.$blockId|smarty:nodefaults)}>
- <{assign var="blocks" value=$action.blocks.$blockId}>
- <{include file="menu_mobile_recursive_block.html"}>
- <{/if}>
-<{/foreach}>
-
+<{strip}>
+<{* ブロック一覧表示用テンプレート *}>
+<{assign var=displayUlTag value=$smarty.const._ON}>
+<{foreach name="block" key="block_id" key=blockId item="block" from=$blocks}>
+ <{if $block.module_id != 0}>
+ <{if $block.block_name == ""
+ && $block.content != ""}>
+ <{if $smarty.session._smartphone_flag == _ON
+ || $action.html_flag == _ON}>
+ <{$block.content|smarty:nodefaults|img_style_rgb_to_hex|wysiwig_convert_url}>
+ <{else}>
+ <{$block.content|html_to_text|smarty:nodefaults|nl2br}>
+ <{/if}>
+
+ <{if $block.more_title != ""}>
+
+
+
+ <{$block.more_title}>
+
+ <{/if}>
+
+ <{else}>
+ <{if $displayUlTag == _ON}>
+
+ <{/if}>
+<{/foreach}>
<{/strip}>
\ No newline at end of file
diff --git a/html/webapp/modules/menu/validator/Validator_Regist.class.php b/html/webapp/modules/menu/validator/Validator_Regist.class.php
index 3da5d0a..137456b 100644
--- a/html/webapp/modules/menu/validator/Validator_Regist.class.php
+++ b/html/webapp/modules/menu/validator/Validator_Regist.class.php
@@ -3,7 +3,7 @@
/**
* 登録時、権限チェック
- *
+ *
* @package NetCommons.components
* @author Noriko Arai,Ryuji Masukawa
* @copyright 2006-2007 NetCommons Project
@@ -25,45 +25,45 @@ class Menu_Validator_Regist extends Validator
function validate($attributes, $errStr, $params)
{
$main_page_id = $attributes;
-
+
$container =& DIContainerFactory::getContainer();
$pagesView =& $container->getComponent("pagesView");
$session =& $container->getComponent("Session");
-
+
$main_page =& $pagesView->getPageById($main_page_id);
if($main_page === false || !isset($main_page['page_id'])) {
- return $errStr;
+ return $errStr;
}
if($main_page['thread_num'] == 0 && $main_page['private_flag'] == _ON) {
// プライベートスペースならば、主担以上ならばOK
if($main_page['authority_id'] < _AUTH_CHIEF) {
- return $errStr;
+ return $errStr;
}
- } else if($main_page['thread_num'] == 0) {
+ } else if($main_page['thread_num'] == 0 && (!isset($params[0]) || $params[0] != "add")) {
// 深さ0ならば、管理者のみ変更を許す
if($session->getParameter("_user_auth_id") != _AUTH_ADMIN) {
- return $errStr;
+ return $errStr;
}
} else if($main_page['page_id'] == $main_page['room_id']) {
- // その他のルーム
+ // その他のルーム
if($main_page['authority_id'] < _AUTH_CHIEF) {
- return $errStr;
+ return $errStr;
}
// 親のルームの権限が主担ならば許す
//$parent_page =& $pagesView->getPageById($main_page['parent_id']);
//if($parent_page === false || !isset($parent_page['authority_id']) || $parent_page['authority_id'] < _AUTH_CHIEF) {
- // return $errStr;
+ // return $errStr;
//}
} else {
// ページ-カテゴリ
$parent_page =& $pagesView->getPageById($main_page['room_id']);
if($parent_page === false || !isset($parent_page['authority_id']) || $parent_page['authority_id'] < _AUTH_CHIEF) {
- return $errStr;
+ return $errStr;
}
}
-
+
if($main_page['authority_id'] < _AUTH_CHIEF && $session->getParameter("_user_auth_id") != _AUTH_ADMIN) {
- return $errStr;
+ return $errStr;
}
}
}
diff --git a/html/webapp/modules/menu/view/mobile/init/Init.class.php b/html/webapp/modules/menu/view/mobile/init/Init.class.php
index 2610b2b..2c0614e 100644
--- a/html/webapp/modules/menu/view/mobile/init/Init.class.php
+++ b/html/webapp/modules/menu/view/mobile/init/Init.class.php
@@ -109,6 +109,23 @@ function execute()
$this->pageCount = count($this->pageTree[$this->page_id]);
}
$this->topPage = current($this->pageTree);
+ if ($this->each_room_flag == _OFF) {
+ $root = array();
+ $dummy = array('thread_num'=>0,'visible'=>true);
+ if (isset($this->pageTree[_SPACE_TYPE_PUBLIC])) {
+ $root[0][_SPACE_TYPE_PUBLIC] = $dummy;
+ }
+ if (isset($this->pageTree[_SPACE_TYPE_GROUP])) {
+ $root[0][_SPACE_TYPE_GROUP] = $dummy;
+ }
+ if (isset($_SESSION['_self_myroom_page']['room_id'])) {
+ $root[0][$_SESSION['_self_myroom_page']['room_id']] = $dummy;
+ }
+ if (isset($root[0])) {
+ $this->topPage = $root[0];
+ $this->pageTree += $root;
+ }
+ }
$this->mobileView->getRoomTree($this->room_arr, $this->menu_display_type, $this->each_room_flag, $roomIds);
if($this->t == _ON || $is_room_detail_display) {
diff --git a/html/webapp/modules/module/update/Update.class.php b/html/webapp/modules/module/update/Update.class.php
index e33a018..6fc5538 100644
--- a/html/webapp/modules/module/update/Update.class.php
+++ b/html/webapp/modules/module/update/Update.class.php
@@ -680,74 +680,6 @@ function execute()
}
}
- // users_items_linkにindexを追加
- $sql = "SHOW INDEX FROM `".$this->db->getPrefix()."users_items_link` ;";
- $results = $this->db->execute($sql);
- if($results === false) return false;
- $alter_table_flag = true;
- $alter_table_content_flag = true;
- foreach($results as $result) {
- if(isset($result['Key_name']) && $result['Key_name'] == "item_id") {
- $alter_table_flag = false;
- }
- if(isset($result['Key_name']) && $result['Key_name'] == "content") {
- $alter_table_content_flag = false;
- }
- }
- if($alter_table_flag) {
- $sql = "ALTER TABLE `".$this->db->getPrefix()."users_items_link` ADD INDEX ( `item_id`, `email_reception_flag` ) ;";
- $result = $this->db->execute($sql);
- if($result === false) return false;
- }
- if($alter_table_content_flag) {
- $sql = "ALTER TABLE `".$this->db->getPrefix()."users_items_link` ADD FULLTEXT ( `content` ) ;";
- $result = $this->db->execute($sql);
- if($result === false) return false;
- }
-
- // usersにindexを追加
- $sql = "SHOW INDEX FROM `".$this->db->getPrefix()."users` ;";
- $results = $this->db->execute($sql);
- if($results === false) return false;
- $alter_table_login_id_flag = true;
- $alter_table_handle_flag = true;
- $alter_table_active_flag = true;
- $alter_table_activate_key_flag = true;
- foreach($results as $result) {
- if(isset($result['Key_name']) && $result['Key_name'] == "active_flag") {
- $alter_table_active_flag = false;
- }
- if(isset($result['Key_name']) && $result['Key_name'] == "login_id") {
- $alter_table_login_id_flag = false;
- }
- if(isset($result['Key_name']) && $result['Key_name'] == "handle") {
- $alter_table_handle_flag = false;
- }
- if(isset($result['Key_name']) && $result['Key_name'] == "activate_key") {
- $alter_table_activate_key_flag = false;
- }
- }
- if($alter_table_login_id_flag) {
- $sql = "ALTER TABLE `".$this->db->getPrefix()."users` ADD INDEX ( `login_id` ) ;";
- $result = $this->db->execute($sql);
- if($result === false) return false;
- }
- if($alter_table_handle_flag) {
- $sql = "ALTER TABLE `".$this->db->getPrefix()."users` ADD INDEX ( `handle` ) ;";
- $result = $this->db->execute($sql);
- if($result === false) return false;
- }
- if($alter_table_active_flag) {
- $sql = "ALTER TABLE `".$this->db->getPrefix()."users` ADD INDEX ( `active_flag`, `system_flag`, `role_authority_id` ) ;";
- $result = $this->db->execute($sql);
- if($result === false) return false;
- }
- if($alter_table_activate_key_flag) {
- $sql = "ALTER TABLE `".$this->db->getPrefix()."users` ADD INDEX ( `activate_key` ) ;";
- $result = $this->db->execute($sql);
- if($result === false) return false;
- }
-
// blocksにindexを追加
$sql = "SHOW INDEX FROM `".$this->db->getPrefix()."blocks` ;";
$results = $this->db->execute($sql);
diff --git a/html/webapp/modules/multidatabase/action/edit/addmetadata/Addmetadata.class.php b/html/webapp/modules/multidatabase/action/edit/addmetadata/Addmetadata.class.php
index 1d56169..a6d04dc 100644
--- a/html/webapp/modules/multidatabase/action/edit/addmetadata/Addmetadata.class.php
+++ b/html/webapp/modules/multidatabase/action/edit/addmetadata/Addmetadata.class.php
@@ -76,29 +76,38 @@ function execute()
$this->search_flag = _OFF;
}
- if(!empty($metadata_id)) {
+ $beforeType = null;
+ $afterType = $this->type;
+ if (!empty($metadata_id)) {
// 編集
$where_params = array("metadata_id" => $metadata_id);
$metadata_before_update = $this->db->selectExecute("multidatabase_metadata", $where_params);
if($metadata_before_update === false || !isset($metadata_before_update[0])) {
return 'error';
}
- if(($metadata_before_update[0]['type'] == MULTIDATABASE_META_TYPE_TEXT || $metadata_before_update[0]['type'] == MULTIDATABASE_META_TYPE_TEXTAREA ||
- $metadata_before_update[0]['type'] == MULTIDATABASE_META_TYPE_WYSIWYG || $metadata_before_update[0]['type'] == MULTIDATABASE_META_TYPE_AUTONUM ||
- $metadata_before_update[0]['type'] == MULTIDATABASE_META_TYPE_MAIL || $metadata_before_update[0]['type'] == MULTIDATABASE_META_TYPE_DATE)
- && ($this->type == MULTIDATABASE_META_TYPE_FILE || $this->type == MULTIDATABASE_META_TYPE_IMAGE)) {
- $param = array("content" => "");
- $result = $this->db->updateExecute("multidatabase_metadata_content", $param, $where_params, true);
+ $beforeType = $metadata_before_update[0]['type'];
+
+ if ($beforeType != MULTIDATABASE_META_TYPE_WYSIWYG
+ && $afterType == MULTIDATABASE_META_TYPE_WYSIWYG) {
+ $sql = "SELECT metadata_content_id, "
+ . "content "
+ . "FROM {multidatabase_metadata_content} "
+ . "WHERE metadata_id = ?";
+ $result = $this->db->execute($sql, $where_params, null, null, true, array($this, '_escapeHtml'));
if ($result === false) {
return 'error';
}
- } elseif ($this->type == MULTIDATABASE_META_TYPE_DATE) {
+ }
+
+ if ($beforeType != MULTIDATABASE_META_TYPE_DATE
+ && $afterType == MULTIDATABASE_META_TYPE_DATE) {
$param = array("content" => "");
$result = $this->db->updateExecute('multidatabase_metadata_content', $param, $where_params, true);
if ($result === false) {
return 'error';
}
}
+
$param = array(
"name" => $this->name,
"type" => $this->type,
@@ -142,8 +151,8 @@ function execute()
}
}
- if ($this->type == MULTIDATABASE_META_TYPE_AUTONUM) {
- $sql = "";
+ if ($beforeType != MULTIDATABASE_META_TYPE_AUTONUM
+ && $afterType == MULTIDATABASE_META_TYPE_AUTONUM) {
$sql = "SELECT MC.content_id AS content_id, ".$metadata_id." AS metadata_id, MMC.metadata_content_id AS metadata_content_id, MC.temporary_flag, MC.agree_flag " .
" FROM {multidatabase_content} MC" .
" LEFT JOIN {multidatabase_metadata_content} MMC" .
@@ -219,5 +228,32 @@ function _fetchCallback(&$recordSet)
return true;
}
+ /**
+ * 既存コンテンツをHTMLエスケープする
+ *
+ * @param array $recordSet コンテンツデータADORecordSet
+ * @return boolean true or false
+ * @access public
+ */
+ function _escapeHtml(&$recordSet)
+ {
+ $sql = "UPDATE {multidatabase_metadata_content} "
+ . "SET "
+ . "content = ? "
+ . "WHERE metadata_content_id = ?";
+
+ while ($row = $recordSet->fetchRow()) {
+ $bindValues = array(
+ htmlspecialchars($row['content']),
+ $row['metadata_content_id']
+ );
+ $result = $this->db->execute($sql, $bindValues);
+ if ($result === false) {
+ return false;
+ }
+ }
+
+ return true;
+ }
}
?>
diff --git a/html/webapp/modules/photoalbum/files/css/default/style.css b/html/webapp/modules/photoalbum/files/css/default/style.css
index 7f559f4..e999c37 100644
--- a/html/webapp/modules/photoalbum/files/css/default/style.css
+++ b/html/webapp/modules/photoalbum/files/css/default/style.css
@@ -221,7 +221,7 @@ span.photoalbum_comment_time {
margin-right:5px;
}
form.photoalbum_comment_form {
- width:450px;
+ width:455px;
}
form.photoalbum_photo_form {
diff --git a/html/webapp/modules/photoalbum/language/chinese/main.ini b/html/webapp/modules/photoalbum/language/chinese/main.ini
index 9dd0041..ecb12b8 100644
--- a/html/webapp/modules/photoalbum/language/chinese/main.ini
+++ b/html/webapp/modules/photoalbum/language/chinese/main.ini
@@ -1,7 +1,7 @@
[Photoalbum_View_Edit_List:Photoalbum_View_Edit_Entry:Photoalbum_Action_Edit_Entry]
photoalbum_photoalbum_name = "相册标题"
-[Photoalbum_View_Edit_List:Photoalbum_View_Edit_Style]
+[Photoalbum_View_Main_Init:Photoalbum_View_Edit_List:Photoalbum_View_Edit_Style]
photoalbum_no_photoalbum = "暂无相片专辑"
[Photoalbum_View_Edit_List]
diff --git a/html/webapp/modules/photoalbum/language/english/main.ini b/html/webapp/modules/photoalbum/language/english/main.ini
index 9533695..ec3d23b 100644
--- a/html/webapp/modules/photoalbum/language/english/main.ini
+++ b/html/webapp/modules/photoalbum/language/english/main.ini
@@ -1,7 +1,7 @@
[Photoalbum_View_Edit_List:Photoalbum_View_Edit_Entry:Photoalbum_Action_Edit_Entry]
photoalbum_photoalbum_name = "Photoalbum Title"
-[Photoalbum_View_Edit_List:Photoalbum_View_Edit_Style]
+[Photoalbum_View_Main_Init:Photoalbum_View_Edit_List:Photoalbum_View_Edit_Style]
photoalbum_no_photoalbum = "No album found"
[Photoalbum_View_Edit_List]
diff --git a/html/webapp/modules/photoalbum/language/japanese/main.ini b/html/webapp/modules/photoalbum/language/japanese/main.ini
index c62004d..c85d523 100644
--- a/html/webapp/modules/photoalbum/language/japanese/main.ini
+++ b/html/webapp/modules/photoalbum/language/japanese/main.ini
@@ -1,7 +1,7 @@
[Photoalbum_View_Edit_List:Photoalbum_View_Edit_Entry:Photoalbum_Action_Edit_Entry]
photoalbum_photoalbum_name = "フォトアルバム名称"
-[Photoalbum_View_Edit_List:Photoalbum_View_Edit_Style]
+[Photoalbum_View_Main_Init:Photoalbum_View_Edit_List:Photoalbum_View_Edit_Style]
photoalbum_no_photoalbum = "現在作成されているフォトアルバムはありません。"
[Photoalbum_View_Edit_List]
diff --git a/html/webapp/modules/photoalbum/templates/default/photoalbum_mobile_view_photo.html b/html/webapp/modules/photoalbum/templates/default/photoalbum_mobile_view_photo.html
index 577937d..7ca8b82 100644
--- a/html/webapp/modules/photoalbum/templates/default/photoalbum_mobile_view_photo.html
+++ b/html/webapp/modules/photoalbum/templates/default/photoalbum_mobile_view_photo.html
@@ -109,9 +109,9 @@
$(".photo_image_wrapper<{$action.photo.photo_id}>").bind( "swiperight" );
$(".photo_image_wrapper<{$action.photo.photo_id}>").bind( "swipeleft" );
-<{if $action.prevPhoto != null}>
+<{if $action.photo.prev_photo_id != null}>
$(".photo_image_wrapper<{$action.photo.photo_id}>").bind( "swiperight", function(e) {
- $.mobile.changePage("?action=photoalbum_view_mobile_photo&block_id=<{$block_id}>&album_id=<{$action.album_id}>&photo_id=<{$action.prevPhoto.photo_id}>&seq=<{$action.seq-1}><{$session_param}>",{ transition: "slide", reverse:"true"});
+ $.mobile.changePage("?action=photoalbum_view_mobile_photo&block_id=<{$block_id}>&album_id=<{$action.album_id}>&photo_id=<{$action.photo.prev_photo_id}>&seq=<{$action.seq-1}><{$session_param}>",{ transition: "slide", reverse:"true"});
e.preventDefault();
});
<{else}>
@@ -119,9 +119,9 @@
$(this).nc_jqm_alert("<{$lang.photoalbum_no_more_photos|smarty:nodefaults}>");
});
<{/if}>
-<{if $action.nextPhoto != null}>
+<{if $action.photo.next_photo_id != null}>
$(".photo_image_wrapper<{$action.photo.photo_id}>").bind( "swipeleft", function(e) {
- $.mobile.changePage("?action=photoalbum_view_mobile_photo&block_id=<{$block_id}>&album_id=<{$action.album_id}>&photo_id=<{$action.nextPhoto.photo_id}>&seq=<{$action.photo.photo_sequence+1}><{$session_param}>");
+ $.mobile.changePage("?action=photoalbum_view_mobile_photo&block_id=<{$block_id}>&album_id=<{$action.album_id}>&photo_id=<{$action.photo.next_photo_id}>&seq=<{$action.photo.photo_sequence+1}><{$session_param}>");
e.preventDefault();
});
<{else}>
diff --git a/html/webapp/modules/photoalbum/templates/default/photoalbum_mobile_view_photo_list.html b/html/webapp/modules/photoalbum/templates/default/photoalbum_mobile_view_photo_list.html
index 4ebdbeb..0c8e90f 100644
--- a/html/webapp/modules/photoalbum/templates/default/photoalbum_mobile_view_photo_list.html
+++ b/html/webapp/modules/photoalbum/templates/default/photoalbum_mobile_view_photo_list.html
@@ -30,7 +30,7 @@
+<{/strip}>
diff --git a/html/webapp/modules/menu/templates/jq_gnavi_pldwn_blue/menu_view_main_list.html b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_blue/menu_view_main_list.html
new file mode 100644
index 0000000..159fd9d
--- /dev/null
+++ b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_blue/menu_view_main_list.html
@@ -0,0 +1,3 @@
+<{strip}>
+ <{include file="../jq_gnavi_pldwn_gray/menu_view_main_list.html"}>
+<{/strip}>
diff --git a/html/webapp/modules/menu/templates/jq_gnavi_pldwn_gray/menu_view_main_detail.html b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_gray/menu_view_main_detail.html
new file mode 100644
index 0000000..2118f31
--- /dev/null
+++ b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_gray/menu_view_main_detail.html
@@ -0,0 +1,11 @@
+<{strip}>
+<{assign var="now_thread_num" value=$action.thread_num}>
+<{assign var="now_parent_id" value=$action.parent_id}>
+<{assign var="menus" value=$action.menus.$now_thread_num.$now_parent_id}>
+
+<{assign var="pldwn_sub_class_name" value="menu_jq_gnavi_pldwn_gray_sub"}>
+<{assign var="pldwn_btn_class_name" value="menu_jq_gnavi_pldwn_gray_btn"}>
+<{assign var="pldwn_highlight_class_name" value="menu_jq_gnavi_pldwn_gray_highlight"}>
+
+<{include file="menu_view_main_list.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
new file mode 100644
index 0000000..cde7810
--- /dev/null
+++ b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_gray/menu_view_main_init.html
@@ -0,0 +1,50 @@
+<{strip}>
+<{assign var="menus" value=$action.menus.0.0}>
+<{assign var="thread_nest" value=0}>
+
+<{assign var="pldwn_sub_class_name" value="menu_jq_gnavi_pldwn_gray_sub"}>
+<{assign var="pldwn_btn_class_name" value="menu_jq_gnavi_pldwn_gray_btn"}>
+<{assign var="pldwn_highlight_class_name" value="menu_jq_gnavi_pldwn_gray_highlight"}>
+
+
+<{include file="../menu_script.html"}>
+
+<{/strip}>
diff --git a/html/webapp/modules/menu/templates/jq_gnavi_pldwn_gray/menu_view_main_list.html b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_gray/menu_view_main_list.html
new file mode 100644
index 0000000..1808cff
--- /dev/null
+++ b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_gray/menu_view_main_list.html
@@ -0,0 +1,108 @@
+<{strip}>
+
+
+<{* スレッド階層が1以上のときはプルダウン対応とする(2以上は横に出る。推奨は2まで) 0のときはグローバルナビに横並び。*}>
+<{if $thread_nest>=1}>
+
+<{/if}>
+
+
+
+<{foreach from=$menus item=menu}>
+
+<{if $menu.space_type == _SPACE_TYPE_PUBLIC}>
+
+ <{* ノードかどうかでクラス変更 *}>
+ <{assign var="now_page_id" value=$menu.page_id}>
+ <{assign var="next_thread_num" value=$menu.thread_num+1}>
+
+ <{if $menu.space_type == _SPACE_TYPE_PUBLIC}>
+ <{assign var="thread_num" value=$menu.thread_num-1}>
+ <{else}>
+ <{assign var="thread_num" value=$menu.thread_num}>
+ <{/if}>
+
+
+ <{if $thread_num <= 0}>
+ <{assign var="display_flag" value=$smarty.const._ON}>
+ <{/if}>
+
+
+ <{if $menu.thread_num != 0 ||
+ ($menu.space_type != _SPACE_TYPE_PUBLIC && !($menu.space_type == _SPACE_TYPE_GROUP && $menu.default_entry_flag == _ON) && !($menu.space_type == _SPACE_TYPE_GROUP && $menu.private_flag == _OFF && $menu.thread_num == 0 && !isset($action.menus.$next_thread_num.$now_page_id|smarty:nodefaults)))}>
+ <{assign var="display_flag" value=$action.main_active_node_arr.$now_page_id}>
+ <{*アクティブかどうか*}>
+ <{if $action.main_page_id == $menu.page_id}>
+ <{assign var="class_name" value="nowrap $pldwn_highlight_class_name _menu_active"}>
+ <{elseif $display_flag == $smarty.const._ON }>
+ <{assign var="class_name" value="nowrap $pldwn_highlight_class_name "}>
+ <{else}>
+ <{assign var="class_name" value="nowrap"}>
+ <{/if}>
+ <{* スペースタイプでクラス変更 *}>
+ <{if $menu.space_type == _SPACE_TYPE_PUBLIC}>
+ <{assign var="top_class_name" value=""}>
+ <{assign var="space_type_class_name" value=""}>
+ <{elseif $menu.space_type == _SPACE_TYPE_GROUP}>
+ <{assign var="top_class_name" value=""}>
+ <{assign var="space_type_class_name" value=""}>
+ <{/if}>
+ <{*プライベートかいなか*}>
+ <{if $menu.private_flag}>
+ <{assign var="top_class_name" value=""}>
+ <{assign var="space_type_class_name" value=""}>
+ <{/if}>
+ <{*ノードで下にページ(ノード)がない場合、表示しない*}>
+ <{*if $menu.page_name != "" && ($menu.action_name!="" || $action.menus.$next_thread_num.$now_page_id)*}>
+ <{if $menu.action_name!="" && $menu.page_name != "" && $menu.visibility_flag == _ON && !($menu.page_id == $menu.room_id && $menu.display_flag == _OFF && $menu.authority_id < _AUTH_CHIEF)}>
+
+
+ <{if $action.menus.$next_thread_num.$now_page_id
+ &&
+ !($menu.page_id == $menu.room_id && $menu.display_flag == _OFF && $menu.authority_id < _AUTH_CHIEF)}>
+
+ <{assign var="menus" value=$action.menus.$next_thread_num.$now_page_id}>
+ <{assign var="old_thread_nest" value=$thread_nest}>
+ <{if $menu.private_flag == $smarty.const._ON}>
+ <{assign var="thread_nest" value=$menu.thread_num+1}>
+ <{else}>
+ <{assign var="thread_nest" value=$menu.thread_num}>
+ <{/if}>
+ <{include file="menu_view_main_list.html"}>
+ <{assign var="thread_nest" value=$old_thread_nest}>
+ <{/if}>
+
+ <{/if}>
+ <{/if}>
+
+
+
+ <{if ($menu.space_type==_SPACE_TYPE_PUBLIC && $menu.thread_num == 0) ||
+ ($menu.space_type == _SPACE_TYPE_GROUP && $menu.private_flag == _ON && $menu.thread_num==0) ||
+ ($menu.space_type == _SPACE_TYPE_GROUP && $menu.private_flag == _OFF && $menu.thread_num==0)}>
+ <{if $action.menus.$next_thread_num.$now_page_id && !($menu.page_id == $menu.room_id && $menu.display_flag == _OFF && $menu.authority_id < _AUTH_CHIEF)}>
+ <{assign var="menus" value=$action.menus.$next_thread_num.$now_page_id}>
+ <{assign var="old_thread_nest" value=$thread_nest}>
+ <{if $menu.private_flag == $smarty.const._ON}>
+ <{assign var="thread_nest" value=$menu.thread_num+1}>
+ <{else}>
+ <{assign var="thread_nest" value=$menu.thread_num}>
+ <{/if}>
+ <{include file="menu_view_main_list.html"}>
+ <{assign var="thread_nest" value=$old_thread_nest}>
+ <{/if}>
+ <{/if}>
+
+
+<{/if}>
+
+<{/foreach}>
+
+<{if $thread_nest>=1}>
+
+<{/if}>
+<{/strip}>
diff --git a/html/webapp/modules/menu/templates/jq_gnavi_pldwn_green/menu_view_main_detail.html b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_green/menu_view_main_detail.html
new file mode 100644
index 0000000..1754c73
--- /dev/null
+++ b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_green/menu_view_main_detail.html
@@ -0,0 +1,11 @@
+<{strip}>
+<{assign var="now_thread_num" value=$action.thread_num}>
+<{assign var="now_parent_id" value=$action.parent_id}>
+<{assign var="menus" value=$action.menus.$now_thread_num.$now_parent_id}>
+
+<{assign var="pldwn_sub_class_name" value="menu_jq_gnavi_pldwn_green_sub"}>
+<{assign var="pldwn_btn_class_name" value="menu_jq_gnavi_pldwn_green_btn"}>
+<{assign var="pldwn_highlight_class_name" value="menu_jq_gnavi_pldwn_green_highlight"}>
+
+<{include file="menu_view_main_list.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
new file mode 100644
index 0000000..91e4476
--- /dev/null
+++ b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_green/menu_view_main_init.html
@@ -0,0 +1,50 @@
+<{strip}>
+<{assign var="menus" value=$action.menus.0.0}>
+<{assign var="thread_nest" value=0}>
+
+<{assign var="pldwn_sub_class_name" value="menu_jq_gnavi_pldwn_green_sub"}>
+<{assign var="pldwn_btn_class_name" value="menu_jq_gnavi_pldwn_green_btn"}>
+<{assign var="pldwn_highlight_class_name" value="menu_jq_gnavi_pldwn_green_highlight"}>
+
+
+<{include file="../menu_script.html"}>
+
+<{/strip}>
diff --git a/html/webapp/modules/menu/templates/jq_gnavi_pldwn_green/menu_view_main_list.html b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_green/menu_view_main_list.html
new file mode 100644
index 0000000..159fd9d
--- /dev/null
+++ b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_green/menu_view_main_list.html
@@ -0,0 +1,3 @@
+<{strip}>
+ <{include file="../jq_gnavi_pldwn_gray/menu_view_main_list.html"}>
+<{/strip}>
diff --git a/html/webapp/modules/menu/templates/jq_gnavi_pldwn_orange/menu_view_main_detail.html b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_orange/menu_view_main_detail.html
new file mode 100644
index 0000000..9d9c728
--- /dev/null
+++ b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_orange/menu_view_main_detail.html
@@ -0,0 +1,11 @@
+<{strip}>
+<{assign var="now_thread_num" value=$action.thread_num}>
+<{assign var="now_parent_id" value=$action.parent_id}>
+<{assign var="menus" value=$action.menus.$now_thread_num.$now_parent_id}>
+
+<{assign var="pldwn_sub_class_name" value="menu_jq_gnavi_pldwn_orange_sub"}>
+<{assign var="pldwn_btn_class_name" value="menu_jq_gnavi_pldwn_orange_btn"}>
+<{assign var="pldwn_highlight_class_name" value="menu_jq_gnavi_pldwn_orange_highlight"}>
+
+<{include file="menu_view_main_list.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
new file mode 100644
index 0000000..f8522ef
--- /dev/null
+++ b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_orange/menu_view_main_init.html
@@ -0,0 +1,50 @@
+<{strip}>
+<{assign var="menus" value=$action.menus.0.0}>
+<{assign var="thread_nest" value=0}>
+
+<{assign var="pldwn_sub_class_name" value="menu_jq_gnavi_pldwn_orange_sub"}>
+<{assign var="pldwn_btn_class_name" value="menu_jq_gnavi_pldwn_orange_btn"}>
+<{assign var="pldwn_highlight_class_name" value="menu_jq_gnavi_pldwn_orange_highlight"}>
+
+
+<{include file="../menu_script.html"}>
+
+<{/strip}>
diff --git a/html/webapp/modules/menu/templates/jq_gnavi_pldwn_orange/menu_view_main_list.html b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_orange/menu_view_main_list.html
new file mode 100644
index 0000000..159fd9d
--- /dev/null
+++ b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_orange/menu_view_main_list.html
@@ -0,0 +1,3 @@
+<{strip}>
+ <{include file="../jq_gnavi_pldwn_gray/menu_view_main_list.html"}>
+<{/strip}>
diff --git a/html/webapp/modules/menu/templates/jq_gnavi_pldwn_red/menu_view_main_detail.html b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_red/menu_view_main_detail.html
new file mode 100644
index 0000000..4812c68
--- /dev/null
+++ b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_red/menu_view_main_detail.html
@@ -0,0 +1,11 @@
+<{strip}>
+<{assign var="now_thread_num" value=$action.thread_num}>
+<{assign var="now_parent_id" value=$action.parent_id}>
+<{assign var="menus" value=$action.menus.$now_thread_num.$now_parent_id}>
+
+<{assign var="pldwn_sub_class_name" value="menu_jq_gnavi_pldwn_red_sub"}>
+<{assign var="pldwn_btn_class_name" value="menu_jq_gnavi_pldwn_red_btn"}>
+<{assign var="pldwn_highlight_class_name" value="menu_jq_gnavi_pldwn_red_highlight"}>
+
+<{include file="menu_view_main_list.html"}>
+<{/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
new file mode 100644
index 0000000..5659bc1
--- /dev/null
+++ b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_red/menu_view_main_init.html
@@ -0,0 +1,50 @@
+<{strip}>
+<{assign var="menus" value=$action.menus.0.0}>
+<{assign var="thread_nest" value=0}>
+
+<{assign var="pldwn_sub_class_name" value="menu_jq_gnavi_pldwn_red_sub"}>
+<{assign var="pldwn_btn_class_name" value="menu_jq_gnavi_pldwn_red_btn"}>
+<{assign var="pldwn_highlight_class_name" value="menu_jq_gnavi_pldwn_red_highlight"}>
+
+
+<{include file="../menu_script.html"}>
+
+<{/strip}>
diff --git a/html/webapp/modules/menu/templates/jq_gnavi_pldwn_red/menu_view_main_list.html b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_red/menu_view_main_list.html
new file mode 100644
index 0000000..159fd9d
--- /dev/null
+++ b/html/webapp/modules/menu/templates/jq_gnavi_pldwn_red/menu_view_main_list.html
@@ -0,0 +1,3 @@
+<{strip}>
+ <{include file="../jq_gnavi_pldwn_gray/menu_view_main_list.html"}>
+<{/strip}>
From 4be13ee244ba63f09905c60ec8265a1b8dcd1fd4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=97=A4=E5=8E=9F=E3=82=8A=E3=81=8B?=
Date: Fri, 14 Jun 2013 11:08:48 +0900
Subject: [PATCH 43/61] =?UTF-8?q?=E3=82=A2=E3=83=B3=E3=82=B1=E3=83=BC?=
=?UTF-8?q?=E3=83=88=E3=83=A2=E3=82=B8=E3=83=A5=E3=83=BC=E3=83=AB=E3=81=AB?=
=?UTF-8?q?=E3=82=AD=E3=83=BC=E3=83=95=E3=83=AC=E3=83=BC=E3=82=BA=E6=A9=9F?=
=?UTF-8?q?=E8=83=BD=E3=80=81=E3=81=8A=E3=82=88=E3=81=B3=E5=9B=9E=E7=AD=94?=
=?UTF-8?q?=E7=B5=90=E6=9E=9C=E3=82=92=E8=A6=8B=E3=81=9B=E3=81=AA=E3=81=84?=
=?UTF-8?q?=E3=82=AA=E3=83=97=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=92=E8=BF=BD?=
=?UTF-8?q?=E5=8A=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
パブリックに置いているアンケートでも、キーフレーズを入力しないと回答できない機能を追加(会員登録時のキーフレーズに類似したもの)
同一IDを使いまわしている環境に対応するため、「回答結果を見せない」オプションを選択できる機能を追加
---
.../action/edit/questionnaire/entry/maple.ini | 2 +
.../action/main/answer/maple.ini | 1 +
.../action/main/confirm/maple.ini | 1 +
.../questionnaire/action/main/start/maple.ini | 1 +
.../questionnaire/components/Action.class.php | 3 +
.../questionnaire/components/View.class.php | 12 ++--
.../files/js/default/questionnaire.js | 26 +++++++++
.../questionnaire/language/chinese/main.ini | 9 +++
.../questionnaire/language/english/main.ini | 9 +++
.../questionnaire/language/japanese/main.ini | 9 +++
.../modules/questionnaire/sql/mysql/table.sql | 3 +
.../default/questionnaire_mobile_head.html | 8 ++-
.../default/questionnaire_mobile_keypass.html | 9 +++
.../questionnaire_mobile_question_form.html | 2 +
.../default/questionnaire_mobile_start.html | 3 +
...onnaire_view_edit_questionnaire_entry.html | 38 ++++++++++++
.../default/questionnaire_view_main_head.html | 6 ++
.../questionnaire_view_main_keypass.html | 12 ++++
...questionnaire_view_main_question_form.html | 2 +
.../questionnaire_view_main_start.html | 1 +
.../questionnaire/update/Update.class.php | 21 +++++++
.../validator/Validator_Keypass.class.php | 53 +++++++++++++++++
.../Validator_KeypassCheck.class.php | 58 +++++++++++++++++++
.../view/main/answer/Answer.class.php | 4 ++
.../view/main/init/Init.class.php | 10 ++++
.../view/main/summary/Summary.class.php | 4 ++
.../questionnaire/view/main/summary/maple.ini | 3 +-
27 files changed, 303 insertions(+), 7 deletions(-)
create mode 100644 html/webapp/modules/questionnaire/templates/default/questionnaire_mobile_keypass.html
create mode 100644 html/webapp/modules/questionnaire/templates/default/questionnaire_view_main_keypass.html
create mode 100644 html/webapp/modules/questionnaire/validator/Validator_Keypass.class.php
create mode 100644 html/webapp/modules/questionnaire/validator/Validator_KeypassCheck.class.php
diff --git a/html/webapp/modules/questionnaire/action/edit/questionnaire/entry/maple.ini b/html/webapp/modules/questionnaire/action/edit/questionnaire/entry/maple.ini
index 566e4cf..4b3793d 100644
--- a/html/webapp/modules/questionnaire/action/edit/questionnaire/entry/maple.ini
+++ b/html/webapp/modules/questionnaire/action/edit/questionnaire/entry/maple.ini
@@ -8,6 +8,8 @@ questionnaire_name.required = "1:lang._required,lang.questionnaire_questionnaire
questionnaire_name.maxlength = "1,_VALIDATOR_TITLE_LEN:lang._maxlength_error,lang.questionnaire_questionnaire_name,_VALIDATOR_TITLE_LEN"
period.date:period = "1:lang._invalid_date,lang.questionnaire_period_text"
key:period_checkbox,period.questionnaire.period:period = "1:lang.questionnaire_period_invalid"
+keypass_phrase.maxlength = "1,_VALIDATOR_TITLE_LEN:lang._maxlength_error,lang.questionnaire_keypass,_VALIDATOR_TITLE_LEN"
+key:keypass_use_flag,keypass_phrase.questionnaire.Keypass = "1:lang.questionnaire_keypass_invalid"
[View]
create = "action:questionnaire_view_edit_question_list"
diff --git a/html/webapp/modules/questionnaire/action/main/answer/maple.ini b/html/webapp/modules/questionnaire/action/main/answer/maple.ini
index 4fde564..3091e2e 100644
--- a/html/webapp/modules/questionnaire/action/main/answer/maple.ini
+++ b/html/webapp/modules/questionnaire/action/main/answer/maple.ini
@@ -8,6 +8,7 @@ image_authentication,id.imageauth:g="1:lang._invalid_image_auth_input"
key:questionnaire.questionnaire.answer:g = "1:lang._invalid_input"
key:block_id,questionnaire,question_id,answer_value,choice_id.questionnaire.answerRequired:g = "1:lang.questionnaire_answer_required"
key:block_id,questionnaire.questionnaire.summaryExists:g = "1:lang._invalid_input"
+key:questionnaire,keypass_phrase,block_id.questionnaire.keypassCheck:g = "1:lang.questionnaire_keypass_invalid_input"
[View]
define:theme = 1
diff --git a/html/webapp/modules/questionnaire/action/main/confirm/maple.ini b/html/webapp/modules/questionnaire/action/main/confirm/maple.ini
index fac00a8..a07068b 100644
--- a/html/webapp/modules/questionnaire/action/main/confirm/maple.ini
+++ b/html/webapp/modules/questionnaire/action/main/confirm/maple.ini
@@ -4,6 +4,7 @@ action = "questionnaire_view_main_question"
[ValidateDef]
key:room_id,block_id,questionnaire_id.questionnaire.questionnaireExists:g = "1:lang._invalid_input"
key:block_id,questionnaire_id.questionnaire.questionnaireView:g = "1:lang._invalid_input"
+key:questionnaire,keypass_phrase,block_id.questionnaire.keypassCheck:g = "1:lang.questionnaire_keypass_invalid_input"
image_authentication,id.imageauth:g="1:lang._invalid_image_auth_input"
key:questionnaire.questionnaire.answer:g = "1:lang._invalid_input"
key:block_id,questionnaire,question_id,answer_value,choice_id.questionnaire.answerRequired:g = "1:lang.questionnaire_answer_required"
diff --git a/html/webapp/modules/questionnaire/action/main/start/maple.ini b/html/webapp/modules/questionnaire/action/main/start/maple.ini
index da1dafc..5084ec0 100644
--- a/html/webapp/modules/questionnaire/action/main/start/maple.ini
+++ b/html/webapp/modules/questionnaire/action/main/start/maple.ini
@@ -2,6 +2,7 @@
key:room_id,block_id,questionnaire_id.questionnaire.questionnaireExists:g = "1:lang._invalid_input"
key:block_id,questionnaire_id.questionnaire.questionnaireView:g = "1:lang._invalid_input"
image_authentication,id.imageauth:g="1:lang._invalid_image_auth_input"
+key:questionnaire,keypass_phrase,block_id.questionnaire.keypassCheck:g = "1:lang.questionnaire_keypass_invalid_input"
[TokenExtra]
action = "questionnaire_view_main_question"
diff --git a/html/webapp/modules/questionnaire/components/Action.class.php b/html/webapp/modules/questionnaire/components/Action.class.php
index 2fce26a..a25e976 100644
--- a/html/webapp/modules/questionnaire/components/Action.class.php
+++ b/html/webapp/modules/questionnaire/components/Action.class.php
@@ -78,7 +78,10 @@ function setQuestionnaire()
$params = array(
"image_authentication" => intval($this->_request->getParameter("image_authentication")),
+ 'keypass_use_flag' => intval($this->_request->getParameter('keypass_use_flag')),
+ 'keypass_phrase' => $this->_request->getParameter('keypass_phrase'),
"total_flag" => intval($this->_request->getParameter("total_flag")),
+ "answer_show_flag" => intval($this->_request->getParameter("answer_show_flag")),
"mail_send" => intval($this->_request->getParameter("mail_send")),
"mail_subject" => $this->_request->getParameter("mail_subject"),
"mail_body" => $this->_request->getParameter("mail_body")
diff --git a/html/webapp/modules/questionnaire/components/View.class.php b/html/webapp/modules/questionnaire/components/View.class.php
index 9bab2b0..211d2f2 100644
--- a/html/webapp/modules/questionnaire/components/View.class.php
+++ b/html/webapp/modules/questionnaire/components/View.class.php
@@ -206,8 +206,11 @@ function &getDefaultQuestionnaire()
"nonmember_flag" => constant($config["nonmember_flag"]["conf_value"]),
"image_authentication" => constant($config["image_authentication"]["conf_value"]),
"anonymity_flag" => constant($config["anonymity_flag"]["conf_value"]),
+ "keypass_use_flag" => constant($config["keypass_use_flag"]["conf_value"]),
+ "keypass_phrase" => $config["keypass_phrase"]["conf_value"],
"repeat_flag" => constant($config["repeat_flag"]["conf_value"]),
- "total_flag" => constant($config["total_flag"]["conf_value"])
+ "total_flag" => constant($config["total_flag"]["conf_value"]),
+ "answer_show_flag" => constant($config["answer_show_flag"]["conf_value"])
);
return $questionnaire;
@@ -232,7 +235,8 @@ function &getQuestionnaire()
$format = "";
if ($actionName == "questionnaire_view_edit_questionnaire_entry") {
$sql .= ", questionnaire_type, period, ".
- "nonmember_flag, image_authentication, anonymity_flag, repeat_flag, total_flag, ".
+ "nonmember_flag, image_authentication, anonymity_flag, keypass_use_flag, keypass_phrase, ".
+ "repeat_flag, total_flag, answer_show_flag, ".
"answer_count, mail_send, mail_subject, mail_body ";
$format = _INPUT_DATE_FORMAT;
@@ -249,7 +253,7 @@ function &getQuestionnaire()
} elseif ($edit) {
$sql .= ", questionnaire_type, period, ".
- "nonmember_flag, anonymity_flag, total_flag, ".
+ "nonmember_flag, anonymity_flag, total_flag, answer_show_flag, ".
"answer_count ";
}
@@ -303,7 +307,7 @@ function &getCurrentQuestionnaire()
);
$sql = "SELECT Q.questionnaire_id, Q.questionnaire_name, Q.icon_name, Q.status, Q.questionnaire_type, Q.period, ".
- "Q.nonmember_flag, Q.image_authentication, Q.anonymity_flag, Q.repeat_flag, Q.total_flag, ".
+ "Q.nonmember_flag, Q.image_authentication, Q.anonymity_flag, Q.keypass_use_flag, Q.keypass_phrase, Q.repeat_flag, Q.total_flag, Q.answer_show_flag, ".
"Q.answer_count, Q.mail_send ".
"FROM {questionnaire_block} B ".
"INNER JOIN {questionnaire} Q ".
diff --git a/html/webapp/modules/questionnaire/files/js/default/questionnaire.js b/html/webapp/modules/questionnaire/files/js/default/questionnaire.js
index 41affc3..ac5c5b8 100644
--- a/html/webapp/modules/questionnaire/files/js/default/questionnaire.js
+++ b/html/webapp/modules/questionnaire/files/js/default/questionnaire.js
@@ -164,6 +164,12 @@ clsQuestionnaire.prototype = {
element.disabled = false;
Element.removeClassName($("questionnaire_image_authentication_label" + this.id), "disable_lbl");
}
+ element = $("questionnaire_keypass_use_flag" + this.id);
+ if (element) {
+ element.disabled = false;
+ Element.removeClassName($("questionnaire_keypass_use_flag_label" + this.id), "disable_lbl");
+ this.changeKeypass(element.checked);
+ }
} else {
$("questionnaire_repeat" + this.id).disabled = false;
$("questionnaire_repeat" + this.id).checked = false;
@@ -176,6 +182,26 @@ clsQuestionnaire.prototype = {
element.disabled = true;
Element.addClassName($("questionnaire_image_authentication_label" + this.id), "disable_lbl");
}
+ element = $("questionnaire_keypass_use_flag" + this.id);
+ if (element) {
+ element.checked = false;
+ element.disabled = true;
+ Element.addClassName($("questionnaire_keypass_use_flag_label" + this.id), "disable_lbl");
+ this.changeKeypass(element.checked);
+ }
+ }
+ },
+
+ changeKeypass: function(keypass) {
+ if(keypass) {
+ if ($("questionnaire_keypass_phrase" + this.id)) {
+ $("questionnaire_keypass_phrase" + this.id).disabled = false;
+ }
+ }
+ else {
+ if ($("questionnaire_keypass_phrase" + this.id)) {
+ $("questionnaire_keypass_phrase" + this.id).disabled = true;
+ }
}
},
diff --git a/html/webapp/modules/questionnaire/language/chinese/main.ini b/html/webapp/modules/questionnaire/language/chinese/main.ini
index 189b387..ab7c0ad 100644
--- a/html/webapp/modules/questionnaire/language/chinese/main.ini
+++ b/html/webapp/modules/questionnaire/language/chinese/main.ini
@@ -43,14 +43,18 @@ questionnaire_type_random = "随机"
questionnaire_period = "截止日期"
questionnaire_nonmember = "允许非成员作答"
questionnaire_image_authentication = "图片验证"
+questionnaire_keypass = "使用关键短语"
questionnaire_anonymity = "匿名回答"
questionnaire_repeat = "重复回答"
questionnaire_total = "公布统计结果"
+questionnaire_answer_show = "不要显示答题内容"
questionnaire_mail_note = "您可以使用关键字 {X-SITE_NAME},{X-ROOM}, {X-QUESTIONNAIRE_NAME}, {X-USER}, {X-TO_DATE}, {X-URL}. 每个关键字分别代表 网站名,房间名, 问卷标题,回答人, 回答日期和URL。"
[Questionnaire_Action_Edit_Questionnaire_Entry]
questionnaire_period_text = "截止日期"
questionnaire_period_invalid = "无效输入"
+questionnaire_keypass = "关键短语"
+questionnaire_keypass_invalid = "进入关键短语"
[Questionnaire_View_Edit_Question_List]
questionnaire_question_list_text = "您可以添加和编辑要回答的问题。"
@@ -103,6 +107,8 @@ questionnaire_goto_total = "统计结果"
questionnaire_goto_total_title = "显示%s的统计结果"
questionnaire_answer_start = "开始"
questionnaire_image_authentication_label = "图片验证:"
+questionnaire_keypass_label = "关键短语:"
+questionnaire_has_finished = "它是已经回答。谢谢你的帮助。"
[Questionnaire_View_Main_Single:Questionnaire_Action_Main_Answer]
questionnaire_single_question = "问题%s/%s:"
@@ -112,6 +118,9 @@ questionnaire_mobile_single_question = "[No.%s/%s问题]"
questionnaire_answer_required = "请输入回答。"
questionnaire_answer_textarea = "问答题回答的内容"
+[Questionnaire_Action_Main_Start:Questionnaire_Action_Main_Answer:Questionnaire_Action_Main_Confirm]
+questionnaire_keypass_invalid_input = "关键的一句是不正确的。"
+
[Questionnaire_Action_Main_Answer]
questionnaire_next_question = "下一个问题>>"
diff --git a/html/webapp/modules/questionnaire/language/english/main.ini b/html/webapp/modules/questionnaire/language/english/main.ini
index ba3e3c0..ac7f3ab 100644
--- a/html/webapp/modules/questionnaire/language/english/main.ini
+++ b/html/webapp/modules/questionnaire/language/english/main.ini
@@ -43,14 +43,18 @@ questionnaire_type_random = "random"
questionnaire_period = "Due date"
questionnaire_nonmember = "Answer of nonmember"
questionnaire_image_authentication = "Picture certification"
+questionnaire_keypass = "Key phrase"
questionnaire_anonymity = "It does anonymous."
questionnaire_repeat = "Repeat answer"
questionnaire_total = "Disclose the summary"
+questionnaire_answer_show = "Do not show the answer"
questionnaire_mail_note = "You may use the keywords {X-SITE_NAME}, {X-ROOM}、 {X-QUESTIONNAIRE_NAME}, {X-USER}, {X-TO_DATE}, {X-URL}. Each keyword stands for the site name, the room name the title of questionnaire, the respondent, the date and the url."
[Questionnaire_Action_Edit_Questionnaire_Entry]
questionnaire_period_text = "Due date"
questionnaire_period_invalid = "Invalid input"
+questionnaire_keypass = "Key phrase"
+questionnaire_keypass_invalid = "Please input key phrase."
[Questionnaire_View_Edit_Question_List]
questionnaire_question_list_text = "You can add and edit the questions to ask."
@@ -103,6 +107,7 @@ questionnaire_goto_total = "Summary"
questionnaire_goto_total_title = "Displaying the summary of %s"
questionnaire_answer_start = "Start"
questionnaire_image_authentication_label = "Picture certification:"
+questionnaire_keypass_label = "Key Phrase:"
[Questionnaire_View_Main_Single:Questionnaire_Action_Main_Answer]
questionnaire_single_question = "Question %s/%s:"
@@ -111,6 +116,10 @@ questionnaire_mobile_single_question = "[No. %s among/%s quesitons]"
[Questionnaire_Action_Main_Answer:Questionnaire_Action_Main_Confirm]
questionnaire_answer_required = "Please enter."
questionnaire_answer_textarea = "Content of answer of description type"
+questionnaire_keypass_invalid_input = "Key phrase does not match."
+
+[Questionnaire_Action_Main_Start:Questionnaire_Action_Main_Answer:Questionnaire_Action_Main_Confirm]
+questionnaire_keypass_invalid_input = "Invalid key phrase."
[Questionnaire_Action_Main_Answer]
questionnaire_next_question = "Next question >>"
diff --git a/html/webapp/modules/questionnaire/language/japanese/main.ini b/html/webapp/modules/questionnaire/language/japanese/main.ini
index c48c6af..b411a38 100644
--- a/html/webapp/modules/questionnaire/language/japanese/main.ini
+++ b/html/webapp/modules/questionnaire/language/japanese/main.ini
@@ -43,14 +43,18 @@ questionnaire_type_random = "ランダムに表示する"
questionnaire_period = "期限を指定する"
questionnaire_nonmember = "非会員の回答を受け付ける"
questionnaire_image_authentication = "画像認証を行う"
+questionnaire_keypass = "キーフレーズを使う"
questionnaire_anonymity = "匿名で回答させる"
questionnaire_repeat = "繰返しの回答をさせる"
questionnaire_total = "回答後に集計結果を表示する"
+questionnaire_answer_show = "回答内容を表示しない"
questionnaire_mail_note = "件名と本文には、 {X-SITE_NAME}、{X-ROOM}、 {X-QUESTIONNAIRE_NAME}、{X-USER}、 {X-TO_DATE}、{X-URL} というキーワードを使えます。 それぞれのキーワードは、 サイト名称、ルーム名称、 アンケート名称、回答者ハンドル名称、 回答日時、回答結果のURL に変換されて送信されます。"
[Questionnaire_Action_Edit_Questionnaire_Entry]
questionnaire_period_text = "期限"
questionnaire_period_invalid = "期限は未来の日付を入力してください"
+questionnaire_keypass = "キーフレーズ"
+questionnaire_keypass_invalid = "キーフレーズを入力して下さい。"
[Questionnaire_View_Edit_Question_List]
questionnaire_question_list_text = "質問の追加・編集・表示順変更ができます"
@@ -103,6 +107,8 @@ questionnaire_goto_total = "集計結果を見る"
questionnaire_goto_total_title = "%sの集計結果を表示します。"
questionnaire_answer_start = "始める"
questionnaire_image_authentication_label = "画像認証:"
+questionnaire_keypass_label = "キーフレーズ:"
+questionnaire_has_finished = "すでに回答済みです。ご協力ありがとうございました。"
[Questionnaire_View_Main_Single:Questionnaire_Action_Main_Answer]
questionnaire_single_question = "%s/%s問目:"
@@ -112,6 +118,9 @@ questionnaire_mobile_single_question = "[%s/%s問目]"
questionnaire_answer_required = "質問%sは必須項目です。"
questionnaire_answer_textarea = "記述式回答内容"
+[Questionnaire_Action_Main_Start:Questionnaire_Action_Main_Answer:Questionnaire_Action_Main_Confirm]
+questionnaire_keypass_invalid_input = "キーフレーズが間違っています。"
+
[Questionnaire_Action_Main_Answer]
questionnaire_next_question = "次の質問へ"
diff --git a/html/webapp/modules/questionnaire/sql/mysql/table.sql b/html/webapp/modules/questionnaire/sql/mysql/table.sql
index 4adc3ac..f23fdc0 100644
--- a/html/webapp/modules/questionnaire/sql/mysql/table.sql
+++ b/html/webapp/modules/questionnaire/sql/mysql/table.sql
@@ -15,8 +15,11 @@ CREATE TABLE `questionnaire` (
`nonmember_flag` tinyint(1) NOT NULL default '0',
`image_authentication` tinyint(1) NOT NULL default '0',
`anonymity_flag` tinyint(1) NOT NULL default '0',
+ `keypass_use_flag` tinyint(1) NOT NULL default '0',
+ `keypass_phrase` varchar(128) NOT NULL default '',
`repeat_flag` tinyint(1) NOT NULL default '0',
`total_flag` tinyint(1) NOT NULL default '0',
+ `answer_show_flag` tinyint(1) NOT NULL default '0',
`answer_count` int(11) NOT NULL default '0',
`mail_send` tinyint(1) NOT NULL default '0',
`mail_subject` varchar(255) NOT NULL default '',
diff --git a/html/webapp/modules/questionnaire/templates/default/questionnaire_mobile_head.html b/html/webapp/modules/questionnaire/templates/default/questionnaire_mobile_head.html
index 64ed767..1a8615b 100644
--- a/html/webapp/modules/questionnaire/templates/default/questionnaire_mobile_head.html
+++ b/html/webapp/modules/questionnaire/templates/default/questionnaire_mobile_head.html
@@ -17,9 +17,13 @@
<{if $action.answerLinkShow}>
-
+ <{if $action.questionnaire.answer_show_flag == $smarty.const._OFF}>
+
<{$lang.questionnaire_goto_answer}>
-
+
+ <{else}>
+ <{$lang.questionnaire_has_finished|smarty:nodefaults}>
+ <{/if}>
<{/if}>
diff --git a/html/webapp/modules/questionnaire/templates/default/questionnaire_mobile_keypass.html b/html/webapp/modules/questionnaire/templates/default/questionnaire_mobile_keypass.html
new file mode 100644
index 0000000..8c54103
--- /dev/null
+++ b/html/webapp/modules/questionnaire/templates/default/questionnaire_mobile_keypass.html
@@ -0,0 +1,9 @@
+<{strip}>
+<{* キーフレーズ認証項目用テンプレート *}>
+<{if $action.questionnaire.keypass_use_flag == _ON}>
+ <{$lang.questionnaire_keypass_label}>
+
+
+
+<{/if}>
+<{/strip}>
diff --git a/html/webapp/modules/questionnaire/templates/default/questionnaire_mobile_question_form.html b/html/webapp/modules/questionnaire/templates/default/questionnaire_mobile_question_form.html
index 558f08d..42a7a95 100644
--- a/html/webapp/modules/questionnaire/templates/default/questionnaire_mobile_question_form.html
+++ b/html/webapp/modules/questionnaire/templates/default/questionnaire_mobile_question_form.html
@@ -14,6 +14,8 @@
<{assign var="question" value="`$action.question`"}>
<{include file="questionnaire_mobile_question_answer.html"}>
<{else}>
+ <{include file="questionnaire_mobile_keypass.html"}>
+
<{foreach from=$action.questions item=question name="question"}>
<{include file="questionnaire_mobile_question_answer.html"}>
<{/foreach}>
diff --git a/html/webapp/modules/questionnaire/templates/default/questionnaire_mobile_start.html b/html/webapp/modules/questionnaire/templates/default/questionnaire_mobile_start.html
index acb3a0d..1c1bc7a 100644
--- a/html/webapp/modules/questionnaire/templates/default/questionnaire_mobile_start.html
+++ b/html/webapp/modules/questionnaire/templates/default/questionnaire_mobile_start.html
@@ -8,8 +8,11 @@
+
+ <{include file="questionnaire_mobile_keypass.html"}>
<{include file="questionnaire_mobile_image_authentication.html"}>
+
<{$token_form|smarty:nodefaults}>
diff --git a/html/webapp/modules/questionnaire/templates/default/questionnaire_view_edit_questionnaire_entry.html b/html/webapp/modules/questionnaire/templates/default/questionnaire_view_edit_questionnaire_entry.html
index 7f830f1..7b53993 100644
--- a/html/webapp/modules/questionnaire/templates/default/questionnaire_view_edit_questionnaire_entry.html
+++ b/html/webapp/modules/questionnaire/templates/default/questionnaire_view_edit_questionnaire_entry.html
@@ -103,6 +103,22 @@
<{/if}>
+ <{if ($smarty.session._space_type != _SPACE_TYPE_PUBLIC && ($smarty.session._main_room_page.private_flag == _OFF || $smarty.session._main_room_page.default_entry_flag == _OFF))}>
+
+ <{else}>
+
+
+
+
+
+
+ <{$lang.questionnaire_keypass}>
+
+
+
+
+ <{/if}>
+
@@ -136,6 +152,17 @@
+
+
+
+
+
+
+ <{$lang.questionnaire_answer_show}>
+
+
+
+
<{$lang.questionnaire_mail_send}>
@@ -230,13 +257,20 @@
$("questionnaire_image_authentication<{$id}>").checked = true;
<{/if}>
+ <{if $action.questionnaire.keypass_use_flag == _ON}>
+ $("questionnaire_keypass_use_flag<{$id}>").checked = true;
+ <{/if}>
+ $("questionnaire_keypass_phrase<{$id}>").value = "<{$action.questionnaire.keypass_phrase}>";
+
questionnaireCls["<{$id}>"].changeNonmember($("questionnaire_nonmember<{$id}>").checked);
+ questionnaireCls["<{$id}>"].changeKeypass($("questionnaire_keypass_use_flag<{$id}>").checked);
<{/if}>
<{if $action.questionnaire.anonymity_flag == _ON}>
$("questionnaire_anonymity<{$id}>").checked = true;
<{/if}>
+
<{if $action.questionnaire.repeat_flag == _ON}>
$("questionnaire_repeat<{$id}>").checked = true;
<{/if}>
@@ -245,6 +279,10 @@
$("questionnaire_total<{$id}>").checked = true;
<{/if}>
+ <{if $action.questionnaire.answer_show_flag == _ON}>
+ $("questionnaire_answer_show<{$id}>").checked = true;
+ <{/if}>
+
<{if $action.questionnaire.mail_send == _ON && $action.questionnaire.anonymity_flag != _ON}>
$("questionnaire_mail_send_on<{$id}>").checked = true;
questionnaireCls["<{$id}>"].changeMailSend(true);
diff --git a/html/webapp/modules/questionnaire/templates/default/questionnaire_view_main_head.html b/html/webapp/modules/questionnaire/templates/default/questionnaire_view_main_head.html
index eb0af86..fbfec41 100644
--- a/html/webapp/modules/questionnaire/templates/default/questionnaire_view_main_head.html
+++ b/html/webapp/modules/questionnaire/templates/default/questionnaire_view_main_head.html
@@ -15,9 +15,15 @@
<{/if}>
<{if $action.answerLinkShow}>
+ <{if $action.questionnaire.answer_show_flag==$smarty.const._OFF}>
<{$lang.questionnaire_goto_answer}>
+ <{else}>
+
+ <{$lang.questionnaire_has_finished|smarty:nodefaults}>
+
+ <{/if}>
<{/if}>
<{if $action.totalLinkShow}>
diff --git a/html/webapp/modules/questionnaire/templates/default/questionnaire_view_main_keypass.html b/html/webapp/modules/questionnaire/templates/default/questionnaire_view_main_keypass.html
new file mode 100644
index 0000000..b44c3fc
--- /dev/null
+++ b/html/webapp/modules/questionnaire/templates/default/questionnaire_view_main_keypass.html
@@ -0,0 +1,12 @@
+<{strip}>
+<{* キーパス項目用テンプレート *}>
+<{if $action.questionnaire.keypass_use_flag == _ON}>
+
+
+ <{$lang.questionnaire_keypass_label}>
+
+
+
+
+<{/if}>
+<{/strip}>
diff --git a/html/webapp/modules/questionnaire/templates/default/questionnaire_view_main_question_form.html b/html/webapp/modules/questionnaire/templates/default/questionnaire_view_main_question_form.html
index a2b7206..46cb3b4 100644
--- a/html/webapp/modules/questionnaire/templates/default/questionnaire_view_main_question_form.html
+++ b/html/webapp/modules/questionnaire/templates/default/questionnaire_view_main_question_form.html
@@ -17,6 +17,8 @@
<{assign var="question" value="`$action.question`"}>
<{include file="questionnaire_view_main_question_answer.html"}>
<{else}>
+ <{include file="questionnaire_view_main_keypass.html"}>
+
<{foreach from=$action.questions item=question name="question"}>
<{include file="questionnaire_view_main_question_answer.html"}>
<{/foreach}>
diff --git a/html/webapp/modules/questionnaire/templates/default/questionnaire_view_main_start.html b/html/webapp/modules/questionnaire/templates/default/questionnaire_view_main_start.html
index fb89bb4..b984869 100644
--- a/html/webapp/modules/questionnaire/templates/default/questionnaire_view_main_start.html
+++ b/html/webapp/modules/questionnaire/templates/default/questionnaire_view_main_start.html
@@ -8,6 +8,7 @@
+ <{include file="questionnaire_view_main_keypass.html"}>
<{include file="questionnaire_view_main_image_authentication.html"}>
diff --git a/html/webapp/modules/questionnaire/update/Update.class.php b/html/webapp/modules/questionnaire/update/Update.class.php
index 586ddb4..0c561bd 100644
--- a/html/webapp/modules/questionnaire/update/Update.class.php
+++ b/html/webapp/modules/questionnaire/update/Update.class.php
@@ -19,6 +19,27 @@ class Questionnaire_Update extends Action
function execute()
{
+ // key pass phrase 関連フィールドを追加
+ $adoConnection = $this->dbObject->getAdoDbObject();
+ $metaColumns = $adoConnection->MetaColumns($this->dbObject->getPrefix() . 'questionnaire');
+ if (!isset($metaColumns['KEYPASS_USE_FLAG'])) {
+ $sql = "ALTER TABLE `" . $this->dbObject->getPrefix() . "questionnaire` "
+ . "ADD `keypass_use_flag` tinyint(1) NOT NULL default '0' AFTER `anonymity_flag`,"
+ . "ADD `keypass_phrase` varchar(128) NOT NULL default '' AFTER `keypass_use_flag`;";
+ if (!$this->dbObject->execute($sql)) {
+ return false;
+ }
+ }
+ // 「結果をみる」関連フィールドを追加
+ if (!isset($metaColumns['ANSWER_SHOW_FLAG'])) {
+ $sql = "ALTER TABLE `" . $this->dbObject->getPrefix() . "questionnaire` "
+ . "ADD `answer_show_flag` tinyint(1) NOT NULL default '0' AFTER `total_flag`;";
+ if (!$this->dbObject->execute($sql)) {
+ return false;
+ }
+ }
+
+
// questionnaireにindexを追加
$sql = "SHOW INDEX FROM `".$this->dbObject->getPrefix()."questionnaire` ;";
diff --git a/html/webapp/modules/questionnaire/validator/Validator_Keypass.class.php b/html/webapp/modules/questionnaire/validator/Validator_Keypass.class.php
new file mode 100644
index 0000000..4dadbad
--- /dev/null
+++ b/html/webapp/modules/questionnaire/validator/Validator_Keypass.class.php
@@ -0,0 +1,53 @@
+getComponent('Request');
+
+ // 使用しない
+ if (empty($attributes['keypass_use_flag'])) {
+ // 空にしてノーチェック
+ $request->setParameter('keypass_phrase', '');
+ return;
+ }
+
+ if (!isset($attributes['keypass_phrase'])) {
+ return $errStr;
+ }
+ if (is_null($attributes['keypass_phrase'])) {
+ return $errStr;
+ }
+ if ($attributes['keypass_phrase']=='') {
+ return $errStr;
+ }
+
+ return;
+ }
+}
+?>
diff --git a/html/webapp/modules/questionnaire/validator/Validator_KeypassCheck.class.php b/html/webapp/modules/questionnaire/validator/Validator_KeypassCheck.class.php
new file mode 100644
index 0000000..0570512
--- /dev/null
+++ b/html/webapp/modules/questionnaire/validator/Validator_KeypassCheck.class.php
@@ -0,0 +1,58 @@
+getComponent('Session');
+ $chk_flg = $session->getParameter('questionnaire_keypass_check_flag'. $attributes['block_id']);
+ if (empty($chk_flg)) { // たってない
+ return;
+ }
+
+
+ // 使う設定ならば
+ // 入力されてる?
+ if (empty($attributes['keypass_phrase'])) {
+ return $errStr;
+ }
+
+ // 入力されてるなら
+ // 一致してる?
+ if ($attributes['questionnaire']['keypass_phrase'] != $attributes['keypass_phrase']) {
+ return $errStr;
+ }
+ // チェックOKだったのでフラグ削除
+ $session->removeParameter('questionnaire_keypass_check_flag'. $attributes['block_id']);
+ return;
+ }
+}
+?>
diff --git a/html/webapp/modules/questionnaire/view/main/answer/Answer.class.php b/html/webapp/modules/questionnaire/view/main/answer/Answer.class.php
index b463e3b..cdf5753 100644
--- a/html/webapp/modules/questionnaire/view/main/answer/Answer.class.php
+++ b/html/webapp/modules/questionnaire/view/main/answer/Answer.class.php
@@ -41,6 +41,10 @@ class Questionnaire_View_Main_Answer extends Action
*/
function execute()
{
+
+ if($this->questionnaire['answer_show_flag']==_ON && $this->session->getParameter('_auth_id')<_AUTH_CHIEF) {
+ return 'error';
+ }
$this->questions = $this->questionnaireView->getAnswer($this->summary_id);
if (empty($this->questions)) {
diff --git a/html/webapp/modules/questionnaire/view/main/init/Init.class.php b/html/webapp/modules/questionnaire/view/main/init/Init.class.php
index be14356..7ac2ea4 100644
--- a/html/webapp/modules/questionnaire/view/main/init/Init.class.php
+++ b/html/webapp/modules/questionnaire/view/main/init/Init.class.php
@@ -79,6 +79,7 @@ function execute()
if ($this->questionnaire["questionnaire_type"] != QUESTIONNAIRE_TYPE_LIST_VALUE) {
$questionIDs = $this->session->getParameter("questionnaire_question_id_array". $this->block_id);
if (empty($questionIDs)) {
+ $this->_setKeyPassFlag();
return "start";
}
@@ -103,7 +104,16 @@ function execute()
}
}
+ $this->_setKeyPassFlag();
return "list";
}
+ function _setKeyPassFlag() {
+ if ($this->questionnaire['keypass_use_flag'] == _ON) {
+ $this->session->setParameter('questionnaire_keypass_check_flag'. $this->block_id, _ON);
+ }
+ else {
+ $this->session->removeParameter('questionnaire_keypass_check_flag'. $this->block_id);
+ }
+ }
}
?>
\ No newline at end of file
diff --git a/html/webapp/modules/questionnaire/view/main/summary/Summary.class.php b/html/webapp/modules/questionnaire/view/main/summary/Summary.class.php
index 960f723..455711d 100644
--- a/html/webapp/modules/questionnaire/view/main/summary/Summary.class.php
+++ b/html/webapp/modules/questionnaire/view/main/summary/Summary.class.php
@@ -25,6 +25,7 @@ class Questionnaire_View_Main_Summary extends Action
var $configView = null;
var $request = null;
var $filterChain = null;
+ var $session = null;
// validatorから受け取るため
var $questionnaire = null;
@@ -42,6 +43,9 @@ class Questionnaire_View_Main_Summary extends Action
*/
function execute()
{
+ if($this->questionnaire['answer_show_flag']==_ON && $this->session->getParameter('_auth_id')<_AUTH_CHIEF) {
+ return 'error';
+ }
if ($this->scroll != _ON) {
$config = $this->configView->getConfigByConfname($this->module_id, "questionnaire_summary_list_row_count");
if ($config === false) {
diff --git a/html/webapp/modules/questionnaire/view/main/summary/maple.ini b/html/webapp/modules/questionnaire/view/main/summary/maple.ini
index 75c2d7a..f18c816 100644
--- a/html/webapp/modules/questionnaire/view/main/summary/maple.ini
+++ b/html/webapp/modules/questionnaire/view/main/summary/maple.ini
@@ -17,4 +17,5 @@ screen = "questionnaire_mobile_summary.html"
[Action]
configView = "ref:configView"
request = "ref:Request"
-filterChain = "ref:FilterChain"
\ No newline at end of file
+filterChain = "ref:FilterChain"
+session = "ref:Session"
\ No newline at end of file
From 59f7fb56a68f173e2a2b8ba095edff6d85a5d0de Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=97=A4=E5=8E=9F=E3=82=8A=E3=81=8B?=
Date: Fri, 14 Jun 2013 20:08:47 +0900
Subject: [PATCH 44/61] =?UTF-8?q?=E6=96=BD=E8=A8=AD=E4=BA=88=E7=B4=84?=
=?UTF-8?q?=E3=81=AB=E3=80=8C=E6=99=82=E9=96=93=E6=9E=A0=E3=80=8D=E3=81=A7?=
=?UTF-8?q?=E3=81=AE=E7=99=BB=E9=8C=B2=E6=A9=9F=E8=83=BD=E3=82=92=E8=BF=BD?=
=?UTF-8?q?=E5=8A=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
時間枠設定が行えるよう
予約登録時、時間枠での指定が可能なよう
表示する表に時間枠エリアを設ける
---
.../edit/timeframe/delete/Delete.class.php | 34 ++++
.../action/edit/timeframe/delete/maple.ini | 16 ++
.../edit/timeframe/entry/Entry.class.php | 34 ++++
.../action/edit/timeframe/entry/maple.ini | 21 ++
.../reservation/components/Action.class.php | 63 ++++++
.../reservation/components/View.class.php | 183 ++++++++++++++++++
.../reservation/files/css/default/style.css | 72 +++++++
.../files/js/default/reservation.js | 96 ++++++++-
html/webapp/modules/reservation/install.ini | 2 +
.../reservation/language/chinese/main.ini | 34 ++++
.../reservation/language/english/main.ini | 34 ++++
.../reservation/language/japanese/main.ini | 33 ++++
.../modules/reservation/sql/mysql/table.sql | 25 +++
.../default/reservation_main_addreserve.html | 28 ++-
...ervation_reserve_details_reserve_time.html | 13 ++
...servation_reserve_regist_reserve_time.html | 35 +++-
.../reservation_style_timeframe_type.html | 15 ++
.../reservation_view_edit_style_init.html | 4 +
.../reservation_view_edit_timeframe.html | 47 +++++
...reservation_view_edit_timeframe_entry.html | 115 +++++++++++
.../reservation_view_main_init_location.html | 24 ++-
.../reservation_view_main_init_weekly.html | 41 +++-
.../reservation_view_main_reserve_regist.html | 8 +-
.../reservation/update/Update.class.php | 33 ++++
.../Validator_TimeframeAdjustment.class.php | 76 ++++++++
.../Validator_TimeframeListView.class.php | 51 +++++
.../Validator_TimeframeTimetable.class.php | 57 ++++++
.../Validator_TimeframeView.class.php | 55 ++++++
.../modules/reservation/view/edit/maple.ini | 1 +
.../view/edit/style/init/Init.class.php | 1 +
.../view/edit/style/init/maple.ini | 4 +
.../view/edit/timeframe/Timeframe.class.php | 36 ++++
.../view/edit/timeframe/entry/Entry.class.php | 51 +++++
.../view/edit/timeframe/entry/maple.ini | 10 +
.../reservation/view/edit/timeframe/maple.ini | 17 ++
.../reservation/view/main/init/Init.class.php | 5 +-
.../reservation/view/main/init/maple.ini | 4 +
.../view/main/reserve/add/Add.class.php | 5 +
.../view/main/reserve/add/maple.ini | 3 +
.../main/reserve/details/Details.class.php | 3 +
.../view/main/reserve/details/maple.ini | 2 +
.../view/main/reserve/modify/Modify.class.php | 5 +
.../view/main/reserve/modify/maple.ini | 3 +
43 files changed, 1371 insertions(+), 28 deletions(-)
create mode 100644 html/webapp/modules/reservation/action/edit/timeframe/delete/Delete.class.php
create mode 100644 html/webapp/modules/reservation/action/edit/timeframe/delete/maple.ini
create mode 100644 html/webapp/modules/reservation/action/edit/timeframe/entry/Entry.class.php
create mode 100644 html/webapp/modules/reservation/action/edit/timeframe/entry/maple.ini
create mode 100644 html/webapp/modules/reservation/templates/default/reservation_style_timeframe_type.html
create mode 100644 html/webapp/modules/reservation/templates/default/reservation_view_edit_timeframe.html
create mode 100644 html/webapp/modules/reservation/templates/default/reservation_view_edit_timeframe_entry.html
create mode 100644 html/webapp/modules/reservation/validator/Validator_TimeframeAdjustment.class.php
create mode 100644 html/webapp/modules/reservation/validator/Validator_TimeframeListView.class.php
create mode 100644 html/webapp/modules/reservation/validator/Validator_TimeframeTimetable.class.php
create mode 100644 html/webapp/modules/reservation/validator/Validator_TimeframeView.class.php
create mode 100644 html/webapp/modules/reservation/view/edit/timeframe/Timeframe.class.php
create mode 100644 html/webapp/modules/reservation/view/edit/timeframe/entry/Entry.class.php
create mode 100644 html/webapp/modules/reservation/view/edit/timeframe/entry/maple.ini
create mode 100644 html/webapp/modules/reservation/view/edit/timeframe/maple.ini
diff --git a/html/webapp/modules/reservation/action/edit/timeframe/delete/Delete.class.php b/html/webapp/modules/reservation/action/edit/timeframe/delete/Delete.class.php
new file mode 100644
index 0000000..c53f4cd
--- /dev/null
+++ b/html/webapp/modules/reservation/action/edit/timeframe/delete/Delete.class.php
@@ -0,0 +1,34 @@
+reservationAction->deleteTimeframe();
+ if (!$result) {
+ return 'error';
+ }
+ return 'success';
+ }
+}
+?>
\ No newline at end of file
diff --git a/html/webapp/modules/reservation/action/edit/timeframe/delete/maple.ini b/html/webapp/modules/reservation/action/edit/timeframe/delete/maple.ini
new file mode 100644
index 0000000..271c6f2
--- /dev/null
+++ b/html/webapp/modules/reservation/action/edit/timeframe/delete/maple.ini
@@ -0,0 +1,16 @@
+[TokenExtra]
+mode = "check"
+action = "reservation_view_edit_timeframe"
+
+[SmartyAssign::reservationAssign]
+global = timezone.ini
+
+[ValidateDef::reservationValidate]
+timeframe_id.required:g = "1:lang._invalid_input"
+key:timeframe_id.reservation.TimeframeView = "1:lang._invalid_input"
+
+[Action]
+reservationAction = "ref:reservationAction"
+
+[View]
+success = "action:reservation_view_edit_timeframe"
\ No newline at end of file
diff --git a/html/webapp/modules/reservation/action/edit/timeframe/entry/Entry.class.php b/html/webapp/modules/reservation/action/edit/timeframe/entry/Entry.class.php
new file mode 100644
index 0000000..3bd1eb3
--- /dev/null
+++ b/html/webapp/modules/reservation/action/edit/timeframe/entry/Entry.class.php
@@ -0,0 +1,34 @@
+reservationAction->setTimeframe();
+ if (!$result) {
+ return 'error';
+ }
+ return 'success';
+ }
+}
+?>
\ No newline at end of file
diff --git a/html/webapp/modules/reservation/action/edit/timeframe/entry/maple.ini b/html/webapp/modules/reservation/action/edit/timeframe/entry/maple.ini
new file mode 100644
index 0000000..391d57a
--- /dev/null
+++ b/html/webapp/modules/reservation/action/edit/timeframe/entry/maple.ini
@@ -0,0 +1,21 @@
+[TokenExtra]
+mode = "check"
+action = "reservation_view_edit_timeframe_entry"
+
+[SmartyAssign::reservationAssign]
+global = timezone.ini
+
+[ValidateDef::reservationValidate]
+key:timeframe_id.reservation.TimeframeView = "1:lang._invalid_input"
+timeframe_name.required:g = "1:lang._required,lang.reservation_timeframe_name_label"
+key:timezone_offset.reservation.timezoneOffset:g = "1:lang._invalid_input"
+key:start_hour,start_minute,end_hour,end_minute,allday_flag,timezone_offset,rrule_byday.reservation.locationTimetable:g = "1:lang._invalid_input"
+key:timeframe_id.reservation.timeframeTimetable:g = "1:lang.reservation_timeframe_timetable_duplicated"
+timeframe_name.maxlength = "1,_VALIDATOR_TITLE_LEN:lang._maxlength_error,lang.reservation_timeframe_name_label,_VALIDATOR_TITLE_LEN"
+timeframe_color.match = "1,(^$|^#[0-9a-fA-F]{6}$):lang.reservation_err_match_color,lang.reservation_timeframe_color_label"
+
+[Action]
+reservationAction = "ref:reservationAction"
+
+[View]
+success = "main:true.html"
\ No newline at end of file
diff --git a/html/webapp/modules/reservation/components/Action.class.php b/html/webapp/modules/reservation/components/Action.class.php
index c083842..6bc145d 100644
--- a/html/webapp/modules/reservation/components/Action.class.php
+++ b/html/webapp/modules/reservation/components/Action.class.php
@@ -278,6 +278,7 @@ function setBlock()
$params = array(
"block_id" => $this->_request->getParameter("block_id"),
"display_type" => $default["display_type"],
+ 'display_timeframe'=> $default['display_timeframe'],
"display_start_time" => $default["display_start_time"],
"display_interval" => $default["display_interval"],
"category_id" => $default["category_id"],
@@ -290,6 +291,7 @@ function setBlock()
} elseif ($actionName == "reservation_action_edit_style") {
$params = array(
"display_type" => intval($this->_request->getParameter("display_type")),
+ 'display_timeframe' => intval($this->_request->getParameter('display_timeframe')),
"display_start_time" => $this->_request->getParameter("display_start_time"),
"display_interval" => intval($this->_request->getParameter("display_interval")),
"category_id" => $this->_request->getParameter("category_id"),
@@ -738,6 +740,67 @@ function setLocationSequence()
return true;
}
+ /**
+ * 時間枠を登録する
+ *
+ * @access public
+ */
+ function setTimeframe()
+ {
+ $timeframe_id = $this->_request->getParameter('timeframe_id');
+ $timezone_offset = $this->_request->getParameter('timezone_offset');
+ $start_time = $this->_request->getParameter('start_time');
+ $end_time = $this->_request->getParameter('end_time');
+
+ $commonMain =& $this->_container->getComponent("commonMain");
+ $timezoneMain =& $commonMain->registerClass(WEBAPP_DIR.'/components/timezone/Main.class.php', "Timezone_Main", "timezoneMain");
+
+ //$timezone_offset_float = $timezoneMain->getFloatTimeZone($timezone_offset);
+ $start_time = $this->_reservationView->dateFormat($start_time, $timezone_offset, true, 'His');
+ $end_time = $this->_reservationView->dateFormat($end_time, $timezone_offset, true, 'His');
+
+ $params = array(
+ 'timeframe_name' => $this->_request->getParameter('timeframe_name'),
+ 'start_time' => $start_time,
+ 'end_time' => $end_time,
+ 'timezone_offset' => $timezone_offset,
+ 'timeframe_color' => $this->_request->getParameter('timeframe_color')
+ );
+
+ // 新規登録
+ if(empty($timeframe_id)) {
+ $timeframe_id = $this->_db->insertExecute('reservation_timeframe', $params, true, 'timeframe_id');
+ if ($timeframe_id === false) {
+ return false;
+ }
+ }
+ // 再編集
+ else {
+ $where_param = array('timeframe_id'=>$timeframe_id);
+ $ret = $this->_db->updateExecute('reservation_timeframe', $params, $where_param);
+ if ($ret === false) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * 時間枠を削除する
+ *
+ * @access public
+ */
+ function deleteTimeframe()
+ {
+ $timeframe_id = $this->_request->getParameter('timeframe_id');
+ $where_param = array('timeframe_id'=>$timeframe_id);
+ $ret = $this->_db->deleteExecute('reservation_timeframe', $where_param);
+ if ($ret === false) {
+ return false;
+ }
+ return true;
+ }
+
/**
* 予約を登録する
*
diff --git a/html/webapp/modules/reservation/components/View.class.php b/html/webapp/modules/reservation/components/View.class.php
index 4488790..bbadea8 100644
--- a/html/webapp/modules/reservation/components/View.class.php
+++ b/html/webapp/modules/reservation/components/View.class.php
@@ -167,6 +167,7 @@ function dateFormat($time=null, $timezone_offset=null, $insert_flag=false, $time
}
if (isset($timezone_offset)) {
$timezone_minute_offset = 0;
+ $timezone_offset = floatval($timezone_offset);
if(round($timezone_offset) != intval($timezone_offset)) {
$timezone_offset = ($timezone_offset> 0) ? floor($timezone_offset) : ceil($timezone_offset);
$timezone_minute_offset = ($timezone_offset> 0) ? 30 : -30; // 0.5minute
@@ -417,6 +418,7 @@ function getDefaultBlock()
$default = array(
"block_id" => 0,
"display_type" => $display_type,
+ 'display_timeframe'=>_OFF,
"display_start_time" => $display_start_time,
"start_time_hour" => $config['start_time_hour']["conf_value"],
"display_interval" => $display_interval,
@@ -784,6 +786,187 @@ function getCountLocation($location_id = null)
}
}
+ /**
+ * 時間枠取得
+ *
+ * @access public
+ */
+ function getTimeframes($divided_flag=false)
+ {
+ $func_params = array($divided_flag);
+
+ $result = $this->_db->selectExecute('reservation_timeframe', null, null, 0, 0, array($this, '_getTimeframesCallback'), $func_params);
+
+ if ($result === false) {
+ $this->_db->addError();
+ return false;
+ }
+ return $result;
+ }
+
+ function _getTimeframesCallback($recordSet, $params = array(false))
+ {
+ $ret = array();
+
+ $divided_flag = $params[0];
+
+ $commonMain =& $this->_container->getComponent("commonMain");
+ $timezoneMain =& $commonMain->registerClass(WEBAPP_DIR.'/components/timezone/Main.class.php', "Timezone_Main", "timezoneMain");
+
+ while ($row = $recordSet->fetchRow()) {
+
+ $start_time = timezone_date($row['start_time'], false, 'His');
+ $end_time = timezone_date($row['end_time'], false, 'His');
+
+ // 日跨ぎ 分割希望時
+ if($divided_flag == true && $start_time>$end_time) {
+ $ret_row = $this->__getTimeframesCallback($timezoneMain, $row, $start_time, '240000');
+ $ret[$start_time] = $ret_row;
+ $ret_row = $this->__getTimeframesCallback($timezoneMain, $row, '000000', $end_time);
+ $ret['000000'] = $ret_row;
+ }
+ else {
+ $ret_row = $this->__getTimeframesCallback($timezoneMain, $row, $start_time, $end_time);
+ $ret[$start_time] = $ret_row;
+ }
+ }
+ ksort($ret);
+ return $ret;
+ }
+ function __getTimeframesCallback(&$timezoneMain, $row, $start_time, $end_time)
+ {
+ $ret = $row;
+
+ $ret['start_time_view'] = $start_time;
+ $ret['end_time_view'] = $end_time;
+
+ $ret['left'] = $this->TimeDiff('000000', $start_time) * RESERVATION_DEF_V_INTERVAL;
+ $ret['top'] = $this->TimeDiff('000000', $start_time) * RESERVATION_DEF_H_INTERVAL;
+
+ if($end_time == '000000') {
+ $ret['width'] = $this->TimeDiff($ret['start_time_view'], '240000') * RESERVATION_DEF_V_INTERVAL;
+ $ret['height'] = $this->TimeDiff($ret['start_time_view'], '240000') * RESERVATION_DEF_H_INTERVAL;
+ }
+ else {
+ $ret['width'] = $this->TimeDiff($ret['start_time_view'], $ret['end_time_view']) * RESERVATION_DEF_V_INTERVAL;
+ $ret['height'] = $this->TimeDiff($ret['start_time_view'], $ret['end_time_view']) * RESERVATION_DEF_H_INTERVAL;
+ }
+
+ $ret['start_time_view_hour'] = substr($ret['start_time_view'], 0, 2);
+ $ret['start_time_view_min'] = substr($ret['start_time_view'], 2, 2);
+ $ret['end_time_view_hour'] = substr($ret['end_time_view'], 0, 2);
+ $ret['end_time_view_min'] = substr($ret['end_time_view'], 2, 2);
+
+
+ $ret["start_time_original_str"] = $this->dateFormat(date('Ymd').$ret["start_time"], $ret["timezone_offset"], false, _SHORT_TIME_FORMAT);
+ $ret["end_time_original_str"] = $this->dateFormat(date('Ymd').$ret["end_time"], $ret["timezone_offset"], false, _SHORT_TIME_FORMAT);
+ $ret["start_time_original"] = $this->dateFormat(date('Ymd').$ret["start_time"], $ret["timezone_offset"], false, "His");
+ $ret["end_time_original"] = $this->dateFormat(date('Ymd').$ret["end_time"], $ret["timezone_offset"], false, "His");
+
+ $ret["start_time_original_hour"] = substr($ret['start_time_original'], 0, 2);
+ $ret["start_time_original_min"] = substr($ret['start_time_original'], 2, 2);
+ $ret["end_time_original_hour"] = substr($ret['end_time_original'], 0, 2);
+ $ret["end_time_original_min"] = substr($ret['end_time_original'], 2, 2);
+
+ $ret['timezone_constant_string'] = $timezoneMain->getLangTimeZone($ret['timezone_offset'], false);
+ $ret['timezone_string'] = $timezoneMain->getLangTimeZone($ret['timezone_offset']);
+
+ return $ret;
+ }
+
+ /**
+ * 時間枠数取得
+ *
+ * @access public
+ */
+ function getTimeframesCount()
+ {
+ $result = $this->_db->countExecute('reservation_timeframe');
+ if ($result === false) {
+ $this->_db->addError();
+ return false;
+ }
+ return $result;
+ }
+
+ /**
+ * 時間枠取得
+ *
+ * @access public
+ */
+ function getTimeframe($timeframe_id)
+ {
+ $result = $this->_db->selectExecute('reservation_timeframe', array('timeframe_id'=>$timeframe_id), null, 0, 0, array($this, '_getTimeframesCallback'));
+ if ($result === false) {
+ $this->_db->addError();
+ return false;
+ }
+ $timeframe = array_shift($result);
+ return $timeframe;
+ }
+
+ /**
+ * 開始時間による時間枠取得(GMT)
+ *
+ * @access public
+ */
+ function getTimeframeByStartTime($start_time_str)
+ {
+ $result = $this->_db->selectExecute('reservation_timeframe', array('start_time'=>$start_time_str), null, 0, 0, array($this, '_getTimeframesCallback'));
+ if ($result === false) {
+ $this->_db->addError();
+ return false;
+ }
+ $timeframe = array_shift($result);
+ return $timeframe;
+ }
+
+ /**
+ * 終了時間による時間枠取得(GMT)
+ *
+ * @access public
+ */
+ function getTimeframeByEndTime($end_time_str)
+ {
+ $result = $this->_db->selectExecute('reservation_timeframe', array('end_time'=>$end_time_str), null, 0, 0, array($this, '_getTimeframesCallback'));
+ if ($result === false) {
+ $this->_db->addError();
+ return false;
+ }
+ $timeframe = array_shift($result);
+ return $timeframe;
+ }
+
+ /**
+ * 時間枠重なりチェック(GMT)
+ *
+ * @access public
+ */
+ function getTimeframeDuplicate($timeframe_id, $start_time, $end_time)
+ {
+ $sql = 'SELECT count(*) AS timeframe_count FROM {reservation_timeframe} WHERE '
+ . '( ? < start_time AND ? > start_time '
+ . ' OR '
+ . ' ? >= start_time AND CASE WHEN start_time < end_time THEN ?+240000 < end_time+240000 ELSE ? <= end_time END )';
+ if(!empty($timeframe_id)) {
+ $sql .= ' AND timeframe_id != ?';
+ }
+
+ $where_param = array($start_time, $end_time,$start_time, $start_time, $start_time);
+ if(!empty($timeframe_id)) {
+ $where_param[] = $timeframe_id;
+ }
+ $result = $this->_db->execute($sql, $where_param);
+ if($result && isset($result[0])) {
+ if($result[0]['timeframe_count']>0) {
+ return false;
+ }
+ }
+
+ //
+ return true;
+ }
+
/**
* 施設に紐付くルーム取得
*
diff --git a/html/webapp/modules/reservation/files/css/default/style.css b/html/webapp/modules/reservation/files/css/default/style.css
index 0b50aa8..862030d 100644
--- a/html/webapp/modules/reservation/files/css/default/style.css
+++ b/html/webapp/modules/reservation/files/css/default/style.css
@@ -363,6 +363,27 @@ div.reservation_monthly table.reservation_body th.reservation_weeknum {
margin-left:5px;
padding-left:5px;
}
+.reservation_weekly table.reservation_body td.reservation_timeframe_head img.reservation_blank {
+ width:50px;
+ height:1px;
+}
+.reservation_weekly div.reservation_timeframe_wrapper {
+ height:100%;
+ width:50px;
+}
+.reservation_weekly th.reservation_timeframe_wrapper {
+ border-right:1px solid #dddddd;
+ vertical-align:top;
+}
+.reservation_weekly div.reservation_timeframe_spacer {
+}
+.reservation_weekly div.reservation_timeframe_label {
+ font-size:80%;
+ text-align:center;
+ border-top:1px solid #aaaaaa;
+ border-bottom:1px solid #aaaaaa;
+ overflow:hidden;
+}
/*
* CSS of each location reservation
@@ -439,6 +460,24 @@ div.reservation_monthly table.reservation_body th.reservation_weeknum {
display:block;
margin-left:7px;
}
+.reservation_each_location div.reservation_timeframe_wrapper {
+ width:100%;
+ height:20px;
+ border-bottom:1px solid #dddddd;
+}
+.reservation_each_location div.reservation_timeframe_spacer {
+ float:left;
+ height:20px;
+}
+.reservation_each_location div.reservation_timeframe_label {
+ height:20px;
+ text-align:center;
+ border-left:1px solid #aaaaaa;
+ border-right:1px solid #aaaaaa;
+ overflow:hidden;
+ float:left;
+ font-size:80%;
+}
/* 予約のインポート */
.reservation_top_description {
@@ -457,4 +496,37 @@ div.reservation_monthly table.reservation_body th.reservation_weeknum {
}
.reservation_reserve_room_id {
width:185px;
+}
+
+.reservation_timeframe {
+ border-width:1px;
+ border-style: solid;
+ border-color: #ccc #aaa #aaa #ccc;
+ margin-bottom:1px;
+}
+.reservation_timeframe td {
+ padding:3px 5px;
+}
+.reservation_timeframe_name {
+ width:100px;
+ text-align:left;
+}
+.reservation_timeframe_time {
+ width:250px;
+ text-align:left;
+}
+.reservation_timeframe_color {
+ width:20px;
+ height:15px;
+}
+table.reservation_timeframe_entry th {
+ padding:2px 15px;
+}
+table.reservation_timeframe_entry td {
+ padding:2px 15px 2px 0px;
+}
+div.reservation_timeframe_time_original {
+ font-size:85%;
+ color:#999999;
+ width:250px;
}
\ No newline at end of file
diff --git a/html/webapp/modules/reservation/files/js/default/reservation.js b/html/webapp/modules/reservation/files/js/default/reservation.js
index 6666f2f..919eea1 100644
--- a/html/webapp/modules/reservation/files/js/default/reservation.js
+++ b/html/webapp/modules/reservation/files/js/default/reservation.js
@@ -254,7 +254,7 @@ clsReservation.prototype = {
/*
* Function of the reservation
*/
- showEasyAddReserve: function(event, date, time, location_id) {
+ showEasyAddReserve: function(event, date, time, location_id, timeframe_id) {
var params = new Object();
params["prefix_id_name"] = "popup_regist_reservation";
params["action"] = "reservation_view_main_reserve_add";
@@ -268,6 +268,9 @@ clsReservation.prototype = {
if (time) {
params["time"] = time;
}
+ if (timeframe_id) {
+ params["timeframe_id"] = timeframe_id;
+ }
commonCls.sendPopupView(event, params, {"top_el":$(this.id),"modal_flag":true});
},
showReserveDetails: function(event, reserve_id) {
@@ -432,6 +435,9 @@ clsReservation.prototype = {
},
addReserve: function(id, form_el, details_flag) {
+
+ this._switchTimeframeDisable(form_el, false);
+
if (details_flag == "1") {
var description = this.textarea.getTextArea();
var params_str = "action=reservation_action_main_reserve_add&details_flag=1&" + Form.serialize(form_el) +
@@ -448,9 +454,16 @@ clsReservation.prototype = {
reservationCls[id].changeReservation();
commonCls.removeBlock(this.id);
}.bind(this);
+ params["callbackfunc_error"] = function(res) {
+ this._switchTimeframeDisable(form_el, true);
+ commonCls.alert(res);
+ }.bind(this);
commonCls.sendPost(this.id, params_str, params);
},
modifyReserve: function(id, form_el) {
+
+ this._switchTimeframeDisable(form_el, false);
+
var description = this.textarea.getTextArea();
var params_str = "action=reservation_action_main_reserve_modify&" + Form.serialize(form_el) +
"&description=" + encodeURIComponent(description);
@@ -463,6 +476,10 @@ clsReservation.prototype = {
reservationCls[id].changeReservation();
commonCls.removeBlock(this.id);
}.bind(this);
+ params["callbackfunc_error"] = function(res) {
+ this._switchTimeframeDisable(form_el, true);
+ commonCls.alert(res);
+ }.bind(this);
commonCls.sendPost(this.id, params_str, params);
},
deleteReserve: function(id, reserve_id, edit_rrule, confirm_mes) {
@@ -477,6 +494,18 @@ clsReservation.prototype = {
commonCls.sendPost(this.id, "action=reservation_action_main_reserve_delete&reserve_id=" + reserve_id +
"&edit_rrule=" + edit_rrule, params);
},
+ _switchTimeframeDisable: function(form_el, opeflag) {
+ if(form_el.start_timeframe && form_el.end_timeframe) {
+ if($F(form_el.start_timeframe).length != 0) {
+ form_el.start_hour.disabled = opeflag;
+ form_el.start_minute.disabled = opeflag;
+ }
+ if($F(form_el.end_timeframe).length != 0) {
+ form_el.end_hour.disabled = opeflag;
+ form_el.end_minute.disabled = opeflag;
+ }
+ }
+ },
sendMail: function() {
commonCls.sendPost(this.id, "action=reservation_action_main_reserve_mail", {"loading_el":null});
},
@@ -639,11 +668,23 @@ clsReservation.prototype = {
form_el.start_minute.disabled = true;
form_el.end_hour.disabled = true;
form_el.end_minute.disabled = true;
+ if(form_el.start_timeframe) {
+ form_el.start_timeframe.disabled = true;
+ }
+ if(form_el.end_timeframe) {
+ form_el.end_timeframe.disabled = true;
+ }
} else {
form_el.start_hour.disabled = false;
form_el.start_minute.disabled = false;
form_el.end_hour.disabled = false;
form_el.end_minute.disabled = false;
+ if(form_el.start_timeframe) {
+ form_el.start_timeframe.disabled = false;
+ }
+ if(form_el.end_timeframe) {
+ form_el.end_timeframe.disabled = false;
+ }
}
this.switchTime24Reserve(form_el);
},
@@ -713,6 +754,31 @@ clsReservation.prototype = {
form_el.start_time_fixation.disabled = true;
}
},
+ switchTimeframe: function(el, form_el, tgt_str) {
+ var times_str = $F(el);
+ var tgt_hour_el = $("reservation_" + tgt_str + "_hour" + this.id);
+ var tgt_minute_el = $("reservation_" + tgt_str + "_minute" + this.id);
+
+ if(times_str.length == 0) {
+ tgt_hour_el.disabled = false;
+ tgt_minute_el.disabled = false;
+ }
+ else {
+ var times = $F(el).split('|');
+ Form.Element.SetSerializers.select(tgt_hour_el, times[0]);
+ Form.Element.SetSerializers.select(tgt_minute_el, times[1]);
+ tgt_hour_el.disabled = true;
+ tgt_minute_el.disabled = true;
+/*
+ if(tgt_str=="start") {
+ if($F("reservation_end_timeframe"+this.id).length == 0) {
+ $("reservation_end_timeframe"+this.id).selectedIndex = el.selectedIndex;
+ this.switchTimeframe($("reservation_end_timeframe"+this.id), form_el, "end");
+ }
+ }
+*/
+ }
+ },
changeStyle: function(form_el) {
this.scrollTop = null;
this.scrollLeft = null;
@@ -1032,6 +1098,34 @@ clsReservation.prototype = {
commonCls.sendPost(this.id, params_str, params);
},
+ /*
+ * Timeframe functions
+ */
+ switchTimeframeTime24: function(form_el) {
+ if (form_el.end_hour.value == "24") {
+ form_el.end_minute.disabled = true;
+ form_el.end_minute.value = "00";
+ } else {
+ form_el.end_minute.disabled = false;
+ }
+ },
+
+ switchTimeframeColor: function(el, form_el) {
+ var color = form_el.timeframe_color.value;
+ Element.setStyle(el, {"backgroundColor":color});
+ },
+
+ setTimeframe: function(form_el, block_id) {
+ var target_el = $("_"+block_id);
+ var params = new Object();
+ params["callbackfunc"] = function(res){
+ commonCls.sendView(target_el, "action=reservation_view_edit_timeframe" );
+ commonCls.removeBlock(this.id);
+ }.bind(this);
+ commonCls.sendPost(this.id, 'action=reservation_action_edit_timeframe_entry&' +
+ Form.serialize(form_el) , params);
+ },
+
/*
* Function of mail registration
*/
diff --git a/html/webapp/modules/reservation/install.ini b/html/webapp/modules/reservation/install.ini
index f5fec1c..c42eb78 100644
--- a/html/webapp/modules/reservation/install.ini
+++ b/html/webapp/modules/reservation/install.ini
@@ -24,6 +24,8 @@ mail_subject = "RESERVATION_MAIL_SUBJECT"
mail_body = "RESERVATION_MAIL_BODY"
mail_authority = "_AUTH_GUEST"
+timeframe_color = "#ffc9c9|#ffeeb5|#d7fab4|#d3f4ff|#cfd7ff|#ffdffb|#ffd7b0"
+
[CleanUp]
reservation_reserve_details = description
reservation_location_details = description
diff --git a/html/webapp/modules/reservation/language/chinese/main.ini b/html/webapp/modules/reservation/language/chinese/main.ini
index 8f64750..84f18ca 100644
--- a/html/webapp/modules/reservation/language/chinese/main.ini
+++ b/html/webapp/modules/reservation/language/chinese/main.ini
@@ -21,6 +21,7 @@ reservation_error_holiday = "获取节日数据失败。"
reservation_auth = "权限设置"
reservation_location_manage = "显示列表"
reservation_location_add = "注册新设施"
+reservation_timeframe = "时间框架设置"
reservation_mail = "邮件设置"
reservation_csv_import = "导入"
@@ -35,6 +36,9 @@ reservation_each_location = "每日"
reservation_default_location = "默认设施"
+reservation_timeframe = "时间框架显示"
+reservation_timeframe_on = "显示的时间框架"
+
reservation_start_time = "预约开始时间"
reservation_start_time_default = "随到随用"
reservation_start_time_fixation = "预定时间"
@@ -158,6 +162,7 @@ reservation_display_monthly = "正在显示月历"
reservation_display_weekly = "正在显示周历"
reservation_display_location = "正在显示每日时刻"
+reservation_time_pause = "~"
[Reservation_View_Main_Reserve:Reservation_View_Edit_Import_Init]
reservation_reserve_flag = "群组"
@@ -295,6 +300,9 @@ reservation_rrule_term_until = "结束日期 "
reservation_rrule_count = " 次"
+reservation_timeframe_start_frame = "--开始帧--"
+reservation_timeframe_end_frame = "--结束帧--"
+
[Reservation_View_Main_Movedate]
reservation_year_format = "%s"
reservation_move = "跳转到..."
@@ -351,3 +359,29 @@ define:RESERVATION_ERR_FILE_FORMAT = "フォーマットが正しくありませ
cv_import_success = "CSVファイルからの取り込みが正常に終了しました。"
define:RESERVATION_ERR_NUM = "%s行目: "
define:RESERVATION_INVALID_TIME = "您不能输入%s。请输入正确的期。"
+
+
+[Reservation_View_Edit_Timeframe_Entry:Reservation_Action_Edit_Timeframe_Entry]
+reservation_timeframe_name_label = "时间框架名称"
+reservation_timeframe_range_label = "时间范围"
+reservation_timeframe_color_label = "时间框架的颜色"
+
+
+[Reservation_View_Edit_Timeframe]
+reservation_timeframe_add_message = "我会加一个时间框架"
+reservation_timeframe_add_title = "添加定义一个时间框架"
+reservation_timeframe_no_exists = "尚未注册时间框架。"
+reservation_time_pause = " ~ "
+reservation_timeframe_delete_confirm_message = "你要删除“%s的”吗?"
+
+[Reservation_View_Edit_Timeframe_Entry]
+_dialog_name = "时间框架设置"
+reservation_hour_format = "%s:"
+reservation_minute_format = "%s"
+reservation_timeframe_color_select_message = "--请选择一种颜色--"
+
+[Reservation_Action_Edit_Timeframe_Entry]
+define:RESERVATION_ERR_FROM_TO_DATE = "在设定的时间有误差。请设置正确的时间框架。"
+reservation_err_match_color = "不正确选定的颜色。请选择一个不同的颜色。"
+reservation_timeframe_timetable_duplicated = "重叠的帧的开始时间的时间帧/结束时间,已经被注册。请修改"
+define:RESERVATION_ERR_TIMEFRAME_MIN_TIME = "我可以指定在15分钟的时间框架。开始,请适当调整的结束时间。"
\ No newline at end of file
diff --git a/html/webapp/modules/reservation/language/english/main.ini b/html/webapp/modules/reservation/language/english/main.ini
index 7f1acae..0ed8d01 100644
--- a/html/webapp/modules/reservation/language/english/main.ini
+++ b/html/webapp/modules/reservation/language/english/main.ini
@@ -21,6 +21,7 @@ reservation_error_holiday = "Failed while obtaining the holiday data."
reservation_auth = "Authority setting"
reservation_location_manage = "Show list"
reservation_location_add = "Register new"
+reservation_timeframe = "Timeframe setting"
reservation_mail = "Mail setting"
reservation_csv_import = "Import"
@@ -35,6 +36,9 @@ reservation_each_location = "Daily"
reservation_default_location = "Default institution"
+reservation_timeframe = "Timeframes"
+reservation_timeframe_on = "Display timeframe"
+
reservation_start_time = "Starting time"
reservation_start_time_default = "alters by time of use"
reservation_start_time_fixation = "fixed"
@@ -158,6 +162,7 @@ reservation_display_monthly = "Monthly calendar is shown"
reservation_display_weekly = "Weekly calendar is shown"
reservation_display_location = "Daily calendar is shown"
+reservation_time_pause = " - "
[Reservation_View_Main_Reserve:Reservation_View_Edit_Import_Init]
reservation_reserve_flag = "Group"
@@ -295,6 +300,10 @@ reservation_rrule_term_until = "End date "
reservation_rrule_count = " times"
+reservation_timeframe_start_frame = "--start timeframe--"
+reservation_timeframe_end_frame = "--end timeframe--"
+
+
[Reservation_View_Main_Movedate]
reservation_year_format = "%s"
reservation_move = "Goto..."
@@ -351,3 +360,28 @@ define:RESERVATION_ERR_FILE_FORMAT = "Formats are different."
cv_import_success = "Import from CSV file has completed normally."
define:RESERVATION_ERR_NUM = "line number %s: "
define:RESERVATION_INVALID_TIME = "Unauthorized input, %s. Please input the correct time."
+
+[Reservation_View_Edit_Timeframe_Entry:Reservation_Action_Edit_Timeframe_Entry]
+reservation_timeframe_name_label = "Timeframe name"
+reservation_timeframe_range_label = "Timeframe range"
+reservation_timeframe_color_label = "Timeframe color"
+
+
+[Reservation_View_Edit_Timeframe]
+reservation_timeframe_add_message = "Adding a timeframe"
+reservation_timeframe_add_title = "Add timeframe"
+reservation_timeframe_no_exists = "Timeframe is not registered yet."
+reservation_time_pause = " - "
+reservation_timeframe_delete_confirm_message = "Do you want to delete [%s]?"
+
+[Reservation_View_Edit_Timeframe_Entry]
+_dialog_name = "Timeframe setting"
+reservation_hour_format = "%s:"
+reservation_minute_format = "%s"
+reservation_timeframe_color_select_message = "--Select a color--"
+
+[Reservation_Action_Edit_Timeframe_Entry]
+define:RESERVATION_ERR_FROM_TO_DATE = "There is an error in the setting of time. Please set the correct time."
+reservation_err_match_color = "There is an error in the setting of color. Please select the correct color."
+reservation_timeframe_timetable_duplicated = "This time range has been already registered. Try different time."
+define:RESERVATION_ERR_TIMEFRAME_MIN_TIME = "At least 15 minutes is required for timeframe."
\ No newline at end of file
diff --git a/html/webapp/modules/reservation/language/japanese/main.ini b/html/webapp/modules/reservation/language/japanese/main.ini
index df04b08..8575a0f 100644
--- a/html/webapp/modules/reservation/language/japanese/main.ini
+++ b/html/webapp/modules/reservation/language/japanese/main.ini
@@ -21,6 +21,7 @@ reservation_error_holiday = "祝日データを取得する際にエラーが発
reservation_auth = "権限設定"
reservation_location_manage = "施設管理"
reservation_location_add = "施設登録"
+reservation_timeframe = "時間枠管理"
reservation_mail = "メール設定"
reservation_csv_import = "予約のインポート"
@@ -35,6 +36,9 @@ reservation_each_location = "日表示(カテゴリ別)"
reservation_default_location = "最初に表示する施設"
+reservation_timeframe = "時間枠表示"
+reservation_timeframe_on = "時間枠を表示する"
+
reservation_start_time = "表示開始時"
reservation_start_time_default = "閲覧時刻により変動"
reservation_start_time_fixation = "固定"
@@ -158,6 +162,7 @@ reservation_display_monthly = "月別予約状況を表示しています。"
reservation_display_weekly = "週別予約状況を表示しています。"
reservation_display_location = "施設別予約状況を表示しています。"
+reservation_time_pause = "~"
[Reservation_View_Main_Reserve:Reservation_View_Edit_Import_Init]
reservation_reserve_flag = "利用するグループ"
@@ -295,6 +300,9 @@ reservation_rrule_term_until = "終了日による指定 "
reservation_rrule_count = "回"
+reservation_timeframe_start_frame = "--開始枠--"
+reservation_timeframe_end_frame = "--終了枠--"
+
[Reservation_View_Main_Movedate]
reservation_year_format = "%s年"
reservation_move = "移動"
@@ -351,3 +359,28 @@ define:RESERVATION_ERR_FILE_FORMAT = "フォーマットが正しくありませ
cv_import_success = "CSVファイルからの取り込みが正常に終了しました。"
define:RESERVATION_ERR_NUM = "%s行目: "
define:RESERVATION_INVALID_TIME = "入力された%sが不正です。正しい時間を入力して下さい"
+
+[Reservation_View_Edit_Timeframe_Entry:Reservation_Action_Edit_Timeframe_Entry]
+reservation_timeframe_name_label = "時間枠名"
+reservation_timeframe_range_label = "時間範囲"
+reservation_timeframe_color_label = "時間枠色"
+
+
+[Reservation_View_Edit_Timeframe]
+reservation_timeframe_add_message = "時間枠を追加します"
+reservation_timeframe_add_title = "時間枠定義の追加"
+reservation_timeframe_no_exists = "時間枠はまだ登録されていません。"
+reservation_time_pause = " ~ "
+reservation_timeframe_delete_confirm_message = "「%s」を削除してよろしいですか?"
+
+[Reservation_View_Edit_Timeframe_Entry]
+_dialog_name = "時間枠設定"
+reservation_hour_format = "%s時"
+reservation_minute_format = "%s分"
+reservation_timeframe_color_select_message = "--色を選んでください--"
+
+[Reservation_Action_Edit_Timeframe_Entry]
+define:RESERVATION_ERR_FROM_TO_DATE = "時間の設定に誤りがあります。正しい時間枠を設定してください。"
+reservation_err_match_color = "選択された色は正しくありません。別の色を選択して下さい。"
+reservation_timeframe_timetable_duplicated = "時間枠の開始時間/終了時間が、すでに登録されている枠と重なっています。修正して下さい。"
+define:RESERVATION_ERR_TIMEFRAME_MIN_TIME = "時間枠は15分単位で指定できます。開始、終了時間を適切に調整してください。"
\ No newline at end of file
diff --git a/html/webapp/modules/reservation/sql/mysql/table.sql b/html/webapp/modules/reservation/sql/mysql/table.sql
index 24724cd..4041cb4 100644
--- a/html/webapp/modules/reservation/sql/mysql/table.sql
+++ b/html/webapp/modules/reservation/sql/mysql/table.sql
@@ -130,6 +130,31 @@ CREATE TABLE `reservation_location_details` (
KEY `room_id` (`room_id`)
) ENGINE=MyISAM;
+-- --------------------------------------------------------
+
+-- -
+-- Table Structure `reservation_timeframe`
+-- -
+
+CREATE TABLE `reservation_timeframe` (
+ `timeframe_id` int(11) unsigned NOT NULL,
+ `timeframe_name` varchar(255) NOT NULL default '',
+ `start_time` varchar(14) NOT NULL default '',
+ `end_time` varchar(14) NOT NULL default '',
+ `timezone_offset` float(3,1) NOT NULL default '0.0',
+ `timeframe_color` varchar(16) NOT NULL default '',
+ `insert_time` varchar(14) NOT NULL default '',
+ `insert_site_id` varchar(40) NOT NULL default '',
+ `insert_user_id` varchar(40) NOT NULL default '',
+ `insert_user_name` varchar(255) NOT NULL default '',
+ `update_time` varchar(14) NOT NULL default '',
+ `update_site_id` varchar(40) NOT NULL default '',
+ `update_user_id` varchar(40) NOT NULL default '',
+ `update_user_name` varchar(255) NOT NULL default '',
+ PRIMARY KEY (`timeframe_id`)
+) ENGINE=MyISAM;
+
+
-- --------------------------------------------------------
-- -
diff --git a/html/webapp/modules/reservation/templates/default/reservation_main_addreserve.html b/html/webapp/modules/reservation/templates/default/reservation_main_addreserve.html
index b9ea1da..1b63986 100644
--- a/html/webapp/modules/reservation/templates/default/reservation_main_addreserve.html
+++ b/html/webapp/modules/reservation/templates/default/reservation_main_addreserve.html
@@ -2,17 +2,29 @@
<{if ($smarty.session._user_id && $smarty.session._user_id != "0") }>
<{if ($location_id != 0) }>
-
- " class="icon" alt="<{$lang.reservation_easy_addreserve|smarty:nodefaults}>" title="<{$lang.reservation_easy_addreserve|smarty:nodefaults}>" />
-
- <{elseif ($hour === "") }>
-
+ <{if ($hour === "" && $timeframe_id === "") }>
+
+ <{elseif $timeframe_id === ""}>
+
+ <{else}>
+
+ <{/if}>
" class="icon" alt="<{$lang.reservation_easy_addreserve|smarty:nodefaults}>" title="<{$lang.reservation_easy_addreserve|smarty:nodefaults}>" />
<{else}>
-
- " class="icon" alt="<{$lang.reservation_easy_addreserve|smarty:nodefaults}>" title="<{$lang.reservation_easy_addreserve|smarty:nodefaults}>" />
-
+ <{if ($hour === "" && $timeframe_id === "") }>
+
+ " class="icon" alt="<{$lang.reservation_easy_addreserve|smarty:nodefaults}>" title="<{$lang.reservation_easy_addreserve|smarty:nodefaults}>" />
+
+ <{elseif $timeframe_id === ""}>
+
+ " class="icon" alt="<{$lang.reservation_easy_addreserve|smarty:nodefaults}>" title="<{$lang.reservation_easy_addreserve|smarty:nodefaults}>" />
+
+ <{else}>
+
+ " class="icon" alt="<{$lang.reservation_easy_addreserve|smarty:nodefaults}>" title="<{$lang.reservation_easy_addreserve|smarty:nodefaults}>" />
+
+ <{/if}>
<{/if}>
<{else}>
diff --git a/html/webapp/modules/reservation/templates/default/reservation_reserve_details_reserve_time.html b/html/webapp/modules/reservation/templates/default/reservation_reserve_details_reserve_time.html
index a73b5fc..63e61c2 100644
--- a/html/webapp/modules/reservation/templates/default/reservation_reserve_details_reserve_time.html
+++ b/html/webapp/modules/reservation/templates/default/reservation_reserve_details_reserve_time.html
@@ -4,6 +4,19 @@
<{$lang.reservation_reserve_time|smarty:nodefaults}>
+ <{if $action.reserve_block.display_timeframe == $smarty.const._ON}>
+ <{if !empty($action.start_timeframe|smarty:nodefaults) && !empty($action.end_timeframe|smarty:nodefaults)}>
+ <{if $action.start_timeframe.timeframe_id == $action.end_timeframe.timeframe_id}>
+ <{$action.start_timeframe.timeframe_name}>
+ <{else}>
+ <{$action.start_timeframe.timeframe_name}>
+ <{$lang.reservation_time_pause|smarty:nodefaults}>
+ <{$action.end_timeframe.timeframe_name}>
+ <{/if}>
+
+ <{/if}>
+ <{/if}>
+
<{if ($action.reserve.start_date_view == $action.reserve.end_date_view) }>
<{$action.reserve.start_date_str}>
<{if ($action.reserve.start_time_view != "000000" && $action.reserve.start_time_view != "240000") }>
diff --git a/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_reserve_time.html b/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_reserve_time.html
index 182b7aa..2498fa5 100644
--- a/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_reserve_time.html
+++ b/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_reserve_time.html
@@ -7,14 +7,33 @@
-
+
<{if ($reserve.allday_flag == _ON) }> checked="checked"<{/if}> onclick='reservationCls["<{$id}>"].switchAllday(this.form);' />
<{$lang.reservation_allday_flag|smarty:nodefaults}>
-
+
+ <{if $action.reserve_block.display_timeframe == $smarty.const._ON && $action.timeframe_list_count!=0}>
+
+ <{if ($reserve.allday_flag == _ON) }> disabled="disabled"<{/if}> onchange='reservationCls["<{$id}>"].switchTimeframe(this, this.form, "start");'>
+ <{$lang.reservation_timeframe_start_frame}>
+ <{foreach from=$action.timeframe_list item=timeframe}>
+ <{if $timeframe.timeframe_id==$action.start_timeframe_id}> selected="selected"<{/if}>><{$timeframe.timeframe_name}>
+ <{/foreach}>
+
+
+ <{$lang.reservation_time_pause|smarty:nodefaults}>
+
+ <{if ($reserve.allday_flag == _ON) }> disabled="disabled"<{/if}> onchange='reservationCls["<{$id}>"].switchTimeframe(this, this.form, "end");'>
+ <{$lang.reservation_timeframe_end_frame}>
+ <{foreach from=$action.timeframe_list item=timeframe}>
+ <{if $timeframe.timeframe_id==$action.end_timeframe_id}> selected="selected"<{/if}>><{$timeframe.timeframe_name}>
+ <{/foreach}>
+
+ <{/if}>
+
- <{if ($reserve.allday_flag == _ON) }> disabled="disabled"<{/if}>>
+ <{if ($reserve.allday_flag == _ON) }> disabled="disabled"<{/if}>>
<{section name=hour loop=24 start=0 step=1}>
<{assign var=hour value=$smarty.section.hour.index}>
<{assign var=reserve_hour value=$reserve.start_time_view|substr:0:2|intval}>
@@ -24,7 +43,7 @@
<{/section}>
- <{if ($reserve.allday_flag == _ON) }> disabled="disabled"<{/if}>>
+ <{if ($reserve.allday_flag == _ON) }> disabled="disabled"<{/if}>>
<{section name=minute loop=60 start=0 step=5}>
<{assign var=minute value=$smarty.section.minute.index}>
<{assign var=reserve_minute value=$reserve.start_time_view|substr:2:2|intval}>
@@ -33,10 +52,10 @@
<{/section}>
-
+
<{$lang.reservation_time_pause|smarty:nodefaults}>
-
- <{if ($reserve.allday_flag == _ON) }> disabled="disabled"<{/if}> onchange='reservationCls["<{$id}>"].switchTime24Reserve(this.form);'>
+
+ <{if ($reserve.allday_flag == _ON) }> disabled="disabled"<{/if}> onchange='reservationCls["<{$id}>"].switchTime24Reserve(this.form);'>
<{section name=hour loop=25 start=0 step=1}>
<{assign var=hour value=$smarty.section.hour.index}>
<{assign var=reserve_hour value=$reserve.end_time_view|substr:0:2|intval}>
@@ -46,7 +65,7 @@
<{/section}>
- <{if ($reserve.allday_flag == _ON) }> disabled="disabled"<{/if}>>
+ <{if ($reserve.allday_flag == _ON) }> disabled="disabled"<{/if}>>
<{section name=minute loop=60 start=0 step=5}>
<{assign var=minute value=$smarty.section.minute.index}>
<{assign var=reserve_minute value=$reserve.end_time_view|substr:2:2|intval}>
diff --git a/html/webapp/modules/reservation/templates/default/reservation_style_timeframe_type.html b/html/webapp/modules/reservation/templates/default/reservation_style_timeframe_type.html
new file mode 100644
index 0000000..b952784
--- /dev/null
+++ b/html/webapp/modules/reservation/templates/default/reservation_style_timeframe_type.html
@@ -0,0 +1,15 @@
+<{strip}>
+
+
+
+ <{$lang.reservation_timeframe|smarty:nodefaults}>
+
+
+
+
+ <{if ($reserve_block.display_timeframe == $smarty.const._ON) }> checked="checked"<{/if}> <{if $action.timeframe_list_count == 0}>disabled="disabled"<{/if}> />
+ <{$lang.reservation_timeframe_on|smarty:nodefaults}>
+
+
+
+<{/strip}>
\ No newline at end of file
diff --git a/html/webapp/modules/reservation/templates/default/reservation_view_edit_style_init.html b/html/webapp/modules/reservation/templates/default/reservation_view_edit_style_init.html
index ae9f253..fb4826a 100644
--- a/html/webapp/modules/reservation/templates/default/reservation_view_edit_style_init.html
+++ b/html/webapp/modules/reservation/templates/default/reservation_view_edit_style_init.html
@@ -19,6 +19,10 @@
<{include file="reservation_style_location.html" current_location_id=$action.reserve_block.location_id}>
+
+ <{include file="reservation_style_timeframe_type.html" reserve_block=$action.reserve_block}>
+
+
<{include file="reservation_style_default_time.html" reserve_block=$action.reserve_block}>
diff --git a/html/webapp/modules/reservation/templates/default/reservation_view_edit_timeframe.html b/html/webapp/modules/reservation/templates/default/reservation_view_edit_timeframe.html
new file mode 100644
index 0000000..d73b354
--- /dev/null
+++ b/html/webapp/modules/reservation/templates/default/reservation_view_edit_timeframe.html
@@ -0,0 +1,47 @@
+
\ No newline at end of file
diff --git a/html/webapp/modules/reservation/templates/default/reservation_view_edit_timeframe_entry.html b/html/webapp/modules/reservation/templates/default/reservation_view_edit_timeframe_entry.html
new file mode 100644
index 0000000..8e9f96f
--- /dev/null
+++ b/html/webapp/modules/reservation/templates/default/reservation_view_edit_timeframe_entry.html
@@ -0,0 +1,115 @@
+<{strip}>
+
+
+
+<{include file="../reservation_script.html"}>
+
+<{/strip}>
\ No newline at end of file
diff --git a/html/webapp/modules/reservation/templates/default/reservation_view_main_init_location.html b/html/webapp/modules/reservation/templates/default/reservation_view_main_init_location.html
index 8f24088..6eae9a2 100644
--- a/html/webapp/modules/reservation/templates/default/reservation_view_main_init_location.html
+++ b/html/webapp/modules/reservation/templates/default/reservation_view_main_init_location.html
@@ -12,11 +12,33 @@
+ <{if $action.reserve_block.display_timeframe == $smarty.const._ON}>
+
+ <{/if}>
+
+ <{if $action.reserve_block.display_timeframe == $smarty.const._ON}>
+
+
+
+ <{assign var=start_pos value=0}>
+ <{foreach from=$action.timeframe_list item=timeframe}>
+ <{assign var=spacer_width value=`$timeframe.left-$start_pos`}>
+
+
transparent<{else}><{$timeframe.timeframe_color}><{/if}>" title="<{$timeframe.start_time|timezone_date:false:$lang._short_time_format}><{$lang.reservation_time_pause}><{$timeframe.end_time|timezone_date:false:$lang._short_time_format}>">
+ <{$timeframe.timeframe_name}>
+
+ <{assign var=start_pos value=$timeframe.left+$timeframe.width}>
+ <{/foreach}>
+
+
+
+ <{/if}>
+
<{section name=hour loop=24 start=0 step=1}>
<{assign var=hour value=$smarty.section.hour.index}>
@@ -31,7 +53,7 @@
<{foreach name="location_list" key="location_id" item="location" from=$action.location_list}>
-
+
<{if ($action.reserve_data.$location_id.$view_date) }>
<{include file="reservation_view_main_list_location.html"}>
<{else}>
diff --git a/html/webapp/modules/reservation/templates/default/reservation_view_main_init_weekly.html b/html/webapp/modules/reservation/templates/default/reservation_view_main_init_weekly.html
index 68e7b92..371669b 100644
--- a/html/webapp/modules/reservation/templates/default/reservation_view_main_init_weekly.html
+++ b/html/webapp/modules/reservation/templates/default/reservation_view_main_init_weekly.html
@@ -1,7 +1,7 @@
<{strip}>
<{assign var="lang_year" value=$lang.reservation_monthly_year_format|smarty:nodefaults|date:"`$action.current_timestamp`"}>
-<{assign var="lang_month" value=$lang.reservation_monthly_month_format|smarty:nodefaults|date:"`$action.current_timestamp`"}>
+<{assign var="lang_month" value=$lang.reservation_monthly_month_format|smarty:nodefaults|date:"`$action.current_timestamp`"}>
<{include file="reservation_main_header_weekly.html"}>
@@ -12,6 +12,11 @@
+ <{if $action.reserve_block.display_timeframe == $smarty.const._ON}>
+
+ /images/common/blank.gif" alt="" title="" />
+
+ <{/if}>
/images/common/blank.gif" alt="" title="" />
@@ -24,7 +29,7 @@
<{/if}>
<{assign var="index" value=$smarty.section.timestamp.iteration-1}>
<{assign var="wday" value="w"|date:"`$timestamp`"}>
-
+
<{assign var="wday_data" value=$action.week_list.$wday}>
<{assign var="lang_wday" value=$lang.reservation_wday_format|smarty:nodefaults|sprintf:"`$wday_data.name`"}>
<{assign var="lang_day" value=$lang.reservation_weekly_format|smarty:nodefaults|date:"`$timestamp`"}>
@@ -32,7 +37,7 @@
<{include file="reservation_main_set_day_class.html" assign="day_class" view_date=$action.view_date set_date=$date wday=$wday}>
<{assign var="lang_year" value=$lang.reservation_monthly_year_format|smarty:nodefaults|date:"`$timestamp`"}>
- <{assign var="lang_month" value=$lang.reservation_monthly_month_format|smarty:nodefaults|date:"`$timestamp`"}>
+ <{assign var="lang_month" value=$lang.reservation_monthly_month_format|smarty:nodefaults|date:"`$timestamp`"}>
@@ -60,7 +65,24 @@
<{assign var=hour value=$smarty.section.hour.index}>
-
+ <{if $action.reserve_block.display_timeframe == $smarty.const._ON && ($smarty.section.hour.first)}>
+
+
+ <{assign var=start_pos value=0}>
+ <{foreach from=$action.timeframe_list item=timeframe}>
+ <{assign var=spacer_height value=`$timeframe.top-$start_pos`}>
+
+
transparent<{else}><{$timeframe.timeframe_color}><{/if}>" title="<{$timeframe.start_time|timezone_date:false:$lang._short_time_format}><{$lang.reservation_time_pause}><{$timeframe.end_time|timezone_date:false:$lang._short_time_format}>">
+
<{include file="reservation_main_addreserve.html" view_date=$first_date timeframe_id=`$timeframe.timeframe_id`}>
+ <{$timeframe.timeframe_name}>
+
+ <{assign var=start_pos value=$timeframe.top+$timeframe.height}>
+ <{/foreach}>
+
+
+ <{/if}>
+
+
<{$lang.reservation_time_format|smarty:nodefaults|sprintf:$hour}>
<{include file="reservation_main_addreserve.html" view_date=$first_date hour=$hour}>
@@ -71,8 +93,8 @@
<{section name=timestamp loop=$action.end_timestamp start=$action.start_timestamp step=86400}>
<{assign var="timestamp" value=$smarty.section.timestamp.index}>
<{assign var="date" value="Ymd"|date:$smarty.section.timestamp.index}>
-
-
+
+
<{if ($action.reserve_data.$date) }>
<{include file="./reservation_view_main_list_weekly.html"}>
@@ -81,13 +103,18 @@
<{/if}>
-
+
<{/section}>
<{/if}>
<{/section}>
+ <{if $action.reserve_block.display_timeframe == $smarty.const._ON}>
+
+
+ <{/if}>
+
/images/common/blank.gif" alt="" title="" />
diff --git a/html/webapp/modules/reservation/templates/default/reservation_view_main_reserve_regist.html b/html/webapp/modules/reservation/templates/default/reservation_view_main_reserve_regist.html
index 342f203..dcf37ea 100644
--- a/html/webapp/modules/reservation/templates/default/reservation_view_main_reserve_regist.html
+++ b/html/webapp/modules/reservation/templates/default/reservation_view_main_reserve_regist.html
@@ -19,7 +19,7 @@
<{include file="reservation_reserve_regist_location.html" reserve=$action.reserve|smarty:nodefaults}>
-
+
<{if ($action.details_flag == _ON) }>
<{include file="reservation_reserve_regist_contact.html" reserve=$action.reserve|smarty:nodefaults}>
@@ -36,7 +36,7 @@
<{/if}>
<{/if}>
-
+
<{if ($action.mail_send == _ON) }>
<{include file="reservation_reserve_regist_mail.html" reserve=$action.reserve|smarty:nodefaults}>
@@ -82,6 +82,10 @@
reservationCls["<{$id}>"].initRepeat();
<{/if}>
reservationCls["<{$id}>"].switchTime24Reserve($("reservation_form<{$id}>"));
+ if($("reservation_start_timeframe<{$id}>")) {
+ reservationCls["<{$id}>"].switchTimeframe($("reservation_start_timeframe<{$id}>"), $("reservation_form<{$id}>"), "start" );
+ reservationCls["<{$id}>"].switchTimeframe($("reservation_end_timeframe<{$id}>"), $("reservation_form<{$id}>"), "end" );
+ }
commonCls.focus("<{$id}>");
diff --git a/html/webapp/modules/reservation/update/Update.class.php b/html/webapp/modules/reservation/update/Update.class.php
index 2f47175..4cf030a 100644
--- a/html/webapp/modules/reservation/update/Update.class.php
+++ b/html/webapp/modules/reservation/update/Update.class.php
@@ -217,6 +217,39 @@ function execute()
}
}
+ // reservation_blockにカラムを追加
+ $adodb = $this->db->getAdoDbObject();
+ $metaColumns = $adodb->MetaColumns($this->db->getPrefix().'reservation_block');
+ if(!isset($metaColumns['DISPLAY_TIMEFRAME'])) {
+ $sql = "ALTER TABLE `".$this->db->getPrefix()."reservation_block` ".
+ " ADD `display_timeframe` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `display_type` ;";
+ $result = $this->db->execute($sql);
+ if($result === false) return false;
+ }
+ // reservation_timeframeテーブルを追加
+ $metaTables = $adodb->MetaTables();
+ if (!in_array($this->db->getPrefix()."reservation_timeframe", $metaTables)) {
+ $sql = "CREATE TABLE `".$this->db->getPrefix()."reservation_timeframe` (" .
+ " `timeframe_id` int(11) NOT NULL default '0'," .
+ " `timeframe_name` varchar(255) default NULL," .
+ " `start_time` varchar(14) NOT NULL default ''," .
+ " `end_time` varchar(14) NOT NULL default ''," .
+ " `timezone_offset` float(3,1) NOT NULL default '0.0'," .
+ " `timeframe_color` varchar(16) NOT NULL default ''," .
+ " `insert_time` varchar(14) NOT NULL default ''," .
+ " `insert_site_id` varchar(40) NOT NULL default ''," .
+ " `insert_user_id` varchar(40) NOT NULL default ''," .
+ " `insert_user_name` varchar(255) NOT NULL default ''," .
+ " `update_time` varchar(14) NOT NULL default ''," .
+ " `update_site_id` varchar(40) NOT NULL default ''," .
+ " `update_user_id` varchar(40) NOT NULL default ''," .
+ " `update_user_name` varchar(255) NOT NULL default ''," .
+ " PRIMARY KEY (`timeframe_id`)" .
+ ") ENGINE=MyISAM;";
+ $result = $this->db->execute($sql);
+ if($result === false) return false;
+ }
+
return true;
}
}
diff --git a/html/webapp/modules/reservation/validator/Validator_TimeframeAdjustment.class.php b/html/webapp/modules/reservation/validator/Validator_TimeframeAdjustment.class.php
new file mode 100644
index 0000000..0ced79b
--- /dev/null
+++ b/html/webapp/modules/reservation/validator/Validator_TimeframeAdjustment.class.php
@@ -0,0 +1,76 @@
+getComponent("Request");
+ $reservationView =& $container->getComponent("reservationView");
+
+ $actionChain =& $container->getComponent("ActionChain");
+ $actionName = $actionChain->getCurActionName();
+
+ $block = $request->getParameter('reserve_block');
+ if($block['display_timeframe'] == _OFF) {
+ return;
+ }
+
+ if ($actionName == "reservation_view_main_reserve_add") {
+ if(!isset($attributes['timeframe_id'])) {
+ return;
+ }
+ $timeframe_id = $attributes['timeframe_id'];
+ $timeframe = $reservationView->getTimeframe($timeframe_id);
+ if($timeframe && is_array($timeframe)) {
+ $request->setParameter('start_hour', $timeframe['start_time_view_hour']);
+ $request->setParameter('start_minute', $timeframe['start_time_view_min']);
+ $request->setParameter('end_hour', $timeframe['end_time_view_hour']);
+ $request->setParameter('end_minute', $timeframe['end_time_view_min']);
+ $request->setParameter('start_timeframe_id', $timeframe['timeframe_id']);
+ $request->setParameter('end_timeframe_id', $timeframe['timeframe_id']);
+ $request->setParameter('start_timeframe', $timeframe);
+ $request->setParameter('end_timeframe', $timeframe);
+ }
+ }
+ elseif($actionName == "reservation_view_main_reserve_modify" ||
+ $actionName == "reservation_view_main_reserve_details") {
+ $reserve = $request->getParameter("reserve");
+ if($reserve) {
+ $start_timeframe = $reservationView->getTimeframeByStartTime($reserve['start_time']);
+ if($start_timeframe) {
+ $request->setParameter('start_timeframe_id', $start_timeframe['timeframe_id']);
+ $request->setParameter('start_timeframe', $start_timeframe);
+ }
+ $end_timeframe = $reservationView->getTimeframeByEndTime($reserve['end_time']);
+ if($end_timeframe) {
+ $request->setParameter('end_timeframe_id', $end_timeframe['timeframe_id']);
+ $request->setParameter('end_timeframe', $end_timeframe);
+ }
+ }
+ }
+ return;
+ }
+}
+?>
\ No newline at end of file
diff --git a/html/webapp/modules/reservation/validator/Validator_TimeframeListView.class.php b/html/webapp/modules/reservation/validator/Validator_TimeframeListView.class.php
new file mode 100644
index 0000000..df6e532
--- /dev/null
+++ b/html/webapp/modules/reservation/validator/Validator_TimeframeListView.class.php
@@ -0,0 +1,51 @@
+getComponent("reservationView");
+
+ $request =& $container->getComponent("Request");
+
+ $actionChain =& $container->getComponent("ActionChain");
+ $actionName = $actionChain->getCurActionName();
+
+
+ if($actionName == 'reservation_view_main_init') {
+ $divided_flag = true;
+ }
+ else {
+ $divided_flag = false;
+ }
+ $timeframe_list = $reservationView->getTimeframes($divided_flag);
+ $request->setParameter('timeframe_list', $timeframe_list);
+
+ $request->setParameter('timeframe_list_count', count($timeframe_list));
+
+ return;
+ }
+}
+?>
diff --git a/html/webapp/modules/reservation/validator/Validator_TimeframeTimetable.class.php b/html/webapp/modules/reservation/validator/Validator_TimeframeTimetable.class.php
new file mode 100644
index 0000000..13b4057
--- /dev/null
+++ b/html/webapp/modules/reservation/validator/Validator_TimeframeTimetable.class.php
@@ -0,0 +1,57 @@
+getComponent("Request");
+ $reservationView =& $container->getComponent("reservationView");
+
+ // このValidatorの前にlocationTimetable Validatorが実行されていることが前提
+
+ // 指定された時刻をGMTに修正したうえでチェック
+ $start_time = timezone_date($request->getParameter('start_time'), true, 'His');
+ $end_time = timezone_date($request->getParameter('end_time'), true, 'His');
+
+ // 0:00-24:00 の場合だけあり得る
+ if($start_time == $end_time) {
+ $end_time = strval(intval($end_time)+240000);
+ }
+
+ $ret = $reservationView->getTimeframeDuplicate($attributes['timeframe_id'], $start_time, $end_time);
+ if($ret == false) {
+ return $errStr;
+ }
+
+ // 差分チェックは入力データで行う
+ $diff = $reservationView->TimeDiff($request->getParameter('start_time'), $request->getParameter('end_time'));
+ if ($diff < RESERVATION_SELECT_MIN_TIME) {
+ return RESERVATION_ERR_TIMEFRAME_MIN_TIME;
+ }
+
+ return;
+ }
+}
+?>
\ No newline at end of file
diff --git a/html/webapp/modules/reservation/validator/Validator_TimeframeView.class.php b/html/webapp/modules/reservation/validator/Validator_TimeframeView.class.php
new file mode 100644
index 0000000..bc313f1
--- /dev/null
+++ b/html/webapp/modules/reservation/validator/Validator_TimeframeView.class.php
@@ -0,0 +1,55 @@
+getComponent("reservationView");
+
+ $request =& $container->getComponent("Request");
+
+ $actionChain =& $container->getComponent("ActionChain");
+ $actionName = $actionChain->getCurActionName();
+
+ if(!isset($attributes['timeframe_id']) || empty($attributes['timeframe_id'])) {
+ if($actionName == 'reservation_action_edit_timeframe_delete') {
+ return $errStr;
+ }
+ else {
+ // 新規追加
+ return;
+ }
+ }
+ $timeframe = $reservationView->getTimeframe($attributes['timeframe_id']);
+ if(!$timeframe) {
+ return $errStr;
+ }
+
+ $request->setParameter('timeframe', $timeframe);
+
+ return;
+ }
+}
+?>
diff --git a/html/webapp/modules/reservation/view/edit/maple.ini b/html/webapp/modules/reservation/view/edit/maple.ini
index da59ff0..7087e7a 100644
--- a/html/webapp/modules/reservation/view/edit/maple.ini
+++ b/html/webapp/modules/reservation/view/edit/maple.ini
@@ -5,6 +5,7 @@ css_tab = "comp:{$theme_name}/comp_tabset.css"
_change_display = "define:reservation_view_edit_style_init"
reservation_location_manage = "_user_auth_id==_AUTH_ADMIN->commonCls.sendView('<{$id}>','reservation_view_edit_location_init');"
reservation_location_add = "_user_auth_id==_AUTH_ADMIN->commonCls.sendView('<{$id}>','reservation_view_edit_location_add');"
+reservation_timeframe = "_user_auth_id==_AUTH_ADMIN->commonCls.sendView('<{$id}>','reservation_view_edit_timeframe');"
reservation_mail = "_user_auth_id==_AUTH_ADMIN->commonCls.sendView('<{$id}>','reservation_view_edit_mail');"
reservation_csv_import = "_user_auth_id==_AUTH_ADMIN->commonCls.sendView('<{$id}>','reservation_view_edit_import_init');"
_edit_design = "define:_EDIT_DESIGN_METHOD"
diff --git a/html/webapp/modules/reservation/view/edit/style/init/Init.class.php b/html/webapp/modules/reservation/view/edit/style/init/Init.class.php
index 53b0cea..c734ce5 100644
--- a/html/webapp/modules/reservation/view/edit/style/init/Init.class.php
+++ b/html/webapp/modules/reservation/view/edit/style/init/Init.class.php
@@ -20,6 +20,7 @@ class Reservation_View_Edit_Style_Init extends Action
var $location_count = null;
var $reserve_block = null;
var $location_count_list = null;
+ var $timeframe_list_count = null;
/**
* execute処理
diff --git a/html/webapp/modules/reservation/view/edit/style/init/maple.ini b/html/webapp/modules/reservation/view/edit/style/init/maple.ini
index 548a74a..88730d1 100644
--- a/html/webapp/modules/reservation/view/edit/style/init/maple.ini
+++ b/html/webapp/modules/reservation/view/edit/style/init/maple.ini
@@ -1,6 +1,9 @@
[HeaderMenu]
1,_change_display = "define:auto"
+[SmartyAssign::reservationStyleAssign]
+global = timezone.ini
+
[AllowIdList]
room_id_arr = "ALLOW_ROOM_ID"
@@ -10,6 +13,7 @@ key:block_id.reservation.block:g = "1:lang._invalid_input"
key:reserve_block,location_count.reservation.locationExists:g = "1:lang.reservation_nolocation"
key:reserve_block,category_list.reservation.categoryView:g = "1:lang._invalid_input"
key:reserve_block.reservation.locationView:g = "1:lang._invalid_input"
+.reservation.TimeframeListView = "1:lang._invalid_input"
[View]
define:theme = 1
diff --git a/html/webapp/modules/reservation/view/edit/timeframe/Timeframe.class.php b/html/webapp/modules/reservation/view/edit/timeframe/Timeframe.class.php
new file mode 100644
index 0000000..5c1cc5f
--- /dev/null
+++ b/html/webapp/modules/reservation/view/edit/timeframe/Timeframe.class.php
@@ -0,0 +1,36 @@
+configView->getConfigByConfname($this->module_id, 'timeframe_color');
+ if($config) {
+ $this->timeframe_colors = explode('|', $config['conf_value']);
+ }
+
+ $this->timezone_list = explode("|", RESERVATION_DEF_TIMEZONE);
+
+ $this->week_list = $this->reservationView->getLocationWeekArray();
+
+ return 'success';
+ }
+}
\ No newline at end of file
diff --git a/html/webapp/modules/reservation/view/edit/timeframe/entry/maple.ini b/html/webapp/modules/reservation/view/edit/timeframe/entry/maple.ini
new file mode 100644
index 0000000..a0a305e
--- /dev/null
+++ b/html/webapp/modules/reservation/view/edit/timeframe/entry/maple.ini
@@ -0,0 +1,10 @@
+[HeaderMenu]
+mode = "nobuild"
+
+[ValidateDef]
+key:timeframe_id.reservation.TimeframeView = "1:lang._invalid_input"
+
+
+[View]
+define:theme_name = "system"
+success = "reservation_view_edit_timeframe_entry.html"
\ No newline at end of file
diff --git a/html/webapp/modules/reservation/view/edit/timeframe/maple.ini b/html/webapp/modules/reservation/view/edit/timeframe/maple.ini
new file mode 100644
index 0000000..739bcba
--- /dev/null
+++ b/html/webapp/modules/reservation/view/edit/timeframe/maple.ini
@@ -0,0 +1,17 @@
+[SmartyAssign::reservationTimeframeAssign]
+global = timezone.ini
+
+[ValidateDef]
+authcheck = "1,_user_auth_id==_AUTH_ADMIN:lang._invalid_auth"
+.reservation.TimeframeListView = "1:lang._invalid_input"
+
+[HeaderMenu]
+1,reservation_timeframe = "define:auto"
+
+[Action]
+configView = "ref:configView"
+reservationView = "ref:reservationView"
+
+[View]
+define:theme = 1
+success = "reservation_view_edit_timeframe.html"
diff --git a/html/webapp/modules/reservation/view/main/init/Init.class.php b/html/webapp/modules/reservation/view/main/init/Init.class.php
index ea49c6c..f93584f 100644
--- a/html/webapp/modules/reservation/view/main/init/Init.class.php
+++ b/html/webapp/modules/reservation/view/main/init/Init.class.php
@@ -50,6 +50,9 @@ class Reservation_View_Main_Init extends Action
var $prev_day = null;
var $input_date = null;
+ var $timeframe_list = null;
+ var $timeframe_list_count = null;
+
/**
* execute実行
*
@@ -64,7 +67,7 @@ function execute()
if ($this->location_count == 0) {
return 'noLocation';
}
-
+
switch ($this->reserve_block["display_type"]) {
case RESERVATION_DEF_MONTHLY:
return 'successMonthly';
diff --git a/html/webapp/modules/reservation/view/main/init/maple.ini b/html/webapp/modules/reservation/view/main/init/maple.ini
index 12b010f..0d14393 100644
--- a/html/webapp/modules/reservation/view/main/init/maple.ini
+++ b/html/webapp/modules/reservation/view/main/init/maple.ini
@@ -1,3 +1,6 @@
+[SmartyAssign::reservationInitAssign]
+global = timezone.ini
+
[AllowIdList]
room_id_arr = "ALLOW_ROOM_ID"
@@ -13,6 +16,7 @@ key:category_list.reservation.categoryView:g = "1:lang.reservation_no_category"
key:category_id.reservation.locationView:g = "1:lang.reservation_select_nolocation"
key:start_date,end_date.reservation.holidayView:g = "1:lang.reservation_error_holiday"
key:start_date,end_date.reservation.reserveView:g = "1:lang.reservation_error_reserve"
+.reservation.TimeframeListView:g = "1:lang._invalid_input"
[Action]
session = "ref:Session"
diff --git a/html/webapp/modules/reservation/view/main/reserve/add/Add.class.php b/html/webapp/modules/reservation/view/main/reserve/add/Add.class.php
index 1b18cfe..ea82db5 100644
--- a/html/webapp/modules/reservation/view/main/reserve/add/Add.class.php
+++ b/html/webapp/modules/reservation/view/main/reserve/add/Add.class.php
@@ -29,6 +29,11 @@ class Reservation_View_Main_Reserve_Add extends Action
var $location_list = null;
var $location_count = null;
var $location_count_list = null;
+ var $reserve_block = null;
+ var $timeframe_list = null;
+ var $timeframe_list_count = null;
+ var $start_timeframe_id = null;
+ var $end_timeframe_id = null;
// Filterから受け取るため
var $room_arr = null;
diff --git a/html/webapp/modules/reservation/view/main/reserve/add/maple.ini b/html/webapp/modules/reservation/view/main/reserve/add/maple.ini
index b59c882..08b162f 100644
--- a/html/webapp/modules/reservation/view/main/reserve/add/maple.ini
+++ b/html/webapp/modules/reservation/view/main/reserve/add/maple.ini
@@ -8,8 +8,11 @@ room_arr = "ALLOW_ROOM_ARR"
room_id_arr = "ALLOW_ROOM_ID"
[ValidateDef]
+.reservation.TimeframeListView = "1:lang._invalid_input"
reserve_date.date:g = "1:lang._invalid_date,lang.reservation_reserve_time"
key:date.reservation.date:g = "1:lang._invalid_input"
+key:block_id.reservation.block:g = "1:lang._invalid_input"
+key:timeframe_id.reservation.timeframeAdjustment:g = "1:lang._invalid_input"
key:time,start_hour,start_minute.reservation.time:g = "1:lang.reservation_reserve_time"
key:time,end_hour,end_minute.reservation.time:g = "1:lang.reservation_reserve_time"
key:location_id.reservation.locationExists = "1:lang._invalid_input"
diff --git a/html/webapp/modules/reservation/view/main/reserve/details/Details.class.php b/html/webapp/modules/reservation/view/main/reserve/details/Details.class.php
index 4ddb6a5..26adf50 100644
--- a/html/webapp/modules/reservation/view/main/reserve/details/Details.class.php
+++ b/html/webapp/modules/reservation/view/main/reserve/details/Details.class.php
@@ -17,6 +17,9 @@ class Reservation_View_Main_Reserve_Details extends Action
// validatorから受け取るため
var $reserve = null;
var $rrule_reserve_id = null;
+ var $reserve_block = null;
+ var $start_timeframe = null;
+ var $end_timeframe = null;
/**
* execute実行
diff --git a/html/webapp/modules/reservation/view/main/reserve/details/maple.ini b/html/webapp/modules/reservation/view/main/reserve/details/maple.ini
index 0ff8a8e..042a766 100644
--- a/html/webapp/modules/reservation/view/main/reserve/details/maple.ini
+++ b/html/webapp/modules/reservation/view/main/reserve/details/maple.ini
@@ -8,6 +8,8 @@ room_id_arr = "ALLOW_ROOM_ID"
key:reserve_id.reservation.reserveExists:g = "1:lang._invalid_auth"
key:reserve_id.reservation.reserveView:g = "1:lang._invalid_auth"
key:location_id.reservation.locationExists:g = "1:lang._invalid_auth"
+key:block_id.reservation.block:g = "1:lang._invalid_input"
+.reservation.timeframeAdjustment:g = "1:lang._invalid_input"
[Action]
reservationView = "ref:reservationView"
diff --git a/html/webapp/modules/reservation/view/main/reserve/modify/Modify.class.php b/html/webapp/modules/reservation/view/main/reserve/modify/Modify.class.php
index a70db48..1dd042c 100644
--- a/html/webapp/modules/reservation/view/main/reserve/modify/Modify.class.php
+++ b/html/webapp/modules/reservation/view/main/reserve/modify/Modify.class.php
@@ -22,10 +22,15 @@ class Reservation_View_Main_Reserve_Modify extends Action
var $location = null;
var $allow_add_rooms = null;
var $category_list = null;
+ var $reserve_block = null;
var $location_id = null;
var $location_list = null;
var $location_count = null;
var $location_count_list = null;
+ var $timeframe_list = null;
+ var $timeframe_list_count = null;
+ var $start_timeframe_id = null;
+ var $end_timeframe_id = null;
// Filterから受け取るため
var $room_arr = null;
diff --git a/html/webapp/modules/reservation/view/main/reserve/modify/maple.ini b/html/webapp/modules/reservation/view/main/reserve/modify/maple.ini
index f569159..793693e 100644
--- a/html/webapp/modules/reservation/view/main/reserve/modify/maple.ini
+++ b/html/webapp/modules/reservation/view/main/reserve/modify/maple.ini
@@ -13,6 +13,9 @@ key:reserve_id.reservation.reserveView:g = "1:lang._invalid_auth"
key:location_id.reservation.locationExists:g = "1:lang._invalid_auth"
key:category_list.reservation.categoryView:g = "1:lang.reservation_no_category"
key:category_id,location_id.reservation.locationView:g = "1:lang.reservation_select_nolocation"
+key:block_id.reservation.block:g = "1:lang._invalid_input"
+.reservation.TimeframeListView = "1:lang._invalid_input"
+.reservation.timeframeAdjustment:g = "1:lang._invalid_input"
[HeaderInc]
textarea_css = "comp:{$theme_name}/comp_textarea.css"
From 964f92a83bb337380bb7b4d0d826128d999eb1bc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=89=9F=E7=94=B0=E5=8F=A3=E3=80=80=E6=BA=80?=
Date: Wed, 17 Jul 2013 10:54:48 +0900
Subject: [PATCH 45/61] =?UTF-8?q?=E4=BC=9A=E5=93=A1=E7=99=BB=E9=8C=B2?=
=?UTF-8?q?=E3=81=A7=E6=80=A7=E5=88=A5=E3=82=92=E5=BF=85=E9=A0=88=E3=81=AB?=
=?UTF-8?q?=E3=81=97=E3=81=9F=E6=99=82=E3=81=AE=E3=82=A8=E3=83=A9=E3=83=BC?=
=?UTF-8?q?=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8=E4=BF=AE=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
エラーメッセージが「7:性別を入力してください。」
→「性別を入力してください。」になるように修正
---
html/webapp/modules/login/files/js/default/login.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/html/webapp/modules/login/files/js/default/login.js b/html/webapp/modules/login/files/js/default/login.js
index 42f0be6..3aa4d46 100644
--- a/html/webapp/modules/login/files/js/default/login.js
+++ b/html/webapp/modules/login/files/js/default/login.js
@@ -92,7 +92,7 @@ clsLogin.prototype = {
commonCls.alert(alert_res);
commonCls.focus(focus_el);
} else {
- commonCls.alert(res);
+ commonCls.alert(alert_res);
}
} else {
commonCls.alert(res);
From 6b0dc5af2af6928bc717e63b3a57577fe5beffce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=89=9F=E7=94=B0=E5=8F=A3=E3=80=80=E6=BA=80?=
Date: Wed, 17 Jul 2013 11:23:52 +0900
Subject: [PATCH 46/61] =?UTF-8?q?#80=20=E4=BD=B5=E3=81=9B=E3=81=A6?=
=?UTF-8?q?=E4=BC=9A=E5=93=A1=E7=AE=A1=E7=90=86=E3=81=8B=E3=82=89=E3=81=AE?=
=?UTF-8?q?=E4=BC=9A=E5=93=A1=E7=99=BB=E9=8C=B2=E6=99=82=E3=81=AE=E5=90=8C?=
=?UTF-8?q?=E6=A7=98=E3=81=AE=E4=B8=8D=E5=82=99=E3=82=92=E4=BF=AE=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
html/webapp/modules/user/files/js/default/user.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/html/webapp/modules/user/files/js/default/user.js b/html/webapp/modules/user/files/js/default/user.js
index 63990a9..67014b6 100644
--- a/html/webapp/modules/user/files/js/default/user.js
+++ b/html/webapp/modules/user/files/js/default/user.js
@@ -624,7 +624,7 @@ clsUser.prototype = {
focus_el.focus();
if(focus_el.type == "text") focus_el.select();
} else {
- commonCls.alert(res);
+ commonCls.alert(alert_res);
}
} else {
commonCls.alert(res);
From 2706aa29d22af760eb6737a4ec9452d7c55dd5a1 Mon Sep 17 00:00:00 2001
From: Rika Fujiwara
Date: Thu, 18 Jul 2013 17:32:07 +0900
Subject: [PATCH 47/61] =?UTF-8?q?=E3=83=AB=E3=83=BC=E3=83=A0=E7=AE=A1?=
=?UTF-8?q?=E7=90=86=E6=A9=9F=E8=83=BD=E3=81=AB=E6=A8=A9=E9=99=90=E8=A8=AD?=
=?UTF-8?q?=E5=AE=9A=E3=81=AECSV=E3=82=A8=E3=82=AF=E3=82=B9=E3=83=9D?=
=?UTF-8?q?=E3=83=BC=E3=83=88=E6=A9=9F=E8=83=BD=E3=81=A8=E3=82=A4=E3=83=B3?=
=?UTF-8?q?=E3=83=9D=E3=83=BC=E3=83=88=E6=A9=9F=E8=83=BD=E3=82=92=E8=BF=BD?=
=?UTF-8?q?=E5=8A=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../room/action/admin/export/Export.class.php | 79 +++++
.../room/action/admin/export/maple.ini | 21 ++
.../admin/import/confirm/Confirm.class.php | 203 +++++++++++++
.../action/admin/import/confirm/dicon.ini | 3 +
.../action/admin/import/confirm/maple.ini | 30 ++
.../modules/room/components/View.class.php | 204 +++++++++++++
html/webapp/modules/room/config/main.ini | 9 +-
.../modules/room/files/css/default/style.css | 54 +++-
html/webapp/modules/room/files/js/room.js | 85 ++++++
.../modules/room/language/chinese/main.ini | 65 +++-
.../modules/room/language/english/main.ini | 65 +++-
.../modules/room/language/japanese/main.ini | 65 +++-
.../room_action_admin_import_confirm.html | 55 ++++
.../default/room_view_admin_import.html | 98 +++++++
.../room_view_admin_import_confirm.html | 68 +++++
.../room_view_admin_regist_selectusers.html | 8 +
.../default/room_view_admin_roomlist.html | 6 +
.../Validator_ImportRoomIdCheck.class.php | 55 ++++
.../room/view/admin/export/Export.class.php | 168 +++++++++++
.../modules/room/view/admin/export/dicon.ini | 3 +
.../modules/room/view/admin/export/maple.ini | 26 ++
.../room/view/admin/import/Import.class.php | 85 ++++++
.../admin/import/confirm/Confirm.class.php | 60 ++++
.../room/view/admin/import/confirm/maple.ini | 8 +
.../modules/room/view/admin/import/maple.ini | 20 ++
.../view/admin/import/upload/Upload.class.php | 277 ++++++++++++++++++
.../room/view/admin/import/upload/dicon.ini | 4 +
.../room/view/admin/import/upload/maple.ini | 24 ++
.../regist/selectusers/Selectusers.class.php | 17 +-
29 files changed, 1858 insertions(+), 7 deletions(-)
create mode 100644 html/webapp/modules/room/action/admin/export/Export.class.php
create mode 100644 html/webapp/modules/room/action/admin/export/maple.ini
create mode 100644 html/webapp/modules/room/action/admin/import/confirm/Confirm.class.php
create mode 100644 html/webapp/modules/room/action/admin/import/confirm/dicon.ini
create mode 100644 html/webapp/modules/room/action/admin/import/confirm/maple.ini
create mode 100644 html/webapp/modules/room/components/View.class.php
create mode 100644 html/webapp/modules/room/templates/default/room_action_admin_import_confirm.html
create mode 100644 html/webapp/modules/room/templates/default/room_view_admin_import.html
create mode 100644 html/webapp/modules/room/templates/default/room_view_admin_import_confirm.html
create mode 100644 html/webapp/modules/room/validator/Validator_ImportRoomIdCheck.class.php
create mode 100644 html/webapp/modules/room/view/admin/export/Export.class.php
create mode 100644 html/webapp/modules/room/view/admin/export/dicon.ini
create mode 100644 html/webapp/modules/room/view/admin/export/maple.ini
create mode 100644 html/webapp/modules/room/view/admin/import/Import.class.php
create mode 100644 html/webapp/modules/room/view/admin/import/confirm/Confirm.class.php
create mode 100644 html/webapp/modules/room/view/admin/import/confirm/maple.ini
create mode 100644 html/webapp/modules/room/view/admin/import/maple.ini
create mode 100644 html/webapp/modules/room/view/admin/import/upload/Upload.class.php
create mode 100644 html/webapp/modules/room/view/admin/import/upload/dicon.ini
create mode 100644 html/webapp/modules/room/view/admin/import/upload/maple.ini
diff --git a/html/webapp/modules/room/action/admin/export/Export.class.php b/html/webapp/modules/room/action/admin/export/Export.class.php
new file mode 100644
index 0000000..37a03ab
--- /dev/null
+++ b/html/webapp/modules/room/action/admin/export/Export.class.php
@@ -0,0 +1,79 @@
+>ルーム一覧>>参加者修正>>エクスポート>>準備
+ *
+ * @package NetCommons
+ * @author Noriko Arai,Ryuji Masukawa
+ * @copyright 2006-2007 NetCommons Project
+ * @license http://www.netcommons.org/license.txt NetCommons License
+ * @project NetCommons Project, supported by National Institute of Informatics
+ * @access public
+ */
+
+class Room_Action_Admin_Export extends Action
+{
+ // リクエストパラメータをセットするため
+ var $parent_page_id = null;
+ var $edit_current_page_id = null;
+
+ // VAlidatorでセット
+ var $page = null;
+
+ // 使用コンポーネントを受け取るため
+ var $session = null;
+ var $db = null;
+ var $actionChain = null;
+
+
+ // 値をセットするため
+
+ /**
+ * execute実行
+ *
+ * @access public
+ */
+ function execute()
+ {
+ $this->session->setParameter(array('room', 'export', 'current_page_id'), $this->edit_current_page_id);
+ $this->session->setParameter(array('room', 'export', 'current_page_name'), $this->page['page_name']);
+
+ $select_str =& $this->session->getParameter(array('room', $this->edit_current_page_id, 'selected_select_str'));
+ $from_str =& $this->session->getParameter(array('room', $this->edit_current_page_id, 'selected_from_str'));
+ $add_from_str =& $this->session->getParameter(array('room', $this->edit_current_page_id, 'selected_add_from_str'));
+ $where_str =& $this->session->getParameter(array('room', $this->edit_current_page_id, 'selected_where_str'));
+ $add_where_str =& $this->session->getParameter(array('room', $this->edit_current_page_id,'selected_add_where_str'));
+ $export_add_where_str = ' AND {authorities}.user_authority_id != ?';
+ $params =& $this->session->getParameter(array('room', $this->edit_current_page_id, 'selected_params'));
+ $from_params =& $this->session->getParameter(array('room', $this->edit_current_page_id, 'selected_from_params'));
+ $where_params =& $this->session->getParameter(array('room', $this->edit_current_page_id, 'selected_where_params'));
+ if(!is_array($from_params)) $from_params = array();
+ if(!is_array($where_params)) $where_params = array();
+
+ $export_where_params = array(_AUTH_ADMIN);
+
+ $sql_params = array_merge((array)$params, (array)$from_params, (array)$where_params, (array)$export_where_params);
+
+ $sql = $select_str.$from_str.$add_from_str.$where_str.$add_where_str.$export_add_where_str;
+
+ //
+ // レコード数取得
+ //
+ $count_sql = 'SELECT COUNT(*) FROM (' . $select_str.$from_str.$add_from_str.$where_str.$add_where_str.$export_add_where_str . ') AS T';
+ $count_result =& $this->db->execute($count_sql, $sql_params, null, null, false);
+ if($count_result === false) {
+ $this->db->addError();
+ return 'error';
+ }
+
+ $data_count = intval($count_result[0][0]);
+ if($data_count == 0) {
+ $errorList =& $this->actionChain->getCurErrorList();
+ $errorList->add(get_class($this), ROOM_EXPORT_NONE);
+ return 'error';
+ }
+
+ return 'success';
+ }
+}
+?>
\ No newline at end of file
diff --git a/html/webapp/modules/room/action/admin/export/maple.ini b/html/webapp/modules/room/action/admin/export/maple.ini
new file mode 100644
index 0000000..f5ba385
--- /dev/null
+++ b/html/webapp/modules/room/action/admin/export/maple.ini
@@ -0,0 +1,21 @@
+[TokenExtra::TokenExtraExport]
+mode="check"
+action = "room_view_admin_regist_selectusers"
+
+[ValidateDef]
+parent_page_id.required ="1:lang._invalid_input"
+edit_current_page_id.required ="1:lang._invalid_input"
+parent_page_id,edit_current_page_id.room.RoomRegist = "1,export:lang._invalid_input"
+
+[Action]
+session = "ref:Session"
+db = "ref:DbObject"
+actionChain = "ref:ActionChain"
+
+
+[View]
+define:theme = 0
+success = "main:true.html"
+;success = "location:room_view_admin_export"
+;success = "location_script:"
+error = "main:error.html"
diff --git a/html/webapp/modules/room/action/admin/import/confirm/Confirm.class.php b/html/webapp/modules/room/action/admin/import/confirm/Confirm.class.php
new file mode 100644
index 0000000..d2bd4f6
--- /dev/null
+++ b/html/webapp/modules/room/action/admin/import/confirm/Confirm.class.php
@@ -0,0 +1,203 @@
+authoritiesView->getAuthorities(array('(system_flag ='. _ON . ' OR user_authority_id = '. _AUTH_MODERATE. ') AND user_authority_id != '. _AUTH_ADMIN => null));
+ $this->authorities = array();
+ foreach($tmp_authorities as $a) {
+ $a['new_total'] = 0;
+ $a['added_num'] = 0;
+ $this->authorities[$a['role_authority_id']] = $a;
+ }
+
+ $errorList =& $this->actionChain->getCurErrorList();
+ $warn_cnt = 0;
+
+ // 不要セッション情報初期化
+ $this->session->removeParameter(array('room', 'import', 'count'));
+ $this->session->removeParameter(array('room', 'import', 'warn'));
+
+ // メンバ変数初期化
+ $this->added_auth_member_num = array();
+ $this->total_auth_member_num = array();
+ $this->deleted_auth_member_num = 0;
+
+ // デフォルト参加権限定義情報を取得しておきます
+ $config = $this->configView->getConfigByCatid(_SYS_CONF_MODID, _GENERAL_CONF_CATID);
+ if($this->page['default_entry_flag'] == _OFF) {
+ $default_role_auth = _ROLE_AUTH_OTHER;
+ }
+ else {
+ if($this->page['space_type'] == _SPACE_TYPE_PUBLIC) {
+ $default_role_auth = $config['default_entry_role_auth_public']['conf_value'];
+ }
+ else {
+ $default_role_auth = $config['default_entry_role_auth_group']['conf_value'];
+ }
+ }
+
+ // 変更ユーザ情報、対象ルームユーザ情報取得
+ $change_users = $this->session->getParameter(array('room', 'import', 'data'));
+ $users = $this->roomView->getRoomUsersList($this->page, $this->parent_page, $this->authorities);
+
+ $my_handle = $this->session->getParameter('_handle');
+
+ foreach($change_users as $handle=>$new_auth) {
+ // 対象者が存在しない会員だった
+ // 管理者権限だった
+ // 自分だった
+ // 警告追加&スキップ
+ if($handle==$my_handle
+ || !isset($users[$handle])
+ || $users[$handle]['user_authority_id'] == _AUTH_ADMIN ) {
+ $this->session->setParameter(array('room', 'import', 'warn', $warn_cnt++), $handle);// 警告追加しスキップ
+ continue;
+ }
+ $where_params = array(
+ 'room_id' => $this->edit_current_page_id,
+ 'user_id' => $users[$handle]['user_id']
+ );
+ $ins_params = array(
+ 'room_id' => $this->edit_current_page_id,
+ 'user_id' => $users[$handle]['user_id'],
+ 'role_authority_id' => $new_auth,
+ 'createroom_flag' => _OFF
+ );
+ $upd_params = array(
+ 'role_authority_id' => $new_auth
+ );
+ $del_upd_params = array(
+ 'role_authority_id' => $new_auth,
+ 'createroom_flag' => _OFF
+ );
+
+ // 不参加に
+ if($new_auth == _ROLE_AUTH_OTHER) {
+ if($default_role_auth==$new_auth) {
+ $resultPageUserLink = $this->pagesAction->delPageUsersLink($where_params);
+ }
+ else {
+ if($users[$handle]['createroom_flag']==_OFF && $users[$handle]['authority_id']==$default_role_auth) {
+ $resultPageUserLink = $this->pagesAction->insPageUsersLink($ins_params);
+ }
+ else {
+ $resultPageUserLink = $this->pagesAction->updPageUsersLink($del_upd_params, $where_params);
+ }
+ }
+
+ // 対象が親ルームの場合は、全てのサブルームからも削除
+ if($this->page['space_type']!=_SPACE_TYPE_PUBLIC && $this->page['thread_num']==1) {
+ $subroom_where_params = array($this->edit_current_page_id, $users[$handle]['user_id']);
+ $sql = ' DELETE FROM {pages_users_link} WHERE room_id IN (SELECT page_id FROM {pages} WHERE parent_id=? AND page_id=room_id) AND user_id = ?';
+ $this->db->execute($sql, $subroom_where_params);
+ }
+ if($resultPageUserLink) {
+ $this->deleted_auth_member_num++;
+ }
+ }
+ // 権限変更
+ else {
+ if(!isset($users[$handle]['permitted_auth'][$new_auth])
+ || $users[$handle]['permitted_auth'][$new_auth]==_OFF) {
+ $this->session->setParameter(array('room', 'import', 'warn', $warn_cnt++), $handle);// 警告追加しスキップ
+ continue;
+ }
+ // デフォルト権限での参加に変更
+ if($new_auth==$default_role_auth) {
+ // しかし現状ルーム作成権限がON
+ if($users[$handle]['createroom_flag']==_ON) {
+ // ならばUPDATEでレコード温存
+ $resultPageUserLink = $this->pagesAction->updPageUsersLink($upd_params, $where_params);
+ }
+ // ルーム作成権限OFF
+ else {
+ // ならばレコード削除
+ $resultPageUserLink = $this->pagesAction->delPageUsersLink($where_params);
+ }
+ }
+ else {
+ if($users[$handle]['authority_id']==$default_role_auth) {
+ // しかし現状ルーム作成権限がON
+ if($users[$handle]['createroom_flag']==_ON) {
+ // ならば既にレコードあり。UPDATE
+ $resultPageUserLink = $this->pagesAction->updPageUsersLink($upd_params, $where_params);
+ }
+ else {
+ $resultPageUserLink = $this->pagesAction->insPageUsersLink($ins_params);
+ }
+ }
+ else {
+ $resultPageUserLink = $this->pagesAction->updPageUsersLink($upd_params, $where_params);
+ }
+ }
+ if($resultPageUserLink) {
+ $this->authorities[$new_auth]['added_num']++;
+ }
+ }
+ if($resultPageUserLink) {
+ $users[$handle]['authority_id'] = $new_auth;
+ }
+ else {
+ $this->session->setParameter(array('room', 'import', 'warn', $warn_cnt++), $handle);// 警告追加しスキップ
+ }
+ }
+
+ foreach($users as $handle=>$user) {
+ if(!isset($this->authorities[$user['authority_id']])) {
+ continue;
+ }
+ $this->authorities[$user['authority_id']]['new_total']++;
+ }
+
+ foreach($this->authorities as $a) {
+ $this->added_auth_member_num[$a['role_authority_name']] = $a['added_num'];
+ $this->total_auth_member_num[$a['role_authority_name']] = $a['new_total'];
+ }
+ return 'success';
+ }
+}
\ No newline at end of file
diff --git a/html/webapp/modules/room/action/admin/import/confirm/dicon.ini b/html/webapp/modules/room/action/admin/import/confirm/dicon.ini
new file mode 100644
index 0000000..fc26ae6
--- /dev/null
+++ b/html/webapp/modules/room/action/admin/import/confirm/dicon.ini
@@ -0,0 +1,3 @@
+[DIContainer]
+roomView = "modules://room.components.view"
+pagesAction = "pages.Action"
diff --git a/html/webapp/modules/room/action/admin/import/confirm/maple.ini b/html/webapp/modules/room/action/admin/import/confirm/maple.ini
new file mode 100644
index 0000000..75da971
--- /dev/null
+++ b/html/webapp/modules/room/action/admin/import/confirm/maple.ini
@@ -0,0 +1,30 @@
+[DIContainer]
+filename_import = "dicon.ini"
+
+[TokenExtra]
+mode="check"
+action="room_view_admin_import_confirm"
+
+[ValidateDef]
+authcheck = "1,_auth_id>=_AUTH_CHEIF:lang._invalid_auth"
+parent_page_id,edit_current_page_id.room.ImportRoomIdCheck = "1:lang._invalid_input"
+parent_page_id.required ="1:lang._invalid_input"
+edit_current_page_id.required ="1:lang._invalid_input"
+parent_page_id,edit_current_page_id.room.RoomRegist = "1,export:lang._invalid_input"
+
+[Action]
+session = "ref:Session"
+configView = "ref:configView"
+usersView = "ref:usersView"
+pagesView = "ref:pagesView"
+pagesAction = "ref:pagesAction"
+roomView = "ref:roomView"
+authoritiesView = "ref:authoritiesView"
+actionChain = "ref:ActionChain"
+db = "ref:DbObject"
+
+[View]
+define:theme = 1
+success = "room_action_admin_import_confirm.html"
+error = "main:error.html"
+
diff --git a/html/webapp/modules/room/components/View.class.php b/html/webapp/modules/room/components/View.class.php
new file mode 100644
index 0000000..29eec87
--- /dev/null
+++ b/html/webapp/modules/room/components/View.class.php
@@ -0,0 +1,204 @@
+_container =& DIContainerFactory::getContainer();
+ $this->_db =& $this->_container->getComponent("DbObject");
+ $this->_session =& $this->_container->getComponent("Session");
+ $this->_authoritiesView =& $this->_container->getComponent("authoritiesView");
+ $this->_configView =& $this->_container->getComponent("configView");
+ }
+ /**
+ * ルーム内参加可能者一覧、およびそれらの人物へ与えているロール権限、そして権限設定可能上限
+ *
+ * @access public
+ */
+ function &getRoomUsersList($page, $parent_page, $authorities)
+ {
+ $subroom_flag = false;
+ $edit_current_page_id = $page['page_id'];
+ $parent_page_id = $parent_page['page_id'];
+ if($edit_current_page_id != _SELF_TOPPUBLIC_ID && $parent_page['thread_num']==1) {
+ $subroom_flag = true;
+ }
+ $space_type = $page['space_type'];
+ // 親ページがない=パブリックスペースTOP
+ // このときはcreateroom_flag設定による権限以上の権限取得の抜け駆け禁止
+ if($space_type == _SPACE_TYPE_PUBLIC && $page['thread_num'] == 0) {
+ $public_top_page_flag = _ON;
+ }
+ else {
+ $public_top_page_flag = _OFF;
+ }
+
+ $default_entry_flag = $page['default_entry_flag'];
+
+ $config = $this->_configView->getConfigByCatid(_SYS_CONF_MODID, _GENERAL_CONF_CATID);
+ if($config == false) {
+ return false;
+ }
+ $default_entry_role_auth_public = $config['default_entry_role_auth_public']['conf_value'];
+ $default_entry_role_auth_group = $config['default_entry_role_auth_group']['conf_value'];
+
+
+ $params = array();
+ $select_str = 'SELECT {users}.user_id, {users}.handle, '.
+ '{authorities}.user_authority_id,'.
+ '{authorities}.role_authority_id,'.
+ '{authorities}.public_createroom_flag,'.
+ '{authorities}.group_createroom_flag,'.
+ '{authorities}.hierarchy,'.
+ '{pages_users_link}.role_authority_id AS authority_id,'.
+ '{pages_users_link}.createroom_flag';
+
+ $from_str = ' FROM {authorities}, {users}'.
+ ' LEFT JOIN {pages_users_link} ON {pages_users_link}.room_id='.$edit_current_page_id.
+ ' AND {users}.user_id={pages_users_link}.user_id ';
+
+ $where_str = ' WHERE {users}.role_authority_id={authorities}.role_authority_id';
+
+ if($parent_page['thread_num'] >= 1) {
+ //親ルームに参加している会員すべて(サブグループ作成)
+ if($parent_page['default_entry_flag']) {
+ $where_str .= ' AND {users}.user_id NOT IN (SELECT user_id FROM {pages_users_link} WHERE room_id =' . $parent_page_id . ' AND role_authority_id = ' . _ROLE_AUTH_OTHER . ')';
+ }
+ else {
+ $where_str .= ' AND {users}.user_id IN (SELECT user_id FROM {pages_users_link} WHERE room_id =' . $parent_page_id . ')';
+ }
+ }
+ $sql = $select_str . $from_str . $where_str;
+ $users =& $this->_db->execute($sql, $params, null, null, true,
+ array($this, '_usersFetchCallback'),
+ array($subroom_flag, $space_type, $default_entry_flag, $default_entry_role_auth_public, $default_entry_role_auth_group, $authorities, $public_top_page_flag));
+ return $users;
+ }
+ /**
+ * fetch時コールバックメソッド
+ * @param result adodb object
+ * @return array items
+ * @access private
+ */
+ function &_roomusersFetchcallback($result)
+ {
+ $ret = array();
+ while ($row = $result->fetchRow()) {
+ $ret[$row['user_id']] = $row;
+ }
+ return $ret;
+ }
+ /**
+ * fetch時コールバックメソッド
+ * @param result adodb object
+ * @return array items
+ * @access private
+ */
+ function &_usersFetchcallback($result, $params)
+ {
+ $subroom_flag = $params[0];
+ $space_type = $params[1];
+ $default_entry_flag = $params[2];
+ $default_entry_role_auth_public = $params[3];
+ $default_entry_role_auth_group = $params[4];
+ $authorities = $params[5];
+ $public_top_page_flag = $params[6];
+
+ $auth = array();
+ foreach($authorities as $a) {
+ $auth[$a['role_authority_id']] = $a;
+ }
+
+ $ret = array();
+
+ while ($row = $result->fetchRow()) {
+ // createroom_flag がONでも、該当のページがパブリックスペースのTOPのときは有効にならない!
+ if(($public_top_page_flag==_OFF && $row['createroom_flag']==_ON) || ($public_top_page_flag==_OFF && $space_type==_SPACE_TYPE_PUBLIC && $row['public_createroom_flag']==_ON) || ($space_type==_SPACE_TYPE_GROUP && $row['group_createroom_flag']==_ON)) {
+ $createroom_flag =_ON;
+ }
+ else {
+ $createroom_flag =_OFF;
+ }
+ // authがNULLのとき デフォルト権限を意味する
+ if(is_null($row['authority_id'])) {
+ if($default_entry_flag==_OFF) {
+ $row['authority_id'] = _ROLE_AUTH_OTHER;
+ }
+ else {
+ if($space_type==_SPACE_TYPE_PUBLIC) {
+ $row['authority_id'] = $default_entry_role_auth_public;
+ }
+ else {
+ $row['authority_id'] = $default_entry_role_auth_group;
+ }
+ }
+ }
+
+ $row_auth = array();
+ foreach($auth as $auth_id=>$a) {
+
+ $row_auth[$auth_id] = false;
+
+ if($subroom_flag == true) { // サブルームであれば誰でも何にでもなれる
+ $row_auth[$auth_id] = true;
+ }
+ else {
+ if($auth_id==_ROLE_AUTH_CHIEF) {
+ if($row['hierarchy'] >=_HIERARCHY_CHIEF || ($row['authority_id'] == _ROLE_AUTH_ADMIN || $row['authority_id'] == _ROLE_AUTH_CHIEF) || $createroom_flag==_ON) {
+ $row_auth[$auth_id] = true;
+ }
+ }
+ else if($auth_id==_ROLE_AUTH_GENERAL) {
+ if($row['hierarchy'] >=_HIERARCHY_GENERAL || ($row['authority_id'] == _ROLE_AUTH_GENERAL) || $createroom_flag==_ON) {
+ $row_auth[$auth_id] = true;
+ }
+ }
+ else if($auth_id==_ROLE_AUTH_GUEST) { // ゲストは誰でもなれる
+ $row_auth[$auth_id] = true;
+ }
+ else {
+ if($row['hierarchy']>=$a['hierarchy'] || $createroom_flag == _ON || $row['authority_id'] == $a['role_authority_id']) {
+ $row_auth[$auth_id] = true;
+ }
+ }
+ }
+ }
+ $row['permitted_auth'] = $row_auth;
+ $ret[$row['handle']] = $row;
+ }
+ return $ret;
+ }
+}
diff --git a/html/webapp/modules/room/config/main.ini b/html/webapp/modules/room/config/main.ini
index d90e3c0..3367d25 100644
--- a/html/webapp/modules/room/config/main.ini
+++ b/html/webapp/modules/room/config/main.ini
@@ -6,4 +6,11 @@ room_list_visible_rows = 18 ;//ルーム一覧表示行数
room_users_regist_once = 30000 ;//一度に登録する会員数(この数を越える会員の登録を行う場合、sendを複数回繰り返す)
[Room_View_Admin_Regist_Selectusers:Room_View_Admin_Regist_Confirm]
-room_users_list = 15 ;//会員選択一覧表示行数
\ No newline at end of file
+room_users_list = 15 ;//会員選択一覧表示行数
+
+[Room_View_Admin_Import]
+define:ROOM_IMPORT_LINE_LIMIT = 10000
+
+[Room_View_Admin_Import_Upload]
+define:ROOM_TIME_LIMIT = 12000
+define:ROOM_IMPORT_ITEM_COLUMN = 2
\ No newline at end of file
diff --git a/html/webapp/modules/room/files/css/default/style.css b/html/webapp/modules/room/files/css/default/style.css
index ca6d442..f4e3017 100644
--- a/html/webapp/modules/room/files/css/default/style.css
+++ b/html/webapp/modules/room/files/css/default/style.css
@@ -28,7 +28,7 @@ div.room_init_icon_title {
width:120px;
}
.room_admin{
- width:340px;
+ width:460px;
}
img.room_prefix_icon {
height:15px;
@@ -112,6 +112,11 @@ img.room_prefix_icon {
margin:5px;
padding:0.4em;
}
+div.room_csv_export {
+ float:right;
+ margin:-1.5em 20px 0.5em 0;
+ font-weight:bold;
+}
/* 登録内容確認 */
.room_confirm_default_entry {
font-weight:bold;
@@ -130,4 +135,51 @@ select.room_selectlist {
}
.room_inf td {
padding:6px;
+}
+/* 参加者インポート */
+.room_import_file_select {
+ width:32em;
+}
+.room_import_help_field {
+ width:42em;
+}
+div.room_import_help_description {
+ overflow: auto;
+ border: 1px solid;
+ padding: 5px;
+}
+table.room_import_help_description {
+ width:100%;
+}
+tr.room_grid_row {
+ margin : 1px;
+ border:1px solid #d5d5d5;
+ height : 22px;
+ overflow : hidden;
+ line-height: 18px;
+}
+th.room_grid_header {
+ padding : 3px 2px 2px 3px;
+ text-align:center;
+ background-color:#e0e0e0;
+ border:1px solid #d5d5d5;
+}
+td.room_grid_col {
+ padding : 3px 2px 2px 3px;
+ border:1px solid #d5d5d5;
+ padding-left:4px;
+}
+.room_indent {
+ margin-left:20px;
+}
+.room_import_form label {
+ margin:2px 8px;
+}
+.room_import_result {
+ margin: 5px 15px;
+ padding: 1em;
+ border: 1px solid #999;
+}
+.room_import_result table td {
+ padding: 2px 5px;
}
\ No newline at end of file
diff --git a/html/webapp/modules/room/files/js/room.js b/html/webapp/modules/room/files/js/room.js
index 3be6a2f..3ed2c72 100644
--- a/html/webapp/modules/room/files/js/room.js
+++ b/html/webapp/modules/room/files/js/room.js
@@ -241,5 +241,90 @@ clsRoom.prototype = {
'lang':select_lang
}
commonCls.sendView(this.id, params);
+ },
+ roomUsersExport: function(event, parent_page_id, edit_current_page_id, confirm_mes) {
+
+ var top_el = $(this.id);
+
+ var params = {
+ 'action':'room_action_admin_export',
+ 'parent_page_id':parent_page_id,
+ 'edit_current_page_id':edit_current_page_id
+ }
+ var parameter = new Object();
+ parameter["callbackfunc"] = function(res){
+ if(!commonCls.confirm(confirm_mes))
+ {
+ return false;
+ }
+ location.href= '.' + _nc_index_file_name + '?action=room_view_admin_export&_token='+ $('_token' +this.top_el_id).value;
+ }
+ parameter["callbackfunc_error"] = function(res) {
+ commonCls.alert(res);
+ }
+ commonCls.sendPost(this.id, params, parameter);
+ },
+ _isSelectFile: function(frm) {
+ if($F("room_import_file_select").length > 0) {
+ return(true);
+ }
+ return(false);
+ },
+ _alertImport: function(confirm_message, target) {
+ var keyword = $(target).textContent;
+ var newmsg = confirm_message.replace('%error_item%', keyword);
+ commonCls.alert(newmsg);
+ return;
+ },
+ doUserImport: function(frm, confirm_message) {
+ var keyword;
+ if(!this._isSelectFile(frm)) {
+ this._alertImport(confirm_message, 'room_import_label_file');
+ return false;
+ }
+
+ var this_el = $("room_import_frm");
+ var top_el = $(this.id);
+ var params = new Object();
+ params["method"] = "post";
+
+ params["top_el"] = top_el;
+ params["loading_el"] = top_el;
+ params["timeout_flag"] = 0;
+
+ params['form_prefix'] = "room_import_attachment";
+
+
+
+ params["param"] = new Object();
+ params["param"]["action"] = "room_view_admin_import_upload";
+
+ params["callbackfunc"] = function(res) {
+ this.user_checkdata(this_el);
+ }.bind(this);
+ params["callbackfunc_error"] = function(file_list, res){
+ commonCls.alert(res);
+ }.bind(this);
+ commonCls.sendAttachment(params);
+ },
+ user_checkdata: function(this_el) {
+ var top_el = $(this.id);
+ var chk_params = new Object();
+ chk_params["param"] = {"action":"room_view_admin_import_confirm"};
+ chk_params["top_el"] = top_el;
+ chk_params["loading_el"] = top_el;
+ chk_params["target_el"] = $(this.id);
+
+ commonCls.send(chk_params);
+ },
+ user_importdata: function() {
+ var top_el = $(this.id);
+ var action_params = new Object();
+ action_params['method'] = "post";
+ action_params["param"] = {"action":"room_action_admin_import_confirm"};
+ action_params["top_el"] = top_el;
+ action_params["loading_el"] = top_el;
+ action_params["target_el"] = $(this.id);
+ commonCls.send(action_params);
}
}
\ No newline at end of file
diff --git a/html/webapp/modules/room/language/chinese/main.ini b/html/webapp/modules/room/language/chinese/main.ini
index 5eac669..9742150 100644
--- a/html/webapp/modules/room/language/chinese/main.ini
+++ b/html/webapp/modules/room/language/chinese/main.ini
@@ -16,6 +16,7 @@ room_admin = "管理"
room_back_list = "返回"
room_admin_inf = "编辑"
room_admin_edit = "成员"
+room_admin_import = "进口"
room_confirm_roomdelete = "如果删除房间%s,房间内的所有模块都将消失。 您确定要删除房间吗?"
room_list_display_flag_on = "开放"
room_list_display_flag_off = "维护中"
@@ -50,7 +51,14 @@ room_name_error_mes = "该房间名已存在。"
room_top_description ="设置房间内所有成员的角色,然后按%s。按%s可一次性设置所有角色。 如果您想要继续添加成员,请按%s。"
room_top_user_auth_id = "权限"
room_selected_entry_users = "检索成员"
+room_csv_export = "(出口参与者权限列表)"
+room_export_confirm_exp = "您可以导出室成员的角色,排除%当局。 您确定要继续吗? *下载CSV文件,将备份文件,这个房间。 下载后,请仔细保存这个文件。"
+room_export_exp = "这个房间里的角色成员列表中显示的将是出口。(是否排除%s)"
+[Room_View_Admin_Export]
+define:ROOM_EXPORT_AUTHORITY_NAME = "角色"
+[Room_View_Admin_Export:Room_Action_Admin_Export]
+define:ROOM_EXPORT_NONE = "暂无可导出的用户。"
[Room_View_Admin_Regist_Userslist:Room_View_Admin_Regist_Confirm]
room_subgroup_create_on ="允许"
@@ -85,4 +93,59 @@ room_entry_modules="允许使用的模块"
confirm_selectmodules = "您确定要更改可用模块设置吗?"
[Room_Action_Admin_Search]
-room_user_search_condition_limit = "选项过多"
\ No newline at end of file
+room_user_search_condition_limit = "选项过多"
+
+
+[Room_View_Admin_Import]
+room_import_title_description = "你可以导入的房间(%)成员的角色。"
+room_import_file = "导入文件"
+room_import_select_file_description = "请指定导入文件设置的角色。"
+room_import_select_file_note = "第一行被视为一个标题行。 行上限为%d。"
+room_import_help_label = "帮助"
+room_import_help_title = "导入文件设置的详细确认"
+room_import_exp = "你可以注册角色的房间成员从导入的文件。 中止,如果权力不能放弃或成员可以不参加已经描述,进口没有得到执行。 为了避免错误,请使用导出的文件。 "
+room_import_import_imp = "进出口运行"
+room_import_help_open = "显示"
+room_import_help_close = "关闭"
+room_import_item = "项目"
+room_import_contents = "内容"
+room_import_need_on = "※必填字段
+room_import_sel = "<选项>"
+room_not_entry = "不参加"
+define:ROOM_IMPORT_ITEM_HANDLE = "设置昵称。"
+room_import_check_message = "%error_item%没有被选中。"
+define:ROOM_IMPORT_HELP_AUTH_LABEL = "参与权"
+define:ROOM_IMPORT_HELP_AUTH_EXP = "在这个房间里的角色设置。"
+define:ROOM_IMPORT_UPLOAD_SYSERR = "系统发生错误。"
+define:ROOM_IMPORT_UPLOAD_OPEN_ERR = "文件打开错误。"
+define:ROOM_IMPORT_UPLOAD_NOROOM_ERR = "房间不存在的指定。"
+define:ROOM_IMPORT_UPLOAD_NO_PERMISSION = "你没有权限。"
+define:ROOM_IMPORT_UPLOAD_COLUMN_ERR = "错误:%d CSV文件中的列数是错误的。"
+define:ROOM_IMPORT_UPLOAD_NOUSER_ERR = "错误:%d 不存在,或者是不可能的成员角色,%s 已被指定为操作对象。"
+define:ROOM_IMPORT_UPLOAD_NOAUTH_ERR = "错误:%d %d 是错误的权威价值。"
+define:ROOM_IMPORT_UPLOAD_NOT_PERMIT_AUTH = "错误:%d 成员%s,权威[%d]不能设置。"
+define:ROOM_IMPORT_UPLOAD_NO_CHAGE = "没有变化。"
+define:ROOM_IMPORT_UPLOAD_LINE_OVER_ERR = "文件中的行数超过%d行。"
+define:ROOM_IMPORT_CONFIRM_ADMINUSER_WRAN = "会员“管理”不能改变基本权限。排除在这一进程。"
+define:ROOM_IMPORT_CONFIRM_MYSELF_WRAN = "不能改变自己管理局。排除在这一进程。"
+define:ROOM_IMPORT_CONFIRM_PUBLIC_OTHER_WRAN = "这是不可能改变在公共空间中的不参与。排除在这一进程。"
+define:ROOM_IMPORT_UPLOAD_NODATAS_ERR = "在文件中不存在的数据线。"
+
+[Room_View_Admin_Import_Confirm]
+room_import_confirm_message1 = "这个角色列表将被设置为%s的房间。"
+room_import_confirm_change_count = "%d人将被添加到%s。"
+room_import_confirm_message2 = "本次变动后中,的间客房的的角色设施将作如下安排。 "
+room_import_confirm_count = "%s %d"
+room_import_confirm_message3 = "您确定要继续吗?"
+room_import_confirm_warnMsg = "昵称「%s」"
+
+
+[Room_Action_Admin_Import_Confirm]
+room_import_confirm_message1 = "%s的房间已成立了这个角色列表"
+room_import_confirm_change_count = "%d人已被添加到的%s。"
+room_import_confirm_message2 = "角色房间的情况如下。 "
+room_import_confirm_count = "%s %d"
+
+room_import_confirm_warnMsg = "有一个问题。 而不可能改变成员下面描述的。"
+room_not_entry = "不参加"
+
diff --git a/html/webapp/modules/room/language/english/main.ini b/html/webapp/modules/room/language/english/main.ini
index ce5a3b7..90b0214 100644
--- a/html/webapp/modules/room/language/english/main.ini
+++ b/html/webapp/modules/room/language/english/main.ini
@@ -15,6 +15,7 @@ room_space_common="Open for all members"
room_admin = "Controler"
room_back_list = "Back"
room_admin_inf = "Edit"
+room_admin_import = "Import"
room_admin_edit = "Members"
room_confirm_roomdelete = "By deleting the room, %s, all the modules created in the room will vanish. Are you sure to proceed?"
room_list_display_flag_on = "Open"
@@ -50,7 +51,14 @@ room_name_error_mes = "There exists a room of the same name."
room_top_description ="Set the roles of the room members, and press %s button. To set the roles all at once, press %s button. If you wish to continue to add members, press %s button"
room_top_user_auth_id = "Authority"
room_selected_entry_users = "Search for the members"
+room_csv_export = "(Export participants authority list)"
+room_export_confirm_exp = "You can export the roles of the room members, exclude %s authorities. Are you sure to proceed? *The download csv files will be backup-file for this room. Please preserve this file carefully after downloading."
+room_export_exp = "The roles of this room members displayed in the list will be export.(exclude %s) "
+[Room_View_Admin_Export]
+define:ROOM_EXPORT_AUTHORITY_NAME = "Roles"
+[Room_View_Admin_Export:Room_Action_Admin_Export]
+define:ROOM_EXPORT_NONE = "There is no member to export."
[Room_View_Admin_Regist_Userslist:Room_View_Admin_Regist_Confirm]
room_subgroup_create_on ="Allowed"
@@ -85,4 +93,59 @@ room_entry_modules="Modules allowed to use"
confirm_selectmodules = "You are changing the set of modules which are allowed to be used. Are you sure to proceed?"
[Room_Action_Admin_Search]
-room_user_search_condition_limit = "Too many conditions."
\ No newline at end of file
+room_user_search_condition_limit = "Too many conditions."
+
+
+[Room_View_Admin_Import]
+room_import_title_description = "You can import the roles of room(%s) members."
+room_import_file = "Import file"
+room_import_select_file_description = "Please specify the import file to set the roles."
+room_import_select_file_note = "The first line is treated as a header line. Upper limit of the line is %d."
+room_import_help_label = "Help"
+room_import_help_title = "Detailed confirmation of import file settings"
+room_import_exp = "You can register the roles of room members from imported file. It becomes aborted if the role that can not give or member can not participate has been described, the import is not enforced. To avoid the error, please use the exported file. "
+room_import_import_imp = "Import is run"
+room_import_help_open = "Display"
+room_import_help_close = "Close"
+room_import_item = "Item"
+room_import_contents = "description"
+room_import_need_on = "Required fields"
+room_import_sel = "<option>"
+room_not_entry = "not entry"
+define:ROOM_IMPORT_ITEM_HANDLE = "Set handle."
+room_import_check_message = "%error_item% has not been selected."
+define:ROOM_IMPORT_HELP_AUTH_LABEL = "Role"
+define:ROOM_IMPORT_HELP_AUTH_EXP = "Set the role in this room."
+define:ROOM_IMPORT_UPLOAD_SYSERR = "A system error has occurred."
+define:ROOM_IMPORT_UPLOAD_OPEN_ERR = "File open error."
+define:ROOM_IMPORT_UPLOAD_NOROOM_ERR = "Room that does not exist was specified."
+define:ROOM_IMPORT_UPLOAD_NO_PERMISSION = "You do not have authority."
+define:ROOM_IMPORT_UPLOAD_COLUMN_ERR = "Error:%d line Number of columns in the CSV file is wrong."
+define:ROOM_IMPORT_UPLOAD_NOUSER_ERR = "Error:%d line Not exist, or member role is not possible, %s has been specified as the operation target."
+define:ROOM_IMPORT_UPLOAD_NOAUTH_ERR = "Error:%d line %d is wrong value for the role."
+define:ROOM_IMPORT_UPLOAD_NOT_PERMIT_AUTH = "Error:%d line Member %s, role [%d] can not be set."
+define:ROOM_IMPORT_UPLOAD_NO_CHAGE = "No changes."
+define:ROOM_IMPORT_UPLOAD_LINE_OVER_ERR = "This file has over %d lines."
+define:ROOM_IMPORT_CONFIRM_ADMINUSER_WRAN = "`manager` can not change the role. excluded from the process."
+define:ROOM_IMPORT_CONFIRM_MYSELF_WRAN = "Own role can not be changed. excluded from the process."
+define:ROOM_IMPORT_CONFIRM_PUBLIC_OTHER_WRAN = "It is not possible to change to the non-participation in the public space. excluded from the process."
+define:ROOM_IMPORT_UPLOAD_NODATAS_ERR = "Data line does not exist in the file."
+
+[Room_View_Admin_Import_Confirm]
+room_import_confirm_message1 = "This role list will be setting to %s room."
+room_import_confirm_change_count = "%d member will be added to %s."
+room_import_confirm_message2 = "After the change, roles of the room will be as follows. "
+room_import_confirm_count = "%s %d"
+room_import_confirm_message3 = "Are you sure to proceed?"
+room_import_confirm_warnMsg = "Handle - %s"
+
+
+[Room_Action_Admin_Import_Confirm]
+room_import_confirm_message1 = "This role list has been set to %s room."
+room_import_confirm_change_count = "%d member have been added to %s."
+room_import_confirm_message2 = "Roles of the room was as follows. "
+room_import_confirm_count = "%s %d"
+
+room_import_confirm_warnMsg = "There was a problem. It was not possible to change the members described below."
+room_not_entry = "not entry"
+
diff --git a/html/webapp/modules/room/language/japanese/main.ini b/html/webapp/modules/room/language/japanese/main.ini
index 9f50a0d..caf2367 100644
--- a/html/webapp/modules/room/language/japanese/main.ini
+++ b/html/webapp/modules/room/language/japanese/main.ini
@@ -16,6 +16,7 @@ room_admin = "管理"
room_back_list = "戻る"
room_admin_inf = "基本項目編集"
room_admin_edit = "参加者修正"
+room_admin_import = "参加者インポート"
room_confirm_roomdelete = "「%s」ルームに配置されたすべてのモジュールは完全に削除されます %sを削除してよろしいですか?"
room_list_display_flag_on = "公開中にする"
room_list_display_flag_off = "準備中にする"
@@ -50,6 +51,14 @@ room_name_error_mes = "同じ階層に同名のルームが存在します"
room_top_description ="このルームでの会員の役割を設定して、[%s]ボタンを押してください。[%s]ボタンより役割を一括で選択できます。 続けて参加会員を追加する場合、[%s]を押してください。"
room_top_user_auth_id = "ベース権限"
room_selected_entry_users = "対象会員の絞込み"
+room_csv_export = "(参加者権限一覧をエクスポート)"
+room_export_confirm_exp = "参加会員修正一覧に表示されている会員のうち、 %s以外の会員のルーム参加権限情報をエクスポートします。 よろしいですか? ※ダウンロードされたCSVは現在のルーム参加者の バックアップファイルとしても役立ちます。 ダウンロード後は必ず大切に保存しておいてください。"
+room_export_exp = "参加会員修正一覧に表示されている会員をエクスポートします。ただし、%sの会員情報はエクスポートできません。"
+
+[Room_View_Admin_Export]
+define:ROOM_EXPORT_AUTHORITY_NAME = "参加者権限"
+[Room_View_Admin_Export:Room_Action_Admin_Export]
+define:ROOM_EXPORT_NONE = "エクスポート可能な会員が見つかりませんでした。"
[Room_View_Admin_Regist_Userslist:Room_View_Admin_Regist_Confirm]
@@ -85,4 +94,58 @@ room_entry_modules="利用を許可したモジュール"
confirm_selectmodules = "内容を変更しようとしています。利用の許可を途中で取り消すと、 現在利用中のモジュールに蓄積されたデータが消滅するので注意してください。 この変更を確定しますか?"
[Room_Action_Admin_Search]
-room_user_search_condition_limit = "検索条件が多すぎます。条件を減らして再度検索してください。"
\ No newline at end of file
+room_user_search_condition_limit = "検索条件が多すぎます。条件を減らして再度検索してください。"
+
+[Room_View_Admin_Import]
+room_import_title_description = "ルーム「%s」へ参加者情報をインポートします。"
+room_import_file = "インポートファイル"
+room_import_select_file_description = "参加権限を設定したインポートファイルを指定して下さい。"
+room_import_select_file_note = "※1行目はヘッダ行として扱われます。 ※処理可能な行数は%d行までです。"
+room_import_help_label = "ヘルプ"
+room_import_help_title = "インポートファイル設定項目の詳細確認"
+room_import_exp = "ルームの参加者/参加権限を指定形式のファイルからインポートし、一括登録ができます。 参加できない会員や与えることのできない権限が記載されていた場合は処理中断となり、インポートは実施されません。 エラー発生を極力避けるため、エクスポートされたファイルを利用してください。 "
+room_import_import_imp = "インポート処理を実行します"
+room_import_help_open = "表示"
+room_import_help_close = "閉じる"
+room_import_item = "項目"
+room_import_contents = "内容"
+room_import_need_on = "※必須入力項目"
+room_import_sel = "<選択肢>"
+room_not_entry = "不参加"
+define:ROOM_IMPORT_ITEM_HANDLE = "ハンドルを設定します。"
+room_import_check_message = "%error_item%が選択されていません。"
+define:ROOM_IMPORT_HELP_AUTH_LABEL = "参加権限"
+define:ROOM_IMPORT_HELP_AUTH_EXP = "ルームにどのような権限で参加させるかの値を設定します。"
+define:ROOM_IMPORT_UPLOAD_SYSERR = "システムエラーが発生しました。"
+define:ROOM_IMPORT_UPLOAD_OPEN_ERR = "ファイルのオープンに失敗しました。"
+define:ROOM_IMPORT_UPLOAD_NOROOM_ERR = "存在しないルームが指定されました。"
+define:ROOM_IMPORT_UPLOAD_NO_PERMISSION = "操作権限がありません。"
+define:ROOM_IMPORT_UPLOAD_COLUMN_ERR = "エラー:%d行目 CSVファイルのカラム数が既定のものと異なります。内容を再度確認してください。"
+define:ROOM_IMPORT_UPLOAD_NOUSER_ERR = "エラー:%d行目 存在しない、または参加が不可能な会員「%s」が、操作対象として指定されています。"
+define:ROOM_IMPORT_UPLOAD_NOAUTH_ERR = "エラー:%d行目 %dは設定できる権限種別ではありません。"
+define:ROOM_IMPORT_UPLOAD_NOT_PERMIT_AUTH = "エラー:%d行目 会員%sに、権限[%d]は設定できません。"
+define:ROOM_IMPORT_UPLOAD_NO_CHAGE = "このCSVでは変更となる会員はありませんでした。"
+define:ROOM_IMPORT_UPLOAD_LINE_OVER_ERR = "ファイルの行数が%d行を超えています。"
+define:ROOM_IMPORT_CONFIRM_ADMINUSER_WRAN = "ベース権限が「管理」の会員は変更できません。処理対象から除外しました。"
+define:ROOM_IMPORT_CONFIRM_MYSELF_WRAN = "自分自身の権限は変更できません。処理対象から除外しました。"
+define:ROOM_IMPORT_CONFIRM_PUBLIC_OTHER_WRAN = "パブリック空間で不参加への変更はできません。不参加指定は処理対象から除外しました。"
+define:ROOM_IMPORT_UPLOAD_NODATAS_ERR = "ファイルにデータ行が存在しません。"
+
+[Room_View_Admin_Import_Confirm]
+room_import_confirm_message1 = "%sルームに対して、以下の設定をします。"
+room_import_confirm_change_count = "%d名を%sに変更します。"
+room_import_confirm_message2 = "変更後、ルームの人員構成は以下のとおりとなります。 "
+room_import_confirm_count = "%s %d名"
+room_import_confirm_message3 = "よろしいですか?"
+room_import_confirm_warnMsg = "ハンドル名「%s」"
+
+
+[Room_Action_Admin_Import_Confirm]
+room_import_confirm_message1 = "%sルームに対して、以下の設定をしました。"
+room_import_confirm_change_count = "%d名を%sに変更しました。"
+room_import_confirm_message2 = "ルームの人員構成は以下のとおりとなりました。 "
+room_import_confirm_count = "%s %d名"
+
+room_import_confirm_warnMsg = "何らかの設定変更がなされたようです。 以下の会員の変更ができませんでした。"
+room_not_entry = "不参加"
+
diff --git a/html/webapp/modules/room/templates/default/room_action_admin_import_confirm.html b/html/webapp/modules/room/templates/default/room_action_admin_import_confirm.html
new file mode 100644
index 0000000..1316846
--- /dev/null
+++ b/html/webapp/modules/room/templates/default/room_action_admin_import_confirm.html
@@ -0,0 +1,55 @@
+<{strip}>
+
+
+
+ <{$lang.room_import_confirm_message1|smarty:nodefaults|sprintf:$action.page.page_name}>
+
+
+ <{foreach item=num key=auth_name from=$action.added_auth_member_num}>
+ <{if $num!=0}>
+ <{$lang.room_import_confirm_change_count|sprintf:$num:$auth_name}>
+
+ <{/if}>
+ <{/foreach}>
+ <{if $action.deleted_auth_member_num > 0}>
+ <{$lang.room_import_confirm_change_count|sprintf:$action.deleted_auth_member_num:$lang.room_not_entry}>
+ <{/if}>
+
+
+
+ <{$lang.room_import_confirm_message2|smarty:nodefaults}>
+
+
+
+ <{foreach item=num key=auth_name from=$action.total_auth_member_num}>
+ <{if $num!=0}>
+
+ <{$auth_name}>
+ <{$num}>
+
+ <{/if}>
+ <{/foreach}>
+
+
+
+ <{if count($action.warnMsg)>0 && $action.warnMsg.0!=''}>
+
+ <{$lang.room_import_confirm_warnMsg|smarty:nodefaults}>
+
+ <{foreach item=handle from=$action.warnMsg}>
+ <{$handle}>
+ <{/foreach}>
+
+ <{/if}>
+
+
+ <{* 閉じる *}>
+
+
+
+
+
+
+<{include file="room_script.html"}>
+
+<{/strip}>
\ No newline at end of file
diff --git a/html/webapp/modules/room/templates/default/room_view_admin_import.html b/html/webapp/modules/room/templates/default/room_view_admin_import.html
new file mode 100644
index 0000000..df278ba
--- /dev/null
+++ b/html/webapp/modules/room/templates/default/room_view_admin_import.html
@@ -0,0 +1,98 @@
+<{strip}>
+
+
+ <{* 各種ボタン *}>
+
+
+
+ <{* キャンセル *}>
+
+
+
+
+<{include file="room_script.html"}>
+<{/strip}>
diff --git a/html/webapp/modules/room/templates/default/room_view_admin_import_confirm.html b/html/webapp/modules/room/templates/default/room_view_admin_import_confirm.html
new file mode 100644
index 0000000..5268080
--- /dev/null
+++ b/html/webapp/modules/room/templates/default/room_view_admin_import_confirm.html
@@ -0,0 +1,68 @@
+<{strip}>
+
+<{include file="room_script.html"}>
+
+<{/strip}>
\ No newline at end of file
diff --git a/html/webapp/modules/room/templates/default/room_view_admin_regist_selectusers.html b/html/webapp/modules/room/templates/default/room_view_admin_regist_selectusers.html
index 8c25c5f..4d7f761 100644
--- a/html/webapp/modules/room/templates/default/room_view_admin_regist_selectusers.html
+++ b/html/webapp/modules/room/templates/default/room_view_admin_regist_selectusers.html
@@ -21,6 +21,14 @@
+
+ <{* CSVエクスポート *}>
+
+
<{assign var="edit_current_page_id" value=$action.edit_current_page_id}>