diff --git a/module/block/control.php b/module/block/control.php index 671ae36898..b8665325e9 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -741,29 +741,20 @@ class block extends control if(!empty($this->params->type) and preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) die(); $status = isset($this->params->type) ? $this->params->type : ''; - $orderBy = isset($this->params->orderBy) ? $this->params->orderBy : 'id_asc'; - /* Get products. */ - $products = $this->loadModel('product')->getList($status); - foreach($products as $productID => $product) - { - if(!$this->product->checkPriv($product)) unset($products[$productID]); - } - $productIDList = array_keys($products); - if(!$productIDList) + $products = $this->block->getProductsLikeDropMenu($status); + $productIdList = array_keys($products); + + if(empty($products)) { $this->view->products = $products; return false; } - $products = $this->dao->select('*')->from(TABLE_PRODUCT) - ->where('id')->in($productIDList) - ->orderBy($orderBy) - ->fetchAll('id'); /* Get stories. */ $stories = $this->dao->select('product, stage, COUNT(status) AS count')->from(TABLE_STORY) ->where('deleted')->eq(0) - ->andWhere('product')->in($productIDList) + ->andWhere('product')->in($productIdList) ->groupBy('product, stage') ->fetchGroup('product', 'stage'); /* Padding the stories to sure all status have records. */ @@ -779,7 +770,7 @@ class block extends control /* Get plans. */ $plans = $this->dao->select('product, end')->from(TABLE_PRODUCTPLAN) ->where('deleted')->eq(0) - ->andWhere('product')->in($productIDList) + ->andWhere('product')->in($productIdList) ->fetchGroup('product'); foreach($plans as $product => $productPlans) { @@ -802,7 +793,7 @@ class block extends control /* Get projects. */ $projects = $this->dao->select('t1.product, t2.status, t2.end')->from(TABLE_PROJECTPRODUCT)->alias('t1') ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id') - ->where('t1.product')->in($productIDList) + ->where('t1.product')->in($productIdList) ->andWhere('t2.deleted')->eq(0) ->fetchGroup('product'); foreach($projects as $product => $productProjects) @@ -829,7 +820,7 @@ class block extends control /* Get releases. */ $releases = $this->dao->select('product, status, COUNT(*) AS count')->from(TABLE_RELEASE) ->where('deleted')->eq(0) - ->andWhere('product')->in($productIDList) + ->andWhere('product')->in($productIdList) ->groupBy('product, status') ->fetchGroup('product', 'status'); foreach($releases as $product => $release) @@ -843,7 +834,7 @@ class block extends control /* Get last releases. */ $lastReleases = $this->dao->select('product, COUNT(*) AS count')->from(TABLE_RELEASE) ->where('date')->eq(date('Y-m-d', strtotime('-1 day'))) - ->andWhere('product')->in($productIDList) + ->andWhere('product')->in($productIdList) ->groupBy('product') ->fetchPairs(); @@ -879,33 +870,23 @@ class block extends control $this->app->loadLang('bug'); $status = isset($this->params->type) ? $this->params->type : ''; - $orderBy = isset($this->params->orderBy) ? $this->params->orderBy : 'id_asc'; $num = isset($this->params->num) ? (int)$this->params->num : 0; /* Get projects. */ - $projects = $this->loadModel('project')->getList($status); - foreach($projects as $projectID => $project) - { - if(!$this->project->checkPriv($project)) unset($projects[$projectID]); - } - $projectIDList = array_keys($projects); - if(!$projectIDList) + $projects = $this->block->getProjectsLikeDropMenu($status); + if(empty($projects)) { $this->view->projects = $projects; return false; } - $projects = $this->dao->select('*')->from(TABLE_PROJECT) - ->where('id')->in($projectIDList) - ->orderBy($orderBy) - ->beginIF($this->viewType != 'json')->limit($num)->fi() - ->fetchAll('id'); - $projectIDList = array_keys($projects); + + $projectIdList = array_keys($projects); /* Get tasks. */ $yesterday = date('Y-m-d', strtotime('-1 day')); $tasks = $this->dao->select("project, count(id) as totalTasks, count(status in ('wait','doing','pause') or null) as undoneTasks, count(finishedDate like '{$yesterday}%' or null) as yesterdayFinished, sum(if(status != 'cancel', estimate, 0)) as totalEstimate, sum(consumed) as totalConsumed, sum(if(status != 'cancel', `left`, 0)) as totalLeft")->from(TABLE_TASK) - ->where('project')->in($projectIDList) + ->where('project')->in($projectIdList) ->andWhere('deleted')->eq(0) ->andWhere('parent')->eq(0) ->groupBy('project') @@ -923,7 +904,7 @@ class block extends control /* Get stories. */ $stories = $this->dao->select("t1.project, count(t2.status) as totalStories, count(t2.status != 'closed' or null) as unclosedStories, count(t2.stage = 'released' or null) as releasedStories")->from(TABLE_PROJECTSTORY)->alias('t1') ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') - ->where('t1.project')->in($projectIDList) + ->where('t1.project')->in($projectIdList) ->andWhere('t2.deleted')->eq(0) ->groupBy('project') ->fetchAll('project'); @@ -939,7 +920,7 @@ class block extends control /* Get bugs. */ $bugs = $this->dao->select("project, status, count(status) as totalBugs, count(status = 'active' or null) as activeBugs, count(resolvedDate like '{$yesterday}%' or null) as yesterdayResolved")->from(TABLE_BUG) - ->where('project')->in($projectIDList) + ->where('project')->in($projectIdList) ->andWhere('deleted')->eq(0) ->groupBy('project') ->fetchAll('project'); @@ -997,24 +978,15 @@ class block extends control if(!empty($this->params->type) and preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) die(); $status = isset($this->params->type) ? $this->params->type : ''; - $orderBy = isset($this->params->orderBy) ? $this->params->orderBy : 'id_asc'; - /* Get products. */ - $products = $this->loadModel('product')->getList($status); - foreach($products as $productID => $product) - { - if(!$this->product->checkPriv($product)) unset($products[$productID]); - } - $productIDList = array_keys($products); - if(!$productIDList) + $products = $this->block->getProductsLikeDropMenu($status); + $productIdList = array_keys($products); + + if(empty($products)) { $this->view->products = $products; return false; } - $products = $this->dao->select('*')->from(TABLE_PRODUCT) - ->where('id')->in($productIDList) - ->orderBy($orderBy) - ->fetchAll('id'); $testedBuilds = $this->dao->select('build')->from(TABLE_TESTTASK)->where('product')->in(array_keys($products))->andWhere('project')->ne(0)->andWhere('deleted')->eq(0)->fetchPairs(); $builds = $this->dao->select('id, product, name, bugs')->from(TABLE_BUILD)->where('id')->in($testedBuilds)->andWhere('deleted')->eq(0)->fetchGroup('product', 'id'); diff --git a/module/block/model.php b/module/block/model.php index 6bfa893c47..c57e60d91c 100644 --- a/module/block/model.php +++ b/module/block/model.php @@ -471,11 +471,6 @@ class blockModel extends model $params->type['options'] = $this->lang->block->typeList->product; $params->type['control'] = 'select'; - $params->orderBy['name'] = $this->lang->block->orderBy; - $params->orderBy['default'] = 'id_desc'; - $params->orderBy['options'] = $this->lang->block->orderByList->product; - $params->orderBy['control'] = 'select'; - return json_encode($params); } @@ -492,11 +487,6 @@ class blockModel extends model $params->type['options'] = $this->lang->block->typeList->project; $params->type['control'] = 'select'; - $params->orderBy['name'] = $this->lang->block->orderBy; - $params->orderBy['default'] = 'id_desc'; - $params->orderBy['options'] = $this->lang->block->orderByList->project; - $params->orderBy['control'] = 'select'; - return json_encode($params); } @@ -513,11 +503,6 @@ class blockModel extends model $params->type['options'] = $this->lang->block->typeList->product; $params->type['control'] = 'select'; - $params->orderBy['name'] = $this->lang->block->orderBy; - $params->orderBy['default'] = 'id_desc'; - $params->orderBy['options'] = $this->lang->block->orderByList->product; - $params->orderBy['control'] = 'select'; - return json_encode($params); } @@ -645,4 +630,88 @@ class blockModel extends model return $key == $hash; } + + /** + * Get products like drop menu order + * + * @param strint $status + * @access public + * @return array + */ + public function getProductsLikeDropMenu($status) + { + $products = $this->loadModel('product')->getList($status); + if(empty($products)) return $products; + + $lines = $this->loadModel('tree')->getLinePairs(); + $productList = array(); + foreach($lines as $id => $name) + { + foreach($products as $key => $product) + { + if($product->line == $id) + { + $product->name = $name . '/' . $product->name; + $productList[] = $product; + unset($products[$key]); + } + } + } + $productList = array_merge($productList, $products); + + $products = $mineProducts = $otherProducts = $closedProducts = array(); + foreach($productList as $product) + { + if(!$this->app->user->admin and !$this->product->checkPriv($product)) continue; + if($product->status == 'normal' and $product->PO == $this->app->user->account) + { + $mineProducts[$product->id] = $product; + } + elseif($product->status == 'normal' and $product->PO != $this->app->user->account) + { + $otherProducts[$product->id] = $product; + } + elseif($product->status == 'closed') + { + $closedProducts[$product->id] = $product; + } + } + $products = $mineProducts + $otherProducts + $closedProducts; + + return $products; + } + + /** + * Get projects like drop menu order + * + * @param string $status + * @access public + * @return array + */ + public function getProjectsLikeDropMenu($status) + { + $projectList = $this->loadModel('project')->getList($status); + if(empty($projectList)) return $projectList; + + $projects = $mineProjects = $otherProjects = $closedProjects = array(); + foreach($projectList as $project) + { + if(!$this->app->user->admin and !$this->project->checkPriv($project->id)) continue; + if($project->status != 'done' and $project->status != 'closed' and $project->PM == $this->app->user->account) + { + $mineProjects[$project->id] = $project; + } + elseif($project->status != 'done' and $project->status != 'closed' and !($project->PM == $this->app->user->account)) + { + $otherProjects[$project->id] = $project; + } + elseif($project->status == 'done' or $project->status == 'closed') + { + $closedProjects[$project->id] = $project; + } + } + $projects = $mineProjects + $otherProjects + $closedProjects; + + return $projects; + } } diff --git a/module/bug/config.php b/module/bug/config.php index 37773028f7..9c7e5ed1ef 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -165,7 +165,7 @@ $config->bug->search['params']['lastEditedDate']= array('operator' => '=', $config->bug->search['params']['deadline'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); $config->bug->datatable = new stdclass(); -$config->bug->datatable->defaultField = array('id', 'pri', 'title', 'severity', 'status', 'openedBy', 'openedDate', 'assignedTo', 'resolvedBy', 'resolution', 'actions'); +$config->bug->datatable->defaultField = array('id', 'pri', 'title', 'severity', 'status', 'openedBy', 'openedDate', 'assignedTo', 'resolution', 'actions'); $config->bug->datatable->fieldList['id']['title'] = 'idAB'; $config->bug->datatable->fieldList['id']['fixed'] = 'left'; @@ -284,12 +284,12 @@ $config->bug->datatable->fieldList['deadline']['required'] = 'no'; $config->bug->datatable->fieldList['resolvedBy']['title'] = 'resolvedByAB'; $config->bug->datatable->fieldList['resolvedBy']['fixed'] = 'no'; -$config->bug->datatable->fieldList['resolvedBy']['width'] = '80'; +$config->bug->datatable->fieldList['resolvedBy']['width'] = '70'; $config->bug->datatable->fieldList['resolvedBy']['required'] = 'no'; $config->bug->datatable->fieldList['resolution']['title'] = 'resolutionAB'; $config->bug->datatable->fieldList['resolution']['fixed'] = 'no'; -$config->bug->datatable->fieldList['resolution']['width'] = '80'; +$config->bug->datatable->fieldList['resolution']['width'] = '70'; $config->bug->datatable->fieldList['resolution']['required'] = 'no'; $config->bug->datatable->fieldList['resolvedDate']['title'] = 'resolvedDateAB'; diff --git a/module/bug/css/batchcreate.css b/module/bug/css/batchcreate.css index 65f2a1233a..8dd37aa519 100644 --- a/module/bug/css/batchcreate.css +++ b/module/bug/css/batchcreate.css @@ -1,2 +1 @@ -#batchCreateForm{overflow-x:auto;} #batchCreateForm .chosen-container .chosen-drop{min-width:200px;} diff --git a/module/bug/css/batchedit.css b/module/bug/css/batchedit.css index c293bdd635..38b827fe2d 100644 --- a/module/bug/css/batchedit.css +++ b/module/bug/css/batchedit.css @@ -1,4 +1,3 @@ .chosen-container[id^="plan"] .chosen-drop {min-width: 300px; border-top: 1px solid #ddd!important} .duplicate-input {border-left-width: 0; border-radius: 0 2px 2px 0; padding-left: 9px} .duplicate-input:focus {border-left-width: 1px; padding-left: 8px} -#batchEditForm{overflow-x:auto;} diff --git a/module/bug/view/batchcreate.html.php b/module/bug/view/batchcreate.html.php index dae7c7f2bf..58da695603 100644 --- a/module/bug/view/batchcreate.html.php +++ b/module/bug/view/batchcreate.html.php @@ -18,8 +18,8 @@ session->currentProductType !== 'normal') echo '' . $branches[$branch] . '';?>
- createLink('file', 'uploadImages', 'module=bug¶ms=' . helper::safe64Encode("productID=$productID&projectID=$projectID&moduleID=$moduleID")), $lang->uploadImages, '', "data-toggle='modal' data-type='iframe' class='btn btn-info' data-width='70%'")?> - + createLink('file', 'uploadImages', 'module=bug¶ms=' . helper::safe64Encode("productID=$productID&projectID=$projectID&moduleID=$moduleID")), $lang->uploadImages, '', "data-toggle='modal' data-type='iframe' class='btn btn-primary' data-width='70%'")?> + createLink('custom', 'ajaxSaveCustomFields', 'module=bug§ion=custom&key=batchCreateFields')?>
diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index 535e32f3c7..5845b74a4a 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -143,7 +143,7 @@ js::set('confirmDeleteTemplate', $lang->bug->confirmDeleteTemplate); - + diff --git a/module/bug/view/linkbugs.html.php b/module/bug/view/linkbugs.html.php index ed7a0dabd7..d2439aa95a 100644 --- a/module/bug/view/linkbugs.html.php +++ b/module/bug/view/linkbugs.html.php @@ -11,6 +11,7 @@ */ ?> +

@@ -22,7 +23,7 @@
- +
diff --git a/module/build/view/linkbug.html.php b/module/build/view/linkbug.html.php index e4af0fd1b2..33677b5ec9 100644 --- a/module/build/view/linkbug.html.php +++ b/module/build/view/linkbug.html.php @@ -16,7 +16,7 @@
productplan->unlinkedBugs;?>
- +
@@ -71,4 +71,7 @@ - \ No newline at end of file + + diff --git a/module/build/view/linkstory.html.php b/module/build/view/linkstory.html.php index c2d5ed943f..5fc2fdfd23 100644 --- a/module/build/view/linkstory.html.php +++ b/module/build/view/linkstory.html.php @@ -16,7 +16,7 @@
productplan->unlinkedStories;?>
- +
@@ -76,3 +76,6 @@ + diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php index aae3f5b5f4..cd456490c9 100644 --- a/module/build/view/view.html.php +++ b/module/build/view/view.html.php @@ -11,6 +11,7 @@ */ ?> + build->confirmUnlinkStory)?> build->confirmUnlinkBug)?> global->flow)?> diff --git a/module/doc/model.php b/module/doc/model.php index 7b15723fff..dda419e267 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -1224,14 +1224,14 @@ class docModel extends model */ public function statLibCounts($idList) { - $moduleCounts = $this->dao->select("root, count(id) as moduleCount")->from(TABLE_MODULE) + $moduleCounts = $this->dao->select("`root`, count(id) as moduleCount")->from(TABLE_MODULE) ->where('type')->eq('doc') ->andWhere('root')->in($idList) ->andWhere('deleted')->eq(0) ->groupBy('root') ->fetchPairs(); - $docs = $this->dao->select("id,lib,acl,users,groups")->from(TABLE_DOC) + $docs = $this->dao->select("`id`,`lib`,`acl`,`users`,`groups`")->from(TABLE_DOC) ->where('lib')->in($idList) ->andWhere('deleted')->eq(0) ->andWhere('module')->eq(0) diff --git a/module/doc/view/view.html.php b/module/doc/view/view.html.php index a50211a0d5..6a4e8817a5 100644 --- a/module/doc/view/view.html.php +++ b/module/doc/view/view.html.php @@ -68,7 +68,7 @@
-
+
content; diff --git a/module/file/control.php b/module/file/control.php index 48477542a3..9571a83a0b 100644 --- a/module/file/control.php +++ b/module/file/control.php @@ -138,9 +138,15 @@ class file extends control $file = $this->file->getById($fileID); /* Judge the mode, down or open. */ - $mode = 'down'; + $mode = 'down'; $fileTypes = 'txt|jpg|jpeg|gif|png|bmp|xml|html'; if(stripos($fileTypes, $file->extension) !== false && $mouse == 'left') $mode = 'open'; + if($file->extension == 'txt') + { + $extension = end(explode('.', $file->title)); + if($extension != 'txt') $mode = 'down'; + $file->extension = $extension; + } if(file_exists($file->realPath)) { diff --git a/module/file/model.php b/module/file/model.php index d0d1152d35..3baa7a8089 100644 --- a/module/file/model.php +++ b/module/file/model.php @@ -19,7 +19,7 @@ class fileModel extends model /** * Construct function. - * + * * @access public * @return void */ @@ -33,9 +33,9 @@ class fileModel extends model /** * Get files of an object. - * - * @param string $objectType - * @param string $objectID + * + * @param string $objectType + * @param string $objectID * @param string $extra * @access public * @return array @@ -60,8 +60,8 @@ class fileModel extends model /** * Get info of a file. - * - * @param int $fileID + * + * @param int $fileID * @access public * @return object */ @@ -77,10 +77,10 @@ class fileModel extends model /** * Save upload. - * - * @param string $objectType - * @param string $objectID - * @param string $extra + * + * @param string $objectType + * @param string $objectID + * @param string $extra * @param string $filesName * @param string $labelsName * @access public @@ -113,7 +113,7 @@ class fileModel extends model /** * Get counts of uploaded files. - * + * * @access public * @return int */ @@ -124,8 +124,8 @@ class fileModel extends model /** * Get info of uploaded files. - * - * @param string $htmlTagName + * + * @param string $htmlTagName * @param string $labelsName * @access public * @return array @@ -152,7 +152,7 @@ class fileModel extends model $title = isset($_POST[$labelsName][$id]) ? $_POST[$labelsName][$id] : ''; $file['extension'] = $this->getExtension($filename); $file['pathname'] = $this->setPathName($id, $file['extension']); - $file['title'] = (!empty($title) and $title != $filename) ? htmlspecialchars($title) : str_replace('.' . $file['extension'], '', $filename); + $file['title'] = (!empty($title) and $title != $filename) ? htmlspecialchars($title) : $filename; $file['title'] = $purifier->purify($file['title']); $file['size'] = $size[$id]; $file['tmpname'] = $tmp_name[$id]; @@ -167,7 +167,7 @@ class fileModel extends model $title = isset($_POST[$labelsName][0]) ? $_POST[$labelsName][0] : ''; $file['extension'] = $this->getExtension($name); $file['pathname'] = $this->setPathName(0, $file['extension']); - $file['title'] = (!empty($title) and $title != $name) ? htmlspecialchars($title) : substr($name, 0, strpos($name, $file['extension']) - 1); + $file['title'] = (!empty($title) and $title != $name) ? htmlspecialchars($title) : $name; $file['title'] = $purifier->purify($file['title']); $file['size'] = $size; $file['tmpname'] = $tmp_name; @@ -287,8 +287,8 @@ class fileModel extends model /** * Get extension of a file. - * - * @param string $filename + * + * @param string $filename * @access public * @return string */ @@ -303,8 +303,8 @@ class fileModel extends model /** * Get save name. - * - * @param string $pathName + * + * @param string $pathName * @access public * @return string */ @@ -316,8 +316,8 @@ class fileModel extends model /** * Get real path name. - * - * @param string $pathName + * + * @param string $pathName * @access public * @return string */ @@ -331,8 +331,8 @@ class fileModel extends model /** * Get export tpl. - * - * @param string $module + * + * @param string $module * @access public * @return object */ @@ -349,8 +349,8 @@ class fileModel extends model /** * Save export template. - * - * @param string $module + * + * @param string $module * @access public * @return int */ @@ -369,9 +369,9 @@ class fileModel extends model /** * Set path name of the uploaded file to be saved. - * - * @param int $fileID - * @param string $extension + * + * @param int $fileID + * @param string $extension * @access public * @return string */ @@ -384,7 +384,7 @@ class fileModel extends model /** * Set save path. - * + * * @access public * @return void */ @@ -398,10 +398,10 @@ class fileModel extends model } $this->savePath = dirname($savePath) . '/'; } - + /** * Set the web path of upload files. - * + * * @access public * @return void */ @@ -412,9 +412,9 @@ class fileModel extends model /** * Insert the set image size code. - * - * @param string $content - * @param int $maxSize + * + * @param string $content + * @param int $maxSize * @access public * @return string */ @@ -463,9 +463,9 @@ class fileModel extends model } /** - * Paste image in kindeditor at firefox and chrome. - * - * @param string $data + * Paste image in kindeditor at firefox and chrome. + * + * @param string $data * @access public * @return string */ @@ -503,8 +503,8 @@ class fileModel extends model /** * Parse CSV. - * - * @param string $fileName + * + * @param string $fileName * @access public * @return array */ @@ -606,8 +606,8 @@ class fileModel extends model /** * Remove interference for parse csv. - * - * @param array $matchs + * + * @param array $matchs * @access private * @return string */ @@ -619,9 +619,9 @@ class fileModel extends model /** * Process editor. - * - * @param object $data - * @param string $editorList + * + * @param object $data + * @param string $editorList * @access public * @return object */ @@ -662,9 +662,9 @@ class fileModel extends model } /** - * Compress image - * - * @param array $file + * Compress image + * + * @param array $file * @access public * @return array */ @@ -699,15 +699,15 @@ class fileModel extends model * Webpage: de77.com * Version: 07.02.2010 * Source : https://github.com/acustodioo/pic/blob/master/imagecreatefrombmp.function.php - * - * @param string $filename + * + * @param string $filename * @access public * @return resource */ public function imagecreatefrombmp($filename) { $f = fopen($filename, "rb"); - //read header + //read header $header = fread($f, 54); $header = unpack('c2identifier/Vfile_size/Vreserved/Vbitmap_data/Vheader_size/'. 'Vwidth/Vheight/vplanes/vbits_per_pixel/Vcompression/Vdata_size/'. @@ -740,9 +740,9 @@ class fileModel extends model } /** - * Dwordize for imagecreatefrombmp - * - * @param streing $str + * Dwordize for imagecreatefrombmp + * + * @param streing $str * @access private * @return int */ @@ -756,10 +756,10 @@ class fileModel extends model /** * Update objectID. - * - * @param int $uid - * @param int $objectID - * @param string $objectType + * + * @param int $uid + * @param int $objectID + * @param string $objectType * @access public * @return bool */ @@ -779,10 +779,10 @@ class fileModel extends model } /** - * Revert real src. - * - * @param object $data - * @param string $fields + * Revert real src. + * + * @param object $data + * @param string $fields * @access public * @return object */ @@ -800,8 +800,8 @@ class fileModel extends model /** * Auto delete useless image. - * - * @param int $uid + * + * @param int $uid * @access public * @return void */ diff --git a/module/file/view/printfiles.html.php b/module/file/view/printfiles.html.php index 31ad8eef60..f72e2360b1 100644 --- a/module/file/view/printfiles.html.php +++ b/module/file/view/printfiles.html.php @@ -47,7 +47,7 @@ $sessionString .= session_name() . '=' . session_id(); { $uploadDate = $lang->file->uploadDate . substr($file->addedDate, 0, 10); $fileTitle = "
  •  " . $file->title; - if(strpos($file->title, ".{$file->extension}") === false) $fileTitle .= ".{$file->extension}"; + if(strpos($file->title, ".{$file->extension}") === false && $file->extension != 'txt') $fileTitle .= ".{$file->extension}"; $imageWidth = 0; if(stripos('jpg|jpeg|gif|png|bmp', $file->extension) !== false) { diff --git a/module/git/model.php b/module/git/model.php index 64e2cc3d7b..95c8502521 100644 --- a/module/git/model.php +++ b/module/git/model.php @@ -283,11 +283,11 @@ class gitModel extends model exec("{$this->client} config core.quotepath false"); if($fromRevision) { - $cmd = "$this->client log --stat=1024 $fromRevision..HEAD --pretty=format:%an*_*%cd*_*%H*_*%s"; + $cmd = "$this->client log --stat=1024 --name-status $fromRevision..HEAD"; } else { - $cmd = "$this->client log --stat=1024 --pretty=format:%an*_*%cd*_*%H*_*%s"; + $cmd = "$this->client log --stat=1024 --name-status"; } exec($cmd, $list, $return); @@ -304,17 +304,11 @@ class gitModel extends model foreach($list as $line) { - if(!$line) - { - $i++; - continue; - } + if(strpos($line, 'commit ') === 0) $i++; $logs[$i][] = $line; } - foreach($logs as $log) - { - $parsedLogs[] = $this->convertLog($log); - } + + foreach($logs as $log) $parsedLogs[] = $this->convertLog($log); return $parsedLogs; } @@ -328,22 +322,35 @@ class gitModel extends model public function convertLog($log) { - list($account, $date, $hash, $comment) = explode('*_*', $log[0]); + list($hash, $account, $date) = $log; + + $account = preg_replace('/^Author:/', '', $account); + $account = trim(preg_replace('/<\w+@\w+\.\w+>/', '', $account)); + $date = trim(preg_replace('/^Date:/', '', $date)); + + $count = count($log); + $comment = ''; + $files = array(); + for($i = 3; $i < $count; $i++) + { + $line = $log[$i]; + if(preg_match('/^\s{2,}/', $line)) + { + $comment .= $line; + } + elseif(strpos($line, "\t") !== false) + { + list($action, $entry) = explode("\t", $line); + $entry = '/' . trim($entry); + $files[$action][] = $entry; + } + } $parsedLog = new stdClass(); $parsedLog->author = $account; - $parsedLog->revision = $hash; - $parsedLog->msg = $comment; + $parsedLog->revision = trim(preg_replace('/^commit/', '', $hash)); + $parsedLog->msg = trim($comment); $parsedLog->date = date('Y-m-d H:i:s', strtotime($date)); - $parsedLog->files = array(); - - unset($log[0]); - foreach($log as $change) - { - if(strpos($change, '|') === false) continue; - list($entry, $modify) = explode('|', $change); - $entry = '/' . trim($entry); - $parsedLog->files['M'][] = $entry; - } + $parsedLog->files = $files; return $parsedLog; } diff --git a/module/message/control.php b/module/message/control.php index 83b4826312..c214f35193 100644 --- a/module/message/control.php +++ b/module/message/control.php @@ -12,8 +12,8 @@ class message extends control { /** - * Index - * + * Index + * * @access public * @return void */ @@ -32,8 +32,8 @@ class message extends control } /** - * Setting - * + * Setting + * * @access public * @return void */ @@ -65,7 +65,7 @@ class message extends control /** * Ajax get message. - * + * * @access public * @return void */ @@ -96,7 +96,7 @@ class message extends control { echo << - +
    {$messages}
  • diff --git a/module/productplan/view/linkbug.html.php b/module/productplan/view/linkbug.html.php index b7feb46fef..3381a10f34 100644 --- a/module/productplan/view/linkbug.html.php +++ b/module/productplan/view/linkbug.html.php @@ -10,13 +10,13 @@ * @link http://www.zentao.net */ ?> -
    +
    id&browseType=$browseType¶m=$param&orderBy=$orderBy")?>'>
    productplan->unlinkedBugs;?>
    - +
    @@ -71,3 +71,6 @@ + diff --git a/module/productplan/view/linkstory.html.php b/module/productplan/view/linkstory.html.php index c162604a74..2efb220ace 100644 --- a/module/productplan/view/linkstory.html.php +++ b/module/productplan/view/linkstory.html.php @@ -10,13 +10,13 @@ * @link http://www.zentao.net */ ?> -
    +
    id&browseType=$browseType¶m=$param&orderBy=$orderBy")?>">
    productplan->unlinkedStories;?>
    - +
    @@ -79,3 +79,6 @@ + diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index cc401bdff8..20cdad30d9 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -12,6 +12,7 @@ ?> + productplan->confirmUnlinkStory)?> productplan->confirmUnlinkBug)?> id);?> diff --git a/module/project/js/story.js b/module/project/js/story.js index 75bac77fec..cea313b85c 100644 --- a/module/project/js/story.js +++ b/module/project/js/story.js @@ -28,6 +28,7 @@ $(function() parent.location.href = createLink('project', 'importPlanStories', 'projectID=' + projectID + '&planID=' + planID); } }) + $('.sorter-false a').unwrap(); }); function showCheckedSummary() diff --git a/module/project/view/importbug.html.php b/module/project/view/importbug.html.php index d554475ddd..d133b1b3c4 100755 --- a/module/project/view/importbug.html.php +++ b/module/project/view/importbug.html.php @@ -51,7 +51,7 @@ var browseType = '';
    - +
    id) . html::hidden("id[$bug->id]", $bug->id);?> diff --git a/module/project/view/linkstory.html.php b/module/project/view/linkstory.html.php index 147b5eb036..caf5cd0058 100644 --- a/module/project/view/linkstory.html.php +++ b/module/project/view/linkstory.html.php @@ -11,6 +11,7 @@ */ ?> + @@ -27,7 +28,7 @@
    - +
    diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index 729666b109..2790f044eb 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -12,6 +12,7 @@ ?> + @@ -97,7 +98,7 @@
    - +
    id}&orderBy=%s&type=$type¶m=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?> - - + - - - - - - - + + + + + + + - + diff --git a/module/release/view/linkbug.html.php b/module/release/view/linkbug.html.php index 147ee83160..dcf28182d8 100644 --- a/module/release/view/linkbug.html.php +++ b/module/release/view/linkbug.html.php @@ -20,7 +20,7 @@ $formID = $type == 'leftBug' ? 'unlinkedLeftBugsForm' : 'unlinkedBugsForm';
    productplan->unlinkedBugs;?>
    -
    +
    @@ -115,19 +116,19 @@ idAB);?>
    project->updateOrder);?> project->updateOrder);?> priAB);?> story->title);?> openedByAB);?> assignedToAB);?> story->estimateAB);?> statusAB);?> story->stageAB);?> priAB);?> story->title);?> openedByAB);?> assignedToAB);?> story->estimateAB);?> statusAB);?> story->stageAB);?> story->taskCountAB;?> story->bugCountAB;?> story->caseCountAB;?>actions;?>actions;?>
    +
    @@ -75,3 +75,6 @@ $formID = $type == 'leftBug' ? 'unlinkedLeftBugsForm' : 'unlinkedBugsForm'; + diff --git a/module/release/view/linkstory.html.php b/module/release/view/linkstory.html.php index cc27f57bb9..80ec3ef12b 100644 --- a/module/release/view/linkstory.html.php +++ b/module/release/view/linkstory.html.php @@ -16,7 +16,7 @@
    productplan->unlinkedStories;?>
    - +
    + @@ -147,7 +147,7 @@ - + @@ -161,7 +161,7 @@ - + diff --git a/module/story/view/linkstory.html.php b/module/story/view/linkstory.html.php index 372fdbc411..e2d2be67ae 100644 --- a/module/story/view/linkstory.html.php +++ b/module/story/view/linkstory.html.php @@ -11,6 +11,7 @@ */ ?> +
    @@ -25,7 +26,7 @@
    -
    @@ -74,4 +74,7 @@
    - \ No newline at end of file + + diff --git a/module/release/view/view.html.php b/module/release/view/view.html.php index a516c9e0f9..5d2e6433d2 100644 --- a/module/release/view/view.html.php +++ b/module/release/view/view.html.php @@ -11,6 +11,7 @@ */ ?> + release->confirmUnlinkStory)?> release->confirmUnlinkBug)?>

    story->batchCreate;?>

    - createLink('file', 'uploadImages', 'module=story¶ms=' . helper::safe64Encode("productID=$productID&branch=$branch&moduleID=$moduleID")), $lang->uploadImages, '', "data-toggle='modal' data-type='iframe' class='btn btn-info' data-width='70%'")?> - + createLink('file', 'uploadImages', 'module=story¶ms=' . helper::safe64Encode("productID=$productID&branch=$branch&moduleID=$moduleID")), $lang->uploadImages, '', "data-toggle='modal' data-type='iframe' class='btn btn-primary' data-width='70%'")?> + createLink('custom', 'ajaxSaveCustomFields', 'module=story§ion=custom&key=batchCreateFields')?>
    diff --git a/module/story/view/change.html.php b/module/story/view/change.html.php index 2e0ba133e9..55e4c50009 100644 --- a/module/story/view/change.html.php +++ b/module/story/view/change.html.php @@ -26,7 +26,7 @@
    story->reviewedBy;?>
    - assignedTo, 'class="form-control chosen"');?> + reviewedBy, 'class="form-control chosen"');?> story->checkForceReview()):?> story->needNotReview, '', "id='needNotReview' {$needReview}");?> diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index e6a88ec078..d588bae60a 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -122,9 +122,9 @@
    story->pri;?> - + - +
    story->spec;?> story->specTemplate) . "'");?>
    story->legendAttatch;?> fetch('file', 'buildform');?>
    story->mailto;?>
    +
    diff --git a/module/testcase/css/batchcreate.css b/module/testcase/css/batchcreate.css index 8edac19133..fccb26098a 100644 --- a/module/testcase/css/batchcreate.css +++ b/module/testcase/css/batchcreate.css @@ -9,4 +9,3 @@ #batchCreateForm .input-group .form-control {position: static;} #batchCreateForm .input-group .colorpicker {z-index: 2;} #batchCreateForm .input-group .colorpicker.open {z-index: 5;} -#batchCreateForm {overflow-x: auto;} diff --git a/module/testcase/view/batchcreate.html.php b/module/testcase/view/batchcreate.html.php index c932fcc709..a3ec7526bc 100644 --- a/module/testcase/view/batchcreate.html.php +++ b/module/testcase/view/batchcreate.html.php @@ -24,7 +24,7 @@
    - + createLink('custom', 'ajaxSaveCustomFields', 'module=testcase§ion=custom&key=batchCreateFields')?>
    diff --git a/module/testcase/view/create.html.php b/module/testcase/view/create.html.php index 4fefa6957a..d8a9f6f333 100644 --- a/module/testcase/view/create.html.php +++ b/module/testcase/view/create.html.php @@ -125,7 +125,7 @@ - + @@ -182,7 +182,7 @@ type)) $step->type = 'step';?>
    - type === 'group') echo ' checked' ?>> + type === 'group') echo ' checked' ?>>
    diff --git a/module/testcase/view/linkcases.html.php b/module/testcase/view/linkcases.html.php index 3687fc01fd..d8d2ff8073 100644 --- a/module/testcase/view/linkcases.html.php +++ b/module/testcase/view/linkcases.html.php @@ -11,6 +11,7 @@ */ ?> +

    @@ -22,7 +23,7 @@
    -

    diff --git a/module/task/css/batchcreate.css b/module/task/css/batchcreate.css index 8846e86a9a..e5fdbccedb 100644 --- a/module/task/css/batchcreate.css +++ b/module/task/css/batchcreate.css @@ -7,7 +7,6 @@ #batchCreateForm .input-group .form-control {position: static;} #batchCreateForm .input-group .colorpicker {z-index: 2;} #batchCreateForm .input-group .colorpicker.open {z-index: 5;} -#batchCreateForm{overflow-x:auto;} .main-header .pull-left {max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;} diff --git a/module/task/css/batchedit.css b/module/task/css/batchedit.css index 102e960b82..9ef9eaa117 100644 --- a/module/task/css/batchedit.css +++ b/module/task/css/batchedit.css @@ -1,2 +1 @@ .chosen-container[id^="module"] .chosen-drop {min-width: 400px;!important} -#batchEditForm{overflow-x:auto;} diff --git a/module/task/model.php b/module/task/model.php index 5c6a6ee4b8..20635a2f38 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1468,7 +1468,7 @@ class taskModel extends model public function getProjectTasks($projectID, $productID = 0, $type = 'all', $modules = 0, $orderBy = 'status_asc, id_desc', $pager = null) { if(is_string($type)) $type = strtolower($type); - $tasks = $this->dao->select('t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.product, t2.branch, t2.version AS latestStoryVersion, t2.status AS storyStatus, t3.realname AS assignedToRealName') + $tasks = $this->dao->select('DISTINCT t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.product, t2.branch, t2.version AS latestStoryVersion, t2.status AS storyStatus, t3.realname AS assignedToRealName') ->from(TABLE_TASK)->alias('t1') ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') ->leftJoin(TABLE_USER)->alias('t3')->on('t1.assignedTo = t3.account') @@ -1504,7 +1504,7 @@ class taskModel extends model } /* Select children task. */ - $children = $this->dao->select('t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.product, t2.branch, t2.version AS latestStoryVersion, t2.status AS storyStatus, t3.realname AS assignedToRealName') + $children = $this->dao->select('DISTINCT t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.product, t2.branch, t2.version AS latestStoryVersion, t2.status AS storyStatus, t3.realname AS assignedToRealName') ->from(TABLE_TASK)->alias('t1') ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') ->leftJoin(TABLE_USER)->alias('t3')->on('t1.assignedTo = t3.account') diff --git a/module/task/view/batchcreate.html.php b/module/task/view/batchcreate.html.php index fe76824883..766cb9b177 100644 --- a/module/task/view/batchcreate.html.php +++ b/module/task/view/batchcreate.html.php @@ -28,7 +28,7 @@
    - + createLink('custom', 'ajaxSaveCustomFields', 'module=task§ion=custom&key=batchCreateFields')?>
    diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index dfc6acdbcf..4ab7fa69b7 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -107,7 +107,7 @@ pri, "class='form-control chosen'");?> - pri, "class='form-control' data-provide='labelSelector'");?> + pri, "class='form-control' data-provide='labelSelector' data-label-class='label-pri'");?>
    +
    diff --git a/module/testsuite/view/linkcase.html.php b/module/testsuite/view/linkcase.html.php index ce296f60af..70eab0c1cd 100644 --- a/module/testsuite/view/linkcase.html.php +++ b/module/testsuite/view/linkcase.html.php @@ -30,7 +30,7 @@
     testsuite->unlinkedCases;?> (recTotal;?>)
    -
    diff --git a/module/testsuite/view/createcase.html.php b/module/testsuite/view/createcase.html.php index 376c80b05d..c86a06a4e8 100644 --- a/module/testsuite/view/createcase.html.php +++ b/module/testsuite/view/createcase.html.php @@ -95,7 +95,7 @@ - +
    +
    diff --git a/module/testtask/view/linkcase.html.php b/module/testtask/view/linkcase.html.php index c028ce195c..aae5e77e5e 100644 --- a/module/testtask/view/linkcase.html.php +++ b/module/testtask/view/linkcase.html.php @@ -11,6 +11,7 @@ */ ?> +