PDA

View Full Version : Changing Companies Tabs


baf
10-09-04, 01:20 PM
I searched the forums here, and looked in the modules/companies directory but could not find out how to change the main tabs in the companies module.
I'd like to change them from the standard ("Not Applicable Client Vendor Supplier Consultant....") to something else.

Anyone know?

Karen
10-09-04, 01:46 PM
System Admin > System Lookup Values should allow you to change the text.

baf
10-09-04, 03:08 PM
Gosh... that was easier than looking in .php's!
Thanks!

caseydk
10-09-04, 10:29 PM
The project types and a few other things can be changed just as easily...

dfree
05-10-04, 02:46 PM
After I'd entered two dozen companies under "internal companies," I went into the System Lookup Values and changed that tab to "affiliates," then deleted all the other company types. Now all those companies are visible only under the "all companies" but not under the "affiliates" even those the company type shown for each of them indicates that they're still under "affiliates." Any thing I can do to have them appear under the "affiliates" tab?

Thanks, Karen, I really appreciate all that you and everyone does. It's such a great program.

caseydk
05-10-04, 10:34 PM
Check your database backend and make sure that they are truly classified as affiliates.

dfree
05-10-04, 11:51 PM
Casey, I'm a real newbie to php and mysql -- but want to learn it. Could you point me in the direction of how I would check the database backend? I would really appreciate it.

caseydk
06-10-04, 03:28 AM
You could query it directly via phpMyAdmin or on the command line.

What did you use to create the database?

dfree
15-10-04, 12:31 PM
Casey, I used Fantastico to create it. I've since looked at phyMyAdmin and found a tutorial that gets me a little closer. What would my query be check to see if the company types for each company is really "affiliate"?

caseydk
15-10-04, 10:43 PM
Use:

SELECT company_id, company_name, company_type FROM companies

and then compare the value of company_type with the value from your System Admin > System Lookup Values.

majic_user
16-10-04, 12:11 AM
When you rearrange the tabs using sys values you are simply changing the UI. The functionality is that if you click on the first tab, you look for all companies with a company type of 0. If the first tab is labled with a company type that has an id of 2, you will not see the right list.

To demonstrate:
Add a few companies using a few types.
Edit the sysvals for company type and move the first type to the last position.
When you go back to companies, click on the first tab. Regardless of what it says in the tab label will get the same list of companies you had before.

I will look at the code in 1.0.2 and see what is causing this.

Horace
16-10-04, 01:43 AM
The little I know....

The company type for existing entries is not updated when you change sysvals. Also I remember seeing company types hard coded in to querys.
eg. where companytype == 1
I've found you can add, relabel and reshuffle conpany types as long as you dont change the ID for an existing company type.

Using the tab number as an ID is (IMHO) an easy wasy to track where you are. I've got an addedit routine that has three branches depending on the tab number. However if a user 'reshuffles' the tab order the routine will break. A trade-off at best.

I'm gonna wait for 2.0 and see if the devs have changed how tabs are handled, thought I saw something here on the forum about dynamically adding tabs, that may provide a fix for the above at the same time.

majic_user
16-10-04, 05:46 AM
I agree with Horace, however the other issue is that the tabs change order, but do not show the correct companies for that type. In the code the tabs are created using an array of filename, name pairs. The tab index that is used in the query to get the companies is the key of that array which is an integer starting at 0. So the index of the tab is used as the value of the company type id when getting the list of companies to display.

The company type needs to be passed to the query somehow.