Merge branch 'sprint/master_lanzongjun_fixbug_lite' of https://gitlab.zcorp.cc/easycorp/zentaopms into sprint/master_lanzongjun_fixbug_lite

This commit is contained in:
Zongjun Lan
2022-03-18 10:51:07 +08:00
14 changed files with 362 additions and 62 deletions

102
doc/LICENSE.LITE.CN Normal file
View File

@@ -0,0 +1,102 @@
Z PUBLIC LICENSE 1.2
许可
Z PUBLIC LICENSE 由青岛易软天创网络科技有限公司www.easycorp.cn起草简称ZPL协议。
任何人均可使用该协议来发布开源软件,并可对下面协议正文中以下划线标注的空白部分做相应修改,
除此之外的任何内容不得做任何修改。青岛易软天创网络科技有限公司拥有对该协议条款的最终解释权。
前言:
禅道迅捷版软件(以下简称该软件)由 青岛易软天创网络科技有限公司www.easycorp.cn开发以下简称我。我依法拥有该软件的所有版权。
本着共享开放的角度,我以开放源代码的形式发布该软件。您可以在遵守该协议的前提下使用该软件。
自您安装该软件开始,您和我之间的合同关系自动成立。除非您停止使用该软件或与我有签署额外合同,
您须认真遵循该授权协议约定的每一条款。
我的联系方式:
联系人:徐先生
电话: 4006-8899-23
Email co@zentao.net
QQ 1492153927
地址: 青岛开发区长江路232号国贸中心C座2单元2902室
约定:
下述条款中所指该软件的标志包括如下方面:
该软件源代码及文档中关于该软件的版权提示、文字、图片和链接。
该软件运行时界面上呈现出来的有关该软件的文字、图片和链接。
不包括如下方面:
该软件提供的演示数据中关于该软件的文字、图片和链接。
一、免责
该软件是以开放源代码的方式发行,您使用该软件无需任何费用,因此在使用该软件前,您须知晓:
1.1 我没有对该软件提供任何技术支持的义务,您可联系我购买商业的技术支持。
1.2 我对因使用该软件而产生直接或间接的任何问题不负任何责任。
1.3 开源不等于免费,开源不等于无版权,开源软件的发展需要您我共同的努力。
二、自用该软件
2.1 您个人或您就职的公司(组织)可自由使用该软件,我不对您或您就职公司(组织)的性质做任何限制。
2.2 您可以在您个人或您就职公司(组织)任意数量的电脑上运行该软件,我不对电脑的数量做任何限制。
2.3 您可以对该软件源代码进行修改以适应您个人或您所在公司(组织)使用的要求,您做的改动无需对外发布。
2.4 您个人或您就职公司(组织)使用该软件时,必须保留该软件的所有标志,不得以任何方式隐藏或遮掩任一标志。
三、为用户定制
3.1 您可以使用该软件为您的用户部署各种形式的应用,我不对应用的性质做任何限制。
3.2 您可以使用该软件为您的用户部署任意数量的应用,我不对应用的数量做任何限制。
3.3 您可以对该软件源代码进行修改以适应您的用户的要求,您做的改动无需对外发布。
3.4 您对该软件源代码所做的修改可以源代码或二进制的方式提供给您的用户。
3.5 您使用该软件为您的任一用户部署的任一应用都必须保留该软件所有的标志。
3.6 您使用该软件为您的任一用户部署的任一应用都不得以任何方式隐藏或遮掩该软件任一标志。
四、提供在线服务
4.1 您可以使用该软件搭建在线服务,为您的用户提供服务,我不对该服务及该服务用户的性质做任何限制。
4.2 您可以使用该软件搭建在线服务,为您的用户提供服务,我不对该服务的用户数量做任何限制。
4.3 您可以对该软件源代码进行修改以适应在线服务的要求,您做的改动无需对外发布。
4.4 您使用该软件搭建在线服务时,必须以明确的方式告知您的用户该服务是基于该软件搭建的。
4.5 您使用该软件搭建在线服务为您的任一用户部署的任一应用必须保留该软件所有的标志。
4.6 您使用该软件搭建在线服务为您的任一用户部署的任一应用不得以任何方式隐藏或遮掩该软件任一标志。
4.7 您使用该软件搭建在线服务时,不得为您的用户提供去除、隐藏或遮掩该软件任一标志的功能。
五、无改动发布或集成该软件
5.1 我欢迎并感谢您将该软件发布在您的个人网站、企业官网或者其他的第三方网站。
5.2 我欢迎并感谢您将该软件集成在其他系统中一起发布,比如云服务镜像、操作系统发行版等。
5.3 您在发布或者集成该软件的时候,不得对该软件源码做任何改动。
5.4 您在发布或者集成该软件的时候,须保留该软件的所有标志。
六、发布基于该软件的衍生作品
6.1 我欢迎并感谢您为该软件开发衍生作品。
6.2 您开发的衍生作品中涉及到对该软件源代码改动的地方,须遵循如下条款:
6.2.1 如修改了该软件的源代码,须依据本协议发布修改后的源代码。
6.2.2 如修改了该软件的源代码,须保留代码里面该软件原有的所有标志。
6.2.3 您可以在代码中追加您自己的标志。
6.2.4 您可以对您开发的衍生作品进行收费。
6.2.5 第三方的用户可在遵循6.2所有条款下可继续在您开发的衍生作品基础上进行修改并发布。
6.3 您开发的衍生作品中独立于本软件开发的代码,可以源代码或二进制的方式进行发布,可免费或收费发布。
6.4 您开发的衍生作品不得以任何方式去除、隐藏或遮掩该软件的任一标志。
七、发布基于该软件API的应用
7.1 我欢迎并感谢您为该软件开发基于API的各种应用比如客户端软件等。
7.2 您基于该软件API机制开发的应用可以源代码或者二进制的方式进行发布我对此没有任何限制。
7.3 您基于该软件API机制开发的应用授权协议可以自行约定我对此没有任何限制。
7.4 您基于该软件API机制开发的应用可以免费或者收费发布我对此没有任何限制。
八、授权例外
如果上述条款无法满足您使用该软件的要求,可联系我签署额外的合同以获得更灵活的授权许可。
九、合同约束
9.1 如果您违反了该协议的任一条款,该授权协议将自动终止,我保留通过法律手段追究责任的权利。

99
doc/LICENSE.LITE.EN Normal file
View File

@@ -0,0 +1,99 @@
Z PUBLIC LICENSE 1.2
Authorization
Z PUBLIC LICENSE, also known as ZPL Agreement, is drafted by EasyCorp(www.easycorp.ltd).
Anyone can use the agreement to publish open source software, and modify the blank in the following text of the agreement accordingly.
No other text of the agreement shall be changed. EasyCorp has the final interpretation of the terms in the agreement.
Preface
ZenTao LITE (Hereinafter referred to as "the software") developed by EasyCorp (www.easycorp.ltd) (hereinafter referred to I). I'm entitled to all copyright of the software.
The software is released as open source software. You are authorized to use the software as long as you are in compliance with this agreement.
By installation of the software, you agree that a contractual relationship between you and me is automatically established.
You are obliged to fully comply with all the terms of this agreement unless you choose to stop using the software or you have signed additional agreement with me.
My Contact:
Email: renee@easysoft.ltd
Site: https://www.zentao.pm
We agree:
Indications of the software include:
Notes, texts, pictures and links showing copyright attribution of the software in the source code and related documentation.
and texts, picture and links on the interface of the software when running.
Excluding
texts, picture and links on the interface of the demo versions of the software.
1. Disclaimer
The software is an open-source software, so you are authorized to use the software without paying a fee. Before you start to use it, please note:
1.1 I do not have any obligation to provide technical support for the software. You can contact me to purchase technical support service.
1.2 I'm not responsible for any liability caused by your using the software directly or indirectly.
1.3 Open source software does not mean it's free of charge, neither does it mean the software does not enjoy copyright.
2. For personal use
2.1 You or your company/organization are authorized to use the software for your internal use for both commercial and non-commercial purposes..
2.2 You or your company/organization are authorized to run the software on any number of computers.
2.3 You or your company/organization are authorized to modify the source code of the software to meet your requirements. You do not need to release the modified codes.
2.4 You or your company/organization must keep all the indications of the software when using it. None of the indications can be removed, hidden or obscured in any way.
3. For customized software
3.1 You are authorized to use the software to deploy various forms of application for your users in any way you like.
3.2 You are authorized to use the software to deploy any number of applications for your users.
3.3 You are authorized to modify the source code to meet your user's requirements without releasing the modified codes.
3.4 You are authorized to provide the modified codes to your users in either source code form or binary.
3.5 You must keep all the indications of the software when providing applications to your users.
3.6 None of the indications of the software may be removed, hidden or obscured in any way when you provide applications to your users.
4. Online service
4.1 You are authorized to use the software to build your online service for your users in any way you like.
4.2 You are authorized to use the software to build your online service for any number of your users.
4.3 You are authorized to modify the source codes of the software to meet your user's requirements on online service without releasing the modified codes.
4.4 You must notify your users clearly that your service is based on the software when you use it to build your online service.
4.5 You must keep all the indications of the software when providing online service to your users.
4.6 You must keep all the indications of the software in any application you make for your users. None of the indications can be hidden or obscured in any way.
4.7 You are forbidden from assisting your users by providing tools for your users to remove, hide or obscure any indication of the software when you use the software to build your online service.
5. Publish or integrate the software without modification
5.1 You are authorized to publish the software on your personal sites, corporate official website or other third-party sites.
5.2 You are authorized to integrate the software with other systems, such as cloud virtual machine images, operating system images and so on.
5.3 Do not modify the source code of the software when you publish or integrate it.
5.4 All indications of the software must be kept the same when you publish or integrate the software.
6. Publish derived work based on the software
6.1 You are authorized to develop derived work based on the software.
6.2 The modified codes of the software in your derived work must follow the following terms:
6.2.1 The source codes must be released if you make any modification to the software.
6.2.2 All indications of the software must be kept the same.
6.2.3 You are entitled to add your indications to the modified codes.
6.2.4 You are entitled to charge fees for the derived work you developed based on the software.
6.2.5 You agree to authorize third party users to modify and release the derived work in compliance with 6.2.
6.3 If the codes of the work are independently developed by yourself, You are authorized to release the work in either source code form or binary. You are entitled to charge your users or make it free.
6.4 None of the indications of the software can be removed, hidden or obscured in any way in the derived work you developed.
7. Publish applications based on API of the software
7.1 You are authorized to develop your applications based on the API of the software, for example, client software.
7.2 You are authorized to publish applications you developed based on the API in either source code form or binary.
7.3 You are authorized to use your own license to release applications you developed based on the API.
7.4 You are entitled to release applications you developed based on the API either free or with a charge.
8. Exceptions
If the terms above do not meet your requirements when using the software, please contact me for a more flexible license.
9. Termination
9.1 Violation of any of the terms of the agreement will result in immediate termination of this license. I reserve all rights to take legal actions in case of dispute.

View File

@@ -25,7 +25,20 @@ public function setMenu($executionID, $buildID = 0, $extra = '')
$modulePageNav .= "<ul class='dropdown-menu'>";
foreach($kanbanList as $kanbanID => $kanban)
{
$modulePageNav .= '<li>' . html::a(helper::createLink($this->app->rawModule, $this->app->rawMethod, "execution=$kanban->id"), $kanban->name) . '</li>';
if($this->session->kanbanview && strpos('|kanban|task|calendar|gantt|tree|grouptask|', "|{$this->session->kanbanview}|") !== false)
{
$method = $this->session->kanbanview;
}
elseif($this->cookie->kanbanview && strpos('|kanban|task|calendar|gantt|tree|grouptask|', "|{$this->cookie->kanbanview}|") !== false)
{
$method = $this->cookie->kanbanview;
}
else
{
$method = 'kanban';
}
$modulePageNav .= '<li>' . html::a(helper::createLink('execution', $method, "execution=$kanban->id"), $kanban->name) . '</li>';
}
$modulePageNav .= "</ul></div></div>";

View File

@@ -0,0 +1,16 @@
<?php
helper::importControl('install');
class myinstall extends install
{
public function step4()
{
if(!isset($this->config->installed) or !$this->config->installed)
{
$this->view->error = $this->lang->install->errorNotSaveConfig;
$this->display();
}
$_POST['mode'] = 'new';
return parent::step4();
}
}

View File

@@ -0,0 +1,10 @@
<?php
helper::importControl('install');
class myinstall extends install
{
public function step6()
{
$this->config->version = $this->config->liteVersion;
return parent::step6();
}
}

View File

@@ -0,0 +1,6 @@
<?php
$lang->install->successLabel = "<p>You have installed ZenTao Lite %s.</p>";
$lang->install->successNoticeLabel = "<p>You have installed ZenTao Lite %s.<strong class='text-danger'> Please delete install.php</strong>.</p>";
$lang->install->joinZentao = <<<EOT
<p>Note: In order to get the latest news of ZenTao Lite, please sign up on ZenTao Community(<a href='https://www.zentao.pm' class='alert-link' target='_blank'>www.zentao.pm</a>).</p>
EOT;

View File

@@ -14,4 +14,10 @@ $lang->install->links = <<<EOT
EOT;
$lang->install->successLabel = "<p>您已经成功安装禅道迅捷版%s。</p>";
$lang->install->successNoticeLabel = "<p>您已经成功安装禅道迅捷版%s<strong class='text-danger'>请及时删除install.php</strong>。</p>";
$lang->install->joinZentao = <<<EOT
<p>友情提示:为了您及时获得禅道迅捷版的最新动态,请在禅道社区(<a href='https://www.zentao.net' class='alert-link' target='_blank'>www.zentao.net</a>)进行登记。</p>
EOT;

View File

@@ -0,0 +1,16 @@
<?php
/**
* Get license according the client lang.
*
* @access public
* @return string
*/
public function getLicense()
{
$clientLang = $this->app->getClientLang();
$licenseCN = file_get_contents($this->app->getBasePath() . 'doc/LICENSE.LITE.CN');
$licenseEN = file_get_contents($this->app->getBasePath() . 'doc/LICENSE.LITE.EN');
if($clientLang == 'zh-cn' or $clientLang == 'zh-tw') return $licenseCN . $licenseEN;
return $licenseEN . $licenseCN;
}

View File

@@ -0,0 +1,3 @@
<script>
$('#importDemoData0').closest('tr').remove();
</script>

View File

@@ -5,7 +5,7 @@
*
* The author disclaims copyright to this source code. In place of
* a legal notice, here is a blessing:
*
*
* May you do good and not evil.
* May you find forgiveness for yourself and forgive others.
* May you share freely, never taking more than you give.
@@ -13,7 +13,7 @@
/**
* pager类.
* Pager class.
*
*
* @package framework
*/
class basePager
@@ -29,7 +29,7 @@ class basePager
/**
* 总个数。
* The total counts.
*
*
* @var int
* @access public
*/
@@ -38,7 +38,7 @@ class basePager
/**
* 每页的记录数。
* Record count per page.
*
*
* @var int
* @access public
*/
@@ -46,7 +46,7 @@ class basePager
/**
* The cookie name of recPerPage.
*
*
* @var string
* @access public
*/
@@ -55,7 +55,7 @@ class basePager
/**
* 总页面数。
* Page count.
*
*
* @var string
* @access public
*/
@@ -64,7 +64,7 @@ class basePager
/**
* 当前页码。
* Current page id.
*
*
* @var string
* @access public
*/
@@ -73,7 +73,7 @@ class basePager
/**
* 全局变量$app。
* The global $app.
*
*
* @var object
* @access public
*/
@@ -82,7 +82,7 @@ class basePager
/**
* 全局变量$lang。
* The global $lang.
*
*
* @var object
* @access public
*/
@@ -91,7 +91,7 @@ class basePager
/**
* 当前的模块名。
* Current module name.
*
*
* @var string
* @access public
*/
@@ -100,7 +100,7 @@ class basePager
/**
* 当前的方法名。
* Current method.
*
*
* @var string
* @access public
*/
@@ -117,10 +117,10 @@ class basePager
/**
* 构造方法。
* The construct function.
*
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
*
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
@@ -140,10 +140,10 @@ class basePager
/**
* 构造方法。
* The factory function.
*
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
*
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return object
*/
@@ -155,8 +155,8 @@ class basePager
/**
* 设置总记录数。
* Set the recTotal property.
*
* @param int $recTotal
*
* @param int $recTotal
* @access public
* @return void
*/
@@ -168,8 +168,8 @@ class basePager
/**
* 设置每页记录数。
* Set the recPerPage property.
*
* @param int $recPerPage
*
* @param int $recPerPage
* @access public
* @return void
*/
@@ -185,7 +185,7 @@ class basePager
/**
* 设置总页数。
* Set the pageTotal property.
*
*
* @access public
* @return void
*/
@@ -197,8 +197,8 @@ class basePager
/**
* 设置页码。
* Set the page id.
*
* @param int $pageID
*
* @param int $pageID
* @access public
* @return void
*/
@@ -217,7 +217,7 @@ class basePager
/**
* 设置全局变量$app。
* Set the $app property;
*
*
* @access public
* @return void
*/
@@ -230,7 +230,7 @@ class basePager
/**
* 设置全局变量$lang。
* Set the $lang property.
*
*
* @access public
* @return void
*/
@@ -243,7 +243,7 @@ class basePager
/**
* 设置模块名。
* Set the $moduleName property.
*
*
* @access public
* @return void
*/
@@ -255,7 +255,7 @@ class basePager
/**
* 设置方法名。
* Set the $methodName property.
*
*
* @access public
* @return void
*/
@@ -267,7 +267,7 @@ class basePager
/**
* 从请求网址中获取记录总数、每页记录数、页码。
* Get recTotal, recPerpage, pageID from the request params, and add them to params.
*
*
* @access public
* @return void
*/
@@ -295,7 +295,7 @@ class basePager
/**
* 创建limit语句。
* Create the limit string.
*
*
* @access public
* @return string
*/
@@ -307,11 +307,11 @@ class basePager
}
/**
* 向页面显示分页信息。
* 向页面显示分页信息。
* Print the pager's html.
*
* @param string $align
* @param string $type
*
* @param string $align
* @param string $type
* @access public
* @return void
*/
@@ -330,7 +330,7 @@ class basePager
/**
* 获取优化后的分页。
* Get the justify pager html string
*
*
* @access public
* @return [type] [description]
*/
@@ -370,7 +370,7 @@ class basePager
{
/* 如果记录个数为0返回没有记录。 */
/* If the RecTotal is zero, return with no record. */
if($this->recTotal == 0) return $type == 'mobile' ? '' : "<div style='float:$align; clear:none;' class='page'>{$this->lang->pager->noRecord}</div>";
if($this->recTotal == 0) return $type == 'mobile' ? '' : "<div style='float:$align; clear:none;' class='page'>{$this->lang->pager->noRecord}</div>";
/* Set the params. */
$this->setParams();
@@ -411,7 +411,7 @@ class basePager
/**
* 生成分页摘要信息。
* Create the digest code.
*
*
* @access public
* @return string
*/
@@ -423,7 +423,7 @@ class basePager
/**
* 创建首页链接。
* Create the first page.
*
*
* @access public
* @return string
*/
@@ -437,8 +437,8 @@ class basePager
/**
* 创建前一页链接。
* Create the pre page html.
*
* @param string $type
*
* @param string $type
* @access public
* @return string
*/
@@ -456,13 +456,13 @@ class basePager
$this->params['pageID'] = $this->pageID - 1;
return $this->createLink($this->lang->pager->pre);
}
}
}
/**
* 创建下一页链接。
* Create the next page html.
*
* @param string $type
*
* @param string $type
* @access public
* @return string
*/
@@ -484,8 +484,8 @@ class basePager
/**
* 创建最后一页链接。
* Create the last page
*
* Create the last page
*
* @access public
* @return string
*/
@@ -494,18 +494,18 @@ class basePager
if($this->pageID == $this->pageTotal) return $this->lang->pager->last . ' ';
$this->params['pageID'] = $this->pageTotal;
return $this->createLink($this->lang->pager->last);
}
}
/**
* 创建每页显示记录数的select标签。
* Create the select object of record perpage.
*
*
* @access public
* @return string
*/
public function createRecPerPageJS()
{
/*
/*
* 替换recTotal, recPerPage, pageID为特殊的字符串然后用js代码替换掉。
* Replace the recTotal, recPerPage, pageID to special string, and then replace them with values by JS.
**/
@@ -554,8 +554,8 @@ EOT;
/**
* 生成每页显示记录数的select列表。
* Create the select list of RecPerPage.
*
* Create the select list of RecPerPage.
*
* @access public
* @return string
*/
@@ -579,7 +579,7 @@ EOT;
/**
* 生成跳转到指定页码的部分。
* Create the goto part html.
*
*
* @access public
* @return string
*/
@@ -590,13 +590,13 @@ EOT;
$goToHtml .= "<input type='text' id='_pageID' value='$this->pageID' style='text-align:center;width:30px;' class='form-control' /> \n";
$goToHtml .= "<input type='button' id='goto' value='{$this->lang->pager->locate}' onclick='submitPage(\"changePageID\");' class='btn'/>";
return $goToHtml;
}
}
/**
* 创建链接。
* Create link.
*
* @param string $title
*
* @param string $title
* @access public
* @return string
*/

View File

@@ -243,6 +243,7 @@ class commonModel extends model
$user->admin = false;
$user->rights = $this->loadModel('user')->authorize('guest');
$user->groups = array('group');
$user->visions = $this->config->vision;
if(!defined('IN_UPGRADE')) $user->view = $this->user->grantUserView($user->account, $user->rights['acls']);
$this->session->set('user', $user);
$this->app->user = $this->session->user;

View File

@@ -181,10 +181,18 @@ class install extends control
return print(js::locate(inlink('step5'), 'parent'));
}
$this->app->loadLang('upgrade');
if(!isset($this->config->installed) or !$this->config->installed)
{
$this->view->error = $this->lang->install->errorNotSaveConfig;
$this->display();
}
else
{
$this->app->loadLang('upgrade');
$this->view->title = $this->lang->install->introduction;
$this->display();
$this->view->title = $this->lang->install->introduction;
$this->display();
}
}
/**

View File

@@ -12,6 +12,22 @@
?>
<?php include '../../common/view/header.lite.html.php';?>
<div class='container'>
<?php if(isset($error)):?>
<div class='modal-dialog'>
<div class='modal-header'>
<strong><?php echo $lang->install->error;?></strong>
</div>
<div class='modal-body'>
<div class='alert alert-danger alert-pure with-icon'>
<i class='icon-exclamation-sign'></i>
<div class='content'><?php echo $error;?></div>
</div>
</div>
<div class='modal-footer'>
<?php echo html::commonButton($lang->install->pre, "onclick='javascript:history.back(-1)'");?>
</div>
</div>
<?php else:?>
<div class='panel' style='padding:50px 300px'>
<form method='post'>
<h1 class='text-center'><?php echo $title;?></h1>
@@ -35,5 +51,6 @@
</div>
</form>
</div>
<?php endif;?>
</div>
<?php include '../../common/view/footer.lite.html.php';?>

View File

@@ -249,13 +249,16 @@ class userModel extends model
/**
* Get user info by ID.
*
* @param mix $userID
* @param string $field id|account
* @param mix $userID
* @param string $field id|account
* @access public
* @return object|bool
*/
public function getById($userID, $field = 'account')
{
/* Return current user when user is guest or empty to make sure pages in dashboard work fine. */
if(empty($userID) && $this->app->user->account == 'guest') return $this->app->user;
if($field == 'id') $userID = (int)$userID;
if($field == 'account') $userID = str_replace(' ', '', $userID);