Adding CompanyDirectory company status to the Companies tab in the admin panel
Posted: Sun Oct 11, 2009 6:07 am
I'm using CompanyDirectory on one of my sites, and there are a number of active companies listed, as well as a number that are either "Disabled" or "Draft". I wanted to be able to see the status of each company without having to click on the company to view its details. Here is how I did it (the code below works as of CompanyDirectory 1.4):
DISCLAIMER: EDITS TO THE SOURCE CODE MAKE YOUR SITE UNSUPPORTABLE. PROCEED AT YOUR OWN RISK. THE MODIFICATIONS PRESENTED BELOW ARE WORKING FINE FOR ME, BUT I MAKE NO CLAIM THAT THEY WILL WORK FOR YOU.
Open function.admin_companiestab.php. Insert the following code:
Open templates\companylist.tpl. Insert the following code:
With these edits in place, a new column "Status" is added to the Companies tab in the Admin panel, and the status of each company is listed.
I hope this is useful to someone!
DISCLAIMER: EDITS TO THE SOURCE CODE MAKE YOUR SITE UNSUPPORTABLE. PROCEED AT YOUR OWN RISK. THE MODIFICATIONS PRESENTED BELOW ARE WORKING FINE FOR ME, BUT I MAKE NO CLAIM THAT THEY WILL WORK FOR YOU.
Open function.admin_companiestab.php. Insert the following code:
Code: Select all
after line 39: $onerow->status = $row['status'];
after line 63: $smarty->assign('statustext', $this->Lang('status'));
Code: Select all
after line 28: <th>{$statustext}</th>
after line 40: <td>{$entry->status}</td>
I hope this is useful to someone!