正在显示
70 个修改的文件
包含
4614 行增加
和
0 行删除
| 1 | +/* | ||
| 2 | + * Activiti Modeler component part of the Activiti project | ||
| 3 | + * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. | ||
| 4 | + * | ||
| 5 | + * This library is free software; you can redistribute it and/or | ||
| 6 | + * modify it under the terms of the GNU Lesser General Public | ||
| 7 | + * License as published by the Free Software Foundation; either | ||
| 8 | + * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | + * | ||
| 10 | + * This library is distributed in the hope that it will be useful, | ||
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | + * Lesser General Public License for more details. | ||
| 14 | + | ||
| 15 | + * You should have received a copy of the GNU Lesser General Public | ||
| 16 | + * License along with this library; if not, write to the Free Software | ||
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | + */ | ||
| 19 | +'use strict'; | ||
| 20 | + | ||
| 21 | +var ACTIVITI = ACTIVITI || {}; | ||
| 22 | + | ||
| 23 | +ACTIVITI.CONFIG = { | ||
| 24 | + 'contextRoot' : appContextRoot+'/service', | ||
| 25 | +}; |
| 1 | +/* | ||
| 2 | + * Activiti Modeler component part of the Activiti project | ||
| 3 | + * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. | ||
| 4 | + * | ||
| 5 | + * This library is free software; you can redistribute it and/or | ||
| 6 | + * modify it under the terms of the GNU Lesser General Public | ||
| 7 | + * License as published by the Free Software Foundation; either | ||
| 8 | + * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | + * | ||
| 10 | + * This library is distributed in the hope that it will be useful, | ||
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | + * Lesser General Public License for more details. | ||
| 14 | + | ||
| 15 | + * You should have received a copy of the GNU Lesser General Public | ||
| 16 | + * License along with this library; if not, write to the Free Software | ||
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | + */ | ||
| 19 | +'use strict'; | ||
| 20 | + | ||
| 21 | +var activitiModeler = angular.module('activitiModeler', [ | ||
| 22 | + 'ngCookies', | ||
| 23 | + 'ngResource', | ||
| 24 | + 'ngSanitize', | ||
| 25 | + 'ngRoute', | ||
| 26 | + 'ngDragDrop', | ||
| 27 | + 'mgcrea.ngStrap', | ||
| 28 | + 'ngGrid', | ||
| 29 | + 'ngAnimate', | ||
| 30 | + 'pascalprecht.translate', | ||
| 31 | + 'duScroll' | ||
| 32 | +]); | ||
| 33 | + | ||
| 34 | +var activitiModule = activitiModeler; | ||
| 35 | + | ||
| 36 | +activitiModeler | ||
| 37 | + // Initialize routes | ||
| 38 | + .config(['$selectProvider', '$translateProvider', function ($selectProvider, $translateProvider) { | ||
| 39 | + | ||
| 40 | + // Override caret for bs-select directive | ||
| 41 | + angular.extend($selectProvider.defaults, { | ||
| 42 | + caretHtml: ' <i class="icon icon-caret-down"></i>' | ||
| 43 | + }); | ||
| 44 | + | ||
| 45 | + // Initialize angular-translate | ||
| 46 | + $translateProvider.useStaticFilesLoader({ | ||
| 47 | + prefix: './editor-app/i18n/', | ||
| 48 | + suffix: '.json' | ||
| 49 | + }); | ||
| 50 | + | ||
| 51 | + $translateProvider.preferredLanguage('en'); | ||
| 52 | + | ||
| 53 | + // remember language | ||
| 54 | + $translateProvider.useCookieStorage(); | ||
| 55 | + | ||
| 56 | + }]) | ||
| 57 | + .run(['$rootScope', '$timeout', '$modal', '$translate', '$location', '$window', '$http', '$q', | ||
| 58 | + function($rootScope, $timeout, $modal, $translate, $location, $window, $http, $q) { | ||
| 59 | + | ||
| 60 | + $rootScope.config = ACTIVITI.CONFIG; | ||
| 61 | + | ||
| 62 | + $rootScope.editorInitialized = false; | ||
| 63 | + | ||
| 64 | + $rootScope.editorFactory = $q.defer(); | ||
| 65 | + | ||
| 66 | + $rootScope.forceSelectionRefresh = false; | ||
| 67 | + | ||
| 68 | + $rootScope.ignoreChanges = false; // by default never ignore changes | ||
| 69 | + | ||
| 70 | + $rootScope.validationErrors = []; | ||
| 71 | + | ||
| 72 | + $rootScope.staticIncludeVersion = Date.now(); | ||
| 73 | + | ||
| 74 | + /** | ||
| 75 | + * A 'safer' apply that avoids concurrent updates (which $apply allows). | ||
| 76 | + */ | ||
| 77 | + $rootScope.safeApply = function(fn) { | ||
| 78 | + var phase = this.$root.$$phase; | ||
| 79 | + if(phase == '$apply' || phase == '$digest') { | ||
| 80 | + if(fn && (typeof(fn) === 'function')) { | ||
| 81 | + fn(); | ||
| 82 | + } | ||
| 83 | + } else { | ||
| 84 | + this.$apply(fn); | ||
| 85 | + } | ||
| 86 | + }; | ||
| 87 | + | ||
| 88 | + | ||
| 89 | + /** | ||
| 90 | + * Initialize the event bus: couple all Oryx events with a dispatch of the | ||
| 91 | + * event of the event bus. This way, it gets much easier to attach custom logic | ||
| 92 | + * to any event. | ||
| 93 | + */ | ||
| 94 | + | ||
| 95 | + /* Helper method to fetch model from server (always needed) */ | ||
| 96 | + function fetchModel(modelId) { | ||
| 97 | + | ||
| 98 | + var modelUrl = KISBPM.URL.getModel(modelId); | ||
| 99 | + | ||
| 100 | + $http({method: 'GET', url: modelUrl}). | ||
| 101 | + success(function (data, status, headers, config) { | ||
| 102 | + $rootScope.editor = new ORYX.Editor(data); | ||
| 103 | + $rootScope.modelData = angular.fromJson(data); | ||
| 104 | + $rootScope.editorFactory.resolve(); | ||
| 105 | + }). | ||
| 106 | + error(function (data, status, headers, config) { | ||
| 107 | + console.log('Error loading model with id ' + modelId + ' ' + data); | ||
| 108 | + }); | ||
| 109 | + } | ||
| 110 | + | ||
| 111 | + | ||
| 112 | + function initScrollHandling() { | ||
| 113 | + var canvasSection = jQuery('#canvasSection'); | ||
| 114 | + canvasSection.scroll(function() { | ||
| 115 | + | ||
| 116 | + // Hides the resizer and quick menu items during scrolling | ||
| 117 | + | ||
| 118 | + var selectedElements = $rootScope.editor.selection; | ||
| 119 | + var subSelectionElements = $rootScope.editor._subSelection; | ||
| 120 | + | ||
| 121 | + $rootScope.selectedElements = selectedElements; | ||
| 122 | + $rootScope.subSelectionElements = subSelectionElements; | ||
| 123 | + if (selectedElements && selectedElements.length > 0) { | ||
| 124 | + $rootScope.selectedElementBeforeScrolling = selectedElements[0]; | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + jQuery('.Oryx_button').each(function(i, obj) { | ||
| 128 | + $rootScope.orginalOryxButtonStyle = obj.style.display; | ||
| 129 | + obj.style.display = 'none'; | ||
| 130 | + }); | ||
| 131 | + | ||
| 132 | + jQuery('.resizer_southeast').each(function(i, obj) { | ||
| 133 | + $rootScope.orginalResizerSEStyle = obj.style.display; | ||
| 134 | + obj.style.display = 'none'; | ||
| 135 | + }); | ||
| 136 | + jQuery('.resizer_northwest').each(function(i, obj) { | ||
| 137 | + $rootScope.orginalResizerNWStyle = obj.style.display; | ||
| 138 | + obj.style.display = 'none'; | ||
| 139 | + }); | ||
| 140 | + $rootScope.editor.handleEvents({type:ORYX.CONFIG.EVENT_CANVAS_SCROLL}); | ||
| 141 | + }); | ||
| 142 | + | ||
| 143 | + canvasSection.scrollStopped(function(){ | ||
| 144 | + | ||
| 145 | + // Puts the quick menu items and resizer back when scroll is stopped. | ||
| 146 | + | ||
| 147 | + $rootScope.editor.setSelection([]); // needed cause it checks for element changes and does nothing if the elements are the same | ||
| 148 | + $rootScope.editor.setSelection($rootScope.selectedElements, $rootScope.subSelectionElements); | ||
| 149 | + $rootScope.selectedElements = undefined; | ||
| 150 | + $rootScope.subSelectionElements = undefined; | ||
| 151 | + | ||
| 152 | + function handleDisplayProperty(obj) { | ||
| 153 | + if (jQuery(obj).position().top > 0) { | ||
| 154 | + obj.style.display = 'block'; | ||
| 155 | + } else { | ||
| 156 | + obj.style.display = 'none'; | ||
| 157 | + } | ||
| 158 | + } | ||
| 159 | + | ||
| 160 | + jQuery('.Oryx_button').each(function(i, obj) { | ||
| 161 | + handleDisplayProperty(obj); | ||
| 162 | + }); | ||
| 163 | + | ||
| 164 | + jQuery('.resizer_southeast').each(function(i, obj) { | ||
| 165 | + handleDisplayProperty(obj); | ||
| 166 | + }); | ||
| 167 | + jQuery('.resizer_northwest').each(function(i, obj) { | ||
| 168 | + handleDisplayProperty(obj); | ||
| 169 | + }); | ||
| 170 | + | ||
| 171 | + }); | ||
| 172 | + } | ||
| 173 | + | ||
| 174 | + /** | ||
| 175 | + * Initialize the Oryx Editor when the content has been loaded | ||
| 176 | + */ | ||
| 177 | + $rootScope.$on('$includeContentLoaded', function (event) { | ||
| 178 | + if (!$rootScope.editorInitialized) { | ||
| 179 | + | ||
| 180 | + ORYX._loadPlugins(); | ||
| 181 | + | ||
| 182 | + var modelId = EDITOR.UTIL.getParameterByName('modelId'); | ||
| 183 | + fetchModel(modelId); | ||
| 184 | + | ||
| 185 | + $rootScope.window = {}; | ||
| 186 | + var updateWindowSize = function() { | ||
| 187 | + $rootScope.window.width = $window.innerWidth; | ||
| 188 | + $rootScope.window.height = $window.innerHeight; | ||
| 189 | + }; | ||
| 190 | + | ||
| 191 | + // Window resize hook | ||
| 192 | + angular.element($window).bind('resize', function() { | ||
| 193 | + $rootScope.safeApply(updateWindowSize()); | ||
| 194 | + }); | ||
| 195 | + | ||
| 196 | + $rootScope.$watch('window.forceRefresh', function(newValue) { | ||
| 197 | + if(newValue) { | ||
| 198 | + $timeout(function() { | ||
| 199 | + updateWindowSize(); | ||
| 200 | + $rootScope.window.forceRefresh = false; | ||
| 201 | + }); | ||
| 202 | + } | ||
| 203 | + }); | ||
| 204 | + | ||
| 205 | + updateWindowSize(); | ||
| 206 | + | ||
| 207 | + // Hook in resizing of main panels when window resizes | ||
| 208 | + // TODO: perhaps move to a separate JS-file? | ||
| 209 | + jQuery(window).resize(function () { | ||
| 210 | + | ||
| 211 | + // Calculate the offset based on the bottom of the module header | ||
| 212 | + var offset = jQuery("#editor-header").offset(); | ||
| 213 | + var propSectionHeight = jQuery('#propertySection').height(); | ||
| 214 | + var canvas = jQuery('#canvasSection'); | ||
| 215 | + var mainHeader = jQuery('#main-header'); | ||
| 216 | + | ||
| 217 | + if (offset == undefined || offset === null | ||
| 218 | + || propSectionHeight === undefined || propSectionHeight === null | ||
| 219 | + || canvas === undefined || canvas === null || mainHeader === null) { | ||
| 220 | + return; | ||
| 221 | + } | ||
| 222 | + | ||
| 223 | + if ($rootScope.editor) | ||
| 224 | + { | ||
| 225 | + var selectedElements = $rootScope.editor.selection; | ||
| 226 | + var subSelectionElements = $rootScope.editor._subSelection; | ||
| 227 | + | ||
| 228 | + $rootScope.selectedElements = selectedElements; | ||
| 229 | + $rootScope.subSelectionElements = subSelectionElements; | ||
| 230 | + if (selectedElements && selectedElements.length > 0) | ||
| 231 | + { | ||
| 232 | + $rootScope.selectedElementBeforeScrolling = selectedElements[0]; | ||
| 233 | + | ||
| 234 | + $rootScope.editor.setSelection([]); // needed cause it checks for element changes and does nothing if the elements are the same | ||
| 235 | + $rootScope.editor.setSelection($rootScope.selectedElements, $rootScope.subSelectionElements); | ||
| 236 | + $rootScope.selectedElements = undefined; | ||
| 237 | + $rootScope.subSelectionElements = undefined; | ||
| 238 | + } | ||
| 239 | + } | ||
| 240 | + | ||
| 241 | +// var totalAvailable = jQuery(window).height() - offset.top - mainHeader.height() - 21; | ||
| 242 | + var totalAvailable = jQuery(window).height() - offset.top - mainHeader.height() - 42; // 隐藏顶部标题栏,调整下fix参数 ThinkGem | ||
| 243 | + canvas.height(totalAvailable - propSectionHeight); | ||
| 244 | + jQuery('#paletteSection').height(totalAvailable); | ||
| 245 | + | ||
| 246 | + // Update positions of the resize-markers, according to the canvas | ||
| 247 | + | ||
| 248 | + var actualCanvas = null; | ||
| 249 | + if (canvas && canvas[0].children[1]) { | ||
| 250 | + actualCanvas = canvas[0].children[1]; | ||
| 251 | + } | ||
| 252 | + | ||
| 253 | + var canvasTop = canvas.position().top; | ||
| 254 | + var canvasLeft = canvas.position().left; | ||
| 255 | + var canvasHeight = canvas[0].clientHeight; | ||
| 256 | + var canvasWidth = canvas[0].clientWidth; | ||
| 257 | + var iconCenterOffset = 8; | ||
| 258 | + var widthDiff = 0; | ||
| 259 | + | ||
| 260 | + var actualWidth = 0; | ||
| 261 | + if(actualCanvas) { | ||
| 262 | + // In some browsers, the SVG-element clientwidth isn't available, so we revert to the parent | ||
| 263 | + actualWidth = actualCanvas.clientWidth || actualCanvas.parentNode.clientWidth; | ||
| 264 | + } | ||
| 265 | + | ||
| 266 | + | ||
| 267 | + if(actualWidth < canvas[0].clientWidth) { | ||
| 268 | + widthDiff = actualWidth - canvas[0].clientWidth; | ||
| 269 | + // In case the canvas is smaller than the actual viewport, the resizers should be moved | ||
| 270 | + canvasLeft -= widthDiff / 2; | ||
| 271 | + canvasWidth += widthDiff; | ||
| 272 | + } | ||
| 273 | + | ||
| 274 | + var iconWidth = 17; | ||
| 275 | + var iconOffset = 20; | ||
| 276 | + | ||
| 277 | + var north = jQuery('#canvas-grow-N'); | ||
| 278 | + north.css('top', canvasTop + iconOffset + 'px'); | ||
| 279 | + north.css('left', canvasLeft - 10 + (canvasWidth - iconWidth) / 2 + 'px'); | ||
| 280 | + | ||
| 281 | + var south = jQuery('#canvas-grow-S'); | ||
| 282 | + south.css('top', (canvasTop + canvasHeight - iconOffset - iconCenterOffset) + 'px'); | ||
| 283 | + south.css('left', canvasLeft - 10 + (canvasWidth - iconWidth) / 2 + 'px'); | ||
| 284 | + | ||
| 285 | + var east = jQuery('#canvas-grow-E'); | ||
| 286 | + east.css('top', canvasTop - 10 + (canvasHeight - iconWidth) / 2 + 'px'); | ||
| 287 | + east.css('left', (canvasLeft + canvasWidth - iconOffset - iconCenterOffset) + 'px'); | ||
| 288 | + | ||
| 289 | + var west = jQuery('#canvas-grow-W'); | ||
| 290 | + west.css('top', canvasTop -10 + (canvasHeight - iconWidth) / 2 + 'px'); | ||
| 291 | + west.css('left', canvasLeft + iconOffset + 'px'); | ||
| 292 | + | ||
| 293 | + north = jQuery('#canvas-shrink-N'); | ||
| 294 | + north.css('top', canvasTop + iconOffset + 'px'); | ||
| 295 | + north.css('left', canvasLeft + 10 + (canvasWidth - iconWidth) / 2 + 'px'); | ||
| 296 | + | ||
| 297 | + south = jQuery('#canvas-shrink-S'); | ||
| 298 | + south.css('top', (canvasTop + canvasHeight - iconOffset - iconCenterOffset) + 'px'); | ||
| 299 | + south.css('left', canvasLeft +10 + (canvasWidth - iconWidth) / 2 + 'px'); | ||
| 300 | + | ||
| 301 | + east = jQuery('#canvas-shrink-E'); | ||
| 302 | + east.css('top', canvasTop + 10 + (canvasHeight - iconWidth) / 2 + 'px'); | ||
| 303 | + east.css('left', (canvasLeft + canvasWidth - iconOffset - iconCenterOffset) + 'px'); | ||
| 304 | + | ||
| 305 | + west = jQuery('#canvas-shrink-W'); | ||
| 306 | + west.css('top', canvasTop + 10 + (canvasHeight - iconWidth) / 2 + 'px'); | ||
| 307 | + west.css('left', canvasLeft + iconOffset + 'px'); | ||
| 308 | + }); | ||
| 309 | + | ||
| 310 | + jQuery(window).trigger('resize'); | ||
| 311 | + | ||
| 312 | + jQuery.fn.scrollStopped = function(callback) { | ||
| 313 | + jQuery(this).scroll(function(){ | ||
| 314 | + var self = this, $this = jQuery(self); | ||
| 315 | + if ($this.data('scrollTimeout')) { | ||
| 316 | + clearTimeout($this.data('scrollTimeout')); | ||
| 317 | + } | ||
| 318 | + $this.data('scrollTimeout', setTimeout(callback,50,self)); | ||
| 319 | + }); | ||
| 320 | + }; | ||
| 321 | + | ||
| 322 | + // Always needed, cause the DOM element on which the scroll event listeners are attached are changed for every new model | ||
| 323 | + initScrollHandling(); | ||
| 324 | + | ||
| 325 | + $rootScope.editorInitialized = true; | ||
| 326 | + } | ||
| 327 | + }); | ||
| 328 | + | ||
| 329 | + /** | ||
| 330 | + * Initialize the event bus: couple all Oryx events with a dispatch of the | ||
| 331 | + * event of the event bus. This way, it gets much easier to attach custom logic | ||
| 332 | + * to any event. | ||
| 333 | + */ | ||
| 334 | + | ||
| 335 | + $rootScope.editorFactory.promise.then(function() { | ||
| 336 | + | ||
| 337 | + KISBPM.eventBus.editor = $rootScope.editor; | ||
| 338 | + | ||
| 339 | + var eventMappings = [ | ||
| 340 | + { oryxType : ORYX.CONFIG.EVENT_SELECTION_CHANGED, kisBpmType : KISBPM.eventBus.EVENT_TYPE_SELECTION_CHANGE }, | ||
| 341 | + { oryxType : ORYX.CONFIG.EVENT_DBLCLICK, kisBpmType : KISBPM.eventBus.EVENT_TYPE_DOUBLE_CLICK }, | ||
| 342 | + { oryxType : ORYX.CONFIG.EVENT_MOUSEOUT, kisBpmType : KISBPM.eventBus.EVENT_TYPE_MOUSE_OUT }, | ||
| 343 | + { oryxType : ORYX.CONFIG.EVENT_MOUSEOVER, kisBpmType : KISBPM.eventBus.EVENT_TYPE_MOUSE_OVER } | ||
| 344 | + | ||
| 345 | + ]; | ||
| 346 | + | ||
| 347 | + eventMappings.forEach(function(eventMapping) { | ||
| 348 | + $rootScope.editor.registerOnEvent(eventMapping.oryxType, function(event) { | ||
| 349 | + KISBPM.eventBus.dispatch(eventMapping.kisBpmType, event); | ||
| 350 | + }); | ||
| 351 | + }); | ||
| 352 | + | ||
| 353 | + $rootScope.editor.registerOnEvent(ORYX.CONFIG.EVENT_SHAPEREMOVED, function (event) { | ||
| 354 | + var validateButton = document.getElementById(event.shape.resourceId + "-validate-button"); | ||
| 355 | + if (validateButton) | ||
| 356 | + { | ||
| 357 | + validateButton.style.display = 'none'; | ||
| 358 | + } | ||
| 359 | + }); | ||
| 360 | + | ||
| 361 | + // The Oryx canvas is ready (we know since we're in this promise callback) and the | ||
| 362 | + // event bus is ready. The editor is now ready for use | ||
| 363 | + KISBPM.eventBus.dispatch(KISBPM.eventBus.EVENT_TYPE_EDITOR_READY, {type : KISBPM.eventBus.EVENT_TYPE_EDITOR_READY}); | ||
| 364 | + | ||
| 365 | + }); | ||
| 366 | + | ||
| 367 | + // Alerts | ||
| 368 | + $rootScope.alerts = { | ||
| 369 | + queue: [] | ||
| 370 | + }; | ||
| 371 | + | ||
| 372 | + $rootScope.showAlert = function(alert) { | ||
| 373 | + if(alert.queue.length > 0) { | ||
| 374 | + alert.current = alert.queue.shift(); | ||
| 375 | + // Start timout for message-pruning | ||
| 376 | + alert.timeout = $timeout(function() { | ||
| 377 | + if (alert.queue.length == 0) { | ||
| 378 | + alert.current = undefined; | ||
| 379 | + alert.timeout = undefined; | ||
| 380 | + } else { | ||
| 381 | + $rootScope.showAlert(alert); | ||
| 382 | + } | ||
| 383 | + }, (alert.current.type == 'error' ? 5000 : 1000)); | ||
| 384 | + } else { | ||
| 385 | + $rootScope.alerts.current = undefined; | ||
| 386 | + } | ||
| 387 | + }; | ||
| 388 | + | ||
| 389 | + $rootScope.addAlert = function(message, type) { | ||
| 390 | + var newAlert = {message: message, type: type}; | ||
| 391 | + if (!$rootScope.alerts.timeout) { | ||
| 392 | + // Timeout for message queue is not running, start one | ||
| 393 | + $rootScope.alerts.queue.push(newAlert); | ||
| 394 | + $rootScope.showAlert($rootScope.alerts); | ||
| 395 | + } else { | ||
| 396 | + $rootScope.alerts.queue.push(newAlert); | ||
| 397 | + } | ||
| 398 | + }; | ||
| 399 | + | ||
| 400 | + $rootScope.dismissAlert = function() { | ||
| 401 | + if (!$rootScope.alerts.timeout) { | ||
| 402 | + $rootScope.alerts.current = undefined; | ||
| 403 | + } else { | ||
| 404 | + $timeout.cancel($rootScope.alerts.timeout); | ||
| 405 | + $rootScope.alerts.timeout = undefined; | ||
| 406 | + $rootScope.showAlert($rootScope.alerts); | ||
| 407 | + } | ||
| 408 | + }; | ||
| 409 | + | ||
| 410 | + $rootScope.addAlertPromise = function(promise, type) { | ||
| 411 | + if (promise) { | ||
| 412 | + promise.then(function(data) { | ||
| 413 | + $rootScope.addAlert(data, type); | ||
| 414 | + }); | ||
| 415 | + } | ||
| 416 | + }; | ||
| 417 | + | ||
| 418 | + } | ||
| 419 | + ]) | ||
| 420 | + | ||
| 421 | + // Moment-JS date-formatting filter | ||
| 422 | + .filter('dateformat', function() { | ||
| 423 | + return function(date, format) { | ||
| 424 | + if (date) { | ||
| 425 | + if (format) { | ||
| 426 | + return moment(date).format(format); | ||
| 427 | + } else { | ||
| 428 | + return moment(date).calendar(); | ||
| 429 | + } | ||
| 430 | + } | ||
| 431 | + return ''; | ||
| 432 | + }; | ||
| 433 | + }); |
src/main/webapp/act/process-editor/editor-app/configuration/properties-assignment-controller.js
0 → 100644
| 1 | +/* | ||
| 2 | + * Activiti Modeler component part of the Activiti project | ||
| 3 | + * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. | ||
| 4 | + * | ||
| 5 | + * This library is free software; you can redistribute it and/or | ||
| 6 | + * modify it under the terms of the GNU Lesser General Public | ||
| 7 | + * License as published by the Free Software Foundation; either | ||
| 8 | + * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | + * | ||
| 10 | + * This library is distributed in the hope that it will be useful, | ||
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | + * Lesser General Public License for more details. | ||
| 14 | + | ||
| 15 | + * You should have received a copy of the GNU Lesser General Public | ||
| 16 | + * License along with this library; if not, write to the Free Software | ||
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | + */ | ||
| 19 | + | ||
| 20 | +/* | ||
| 21 | + * Assignment | ||
| 22 | + */ | ||
| 23 | +var KisBpmAssignmentCtrl = [ '$scope', '$modal', function($scope, $modal) { | ||
| 24 | + | ||
| 25 | + // Config for the modal window | ||
| 26 | + var opts = { | ||
| 27 | + template: 'editor-app/configuration/properties/assignment-popup.html?version=' + Date.now(), | ||
| 28 | + scope: $scope | ||
| 29 | + }; | ||
| 30 | + | ||
| 31 | + // Open the dialog | ||
| 32 | + $modal(opts); | ||
| 33 | +}]; | ||
| 34 | + | ||
| 35 | +var KisBpmAssignmentPopupCtrl = [ '$scope', function($scope) { | ||
| 36 | + | ||
| 37 | + // Put json representing assignment on scope | ||
| 38 | + if ($scope.property.value !== undefined && $scope.property.value !== null | ||
| 39 | + && $scope.property.value.assignment !== undefined | ||
| 40 | + && $scope.property.value.assignment !== null) | ||
| 41 | + { | ||
| 42 | + $scope.assignment = $scope.property.value.assignment; | ||
| 43 | + } else { | ||
| 44 | + $scope.assignment = {}; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + if ($scope.assignment.candidateUsers == undefined || $scope.assignment.candidateUsers.length == 0) | ||
| 48 | + { | ||
| 49 | + $scope.assignment.candidateUsers = [{value: ''}]; | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + // Click handler for + button after enum value | ||
| 53 | + var userValueIndex = 1; | ||
| 54 | + $scope.addCandidateUserValue = function(index) { | ||
| 55 | + $scope.assignment.candidateUsers.splice(index + 1, 0, {value: 'value ' + userValueIndex++}); | ||
| 56 | + }; | ||
| 57 | + | ||
| 58 | + // Click handler for - button after enum value | ||
| 59 | + $scope.removeCandidateUserValue = function(index) { | ||
| 60 | + $scope.assignment.candidateUsers.splice(index, 1); | ||
| 61 | + }; | ||
| 62 | + | ||
| 63 | + if ($scope.assignment.candidateGroups == undefined || $scope.assignment.candidateGroups.length == 0) | ||
| 64 | + { | ||
| 65 | + $scope.assignment.candidateGroups = [{value: ''}]; | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + var groupValueIndex = 1; | ||
| 69 | + $scope.addCandidateGroupValue = function(index) { | ||
| 70 | + $scope.assignment.candidateGroups.splice(index + 1, 0, {value: 'value ' + groupValueIndex++}); | ||
| 71 | + }; | ||
| 72 | + | ||
| 73 | + // Click handler for - button after enum value | ||
| 74 | + $scope.removeCandidateGroupValue = function(index) { | ||
| 75 | + $scope.assignment.candidateGroups.splice(index, 1); | ||
| 76 | + }; | ||
| 77 | + | ||
| 78 | + $scope.save = function() { | ||
| 79 | + | ||
| 80 | + $scope.property.value = {}; | ||
| 81 | + handleAssignmentInput($scope); | ||
| 82 | + $scope.property.value.assignment = $scope.assignment; | ||
| 83 | + | ||
| 84 | + $scope.updatePropertyInModel($scope.property); | ||
| 85 | + $scope.close(); | ||
| 86 | + }; | ||
| 87 | + | ||
| 88 | + // Close button handler | ||
| 89 | + $scope.close = function() { | ||
| 90 | + handleAssignmentInput($scope); | ||
| 91 | + $scope.property.mode = 'read'; | ||
| 92 | + $scope.$hide(); | ||
| 93 | + }; | ||
| 94 | + | ||
| 95 | + var handleAssignmentInput = function($scope) { | ||
| 96 | + if ($scope.assignment.candidateUsers) | ||
| 97 | + { | ||
| 98 | + var emptyUsers = true; | ||
| 99 | + var toRemoveIndexes = []; | ||
| 100 | + for (var i = 0; i < $scope.assignment.candidateUsers.length; i++) | ||
| 101 | + { | ||
| 102 | + if ($scope.assignment.candidateUsers[i].value != '') | ||
| 103 | + { | ||
| 104 | + emptyUsers = false; | ||
| 105 | + } | ||
| 106 | + else | ||
| 107 | + { | ||
| 108 | + toRemoveIndexes[toRemoveIndexes.length] = i; | ||
| 109 | + } | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + for (var i = 0; i < toRemoveIndexes.length; i++) | ||
| 113 | + { | ||
| 114 | + $scope.assignment.candidateUsers.splice(toRemoveIndexes[i], 1); | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + if (emptyUsers) | ||
| 118 | + { | ||
| 119 | + $scope.assignment.candidateUsers = undefined; | ||
| 120 | + } | ||
| 121 | + } | ||
| 122 | + | ||
| 123 | + if ($scope.assignment.candidateGroups) | ||
| 124 | + { | ||
| 125 | + var emptyGroups = true; | ||
| 126 | + var toRemoveIndexes = []; | ||
| 127 | + for (var i = 0; i < $scope.assignment.candidateGroups.length; i++) | ||
| 128 | + { | ||
| 129 | + if ($scope.assignment.candidateGroups[i].value != '') | ||
| 130 | + { | ||
| 131 | + emptyGroups = false; | ||
| 132 | + } | ||
| 133 | + else | ||
| 134 | + { | ||
| 135 | + toRemoveIndexes[toRemoveIndexes.length] = i; | ||
| 136 | + } | ||
| 137 | + } | ||
| 138 | + | ||
| 139 | + for (var i = 0; i < toRemoveIndexes.length; i++) | ||
| 140 | + { | ||
| 141 | + $scope.assignment.candidateGroups.splice(toRemoveIndexes[i], 1); | ||
| 142 | + } | ||
| 143 | + | ||
| 144 | + if (emptyGroups) | ||
| 145 | + { | ||
| 146 | + $scope.assignment.candidateGroups = undefined; | ||
| 147 | + } | ||
| 148 | + } | ||
| 149 | + }; | ||
| 150 | +}]; |
| 1 | +/* | ||
| 2 | + * Activiti Modeler component part of the Activiti project | ||
| 3 | + * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. | ||
| 4 | + * | ||
| 5 | + * This library is free software; you can redistribute it and/or | ||
| 6 | + * modify it under the terms of the GNU Lesser General Public | ||
| 7 | + * License as published by the Free Software Foundation; either | ||
| 8 | + * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | + * | ||
| 10 | + * This library is distributed in the hope that it will be useful, | ||
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | + * Lesser General Public License for more details. | ||
| 14 | + | ||
| 15 | + * You should have received a copy of the GNU Lesser General Public | ||
| 16 | + * License along with this library; if not, write to the Free Software | ||
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | + */ | ||
| 19 | + | ||
| 20 | +/* | ||
| 21 | + * Condition expression | ||
| 22 | + */ | ||
| 23 | + | ||
| 24 | +var KisBpmConditionExpressionCtrl = [ '$scope', '$modal', function($scope, $modal) { | ||
| 25 | + | ||
| 26 | + // Config for the modal window | ||
| 27 | + var opts = { | ||
| 28 | + template: 'editor-app/configuration/properties/condition-expression-popup.html?version=' + Date.now(), | ||
| 29 | + scope: $scope | ||
| 30 | + }; | ||
| 31 | + | ||
| 32 | + // Open the dialog | ||
| 33 | + $modal(opts); | ||
| 34 | +}]; | ||
| 35 | + | ||
| 36 | +var KisBpmConditionExpressionPopupCtrl = [ '$scope', '$translate', '$http', function($scope, $translate, $http) { | ||
| 37 | + | ||
| 38 | + // Put json representing condition on scope | ||
| 39 | + if ($scope.property.value !== undefined && $scope.property.value !== null) { | ||
| 40 | + | ||
| 41 | + $scope.conditionExpression = {value: $scope.property.value}; | ||
| 42 | + | ||
| 43 | + } else { | ||
| 44 | + $scope.conditionExpression = {value: ''}; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + $scope.save = function() { | ||
| 48 | + $scope.property.value = $scope.conditionExpression.value; | ||
| 49 | + $scope.updatePropertyInModel($scope.property); | ||
| 50 | + $scope.close(); | ||
| 51 | + }; | ||
| 52 | + | ||
| 53 | + // Close button handler | ||
| 54 | + $scope.close = function() { | ||
| 55 | + $scope.property.mode = 'read'; | ||
| 56 | + $scope.$hide(); | ||
| 57 | + }; | ||
| 58 | +}]; |
src/main/webapp/act/process-editor/editor-app/configuration/properties-custom-controllers.js
0 → 100644
| 1 | +/* | ||
| 2 | + * Activiti Modeler component part of the Activiti project | ||
| 3 | + * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. | ||
| 4 | + * | ||
| 5 | + * This library is free software; you can redistribute it and/or | ||
| 6 | + * modify it under the terms of the GNU Lesser General Public | ||
| 7 | + * License as published by the Free Software Foundation; either | ||
| 8 | + * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | + * | ||
| 10 | + * This library is distributed in the hope that it will be useful, | ||
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | + * Lesser General Public License for more details. | ||
| 14 | + | ||
| 15 | + * You should have received a copy of the GNU Lesser General Public | ||
| 16 | + * License along with this library; if not, write to the Free Software | ||
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | + */ |
src/main/webapp/act/process-editor/editor-app/configuration/properties-default-controllers.js
0 → 100644
| 1 | +/* | ||
| 2 | + * Activiti Modeler component part of the Activiti project | ||
| 3 | + * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. | ||
| 4 | + * | ||
| 5 | + * This library is free software; you can redistribute it and/or | ||
| 6 | + * modify it under the terms of the GNU Lesser General Public | ||
| 7 | + * License as published by the Free Software Foundation; either | ||
| 8 | + * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | + * | ||
| 10 | + * This library is distributed in the hope that it will be useful, | ||
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | + * Lesser General Public License for more details. | ||
| 14 | + | ||
| 15 | + * You should have received a copy of the GNU Lesser General Public | ||
| 16 | + * License along with this library; if not, write to the Free Software | ||
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | + */ | ||
| 19 | + | ||
| 20 | +/* | ||
| 21 | + * String controller | ||
| 22 | + */ | ||
| 23 | + | ||
| 24 | +var KisBpmStringPropertyCtrl = [ '$scope', function ($scope) { | ||
| 25 | + | ||
| 26 | + $scope.shapeId = $scope.selectedShape.id; | ||
| 27 | + $scope.valueFlushed = false; | ||
| 28 | + /** Handler called when input field is blurred */ | ||
| 29 | + $scope.inputBlurred = function() { | ||
| 30 | + $scope.valueFlushed = true; | ||
| 31 | + if ($scope.property.value) { | ||
| 32 | + $scope.property.value = $scope.property.value.replace(/(<([^>]+)>)/ig,""); | ||
| 33 | + } | ||
| 34 | + $scope.updatePropertyInModel($scope.property); | ||
| 35 | + }; | ||
| 36 | + | ||
| 37 | + $scope.enterPressed = function(keyEvent) { | ||
| 38 | + if (keyEvent && keyEvent.which === 13) { | ||
| 39 | + keyEvent.preventDefault(); | ||
| 40 | + $scope.inputBlurred(); // we want to do the same as if the user would blur the input field | ||
| 41 | + } | ||
| 42 | + }; | ||
| 43 | + | ||
| 44 | + $scope.$on('$destroy', function controllerDestroyed() { | ||
| 45 | + if(!$scope.valueFlushed) { | ||
| 46 | + if ($scope.property.value) { | ||
| 47 | + $scope.property.value = $scope.property.value.replace(/(<([^>]+)>)/ig,""); | ||
| 48 | + } | ||
| 49 | + $scope.updatePropertyInModel($scope.property, $scope.shapeId); | ||
| 50 | + } | ||
| 51 | + }); | ||
| 52 | + | ||
| 53 | +}]; | ||
| 54 | + | ||
| 55 | +/* | ||
| 56 | + * Boolean controller | ||
| 57 | + */ | ||
| 58 | + | ||
| 59 | +var KisBpmBooleanPropertyCtrl = ['$scope', function ($scope) { | ||
| 60 | + | ||
| 61 | + $scope.changeValue = function() { | ||
| 62 | + if ($scope.property.key === 'oryx-defaultflow' && $scope.property.value) { | ||
| 63 | + var selectedShape = $scope.selectedShape; | ||
| 64 | + if (selectedShape) { | ||
| 65 | + var incomingNodes = selectedShape.getIncomingShapes(); | ||
| 66 | + if (incomingNodes && incomingNodes.length > 0) { | ||
| 67 | + // get first node, since there can be only one for a sequence flow | ||
| 68 | + var rootNode = incomingNodes[0]; | ||
| 69 | + var flows = rootNode.getOutgoingShapes(); | ||
| 70 | + if (flows && flows.length > 1) { | ||
| 71 | + // in case there are more flows, check if another flow is already defined as default | ||
| 72 | + for (var i = 0; i < flows.length; i++) { | ||
| 73 | + if (flows[i].resourceId != selectedShape.resourceId) { | ||
| 74 | + var defaultFlowProp = flows[i].properties['oryx-defaultflow']; | ||
| 75 | + if (defaultFlowProp) { | ||
| 76 | + flows[i].setProperty('oryx-defaultflow', false, true); | ||
| 77 | + } | ||
| 78 | + } | ||
| 79 | + } | ||
| 80 | + } | ||
| 81 | + } | ||
| 82 | + } | ||
| 83 | + } | ||
| 84 | + $scope.updatePropertyInModel($scope.property); | ||
| 85 | + }; | ||
| 86 | + | ||
| 87 | +}]; | ||
| 88 | + | ||
| 89 | +/* | ||
| 90 | + * Text controller | ||
| 91 | + */ | ||
| 92 | + | ||
| 93 | +var KisBpmTextPropertyCtrl = [ '$scope', '$modal', function($scope, $modal) { | ||
| 94 | + | ||
| 95 | + var opts = { | ||
| 96 | + template: 'editor-app/configuration/properties/text-popup.html?version=' + Date.now(), | ||
| 97 | + scope: $scope | ||
| 98 | + }; | ||
| 99 | + | ||
| 100 | + // Open the dialog | ||
| 101 | + $modal(opts); | ||
| 102 | +}]; | ||
| 103 | + | ||
| 104 | +var KisBpmTextPropertyPopupCtrl = ['$scope', function($scope) { | ||
| 105 | + | ||
| 106 | + $scope.save = function() { | ||
| 107 | + $scope.updatePropertyInModel($scope.property); | ||
| 108 | + $scope.close(); | ||
| 109 | + }; | ||
| 110 | + | ||
| 111 | + $scope.close = function() { | ||
| 112 | + $scope.property.mode = 'read'; | ||
| 113 | + $scope.$hide(); | ||
| 114 | + }; | ||
| 115 | +}]; |
src/main/webapp/act/process-editor/editor-app/configuration/properties-event-listeners-controller.js
0 → 100644
| 1 | +/* | ||
| 2 | + * Activiti Modeler component part of the Activiti project | ||
| 3 | + * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. | ||
| 4 | + * | ||
| 5 | + * This library is free software; you can redistribute it and/or | ||
| 6 | + * modify it under the terms of the GNU Lesser General Public | ||
| 7 | + * License as published by the Free Software Foundation; either | ||
| 8 | + * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | + * | ||
| 10 | + * This library is distributed in the hope that it will be useful, | ||
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | + * Lesser General Public License for more details. | ||
| 14 | + | ||
| 15 | + * You should have received a copy of the GNU Lesser General Public | ||
| 16 | + * License along with this library; if not, write to the Free Software | ||
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | + */ | ||
| 19 | + | ||
| 20 | +/* | ||
| 21 | + * Execution listeners | ||
| 22 | + */ | ||
| 23 | + | ||
| 24 | +var KisBpmEventListenersCtrl = [ '$scope', '$modal', '$timeout', '$translate', function($scope, $modal, $timeout, $translate) { | ||
| 25 | + | ||
| 26 | + // Config for the modal window | ||
| 27 | + var opts = { | ||
| 28 | + template: 'editor-app/configuration/properties/event-listeners-popup.html?version=' + Date.now(), | ||
| 29 | + scope: $scope | ||
| 30 | + }; | ||
| 31 | + | ||
| 32 | + // Open the dialog | ||
| 33 | + $modal(opts); | ||
| 34 | +}]; | ||
| 35 | + | ||
| 36 | +//Need a separate controller for the modal window due to https://github.com/angular-ui/bootstrap/issues/259 | ||
| 37 | +// Will be fixed in a newer version of Angular UI | ||
| 38 | +var KisBpmEventListenersPopupCtrl = [ '$scope', '$q', '$translate', function($scope, $q, $translate) { | ||
| 39 | + | ||
| 40 | + // Put json representing form properties on scope | ||
| 41 | + if ($scope.property.value !== undefined && $scope.property.value !== null | ||
| 42 | + && $scope.property.value.eventListeners !== undefined | ||
| 43 | + && $scope.property.value.eventListeners !== null) { | ||
| 44 | + | ||
| 45 | + if ($scope.property.value.eventListeners.constructor == String) | ||
| 46 | + { | ||
| 47 | + $scope.eventListeners = JSON.parse($scope.property.value.eventListeners); | ||
| 48 | + } | ||
| 49 | + else | ||
| 50 | + { | ||
| 51 | + // Note that we clone the json object rather then setting it directly, | ||
| 52 | + // this to cope with the fact that the user can click the cancel button and no changes should have happened | ||
| 53 | + $scope.eventListeners = angular.copy($scope.property.value.eventListeners); | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + } else { | ||
| 57 | + $scope.eventListeners = []; | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + // Array to contain selected properties (yes - we only can select one, but ng-grid isn't smart enough) | ||
| 61 | + $scope.selectedListeners = []; | ||
| 62 | + $scope.translationsRetrieved = false; | ||
| 63 | + | ||
| 64 | + $scope.labels = {}; | ||
| 65 | + | ||
| 66 | + var eventPromise = $translate('PROPERTY.EXECUTIONLISTENERS.EVENT'); | ||
| 67 | + var implementationPromise = $translate('PROPERTY.EXECUTIONLISTENERS.FIELDS.IMPLEMENTATION'); | ||
| 68 | + var namePromise = $translate('PROPERTY.EXECUTIONLISTENERS.FIELDS.NAME'); | ||
| 69 | + | ||
| 70 | + $q.all([eventPromise, implementationPromise, namePromise]).then(function(results) { | ||
| 71 | + $scope.labels.eventLabel = results[0]; | ||
| 72 | + $scope.labels.implementationLabel = results[1]; | ||
| 73 | + $scope.labels.nameLabel = results[2]; | ||
| 74 | + $scope.translationsRetrieved = true; | ||
| 75 | + | ||
| 76 | + // Config for grid | ||
| 77 | + $scope.gridOptions = { | ||
| 78 | + data: 'eventListeners', | ||
| 79 | + enableRowReordering: true, | ||
| 80 | + headerRowHeight: 28, | ||
| 81 | + multiSelect: false, | ||
| 82 | + keepLastSelected : false, | ||
| 83 | + selectedItems: $scope.selectedListeners, | ||
| 84 | + afterSelectionChange: function (rowItem, event) { | ||
| 85 | + | ||
| 86 | + if ($scope.selectedListeners.length > 0) | ||
| 87 | + { | ||
| 88 | + var fields = $scope.selectedListeners[0].fields; | ||
| 89 | + if (fields !== undefined && fields !== null) | ||
| 90 | + { | ||
| 91 | + for (var i = 0; i < fields.length; i++) | ||
| 92 | + { | ||
| 93 | + var field = fields[i]; | ||
| 94 | + if (field.stringValue !== undefined && field.stringValue !== '') | ||
| 95 | + { | ||
| 96 | + field.implementation = field.stringValue; | ||
| 97 | + } | ||
| 98 | + else if (field.expression !== undefined && field.expression !== '') | ||
| 99 | + { | ||
| 100 | + field.implementation = field.expression; | ||
| 101 | + } | ||
| 102 | + else if (field.string !== undefined && field.string !== '') | ||
| 103 | + { | ||
| 104 | + field.implementation = field.string; | ||
| 105 | + } | ||
| 106 | + } | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + if (!$scope.selectedListeners[0].events || $scope.selectedListeners[0].events.length == 0) | ||
| 110 | + { | ||
| 111 | + $scope.selectedListeners[0].events = [{event: ''}]; | ||
| 112 | + } | ||
| 113 | + } | ||
| 114 | + }, | ||
| 115 | + columnDefs: [{ field: 'event', displayName: $scope.labels.eventLabel }, | ||
| 116 | + { field: 'implementation', displayName: $scope.labels.implementationLabel }] | ||
| 117 | + }; | ||
| 118 | + }); | ||
| 119 | + | ||
| 120 | + // Click handler for + button after enum value | ||
| 121 | + $scope.addEventValue = function(index) { | ||
| 122 | + $scope.selectedListeners[0].events.splice(index + 1, 0, {event: ''}); | ||
| 123 | + }; | ||
| 124 | + | ||
| 125 | + // Click handler for - button after enum value | ||
| 126 | + $scope.removeEventValue = function(index) { | ||
| 127 | + $scope.selectedListeners[0].events.splice(index, 1); | ||
| 128 | + $scope.listenerDetailsChanged(); | ||
| 129 | + }; | ||
| 130 | + | ||
| 131 | + $scope.listenerDetailsChanged = function() { | ||
| 132 | + var listener = $scope.selectedListeners[0]; | ||
| 133 | + if (listener.events) | ||
| 134 | + { | ||
| 135 | + var eventText = ''; | ||
| 136 | + for (var i = 0; i < listener.events.length; i++) | ||
| 137 | + { | ||
| 138 | + if (i > 0) | ||
| 139 | + { | ||
| 140 | + eventText += ", "; | ||
| 141 | + } | ||
| 142 | + eventText += listener.events[i].event; | ||
| 143 | + } | ||
| 144 | + $scope.selectedListeners[0].event = eventText; | ||
| 145 | + } | ||
| 146 | + | ||
| 147 | + if (listener.rethrowEvent) | ||
| 148 | + { | ||
| 149 | + var implementationText = ''; | ||
| 150 | + if (listener.rethrowType && listener.rethrowType.length > 0) | ||
| 151 | + { | ||
| 152 | + if (listener.rethrowType === 'error' && listener.errorcode !== '') | ||
| 153 | + { | ||
| 154 | + implementationText = "Rethrow as error " + listener.errorcode; | ||
| 155 | + } | ||
| 156 | + else if (listener.rethrowType === 'message' && listener.messagename !== '') | ||
| 157 | + { | ||
| 158 | + implementationText = "Rethrow as message " + listener.messagename; | ||
| 159 | + } | ||
| 160 | + else if ((listener.rethrowType === 'signal' || listener.rethrowType === 'globalSignal') && listener.signalname !== '') | ||
| 161 | + { | ||
| 162 | + implementationText = "Rethrow as signal " + listener.signalname; | ||
| 163 | + } | ||
| 164 | + } | ||
| 165 | + $scope.selectedListeners[0].implementation = implementationText; | ||
| 166 | + } | ||
| 167 | + else | ||
| 168 | + { | ||
| 169 | + if ($scope.selectedListeners[0].className !== '') | ||
| 170 | + { | ||
| 171 | + $scope.selectedListeners[0].implementation = $scope.selectedListeners[0].className; | ||
| 172 | + } | ||
| 173 | + else if ($scope.selectedListeners[0].delegateExpression !== '') | ||
| 174 | + { | ||
| 175 | + $scope.selectedListeners[0].implementation = $scope.selectedListeners[0].delegateExpression; | ||
| 176 | + } | ||
| 177 | + else | ||
| 178 | + { | ||
| 179 | + $scope.selectedListeners[0].implementation = ''; | ||
| 180 | + } | ||
| 181 | + } | ||
| 182 | + }; | ||
| 183 | + | ||
| 184 | + // Click handler for add button | ||
| 185 | + $scope.addNewListener = function() { | ||
| 186 | + $scope.eventListeners.push({ event : '', | ||
| 187 | + implementation : '', | ||
| 188 | + className : '', | ||
| 189 | + delegateExpression: '', | ||
| 190 | + retrowEvent: false}); | ||
| 191 | + }; | ||
| 192 | + | ||
| 193 | + // Click handler for remove button | ||
| 194 | + $scope.removeListener = function() { | ||
| 195 | + if ($scope.selectedListeners.length > 0) { | ||
| 196 | + var index = $scope.eventListeners.indexOf($scope.selectedListeners[0]); | ||
| 197 | + $scope.gridOptions.selectItem(index, false); | ||
| 198 | + $scope.eventListeners.splice(index, 1); | ||
| 199 | + | ||
| 200 | + $scope.selectedListeners.length = 0; | ||
| 201 | + if (index < $scope.eventListeners.length) { | ||
| 202 | + $scope.gridOptions.selectItem(index + 1, true); | ||
| 203 | + } else if ($scope.eventListeners.length > 0) { | ||
| 204 | + $scope.gridOptions.selectItem(index - 1, true); | ||
| 205 | + } | ||
| 206 | + } | ||
| 207 | + }; | ||
| 208 | + | ||
| 209 | + // Click handler for up button | ||
| 210 | + $scope.moveListenerUp = function() { | ||
| 211 | + if ($scope.selectedListeners.length > 0) { | ||
| 212 | + var index = $scope.eventListeners.indexOf($scope.selectedListeners[0]); | ||
| 213 | + if (index != 0) { // If it's the first, no moving up of course | ||
| 214 | + // Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272 | ||
| 215 | + var temp = $scope.eventListeners[index]; | ||
| 216 | + $scope.eventListeners.splice(index, 1); | ||
| 217 | + $timeout(function(){ | ||
| 218 | + $scope.eventListeners.splice(index + -1, 0, temp); | ||
| 219 | + }, 100); | ||
| 220 | + | ||
| 221 | + } | ||
| 222 | + } | ||
| 223 | + }; | ||
| 224 | + | ||
| 225 | + // Click handler for down button | ||
| 226 | + $scope.moveListenerDown = function() { | ||
| 227 | + if ($scope.selectedListeners.length > 0) { | ||
| 228 | + var index = $scope.eventListeners.indexOf($scope.selectedListeners[0]); | ||
| 229 | + if (index != $scope.eventListeners.length - 1) { // If it's the last element, no moving down of course | ||
| 230 | + // Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272 | ||
| 231 | + var temp = $scope.eventListeners[index]; | ||
| 232 | + $scope.eventListeners.splice(index, 1); | ||
| 233 | + $timeout(function(){ | ||
| 234 | + $scope.eventListeners.splice(index + 1, 0, temp); | ||
| 235 | + }, 100); | ||
| 236 | + | ||
| 237 | + } | ||
| 238 | + } | ||
| 239 | + }; | ||
| 240 | + | ||
| 241 | + // Click handler for save button | ||
| 242 | + $scope.save = function() { | ||
| 243 | + | ||
| 244 | + if ($scope.eventListeners.length > 0) { | ||
| 245 | + $scope.property.value = {}; | ||
| 246 | + $scope.property.value.eventListeners = $scope.eventListeners; | ||
| 247 | + } else { | ||
| 248 | + $scope.property.value = null; | ||
| 249 | + } | ||
| 250 | + | ||
| 251 | + $scope.updatePropertyInModel($scope.property); | ||
| 252 | + $scope.close(); | ||
| 253 | + }; | ||
| 254 | + | ||
| 255 | + $scope.cancel = function() { | ||
| 256 | + $scope.property.mode = 'read'; | ||
| 257 | + $scope.$hide(); | ||
| 258 | + }; | ||
| 259 | + | ||
| 260 | + // Close button handler | ||
| 261 | + $scope.close = function() { | ||
| 262 | + $scope.property.mode = 'read'; | ||
| 263 | + $scope.$hide(); | ||
| 264 | + }; | ||
| 265 | + | ||
| 266 | +}]; |
| 1 | +/* | ||
| 2 | + * Activiti Modeler component part of the Activiti project | ||
| 3 | + * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. | ||
| 4 | + * | ||
| 5 | + * This library is free software; you can redistribute it and/or | ||
| 6 | + * modify it under the terms of the GNU Lesser General Public | ||
| 7 | + * License as published by the Free Software Foundation; either | ||
| 8 | + * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | + * | ||
| 10 | + * This library is distributed in the hope that it will be useful, | ||
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | + * Lesser General Public License for more details. | ||
| 14 | + | ||
| 15 | + * You should have received a copy of the GNU Lesser General Public | ||
| 16 | + * License along with this library; if not, write to the Free Software | ||
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | + */ | ||
| 19 | + | ||
| 20 | +/* | ||
| 21 | + * Execution listeners | ||
| 22 | + */ | ||
| 23 | + | ||
| 24 | +var KisBpmExecutionListenersCtrl = [ '$scope', '$modal', '$timeout', '$translate', function($scope, $modal, $timeout, $translate) { | ||
| 25 | + | ||
| 26 | + // Config for the modal window | ||
| 27 | + var opts = { | ||
| 28 | + template: 'editor-app/configuration/properties/execution-listeners-popup.html?version=' + Date.now(), | ||
| 29 | + scope: $scope | ||
| 30 | + }; | ||
| 31 | + | ||
| 32 | + // Open the dialog | ||
| 33 | + $modal(opts); | ||
| 34 | +}]; | ||
| 35 | + | ||
| 36 | +var KisBpmExecutionListenersPopupCtrl = [ '$scope', '$q', '$translate', function($scope, $q, $translate) { | ||
| 37 | + | ||
| 38 | + // Put json representing form properties on scope | ||
| 39 | + if ($scope.property.value !== undefined && $scope.property.value !== null | ||
| 40 | + && $scope.property.value.executionListeners !== undefined | ||
| 41 | + && $scope.property.value.executionListeners !== null) { | ||
| 42 | + | ||
| 43 | + if ($scope.property.value.executionListeners.constructor == String) | ||
| 44 | + { | ||
| 45 | + $scope.executionListeners = JSON.parse($scope.property.value.executionListeners); | ||
| 46 | + } | ||
| 47 | + else | ||
| 48 | + { | ||
| 49 | + // Note that we clone the json object rather then setting it directly, | ||
| 50 | + // this to cope with the fact that the user can click the cancel button and no changes should have happened | ||
| 51 | + $scope.executionListeners = angular.copy($scope.property.value.executionListeners); | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + for (var i = 0; i < $scope.executionListeners.length; i++) | ||
| 55 | + { | ||
| 56 | + var executionListener = $scope.executionListeners[i]; | ||
| 57 | + if (executionListener.className !== undefined && executionListener.className !== '') | ||
| 58 | + { | ||
| 59 | + executionListener.implementation = executionListener.className; | ||
| 60 | + } | ||
| 61 | + else if (executionListener.expression !== undefined && executionListener.expression !== '') | ||
| 62 | + { | ||
| 63 | + executionListener.implementation = executionListener.expression; | ||
| 64 | + } | ||
| 65 | + else if (executionListener.delegateExpression !== undefined && executionListener.delegateExpression !== '') | ||
| 66 | + { | ||
| 67 | + executionListener.implementation = executionListener.delegateExpression; | ||
| 68 | + } | ||
| 69 | + } | ||
| 70 | + } else { | ||
| 71 | + $scope.executionListeners = []; | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + // Array to contain selected properties (yes - we only can select one, but ng-grid isn't smart enough) | ||
| 75 | + $scope.selectedListeners = []; | ||
| 76 | + $scope.selectedFields = []; | ||
| 77 | + $scope.translationsRetrieved = false; | ||
| 78 | + | ||
| 79 | + $scope.labels = {}; | ||
| 80 | + | ||
| 81 | + var eventPromise = $translate('PROPERTY.EXECUTIONLISTENERS.EVENT'); | ||
| 82 | + var implementationPromise = $translate('PROPERTY.EXECUTIONLISTENERS.FIELDS.IMPLEMENTATION'); | ||
| 83 | + var namePromise = $translate('PROPERTY.EXECUTIONLISTENERS.FIELDS.NAME'); | ||
| 84 | + | ||
| 85 | + $q.all([eventPromise, implementationPromise, namePromise]).then(function(results) { | ||
| 86 | + $scope.labels.eventLabel = results[0]; | ||
| 87 | + $scope.labels.implementationLabel = results[1]; | ||
| 88 | + $scope.labels.nameLabel = results[2]; | ||
| 89 | + $scope.translationsRetrieved = true; | ||
| 90 | + | ||
| 91 | + // Config for grid | ||
| 92 | + $scope.gridOptions = { | ||
| 93 | + data: 'executionListeners', | ||
| 94 | + enableRowReordering: true, | ||
| 95 | + headerRowHeight: 28, | ||
| 96 | + multiSelect: false, | ||
| 97 | + keepLastSelected : false, | ||
| 98 | + selectedItems: $scope.selectedListeners, | ||
| 99 | + afterSelectionChange: function (rowItem, event) { | ||
| 100 | + $scope.selectedFields.length = 0; | ||
| 101 | + if ($scope.selectedListeners.length > 0) | ||
| 102 | + { | ||
| 103 | + var fields = $scope.selectedListeners[0].fields; | ||
| 104 | + if (fields !== undefined && fields !== null) | ||
| 105 | + { | ||
| 106 | + for (var i = 0; i < fields.length; i++) | ||
| 107 | + { | ||
| 108 | + var field = fields[i]; | ||
| 109 | + if (field.stringValue !== undefined && field.stringValue !== '') | ||
| 110 | + { | ||
| 111 | + field.implementation = field.stringValue; | ||
| 112 | + } | ||
| 113 | + else if (field.expression !== undefined && field.expression !== '') | ||
| 114 | + { | ||
| 115 | + field.implementation = field.expression; | ||
| 116 | + } | ||
| 117 | + else if (field.string !== undefined && field.string !== '') | ||
| 118 | + { | ||
| 119 | + field.implementation = field.string; | ||
| 120 | + } | ||
| 121 | + } | ||
| 122 | + } | ||
| 123 | + } | ||
| 124 | + }, | ||
| 125 | + columnDefs: [{ field: 'event', displayName: $scope.labels.eventLabel }, | ||
| 126 | + { field: 'implementation', displayName: $scope.labels.implementationLabel }] | ||
| 127 | + }; | ||
| 128 | + | ||
| 129 | + // Config for field grid | ||
| 130 | + $scope.gridFieldOptions = { | ||
| 131 | + data: 'selectedListeners[0].fields', | ||
| 132 | + enableRowReordering: true, | ||
| 133 | + headerRowHeight: 28, | ||
| 134 | + multiSelect: false, | ||
| 135 | + keepLastSelected : false, | ||
| 136 | + selectedItems: $scope.selectedFields, | ||
| 137 | + columnDefs: [{ field: 'name', displayName: $scope.labels.nameLabel }, | ||
| 138 | + { field: 'implementation', displayName: $scope.labels.implementationLabel}] | ||
| 139 | + }; | ||
| 140 | + }); | ||
| 141 | + | ||
| 142 | + $scope.listenerDetailsChanged = function() { | ||
| 143 | + if ($scope.selectedListeners[0].className !== '') | ||
| 144 | + { | ||
| 145 | + $scope.selectedListeners[0].implementation = $scope.selectedListeners[0].className; | ||
| 146 | + } | ||
| 147 | + else if ($scope.selectedListeners[0].expression !== '') | ||
| 148 | + { | ||
| 149 | + $scope.selectedListeners[0].implementation = $scope.selectedListeners[0].expression; | ||
| 150 | + } | ||
| 151 | + else if ($scope.selectedListeners[0].delegateExpression !== '') | ||
| 152 | + { | ||
| 153 | + $scope.selectedListeners[0].implementation = $scope.selectedListeners[0].delegateExpression; | ||
| 154 | + } | ||
| 155 | + else | ||
| 156 | + { | ||
| 157 | + $scope.selectedListeners[0].implementation = ''; | ||
| 158 | + } | ||
| 159 | + }; | ||
| 160 | + | ||
| 161 | + // Click handler for add button | ||
| 162 | + $scope.addNewListener = function() { | ||
| 163 | + $scope.executionListeners.push({ event : 'start', | ||
| 164 | + implementation : '', | ||
| 165 | + className : '', | ||
| 166 | + expression: '', | ||
| 167 | + delegateExpression: ''}); | ||
| 168 | + }; | ||
| 169 | + | ||
| 170 | + // Click handler for remove button | ||
| 171 | + $scope.removeListener = function() { | ||
| 172 | + if ($scope.selectedListeners.length > 0) { | ||
| 173 | + var index = $scope.executionListeners.indexOf($scope.selectedListeners[0]); | ||
| 174 | + $scope.gridOptions.selectItem(index, false); | ||
| 175 | + $scope.executionListeners.splice(index, 1); | ||
| 176 | + | ||
| 177 | + $scope.selectedListeners.length = 0; | ||
| 178 | + if (index < $scope.executionListeners.length) { | ||
| 179 | + $scope.gridOptions.selectItem(index + 1, true); | ||
| 180 | + } else if ($scope.executionListeners.length > 0) { | ||
| 181 | + $scope.gridOptions.selectItem(index - 1, true); | ||
| 182 | + } | ||
| 183 | + } | ||
| 184 | + }; | ||
| 185 | + | ||
| 186 | + // Click handler for up button | ||
| 187 | + $scope.moveListenerUp = function() { | ||
| 188 | + if ($scope.selectedListeners.length > 0) { | ||
| 189 | + var index = $scope.executionListeners.indexOf($scope.selectedListeners[0]); | ||
| 190 | + if (index != 0) { // If it's the first, no moving up of course | ||
| 191 | + // Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272 | ||
| 192 | + var temp = $scope.executionListeners[index]; | ||
| 193 | + $scope.executionListeners.splice(index, 1); | ||
| 194 | + $timeout(function(){ | ||
| 195 | + $scope.executionListeners.splice(index + -1, 0, temp); | ||
| 196 | + }, 100); | ||
| 197 | + | ||
| 198 | + } | ||
| 199 | + } | ||
| 200 | + }; | ||
| 201 | + | ||
| 202 | + // Click handler for down button | ||
| 203 | + $scope.moveListenerDown = function() { | ||
| 204 | + if ($scope.selectedListeners.length > 0) { | ||
| 205 | + var index = $scope.executionListeners.indexOf($scope.selectedListeners[0]); | ||
| 206 | + if (index != $scope.executionListeners.length - 1) { // If it's the last element, no moving down of course | ||
| 207 | + // Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272 | ||
| 208 | + var temp = $scope.executionListeners[index]; | ||
| 209 | + $scope.executionListeners.splice(index, 1); | ||
| 210 | + $timeout(function(){ | ||
| 211 | + $scope.executionListeners.splice(index + 1, 0, temp); | ||
| 212 | + }, 100); | ||
| 213 | + | ||
| 214 | + } | ||
| 215 | + } | ||
| 216 | + }; | ||
| 217 | + | ||
| 218 | + $scope.fieldDetailsChanged = function() { | ||
| 219 | + if ($scope.selectedFields[0].stringValue !== '') | ||
| 220 | + { | ||
| 221 | + $scope.selectedFields[0].implementation = $scope.selectedFields[0].stringValue; | ||
| 222 | + } | ||
| 223 | + else if ($scope.selectedFields[0].expression !== '') | ||
| 224 | + { | ||
| 225 | + $scope.selectedFields[0].implementation = $scope.selectedFields[0].expression; | ||
| 226 | + } | ||
| 227 | + else if ($scope.selectedFields[0].string !== '') | ||
| 228 | + { | ||
| 229 | + $scope.selectedFields[0].implementation = $scope.selectedFields[0].string; | ||
| 230 | + } | ||
| 231 | + else | ||
| 232 | + { | ||
| 233 | + $scope.selectedFields[0].implementation = ''; | ||
| 234 | + } | ||
| 235 | + }; | ||
| 236 | + | ||
| 237 | + // Click handler for add button | ||
| 238 | + $scope.addNewField = function() { | ||
| 239 | + if ($scope.selectedListeners.length > 0) | ||
| 240 | + { | ||
| 241 | + if ($scope.selectedListeners[0].fields == undefined) | ||
| 242 | + { | ||
| 243 | + $scope.selectedListeners[0].fields = []; | ||
| 244 | + } | ||
| 245 | + $scope.selectedListeners[0].fields.push({ name : 'fieldName', | ||
| 246 | + implementation : '', | ||
| 247 | + stringValue : '', | ||
| 248 | + expression: '', | ||
| 249 | + string: ''}); | ||
| 250 | + } | ||
| 251 | + }; | ||
| 252 | + | ||
| 253 | + // Click handler for remove button | ||
| 254 | + $scope.removeField = function() { | ||
| 255 | + if ($scope.selectedFields.length > 0) { | ||
| 256 | + var index = $scope.selectedListeners[0].fields.indexOf($scope.selectedFields[0]); | ||
| 257 | + $scope.gridFieldOptions.selectItem(index, false); | ||
| 258 | + $scope.selectedListeners[0].fields.splice(index, 1); | ||
| 259 | + | ||
| 260 | + $scope.selectedFields.length = 0; | ||
| 261 | + if (index < $scope.selectedListeners[0].fields.length) { | ||
| 262 | + $scope.gridFieldOptions.selectItem(index + 1, true); | ||
| 263 | + } else if ($scope.selectedListeners[0].fields.length > 0) { | ||
| 264 | + $scope.gridFieldOptions.selectItem(index - 1, true); | ||
| 265 | + } | ||
| 266 | + } | ||
| 267 | + }; | ||
| 268 | + | ||
| 269 | + // Click handler for up button | ||
| 270 | + $scope.moveFieldUp = function() { | ||
| 271 | + if ($scope.selectedFields.length > 0) { | ||
| 272 | + var index = $scope.selectedListeners[0].fields.indexOf($scope.selectedFields[0]); | ||
| 273 | + if (index != 0) { // If it's the first, no moving up of course | ||
| 274 | + // Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272 | ||
| 275 | + var temp = $scope.selectedListeners[0].fields[index]; | ||
| 276 | + $scope.selectedListeners[0].fields.splice(index, 1); | ||
| 277 | + $timeout(function(){ | ||
| 278 | + $scope.selectedListeners[0].fields.splice(index + -1, 0, temp); | ||
| 279 | + }, 100); | ||
| 280 | + | ||
| 281 | + } | ||
| 282 | + } | ||
| 283 | + }; | ||
| 284 | + | ||
| 285 | + // Click handler for down button | ||
| 286 | + $scope.moveFieldDown = function() { | ||
| 287 | + if ($scope.selectedFields.length > 0) { | ||
| 288 | + var index = $scope.selectedListeners[0].fields.indexOf($scope.selectedFields[0]); | ||
| 289 | + if (index != $scope.selectedListeners[0].fields.length - 1) { // If it's the last element, no moving down of course | ||
| 290 | + // Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272 | ||
| 291 | + var temp = $scope.selectedListeners[0].fields[index]; | ||
| 292 | + $scope.selectedListeners[0].fields.splice(index, 1); | ||
| 293 | + $timeout(function(){ | ||
| 294 | + $scope.selectedListeners[0].fields.splice(index + 1, 0, temp); | ||
| 295 | + }, 100); | ||
| 296 | + | ||
| 297 | + } | ||
| 298 | + } | ||
| 299 | + }; | ||
| 300 | + | ||
| 301 | + // Click handler for save button | ||
| 302 | + $scope.save = function() { | ||
| 303 | + | ||
| 304 | + if ($scope.executionListeners.length > 0) { | ||
| 305 | + $scope.property.value = {}; | ||
| 306 | + $scope.property.value.executionListeners = $scope.executionListeners; | ||
| 307 | + } else { | ||
| 308 | + $scope.property.value = null; | ||
| 309 | + } | ||
| 310 | + | ||
| 311 | + $scope.updatePropertyInModel($scope.property); | ||
| 312 | + $scope.close(); | ||
| 313 | + }; | ||
| 314 | + | ||
| 315 | + $scope.cancel = function() { | ||
| 316 | + $scope.$hide(); | ||
| 317 | + $scope.property.mode = 'read'; | ||
| 318 | + }; | ||
| 319 | + | ||
| 320 | + // Close button handler | ||
| 321 | + $scope.close = function() { | ||
| 322 | + $scope.$hide(); | ||
| 323 | + $scope.property.mode = 'read'; | ||
| 324 | + }; | ||
| 325 | + | ||
| 326 | +}]; |
src/main/webapp/act/process-editor/editor-app/configuration/properties-fields-controller.js
0 → 100644
| 1 | +/* | ||
| 2 | + * Activiti Modeler component part of the Activiti project | ||
| 3 | + * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. | ||
| 4 | + * | ||
| 5 | + * This library is free software; you can redistribute it and/or | ||
| 6 | + * modify it under the terms of the GNU Lesser General Public | ||
| 7 | + * License as published by the Free Software Foundation; either | ||
| 8 | + * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | + * | ||
| 10 | + * This library is distributed in the hope that it will be useful, | ||
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | + * Lesser General Public License for more details. | ||
| 14 | + | ||
| 15 | + * You should have received a copy of the GNU Lesser General Public | ||
| 16 | + * License along with this library; if not, write to the Free Software | ||
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | + */ | ||
| 19 | + | ||
| 20 | +/* | ||
| 21 | + * Task listeners | ||
| 22 | + */ | ||
| 23 | + | ||
| 24 | +var KisBpmFieldsCtrl = [ '$scope', '$modal', '$timeout', '$translate', function($scope, $modal, $timeout, $translate) { | ||
| 25 | + | ||
| 26 | + // Config for the modal window | ||
| 27 | + var opts = { | ||
| 28 | + template: 'editor-app/configuration/properties/fields-popup.html', | ||
| 29 | + scope: $scope | ||
| 30 | + }; | ||
| 31 | + | ||
| 32 | + // Open the dialog | ||
| 33 | + $modal(opts); | ||
| 34 | +}]; | ||
| 35 | + | ||
| 36 | +var KisBpmFieldsPopupCtrl = [ '$scope', '$q', '$translate', function($scope, $q, $translate) { | ||
| 37 | + | ||
| 38 | + // Put json representing form properties on scope | ||
| 39 | + if ($scope.property.value !== undefined && $scope.property.value !== null | ||
| 40 | + && $scope.property.value.fields !== undefined | ||
| 41 | + && $scope.property.value.fields !== null) { | ||
| 42 | + // Note that we clone the json object rather then setting it directly, | ||
| 43 | + // this to cope with the fact that the user can click the cancel button and no changes should have happened | ||
| 44 | + $scope.fields = angular.copy($scope.property.value.fields); | ||
| 45 | + | ||
| 46 | + for (var i = 0; i < $scope.fields.length; i++) | ||
| 47 | + { | ||
| 48 | + var field = $scope.fields[i]; | ||
| 49 | + if (field.stringValue !== undefined && field.stringValue !== '') | ||
| 50 | + { | ||
| 51 | + field.implementation = field.stringValue; | ||
| 52 | + } | ||
| 53 | + else if (field.expression !== undefined && field.expression !== '') | ||
| 54 | + { | ||
| 55 | + field.implementation = field.expression; | ||
| 56 | + } | ||
| 57 | + else if (field.string !== undefined && field.string !== '') | ||
| 58 | + { | ||
| 59 | + field.implementation = field.string; | ||
| 60 | + } | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + } else { | ||
| 64 | + $scope.fields = []; | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + // Array to contain selected properties (yes - we only can select one, but ng-grid isn't smart enough) | ||
| 68 | + $scope.selectedFields = []; | ||
| 69 | + $scope.translationsRetrieved = false; | ||
| 70 | + $scope.labels = {}; | ||
| 71 | + | ||
| 72 | + var namePromise = $translate('PROPERTY.FIELDS.NAME'); | ||
| 73 | + var implementationPromise = $translate('PROPERTY.FIELDS.IMPLEMENTATION'); | ||
| 74 | + | ||
| 75 | + $q.all([namePromise, implementationPromise]).then(function(results) { | ||
| 76 | + $scope.labels.nameLabel = results[0]; | ||
| 77 | + $scope.labels.implementationLabel = results[1]; | ||
| 78 | + $scope.translationsRetrieved = true; | ||
| 79 | + | ||
| 80 | + // Config for grid | ||
| 81 | + $scope.gridOptions = { | ||
| 82 | + data: 'fields', | ||
| 83 | + enableRowReordering: true, | ||
| 84 | + headerRowHeight: 28, | ||
| 85 | + multiSelect: false, | ||
| 86 | + keepLastSelected: false, | ||
| 87 | + selectedItems: $scope.selectedFields, | ||
| 88 | + columnDefs: [{field: 'name', displayName: $scope.labels.nameLabel}, | ||
| 89 | + {field: 'implementation', displayName: $scope.labels.implementationLabel}] | ||
| 90 | + }; | ||
| 91 | + }); | ||
| 92 | + | ||
| 93 | + $scope.fieldDetailsChanged = function() { | ||
| 94 | + if ($scope.selectedFields[0].stringValue != '') | ||
| 95 | + { | ||
| 96 | + $scope.selectedFields[0].implementation = $scope.selectedFields[0].stringValue; | ||
| 97 | + } | ||
| 98 | + else if ($scope.selectedFields[0].expression != '') | ||
| 99 | + { | ||
| 100 | + $scope.selectedFields[0].implementation = $scope.selectedFields[0].expression; | ||
| 101 | + } | ||
| 102 | + else if ($scope.selectedFields[0].string != '') | ||
| 103 | + { | ||
| 104 | + $scope.selectedFields[0].implementation = $scope.selectedFields[0].string; | ||
| 105 | + } | ||
| 106 | + else | ||
| 107 | + { | ||
| 108 | + $scope.selectedFields[0].implementation = ''; | ||
| 109 | + } | ||
| 110 | + }; | ||
| 111 | + | ||
| 112 | + // Click handler for add button | ||
| 113 | + $scope.addNewField = function() { | ||
| 114 | + $scope.fields.push({ name : 'fieldName', | ||
| 115 | + implementation : '', | ||
| 116 | + stringValue : '', | ||
| 117 | + expression: '', | ||
| 118 | + string: ''}); | ||
| 119 | + }; | ||
| 120 | + | ||
| 121 | + // Click handler for remove button | ||
| 122 | + $scope.removeField = function() { | ||
| 123 | + if ($scope.selectedFields.length > 0) { | ||
| 124 | + var index = $scope.fields.indexOf($scope.selectedFields[0]); | ||
| 125 | + $scope.gridOptions.selectItem(index, false); | ||
| 126 | + $scope.fields.splice(index, 1); | ||
| 127 | + | ||
| 128 | + $scope.selectedFields.length = 0; | ||
| 129 | + if (index < $scope.fields.length) { | ||
| 130 | + $scope.gridOptions.selectItem(index + 1, true); | ||
| 131 | + } else if ($scope.fields.length > 0) { | ||
| 132 | + $scope.gridOptions.selectItem(index - 1, true); | ||
| 133 | + } | ||
| 134 | + } | ||
| 135 | + }; | ||
| 136 | + | ||
| 137 | + // Click handler for up button | ||
| 138 | + $scope.moveFieldUp = function() { | ||
| 139 | + if ($scope.selectedFields.length > 0) { | ||
| 140 | + var index = $scope.fields.indexOf($scope.selectedFields[0]); | ||
| 141 | + if (index != 0) { // If it's the first, no moving up of course | ||
| 142 | + // Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272 | ||
| 143 | + var temp = $scope.fields[index]; | ||
| 144 | + $scope.fields.splice(index, 1); | ||
| 145 | + $timeout(function(){ | ||
| 146 | + $scope.fields.splice(index + -1, 0, temp); | ||
| 147 | + }, 100); | ||
| 148 | + | ||
| 149 | + } | ||
| 150 | + } | ||
| 151 | + }; | ||
| 152 | + | ||
| 153 | + // Click handler for down button | ||
| 154 | + $scope.moveFieldDown = function() { | ||
| 155 | + if ($scope.selectedFields.length > 0) { | ||
| 156 | + var index = $scope.fields.indexOf($scope.selectedFields[0]); | ||
| 157 | + if (index != $scope.fields.length - 1) { // If it's the last element, no moving down of course | ||
| 158 | + // Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272 | ||
| 159 | + var temp = $scope.fields[index]; | ||
| 160 | + $scope.fields.splice(index, 1); | ||
| 161 | + $timeout(function(){ | ||
| 162 | + $scope.fields.splice(index + 1, 0, temp); | ||
| 163 | + }, 100); | ||
| 164 | + | ||
| 165 | + } | ||
| 166 | + } | ||
| 167 | + }; | ||
| 168 | + | ||
| 169 | + // Click handler for save button | ||
| 170 | + $scope.save = function() { | ||
| 171 | + | ||
| 172 | + if ($scope.fields.length > 0) { | ||
| 173 | + $scope.property.value = {}; | ||
| 174 | + $scope.property.value.fields = $scope.fields; | ||
| 175 | + } else { | ||
| 176 | + $scope.property.value = null; | ||
| 177 | + } | ||
| 178 | + | ||
| 179 | + $scope.updatePropertyInModel($scope.property); | ||
| 180 | + $scope.close(); | ||
| 181 | + }; | ||
| 182 | + | ||
| 183 | + $scope.cancel = function() { | ||
| 184 | + $scope.close(); | ||
| 185 | + }; | ||
| 186 | + | ||
| 187 | + // Close button handler | ||
| 188 | + $scope.close = function() { | ||
| 189 | + $scope.property.mode = 'read'; | ||
| 190 | + $scope.$hide(); | ||
| 191 | + }; | ||
| 192 | +}]; |
src/main/webapp/act/process-editor/editor-app/configuration/properties-form-properties-controller.js
0 → 100644
| 1 | +/* | ||
| 2 | + * Activiti Modeler component part of the Activiti project | ||
| 3 | + * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. | ||
| 4 | + * | ||
| 5 | + * This library is free software; you can redistribute it and/or | ||
| 6 | + * modify it under the terms of the GNU Lesser General Public | ||
| 7 | + * License as published by the Free Software Foundation; either | ||
| 8 | + * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | + * | ||
| 10 | + * This library is distributed in the hope that it will be useful, | ||
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | + * Lesser General Public License for more details. | ||
| 14 | + | ||
| 15 | + * You should have received a copy of the GNU Lesser General Public | ||
| 16 | + * License along with this library; if not, write to the Free Software | ||
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | + */ | ||
| 19 | + | ||
| 20 | +/* | ||
| 21 | + * Form Properties | ||
| 22 | + */ | ||
| 23 | + | ||
| 24 | +var KisBpmFormPropertiesCtrl = [ '$scope', '$modal', '$timeout', '$translate', function($scope, $modal, $timeout, $translate) { | ||
| 25 | + | ||
| 26 | + // Config for the modal window | ||
| 27 | + var opts = { | ||
| 28 | + template: 'editor-app/configuration/properties/form-properties-popup.html?version=' + Date.now(), | ||
| 29 | + scope: $scope | ||
| 30 | + }; | ||
| 31 | + | ||
| 32 | + // Open the dialog | ||
| 33 | + $modal(opts); | ||
| 34 | +}]; | ||
| 35 | + | ||
| 36 | +var KisBpmFormPropertiesPopupCtrl = ['$scope', '$q', '$translate', '$timeout', function($scope, $q, $translate, $timeout) { | ||
| 37 | + | ||
| 38 | + // Put json representing form properties on scope | ||
| 39 | + if ($scope.property.value !== undefined && $scope.property.value !== null | ||
| 40 | + && $scope.property.value.formProperties !== undefined | ||
| 41 | + && $scope.property.value.formProperties !== null) { | ||
| 42 | + // Note that we clone the json object rather then setting it directly, | ||
| 43 | + // this to cope with the fact that the user can click the cancel button and no changes should have happended | ||
| 44 | + $scope.formProperties = angular.copy($scope.property.value.formProperties); | ||
| 45 | + | ||
| 46 | + for (var i = 0; i < $scope.formProperties.length; i++) { | ||
| 47 | + var formProperty = $scope.formProperties[i]; | ||
| 48 | + if (formProperty.enumValues && formProperty.enumValues.length > 0) { | ||
| 49 | + for (var j = 0; j < formProperty.enumValues.length; j++) { | ||
| 50 | + var enumValue = formProperty.enumValues[j]; | ||
| 51 | + if (!enumValue.id && !enumValue.name && enumValue.value) { | ||
| 52 | + enumValue.id = enumValue.value; | ||
| 53 | + enumValue.name = enumValue.value; | ||
| 54 | + } | ||
| 55 | + } | ||
| 56 | + } | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + } else { | ||
| 60 | + $scope.formProperties = []; | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + // Array to contain selected properties (yes - we only can select one, but ng-grid isn't smart enough) | ||
| 64 | + $scope.selectedProperties = []; | ||
| 65 | + $scope.selectedEnumValues = []; | ||
| 66 | + | ||
| 67 | + $scope.translationsRetrieved = false; | ||
| 68 | + | ||
| 69 | + $scope.labels = {}; | ||
| 70 | + | ||
| 71 | + var idPromise = $translate('PROPERTY.FORMPROPERTIES.ID'); | ||
| 72 | + var namePromise = $translate('PROPERTY.FORMPROPERTIES.NAME'); | ||
| 73 | + var typePromise = $translate('PROPERTY.FORMPROPERTIES.TYPE'); | ||
| 74 | + | ||
| 75 | + $q.all([idPromise, namePromise, typePromise]).then(function(results) { | ||
| 76 | + $scope.labels.idLabel = results[0]; | ||
| 77 | + $scope.labels.nameLabel = results[1]; | ||
| 78 | + $scope.labels.typeLabel = results[2]; | ||
| 79 | + $scope.translationsRetrieved = true; | ||
| 80 | + | ||
| 81 | + // Config for grid | ||
| 82 | + $scope.gridOptions = { | ||
| 83 | + data: 'formProperties', | ||
| 84 | + enableRowReordering: true, | ||
| 85 | + headerRowHeight: 28, | ||
| 86 | + multiSelect: false, | ||
| 87 | + keepLastSelected : false, | ||
| 88 | + selectedItems: $scope.selectedProperties, | ||
| 89 | + columnDefs: [{ field: 'id', displayName: $scope.labels.idLabel }, | ||
| 90 | + { field: 'name', displayName: $scope.labels.nameLabel}, | ||
| 91 | + { field: 'type', displayName: $scope.labels.typeLabel}] | ||
| 92 | + }; | ||
| 93 | + | ||
| 94 | + $scope.enumGridOptions = { | ||
| 95 | + data: 'selectedProperties[0].enumValues', | ||
| 96 | + enableRowReordering: true, | ||
| 97 | + headerRowHeight: 28, | ||
| 98 | + multiSelect: false, | ||
| 99 | + keepLastSelected : false, | ||
| 100 | + selectedItems: $scope.selectedEnumValues, | ||
| 101 | + columnDefs: [{ field: 'id', displayName: $scope.labels.idLabel }, | ||
| 102 | + { field: 'name', displayName: $scope.labels.nameLabel}] | ||
| 103 | + } | ||
| 104 | + }); | ||
| 105 | + | ||
| 106 | + // Handler for when the value of the type dropdown changes | ||
| 107 | + $scope.propertyTypeChanged = function() { | ||
| 108 | + | ||
| 109 | + // Check date. If date, show date pattern | ||
| 110 | + if ($scope.selectedProperties[0].type === 'date') { | ||
| 111 | + $scope.selectedProperties[0].datePattern = 'MM-dd-yyyy hh:mm'; | ||
| 112 | + | ||
| 113 | + } else { | ||
| 114 | + delete $scope.selectedProperties[0].datePattern; | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + // Check enum. If enum, show list of options | ||
| 118 | + if ($scope.selectedProperties[0].type === 'enum') { | ||
| 119 | + $scope.selectedProperties[0].enumValues = [ {id: 'value1', name: 'Value 1'}, {id: 'value2', name: 'Value 2'}]; | ||
| 120 | + | ||
| 121 | + } else { | ||
| 122 | + delete $scope.selectedProperties[0].enumValues; | ||
| 123 | + } | ||
| 124 | + }; | ||
| 125 | + | ||
| 126 | + // Click handler for add button | ||
| 127 | + var propertyIndex = 1; | ||
| 128 | + $scope.addNewProperty = function() { | ||
| 129 | + $scope.formProperties.push({ id : 'new_property_' + propertyIndex++, | ||
| 130 | + name : '', | ||
| 131 | + type : 'string', | ||
| 132 | + readable: true, | ||
| 133 | + writable: true}); | ||
| 134 | + | ||
| 135 | + $timeout(function(){ | ||
| 136 | + $scope.gridOptions.selectItem($scope.formProperties.length - 1, true); | ||
| 137 | + }); | ||
| 138 | + }; | ||
| 139 | + | ||
| 140 | + // Click handler for remove button | ||
| 141 | + $scope.removeProperty = function() { | ||
| 142 | + if ($scope.selectedProperties.length > 0) { | ||
| 143 | + var index = $scope.formProperties.indexOf($scope.selectedProperties[0]); | ||
| 144 | + $scope.gridOptions.selectItem(index, false); | ||
| 145 | + $scope.formProperties.splice(index, 1); | ||
| 146 | + | ||
| 147 | + $scope.selectedProperties.length = 0; | ||
| 148 | + if (index < $scope.formProperties.length) { | ||
| 149 | + $scope.gridOptions.selectItem(index + 1, true); | ||
| 150 | + } else if ($scope.formProperties.length > 0) { | ||
| 151 | + $scope.gridOptions.selectItem(index - 1, true); | ||
| 152 | + } | ||
| 153 | + } | ||
| 154 | + }; | ||
| 155 | + | ||
| 156 | + // Click handler for up button | ||
| 157 | + $scope.movePropertyUp = function() { | ||
| 158 | + if ($scope.selectedProperties.length > 0) { | ||
| 159 | + var index = $scope.formProperties.indexOf($scope.selectedProperties[0]); | ||
| 160 | + if (index != 0) { // If it's the first, no moving up of course | ||
| 161 | + // Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272 | ||
| 162 | + var temp = $scope.formProperties[index]; | ||
| 163 | + $scope.formProperties.splice(index, 1); | ||
| 164 | + $timeout(function(){ | ||
| 165 | + $scope.formProperties.splice(index + -1, 0, temp); | ||
| 166 | + }, 100); | ||
| 167 | + | ||
| 168 | + } | ||
| 169 | + } | ||
| 170 | + }; | ||
| 171 | + | ||
| 172 | + // Click handler for down button | ||
| 173 | + $scope.movePropertyDown = function() { | ||
| 174 | + if ($scope.selectedProperties.length > 0) { | ||
| 175 | + var index = $scope.formProperties.indexOf($scope.selectedProperties[0]); | ||
| 176 | + if (index != $scope.formProperties.length - 1) { // If it's the last element, no moving down of course | ||
| 177 | + // Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272 | ||
| 178 | + var temp = $scope.formProperties[index]; | ||
| 179 | + $scope.formProperties.splice(index, 1); | ||
| 180 | + $timeout(function(){ | ||
| 181 | + $scope.formProperties.splice(index + 1, 0, temp); | ||
| 182 | + }, 100); | ||
| 183 | + | ||
| 184 | + } | ||
| 185 | + } | ||
| 186 | + }; | ||
| 187 | + | ||
| 188 | + $scope.addNewEnumValue = function() { | ||
| 189 | + if ($scope.selectedProperties.length > 0) { | ||
| 190 | + $scope.selectedProperties[0].enumValues.push({ id : '', name : ''}); | ||
| 191 | + } | ||
| 192 | + | ||
| 193 | + $timeout(function(){ | ||
| 194 | + $scope.enumGridOptions.selectItem($scope.selectedProperties[0].enumValues.length - 1, true); | ||
| 195 | + }); | ||
| 196 | + }; | ||
| 197 | + | ||
| 198 | + // Click handler for remove button | ||
| 199 | + $scope.removeEnumValue = function() { | ||
| 200 | + if ($scope.selectedProperties.length > 0 && $scope.selectedEnumValues.length > 0) { | ||
| 201 | + var index = $scope.selectedProperties[0].enumValues.indexOf($scope.selectedEnumValues[0]); | ||
| 202 | + $scope.enumGridOptions.selectItem(index, false); | ||
| 203 | + $scope.selectedProperties[0].enumValues.splice(index, 1); | ||
| 204 | + | ||
| 205 | + $scope.selectedEnumValues.length = 0; | ||
| 206 | + if (index < $scope.selectedProperties[0].enumValues.length) { | ||
| 207 | + $timeout(function(){ | ||
| 208 | + $scope.enumGridOptions.selectItem(index + 1, true); | ||
| 209 | + }); | ||
| 210 | + | ||
| 211 | + } else if ($scope.selectedProperties[0].enumValues.length > 0) { | ||
| 212 | + $timeout(function(){ | ||
| 213 | + $scope.enumGridOptions.selectItem(index - 1, true); | ||
| 214 | + }); | ||
| 215 | + } | ||
| 216 | + } | ||
| 217 | + }; | ||
| 218 | + | ||
| 219 | + // Click handler for up button | ||
| 220 | + $scope.moveEnumValueUp = function() { | ||
| 221 | + if ($scope.selectedProperties.length > 0 && $scope.selectedEnumValues.length > 0) { | ||
| 222 | + var index = $scope.selectedProperties[0].enumValues.indexOf($scope.selectedEnumValues[0]); | ||
| 223 | + if (index != 0) { // If it's the first, no moving up of course | ||
| 224 | + // Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272 | ||
| 225 | + var temp = $scope.selectedProperties[0].enumValues[index]; | ||
| 226 | + $scope.selectedProperties[0].enumValues.splice(index, 1); | ||
| 227 | + $timeout(function(){ | ||
| 228 | + $scope.selectedProperties[0].enumValues.splice(index + -1, 0, temp); | ||
| 229 | + }); | ||
| 230 | + | ||
| 231 | + } | ||
| 232 | + } | ||
| 233 | + }; | ||
| 234 | + | ||
| 235 | + // Click handler for down button | ||
| 236 | + $scope.moveEnumValueDown = function() { | ||
| 237 | + if ($scope.selectedProperties.length > 0 && $scope.selectedEnumValues.length > 0) { | ||
| 238 | + var index = $scope.selectedProperties[0].enumValues.indexOf($scope.selectedEnumValues[0]); | ||
| 239 | + if (index != $scope.selectedProperties[0].enumValues.length - 1) { // If it's the last element, no moving down of course | ||
| 240 | + // Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272 | ||
| 241 | + var temp = $scope.selectedProperties[0].enumValues[index]; | ||
| 242 | + $scope.selectedProperties[0].enumValues.splice(index, 1); | ||
| 243 | + $timeout(function(){ | ||
| 244 | + $scope.selectedProperties[0].enumValues.splice(index + 1, 0, temp); | ||
| 245 | + }); | ||
| 246 | + | ||
| 247 | + } | ||
| 248 | + } | ||
| 249 | + }; | ||
| 250 | + | ||
| 251 | + // Click handler for save button | ||
| 252 | + $scope.save = function() { | ||
| 253 | + | ||
| 254 | + if ($scope.formProperties.length > 0) { | ||
| 255 | + $scope.property.value = {}; | ||
| 256 | + $scope.property.value.formProperties = $scope.formProperties; | ||
| 257 | + } else { | ||
| 258 | + $scope.property.value = null; | ||
| 259 | + } | ||
| 260 | + | ||
| 261 | + $scope.updatePropertyInModel($scope.property); | ||
| 262 | + $scope.close(); | ||
| 263 | + }; | ||
| 264 | + | ||
| 265 | + $scope.cancel = function() { | ||
| 266 | + $scope.$hide(); | ||
| 267 | + $scope.property.mode = 'read'; | ||
| 268 | + }; | ||
| 269 | + | ||
| 270 | + // Close button handler | ||
| 271 | + $scope.close = function() { | ||
| 272 | + $scope.$hide(); | ||
| 273 | + $scope.property.mode = 'read'; | ||
| 274 | + }; | ||
| 275 | + | ||
| 276 | +}]; |
src/main/webapp/act/process-editor/editor-app/configuration/properties-in-parameters-controller.js
0 → 100644
| 1 | +/* | ||
| 2 | + * Activiti Modeler component part of the Activiti project | ||
| 3 | + * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. | ||
| 4 | + * | ||
| 5 | + * This library is free software; you can redistribute it and/or | ||
| 6 | + * modify it under the terms of the GNU Lesser General Public | ||
| 7 | + * License as published by the Free Software Foundation; either | ||
| 8 | + * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | + * | ||
| 10 | + * This library is distributed in the hope that it will be useful, | ||
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | + * Lesser General Public License for more details. | ||
| 14 | + | ||
| 15 | + * You should have received a copy of the GNU Lesser General Public | ||
| 16 | + * License along with this library; if not, write to the Free Software | ||
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | + */ | ||
| 19 | + | ||
| 20 | +/* | ||
| 21 | + * Input parameters for call activity | ||
| 22 | + */ | ||
| 23 | + | ||
| 24 | +var KisBpmInParametersCtrl = [ '$scope', '$modal', '$timeout', '$translate', function($scope, $modal, $timeout, $translate) { | ||
| 25 | + | ||
| 26 | + // Config for the modal window | ||
| 27 | + var opts = { | ||
| 28 | + template: 'editor-app/configuration/properties/in-parameters-popup.html?version=' + Date.now(), | ||
| 29 | + scope: $scope | ||
| 30 | + }; | ||
| 31 | + | ||
| 32 | + // Open the dialog | ||
| 33 | + $modal(opts); | ||
| 34 | +}]; | ||
| 35 | + | ||
| 36 | +var KisBpmInParametersPopupCtrl = ['$scope', '$q', '$translate', function($scope, $q, $translate) { | ||
| 37 | + | ||
| 38 | + // Put json representing form properties on scope | ||
| 39 | + if ($scope.property.value !== undefined && $scope.property.value !== null | ||
| 40 | + && $scope.property.value.inParameters !== undefined | ||
| 41 | + && $scope.property.value.inParameters !== null) { | ||
| 42 | + // Note that we clone the json object rather then setting it directly, | ||
| 43 | + // this to cope with the fact that the user can click the cancel button and no changes should have happened | ||
| 44 | + $scope.parameters = angular.copy($scope.property.value.inParameters); | ||
| 45 | + } else { | ||
| 46 | + $scope.parameters = []; | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + // Array to contain selected properties (yes - we only can select one, but ng-grid isn't smart enough) | ||
| 50 | + $scope.selectedParameters = []; | ||
| 51 | + $scope.translationsRetrieved = false; | ||
| 52 | + | ||
| 53 | + $scope.labels = {}; | ||
| 54 | + | ||
| 55 | + var sourcePromise = $translate('PROPERTY.PARAMETER.SOURCE'); | ||
| 56 | + var sourceExpressionPromise = $translate('PROPERTY.PARAMETER.SOURCEEXPRESSION'); | ||
| 57 | + var targetPromise = $translate('PROPERTY.PARAMETER.TARGET'); | ||
| 58 | + | ||
| 59 | + $q.all([sourcePromise, sourceExpressionPromise, targetPromise]).then(function(results) { | ||
| 60 | + $scope.labels.sourceLabel = results[0]; | ||
| 61 | + $scope.labels.sourceExpressionLabel = results[1]; | ||
| 62 | + $scope.labels.targetLabel = results[2]; | ||
| 63 | + $scope.translationsRetrieved = true; | ||
| 64 | + | ||
| 65 | + // Config for grid | ||
| 66 | + $scope.gridOptions = { | ||
| 67 | + data: 'parameters', | ||
| 68 | + enableRowReordering: true, | ||
| 69 | + headerRowHeight: 28, | ||
| 70 | + multiSelect: false, | ||
| 71 | + keepLastSelected : false, | ||
| 72 | + selectedItems: $scope.selectedParameters, | ||
| 73 | + columnDefs: [{ field: 'source', displayName: $scope.labels.sourceLabel }, | ||
| 74 | + { field: 'sourceExpression', displayName: $scope.labels.sourceExpressionLabel }, | ||
| 75 | + { field: 'target', displayName: $scope.labels.targetLabel }] | ||
| 76 | + }; | ||
| 77 | + }); | ||
| 78 | + | ||
| 79 | + // Click handler for add button | ||
| 80 | + $scope.addNewParameter = function() { | ||
| 81 | + $scope.parameters.push({ source : '', | ||
| 82 | + sourceExpression : '', | ||
| 83 | + target : ''}); | ||
| 84 | + }; | ||
| 85 | + | ||
| 86 | + // Click handler for remove button | ||
| 87 | + $scope.removeParameter = function() { | ||
| 88 | + if ($scope.selectedParameters.length > 0) { | ||
| 89 | + var index = $scope.parameters.indexOf($scope.selectedParameters[0]); | ||
| 90 | + $scope.gridOptions.selectItem(index, false); | ||
| 91 | + $scope.parameters.splice(index, 1); | ||
| 92 | + | ||
| 93 | + $scope.selectedParameters.length = 0; | ||
| 94 | + if (index < $scope.parameters.length) { | ||
| 95 | + $scope.gridOptions.selectItem(index + 1, true); | ||
| 96 | + } else if ($scope.parameters.length > 0) { | ||
| 97 | + $scope.gridOptions.selectItem(index - 1, true); | ||
| 98 | + } | ||
| 99 | + } | ||
| 100 | + }; | ||
| 101 | + | ||
| 102 | + // Click handler for up button | ||
| 103 | + $scope.moveParameterUp = function() { | ||
| 104 | + if ($scope.selectedParameters.length > 0) { | ||
| 105 | + var index = $scope.parameters.indexOf($scope.selectedParameters[0]); | ||
| 106 | + if (index != 0) { // If it's the first, no moving up of course | ||
| 107 | + // Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272 | ||
| 108 | + var temp = $scope.parameters[index]; | ||
| 109 | + $scope.parameters.splice(index, 1); | ||
| 110 | + $timeout(function(){ | ||
| 111 | + $scope.parameters.splice(index + -1, 0, temp); | ||
| 112 | + }, 100); | ||
| 113 | + | ||
| 114 | + } | ||
| 115 | + } | ||
| 116 | + }; | ||
| 117 | + | ||
| 118 | + // Click handler for down button | ||
| 119 | + $scope.moveParameterDown = function() { | ||
| 120 | + if ($scope.selectedParameters.length > 0) { | ||
| 121 | + var index = $scope.parameters.indexOf($scope.selectedParameters[0]); | ||
| 122 | + if (index != $scope.parameters.length - 1) { // If it's the last element, no moving down of course | ||
| 123 | + // Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272 | ||
| 124 | + var temp = $scope.parameters[index]; | ||
| 125 | + $scope.parameters.splice(index, 1); | ||
| 126 | + $timeout(function(){ | ||
| 127 | + $scope.parameters.splice(index + 1, 0, temp); | ||
| 128 | + }, 100); | ||
| 129 | + | ||
| 130 | + } | ||
| 131 | + } | ||
| 132 | + }; | ||
| 133 | + | ||
| 134 | + // Click handler for save button | ||
| 135 | + $scope.save = function() { | ||
| 136 | + | ||
| 137 | + if ($scope.parameters.length > 0) { | ||
| 138 | + $scope.property.value = {}; | ||
| 139 | + $scope.property.value.inParameters = $scope.parameters; | ||
| 140 | + } else { | ||
| 141 | + $scope.property.value = null; | ||
| 142 | + } | ||
| 143 | + | ||
| 144 | + $scope.updatePropertyInModel($scope.property); | ||
| 145 | + $scope.close(); | ||
| 146 | + }; | ||
| 147 | + | ||
| 148 | + $scope.cancel = function() { | ||
| 149 | + $scope.close(); | ||
| 150 | + }; | ||
| 151 | + | ||
| 152 | + // Close button handler | ||
| 153 | + $scope.close = function() { | ||
| 154 | + $scope.property.mode = 'read'; | ||
| 155 | + $scope.$hide(); | ||
| 156 | + }; | ||
| 157 | + | ||
| 158 | +}]; |
| 1 | +/* | ||
| 2 | + * Activiti Modeler component part of the Activiti project | ||
| 3 | + * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. | ||
| 4 | + * | ||
| 5 | + * This library is free software; you can redistribute it and/or | ||
| 6 | + * modify it under the terms of the GNU Lesser General Public | ||
| 7 | + * License as published by the Free Software Foundation; either | ||
| 8 | + * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | + * | ||
| 10 | + * This library is distributed in the hope that it will be useful, | ||
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | + * Lesser General Public License for more details. | ||
| 14 | + | ||
| 15 | + * You should have received a copy of the GNU Lesser General Public | ||
| 16 | + * License along with this library; if not, write to the Free Software | ||
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | + */ | ||
| 19 | + | ||
| 20 | +/* | ||
| 21 | + * Execution listeners | ||
| 22 | + */ | ||
| 23 | + | ||
| 24 | +angular.module('activitiModeler').controller('ActivitiMessageDefinitionsCtrl', ['$scope', '$modal', function ($scope, $modal) { | ||
| 25 | + | ||
| 26 | + // Config for the modal window | ||
| 27 | + var opts = { | ||
| 28 | + template: 'editor-app/configuration/properties/message-definitions-popup.html?version=' + Date.now(), | ||
| 29 | + scope: $scope | ||
| 30 | + }; | ||
| 31 | + | ||
| 32 | + // Open the dialog | ||
| 33 | + $modal(opts); | ||
| 34 | +}]); | ||
| 35 | + | ||
| 36 | +//Need a separate controller for the modal window due to https://github.com/angular-ui/bootstrap/issues/259 | ||
| 37 | +// Will be fixed in a newer version of Angular UI | ||
| 38 | +angular.module('activitiModeler').controller('ActivitiMessageDefinitionsPopupCtrl', | ||
| 39 | + ['$scope', '$q', '$translate', '$timeout', function ($scope, $q, $translate, $timeout) { | ||
| 40 | + | ||
| 41 | + // Put json representing mesage definitions on scope | ||
| 42 | + if ($scope.property.value !== undefined && $scope.property.value !== null && $scope.property.value.length > 0) { | ||
| 43 | + | ||
| 44 | + if ($scope.property.value.constructor == String) { | ||
| 45 | + $scope.messageDefinitions = JSON.parse($scope.property.value); | ||
| 46 | + } | ||
| 47 | + else { | ||
| 48 | + // Note that we clone the json object rather then setting it directly, | ||
| 49 | + // this to cope with the fact that the user can click the cancel button and no changes should have happened | ||
| 50 | + $scope.messageDefinitions = angular.copy($scope.property.value); | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + } else { | ||
| 54 | + $scope.messageDefinitions = []; | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + // Array to contain selected mesage definitions (yes - we only can select one, but ng-grid isn't smart enough) | ||
| 58 | + $scope.selectedMessages = []; | ||
| 59 | + $scope.translationsRetrieved = false; | ||
| 60 | + | ||
| 61 | + $scope.labels = {}; | ||
| 62 | + | ||
| 63 | + var idPromise = $translate('PROPERTY.MESSAGEDEFINITIONS.ID'); | ||
| 64 | + var namePromise = $translate('PROPERTY.MESSAGEDEFINITIONS.NAME'); | ||
| 65 | + | ||
| 66 | + $q.all([idPromise, namePromise]).then(function (results) { | ||
| 67 | + | ||
| 68 | + $scope.labels.idLabel = results[0]; | ||
| 69 | + $scope.labels.nameLabel = results[1]; | ||
| 70 | + $scope.translationsRetrieved = true; | ||
| 71 | + | ||
| 72 | + // Config for grid | ||
| 73 | + $scope.gridOptions = { | ||
| 74 | + data: 'messageDefinitions', | ||
| 75 | + headerRowHeight: 28, | ||
| 76 | + enableRowSelection: true, | ||
| 77 | + enableRowHeaderSelection: false, | ||
| 78 | + multiSelect: false, | ||
| 79 | + keepLastSelected : false, | ||
| 80 | + selectedItems: $scope.selectedMessages, | ||
| 81 | + columnDefs: [ | ||
| 82 | + {field: 'id', displayName: $scope.labels.idLabel}, | ||
| 83 | + {field: 'name', displayName: $scope.labels.nameLabel}] | ||
| 84 | + }; | ||
| 85 | + }); | ||
| 86 | + | ||
| 87 | + // Click handler for add button | ||
| 88 | + $scope.addNewMessageDefinition = function () { | ||
| 89 | + var newMessageDefinition = {id: '', name: ''}; | ||
| 90 | + | ||
| 91 | + $scope.messageDefinitions.push(newMessageDefinition); | ||
| 92 | + $timeout(function () { | ||
| 93 | + $scope.gridOptions.selectItem($scope.messageDefinitions.length - 1, true); | ||
| 94 | + }); | ||
| 95 | + }; | ||
| 96 | + | ||
| 97 | + // Click handler for remove button | ||
| 98 | + $scope.removeMessageDefinition = function () { | ||
| 99 | + if ($scope.selectedMessages && $scope.selectedMessages.length > 0) { | ||
| 100 | + var index = $scope.messageDefinitions.indexOf($scope.selectedMessages[0]); | ||
| 101 | + $scope.gridOptions.selectItem(index, false); | ||
| 102 | + $scope.messageDefinitions.splice(index, 1); | ||
| 103 | + | ||
| 104 | + $scope.selectedMessages.length = 0; | ||
| 105 | + if (index < $scope.messageDefinitions.length) { | ||
| 106 | + $scope.gridOptions.selectItem(index + 1, true); | ||
| 107 | + } else if ($scope.messageDefinitions.length > 0) { | ||
| 108 | + $scope.gridOptions.selectItem(index - 1, true); | ||
| 109 | + } | ||
| 110 | + } | ||
| 111 | + }; | ||
| 112 | + | ||
| 113 | + // Click handler for save button | ||
| 114 | + $scope.save = function () { | ||
| 115 | + | ||
| 116 | + if ($scope.messageDefinitions.length > 0) { | ||
| 117 | + $scope.property.value = $scope.messageDefinitions; | ||
| 118 | + } else { | ||
| 119 | + $scope.property.value = null; | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + $scope.updatePropertyInModel($scope.property); | ||
| 123 | + $scope.close(); | ||
| 124 | + }; | ||
| 125 | + | ||
| 126 | + $scope.cancel = function () { | ||
| 127 | + $scope.property.mode = 'read'; | ||
| 128 | + $scope.$hide(); | ||
| 129 | + }; | ||
| 130 | + | ||
| 131 | + // Close button handler | ||
| 132 | + $scope.close = function () { | ||
| 133 | + $scope.property.mode = 'read'; | ||
| 134 | + $scope.$hide(); | ||
| 135 | + }; | ||
| 136 | + | ||
| 137 | + }]); |
src/main/webapp/act/process-editor/editor-app/configuration/properties-message-scope-controller.js
0 → 100644
| 1 | +/* | ||
| 2 | + * Activiti Modeler component part of the Activiti project | ||
| 3 | + * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. | ||
| 4 | + * | ||
| 5 | + * This library is free software; you can redistribute it and/or | ||
| 6 | + * modify it under the terms of the GNU Lesser General Public | ||
| 7 | + * License as published by the Free Software Foundation; either | ||
| 8 | + * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | + * | ||
| 10 | + * This library is distributed in the hope that it will be useful, | ||
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | + * Lesser General Public License for more details. | ||
| 14 | + | ||
| 15 | + * You should have received a copy of the GNU Lesser General Public | ||
| 16 | + * License along with this library; if not, write to the Free Software | ||
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | + */ | ||
| 19 | + | ||
| 20 | +angular.module('activitiModeler').controller('ActivitiMessageRefCtrl', [ '$scope', function($scope) { | ||
| 21 | + | ||
| 22 | + // Find the parent shape on which the message definitions are defined | ||
| 23 | + var messageDefinitionsProperty = undefined; | ||
| 24 | + var parent = $scope.selectedShape; | ||
| 25 | + while (parent !== null && parent !== undefined && messageDefinitionsProperty === undefined) { | ||
| 26 | + if (parent.properties && parent.properties['oryx-messagedefinitions']) { | ||
| 27 | + messageDefinitionsProperty = parent.properties['oryx-messagedefinitions']; | ||
| 28 | + } else { | ||
| 29 | + parent = parent.parent; | ||
| 30 | + } | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + try { | ||
| 34 | + messageDefinitionsProperty = JSON.parse(messageDefinitionsProperty); | ||
| 35 | + if (typeof messageDefinitionsProperty == 'string') { | ||
| 36 | + messageDefinitionsProperty = JSON.parse(messageDefinitionsProperty); | ||
| 37 | + } | ||
| 38 | + } catch (err) { | ||
| 39 | + // Do nothing here, just to be sure we try-catch it | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + $scope.messageDefinitions = messageDefinitionsProperty; | ||
| 43 | + | ||
| 44 | + | ||
| 45 | + $scope.messageChanged = function() { | ||
| 46 | + $scope.updatePropertyInModel($scope.property); | ||
| 47 | + }; | ||
| 48 | +}]); |
src/main/webapp/act/process-editor/editor-app/configuration/properties-multiinstance-controller.js
0 → 100644
| 1 | +/* | ||
| 2 | + * Activiti Modeler component part of the Activiti project | ||
| 3 | + * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. | ||
| 4 | + * | ||
| 5 | + * This library is free software; you can redistribute it and/or | ||
| 6 | + * modify it under the terms of the GNU Lesser General Public | ||
| 7 | + * License as published by the Free Software Foundation; either | ||
| 8 | + * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | + * | ||
| 10 | + * This library is distributed in the hope that it will be useful, | ||
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | + * Lesser General Public License for more details. | ||
| 14 | + | ||
| 15 | + * You should have received a copy of the GNU Lesser General Public | ||
| 16 | + * License along with this library; if not, write to the Free Software | ||
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | + */ | ||
| 19 | + | ||
| 20 | +/* | ||
| 21 | + * Execution listeners | ||
| 22 | + */ | ||
| 23 | + | ||
| 24 | +var KisBpmMultiInstanceCtrl = [ '$scope', function($scope) { | ||
| 25 | + | ||
| 26 | + if ($scope.property.value == undefined && $scope.property.value == null) | ||
| 27 | + { | ||
| 28 | + $scope.property.value = 'None'; | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + $scope.multiInstanceChanged = function() { | ||
| 32 | + $scope.updatePropertyInModel($scope.property); | ||
| 33 | + }; | ||
| 34 | +}]; |
src/main/webapp/act/process-editor/editor-app/configuration/properties-out-parameters-controller.js
0 → 100644
| 1 | +/* | ||
| 2 | + * Activiti Modeler component part of the Activiti project | ||
| 3 | + * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. | ||
| 4 | + * | ||
| 5 | + * This library is free software; you can redistribute it and/or | ||
| 6 | + * modify it under the terms of the GNU Lesser General Public | ||
| 7 | + * License as published by the Free Software Foundation; either | ||
| 8 | + * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | + * | ||
| 10 | + * This library is distributed in the hope that it will be useful, | ||
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | + * Lesser General Public License for more details. | ||
| 14 | + | ||
| 15 | + * You should have received a copy of the GNU Lesser General Public | ||
| 16 | + * License along with this library; if not, write to the Free Software | ||
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | + */ | ||
| 19 | + | ||
| 20 | +/* | ||
| 21 | + * Input parameters for call activity | ||
| 22 | + */ | ||
| 23 | + | ||
| 24 | +var KisBpmOutParametersCtrl = [ '$scope' , '$modal', '$timeout', '$translate', function($scope, $modal, $timeout, $translate) { | ||
| 25 | + | ||
| 26 | + // Config for the modal window | ||
| 27 | + var opts = { | ||
| 28 | + template: 'editor-app/configuration/properties/out-parameters-popup.html?version=' + Date.now(), | ||
| 29 | + scope: $scope | ||
| 30 | + }; | ||
| 31 | + | ||
| 32 | + // Open the dialog | ||
| 33 | + $modal(opts); | ||
| 34 | +}]; | ||
| 35 | + | ||
| 36 | +var KisBpmOutParametersPopupCtrl = [ '$scope', '$q', '$translate', function($scope, $q, $translate) { | ||
| 37 | + | ||
| 38 | + // Put json representing form properties on scope | ||
| 39 | + if ($scope.property.value !== undefined && $scope.property.value !== null | ||
| 40 | + && $scope.property.value.outParameters !== undefined | ||
| 41 | + && $scope.property.value.outParameters !== null) { | ||
| 42 | + // Note that we clone the json object rather then setting it directly, | ||
| 43 | + // this to cope with the fact that the user can click the cancel button and no changes should have happened | ||
| 44 | + $scope.parameters = angular.copy($scope.property.value.outParameters); | ||
| 45 | + } else { | ||
| 46 | + $scope.parameters = []; | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + // Array to contain selected properties (yes - we only can select one, but ng-grid isn't smart enough) | ||
| 50 | + $scope.selectedParameters = []; | ||
| 51 | + $scope.translationsRetrieved = false; | ||
| 52 | + | ||
| 53 | + $scope.labels = {}; | ||
| 54 | + | ||
| 55 | + var sourcePromise = $translate('PROPERTY.PARAMETER.SOURCE'); | ||
| 56 | + var sourceExpressionPromise = $translate('PROPERTY.PARAMETER.SOURCEEXPRESSION'); | ||
| 57 | + var targetPromise = $translate('PROPERTY.PARAMETER.TARGET'); | ||
| 58 | + | ||
| 59 | + $q.all([sourcePromise, sourceExpressionPromise, targetPromise]).then(function(results) { | ||
| 60 | + $scope.labels.sourceLabel = results[0]; | ||
| 61 | + $scope.labels.sourceExpressionLabel = results[1]; | ||
| 62 | + $scope.labels.targetLabel = results[2]; | ||
| 63 | + $scope.translationsRetrieved = true; | ||
| 64 | + | ||
| 65 | + // Config for grid | ||
| 66 | + $scope.gridOptions = { | ||
| 67 | + data: 'parameters', | ||
| 68 | + enableRowReordering: true, | ||
| 69 | + headerRowHeight: 28, | ||
| 70 | + multiSelect: false, | ||
| 71 | + keepLastSelected : false, | ||
| 72 | + selectedItems: $scope.selectedParameters, | ||
| 73 | + columnDefs: [{ field: 'source', displayName: $scope.labels.sourceLabel }, | ||
| 74 | + { field: 'sourceExpression', displayName: $scope.labels.sourceExpressionLabel }, | ||
| 75 | + { field: 'target', displayName: $scope.labels.targetLabel }] | ||
| 76 | + }; | ||
| 77 | + }); | ||
| 78 | + | ||
| 79 | + // Click handler for add button | ||
| 80 | + $scope.addNewParameter = function() { | ||
| 81 | + $scope.parameters.push({ source : '', | ||
| 82 | + sourceExpression : '', | ||
| 83 | + target : ''}); | ||
| 84 | + }; | ||
| 85 | + | ||
| 86 | + // Click handler for remove button | ||
| 87 | + $scope.removeParameter = function() { | ||
| 88 | + if ($scope.selectedParameters.length > 0) { | ||
| 89 | + var index = $scope.parameters.indexOf($scope.selectedParameters[0]); | ||
| 90 | + $scope.gridOptions.selectItem(index, false); | ||
| 91 | + $scope.parameters.splice(index, 1); | ||
| 92 | + | ||
| 93 | + $scope.selectedParameters.length = 0; | ||
| 94 | + if (index < $scope.parameters.length) { | ||
| 95 | + $scope.gridOptions.selectItem(index + 1, true); | ||
| 96 | + } else if ($scope.parameters.length > 0) { | ||
| 97 | + $scope.gridOptions.selectItem(index - 1, true); | ||
| 98 | + } | ||
| 99 | + } | ||
| 100 | + }; | ||
| 101 | + | ||
| 102 | + // Click handler for up button | ||
| 103 | + $scope.moveParameterUp = function() { | ||
| 104 | + if ($scope.selectedParameters.length > 0) { | ||
| 105 | + var index = $scope.parameters.indexOf($scope.selectedParameters[0]); | ||
| 106 | + if (index != 0) { // If it's the first, no moving up of course | ||
| 107 | + // Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272 | ||
| 108 | + var temp = $scope.parameters[index]; | ||
| 109 | + $scope.parameters.splice(index, 1); | ||
| 110 | + $timeout(function(){ | ||
| 111 | + $scope.parameters.splice(index + -1, 0, temp); | ||
| 112 | + }, 100); | ||
| 113 | + | ||
| 114 | + } | ||
| 115 | + } | ||
| 116 | + }; | ||
| 117 | + | ||
| 118 | + // Click handler for down button | ||
| 119 | + $scope.moveParameterDown = function() { | ||
| 120 | + if ($scope.selectedParameters.length > 0) { | ||
| 121 | + var index = $scope.parameters.indexOf($scope.selectedParameters[0]); | ||
| 122 | + if (index != $scope.parameters.length - 1) { // If it's the last element, no moving down of course | ||
| 123 | + // Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272 | ||
| 124 | + var temp = $scope.parameters[index]; | ||
| 125 | + $scope.parameters.splice(index, 1); | ||
| 126 | + $timeout(function(){ | ||
| 127 | + $scope.parameters.splice(index + 1, 0, temp); | ||
| 128 | + }, 100); | ||
| 129 | + | ||
| 130 | + } | ||
| 131 | + } | ||
| 132 | + }; | ||
| 133 | + | ||
| 134 | + // Click handler for save button | ||
| 135 | + $scope.save = function() { | ||
| 136 | + | ||
| 137 | + if ($scope.parameters.length > 0) { | ||
| 138 | + $scope.property.value = {}; | ||
| 139 | + $scope.property.value.outParameters = $scope.parameters; | ||
| 140 | + } else { | ||
| 141 | + $scope.property.value = null; | ||
| 142 | + } | ||
| 143 | + | ||
| 144 | + $scope.updatePropertyInModel($scope.property); | ||
| 145 | + $scope.close(); | ||
| 146 | + }; | ||
| 147 | + | ||
| 148 | + $scope.cancel = function() { | ||
| 149 | + $scope.close(); | ||
| 150 | + }; | ||
| 151 | + | ||
| 152 | + // Close button handler | ||
| 153 | + $scope.close = function() { | ||
| 154 | + $scope.property.mode = 'read'; | ||
| 155 | + $scope.$hide(); | ||
| 156 | + }; | ||
| 157 | + | ||
| 158 | +}]; |
| 1 | +/* | ||
| 2 | + * Activiti Modeler component part of the Activiti project | ||
| 3 | + * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. | ||
| 4 | + * | ||
| 5 | + * This library is free software; you can redistribute it and/or | ||
| 6 | + * modify it under the terms of the GNU Lesser General Public | ||
| 7 | + * License as published by the Free Software Foundation; either | ||
| 8 | + * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | + * | ||
| 10 | + * This library is distributed in the hope that it will be useful, | ||
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | + * Lesser General Public License for more details. | ||
| 14 | + | ||
| 15 | + * You should have received a copy of the GNU Lesser General Public | ||
| 16 | + * License along with this library; if not, write to the Free Software | ||
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | + */ | ||
| 19 | + | ||
| 20 | +/* | ||
| 21 | + * Sequence flow order controller | ||
| 22 | + */ | ||
| 23 | + | ||
| 24 | +var KisBpmSequenceFlowOrderCtrl = [ '$scope', '$modal', '$timeout', '$translate', function($scope, $modal, $timeout, $translate) { | ||
| 25 | + | ||
| 26 | + // Config for the modal window | ||
| 27 | + var opts = { | ||
| 28 | + template: 'editor-app/configuration/properties/sequenceflow-order-popup.html?version=' + Date.now(), | ||
| 29 | + scope: $scope | ||
| 30 | + }; | ||
| 31 | + | ||
| 32 | + $modal(opts); | ||
| 33 | +}]; | ||
| 34 | + | ||
| 35 | +var KisBpmSequenceFlowOrderPopupCtrl = ['$scope', '$translate', function($scope, $translate) { | ||
| 36 | + | ||
| 37 | + // Find the outgoing sequence flow of the current selected shape | ||
| 38 | + var outgoingSequenceFlow = []; | ||
| 39 | + var selectedShape = $scope.selectedShape; | ||
| 40 | + if (selectedShape) { | ||
| 41 | + var outgoingNodes = selectedShape.getOutgoingShapes(); | ||
| 42 | + for (var i=0; i<outgoingNodes.length; i++) { | ||
| 43 | + if (outgoingNodes[i].getStencil().title() === 'Sequence flow') { | ||
| 44 | + var targetActivity = outgoingNodes[i].getTarget(); | ||
| 45 | + // We need the resourceId of a sequence flow, not the id because that will change with every editor load | ||
| 46 | + outgoingSequenceFlow.push({ | ||
| 47 | + id : outgoingNodes[i].resourceId, | ||
| 48 | + targetTitle : targetActivity.properties['oryx-name'], | ||
| 49 | + targetType : targetActivity.getStencil().title() | ||
| 50 | + }); | ||
| 51 | + } | ||
| 52 | + } | ||
| 53 | + } else { | ||
| 54 | + console.log('Programmatic error: no selected shape found'); | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + // Now we can apply the order which was (possibly) previously saved | ||
| 58 | + var orderedOutgoingSequenceFlow = []; | ||
| 59 | + if ($scope.property.value && $scope.property.value.sequenceFlowOrder) { | ||
| 60 | + | ||
| 61 | + var sequenceFlowOrderList = $scope.property.value.sequenceFlowOrder; | ||
| 62 | + | ||
| 63 | + // Loop the list of sequence flow that was saved in the json model and match them with the outgoing sequence flow found above | ||
| 64 | + for (var flowIndex=0; flowIndex < sequenceFlowOrderList.length; flowIndex++) { | ||
| 65 | + | ||
| 66 | + // find the sequence flow in the outgoing sequence flows. | ||
| 67 | + | ||
| 68 | + for (var outgoingFlowIndex=0; outgoingFlowIndex < outgoingSequenceFlow.length; outgoingFlowIndex++) { | ||
| 69 | + if (outgoingSequenceFlow[outgoingFlowIndex].id === sequenceFlowOrderList[flowIndex]) { | ||
| 70 | + orderedOutgoingSequenceFlow.push(outgoingSequenceFlow[outgoingFlowIndex]); | ||
| 71 | + outgoingSequenceFlow.splice(outgoingFlowIndex, 1); | ||
| 72 | + break; | ||
| 73 | + } | ||
| 74 | + } | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + // Now all the matching sequence flow we're removed from the outgoing sequence flow list | ||
| 78 | + // We can simply apply the remaining ones (these are new vs. the time when the values were saved to the model) | ||
| 79 | + orderedOutgoingSequenceFlow = orderedOutgoingSequenceFlow.concat(outgoingSequenceFlow); | ||
| 80 | + | ||
| 81 | + } else { | ||
| 82 | + orderedOutgoingSequenceFlow = outgoingSequenceFlow; | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + // Now we can put it on the scope | ||
| 86 | + $scope.outgoingSequenceFlow = orderedOutgoingSequenceFlow; | ||
| 87 | + | ||
| 88 | + // Move up click handler | ||
| 89 | + $scope.moveUp = function(index) { | ||
| 90 | + var temp = $scope.outgoingSequenceFlow[index]; | ||
| 91 | + $scope.outgoingSequenceFlow[index] = $scope.outgoingSequenceFlow[index - 1]; | ||
| 92 | + $scope.outgoingSequenceFlow[index - 1] = temp; | ||
| 93 | + }; | ||
| 94 | + | ||
| 95 | + // Move down click handler | ||
| 96 | + $scope.moveDown = function(index) { | ||
| 97 | + var temp = $scope.outgoingSequenceFlow[index]; | ||
| 98 | + $scope.outgoingSequenceFlow[index] = $scope.outgoingSequenceFlow[index + 1]; | ||
| 99 | + $scope.outgoingSequenceFlow[index + 1] = temp; | ||
| 100 | + }; | ||
| 101 | + | ||
| 102 | + // Save click handler | ||
| 103 | + $scope.save = function() { | ||
| 104 | + if ($scope.outgoingSequenceFlow.length > 0) { | ||
| 105 | + $scope.property.value = {}; | ||
| 106 | + $scope.property.value.sequenceFlowOrder = []; | ||
| 107 | + | ||
| 108 | + for (var flowIndex=0; flowIndex < $scope.outgoingSequenceFlow.length; flowIndex++) { | ||
| 109 | + $scope.property.value.sequenceFlowOrder.push($scope.outgoingSequenceFlow[flowIndex].id); | ||
| 110 | + } | ||
| 111 | + } else { | ||
| 112 | + $scope.property.value = null; | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + $scope.updatePropertyInModel($scope.property); | ||
| 116 | + $scope.close(); | ||
| 117 | + }; | ||
| 118 | + | ||
| 119 | + // Cancel click handler | ||
| 120 | + $scope.cancel = function() { | ||
| 121 | + $scope.close(); | ||
| 122 | + }; | ||
| 123 | + | ||
| 124 | + // Close button handler | ||
| 125 | + $scope.close = function() { | ||
| 126 | + $scope.property.mode = 'read'; | ||
| 127 | + $scope.$hide(); | ||
| 128 | + }; | ||
| 129 | + | ||
| 130 | +}]; |
| 1 | +/* | ||
| 2 | + * Activiti Modeler component part of the Activiti project | ||
| 3 | + * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. | ||
| 4 | + * | ||
| 5 | + * This library is free software; you can redistribute it and/or | ||
| 6 | + * modify it under the terms of the GNU Lesser General Public | ||
| 7 | + * License as published by the Free Software Foundation; either | ||
| 8 | + * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | + * | ||
| 10 | + * This library is distributed in the hope that it will be useful, | ||
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | + * Lesser General Public License for more details. | ||
| 14 | + | ||
| 15 | + * You should have received a copy of the GNU Lesser General Public | ||
| 16 | + * License along with this library; if not, write to the Free Software | ||
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | + */ | ||
| 19 | + | ||
| 20 | +angular.module('activitiModeler').controller('ActivitiSignalDefinitionsCtrl', ['$scope', '$modal', function ($scope, $modal) { | ||
| 21 | + | ||
| 22 | + // Config for the modal window | ||
| 23 | + var opts = { | ||
| 24 | + template: 'editor-app/configuration/properties/signal-definitions-popup.html?version=' + Date.now(), | ||
| 25 | + scope: $scope | ||
| 26 | + }; | ||
| 27 | + | ||
| 28 | + // Open the dialog | ||
| 29 | + $modal(opts); | ||
| 30 | +}]); | ||
| 31 | + | ||
| 32 | +//Need a separate controller for the modal window due to https://github.com/angular-ui/bootstrap/issues/259 | ||
| 33 | +// Will be fixed in a newer version of Angular UI | ||
| 34 | +angular.module('activitiModeler').controller('ActivitiSignalDefinitionsPopupCtrl', | ||
| 35 | + ['$scope', '$q', '$translate', '$timeout', function ($scope, $q, $translate, $timeout) { | ||
| 36 | + | ||
| 37 | + // Put json representing signal definitions on scope | ||
| 38 | + if ($scope.property.value !== undefined && $scope.property.value !== null && $scope.property.value.length > 0) { | ||
| 39 | + | ||
| 40 | + if ($scope.property.value.constructor == String) { | ||
| 41 | + $scope.signalDefinitions = JSON.parse($scope.property.value); | ||
| 42 | + } | ||
| 43 | + else { | ||
| 44 | + // Note that we clone the json object rather then setting it directly, | ||
| 45 | + // this to cope with the fact that the user can click the cancel button and no changes should have happened | ||
| 46 | + $scope.signalDefinitions = angular.copy($scope.property.value); | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + } else { | ||
| 50 | + $scope.signalDefinitions = []; | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + // Array to contain selected signal definitions (yes - we only can select one, but ng-grid isn't smart enough) | ||
| 54 | + $scope.selectedSignals = []; | ||
| 55 | + $scope.translationsRetrieved = false; | ||
| 56 | + | ||
| 57 | + $scope.labels = {}; | ||
| 58 | + | ||
| 59 | + var idPromise = $translate('PROPERTY.SIGNALDEFINITIONS.ID'); | ||
| 60 | + var namePromise = $translate('PROPERTY.SIGNALDEFINITIONS.NAME'); | ||
| 61 | + var scopePromise = $translate('PROPERTY.SIGNALDEFINITIONS.SCOPE'); | ||
| 62 | + | ||
| 63 | + $q.all([idPromise, namePromise, scopePromise]).then(function (results) { | ||
| 64 | + | ||
| 65 | + $scope.labels.idLabel = results[0]; | ||
| 66 | + $scope.labels.nameLabel = results[1]; | ||
| 67 | + $scope.labels.scopeLabel = results[2]; | ||
| 68 | + $scope.translationsRetrieved = true; | ||
| 69 | + | ||
| 70 | + // Config for grid | ||
| 71 | + $scope.gridOptions = { | ||
| 72 | + data: 'signalDefinitions', | ||
| 73 | + headerRowHeight: 28, | ||
| 74 | + enableRowSelection: true, | ||
| 75 | + enableRowHeaderSelection: false, | ||
| 76 | + multiSelect: false, | ||
| 77 | + keepLastSelected : false, | ||
| 78 | + selectedItems: $scope.selectedSignals, | ||
| 79 | + columnDefs: [ | ||
| 80 | + {field: 'id', displayName: $scope.labels.idLabel}, | ||
| 81 | + {field: 'name', displayName: $scope.labels.nameLabel}, | ||
| 82 | + {field: 'scope', displayName: $scope.labels.scopeLabel}] | ||
| 83 | + }; | ||
| 84 | + }); | ||
| 85 | + | ||
| 86 | + // Click handler for add button | ||
| 87 | + $scope.addNewSignalDefinition = function () { | ||
| 88 | + var newSignalDefinition = {id: '', name: '', scope: 'global'}; | ||
| 89 | + | ||
| 90 | + $scope.signalDefinitions.push(newSignalDefinition); | ||
| 91 | + $timeout(function () { | ||
| 92 | + $scope.gridOptions.selectItem($scope.signalDefinitions.length - 1, true); | ||
| 93 | + }); | ||
| 94 | + }; | ||
| 95 | + | ||
| 96 | + // Click handler for remove button | ||
| 97 | + $scope.removeSignalDefinition = function () { | ||
| 98 | + if ($scope.selectedSignals && $scope.selectedSignals.length > 0) { | ||
| 99 | + var index = $scope.signalDefinitions.indexOf($scope.selectedSignals[0]); | ||
| 100 | + $scope.gridOptions.selectItem(index, false); | ||
| 101 | + $scope.signalDefinitions.splice(index, 1); | ||
| 102 | + | ||
| 103 | + $scope.selectedSignals.length = 0; | ||
| 104 | + if (index < $scope.signalDefinitions.length) { | ||
| 105 | + $scope.gridOptions.selectItem(index + 1, true); | ||
| 106 | + } else if ($scope.signalDefinitions.length > 0) { | ||
| 107 | + $scope.gridOptions.selectItem(index - 1, true); | ||
| 108 | + } | ||
| 109 | + } | ||
| 110 | + }; | ||
| 111 | + | ||
| 112 | + // Click handler for save button | ||
| 113 | + $scope.save = function () { | ||
| 114 | + | ||
| 115 | + if ($scope.signalDefinitions.length > 0) { | ||
| 116 | + $scope.property.value = $scope.signalDefinitions; | ||
| 117 | + } else { | ||
| 118 | + $scope.property.value = null; | ||
| 119 | + } | ||
| 120 | + | ||
| 121 | + $scope.updatePropertyInModel($scope.property); | ||
| 122 | + $scope.close(); | ||
| 123 | + }; | ||
| 124 | + | ||
| 125 | + $scope.cancel = function () { | ||
| 126 | + $scope.property.mode = 'read'; | ||
| 127 | + $scope.$hide(); | ||
| 128 | + }; | ||
| 129 | + | ||
| 130 | + // Close button handler | ||
| 131 | + $scope.close = function () { | ||
| 132 | + $scope.property.mode = 'read'; | ||
| 133 | + $scope.$hide(); | ||
| 134 | + }; | ||
| 135 | + | ||
| 136 | + }]); |
src/main/webapp/act/process-editor/editor-app/configuration/properties-signal-scope-controller.js
0 → 100644
| 1 | +/* | ||
| 2 | + * Activiti Modeler component part of the Activiti project | ||
| 3 | + * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. | ||
| 4 | + * | ||
| 5 | + * This library is free software; you can redistribute it and/or | ||
| 6 | + * modify it under the terms of the GNU Lesser General Public | ||
| 7 | + * License as published by the Free Software Foundation; either | ||
| 8 | + * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | + * | ||
| 10 | + * This library is distributed in the hope that it will be useful, | ||
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | + * Lesser General Public License for more details. | ||
| 14 | + | ||
| 15 | + * You should have received a copy of the GNU Lesser General Public | ||
| 16 | + * License along with this library; if not, write to the Free Software | ||
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | + */ | ||
| 19 | +angular.module('activitiModeler').controller('ActivitiSignalRefCtrl', [ '$scope', function($scope) { | ||
| 20 | + | ||
| 21 | + // Find the parent shape on which the signal definitions are defined | ||
| 22 | + var signalDefinitionsProperty = undefined; | ||
| 23 | + var parent = $scope.selectedShape; | ||
| 24 | + while (parent !== null && parent !== undefined && signalDefinitionsProperty === undefined) { | ||
| 25 | + if (parent.properties && parent.properties['oryx-signaldefinitions']) { | ||
| 26 | + signalDefinitionsProperty = parent.properties['oryx-signaldefinitions']; | ||
| 27 | + } else { | ||
| 28 | + parent = parent.parent; | ||
| 29 | + } | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + try { | ||
| 33 | + signalDefinitionsProperty = JSON.parse(signalDefinitionsProperty); | ||
| 34 | + if (typeof signalDefinitionsProperty == 'string') { | ||
| 35 | + signalDefinitionsProperty = JSON.parse(signalDefinitionsProperty); | ||
| 36 | + } | ||
| 37 | + } catch (err) { | ||
| 38 | + // Do nothing here, just to be sure we try-catch it | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + $scope.signalDefinitions = signalDefinitionsProperty; | ||
| 42 | + | ||
| 43 | + | ||
| 44 | + $scope.signalChanged = function() { | ||
| 45 | + $scope.updatePropertyInModel($scope.property); | ||
| 46 | + }; | ||
| 47 | +}]); |
src/main/webapp/act/process-editor/editor-app/configuration/properties-task-listeners-controller.js
0 → 100644
| 1 | +/* | ||
| 2 | + * Activiti Modeler component part of the Activiti project | ||
| 3 | + * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. | ||
| 4 | + * | ||
| 5 | + * This library is free software; you can redistribute it and/or | ||
| 6 | + * modify it under the terms of the GNU Lesser General Public | ||
| 7 | + * License as published by the Free Software Foundation; either | ||
| 8 | + * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | + * | ||
| 10 | + * This library is distributed in the hope that it will be useful, | ||
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | + * Lesser General Public License for more details. | ||
| 14 | + | ||
| 15 | + * You should have received a copy of the GNU Lesser General Public | ||
| 16 | + * License along with this library; if not, write to the Free Software | ||
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | + */ | ||
| 19 | + | ||
| 20 | +/* | ||
| 21 | + * Task listeners | ||
| 22 | + */ | ||
| 23 | + | ||
| 24 | +var KisBpmTaskListenersCtrl = [ '$scope', '$modal', '$timeout', '$translate', function($scope, $modal, $timeout, $translate) { | ||
| 25 | + | ||
| 26 | + // Config for the modal window | ||
| 27 | + var opts = { | ||
| 28 | + template: 'editor-app/configuration/properties/task-listeners-popup.html?version=' + Date.now(), | ||
| 29 | + scope: $scope | ||
| 30 | + }; | ||
| 31 | + | ||
| 32 | + // Open the dialog | ||
| 33 | + $modal(opts); | ||
| 34 | +}]; | ||
| 35 | + | ||
| 36 | +var KisBpmTaskListenersPopupCtrl = [ '$scope', '$q', '$translate', function($scope, $q, $translate) { | ||
| 37 | + | ||
| 38 | + // Put json representing form properties on scope | ||
| 39 | + if ($scope.property.value !== undefined && $scope.property.value !== null | ||
| 40 | + && $scope.property.value.taskListeners !== undefined | ||
| 41 | + && $scope.property.value.taskListeners !== null) { | ||
| 42 | + | ||
| 43 | + if ($scope.property.value.taskListeners.constructor == String) | ||
| 44 | + { | ||
| 45 | + $scope.taskListeners = JSON.parse($scope.property.value.taskListeners); | ||
| 46 | + } | ||
| 47 | + else | ||
| 48 | + { | ||
| 49 | + // Note that we clone the json object rather then setting it directly, | ||
| 50 | + // this to cope with the fact that the user can click the cancel button and no changes should have happened | ||
| 51 | + $scope.taskListeners = angular.copy($scope.property.value.taskListeners); | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + for (var i = 0; i < $scope.taskListeners.length; i++) | ||
| 55 | + { | ||
| 56 | + var taskListener = $scope.taskListeners[i]; | ||
| 57 | + if (taskListener.className !== undefined && taskListener.className !== '') | ||
| 58 | + { | ||
| 59 | + taskListener.implementation = taskListener.className; | ||
| 60 | + } | ||
| 61 | + else if (taskListener.expression !== undefined && taskListener.expression !== '') | ||
| 62 | + { | ||
| 63 | + taskListener.implementation = taskListener.expression; | ||
| 64 | + } | ||
| 65 | + else if (taskListener.delegateExpression !== undefined && taskListener.delegateExpression !== '') | ||
| 66 | + { | ||
| 67 | + taskListener.implementation = taskListener.delegateExpression; | ||
| 68 | + } | ||
| 69 | + } | ||
| 70 | + } else { | ||
| 71 | + $scope.taskListeners = []; | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + // Array to contain selected properties (yes - we only can select one, but ng-grid isn't smart enough) | ||
| 75 | + $scope.selectedListeners = []; | ||
| 76 | + $scope.selectedFields = []; | ||
| 77 | + $scope.translationsRetrieved = false; | ||
| 78 | + | ||
| 79 | + $scope.labels = {}; | ||
| 80 | + | ||
| 81 | + var eventPromise = $translate('PROPERTY.TASKLISTENERS.EVENT'); | ||
| 82 | + var implementationPromise = $translate('PROPERTY.TASKLISTENERS.FIELDS.IMPLEMENTATION'); | ||
| 83 | + var namePromise = $translate('PROPERTY.TASKLISTENERS.FIELDS.NAME'); | ||
| 84 | + | ||
| 85 | + $q.all([eventPromise, implementationPromise, namePromise]).then(function(results) { | ||
| 86 | + $scope.labels.eventLabel = results[0]; | ||
| 87 | + $scope.labels.implementationLabel = results[1]; | ||
| 88 | + $scope.labels.nameLabel = results[2]; | ||
| 89 | + $scope.translationsRetrieved = true; | ||
| 90 | + | ||
| 91 | + // Config for grid | ||
| 92 | + $scope.gridOptions = { | ||
| 93 | + data: 'taskListeners', | ||
| 94 | + enableRowReordering: true, | ||
| 95 | + headerRowHeight: 28, | ||
| 96 | + multiSelect: false, | ||
| 97 | + keepLastSelected : false, | ||
| 98 | + selectedItems: $scope.selectedListeners, | ||
| 99 | + afterSelectionChange: function (rowItem, event) { | ||
| 100 | + $scope.selectedFields.length = 0; | ||
| 101 | + if ($scope.selectedListeners.length > 0) | ||
| 102 | + { | ||
| 103 | + var fields = $scope.selectedListeners[0].fields; | ||
| 104 | + if (fields !== undefined && fields !== null) | ||
| 105 | + { | ||
| 106 | + for (var i = 0; i < fields.length; i++) | ||
| 107 | + { | ||
| 108 | + var field = fields[i]; | ||
| 109 | + if (field.stringValue !== undefined && field.stringValue !== '') | ||
| 110 | + { | ||
| 111 | + field.implementation = field.stringValue; | ||
| 112 | + } | ||
| 113 | + else if (field.expression !== undefined && field.expression !== '') | ||
| 114 | + { | ||
| 115 | + field.implementation = field.expression; | ||
| 116 | + } | ||
| 117 | + else if (field.string !== undefined && field.string !== '') | ||
| 118 | + { | ||
| 119 | + field.implementation = field.string; | ||
| 120 | + } | ||
| 121 | + } | ||
| 122 | + } | ||
| 123 | + } | ||
| 124 | + }, | ||
| 125 | + columnDefs: [{ field: 'event', displayName: $scope.labels.eventLabel }, | ||
| 126 | + { field: 'implementation', displayName: $scope.labels.implementationLabel}] | ||
| 127 | + }; | ||
| 128 | + | ||
| 129 | + // Config for field grid | ||
| 130 | + $scope.gridFieldOptions = { | ||
| 131 | + data: 'selectedListeners[0].fields', | ||
| 132 | + enableRowReordering: true, | ||
| 133 | + headerRowHeight: 28, | ||
| 134 | + multiSelect: false, | ||
| 135 | + keepLastSelected : false, | ||
| 136 | + selectedItems: $scope.selectedFields, | ||
| 137 | + columnDefs: [{ field: 'name', displayName: $scope.labels.name }, | ||
| 138 | + { field: 'implementation', displayName: $scope.labels.implementationLabel}] | ||
| 139 | + }; | ||
| 140 | + }); | ||
| 141 | + | ||
| 142 | + $scope.listenerDetailsChanged = function() { | ||
| 143 | + if ($scope.selectedListeners[0].className !== '') | ||
| 144 | + { | ||
| 145 | + $scope.selectedListeners[0].implementation = $scope.selectedListeners[0].className; | ||
| 146 | + } | ||
| 147 | + else if ($scope.selectedListeners[0].expression !== '') | ||
| 148 | + { | ||
| 149 | + $scope.selectedListeners[0].implementation = $scope.selectedListeners[0].expression; | ||
| 150 | + } | ||
| 151 | + else if ($scope.selectedListeners[0].delegateExpression !== '') | ||
| 152 | + { | ||
| 153 | + $scope.selectedListeners[0].implementation = $scope.selectedListeners[0].delegateExpression; | ||
| 154 | + } | ||
| 155 | + else | ||
| 156 | + { | ||
| 157 | + $scope.selectedListeners[0].implementation = ''; | ||
| 158 | + } | ||
| 159 | + }; | ||
| 160 | + | ||
| 161 | + // Click handler for add button | ||
| 162 | + $scope.addNewListener = function() { | ||
| 163 | + $scope.taskListeners.push({ event : 'create', | ||
| 164 | + implementation : '', | ||
| 165 | + className : '', | ||
| 166 | + expression: '', | ||
| 167 | + delegateExpression: ''}); | ||
| 168 | + }; | ||
| 169 | + | ||
| 170 | + // Click handler for remove button | ||
| 171 | + $scope.removeListener = function() { | ||
| 172 | + if ($scope.selectedListeners.length > 0) { | ||
| 173 | + var index = $scope.taskListeners.indexOf($scope.selectedListeners[0]); | ||
| 174 | + $scope.gridOptions.selectItem(index, false); | ||
| 175 | + $scope.taskListeners.splice(index, 1); | ||
| 176 | + | ||
| 177 | + $scope.selectedListeners.length = 0; | ||
| 178 | + if (index < $scope.taskListeners.length) { | ||
| 179 | + $scope.gridOptions.selectItem(index + 1, true); | ||
| 180 | + } else if ($scope.taskListeners.length > 0) { | ||
| 181 | + $scope.gridOptions.selectItem(index - 1, true); | ||
| 182 | + } | ||
| 183 | + } | ||
| 184 | + }; | ||
| 185 | + | ||
| 186 | + // Click handler for up button | ||
| 187 | + $scope.moveListenerUp = function() { | ||
| 188 | + if ($scope.selectedListeners.length > 0) { | ||
| 189 | + var index = $scope.taskListeners.indexOf($scope.selectedListeners[0]); | ||
| 190 | + if (index != 0) { // If it's the first, no moving up of course | ||
| 191 | + // Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272 | ||
| 192 | + var temp = $scope.taskListeners[index]; | ||
| 193 | + $scope.taskListeners.splice(index, 1); | ||
| 194 | + $timeout(function(){ | ||
| 195 | + $scope.taskListeners.splice(index + -1, 0, temp); | ||
| 196 | + }, 100); | ||
| 197 | + | ||
| 198 | + } | ||
| 199 | + } | ||
| 200 | + }; | ||
| 201 | + | ||
| 202 | + // Click handler for down button | ||
| 203 | + $scope.moveListenerDown = function() { | ||
| 204 | + if ($scope.selectedListeners.length > 0) { | ||
| 205 | + var index = $scope.taskListeners.indexOf($scope.selectedListeners[0]); | ||
| 206 | + if (index != $scope.taskListeners.length - 1) { // If it's the last element, no moving down of course | ||
| 207 | + // Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272 | ||
| 208 | + var temp = $scope.taskListeners[index]; | ||
| 209 | + $scope.taskListeners.splice(index, 1); | ||
| 210 | + $timeout(function(){ | ||
| 211 | + $scope.taskListeners.splice(index + 1, 0, temp); | ||
| 212 | + }, 100); | ||
| 213 | + | ||
| 214 | + } | ||
| 215 | + } | ||
| 216 | + }; | ||
| 217 | + | ||
| 218 | + $scope.fieldDetailsChanged = function() { | ||
| 219 | + if ($scope.selectedFields[0].stringValue != '') | ||
| 220 | + { | ||
| 221 | + $scope.selectedFields[0].implementation = $scope.selectedFields[0].stringValue; | ||
| 222 | + } | ||
| 223 | + else if ($scope.selectedFields[0].expression != '') | ||
| 224 | + { | ||
| 225 | + $scope.selectedFields[0].implementation = $scope.selectedFields[0].expression; | ||
| 226 | + } | ||
| 227 | + else if ($scope.selectedFields[0].string != '') | ||
| 228 | + { | ||
| 229 | + $scope.selectedFields[0].implementation = $scope.selectedFields[0].string; | ||
| 230 | + } | ||
| 231 | + else | ||
| 232 | + { | ||
| 233 | + $scope.selectedFields[0].implementation = ''; | ||
| 234 | + } | ||
| 235 | + }; | ||
| 236 | + | ||
| 237 | + // Click handler for add button | ||
| 238 | + $scope.addNewField = function() { | ||
| 239 | + if ($scope.selectedListeners.length > 0) | ||
| 240 | + { | ||
| 241 | + if ($scope.selectedListeners[0].fields == undefined) | ||
| 242 | + { | ||
| 243 | + $scope.selectedListeners[0].fields = []; | ||
| 244 | + } | ||
| 245 | + $scope.selectedListeners[0].fields.push({ name : 'fieldName', | ||
| 246 | + implementation : '', | ||
| 247 | + stringValue : '', | ||
| 248 | + expression: '', | ||
| 249 | + string: ''}); | ||
| 250 | + } | ||
| 251 | + }; | ||
| 252 | + | ||
| 253 | + // Click handler for remove button | ||
| 254 | + $scope.removeField = function() { | ||
| 255 | + if ($scope.selectedFields.length > 0) { | ||
| 256 | + var index = $scope.selectedListeners[0].fields.indexOf($scope.selectedFields[0]); | ||
| 257 | + $scope.gridFieldOptions.selectItem(index, false); | ||
| 258 | + $scope.selectedListeners[0].fields.splice(index, 1); | ||
| 259 | + | ||
| 260 | + $scope.selectedFields.length = 0; | ||
| 261 | + if (index < $scope.selectedListeners[0].fields.length) { | ||
| 262 | + $scope.gridFieldOptions.selectItem(index + 1, true); | ||
| 263 | + } else if ($scope.selectedListeners[0].fields.length > 0) { | ||
| 264 | + $scope.gridFieldOptions.selectItem(index - 1, true); | ||
| 265 | + } | ||
| 266 | + } | ||
| 267 | + }; | ||
| 268 | + | ||
| 269 | + // Click handler for up button | ||
| 270 | + $scope.moveFieldUp = function() { | ||
| 271 | + if ($scope.selectedFields.length > 0) { | ||
| 272 | + var index = $scope.selectedListeners[0].fields.indexOf($scope.selectedFields[0]); | ||
| 273 | + if (index != 0) { // If it's the first, no moving up of course | ||
| 274 | + // Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272 | ||
| 275 | + var temp = $scope.selectedListeners[0].fields[index]; | ||
| 276 | + $scope.selectedListeners[0].fields.splice(index, 1); | ||
| 277 | + $timeout(function(){ | ||
| 278 | + $scope.selectedListeners[0].fields.splice(index + -1, 0, temp); | ||
| 279 | + }, 100); | ||
| 280 | + | ||
| 281 | + } | ||
| 282 | + } | ||
| 283 | + }; | ||
| 284 | + | ||
| 285 | + // Click handler for down button | ||
| 286 | + $scope.moveFieldDown = function() { | ||
| 287 | + if ($scope.selectedFields.length > 0) { | ||
| 288 | + var index = $scope.selectedListeners[0].fields.indexOf($scope.selectedFields[0]); | ||
| 289 | + if (index != $scope.selectedListeners[0].fields.length - 1) { // If it's the last element, no moving down of course | ||
| 290 | + // Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272 | ||
| 291 | + var temp = $scope.selectedListeners[0].fields[index]; | ||
| 292 | + $scope.selectedListeners[0].fields.splice(index, 1); | ||
| 293 | + $timeout(function(){ | ||
| 294 | + $scope.selectedListeners[0].fields.splice(index + 1, 0, temp); | ||
| 295 | + }, 100); | ||
| 296 | + | ||
| 297 | + } | ||
| 298 | + } | ||
| 299 | + }; | ||
| 300 | + | ||
| 301 | + // Click handler for save button | ||
| 302 | + $scope.save = function() { | ||
| 303 | + | ||
| 304 | + if ($scope.taskListeners.length > 0) { | ||
| 305 | + $scope.property.value = {}; | ||
| 306 | + $scope.property.value.taskListeners = $scope.taskListeners; | ||
| 307 | + } else { | ||
| 308 | + $scope.property.value = null; | ||
| 309 | + } | ||
| 310 | + | ||
| 311 | + $scope.updatePropertyInModel($scope.property); | ||
| 312 | + $scope.close(); | ||
| 313 | + }; | ||
| 314 | + | ||
| 315 | + $scope.cancel = function() { | ||
| 316 | + $scope.close(); | ||
| 317 | + }; | ||
| 318 | + | ||
| 319 | + // Close button handler | ||
| 320 | + $scope.close = function() { | ||
| 321 | + $scope.property.mode = 'read'; | ||
| 322 | + $scope.$hide(); | ||
| 323 | + }; | ||
| 324 | + | ||
| 325 | +}]; |
| 1 | +/* | ||
| 2 | + * Activiti Modeler component part of the Activiti project | ||
| 3 | + * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. | ||
| 4 | + * | ||
| 5 | + * This library is free software; you can redistribute it and/or | ||
| 6 | + * modify it under the terms of the GNU Lesser General Public | ||
| 7 | + * License as published by the Free Software Foundation; either | ||
| 8 | + * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | + * | ||
| 10 | + * This library is distributed in the hope that it will be useful, | ||
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | + * Lesser General Public License for more details. | ||
| 14 | + | ||
| 15 | + * You should have received a copy of the GNU Lesser General Public | ||
| 16 | + * License along with this library; if not, write to the Free Software | ||
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | + */ | ||
| 19 | +'use strict'; | ||
| 20 | + | ||
| 21 | +var KISBPM = KISBPM || {}; | ||
| 22 | +KISBPM.PROPERTY_CONFIG = | ||
| 23 | +{ | ||
| 24 | + "string": { | ||
| 25 | + "readModeTemplateUrl": "editor-app/configuration/properties/default-value-display-template.html", | ||
| 26 | + "writeModeTemplateUrl": "editor-app/configuration/properties/string-property-write-mode-template.html" | ||
| 27 | + }, | ||
| 28 | + "boolean": { | ||
| 29 | + "templateUrl": "editor-app/configuration/properties/boolean-property-template.html" | ||
| 30 | + }, | ||
| 31 | + "text" : { | ||
| 32 | + "readModeTemplateUrl": "editor-app/configuration/properties/default-value-display-template.html", | ||
| 33 | + "writeModeTemplateUrl": "editor-app/configuration/properties/text-property-write-template.html" | ||
| 34 | + }, | ||
| 35 | + "kisbpm-multiinstance" : { | ||
| 36 | + "readModeTemplateUrl": "editor-app/configuration/properties/default-value-display-template.html", | ||
| 37 | + "writeModeTemplateUrl": "editor-app/configuration/properties/multiinstance-property-write-template.html" | ||
| 38 | + }, | ||
| 39 | + "oryx-formproperties-complex": { | ||
| 40 | + "readModeTemplateUrl": "editor-app/configuration/properties/form-properties-display-template.html", | ||
| 41 | + "writeModeTemplateUrl": "editor-app/configuration/properties/form-properties-write-template.html" | ||
| 42 | + }, | ||
| 43 | + "oryx-executionlisteners-multiplecomplex": { | ||
| 44 | + "readModeTemplateUrl": "editor-app/configuration/properties/execution-listeners-display-template.html", | ||
| 45 | + "writeModeTemplateUrl": "editor-app/configuration/properties/execution-listeners-write-template.html" | ||
| 46 | + }, | ||
| 47 | + "oryx-tasklisteners-multiplecomplex": { | ||
| 48 | + "readModeTemplateUrl": "editor-app/configuration/properties/task-listeners-display-template.html", | ||
| 49 | + "writeModeTemplateUrl": "editor-app/configuration/properties/task-listeners-write-template.html" | ||
| 50 | + }, | ||
| 51 | + "oryx-eventlisteners-multiplecomplex": { | ||
| 52 | + "readModeTemplateUrl": "editor-app/configuration/properties/event-listeners-display-template.html", | ||
| 53 | + "writeModeTemplateUrl": "editor-app/configuration/properties/event-listeners-write-template.html" | ||
| 54 | + }, | ||
| 55 | + "oryx-usertaskassignment-complex": { | ||
| 56 | + "readModeTemplateUrl": "editor-app/configuration/properties/assignment-display-template.html", | ||
| 57 | + "writeModeTemplateUrl": "editor-app/configuration/properties/assignment-write-template.html" | ||
| 58 | + }, | ||
| 59 | + "oryx-servicetaskfields-complex": { | ||
| 60 | + "readModeTemplateUrl": "editor-app/configuration/properties/fields-display-template.html", | ||
| 61 | + "writeModeTemplateUrl": "editor-app/configuration/properties/fields-write-template.html" | ||
| 62 | + }, | ||
| 63 | + "oryx-callactivityinparameters-complex": { | ||
| 64 | + "readModeTemplateUrl": "editor-app/configuration/properties/in-parameters-display-template.html", | ||
| 65 | + "writeModeTemplateUrl": "editor-app/configuration/properties/in-parameters-write-template.html" | ||
| 66 | + }, | ||
| 67 | + "oryx-callactivityoutparameters-complex": { | ||
| 68 | + "readModeTemplateUrl": "editor-app/configuration/properties/out-parameters-display-template.html", | ||
| 69 | + "writeModeTemplateUrl": "editor-app/configuration/properties/out-parameters-write-template.html" | ||
| 70 | + }, | ||
| 71 | + "oryx-subprocessreference-complex": { | ||
| 72 | + "readModeTemplateUrl": "editor-app/configuration/properties/subprocess-reference-display-template.html", | ||
| 73 | + "writeModeTemplateUrl": "editor-app/configuration/properties/subprocess-reference-write-template.html" | ||
| 74 | + }, | ||
| 75 | + "oryx-sequencefloworder-complex" : { | ||
| 76 | + "readModeTemplateUrl": "editor-app/configuration/properties/sequenceflow-order-display-template.html", | ||
| 77 | + "writeModeTemplateUrl": "editor-app/configuration/properties/sequenceflow-order-write-template.html" | ||
| 78 | + }, | ||
| 79 | + "oryx-conditionsequenceflow-complex" : { | ||
| 80 | + "readModeTemplateUrl": "editor-app/configuration/properties/condition-expression-display-template.html", | ||
| 81 | + "writeModeTemplateUrl": "editor-app/configuration/properties/condition-expression-write-template.html" | ||
| 82 | + }, | ||
| 83 | + "oryx-signaldefinitions-multiplecomplex" : { | ||
| 84 | + "readModeTemplateUrl": "editor-app/configuration/properties/signal-definitions-display-template.html", | ||
| 85 | + "writeModeTemplateUrl": "editor-app/configuration/properties/signal-definitions-write-template.html" | ||
| 86 | + }, | ||
| 87 | + "oryx-signalref-string" : { | ||
| 88 | + "readModeTemplateUrl": "editor-app/configuration/properties/default-value-display-template.html", | ||
| 89 | + "writeModeTemplateUrl": "editor-app/configuration/properties/signal-property-write-template.html" | ||
| 90 | + }, | ||
| 91 | + "oryx-messagedefinitions-multiplecomplex" : { | ||
| 92 | + "readModeTemplateUrl": "editor-app/configuration/properties/message-definitions-display-template.html", | ||
| 93 | + "writeModeTemplateUrl": "editor-app/configuration/properties/message-definitions-write-template.html" | ||
| 94 | + }, | ||
| 95 | + "oryx-messageref-string" : { | ||
| 96 | + "readModeTemplateUrl": "editor-app/configuration/properties/default-value-display-template.html", | ||
| 97 | + "writeModeTemplateUrl": "editor-app/configuration/properties/message-property-write-template.html" | ||
| 98 | + } | ||
| 99 | +}; |
| 1 | +<span ng-if="property.value.assignment.assignee">{{'PROPERTY.ASSIGNMENT.ASSIGNEE_DISPLAY' | translate:property.value.assignment }} </span> | ||
| 2 | +<span ng-if="property.value.assignment.candidateUsers.length > 0">{{'PROPERTY.ASSIGNMENT.CANDIDATE_USERS_DISPLAY' | translate:property.value.assignment.candidateUsers}} </span> | ||
| 3 | +<span ng-if="property.value.assignment.candidateGroups.length > 0">{{'PROPERTY.ASSIGNMENT.CANDIDATE_GROUPS_DISPLAY' | translate:property.value.assignment.candidateGroups}} </span> | ||
| 4 | +<span ng-if="!property.value.assignment.assignee && (!property.value.assignment.candidateUsers || property.value.assignment.candidateUsers.length == 0) && (!property.value.assignment.candidateGroups || property.value.assignment.candidateGroups.length == 0)" translate>PROPERTY.ASSIGNMENT.EMPTY</span> |
src/main/webapp/act/process-editor/editor-app/configuration/properties/assignment-popup.html
0 → 100644
| 1 | +<div class="modal" ng-controller="KisBpmAssignmentPopupCtrl"> | ||
| 2 | + <div class="modal-dialog"> | ||
| 3 | + <div class="modal-content"> | ||
| 4 | + <div class="modal-header"> | ||
| 5 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">×</button> | ||
| 6 | + <h2 translate>PROPERTY.ASSIGNMENT.TITLE</h2> | ||
| 7 | + </div> | ||
| 8 | + <div class="modal-body"> | ||
| 9 | + | ||
| 10 | + <div class="row row-no-gutter"> | ||
| 11 | + <div class="form-group"> | ||
| 12 | + <label for="assigneeField">{{'PROPERTY.ASSIGNMENT.ASSIGNEE' | translate}}</label> | ||
| 13 | + <input type="text" id="assigneeField" class="form-control" ng-model="assignment.assignee" placeholder="{{'PROPERTY.ASSIGNMENT.ASSIGNEE_PLACEHOLDER' | translate}}" /> | ||
| 14 | + </div> | ||
| 15 | + </div> | ||
| 16 | + | ||
| 17 | + <div class="row row-no-gutter"> | ||
| 18 | + <div class="form-group"> | ||
| 19 | + <label for="userField">{{'PROPERTY.ASSIGNMENT.CANDIDATE_USERS' | translate}}</label> | ||
| 20 | + <div ng-repeat="candidateUser in assignment.candidateUsers"> | ||
| 21 | + <input id="userField" class="form-control" type="text" ng-model="candidateUser.value" /> | ||
| 22 | + <i class="glyphicon glyphicon-minus clickable-property" ng-click="removeCandidateUserValue($index)"></i> | ||
| 23 | + <i ng-if="$index == (assignment.candidateUsers.length - 1)" class="glyphicon glyphicon-plus clickable-property" ng-click="addCandidateUserValue($index)"></i> | ||
| 24 | + </div> | ||
| 25 | + </div> | ||
| 26 | + | ||
| 27 | + <div class="form-group"> | ||
| 28 | + <label for="groupField">{{'PROPERTY.ASSIGNMENT.CANDIDATE_GROUPS' | translate}}</label> | ||
| 29 | + <div ng-repeat="candidateGroup in assignment.candidateGroups"> | ||
| 30 | + <input id="groupField" class="form-control" type="text" ng-model="candidateGroup.value" /> | ||
| 31 | + <i class="glyphicon glyphicon-minus clickable-property" ng-click="removeCandidateGroupValue($index)"></i> | ||
| 32 | + <i ng-if="$index == (assignment.candidateGroups.length - 1)" class="glyphicon glyphicon-plus clickable-property" ng-click="addCandidateGroupValue($index)"></i> | ||
| 33 | + </div> | ||
| 34 | + </div> | ||
| 35 | + </div> | ||
| 36 | + | ||
| 37 | + </div> | ||
| 38 | + <div class="modal-footer"> | ||
| 39 | + <button ng-click="close()" class="btn btn-primary" translate>ACTION.CANCEL</button> | ||
| 40 | + <button ng-click="save()" class="btn btn-primary" translate>ACTION.SAVE</button> | ||
| 41 | + </div> | ||
| 42 | + </div> | ||
| 43 | + </div> | ||
| 44 | +</div> |
| 1 | + | ||
| 2 | +<div class="modal" ng-controller="KisBpmConditionExpressionPopupCtrl"> | ||
| 3 | +<div class="modal-dialog"> | ||
| 4 | +<div class="modal-content"> | ||
| 5 | +<div class="modal-header"> | ||
| 6 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">×</button> | ||
| 7 | + <h2 translate>PROPERTY.SEQUENCEFLOW.CONDITION.TITLE</h2> | ||
| 8 | +</div> | ||
| 9 | +<div class="modal-body"> | ||
| 10 | + | ||
| 11 | + <div class="detail-group clearfix"> | ||
| 12 | + | ||
| 13 | + <div class="form-group clearfix"> | ||
| 14 | + <div class="col-xs-12"> | ||
| 15 | + <label class="col-xs-3">{{'PROPERTY.SEQUENCEFLOW.CONDITION.STATIC' | translate}}</label> | ||
| 16 | + <div class="col-xs-9"> | ||
| 17 | + <textarea class="form-control" ng-model="conditionExpression.value" style="width:90%; height:100%; max-width: 100%; max-height: 100%; min-height: 100px"/> | ||
| 18 | + </div> | ||
| 19 | + </div> | ||
| 20 | + </div> | ||
| 21 | + | ||
| 22 | + </div> | ||
| 23 | + <div class="modal-footer"> | ||
| 24 | + <button ng-click="close()" class="btn btn-primary" translate>ACTION.CANCEL</button> | ||
| 25 | + <button ng-click="save()" class="btn btn-primary" translate>ACTION.SAVE</button> | ||
| 26 | + </div> | ||
| 27 | +</div> | ||
| 28 | +</div> | ||
| 29 | +</div> |
src/main/webapp/act/process-editor/editor-app/configuration/properties/event-listeners-popup.html
0 → 100644
| 1 | + | ||
| 2 | +<div class="modal" ng-controller="KisBpmEventListenersPopupCtrl"> | ||
| 3 | + <div class="modal-dialog modal-wide"> | ||
| 4 | + <div class="modal-content"> | ||
| 5 | + <div class="modal-header"> | ||
| 6 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">×</button> | ||
| 7 | + <h2>{{'PROPERTY.PROPERTY.EDIT.TITLE' | translate:property}}</h2> | ||
| 8 | + </div> | ||
| 9 | + <div class="modal-body"> | ||
| 10 | + | ||
| 11 | + <div class="row row-no-gutter"> | ||
| 12 | + <div class="col-xs-10"> | ||
| 13 | + <div ng-if="translationsRetrieved" class="kis-listener-grid" ng-grid="gridOptions"></div> | ||
| 14 | + <div class="pull-right"> | ||
| 15 | + <div class="btn-group"> | ||
| 16 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.MOVE.UP | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="moveListenerUp()"><i class="glyphicon glyphicon-arrow-up"></i></a> | ||
| 17 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.MOVE.DOWN | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="moveListenerDown()"><i class="glyphicon glyphicon-arrow-down"></i></a> | ||
| 18 | + </div> | ||
| 19 | + <div class="btn-group"> | ||
| 20 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.ADD | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="addNewListener()"><i class="glyphicon glyphicon-plus"></i></a> | ||
| 21 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.REMOVE | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="removeListener()"><i class="glyphicon glyphicon-minus"></i></a> | ||
| 22 | + </div> | ||
| 23 | + </div> | ||
| 24 | + </div> | ||
| 25 | + </div> | ||
| 26 | + | ||
| 27 | + <div class="row row-no-gutter"> | ||
| 28 | + <div ng-if="translationsRetrieved" ng-show="selectedListeners.length > 0" class="col-xs-6"> | ||
| 29 | + <div class="form-group"> | ||
| 30 | + <label for="userField">{{'PROPERTY.EVENTLISTENERS.EVENTS' | translate}}</label> | ||
| 31 | + <div ng-repeat="eventDefinition in selectedListeners[0].events"> | ||
| 32 | + <select id="eventField" class="form-control" ng-model="eventDefinition.event" ng-change="listenerDetailsChanged()"> | ||
| 33 | + <option title="{{'EVENT_TYPE.ACTIVITY.COMPENSATE.TOOLTIP' | translate}}">ACTIVITY_COMPENSATE</option> | ||
| 34 | + <option title="{{'EVENT_TYPE.ACTIVITY.COMPLETED.TOOLTIP' | translate}}">ACTIVITY_COMPLETED</option> | ||
| 35 | + <option title="bla">ACTIVITY_ERROR_RECEIVED</option> | ||
| 36 | + <option>ACTIVITY_MESSAGE_RECEIVED</option> | ||
| 37 | + <option>ACTIVITY_SIGNALED</option> | ||
| 38 | + <option>ACTIVITY_STARTED</option> | ||
| 39 | + <option>ENGINE_CLOSED</option> | ||
| 40 | + <option>ENGINE_CREATED</option> | ||
| 41 | + <option>ENTITY_ACTIVATED</option> | ||
| 42 | + <option>ENTITY_CREATED</option> | ||
| 43 | + <option>ENTITY_DELETED</option> | ||
| 44 | + <option>ENTITY_INITIALIZED</option> | ||
| 45 | + <option>ENTITY_SUSPENDED</option> | ||
| 46 | + <option>ENTITY_UPDATED</option> | ||
| 47 | + <option>JOB_EXECUTION_FAILURE</option> | ||
| 48 | + <option>JOB_EXECUTION_SUCCESS</option> | ||
| 49 | + <option>JOB_RETRIES_DECREMENTED</option> | ||
| 50 | + <option title="{{'EVENT_TYPE.MEMBERSHIP.CREATED.TOOLTIP' | translate}}">MEMBERSHIP_CREATED</option> | ||
| 51 | + <option title="{{'EVENT_TYPE.MEMBERSHIP.DELETED.TOOLTIP' | translate}}">MEMBERSHIP_DELETED</option> | ||
| 52 | + <option title="{{'EVENT_TYPE.MEMBERSHIPS.DELETED.TOOLTIP' | translate}}">MEMBERSHIPS_DELETED</option> | ||
| 53 | + <option title="{{'EVENT_TYPE.TASK.ASSIGNED.TOOLTIP' | translate}}">TASK_ASSIGNED</option> | ||
| 54 | + <option title="{{'EVENT_TYPE.TASK.COMPLETED.TOOLTIP' | translate}}">TASK_COMPLETED</option> | ||
| 55 | + <option>TIMER_FIRED</option> | ||
| 56 | + <option title="{{'EVENT_TYPE.UNCAUGHT.BPMNERROR.TOOLTIP' | translate}}">UNCAUGHT_BPMN_ERROR</option> | ||
| 57 | + <option title="{{'EVENT_TYPE.VARIABLE.CREATED.TOOLTIP' | translate}}">VARIABLE_CREATED</option> | ||
| 58 | + <option title="{{'EVENT_TYPE.VARIABLE.DELETED.TOOLTIP' | translate}}">VARIABLE_DELETED</option> | ||
| 59 | + <option title="{{'EVENT_TYPE.VARIABLE.UPDATED.TOOLTIP' | translate}}">VARIABLE_UPDATED</option> | ||
| 60 | + </select> | ||
| 61 | + <i ng-if="$index > 0" class="glyphicon glyphicon-minus clickable-property" ng-click="removeEventValue($index)"></i> | ||
| 62 | + <i class="glyphicon glyphicon-plus clickable-property" ng-click="addEventValue($index)"></i> | ||
| 63 | + </div> | ||
| 64 | + <div class="form-group"> | ||
| 65 | + <label for="classField">{{'PROPERTY.EVENTLISTENERS.RETHROW' | translate}}</label> | ||
| 66 | + <input type="checkbox" id="rethrowField" class="form-control" ng-model="selectedListeners[0].rethrowEvent" ng-change="listenerDetailsChanged()" /> | ||
| 67 | + </div> | ||
| 68 | + </div> | ||
| 69 | + </div> | ||
| 70 | + <div ng-show="selectedListeners.length > 0 && selectedListeners[0].events[0].event" class="col-xs-6"> | ||
| 71 | + <div class="form-group" ng-if="!selectedListeners[0].rethrowEvent"> | ||
| 72 | + <label for="classField">{{'PROPERTY.EVENTLISTENERS.CLASS' | translate}}</label> | ||
| 73 | + <input type="text" id="classField" class="form-control" ng-model="selectedListeners[0].className" ng-change="listenerDetailsChanged()" placeholder="{{'PROPERTY.EVENTLISTENERS.CLASS.PLACEHOLDER' | translate}}" /> | ||
| 74 | + </div> | ||
| 75 | + <div class="form-group" ng-if="!selectedListeners[0].rethrowEvent"> | ||
| 76 | + <label for="delegateExpressionField">{{'PROPERTY.EVENTLISTENERS.DELEGATEEXPRESSION' | translate}}</label> | ||
| 77 | + <input type="text" id="delegateExpressionField" class="form-control" ng-model="selectedListeners[0].delegateExpression" ng-change="listenerDetailsChanged()" placeholder="{{'PROPERTY.EVENTLISTENERS.DELEGATEEXPRESSION.PLACEHOLDER' | translate}}" /> | ||
| 78 | + </div> | ||
| 79 | + <div class="form-group" ng-if="!selectedListeners[0].rethrowEvent"> | ||
| 80 | + <label for="entityTypeField">{{'PROPERTY.EVENTLISTENERS.ENTITYTYPE' | translate}}</label> | ||
| 81 | + <input type="text" id="entityTypeField" class="form-control" ng-model="selectedListeners[0].entityType" ng-change="listenerDetailsChanged()" placeholder="{{'PROPERTY.EVENTLISTENERS.ENTITYTYPE.PLACEHOLDER' | translate}}" /> | ||
| 82 | + </div> | ||
| 83 | + <div class="form-group" ng-if="selectedListeners[0].rethrowEvent"> | ||
| 84 | + <label for="delegateExpressionField">{{'PROPERTY.EVENTLISTENERS.RETHROWTYPE' | translate}}</label> | ||
| 85 | + <select id="rethrowTypeField" class="form-control" ng-model="selectedListeners[0].rethrowType" ng-change="rethrowTypeChanged()"> | ||
| 86 | + <option>error</option> | ||
| 87 | + <option>message</option> | ||
| 88 | + <option>signal</option> | ||
| 89 | + <option>globalSignal</option> | ||
| 90 | + </select> | ||
| 91 | + </div> | ||
| 92 | + <div class="form-group" ng-if="selectedListeners[0].rethrowType === 'error'"> | ||
| 93 | + <label for="errorCodeField">{{'PROPERTY.EVENTLISTENERS.ERRORCODE' | translate}}</label> | ||
| 94 | + <input type="text" id="errorCodeField" class="form-control" ng-model="selectedListeners[0].errorcode" ng-change="listenerDetailsChanged()" placeholder="{{'PROPERTY.EVENTLISTENERS.ERRORCODE.PLACEHOLDER' | translate}}" /> | ||
| 95 | + </div> | ||
| 96 | + <div class="form-group" ng-if="selectedListeners[0].rethrowType === 'message'"> | ||
| 97 | + <label for="messageNameField">{{'PROPERTY.EVENTLISTENERS.MESSAGENAME' | translate}}</label> | ||
| 98 | + <input type="text" id="messageNameField" class="form-control" ng-model="selectedListeners[0].messagename" ng-change="listenerDetailsChanged()" placeholder="{{'PROPERTY.EVENTLISTENERS.MESSAGENAME.PLACEHOLDER' | translate}}" /> | ||
| 99 | + </div> | ||
| 100 | + <div class="form-group" ng-if="selectedListeners[0].rethrowType === 'signal' || selectedListeners[0].rethrowType === 'globalSignal'"> | ||
| 101 | + <label for="messageNameField">{{'PROPERTY.EVENTLISTENERS.SIGNALNAME' | translate}}</label> | ||
| 102 | + <input type="text" id="signalNameField" class="form-control" ng-model="selectedListeners[0].signalname" ng-change="listenerDetailsChanged()" placeholder="{{'PROPERTY.EVENTLISTENERS.SIGNALNAME.PLACEHOLDER' | translate}}" /> | ||
| 103 | + </div> | ||
| 104 | + </div> | ||
| 105 | + <div ng-show="selectedListeners.length == 0" class="col-xs-6 muted no-property-selected" translate>PROPERTY.EVENTLISTENERS.UNSELECTED</div> | ||
| 106 | + </div> | ||
| 107 | + | ||
| 108 | + </div> | ||
| 109 | + <div class="modal-footer"> | ||
| 110 | + <button ng-click="cancel()" class="btn btn-primary" translate>ACTION.CANCEL</button> | ||
| 111 | + <button ng-click="save()" class="btn btn-primary" translate>ACTION.SAVE</button> | ||
| 112 | + </div> | ||
| 113 | + </div> | ||
| 114 | + </div> | ||
| 115 | +</div> |
| 1 | + | ||
| 2 | +<div class="modal" ng-controller="KisBpmExecutionListenersPopupCtrl"> | ||
| 3 | + <div class="modal-dialog modal-wide"> | ||
| 4 | + <div class="modal-content"> | ||
| 5 | + <div class="modal-header"> | ||
| 6 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">×</button> | ||
| 7 | + <h2>{{'PROPERTY.PROPERTY.EDIT.TITLE' | translate:property}}</h2> | ||
| 8 | + </div> | ||
| 9 | + <div class="modal-body"> | ||
| 10 | + | ||
| 11 | + <div class="row row-no-gutter"> | ||
| 12 | + <div class="col-xs-6"> | ||
| 13 | + <div ng-if="translationsRetrieved" class="kis-listener-grid" ng-grid="gridOptions"></div> | ||
| 14 | + <div class="pull-right"> | ||
| 15 | + <div class="btn-group"> | ||
| 16 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.MOVE.UP | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="moveListenerUp()"><i class="glyphicon glyphicon-arrow-up"></i></a> | ||
| 17 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.MOVE.DOWN | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="moveListenerDown()"><i class="glyphicon glyphicon-arrow-down"></i></a> | ||
| 18 | + </div> | ||
| 19 | + <div class="btn-group"> | ||
| 20 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.ADD | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="addNewListener()"><i class="glyphicon glyphicon-plus"></i></a> | ||
| 21 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.REMOVE | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="removeListener()"><i class="glyphicon glyphicon-minus"></i></a> | ||
| 22 | + </div> | ||
| 23 | + </div> | ||
| 24 | + </div> | ||
| 25 | + | ||
| 26 | + <div class="col-xs-6"> | ||
| 27 | + <div ng-show="selectedListeners.length > 0"> | ||
| 28 | + | ||
| 29 | + <div class="form-group"> | ||
| 30 | + <label for="eventField">{{'PROPERTY.EXECUTIONLISTENERS.EVENT' | translate}}</label> | ||
| 31 | + <select id="eventField" class="form-control" ng-model="selectedListeners[0].event"> | ||
| 32 | + <option>start</option> | ||
| 33 | + <option>end</option> | ||
| 34 | + <option>take</option> | ||
| 35 | + </select> | ||
| 36 | + </div> | ||
| 37 | + <div class="form-group"> | ||
| 38 | + <label for="classField">{{'PROPERTY.EXECUTIONLISTENERS.CLASS' | translate}}</label> | ||
| 39 | + <input type="text" id="classField" class="form-control" ng-model="selectedListeners[0].className" ng-change="listenerDetailsChanged()" placeholder="{{'PROPERTY.EXECUTIONLISTENERS.CLASS.PLACEHOLDER' | translate}}" /> | ||
| 40 | + </div> | ||
| 41 | + <div class="form-group"> | ||
| 42 | + <label for="expressionField">{{'PROPERTY.EXECUTIONLISTENERS.EXPRESSION' | translate}}</label> | ||
| 43 | + <input type="text" id="expressionField" class="form-control" ng-model="selectedListeners[0].expression" ng-change="listenerDetailsChanged()" placeholder="{{'PROPERTY.EXECUTIONLISTENERS.EXPRESSION.PLACEHOLDER' | translate}}" /> | ||
| 44 | + </div> | ||
| 45 | + <div class="form-group"> | ||
| 46 | + <label for="delegateExpressionField">{{'PROPERTY.EXECUTIONLISTENERS.DELEGATEEXPRESSION' | translate}}</label> | ||
| 47 | + <input type="text" id="delegateExpressionField" class="form-control" ng-model="selectedListeners[0].delegateExpression" ng-change="listenerDetailsChanged()" placeholder="{{'PROPERTY.EXECUTIONLISTENERS.DELEGATEEXPRESSION.PLACEHOLDER' | translate}}" /> | ||
| 48 | + </div> | ||
| 49 | + </div> | ||
| 50 | + <div ng-show="selectedListeners.length == 0" class="muted no-property-selected" translate>PROPERTY.EXECUTIONLISTENERS.UNSELECTED</div> | ||
| 51 | + </div> | ||
| 52 | + </div> | ||
| 53 | + | ||
| 54 | + <div class="row row-no-gutter"> | ||
| 55 | + <div class="col-xs-6"> | ||
| 56 | + <div ng-if="translationsRetrieved" class="kis-field-grid" ng-grid="gridFieldOptions"></div> | ||
| 57 | + <div class="pull-right"> | ||
| 58 | + <div class="btn-group"> | ||
| 59 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.MOVE.UP | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="moveFieldUp()"><i class="glyphicon glyphicon-arrow-up"></i></a> | ||
| 60 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.MOVE.DOWN | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="moveFieldDown()"><i class="glyphicon glyphicon-arrow-down"></i></a> | ||
| 61 | + </div> | ||
| 62 | + <div class="btn-group"> | ||
| 63 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.ADD | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="addNewField()"><i class="glyphicon glyphicon-plus"></i></a> | ||
| 64 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.REMOVE | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="removeField()"><i class="glyphicon glyphicon-minus"></i></a> | ||
| 65 | + </div> | ||
| 66 | + </div> | ||
| 67 | + </div> | ||
| 68 | + | ||
| 69 | + <div class="col-xs-6"> | ||
| 70 | + <div ng-show="selectedFields.length > 0"> | ||
| 71 | + | ||
| 72 | + <div class="form-group"> | ||
| 73 | + <label for="nameField">{{'PROPERTY.EXECUTIONLISTENERS.FIELDS.NAME' | translate}}</label> | ||
| 74 | + <input type="text" id="nameField" class="form-control" ng-model="selectedFields[0].name" placeholder="{{'PROPERTY.EXECUTIONLISTENERS.FIELDS.NAME.PLACEHOLDER' | translate}}" /> | ||
| 75 | + </div> | ||
| 76 | + <div class="form-group"> | ||
| 77 | + <label for="stringValueField">{{'PROPERTY.EXECUTIONLISTENERS.FIELDS.STRINGVALUE' | translate}}</label> | ||
| 78 | + <input type="text" id="stringValueField" class="form-control" ng-model="selectedFields[0].stringValue" ng-change="fieldDetailsChanged()" placeholder="{{'PROPERTY.EXECUTIONLISTENERS.FIELDS.STRINGVALUE.PLACEHOLDER' | translate}}" /> | ||
| 79 | + </div> | ||
| 80 | + <div class="form-group"> | ||
| 81 | + <label for="expressionField">{{'PROPERTY.EXECUTIONLISTENERS.FIELDS.EXPRESSION' | translate}}</label> | ||
| 82 | + <input type="text" id="expressionField" class="form-control" ng-model="selectedFields[0].expression" ng-change="fieldDetailsChanged()" placeholder="{{'PROPERTY.EXECUTIONLISTENERS.FIELDS.EXPRESSION.PLACEHOLDER' | translate}}" /> | ||
| 83 | + </div> | ||
| 84 | + <div class="form-group"> | ||
| 85 | + <label for="stringField">{{'PROPERTY.EXECUTIONLISTENERS.FIELDS.STRING' | translate}}</label> | ||
| 86 | + <textarea id="stringField" class="form-control" ng-model="selectedFields[0].string" ng-change="fieldDetailsChanged()" placeholder="{{'PROPERTY.EXECUTIONLISTENERS.FIELDS.STRING.PLACEHOLDER' | translate}}"></textarea> | ||
| 87 | + </div> | ||
| 88 | + | ||
| 89 | + </div> | ||
| 90 | + <div ng-show="selectedFields.length == 0" class="muted no-property-selected"translate>PROPERTY.EXECUTIONLISTENERS.FIELDS.EMPTY</div> | ||
| 91 | + </div> | ||
| 92 | + </div> | ||
| 93 | + | ||
| 94 | + </div> | ||
| 95 | + <div class="modal-footer"> | ||
| 96 | + <button ng-click="cancel()" class="btn btn-primary" translate>ACTION.CANCEL</button> | ||
| 97 | + <button ng-click="save()" class="btn btn-primary" translate>ACTION.SAVE</button> | ||
| 98 | + </div> | ||
| 99 | + </div> | ||
| 100 | + </div> | ||
| 101 | +</div> |
src/main/webapp/act/process-editor/editor-app/configuration/properties/feedback-popup.html
0 → 100644
| 1 | + | ||
| 2 | +<div class="modal" ng-controller="BpmnFeedbackPopupCtrl"> | ||
| 3 | + <div class="modal-dialog"> | ||
| 4 | + <div class="modal-content"> | ||
| 5 | + <div class="modal-header"> | ||
| 6 | + <h2>{{'PROPERTY.FEEDBACK.TITLE' | translate:property}}</h2> | ||
| 7 | + </div> | ||
| 8 | + <div class="modal-body"> | ||
| 9 | + <p><textarea auto-focus class="form-control" ng-model="model.feedback" style="width:90%; height:100%; max-width: 100%; max-height: 100%; min-height: 300px"/></p> | ||
| 10 | + </div> | ||
| 11 | + <div class="modal-footer"> | ||
| 12 | + <button ng-click="cancel()" class="btn btn-primary" translate >ACTION.CANCEL</button> | ||
| 13 | + <button ng-click="send()" ng-disabled="model.feedback.length === 0" class="btn btn-primary" translate >ACTION.SEND</button> | ||
| 14 | + </div> | ||
| 15 | + </div> | ||
| 16 | + </div> | ||
| 17 | +</div> |
| 1 | + | ||
| 2 | +<div class="modal" ng-controller="KisBpmFieldsPopupCtrl"> | ||
| 3 | + <div class="modal-dialog modal-wide"> | ||
| 4 | + <div class="modal-content"> | ||
| 5 | + <div class="modal-header"> | ||
| 6 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">×</button> | ||
| 7 | + <h3>{{'PROPERTY.PROPERTY.EDIT.TITLE' | translate:property}}</h3> | ||
| 8 | + </div> | ||
| 9 | + <div class="modal-body"> | ||
| 10 | + | ||
| 11 | + <div class="row row-no-gutter"> | ||
| 12 | + <div class="col-xs-6"> | ||
| 13 | + <div ng-if="translationsRetrieved" class="kis-listener-grid" ng-grid="gridOptions"></div> | ||
| 14 | + <div class="pull-right"> | ||
| 15 | + <div class="btn-group"> | ||
| 16 | + <a href="#" class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.MOVE.UP' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="moveFieldUp()"><i class="glyphicon glyphicon-arrow-up"></i></a> | ||
| 17 | + <a href="#" class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.MOVE.DOWN' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="moveFieldDown()"><i class="glyphicon glyphicon-arrow-down"></i></a> | ||
| 18 | + </div> | ||
| 19 | + <div class="btn-group"> | ||
| 20 | + <a href="#" class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.ADD' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="addNewField()"><i class="glyphicon glyphicon-plus"></i></a> | ||
| 21 | + <a href="#" class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.REMOVE' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="removeField()"><i class="glyphicon glyphicon-minus"></i></a> | ||
| 22 | + </div> | ||
| 23 | + </div> | ||
| 24 | + </div> | ||
| 25 | + | ||
| 26 | + <div class="col-xs-6"> | ||
| 27 | + <div ng-show="selectedFields.length > 0"> | ||
| 28 | + | ||
| 29 | + <div class="form-group"> | ||
| 30 | + <label for="fieldName">{{'PROPERTY.FIELDS.NAME' | translate}}</label> | ||
| 31 | + <input type="text" id="fieldName" class="form-control" ng-model="selectedFields[0].name" placeholder="{{'PROPERTY.FIELDS.NAME.PLACEHOLDER' | translate}}" /> | ||
| 32 | + </div> | ||
| 33 | + | ||
| 34 | + <div class="form-group"> | ||
| 35 | + <label for="fieldStringValue">{{'PROPERTY.FIELDS.STRINGVALUE' | translate}}</label> | ||
| 36 | + <input type="text" id="fieldStringValue" class="form-control" ng-model="selectedFields[0].stringValue" ng-change="fieldDetailsChanged()" placeholder="{{'PROPERTY.FIELDS.STRINGVALUE.PLACEHOLDER' | translate}}" /> | ||
| 37 | + </div> | ||
| 38 | + | ||
| 39 | + <div class="form-group"> | ||
| 40 | + <label for="fieldExpression">{{'PROPERTY.FIELDS.EXPRESSION' | translate}}</label> | ||
| 41 | + <input type="text" id="fieldExpression" class="form-control" ng-model="selectedFields[0].expression" ng-change="fieldDetailsChanged()" placeholder="{{'PROPERTY.FIELDS.EXPRESSION.PLACEHOLDER' | translate}}" /> | ||
| 42 | + </div> | ||
| 43 | + | ||
| 44 | + <div class="form-group"> | ||
| 45 | + <label for="fieldString">{{'PROPERTY.FIELDS.STRING' | translate}}</label> | ||
| 46 | + <textarea type="text" id="fieldString" class="form-control" ng-model="selectedFields[0].string" ng-change="fieldDetailsChanged()" placeholder="{{'PROPERTY.FIELDS.STRING.PLACEHOLDER' | translate}}"></textarea> | ||
| 47 | + </div> | ||
| 48 | + | ||
| 49 | + </div> | ||
| 50 | + <div ng-show="selectedFields.length == 0" class="muted no-property-selected" translate>PROPERTY.FIELDS.EMPTY</div> | ||
| 51 | + </div> | ||
| 52 | + </div> | ||
| 53 | + | ||
| 54 | + </div> | ||
| 55 | + <div class="modal-footer"> | ||
| 56 | + <button ng-click="cancel()" class="btn btn-primary" translate>ACTION.CANCEL</button> | ||
| 57 | + <button ng-click="save()" class="btn btn-primary" translate>ACTION.SAVE</button> | ||
| 58 | + </div> | ||
| 59 | + </div> | ||
| 60 | + </div> | ||
| 61 | +</div> |
src/main/webapp/act/process-editor/editor-app/configuration/properties/form-properties-popup.html
0 → 100644
| 1 | + | ||
| 2 | +<div class="modal" ng-controller="KisBpmFormPropertiesPopupCtrl"> | ||
| 3 | + <div class="modal-dialog modal-wide"> | ||
| 4 | + <div class="modal-content"> | ||
| 5 | + <div class="modal-header"> | ||
| 6 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">×</button> | ||
| 7 | + <h2>{{'PROPERTY.PROPERTY.EDIT.TITLE' | translate:property}}</h2> | ||
| 8 | + </div> | ||
| 9 | + <div class="modal-body"> | ||
| 10 | + | ||
| 11 | + <div class="row row-no-gutter"> | ||
| 12 | + <div class="col-xs-6"> | ||
| 13 | + <div ng-if="translationsRetrieved" class="default-grid" ng-grid="gridOptions"></div> | ||
| 14 | + <div class="pull-right"> | ||
| 15 | + <div class="btn-group"> | ||
| 16 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.MOVE.UP' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="movePropertyUp()"><i class="glyphicon glyphicon-arrow-up"></i></a> | ||
| 17 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.MOVE.DOWN' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="movePropertyDown()"><i class="glyphicon glyphicon-arrow-down"></i></a> | ||
| 18 | + </div> | ||
| 19 | + <div class="btn-group"> | ||
| 20 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.ADD' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="addNewProperty()"><i class="glyphicon glyphicon-plus"></i></a> | ||
| 21 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.REMOVE' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="removeProperty()"><i class="glyphicon glyphicon-minus"></i></a> | ||
| 22 | + </div> | ||
| 23 | + </div> | ||
| 24 | + </div> | ||
| 25 | + | ||
| 26 | + <div class="col-xs-6"> | ||
| 27 | + <div ng-show="selectedProperties.length > 0"> | ||
| 28 | + | ||
| 29 | + <div class="form-group"> | ||
| 30 | + <label for="idField">{{'PROPERTY.FORMPROPERTIES.ID' | translate}}</label> | ||
| 31 | + <input id="idField" class="form-control" type="text" ng-model="selectedProperties[0].id" placeholder="{{'PROPERTY.FORMPROPERTIES.ID.PLACEHOLDER' | translate }}" /> | ||
| 32 | + </div> | ||
| 33 | + <div class="form-group"> | ||
| 34 | + <label for="nameField">{{'PROPERTY.FORMPROPERTIES.NAME' | translate}}</label> | ||
| 35 | + <input id="nameField" class="form-control" type="text" ng-model="selectedProperties[0].name" placeholder="{{'PROPERTY.FORMPROPERTIES.NAME.PLACEHOLDER' | translate }}" /> | ||
| 36 | + </div> | ||
| 37 | + <div class="form-group"> | ||
| 38 | + <label for="typeField">{{'PROPERTY.FORMPROPERTIES.TYPE' | translate}}</label> | ||
| 39 | + <select id="typeField" class="form-control" ng-model="selectedProperties[0].type" ng-change="propertyTypeChanged()"> | ||
| 40 | + <option>string</option> | ||
| 41 | + <option>long</option> | ||
| 42 | + <option>boolean</option> | ||
| 43 | + <option>date</option> | ||
| 44 | + <option>enum</option> | ||
| 45 | + </select> | ||
| 46 | + </div> | ||
| 47 | + <div class="form-group" ng-show="selectedProperties[0].datePattern"> | ||
| 48 | + <label for="datePatternField">{{'PROPERTY.FORMPROPERTIES.DATEPATTERN' | translate}}</label> | ||
| 49 | + <input id="datePatternField" class="form-control" type="text" ng-model="selectedProperties[0].datePattern" placeholder="{{'PROPERTY.FORMPROPERTIES.DATEPATTERN.PLACEHOLDER' | translate }}" /> | ||
| 50 | + </div> | ||
| 51 | + <div ng-if="selectedProperties[0].type == 'enum'" style="padding-bottom:10px"> | ||
| 52 | + <div class="row row-no-gutter"> | ||
| 53 | + <div class="col-xs-6"> | ||
| 54 | + <div ng-if="translationsRetrieved" class="kis-listener-grid" ng-grid="enumGridOptions"></div> | ||
| 55 | + <div class="pull-right"> | ||
| 56 | + <div class="btn-group"> | ||
| 57 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.MOVE.UP | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="moveEnumValueUp()"><i class="glyphicon glyphicon-arrow-up"></i></a> | ||
| 58 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.MOVE.DOWN | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="moveEnumValueDown()"><i class="glyphicon glyphicon-arrow-down"></i></a> | ||
| 59 | + </div> | ||
| 60 | + <div class="btn-group"> | ||
| 61 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.ADD | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="addNewEnumValue()"><i class="glyphicon glyphicon-plus"></i></a> | ||
| 62 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.REMOVE | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="removeEnumValue()"><i class="glyphicon glyphicon-minus"></i></a> | ||
| 63 | + </div> | ||
| 64 | + </div> | ||
| 65 | + </div> | ||
| 66 | + | ||
| 67 | + <div class="col-xs-6"> | ||
| 68 | + <div ng-show="selectedEnumValues.length > 0"> | ||
| 69 | + | ||
| 70 | + <div class="form-group"> | ||
| 71 | + <label for="classField">{{'PROPERTY.FORMPROPERTIES.VALUES.ID' | translate}}</label> | ||
| 72 | + <input type="text" id="classField" class="form-control" ng-model="selectedEnumValues[0].id" placeholder="{{'PROPERTY.FORMPROPERTIES.VALUES.ID.PLACEHOLDER' | translate}}" /> | ||
| 73 | + </div> | ||
| 74 | + <div class="form-group"> | ||
| 75 | + <label for="classField">{{'PROPERTY.FORMPROPERTIES.VALUES.NAME' | translate}}</label> | ||
| 76 | + <input type="text" id="classField" class="form-control" ng-model="selectedEnumValues[0].name" placeholder="{{'PROPERTY.FORMPROPERTIES.VALUES.NAME.PLACEHOLDER' | translate}}" /> | ||
| 77 | + </div> | ||
| 78 | + </div> | ||
| 79 | + <div ng-show="selectedEnumValues.length == 0" class="muted no-property-selected" translate>PROPERTY.FORMPROPERTIES.ENUMVALUES.EMPTY</div> | ||
| 80 | + </div> | ||
| 81 | + </div> | ||
| 82 | + </div> | ||
| 83 | + <div class="form-group"> | ||
| 84 | + <label for="expressionField">{{'PROPERTY.FORMPROPERTIES.EXPRESSION' | translate}}</label> | ||
| 85 | + <input id="expressionField" class="form-control" type="text" ng-model="selectedProperties[0].expression" placeholder="{{'PROPERTY.FORMPROPERTIES.EXPRESSION.PLACEHOLDER' | translate }}" /> | ||
| 86 | + </div> | ||
| 87 | + <div class="form-group"> | ||
| 88 | + <label for="variableField">{{'PROPERTY.FORMPROPERTIES.VARIABLE' | translate}}</label> | ||
| 89 | + <input id="variableField" class="form-control" type="text" ng-model="selectedProperties[0].variable" placeholder="{{'PROPERTY.FORMPROPERTIES.VARIABLE.PLACEHOLDER' | translate }}" /> | ||
| 90 | + </div> | ||
| 91 | + <div class="form-inline"> | ||
| 92 | + <div class="form-group col-xs-2" > | ||
| 93 | + <label for="requiredField">{{'PROPERTY.FORMPROPERTIES.REQUIRED' | translate}}</label> | ||
| 94 | + <input id="requiredField" class="form-control" type="checkbox" ng-model="selectedProperties[0].required" /> | ||
| 95 | + </div> | ||
| 96 | + <div class="form-group col-xs-2"> | ||
| 97 | + <label for="readableField">{{'PROPERTY.FORMPROPERTIES.READABLE' | translate}}</label> | ||
| 98 | + <input id="readableField" class="form-control" type="checkbox" ng-model="selectedProperties[0].readable" /> | ||
| 99 | + </div> | ||
| 100 | + <div class="form-group col-xs-2"> | ||
| 101 | + <label for="writableField">{{'PROPERTY.FORMPROPERTIES.WRITABLE' | translate}}</label> | ||
| 102 | + <input id="writableField" class="form-control" type="checkbox" ng-model="selectedProperties[0].writable" /> | ||
| 103 | + </div> | ||
| 104 | + </div> | ||
| 105 | + </div> | ||
| 106 | + <div ng-show="selectedProperties.length == 0" class="muted no-property-selected" translate>PROPERTY.FORMPROPERTIES.EMPTY</div> | ||
| 107 | + </div> | ||
| 108 | + </div> | ||
| 109 | + | ||
| 110 | + </div> | ||
| 111 | + <div class="modal-footer"> | ||
| 112 | + <button ng-click="cancel()" class="btn btn-primary" translate>ACTION.CANCEL</button> | ||
| 113 | + <button ng-click="save()" class="btn btn-primary" translate>ACTION.SAVE</button> | ||
| 114 | + </div> | ||
| 115 | + </div> | ||
| 116 | + </div> | ||
| 117 | +</div> |
src/main/webapp/act/process-editor/editor-app/configuration/properties/in-parameters-popup.html
0 → 100644
| 1 | + | ||
| 2 | +<div class="modal" ng-controller="KisBpmInParametersPopupCtrl"> | ||
| 3 | + <div class="modal-dialog modal-wide"> | ||
| 4 | + <div class="modal-content"> | ||
| 5 | + <div class="modal-header"> | ||
| 6 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">×</button> | ||
| 7 | + <h2>{{'PROPERTY.PROPERTY.EDIT.TITLE' | translate:property}}</h2> | ||
| 8 | + </div> | ||
| 9 | + <div class="modal-body"> | ||
| 10 | + | ||
| 11 | + <div class="row row-no-gutter"> | ||
| 12 | + <div class="col-xs-6"> | ||
| 13 | + <div ng-if="translationsRetrieved" class="kis-listener-grid" ng-grid="gridOptions"></div> | ||
| 14 | + <div class="pull-right"> | ||
| 15 | + <div class="btn-group"> | ||
| 16 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.MOVE.UP' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="moveParameterUp()"><i class="glyphicon glyphicon-arrow-up"></i></a> | ||
| 17 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.MOVE.DOWN' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="moveParameterDown()"><i class="glyphicon glyphicon-arrow-down"></i></a> | ||
| 18 | + </div> | ||
| 19 | + <div class="btn-group"> | ||
| 20 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.ADD' | translate:property}}" data-placement="bottom" data-original-title="" title="" ng-click="addNewParameter()"><i class="glyphicon glyphicon-plus"></i></a> | ||
| 21 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.REMOVE' | translate:property}}" data-placement="bottom" data-original-title="" title="" ng-click="removeParameter()"><i class="glyphicon glyphicon-minus"></i></a> | ||
| 22 | + </div> | ||
| 23 | + </div> | ||
| 24 | + </div> | ||
| 25 | + | ||
| 26 | + <div class="col-xs-6"> | ||
| 27 | + <div ng-show="selectedParameters.length > 0"> | ||
| 28 | + | ||
| 29 | + <div class="form-group"> | ||
| 30 | + <label for="sourceField">{{'PROPERTY.PARAMETER.SOURCE' | translate}}</label> | ||
| 31 | + <input type="text" id="sourceField" class="form-control" ng-model="selectedParameters[0].source" placeholder="{{'PROPERTY.PARAMETER.SOURCE.PLACEHOLDER' | translate}}" /> | ||
| 32 | + </div> | ||
| 33 | + <div class="form-group"> | ||
| 34 | + <label for="expressionField">{{'PROPERTY.PARAMETER.SOURCEEXPRESSION' | translate}}</label> | ||
| 35 | + <input type="text" id="expressionField" class="form-control" ng-model="selectedParameters[0].sourceExpression" placeholder="{{'PROPERTY.PARAMETER.SOURCEEXPRESSION.PLACEHOLDER' | translate}}" /> | ||
| 36 | + </div> | ||
| 37 | + <div class="form-group"> | ||
| 38 | + <label for="expressionField">{{'PROPERTY.PARAMETER.TARGET' | translate}}</label> | ||
| 39 | + <input type="text" id="expressionField" class="form-control" ng-model="selectedParameters[0].target" placeholder="{{'PROPERTY.PARAMETER.TARGET.PLACEHOLDER' | translate}}" /> | ||
| 40 | + </div> | ||
| 41 | + | ||
| 42 | + </div> | ||
| 43 | + <div ng-show="selectedParameters.length == 0" class="muted no-property-selected" translate>PROPERTY.PARAMETER.EMPTY</div> | ||
| 44 | + </div> | ||
| 45 | + </div> | ||
| 46 | + </div> | ||
| 47 | + <div class="modal-footer"> | ||
| 48 | + <button ng-click="cancel()" class="btn btn-primary" translate>ACTION.CANCEL</button> | ||
| 49 | + <button ng-click="save()" class="btn btn-primary" translate>ACTION.SAVE</button> | ||
| 50 | + </div> | ||
| 51 | + </div> | ||
| 52 | + </div> | ||
| 53 | +</div> |
| 1 | + | ||
| 2 | +<div class="modal" ng-controller="ActivitiMessageDefinitionsPopupCtrl"> | ||
| 3 | + <div class="modal-dialog modal-wide"> | ||
| 4 | + <div class="modal-content"> | ||
| 5 | + | ||
| 6 | + <div class="modal-header"> | ||
| 7 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">×</button> | ||
| 8 | + <h2>{{'PROPERTY.PROPERTY.EDIT.TITLE' | translate:property}}</h2> | ||
| 9 | + </div> | ||
| 10 | + | ||
| 11 | + <div class="modal-body"> | ||
| 12 | + | ||
| 13 | + <div class="row row-no-gutter"> | ||
| 14 | + | ||
| 15 | + <div class="col-xs-8"> | ||
| 16 | + <div ng-if="translationsRetrieved" class="kis-listener-grid" ng-grid="gridOptions"></div> | ||
| 17 | + <div class="pull-right"> | ||
| 18 | + <div class="btn-group"> | ||
| 19 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.ADD | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="addNewMessageDefinition()"><i class="glyphicon glyphicon-plus"></i></a> | ||
| 20 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.REMOVE | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="removeMessageDefinition()"><i class="glyphicon glyphicon-minus"></i></a> | ||
| 21 | + </div> | ||
| 22 | + </div> | ||
| 23 | + </div> | ||
| 24 | + | ||
| 25 | + <div class="col-xs-4" ng-show="selectedMessages && selectedMessages.length > 0"> | ||
| 26 | + | ||
| 27 | + <div class="form-group"> | ||
| 28 | + <label>{{'PROPERTY.MESSAGEDEFINITIONS.ID' | translate}}</label> | ||
| 29 | + <input type="text" class="form-control" ng-model="selectedMessages[0].id"> | ||
| 30 | + </div> | ||
| 31 | + | ||
| 32 | + <div class="form-group"> | ||
| 33 | + <label>{{'PROPERTY.MESSAGEDEFINITIONS.NAME' | translate}}</label> | ||
| 34 | + <input type="text" class="form-control" ng-model="selectedMessages[0].name"> | ||
| 35 | + </div> | ||
| 36 | + | ||
| 37 | + </div> | ||
| 38 | + | ||
| 39 | + </div> | ||
| 40 | + | ||
| 41 | + </div> | ||
| 42 | + | ||
| 43 | + <div class="modal-footer"> | ||
| 44 | + <button ng-click="cancel()" class="btn btn-primary" translate>ACTION.CANCEL</button> | ||
| 45 | + <button ng-click="save()" class="btn btn-primary" translate>ACTION.SAVE</button> | ||
| 46 | + </div> | ||
| 47 | + | ||
| 48 | + </div> | ||
| 49 | + </div> | ||
| 50 | +</div> |
src/main/webapp/act/process-editor/editor-app/configuration/properties/out-parameters-popup.html
0 → 100644
| 1 | + | ||
| 2 | +<div class="modal" ng-controller="KisBpmOutParametersPopupCtrl"> | ||
| 3 | + <div class="modal-dialog modal-wide"> | ||
| 4 | + <div class="modal-content"> | ||
| 5 | + <div class="modal-header"> | ||
| 6 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">×</button> | ||
| 7 | + <h2>{{'PROPERTY.PROPERTY.EDIT.TITLE' | translate:property}}</h2> | ||
| 8 | + </div> | ||
| 9 | + <div class="modal-body"> | ||
| 10 | + | ||
| 11 | + <div class="row row-no-gutter"> | ||
| 12 | + <div class="col-xs-6"> | ||
| 13 | + <div ng-if="translationsRetrieved" class="kis-listener-grid" ng-grid="gridOptions"></div> | ||
| 14 | + <div class="pull-right"> | ||
| 15 | + <div class="btn-group"> | ||
| 16 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.MOVE.UP' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="moveParameterUp()"><i class="glyphicon glyphicon-arrow-up"></i></a> | ||
| 17 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.MOVE.DOWN' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="moveParameterDown()"><i class="glyphicon glyphicon-arrow-down"></i></a> | ||
| 18 | + </div> | ||
| 19 | + <div class="btn-group"> | ||
| 20 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.ADD' | translate:property}}" data-placement="bottom" data-original-title="" title="" ng-click="addNewParameter()"><i class="glyphicon glyphicon-plus"></i></a> | ||
| 21 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.REMOVE' | translate:property}}" data-placement="bottom" data-original-title="" title="" ng-click="removeParameter()"><i class="glyphicon glyphicon-minus"></i></a> | ||
| 22 | + </div> | ||
| 23 | + </div> | ||
| 24 | + </div> | ||
| 25 | + | ||
| 26 | + <div class="col-xs-6"> | ||
| 27 | + <div ng-show="selectedParameters.length > 0"> | ||
| 28 | + | ||
| 29 | + <div class="form-group"> | ||
| 30 | + <label for="sourceField">{{'PROPERTY.PARAMETER.SOURCE' | translate}}</label> | ||
| 31 | + <input type="text" id="sourceField" class="form-control" ng-model="selectedParameters[0].source" placeholder="{{'PROPERTY.PARAMETER.SOURCE.PLACEHOLDER' | translate}}" /> | ||
| 32 | + </div> | ||
| 33 | + <div class="form-group"> | ||
| 34 | + <label for="expressionField">{{'PROPERTY.PARAMETER.SOURCEEXPRESSION' | translate}}</label> | ||
| 35 | + <input type="text" id="expressionField" class="form-control" ng-model="selectedParameters[0].sourceExpression" placeholder="{{'PROPERTY.PARAMETER.SOURCEEXPRESSION.PLACEHOLDER' | translate}}" /> | ||
| 36 | + </div> | ||
| 37 | + <div class="form-group"> | ||
| 38 | + <label for="expressionField">{{'PROPERTY.PARAMETER.TARGET' | translate}}</label> | ||
| 39 | + <input type="text" id="expressionField" class="form-control" ng-model="selectedParameters[0].target" placeholder="{{'PROPERTY.PARAMETER.TARGET.PLACEHOLDER' | translate}}" /> | ||
| 40 | + </div> | ||
| 41 | + | ||
| 42 | + </div> | ||
| 43 | + <div ng-show="selectedParameters.length == 0" class="muted no-property-selected" translate>PROPERTY.PARAMETER.EMPTY</div> | ||
| 44 | + </div> | ||
| 45 | + </div> | ||
| 46 | + </div> | ||
| 47 | + <div class="modal-footer"> | ||
| 48 | + <button ng-click="cancel()" class="btn btn-primary" translate>ACTION.CANCEL</button> | ||
| 49 | + <button ng-click="save()" class="btn btn-primary" translate>ACTION.SAVE</button> | ||
| 50 | + </div> | ||
| 51 | + </div> | ||
| 52 | + </div> | ||
| 53 | +</div> |
src/main/webapp/act/process-editor/editor-app/configuration/properties/sequenceflow-order-popup.html
0 → 100644
| 1 | + | ||
| 2 | +<div class="modal" ng-controller="KisBpmSequenceFlowOrderPopupCtrl"> | ||
| 3 | + <div class="modal-dialog"> | ||
| 4 | + <div class="modal-content"> | ||
| 5 | + <div class="modal-header"> | ||
| 6 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">×</button> | ||
| 7 | + <h3>{{'PROPERTY.PROPERTY.EDIT.TITLE' | translate:property}}</h3> | ||
| 8 | + </div> | ||
| 9 | + | ||
| 10 | + <div class="modal-body"> | ||
| 11 | + | ||
| 12 | + <div translate>PROPERTY.SEQUENCEFLOW.ORDER.DESCRIPTION</div> | ||
| 13 | + <br/> | ||
| 14 | + <ol> | ||
| 15 | + <li class="sequence-flow-order-element" ng-repeat="sequenceFlow in outgoingSequenceFlow"> | ||
| 16 | + {{'PROPERTY.SEQUENCEFLOW.ORDER.SEQUENCEFLOW.VALUE' | translate:sequenceFlow}} | ||
| 17 | + <a class="btn btn-icon btn-sm" | ||
| 18 | + rel="tooltip" | ||
| 19 | + data-title="{{'ACTION.MOVE.UP' | translate}}" | ||
| 20 | + data-placement="bottom" | ||
| 21 | + data-original-title="" title="" | ||
| 22 | + ng-click="moveUp($index)" | ||
| 23 | + ng-if="$index > 0"> | ||
| 24 | + <i class="glyphicon glyphicon-arrow-up"></i> | ||
| 25 | + </a> | ||
| 26 | + <a class="btn btn-icon btn-sm" | ||
| 27 | + rel="tooltip" | ||
| 28 | + data-title="{{'ACTION.MOVE.DOWN' | translate}}" | ||
| 29 | + data-placement="bottom" | ||
| 30 | + data-original-title="" | ||
| 31 | + title="" | ||
| 32 | + ng-click="moveDown($index)" | ||
| 33 | + ng-if="$index < outgoingSequenceFlow.length - 1"> | ||
| 34 | + <i class="glyphicon glyphicon-arrow-down"></i> | ||
| 35 | + </a> | ||
| 36 | + </li> | ||
| 37 | + </ol> | ||
| 38 | + | ||
| 39 | + | ||
| 40 | + </div> | ||
| 41 | + <div class="modal-footer"> | ||
| 42 | + <button ng-click="cancel()" class="btn btn-primary" translate>ACTION.CANCEL</button> | ||
| 43 | + <button ng-click="save()" class="btn btn-primary" translate>ACTION.SAVE</button> | ||
| 44 | + </div> | ||
| 45 | + </div> | ||
| 46 | + </div> | ||
| 47 | +</div> |
src/main/webapp/act/process-editor/editor-app/configuration/properties/signal-definitions-popup.html
0 → 100644
| 1 | + | ||
| 2 | +<div class="modal" ng-controller="ActivitiSignalDefinitionsPopupCtrl"> | ||
| 3 | + <div class="modal-dialog modal-wide"> | ||
| 4 | + <div class="modal-content"> | ||
| 5 | + | ||
| 6 | + <div class="modal-header"> | ||
| 7 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">×</button> | ||
| 8 | + <h2>{{'PROPERTY.PROPERTY.EDIT.TITLE' | translate:property}}</h2> | ||
| 9 | + </div> | ||
| 10 | + | ||
| 11 | + <div class="modal-body"> | ||
| 12 | + | ||
| 13 | + <div class="row row-no-gutter"> | ||
| 14 | + | ||
| 15 | + <div class="col-xs-8"> | ||
| 16 | + <div ng-if="translationsRetrieved" class="kis-listener-grid" ng-grid="gridOptions"></div> | ||
| 17 | + <div class="pull-right"> | ||
| 18 | + <div class="btn-group"> | ||
| 19 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.ADD | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="addNewSignalDefinition()"><i class="glyphicon glyphicon-plus"></i></a> | ||
| 20 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.REMOVE | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="removeSignalDefinition()"><i class="glyphicon glyphicon-minus"></i></a> | ||
| 21 | + </div> | ||
| 22 | + </div> | ||
| 23 | + </div> | ||
| 24 | + | ||
| 25 | + <div class="col-xs-4" ng-show="selectedSignals && selectedSignals.length > 0"> | ||
| 26 | + | ||
| 27 | + <div class="form-group"> | ||
| 28 | + <label>{{'PROPERTY.SIGNALDEFINITIONS.ID' | translate}}</label> | ||
| 29 | + <input type="text" class="form-control" ng-model="selectedSignals[0].id"> | ||
| 30 | + </div> | ||
| 31 | + | ||
| 32 | + <div class="form-group"> | ||
| 33 | + <label>{{'PROPERTY.SIGNALDEFINITIONS.NAME' | translate}}</label> | ||
| 34 | + <input type="text" class="form-control" ng-model="selectedSignals[0].name"> | ||
| 35 | + </div> | ||
| 36 | + | ||
| 37 | + <div class="form-group"> | ||
| 38 | + <label>{{'PROPERTY.SIGNALDEFINITIONS.SCOPE' | translate}}</label> | ||
| 39 | + <select class="form-control" ng-model="selectedSignals[0].scope"> | ||
| 40 | + <option value="global">{{'PROPERTY.SIGNALDEFINITIONS.SCOPE-GLOBAL' | translate}}</option> | ||
| 41 | + <option value="processInstance">{{'PROPERTY.SIGNALDEFINITIONS.SCOPE-PROCESSINSTANCE' | translate}}</option> | ||
| 42 | + </select> | ||
| 43 | + </div> | ||
| 44 | + | ||
| 45 | + </div> | ||
| 46 | + | ||
| 47 | + </div> | ||
| 48 | + | ||
| 49 | + </div> | ||
| 50 | + | ||
| 51 | + <div class="modal-footer"> | ||
| 52 | + <button ng-click="cancel()" class="btn btn-primary" translate>ACTION.CANCEL</button> | ||
| 53 | + <button ng-click="save()" class="btn btn-primary" translate>ACTION.SAVE</button> | ||
| 54 | + </div> | ||
| 55 | + | ||
| 56 | + </div> | ||
| 57 | + </div> | ||
| 58 | +</div> |
| 1 | + | ||
| 2 | +<div class="modal" ng-controller="KisBpmCollapsedSubprocessReferencePopupCrtl"> | ||
| 3 | + <div class="modal-dialog modal-wide"> | ||
| 4 | + <div class="modal-content"> | ||
| 5 | + <div class="modal-header"> | ||
| 6 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">×</button> | ||
| 7 | + <h2> | ||
| 8 | + {{'PROPERTY.SUBPROCESSREFERENCE.TITLE' | translate}} | ||
| 9 | + <span ng-show="selectedSubProcess != null"> - {{selectedSubProcess.name}}</span> | ||
| 10 | + <span ng-show="selectedSubProcess == null"> - {{'PROPERTY.SUBPROCESSREFERENCE.EMPTY' | translate}}</span> | ||
| 11 | + | ||
| 12 | + </h2> | ||
| 13 | + </div> | ||
| 14 | + <div class="modal-body"> | ||
| 15 | + <div class="detail-group clearfix"> | ||
| 16 | + <div class="col-xs-12"> | ||
| 17 | + <div class="alert alert-error" ng-show="(!state.loadingFolders && !state.loadingSubprocesses) && state.subprocessError" translate>PROPERTY.SUBPROCESSREFERENCE.ERROR.SUBPROCESS</div> | ||
| 18 | + </div> | ||
| 19 | + </div> | ||
| 20 | + <div class="detail-group clearfix"> | ||
| 21 | + <div class="col-xs-12 editor-item-picker"> | ||
| 22 | + <div ng-if="!state.loadingSubprocesses && !state.subprocessError" class="col-xs-4 editor-item-picker-component" ng-repeat="sub in subProcesses" ng-class="{'selected' : sub.id == selectedSubProcess.id}" ng-click="selectSubProcess(sub, $event)"> | ||
| 23 | + <div class="controls"> | ||
| 24 | + <input type="checkbox" value="option1" ng-click="selectSubProcess(sub, $event)" ng-checked="sub.id == selectedSubProcess.id" /> | ||
| 25 | + </div> | ||
| 26 | + <h4>{{sub.name}}</h4> | ||
| 27 | + <img src="{{config.contextRoot}}/app/rest/models/{{sub.id}}/thumbnail" /> | ||
| 28 | + </div> | ||
| 29 | + <div ng-show="state.loadingSubprocesses"> | ||
| 30 | + <p class="loading" translate>PROPERTY.SUBPROCESSREFERENCE.SUBPROCESS.LOADING</p> | ||
| 31 | + </div> | ||
| 32 | + <div ng-show="!state.loadingSubprocesses && subProcesses.length == 0"> | ||
| 33 | + <p translate>PROPERTY.SUBPROCESSREFERENCE.SUBPROCESS.EMPTY</p> | ||
| 34 | + </div> | ||
| 35 | + </div> | ||
| 36 | + </div> | ||
| 37 | + </div> | ||
| 38 | + <div class="modal-footer"> | ||
| 39 | + <button ng-disabled="state.subprocessError" ng-click="save()" class="btn btn-primary" translate>ACTION.SAVE</button> | ||
| 40 | + </div> | ||
| 41 | + </div> | ||
| 42 | + </div> | ||
| 43 | +</div> |
src/main/webapp/act/process-editor/editor-app/configuration/properties/task-listeners-popup.html
0 → 100644
| 1 | + | ||
| 2 | +<div class="modal" ng-controller="KisBpmTaskListenersPopupCtrl"> | ||
| 3 | + <div class="modal-dialog modal-wide"> | ||
| 4 | + <div class="modal-content"> | ||
| 5 | + <div class="modal-header"> | ||
| 6 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">×</button> | ||
| 7 | + <h2>{{'PROPERTY.PROPERTY.EDIT.TITLE' | translate:property}}</h2> | ||
| 8 | + </div> | ||
| 9 | + <div class="modal-body"> | ||
| 10 | + | ||
| 11 | + <div class="row row-no-gutter"> | ||
| 12 | + <div class="col-xs-6"> | ||
| 13 | + <div ng-if="translationsRetrieved" class="kis-listener-grid" ng-grid="gridOptions"></div> | ||
| 14 | + <div class="pull-right"> | ||
| 15 | + <div class="btn-group"> | ||
| 16 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.MOVE.UP | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="moveListenerUp()"><i class="glyphicon glyphicon-arrow-up"></i></a> | ||
| 17 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.MOVE.DOWN | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="moveListenerDown()"><i class="glyphicon glyphicon-arrow-down"></i></a> | ||
| 18 | + </div> | ||
| 19 | + <div class="btn-group"> | ||
| 20 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.ADD | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="addNewListener()"><i class="glyphicon glyphicon-plus"></i></a> | ||
| 21 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.REMOVE | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="removeListener()"><i class="glyphicon glyphicon-minus"></i></a> | ||
| 22 | + </div> | ||
| 23 | + </div> | ||
| 24 | + </div> | ||
| 25 | + | ||
| 26 | + <div class="col-xs-6"> | ||
| 27 | + <div ng-show="selectedListeners.length > 0"> | ||
| 28 | + | ||
| 29 | + <div class="form-group"> | ||
| 30 | + <label for="eventField">{{'PROPERTY.TASKLISTENERS.EVENT' | translate}}</label> | ||
| 31 | + <select id="eventField" class="form-control" ng-model="selectedListeners[0].event"> | ||
| 32 | + <option>create</option> | ||
| 33 | + <option>assignment</option> | ||
| 34 | + <option>complete</option> | ||
| 35 | + <option>delete</option> | ||
| 36 | + </select> | ||
| 37 | + </div> | ||
| 38 | + <div class="form-group"> | ||
| 39 | + <label for="classField">{{'PROPERTY.TASKLISTENERS.CLASS' | translate}}</label> | ||
| 40 | + <input type="text" id="classField" class="form-control" ng-model="selectedListeners[0].className" ng-change="listenerDetailsChanged()" placeholder="{{'PROPERTY.TASKLISTENERS.CLASS.PLACEHOLDER' | translate}}" /> | ||
| 41 | + </div> | ||
| 42 | + <div class="form-group"> | ||
| 43 | + <label for="expressionField">{{'PROPERTY.TASKLISTENERS.EXPRESSION' | translate}}</label> | ||
| 44 | + <input type="text" id="expressionField" class="form-control" ng-model="selectedListeners[0].expression" ng-change="listenerDetailsChanged()" placeholder="{{'PROPERTY.TASKLISTENERS.EXPRESSION.PLACEHOLDER' | translate}}" /> | ||
| 45 | + </div> | ||
| 46 | + <div class="form-group"> | ||
| 47 | + <label for="delegateExpressionField">{{'PROPERTY.TASKLISTENERS.DELEGATEEXPRESSION' | translate}}</label> | ||
| 48 | + <input type="text" id="delegateExpressionField" class="form-control" ng-model="selectedListeners[0].delegateExpression" ng-change="listenerDetailsChanged()" placeholder="{{'PROPERTY.TASKLISTENERS.DELEGATEEXPRESSION.PLACEHOLDER' | translate}}" /> | ||
| 49 | + </div> | ||
| 50 | + </div> | ||
| 51 | + <div ng-show="selectedListeners.length == 0" class="muted no-property-selected" translate>PROPERTY.TASKLISTENERS.UNSELECTED</div> | ||
| 52 | + </div> | ||
| 53 | + </div> | ||
| 54 | + | ||
| 55 | + <div class="row row-no-gutter"> | ||
| 56 | + <div class="col-xs-6"> | ||
| 57 | + <div ng-if="translationsRetrieved" class="kis-field-grid" ng-grid="gridFieldOptions"></div> | ||
| 58 | + <div class="pull-right"> | ||
| 59 | + <div class="btn-group"> | ||
| 60 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.MOVE.UP | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="moveFieldUp()"><i class="glyphicon glyphicon-arrow-up"></i></a> | ||
| 61 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.MOVE.DOWN | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="moveFieldDown()"><i class="glyphicon glyphicon-arrow-down"></i></a> | ||
| 62 | + </div> | ||
| 63 | + <div class="btn-group"> | ||
| 64 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.ADD | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="addNewField()"><i class="glyphicon glyphicon-plus"></i></a> | ||
| 65 | + <a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{ACTION.REMOVE | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="removeField()"><i class="glyphicon glyphicon-minus"></i></a> | ||
| 66 | + </div> | ||
| 67 | + </div> | ||
| 68 | + </div> | ||
| 69 | + | ||
| 70 | + <div class="col-xs-6"> | ||
| 71 | + <div ng-show="selectedFields.length > 0"> | ||
| 72 | + | ||
| 73 | + <div class="form-group"> | ||
| 74 | + <label for="nameField">{{'PROPERTY.TASKLISTENERS.FIELDS.NAME' | translate}}</label> | ||
| 75 | + <input type="text" id="nameField" class="form-control" ng-model="selectedFields[0].name" placeholder="{{'PROPERTY.TASKLISTENERS.FIELDS.NAME.PLACEHOLDER' | translate}}" /> | ||
| 76 | + </div> | ||
| 77 | + <div class="form-group"> | ||
| 78 | + <label for="stringValueField">{{'PROPERTY.TASKLISTENERS.FIELDS.STRINGVALUE' | translate}}</label> | ||
| 79 | + <input type="text" id="stringValueField" class="form-control" ng-model="selectedFields[0].stringValue" ng-change="fieldDetailsChanged()" placeholder="{{'PROPERTY.TASKLISTENERS.FIELDS.STRINGVALUE.PLACEHOLDER' | translate}}" /> | ||
| 80 | + </div> | ||
| 81 | + <div class="form-group"> | ||
| 82 | + <label for="expressionField">{{'PROPERTY.TASKLISTENERS.FIELDS.EXPRESSION' | translate}}</label> | ||
| 83 | + <input type="text" id="expressionField" class="form-control" ng-model="selectedFields[0].expression" ng-change="fieldDetailsChanged()" placeholder="{{'PROPERTY.TASKLISTENERS.FIELDS.EXPRESSION.PLACEHOLDER' | translate}}" /> | ||
| 84 | + </div> | ||
| 85 | + <div class="form-group"> | ||
| 86 | + <label for="stringField">{{'PROPERTY.TASKLISTENERS.FIELDS.STRING' | translate}}</label> | ||
| 87 | + <textarea id="stringField" class="form-control" ng-model="selectedFields[0].string" ng-change="fieldDetailsChanged()" placeholder="{{'PROPERTY.TASKLISTENERS.FIELDS.STRING.PLACEHOLDER' | translate}}"></textarea> | ||
| 88 | + </div> | ||
| 89 | + | ||
| 90 | + </div> | ||
| 91 | + <div ng-show="selectedFields.length == 0" class="muted no-property-selected"translate>PROPERTY.TASKLISTENERS.FIELDS.EMPTY</div> | ||
| 92 | + </div> | ||
| 93 | + </div> | ||
| 94 | + | ||
| 95 | + </div> | ||
| 96 | + <div class="modal-footer"> | ||
| 97 | + <button ng-click="cancel()" class="btn btn-primary" translate>ACTION.CANCEL</button> | ||
| 98 | + <button ng-click="save()" class="btn btn-primary" translate>ACTION.SAVE</button> | ||
| 99 | + </div> | ||
| 100 | + </div> | ||
| 101 | + </div> | ||
| 102 | +</div> |
| 1 | + | ||
| 2 | +<div class="modal" ng-controller="KisBpmTextPropertyPopupCtrl"> | ||
| 3 | + <div class="modal-dialog"> | ||
| 4 | + <div class="modal-content"> | ||
| 5 | + <div class="modal-header"> | ||
| 6 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">×</button> | ||
| 7 | + <h3>{{'PROPERTY.PROPERTY.EDIT.TITLE' | translate:property}}</h3> | ||
| 8 | + </div> | ||
| 9 | + <div class="modal-body"> | ||
| 10 | + <p><textarea auto-focus class="form-control" ng-model="property.value" style="width:70%; height:100%; max-width: 100%; max-height: 100%; min-height: 200px"/></p> | ||
| 11 | + </div> | ||
| 12 | + <div class="modal-footer"> | ||
| 13 | + <button ng-click="save()" class="btn btn-primary" translate >ACTION.SAVE</button> | ||
| 14 | + </div> | ||
| 15 | + </div> | ||
| 16 | + </div> | ||
| 17 | +</div> |
| 1 | +/* | ||
| 2 | + * Activiti Modeler component part of the Activiti project | ||
| 3 | + * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. | ||
| 4 | + * | ||
| 5 | + * This library is free software; you can redistribute it and/or | ||
| 6 | + * modify it under the terms of the GNU Lesser General Public | ||
| 7 | + * License as published by the Free Software Foundation; either | ||
| 8 | + * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | + * | ||
| 10 | + * This library is distributed in the hope that it will be useful, | ||
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | + * Lesser General Public License for more details. | ||
| 14 | + | ||
| 15 | + * You should have received a copy of the GNU Lesser General Public | ||
| 16 | + * License along with this library; if not, write to the Free Software | ||
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | + */ |
| 1 | +/* | ||
| 2 | + * Activiti Modeler component part of the Activiti project | ||
| 3 | + * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. | ||
| 4 | + * | ||
| 5 | + * This library is free software; you can redistribute it and/or | ||
| 6 | + * modify it under the terms of the GNU Lesser General Public | ||
| 7 | + * License as published by the Free Software Foundation; either | ||
| 8 | + * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | + * | ||
| 10 | + * This library is distributed in the hope that it will be useful, | ||
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | + * Lesser General Public License for more details. | ||
| 14 | + | ||
| 15 | + * You should have received a copy of the GNU Lesser General Public | ||
| 16 | + * License along with this library; if not, write to the Free Software | ||
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | + */ | ||
| 19 | +'use strict'; | ||
| 20 | + | ||
| 21 | +var KISBPM = KISBPM || {}; | ||
| 22 | +KISBPM.TOOLBAR = { | ||
| 23 | + ACTIONS: { | ||
| 24 | + | ||
| 25 | + saveModel: function (services) { | ||
| 26 | + | ||
| 27 | + var modal = services.$modal({ | ||
| 28 | + backdrop: true, | ||
| 29 | + keyboard: true, | ||
| 30 | + template: 'editor-app/popups/save-model.html?version=' + Date.now(), | ||
| 31 | + scope: services.$scope | ||
| 32 | + }); | ||
| 33 | + }, | ||
| 34 | + | ||
| 35 | + undo: function (services) { | ||
| 36 | + | ||
| 37 | + // Get the last commands | ||
| 38 | + var lastCommands = services.$scope.undoStack.pop(); | ||
| 39 | + | ||
| 40 | + if (lastCommands) { | ||
| 41 | + // Add the commands to the redo stack | ||
| 42 | + services.$scope.redoStack.push(lastCommands); | ||
| 43 | + | ||
| 44 | + // Force refresh of selection, might be that the undo command | ||
| 45 | + // impacts properties in the selected item | ||
| 46 | + if (services.$rootScope && services.$rootScope.forceSelectionRefresh) | ||
| 47 | + { | ||
| 48 | + services.$rootScope.forceSelectionRefresh = true; | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + // Rollback every command | ||
| 52 | + for (var i = lastCommands.length - 1; i >= 0; --i) { | ||
| 53 | + lastCommands[i].rollback(); | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + // Update and refresh the canvas | ||
| 57 | + services.$scope.editor.handleEvents({ | ||
| 58 | + type: ORYX.CONFIG.EVENT_UNDO_ROLLBACK, | ||
| 59 | + commands: lastCommands | ||
| 60 | + }); | ||
| 61 | + | ||
| 62 | + // Update | ||
| 63 | + services.$scope.editor.getCanvas().update(); | ||
| 64 | + services.$scope.editor.updateSelection(); | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + var toggleUndo = false; | ||
| 68 | + if (services.$scope.undoStack.length == 0) | ||
| 69 | + { | ||
| 70 | + toggleUndo = true; | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + var toggleRedo = false; | ||
| 74 | + if (services.$scope.redoStack.length > 0) | ||
| 75 | + { | ||
| 76 | + toggleRedo = true; | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + if (toggleUndo || toggleRedo) { | ||
| 80 | + for (var i = 0; i < services.$scope.items.length; i++) { | ||
| 81 | + var item = services.$scope.items[i]; | ||
| 82 | + if (toggleUndo && item.action === 'KISBPM.TOOLBAR.ACTIONS.undo') { | ||
| 83 | + services.$scope.safeApply(function () { | ||
| 84 | + item.enabled = false; | ||
| 85 | + }); | ||
| 86 | + } | ||
| 87 | + else if (toggleRedo && item.action === 'KISBPM.TOOLBAR.ACTIONS.redo') { | ||
| 88 | + services.$scope.safeApply(function () { | ||
| 89 | + item.enabled = true; | ||
| 90 | + }); | ||
| 91 | + } | ||
| 92 | + } | ||
| 93 | + } | ||
| 94 | + }, | ||
| 95 | + | ||
| 96 | + redo: function (services) { | ||
| 97 | + | ||
| 98 | + // Get the last commands from the redo stack | ||
| 99 | + var lastCommands = services.$scope.redoStack.pop(); | ||
| 100 | + | ||
| 101 | + if (lastCommands) { | ||
| 102 | + // Add this commands to the undo stack | ||
| 103 | + services.$scope.undoStack.push(lastCommands); | ||
| 104 | + | ||
| 105 | + // Force refresh of selection, might be that the redo command | ||
| 106 | + // impacts properties in the selected item | ||
| 107 | + if (services.$rootScope && services.$rootScope.forceSelectionRefresh) | ||
| 108 | + { | ||
| 109 | + services.$rootScope.forceSelectionRefresh = true; | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + // Execute those commands | ||
| 113 | + lastCommands.each(function (command) { | ||
| 114 | + command.execute(); | ||
| 115 | + }); | ||
| 116 | + | ||
| 117 | + // Update and refresh the canvas | ||
| 118 | + services.$scope.editor.handleEvents({ | ||
| 119 | + type: ORYX.CONFIG.EVENT_UNDO_EXECUTE, | ||
| 120 | + commands: lastCommands | ||
| 121 | + }); | ||
| 122 | + | ||
| 123 | + // Update | ||
| 124 | + services.$scope.editor.getCanvas().update(); | ||
| 125 | + services.$scope.editor.updateSelection(); | ||
| 126 | + } | ||
| 127 | + | ||
| 128 | + var toggleUndo = false; | ||
| 129 | + if (services.$scope.undoStack.length > 0) { | ||
| 130 | + toggleUndo = true; | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + var toggleRedo = false; | ||
| 134 | + if (services.$scope.redoStack.length == 0) { | ||
| 135 | + toggleRedo = true; | ||
| 136 | + } | ||
| 137 | + | ||
| 138 | + if (toggleUndo || toggleRedo) { | ||
| 139 | + for (var i = 0; i < services.$scope.items.length; i++) { | ||
| 140 | + var item = services.$scope.items[i]; | ||
| 141 | + if (toggleUndo && item.action === 'KISBPM.TOOLBAR.ACTIONS.undo') { | ||
| 142 | + services.$scope.safeApply(function () { | ||
| 143 | + item.enabled = true; | ||
| 144 | + }); | ||
| 145 | + } | ||
| 146 | + else if (toggleRedo && item.action === 'KISBPM.TOOLBAR.ACTIONS.redo') { | ||
| 147 | + services.$scope.safeApply(function () { | ||
| 148 | + item.enabled = false; | ||
| 149 | + }); | ||
| 150 | + } | ||
| 151 | + } | ||
| 152 | + } | ||
| 153 | + }, | ||
| 154 | + | ||
| 155 | + cut: function (services) { | ||
| 156 | + KISBPM.TOOLBAR.ACTIONS._getOryxEditPlugin(services.$scope).editCut(); | ||
| 157 | + for (var i = 0; i < services.$scope.items.length; i++) { | ||
| 158 | + var item = services.$scope.items[i]; | ||
| 159 | + if (item.action === 'KISBPM.TOOLBAR.ACTIONS.paste') { | ||
| 160 | + services.$scope.safeApply(function () { | ||
| 161 | + item.enabled = true; | ||
| 162 | + }); | ||
| 163 | + } | ||
| 164 | + } | ||
| 165 | + }, | ||
| 166 | + | ||
| 167 | + copy: function (services) { | ||
| 168 | + KISBPM.TOOLBAR.ACTIONS._getOryxEditPlugin(services.$scope).editCopy(); | ||
| 169 | + for (var i = 0; i < services.$scope.items.length; i++) { | ||
| 170 | + var item = services.$scope.items[i]; | ||
| 171 | + if (item.action === 'KISBPM.TOOLBAR.ACTIONS.paste') { | ||
| 172 | + services.$scope.safeApply(function () { | ||
| 173 | + item.enabled = true; | ||
| 174 | + }); | ||
| 175 | + } | ||
| 176 | + } | ||
| 177 | + }, | ||
| 178 | + | ||
| 179 | + paste: function (services) { | ||
| 180 | + KISBPM.TOOLBAR.ACTIONS._getOryxEditPlugin(services.$scope).editPaste(); | ||
| 181 | + }, | ||
| 182 | + | ||
| 183 | + deleteItem: function (services) { | ||
| 184 | + KISBPM.TOOLBAR.ACTIONS._getOryxEditPlugin(services.$scope).editDelete(); | ||
| 185 | + }, | ||
| 186 | + | ||
| 187 | + addBendPoint: function (services) { | ||
| 188 | + | ||
| 189 | + var dockerPlugin = KISBPM.TOOLBAR.ACTIONS._getOryxDockerPlugin(services.$scope); | ||
| 190 | + | ||
| 191 | + var enableAdd = !dockerPlugin.enabledAdd(); | ||
| 192 | + dockerPlugin.setEnableAdd(enableAdd); | ||
| 193 | + if (enableAdd) | ||
| 194 | + { | ||
| 195 | + dockerPlugin.setEnableRemove(false); | ||
| 196 | + document.body.style.cursor = 'pointer'; | ||
| 197 | + } | ||
| 198 | + else | ||
| 199 | + { | ||
| 200 | + document.body.style.cursor = 'default'; | ||
| 201 | + } | ||
| 202 | + }, | ||
| 203 | + | ||
| 204 | + removeBendPoint: function (services) { | ||
| 205 | + | ||
| 206 | + var dockerPlugin = KISBPM.TOOLBAR.ACTIONS._getOryxDockerPlugin(services.$scope); | ||
| 207 | + | ||
| 208 | + var enableRemove = !dockerPlugin.enabledRemove(); | ||
| 209 | + dockerPlugin.setEnableRemove(enableRemove); | ||
| 210 | + if (enableRemove) | ||
| 211 | + { | ||
| 212 | + dockerPlugin.setEnableAdd(false); | ||
| 213 | + document.body.style.cursor = 'pointer'; | ||
| 214 | + } | ||
| 215 | + else | ||
| 216 | + { | ||
| 217 | + document.body.style.cursor = 'default'; | ||
| 218 | + } | ||
| 219 | + }, | ||
| 220 | + | ||
| 221 | + /** | ||
| 222 | + * Helper method: fetches the Oryx Edit plugin from the provided scope, | ||
| 223 | + * if not on the scope, it is created and put on the scope for further use. | ||
| 224 | + * | ||
| 225 | + * It's important to reuse the same EditPlugin while the same scope is active, | ||
| 226 | + * as the clipboard is stored for the whole lifetime of the scope. | ||
| 227 | + */ | ||
| 228 | + _getOryxEditPlugin: function ($scope) { | ||
| 229 | + if ($scope.oryxEditPlugin === undefined || $scope.oryxEditPlugin === null) { | ||
| 230 | + $scope.oryxEditPlugin = new ORYX.Plugins.Edit($scope.editor); | ||
| 231 | + } | ||
| 232 | + return $scope.oryxEditPlugin; | ||
| 233 | + }, | ||
| 234 | + | ||
| 235 | + zoomIn: function (services) { | ||
| 236 | + KISBPM.TOOLBAR.ACTIONS._getOryxViewPlugin(services.$scope).zoom([1.0 + ORYX.CONFIG.ZOOM_OFFSET]); | ||
| 237 | + }, | ||
| 238 | + | ||
| 239 | + zoomOut: function (services) { | ||
| 240 | + KISBPM.TOOLBAR.ACTIONS._getOryxViewPlugin(services.$scope).zoom([1.0 - ORYX.CONFIG.ZOOM_OFFSET]); | ||
| 241 | + }, | ||
| 242 | + | ||
| 243 | + zoomActual: function (services) { | ||
| 244 | + KISBPM.TOOLBAR.ACTIONS._getOryxViewPlugin(services.$scope).setAFixZoomLevel(1); | ||
| 245 | + }, | ||
| 246 | + | ||
| 247 | + zoomFit: function (services) { | ||
| 248 | + KISBPM.TOOLBAR.ACTIONS._getOryxViewPlugin(services.$scope).zoomFitToModel(); | ||
| 249 | + }, | ||
| 250 | + | ||
| 251 | + alignVertical: function (services) { | ||
| 252 | + KISBPM.TOOLBAR.ACTIONS._getOryxArrangmentPlugin(services.$scope).alignShapes([ORYX.CONFIG.EDITOR_ALIGN_MIDDLE]); | ||
| 253 | + }, | ||
| 254 | + | ||
| 255 | + alignHorizontal: function (services) { | ||
| 256 | + KISBPM.TOOLBAR.ACTIONS._getOryxArrangmentPlugin(services.$scope).alignShapes([ORYX.CONFIG.EDITOR_ALIGN_CENTER]); | ||
| 257 | + }, | ||
| 258 | + | ||
| 259 | + sameSize: function (services) { | ||
| 260 | + KISBPM.TOOLBAR.ACTIONS._getOryxArrangmentPlugin(services.$scope).alignShapes([ORYX.CONFIG.EDITOR_ALIGN_SIZE]); | ||
| 261 | + }, | ||
| 262 | + | ||
| 263 | + closeEditor: function(services) { | ||
| 264 | + //window.location.href = "./"; | ||
| 265 | + if(window.confirm('请确认数据是否已经保存,确定要关闭编辑器吗?')) | ||
| 266 | + window.close();//add by cheshuyan at 2016.05.21 | ||
| 267 | + }, | ||
| 268 | + | ||
| 269 | + /** | ||
| 270 | + * Helper method: fetches the Oryx View plugin from the provided scope, | ||
| 271 | + * if not on the scope, it is created and put on the scope for further use. | ||
| 272 | + */ | ||
| 273 | + _getOryxViewPlugin: function ($scope) { | ||
| 274 | + if ($scope.oryxViewPlugin === undefined || $scope.oryxViewPlugin === null) { | ||
| 275 | + $scope.oryxViewPlugin = new ORYX.Plugins.View($scope.editor); | ||
| 276 | + } | ||
| 277 | + return $scope.oryxViewPlugin; | ||
| 278 | + }, | ||
| 279 | + | ||
| 280 | + _getOryxArrangmentPlugin: function ($scope) { | ||
| 281 | + if ($scope.oryxArrangmentPlugin === undefined || $scope.oryxArrangmentPlugin === null) { | ||
| 282 | + $scope.oryxArrangmentPlugin = new ORYX.Plugins.Arrangement($scope.editor); | ||
| 283 | + } | ||
| 284 | + return $scope.oryxArrangmentPlugin; | ||
| 285 | + }, | ||
| 286 | + | ||
| 287 | + _getOryxDockerPlugin: function ($scope) { | ||
| 288 | + if ($scope.oryxDockerPlugin === undefined || $scope.oryxDockerPlugin === null) { | ||
| 289 | + $scope.oryxDockerPlugin = new ORYX.Plugins.AddDocker($scope.editor); | ||
| 290 | + } | ||
| 291 | + return $scope.oryxDockerPlugin; | ||
| 292 | + } | ||
| 293 | + } | ||
| 294 | +}; | ||
| 295 | + | ||
| 296 | +/** Custom controller for the save dialog */ | ||
| 297 | +var SaveModelCtrl = [ '$rootScope', '$scope', '$http', '$route', '$location', | ||
| 298 | + function ($rootScope, $scope, $http, $route, $location) { | ||
| 299 | + | ||
| 300 | + var modelMetaData = $scope.editor.getModelMetaData(); | ||
| 301 | + | ||
| 302 | + var description = ''; | ||
| 303 | + if (modelMetaData.description) { | ||
| 304 | + description = modelMetaData.description; | ||
| 305 | + } | ||
| 306 | + | ||
| 307 | + var saveDialog = { 'name' : modelMetaData.name, | ||
| 308 | + 'description' : description}; | ||
| 309 | + | ||
| 310 | + $scope.saveDialog = saveDialog; | ||
| 311 | + | ||
| 312 | + var json = $scope.editor.getJSON(); | ||
| 313 | + json = JSON.stringify(json); | ||
| 314 | + | ||
| 315 | + var params = { | ||
| 316 | + modeltype: modelMetaData.model.modelType, | ||
| 317 | + json_xml: json, | ||
| 318 | + name: 'model' | ||
| 319 | + }; | ||
| 320 | + | ||
| 321 | + $scope.status = { | ||
| 322 | + loading: false | ||
| 323 | + }; | ||
| 324 | + | ||
| 325 | + $scope.close = function () { | ||
| 326 | + $scope.$hide(); | ||
| 327 | + }; | ||
| 328 | + | ||
| 329 | + $scope.saveAndClose = function () { | ||
| 330 | + $scope.save(function() { | ||
| 331 | + //window.location.href = "./"; | ||
| 332 | + if(window.confirm('请确认数据是否已经保存,确定要关闭编辑器吗?')) | ||
| 333 | + window.close();//add by cheshuyan at 2016.05.21 | ||
| 334 | + }); | ||
| 335 | + }; | ||
| 336 | + $scope.save = function (successCallback) { | ||
| 337 | + | ||
| 338 | + if (!$scope.saveDialog.name || $scope.saveDialog.name.length == 0) { | ||
| 339 | + return; | ||
| 340 | + } | ||
| 341 | + | ||
| 342 | + // Indicator spinner image | ||
| 343 | + $scope.status = { | ||
| 344 | + loading: true | ||
| 345 | + }; | ||
| 346 | + | ||
| 347 | + modelMetaData.name = $scope.saveDialog.name; | ||
| 348 | + modelMetaData.description = $scope.saveDialog.description; | ||
| 349 | + | ||
| 350 | + var json = $scope.editor.getJSON(); | ||
| 351 | + json = JSON.stringify(json); | ||
| 352 | + | ||
| 353 | + var selection = $scope.editor.getSelection(); | ||
| 354 | + $scope.editor.setSelection([]); | ||
| 355 | + | ||
| 356 | + // Get the serialized svg image source | ||
| 357 | + var svgClone = $scope.editor.getCanvas().getSVGRepresentation(true); | ||
| 358 | + $scope.editor.setSelection(selection); | ||
| 359 | + if ($scope.editor.getCanvas().properties["oryx-showstripableelements"] === false) { | ||
| 360 | + var stripOutArray = jQuery(svgClone).find(".stripable-element"); | ||
| 361 | + for (var i = stripOutArray.length - 1; i >= 0; i--) { | ||
| 362 | + stripOutArray[i].remove(); | ||
| 363 | + } | ||
| 364 | + } | ||
| 365 | + | ||
| 366 | + // Remove all forced stripable elements | ||
| 367 | + var stripOutArray = jQuery(svgClone).find(".stripable-element-force"); | ||
| 368 | + for (var i = stripOutArray.length - 1; i >= 0; i--) { | ||
| 369 | + stripOutArray[i].remove(); | ||
| 370 | + } | ||
| 371 | + | ||
| 372 | + // Parse dom to string | ||
| 373 | + var svgDOM = DataManager.serialize(svgClone); | ||
| 374 | + | ||
| 375 | + var params = { | ||
| 376 | + json_xml: json, | ||
| 377 | + svg_xml: svgDOM, | ||
| 378 | + name: $scope.saveDialog.name, | ||
| 379 | + description: $scope.saveDialog.description | ||
| 380 | + }; | ||
| 381 | + | ||
| 382 | + // Update | ||
| 383 | + $http({ method: 'PUT', | ||
| 384 | + data: params, | ||
| 385 | + ignoreErrors: true, | ||
| 386 | + headers: {'Accept': 'application/json', | ||
| 387 | + 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}, | ||
| 388 | + transformRequest: function (obj) { | ||
| 389 | + var str = []; | ||
| 390 | + for (var p in obj) { | ||
| 391 | + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | ||
| 392 | + } | ||
| 393 | + return str.join("&"); | ||
| 394 | + }, | ||
| 395 | + url: KISBPM.URL.putModel(modelMetaData.modelId)}) | ||
| 396 | + | ||
| 397 | + .success(function (data, status, headers, config) { | ||
| 398 | + $scope.editor.handleEvents({ | ||
| 399 | + type: ORYX.CONFIG.EVENT_SAVED | ||
| 400 | + }); | ||
| 401 | + $scope.modelData.name = $scope.saveDialog.name; | ||
| 402 | + $scope.modelData.lastUpdated = data.lastUpdated; | ||
| 403 | + | ||
| 404 | + $scope.status.loading = false; | ||
| 405 | + $scope.$hide(); | ||
| 406 | + | ||
| 407 | + // Fire event to all who is listening | ||
| 408 | + var saveEvent = { | ||
| 409 | + type: KISBPM.eventBus.EVENT_TYPE_MODEL_SAVED, | ||
| 410 | + model: params, | ||
| 411 | + modelId: modelMetaData.modelId, | ||
| 412 | + eventType: 'update-model' | ||
| 413 | + }; | ||
| 414 | + KISBPM.eventBus.dispatch(KISBPM.eventBus.EVENT_TYPE_MODEL_SAVED, saveEvent); | ||
| 415 | + | ||
| 416 | + // Reset state | ||
| 417 | + $scope.error = undefined; | ||
| 418 | + $scope.status.loading = false; | ||
| 419 | + | ||
| 420 | + // Execute any callback | ||
| 421 | + if (successCallback) { | ||
| 422 | + successCallback(); | ||
| 423 | + } | ||
| 424 | + | ||
| 425 | + }) | ||
| 426 | + .error(function (data, status, headers, config) { | ||
| 427 | + $scope.error = {}; | ||
| 428 | + console.log('Something went wrong when updating the process model:' + JSON.stringify(data)); | ||
| 429 | + $scope.status.loading = false; | ||
| 430 | + }); | ||
| 431 | + }; | ||
| 432 | + | ||
| 433 | +}]; |
-
请 注册 或 登录 后发表评论