Adding a field to registrant for the admin

More
11 years 7 months ago #48170 by MStar
Hey Tuan,

Thanks for the great product.

I am trying to find the best way to add an extra column in the database for the registrants. This column would be similar to the published column and would store grades of folks who attend the courses.

Do I just add this column directly in the database (via phpmyadmin or something like that) or is there an xml file I can play around with?

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

More
11 years 7 months ago #48175 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Adding a field to registrant for the admin
Hi

Who will enter that grades ? Administrator of the site ? Please let me know so that I can guide you.

Regards,

Tuan

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

More
11 years 7 months ago #48182 by MStar
Replied by MStar on topic Adding a field to registrant for the admin
Hey Tuan, thanks for the reply.

It will be the trainer, preferably one who has the privilege to be able to see the list of students. Perhaps he could assign the grade on that very list (you know the list on the event page?). That is the ideal situation but if that's too convoluted then assigning grades from the backend (so trainer with admin privileges) might be another possibility.

These grades need to be permanently stored in the DB because based on these grades certificates may be generated later.

Oh and obviously the students or anyone unauthorized should not be able to enter nor see others' grades.

Appreciate your replies on this. Thank you!

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

More
11 years 7 months ago - 11 years 7 months ago #48192 by MStar
Replied by MStar on topic Adding a field to registrant for the admin
Hey Tuan,

I figured out how to change grade on the front end (by making changes in the registrantlist and registrant views). Now I'm struggling with something else. After editing the user in the registrant list, it redirects to the history page:

In the controller.php file, the following line controls that:
Code:
$this->setRedirect(JRoute::_(EventbookingHelperRoute::getViewRoute('history', $Itemid), false));

You can find it under the
Code:
save_registrant()
function

I am just wondering if there is a way to instead redirect it to the registrantlist view (i.e. the view that comes up when you click on View List). I've tried it a couple of times but the redirect is unsuccessful. Any tips on this? If this is not possible, then just closing the modal might be another option but less ideal.

I'd also appreciate if you could tell me if there;s something wrong I could be doing with any of this.
Last edit: 11 years 7 months ago by MStar.

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

More
11 years 7 months ago #48195 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Adding a field to registrant for the admin
Hi

If I understand your requirement correctly, you can change the code above to
Code:
$this->setRedirect(JRoute::_(EventbookingHelperRoute::getViewRoute('registrantlist', $Itemid), false));

Could you try ?

Tuan

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

More
11 years 7 months ago - 11 years 7 months ago #48228 by MStar
Replied by MStar on topic Adding a field to registrant for the admin
Hey Tuan, thank you for your reply.

I tried what you suggested before as well but its not exactly what I need. Let me post images to explain what I would like to happen.

image1.png - So when you are on the page shown in image1.png, you click View List and you get to what is shown in image2.png. The solution you suggested, instead, brings the user to image3.png. What I would like is, if possible, to bring the user back to image2.png so they can continue to assign grades.

I am not entirely sure on how getViewRoute works. The line that controls the behavior of View List (from image1.png) is in /event/tmpl/default.php:
Code:
<a href="index.php?option=com_eventbooking&view=registrantlist&id=<?php echo $item->id ?>&tmpl=component" class="eb-colorbox-register-lists"><span class="view_list"><?php echo JText::_("EB_VIEW_LIST"); ?></span></a>

Following that line, I have managed to achieve what I wanted temporarily by getting the event_id (with $event_id = JRequest::getVar('event_id', ''); ) and doing the following:
Code:
$this->setRedirect(JRoute::_("index.php?option=com_eventbooking&view=registrantlist&id=$event_id &tmpl=component"));

I am not sure if this is a viable solution so I'd appreciate it if you could suggest something better if it exists.

Thank you for all your replies so far.
Last edit: 11 years 7 months ago by MStar.

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

More
11 years 7 months ago #48252 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Adding a field to registrant for the admin
Ah

I understand it now. Yes, you can use the code above. It is a valid code

Regards,

Tuan
The following user(s) said Thank You: MStar

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

More
11 years 7 months ago #48268 by MStar
Replied by MStar on topic Adding a field to registrant for the admin
Awesome, thank you for your replies.

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

More
11 years 7 months ago #48273 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Adding a field to registrant for the admin
No problem. Happy to assist when you (and general customers) need support :).

Tuan

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

Moderators: Tuan Pham Ngoc