[spalenque] - #6968 *QA CHANGES

This commit is contained in:
santipalenque 2014-11-18 13:38:03 -03:00 committed by Sebastian Marcet
parent 1f26e7d5e6
commit 70b97e2e0e
26 changed files with 649 additions and 38 deletions

View File

@ -62,6 +62,11 @@ class CompanyService
}
public function isDraft()
{
return 0;
}
public function isNotPublished()
{
return 0;
}

View File

@ -16,6 +16,7 @@ class CompanyServiceDraft
'Overview' => 'HTMLText',
'Call2ActionUri' => 'Text',
'Active' => 'Boolean',
'Published' => 'Boolean',
);
static $has_one = array(
@ -56,6 +57,16 @@ class CompanyServiceDraft
return 1;
}
public function isNotPublished()
{
return !$this->getField('Published');
}
public function setPublished($published)
{
$this->setField('Published',$published);
}
public function setCompany(ICompany $company)
{
AssociationFactory::getInstance()->getMany2OneAssociation($this,'Company')->setTarget($company);

View File

@ -14,7 +14,7 @@ final class ApplianceDraftFactory extends OpenStackImplementationDraftFactory {
* @param null|string $call_2_action_url
* @return ICompanyService
*/
public function buildCompanyService($name, $overview, ICompany $company, $active, IMarketPlaceType $marketplace_type, $call_2_action_url = null, $live_id = null)
public function buildCompanyService($name, $overview, ICompany $company, $active, IMarketPlaceType $marketplace_type, $call_2_action_url = null, $live_id = null, $published = null)
{
$appliance = new ApplianceDraft;
$appliance->setName($name);
@ -27,6 +27,7 @@ final class ApplianceDraftFactory extends OpenStackImplementationDraftFactory {
$appliance->setMarketplace($marketplace_type);
$appliance->setCall2ActionUri($call_2_action_url);
$appliance->setLiveServiceId($live_id);
$appliance->setPublished($published);
return $appliance;
}

View File

@ -25,7 +25,7 @@ final class ApplianceFactory extends OpenStackImplementationFactory {
* @param null|string $call_2_action_url
* @return ICompanyService
*/
public function buildCompanyService($name, $overview, ICompany $company, $active, IMarketPlaceType $marketplace_type, $call_2_action_url = null, $live_service = null)
public function buildCompanyService($name, $overview, ICompany $company, $active, IMarketPlaceType $marketplace_type, $call_2_action_url = null, $live_service = null, $published = null)
{
$appliance = new Appliance;
$appliance->setName($name);

View File

@ -15,7 +15,7 @@ final class ConsultantDraftFactory
* @param null|string $call_2_action_url
* @return ICompanyService
*/
public function buildCompanyService($name, $overview, ICompany $company, $active, IMarketPlaceType $marketplace_type, $call_2_action_url = null, $live_id = null)
public function buildCompanyService($name, $overview, ICompany $company, $active, IMarketPlaceType $marketplace_type, $call_2_action_url = null, $live_id = null, $published = null)
{
$consultant = new ConsultantDraft;
$consultant->setName($name);
@ -28,6 +28,7 @@ final class ConsultantDraftFactory
$consultant->setMarketplace($marketplace_type);
$consultant->setCall2ActionUri($call_2_action_url);
$consultant->setLiveServiceId($live_id);
$consultant->setPublished($published);
return $consultant;
}

View File

@ -27,7 +27,7 @@ final class ConsultantFactory
* @param null|string $call_2_action_url
* @return ICompanyService
*/
public function buildCompanyService($name, $overview, ICompany $company, $active, IMarketPlaceType $marketplace_type, $call_2_action_url = null, $live_id = null)
public function buildCompanyService($name, $overview, ICompany $company, $active, IMarketPlaceType $marketplace_type, $call_2_action_url = null, $live_id = null, $published = null)
{
$consultant = new Consultant;
$consultant->setName($name);

View File

@ -14,7 +14,7 @@ final class DistributionDraftFactory extends OpenStackImplementationDraftFactory
* @param null|string $call_2_action_url
* @return ICompanyService
*/
public function buildCompanyService($name, $overview, ICompany $company, $active, IMarketPlaceType $marketplace_type, $call_2_action_url = null, $live_id = null)
public function buildCompanyService($name, $overview, ICompany $company, $active, IMarketPlaceType $marketplace_type, $call_2_action_url = null, $live_id = null, $published = null)
{
$distribution = new DistributionDraft;
$distribution->setName($name);
@ -27,6 +27,7 @@ final class DistributionDraftFactory extends OpenStackImplementationDraftFactory
$distribution->setMarketplace($marketplace_type);
$distribution->setCall2ActionUri($call_2_action_url);
$distribution->setLiveServiceId($live_id);
$distribution->setPublished($published);
return $distribution;
}

View File

@ -25,7 +25,7 @@ final class DistributionFactory extends OpenStackImplementationFactory {
* @param null|string $call_2_action_url
* @return ICompanyService
*/
public function buildCompanyService($name, $overview, ICompany $company, $active, IMarketPlaceType $marketplace_type, $call_2_action_url = null, $live_id = null)
public function buildCompanyService($name, $overview, ICompany $company, $active, IMarketPlaceType $marketplace_type, $call_2_action_url = null, $live_id = null, $published = null)
{
$distribution = new Distribution;
$distribution->setName($name);

View File

@ -13,7 +13,7 @@ final class PrivateCloudDraftFactory extends CloudDraftFactory {
* @param null|string $call_2_action_url
* @return ICompanyService
*/
public function buildCompanyService($name, $overview, ICompany $company, $active, IMarketPlaceType $marketplace_type, $call_2_action_url = null, $live_id = null)
public function buildCompanyService($name, $overview, ICompany $company, $active, IMarketPlaceType $marketplace_type, $call_2_action_url = null, $live_id = null, $published = null)
{
$private_cloud = new PrivateCloudServiceDraft;
$private_cloud->setName($name);
@ -26,6 +26,7 @@ final class PrivateCloudDraftFactory extends CloudDraftFactory {
$private_cloud->setMarketplace($marketplace_type);
$private_cloud->setCall2ActionUri($call_2_action_url);
$private_cloud->setLiveServiceId($live_id);
$private_cloud->setPublished($published);
return $private_cloud;
}

View File

@ -24,7 +24,7 @@ final class PrivateCloudFactory extends CloudFactory {
* @param null|string $call_2_action_url
* @return ICompanyService
*/
public function buildCompanyService($name, $overview, ICompany $company, $active, IMarketPlaceType $marketplace_type, $call_2_action_url = null, $live_service = null)
public function buildCompanyService($name, $overview, ICompany $company, $active, IMarketPlaceType $marketplace_type, $call_2_action_url = null, $live_service = null, $published = null)
{
$private_cloud = new PrivateCloudService;
$private_cloud->setName($name);

View File

@ -15,7 +15,7 @@ final class PublicCloudDraftFactory
* @param null|string $call_2_action_url
* @return ICompanyService
*/
public function buildCompanyService($name, $overview, ICompany $company, $active, IMarketPlaceType $marketplace_type, $call_2_action_url = null, $live_id = null)
public function buildCompanyService($name, $overview, ICompany $company, $active, IMarketPlaceType $marketplace_type, $call_2_action_url = null, $live_id = null, $published = null)
{
$public_cloud = new PublicCloudServiceDraft();
$public_cloud->setName($name);
@ -28,6 +28,7 @@ final class PublicCloudDraftFactory
$public_cloud->setMarketplace($marketplace_type);
$public_cloud->setCall2ActionUri($call_2_action_url);
$public_cloud->setLiveServiceId($live_id);
$public_cloud->setPublished($published);
return $public_cloud;
}

View File

@ -26,7 +26,7 @@ final class PublicCloudFactory
* @param null|string $call_2_action_url
* @return ICompanyService
*/
public function buildCompanyService($name, $overview, ICompany $company, $active, IMarketPlaceType $marketplace_type, $call_2_action_url = null, $live_service = null)
public function buildCompanyService($name, $overview, ICompany $company, $active, IMarketPlaceType $marketplace_type, $call_2_action_url = null, $live_service = null, $published = null)
{
$public_cloud = new PublicCloudService;
$public_cloud->setName($name);

View File

@ -194,7 +194,8 @@ abstract class CompanyServiceManager {
$data['active'],
$getMarketPlaceType->invoke($this_var),
$data['call_2_action_uri'],
$live_service_id);
$live_service_id,
$data['published']);
$this_var->register($company_service);
@ -252,6 +253,8 @@ abstract class CompanyServiceManager {
$company_service->setName($data['name']);
if ($company_service->isDraft()) {
$live_service_id = (isset($data['live_service_id'])) ? $data['live_service_id'] : 0;
$published = (isset($data['published'])) ? $data['published'] : 0;
$company_service->setPublished($published);
$company_service->setLiveServiceId($live_service_id);
}

View File

@ -24,7 +24,7 @@ interface ICompanyServiceFactory {
* @param null|string $call_2_action_url
* @return ICompanyService
*/
public function buildCompanyService($name, $overview, ICompany $company, $active, IMarketPlaceType $marketplace_type,$call_2_action_url=null,$live_id=null);
public function buildCompanyService($name, $overview, ICompany $company, $active, IMarketPlaceType $marketplace_type,$call_2_action_url=null,$live_id=null,$published=null);
/**
* @param $id

View File

@ -83,6 +83,8 @@ jQuery(document).ready(function($){
hypervisors !== false &&
videos !== false){
ajaxIndicatorStart('saving data.. please wait..');
//create distribution object and POST it
var appliance = {};
appliance.id = parseInt($("#id",form).val());
@ -98,6 +100,7 @@ jQuery(document).ready(function($){
appliance.capabilities = capabilities;
appliance.regional_support = regional_support;
appliance.additional_resources = additional_resources;
appliance.published = 0;
var type = appliance.id > 0 ?'PUT':'POST';
$('.save-appliance').prop('disabled',true);
@ -108,12 +111,90 @@ jQuery(document).ready(function($){
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data,textStatus,jqXHR) {
//window.location = listing_url;
if(appliance.id < 1) $("#id",form).val(data);
ajaxIndicatorStop();
$('.publish-appliance').prop('disabled',false);
$('.save-appliance').prop('disabled',false);
window.location = listing_url;
},
error: function (jqXHR, textStatus, errorThrown) {
ajaxIndicatorStop();
ajaxError(jqXHR, textStatus, errorThrown);
$('.save-appliance').prop('disabled',false);
}
});
}
return false;
});
$('.preview-appliance').click(function(event){
event.preventDefault();
event.stopPropagation();
var button = $(this);
if(button.prop('disabled')){
return false;
}
var form_validator = form.marketplace_type_header('getFormValidator');
form_validator.settings.ignore = ".add-comtrol";
var is_valid = form.valid();
if(!is_valid) return false;
form_validator.resetForm();
var additional_resources = $("#additional-resources-form").additional_resources('serialize');
var regional_support = $("#support-channels-form").support_channels('serialize');
var capabilities = $("#components_form").components('serialize');
var guest_os = $("#guest_os_form").guest_os('serialize');
var hypervisors = $("#hypervisors_form").hypervisors('serialize');
var videos = $("#videos-form").videos('serialize');
var is_pdf = $(this).hasClass('pdf');
if(additional_resources !== false &&
regional_support !== false &&
capabilities !== false &&
guest_os !== false &&
hypervisors !== false &&
videos !== false){
ajaxIndicatorStart('saving data.. please wait..');
//create distribution object and POST it
var appliance = {};
appliance.id = parseInt($("#id",form).val());
appliance.live_service_id = parseInt($("#live_id",form).val());
appliance.company_id = parseInt($("#company_id",form).val());
appliance.name = $("#name",form).val();
appliance.overview = $("#overview",form).val();
appliance.call_2_action_uri = $("#call_2_action_uri",form).val();
appliance.active = $('#active',form).is(":checked");;
appliance.videos = videos;
appliance.hypervisors = hypervisors;
appliance.guest_os = guest_os;
appliance.capabilities = capabilities;
appliance.regional_support = regional_support;
appliance.additional_resources = additional_resources;
appliance.published = 0;
var type = appliance.id > 0 ?'PUT':'POST';
$('.save-appliance').prop('disabled',true);
$.ajax({
type: type,
url: 'api/v1/marketplace/appliances',
data: JSON.stringify(appliance),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data,textStatus,jqXHR) {
ajaxIndicatorStop();
$('.publish-appliance').prop('disabled',false);
$('.save-appliance').prop('disabled',false);
var draft_id = (appliance.id > 0) ? appliance.id : data;
$("#id",form).val(draft_id);
if (is_pdf) {
window.location = product_url+'/'+draft_id+'/draft_pdf';
} else {
window.open(product_url+'/'+draft_id+'/draft_preview','_blank');
}
},
error: function (jqXHR, textStatus, errorThrown) {
ajaxIndicatorStop();
ajaxError(jqXHR, textStatus, errorThrown);
$('.save-appliance').prop('disabled',false);
}
@ -148,6 +229,8 @@ jQuery(document).ready(function($){
hypervisors !== false &&
videos !== false){
ajaxIndicatorStart('saving data.. please wait..');
//create distribution object and POST it
var appliance = {};
appliance.id = parseInt($("#id",form).val());
@ -163,6 +246,7 @@ jQuery(document).ready(function($){
appliance.capabilities = capabilities;
appliance.regional_support = regional_support;
appliance.additional_resources = additional_resources;
appliance.published = 1;
var url = 'api/v1/marketplace/appliances/'+appliance.live_service_id;
@ -174,9 +258,11 @@ jQuery(document).ready(function($){
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data,textStatus,jqXHR) {
ajaxIndicatorStop();
window.location = listing_url;
},
error: function (jqXHR, textStatus, errorThrown) {
ajaxIndicatorStop();
ajaxError(jqXHR, textStatus, errorThrown);
$('.publish-appliance').prop('disabled',false);
}

View File

@ -115,7 +115,8 @@ jQuery(document).ready(function($){
languages_spoken: languages_spoken,
offices: offices,
videos: videos,
additional_resources: additional_resources
additional_resources: additional_resources,
published: 0
}
$('.save-consultant').prop('disabled',true);
var type = consultant.id > 0 ?'PUT':'POST';
@ -186,6 +187,138 @@ jQuery(document).ready(function($){
return false;
});
$('.preview-consultant').click(function(event){
event.preventDefault();
event.stopPropagation();
var button = $(this);
if(button.prop('disabled')){
return false;
}
var form_validator = form.marketplace_type_header('getFormValidator');
form_validator.settings.ignore = ".add-comtrol";
var is_valid = form.valid();
form_validator.settings.ignore = [];
if(!is_valid) return false;
form_validator.resetForm();
var expertise_areas = $('#expertise_areas_form').expertise_areas('serialize');
var configuration_management = $('#configuration_management_form').configuration_management_expertise('serialize');
var reference_clients = $('#reference_clients_form').reference_clients('serialize');
var services_offered = $('#services_offered_form').services_offered('serialize');
var regional_support = $('#support-channels-form').support_channels('serialize');
var languages_spoken = $('#languages_spoken_form').spoken_languages('serialize');
var offices = $('#offices_form').offices('serialize');
var videos = $('#videos-form').videos('serialize');
var additional_resources = $('#additional-resources-form').additional_resources('serialize');
var is_pdf = $(this).hasClass('pdf');
if(expertise_areas!==false &&
configuration_management!== false &&
reference_clients!== false &&
services_offered !== false &&
regional_support !== false &&
languages_spoken !== false &&
offices !== false &&
videos !== false &&
additional_resources !== false ){
ajaxIndicatorStart('saving data.. please wait..');
var consultant = {
id : parseInt($("#id",form).val()),
live_service_id : parseInt($("#live_id",form).val()),
company_id : parseInt($("#company_id",form).val()),
name : $("#name",form).val().trim(),
overview : $("#overview",form).val().trim(),
call_2_action_uri : $("#call_2_action_uri",form).val().trim(),
active : $('#active',form).is(":checked"),
expertise_areas: expertise_areas,
configuration_management: configuration_management,
reference_clients: reference_clients,
services_offered: services_offered,
regional_support: regional_support,
languages_spoken: languages_spoken,
offices: offices,
videos: videos,
additional_resources: additional_resources,
published: 0
}
$('.save-consultant').prop('disabled',true);
var type = consultant.id > 0 ?'PUT':'POST';
$(this).geocoding({
requests:consultant.offices,
buildGeoRequest:function(office){
var address = office.address_1+' '+office.address_2;
address = address.trim();
if(address!=''){
address+= ', '+office.city;
}
var restrictions = {
locality: office.city,
country:office.country
};
if(office.state!=''){
restrictions.administrativeArea = office.state;
if(address!=''){
address+= ', '+office.state;
}
}
if(office.zip_code!=''){
//restrictions.postalCode = office.zip_code;
if(address!=''){
address+= ', '+office.zip_code;
}
}
var request = {componentRestrictions:restrictions};
if(address!=''){
request.address = address;
}
return request;
},
postProcessRequest:function(office, lat, lng){
office.lat = lat;
office.lng = lng;
},
processFinished:function(){
$.ajax({
type: type,
url: 'api/v1/marketplace/consultants',
data: JSON.stringify(consultant),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data,textStatus,jqXHR) {
$('.publish-consultant').prop('disabled',false);
$('.save-consultant').prop('disabled',false);
ajaxIndicatorStop();
var draft_id = (consultant.id > 0) ? consultant.id : data;
$("#id",form).val(draft_id);
if (is_pdf) {
window.location = product_url+'/'+draft_id+'/draft_pdf';
} else {
window.open(product_url+'/'+draft_id+'/draft_preview','_blank');
}
},
error: function (jqXHR, textStatus, errorThrown) {
ajaxIndicatorStop();
$('.save-consultant').prop('disabled',false);
ajaxError(jqXHR, textStatus, errorThrown);
}
});
},
cancelProcess:function(){
ajaxIndicatorStop();
$('.save-consultant').prop('disabled',false);
},
errorMessage:function(office){
return 'office: address ( address_1:'+office.address_1+', address_2:'+office.address_2+', city:'+office.city+',state: '+office.state+', country:'+office.country+' )';
}
});
}
return false;
});
$('.publish-consultant').click(function(event){
event.preventDefault();
event.stopPropagation();
@ -238,7 +371,8 @@ jQuery(document).ready(function($){
languages_spoken: languages_spoken,
offices: offices,
videos: videos,
additional_resources: additional_resources
additional_resources: additional_resources,
published: 1
}
$('.publish-consultant').prop('disabled',true);

View File

@ -84,6 +84,8 @@ jQuery(document).ready(function($){
hypervisors !== false &&
videos !== false){
ajaxIndicatorStart('saving data.. please wait..');
//create distribution object and POST it
var distribution = {};
distribution.id = parseInt($("#id",form).val());
@ -99,6 +101,7 @@ jQuery(document).ready(function($){
distribution.capabilities = capabilities;
distribution.regional_support = regional_support;
distribution.additional_resources = additional_resources;
distribution.published = 0;
var type = distribution.id > 0 ?'PUT':'POST';
@ -110,11 +113,91 @@ jQuery(document).ready(function($){
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data,textStatus,jqXHR) {
ajaxIndicatorStop();
$('.publish-distribution').prop('disabled',false);
$('.save-distribution').prop('disabled',false);
window.location = listing_url;
},
error: function (jqXHR, textStatus, errorThrown) {
ajaxIndicatorStop();
$('.save-distribution').prop('disabled',false);
ajaxError(jqXHR, textStatus, errorThrown);
}
});
}
return false;
});
$('.preview-distribution').click(function(event){
event.preventDefault();
event.stopPropagation();
var button = $(this);
if(button.prop('disabled')){
return false;
}
var form_validator = form.marketplace_type_header('getFormValidator');
form_validator.settings.ignore = ".add-comtrol";
var is_valid = form.valid();
if(!is_valid) return false;
form_validator.resetForm();
var additional_resources = $("#additional-resources-form").additional_resources('serialize');
var regional_support = $("#support-channels-form").support_channels('serialize');
var capabilities = $("#components_form").components('serialize');
var guest_os = $("#guest_os_form").guest_os('serialize');
var hypervisors = $("#hypervisors_form").hypervisors('serialize');
var videos = $("#videos-form").videos('serialize');
var is_pdf = $(this).hasClass('pdf');
if(additional_resources !== false &&
regional_support !== false &&
capabilities !== false &&
guest_os !== false &&
hypervisors !== false &&
videos !== false){
ajaxIndicatorStart('saving data.. please wait..');
//create distribution object and POST it
var distribution = {};
distribution.id = parseInt($("#id",form).val());
distribution.live_service_id = parseInt($("#live_id",form).val());
distribution.company_id = parseInt($("#company_id",form).val());
distribution.name = $("#name",form).val();
distribution.overview = $("#overview",form).val();
distribution.call_2_action_uri = $("#call_2_action_uri",form).val();
distribution.active = $('#active',form).is(":checked");
distribution.videos = videos;
distribution.hypervisors = hypervisors;
distribution.guest_os = guest_os;
distribution.capabilities = capabilities;
distribution.regional_support = regional_support;
distribution.additional_resources = additional_resources;
distribution.published = 0;
var type = distribution.id > 0 ?'PUT':'POST';
$('.save-distribution').prop('disabled',true);
$.ajax({
type: type,
url: 'api/v1/marketplace/distributions',
data: JSON.stringify(distribution),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data,textStatus,jqXHR) {
ajaxIndicatorStop();
$('.publish-distribution').prop('disabled',false);
$('.save-distribution').prop('disabled',false);
var draft_id = (distribution.id > 0) ? distribution.id : data;
$("#id",form).val(draft_id);
if (is_pdf) {
window.location = product_url+'/'+draft_id+'/draft_pdf';
} else {
window.open(product_url+'/'+draft_id+'/draft_preview','_blank');
}
},
error: function (jqXHR, textStatus, errorThrown) {
ajaxIndicatorStop();
$('.save-distribution').prop('disabled',false);
ajaxError(jqXHR, textStatus, errorThrown);
}
@ -149,6 +232,8 @@ jQuery(document).ready(function($){
hypervisors !== false &&
videos !== false){
ajaxIndicatorStart('saving data.. please wait..');
//create distribution object and POST it
var distribution = {};
distribution.id = parseInt($("#id",form).val());
@ -164,6 +249,7 @@ jQuery(document).ready(function($){
distribution.capabilities = capabilities;
distribution.regional_support = regional_support;
distribution.additional_resources = additional_resources;
distribution.published = 1;
var url = 'api/v1/marketplace/distributions/'+distribution.live_service_id;
@ -176,9 +262,11 @@ jQuery(document).ready(function($){
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data,textStatus,jqXHR) {
ajaxIndicatorStop();
window.location = listing_url;
},
error: function (jqXHR, textStatus, errorThrown) {
ajaxIndicatorStop();
$('.publish-distribution').prop('disabled',false);
ajaxError(jqXHR, textStatus, errorThrown);
}

View File

@ -120,6 +120,7 @@ jQuery(document).ready(function($){
private_cloud.regional_support = regional_support;
private_cloud.additional_resources = additional_resources;
private_cloud.data_centers = data_centers;
private_cloud.published = 0;
var type = private_cloud.id > 0 ?'PUT':'POST';
@ -176,6 +177,125 @@ jQuery(document).ready(function($){
return false;
});
$('.preview-private_cloud').click(function(event){
var button = $(this);
if(button.prop('disabled')){
return false;
}
event.preventDefault();
event.stopPropagation();
var form_validator = form.marketplace_type_header('getFormValidator');
form_validator.settings.ignore = ".add-comtrol";
var is_valid = form.valid();
if(!is_valid) return false;
form_validator.resetForm();
var additional_resources = $("#additional-resources-form").additional_resources('serialize');
var regional_support = $("#support-channels-form").support_channels('serialize');
var capabilities = $("#components_form").components('serialize');
var guest_os = $("#guest_os_form").guest_os('serialize');
var hyper_visors = $("#hypervisors_form").hypervisors('serialize');
var videos = $("#videos-form").videos('serialize');
var data_centers = $("#data-centers-form").datacenter_locations('serialize');
var pricing_schemas = $("#pricing_schema_form").pricing_schemas('serialize');
var is_pdf = $(this).hasClass('pdf');
if(additional_resources !== false &&
regional_support !== false &&
capabilities !== false &&
guest_os !== false &&
hyper_visors !== false &&
videos !== false &&
data_centers !== false &&
pricing_schemas !== false
){
ajaxIndicatorStart('saving data.. please wait..');
//create private_cloud object and POST it
var private_cloud = {};
private_cloud.id = parseInt($("#id",form).val());
private_cloud.live_service_id = parseInt($("#live_id",form).val());
private_cloud.company_id = parseInt($("#company_id",form).val());
private_cloud.name = $("#name",form).val();
private_cloud.overview = $("#overview",form).val();
private_cloud.call_2_action_uri = $("#call_2_action_uri",form).val();
private_cloud.active = $('#active',form).is(":checked");
private_cloud.videos = videos;
private_cloud.hypervisors = hyper_visors;
private_cloud.guest_os = guest_os;
private_cloud.capabilities = capabilities;
for(var i in private_cloud.capabilities){
var c = private_cloud.capabilities[i];
c.pricing_schemas = pricing_schemas;
}
private_cloud.regional_support = regional_support;
private_cloud.additional_resources = additional_resources;
private_cloud.data_centers = data_centers;
private_cloud.published = 0;
var type = private_cloud.id > 0 ?'PUT':'POST';
$('.save-private-cloud').prop('disabled',true);
$(this).geocoding({
requests:private_cloud.data_centers.locations,
buildGeoRequest:function(location){
var restrictions = {
locality: location.city,
country:location.country
};
if(location.state!=''){
restrictions.administrativeArea = location.state;
}
var request = {componentRestrictions:restrictions};
return request;
},
postProcessRequest:function(location, lat, lng){
location.lat = lat;
location.lng = lng;
},
processFinished:function(){
$.ajax({
type: type,
url: 'api/v1/marketplace/private-clouds',
data: JSON.stringify(private_cloud),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data,textStatus,jqXHR) {
$('.publish-private-cloud').prop('disabled',false);
$('.save-private-cloud').prop('disabled',false);
ajaxIndicatorStop();
var draft_id = (private_cloud.id > 0) ? private_cloud.id : data;
$("#id",form).val(draft_id);
if (is_pdf) {
window.location = product_url+'/'+draft_id+'/draft_pdf';
} else {
window.open(product_url+'/'+draft_id+'/draft_preview','_blank');
}
},
error: function (jqXHR, textStatus, errorThrown) {
ajaxIndicatorStop();
$('.save-private-cloud').prop('disabled',false);
ajaxError(jqXHR, textStatus, errorThrown);
}
});
},
cancelProcess:function(){
ajaxIndicatorStop();
$('.save-private-cloud').prop('disabled',false);
},
errorMessage:function(location){
return 'data center location: address ( city:'+location.city+',state: '+location.state+', country:'+location.country+' )';
}
});
}
return false;
});
$('.publish-private-cloud').click(function(event){
var button = $(this);
if(button.prop('disabled')){
@ -230,6 +350,7 @@ jQuery(document).ready(function($){
private_cloud.regional_support = regional_support;
private_cloud.additional_resources = additional_resources;
private_cloud.data_centers = data_centers;
private_cloud.published = 1;
var url = 'api/v1/marketplace/private-clouds/'+private_cloud.live_service_id;

View File

@ -120,6 +120,7 @@ jQuery(document).ready(function($){
public_cloud.regional_support = regional_support;
public_cloud.additional_resources = additional_resources;
public_cloud.data_centers = data_centers;
public_cloud.published = 0;
var type = public_cloud.id > 0 ?'PUT':'POST';
@ -179,6 +180,127 @@ jQuery(document).ready(function($){
return false;
});
$('.preview-public_cloud').click(function(event){
var button = $(this);
if(button.prop('disabled')){
return false;
}
event.preventDefault();
event.stopPropagation();
var form_validator = form.marketplace_type_header('getFormValidator');
form_validator.settings.ignore = ".add-comtrol";
var is_valid = form.valid();
if(!is_valid) return false;
form_validator.resetForm();
var additional_resources = $("#additional-resources-form").additional_resources('serialize');
var regional_support = $("#support-channels-form").support_channels('serialize');
var capabilities = $("#components_form").components('serialize');
var guest_os = $("#guest_os_form").guest_os('serialize');
var hyper_visors = $("#hypervisors_form").hypervisors('serialize');
var videos = $("#videos-form").videos('serialize');
var data_centers = $("#data-centers-form").datacenter_locations('serialize');
var pricing_schemas = $("#pricing_schema_form").pricing_schemas('serialize');
var is_pdf = $(this).hasClass('pdf');
if(additional_resources !== false &&
regional_support !== false &&
capabilities !== false &&
guest_os !== false &&
hyper_visors !== false &&
videos !== false &&
data_centers !== false &&
pricing_schemas !== false
){
ajaxIndicatorStart('saving data.. please wait..');
//create public_cloud object and POST it
var public_cloud = {};
public_cloud.id = parseInt($("#id",form).val());
public_cloud.live_service_id = parseInt($("#live_id",form).val());
public_cloud.company_id = parseInt($("#company_id",form).val());
public_cloud.name = $("#name",form).val();
public_cloud.overview = $("#overview",form).val();
public_cloud.call_2_action_uri = $("#call_2_action_uri",form).val();
public_cloud.active = $('#active',form).is(":checked");
public_cloud.videos = videos;
public_cloud.hypervisors = hyper_visors;
public_cloud.guest_os = guest_os;
public_cloud.capabilities = capabilities;
for(var i in public_cloud.capabilities){
var c = public_cloud.capabilities[i];
c.pricing_schemas = pricing_schemas;
}
public_cloud.regional_support = regional_support;
public_cloud.additional_resources = additional_resources;
public_cloud.data_centers = data_centers;
public_cloud.published = 0;
var type = public_cloud.id > 0 ?'PUT':'POST';
$('.save-public-cloud').prop('disabled',true);
$(this).geocoding({
requests:public_cloud.data_centers.locations,
buildGeoRequest:function(location){
var restrictions = {
locality: location.city,
country:location.country
};
if(location.state!=''){
restrictions.administrativeArea = location.state;
}
var request = {componentRestrictions:restrictions};
return request;
},
postProcessRequest:function(location, lat, lng){
location.lat = lat;
location.lng = lng;
},
processFinished:function(){
$.ajax({
type: type,
url: 'api/v1/marketplace/public-clouds',
data: JSON.stringify(public_cloud),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data,textStatus,jqXHR) {
$('.publish-public-cloud').prop('disabled',false);
$('.save-public-cloud').prop('disabled',false);
ajaxIndicatorStop();
var draft_id = (public_cloud.id > 0) ? public_cloud.id : data;
$("#id",form).val(draft_id);
if (is_pdf) {
window.location = product_url+'/'+draft_id+'/draft_pdf';
} else {
window.open(product_url+'/'+draft_id+'/draft_preview','_blank');
}
},
error: function (jqXHR, textStatus, errorThrown) {
ajaxIndicatorStop();
$('.save-public-cloud').prop('disabled',false);
ajaxError(jqXHR, textStatus, errorThrown);
}
});
},
cancelProcess:function(){
ajaxIndicatorStop();
$('.save-public-cloud').prop('disabled',false);
},
errorMessage:function(location){
return 'data center location: address ( city:'+location.city+',state: '+location.state+', country:'+location.country+' )';
}
});
}
return false;
});
$('.publish-public-cloud').click(function(event){
var button = $(this);
if(button.prop('disabled')){
@ -232,6 +354,7 @@ jQuery(document).ready(function($){
public_cloud.regional_support = regional_support;
public_cloud.additional_resources = additional_resources;
public_cloud.data_centers = data_centers;
public_cloud.published = 0;
var url = 'api/v1/marketplace/public-clouds/'+public_cloud.live_service_id;

View File

@ -490,7 +490,12 @@ h1.marketplace a,h1.marketplace a.visited{
background:url("/marketplace/code/ui/frontend/images/api/full.png") no-repeat scroll center center rgba(0,0,0,0);
display:inline-block;
height:20px;
text-indent:-3000px;
color: black;
/*text-indent:-3000px; uncomment this to hide text inside icon*/
font-size: 7px;
text-align: center;
line-height: 19px;
font-weight: bold;
width:20px;
}

View File

@ -28,7 +28,7 @@
level = 'none';
else if(coverage>0 && coverage <= 50)
level = 'partial';
td.append('<span class="level-'+level+'">'+level+'</span>');
td.append('<span class="level-'+level+'">'+coverage+'%</span>');
});
}
}

View File

@ -3,15 +3,20 @@
<div style="clear:both">
<h1 style="width:50%;float:left;">Appliances - Product Details</h1>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center" class="roundedButton save-appliance" href="#" id="save-appliance">Save</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:50px;" class="roundedButton publish-appliance" href="#" id="publish-appliance">Publish</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:2%;" class="roundedButton publish-appliance" href="#" id="publish-appliance">Publish</a>
<% if CurrentAppliance %>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:50px;" class="roundedButton addDeploymentBtn" target="_blank" href="$Top.Link(appliance)/$CurrentAppliance.ID/<% if CurrentAppliance.isDraft %>draft_<% end_if %>preview">Preview</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:2%;" class="roundedButton addDeploymentBtn preview-appliance" href="#" >Preview</a>
<% end_if %>
<% if CurrentAppliance %>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:50px;" class="roundedButton addDeploymentBtn" target="_blank" href="$Top.Link(appliance)/$CurrentAppliance.ID/<% if CurrentAppliance.isDraft %>draft_<% end_if %>pdf">Download PDF</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:2%;" class="roundedButton addDeploymentBtn preview-appliance pdf" href="#" >Download PDF</a>
<% end_if %>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:50px;" class="roundedButton addDeploymentBtn" href="$Top.Link">&lt;&lt; Back to Products</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:2%;" class="roundedButton addDeploymentBtn" href="$Top.Link">&lt;&lt; Back to Products</a>
</div>
<% if CurrentAppliance.isNotPublished %>
<div style="clear:both; color:red">
THIS VERSION IS NOT CURRENTLY PUBLISHED
</div>
<% end_if %>
<div style="clear:both">
<fieldset>
<form id="appliance_form" name="appliance_form">
@ -35,6 +40,7 @@
<% end_if %>
var component_releases = $ReleasesByComponent;
var listing_url = "{$Top.Link}";
var product_url = "$Top.Link(appliance)";
</script>
</div>
<% else %>

View File

@ -3,15 +3,20 @@
<div style="clear:both">
<h1 style="width:50%;float:left;">Consultant - Product Details</h1>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center" class="roundedButton save-consultant" href="#" id="save-consultant" name="save-consultant">Save</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:50px;" class="roundedButton publish-consultant" href="#" id="publish-consultant">Publish</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:2%;" class="roundedButton publish-consultant" href="#" id="publish-consultant">Publish</a>
<% if CurrentConsultant %>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:50px;" class="roundedButton addDeploymentBtn" target="_blank" href="$Top.Link(consultant)/$CurrentConsultant.ID/<% if CurrentConsultant.isDraft %>draft_<% end_if %>preview">Preview</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:2%;" class="roundedButton addDeploymentBtn preview-consultant" href="#" >Preview</a>
<% end_if %>
<% if CurrentConsultant %>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:50px;" class="roundedButton addDeploymentBtn" target="_blank" href="$Top.Link(consultant)/$CurrentConsultant.ID/<% if CurrentConsultant.isDraft %>draft_<% end_if %>pdf">Download PDF</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:2%;" class="roundedButton addDeploymentBtn preview-consultant pdf" href="#" >Download PDF</a>
<% end_if %>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:50px;" class="roundedButton addDeploymentBtn" href="$Top.Link(consultants)">&lt;&lt; Back to Products</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:2%;" class="roundedButton addDeploymentBtn" href="$Top.Link(consultants)">&lt;&lt; Back to Products</a>
</div>
<% if CurrentConsultant.isNotPublished %>
<div style="clear:both; color:red">
THIS VERSION IS NOT CURRENTLY PUBLISHED
</div>
<% end_if %>
<div style="clear:both">
<fieldset>
<form id="consultant_form" name="consultant_form">
@ -38,6 +43,7 @@
<% end_if %>
var component_releases = $ReleasesByComponent;
var listing_url = "$Top.Link(consultants)";
var product_url = "$Top.Link(consultant)";
</script>
</div>
<% else %>

View File

@ -3,15 +3,20 @@
<div style="clear:both">
<h1 style="width:50%;float:left;">Distribution - Product Details</h1>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center" class="roundedButton save-distribution" href="#" id="save-distribution">Save</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:50px;" class="roundedButton publish-distribution" href="#" id="publish-distribution">Publish</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:2%;" class="roundedButton publish-distribution" href="#" id="publish-distribution">Publish</a>
<% if CurrentDistribution %>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:50px;" class="roundedButton addDeploymentBtn" target="_blank" href="$Top.Link(distribution)/$CurrentDistribution.ID/<% if CurrentDistribution.isDraft %>draft_<% end_if %>preview">Preview</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:2%;" class="roundedButton addDeploymentBtn preview-distribution" href="#" >Preview</a>
<% end_if %>
<% if CurrentDistribution %>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:50px;" class="roundedButton addDeploymentBtn" target="_blank" href="$Top.Link(distribution)/$CurrentDistribution.ID/<% if CurrentDistribution.isDraft %>draft_<% end_if %>pdf">Download PDF</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:2%;" class="roundedButton addDeploymentBtn preview-distribution pdf" href="#" >Download PDF</a>
<% end_if %>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:50px;" class="roundedButton addDeploymentBtn" href="$Top.Link">&lt;&lt; Back to Products</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:2%;" class="roundedButton addDeploymentBtn" href="$Top.Link">&lt;&lt; Back to Products</a>
</div>
<% if CurrentDistribution.isNotPublished %>
<div style="clear:both; color:red">
THIS VERSION IS NOT CURRENTLY PUBLISHED
</div>
<% end_if %>
<div style="clear:both">
<fieldset>
<form id="distribution_form" name="distribution_form">
@ -35,6 +40,7 @@
<% end_if %>
var component_releases = $ReleasesByComponent;
var listing_url = "{$Top.Link}";
var product_url = "$Top.Link(distribution)";
</script>
</div>
</div>

View File

@ -3,15 +3,20 @@
<div style="clear:both">
<h1 style="width:50%;float:left;">Private Cloud - Product Details</h1>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center" class="roundedButton save-private-cloud" href="#" id="save-private-cloud1">Save</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:50px;" class="roundedButton publish-private-cloud" href="#" id="publish-private-cloud1">Publish</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:2%;" class="roundedButton publish-private-cloud" href="#" id="publish-private-cloud1">Publish</a>
<% if CurrentPrivateCloud %>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:50px;" class="roundedButton addDeploymentBtn" target="_blank" href="$Top.Link(private_cloud)/$CurrentPrivateCloud.ID/<% if CurrentPrivateCloud.isDraft %>draft_<% end_if %>preview">Preview</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:2%;" class="roundedButton addDeploymentBtn preview-private_cloud" href="#" >Preview</a>
<% end_if %>
<% if CurrentPrivateCloud %>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:50px;" class="roundedButton addDeploymentBtn" target="_blank" href="$Top.Link(private_cloud)/$CurrentPrivateCloud.ID/<% if CurrentPrivateCloud.isDraft %>draft_<% end_if %>pdf">Download PDF</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:2%;" class="roundedButton addDeploymentBtn preview-private_cloud pdf" href="#" >Download PDF</a>
<% end_if %>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:50px;" class="roundedButton addDeploymentBtn" href="$Top.Link(private_clouds)">&lt;&lt; Back to Products</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:2%;" class="roundedButton addDeploymentBtn" href="$Top.Link(private_clouds)">&lt;&lt; Back to Products</a>
</div>
<% if CurrentPrivateCloud.isNotPublished %>
<div style="clear:both; color:red">
THIS VERSION IS NOT CURRENTLY PUBLISHED
</div>
<% end_if %>
<div style="clear:both">
<fieldset>
<form id="private_cloud_form" name="private_cloud_form">
@ -37,6 +42,7 @@
<% end_if %>
var component_releases = $ReleasesByComponent;
var listing_url = "$Top.Link(private_clouds)";
var product_url = "$Top.Link(private_cloud)";
</script>
</div>
<% else %>

View File

@ -3,15 +3,20 @@
<div style="clear:both">
<h1 style="width:50%;float:left;">Public Cloud - Product Details</h1>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center" class="roundedButton save-public-cloud" href="#" id="save-public-cloud1">Save</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:50px;" class="roundedButton publish-public-cloud" href="#" id="publish-public-cloud1">Publish</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:2%;" class="roundedButton publish-public-cloud" href="#" id="publish-public-cloud1">Publish</a>
<% if CurrentPublicCloud %>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:50px;" class="roundedButton addDeploymentBtn" target="_blank" href="$Top.Link(public_cloud)/$CurrentPublicCloud.ID/<% if CurrentPublicCloud.isDraft %>draft_<% end_if %>preview">Preview</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:2%;" class="roundedButton addDeploymentBtn preview-public_cloud" href="#" >Preview</a>
<% end_if %>
<% if CurrentPublicCloud %>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:50px;" class="roundedButton addDeploymentBtn" target="_blank" href="$Top.Link(public_cloud)/$CurrentPublicCloud.ID/<% if CurrentPublicCloud.isDraft %>draft_<% end_if %>pdf">Download PDF</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:2%;" class="roundedButton addDeploymentBtn preview-public_cloud pdf" href="#" >Download PDF</a>
<% end_if %>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:50px;" class="roundedButton addDeploymentBtn" href="$Top.Link(public_clouds)">&lt;&lt; Back to Products</a>
<a style="overflow:hidden;white-space: nowrap;font-weight:normal;float:right;margin-bottom:50px;text-align:center;margin-right:2%;" class="roundedButton addDeploymentBtn" href="$Top.Link(public_clouds)">&lt;&lt; Back to Products</a>
</div>
<% if CurrentPublicCloud.isNotPublished %>
<div style="clear:both; color:red">
THIS VERSION IS NOT CURRENTLY PUBLISHED
</div>
<% end_if %>
<div style="clear:both">
<fieldset>
<form id="public_cloud_form" name="public_cloud_form">
@ -37,6 +42,7 @@
<% end_if %>
var component_releases = $ReleasesByComponent;
var listing_url = "$Top.Link(public_clouds)";
var product_url = "$Top.Link(public_cloud)";
</script>
</div>
<% else %>