Hi,
I changed the view of "Manage Departments" in the Admin CP.
This is because I have different departments for different templates.
See the following screenshot to get an impression of it.
Follow the following steps to implement this modification.
Open:
Code:
\modules\core\admin_departments.php
Find:
Code:
$fields[0]["name"] = "title";
$fields[0]["title"] = $_SWIFT["language"]["deptitle"];
$fields[0]["width"] = "";
$fields[1]["name"] = "departmenttype";
$fields[1]["title"] = $_SWIFT["language"]["deptype"];
$fields[1]["width"] = "100";
$fields[1]["align"] = "center";
$fields[2]["name"] = "departmentmodule";
$fields[2]["title"] = $_SWIFT["language"]["depmodule"];
$fields[2]["width"] = "120";
$fields[2]["align"] = "center";
$fields[3]["type"] = "custom";
$fields[3]["name"] = "options";
$fields[3]["title"] = $_SWIFT["language"]["options"];
$fields[3]["width"] = "150";
$fields[3]["align"] = "center";
Replace this by:
Code:
$fields[0]["name"] = "title";
$fields[0]["title"] = $_SWIFT["language"]["deptitle"];
$fields[0]["width"] = "";
$fields[1]["name"] = "TemplateName";
$fields[1]["title"] = $_SWIFT["language"]["templategroups"];
$fields[1]["width"] = "130";
$fields[1]["align"] = "center";
$fields[2]["name"] = "displayorder";
$fields[2]["title"] = $_SWIFT["language"]["displayorder"];
$fields[2]["width"] = "120";
$fields[2]["align"] = "center";
$fields[3]["name"] = "departmenttype";
$fields[3]["title"] = $_SWIFT["language"]["deptype"];
$fields[3]["width"] = "100";
$fields[3]["align"] = "center";
$fields[4]["name"] = "departmentmodule";
$fields[4]["title"] = $_SWIFT["language"]["depmodule"];
$fields[4]["width"] = "120";
$fields[4]["align"] = "center";
$fields[5]["type"] = "custom";
$fields[5]["name"] = "options";
$fields[5]["title"] = $_SWIFT["language"]["options"];
$fields[5]["width"] = "150";
$fields[5]["align"] = "center";
Find:
Code:
$grid->start("departments", $_SWIFT["language"]["departmentlist"], 'SELECT * FROM `'. TABLE_PREFIX .'departments` $_sortjoin;', 'SELECT COUNT(*) AS totalitems FROM `'. TABLE_PREFIX .'departments`;', 'SELECT * FROM `'. TABLE_PREFIX .'departments` WHERE `title` LIKE \'%$_searchstr%\' $_sortjoin;', $fields, $options); Replace this line by:
Code:
$grid->start("departments", $_SWIFT["language"]["departmentlist"], 'SELECT *, (SELECT title FROM '. TABLE_PREFIX .'tgroupassigns INNER JOIN '. TABLE_PREFIX .'templategroups ON '. TABLE_PREFIX .'tgroupassigns.tgroupid = '. TABLE_PREFIX .'templategroups.tgroupid WHERE '. TABLE_PREFIX .'tgroupassigns.toassignid = '. TABLE_PREFIX .'departments.departmentid AND '. TABLE_PREFIX .'tgroupassigns.type = 1 LIMIT 1) as TemplateName FROM '. TABLE_PREFIX .'departments $_sortjoin;', 'SELECT COUNT(*) AS totalitems FROM `'. TABLE_PREFIX .'departments`;', 'SELECT * FROM `'. TABLE_PREFIX .'departments` WHERE `title` LIKE \'%$_searchstr%\' $_sortjoin;', $fields, $options); Save and close the file. Enjoy!