parent
2855aa90d5
commit
0d542c7a76
@ -25,7 +25,5 @@ final class SapphireEventPublishingService implements IEventPublishingService {
|
|||||||
$parent = EventHolder::get()->first();
|
$parent = EventHolder::get()->first();
|
||||||
if(!$parent) throw new NotFoundEntityException('EventHolder','');
|
if(!$parent) throw new NotFoundEntityException('EventHolder','');
|
||||||
$event->setParent($parent); // Should set the ID once the Holder is created...
|
$event->setParent($parent); // Should set the ID once the Holder is created...
|
||||||
$event->write();
|
|
||||||
//$event->doPublish();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -122,7 +122,7 @@ final class EventRegistrationRequestManager {
|
|||||||
$event = $factory->buildEvent($request);
|
$event = $factory->buildEvent($request);
|
||||||
$event_repository->add($event);
|
$event_repository->add($event);
|
||||||
$request->markAsPosted();
|
$request->markAsPosted();
|
||||||
|
$event_publishing_service->publish($event);
|
||||||
//send Accepted message
|
//send Accepted message
|
||||||
$point_of_contact = $request->getPointOfContact();
|
$point_of_contact = $request->getPointOfContact();
|
||||||
$name_to = $point_of_contact->getName();
|
$name_to = $point_of_contact->getName();
|
||||||
@ -139,7 +139,7 @@ final class EventRegistrationRequestManager {
|
|||||||
return $event;
|
return $event;
|
||||||
});
|
});
|
||||||
|
|
||||||
$event_publishing_service->publish($event);
|
|
||||||
return $event;
|
return $event;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,6 +120,8 @@ jQuery(document).ready(function($) {
|
|||||||
modal: true,
|
modal: true,
|
||||||
buttons: {
|
buttons: {
|
||||||
"Post": function() {
|
"Post": function() {
|
||||||
|
var btn = $(".ui-dialog-buttonset button:contains('Post')",$(this).parent());
|
||||||
|
btn.attr("disabled", true);
|
||||||
var id = $(this).data('id');
|
var id = $(this).data('id');
|
||||||
var row = $(this).data('row');
|
var row = $(this).data('row');
|
||||||
var url = 'api/v1/event-registration-requests/'+id+'/posted';
|
var url = 'api/v1/event-registration-requests/'+id+'/posted';
|
||||||
@ -133,6 +135,7 @@ jQuery(document).ready(function($) {
|
|||||||
},
|
},
|
||||||
error: function (jqXHR, textStatus, errorThrown) {
|
error: function (jqXHR, textStatus, errorThrown) {
|
||||||
ajaxError(jqXHR, textStatus, errorThrown);
|
ajaxError(jqXHR, textStatus, errorThrown);
|
||||||
|
btn.attr("disabled", false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$(this).dialog( "close" );
|
$(this).dialog( "close" );
|
||||||
|
@ -25,7 +25,5 @@ implements IJobPublishingService
|
|||||||
$parent = JobHolder::get()->first();
|
$parent = JobHolder::get()->first();
|
||||||
if(!$parent) throw new NotFoundEntityException('JobHolder','');
|
if(!$parent) throw new NotFoundEntityException('JobHolder','');
|
||||||
$job->setParent($parent); // Should set the ID once the Holder is created...
|
$job->setParent($parent); // Should set the ID once the Holder is created...
|
||||||
$job->write();
|
|
||||||
//$job->doPublish();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -136,13 +136,15 @@ final class JobRegistrationRequestManager {
|
|||||||
$repository = $this->repository;
|
$repository = $this->repository;
|
||||||
$factory = $this->factory;
|
$factory = $this->factory;
|
||||||
$jobs_repository = $this->jobs_repository;
|
$jobs_repository = $this->jobs_repository;
|
||||||
|
$jobs_publishing_service = $this->jobs_publishing_service ;
|
||||||
|
|
||||||
$job = $this->tx_manager->transaction(function() use ($id, $repository, $jobs_repository, $factory, $jobs_link){
|
$job = $this->tx_manager->transaction(function() use ($id, $repository, $jobs_repository, $factory, $jobs_link, $jobs_publishing_service){
|
||||||
$request = $repository->getById($id);
|
$request = $repository->getById($id);
|
||||||
if(!$request) throw new NotFoundEntityException('JobRegistrationRequest',sprintf('id %s',$id ));
|
if(!$request) throw new NotFoundEntityException('JobRegistrationRequest',sprintf('id %s',$id ));
|
||||||
$job = $factory->buildJob($request);
|
$job = $factory->buildJob($request);
|
||||||
$jobs_repository->add($job);
|
$jobs_repository->add($job);
|
||||||
$request->markAsPosted();
|
$request->markAsPosted();
|
||||||
|
$jobs_publishing_service->publish($job);
|
||||||
//send Accepted message
|
//send Accepted message
|
||||||
$point_of_contact = $request->getPointOfContact();
|
$point_of_contact = $request->getPointOfContact();
|
||||||
$name_to = $point_of_contact->getName();
|
$name_to = $point_of_contact->getName();
|
||||||
@ -155,11 +157,10 @@ final class JobRegistrationRequestManager {
|
|||||||
'JobLink' => $jobs_link,
|
'JobLink' => $jobs_link,
|
||||||
));
|
));
|
||||||
$email->send();
|
$email->send();
|
||||||
|
|
||||||
return $job;
|
return $job;
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->jobs_publishing_service->publish($job);
|
|
||||||
return $job;
|
return $job;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,6 +176,8 @@ jQuery(document).ready(function($) {
|
|||||||
modal: true,
|
modal: true,
|
||||||
buttons: {
|
buttons: {
|
||||||
"Post": function() {
|
"Post": function() {
|
||||||
|
var btn = $(".ui-dialog-buttonset button:contains('Post')",$(this).parent());
|
||||||
|
btn.attr("disabled", true);
|
||||||
var id = $(this).data('id');
|
var id = $(this).data('id');
|
||||||
var row = $(this).data('row');
|
var row = $(this).data('row');
|
||||||
var url = 'api/v1/job-registration-requests/'+id+'/posted';
|
var url = 'api/v1/job-registration-requests/'+id+'/posted';
|
||||||
@ -189,6 +191,7 @@ jQuery(document).ready(function($) {
|
|||||||
},
|
},
|
||||||
error: function (jqXHR, textStatus, errorThrown) {
|
error: function (jqXHR, textStatus, errorThrown) {
|
||||||
ajaxError(jqXHR, textStatus, errorThrown);
|
ajaxError(jqXHR, textStatus, errorThrown);
|
||||||
|
btn.attr("disabled", false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$(this).dialog( "close" );
|
$(this).dialog( "close" );
|
||||||
|
@ -168,6 +168,8 @@ jQuery(document).ready(function($) {
|
|||||||
|
|
||||||
$(form).submit(function( event ) {
|
$(form).submit(function( event ) {
|
||||||
if(job_valid) return;
|
if(job_valid) return;
|
||||||
|
|
||||||
|
$('#JobRegistrationRequestForm_JobRegistrationRequestForm_action_saveJobRegistrationRequest').prop('disabled', true);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
@ -227,9 +229,11 @@ jQuery(document).ready(function($) {
|
|||||||
cancelProcess:function(){
|
cancelProcess:function(){
|
||||||
job_valid = false;
|
job_valid = false;
|
||||||
ajaxIndicatorStop();
|
ajaxIndicatorStop();
|
||||||
|
$('#JobRegistrationRequestForm_JobRegistrationRequestForm_action_saveJobRegistrationRequest').prop('disabled', false);
|
||||||
},
|
},
|
||||||
errorMessage:function(location){
|
errorMessage:function(location){
|
||||||
return 'job location: address ( city:'+location.city+',state: '+location.state+', country:'+location.country+' )';
|
return 'job location: address ( city:'+location.city+',state: '+location.state+', country:'+location.country+' )';
|
||||||
|
$('#JobRegistrationRequestForm_JobRegistrationRequestForm_action_saveJobRegistrationRequest').prop('disabled', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
|
@ -43,8 +43,7 @@ final class Custom_SS_LogEmailWriter extends SS_LogEmailWriter {
|
|||||||
$formattedData = $this->_formatter->format($event);
|
$formattedData = $this->_formatter->format($event);
|
||||||
$subject = $formattedData['subject'];
|
$subject = $formattedData['subject'];
|
||||||
$body = $formattedData['data'];
|
$body = $formattedData['data'];
|
||||||
$email = EmailFactory::getInstance()->buildEmail(self::$send_from, $this->emailAddress,$subject, $body);
|
$email = new Email(self::$send_from, $this->emailAddress,$subject, $body);
|
||||||
|
|
||||||
$email->send();
|
$email->send();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user