I'm looking for a part-time remote job.

Hire me


I'm the author of:

Mastering Redmine is a comprehensive guide with tips, tricks and best practices, and an easy-to-learn structure.

Check the book's project or

Buy the book

Social pages of the book:

By buying this book you also donate to Redmine (see this page).


Follow me:

Feature #1887

Project approval

Added by Blaž Podržaj over 12 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Start date:
02 Nov 2011
Due date:
05 Feb 2012
% Done:

100%


Description

Hi,

I found this project approval plugin by David Fuentes which was meant for Redmine 0.8. I contacted him if he was willing to update it to support Redmine 1.2.x but he said he had some other priorities in his life now Since I’m not a programmer and I found you are quite literate in RoR and Redmine programming I was wondering if you could take a peek at https://github.com/davidfb/redmine_projects_approval and maybe fork it. The plugin is still functional (creates archived project) but it fails on two things:

  • when you create new project you don’t get creation_flash_message but insted you are presented with a 404 error as you can’t access prject page yet
  • mail sent to admin and back to creator doesn’t follow Settings→General→Text Formatting option but instead it sends mail that has HTML code in it which is then not interpreted

History

#1 Updated by Andriy Lesyuk about 12 years ago

  • Status changed from New to Open
  • Assignee set to Andriy Lesyuk
  • % Done changed from 0 to 30

#2 Updated by Andriy Lesyuk about 12 years ago

Have a question regarding mail:

mail sent to admin and back to creator doesn’t follow Settings→General→Text Formatting option but instead it sends mail that has HTML code in it which is then not interpreted

Settings → General → Text Formatting is for Wiki content, not for mail! Mail is configured under Settings → Email notifications. I guess I got it wrong... So what is the problem with mail?..

My fork: https://github.com/s-andy/redmine_projects_approval

#3 Updated by Blaž Podržaj about 12 years ago

You’re right, I meant Settings → Email notifications → Plain text mail (no HTML)... which doesn’t apply with this plugin. Instead mail is sent malformed... you get mail that shows HTML code in it instead of HTML interpretation and that no matter the setting (even if set to Plain text mail).

#4 Updated by Andriy Lesyuk about 12 years ago

  • % Done changed from 30 to 70

Check plugin from my github repo!.. Seems it works! Please confirm.

#5 Updated by Blaž Podržaj about 12 years ago

Hmm, it wasn’t working until i renamed files in views/approval_notifier to .text.html.rhtml and .text.plain.rhtml. I was getting error ActionView::MissingTemplate otherwise. And it somehow breaks redmine_favorite_projects plugin (I’m not sure what’s the problem). Otherwise it works fine except that only user admin gets mail for approving. Is it possible that all users with admin flag get this mail?

There are several other things I'd like to see in this plugin:
  • sending mail for not approving the project (cancelation)
  • better distinguish between normal users and admins
  • distinguish between projects and subprojects

...but these I will try to solve myself

#6 Updated by Andriy Lesyuk about 12 years ago

Hmm, it wasn’t working until i renamed files in views/approval_notifier to .text.html.rhtml and .text.plain.rhtml. I was getting error ActionView::MissingTemplate otherwise.

I renamed them because I was getting the same error for files .text.html.rhtml and .text.plain.rhtml... Weird! What is your verson of Redmine?

And it somehow breaks redmine_favorite_projects plugin (I’m not sure what’s the problem).

Can’t understand what in plugin causes this... Without my changes (only David’s plugin) also conflicts?

Otherwise it works fine except that only user admin gets mail for approving. Is it possible that all users with admin flag get this mail?

Plugin delivers mail only to admin. It sends notification to user only when approved. Not sure if all admins get this email...

P.S. Want to pull changes back to David’s repo when ready...

#7 Updated by Blaž Podržaj about 12 years ago

I renamed them because I was getting the same error for files .text.html.rhtml and .text.plain.rhtml... Weird! What is your verson of Redmine?

1.2.3 on rails 2.3.14 (actionmailer is also 2.3.14).

Can’t understand what in plugin causes this... Without my changes (only David’s plugin) also conflicts?

Yeah it conflicts also. It must be this favorite plugin problem since I’m getting this ActionView::TemplateError (undefined method `favorite_tag'... error.

Plugin delivers mail only to admin. It sends notification to user only when approved. Not sure if all admins get this email...

As I said it delivers only to user admin but I would like to deliver to all admins (users with admin flag). Approval notification to user is fine.

P.S. Want to pull changes back to David’s repo when ready...

I’m not sure about those erb templates (rhtml templates in my case). Are these Redmine version dependent?

#8 Updated by Blaž Podržaj about 12 years ago

Plugin delivers mail only to admin. It sends notification to user only when approved. Not sure if all admins get this email...

There is admin = User.find(:first, :conditions => { :admin => true }) in project_approval.rb but if I remove :first parameter I get ActiveRecord::RecordNotFound (Couldn't find User without an ID) error.

#9 Updated by Andriy Lesyuk about 12 years ago

P.S. Want to pull changes back to David’s repo when ready...

I’m not sure about those erb templates (rhtml templates in my case). Are these Redmine version dependent?

Not sure too!.. Seems yes. Will rename them back perhaps...

Plugin delivers mail only to admin. It sends notification to user only when approved. Not sure if all admins get this email...

There is admin = User.find(:first, :conditions => { :admin => true }) in project_approval.rb but if I remove :first parameter I get ActiveRecord::RecordNotFound (Couldn't find User without an ID) error.

Accordingly to this code it definitely sends only to one admin! You need to replace :first with :all. But it won’t work (other code does not support multiple users)!

#10 Updated by Blaž Podržaj about 12 years ago

In this case one would need another method for creating mail for all admins right?

#11 Updated by Andriy Lesyuk about 12 years ago

  • % Done changed from 70 to 80

Renamed those files back (but remember that for my Redmine 1.3.0 they do not work), modified locale variables for 1.3.0 (should work for earlier as well) and fixed code to work for all admins... Please test! And say if I can pull changes back.

#12 Updated by Andriy Lesyuk about 12 years ago

  • Status changed from Open to In Progress

Going to pull changes back...

#13 Updated by Andriy Lesyuk about 12 years ago

  • % Done changed from 80 to 100

Sent pull request!

#14 Updated by Andriy Lesyuk about 12 years ago

  • Due date set to 05 Feb 2012
  • Status changed from In Progress to Closed

Changes were merged!

Also available in: Atom PDF

Terms of use | Privacy policy