* Refactor submit function.
This commit is contained in:
@@ -376,3 +376,29 @@ $('#teamForm').on('change', '.team-select [name^=team]', function()
|
||||
$tr.find('[name^=teamConsumed]').val(consumed);
|
||||
$tr.find('[name^=teamEstimate]').val(estimate);
|
||||
});
|
||||
|
||||
window.clickSubmit = function()
|
||||
{
|
||||
if(isMultiple)
|
||||
{
|
||||
var multiple = $('#multiple').is(":checked");
|
||||
if(!multiple)
|
||||
{
|
||||
var assignedTo = $('[name=assignedTo]').val();
|
||||
if(!assignedTo)
|
||||
{
|
||||
zui.Modal.alert(teamNotEmpty);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var estimate = parseInt($('#left').val());
|
||||
if(isNaN(estimate) || estimate <= 0)
|
||||
{
|
||||
zui.Modal.alert(multiple ? teamLeftEmpty : leftNotEmpty);
|
||||
return false;
|
||||
}
|
||||
|
||||
$('#assignedTo').val('');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,6 +320,7 @@ for($i; $i <= $rowCount; $i ++)
|
||||
/* ====== Define the page structure with zin widgets ====== */
|
||||
formPanel
|
||||
(
|
||||
set::ajax(array('beforeSubmit' => jsRaw("clickSubmit"))),
|
||||
$taskModeBox,
|
||||
formRow
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user