Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

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

  • vlemos
  • vlemos's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • Posts: 295
  • Thank you received: 41
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

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

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

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 36
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)
The following user(s) said Thank You: vlemos

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

Last edit: by liubov.

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

  • vlemos
  • vlemos's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • Posts: 295
  • Thank you received: 41
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

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

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

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 following user(s) said Thank You: vlemos

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

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

  • vlemos
  • vlemos's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • Posts: 295
  • Thank you received: 41
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

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

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

  • vlemos
  • vlemos's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • Posts: 295
  • Thank you received: 41
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

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

Last edit: by vlemos.
  • Page:
  • 1
Time to create page: 0.063 seconds

Awards for the best Joomla app. This product is gonna win an award for this amazing job. Cook Self Service is the the best application from all over the Joomla universe ! It brings Joomla to a professional level really advanced for developers. It is a real fun to develop with it. The ACL part and security checks implementation are just... so much hours saved. I can now concentrate myself more on the design part and the creative works. Thank you so much. Guys I offer you all my congratulation ! Keep up the works because Joomla is needing it to increase the quality of extensions availables on the JED. I also learned a lot because I can see how to code at the proper place and I found all my answers reading the forum.
lack_hanson (JED)
          

Get Started