Active Collab Logo

Creating a new page in ActiveCollab 3

Active Collab Logo

Just created a new page in ActiveCollab 3. I wanted a new ipn (Instant Payment Notifications) handler page for paypal recurring payments. The name of my new module is PaypalRecurring.

Here are the simple steps to created a new view page in AC3.

I wanted to create URL:

In the PaypalRecurringModule.class.php add a new route in defineRoutes() function like the following:

function defineRoutes() {
Router::map('paypal_recurring_capture', 'ppr/capture', array('controller' => 'paypal_recurring', 'action' => 'ipn_capture'));

In short it means that i will be creating a new action named ipn_capture in my paypal_recurring/controllers/PaypalRecurringController.class.php file and the name/identifier of this map is paypal_recurring_capture. In turn, it can be invoked by passing the in the browser address bar. As taken from an example at AC3 documentation website i will include a function to fetch all projects by an user, just to show how functionality can be added to the controller and be displayed in the subsequent view files.

// Build on top of payments module
AngieApplication::useController('payments', PAYMENTS_FRAMEWORK_INJECT_INTO);

* Paypal Recurring controller implementation
class PaypalRecurringController extends PaymentsController{

* Capture action
function ipn_capture() {
//do something here.. php variables for smarty view files can be set here.
'projects' => Projects::findActiveByUser($this->logged_user)

In the ipn_capture function of the PaypalRecurringController more functionality can be added. PHP variables for smarty view files can be set here as shown in the example above.

{title}My Projects{/title}
{add_bread_crumb}My Projects{/add_bread_crumb}

{if $projects}
<table class="common" cellspacing="0">
<th>{lang}Cost so Far{/lang}</th>
{foreach $projects as $project}
<td>{project_link project=$project}</td>
<td>{user_link user=$project->getLeader()}</td>
<p class="empty_page">{lang}No projects loaded{/lang}</p>

Finally this page’s result can be viewed at in browser

Leave a Reply

Your email address will not be published. Required fields are marked *