fix #1149 where submitting a dependency that does not exist will show a warning that it will be ignored

This commit is contained in:
Reinier Balt 2011-04-30 20:46:47 +02:00
parent 7f27a6e2bd
commit 79cb34e105
5 changed files with 692 additions and 686 deletions

View file

@ -252,7 +252,7 @@ module ApplicationHelper
contexts.show_form contexts.show_form_title
contexts.new_context_pre contexts.new_context_post
common.cancel common.ok
common.ajaxError
common.ajaxError todos.unresolved_dependency
}.each do |s|
js << "i18n['#{s}'] = '#{ t(s).gsub(/'/, "\\\\'") }';\n"
end

File diff suppressed because it is too large Load diff

View file

@ -421,6 +421,7 @@ en:
contexts: Contexts
projects: Projects
todos:
unresolved_dependency: "The value you entered in the dependency field did not resolve to an existing action. This value will not be saved with the rest of the action. Continue?"
action_saved: "Action saved"
recurring_action_saved: "Recurring action saved"
action_saved_to_tickler: "Action saved to tickler"

File diff suppressed because it is too large Load diff

View file

@ -76,6 +76,9 @@ var TracksForm = {
/* submit todo form after entering new todo */
$("button#todo_new_action_submit").live('click', function (ev) {
if ($('input#predecessor_input').val() != "")
if (!confirm(i18n['todos.unresolved_dependency']))
return false;
if (TodoItems.askIfNewContextProvided('', this))
submit_with_ajax_and_block_element('form#todo-form-new-action', $(this));
return false;