View Full Version : Tasks contacts - limit to assigned company?
I was wondering about the following scenario:
I create a project for a chosen client in dotProject (e.g. Client A). Under Client A I have Contacts A1, A2, A3 in my contact list in dotProject.
I want to know if it is possible when I create a task under the project for my Client A, that I can see only the contacts of Client A for this task instead of heaving always the list of all contacts for all my clients.
After all this project is only for Client A, so I won't choose contact of Client B or C, for a task under the project for Client A.
Hope its clear what I mean :-) and anybody can help out, I think should be an easy change somewhere in the code?
Thanks a lot,
Anybody? I believen it shouldn't be a big step to do these changes.
Hope somebody can at least point into the right direction.
thanks a lot in advance
cyberhorse
16-10-10, 09:26 AM
Try this:
edit modules/tasks/ae_desc.php:55(ish)
change
. '" onclick="javascript:popContacts();" />');
to
. '" onclick="javascript:popContacts('.$company_id.');" />');
and addedit.js:62
function popContacts() {
window.open('./index.php?m=public&a=contact_selector&dialog=1&call_back=setContacts&selected_contacts_id='+selected_contacts_id, 'contacts','height=600,width=400,resizable,scrollb ars=yes');
}
to
function popContacts(company_id) {
window.open('./index.php?m=public&a=contact_selector&dialog=1&call_back=setContacts&company_id='+company_id+'&selected_contacts_id='+selected_contacts_id, 'contacts','height=600,width=400,resizable,scrollb ars=yes');
}
Try this:
edit modules/tasks/ae_desc.php:55(ish)
change
. '" onclick="javascript:popContacts();" />');
to
. '" onclick="javascript:popContacts('.$company_id.');" />');
and addedit.js:62
function popContacts() {
window.open('./index.php?m=public&a=contact_selector&dialog=1&call_back=setContacts&selected_contacts_id='+selected_contacts_id, 'contacts','height=600,width=400,resizable,scrollb ars=yes');
}
to
function popContacts(company_id) {
window.open('./index.php?m=public&a=contact_selector&dialog=1&call_back=setContacts&company_id='+company_id+'&selected_contacts_id='+selected_contacts_id, 'contacts','height=600,width=400,resizable,scrollb ars=yes');
}
Changes in ae_desc.php result in that there is no more pop-up window. I click the window and nothing happens. Once deleting " '.$company_id.' " from the brackets, it works fine again. But since there is no company_id then passed to the function popContacts, so of course this part will not work either then.
Any other ideas?
Thanks a lot for your help.
cyberhorse
18-10-10, 07:46 PM
Try putting
global $company_id;
somewhere before and also maybe
global $company_id;
in the addedit.php file.
Check if $company_id exists in different places.
thanks for the help, but still so far no success.
Once I do this change
. '" onclick="javascript:popContacts('.$company_id.');" />');
the popup just doesn't work, even when global $company_id put everywhere.
Any idea?
cyberhorse
19-10-10, 08:41 PM
echo $company_id to make sure you it actually has something. If it doesn't you can copy some logic from somewhere to load it (based on the project_id or something)
In the Project Module where the Company/ Division drop-down list is located, how do I only echo to that viewer page the company_id 1, not all of the companies or the global word "all"? I only just want the company_id 1 to display in this Project module for the said user or viewer who has permission to see the project or projects of the company_id 1.
I have learn a lot with the help of the username cyberhorse. All the information that he has bestowed onto me has been very accurate.
Now to answer your question. dotProject is set up to first recognize companies. Within the primary company, you can assign any one to view all or certain aspect of the company or the project or projects that the primary company wants you to view as a user.
If you need further explaination or an example, you can email me at sunflowertbgm@hotmail.com
I can send you to my dotproject url that outlines the answer to your question if you do not understand what I wrote above.
Everything that you want to implement is done in the Admin User section. Where you can assign user a, user b, and so on to the project and task that you want assign users to view.
vBulletin® v3.6.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.