* Optimize code.

This commit is contained in:
mayue
2021-12-22 10:36:55 +08:00
parent ea0477b6b2
commit 14a7faf16d
4 changed files with 7 additions and 21 deletions
-2
View File
@@ -103,7 +103,6 @@ class projectrelease extends control
$this->loadModel('build');
$this->app->loadConfig('release');
$this->config->projectrelease->create = $this->config->release->create;
$this->app->loadLang('release');
if(!empty($_POST))
@@ -128,7 +127,6 @@ class projectrelease extends control
unset($builds['trunk']);
$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;
$this->view->lastRelease = $this->projectrelease->getLast($projectID);
$this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed');
+2 -8
View File
@@ -5,13 +5,7 @@ $('#submit').click(function()
var date = $('#date').val();
if(name && dateFormat.test(date))
{
if(confirm(confirmLink))
{
$('#sync').val('true');
}
else
{
$('#sync').val('false');
}
var result = confirm(confirmLink) ? true : false;
$('#sync').val(result);
}
});
+2 -8
View File
@@ -5,13 +5,7 @@ $('#submit').click(function()
var date = $('#date').val();
if(name && dateFormat.test(date))
{
if(confirm(confirmLink))
{
$('#sync').val('true');
}
else
{
$('#sync').val('false');
}
var result = confirm(confirmLink) ? true : false;
$('#sync').val(result);
}
});
+3 -3
View File
@@ -112,9 +112,9 @@ class releaseModel extends model
public function create($productID, $branch = 0)
{
/* Init vars. */
$productID = (int)$productID;
$branch = (int)$branch;
$buildID = 0;
$productID = (int)$productID;
$branch = (int)$branch;
$buildID = 0;
/* Check build if build is required. */
if(strpos($this->config->release->create->requiredFields, 'build') !== false and $this->post->build == false) return dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->release->build);