diff --git a/lib/base/dao/dao.class.php b/lib/base/dao/dao.class.php index d2cefafda6..9e8300f091 100644 --- a/lib/base/dao/dao.class.php +++ b/lib/base/dao/dao.class.php @@ -1106,7 +1106,13 @@ class baseDAO { ${"arg$i"} = isset($funcArgs[$i + 2]) ? $funcArgs[$i + 2] : null; } - if(strtolower($funcName) == 'notempty' and !empty($selectFields) and strpos(",{$selectFields},", ",{$fieldName},") !== false) $arg0 = $fieldName; + + /* When check not empty and field is select, then use empty function to check. */ + if(strtolower($funcName) == 'notempty') + { + $arg0 = false; + if(!empty($selectFields) and strpos(",{$selectFields},", ",{$fieldName},") !== false) $arg0 = true; + } $checkFunc = 'check' . $funcName; if(validater::$checkFunc($value, $arg0, $arg1, $arg2) === false) diff --git a/lib/base/filter/filter.class.php b/lib/base/filter/filter.class.php index ef1a034cb0..1404760eb9 100644 --- a/lib/base/filter/filter.class.php +++ b/lib/base/filter/filter.class.php @@ -324,15 +324,16 @@ class baseValidater * Not empty checking. * * @param mixed $var - * @param string $fieldName + * @param bool $useEmpty * @static * @access public * @return bool */ - public static function checkNotEmpty($var, $fieldName = '') + public static function checkNotEmpty($var, $useEmpty = false) { $var = trim($var); - if($fieldName) return !empty($var); + + if($useEmpty) return !empty($var); return strlen($var) != 0; } diff --git a/lib/dingapi/dingapi.class.php b/lib/dingapi/dingapi.class.php index 2d4560757c..a906264511 100644 --- a/lib/dingapi/dingapi.class.php +++ b/lib/dingapi/dingapi.class.php @@ -50,6 +50,7 @@ class dingapi /** * Get all users. * + * @param string $whiteListDept * @access public * @return array */ @@ -79,6 +80,7 @@ class dingapi /** * Get all depts. * + * @param string $whiteList * @access public * @return array */ @@ -87,6 +89,7 @@ class dingapi $response = $this->queryAPI($this->apiUrl . "department/list?access_token={$this->token}"); if($this->isError()) return false; + /* Get parent and white list parent dept id list. */ if($whiteList) { $parentIdList = array(); @@ -110,6 +113,7 @@ class dingapi continue; } + /* Check this dept belong to white list. */ $isWhiteList = false; $parentID = $dept->parentid; while(isset($parentIdList[$parentID])) diff --git a/module/action/model.php b/module/action/model.php index 6984b7be6f..8343485f75 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -844,7 +844,7 @@ class actionModel extends model } /* If action type is login or logout, needn't link. */ - if($actionType == 'svncommited') + if($actionType == 'svncommited' or $actionType == 'gitcommited') { $action->actor = isset($commiters[$action->actor]) ? $commiters[$action->actor] : $action->actor; } diff --git a/module/bug/config.php b/module/bug/config.php index 873f6647a6..ecd8e71bf2 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -2,7 +2,7 @@ $config->bug = new stdClass(); $config->bug->batchCreate = 10; $config->bug->longlife = 7; -$config->bug->selectFields = 'module,project,pri,severity,type,story,task,os,browser,plan,assignedTo,resolvedBuild'; +$config->bug->selectFields = 'module,project,openedBuild,resolution,pri,severity,type,story,task,os,browser,plan,assignedTo,resolvedBuild'; $config->bug->create = new stdclass(); $config->bug->edit = new stdclass(); diff --git a/module/bug/control.php b/module/bug/control.php index f43fa603e4..7ef444ef5d 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -1605,6 +1605,7 @@ class bug extends control } /* Set related files. */ + $bug->files = ''; if(isset($relatedFiles[$bug->id])) { foreach($relatedFiles[$bug->id] as $file) diff --git a/module/build/config.php b/module/build/config.php index 350e441a74..57e2e181cf 100644 --- a/module/build/config.php +++ b/module/build/config.php @@ -8,3 +8,5 @@ $config->build->edit->requiredFields = 'product,project,name,builder,date'; $config->build->editor = new stdclass(); $config->build->editor->create = array('id' => 'desc', 'tools' => 'simpleTools'); $config->build->editor->edit = array('id' => 'desc', 'tools' => 'simpleTools'); + +$config->build->selectFields = 'product,project,builder'; diff --git a/module/build/control.php b/module/build/control.php index 5cd8f747ae..b79dbbfc12 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -446,7 +446,6 @@ class build extends control /* Load pager. */ $this->app->loadClass('pager', $static = true); - if($this->app->getViewType() == 'mhtml') $recPerPage = 10; $pager = new pager($recTotal, $recPerPage, $pageID); /* Build search form. */ @@ -563,7 +562,6 @@ class build extends control /* Load pager. */ $this->app->loadClass('pager', $static = true); - if($this->app->getViewType() == 'mhtml') $recPerPage = 10; $pager = new pager($recTotal, $recPerPage, $pageID); $queryID = ($browseType == 'bysearch') ? (int)$param : 0; diff --git a/module/build/model.php b/module/build/model.php index 923a1fce3f..d7a901b87c 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -208,7 +208,6 @@ class buildModel extends model ->get(); if($this->config->global->flow == 'onlyTest') $build->project = 0; - if(empty($build->product)) return dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->build->product); $build = $this->loadModel('file')->processImgURL($build, $this->config->build->editor->create['id'], $this->post->uid); $this->dao->insert(TABLE_BUILD)->data($build) diff --git a/module/file/model.php b/module/file/model.php index fa53a1802d..8ab9bec770 100644 --- a/module/file/model.php +++ b/module/file/model.php @@ -205,7 +205,8 @@ class fileModel extends model $file['title'] = $purifier->purify($file['title']); $file['size'] = $_POST['size']; $file['tmpname'] = $tmp_name; - $file['uuid'] = str_replace(array('.', DS), '', $_POST['uuid']); + /* Fix for build uuid like '../../'. */ + $file['uuid'] = str_replace(array('.', '/', '\\'), '', $_POST['uuid']); $file['pathname'] = $this->setPathName(0, $file['extension']); $file['chunkpath'] = 'chunks' . DS .'f_' . $file['uuid'] . '.' . $file['extension'] . '.part'; $file['chunks'] = isset($_POST['chunks']) ? intval($_POST['chunks']) : 0; diff --git a/module/file/view/buildform.html.php b/module/file/view/buildform.html.php index f51510d260..31f0109baa 100644 --- a/module/file/view/buildform.html.php +++ b/module/file/view/buildform.html.php @@ -28,11 +28,11 @@ - +