diff --git a/framework/base/control.class.php b/framework/base/control.class.php index 13aebfc8ac..1778c5c804 100644 --- a/framework/base/control.class.php +++ b/framework/base/control.class.php @@ -16,7 +16,7 @@ class baseControl /** * 全局对象 $app。 * The global $app object. - * + * * @var object * @access public */ @@ -25,7 +25,7 @@ class baseControl /** * 应用名称 $appName * The global $appName. - * + * * @var string * @access public */ @@ -34,7 +34,7 @@ class baseControl /** * 全局对象 $config。 * The global $config object. - * + * * @var object * @access public */ @@ -43,7 +43,7 @@ class baseControl /** * 全局对象 $lang。 * The global $lang object. - * + * * @var object * @access public */ @@ -52,7 +52,7 @@ class baseControl /** * 全局对象 $dbh,数据库连接句柄。 * The global $dbh object, the database connection handler. - * + * * @var object * @access public */ @@ -61,7 +61,7 @@ class baseControl /** * $dao对象,实现sql的拼装和执行。 * The $dao object, used to join sql and excute sql. - * + * * @var object * @access public */ @@ -70,7 +70,7 @@ class baseControl /** * $post对象,用户可以通过$this->post->key来引用$_POST变量。 * The $post object, useer can access a post var by $this->post->key. - * + * * @var object * @access public */ @@ -79,7 +79,7 @@ class baseControl /** * $get对象,用户可以通过$this->get->key来引用$_GET变量。 * The $get object, useer can access a get var by $this->get->key. - * + * * @var object * @access public */ @@ -88,7 +88,7 @@ class baseControl /** * $session对象,用户可以通过$this->session->key来引用$_SESSION变量。 * The $session object, useer can access a session var by $this->session->key. - * + * * @var object * @access public */ @@ -97,7 +97,7 @@ class baseControl /** * $server对象,用户可以通过$this->server->key来引用$_SERVER变量。 * The $server object, useer can access a server var by $this->server->key. - * + * * @var object * @access public */ @@ -106,7 +106,7 @@ class baseControl /** * $cookie对象,用户可以通过$this->cookie->key来引用$_COOKIE变量。 * The $cookie object, useer can access a cookie var by $this->cookie->key. - * + * * @var object * @access public */ @@ -115,7 +115,7 @@ class baseControl /** * 当前模块的名称。 * The name of current module. - * + * * @var string * @access public */ @@ -124,16 +124,16 @@ class baseControl /** * $view用于存放从control传到view视图的数据。 * The vars assigned to the view page. - * + * * @var object * @access public */ - public $view; + public $view; /** * 视图的类型,比如html, json。 * The type of the view, such html, json. - * + * * @var string * @access public */ @@ -142,7 +142,7 @@ class baseControl /** * 输出到浏览器的内容。 * The content to display. - * + * * @var string * @access public */ @@ -151,25 +151,25 @@ class baseControl /** * 客户端设备。 * The client device. - * - * @var string + * + * @var string * @access public */ public $clientDevice; /** * 不同设备下视图文件的前缀。 - * The prefix of view file for mobile or PC. - * - * @var string + * The prefix of view file for mobile or PC. + * + * @var string * @access public */ public $devicePrefix; /** - * 构造方法。 - * - * 1. 将全局变量设为baseControl类的成员变量,方便baseControl的派生类调用; + * 构造方法。 + * + * 1. 将全局变量设为baseControl类的成员变量,方便baseControl的派生类调用; * 2. 设置当前模块,读取该模块的model类; * 3. 初始化$view视图类。 * @@ -178,10 +178,10 @@ class baseControl * 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. * 3. auto assign the $lang and $config to the view. - * - * @param string $moduleName - * @param string $methodName - * @param string $appName + * + * @param string $moduleName + * @param string $methodName + * @param string $appName * @access public * @return void */ @@ -234,10 +234,10 @@ class baseControl //-------------------- Model相关方法(Model related methods) --------------------// - /* - * 设置模块名。 - * Set the module name. - * + /* + * 设置模块名。 + * Set the module name. + * * @param string $moduleName 模块名,如果为空,则从$app中获取. The module name, if empty, get it from $app. * @access public * @return void @@ -250,8 +250,8 @@ class baseControl /** * 设置方法名。 * Set the method name. - * - * @param string $methodName 方法名,如果为空,则从$app中获取。The method name, if empty, get it from $app. + * + * @param string $methodName 方法名,如果为空,则从$app中获取。The method name, if empty, get it from $app. * @access public * @return void */ @@ -263,7 +263,7 @@ class baseControl /** * 加载指定模块的model文件。 * Load the model file of one module. - * + * * @param string $moduleName 模块名,如果为空,使用当前模块。The module name, if empty, use current module's name. * @param string $appName The app name, if empty, use current app's name. * @access public @@ -286,9 +286,9 @@ class baseControl /** * 如果没有model文件,尝试加载config配置信息。 - * If no model file, try load config. + * If no model file, try load config. */ - if(!helper::import($modelFile)) + if(!helper::import($modelFile)) { $this->app->loadModuleConfig($moduleName, $appName); $this->app->loadLang($moduleName, $appName); @@ -296,7 +296,7 @@ class baseControl return false; } - /** + /** * 如果没有扩展文件,model类名是$moduleName + 'model',如果有扩展,还需要增加ext前缀。 * If no extension file, model class name is $moduleName + 'model', else with 'ext' as the prefix. */ @@ -307,7 +307,7 @@ class baseControl if(!class_exists($modelClass)) $this->app->triggerError(" The model $modelClass not found", __FILE__, __LINE__, $exit = true); } - /** + /** * 初始化model对象,在control对象中可以通过$this->$moduleName来引用。同时将dao对象赋为control对象的成员变量,方便引用。 * Init the model object thus you can try $this->$moduleName to access it. Also assign the $dao object as a member of control object. */ @@ -320,7 +320,7 @@ class baseControl /** * 设置超级全局变量,方便直接引用。 * Set the super vars. - * + * * @access public * @return void */ @@ -336,7 +336,7 @@ class baseControl /** * 设置客户端的设备类型。 * Set client device. - * + * * @access public * @return void */ @@ -362,7 +362,7 @@ class baseControl /** * 设置视图文件:主视图文件,扩展视图文件, 站点扩展视图文件,以及钩子脚本。 * Set view files: the main file, extension view file, site extension view file and hook files. - * + * * @param string $moduleName module name * @param string $methodName method name * @access public @@ -401,15 +401,15 @@ class baseControl /** * 获取某一个视图文件的扩展。 * Get the extension file of an view. - * - * @param string $viewFile + * + * @param string $viewFile * @access public * @return string|bool If extension view file exists, return the path. Else return fasle. */ public function getExtViewFile($viewFile) { /** - * 首先找sitecode下的扩展文件,如果没有,再找ext下的扩展文件。 + * 首先找sitecode下的扩展文件,如果没有,再找ext下的扩展文件。 * Find extViewFile in ext/_$siteCode/view first, then try ext/view/. */ if($this->app->siteCode) @@ -437,9 +437,9 @@ class baseControl /** * 获取适用于当前方法的css:该模块公用的css + 当前方法的css + 扩展的css。 * Get css codes applied to current method: module common css + method css + extension css. - * - * @param string $moduleName - * @param string $methodName + * + * @param string $moduleName + * @param string $methodName * @access public * @return string */ @@ -504,8 +504,8 @@ class baseControl /** * Get extension css and extension css with lang. - * - * @param array $files + * + * @param array $files * @access public * @return string */ @@ -556,9 +556,9 @@ class baseControl /** * 获取适用于当前方法的js:该模块公用的js + 当前方法的js + 扩展的js。 * Get js codes applied to current method: module common js + method js + extension js. - * - * @param string $moduleName - * @param string $methodName + * + * @param string $moduleName + * @param string $methodName * @access public * @return string */ @@ -599,14 +599,14 @@ class baseControl if(!empty($jsExtFiles) and is_array($jsExtFiles)) foreach($jsExtFiles as $jsFile) $js .= file_get_contents($jsFile); } } - + return $js; } /** * 向$view传递一个变量。 * Assign one var to the view vars. - * + * * @param string $name the name. * @param mixed $value the value. * @access public @@ -631,7 +631,7 @@ class baseControl /** * 渲染视图文件。 - * Parse view file. + * Parse view file. * * @param string $moduleName module name, if empty, use current module. * @param string $methodName method name, if empty, use current method. @@ -698,7 +698,7 @@ class baseControl /** * 获得当前页面的CSS和JS。 - * Get css and js codes for current method. + * Get css and js codes for current method. */ $css = $this->getCSS($moduleName, $methodName); $js = $this->getJS($moduleName, $methodName); @@ -707,7 +707,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 pathes work. */ $currentPWD = getcwd(); chdir(dirname($viewFile)); @@ -725,7 +725,7 @@ class baseControl /** * 渲染完毕后,再切换回之前的路径。 - * At the end, chang the dir to the previous. + * At the end, chang the dir to the previous. */ chdir($currentPWD); } @@ -752,7 +752,7 @@ class baseControl if($moduleName == '') $moduleName = $this->moduleName; if($methodName == '') $methodName = $this->methodName; if($appName == '') $appName = $this->appName; - if($moduleName == $this->moduleName and $methodName == $this->methodName) + if($moduleName == $this->moduleName and $methodName == $this->methodName) { $this->parse($moduleName, $methodName); return $this->output; @@ -810,7 +810,7 @@ class baseControl /** * 加载控制器文件。 - * Load the control file. + * Load the control file. */ if(!is_file($file2Included)) $this->app->triggerError("The control file $file2Included not found", __FILE__, __LINE__, $exit = true); if(!class_exists($classNameToFetch)) @@ -821,26 +821,26 @@ class baseControl /** * 设置调用的类名。 - * Set the name of the class to be called. + * Set the name of the class to be called. */ $className = class_exists("my$moduleName") ? "my$moduleName" : $moduleName; if(!class_exists($className)) $this->app->triggerError(" The class $className not found", __FILE__, __LINE__, $exit = true); /** * 解析参数,创建模块control对象。 - * Parse the params, create the $module control object. + * Parse the params, create the $module control object. */ $module = new $className($moduleName, $methodName, $appName); /** * 调用对应方法,使用ob方法获取输出内容。 - * Call the method and use ob function to get the output. + * Call the method and use ob function to get the output. */ ob_start(); call_user_func_array(array($module, $methodName), $params); $output = ob_get_contents(); ob_end_clean(); - + unset($module); /** @@ -855,14 +855,14 @@ class baseControl /** * 返回内容。 - * Return the content. + * Return the content. */ return $output; } /** * 向浏览器输出内容。 - * Print the content of the view. + * Print the content of the view. * * @param string $moduleName module name * @param string $methodName method name @@ -875,12 +875,12 @@ class baseControl echo $this->output; } - /** + /** * 直接输出data数据,通常用于ajax请求中。 * Send data directly, for ajax requests. * - * @param misc $data - * @param string $type + * @param misc $data + * @param string $type * @access public * @return void */ @@ -897,7 +897,7 @@ class baseControl /** * 响应非ajax的请求。 - * Response request not ajax. + * Response request not ajax. */ if(isset($data['result']) and $data['result'] == 'success') { @@ -930,16 +930,16 @@ class baseControl * @access public * @return string the link string. */ - public function createLink($moduleName, $methodName = 'index', $vars = array(), $viewType = '', $onlybody = false, $PRJID = 0) + public function createLink($moduleName, $methodName = 'index', $vars = array(), $viewType = '', $onlybody = false) { if(empty($moduleName)) $moduleName = $this->moduleName; - return helper::createLink($moduleName, $methodName, $vars, $viewType, $onlybody, $PRJID); + return helper::createLink($moduleName, $methodName, $vars, $viewType, $onlybody); } /** * 创建当前模块的一个方法链接。 * Create a link to the inner method of current module. - * + * * @param string $methodName method name * @param string|array $vars the params passed, can be array(key=>value) or key1=value1&key2=value2 * @param string $viewType the view type @@ -954,7 +954,7 @@ class baseControl /** * 重定向到另一个页面。 * Location to another page. - * + * * @param string $url the target url. * @access public * @return void diff --git a/module/block/control.php b/module/block/control.php index 8388eca3f7..97b8c240ed 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -1687,7 +1687,8 @@ class block extends control $stmt = $this->dao->select('*')->from(TABLE_TODO) ->where("(assignedTo = '{$this->app->user->account}' or (account='{$this->app->user->account}'))") ->andWhere('cycle')->eq(0) - ->orderBy('`date`'); + ->andWhere('status')->eq('wait') + ->orderBy('`date` desc'); if(isset($params->todoNum)) $stmt->limit($params->todoNum); $todos = $stmt->fetchAll(); diff --git a/module/bug/css/create.css b/module/bug/css/create.css index 750aea0dd8..554b1268aa 100644 --- a/module/bug/css/create.css +++ b/module/bug/css/create.css @@ -9,7 +9,6 @@ html[lang='en'] #deadlineTd .input-group-addon {padding: 5px 18px;} .bootbox-prompt .modal-dialog {width: 500px; margin-top: 10%;} #buildBoxActions {padding-left: 15px;} -#executionIdBox {display: block;} #module + .chosen-container-single .chosen-single, #task + .chosen-container-single .chosen-single, diff --git a/module/bug/js/common.js b/module/bug/js/common.js index 4710eda4bf..26329670a7 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -272,6 +272,7 @@ function loadProductExecutions(productID, projectID = 0) $('#executionIdBox').load(link, function() { $(this).find('select').chosen(); + if(typeof(bugExecution) == 'string') $('#executionIdBox').prepend("" + bugExecution + ""); if(required) $(this).addClass('required'); }); } @@ -546,7 +547,9 @@ function notice() else { executionID = $('#execution').val(); - html += '' + createBuild + ' '; + link = createLink('build', 'create','executionID=' + executionID + '&productID=' + $('#product').val()); + link += config.requestType == 'GET' ? '&onlybody=yes' : '?onlybody=yes'; + html += '' + createBuild + ' '; html += '' + refresh + ''; } var $bba = $('#buildBoxActions'); diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index 1bdd2ad2b7..d42be5ddbd 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -72,7 +72,7 @@ js::set('oldProjectID', $projectID); - bug->execution : $lang->bug->type;?> + bug->project : $lang->bug->type;?> @@ -97,8 +97,11 @@ js::set('oldProjectID', $projectID);
-
- +
+
+ bug->execution;?> + +
@@ -322,6 +325,7 @@ js::set('oldProjectID', $projectID);
bug->module);?> +bug->execution);?> diff --git a/module/build/control.php b/module/build/control.php index 0627f029e3..520e2a6073 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -49,6 +49,11 @@ class build extends control $this->session->set('buildCreate', $this->app->getURI(true)); $execution = $this->execution->getByID($executionID); + /* Set menu. */ + $executions = $this->execution->getPairs($execution->project); + $this->execution->setMenu($executions, $executionID); + commonModel::setAppObjectID('execution', $executionID); + $productGroups = $this->execution->getProducts($executionID); $productID = $productID ? $productID : key($productGroups); $products = array(); diff --git a/module/common/lang/de.php b/module/common/lang/de.php index b302f9d062..f34b32fcf5 100644 --- a/module/common/lang/de.php +++ b/module/common/lang/de.php @@ -312,12 +312,13 @@ $lang->my->workMenu->testcase = 'Test Case|my|work|mode=testcase&type=assignt $lang->my->workMenu->testtask = 'Test Task|my|work|mode=testtask&type=wait'; $lang->my->contributeMenu = new stdclass(); -$lang->my->contributeMenu->task = 'Task|my|contribute|mode=task'; +$lang->my->contributeMenu->task = 'Task|my|contribute|mode=task'; f($config->URAndSR) $lang->my->contributeMenu->requirement = "$lang->URCommon|my|contribute|mode=requirement"; -$lang->my->contributeMenu->story = "$lang->SRCommon|my|contribute|mode=story"; -$lang->my->contributeMenu->bug = 'Bug|my|contribute|mode=bug'; -$lang->my->contributeMenu->testcase = 'Test Case|my|contribute|mode=testtask&type=openedbyme'; -$lang->my->contributeMenu->testtask = 'Test Task|my|contribute|mode=testtask&type=done'; +$lang->my->contributeMenu->story = "$lang->SRCommon|my|contribute|mode=story"; +$lang->my->contributeMenu->bug = 'Bug|my|contribute|mode=bug'; +$lang->my->contributeMenu->testcase = 'Test Case|my|contribute|mode=testtask&type=openedbyme'; +$lang->my->contributeMenu->testtask = 'Test Task|my|contribute|mode=testtask&type=done'; +$lang->my->contributeMenu->doc = 'Doc|my|contribute|mode=doc&type=openedbyme'; $lang->my->dividerMenu = ',myWork,score,'; diff --git a/module/common/lang/en.php b/module/common/lang/en.php index 3dcd3ee4ff..0460c360d8 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -313,12 +313,13 @@ $lang->my->workMenu->testcase = 'Test Case|my|work|mode=testcase&type=assignt $lang->my->workMenu->testtask = 'Test Task|my|work|mode=testtask&type=wait'; $lang->my->contributeMenu = new stdclass(); -$lang->my->contributeMenu->task = 'Task|my|contribute|mode=task'; +$lang->my->contributeMenu->task = 'Task|my|contribute|mode=task'; if($config->URAndSR) $lang->my->contributeMenu->requirement = "$lang->URCommon|my|contribute|mode=requirement"; -$lang->my->contributeMenu->story = "$lang->SRCommon|my|contribute|mode=story"; -$lang->my->contributeMenu->bug = 'Bug|my|contribute|mode=bug'; -$lang->my->contributeMenu->testcase = 'Test Case|my|contribute|mode=testtask&type=openedbyme'; -$lang->my->contributeMenu->testtask = 'Test Task|my|contribute|mode=testtask&type=done'; +$lang->my->contributeMenu->story = "$lang->SRCommon|my|contribute|mode=story"; +$lang->my->contributeMenu->bug = 'Bug|my|contribute|mode=bug'; +$lang->my->contributeMenu->testcase = 'Test Case|my|contribute|mode=testtask&type=openedbyme'; +$lang->my->contributeMenu->testtask = 'Test Task|my|contribute|mode=testtask&type=done'; +$lang->my->contributeMenu->doc = 'Doc|my|contribute|mode=doc&type=openedbyme'; $lang->my->dividerMenu = ',myWork,score,'; @@ -622,10 +623,11 @@ $lang->navGroup->measrecord = 'project'; $lang->navGroup->execution = 'execution'; $lang->navGroup->task = 'execution'; $lang->navGroup->build = 'execution'; -$lang->navGroup->repo = 'execution'; $lang->navGroup->doc = 'doc'; +$lang->navGroup->qa = 'qa'; + $lang->navGroup->sqlbuilder = 'system'; $lang->navGroup->auditcl = 'system'; $lang->navGroup->cmcl = 'system'; @@ -857,7 +859,7 @@ $lang->menu = new stdclass(); $lang->menu->scrum = new stdclass(); $lang->menu->scrum->index = 'Index|project|index|project={PROJECT}'; $lang->menu->scrum->project = "$lang->executionCommon|project|index|locate=no"; -$lang->menu->scrum->projectstory = array('link' => $lang->SRCommon . '|projectstory|story', 'subModule' => 'story', 'alias' => 'story,track'); +$lang->menu->scrum->projectstory = array('link' => $lang->SRCommon . '|projectstory|story|project={PROJECT}', 'subModule' => 'story', 'alias' => 'story,track'); $lang->menu->scrum->doc = 'Doc|doc|index|'; $lang->menu->scrum->qa = 'QA|qa|index'; $lang->menu->scrum->ci = 'Code|repo|browse'; @@ -882,7 +884,7 @@ $lang->menu->waterfall->programplan = array('link' => 'Plan|programplan|brows $lang->menu->waterfall->project = array('link' => $lang->executionCommon . '|project|task|executionID={EXECUTION}', 'subModule' => ',project,task,'); $lang->menu->waterfall->doc = array('link' => 'Doc|doc|index|project={PROJECT}'); $lang->menu->waterfall->weekly = array('link' => 'Weekly|weekly|index|project={PROJECT}', 'subModule' => ',milestone,'); -$lang->menu->waterfall->projectstory = array('link' => $lang->SRCommon . '|projectstory|story'); +$lang->menu->waterfall->projectstory = array('link' => $lang->SRCommon . '|projectstory|story|project={PROJECT}'); $lang->menu->waterfall->design = 'Design|design|browse|product={PRODUCT}'; $lang->menu->waterfall->ci = 'Repo|repo|browse|'; $lang->menu->waterfall->track = array('link' => 'Track|projectstory|track', 'alias' => 'track'); diff --git a/module/common/lang/fr.php b/module/common/lang/fr.php index 51d9e85f4d..5b852c04af 100644 --- a/module/common/lang/fr.php +++ b/module/common/lang/fr.php @@ -312,12 +312,13 @@ $lang->my->workMenu->testcase = 'Test Case|my|work|mode=testcase&type=assignt $lang->my->workMenu->testtask = 'Test Task|my|work|mode=testtask&type=wait'; $lang->my->contributeMenu = new stdclass(); -$lang->my->contributeMenu->task = 'Task|my|contribute|mode=task'; +$lang->my->contributeMenu->task = 'Task|my|contribute|mode=task'; if($config->URAndSR) $lang->my->contributeMenu->requirement = "$lang->URCommon|my|contribute|mode=requirement"; -$lang->my->contributeMenu->story = "$lang->SRCommon|my|contribute|mode=story"; -$lang->my->contributeMenu->bug = 'Bug|my|contribute|mode=bug'; -$lang->my->contributeMenu->testcase = 'Test Case|my|contribute|mode=testtask&type=openedbyme'; -$lang->my->contributeMenu->testtask = 'Test Task|my|contribute|mode=testtask&type=done'; +$lang->my->contributeMenu->story = "$lang->SRCommon|my|contribute|mode=story"; +$lang->my->contributeMenu->bug = 'Bug|my|contribute|mode=bug'; +$lang->my->contributeMenu->testcase = 'Test Case|my|contribute|mode=testtask&type=openedbyme'; +$lang->my->contributeMenu->testtask = 'Test Task|my|contribute|mode=testtask&type=done'; +$lang->my->contributeMenu->doc = 'Doc|my|contribute|mode=doc&type=openedbyme'; $lang->my->dividerMenu = ',myWork,score,'; diff --git a/module/common/lang/vi.php b/module/common/lang/vi.php index e827cb78b7..e3e47d432e 100644 --- a/module/common/lang/vi.php +++ b/module/common/lang/vi.php @@ -312,12 +312,13 @@ $lang->my->workMenu->testcase = 'Test Case|my|work|mode=testcase&type=assignt $lang->my->workMenu->testtask = 'Test Task|my|work|mode=testtask&type=wait'; $lang->my->contributeMenu = new stdclass(); -$lang->my->contributeMenu->task = 'Task|my|contribute|mode=task'; +$lang->my->contributeMenu->task = 'Task|my|contribute|mode=task'; if($config->URAndSR) $lang->my->contributeMenu->requirement = "$lang->URCommon|my|contribute|mode=requirement"; -$lang->my->contributeMenu->story = "$lang->SRCommon|my|contribute|mode=story"; -$lang->my->contributeMenu->bug = 'Bug|my|contribute|mode=bug'; -$lang->my->contributeMenu->testcase = 'Test Case|my|contribute|mode=testtask&type=openedbyme'; -$lang->my->contributeMenu->testtask = 'Test Task|my|contribute|mode=testtask&type=done'; +$lang->my->contributeMenu->story = "$lang->SRCommon|my|contribute|mode=story"; +$lang->my->contributeMenu->bug = 'Bug|my|contribute|mode=bug'; +$lang->my->contributeMenu->testcase = 'Test Case|my|contribute|mode=testtask&type=openedbyme'; +$lang->my->contributeMenu->testtask = 'Test Task|my|contribute|mode=testtask&type=done'; +$lang->my->contributeMenu->doc = 'Doc|my|contribute|mode=doc&type=openedbyme'; $lang->my->dividerMenu = ',myProject,team,'; diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index a007624196..24fac298e1 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -313,12 +313,13 @@ $lang->my->workMenu->testcase = '用例|my|work|mode=testcase&type=assigntome $lang->my->workMenu->testtask = '测试单|my|work|mode=testtask&type=wait'; $lang->my->contributeMenu = new stdclass(); -$lang->my->contributeMenu->task = '任务|my|contribute|mode=task'; +$lang->my->contributeMenu->task = '任务|my|contribute|mode=task'; if($config->URAndSR) $lang->my->contributeMenu->requirement = "$lang->URCommon|my|contribute|mode=requirement"; -$lang->my->contributeMenu->story = "$lang->SRCommon|my|contribute|mode=story"; -$lang->my->contributeMenu->bug = 'Bug|my|contribute|mode=bug'; -$lang->my->contributeMenu->testcase = '用例|my|contribute|mode=testcase&type=openedbyme'; -$lang->my->contributeMenu->testtask = '测试单|my|contribute|mode=testtask&type=done'; +$lang->my->contributeMenu->story = "$lang->SRCommon|my|contribute|mode=story"; +$lang->my->contributeMenu->bug = 'Bug|my|contribute|mode=bug'; +$lang->my->contributeMenu->testcase = '用例|my|contribute|mode=testcase&type=openedbyme'; +$lang->my->contributeMenu->testtask = '测试单|my|contribute|mode=testtask&type=done'; +$lang->my->contributeMenu->doc = '文档|my|contribute|mode=doc&type=openedbyme'; $lang->my->dividerMenu = ',myWork,score,'; @@ -335,7 +336,7 @@ $lang->story->menu = $lang->product->menu; $lang->execution = new stdclass(); $lang->execution->homeMenu = new stdclass(); $lang->execution->homeMenu->index = '仪表盘|execution|index|'; -$lang->execution->homeMenu->list = array('link' => '执行|execution|all|', 'alias' => 'batchedit'); +$lang->execution->homeMenu->list = array('link' => '执行|execution|all|', 'alias' => 'create,batchedit'); $lang->execution->menu = new stdclass(); $lang->execution->menu->task = array('link' => '任务|execution|task|executionID=%s', 'subModule' => 'task,tree', 'alias' => 'importtask,importbug'); @@ -345,7 +346,7 @@ $lang->execution->menu->view = array('link' => '视图|execution|grouptask|e $lang->execution->menu->story = array('link' => "{$lang->SRCommon}|execution|story|executionID=%s", 'subModule' => 'story', 'alias' => 'linkstory,storykanban'); $lang->execution->menu->qa = array('link' => '测试|execution|qa|executionID=%s', 'subModule' => 'bug', 'alias' => 'qa,bug,testcase,testtask,testreport'); $lang->execution->menu->repo = array('link' => '代码|repo|browse|projectID=%s'); -$lang->execution->menu->doc = array('link' => '文档|doc|objectLibs|type=execution&objectID=%s&from=execution', 'subModule' => 'doc'); +$lang->execution->menu->doc = array('link' => '文档|doc|objectLibs|type=execution&objectID=%s', 'subModule' => 'doc'); $lang->execution->menu->build = array('link' => '版本|execution|build|executionID=%s', 'subModule' => 'build'); $lang->execution->menu->release = array('link' => '发布|projectrelease|browse|project=%s'); $lang->execution->menu->action = array('link' => '动态|execution|dynamic|executionID=%s'); @@ -624,15 +625,15 @@ $lang->navGroup->jenkins = 'project'; $lang->navGroup->compile = 'project'; $lang->navGroup->report = 'project'; $lang->navGroup->measrecord = 'project'; -$lang->navGroup->qa = 'project'; $lang->navGroup->execution = 'execution'; $lang->navGroup->task = 'execution'; $lang->navGroup->build = 'execution'; -$lang->navGroup->repo = 'execution'; $lang->navGroup->doc = 'doc'; +$lang->navGroup->qa = 'qa'; + $lang->navGroup->company = 'system'; $lang->navGroup->sqlbuilder = 'system'; $lang->navGroup->auditcl = 'system'; @@ -863,8 +864,8 @@ $lang->icons['score'] = 'tint'; $lang->menu = new stdclass(); $lang->menu->scrum = new stdclass(); $lang->menu->scrum->index = '仪表盘|project|index|project={PROJECT}'; -$lang->menu->scrum->execution = "$lang->executionCommon|execution|all|status=all&projectID={PROJECT}&from=project"; -$lang->menu->scrum->projectstory = array('link' => $lang->SRCommon . '|projectstory|story', 'alias' => 'story,track'); +$lang->menu->scrum->execution = "$lang->executionCommon|execution|all|status=all&projectID={PROJECT}"; +$lang->menu->scrum->projectstory = array('link' => $lang->SRCommon . '|projectstory|story|projectID={PROJECT}', 'alias' => 'story,track'); $lang->menu->scrum->doc = array('link' => '文档|doc|objectLibs|type=project&objectID={PROJECT}', 'subModule' => 'doc'); $lang->menu->scrum->qa = array('link' => '测试|qa|index', 'subModule' => 'testcase,testtask'); $lang->menu->scrum->ci = '代码|repo|browse'; @@ -901,7 +902,7 @@ $lang->menu->waterfall->programplan = array('link' => '计划|programplan|bro $lang->menu->waterfall->project = array('link' => $lang->executionCommon . '|project|task|executionID={EXECUTION}', 'subModule' => ',project,task,'); $lang->menu->waterfall->doc = array('link' => '文档|doc|index|project={PROJECT}'); $lang->menu->waterfall->weekly = array('link' => '报告|weekly|index|project={PROJECT}', 'subModule' => ',milestone,'); -$lang->menu->waterfall->projectstory = array('link' => $lang->SRCommon . '|projectstory|story'); +$lang->menu->waterfall->projectstory = array('link' => $lang->SRCommon . '|projectstory|story|project={PROJECT}'); $lang->menu->waterfall->design = '设计|design|browse|product={PRODUCT}'; $lang->menu->waterfall->ci = '代码|repo|browse|'; $lang->menu->waterfall->track = array('link' => '矩阵|projectstory|track', 'alias' => 'track'); @@ -947,6 +948,6 @@ $lang->projectstory->menu = new stdclass(); $lang->stakeholder->menu = $lang->scrum->setMenu; $lang->nc->menu = $lang->auditplan->menu; -$lang->noMenuModule = array('report', 'my', 'todo', 'effort', 'program', 'product', 'execution', 'task', 'build', 'productplan', 'project', 'projectrelease', 'projectstory', 'story', 'branch', 'release', 'attend', 'leave', 'makeup', 'overtime', 'lieu', 'custom', 'admin', 'mail', 'extension', 'dev', 'backup', 'action', 'cron', 'pssp', 'sms', 'message', 'webhook', 'search', 'score', 'stage', 'entry'); +$lang->noMenuModule = array('report', 'my', 'todo', 'effort', 'program', 'product', 'execution', 'task', 'build', 'productplan', 'project', 'projectrelease', 'projectstory', 'story', 'branch', 'release', 'qa', 'attend', 'leave', 'makeup', 'overtime', 'lieu', 'custom', 'admin', 'mail', 'extension', 'dev', 'backup', 'action', 'cron', 'pssp', 'sms', 'message', 'webhook', 'search', 'score', 'stage', 'entry'); include (dirname(__FILE__) . '/menuOrder.php'); diff --git a/module/common/model.php b/module/common/model.php index 7039f9b5e4..04917e4964 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -2289,10 +2289,12 @@ EOD; { global $lang, $config; + /* If homeMenu is not exists or unset, display menu. */ if(!isset($lang->$openApp->homeMenu)) { - $lang->menu = $lang->$openApp->menu; + $lang->menu = $openApp == 'project' ? self::getProjectMainMenu($moduleName) : $lang->$openApp->menu; $lang->menuOrder = $lang->$openApp->menuOrder; + return; } @@ -2302,6 +2304,7 @@ EOD; return; } + /* If the method is in homeMenu, display homeMenu. */ foreach($lang->$openApp->homeMenu as $menu) { $link = is_array($menu) ? $menu['link'] : $menu; @@ -2314,22 +2317,9 @@ EOD; } } - if($openApp == 'project') - { - if($config->systemMode == 'classic' or ($moduleName == 'project' and $methodName == 'browse')) - { - $lang->menu = $lang->project->homeMenu; - } - else - { - $lang->menu = self::getProjectMainMenu($moduleName); - } - } - else - { - $lang->menu = $lang->$openApp->menu; - $lang->menuOrder = $lang->$openApp->menuOrder; - } + /* Default, display menu. */ + $lang->menu = $openApp == 'project' ? self::getProjectMainMenu($moduleName) : $lang->$openApp->menu; + $lang->menuOrder = $lang->$openApp->menuOrder; } /** @@ -2384,7 +2374,7 @@ EOD; self::initProjectSubmenu(); if($project->model == 'scrum') { - $lang->menuOrder = $lang->scrum->menuOrder; + $lang->project->menuOrder = $lang->scrum->menuOrder; /* The scrum project temporarily hides the trace matrix. */ unset($lang->projectstory->menu->track); @@ -2395,7 +2385,7 @@ EOD; { $lang->project->dividerMenu = str_replace(',project,', ',', $lang->project->dividerMenu); $lang->release->menu = new stdclass(); - $lang->menuOrder = $lang->waterfall->menuOrder; + $lang->project->menuOrder = $lang->waterfall->menuOrder; return self::processMenuVars($lang->menu->waterfall); } } @@ -2479,7 +2469,10 @@ EOD; foreach($lang->$openApp->menu as $label => $menu) { - $lang->$openApp->menu->{$label}['link'] = is_array($menu) ? sprintf($menu['link'], $objectID) : sprintf($menu, $objectID); + if(isset($lang->$openApp->menu->{$label}['link'])) + { + $lang->$openApp->menu->{$label}['link'] = is_array($menu) ? sprintf($menu['link'], $objectID) : sprintf($menu, $objectID); + } } if($openApp == 'program') diff --git a/module/common/view/header.html.php b/module/common/view/header.html.php index 69cb2853f8..5c66d3df83 100755 --- a/module/common/view/header.html.php +++ b/module/common/view/header.html.php @@ -29,7 +29,7 @@ $isQa = $app->openApp == 'qa'; project->switcherMenu) ? $lang->project->switcherMenu : '';;?> - + rawModule, $lang->noMenuModule)):?> diff --git a/module/doc/control.php b/module/doc/control.php index 3d6e7bcadd..09ed175f2c 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -567,10 +567,10 @@ class doc extends control /** * Delete file for doc. - * - * @param int $docID - * @param int $fileID - * @param string $confirm + * + * @param int $docID + * @param int $fileID + * @param string $confirm * @access public * @return void */ @@ -728,7 +728,7 @@ class doc extends control } /** - * Ajax get all child module. + * Ajax get all child module. * * @access public * @return void @@ -919,7 +919,7 @@ class doc extends control $this->lang->product->switcherMenu = $this->product->getSwitcher($objectID); $this->lang->noMenuModule[] = 'doc'; } - elseif($from == 'project') + elseif($from == 'project' or $from == 'execution') { if($this->config->systemMode == 'classic') $this->lang->noMenuModule[] = 'doc'; } @@ -947,7 +947,7 @@ class doc extends control $this->view->type = $type; $this->view->object = $object; - $this->view->from = $$from; + $this->view->from = $from; $this->view->libs = $this->doc->getLibsByObject($type, $objectID); $this->view->canBeChanged = common::canModify($type, $object); // Determines whether an object is editable. $this->display(); diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index 618877c5f7..f9e1b3a0a2 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -54,6 +54,7 @@ $lang->doc->searchDoc = '搜索'; $lang->doc->fast = '快速访问'; $lang->doc->allDoc = '所有文档'; $lang->doc->openedByMe = '由我创建'; +$lang->doc->editedByMe = '由我编辑'; $lang->doc->orderByOpen = '最近添加'; $lang->doc->orderByEdit = '最近更新'; $lang->doc->orderByVisit = '最近访问'; diff --git a/module/doc/model.php b/module/doc/model.php index 49798fb890..6470209568 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -356,6 +356,22 @@ class docModel extends model ->page($pager) ->fetchAll('id'); } + elseif($browseType == 'editedbyme') + { + $docIDList = $this->dao->select('objectID')->from(TABLE_ACTION) + ->where('objectType')->eq('doc') + ->andWhere('actor')->eq($this->app->user->account) + ->fetchAll('objectID'); + $docs = $this->dao->select('*')->from(TABLE_DOC) + ->where('deleted')->eq(0) + ->andWhere('id')->in(array_keys($docIDList)) + ->beginIF($libID)->andWhere('lib')->in($libID)->fi() + ->andWhere('lib')->in($allLibs) + ->beginIF($this->config->doc->notArticleType)->andWhere('type')->notIN($this->config->doc->notArticleType)->fi() + ->orderBy($sort) + ->page($pager) + ->fetchAll('id'); + } elseif($browseType == 'byediteddate') { $docs = $this->dao->select('*')->from(TABLE_DOC) @@ -1824,13 +1840,12 @@ class docModel extends model public function appendNavCSS() { $navCSS = ''; - if($this->lang->navGroup->doc == 'doc') + if($this->app->openApp == 'doc') { $navCSS .= <<app->rawMethod != 'index') $navCSS .= '.header-btn+.header-btn::after, .header-btn+.header-btn::before {top: -50px;}'; } diff --git a/module/execution/control.php b/module/execution/control.php index 3f2335728f..982ddc00c3 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1169,6 +1169,7 @@ class execution extends control /** * Create a execution. * + * @param string $projectID * @param string $productID * @param string $executionID * @param string $copyExecutionID @@ -1178,7 +1179,7 @@ class execution extends control * @access public * @return void */ - public function create($productID = '', $executionID = '', $copyExecutionID = '', $planID = 0, $confirm = 'no') + public function create($productID = '', $executionID = '', $copyExecutionID = '', $planID = 0, $confirm = 'no', $projectID = 0) { $this->app->loadLang('program'); $this->app->loadLang('stage'); @@ -1220,6 +1221,7 @@ class execution extends control $team = $copyExecution->team; $acl = $copyExecution->acl; $whitelist = $copyExecution->whitelist; + $projectID = $copyExecution->project; $products = $this->execution->getProducts($copyExecutionID); foreach($products as $product) { @@ -1268,19 +1270,6 @@ class execution extends control } } - $isSprint = true; - if($this->config->systemMode == 'new') - { - $project = $this->project->getById($this->session->PRJ); - if($project->model == 'scrum') - { - unset($this->lang->execution->endList[62]); - unset($this->lang->execution->endList[93]); - unset($this->lang->execution->endList[186]); - unset($this->lang->execution->endList[365]); - } - } - $executionID = key($this->executions); $this->execution->setMenu($this->executions, $executionID); @@ -1288,15 +1277,16 @@ class execution extends control $this->view->position[] = $this->view->title; $this->view->executions = array('' => '') + $this->execution->getList(); $this->view->groups = $this->loadModel('group')->getPairs(); - $this->view->allProducts = array(0 => '') + $this->loadModel('product')->getProductPairsByProject($this->session->PRJ); + $this->view->allProducts = array(0 => '') + $this->loadModel('product')->getProductPairsByProject($projectID); $this->view->acl = $acl; $this->view->plan = $plan; $this->view->name = $name; $this->view->code = $code; $this->view->team = $team; - $this->view->allProjects = array('' => '') + $this->project->getPairsByModel(); + $this->view->allProjects = array(0 => '') + $this->project->getPairsByModel(); $this->view->executionID = $executionID; $this->view->productID = $productID; + $this->view->projectID = $projectID; $this->view->products = $products; $this->view->productPlan = array(0 => '') + $productPlan; $this->view->productPlans = array(0 => '') + $productPlans; @@ -1304,7 +1294,6 @@ class execution extends control $this->view->copyExecutionID = $copyExecutionID; $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products)); $this->view->users = $this->loadModel('user')->getPairs('nodeleted|noclosed'); - $this->view->isSprint = $isSprint; $this->display(); } diff --git a/module/execution/js/create.js b/module/execution/js/create.js index 3d2311b7d5..6f426b2b3c 100644 --- a/module/execution/js/create.js +++ b/module/execution/js/create.js @@ -38,7 +38,7 @@ $(function() var adjustMainCol = function() { - if(isSprint) $('.main-form .col-main').css('width', Math.max(250, Math.floor(($('#productsBox').outerWidth() - 50)/3) + 10)); + $('.main-form .col-main').css('width', Math.max(250, Math.floor(($('#productsBox').outerWidth() - 50)/3) + 10)); }; adjustMainCol(); $(window).on('resize', adjustMainCol); @@ -57,3 +57,14 @@ function showLifeTimeTips() } } +/** + * Refresh page. + * + * @param object $projectID + * @access public + * @return void + */ +function refreshPage(projectID) +{ + location.href = createLink('execution', 'create', 'productID=&executionID=©ExecutionID=&planID=&confirm=no&projectID=' + projectID); +} diff --git a/module/execution/view/create.html.php b/module/execution/view/create.html.php index 9676214649..bab883d43a 100644 --- a/module/execution/view/create.html.php +++ b/module/execution/view/create.html.php @@ -35,7 +35,6 @@ execution->placeholder);?> execution->errorSameProducts);?> -
@@ -48,7 +47,7 @@ - + @@ -86,31 +85,9 @@ - + - - - - - - @@ -183,7 +160,6 @@ diff --git a/module/my/control.php b/module/my/control.php index 4037593ae0..f731e53bb5 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -476,6 +476,37 @@ class my extends control $this->display(); } + public function doc($type = 'openedbyme', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) + { + /* Save session, load lang. */ + if($this->app->viewType != 'json') $this->session->set('docList', $this->app->getURI(true)); + $this->loadModel('doc'); + + /* Load pager. */ + $this->app->loadClass('pager', $static = true); + $pager = pager::init($recTotal, $recPerPage, $pageID); + + /* Append id for secend sort. */ + $sort = $this->loadModel('common')->appendOrder($orderBy); + + $docs = $this->doc->getDocsByBrowseType(0, $type, 0, 0, $sort, $pager); + + /* Assign. */ + $this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->doc; + $this->view->position[] = $this->lang->my->doc; + $this->view->docs = $docs; + $this->view->users = $this->user->getPairs('noletter'); + $this->view->type = $type; + $this->view->recTotal = $recTotal; + $this->view->recPerPage = $recPerPage; + $this->view->pageID = $pageID; + $this->view->orderBy = $orderBy; + $this->view->pager = $pager; + + $this->display(); + + } + /** * My projects. * diff --git a/module/my/js/doc.js b/module/my/js/doc.js new file mode 100644 index 0000000000..ef9e5db6f3 --- /dev/null +++ b/module/my/js/doc.js @@ -0,0 +1,19 @@ +$('.ajaxCollect').click(function (event) { + var obj = $(this); + var url = obj.data('url'); + $.get(url, function(response) + { + if(response.status == 'yes') + { + obj.children('i').removeClass().addClass('icon icon-star text-yellow'); + obj.parent().prev().children('.file-name').children('i').remove('.icon'); + obj.parent().prev().children('.file-name').prepend(' '); + } + else + { + obj.children('i').removeClass().addClass('icon icon-star-empty'); + obj.parent().prev().children('.file-name').children('i').remove(".icon"); + } + }, 'json'); + return false; +}); diff --git a/module/my/lang/de.php b/module/my/lang/de.php index dda1bbe311..f66f5d7066 100644 --- a/module/my/lang/de.php +++ b/module/my/lang/de.php @@ -14,6 +14,7 @@ $lang->my->bug = 'My Bugs'; $lang->my->testTask = 'My Builds'; $lang->my->testCase = 'My Cases'; $lang->my->story = 'My Stories'; +$lang->my->doc = "My Docs"; $lang->my->createProgram = 'Create Program'; $lang->my->project = "My Projects"; $lang->my->execution = "My {$lang->executionCommon}s"; diff --git a/module/my/lang/en.php b/module/my/lang/en.php index dda1bbe311..f66f5d7066 100644 --- a/module/my/lang/en.php +++ b/module/my/lang/en.php @@ -14,6 +14,7 @@ $lang->my->bug = 'My Bugs'; $lang->my->testTask = 'My Builds'; $lang->my->testCase = 'My Cases'; $lang->my->story = 'My Stories'; +$lang->my->doc = "My Docs"; $lang->my->createProgram = 'Create Program'; $lang->my->project = "My Projects"; $lang->my->execution = "My {$lang->executionCommon}s"; diff --git a/module/my/lang/fr.php b/module/my/lang/fr.php index dda1bbe311..f66f5d7066 100644 --- a/module/my/lang/fr.php +++ b/module/my/lang/fr.php @@ -14,6 +14,7 @@ $lang->my->bug = 'My Bugs'; $lang->my->testTask = 'My Builds'; $lang->my->testCase = 'My Cases'; $lang->my->story = 'My Stories'; +$lang->my->doc = "My Docs"; $lang->my->createProgram = 'Create Program'; $lang->my->project = "My Projects"; $lang->my->execution = "My {$lang->executionCommon}s"; diff --git a/module/my/lang/vi.php b/module/my/lang/vi.php index dda1bbe311..f66f5d7066 100644 --- a/module/my/lang/vi.php +++ b/module/my/lang/vi.php @@ -14,6 +14,7 @@ $lang->my->bug = 'My Bugs'; $lang->my->testTask = 'My Builds'; $lang->my->testCase = 'My Cases'; $lang->my->story = 'My Stories'; +$lang->my->doc = "My Docs"; $lang->my->createProgram = 'Create Program'; $lang->my->project = "My Projects"; $lang->my->execution = "My {$lang->executionCommon}s"; diff --git a/module/my/lang/zh-cn.php b/module/my/lang/zh-cn.php index 542889bddf..d376bd3230 100644 --- a/module/my/lang/zh-cn.php +++ b/module/my/lang/zh-cn.php @@ -14,6 +14,7 @@ $lang->my->bug = '我的Bug'; $lang->my->testTask = '我的版本'; $lang->my->testCase = '我的用例'; $lang->my->story = "我的{$lang->SRCommon}"; +$lang->my->doc = "我的文档"; $lang->my->createProgram = '添加项目'; $lang->my->project = "我的项目"; $lang->my->execution = "我的{$lang->executionCommon}"; diff --git a/module/my/view/doc.html.php b/module/my/view/doc.html.php new file mode 100644 index 0000000000..b584afeabd --- /dev/null +++ b/module/my/view/doc.html.php @@ -0,0 +1,73 @@ + + * @package my + * @version $Id + * @link http://www.zentao.net + */ +?> + + + +
+ +
+

+ project->empty;?> +

+
+ +
+
execution->project;?>
execution->type;?> - execution->lifeTimeList, '', "class='form-control' onchange='showLifeTimeTips()'"); - } - else - { - echo html::select('attribute', $lang->stage->typeList, '', "class='form-control'"); - } - ?> - execution->lifeTimeList, '', "class='form-control' onchange='showLifeTimeTips()'"); ?>
execution->typeDesc;?>
programplan->percent;?> -
- - % -
-
execution->status;?>
-
+ + + + + + + + + + + + + collector, ',' . $this->app->user->account . ',') !== false ? 'icon-star text-yellow' : 'icon-star-empty';?> + collector, ',' . $this->app->user->account . ',') !== false ? $lang->doc->cancelCollection : $lang->doc->collect;?> + + + + + + + + + + +
doc->title;?>doc->size;?>doc->addedBy;?>doc->addedDate;?>doc->editedDate;?>actions;?>
createLink('doc', 'view', "docID=$doc->id&version=0&from={$lang->navGroup->doc}"), "  " . $doc->title, '', "title={$doc->title}");?>fileSize ? $doc->fileSize : '-';?>addedBy);?>addedDate, 'y-m-d');?>editedDate, 'y-m-d');?> + + + id&objectType=doc");?>" title="" class='btn btn-link ajaxCollect'> + + id&comment=false&from={$lang->navGroup->doc}", "", '', "title='{$lang->edit}' class='btn btn-link'")?> + id&confirm=no&from={$lang->navGroup->doc}", "", 'hiddenwin', "title='{$lang->delete}' class='btn btn-link'")?> + +
+ + + +
+ diff --git a/module/product/control.php b/module/product/control.php index a2d76e6a68..686e3b7d24 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -343,6 +343,7 @@ class product extends control $this->view->title = $this->lang->product->create; $this->view->position[] = $this->view->title; $this->view->groups = $this->loadModel('group')->getPairs(); + $this->view->programID = $programID; $this->view->poUsers = $poUsers; $this->view->qdUsers = $qdUsers; $this->view->rdUsers = $rdUsers; diff --git a/module/product/js/create.js b/module/product/js/create.js index 32f955c4c7..766a703bc1 100644 --- a/module/product/js/create.js +++ b/module/product/js/create.js @@ -14,6 +14,18 @@ function loadProductLines(rootID) }); } +/** + * Set parent program. + * + * @param $parentProgram + * @access public + * @return void + */ +function setParentProgram(parentProgram) +{ + location.href = createLink('product', 'create', 'programID=' + parentProgram); +} + $('#program').change(function() { var programID = $(this).val(); diff --git a/module/product/model.php b/module/product/model.php index b8b1fc5a25..33f6921931 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -32,7 +32,7 @@ class productModel extends model $product = $this->getByID($productID); if($product) { - $this->lang->modulePageNav = $this->getModuleNav($products, '', $product, $extra, $branch, $module, $moduleType); + $this->getModuleNav($products, '', $product, $extra, $branch, $module, $moduleType); } foreach($this->lang->product->menu as $key => $menu) diff --git a/module/product/view/create.html.php b/module/product/view/create.html.php index 4c3980a0cc..3178431157 100644 --- a/module/product/view/create.html.php +++ b/module/product/view/create.html.php @@ -24,7 +24,7 @@ config->systemMode == 'new'):?> program->common;?> - + diff --git a/module/product/view/project.html.php b/module/product/view/project.html.php index dc7964c846..e3012756ad 100644 --- a/module/product/view/project.html.php +++ b/module/product/view/project.html.php @@ -49,7 +49,7 @@ id);?> - createLink('project', 'task', 'project=' . $project->id, '', false, $project->id), $project->name, '_parent');?> + createLink('project', explode('-', $config->projectLink)[1], 'project=' . $project->id, '', false, $project->id), $project->name, '_parent');?> programName) ? $project->programName : '';?> PM]) ? $PMList[$project->PM]->id : ''?> diff --git a/module/productplan/js/browse.js b/module/productplan/js/browse.js index f52f31a236..d0727126a0 100644 --- a/module/productplan/js/browse.js +++ b/module/productplan/js/browse.js @@ -1,5 +1,5 @@ $(document).on('click', '.task-toggle', function(e) -{ +{ var $toggle = $(this); var id = $(this).data('id'); var isCollapsed = $toggle.toggleClass('collapsed').hasClass('collapsed'); @@ -24,7 +24,7 @@ $(function() { var PRJID = $('#project').val(); var planID = $('#planID').val(); - parent.location.href = createLink('project', 'create', 'productID=' + productID + '&projectID=©ProjectID=&planID=' + planID, '', '', PRJID); + parent.location.href = createLink('execution', 'create', 'productID=' + productID + '&executionID=©ExecutionID=&planID=' + planID + '&confirm=&projectID=' + PRJID, '', ''); }); }); $(document).on('click', 'td.content .more', function(e) diff --git a/module/productplan/view/browse.html.php b/module/productplan/view/browse.html.php index 1fbe377f3c..963ec5c705 100644 --- a/module/productplan/view/browse.html.php +++ b/module/productplan/view/browse.html.php @@ -120,7 +120,7 @@ stories;?> bugs;?> hour;?> - projectID)) echo html::a(helper::createLink('project', 'task', 'projectID=' . $plan->projectID), '');?> + projectID)) echo html::a(helper::createLink('execution', 'task', 'projectID=' . $plan->projectID), '');?> ', '
', '
', '
'), "\n", str_replace(array("\n", "\r"), '', $plan->desc)), ''));?>
@@ -128,7 +128,7 @@ " . $this->loadModel('flow')->getFieldValue($extendField, $plan) . "";?> ', '', "data-toggle='modal' data-id='$plan->id' onclick='getPlanID(this)' class='btn' title='{$lang->productplan->createExecution}'"); + if(common::hasPriv('execution', 'create', $plan)) echo html::a('#projects', '', '', "data-toggle='modal' data-id='$plan->id' onclick='getPlanID(this)' class='btn' title='{$lang->productplan->createExecution}'"); if(common::hasPriv('productplan', 'linkStory', $plan) and $plan->parent >= 0) echo html::a(inlink('view', "planID=$plan->id&type=story&orderBy=id_desc&link=true"), '', '', "class='btn' title='{$lang->productplan->linkStory}'"); if(common::hasPriv('productplan', 'linkBug', $plan)) echo html::a(inlink('view', "planID=$plan->id&type=bug&orderBy=id_desc&link=true"), '', '', "class='btn' title='{$lang->productplan->linkBug}'"); common::printIcon('productplan', 'edit', "planID=$plan->id", $plan, 'list'); diff --git a/module/project/control.php b/module/project/control.php index 1d56002c3f..af1ea80e39 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -501,7 +501,6 @@ class project extends control public function view($projectID = 0) { $this->app->loadLang('bug'); - $this->lang->navGroup->project = 'project'; $this->lang->project->menu = $this->lang->scrum->setMenu; $moduleIndex = array_search('project', $this->lang->noMenuModule); if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]); @@ -546,7 +545,6 @@ class project extends control */ public function group($projectID = 0, $programID = 0) { - $this->lang->navGroup->project = 'project'; $this->lang->project->menu = $this->lang->scrum->setMenu; $moduleIndex = array_search('project', $this->lang->noMenuModule); if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]); @@ -1214,7 +1212,6 @@ class project extends control { if($from == 'project') { - $this->lang->navGroup->project = 'project'; $this->lang->project->menu = $this->lang->scrum->setMenu; $moduleIndex = array_search('project', $this->lang->noMenuModule); if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]); @@ -1378,9 +1375,6 @@ class project extends control */ public function adjustNavigation($from = '', $projectID = 0) { - if($from == 'browse') $this->lang->project->menu = $this->lang->project->menu; - if($from == 'program') $this->lang->navGroup->project = 'project'; - if($from == 'project') { $this->lang->navGroup->project = 'project'; diff --git a/module/project/js/create.js b/module/project/js/create.js index 797ffd5a67..d85cf06508 100644 --- a/module/project/js/create.js +++ b/module/project/js/create.js @@ -27,12 +27,12 @@ $(function() /** * Set parent program. * + * @param $parentProgram * @access public * @return void */ -function setParentProgram() +function setParentProgram(parentProgram) { - var parentProgram = $("#parent").val(); location.href = createLink('project', 'create', 'model=' + model + '&programID=' + parentProgram); } diff --git a/module/projectbuild/control.php b/module/projectbuild/control.php new file mode 100644 index 0000000000..2b068277cd --- /dev/null +++ b/module/projectbuild/control.php @@ -0,0 +1,78 @@ + + * @package projectBuild + * @version $Id: control.php 5094 2013-07-10 08:46:15Z chencongzhi520@gmail.com $ + * @link http://www.zentao.net + */ +class projectBuild extends control +{ + /** + * Browse builds of a project. + * + * @param int $projectID + * @param string $type all|product|bysearch + * @param int $param + * @access public + * @return void + */ + public function browse($projectID = 0, $type = 'all', $param = 0) + { + $this->loadModel('project'); + $this->loadModel('execution'); + $this->loadModel('build'); + $project = $this->project->getByID($projectID); + + /* Get products' list. */ + $products = $this->project->getProducts($projectID, false); + $products = array('' => '') + $products; + + /* Build the search form. */ + $type = strtolower($type); + $queryID = ($type == 'bysearch') ? (int)$param : 0; + $actionURL = $this->createLink('projectbuild', 'browse', "projectID=$projectID&type=bysearch&queryID=myQueryID"); + + $executions = $this->execution->getByProject($projectID, 'all', '', true); + $this->config->build->search['fields']['project'] = $this->project->lang->executionCommon; + $this->config->build->search['params']['project'] = array('operator' => '=', 'control' => 'select', 'values' => array('' => '') + $executions); + + $this->project->buildProjectBuildSearchForm($products, $queryID, $actionURL, 'project'); + commonModel::setAppObjectID('project', $projectID); + + if($type == 'bysearch') + { + $builds = $this->build->getProjectBuildsBySearch((int)$projectID, (int)$param); + } + else + { + $builds = $this->build->getProjectBuilds((int)$projectID, $type, $param); + } + + /* Set project builds. */ + $projectBuilds = array(); + if(!empty($builds)) + { + foreach($builds as $build) $projectBuilds[$build->product][] = $build; + } + + /* Header and position. */ + $this->view->title = $project->name . $this->lang->colon . $this->lang->execution->build; + $this->view->position[] = html::a(inlink('browse', "projectID=$projectID"), $project->name); + $this->view->position[] = $this->lang->execution->build; + + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->view->buildsTotal = count($builds); + $this->view->projectBuilds = $projectBuilds; + $this->view->projectID = $projectID; + $this->view->product = $type == 'product' ? $param : 'all'; + $this->view->project = $project; + $this->view->products = $products; + $this->view->executions = $executions; + $this->view->type = $type; + + $this->display(); + } +} diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php index a523c68643..00011d36f6 100644 --- a/module/projectrelease/control.php +++ b/module/projectrelease/control.php @@ -58,20 +58,23 @@ class projectrelease extends control /** * Browse releases. * + * @param int $projectID * @param string $type * @access public * @return void */ - public function browse($type = 'all') + public function browse($projectID, $type = 'all') { $this->session->set('releaseList', $this->app->getURI(true)); $execution = $this->loadModel('execution')->getById($this->session->PRJ); + commonModel::setAppObjectID('project', $projectID); $this->view->title = $execution->name . $this->lang->colon . $this->lang->release->browse; $this->view->position[] = $this->lang->release->browse; $this->view->execution = $execution; $this->view->products = $this->loadModel('product')->getProducts($this->session->PRJ); - $this->view->releases = $this->projectrelease->getList($this->session->PRJ, $type); + $this->view->releases = $this->projectrelease->getList($projectID, $type); + $this->view->projectID = $projectID; $this->view->type = $type; $this->display(); } @@ -79,10 +82,11 @@ class projectrelease extends control /** * Create a release. * + * @param int $projectID * @access public * @return void */ - public function create() + public function create($projectID) { $this->app->loadConfig('release'); $this->config->projectrelease->create = $this->config->release->create; @@ -105,7 +109,9 @@ class projectrelease extends control foreach($releaseBuilds as $build) unset($builds[$build]); unset($builds['trunk']); + commonModel::setAppObjectID('project', $projectID); $this->commonAction(); + $this->view->title = $this->view->project->name . $this->lang->colon . $this->lang->release->create; $this->view->position[] = $this->lang->release->create; $this->view->builds = $builds; diff --git a/module/projectrelease/view/browse.html.php b/module/projectrelease/view/browse.html.php index 033f4849c6..2cd8005432 100644 --- a/module/projectrelease/view/browse.html.php +++ b/module/projectrelease/view/browse.html.php @@ -16,14 +16,14 @@ diff --git a/module/repo/view/create.html.php b/module/repo/view/create.html.php index 29d0ce8536..b547e7e1fd 100644 --- a/module/repo/view/create.html.php +++ b/module/repo/view/create.html.php @@ -18,7 +18,7 @@
-

repo->create; ?>

+

repo->createAction;?>

diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index 9ee2c8b719..46a2fddee6 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -86,7 +86,7 @@ - - story->checkForceReview()):?> - - - + diff --git a/module/task/control.php b/module/task/control.php index 39741b7bbe..8c2da8f404 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -462,7 +462,6 @@ class task extends control /* The tasks of my. */ else { - $this->lang->navGroup->task = 'my'; $this->lang->task->menu = $this->lang->my->menu; $this->lang->task->menuOrder = $this->lang->my->menuOrder; $this->loadModel('my')->setMenu(); diff --git a/module/testcase/control.php b/module/testcase/control.php index 6817866434..996f94a9c2 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -290,6 +290,7 @@ class testcase extends control setcookie('caseModule', 0, 0, $this->config->webRoot, '', false, false); $response['locate'] = $this->createLink('testcase', 'browse', "productID={$this->post->product}&branch={$this->post->branch}&browseType=all¶m=0&orderBy=id_desc"); + if($this->app->openApp == 'execution') $response['locate'] = $this->createLink('execution', 'testcase', "executionID={$this->session->execution}&type=all"); $this->send($response); } if(empty($this->products)) $this->locate($this->createLink('product', 'create')); diff --git a/module/todo/model.php b/module/todo/model.php index b782497287..6f9b63cf6d 100644 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -38,6 +38,14 @@ class todoModel extends model ->remove(implode(',', $this->config->todo->moduleList) . ',uid') ->get(); + if($todo->type != 'custom') + { + $type = $todo->type; + $object = $this->loadModel($type)->getByID($this->post->$type); + if(isset($object->name)) $todo->name = $object->name; + if(isset($object->title)) $todo->name = $object->title; + } + if($todo->end < $todo->begin) { dao::$errors[] = sprintf($this->lang->error->gt, $this->lang->todo->end, $this->lang->todo->begin); @@ -499,8 +507,8 @@ class todoModel extends model * @access public * @return object */ - public function getByList($todoIDList = 0) - { + public function getByList($todoIDList = 0) + { return $this->dao->select('*')->from(TABLE_TODO) ->beginIF($todoIDList)->where('id')->in($todoIDList)->fi() ->fetchAll('id'); @@ -698,9 +706,9 @@ class todoModel extends model } /** - * Assign todo. - * - * @param int $todoID + * Assign todo. + * + * @param int $todoID * @access public * @return bool */ @@ -722,8 +730,8 @@ class todoModel extends model /** * Get todo count. - * - * @param string $account + * + * @param string $account * @access public * @return int */
-
story->source;?>
+
story->source;?>
story->sourceList, $source, "class='form-control chosen'");?> story->sourceNote;?> @@ -98,15 +98,23 @@
story->reviewedBy;?>PO : '', "class='form-control chosen'");?> -
- /> - +
+
+
+ PO : '', "class='form-control chosen'");?> +
+ story->checkForceReview()):?> +
+ +
+ /> + +
+
+
+
@@ -125,7 +133,7 @@ config->URAndSR):?>
story->requirement;?>