Create new View page or Export

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
Starbuck
Posts: 217
Joined: Feb 13, 2006 9:53 pm
Location: USA
Contact:

Create new View page or Export

Post by Starbuck »

I have looked all around and I think I must be missing something... A colleage added new custom fields to a project. I thought it would be good to have a View of that data.

We have Print Reports, CSV Export, Excel Export, and XML Export.

Is there a model anywhere, maybe documentation, that describes how to properly add a button to the Viewing Issues area of view_all_bug_page.php?

I do not want to simply customize the one view for a project.
I want to create a new view option, like a new kind of issues_trend_page.php.
A user should be able to click the button for a new view, with as much ease as the ability to Save a filter to display filtered fields in the one view that we have.

This might be the wrong approach. Maybe it would be better to duplicate view_all_bug_page.php, and add a new button to the navigation area, either at the bottom or under View Issues?

Suggestions are welcome. Thanks!
If you want Mantis to work differently, use or create a plugin. Visit the Plugins forums.
Ask developers to create a plugin that you need - and motivate them to help you!
cas
Posts: 906
Joined: Mar 11, 2006 11:08 am
Contact:

Re: Create new View page or Export

Post by cas »

You could create a plugin which adds a button to the view page :roll:
The plugin then can handle your requirements.
Starbuck
Posts: 217
Joined: Feb 13, 2006 9:53 pm
Location: USA
Contact:

Re: Create new View page or Export

Post by Starbuck »

Thanks @cas. But, well, that's a 100% DIY solution with zero % built-in support. I was kinda hoping for slightly better. :wink:

I know we have examples for adding buttons to the side, like in the wiki plugin.
But creating a new view won't be as easy as cloning view_all_bug_page.php. That page relies on configuration settings to decide what to display. Reproducing that functionality requires creating a new table for configuration data. That means a new section is required in Configuration to save the parameters.

If I were to create a plugin, it would be very generic and allow for any number of side buttons (kinda sloppy) leading to new views which all have their own configuration data and sections. In v2 there should probably be an ability for users to define and add their own views. In v3, add security so that only members with permission can do that.

That's huge. I'm already dreading version 3 before I start the first line of code. :lol:

Seriously though, I need to look at the code to understand what kind of structure is already in place. I really hope it's dynamic as I describe here, and not all hardcoded like there will only ever be one view that's assumed to be adequate for all members and all needs.
If you want Mantis to work differently, use or create a plugin. Visit the Plugins forums.
Ask developers to create a plugin that you need - and motivate them to help you!
cas
Posts: 906
Joined: Mar 11, 2006 11:08 am
Contact:

Re: Create new View page or Export

Post by cas »

@starbuck, there is an alternative for viewing/exporting that data even without a plugin.
You can manage the columns for the bug_view_all page yourself as well as the XLS/CSV export columns.
In your case, if you do not want to adjust the view_all_bug_page layout, you can simply adjust the XLS export layout.
EazyPeazy :mrgreen:
Starbuck
Posts: 217
Joined: Feb 13, 2006 9:53 pm
Location: USA
Contact:

Re: Create new View page or Export

Post by Starbuck »

That's where we are now, with one view for everyone with a single configuration. Change the configuration and it's still the same view for everyone.

To be clear, there is the view on the page, the CSV view, the Print view, etc. Yes, each one of those has a configuration. But there is only one page view, only one CSV view, only one Print view...

Consider filters, where we have named filters that determine what goes into those views.
I'm proposing named views where we can see different fields of that filtered data.

I don't care if I get to this from a button on the side, from a button next to Print/CSV, or a dropdown by filters.
We should be able to toggle a named view, see all of the fields for that view, and then click one of the buttons to Print or export that view.

Also consider: Right now if we export to CSV we don't really know what fields we will want later, so we configure those fields for what we want right at that moment. It's a personal preference of the administrator. To avoid changing it later, we might just put all fields in the export configs, and then post-process it after we get the data. With Print we can't do that -there is one report for everyone. We can't just put all fields in the Print because there is limited page space.

So now I'm thinking:
- Use the Filter dropdown as a model rather than adding a button to the side. This would be much more elegant.
- Create a manage_view_page.php like manage_filter_page.php.
- Create a new manage_config_columns_page.php that will save to named views rather than the default view.

As I think about this, all of the code is already there, it just needs to be repurposed into a plugin.

Any thoughts from @atrol or @dregad?
If you want Mantis to work differently, use or create a plugin. Visit the Plugins forums.
Ask developers to create a plugin that you need - and motivate them to help you!
Starbuck
Posts: 217
Joined: Feb 13, 2006 9:53 pm
Location: USA
Contact:

Re: Create new View page or Export

Post by Starbuck »

Additional note : We know that we can do this because Mantis already supports per-project views. What I'm suggesting here is that views simply get names which can then be assigned as a default to any project, and then the names can be made available in a dropdown in the view page.

I think I will be able to do this but it will take time ... which I don't have ... but it will be fun! :)
If you want Mantis to work differently, use or create a plugin. Visit the Plugins forums.
Ask developers to create a plugin that you need - and motivate them to help you!
cas
Posts: 906
Joined: Mar 11, 2006 11:08 am
Contact:

Re: Create new View page or Export

Post by cas »

In the past I have developed a so-called Query plugin which allowed me to create a variation of reports and even to send them by mail to various people.
Queries are defined by the admin but can be executed by multiple people ( or distributed in the background) :mrgreen:
Starbuck
Posts: 217
Joined: Feb 13, 2006 9:53 pm
Location: USA
Contact:

Re: Create new View page or Export

Post by Starbuck »

Yes, Queries would be good to simply report data. But we would lose the formatting and functionality provided by the View page. For example, clicking on fields, and especially mass updates of selected records.

There still needs to be a link between the fields selected for a query and the fields which are rendered in the View grid.

I am guessing that you have a UI where a query is entered. It might be a text box similar to the Configuration form where we enter the fields that are rendered in the view and exports. So you're storing your output specs (the columns to be displayed) in a separate table.

Some of that code would be useful but it doesn't sound it's a real integration with the existing environment, it's more of an add-on than a plugin.

I'm thinking of functionality that works more integrally with Mantis, not outside of it.

Is my understanding of what you've done incorrect?

Thanks for the continued discussion. Suggestions from others are also welcome.
If you want Mantis to work differently, use or create a plugin. Visit the Plugins forums.
Ask developers to create a plugin that you need - and motivate them to help you!
cas
Posts: 906
Joined: Mar 11, 2006 11:08 am
Contact:

Re: Create new View page or Export

Post by cas »

It is a plug-in for Mantis but indeed does not take care of your requirements as described. What you are looking for is an option to dynamically change the lay-out using named views.
That indeed could be a nice add-on to mantis.
I will give it some thougts :roll:
cas
Posts: 906
Joined: Mar 11, 2006 11:08 am
Contact:

Re: Create new View page or Export

Post by cas »

@starbuck, Did you check out this plugin:
https://github.com/mantisbt-plugins/Inl ... figuration

With a few changes, it can be made to select a lay-out based upon name ( by project if you like) :mrgreen:
Starbuck
Posts: 217
Joined: Feb 13, 2006 9:53 pm
Location: USA
Contact:

Re: Create new View page or Export

Post by Starbuck »

I think that's exactly what I've been describing. I will fork it and start looking.
Thanks @cas!!!!!!!!!!!!!!!!!
If you want Mantis to work differently, use or create a plugin. Visit the Plugins forums.
Ask developers to create a plugin that you need - and motivate them to help you!
Post Reply