diff --git a/README.textile b/README.textile index 89fd922..110bfb4 100644 --- a/README.textile +++ b/README.textile @@ -227,5 +227,3 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -fdg -zxcx \ No newline at end of file diff --git a/controllers/notepad.rb b/controllers/notepad.rb index cf1855b..eef1a59 100644 --- a/controllers/notepad.rb +++ b/controllers/notepad.rb @@ -31,8 +31,14 @@ def self.processNotepad(params, session) if infotext=="" error_msg.push('Notes not found') + return {:error_msg => error_msg, :success_msg => success_msg} end + if !session[params[:project]][:notepad].nil? && !session[params[:project]][:notepad].empty? && session[params[:project]][:notepad] == infotext + error_msg.push("This notes was already saved and tickets were created") + return {:error_msg => error_msg, :success_msg => success_msg} + end + infotext.each_line do |line| line.gsub!(/^(\**)\s?([a-zA-Z0-9\$%_\*\+\s\.]*)\s?(@([a-zA-Z0-9_\.]*))?/) do |match| heir = $1 @@ -97,6 +103,8 @@ def self.processNotepad(params, session) end end + session[params[:project]][:notepad] = infotext + msg = {:error_msg => error_msg, :success_msg => success_msg} return msg end