Code Monkey home page Code Monkey logo

custom_tables's Introduction

Redmine Custom Tables

This plugin provides a possibility to create custom tables. The table is built with Redmine custom fields. It allows you to create any databases you need for your business and integrate it into your workflow processes.

Online demo

  • login: admin
  • password: admin

Features

  • Table constructor
  • Filtering
  • Sorting
  • Grouping
  • Integration with issues
  • History of changes
  • Commenting entities
  • Export CSV/PDF
  • API

Compatibility

  • Redmine 4.0.0 or higher

Installation and Setup

  • Clone or download this repo into your redmine_root/plugins/ folder
$ git clone https://github.com/frywer/custom_tables.git
  • If you downloaded a tarball / zip from master branch, make sure you rename the extracted folder to custom_tables
  • You have to run the plugin rake task to provide the assets (from the Redmine root directory):
$ bundle exec rake redmine:plugins:migrate RAILS_ENV=production
  • Restart redmine

Usage

  1. Visit Administration->Custom tables to open table constructor.
  2. Press button New table. Fill the name field, select projects you want to enable table on and submit the form.
  3. Add custom fields to your new table.
  4. Give access to the users Administration -> Roles and permissions -> Project -> Manage custom tables

custom_tables's People

Contributors

frywer avatar grosucon avatar prmdhost avatar vsc55 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

custom_tables's Issues

ActionView::Template::Error (undefined method `name' for nil:NilClass):

Dear @frywer

First I want to thank you about this job.

I followed the steps in the readme file (double checked), and it seems to work but at the moment I try to export to pdf I get the "Internal error" message and looking at the production log I see next lines:
`Started GET "/custom_tables/1.pdf" for 95.169.228.73 at 2021-05-09 17:29:24 +0000
Processing by CustomTablesController#show as PDF
Parameters: {"id"=>"1"}
Current user: admin (id=1)
Rendering plugins/custom_tables/app/views/custom_tables/show.pdf.erb
Rendered plugins/custom_tables/app/views/custom_tables/show.pdf.erb (2.1ms)
Completed 500 Internal Server Error in 61ms (ActiveRecord: 52.3ms)

ActionView::Template::Error (undefined method `name' for nil:NilClass):
1: <%= raw custom_tables_to_pdf(@custom_entities, @project, @query) %>

plugins/custom_tables/app/helpers/custom_tables_pdf_helper.rb:6:in custom_tables_to_pdf' plugins/custom_tables/app/views/custom_tables/show.pdf.erb:1:in _plugins_custom_tables_app_views_custom_tables_show_pdf_erb__86558262865344834_69817450630220'
lib/redmine/sudo_mode.rb:65:in sudo_mode' plugins/redmine_dmsf/lib/redmine_dmsf/webdav/custom_middleware.rb:60:in call'`

Are you so king to tell me how to debug further this error?

Let project manager to modify the table definition

Hi,
Thank you for such a great plugin.
Now, the plugin works as:
Administrator create and define the table structure.
The project members who has permission (such as Manager) can input data to the table, but no one can have the permission to modify the table structure.

Is it possible to change the permission granting to:

  1. Administrator create main table
  2. In Roles & permission settings, enable Manager to modify the table, and enable some other roles to add data to table, some other roles to edit data, some other roles to delete data.

Error when used with redmine_checklist

This plugin fails when used in conjunction with redmine_checklists (either light or pro version)

The plugin installs ok but when I try to look into a custom table (click on the lens) I get this error

Started GET "/custom_entities/1" for XX.XX.XX.XX at 2020-06-04 09:25:30 +0200
Processing by CustomEntitiesController#show as HTML
  Parameters: {"id"=>"1"}
  Current user: admin (id=1)
  Rendering plugins/custom_tables/app/views/custom_entities/show.html.erb within layouts/admin
  Rendered plugins/custom_tables/app/views/custom_entities/_history.html.erb (6.8ms)
  Rendered plugins/custom_tables/app/views/custom_entities/show.html.erb within layouts/admin (19.9ms)
Completed 500 Internal Server Error in 42ms (ActiveRecord: 14.3ms)

ActionView::Template::Error (undefined method `project' for nil:NilClass):
     8:
     9:         <% if journal.details.any? %>
    10:             <ul class="details">
    11:               <% details_to_strings(journal.visible_details).each do |string| %>
    12:                   <li><%= string %></li>
    13:               <% end %>
    14:             </ul>

plugins/redmine_checklists/lib/redmine_checklists/patches/issues_helper_patch.rb:39:in `details_to_strings_with_checklists'
plugins/custom_tables/app/views/custom_entities/_history.html.erb:11:in `block in _6e0a70cc0d75a91bab1a58757fef455b'
plugins/custom_tables/app/views/custom_entities/_history.html.erb:1:in `each'
plugins/custom_tables/app/views/custom_entities/_history.html.erb:1:in `_6e0a70cc0d75a91bab1a58757fef455b'
plugins/custom_tables/app/views/custom_entities/show.html.erb:46:in `_ae781de78c7c286cab57ff041a47a806'
lib/redmine/sudo_mode.rb:65:in `sudo_mode'

If I remove redmine_checklists, custom_tables works ok.

SQLite Error

SQLite3::SQLException: Cannot add a NOT NULL column with default value NULL: ALTER TABLE "custom_tables" ADD "lft" integer NOT NULL

when do
bundle exec rake redmine:plugins:migrate RAILS_ENV=production

File field always required

Hi, I've created a table that includes a file custom field. It is not marked as required. However, when I try to create a new registry in the table, it does not create it since it requires the file (warning message "File is invalid").

It would be great if you could check this.
And thanks a lot for your nice plugin!

Some API functions work only from admiin user

Hi.
I am trying to read through API the rows of custom table for the specified issue id:

curl -v -X GET -H "Content-Type: application/json" -H "X-Redmine-API-Key: aaaaaaaaaaaaaaaaaa" -d '{"issue_id": "21508"}' "https://mydomain/custom_tables/5.json"
But it doesnt work from normal user, even thou this user has an access to this issue.
I understand now, that plugin probably makes SQL-request to the whole table and doesnt check the rights of the user for the specified issue. Therefore this request works only from admin.

But the problem is that we cannot run scripts with admin rights on our system....

Can you please may be make one more API-method which would check for the user's right and allow read table rows for the issue, if user has the rights to edit (see) the issue specified in the request?
Thank you !

It looks like Redmine provides the methood to see the needed information:
https://www.rubydoc.info/github/edavis10/redmine/Issue#attributes_editable%3F-instance_method

Originally posted by @Mikhail-Kukharenko in #18 (comment)

Issue with sorting custom table

Hello! I'm using your plugin for my redmine custom build. Recently after migration I get an issue which doesn't allow me to sort custom table in my issue. Is it probably because I'm using postgresql instead of mysql or not?

Customize view of table in issue

Is there possibility to customize view of table in issue? For example, I would like to hide totals for number type fields above table view, and leave just table name

API

Hi! Where can I find API information? Is there any support for the REST API?

Grant read-only access to role

Hi,
In my configuration I want to create a role that should have the read-only access to a custom_tables.

I tried to achieve this by giving the role permission to see the table in the custom_table settings and not giving him the manage access in "Administration -> Roles and permissions -> Project -> Manage custom tables". But the table shows the alert "No permission to manage custom tables!".

Am I doing something wrong or is it not possible to grant read-only access to a role for a custom_table?

Thanks in advance

Cannot Load Such File

Hi, I was trying to install your plugin, but every time i try to run the "Bundle exec rake" command the following appears:
C:\Bitnami\redmine-4.0.4-3\apps\redmine\htdocs>bundle exec rake redmine:plugins:migrate RAILS
_ENV=production --trace
rake aborted!
LoadError: cannot load such file -- rspec/core/rake_task
C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/plugins/custom_tables/lib/tasks/r
edmine.rake:1:in require' C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/plugins/custom_tables/lib/tasks/r edmine.rake:1:in <top (required)>'
C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/lib/tasks/redmine.rake:190:in lo ad' C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/lib/tasks/redmine.rake:190:in bl
ock in <top (required)>'
C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/lib/tasks/redmine.rake:190:in ea ch' C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/lib/tasks/redmine.rake:190:in <t
op (required)>'
C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/rai
lties-5.2.3/lib/rails/engine.rb:650:in load' C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/rai lties-5.2.3/lib/rails/engine.rb:650:in block in run_tasks_blocks'
C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/rai
lties-5.2.3/lib/rails/engine.rb:650:in each' C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/rai lties-5.2.3/lib/rails/engine.rb:650:in run_tasks_blocks'
C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/rai
lties-5.2.3/lib/rails/application.rb:515:in run_tasks_blocks' C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/rai lties-5.2.3/lib/rails/engine.rb:459:in load_tasks'
C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/rai
lties-5.2.3/lib/rails/railtie.rb:190:in public_send' C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/rai lties-5.2.3/lib/rails/railtie.rb:190:in method_missing'
C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/Rakefile:7:in <top (required)>' C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/rak e-12.3.3/lib/rake/rake_module.rb:29:in load'
C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/rak
e-12.3.3/lib/rake/rake_module.rb:29:in load_rakefile' C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/rak e-12.3.3/lib/rake/application.rb:703:in raw_load_rakefile'
C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/rak
e-12.3.3/lib/rake/application.rb:104:in block in load_rakefile' C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/rak e-12.3.3/lib/rake/application.rb:186:in standard_exception_handling'
C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/rak
e-12.3.3/lib/rake/application.rb:103:in load_rakefile' C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/rak e-12.3.3/lib/rake/application.rb:82:in block in run'
C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/rak
e-12.3.3/lib/rake/application.rb:186:in standard_exception_handling' C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/rak e-12.3.3/lib/rake/application.rb:80:in run'
C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/gems/rak
e-12.3.3/exe/rake:27:in <top (required)>' C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/bin/rake :23:in load'
C:/Bitnami/redmine-4.0.4-3/apps/redmine/htdocs/vendor/bundle/ruby/2.5.0/bin/rake
:23:in `

'

Have you seen this before, or do you possibly know what might be causing this?

Thank you

Add custom values on create issue

How to add values for a custom table on creating issue? Can this be done?
Or automatically show a popup form for a custom table after creating issue

Error during installation

I get this message during install...
[!] There was an error parsing Gemfile:
[!] There was an error parsing Gemfile: You cannot specify the same gem twice with different version requirements.
You specified: database_cleaner (>= 0) and database_cleaner (~> 1.6.1). Bundler cannot continue.

from /opt/bitnami/apps/redmineplusagile/htdocs/plugins/custom_tables/Gemfile:6

-------------------------------------------

gem 'poltergeist'

gem 'database_cleaner', '~> 1.6.1'

gem 'rspec-retry'

-------------------------------------------

. Bundler cannot continue.

from /opt/bitnami/apps/redmineplusagile/htdocs/Gemfile:99

-------------------------------------------

Dir.glob File.expand_path("../plugins/*/{Gemfile,PluginGemfile}", FILE) do |file|

eval_gemfile file

end

-------------------------------------------

CustomEntity of type User does not have users inside its values

I've created a CustomTable with only one field, which is a field of type User. When I try to create a new CustomEntity for that table, the field has no users inside its values. But if I don't select an user from that table and edit it, it now has users inside its values

I made a GIF to show what I mean:
chrome_ZDLMh2eVI8

Custom tables columns as Issue list filter and add columns

Ubuntu 18.04
Docker redmine 4.1.0 amd64

This is a great plugin, but i'm looking for one feature that i dont know if its intended or not, maybe a bug.
I need to use the custom tables as filters on main issue list and be able to add columns too, but i cant do it even if i check 'used as a filter' when i create the custom table.

Environment:
Redmine version 4.1.0.stable
Ruby version 2.6.5-p114 (2019-10-01) [x86_64-linux]
Rails version 5.2.4.1
Environment production
Database adapter Mysql2
Database timezone UTC
ActiveRecord timezone local
App timezone UTC
Mailer queue ActiveJob::QueueAdapters::AsyncAdapter
Mailer delivery smtp
SCM:
Subversion 1.10.4
Mercurial 4.8.2
Bazaar 2.8.0
Git 2.20.1
Filesystem
Redmine plugins:
custom_tables 1.0.4
easy_gantt 1.12
redmine_dashboard 2.7.1
redmine_more_filters 1.4.0

Cannot export to CSV

On a table with over 100 rows the CSV export is always the first 100 items. If you select 201 to 300 or 301 to 400, the csv export is 1 to 101.

It would be useful to have an option to list "All" rows in a table and then export these via CSV.

Feature request to move "Show, Edit, Delete" icons

Hi

When the table is large, navigating to the right hand side to reach the "Show, Edit, Delete" icons for each row is a bit awkward. If they were located on the left hand side of the row, it would be a lot more user friendly.

table-1

Copy table data when create copy of issue

Feature request
When I copy issue it will be nice to get date in copied issue.
It's needed to prepare eg. test scenario repository - in project "repository" custom test scenarios (or regression scenarios) an then copy to real project when I plan to use scenario.

export to

When I click export in pdf (in issue) - the values from the custom tables are not displayed. How to make values get exported?

User custom table item as value in custom field

I'd like to use (select in combo-box) an item/row defined in a custom-table to set value of a custom field on issue.
With this feature would be possible to create new custom entities (eg. contracts, orders, and so on) with their attributes and attach to an issue or to a project.

Errors after uninstall this plugin

Since my previous issue I have uninstalled this plugin, but after that I get errors with other components of redmine like custom fields or the calendar. In production.log I can see several errors of this type.

Started GET "/projects/2193_m-add-a-suite_ad/issues" for 89.107.242.213 at 2020-06-09 10:14:19 +0200
Processing by IssuesController#index as HTML
  Parameters: {"project_id"=>"2193_m-add-a-suite_ad"}
  Current user: admin (id=1)
Completed 500 Internal Server Error in 24ms (ActiveRecord: 11.9ms)

ActiveRecord::SubclassNotFound (The single-table inheritance mechanism failed to locate the subclass: 'CustomEntityCustomField'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite CustomField.inheritance_column to use another column for that information.):

app/models/query.rb:1381:in `group_by'
app/models/query.rb:1381:in `add_associations_custom_fields_filters'
app/models/issue_query.rb:209:in `initialize_available_filters'
app/models/query.rb:652:in `available_filters'
plugins/redmine_checklists/lib/redmine_checklists/patches/issue_query_patch.rb:41:in `available_filters_with_checklists'
app/models/query.rb:403:in `build_from_params'
app/models/issue_query.rb:92:in `build_from_params'
app/helpers/queries_helper.rb:314:in `retrieve_query'
app/controllers/issues_controller.rb:46:in `index'
plugins/redmine_issues_tree/lib/redmine_issues_tree/issues_controller_patch.rb:17:in `index'
lib/redmine/sudo_mode.rb:65:in `sudo_mode'
plugins/redmine_dmsf/lib/redmine_dmsf/webdav/custom_middleware.rb:72:in `call'
Started GET "/projects/2193_m-add-a-suite_ad/issues/calendar" for 89.107.242.213 at 2020-06-09 10:14:25 +0200
Processing by CalendarsController#show as HTML
  Parameters: {"project_id"=>"2193_m-add-a-suite_ad"}
  Current user: admin (id=1)
Completed 500 Internal Server Error in 30ms (ActiveRecord: 14.7ms)

ActiveRecord::SubclassNotFound (The single-table inheritance mechanism failed to locate the subclass: 'CustomEntityCustomField'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite CustomField.inheritance_column to use another column for that information.):

app/models/query.rb:1381:in `group_by'
app/models/query.rb:1381:in `add_associations_custom_fields_filters'
app/models/issue_query.rb:209:in `initialize_available_filters'
app/models/query.rb:652:in `available_filters'
plugins/redmine_checklists/lib/redmine_checklists/patches/issue_query_patch.rb:41:in `available_filters_with_checklists'
app/models/query.rb:403:in `build_from_params'
app/models/issue_query.rb:92:in `build_from_params'
app/helpers/queries_helper.rb:314:in `retrieve_query'
app/controllers/calendars_controller.rb:42:in `show'
lib/redmine/sudo_mode.rb:65:in `sudo_mode'
plugins/redmine_dmsf/lib/redmine_dmsf/webdav/custom_middleware.rb:72:in `call'

I reinstalled the custom_tables plugin, although I can't use it because It doesn't work in conjunction with redmine_checklists.

This is the error:
ActiveRecord::SubclassNotFound (The single-table inheritance mechanism failed to locate the subclass: 'CustomEntityCustomField'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite CustomField.inheritance_column to use another column for that information.):

I found that the SubClass 'CustomEntityCustomField' is defined in custom_tables so there is a uninstall issue.

I have uninstalled with the command
bundle exec rake redmine:plugins:migrate RAILS_ENV=production VERSION=0 NAME=custom_tables

is import from CSV possible

I am trying to use a source CSV file of names/numbers/emails to create an online address list for my users. I think this is the closest matching plugin for this capability. Is it possible to import data into a custom table?

Field format "User"

There is possibility to add field format "User" with drop-down list of all users OR users inherited with project/issue?

Not able to insert field value with API

Hi,
I try to use Rest API to insert a new row to a custom table.
After I sent the http request, a new row do inserted to my custom table, but the field value was not. Please see below:

curl -X POST -H "Content-Type: application/json" -H "X-Redmine-API-Key: 8b506638580e4918f9249ac622cd835b30a63e86" -d '{"custom_entity": {"custom_table_id":8, "issue_id":35, "external_names":{"HTS":"xxxxxx"}}}' http://redmine.devops.wq/custom_entities.json
{"id":89,"HTS":"","issue_id":35,"custom_table_id":8}

I wanted to assign "xxxxxx" to column "HTS" when the row was created. A new row was created but "xxxxxx" was not assigned to column "HTS", which kept blank.
Is there any thing incorrect I did? Can you help figure out where the problem is?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.