diff --git a/module/build/control.php b/module/build/control.php index 21a79b3d9d..859acd00fe 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -23,9 +23,9 @@ class build extends control if(!empty($_POST)) { $buildID = $this->build->create($projectID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); $this->loadModel('action')->create('build', $buildID, 'opened'); - die(js::locate($this->createLink('build', 'view', "buildID=$buildID"), 'parent')); + $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('build', 'view', "buildID=$buildID"))); } $this->session->set('buildCreate', $this->app->getURI(true)); @@ -93,7 +93,7 @@ class build extends control if(!empty($_POST)) { $changes = $this->build->update($buildID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); $files = $this->loadModel('file')->saveUpload('build', $buildID); if($changes or $files) @@ -103,7 +103,7 @@ class build extends control $actionID = $this->loadModel('action')->create('build', $buildID, 'Edited', $fileAction); if(!empty($changes)) $this->action->logHistory($actionID, $changes); } - die(js::locate(inlink('view', "buildID=$buildID"), 'parent')); + $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "buildID=$buildID"))); } $build = $this->build->getById((int)$buildID); diff --git a/module/build/js/common.js b/module/build/js/common.js index 7ac9315de8..deff5408ea 100644 --- a/module/build/js/common.js +++ b/module/build/js/common.js @@ -13,12 +13,13 @@ $(document).ready(function() function loadBranches(productID) { $('#branch').remove(); + $('#branch_chosen').remove(); $.get(createLink('branch', 'ajaxGetBranches', 'productID=' + productID + '&oldBranch=' + productGroups[productID]['branch']), function(data) { if(data) { $('#product').closest('.input-group').append(data); - $('#branch').css('width', '100px'); + $('#branch').chosen(); } }); } diff --git a/module/build/view/create.html.php b/module/build/view/create.html.php index f6ca6159da..bfe4b75ead 100644 --- a/module/build/view/create.html.php +++ b/module/build/view/create.html.php @@ -11,75 +11,76 @@ */ ?> - -
| build->product;?> | +
+
+ product, "onchange='loadBranches(this.value);' class='form-control chosen' required");?>
+ productType != 'normal')
+ {
+ if($product->branch) $branches = array($product->branch => $branches[$product->branch]);
+ echo "" . html::select('branch', $branches, $build->branch, "class='form-control chosen'");
+ }
+ ?>
+
+ | + |
|---|---|---|
| build->name;?> | +name, "class='form-control' autocomplete='off' required");?> | +|
| build->builder;?> | +builder, 'class="form-control chosen" required');?> | +|
| build->date;?> | +date, "class='form-control form-date' required");?> | +|
| build->scmPath;?> | +scmPath, "class='form-control' placeholder='{$lang->build->placeholder->scmPath}' autocomplete='off'");?> | +|
| build->filePath;?> | +filePath, "class='form-control' placeholder='{$lang->build->placeholder->filePath}' autocomplete='off'");?> | +|
| build->files;?> | +fetch('file', 'buildForm');?> | +|
| build->desc;?> | +desc), "rows='10' class='form-control kindeditor' hidefocus='true'");?> | +|
| + + + config->global->flow != 'onlyTest' ? html::hidden('project', $build->project) : '';?> + | +||
| build->product;?> | -
-
- product, "onchange='loadBranches(this.value);' class='form-control chosen'");?>
- productType != 'normal')
- {
- if($product->branch) $branches = array($product->branch => $branches[$product->branch]);
- echo html::select('branch', $branches, $build->branch, "class='form-control' style='width:100px'");
- }
- ?>
-
- | - |
|---|---|---|
| build->name;?> | -name, "class='form-control' autocomplete='off'");?> | -|
| build->builder;?> | -builder, 'class="form-control chosen"');?> | -|
| build->date;?> | -date, "class='form-control form-date'");?> | -|
| build->scmPath;?> | -scmPath, "class='form-control' placeholder='{$lang->build->placeholder->scmPath}' autocomplete='off'");?> | -|
| build->filePath;?> | -filePath, "class='form-control' placeholder='{$lang->build->placeholder->filePath}' autocomplete='off'");?> | -|
| build->files;?> | -fetch('file', 'buildForm', array('fileCount' => 1));?> | -|
| build->desc;?> | -desc), "rows='10' class='form-control'");?> | -|
| config->global->flow != 'onlyTest' ? html::hidden('project', $build->project) : '');?> | ||