$QSIFUNSET(id,Create,Edit) Promotion Group
Help
var prom = data;
var name = InitialCaps(data);
if (prom == 'YospacePromotion') {
prom = 'basic';
name = 'Basic';
} else if (prom == 'AdTechPromotion') {
prom = 'adt';
name = 'AdTech';
} else if (prom == 'DoubleClickPromotion') {
prom = 'dart';
name = 'Dart';
} else if (prom == 'GenericExternalPromotion') {
prom = 'ext';
name = 'External';
} else if (prom == 'LazyLoadExternalPromotion') {
prom = 'dyn';
name = 'dynamic';
} else if (prom == 'SCTE130Promotion') {
prom = 'scte';
name = 'scte130';
}
retval = Builder.node('div', {
className: 'typebutton ' + data.toLowerCase(),
title: name + " Promotion"
}, prom.toUpperCase());
var count = otherdata['impressionCount'];
if (count == null) {
count = '0';
}
var limit = otherdata['impressionLimit'];
if (limit == null) {
limit = 'Unlimited';
}
retval = [
count,
" / ",
limit
];
var prom = otherdata['type'];
if (prom == 'YospacePromotion') {
prom = 'basic'
} else if (prom == 'AdTechPromotion') {
prom = 'adtech'
} else if (prom == 'DoubleClickPromotion') {
prom = 'dart'
} else if (prom == 'GenericExternalPromotion') {
prom = 'external'
} else if (prom == 'LazyLoadExternalPromotion') {
prom = 'dynamic'
} else if (prom == 'SCTE130Promotion') {
prom = 'scte130';
}
retval = [
linkAction('Edit', 'edit_' + prom + '_promotion.html?id=' + data, 'Edit this promotion'),
' | ',
ajaxAction(
'Make Inactive',
'web/advert/promotion/setState',
{'id': data, 'active': 0},
'Make this promotion inactive'),
' | ',
linkAction('Duplicate', 'edit_' + prom + '_promotion.html?dup=1&id=' + data, 'Duplicate this Promotion'),
' | ',
functionAction('Export XML', function() {
if(!confirm('Export XML format of this promotion?')) { return; }
window.location.href = 'web/impex/promotionExport?fileFormat=XML&id=' + data;
}, "Export XML format of this promotion"),
'/',
functionAction('JSON', function() {
if(!confirm('Export JSON format of this promotion?')) { return; }
window.location.href = 'web/impex/promotionExport?fileFormat=JSON&id=' + data;
}, "Export JSON format of this promotion")
];
var prom = otherdata['type'];
if (prom == 'YospacePromotion') {
prom = 'basic'
} else if (prom == 'AdTechPromotion') {
prom = 'adtech'
} else if (prom == 'DoubleClickPromotion') {
prom = 'dart'
} else if (prom == 'GenericExternalPromotion') {
prom = 'external'
} else if (prom == 'LazyLoadExternalPromotion') {
prom = 'dynamic'
} else if (prom == 'SCTE130Promotion') {
prom = 'scte130';
}
retval = [
linkAction('Edit', 'edit_' + prom + '_promotion.html?id=' + data, 'Edit this promotion'),
' | ',
ajaxAction(
'Make Active',
'web/advert/promotion/setState',
{'id': data, 'active': 1},
'Make this promotion active'
),
' | ',
ajaxAction(
'Delete',
'web/advert/promotion/remove',
{'id': data},
'Delete this promotion', false, true),
' | ',
linkAction('Duplicate', 'edit_' + prom + '_promotion.html?dup=1&id=' + data, 'Duplicate this Promotion'),
' | ',
functionAction('Export XML', function() {
if(!confirm('Export XML format of this promotion?')) { return; }
window.location.href = 'web/impex/promotionExport?fileFormat=XML&id=' + data;
}, "Export XML format of this promotion"),
'/',
functionAction('JSON', function() {
if(!confirm('Export JSON format of this promotion?')) { return; }
window.location.href = 'web/impex/promotionExport?fileFormat=JSON&id=' + data;
}, "Export JSON format of this promotion")
];