This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($this->Filter->hasConditions($this->Program)) { | |
$this->params['url'] = array( | |
'filter_operator' => 'all', | |
'filter_param' => array( | |
1 => array( | |
1 => 'status', | |
2 => 'is', | |
3 => 'running' | |
) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// in the validation rule | |
.... | |
'content' => array( | |
'requiredConditional' => array( | |
'rule' => array('requiredConditionalFieldOrValue', 'type-interaction', 'announcement', 'question-answer', 'question-answer-keyword'), | |
'message' => 'The interaction required a content.', | |
), | |
'notempty' => array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//The issue is this function is not easy to test our new behavior we need to refactor it to make it easy to test | |
protected function _getProgramStats($database) | |
{ | |
$programStats = array( | |
'active-participant-count' => 'N/A', | |
'participant-count' => 'N/A', | |
'all-received-messages-count'=> 'N/A', | |
'current-month-received-messages-count' => 'N/A', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generateHtmlProgramStats(programStats) { | |
var myTemplate = '<div>'+ | |
'<span ' + ( (programStats!=null) ? 'title="Optin/Totalparticipant(s)"' : 'Stats Not Available') +'class = stat>'+ | |
'ActiveParticipant/TotalParticipantStats'+ | |
'</span> participant(s)'+ | |
'</div>'+ | |
'<div>'+ | |
'<span title = Total(totalcurrentmonth)message(s) class = stat>'+ | |
'Totalhistory(Totalcurrentmonthmessages)'+ | |
'</span> total message(s)'+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::uses('Component', 'Controller'); | |
class CreditManagerComponent extends Component{ | |
public $Controller = null; | |
public $redis = null; | |
public $redisProgramPrefix = null; | |
public function initialize(Controller $controller) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//in ProgramsController | |
... | |
function constructClasses() | |
{ | |
parent::constructClasses(); | |
$this->_instanciateVumiRabbitMQ(); | |
$this->_instanciateMongoModel("vusion"); //this is hard coded at the moment also so no worry about that | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function formatKeywordValidation(value, element, param) { | |
var errors = {}; | |
if (isDialogueView()) { | |
var keywordRegex = new RegExp('^[a-zA-Z0-9]+(,(\\s)?[a-zA-Z0-9]+)*$','i'); | |
} else { | |
var keywordRegex = new RegExp('^[a-zA-Z0-9\\s]+(,(\\s)?[a-zA-Z0-9\\s]+)*$','i'); | |
} | |
if (keywordRegex.test(value)) { | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Looking for a workaround to install ve for vumi without the problematique riak-pb | |
## puppet/manifest/vusion.pp (part only) | |
.... | |
file { "/var/vusion/backend/requirements.py": | |
ensure => present, | |
source => "puppet:///config/requirements.pip", | |
require => [User['supervisordUser'], | |
Exec['checkout-vusion']], | |
before => Exec['install-virtualenv'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
My config: Precise32, python 2.7, twisted 12.1.0 | |
(ve)vagrant@precise32:/var/vusion/vusion-backend/ve/src/vumi/vumi$ trial transports/tests/ | |
vumi.transports.tests.test_base | |
BaseTransportTestCase | |
test_consumer_registry ... [ERROR] | |
test_middleware_for_events ... [ERROR] | |
test_middleware_for_failures ... [ERROR] | |
test_middleware_for_inbound_messages ... [ERROR] | |
test_middleware_for_outbound_messages ... [ERROR] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#I get an exception when trying to dynamically restart a worker with the same name. | |
#In this case the worker is name 'simulator' and has transport_name ='simulator'. | |
#In the example below, the multiworker has to first stop the worker, then start a new one with the same mane. | |
#This request as send to the multiworker through control Messages (see in the log "Received control!") | |
==The Error== | |
2012-04-20 09:46:27+0300 [WorkerAMQClient,client] 'Unexpected error RuntimeError(u"cannot have two services with same name \'simulator\'",)' | |
==Logs== |
NewerOlder