Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Show only related objects


Go to End
Reply


11 Posts   2071 Views

Avatar
klikhier

Community Member, 150 Posts

26 June 2009 at 1:18am

I have this many_many mentor-student relationship and I'm using the DataObjectManager module (ManyManyDataObjectManager) on the MentorPage to show related students.

Now it's possible to show only the related (checked) students by using the filter clause in the ManyManyDOM, BUT is it also possible to hide the checkboxes completely, so that one can view/edit the students, but CAN NOT remove the relationship (uncheck the checkbox)?

Avatar
UncleCheese

Forum Moderator, 4094 Posts

26 June 2009 at 2:16am

So no one can uncheck these boxes? Seems kind of limiting. I could definitely see adding a checkpoint for permissions that would disable/enable the checkboxes, but I don't think unconditionally turning them off is a good idea.

Avatar
klikhier

Community Member, 150 Posts

26 June 2009 at 3:23am

What I'm looking for is the following: suppose there are 10.000 students and they are assigned to the mentors outside the CMS (using front-end form) or through ModelAdmin. Would be nice though to only show the assigned students (say 10 or so) on the mentor page in the CMS and not all 10.000. This can be done easily by using the filter clause (show related students only), but then there are still check boxes, which is a bit weird and users could accidentally remove the relation by unchecking the checkbox and saving the mentorpage.

Sorry for the strange example, but I hope I explained the situation with it.

Avatar
UncleCheese

Forum Moderator, 4094 Posts

26 June 2009 at 3:41am

Understood, but somebody needs the privileges to remove that relation, right? So I think it would make sense to assign a permission level to the checkboxes rather than just remove them all together. A top-level admin should have the power to remove the relations if he wants.

Avatar
klikhier

Community Member, 150 Posts

26 June 2009 at 3:43am

Ah, yes, agreed!

Avatar
klikhier

Community Member, 150 Posts

26 June 2009 at 7:07am

UncleCheese, one more thing. It turns out that the filter clause is not that simple. I want to show only related students on a mentor page. I'm using this on 'MentorPage':

      $manager = new ManyManyDataObjectManager(
         $this, // Controller
         'Students', // Source name
         'Student', // Source class
         array(
            'Name' => 'Name'
         ), // Headings
         'getCMSFields_forPopup',
         '', // Filter clause
         '', // Sort clause
         '' // Join clause
      );

What filter clause do I need to show only assigned(related) students? Do I need a join with MentorPage_Students? I'm sorry but my knowledge is scarce on this point. Would be very (very!) nice if you could help, sorry for inconvenience, if any ;)

Avatar
UncleCheese

Forum Moderator, 4094 Posts

26 June 2009 at 7:40am

I don't believe that type of filter is possible at this point. I did, however, just check in the feature for adding marking permissions. You might want to give that a test.

Avatar
klikhier

Community Member, 150 Posts

26 June 2009 at 9:31am

Ok, thanks!!! Would there be another way to show only related Students on a MentorPage (i.e. by using something else than DOM?)

Go to Top