Welcome, Guest
Username: Password: Remember me

TOPIC: Requesting your help, thanks.

Requesting your help, thanks. 09 Sep 2013 00:20 #11029

  • vlemos
  • vlemos's Avatar
  • Online
  • Elite Member
  • Posts: 295
  • Thank you received: 41
  • Karma: 21
Hello Cooks

I am requesting your help to determine the best way to solve a problem I am working on. I have a site were users can apply for services.

I have created a front-end link to the applications table which displays all applications. Which is a simple list view; however, this is not what I need. I need to test if the logged in user has a record in the applications table:
1. For "no” – I need to load the create a new record
2. For "yes" – I need to load the edit record

This way the logged in user never sees the list view and only interacts with their record.

I believe I can modify the entry point "view.html.php" file of the application collections-view and achieve the desired result; via a conditional redirect. However, I am not sure if it is the best way to approach the problem.

Any ideas or links to similar solutions would be greatly appreciated.

Thanks in advance
v
The administrator has disabled public write access.

Requesting your help, thanks. 09 Sep 2013 14:59 #11031

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 278
  • Thank you received: 35
  • Karma: 22
I have something similar ...

Add Joomla Access field in the Application Table in order manage ACL.
After that, when logged, the Joomla User could see only his own data in the Frontend ...

note this solution works if it is the Joomla User that has created records ... (from Front or Back)
Last Edit: 09 Sep 2013 15:47 by liubov.
The administrator has disabled public write access.
The following user(s) said Thank You: vlemos

Requesting your help, thanks. 10 Sep 2013 04:51 #11035

  • vlemos
  • vlemos's Avatar
  • Online
  • Elite Member
  • Posts: 295
  • Thank you received: 41
  • Karma: 21
Thanks liubov, yes this may work for some scenarios. However, mine is different. Basically I need to present the item-view in one of two ways: either as a new record if one does not exist for the logged in user or in edit mode if a record does exist for that user. If the list-view should be the entry point of the item-views; I believe that I would need to start coding in a list-view and then call the item-views depending on the results of my test. Thanks again V
The administrator has disabled public write access.

Requesting your help, thanks. 10 Sep 2013 10:43 #11042

  • cefnllys
  • cefnllys's Avatar
  • Offline
  • Premium Member
  • Posts: 102
  • Thank you received: 5
  • Karma: 1
I have done something similar to this before, basically what i did was on the item view is get user id using the joomla code for doing this, then check if user id not equal to "0" if it isn't equal to "0" then check the database for an entry with that users id and return the id of that object. then simply set the item views CID to that id and it will display the record but if no record exists for that user set the CID to "0" and it will create a new entry. hope this helps its only a rough explanation.
The administrator has disabled public write access.
The following user(s) said Thank You: vlemos

Requesting your help, thanks. 10 Sep 2013 14:06 #11046

  • vlemos
  • vlemos's Avatar
  • Online
  • Elite Member
  • Posts: 295
  • Thank you received: 41
  • Karma: 21
Hello cefnllys, thanks for your feedback. I know some of the logic needed to get the task done. What I don't know at the moment is the best placed to start coding this solution based on the j-cook framework. My front-end menu item calls the list-view but I need to add a test in the execution path and call one of two item-views. The test you described should work if coded correctly; however, it does not address where the best place to code the solution is.

My question is really: where is the best place to code this solution in the cook framework and should it be done using redirects?

Regards
v
The administrator has disabled public write access.

Requesting your help, thanks. 10 Sep 2013 17:46 #11052

  • vlemos
  • vlemos's Avatar
  • Online
  • Elite Member
  • Posts: 295
  • Thank you received: 41
  • Karma: 21
Here is a rough pic of what I am trying to achieve.

Edited:
Attachments not working for me. Sorry....

@Admin: Do you have a few minutes to advise on the best way forward for coding this type of solution? Thx V
Last Edit: 10 Sep 2013 21:19 by vlemos.
The administrator has disabled public write access.
Time to create page: 0.113 seconds

Get Started