Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
88 lines (76 sloc) 4.5 KB
<?php
/**
* Route Class
*
* @author rutoru
* @package Runa-CCA
*/
namespace Runa_CCA;
class Route{
/**
* registration
*
* @param \Slim\Slim Object
*/
static function registration($app){
// Login
$app->get('/', function(){\Runa_CCA\Controller\Login::start();});
$app->map('/login', function(){\Runa_CCA\Controller\Login::login();})->via('GET', 'POST');
$app->get('/logout', function(){\Runa_CCA\Controller\Login::logout();});
// Configuration
$app->map ('/conf', function(){\Runa_CCA\Controller\Configuration::portal();})->via('GET', 'POST');
$app->map ('/conf/oplist', function(){\Runa_CCA\Controller\OpConfiguration::portal("LISTOPERATOR");})->via('GET', 'POST');
$app->map ('/conf/opnew', function(){\Runa_CCA\Controller\OpConfiguration::portal("NEWOPERATOR");})->via('GET', 'POST');
$app->post('/conf/opadd', function(){\Runa_CCA\Controller\OpConfiguration::portal("MNGOPERATOR");});
$app->post('/conf/opmod', function(){\Runa_CCA\Controller\OpConfiguration::portal("MODOPERATOR");});
$app->post('/conf/passchg', function(){\Runa_CCA\Controller\Login::password("CHANGEPASSWORD");});
$app->get ('/self/passchgdisp',function(){\Runa_CCA\Controller\Login::changePasswordSelf();});
$app->map ('/conf/queuelist', function(){\Runa_CCA\Controller\QueueConfiguration::portal("LISTQUEUE");})->via('GET', 'POST');
$app->map ('/conf/queuenew', function(){\Runa_CCA\Controller\QueueConfiguration::portal("NEWQUEUE");})->via('GET', 'POST');
$app->post('/conf/queueadd', function(){\Runa_CCA\Controller\QueueConfiguration::portal("MNGQUEUE");});
$app->post('/conf/queuemod', function(){\Runa_CCA\Controller\QueueConfiguration::portal("MODQUEUE");});
// Reporting
// Wallboard
$app->map ('/report/wallboard',function(){\Runa_CCA\Controller\Report::portal("WALLBOARD");})->via('GET', 'POST');
// Softphone
$app->map ('/softphone', function(){\Runa_CCA\Controller\Softphone::portal();})->via('GET', 'POST');
// Small CRM
$app->map ('/customer/customerlist', function(){\Runa_CCA\Controller\Customer::portal("LISTCUSTOMER");})->via('GET', 'POST');
$app->map ('/customer/customernew', function(){\Runa_CCA\Controller\Customer::portal("NEWCUSTOMER");})->via('GET', 'POST');
$app->post('/customer/customeradd', function(){\Runa_CCA\Controller\Customer::portal("MNGCUSTOMER");});
$app->post('/customer/customermod', function(){\Runa_CCA\Controller\Customer::portal("MODCUSTOMER");});
$app->post('/customer/customersearch',function(){\Runa_CCA\Controller\Customer::portal("SEARCHCUSTOMER");});
// Twilio
// TwiML for Operators(Client Application)
$app->post('/twilio/operator', '\Runa_CCA\Controller\TwiMLApp:createTwiMLApp');
// CallFlow
// "NewService"
$app->map ('/twilio/callflow/newservice/main',
function () {
\Runa_CCA\Controller\CallFlow\NewService::start("main");
})->via('GET', 'POST');
$app->map ('/twilio/callflow/newservice/wait',
function () {
\Runa_CCA\Controller\CallFlow\NewService::start("wait");
})->via('GET', 'POST');
$app->map ('/twilio/callflow/newservice/info',
function () {
\Runa_CCA\Controller\CallFlow\NewService::start("info");
})->via('GET', 'POST');
$app->map ('/twilio/callflow/newservice/enqueaction',
function () {
\Runa_CCA\Controller\CallFlow\NewService::start("enqueaction");
})->via('GET', 'POST');
$app->map ('/twilio/callflow/newservice/guidance',
function () {
\Runa_CCA\Controller\CallFlow\NewService::start("guidance");
})->via('GET', 'POST');
$app->map ('/twilio/callflow/newservice/statuscallback',
function () {
\Runa_CCA\Controller\CallFlow\NewService::start("statuscallback");
})->via('GET', 'POST');
// Error
$app->notFound(function(){\Runa_CCA\Controller\Error::display("NOTFOUND");});
$app->error(function(){\Runa_CCA\Controller\Error::display("ERROR");});
}
}