From 65b5bfe25ef7a00bb3a60e039910e4939bfa157b Mon Sep 17 00:00:00 2001
From: kteraguchi
Date: Tue, 22 Jan 2013 15:12:46 +0900
Subject: [PATCH 01/39] =?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 @@
$(".photolist_<{$action.pageNumber}>").bind( "swiperight" );
$(".photolist_<{$action.pageNumber}>").bind( "swipeleft" );
- <{if $action.pagePrevious > 0}>
+ <{if $action.pageNumber > 0}>
$(".photolist_<{$action.pageNumber}>").bind( "swiperight", function(e) {
$.mobile.changePage("?action=photoalbum_view_mobile_list&block_id=<{$block_id}>&album_id=<{$action.album_id}>&pageNumber=<{$action.pagePrevious}><{$session_param}>",{ transition: "slide", reverse:"true"});
e.preventDefault();
diff --git a/html/webapp/modules/photoalbum/view/main/init/maple.ini b/html/webapp/modules/photoalbum/view/main/init/maple.ini
index 37fe082..44a034b 100644
--- a/html/webapp/modules/photoalbum/view/main/init/maple.ini
+++ b/html/webapp/modules/photoalbum/view/main/init/maple.ini
@@ -1,5 +1,5 @@
[ValidateDef]
-key:room_id,block_id,photoalbum_id.photoalbum.photoalbumExists:g = "1:lang._invalid_input"
+key:room_id,block_id,photoalbum_id.photoalbum.photoalbumExists:g = "1:lang.photoalbum_no_photoalbum"
key:block_id,prefix_id_name,photoalbum_id.photoalbum.photoalbumView:g = "1:lang._invalid_input"
key:photoalbum.photoalbum.displaySlide:g = "1:"
diff --git a/html/webapp/modules/photoalbum/view/mobile/list/List.class.php b/html/webapp/modules/photoalbum/view/mobile/list/List.class.php
index 24aa3ad..cf2fbf9 100644
--- a/html/webapp/modules/photoalbum/view/mobile/list/List.class.php
+++ b/html/webapp/modules/photoalbum/view/mobile/list/List.class.php
@@ -61,8 +61,6 @@ function execute()
if ($pageCount > 1) {
if ($this->pageNumber === null && $this->session->getParameter('photoalbum_photolist_page_number'. $this->block_id) !== null) {
$this->pageNumber = $this->session->getParameter('photoalbum_photolist_page_number'. $this->block_id);
- } else {
- $this->pageNumber = intval($this->pageNumber);
}
$this->pageNumber = intval($this->pageNumber);
$this->session->setParameter('photoalbum_photolist_page_number'. $this->block_id, $this->pageNumber);
diff --git a/html/webapp/modules/pm/components/View.class.php b/html/webapp/modules/pm/components/View.class.php
index 4d247d5..0968380 100644
--- a/html/webapp/modules/pm/components/View.class.php
+++ b/html/webapp/modules/pm/components/View.class.php
@@ -2059,7 +2059,7 @@ function getFromInfo($public_flag) {
function getAuthoritySQL()
{
$usersView =& $this->_container->getComponent('usersView');
- $from_sql = " FROM {authorities},{users}".
+ $from_sql = " FROM ({authorities},{users})".
" INNER JOIN {authorities_modules_link}".
" ON {authorities_modules_link}.module_id = ".$this->_request->getParameter("module_id").
" AND {authorities}.role_authority_id = {authorities_modules_link}.role_authority_id";
diff --git a/html/webapp/modules/pm/language/english/main.ini b/html/webapp/modules/pm/language/english/main.ini
index d7100c3..f946e38 100644
--- a/html/webapp/modules/pm/language/english/main.ini
+++ b/html/webapp/modules/pm/language/english/main.ini
@@ -106,14 +106,14 @@ pm_tab_filter_title = "Filter"
pm_tab_tag_title = "Tag"
[Pm_View_Main_Forward]
-pm_mail_intro = "You can forward incoming messages to a your email address and create a filter to forward specific messages."
+pm_mail_intro = "You can forward incoming messages to your email address and create a filter to forward specific messages."
pm_no_forward_email = "You can not forwad incoming message until you had enter your email address in user profile."
pm_mail_title = "Message forwarding"
pm_mail_option_no = "Disable forwarding"
pm_mail_option_yes = "Enable forwarding"
[Pm_View_Main_Filter_Init]
-pm_filter_intro = "Specify the criteria to automatically sort incoming messages."
+pm_filter_intro = "The following filters are applied to all incoming message:"
pm_filter_new = "Create a new filter"
pm_filter_list = "Filter list"
pm_filter_no_filtering = "No filter."
@@ -139,8 +139,8 @@ pm_tag_list = "Tag list"
pm_no_tag = "No tag."
[Pm_View_Main_Filter_Entry]
-pm_filter_new_desc = "Specify the criteria to automatically sort incoming messages, fill 'From' with member's handle. Two or more key words can be specified by switching off the ',' district."
-pm_filter_new_keyword_note = "Two or more key words can be specified by switching off the ',' district."
+pm_filter_new_desc = "Specify the criteria you'd like to use for determining what to do with a message as it arrives. Fill `From` with member`s nickname. Separate with `,` to input more than two keywords."
+pm_filter_new_keyword_note = "Separate with `,` to input more than two keywords."
pm_filter_new_body_note = "Please choose the content of the processing of messages satisfied the condition."
pm_filter_new_apply_inbox = "Processing range"
pm_filter_new_apply_inbox_note = "Apply to the received messages"
diff --git a/html/webapp/modules/registration/validator/Validator_ItemData.class.php b/html/webapp/modules/registration/validator/Validator_ItemData.class.php
index ada3e46..6cd27f0 100644
--- a/html/webapp/modules/registration/validator/Validator_ItemData.class.php
+++ b/html/webapp/modules/registration/validator/Validator_ItemData.class.php
@@ -105,7 +105,7 @@ function validate($attributes, $errStr, $params)
}
if ($item["item_type"] == REGISTRATION_TYPE_TEXTAREA) {
$itemDataValues[$itemID] = preg_replace("/\r\n/", "\n", $itemDataValues[$itemID]);
- $entryDatas[$itemID]["item_data_value"] = $itemDataValues[$itemID];
+ $entryDatas[$itemID]["item_data_value"] = $itemDataValues[$itemID];
}
if ($item["item_type"] == REGISTRATION_TYPE_FILE) {
if ($mobileFlag
@@ -137,8 +137,8 @@ function validate($attributes, $errStr, $params)
}
if ($item["require_flag"] == _ON
- && (empty($itemDataValues)
- || empty($itemDataValues[$itemID]))) {
+ && (!isset($itemDataValues[$itemID])
+ || $itemDataValues[$itemID] == '')) {
$errors[] = sprintf($smartyAssign->getLang("_required"), $item["item_name"]);
continue;
}
diff --git a/html/webapp/modules/reservation/components/Action.class.php b/html/webapp/modules/reservation/components/Action.class.php
index d859353..fd6b1fd 100644
--- a/html/webapp/modules/reservation/components/Action.class.php
+++ b/html/webapp/modules/reservation/components/Action.class.php
@@ -62,23 +62,23 @@ function Reservation_Components_Action()
$this->_reservationView =& $this->_container->getComponent("reservationView");
}
- /**
- * カテゴリーを登録する
- *
- * @access public
- */
- function setCategory()
- {
- $site_id = $this->_session->getParameter("_site_id");
- $user_id = $this->_session->getParameter("_user_id");
- $user_name = $this->_session->getParameter("_handle");
+ /**
+ * カテゴリーを登録する
+ *
+ * @access public
+ */
+ function setCategory()
+ {
+ $site_id = $this->_session->getParameter("_site_id");
+ $user_id = $this->_session->getParameter("_user_id");
+ $user_name = $this->_session->getParameter("_handle");
$time = timezone_date();
$actionChain =& $this->_container->getComponent("ActionChain");
$actionName = $actionChain->getCurActionName();
if ($actionName == "reservation_action_edit_addblock") {
- $params = array(
+ $params = array(
"category_name" => "",
"display_sequence" => 1,
"insert_time" => $time,
@@ -89,16 +89,16 @@ function setCategory()
"update_site_id" => $site_id,
"update_user_id" => $user_id,
"update_user_name" => $user_name
- );
+ );
- $result = $this->_db->insertExecute("reservation_category", $params, false, "category_id");
- if ($result === false) {
- return false;
- }
+ $result = $this->_db->insertExecute("reservation_category", $params, false, "category_id");
+ if ($result === false) {
+ return false;
+ }
} elseif ($actionName == "reservation_action_edit_category_add") {
$display_sequence = $this->_reservationView->getCategorySequence();
- $params = array(
+ $params = array(
"category_name" => $this->_request->getParameter("category_name"),
"display_sequence" => $display_sequence + 1,
"insert_time" => $time,
@@ -109,83 +109,83 @@ function setCategory()
"update_site_id" => $site_id,
"update_user_id" => $user_id,
"update_user_name" => $user_name
- );
+ );
- $result = $this->_db->insertExecute("reservation_category", $params, false, "category_id");
- if ($result === false) {
- return false;
- }
+ $result = $this->_db->insertExecute("reservation_category", $params, false, "category_id");
+ if ($result === false) {
+ return false;
+ }
} elseif ($actionName == "reservation_action_edit_category_rename") {
- $params = array(
+ $params = array(
"category_name" => $this->_request->getParameter("category_name"),
"update_time" => $time,
"update_site_id" => $site_id,
"update_user_id" => $user_id,
"update_user_name" => $user_name
- );
+ );
$where_params = array(
"category_id" => $this->_request->getParameter("category_id")
);
- $result = $this->_db->updateExecute("reservation_category", $params, $where_params, false);
- if($result === false) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * カテゴリーを登録する
- *
- * @access public
- */
- function setCategorySequence()
- {
- $site_id = $this->_session->getParameter("_site_id");
- $user_id = $this->_session->getParameter("_user_id");
- $user_name = $this->_session->getParameter("_handle");
+ $result = $this->_db->updateExecute("reservation_category", $params, $where_params, false);
+ if($result === false) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * カテゴリーを登録する
+ *
+ * @access public
+ */
+ function setCategorySequence()
+ {
+ $site_id = $this->_session->getParameter("_site_id");
+ $user_id = $this->_session->getParameter("_user_id");
+ $user_name = $this->_session->getParameter("_handle");
$time = timezone_date();
- //データ取得
- $position = $this->_request->getParameter("position");
- $drag_category = $this->_request->getParameter("drag_category");
- $drop_category = $this->_request->getParameter("drop_category");
+ //データ取得
+ $position = $this->_request->getParameter("position");
+ $drag_category = $this->_request->getParameter("drag_category");
+ $drop_category = $this->_request->getParameter("drop_category");
- //移動元デクリメント
- //前詰め処理
+ //移動元デクリメント
+ //前詰め処理
$sequence_param = array(
"display_sequence"=> $drag_category["display_sequence"]
);
- $result = $this->_db->seqExecute("reservation_category", array(), $sequence_param);
- if ($result === false) {
- return false;
- }
-
- if ($drag_category["display_sequence"] > $drop_category["display_sequence"]) {
- if ($position == "top") {
- $drop_display_sequence = $drop_category["display_sequence"];
- } else {
- $drop_display_sequence = $drop_category["display_sequence"] + 1;
- }
- } else {
- if ($position == "top") {
- $drop_display_sequence = $drop_category["display_sequence"] - 1;
- } else {
- $drop_display_sequence = $drop_category["display_sequence"];
- }
- }
-
- //移動先インクリメント
+ $result = $this->_db->seqExecute("reservation_category", array(), $sequence_param);
+ if ($result === false) {
+ return false;
+ }
+
+ if ($drag_category["display_sequence"] > $drop_category["display_sequence"]) {
+ if ($position == "top") {
+ $drop_display_sequence = $drop_category["display_sequence"];
+ } else {
+ $drop_display_sequence = $drop_category["display_sequence"] + 1;
+ }
+ } else {
+ if ($position == "top") {
+ $drop_display_sequence = $drop_category["display_sequence"] - 1;
+ } else {
+ $drop_display_sequence = $drop_category["display_sequence"];
+ }
+ }
+
+ //移動先インクリメント
$sequence_param = array(
"display_sequence"=> $drop_display_sequence
);
- $result = $this->_db->seqExecute("reservation_category", array(), $sequence_param, 1);
- if($result === false) {
- return false;
- }
+ $result = $this->_db->seqExecute("reservation_category", array(), $sequence_param, 1);
+ if($result === false) {
+ return false;
+ }
- //更新
- $params = array(
+ //更新
+ $params = array(
"display_sequence" => $drop_display_sequence,
"update_time" => $time,
"update_site_id" => $site_id,
@@ -195,127 +195,127 @@ function setCategorySequence()
$where_params = array(
"category_id" => $this->_request->getParameter("drag_category_id")
);
- $result = $this->_db->updateExecute("reservation_category", $params, $where_params, false);
- if($result === false) {
- return false;
- }
-
- return true;
- }
-
- /**
- * カテゴリーを登録する
- *
- * @access public
- */
- function deleteCategory()
- {
- $category_id = $this->_request->getParameter("category_id");
-
- $category = $this->_db->selectExecute("reservation_category", array("category_id"=>$category_id));
- if ($category === false || !isset($category[0])) {
- return false;
- }
- //前詰め処理
+ $result = $this->_db->updateExecute("reservation_category", $params, $where_params, false);
+ if($result === false) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * カテゴリーを登録する
+ *
+ * @access public
+ */
+ function deleteCategory()
+ {
+ $category_id = $this->_request->getParameter("category_id");
+
+ $category = $this->_db->selectExecute("reservation_category", array("category_id"=>$category_id));
+ if ($category === false || !isset($category[0])) {
+ return false;
+ }
+ //前詰め処理
$sequence_param = array(
"display_sequence" => $category[0]["display_sequence"]
);
- $result = $this->_db->seqExecute("reservation_category", array(), $sequence_param);
- if ($result === false) {
- return false;
- }
- //カテゴリーなしに変更処理
- $location_list = $this->_db->selectExecute("reservation_location", array("category_id"=>$category_id));
- if ($location_list === false) {
- return false;
- }
- if (!empty($location_list)) {
+ $result = $this->_db->seqExecute("reservation_category", array(), $sequence_param);
+ if ($result === false) {
+ return false;
+ }
+ //カテゴリーなしに変更処理
+ $location_list = $this->_db->selectExecute("reservation_location", array("category_id"=>$category_id));
+ if ($location_list === false) {
+ return false;
+ }
+ if (!empty($location_list)) {
$non_category = $this->_reservationView->getNonCategory();
$display_sequence = $this->_reservationView->getLocationSequence($non_category["category_id"]);
- $site_id = $this->_session->getParameter("_site_id");
- $user_id = $this->_session->getParameter("_user_id");
- $user_name = $this->_session->getParameter("_handle");
+ $site_id = $this->_session->getParameter("_site_id");
+ $user_id = $this->_session->getParameter("_user_id");
+ $user_name = $this->_session->getParameter("_handle");
$time = timezone_date();
- foreach ($location_list as $i=>$location) {
- $display_sequence++;
- $params = array(
- "category_id" => $non_category["category_id"],
- "display_sequence" => $display_sequence,
+ foreach ($location_list as $i=>$location) {
+ $display_sequence++;
+ $params = array(
+ "category_id" => $non_category["category_id"],
+ "display_sequence" => $display_sequence,
"update_time" => $time,
"update_site_id" => $site_id,
"update_user_id" => $user_id,
"update_user_name" => $user_name
- );
- $result = $this->_db->updateExecute("reservation_location", $params, array("location_id"=>$location["location_id"]), false);
- if ($result === false) {
- return false;
- }
- }
- }
- //削除
- $result = $this->_db->deleteExecute("reservation_category", array("category_id"=>$category_id));
- if($result === false) {
- return false;
- }
- return true;
- }
-
- /**
- * ブロックを登録する
- *
- * @return integer カテゴリー件数
- * @access public
- */
- function setBlock()
- {
+ );
+ $result = $this->_db->updateExecute("reservation_location", $params, array("location_id"=>$location["location_id"]), false);
+ if ($result === false) {
+ return false;
+ }
+ }
+ }
+ //削除
+ $result = $this->_db->deleteExecute("reservation_category", array("category_id"=>$category_id));
+ if($result === false) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * ブロックを登録する
+ *
+ * @return integer カテゴリー件数
+ * @access public
+ */
+ function setBlock()
+ {
$actionChain =& $this->_container->getComponent("ActionChain");
$actionName = $actionChain->getCurActionName();
if ($actionName == "reservation_action_edit_addblock") {
$default = $this->_reservationView->getDefaultBlock();
- $params = array(
- "block_id" => $this->_request->getParameter("block_id"),
+ $params = array(
+ "block_id" => $this->_request->getParameter("block_id"),
"display_type" => $default["display_type"],
"display_start_time" => $default["display_start_time"],
"display_interval" => $default["display_interval"],
"category_id" => $default["category_id"],
"location_id" => $default["location_id"]
);
- $result = $this->_db->insertExecute("reservation_block", $params, true);
- if ($result === false) {
- return false;
- }
+ $result = $this->_db->insertExecute("reservation_block", $params, true);
+ if ($result === false) {
+ return false;
+ }
} elseif ($actionName == "reservation_action_edit_style") {
- $params = array(
+ $params = array(
"display_type" => intval($this->_request->getParameter("display_type")),
"display_start_time" => $this->_request->getParameter("display_start_time"),
"display_interval" => intval($this->_request->getParameter("display_interval")),
"category_id" => $this->_request->getParameter("category_id"),
"location_id" => $this->_request->getParameter("location_id")
);
- $where_params = array(
- "block_id" => $this->_request->getParameter("block_id"),
+ $where_params = array(
+ "block_id" => $this->_request->getParameter("block_id"),
);
- $result = $this->_db->updateExecute("reservation_block", $params, $where_params, true);
- if ($result === false) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * 施設を登録する
- *
- * @access public
- */
- function addLocation()
- {
- $site_id = $this->_session->getParameter("_site_id");
- $user_id = $this->_session->getParameter("_user_id");
- $user_name = $this->_session->getParameter("_handle");
+ $result = $this->_db->updateExecute("reservation_block", $params, $where_params, true);
+ if ($result === false) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * 施設を登録する
+ *
+ * @access public
+ */
+ function addLocation()
+ {
+ $site_id = $this->_session->getParameter("_site_id");
+ $user_id = $this->_session->getParameter("_user_id");
+ $user_name = $this->_session->getParameter("_handle");
$time = timezone_date();
$category_id = $this->_request->getParameter("category_id");
@@ -323,19 +323,20 @@ function addLocation()
$allroom_flag = intval($this->_request->getParameter("allroom_flag"));
$description = $this->_request->getParameter("description");
- $params = array(
- "category_id" => $category_id,
- "location_name" => $this->_request->getParameter("location_name"),
- "active_flag" => _ON,
- "add_authority" => $this->_request->getParameter("add_authority"),
- "time_table" => $this->_request->getParameter("time_table"),
- "start_time" => timezone_date($this->_request->getParameter("start_time"), true, "YmdHis"),
- "end_time" => timezone_date($this->_request->getParameter("end_time"), true, "YmdHis"),
- "timezone_offset" => $this->_request->getParameter("timezone_offset"),
- "duplication_flag" => intval($this->_request->getParameter("duplication_flag")),
- "use_private_flag" => intval($this->_request->getParameter("use_private_flag")),
- "allroom_flag" => $allroom_flag,
- "display_sequence" => $display_sequence + 1,
+ $params = array(
+ "category_id" => $category_id,
+ "location_name" => $this->_request->getParameter("location_name"),
+ "active_flag" => _ON,
+ "add_authority" => $this->_request->getParameter("add_authority"),
+ "time_table" => $this->_request->getParameter("time_table"),
+ "start_time" => timezone_date($this->_request->getParameter("start_time"), true, "YmdHis"),
+ "end_time" => timezone_date($this->_request->getParameter("end_time"), true, "YmdHis"),
+ "timezone_offset" => $this->_request->getParameter("timezone_offset"),
+ "duplication_flag" => intval($this->_request->getParameter("duplication_flag")),
+ "use_private_flag" => intval($this->_request->getParameter("use_private_flag")),
+ "use_auth_flag" => intval($this->_request->getParameter("use_auth_flag")),
+ "allroom_flag" => $allroom_flag,
+ "display_sequence" => $display_sequence + 1,
"insert_time" => $time,
"insert_site_id" => $site_id,
"insert_user_id" => $user_id,
@@ -344,20 +345,20 @@ function addLocation()
"update_site_id" => $site_id,
"update_user_id" => $user_id,
"update_user_name" => $user_name
- );
- $location_id = $this->_db->insertExecute("reservation_location", $params, false, "location_id");
- if ($location_id === false) {
- return false;
- }
+ );
+ $location_id = $this->_db->insertExecute("reservation_location", $params, false, "location_id");
+ if ($location_id === false) {
+ return false;
+ }
$params = array(
"location_id" => $location_id,
- "contact" => $this->_request->getParameter("contact"),
- "description" => $description
+ "contact" => $this->_request->getParameter("contact"),
+ "description" => $description
);
- $result = $this->_db->insertExecute("reservation_location_details", $params, false);
- if ($result === false) {
- return false;
- }
+ $result = $this->_db->insertExecute("reservation_location_details", $params, false);
+ if ($result === false) {
+ return false;
+ }
$commonMain =& $this->_container->getComponent("commonMain");
$uploadsAction =& $commonMain->registerClass(WEBAPP_DIR.'/components/uploads/Action.class.php', "Uploads_Action", "uploadsAction");
@@ -369,41 +370,41 @@ function addLocation()
$where_params = array(
"upload_id IN (". implode(",", $upload_id_arr) .")" => null
);
- $result = $uploadsAction->updUploads($params, $where_params);
- if ($result === false) {
- return false;
- }
+ $result = $uploadsAction->updUploads($params, $where_params);
+ if ($result === false) {
+ return false;
+ }
}
$select_room = $this->_request->getParameter("select_room");
- if ($allroom_flag == _ON || empty($select_room)) {
- return true;
- }
+ if ($allroom_flag == _ON || empty($select_room)) {
+ return true;
+ }
foreach ($select_room as $i=>$room_id) {
- $params = array(
+ $params = array(
"location_id" => $location_id,
- "room_id" => intval($room_id)
- );
- $result = $this->_db->insertExecute("reservation_location_rooms", $params, true);
- if ($result === false) {
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * 施設を登録する
- *
- * @access public
- */
- function updateLocation()
- {
- $site_id = $this->_session->getParameter("_site_id");
- $user_id = $this->_session->getParameter("_user_id");
- $user_name = $this->_session->getParameter("_handle");
+ "room_id" => intval($room_id)
+ );
+ $result = $this->_db->insertExecute("reservation_location_rooms", $params, true);
+ if ($result === false) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * 施設を登録する
+ *
+ * @access public
+ */
+ function updateLocation()
+ {
+ $site_id = $this->_session->getParameter("_site_id");
+ $user_id = $this->_session->getParameter("_user_id");
+ $user_name = $this->_session->getParameter("_handle");
$time = timezone_date();
$location = $this->_request->getParameter("location");
@@ -420,91 +421,92 @@ function updateLocation()
$new_select_room = array();
}
- if ($allroom_flag == _OFF) {
- $diff_array = array_diff($old_select_rooms, $new_select_room);
- if (!empty($diff_array) && count($diff_array) > 0) {
- $params = array(
+ if ($allroom_flag == _OFF) {
+ $diff_array = array_diff($old_select_rooms, $new_select_room);
+ if (!empty($diff_array) && count($diff_array) > 0) {
+ $params = array(
"location_id" => $location_id,
- "room_id IN (".implode(",", $diff_array).")" => null
- );
- $result = $this->_db->deleteExecute("reservation_location_rooms", $params);
- if($result === false) {
- return false;
- }
- }
-
- $diff_array = array_diff($new_select_room, $old_select_rooms);
- foreach ($diff_array as $i=>$room_id) {
- $params = array(
+ "room_id IN (".implode(",", $diff_array).")" => null
+ );
+ $result = $this->_db->deleteExecute("reservation_location_rooms", $params);
+ if($result === false) {
+ return false;
+ }
+ }
+
+ $diff_array = array_diff($new_select_room, $old_select_rooms);
+ foreach ($diff_array as $i=>$room_id) {
+ $params = array(
"location_id" => $location_id,
- "room_id" => intval($room_id)
- );
- $result = $this->_db->insertExecute("reservation_location_rooms", $params, true);
- if ($result === false) {
- return false;
- }
- }
- } else {
- $result = $this->_db->deleteExecute("reservation_location_rooms", array("location_id"=>$location_id));
- if($result === false) {
- return false;
- }
- }
-
- if ($location["category_id"] != $category_id) {
- //移動元デクリメント
- //前詰め処理
- $params = array(
+ "room_id" => intval($room_id)
+ );
+ $result = $this->_db->insertExecute("reservation_location_rooms", $params, true);
+ if ($result === false) {
+ return false;
+ }
+ }
+ } else {
+ $result = $this->_db->deleteExecute("reservation_location_rooms", array("location_id"=>$location_id));
+ if($result === false) {
+ return false;
+ }
+ }
+
+ if ($location["category_id"] != $category_id) {
+ //移動元デクリメント
+ //前詰め処理
+ $params = array(
"category_id" => $location["category_id"]
);
$sequence_param = array(
"display_sequence" => $location["display_sequence"]
);
- $result = $this->_db->seqExecute("reservation_location", $params, $sequence_param);
- if ($result === false) {
- return false;
- }
-
- //移動元インクリメント
- $display_sequence = $this->_reservationView->getLocationSequence($category_id);
- $display_sequence++;
- } else {
- $display_sequence = $location["display_sequence"];
- }
-
- $params = array(
- "category_id" => $category_id,
- "location_name" => $this->_request->getParameter("location_name"),
- "active_flag" => _ON,
- "add_authority" => $this->_request->getParameter("add_authority"),
- "time_table" => $this->_request->getParameter("time_table"),
- "start_time" => timezone_date($this->_request->getParameter("start_time"), true, "YmdHis"),
- "end_time" => timezone_date($this->_request->getParameter("end_time"), true, "YmdHis"),
- "timezone_offset" => $this->_request->getParameter("timezone_offset"),
- "duplication_flag" => intval($this->_request->getParameter("duplication_flag")),
- "use_private_flag" => intval($this->_request->getParameter("use_private_flag")),
- "allroom_flag" => $allroom_flag,
- "display_sequence" => $display_sequence,
+ $result = $this->_db->seqExecute("reservation_location", $params, $sequence_param);
+ if ($result === false) {
+ return false;
+ }
+
+ //移動元インクリメント
+ $display_sequence = $this->_reservationView->getLocationSequence($category_id);
+ $display_sequence++;
+ } else {
+ $display_sequence = $location["display_sequence"];
+ }
+
+ $params = array(
+ "category_id" => $category_id,
+ "location_name" => $this->_request->getParameter("location_name"),
+ "active_flag" => _ON,
+ "add_authority" => $this->_request->getParameter("add_authority"),
+ "time_table" => $this->_request->getParameter("time_table"),
+ "start_time" => timezone_date($this->_request->getParameter("start_time"), true, "YmdHis"),
+ "end_time" => timezone_date($this->_request->getParameter("end_time"), true, "YmdHis"),
+ "timezone_offset" => $this->_request->getParameter("timezone_offset"),
+ "duplication_flag" => intval($this->_request->getParameter("duplication_flag")),
+ "use_private_flag" => intval($this->_request->getParameter("use_private_flag")),
+ "use_auth_flag" => intval($this->_request->getParameter("use_auth_flag")),
+ "allroom_flag" => $allroom_flag,
+ "display_sequence" => $display_sequence,
"update_time" => $time,
"update_site_id" => $site_id,
"update_user_id" => $user_id,
"update_user_name" => $user_name
- );
+ );
$where_params = array(
"location_id" => $location_id
);
- $result = $this->_db->updateExecute("reservation_location", $params, $where_params, false);
- if ($result === false) {
- return false;
- }
+ $result = $this->_db->updateExecute("reservation_location", $params, $where_params, false);
+ if ($result === false) {
+ return false;
+ }
$params = array(
- "contact" => $this->_request->getParameter("contact"),
- "description" => $description
+ "contact" => $this->_request->getParameter("contact"),
+ "description" => $description
);
- $result = $this->_db->updateExecute("reservation_location_details", $params, $where_params, false);
- if ($result === false) {
- return false;
- }
+ $result = $this->_db->updateExecute("reservation_location_details", $params, $where_params, false);
+ if ($result === false) {
+ return false;
+ }
$commonMain =& $this->_container->getComponent("commonMain");
$uploadsAction =& $commonMain->registerClass(WEBAPP_DIR.'/components/uploads/Action.class.php', "Uploads_Action", "uploadsAction");
@@ -517,214 +519,214 @@ function updateLocation()
$where_params = array(
"upload_id IN (". implode(",", $upload_id_arr) .")" => null
);
- $result = $uploadsAction->updUploads($params, $where_params);
- if ($result === false) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * 施設を登録する
- *
- * @access public
- */
- function renameLocation()
- {
- $site_id = $this->_session->getParameter("_site_id");
- $user_id = $this->_session->getParameter("_user_id");
- $user_name = $this->_session->getParameter("_handle");
+ $result = $uploadsAction->updUploads($params, $where_params);
+ if ($result === false) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * 施設を登録する
+ *
+ * @access public
+ */
+ function renameLocation()
+ {
+ $site_id = $this->_session->getParameter("_site_id");
+ $user_id = $this->_session->getParameter("_user_id");
+ $user_name = $this->_session->getParameter("_handle");
$time = timezone_date();
- $params = array(
- "location_name" => $this->_request->getParameter("location_name"),
+ $params = array(
+ "location_name" => $this->_request->getParameter("location_name"),
"update_time" => $time,
"update_site_id" => $site_id,
"update_user_id" => $user_id,
"update_user_name" => $user_name
- );
+ );
$where_params = array(
"location_id" => $this->_request->getParameter("location_id")
);
- $result = $this->_db->updateExecute("reservation_location", $params, $where_params, false);
- if ($result === false) {
- return false;
- }
- return true;
- }
-
- /**
- * 施設を登録する
- *
- * @access public
- */
- function deleteLocation()
- {
+ $result = $this->_db->updateExecute("reservation_location", $params, $where_params, false);
+ if ($result === false) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * 施設を登録する
+ *
+ * @access public
+ */
+ function deleteLocation()
+ {
$location_id = $this->_request->getParameter("location_id");
- $location = $this->_db->selectExecute("reservation_location", array("location_id"=>$location_id));
- if ($location === false || !isset($location[0])) {
- return false;
- }
- //前詰め処理
- $params = array(
+ $location = $this->_db->selectExecute("reservation_location", array("location_id"=>$location_id));
+ if ($location === false || !isset($location[0])) {
+ return false;
+ }
+ //前詰め処理
+ $params = array(
"category_id" => $location[0]["category_id"]
);
$sequence_param = array(
"display_sequence" => $location[0]["display_sequence"]
);
- $result = $this->_db->seqExecute("reservation_location", $params, $sequence_param);
- if ($result === false) {
- return false;
- }
-
- $result = $this->_db->deleteExecute("reservation_location", array("location_id"=>$location_id));
- if($result === false) {
- return false;
- }
- $result = $this->_db->deleteExecute("reservation_location_details", array("location_id"=>$location_id));
- if($result === false) {
- return false;
- }
- $result = $this->_db->deleteExecute("reservation_location_rooms", array("location_id"=>$location_id));
- if($result === false) {
- return false;
- }
- $result = $this->_db->deleteExecute("reservation_reserve", array("location_id"=>$location_id));
- if($result === false) {
- return false;
- }
- $result = $this->_db->deleteExecute("reservation_reserve_details", array("location_id"=>$location_id));
- if($result === false) {
- return false;
- }
- return true;
- }
-
- /**
- * 施設を登録する
- *
- * @access public
- */
- function setLocationSequence()
- {
- $site_id = $this->_session->getParameter("_site_id");
- $user_id = $this->_session->getParameter("_user_id");
- $user_name = $this->_session->getParameter("_handle");
+ $result = $this->_db->seqExecute("reservation_location", $params, $sequence_param);
+ if ($result === false) {
+ return false;
+ }
+
+ $result = $this->_db->deleteExecute("reservation_location", array("location_id"=>$location_id));
+ if($result === false) {
+ return false;
+ }
+ $result = $this->_db->deleteExecute("reservation_location_details", array("location_id"=>$location_id));
+ if($result === false) {
+ return false;
+ }
+ $result = $this->_db->deleteExecute("reservation_location_rooms", array("location_id"=>$location_id));
+ if($result === false) {
+ return false;
+ }
+ $result = $this->_db->deleteExecute("reservation_reserve", array("location_id"=>$location_id));
+ if($result === false) {
+ return false;
+ }
+ $result = $this->_db->deleteExecute("reservation_reserve_details", array("location_id"=>$location_id));
+ if($result === false) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * 施設を登録する
+ *
+ * @access public
+ */
+ function setLocationSequence()
+ {
+ $site_id = $this->_session->getParameter("_site_id");
+ $user_id = $this->_session->getParameter("_user_id");
+ $user_name = $this->_session->getParameter("_handle");
$time = timezone_date();
- //データ取得
- $position = $this->_request->getParameter("position");
- $drag_location = $this->_request->getParameter("drag_location");
- $drop_category = $this->_request->getParameter("drop_category");
- $drop_location = $this->_request->getParameter("drop_location");
+ //データ取得
+ $position = $this->_request->getParameter("position");
+ $drag_location = $this->_request->getParameter("drag_location");
+ $drop_category = $this->_request->getParameter("drop_category");
+ $drop_location = $this->_request->getParameter("drop_location");
- $drag_category_id = $drag_location["category_id"];
+ $drag_category_id = $drag_location["category_id"];
- if ($position == "inside") {
- $drop_category_id = $drop_category["category_id"];
- } else {
- $drop_category_id = $drop_location["category_id"];
- }
+ if ($position == "inside") {
+ $drop_category_id = $drop_category["category_id"];
+ } else {
+ $drop_category_id = $drop_location["category_id"];
+ }
- //移動元デクリメント
- //前詰め処理
- $params = array(
+ //移動元デクリメント
+ //前詰め処理
+ $params = array(
"category_id" => $drag_category_id
);
$sequence_param = array(
"display_sequence" => $drag_location["display_sequence"]
);
- $result = $this->_db->seqExecute("reservation_location", $params, $sequence_param);
- if ($result === false) {
- return false;
- }
-
- if ($position == "inside") {
- $drop_display_sequence = $this->_reservationView->getLocationSequence($drop_category_id);
- if ($drop_display_sequence === false) {
- return false;
- }
- if ($drag_category_id != $drop_category_id) {
- $drop_display_sequence = $drop_display_sequence + 1;
- }
- } else {
- if ($drag_category_id == $drop_category_id) {
- if ($drag_location["display_sequence"] > $drop_location["display_sequence"]) {
- if ($position == "top") {
- $drop_display_sequence = $drop_location["display_sequence"];
- } else {
- $drop_display_sequence = $drop_location["display_sequence"] + 1;
- }
- } else {
- if ($position == "top") {
- $drop_display_sequence = $drop_location["display_sequence"] - 1;
- } else {
- $drop_display_sequence = $drop_location["display_sequence"];
- }
- }
- } else {
- if ($position == "top") {
- $drop_display_sequence = $drop_location["display_sequence"];
- } else {
- $drop_display_sequence = $drop_location["display_sequence"] + 1;
- }
- }
- if ($drop_display_sequence == 0) $drop_display_sequence = 1;
-
- //移動先インクリメント
- $params = array(
+ $result = $this->_db->seqExecute("reservation_location", $params, $sequence_param);
+ if ($result === false) {
+ return false;
+ }
+
+ if ($position == "inside") {
+ $drop_display_sequence = $this->_reservationView->getLocationSequence($drop_category_id);
+ if ($drop_display_sequence === false) {
+ return false;
+ }
+ if ($drag_category_id != $drop_category_id) {
+ $drop_display_sequence = $drop_display_sequence + 1;
+ }
+ } else {
+ if ($drag_category_id == $drop_category_id) {
+ if ($drag_location["display_sequence"] > $drop_location["display_sequence"]) {
+ if ($position == "top") {
+ $drop_display_sequence = $drop_location["display_sequence"];
+ } else {
+ $drop_display_sequence = $drop_location["display_sequence"] + 1;
+ }
+ } else {
+ if ($position == "top") {
+ $drop_display_sequence = $drop_location["display_sequence"] - 1;
+ } else {
+ $drop_display_sequence = $drop_location["display_sequence"];
+ }
+ }
+ } else {
+ if ($position == "top") {
+ $drop_display_sequence = $drop_location["display_sequence"];
+ } else {
+ $drop_display_sequence = $drop_location["display_sequence"] + 1;
+ }
+ }
+ if ($drop_display_sequence == 0) $drop_display_sequence = 1;
+
+ //移動先インクリメント
+ $params = array(
"category_id" => $drop_category_id
);
$sequence_param = array(
"display_sequence"=> $drop_display_sequence
);
- $result = $this->_db->seqExecute("reservation_location", $params, $sequence_param, 1);
- if ($result === false) {
- return false;
- }
- }
- //更新
- $params = array(
- "category_id" => $drop_category_id,
+ $result = $this->_db->seqExecute("reservation_location", $params, $sequence_param, 1);
+ if ($result === false) {
+ return false;
+ }
+ }
+ //更新
+ $params = array(
+ "category_id" => $drop_category_id,
"display_sequence" => $drop_display_sequence
);
$where_params = array(
"location_id" => $drag_location["location_id"]
);
- $result = $this->_db->updateExecute("reservation_location", $params, $where_params, true);
- if ($result === false) {
- return false;
- }
- return true;
- }
-
- /**
- * 予約を登録する
- *
- * @access public
- */
- function addReserve()
- {
+ $result = $this->_db->updateExecute("reservation_location", $params, $where_params, true);
+ if ($result === false) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * 予約を登録する
+ *
+ * @access public
+ */
+ function addReserve()
+ {
$calendarAction =& $this->_container->getComponent("calendarAction");
- $user_id = $this->_session->getParameter("_user_id");
- $user_name = $this->_session->getParameter("_handle");
+ $user_id = $this->_session->getParameter("_user_id");
+ $user_name = $this->_session->getParameter("_handle");
- $details_flag = intval($this->_request->getParameter("details_flag"));
+ $details_flag = intval($this->_request->getParameter("details_flag"));
$entry_calendar = intval($this->_request->getParameter("entry_calendar"));
- $allday_flag = intval($this->_request->getParameter("allday_flag"));
+ $allday_flag = intval($this->_request->getParameter("allday_flag"));
$contact = $this->_request->getParameter("contact");
$description = $this->_request->getParameter("description");
- $location = $this->_request->getParameter("location");
- $reserve_room_id = $this->_request->getParameter("reserve_room_id");
+ $location = $this->_request->getParameter("location");
+ $reserve_room_id = $this->_request->getParameter("reserve_room_id");
if ($details_flag == _ON) {
$rrule = $this->_request->getParameter("rrule");
$rrule_str = $calendarAction->concatRRule($rrule);
- $details_params = array(
+ $details_params = array(
"contact" => $contact,
"description" => $description,
"rrule" => $rrule_str,
@@ -733,23 +735,22 @@ function addReserve()
);
} else {
$rrule_str = "";
- $details_params = array(
- "location_id" => $location["location_id"],
- "room_id" => $reserve_room_id
- );
+ $details_params = array(
+ "location_id" => $location["location_id"],
+ "room_id" => $reserve_room_id
+ );
}
- $reserve_details_id = $this->_db->insertExecute("reservation_reserve_details", $details_params, false, "reserve_details_id");
- if ($reserve_details_id === false) {
- return false;
- }
+ $reserve_details_id = $this->_db->insertExecute("reservation_reserve_details", $details_params, false, "reserve_details_id");
+ if ($reserve_details_id === false) {
+ return false;
+ }
$this->_request->setParameter("reserve_details_id", $reserve_details_id);
-
$start_time_full = timezone_date($this->_request->getParameter("start_time_full"));
$end_time_full = timezone_date($this->_request->getParameter("end_time_full"));
- $base_params = array(
+ $base_params = array(
"reserve_details_id" => $reserve_details_id,
"location_id" => $location["location_id"],
"room_id" => $reserve_room_id,
@@ -767,10 +768,10 @@ function addReserve()
"timezone_offset" => $this->_request->getParameter("timezone_offset")
);
- $reserve_id = $this->_db->insertExecute("reservation_reserve", $base_params, true, "reserve_id");
- if ($reserve_id === false) {
- return false;
- }
+ $reserve_id = $this->_db->insertExecute("reservation_reserve", $base_params, true, "reserve_id");
+ if ($reserve_id === false) {
+ return false;
+ }
$this->_request->setParameter("reserve_id", $reserve_id);
$block_id = $this->_reservationView->getBlockIdByWhatsnew();
@@ -789,10 +790,10 @@ function addReserve()
"end_time_full" => $end_time_full
);
$params = array_merge($base_params, $params);
- $result = $this->_db->insertExecute("reservation_reserve", $params, true, "reserve_id");
- if ($result === false) {
- return false;
- }
+ $result = $this->_db->insertExecute("reservation_reserve", $params, true, "reserve_id");
+ if ($result === false) {
+ return false;
+ }
}
}
@@ -825,61 +826,61 @@ function addReserve()
$where_params = array(
"upload_id IN (". implode(",", $upload_id_arr) .")" => null
);
- $result = $uploadsAction->updUploads($params, $where_params);
- if ($result === false) {
- return false;
- }
+ $result = $uploadsAction->updUploads($params, $where_params);
+ if ($result === false) {
+ return false;
+ }
}
//--新着情報関連 Start--
$result = $this->setWhatsnew();
- if ($result === false) {
- return false;
- }
+ if ($result === false) {
+ return false;
+ }
//--新着情報関連 End--
- $notification_mail = intval($this->_request->getParameter("notification_mail"));
+ $notification_mail = intval($this->_request->getParameter("notification_mail"));
if ($notification_mail == _ON) {
$this->_session->setParameter("reservation_mail_reserve_id", $reserve_id);
} else {
$this->_session->setParameter("reservation_mail_reserve_id", 0);
}
- return true;
- }
+ return true;
+ }
- /**
- * 予約を登録する
- *
- * @access public
- */
- function deleteReserve()
- {
+ /**
+ * 予約を登録する
+ *
+ * @access public
+ */
+ function deleteReserve()
+ {
$calendarAction =& $this->_container->getComponent("calendarAction");
- $user_id = $this->_session->getParameter("_user_id");
- $user_name = $this->_session->getParameter("_handle");
+ $user_id = $this->_session->getParameter("_user_id");
+ $user_name = $this->_session->getParameter("_handle");
$edit_rrule = intval($this->_request->getParameter("edit_rrule"));
$reserve = $this->_request->getParameter("reserve");
- $reserve_details_id = $reserve["reserve_details_id"];
- $start_date = $reserve["start_date"];
- $start_time = $reserve["start_time"];
- $start_time_full = $reserve["start_time_full"];
+ $reserve_details_id = $reserve["reserve_details_id"];
+ $start_date = $reserve["start_date"];
+ $start_time = $reserve["start_time"];
+ $start_time_full = $reserve["start_time_full"];
- $calendar_id = $reserve["calendar_id"];
- if ($edit_rrule == RESERVATION_RESERVE_EDIT_ALL) {
- $params = array(
+ $calendar_id = $reserve["calendar_id"];
+ if ($edit_rrule == RESERVATION_RESERVE_EDIT_ALL) {
+ $params = array(
"reserve_details_id" => $reserve_details_id
);
- $result = $this->_db->deleteExecute("reservation_reserve", $params);
+ $result = $this->_db->deleteExecute("reservation_reserve", $params);
- } elseif ($edit_rrule == RESERVATION_RESERVE_EDIT_AFTER) {
+ } elseif ($edit_rrule == RESERVATION_RESERVE_EDIT_AFTER) {
$sql = "DELETE FROM {reservation_reserve}" .
" WHERE reserve_details_id = ?" .
" AND start_time_full >= ?";
- $params = array(
+ $params = array(
"reserve_details_id" => $reserve_details_id,
"start_time_full" => $start_time_full
);
@@ -902,19 +903,19 @@ function deleteReserve()
$rrule_str = $calendarAction->concatRRule($rrule_arr);
$result = $this->_db->updateExecute("reservation_reserve_details", array("rrule"=>$rrule_str), array("reserve_details_id"=>$reserve_details_id));
- } else {
- $params = array(
+ } else {
+ $params = array(
"reserve_id" => $reserve["reserve_id"]
);
- $result = $this->_db->deleteExecute("reservation_reserve", $params);
- }
- if ($result === false) {
- return false;
- }
+ $result = $this->_db->deleteExecute("reservation_reserve", $params);
+ }
+ if ($result === false) {
+ return false;
+ }
$sql = "SELECT COUNT(*) FROM {reservation_reserve} ";
$sql .= "WHERE reserve_details_id = ? ";
- $params = array(
+ $params = array(
"reserve_details_id" => $reserve_details_id
);
$result = $this->_db->execute($sql, $params, null, null, false);
@@ -923,38 +924,38 @@ function deleteReserve()
return false;
}
if ($result[0][0] == 0) {
- $result = $this->_db->deleteExecute("reservation_reserve_details", $params);
+ $result = $this->_db->deleteExecute("reservation_reserve_details", $params);
- if ($result === false) {
- return false;
- }
+ if ($result === false) {
+ return false;
+ }
//--新着情報関連 Start--
$whatsnewAction =& $this->_container->getComponent("whatsnewAction");
$result = $whatsnewAction->delete($reserve_details_id);
- if ($result === false) {
- return false;
- }
- //--新着情報関連 End--
+ if ($result === false) {
+ return false;
+ }
+ //--新着情報関連 End--
}
if ($calendar_id != 0) {
$result = $calendarAction->deletePlan($calendar_id, $edit_rrule);
}
- return true;
- }
+ return true;
+ }
- /**
- * 予約を登録する
- *
- * @access public
- */
- function updateReserve()
- {
+ /**
+ * 予約を登録する
+ *
+ * @access public
+ */
+ function updateReserve()
+ {
$calendarAction =& $this->_container->getComponent("calendarAction");
- $user_id = $this->_session->getParameter("_user_id");
- $user_name = $this->_session->getParameter("_handle");
+ $user_id = $this->_session->getParameter("_user_id");
+ $user_name = $this->_session->getParameter("_handle");
$edit_rrule = intval($this->_request->getParameter("edit_rrule"));
$reserve = $this->_request->getParameter("reserve");
@@ -981,29 +982,29 @@ function updateReserve()
$block_id = $this->_reservationView->getBlockIdByWhatsnew();
- $details_params = array(
+ $details_params = array(
"contact" => $this->_request->getParameter("contact"),
"description" => $description,
"rrule" => $rrule_str
);
if ($edit_rrule == RESERVATION_RESERVE_EDIT_ALL) {
- $result = $this->_updateReserveByAll($reserve_details_id, $details_params);
- if ($result === false) {
- return false;
- }
+ $result = $this->_updateReserveByAll($reserve_details_id, $details_params);
+ if ($result === false) {
+ return false;
+ }
} elseif ($edit_rrule == RESERVATION_RESERVE_EDIT_AFTER) {
- $result = $this->_updateReserveByAfter($reserve_details_id, $start_time_full, $details_params);
- if ($result === false) {
- return false;
- }
+ $result = $this->_updateReserveByAfter($reserve_details_id, $start_time_full, $details_params);
+ if ($result === false) {
+ return false;
+ }
} else {
- $reserve_details_id = $this->_db->insertExecute("reservation_reserve_details", $details_params, false, "reserve_details_id");
- if ($reserve_details_id === false) {
- return false;
- }
+ $reserve_details_id = $this->_db->insertExecute("reservation_reserve_details", $details_params, false, "reserve_details_id");
+ if ($reserve_details_id === false) {
+ return false;
+ }
}
$this->_request->setParameter("reserve_details_id", $reserve_details_id);
@@ -1032,14 +1033,14 @@ function updateReserve()
"update_site_id" => $this->_session->getParameter("_site_id"),
"update_user_id" => $user_id,
"update_user_name" => $user_name
- );
+ );
$where_params = array(
"reserve_id" => $reserve["reserve_id"]
);
- $result = $this->_db->updateExecute("reservation_reserve", $reserve_params, $where_params, false);
- if ($result === false) {
- return false;
- }
+ $result = $this->_db->updateExecute("reservation_reserve", $reserve_params, $where_params, false);
+ if ($result === false) {
+ return false;
+ }
if ($edit_rrule != RESERVATION_RESERVE_EDIT_THIS) {
$sql = "DELETE FROM {reservation_reserve} " .
@@ -1069,10 +1070,10 @@ function updateReserve()
"end_time_full" => $end_time_full
);
$params = array_merge($reserve_params, $params);
- $result = $this->_db->insertExecute("reservation_reserve", $params, false, "reserve_id");
- if ($result === false) {
- return false;
- }
+ $result = $this->_db->insertExecute("reservation_reserve", $params, false, "reserve_id");
+ if ($result === false) {
+ return false;
+ }
}
}
}
@@ -1123,27 +1124,27 @@ function updateReserve()
$where_params = array(
"upload_id IN (". implode(",", $upload_id_arr) .")" => null
);
- $result = $uploadsAction->updUploads($params, $where_params);
- if ($result === false) {
- return false;
- }
+ $result = $uploadsAction->updUploads($params, $where_params);
+ if ($result === false) {
+ return false;
+ }
}
//--新着情報関連 Start--
$result = $this->setWhatsnew();
- if ($result === false) {
- return false;
- }
+ if ($result === false) {
+ return false;
+ }
//--新着情報関連 End--
- $notification_mail = intval($this->_request->getParameter("notification_mail"));
+ $notification_mail = intval($this->_request->getParameter("notification_mail"));
if ($notification_mail == _ON) {
$this->_session->setParameter("reservation_mail_reserve_id", $reserve["reserve_id"]);
} else {
$this->_session->setParameter("reservation_mail_reserve_id", 0);
}
- return true;
- }
+ return true;
+ }
/**
* 予定の変更
@@ -1154,10 +1155,10 @@ function _updateReserveByAll($reserve_details_id, $details_params)
{
$params = array("reserve_details_id" => $reserve_details_id);
- $result = $this->_db->updateExecute("reservation_reserve_details", $details_params, array("reserve_details_id"=>$reserve_details_id));
- if ($result === false) {
- return false;
- }
+ $result = $this->_db->updateExecute("reservation_reserve_details", $details_params, array("reserve_details_id"=>$reserve_details_id));
+ if ($result === false) {
+ return false;
+ }
return true;
}
@@ -1176,7 +1177,7 @@ function _updateReserveByAfter(&$reserve_details_id, $start_time_full, $details_
"WHERE reserve_details_id = ? " .
"AND start_time_full >= ? " .
"AND reserve_id <> ?";
- $params = array(
+ $params = array(
"reserve_details_id" => $reserve_details_id,
"start_time_full" => $start_time_full,
"reserve_id" => $reserve["reserve_id"]
@@ -1190,7 +1191,7 @@ function _updateReserveByAfter(&$reserve_details_id, $start_time_full, $details_
$sql = "SELECT COUNT(*) FROM {reservation_reserve} " .
"WHERE reserve_details_id = ? " .
"AND reserve_id <> ?";
- $params = array(
+ $params = array(
"reserve_details_id" => $reserve_details_id,
"reserve_id" => $reserve["reserve_id"]
);
@@ -1200,10 +1201,10 @@ function _updateReserveByAfter(&$reserve_details_id, $start_time_full, $details_
return false;
}
if ($result[0][0] == 0) {
- $result = $this->_db->deleteExecute("reservation_reserve_details", array("reserve_details_id"=>$reserve_details_id));
- if($result === false) {
- return false;
- }
+ $result = $this->_db->deleteExecute("reservation_reserve_details", array("reserve_details_id"=>$reserve_details_id));
+ if($result === false) {
+ return false;
+ }
} else {
$rrule_arr = $reserve["rrule_arr"];
$freq = $rrule_arr["FREQ"];
@@ -1216,15 +1217,15 @@ function _updateReserveByAfter(&$reserve_details_id, $start_time_full, $details_
$rrule_before_str = $calendarAction->concatRRule($rrule_arr);
$result = $this->_db->updateExecute("reservation_reserve_details", array("rrule"=>$rrule_before_str), array("reserve_details_id"=>$reserve_details_id));
- if ($result === false) {
- return false;
- }
- }
- $reserve_details_id = $this->_db->insertExecute("reservation_reserve_details", $details_params, false, "reserve_details_id");
- if ($reserve_details_id === false) {
- return false;
- }
- return true;
+ if ($result === false) {
+ return false;
+ }
+ }
+ $reserve_details_id = $this->_db->insertExecute("reservation_reserve_details", $details_params, false, "reserve_details_id");
+ if ($reserve_details_id === false) {
+ return false;
+ }
+ return true;
}
/**
@@ -1237,22 +1238,22 @@ function setWhatsnew()
//--新着情報関連 Start--
$whatsnewAction =& $this->_container->getComponent("whatsnewAction");
- $user_id = $this->_session->getParameter("_user_id");
- $user_name = $this->_session->getParameter("_handle");
+ $user_id = $this->_session->getParameter("_user_id");
+ $user_name = $this->_session->getParameter("_handle");
$block_id = $this->_reservationView->getBlockIdByWhatsnew();
- $reserve_id = $this->_request->getParameter("reserve_id");
+ $reserve_id = $this->_request->getParameter("reserve_id");
$reserve = $this->_reservationView->getReserve($reserve_id);
- if ($reserve === false) {
- return false;
- }
- $location = $this->_request->getParameter("location");
+ if ($reserve === false) {
+ return false;
+ }
+ $location = $this->_request->getParameter("location");
$result = $whatsnewAction->delete($reserve["reserve_details_id"]);
- if ($result === false) {
- return false;
- }
+ if ($result === false) {
+ return false;
+ }
$whatsnew_description = "";
$whatsnew_description .= sprintf(RESERVATION_WHATSNEW_LOCATION, $location["location_name"]);
@@ -1296,9 +1297,9 @@ function setWhatsnew()
$whatsnew["user_id"] = $user_id;
$whatsnew["authority_id"] = _AUTH_ADMIN;
$result = $whatsnewAction->insert($whatsnew, _ON);
- if ($result === false) {
- return false;
- }
+ if ($result === false) {
+ return false;
+ }
}
$whatsnew["authority_id"] = _AUTH_GUEST;
$select_rooms = $this->_reservationView->getLocationRoom($location["location_id"]);
@@ -1309,9 +1310,9 @@ function setWhatsnew()
$whatsnew["room_id"] = $select_rooms;
}
$result = $whatsnewAction->insert($whatsnew, _ON);
- if ($result === false) {
- return false;
- }
+ if ($result === false) {
+ return false;
+ }
//--新着情報関連 End--
return true;
}
diff --git a/html/webapp/modules/reservation/components/View.class.php b/html/webapp/modules/reservation/components/View.class.php
index ae4159a..92c952a 100644
--- a/html/webapp/modules/reservation/components/View.class.php
+++ b/html/webapp/modules/reservation/components/View.class.php
@@ -87,11 +87,11 @@ function TimeDiff($from_time, $to_time)
{
if (strlen($from_time) == 6) {
$dateTimeBegin = mktime(substr($from_time,0,2), substr($from_time,2,2), substr($from_time,4));
- $dateTimeEnd = mktime(substr($to_time,0,2), substr($to_time,2,2), substr($to_time,4));
+ $dateTimeEnd = mktime(substr($to_time,0,2), substr($to_time,2,2), substr($to_time,4));
} else {
$dateTimeBegin = mktime(substr($from_time,8,2), substr($from_time,10,2), substr($from_time,12,2),
substr($from_time,4,2), substr($from_time,6,2), substr($from_time,0,4));
- $dateTimeEnd = mktime(substr($to_time,8,2), substr($to_time,10,2), substr($to_time,12,2),
+ $dateTimeEnd = mktime(substr($to_time,8,2), substr($to_time,10,2), substr($to_time,12,2),
substr($to_time,4,2), substr($to_time,6,2), substr($to_time,0,4));
}
@@ -113,7 +113,7 @@ function getWeekArray()
foreach ($this->_wdayArrary as $i=>$key) {
$weekArray[$i] = array("name" => $this->_weekNameArray[$i], "long_name" => $this->_weekLongNameArray[$i]);
}
- return $weekArray;
+ return $weekArray;
}
/**
@@ -139,7 +139,7 @@ function convertTimeTableStr($time_table)
}
}
}
- return $time_table_str;
+ return $time_table_str;
}
/**
* タイムテーブルの選択データ取得
@@ -151,7 +151,7 @@ function getLocationWeekArray()
foreach ($this->_wdayArrary as $i=>$key) {
$weekArray[$key] = array("name" => $this->_weekNameArray[$i], "long_name" => $this->_weekLongNameArray[$i]);
}
- return $weekArray;
+ return $weekArray;
}
@@ -216,42 +216,42 @@ function setReserveFlag(&$row)
return true;
}
- /**
- * カテゴリー件数を取得する
- *
- * @param mixed $category_id カテゴリーID
- *
- * @return integer カテゴリー件数
- * @access public
- */
- function getCountCategory($category_id=null)
- {
+ /**
+ * カテゴリー件数を取得する
+ *
+ * @param mixed $category_id カテゴリーID
+ *
+ * @return integer カテゴリー件数
+ * @access public
+ */
+ function getCountCategory($category_id=null)
+ {
if (isset($category_id)) {
$params = array("category_id"=>$category_id);
} else {
$params = null;
}
- $count = $this->_db->countExecute("reservation_category", $params);
- return $count;
- }
-
- /**
- * カテゴリーの存在チェックする
- *
- * @param mixed $category_id カテゴリーID
- *
- * @return boolean
- * @access public
- */
- function categoryExists($category_id=null)
- {
- $count = $this->getCountCategory($category_id);
- if ($count > 0) {
- return true;
- } else {
- return false;
- }
- }
+ $count = $this->_db->countExecute("reservation_category", $params);
+ return $count;
+ }
+
+ /**
+ * カテゴリーの存在チェックする
+ *
+ * @param mixed $category_id カテゴリーID
+ *
+ * @return boolean
+ * @access public
+ */
+ function categoryExists($category_id=null)
+ {
+ $count = $this->getCountCategory($category_id);
+ if ($count > 0) {
+ return true;
+ } else {
+ return false;
+ }
+ }
/**
* カテゴリー取得
@@ -290,7 +290,7 @@ function &getCategories()
$this->_db->addError();
return false;
}
- return $result;
+ return $result;
}
/**
* カテゴリー取得
@@ -306,23 +306,23 @@ function _getCategories(&$recordSet)
return $result;
}
- /**
- * カテゴリー取得
- *
- * @param mixed $category_id カテゴリーID
- *
- * @return array カテゴリー
- * @access public
- */
- function getCategory($category_id)
- {
- $category =& $this->_db->selectExecute("reservation_category", array("category_id"=>$category_id));
+ /**
+ * カテゴリー取得
+ *
+ * @param mixed $category_id カテゴリーID
+ *
+ * @return array カテゴリー
+ * @access public
+ */
+ function getCategory($category_id)
+ {
+ $category =& $this->_db->selectExecute("reservation_category", array("category_id"=>$category_id));
if ($category === false) {
return $category;
}
$category = $category[0];
- return $category;
- }
+ return $category;
+ }
/**
* カテゴリー取得
*
@@ -330,32 +330,32 @@ function getCategory($category_id)
*/
function getCategorySequence()
{
- $max_sequence = $this->_db->maxExecute("reservation_category", "display_sequence");
- if ($max_sequence === false) {
- return false;
- }
- if (empty($max_sequence)) {
- $max_sequence = 0;
- }
- return $max_sequence;
- }
- /**
- * カテゴリー取得
- *
- * @param mixed $category_id カテゴリーID
- *
- * @return array カテゴリー
- * @access public
- */
- function getNonCategory()
- {
- $categories =& $this->_db->selectExecute("reservation_category", array("category_name"=>""));
+ $max_sequence = $this->_db->maxExecute("reservation_category", "display_sequence");
+ if ($max_sequence === false) {
+ return false;
+ }
+ if (empty($max_sequence)) {
+ $max_sequence = 0;
+ }
+ return $max_sequence;
+ }
+ /**
+ * カテゴリー取得
+ *
+ * @param mixed $category_id カテゴリーID
+ *
+ * @return array カテゴリー
+ * @access public
+ */
+ function getNonCategory()
+ {
+ $categories =& $this->_db->selectExecute("reservation_category", array("category_name"=>""));
if ($categories === false) {
return $categories;
}
$category = $categories[0];
- return $category;
- }
+ return $category;
+ }
/**
* デフォルト値取得
@@ -364,65 +364,65 @@ function getNonCategory()
*/
function getDefaultBlock()
{
- $module_id = $this->_request->getParameter("module_id");
+ $module_id = $this->_request->getParameter("module_id");
$configView =& $this->_container->getComponent("configView");
$config = $configView->getConfig($module_id, false);
if ($config === false) {
- return false;
- }
-
- if (defined($config['display_type']["conf_value"])) {
- $display_type = constant($config['display_type']["conf_value"]);
- } else {
- $display_type = $config['display_type']["conf_value"];
- }
+ return false;
+ }
+
+ if (defined($config['display_type']["conf_value"])) {
+ $display_type = constant($config['display_type']["conf_value"]);
+ } else {
+ $display_type = $config['display_type']["conf_value"];
+ }
$room_id_arr = $this->_request->getParameter("room_id_arr");
- switch ($display_type) {
- case RESERVATION_DEF_MONTHLY:
- case RESERVATION_DEF_WEEKLY:
+ switch ($display_type) {
+ case RESERVATION_DEF_MONTHLY:
+ case RESERVATION_DEF_WEEKLY:
$result = $this->getFirstLocation();
if ($result === false) {
return $result;
}
$category_id = $result["category_id"];
$location_id = $result["location_id"];
- break;
- case RESERVATION_DEF_LOCATION:
- $category_id = $this->getFirstCategory();
- if ($category_id === false) {
+ break;
+ case RESERVATION_DEF_LOCATION:
+ $category_id = $this->getFirstCategory();
+ if ($category_id === false) {
return $category_id;
}
- $category_id = $category_id;
- $location_id = 0;
- break;
- default:
- $category_id = 0;
- $location_id = 0;
- }
-
- if (defined($config['display_interval']["conf_value"])) {
- $display_interval = constant($config['display_interval']["conf_value"]);
- } else {
- $display_interval = intval($config['display_interval']["conf_value"]);
- }
-
- if (defined($config['display_start_time']["conf_value"])) {
- $display_start_time = constant($config['display_start_time']["conf_value"]);
- } else {
- $display_start_time = $config['display_start_time']["conf_value"];
- }
-
- $default = array(
- "block_id" => 0,
- "display_type" => $display_type,
- "display_start_time" => $display_start_time,
- "start_time_hour" => $config['start_time_hour']["conf_value"],
- "display_interval" => $display_interval,
- "category_id" => $category_id,
- "location_id" => $location_id
- );
- return $default;
+ $category_id = $category_id;
+ $location_id = 0;
+ break;
+ default:
+ $category_id = 0;
+ $location_id = 0;
+ }
+
+ if (defined($config['display_interval']["conf_value"])) {
+ $display_interval = constant($config['display_interval']["conf_value"]);
+ } else {
+ $display_interval = intval($config['display_interval']["conf_value"]);
+ }
+
+ if (defined($config['display_start_time']["conf_value"])) {
+ $display_start_time = constant($config['display_start_time']["conf_value"]);
+ } else {
+ $display_start_time = $config['display_start_time']["conf_value"];
+ }
+
+ $default = array(
+ "block_id" => 0,
+ "display_type" => $display_type,
+ "display_start_time" => $display_start_time,
+ "start_time_hour" => $config['start_time_hour']["conf_value"],
+ "display_interval" => $display_interval,
+ "category_id" => $category_id,
+ "location_id" => $location_id
+ );
+ return $default;
}
/**
@@ -439,7 +439,7 @@ function getFirstLocation($category_id = null)
if (!isset($result[0])) {
return false;
}
- return $result[0];
+ return $result[0];
}
/**
@@ -449,14 +449,14 @@ function getFirstLocation($category_id = null)
*/
function getLocationSequence($category_id)
{
- $max_sequence = $this->_db->maxExecute("reservation_location", "display_sequence", array("category_id"=>$category_id));
- if ($max_sequence === false) {
- return false;
- }
- if (empty($max_sequence)) {
- $max_sequence = 0;
- }
- return $max_sequence;
+ $max_sequence = $this->_db->maxExecute("reservation_location", "display_sequence", array("category_id"=>$category_id));
+ if ($max_sequence === false) {
+ return false;
+ }
+ if (empty($max_sequence)) {
+ $max_sequence = 0;
+ }
+ return $max_sequence;
}
/**
@@ -466,8 +466,8 @@ function getLocationSequence($category_id)
*/
function getLocations($category_id = null, $limit = null, $offset = null, $func=null)
{
- $_user_auth_id = $this->_session->getParameter("_user_auth_id");
- $_user_id = $this->_session->getParameter("_user_id");
+ $_user_auth_id = $this->_session->getParameter("_user_auth_id");
+ $_user_id = $this->_session->getParameter("_user_id");
if (!isset($func)) {
$func = array($this,"_getLocations");
@@ -486,22 +486,7 @@ function getLocations($category_id = null, $limit = null, $offset = null, $func=
"ON (location.location_id = l_rooms.location_id) ";
if ($_user_auth_id != _AUTH_ADMIN) {
$sql .= "WHERE (";
-
- $pagesView =& $this->_container->getComponent("pagesView");
- $private_spase = $pagesView->getPrivateSpaceByUserId($_user_id);
- if ($private_spase === false) {
- return false;
- }
- if (!empty($private_spase)) {
- $private_room_id = $private_spase[0]["page_id"];
- } else {
- $private_room_id = 0;
- }
-
- if ($private_room_id > 0) {
- $sql .= "location.use_private_flag = ". _ON . " AND location.add_authority <= " . $_user_auth_id . " OR ";
- }
- $sql .= "location.allroom_flag = ". _ON;
+ $sql .= "location.allroom_flag = ". _ON;
if (!empty($room_id_arr)) {
$sql .= " OR location.allroom_flag = ". _OFF ." AND l_rooms.room_id IN (".implode(",",$room_id_arr).")";
}
@@ -519,7 +504,7 @@ function getLocations($category_id = null, $limit = null, $offset = null, $func=
$this->_db->addError();
return false;
}
- return $result;
+ return $result;
}
/**
* 施設取得
@@ -528,7 +513,7 @@ function getLocations($category_id = null, $limit = null, $offset = null, $func=
*/
function _getLocations(&$recordSet, $params)
{
- $_user_auth_id = $this->_session->getParameter("_user_auth_id");
+ $_user_auth_id = $this->_session->getParameter("_user_auth_id");
$result = array();
$commonMain =& $this->_container->getComponent("commonMain");
@@ -567,12 +552,6 @@ function _getLocations(&$recordSet, $params)
$row["timezone_string"] = $timezoneMain->getLangTimeZone($row["timezone_offset"], false);
}
- if ($row["use_private_flag"] == _ON && $_user_auth_id >= $row["add_authority"]) {
- $row["hasPrivateAddReserve"] = _ON;
- } else {
- $row["hasPrivateAddReserve"] = _OFF;
- }
-
if ($actionName == "reservation_view_main_init" && $params[0] == _OFF && $display_type == RESERVATION_DEF_LOCATION) {
$result[$row["location_id"]] = $row;
} elseif ($actionName == "reservation_view_edit_location_init" || $actionName == "reservation_view_main_movedate" ||
@@ -610,9 +589,9 @@ function getLocation($location_id, $details_flag=false)
$actionChain =& $this->_container->getComponent("ActionChain");
$actionName = $actionChain->getCurActionName();
if ($actionName == "reservation_action_edit_location_sequence") {
- $result = $this->_db->execute($sql, array("location_id"=>$location_id));
+ $result = $this->_db->execute($sql, array("location_id"=>$location_id));
} else {
- $result = $this->_db->execute($sql, array("location_id"=>$location_id), null, null, true, array($this,"_getLocations"), array(_ON));
+ $result = $this->_db->execute($sql, array("location_id"=>$location_id), null, null, true, array($this,"_getLocations"), array(_ON));
}
if ($result === false) {
$this->_db->addError();
@@ -636,35 +615,35 @@ function getDefaultLocation()
$configView =& $this->_container->getComponent("configView");
$config = $configView->getConfig($module_id, false);
if ($config === false) {
- return false;
- }
-
- $commonMain =& $this->_container->getComponent("commonMain");
- $timezoneMain =& $commonMain->registerClass(WEBAPP_DIR.'/components/timezone/Main.class.php', "Timezone_Main", "timezoneMain");
-
- $timezone_offset = $this->_session->getParameter("_timezone_offset");
- $location = array(
- "location_id" => 0,
- "category_id" => 0,
- "location_name" => "",
- "active_flag" => _ON,
- "add_authority" => _AUTH_CHIEF,
- "time_table" => RESERVATION_DEF_WEEKYDAY,
- "time_table_arr" => explode(",", RESERVATION_DEF_WEEKYDAY),
- "start_time" => timezone_date_format(null, "Ymd090000"),
- "end_time" => timezone_date_format(null, "Ymd180000"),
- "timezone_offset" => $timezone_offset,
- "timezone_string" => $timezoneMain->getLangTimeZone($timezone_offset, false),
- "allday_flag" => _OFF,
- "contact" => "",
- "description" => "",
- "duplication_flag" => _OFF,
- "use_private_flag" => (defined($config['use_private_flag']["conf_value"]) ?
- constant($config['use_private_flag']["conf_value"]) : intval($config['use_private_flag']["conf_value"])),
- "allroom_flag" => (defined($config['allroom_flag']["conf_value"]) ?
- constant($config['allroom_flag']["conf_value"]) : intval($config['allroom_flag']["conf_value"])),
- "display_sequence" => 0
- );
+ return false;
+ }
+
+ $commonMain =& $this->_container->getComponent("commonMain");
+ $timezoneMain =& $commonMain->registerClass(WEBAPP_DIR.'/components/timezone/Main.class.php', "Timezone_Main", "timezoneMain");
+
+ $timezone_offset = $this->_session->getParameter("_timezone_offset");
+ $location = array(
+ "location_id" => 0,
+ "category_id" => 0,
+ "location_name" => "",
+ "active_flag" => _ON,
+ "add_authority" => _AUTH_CHIEF,
+ "time_table" => RESERVATION_DEF_WEEKYDAY,
+ "time_table_arr" => explode(",", RESERVATION_DEF_WEEKYDAY),
+ "start_time" => timezone_date_format(null, "Ymd090000"),
+ "end_time" => timezone_date_format(null, "Ymd180000"),
+ "timezone_offset" => $timezone_offset,
+ "timezone_string" => $timezoneMain->getLangTimeZone($timezone_offset, false),
+ "allday_flag" => _OFF,
+ "contact" => "",
+ "description" => "",
+ "duplication_flag" => _OFF,
+ "use_private_flag" => (defined($config['use_private_flag']["conf_value"]) ?
+ constant($config['use_private_flag']["conf_value"]) : intval($config['use_private_flag']["conf_value"])),
+ "allroom_flag" => (defined($config['allroom_flag']["conf_value"]) ?
+ constant($config['allroom_flag']["conf_value"]) : intval($config['allroom_flag']["conf_value"])),
+ "display_sequence" => 0
+ );
return $location;
}
@@ -675,8 +654,8 @@ function getDefaultLocation()
*/
function getCountLocationByCategory()
{
- $_user_auth_id = $this->_session->getParameter("_user_auth_id");
- $_user_id = $this->_session->getParameter("_user_id");
+ $_user_auth_id = $this->_session->getParameter("_user_auth_id");
+ $_user_id = $this->_session->getParameter("_user_id");
$room_id_arr = $this->_request->getParameter("room_id_arr");
@@ -721,7 +700,7 @@ function getCountLocationByCategory()
return false;
}
}
- return $result;
+ return $result;
}
/**
@@ -745,8 +724,8 @@ function _getCountLocationByCategory(&$recordSet)
*/
function getCountLocation($location_id = null)
{
- $_user_auth_id = $this->_session->getParameter("_user_auth_id");
- $_user_id = $this->_session->getParameter("_user_id");
+ $_user_auth_id = $this->_session->getParameter("_user_auth_id");
+ $_user_id = $this->_session->getParameter("_user_id");
$room_id_arr = $this->_request->getParameter("room_id_arr");
@@ -800,7 +779,7 @@ function getCountLocation($location_id = null)
$this->_db->addError();
return false;
}
- return intval($result[0][0]);
+ return intval($result[0][0]);
}
}
@@ -823,12 +802,12 @@ function getLocationRoom($location_id)
$sql .= " WHERE location.location_id = ?".
" AND l_rooms.room_id IN (".implode(",",$room_id_arr).")";
- $result = $this->_db->execute($sql, $params, null, null, true, array($this,"_getLocationRoom"));
+ $result = $this->_db->execute($sql, $params, null, null, true, array($this,"_getLocationRoom"));
if ($result === false) {
$this->_db->addError();
return $result;
}
- return $result;
+ return $result;
}
/**
* 施設に紐付くルーム取得
@@ -901,25 +880,25 @@ function getBlock($display_type=null)
"block_id" => $this->_request->getParameter("block_id")
);
- $result =& $this->_db->selectExecute("reservation_block", $params);
- if (empty($result)) {
- $result[0] = $this->getDefaultBlock();
- }
- if (empty($result)) {
- return false;
- }
+ $result =& $this->_db->selectExecute("reservation_block", $params);
+ if (empty($result)) {
+ $result[0] = $this->getDefaultBlock();
+ }
+ if (empty($result)) {
+ return false;
+ }
- $reserve_block = $result[0];
+ $reserve_block = $result[0];
$room_id_arr = $this->_request->getParameter("room_id_arr");
if (isset($display_type) && $display_type > 0) {
$reserve_block["display_type"] = $display_type;
}
- switch ($reserve_block["display_type"]) {
- case RESERVATION_DEF_MONTHLY:
- case RESERVATION_DEF_WEEKLY:
- $location_id = $this->_request->getParameter("location_id");
+ switch ($reserve_block["display_type"]) {
+ case RESERVATION_DEF_MONTHLY:
+ case RESERVATION_DEF_WEEKLY:
+ $location_id = $this->_request->getParameter("location_id");
if (!isset($location_id)) {
$location_id = $reserve_block["location_id"];
} else {
@@ -933,15 +912,15 @@ function getBlock($display_type=null)
}
$location_id = intval($location["location_id"]);
}
- $location =& $this->getLocation($location_id, false);
+ $location =& $this->getLocation($location_id, false);
if ($location === false) {
return false;
}
$reserve_block["category_id"] = $location["category_id"];
$reserve_block["location_id"] = $location["location_id"];
- break;
- case RESERVATION_DEF_LOCATION:
- $category_id = $this->_request->getParameter("category_id");
+ break;
+ case RESERVATION_DEF_LOCATION:
+ $category_id = $this->_request->getParameter("category_id");
if (!isset($category_id)) {
$category_id = $reserve_block["category_id"];
} else {
@@ -958,9 +937,9 @@ function getBlock($display_type=null)
}
$reserve_block["category_id"] = $category_id;
$reserve_block["location_id"] = 0;
- break;
+ break;
default:
- }
+ }
//表示タイプの設定
$type = substr($reserve_block["display_start_time"], -1);
@@ -970,13 +949,13 @@ function getBlock($display_type=null)
$reserve_block["start_time_hour"] = $reserve_block["display_start_time"];
} else {
$reserve_block["start_time_type"] = RESERVATION_DEF_START_TIME_DEFAULT;
- $module_id = $this->_request->getParameter("module_id");
+ $module_id = $this->_request->getParameter("module_id");
$configView =& $this->_container->getComponent("configView");
$config = $configView->getConfigByConfname($module_id, "start_time_hour");
if ($config === false) {
- return false;
- }
- $reserve_block["start_time_hour"] = $config["conf_value"];
+ return false;
+ }
+ $reserve_block["start_time_hour"] = $config["conf_value"];
}
return $reserve_block;
}
@@ -1008,10 +987,10 @@ function getReserve($reserve_id)
"reserve_id" => $reserve_id
);
- $result = $this->_db->execute($sql, $params, null, null, true, array($this,"_getReserve"));
+ $result = $this->_db->execute($sql, $params, null, null, true, array($this,"_getReserve"));
if ($result === false) {
- $this->_db->addError();
- return $result;
+ $this->_db->addError();
+ return $result;
}
return $result;
}
@@ -1022,7 +1001,7 @@ function getReserve($reserve_id)
*/
function &_getReserve(&$recordSet)
{
- $authCheck =& $this->_container->getComponent("authCheck");
+ $authCheck =& $this->_container->getComponent("authCheck");
$_user_id = $this->_session->getParameter("_user_id");
@@ -1177,26 +1156,26 @@ function getReserveByDate($from_date, $to_date=null)
" OR (reserve.end_date >= ? AND reserve.end_date <= ?)" .
" OR (reserve.start_date <= ? AND reserve.end_date >= ?))";
- switch ($reserve_block["display_type"]) {
- case RESERVATION_DEF_LOCATION:
- if ($reserve_block["category_id"] != 0) {
- $sql .= " AND location.category_id = ?";
- $params["category_id"] = $reserve_block["category_id"];
- }
+ switch ($reserve_block["display_type"]) {
+ case RESERVATION_DEF_LOCATION:
+ if ($reserve_block["category_id"] != 0) {
+ $sql .= " AND location.category_id = ?";
+ $params["category_id"] = $reserve_block["category_id"];
+ }
$sql .= " ORDER BY reserve.location_id, reserve.allday_flag DESC, reserve.start_date, reserve.start_time, reserve.end_date, reserve.end_time, reserve.reserve_id";
break;
- case RESERVATION_DEF_WEEKLY:
- case RESERVATION_DEF_MONTHLY:
- default:
- $sql .= " AND reserve.location_id = ?";
- $params["location_id"] = $reserve_block["location_id"];
+ case RESERVATION_DEF_WEEKLY:
+ case RESERVATION_DEF_MONTHLY:
+ default:
+ $sql .= " AND reserve.location_id = ?";
+ $params["location_id"] = $reserve_block["location_id"];
$sql .= " ORDER BY reserve.allday_flag DESC, reserve.start_date, reserve.start_time, reserve.end_date, reserve.end_time, reserve.location_id, reserve.reserve_id";
- }
+ }
- $result = $this->_db->execute($sql, $params, null, null, true, array($this,"_getReserveByDate"));
+ $result = $this->_db->execute($sql, $params, null, null, true, array($this,"_getReserveByDate"));
if ($result === false) {
- $this->_db->addError();
- return $result;
+ $this->_db->addError();
+ return $result;
}
return $result;
}
@@ -1372,63 +1351,84 @@ function getAddReserve()
$title_icon = $this->_request->getParameter("icon_name");
- $reserve = array(
- "room_id" => intval($this->_request->getParameter("reserve_room_id")),
- "location_id" => $this->_request->getParameter("location_id"),
- "category_id" => $this->_request->getParameter("category_id"),
- "title" => $this->_request->getParameter("title"),
- "title_icon" => $title_icon,
- "allday_flag" => intval($this->_request->getParameter("allday_flag")),
- "start_date" => date("Ymd", $current_timestamp),
- "input_start_date" => date(_INPUT_DATE_FORMAT, $current_timestamp),
- "start_time_view" => $start_time,
- "end_date" => date("Ymd", $current_timestamp),
- "input_end_date" => date(_INPUT_DATE_FORMAT, $current_timestamp),
- "end_time_view" => $end_time,
- "timezone_offset" => $this->_session->getParameter("_timezone_offset"),
- "contact" => "",
- "description" => "",
- "rrule" => "",
- "rrule_arr" => $this->parseRRule(""),
- "rrule_set_arr" => $this->parseRRule("", true),
- );
+ $reserve = array(
+ "room_id" => intval($this->_request->getParameter("reserve_room_id")),
+ "location_id" => $this->_request->getParameter("location_id"),
+ "category_id" => $this->_request->getParameter("category_id"),
+ "title" => $this->_request->getParameter("title"),
+ "title_icon" => $title_icon,
+ "allday_flag" => intval($this->_request->getParameter("allday_flag")),
+ "start_date" => date("Ymd", $current_timestamp),
+ "input_start_date" => date(_INPUT_DATE_FORMAT, $current_timestamp),
+ "start_time_view" => $start_time,
+ "end_date" => date("Ymd", $current_timestamp),
+ "input_end_date" => date(_INPUT_DATE_FORMAT, $current_timestamp),
+ "end_time_view" => $end_time,
+ "timezone_offset" => $this->_session->getParameter("_timezone_offset"),
+ "contact" => "",
+ "description" => "",
+ "rrule" => "",
+ "rrule_arr" => $this->parseRRule(""),
+ "rrule_set_arr" => $this->parseRRule("", true),
+ );
return $reserve;
}
/**
- * 施設に紐付くルーム取得
+ * 施設に紐付く予約できる権限のルーム取得
*
+ * @param &$location 施設情報
* @access public
*/
- function getAddLocationRoom()
+ function getAddLocationRoom(&$location)
{
$pagesView =& $this->_container->getComponent("pagesView");
-
- $_user_auth_id = $this->_session->getParameter("_user_auth_id");
-
- $location = $this->_request->getParameter("location");
+ $_user_auth_id = $this->_session->getparameter('_user_auth_id');
$room_id_arr = $pagesView->getRoomIdByUserId(null, $location["add_authority"]);
if ($room_id_arr === false) {
return false;
}
- $private_spase = $pagesView->getPrivateSpaceByUserId($this->_session->getParameter("_user_id"));
- if ($private_spase === false) {
+ if ($location['add_authority'] == _AUTH_GENERAL) {
+ $search_result = array_search(_SELF_TOPGROUP_ID, $room_id_arr);
+ if ($search_result) {
+ unset($room_id_arr[$search_result]);
+ }
+ }
+ $private_space = $pagesView->getPrivateSpaceByUserId($this->_session->getParameter("_user_id"));
+ if ($private_space === false) {
return false;
}
- if (!empty($private_spase)) {
- $private_room_id = $private_spase[0]["page_id"];
+ if (!empty($private_space)) {
+ $private_room_id = $private_space[0]["page_id"];
} else {
$private_room_id = 0;
}
- if ($location["hasPrivateAddReserve"] == _OFF || $_user_auth_id < $location["add_authority"]) {
+ $actionChain =& $this->_container->getComponent('ActionChain');
+ $actionName = $actionChain->getCurActionName();
+
+ $location['hasPrivateReserveAuthority'] = false;
+ if ($location['use_private_flag'] == _ON && !empty($room_id_arr)
+ && $actionName != 'reservation_view_main_reserve_switch_location'
+ && $actionName != 'reservation_view_edit_import_init') {
+
+ if ($location['use_auth_flag'] == RESERVATION_USE_AUTH_USER
+ && ($_user_auth_id == _AUTH_ADMIN || $location['add_authority'] <= $_user_auth_id)) {
+ $location['hasPrivateReserveAuthority'] = true;
+ } elseif ($location['use_auth_flag'] == RESERVATION_USE_AUTH_ROOM
+ && count($room_id_arr) > 1) {
+ $location['hasPrivateReserveAuthority'] = true;
+ }
+ }
+ if (!$location['hasPrivateReserveAuthority']) {
$search_result = array_search($private_room_id, $room_id_arr);
if ($search_result != 0 || $search_result === 0) {
unset($room_id_arr[$search_result]);
}
}
+
if (count($room_id_arr) == 0) {
return false;
}
@@ -1436,7 +1436,6 @@ function getAddLocationRoom()
if ($location["allroom_flag"] == _ON) {
return $room_id_arr;
}
-
$params = array("location_id" => $location["location_id"]);
$sql = "SELECT location.location_id, l_rooms.room_id, page.thread_num, page.private_flag, page.space_type, page.page_name";
$sql .= " FROM {reservation_location} location".
@@ -1447,32 +1446,21 @@ function getAddLocationRoom()
$sql .= " WHERE location.location_id = ?".
" AND l_rooms.room_id IN (".implode(",",$room_id_arr).")";
- $result = $this->_db->execute($sql, $params, null, null, true, array($this,"_getLocationRoom"));
- if ($result === false) {
+ $allow_add_rooms = $this->_db->execute($sql, $params, null, null, true, array($this,"_getLocationRoom"));
+ if ($allow_add_rooms === false) {
$this->_db->addError();
- return $result;
+ return false;
+ }
+ if ($location['hasPrivateReserveAuthority']) {
+ $allow_add_rooms[] = $private_room_id;
}
- $actionChain =& $this->_container->getComponent("ActionChain");
- $actionName = $actionChain->getCurActionName();
- if ($actionName == "reservation_action_edit_location_modify" ||
- $actionName == "reservation_view_edit_import_init" ||
- $actionName == "reservation_action_edit_import" ||
- $actionName == "reservation_view_main_reserve_add" ||
- $actionName == "reservation_view_main_reserve_modify" ||
- $actionName == "reservation_action_main_reserve_add" ||
- $actionName == "reservation_action_main_reserve_modify" ||
- $actionName == "reservation_view_main_reserve_switch_location") {
-
- if ($location["hasPrivateAddReserve"] == _ON && $private_room_id > 0 && in_array($private_room_id, $room_id_arr)) {
- $result[] = $private_room_id;
- }
- } else {
- if ($location["hasPrivateAddReserve"] == _ON && $private_room_id > 0 && in_array($private_room_id, $room_id_arr)) {
- $result[RESERVATION_PRIVATE][$private_room_id] = $private_spase[0]["page_name"];
- }
+ if ($location['use_auth_flag'] == RESERVATION_USE_AUTH_ROOM
+ && count($allow_add_rooms) == 0) {
+ $location['hasPrivateReserveAuthority'] = false;
}
- return $result;
+
+ return $allow_add_rooms;
}
/**
@@ -1644,30 +1632,30 @@ function getMailConfig()
$configView =& $this->_container->getComponent("configView");
$config = $configView->getConfig($module_id, false);
if ($config === false) {
- return false;
- }
+ return false;
+ }
$result = array();
- if (defined($config["mail_send"]["conf_value"])) {
- $result["mail_send"] = constant($config["mail_send"]["conf_value"]);
- } else {
- $result["mail_send"] = intval($config["mail_send"]["conf_value"]);
- }
- if (defined($config["mail_authority"]["conf_value"])) {
- $result["mail_authority"] = constant($config["mail_authority"]["conf_value"]);
- } else {
- $result["mail_authority"] = intval($config["mail_authority"]["conf_value"]);
- }
- if (defined($config["mail_subject"]["conf_value"])) {
- $result["mail_subject"] = constant($config["mail_subject"]["conf_value"]);
- } else {
- $result["mail_subject"] = $config["mail_subject"]["conf_value"];
- }
- if (defined($config["mail_body"]["conf_value"])) {
- $result["mail_body"] = preg_replace("/\\\\n/s", "\n", constant($config["mail_body"]["conf_value"]));
- } else {
- $result["mail_body"] = preg_replace("/\\\\n/s", "\n", $config["mail_body"]["conf_value"]);
- }
+ if (defined($config["mail_send"]["conf_value"])) {
+ $result["mail_send"] = constant($config["mail_send"]["conf_value"]);
+ } else {
+ $result["mail_send"] = intval($config["mail_send"]["conf_value"]);
+ }
+ if (defined($config["mail_authority"]["conf_value"])) {
+ $result["mail_authority"] = constant($config["mail_authority"]["conf_value"]);
+ } else {
+ $result["mail_authority"] = intval($config["mail_authority"]["conf_value"]);
+ }
+ if (defined($config["mail_subject"]["conf_value"])) {
+ $result["mail_subject"] = constant($config["mail_subject"]["conf_value"]);
+ } else {
+ $result["mail_subject"] = $config["mail_subject"]["conf_value"];
+ }
+ if (defined($config["mail_body"]["conf_value"])) {
+ $result["mail_body"] = preg_replace("/\\\\n/s", "\n", constant($config["mail_body"]["conf_value"]));
+ } else {
+ $result["mail_body"] = preg_replace("/\\\\n/s", "\n", $config["mail_body"]["conf_value"]);
+ }
return $result;
}
@@ -1687,10 +1675,10 @@ function getRepeatReserveId($reserve_details_id)
"reserve_details_id" => $reserve_details_id
);
- $result = $this->_db->execute($sql, $params, null, null, true, array($this,"_getRepeatReserveId"));
+ $result = $this->_db->execute($sql, $params, null, null, true, array($this,"_getRepeatReserveId"));
if ($result === false) {
- $this->_db->addError();
- return $result;
+ $this->_db->addError();
+ return $result;
}
return $result;
}
@@ -1748,7 +1736,7 @@ function &defaultRRule()
$result_array["DAILY"] = array(
"INTERVAL" => 1
);
- return $result_array;
+ return $result_array;
}
/**
@@ -1801,7 +1789,7 @@ function &parseRRule($rrule_str="", $base_flag=false)
$result_array[$freq][$key] = explode(",", $val);
}
}
- return $result_array;
+ return $result_array;
}
/**
@@ -1920,7 +1908,7 @@ function stringRRule($rrule)
$result_str .= " ";
$result_str .= sprintf(RESERVATION_RRULE_COUNT, $rrule["COUNT"]);
}
- return $result_str;
+ return $result_str;
}
@@ -2127,7 +2115,7 @@ function getRepeatReserve($rrule)
default:
$repeat_time = null;
}
- return $repeat_time;
+ return $repeat_time;
}
/**
@@ -2262,18 +2250,18 @@ function __repeatYearlyByday(&$repeat_time, &$params, &$rrule, $first=false)
$timestamp = mktime(0, 0, 0, substr($s_time,4,2), 1, substr($s_time,0,4));
$year = date("Y", $timestamp);
$month = date("m", $timestamp);
- if ($week == -1) {
+ if ($week == -1) {
$last_day = date("t", $timestamp);
$timestamp = mktime(0, 0, 0, $month, $last_day, $year);
$w_last_day = date("w", $timestamp);
$w_last_day = ($wday_num <= $w_last_day ? $w_last_day : 7 + $w_last_day);
- $timestamp = mktime(0, 0, 0, $month, $last_day - $w_last_day + $wday_num, $year);
- } else {
+ $timestamp = mktime(0, 0, 0, $month, $last_day - $w_last_day + $wday_num, $year);
+ } else {
$w_1day = date("w", $timestamp);
$w_1day = ($w_1day <= $wday_num ? 7 + $w_1day : $w_1day);
$day = $week * 7 + $wday_num + 1;
$timestamp = mktime(0, 0, 0, $month, $day - $w_1day, $year);
- }
+ }
$byday = date("YmdHis", $timestamp);
if ($first && $s_time >= $byday) {
$rrule["INDEX"]--;
@@ -2370,18 +2358,18 @@ function _repeatMonthlyByDay(&$repeat_time, &$params, &$rrule, $first=false)
$timestamp = mktime(0, 0, 0, substr($s_time,4,2) + ($first ? 0 : $rrule["INTERVAL"]), 1, substr($s_time,0,4));
$year = date("Y", $timestamp);
$month = date("m", $timestamp);
- if ($week == -1) {
+ if ($week == -1) {
$last_day = date("t", $timestamp);
$timestamp = mktime(0, 0, 0, $month, $last_day, $year);
$w_last_day = date("w", $timestamp);
$w_last_day = ($wday_num <= $w_last_day ? $w_last_day : 7 + $w_last_day);
- $timestamp = mktime(0, 0, 0, $month, $last_day - $w_last_day + $wday_num, $year);
- } else {
+ $timestamp = mktime(0, 0, 0, $month, $last_day - $w_last_day + $wday_num, $year);
+ } else {
$w_1day = date("w", $timestamp);
$w_1day = ($w_1day <= $wday_num ? 7 + $w_1day : $w_1day);
$day = $week * 7 + $wday_num + 1;
$timestamp = mktime(0, 0, 0, $month, $day - $w_1day, $year);
- }
+ }
$byday = date("YmdHis", $timestamp);
if ($first && $s_time >= $byday) {
$rrule["INDEX"]--;
@@ -2527,7 +2515,7 @@ function _setRepeatTime(&$repeat_time, &$params, $start_time_full, $end_time_ful
);
$repeat_time[] = $r_array;
- return $repeat_time;
+ return $repeat_time;
}
/**
@@ -2597,7 +2585,7 @@ function _getSearchResults(&$recordSet)
$ret_row["pubDate"] = $row["start_time_full"];
$ret_row["title_icon"] = $row["title_icon"];
$ret_row["title"] = $row["title"];
- $ret_row["url"] = "?action=".DEFAULT_ACTION.
+ $ret_row["url"] = "?action=".DEFAULT_ACTION.
"&page_id=".$this->_session->getParameter("_main_page_id").
"&active_center=reservation_view_main_init" .
"&reserve_id=".$row["reserve_id"];
diff --git a/html/webapp/modules/reservation/config/main.ini b/html/webapp/modules/reservation/config/main.ini
index ad00dc2..53e9e6a 100644
--- a/html/webapp/modules/reservation/config/main.ini
+++ b/html/webapp/modules/reservation/config/main.ini
@@ -33,3 +33,6 @@ define:RESERVATION_SELECT_MAX_YEAR = 2034
define:RESERVATION_SELECT_MIN_TIME = 0.25
define:RESERVATION_IMPORT_FILENAME = "reservation_import"
+
+define:RESERVATION_USE_AUTH_USER = "0"
+define:RESERVATION_USE_AUTH_ROOM = "1"
diff --git a/html/webapp/modules/reservation/language/chinese/main.ini b/html/webapp/modules/reservation/language/chinese/main.ini
index 243498b..8f64750 100644
--- a/html/webapp/modules/reservation/language/chinese/main.ini
+++ b/html/webapp/modules/reservation/language/chinese/main.ini
@@ -56,12 +56,14 @@ reservation_minute = "%s"
reservation_pause = " - "
reservation_duplication_flag = "允许同一时段有一个以上的用户预订?"
reservation_use_private_flag = "允许个人使用"
+reservation_use_auth_user = "用户权限"
+reservation_use_auth_room = "房间权限"
reservation_allroom_flag = "允许所有群组使用"
reservation_room_select = "选择房间"
[Reservation_View_Edit_Location_Add:Reservation_View_Edit_Location_Modify]
reservation_summary = _SUMMARY_INPUTFORM
-reservation_use_private_desc = "只有具有权限的用户才允许个人预约。"
+reservation_use_private_desc = "请选择个人使用的权限。"
[Reservation_Action_Edit_Location]
reservation_description = "详细信息"
diff --git a/html/webapp/modules/reservation/language/english/main.ini b/html/webapp/modules/reservation/language/english/main.ini
index 5172f51..7f1acae 100644
--- a/html/webapp/modules/reservation/language/english/main.ini
+++ b/html/webapp/modules/reservation/language/english/main.ini
@@ -56,12 +56,14 @@ reservation_minute = "%s"
reservation_pause = " - "
reservation_duplication_flag = "Allow more than one reservation for one slot?"
reservation_use_private_flag = "Allow private use?"
+reservation_use_auth_user = "User authority"
+reservation_use_auth_room = "Room authority"
reservation_allroom_flag = "Allow all the groups to use?"
reservation_room_select = "Select rooms"
[Reservation_View_Edit_Location_Add:Reservation_View_Edit_Location_Modify]
reservation_summary = _SUMMARY_INPUTFORM
-reservation_use_private_desc = "Only the members who have the privilege are allowed to reserve for this institution for private use. "
+reservation_use_private_desc = "Please select from the following items."
[Reservation_Action_Edit_Location]
reservation_description = "Details"
@@ -187,7 +189,7 @@ define:RESERVATION_ERR_RESERVE_UNTIL_OVER = "Invalid input. The starting d
define:RESERVATION_ERR_RESERVE_FROM_TO_DATE = "Not available."
define:RESERVATION_ERR_RESERVE_DUPLICATION = "It has been already reserved by someone else. Try different time and date."
define:RESERVATION_ERR_RESERVE_DATE = "(%s)"
-define:RESERVATION_ERR_RESERVE_MIN_TIME = "予約時間の間隔を15分単位で設定して下さい。"
+define:RESERVATION_ERR_RESERVE_MIN_TIME = "Please register a booking for more than 15 minutes."
reservation_err_reserve_from_to_date = RESERVATION_ERR_RESERVE_FROM_TO_DATE
reservation_err_reserve_duplication = RESERVATION_ERR_RESERVE_DUPLICATION
reservation_contact = "Contact"
@@ -213,10 +215,10 @@ reservation_insert_user_title = "Poster:%s"
reservation_label_date = "Date"
reservation_reserve_title = "Title"
reservation_reserve_time = "Day"
-define:RESERVATION_RRULE_ERR_MONTH = "繰返しの月が指定されていません。必ず1つ指定して下さい。"
-define:RESERVATION_RRULE_ERR_WDAY = "繰返しの曜日が指定されていません。必ず1つ指定して下さい。"
-define:RESERVATION_RRULE_ERR_WDAY_OR_DAY = "繰返しの曜日または日付が指定されていません。必ずどちらか指定して下さい。"
-define:RESERVATION_RRULE_ERR_COUNT_OR_UNTIL = "繰返しの回数または終了日が指定されていません。必ずどちらか指定して下さい。"
+define:RESERVATION_RRULE_ERR_MONTH = "Please specify at least one."
+define:RESERVATION_RRULE_ERR_WDAY = "Please specify at least one."
+define:RESERVATION_RRULE_ERR_WDAY_OR_DAY = "Please specify what date or day of the week."
+define:RESERVATION_RRULE_ERR_COUNT_OR_UNTIL = "Please specify the range."
define:RESERVATION_RRULE_ERR_INTERVAL = "Interval"
define:RESERVATION_RRULE_LBL_COUNT = "the number of "
diff --git a/html/webapp/modules/reservation/language/japanese/main.ini b/html/webapp/modules/reservation/language/japanese/main.ini
index 5fae0bb..df04b08 100644
--- a/html/webapp/modules/reservation/language/japanese/main.ini
+++ b/html/webapp/modules/reservation/language/japanese/main.ini
@@ -56,12 +56,14 @@ reservation_minute = "%s分"
reservation_pause = " ~ "
reservation_duplication_flag = "予約の時間帯を重複可能にする"
reservation_use_private_flag = "個人的な予約を受け付ける"
+reservation_use_auth_user = "会員の権限"
+reservation_use_auth_room = "ルームでの権限"
reservation_allroom_flag = "全てのルームから予約を受け付ける"
-reservation_room_select = "ルームの選択"
+reservation_room_select = "予定を受け付けるルーム"
[Reservation_View_Edit_Location_Add:Reservation_View_Edit_Location_Modify]
reservation_summary = _SUMMARY_INPUTFORM
-reservation_use_private_desc = "ただし、個人的な予約を登録できるユーザは 「予約できる権限」で指定された会員に限られます。"
+reservation_use_private_desc = "個人的な予約で使用する権限を以下の項目から選択してください。"
[Reservation_Action_Edit_Location]
reservation_description = "詳細"
@@ -163,7 +165,7 @@ reservation_no_reserve_flag = "-- 指定しない --"
reservation_details_addreserve = "予約の詳細"
reservation_detail_items = "予約の詳細を表示します。"
reservation_notification_mail = "メールで通知"
-reservation_no_reserve = "予約できませんでした"
+reservation_no_reserve = "利用できるグループがありません"
reservation_error_reserve_flag = "このグループは当該施設を予約できません。"
reservation_allday_flag = "利用時間の制限なし"
@@ -187,7 +189,7 @@ define:RESERVATION_ERR_RESERVE_UNTIL_OVER = "繰返しの終了日が予約の
define:RESERVATION_ERR_RESERVE_FROM_TO_DATE = "予約時間の範囲に誤りがあります。予約時間を確認し、正しい時間帯を入力してください。"
define:RESERVATION_ERR_RESERVE_DUPLICATION = "既に予約が入っているため、予約できません。"
define:RESERVATION_ERR_RESERVE_DATE = "(%s)"
-define:RESERVATION_ERR_RESERVE_MIN_TIME = "予約時間は15分単位で指定できます。予約時間を適切に調整してください。"
+define:RESERVATION_ERR_RESERVE_MIN_TIME = "15分以上の予約を登録してください。"
reservation_err_reserve_from_to_date = RESERVATION_ERR_RESERVE_FROM_TO_DATE
reservation_err_reserve_duplication = RESERVATION_ERR_RESERVE_DUPLICATION
reservation_contact = "連絡先"
diff --git a/html/webapp/modules/reservation/sql/mysql/table.sql b/html/webapp/modules/reservation/sql/mysql/table.sql
index df37e72..24724cd 100644
--- a/html/webapp/modules/reservation/sql/mysql/table.sql
+++ b/html/webapp/modules/reservation/sql/mysql/table.sql
@@ -91,13 +91,14 @@ CREATE TABLE `reservation_location` (
`category_id` int(11) unsigned NOT NULL default '0',
`location_name` varchar(255) NOT NULL default '',
`active_flag` tinyint unsigned NOT NULL default '0',
- `add_authority` tinyint unsigned NOT NULL default '0',
+ `add_authority` tinyint unsigned NOT NULL default '0',
`time_table` varchar(32) 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',
`duplication_flag` tinyint unsigned NOT NULL default '0',
`use_private_flag` tinyint unsigned NOT NULL default '0',
+ `use_auth_flag` tinyint unsigned NOT NULL default '0',
`allroom_flag` tinyint unsigned NOT NULL default '0',
`display_sequence` int(11) unsigned NOT NULL default '0',
`room_id` int(11) default NULL,
diff --git a/html/webapp/modules/reservation/templates/default/reservation_location_regist_authority.html b/html/webapp/modules/reservation/templates/default/reservation_location_regist_authority.html
index 4f9958e..d25de8f 100644
--- a/html/webapp/modules/reservation/templates/default/reservation_location_regist_authority.html
+++ b/html/webapp/modules/reservation/templates/default/reservation_location_regist_authority.html
@@ -7,24 +7,43 @@
-
-
+
+
<{$smarty.const._AUTH_CHIEF_NAME}>
-
-
-
-
-
+
+
+
+
+
<{$smarty.const._AUTH_MODERATE_NAME}>
-
-
-
-
+
+
+
+
<{$smarty.const._AUTH_GENERAL_NAME}>
+
+
+ <{if ($location.use_private_flag == _ON) }> checked="checked"<{/if}> onchange="commonCls.displayChange($('reservation_use_auth<{$id}>')); return false;" />
+ <{$lang.reservation_use_private_flag|smarty:nodefaults}>
+
+
+
+ <{$lang.reservation_use_private_desc|smarty:nodefaults}>
+
+
+ <{if ($location.use_auth_flag == "" || $location.use_auth_flag == $smarty.const.RESERVATION_USE_AUTH_USER) }> checked="checked"<{/if}> />
+ <{$lang.reservation_use_auth_user|smarty:nodefaults}>
+
+
+
+ <{if ($location.use_auth_flag == $smarty.const.RESERVATION_USE_AUTH_ROOM) }> checked="checked"<{/if}> />
+ <{$lang.reservation_use_auth_room|smarty:nodefaults}>
+
+
<{/strip}>
\ No newline at end of file
diff --git a/html/webapp/modules/reservation/templates/default/reservation_location_regist_location_name.html b/html/webapp/modules/reservation/templates/default/reservation_location_regist_location_name.html
index e948f2d..9ed6eea 100644
--- a/html/webapp/modules/reservation/templates/default/reservation_location_regist_location_name.html
+++ b/html/webapp/modules/reservation/templates/default/reservation_location_regist_location_name.html
@@ -7,14 +7,6 @@
-
-
- <{if ($location.use_private_flag == _ON) }> checked="checked"<{/if}> />
- <{$lang.reservation_use_private_flag|smarty:nodefaults}>
-
-
- <{$lang.reservation_use_private_desc|smarty:nodefaults}>
-
<{/strip}>
\ No newline at end of file
diff --git a/html/webapp/modules/reservation/templates/default/reservation_view_edit_location_regist.html b/html/webapp/modules/reservation/templates/default/reservation_view_edit_location_regist.html
index d7b3dfe..527e744 100644
--- a/html/webapp/modules/reservation/templates/default/reservation_view_edit_location_regist.html
+++ b/html/webapp/modules/reservation/templates/default/reservation_view_edit_location_regist.html
@@ -12,11 +12,11 @@
- <{include file="reservation_location_regist_authority.html" location=$action.location|smarty:nodefaults}>
+ <{include file="reservation_location_regist_category.html" location=$action.location|smarty:nodefaults}>
- <{include file="reservation_location_regist_category.html" location=$action.location|smarty:nodefaults}>
+ <{include file="reservation_location_regist_authority.html" location=$action.location|smarty:nodefaults}>
diff --git a/html/webapp/modules/reservation/templates/default/reservation_view_main_list_location.html b/html/webapp/modules/reservation/templates/default/reservation_view_main_list_location.html
index 73d62ea..c3332ba 100644
--- a/html/webapp/modules/reservation/templates/default/reservation_view_main_list_location.html
+++ b/html/webapp/modules/reservation/templates/default/reservation_view_main_list_location.html
@@ -17,7 +17,7 @@
<{$reserve.short_title}>
<{else}>
-
+
<{$reserve.insert_user_name}>
<{/if}>
diff --git a/html/webapp/modules/reservation/templates/default/reservation_view_main_list_monthly.html b/html/webapp/modules/reservation/templates/default/reservation_view_main_list_monthly.html
index 426c962..fa5e12b 100644
--- a/html/webapp/modules/reservation/templates/default/reservation_view_main_list_monthly.html
+++ b/html/webapp/modules/reservation/templates/default/reservation_view_main_list_monthly.html
@@ -20,7 +20,7 @@
<{$reserve.short_title}>
<{else}>
-
+
/images/common/blank.gif" class="icon <{$reserve_class}> reservation_reserve_mark" alt="" title="" />
<{$reserve.insert_user_name}>
diff --git a/html/webapp/modules/reservation/templates/default/reservation_view_main_list_weekly.html b/html/webapp/modules/reservation/templates/default/reservation_view_main_list_weekly.html
index b57d0b9..2a32298 100644
--- a/html/webapp/modules/reservation/templates/default/reservation_view_main_list_weekly.html
+++ b/html/webapp/modules/reservation/templates/default/reservation_view_main_list_weekly.html
@@ -17,7 +17,7 @@
<{$reserve.short_title}>
<{else}>
-
+
<{$reserve.insert_user_name}>
<{/if}>
diff --git a/html/webapp/modules/reservation/templates/default/reservation_view_recursive_room.html b/html/webapp/modules/reservation/templates/default/reservation_view_recursive_room.html
index 3c9d551..01b6a7f 100644
--- a/html/webapp/modules/reservation/templates/default/reservation_view_recursive_room.html
+++ b/html/webapp/modules/reservation/templates/default/reservation_view_recursive_room.html
@@ -22,7 +22,7 @@
<{assign var="reserve_name" value=$room.page_name}>
<{/if}>
- <{if (($reserve_flag != RESERVATION_PRIVATE || $action.private_space && $reserve_flag == RESERVATION_PRIVATE) && ($reserve_flag != RESERVATION_GROUP || $reserve_flag == RESERVATION_GROUP && $room.thread_num != 0)) }>
+ <{if (($reserve_flag != RESERVATION_PRIVATE || $action.location.hasPrivateReserveAuthority && $reserve_flag == RESERVATION_PRIVATE) && ($reserve_flag != RESERVATION_GROUP || $reserve_flag == RESERVATION_GROUP && $room.thread_num != 0)) }>
<{assign var="room_id" value=$room.page_id}>
<{if ($reserve_flag == RESERVATION_GROUP) }>
<{assign var="indent" value=$room.thread_num-1}>
@@ -30,7 +30,7 @@
<{assign var="indent" value=$room.thread_num}>
<{/if}>
- <{if ($reserve_flag != RESERVATION_PUBLIC && ($action_name == "reservation_view_edit_location_add" || $action_name == "reservation_view_edit_location_modify")) }>
+ <{if ($action_name == "reservation_view_edit_location_add" || $action_name == "reservation_view_edit_location_modify") }>
<{assign var="select_rooms" value=$action.select_rooms.$reserve_flag}>
@@ -41,7 +41,7 @@
- <{elseif ($reserve_flag != RESERVATION_PUBLIC && ($action_name == "reservation_view_main_location_details"))}>
+ <{elseif ($action_name == "reservation_view_main_location_details") }>
<{assign var="select_rooms" value=$action.select_rooms.$reserve_flag}>
<{if ($select_rooms.$room_id) }><{else}> class="disable_lbl"<{/if}>>
<{" "|str_repeat:$indent}>
diff --git a/html/webapp/modules/reservation/update/Update.class.php b/html/webapp/modules/reservation/update/Update.class.php
index 4cb9b39..c553678 100644
--- a/html/webapp/modules/reservation/update/Update.class.php
+++ b/html/webapp/modules/reservation/update/Update.class.php
@@ -16,6 +16,15 @@ class Reservation_Update extends Action
function execute()
{
+ $adodb = $this->db->getAdoDbObject();
+ $metaColumns = $adodb->MetaColumns($this->db->getPrefix()."reservation_location");
+ if (!isset($metaColumns["use_auth_flag"]) && !isset($metaColumns["USE_AUTH_FLAG"])) {
+ $sql = "ALTER TABLE `".$this->db->getPrefix()."reservation_location"."` ADD `use_auth_flag` TINYINT unsigned NOT NULL default '0' AFTER `use_private_flag` ;";
+ $result = $this->db->execute($sql);
+ if ($result === false) {
+ return false;
+ }
+ }
// reservation_blockにindexを追加
$sql = "SHOW INDEX FROM `".$this->db->getPrefix()."reservation_block` ;";
$results = $this->db->execute($sql);
diff --git a/html/webapp/modules/reservation/validator/Validator_LocationView.class.php b/html/webapp/modules/reservation/validator/Validator_LocationView.class.php
index c7effb7..a253258 100644
--- a/html/webapp/modules/reservation/validator/Validator_LocationView.class.php
+++ b/html/webapp/modules/reservation/validator/Validator_LocationView.class.php
@@ -71,36 +71,25 @@ function validate($attributes, $errStr, $params)
$request->setParameter("location_list", $location_list);
$request->setParameter("location_count", count($location_list));
- } elseif ($actionName == "reservation_action_main_reserve_add" || $actionName == "reservation_action_main_reserve_modify" ||
- $actionName == "reservation_action_edit_import") {
+ } elseif ($actionName == "reservation_view_main_reserve_add" || $actionName == "reservation_view_main_reserve_modify"
+ || $actionName == "reservation_view_main_reserve_switch_category" || $actionName == "reservation_view_main_reserve_switch_location"
+ || $actionName == "reservation_action_main_reserve_add" || $actionName == "reservation_action_main_reserve_modify"
+ || $actionName == "reservation_action_edit_import"
+ ) {
$location = $reservationView->getLocation($attributes["location_id"]);
if (empty($location)) {
return $errStr;
}
- $request->setParameter("location", $location);
-
- $select_rooms = $reservationView->getAddLocationRoom();
- if (empty($select_rooms)) {
- $select_rooms = array();
- }
- $request->setParameter("allow_add_rooms", $select_rooms);
-
- } elseif ($actionName == "reservation_view_main_reserve_add" || $actionName == "reservation_view_main_reserve_modify" ||
- $actionName == "reservation_view_main_reserve_switch_category" || $actionName == "reservation_view_main_reserve_switch_location") {
-
- $location = $reservationView->getLocation($attributes["location_id"]);
- if (empty($location)) {
- return $errStr;
+ $allow_add_rooms = $reservationView->getAddLocationRoom($location);
+ if (empty($allow_add_rooms)) {
+ $allow_add_rooms = array();
}
$request->setParameter("location", $location);
+ $request->setParameter("allow_add_rooms", $allow_add_rooms);
- $select_rooms = $reservationView->getAddLocationRoom();
- if (empty($select_rooms)) {
- $select_rooms = array();
- }
- $request->setParameter("allow_add_rooms", $select_rooms);
-
- if ($actionName != "reservation_view_main_reserve_switch_location") {
+ if ($actionName == "reservation_view_main_reserve_add" || $actionName == "reservation_view_main_reserve_modify"
+ || $actionName == "reservation_view_main_reserve_switch_category"
+ ) {
if ($attributes["category_id"] > 0) {
$location_list = $reservationView->getLocations($attributes["category_id"]);
} else {
diff --git a/html/webapp/modules/reservation/view/edit/import/init/Init.class.php b/html/webapp/modules/reservation/view/edit/import/init/Init.class.php
index 2f3d86e..c2bb222 100644
--- a/html/webapp/modules/reservation/view/edit/import/init/Init.class.php
+++ b/html/webapp/modules/reservation/view/edit/import/init/Init.class.php
@@ -36,32 +36,32 @@ class Reservation_View_Edit_Import_Init extends Action
var $help_end_time = "";
var $location_id = 0;
- /**
- * execute処理
- *
- * @access public
- */
- function execute()
- {
- $this->help_start_time = "090000";
- $this->help_end_time = "180000";
- $this->help_reserve_time = timezone_date_format(null, "Ymd");
+ /**
+ * execute処理
+ *
+ * @access public
+ */
+ function execute()
+ {
+ $this->help_start_time = "090000";
+ $this->help_end_time = "180000";
+ $this->help_reserve_time = timezone_date_format(null, "Ymd");
$this->category_list = $this->reservationView->getCategories();
$this->location_count_list = $this->reservationView->getCountLocationByCategory();
- $this->location_list = $this->reservationView->getLocations();
- $this->location_count = count($this->location_list);
- foreach ($this->location_list as $location) {
- $this->location = $location;
- $this->location_id = $this->location["location_id"];
+ $this->location_list = $this->reservationView->getLocations();
+ $this->location_count = count($this->location_list);
+ foreach ($this->location_list as $location) {
+ $this->location = $location;
+ $this->location_id = $this->location["location_id"];
$this->request->setParameter("location", $location);
- break;
- }
+ break;
+ }
- $this->allow_add_rooms = $this->reservationView->getAddLocationRoom();
+ $this->allow_add_rooms = $this->reservationView->getAddLocationRoom($location);
return 'success';
- }
+ }
}
?>
\ No newline at end of file
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 f5fde1f..5fc9f22 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
@@ -39,7 +39,6 @@ class Reservation_View_Main_Reserve_Add extends Action
// 値をセットするため
var $reserve = null;
var $edit_rrule = null;
- var $private_space = null;
var $reserve_room_id = null;
var $week_list = null;
var $timezone_list = null;
@@ -60,9 +59,6 @@ function execute()
if ($this->details_flag == _ON) {
$this->edit_rrule = RESERVATION_RESERVE_EDIT_ALL;
}
- if ($this->location["hasPrivateAddReserve"] == _ON) {
- $this->private_space = _ON;
- }
$this->reserve_room_id = $this->reserve["room_id"];
$this->timezone_list = explode("|", RESERVATION_DEF_TIMEZONE);
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 a3f3520..a70db48 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
@@ -36,7 +36,6 @@ class Reservation_View_Main_Reserve_Modify extends Action
// 値をセットするため
var $edit_rrule = null;
- var $private_space = null;
var $reserve_room_id = null;
var $week_list = null;
var $timezone_list = null;
@@ -51,9 +50,6 @@ class Reservation_View_Main_Reserve_Modify extends Action
*/
function execute()
{
- if ($this->location["hasPrivateAddReserve"] == _ON) {
- $this->private_space = _ON;
- }
$this->reserve_room_id = $this->reserve["room_id"];
$this->week_list = $this->reservationView->getLocationWeekArray();
diff --git a/html/webapp/modules/rss/components/Parse.class.php b/html/webapp/modules/rss/components/Parse.class.php
index 6fe8022..2479dfd 100644
--- a/html/webapp/modules/rss/components/Parse.class.php
+++ b/html/webapp/modules/rss/components/Parse.class.php
@@ -79,15 +79,26 @@ function &parse($xml, $encoding)
"webmaster" => $xmlArray["author"]["name"],
"generator" => !empty($xmlArray["generator"]) ? $xmlArray["generator"] : "",
);
+ if (isset($xmlArray["entry"]["title"])) {
+ $entry = $xmlArray["entry"];
+ unset($xmlArray["entry"]);
+ $xmlArray["entry"][0] = $entry;
+ }
foreach ($xmlArray["entry"] as $entry ) {
+ if (!empty($entry["content"])) {
+ $description = !is_array($entry["content"]) ? $entry["content"] : $entry["content"]["_content"];
+ } elseif (!empty($entry["summary"])) {
+ $description = !is_array($entry["summary"]) ? $entry["summary"] : $entry["summary"]["_content"];
+ } else {
+ $description = "";
+ }
$atomArray["item"][] = array(
"title" => !is_array($entry["title"]) ? $entry["title"] : $entry["title"]["_content"],
"link" => $entry["link"]["href"],
"id" => $entry["id"],
"pubdate" => !empty($entry["updated"]) ? $entry["updated"] : (!empty($entry["modified"]) ? $entry["modified"] : ""),
- "description" => !empty($entry["content"]["_content"]) ? $entry["content"]["_content"] :
- !empty($entry["summary"]["_content"]) ? $entry["summary"]["_content"] : ''
+ "description" => $description
) ;
}
diff --git a/html/webapp/modules/user/install.ini b/html/webapp/modules/user/install.ini
index 8855c77..0963e07 100644
--- a/html/webapp/modules/user/install.ini
+++ b/html/webapp/modules/user/install.ini
@@ -2,5 +2,6 @@ version = "2.4.0.0"
action_name="user_view_main_search"
system_flag=1
module_icon="user.gif"
+module_update_action="user_update"
[CleanUp]
diff --git a/html/webapp/modules/user/validator/Validator_ItemsInputs.class.php b/html/webapp/modules/user/validator/Validator_ItemsInputs.class.php
index 104d924..0d31c3e 100644
--- a/html/webapp/modules/user/validator/Validator_ItemsInputs.class.php
+++ b/html/webapp/modules/user/validator/Validator_ItemsInputs.class.php
@@ -5,11 +5,11 @@
/**
* 項目テーブルの入力チェック(login_id, password,handle, email)
* 必須チェック
- * リクエストパラメータ
- * var $user_id = null;
- * var $items = null;
- * var $items_public = null;
- * var $items_reception = null;
+ * リクエストパラメータ
+ * var $user_id = null;
+ * var $items = null;
+ * var $items_public = null;
+ * var $items_reception = null;
*
* @package NetCommons.validator
* @author Noriko Arai,Ryuji Masukawa
@@ -20,29 +20,29 @@
*/
class User_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");
$_system_user_id = $session->getParameter("_system_user_id");
if(!isset($attributes['user_id'])) $attributes['user_id'] = "0";
if($attributes['user_id'] != "0") {
- $user =& $usersView->getUserById($attributes['user_id']);
- if($user === false) return $errStr;
- $edit_flag = true;
+ $user =& $usersView->getUserById($attributes['user_id']);
+ if($user === false) return $errStr;
+ $edit_flag = true;
} else {
$attributes['user_id'] = "0";
$edit_flag = false;
@@ -61,136 +61,132 @@ function validate($attributes, $errStr, $params)
}
$where_params = array(
- "user_authority_id" => _AUTH_ADMIN // 管理者固定
- );
+ "user_authority_id" => _AUTH_ADMIN // 管理者固定
+ );
$show_items =& $usersView->getItems($where_params, null, null, null, array($this, "_getItemsFetchcallback"));
if($show_items === false) return $errStr;
- foreach($show_items as $items) {
- $err_prefix = $items['item_id'].":";
- if(isset($attributes['items']) && isset($attributes['items'][$items['item_id']])) {
- $content = $attributes['items'][$items['item_id']];
- } else {
- $content = "";
- }
-
- if($items['define_flag'] == _ON && defined($items['item_name'])) $items['item_name'] = constant($items['item_name']);
- // 必須入力チェック
- if($items['require_flag'] == _ON && !($edit_flag == _ON && $items['tag_name'] == "password")) {
- // 必須項目
- 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 && $users[0]['user_id'] != $attributes['user_id']) {
- return $err_prefix.sprintf(USER_MES_ERROR_DUPLICATE, USER_ITEM_LOGIN, USER_ITEM_LOGIN);
- }
- } else if($items['tag_name'] == "password" && $content != "") {
- $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(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 && $users[0]['user_id'] != $attributes['user_id']) {
- return $err_prefix.sprintf(USER_MES_ERROR_DUPLICATE, USER_ITEM_HANDLE, USER_ITEM_HANDLE);
- }
- } else if($items['tag_name'] == "active_flag_lang") {
- //システム管理者の場合、使用不可にはできない
- if($attributes['user_id'] == $_system_user_id && $content == _OFF) {
- return $err_prefix._INVALID_INPUT;
- }
- } else if($items['tag_name'] == "role_authority_name") {
- //システム管理者の場合、変更不可
- if($attributes['user_id'] == $_system_user_id && $content != _SYSTEM_ROLE_AUTH_ID) {
- return $err_prefix._INVALID_INPUT;
- }
- }
- if($items['type'] == "email" || $items['type'] == "mobile_email") {
- $email = $content;
-
- // 入力文字チェック
- if ( $email != "" && !strpos($email, "@") ) {
- return $err_prefix.sprintf(_FORMAT_WRONG_ERROR, $items['item_name']);
- }
- // 重複チェック
- if($email != "") {
- $where_param = array(
- "({items}.type = 'email' OR {items}.type = 'mobile_email') " => null,
- "{users_items_link}.content" => $email
- );
- $chk_items =& $usersView->getItems($where_param);
- $count = count($chk_items);
- if($count >= 1 && $chk_items[0]['user_id'] != $attributes['user_id']) {
- return $err_prefix.sprintf(USER_MES_ERROR_DUPLICATE, $items['item_name'] , $items['item_name'] );
- }
- }
- // メール受信可否
- if(isset($attributes['items_reception']) && isset($attributes['items_reception'][$items['item_id']])) {
- if($items['allow_email_reception_flag'] == _OFF ||
- !($attributes['items_reception'][$items['item_id']] == _ON ||
- $attributes['items_reception'][$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;
- }
- }
- }
- // actionChain取得
+ foreach($show_items as $items) {
+ $err_prefix = $items['item_id'].":";
+ if(isset($attributes['items']) && isset($attributes['items'][$items['item_id']])) {
+ $content = $attributes['items'][$items['item_id']];
+ } else {
+ $content = "";
+ }
+
+ if($items['define_flag'] == _ON && defined($items['item_name'])) $items['item_name'] = constant($items['item_name']);
+ // 必須入力チェック
+ if($items['require_flag'] == _ON && !($edit_flag == _ON && $items['tag_name'] == "password")) {
+ // 必須項目
+ 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 && $users[0]['user_id'] != $attributes['user_id']) {
+ return $err_prefix.sprintf(USER_MES_ERROR_DUPLICATE, USER_ITEM_LOGIN, USER_ITEM_LOGIN);
+ }
+ } else if($items['tag_name'] == "password" && $content != "") {
+ $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(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 && $users[0]['user_id'] != $attributes['user_id']) {
+ return $err_prefix.sprintf(USER_MES_ERROR_DUPLICATE, USER_ITEM_HANDLE, USER_ITEM_HANDLE);
+ }
+ } else if($items['tag_name'] == "active_flag_lang") {
+ //システム管理者の場合、使用不可にはできない
+ if($attributes['user_id'] == $_system_user_id && $content == _OFF) {
+ return $err_prefix._INVALID_INPUT;
+ }
+ } else if($items['tag_name'] == "role_authority_name") {
+ //システム管理者の場合、変更不可
+ if($attributes['user_id'] == $_system_user_id && $content != _SYSTEM_ROLE_AUTH_ID) {
+ return $err_prefix._INVALID_INPUT;
+ }
+ }
+ if($items['type'] == "email" || $items['type'] == "mobile_email") {
+ $email = $content;
+
+ // 入力文字チェック
+ if ( $email != "" && !strpos($email, "@") ) {
+ return $err_prefix.sprintf(_FORMAT_WRONG_ERROR, $items['item_name']);
+ }
+ // 重複チェック
+ $userIdByMail = $usersView->getUserIdByMail($email);
+ if (!empty($userIdByMail)
+ && $userIdByMail != $attributes['user_id']) {
+ $errorMessage = $err_prefix
+ . sprintf(USER_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 ||
+ !($attributes['items_reception'][$items['item_id']] == _ON ||
+ $attributes['items_reception'][$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;
+ }
+ }
+ }
+ // 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));
}
if(isset($user)) {
//会員情報
if(isset($params[1])) {
- BeanUtils::setAttributes($action, array($params[1]=>$user));
+ BeanUtils::setAttributes($action, array($params[1]=>$user));
} else {
BeanUtils::setAttributes($action, array("user"=>$user));
}
}
- return;
- }
-
+ return;
+ }
+
/**
* fetch時コールバックメソッド
* @param result adodb object
diff --git a/html/webapp/modules/user/view/admin/import/upload/Upload.class.php b/html/webapp/modules/user/view/admin/import/upload/Upload.class.php
index fe1add1..6b8bee9 100644
--- a/html/webapp/modules/user/view/admin/import/upload/Upload.class.php
+++ b/html/webapp/modules/user/view/admin/import/upload/Upload.class.php
@@ -20,7 +20,6 @@ class User_View_Admin_Import_Upload extends Action
//使用コンポーネント
var $session = null;
var $actionChain = null;
- var $db = null;
var $uploadsAction = null;
var $usersView = null;
var $authoritiesView = null;
@@ -33,53 +32,53 @@ class User_View_Admin_Import_Upload extends Action
var $handle_list = null; // インポートファイル内の重複確認のためのハンドルリスト
var $email_list_all = null; //インポートファイル内の重複確認のためのすべてのeメールリスト
- var $email_column_cnt = 0; //ユーザ情報中のemail又はmobile_emailの個数
+ var $email_column_cnt = 0; //ユーザ情報中のemail又はmobile_emailの個数
var $email_column_name = array(); //ユーザ情報中にemail又はmobile_emailの見出し
- /**
- * インポートファイルのアップロード
- *
- * @access public
- */
- function execute()
- {
- set_time_limit(USER_TIME_LIMIT);
+ /**
+ * インポートファイルのアップロード
+ *
+ * @access public
+ */
+ function execute()
+ {
+ set_time_limit(USER_TIME_LIMIT);
// メモリ最大サイズ設定
ini_set('memory_limit', -1);
- $errorList =& $this->actionChain->getCurErrorList();
+ $errorList =& $this->actionChain->getCurErrorList();
$errUser_cnt = 0;
if ($this->user_import_option_data_set == "1") $this->duplicate_data = _ON;
if ($this->user_import_option_detail_set == "1") $this->detail_res = _ON;
- // ファイルアップロード
+ // ファイルアップロード
$garbage_flag = _ON;
- $filelist = $this->uploadsAction->uploads($garbage_flag);
- if(isset($filelist['error_mes']) && $filelist['error_mes'] != "") {
- $errorList->add(get_class($this), sprintf(_FILE_UPLOAD_ERR_FAILURE."(%s)", $filelist['error_mes']));
- return 'error';
- }else if($filelist[0]['extension'] != "csv") {
- $errorList->add(get_class($this), sprintf(_FILE_UPLOAD_ERR_FILENAME_REJECRED."(%s)", $filelist[0]['file_name']));
+ $filelist = $this->uploadsAction->uploads($garbage_flag);
+ if(isset($filelist['error_mes']) && $filelist['error_mes'] != "") {
+ $errorList->add(get_class($this), sprintf(_FILE_UPLOAD_ERR_FAILURE."(%s)", $filelist['error_mes']));
+ return 'error';
+ }else if($filelist[0]['extension'] != "csv") {
+ $errorList->add(get_class($this), sprintf(_FILE_UPLOAD_ERR_FILENAME_REJECRED."(%s)", $filelist[0]['file_name']));
$this->_delImportFile(FILEUPLOADS_DIR."user/".$filelist[0]['physical_file_name']);
- return 'error';
- }
+ return 'error';
+ }
$file = FILEUPLOADS_DIR."user/".$filelist[0]['physical_file_name'];
- //$file = WEBAPP_DIR."/uploads/user/".$filelist[0]['physical_file_name'];
- $handle = fopen($file, 'r');
- if($handle == false) {
- $errorList->add(get_class($this), sprintf(USER_IMPORT_UPLOAD_OPENERR."(%s)", $file));
- $this->_delImportFile($file);
- return 'error';
- }
+ //$file = WEBAPP_DIR."/uploads/user/".$filelist[0]['physical_file_name'];
+ $handle = fopen($file, 'r');
+ if($handle == false) {
+ $errorList->add(get_class($this), sprintf(USER_IMPORT_UPLOAD_OPENERR."(%s)", $file));
+ $this->_delImportFile($file);
+ return 'error';
+ }
$users_admin = $this->usersView->getUsers(array("user_authority_id" => _AUTH_ADMIN));
if (isset($users_admin) && is_array($users_admin)) {
- $showitems = $this->usersView->getShowItems($users_admin[0]['user_id'], _AUTH_ADMIN, null);
+ $showitems = $this->usersView->getShowItems($users_admin[0]['user_id'], _AUTH_ADMIN, null);
}
if (!isset($showitems) || !is_array($showitems)) {
- $errorList->add(get_class($this), sprintf("show items error"));
+ $errorList->add(get_class($this), sprintf("show items error"));
$this->_delImportFile($file);
return 'error';
}
@@ -89,7 +88,7 @@ function execute()
$row_data_headers = fgets($handle);
$row_data_headers = mb_convert_encoding($row_data_headers, "UTF-8", "SJIS");
if (empty($row_data_headers)) {
- $errorList->add(get_class($this), sprintf(USER_IMPORT_UPLOAD_NODATA."(%s)", $filelist[0]['file_name']));
+ $errorList->add(get_class($this), sprintf(USER_IMPORT_UPLOAD_NODATA."(%s)", $filelist[0]['file_name']));
$this->_delImportFile($file);
return 'error';
}
@@ -107,16 +106,16 @@ function execute()
$row_data_header = preg_replace('/'.$e.$e.'/su', $e, $row_data_header);
$row_data_headers[$i] = $row_data_header;
foreach($showitems as $item_list) {
- foreach($item_list as $showitem) {
- $strncmp = strncmp($row_data_header, $showitem['item_name'], strlen($showitem['item_name']));
- if ($strncmp != 0 && $showitem['item_name'] == "ID") {
- $strncmp = strncmp($row_data_header, strtolower($showitem['item_name']), strlen($showitem['item_name']));
- if ($strncmp == 0) {
- $row_data_header = $showitem['item_name'];
- $row_data_headers[$i] = $showitem['item_name'];
- }
- }
- if (!$strncmp) {
+ foreach($item_list as $showitem) {
+ $strncmp = strncmp($row_data_header, $showitem['item_name'], strlen($showitem['item_name']));
+ if ($strncmp != 0 && $showitem['item_name'] == "ID") {
+ $strncmp = strncmp($row_data_header, strtolower($showitem['item_name']), strlen($showitem['item_name']));
+ if ($strncmp == 0) {
+ $row_data_header = $showitem['item_name'];
+ $row_data_headers[$i] = $showitem['item_name'];
+ }
+ }
+ if (!$strncmp) {
if (!strcmp($row_data_header, sprintf(USER_IMPORT_RECEPTION_EMAIL, $showitem['item_name']))) {
$reception = "1";
} else if (!strcmp($row_data_header, sprintf(USER_IMPORT_PUBLIC_FLAG, $showitem['item_name']))) {
@@ -125,16 +124,16 @@ function execute()
continue;
}
$item_poss[] = array("name" => $row_data_header,
- "item_id" => $showitem['item_id'],
- "public_flag" => $public,
- "reception" => $reception,
- "showitem" => $showitem);
+ "item_id" => $showitem['item_id'],
+ "public_flag" => $public,
+ "reception" => $reception,
+ "showitem" => $showitem);
$item_found = _ON;
$row_data_headers_disp[] = $row_data_header;
if ( ($reception != "1" ) &&
- ($public != "1" ) &&
- (($showitem['type'] == 'email') || ($showitem['type'] == 'mobile_email')) ) {
+ ($public != "1" ) &&
+ (($showitem['type'] == 'email') || ($showitem['type'] == 'mobile_email')) ) {
$this->email_column_cnt++;
$this->email_column_name[] = $showitem['item_name'];
}
@@ -146,10 +145,10 @@ function execute()
}
if ($item_found != _ON) {
$item_poss[] = array("name" => trim($row_data_header),
- "item_id" => "none",
- "public_flag" => $public,
- "reception" => $reception,
- "showitem" => $showitem);
+ "item_id" => "none",
+ "public_flag" => $public,
+ "reception" => $reception,
+ "showitem" => $showitem);
}
}
$row_data_headers_disp[] = USER_IMPORT_DATACHK_RES;
@@ -158,7 +157,7 @@ function execute()
// データチェック
$idx = 0;
$chkusers_num = 0;
- while (!feof($handle)) {
+ while (!feof($handle)) {
$items = null; $items_public = null; $items_reception = null;
$row_data_user_str = fgets($handle);
if (empty($row_data_user_str)) continue;
@@ -261,9 +260,9 @@ function execute()
// 会員情報の重複チェック
$user_id="0";
$attributes = array("user_id" => $user_id,
- "items" => $items,
- "item_public" => $items_public,
- "item_reception" => $items_reception);
+ "items" => $items,
+ "item_public" => $items_public,
+ "item_reception" => $items_reception);
$res = $this->dataCheck($attributes, "error");
$user_id = $res["userid"];
$errlists = $res["errlist"];
@@ -309,8 +308,8 @@ function execute()
fclose($handle);
if($chkusers_num > USER_IMPORT_ROW_NUM) {
$errorList->add(get_class($this), sprintf(USER_IMPORT_ROW_OVER_ERROR, USER_IMPORT_ROW_NUM));
- $this->_delImportFile($file);
- return 'error';
+ $this->_delImportFile($file);
+ return 'error';
}
//if($errUser) {
$this->_delImportFile($file);
@@ -320,7 +319,7 @@ function execute()
$this->session->setParameter(array("user", "import", "errUser_cnt"), $errUser_cnt);
}
- /**
+ /**
* 設定値が設定可能範囲かチェック
* @param item name
* @return res
@@ -365,7 +364,7 @@ function checkVal($item, $name)
return $res;
}
- /**
+ /**
* 設定値を数値から名称に変更
* @param item name
* @return name
@@ -415,21 +414,21 @@ function getChangeName($item, $name)
function setDefault($item)
{
switch ($item['item_name']) {
- case USER_ITEM_TIMEZONE_OFFSET:
- $res = USER_IMPORT_TIMEZONE_DEFAULT;
- break;
- case USER_ITEM_LANG_DIRNAME:
- $res = USER_IMPORT_LANG_DEFAULT;
- break;
- case USER_ITEM_ROLE_AUTHORITY_ID:
+ case USER_ITEM_TIMEZONE_OFFSET:
+ $res = USER_IMPORT_TIMEZONE_DEFAULT;
+ break;
+ case USER_ITEM_LANG_DIRNAME:
+ $res = USER_IMPORT_LANG_DEFAULT;
+ break;
+ case USER_ITEM_ROLE_AUTHORITY_ID:
$res = USER_IMPORT_ROLE_DEFAULT;
- break;
- case USER_ITEM_ACTIVE_FLAG:
- $res = USER_IMPORT_ACTIVE_DEFAULT;
- break;
- default:
+ break;
+ case USER_ITEM_ACTIVE_FLAG:
+ $res = USER_IMPORT_ACTIVE_DEFAULT;
+ break;
+ default:
$res = "";
- break;
+ break;
}
return trim($res);
@@ -469,185 +468,154 @@ function dataCheck($attributes, $errStr)
$edit_flag = false;
$where_params = array(
- "user_authority_id" => _AUTH_ADMIN // 管理者固定
- );
+ "user_authority_id" => _AUTH_ADMIN // 管理者固定
+ );
$show_items =& $this->usersView->getItems($where_params, null, null, null, array($this, "_getItemsFetchcallback"));
if($show_items === false) return $errStr;
$current_user = null;
foreach($show_items as $items) {
if((isset($attributes['items']) && is_array($attributes['items'])) && isset($attributes['items'][$items['item_id']])) {
- $content = $attributes['items'][$items['item_id']];
- } else {
- $content = "";
- }
-
- if($items['define_flag'] == _ON && defined($items['item_name'])) $items['item_name'] = constant($items['item_name']);
- // 必須入力チェック
- if($items['require_flag'] == _ON) {
- if($content == "") {
- if ($this->duplicate_data == _OFF || !isset($current_user) || $items['tag_name'] != "password") {
+ $content = $attributes['items'][$items['item_id']];
+ } else {
+ $content = "";
+ }
+
+ if($items['define_flag'] == _ON && defined($items['item_name'])) $items['item_name'] = constant($items['item_name']);
+ // 必須入力チェック
+ if($items['require_flag'] == _ON) {
+ if($content == "") {
+ if ($this->duplicate_data == _OFF || !isset($current_user) || $items['tag_name'] != "password") {
// パスワードで既存会員ならば、エラーにしない
$errlist[] = sprintf(_REQUIRED, $items['item_name']).$edit_flag;
- $user_id = $errStr;
- continue;
- }
- }
- }
- 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) {
+ $user_id = $errStr;
+ continue;
+ }
+ }
+ }
+ 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) {
$errlist[] = sprintf(_MAXRANGE_ERROR, USER_ITEM_LOGIN, USER_LOGIN_ID_MINSIZE, USER_LOGIN_ID_MAXSIZE);
- $user_id = $errStr;
- }
+ $user_id = $errStr;
+ }
- // 半角英数または、記号
- if(preg_match(_REGEXP_ALLOW_HALFSIZE_SYMBOL, $login_id)) {
+ // 半角英数または、記号
+ if(preg_match(_REGEXP_ALLOW_HALFSIZE_SYMBOL, $login_id)) {
$errlist[] = sprintf(_HALFSIZESYMBOL_ERROR, USER_ITEM_LOGIN);
- $user_id = $errStr;
- }
-
- // 重複チェック
- $where_params = array("login_id" => $login_id);
- $users =& $this->usersView->getUsers($where_params);
- $count = count($users);
- if($count >= 1) {
- if ($this->duplicate_data == _OFF) {
+ $user_id = $errStr;
+ }
+
+ // 重複チェック
+ $where_params = array("login_id" => $login_id);
+ $users =& $this->usersView->getUsers($where_params);
+ $count = count($users);
+ if($count >= 1) {
+ if ($this->duplicate_data == _OFF) {
$errlist[] = sprintf(USER_IMPORT_MES_ERROR_DUPLICATE, USER_ITEM_LOGIN);
- $user_id = $errStr;
- } else {
+ $user_id = $errStr;
+ } else {
if ($user_id != $errStr) {
$user_id = $users[0]['user_id'];
$attributes['user_id'] = $user_id;
}
$edit_flag = _ON;
- }
- $current_user = $users[0];
- } else {
- $current_user = null;
- }
-
- $this->loginid_list[] = $login_id;
- } else if($items['tag_name'] == "password" && $content != "") {
- $new_password = $content;
- // 文字チェック
- $pass_len = strlen($new_password);
- if($pass_len < USER_PASSWORD_MINSIZE || $pass_len > USER_PASSWORD_MAXSIZE) {
+ }
+ $current_user = $users[0];
+ } else {
+ $current_user = null;
+ }
+
+ $this->loginid_list[] = $login_id;
+ } else if($items['tag_name'] == "password" && $content != "") {
+ $new_password = $content;
+ // 文字チェック
+ $pass_len = strlen($new_password);
+ if($pass_len < USER_PASSWORD_MINSIZE || $pass_len > USER_PASSWORD_MAXSIZE) {
$errlist[] = sprintf(_MAXRANGE_ERROR, USER_ITEM_PASSWORD, USER_PASSWORD_MINSIZE, USER_PASSWORD_MAXSIZE);
- $user_id = $errStr;
- }
- // 半角英数または、記号
- if(preg_match(_REGEXP_ALLOW_HALFSIZE_SYMBOL, $new_password)) {
+ $user_id = $errStr;
+ }
+ // 半角英数または、記号
+ if(preg_match(_REGEXP_ALLOW_HALFSIZE_SYMBOL, $new_password)) {
$errlist[] = sprintf(_HALFSIZESYMBOL_ERROR, USER_ITEM_PASSWORD);
- $user_id = $errStr;
- }
- } else if($items['tag_name'] == "handle") {
- // 重複チェック
- $handle = $content;
- $where_params = array("handle" => $handle);
- $users =& $this->usersView->getUsers($where_params);
- $count = count($users);
- if($count >= 1 && $users[0]['user_id'] != $attributes['user_id']) {
+ $user_id = $errStr;
+ }
+ } else if($items['tag_name'] == "handle") {
+ // 重複チェック
+ $handle = $content;
+ $where_params = array("handle" => $handle);
+ $users =& $this->usersView->getUsers($where_params);
+ $count = count($users);
+ if($count >= 1 && $users[0]['user_id'] != $attributes['user_id']) {
$errlist[] = sprintf(USER_IMPORT_MES_ERROR_DUPLICATE, USER_ITEM_HANDLE);
- $user_id = $errStr;
- }
+ $user_id = $errStr;
+ }
- $this->handle_list[] = $handle;
- } else if($items['tag_name'] == "active_flag_lang") {
- //システム管理者の場合、使用不可にはできない
- if($attributes['user_id'] == $_system_user_id && $content == _OFF) {
+ $this->handle_list[] = $handle;
+ } else if($items['tag_name'] == "active_flag_lang") {
+ //システム管理者の場合、使用不可にはできない
+ if($attributes['user_id'] == $_system_user_id && $content == _OFF) {
$errlist[] = sprintf(USER_IMPORT_SYSTEM_ADMIN_ERR, $items['item_name']);
$user_id = $errStr;
- }
- } else if($items['tag_name'] == "role_authority_name") {
- //システム管理者の場合、変更不可
- if($attributes['user_id'] == $_system_user_id && $content != _SYSTEM_ROLE_AUTH_ID) {
+ }
+ } else if($items['tag_name'] == "role_authority_name") {
+ //システム管理者の場合、変更不可
+ if($attributes['user_id'] == $_system_user_id && $content != _SYSTEM_ROLE_AUTH_ID) {
$errlist[] = sprintf(USER_IMPORT_SYSTEM_ADMIN_ERR, $items['item_name']);
- $user_id = $errStr;
- }
+ $user_id = $errStr;
+ }
- $authority = $this->authoritiesView->getAuthorityByID($content);
- if ((($authority !== false) && ($authority != null)) && ($authority["user_authority_id"] >= $_user_auth_id)) {
+ $authority = $this->authoritiesView->getAuthorityByID($content);
+ if ((($authority !== false) && ($authority != null)) && ($authority["user_authority_id"] >= $_user_auth_id)) {
$errlist[] = sprintf(USER_IMPORT_SYSTEM_AUTH_ERR, $items['item_name']);
- $user_id = $errStr;
- } else if ($content == "") {
- $errlist[] = sprintf(_REQUIRED, $items['item_name']);
- $user_id = $errStr;
- }
- }
- if($items['type'] == "email" || $items['type'] == "mobile_email") {
- $email = $content;
-
- // 文字チェック
- if ( $email != "" && !strpos($email, "@") ) {
+ $user_id = $errStr;
+ } else if ($content == "") {
+ $errlist[] = sprintf(_REQUIRED, $items['item_name']);
+ $user_id = $errStr;
+ }
+ }
+ if($items['type'] == "email" || $items['type'] == "mobile_email") {
+ $email = $content;
+
+ // 文字チェック
+ if ( $email != "" && !strpos($email, "@") ) {
$errlist[] = sprintf(_FORMAT_WRONG_ERROR, $items['item_name']);
- $user_id = $errStr;
- }
- // 重複チェック
- if($email != "") {
- $sql = "SELECT item_id, type FROM {items}".
- " WHERE ({items}.type='email' OR {items}.type='mobile_email')";
- $email_items = $this->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 =& $this->db->execute($sql, $where_params);
- $count = !empty($chk_items) ? count($chk_items) : 0;
- if($count >= 1 && $chk_items[0]['user_id'] != $attributes['user_id']) {
- $errlist[] = sprintf(USER_IMPORT_MES_ERROR_DUPLICATE, $items['item_name']);
- $user_id = $errStr;
- }
- }
- }
- // メール受信可否
- if((isset($attributes['items_reception']) && is_array($attributes['items_reception'])) && isset($attributes['items_reception'][$items['item_id']])) {
- if($items['allow_email_reception_flag'] == _OFF ||
- !($attributes['items_reception'][$items['item_id']] == _ON ||
- $attributes['items_reception'][$items['item_id']] == _OFF)) {
- $errlist[] = sprintf(USER_IMPORT_INVALID_INPUT, $items['item_name'], USER_IMPORT_EMAIL_USE_SET);
+ $user_id = $errStr;
+ }
+ // 重複チェック
+ $userIdByMail = $this->usersView->getUserIdByMail($email);
+ if (!empty($userIdByMail)
+ && $userIdByMail != $attributes['user_id']) {
+ $errlist[] = sprintf(USER_IMPORT_MES_ERROR_DUPLICATE, $items['item_name']);
+ $user_id = $errStr;
+ }
+ // メール受信可否
+ if((isset($attributes['items_reception']) && is_array($attributes['items_reception'])) && isset($attributes['items_reception'][$items['item_id']])) {
+ if($items['allow_email_reception_flag'] == _OFF ||
+ !($attributes['items_reception'][$items['item_id']] == _ON ||
+ $attributes['items_reception'][$items['item_id']] == _OFF)) {
+ $errlist[] = sprintf(USER_IMPORT_INVALID_INPUT, $items['item_name'], USER_IMPORT_EMAIL_USE_SET);
$user_id = $errStr;
- }
- }
+ }
+ }
$this->email_list_all[] = $email;
- }
+ }
- // 公開設定
- if((isset($attributes['items_public']) && is_array($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)) {
+ // 公開設定
+ if((isset($attributes['items_public']) && is_array($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)) {
$errlist[] = sprintf(USER_IMPORT_INVALID_INPUT, $items['item_name'], USER_IMPORT_PUBLIC_SET);
- $user_id = $errStr;
- }
- }
- }
- $res = array("errlist" => $errlist, "userid" => $user_id);
+ $user_id = $errStr;
+ }
+ }
+ }
+ $res = array("errlist" => $errlist, "userid" => $user_id);
return $res;
}
diff --git a/html/webapp/modules/user/view/admin/import/upload/maple.ini b/html/webapp/modules/user/view/admin/import/upload/maple.ini
index 26d9c8d..f08c72b 100644
--- a/html/webapp/modules/user/view/admin/import/upload/maple.ini
+++ b/html/webapp/modules/user/view/admin/import/upload/maple.ini
@@ -10,7 +10,6 @@ allow_extension="true"
[Action]
session = "ref:Session"
actionChain = "ref:ActionChain"
-db = "ref:DbObject"
uploadsAction = "ref:uploadsAction"
usersView = "ref:usersView"
authoritiesView = "ref:authoritiesView"
diff --git a/html/webapp/style/css/common.css b/html/webapp/style/css/common.css
index 240edb9..7a759ca 100644
--- a/html/webapp/style/css/common.css
+++ b/html/webapp/style/css/common.css
@@ -351,7 +351,7 @@ div.contextMenu {
border:1px solid #aca899;
border-left:1px solid #666666;
border-right:1px solid #666666;
- background-color:Window;
+ background-color:#FFFFFF;
}
div.contextRow {
padding-left:15px;
diff --git a/html/webapp/templates/main/mobile_smart.html b/html/webapp/templates/main/mobile_smart.html
index 799fa5c..bbc8d97 100644
--- a/html/webapp/templates/main/mobile_smart.html
+++ b/html/webapp/templates/main/mobile_smart.html
@@ -79,7 +79,7 @@
<{$smarty.session._meta.sitename}>
<{/if}>
-
+
/images/comp/textarea/titleicon/icon-pc.gif" alt="<{$lang._pc_viewer}>" title="<{$lang._pc_viewer}>" />
From 1390a095cff755df74ea84552309d89a3a3a6bc3 Mon Sep 17 00:00:00 2001
From: kteraguchi
Date: Wed, 23 Jan 2013 17:48:54 +0900
Subject: [PATCH 02/39] =?UTF-8?q?#2=20=E3=82=B9=E3=83=9E=E3=83=9B=E3=81=A7?=
=?UTF-8?q?=E5=8F=B3=E5=81=B4=E3=81=AB=E9=9A=99=E9=96=93=E3=81=8C=E3=81=A7?=
=?UTF-8?q?=E3=81=8D=E3=81=A6=E3=81=97=E3=81=BE=E3=81=86=E4=BB=B6=E3=82=92?=
=?UTF-8?q?=E4=BF=AE=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
html/webapp/templates/main/mobile_smart.html | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/html/webapp/templates/main/mobile_smart.html b/html/webapp/templates/main/mobile_smart.html
index bbc8d97..4329aed 100644
--- a/html/webapp/templates/main/mobile_smart.html
+++ b/html/webapp/templates/main/mobile_smart.html
@@ -67,10 +67,10 @@ <{$smarty.session._page_title}>
<{$contents|smarty:nodefaults}>
-
+
<{$smarty.session._meta.sitename}>
<{if ($smarty.session._user_id != "" && $smarty.session._user_id != "0") }>
-
-<{/strip}>
\ No newline at end of file
+<{/strip}>
From c36b9e1b3bf89478eb570c7ccbf9ad0829f30f0f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=B0=B8=E5=8E=9F=E3=80=80=E7=AF=A4?=
Date: Sat, 26 Jan 2013 10:00:33 +0900
Subject: [PATCH 03/39] =?UTF-8?q?#6=20=E6=B1=8E=E7=94=A8=E3=83=87=E3=83=BC?=
=?UTF-8?q?=E3=82=BF=E3=83=99=E3=83=BC=E3=82=B9=E3=81=AE=E3=83=9A=E3=83=BC?=
=?UTF-8?q?=E3=82=B8=E9=81=B7=E7=A7=BB=E3=81=8C1=E5=9B=9E=E7=9B=AE?=
=?UTF-8?q?=E3=80=81=E5=A4=B1=E6=95=97=E3=81=99=E3=82=8B=E3=80=82=E3=81=AE?=
=?UTF-8?q?=E4=BF=AE=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
オープンソース・ワークショップ 永原です。
修正&テストしました。
カテゴリ、並べ替えが変更された際は1ページ目に戻す。という処理に問題がありました。
1ページ目に戻す際、セッションに保持している状態と比較していますが、初回のページ遷移時は該当セッションが空でした。
その判定が抜けていたため、カテゴリ、並べ替えが変更されたと誤認識して1ページ目に戻されていました。
---
.../view/main/init/Init.class.php | 508 +++++++++---------
1 file changed, 255 insertions(+), 253 deletions(-)
diff --git a/html/webapp/modules/multidatabase/view/main/init/Init.class.php b/html/webapp/modules/multidatabase/view/main/init/Init.class.php
index 16114eb..17338e3 100644
--- a/html/webapp/modules/multidatabase/view/main/init/Init.class.php
+++ b/html/webapp/modules/multidatabase/view/main/init/Init.class.php
@@ -1,254 +1,256 @@
-session->getParameter( "_mobile_flag" ) == true ) {
- $this->block_num = $this->mobileView->getCountForBlockInPageWithBlock( $this->block_id );
- $this->html_flag = $this->mobileView->getTextHtmlMode( $this->html_flag );
- }
-
- if(empty($this->metadatas)) {
- $this->metadata_exists = false;
- return 'success';
- }
-
- $section_params = array(
- "multidatabase_id" => intval($this->multidatabase_id),
- "list_flag" => _ON,
- "type IN (".MULTIDATABASE_META_TYPE_SECTION.",".MULTIDATABASE_META_TYPE_MULTIPLE.") " => null
- );
- $this->section_metadatas = $this->mdbView->getMetadatas($section_params);
- if($this->section_metadatas === false) {
- return 'error';
- }
-
- $sort_params = array(
- "multidatabase_id" => intval($this->multidatabase_id),
- "sort_flag" => _ON,
- "list_flag" => _ON
- );
- $this->sort_metadatas = $this->mdbView->getMetadatas($sort_params);
- if($this->sort_metadatas === false) {
- return 'error';
- }
-
- $sort_section = $this->session->getParameter(array("multidatabase", $this->block_id, "sort_section"));
- if(!empty($this->sort_section)) {
- $this->session->setParameter(array("multidatabase", $this->block_id, "sort_section"), $this->sort_section);
- if($sort_section != $this->sort_section) {
- // カテゴリ変更を行った場合、1ページ目を表示する。
- $this->now_page = 1;
- }
- }else if(!empty($sort_section)) {
- $this->sort_section = $sort_section;
- }
- $where_params = array();
- if(!empty($this->sort_section)) {
- foreach($this->sort_section as $key => $val) {
- $where_params["m_content".$key.".content"] = $val;
- }
- }
-
- $visible_item = $this->session->getParameter(array("multidatabase", $this->block_id, "visible_item"));
- if($this->visible_item != "") {
- if($visible_item != "" && $this->visible_item != $visible_item) {
- $this->now_page = 1;
- }
- $this->session->setParameter(array("multidatabase", $this->block_id, "visible_item"), $this->visible_item);
- }else if($visible_item != ""){
- $this->visible_item = $visible_item;
- }else {
- $this->visible_item = $this->mdb_obj['visible_item'];
- }
-
- $sort_metadata = $this->session->getParameter(array("multidatabase", $this->block_id, "sort_metadata"));
- if(!empty($this->sort_metadata)) {
- $this->session->setParameter(array("multidatabase", $this->block_id, "sort_metadata"), $this->sort_metadata);
- if($sort_metadata != $this->sort_metadata) {
- // 並べ替えを行った場合、1ページ目を表示する。
- $this->now_page = 1;
- }
- }else if(!empty($sort_metadata)) {
- $this->sort_metadata = $sort_metadata;
- }else {
- $this->sort_metadata = $this->mdb_obj['default_sort'];
- }
- if($this->sort_metadata != MULTIDATABASE_DEFAULT_DATE_SORT
- && $this->sort_metadata != MULTIDATABASE_DEFAULT_DATE_ASC_SORT
- && $this->sort_metadata != MULTIDATABASE_DEFAULT_VOTE_SORT
- && $this->sort_metadata != MULTIDATABASE_DEFAULT_SEQUENCE_SORT
- && !array_key_exists($this->sort_metadata, $this->sort_metadatas)) {
- $this->sort_metadata = MULTIDATABASE_DEFAULT_SEQUENCE_SORT;
- }
-
- $mdbcount = $this->mdbView->getMDBListCount($this->multidatabase_id, $this->metadatas, $where_params);
- if($mdbcount === false) {
- return 'error';
- }
- if($mdbcount == 0) {
- $this->exists = false;
- return 'success';
- }
-
- $now_page = $this->session->getParameter(array("multidatabase", $this->block_id, "now_page"));
- if(!empty($this->now_page)) {
- $this->session->setParameter(array("multidatabase", $this->block_id, "now_page"), $this->now_page);
- }else if(!empty($now_page)){
- $this->now_page = $now_page;
- }
-
- if(!empty($this->visible_item)) {
- $this->setPageInfo($mdbcount, $this->visible_item, $this->now_page);
- }
-
- if(empty($this->sort_metadata) || $this->sort_metadata == MULTIDATABASE_DEFAULT_SEQUENCE_SORT) {
- $order_params = array(
- "{multidatabase_content}.display_sequence" => "ASC",
- "{multidatabase_content}.insert_time" => "DESC"
- );
- }else if($this->sort_metadata == MULTIDATABASE_DEFAULT_DATE_SORT) {
- $order_params = array(
- "{multidatabase_content}.insert_time" => "DESC"
- );
- }else if($this->sort_metadata == MULTIDATABASE_DEFAULT_DATE_ASC_SORT) {
- $order_params = array(
- "{multidatabase_content}.insert_time" => "ASC"
- );
- }else if($this->sort_metadata == MULTIDATABASE_DEFAULT_VOTE_SORT) {
- $order_params = array(
- "{multidatabase_content}.vote_count" => "DESC"
- );
- }else if(isset($this->sort_metadatas[$this->sort_metadata]) && ($this->sort_metadatas[$this->sort_metadata]["type"] == MULTIDATABASE_META_TYPE_FILE || $this->sort_metadatas[$this->sort_metadata]["type"] == MULTIDATABASE_META_TYPE_IMAGE)) {
- $order_params = array(
- "F".$this->sort_metadata.".file_name" => "ASC",
- "{multidatabase_content}.insert_time" => "DESC"
- );
- }else if (isset($this->sort_metadatas[$this->sort_metadata]) && $this->sort_metadatas[$this->sort_metadata]["type"] == MULTIDATABASE_META_TYPE_INSERT_TIME){
- $order_params = array(
- "{multidatabase_content}.insert_time" => "ASC"
- );
- }else if (isset($this->sort_metadatas[$this->sort_metadata]) && $this->sort_metadatas[$this->sort_metadata]["type"] == MULTIDATABASE_META_TYPE_UPDATE_TIME){
- $order_params = array(
- "{multidatabase_content}.update_time" => "ASC"
- );
- }else{
- $order_params = array(
- "m_content".$this->sort_metadata.".content" => "ASC",
- "{multidatabase_content}.insert_time" => "DESC"
- );
- }
-
- $this->mdblist = $this->mdbView->getMDBList($this->multidatabase_id, $this->metadatas, $where_params, $order_params, $this->visible_item, $this->disp_begin);
- if($this->mdblist === false) {
- return 'error';
- }
-
- return 'success';
- }
-
- /**
- * ページに関する設定を行います
- *
- * @param int disp_cnt 1ページ当り表示件数
- * @param int now_page 現ページ
- */
- function setPageInfo($data_cnt, $disp_cnt, $now_page = NULL){
- $this->data_cnt = $data_cnt;
- // now page
- $this->now_page = (NULL == $now_page) ? 1 : $now_page;
- // total page
- $this->total_page = ceil($this->data_cnt / $disp_cnt);
- if($this->total_page < $this->now_page) {
- $this->now_page = 1;
- }
- // link array {{
- if(($this->now_page - MULTIDATABASE_FRONT_AND_BEHIND_LINK_CNT) > 0){
- $start = $this->now_page - MULTIDATABASE_FRONT_AND_BEHIND_LINK_CNT;
- }else{
- $start = 1;
- }
- if(($this->now_page + MULTIDATABASE_FRONT_AND_BEHIND_LINK_CNT) >= $this->total_page){
- $end = $this->total_page;
- }else{
- $end = $this->now_page + MULTIDATABASE_FRONT_AND_BEHIND_LINK_CNT;
- }
- $i = 0;
- for($i = $start; $i <= $end; $i++){
- $this->link_array[] = $i;
- }
- // next link
- if($disp_cnt < $this->data_cnt){
- if($this->now_page < $this->total_page){
- $this->next_link = TRUE;
- }
- }
- // prev link
- if(1 < $this->now_page){
- $this->prev_link = TRUE;
- }
- // begin disp number
- $this->disp_begin = ($this->now_page - 1) * $disp_cnt;
- // end disp number
- $tmp_cnt = $this->now_page * $disp_cnt;
- $this->disp_end = ($this->data_cnt < $tmp_cnt) ? $this->data_cnt : $tmp_cnt;
- }
-}
+session->getParameter( "_mobile_flag" ) == true ) {
+ $this->block_num = $this->mobileView->getCountForBlockInPageWithBlock( $this->block_id );
+ $this->html_flag = $this->mobileView->getTextHtmlMode( $this->html_flag );
+ }
+
+ if(empty($this->metadatas)) {
+ $this->metadata_exists = false;
+ return 'success';
+ }
+
+ $section_params = array(
+ "multidatabase_id" => intval($this->multidatabase_id),
+ "list_flag" => _ON,
+ "type IN (".MULTIDATABASE_META_TYPE_SECTION.",".MULTIDATABASE_META_TYPE_MULTIPLE.") " => null
+ );
+ $this->section_metadatas = $this->mdbView->getMetadatas($section_params);
+ if($this->section_metadatas === false) {
+ return 'error';
+ }
+
+ $sort_params = array(
+ "multidatabase_id" => intval($this->multidatabase_id),
+ "sort_flag" => _ON,
+ "list_flag" => _ON
+ );
+ $this->sort_metadatas = $this->mdbView->getMetadatas($sort_params);
+ if($this->sort_metadatas === false) {
+ return 'error';
+ }
+
+ $sort_section = $this->session->getParameter(array("multidatabase", $this->block_id, "sort_section"));
+ if(!empty($this->sort_section)) {
+ $this->session->setParameter(array("multidatabase", $this->block_id, "sort_section"), $this->sort_section);
+ // 初回、セッションの $sort_section は空なので、その判定を追加 by nagahara@opensource-workshop.jp
+ if(!empty($sort_section) && $sort_section != $this->sort_section) {
+ // カテゴリ変更を行った場合、1ページ目を表示する。
+ $this->now_page = 1;
+ }
+ }else if(!empty($sort_section)) {
+ $this->sort_section = $sort_section;
+ }
+ $where_params = array();
+ if(!empty($this->sort_section)) {
+ foreach($this->sort_section as $key => $val) {
+ $where_params["m_content".$key.".content"] = $val;
+ }
+ }
+
+ $visible_item = $this->session->getParameter(array("multidatabase", $this->block_id, "visible_item"));
+ if($this->visible_item != "") {
+ if($visible_item != "" && $this->visible_item != $visible_item) {
+ $this->now_page = 1;
+ }
+ $this->session->setParameter(array("multidatabase", $this->block_id, "visible_item"), $this->visible_item);
+ }else if($visible_item != ""){
+ $this->visible_item = $visible_item;
+ }else {
+ $this->visible_item = $this->mdb_obj['visible_item'];
+ }
+
+ $sort_metadata = $this->session->getParameter(array("multidatabase", $this->block_id, "sort_metadata"));
+ if(!empty($this->sort_metadata)) {
+ $this->session->setParameter(array("multidatabase", $this->block_id, "sort_metadata"), $this->sort_metadata);
+ // 初回、セッションの $sort_metadata は空なので、その判定を追加 by nagahara@opensource-workshop.jp
+ if(!empty($sort_metadata) && $sort_metadata != $this->sort_metadata) {
+ // 並べ替えを行った場合、1ページ目を表示する。
+ $this->now_page = 1;
+ }
+ }else if(!empty($sort_metadata)) {
+ $this->sort_metadata = $sort_metadata;
+ }else {
+ $this->sort_metadata = $this->mdb_obj['default_sort'];
+ }
+ if($this->sort_metadata != MULTIDATABASE_DEFAULT_DATE_SORT
+ && $this->sort_metadata != MULTIDATABASE_DEFAULT_DATE_ASC_SORT
+ && $this->sort_metadata != MULTIDATABASE_DEFAULT_VOTE_SORT
+ && $this->sort_metadata != MULTIDATABASE_DEFAULT_SEQUENCE_SORT
+ && !array_key_exists($this->sort_metadata, $this->sort_metadatas)) {
+ $this->sort_metadata = MULTIDATABASE_DEFAULT_SEQUENCE_SORT;
+ }
+
+ $mdbcount = $this->mdbView->getMDBListCount($this->multidatabase_id, $this->metadatas, $where_params);
+ if($mdbcount === false) {
+ return 'error';
+ }
+ if($mdbcount == 0) {
+ $this->exists = false;
+ return 'success';
+ }
+
+ $now_page = $this->session->getParameter(array("multidatabase", $this->block_id, "now_page"));
+ if(!empty($this->now_page)) {
+ $this->session->setParameter(array("multidatabase", $this->block_id, "now_page"), $this->now_page);
+ }else if(!empty($now_page)){
+ $this->now_page = $now_page;
+ }
+
+ if(!empty($this->visible_item)) {
+ $this->setPageInfo($mdbcount, $this->visible_item, $this->now_page);
+ }
+
+ if(empty($this->sort_metadata) || $this->sort_metadata == MULTIDATABASE_DEFAULT_SEQUENCE_SORT) {
+ $order_params = array(
+ "{multidatabase_content}.display_sequence" => "ASC",
+ "{multidatabase_content}.insert_time" => "DESC"
+ );
+ }else if($this->sort_metadata == MULTIDATABASE_DEFAULT_DATE_SORT) {
+ $order_params = array(
+ "{multidatabase_content}.insert_time" => "DESC"
+ );
+ }else if($this->sort_metadata == MULTIDATABASE_DEFAULT_DATE_ASC_SORT) {
+ $order_params = array(
+ "{multidatabase_content}.insert_time" => "ASC"
+ );
+ }else if($this->sort_metadata == MULTIDATABASE_DEFAULT_VOTE_SORT) {
+ $order_params = array(
+ "{multidatabase_content}.vote_count" => "DESC"
+ );
+ }else if(isset($this->sort_metadatas[$this->sort_metadata]) && ($this->sort_metadatas[$this->sort_metadata]["type"] == MULTIDATABASE_META_TYPE_FILE || $this->sort_metadatas[$this->sort_metadata]["type"] == MULTIDATABASE_META_TYPE_IMAGE)) {
+ $order_params = array(
+ "F".$this->sort_metadata.".file_name" => "ASC",
+ "{multidatabase_content}.insert_time" => "DESC"
+ );
+ }else if (isset($this->sort_metadatas[$this->sort_metadata]) && $this->sort_metadatas[$this->sort_metadata]["type"] == MULTIDATABASE_META_TYPE_INSERT_TIME){
+ $order_params = array(
+ "{multidatabase_content}.insert_time" => "ASC"
+ );
+ }else if (isset($this->sort_metadatas[$this->sort_metadata]) && $this->sort_metadatas[$this->sort_metadata]["type"] == MULTIDATABASE_META_TYPE_UPDATE_TIME){
+ $order_params = array(
+ "{multidatabase_content}.update_time" => "ASC"
+ );
+ }else{
+ $order_params = array(
+ "m_content".$this->sort_metadata.".content" => "ASC",
+ "{multidatabase_content}.insert_time" => "DESC"
+ );
+ }
+
+ $this->mdblist = $this->mdbView->getMDBList($this->multidatabase_id, $this->metadatas, $where_params, $order_params, $this->visible_item, $this->disp_begin);
+ if($this->mdblist === false) {
+ return 'error';
+ }
+
+ return 'success';
+ }
+
+ /**
+ * ページに関する設定を行います
+ *
+ * @param int disp_cnt 1ページ当り表示件数
+ * @param int now_page 現ページ
+ */
+ function setPageInfo($data_cnt, $disp_cnt, $now_page = NULL){
+ $this->data_cnt = $data_cnt;
+ // now page
+ $this->now_page = (NULL == $now_page) ? 1 : $now_page;
+ // total page
+ $this->total_page = ceil($this->data_cnt / $disp_cnt);
+ if($this->total_page < $this->now_page) {
+ $this->now_page = 1;
+ }
+ // link array {{
+ if(($this->now_page - MULTIDATABASE_FRONT_AND_BEHIND_LINK_CNT) > 0){
+ $start = $this->now_page - MULTIDATABASE_FRONT_AND_BEHIND_LINK_CNT;
+ }else{
+ $start = 1;
+ }
+ if(($this->now_page + MULTIDATABASE_FRONT_AND_BEHIND_LINK_CNT) >= $this->total_page){
+ $end = $this->total_page;
+ }else{
+ $end = $this->now_page + MULTIDATABASE_FRONT_AND_BEHIND_LINK_CNT;
+ }
+ $i = 0;
+ for($i = $start; $i <= $end; $i++){
+ $this->link_array[] = $i;
+ }
+ // next link
+ if($disp_cnt < $this->data_cnt){
+ if($this->now_page < $this->total_page){
+ $this->next_link = TRUE;
+ }
+ }
+ // prev link
+ if(1 < $this->now_page){
+ $this->prev_link = TRUE;
+ }
+ // begin disp number
+ $this->disp_begin = ($this->now_page - 1) * $disp_cnt;
+ // end disp number
+ $tmp_cnt = $this->now_page * $disp_cnt;
+ $this->disp_end = ($this->data_cnt < $tmp_cnt) ? $this->data_cnt : $tmp_cnt;
+ }
+}
?>
\ No newline at end of file
From 20a6943b56b5cfcfa3eee4c413f642be808b3966 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=B0=B8=E5=8E=9F=E3=80=80=E7=AF=A4?=
Date: Sun, 27 Jan 2013 10:01:31 +0900
Subject: [PATCH 04/39] =?UTF-8?q?#9=20Git=20=E3=81=AE=E7=84=A1=E8=A6=96?=
=?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=AB=E3=81=A4=E3=81=84?=
=?UTF-8?q?=E3=81=A6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
NetCommons2用のGit 無視ファイル設定です。
---
.gitignore | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
create mode 100644 .gitignore
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..05a5b3e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,20 @@
+#-----------------------------------
+#- NetCommons2用 無視ファイル設定
+#-----------------------------------
+
+html/images
+html/js
+html/themes
+
+html/webapp/templates_c
+html/webapp/uploads
+
+# install.inc.php はサーバにコミットされているので、
+# この無視ファイルでは無視できない。(以下のファイル)
+# html/webapp/config/install.inc.php
+# そのため、以下のGit のShell コマンドで無視設定する。
+# git update-index --assume-unchanged html\webapp\config\install.inc.php
+# Git Shell プロンプトを起動し、develop ブランチへ移動、無視ファイル指定のコマンドを実行する。
+# C:\Github\NetCommons2 > git init .
+# C:\Github\NetCommons2 > git checkout -b develop
+# C:\Github\NetCommons2 [develop +0 ~1 -0]> git update-index --assume-unchanged html\webapp\config\install.inc.php
From 9aa0843789f9b0d6368333568d3c2db7a47ae64e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=B0=B8=E5=8E=9F=E3=80=80=E7=AF=A4?=
Date: Sun, 27 Jan 2013 10:47:55 +0900
Subject: [PATCH 05/39] =?UTF-8?q?#1=20=E6=B1=8E=E7=94=A8=E3=83=87=E3=83=BC?=
=?UTF-8?q?=E3=82=BF=E3=83=99=E3=83=BC=E3=82=B9=E3=81=AE=20=E7=B7=A8?=
=?UTF-8?q?=E9=9B=86=20=EF=BC=9E=20=E8=A1=A8=E7=A4=BA=E6=96=B9=E6=B3=95=20?=
=?UTF-8?q?=E3=81=AE=E8=A8=AD=E5=AE=9A=E5=86=85=E5=AE=B9=E3=81=8C=E6=AD=A3?=
=?UTF-8?q?=E3=81=97=E3=81=8F=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C=E3=81=AA?=
=?UTF-8?q?=E3=81=84=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
オープンソース・ワークショップの永原です。
修正しました。
元々の修正の意図もあると思うので、影響が最小限になるように、今回問題が発生している「表示方法変更」画面を起動する場合のみを条件で判定して、対応しました。
---
.../validator/Validator_MultidatabaseView.class.php | 3 +++
1 file changed, 3 insertions(+)
diff --git a/html/webapp/modules/multidatabase/validator/Validator_MultidatabaseView.class.php b/html/webapp/modules/multidatabase/validator/Validator_MultidatabaseView.class.php
index 738a76c..07ece22 100644
--- a/html/webapp/modules/multidatabase/validator/Validator_MultidatabaseView.class.php
+++ b/html/webapp/modules/multidatabase/validator/Validator_MultidatabaseView.class.php
@@ -50,6 +50,9 @@ function validate($attributes, $errStr, $params)
$mdbView =& $container->getComponent("mdbView");
if (empty($attributes['multidatabase_id'])) {
$mdb_obj = $mdbView->getDefaultMdb();
+ } elseif ( $actionName == 'multidatabase_view_edit_style' ) {
+ // 表示方法変更の場合は、現在設定されている表示件数や表示順を取得したいため、getCurrentMdb()を呼ぶ。 by nagahara@opensource-workshop.jp
+ $mdb_obj = $mdbView->getCurrentMdb();
} elseif ($prefix_id_name == MULTIDATABASE_REFERENCE_PREFIX_NAME.$attributes['multidatabase_id']
|| !strncmp($actionName, 'multidatabase_view_edit', 23)) {
$mdb_obj = $mdbView->getMdb();
From e31bb27ea73e3e38f8540aca70f8a94041a44b90 Mon Sep 17 00:00:00 2001
From: mutaguchi
Date: Wed, 13 Feb 2013 23:11:27 +0900
Subject: [PATCH 06/39] =?UTF-8?q?#17=20=E6=96=BD=E8=A8=AD=E4=BA=88?=
=?UTF-8?q?=E7=B4=84=E3=81=AE=E3=83=90=E3=82=B0=E5=AF=BE=E5=BF=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
施設0件か、初期表示する施設が削除時、表示方法変更「表示方法」を日にアップデートする。
---
.../reservation/components/Action.class.php | 40 ++++++++++++++++++-
.../reservation/components/View.class.php | 34 +++++++++++++---
2 files changed, 67 insertions(+), 7 deletions(-)
diff --git a/html/webapp/modules/reservation/components/Action.class.php b/html/webapp/modules/reservation/components/Action.class.php
index fd6b1fd..9513279 100644
--- a/html/webapp/modules/reservation/components/Action.class.php
+++ b/html/webapp/modules/reservation/components/Action.class.php
@@ -276,7 +276,7 @@ function setBlock()
if ($actionName == "reservation_action_edit_addblock") {
$default = $this->_reservationView->getDefaultBlock();
$params = array(
- "block_id" => $this->_request->getParameter("block_id"),
+ "block_id" => $this->_request->getParameter("block_id"),
"display_type" => $default["display_type"],
"display_start_time" => $default["display_start_time"],
"display_interval" => $default["display_interval"],
@@ -302,6 +302,35 @@ function setBlock()
if ($result === false) {
return false;
}
+
+ // 2013.02.12 bugfix 施設=0件か、表示設定方法に削除した施設を指定していた時は、表示方法変更「表示方法」を「日」にアップデート
+ } elseif ($actionName == "reservation_action_edit_location_delete") {
+
+ // 初期設定
+ $default = $this->_reservationView->getDefaultBlock();
+
+ // 施設件数
+ $location_count = $this->_reservationView->getCountLocation();
+
+ // 表示設定方法取得 by location_id
+ $block_by_location_id = $this->_reservationView->getBlockByLocationId();
+
+ // 施設=0件か、表示設定方法に削除した施設を指定していた
+ if ( $location_count == 0 || !empty($block_by_location_id) ) {
+ $params = array(
+ "display_type" => $default["display_type"],
+ "location_id" => $default["location_id"]
+ );
+ $where_params = array(
+ "block_id" => $this->_request->getParameter("block_id"),
+ );
+
+ // 更新
+ $result = $this->_db->updateExecute("reservation_block", $params, $where_params, true);
+ if ($result === false) {
+ return false;
+ }
+ }
}
return true;
}
@@ -557,7 +586,7 @@ function renameLocation()
}
/**
- * 施設を登録する
+ * 施設を削除する
*
* @access public
*/
@@ -601,6 +630,13 @@ function deleteLocation()
if($result === false) {
return false;
}
+
+ // 2013.02.12 bugfix 施設=0件か、表示設定方法に削除した施設を指定していた時は、表示方法変更「表示方法」を「日」にアップデート
+ $result = $this->setBlock();
+ if($result === 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 92c952a..4488790 100644
--- a/html/webapp/modules/reservation/components/View.class.php
+++ b/html/webapp/modules/reservation/components/View.class.php
@@ -268,7 +268,8 @@ function getFirstCategory()
if (!empty($key_array)) {
return $key_array[0];
}
- if ($actionName == "reservation_action_edit_addblock") {
+ // 2013.02.12 bugfix modify
+ if ($actionName == "reservation_action_edit_addblock" || $actionName == "reservation_action_edit_location_delete") {
return "0";
} else {
return false;
@@ -396,16 +397,16 @@ function getDefaultBlock()
$category_id = $category_id;
$location_id = 0;
break;
- default:
- $category_id = 0;
+ default:
+ $category_id = 0;
$location_id = 0;
}
if (defined($config['display_interval']["conf_value"])) {
- $display_interval = constant($config['display_interval']["conf_value"]);
+ $display_interval = constant($config['display_interval']["conf_value"]);
} else {
$display_interval = intval($config['display_interval']["conf_value"]);
- }
+ }
if (defined($config['display_start_time']["conf_value"])) {
$display_start_time = constant($config['display_start_time']["conf_value"]);
@@ -960,6 +961,29 @@ function getBlock($display_type=null)
return $reserve_block;
}
+ // 2013.02.12 bugfix insert
+ /**
+ * デフォルト値取得 by location_id
+ *
+ * @access public
+ */
+ function getBlockByLocationId()
+ {
+ $params = array(
+ "block_id" => $this->_request->getParameter("block_id"),
+ "location_id" => $this->_request->getParameter("location_id")
+ );
+
+ $result =& $this->_db->selectExecute("reservation_block", $params);
+ if (empty($result)) {
+ return false;
+ }
+
+ $reserve_block = $result[0];
+
+ return $reserve_block;
+ }
+
/**
* 予約取得
*
From 1b12e8d4afa1d1be3ff53ec9a719734db82cc555 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: Thu, 14 Feb 2013 15:41:24 +0900
Subject: [PATCH 07/39] =?UTF-8?q?#18=20=E6=96=BD=E8=A8=AD=E4=BA=88?=
=?UTF-8?q?=E7=B4=84=20=E6=97=A5=E8=A1=A8=E7=A4=BA=E3=81=A7=E3=81=AE?=
=?UTF-8?q?=E4=BA=88=E7=B4=84=E6=99=82=E3=81=AB=E4=BA=9B=E7=B4=B0=E3=81=AA?=
=?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=83=90=E3=82=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
予約登録時、「-- 施設の絞り込み --」を選択したカテゴリにする。
---
.../reservation_reserve_regist_location.html | 60 +++++++++----------
.../view/main/reserve/add/Add.class.php | 1 +
2 files changed, 31 insertions(+), 30 deletions(-)
diff --git a/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_location.html b/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_location.html
index 3dff1a3..457a0f0 100644
--- a/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_location.html
+++ b/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_location.html
@@ -1,30 +1,30 @@
-<{strip}>
-
-
-
- <{$lang.reservation_location|smarty:nodefaults}>
-
-
-
-
-
- <{$lang.reservation_select_location|smarty:nodefaults}>
-
- <{foreach name="category" key="category_id" item="category_name" from=$action.category_list}>
- <{if ($action.location_count_list.$category_id > 0 || $smarty.session._user_auth_id == _AUTH_ADMIN) }>
-
- <{if ($category_name == "") }>
- <{$lang.reservation_no_category|smarty:nodefaults}>
- <{else}>
- <{$category_name|smarty:nodefaults}>
- <{/if}>
-
- <{/if}>
- <{/foreach}>
-
-
- <{include file="reservation_view_switch_category.html"}>
-
-
-
-<{/strip}>
+<{strip}>
+
+
+
+ <{$lang.reservation_location|smarty:nodefaults}>
+
+
+
+
+
+ <{$lang.reservation_select_location|smarty:nodefaults}>
+
+ <{foreach name="category" key="category_id" item="category_name" from=$action.category_list}>
+ <{if ($action.location_count_list.$category_id > 0 || $smarty.session._user_auth_id == _AUTH_ADMIN) }>
+ <{if ($category_id == $action.category_id) }> selected="selected"<{/if}>>
+ <{if ($category_name == "") }>
+ <{$lang.reservation_no_category|smarty:nodefaults}>
+ <{else}>
+ <{$category_name|smarty:nodefaults}>
+ <{/if}>
+
+ <{/if}>
+ <{/foreach}>
+
+
+ <{include file="reservation_view_switch_category.html"}>
+
+
+
+<{/strip}>
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 5fc9f22..1b18cfe 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
@@ -20,6 +20,7 @@ class Reservation_View_Main_Reserve_Add extends Action
var $module_id = null;
var $entry_calendar = null;
var $notification_mail = null;
+ var $category_id = null;
// validatorから受け取るため
var $location = null;
From f833d6c5a89b6eafc03c16a3afc655e0cc813a30 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: Thu, 14 Feb 2013 17:29:04 +0900
Subject: [PATCH 08/39] =?UTF-8?q?Revert=20"#18=20=E6=96=BD=E8=A8=AD?=
=?UTF-8?q?=E4=BA=88=E7=B4=84=20=E6=97=A5=E8=A1=A8=E7=A4=BA=E3=81=A7?=
=?UTF-8?q?=E3=81=AE=E4=BA=88=E7=B4=84=E6=99=82=E3=81=AB=E4=BA=9B=E7=B4=B0?=
=?UTF-8?q?=E3=81=AA=E8=A1=A8=E7=A4=BA=E3=83=90=E3=82=B0"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This reverts commit fba694dbfd04efb1b0c7016123f0767a2f6631d9.
---
.../reservation_reserve_regist_location.html | 60 +++++++++----------
.../view/main/reserve/add/Add.class.php | 1 -
2 files changed, 30 insertions(+), 31 deletions(-)
diff --git a/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_location.html b/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_location.html
index 457a0f0..3dff1a3 100644
--- a/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_location.html
+++ b/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_location.html
@@ -1,30 +1,30 @@
-<{strip}>
-
-
-
- <{$lang.reservation_location|smarty:nodefaults}>
-
-
-
-
-
- <{$lang.reservation_select_location|smarty:nodefaults}>
-
- <{foreach name="category" key="category_id" item="category_name" from=$action.category_list}>
- <{if ($action.location_count_list.$category_id > 0 || $smarty.session._user_auth_id == _AUTH_ADMIN) }>
- <{if ($category_id == $action.category_id) }> selected="selected"<{/if}>>
- <{if ($category_name == "") }>
- <{$lang.reservation_no_category|smarty:nodefaults}>
- <{else}>
- <{$category_name|smarty:nodefaults}>
- <{/if}>
-
- <{/if}>
- <{/foreach}>
-
-
- <{include file="reservation_view_switch_category.html"}>
-
-
-
-<{/strip}>
+<{strip}>
+
+
+
+ <{$lang.reservation_location|smarty:nodefaults}>
+
+
+
+
+
+ <{$lang.reservation_select_location|smarty:nodefaults}>
+
+ <{foreach name="category" key="category_id" item="category_name" from=$action.category_list}>
+ <{if ($action.location_count_list.$category_id > 0 || $smarty.session._user_auth_id == _AUTH_ADMIN) }>
+
+ <{if ($category_name == "") }>
+ <{$lang.reservation_no_category|smarty:nodefaults}>
+ <{else}>
+ <{$category_name|smarty:nodefaults}>
+ <{/if}>
+
+ <{/if}>
+ <{/foreach}>
+
+
+ <{include file="reservation_view_switch_category.html"}>
+
+
+
+<{/strip}>
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..5fc9f22 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
@@ -20,7 +20,6 @@ class Reservation_View_Main_Reserve_Add extends Action
var $module_id = null;
var $entry_calendar = null;
var $notification_mail = null;
- var $category_id = null;
// validatorから受け取るため
var $location = null;
From b0d5517fccab766aff68d42404300b856bb1e373 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: Thu, 14 Feb 2013 18:02:12 +0900
Subject: [PATCH 09/39] =?UTF-8?q?#18=20=E6=96=BD=E8=A8=AD=E4=BA=88?=
=?UTF-8?q?=E7=B4=84=20=E6=97=A5=E8=A1=A8=E7=A4=BA=E3=81=A7=E3=81=AE?=
=?UTF-8?q?=E4=BA=88=E7=B4=84=E6=99=82=E3=81=AB=E4=BA=9B=E7=B4=B0=E3=81=AA?=
=?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=83=90=E3=82=B0=E3=80=80html=E3=81=AEdiff?=
=?UTF-8?q?=E3=81=9A=E3=82=8C=E5=86=8D=E3=82=B3=E3=83=9F=E3=83=83=E3=83=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
htmlのdiffずれのため、Revert(戻し) -> 再コミット。
--- やったこと
・Revert(戻し)
・C:\Program Files (x86)\Git\etc\gitconfig
[core]
autoCRLF = false
の確認。(既に設定済みだった)
・ローカルのNetCommons2プロジェクト削除
・NetCommons2プロジェクトを再クローン
--- 環境
windows7
sakura editor
GitHub for Windows
--- 確認
GitHub for Windowsから、コミット前の diff は html、php 共に1行づつの変更で、おかしな所がない事を確認済み。
---
.../reservation_reserve_regist_location.html | 60 +++++++++----------
.../view/main/reserve/add/Add.class.php | 1 +
2 files changed, 31 insertions(+), 30 deletions(-)
diff --git a/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_location.html b/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_location.html
index 3dff1a3..428f8df 100644
--- a/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_location.html
+++ b/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_location.html
@@ -1,30 +1,30 @@
-<{strip}>
-
-
-
- <{$lang.reservation_location|smarty:nodefaults}>
-
-
-
-
-
- <{$lang.reservation_select_location|smarty:nodefaults}>
-
- <{foreach name="category" key="category_id" item="category_name" from=$action.category_list}>
- <{if ($action.location_count_list.$category_id > 0 || $smarty.session._user_auth_id == _AUTH_ADMIN) }>
-
- <{if ($category_name == "") }>
- <{$lang.reservation_no_category|smarty:nodefaults}>
- <{else}>
- <{$category_name|smarty:nodefaults}>
- <{/if}>
-
- <{/if}>
- <{/foreach}>
-
-
- <{include file="reservation_view_switch_category.html"}>
-
-
-
-<{/strip}>
+<{strip}>
+
+
+
+ <{$lang.reservation_location|smarty:nodefaults}>
+
+
+
+
+
+ <{$lang.reservation_select_location|smarty:nodefaults}>
+
+ <{foreach name="category" key="category_id" item="category_name" from=$action.category_list}>
+ <{if ($action.location_count_list.$category_id > 0 || $smarty.session._user_auth_id == _AUTH_ADMIN) }>
+ <{if ($category_id == $action.category_id) }> selected="selected"<{/if}>>
+ <{if ($category_name == "") }>
+ <{$lang.reservation_no_category|smarty:nodefaults}>
+ <{else}>
+ <{$category_name|smarty:nodefaults}>
+ <{/if}>
+
+ <{/if}>
+ <{/foreach}>
+
+
+ <{include file="reservation_view_switch_category.html"}>
+
+
+
+<{/strip}>
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 5fc9f22..1b18cfe 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
@@ -20,6 +20,7 @@ class Reservation_View_Main_Reserve_Add extends Action
var $module_id = null;
var $entry_calendar = null;
var $notification_mail = null;
+ var $category_id = null;
// validatorから受け取るため
var $location = null;
From c2b3f8e40d959124ee7c84670e7085b9c338c5dd 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: Thu, 14 Feb 2013 19:00:42 +0900
Subject: [PATCH 10/39] =?UTF-8?q?Revert=20"#18=20=E6=96=BD=E8=A8=AD?=
=?UTF-8?q?=E4=BA=88=E7=B4=84=20=E6=97=A5=E8=A1=A8=E7=A4=BA=E3=81=A7?=
=?UTF-8?q?=E3=81=AE=E4=BA=88=E7=B4=84=E6=99=82=E3=81=AB=E4=BA=9B=E7=B4=B0?=
=?UTF-8?q?=E3=81=AA=E8=A1=A8=E7=A4=BA=E3=83=90=E3=82=B0=E3=80=80html?=
=?UTF-8?q?=E3=81=AEdiff=E3=81=9A=E3=82=8C=E5=86=8D=E3=82=B3=E3=83=9F?=
=?UTF-8?q?=E3=83=83=E3=83=88"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This reverts commit 4bf4cffe835155f5c1071212e3a971375f870179.
---
.../reservation_reserve_regist_location.html | 60 +++++++++----------
.../view/main/reserve/add/Add.class.php | 1 -
2 files changed, 30 insertions(+), 31 deletions(-)
diff --git a/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_location.html b/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_location.html
index 428f8df..3dff1a3 100644
--- a/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_location.html
+++ b/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_location.html
@@ -1,30 +1,30 @@
-<{strip}>
-
-
-
- <{$lang.reservation_location|smarty:nodefaults}>
-
-
-
-
-
- <{$lang.reservation_select_location|smarty:nodefaults}>
-
- <{foreach name="category" key="category_id" item="category_name" from=$action.category_list}>
- <{if ($action.location_count_list.$category_id > 0 || $smarty.session._user_auth_id == _AUTH_ADMIN) }>
- <{if ($category_id == $action.category_id) }> selected="selected"<{/if}>>
- <{if ($category_name == "") }>
- <{$lang.reservation_no_category|smarty:nodefaults}>
- <{else}>
- <{$category_name|smarty:nodefaults}>
- <{/if}>
-
- <{/if}>
- <{/foreach}>
-
-
- <{include file="reservation_view_switch_category.html"}>
-
-
-
-<{/strip}>
+<{strip}>
+
+
+
+ <{$lang.reservation_location|smarty:nodefaults}>
+
+
+
+
+
+ <{$lang.reservation_select_location|smarty:nodefaults}>
+
+ <{foreach name="category" key="category_id" item="category_name" from=$action.category_list}>
+ <{if ($action.location_count_list.$category_id > 0 || $smarty.session._user_auth_id == _AUTH_ADMIN) }>
+
+ <{if ($category_name == "") }>
+ <{$lang.reservation_no_category|smarty:nodefaults}>
+ <{else}>
+ <{$category_name|smarty:nodefaults}>
+ <{/if}>
+
+ <{/if}>
+ <{/foreach}>
+
+
+ <{include file="reservation_view_switch_category.html"}>
+
+
+
+<{/strip}>
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..5fc9f22 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
@@ -20,7 +20,6 @@ class Reservation_View_Main_Reserve_Add extends Action
var $module_id = null;
var $entry_calendar = null;
var $notification_mail = null;
- var $category_id = null;
// validatorから受け取るため
var $location = null;
From 15180e26cc9b063524e8feed0401d04dd09f5ea5 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: Thu, 14 Feb 2013 19:26:21 +0900
Subject: [PATCH 11/39] =?UTF-8?q?#18=20=E6=96=BD=E8=A8=AD=E4=BA=88?=
=?UTF-8?q?=E7=B4=84=20=E6=97=A5=E8=A1=A8=E7=A4=BA=E3=81=A7=E3=81=AE?=
=?UTF-8?q?=E4=BA=88=E7=B4=84=E6=99=82=E3=81=AB=E4=BA=9B=E7=B4=B0=E3=81=AA?=
=?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=83=90=E3=82=B0=E3=80=80html=E3=81=AEdiff?=
=?UTF-8?q?=E3=81=9A=E3=82=8C=E5=86=8D=E3=82=B3=E3=83=9F=E3=83=83=E3=83=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
・GitHub 上の改行コードがどうなっているか確認
⇒WebページからZipでダウンロードして、コミットしたhtmlを確認
⇒⇒LFだった。
⇒⇒さわってないhtmlは CRLFだった。
⇒⇒⇒autocrlf設定が生きてそう
・gitconfigがもう一つあった。
%USERPROFILE%\AppData\Local\GitHub\PortableGit_どーたらこーたら\etc\gitconfig
⇒autocrlf true⇒false
これで再コミットしたらどうだろう?
--- 参考
http://d.hatena.ne.jp/dojum/20121126
http://git-scm.com/book/ja/ch7-1.html#書式設定と空白文字
---
.../templates/default/reservation_reserve_regist_location.html | 2 +-
.../modules/reservation/view/main/reserve/add/Add.class.php | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_location.html b/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_location.html
index 3dff1a3..fe84052 100644
--- a/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_location.html
+++ b/html/webapp/modules/reservation/templates/default/reservation_reserve_regist_location.html
@@ -12,7 +12,7 @@
<{foreach name="category" key="category_id" item="category_name" from=$action.category_list}>
<{if ($action.location_count_list.$category_id > 0 || $smarty.session._user_auth_id == _AUTH_ADMIN) }>
-
+ <{if ($category_id == $action.category_id) }> selected="selected"<{/if}>>
<{if ($category_name == "") }>
<{$lang.reservation_no_category|smarty:nodefaults}>
<{else}>
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 5fc9f22..1b18cfe 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
@@ -20,6 +20,7 @@ class Reservation_View_Main_Reserve_Add extends Action
var $module_id = null;
var $entry_calendar = null;
var $notification_mail = null;
+ var $category_id = null;
// validatorから受け取るため
var $location = null;
From e32ca32ca81d34df60f40f47ef080d2dca388682 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=B0=B8=E5=8E=9F=E3=80=80=E7=AF=A4?=
Date: Sat, 16 Feb 2013 14:26:49 +0900
Subject: [PATCH 12/39] =?UTF-8?q?#16=20=E6=97=A5=E8=AA=8C=E3=81=AE?=
=?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB=E3=81=8C=E6=94=B9=E8=A1=8C?=
=?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
#16 日誌のタイトルが改行されない件について、日誌タイトルcss の white-space:nowrap; を削除しました。
---
html/webapp/modules/journal/files/css/default/style.css | 1 -
1 file changed, 1 deletion(-)
diff --git a/html/webapp/modules/journal/files/css/default/style.css b/html/webapp/modules/journal/files/css/default/style.css
index d9d5d5f..6ca6cd2 100644
--- a/html/webapp/modules/journal/files/css/default/style.css
+++ b/html/webapp/modules/journal/files/css/default/style.css
@@ -40,7 +40,6 @@
vertical-align:middle;
border-right:medium none;
font-weight:bold;
- white-space:nowrap;
}
.journal_list_title_h {
padding-top: 5px;
From dea73d93df3dbd2a22d1c31f554ae72b3790fdbc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=B0=B8=E5=8E=9F=E3=80=80=E7=AF=A4?=
Date: Sun, 24 Feb 2013 08:44:20 +0900
Subject: [PATCH 13/39] =?UTF-8?q?#8=20=E3=83=87=E3=83=BC=E3=82=BF=E7=94=A8?=
=?UTF-8?q?=E3=81=AE=E7=A9=BA=E3=83=95=E3=82=A9=E3=83=AB=E3=83=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
/webapp/templates_c と /webapp/uploads を作成します。
空フォルダなので、.gitkeep を同封します。
---
html/webapp/templates_c/.gitkeep | 0
html/webapp/uploads/.gitkeep | 0
2 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 html/webapp/templates_c/.gitkeep
create mode 100644 html/webapp/uploads/.gitkeep
diff --git a/html/webapp/templates_c/.gitkeep b/html/webapp/templates_c/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/html/webapp/uploads/.gitkeep b/html/webapp/uploads/.gitkeep
new file mode 100644
index 0000000..e69de29
From a611069d5bcfafab4be01fe0177b5ceb5fcf46b5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E3=82=AA=E3=83=BC=E3=83=97=E3=83=B3=E3=82=BD=E3=83=BC?=
=?UTF-8?q?=E3=82=B9=E3=83=BB=E3=83=AF=E3=83=BC=E3=82=AF=E3=82=B7=E3=83=A7?=
=?UTF-8?q?=E3=83=83=E3=83=97=20=E6=B0=B8=E5=8E=9F=20=E7=AF=A4?=
Date: Sun, 24 Feb 2013 08:47:34 +0900
Subject: [PATCH 14/39] =?UTF-8?q?#9=20git=E3=81=AE=E7=84=A1=E8=A6=96?=
=?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=82=92=E4=BF=AE=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
komunaさんに指摘頂いた内容を反映
---
.gitignore | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/.gitignore b/.gitignore
index 05a5b3e..fecf3e6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,12 +2,12 @@
#- NetCommons2用 無視ファイル設定
#-----------------------------------
-html/images
-html/js
-html/themes
+/html/images
+/html/js
+/html/themes
-html/webapp/templates_c
-html/webapp/uploads
+/html/webapp/templates_c/*
+/html/webapp/uploads/*
# install.inc.php はサーバにコミットされているので、
# この無視ファイルでは無視できない。(以下のファイル)
From c288124ba51fca0655f430a9567f338fec5c3e38 Mon Sep 17 00:00:00 2001
From: komuna
Date: Mon, 25 Feb 2013 22:12:22 +0900
Subject: [PATCH 15/39] =?UTF-8?q?=E8=91=97=E4=BD=9C=E6=A8=A9=E8=A1=A8?=
=?UTF-8?q?=E7=A4=BA=E3=81=AB=E9=81=A9=E5=BA=A6=E3=81=AA=E3=83=91=E3=83=87?=
=?UTF-8?q?=E3=82=A3=E3=83=B3=E3=82=B0=E3=82=92=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
「アクセシビリティー」テーマもこれに整合するよう修正。
---
html/webapp/style/css/page_style.css | 9 ++++++++-
.../style/themes/accessibility/css/default/style.css | 2 +-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/html/webapp/style/css/page_style.css b/html/webapp/style/css/page_style.css
index 0def272..fee981f 100644
--- a/html/webapp/style/css/page_style.css
+++ b/html/webapp/style/css/page_style.css
@@ -144,7 +144,14 @@ table#footerbar {
width:100%;
/*border-top:1px #a9a9d1 solid;*/
}
-table#footerbar .copyright {text-align:right; color:#a3a3a3; vertical-align:middle; font-size:90%; font-weight:bold;}
+table#footerbar .copyright {
+ text-align:right;
+ color:#a3a3a3;
+ vertical-align:middle;
+ font-size:90%;
+ font-weight:bold;
+ padding:0 0.5em;
+}
/* センターカラム 情報メッセージ */
div#centercolumn_inf_mes {
diff --git a/html/webapp/style/themes/accessibility/css/default/style.css b/html/webapp/style/themes/accessibility/css/default/style.css
index 7720fd1..dab3d8a 100644
--- a/html/webapp/style/themes/accessibility/css/default/style.css
+++ b/html/webapp/style/themes/accessibility/css/default/style.css
@@ -126,7 +126,7 @@ table.outer th {
table#footerbar .copyright {
color:#404040;
font-size:120%;
- padding:0px 5px;
+ padding:0 0.5em;
}
td.grid_row, tr.grid_row td {
From f6631434d106d7f97e1d954a69bd31f77f165a19 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=B0=B8=E5=8E=9F=E3=80=80=E7=AF=A4?=
Date: Tue, 26 Feb 2013 08:21:14 +0900
Subject: [PATCH 16/39] =?UTF-8?q?#23=20=E6=96=B0=E7=9D=80=E6=83=85?=
=?UTF-8?q?=E5=A0=B1=E3=81=AE=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB=E3=81=8C?=
=?UTF-8?q?=E6=94=B9=E8=A1=8C=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
タイトルを改行するように修正しました。
---
html/webapp/modules/whatsnew/files/css/default/style.css | 1 -
1 file changed, 1 deletion(-)
diff --git a/html/webapp/modules/whatsnew/files/css/default/style.css b/html/webapp/modules/whatsnew/files/css/default/style.css
index d21ddc8..2d8f1ac 100644
--- a/html/webapp/modules/whatsnew/files/css/default/style.css
+++ b/html/webapp/modules/whatsnew/files/css/default/style.css
@@ -3,7 +3,6 @@
}
.whatsnew_title {
padding:2px 10px 3px 5px;
- white-space:nowrap;
}
tr.whatsnew_unread td a{
color:#04419a !important;
From cab346e317c0bef38f494d97d0e5732163c9f759 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=B0=B8=E5=8E=9F=E3=80=80=E7=AF=A4?=
Date: Tue, 26 Feb 2013 10:37:17 +0900
Subject: [PATCH 17/39] =?UTF-8?q?#25=20=E8=91=97=E4=BD=9C=E6=A8=A9?=
=?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=81=AB=E9=81=A9=E5=BA=A6=E3=81=AA=E3=83=91?=
=?UTF-8?q?=E3=83=87=E3=82=A3=E3=83=B3=E3=82=B0=E3=82=92=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Pull Requests で頂いた「著作権表示に適度なパディングを。」をマージして、幅を調整します。
対象のPull Requests は以下。
#24
---
html/webapp/style/css/page_style.css | 2 +-
html/webapp/style/themes/accessibility/css/default/style.css | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/html/webapp/style/css/page_style.css b/html/webapp/style/css/page_style.css
index fee981f..c991f20 100644
--- a/html/webapp/style/css/page_style.css
+++ b/html/webapp/style/css/page_style.css
@@ -150,7 +150,7 @@ table#footerbar .copyright {
vertical-align:middle;
font-size:90%;
font-weight:bold;
- padding:0 0.5em;
+ padding:0 8px;
}
/* センターカラム 情報メッセージ */
diff --git a/html/webapp/style/themes/accessibility/css/default/style.css b/html/webapp/style/themes/accessibility/css/default/style.css
index dab3d8a..0fd5fed 100644
--- a/html/webapp/style/themes/accessibility/css/default/style.css
+++ b/html/webapp/style/themes/accessibility/css/default/style.css
@@ -126,7 +126,7 @@ table.outer th {
table#footerbar .copyright {
color:#404040;
font-size:120%;
- padding:0 0.5em;
+ padding:0 8px;
}
td.grid_row, tr.grid_row td {
From 5e2e5e712c82931c9e9cade5612d694855d09e75 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=B0=B8=E5=8E=9F=E3=80=80=E7=AF=A4?=
Date: Tue, 26 Feb 2013 12:18:21 +0900
Subject: [PATCH 18/39] =?UTF-8?q?#11=20Generator=20=E3=81=AEPHP5.3=20?=
=?UTF-8?q?=E3=83=AF=E3=83=BC=E3=83=8B=E3=83=B3=E3=82=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
修正しました。
---
html/maple/generate/script/generate.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/html/maple/generate/script/generate.php b/html/maple/generate/script/generate.php
index 8f5d178..6c74f17 100644
--- a/html/maple/generate/script/generate.php
+++ b/html/maple/generate/script/generate.php
@@ -23,7 +23,7 @@
define('BASE_DIR', dirname(dirname(dirname(dirname(__FILE__)))));
-error_reporting(E_ALL);
+error_reporting(E_ALL ^ E_DEPRECATED);
//error_reporting(0);
define('DEBUG_MODE', 0);
From ea78cb9bce36aecaadb584fd27b0f2aa0568c32f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=B0=B8=E5=8E=9F=E3=80=80=E7=AF=A4?=
Date: Tue, 26 Feb 2013 12:22:26 +0900
Subject: [PATCH 19/39] =?UTF-8?q?#11=20=E3=82=B9=E3=82=B1=E3=83=AB?=
=?UTF-8?q?=E3=83=88=E3=83=B3=E3=81=AE=E3=83=A2=E3=82=B8=E3=83=A5=E3=83=BC?=
=?UTF-8?q?=E3=83=AB=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
修正しました。
コアのバージョンが上がったら、また修正しましょう。
---
.../generate/templates/maple/generate/skeleton/install.ini.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/html/maple/generate/templates/maple/generate/skeleton/install.ini.txt b/html/maple/generate/templates/maple/generate/skeleton/install.ini.txt
index 264b247..644a247 100644
--- a/html/maple/generate/templates/maple/generate/skeleton/install.ini.txt
+++ b/html/maple/generate/templates/maple/generate/skeleton/install.ini.txt
@@ -1,4 +1,4 @@
-version = "2.1.0.0"
+version = "2.4.0.0"
action_name="action_name; ?>"
moduletype == "normal" || $skeleton->moduletype == "full") {
From 199aed2556bd9db708ac1a42296cbe4c6f388bdb Mon Sep 17 00:00:00 2001
From: komuna
Date: Thu, 28 Feb 2013 17:22:25 +0900
Subject: [PATCH 20/39] =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=82=B9=E3=83=88?=
=?UTF-8?q?=E3=83=BC=E3=83=AB=E5=BE=8C=E3=81=AE=20welcome=20=E3=83=A1?=
=?UTF-8?q?=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8=E4=B8=AD=E3=81=AE=E6=A9=9F?=
=?UTF-8?q?=E6=A7=8B=E5=90=8D=E3=81=AE=E8=AA=A4=E3=82=8A=E3=82=92=E8=A8=82?=
=?UTF-8?q?=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
「情報・システム研究機構」の「研究」が抜けていた。
ついでに “ ” の向きの間違いも訂正。
---
html/webapp/modules/install/language/japanese/welcome.php | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/html/webapp/modules/install/language/japanese/welcome.php b/html/webapp/modules/install/language/japanese/welcome.php
index 190ac84..184068d 100644
--- a/html/webapp/modules/install/language/japanese/welcome.php
+++ b/html/webapp/modules/install/language/japanese/welcome.php
@@ -12,17 +12,17 @@
$content .=
"はじめに
- NetCommonsは、大学共同利用機関法人情報・システム機構 国立情報学研究所が開発したPHPによるオープンソースの情報共有基盤システムです。
-本ソフトウェアの著作権は情報・システム機構およびプログラムを作成した各個人に帰属し、FreeBSDライセンス (参考:日本語訳 )によって公開されています。本ソフトウェアを利用する方は、FreeBSDライセンスの精神をご理解の上、ご利用ください。
+ NetCommonsは、大学共同利用機関法人情報・システム研究機構 国立情報学研究所が開発したPHPによるオープンソースの情報共有基盤システムです。
+本ソフトウェアの著作権は情報・システム研究機構およびプログラムを作成した各個人に帰属し、FreeBSDライセンス (参考:日本語訳 )によって公開されています。本ソフトウェアを利用する方は、FreeBSDライセンスの精神をご理解の上、ご利用ください。
本ソフトウェアはソースコード形式であれバイナリ形式であれ、変更の有無に関わらず、以下の条件を満たす限りにおいて、再配布および使用を許可します:
ソースコード形式で再配布する場合、上記著作権表示、本条件書および下記責任限定規定を必ず含めてください。
バイナリ形式で再配布する場合、上記著作権表示、本条件書および下記責任限定規定を、配布物とともに提供される文書 および/または他の資料に必ず含めてください。
- 本ソフトウェアは国立情報学研究所NetCommons PROJECT によって、”現状のまま” 提供されるものとします。本ソフトウェアについては、明示黙示を問わず、商用品として通常そなえるべき品質をそなえているとの保証も、特定の目的に適合するとの保証を含め、何の保証もなされません。 事由のいかんを問わず、損害発生の原因いかんを問わず、且つ、 責任の根拠が契約であるか厳格責任であるか (過失その他) 不法行為であるかを問わず、 情報・システム研究機構、国立情報学研究所、NetCommons PROJECTおよび寄与者も、仮にそのような損害が発生する可能性を知らされていたとしても、本ソフトウェアの使用から発生した直接損害、間接損害、偶発的な損害、特別損害、懲罰的損害または結果損害のいずれに対しても (代替品または サービスの提供; 使用機会、データまたは利益の損失の補償; または、業務の中断に対する補償を含め) 責任をいっさい負いません。
+ 本ソフトウェアは国立情報学研究所NetCommons PROJECT によって、“現状のまま” 提供されるものとします。本ソフトウェアについては、明示黙示を問わず、商用品として通常そなえるべき品質をそなえているとの保証も、特定の目的に適合するとの保証を含め、何の保証もなされません。 事由のいかんを問わず、損害発生の原因いかんを問わず、且つ、 責任の根拠が契約であるか厳格責任であるか (過失その他) 不法行為であるかを問わず、 情報・システム研究機構、国立情報学研究所、NetCommons PROJECTおよび寄与者も、仮にそのような損害が発生する可能性を知らされていたとしても、本ソフトウェアの使用から発生した直接損害、間接損害、偶発的な損害、特別損害、懲罰的損害または結果損害のいずれに対しても (代替品または サービスの提供; 使用機会、データまたは利益の損失の補償; または、業務の中断に対する補償を含め) 責任をいっさい負いません。
- 本ソフトウェアの名称である「NetCommons」およびロゴは大学共同利用機関法人情報・システム機構の知的財産として商標登録されています。商標「NetCommons」の利用を希望される場合には、大学共同利用機関法人情報・システム機構 国立情報学研究所(郵便番号101-8430 東京都千代田区一ツ橋2-1-2)までお問い合わせください。
+ 本ソフトウェアの名称である「NetCommons」およびロゴは大学共同利用機関法人情報・システム研究機構の知的財産として商標登録されています。商標「NetCommons」の利用を希望される場合には、大学共同利用機関法人情報・システム研究機構 国立情報学研究所(郵便番号101-8430 東京都千代田区一ツ橋2-1-2)までお問い合わせください。
必要なソフトウエア
From 7904e3c31e7933115d6dc708874997040ceac30e Mon Sep 17 00:00:00 2001
From: komuna
Date: Thu, 28 Feb 2013 17:53:28 +0900
Subject: [PATCH 21/39] =?UTF-8?q?CSS,=20JavaScript,=20gzip=20=E3=81=AE?=
=?UTF-8?q?=E8=A1=A8=E8=A8=98=E3=81=AE=E8=AA=A4=E3=82=8A=E3=82=92=E8=A8=82?=
=?UTF-8?q?=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Css とか Javascript とかになってた。
PHP のコメント中などユーザーの目に触れないところは修正していない。
---
html/webapp/modules/system/language/chinese/main.ini | 4 ++--
html/webapp/modules/system/language/english/main.ini | 4 ++--
html/webapp/modules/system/language/japanese/main.ini | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/html/webapp/modules/system/language/chinese/main.ini b/html/webapp/modules/system/language/chinese/main.ini
index deba918..35a6c08 100644
--- a/html/webapp/modules/system/language/chinese/main.ini
+++ b/html/webapp/modules/system/language/chinese/main.ini
@@ -64,9 +64,9 @@ system_closesite_text_note = "上述说明在网站关闭时将出现。"
[System_View_Main_Server::System_Action_Server]
system_server_config = "系统配置"
system_php_memory_limit = "最大内存"
-system_js_compress_gzip = "以Gzip格式压缩Javascript文件?"
+system_js_compress_gzip = "以gzip格式压缩JavaScript文件?"
system_none_zlib = "没有被安装zlib扩展包。 要安装zlib扩展包,需要在编译PHP时加上选项--with-zlib[=DIR]。"
-system_js_compress_gzip_desc = "通过压缩javascript文件,您可以节约传输时间。但并不是所有的浏览器或代理服务器都能够正确解压缩Gzip格式文件。"
+system_js_compress_gzip_desc = "通过压缩JavaScript文件,您可以节约传输时间。但并不是所有的浏览器或代理服务器都能够正确解压缩gzip格式文件。"
system_session_title = "会话"
system_session_name = "保存会话ID的Coockie"
system_proxy_title = "代理服务器"
diff --git a/html/webapp/modules/system/language/english/main.ini b/html/webapp/modules/system/language/english/main.ini
index 93b24c1..debac24 100644
--- a/html/webapp/modules/system/language/english/main.ini
+++ b/html/webapp/modules/system/language/english/main.ini
@@ -64,9 +64,9 @@ system_closesite_text_note = "The text that is presented when the site is closed
[System_View_Main_Server::System_Action_Server]
system_server_config = "System Configuration"
system_php_memory_limit = "Maximum number of memories"
-system_js_compress_gzip = "Compress Javascript files in Gzip format?"
+system_js_compress_gzip = "Compress JavaScript files in gzip format?"
system_none_zlib = "Not install the zlib extension yet. To install the zlib extension, you need to add the option --with-zlib[=DIR] when compiling PHP."
-system_js_compress_gzip_desc = "By compressing the javascript files, you can save the transfer time. However, not every browser or proxy server is able to expand the Gzip format correctly."
+system_js_compress_gzip_desc = "By compressing the JavaScript files, you can save the transfer time. However, not every browser or proxy server is able to expand the gzip format correctly."
system_session_title = "Session"
system_session_name = "Coockie for session ID"
system_proxy_title = "proxy server"
diff --git a/html/webapp/modules/system/language/japanese/main.ini b/html/webapp/modules/system/language/japanese/main.ini
index e71a99c..e4549d8 100644
--- a/html/webapp/modules/system/language/japanese/main.ini
+++ b/html/webapp/modules/system/language/japanese/main.ini
@@ -64,9 +64,9 @@ system_closesite_text_note = "サイト閉鎖時に表示します。"
[System_View_Main_Server::System_Action_Server]
system_server_config = "システムコンフィグ"
system_php_memory_limit = "PHP最大メモリ数"
-system_js_compress_gzip = "Css,JavascriptのGzip圧縮転送を有効にする"
+system_js_compress_gzip = "CSS,JavaScriptのgzip圧縮転送を有効にする"
system_none_zlib = "zlib拡張モジュールがインストールされていません。 有効にする場合、PHPのコンパイル時の オプションに--with-zlib[=DIR]を 指定してコンパイルする必要があります。"
-system_js_compress_gzip_desc = "HTTP転送されるCss,JavascriptをGzip圧縮することで、読み込みが早くなります。但し、gzip圧縮に対応していないブラウザ等でjavascriptの転送に失敗する場合があります。"
+system_js_compress_gzip_desc = "HTTP転送されるCSS,JavaScriptをgzip圧縮することで、読み込みが早くなります。但し、gzip圧縮に対応していないブラウザ等でJavaScriptの転送に失敗する場合があります。"
system_session_title = "セッション"
system_session_name = "セッションID保存用のクッキーの名称"
system_proxy_title = "プロキシサーバ"
From d408c29949dbcb91737385503b688dae0cc73683 Mon Sep 17 00:00:00 2001
From: komuna
Date: Thu, 28 Feb 2013 18:09:17 +0900
Subject: [PATCH 22/39] =?UTF-8?q?=E6=96=87=E6=9B=B8=E5=9E=8B=E5=AE=A3?=
=?UTF-8?q?=E8=A8=80=E3=81=AE=E5=89=8D=E3=81=AE=E7=A9=BA=E8=A1=8C=E3=82=92?=
=?UTF-8?q?=E5=89=8A=E9=99=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
ソース見たときに気持ち悪いので。
あっても文法違反ではないし,表示に支障はないが。
---
html/webapp/templates/main/header.html | 1 -
1 file changed, 1 deletion(-)
diff --git a/html/webapp/templates/main/header.html b/html/webapp/templates/main/header.html
index 9d61453..0586369 100644
--- a/html/webapp/templates/main/header.html
+++ b/html/webapp/templates/main/header.html
@@ -1,4 +1,3 @@
-
<{strip}>
From 2034982389e776b7c4b3a24ede86dcfd9e79406f Mon Sep 17 00:00:00 2001
From: kteraguchi
Date: Thu, 11 Apr 2013 18:34:20 +0900
Subject: [PATCH 23/39] =?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=E3=81=A7=E6=BC=8F=E3=82=8C=E3=81=A6?=
=?UTF-8?q?=E3=81=9F=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92=E8=BF=BD?=
=?UTF-8?q?=E5=8A=A0=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../modules/user/update/Update.class.php | 131 ++++++++++++++++++
html/webapp/modules/user/update/maple.ini | 8 ++
2 files changed, 139 insertions(+)
create mode 100644 html/webapp/modules/user/update/Update.class.php
create mode 100644 html/webapp/modules/user/update/maple.ini
diff --git a/html/webapp/modules/user/update/Update.class.php b/html/webapp/modules/user/update/Update.class.php
new file mode 100644
index 0000000..9b0ec26
--- /dev/null
+++ b/html/webapp/modules/user/update/Update.class.php
@@ -0,0 +1,131 @@
+db->execute($sql);
+ if ($indexes === false) {
+ return false;
+ }
+ foreach($indexes as $index) {
+ if ($index['Key_name'] == 'item_id') {
+ $isIndexedItemId = true;
+ }
+ if ($index['Key_name'] == 'content') {
+ $isIndexedContent = true;
+
+ if ($index['Index_type'] == 'FULLTEXT') {
+ $isFullTextIndexedContent = true;
+ }
+ }
+ }
+ if (!$isIndexedItemId) {
+ $sql = "ALTER TABLE {users_items_link} "
+ . "ADD INDEX ("
+ . "`item_id`, "
+ . "`email_reception_flag`);";
+ $result = $this->db->execute($sql);
+ if ($result === false) {
+ return false;
+ }
+ }
+ if ($isFullTextIndexedContent) {
+ $sql = "ALTER TABLE {users_items_link} "
+ . "DROP INDEX `content`;";
+ $result = $this->db->execute($sql);
+ if ($result === false) {
+ return false;
+ }
+ $isIndexedContent = false;
+ }
+ if (!$isIndexedContent) {
+ $sql = "ALTER TABLE {users_items_link} "
+ . "ADD INDEX (`content`(255));";
+ $result = $this->db->execute($sql);
+ if ($result === false) {
+ return false;
+ }
+ }
+
+ $sql = "SHOW INDEX "
+ . "FROM {users};";
+ $indexes = $this->db->execute($sql);
+ if ($indexes === false) {
+ return false;
+ }
+ $isIndexedLoginId = false;
+ $isIndexedHandle = false;
+ $isIndexedActiveFlag = false;
+ $isIndexedActivateKey = false;
+ foreach($indexes as $index) {
+ if ($index['Key_name'] == 'active_flag') {
+ $isIndexedActiveFlag = true;
+ }
+ if ($index['Key_name'] == 'login_id') {
+ $isIndexedLoginId = true;
+ }
+ if ($index['Key_name'] == 'handle') {
+ $isIndexedHandle = true;
+ }
+ if ($index['Key_name'] == 'activate_key') {
+ $isIndexedActivateKey = true;
+ }
+ }
+ if (!$isIndexedLoginId) {
+ $sql = "ALTER TABLE {users} "
+ . "ADD INDEX (`login_id`);";
+ $result = $this->db->execute($sql);
+ if ($result === false) {
+ return false;
+ }
+ }
+ if (!$isIndexedHandle) {
+ $sql = "ALTER TABLE {users} "
+ . "ADD INDEX (`handle`);";
+ $result = $this->db->execute($sql);
+ if ($result === false) {
+ return false;
+ }
+ }
+ if (!$isIndexedActiveFlag) {
+ $sql = "ALTER TABLE {users} "
+ . "ADD INDEX ("
+ . "`active_flag`, "
+ . "`system_flag`, "
+ . "`role_authority_id`);";
+ $result = $this->db->execute($sql);
+ if ($result === false) {
+ return false;
+ }
+ }
+ if (!$isIndexedActivateKey) {
+ $sql = "ALTER TABLE {users} "
+ . "ADD INDEX (`activate_key`);";
+ $result = $this->db->execute($sql);
+ if ($result === false) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
+?>
diff --git a/html/webapp/modules/user/update/maple.ini b/html/webapp/modules/user/update/maple.ini
new file mode 100644
index 0000000..1a2a42e
--- /dev/null
+++ b/html/webapp/modules/user/update/maple.ini
@@ -0,0 +1,8 @@
+[RecursiveNocall]
+ValidateDef =
+
+[ValidateDef]
+requiredfalse ="1:lang._invalid_input"
+
+[Action]
+db = "ref:DbObject"
\ No newline at end of file
From 1be6c12b63d9b42ccc3372f73e009fb20eeee9d8 Mon Sep 17 00:00:00 2001
From: kteraguchi
Date: Thu, 11 Apr 2013 18:51:25 +0900
Subject: [PATCH 24/39] =?UTF-8?q?#52=20#53=E3=80=80=E3=83=9A=E3=83=BC?=
=?UTF-8?q?=E3=82=B8=E3=83=87=E3=83=BC=E3=82=BF=E5=89=8A=E9=99=A4=E5=87=A6?=
=?UTF-8?q?=E7=90=86=E3=81=AE=E5=85=B1=E9=80=9A=E5=8C=96=E3=80=81=E5=8F=8A?=
=?UTF-8?q?=E3=81=B3=E3=80=81=E4=BC=9A=E5=93=A1=E6=A4=9C=E7=B4=A2=E3=81=AE?=
=?UTF-8?q?=E4=B8=8D=E5=85=B7=E5=90=88=E4=BF=AE=E6=AD=A3=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/abbreviateurl/Action.class.php | 18 +
.../webapp/components/blocks/Action.class.php | 39 +-
.../components/database/Sqlutility.class.php | 287 ++++++------
html/webapp/components/pages/Action.class.php | 413 +++++++++++++++---
html/webapp/components/pages/View.class.php | 47 ++
.../components/uploads/Action.class.php | 67 +--
html/webapp/components/users/Action.class.php | 173 +++++++-
html/webapp/components/users/View.class.php | 20 +-
.../components/whatsnew/Action.class.php | 32 +-
.../backup/action/main/init/Init.class.php | 1 -
.../edit/deletepage/Deletepage.class.php | 155 +++----
.../menu/action/edit/deletepage/maple.ini | 4 +-
.../admin/uninstall/Uninstall.class.php | 11 +-
.../room/action/admin/delete/Delete.class.php | 208 +--------
.../room/action/admin/delete/dicon.ini | 6 +-
.../room/action/admin/delete/maple.ini | 19 +-
.../admin/selmodules/Selmodules.class.php | 216 ++++-----
.../room/action/admin/selmodules/dicon.ini | 7 +-
html/webapp/modules/room/install.ini | 1 +
.../modules/room/update/Update.class.php | 55 +++
html/webapp/modules/room/update/dicon.ini | 13 +
html/webapp/modules/room/update/maple.ini | 12 +
.../user/action/admin/delete/Delete.class.php | 158 +------
.../user/action/admin/delete/dicon.ini | 4 +-
.../user/action/admin/delete/maple.ini | 8 -
.../admin/seldelete/Seldelete.class.php | 250 ++---------
.../user/action/admin/seldelete/dicon.ini | 4 +-
.../user/action/admin/seldelete/maple.ini | 7 -
.../whatsnew/components/Action.class.php | 5 +-
.../modules/whatsnew/update/Update.class.php | 41 ++
30 files changed, 1129 insertions(+), 1152 deletions(-)
create mode 100644 html/webapp/modules/room/update/Update.class.php
create mode 100644 html/webapp/modules/room/update/dicon.ini
create mode 100644 html/webapp/modules/room/update/maple.ini
diff --git a/html/webapp/components/abbreviateurl/Action.class.php b/html/webapp/components/abbreviateurl/Action.class.php
index ccd7eea..7b1b314 100644
--- a/html/webapp/components/abbreviateurl/Action.class.php
+++ b/html/webapp/components/abbreviateurl/Action.class.php
@@ -263,6 +263,24 @@ function moveRoom($contents_id, $org_room_id, $move_room_id)
return true;
}
+ /**
+ * 条件に該当する短縮URLデータを削除する。
+ *
+ * @param string $whereClause where句文字列
+ * @param array $bindValues バインド値配列
+ * @return boolean true or false
+ * @access public
+ */
+ function deleteByWhereClause($whereClause, $bindValues)
+ {
+ $sql = "DELETE FROM {abbreviate_url} "
+ . "WHERE " . $whereClause;
+ if (!$this->_db->execute($sql, $bindValues)) {
+ $this->_db->addError();
+ return false;
+ }
+ return true;
+ }
}
?>
diff --git a/html/webapp/components/blocks/Action.class.php b/html/webapp/components/blocks/Action.class.php
index 6e29ddc..749a0e4 100644
--- a/html/webapp/components/blocks/Action.class.php
+++ b/html/webapp/components/blocks/Action.class.php
@@ -631,13 +631,13 @@ function delFuncExec($block_id, $block_obj = null, $delete_action = null)
// 配列でなければエラーとする
return false;
}
-
+
//自動的に削除
$where_params = array(
"block_id" => $block_id
);
$error = false;
-
+
foreach ($table_list as $table_name) {
//ブロックIDより削除処理。ブロックIDがなければ、処理しない
$result = $this->_db->execute("DESCRIBE ".$table_name." block_id");
@@ -658,28 +658,35 @@ function delFuncExec($block_id, $block_obj = null, $delete_action = null)
//削除関数呼び出し
//
$pathList = explode("_", $delete_action);
- $ucPathList = array_map('ucfirst', $pathList);
-
- $basename = ucfirst($pathList[count($pathList) - 1]);
-
- $actionPath = join("/", $pathList);
- $className = join("_", $ucPathList);
- $filename = MODULE_DIR . "/${actionPath}/${basename}.class.php";
- if (@file_exists($filename)) {
+ $ucPathList = array_map('ucfirst', $pathList);
+
+ $basename = ucfirst($pathList[count($pathList) - 1]);
+
+ $actionPath = join("/", $pathList);
+ $className = join("_", $ucPathList);
+ $filename = MODULE_DIR . "/${actionPath}/${basename}.class.php";
+ if (@file_exists($filename)) {
//$params = array("action" =>$delete_action, "block_id" =>$block_id, "page_id" =>$block_obj['page_id'], "table_name" =>$table_list);
$pagesView =& $this->_container->getComponent("pagesView");
$page = $pagesView->getPageById($block_obj['page_id']);
- if($page === false) {
- return false;
- }
-
- $params = array("action" =>$delete_action, "mode"=>"block_delete", "block_id" =>$block_id, "page_id" =>$block_obj['page_id'], "room_id" =>$page['room_id']);
+ if($page === false) {
+ return false;
+ }
+
+ $params = array(
+ 'action' => $delete_action,
+ 'mode' => 'block_delete',
+ 'block_id' => $block_id,
+ 'page_id' => $block_obj['page_id'],
+ 'room_id' => $page['room_id'],
+ 'module_id' => $block_obj['module_id']
+ );
$result = $this->preexecuteMain->preExecute($delete_action, $params);
if($result === false || $result === "false") {
//エラーが発生した場合、エラーリストに追加
$this->_db->addError("delFuncExec", sprintf(_INVALID_ACTION, $delete_action));
}
- }
+ }
}
}
}
diff --git a/html/webapp/components/database/Sqlutility.class.php b/html/webapp/components/database/Sqlutility.class.php
index 86fe653..6225b81 100644
--- a/html/webapp/components/database/Sqlutility.class.php
+++ b/html/webapp/components/database/Sqlutility.class.php
@@ -20,194 +20,193 @@ class Database_Sqlutility
* @access private
*/
var $_container = null;
-
+
/**
* コンストラクター
*
- * @access public
+ * @access public
*/
function Database_Sqlutility() {
$this->_container =& DIContainerFactory::getContainer();
$this->_db =& $this->_container->getComponent("DbObject");
}
-
+
/**
- * モジュールDirからテーブルリスト取得
+ * モジュール使用テーブル名データを取得する。
*
- * @param string $dirname モジュールのディレクリ名称
- * @return array テーブル名称の配列
- * @access public
+ * @param string $dirname モジュールのディレクリ名称
+ * @param boolean $needPrefix テーブル名のプレフィックス有無
+ * @return array テーブル名の配列
+ * @access public
*/
- function &getTableList($dirname, $prefix_flag = true)
+ function &getTableList($directory, $needPrefix = true)
{
- $table_list = false;
- $configView =& $this->_container->getComponent("configView");
- $config_obj = $configView->getConfigByConfname(_SYS_CONF_MODID, "db_kind"); //conf_name=db_kind(mysql等がvalueに入る)
- if($config_obj) {
- $db_kind = $config_obj["conf_value"];
- } else {
- $db_kind = _DEFAULT_SQL_KIND;
+ $tableNames = array();
+ $databaseDriver = _DEFAULT_SQL_KIND;
+
+ $configView =& $this->_container->getComponent('configView');
+ $config = $configView->getConfigByConfname(_SYS_CONF_MODID, 'db_kind');
+ if (!empty($config)) {
+ $databaseDriver = $config['conf_value'];
}
- $file_path = "/".$dirname."/sql/".$db_kind."/"._SYS_TABLE_INI;
- if (@file_exists(MODULE_DIR.$file_path) && filesize(MODULE_DIR.$file_path) != 0) {
- //モジュールに使用するテーブルあり
- // SQLファイルの読み込み
- $handle = fopen(MODULE_DIR.$file_path, 'r');
- $sql_query = fread($handle, filesize(MODULE_DIR.$file_path));
- fclose($handle);
- $sql_query = trim($sql_query);
- // SQLユーティリティクラスにて各クエリを配列に格納する
- $this->splitMySqlFile($pieces, $sql_query);
-
- //$created_tables = array();
- $table_list = array();
- foreach ($pieces as $piece) {
- // SQLユーティリティクラスにてテーブル名にプレフィックスをつける
- // 配列としてリターンされ、
- // [0] プレフィックスをつけたクエリ
- // [4] プレフィックスをつけないテーブル名
- // が格納されている
- $prefixed_query = $this->prefixQuery($piece, $this->_db->getPrefix());
- if ( !$prefixed_query ) {
- //エラー
- $table_list = false;
- break;
- }
-
- //既にTABLEが存在しなければ、次へ
- //if(in_array($this->_db->getPrefix().$prefixed_query[4],$created_tables)) {
- // continue;
- //}
- if($prefix_flag) {
- $table_list[] = $this->_db->getPrefix().$prefixed_query[4];
- } else {
- $table_list[] = $prefixed_query[4];
- }
+
+ $sqlFilePathName = MODULE_DIR . '/' . $directory . '/sql/' . $databaseDriver . '/' . _SYS_TABLE_INI;
+ if (!file_exists($sqlFilePathName)) {
+ return $tableNames;
+ }
+
+ $sqlFileSize = filesize($sqlFilePathName);
+ if (empty($sqlFileSize)) {
+ return $tableNames;
+ }
+
+ $handle = fopen($sqlFilePathName, 'r');
+ $sqlContent = fread($handle, $sqlFileSize);
+ fclose($handle);
+
+ $this->splitMySqlFile($sqls, $sqlContent);
+ $tablePrefix = $this->_db->getPrefix();
+ foreach ($sqls as $sql) {
+ $dividedSqls = $this->prefixQuery($sql, $tablePrefix);
+ if (!$dividedSqls) {
+ return $dividedSqls;
+ }
+
+ $tableName = $dividedSqls[4];
+ if ($needPrefix) {
+ $tableName = $tablePrefix . $tableName;
+ }
+
+ if (in_array($tableName, $tableNames)) {
+ continue;
}
+
+ $tableNames[] = $tableName;
}
- return $table_list;
+
+ return $tableNames;
}
-
+
/**
- * 各クエリを配列に格納
- * TODO:今後、自作、メソッドに入れ替え予定
- *
- * @param array the splitted sql commands
- * @param string the sql commands
- * @return boolean always true
- * @access public
- */
+ * 各クエリを配列に格納
+ * TODO:今後、自作、メソッドに入れ替え予定
+ *
+ * @param array the splitted sql commands
+ * @param string the sql commands
+ * @return boolean always true
+ * @access public
+ */
function splitMySqlFile(&$ret, $sql)
{
- $sql = trim($sql);
- $sql_len = strlen($sql);
- $char = '';
- $string_start = '';
- $in_string = false;
-
- for ($i = 0; $i < $sql_len; ++$i) {
- $char = $sql[$i];
-
- // We are in a string, check for not escaped end of
- // strings except for backquotes that can't be escaped
- if ($in_string) {
- for (;;) {
- $i = strpos($sql, $string_start, $i);
+ $sql = trim($sql);
+ $sql_len = strlen($sql);
+ $char = '';
+ $string_start = '';
+ $in_string = false;
+
+ for ($i = 0; $i < $sql_len; ++$i) {
+ $char = $sql[$i];
+
+ // We are in a string, check for not escaped end of
+ // strings except for backquotes that can't be escaped
+ if ($in_string) {
+ for (;;) {
+ $i = strpos($sql, $string_start, $i);
// No end of string found -> add the current
// substring to the returned array
- if (!$i) {
+ if (!$i) {
$ret[] = $sql;
- return true;
- }
- // Backquotes or no backslashes before
- // quotes: it's indeed the end of the
+ return true;
+ }
+ // Backquotes or no backslashes before
+ // quotes: it's indeed the end of the
// string -> exit the loop
- else if ($string_start == '`' || $sql[$i-1] != '\\') {
- $string_start = '';
- $in_string = false;
- break;
- }
- // one or more Backslashes before the presumed
+ else if ($string_start == '`' || $sql[$i-1] != '\\') {
+ $string_start = '';
+ $in_string = false;
+ break;
+ }
+ // one or more Backslashes before the presumed
// end of string...
- else {
+ else {
// first checks for escaped backslashes
- $j = 2;
- $escaped_backslash = false;
+ $j = 2;
+ $escaped_backslash = false;
while ($i-$j > 0 && $sql[$i-$j] == '\\') {
$escaped_backslash = !$escaped_backslash;
- $j++;
- }
- // ... if escaped backslashes: it's really the
+ $j++;
+ }
+ // ... if escaped backslashes: it's really the
// end of the string -> exit the loop
- if ($escaped_backslash) {
- $string_start = '';
- $in_string = false;
+ if ($escaped_backslash) {
+ $string_start = '';
+ $in_string = false;
break;
- }
- // ... else loop
- else {
+ }
+ // ... else loop
+ else {
$i++;
- }
- } // end if...elseif...else
- } // end for
- } // end if (in string)
- // We are not in a string, first check for delimiter...
- else if ($char == ';') {
+ }
+ } // end if...elseif...else
+ } // end for
+ } // end if (in string)
+ // We are not in a string, first check for delimiter...
+ else if ($char == ';') {
// if delimiter found, add the parsed part to the returned array
- $ret[] = substr($sql, 0, $i);
- $sql = ltrim(substr($sql, min($i + 1, $sql_len)));
- $sql_len = strlen($sql);
- if ($sql_len) {
- $i = -1;
- } else {
- // The submited statement(s) end(s) here
- return true;
+ $ret[] = substr($sql, 0, $i);
+ $sql = ltrim(substr($sql, min($i + 1, $sql_len)));
+ $sql_len = strlen($sql);
+ if ($sql_len) {
+ $i = -1;
+ } else {
+ // The submited statement(s) end(s) here
+ return true;
}
- } // end else if (is delimiter)
- // ... then check for start of a string,...
- else if (($char == '"') || ($char == '\'') || ($char == '`')) {
- $in_string = true;
+ } // end else if (is delimiter)
+ // ... then check for start of a string,...
+ else if (($char == '"') || ($char == '\'') || ($char == '`')) {
+ $in_string = true;
$string_start = $char;
- } // end else if (is start of string)
-
- // for start of a comment (and remove this comment if found)...
- else if ($char == '#' || ($char == ' ' && $i > 1 && $sql[$i-2] . $sql[$i-1] == '--')) {
- // starting position of the comment depends on the comment type
- $start_of_comment = (($sql[$i] == '#') ? $i : $i-2);
- // if no "\n" exits in the remaining string, checks for "\r"
- // (Mac eol style)
- $end_of_comment = (strpos(' ' . $sql, "\012", $i+2))
- ? strpos(' ' . $sql, "\012", $i+2)
- : strpos(' ' . $sql, "\015", $i+2);
- if (!$end_of_comment) {
- // no eol found after '#', add the parsed part to the returned
- // array and exit
+ } // end else if (is start of string)
+
+ // for start of a comment (and remove this comment if found)...
+ else if ($char == '#' || ($char == ' ' && $i > 1 && $sql[$i-2] . $sql[$i-1] == '--')) {
+ // starting position of the comment depends on the comment type
+ $start_of_comment = (($sql[$i] == '#') ? $i : $i-2);
+ // if no "\n" exits in the remaining string, checks for "\r"
+ // (Mac eol style)
+ $end_of_comment = (strpos(' ' . $sql, "\012", $i+2))
+ ? strpos(' ' . $sql, "\012", $i+2)
+ : strpos(' ' . $sql, "\015", $i+2);
+ if (!$end_of_comment) {
+ // no eol found after '#', add the parsed part to the returned
+ // array and exit
// RMV fix for comments at end of file
- $last = trim(substr($sql, 0, $i-1));
+ $last = trim(substr($sql, 0, $i-1));
if (!empty($last)) {
$ret[] = $last;
}
- return true;
+ return true;
} else {
- $sql = substr($sql, 0, $start_of_comment) . ltrim(substr($sql, $end_of_comment));
- $sql_len = strlen($sql);
- $i--;
- } // end if...else
- } // end else if (is comment)
- } // end for
-
- // add any rest to the returned array
- if (!empty($sql) && trim($sql) != '') {
+ $sql = substr($sql, 0, $start_of_comment) . ltrim(substr($sql, $end_of_comment));
+ $sql_len = strlen($sql);
+ $i--;
+ } // end if...else
+ } // end else if (is comment)
+ } // end for
+
+ // add any rest to the returned array
+ if (!empty($sql) && trim($sql) != '') {
$ret[] = $sql;
- }
- return true;
+ }
+ return true;
}
/**
* add a prefix.'_' to all tablenames in a query
* TODO:今後、自作、メソッドに入れ替え予定
- * @param string $query valid SQL query string
- * @param string $prefix prefix to add to all table names
+ * @param string $query valid SQL query string
+ * @param string $prefix prefix to add to all table names
* @return mixed FALSE on failure
*/
function prefixQuery($query, $prefix)
diff --git a/html/webapp/components/pages/Action.class.php b/html/webapp/components/pages/Action.class.php
index b4d3535..b55bb0e 100644
--- a/html/webapp/components/pages/Action.class.php
+++ b/html/webapp/components/pages/Action.class.php
@@ -440,77 +440,99 @@ function updThreadNum($parent_id, $thread_num)
/**
* 削除関数呼び出し
- * @param int $room_id 削除対象room_id
- * @param array $modules 削除対象モジュール配列
- * @param string delete_action
+ * @param mix $roomId 削除対象ルームID
+ * @param array $module 削除対象モジュール配列
+ * @param string $deleteAction 削除アクション名称
* @return boolean true or false
- * @access public
+ * @access public
*/
- function delFuncExec($room_id, &$module, $delete_action = null)
+ function delFuncExec($roomId, $module, $deleteAction = null)
{
- if($delete_action == "auto") {
- $action_name = $module['action_name'];
- $pathList = explode("_", $action_name);
+ if (empty($roomId)) {
+ return true;
+ }
+
+ if (!strlen($deleteAction)) {
+ return true;
+ }
+
+ $roomIds = $roomId;
+ if (!is_array($roomId)) {
+ $roomIds = array($roomId);
+ }
+
+ if ($deleteAction == 'auto') {
+ $inValue = '';
+ foreach ($roomIds as $roomId) {
+ $inValue .= intval($roomId) . ',';
+ }
+ $inValue = substr($inValue, 0, -1);
+
+ $actionName = $module['action_name'];
+ $pathList = explode('_', $actionName);
$dirname = $pathList[0];
- //テーブルリスト取得
- $table_list = $this->databaseSqlutility->getTableList($dirname);
- if(!is_array($table_list)) {
- // 配列でなければエラーとする
+ // 使用しているテーブル名配列を取得
+ $tables = $this->databaseSqlutility->getTableList($dirname);
+ if (!is_array($tables)) {
return false;
}
- //自動的に削除
- $where_params = array(
- "room_id" => $room_id
- );
- $error = false;
-
- foreach ($table_list as $table_name) {
- //ルームIDより削除処理。ルームIDがなければ、処理しない
- $result = $this->_db->execute("DESCRIBE ".$table_name." room_id");
- if(is_array($result) && isset($result[0])) {
- $result = $this->_db->execute("DELETE FROM ".$table_name." WHERE room_id=?" .
- " ",$where_params);
- if(!$result) {
- $error = true;
- }
+ $isError = false;
+ foreach ($tables as $table) {
+ $sql = "DESCRIBE " . $table . " room_id";
+ $result = $this->_db->execute($sql);
+ if ($result === false) {
+ $isError = true;
+ }
+
+ if (count($result) == 0) {
+ continue;
+ }
+
+ $sql = "DELETE FROM " . $table . " "
+ . "WHERE room_id IN (" . $inValue . ")";
+ if (!$this->_db->execute($sql)) {
+ $this->_db->addError();
+ $isError = true;
}
}
- if($error) return false;
- } elseif($delete_action == "" || $delete_action === null) {
- //なにもしない
} else {
- //
- //削除関数呼び出し
- //
- $pathList = explode("_", $delete_action);
- $ucPathList = array_map('ucfirst', $pathList);
-
- $basename = ucfirst($pathList[count($pathList) - 1]);
-
- $actionPath = join("/", $pathList);
- $className = join("_", $ucPathList);
- $filename = MODULE_DIR . "/${actionPath}/${basename}.class.php";
- if (@file_exists($filename)) {
- $pagesView =& $this->_container->getComponent("pagesView");
- $page =& $pagesView->getPageById($room_id);
- if($page === false || !isset($page['page_id'])) {
- return false;
+ $pathList = explode('_', $deleteAction);
+ $ucPathList = array_map('ucfirst', $pathList);
+ $basename = ucfirst($pathList[count($pathList) - 1]);
+
+ $actionPath = join('/', $pathList);
+ $className = join('_', $ucPathList);
+ $filename = MODULE_DIR . "/${actionPath}/${basename}.class.php";
+ if (!file_exists($filename)) {
+ return false;
+ }
+
+ $isError = false;
+ $pagesView =& $this->_container->getComponent('pagesView');
+ foreach ($roomIds as $roomId) {
+ $page =& $pagesView->getPageById($roomId);
+ if (empty($page)) {
+ $isError = true;
}
- //ブロック削除アクション
$params = array(
- 'action' => $delete_action,
- 'mode' => "delete",
- 'page_id'=> $page['page_id'],
- 'room_id'=> $room_id
- );
- $result = $this->preexecuteMain->preExecute($delete_action, $params);
- if($result === false || $result === "false") {
- return false;
+ 'action' => $deleteAction,
+ 'mode' => 'delete',
+ 'page_id'=> $page['page_id'],
+ 'room_id'=> $roomId
+ );
+ $result = $this->preexecuteMain->preExecute($deleteAction, $params);
+ if ($result === false
+ || $result === "false") {
+ $isError = true;
}
- }
+ }
+ }
+
+ if ($isError) {
+ return false;
}
return true;
}
@@ -687,5 +709,284 @@ function &_fetchcallbackGetChildPages($result, $page) {
}
return $ret;
}
+
+ /**
+ * サブグループも含めたルームデータを削除する
+ *
+ * @param string $roomId ページID
+ * @return boolean true or false
+ * @access public
+ */
+ function deleteRoom($roomId)
+ {
+ $roomId = intval($roomId);
+
+ $sql = "SELECT page_id "
+ . "FROM {pages} "
+ . "WHERE parent_id = ? "
+ . "AND page_id = room_id";
+ $subRooms =& $this->_db->execute($sql, $roomId);
+ if ($subRooms === false) {
+ $this->_db->addError();
+ return false;
+ }
+
+ foreach ($subRooms as $subRoom) {
+ $pageId = $subRoom['page_id'];
+ if (!$this->deleteRoom($pageId)) {
+ return false;
+ }
+ }
+
+ if (!$this->deleteLowestRoom($roomId)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * サブグループがないルームデータを削除する
+ *
+ * @param string $roomId ルームID
+ * @return boolean true or false
+ * @access public
+ */
+ function deleteLowestRoom($roomId)
+ {
+ $pagesView =& $this->_container->getComponent('pagesView');
+ $modules =& $pagesView->getUsableModulesByRoom($roomId);
+ if ($modules === false) {
+ return false;
+ }
+
+ if (!$this->deleteEachModule($roomId, $modules)) {
+ return false;
+ }
+
+ if (!$this->deleteRoomModule($roomId, null)) {
+ return false;
+ }
+
+ $columnValues = array(
+ 'room_id' => $roomId
+ );
+ if (!$this->_db->deleteExecute('pages_users_link', $columnValues)) {
+ return false;
+ }
+
+ $inValue = '';
+ $sql = "SELECT page_id, "
+ . "room_id, "
+ . "parent_id, "
+ . "display_sequence, "
+ . "lang_dirname, "
+ . "private_flag "
+ . "FROM {pages} "
+ . "WHERE room_id = ?";
+ $pages =& $this->_db->execute($sql, $roomId);
+ if ($pages === false) {
+ $this->_db->addError();
+ return false;
+ }
+ foreach ($pages as $page) {
+ $inValue .= $page['page_id'] . ',';
+
+ if ($page['page_id'] == $page['room_id']) {
+ $parentId = $page['parent_id'];
+ $sequence = $page['display_sequence'];
+ $language = $page['lang_dirname'];
+ $isPrivate = $page['private_flag'];
+ }
+ }
+
+ if (empty($inValue)) {
+ return false;
+ }
+ $inValue = substr($inValue, 0, -1);
+ if (!$this->deletePagesByInOperator($inValue)) {
+ return false;
+ }
+
+ if (!empty($parentId)
+ && !$this->decrementDisplaySeq($parentId, $sequence, $language)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * 各モジュール削除処理を呼出す。
+ *
+ * @param mix $roomId ルームID
+ * @param array $modules モジュールデータ配列
+ * @return boolean true or false
+ * @access public
+ */
+ function deleteEachModule($roomId, $modules)
+ {
+ foreach ($modules as $module) {
+ $actionName = $module['delete_action'];
+ if (!strlen($actionName)) {
+ continue;
+ }
+
+ if (!$this->delFuncExec($roomId, $module, $actionName)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * ルームモジュールデータを削除する。
+ *
+ * @param string $roomId ルームID
+ * @param array $moduleIds モジュールID配列
+ * @return boolean true or false
+ * @access public
+ */
+ function deleteRoomModule($roomId, $moduleIds)
+ {
+ if (isset($roomId)
+ && is_array($moduleIds)
+ && empty($moduleIds)) {
+ return true;
+ }
+
+ $whereClause = '';
+ $bindValues = array();
+ if (!empty($roomId)) {
+ $whereClause .= "room_id = ? ";
+ $bindValues = array(
+ $roomId
+ );
+ }
+ if (!empty($roomId)
+ && !empty($moduleIds)) {
+ $whereClause .= "AND ";
+ }
+ if (!empty($moduleIds)) {
+ $whereClause .= "module_id IN ('" . implode("','", $moduleIds) . "')";
+ }
+
+ $sql = "DELETE FROM {pages_modules_link} "
+ . "WHERE " . $whereClause;
+ if (!$this->_db->execute($sql, $bindValues)) {
+ $this->_db->addError();
+ return false;
+ }
+
+ $uploadsAction =& $this->_container->getComponent('uploadsAction');
+ if (!$uploadsAction->deleteByWhereClause($whereClause, $bindValues)) {
+ return false;
+ }
+
+ $whatsnewAction =& $this->_container->getComponent('whatsnewAction');
+ if (!$whatsnewAction->deleteByWhereClause($whereClause, $bindValues)) {
+ return false;
+ }
+
+ $abbreviateurlAction =& $this->_container->getComponent('abbreviateurlAction');
+ if (!$abbreviateurlAction->deleteByWhereClause($whereClause, $bindValues)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * IN演算子でページデータ、および、ページIDに関係するデータを削除する
+ *
+ * @param string $inValue IN演算子の値(カンマ区切り)
+ * @return boolean true or false
+ * @access public
+ */
+ function deletePagesByInOperator($inValue)
+ {
+ if (empty($inValue)) {
+ return true;
+ }
+
+ $sql = "SELECT B.block_id, "
+ . "B.page_id, "
+ . "B.module_id, "
+ . "B.action_name, "
+ . "M.block_delete_action "
+ . "FROM {blocks} B "
+ . "LEFT JOIN {modules} M "
+ . "ON B.module_id = M.module_id "
+ . "WHERE B.page_id IN (" . $inValue . ")";
+ $blocks =& $this->_db->execute($sql);
+ if ($blocks === false) {
+ $this->_db->addError();
+ return false;
+ }
+
+ $blocksAction =& $this->_container->getComponent('blocksAction');
+ foreach ($blocks as $block) {
+ $blockId = $block['block_id'];
+ $actionName = $block['block_delete_action'];
+ if (!strlen($actionName)) {
+ continue;
+ }
+
+ if (!$blocksAction->delFuncExec($blockId, $block, $actionName)) {
+ return false;
+ }
+ }
+
+ if (!$this->deleteByInOperator('blocks', $inValue)) {
+ return false;
+ }
+
+ if (!$this->deleteByInOperator('menu_detail', $inValue)) {
+ return false;
+ }
+
+ if (!$this->deleteByInOperator('mobile_menu_detail', $inValue)) {
+ return false;
+ }
+
+ if (!$this->deleteByInOperator('pages_meta_inf', $inValue)) {
+ return false;
+ }
+
+ if (!$this->deleteByInOperator('pages_style', $inValue, 'set_page_id')) {
+ return false;
+ }
+
+ if (!$this->deleteByInOperator('pages', $inValue)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * IN演算子でデータを削除する。
+ *
+ * @param string $tableName 対象テーブル名称
+ * @param string $inValue IN演算子の値(カンマ区切り文字列)
+ * @return boolean true or false
+ * @access public
+ */
+ function deleteByInOperator($tableName, $inValue, $columnName = 'page_id')
+ {
+ if (empty($inValue)) {
+ return true;
+ }
+
+ $sql = "DELETE FROM {" . $tableName . "} "
+ . "WHERE " . $columnName . " IN (" . $inValue . ")";
+ if (!$this->_db->execute($sql)) {
+ $this->_db->addError();
+ return false;
+ }
+
+ return true;
+ }
}
?>
diff --git a/html/webapp/components/pages/View.class.php b/html/webapp/components/pages/View.class.php
index 62f3b82..bab3b6c 100644
--- a/html/webapp/components/pages/View.class.php
+++ b/html/webapp/components/pages/View.class.php
@@ -598,5 +598,52 @@ function getGroupWhereStatement()
return $whereStatement;
}
+
+ /**
+ * ルームで使用可能なモジュールデータ配列を取得する
+ *
+ * @param string $roomId ルームID
+ * @return array ルームで使用可能なモジュールデータ配列
+ * @access public
+ */
+ function &getUsableModulesByRoom($roomId, $useIdAsKey = false)
+ {
+ $fetchFunction = null;
+ if ($useIdAsKey) {
+ $fetchFunction = array($this, '_fetchModule');
+ }
+
+ $sql = "SELECT M.module_id, "
+ . "M.action_name, "
+ . "M.delete_action "
+ . "FROM {modules} M "
+ . "INNER JOIN {pages_modules_link} PM "
+ . "ON M.module_id = PM.module_id "
+ . "WHERE PM.room_id = ?";
+ $modules =& $this->_db->execute($sql, $roomId, null, null, true, $fetchFunction);
+ if ($modules === false) {
+ $this->_db->addError();
+ }
+
+ return $modules;
+ }
+
+ /**
+ * モジュールIDをキーとしたモジュールデータ配列を作成する。
+ *
+ * @param object $recordSet モジュールデータADORecordSetオブジェクト
+ * @return string 指定文字区切りの文字列
+ * @access private
+ */
+ function &_fetchModule(&$recordSet)
+ {
+ $modules = array();
+ while ($module = $recordSet->fetchRow()) {
+ $moduleId = $module['module_id'];
+ $modules[$moduleId] = $module;
+ }
+
+ return $modules;
+ }
}
?>
diff --git a/html/webapp/components/uploads/Action.class.php b/html/webapp/components/uploads/Action.class.php
index 1c341c8..fce1a68 100644
--- a/html/webapp/components/uploads/Action.class.php
+++ b/html/webapp/components/uploads/Action.class.php
@@ -355,61 +355,40 @@ function _delUploadFile($upload_id, $upload = null)
}
/**
- * module_idによるUploads削除処理
- * @param int module_id
+ * 条件に該当するアップロードデータを削除する。
+ *
+ * @param string $whereClause where句文字列
+ * @param array $bindValues バインド値配列
* @return boolean true or false
* @access public
*/
- function delUploadsByModuleid($module_id)
+ function deleteByWhereClause($whereClause, $bindValues)
{
- $where_params = array(
- "module_id" => $module_id
- );
- $uploads =& $this->_db->selectExecute("uploads", $where_params);
- if($uploads === false) {
- return false;
- }
- foreach($uploads as $upload) {
- $this->_delUploadFile($upload["upload_id"], $upload);
- }
-
- $result = $this->_db->execute("DELETE FROM {uploads} WHERE module_id=?" .
- " ",$where_params);
-
- if($result === false) {
- //エラーが発生した場合、エラーリストに追加
+ $sql = "SELECT upload_id, "
+ . "physical_file_name, "
+ . "file_path, "
+ . "extension "
+ . "FROM {uploads} "
+ . "WHERE " . $whereClause;
+ $uploads = $this->_db->execute($sql, $bindValues);
+ if ($uploads === false) {
$this->_db->addError();
return false;
}
- return true;
- }
-
-
- /**
- * room_idによるUploads削除処理
- * @param int room_id
- * @return boolean true or false
- * @access public
- */
- function delUploadsByRoomid($room_id)
- {
- $where_params = array(
- "room_id" => $room_id
- );
- $uploads =& $this->_db->selectExecute("uploads", $where_params);
- if($uploads === false) {
- return false;
- }
+ $inValue = '';
foreach($uploads as $upload) {
- $this->_delUploadFile($upload["upload_id"], $upload);
+ $this->_delUploadFile($upload['upload_id'], $upload);
+ $inValue .= $upload['upload_id'] . ',';
+ }
+ if (empty($inValue)) {
+ return true;
}
- $result = $this->_db->execute("DELETE FROM {uploads} WHERE room_id=?" .
- " ",$where_params);
-
- if($result === false) {
- //エラーが発生した場合、エラーリストに追加
+ $inValue = substr($inValue, 0, -1);
+ $sql = "DELETE FROM {uploads} "
+ . "WHERE upload_id IN (" . $inValue . ")";
+ if (!$this->_db->execute($sql)) {
$this->_db->addError();
return false;
}
diff --git a/html/webapp/components/users/Action.class.php b/html/webapp/components/users/Action.class.php
index c79d16c..f4c863a 100644
--- a/html/webapp/components/users/Action.class.php
+++ b/html/webapp/components/users/Action.class.php
@@ -65,7 +65,7 @@ function insUser($params=array()) {
// Hash値で同じものがないか念のためチェック
$result = $this->_db->selectExecute("users", array("user_id" => $user_id));
if ($result === false) {
- return false;
+ return false;
}
if(!isset($result[0]['user_id'])) {
break;
@@ -105,7 +105,7 @@ function insItem($params=array()) {
function insItemDesc($item_id, $params=array()) {
$db_params = array("item_id"=>0);
$db_params = array_merge($db_params, $params);
- $db_params["item_id"] = $item_id;
+ $db_params["item_id"] = $item_id;
return $this->_db->insertExecute("items_desc", $db_params);
}
@@ -120,7 +120,7 @@ function insItemDesc($item_id, $params=array()) {
function insItemOptions($item_id, $params=array()) {
$db_params = array("item_id"=>0);
$db_params = array_merge($db_params, $params);
- $db_params["item_id"] = $item_id;
+ $db_params["item_id"] = $item_id;
return $this->_db->insertExecute("items_options", $db_params);
}
@@ -308,8 +308,8 @@ function delUsersItemsLinkById($item_id, $user_id = null)
}
$result = $this->_db->deleteExecute("users_items_link", $params);
if ($result === false) {
- $this->_db->addError();
- return $result;
+ $this->_db->addError();
+ return $result;
}
return true;
}
@@ -328,8 +328,8 @@ function delItemDescById($item_id)
);
$result = $this->_db->deleteExecute("items_desc", $params);
if ($result === false) {
- $this->_db->addError();
- return $result;
+ $this->_db->addError();
+ return $result;
}
return true;
}
@@ -348,9 +348,164 @@ function delItemOptionsById($item_id)
);
$result = $this->_db->deleteExecute("items_options", $params);
if ($result === false) {
- $this->_db->addError();
- return $result;
+ $this->_db->addError();
+ return $result;
+ }
+ return true;
+ }
+
+ /**
+ * 会員データを削除する
+ *
+ * @param mix $roomId 削除対象ルームID
+ * @return boolean true or false
+ * @access public
+ */
+ function deleteUser($userId)
+ {
+ if (empty($userId)) {
+ return true;
+ }
+
+ $userIds = $userId;
+ if (!is_array($userId)) {
+ $userIds = array($userId);
+ }
+ $inValue = "'" . implode("','", $userIds) . "'";
+
+ $sql = "SELECT P.room_id, "
+ . "U.role_authority_id "
+ . "FROM {pages} P "
+ . "INNER JOIN {users} U "
+ . "ON P.insert_user_id = U.user_id "
+ . "WHERE P.thread_num = ? "
+ . "AND P.private_flag = ? "
+ . "AND P.space_type = ? "
+ . "AND P.insert_user_id IN (" . $inValue . ")";
+ $bindValues = array(
+ 0,
+ _ON,
+ _SPACE_TYPE_GROUP
+ );
+ $privateRoomsPerRole = $this->_db->execute($sql, $bindValues, null, null, true, array($this, '_fetchPrivateRoomPerRole'));
+
+ $roles = array_keys($privateRoomsPerRole);
+ $sql = "SELECT M.action_name, "
+ . "M.delete_action, "
+ . "AM.role_authority_id "
+ . "FROM {modules} M "
+ . "INNER JOIN {authorities_modules_link} AM "
+ . "ON M.module_id = AM.module_id "
+ . "WHERE M.system_flag = ? "
+ . "AND AM.role_authority_id IN ('" . implode("','", $roles) . "')";
+ $bindValues = array(
+ _OFF
+ );
+ $modulesPerRole =& $this->_db->execute($sql, $bindValues, null, null, true, array($this, '_fetchModulePerRole'));
+ if ($modulesPerRole === false) {
+ return false;
}
+
+ $pagesAction =& $this->_container->getComponent('pagesAction');
+ foreach ($privateRoomsPerRole as $roleId => $privateRooms) {
+ if (!$pagesAction->deleteEachModule($privateRooms, $modulesPerRole[$roleId])) {
+ return false;
+ }
+
+ foreach ($privateRooms as $roomId) {
+ if (!$pagesAction->deleteRoom($roomId)) {
+ return false;
+ }
+ }
+ }
+
+ if (!$this->deleteByInOperator('users', $inValue)) {
+ return false;
+ }
+
+ if (!$this->deleteByInOperator('users_items_link', $inValue)) {
+ return false;
+ }
+
+ if (!$this->deleteByInOperator('pages_users_link', $inValue)) {
+ return false;
+ }
+
+ $sql = "UPDATE {uploads} "
+ . "SET "
+ . "garbage_flag = ? "
+ . "WHERE action_name = ? "
+ . "AND unique_id IN (" . $inValue . ") "
+ . "AND garbage_flag = ?";
+ $bindValues = array(
+ _ON,
+ 'common_download_user',
+ _OFF
+ );
+ if (!$this->_db->execute($sql, $bindValues)) {
+ $this->_db->addError();
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * ロール毎のプライベートスペースデータ配列を作成する。
+ *
+ * @param object $recordSet プライベートスペースデータADORecordSet
+ * @return array モジュールデータ配列
+ * @access public
+ */
+ function _fetchPrivateRoomPerRole($recordSet)
+ {
+ $privateRoomsPerRole = array();
+ while ($privateRoom = $recordSet->fetchRow()) {
+ $roleId = $privateRoom['role_authority_id'];
+ $privateRoomsPerRole[$roleId][] = $privateRoom['room_id'];
+ }
+
+ return $privateRoomsPerRole;
+ }
+
+ /**
+ * ロール毎にモジュールデータ配列を作成する
+ *
+ * @param array $recordSet タスクADORecordSet
+ * @return array モジュールデータ配列
+ * @access private
+ */
+ function _fetchModulePerRole($recordSet) {
+ $modulesPerRole = array();
+ while ($module = $recordSet->fetchRow()) {
+ $roleId = $module['role_authority_id'];
+ $modulesPerRole[$roleId][] = $module;
+ }
+
+ return $modulesPerRole;
+ }
+
+ /**
+ * IN演算子でデータを削除する。
+ *
+ * @param string $tableName 対象テーブル名称
+ * @param string $inValue IN演算子の値(カンマ区切り文字列)
+ * @return boolean true or false
+ * @access public
+ */
+ function deleteByInOperator($tableName, $inValue)
+ {
+ if (empty($inValue)) {
+ return true;
+ }
+
+ $sql = "DELETE FROM {" . $tableName . "} "
+ . "WHERE user_id IN (" . $inValue . ")";
+ if (!$this->_db->execute($sql)) {
+ $this->_db->addError();
+ return false;
+ }
+
return true;
}
}
diff --git a/html/webapp/components/users/View.class.php b/html/webapp/components/users/View.class.php
index a1a68a1..76e19af 100644
--- a/html/webapp/components/users/View.class.php
+++ b/html/webapp/components/users/View.class.php
@@ -927,7 +927,7 @@ function &createSearchWhereString() {
$othersSearchAuthority = false;
$actionName = $actionChain->getCurActionName();
- if ($session->getParameter('_auth_id') == _AUTH_ADMIN
+ if ($session->getParameter('_user_auth_id') == _AUTH_ADMIN
|| $actionName == 'room_action_admin_search') {
$othersSearchAuthority = true;
}
@@ -1049,10 +1049,10 @@ function &_fetchRoomUser($result, $func_params)
$absence_users = array(); //不参加会員
$absence_rooms = array(); //不参加会員がいるルームID配列
while ($row = $result->fetchRow()) {
- if($row['role_authority_id'] == _ROLE_AUTH_OTHER) {
+ if ($row['role_authority_id'] == _ROLE_AUTH_OTHER) {
//不参加会員
$absence_users[$row['user_id']] = $row['user_id'];
- $absence_rooms[$row['room_id']] = $row['room_id'];
+ $absence_rooms[$row['room_id']][] = $row['user_id'];
} else {
$presence_users[$row['user_id']] = $row['user_id'];
}
@@ -1061,16 +1061,22 @@ function &_fetchRoomUser($result, $func_params)
return $presence_users;
}
- // 不参加会員が誰もいないデフォルト参加ルームがある場合は全ての会員から検索する
- foreach($default_entry_room_arr as $room_id) {
- if(!isset($absence_rooms[$room_id])) {
+ $noParticipationRoomUsers = array();
+ foreach ($default_entry_room_arr as $room_id) {
+ // 不参加会員が誰もいないデフォルト参加ルームがある場合は全ての会員から検索する
+ if (!isset($absence_rooms[$room_id])) {
$absence_users = array();
return $absence_users;
}
+
+ if (empty($noParticipationRoomUsers)) {
+ $noParticipationRoomUsers = $absence_rooms[$room_id];
+ }
+ $noParticipationRoomUsers = array_intersect($noParticipationRoomUsers, $absence_rooms[$room_id]);
}
// 参加会員配列にいない不参加会員を取得
- $absence_users = array_diff($absence_users, $presence_users);
+ $absence_users = array_diff($noParticipationRoomUsers, $presence_users);
// 不参加者を返す
return $absence_users;
diff --git a/html/webapp/components/whatsnew/Action.class.php b/html/webapp/components/whatsnew/Action.class.php
index c1aad0f..2e80964 100644
--- a/html/webapp/components/whatsnew/Action.class.php
+++ b/html/webapp/components/whatsnew/Action.class.php
@@ -416,7 +416,7 @@ function _deleteUser(&$recordSet)
*/
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');
@@ -499,13 +499,14 @@ function _deletePeriod($moduleId, $roomIds)
}
/**
- * ルームIDで新着データを削除する
- *
- * @param string $roomId ルームID
+ * 条件に該当する新着データを削除する。
+ *
+ * @param string $whereClause where句文字列
+ * @param array $bindValues バインド値配列
* @return boolean true or false
- * @access public
+ * @access public
*/
- function deleteByRoomId($roomId)
+ function deleteByWhereClause($whereClause, $bindValues)
{
$module =& $this->_modulesView->getModuleByDirname('whatsnew');
if (!$module) {
@@ -514,9 +515,9 @@ function deleteByRoomId($roomId)
$sql = "SELECT whatsnew_id "
. "FROM {whatsnew} "
- . "WHERE room_id = ? ";
- $inValue = $this->_db->execute($sql, $roomId, null, null, false, array($this, '_createDelimitedString'));
- if ($inValue == false) {
+ . "WHERE " . $whereClause;
+ $inValue = $this->_db->execute($sql, $bindValues, null, null, false, array($this, '_createDelimitedString'));
+ if ($inValue === false) {
$this->_db->addError();
return false;
}
@@ -524,13 +525,11 @@ function deleteByRoomId($roomId)
if (!$this->_deleteByInOperator('whatsnew_user', $inValue)) {
return false;
}
-
- $sql = "DELETE FROM {whatsnew} "
- . "WHERE room_id = ? ";
- if (!$this->_db->execute($sql, $roomId)) {
- $this->_db->addError();
+ if (!$this->_deleteByInOperator('whatsnew', $inValue)) {
return false;
}
+
+ return true;
}
/**
@@ -541,13 +540,14 @@ function deleteByRoomId($roomId)
* @return string 指定文字区切りの文字列
* @access private
*/
- function &_createDelimitedIdString(&$recordSet, $glue = ',')
+ function &_createDelimitedString(&$recordSet, $glue = ',')
{
$string = '';
while ($whatsnew = $recordSet->fetchRow()) {
$string .= $whatsnew[0]. $glue;
}
- if (!strlen($glue)) {
+ if (strlen($string)
+ && strlen($glue)) {
$string = substr($string, 0, strlen($glue) * -1);
}
diff --git a/html/webapp/modules/backup/action/main/init/Init.class.php b/html/webapp/modules/backup/action/main/init/Init.class.php
index e058ba5..73008ff 100644
--- a/html/webapp/modules/backup/action/main/init/Init.class.php
+++ b/html/webapp/modules/backup/action/main/init/Init.class.php
@@ -879,7 +879,6 @@ function _createDumpXML($page_id, $child_flag = false)
$pathList = explode("_",$module['action_name']);
$dirname =$pathList[0];
$tableList = $this->databaseSqlutility->getTableList($dirname, false);
- if($tableList === false) continue;
foreach($tableList as $table) {
$metaColumns = $adodb->MetaColumns($this->db->getPrefix().$table);
if(isset($metaColumns["ROOM_ID"])) {
diff --git a/html/webapp/modules/menu/action/edit/deletepage/Deletepage.class.php b/html/webapp/modules/menu/action/edit/deletepage/Deletepage.class.php
index 0f09773..0ae6b7a 100644
--- a/html/webapp/modules/menu/action/edit/deletepage/Deletepage.class.php
+++ b/html/webapp/modules/menu/action/edit/deletepage/Deletepage.class.php
@@ -14,31 +14,27 @@
*/
class Menu_Action_Edit_Deletepage extends Action
{
- // リクエストパラメータを受け取るため
- var $main_page_id = null;
- var $block_id = null;
-
- // 使用コンポーネントを受け取るため
- var $session = null;
- var $pagesView = null;
- var $pagesAction = null;
- var $blocksAction = null;
- var $menuAction = null;
- var $blocksView = null;
-
- // 値をセットするため
- var $url = null;
-
- var $del_page_arr = array();
-
- /**
- * ページ追加アクション
- *
- * @access public
- */
- function execute()
- {
- $page_id = intval($this->main_page_id);
+ // リクエストパラメータを受け取るため
+ var $main_page_id = null;
+ var $block_id = null;
+
+ // 使用コンポーネントを受け取るため
+ var $session = null;
+ var $pagesView = null;
+ var $pagesAction = null;
+ var $db = null;
+
+ // 値をセットするため
+ var $url = null;
+
+ /**
+ * ページ追加アクション
+ *
+ * @access public
+ */
+ function execute()
+ {
+ $page_id = intval($this->main_page_id);
$page =& $this->pagesView->getPageById($page_id);
if($page === false || !isset($page['page_id'])) {
return 'error';
@@ -47,53 +43,39 @@ function execute()
//深さが0 または、ルーム
return 'error';
}
- //ページ削除
- if(!$this->pagesAction->delPageById($page_id)) {
- return 'error';
- }
- //ページスタイル削除
- if(!$this->pagesAction->delPageStyleById($page_id)) {
- return 'error';
- }
-
- //pages_meta_infテーブル削除
- if(!$this->pagesAction->delPageMetaInfById($page_id)) {
- return 'error';
- }
-
- //表示順decrement
- if(!$this->pagesAction->decrementDisplaySeq($page['parent_id'], $page['display_sequence'], $page['lang_dirname'])) {
- return 'error';
+
+ $pageIds = array($page_id);
+ $hasChildPageIds = array();
+ if ($page['node_flag']) {
+ $hasChildPageIds = $pageIds;
}
- //削除関数を呼び出し
- $blocks =& $this->blocksView->getBlockByPageId($page_id);
- if(isset($blocks[0])) {
- foreach($blocks as $block) {
- $this->blocksAction->delFuncExec($block['block_id']);
+
+ while (!empty($hasChildPageIds)) {
+ $sql = "SELECT page_id, "
+ . "node_flag "
+ . "FROM {pages} "
+ . "WHERE parent_id IN (" . implode(',', $hasChildPageIds) . ")";
+ $childPages = $this->db->execute($sql);
+ if ($childPages === false) {
+ $this->db->addError();
+ return 'error';
+ }
+
+ $hasChildPageIds = array();
+ foreach ($childPages as $childPage) {
+ if ($childPage['node_flag']) {
+ $hasChildPageIds[] = $childPage['page_id'];
+ }
+ $pageIds[] = $childPage['page_id'];
}
}
-
- //ブロックテーブル削除
- if(!$this->blocksAction->delBlockByPageId($page_id)) {
- return 'error';
- }
- //メニュー詳細テーブル削除
- if(!$this->menuAction->delMenuDetailByPageId($page_id)) {
- return 'error';
- }
- //携帯メニュー詳細テーブル削除
- if(!$this->menuAction->delMobileMenuDetailByPageId($page_id)) {
+
+ $inValue = implode(',', $pageIds);
+ if (!$this->pagesAction->deletePagesByInOperator($inValue)) {
return 'error';
}
- $this->del_page_arr[] = $page_id;
- if($page['node_flag']) {
- //子供を再帰的に削除
- if(!$this->_delPageChildren($page['page_id'])) {
- return 'error';
- }
- }
- if(in_array($this->session->getParameter("_main_page_id"), $this->del_page_arr)) {
+ if(in_array($this->session->getParameter("_main_page_id"), $pageIds)) {
$this->session->setParameter("_editing_block_id", intval($this->block_id));
//再表示URL
@@ -102,45 +84,6 @@ function execute()
$this->url = "true";
}
return 'success';
- }
-
- function _delPageChildren($parent_id) {
- $ret = true;
- $pages = $this->pagesView->getPages(array("parent_id"=>$parent_id));
- if(isset($pages[0])) {
- foreach($pages as $page) {
- if($page['node_flag']) {
- //子供を再帰的に削除
- $this->_delPageChildren($page['page_id']);
- }
- $this->del_page_arr[] = $page['page_id'];
- if(!$this->pagesAction->delPageById($page['page_id'])) {
- $ret = false;
- }
- //ページスタイル削除
- if(!$this->pagesAction->delPageStyleById($page['page_id'])) {
- $ret = false;
- }
- //pages_meta_infテーブル削除
- if(!$this->pagesAction->delPageMetaInfById($page['page_id'])) {
- $ret = false;
- }
- //削除関数を呼び出し
- $blocks =& $this->blocksView->getBlockByPageId($page['page_id']);
- if(isset($blocks[0])) {
- foreach($blocks as $block) {
- $this->blocksAction->delFuncExec($block['block_id']);
- }
- }
- if(!$this->blocksAction->delBlockByPageId($page['page_id'])) {
- $ret = false;
- }
- if(!$this->menuAction->delMenuDetailByPageId($page['page_id'])) {
- $ret = false;
- }
- }
- }
- return $ret;
- }
+ }
}
?>
diff --git a/html/webapp/modules/menu/action/edit/deletepage/maple.ini b/html/webapp/modules/menu/action/edit/deletepage/maple.ini
index 0996510..401fa5e 100644
--- a/html/webapp/modules/menu/action/edit/deletepage/maple.ini
+++ b/html/webapp/modules/menu/action/edit/deletepage/maple.ini
@@ -7,9 +7,7 @@ main_page_id.menu.delete = "1:lang.menu_error_last_page"
session = "ref:Session"
pagesView = "ref:pagesView"
pagesAction = "ref:pagesAction"
-blocksAction = "ref:blocksAction"
-menuAction = "ref:menuAction"
-blocksView = "ref:blocksView"
+db = "ref:DbObject"
[View]
success = "common:menu_action_edit_deletepage.html"
diff --git a/html/webapp/modules/module/action/admin/uninstall/Uninstall.class.php b/html/webapp/modules/module/action/admin/uninstall/Uninstall.class.php
index 75d7155..df2bdb0 100644
--- a/html/webapp/modules/module/action/admin/uninstall/Uninstall.class.php
+++ b/html/webapp/modules/module/action/admin/uninstall/Uninstall.class.php
@@ -231,10 +231,10 @@ function execute()
}
}
}
- if($this->uploadsAction->delUploadsByModuleid($this->upd_module_id) && $del_flag) {
- $this->_setMes(MODULE_MES_RESULT_UPLOADS_EN,1);
- }
-
+ if ($del_flag) {
+ $this->_setMes(MODULE_MES_RESULT_UPLOADS_EN,1);
+ }
+
// ----------------------------------------------
// --- モジュールテーブルのデータ削除 ---
// ----------------------------------------------
@@ -266,8 +266,7 @@ function execute()
// --- ページモジュールリンクデータ削除 ---
// ----------------------------------------------------------------------
$this->_setMes(sprintf(MODULE_MES_RESULT_DELETE_ST,MODULE_PAGES_MODULES_LINK_TABLE_NAME),1);
- if($this->pagesAction->delPagesModulesLink(array("module_id" => $this->upd_module_id))) {
- //削除成功
+ if ($this->pagesAction->deleteRoomModule(null, array($this->upd_module_id))) {
$this->_setMes(sprintf(MODULE_MES_RESULT_DELETE_EN,MODULE_PAGES_MODULES_LINK_TABLE_NAME),1);
} else {
$this->_setMes(sprintf(MODULE_MES_RESULT_DELETE_ER,MODULE_PAGES_MODULES_LINK_TABLE_NAME),1);
diff --git a/html/webapp/modules/room/action/admin/delete/Delete.class.php b/html/webapp/modules/room/action/admin/delete/Delete.class.php
index eb6783e..98539a2 100644
--- a/html/webapp/modules/room/action/admin/delete/Delete.class.php
+++ b/html/webapp/modules/room/action/admin/delete/Delete.class.php
@@ -15,207 +15,23 @@
class Room_Action_Admin_Delete extends Action
{
// パラメータを受け取るため
- var $parent_page_id = null;
var $edit_current_page_id = null;
-
- // バリデートによりセット
- var $parent_page = null;
- var $page = null;
-
- // 使用コンポーネントを受け取るため
- var $pagesView = null;
- var $pagesAction = null;
- var $blocksView = null;
- var $modulesView = null;
- var $preexecuteMain = null;
- var $blocksAction = null;
- var $db = null;
- var $uploadsAction = null;
-
- /**
- * ルーム削除処理
- *
- * @access public
- */
- function execute()
- {
- $result = $this->_delRoom(intval($this->edit_current_page_id));
- if($result === false) return 'error';
- return 'success';
- }
-
- /**
- * 削除処理
- * @param int current_page_id
- * @return boolean
- * @access private
- */
- function _delRoom($current_page_id) {
- $log =& LogFactory::getLog();
-
- // ----------------------------------------------------------------------
- // --- サブグループ ---
- // ----------------------------------------------------------------------
- $sub_pages =& $this->db->selectExecute("pages", array("parent_id" => $current_page_id, "room_id = page_id" => null));
- if($sub_pages === false) {
- return false;
- }
- if(count($sub_pages) > 0) {
- //サブグループあり
- //それぞれ、ルーム削除を再帰的に行う
- foreach($sub_pages as $sub_page) {
- $result = $this->_delRoom(intval($sub_page['page_id']));
- if(!$result) return false;
- }
- }
-
- // ルームに所属しているページ一覧取得
- $result = $this->db->selectExecute("pages", array("room_id" => $current_page_id) ,null, null, null, array($this, "_fetchcallback"));
- if($result === false) {
- return false;
- }
- list($page_list, $pages) = $result;
-
- // ----------------------------------------------------------------------
- // --- ブロック削除アクション-削除アクション実行 ---
- // ----------------------------------------------------------------------
- $blocks =& $this->blocksView->getBlockByPageId($page_list);
- $modules =& $this->modulesView->getModulesByUsed($current_page_id,0,0,true);
- if(is_array($blocks) && count($blocks) > 0) {
- foreach($blocks as $block) {
- $block_delete_action = $modules[$block['module_id']]['block_delete_action'];
- if($block_delete_action != "" && $block_delete_action != null) {
- //ブロック削除アクション
- $result = $this->blocksAction->delFuncExec($block['block_id'], $block, $block_delete_action);
- //if($result === false) {
- // 削除アクションの返り値をエラーとしない
- // モジュールの作り方によってルームの削除ができなくなると問題なので。
- //$log->warn(sprintf("%sのブロック削除アクション(%s)が失敗しました。",$modules[$block['module_id_id']]['module_name'], $block_delete_action), "Room_Action_Admin_Delete_Init#execute");
- //return false;
- //}
- }
- }
- }
- if(is_array($modules) && count($modules) > 0) {
- foreach($modules as $module) {
- $delete_action = $module['delete_action'];
- // delete_action処理
- if($delete_action != "" && $delete_action != null) {
- $result = $this->pagesAction->delFuncExec($current_page_id, $module, $delete_action);
- }
- }
- }
- // ----------------------------------------------------------------------
- // --- 添付ファイル更新処理 ---
- // ----------------------------------------------------------------------
- $result = $this->uploadsAction->delUploadsByRoomid($current_page_id);
- if($result === false) return false;
-
- // ----------------------------------------------------------------------
- // --- ページモジュールリンクテーブル削除 ---
- // ----------------------------------------------------------------------
- $result = $this->pagesAction->delPagesModulesLink(array("room_id" => $current_page_id));
- if($result === false) return false;
-
- // ----------------------------------------------------------------------
- // --- ページユーザリンクテーブル削除 ---
- // ----------------------------------------------------------------------
- $result = $this->pagesAction->delPageUsersLink(array("room_id" => $current_page_id));
- if($result === false) return false;
-
- foreach($page_list as $page_id) {
- // ----------------------------------------------------------------------
- // --- ブロックテーブル削除 ---
- // ----------------------------------------------------------------------
- $result = $this->pagesAction->delPageById($page_id, "blocks");
- if(!$result) {
- return false;
- }
- // ----------------------------------------------------------------------
- // --- 非表示メニューテーブル削除 ---
- // ----------------------------------------------------------------------
- if(!$this->pagesAction->delPageById($page_id, 'menu_detail')) {
- return false;
- }
- if(!$this->pagesAction->delPageById($page_id, 'mobile_menu_detail')) {
- return false;
- }
+ // 使用コンポーネントを受け取るため
+ var $pagesAction = null;
- // ----------------------------------------------------------------------
- // --- ページテーブル削除 ---
- // ----------------------------------------------------------------------
- $result = $this->pagesAction->delPageById($page_id);
- if(!$result) {
- return false;
- }
- // ----------------------------------------------------------------------
- // --- ページスタイル削除 ---
- // ----------------------------------------------------------------------
- if(!$this->pagesAction->delPageStyleById($page_id)) {
- return false;
- }
-
- // ----------------------------------------------------------------------
- // --- pages_meta_infテーブル削除 ---
- // ----------------------------------------------------------------------
- if(!$this->pagesAction->delPageMetaInfById($page_id)) {
- return false;
- }
-
- // ----------------------------------------------------------------------
- // --- 表示順decrement ---
- // ----------------------------------------------------------------------
- if($current_page_id == $page_id) {
- if(!$this->pagesAction->decrementDisplaySeq($pages[$page_id]['parent_id'], $pages[$page_id]['display_sequence'], $pages[$page_id]['lang_dirname'])) {
- return false;
- }
- }
- }
- // ----------------------------------------------------------------------
- // --- ショートカット先削除 ---
- // ----------------------------------------------------------------------
- $shortcuts =& $this->db->selectExecute("shortcut", array("room_id" => $current_page_id));
- if(isset($shortcuts[0])) {
- $preexecute_params = array(
- "mode" => "delete",
- "shortcut_flag" => _ON
- );
- foreach($shortcuts as $shortcut) {
- //TODO shortcut_site_idにより、他サイトを考慮した場合は、他サイトの削除処理を行うこと 現状、未実装
- $preexecute_params["block_id"] = $shortcut["shortcut_block_id"];
- $preexecute_params["page_id"] = $shortcut["shortcut_page_id"];
- $preexecute_params["room_id"] = $shortcut["shortcut_room_id"];
- //delete_blockアクションを呼ぶ
- $result = $this->preexecuteMain->preExecute("pages_actionblock_deleteblock", $preexecute_params);
- if($result === false || $result === "false") {
- //$errorList->add($this->_classname, sprintf(_INVALID_ACTION,"pages_actionblock_deleteblock"));
- return false;
- }
- }
- $result = $this->db->deleteExecute("shortcut", array("room_id" => $current_page_id));
- if($result === false){
- //$errorList->add($this->_classname, sprintf(_INVALID_ACTION,"pages_actionblock_deleteblock"));
- return false;
- }
- }
- return true;
- }
-
- /**
- * fetch時コールバックメソッド
- * @param result adodb object
- * @return array
- * @access private
+ /**
+ * ルーム削除処理
+ *
+ * @access public
*/
- function _fetchcallback($result) {
- $ret = array();
- $parent_ret = array();
- while ($row = $result->fetchRow()) {
- $ret[] = $row['page_id'];
- $page_ret[$row['page_id']] = $row;
+ function execute()
+ {
+ if (!$this->pagesAction->deleteRoom($this->edit_current_page_id)) {
+ return 'error';
}
- return array($ret, $page_ret);
+
+ return 'success';
}
}
?>
\ No newline at end of file
diff --git a/html/webapp/modules/room/action/admin/delete/dicon.ini b/html/webapp/modules/room/action/admin/delete/dicon.ini
index 6cf756c..d38ced3 100644
--- a/html/webapp/modules/room/action/admin/delete/dicon.ini
+++ b/html/webapp/modules/room/action/admin/delete/dicon.ini
@@ -1,15 +1,13 @@
[DIContainer]
databaseSqlutility = "database.sqlutility"
-blocksAction = "blocks.action"
pagesAction = "pages.action"
uploadsAction = "uploads.action"
+blocksAction = "blocks.action"
[blocksAction]
databaseSqlutility = "dicon://databaseSqlutility"
preexecuteMain = "dicon://preexecuteMain"
-modulesView = "dicon://modulesView"
[pagesAction]
databaseSqlutility = "dicon://databaseSqlutility"
-preexecuteMain = "dicon://preexecuteMain"
-modulesView = "dicon://modulesView"
\ No newline at end of file
+preexecuteMain = "dicon://preexecuteMain"
\ No newline at end of file
diff --git a/html/webapp/modules/room/action/admin/delete/maple.ini b/html/webapp/modules/room/action/admin/delete/maple.ini
index 076e1d4..36cf219 100644
--- a/html/webapp/modules/room/action/admin/delete/maple.ini
+++ b/html/webapp/modules/room/action/admin/delete/maple.ini
@@ -8,18 +8,11 @@ edit_current_page_id.required ="1:lang._invalid_input"
parent_page_id,edit_current_page_id.room.RoomRegist = "1,delete:lang._invalid_input"
[DIContainer]
-filename_delete = dicon.ini
-
-[Action]
-pagesAction = "ref:pagesAction"
-blocksView = "ref:blocksView"
-modulesView = "ref:modulesView"
-preexecuteMain = "ref:preexecuteMain"
-blocksAction = "ref:blocksAction"
-pagesView = "ref:pagesView"
-db = "ref:DbObject"
-uploadsAction = "ref:uploadsAction"
+filename = dicon.ini
[View]
-success = "main:error.html"
-error = "main:error.html"
\ No newline at end of file
+success = "main:true.html"
+error = "main:error.html"
+
+[Action]
+pagesAction = "ref:pagesAction"
\ No newline at end of file
diff --git a/html/webapp/modules/room/action/admin/selmodules/Selmodules.class.php b/html/webapp/modules/room/action/admin/selmodules/Selmodules.class.php
index 385bc49..95f6152 100644
--- a/html/webapp/modules/room/action/admin/selmodules/Selmodules.class.php
+++ b/html/webapp/modules/room/action/admin/selmodules/Selmodules.class.php
@@ -15,109 +15,97 @@
class Room_Action_Admin_Selmodules extends Action
{
// リクエストパラメータを受け取るため
- var $edit_current_page_id = null;
- var $parent_page_id = null;
-
- var $enroll_modules = null;
-
+ var $edit_current_page_id = null;
+ var $parent_page_id = null;
+
+ var $enroll_modules = null;
+
// バリデートによりセット
var $parent_page = null;
var $page = null;
-
- // 使用コンポーネントを受け取るため
- var $pagesView = null;
- var $pagesAction = null;
- var $modulesView = null;
- var $blocksView = null;
- var $blocksAction = null;
- var $preexecuteMain = null;
- var $db = null;
- var $request = null;
-
+
+ // 使用コンポーネントを受け取るため
+ var $pagesView = null;
+ var $pagesAction = null;
+ var $modulesView = null;
+ var $blocksView = null;
+ var $blocksAction = null;
+ var $preexecuteMain = null;
+ var $db = null;
+ var $request = null;
+
//値をセットするため
- /**
- * 使用可能モジュール配置修正
- *
- * @access public
- */
- function execute()
- {
- if($this->edit_current_page_id != 0) {
- $log =& LogFactory::getLog();
- // ----------------------------------------------------------------------
- // --- ページモジュールリンクテーブル変更 ---
- // ----------------------------------------------------------------------
- //if(isset($this->enroll_modules)) {
- $where_params = array(
- "room_id" => $this->edit_current_page_id
- );
- $page_modules =& $this->pagesView->getPageModulesLink($where_params, null, array($this, "_fetchcallbackModulesLink"));
- $error_flag = false;
- if(isset($this->enroll_modules)) {
- foreach($this->enroll_modules as $module_id) {
- if(!isset($page_modules[$module_id])) {
- $params = array(
- "room_id" => $this->edit_current_page_id,
- "module_id" => $module_id
- );
- //insert
- $result = $this->pagesAction->insPagesModulesLink($params);
- if($result === false) {
- $error_flag = true;
- }
- }
- unset($page_modules[$module_id]);
- }
- }
- $page_list =& $this->db->selectExecute("pages", array("room_id" => $this->edit_current_page_id) ,null, null, null, array($this, "_fetchcallback"));
- if($page_list === false) {
- return 'error';
- }
- $blocks =& $this->blocksView->getBlockByPageId($page_list);
-
- //ページモジュールリンクテーブル削除
- foreach($page_modules as $page_module) {
- $where_params = array(
- "room_id" => $page_module['room_id'],
- "module_id" => $page_module['module_id']
- );
- $result = $this->pagesAction->delPagesModulesLink($where_params);
- if($result === false) {
- $error_flag = true;
- }
- //
- // モジュール削除関数を呼び出す
- //
- $module =& $this->modulesView->getModulesById($page_module['module_id']);
- $delete_action = $module['delete_action'];
- if($delete_action != "" && $delete_action != null) {
- $result = $this->pagesAction->delFuncExec($page_module['room_id'], $module, $delete_action);
- }
- }
- if(is_array($blocks) && count($blocks) > 0) {
- foreach($blocks as $block) {
- $module_id = $block['module_id'];
- if(isset($page_modules[$module_id])) {
- //block削除処理
- $preexecute_params = array(
- "block_id" => $block['block_id'],
- "page_id"=> $block['page_id']
- );
- $result = $this->preexecuteMain->preExecute("pages_actionblock_deleteblock", $preexecute_params);
- //if($result === false || $result === "false") {
- // $log->warn(sprintf("%sの削除アクション(%s)が失敗しました。","pages", "pages_actionblock_deleteblock"), "Room_Action_Admin_Create_Selectmodules#execute");
- //}
- }
- }
- }
- if($error_flag) {
- return 'error';
- }
- //}
- }
- // ----------------------------------------------------------------------
- // --- 終了処理 ---
+ /**
+ * 使用可能モジュール配置修正
+ *
+ * @access public
+ */
+ function execute()
+ {
+ $roomId = $this->edit_current_page_id;
+ $usableModuleIds = $this->enroll_modules;
+ if (!isset($usableModuleIds)) {
+ $usableModuleIds = array();
+ }
+ $previousUsableModules = $this->pagesView->getUsableModulesByRoom($roomId, true);
+
+ $isError = false;
+ foreach ($usableModuleIds as $moduleId) {
+ if (isset($previousUsableModules[$moduleId])) {
+ unset($previousUsableModules[$moduleId]);
+ continue;
+ }
+
+ $insertDatas = array(
+ 'room_id' => $roomId,
+ 'module_id' => $moduleId
+ );
+
+ if (!$this->pagesAction->insPagesModulesLink($insertDatas)) {
+ $isError = true;
+ }
+ }
+
+ if (!$this->pagesAction->deleteEachModule($roomId, $previousUsableModules)) {
+ $isError = true;
+ }
+
+ $unusableModuleIds = array_keys($previousUsableModules);
+ if (!$this->pagesAction->deleteRoomModule($roomId, $unusableModuleIds)) {
+ $isError = true;
+ }
+
+ $sql = "SELECT B.block_id, "
+ . "B.page_id "
+ . "FROM {blocks} B "
+ . "INNER JOIN {pages} P "
+ . "ON B.page_id = P.page_id "
+ . "WHERE P.room_id = ? "
+ . "AND B.module_id IN ('" . implode("','", $unusableModuleIds) . "')";
+ $blocks =& $this->db->execute($sql, $roomId);
+ if ($blocks === false) {
+ $this->db->addError();
+ }
+
+ foreach($blocks as $block) {
+ $request = array(
+ 'block_id' => $block['block_id'],
+ 'page_id' => $block['page_id']
+ );
+ $result = $this->preexecuteMain->preExecute('pages_actionblock_deleteblock', $request);
+ if ($result === false
+ || $result === 'false') {
+ $isError = true;
+ }
+ }
+
+ if($isError) {
+ return 'error';
+ }
+
+ // ----------------------------------------------------------------------
+ // --- 終了処理 ---
// ----------------------------------------------------------------------
// リスト表示のリクエストパラメータセット
if(!isset($this->parent_page)) {
@@ -130,37 +118,7 @@ function execute()
$this->request->setParameter("show_default_entry_flag", $this->parent_page['default_entry_flag']);
}
- return 'success';
- }
-
-
- /**
- * fetch時コールバックメソッド
- * @param result adodb object
- * @return array
- * @access private
- */
- function &_fetchcallbackModulesLink($result) {
- $ret = array();
- while ($row = $result->fetchRow()) {
- $ret[$row['module_id']] = $row;
- }
- return $ret;
- }
-
-
- /**
- * fetch時コールバックメソッド
- * @param result adodb object
- * @return array
- * @access private
- */
- function &_fetchcallback($result) {
- $ret = array();
- while ($row = $result->fetchRow()) {
- array_push ( $ret, $row['page_id']);
- }
- return $ret;
+ return 'success';
}
}
?>
diff --git a/html/webapp/modules/room/action/admin/selmodules/dicon.ini b/html/webapp/modules/room/action/admin/selmodules/dicon.ini
index 8431155..d38ced3 100644
--- a/html/webapp/modules/room/action/admin/selmodules/dicon.ini
+++ b/html/webapp/modules/room/action/admin/selmodules/dicon.ini
@@ -1,14 +1,13 @@
[DIContainer]
databaseSqlutility = "database.sqlutility"
-blocksAction = "blocks.action"
pagesAction = "pages.action"
+uploadsAction = "uploads.action"
+blocksAction = "blocks.action"
[blocksAction]
databaseSqlutility = "dicon://databaseSqlutility"
preexecuteMain = "dicon://preexecuteMain"
-modulesView = "dicon://modulesView"
[pagesAction]
databaseSqlutility = "dicon://databaseSqlutility"
-preexecuteMain = "dicon://preexecuteMain"
-modulesView = "dicon://modulesView"
\ No newline at end of file
+preexecuteMain = "dicon://preexecuteMain"
\ No newline at end of file
diff --git a/html/webapp/modules/room/install.ini b/html/webapp/modules/room/install.ini
index 72cd700..c073806 100644
--- a/html/webapp/modules/room/install.ini
+++ b/html/webapp/modules/room/install.ini
@@ -2,3 +2,4 @@ version = "2.4.0.0"
action_name="room_view_admin_init"
module_icon="room.gif"
system_flag=1
+module_update_action = "room_update"
diff --git a/html/webapp/modules/room/update/Update.class.php b/html/webapp/modules/room/update/Update.class.php
new file mode 100644
index 0000000..6c94cbc
--- /dev/null
+++ b/html/webapp/modules/room/update/Update.class.php
@@ -0,0 +1,55 @@
+db->execute($sql, $bindValues);
+ if ($garbages === false) {
+ $this->db->addError();
+ return false;
+ }
+
+ foreach ($garbages as $garbage) {
+ if (!$this->pagesAction->deleteRoom($garbage['room_id'])) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
+?>
diff --git a/html/webapp/modules/room/update/dicon.ini b/html/webapp/modules/room/update/dicon.ini
new file mode 100644
index 0000000..647492b
--- /dev/null
+++ b/html/webapp/modules/room/update/dicon.ini
@@ -0,0 +1,13 @@
+[DIContainer]
+databaseSqlutility = "database.sqlutility"
+blocksAction = "blocks.action"
+pagesAction = "pages.action"
+uploadsAction = "uploads.action"
+
+[blocksAction]
+databaseSqlutility = "dicon://databaseSqlutility"
+preexecuteMain = "dicon://preexecuteMain"
+
+[pagesAction]
+databaseSqlutility = "dicon://databaseSqlutility"
+preexecuteMain = "dicon://preexecuteMain"
\ No newline at end of file
diff --git a/html/webapp/modules/room/update/maple.ini b/html/webapp/modules/room/update/maple.ini
new file mode 100644
index 0000000..1fd1080
--- /dev/null
+++ b/html/webapp/modules/room/update/maple.ini
@@ -0,0 +1,12 @@
+[RecursiveNocall]
+ValidateDef =
+
+[ValidateDef]
+requiredfalse ="1:lang._invalid_input"
+
+[DIContainer]
+filename = dicon.ini
+
+[Action]
+db = "ref:DbObject"
+pagesAction = "ref:pagesAction"
\ No newline at end of file
diff --git a/html/webapp/modules/user/action/admin/delete/Delete.class.php b/html/webapp/modules/user/action/admin/delete/Delete.class.php
index 10f9cdf..dc025b1 100644
--- a/html/webapp/modules/user/action/admin/delete/Delete.class.php
+++ b/html/webapp/modules/user/action/admin/delete/Delete.class.php
@@ -19,15 +19,7 @@ class User_Action_Admin_Delete extends Action
var $user_id = null;
// 使用コンポーネントを受け取るため
- var $pagesView = null;
var $usersAction = null;
- var $pagesAction = null;
- var $uploadsAction = null;
- var $db = null;
- var $blocksView = null;
- var $blocksAction = null;
- var $modulesView = null;
- var $usersView = null;
var $actionChain = null;
/**
@@ -37,160 +29,16 @@ class User_Action_Admin_Delete extends Action
*/
function execute()
{
- $user_id = $this->user_id;
-
- // ルームに所属しているページ一覧取得
- $params = array(
- "insert_user_id" => $user_id
- );
-
- $privatespace_pages = $this->db->execute("SELECT {pages}.* " .
- " FROM {pages} " .
- " WHERE {pages}.thread_num = 0 AND {pages}.private_flag = "._ON.
- " AND {pages}.space_type = "._SPACE_TYPE_GROUP.
- " AND {pages}.insert_user_id = ? ".
- " ORDER BY default_entry_flag DESC",$params);
-
- if ($privatespace_pages === false || !isset($privatespace_pages[0])) {
- $this->db->addError();
- return 'error';
- }
- if(count($privatespace_pages) > 1) {
- $where_page_list = array("(room_id = ".$privatespace_pages[0]['room_id']." OR room_id=".$privatespace_pages[1]['room_id'].")" => null);
- } else {
- $where_page_list = array("room_id" => $privatespace_pages[0]['room_id']);
- }
- $page_list =& $this->db->selectExecute("pages", $where_page_list ,null, null, null, array($this, "_fetchcallback"));
- if($page_list === false) {
- return 'error';
- }
- $users = $this->usersView->getUsers(array("user_id"=>$user_id));
- if($users === false || !isset($users[0])) return 'error';
-
- // ----------------------------------------------------------------------
- // --- usersテーブルから削除 ---
- // ----------------------------------------------------------------------
- // ----------------------------------------------------------------------
- // --- users_items_linkテーブルから削除 ---
- // ----------------------------------------------------------------------
- $result = $this->usersAction->delUserById($user_id);
- if($result === false) return 'error';
-
- // ----------------------------------------------------------------------
- // --- pages_users_linkテーブルから削除 ---
- // ----------------------------------------------------------------------
- $where_params = array("user_id" => $user_id);
- $result = $this->pagesAction->delPageUsersLink($where_params);
- if($result === false) return 'error';
-
- // ----------------------------------------------------------------------
- // --- ブロック削除アクション-削除アクション実行 ---
- // ----------------------------------------------------------------------
- $blocks =& $this->blocksView->getBlockByPageId($page_list);
- $modules =& $this->modulesView->getAuthoritiesModulesByUsed($users[0]['role_authority_id'],0,0,true);
-
- if(is_array($blocks) && count($blocks) > 0) {
- foreach($blocks as $block) {
- if(!isset($modules[$block['module_id']])) {
- $get_modules= $this->modulesView->getModules(array("module_id" => $block['module_id']));
- $modules[$block['module_id']] = $get_modules[0];
- }
- $block_delete_action = $modules[$block['module_id']]['block_delete_action'];
- if($block_delete_action != "" && $block_delete_action != null) {
- //ブロック削除アクション
- $result = $this->blocksAction->delFuncExec($block['block_id'], $block, $block_delete_action);
- }
- }
- }
- foreach($privatespace_pages as $privatespace_page) {
- $current_page_id = $privatespace_page['room_id'];
-
- // ----------------------------------------------------------------------
- // --- 添付ファイル削除処理 ---
- // ----------------------------------------------------------------------
- $result = $this->uploadsAction->delUploadsByRoomid($current_page_id);
- if($result === false) return 'error';
-
- if(is_array($modules) && count($modules) > 0) {
- foreach($modules as $module) {
- $delete_action = $module['delete_action'];
- // delete_action処理
- if($delete_action != "" && $delete_action != null) {
- $result = $this->pagesAction->delFuncExec($current_page_id, $module, $delete_action);
- }
- }
- }
- }
-
- // ----------------------------------------------------------------------
- // --- プライベートスペースの削除 ---
- // ----------------------------------------------------------------------
- foreach($page_list as $page_id) {
- //削除関数を呼び出し
- $blocks =& $this->blocksView->getBlockByPageId($page_id);
- if(isset($blocks[0])) {
- foreach($blocks as $block) {
- $this->blocksAction->delFuncExec($block['block_id']);
- }
- }
- // ----------------------------------------------------------------------
- // --- ブロックテーブル削除 ---
- // ----------------------------------------------------------------------
- $result = $this->pagesAction->delPageById($page_id, "blocks");
- if(!$result) {
- return 'error';
- }
-
- // ----------------------------------------------------------------------
- // --- ページテーブル削除 ---
- // ----------------------------------------------------------------------
- $result = $this->pagesAction->delPageById($page_id);
- if(!$result) {
- return 'error';
- }
-
- // ----------------------------------------------------------------------
- // --- pages_meta_inf テーブルから削除 ---
- // ----------------------------------------------------------------------
- if(!$this->pagesAction->delPageMetaInfById($page_id)) {
- return 'error';
- }
+ if (!$this->usersAction->deleteUser($this->user_id)) {
+ return 'error';
}
- // ----------------------------------------------------------------------
- // --- uploads テーブルから削除(アバター等) ---
- // ----------------------------------------------------------------------
- // 複数存在する場合もあるため、ガーベージフラグにより対応
- $params = array("garbage_flag" => _ON);
- $where_params = array(
- "action_name" => "common_download_user",
- "unique_id " => $user_id,
- "garbage_flag" => _OFF
- );
- $result = $this->uploadsAction->updUploads($params, $where_params);
- if($result === false) return 'error';
-
$recursive_action_name = $this->actionChain->getRecursive();
- if($recursive_action_name != "") {
+ if (!empty($recursive_action_name)) {
return 'recursive_success';
}
return 'success';
}
-
-
- /**
- * fetch時コールバックメソッド
- * @param result adodb object
- * @return array
- * @access private
- */
- function &_fetchcallback($result) {
- $ret = array();
- while ($row = $result->fetchRow()) {
- $ret[] = $row['page_id'];
- }
- return $ret;
- }
}
?>
diff --git a/html/webapp/modules/user/action/admin/delete/dicon.ini b/html/webapp/modules/user/action/admin/delete/dicon.ini
index e3d3b5c..d38ced3 100644
--- a/html/webapp/modules/user/action/admin/delete/dicon.ini
+++ b/html/webapp/modules/user/action/admin/delete/dicon.ini
@@ -7,9 +7,7 @@ blocksAction = "blocks.action"
[blocksAction]
databaseSqlutility = "dicon://databaseSqlutility"
preexecuteMain = "dicon://preexecuteMain"
-modulesView = "dicon://modulesView"
[pagesAction]
databaseSqlutility = "dicon://databaseSqlutility"
-preexecuteMain = "dicon://preexecuteMain"
-modulesView = "dicon://modulesView"
\ No newline at end of file
+preexecuteMain = "dicon://preexecuteMain"
\ No newline at end of file
diff --git a/html/webapp/modules/user/action/admin/delete/maple.ini b/html/webapp/modules/user/action/admin/delete/maple.ini
index 25ada51..d60734c 100644
--- a/html/webapp/modules/user/action/admin/delete/maple.ini
+++ b/html/webapp/modules/user/action/admin/delete/maple.ini
@@ -20,15 +20,7 @@ action="user_view_main_search"
filename_regist = "dicon.ini"
[Action]
-pagesView = "ref:pagesView"
-pagesAction = "ref:pagesAction"
usersAction = "ref:usersAction"
-uploadsAction = "ref:uploadsAction"
-db = "ref:DbObject"
-blocksView = "ref:blocksView"
-blocksAction = "ref:blocksAction"
-usersView = "ref:usersView"
-modulesView = "ref:modulesView"
actionChain = "ref:ActionChain"
[View]
diff --git a/html/webapp/modules/user/action/admin/seldelete/Seldelete.class.php b/html/webapp/modules/user/action/admin/seldelete/Seldelete.class.php
index 63dfe89..730d879 100644
--- a/html/webapp/modules/user/action/admin/seldelete/Seldelete.class.php
+++ b/html/webapp/modules/user/action/admin/seldelete/Seldelete.class.php
@@ -20,13 +20,8 @@ class User_Action_Admin_Seldelete extends Action
// 使用コンポーネントを受け取るため
var $session = null;
- var $pagesView = null;
var $usersAction = null;
- var $pagesAction = null;
- var $uploadsAction = null;
var $db = null;
- var $blocksView = null;
- var $blocksAction = null;
var $authoritiesView = null;
/**
@@ -57,205 +52,48 @@ function execute()
$this->db->addError();
return 'error';
}
- $del_users = array();
+
$login_user_id = $this->session->getParameter("_user_id");
$_system_user_id = $this->session->getParameter("_system_user_id");
$_user_auth_id = $this->session->getParameter("_user_auth_id");
- $arr_count = 0;
- $count = 0;
+
+ $canUseSysytemModule = false;
+ $roleId = $this->session->getParameter('_role_auth_id');
+ $fetchMethod = array($this, '_canUseSysytemModule');
+ $whereArray = array('system_flag' => _ON);
if($_user_auth_id == _AUTH_ADMIN) {
- //
- // 管理者ならば、システムコントロールモジュール、サイト運営モジュールの選択の有無で上下を判断
- //
- $_role_auth_id = $this->session->getParameter("_role_auth_id");
- $func = array($this, "_getSysModulesFetchcallback");
- $system_user_flag = $this->authoritiesView->getAuthoritiesModulesLinkByAuthorityId($_role_auth_id, array("system_flag"=>_ON), null, $func);
- } else {
- $func = null;
- $system_user_flag = null;
+ // 管理者ならば、システムコントロールモジュール、サイト運営モジュールの選択の有無で上下を判断
+ $canUseSysytemModule = $this->authoritiesView->getAuthoritiesModulesLinkByAuthorityId($roleId, $whereArray, null, $fetchMethod);
}
+
+ $targetUsers = array();
foreach($users as $user_id => $user) {
- if(!isset($del_users[$arr_count])) {
- $del_users[$arr_count] = array();
- }
if($user_id == $login_user_id || $user_id == $_system_user_id) {
- // 自分自身 or システム管理者
- continue;
- }
- if($_user_auth_id != _AUTH_ADMIN && $user['user_authority_id'] >= $_user_auth_id) {
- // ログイン会員よりベース権限が未満のものしか削除できない
- continue;
- }
+ // 自分自身 or システム管理者
+ continue;
+ }
+ if($_user_auth_id != _AUTH_ADMIN && $user['user_authority_id'] >= $_user_auth_id) {
+ // ログイン会員よりベース権限が未満のものしか削除できない
+ continue;
+ }
- if($system_user_flag === null) {
- $buf_system_user_flag = $this->authoritiesView->getAuthoritiesModulesLinkByAuthorityId($user['role_authority_id'], array("system_flag"=>_ON), null, $func);
- if($buf_system_user_flag === true) {
+ if (empty($canUseSysytemModule)) {
+ $canUseSysytemModuleTarget = $this->authoritiesView->getAuthoritiesModulesLinkByAuthorityId($user['role_authority_id'], $whereArray, null, $fetchMethod);
+ if ($canUseSysytemModuleTarget === true) {
continue;
}
}
- if(isset($this->delete_users[$user_id])) {
- if($this->delete_users[$user_id] == _ON) {
- // 選択されている
- // 削除対象
- $del_users[$arr_count][] = $user_id;
- } else {
- continue;
- }
- } else if($this->select_user == _ON){
- // 全選択中
- // 削除対象
- $del_users[$arr_count][] = $user_id;
+ if (!empty($this->delete_users[$user_id])
+ || !empty($this->select_user)) {
+ $targetUsers[] = $user_id;
} else {
continue;
}
- // 50件単位でdeleteするため
- $count++;
- if($count == 50) {
- $count = 0;
- $arr_count++;
- }
- }
-
- $modules = $this->db->execute("SELECT {modules}.*,{authorities_modules_link}.role_authority_id FROM {modules},{authorities_modules_link} " .
- " WHERE {modules}.system_flag = 0 AND {modules}.module_id={authorities_modules_link}.module_id " .
- " ORDER BY {modules}.display_sequence",array(),null,null, true, array($this, "_fetchcallbackModulesByUsed"));
- if ($modules === false) {
- $this->db->addError();
- return 'error';
}
- // ---------------------------------------------------------
- // 削除処理
- // ---------------------------------------------------------
- // 50件単位
- foreach($del_users as $del_users_arr) {
- if(count($del_users_arr) == 0) {
- continue;
- }
- $where_user_str = implode("','", $del_users_arr);
- $where_params = array(
- "user_id IN ('".$where_user_str. "') " => null
- );
-
- $params = array();
- $privatespace_pages = $this->db->execute("SELECT {pages}.page_id " .
- " FROM {pages_users_link}, {pages} " .
- " WHERE {pages}.thread_num = 0 AND {pages}.private_flag = "._ON.
- " AND {pages}.space_type = "._SPACE_TYPE_GROUP.
- " AND {pages}.insert_user_id IN ('".$where_user_str. "') " .
- " ",$params, null, null, true, array($this, "_pageFetchcallback"));
- if ($privatespace_pages === false) {
- $this->db->addError();
- return 'error';
- }
-
- $page_list =& $this->db->selectExecute("pages", array("room_id IN (".implode(",", $privatespace_pages). ") " => null) ,null, null, null, array($this, "_pageFetchcallback"));
- if($page_list === false) {
- return 'error';
- }
- // ----------------------------------------------------------------------
- // --- usersテーブルから削除 ---
- // ----------------------------------------------------------------------
- // ----------------------------------------------------------------------
- // --- users_items_linkテーブルから削除 ---
- // ----------------------------------------------------------------------
- $result = $this->db->deleteExecute("users", $where_params);
- if ($result === false) {
- return 'error';
- }
-
- $result = $this->db->deleteExecute("users_items_link", $where_params);
- if ($result === false) {
- return 'error';
- }
-
- // ----------------------------------------------------------------------
- // --- pages_users_linkテーブルから削除 ---
- // ----------------------------------------------------------------------
- $result = $this->pagesAction->delPageUsersLink($where_params);
- if($result === false) {
- return 'error';
- }
-
- // ----------------------------------------------------------------------
- // --- プライベートスペースの削除 ---
- // ----------------------------------------------------------------------
- if(is_array($page_list)) {
- // ----------------------------------------------------------------------
- // --- ブロック削除アクション-削除アクション実行 ---
- // ----------------------------------------------------------------------
-
- $blocks =& $this->blocksView->getBlockByPageId($page_list);
- if(is_array($blocks) && count($blocks) > 0) {
- foreach($blocks as $block) {
- //ブロック削除アクション
- $result = $this->blocksAction->delFuncExec($block['block_id'], $block);
- }
- }
- foreach($page_list as $current_page_id) {
-
- // ----------------------------------------------------------------------
- // --- pages_meta_inf テーブルから削除 ---
- // ----------------------------------------------------------------------
- if(!$this->pagesAction->delPageMetaInfById($current_page_id)) {
- return 'error';
- }
-
- // ----------------------------------------------------------------------
- // --- 添付ファイル削除処理 ---
- // ----------------------------------------------------------------------
- $result = $this->uploadsAction->delUploadsByRoomid($current_page_id);
- if(is_array($modules) && count($modules) > 0 &&
- isset($modules[$users[$user_id]['role_authority_id']])) {
- foreach($modules[$users[$user_id]['role_authority_id']] as $module) {
- $delete_action = $module['delete_action'];
- // delete_action処理
- if($delete_action != "" && $delete_action != null) {
- $result = $this->pagesAction->delFuncExec($current_page_id, $module, $delete_action);
- }
- }
- }
- }
-
- /*
- foreach($page_list as $page_id) {
- //削除関数を呼び出し
- $blocks =& $this->blocksView->getBlockByPageId($page_id);
- if(isset($blocks[0])) {
- foreach($blocks as $block) {
- $this->blocksAction->delFuncExec($block['block_id']);
- }
- }
- }
- */
- $delpage_params = array(
- "page_id IN (".implode(",", $page_list). ") " => null
- );
- $result = $this->db->deleteExecute("pages", $delpage_params);
- if ($result === false) {
- return 'error';
- }
- $result = $this->db->deleteExecute("blocks", $delpage_params);
- if ($result === false) {
- return 'error';
- }
- }
-
- // ----------------------------------------------------------------------
- // --- uploads テーブルから削除(アバター等) ---
- // ----------------------------------------------------------------------
- // 複数存在する場合もあるため、ガーベージフラグにより対応
- $params = array("garbage_flag" => _ON);
- $where_params = array(
- "action_name" => "common_download_user",
- "unique_id IN ('".$where_user_str. "') " => null,
- "garbage_flag" => _OFF
- );
- $result = $this->uploadsAction->updUploads($params, $where_params);
- if($result === false) {
- return 'error';
- }
+ if (!$this->usersAction->deleteUser($targetUsers)) {
+ return 'error';
}
return 'success';
@@ -276,26 +114,13 @@ function &_fetchcallback($result) {
}
/**
- * fetch時コールバックメソッド
- * @param result adodb object
- * @return array users
- * @access private
- */
- function &_pageFetchcallback($result) {
- $ret = array();
- while ($row = $result->fetchRow()) {
- $ret[$row['page_id']] = $row['page_id'];
- }
- return $ret;
- }
-
- /**
- * fetch時コールバックメソッド
- * @param result adodb object
+ * システム管理用モジュールが利用できるかどうか判断する。
+ *
+ * @param array $recordSet 利用可能モジュール
* @return true or null
- * @access private
+ * @access private
*/
- function _getSysModulesFetchcallback($result) {
+ function _canUseSysytemModule($result) {
$site_modules_dir_arr = explode("|", AUTHORITY_SYS_DEFAULT_MODULES_ADMIN);
while ($obj = $result->fetchRow()) {
if($obj["authority_id"] === null) continue;
@@ -308,20 +133,5 @@ function _getSysModulesFetchcallback($result) {
}
return null;
}
-
- /**
- * fetch時コールバックメソッド
- * @param result adodb object
- * @return true or null
- * @access private
- */
- function _fetchcallbackModulesByUsed($result) {
- $ret = array();
- while ($row = $result->fetchRow()) {
- $ret[$row['role_authority_id']][$row['module_id']] = $row;
- }
- return $ret;
- }
-
}
?>
diff --git a/html/webapp/modules/user/action/admin/seldelete/dicon.ini b/html/webapp/modules/user/action/admin/seldelete/dicon.ini
index e3d3b5c..d38ced3 100644
--- a/html/webapp/modules/user/action/admin/seldelete/dicon.ini
+++ b/html/webapp/modules/user/action/admin/seldelete/dicon.ini
@@ -7,9 +7,7 @@ blocksAction = "blocks.action"
[blocksAction]
databaseSqlutility = "dicon://databaseSqlutility"
preexecuteMain = "dicon://preexecuteMain"
-modulesView = "dicon://modulesView"
[pagesAction]
databaseSqlutility = "dicon://databaseSqlutility"
-preexecuteMain = "dicon://preexecuteMain"
-modulesView = "dicon://modulesView"
\ No newline at end of file
+preexecuteMain = "dicon://preexecuteMain"
\ No newline at end of file
diff --git a/html/webapp/modules/user/action/admin/seldelete/maple.ini b/html/webapp/modules/user/action/admin/seldelete/maple.ini
index a219411..0da7b62 100644
--- a/html/webapp/modules/user/action/admin/seldelete/maple.ini
+++ b/html/webapp/modules/user/action/admin/seldelete/maple.ini
@@ -4,7 +4,6 @@ filename_auth = "/modules/authority/config/define.inc.php"
[ValidateDef]
authcheck = "1,_auth_id>=_AUTH_ADMIN:lang._invalid_auth"
-;user_id.user.DelUser="1:lang._invalid_input"
[TokenExtra]
mode="check"
@@ -15,15 +14,9 @@ filename_regist = "dicon.ini"
[Action]
session = "ref:Session"
-pagesView = "ref:pagesView"
-pagesAction = "ref:pagesAction"
usersAction = "ref:usersAction"
-uploadsAction = "ref:uploadsAction"
db = "ref:DbObject"
-blocksView = "ref:blocksView"
-blocksAction = "ref:blocksAction"
authoritiesView = "ref:authoritiesView"
-modulesView = "ref:modulesView"
[View]
success = "action:user_action_main_search"
diff --git a/html/webapp/modules/whatsnew/components/Action.class.php b/html/webapp/modules/whatsnew/components/Action.class.php
index c69b27e..77a2997 100644
--- a/html/webapp/modules/whatsnew/components/Action.class.php
+++ b/html/webapp/modules/whatsnew/components/Action.class.php
@@ -58,10 +58,11 @@ function setRead()
if (empty($whatsnew)) {
return false;
}
-
+
$params = array(
"whatsnew_id"=>$whatsnew["whatsnew_id"],
- "user_id" => $_user_id
+ "user_id" => $_user_id,
+ 'room_id' => $whatsnew['room_id']
);
$count = $this->_db->countExecute("whatsnew_user", $params);
if ($count > 0) {
diff --git a/html/webapp/modules/whatsnew/update/Update.class.php b/html/webapp/modules/whatsnew/update/Update.class.php
index 5ac4f17..00334d6 100644
--- a/html/webapp/modules/whatsnew/update/Update.class.php
+++ b/html/webapp/modules/whatsnew/update/Update.class.php
@@ -277,6 +277,47 @@ function execute()
if($result === false) return false;
}
+ $sql = "SELECT WU.whatsnew_id, "
+ . "W.room_id "
+ . "FROM {whatsnew_user} WU "
+ . "LEFT JOIN {whatsnew} W "
+ . "ON WU.whatsnew_id = W.whatsnew_id "
+ . "WHERE WU.room_id IS NULL "
+ . "GROUP BY WU.whatsnew_id "
+ . "ORDER BY W.room_id";
+ $whatsnews = $this->db->execute($sql);
+ $roomId = null;
+ $targetIds = array();
+ foreach ($whatsnews as $whatsnew) {
+ if (!isset($whatsnew['room_id'])) {
+ $whatsnew['room_id'] = 'NULL';
+ }
+
+ $roomId = $whatsnew['room_id'];
+ $targetIds[$roomId][] = $whatsnew['whatsnew_id'];
+ }
+
+ foreach ($targetIds as $roomId => $whatsnewIds) {
+ $whereClause = 'WHERE whatsnew_id IN (' . implode(',', $whatsnewIds) . ')';
+ $bindValues = array();
+ if ($roomId === 'NULL') {
+ $sql = "DELETE FROM {whatsnew_user} "
+ . $whereClause;
+ } else {
+ $sql = "UPDATE {whatsnew_user} SET "
+ . "room_id = ? "
+ . $whereClause;
+ $bindValues = array(
+ $roomId
+ );
+ }
+
+ $result = $this->db->execute($sql, $bindValues);
+ if ($result === false) {
+ return false;
+ }
+ }
+
return true;
}
}
From 8d93d2e764c65738260795bdcda0df8f7a23d2ef Mon Sep 17 00:00:00 2001
From: kteraguchi
Date: Tue, 16 Apr 2013 15:16:25 +0900
Subject: [PATCH 25/39] =?UTF-8?q?#54=20=E6=96=B0=E7=9D=80=E3=83=AA?=
=?UTF-8?q?=E3=83=B3=E3=82=AF=E5=85=88=E3=81=AE=E3=83=96=E3=83=AD=E3=83=83?=
=?UTF-8?q?=E3=82=AF=E3=81=8C=E5=89=8A=E9=99=A4=E3=81=95=E3=82=8C=E3=81=A6?=
=?UTF-8?q?=E3=82=82Notice=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=8C=E7=99=BA?=
=?UTF-8?q?=E7=94=9F=E3=81=97=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB?=
=?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../calendar/components/View.class.php | 45 +++++++++----------
1 file changed, 22 insertions(+), 23 deletions(-)
diff --git a/html/webapp/modules/calendar/components/View.class.php b/html/webapp/modules/calendar/components/View.class.php
index 4da2643..0b8aacb 100644
--- a/html/webapp/modules/calendar/components/View.class.php
+++ b/html/webapp/modules/calendar/components/View.class.php
@@ -1214,37 +1214,37 @@ function hasEditAuthority(&$plan)
*/
function &getSelectRoomList()
{
- $calendarView =& $this->_container->getComponent("calendarView");
+ $calendarView =& $this->_container->getComponent("calendarView");
- $calendar_block = $calendarView->getBlock();
- if ($calendar_block === false) {
- return $calendar_block;
- }
+ $calendar_block = $calendarView->getBlock();
+ if ($calendar_block === false) {
+ return $calendar_block;
+ }
- $sess_myroom_flag = $this->_session->getParameter(array("calendar", "myroom_flag", $calendar_block["block_id"]));
+ $sess_myroom_flag = $this->_session->getParameter(array("calendar", "myroom_flag", $calendar_block["block_id"]));
if (isset($sess_myroom_flag)) {
$calendar_block["myroom_flag"] = intval($sess_myroom_flag);
}
- $user_id = $this->_session->getParameter("_user_id");
-
- $room_arr = $this->_request->getParameter("room_arr");
- if (!empty($user_id)) {
- $room_arr[0][0][0] = array(
- "page_id" => CALENDAR_ALL_MEMBERS_ID,
- "parent_id" => 0,
- "page_name" => CALENDAR_ALL_MEMBERS_LANG,
- "thread_num" => 0,
- "space_type" => _SPACE_TYPE_UNDEFINED,
- "private_flag" => _OFF,
- "authority_id" => $this->_session->getParameter("_user_auth_id")
- );
- }
+ $user_id = $this->_session->getParameter("_user_id");
+
+ $room_arr = $this->_request->getParameter("room_arr");
+ if (!empty($user_id)) {
+ $room_arr[0][0][0] = array(
+ "page_id" => CALENDAR_ALL_MEMBERS_ID,
+ "parent_id" => 0,
+ "page_name" => CALENDAR_ALL_MEMBERS_LANG,
+ "thread_num" => 0,
+ "space_type" => _SPACE_TYPE_UNDEFINED,
+ "private_flag" => _OFF,
+ "authority_id" => $this->_session->getParameter("_user_auth_id")
+ );
+ }
$thread_num = 0;
$parent_id = 0;
- $getdata =& $this->_container->getComponent("GetData");
+ $getdata =& $this->_container->getComponent("GetData");
$pages = $getdata->getParameter("pages");
$actionChain =& $this->_container->getComponent("ActionChain");
@@ -1254,12 +1254,11 @@ function &getSelectRoomList()
"not_enroll_room_arr" => array(),
"room_arr" => $room_arr,
"calendar_block" => $calendar_block,
- "_page" => $pages[$this->_session->getParameter("_main_page_id")],
"private_room_id_arr" => array(),
"action_name" => $actionChain->getCurActionName()
);
- $sess_enroll_room = $this->_session->getParameter(array("calendar", "enroll_room", $calendar_block["block_id"]));
+ $sess_enroll_room = $this->_session->getParameter(array("calendar", "enroll_room", $calendar_block["block_id"]));
foreach ($result_params["room_arr"][$thread_num][$parent_id] as $disp => $room) {
if ($room["space_type"] == _SPACE_TYPE_GROUP && $room["private_flag"] == _ON) {
if ($result_params["calendar_block"]["myroom_flag"] == _ON) {
From d21ab2215b40ad0c036487744f6a19137ca36125 Mon Sep 17 00:00:00 2001
From: kteraguchi
Date: Tue, 16 Apr 2013 15:49:18 +0900
Subject: [PATCH 26/39] =?UTF-8?q?#55=20=E3=83=AA=E3=82=B9=E3=83=88?=
=?UTF-8?q?=E3=82=A2=E6=99=82=E3=80=81id=E3=81=8C=E9=81=A9=E5=88=87?=
=?UTF-8?q?=E3=81=AB=E8=A8=AD=E5=AE=9A=E3=81=95=E3=82=8C=E3=82=8B=E3=82=88?=
=?UTF-8?q?=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
html/webapp/modules/chat/install.ini | 1 -
html/webapp/modules/circular/install.ini | 1 +
html/webapp/modules/multidatabase/install.ini | 1 +
html/webapp/modules/registration/install.ini | 3 ++-
4 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/html/webapp/modules/chat/install.ini b/html/webapp/modules/chat/install.ini
index 5873bcf..171ba0b 100644
--- a/html/webapp/modules/chat/install.ini
+++ b/html/webapp/modules/chat/install.ini
@@ -15,7 +15,6 @@ display_type = "_OFF"
line_num = "30"
[Restore]
-chat_id =
block_id = core.block_id
room_id = core.page_id
diff --git a/html/webapp/modules/circular/install.ini b/html/webapp/modules/circular/install.ini
index 3ad17d4..fa99f01 100644
--- a/html/webapp/modules/circular/install.ini
+++ b/html/webapp/modules/circular/install.ini
@@ -26,3 +26,4 @@ circular_id =
circular.circular_body = wysiwyg.upload_id
circular_choice.choice_id =
circular_postscript.postscript_id =
+circular_postscript.postscript_value = wysiwyg.upload_id
diff --git a/html/webapp/modules/multidatabase/install.ini b/html/webapp/modules/multidatabase/install.ini
index 2c6db68..5b0a366 100644
--- a/html/webapp/modules/multidatabase/install.ini
+++ b/html/webapp/modules/multidatabase/install.ini
@@ -33,6 +33,7 @@ room_id = core.page_id
content_id =
comment_id =
metadata_id =
+title_metadata_id = metadata_id
metadata_content_id =
multidatabase_metadata_content.content=wysiwyg.upload_id
multidatabase_metadata_content.content = text.upload_id
diff --git a/html/webapp/modules/registration/install.ini b/html/webapp/modules/registration/install.ini
index 5d75619..5e2053a 100644
--- a/html/webapp/modules/registration/install.ini
+++ b/html/webapp/modules/registration/install.ini
@@ -37,7 +37,8 @@ room_id = core.page_id
item_id =
data_id =
item_data_id =
-registration_item_data.item_data_value=wysiwyg.upload_id
+upload_id = core.upload_id
+registration_item_data.item_data_value = text.upload_id
[Operation]
select_sql = "SELECT {registration}.registration_id,{registration}.registration_name FROM {registration_block},{registration} WHERE {registration_block}.registration_id = {registration}.registration_id AND {registration_block}.block_id = ?"
From e2643f7e5dd186cf4148e73172922d894e2acefc Mon Sep 17 00:00:00 2001
From: kteraguchi
Date: Tue, 16 Apr 2013 16:06:22 +0900
Subject: [PATCH 27/39] =?UTF-8?q?#56=20room=5Fid=E3=82=92=E6=9B=B4?=
=?UTF-8?q?=E6=96=B0=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE?=
=?UTF-8?q?=E6=AD=A3=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../reservation/components/Action.class.php | 3 ++-
.../reservation/update/Update.class.php | 27 +++++++++++++++++++
2 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/html/webapp/modules/reservation/components/Action.class.php b/html/webapp/modules/reservation/components/Action.class.php
index 9513279..c083842 100644
--- a/html/webapp/modules/reservation/components/Action.class.php
+++ b/html/webapp/modules/reservation/components/Action.class.php
@@ -1021,7 +1021,8 @@ function updateReserve()
$details_params = array(
"contact" => $this->_request->getParameter("contact"),
"description" => $description,
- "rrule" => $rrule_str
+ "rrule" => $rrule_str,
+ 'room_id' => $reserve_room_id
);
if ($edit_rrule == RESERVATION_RESERVE_EDIT_ALL) {
diff --git a/html/webapp/modules/reservation/update/Update.class.php b/html/webapp/modules/reservation/update/Update.class.php
index c553678..2f47175 100644
--- a/html/webapp/modules/reservation/update/Update.class.php
+++ b/html/webapp/modules/reservation/update/Update.class.php
@@ -190,6 +190,33 @@ function execute()
$result = $this->db->execute($sql);
if($result === false) return false;
}
+
+ $sql = "SELECT RD.reserve_details_id, "
+ . "R.room_id "
+ . "FROM {reservation_reserve_details} RD "
+ . "LEFT JOIN {reservation_reserve} R "
+ . "ON RD.reserve_details_id = R.reserve_details_id "
+ . "WHERE R.room_id != RD.room_id "
+ . "OR R.room_id IS NULL "
+ . "GROUP BY RD.reserve_details_id";
+ $reserves = $this->db->execute($sql);
+ foreach ($reserves as $reserve) {
+ $whereArray = array(
+ 'reserve_details_id' => $reserve['reserve_details_id']
+ );
+ if (isset($reserve['room_id'])) {
+ $updateColumns = array(
+ 'room_id' => $reserve['room_id']
+ );
+ $result = $this->db->updateExecute('reservation_reserve_details', $updateColumns, $whereArray, false);
+ } else {
+ $result = $this->db->deleteExecute('reservation_reserve_details', $whereArray);
+ }
+ if ($result === false) {
+ return false;
+ }
+ }
+
return true;
}
}
From 92a0532737da2ffa411157b680d4e6b5e086334b Mon Sep 17 00:00:00 2001
From: kteraguchi
Date: Fri, 19 Apr 2013 17:57:25 +0900
Subject: [PATCH 28/39] =?UTF-8?q?#16=20#23=20=E3=83=8F=E3=83=B3=E3=83=89?=
=?UTF-8?q?=E3=83=AB=E5=90=8D=E3=82=82=E6=94=B9=E8=A1=8C=E3=81=95=E3=82=8C?=
=?UTF-8?q?=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?=
=?UTF-8?q?=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
html/webapp/modules/journal/files/css/default/style.css | 1 -
html/webapp/modules/whatsnew/files/css/default/style.css | 2 --
2 files changed, 3 deletions(-)
diff --git a/html/webapp/modules/journal/files/css/default/style.css b/html/webapp/modules/journal/files/css/default/style.css
index 6ca6cd2..ede713e 100644
--- a/html/webapp/modules/journal/files/css/default/style.css
+++ b/html/webapp/modules/journal/files/css/default/style.css
@@ -55,7 +55,6 @@
border-left:medium none;
padding-left:30px;
text-align:right;
- white-space:nowrap;
}
.journal_list_bottom {
diff --git a/html/webapp/modules/whatsnew/files/css/default/style.css b/html/webapp/modules/whatsnew/files/css/default/style.css
index 2d8f1ac..bd99cb7 100644
--- a/html/webapp/modules/whatsnew/files/css/default/style.css
+++ b/html/webapp/modules/whatsnew/files/css/default/style.css
@@ -17,9 +17,7 @@ tr.whatsnew_read td a{
.whatsnew_user_name {
font-size:85%;
text-align:right;
- white-space:nowrap;
padding:2px 5px 3px 5px;
- white-space:nowrap;
}
.whatsnew_module {
font-size:85%;
From 924e5ff6ec010f65755982efc7bf62101222af97 Mon Sep 17 00:00:00 2001
From: kteraguchi
Date: Mon, 22 Apr 2013 18:29:56 +0900
Subject: [PATCH 29/39] =?UTF-8?q?#36=20#41=20=E3=81=A4=E3=81=84=E3=81=A7?=
=?UTF-8?q?=E3=81=AB=E6=9C=AB=E5=B0=BE=E3=81=AE=E3=82=B9=E3=83=9A=E3=83=BC?=
=?UTF-8?q?=E3=82=B9=E3=82=92=E9=99=A4=E5=8E=BB=E3=80=82=EF=BC=88Reseachma?=
=?UTF-8?q?p=E3=82=BD=E3=83=BC=E3=82=B9=E3=81=A8=E5=90=88=E3=82=8F?=
=?UTF-8?q?=E3=81=9B=E3=81=BE=E3=81=97=E3=81=9F=E3=80=82=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
html/webapp/modules/system/language/english/main.ini | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/html/webapp/modules/system/language/english/main.ini b/html/webapp/modules/system/language/english/main.ini
index debac24..8296797 100644
--- a/html/webapp/modules/system/language/english/main.ini
+++ b/html/webapp/modules/system/language/english/main.ini
@@ -81,13 +81,13 @@ system_proxy_pass = "Proxy password"
system_proxy_pass_note = "If your proxy server needs BASIC authentication, set the password. Else, leave blank"
system_use_permalink_title="Permalink Setting"
system_use_permalink="Use the permalink"
-system_use_permalink_note = "During initial setting, URLs with many parameters are used, but permanent links can also be created. To enable setting, it is necessary to enable .htaccess in Apache. Under htdocs `.htaccess` will be automatically created."
+system_use_permalink_note = "During initial setting, URLs with many parameters are used, but permanent links can also be created. To enable setting, it is necessary to enable .htaccess in Apache. Under htdocs `.htaccess` will be automatically created."
system_ldap_title = "LDAP Certification"
system_ldap_uses = "Use the LDAP"
system_ldap_server = "LDAP Host"
system_ldap_server_note = "Please input the LDAP host's name or IP address."
system_ldap_domain = "Domain"
-system_ldap_domain_note = "Please input the Domain's name or RDN(Relative Distinguished Name)."
+system_ldap_domain_note = "Please input the Domain's name or RDN(Relative Distinguished Name)."
[System_View_Main_Mail]
system_mail_from = "FROM address"
From 45e7ea60b8fa013dd8e8ae4d5334f7ed2ca1893f Mon Sep 17 00:00:00 2001
From: kteraguchi
Date: Tue, 23 Apr 2013 15:54:44 +0900
Subject: [PATCH 30/39] =?UTF-8?q?#24=20#25=20=E3=81=A4=E3=81=84=E3=81=A7?=
=?UTF-8?q?=E3=81=AB=E4=B8=8D=E8=A6=81=E5=AE=9A=E7=BE=A9=E3=82=92=E5=89=8A?=
=?UTF-8?q?=E9=99=A4=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
html/webapp/style/css/page_style.css | 4 ----
1 file changed, 4 deletions(-)
diff --git a/html/webapp/style/css/page_style.css b/html/webapp/style/css/page_style.css
index c991f20..0f57952 100644
--- a/html/webapp/style/css/page_style.css
+++ b/html/webapp/style/css/page_style.css
@@ -163,8 +163,4 @@ div#centercolumn_inf_mes {
div#centercolumn_inf_mes div {
padding:3px;
-}
-
-div.centercolumn_active_center {
- padding:8px 15px;
}
\ No newline at end of file
From 5a0e61ed662c038aee13c6fe998fdd2d7aea7389 Mon Sep 17 00:00:00 2001
From: kteraguchi
Date: Wed, 24 Apr 2013 12:03:35 +0900
Subject: [PATCH 31/39] =?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=E3=81=A7=E6=BC=8F=E3=82=8C=E3=81=A6?=
=?UTF-8?q?=E3=81=9F=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92=E8=BF=BD?=
=?UTF-8?q?=E5=8A=A0=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
html/webapp/language/chinese/lang_common.js | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/html/webapp/language/chinese/lang_common.js b/html/webapp/language/chinese/lang_common.js
index 17c9f75..57bfcdf 100644
--- a/html/webapp/language/chinese/lang_common.js
+++ b/html/webapp/language/chinese/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 = {
From 87994f105e7aff91f38ed569183e18f9c28d69a5 Mon Sep 17 00:00:00 2001
From: kteraguchi
Date: Thu, 25 Apr 2013 15:59:10 +0900
Subject: [PATCH 32/39] =?UTF-8?q?#57=20NC2.4.0.0=E3=81=AE=E4=BF=AE?=
=?UTF-8?q?=E6=AD=A3=E3=81=A7=E3=80=81=E6=B6=88=E3=81=88=E3=81=A6=E3=81=97?=
=?UTF-8?q?=E3=81=BE=E3=81=A3=E3=81=9F=E6=8A=95=E7=A5=A8=E9=A0=86=E3=82=BD?=
=?UTF-8?q?=E3=83=BC=E3=83=88=E5=87=A6=E7=90=86=E3=82=92=E6=88=BB=E3=81=97?=
=?UTF-8?q?=E3=81=9F=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../multidatabase/view/main/search/result/Result.class.php | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/html/webapp/modules/multidatabase/view/main/search/result/Result.class.php b/html/webapp/modules/multidatabase/view/main/search/result/Result.class.php
index 7842357..60d4a3e 100644
--- a/html/webapp/modules/multidatabase/view/main/search/result/Result.class.php
+++ b/html/webapp/modules/multidatabase/view/main/search/result/Result.class.php
@@ -199,6 +199,11 @@ function execute()
$order_params = array(
"{multidatabase_content}.insert_time" => "ASC"
);
+ }else if($this->sort_metadata == MULTIDATABASE_DEFAULT_VOTE_SORT) {
+ $order_params = array(
+ "{multidatabase_content}.vote_count" => "DESC",
+ "{multidatabase_content}.insert_time" => "DESC"
+ );
}else if(isset($this->sort_metadatas[$this->sort_metadata]) && ($this->sort_metadatas[$this->sort_metadata]["type"] == MULTIDATABASE_META_TYPE_FILE || $this->sort_metadatas[$this->sort_metadata]["type"] == MULTIDATABASE_META_TYPE_IMAGE)) {
$order_params = array(
"F".$this->sort_metadata.".file_name" => "ASC",
From 56e99a1a517c6d1ed20727ce94bc14cf224240ec Mon Sep 17 00:00:00 2001
From: kteraguchi
Date: Fri, 26 Apr 2013 11:57:57 +0900
Subject: [PATCH 33/39] =?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=E3=81=A7=E3=80=81=E3=83=A1=E3=83=BC?=
=?UTF-8?q?=E3=83=AB=E3=82=A2=E3=83=89=E3=83=AC=E3=82=B9=E3=83=81=E3=82=A7?=
=?UTF-8?q?=E3=83=83=E3=82=AF=E5=87=A6=E7=90=86=E3=81=AE=E5=85=B1=E9=80=9A?=
=?UTF-8?q?=E5=8C=96=E3=82=92=E3=81=97=E3=81=9F=E9=9A=9B=E3=81=AB=E3=80=81?=
=?UTF-8?q?Notice=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=8C=E7=99=BA=E7=94=9F?=
=?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=AA=E3=81=A3?=
=?UTF-8?q?=E3=81=9F=E3=83=90=E3=82=B0=E3=82=92=E4=BF=AE=E6=AD=A3=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../modules/login/validator/Validator_ItemsInputs.class.php | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/html/webapp/modules/login/validator/Validator_ItemsInputs.class.php b/html/webapp/modules/login/validator/Validator_ItemsInputs.class.php
index 1db03d2..335733c 100644
--- a/html/webapp/modules/login/validator/Validator_ItemsInputs.class.php
+++ b/html/webapp/modules/login/validator/Validator_ItemsInputs.class.php
@@ -55,15 +55,14 @@ function validate($attributes, $errStr, $params)
if($show_items === false) {
return $errStr;
}
- $autoregist_use_items = explode("|", $config['autoregist_use_items']['conf_value']);
- foreach($autoregist_use_items as $autoregist_use_item) {
+ $configs = explode("|", $config['autoregist_use_items']['conf_value']);
+ foreach($configs 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);
From 9a28aae626f55ad96be34148ec34131957c96139 Mon Sep 17 00:00:00 2001
From: kteraguchi
Date: Fri, 26 Apr 2013 15:54:52 +0900
Subject: [PATCH 34/39] =?UTF-8?q?Revert=20"=E6=96=87=E6=9B=B8=E5=9E=8B?=
=?UTF-8?q?=E5=AE=A3=E8=A8=80=E3=81=AE=E5=89=8D=E3=81=AE=E7=A9=BA=E8=A1=8C?=
=?UTF-8?q?=E3=82=92=E5=89=8A=E9=99=A4"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This reverts commit 2209bca239276af8eba71406b4cdb096455be759.
---
html/webapp/templates/main/header.html | 1 +
1 file changed, 1 insertion(+)
diff --git a/html/webapp/templates/main/header.html b/html/webapp/templates/main/header.html
index 0586369..9d61453 100644
--- a/html/webapp/templates/main/header.html
+++ b/html/webapp/templates/main/header.html
@@ -1,3 +1,4 @@
+
<{strip}>
From 69cd0a230a80a79d666d908e01cd2983247adb41 Mon Sep 17 00:00:00 2001
From: kteraguchi
Date: Fri, 26 Apr 2013 16:53:52 +0900
Subject: [PATCH 35/39] =?UTF-8?q?#9=20Eclipse=E9=96=8B=E7=99=BA=E7=94=A8?=
=?UTF-8?q?=E7=84=A1=E8=A6=96=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E5=AE=9A?=
=?UTF-8?q?=E7=BE=A9=E3=82=92=E8=BF=BD=E5=8A=A0=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.gitignore | 3 +++
1 file changed, 3 insertions(+)
diff --git a/.gitignore b/.gitignore
index fecf3e6..37ebe2d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,3 +18,6 @@
# C:\Github\NetCommons2 > git init .
# C:\Github\NetCommons2 > git checkout -b develop
# C:\Github\NetCommons2 [develop +0 ~1 -0]> git update-index --assume-unchanged html\webapp\config\install.inc.php
+
+# Eclipse開発用無視ファイル設定
+/.settings
From 5449470fbc4fd8fa3c2dc3c6cbe9316772e58e36 Mon Sep 17 00:00:00 2001
From: kteraguchi
Date: Fri, 10 May 2013 10:29:59 +0900
Subject: [PATCH 36/39] =?UTF-8?q?#9=20Eclipse=E9=96=8B=E7=99=BA=E7=94=A8?=
=?UTF-8?q?=E7=84=A1=E8=A6=96=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E5=AE=9A?=
=?UTF-8?q?=E7=BE=A9=E3=82=92=E5=86=8D=E8=BF=BD=E5=8A=A0=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.gitignore | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore
index 37ebe2d..71a9b13 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,9 @@
/html/images
/html/js
/html/themes
+/html/htdocs/images
+/html/htdocs/js
+/html/htdocs/themes
/html/webapp/templates_c/*
/html/webapp/uploads/*
@@ -20,4 +23,6 @@
# C:\Github\NetCommons2 [develop +0 ~1 -0]> git update-index --assume-unchanged html\webapp\config\install.inc.php
# Eclipse開発用無視ファイル設定
-/.settings
+/.settings
+/.buildpath
+/.project
From 8e9a658b75c34008a275b2f185275389102aae03 Mon Sep 17 00:00:00 2001
From: kteraguchi
Date: Fri, 10 May 2013 10:48:48 +0900
Subject: [PATCH 37/39] =?UTF-8?q?#60=20htdocs/index.php=E3=81=8C=E5=AD=98?=
=?UTF-8?q?=E5=9C=A8=E3=81=99=E3=82=8B=E5=A0=B4=E5=90=88=E3=80=81=E3=83=90?=
=?UTF-8?q?=E3=83=83=E3=82=AF=E3=82=A2=E3=83=83=E3=83=97=E5=AF=BE=E8=B1=A1?=
=?UTF-8?q?=E3=81=A8=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE?=
=?UTF-8?q?=E6=AD=A3=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
html/webapp/modules/backup/action/main/init/Init.class.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/html/webapp/modules/backup/action/main/init/Init.class.php b/html/webapp/modules/backup/action/main/init/Init.class.php
index 73008ff..5eb7e92 100644
--- a/html/webapp/modules/backup/action/main/init/Init.class.php
+++ b/html/webapp/modules/backup/action/main/init/Init.class.php
@@ -249,7 +249,7 @@ function _fullBackUp()
$archiveDir = (isset($startIndexDirs[0])) ? $archiveBaseDir . implode('/', $startIndexDirs) : substr($archiveBaseDir, 0, strlen($archiveBaseDir) - 1);
$this->_readStartFile($source, START_INDEX_DIR, $archiveDir);
- if(file_exists(dirname(START_INDEX_DIR) . INDEX_FILE_NAME)) {
+ if (file_exists(dirname(START_INDEX_DIR) . INDEX_FILE_NAME)) {
$handle = fopen(dirname(START_INDEX_DIR) . INDEX_FILE_NAME, "r");
if ($handle) {
$contents = fread($handle, 94);
@@ -258,7 +258,7 @@ function _fullBackUp()
$source[] = File_Archive::read(dirname(START_INDEX_DIR) . INDEX_FILE_NAME, dirname($archiveDir) . INDEX_FILE_NAME);
}
}
- } else {
+ } elseif (file_exists(START_INDEX_DIR . '/htdocs' . INDEX_FILE_NAME)) {
$source[] = File_Archive::read(START_INDEX_DIR . '/htdocs' . INDEX_FILE_NAME, $archiveDir . '/htdocs' . INDEX_FILE_NAME);
}
From c7171437da4d220a71358016f3100d42b02cede8 Mon Sep 17 00:00:00 2001
From: kteraguchi
Date: Fri, 17 May 2013 16:47:26 +0900
Subject: [PATCH 38/39] =?UTF-8?q?=E5=A4=89=E6=9B=B4=E5=B1=A5=E6=AD=B4?=
=?UTF-8?q?=E3=81=AE=E8=BF=BD=E8=A8=98=E3=80=81=E3=81=8A=E3=82=88=E3=81=B3?=
=?UTF-8?q?=E3=80=81=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E5=AE=9A?=
=?UTF-8?q?=E7=BE=A9=E3=81=AE=E5=A4=89=E6=9B=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/CHANGES.txt | 68 +++++++++++++++++++
html/webapp/config/version.php | 2 +-
html/webapp/modules/authority/install.ini | 2 +-
html/webapp/modules/backup/install.ini | 2 +-
html/webapp/modules/bbs/install.ini | 2 +-
html/webapp/modules/calendar/install.ini | 2 +-
html/webapp/modules/chat/install.ini | 2 +-
html/webapp/modules/circular/install.ini | 2 +-
html/webapp/modules/journal/install.ini | 2 +-
html/webapp/modules/linklist/install.ini | 2 +-
html/webapp/modules/login/install.ini | 2 +-
html/webapp/modules/menu/install.ini | 2 +-
html/webapp/modules/module/install.ini | 2 +-
html/webapp/modules/multidatabase/install.ini | 2 +-
html/webapp/modules/photoalbum/install.ini | 2 +-
html/webapp/modules/pm/install.ini | 2 +-
html/webapp/modules/registration/install.ini | 2 +-
html/webapp/modules/reservation/install.ini | 2 +-
html/webapp/modules/room/install.ini | 2 +-
html/webapp/modules/rss/install.ini | 2 +-
html/webapp/modules/system/install.ini | 2 +-
html/webapp/modules/user/install.ini | 2 +-
html/webapp/modules/whatsnew/install.ini | 2 +-
23 files changed, 90 insertions(+), 22 deletions(-)
diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt
index 01e9dcc..f8888ac 100644
--- a/docs/CHANGES.txt
+++ b/docs/CHANGES.txt
@@ -1,6 +1,74 @@
NetComomns2 Changelog
===============================
+2013/05/20: Version 2.4.1.0
+===============================
+- 会員の新規申込みで複数選択項目があった場合、その項目を条件とした会員検索にヒットしないバグを修正
+- 会員項目で英語表記の一部を先頭大文字に修正
+- 会員検索でルームに参加していない会員が正しくヒットしないバグを修正
+- 権限管理で不要な定義を削除
+- ページデータの削除処理を共通化
+- パブリックスペースで主坦権限であるユーザーがページ追加できないバグを修正
+- バックアップでhtdocs/index.phpが存在しない場合、フルバックアップができないバグを修正
+- バックアップのルームリストアでアップロードファイルの削除処理を修正
+- システム管理でJavaScript,CSS,gzipの表記を修正
+- モバイル管理の表示メニュー設定に対象外のページが表示されてしまうバグを修正
+- モバイル管理でルーム別メニュー表示をしないに設定した場合、ルームが表示されないことがあるバグを修正
+- スマートフォンでPC用画面に切り替える際に確認メッセージを表示するように修正
+- スマートフォンで機種によって横スクロールしていたが、しないように修正
+- スマートフォンで表示する場合、ページ内リンクのフラグメント(#)以降を削除する処理を追加
+- メールアドレス検索処理の修正、および、共通化
+- カレンダーコンポーネントで月表示の英語表記を修正
+‐ WYSIWYGエディタの画像挿入時に画像サイズ「大・中・小」を選択できるように修正
+‐ WYSIWYGエディタでliタグのvalueが認識されないバグを修正
+‐ WYSIWYGエディタでリンク挿入の英語文言を一部修正
+- 共通定義の文言を一部修正
+- ファイルのダウンロード処理で1Mbyteごとにflushするように修正
+- 固定リンクの使用禁止文字を追加
+- 読み上げソフト用画面をキャンセルする処理を修正
+- インストール後のWelcome文章を修正
+- フッターにある著作権表示の内側余白を修正
+- generatorでDEPRECATEDエラーを抑制する処理を追加
+- システムカラーの定義を6桁のカラーコードに修正
+- ログインで定数を使うように修正
+- お知らせで携帯表示にあるtext/html切替リンクの表示処理を修正
+- 掲示板でフィーチャーフォンのスレッド表示が正しく表示されないバグを修正
+- カレンダーで新着からのリンク先が削除されていた場合、Noticeエラーが発生するバグを修正
+- チャットのデータがNC1からの移行データだった場合、IDが重複してしまうことがあるバグを修正
+- チャットでルームのリストア時にIDが重複してしまうバグを修正
+- 回覧板の追記をWYSIWYGエディタに変更
+- 回覧板で追記のメール件名を入力できるように修正
+- 日誌で同一日付の記事が合った場合、次の記事、前の記事のリンク先が正しくないバグを修正
+- 日誌で携帯版の新着にあるリンク先がコメント画面になってしまうバグを修正
+- 日誌で長いタイトルは改行するように修正
+- リンクリストで表示方法選択がドロップダウンの場合は説明付きチェックボックスを使用不可になるように修正
+- リンクリストでhttpsでも画像が表示するように修正
+- 汎用データベースで項目属性の変更による既存コンテンツ更新処理のバグを修正
+- 汎用データベースで表示直後に改ページが動作しないバグを修正
+- 汎用データベースで検索結果を投票順でソートするとエラーが発生するバグを修正
+- 汎用データベースでルームのリストア時にタイトルメタデータIDが変更されないバグを修正
+- 汎用データベースの表示方法変更画面で登録した表示件数、表示順が表示されるように修正
+- フォトアルバムで選択中のアルバムが削除された場合に表示されるメッセージを修正
+- フォトアルバムで写真画面の幅を大きくするように修正
+- フォトアルバムでスマートフォンの写真一覧画面にある改ページ処理を修正
+- プライベートメッセージの宛先検索でMySQLのバージョンによってエラーが発生するバグを修正
+- プライベートメッセージでグループルームがない場合、宛先の検索がヒットしないバグを修正
+- プライベートメッセージの英語文言を一部修正
+- 登録フォームで入力必須の項目に「0」が登録できないバグを修正
+- 施設予約で利用するグループを変更しても、施設詳細のルームIDが更新されないバグを修正
+- 施設予約のルーム選択リストからパブリックスペース、および、パブリックルームを選択できるように修正
+- 施設予約で登録者を正しく表示するように修正
+- 施設予約の個人的な予約で会員の権限、ルームでの権限を選択できるように修正
+- 施設予約で15分未満の予約をした際に、表示されるメッセージを修正
+- 施設予約の日表示で予約登録画面を開いた場合、選択していたカテゴリを表示するように修正
+- 施設予約で最初に表示する施設を削除すると、Noticeエラーが発生するバグを修正
+- RSSの対象がAtom形式で1件の場合表示されないバグを修正
+- RSSで概要、内容が表示されないことがあるバグを修正
+- 新着情報で古いデータの削除処理を修正
+- 新着情報で長いタイトルは改行するように修正
+
+
+
2012/03/27: Version 2.4.0.0
===============================
- スマートフォン対応、および、フィーチャーフォンのデザイン改修
diff --git a/html/webapp/config/version.php b/html/webapp/config/version.php
index 90797dc..c35760a 100644
--- a/html/webapp/config/version.php
+++ b/html/webapp/config/version.php
@@ -1,4 +1,4 @@
\ No newline at end of file
diff --git a/html/webapp/modules/authority/install.ini b/html/webapp/modules/authority/install.ini
index f713dcb..c122020 100644
--- a/html/webapp/modules/authority/install.ini
+++ b/html/webapp/modules/authority/install.ini
@@ -1,4 +1,4 @@
-version = "2.4.0.0"
+version = "2.4.0.1"
action_name="authority_view_admin_init"
module_icon="authority.gif"
system_flag=1
diff --git a/html/webapp/modules/backup/install.ini b/html/webapp/modules/backup/install.ini
index 32a314e..90f8a1b 100644
--- a/html/webapp/modules/backup/install.ini
+++ b/html/webapp/modules/backup/install.ini
@@ -1,4 +1,4 @@
-version = "2.4.0.0"
+version = "2.4.0.1"
action_name="backup_view_main_init"
module_icon="backup.gif"
system_flag=1
diff --git a/html/webapp/modules/bbs/install.ini b/html/webapp/modules/bbs/install.ini
index 3a06a45..4f27b34 100644
--- a/html/webapp/modules/bbs/install.ini
+++ b/html/webapp/modules/bbs/install.ini
@@ -1,4 +1,4 @@
-version = "2.4.0.0"
+version = "2.4.0.1"
action_name = "bbs_view_main_init"
edit_action_name = "bbs_view_edit_list"
search_action = "bbs_view_admin_search"
diff --git a/html/webapp/modules/calendar/install.ini b/html/webapp/modules/calendar/install.ini
index 6584a90..c43cbfe 100644
--- a/html/webapp/modules/calendar/install.ini
+++ b/html/webapp/modules/calendar/install.ini
@@ -1,4 +1,4 @@
-version = "2.4.0.0"
+version = "2.4.0.1"
action_name="calendar_view_main_init"
edit_action_name="calendar_view_edit_init"
search_action = "calendar_view_admin_search"
diff --git a/html/webapp/modules/chat/install.ini b/html/webapp/modules/chat/install.ini
index 171ba0b..5ed9258 100644
--- a/html/webapp/modules/chat/install.ini
+++ b/html/webapp/modules/chat/install.ini
@@ -1,4 +1,4 @@
-version = "2.4.0.0"
+version = "2.4.0.1"
action_name="chat_view_main_init"
edit_action_name = "chat_view_edit_init"
block_add_action = "chat_action_edit_create"
diff --git a/html/webapp/modules/circular/install.ini b/html/webapp/modules/circular/install.ini
index fa99f01..8f51fda 100644
--- a/html/webapp/modules/circular/install.ini
+++ b/html/webapp/modules/circular/install.ini
@@ -1,4 +1,4 @@
-version = "2.4.0.0"
+version = "2.4.0.1"
action_name = "circular_view_main_init"
edit_action_name = "circular_view_edit_option"
search_action = "circular_view_admin_search"
diff --git a/html/webapp/modules/journal/install.ini b/html/webapp/modules/journal/install.ini
index 33f46a0..5453878 100644
--- a/html/webapp/modules/journal/install.ini
+++ b/html/webapp/modules/journal/install.ini
@@ -1,4 +1,4 @@
-version = "2.4.0.0"
+version = "2.4.0.1"
action_name="journal_view_main_init"
edit_action_name="journal_view_edit_list"
block_add_action="journal_view_edit_create"
diff --git a/html/webapp/modules/linklist/install.ini b/html/webapp/modules/linklist/install.ini
index 637ad0e..11aa85e 100644
--- a/html/webapp/modules/linklist/install.ini
+++ b/html/webapp/modules/linklist/install.ini
@@ -1,4 +1,4 @@
-version = "2.4.0.0"
+version = "2.4.0.1"
action_name = "linklist_view_main_init"
edit_action_name = "linklist_view_edit_list"
block_add_action = "linklist_view_edit_entry"
diff --git a/html/webapp/modules/login/install.ini b/html/webapp/modules/login/install.ini
index 496ea5b..763f7ac 100644
--- a/html/webapp/modules/login/install.ini
+++ b/html/webapp/modules/login/install.ini
@@ -1,4 +1,4 @@
-version = "2.4.0.0"
+version = "2.4.0.1"
action_name="login_view_main_init"
[Mobile]
diff --git a/html/webapp/modules/menu/install.ini b/html/webapp/modules/menu/install.ini
index 3254baa..8b854d0 100644
--- a/html/webapp/modules/menu/install.ini
+++ b/html/webapp/modules/menu/install.ini
@@ -1,4 +1,4 @@
-version = "2.4.0.0"
+version = "2.4.0.1"
action_name="menu_view_main_init"
edit_action_name="menu_view_edit_init"
block_delete_action="auto"
diff --git a/html/webapp/modules/module/install.ini b/html/webapp/modules/module/install.ini
index 41052df..645a691 100644
--- a/html/webapp/modules/module/install.ini
+++ b/html/webapp/modules/module/install.ini
@@ -1,4 +1,4 @@
-version = "2.4.0.0"
+version = "2.4.0.1"
action_name = "module_view_admin_init"
system_flag=1
;disposition_flag=1
diff --git a/html/webapp/modules/multidatabase/install.ini b/html/webapp/modules/multidatabase/install.ini
index 5b0a366..5ce72ac 100644
--- a/html/webapp/modules/multidatabase/install.ini
+++ b/html/webapp/modules/multidatabase/install.ini
@@ -1,4 +1,4 @@
-version = "2.4.0.0"
+version = "2.4.0.1"
action_name="multidatabase_view_main_init"
edit_action_name="multidatabase_view_edit_list"
block_add_action="multidatabase_view_edit_create"
diff --git a/html/webapp/modules/photoalbum/install.ini b/html/webapp/modules/photoalbum/install.ini
index dc46f80..490c407 100644
--- a/html/webapp/modules/photoalbum/install.ini
+++ b/html/webapp/modules/photoalbum/install.ini
@@ -1,4 +1,4 @@
-version = "2.4.0.0"
+version = "2.4.0.1"
action_name = "photoalbum_view_main_init"
edit_action_name = "photoalbum_view_edit_list"
block_add_action = "photoalbum_view_edit_entry"
diff --git a/html/webapp/modules/pm/install.ini b/html/webapp/modules/pm/install.ini
index 2b6e8bb..77b0246 100644
--- a/html/webapp/modules/pm/install.ini
+++ b/html/webapp/modules/pm/install.ini
@@ -1,4 +1,4 @@
-version = "2.4.0.0"
+version = "2.4.0.1"
action_name="pm_view_main_init"
delete_action = "pm_action_admin_operation"
module_update_action="pm_update"
diff --git a/html/webapp/modules/registration/install.ini b/html/webapp/modules/registration/install.ini
index 5e2053a..8717f19 100644
--- a/html/webapp/modules/registration/install.ini
+++ b/html/webapp/modules/registration/install.ini
@@ -1,4 +1,4 @@
-version = "2.4.0.0"
+version = "2.4.0.1"
action_name="registration_view_main_init"
edit_action_name="registration_view_edit_registration_list"
block_add_action="registration_view_edit_registration_entry"
diff --git a/html/webapp/modules/reservation/install.ini b/html/webapp/modules/reservation/install.ini
index 4774daf..f5fec1c 100644
--- a/html/webapp/modules/reservation/install.ini
+++ b/html/webapp/modules/reservation/install.ini
@@ -1,4 +1,4 @@
-version = "2.4.0.0"
+version = "2.4.1.0"
action_name = "reservation_view_main_init"
edit_action_name = "reservation_view_edit_style_init"
block_add_action = "reservation_action_edit_addblock"
diff --git a/html/webapp/modules/room/install.ini b/html/webapp/modules/room/install.ini
index c073806..7cc88f5 100644
--- a/html/webapp/modules/room/install.ini
+++ b/html/webapp/modules/room/install.ini
@@ -1,4 +1,4 @@
-version = "2.4.0.0"
+version = "2.4.0.1"
action_name="room_view_admin_init"
module_icon="room.gif"
system_flag=1
diff --git a/html/webapp/modules/rss/install.ini b/html/webapp/modules/rss/install.ini
index 45c6af7..421cdba 100644
--- a/html/webapp/modules/rss/install.ini
+++ b/html/webapp/modules/rss/install.ini
@@ -1,4 +1,4 @@
-version = "2.4.0.0"
+version = "2.4.0.1"
action_name = "rss_view_main_init"
edit_action_name = "rss_view_edit_init"
block_delete_action = "auto"
diff --git a/html/webapp/modules/system/install.ini b/html/webapp/modules/system/install.ini
index beade5f..17eb963 100644
--- a/html/webapp/modules/system/install.ini
+++ b/html/webapp/modules/system/install.ini
@@ -1,4 +1,4 @@
-version = "2.4.0.0"
+version = "2.4.0.1"
action_name="system_view_main_general"
system_flag=1
module_icon=system.gif
diff --git a/html/webapp/modules/user/install.ini b/html/webapp/modules/user/install.ini
index 0963e07..a1b5f2c 100644
--- a/html/webapp/modules/user/install.ini
+++ b/html/webapp/modules/user/install.ini
@@ -1,4 +1,4 @@
-version = "2.4.0.0"
+version = "2.4.0.1"
action_name="user_view_main_search"
system_flag=1
module_icon="user.gif"
diff --git a/html/webapp/modules/whatsnew/install.ini b/html/webapp/modules/whatsnew/install.ini
index 6052a04..9228ecf 100644
--- a/html/webapp/modules/whatsnew/install.ini
+++ b/html/webapp/modules/whatsnew/install.ini
@@ -1,4 +1,4 @@
-version = "2.4.0.0"
+version = "2.4.0.1"
action_name = "whatsnew_view_main_init"
edit_action_name = "whatsnew_view_edit_init"
block_add_action = "whatsnew_action_edit_addblock"
From ef06c473523038c97320e9b9ea2945999fb989ad Mon Sep 17 00:00:00 2001
From: "suehiro.hisayoshi"
Date: Tue, 21 May 2013 19:55:18 +0900
Subject: [PATCH 39/39] =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=83=87=E3=83=B3?=
=?UTF-8?q?=E3=83=88=E3=81=8C=E5=B4=A9=E3=82=8C=E3=81=A6=E3=81=84=E3=81=9F?=
=?UTF-8?q?=E3=81=AE=E3=81=A7=E3=83=87=E3=82=A3=E3=83=AC=E3=82=AF=E3=83=88?=
=?UTF-8?q?=E3=83=AA=E3=81=AE=E9=9B=B0=E5=9B=B2=E6=B0=97=E3=81=AB=E5=90=88?=
=?UTF-8?q?=E3=82=8F=E3=81=9B=E3=81=A6=E7=9B=B4=E3=81=97=E3=81=9F=E3=80=82?=
=?UTF-8?q?=20=E6=A9=9F=E8=83=BD=E3=82=84=E9=96=A2=E6=95=B0=E3=81=AE?=
=?UTF-8?q?=E5=AE=9F=E8=A3=85=E3=81=AB=E9=96=A2=E3=81=99=E3=82=8B=E4=BF=AE?=
=?UTF-8?q?=E6=AD=A3=E7=82=B9=E3=81=AF=E3=81=82=E3=82=8A=E3=81=BE=E3=81=9B?=
=?UTF-8?q?=E3=82=93?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../filter/Filter_RequestCheck.class.php | 174 +++++++++---------
1 file changed, 87 insertions(+), 87 deletions(-)
diff --git a/html/maple/filter/Filter_RequestCheck.class.php b/html/maple/filter/Filter_RequestCheck.class.php
index e1491ed..905a454 100644
--- a/html/maple/filter/Filter_RequestCheck.class.php
+++ b/html/maple/filter/Filter_RequestCheck.class.php
@@ -18,7 +18,7 @@
* @access public
*/
class Filter_RequestCheck extends Filter {
-
+
var $_container;
var $_log;
@@ -30,118 +30,118 @@ class Filter_RequestCheck extends Filter {
var $_request;
var $_className;
-
- /**
- * コンストラクター
- *
- * @access public
- */
- function Filter_RequestCheck() {
- parent::Filter();
- }
- /**
- * Viewの処理を実行
- *
- * @access public
- **/
- function execute() {
- $this->_container =& DIContainerFactory::getContainer();
+ /**
+ * コンストラクター
+ *
+ * @access public
+ */
+ function Filter_RequestCheck() {
+ parent::Filter();
+ }
+
+ /**
+ * Viewの処理を実行
+ *
+ * @access public
+ **/
+ function execute() {
+ $this->_container =& DIContainerFactory::getContainer();
$this->_log =& LogFactory::getLog();
$this->_filterChain =& $this->_container->getComponent("FilterChain");
$this->_actionChain =& $this->_container->getComponent("ActionChain");
$this->_request =& $this->_container->getComponent("Request");
-
+
$this->_className = get_class($this);
-
- $this->_prefilter();
-
+
+ $this->_prefilter();
+
$this->_log->trace("{$this->_className}の前処理が実行されました", "{$this->_className}#execute");
-
+
$this->_filterChain->execute();
$this->_postfilter();
$this->_log->trace("{$this->_className}の後処理が実行されました", "{$this->_className}#execute");
- }
-
- /**
+ }
+
+ /**
* プレフィルタ
* 初期処理を行う
* @access private
*/
function _prefilter()
{
- $errorList =& $this->_actionChain->getCurErrorList();
- if ($errorList->isExists()) {
- //既にエラーがあればそのまま返却
- return;
- }
- //アクション名取得
- $action_name = $this->_actionChain->getCurActionName();
- $pathList = explode("_", $action_name);
- $attributes = $this->getAttributes();
- if (isset($attributes["request"])) {
- if ($attributes["request"] == "BOTH" || $this->_request->getMethod() == $attributes["request"]) {
- //登録処理の場合、リファラチェック
- if ($this->_request->getMethod() == "POST" && $this->_refcheck()) {
- return;
- } else if($this->_request->getMethod() == "GET"){
- return;
- }
- }
- } else if ($this->_request->getMethod() == "POST" && isset($_FILES) && (0 < count($_FILES))) {
- //ファイルアップロード処理の場合、リファラチェック
- if ($this->_refcheck()) {
- return;
- }
- } else {
- //Default
- //system_view(action)_XXXX
- $i = 1;
- //if($pathList[1] == "system" && isset($pathList[2])) {
- // $i = 2;
- //}
- if($pathList[$i] != "action" && $pathList[$i] != "view") {
- //module名_action or module名_viewのどちらでもない場合、チェックしない
- return;
- }else if ($this->_request->getMethod() == "POST" && $pathList[$i] == "action") {
- //登録処理の場合、リファラチェック
- if (isset($attributes["refcheck"]) && $attributes["refcheck"] == "none") {
- return;
- }
- if ($this->_refcheck()) {
- return;
- }
- } else if($this->_request->getMethod() == "GET" && $pathList[$i] == "view"){
- return;
- }
- }
- //エラー
- $errorList->add("RquestCheck_Error", sprintf(_REQUESTCHECK_FAILURE,CURRENT_URL));
- $errorList->setType(VALIDATE_ERROR_TYPE); //VALIDATE_ERRORとする
- return;
-
+ $errorList =& $this->_actionChain->getCurErrorList();
+ if ($errorList->isExists()) {
+ //既にエラーがあればそのまま返却
+ return;
+ }
+ //アクション名取得
+ $action_name = $this->_actionChain->getCurActionName();
+ $pathList = explode("_", $action_name);
+ $attributes = $this->getAttributes();
+ if (isset($attributes["request"])) {
+ if ($attributes["request"] == "BOTH" || $this->_request->getMethod() == $attributes["request"]) {
+ //登録処理の場合、リファラチェック
+ if ($this->_request->getMethod() == "POST" && $this->_refcheck()) {
+ return;
+ } else if($this->_request->getMethod() == "GET"){
+ return;
+ }
+ }
+ } else if ($this->_request->getMethod() == "POST" && isset($_FILES) && (0 < count($_FILES))) {
+ //ファイルアップロード処理の場合、リファラチェック
+ if ($this->_refcheck()) {
+ return;
+ }
+ } else {
+ //Default
+ //system_view(action)_XXXX
+ $i = 1;
+ //if($pathList[1] == "system" && isset($pathList[2])) {
+ // $i = 2;
+ //}
+ if($pathList[$i] != "action" && $pathList[$i] != "view") {
+ //module名_action or module名_viewのどちらでもない場合、チェックしない
+ return;
+ }else if ($this->_request->getMethod() == "POST" && $pathList[$i] == "action") {
+ //登録処理の場合、リファラチェック
+ if (isset($attributes["refcheck"]) && $attributes["refcheck"] == "none") {
+ return;
+ }
+ if ($this->_refcheck()) {
+ return;
+ }
+ } else if($this->_request->getMethod() == "GET" && $pathList[$i] == "view"){
+ return;
+ }
+ }
+ //エラー
+ $errorList->add("RquestCheck_Error", sprintf(_REQUESTCHECK_FAILURE,CURRENT_URL));
+ $errorList->setType(VALIDATE_ERROR_TYPE); //VALIDATE_ERRORとする
+ return;
+
}
-
+
/**
* リファラチェック
* @access private
*/
function _refcheck()
{
- $ref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
- if ($ref != '' && strpos($ref, BASE_URL) === 0) {
- return true;
- }
- // httpsの場合
- $ssl_base_url = preg_replace("/^http:\/\//i","https://", BASE_URL);
- if ($ref != '' && strpos($ref, $ssl_base_url) === 0) {
- return true;
- }
- return false;
+ $ref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
+ if ($ref != '' && strpos($ref, BASE_URL) === 0) {
+ return true;
+ }
+ // httpsの場合
+ $ssl_base_url = preg_replace("/^http:\/\//i","https://", BASE_URL);
+ if ($ref != '' && strpos($ref, $ssl_base_url) === 0) {
+ return true;
+ }
+ return false;
}
-
+
/**
* ポストフィルタ
* @access private