Project

General

Profile

Redmine Banner Plugin

Added by Akiko Takano about 12 years ago

Hello,

I've written a little plugin to show the message from administrator site-widely in Redmine.

I've added an entry in the plugin list with the usual information: http://www.redmine.org/plugins/redmine_banner.

There is a sample screenshot:

Screenshot for banner message.

I made this because I personally feel the news or welcome message are not noticeable.
I hope it would be useful for someone, especially site administrator.

Please not that its my first plugin and I'm really not a skilled developper....
Feedbacks are greatly appreciated!

banner-sample.png (67.4 KB) banner-sample.png Screenshot for banner message.

Replies (28)

RE: Redmine Banner Plugin - Added by Jorge Iglesias about 5 years ago

Hi!

I hope you still read this.
I want to schedulle timer. I want to put all days a banner if the hour of businness is over and the client should call the 24x7 service.

We think on cron processor to modify the plugin database, but we dont find where is the banner information. We can try this?

Maybe you have a better idea

Really TY!

RE: Redmine Banner Plugin - Added by Akiko Takano about 4 years ago

Hi, Jorge and everyone.

Sorry I could not find this post and delayed my reply!

Jorge Iglesias wrote:

I want to schedulle timer. I want to put all days a banner if the hour of businness is over and the client should call the 24x7 service.

We think on cron processor to modify the plugin database, but we dont find where is the banner information. We can try this?

Which table that holds global banner setting and message?

You can see the global banner's data in a settings table.
But message and setting is stored as hashed value in "value" column.


SELECT  "settings".* FROM "settings" WHERE "settings"."name" = "plugin_redmine_banner";

SELECT  "settings"."value" FROM "settings" WHERE "settings"."name" = "plugin_redmine_banner";

{"enable"=>"true",
 "type"=>"info",
 "display_part"=>"both",
 "banner_description"=>"Message for Global Banner",
 "use_timer"=>"string",
 "start_ymd"=>"2019-08-20",
 "start_hour"=>16,
 "start_min"=>31,
 "end_ymd"=>"2019-08-21",
 "end_hour"=>16,
 "end_min"=>31,
 "related_link"=>"http://localhost:3000/news"}

Since v0.2.1, Global Banner plugin support API. So you can update the global banner message via HTTP client like curl with scheduled cron.
If you run cron inside the same server of Redmine, you can also update global banner via rails script command.

via API

curl -v -H "Content-Type: application/json" -X PUT --data-binary "@banner.json" \
   -u login:password http://your_redmine.example.com/banners/api/global_banner.json
curl -v -H "Content-Type: application/json" -X PUT --data-binary "@banner.json" \
   -H "X-Redmine-API-Key: xxxx" http://your_redmine.example.com/banners/api/global_banner.json

The file that contains the data sent to Redmine (banner.json in the example above) would look like this:


{
  "global_banner": {
    "banner_description": "Message for Global Banner",
    "display_part": "both",
    "enable": "true",
    "end_hour": 16,
    "end_min": 31,
    "end_ymd": "2019-08-21",
    "related_link": "http://localhost:3000/news",
    "start_hour": 16,
    "start_min": 31,
    "start_ymd": "2019-08-20",
    "type": "info",
    "use_timer": "string" 
  }
}

via rails script

  • Create simple script to update Global Banner as following:
banner_description = ARGV[0] || "Custom message.....#{Time.current}" 
message = {
  enable: 'true',
  type: 'info',
  display_part: 'both',
  banner_description: banner_description
}

banner_setting = Setting.send(:find_or_default,'plugin_redmine_banner')
banner_setting.value = message.stringify_keys
banner_setting.save

  • Run this script via rails runner command.
bin/rails runner sample.rb "Pass message as argument." -e development

Redmine Banner Plugin v0.3.0 - Added by Akiko Takano about 4 years ago

Hello, everyone.

Banner plugin is now version 0.3.0, support for Redmine 4.x.
As I wrote above, current version supports Rest API for Global Banner.
And give the ability to specific users to manage the site-wide banner.

Hope this would be any help :)

(26-28/28)