a few questions about custom fields

9 years 5 months ago #1 by rapasae
Hello.

Is there any way to create a custom field of type "checkbox" so you can add for example, an acceptance of "TOS" (terms of service)

Another doubt.
Is it possible to delete or change the order of the predefined fields when using a form with custom fields, so that such attachments are not in last place or the summary is not first ?.

Thanks a lot for your great component and support

Please Log in or Create an account to join the conversation.

9 years 5 months ago #2 by chrisc
I was working on adding 'checkbox' to the type of custom fields, but the main problem is that Joomla doesn't have it as one of the JHtml types so it is necessary to cludge the output to get what we need. It was starting to get very messy so the change was put on the back burner whilst I thought more on the implementation. [The code is still present just not invoked.) The best solution I can suggest is to use a radio button instead, even thought it is not ideal (or quite the same thing).

The order of the custom fields is controlled by the custom fields 'ordering' column, but the actual positioning of all of the fields in the form and in the display is governed by the actual template fields. There is no easy way to change their order other than by changing the template fields themselves.

If you are interested in going down this route the best way is to create template overrides for the releveant templates and make your changes there. This has two advantages, the first being that any changes you make are not lost when the component is updated. The second is that you can try out your changes easily and if you messy it up you can just copy over the orginal template fields and start again.

The only disadvantage is that you would need to relook at your changes when an update is installed to ensure that you can implement any of the changes you want for the new release.

There are several places on the Joomla site and elsewhere that descrbe how easy it is to create template overrides so I will not repeat them here. Any problems please ask.

Regards

If you are using our extensions please leave a review at the JED: IP Mapping | Issue Tracker | JAudit | Password Control

Please Log in or Create an account to join the conversation.

9 years 5 months ago - 9 years 5 months ago #3 by rapasae
Thank you for your advice. I will try something like you have described.

I think I found a bug/problem or perhaps i don't understand this module enough.

I have several projects with custom fields. When i want to create a new issue, custom fields for each project are displayed correctly using the project dropdown list in the form to select the project. But if I create a menu to show the form with only one project, it always show custom fields belonging to the default project.

Please Log in or Create an account to join the conversation.

9 years 5 months ago - 9 years 5 months ago #4 by chrisc
I will try and reproduce the problem and work on a fix. Shouldn't be too difficult. May not be today though. Thank you for reporting it.

Update: yes I can confirm its a 'feature'. It should be changed. Watch this space...

Update 2: Let us try making the following chnage:

In the file site/component/com_issuetracker/views/form/view.html.php after line 366 (just before the $def_type is obtained from the parameters), add the following code:
      // Get project from menu item if only one possible.
       $menu      = $app->getMenu()->getActive();
       if ($menu) {
         $projects =  $this->parameters->get('projects');
         $cnt = count($projects);
         if ( $cnt == 1 && $projects[0] != 0 )
            $def_proj = $projects[0];
      }
:

Also change the line around (new) 396 from:
      if (empty($this->item->id) ) {
to:
      if (empty($this->item->id) && empty($this->item->related_project_id) ) {

The last change is just 'belt and braces' and is probably not required but it does no harm.

Let me know it it works for you, my tests seem to be fine.

Regards

If you are using our extensions please leave a review at the JED: IP Mapping | Issue Tracker | JAudit | Password Control
The following user(s) said Thank You: rapasae

Please Log in or Create an account to join the conversation.

9 years 5 months ago #5 by rapasae

chrisc wrote: Let me know it it works for you, my tests seem to be fine.


Excellent! It works for me too.

Thanks a lot!
The following user(s) said Thank You: chrisc

Please Log in or Create an account to join the conversation.

9 years 5 months ago #6 by chrisc
I have added the fix for the next version.

Now to revisit the checkbox and see if I can resolve the problem I was seeing. I suspect I may end up having to code the html directly.

I will not mark the thread as resolved until I have get the checkboxes option in place.

Regards

If you are using our extensions please leave a review at the JED: IP Mapping | Issue Tracker | JAudit | Password Control

Please Log in or Create an account to join the conversation.

Time to create page: 0.168 seconds
Go To Top

Joomla! Debug Console

Session

Profile Information

Memory Usage

Database Queries