Skip to content
Permalink
Browse files

Merge branch 'hotfix-10.11.6' into stable

  • Loading branch information...
DominicWatson committed Nov 8, 2019
2 parents e102b19 + f5eec14 commit 0c356d8e6f325fc7b4e96ba0efab79f1e6b7edcd
@@ -34,7 +34,7 @@
"cbstorages":"1.3.0+14",
"cbjavaloader":"1.5.0+35",
"coldbox":"5.4.0",
"cfconcurrent":"2.1.2"
"cfconcurrent":"2.1.3"
},
"devDependencies":{
"testbox":"2.7.0"
@@ -1464,11 +1464,11 @@
return document.documentMode >= 8;
}
if (/iP(od|hone)/i.test(window.navigator.userAgent)) {
return false;
return true;
}
if (/Android/i.test(window.navigator.userAgent)) {
if (/Mobile/i.test(window.navigator.userAgent)) {
return false;
return true;
}
}
return true;
@@ -512,6 +512,23 @@ component {
, derivativeGenerator = "derivativeGeneratorService"
};

settings.heartbeats = {
defaultHostname = settings.env.DEFAULT_HEARTBEAT_HOSTNAME ?: cgi.server_name
, assetQueue = {}
, cacheBoxReap = {}
, healthCheck = {}
, adhocTask = {}
, taskmanager = {}
, emailQueue = {}
};

settings.heartbeats.assetQueue.hostname = settings.env.ASSETQUEUE_HEARTBEAT_HOSTNAME ?: settings.heartbeats.defaultHostname;
settings.heartbeats.adhocTask.hostname = settings.env.ADHOCTASK_HEARTBEAT_HOSTNAME ?: settings.heartbeats.defaultHostname;
settings.heartbeats.taskmanager.hostname = settings.env.TASKMANAGER_HEARTBEAT_HOSTNAME ?: settings.heartbeats.defaultHostname;
settings.heartbeats.emailQueue.hostname = settings.env.EMAILQUEUE_HEARTBEAT_HOSTNAME ?: settings.heartbeats.defaultHostname;
settings.heartbeats.cacheBoxReap.hostname = settings.env.CACHEBOXREAP_HEARTBEAT_HOSTNAME ?: settings.heartbeats.defaultHostname;
settings.heartbeats.healthCheck.hostname = settings.env.HEALTHCHECK_HEARTBEAT_HOSTNAME ?: settings.heartbeats.defaultHostname;

_loadConfigurationFromExtensions();

environments = {
@@ -15,10 +15,10 @@ it will be merged with this form definition.
<param name="regex" value="^[a-zA-Z][a-zA-Z0-9_]*$" />
</rule>
</field>
<field name="layout" control="formbuilderFieldLayoutPicker" required="true" sortorder="30" />
<field name="mandatory" control="yesnoswitch" required="false" sortorder="40" />
<field name="help" control="textarea" required="false" sortorder="50" />
<field name="export" control="yesnoswitch" sortorder="60" />
<field name="layout" control="formbuilderFieldLayoutPicker" required="true" sortorder="30" />
<field name="mandatory" control="yesnoswitch" required="false" sortorder="40" />
<field name="help" control="textarea" required="false" sortorder="50" />
<field name="exclude_export" control="yesnoswitch" sortorder="60" />
</fieldset>
</tab>
</form>
@@ -38,6 +38,9 @@ component extends="preside.system.base.AdminHandler" {
}

prc.rootFolderId = assetManagerService.getRootFolderId();
if ( Len( Trim( rc.asset_folder ?: "" ) ) ) {
rc.folder = rc.asset_folder;
}
if ( !Len( Trim( rc.folder ?: "" ) ) ) {
rc.folder = prc.rootFolderId;
}
@@ -923,6 +923,15 @@ component extends="preside.system.base.AdminHandler" {

public void function quickAddForm( event, rc, prc ) {
_checkPermission( argumentCollection=arguments, key="add" );

var object = prc.objectName ?: "";
if ( customizationService.objectHasCustomization( object, "preQuickAddRecordForm" ) ) {
customizationService.runCustomization(
objectName = object
, action = "preQuickAddRecordForm"
, args = {objectName = object}
);
}

event.setView( view="/admin/datamanager/quickAddForm", layout="adminModalDialog", args={
allowAddAnotherSwitch = IsTrue( rc.multiple ?: "" )
@@ -932,11 +941,19 @@ component extends="preside.system.base.AdminHandler" {
public void function quickAddRecordAction( event, rc, prc ) {
_checkPermission( argumentCollection=arguments, key="add" );

runEvent(
event = "admin.DataManager._quickAddRecordAction"
, prePostExempt = true
, private = true
);
if ( customizationService.objectHasCustomization( objectName, "quickAddRecordAction" ) ) {
customizationService.runCustomization(
objectName = objectName
, action = "quickAddRecordAction"
, args = { objectName=objectName }
);
} else {
runEvent(
event = "admin.DataManager._quickAddRecordAction"
, prePostExempt = true
, private = true
);
}
}

public void function superQuickAddAction( event, rc, prc ) {
@@ -954,17 +971,34 @@ component extends="preside.system.base.AdminHandler" {

prc.record = queryRowToStruct( prc.record );

var object = prc.objectName ?: "";
if ( customizationService.objectHasCustomization( object, "preQuickEditRecordForm" ) ) {
customizationService.runCustomization(
objectName = object
, action = "preQuickEditRecordForm"
, args = {objectName = object}
);
}

event.setView( view="/admin/datamanager/quickEditForm", layout="adminModalDialog" );
}

public void function quickEditRecordAction( event, rc, prc ) {
_checkPermission( argumentCollection=arguments, key="edit" );

runEvent(
event = "admin.DataManager._quickEditRecordAction"
, prePostExempt = true
, private = true
);
if ( customizationService.objectHasCustomization( objectName, "quickEditRecordAction" ) ) {
customizationService.runCustomization(
objectName = objectName
, action = "quickEditRecordAction"
, args = { objectName=objectName }
);
} else {
runEvent(
event = "admin.DataManager._quickEditRecordAction"
, prePostExempt = true
, private = true
);
}
}

public void function configuratorForm( event, rc, prc ) {
@@ -2172,6 +2206,14 @@ component extends="preside.system.base.AdminHandler" {
) {
var formData = event.getCollectionForForm( formName=arguments.formName, stripPermissionedFields=arguments.stripPermissionedFields, permissionContext=arguments.permissionContext, permissionContextKeys=arguments.permissionContextKeys );
var validationResult = validateForm( formName=arguments.formName, formData=formData, stripPermissionedFields=arguments.stripPermissionedFields, permissionContext=arguments.permissionContext, permissionContextKeys=arguments.permissionContextKeys );

if ( customizationService.objectHasCustomization( object, "preQuickAddRecordAction" ) ) {
customizationService.runCustomization(
objectName = object
, action = "preQuickAddRecordAction"
, args = {objectName = object,formData: formData}
);
}

if ( validationResult.validated() ) {
var obj = presideObjectService.getObject( object );
@@ -2187,6 +2229,14 @@ component extends="preside.system.base.AdminHandler" {
, validationResult = translateValidationMessages( validationResult )
});
}

if ( customizationService.objectHasCustomization( object, "postQuickAddRecordAction" ) ) {
customizationService.runCustomization(
objectName = object
, action = "postQuickAddRecordAction"
, args = {objectName = object,formData: formData,newId: newId ?: ''}
);
}
}

private void function _superQuickAddRecordAction(
@@ -2575,6 +2625,14 @@ component extends="preside.system.base.AdminHandler" {
var formData = event.getCollectionForForm( formName=arguments.formName, stripPermissionedFields=arguments.stripPermissionedFields, permissionContext=arguments.permissionContext, permissionContextKeys=arguments.permissionContextKeys );
var validationResult = "";

if ( customizationService.objectHasCustomization( object, "preQuickEditRecordAction" ) ) {
customizationService.runCustomization(
objectName = object
, action = "preQuickEditRecordAction"
, args = {objectName = object,formData: formData}
);
}

if ( presideObjectService.dataExists( objectName=arguments.object, filter={ id=id } ) ) {
formData.id = id;
validationResult = validateForm( formName=arguments.formName, formData=formData, stripPermissionedFields=arguments.stripPermissionedFields, permissionContext=arguments.permissionContext, permissionContextKeys=arguments.permissionContextKeys );
@@ -2592,6 +2650,14 @@ component extends="preside.system.base.AdminHandler" {
} else {
event.renderData( type="json", data={ success = false });
}

if ( customizationService.objectHasCustomization( object, "postQuickEditRecordAction" ) ) {
customizationService.runCustomization(
objectName = object
, action = "postQuickEditRecordAction"
, args = {objectName = object,formData: formData}
);
}
}

private void function _checkObjectExists(
@@ -16,7 +16,6 @@ component {
) {
var tmpFile = getTempFile( getTempDirectory(), "ExcelExport" );
var workbook = spreadsheetLib.new( xmlformat=true );
var headers = [];
var data = [];
var dataCols = [];
var row = 1;
@@ -48,7 +47,7 @@ component {

spreadsheetLib.formatRow( workbook, { bold=true }, 1 );
spreadsheetLib.addFreezePane( workbook, 0, 1 );
for( var i=1; i <= headers.len(); i++ ){
for( var i=1; i <= dataCols.len(); i++ ){
spreadsheetLib.autoSizeColumn( workbook, i );
}

@@ -0,0 +1,35 @@
component {

property name="presideObjectService" inject="presideObjectService";

public boolean function default( event, rc, prc, args={} ) {
return IsTrue( args.data ?: "" );
}

public string function admin( event, rc, prc, args={} ) {

var data = args.data ?: "";
var objectName = args.objectName ?: "";
var propertyName = args.propertyName ?: "";
var valueAttribute = "booleanBadgeUnknownValue";
var styleAttribute = "booleanBadgeUnknownStyle";

if ( IsBoolean( data ) ) {
valueAttribute = data ? "booleanBadgeTrueValue" : "booleanBadgeFalseValue";
styleAttribute = data ? "booleanBadgeTrueStyle" : "booleanBadgeFalseStyle";
}

var booleanBadgeValue = presideObjectService.getObjectPropertyAttribute( objectName=objectName, propertyName=propertyName, attributeName=valueAttribute );
booleanBadgeValue = translateResource( uri="preside-objects.#objectName#:field.#propertyName#.#valueAttribute#", defaultValue=booleanBadgeValue );

if ( isEmpty( booleanBadgeValue ) ) {
return "";
}

var booleanBadgeStyle = presideObjectService.getObjectPropertyAttribute( objectName=objectName, propertyName=propertyName, attributeName=styleAttribute, defaultValue="info" );
booleanBadgeStyle = translateResource( uri="preside-objects.#objectName#:field.#propertyName#.#styleAttribute#", defaultValue=booleanBadgeStyle );

return '<span class="badge badge-pill badge-#booleanBadgeStyle#">#booleanBadgeValue#</span>';
}

}
@@ -16,8 +16,8 @@ field.help.title=Help text
field.help.placeholder=e.g. a brief explanation to guide the user
field.help.help=Help text may appear in a tooltip and should contain brief help to allow the user to understand the purpose of the form field

field.export.title=Include in export
field.export.help=Whether or not the field will be export to Excel
field.exclude_export.title=Exclude from export
field.exclude_export.help=Exclude from exports to prevent sensitive data being downloaded from the central database

tab.default.title=Standard fields
validation.error.invalid.name.format=Invalid name format. Names must start with a letter and contain only letters, numbers or underscores (_).
@@ -37,3 +37,6 @@ field.activity_link_body.title=Activity link body
field.activity_code.title=Activity failure code
field.activity_reason.title=Activity failure reason
field.activity_date.title=Activity date

field.failed.booleanBadgeTrueValue=failed
field.failed.booleanBadgeTrueStyle=danger
@@ -22,7 +22,7 @@ component extends="preside.system.base.SystemPresideObject" {
property name="send_args" type="string" dbtype="text" autofilter=false;

property name="sent" type="boolean" dbtype="boolean" default=false indexes="sent,template_sent|2";
property name="failed" type="boolean" dbtype="boolean" default=false indexes="failed,template_failed|2";
property name="failed" type="boolean" dbtype="boolean" default=false indexes="failed,template_failed|2" renderer="booleanBadge";
property name="delivered" type="boolean" dbtype="boolean" default=false indexes="delivered,template_delivered|2";
property name="hard_bounced" type="boolean" dbtype="boolean" default=false indexes="hard_bounced,template_hard_bounced|2";
property name="opened" type="boolean" dbtype="boolean" default=false indexes="opened,template_opened|2";
@@ -55,6 +55,6 @@ component {
, "/preside/system/services/assetmanager/lib/xml-apis-ext-1.3.04.jar"
, "/preside/system/services/assetmanager/lib/xmlgraphics-commons-2.3.jar"
];
}S
}

}
@@ -8,25 +8,27 @@ component {
// CONSTRUCTOR
/**
* @scheduledThreadpoolExecutor.inject presideScheduledThreadpoolExecutor
*
*/
public any function init(
required string threadName
, required numeric intervalInMs
, required any scheduledThreadpoolExecutor
, string feature = ""
, string feature = ""
, string hostname = cgi.server_name
) {
_setThreadName( arguments.threadName );
_setIntervalInMs( arguments.intervalInMs );
_setScheduledThreadpoolExecutor( arguments.scheduledThreadpoolExecutor );
_setFeature( arguments.feature );
_setHostname( arguments.hostname );

return this;
}

public void function run() {
$getRequestContext().autoSetSiteByHost();
$run();
setLastRun();
}

public void function $run() {
@@ -51,11 +53,12 @@ component {
, initialDelay = 0
, period = _getIntervalInMs()
, timeUnit = tpe.getObjectFactory().MILLISECONDS
, hostname = _getHostname()
);

setStartTime();

$systemOutput( "Started #_getThreadName()# heartbeat." );
$systemOutput( "Started #_getThreadName()# heartbeat with hostname: #_getHostname()#" );

_setTaskFuture( taskFuture );
}
@@ -153,4 +156,11 @@ component {
private void function _setTaskFuture( required any taskFuture ) {
_taskFuture = arguments.taskFuture;
}

private string function _getHostname() {
return _hostname;
}
private void function _setHostname( required string hostname ) {
_hostname = arguments.hostname;
}
}
@@ -8,17 +8,20 @@ component extends="AbstractHeartBeat" {
/**
* @scheduledThreadpoolExecutor.inject presideScheduledThreadpoolExecutor
* @assetQueueService.inject presidecms:dynamicservice:assetQueue
* @hostname.inject coldbox:setting:heartbeats.assetqueue.hostname
*
*/
public function init(
required any scheduledThreadpoolExecutor
, required any assetQueueService
, required string hostname
, numeric instanceNumber = 1
, string threadName = "Preside Asset Queue Processor #arguments.instanceNumber#"
){
super.init(
threadName = arguments.threadName
, scheduledThreadpoolExecutor = arguments.scheduledThreadpoolExecutor
, hostname = arguments.hostname
, intervalInMs = 2000
, feature = "assetQueueHeartBeat"
);
@@ -38,8 +41,6 @@ component extends="AbstractHeartBeat" {
} catch( any e ) {
$raiseError( e );
}

setLastRun();
}

// GETTERS AND SETTERS

0 comments on commit 0c356d8

Please sign in to comment.
You can’t perform that action at this time.