From 3ad35562c4cf59418f3b99dbff62d370902a4e64 Mon Sep 17 00:00:00 2001 From: chaideqing Date: Fri, 31 Mar 2023 13:16:27 +0800 Subject: [PATCH 1/4] * Fix bug #33382. --- lib/feishuapi/feishuapi.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/feishuapi/feishuapi.class.php b/lib/feishuapi/feishuapi.class.php index e295dd12ea..89c84a3150 100644 --- a/lib/feishuapi/feishuapi.class.php +++ b/lib/feishuapi/feishuapi.class.php @@ -265,7 +265,7 @@ class feishuapi curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); - if($_SERVER['HTTPS'] != 'on') + if(!isset($_SERVER['HTTPS']) or $_SERVER['HTTPS'] != 'on') { curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); From 99f7f0254df6daec55f1532984cf5ac0a4b1ef95 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 4 Apr 2023 14:37:39 +0800 Subject: [PATCH 2/4] * Add mine doc data. --- module/doc/control.php | 37 ++++++++++++++++++++++++++---- module/doc/model.php | 6 ++--- module/doc/view/browse.html.php | 23 +++++++++++++++++++ module/doc/view/createlib.html.php | 2 +- 4 files changed, 59 insertions(+), 9 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index a681df9fd4..af8f38132e 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -79,6 +79,7 @@ class doc extends control $browseType = strtolower($browseType); $queryID = ($browseType == 'bysearch') ? (int)$param : 0; $moduleID = ($browseType == 'bymodule') ? (int)$param : 0; + $libID = ($browseType == 'bylib') ? (int)$param : 0; /* Set header and position. */ $this->view->title = $this->lang->doc->common; @@ -103,13 +104,22 @@ class doc extends control $this->app->rawMethod = 'recent'; } + $libs = $this->doc->getLibsByObject('mine', 0); + $libTree = $this->doc->getLibTree($libID, $libs, 'mine', 0); + $this->view->moduleID = $moduleID; $this->view->docs = $this->doc->getDocsByBrowseType($browseType, $queryID, $moduleID, $sort, $pager); $this->view->users = $this->user->getPairs('noletter'); $this->view->orderBy = $orderBy; $this->view->browseType = $browseType; $this->view->param = $param; + $this->view->libID = $libID; + $this->view->libTree = $libTree; $this->view->pager = $pager; + $this->view->type = 'mine'; + $this->view->objectID = 0; + $this->view->canExport = 0; + $this->view->libType = 'mine'; $this->display(); } @@ -126,7 +136,7 @@ class doc extends control { if(!empty($_POST)) { - $libID = $this->doc->createlib(); + $libID = $this->doc->createLib(); if(!dao::isError()) { if($type == 'project' and $this->post->project) $objectID = $this->post->project; @@ -167,21 +177,38 @@ class doc extends control if($execution->type == 'stage') $this->lang->doc->execution = str_replace($this->lang->executionCommon, $this->lang->project->stage, $this->lang->doc->execution); } - if($type == 'custom') unset($this->lang->doclib->aclList['default']); - if($type != 'custom') + $acl = 'default'; + if($type == 'custom') + { + $acl = 'open'; + unset($this->lang->doclib->aclList['default']); + } + elseif($type == 'mine') + { + $acl = 'private'; + unset($this->lang->doclib->aclList['open']); + unset($this->lang->doclib->aclList['default']); + $this->lang->doclib->aclList['private'] = $this->lang->doclib->aclListB['private']; + } + + if($type != 'custom' and $type != 'mine') { $this->lang->doclib->aclList['default'] = sprintf($this->lang->doclib->aclList['default'], $this->lang->{$type}->common); $this->lang->doclib->aclList['private'] = sprintf($this->lang->doclib->privateACL, $this->lang->{$type}->common); unset($this->lang->doclib->aclList['open']); } - $this->app->loadLang('api'); - $this->lang->api->aclList['default'] = sprintf($this->lang->api->aclList['default'], $this->lang->{$type}->common); + if($type != 'mine') + { + $this->app->loadLang('api'); + $this->lang->api->aclList['default'] = sprintf($this->lang->api->aclList['default'], $this->lang->{$type}->common); + } $this->view->groups = $this->loadModel('group')->getPairs(); $this->view->users = $this->user->getPairs('nocode|noclosed'); $this->view->objects = $objects; $this->view->type = $type; + $this->view->acl = $acl; $this->view->objectID = $objectID; $this->display(); } diff --git a/module/doc/model.php b/module/doc/model.php index 6948a52e0f..3ffe6134f6 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -1478,15 +1478,15 @@ class docModel extends model */ public function getLibsByObject($type, $objectID, $mode = '', $appendLib = 0) { - if($type == 'custom' or $type == 'book') + if($type == 'custom' or $type == 'book' or $type == 'mine') { $objectLibs = $this->dao->select('*')->from(TABLE_DOCLIB) ->where('deleted')->eq(0) ->andWhere('vision')->eq($this->config->vision) ->andWhere('type')->eq($type) ->beginIF(!empty($appendLib))->orWhere('id')->eq($appendLib)->fi() - ->beginIF($type == 'custom')->orderBy('`order` asc, id_asc')->fi() - ->beginIF($type == 'book')->orderBy('`order` asc, id_asc')->fi() + ->beginIF($type == 'mine')->orWhere('addedBy')->eq($this->app->user->account)->fi() + ->orderBy('`order` asc, id_asc') ->fetchAll('id'); } elseif($type != 'product' and $type != 'project' and $type != 'execution') diff --git a/module/doc/view/browse.html.php b/module/doc/view/browse.html.php index f3c2b0c765..f22e426a98 100644 --- a/module/doc/view/browse.html.php +++ b/module/doc/view/browse.html.php @@ -16,7 +16,30 @@ doc);?> doc->confirmDelete)?> tab)?> +
>
+
diff --git a/module/doc/view/createlib.html.php b/module/doc/view/createlib.html.php index c0a173fbf9..b3d6a59c9f 100644 --- a/module/doc/view/createlib.html.php +++ b/module/doc/view/createlib.html.php @@ -60,7 +60,7 @@ doclib->control;?> - doclib->aclList, $type == 'custom' ? 'open' : 'default', "onchange='toggleAcl(this.value, \"lib\")'", 'block')?> + doclib->aclList, $acl, "onchange='toggleAcl(this.value, \"lib\")'", 'block')?> From 93e71f8861304a94b030db361aee31f71a01237d Mon Sep 17 00:00:00 2001 From: liugang Date: Thu, 6 Apr 2023 02:05:02 +0000 Subject: [PATCH 3/4] * Call getDatabaseVersion instead of getMysqlVersion. --- module/admin/control.php | 2 +- module/upgrade/model.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/admin/control.php b/module/admin/control.php index 97238f0cfe..8c997f4a7b 100755 --- a/module/admin/control.php +++ b/module/admin/control.php @@ -506,7 +506,7 @@ class admin extends control if(stripos($table, 'searchindex') !== false) { - $mysqlVersion = $this->loadModel('install')->getMysqlVersion(); + $mysqlVersion = $this->loadModel('install')->getDatabaseVersion(); if($mysqlVersion < 5.6) continue; } diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 6638adc597..cdb69ce4f2 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -2008,7 +2008,7 @@ class upgradeModel extends model if(!file_exists($sqlFile)) return false; $this->saveLogs('Run Method ' . __FUNCTION__); - $mysqlVersion = $this->loadModel('install')->getMysqlVersion(); + $mysqlVersion = $this->loadModel('install')->getDatabaseVersion(); $ignoreCode = '|1050|1054|1060|1091|1061|'; /* Read the sql file to lines, remove the comment lines, then join theme by ';'. */ From 30a90eb1f97d5a5407e494390efd4c695b533666 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Thu, 6 Apr 2023 10:48:54 +0800 Subject: [PATCH 4/4] * Modify language. --- module/doc/control.php | 4 ++-- module/doc/model.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index ff585f49b9..e9fddde1b7 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -104,7 +104,7 @@ class doc extends control $this->app->rawMethod = 'recent'; } - $libs = $this->doc->getLibsByObject('mine', 0); + $libs = $this->doc->getLibsByObject('mine', 0); $libTree = $this->doc->getLibTree($libID, $libs, 'mine', 0); $this->view->moduleID = $moduleID; @@ -188,7 +188,7 @@ class doc extends control $acl = 'private'; unset($this->lang->doclib->aclList['open']); unset($this->lang->doclib->aclList['default']); - $this->lang->doclib->aclList['private'] = $this->lang->doclib->aclListB['private']; + $this->lang->doclib->aclList = $this->lang->doclib->mySpaceAclList['private']; } if($type != 'custom' and $type != 'mine') diff --git a/module/doc/model.php b/module/doc/model.php index e1c6e469f0..783c56eca0 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -1479,7 +1479,7 @@ class docModel extends model */ public function getLibsByObject($type, $objectID, $mode = '', $appendLib = 0) { - if($type == 'custom' or $type == 'book' or $type == 'mine') + if($type == 'custom' or $type == 'mine') { $objectLibs = $this->dao->select('*')->from(TABLE_DOCLIB) ->where('deleted')->eq(0)