PDA

View Full Version : default to "All" companies in project view


polgard
24-06-05, 05:03 AM
I would like to have the default for project view to show projects from all companies, not the company of the user. I get round it at the moment by removing a company from users in their user profile. But this breaks the contacts/companies information I need.

Any hints on where I need to modify the code (I assume in projects/index.php

thanks

pedroa
24-06-05, 08:26 AM
Change on modules/projects/index.php line 33 from:

$company_id = $AppUI->getState( 'ProjIdxCompany' ) !== NULL ? $AppUI->getState( 'ProjIdxCompany' ) : $AppUI->user_company;

to

$company_id = $AppUI->getState( 'ProjIdxCompany' ) !== NULL ? $AppUI->getState( 'ProjIdxCompany' ) : 0;


and line 41 from:

$department = $AppUI->getState( 'ProjIdxDepartment' ) !== NULL ? $AppUI->getState( 'ProjIdxDepartment' ) : $company_prefix.$AppUI->user_company;

to

$department = $AppUI->getState( 'ProjIdxDepartment' ) !== NULL ? $AppUI->getState( 'ProjIdxDepartment' ) : 'company_0';


Off you go...

Pedro A.

polgard
24-06-05, 06:32 PM
thank you, that was exactly what I was looking for.

beach_defender
26-06-05, 06:07 PM
Hi,
I was looking at this and thought wouldn't it be cool if users could set this. For example in a service company some (Boss, Operations Mgr,etc) will always want to a 'whole of company' view initially, while individual project managers will only be interested in their own projects.

I am sure that my current customers would be interested in this, if so, I'll try to post a way to do it.

Cheers

(I wanted the default to 'All' as well so thanks heaps pedroa )

pedroa
27-06-05, 04:00 AM
It wouldn't be too hard to have another user preference for this.
Add a field, add a combo, store the setting, retrieve the setting, make it work accordingly...

Pedro A.