Jump to content


Add Edit Link to View Form

edit view

  • Please log in to reply
4 replies to this topic

#1 rjsig

rjsig

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 01 May 2012 - 07:56 PM

Hello everyone,

I've made a few changes to the gc library and created a "view" js and "view" view such that a logged in user who is not an administrator can view more info in the view form than is practical to display in the list (mobile app), but not change it. This is working fine.

Logged in users may "Add" Venues to assist in populating desirable local Venues, and should be given default permissions to change the particular Venues they have entered.

First thing I'm not sure how to do with gc - how to automatically add the currently logged-in user to a many-to-many "users-venues" table at the successful completion of adding a new Venue in the "venue" table. Would love help on this as I have several other situations to do essentially the same thing.

Second thing I'm not sure how to do with gc - I would like a currently logged-in user to see both a "view icon" which I have working, and additionally an "edit icon" in the Venue List for only those Venues that user has authorization to edit. The authorization would be in the many-to-many table "users-venues" table mentioned earlier which contains the following logical fields:

Third thing I'm not sure how to do with gc - If a currently logged-in user chooses to "View" a Venue rather than "Edit" one they are authorized to edit, I would like to show an "Edit Button" on the "View" form so that, once viewing, they could edit if they choose to without first returning to the table and choosing the edit icon. I almost have this bit working, but am stuck rather stupidly on calling the "Edit Form" from the "View Form" with the proper state in place, or the proper user id in place, or such that it will actually save the edited record once displayed. I've had it in several conditions so far but am no longer making progress - thus this request.

I am more than impressed with gc and what I have read as responses in the forum and look for to learning from your replies.

Thanks - Randy

#2 HumbleMonk

HumbleMonk

    Member

  • Members
  • PipPip
  • 25 posts

Posted 01 May 2012 - 10:48 PM

For your first problem use this callback: http://www.grocerycr...ck_after_insert

#3 rjsig

rjsig

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 04 May 2012 - 11:48 AM

Thank you HM. Looks like I can use that code to accomplish my first purpose. Will try today. I had clicked to receive email on responses but didn't get one so came and looked and here it was.

Now could some of my brother/sister coders please help on the other two needs? I'm stuck going in circles.

-- Randy

#4 simonfrank

simonfrank

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 04 May 2012 - 02:45 PM

For no. 2 would the column call back work for this? http://www.grocerycr...allback_column. Failing that you could modify the theme.

For no.3 it would be great to have an add action function which adds to the bottom of the form, as I need something for that. If I manage to hack something up I'll post it.


#5 InnaAbu46

InnaAbu46

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 21 May 2012 - 02:28 PM

"Исрамед-портал" - некоммерческая организация финансируемая
частным благотворительным фондом.

info@isramed-portal.com
Все консультации и услуги бесплатны.





Also tagged with one or more of these keywords: edit, view

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users