https://github.com/zealous-tech/note_change_notifier
Note Change Notifier is a Redmine plugin that notifies note change of contact/deal in redmine_contacts' plugin by e-mail.
https://github.com/zealous-tech/note_change_notifier
Last synced: about 1 year ago
JSON representation
Note Change Notifier is a Redmine plugin that notifies note change of contact/deal in redmine_contacts' plugin by e-mail.
- Host: GitHub
- URL: https://github.com/zealous-tech/note_change_notifier
- Owner: zealous-tech
- License: gpl-2.0
- Created: 2020-08-14T11:15:51.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-10-21T12:58:05.000Z (over 4 years ago)
- Last Synced: 2023-07-13T13:24:46.154Z (almost 3 years ago)
- Language: Ruby
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Note Change Notifier
Note Change Notifier is a Redmine plugin that notifies note
change of contact/deal in redmine_contacts' plugin by e-mail. Note Change Notifier
is based on (modified) Journal Change Notifier. Plugin tested on redmine
version 3.4.2 and 4.2.2
## License
GPL 2 or later. See LICENSE for details.
# Installation of note_change_notifier plugin
1. Install plugin as usual:
$ sudo cp -r note_change_notifier [Redmine_Root]/plugins
$ cd [Redmine_Root]
$ sudo bundle install
$ sudo bundle exec rake redmine:plugins:migrate RAILS_ENV=production
$ sudo /etc/init.d/apache2 restart
2. Edit [Redmine_Root]/plugins/redmine_contacts/app/controllers/notes_controller.rb (add call_hook to update and destroy methods), as follows:
...
...
...
def update
@note.safe_attributes = params[:note]
if @note.save
@note.note_time = params[:note][:note_time] if params[:note] && params[:note][:note_time]
attachments = Attachment.attach_files(@note, (params[:attachments] || (params[:note] && params[:note][:uploads])))
render_attachment_warning_if_needed(@note)
flash[:notice] = l(:notice_successful_update)
respond_to do |format|
format.html { redirect_back_or_default({ :action => 'show', :project_id => @note.source.project, :id => @note }) }
format.api { render_api_ok }
end
+ call_hook(:plugin_redmine_contacts_controller_notes_edit_post, { :note => @note, :params => params}) if Redmine::Plugin.installed?(:note_change_notifier)
else
respond_to do |format|
format.html { render :action => 'edit', :project_id => params[:project_id], :id => @note }
format.api { render_validation_errors(@note) }
end
end
end
...
...
...
def destroy
(render_403; return false) unless @note.destroyable_by?(User.current, @project)
@note.destroy
respond_to do |format|
format.js
format.html { redirect_to :action => 'show', :project_id => @project, :id => @note.source }
format.api { render_api_ok }
end
+ call_hook(:plugin_redmine_contacts_controller_notes_edit_post, { :note => @note, :params => params}) if Redmine::Plugin.installed?(:note_change_notifier)
# redirect_to :action => 'show', :project_id => @project, :id => @contact
end
...
...
...