First, you will need the basic URL for linking to a list of tickets...
http://*your domain*/intranet/infocapture/issues.php
Then you will need to define the ID of the project that you wish to link to NB: Your session will store the ID of the project that you were viewing last, so this is necessary to ensure that you are always linking to the correct project.
http://*your domain*/intranet/infocapture/issues.php?project_id_select=1
(Don’t forget to change the id of the project to the one that you want to link to. “Project ID 1” is just my example!)
Then you need to pass the variable(s) and the value(s) of the filter that you wish to run....
Here are the variables that are available for every project....
Variables available for fields specific to your project can be discovered using the Firebug Add-on for Firefox.
Example: I have a select list with a symbolic name of “category” (it contains 3 values - Cat 1, Cat 2, Cat 3)
The variable for this field will be “category[]”.
The first value in a select list is always “0”. So the field values are mapped as follows...
Passing the variables in the URL
Here is an example of linking directly to a filter on project id=1, for all tickets that have a Category value of Cat 1.
http://*your domain*/intranet/infocapture/issues.php?id_in_project=1&search_string=&category[]=0
Here is an example of the same link, but filtering the list by tickets reported only by myself... NB: My user id is 23
http://*your domain*/intranet/infocapture/issues.php?id_in_project=1&search_string=&category[]=0&_reporter_[]=23
In this next example, I’m filtering the list by the first status and by category 2
http://*your domain*/intranet/infocapture/issues.php?id_in_project=1&search_string=&category[]=1&_status_[]=0
Replace the first square bracket with
%5B
Replace the second square bracket with
%5D
Example:
http://*your domain*/intranet/infocapture/issues.php?id_in_project=1&&_status_[]=0
becomes
http://*your domain*/intranet/infocapture/issues.php?id_in_project=1&&_status_%5B%5D=0
With thanks to Craig (and the Claromentis UK Development Team), I’m now pleased to share with everyone the new Component that can be used to create links to Infocapture Ticket Lists with the filters for the “Assigned To” and “Reported by” field values as “Myself”.
This will be particularly useful for many of our clients I’m sure....
IC Ticket List with Filter Component
<component class=”ComponentICSelfGeneratedLinks” project_id=”8” link_name=”This is the link name” mode=”1”>
Link_name - Defines the title of the click-able link/url
Mode - Defines the list filter for tickets logged by or reported by the user clicking on the link
Discussion
NB: At this time, I don’t think it’s possible to run the filter using the Reported By and Assigned To variables as “Myself”. This is because it’s PHP code that collects the user id from the global session variables for this filter, and it’s not possible to run the POST this in a URL. (As far as I am aware).
If anyone comes up with a way to do this, please share... :)
Otherwise, each user will require their own URL to link directly to a filter that uses the “Myself” filter for the “Assigned To” or “Reported By” fields...
However!! It should be really easy to write a component that generates this URL automatically! In fact, the concept of an Infocapture Automated Filter Link Component actually sounds quite exciting.. and simple. :)
Anthony,
I agree that your last point sounds like a good solution in the short term - If this were developed, could it be incorporated into core code for other customers to use as well?
My coding senses are tingling...
As a further reply to this, I’ve developed and sent you an example of the Component that you’ve suggested.
This is an interesting topic that I anticipate editors that are providing links in Publish etc, to users without a lot of technical knowledge, would find to be a very worthwhile aid. One of the items that I find us consistently advising on is “How do I find the information that is only applicable to me / us / here?”
It is interesting in Anthony’s post above that the filter will not function on filtering by “Myself” - we currently have bespoke plugins on some of our IC projects to restrict access to an IC list based on “Who I am”.
The above seems to be a good way of linking people to specifically filtered issue lists, however how would this fit with projects that have “codename” links in the newer versions of Claromentis? Would you need to revert back to the legacy full path link?
One downside to this I believe would be the last “Tip” as I don’t think users would be able to competently change these links without some prior knowledge. Is there a way to automate this in the future?
Thanks again for the submission of the component to create the URL Craig. Particularly when written on a lunch break whilst on a training course!! This is a really great start for this component and has great scope for further additions.
With regards to the square brackets causing an issue when Claromentis abbreviates URLs... this can be overcome by enhancing the regex that Claromentis users... however, this is a little more involving than a simple fix... the development team will have to take into consideration potential security risks with allowing this and any other side affects that this may have... but it’s definitely being considered already, and may find it’s way into the core in a near future release.
I think this is a great example of collaboration between ourselves and our clients and I hope this continues to grow as this can become a very strong and rewarding area of our software for both parties.
Thanks again!