[Vtigercrm-developers] vtlib, setRelatedModules() associative array does not create a related list.

Martin Allen martin.allen at clystnet.com
Mon Oct 29 16:52:14 GMT 2018


If you look at the code in vtlib, it defaults the related list function to
get_dependents_list, and inserts the field id of the related field that we
just related to this module.
Which is perfect, its only if you want it do something custom that we need
to change the function in which case we would manually create the list
function.

It also *attempts *to get the actions (Add & Select) using the call to
Vtiger_Module_Model::getRelationshipActions() which *should* return
Array('ADD','SELECT') (presumably the idea being that if further actions
are ever added they would get returned too!) - however this call never
works. I think its becuase this function is located in
/modules/Vtiger/models/Module.php which the first line of which does
vimport('~/vtlib/Vtiger/Module.php') which I think upsets it when we've
already included it??

Martin Allen

*>>Call me now for free<< <https://emailrtc.voiceflex.com/?c=7b355216c4>*


*01392 248692 - Main Office01392 690659 - Direct Line*

*[image: signature2]*

Have you visited our website recently? http://www.clystnet.com


The information in this email is confidential If you are not the intended
recipient, you must not read or use that information. This email and any
attachments are believed to be virus free however no responsibility is
accepted by Clystnet for any loss or damage arising in any way from receipt
or use thereof. Clystnet Ltd (company reg number 7164503) is based at
Silverdown Park, Fair Oak Close, Clyst Honiton, EX5 2UX


On Mon, 29 Oct 2018 at 16:33, <
vtigercrm-developers-request at lists.vtigercrm.com> wrote:

> Send vtigercrm-developers mailing list submissions to
>         vtigercrm-developers at lists.vtigercrm.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
>
> http://lists.vtigercrm.com/cgi-bin/mailman/listinfo/vtigercrm-developers
>
> or, via email, send a message with subject or body 'help' to
>         vtigercrm-developers-request at lists.vtigercrm.com
>
> You can reach the person managing the list at
>         vtigercrm-developers-owner at lists.vtigercrm.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of vtigercrm-developers digest..."
>
>
> Today's Topics:
>
>    1. Re: vtiger 7.0 calendar access issue (IT-Solutions4You)
>    2. vtlib, setRelatedModules() associative array does not create
>       a related list. (Martin Allen)
>    3. Re: vtlib, setRelatedModules() associative array does not
>       create a related list. (Alan Lord)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 29 Oct 2018 13:38:24 +0100
> From: IT-Solutions4You <info at its4you.sk>
> To: vtigercrm-developers at lists.vtigercrm.com
> Subject: Re: [Vtigercrm-developers] vtiger 7.0 calendar access issue
> Message-ID: <pr6urt$gnj$1 at blaine.gmane.org>
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> If I remember my right sharing rules don't work with Calendar (Task,
> Events) module. Calendar module has own "Calendar Sharing" setting. Each
> user can define own sharing criteria.
> But you can also set
> View All  - Can view all the modules information
> Edit All  - Can edit all the modules information
> in profile setting of Vice profile.
>
> Matus.
>
>
>
>
> D?a 29. 10. 2018 o 10:02 lucia digirolamo nap?sal(a):
> > Hi,
> >
> > in my vtiger I have the admin with role = CEO and a subrole called vice
> > which is not an admin, then I have a third role which is a subordinate
> > of vice. The vice role should have all the permission of the admin
> > except the delete, so the vice must be able to view/create/edit
> > everything, while the third role can view all the record but be able to
> > edit only the ones they created. To do that I created a sharing rule and
> > it works. The only problem is with the calendar. The calendar must
> > follow the sames rules so: vice can be able to view and edit all records
> > while third role can view all but can edit only the entries they've
> > created. The third role works as expected but the vice is not. At the
> > moment for calendar entries, the vice can view all the records but they
> > can modify only the record they've created. I need them to be able to
> > edit all the records.
> >
> > I've set all the entries to Public but this doesn't solve the issue.
> >
> > I've also tried to invite the other users just as a test but it doesnt
> > work either: the invited vice still cannot edit the record.
> >
> > Is there a way to set the calendar in a way that the vice role can view
> > and edit all the records?
> >
> >
> > _______________________________________________
> > http://www.vtiger.com/
> >
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Mon, 29 Oct 2018 16:04:46 +0000
> From: Martin Allen <martin.allen at clystnet.com>
> To: vtigercrm-developers at lists.vtigercrm.com
> Subject: [Vtigercrm-developers] vtlib, setRelatedModules() associative
>         array does not create a related list.
> Message-ID:
>         <CAL1vgxEUVvDC63CA9zm9JPBN53v=
> DMX223FcLiX_Fy4+w59zzA at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> When creating a field using vtlib it is possible to pass an associative
> array to setRelatedModules() function which SHOULD create a related list in
> the related module.
>
> However it never correctly creates the list, as it can't call the function
> Vtiger_Module_Model::getRelationshipActions() .
>
> e.g. $field1->setRelatedModules(Array('Contacts'=>'Accounts')) should
> create a related list in Contacts module labelled 'Accounts', relating to
> the module that the field was in.
>
> Are we missing a include/require?? (Only including vtlib/Vtiger/Module.php
> and Field.php and Block.php)
>
> We tried including /modules/Vtiger/models/Module.php but still can't get it
> working??
>
> Any ideas, as the ability to add a related field and its equivalent related
> list in one call would be a great time saver!!
>
> Martin Allen
>
> *>>Call me now for free<< <https://emailrtc.voiceflex.com/?c=7b355216c4>*
>
>
> *01392 248692 - Main Office01392 690659 - Direct Line*
>
> *[image: signature2]*
>
> Have you visited our website recently? http://www.clystnet.com
>
>
> The information in this email is confidential If you are not the intended
> recipient, you must not read or use that information. This email and any
> attachments are believed to be virus free however no responsibility is
> accepted by Clystnet for any loss or damage arising in any way from receipt
> or use thereof. Clystnet Ltd (company reg number 7164503) is based at
> Silverdown Park, Fair Oak Close, Clyst Honiton, EX5 2UX
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20181029/77c65185/attachment-0001.html
> >
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: image001.png
> Type: image/png
> Size: 10550 bytes
> Desc: not available
> URL: <
> http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20181029/77c65185/attachment-0001.png
> >
>
> ------------------------------
>
> Message: 3
> Date: Mon, 29 Oct 2018 16:31:48 +0000
> From: Alan Lord <alanslists at gmail.com>
> To: vtigercrm-developers at lists.vtigercrm.com
> Subject: Re: [Vtigercrm-developers] vtlib, setRelatedModules()
>         associative array does not create a related list.
> Message-ID: <pr7chh$rqa$1 at blaine.gmane.org>
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> Err, but you also need to specify which function to call to generate the
> related list of data and also what features are available from the
> related List, e.g. "ADD, SELECT"...
>
> Can't see how that would work some how, unless I am missing the point.
>
> Al
>
> On 29/10/2018 16:04, Martin Allen wrote:
> > When creating a field using vtlib it is possible to pass an associative
> > array to setRelatedModules() function which SHOULD create a related list
> > in the related module.
> >
> > However it never correctly creates the list, as it can't call the
> > function Vtiger_Module_Model::getRelationshipActions() .
> >
> > e.g. $field1->setRelatedModules(Array('Contacts'=>'Accounts')) should
> > create a related list in Contacts module labelled 'Accounts', relating
> > to the module that the field was in.
> >
> > Are we missing a include/require?? (Only including
> > vtlib/Vtiger/Module.php and Field.php and Block.php)
> >
> > We tried including /modules/Vtiger/models/Module.php but still can't get
> > it working??
> >
> > Any ideas, as the ability to add a related field and its equivalent
> > related list in one call would be a great time saver!!
> >
> > Martin Allen
> >
> > *>>Call me now for free<< <https://emailrtc.voiceflex.com/?c=7b355216c4
> >*
> >
> > *01392 248692 - Main Office
> > 01392 690659 - Direct Line*
> >
> > *signature2*
> >
> > Have you visited our website recently? http://www.clystnet.com
> > <http://www.clystnet.com/>
> >
> >
> > The information in this email is confidential If you are not the
> > intended recipient, you must not read or use that information. This
> > email and any attachments are believed to be virus free however no
> > responsibility is accepted by Clystnet for any loss or damage arising in
> > any way from receipt or use thereof. Clystnet Ltd (company reg number
> > 7164503) is based at Silverdown Park, Fair Oak Close, Clyst Honiton, EX5
> 2UX
> >
> >
> > _______________________________________________
> > http://www.vtiger.com/
> >
>
>
>
>
> ------------------------------
>
> _______________________________________________
> vtigercrm-developers mailing list
> vtigercrm-developers at lists.vtigercrm.com
> http://lists.vtigercrm.com/cgi-bin/mailman/listinfo/vtigercrm-developers
>
>
> End of vtigercrm-developers Digest, Vol 153, Issue 25
> *****************************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20181029/54a3ff8f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 10550 bytes
Desc: not available
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20181029/54a3ff8f/attachment-0001.png>


More information about the vtigercrm-developers mailing list