Skip to content

MEDEVIT/redmine_medelexis

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redmine_medelexis

A few goodies for the Medelexis MIS

  • admin-users see the api_key of all users
  • hooks are called after create/editing service tickets

TODO

  • Scripts for the hooks

installation

cd /path/to/redmine/plugins
git clone [email protected]:ngiger/redmine_medelexis.github
service restart redmine
[09:51:04] Marco Descher: Für Admin user https://mis-beta.medelexis.ch/mmustermann/license.xml
[09:52:15] Marco Descher:  https://mis-beta.medelexis.ch/my/license - list of all service tickets
[09:52:23] Marco Descher:  https://mis-beta.medelexis.ch/my/license.xml - encrypted and signed license
[09:52:35] Marco Descher: https://mis-beta.medelexis.ch/mmustermann/license - list of all service tickets
[09:52:42] Marco Descher: https://mis-beta.medelexis.ch/mmustermann/license.xml -encrypted and signed license
Im logger IP-Adresse des Aufrufes abspeichern.

configuration

Under http://foo.org/settings/plugin/redmine_medelexis you can add more debugging (to the default system logger) and to keep the temporary license files.

Installation from scratch for development

Get the needed zip files. Used versions are found under https://mis-beta.medelexis.ch/admin/info

  • redmine-2.4.2.zip
  • redmine_contacts-3_2_13-pro.zip
  • redmine_contacts_helpdesk-2_2_8.zip
  • redmine_contacts_invoices-3_1_0-pro.zip
  • redmine_products-1_0_1-pro.zip

Afterwards execute and verify these steps (assuming a bash shell). Using ruby 1.9.3p547 was fine for me. Ruby 2.1.2 had some problems

unzip redmine-*.zip
cd redmine-2.4.2
cd plugins
unzip redmine_contacts-*-pro.zip
unzip redmine_contacts_helpdesk-*.zip
unzip redmine_contacts_invoices-*.zip
unzip redmine_products-*.zip
# (Skip unless production) git clone https://github.com/thorin/redmine_ldap_sync
git clone [email protected]:ngiger/redmine_medelexis.git # or https://github.com/ngiger/redmine_medelexis.git
cd ..
bundle install
bundle exec rake db:migrate RAILS_ENV=development
bundle exec rake RAILS_ENV=development redmine:plugins NAME=redmine_contacts
bundle exec rake RAILS_ENV=development redmine:plugins NAME=redmine_contacts_helpdesk
bundle exec rake RAILS_ENV=development redmine:plugins NAME=redmine_contacts_invoices
bundle exec rake RAILS_ENV=development redmine:plugins NAME=redmine_products
bundle exec rake RAILS_ENV=development redmine:plugins NAME=redmine_ldap_sync
bundle exec rake RAILS_ENV=development redmine:plugins NAME=redmine_medelexis

development: Loading a dump

bundle exec rake RAILS_ENV=development db:data:load # loads db/data.yml

Creating a dump from the production server

bundle exec rake RAILS_ENV=production db:data:dump # loads db/data.yml

Reset admin login, password and skip ldap

RAILS_ENV=development bundle exec script/rails runner 'user = User.find(:first, :conditions => {:admin => true}) ; \
user.login = "admin"; user.auth_source_id = nil; user.password, user.password_confirmation = "my_password"; user.save!'

If you know the login of you might also use something like :conditions => {:login => "myLogin"}

Start rails for development

bundle exec rake RAILS_ENV=development script/rails server webrick --port=30001

Running the tests

Now you should be able to login under
To run the tests call

  • bundle exec rake redmine:plugins:test NAME=redmine_medelexis, which runs the test for all installed plugins.
    Run tests for redmine_medelexis-plugins using
  • bundle exec rake redmine:plugins:test NAME=redmine_medelexis
  • ruby test/functional/license_test.rb
  • ruby test/integration/license_test.rb

Scripts for the production server

The script scripts/convert_test_abo_to_orders.rb converts all open ‘TRIAL’ issues older than 1 month into ‘LICENSED’. It should be run daily with a cron scripts. E.g. /etc/cron.daily/onvert_test_abo_to_orders.sh could have the following content.

#!/bin/bash
cd /path/to/redmine/checkout && bundle exec ruby script/rails runner plugins/redmine_medelexis/scripts/convert_test_abo_to_orders.rb

It will add the log entries like this to the system logg

Aug 11 20:28:11 host user: redmine_medelexis: issue_to_licensed took 1 second for ids 20,21,22

It bundles all changes into a single transaction which includes the system log output, therefore we should be able to trust it.

About

A few goodies for the Medelexis MIS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%