University of Oregon

New activeCollab Module: Project Menu Object Count | activeCollab – Project Management and Collaboration Tool

I’ve created a new module: Project Menu Object Count.

I wanted to know how many items there were in each tab so I could get right to the goods. And I didn’t like clicking through the tabs, waiting to find out if there were any tickets, pages, files, etc…

So the Project Menu Object Count module was born.
It will update the visible menus tabs when in a project appending them with the number of items for that object type. For example, if you have 12 milestones in a project, that tab would read “Milestones (12)”. It leverages the API in hopes that it will continue to function in future releases.

Here are my tabs before:

Here is a screen shot of tabs with Project Menu Object Count installed:

Notes / Compatibility:
Tested with aC version 2.3.2 and the standard theme.

This module uses jQuery to identify the available projects for the current user by lopping through the visible tabs. The benefit of using jQuery is that it doesn’t slow down the page load time. The disadvantage is that it has been developed and tested in the default aC theme and may not work in other themes if they implement custom id’s for menu tabs. That being said, the script isn’t too strict. It simply looks for a dom block with the id: #tabs and the li’s contained with in. i.e. $(‘#tabs li’).each(…);
The id of those list items should also be standardized. The milestones tab, for example uses this html:


This script extracts the object type from that ID: “milestones” and passes that to the API to get a count of items.

Limitations: the current API (shipped with aC 2.3.2) does not return the number of pages. Two patches have been submitted to aC support that would fix the problem, and both are included with the module zip file.

javascript variables populated by the system:

Installation instructions:
In order to install the Project Menu Object Count module and run it successfully you need to follow the following instructions.
Step 1. Unzip the provided.

Step 2. Copy the public/assets/modules/projectmenuobjectcount folder to activecollab >> application >> modules in your site. We have placed it in the similar structure for your better understanding.

Step 3. Copy the public/assets/modules/projectmenuobjectcount folder to your publicassetsmodules folder

Step 4. Login in your system and you will find the new Module ready to be installed

Step 5. After installation, please go to main administration page and click on the Project Menu Object Count icon and enable it.

After installation you will see object count appended to your menu tabs.


The module structure is a simple as possible.
It contains the two requisite files: init.php and module.class.php on the application side. These don’t declare anything special just the bare-bones requirements.
The public side contains the module icons and one .js file: main.js.

Keep in mind that this was built to suit my specific use case and may not work for everyone.
Try it out, see what you think. I find it really valuable.

The initial release is version = “2.3.x-1.0”.
The initial release is version = “2.3.x-1.0”.
Cost: free.
Zip file:

Here’s the main.js code:

$(document).ready(function(){  /*run after jQuery loads*/
	var currentProjectID =;
	var currentHomepageUrl =;
	$('#tabs li').each(
			tab = ''; //set default
			tab = $(this).attr('id'); //get object name from tab id
			tabName = ''; //set default
			tabName = tab.replace('page_tab_',''); //extract name from id
			function popTabCount(tab, tabName){
					function(json) {
						if (json == null){
							//could show a 0 here.
							//jsonDataLength = "0";
						} else {
							if(typeof(json[0].type)!=="undefined" &amp;&amp; ([0].type.toLowerCase())!==-1) || (tabName == 'people')){
								jsonDataLength = json.length;
								$('#'+tab).find('a span').not(' .count').append(' <i>('+jsonDataLength+')</i>');
							} else {
								//could show a 0 here.
								//jsonDataLength = "0";
							} //end if typeof(json[0].type)!=="undefined" ...
						} //end if (json == null)
						//$('#'+tab).find('.count').text('('+jsonDataLength+')').show(); //moved up into if()
					} //end function json
				); //end getJSON()
			} //end function popTabCount()
			popTabCount(tab, tabName);
		} //end function
	); //end each
}); //end ready

Posted on aC here: New Module for your review: Project Menu Object Count | activeCollab – Project Management and Collaboration Tool.

Syntaxhighlighter with activeCollab documentation

I posted some documentation for a free aC module today: Syntaxhighlighter with AC.

I pulled it together from the forum posts.
Here’s the content of the file: (more…)

Adding a button for toggling nested items in activecollab

This is a follow up to Bookmarklets for expanding, collapsing items in activeCollab.

I hacked the activeCollab Checklist module last night. Specifically the ChecklistsController.class.php file, adding the links to toggle the nested items.

Here’s the new button:

Here it is expanded:

I briefly looked at creating a module to override the checklist controller module but wasn’t able to make any headway there so I created a patch: ChecklistsController.class.php_toggle_nested_items_5-5-11_v0.2.patch.

Bookmarklets for expanding, collapsing items in activeCollab

There’s a follow up post here: Adding a button for toggling nested items in activecollab.

I just put together a couple of bookmarklets that I thought I’d share.

They allow you to open/close/toggle nested menu items like checklists. (more…)