Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms
This commit is contained in:
+1
-1
@@ -10,7 +10,7 @@
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
/* Set pathes and timezone. */
|
||||
/* Set paths and timezone. */
|
||||
$zentaoPath = dirname(dirname(dirname(__FILE__))) . "/";
|
||||
$cronPath = $zentaoPath . 'bin/cron';
|
||||
include $zentaoPath . 'config/config.php';
|
||||
|
||||
+1
-1
@@ -3432,7 +3432,7 @@ Bug影响版本为多个时,统计报表无法统计。
|
||||
1174 将todo/view/footer.html.php移到todo/common.js
|
||||
1171 删除的用户名字上没有加横线
|
||||
1087 调整代码高亮的展示形式
|
||||
947 将pathFix变量改用DIRECTORY_SEPERATOR的缩写DS
|
||||
947 将pathFix变量改用DIRECTORY_SEPARATOR的缩写DS
|
||||
945 处理common和commonmodel的关系和逻辑
|
||||
722 清除没有使用的语言条目
|
||||
441 将统计报表程序移至model层
|
||||
|
||||
@@ -177,7 +177,7 @@ class baseControl
|
||||
* The construct function.
|
||||
*
|
||||
* 1. global the global vars, refer them by the class member such as $this->app.
|
||||
* 2. set the pathes of current module, and load it's model class.
|
||||
* 2. set the paths of current module, and load it's model class.
|
||||
* 3. auto assign the $lang and $config to the view.
|
||||
*
|
||||
* @param string $moduleName
|
||||
@@ -708,7 +708,7 @@ class baseControl
|
||||
|
||||
/**
|
||||
* 切换到视图文件所在的目录,以保证视图文件里面的include语句能够正常运行。
|
||||
* Change the dir to the view file to keep the relative pathes work.
|
||||
* Change the dir to the view file to keep the relative paths work.
|
||||
*/
|
||||
$currentPWD = getcwd();
|
||||
chdir(dirname($viewFile));
|
||||
@@ -778,7 +778,7 @@ class baseControl
|
||||
|
||||
/**
|
||||
* 设置引用的文件和路径。
|
||||
* Set the pathes and files to included.
|
||||
* Set the paths and files to included.
|
||||
*/
|
||||
$modulePath = $this->app->getModulePath($appName, $moduleName);
|
||||
$moduleControlFile = $modulePath . 'control.php';
|
||||
|
||||
@@ -129,7 +129,7 @@ class baseModel
|
||||
*
|
||||
* The construct function.
|
||||
* 1. global the global vars, refer them by the class member such as $this->app.
|
||||
* 2. set the pathes, config, lang of current module
|
||||
* 2. set the paths, config, lang of current module
|
||||
*
|
||||
* @param string $appName
|
||||
* @access public
|
||||
|
||||
@@ -1025,7 +1025,7 @@ class baseRouter
|
||||
|
||||
/**
|
||||
* 设置站点代号,可以针对不同的站点来加载不同的扩展。
|
||||
* Set the code of current site, thus can load diffrent extension of diffrent site.
|
||||
* Set the code of current site, thus can load different extension of different site.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
@@ -1075,7 +1075,7 @@ class baseRouter
|
||||
|
||||
/**
|
||||
* 解析本次请求的入口方法,根据请求的类型(PATH_INFO GET),调用相应的方法。
|
||||
* The entrance of parseing request. According to the requestType, call related methods.
|
||||
* The entrance of parsing request. According to the requestType, call related methods.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
@@ -1215,7 +1215,7 @@ class baseRouter
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取$vewType变量。
|
||||
* 获取$viewType变量。
|
||||
* Get the $viewType var.
|
||||
*
|
||||
* @access public
|
||||
@@ -1237,8 +1237,8 @@ class baseRouter
|
||||
*
|
||||
* Load the common module
|
||||
*
|
||||
* The common module is a special module, which can be used to do some common things. For examle:
|
||||
* start session, check priviledge and so on.
|
||||
* The common module is a special module, which can be used to do some common things. For example:
|
||||
* start session, check privilege and so on.
|
||||
* This method should called manually in the router file(www/index.php) after the $lang, $config, $dbh loaded.
|
||||
*
|
||||
* @access public
|
||||
@@ -1393,7 +1393,7 @@ class baseRouter
|
||||
{
|
||||
$moduleExtPaths = $this->getModuleExtPath('', $this->moduleName, 'control');
|
||||
|
||||
/* 如果扩展目录为空,不包含任何扩展文件。If there's no ext pathes return false.*/
|
||||
/* 如果扩展目录为空,不包含任何扩展文件。If there's no ext paths return false.*/
|
||||
if(empty($moduleExtPaths)) return false;
|
||||
|
||||
/* 如果extensionLevel == 2,且扩展文件存在,返回该站点扩展文件。If extensionLevel == 2 and site extensionFile exists, return it. */
|
||||
@@ -1633,7 +1633,7 @@ class baseRouter
|
||||
{
|
||||
/*
|
||||
* 根据$requestFix分割符,分割网址。
|
||||
* There's the request seperator, split the URI by it.
|
||||
* There's the request separator, split the URI by it.
|
||||
**/
|
||||
if(strpos($this->URI, $this->config->requestFix) !== false)
|
||||
{
|
||||
@@ -1643,7 +1643,7 @@ class baseRouter
|
||||
}
|
||||
/*
|
||||
* 如果网址中没有分隔符,使用默认的方法。
|
||||
* No reqeust seperator, use the default method name.
|
||||
* No request separator, use the default method name.
|
||||
**/
|
||||
else
|
||||
{
|
||||
@@ -1966,7 +1966,7 @@ class baseRouter
|
||||
$classFile .= '.class.php';
|
||||
if(!helper::import($classFile)) $this->triggerError("class file $classFile not found", __FILE__, __LINE__, $exit = true);
|
||||
|
||||
/* 如果是静态调用,则返回(If staitc, return) */
|
||||
/* 如果是静态调用,则返回(If static, return) */
|
||||
if($static) return true;
|
||||
|
||||
/* 实例化该类(Instance it) */
|
||||
@@ -2267,7 +2267,7 @@ class baseRouter
|
||||
|
||||
/*
|
||||
* 发现错误,保存到日志中。
|
||||
* If any error occers, save it.
|
||||
* If any error occurs, save it.
|
||||
* */
|
||||
if(!function_exists('error_get_last')) return;
|
||||
$error = error_get_last();
|
||||
@@ -2279,8 +2279,8 @@ class baseRouter
|
||||
* Trigger an error.
|
||||
*
|
||||
* @param string $message 错误信息 error message
|
||||
* @param string $file 所在文件 the file error occers
|
||||
* @param int $line 错误行 the line error occers
|
||||
* @param string $file 所在文件 the file error occurs
|
||||
* @param int $line 错误行 the line error occurs
|
||||
* @param bool $exit 是否停止程序 exit the program or not
|
||||
* @access public
|
||||
* @return void
|
||||
|
||||
@@ -230,7 +230,7 @@ class control extends baseControl
|
||||
|
||||
/**
|
||||
* 切换到视图文件所在的目录,以保证视图文件里面的include语句能够正常运行。
|
||||
* Change the dir to the view file to keep the relative pathes work.
|
||||
* Change the dir to the view file to keep the relative paths work.
|
||||
*/
|
||||
$currentPWD = getcwd();
|
||||
chdir(dirname($viewFile));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
$config->extension = new stdclass();
|
||||
$config->extension->apiRoot = 'https://api.zentao.net/extension-';
|
||||
$config->extension->extPathes = array('module', 'bin', 'www', 'library', 'config');
|
||||
$config->extension->extPaths = array('module', 'bin', 'www', 'library', 'config');
|
||||
|
||||
@@ -13,9 +13,9 @@ class extension extends control
|
||||
{
|
||||
/**
|
||||
* Construct function.
|
||||
*
|
||||
* @param string $moduleName
|
||||
* @param string $methodName
|
||||
*
|
||||
* @param string $moduleName
|
||||
* @param string $methodName
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -79,9 +79,9 @@ class extension extends control
|
||||
|
||||
/**
|
||||
* Obtain extensions from the community.
|
||||
*
|
||||
* @param string $type
|
||||
* @param string $param
|
||||
*
|
||||
* @param string $type
|
||||
* @param string $param
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -119,16 +119,16 @@ class extension extends control
|
||||
|
||||
/**
|
||||
* Install a extension
|
||||
*
|
||||
* @param string $extension
|
||||
* @param string $downLink
|
||||
* @param string $md5
|
||||
* @param string $type
|
||||
* @param string $overridePackage
|
||||
* @param string $ignoreCompatible
|
||||
* @param string $overrideFile
|
||||
* @param string $agreeLicense
|
||||
* @param int $upgrade
|
||||
*
|
||||
* @param string $extension
|
||||
* @param string $downLink
|
||||
* @param string $md5
|
||||
* @param string $type
|
||||
* @param string $overridePackage
|
||||
* @param string $ignoreCompatible
|
||||
* @param string $overrideFile
|
||||
* @param string $agreeLicense
|
||||
* @param int $upgrade
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -138,12 +138,12 @@ class extension extends control
|
||||
|
||||
$this->view->error = '';
|
||||
$installTitle = $upgrade == 'no' ? $this->lang->extension->install : $this->lang->extension->upgrade;
|
||||
$installType = $upgrade == 'no' ? $this->lang->extension->installExt : $this->lang->extension->upgradeExt;
|
||||
$installType = $upgrade == 'no' ? $this->lang->extension->installExt : $this->lang->extension->upgradeExt;
|
||||
$this->view->installType = $installType;
|
||||
$this->view->upgrade = $upgrade;
|
||||
$this->view->title = $installTitle . $extension;
|
||||
|
||||
|
||||
|
||||
$statusFile = $this->loadModel('common')->checkSafeFile();
|
||||
if($statusFile)
|
||||
{
|
||||
@@ -154,14 +154,14 @@ class extension extends control
|
||||
$packageFile = $this->extension->getPackageFile($extension);
|
||||
|
||||
/* Check the package file exists or not. */
|
||||
if(!file_exists($packageFile))
|
||||
if(!file_exists($packageFile))
|
||||
{
|
||||
$this->view->error = sprintf($this->lang->extension->errorPackageNotFound, $packageFile);
|
||||
die($this->display());
|
||||
}
|
||||
|
||||
/* Checking the extension pathes. */
|
||||
$return = $this->extension->checkExtensionPathes($extension);
|
||||
/* Checking the extension paths. */
|
||||
$return = $this->extension->checkExtensionPaths($extension);
|
||||
if($this->session->dirs2Created == false) $this->session->set('dirs2Created', $return->dirs2Created, 'admin'); // Save the dirs to be created.
|
||||
if($return->result != 'ok')
|
||||
{
|
||||
@@ -328,8 +328,8 @@ class extension extends control
|
||||
|
||||
/**
|
||||
* Uninstall an extension.
|
||||
*
|
||||
* @param string $extension
|
||||
*
|
||||
* @param string $extension
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -367,8 +367,8 @@ class extension extends control
|
||||
|
||||
/**
|
||||
* Activate an extension;
|
||||
*
|
||||
* @param string $extension
|
||||
*
|
||||
* @param string $extension
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -395,8 +395,8 @@ class extension extends control
|
||||
|
||||
/**
|
||||
* Deactivate an extension
|
||||
*
|
||||
* @param string $extension
|
||||
*
|
||||
* @param string $extension
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -411,7 +411,7 @@ class extension extends control
|
||||
|
||||
/**
|
||||
* Upload an extension
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -461,8 +461,8 @@ class extension extends control
|
||||
|
||||
/**
|
||||
* Erase an extension.
|
||||
*
|
||||
* @param string $extension
|
||||
*
|
||||
* @param string $extension
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -476,11 +476,11 @@ class extension extends control
|
||||
|
||||
/**
|
||||
* Update extension.
|
||||
*
|
||||
* @param string $extension
|
||||
* @param string $downLink
|
||||
* @param string $md5
|
||||
* @param string $type
|
||||
*
|
||||
* @param string $extension
|
||||
* @param string $downLink
|
||||
* @param string $md5
|
||||
* @param string $type
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -492,8 +492,8 @@ class extension extends control
|
||||
|
||||
/**
|
||||
* Browse the structure of extension.
|
||||
*
|
||||
* @param int $extension
|
||||
*
|
||||
* @param int $extension
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
|
||||
+94
-94
@@ -12,13 +12,13 @@
|
||||
class extensionModel extends model
|
||||
{
|
||||
/**
|
||||
* The extension manager version. Don't change it.
|
||||
* The extension manager version. Don't change it.
|
||||
*/
|
||||
const EXT_MANAGER_VERSION = '1.3';
|
||||
|
||||
/**
|
||||
* The api root.
|
||||
*
|
||||
*
|
||||
* @var string
|
||||
* @access public
|
||||
*/
|
||||
@@ -26,7 +26,7 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* The construct function.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -39,7 +39,7 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Set the apiRoot.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -50,8 +50,8 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Fetch data from an api.
|
||||
*
|
||||
* @param string $url
|
||||
*
|
||||
* @param string $url
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
@@ -83,7 +83,7 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Get extension modules from the api.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return string|bool
|
||||
*/
|
||||
@@ -99,9 +99,9 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Get extensions by some condition.
|
||||
*
|
||||
* @param string $type
|
||||
* @param mixed $param
|
||||
*
|
||||
* @param string $type
|
||||
* @param mixed $param
|
||||
* @access public
|
||||
* @return array|bool
|
||||
*/
|
||||
@@ -123,8 +123,8 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Get versions for some extensions.
|
||||
*
|
||||
* @param string $extensions
|
||||
*
|
||||
* @param string $extensions
|
||||
* @access public
|
||||
* @return array|bool
|
||||
*/
|
||||
@@ -139,8 +139,8 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Check incompatible extension
|
||||
*
|
||||
* @param array $versions
|
||||
*
|
||||
* @param array $versions
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
@@ -155,8 +155,8 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Get extensions by status.
|
||||
*
|
||||
* @param string $status
|
||||
*
|
||||
* @param string $status
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
@@ -172,8 +172,8 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Get extension info from database.
|
||||
*
|
||||
* @param string $extension
|
||||
*
|
||||
* @param string $extension
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
@@ -184,8 +184,8 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Get info of an extension from the package file.
|
||||
*
|
||||
* @param string $extension
|
||||
*
|
||||
* @param string $extension
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
@@ -215,8 +215,8 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Parse extension's config file.
|
||||
*
|
||||
* @param string $extension
|
||||
*
|
||||
* @param string $extension
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
@@ -229,7 +229,7 @@ class extensionModel extends model
|
||||
if(file_exists($infoFile)) return (object)parse_ini_file($infoFile);
|
||||
|
||||
/**
|
||||
* Then try parse yaml file. since 2.5 version.
|
||||
* Then try parse yaml file. since 2.5 version.
|
||||
*/
|
||||
|
||||
/* Try the yaml of current lang, then try en. */
|
||||
@@ -255,9 +255,9 @@ class extensionModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the full path of the zip file of a extension.
|
||||
*
|
||||
* @param string $extension
|
||||
* Get the full path of the zip file of a extension.
|
||||
*
|
||||
* @param string $extension
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
@@ -267,15 +267,15 @@ class extensionModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Get pathes from an extension package.
|
||||
*
|
||||
* @param string $extension
|
||||
* Get paths from an extension package.
|
||||
*
|
||||
* @param string $extension
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getPathesFromPackage($extension)
|
||||
public function getPathsFromPackage($extension)
|
||||
{
|
||||
$pathes = array();
|
||||
$paths = array();
|
||||
$packageFile = $this->getPackageFile($extension);
|
||||
|
||||
/* Get files from the package file. */
|
||||
@@ -289,20 +289,20 @@ class extensionModel extends model
|
||||
$file = (object)$file;
|
||||
if($file->folder) continue;
|
||||
$file->filename = substr($file->filename, strpos($file->filename, '/') + 1);
|
||||
$pathes[] = dirname($file->filename);
|
||||
$paths[] = dirname($file->filename);
|
||||
}
|
||||
}
|
||||
|
||||
/* Append the pathes to stored the extracted files. */
|
||||
$pathes[] = "module/extension/ext/";
|
||||
/* Append the paths to stored the extracted files. */
|
||||
$paths[] = "module/extension/ext/";
|
||||
|
||||
return array_unique($pathes);
|
||||
return array_unique($paths);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all files from a package.
|
||||
*
|
||||
* @param string $extension
|
||||
*
|
||||
* @param string $extension
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
@@ -314,9 +314,9 @@ class extensionModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the extension's condition.
|
||||
*
|
||||
* @param string $extenstion
|
||||
* Get the extension's condition.
|
||||
*
|
||||
* @param string $extenstion
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
@@ -341,8 +341,8 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Process license. If is opensource return the full text of it.
|
||||
*
|
||||
* @param string $license
|
||||
*
|
||||
* @param string $license
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
@@ -358,9 +358,9 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Get hook file for install or uninstall.
|
||||
*
|
||||
* @param string $extension
|
||||
* @param string $hook preinstall|postinstall|preuninstall|postuninstall
|
||||
*
|
||||
* @param string $extension
|
||||
* @param string $hook preinstall|postinstall|preuninstall|postuninstall
|
||||
* @access public
|
||||
* @return string|bool
|
||||
*/
|
||||
@@ -373,9 +373,9 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Get the install db file.
|
||||
*
|
||||
* @param string $extension
|
||||
* @param string $method
|
||||
*
|
||||
* @param string $extension
|
||||
* @param string $method
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
@@ -386,7 +386,7 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Check the download path.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return object the check result.
|
||||
*/
|
||||
@@ -422,12 +422,12 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Check extension files.
|
||||
*
|
||||
* @param string $extension
|
||||
*
|
||||
* @param string $extension
|
||||
* @access public
|
||||
* @return object the check result.
|
||||
*/
|
||||
public function checkExtensionPathes($extension)
|
||||
public function checkExtensionPaths($extension)
|
||||
{
|
||||
$return = new stdclass();
|
||||
$return->result = 'ok';
|
||||
@@ -437,8 +437,8 @@ class extensionModel extends model
|
||||
$return->dirs2Created = array();
|
||||
|
||||
$appRoot = $this->app->getAppRoot();
|
||||
$pathes = $this->getPathesFromPackage($extension);
|
||||
foreach($pathes as $path)
|
||||
$paths = $this->getPathsFromPackage($extension);
|
||||
foreach($paths as $path)
|
||||
{
|
||||
if($path == 'db' or $path == 'doc' or $path == 'hook') continue;
|
||||
$path = $appRoot . $path;
|
||||
@@ -471,8 +471,8 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Check the extension's version is compatibility for zentao version
|
||||
*
|
||||
* @param string $version
|
||||
*
|
||||
* @param string $version
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -486,8 +486,8 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Check files in the package conflicts with exists files or not.
|
||||
*
|
||||
* @param string $extension
|
||||
*
|
||||
* @param string $extension
|
||||
* @param string $type
|
||||
* @param bool $isCheck
|
||||
* @access public
|
||||
@@ -514,12 +514,12 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Extract an extension.
|
||||
*
|
||||
* @param string $extension
|
||||
*
|
||||
* @param string $extension
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function extractPackage($extension)
|
||||
public function extractPackage($extension)
|
||||
{
|
||||
$return = new stdclass();
|
||||
$return->result = 'ok';
|
||||
@@ -545,9 +545,9 @@ class extensionModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy package files.
|
||||
*
|
||||
* @param int $extension
|
||||
* Copy package files.
|
||||
*
|
||||
* @param int $extension
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
@@ -555,10 +555,10 @@ class extensionModel extends model
|
||||
{
|
||||
$appRoot = $this->app->getAppRoot();
|
||||
$extensionDir = "ext/$extension/";
|
||||
$pathes = scandir($extensionDir);
|
||||
$paths = scandir($extensionDir);
|
||||
$copiedFiles = array();
|
||||
|
||||
foreach($pathes as $path)
|
||||
foreach($paths as $path)
|
||||
{
|
||||
if($path == 'db' or $path == 'doc' or $path == 'hook' or $path == '..' or $path == '.') continue;
|
||||
|
||||
@@ -576,8 +576,8 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Remove an extension.
|
||||
*
|
||||
* @param string $extension
|
||||
*
|
||||
* @param string $extension
|
||||
* @access public
|
||||
* @return array the remove commands need executed manually.
|
||||
*/
|
||||
@@ -628,7 +628,7 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Clean model cache files.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -640,8 +640,8 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Erase an extension's package file.
|
||||
*
|
||||
* @param string $extension
|
||||
*
|
||||
* @param string $extension
|
||||
* @access public
|
||||
* @return array the remove commands need executed manually.
|
||||
*/
|
||||
@@ -671,9 +671,9 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Judge need execute db install or not.
|
||||
*
|
||||
* @param string $extension
|
||||
* @param string $method
|
||||
*
|
||||
* @param string $extension
|
||||
* @param string $method
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -684,8 +684,8 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Install the db.
|
||||
*
|
||||
* @param int $extension
|
||||
*
|
||||
* @param int $extension
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
@@ -712,7 +712,7 @@ class extensionModel extends model
|
||||
{
|
||||
$this->dbh->query($sql);
|
||||
}
|
||||
catch(PDOException $e)
|
||||
catch(PDOException $e)
|
||||
{
|
||||
$errorInfo = $e->errorInfo;
|
||||
$errorCode = $errorInfo[1];
|
||||
@@ -724,9 +724,9 @@ class extensionModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Backup db when uninstall extension.
|
||||
*
|
||||
* @param string $extension
|
||||
* Backup db when uninstall extension.
|
||||
*
|
||||
* @param string $extension
|
||||
* @access public
|
||||
* @return bool|string
|
||||
*/
|
||||
@@ -755,14 +755,14 @@ class extensionModel extends model
|
||||
$backupFile = $this->app->getTmpRoot() . $extension . '.' . date('Ymd') . '.sql';
|
||||
$result = $zdb->dump($backupFile, $backupTables);
|
||||
if($result->result) return $backupFile;
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the extension to database.
|
||||
*
|
||||
*
|
||||
* @param string $extension the extension code
|
||||
* @param string $type the extension type
|
||||
* @access public
|
||||
@@ -781,10 +781,10 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Update an extension.
|
||||
*
|
||||
* @param string $extension
|
||||
* @param string $status
|
||||
* @param array $files
|
||||
*
|
||||
* @param string $extension
|
||||
* @param string $status
|
||||
* @param array $files
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -820,8 +820,8 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Check depends extension.
|
||||
*
|
||||
* @param string $extension
|
||||
*
|
||||
* @param string $extension
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
@@ -843,10 +843,10 @@ class extensionModel extends model
|
||||
|
||||
/**
|
||||
* Compare for limit data.
|
||||
*
|
||||
* @param string $version
|
||||
* @param array $limit
|
||||
* @param string $type
|
||||
*
|
||||
* @param string $version
|
||||
* @param array $limit
|
||||
* @param string $type
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -873,7 +873,7 @@ class extensionModel extends model
|
||||
/**
|
||||
* Get extension expire date.
|
||||
*
|
||||
* @param int $extension
|
||||
* @param int $extension
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
|
||||
@@ -38,10 +38,18 @@ class index extends control
|
||||
$latestVersionList = array();
|
||||
if(isset($this->config->global->latestVersionList)) $latestVersionList = json_decode($this->config->global->latestVersionList);
|
||||
|
||||
$this->view->open = helper::safe64Decode($open);
|
||||
$this->view->title = $this->lang->index->common;
|
||||
$showFeatures = false;
|
||||
foreach($this->config->newFeatures as $feature)
|
||||
{
|
||||
$accounts = zget($this->config->global, 'skip' . ucfirst($feature), '');
|
||||
if(strpos(",$accounts,", $this->app->user->account) === false) $showFeatures = true;
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->index->common;
|
||||
$this->view->open = helper::safe64Decode($open);
|
||||
$this->view->showFeatures = $showFeatures;
|
||||
$this->view->latestVersionList = $latestVersionList;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
(function()
|
||||
{
|
||||
if(showFeatures)
|
||||
{
|
||||
/* Show features dialog. */
|
||||
new $.zui.ModalTrigger({url: $.createLink('misc', 'features'), type: 'iframe', width: 900, showHeader: false, backdrop: 'static'}).show();
|
||||
}
|
||||
|
||||
/* Init variables */
|
||||
var openedApps = {}; // Key-value to save appCode-app pairs
|
||||
var appsMap = {}; // Key-value to save opened appCode-app pairs
|
||||
@@ -852,9 +858,3 @@ function getLatestVersion()
|
||||
$('#globalSearchInput').click();
|
||||
$('#upgradeContent').toggle();
|
||||
}
|
||||
|
||||
/** Show features dialog */
|
||||
function showFeaturesDialog()
|
||||
{
|
||||
new $.zui.ModalTrigger({url: $.createLink('misc', 'features'), type: 'ajax', width: 900, showHeader: false, backdrop: 'static'}).show();
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ js::set('appsMenuItems', commonModel::getMainNavList($app->rawModule));
|
||||
js::set('defaultOpen', $open);
|
||||
js::set('manualText', $lang->manual);
|
||||
js::set('manualUrl', ((!empty($config->isINT)) ? $config->manualUrl['int'] : $config->manualUrl['home']) . '&theme=' . $_COOKIE['theme']);
|
||||
js::set('showFeatures', $showFeatures);
|
||||
?>
|
||||
<style>
|
||||
#versionTitle {margin: 8px 3px 0px 0px; background-image: url(<?php echo $config->webRoot . 'theme/default/images/main/version-upgrade.svg';?>);}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#features {padding: 10px 0;}
|
||||
#features > header {text-align: center;}
|
||||
#features > footer {text-align: center; padding-top: 18px; border-top: 1px solid #eee}
|
||||
|
||||
@@ -8,7 +9,7 @@
|
||||
#featuresNav > li.active > a:hover {background-color: #f1f1f1; opacity: 1;}
|
||||
|
||||
#featuresCarousel {padding: 0 50px;}
|
||||
#featuresCarousel .carousel-indicators {bottom: 0;}
|
||||
#featuresCarousel .carousel-indicators {bottom: -10px;}
|
||||
#featuresCarousel .carousel-indicators li {border-color: #d8d8d8; background-color: #d8d8d8; width: 12px; height: 12px;}
|
||||
#featuresCarousel .carousel-indicators li + li {margin-left: 10px !important;}
|
||||
#featuresCarousel .carousel-indicators .active {border-color: #73b1df; background-color: #73b1df; margin: 1px;}
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<th class='text-left'><?php common::printOrderLink('targetProject', $orderBy, $vars, $lang->mr->targetProject); ?></th>
|
||||
<th class='w-120px text-left'><?php common::printOrderLink('targetBranch', $orderBy, $vars, $lang->mr->targetBranch); ?></th>
|
||||
<th class='w-120px text-left'><?php common::printOrderLink('mergeStatus', $orderBy, $vars, $lang->mr->mergeStatus); ?></th>
|
||||
<th class='w-120px c-actions-4'><?php echo $lang->actions; ?></th>
|
||||
<th class='c-actions-3'><?php echo $lang->actions; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -50,7 +50,7 @@
|
||||
<td class='text'><?php echo $this->loadModel('gitlab')->apiGetSingleProject($MR->gitlabID, $MR->targetProject)->name_with_namespace; ?></td>
|
||||
<td class='text'><?php echo $MR->targetBranch;?></td>
|
||||
<td class='text'><?php echo ($MR->status == 'merged') ? zget($lang->mr->statusList, $MR->status) : zget($lang->mr->mergeStatusList, $MR->mergeStatus); ?></td>
|
||||
<td class='text-left c-actions'>
|
||||
<td class='c-actions'>
|
||||
<?php
|
||||
common::printLink('mr', 'view', "mr={$MR->id}", '<i class="icon icon-eye"></i>', '', "title='{$lang->mr->view}' class='btn btn-info'");
|
||||
common::printLink('mr', 'edit', "mr={$MR->id}", '<i class="icon icon-edit"></i>', '', "title='{$lang->mr->edit}' class='btn btn-info'");
|
||||
|
||||
@@ -32,15 +32,7 @@ class my extends control
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$showFeatures = false;
|
||||
foreach($this->config->newFeatures as $feature)
|
||||
{
|
||||
$accounts = zget($this->config->global, 'skip' . ucfirst($feature), '');
|
||||
if(strpos(",$accounts,", $this->app->user->account) === false) $showFeatures = true;
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->my->common;
|
||||
$this->view->showFeatures = $showFeatures;
|
||||
$this->view->title = $this->lang->my->common;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
$(function()
|
||||
{
|
||||
if(showFeatures) showFeaturesDialog();
|
||||
|
||||
/* Set the heights of every block to keep them same height. */
|
||||
projectBoxHeight = $('#projectbox').height();
|
||||
productBoxHeight = $('#productbox').height();
|
||||
@@ -37,14 +35,3 @@ $(function()
|
||||
$(this).find('.fixedHead').css('top',$(this).scrollTop());
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Show features dialog.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function showFeaturesDialog()
|
||||
{
|
||||
$.zui.modalTrigger.show({url: $.createLink('misc', 'features'), type: 'ajax', width: 900, showHeader: false})
|
||||
}
|
||||
|
||||
@@ -10,6 +10,5 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php js::set('showFeatures', $showFeatures);?>
|
||||
<?php echo $this->fetch('block', 'dashboard', 'module=my');?>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -31,7 +31,7 @@ class product extends control
|
||||
|
||||
/* Get all products, if no, goto the create page. */
|
||||
$this->products = $this->product->getPairs('nocode|all');
|
||||
if(empty($this->products) and strpos(',create,index,showerrornone,ajaxgetdropmenu,', $this->methodName) === false and $this->app->getViewType() != 'mhtml') $this->locate($this->createLink('product', 'create'));
|
||||
if(empty($this->products) and strpos(',create,index,showerrornone,ajaxgetdropmenu,kanban', $this->methodName) === false and $this->app->getViewType() != 'mhtml') $this->locate($this->createLink('product', 'create'));
|
||||
$this->view->products = $this->products;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<?php include '../../common/view/kanban.html.php';?>
|
||||
<?php if(empty($kanbanList)):?>
|
||||
<div class="table-empty-tip cell">
|
||||
<p class="text-muted"><?php echo $lang->noData;?></p>
|
||||
<p class="text-muted"><?php echo $lang->product->noProduct;?></p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div id='kanbanList'>
|
||||
|
||||
@@ -2826,7 +2826,7 @@ class upgradeModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Judge any error occers.
|
||||
* Judge any error occurs.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
|
||||
Vendored
+2
-2
@@ -39,7 +39,7 @@ $.extend(
|
||||
/* try parse to json when response is json's string. */
|
||||
try{if(typeof(response) == 'string') response = JSON.parse(response);}catch(e){}
|
||||
|
||||
/* The response is not an object, some error occers, alert it. */
|
||||
/* The response is not an object, some error occurs, alert it. */
|
||||
if(typeof(response) != 'object')
|
||||
{
|
||||
if(response) return alert(response);
|
||||
@@ -176,7 +176,7 @@ $.extend(
|
||||
}
|
||||
},
|
||||
|
||||
/* When error occers, alert the response text, status and error. */
|
||||
/* When error occurs, alert the response text, status and error. */
|
||||
error:function(jqXHR, textStatus, errorThrown)
|
||||
{
|
||||
$.enableForm(formID);
|
||||
|
||||
Reference in New Issue
Block a user