From eeb1d13549db30df72d99569f71a6636f5d83096 Mon Sep 17 00:00:00 2001 From: Victor Saisa Lopez Date: Tue, 16 Oct 2012 12:24:55 -0400 Subject: [PATCH 01/33] BUG 9887 "No se muestra del color correspondiente la tarea..." SOLVED - In the processMap not validate the route type of task (ie for colors) - For the color of the task now takes into account the type of route * Available from version 2.0.45 --- workflow/engine/classes/class.processMap.php | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/workflow/engine/classes/class.processMap.php b/workflow/engine/classes/class.processMap.php index 0a4d833fe..6c243430d 100755 --- a/workflow/engine/classes/class.processMap.php +++ b/workflow/engine/classes/class.processMap.php @@ -220,6 +220,8 @@ class processMap if ($aRow3) { $aRow2['FINISH'] = ''; } + + /* if (($aRow2['FINISH'] == null) && ($aRow1['TAS_UID'] == $sTask)) { $oTask->color = '#FF0000'; } else { @@ -234,6 +236,21 @@ class processMap $oTask->color = "#939598"; } } + */ + if (empty($aRow2["FINISH"]) && $aRow1["TAS_UID"] == $sTask) { + $oTask->color = "#FF0000"; //Red + } else { + if (!empty($aRow2["FINISH"])) { + $oTask->color = "#006633"; //Green + } else { + if ($aRow2["CANT"] == 0 || $oTask->derivation->type != 5) { + $oTask->color = "#939598"; //Gray + } else { + //$oTask->color = "#FF9900"; //Yellow + $oTask->color = "#FF0000"; //Red + } + } + } } else { if ($bView && ($sApplicationUID != '') && ($iDelegation > 0) && ($sTask != '')) { $oCriteria = new Criteria( 'workflow' ); @@ -257,6 +274,8 @@ class processMap if ($aRow3) { $aRow2['FINISH'] = ''; } + + /* if (($aRow2['FINISH'] == null) && ($aRow1['TAS_UID'] == $sTask)) { $oTask->color = '#FF0000'; } else { @@ -270,6 +289,20 @@ class processMap $oTask->color = '#939598'; } } + */ + if (empty($aRow2["FINISH"]) && $aRow1["TAS_UID"] == $sTask) { + $oTask->color = "#FF0000"; //Red + } else { + if (!empty($aRow2["FINISH"])) { + $oTask->color = "#006633"; //Green + } else { + if ($aRow2["CANT"] == 0 || $oTask->derivation->type != 5) { + $oTask->color = "#939598"; //Gray + } else { + $oTask->color = "#FF9900"; //Yellow + } + } + } } } From 2b557edac2f9e4c867cf9d0b36b5d57931701fc5 Mon Sep 17 00:00:00 2001 From: Julio Cesar Laura Date: Tue, 16 Oct 2012 12:52:20 -0400 Subject: [PATCH 02/33] Add validation for the new fields on Process table --- workflow/engine/classes/model/Process.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/workflow/engine/classes/model/Process.php b/workflow/engine/classes/model/Process.php index 9ee526412..397ecf43a 100755 --- a/workflow/engine/classes/model/Process.php +++ b/workflow/engine/classes/model/Process.php @@ -454,11 +454,11 @@ class Process extends BaseProcess { $this->setProAssignment ( $aData['PRO_ASSIGNMENT'] ); $this->setProShowMap ( $aData['PRO_SHOW_MAP'] ); $this->setProShowMessage ( $aData['PRO_SHOW_MESSAGE'] ); - $this->setProSubprocess ( $aData['PRO_SUBPROCESS'] ); - $this->setProTriDeleted ( $aData['PRO_TRI_DELETED'] ); - $this->setProTriCanceled ( $aData['PRO_TRI_CANCELED'] ); - $this->setProTriPaused ( $aData['PRO_TRI_PAUSED'] ); - $this->setProTriReassigned( $aData['PRO_TRI_REASSIGNED'] ); + $this->setProSubprocess ( isset($aData['PRO_SUBPROCESS']) ? $aData['PRO_SUBPROCESS'] : '' ); + $this->setProTriDeleted ( isset($aData['PRO_TRI_DELETED']) ? $aData['PRO_TRI_DELETED'] : '' ); + $this->setProTriCanceled ( isset($aData['PRO_TRI_CANCELED']) ? $aData['PRO_TRI_CANCELED'] : '' ); + $this->setProTriPaused ( isset($aData['PRO_TRI_PAUSED']) ? $aData['PRO_TRI_PAUSED'] : '' ); + $this->setProTriReassigned( isset($aData['PRO_TRI_REASSIGNED']) ? $aData['PRO_TRI_REASSIGNED'] : '' ); $this->setProShowDelegate ( $aData['PRO_SHOW_DELEGATE'] ); $this->setProShowDynaform ( $aData['PRO_SHOW_DYNAFORM'] ); From 5f0b6afaf15e32b97e5cf8a6a2bdd5ee2171d331 Mon Sep 17 00:00:00 2001 From: Ralph Asendeteufrer Date: Tue, 16 Oct 2012 13:32:16 -0400 Subject: [PATCH 03/33] BUG 9877 PM table Dynaform Title size could grows up to infinite PROBLEM The title of the Dynaforms grows up at time to create it from a PM table. SOLUTION the title should no concat the names of the PM tables in the dynaform table, no it is only assigning the PM table tittle in case the title is empty. --- workflow/engine/xmlform/dynaforms/dynaforms_Edit.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflow/engine/xmlform/dynaforms/dynaforms_Edit.xml b/workflow/engine/xmlform/dynaforms/dynaforms_Edit.xml index 6e87b2372..3912d89ee 100755 --- a/workflow/engine/xmlform/dynaforms/dynaforms_Edit.xml +++ b/workflow/engine/xmlform/dynaforms/dynaforms_Edit.xml @@ -17,7 +17,7 @@ Create from a PM Table - + Title @@ -87,7 +87,7 @@ document.getElementById('form[DYN_TITLE]').value = document.getElementById('form leimnud.event.add(document.getElementById('form[ADD_TABLE]'), 'change', setPMTableDynaformTitle); function setPMTableDynaformTitle(){ if(document.getElementById('form[ADD_TABLE]').value!=''){ - document.getElementById('form[DYN_TITLE]').value = document.getElementById('form[DYN_TITLE]').value + document.getElementById('form[ADD_TABLE]')[document.getElementById('form[ADD_TABLE]').selectedIndex].innerHTML; + document.getElementById('form[DYN_TITLE]').value = document.getElementById('form[ADD_TABLE]')[document.getElementById('form[ADD_TABLE]').selectedIndex].innerHTML; } } var oPanel; From 8ebd27a06492e1c1cf2b81d0c5f0762ba44aeb54 Mon Sep 17 00:00:00 2001 From: norahmollo Date: Tue, 16 Oct 2012 18:08:45 +0000 Subject: [PATCH 04/33] OD STYLE Formating workflow/engine/methods/login/ Change format files in workflow/engine/methods/login/ --- .../engine/methods/login/authentication.php | 10 +- .../engine/methods/login/changePassword.php | 77 ++++--- workflow/engine/methods/login/dbInfo.php | 117 +++++----- .../engine/methods/login/forgotPassword.php | 6 +- workflow/engine/methods/login/index.php | 2 +- workflow/engine/methods/login/login_Ajax.php | 45 ++-- workflow/engine/methods/login/noViewPage.php | 4 +- .../engine/methods/login/retrivePassword.php | 203 ++++++++---------- .../engine/methods/login/sysLoginVerify.php | 12 +- 9 files changed, 219 insertions(+), 257 deletions(-) diff --git a/workflow/engine/methods/login/authentication.php b/workflow/engine/methods/login/authentication.php index a233c0074..5f18b6fe3 100755 --- a/workflow/engine/methods/login/authentication.php +++ b/workflow/engine/methods/login/authentication.php @@ -154,9 +154,9 @@ try { } if (PHP_VERSION < 5.2) { - setcookie(session_name(), session_id(), null, '/', '; HttpOnly'); + setcookie(session_name(), session_id(), null, '/', '; HttpOnly'); } else { - setcookie(session_name(), session_id(), null, '/', null, null, true); + setcookie(session_name(), session_id(), null, '/', null, null, true); } $aUser = $RBAC->userObj->load($_SESSION['USER_LOGGED']); @@ -214,11 +214,11 @@ try { //************** background processes, here we are putting some back office routines ********** $heartBeatNWIDate = $oServerConf->getHeartbeatProperty('HB_NEXT_GWI_DATE','HEART_BEAT_CONF'); if (is_null($heartBeatNWIDate)) { - $heartBeatNWIDate = time(); + $heartBeatNWIDate = time(); } if (time() >= $heartBeatNWIDate) { - $oServerConf->setWsInfo(SYS_SYS, $oServerConf->getWorkspaceInfo(SYS_SYS)); - $oServerConf->setHeartbeatProperty('HB_NEXT_GWI_DATE', strtotime('+1 day'), 'HEART_BEAT_CONF'); + $oServerConf->setWsInfo(SYS_SYS, $oServerConf->getWorkspaceInfo(SYS_SYS)); + $oServerConf->setHeartbeatProperty('HB_NEXT_GWI_DATE', strtotime('+1 day'), 'HEART_BEAT_CONF'); } //**** defining and saving server info, this file has the values of the global array $_SERVER **** diff --git a/workflow/engine/methods/login/changePassword.php b/workflow/engine/methods/login/changePassword.php index 518a10fd1..12e6fc988 100755 --- a/workflow/engine/methods/login/changePassword.php +++ b/workflow/engine/methods/login/changePassword.php @@ -24,63 +24,62 @@ require_once 'classes/model/UsersProperties.php'; $oUserProperty = new UsersProperties(); $aUserProperty = $oUserProperty->load($_SESSION['USER_LOGGED']); $aHistory = unserialize($aUserProperty['USR_PASSWORD_HISTORY']); + if (!is_array($aHistory)) { - $aHistory = array(); + $aHistory = array(); } + if (!defined('PPP_PASSWORD_HISTORY')) { - define('PPP_PASSWORD_HISTORY', 0); + define('PPP_PASSWORD_HISTORY', 0); } + if (PPP_PASSWORD_HISTORY > 0) { - if (count($aHistory) >= PPP_PASSWORD_HISTORY) { - array_shift($aHistory); - } - $aHistory[] = $_POST['form']['USR_PASSWORD']; + if (count($aHistory) >= PPP_PASSWORD_HISTORY) { + array_shift($aHistory); + } + $aHistory[] = $_POST['form']['USR_PASSWORD']; } + $aUserProperty['USR_LAST_UPDATE_DATE'] = date('Y-m-d H:i:s'); $aUserProperty['USR_LOGGED_NEXT_TIME'] = 0; $aUserProperty['USR_PASSWORD_HISTORY'] = serialize($aHistory); $oUserProperty->update($aUserProperty); -if ( class_exists('redirectDetail')) { - //falta validar... - if(isset($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'])) - $userRole = $RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE']; - $oPluginRegistry = &PMPluginRegistry::getSingleton(); - //$oPluginRegistry->showArrays(); - $aRedirectLogin = $oPluginRegistry->getRedirectLogins(); - if(isset($aRedirectLogin)) - { if(is_array($aRedirectLogin)) - { - foreach ( $aRedirectLogin as $key=>$detail ) { - if(isset($detail->sPathMethod)) - { - if ( $detail->sRoleCode == $userRole ) { - G::header('location: /sys' . SYS_TEMP . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $detail->sPathMethod ); - die; - } +if (class_exists('redirectDetail')) { + //falta validar... + if (isset($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'])) { + $userRole = $RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE']; + } + $oPluginRegistry = &PMPluginRegistry::getSingleton(); + //$oPluginRegistry->showArrays(); + $aRedirectLogin = $oPluginRegistry->getRedirectLogins(); + if (isset($aRedirectLogin)) { + if (is_array($aRedirectLogin)) { + foreach ($aRedirectLogin as $key => $detail) { + if (isset($detail->sPathMethod)) { + if ($detail->sRoleCode == $userRole) { + G::header('location: /sys' . SYS_TEMP . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $detail->sPathMethod ); + die; + } + } } } - } - } + } } //end plugin - - if (isset($frm['USER_LANG'])) { +if (isset($frm['USER_LANG'])) { if ($frm['USER_LANG'] != '') { - $lang = $frm['USER_LANG']; + $lang = $frm['USER_LANG']; } - } - else { +} else { if (defined('SYS_LANG')) { - $lang = SYS_LANG; + $lang = SYS_LANG; + } else { + $lang = 'en'; } - else { - $lang = 'en'; - } - } - $sLocation = $oUserProperty->redirectTo($_SESSION['USER_LOGGED'], $lang); - G::header('Location: ' . $sLocation); - die; +} +$sLocation = $oUserProperty->redirectTo($_SESSION['USER_LOGGED'], $lang); +G::header('Location: ' . $sLocation); +die; -?> \ No newline at end of file diff --git a/workflow/engine/methods/login/dbInfo.php b/workflow/engine/methods/login/dbInfo.php index 7b4f288cf..65dce49ba 100755 --- a/workflow/engine/methods/login/dbInfo.php +++ b/workflow/engine/methods/login/dbInfo.php @@ -24,82 +24,78 @@ * */ -function lookup( $target ) { - global $ntarget; - $msg = $target . ' => '; - //if (eregi ( '[a-zA-Z]', $target )) - if (preg_match( '[a-zA-Z]', $target )) //Made compatible to PHP 5.3 - $ntarget = gethostbyname ( $target ); - else - $ntarget = gethostbyaddr ( $target ); - $msg .= $ntarget; - return ($msg); +function lookup ($target) +{ + global $ntarget; + $msg = $target . ' => '; + //if (eregi ( '[a-zA-Z]', $target )) + if (preg_match( '[a-zA-Z]', $target )) { + //Made compatible to PHP 5.3 + $ntarget = gethostbyname ( $target ); + } else { + $ntarget = gethostbyaddr ( $target ); + } + $msg .= $ntarget; + return ($msg); } G::LoadClass("system"); if (getenv ( 'HTTP_CLIENT_IP' )) { - $ip = getenv ( 'HTTP_CLIENT_IP' ); -} -else { - if (getenv ( 'HTTP_X_FORWARDED_FOR' )) { - $ip = getenv ( 'HTTP_X_FORWARDED_FOR' ); - } - else { - $ip = getenv ( 'REMOTE_ADDR' ); - } + $ip = getenv ( 'HTTP_CLIENT_IP' ); +} else { + if (getenv ( 'HTTP_X_FORWARDED_FOR' )) { + $ip = getenv ( 'HTTP_X_FORWARDED_FOR' ); + } else { + $ip = getenv ( 'REMOTE_ADDR' ); + } } $redhat = ''; if (file_exists ( '/etc/redhat-release' )) { - $fnewsize = filesize ( '/etc/redhat-release' ); - $fp = fopen ( '/etc/redhat-release', 'r' ); - $redhat = trim ( fread ( $fp, $fnewsize ) ); - fclose ( $fp ); + $fnewsize = filesize ( '/etc/redhat-release' ); + $fp = fopen ( '/etc/redhat-release', 'r' ); + $redhat = trim ( fread ( $fp, $fnewsize ) ); + fclose ( $fp ); } $redhat .= " (" . PHP_OS . ")"; if (defined ( "DB_HOST" )) { - G::LoadClass ( 'net' ); - G::LoadClass ( 'dbConnections' ); - $dbNetView = new NET ( DB_HOST ); - $dbNetView->loginDbServer ( DB_USER, DB_PASS ); - - $dbConns = new dbConnections ( '' ); - $availdb = ''; - foreach ( $dbConns->getDbServicesAvailables () as $key => $val ) { - if ($availdb != '') - $availdb .= ', '; - $availdb .= $val ['name']; - } - - try { - - $sMySQLVersion = $dbNetView->getDbServerVersion ( DB_ADAPTER ); - - } - catch ( Exception $oException ) { - $sMySQLVersion = '?????'; - } + G::LoadClass ( 'net' ); + G::LoadClass ( 'dbConnections' ); + $dbNetView = new NET ( DB_HOST ); + $dbNetView->loginDbServer ( DB_USER, DB_PASS ); + $dbConns = new dbConnections ( '' ); + $availdb = ''; + foreach ($dbConns->getDbServicesAvailables () as $key => $val) { + if ($availdb != '') { + $availdb .= ', '; + } + $availdb .= $val ['name']; + } + try { + $sMySQLVersion = $dbNetView->getDbServerVersion ( DB_ADAPTER ); + } catch (Exception $oException) { + $sMySQLVersion = '?????'; + } } $Fields ['SYSTEM'] = $redhat; if (defined ( "DB_HOST" )) { - $Fields ['DATABASE'] = $dbNetView->dbName ( DB_ADAPTER ) . ' (Version ' . $sMySQLVersion . ')'; - $Fields ['DATABASE_SERVER'] = DB_HOST; - $Fields ['DATABASE_NAME'] = DB_NAME; - $Fields ['AVAILABLE_DB'] = $availdb; -} -else { - $Fields ['DATABASE'] = "Not defined"; - $Fields ['DATABASE_SERVER'] = "Not defined"; - $Fields ['DATABASE_NAME'] = "Not defined"; - $Fields ['AVAILABLE_DB'] = "Not defined"; + $Fields ['DATABASE'] = $dbNetView->dbName ( DB_ADAPTER ) . ' (Version ' . $sMySQLVersion . ')'; + $Fields ['DATABASE_SERVER'] = DB_HOST; + $Fields ['DATABASE_NAME'] = DB_NAME; + $Fields ['AVAILABLE_DB'] = $availdb; +} else { + $Fields ['DATABASE'] = "Not defined"; + $Fields ['DATABASE_SERVER'] = "Not defined"; + $Fields ['DATABASE_NAME'] = "Not defined"; + $Fields ['AVAILABLE_DB'] = "Not defined"; } $eeT=""; - if(class_exists('pmLicenseManager')){ +if (class_exists('pmLicenseManager')) { $eeT=" - Enterprise Edition"; - } +} $Fields ['PHP'] = phpversion (); $Fields ['FLUID'] = System::getVersion() . $eeT; $Fields ['IP'] = lookup ( $ip ); @@ -113,8 +109,9 @@ $Fields ['SERVER_ADDR'] = getenv ( 'SERVER_ADDR' ); $Fields ['HTTP_USER_AGENT'] = getenv ( 'HTTP_USER_AGENT' ); $Fields ['TIME_ZONE'] = (defined('TIME_ZONE')) ? TIME_ZONE : "Unknown"; -if (! defined ( 'SKIP_RENDER_SYSTEM_INFORMATION' )) { - $G_PUBLISH = new Publisher ( ); - $G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'login/dbInfo', '', $Fields, 'appNew2' ); - G::RenderPage ( 'publish', 'raw' ); +if (!defined( 'SKIP_RENDER_SYSTEM_INFORMATION')) { + $G_PUBLISH = new Publisher ( ); + $G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'login/dbInfo', '', $Fields, 'appNew2' ); + G::RenderPage ( 'publish', 'raw' ); } + diff --git a/workflow/engine/methods/login/forgotPassword.php b/workflow/engine/methods/login/forgotPassword.php index 14db83533..755fab2db 100755 --- a/workflow/engine/methods/login/forgotPassword.php +++ b/workflow/engine/methods/login/forgotPassword.php @@ -22,7 +22,7 @@ * Coral Gables, FL, 33134, USA, or email info@colosa.com. * */ - $G_PUBLISH = new Publisher (); - $G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'login/forgotPassword', '', array(), 'retrivePassword.php'); - G::RenderPage ( "publish" ); +$G_PUBLISH = new Publisher (); +$G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'login/forgotPassword', '', array(), 'retrivePassword.php'); +G::RenderPage ( "publish" ); diff --git a/workflow/engine/methods/login/index.php b/workflow/engine/methods/login/index.php index 86dc1a932..57d0c8733 100755 --- a/workflow/engine/methods/login/index.php +++ b/workflow/engine/methods/login/index.php @@ -22,7 +22,7 @@ * Coral Gables, FL, 33134, USA, or email info@colosa.com. * */ - $newFile = str_replace ( 'index.php', 'login.php' , __FILE__ ) ; + $newFile = str_replace ( 'index.php', 'login.php' , __FILE__ ); return $newFile; \ No newline at end of file diff --git a/workflow/engine/methods/login/login_Ajax.php b/workflow/engine/methods/login/login_Ajax.php index b9ad4c349..905b4b9aa 100755 --- a/workflow/engine/methods/login/login_Ajax.php +++ b/workflow/engine/methods/login/login_Ajax.php @@ -23,28 +23,25 @@ * */ try { - - G::LoadInclude ( 'ajax' ); - if (isset ( $_POST ['form'] )) { - $_POST = $_POST ['form']; - } - $_POST ['function'] = get_ajax_value ( 'function' ); - switch ($_POST ['function']) { - case 'getStarted_save' : - require_once 'classes/model/Configuration.php'; - $aData ['CFG_UID'] = 'getStarted'; - $aData ['OBJ_UID'] = ''; - $aData ['CFG_VALUE'] = '1'; - $aData ['PRO_UID'] = ''; - $aData ['USR_UID'] = ''; - $aData ['APP_UID'] = ''; - - $oConfig = new Configuration ( ); - - $oConfig->create ( $aData ); - break; - } -} -catch ( Exception $oException ) { - die ( $oException->getMessage () ); + G::LoadInclude ( 'ajax' ); + if (isset ( $_POST ['form'] )) { + $_POST = $_POST ['form']; + } + $_POST ['function'] = get_ajax_value ( 'function' ); + switch ($_POST ['function']) { + case 'getStarted_save': + require_once 'classes/model/Configuration.php'; + $aData ['CFG_UID'] = 'getStarted'; + $aData ['OBJ_UID'] = ''; + $aData ['CFG_VALUE'] = '1'; + $aData ['PRO_UID'] = ''; + $aData ['USR_UID'] = ''; + $aData ['APP_UID'] = ''; + $oConfig = new Configuration ( ); + $oConfig->create ( $aData ); + break; + } +} catch ( Exception $oException ) { + die ( $oException->getMessage () ); } + diff --git a/workflow/engine/methods/login/noViewPage.php b/workflow/engine/methods/login/noViewPage.php index 92323c55a..4692aa4cb 100755 --- a/workflow/engine/methods/login/noViewPage.php +++ b/workflow/engine/methods/login/noViewPage.php @@ -30,7 +30,7 @@ $G_SUB_MENU = "empty"; $referer = $_SERVER ['HTTP_REFERER']; $dbc = new DBConnection ( ); $G_PUBLISH = new Publisher ( ); -$G_PUBLISH->AddContent ( "xmlform", "xmlform", "login/noViewPage", "", NULL ); +$G_PUBLISH->AddContent ( "xmlform", "xmlform", "login/noViewPage", "", null ); G::RenderPage ( "publish" ); -?> \ No newline at end of file + diff --git a/workflow/engine/methods/login/retrivePassword.php b/workflow/engine/methods/login/retrivePassword.php index 179148af8..e4a3b6e5c 100755 --- a/workflow/engine/methods/login/retrivePassword.php +++ b/workflow/engine/methods/login/retrivePassword.php @@ -11,40 +11,40 @@ $user = new Users(); $userData = $rbacUser->getByUsername($data['USR_USERNAME']); -if($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL']) { - $aSetup = getEmailConfiguration(); - if (count($aSetup) == 0 || !isset($aSetup['MESS_ENGINE'])) { - G::SendTemporalMessage ('ID_EMAIL_ENGINE_IS_NOT_ENABLED', "warning"); - G::header('location: forgotPassword'); - die; - } +if ($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL']) { + $aSetup = getEmailConfiguration(); + if (count($aSetup) == 0 || !isset($aSetup['MESS_ENGINE'])) { + G::SendTemporalMessage ('ID_EMAIL_ENGINE_IS_NOT_ENABLED', "warning"); + G::header('location: forgotPassword'); + die; + } - $newPass = G::generate_password(); + $newPass = G::generate_password(); - $aData['USR_UID'] = $userData['USR_UID']; - $aData['USR_PASSWORD'] = md5($newPass); -/* **Save after sending the mail - $rbacUser->update($aData); - $user->update($aData); -*/ - $sFrom = ($aSetup['MESS_ACCOUNT'] != '' ? $aSetup['MESS_ACCOUNT'] . ' ' : '') . '<' . $aSetup['MESS_ACCOUNT'] . '>'; - $sSubject = G::LoadTranslation('ID_RESET_PASSWORD').' - ProcessMaker' ; - $msg = '

ProcessMaker Forgot password Service

'; - $msg .='

'.G::LoadTranslation('ID_YOUR_USERMANE_IS').' : '.$userData['USR_USERNAME'].'

'; - $msg .='

'.G::LoadTranslation('ID_YOUR_PASSWORD_IS').' : '.$newPass.'

'; - switch ($aSetup['MESS_ENGINE']) { - case 'MAIL': - $engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_1'); - break; - case 'PHPMAILER': - $engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_2'); - break; - case 'OPENMAIL': - $engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_3'); - break; - } + $aData['USR_UID'] = $userData['USR_UID']; + $aData['USR_PASSWORD'] = md5($newPass); + /* **Save after sending the mail + $rbacUser->update($aData); + $user->update($aData); + */ + $sFrom = ($aSetup['MESS_ACCOUNT'] != '' ? $aSetup['MESS_ACCOUNT'] . ' ' : '') . '<' . $aSetup['MESS_ACCOUNT'] . '>'; + $sSubject = G::LoadTranslation('ID_RESET_PASSWORD').' - ProcessMaker' ; + $msg = '

ProcessMaker Forgot password Service

'; + $msg .='

'.G::LoadTranslation('ID_YOUR_USERMANE_IS').' : '.$userData['USR_USERNAME'].'

'; + $msg .='

'.G::LoadTranslation('ID_YOUR_PASSWORD_IS').' : '.$newPass.'

'; + switch ($aSetup['MESS_ENGINE']) { + case 'MAIL': + $engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_1'); + break; + case 'PHPMAILER': + $engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_2'); + break; + case 'OPENMAIL': + $engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_3'); + break; + } - $sBody = " + $sBody = " @@ -53,99 +53,66 @@ if($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL'] www.processmaker.com
$msg
"; - G::LoadClass('spool'); - $oSpool = new spoolRun(); + G::LoadClass('spool'); + $oSpool = new spoolRun(); - $oSpool->setConfig( array( - 'MESS_ENGINE' => $aSetup['MESS_ENGINE'], - 'MESS_SERVER' => $aSetup['MESS_SERVER'], - 'MESS_PORT' => $aSetup['MESS_PORT'], - 'MESS_ACCOUNT' => $aSetup['MESS_ACCOUNT'], - 'MESS_PASSWORD' => $aSetup['MESS_PASSWORD'], - 'SMTPAuth' => $aSetup['MESS_RAUTH'], - 'SMTPSecure' => $aSetup['SMTPSecure'] - )); + $oSpool->setConfig( array( + 'MESS_ENGINE' => $aSetup['MESS_ENGINE'], + 'MESS_SERVER' => $aSetup['MESS_SERVER'], + 'MESS_PORT' => $aSetup['MESS_PORT'], + 'MESS_ACCOUNT' => $aSetup['MESS_ACCOUNT'], + 'MESS_PASSWORD' => $aSetup['MESS_PASSWORD'], + 'SMTPAuth' => $aSetup['MESS_RAUTH'], + 'SMTPSecure' => $aSetup['SMTPSecure'] + )); - $passwd = $oSpool->config['MESS_PASSWORD']; - $passwdDec = G::decrypt($passwd,'EMAILENCRYPT'); - $auxPass = explode('hash:', $passwdDec); - if (count($auxPass) > 1) { - if (count($auxPass) == 2) { - $passwd = $auxPass[1]; - } else { - array_shift($auxPass); - $passwd = implode('', $auxPass); + $passwd = $oSpool->config['MESS_PASSWORD']; + $passwdDec = G::decrypt($passwd,'EMAILENCRYPT'); + $auxPass = explode('hash:', $passwdDec); + if (count($auxPass) > 1) { + if (count($auxPass) == 2) { + $passwd = $auxPass[1]; + } else { + array_shift($auxPass); + $passwd = implode('', $auxPass); + } } - } - $oSpool->config['MESS_PASSWORD'] = $passwd; - $oSpool->create(array( - 'msg_uid' => '', - 'app_uid' => '', - 'del_index' => 0, - 'app_msg_type' => 'TEST', - 'app_msg_subject' => $sSubject, - 'app_msg_from' => $sFrom, - 'app_msg_to' => $data['USR_EMAIL'], - 'app_msg_body' => $sBody, - 'app_msg_cc' => '', - 'app_msg_bcc' => '', - 'app_msg_attach' => '', - 'app_msg_template' => '', - 'app_msg_status' => 'pending', - 'app_msg_attach'=>'' - )); + $oSpool->config['MESS_PASSWORD'] = $passwd; - try { - - $oSpool->sendMail(); - - $rbacUser->update($aData); - $user->update($aData); - - G::header ("location: login.html"); - G::SendTemporalMessage ('ID_NEW_PASSWORD_SENT', "info"); - } - catch (phpmailerException $e) { - G::header ("location: login.html"); - G::SendTemporalMessage (G::LoadTranslation('MISSING_OR_NOT_CONFIGURED_SMTP'), "warning", 'string'); - } - catch (Exception $e) { - G::header ("location: login.html"); - G::SendTemporalMessage ($e->getMessage(), "warning", 'string'); - } + $oSpool->create(array( + 'msg_uid' => '', + 'app_uid' => '', + 'del_index' => 0, + 'app_msg_type' => 'TEST', + 'app_msg_subject' => $sSubject, + 'app_msg_from' => $sFrom, + 'app_msg_to' => $data['USR_EMAIL'], + 'app_msg_body' => $sBody, + 'app_msg_cc' => '', + 'app_msg_bcc' => '', + 'app_msg_attach' => '', + 'app_msg_template' => '', + 'app_msg_status' => 'pending', + 'app_msg_attach'=>'' + )); + try { + $oSpool->sendMail(); + $rbacUser->update($aData); + $user->update($aData); + G::header ("location: login.html"); + G::SendTemporalMessage ('ID_NEW_PASSWORD_SENT', "info"); + } catch (phpmailerException $e) { + G::header ("location: login.html"); + G::SendTemporalMessage (G::LoadTranslation('MISSING_OR_NOT_CONFIGURED_SMTP'), "warning", 'string'); + } catch (Exception $e) { + G::header ("location: login.html"); + G::SendTemporalMessage ($e->getMessage(), "warning", 'string'); + } } else { - $msg = G::LoadTranslation('ID_USER') . ' ' . $data['USR_USERNAME'] . ' '. G::LoadTranslation('ID_IS_NOT_REGISTERED'); - G::SendTemporalMessage ($msg, "warning", 'string'); - G::header('location: forgotPassword'); + $msg = G::LoadTranslation('ID_USER') . ' ' . $data['USR_USERNAME'] . ' '. G::LoadTranslation('ID_IS_NOT_REGISTERED'); + G::SendTemporalMessage ($msg, "warning", 'string'); + G::header('location: forgotPassword'); } - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/workflow/engine/methods/login/sysLoginVerify.php b/workflow/engine/methods/login/sysLoginVerify.php index a49b41028..480b30ec1 100755 --- a/workflow/engine/methods/login/sysLoginVerify.php +++ b/workflow/engine/methods/login/sysLoginVerify.php @@ -23,9 +23,11 @@ * */ -if (! isset ( $_POST )) - G::header ( 'location: /sys/' . $lang . '/' . SYS_SKIN . '/' . 'login/login' ); +if (! isset ( $_POST )) { + G::header ( 'location: /sys/' . $lang . '/' . SYS_SKIN . '/' . 'login/login' ); +} +if (isset ( $_SESSION ['sysLogin'] )) { + $_POST ['form'] = $_SESSION ['sysLogin']; +} +require_once ('authentication.php'); -if (isset ( $_SESSION ['sysLogin'] )) - $_POST ['form'] = $_SESSION ['sysLogin']; -require_once ('authentication.php'); \ No newline at end of file From 93abda2b924e25632ec82f979a95481aac8c02c1 Mon Sep 17 00:00:00 2001 From: Julio Cesar Laura Date: Tue, 16 Oct 2012 14:11:05 -0400 Subject: [PATCH 05/33] Fix issues with dorms accesibility (Stanford) --- gulliver/js/grid/core/grid.js | 23 +++++++++++++---------- gulliver/system/class.xmlform.php | 23 ++++++++++------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/gulliver/js/grid/core/grid.js b/gulliver/js/grid/core/grid.js index 14b42b873..c1d8a1341 100755 --- a/gulliver/js/grid/core/grid.js +++ b/gulliver/js/grid/core/grid.js @@ -681,17 +681,20 @@ var G_Grid = function(oForm, sGridName){ } } } + + //Set focus the first element in the grid + for (var i = 0; i < this.aFields.length; i++) { + var fieldName = 'form[' + sGridName + '][' + currentRow + '][' + this.aFields[i].sFieldName + ']'; + if (this.aFields[i].sType != 'file' && document.getElementById(fieldName).focus) { + document.getElementById(fieldName).focus(); + break; + } + } + //Fires OnAddRow Event if (this.onaddrow) { this.onaddrow(currentRow); } - var newInputs = oNewRow.getElementsByTagName('input'); - for (var i = 0; i < newInputs.length; i++) { - if (typeof(newInputs[i]) != 'undefined' && newInputs[i].type != 'hidden') { - newInputs[i].focus(); - break; - } - } }; this.deleteGridRow = function (sRow, bWithoutConfirm) @@ -740,12 +743,12 @@ var G_Grid = function(oForm, sGridName){ for (i = 1; i < oObj.oGrid.rows[iRowAux - 1].cells.length; i++) { var oCell1 = oObj.oGrid.rows[iRowAux - 1].cells[i]; var oCell2 = oObj.oGrid.rows[iRowAux].cells[i]; - + switch (oCell1.innerHTML.replace(/^\s+|\s+$/g, '').substr(0, 6).toLowerCase()){ case '' . ' ' . '' - . '' + . 'x' . ' ' . '' . ''; @@ -4789,19 +4789,16 @@ class xmlformTemplate extends Smarty $value = (isset ( $form->values [$k] )) ? $form->values [$k] : NULL; $result [$k] = G::replaceDataField ( $form->fields [$k]->label, $form->values ); if ($form->type == 'xmlform') { - if ($v->type == 'checkgroup' || $v->type == 'radiogroup') { - $firstValueOptions = ''; - foreach ($v->options as $indexOption => $valueOptions) { - $firstValueOptions = $indexOption; - break; - } - if ($firstValueOptions != '') { - $result[$k] = ''; - } else { - $result[$k] = ''; - } - } else { + if ($v->type != 'checkgroup' && $v->type != 'radiogroup') { $result[$k] = ''; + } else { + if (is_array($v->options)) { + foreach ($v->options as $optionValue => $optionLabel) { + if (isset($form->fields[$k]->options[$optionValue])) { + $form->fields[$k]->options[$optionValue] = ''; + } + } + } } } if (! is_array ( $value )) { From 0dd1dbb5f7e5e6b4caa25b5741cc88137382980c Mon Sep 17 00:00:00 2001 From: Julio Cesar Laura Date: Tue, 16 Oct 2012 14:14:29 -0400 Subject: [PATCH 06/33] Delete addional "x" character --- gulliver/system/class.xmlform.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulliver/system/class.xmlform.php b/gulliver/system/class.xmlform.php index f68c94b18..d785fb77e 100755 --- a/gulliver/system/class.xmlform.php +++ b/gulliver/system/class.xmlform.php @@ -3861,7 +3861,7 @@ class XmlForm_Field_Date extends XmlForm_Field_SimpleText . '' . ' ' . '' - . 'x' + . '' . ' ' . '' . ''; From e47528c28ad00acdb89d560261c780ba1f8e1b36 Mon Sep 17 00:00:00 2001 From: Fernando Ontiveros Date: Tue, 16 Oct 2012 14:45:41 -0400 Subject: [PATCH 07/33] JENKINS-CI changing phpunit.xml to first stage in jenkins, in this first stage we only check style and basic phpunits --- phpunit.xml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index c423da389..d3ed5e4d7 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -7,14 +7,13 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" - stopOnFailure="false" - syntaxCheck="false" + stopOnFailure="true" + syntaxCheck="true" bootstrap="tests/bootstrap.php" > ./tests/automated/ - ./tests/unit/backend/services/ ".$v."
"; - */ - if ($value['TAS_TYPE']=='NORMAL') { - $ini = ($value['TAS_START']=='TRUE') ? 'true' : 'false'; - - $nodo_task = addNodox($doc, $nodo_tasks, 'Task', '', array('Title'=> $value['TAS_TITLE'],'Description'=> $value['TAS_DESCRIPTION'],'Id'=> 'ID'.$value['TAS_UID'],'StartingTask'=> $ini)); - $nodo_coordinates = addNodox($doc, $nodo_task, 'Coordinates', '', array('XCoordinate'=> $value['TAS_POSX'],'YCoordinate'=> $value['TAS_POSY'])); - $nodo_derivationrule = addNodox($doc, $nodo_task, 'DerivationRule', '', ''); - - derivationRules($aRoute, $doc, $nodo_derivationrule); - - $nodo_assignmentrules = addNodox($doc, $nodo_task, 'AssignmentRules', '', ''); - $nodo_cyclicalassignment = addNodox($doc, $nodo_assignmentrules, 'CyclicalAssignment', '', ''); - $nodo_timingcontrol = addNodox($doc, $nodo_task, 'TimingControl', '', array('TaskDuration'=> $value['TAS_DURATION'])); - $nodo_permissions = addNodox($doc, $nodo_task, 'Permissions', '', ''); - $nodo_caselabels = addNodox($doc, $nodo_task, 'CaseLabels', '', ''); - $nodo_notifications = addNodox($doc, $nodo_task, 'Notifications', '', ''); - } else { - require_once ( "classes/model/SubProcess.php" ); - $oCriteria = new Criteria('workflow'); - $oCriteria->add(SubProcessPeer::PRO_PARENT, $value['PRO_UID']); - $oCriteria->add(SubProcessPeer::TAS_PARENT, $value['TAS_UID']); - $oDataset = SubProcessPeer::doSelectRS($oCriteria); - $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); - $oDataset->next(); - $aRow = $oDataset->getRow(); - $nodo_task = addNodox($doc, $nodo_tasks, 'SubProcess', '', array('Title'=> $value['TAS_TITLE'],'Description'=> $value['TAS_DESCRIPTION'],'Id'=> 'ID'.$value['TAS_UID'], 'ProcessRef'=>$aRow['PRO_UID'])); - $nodo_coordinates = addNodox($doc, $nodo_task, 'Coordinates', '', array('XCoordinate'=> $value['TAS_POSX'],'YCoordinate'=> $value['TAS_POSY'])); - $nodo_derivationrule = addNodox($doc, $nodo_task, 'DerivationRule', '', ''); - - derivationRules($aRoute, $doc, $nodo_derivationrule); - } - } - $oDataset->next(); -} -//die; -$doc->preserveWhiteSpace = false; -$doc->formatOutput = true; -$doc->save(PATH_METHODS.'services/test_xpdl.xml'); -echo "xml for xpdl creado!!!
"; - diff --git a/workflow/engine/templates/bpmn/Annotation.js b/workflow/engine/templates/bpmn/Annotation.js deleted file mode 100755 index 2382ad80d..000000000 --- a/workflow/engine/templates/bpmn/Annotation.js +++ /dev/null @@ -1,321 +0,0 @@ -ArrowLine=function(){ - this.lineColor=new Color(0,0,0); - this.stroke=1; - this.canvas=null; - this.workflow=null; - this.html=null; - this.graphics=null; - //this.id=UUID.create(); - this.startX=30; - this.startY=30; - this.endX=100; - this.endY=100; - this.zOrder=Line.ZOrderBaseIndex; - this.setSelectable(true); - this.setDeleteable(true); - this.arrowWidth=8; - this.arrowLength=20; - this.lineWidth=2; -}; - -ArrowLine.prototype=new Line(); -ArrowLine.prototype.type="ArrowLine"; -ArrowLine.prototype.paint=function(){ - if(this.graphics===null){ - this.graphics=new jsGraphics(this.id); - } - else{ - this.graphics.clear(); - } - //this.graphics.setStroke(this.stroke); - this.graphics.setStroke( Stroke.DOTTED ); - this.graphics.setColor(this.lineColor.getHTMLStyle()); - - var endY=this.getLength(); - var _3e2a=[0 ,0 ,endY ]; - var _3e2b=[-this.lineWidth,+this.lineWidth,-(this.lineWidth)]; - var _3e2c=this.getAngle()*Math.PI/180; - var rotX=[]; - var rotY=[]; - for(var i=0;i<_3e2a.length;i++){ - rotX[i]=this.startX+_3e2a[i]*Math.cos(_3e2c)-_3e2b[i]*Math.sin(_3e2c); - rotY[i]=this.startY+_3e2a[i]*Math.sin(_3e2c)+_3e2b[i]*Math.cos(_3e2c); - } - this.graphics.drawPolyLine(rotX,rotY); - this.graphics.paint(); -}; - -DottedConnection=function(){ -ArrowLine.call(this); -this.sourcePort=null; -this.targetPort=null; -this.lineSegments=[]; -this.setColor(new Color(0,0,115)); -this.setLineWidth(1); -}; -DottedConnection.prototype=new ArrowLine(); -DottedConnection.prototype.type="DottedConnection"; -DottedConnection.prototype.disconnect=function(){ -if(this.sourcePort!==null){ -this.sourcePort.detachMoveListener(this); -} -if(this.targetPort!==null){ -this.targetPort.detachMoveListener(this); -} -}; -DottedConnection.prototype.reconnect=function(){ -if(this.sourcePort!==null){ -this.sourcePort.attachMoveListener(this); -} -if(this.targetPort!==null){ -this.targetPort.attachMoveListener(this); -} -}; -DottedConnection.prototype.isConnector=function(){ -return true; -}; -DottedConnection.prototype.isResizeable=function(){ -return false; -}; -DottedConnection.prototype.setSource=function(port){ -if(this.sourcePort!==null){ -this.sourcePort.detachMoveListener(this); -} -this.sourcePort=port; -if(this.sourcePort===null){ -return; -} -this.sourcePort.attachMoveListener(this); -this.setStartPoint(port.getAbsoluteX(),port.getAbsoluteY()); -}; -DottedConnection.prototype.getSource=function(){ -return this.sourcePort; -}; -DottedConnection.prototype.setTarget=function(port){ -if(this.targetPort!==null){ -this.targetPort.detachMoveListener(this); -} -this.targetPort=port; -if(this.targetPort===null){ -return; -} -this.targetPort.attachMoveListener(this); -this.setEndPoint(port.getAbsoluteX(),port.getAbsoluteY()); -}; -DottedConnection.prototype.getTarget=function(){ -return this.targetPort; -}; -DottedConnection.prototype.onOtherFigureMoved=function(_3824){ -if(_3824==this.sourcePort){ -this.setStartPoint(this.sourcePort.getAbsoluteX(),this.sourcePort.getAbsoluteY()); -}else{ -this.setEndPoint(this.targetPort.getAbsoluteX(),this.targetPort.getAbsoluteY()); -} -}; - - - -bpmnAnnotation = function (oWorkflow) { - VectorFigure.call(this); - //Getting width and height from DB - if(typeof oWorkflow.anno_width != 'undefined' && typeof oWorkflow.anno_height != 'undefined'){ - this.width = oWorkflow.anno_width; - this.height = oWorkflow.anno_height; - } - else{ - this.width = 110; - this.height = 50; - } - this.setAnnotationName(oWorkflow.annotationName); //It will set the Default Task Name with appropriate count While dragging a task on the canvas -}; - -bpmnAnnotation.prototype = new VectorFigure; -bpmnAnnotation.prototype.type = "bpmnAnnotation"; -bpmnAnnotation.prototype.setAnnotationName = function (name) { - if(typeof name != 'undefined') - this.annotationName = name; - else - this.annotationName = 'Annotation 1'; -}; - -bpmnAnnotation.prototype.coord_converter = function (bound_width, bound_height, text_length) { - //bound_width = this.workflow.currentSelection.width; - //bound_height = this.workflow.currentSelection.height; - input_width = text_length * 6 - input_height = 10 - - temp_width = bound_width - input_width; - temp_width /= 2; - temp_x = temp_width; - - temp_height = bound_height - 10; - temp_height /= 2; - temp_y = temp_height; - - var temp_coord = new Object(); - temp_coord.temp_x = temp_x; - temp_coord.temp_y = temp_y; - return temp_coord; -}; - - - -bpmnAnnotation.prototype.paint = function () { - VectorFigure.prototype.paint.call(this); - - if(typeof workflow.zoomfactor == 'undefined') - workflow.zoomfactor = 1; - - //Set the Task Limitation - if(typeof this.limitFlag == 'undefined' || this.limitFlag == false) - { - this.originalWidth = 110; - this.originalHeight = 50; - this.orgXPos = this.getX(); - this.orgYPos = this.getY(); - this.orgFontSize =this.fontSize; - } - var zoomRate = workflow.zoomfactor; - - this.width = this.originalWidth * workflow.zoomfactor; - this.height = this.originalHeight * workflow.zoomfactor; - - //this.graphics.setColor("#ffffff"); - this.graphics.setColor("#f8f8f8"); - this.graphics.fillRect(0,0, this.getWidth(), this.getHeight()); - this.graphics.setStroke(1.5); - this.graphics.setColor("#202020"); - this.graphics.drawLine(this.getWidth()/4,0,0,0); - this.graphics.drawLine(0,0,0,this.getHeight()); - this.graphics.drawLine(0,this.getHeight(),this.getWidth()/4,this.getHeight()); - this.graphics.setStroke(1); - this.graphics.paint(); - - /* New object is created to implement changing of Text functionality - */ - this.bpmnText = new jsGraphics(this.id) ; - this.padleft = 0.05*this.getWidth(); - this.padtop = 0.13*this.getHeight() -1; - this.rectwidth = this.getWidth() - this.padleft; - this.rectheight = this.getHeight() - 2 * this.padtop; - - //Setting text size to zoom font size if Zoomed - this.fontSize = 11; - var fontSize = zoomRate * this.fontSize; - this.bpmnText.setFont('verdana', + fontSize+'px', Font.PLAIN); - - this.bpmnText.drawStringAnno(this.annotationName,0,this.padtop,this.rectwidth,this.rectheight,'left'); - this.bpmnText.paint(); - - if( this.input1!=null ){ - this.input1.setPosition(0,this.height/2); - } -}; - - jsGraphics.prototype.drawStringAnno = function(txt, x, y, width,height, halign) - { - this.htm += '
'+ - txt + - '<\/div>'; - }; - -bpmnAnnotation.prototype.setWorkflow=function(_40c5){ - VectorFigure.prototype.setWorkflow.call(this,_40c5); - if(_40c5!=null){ - this.input1=new InputPort(); - this.input1.setWorkflow(_40c5); - this.input1.setName('input1'); - this.input1.setZOrder(-1); - this.input1.setBackgroundColor(new Color(255, 255, 255)); - this.input1.setColor(new Color(255, 255, 255)); - //this.addPort(this.input1,0,this.height/2); - this.addPort(this.input1,-this.getWidth()/2,-this.getHeight()/4); - }; -}; - -bpmnAnnotationDialog = function (_2e5e) { - this.figure = _2e5e; - var title = 'Annotation'; - Dialog.call(this, title); - this.setDimension(400, 150); //Set the width and height of the Dialog box -} - -bpmnAnnotationDialog.prototype = new Dialog(); -bpmnAnnotationDialog.prototype.createHTMLElement = function () { - var item = Dialog.prototype.createHTMLElement.call(this); - var inputDiv = document.createElement("form"); - inputDiv.style.position = "absolute"; - inputDiv.style.left = "10px"; - inputDiv.style.top = "30px"; - inputDiv.style.width = "375px"; - inputDiv.style.font = "normal 10px verdana"; - item.appendChild(inputDiv); - this.label = document.createTextNode("Annotation Name"); - inputDiv.appendChild(this.label); - this.input = document.createElement("textarea"); - this.input.style.border = "1px solid gray"; - this.input.style.font = "normal 10px verdana"; - //this.input.type = "text"; - this.input.maxLength = "500"; - this.input.cols = "50"; - this.input.rows = "3"; - var value = bpmnTask.prototype.trim(this.figure.workflow.currentSelection.annotationName); - if (value) this.input.value = value; - else this.input.value = ""; - this.input.style.width = "100%"; - inputDiv.appendChild(this.input); - this.input.focus(); - return item; -}; - -/*Double Click Event for opening the dialog Box*/ -bpmnAnnotation.prototype.onDoubleClick = function () { - var _409d = new bpmnAnnotationDialog(this); - this.workflow.showDialog(_409d, this.workflow.currentSelection.x, this.workflow.currentSelection.y); -}; - - -/** - * This method will be called if the user pressed the OK button in buttonbar of the dialog.
- * The string is first cleared and new string is painted.

- **/ - bpmnAnnotationDialog.prototype.onOk = function () { - this.figure.bpmnText.clear(); - - len = Math.ceil(this.input.value.length/16); - if(this.input.value.length < 19) - { - len = 1.5; - if(this.input.value.length > 9) - this.figure.rectWidth = this.input.value.length*8; - else - this.figure.rectWidth = 48; - } - else - this.figure.rectWidth = 150; - //tempcoord = this.workflow.currentSelection.coord_converter(this.workflow.currentSelection.width, this.workflow.currentSelection.height, this.input.value.length) - this.figure.bpmnText.drawStringAnno(this.input.value,20,20,this.figure.rectWidth,'left'); - // this.figure.bpmnNewText.drawTextString(this.input.value, this.workflow.currentSelection.width, this.workflow.currentSelection.height, tempcoord.temp_x, tempcoord.temp_y); - this.figure.bpmnText.paint(); - this.figure.annotationName = this.input.value; //Set Updated Text value - - //Updating Annotation Text Async into the DB - this.figure.actiontype = 'updateText'; - this.workflow.saveShape(this.figure); - - if(this.figure.rectWidth<80) - tempW = 110; - else - tempW = this.figure.rectWidth+35; - this.workflow.currentSelection.setDimension(tempW, len*13+40); - - this.workflow.removeFigure(this); -}; diff --git a/workflow/engine/templates/bpmn/Dataobject.js b/workflow/engine/templates/bpmn/Dataobject.js deleted file mode 100755 index 375e499d5..000000000 --- a/workflow/engine/templates/bpmn/Dataobject.js +++ /dev/null @@ -1,33 +0,0 @@ -bpmnDataobject = function (_30ab) { - VectorFigure.call(this); - this.setDimension(50, 80); - this.setTaskName(_30ab.taskNo); //It will set the Default Task Name with appropriate count While dragging a task on the canvas -}; - -bpmnDataobject.prototype = new VectorFigure; -bpmnDataobject.prototype.type = "bpmnDataobject"; -bpmnDataobject.prototype.setTaskName = function (name) { - this.taskName = 'Data Object ' + name; -}; - -bpmnDataobject.prototype.paint = function () { - VectorFigure.prototype.paint.call(this); - var x = new Array(0, this.getWidth()-10, this.getWidth(), this.getWidth()-10, this.getWidth()-10, this.getWidth(), this.getWidth(), 0); - var y = new Array(0, 0, 10, 10, 0, 10, this.getHeight(), this.getHeight()); - - this.graphics.setStroke(this.stroke); - this.graphics.setColor("#c0c0c0"); - this.graphics.fillPolygon(x, y); - - for (var i = 0; i < x.length; i++) { - x[i] = x[i] - 3; - y[i] = y[i] - 3; - } - this.graphics.setColor("#ffffff"); - this.graphics.fillPolygon(x, y); - this.graphics.setColor("#ff0f0f"); - this.graphics.drawPolygon(x, y); - this.graphics.paint(); - this.x_text = this.workflow.getAbsoluteX(); //Get x co-ordinate from figure - this.y_text = this.workflow.getAbsoluteY(); //Get x co-ordinate from figure -} diff --git a/workflow/engine/templates/bpmn/EventBoundaryTimerInter.js b/workflow/engine/templates/bpmn/EventBoundaryTimerInter.js deleted file mode 100755 index 68ba991f8..000000000 --- a/workflow/engine/templates/bpmn/EventBoundaryTimerInter.js +++ /dev/null @@ -1,88 +0,0 @@ -bpmnEventBoundaryInter=function(){ -VectorFigure.call(this); -//Setting width and height values as per the zoom ratio -if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined') - this.setDimension(workflow.zoomWidth, workflow.zoomHeight); -else - this.setDimension(30,30); -this.stroke = 2; -}; -bpmnEventBoundaryInter.prototype=new VectorFigure; -bpmnEventBoundaryInter.prototype.type="bpmnEventBoundaryTimerInter"; -bpmnEventBoundaryInter.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); -var x_cir1=0; -var y_cir1=0; - -this.graphics.setColor("#c0c0c0"); -this.graphics.fillEllipse(x_cir1+3,y_cir1+3,this.getWidth(),this.getHeight()); - -this.graphics.setStroke(this.stroke); -this.graphics.setColor( "#f9faf2" ); -this.graphics.fillEllipse(x_cir1,y_cir1,this.getWidth(),this.getHeight()); -this.graphics.setColor("#adae5e"); -this.graphics.drawEllipse(x_cir1,y_cir1,this.getWidth(),this.getHeight()); -var x_cir2=3; -var y_cir2=3; -this.graphics.setColor( "#f9faf2" ); -this.graphics.fillEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6); -this.graphics.setColor("#adae5e"); -this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6); - -this.graphics.setColor("#adae5e"); -//this.graphics.drawEllipse(x_cir3,y_cir3,this.getWidth()-20,this.getHeight()-20); -this.graphics.drawLine(this.getWidth()/2.2,this.getHeight()/2,this.getWidth()/1.6,this.getHeight()/2); //horizontal line -this.graphics.drawLine(this.getWidth()/2.2,this.getHeight()/2,this.getWidth()/2.2,this.getHeight()/3.7); //vertical line - -this.graphics.drawLine(24,8,20,11); //10th min line -this.graphics.drawLine(22,15,25,15); //15th min line -this.graphics.drawLine(24,22,19,20); //25th min line -this.graphics.drawLine(15,22,15,25); //30th min line -this.graphics.drawLine(8,22,12,19); //40th min line -this.graphics.drawLine(5,15,8,15); //45th min line -this.graphics.drawLine(8,8,11,11); //50th min line -this.graphics.drawLine(15,5,15,8); //60th min line - -this.graphics.paint(); - -/*Code Added to Dynamically shift Ports on resizing of shapes - **/ -if(this.input1!=null){ -this.input1.setPosition(0,this.height/2); -} -if(this.output1!=null){ -this.output1.setPosition(this.width/2,this.height); -} -if(this.input2!=null){ -this.input2.setPosition(this.width/2,0); -} -if(this.output2!=null){ -this.output2.setPosition(this.width,this.height/2); -} -}; - -bpmnEventBoundaryInter.prototype.setWorkflow=function(_40c5){ -VectorFigure.prototype.setWorkflow.call(this,_40c5); -if(_40c5!=null){ - var eventPortName = ['input2','output2']; - var eventPortType = ['InputPort','OutputPort']; - var eventPositionX= [this.width/2,this.width/2]; - var eventPositionY= [0,this.height]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } -} -}; - -bpmnEventBoundaryInter.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; diff --git a/workflow/engine/templates/bpmn/EventCancelEnd.js b/workflow/engine/templates/bpmn/EventCancelEnd.js deleted file mode 100755 index 014a07236..000000000 --- a/workflow/engine/templates/bpmn/EventCancelEnd.js +++ /dev/null @@ -1,80 +0,0 @@ -bpmnEventCancelEnd=function(){ -VectorFigure.call(this); -//Setting width and height values as per the zoom ratio -if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined') - this.setDimension(workflow.zoomWidth, workflow.zoomHeight); -else - this.setDimension(30,30); -this.stroke=3; -}; -bpmnEventCancelEnd.prototype=new VectorFigure; -bpmnEventCancelEnd.prototype.type="bpmnEventCancelEnd"; -bpmnEventCancelEnd.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); - //Set the Task Limitation - if (this.getWidth() < 30 || this.getHeight() < 30) { - this.setDimension(30, 30); - } - -this.graphics.setStroke(this.stroke); -var x_cir = 0; -var y_cir = 0; - -this.graphics.setColor("#c0c0c0"); -this.graphics.fillEllipse(x_cir+5,y_cir+5,this.getWidth(),this.getHeight()); -this.graphics.setColor("#f7f1e5"); -this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); -this.graphics.setColor("#c46508"); -this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); -this.graphics.setStroke(2); -//var x=new Array(16,23,31,36,29,37,32,23,16,11,18,11); -//var y=new Array(35,27,33,29,22,14,9,16,9,14,22,29); -var x=new Array(this.getWidth()/2.8,this.getWidth()/1.95,this.getWidth()/1.45,this.getWidth()/1.25,this.getWidth()/1.55,this.getWidth()/1.21,this.getWidth()/1.4,this.getWidth()/1.95,this.getWidth()/2.8,this.getWidth()/4.1,this.getWidth()/2.5,this.getWidth()/4.1); -var y=new Array(this.getHeight()/1.28,this.getHeight()/1.66,this.getHeight()/1.36,this.getHeight()/1.55,this.getHeight()/2.04,this.getHeight()/3.21,this.getHeight()/5.6,this.getHeight()/2.81,this.getHeight()/5.6,this.getHeight()/3.21,this.getHeight()/2.04,this.getHeight()/1.55); -this.graphics.setColor("#c46508"); -this.graphics.fillPolygon(x,y); -this.graphics.setColor("#c46508"); -//this.graphics.drawPolygon(x,y); -this.graphics.paint(); - -/*Code Added to Dynamically shift Ports on resizing of shapes - **/ -if(this.input1!=null){ -this.input1.setPosition(0,this.height/2); -} -if(this.output1!=null){ -this.output1.setPosition(this.width/2,this.height); -} -if(this.input2!=null){ -this.input2.setPosition(this.width/2,0); -} -if(this.output2!=null){ -this.output2.setPosition(this.width,this.height/2); -} -}; - -bpmnEventCancelEnd.prototype.setWorkflow=function(_40c5){ -VectorFigure.prototype.setWorkflow.call(this,_40c5); -if(_40c5!=null){ - var eventPortName = ['input1','input2']; - var eventPortType = ['InputPort','InputPort']; - var eventPositionX= [this.width/2,0]; - var eventPositionY= [0,this.height/2]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } -} -}; - -bpmnEventCancelEnd.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; diff --git a/workflow/engine/templates/bpmn/EventCancelInter.js b/workflow/engine/templates/bpmn/EventCancelInter.js deleted file mode 100755 index 7c5bc20e5..000000000 --- a/workflow/engine/templates/bpmn/EventCancelInter.js +++ /dev/null @@ -1,49 +0,0 @@ -bpmnEventCancelInter=function(){ -VectorFigure.call(this); -this.stroke=1; -}; -bpmnEventCancelInter.prototype=new VectorFigure; -bpmnEventCancelInter.prototype.type="bpmnEventCancelInter"; -bpmnEventCancelInter.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); - -if(typeof workflow.zoomfactor == 'undefined') - workflow.zoomfactor = 1; - //Set the Task Limitation -if(typeof this.limitFlag == 'undefined' || this.limitFlag == false) -{ - this.originalWidth = 30; - this.originalHeight = 30; - this.orgXPos = this.getX(); - this.orgYPos = this.getY(); - this.orgFontSize =this.fontSize; -} - -this.width = this.originalWidth * workflow.zoomfactor; -this.height = this.originalHeight * workflow.zoomfactor; - -this.graphics.setStroke(this.stroke); -var x_cir = 0; -var y_cir = 0; -this.graphics.setColor("#000000"); -this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); -var x_cir2=5; -var y_cir2=5; -this.graphics.setColor("#000000"); -this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-10,this.getHeight()-10); -//var x=new Array(16,23,31,36,29,37,32,23,16,11,18,11); -//var y=new Array(35,27,33,29,22,14,9,16,9,14,22,29); -var cw = this.getWidth(); -var ch = this.getHeight(); -var x=new Array(cw*0.35,cw*0.51,cw*0.68,cw*0.8,cw*0.64,cw*0.82,cw*0.71,cw*0.51,cw*0.35,cw*0.24,cw*0.4,cw*0.24); -var y=new Array(ch*0.78,ch*0.6,ch*0.73,ch*0.64,ch*0.49,ch*0.31,ch*0.17,ch*0.35,ch*0.17,ch*0.31,ch*0.49,ch*0.64); -//var x=new Array(cw/2.8,cw/1.95,cw/1.45,cw/1.25,cw/1.55,cw/1.21,cw/1.4,cw/1.95,cw/2.8,cw/4.1,cw/2.5,cw/4.1); -//var y=new Array(ch/1.28,ch/1.66,ch/1.36,ch/1.55,ch/2.04,ch/3.21,ch/5.6,ch/2.81,ch/5.6,ch/3.21,ch/2.04,ch/1.55); -this.graphics.setColor("#ffffff"); -this.graphics.fillPolygon(x,y); -this.graphics.setColor("#000000"); -this.graphics.drawPolygon(x,y); -this.graphics.paint(); -}; - - diff --git a/workflow/engine/templates/bpmn/EventCompEnd.js b/workflow/engine/templates/bpmn/EventCompEnd.js deleted file mode 100755 index 86bda85f3..000000000 --- a/workflow/engine/templates/bpmn/EventCompEnd.js +++ /dev/null @@ -1,74 +0,0 @@ -bpmnEventCompEnd=function(){ -VectorFigure.call(this); -//Setting width and height values as per the zoom ratio -if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined') - this.setDimension(workflow.zoomWidth, workflow.zoomHeight); -else - this.setDimension(30,30); -this.stroke=3 -}; -bpmnEventCompEnd.prototype=new VectorFigure; -bpmnEventCompEnd.prototype.type="bpmnEventCompEnd"; -bpmnEventCompEnd.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); -this.graphics.setStroke(this.stroke); -var x_cir = 0; -var y_cir = 0; - -this.graphics.setColor("#c0c0c0"); -this.graphics.fillEllipse(x_cir+5,y_cir+5,this.getWidth(),this.getHeight()); -this.graphics.setColor("#f7f1e5"); -this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); -this.graphics.setColor("#c46508"); -this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); -//var x_arrow=new Array(6,19,19,32,32,19,19); -//var y_arrow=new Array(22,33,22,33,11,22,11); -var x_arrow=new Array(this.getWidth()/7,this.getWidth()/2.36,this.getWidth()/2.36,this.getWidth()/1.4,this.getWidth()/1.42,this.getWidth()/2.36,this.getWidth()/2.36); -var y_arrow=new Array(this.getHeight()/2,this.getHeight()/1.36,this.getHeight()/2,this.getHeight()/1.36,this.getHeight()/4,this.getHeight()/2,this.getHeight()/4); -this.graphics.setColor( "#c46508" ); -this.graphics.fillPolygon(x_arrow,y_arrow); -this.graphics.setColor("#c46508"); -//this.graphics.drawPolygon(x_arrow,y_arrow); -this.graphics.paint();/*Code Added to Dynamically shift Ports on resizing of shapes - **/ -if(this.input1!=null){ -this.input1.setPosition(0,this.height/2); -} -if(this.output1!=null){ -this.output1.setPosition(this.width/2,this.height); -} -if(this.input2!=null){ -this.input2.setPosition(this.width/2,0); -} -if(this.output2!=null){ -this.output2.setPosition(this.width,this.height/2); -} -}; - -bpmnEventCompEnd.prototype.setWorkflow=function(_40c5){ -VectorFigure.prototype.setWorkflow.call(this,_40c5); -if(_40c5!=null){ - var eventPortName = ['input1','input2']; - var eventPortType = ['InputPort','InputPort']; - var eventPositionX= [this.width/2,0]; - var eventPositionY= [0,this.height/2]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } -} -}; - - - -bpmnEventCompEnd.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; diff --git a/workflow/engine/templates/bpmn/EventCompInter.js b/workflow/engine/templates/bpmn/EventCompInter.js deleted file mode 100755 index 5f0f9b3ae..000000000 --- a/workflow/engine/templates/bpmn/EventCompInter.js +++ /dev/null @@ -1,121 +0,0 @@ -bpmnEventCompInter=function(){ -VectorFigure.call(this); -this.stroke=1 -}; -bpmnEventCompInter.prototype=new VectorFigure; -bpmnEventCompInter.prototype.type="bpmnEventCompInter"; -bpmnEventCompInter.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); - -if(typeof workflow.zoomfactor == 'undefined') - workflow.zoomfactor = 1; - //Set the Task Limitation -if(typeof this.limitFlag == 'undefined' || this.limitFlag == false) -{ - this.originalWidth = 30; - this.originalHeight = 30; - this.orgXPos = this.getX(); - this.orgYPos = this.getY(); - this.orgFontSize =this.fontSize; -} - -this.width = this.originalWidth * workflow.zoomfactor; -this.height = this.originalHeight * workflow.zoomfactor; - -this.graphics.setStroke(this.stroke); -var x_cir =0; -var y_cir =0; - -this.graphics.setColor("#c0c0c0"); -this.graphics.fillEllipse(x_cir+3,y_cir+3,this.getWidth(),this.getHeight()); - -this.graphics.setColor("#f9faf2") -this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()) -this.graphics.setColor("#adae5e"); -this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); - -var x_cir2=3; -var y_cir2=3; -this.graphics.setColor("#adae5e"); -this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6); -//var x_arrow=new Array(6,19,19,32,32,19,19); -//var y_arrow=new Array(22,33,22,33,11,22,11); -var cw = this.getWidth(); -var ch = this.getHeight(); -var x_arrow=new Array(cw*0.13,cw*0.42,cw*0.42,cw*0.71,cw*0.7,cw*0.42,cw*0.42); -var y_arrow=new Array(ch*0.5,ch*0.73,ch*0.5,ch*0.73,ch*0.25,ch*0.5,ch*0.25); -//var x_arrow=new Array(cw/7.5,cw/2.36,cw/2.36,cw/1.4,cw/1.42,cw/2.36,cw/2.36); -//var y_arrow=new Array(ch/2,ch/1.36,ch/2,ch/1.36,ch/4,ch/2,ch/4); -this.graphics.setColor( "#adae5e" ); -this.graphics.fillPolygon(x_arrow,y_arrow); -this.graphics.setColor("#adae5e"); -this.graphics.drawPolygon(x_arrow,y_arrow); -this.graphics.paint(); - -/*Code Added to Dynamically shift Ports on resizing of shapes - **/ -if(this.input1!=null){ -this.input1.setPosition(0,this.height/2); -} -if(this.output1!=null){ -this.output1.setPosition(this.width/2,this.height); -} -if(this.input2!=null){ -this.input2.setPosition(this.width/2,0); -} -if(this.output2!=null){ -this.output2.setPosition(this.width,this.height/2); -} -}; - -bpmnEventCompInter.prototype.setWorkflow=function(_40c5){ -VectorFigure.prototype.setWorkflow.call(this,_40c5); -if(_40c5!=null){ - - var eventPortName = ['input1','input2','output1','output2']; - var eventPortType = ['InputPort','InputPort','OutputPort','OutputPort']; - var eventPositionX= [0,this.width/2,this.width,this.width/2]; - var eventPositionY= [this.height/2,0,this.height/2,this.height]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } -/* -this.output1=new OutputPort(); -this.output1.setWorkflow(_40c5); -this.output1.setName("output1"); -this.output1.setBackgroundColor(new Color(115, 115, 245)); -this.addPort(this.output1,this.width/2,this.height); - -this.output2=new OutputPort(); -this.output2.setWorkflow(_40c5); -this.output2.setName("output2"); -this.output2.setBackgroundColor(new Color(115, 115, 245)); -this.addPort(this.output2,this.width,this.height/2); - -this.input1=new InputPort(); -this.input1.setWorkflow(_40c5); -this.input1.setName("input1"); -this.input1.setBackgroundColor(new Color(245,115,115)); -this.addPort(this.input1,0,this.height/2); - -this.input2=new InputPort(); -this.input2.setWorkflow(_40c5); -this.input2.setName("input2"); -this.input2.setBackgroundColor(new Color(245,115,115)); -this.addPort(this.input2,this.width/2,0);*/ -} -}; - -bpmnEventCompInter.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; - diff --git a/workflow/engine/templates/bpmn/EventEmptyEnd.js b/workflow/engine/templates/bpmn/EventEmptyEnd.js deleted file mode 100755 index 832aebb81..000000000 --- a/workflow/engine/templates/bpmn/EventEmptyEnd.js +++ /dev/null @@ -1,89 +0,0 @@ -bpmnEventEmptyEnd=function(){ -VectorFigure.call(this); -this.stroke=2; -}; -bpmnEventEmptyEnd.prototype=new VectorFigure; -bpmnEventEmptyEnd.prototype.type="bpmnEventEmptyEnd"; -bpmnEventEmptyEnd.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); -if(typeof workflow.zoomfactor == 'undefined') - workflow.zoomfactor = 1; - //Set the Task Limitation -if(typeof this.limitFlag == 'undefined' || this.limitFlag == false) -{ - this.originalWidth = 30; - this.originalHeight = 30; - this.orgXPos = this.getX(); - this.orgYPos = this.getY(); - this.orgFontSize =this.fontSize; -} - -this.width = this.originalWidth * workflow.zoomfactor; -this.height = this.originalHeight * workflow.zoomfactor; - -var x=0; -var y=0; -this.graphics.setColor("#c0c0c0"); -this.graphics.fillEllipse(x+5,y+5,this.getWidth(),this.getHeight()); -this.graphics.setStroke(this.stroke); -this.graphics.setColor( "#f5d4d4" ); -this.graphics.fillEllipse(x,y,this.getWidth(),this.getHeight()); -this.graphics.setColor("#a23838"); -this.graphics.drawEllipse(x,y,this.getWidth(),this.getHeight()); -this.graphics.paint(); - -/*Code Added to Dynamically shift Ports on resizing of shapes - **/ -if(this.input1!=null){ -this.input1.setPosition(0,this.height/2); -} -if(this.output1!=null){ -this.output1.setPosition(this.width/2,this.height); -} -if(this.input2!=null){ -this.input2.setPosition(this.width/2,0); -} -if(this.output2!=null){ -this.output2.setPosition(this.width,this.height/2); -} -}; - -bpmnEventEmptyEnd.prototype.setWorkflow=function(_40c5){ -VectorFigure.prototype.setWorkflow.call(this,_40c5); -if(_40c5!=null){ - - var eventPortName = ['input1','input2']; - var eventPortType = ['InputPort','InputPort']; - var eventPositionX= [this.width/2,0]; - var eventPositionY= [0,this.height/2]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } - /* -this.input1=new InputPort(); -this.input1.setWorkflow(_40c5); -this.input1.setName("input1"); -this.input1.setBackgroundColor(new Color(245,115,115)); -this.addPort(this.input1,this.width/2,0); - -this.input2=new InputPort(); -this.input2.setWorkflow(_40c5); -this.input2.setName("input2"); -this.input2.setBackgroundColor(new Color(245,115,115)); -this.addPort(this.input2,0,this.height/2);*/ -} -}; - - -bpmnEventEmptyEnd.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; diff --git a/workflow/engine/templates/bpmn/EventEmptyInter.js b/workflow/engine/templates/bpmn/EventEmptyInter.js deleted file mode 100755 index 917346cb5..000000000 --- a/workflow/engine/templates/bpmn/EventEmptyInter.js +++ /dev/null @@ -1,91 +0,0 @@ -bpmnEventEmptyInter=function(width,_30ab){ -VectorFigure.call(this); -this.stroke=1; -}; -bpmnEventEmptyInter.prototype=new VectorFigure; -bpmnEventEmptyInter.prototype.type="bpmnEventEmptyInter"; -bpmnEventEmptyInter.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); -if(typeof workflow.zoomfactor == 'undefined') - workflow.zoomfactor = 1; - //Set the Task Limitation -if(typeof this.limitFlag == 'undefined' || this.limitFlag == false) -{ - this.originalWidth = 30; - this.originalHeight = 30; - this.orgXPos = this.getX(); - this.orgYPos = this.getY(); - this.orgFontSize =this.fontSize; -} -this.width = this.originalWidth * workflow.zoomfactor; -this.height = this.originalHeight * workflow.zoomfactor; - -this.graphics.setStroke(this.stroke); -var x_cir1 = 0; -var y_cir1 = 0; - -this.graphics.setColor("#c0c0c0"); -this.graphics.fillEllipse(x_cir1+3,y_cir1+3,this.getWidth(),this.getHeight()); - -this.graphics.setColor( "#f9faf2" ); -this.graphics.fillEllipse(x_cir1,y_cir1,this.getWidth(),this.getHeight()); - -this.graphics.setColor("#adae5e"); -this.graphics.drawEllipse(x_cir1,y_cir1,this.getWidth(),this.getHeight()); -this.graphics.setStroke(this.stroke); -var x_cir2=3; -var y_cir2=3; - -this.graphics.setColor( "#f9faf2" ); -this.graphics.fillEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6); - -this.graphics.setColor("#adae5e"); -//this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6); -var cw = this.getWidth(); -var ch = this.getHeight(); -this.graphics.drawEllipse(cw*0.15, ch*0.15, ch*0.7, ch*0.7); - -this.graphics.paint(); - -/*Code Added to Dynamically shift Ports on resizing of shapes - **/ -if(this.input1!=null){ -this.input1.setPosition(0,this.height/2); -} -if(this.output1!=null){ -this.output1.setPosition(this.width/2,this.height); -} -if(this.input2!=null){ -this.input2.setPosition(this.width/2,0); -} -if(this.output2!=null){ -this.output2.setPosition(this.width,this.height/2); -} -}; - -bpmnEventEmptyInter.prototype.setWorkflow=function(_40c5){ -VectorFigure.prototype.setWorkflow.call(this,_40c5); -if(_40c5!=null){ - var eventPortName = ['input1','input2','output1','output2']; - var eventPortType = ['InputPort','InputPort','OutputPort','OutputPort']; - var eventPositionX= [0,this.width/2,this.width,this.width/2]; - var eventPositionY= [this.height/2,0,this.height/2,this.height]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } -} -}; - -bpmnEventEmptyInter.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; - diff --git a/workflow/engine/templates/bpmn/EventEmptyStart.js b/workflow/engine/templates/bpmn/EventEmptyStart.js deleted file mode 100755 index 608c461ea..000000000 --- a/workflow/engine/templates/bpmn/EventEmptyStart.js +++ /dev/null @@ -1,76 +0,0 @@ -bpmnEventEmptyStart=function(){ - VectorFigure.call(this); -}; - -bpmnEventEmptyStart.prototype=new VectorFigure; -bpmnEventEmptyStart.prototype.type="bpmnEventEmptyStart"; -bpmnEventEmptyStart.prototype.paint=function() { - VectorFigure.prototype.paint.call(this); - if(typeof workflow.zoomfactor == 'undefined') - workflow.zoomfactor = 1; - - //Set the Limitation - if(typeof this.limitFlag == 'undefined' || this.limitFlag == false) { - this.originalWidth = 30; - this.originalHeight = 30; - this.orgXPos = this.getX(); - this.orgYPos = this.getY(); - this.orgFontSize =this.fontSize; - } - this.width = this.originalWidth * workflow.zoomfactor; - this.height = this.originalHeight * workflow.zoomfactor; - - var x_cir = 0; - var y_cir = 0; - - //draw the circle - this.graphics.setColor("#d0d0d0"); - this.graphics.fillEllipse(x_cir+2,y_cir+2,this.getWidth(),this.getHeight()); - this.graphics.setColor( "#F6FFDA" ); - this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); - this.graphics.setStroke(1); - this.graphics.setColor("#97C759"); - this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); - this.graphics.setStroke(1); - this.graphics.setColor("#98C951"); - this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); - - - this.graphics.paint(); - - - //Code Added to Dynamically shift Ports on resizing of shapes - if(this.output1!=null) { - this.output1.setPosition(this.width/2,this.height); - } - if(this.output2!=null){ - this.output2.setPosition(this.width,this.height/2); - } -}; - -bpmnEventEmptyStart.prototype.setWorkflow=function(_40c5){ -VectorFigure.prototype.setWorkflow.call(this,_40c5); -if(_40c5!=null){ - var eventPortName = ['output1','output2']; - var eventPortType = ['OutputPort','OutputPort']; - var eventPositionX= [this.width/2,this.width]; - var eventPositionY= [this.height,this.height/2]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } -} -}; - -bpmnEventEmptyStart.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; - diff --git a/workflow/engine/templates/bpmn/EventEndSignal.js b/workflow/engine/templates/bpmn/EventEndSignal.js deleted file mode 100755 index db69dccae..000000000 --- a/workflow/engine/templates/bpmn/EventEndSignal.js +++ /dev/null @@ -1,74 +0,0 @@ -bpmnEventEndSignal=function(){ -VectorFigure.call(this); -//Setting width and height values as per the zoom ratio -if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined') - this.setDimension(workflow.zoomWidth, workflow.zoomHeight); -else - this.setDimension(30,30); -this.stroke=2; -}; -bpmnEventEndSignal.prototype=new VectorFigure; -bpmnEventEndSignal.prototype.type="bpmnEventEndSignal"; -bpmnEventEndSignal.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); -var x=0; -var y=0; - -this.graphics.setColor("#c0c0c0"); -this.graphics.fillEllipse(x+5,y+5,this.getWidth(),this.getHeight()); -this.graphics.setStroke(this.stroke); -this.graphics.setColor( "#f7f1e5" ); -this.graphics.fillEllipse(x,y,this.getWidth(),this.getHeight()); -this.graphics.setColor("#c46508"); -this.graphics.drawEllipse(x,y,this.getWidth(),this.getHeight()); -//var x=new Array(5,41,23); -//var y=new Array(35,35,0); -var x=new Array(5,this.getWidth()-4,this.getWidth()/2); -var y=new Array(this.getHeight()-10,this.getHeight()-10,2); -this.graphics.setColor("#c46508"); -this.graphics.fillPolygon(x,y); -this.graphics.setColor("#000000"); -//this.graphics.drawPolygon(x,y); -this.graphics.paint(); - -/*Code Added to Dynamically shift Ports on resizing of shapes - **/ -if(this.input1!=null){ -this.input1.setPosition(0,this.height/2); -} -if(this.output1!=null){ -this.output1.setPosition(this.width/2,this.height); -} -if(this.input2!=null){ -this.input2.setPosition(this.width/2,0); -} -if(this.output2!=null){ -this.output2.setPosition(this.width,this.height/2); -} -}; - -bpmnEventEndSignal.prototype.setWorkflow=function(_40c5){ -VectorFigure.prototype.setWorkflow.call(this,_40c5); -if(_40c5!=null){ - var eventPortName = ['input1','input2']; - var eventPortType = ['InputPort','InputPort']; - var eventPositionX= [this.width/2,0]; - var eventPositionY= [0,this.height/2]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } -} -}; - -bpmnEventEndSignal.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; diff --git a/workflow/engine/templates/bpmn/EventErrorEnd.js b/workflow/engine/templates/bpmn/EventErrorEnd.js deleted file mode 100755 index 1269f803d..000000000 --- a/workflow/engine/templates/bpmn/EventErrorEnd.js +++ /dev/null @@ -1,77 +0,0 @@ -bpmnEventErrorEnd=function(){ -VectorFigure.call(this); -//Setting width and height values as per the zoom ratio -if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined') - this.setDimension(workflow.zoomWidth, workflow.zoomHeight); -else - this.setDimension(30,30); -this.stroke=4; -}; -bpmnEventErrorEnd.prototype=new VectorFigure; -bpmnEventErrorEnd.prototype.type="bpmnEventErrorEnd"; -bpmnEventErrorEnd.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); -this.graphics.setStroke(this.stroke); -var x_cir = 0; -var y_cir = 0; - -this.graphics.setColor("#c0c0c0"); -this.graphics.fillEllipse(x_cir+5,y_cir+5,this.getWidth(),this.getHeight()); - -this.graphics.setColor("#f7f1e5"); -this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); -this.graphics.setColor("#c46508"); -this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); -//var x=new Array(7,17,24,34,24,17); -//var y=new Array(33,23,33,13,26,16); -var x=new Array(this.getWidth()/6.4,this.getWidth()/2.6,this.getWidth()/1.87,this.getWidth()/1.32,this.getWidth()/1.87,this.getWidth()/2.6); -var y=new Array(this.getHeight()/1.36,this.getHeight()/1.95,this.getHeight()/1.36,this.getHeight()/3.46,this.getHeight()/1.73,this.getHeight()/2.8); -this.graphics.setStroke(2); -this.graphics.setColor("#c46508"); -this.graphics.fillPolygon(x,y); -this.graphics.setColor("#c46508"); -this.graphics.drawPolygon(x,y); -this.graphics.paint(); - -/*Code Added to Dynamically shift Ports on resizing of shapes - **/ -if(this.input1!=null){ -this.input1.setPosition(0,this.height/2); -} -if(this.output1!=null){ -this.output1.setPosition(this.width/2,this.height); -} -if(this.input2!=null){ -this.input2.setPosition(this.width/2,0); -} -if(this.output2!=null){ -this.output2.setPosition(this.width,this.height/2); -} -}; - -bpmnEventErrorEnd.prototype.setWorkflow=function(_40c5){ -VectorFigure.prototype.setWorkflow.call(this,_40c5); -if(_40c5!=null){ - var eventPortName = ['input1','input2']; - var eventPortType = ['InputPort','InputPort']; - var eventPositionX= [this.width/2,0]; - var eventPositionY= [0,this.height/2]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } -} -}; - -bpmnEventErrorEnd.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; - diff --git a/workflow/engine/templates/bpmn/EventErrorInter.js b/workflow/engine/templates/bpmn/EventErrorInter.js deleted file mode 100755 index 8c5b8d338..000000000 --- a/workflow/engine/templates/bpmn/EventErrorInter.js +++ /dev/null @@ -1,49 +0,0 @@ -bpmnEventErrorInter=function(){ -VectorFigure.call(this); -this.stroke=1; -}; -bpmnEventErrorInter.prototype=new VectorFigure; -bpmnEventErrorInter.prototype.type="bpmnEventErrorInter"; -bpmnEventErrorInter.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); - -if(typeof workflow.zoomfactor == 'undefined') - workflow.zoomfactor = 1; - //Set the Task Limitation -if(typeof this.limitFlag == 'undefined' || this.limitFlag == false) -{ - this.originalWidth = 30; - this.originalHeight = 30; - this.orgXPos = this.getX(); - this.orgYPos = this.getY(); - this.orgFontSize =this.fontSize; -} - -this.width = this.originalWidth * workflow.zoomfactor; -this.height = this.originalHeight * workflow.zoomfactor; - -this.graphics.setStroke(this.stroke); -var x_cir = 0; -var y_cir = 0; -this.graphics.setColor("#000000"); -this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); -var x_cir2=5; -var y_cir2=5; -this.graphics.setColor("#000000"); -this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-10,this.getHeight()-10); -//var x=new Array(7,17,24,34,24,17); -//var y=new Array(33,23,33,13,26,16); -var cw = this.getWidth(); -var ch = this.getHeight(); -var x=new Array(cw*0.15,cw*0.38,cw*0.53,cw*0.75,cw*0.53,cw*0.38); -var y=new Array(ch*0.73,ch*0.51,ch*0.73,ch*0.28,ch*0.57,ch*0.35); -//var x=new Array(this.getWidth()/6.4,this.getWidth()/2.6,this.getWidth()/1.87,this.getWidth()/1.32,this.getWidth()/1.87,this.getWidth()/2.6); -//var y=new Array(this.getHeight()/1.36,this.getHeight()/1.95,this.getHeight()/1.36,this.getHeight()/3.46,this.getHeight()/1.73,this.getHeight()/2.8); -this.graphics.setColor("#ffffff"); -this.graphics.fillPolygon(x,y); -this.graphics.setColor("#000000"); -this.graphics.drawPolygon(x,y); -this.graphics.paint(); -}; - - diff --git a/workflow/engine/templates/bpmn/EventInterSignal.js b/workflow/engine/templates/bpmn/EventInterSignal.js deleted file mode 100755 index 0962e8582..000000000 --- a/workflow/engine/templates/bpmn/EventInterSignal.js +++ /dev/null @@ -1,97 +0,0 @@ -bpmnEventInterSignal=function(){ -VectorFigure.call(this); -this.stroke=1; -}; -bpmnEventInterSignal.prototype=new VectorFigure; -bpmnEventInterSignal.prototype.type="bpmnEventInterSignal"; -bpmnEventInterSignal.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); - -if(typeof workflow.zoomfactor == 'undefined') - workflow.zoomfactor = 1; - //Set the Task Limitation -if(typeof this.limitFlag == 'undefined' || this.limitFlag == false) -{ - this.originalWidth = 30; - this.originalHeight = 30; - this.orgXPos = this.getX(); - this.orgYPos = this.getY(); - this.orgFontSize =this.fontSize; -} - -this.width = this.originalWidth * workflow.zoomfactor; -this.height = this.originalHeight * workflow.zoomfactor; - -this.graphics.setStroke(this.stroke); -var x_cir = 0; -var y_cir = 0; - -this.graphics.setColor("#c0c0c0"); -this.graphics.fillEllipse(x_cir+3,y_cir+3,this.getWidth(),this.getHeight()); - -this.graphics.setColor("#f9faf2"); -this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); -this.graphics.setColor("#adae5e"); -this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); - -var x_cir2=5; -var y_cir2=5; -this.graphics.setColor("#f9faf2"); -this.graphics.fillEllipse(x_cir2,y_cir2,this.getWidth()-10,this.getHeight()-10); -this.graphics.setColor("#adae5e"); -this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-10,this.getHeight()-10); -//var x=new Array(12,32,22); -//var y=new Array(32,32,9); -var cw = this.getWidth(); -var ch = this.getHeight(); -var x=new Array(cw*0.26,cw*0.71,cw*0.49); -var y=new Array(ch*0.71,ch*0.71,ch*0.2); -//var x=new Array(this.getWidth()/3.75,this.getWidth()/1.4,this.getWidth()/2.04); -//var y=new Array(this.getHeight()/1.4,this.getHeight()/1.4,this.getHeight()/5); -this.graphics.setColor("#adae5e"); -this.graphics.fillPolygon(x,y); -this.graphics.setColor("#adae5e"); -this.graphics.drawPolygon(x,y); -this.graphics.paint(); - -/*Code Added to Dynamically shift Ports on resizing of shapes - **/ -if(this.input1!=null){ -this.input1.setPosition(0,this.height/2); -} -if(this.output1!=null){ -this.output1.setPosition(this.width/2,this.height); -} -if(this.input2!=null){ -this.input2.setPosition(this.width/2,0); -} -if(this.output2!=null){ -this.output2.setPosition(this.width,this.height/2); -} -}; - -bpmnEventInterSignal.prototype.setWorkflow=function(_40c5){ -VectorFigure.prototype.setWorkflow.call(this,_40c5); -if(_40c5!=null){ - var eventPortName = ['input1','input2','output1','output2']; - var eventPortType = ['InputPort','InputPort','OutputPort','OutputPort']; - var eventPositionX= [0,this.width/2,this.width,this.width/2]; - var eventPositionY= [this.height/2,0,this.height/2,this.height]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } -} -}; - -bpmnEventInterSignal.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; diff --git a/workflow/engine/templates/bpmn/EventLinkEnd.js b/workflow/engine/templates/bpmn/EventLinkEnd.js deleted file mode 100755 index 0ddc4eb74..000000000 --- a/workflow/engine/templates/bpmn/EventLinkEnd.js +++ /dev/null @@ -1,30 +0,0 @@ -bpmnEventLinkEnd=function(){ -VectorFigure.call(this); -//Setting width and height values as per the zoom ratio -if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined') - this.setDimension(workflow.zoomWidth, workflow.zoomHeight); -else - this.setDimension(45,45); -this.stroke=3; -}; -bpmnEventLinkEnd.prototype=new VectorFigure; -bpmnEventLinkEnd.prototype.type="bpmnEventLinkEnd"; -bpmnEventLinkEnd.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); -var x_cir = -4; -var y_cir = -4; -this.graphics.setStroke(this.stroke); -this.graphics.setColor("#000000"); -this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); -//var x_arrow=new Array(4,4,22,22,37,22,22); //Arrow working -//var y_arrow=new Array(11,26,26,31,18.5,6,11); -var x_arrow=new Array(4,4,this.getWidth()/2,this.getWidth()/2,this.getWidth()/1.2,this.getWidth()/2,this.getWidth()/2); -var y_arrow=new Array(this.getHeight()/4,this.getHeight()/1.7,this.getHeight()/1.7,this.getHeight()/1.5,this.getHeight()/2.5,this.getHeight()/7,this.getHeight()/4); -this.graphics.setColor( "#000000" ); -this.graphics.fillPolygon(x_arrow,y_arrow); -this.graphics.setColor("#000000"); -this.graphics.drawPolygon(x_arrow,y_arrow); -this.graphics.paint(); -}; - - diff --git a/workflow/engine/templates/bpmn/EventLinkInter.js b/workflow/engine/templates/bpmn/EventLinkInter.js deleted file mode 100755 index 093c0e131..000000000 --- a/workflow/engine/templates/bpmn/EventLinkInter.js +++ /dev/null @@ -1,78 +0,0 @@ -bpmnEventLinkInter=function(){ -VectorFigure.call(this); -//Setting width and height values as per the zoom ratio -if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined') - this.setDimension(workflow.zoomWidth, workflow.zoomHeight); -else - this.setDimension(30,30); -this.stroke=2; -}; -bpmnEventLinkInter.prototype=new VectorFigure; -bpmnEventLinkInter.prototype.type="bpmnEventLinkInter"; -bpmnEventLinkInter.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); -var x_cir = -4; -var y_cir = -4; - -this.graphics.setColor("#c0c0c0"); -this.graphics.fillEllipse(x_cir+3,y_cir+3,this.getWidth(),this.getHeight()); -this.graphics.setColor("#f9faf2"); -this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); -this.graphics.setStroke(this.stroke); -this.graphics.setColor("#adae5e"); -this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); -var x_cir2=-1; -var y_cir2=-1; -this.graphics.setColor("#adae5e"); -this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6); -//var x_arrow=new Array(4,4,22,22,37,22,22); //Arrow working -//var y_arrow=new Array(11,26,26,31,18.5,6,11); -var x_arrow=new Array(4,4,this.getWidth()/2,this.getWidth()/2,this.getWidth()/1.2,this.getWidth()/2,this.getWidth()/2); -var y_arrow=new Array(this.getHeight()/4,this.getHeight()/1.7,this.getHeight()/1.7,this.getHeight()/1.5,this.getHeight()/2.5,this.getHeight()/7,this.getHeight()/4); -this.graphics.setColor( "#adae5e" ); -this.graphics.fillPolygon(x_arrow,y_arrow); -this.graphics.setColor("#adae5e"); -this.graphics.drawPolygon(x_arrow,y_arrow); -this.graphics.paint(); - -/*Code Added to Dynamically shift Ports on resizing of shapes - **/ -if(this.input1!=null){ -this.input1.setPosition(0,this.height/2); -} -if(this.output1!=null){ -this.output1.setPosition(this.width/2,this.height); -} -if(this.input2!=null){ -this.input2.setPosition(this.width/2,0); -} -if(this.output2!=null){ -this.output2.setPosition(this.width,this.height/2); -} -}; - -bpmnEventLinkInter.prototype.setWorkflow=function(_40c5){ -VectorFigure.prototype.setWorkflow.call(this,_40c5); -if(_40c5!=null){ -var eventPortName = ['input1','input2','output1','output2']; - var eventPortType = ['InputPort','InputPort','OutputPort','OutputPort']; - var eventPositionX= [0,this.width/2,this.width,this.width/2]; - var eventPositionY= [this.height/2,0,this.height/2,this.height]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } -} -}; - -bpmnEventLinkInter.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; diff --git a/workflow/engine/templates/bpmn/EventLinkStart.js b/workflow/engine/templates/bpmn/EventLinkStart.js deleted file mode 100755 index 23797ce33..000000000 --- a/workflow/engine/templates/bpmn/EventLinkStart.js +++ /dev/null @@ -1,36 +0,0 @@ -bpmnEventLinkStart=function(){ -VectorFigure.call(this); -//Setting width and height values as per the zoom ratio -if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined') - this.setDimension(workflow.zoomWidth, workflow.zoomHeight); -else - this.setDimension(45,45); -this.stroke=2 -}; -bpmnEventLinkStart.prototype=new VectorFigure; -bpmnEventLinkStart.prototype.type="bpmnEventLinkStart"; -bpmnEventLinkStart.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); - -var x_cir = -4; -var y_cir = -4; - -this.graphics.setStroke(this.stroke); - -this.graphics.setColor("#000000"); -this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); - -//var x_arrow=new Array(4,4,22,22,37,22,22); //Arrow working -//var y_arrow=new Array(11,26,26,31,18.5,6,11); -var x_arrow=new Array(4,4,this.getWidth()/2,this.getWidth()/2,this.getWidth()/1.2,this.getWidth()/2,this.getWidth()/2); -var y_arrow=new Array(this.getHeight()/4,this.getHeight()/1.7,this.getHeight()/1.7,this.getHeight()/1.5,this.getHeight()/2.5,this.getHeight()/7,this.getHeight()/4); -this.graphics.setColor( "#ffffff" ); -this.graphics.fillPolygon(x_arrow,y_arrow); - -this.graphics.setColor("#000000"); -this.graphics.drawPolygon(x_arrow,y_arrow); - -this.graphics.paint(); -}; - - diff --git a/workflow/engine/templates/bpmn/EventMessageEnd.js b/workflow/engine/templates/bpmn/EventMessageEnd.js deleted file mode 100755 index 89d1393f0..000000000 --- a/workflow/engine/templates/bpmn/EventMessageEnd.js +++ /dev/null @@ -1,102 +0,0 @@ -bpmnEventMessageEnd=function(){ -VectorFigure.call(this); -this.stroke = 2; -}; -bpmnEventMessageEnd.prototype=new VectorFigure; -bpmnEventMessageEnd.prototype.type="bpmnEventMessageEnd"; -bpmnEventMessageEnd.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); - -if(typeof workflow.zoomfactor == 'undefined') - workflow.zoomfactor = 1; -//Set the Task Limitation -if(typeof this.limitFlag == 'undefined' || this.limitFlag == false) -{ - this.originalWidth = 30; - this.originalHeight = 30; - this.orgXPos = this.getX(); - this.orgYPos = this.getY(); - this.orgFontSize =this.fontSize; -} - -this.width = this.originalWidth * workflow.zoomfactor; -this.height = this.originalHeight * workflow.zoomfactor; -var x_cir = 0; -var y_cir = 0; - -this.graphics.setColor("#c0c0c0"); -this.graphics.fillEllipse(x_cir+5,y_cir+5,this.getWidth(),this.getHeight()); - -this.graphics.setStroke(this.stroke); -this.graphics.setColor( "#f5d4d4"); -this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); -this.graphics.setColor("#a23838"); -this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); -this.graphics.setStroke(1); -//var x=new Array(12,12,35,35,23.5,12); -//var y=new Array(16,33,33,17,26,17); -/*var x=new Array(this.getWidth()/3.75,this.getWidth()/3.75,this.getWidth()/1.28,this.getWidth()/1.28,this.getWidth()/2,this.getWidth()/3.75,this.getWidth()/3.75); -var y=new Array(this.getHeight()/3.21,this.getHeight()/1.36,this.getHeight()/1.36,this.getHeight()/2.64,this.getHeight()/1.73,this.getHeight()/2.64); -this.graphics.setColor( "#c46508" ); -this.graphics.fillPolygon(x,y); -this.graphics.setColor("#c46508"); -//this.graphics.drawPolygon(x,y); -//var x_tri=new Array(12,23.5,35); -//var y_tri=new Array(13,22,13); -var x_tri=new Array(this.getWidth()/3.75,this.getWidth()/1.91,this.getWidth()/1.28); -var y_tri=new Array(this.getHeight()/3.46,this.getHeight()/2.04,this.getHeight()/3.46); -this.graphics.setColor( "#c46508" ); -this.graphics.fillPolygon(x_tri,y_tri); -this.graphics.setColor("#c46508"); -//this.graphics.drawPolygon(x_tri,y_tri);*/ - -//draw the mail icon - var cw = this.getWidth(); - var ch = this.getHeight(); - var x = new Array( cw*0.25, cw*0.25, cw*0.78, cw*0.78, cw*0.52, cw*0.25, cw*0.25, cw*0.78); - var y = new Array( ch*0.31, ch*0.71, ch*0.71, ch*0.32, ch*0.52, ch*0.32, ch*0.31, ch*0.31); - this.graphics.setColor("#c46508"); - this.graphics.drawPolygon(x,y); -this.graphics.paint(); - -/*Code Added to Dynamically shift Ports on resizing of shapes - **/ -if(this.input1!=null){ -this.input1.setPosition(0,this.height/2); -} -if(this.output1!=null){ -this.output1.setPosition(this.width/2,this.height); -} -if(this.input2!=null){ -this.input2.setPosition(this.width/2,0); -} -if(this.output2!=null){ -this.output2.setPosition(this.width,this.height/2); -} -}; - -bpmnEventMessageEnd.prototype.setWorkflow=function(_40c5){ -VectorFigure.prototype.setWorkflow.call(this,_40c5); -if(_40c5!=null){ - var eventPortName = ['input1','input2']; - var eventPortType = ['InputPort','InputPort']; - var eventPositionX= [this.width/2,0]; - var eventPositionY= [0,this.height/2]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } -} -}; - -bpmnEventMessageEnd.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; diff --git a/workflow/engine/templates/bpmn/EventMessageInter.js b/workflow/engine/templates/bpmn/EventMessageInter.js deleted file mode 100755 index 9bfbe5d07..000000000 --- a/workflow/engine/templates/bpmn/EventMessageInter.js +++ /dev/null @@ -1,80 +0,0 @@ -bpmnEventMessageInter=function(){ -VectorFigure.call(this); -this.stroke=1; -}; -bpmnEventMessageInter.prototype=new VectorFigure; -bpmnEventMessageInter.prototype.type="bpmnEventMessageInter"; -bpmnEventMessageInter.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); - -if(typeof workflow.zoomfactor == 'undefined') - workflow.zoomfactor = 1; - //Set the Task Limitation -if(typeof this.limitFlag == 'undefined' || this.limitFlag == false) -{ - this.originalWidth = 30; - this.originalHeight = 30; - this.orgXPos = this.getX(); - this.orgYPos = this.getY(); - this.orgFontSize =this.fontSize; -} - -this.width = this.originalWidth * workflow.zoomfactor; -this.height = this.originalHeight * workflow.zoomfactor; - -var x_cir = 0; -var y_cir = 0; - -this.graphics.setColor("#c0c0c0"); -this.graphics.fillEllipse(x_cir+3,y_cir+3,this.getWidth(),this.getHeight()); -this.graphics.setStroke(this.stroke); -this.graphics.setColor( "#f9faf2"); -this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); - -this.graphics.setColor("#adae5e"); -this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); - -var x_cir2=3; -var y_cir2=3; - -this.graphics.setColor( "#f9faf2" ); -this.graphics.fillEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6); - -this.graphics.setColor("#adae5e"); -var cw = this.getWidth(); -var ch = this.getHeight(); -this.graphics.drawEllipse(cw*0.15, ch*0.15, ch*0.7, ch*0.7); -//var x=new Array(12,12,32,32,22,12,32); -//var y=new Array(14,31,31,14,23,14,14); -/*var x=new Array(this.getWidth()/3.75,this.getWidth()/3.75,this.getWidth()/1.28,this.getWidth()/1.28,this.getWidth()/2,this.getWidth()/3.75,this.getWidth()/3.75); -var y=new Array(this.getHeight()/3.21,this.getHeight()/1.36,this.getHeight()/1.36,this.getHeight()/2.64,this.getHeight()/1.73,this.getHeight()/2.64); -this.graphics.setStroke(1); -this.graphics.setColor( "#adae5e" ); -//this.graphics.fillPolygon(x,y); -this.graphics.setColor("#adae5e"); -this.graphics.drawPolygon(x,y); -//var x_tri=new Array(12,23.5,35); -//var y_tri=new Array(13,22,13); -var x_tri=new Array(this.getWidth()/3.75,this.getWidth()/1.91,this.getWidth()/1.28); -var y_tri=new Array(this.getHeight()/3.46,this.getHeight()/2.04,this.getHeight()/3.46); -this.graphics.setColor( "#adae5e" ); -//this.graphics.fillPolygon(x_tri,y_tri); -this.graphics.setColor("#adae5e"); -this.graphics.drawPolygon(x_tri,y_tri);*/ - -//draw the mail icon - var cw = this.getWidth(); - var ch = this.getHeight(); - var x = new Array( cw*0.25, cw*0.25, cw*0.78, cw*0.78, cw*0.52, cw*0.25, cw*0.25, cw*0.78); - var y = new Array( ch*0.31, ch*0.71, ch*0.71, ch*0.32, ch*0.52, ch*0.32, ch*0.31, ch*0.31); - this.graphics.setColor("#4aa533"); - this.graphics.drawPolygon(x,y); - -this.graphics.paint(); -}; - -bpmnEventMessageInter.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; diff --git a/workflow/engine/templates/bpmn/EventMessageRecInter.js b/workflow/engine/templates/bpmn/EventMessageRecInter.js deleted file mode 100755 index 3a5d3c7c3..000000000 --- a/workflow/engine/templates/bpmn/EventMessageRecInter.js +++ /dev/null @@ -1,111 +0,0 @@ -bpmnEventMessageRecInter=function(){ -VectorFigure.call(this); -this.stroke=2; -}; -bpmnEventMessageRecInter.prototype=new VectorFigure; -bpmnEventMessageRecInter.prototype.type="bpmnEventMessageRecInter"; -bpmnEventMessageRecInter.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); - -if(typeof workflow.zoomfactor == 'undefined') - workflow.zoomfactor = 1; - //Set the Task Limitation -if(typeof this.limitFlag == 'undefined' || this.limitFlag == false) -{ - this.originalWidth = 30; - this.originalHeight = 30; - this.orgXPos = this.getX(); - this.orgYPos = this.getY(); - this.orgFontSize =this.fontSize; -} - -this.width = this.originalWidth * workflow.zoomfactor; -this.height = this.originalHeight * workflow.zoomfactor; - -var x_cir = 0; -var y_cir = 0; - -this.graphics.setColor("#c0c0c0"); -this.graphics.fillEllipse(x_cir+3,y_cir+3,this.getWidth(),this.getHeight()); -this.graphics.setStroke(this.stroke); -this.graphics.setColor( "#f9faf2"); -this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); - -this.graphics.setColor("#adae5e"); -this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); - -var x_cir2=3; -var y_cir2=3; - -this.graphics.setColor( "#f9faf2" ); -this.graphics.fillEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6); - -this.graphics.setColor("#adae5e"); -this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6); -//var x=new Array(12,12,32,32,22,12,32); -//var y=new Array(14,31,31,14,23,14,14); -/*var x=new Array(this.getWidth()/3.75,this.getWidth()/3.75,this.getWidth()/1.28,this.getWidth()/1.28,this.getWidth()/1.95,this.getWidth()/3.75); -var y=new Array(this.getHeight()/2.64,this.getHeight()/1.36,this.getHeight()/1.36,this.getHeight()/2.64,this.getHeight()/1.73,this.getHeight()/2.64); -this.graphics.setStroke(1); -this.graphics.setColor( "#adae5e" ); -//this.graphics.fillPolygon(x,y); -this.graphics.setColor("#adae5e"); -this.graphics.drawPolygon(x,y); -//var x_tri=new Array(12,23.5,35); -//var y_tri=new Array(13,22,13); -var x_tri=new Array(this.getWidth()/3.75,this.getWidth()/1.91,this.getWidth()/1.28); -var y_tri=new Array(this.getHeight()/3.46,this.getHeight()/2.04,this.getHeight()/3.46); -this.graphics.setColor( "#adae5e" ); -//this.graphics.fillPolygon(x_tri,y_tri); -this.graphics.setColor("#adae5e"); -this.graphics.drawPolygon(x_tri,y_tri);*/ -//draw the mail icon - var cw = this.getWidth(); - var ch = this.getHeight(); - var x = new Array( cw*0.25, cw*0.25, cw*0.78, cw*0.78, cw*0.52, cw*0.25, cw*0.25, cw*0.78); - var y = new Array( ch*0.31, ch*0.71, ch*0.71, ch*0.32, ch*0.52, ch*0.32, ch*0.31, ch*0.31); - this.graphics.setColor("#adae5e"); - this.graphics.drawPolygon(x,y); -this.graphics.paint(); - -/*Code Added to Dynamically shift Ports on resizing of shapes - **/ -if(this.input1!=null){ -this.input1.setPosition(0,this.height/2); -} -if(this.output1!=null){ -this.output1.setPosition(this.width/2,this.height); -} -if(this.input2!=null){ -this.input2.setPosition(this.width/2,0); -} -if(this.output2!=null){ -this.output2.setPosition(this.width,this.height/2); -} -}; - -bpmnEventMessageRecInter.prototype.setWorkflow=function(_40c5){ -VectorFigure.prototype.setWorkflow.call(this,_40c5); -if(_40c5!=null){ - var eventPortName = ['input1','input2','output1','output2']; - var eventPortType = ['InputPort','InputPort','OutputPort','OutputPort']; - var eventPositionX= [0,this.width/2,this.width,this.width/2]; - var eventPositionY= [this.height/2,0,this.height/2,this.height]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } -} -}; - -bpmnEventMessageRecInter.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; diff --git a/workflow/engine/templates/bpmn/EventMessageSendInter.js b/workflow/engine/templates/bpmn/EventMessageSendInter.js deleted file mode 100755 index a1fdff3d5..000000000 --- a/workflow/engine/templates/bpmn/EventMessageSendInter.js +++ /dev/null @@ -1,113 +0,0 @@ -bpmnEventMessageSendInter=function(){ -VectorFigure.call(this); - -this.stroke=1; -}; -bpmnEventMessageSendInter.prototype=new VectorFigure; -bpmnEventMessageSendInter.prototype.type="bpmnEventMessageSendInter"; -bpmnEventMessageSendInter.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); - -if(typeof workflow.zoomfactor == 'undefined') - workflow.zoomfactor = 1; - //Set the Task Limitation -if(typeof this.limitFlag == 'undefined' || this.limitFlag == false) -{ - this.originalWidth = 30; - this.originalHeight = 30; - this.orgXPos = this.getX(); - this.orgYPos = this.getY(); - this.orgFontSize =this.fontSize; -} - -this.width = this.originalWidth * workflow.zoomfactor; -this.height = this.originalHeight * workflow.zoomfactor; - -var x_cir = 0; -var y_cir = 0; - -this.graphics.setColor("#c0c0c0"); -this.graphics.fillEllipse(x_cir+3,y_cir+3,this.getWidth(),this.getHeight()); -this.graphics.setStroke(this.stroke); -this.graphics.setColor( "#f9faf2"); -this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); - -this.graphics.setColor("#adae5e"); -this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); - -var x_cir2=3; -var y_cir2=3; - -this.graphics.setColor( "#f9faf2" ); -this.graphics.fillEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6); - -this.graphics.setColor("#adae5e"); -this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6); -//var x=new Array(12,12,32,32,22,12,32); -//var y=new Array(14,31,31,14,23,14,14); -/*var x=new Array(this.getWidth()/3.75,this.getWidth()/3.75,this.getWidth()/1.28,this.getWidth()/1.28,this.getWidth()/1.95,this.getWidth()/3.75); -var y=new Array(this.getHeight()/2.64,this.getHeight()/1.36,this.getHeight()/1.36,this.getHeight()/2.64,this.getHeight()/1.73,this.getHeight()/2.64); -this.graphics.setStroke(1); -this.graphics.setColor( "#adae5e" ); -this.graphics.fillPolygon(x,y); -this.graphics.setColor("#adae5e"); -//this.graphics.drawPolygon(x,y); -//var x_tri=new Array(12,23.5,35); -//var y_tri=new Array(13,22,13); -var x_tri=new Array(this.getWidth()/3.75,this.getWidth()/1.91,this.getWidth()/1.28); -var y_tri=new Array(this.getHeight()/3.46,this.getHeight()/2.04,this.getHeight()/3.46); -this.graphics.setColor( "#adae5e" ); -this.graphics.fillPolygon(x_tri,y_tri); -this.graphics.setColor("#adae5e");*/ -//this.graphics.drawPolygon(x_tri,y_tri); -//draw the mail icon - var cw = this.getWidth(); - var ch = this.getHeight(); - var x = new Array( cw*0.25, cw*0.25, cw*0.78, cw*0.78, cw*0.52, cw*0.25, cw*0.25, cw*0.78); - var y = new Array( ch*0.31, ch*0.71, ch*0.71, ch*0.32, ch*0.52, ch*0.32, ch*0.31, ch*0.31); - this.graphics.setColor("#adae5e"); - this.graphics.drawPolygon(x,y); -this.graphics.paint(); - - -/*Code Added to Dynamically shift Ports on resizing of shapes - **/ -if(this.input1!=null){ -this.input1.setPosition(0,this.height/2); -} -if(this.output1!=null){ -this.output1.setPosition(this.width/2,this.height); -} -if(this.input2!=null){ -this.input2.setPosition(this.width/2,0); -} -if(this.output2!=null){ -this.output2.setPosition(this.width,this.height/2); -} -}; - -bpmnEventMessageSendInter.prototype.setWorkflow=function(_40c5){ -VectorFigure.prototype.setWorkflow.call(this,_40c5); -if(_40c5!=null){ - var eventPortName = ['input1','input2','output1','output2']; - var eventPortType = ['InputPort','InputPort','OutputPort','OutputPort']; - var eventPositionX= [0,this.width/2,this.width,this.width/2]; - var eventPositionY= [this.height/2,0,this.height/2,this.height]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } -} -}; - -bpmnEventMessageSendInter.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; diff --git a/workflow/engine/templates/bpmn/EventMessageStart.js b/workflow/engine/templates/bpmn/EventMessageStart.js deleted file mode 100755 index 338ee2de0..000000000 --- a/workflow/engine/templates/bpmn/EventMessageStart.js +++ /dev/null @@ -1,89 +0,0 @@ -bpmnEventMessageStart=function(){ - VectorFigure.call(this); -}; - -bpmnEventMessageStart.prototype=new VectorFigure; -bpmnEventMessageStart.prototype.type="bpmnEventMessageStart"; -bpmnEventMessageStart.prototype.paint=function(){ - VectorFigure.prototype.paint.call(this); - if(typeof workflow.zoomfactor == 'undefined') - workflow.zoomfactor = 1; - - //Set the Limitation - if(typeof this.limitFlag == 'undefined' || this.limitFlag == false) { - this.originalWidth = 30; - this.originalHeight = 30; - this.orgXPos = this.getX(); - this.orgYPos = this.getY(); - this.orgFontSize =this.fontSize; - } - this.width = this.originalWidth * workflow.zoomfactor; - this.height = this.originalHeight * workflow.zoomfactor; - - var x_cir = 0; - var y_cir = 0; - - //draw the circle - this.graphics.setColor("#d0d0d0"); - this.graphics.fillEllipse(x_cir+2,y_cir+2,this.getWidth(),this.getHeight()); - this.graphics.setColor( "#F6FFDA" ); - this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); - this.graphics.setStroke(1); - this.graphics.setColor("#97C759"); - this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); - this.graphics.setStroke(1); - this.graphics.setColor("#98C951"); - this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); - - //draw the mail icon - var cw = this.getWidth(); - var ch = this.getHeight(); - var x = new Array( cw*0.25, cw*0.25, cw*0.78, cw*0.78, cw*0.52, cw*0.25, cw*0.25, cw*0.78); - var y = new Array( ch*0.31, ch*0.71, ch*0.71, ch*0.32, ch*0.52, ch*0.32, ch*0.31, ch*0.31); - this.graphics.setColor("#4aa533"); - this.graphics.drawPolygon(x,y); - - this.graphics.paint(); - - /*Code Added to Dynamically shift Ports on resizing of shapes - **/ - if(this.input1!=null){ - this.input1.setPosition(0,this.height/2); - } - if(this.output1!=null){ - this.output1.setPosition(this.width/2,this.height); - } - if(this.input2!=null){ - this.input2.setPosition(this.width/2,0); - } - if(this.output2!=null){ - this.output2.setPosition(this.width,this.height/2); - } -}; - -bpmnEventMessageStart.prototype.setWorkflow=function(_40c5){ - VectorFigure.prototype.setWorkflow.call(this,_40c5); - if(_40c5!=null){ - var eventPortName = ['output1','output2']; - var eventPortType = ['OutputPort','OutputPort']; - var eventPositionX= [this.width/2,this.width]; - var eventPositionY= [this.height,this.height/2]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } - } -}; - -bpmnEventMessageStart.prototype.getContextMenu=function(){ - if(this.id != null){ - this.workflow.handleContextMenu(this); - } -}; - diff --git a/workflow/engine/templates/bpmn/EventMulStart.js b/workflow/engine/templates/bpmn/EventMulStart.js deleted file mode 100755 index 9f1856d43..000000000 --- a/workflow/engine/templates/bpmn/EventMulStart.js +++ /dev/null @@ -1,74 +0,0 @@ -bpmnEventMulStart=function(){ -VectorFigure.call(this); -//Setting width and height values as per the zoom ratio -if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined') - this.setDimension(workflow.zoomWidth, workflow.zoomHeight); -else - this.setDimension(30,30); -this.stroke= 2; -}; -bpmnEventMulStart.prototype=new VectorFigure; -bpmnEventMulStart.prototype.type="bpmnEventMulStart"; -bpmnEventMulStart.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); -var x=0; -var y=0; -this.graphics.setStroke(this.stroke); -this.graphics.setColor("#c0c0c0"); -this.graphics.fillEllipse(x+3,y+3,this.getWidth(),this.getHeight()); -this.graphics.setColor( "#e4f7df" ); -this.graphics.fillEllipse(x,y,this.getWidth(),this.getHeight()); -this.graphics.setColor("#4aa533"); -this.graphics.drawEllipse(x,y,this.getWidth(),this.getHeight()); -//var x_penta=new Array(13,28,36,22,8);(8.5,18.5,24,14.5,5 -//var y_penta=new Array(33,33,18,8,18);(22,22,12,5,12 -var x_penta=new Array(this.getWidth()/3.5,this.getWidth()/1.6,this.getWidth()/1.25,this.getWidth()/2,this.getWidth()/5.6); -var y_penta=new Array(this.getHeight()/1.36,this.getHeight()/1.36,this.getHeight()/2.5,this.getHeight()/5.6,this.getHeight()/2.5); -//this.graphics.setStroke(1); -this.graphics.setColor( "#4aa533" ); -this.graphics.fillPolygon(x_penta,y_penta); -this.graphics.setColor("#4aa533"); -this.graphics.drawPolygon(x_penta,y_penta); -this.graphics.paint(); - -/*Code Added to Dynamically shift Ports on resizing of shapes - **/ -if(this.input1!=null){ -this.input1.setPosition(0,this.height/2); -} -if(this.output1!=null){ -this.output1.setPosition(this.width/2,this.height); -} -if(this.input2!=null){ -this.input2.setPosition(this.width/2,0); -} -if(this.output2!=null){ -this.output2.setPosition(this.width,this.height/2); -} -}; - -bpmnEventMulStart.prototype.setWorkflow=function(_40c5){ -VectorFigure.prototype.setWorkflow.call(this,_40c5); -if(_40c5!=null){ - var eventPortName = ['output1','output2']; - var eventPortType = ['OutputPort','OutputPort']; - var eventPositionX= [this.width/2,this.width]; - var eventPositionY= [this.height,this.height/2]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } -} -}; - -bpmnEventMulStart.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; diff --git a/workflow/engine/templates/bpmn/EventMultipleEnd.js b/workflow/engine/templates/bpmn/EventMultipleEnd.js deleted file mode 100755 index 8a90e1f34..000000000 --- a/workflow/engine/templates/bpmn/EventMultipleEnd.js +++ /dev/null @@ -1,76 +0,0 @@ -bpmnEventMultipleEnd=function(){ -VectorFigure.call(this); -//Setting width and height values as per the zoom ratio -if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined') - this.setDimension(workflow.zoomWidth, workflow.zoomHeight); -else - this.setDimension(30,30); -this.stroke=2; -}; -bpmnEventMultipleEnd.prototype=new VectorFigure; -bpmnEventMultipleEnd.prototype.type="bpmnEventMultipleEnd"; -bpmnEventMultipleEnd.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); -VectorFigure.prototype.paint.call(this); -this.graphics.setStroke(this.stroke); -var x_cir = 0; -var y_cir = 0; - -this.graphics.setColor("#c0c0c0"); -this.graphics.fillEllipse(x_cir+5,y_cir+5,this.getWidth(),this.getHeight()); -this.graphics.setStroke(this.stroke); -this.graphics.setColor( "#f7f1e5" ); -this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); -this.graphics.setColor("#c46508"); -this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); -//var x_penta=new Array(12.5,27.5,35.5,21.5,8); -//var y_penta=new Array(33,33,18,8,18); -var x_penta=new Array(this.getWidth()/3.6,this.getWidth()/1.63,this.getWidth()/1.26,this.getWidth()/2.14,this.getWidth()/5.6); -var y_penta=new Array(this.getHeight()/1.36,this.getHeight()/1.36,this.getHeight()/2.5,this.getHeight()/5.6,this.getHeight()/2.5); -this.graphics.setColor( "#c46508" ); -this.graphics.fillPolygon(x_penta,y_penta); -this.graphics.setColor("#c46508"); -//this.graphics.drawPolygon(x_penta,y_penta); -this.graphics.paint(); - -/*Code Added to Dynamically shift Ports on resizing of shapes - **/ -if(this.input1!=null){ -this.input1.setPosition(0,this.height/2); -} -if(this.output1!=null){ -this.output1.setPosition(this.width/2,this.height); -} -if(this.input2!=null){ -this.input2.setPosition(this.width/2,0); -} -if(this.output2!=null){ -this.output2.setPosition(this.width,this.height/2); -} -}; - -bpmnEventMultipleEnd.prototype.setWorkflow=function(_40c5){ -VectorFigure.prototype.setWorkflow.call(this,_40c5); -if(_40c5!=null){ - var eventPortName = ['input1','input2']; - var eventPortType = ['InputPort','InputPort']; - var eventPositionX= [this.width/2,0]; - var eventPositionY= [0,this.height/2]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } -} -}; - -bpmnEventMultipleEnd.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; diff --git a/workflow/engine/templates/bpmn/EventMultipleInter.js b/workflow/engine/templates/bpmn/EventMultipleInter.js deleted file mode 100755 index 24ccf7a83..000000000 --- a/workflow/engine/templates/bpmn/EventMultipleInter.js +++ /dev/null @@ -1,81 +0,0 @@ -bpmnEventMultipleInter=function(){ -VectorFigure.call(this); -//Setting width and height values as per the zoom ratio -if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined') - this.setDimension(workflow.zoomWidth, workflow.zoomHeight); -else - this.setDimension(30,30); -this.stroke=2 -}; -bpmnEventMultipleInter.prototype=new VectorFigure; -bpmnEventMultipleInter.prototype.type="bpmnEventMultipleInter"; -bpmnEventMultipleInter.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); -this.graphics.setStroke(this.stroke); -var x_cir = 0; -var y_cir = 0; - -this.graphics.setColor("#c0c0c0"); -this.graphics.fillEllipse(x_cir+3,y_cir+3,this.getWidth(),this.getHeight()); - -this.graphics.setColor("#f9faf2"); -this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); -this.graphics.setColor("#adae5e"); -this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); -var x_cir2=3; -var y_cir2=3; -this.graphics.setColor("#f9faf2"); -this.graphics.fillEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6); -this.graphics.setColor("#adae5e"); -this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6); -//var x_penta=new Array(13.5,28.5,37.5,23.1,9); -//var y_penta=new Array(33,33,18,8,18); -var x_penta=new Array(this.getWidth()/3.46,this.getWidth()/1.57,this.getWidth()/1.2,this.getWidth()/1.95,this.getWidth()/5); -var y_penta=new Array(this.getHeight()/1.36,this.getHeight()/1.36,this.getHeight()/2.5,this.getHeight()/5,this.getHeight()/2.5); -this.graphics.setColor( "#adae5e" ); -this.graphics.fillPolygon(x_penta,y_penta); -this.graphics.setColor("#adae5e"); -this.graphics.drawPolygon(x_penta,y_penta); -this.graphics.paint(); - -/*Code Added to Dynamically shift Ports on resizing of shapes - **/ -if(this.input1!=null){ -this.input1.setPosition(0,this.height/2); -} -if(this.output1!=null){ -this.output1.setPosition(this.width/2,this.height); -} -if(this.input2!=null){ -this.input2.setPosition(this.width/2,0); -} -if(this.output2!=null){ -this.output2.setPosition(this.width,this.height/2); -} -}; - -bpmnEventMultipleInter.prototype.setWorkflow=function(_40c5){ -VectorFigure.prototype.setWorkflow.call(this,_40c5); -if(_40c5!=null){ - var eventPortName = ['input1','input2','output1','output2']; - var eventPortType = ['InputPort','InputPort','OutputPort','OutputPort']; - var eventPositionX= [0,this.width/2,this.width,this.width/2]; - var eventPositionY= [this.height/2,0,this.height/2,this.height]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } -} -}; - -bpmnEventMultipleInter.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; diff --git a/workflow/engine/templates/bpmn/EventRuleInter.js b/workflow/engine/templates/bpmn/EventRuleInter.js deleted file mode 100755 index c8b613749..000000000 --- a/workflow/engine/templates/bpmn/EventRuleInter.js +++ /dev/null @@ -1,83 +0,0 @@ -bpmnEventRuleInter=function(){ -VectorFigure.call(this); -//Setting width and height values as per the zoom ratio -if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined') - this.setDimension(workflow.zoomWidth, workflow.zoomHeight); -else - this.setDimension(30,30); -this.stroke = 2; -}; -bpmnEventRuleInter.prototype=new VectorFigure; -bpmnEventRuleInter.prototype.type="bpmnEventRuleInter"; -bpmnEventRuleInter.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); -var x_cir1=0; -var y_cir1=0; - -this.graphics.setColor("#c0c0c0"); -this.graphics.fillEllipse(x_cir1+3,y_cir1+3,this.getWidth(),this.getHeight()); - -this.graphics.setStroke(this.stroke); -this.graphics.setColor( "#f9faf2" ); -this.graphics.fillEllipse(x_cir1,y_cir1,this.getWidth(),this.getHeight()); -this.graphics.setColor("#adae5e"); -this.graphics.drawEllipse(x_cir1,y_cir1,this.getWidth(),this.getHeight()); -var x_cir2=3; -var y_cir2=3; -this.graphics.setColor( "#f9faf2" ); -this.graphics.fillEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6); -this.graphics.setColor("#adae5e"); -this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6); -var x=new Array(12,12,this.getWidth()-10,this.getWidth()-10); -var y=new Array(10,this.getHeight()-10,this.getHeight()-10,10); -//this.graphics.setColor("#adae5e"); -//this.graphics.fillPolygon(x,y); -this.graphics.setColor("#adae5e"); -this.graphics.drawPolygon(x,y); -this.graphics.drawLine(14,this.getHeight()/1.5,this.getWidth()-10,this.getHeight()/1.5); -this.graphics.drawLine(14,this.getHeight()/2,this.getWidth()-10,this.getHeight()/2); -this.graphics.drawLine(14,this.getHeight()/3,this.getWidth()-10,this.getHeight()/3); -this.graphics.drawLine(14,this.getHeight()/4,this.getWidth()-10,this.getHeight()/4); -this.graphics.paint(); - -/*Code Added to Dynamically shift Ports on resizing of shapes - **/ -if(this.input1!=null){ -this.input1.setPosition(0,this.height/2); -} -if(this.output1!=null){ -this.output1.setPosition(this.width/2,this.height); -} -if(this.input2!=null){ -this.input2.setPosition(this.width/2,0); -} -if(this.output2!=null){ -this.output2.setPosition(this.width,this.height/2); -} -}; - -bpmnEventRuleInter.prototype.setWorkflow=function(_40c5){ -VectorFigure.prototype.setWorkflow.call(this,_40c5); -if(_40c5!=null){ - var eventPortName = ['input1','input2','output1','output2']; - var eventPortType = ['InputPort','InputPort','OutputPort','OutputPort']; - var eventPositionX= [0,this.width/2,this.width,this.width/2]; - var eventPositionY= [this.height/2,0,this.height/2,this.height]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } -} -}; - -bpmnEventRuleInter.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; diff --git a/workflow/engine/templates/bpmn/EventRuleStart.js b/workflow/engine/templates/bpmn/EventRuleStart.js deleted file mode 100755 index ebed18558..000000000 --- a/workflow/engine/templates/bpmn/EventRuleStart.js +++ /dev/null @@ -1,77 +0,0 @@ -bpmnEventRuleStart=function(){ -VectorFigure.call(this); -//Setting width and height values as per the zoom ratio -if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined') - this.setDimension(workflow.zoomWidth, workflow.zoomHeight); -else - this.setDimension(30,30); -this.stroke = 2; -}; -bpmnEventRuleStart.prototype=new VectorFigure; -bpmnEventRuleStart.prototype.type="bpmnEventRuleStart"; -bpmnEventRuleStart.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); -var x_cir = 0; -var y_cir = 0; - -this.graphics.setColor("#c0c0c0"); -this.graphics.fillEllipse(x_cir+5,y_cir+5,this.getWidth(),this.getHeight()); -this.graphics.setStroke(this.stroke); -this.graphics.setColor( "#e4f7df"); -this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); -this.graphics.setColor("#4aa533"); -this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); -this.graphics.setStroke(1); -var x=new Array(12,12,this.getWidth()-10,this.getWidth()-10); -var y=new Array(10,this.getHeight()-10,this.getHeight()-10,10); -//this.graphics.setColor("#adae5e"); -//this.graphics.fillPolygon(x,y); -this.graphics.setColor("#4aa533"); -this.graphics.drawPolygon(x,y); -this.graphics.drawLine(14,this.getHeight()/1.5,this.getWidth()-10,this.getHeight()/1.5); -this.graphics.drawLine(14,this.getHeight()/2,this.getWidth()-10,this.getHeight()/2); -this.graphics.drawLine(14,this.getHeight()/3,this.getWidth()-10,this.getHeight()/3); -this.graphics.drawLine(14,this.getHeight()/4,this.getWidth()-10,this.getHeight()/4); -this.graphics.paint(); - -/*Code Added to Dynamically shift Ports on resizing of shapes - **/ -if(this.input1!=null){ -this.input1.setPosition(0,this.height/2); -} -if(this.output1!=null){ -this.output1.setPosition(this.width/2,this.height); -} -if(this.input2!=null){ -this.input2.setPosition(this.width/2,0); -} -if(this.output2!=null){ -this.output2.setPosition(this.width,this.height/2); -} -}; - -bpmnEventRuleStart.prototype.setWorkflow=function(_40c5){ -VectorFigure.prototype.setWorkflow.call(this,_40c5); -if(_40c5!=null){ - var eventPortName = ['output1','output2']; - var eventPortType = ['OutputPort','OutputPort']; - var eventPositionX= [this.width/2,this.width]; - var eventPositionY= [this.height,this.height/2]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } -} -}; - -bpmnEventRuleStart.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; diff --git a/workflow/engine/templates/bpmn/EventSignalStart.js b/workflow/engine/templates/bpmn/EventSignalStart.js deleted file mode 100755 index 1af578206..000000000 --- a/workflow/engine/templates/bpmn/EventSignalStart.js +++ /dev/null @@ -1,74 +0,0 @@ -bpmnEventSignalStart=function(){ -VectorFigure.call(this); -//Setting width and height values as per the zoom ratio -if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined') - this.setDimension(workflow.zoomWidth, workflow.zoomHeight); -else - this.setDimension(30,30); -this.stroke=2; -}; -bpmnEventSignalStart.prototype=new VectorFigure; -bpmnEventSignalStart.prototype.type="bpmnEventSignalStart"; -bpmnEventSignalStart.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); -var x=0; -var y=0; - -this.graphics.setColor("#c0c0c0"); -this.graphics.fillEllipse(x+5,y+5,this.getWidth(),this.getHeight()); -this.graphics.setStroke(this.stroke); -this.graphics.setColor( "#e4f7df" ); -this.graphics.fillEllipse(x,y,this.getWidth(),this.getHeight()); -this.graphics.setColor("#4aa533"); -this.graphics.drawEllipse(x,y,this.getWidth(),this.getHeight()); -//var x=new Array(5,41,23); -//var y=new Array(35,35,0); -var x=new Array(5,this.getWidth()-4,this.getWidth()/2); -var y=new Array(this.getHeight()-10,this.getHeight()-10,2); -this.graphics.setColor("#4aa533"); -//this.graphics.fillPolygon(x,y); -this.graphics.setColor("#4aa533"); -this.graphics.drawPolygon(x,y); -this.graphics.paint(); - -/*Code Added to Dynamically shift Ports on resizing of shapes - **/ -if(this.input1!=null){ -this.input1.setPosition(0,this.height/2); -} -if(this.output1!=null){ -this.output1.setPosition(this.width/2,this.height); -} -if(this.input2!=null){ -this.input2.setPosition(this.width/2,0); -} -if(this.output2!=null){ -this.output2.setPosition(this.width,this.height/2); -} -}; - -bpmnEventSignalStart.prototype.setWorkflow=function(_40c5){ -VectorFigure.prototype.setWorkflow.call(this,_40c5); -if(_40c5!=null){ - var eventPortName = ['output1','output2']; - var eventPortType = ['OutputPort','OutputPort']; - var eventPositionX= [this.width/2,this.width]; - var eventPositionY= [this.height,this.height/2]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } -} -}; - -bpmnEventSignalStart.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; diff --git a/workflow/engine/templates/bpmn/EventTerminateEnd.js b/workflow/engine/templates/bpmn/EventTerminateEnd.js deleted file mode 100755 index f5f23f41e..000000000 --- a/workflow/engine/templates/bpmn/EventTerminateEnd.js +++ /dev/null @@ -1,74 +0,0 @@ -bpmnEventTerminate=function(){ -VectorFigure.call(this); -//Setting width and height values as per the zoom ratio -if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined') - this.setDimension(workflow.zoomWidth, workflow.zoomHeight); -else - this.setDimension(30,30); -this.stroke=2; -}; -bpmnEventTerminate.prototype=new VectorFigure; -bpmnEventTerminate.prototype.type="bpmnEventTerminateEnd"; -bpmnEventTerminate.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); -VectorFigure.prototype.paint.call(this); -this.graphics.setStroke(this.stroke); -var x_cir = 0; -var y_cir = 0; - -this.graphics.setColor("#c0c0c0"); -this.graphics.fillEllipse(x_cir+5,y_cir+5,this.getWidth(),this.getHeight()); -this.graphics.setStroke(this.stroke); -this.graphics.setColor( "#f7f1e5" ); -this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); -this.graphics.setColor("#c46508"); -this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); -var x_cir2=5; -var y_cir2=5; -this.graphics.setColor("#c46508"); -this.graphics.fillEllipse(x_cir2,y_cir2,this.getWidth()-10,this.getHeight()-10); -this.graphics.setColor("#c46508"); -this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-10,this.getHeight()-10); -this.graphics.paint(); - -/*Code Added to Dynamically shift Ports on resizing of shapes - **/ -if(this.input1!=null){ -this.input1.setPosition(0,this.height/2); -} -if(this.output1!=null){ -this.output1.setPosition(this.width/2,this.height); -} -if(this.input2!=null){ -this.input2.setPosition(this.width/2,0); -} -if(this.output2!=null){ -this.output2.setPosition(this.width,this.height/2); -} -}; - -bpmnEventTerminate.prototype.setWorkflow=function(_40c5){ -VectorFigure.prototype.setWorkflow.call(this,_40c5); -if(_40c5!=null){ - var eventPortName = ['input1','input2']; - var eventPortType = ['InputPort','InputPort']; - var eventPositionX= [this.width/2,0]; - var eventPositionY= [0,this.height/2]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } - } -}; - -bpmnEventTerminate.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; diff --git a/workflow/engine/templates/bpmn/EventTimerInter.js b/workflow/engine/templates/bpmn/EventTimerInter.js deleted file mode 100755 index 28d22dad1..000000000 --- a/workflow/engine/templates/bpmn/EventTimerInter.js +++ /dev/null @@ -1,108 +0,0 @@ -bpmnEventTimerInter=function(){ -VectorFigure.call(this); -this.stroke = 1; -}; -bpmnEventTimerInter.prototype=new VectorFigure; -bpmnEventTimerInter.prototype.type="bpmnEventTimerInter"; -bpmnEventTimerInter.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); - -if(typeof workflow.zoomfactor == 'undefined') - workflow.zoomfactor = 1; - //Set the Task Limitation -if(typeof this.limitFlag == 'undefined' || this.limitFlag == false) -{ - this.originalWidth = 30; - this.originalHeight = 30; - this.orgXPos = this.getX(); - this.orgYPos = this.getY(); - this.orgFontSize =this.fontSize; -} - -this.width = this.originalWidth * workflow.zoomfactor; -this.height = this.originalHeight * workflow.zoomfactor; - -var cw = this.getWidth(); -var ch = this.getHeight(); - -var x_cir1=0; -var y_cir1=0; - -this.graphics.setColor("#c0c0c0"); -this.graphics.fillEllipse(x_cir1+3,y_cir1+3,this.getWidth(),this.getHeight()); - -this.graphics.setStroke(this.stroke); -this.graphics.setColor( "#f9faf2" ); -this.graphics.fillEllipse(x_cir1,y_cir1,this.getWidth(),this.getHeight()); -this.graphics.setColor("#adae5e"); -this.graphics.drawEllipse(x_cir1,y_cir1,this.getWidth(),this.getHeight()); -this.graphics.setStroke(this.stroke); -var x_cir2=3; -var y_cir2=3; -this.graphics.setColor( "#f9faf2" ); -this.graphics.fillEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6); -this.graphics.setColor("#adae5e"); -this.graphics.drawEllipse(cw*0.15, ch*0.15, ch*0.7, ch*0.7); -//var x_cir3=10; -//var y_cir3=10; -//this.graphics.setColor( "#f9faf2" ); -//this.graphics.fillEllipse(x_cir3,y_cir3,this.getWidth()-20,this.getHeight()-20); -this.graphics.setColor("#adae5e"); -//this.graphics.drawEllipse(x_cir3,y_cir3,this.getWidth()-20,this.getHeight()-20); - -//this.graphics.drawLine(cw*0.5,ch*0.5,cw*0.77,ch*0.5); -//this.graphics.drawLine(cw*0.5,ch*0.5,cw*0.5,ch*0.22); -this.graphics.drawLine( cw*0.56, ch*0.5, cw*0.43, ch*0.5); //horizontal -this.graphics.drawLine( cw*0.6, ch*0.3, cw*0.43, ch*0.5); - -this.graphics.drawLine(cw*0.73,ch*0.26,cw*0.66,ch*0.30); //10th min line -this.graphics.drawLine(cw*0.66,ch*0.50,cw*0.80,ch*0.50); //15th min line -this.graphics.drawLine(cw*0.60,ch*0.66,cw*0.73,ch*0.73); //25th min line -this.graphics.drawLine(cw*0.50,ch*0.83,cw*0.50,ch*0.70); //30th min line -this.graphics.drawLine(cw*0.23,ch*0.70,cw*0.36,ch*0.63); //40th min line -this.graphics.drawLine(cw*0.16,ch*0.50,cw*0.30,ch*0.50); //45th min line -this.graphics.drawLine(cw*0.26,ch*0.26,cw*0.36,ch*0.36); //50th min line -this.graphics.drawLine(cw*0.50,ch*0.16,cw*0.50,ch*0.26); //60th min line -this.graphics.paint(); - -/*Code Added to Dynamically shift Ports on resizing of shapes - **/ -if(this.input1!=null){ -this.input1.setPosition(0,this.height/2); -} -if(this.output1!=null){ -this.output1.setPosition(this.width/2,this.height); -} -if(this.input2!=null){ -this.input2.setPosition(this.width/2,0); -} -if(this.output2!=null){ -this.output2.setPosition(this.width,this.height/2); -} -}; - -bpmnEventTimerInter.prototype.setWorkflow=function(_40c5){ -VectorFigure.prototype.setWorkflow.call(this,_40c5); -if(_40c5!=null){ - var eventPortName = ['input1','input2','output1','output2']; - var eventPortType = ['InputPort','InputPort','OutputPort','OutputPort']; - var eventPositionX= [0,this.width/2,this.width,this.width/2]; - var eventPositionY= [this.height/2,0,this.height/2,this.height]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } -} -}; - -bpmnEventTimerInter.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; diff --git a/workflow/engine/templates/bpmn/EventTimerStart.js b/workflow/engine/templates/bpmn/EventTimerStart.js deleted file mode 100755 index e99d4768e..000000000 --- a/workflow/engine/templates/bpmn/EventTimerStart.js +++ /dev/null @@ -1,114 +0,0 @@ -bpmnEventTimerStart=function(){ - VectorFigure.call(this); -}; - -bpmnEventTimerStart.prototype=new VectorFigure; -bpmnEventTimerStart.prototype.type="bpmnEventTimerStart"; -bpmnEventTimerStart.prototype.paint=function(){ - VectorFigure.prototype.paint.call(this); - if(typeof workflow.zoomfactor == 'undefined') - workflow.zoomfactor = 1; - - //Set the Limitation - if(typeof this.limitFlag == 'undefined' || this.limitFlag == false) { - this.originalWidth = 30; - this.originalHeight = 30; - this.orgXPos = this.getX(); - this.orgYPos = this.getY(); - this.orgFontSize =this.fontSize; - } - this.width = this.originalWidth * workflow.zoomfactor; - this.height = this.originalHeight * workflow.zoomfactor; - - var x_cir = 0; - var y_cir = 0; - - //draw the circle - this.graphics.setColor("#d0d0d0"); - this.graphics.fillEllipse(x_cir+2,y_cir+2,this.getWidth(),this.getHeight()); - this.graphics.setColor( "#F6FFDA" ); - this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); - this.graphics.setStroke(1); - this.graphics.setColor("#97C759"); - this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); - this.graphics.setStroke(1); - this.graphics.setColor("#98C951"); - //this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight()); - - //draw the clock - var cw = this.getWidth(); - var ch = this.getHeight(); - this.graphics.setColor("#98C951"); - this.graphics.drawEllipse(cw*0.15, ch*0.15, ch*0.7, ch*0.7 ); - - var x = new Array( cw*0.60, cw*0.50, cw*0.75, 0.5); - var y = new Array( ch*0.31, ch*0.50, ch*0.50, 0.5); - this.graphics.setColor("#4aa533"); - //this.graphics.drawPolygon(x,y); - this.graphics.drawLine( cw*0.56, ch*0.5, cw*0.43, ch*0.5); //horizontal - this.graphics.drawLine( cw*0.6, ch*0.3, cw*0.43, ch*0.5); - - this.graphics.drawLine(cw*0.73,ch*0.26,cw*0.66,ch*0.30); //10th min line - this.graphics.drawLine(cw*0.66,ch*0.50,cw*0.80,ch*0.50); //15th min line - this.graphics.drawLine(cw*0.60,ch*0.66,cw*0.73,ch*0.73); //25th min line - this.graphics.drawLine(cw*0.50,ch*0.83,cw*0.50,ch*0.70); //30th min line - this.graphics.drawLine(cw*0.23,ch*0.70,cw*0.36,ch*0.63); //40th min line - this.graphics.drawLine(cw*0.16,ch*0.50,cw*0.30,ch*0.50); //45th min line - this.graphics.drawLine(cw*0.26,ch*0.26,cw*0.36,ch*0.36); //50th min line - this.graphics.drawLine(cw*0.50,ch*0.16,cw*0.50,ch*0.26); //60th min line -// this.graphics.drawLine(22,8,20,10); //10th min line -// this.graphics.drawLine(20,15,24,15); //15th min line -// this.graphics.drawLine(18,20,22,22); //25th min line -// this.graphics.drawLine(15,25,15,21); //30th min line -// this.graphics.drawLine(7,21,11,19); //40th min line -// this.graphics.drawLine(5,15,10,15); //45th min line -// this.graphics.drawLine(6,8,10,10); //50th min line -// this.graphics.drawLine(15,5,15,8); //60th min line - - - //this.graphics.setColor("#4aa533"); - //this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-10,this.getHeight()-10); - //this.graphics.drawLine(this.getWidth()/2,this.getHeight()/2,this.getWidth()/1.3,this.getHeight()/2); //horizontal line - //this.graphics.drawLine(this.getWidth()/2,this.getHeight()/2,this.getWidth()/2,this.getHeight()/4.5); //vertical line - this.graphics.paint(); - - //Code Added to Dynamically shift Ports on resizing of shapes/ - if(this.input1!=null){ - this.input1.setPosition(0,this.height/2); - } - if(this.output1!=null){ - this.output1.setPosition(this.width/2,this.height); - } - if(this.input2!=null){ - this.input2.setPosition(this.width/2,0); - } - if(this.output2!=null){ - this.output2.setPosition(this.width,this.height/2); - } -}; - -bpmnEventTimerStart.prototype.setWorkflow=function(_40c5){ -VectorFigure.prototype.setWorkflow.call(this,_40c5); -if(_40c5!=null){ - var eventPortName = ['output1','output2']; - var eventPortType = ['OutputPort','OutputPort']; - var eventPositionX= [this.width/2,this.width]; - var eventPositionY= [this.height,this.height/2]; - - for(var i=0; i< eventPortName.length ; i++){ - eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port - eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName - eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port - } -} -}; - -bpmnEventTimerStart.prototype.getContextMenu=function(){ -if(this.id != null){ - this.workflow.handleContextMenu(this); -} -}; diff --git a/workflow/engine/templates/bpmn/GatewayComplex.js b/workflow/engine/templates/bpmn/GatewayComplex.js deleted file mode 100755 index fb8e8582b..000000000 --- a/workflow/engine/templates/bpmn/GatewayComplex.js +++ /dev/null @@ -1,102 +0,0 @@ -bpmnGatewayComplex=function(width,_30ab){ - VectorFigure.call(this); - this.stroke =1; -}; - -bpmnGatewayComplex.prototype=new VectorFigure; -bpmnGatewayComplex.prototype.type="bpmnGatewayComplex"; -bpmnGatewayComplex.prototype.paint=function(){ - VectorFigure.prototype.paint.call(this); - if(typeof workflow.zoomfactor == 'undefined') - workflow.zoomfactor = 1; - - //Set the Task Limitation - if(typeof this.limitFlag == 'undefined' || this.limitFlag == false) - { - this.originalWidth = 40; - this.originalHeight = 40; - this.orgXPos = this.getX(); - this.orgYPos = this.getY(); - this.orgFontSize =this.fontSize; - } - - this.width = this.originalWidth * workflow.zoomfactor; - this.height = this.originalHeight * workflow.zoomfactor; - - var cw = this.getWidth(); - var ch = this.getHeight(); - var x=new Array(0,cw*0.5,cw,cw*0.5); - var y=new Array(ch*0.5,cw,cw*0.5,0); - //var x=new Array(0,this.width/2,this.width,this.width/2); - //var y=new Array(this.height/2,this.height,this.height/2,0); - - var x2 = new Array(); - var y2 = new Array(); - - for(var i=0;iThis class represents the primary interface of a component based grid control to represent data - * in a tabular format of rows and columns. The GridPanel is composed of the following:

- *
    - *
  • {@link Ext.data.Store Store} : The Model holding the data records (rows) - *
  • - *
  • {@link Ext.grid.ColumnModel Column model} : Column makeup - *
  • - *
  • {@link Ext.grid.GridView View} : Encapsulates the user interface - *
  • - *
  • {@link Ext.grid.AbstractSelectionModel selection model} : Selection behavior - *
  • - *
- *

Example usage:

- *

-var grid = new Ext.grid.GridPanel({
-    {@link #store}: new {@link Ext.data.Store}({
-        {@link Ext.data.Store#autoDestroy autoDestroy}: true,
-        {@link Ext.data.Store#reader reader}: reader,
-        {@link Ext.data.Store#data data}: xg.dummyData
-    }),
-    {@link #colModel}: new {@link Ext.grid.ColumnModel}({
-        {@link Ext.grid.ColumnModel#defaults defaults}: {
-            width: 120,
-            sortable: true
-        },
-        {@link Ext.grid.ColumnModel#columns columns}: [
-            {id: 'company', header: 'Company', width: 200, sortable: true, dataIndex: 'company'},
-            {header: 'Price', renderer: Ext.util.Format.usMoney, dataIndex: 'price'},
-            {header: 'Change', dataIndex: 'change'},
-            {header: '% Change', dataIndex: 'pctChange'},
-            // instead of specifying renderer: Ext.util.Format.dateRenderer('m/d/Y') use xtype
-            {
-                header: 'Last Updated', width: 135, dataIndex: 'lastChange',
-                xtype: 'datecolumn', format: 'M d, Y'
-            }
-        ],
-    }),
-    {@link #viewConfig}: {
-        {@link Ext.grid.GridView#forceFit forceFit}: true,
-
-//      Return CSS class to apply to rows depending upon data values
-        {@link Ext.grid.GridView#getRowClass getRowClass}: function(record, index) {
-            var c = record.{@link Ext.data.Record#get get}('change');
-            if (c < 0) {
-                return 'price-fall';
-            } else if (c > 0) {
-                return 'price-rise';
-            }
-        }
-    },
-    {@link #sm}: new Ext.grid.RowSelectionModel({singleSelect:true}),
-    width: 600,
-    height: 300,
-    frame: true,
-    title: 'Framed with Row Selection and Horizontal Scrolling',
-    iconCls: 'icon-grid'
-});
- * 
- *

Notes:

- *
    - *
  • Although this class inherits many configuration options from base classes, some of them - * (such as autoScroll, autoWidth, layout, items, etc) are not used by this class, and will - * have no effect.
  • - *
  • A grid requires a width in which to scroll its columns, and a height in which to - * scroll its rows. These dimensions can either be set explicitly through the - * {@link Ext.BoxComponent#height height} and {@link Ext.BoxComponent#width width} - * configuration options or implicitly set by using the grid as a child item of a - * {@link Ext.Container Container} which will have a {@link Ext.Container#layout layout manager} - * provide the sizing of its child items (for example the Container of the Grid may specify - * {@link Ext.Container#layout layout}:'fit').
  • - *
  • To access the data in a Grid, it is necessary to use the data model encapsulated - * by the {@link #store Store}. See the {@link #cellclick} event for more details.
  • - *
- * @constructor - * @param {Object} config The config object - * @xtype grid - */ -Ext.grid.GridPanel = Ext.extend(Ext.Panel, { - /** - * @cfg {String} autoExpandColumn - *

The {@link Ext.grid.Column#id id} of a {@link Ext.grid.Column column} in - * this grid that should expand to fill unused space. This value specified here can not - * be 0.

- *

Note: If the Grid's {@link Ext.grid.GridView view} is configured with - * {@link Ext.grid.GridView#forceFit forceFit}=true the autoExpandColumn - * is ignored. See {@link Ext.grid.Column}.{@link Ext.grid.Column#width width} - * for additional details.

- *

See {@link #autoExpandMax} and {@link #autoExpandMin} also.

- */ - autoExpandColumn : false, - /** - * @cfg {Number} autoExpandMax The maximum width the {@link #autoExpandColumn} - * can have (if enabled). Defaults to 1000. - */ - autoExpandMax : 1000, - /** - * @cfg {Number} autoExpandMin The minimum width the {@link #autoExpandColumn} - * can have (if enabled). Defaults to 50. - */ - autoExpandMin : 50, - /** - * @cfg {Boolean} columnLines true to add css for column separation lines. - * Default is false. - */ - columnLines : false, - /** - * @cfg {Object} cm Shorthand for {@link #colModel}. - */ - /** - * @cfg {Object} colModel The {@link Ext.grid.ColumnModel} to use when rendering the grid (required). - */ - /** - * @cfg {Array} columns An array of {@link Ext.grid.Column columns} to auto create a - * {@link Ext.grid.ColumnModel}. The ColumnModel may be explicitly created via the - * {@link #colModel} configuration property. - */ - /** - * @cfg {String} ddGroup The DD group this GridPanel belongs to. Defaults to 'GridDD' if not specified. - */ - /** - * @cfg {String} ddText - * Configures the text in the drag proxy. Defaults to: - *

-     * ddText : '{0} selected row{1}'
-     * 
- * {0} is replaced with the number of selected rows. - */ - ddText : '{0} selected row{1}', - /** - * @cfg {Boolean} deferRowRender

Defaults to true to enable deferred row rendering.

- *

This allows the GridPanel to be initially rendered empty, with the expensive update of the row - * structure deferred so that layouts with GridPanels appear more quickly.

- */ - deferRowRender : true, - /** - * @cfg {Boolean} disableSelection

true to disable selections in the grid. Defaults to false.

- *

Ignored if a {@link #selModel SelectionModel} is specified.

- */ - /** - * @cfg {Boolean} enableColumnResize false to turn off column resizing for the whole grid. Defaults to true. - */ - /** - * @cfg {Boolean} enableColumnHide - * Defaults to true to enable {@link Ext.grid.Column#hidden hiding of columns} - * with the {@link #enableHdMenu header menu}. - */ - enableColumnHide : true, - /** - * @cfg {Boolean} enableColumnMove Defaults to true to enable drag and drop reorder of columns. false - * to turn off column reordering via drag drop. - */ - enableColumnMove : true, - /** - * @cfg {Boolean} enableDragDrop

Enables dragging of the selected rows of the GridPanel. Defaults to false.

- *

Setting this to true causes this GridPanel's {@link #getView GridView} to - * create an instance of {@link Ext.grid.GridDragZone}. Note: this is available only after - * the Grid has been rendered as the GridView's {@link Ext.grid.GridView#dragZone dragZone} - * property.

- *

A cooperating {@link Ext.dd.DropZone DropZone} must be created who's implementations of - * {@link Ext.dd.DropZone#onNodeEnter onNodeEnter}, {@link Ext.dd.DropZone#onNodeOver onNodeOver}, - * {@link Ext.dd.DropZone#onNodeOut onNodeOut} and {@link Ext.dd.DropZone#onNodeDrop onNodeDrop} are able - * to process the {@link Ext.grid.GridDragZone#getDragData data} which is provided.

- */ - enableDragDrop : false, - /** - * @cfg {Boolean} enableHdMenu Defaults to true to enable the drop down button for menu in the headers. - */ - enableHdMenu : true, - /** - * @cfg {Boolean} hideHeaders True to hide the grid's header. Defaults to false. - */ - /** - * @cfg {Object} loadMask An {@link Ext.LoadMask} config or true to mask the grid while - * loading. Defaults to false. - */ - loadMask : false, - /** - * @cfg {Number} maxHeight Sets the maximum height of the grid - ignored if autoHeight is not on. - */ - /** - * @cfg {Number} minColumnWidth The minimum width a column can be resized to. Defaults to 25. - */ - minColumnWidth : 25, - /** - * @cfg {Object} sm Shorthand for {@link #selModel}. - */ - /** - * @cfg {Object} selModel Any subclass of {@link Ext.grid.AbstractSelectionModel} that will provide - * the selection model for the grid (defaults to {@link Ext.grid.RowSelectionModel} if not specified). - */ - /** - * @cfg {Ext.data.Store} store The {@link Ext.data.Store} the grid should use as its data source (required). - */ - /** - * @cfg {Boolean} stripeRows true to stripe the rows. Default is false. - *

This causes the CSS class x-grid3-row-alt to be added to alternate rows of - * the grid. A default CSS rule is provided which sets a background colour, but you can override this - * with a rule which either overrides the background-color style using the '!important' - * modifier, or which uses a CSS selector of higher specificity.

- */ - stripeRows : false, - /** - * @cfg {Boolean} trackMouseOver True to highlight rows when the mouse is over. Default is true - * for GridPanel, but false for EditorGridPanel. - */ - trackMouseOver : true, - /** - * @cfg {Array} stateEvents - * An array of events that, when fired, should trigger this component to save its state. - * Defaults to:

-     * stateEvents: ['columnmove', 'columnresize', 'sortchange', 'groupchange']
-     * 
- *

These can be any types of events supported by this component, including browser or - * custom events (e.g., ['click', 'customerchange']).

- *

See {@link Ext.Component#stateful} for an explanation of saving and restoring - * Component state.

- */ - stateEvents : ['columnmove', 'columnresize', 'sortchange', 'groupchange'], - /** - * @cfg {Object} view The {@link Ext.grid.GridView} used by the grid. This can be set - * before a call to {@link Ext.Component#render render()}. - */ - view : null, - - /** - * @cfg {Array} bubbleEvents - *

An array of events that, when fired, should be bubbled to any parent container. - * See {@link Ext.util.Observable#enableBubble}. - * Defaults to []. - */ - bubbleEvents: [], - - /** - * @cfg {Object} viewConfig A config object that will be applied to the grid's UI view. Any of - * the config options available for {@link Ext.grid.GridView} can be specified here. This option - * is ignored if {@link #view} is specified. - */ - - // private - rendered : false, - // private - viewReady : false, - - // private - initComponent : function(){ - Ext.grid.GridPanel.superclass.initComponent.call(this); - - if(this.columnLines){ - this.cls = (this.cls || '') + ' x-grid-with-col-lines'; - } - // override any provided value since it isn't valid - // and is causing too many bug reports ;) - this.autoScroll = false; - this.autoWidth = false; - - if(Ext.isArray(this.columns)){ - this.colModel = new Ext.grid.ColumnModel(this.columns); - delete this.columns; - } - - // check and correct shorthanded configs - if(this.ds){ - this.store = this.ds; - delete this.ds; - } - if(this.cm){ - this.colModel = this.cm; - delete this.cm; - } - if(this.sm){ - this.selModel = this.sm; - delete this.sm; - } - this.store = Ext.StoreMgr.lookup(this.store); - - this.addEvents( - // raw events - /** - * @event click - * The raw click event for the entire grid. - * @param {Ext.EventObject} e - */ - 'click', - /** - * @event dblclick - * The raw dblclick event for the entire grid. - * @param {Ext.EventObject} e - */ - 'dblclick', - /** - * @event contextmenu - * The raw contextmenu event for the entire grid. - * @param {Ext.EventObject} e - */ - 'contextmenu', - /** - * @event mousedown - * The raw mousedown event for the entire grid. - * @param {Ext.EventObject} e - */ - 'mousedown', - /** - * @event mouseup - * The raw mouseup event for the entire grid. - * @param {Ext.EventObject} e - */ - 'mouseup', - /** - * @event mouseover - * The raw mouseover event for the entire grid. - * @param {Ext.EventObject} e - */ - 'mouseover', - /** - * @event mouseout - * The raw mouseout event for the entire grid. - * @param {Ext.EventObject} e - */ - 'mouseout', - /** - * @event keypress - * The raw keypress event for the entire grid. - * @param {Ext.EventObject} e - */ - 'keypress', - /** - * @event keydown - * The raw keydown event for the entire grid. - * @param {Ext.EventObject} e - */ - 'keydown', - - // custom events - /** - * @event cellmousedown - * Fires before a cell is clicked - * @param {Grid} this - * @param {Number} rowIndex - * @param {Number} columnIndex - * @param {Ext.EventObject} e - */ - 'cellmousedown', - /** - * @event rowmousedown - * Fires before a row is clicked - * @param {Grid} this - * @param {Number} rowIndex - * @param {Ext.EventObject} e - */ - 'rowmousedown', - /** - * @event headermousedown - * Fires before a header is clicked - * @param {Grid} this - * @param {Number} columnIndex - * @param {Ext.EventObject} e - */ - 'headermousedown', - - /** - * @event groupmousedown - * Fires before a group header is clicked. Only applies for grids with a {@link Ext.grid.GroupingView GroupingView}. - * @param {Grid} this - * @param {String} groupField - * @param {String} groupValue - * @param {Ext.EventObject} e - */ - 'groupmousedown', - - /** - * @event rowbodymousedown - * Fires before the row body is clicked. Only applies for grids with {@link Ext.grid.GridView#enableRowBody enableRowBody} configured. - * @param {Grid} this - * @param {Number} rowIndex - * @param {Ext.EventObject} e - */ - 'rowbodymousedown', - - /** - * @event containermousedown - * Fires before the container is clicked. The container consists of any part of the grid body that is not covered by a row. - * @param {Grid} this - * @param {Ext.EventObject} e - */ - 'containermousedown', - - /** - * @event cellclick - * Fires when a cell is clicked. - * The data for the cell is drawn from the {@link Ext.data.Record Record} - * for this row. To access the data in the listener function use the - * following technique: - *


-function(grid, rowIndex, columnIndex, e) {
-    var record = grid.getStore().getAt(rowIndex);  // Get the Record
-    var fieldName = grid.getColumnModel().getDataIndex(columnIndex); // Get field name
-    var data = record.get(fieldName);
-}
-
- * @param {Grid} this - * @param {Number} rowIndex - * @param {Number} columnIndex - * @param {Ext.EventObject} e - */ - 'cellclick', - /** - * @event celldblclick - * Fires when a cell is double clicked - * @param {Grid} this - * @param {Number} rowIndex - * @param {Number} columnIndex - * @param {Ext.EventObject} e - */ - 'celldblclick', - /** - * @event rowclick - * Fires when a row is clicked - * @param {Grid} this - * @param {Number} rowIndex - * @param {Ext.EventObject} e - */ - 'rowclick', - /** - * @event rowdblclick - * Fires when a row is double clicked - * @param {Grid} this - * @param {Number} rowIndex - * @param {Ext.EventObject} e - */ - 'rowdblclick', - /** - * @event headerclick - * Fires when a header is clicked - * @param {Grid} this - * @param {Number} columnIndex - * @param {Ext.EventObject} e - */ - 'headerclick', - /** - * @event headerdblclick - * Fires when a header cell is double clicked - * @param {Grid} this - * @param {Number} columnIndex - * @param {Ext.EventObject} e - */ - 'headerdblclick', - /** - * @event groupclick - * Fires when group header is clicked. Only applies for grids with a {@link Ext.grid.GroupingView GroupingView}. - * @param {Grid} this - * @param {String} groupField - * @param {String} groupValue - * @param {Ext.EventObject} e - */ - 'groupclick', - /** - * @event groupdblclick - * Fires when group header is double clicked. Only applies for grids with a {@link Ext.grid.GroupingView GroupingView}. - * @param {Grid} this - * @param {String} groupField - * @param {String} groupValue - * @param {Ext.EventObject} e - */ - 'groupdblclick', - /** - * @event containerclick - * Fires when the container is clicked. The container consists of any part of the grid body that is not covered by a row. - * @param {Grid} this - * @param {Ext.EventObject} e - */ - 'containerclick', - /** - * @event containerdblclick - * Fires when the container is double clicked. The container consists of any part of the grid body that is not covered by a row. - * @param {Grid} this - * @param {Ext.EventObject} e - */ - 'containerdblclick', - - /** - * @event rowbodyclick - * Fires when the row body is clicked. Only applies for grids with {@link Ext.grid.GridView#enableRowBody enableRowBody} configured. - * @param {Grid} this - * @param {Number} rowIndex - * @param {Ext.EventObject} e - */ - 'rowbodyclick', - /** - * @event rowbodydblclick - * Fires when the row body is double clicked. Only applies for grids with {@link Ext.grid.GridView#enableRowBody enableRowBody} configured. - * @param {Grid} this - * @param {Number} rowIndex - * @param {Ext.EventObject} e - */ - 'rowbodydblclick', - - /** - * @event rowcontextmenu - * Fires when a row is right clicked - * @param {Grid} this - * @param {Number} rowIndex - * @param {Ext.EventObject} e - */ - 'rowcontextmenu', - /** - * @event cellcontextmenu - * Fires when a cell is right clicked - * @param {Grid} this - * @param {Number} rowIndex - * @param {Number} cellIndex - * @param {Ext.EventObject} e - */ - 'cellcontextmenu', - /** - * @event headercontextmenu - * Fires when a header is right clicked - * @param {Grid} this - * @param {Number} columnIndex - * @param {Ext.EventObject} e - */ - 'headercontextmenu', - /** - * @event groupcontextmenu - * Fires when group header is right clicked. Only applies for grids with a {@link Ext.grid.GroupingView GroupingView}. - * @param {Grid} this - * @param {String} groupField - * @param {String} groupValue - * @param {Ext.EventObject} e - */ - 'groupcontextmenu', - /** - * @event containercontextmenu - * Fires when the container is right clicked. The container consists of any part of the grid body that is not covered by a row. - * @param {Grid} this - * @param {Ext.EventObject} e - */ - 'containercontextmenu', - /** - * @event rowbodycontextmenu - * Fires when the row body is right clicked. Only applies for grids with {@link Ext.grid.GridView#enableRowBody enableRowBody} configured. - * @param {Grid} this - * @param {Number} rowIndex - * @param {Ext.EventObject} e - */ - 'rowbodycontextmenu', - /** - * @event bodyscroll - * Fires when the body element is scrolled - * @param {Number} scrollLeft - * @param {Number} scrollTop - */ - 'bodyscroll', - /** - * @event columnresize - * Fires when the user resizes a column - * @param {Number} columnIndex - * @param {Number} newSize - */ - 'columnresize', - /** - * @event columnmove - * Fires when the user moves a column - * @param {Number} oldIndex - * @param {Number} newIndex - */ - 'columnmove', - /** - * @event sortchange - * Fires when the grid's store sort changes - * @param {Grid} this - * @param {Object} sortInfo An object with the keys field and direction - */ - 'sortchange', - /** - * @event groupchange - * Fires when the grid's grouping changes (only applies for grids with a {@link Ext.grid.GroupingView GroupingView}) - * @param {Grid} this - * @param {String} groupField A string with the grouping field, null if the store is not grouped. - */ - 'groupchange', - /** - * @event reconfigure - * Fires when the grid is reconfigured with a new store and/or column model. - * @param {Grid} this - * @param {Ext.data.Store} store The new store - * @param {Ext.grid.ColumnModel} colModel The new column model - */ - 'reconfigure', - /** - * @event viewready - * Fires when the grid view is available (use this for selecting a default row). - * @param {Grid} this - */ - 'viewready' - ); - }, - - // private - onRender : function(ct, position){ - Ext.grid.GridPanel.superclass.onRender.apply(this, arguments); - - var c = this.getGridEl(); - - this.el.addClass('x-grid-panel'); - - this.mon(c, { - scope: this, - mousedown: this.onMouseDown, - click: this.onClick, - dblclick: this.onDblClick, - contextmenu: this.onContextMenu - }); - - this.relayEvents(c, ['mousedown','mouseup','mouseover','mouseout','keypress', 'keydown']); - - var view = this.getView(); - view.init(this); - view.render(); - this.getSelectionModel().init(this); - }, - - // private - initEvents : function(){ - Ext.grid.GridPanel.superclass.initEvents.call(this); - - if(this.loadMask){ - this.loadMask = new Ext.LoadMask(this.bwrap, - Ext.apply({store:this.store}, this.loadMask)); - } - }, - - initStateEvents : function(){ - Ext.grid.GridPanel.superclass.initStateEvents.call(this); - this.mon(this.colModel, 'hiddenchange', this.saveState, this, {delay: 100}); - }, - - applyState : function(state){ - var cm = this.colModel, - cs = state.columns, - store = this.store, - s, - c, - oldIndex; - - if(cs){ - for(var i = 0, len = cs.length; i < len; i++){ - s = cs[i]; - c = cm.getColumnById(s.id); - if(c){ - c.hidden = s.hidden; - c.width = s.width; - oldIndex = cm.getIndexById(s.id); - if(oldIndex != i){ - cm.moveColumn(oldIndex, i); - } - } - } - } - if(store){ - s = state.sort; - if(s){ - store[store.remoteSort ? 'setDefaultSort' : 'sort'](s.field, s.direction); - } - s = state.group; - if(store.groupBy){ - if(s){ - store.groupBy(s); - }else{ - store.clearGrouping(); - } - } - - } - var o = Ext.apply({}, state); - delete o.columns; - delete o.sort; - Ext.grid.GridPanel.superclass.applyState.call(this, o); - }, - - getState : function(){ - var o = {columns: []}, - store = this.store, - ss, - gs; - - for(var i = 0, c; (c = this.colModel.config[i]); i++){ - o.columns[i] = { - id: c.id, - width: c.width - }; - if(c.hidden){ - o.columns[i].hidden = true; - } - } - if(store){ - ss = store.getSortState(); - if(ss){ - o.sort = ss; - } - if(store.getGroupState){ - gs = store.getGroupState(); - if(gs){ - o.group = gs; - } - } - } - return o; - }, - - // private - afterRender : function(){ - Ext.grid.GridPanel.superclass.afterRender.call(this); - var v = this.view; - this.on('bodyresize', v.layout, v); - v.layout(); - if(this.deferRowRender){ - if (!this.deferRowRenderTask){ - this.deferRowRenderTask = new Ext.util.DelayedTask(v.afterRender, this.view); - } - this.deferRowRenderTask.delay(10); - }else{ - v.afterRender(); - } - this.viewReady = true; - }, - - /** - *

Reconfigures the grid to use a different Store and Column Model - * and fires the 'reconfigure' event. The View will be bound to the new - * objects and refreshed.

- *

Be aware that upon reconfiguring a GridPanel, certain existing settings may become - * invalidated. For example the configured {@link #autoExpandColumn} may no longer exist in the - * new ColumnModel. Also, an existing {@link Ext.PagingToolbar PagingToolbar} will still be bound - * to the old Store, and will need rebinding. Any {@link #plugins} might also need reconfiguring - * with the new data.

- * @param {Ext.data.Store} store The new {@link Ext.data.Store} object - * @param {Ext.grid.ColumnModel} colModel The new {@link Ext.grid.ColumnModel} object - */ - reconfigure : function(store, colModel){ - var rendered = this.rendered; - if(rendered){ - if(this.loadMask){ - this.loadMask.destroy(); - this.loadMask = new Ext.LoadMask(this.bwrap, - Ext.apply({}, {store:store}, this.initialConfig.loadMask)); - } - } - if(this.view){ - this.view.initData(store, colModel); - } - this.store = store; - this.colModel = colModel; - if(rendered){ - this.view.refresh(true); - } - this.fireEvent('reconfigure', this, store, colModel); - }, - - // private - onDestroy : function(){ - if (this.deferRowRenderTask && this.deferRowRenderTask.cancel){ - this.deferRowRenderTask.cancel(); - } - if(this.rendered){ - Ext.destroy(this.view, this.loadMask); - }else if(this.store && this.store.autoDestroy){ - this.store.destroy(); - } - Ext.destroy(this.colModel, this.selModel); - this.store = this.selModel = this.colModel = this.view = this.loadMask = null; - Ext.grid.GridPanel.superclass.onDestroy.call(this); - }, - - // private - processEvent : function(name, e){ - this.view.processEvent(name, e); - }, - - // private - onClick : function(e){ - this.processEvent('click', e); - }, - - // private - onMouseDown : function(e){ - this.processEvent('mousedown', e); - }, - - // private - onContextMenu : function(e, t){ - this.processEvent('contextmenu', e); - }, - - // private - onDblClick : function(e){ - this.processEvent('dblclick', e); - }, - - // private - walkCells : function(row, col, step, fn, scope){ - var cm = this.colModel, - clen = cm.getColumnCount(), - ds = this.store, - rlen = ds.getCount(), - first = true; - - if(step < 0){ - if(col < 0){ - row--; - first = false; - } - while(row >= 0){ - if(!first){ - col = clen-1; - } - first = false; - while(col >= 0){ - if(fn.call(scope || this, row, col, cm) === true){ - return [row, col]; - } - col--; - } - row--; - } - } else { - if(col >= clen){ - row++; - first = false; - } - while(row < rlen){ - if(!first){ - col = 0; - } - first = false; - while(col < clen){ - if(fn.call(scope || this, row, col, cm) === true){ - return [row, col]; - } - col++; - } - row++; - } - } - return null; - }, - - /** - * Returns the grid's underlying element. - * @return {Element} The element - */ - getGridEl : function(){ - return this.body; - }, - - // private for compatibility, overridden by editor grid - stopEditing : Ext.emptyFn, - - /** - * Returns the grid's selection model configured by the {@link #selModel} - * configuration option. If no selection model was configured, this will create - * and return a {@link Ext.grid.RowSelectionModel RowSelectionModel}. - * @return {SelectionModel} - */ - getSelectionModel : function(){ - if(!this.selModel){ - this.selModel = new Ext.grid.RowSelectionModel( - this.disableSelection ? {selectRow: Ext.emptyFn} : null); - } - return this.selModel; - }, - - /** - * Returns the grid's data store. - * @return {Ext.data.Store} The store - */ - getStore : function(){ - return this.store; - }, - - /** - * Returns the grid's ColumnModel. - * @return {Ext.grid.ColumnModel} The column model - */ - getColumnModel : function(){ - return this.colModel; - }, - - /** - * Returns the grid's GridView object. - * @return {Ext.grid.GridView} The grid view - */ - getView : function(){ - if(!this.view){ - this.view = new Ext.grid.GridView(this.viewConfig); - } - return this.view; - }, - /** - * Called to get grid's drag proxy text, by default returns this.ddText. - * @return {String} The text - */ - getDragDropText : function(){ - var count = this.selModel.getCount(); - return String.format(this.ddText, count, count == 1 ? '' : 's'); - } - - /** - * @cfg {String/Number} activeItem - * @hide - */ - /** - * @cfg {Boolean} autoDestroy - * @hide - */ - /** - * @cfg {Object/String/Function} autoLoad - * @hide - */ - /** - * @cfg {Boolean} autoWidth - * @hide - */ - /** - * @cfg {Boolean/Number} bufferResize - * @hide - */ - /** - * @cfg {String} defaultType - * @hide - */ - /** - * @cfg {Object} defaults - * @hide - */ - /** - * @cfg {Boolean} hideBorders - * @hide - */ - /** - * @cfg {Mixed} items - * @hide - */ - /** - * @cfg {String} layout - * @hide - */ - /** - * @cfg {Object} layoutConfig - * @hide - */ - /** - * @cfg {Boolean} monitorResize - * @hide - */ - /** - * @property items - * @hide - */ - /** - * @method add - * @hide - */ - /** - * @method cascade - * @hide - */ - /** - * @method doLayout - * @hide - */ - /** - * @method find - * @hide - */ - /** - * @method findBy - * @hide - */ - /** - * @method findById - * @hide - */ - /** - * @method findByType - * @hide - */ - /** - * @method getComponent - * @hide - */ - /** - * @method getLayout - * @hide - */ - /** - * @method getUpdater - * @hide - */ - /** - * @method insert - * @hide - */ - /** - * @method load - * @hide - */ - /** - * @method remove - * @hide - */ - /** - * @event add - * @hide - */ - /** - * @event afterlayout - * @hide - */ - /** - * @event beforeadd - * @hide - */ - /** - * @event beforeremove - * @hide - */ - /** - * @event remove - * @hide - */ - - - - /** - * @cfg {String} allowDomMove @hide - */ - /** - * @cfg {String} autoEl @hide - */ - /** - * @cfg {String} applyTo @hide - */ - /** - * @cfg {String} autoScroll @hide - */ - /** - * @cfg {String} bodyBorder @hide - */ - /** - * @cfg {String} bodyStyle @hide - */ - /** - * @cfg {String} contentEl @hide - */ - /** - * @cfg {String} disabledClass @hide - */ - /** - * @cfg {String} elements @hide - */ - /** - * @cfg {String} html @hide - */ - /** - * @cfg {Boolean} preventBodyReset - * @hide - */ - /** - * @property disabled - * @hide - */ - /** - * @method applyToMarkup - * @hide - */ - /** - * @method enable - * @hide - */ - /** - * @method disable - * @hide - */ - /** - * @method setDisabled - * @hide - */ -}); -Ext.reg('grid', Ext.grid.GridPanel); \ No newline at end of file diff --git a/workflow/engine/templates/bpmn/Lane.js b/workflow/engine/templates/bpmn/Lane.js deleted file mode 100755 index bd1b12a80..000000000 --- a/workflow/engine/templates/bpmn/Lane.js +++ /dev/null @@ -1,36 +0,0 @@ -bpmnLane = function (_30ab) { - VectorFigure.call(this); - this.setDimension(500, 300); - // this.setTaskName(_30ab.taskNo); //It will set the Default Task Name with appropriate count While dragging a task on the canvas -}; - -bpmnLane.prototype = new VectorFigure; -bpmnLane.prototype.type = "bpmnLane"; -bpmnLane.prototype.setTaskName = function (name) { - this.taskName = 'Data Object ' + name; -}; - -bpmnLane.prototype.paint = function () { - VectorFigure.prototype.paint.call(this); - var x = new Array(0, this.getWidth(), this.getWidth(), 0); - var y = new Array(0, 0, this.getHeight(), this.getHeight()); - - this.graphics.setStroke(this.stroke); - this.graphics.setColor("#c0c0c0"); - this.graphics.fillPolygon(x, y); - - for (var i = 0; i < x.length; i++) { - x[i] = x[i] - 3; - y[i] = y[i] - 3; - } - this.graphics.setColor("#ffffff"); - this.graphics.fillPolygon(x, y); - this.graphics.setColor("#ff0f0f"); - this.graphics.drawPolygon(x, y); - this.graphics.drawLine(45, 0-3, 45, this.getHeight()-3); - this.graphics.drawLine(90, 0-3, 90, this.getHeight()-3); - this.graphics.drawLine(45, 150-3, this.getWidth()-3, 150-3); - this.graphics.paint(); - this.x_text = this.workflow.getAbsoluteX(); //Get x co-ordinate from figure - this.y_text = this.workflow.getAbsoluteY(); //Get x co-ordinate from figure -} diff --git a/workflow/engine/templates/bpmn/LoopingSubProcess.js b/workflow/engine/templates/bpmn/LoopingSubProcess.js deleted file mode 100755 index af7cae056..000000000 --- a/workflow/engine/templates/bpmn/LoopingSubProcess.js +++ /dev/null @@ -1,105 +0,0 @@ -bpmnLoopingSubProcess=function(_30ab){ -VectorFigure.call(this); -this.setDimension(110,60); -this.setTaskName(_30ab); //It will set the Default Task Name with appropriate count While dragging a task on the canvas -}; - -bpmnLoopingSubProcess.prototype=new VectorFigure; -bpmnLoopingSubProcess.prototype.type="bpmnLoopingSubProcess"; -bpmnLoopingSubProcess.prototype.setTaskName=function(name){ -this.taskName = 'Task '+name; -}; -bpmnLoopingSubProcess.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); -var x=new Array(6, this.getWidth()-3, this.getWidth(), this.getWidth(), this.getWidth()-3, 6, 3, 3, 6); -var y=new Array(3, 3, 6, this.getHeight()-3, this.getHeight(), this.getHeight(), this.getHeight()-3, 6, 3); -this.graphics.setStroke(this.stroke); -this.graphics.setColor( "#c0c0c0" ); -this.graphics.fillPolygon(x,y); - -for(var i=0;i - * The string is first cleared and new string is painted.

-**/ -bpmnLoopingSubProcess.prototype.onOk=function(){ - this.figure.bpmnNewText.clear(); - //this.figure.bpmnNewText.drawStringRect(this.input.value,this.workflow.currentSelection.width/2-30,this.workflow.currentSelection.height/2-10,200,'left'); - this.figure.bpmnNewText.drawString(this.input.value,this.workflow.currentSelection.width/2.5,this.workflow.currentSelection.height/2.5); - this.figure.bpmnNewText.paint(); - this.figure.taskName = this.input.value; //Set Updated Text value - this.workflow.removeFigure(this); -}; \ No newline at end of file diff --git a/workflow/engine/templates/bpmn/LoopingTask.js b/workflow/engine/templates/bpmn/LoopingTask.js deleted file mode 100755 index b7271081c..000000000 --- a/workflow/engine/templates/bpmn/LoopingTask.js +++ /dev/null @@ -1,46 +0,0 @@ -bpmnLoopingTask=function(_30ab){ -VectorFigure.call(this); -this.setDimension(110,60); -this.setTaskName(_30ab); //It will set the Default Task Name with appropriate count While dragging a task on the canvas -}; - -bpmnLoopingTask.prototype=new VectorFigure; -bpmnLoopingTask.prototype.type="bpmnLoopingTask"; -bpmnLoopingTask.prototype.setTaskName=function(name){ -this.taskName = 'Task '+name; -}; - -bpmnLoopingTask.prototype.paint=function(){ -VectorFigure.prototype.paint.call(this); - -var x_subtask=new Array(6, this.getWidth()-3, this.getWidth(), this.getWidth(), this.getWidth()-3, 6, 3, 3, 6); -var y_subtask=new Array(3, 3, 6, this.getHeight()-3, this.getHeight(), this.getHeight(), this.getHeight()-3, 6, 3); -var x_subtask=new Array(6,125,128,128,125,6,3,3,6); -var y_subtask=new Array(3,3,6,87,90,90,87,6,3); -this.graphics.setStroke(this.stroke); -this.graphics.setColor( "#c0c0c0" ); -this.graphics.fillPolygon(x_subtask,y_subtask); -for(var i=0;i 1300 - oShape.width) { - workflow.main.setWidth(oShape.x+150); - } - //Top Border - if (oShape.y < 20) { - oShape.y = 20; - } - //Bottom Border - if (oShape.y > 1000 - oShape.height) { - workflow.main.setHeight(oShape.y+75); - } -} - -/** - * ExtJS Form on Right Click of Task - * @Param Shape Object - * @Author Safan Maredia - */ -MyWorkflow.prototype.AddTaskContextMenu= function(oShape) -{ - var taskExtObj = new TaskContext(); - if (oShape.id != null) { - this.canvasTask = Ext.get(oShape.id); - this.contextTaskmenu = new Ext.menu.Menu({ - items: [ -/* - { - text: 'Steps', - iconCls: 'button_menu_ext ss_sprite ss_shape_move_forwards', - handler: taskExtObj.editTaskSteps, - scope: oShape - }, - { - text: 'Users & Users Group', - iconCls: 'button_menu_ext ss_sprite ss_group', - handler: taskExtObj.editUsers, - scope: oShape - }, - { - text: 'Users & Users Groups (ad-hoc)', - iconCls: 'button_menu_ext ss_sprite ss_group', - handler: taskExtObj.editUsersAdHoc, - scope: oShape - }, -*/ - { - text: 'Transform To', - iconCls: 'button_menu_ext ss_sprite ss_page_refresh', - menu: { // <-- submenu by nested config object - items: [ - // stick any markup in a menu - { - text: 'Sub Process', - iconCls: 'button_menu_ext ss_sprite ss_layout_link', - type:'bpmnSubProcess', - scope:oShape, - handler: MyWorkflow.prototype.toggleShapes - } - ] - }, - scope: this - }, - { - text: 'Attach Event', - iconCls: 'button_menu_ext ss_sprite ss_link', - menu: { // <-- submenu by nested config object - items: [ - // stick any markup in a menu - { - text: 'Timer Boundary Event', - iconCls: 'button_menu_ext ss_sprite ss_clock', - type:'bpmnEventBoundaryTimerInter', - scope:oShape, - handler: MyWorkflow.prototype.toggleShapes - } - ] - }, - scope: this - } -/* , - { - text: 'Properties', - handler: taskExtObj.editTaskProperties, - scope: oShape - } -*/ - ] - }); - } - - this.canvasTask.on('contextmenu', function (e) { - e.stopEvent(); - this.contextTaskmenu.showAt(e.getXY()); - }, this); - -} - -/** - * ExtJS Menu on Right Click of Connection - * @Param Shape Object - * @Author Girish Joshi - */ -MyWorkflow.prototype.connectionContextMenu=function(oShape) -{ - this.canvasEvent = Ext.get(oShape.id); - this.contextEventmenu = new Ext.menu.Menu({ - items: [{ - text: 'Straight Line', - iconCls: 'button_menu_ext ss_sprite ss_bullet_white ', - scope: this, - handler: MyWorkflow.prototype.toggleConnection - }, { - text: 'Curvy Line', - scope: this, - iconCls: 'button_menu_ext ss_sprite ss_vector', - handler: MyWorkflow.prototype.toggleConnection - }, { - text: 'Angled Line', - scope: this, - iconCls: 'button_menu_ext ss_sprite ss_bullet_white ', - handler: MyWorkflow.prototype.toggleConnection - }, { - text: 'Delete Line', - iconCls: 'button_menu_ext ss_sprite ss_delete', - scope: this, - handler:function() - { - MyWorkflow.prototype.deleteRoute(oShape.workflow.currentSelection,0) - } - }] - }); - - this.canvasEvent.on('contextmenu', function(e) { - e.stopEvent(); - this.contextEventmenu.showAt(e.getXY()); - }, this); -} - -/** - * Draw2d Functionality of Changing the routers - * @Param Shape Object - * @Author Girish Joshi - */ -MyWorkflow.prototype.toggleConnection=function(oShape) -{ - this.currentSelection.workflow.contextClicked = false; - switch (oShape.text) { - case 'NULL Router': - this.currentSelection.setRouter(null); - break; - case 'Angled Line': - this.currentSelection.setRouter(new ManhattanConnectionRouter()); - break; - case 'Curvy Line': - this.currentSelection.setRouter(new BezierConnectionRouter()); - break; - case 'Straight Line': - this.currentSelection.setRouter(new FanConnectionRouter()); - break; - case 'Delete Line': - this.currentSelection.workflow.getCommandStack().execute(new CommandDelete(this.currentSelection.workflow.getCurrentSelection())); - ToolGeneric.prototype.execute.call(this); - break; - } -} - -/** - * Draw2d Functionality of Adding Port to Gateways - * @Param Shape Object - * @Author Girish Joshi - */ -MyWorkflow.prototype.AddGatewayPorts = function(_40c5) -{ - var TaskPortName = ['inputPort1','inputPort2','outputPort1','outputPort2','outputPort3']; - var TaskPortType = ['InputPort','InputPort','OutputPort','OutputPort','OutputPort']; - var TaskPositionX= [0,_40c5.width/2,_40c5.width,_40c5.width/2, 0]; - var TaskPositionY= [_40c5.height/2,0,_40c5.height/2,_40c5.Height, _40c5.height/2 + 10]; - - for(var i=0; i< TaskPortName.length ; i++){ - eval('_40c5.'+TaskPortName[i]+' = new '+TaskPortType[i]+'()'); //Create New Port - eval('_40c5.'+TaskPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('_40c5.'+TaskPortName[i]+'.setName("'+TaskPortName[i]+'")'); //Set PortName - eval('_40c5.'+TaskPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('_40c5.'+TaskPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('_40c5.'+TaskPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - this.workflow = _40c5.workflow; - this.workflow.currentSelection =_40c5; - eval('_40c5.addPort(_40c5.'+TaskPortName[i]+','+TaskPositionX[i]+', '+TaskPositionY[i]+')'); //Setting Position of the port - } -} -/** - * ExtJs Form on right Click of Gateways - * @Param Shape Object - * @Author Girish Joshi - */ -MyWorkflow.prototype.AddGatewayContextMenu=function(_4092) -{ - this.canvasGateway = Ext.get(_4092.id); - this.contextGatewaymenu = new Ext.menu.Menu({ - items: [{ - text: 'Gateway Type', - menu: { // <-- submenu by nested config object - items: [ - // stick any markup in a menu - { - text: 'Exclusive Gateway', - type:'bpmnGatewayExclusiveData', - scope:_4092, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Inclusive Gateway', - type:'bpmnGatewayInclusive', - scope:_4092, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Parallel Gateway', - type:'bpmnGatewayParallel', - scope:_4092, - handler: MyWorkflow.prototype.toggleShapes - } -/* , { - text: 'Complex Gateway', - type:'bpmnGatewayComplex', - scope:_4092, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Event Based Gateway', - type:'bpmnGatewayExclusiveEvent', - scope:_4092, - handler: MyWorkflow.prototype.toggleShapes - } -*/ - ] - }, - scope: this - },{ - text: 'Properties', - handler: this.editGatewayProperties, - scope: this - }] - }); - -this.canvasGateway.on('contextmenu', function(e) { - e.stopEvent(); - this.contextGatewaymenu.showAt(e.getXY()); -}, this); -} - -/** - * ExtJs Menu on right Click of SubProcess - * @Param Shape Object - * @Author Safan Maredia - */ -MyWorkflow.prototype.AddSubProcessContextMenu=function(_4092) -{ - var taskExtObj = new TaskContext(); - this.canvasSubProcess = Ext.get(_4092.id); - this.contextSubProcessmenu = new Ext.menu.Menu({ - items: [ - { - text: 'Transform To', - menu: { // <-- submenu by nested config object - items: [ - // stick any markup in a menu - { - text: 'Task', - type:'bpmnTask', - scope:_4092, - handler: MyWorkflow.prototype.toggleShapes - } - ] - }, - scope: this - }, - { - text: 'Properties', - handler: taskExtObj.editSubProcessProperties, - scope: this - }] - }); - -this.canvasSubProcess.on('contextmenu', function(e) { - e.stopEvent(); - this.contextSubProcessmenu.showAt(e.getXY()); -}, this); -} - - -//Window pop up function when user clicks on Gateways properties - -MyWorkflow.prototype.editGatewayProperties= function() -{ - -} -/** - * Changing the Shape and Maintaining the Connections - * @Param Shape Object - * @Author Girish Joshi - */ -MyWorkflow.prototype.toggleShapes=function(item) -{ - - //Set the context Clicked Flag to false because context click action is performed - if(item.scope.workflow != null){ - item.scope.workflow.contextClicked = false; - if(item.scope.workflow.currentSelection != null){ - - //Get all the ports of the shapes - var ports = item.scope.workflow.currentSelection.getPorts(); - var len =ports.data.length; - - //Get all the connection of the shape - var conn = new Array(); - for(var i=0; i<=len; i++){ - if(typeof ports.data[i] === 'object') - conn[i] = ports.data[i].getConnections(); - } - - //Initializing Arrays and variables - var connLength = conn.length; - var sourceNode = new Array(); - var targetNode = new Array(); - var countConn = 0; - var sourcePortName = new Array(); - var targetPortName = new Array(); - var sourcePortId = new Array(); - var targetPortId = new Array(); - - //Get the pre-selected id into new variable to compare in future code - var shapeId = this.workflow.currentSelection.id; - - //Get the current pre-selected figure object in the new object, because not accessible after adding new shapes - var oldWorkflow = this.workflow.currentSelection; - - //Get the source and Target object of all the connections in an array - for(i = 0; i< connLength ; i++) - { - for(var j = 0; j < conn[i].data.length ; j++) - { - if(typeof conn[i].data[j] != 'undefined') { - sourceNode[countConn] = conn[i].data[j].sourcePort.parentNode; - targetNode[countConn] = conn[i].data[j].targetPort.parentNode; - sourcePortName[countConn] = conn[i].data[j].sourcePort.properties.name; - targetPortName[countConn] = conn[i].data[j].targetPort.properties.name; - sourcePortId[countConn] = conn[i].data[j].sourcePort.parentNode.id; - targetPortId[countConn] = conn[i].data[j].targetPort.parentNode.id; - countConn++; - } - } - } - - //Add new selected Figure - var x =item.scope.workflow.currentSelection.getX(); //Get x co-ordinate from figure - var y =item.scope.workflow.currentSelection.getY(); //Get y co-ordinate from figure - - if(item.type == 'bpmnEventBoundaryTimerInter') { - workflow.currentSelection.boundaryEvent = true; - workflow.taskName = oldWorkflow.taskName; - var newShape = workflow.currentSelection; - newShape.setDimension(newShape.getWidth(),newShape.getHeight()); - } - else if(item.type == 'bpmnSubProcess') { - workflow.subProcessName = 'Sub Process'; - newShape = eval("new "+item.type+"(this.workflow)"); - } - else - newShape = eval("new "+item.type+"(this.workflow)"); - - if(item.type != 'bpmnEventBoundaryTimerInter') { - this.workflow.addFigure(newShape,x,y); //Add New Selected Shape First - //Delete Old Shape - item.scope.workflow.getCommandStack().execute(new CommandDelete(oldWorkflow)); - ToolGeneric.prototype.execute.call(item.scope); - //to create all the new connections again - var connObj; - for(i=0 ; i < countConn ; i++){ - if(sourcePortId[i] == shapeId) //If shapeId is equal to sourceId the , replace the oldShape object by new shape Object - sourceNode[i] = newShape; - else - targetNode[i] = newShape; - connObj = new DecoratedConnection(); - connObj.setTarget(eval('targetNode[i].getPort(targetPortName[i])')); - connObj.setSource(eval('sourceNode[i].getPort(sourcePortName[i])')); - newShape.workflow.addFigure(connObj); - } - } - //Saving Asynchronously deleted shape and new created shape into DB - if(item.type.match(/Boundary/)) { - newShape.actiontype = 'updateTask'; - workflow.saveShape(newShape); - } - if(newShape.type.match(/Event/) && !item.type.match(/Boundary/)) { - newShape.mode = 'ddEvent'; - newShape.actiontype = 'addEvent'; - //Set the Old Id to the Newly created Event - newShape.html.id = oldWorkflow.id; - newShape.id = oldWorkflow.id; - newShape.workflow.saveShape(newShape); - } - if(newShape.type.match(/Gateway/)) { - newShape.mode = 'ddGateway'; - newShape.actiontype = 'addGateway'; - //Set the Old Id to the Newly created Gateway - newShape.html.id = oldWorkflow.id; - newShape.id = oldWorkflow.id; - newShape.workflow.saveShape(newShape); - } - //Swapping from Task to subprocess and vice -versa - if((newShape.type == 'bpmnSubProcess' || newShape.type == 'bpmnTask') && !item.type.match(/Boundary/)) { - newShape.actiontype = 'addSubProcess'; - if(newShape.type == 'bpmnTask') - newShape.actiontype = 'addTask'; - newShape.workflow.saveShape(newShape); - } - if((this.type == 'bpmnTask' || this.type == 'bpmnSubProcess') && !item.type.match(/Boundary/)) { - this.actiontype = 'deleteTask'; - this.noAlert = true; - if(this.type == 'bpmnSubProcess') - this.actiontype = 'deleteSubProcess'; - newShape.workflow.deleteSilently(this); - } - } - } -} - -/** - * Toggling Between Task and SubProcess - * @Param Shape Object - * @Author Safan Maredia - */ -MyWorkflow.prototype.swapTaskSubprocess=function(itemObj) -{ - if(itemObj.type == 'bpmnSubProcess') - { - workflow.subProcessName = 'Sub Process'; - var newShape = eval("new "+itemObj.type+"(this.workflow)"); - } - else - newShape = eval("new "+itemObj.type+"(this.workflow)"); - - //Swapping from Task to subprocess and vice -versa - if((newShape.type == 'bpmnSubProcess' || newShape.type == 'bpmnTask') && !itemObj.type.match(/Boundary/)) { - newShape.actiontype = 'addSubProcess'; - if(newShape.type == 'bpmnTask') - newShape.actiontype = 'addTask'; - newShape.workflow.saveShape(newShape); - } - if((this.type == 'bpmnTask' || this.type == 'bpmnSubProcess') && !itemObj.type.match(/Boundary/)) { - this.actiontype = 'deleteTask'; - this.noAlert = true; - if(this.type == 'bpmnSubProcess') - this.actiontype = 'deleteSubProcess'; - newShape.workflow.deleteShape(this); - } -} - -/** - * Validating Connection on Input/Output onDrop Event - * @Param port - * @Param portType - * @Param portTypeName - * @Author Girish Joshi - */ -MyWorkflow.prototype.checkConnectionsExist=function(port,portType,portTypeName) -{ - //Get all the ports of the shapes - var ports = port.workflow.currentSelection.getPorts(); - var len =ports.data.length; - - //Get all the connection of the shape - var conn = new Array(); - for(var i=0; i<=len; i++){ - if(typeof ports.data[i] === 'object') - if(ports.data[i].type == portTypeName) - conn[i] = ports.data[i].getConnections(); - } - //Initializing Arrays and variables - var countConn = 0; - var portParentId= new Array(); - var portName = new Array(); - - //Get ALL the connections for the specified PORT - for(i = 0; i< conn.length ; i++) - { - if(typeof conn[i] != 'undefined') - for(var j = 0; j < conn[i].data.length ; j++) - { - if(typeof conn[i].data[j] != 'undefined') { - portParentId[countConn] = eval('conn[i].data[j].'+portType+'.parentNode.id'); - portName[countConn] = eval('conn[i].data[j].'+portType+'.properties.name'); - countConn++; - } - } - } - var conx = 0; - var parentid; - for(i=0 ; i < countConn ; i++) - { - if(portParentId[i] == port.parentNode.id) - conx++; - } - return conx; - -} -/** - * ExtJs Menu on right Click of Start Event - * @Param Shape Object - * @Author Girish Joshi - */ -MyWorkflow.prototype.AddEventStartContextMenu=function(oShape) -{ - this.canvasEvent = Ext.get(oShape.id); - this.contextEventmenu = new Ext.menu.Menu({ - items: [{ - text: 'Event Type', - menu: { // <-- submenu by nested config object - items: [ - // stick any markup in a menu - { - text: 'Empty', - type:'bpmnEventEmptyStart', - scope:oShape, - handler: MyWorkflow.prototype.toggleShapes - }, - { - text: 'Message', - type:'bpmnEventMessageStart', - scope:oShape, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Timer', - type:'bpmnEventTimerStart', - scope:oShape, - handler: MyWorkflow.prototype.toggleShapes - }/*, { - text: 'Conditional', - type:'bpmnEventRuleStart', - scope:oShape, - handler: MyWorkflow.prototype.toggleShapes - }/*, { - text: 'Signal', - type:'bpmnEventSignalStart', - scope:oShape, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Multiple', - type:'bpmnEventMulStart', - scope:oShape, - handler: MyWorkflow.prototype.toggleShapes - }*/ - ] - }, - scope: this - },{ - text: 'Properties', - scope: this, - handler: MyWorkflow.prototype.editEventProperties - }] - }); - -this.canvasEvent.on('contextmenu', function(e) { - e.stopEvent(); - this.contextEventmenu.showAt(e.getXY()); -}, this); -} -/** - * ExtJs Menu on right Click of Intermediate Event - * @Param Shape Object - * @Author Girish Joshi - */ -MyWorkflow.prototype.AddEventInterContextMenu=function(_4093) -{ - this.canvasEvent = Ext.get(_4093.id); - this.contextEventmenu = new Ext.menu.Menu({ - items: [{ - text: 'Event Type', - menu: { // <-- submenu by nested config object - items: [ - // stick any markup in a menu - /*{ - text: 'Empty', - type:'bpmnEventEmptyInter', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - },*/ - { - text: 'Message : Throw', - type:'bpmnEventMessageSendInter', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, - { - text: 'Timer', - type:'bpmnEventTimerInter', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - } - /* - { - text: 'Intermediate Boundary Timer', - type:'bpmnEventBoundaryInter', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - },{ - text: 'Message : Catch', - type:'bpmnEventMessageRecInter', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Compensate', - type:'bpmnEventCompInter', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Conditional', - type:'bpmnEventRuleInter', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Link', - type:'bpmnEventLinkInter', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Signal', - type:'bpmnEventInterSignal', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Multiple', - type:'bpmnEventMultipleInter', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }*/ - ] - }, - scope: this - },{ - text: 'Properties', - handler: MyWorkflow.prototype.editEventProperties, - scope: this - }] - }); - -this.canvasEvent.on('contextmenu', function(e) { - e.stopEvent(); - this.contextEventmenu.showAt(e.getXY()); -}, this); -} -/** - * ExtJs Menu on right Click of End Event - * @Param Shape Object - * @Author Girish Joshi - */ -MyWorkflow.prototype.AddEventEndContextMenu=function(_4093) -{ - this.canvasEvent = Ext.get(_4093.id); - this.contextEventmenu = new Ext.menu.Menu({ - items: [{ - text: 'Event Type', - menu: { // <-- submenu by nested config object - items: [ - // stick any markup in a menu - { - text: 'Empty', - type:'bpmnEventEmptyEnd', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, - { - text: 'Message', - type:'bpmnEventMessageEnd', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }/*, - { - text: 'Error', - type:'bpmnEventErrorEnd', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Cancel', - type:'bpmnEventCancelEnd', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Compensate', - type:'bpmnEventCompEnd', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Signal', - type:'bpmnEventEndSignal', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Multiple', - type:'bpmnEventMultipleEnd', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Terminate', - type:'bpmnEventTerminate', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }*/ - ] - }, - scope: this - },{ - text: 'Properties', - handler: MyWorkflow.prototype.editEventProperties, - scope: this - }] - }); - -this.canvasEvent.on('contextmenu', function(e) { - e.stopEvent(); - this.contextEventmenu.showAt(e.getXY()); -}, this); -} - -/** - * Hiding Ports according to the Shape Selected - * @Param Shape Object - * @Author Girish Joshi - */ -MyWorkflow.prototype.disablePorts=function(oShape) -{ - if(oShape.type != ''){ - var ports =''; - if(oShape.type.match(/Gateway/)) { - ports = ['output1','input1','output2','input2', 'output3' ]; - } - else if(oShape.type.match(/Task/) || oShape.type.match(/Gateway/) || oShape.type.match(/Inter/) || oShape.type.match(/SubProcess/)) { - ports = ['output1','input1','output2','input2' ]; - } - else if(oShape.type.match(/End/)) { - ports = ['input1','input2']; - } - else if(oShape.type.match(/Start/)) { - ports = ['output1','output2']; - } - else if(oShape.type.match(/Annotation/)) { - ports = ['input1']; - } - for(var i=0; i< ports.length ; i++) { - eval('oShape.'+ports[i]+'.setZOrder(-1)'); - eval('oShape.'+ports[i]+'.setBackgroundColor(new Color(255, 255, 255))'); - eval('oShape.'+ports[i]+'.setColor(new Color(255, 255, 255))'); - } - } -} -/** - * Show Ports according to the Shape Selected - * @Param Shape Object - * @Param aPort Array - * @Author Girish Joshi - */ -MyWorkflow.prototype.enablePorts=function(oShape,aPort) -{ - /*Setting Background ,border and Z-order of the flow menu back to original when clicked - *on the shape - **/ - for(var i=0; i< aPort.length ; i++) - { - if(aPort[i].match(/input/)) { - eval('oShape.workflow.currentSelection.'+aPort[i]+'.setBackgroundColor(new Color(245, 115, 115))'); - eval('oShape.workflow.currentSelection.'+aPort[i]+'.setZOrder(49000)'); - } - else { - eval('oShape.workflow.currentSelection.'+aPort[i]+'.setBackgroundColor(new Color(115, 115, 245))'); - eval('oShape.workflow.currentSelection.'+aPort[i]+'.setZOrder(50000)'); - } - eval('oShape.workflow.currentSelection.'+aPort[i]+'.setColor(new Color(90, 150, 90))'); - } -} - -/** - * Hide Flow menu according to the Shape Selected - * @Param Shape Object - * @Param aPort Array - * @Author Girish Joshi - */ -MyWorkflow.prototype.disableFlowMenu =function(oShape,aPort) -{ - /*Setting Background ,border and Z-order of the flow menu back to original when clicked - *on the shape - */ - for(var i=0; i< aPort.length ; i++) - { - if(aPort[i].match(/input/)) - eval('oShape.workflow.currentSelection.'+aPort[i]+'.setBackgroundColor(new Color(245, 115, 115))'); - else - eval('oShape.workflow.currentSelection.'+aPort[i]+'.setBackgroundColor(new Color(115, 115, 245))'); - eval('oShape.workflow.currentSelection.'+aPort[i]+'.setColor(new Color(90, 150, 90))'); - eval('oShape.workflow.currentSelection.'+aPort[i]+'.setZOrder(50000)'); - } -} - -/** - * This function is called on Right Click of All Shapes - * and menu is shown according to the shape selected - * @Param Shape Object - * @Author Girish Joshi - */ -MyWorkflow.prototype.handleContextMenu=function(oShape) -{ - workflow.hideResizeHandles(); - //Enable the contextClicked Flag - workflow.contextClicked = true; - - //Set the current Selection to the selected Figure - workflow.setCurrentSelection(oShape); - - //Disable Resize of all the figures - //oShape.workflow.hideResizeHandles(); -// oShape.setSelectable(false); -// oShape.setResizeable(false); - //Handle the Right click menu - var pmosExtObj = new pmosExt(); - //Load all the process Data - pmosExtObj.loadProcess(oShape); - - //Load Dynaform List - // pmosExtObj.loadDynaforms(oShape); - - if(oShape.type != ''){ - if(oShape.type.match(/Task/)) { - oShape.workflow.taskid = new Array(); - oShape.workflow.taskid.value = oShape.id; - pmosExtObj.loadTask(oShape); - oShape.workflow.AddTaskContextMenu(oShape); - } - else if(oShape.type.match(/Start/)) { - oShape.workflow.taskUid = workflow.getStartEventConn(oShape,'targetPort','OutputPort'); - pmosExtObj.loadDynaforms(oShape); - oShape.workflow.AddEventStartContextMenu(oShape); - } - else if(oShape.type.match(/Inter/)) { - oShape.workflow.taskUidFrom = workflow.getStartEventConn(oShape,'sourcePort','InputPort'); - //oShape.workflow.taskid = oShape.workflow.taskUid[0]; - oShape.workflow.taskUidTo = workflow.getStartEventConn(oShape,'targetPort','OutputPort'); - oShape.workflow.taskid = oShape.workflow.taskUidFrom[0]; - pmosExtObj.loadTask(oShape); - pmosExtObj.getTriggerList(oShape); - oShape.workflow.AddEventInterContextMenu(oShape); - } - else if(oShape.type.match(/End/)) { - oShape.workflow.taskUid = workflow.getStartEventConn(oShape,'sourcePort','InputPort'); - oShape.workflow.AddEventEndContextMenu(oShape); - } - else if(oShape.type.match(/Gateway/)) { - oShape.workflow.AddGatewayContextMenu(oShape); - } - else if(oShape.type.match(/SubProcess/)) { - oShape.workflow.AddSubProcessContextMenu(oShape); - } - } - //this.workflow.AddEventStartContextMenu(oShape); - - -} - -/** - * This function is called in Save Process - * and menu is shown according to the shape selected - * @Param Shape Object - * @Author Javed Aman - */ -MyWorkflow.prototype.getCommonConnections = function(oShape) -{ - var routes = new Array(); - var counter = 0 - for(var p=0; p < oShape.workflow.commonPorts.data.length; p++) - { - if(typeof oShape.workflow.commonPorts.data[p] === "object" && oShape.workflow.commonPorts.data[p] != null) - { - counter++; - } - } - for(var j=0; j< counter; j++) - { - //var temp1 = eval("this.workflow.commonPorts.data["+i+"].parentNode.output"+count+".getConnections()"); - var tester = oShape.workflow.commonPorts.data; - var temp1 = eval("oShape.workflow.commonPorts.data["+j+"].getConnections()"); - if(temp1.data[0]) { - if(routes[j]) { - if(routes[j][1] != temp1.data[0].sourcePort.parentNode.id) { - routes[j] = new Array(3); - routes[j][0] = temp1.data[0].id; - routes[j][1] = temp1.data[0].sourcePort.parentNode.id; - routes[j][2] = temp1.data[0].targetPort.parentNode.id; - routes[j][3] = temp1.data[0].targetPort.properties.name; - routes[j][4] = temp1.data[0].sourcePort.properties.name; - } - } - else { - routes[j] = new Array(3); - routes[j][0] = temp1.data[0].id; - routes[j][1] = temp1.data[0].sourcePort.parentNode.id; - routes[j][2] = temp1.data[0].targetPort.parentNode.id; - routes[j][3] = temp1.data[0].targetPort.properties.name; - routes[j][4] = temp1.data[0].sourcePort.properties.name; - } - } - } - var j = 0; - var serial = new Array(); - for(key in routes) - { - if(typeof routes[key] === 'object') { - serial[j] = routes[key]; - j++; - } - } - var routes = serial.getUniqueValues(); - for(var i=0;i< routes.length ; i++) - { - routes[i] = routes[i].split(','); - } - - return routes; -} - -Array.prototype.getUniqueValues = function () { -var hash = new Object(); -for (j = 0; j < this.length; j++) {hash[this[j]] = true} -var array = new Array(); -for (value in hash) {array.push(value)}; -return array; -} -/** - * Get Process UID - * @Param Shape Object - * @Author Safan maredia - */ -MyWorkflow.prototype.getUrlVars = function() -{ - var vars = [], hash; - var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); - - for(var i = 0; i < hashes.length; i++) - { - hash = hashes[i].split('='); - vars.push(hash[0]); - vars[hash[0]] = hash[1]; - } - var pro_uid = vars["PRO_UID"]; - return pro_uid; -} - - -MyWorkflow.prototype.savePosition= function(oShape) -{ - var shapeId = oShape.id; - var actiontype = oShape.actiontype; - var xpos = oShape.x; - var ypos = oShape.y; - var pos = '{"x":'+xpos+',"y":'+ypos+'}'; - - var width = oShape.width; - var height = oShape.height; - var cordinates = '{"x":'+width+',"y":'+height+'}'; - var urlparams = ''; - switch(actiontype) - { - case 'saveTaskPosition': - urlparams = '?action='+actiontype+'&data={"uid":"'+ shapeId +'","position":'+pos+'}'; - break; - case 'saveEventPosition': - urlparams = '?action='+actiontype+'&data={"uid":"'+ shapeId +'","position":'+pos+'}'; - break; - case 'saveTextPosition': - urlparams = '?action='+actiontype+'&data={"uid":"'+ shapeId +'","position":'+pos+'}'; - break; - case 'saveGatewayPosition': - urlparams = '?action='+actiontype+'&data={"uid":"'+ shapeId +'","position":'+pos+'}'; - break; - case 'saveTaskCordinates': - urlparams = '?action='+actiontype+'&data={"uid":"'+ shapeId +'","position":'+cordinates+'}'; - break; - case 'saveAnnotationCordinates': - urlparams = '?action='+actiontype+'&data={"uid":"'+ shapeId +'","position":'+cordinates+'}'; - break; - } - if(urlparams != ''){ - Ext.Ajax.request({ - url: "bpmn/processes_Ajax.php"+ urlparams, - success: function(response) { - //Ext.Msg.alert (response.responseText); - }, - failure: function(){ - //Ext.Msg.alert ('Failure'); - } - }); - } -} -/** - * Saving Shape Asychronously - * @Param oNewShape Object - * @Author Safan maredia - */ -MyWorkflow.prototype.saveShape= function(oNewShape) -{ - //Initializing variables - var shapeId = oNewShape.id; - var shapetype = oNewShape.type; - var actiontype = oNewShape.actiontype; - var xpos = oNewShape.x; - var ypos = oNewShape.y; - var pos = '{"x":'+xpos+',"y":'+ypos+'}'; - var width = oNewShape.width; - var height = oNewShape.height; - var cordinates = '{"x":'+width+',"y":'+height+'}'; - - if(shapetype == 'bpmnTask'){ - var newlabel = oNewShape.taskName; - } - if(shapetype == 'bpmnAnnotation'){ - newlabel = oNewShape.annotationName; - } - - //var urlparams = "action=addTask&data={"uid":"4708462724ca1d281210739068208635","position":{"x":707,"y":247}}"; - var urlparams = ''; - switch(actiontype) - { - case 'addTask': - urlparams = '?action='+actiontype+'&data={"uid":"'+ pro_uid +'","position":'+pos+',"cordinate":'+cordinates+'}'; - break; - case 'updateTask': - urlparams = '?action='+actiontype+'&data={"uid":"'+ shapeId +'","boundary":"TIMER"}'; - break; - case 'updateTaskName': - urlparams = '?action='+actiontype+'&data={"uid":"'+ shapeId +'","label":"'+newlabel+'"}'; - break; - case 'addSubProcess': - urlparams = '?action='+actiontype+'&data={"uid":"'+ pro_uid +'","position":'+pos+'}'; - break; - case 'addText': - var next_uid = ''; - var taskUidFrom = workflow.getStartEventConn(oNewShape,'sourcePort','OutputPort'); - if(taskUidFrom.length > 0) - next_uid = taskUidFrom[0].value; - urlparams = '?action='+actiontype+'&data={"uid":"'+ pro_uid +'","label":"'+newlabel+'","task_uid":"'+ next_uid +'","position":'+pos+'}'; - break; - case 'updateText': - next_uid = ''; - if(workflow.currentSelection.type == 'bpmnTask') - taskUidFrom = workflow.getStartEventConn(oNewShape,'sourcePort','OutputPort'); - else - taskUidFrom = workflow.getStartEventConn(oNewShape,'sourcePort','InputPort'); - if(taskUidFrom.length > 0) - next_uid = taskUidFrom[0].value; - - urlparams = '?action='+actiontype+'&data={"uid":"'+ shapeId +'","label":"'+newlabel+'","next_uid":"'+ next_uid +'"}'; - break; - case 'saveStartEvent': - //If we change Event to start from Message/Timer then Delete the record from Events Table - this.deleteEvent(oNewShape); - var tas_start = 'TRUE'; - var tas_uid = oNewShape.task_uid; - urlparams = '?action='+actiontype+'&data={"tas_uid":"'+tas_uid+'","tas_start":"'+tas_start+'"}'; - break; - case 'addEvent': - urlparams = '?action='+actiontype+'&data={"uid":"'+ pro_uid +'","evn_type":"'+shapetype+'","position":'+pos+',"evn_uid":"'+shapeId+'"}'; - break; - case 'updateEvent': - urlparams = '?action='+actiontype+'&data={"evn_uid":"'+shapeId +'","evn_type":"'+shapetype+'"}'; - break; - case 'addGateway': - urlparams = '?action='+actiontype+'&data={"pro_uid":"'+ pro_uid +'","gat_uid":"'+ shapeId +'","gat_type":"'+ shapetype +'","position":'+ pos +'}'; - break; - } - //var urlparams = '?action='+actiontype+'&data={"uid":"'+ pro_uid +'","position":'+pos+'}'; - - if(urlparams != ''){ - Ext.Ajax.request({ - url: "bpmn/processes_Ajax.php"+ urlparams, - success: function(response) { - //Ext.Msg.alert (response.responseText); - if(response.responseText != 1 && response.responseText != ""){ - this.workflow.newTaskInfo = Ext.util.JSON.decode(response.responseText); - oNewShape.html.id = this.workflow.newTaskInfo.uid; - oNewShape.id = this.workflow.newTaskInfo.uid; - if(oNewShape.type == 'bpmnTask' && oNewShape.boundaryEvent != true){ - oNewShape.taskName = this.workflow.newTaskInfo.label; - workflow.redrawTaskText(oNewShape); - //After Figure is added, Update Start Event connected to Task - if(typeof this.workflow.preSelectedObj != 'undefined' ){ - var preSelectedFigure = this.workflow.preSelectedObj; - if(preSelectedFigure.type.match(/Start/) && preSelectedFigure.type.match(/Event/)) - this.workflow.saveEvents(preSelectedFigure,oNewShape.id); - else if(preSelectedFigure.type.match(/Task/)) - this.workflow.saveRoute(preSelectedFigure,oNewShape); - else if (preSelectedFigure.type.match(/Gateway/)) - //preSelectedFigure.rou_type = 'SEQUENTIAL'; - this.workflow.saveRoute(preSelectedFigure,oNewShape); - else if (preSelectedFigure.type.match(/Inter/)) { - //preSelectedFigure.rou_type = 'SEQUENTIAL'; - this.workflow.saveEvents(preSelectedFigure,oNewShape); - } - } - - /** - * erik: Setting Drop targets from users & groups grids to assignment to tasks - * for new tasks created recently - */ - //var dropEls = Ext.get('paintarea').query('.x-task'); - //for(var i = 0; i < dropEls.length; i++) - //new Ext.dd.DropTarget(dropEls[i], {ddGroup:'task-assignment', notifyDrop : Ext.getCmp('usersPanel')._onDrop}); - - } - else if(oNewShape.type == 'bpmnSubProcess'){ - oNewShape.subProcessName = this.workflow.newTaskInfo.label; - } - /*else if(oNewShape.type.match(/Inter/) && oNewShape.type.match(/Start/)) { - workflow.saveEvents(oNewShape); - } - else if(oNewShape.type.match(/Start/) && oNewShape.type.match(/Event/)) { - workflow.saveEvents(oNewShape); - }*/ - else if(oNewShape.type.match(/End/) && oNewShape.type.match(/Event/)) { - if(workflow.currentSelection != null && workflow.currentSelection != '') //will check for standalone event - workflow.saveRoute(workflow.currentSelection,oNewShape); - } - else if(oNewShape.type.match(/Gateway/)) { - workflow.saveGateways(oNewShape); - } - else if(oNewShape.type.match(/Inter/) && oNewShape.type.match(/Event/)) { - preSelectedFigure = this.workflow.preSelectedFigure; - workflow.saveEvents(oNewShape,preSelectedFigure.id); - } - } - }, - failure: function(){ - //Ext.Msg.alert ('Failure'); - } - }); - } -} - -MyWorkflow.prototype.saveTask= function(actiontype,xpos,ypos) -{ - if(actiontype != '') { - var pro_uid = this.getUrlVars(); - var actiontype = actiontype; - var pos = '{"x":'+xpos+',"y":'+ypos+'}'; - switch(actiontype) { - case 'addTask': - urlparams = '?action='+actiontype+'&data={"uid":"'+ pro_uid +'","position":'+pos+'}'; - break; - } - Ext.Ajax.request({ - url: "bpmn/processes_Ajax.php"+ urlparams, - success: function(response) { - //Ext.Msg.alert (response.responseText); - if(response.responseText != 1 && response.responseText != "") { - workflow.newTaskInfo = Ext.util.JSON.decode(response.responseText); - workflow.taskName = this.workflow.newTaskInfo.label; - workflow.task = eval("new bpmnTask(workflow) "); - workflow.addFigure(workflow.task, xpos, ypos); - workflow.task.html.id = workflow.newTaskInfo.uid; - workflow.task.id = workflow.newTaskInfo.uid; - } - } - }) - } -} -//Deleting shapes silently on swapping task to sub process and vice-versa -MyWorkflow.prototype.deleteSilently= function(oShape) -{ - //Initializing variables - var pro_uid = this.getUrlVars(); - var shapeId = oShape.id; - var actiontype = oShape.actiontype; - //var shapeName = ''; - - switch(actiontype) - { - case 'deleteTask': - var urlparams = '?action='+actiontype+'&data={"pro_uid":"'+ pro_uid +'","tas_uid":"'+shapeId+'"}'; - this.urlparameter = urlparams; - //shapeName = 'Task :'+ oShape.taskName; - break; - case 'deleteSubProcess': - urlparams = '?action='+actiontype+'&data={"pro_uid":"'+ pro_uid +'","tas_uid":"'+shapeId+'"}'; - this.urlparameter = urlparams; - break; - } - - Ext.Ajax.request({ - url: "bpmn/processes_Ajax.php"+ urlparams, - success: function(response) { - //Ext.Msg.alert (response.responseText); - }, - failure: function(){ - Ext.Msg.alert ('Failure'); - } - }); - //workflow.getCommandStack().execute(new CommandDelete(workflow.getCurrentSelection())); -} -/** - * Deleting Shape Asychronously - * @Param oShape Object - * @Author Safan maredia - */ -MyWorkflow.prototype.deleteShape= function(oShape) -{ - var shapeId = oShape.id; - var actiontype = oShape.actiontype; - var shapeName = ''; - switch(actiontype) - { - case 'deleteTask': - var urlparams = '?action='+actiontype+'&data={"pro_uid":"'+ pro_uid +'","tas_uid":"'+shapeId+'"}'; - this.urlparameter = urlparams; - shapeName = 'Task :'+ oShape.taskName; - break; - case 'deleteSubProcess': - urlparams = '?action='+actiontype+'&data={"pro_uid":"'+ pro_uid +'","tas_uid":"'+shapeId+'"}'; - this.urlparameter = urlparams; - shapeName = oShape.subProcessName; - break; - case 'deleteText': - urlparams = '?action='+actiontype+'&data={"uid":"'+shapeId+'"}'; - this.urlparameter = urlparams; - shapeName = 'Annotation'; - break; - case 'deleteStartEvent': - var task_detail = this.getStartEventConn(this.currentSelection,'targetPort','OutputPort'); - var evn_uid = this.currentSelection.id; - if(task_detail.length > 0){ - var tas_uid = task_detail[0].value; - var tas_start = 'FALSE'; - this.urlparameter = '?action=deleteStartEvent&data={"tas_uid":"'+tas_uid+'","tas_start":"'+tas_start+'","evn_uid":"'+evn_uid+'"}'; - } - else - this.urlparameter = '?action=deleteEvent&data={"uid":"'+evn_uid+'"}'; - shapeName = 'Start Event'; - break; - case 'deleteEndEvent': - shapeName = 'End Event'; - var evn_uid = this.currentSelection.id; - this.urlparameter = '?action=deleteEvent&data={"uid":"'+evn_uid+'"}'; - break; - case 'deleteInterEvent': - shapeName = 'Intermediate Event'; - var evn_uid = this.currentSelection.id; - this.urlparameter = '?action=deleteEvent&data={"uid":"'+evn_uid+'"}'; - break; - case 'deleteGateway': - shapeName = 'Gateway'; - urlparams = '?action='+actiontype+'&data={"pro_uid":"'+ pro_uid +'","gat_uid":"'+shapeId+'"}'; - this.urlparameter = urlparams; - break; - } -if(typeof oShape.noAlert == 'undefined' || oShape.noAlert == null){ - Ext.MessageBox.confirm('Confirm', 'Are you sure you want to delete the '+ shapeName,this.showAjaxDialog); -} -else{ - Ext.MessageBox.confirm('Confirm', 'Are you sure you want to delete the '+ shapeName,this.showDeleteDialog); -} -} - -MyWorkflow.prototype.showAjaxDialog = function(btn){ - //this.workflow.confirm = btn; - if(typeof workflow.urlparameter != 'undefined'){ - var url = workflow.urlparameter; - if(btn == 'yes'){ - var currentObj = workflow.currentSelection; - - //Check for End Event and delete from route table - if(workflow.currentSelection.type.match(/End/) && workflow.currentSelection.type.match(/Event/)){ - var ports = currentObj.getPorts(); - var len =ports.data.length; - var conn = new Array(); - for(var i=0; i<=len; i++){ - if(typeof ports.data[i] === 'object') - conn[i] = ports.data[i].getConnections(); - } - for(i = 0; i< conn.length ; i++) - { - if(typeof conn[i] != 'undefined') - for(var j = 0; j < conn[i].data.length ; j++) - { - if(typeof conn[i].data[j] != 'undefined'){ - if(conn[i].data[j].targetPort.parentNode.id == currentObj.id){ - route = conn[i].data[j]; - break; - } - } - } - } - if(typeof route != 'undefined'){ - workflow.deleteRoute(route,1); - } - } - Ext.Ajax.request({ - url: "bpmn/processes_Ajax.php"+ url, - success: function(response) { - workflow.getCommandStack().execute(new CommandDelete(currentObj)); - }, - failure: function(){ - Ext.Msg.alert ('Failure'); - } - }); - - } - } - }; - -MyWorkflow.prototype.showDeleteDialog = function(btn){ - if(btn == 'yes'){ - workflow.getCommandStack().execute(new CommandDelete(workflow.getCurrentSelection())); - } - }; - - -/** - * ExtJs Menu on right click on Event Shape - * @Param oShape Object - * @Author Girish joshi - */ -MyWorkflow.prototype.editEventProperties = function(oShape) -{ - var currentSelection = oShape.scope.currentSelection; - var pmosExtObj = new pmosExt(); - - switch (currentSelection.type){ - case 'bpmnEventMessageStart': - pmosExtObj.popWebEntry(currentSelection); - break; - case 'bpmnEventTimerStart': - pmosExtObj.popCaseSchedular(currentSelection); - break; - case 'bpmnEventMessageSendInter': - pmosExtObj.popTaskNotification(currentSelection); - break; - case 'bpmnEventTimerInter': - pmosExtObj.popMultipleEvent(currentSelection); - break; - case 'bpmnEventMessageEnd': - pmosExtObj.popMessageEvent(currentSelection); - break; - } -} - -/** - * Get the Source / Target of the shape - * @Param oShape Object - * @Param sPort string - * @Param sPortType string - * @return aStartTask array - * @Author Girish joshi - */ -MyWorkflow.prototype.getStartEventConn = function(oShape,sPort,sPortType) -{ - var aStartTask= new Array(); - - //Get all the ports of the shapes - if( workflow.currentSelection != null && typeof workflow.currentSelection != 'undefined') { - var ports = workflow.currentSelection.getPorts(); - //var ports = oShape.getPorts(); - var len = ports.data.length; - - //Get all the connection of the shape - var conn = new Array(); - for(var i=0; i<=len; i++){ - if(typeof ports.data[i] === 'object') - if(ports.data[i].type == sPortType) - conn[i] = ports.data[i].getConnections(); - } - //Initializing Arrays and variables - var countConn = 0; - - var type; - //Get ALL the connections for the specified PORT - for(i = 0; i< conn.length ; i++) - { - if(typeof conn[i] != 'undefined') - for(var j = 0; j < conn[i].data.length ; j++) - { - if(typeof conn[i].data[j] != 'undefined') - { - type = eval('conn[i].data[j].'+sPort+'.parentNode.type') - if(type == 'bpmnTask') - { - aStartTask[countConn] = new Array(); - aStartTask[countConn].value = eval('conn[i].data[j].'+sPort+'.parentNode.id'); - aStartTask[countConn].name = eval('conn[i].data[j].'+sPort+'.parentNode.taskName'); - countConn++; - } - } - } - } - } - return aStartTask; -} - -/** - * save Gateway depending on the Shape Type - * @Param oGateway Object - * @Param sTaskUID string - * @Author Safan Maredia - */ -MyWorkflow.prototype.saveGateways = function(oGateway){ - var task_uid = ''; - var next_task_uid = ''; - var next_task_type = ''; - var urlparams = ''; - var xpos = oGateway.x; - var ypos = oGateway.y; - var pos = '{"x":'+xpos+',"y":'+ypos+'}'; - - var ports = oGateway.getPorts(); - var len =ports.data.length; - //Get all the connection of the shape - var conn = new Array(); - var count1 = 0; - var count2 = 0; - for(var i=0; i<=len; i++){ - if(typeof ports.data[i] === 'object') - conn[i] = ports.data[i].getConnections(); - } - //Get ALL the connections for the specified PORT - for(i = 0; i< conn.length ; i++){ - if(typeof conn[i] != 'undefined') - for(var j = 0; j < conn[i].data.length ; j++){ - if(typeof conn[i].data[j] != 'undefined'){ - if(conn[i].data[j].sourcePort.parentNode.id != oGateway.id){ - // task_uid[count1] = new Array(); - task_uid = conn[i].data[j].sourcePort.parentNode.id; - count1++; - } - if(conn[i].data[j].targetPort.parentNode.id != oGateway.id){ - // task_uid[count2] = new Array(); - next_task_uid = conn[i].data[j].targetPort.parentNode.id; - next_task_type = conn[i].data[j].targetPort.parentNode.type; - //count2++; - } - } - } - } - // var staskUid = Ext.util.JSON.encode(task_uid); - // var sNextTaskUid = Ext.util.JSON.encode(next_task_uid); - urlparams = '?action=addGateway&data={"pro_uid":"'+ pro_uid +'","tas_from":"'+task_uid+'","tas_to":"'+next_task_uid+'","gat_type":"'+oGateway.type+'","gat_uid":"'+oGateway.id+'","gat_next_type":"'+next_task_type+'","position":'+pos+'}'; - if(urlparams != ''){ - Ext.Ajax.request({ - url: "bpmn/processes_Ajax.php"+ urlparams, - success: function(response) { - if(response.responseText != '') - { - // workflow.currentSelection.id = response.responseText; - /*if(workflow.currentSelection.type.match(/Inter/) && workflow.currentSelection.type.match(/Event/)){ - workflow.currentSelection.id = response.responseText; - var newObj = workflow.currentSelection; - var preObj = new Array(); - preObj.type = 'bpmnTask'; - preObj.id = task_uid[0]; - newObj.evn_uid = workflow.currentSelection.id; - newObj.task_to = next_task_uid[0]; - this.workflow.saveRoute(preObj,newObj); - }*/ - } - }, - failure: function(){ - Ext.Msg.alert ('Failure'); - } - }); - } -} - -/** - * save Event depending on the Shape Type - * @Param oShape Object - * @Param sPort string - * @Param sPortType string - * @Author Girish joshi - */ -MyWorkflow.prototype.saveEvents = function(oEvent,sTaskUID) -{ - var task_uid = new Array(); - var next_task_uid = new Array(); - var urlparams = ''; - - if(typeof sTaskUID == 'undefined') //Will be undefined for standalone events - sTaskUID = ''; - if(oEvent.type.match(/Start/)) - { - var tas_start = 'TRUE'; - urlparams = '?action=saveEvents&data={"tas_uid":"'+sTaskUID+'","tas_start":"'+tas_start+'","evn_type":"'+oEvent.type+'","evn_uid":"'+oEvent.id+'"}'; - } - else if(oEvent.type.match(/Inter/)) - { - var ports = oEvent.getPorts(); - var len =ports.data.length; - - //Get all the connection of the shape - var conn = new Array(); - var count1 = 0; - var count2 = 0; - for(var i=0; i<=len; i++) { - if(typeof ports.data[i] === 'object') - conn[i] = ports.data[i].getConnections(); - } - - //Get ALL the connections for the specified PORT - for(i = 0; i< conn.length ; i++){ - if(typeof conn[i] != 'undefined') - for(var j = 0; j < conn[i].data.length ; j++) { - if(typeof conn[i].data[j] != 'undefined'){ - if(conn[i].data[j].sourcePort.parentNode.type != oEvent.type){ - // task_uid[count1] = new Array(); - task_uid = conn[i].data[j].sourcePort.parentNode.id; - count1++; - } - if(conn[i].data[j].targetPort.parentNode.type != oEvent.type){ - // task_uid[count2] = new Array(); - next_task_uid = conn[i].data[j].targetPort.parentNode.id; - //count2++; - } - } - } - } - // var staskUid = Ext.util.JSON.encode(task_uid); - // var sNextTaskUid = Ext.util.JSON.encode(next_task_uid); - if(typeof task_uid == 'undefined') - task_uid = ''; - if(typeof next_task_uid == 'undefined') - next_task_uid = ''; - - urlparams = '?action=saveEvents&data={"tas_from":"'+task_uid+'","tas_to":"'+next_task_uid+'","evn_type":"'+oEvent.type+'","evn_uid":"'+oEvent.id+'"}'; - } - - if(urlparams != '') { - Ext.Ajax.request({ - url: "bpmn/processes_Ajax.php"+ urlparams, - success: function(response) { - if(response.responseText != '') - { - //Save Route - //disabled by Fernando, because the workflow.currentSelection arrives null and throwing an error in javascript -// if(workflow.currentSelection.type.match(/Inter/) && workflow.currentSelection.type.match(/Event/)){ -// workflow.currentSelection.id = response.responseText; -// var newObj = workflow.currentSelection; -// var preObj = new Array(); -// preObj.type = 'bpmnTask'; -// preObj.id = task_uid[0]; -// newObj.evn_uid = workflow.currentSelection.id; -// newObj.task_to = next_task_uid[0]; -// this.workflow.saveRoute(preObj,newObj); -// } - } - }, - failure: function(){ - Ext.Msg.alert ('Failure'); - } - }); - } -} - -/** - * save Route on Changing of route Ports depending on the Shape Type - * @Param preObj Object - * @Param newObj Object - * @Author Girish joshi - */ -MyWorkflow.prototype.saveRoute = function(preObj,newObj) -{ - var task_uid = new Array(); - var next_task_uid = new Array(); - var rou_type =''; - var rou_evn_uid = ''; - var port_numberIP = ''; - var port_numberOP = ''; - var sGatUid = ''; - var sGatType = ''; - - if(typeof newObj.sPortType != 'undefined') - { - sPortTypeIP = newObj.sPortType; - sPortTypeOP = preObj.sPortType; - var sPortType_lenIP = sPortTypeIP.length; - var sPortType_lenOP = sPortTypeOP.length; - port_numberIP = sPortTypeIP.charAt(sPortType_lenIP-1); - port_numberOP = sPortTypeOP.charAt(sPortType_lenOP-1); - } - if(preObj.type.match(/Task/) && newObj.type.match(/Event/) && newObj.type.match(/Inter/)) - { - task_uid[0] = preObj.id; - next_task_uid[0] = newObj.task_to; - rou_type = 'SEQUENTIAL'; - rou_evn_uid = newObj.id; - } - //If both the Object are Task - else if(preObj.type.match(/Task/) && newObj.type.match(/Task/)) - { - task_uid[0] = preObj.id; - next_task_uid[0] = newObj.id; - rou_type = 'SEQUENTIAL'; - } - else if(preObj.type.match(/Task/) && newObj.type.match(/End/) && newObj.type.match(/Event/) || newObj.reverse == 1) - { - //this.deleteRoute(newObj.conn,1); - if(newObj.reverse == 1) //Reverse Routing - task_uid[0] = newObj.id; - else - task_uid[0] = preObj.id; - - next_task_uid[0] = '-1'; - - rou_type = 'SEQUENTIAL'; - rou_evn_uid = newObj.id; - } - else if(preObj.type.match(/Gateway/)) - { - switch(preObj.type){ - case 'bpmnGatewayParallel': - rou_type ='PARALLEL'; - break; - case 'bpmnGatewayExclusiveData': - rou_type = 'EVALUATE'; - break; - case 'bpmnGatewayInclusive': - rou_type = 'PARALLEL-BY-EVALUATION'; - break; - case 'bpmnGatewayComplex': - rou_type = 'DISCRIMINATOR'; - break; - } - var ports = preObj.getPorts(); - var len =ports.data.length; - - //Get all the connection of the shape - var conn = new Array(); - var count1 = 0; - var count2 = 0; - for(var i=0; i<=len; i++){ - if(typeof ports.data[i] === 'object') - conn[i] = ports.data[i].getConnections(); - } - - //Get ALL the connections for the specified PORT - for(i = 0; i< conn.length ; i++) - { - if(typeof conn[i] != 'undefined') - for(var j = 0; j < conn[i].data.length ; j++) - { - if(typeof conn[i].data[j] != 'undefined') - { - if(conn[i].data[j].sourcePort.parentNode.type != preObj.type){ - // task_uid[count1] = new Array(); - task_uid[count1] = conn[i].data[j].sourcePort.parentNode.id; - count1++; - } - if(conn[i].data[j].targetPort.parentNode.type != preObj.type){ - // task_uid[count2] = new Array(); - next_task_uid[count2] = conn[i].data[j].targetPort.parentNode.id; - count2++; - } - - } - } - } - } - - var staskUid = Ext.util.JSON.encode(task_uid); - var sNextTaskUid = Ext.util.JSON.encode(next_task_uid); - if(preObj.type.match(/Gateway/)){ - sGatUid = preObj.id; - sGatType = preObj.type; - } - if(task_uid.length > 0 && next_task_uid.length > 0) - { - Ext.Ajax.request({ - url: "bpmn/patterns_Ajax.php", - success: function(response) { - if(response.responseText != 0) { - if(typeof newObj.conn != 'undefined') { - //var resp = response.responseText.split("|"); //resp[0] => gateway UID OR event_UID , resp[1] => route UID - var resp = response.responseText; //resp[0] => gateway UID OR event_UID , resp[1] => route UID - newObj.conn.html.id = resp; - newObj.conn.id = resp; - } - } - }, - failure: function(){ - Ext.Msg.alert ('Failure'); - }, - params: { - action :'savePattern', - PROCESS : pro_uid, - TASK : staskUid, - ROU_NEXT_TASK : sNextTaskUid, - ROU_TYPE : rou_type, - ROU_EVN_UID : rou_evn_uid, - PORT_NUMBER_IP: port_numberIP, - PORT_NUMBER_OP: port_numberOP, - GAT_UID : sGatUid, - GAT_TYPE : sGatType, - mode:'Ext' - } - }); - } - else - workflow.saveGateways(preObj); -} - -MyWorkflow.prototype.deleteRoute = function(oConn,iVal){ - workflow.oConn = oConn; - var sourceObjType = oConn.sourcePort.parentNode.type; - var targetObjType = oConn.targetPort.parentNode.type; - var rou_uid = oConn.id; - //Setting Condition for VALID ROUTE_UID present in Route Table - //For start and gateway event, we dont have entry in ROUTE table - if(rou_uid != '' && !sourceObjType.match(/Gateway/) && !sourceObjType.match(/Start/) && !targetObjType.match(/Gateway/)){ - workflow.urlDeleteparameter = '?action=deleteRoute&data={"uid":"'+ rou_uid +'"}'; - } - //Deleting route for Start event and also deleting start event - else if(sourceObjType.match(/Start/)){ - var targetObj = oConn.targetPort.parentNode; //Task - var tas_uid = targetObj.id; - var tas_start = 'FALSE'; - workflow.urlDeleteparameter = '?action=saveStartEvent&data={"tas_uid":"'+tas_uid+'","tas_start":"'+tas_start+'"}'; - } - if(iVal == 0) - Ext.MessageBox.confirm('Confirm', 'Are you sure you want to delete the Route',this.showEventResult); - else - this.showEventResult('yes'); -} - -MyWorkflow.prototype.showEventResult = function(btn){ - //this.workflow.confirm = btn; - if(typeof workflow.urlDeleteparameter != 'undefined') - { - var url = workflow.urlDeleteparameter; - if(btn == 'yes') - { - Ext.Ajax.request({ - url: "bpmn/processes_Ajax.php"+ url, - success: function(response) { - workflow.getCommandStack().execute(new CommandDelete(workflow.oConn)); - }, - failure: function(){ - Ext.Msg.alert ('Failure'); - } - }); - } - } - - }; -/** - * Deleting Event - * @Param eventObj Object - * @Author Girish joshi - */ -MyWorkflow.prototype.deleteEvent = function(eventObj){ - - var event_uid = eventObj.id; - if(event_uid != '') { - var urlparams = '?action=deleteEvent&data={"uid":"'+ event_uid +'"}'; - Ext.Ajax.request({ - url: "bpmn/processes_Ajax.php"+ urlparams, - success: function(response) { - }, - failure: function(){ - Ext.Msg.alert ('Failure'); - } - }); - } -} - -MyWorkflow.prototype.getDeleteCriteria = function() -{ - var shape = workflow.currentSelection.type; - var currentObj = workflow.currentSelection; - if(shape.match(/Task/)){ - workflow.currentSelection.actiontype = 'deleteTask'; - } - else if(shape.match(/SubProcess/)){ - workflow.currentSelection.actiontype = 'deleteSubProcess'; - } - else if(shape.match(/Annotation/)){ - workflow.currentSelection.actiontype = 'deleteText'; - } - else if(shape.match(/Event/) && shape.match(/Start/)){ - workflow.currentSelection.actiontype = 'deleteStartEvent'; - } - else if(shape.match(/Event/) && shape.match(/End/)){ - workflow.currentSelection.actiontype = 'deleteEndEvent'; - } - else if(shape.match(/Event/) && shape.match(/Inter/)){ - workflow.currentSelection.actiontype = 'deleteInterEvent'; - } - else if(shape.match(/Gateway/)){ - workflow.currentSelection.actiontype = 'deleteGateway'; - workflow.deleteShape(workflow.currentSelection); - } - if(workflow.currentSelection.actiontype != '') - workflow.deleteShape(workflow.currentSelection); -} - -/** - * Zoom Function - * @Param sType string(in/out) - * @Author Girish joshi - */ -MyWorkflow.prototype.zoom = function(sType) -{ - //workflow.zoomFactor = 1; - var loadMask = new Ext.LoadMask(document.body, {msg:'Zooming..'}); - var figures = workflow.getDocument().getFigures(); - - var lines=workflow.getLines(); - var size=lines.getSize(); - - sType =sType/100; - workflow.zoomfactor = sType; - var figSize = figures.getSize(); - // loadMask.show(); - for(f = 0;f @@ Replace the value in quotes ';}, - items: - { - xtype:'tabpanel', - activeTab: 0, - defaults:{ - autoHeight:true - }, - items:[{ - title:'All Variables', - id :'allVar', - layout:'form', - listeners: { - activate: function(tabPanel){ - // use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request. - var link = 'proxyVariable?pid='+pro_uid+'&type='+tabPanel.id+'&sFieldName=form[CTO_CONDITION]&sSymbol=@@'; - varStore.proxy.setUrl(link, true); - varStore.load(); - } - }, - items:[{ - xtype: 'grid', - ds: varStore, - cm: varColumns, - width: 380, - autoHeight: true, - //plugins: [editor], - //loadMask : true, - loadingText : 'Loading...', - border: false, - listeners: { - //rowdblclick: alert("ok"), - rowdblclick: function(){ - var getObjectGridRow = workflow.gridObjectRowSelected; - var FieldSelected = workflow.gridField; - - //getting selected row of variables - var rowSelected = this.getSelectionModel().getSelected(); - var rowLabel = rowSelected.data.variable; - - //Assigned new object with condition - if(typeof rowData.colModel != 'undefined') - rowData.colModel.config[3].editor.setValue(rowLabel); - //Assigning / updating Condition for a row - else - rowData[0].set(fieldName,rowLabel); - } - } - }] - }] - } -}); - var window = new Ext.Window({ - title: 'Variables', - collapsible: false, - maximizable: false, - scrollable: true, - width: 400, - height: 350, - minWidth: 200, - minHeight: 150, - autoScroll: true, - layout: 'fit', - plain: true, - buttonAlign: 'center', - items: [varForm] - }); - window.show(); - -} diff --git a/workflow/engine/templates/bpmn/Pool.js b/workflow/engine/templates/bpmn/Pool.js deleted file mode 100755 index 6c3946973..000000000 --- a/workflow/engine/templates/bpmn/Pool.js +++ /dev/null @@ -1,53 +0,0 @@ -bpmnPool = function (workflow) { - VectorFigure.call(this); - this.setDimension(800, 600); - var figures = workflow.getFigures(); - for(var i=0;i" + aData.FILENAME + "<\/a>"); - form.findField('XPDL_FILENAME').setValue("" + aData.FILENAMEXPDL + "<\/a>"); - }, - failure:function(form, action) { - } - }); - - var exportProcesswindow = new Ext.Window({ - title : _('ID_EXPORT_PROCESS'), - collapsible: false, - maximizable: false, - sizeable : false, - width : 420, - height : 210, - resizable : false, - layout : 'fit', - plain : true, - buttonAlign: 'center', - items : exportProcessForm - }); - - workflow.exportProcesswindow = exportProcesswindow; - exportProcesswindow.show(); -} - -ProcessMapContext.prototype.addTask= function() - { - var newShape = eval("new bpmnTask(workflow)"); - var xPos = workflow.contextX; - var yPos = workflow.contextY; - workflow.addFigure(newShape, xPos, yPos); - newShape.actiontype = 'addTask'; - workflow.saveShape(newShape); //Saving Annotations when user drags and drops it - } - -ProcessMapContext.prototype.horiLine= function() - { - PMExt.notify( _('ID_STATUS') , _('ID_HORIZONTAL_LINE') ); - } - -ProcessMapContext.prototype.vertiLine= function() - { - PMExt.notify( _('ID_STATUS') , _('ID_VERTICAL_LINE') ); - } - -ProcessMapContext.prototype.delLines= function() - { - PMExt.notify( _('ID_STATUS') , _('ID_DELETE_LINES') ); - } - -ProcessMapContext.prototype.processPermission= function() - { - //Process Permission store code starts here - var dbConnFields = Ext.data.Record.create([ - { name: 'OP_UID',type: 'string'}, - { name: 'LABEL',type: 'string'}, - { name: 'TASK_TARGET',type: 'string'}, - { name: 'GROUP_USER',type: 'string'}, - { name: 'TASK_SOURCE',type: 'string'}, - { name: 'PARTICIPATED',type: 'string'}, - { name: 'OBJECT_TYPE',type: 'string'}, - { name: 'OBJECT',type: 'string'}, - { name: 'ACTION',type: 'string'}, - { name: 'OP_CASE_STATUS',type: 'string'}, - { name: 'DYNAFORM',type: 'string'}, - { name: 'INPUT',type: 'string'}, - { name: 'OUTPUT',type: 'string'}, - { name: 'TAS_UID',type: 'string'}, - { name: 'OP_TASK_SOURCE',type: 'string'}, - { name: 'OP_PARTICIPATE',type: 'string'}, - { name: 'OP_OBJ_TYPE',type: 'string'}, - { name: 'OP_GROUP_USER',type: 'string'}, - { name: 'OBJ_NAME',type: 'string'}, - { name: 'OP_ACTION',type: 'string'}, - { name: 'USR_FULLNAME',type: 'string'}, - { name: 'DYNAFORM_NAME',type: 'string'}, - { name: 'INPUT_NAME',type: 'string'}, - { name: 'OUTPUT_NAME',type: 'string'} - ]); - - //Creating different stores required for fields in form - var selectField = Ext.data.Record.create([ - { name: 'LABEL',type: 'string'}, - { name: 'UID',type: 'string'} - ]); - - var editor = new Ext.ux.grid.RowEditor({ - saveText: _('ID_UPDATE') - }); - - var btnCreate = new Ext.Button({ - id: 'btnCreate', - text: _('ID_NEW'), - iconCls: 'button_menu_ext ss_sprite ss_add', - handler: function () { - PermissionForm.getForm().reset(); - formWindow.show(); - - } - }); - - var editProPermission = function() { - editor.stopEditing(); - var rowSelected = Ext.getCmp('permissiongrid').getSelectionModel().getSelections(); - if( rowSelected.length == 0 ) { - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - return false; - } - var opUID = rowSelected[0].get('OP_UID'); - PermissionForm.form.load({ - url:'bpmn/proxyExtjs.php?pid='+pro_uid+'&op_uid=' +opUID+'&action=editObjectPermission', - method:'GET', - waitMsg:'Loading', - success:function(form, action) { - formWindow.show(); - if(action.result.data.OP_PARTICIPATE == 1) - form.findField('OP_PARTICIPATE').setValue('Yes'); - else - form.findField('OP_PARTICIPATE').setValue('No'); - - if(action.result.data.OP_OBJ_TYPE == 'DYNAFORM') - Ext.getCmp('dynaform').show(); - if(action.result.data.OP_OBJ_TYPE == 'INPUT') - Ext.getCmp('inputdoc').show(); - if(action.result.data.OP_OBJ_TYPE == 'OUTPUT') - Ext.getCmp('outputdoc').show(); - }, - failure:function(form, action) { - PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED') ); - } - }); - } - - var deleteProPermission = function(){ - ids = Array(); - - editor.stopEditing(); - var rowsSelected = Ext.getCmp('permissiongrid').getSelectionModel().getSelections(); - - if( rowsSelected.length == 0 ) { - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - return false; - } - - for(i=0; i",record.data.CTO_UID); - } - }*/] - }), - sm: new Ext.grid.RowSelectionModel({ - singleSelect: true, - listeners: { - rowselect: function(smObj, rowIndex, record) { - workflow.currentrowIndex = rowIndex; - } - } - }), - stripeRows: true, - viewConfig: {forceFit: true}, - tbar: tb, - bbar: new Ext.PagingToolbar({ - pageSize: 10, - store: assignedStore, - displayInfo: true, - displayMsg: 'Displaying Case Tracker Object {0} - {1} of {2}', - emptyMsg: "No Case Tracker Object to display", - items:[] - }) - }); - - editor.on({ - scope: this, - afteredit: function(roweditor, changes, record, rowIndex) { - var objType = record.data.OBJECT_TYPE; - var objUID = record.data.OBJECT_UID; - var objTitle = record.data.OBJECT_TITLE; - var cto_uid = record.data.CTO_UID; - var condition = record.data.CTO_CONDITION; - - Ext.Ajax.request({ - url : '../tracker/tracker_Ajax.php', - method: 'POST', - params:{ - PRO_UID : pro_uid, - OBJECT_TYPE : objType, - OBJECT_UID : objUID, - action :'assignCaseTrackerObject' - }, - success: function (response) - { - cto_uid = response.responseText; - Ext.Ajax.request({ - url : '../tracker/tracker_ConditionsSave.php', - method: 'POST', - params: - { - PRO_UID : pro_uid, - CTO_UID : cto_uid, - CTO_CONDITION : condition - }, - success: function (response){ - PMExt.notify( _('ID_STATUS') , _('ID_OBJECT_ASSIGNED') ); - availableStore.reload(); - assignedStore.reload(); - } - }) - }, - failure: function () { // when saving data failed - PMExt.notify( _('ID_STATUS') , _('ID_OBJECT_FAILED') ); - } - }) - //Updating the user incase if already assigned user has been replaced by other user - if(changes != '' && typeof record.json != 'undefined') - { - var obj_type = record.json.CTO_TYPE_OBJ; - var obj_UID = record.json.CTO_UID; - var obj_title = record.json.CTO_TITLE; - var obj_uid = record.json.CTO_UID; - var obj_condition = record.json.CTO_CONDITION; - var obj_position = record.json.CTO_POSITION; - - Ext.Ajax.request({ - url: '../tracker/tracker_Ajax.php', - method: 'POST', - params: { - action :'removeCaseTrackerObject', - CTO_UID : obj_UID, - PRO_UID : pro_uid, - STEP_POSITION : obj_position - }, - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_OBJECT_UPDATE') ); - } - }); - } - availableStore.reload(); - assignedStore.reload(); - } - }); - - var gridObjectWindow = new Ext.Window({ - title : 'Objects', - collapsible : false, - maximizable : false, - width : 550, - defaults :{ autoScroll:true }, - height : 380, - minWidth : 200, - minHeight : 150, - plain : true, - items : Objectsgrid, - buttonAlign : 'center' - }); - gridObjectWindow.show() -} - -ProcessMapContext.prototype.ExtVariables = function() -{ - var varFields = Ext.data.Record.create([ - { - name: 'variable', - type: 'string' - }, - { - name: 'type', - type: 'string' - }, - { - name: 'label', - type: 'string' - } - ]); - var varStore = ''; - varStore = new Ext.data.JsonStore({ - root : 'data', - totalProperty: 'totalCount', - idProperty : 'gridIndex', - remoteSort : true, - fields : varFields, - proxy : new Ext.data.HttpProxy({ - url : 'bpmn/proxyExtjs?pid='+pro_uid+'&action=getVariables&sFieldName=form[CTO_CONDITION]&sSymbol=@@' - }) - }); - //varStore.load(); - - var varColumns = new Ext.grid.ColumnModel({ - columns: [ - new Ext.grid.RowNumberer(), - { - id: 'FLD_NAME', - header: _('ID_VARIABLES'), - dataIndex: 'variable', - width: 170, - editable: false, - sortable: true - },{ - id: 'PRO_VARIABLE', - header: _('ID_LABEL'), - dataIndex: 'label', - width: 150, - sortable: true - } - ] - }); - - var varForm = new Ext.FormPanel({ - labelWidth: 100, - monitorValid : true, - width : 400, - bodyStyle : 'padding:10px 0 0 10px;', - height : 350, - renderer: function(val){return '
@@ Replace the value in quotes
';}, - items: - { - xtype:'tabpanel', - activeTab: 0, - defaults:{ - autoHeight:true - }, - items:[{ - title:_('ID_ALL_VARIABLES'), - id :'allVar', - layout:'form', - listeners: { - activate: function(tabPanel){ - // use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request. - var link = 'bpmn/proxyExtjs?pid='+pro_uid+'&action=getVariables&type='+tabPanel.id+'&sFieldName=form[CTO_CONDITION]&sSymbol=@@'; - varStore.proxy.setUrl(link, true); - varStore.load(); - } - }, - items:[{ - xtype: 'grid', - ds: varStore, - cm: varColumns, - width: 380, - autoHeight: true, - //plugins: [editor], - //loadMask : true, - loadingText : 'Loading...', - border: false, - listeners: { - //rowdblclick: alert("ok"), - rowdblclick: function(){ - var objectSelected = workflow.variablesAction; - switch(objectSelected) - { - case 'grid': - var getObjectGridRow = workflow.gridObjectRowSelected; - var FieldSelected = workflow.gridField; - //getting selected row of variables - var rowSelected = this.getSelectionModel().getSelected(); - var rowLabel = rowSelected.data.variable; - - //Assigned new object with condition - if(typeof getObjectGridRow.colModel != 'undefined') - getObjectGridRow.colModel.config[3].editor.setValue(rowLabel); - //Assigning / updating Condition for a row - else - getObjectGridRow[0].set(FieldSelected,rowLabel); - - if(FieldSelected=='CTO_CONDITION') - { - Ext.Ajax.request({ - url : '../tracker/tracker_ConditionsSave.php', - method: 'POST', - params: - { - PRO_UID : pro_uid, - CTO_UID : getObjectGridRow[0].data.CTO_UID, - CTO_CONDITION : getObjectGridRow[0].data.CTO_CONDITION - }, - success: function (response){ - Ext.MessageBox.alert ('Status','Objects has been edited successfully '); - } - }) - } - else if (FieldSelected=='STEP_CONDITION') - { - Ext.Ajax.request({ - url : '../steps/conditions_Save.php', - method: 'POST', - params: - { - PRO_UID : pro_uid, - STEP_UID : getObjectGridRow[0].data.STEP_UID, - STEP_CONDITION : getObjectGridRow[0].data.STEP_CONDITION - }, - success: function (response){ - Ext.MessageBox.alert ('Status','Objects has been edited successfully '); - } - }) - } - else if (FieldSelected=='ST_CONDITION') - { - Ext.Ajax.request({ - url : '../steps/steps_Ajax.php', - method: 'POST', - params: - { - action : 'saveTriggerCondition', - PRO_UID : pro_uid, - STEP_UID : getObjectGridRow[0].data.STEP_UID, - ST_CONDITION : getObjectGridRow[0].data.STEP_CONDITION, - TAS_UID : taskId, - TRI_UID : getObjectGridRow[0].data.TRI_UID, - ST_TYPE : getObjectGridRow[0].data.ST_TYPE - - }, - success: function (response){ - Ext.MessageBox.alert ('Status','Objects has been edited successfully '); - } - }) - } - - window.hide(); - - - break; - case 'form': - FormSelected = workflow.formSelected; - rowSelected = this.getSelectionModel().getSelected(); - FieldSelected = workflow.fieldName; - rowLabel = rowSelected.data.variable; - var value = FormSelected.getForm().findField(FieldSelected).setValue(rowLabel); - window.hide(); - break; - - } - - } - } - }] - },{ - title:_('ID_SYSTEM'), - id:'system', - layout:'form', - listeners:{ - activate: function(tabPanel){ - // use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request. - var link = 'bpmn/proxyExtjs?pid='+pro_uid+'&action=getVariables&type='+tabPanel.id+'&sFieldName=form[CTO_CONDITION]&sSymbol=@@'; - varStore.proxy.setUrl(link, true); - varStore.load(); - } - }, - items:[{ - xtype: 'grid', - ds: varStore, - cm: varColumns, - width: 380, - autoHeight: true, - //plugins: [editor], - //loadMask : true, - loadingText : 'Loading...', - border: false, - listeners: { - //rowdblclick: alert("ok"), - rowdblclick: function(){ - var objectSelected = workflow.variablesAction; - switch(objectSelected) - { - case 'grid': - var getObjectGridRow = workflow.gridObjectRowSelected; - var FieldSelected = workflow.gridField; - //getting selected row of variables - var rowSelected = this.getSelectionModel().getSelected(); - var rowLabel = rowSelected.data.variable; - //Assigned new object with condition - if(typeof getObjectGridRow.colModel != 'undefined') - getObjectGridRow.colModel.config[3].editor.setValue(rowLabel); - //Assigning / updating Condition for a row - else - getObjectGridRow[0].set(FieldSelected,rowLabel); - if(CTO_UID!='') - { - Ext.Ajax.request({ - url : '../tracker/tracker_ConditionsSave.php', - method: 'POST', - params: - { - PRO_UID : pro_uid, - CTO_UID : getObjectGridRow[0].data.CTO_UID, - CTO_CONDITION : getObjectGridRow[0].data.CTO_CONDITION - }, - success: function (response){ - Ext.MessageBox.alert ('Status','Objects has been edited successfully '); - } - }) - window.hide(); - } - - break; - case 'form': - FormSelected = workflow.formSelected; - rowSelected = this.getSelectionModel().getSelected(); - FieldSelected = workflow.fieldName; - rowLabel = rowSelected.data.variable; - var value = FormSelected.getForm().findField(FieldSelected).setValue(rowLabel); - window.hide(); - break; - - } - - } - } - }] - },{ - title:_('ID_CASESLIST_APP_PRO_TITLE'), - id :'process', - layout:'form', - listeners: { - activate: function(tabPanel){ - // use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request. - var link = 'bpmn/proxyExtjs?pid='+pro_uid+'&action=getVariables&type='+tabPanel.id+'&sFieldName=form[CTO_CONDITION]&sSymbol=@@'; - varStore.proxy.setUrl(link, true); - varStore.load(); - } - }, - items:[{ - xtype: 'grid', - ds: varStore, - cm: varColumns, - width: 380, - autoHeight: true, - //plugins: [editor], - //loadMask : true, - loadingText : 'Loading...', - border: false, - listeners: { - //rowdblclick: alert("ok"), - rowdblclick: function(){ - var objectSelected = workflow.variablesAction; - switch(objectSelected) - { - case 'grid': - var getObjectGridRow = workflow.gridObjectRowSelected; - var FieldSelected = workflow.gridField; - //getting selected row of variables - var rowSelected = this.getSelectionModel().getSelected(); - var rowLabel = rowSelected.data.variable; - //Assigned new object with condition - if(typeof getObjectGridRow.colModel != 'undefined') - getObjectGridRow.colModel.config[3].editor.setValue(rowLabel); - //Assigning / updating Condition for a row - else - getObjectGridRow[0].set(FieldSelected,rowLabel); - Ext.Ajax.request({ - url : '../tracker/tracker_ConditionsSave.php', - method: 'POST', - params: - { - PRO_UID : pro_uid, - CTO_UID : getObjectGridRow[0].data.CTO_UID, - CTO_CONDITION : getObjectGridRow[0].data.CTO_CONDITION - }, - success: function (response){ - Ext.MessageBox.alert ('Status','Objects has been edited successfully '); - } - }) - window.hide(); - break; - case 'form': - FormSelected = workflow.formSelected; - rowSelected = this.getSelectionModel().getSelected(); - FieldSelected = workflow.fieldName; - rowLabel = rowSelected.data.variable; - var value = FormSelected.getForm().findField(FieldSelected).setValue(rowLabel); - window.hide(); - break; - - } - - } - } - }] - }] - } - - }); - - var window = new Ext.Window({ - title: _('ID_VARIABLES'), - collapsible: false, - maximizable: false, - scrollable: true, - width: 400, - height: 350, - minWidth: 200, - minHeight: 150, - autoScroll: true, - layout: 'fit', - plain: true, - buttonAlign: 'center', - items: [varForm] - }); - window.show(); -} diff --git a/workflow/engine/templates/bpmn/ProcessOptions.js b/workflow/engine/templates/bpmn/ProcessOptions.js deleted file mode 100755 index 373200f8a..000000000 --- a/workflow/engine/templates/bpmn/ProcessOptions.js +++ /dev/null @@ -1,3911 +0,0 @@ -var workflow = {}; - -var ProcessOptions = function(id){ - //Workflow.call(this,id); -}; - -//ProcessOptions.prototype=new Workflow; -//ProcessOptions.prototype.type="ProcessOptions"; - -/** - * 'addDynaform' function that will allow adding new dynaforms and showing list of - * dynaforms available - */ -ProcessOptions.prototype.addDynaform= function(_5625) -{ - var dynaFields = Ext.data.Record.create([ - {name: 'DYN_UID'}, - {name: 'DYN_TYPE'}, - {name: 'DYN_TITLE'}, - {name: 'DYN_DESCRIPTION'}, - {name: 'TAS_EDIT'}, - {name: 'TAS_VIEW'}, - {name: 'ACTION'} - ]); - - var editor = new Ext.ux.grid.RowEditor({ - saveText: 'Update' - }); - - var btnAdd = new Ext.Button({ - id: 'btnEdit', - text: _('ID_NEW'), - iconCls: 'button_menu_ext ss_sprite ss_add', - //iconCls: 'application_add', - handler: function () { - dynaformDetails.getForm().reset(); - dynaformDetails.getForm().items.items[0].focus('',200); - dynaformDetails.getForm().items.items[1].setValue('normal'); - formWindow.show(); - } - }); - - //edit dynaform Function - var editDynaform = function() { - var rowSelected = Ext.getCmp('dynaformGrid').getSelectionModel().getSelected(); - - if( rowSelected ) { - //location.href = '../dynaforms/dynaforms_Editor?PRO_UID='+pro_uid+'&DYN_UID='+rowSelected.data.DYN_UID+'&bpmn=1' - var url = 'dynaforms/dynaforms_Editor?PRO_UID='+pro_uid+'&DYN_UID='+rowSelected.data.DYN_UID+'&bpmn=1'; - Ext.getCmp('mainTabPanel')._addTabFrame(rowSelected.data.DYN_UID, rowSelected.data.DYN_TITLE, url); - } else - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - } - - var removeDynaform = function() { - ids = Array(); - - editor.stopEditing(); - var rowsSelected = Ext.getCmp('dynaformGrid').getSelectionModel().getSelections(); - - if( rowsSelected.length == 0 ) { - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - return false; - } - - for(i=0; i"+TRANSLATIONS.ID_DESCRIPTION+": {DYN_DESCRIPTION}

") - }); - - var dynaformColumns = new Ext.grid.ColumnModel({ - defaults: { - width: 90, - sortable: true - }, - columns: [ - expander, - { - header: _('ID_TITLE_FIELD'), - dataIndex: 'DYN_TITLE', - width: 280 - },{ - header: _('ID_TYPE'), - dataIndex: 'DYN_TYPE', - width: 90 - },{ - sortable: false, - header: _('ID_TAS_EDIT'), - dataIndex: 'TAS_EDIT', - width: 110 - },{ - sortable: false, - header: _('ID_TAS_VIEW'), - dataIndex: 'TAS_VIEW', - width: 110 - } - ] - }); - - - var addTableColumns = new Ext.grid.ColumnModel({ - columns: [ - new Ext.grid.RowNumberer(), - { - id: 'FLD_NAME', - header: _('ID_PRIMARY_KEY'), - dataIndex: 'FLD_NAME', - width: 200, - editable: false, - sortable: true, - editor: new Ext.form.TextField({ - allowBlank: false - }) - },{ - id: 'PRO_VARIABLE', - header: _('ID_VARIABLES'), - dataIndex: 'PRO_VARIABLE', - width: 200, - sortable: true, - editor: new Ext.form.TextField({ - allowBlank: false - }) - },{ - sortable: false, - renderer: function(val){return '';} - } - ] - }); - - var dynaformGrid = new Ext.grid.GridPanel({ - store: taskDynaform, - id : 'dynaformGrid', - loadMask: true, - loadingText: 'Loading...', - //renderTo: 'cases-grid', - frame: false, - autoHeight:false, - minHeight:400, - height :400, - width: '', - layout: 'fit', - cm: dynaformColumns, - stateful : true, - stateId : 'grid', - plugins: expander, - stripeRows: true, - tbar: tb, - bbar: new Ext.PagingToolbar({ - pageSize: 10, - store: taskDynaform, - displayInfo: true, - displayMsg: 'Displaying dynaforms {0} - {1} of {2}', - emptyMsg: "No users to display", - items:[] - }), - viewConfig: {forceFit: true} - }); - - //connecting context menu to grid - dynaformGrid.addListener('rowcontextmenu', onDynaformsContextMenu,this); - dynaformGrid.addListener('rowdblclick', editDynaform,this); - - //by default the right click is not selecting the grid row over the mouse - //we need to set this four lines - dynaformGrid.on('rowcontextmenu', function (grid, rowIndex, evt) { - var sm = grid.getSelectionModel(); - sm.selectRow(rowIndex, sm.isSelected(rowIndex)); - }, this); - - //prevent default - dynaformGrid.on('contextmenu', function (evt) { - evt.preventDefault(); - }, this); - - function onDynaformsContextMenu(grid, rowIndex, e) { - e.stopEvent(); - var coords = e.getXY(); - dynaformsContextMenu.showAt([coords[0], coords[1]]); - } - - var dynaformsContextMenu = new Ext.menu.Menu({ - id: 'messageContextMenu', - items: [{ - text: _('ID_EDIT'), - iconCls: 'button_menu_ext ss_sprite ss_pencil', - handler: editDynaform - },{ - text: _('ID_DELETE'), - icon: '/images/delete.png', - handler: removeDynaform - },{ - text: _('ID_UID'), - handler: function(){ - var rowSelected = Ext.getCmp('dynaformGrid').getSelectionModel().getSelected(); - workflow.createUIDButton(rowSelected.data.DYN_UID); - } - } - ] - }); - - - - var dynaformDetails = new Ext.FormPanel({ - labelWidth : 100, - buttonAlign : 'center', - width : 490, - height : 420, - bodyStyle : 'padding:10px 0 0 10px;', - autoHeight: true, - items: - [ -// { -// xtype: 'fieldset', -// layout: 'fit', -// border:true, -// title: _('ID_SELECT_DYNAFORM'), -// width: 500, -// collapsible: false, -// labelAlign: 'top', -// items:[{ -// xtype: 'radiogroup', -// //id: 'dynaformType', -// layout: 'fit', -// fieldLabel: _('ID_TYPE'), -// itemCls: 'x-check-group-alt', -// columns: 1, -// items: [ -// { -// boxLabel: _('ID_BLANK_DYNAFORM'), -// name: 'DYN_SOURCE', -// inputValue: 'blankDyna', -// checked: true -// }, -// { -// boxLabel: _('ID_PM_DYNAFORM'), -// name: 'DYN_SOURCE', -// inputValue: 'pmTableDyna' -// }], -// listeners: { -// change: function(radiogroup, radio) { -// if(radio.inputValue == 'blankDyna') -// { -// Ext.getCmp("blankDynaform").show(); -// var f = form.findField('yourField'); -// f.container.up('div.x-form-item').hide(); -// } -// else -// { -// Ext.getCmp("blankDynaform").hide(); -// Ext.getCmp("pmTableDynaform").show(); -// } -// } -// } -// }] -// }, - - { - xtype: 'fieldset', - id: 'blankDynaform', - border:true, - hidden: false, - title: _('ID_DYNAFORM_INFORMATION'), - width: 500, - items:[{ - xtype : 'textfield', - fieldLabel: _('ID_TITLE'), - name : 'DYN_TITLE1', - width : 350, - allowBlank: false - },{ - width : 350, - xtype : 'combo', - allowBlank : false, - mode : 'local', - editable : false, - fieldLabel : _('ID_TYPE'), - triggerAction : 'all', - forceSelection : true, - name : 'DYN_TYPE', - valueField : 'value', - displayField : 'name', - value : 'normal', - store : new Ext.data.JsonStore({ - fields : ['value', 'name'], - data : [ - {value: 'normal', name : _('ID_NORMAL')}, - {value: 'grid', name : _('ID_GRID')} - ] - }) - },{ - xtype : 'textarea', - fieldLabel: _('ID_DESCRIPTION'), - name : 'DYN_DESCRIPTION1', - height : 120, - width : 350 - } - ] - } -// ,{ -// xtype: 'fieldset', -// id: 'pmTableDynaform', -// border:true, -// hidden: true, -// title: 'Dynaform Information', -// width: 500, -// items:[{ -// width: 350, -// xtype: 'combo', -// mode: 'local', -// editable: true, -// triggerAction: 'all', -// forceSelection: true, -// fieldLabel: _('ID_CREATE_PM_TABLE'), -// emptyText : 'Select Table', -// displayField: 'ADD_TAB_NAME', -// valueField: 'ADD_TAB_UID', -// value : '---------------------------', -// store : additionalTables, -// onSelect: function(record, index){ -// var link = 'bpmn/proxyExtjs?tabId='+record.data.ADD_TAB_UID+'&action=getPMTableDynaform'; -// tablesFieldsStore.proxy.setUrl(link, true); -// tablesFieldsStore.load(); -// -// Ext.getCmp("fieldsGrid").show(); -// Ext.getCmp("pmTable").setValue(record.data.ADD_TAB_UID); -// -// this.setValue(record.data[this.valueField || this.displayField]); -// this.collapse(); -// } -// },{ -// xtype:'hidden',//<--hidden field -// name:'ADD_TABLE', -// id :'pmTable' -// }, -// { -// xtype : 'textfield', -// fieldLabel: _('ID_TITLE'), -// name : 'DYN_TITLE2', -// allowBlank: false, -// width : 350 -// },{ -// xtype : 'textarea', -// fieldLabel: _('ID_DESCRIPTION'), -// name : 'DYN_DESCRIPTION2', -// height : 120, -// width : 350 -// }, -// { -// xtype: 'grid', -// id:'fieldsGrid', -// hidden: true, -// store: tablesFieldsStore, -// cm: addTableColumns, -// width: 500, -// //height: 300, -// autoHeight: true, -// clicksToEdit: 1, -// plugins: [editor], -// //loadMask : true, -// loadingText : 'Loading...', -// border: false -// //renderTo : Ext.getBody() -// } -// ] -// } - ], buttons: [{ - text: _('ID_SAVE'), - handler: function(){ - var getForm = dynaformDetails.getForm().getValues(); - //var sDynaformType = getForm.DYN_TYPE; - var sDynaformType = dynaformDetails.getForm().items.items[1].getValue(); - if ( sDynaformType == 'normal' || sDynaformType == '' ) - sDynaformType = 'xmlform'; - else - sDynaformType = 'grid'; - -// if ( getForm.DYN_SOURCE == 'blankDyna') -// { - var sTitle = getForm.DYN_TITLE1; - var sDesc = getForm.DYN_DESCRIPTION1; -// } -// else -// { -// var sAddTab = getForm.ADD_TABLE; -// var aStoreFields = tablesFieldsStore.data.items; -// var fName = new Array(); -// var pVar = new Array(); -// for(var i=0;i"+TRANSLATIONS.ID_DESCRIPTION+": {DBS_DESCRIPTION}

" - ) - }); - - - var dbGridColumn = new Ext.grid.ColumnModel({ - columns: [ - expander, - { - id: 'DBS_TYPE', - header: _('ID_TYPE'), - dataIndex: 'DBS_TYPE', - //width: 100, - editable: false, - sortable: true, - editor: new Ext.form.TextField({ - //allowBlank: false - }) - },{ - id: 'DBS_SERVER', - header: _('ID_SERVER'), - dataIndex: 'DBS_SERVER', - //width: 100, - sortable: true, - editor: new Ext.form.TextField({ - //allowBlank: false - }) - },{ - id: 'DBS_DATABASE_NAME', - header: _('ID_DATABASE_NAME'), - dataIndex: 'DBS_DATABASE_NAME', - width: 150, - sortable: true, - editor: new Ext.form.TextField({ - // allowBlank: false - }) - },{ - id: 'DBS_DESCRIPTION', - header: _('ID_DESCRIPTION'), - dataIndex: 'DBS_DESCRIPTION', - width: 100, - sortable: true, - editor: new Ext.form.TextField({ - }) - } - ] - }); - - var dbGrid = new Ext.grid.GridPanel({ - store: dbStore, - id : 'dbConnGrid', - loadMask: true, - loadingText: 'Loading...', - //renderTo: 'cases-grid', - frame: false, - autoHeight:false, - clicksToEdit: 1, - width:480, - minHeight:400, - height :380, - layout: 'fit', - cm: dbGridColumn, - plugins: expander, - stripeRows: true, - tbar: tb, - bbar: new Ext.PagingToolbar({ - pageSize: 10, - store: dbStore, - displayInfo: true, - displayMsg: 'Displaying DB Connection {0} - {1} of {2}', - emptyMsg: "No DB Connection to display", - items:[] - }), - viewConfig: {forceFit: true} - }); - - //connecting context menu to grid - dbGrid.addListener('rowcontextmenu', ondbGridContextMenu,this); - - //by default the right click is not selecting the grid row over the mouse - //we need to set this four lines - dbGrid.on('rowcontextmenu', function (grid, rowIndex, evt) { - var sm = grid.getSelectionModel(); - sm.selectRow(rowIndex, sm.isSelected(rowIndex)); - }, this); - - //prevent default - dbGrid.on('contextmenu', function (evt) { - evt.preventDefault(); - }, this); - - function ondbGridContextMenu(grid, rowIndex, e) { - e.stopEvent(); - var coords = e.getXY(); - dbGridContextMenu.showAt([coords[0], coords[1]]); - } - - var dbGridContextMenu = new Ext.menu.Menu({ - id: 'messageContextMenu', - items: [{ - text: _('ID_EDIT'), - iconCls: 'button_menu_ext ss_sprite ss_pencil', - handler: editDBConn - },{ - text: _('ID_DELETE'), - icon: '/images/delete.png', - handler: removeDBConn - },{ - text: _('ID_UID'), - handler: function(){ - var rowSelected = Ext.getCmp('dbConnGrid').getSelectionModel().getSelected(); - workflow.createUIDButton(rowSelected.data.DBS_UID); - } - } - ] - }); - - - var dbconnForm =new Ext.FormPanel({ - // title:"Add new Database Source", - collapsible: false, - maximizable: true, - //allowBlank:false, - width:400, - frame:false, - autoDestroy : true, - monitorValid : true, - plain: true, - bodyStyle : 'padding:10px 0 0 10px;', - buttonAlign: 'center', - items:[{ - xtype: 'combo', - width: 200, - mode: 'local', - editable: false, - fieldLabel: _('ID_ENGINE'), - triggerAction: 'all', - forceSelection: true, - name: 'DBS_TYPE', - displayField: 'name', - emptyText : 'Select Format', - valueField : 'value', - allowBlank: false, - //value : 'Select', - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name : 'Select', value: 'select'}, - {name : 'MySql', value: 'MySql'}, - {name : 'PostGreSql', value: 'PostGreSql'}, - {name : 'Microsoft SQL server', value: 'Microsoft SQL server'} - ]}), - onSelect: function(record, index) { - //Show-Hide Format Type Field - if(record.data.value == 'MySql') - { - Ext.getCmp("encode").show(); - Ext.getCmp("postgre").hide(); - dbconnForm.getForm().findField('DBS_PORT').setValue('3306'); - } - else if(record.data.value == 'PostGreSql') - { - Ext.getCmp("postgre").show(); - Ext.getCmp("encode").hide(); - dbconnForm.getForm().findField('DBS_PORT').setValue('5432'); - } - else - { - Ext.getCmp("sqlserver").show(); - Ext.getCmp("postgre").hide(); - dbconnForm.getForm().findField('DBS_PORT').setValue('1433'); - } - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - },{ - xtype: 'fieldset', - id: 'encode', - border:false, - hidden: true, - items: [{ - xtype: 'combo', - width: 220, - mode: 'local', - // hidden: true, - editable: false, - fieldLabel: _('ID_ENCODE'), - triggerAction: 'all', - forceSelection: true, - //dataIndex : 'ENGINE', - displayField: 'value', - valueField: 'name', - name: 'DBS_ENCODE', - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name:'armscii8', value:'armscii8 - ARMSCII-8 Armenian'}, - {name:'ascii', value:'ascii - US ASCII'}, - {name:'big5', value:'big5 - Big5 Traditional Chinese'}, - {name:'binary', value: 'binary - Binary pseudo charset'}, - {name:'cp850', value:'cp850 - DOS West European'}, - {name:'cp852', value: 'cp852 - DOS Central European'}, - {name:'cp866', value:'cp866 - DOS Russian'}, - {name:'cp932', value: 'cp932] - SJIS for Windows Japanese'}, - {name:'cp1250', value: 'cp1250 - Windows Central European'}, - {name:'cp1251', value: 'cp1251 - Windows Cyrillic'}, - {name:'cp1256', value: 'cp1256 - Windows Arabic'}, - {name:'cp1257', value: 'cp1257 - Windows Baltic'}, - {name:'dec8', value:'dec8 - DEC West European'}, - {name:'eucjpms', value: 'eucjpms - UJIS for Windows Japanese'}, - {name:'euckr', value: 'euckr - EUC-KR Korean'}, - {name:'gb2312', value: 'gb2312 - GB2312 Simplified Chinese'}, - {name:'gbk', value: 'gbk - GBK Simplified Chinese'}, - {name:'geostd8', value: 'geostd8 - GEOSTD8 Georgian'}, - {name:'greek', value: 'greek - ISO 8859-7 Greek'}, - {name:'hebrew', value: 'hebrew - ISO 8859-8 Hebrew'}, - {name:'hp8', value: 'hp8 - HP West European'}, - {name:'keybcs2', value: 'keybcs2 - DOS Kamenicky Czech-Slovak'}, - {name:'koi8r', value:'koi8r - KOI8-R Relcom Russian'}, - {name:'koi8u', value: 'koi8u - KOI8-U Ukrainian'}, - {name:'latin1', value:'latin1 - cp1252 West European'}, - {name:'latin2', value:'latin2 - ISO 8859-2 Central European'}, - {name:'latin5', value:'latin5 - ISO 8859-9 Turkish'}, - {name:'latin7', value: 'atin7 - ISO 8859-13 Baltic'}, - {name:'macce', value: 'macce - Mac Central European'}, - {name:'macroman', value:'macroman - Mac West European'}, - {name:'sjis', value:'sjis - Shift-JIS Japanese'}, - {name:'swe7', value:'swe7 - 7bit Swedish'}, - {name:'tis620', value: 'tis620 - TIS620 Thai'}, - {name:'ucs2', value:'ucs2 - UCS-2 Unicode'}, - {name:'ujis', value:'ujis - EUC-JP Japanese'}, - {name:'utf8', value:'utf8 - UTF-8 Unicode'} - ]}), - onSelect: function(record, index){ - dbconnForm.getForm().findField('DBS_ENCODE').setValue(record.data.value); - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - }] - - },{ - xtype: 'fieldset', - id: 'postgre', - border:false, - hidden: true, - items:[{ - xtype: 'combo', - width: 220, - mode: 'local', - // hidden: true, - editable:false, - fieldLabel:_('ID_ENCODE'), - triggerAction: 'all', - forceSelection: true, - //dataIndex : 'ENGINE', - displayField: 'name', - valueField: 'value', - name: 'DBS_ENCODE', - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name:"BIG5", value:"BIG5"}, - {name:"EUC_CN", value:"EUC_CN"}, - {name:"EUC_JP", value:"EUC_JP"}, - {name:"EUC_KR", value:"EUC_KR"}, - {name:"EUC_TW", value:"EUC_TW"}, - {name:"GB18030", value:"GB18030"}, - {name:"GBK", value:"GBK"}, - {name:"ISO_8859_5", value:"ISO_8859_5"}, - {name:"ISO_8859_6", value:"ISO_8859_6"}, - {name:"ISO_8859_7", value:"ISO_8859_7"}, - {name:"ISO_8859_8", value: "ISO_8859_8"}, - {name:"JOHAB", value:"JOHAB"}, - {name:"KOI8", value: "KOI8"}, - {name:"selected", value: "LATIN1"}, - {name:"LATIN2", value:"LATIN2"}, - {name:"LATIN3", value:"LATIN3"}, - {name:"LATIN4", value: "LATIN4"}, - {name:"LATIN5", value:"LATIN5"}, - {name:"LATIN6", value: "LATIN6"}, - {name:"LATIN7", value:"LATIN7"}, - {name:"LATIN8", value:"LATIN8"}, - {name:"LATIN9", value:"LATIN9"}, - {name:"LATIN10", value:"LATIN10"}, - {name:"SJIS", value:"SJIS"}, - {name:"SQL_ASCII", value:"SQL_ASCII"}, - {name:"UHC", value: "UHC"}, - {name:"UTF8", value: "UTF8"}, - {name:"WIN866", value: "WIN866"}, - {name:"WIN874", value:"WIN874"}, - {name:"WIN1250", value:"WIN1250"}, - {name:"WIN1251", value:"WIN1251"}, - {name:"WIN1252", value:"WIN1252"}, - {name:"WIN1256", value:"WIN1256"}, - {name:"WIN1258", value:"WIN1258"} - ]}), - onSelect: function(record, index){ - dbconnForm.getForm().findField('DBS_ENCODE').setValue(record.data.value); - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - }] - },{ - xtype: 'fieldset', - id: 'sqlserver', - border:false, - hidden: true, - items:[{ - xtype: 'combo', - width: 220, - mode: 'local', - editable: false, - fieldLabel: _('ID_ENCODE'), - triggerAction: 'all', - forceSelection: true, - //dataIndex : 'ENGINE', - displayField: 'name', - valueField: 'value', - name: 'DBS_ENCODE', - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name:'utf8', value: 'utf8'} - ]}), - onSelect: function(record, index){ - dbconnForm.getForm().findField('DBS_ENCODE').setValue(record.data.value); - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - }] - - },{ - xtype: 'textfield', - fieldLabel: _('ID_SERVER'), - name: 'DBS_SERVER', - width: 200, - allowBlank: false - },{ - xtype: 'textfield', - fieldLabel: _('ID_DATABASE_NAME'), - name: 'DBS_DATABASE_NAME', - width: 200, - allowBlank: false - },{ - xtype: 'textfield', - fieldLabel: _('ID_USERNAME'), - name: 'DBS_USERNAME', - width: 200, - allowBlank: false - },{ - xtype: 'textfield', - fieldLabel: _('ID_CACHE_PASSWORD'), - inputType:'password', - width: 200, - name: 'DBS_PASSWORD', - allowBlank: true - },{ - xtype: 'textfield', - fieldLabel: _('ID_PORT'), - name: 'DBS_PORT', - width: 200, - //id:'port', - //allowBlank: false, - editable:false - },{ - xtype: 'textarea', - fieldLabel: _('ID_DESCRIPTION'), - name: 'DBS_DESCRIPTION', - allowBlank: true, - width: 220, - height:100 - },{ - id : 'DBS_UID', - xtype: 'hidden', - name : 'DBS_UID' - },{ - id : 'DBS_ENCODE', - xtype: 'hidden', - name : 'DBS_ENCODE' - }], - buttons: [{text:_('ID_TEST_CONNECTION'), - id: 'test', - //formbind: true, - handler: function(){ - // testConnWindow.show(); - } - },{ - text: _('ID_SAVE'), - formBind :true, - handler: function(){ - var getForm = dbconnForm.getForm().getValues(); - var dbConnUID = getForm.DBS_UID; - var Type = getForm.DBS_TYPE; - var Server = getForm.DBS_SERVER; - var DatabaseName = getForm.DBS_DATABASE_NAME; - var Username = getForm.DBS_USERNAME; - var Password = getForm.DBS_PASSWORD; - var Port = getForm.DBS_PORT; - var Description = getForm.DBS_DESCRIPTION; - var encode = getForm.DBS_ENCODE; - - - if(dbConnUID=='') - { - Ext.Ajax.request({ - url : '../dbConnections/dbConnectionsAjax.php', - method: 'POST', - params:{ - dbs_uid :dbConnUID, - type :Type, - server :Server, - db_name :DatabaseName, - user :Username , - passwd :Password, - port :Port, - desc :Description, - PROCESS :pro_uid, - enc :encode, - action :'saveConnection' - }, - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_DBS_CONNECTION_SAVE') ); - } - }); - } - else - { - Ext.Ajax.request({ - url : '../dbConnections/dbConnectionsAjax.php', - method: 'POST', - params:{ - dbs_uid :dbConnUID, - type :Type, - server :Server, - db_name :DatabaseName, - user :Username , - passwd :Password, - port :Port, - PROCESS :pro_uid, - desc :Description, - enc :encode, - action :'saveEditConnection' - }, - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_DBS_CONNECTION_EDIT') ); - } - }); - } - formWindow.hide(); - dbStore.reload(); - } - },{ - text: _('ID_CANCEL'), - handler: function(){ - // when this button clicked, - formWindow.hide(); - } - }] - }) - - - var formWindow = new Ext.Window({ - title: _('ID_DBS_SOURCE'), - collapsible: false, - maximizable: true, - width: 400, - //autoHeight: true, - //height: 400, - //layout: 'fit', - plain: true, - buttonAlign: 'center', - items: dbconnForm - }); - - var gridWindow = new Ext.Window({ - title: _('ID_DBS_LIST'), - collapsible: false, - maximizable: true, - width: 480, - //autoHeight: true, - height: 350, - //layout: 'fit', - plain: true, - buttonAlign: 'center', - items: dbGrid - }); - gridWindow.show(); -} -*/ - -ProcessOptions.prototype.addInputDoc= function(_5625) -{ - var gridWidow; - var inputDocGrid; - var inputDocStore; - var expander; - var inputDocColumns; - var render_version; - var newButton; - var editButton; - var deleteButton; - var saveButton; - var cancelButton; - var smodel; - var bbarpaging; - var idocsContextMenu; - var newIDocWindow; - var inputDocForm; - - //Renderer for Versioning Field - render_version = function(value){ - var out = ''; - switch(value){ - case '0': out = 'No'; break; - case '1': out = 'Yes'; break; - } - return out; - } - - - - newButton = new Ext.Action({ - text : _('ID_NEW'), - iconCls: 'button_menu_ext ss_sprite ss_add', - handler: function(){ - inputDocForm.getForm().reset(); - Ext.getCmp('idoc_FORM_NEEDED').setValue('VIRTUAL'); - Ext.getCmp('idoc_VERSIONING').setValue('0'); - inputDocForm.getForm().findField('INP_DOC_TAGS').setValue('INPUT'); - inputDocForm.getForm().findField('PRO_UID').setValue(pro_uid); - newIDocWindow.setTitle(_('ID_NEW_INPUTDOCS')); - newIDocWindow.show(); - } - }); - - editButton = new Ext.Action({ - text : _('ID_EDIT'), - iconCls: 'button_menu_ext ss_sprite ss_pencil', - disabled: true, - handler: function(){ - Ext.getCmp('designerTab').getEl().mask(_('ID_PROCESSING')); - rowselected = inputDocGrid.getSelectionModel().getSelected(); - Ext.Ajax.request({ - url: 'processOptionsProxy/loadInputDoc', - params: {IDOC_UID: rowselected.data.INP_DOC_UID}, - success: function(r,o){ - Ext.getCmp('designerTab').getEl().unmask(); - var res = Ext.decode(r.responseText); - if (res.success){ - inputDocForm.getForm().reset(); - Ext.getCmp('idoc_FORM_NEEDED').setValue(res.data.INP_DOC_FORM_NEEDED); - if (res.data.INP_DOC_FORM_NEEDED != 'VIRTUAL'){ - Ext.getCmp('formType').setValue(res.data.INP_DOC_ORIGINAL); - Ext.getCmp("formType").enable(); - } - Ext.getCmp('idoc_VERSIONING').setValue(res.data.INP_DOC_VERSIONING); - inputDocForm.getForm().findField('INP_DOC_TITLE').setValue(res.data.INP_DOC_TITLE); - inputDocForm.getForm().findField('INP_DOC_DESCRIPTION').setValue(res.data.INP_DOC_DESCRIPTION); - inputDocForm.getForm().findField('INP_DOC_DESTINATION_PATH').setValue(res.data.INP_DOC_DESTINATION_PATH); - inputDocForm.getForm().findField('INP_DOC_TAGS').setValue(res.data.INP_DOC_TAGS); - inputDocForm.getForm().findField('INP_DOC_UID').setValue(res.data.INP_DOC_UID); - inputDocForm.getForm().findField('PRO_UID').setValue(pro_uid); - newIDocWindow.setTitle(_('ID_EDIT_INPUTDOCS')); - newIDocWindow.show(); - }else{ - PMExt.notify(_('ID_REQUEST_DOCUMENTS'),res.msg); - } - }, - failure: function(r,o){ - Ext.getCmp('designerTab').getEl().unmask(); - PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED')); - } - }); - } - }); - - deleteButton = new Ext.Action({ - text : _('ID_DELETE'), - iconCls: 'button_menu_ext ss_sprite ss_delete', - disabled: true, - handler : function(){ - Ext.getCmp('designerTab').getEl().mask(_('ID_PROCESSING')); - rowselected = inputDocGrid.getSelectionModel().getSelected(); - Ext.Ajax.request({ - url: 'processOptionsProxy/canDeleteInputDoc', - params: {PRO_UID: pro_uid, IDOC_UID: rowselected.data.INP_DOC_UID}, - success: function(r,o){ - Ext.getCmp('designerTab').getEl().unmask(); - var res = Ext.decode(r.responseText); - if (res.success){ - Ext.Msg.confirm(_('ID_CONFIRM'),_('ID_CONFIRM_DELETE_INPUT_DOC'), function(btn, text){ - if (btn=='yes'){ - Ext.getCmp('designerTab').getEl().mask(_('ID_PROCESSING')); - Ext.Ajax.request({ - url: 'processOptionsProxy/deleteInputDoc', - params: {PRO_UID: pro_uid, IDOC_UID: rowselected.data.INP_DOC_UID}, - success: function(r,o){ - Ext.getCmp('designerTab').getEl().unmask(); - var resp = Ext.decode(r.responseText); - if (resp.success){ - editButton.disable(); - deleteButton.disable(); - inputDocGrid.store.load(); - PMExt.notify(_('ID_REQUEST_DOCUMENTS'),resp.msg); - }else{ - PMExt.error(_('ID_ERROR'), resp.msg); - } - }, - failure: function(r,o){ - Ext.getCmp('designerTab').getEl().unmask(); - PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED')); - } - - }); - } - }); - }else{ - PMExt.warning(_('ID_REQUEST_DOCUMENTS'),_('ID_MSG_CANNOT_DELETE_INPUT_DOC')); - } - }, - failure: function(r,o){ - Ext.getCmp('designerTab').getEl().unmask(); - PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED')); - } - }); - } - }); - - saveButton = new Ext.Action({ - text : _('ID_SAVE'), - disabled: false, - handler: function(){ - Ext.getCmp('designerTab').getEl().mask(_('ID_PROCESSING')); - inputDocForm.getForm().submit({ - success: function(f,a){ - Ext.getCmp('designerTab').getEl().unmask(); - var resp = Ext.decode(a.response.responseText); - if (resp.success){ - editButton.disable(); - deleteButton.disable(); - inputDocGrid.store.load(); - Ext.getCmp('frmNewInputDoc').hide(); - PMExt.notify(_('ID_REQUEST_DOCUMENTS'),resp.msg); - }else{ - PMExt.notify( _('ID_ERROR') , resp.msg); - } - }, - failure: function(f,a){ - Ext.getCmp('designerTab').getEl().unmask(); - PMExt.notify( _('ID_REQUEST_DOCUMENTS') , _('ID_SOME_FIELDS_REQUIRED')); - } - }); - } - }); - - cancelButton = new Ext.Action({ - text : _('ID_CANCEL'), - disabled: false, - handler: function(){ - Ext.getCmp('frmNewInputDoc').hide(); - } - }); - - inputDocForm = new Ext.FormPanel({ - labelWidth: 10, - autoWidth : true, - height : 380, - monitorValid : true, - autoHeight: true, - buttonAlign: 'center', - url: 'processOptionsProxy/saveInputDoc', - items: [{ - xtype : 'fieldset', - layout : 'form', - border : true, - title : _('ID_INPUT_INFO'), - autoWidth : true, - labelWidth : 150, - collapsible : false, - labelAlign : '', - plain: false, - items : [ - {xtype: 'textfield', fieldLabel: _('ID_TITLE'),width: 300,name: 'INP_DOC_TITLE', allowBlank: false}, - { - width: 300, - xtype: 'combo', - mode: 'local', - editable: false, - fieldLabel: _('ID_TYPE'), - triggerAction: 'all', - name: 'INP_DOC_FORM_NEEDED', - displayField: 'name', - valueField : 'value', - id: 'idoc_FORM_NEEDED', - autoSelect: true, - allowBlank: false, - submitValue : false, - hiddenName: 'INP_DOC_FORM_NEEDED', - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name : 'Digital', value: 'VIRTUAL'}, - {name : 'Printed', value: 'REAL'}, - {name : 'Digital/Printed', value: 'VREAL'} - ] - }), - onSelect: function(record, index) { - if(record.data.value != 'VIRTUAL') { - Ext.getCmp("formType").enable(); - } - else { - Ext.getCmp("formType").disable(); - } - this.collapse(); - this.setValue(record.data[this.valueField || this.displayField]); - } - }, - { - xtype : 'combo', - id : 'formType', - width : 150, - mode : 'local', - editable : false, - hiddenName : 'INP_DOC_ORIGINAL', - disabled : true, - submitValue : false, - fieldLabel : _('ID_FORMAT'), - triggerAction : 'all', - forceSelection : true, - displayField : 'name', - valueField : 'value', - allowBlank : false, - value : 'ORIGINAL', - store : new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name : 'Original', value: 'ORIGINAL'}, - {name : 'Legal Copy', value: 'COPYLEGAL'}, - {name : 'Copy', value: 'COPY'} - ]} - ) - }, - {xtype: 'textarea', fieldLabel: _('ID_DESCRIPTION'), name: 'INP_DOC_DESCRIPTION', height: 120, width: 300}, - { - width : 150, - xtype: 'combo', - mode: 'local', - editable: false, - fieldLabel: _('ID_ENABLE_VERSIONING'), - triggerAction: 'all', - forceSelection: true, - hiddenName: 'INP_DOC_VERSIONING', - id: 'idoc_VERSIONING', - submitValue: false, - displayField: 'name', - valueField: 'value', - value : '0', - allowBlank: false, - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name : 'No', value: '0'}, - {name : 'Yes', value: '1'} - ]}) - }, - { - layout :'column', - border :false, - items :[{ - layout : 'form', - border :false, - items : [{ - xtype : 'textfield', - width : 250, - fieldLabel : _('ID_DESTINATION_PATH'), - name : 'INP_DOC_DESTINATION_PATH', - anchor :'100%' - }] - },{ - //columnWidth :.4, - layout : 'form', - border :false, - items : [{ - xtype :'button', - title : ' ', - width :50, - text : '@@', - name : 'selectorigin', - handler: function (s) { - workflow.variablesAction = 'form'; - workflow.fieldName = 'INP_DOC_DESTINATION_PATH' ; - workflow.variable = '@@', - workflow.formSelected = inputDocForm; - var rowData = PMVariables(); - } - }] - }] - },{ - layout :'column', - border :false, - items :[{ - //columnWidth :.6, - layout : 'form', - border :false, - items : [{ - xtype : 'textfield', - width : 250, - //id :'tags', - fieldLabel : _('ID_TAGS'), - name : 'INP_DOC_TAGS', - anchor :'100%' - }] - },{ - //columnWidth :.4, - layout : 'form', - border :false, - items : [{ - xtype :'button', - title : ' ', - width:50, - text : '@@', - name : 'selectorigin', - handler: function (s) { - workflow.variablesAction = 'form'; - workflow.fieldName = 'INP_DOC_TAGS' ; - workflow.variable = '@@', - workflow.formSelected = inputDocForm; - var rowData = PMVariables(); - } - }] - }] - }, - {id : 'INP_DOC_UID', xtype: 'hidden', name : 'INP_DOC_UID'}, - {id : 'PRO_UID', xtype: 'hidden', name : 'PRO_UID'} - ] - }], - buttons: [saveButton, cancelButton] - }); - - - smodel = new Ext.grid.RowSelectionModel({ - singleSelect: true, - listeners:{ - rowselect: function(sm){ - editButton.enable(); - deleteButton.enable(); - }, - rowdeselect: function(sm){ - editButton.disable(); - deleteButton.disable(); - } - } - }); - - idocsContextMenu = new Ext.menu.Menu({ - items: [editButton, deleteButton] - }); - - - inputDocStore = new Ext.data.GroupingStore( { - proxy : new Ext.data.HttpProxy({ - url: 'processOptionsProxy/loadInputDocuments?PRO_UID='+pro_uid - //params: {PRO_UID: pro_uid} - }), - reader : new Ext.data.JsonReader( { - root: 'idocs', - totalProperty: 'total_idocs', - fields : [ - {name: 'INP_DOC_UID', type: 'string'}, - {name: 'PRO_UID',type: 'string'}, - {name: 'INP_DOC_TITLE', type: 'string'}, - {name: 'INP_DOC_DESCRIPTION', type: 'string'}, - {name: 'INP_DOC_VERSIONING',type: 'string'}, - {name: 'INP_DOC_DESTINATION_PATH',type: 'string'}, - {name: 'INP_DOC_TASKS', type: 'int'} - ] - }) - }); - - bbarpaging = new Ext.PagingToolbar({ - pageSize: 10, - store: inputDocStore, - displayInfo: true, - displayMsg: _('ID_GRID_PAGE_DISPLAYING_ROLES_MESSAGE') + '    ', - emptyMsg: _('ID_GRID_PAGE_NO_ROLES_MESSAGE'), - items: [] - }); - - expander = new Ext.ux.grid.RowExpander({ - tpl : new Ext.Template("

"+TRANSLATIONS.ID_DESCRIPTION+": {INP_DOC_DESCRIPTION}

") - }); - - inputDocColumns = new Ext.grid.ColumnModel({ - defaults: { - editable: false, - sortable: true - }, - columns: [ - expander, - {id: 'INP_DOC_UID', dataIndex: 'INP_DOC_UID', hidden:true, hideable:false}, - {header: _('ID_TITLE'), dataIndex: 'INP_DOC_TITLE', width: 350}, - {header: _('ID_VERSIONING'), dataIndex: 'INP_DOC_VERSIONING', width: 100, renderer: render_version}, - {header: _('ID_DESTINATION_PATH'), dataIndex: 'INP_DOC_DESTINATION_PATH', width: 150}, - {header: _('ID_TASK'), dataIndex: 'INP_DOC_TASKS', width: 100, align: 'center'} - ] - }); - - inputDocGrid = new Ext.grid.GridPanel({ - store: inputDocStore, - cm: inputDocColumns, - sm: smodel, - id: 'inputdocGrid', - loadMask: true, - frame: false, - autoWidth: true, - clicksToEdit: 1, - height:100, - layout: 'fit', - plugins: expander, - stripeRows: true, - tbar: [newButton, '-', editButton, deleteButton], - bbar: bbarpaging, - viewConfig: {forceFit: true}, - view: new Ext.grid.GroupingView({ - forceFit:true, - groupTextTpl: '{text}' - }) - }); - - //connecting context menu to grid - inputDocGrid.addListener('rowcontextmenu', onInputDocContextMenu,this); - - //by default the right click is not selecting the grid row over the mouse - //we need to set this four lines - inputDocGrid.on('rowcontextmenu', function (grid, rowIndex, evt) { - var sm = grid.getSelectionModel(); - sm.selectRow(rowIndex, sm.isSelected(rowIndex)); - }, this); - - //prevent default - inputDocGrid.on('contextmenu', function (evt) { - evt.preventDefault(); - }, this); - - function onInputDocContextMenu(grid, rowIndex, e) { - e.stopEvent(); - var coords = e.getXY(); - idocsContextMenu.showAt([coords[0], coords[1]]); - } - - inputDocGrid.store.load(); - - gridWindow = new Ext.Window({ - title: _('ID_REQUEST_DOCUMENTS'), - width: 600, - height: 350, - minWidth: 200, - minHeight: 350, - layout: 'fit', - plain: true, - items: inputDocGrid, - autoScroll: true, - modal: true - }); - - newIDocWindow = new Ext.Window({ - title: _('ID_NEW_INPUTDOCS'), - width: 550, - id: 'frmNewInputDoc', - autoHeight: true, - autoScroll: true, - closable: false, - layout: 'fit', - plain: true, - modal: true, - items: inputDocForm - }); - - gridWindow.show(); -} - -ProcessOptions.prototype.addOutputDoc= function(_5625) -{ - - - var outputDocFields = Ext.data.Record.create([ - { - name: 'OUT_DOC_UID', - type: 'string' - }, - { - name: 'OUT_DOC_TYPE', - type: 'string' - }, - { - name: 'OUT_DOC_TITLE', - type: 'string' - }, - { - name: 'OUT_DOC_DESCRIPTION', - type: 'string' - } - ]); - - - var editor = new Ext.ux.grid.RowEditor({ - saveText: _('ID_UPDATE') - }); - - var btnAdd = new Ext.Button({ - id: 'btnAdd', - text: _('ID_NEW'), - iconCls: 'button_menu_ext ss_sprite ss_add', - handler: function () { - outputDocForm.getForm().reset(); - outputDocForm.getForm().items.items[3].setValue('Portrait'); - //outputDocForm.getForm().items.items[4].setValue('Letter'); - outputDocForm.getForm().items.items[9].setValue('BOTH'); - outputDocForm.getForm().items.items[10].setValue(0); - outputDocForm.getForm().items.items[0].focus('',500); - newOPWindow.show(); - } - }); - - //edit output document Function - var editOutputDoc = function(){ - - var rowSelected = Ext.getCmp('outputdocGrid').getSelectionModel().getSelections(); - if( rowSelected.length == 0 ) { - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - return false; - } - var outputDocUID = rowSelected[0].get('OUT_DOC_UID'); - - - - Ext.QuickTips.init(); - - // turn on validation errors beside the field globally - Ext.form.Field.prototype.msgTarget = 'side'; - - var bd = Ext.getBody(); - - var importOption = new Ext.Action({ - text: _('ID_LOAD_FROM_FILE'), - iconCls: 'silk-add', - icon: '/images/import.gif', - handler: function(){ - var w = new Ext.Window({ - title: '', - width: 420, - height: 140, - modal: true, - autoScroll: false, - maximizable: false, - resizable: false, - - items: [ - new Ext.FormPanel({ - /*renderTo: 'form-panel',*/ - id:'uploader', - fileUpload: true, - width: 400, - frame: true, - title: _('ID_OUT_PUT_DOC_UPLOAD_TITLE'), - autoHeight: false, - bodyStyle: 'padding: 10px 10px 0 10px;', - labelWidth: 50, - defaults: { - anchor: '90%', - allowBlank: false, - msgTarget: 'side' - }, - items: [{ - xtype: 'fileuploadfield', - id: 'form-file', - emptyText: _('ID_SELECT_TEMPLATE_FILE'), - fieldLabel: _('ID_FILE'), - name: 'templateFile', - buttonText: '', - buttonCfg: { - iconCls: 'upload-icon' - } - }], - buttons: [{ - text: _('ID_UPLOAD'), - handler: function(){ - var uploader = Ext.getCmp('uploader'); - if(uploader.getForm().isValid()){ - uploader.getForm().submit({ - url: '../outputdocs/outputdocs_Ajax?action=setTemplateFile', - waitMsg: _('ID_UPLOADING_FILE'), - success: function(o, resp){ - w.close(); - - Ext.Ajax.request({ - url: '../outputdocs/outputdocs_Ajax?action=getTemplateFile&r='+Math.random(), - success: function(response){ - top.getForm().findField('OUT_DOC_TEMPLATE').setValue(response.responseText); - if(top.getForm().findFields('OUT_DOC_TEMPLATE').getValue(response.responseText)=='') - Ext.Msg.alert(_('ID_ALERT_MESSAGE'), _('ID_INVALID_FILE')); - }, - failure: function(){}, - params: {request: 'getRows'} - }); - - }, - failure: function(o, resp){ - w.close(); - //alert('ERROR "'+resp.result.msg+'"'); - Ext.MessageBox.show({title: '', msg: resp.result.msg, buttons: - Ext.MessageBox.OK, animEl: 'mb9', fn: function(){}, icon: - Ext.MessageBox.ERROR}); - //setTimeout(function(){Ext.MessageBox.hide(); }, 2000); - } - }); - } - } - },{ - text: _('ID_CANCEL'), - handler: function(){ - // when this button clicked, - w.hide(); - } - }] - }) - ] - }); - w.show(); - } - }); - - - var top = new Ext.FormPanel({ - labelAlign: 'top', - frame:true, - title: '', - bodyStyle:'padding:5px 5px 0', - width: 790, - tbar:[importOption], - items: [ - { - xtype:'htmleditor', - //id:'OUT_DOC_TEMPLATE', - name:'OUT_DOC_TEMPLATE', - fieldLabel:'Output Document Template', - height:300, - anchor:'98%' - }], - - buttons: [{ - text: _('ID_SAVE'), - handler: function(){ - editor.stopEditing(); - Ext.Ajax.request({ - url: 'outputdocs/outputdocs_Save.php', - method: 'POST', - params: { - OUT_DOC_UID: outputDocUID, - functions:'', - OUT_DOC_TEMPLATE:top.getForm().findField('OUT_DOC_TEMPLATE').getValue() - - }, - success: function(response){ - Ext.Msg.show({ - title: '', - msg: 'Saved Successfully', - fn: function(){ - window.hide(); - }, - animEl: 'elId', - icon: Ext.MessageBox.INFO, - buttons: Ext.MessageBox.OK - }); - }, - failure: function(){} - - }); - } - },{ - text: _('ID_CANCEL'), - handler: function(){ - // when this button clicked, - window.hide(); - } - }] - }); - - top.render(document.body); - - var window = new Ext.Window({ - title: _('ID_NEW_INPUTDOCS'), - width: 650, - height: 450, - minWidth: 200, - minHeight: 450, - autoScroll: true, - layout: 'fit', - plain: true, - items: top - }); - window.show(); - - top.form.load({ - url :'bpmn/processes_Ajax.php?OUT_DOC_UID='+outputDocUID+'&action=getOutputDocsTemplates', - method: 'GET', - waitMsg:'Loading', - success:function(form, action) { - //Ext.MessageBox.alert('Message', 'Loaded OK'); - window.show(); - //OUT_DOC_TEMPLATE:Ext.getCmp('OUT_DOC_TEMPLATE').setValue() - }, - failure:function(form, action) { - PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED') ); - } - }); - - -} - - var removeOutputDoc = function(){ - ids = Array(); - - editor.stopEditing(); - var rowsSelected = Ext.getCmp('outputdocGrid').getSelectionModel().getSelections(); - - if( rowsSelected.length == 0 ) { - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - return false; - } - - for(i=0; i"+TRANSLATIONS.ID_DESCRIPTION+": {OUT_DOC_DESCRIPTION}

" - ) - }); - - var outputDocColumns = new Ext.grid.ColumnModel({ - columns: [ - expander, - { - id: 'OUT_DOC_TITLE', - header: _('ID_TITLE'), - dataIndex: 'OUT_DOC_TITLE', - width: 280, - editable: false, - editor: new Ext.form.TextField({ - //allowBlank: false - }) - }, - { - id: 'OUT_DOC_TYPE', - header: _('ID_TYPE'), - dataIndex: 'OUT_DOC_TYPE', - editable: false, - editor: new Ext.form.TextField({ - //allowBlank: false - }) - } - ] - }); - - var outputDocGrid = new Ext.grid.GridPanel({ - store : outputDocStore, - id : 'outputdocGrid', - loadMask : true, - loadingText : 'Loading...', - //renderTo : 'cases-grid', - frame : false, - autoHeight :false, - clicksToEdit: 1, - minHeight :400, - height :400, - layout : 'fit', - cm : outputDocColumns, - stripeRows : true, - plugins: expander, - tbar : tb, - bbar: new Ext.PagingToolbar({ - pageSize: 10, - store: outputDocStore, - displayInfo: true, - displayMsg: 'Displaying Output Document {0} - {1} of {2}', - emptyMsg: "No Output Document to display", - items:[] - }), - viewConfig : {forceFit: true} - }); - - var outputDocForm = new Ext.FormPanel({ - monitorValid :true, - labelWidth : 140, - defaults : {width : 300, autoScroll:true}, - width : 300, - bodyStyle : 'padding:8px 0 0 8px;', - items : [ - { - xtype : 'textfield', - fieldLabel : _('ID_TITLE'), - allowBlank : false, - blankText : 'Enter Title of Output Document', - name : 'OUT_DOC_TITLE' - },{ - width : 450, - layout:'column', - border:false, - items:[{ - columnWidth:.8, - layout : 'form', - width : 300, - border:false, - items: [{ - xtype : 'textfield', - fieldLabel : _('ID_FILENAME_GENERATED'), - name : 'OUT_DOC_FILENAME', - allowBlank : false, - blankText : 'Select Filename generated', - anchor : '100%' - }] - },{ - columnWidth:.2, - layout: 'form', - border:false, - items: [{ - xtype:'button', - title: ' ', - text: '@@', - name: 'selectorigin', - handler: function (s) { - workflow.variablesAction = 'form'; - workflow.fieldName = 'OUT_DOC_FILENAME' ; - workflow.variable = '@#', - workflow.formSelected = outputDocForm; - var rowData = PMVariables(); - console.log(rowData); - } - }] - }] - },{ - xtype : 'textarea', - fieldLabel : _('ID_DESCRIPTION'), - name : 'OUT_DOC_DESCRIPTION', - height : 50, - width : 300 - },{ - width :150, - xtype :'combo', - mode :'local', - editable :false, - fieldLabel :_('ID_ORIENTATION'), - triggerAction :'all', - forceSelection : true, - name :'OUT_DOC_LANDSCAPE', - displayField :'name', - value :'Portrait', - valueField :'value', - store :new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name : 'Portrait', value: '0'}, - {name : 'Landscape', value: '1'}]}) - },{ - width :150, - xtype :'combo', - mode :'local', - editable :false, - fieldLabel :_('ID_MEDIA'), - forceSelection : true, - name :'OUT_DOC_MEDIA', - displayField :'name', - value :'Letter', - valueField :'value', - store : new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name : 'Letter', value: 'Letter'}, - {name : 'Legal', value: 'Legal'}, - {name : 'Executive', value: 'Executive'}, - {name : 'B5', value: 'B5'}, - {name : 'Folio', value: 'Folio'}, - {name : 'A0Oversize', value: 'A0Oversize'}, - {name : 'A0', value: 'A0'}, - {name : 'A1', value: 'A1'}, - {name : 'A2', value: 'A2'}, - {name : 'A3', value: 'A3'}, - {name : 'A4', value: 'A4'}, - {name : 'A5', value: 'A5'}, - {name : 'A6', value: 'A6'}, - {name : 'A7', value: 'A7'}, - {name : 'A8', value: 'A8'}, - {name : 'A9', value: 'A9'}, - {name : 'A10', value: 'A10'}, - {name : 'Screenshot640', value: 'Screenshot640'}, - {name : 'Screenshot800', value: 'Screenshot800'}, - {name : 'Screenshot1024', value: 'Screenshot1024'} - ] - }) - },{ - xtype : 'numberfield', - fieldLabel : _('ID_LEFT_MARGIN'), - name : 'OUT_DOC_LEFT_MARGIN', - width : 50 - },{ - xtype : 'numberfield', - fieldLabel : _('ID_RIGHT_MARGIN'), - name : 'OUT_DOC_RIGHT_MARGIN', - width : 50 - },{ - xtype : 'numberfield', - fieldLabel : _('ID_TOP_MARGIN'), - name : 'OUT_DOC_TOP_MARGIN', - width : 50 - },{ - xtype : 'numberfield', - fieldLabel : _('ID_BOTTOM_MARGIN'), - name : 'OUT_DOC_BOTTOM_MARGIN', - width : 50 - },{ - width :150, - xtype :'combo', - mode :'local', - editable :false, - fieldLabel :_('ID_OUTPUT_GENERATE'), - triggerAction :'all', - forceSelection :true, - name :'OUT_DOC_GENERATE', - displayField :'name', - value :'Doc', - valueField :'value', - store :new Ext.data.JsonStore({ - fields :['name', 'value'], - data :[ - {name : 'BOTH', value: 'BOTH'}, - {name : 'DOC', value: 'DOC'}, - {name : 'PDF', value: 'PDF'}]}) - },{ - width : 50, - xtype :'combo', - mode :'local', - editable :false, - fieldLabel :_('ID_ENABLE_VERSIONING'), - triggerAction :'all', - forceSelection :true, - name :'OUT_DOC_VERSIONING', - displayField :'name', - value :'NO', - valueField :'value', - store :new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name : 'NO', value: '0'}, - {name : 'YES', value: '1'}]}) - },{ - layout :'column', - width : 450, - border :false, - items :[{ - columnWidth :.8, - layout : 'form', - border :false, - items : [{ - xtype : 'textfield', - fieldLabel : _('ID_DESTINATION_PATH'), - name : 'OUT_DOC_DESTINATION_PATH', - anchor :'100%', - width : 300 - }] - },{ - columnWidth :.2, - layout : 'form', - border :false, - items : [{ - xtype : 'button', - title : ' ', - text : '@@', - name : 'selectorigin', - handler: function (s) { - workflow.variablesAction = 'form'; - workflow.fieldName = 'OUT_DOC_DESTINATION_PATH' ; - workflow.variable = '@@', - workflow.formSelected = outputDocForm; - var rowData = PMVariables(); - } - }] - }] - },{ - layout :'column', - width : 450, - border :false, - items :[{ - columnWidth :.8, - layout : 'form', - border :false, - items : [{ - xtype : 'textfield', - fieldLabel : _('ID_TAGS'), - name : 'OUT_DOC_TAGS', - anchor :'100%', - width : 300 - }] - },{ - columnWidth :.2, - layout : 'form', - border :false, - items : [{ - xtype :'button', - title : ' ', - text : '@@', - name : 'selectorigin', - handler: function (s) { - workflow.variablesAction = 'form'; - workflow.fieldName = 'OUT_DOC_TAGS' ; - workflow.variable = '@@', - workflow.formSelected = outputDocForm; - var rowData = PMVariables(); - } - }] - }] - },{ - id : 'OUT_DOC_UID', - xtype: 'hidden', - name : 'OUT_DOC_UID' - } - ], - buttons : [{ - text : _('ID_SAVE'), - formBind :true, - handler : function(){ - var getForm = outputDocForm.getForm().getValues(); - var sDocUID = getForm.OUT_DOC_UID; - var sDocTitle = getForm.OUT_DOC_TITLE; - var sFilename = getForm.OUT_DOC_FILENAME; - var sDesc = getForm.OUT_DOC_DESCRIPTION; - var sLandscape = getForm.OUT_DOC_LANDSCAPE; - if(getForm.OUT_DOC_LANDSCAPE == 'Portrait') - sLandscape=0; - if(getForm.OUT_DOC_LANDSCAPE == 'Landscape') - sLandscape=1; - var sMedia = getForm.OUT_DOC_MEDIA; - var sLeftMargin = getForm.OUT_DOC_LEFT_MARGIN; - var sRightMargin = getForm.OUT_DOC_RIGHT_MARGIN; - var sTopMargin = getForm.OUT_DOC_TOP_MARGIN; - var sBottomMargin = getForm.OUT_DOC_BOTTOM_MARGIN; - var sGenerated = getForm.OUT_DOC_GENERATE; - var sVersioning = getForm.OUT_DOC_VERSIONING; - if(getForm.OUT_DOC_VERSIONING == 'NO') - sVersioning=0; - if(getForm.OUT_DOC_VERSIONING == 'YES') - sVersioning=1; - var sDestPath = getForm.OUT_DOC_DESTINATION_PATH; - var sTags = getForm.OUT_DOC_TAGS; - if(sDocUID == "") - { - Ext.Ajax.request({ - url : 'outputdocs/outputdocs_Save.php', - method: 'POST', - params:{ - functions : 'lookForNameOutput', - NAMEOUTPUT : sDocTitle, - proUid : pro_uid - }, - success: function(response) { - if(response.responseText == "1") - { - Ext.Ajax.request({ - url : 'outputdocs/outputdocs_Save.php', - method: 'POST', - params:{ - functions : '', - OUT_DOC_UID : sDocUID, - OUT_DOC_TITLE : sDocTitle, - OUT_DOC_FILENAME : sFilename, - OUT_DOC_DESCRIPTION : sDesc, - OUT_DOC_LANDSCAPE : sLandscape, - OUT_DOC_MEDIA : sMedia, - OUT_DOC_LEFT_MARGIN : sLeftMargin, - OUT_DOC_RIGHT_MARGIN : sRightMargin, - OUT_DOC_TOP_MARGIN : sTopMargin, - OUT_DOC_BOTTOM_MARGIN : sBottomMargin, - OUT_DOC_GENERATE : sGenerated, - OUT_DOC_VERSIONING : sVersioning, - OUT_DOC_DESTINATION_PATH : sDestPath, - OUT_DOC_TAGS : sTags, - PRO_UID : pro_uid - }, - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('OUTPUT_CREATE') ); - outputDocStore.reload(); - newOPWindow.hide(); - } - }); - - } - - - else - PMExt.error( _('ID_ERROR') , _('ID_OUTPUT_NOT_SAVE') ); - } - }); - } - else - { - Ext.Ajax.request({ - url : 'outputdocs/outputdocs_Save.php', - method: 'POST', - params:{ - functions : '', - OUT_DOC_UID : sDocUID, - OUT_DOC_TITLE : sDocTitle, - OUT_DOC_FILENAME : sFilename, - OUT_DOC_DESCRIPTION : sDesc, - OUT_DOC_LANDSCAPE : sLandscape, - OUT_DOC_MEDIA : sMedia, - OUT_DOC_LEFT_MARGIN : sLeftMargin, - OUT_DOC_RIGHT_MARGIN : sRightMargin, - OUT_DOC_TOP_MARGIN : sTopMargin, - OUT_DOC_BOTTOM_MARGIN : sBottomMargin, - OUT_DOC_GENERATE : sGenerated, - OUT_DOC_VERSIONING : sVersioning, - OUT_DOC_DESTINATION_PATH : sDestPath, - OUT_DOC_TAGS : sTags, - PRO_UID : pro_uid - }, - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_OUTPUT_UPDATE') ); - outputDocStore.reload(); - newOPWindow.hide(); - } - }); - - } - } - },{ - text: _('ID_CANCEL'), - handler: function(){ - // when this button clicked, - newOPWindow.hide(); - } - }], - buttonAlign : 'center' - }); - - var newOPWindow = new Ext.Window({ - title : _('ID_OUTPUT_DOCUMENTS'), - width : 520, - closable : false, - defaults :{autoScroll:true}, - height : 470, - minWidth : 200, - minHeight : 350, - layout : 'fit', - plain : true, - items : outputDocForm, - buttonAlign : 'center' - }); - - //connecting context menu to grid - outputDocGrid.addListener('rowcontextmenu', onOutputDocContextMenu,this); - - //by default the right click is not selecting the grid row over the mouse - //we need to set this four lines - outputDocGrid.on('rowcontextmenu', function (grid, rowIndex, evt) { - var sm = grid.getSelectionModel(); - sm.selectRow(rowIndex, sm.isSelected(rowIndex)); - }, this); - - //prevent default - outputDocGrid.on('contextmenu', function (evt) { - evt.preventDefault(); - }, this); - - function onOutputDocContextMenu(grid, rowIndex, e) { - e.stopEvent(); - var coords = e.getXY(); - outputdocContextMenu.showAt([coords[0], coords[1]]); - } - - var outputdocContextMenu = new Ext.menu.Menu({ - id: 'messageContextMenu', - items: [{ - text: _('ID_EDIT'), - iconCls: 'button_menu_ext ss_sprite ss_pencil', - handler: editOutputDoc - },{ - text: _('ID_PROPERTIES'), - iconCls: 'button_menu_ext ss_sprite ss_application_edit', - handler: propertiesOutputDoc - },{ - text: _('ID_DELETE'), - icon: '/images/delete.png', - handler: removeOutputDoc - },{ - text: _('ID_UID'), - handler: function(){ - var rowSelected = Ext.getCmp('outputdocGrid').getSelectionModel().getSelected(); - workflow.createUIDButton(rowSelected.data.OUT_DOC_UID); - } - } - ] - }); - - var gridWindow = new Ext.Window({ - title : _('ID_OUTPUT_DOCUMENTS'), - collapsible : false, - maximizable : false, - width : 550, - defaults :{autoScroll:true}, - height : 350, - minWidth : 200, - minHeight : 350, - layout : 'fit', - plain : true, - items : outputDocGrid, - buttonAlign : 'center' - }); - gridWindow.show(); -} - -/* -ProcessOptions.prototype.addReportTable= function(_5625) -{ - var reportFields = Ext.data.Record.create([ - { - name:'REP_TAB_UID', - type: 'string' - }, - { - name: 'REP_TAB_TITLE', - type: 'string' - }, - { - name: 'FIELD_NAME', - type: 'string' - }, - { - name: 'FIELD_UID', - type: 'string' - } - ]); - - var editor = new Ext.ux.grid.RowEditor({ - saveText: _('ID_UPDATE') - }); - - var btnAdd = new Ext.Button({ - id: 'btnAdd', - text: _('ID_NEW'), - iconCls: 'button_menu_ext ss_sprite ss_add', - handler: function () { - formWindow.show(); - reportForm.getForm().reset(); - } - }); - - //edit report table Function - var editReportTable = function() { - editor.stopEditing(); - var rowSelected = Ext.getCmp('reportTableGrid').getSelectionModel().getSelections(); - if( rowSelected.length == 0 ) { - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - return false; - } - var repTabUID = rowSelected[0].get('REP_TAB_UID'); - reportForm.form.load({ - url :'bpmn/proxyExtjs.php?pid='+pro_uid+'&REP_TAB_UID=' +repTabUID+'&action=editReportTables', - method: 'GET', - waitMsg:'Loading', - success:function(form, action) { - formWindow.show(); - }, - failure:function(form, action) { - PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED') ); - } - }); - } - - var removeReportTable = function(){ - ids = Array(); - - editor.stopEditing(); - var rowsSelected = Ext.getCmp('reportTableGrid').getSelectionModel().getSelections(); - - if( rowsSelected.length == 0 ) { - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - return false; - } - - for(i=0; i

" - ) - }); - - var reportColumns = new Ext.grid.ColumnModel({ - columns: [ - new Ext.grid.RowNumberer(), - { - id: 'REP_TAB_TITLE', - header: _('ID_TITLE'), - dataIndex: 'REP_TAB_TITLE', - width: 380, - editable: false, - editor: new Ext.form.TextField({ - //allowBlank: false - }) - } - ] - }); - - var reportGrid = new Ext.grid.GridPanel({ - store : reportStore, - id : 'reportTableGrid', - loadMask : true, - loadingText : 'Loading...', - //renderTo : 'cases-grid', - frame : false, - autoHeight :false, - clicksToEdit: 1, - width :420, - height :400, - layout : 'fit', - plugins: expander, - cm : reportColumns, - stripeRows: true, - tbar: tb, - bbar: new Ext.PagingToolbar({ - pageSize: 10, - store: reportStore, - displayInfo: true, - displayMsg: 'Displaying Report Tables {0} - {1} of {2}', - emptyMsg: "No Report Tables to display" - }), - viewConfig: {forceFit: true} - }); - - //connecting context menu to grid - reportGrid.addListener('rowcontextmenu', onreportTableContextMenu,this); - - //by default the right click is not selecting the grid row over the mouse - //we need to set this four lines - reportGrid.on('rowcontextmenu', function (grid, rowIndex, evt) { - var sm = grid.getSelectionModel(); - sm.selectRow(rowIndex, sm.isSelected(rowIndex)); - }, this); - - //prevent default - reportGrid.on('contextmenu', function (evt) { - evt.preventDefault(); - }, this); - - function onreportTableContextMenu(grid, rowIndex, e) { - e.stopEvent(); - var coords = e.getXY(); - reportTableContextMenu.showAt([coords[0], coords[1]]); - } - - var reportTableContextMenu = new Ext.menu.Menu({ - id: 'messageContextMenu', - items: [{ - text: _('ID_EDIT'), - iconCls: 'button_menu_ext ss_sprite ss_pencil', - handler: editReportTable - },{ - text: _('ID_DELETE'), - icon: '/images/delete.png', - handler: removeReportTable - },{ - text: _('ID_UID'), - handler: function(){ - var rowSelected = Ext.getCmp('reportTableGrid').getSelectionModel().getSelected(); - workflow.createUIDButton(rowSelected.data.REP_TAB_UID); - } - } - ] - }); - - var gridWindow = new Ext.Window({ - title : _('ID_REPORT_TABLES'), - collapsible : false, - maximizable : false, - width : 420, - defaults :{autoScroll:true}, - height : 350, - minWidth : 200, - minHeight : 350, - layout : 'fit', - plain : true, - items : reportGrid, - buttonAlign : 'center' - }); - gridWindow.show(); - -var reportForm =new Ext.FormPanel({ - collapsible: false, - maximizable: true, - width:450, - height:325, - frame:false, - monitorValid : true, - plain: true, - bodyStyle : 'padding:10px 0 0 10px;', - buttonAlign: 'center', - items:[{ - xtype: 'textfield', - fieldLabel: _('ID_TITLE'), - width: 250, - name: 'REP_TAB_TITLE', - allowBlank: false - },{ - - xtype: 'textfield', - fieldLabel: _('ID_TABLE_NAME'), - width: 250, - name: 'REP_TAB_NAME', - allowBlank: false - }, - { - xtype: 'combo', - width: 250, - mode: 'local', - editable:false, - fieldLabel: _('ID_TYPE'), - triggerAction: 'all', - forceSelection: true, - name: 'REP_TAB_TYPE', - displayField: 'name', - valueField : 'value', - value : 'Global', - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name : 'Global', value: 'NORMAL'}, - {name : 'Grid', value: 'GRID'} - ]}), - onSelect: function(record, index) { - //Show-Hide Format Type Field - if(record.data.value == 'NORMAL') - { - Ext.getCmp("fields").show(); - Ext.getCmp("gridfields").hide(); - } - else - { - Ext.getCmp("gridfields").show(); - Ext.getCmp("fields").hide(); - } - var link = 'bpmn/proxyExtjs?pid='+pro_uid+'&type='+record.data.value+'&action=getReportTableType'; - reportTableTypeStore.proxy.setUrl(link, true); - reportTableTypeStore.load(); - - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - }, - { - xtype: 'fieldset', - id: 'fields', - border:false, - hidden: false, - items: [{ - xtype: 'multiselect', - width: 240, - height: 150, - mode: 'local', - style : 'margin-bottom:10px', - editable:true, - fieldLabel: _('ID_FIELDS'), - triggerAction: 'all', - allowblank: true, - forceSelection: false, - dataIndex : 'FIELD_NAME', - name: 'FIELDS', - valueField: 'FIELD_UID', - displayField: 'FIELD_NAME', - store: reportTableTypeStore - }] - }, { - xtype: 'fieldset', - id: 'gridfields', - border:false, - hidden: true, - align:'left', - items:[{ - xtype: 'combo', - width: 200, - mode: 'local', - editable:false, - fieldLabel: _('ID_GRID_FIELDS'), - triggerAction: 'all', - forceSelection: true, - displayField: 'name', - valueField: 'value', - name: 'REP_TAB_GRID', - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [] - }) - }] - },{xtype:'hidden', name:'REP_TAB_UID'} - ], buttons: [{ - text: _('ID_SAVE'), - formBind :true, - handler: function(){ - var getForm = reportForm.getForm().getValues(); - //var pro_uid = getForm.PRO_UID; - var tableUID = getForm.REP_TAB_UID; - var Title = getForm.REP_TAB_TITLE; - var Name = getForm.REP_TAB_NAME; - var Type = getForm.REP_TAB_TYPE; - if(Type == 'Global') - Type = 'NORMAL'; - else - Type = 'GRID'; - - var Grid = getForm.REP_TAB_GRID; - var Fields = getForm.FIELDS; - - if(tableUID=='') - { - Ext.Ajax.request({ - url : '../reportTables/reportTables_Save.php', - method: 'POST', - params:{ - PRO_UID :pro_uid, - REP_TAB_UID :'', - REP_TAB_TITLE :Title, - REP_TAB_NAME :Name, - REP_TAB_TYPE :Type , - REP_TAB_GRID :Grid, - FIELDS :Fields - }, - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_REPORT_SAVE') ); - } - }); - } - else - { - Ext.Ajax.request({ - url : '../reportTables/reportTables_Save.php', - method: 'POST', - params:{ - PRO_UID :pro_uid, - REP_TAB_UID :tableUID, - REP_TAB_TITLE :Title, - REP_TAB_NAME :Name, - REP_TAB_TYPE :Type , - REP_TAB_GRID :Grid, - FIELDS :Fields - //REP_TAB_CONNECTION: Connection - }, - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_REPORT_EDITED') ); - } - - - }); - } - formWindow.hide(); - reportStore.reload(); - - } - },{ - text: _('ID_CANCEL'), - handler: function(){ - // when this button clicked, - formWindow.hide(); - } - }] - }) - -var formWindow = new Ext.Window({ - title: _('ID_NEW_REPORT_TABLE'), - collapsible: false, - maximizable: true, - width: 400, - //autoHeight: true, - height: 330, - layout: 'fit', - plain: true, - buttonAlign: 'center', - items: reportForm - }); - //gridWindow.show(); -} -*/ - - -ProcessOptions.prototype.addTriggers = function() -{ - - var triggerFields = Ext.data.Record.create([ - {name: 'TRI_UID'}, - {name: 'TRI_TITLE'}, - {name: 'TRI_DESCRIPTION'}, - {name: 'TRI_WEBBOT'} - ]); - - var editor = new Ext.ux.grid.RowEditor({ - saveText: _('ID_UPDATE') - }); - - var btnAdd = new Ext.Button({ - id: 'btnAdd', - text: _('ID_NEW'), - iconCls: 'button_menu_ext ss_sprite ss_add', - handler: function () { - triggersForm.getForm().reset(); - triggersForm.getForm().items.items[0].focus('',200); - formWindow.show(); - } - }); - - //edit report table Function - var editTriggers = function() { - editor.stopEditing(); - var rowSelected = Ext.getCmp('triggersGrid').getSelectionModel().getSelections(); - if( rowSelected.length == 0 ) { - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - return false; - } - var triggerUID = rowSelected[0].get('TRI_UID'); - editTriggerForm.getForm().load({ - url :'bpmn/proxyExtjs.php?pid='+pro_uid+'&TRI_UID='+triggerUID+'&action=editTriggers', - method: 'GET', - waitMsg:'Loading', - success:function(form, action) { - Ext.getCmp('TRI_WEBBOT').setValue(action.result.data.TRI_WEBBOT); - editTriggerFormWindow.show(); - }, - failure:function(form, action) { - PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED') ); - } - }); - } - - var editProperties = function(){ - editor.stopEditing(); - var rowSelected = Ext.getCmp('triggersGrid').getSelectionModel().getSelections(); - if( rowSelected.length == 0 ) { - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - return false; - } - var triggerUID = rowSelected[0].get('TRI_UID'); - //editPropertiesFormWindow.show(); - editPropertiesForm.form.load({ - url :'bpmn/proxyExtjs.php?pid='+pro_uid+'&TRI_UID='+triggerUID+'&action=editTriggers', - method: 'GET', - waitMsg:'Loading', - success:function(form, action) { - editPropertiesFormWindow.show(); - //Ext.getCmp("TRI_UID").setValue(triggerUID); - }, - failure:function(form, action) { - PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED') ); - } - }); - } - - var removeTriggers = function() { - ids = Array(); - - editor.stopEditing(); - var rowsSelected = Ext.getCmp('triggersGrid').getSelectionModel().getSelections(); - - if( rowsSelected.length == 0 ) { - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - return false; - } - - for(i=0; i"+TRANSLATIONS.ID_DESCRIPTION+": {TRI_DESCRIPTION}

") - }); - - var triggersColumns = new Ext.grid.ColumnModel({ - defaults: { - width: 90, - sortable: true - }, - columns: [ - expander, - { - header: _('ID_TITLE_FIELD'), - dataIndex: 'TRI_TITLE', - width: 280 - } - ] - }); - - var tb = new Ext.Toolbar({ - items: [btnAdd, btnEdit,btnProperties,btnRemove] - }); - - var triggersGrid = new Ext.grid.GridPanel({ - store: triggerStore, - id : 'triggersGrid', - loadMask: true, - loadingText: 'Loading...', - //renderTo: 'cases-grid', - frame: false, - autoHeight:false, - minHeight:400, - height :400, - width: '', - layout: 'fit', - cm: triggersColumns, - stateful : true, - stateId : 'grid', - plugins: expander, - stripeRows: true, - tbar: tb, - bbar: new Ext.PagingToolbar({ - pageSize: 10, - store: triggerStore, - displayInfo: true, - displayMsg: 'Displaying Triggers {0} - {1} of {2}', - emptyMsg: "No Triggers to display" - }), - viewConfig: {forceFit: true} - }); - - //connecting context menu to grid - triggersGrid.addListener('rowcontextmenu', ontriggersContextMenu,this); - - //by default the right click is not selecting the grid row over the mouse - //we need to set this four lines - triggersGrid.on('rowcontextmenu', function (grid, rowIndex, evt) { - var sm = grid.getSelectionModel(); - sm.selectRow(rowIndex, sm.isSelected(rowIndex)); - }, this); - - //prevent default - triggersGrid.on('contextmenu', function (evt) { - evt.preventDefault(); - }, this); - - function ontriggersContextMenu(grid, rowIndex, e) { - e.stopEvent(); - var coords = e.getXY(); - triggersContextMenu.showAt([coords[0], coords[1]]); - } - - var triggersContextMenu = new Ext.menu.Menu({ - id: 'messageContextMenu', - items: [{ - text: _('ID_EDIT'), - iconCls: 'button_menu_ext ss_sprite ss_pencil', - handler: editTriggers - },{ - text: _('ID_PROPERTIES'), - iconCls: 'button_menu_ext ss_sprite ss_application_edit', - handler: editProperties - },{ - text: _('ID_DELETE'), - icon: '/images/delete.png', - handler: removeTriggers - },{ - text: _('ID_UID'), - handler: function(){ - var rowSelected = Ext.getCmp('triggersGrid').getSelectionModel().getSelected(); - workflow.createUIDButton(rowSelected.data.TRI_UID); - } - } - ] - }); - -var triggersForm = new Ext.FormPanel({ - labelWidth : 100, - buttonAlign : 'center', - width : 300, - height : 220, - bodyStyle : 'padding:8px 0 0 8px;', - autoHeight: true, - items: - [{ - xtype: 'textfield', - layout: 'fit', - border:true, - name: 'TRI_TITLE', - fieldLabel: _('ID_TITLE'), - width: 300, - collapsible: false, - allowBlank: false, - labelAlign: 'top' - }, - { - xtype: 'textarea', - border:true, - name: 'TRI_DESCRIPTION', - hidden: false, - fieldLabel: _('ID_DESCRIPTION'), - width: 300, - height: 120 - }], - buttons: [{ - text: _('ID_SAVE'), - //formBind :true, - handler: function(){ - var getForm = triggersForm.getForm().getValues(); - var title = getForm.TRI_TITLE; - var triggerUid = getForm.TRI_UID; - var condition = getForm.TRI_WEBBOT; - var desc = getForm.TRI_DESCRIPTION; - - if(title == '') - PMExt.notify( _('ID_ERROR') , _('ID_TRIGGER_TITLE_REQUIRED') ); - else - { - //First check whether trigger name already exist or not - Ext.Ajax.request({ - url : '../triggers/triggers_Save.php', - method: 'POST', - params: { - functions : 'lookforNameTrigger', - proUid : pro_uid, - NAMETRIGGER : title - }, - success: function(response) { - var result = response.responseText; - if(result) { - //now save trigger - Ext.Ajax.request({ - url : '../triggers/triggers_Save.php', - method: 'POST', - params:{ - //functions : 'lookforNameTrigger', - TRI_TITLE : title, - PRO_UID : pro_uid, - TRI_UID :'', - TRI_PARAM :'', - TRI_TYPE :'SCRIPT', - TRI_DESCRIPTION :desc, - TRI_WEBBOT :condition, - mode :'ext' - }, - success: function(response) { - var result = Ext.util.JSON.decode(response.responseText); - if( result.success ){ - PMExt.notify( _('ID_STATUS') , result.msg); - - //Reloading store after saving triggers - triggerStore.reload(); - formWindow.hide(); - } else { - PMExt.error(_('ID_ERROR'), result.msg); - } - } - }); - } else { - PMExt.error(_('ID_VALIDATION_ERROR'), 'There is a triggers with the same name in this process.'); - } - } - }); - formWindow.hide(); - } - } - },{ - text: _('ID_CANCEL'), - handler: function(){ - // when this button clicked, - formWindow.hide(); - } - }] - }); - - var editTriggerForm = new Ext.FormPanel({ - buttonAlign : 'center', - labelWidth : 2, - layout : 'fit', - width : 570, - height : 350, - items: - [{ - layout :'column', - border :false, - items :[{ - //columnWidth :.6, - layout : 'form', - border : false, - items : [{ -// xtype : 'textarea', - xtype : 'codepress', - language : 'generic', - id : 'TRI_WEBBOT', - width : 420, - height : 310, - name : 'TRI_WEBBOT' - }] - },{ - //columnWidth :.4, - layout : 'form', - border :false, - items : [{ - xtype :'button', - title : ' ', - width : 50, - text : '@@', - name : 'selectorigin', - handler: function (s) { - workflow.variablesAction = 'form'; - workflow.fieldName = 'TRI_WEBBOT' ; - workflow.variable = '@@', - workflow.formSelected = editTriggerForm; - var rowData = PMVariables(); - } - }] - }] - },{ - xtype: 'hidden', - name: 'TRI_UID' - }], - buttons: [{ - text: _('ID_SAVE'), - //formBind :true, - handler: function(){ - var getForm = editTriggerForm.getForm().getValues(); - var triggerUid = getForm.TRI_UID; -// var condition = getForm.TRI_WEBBOT; - var condition = Ext.getCmp('TRI_WEBBOT').getCode(); - var desc = getForm.TRI_DESCRIPTION; - Ext.Ajax.request({ - url : '../triggers/triggers_Save.php', - method: 'POST', - params:{ - PRO_UID : pro_uid, - TRI_UID : triggerUid, - TRI_TYPE : 'SCRIPT', - TRI_WEBBOT : condition, - mode : 'ext' - }, - success: function(response) { - var result = Ext.util.JSON.decode(response.responseText); - if( result.success ){ - PMExt.notify( _('ID_STATUS') , result.msg); - - //Reloading store after saving triggers - triggerStore.reload(); - editTriggerFormWindow.hide(); - } else { - PMExt.error(_('ID_ERROR'), result.msg); - } - } - }); - } - },{ - text: _('ID_CANCEL'), - handler: function(){ - // when this button clicked, - editTriggerFormWindow.hide(); - } - }] - }); - - var editPropertiesForm = new Ext.FormPanel({ - labelWidth : 100, - buttonAlign : 'center', - width : 400, - height : 300, - bodyStyle : 'padding:10px 0 0 10px;', - autoHeight: true, - items: - [{ - xtype: 'fieldset', - title: 'Trigger Information', - border:true, - id: 'trigger', - width: 400, - items:[{ - xtype: 'textfield', - layout: 'fit', - border:true, - name: 'TRI_TITLE', - fieldLabel: _('ID_TITLE'), - width: 250, - allowBlank: false, - labelAlign: 'top' - }, - { - xtype: 'textarea', - border:true, - name: 'TRI_DESCRIPTION', - hidden: false, - fieldLabel: _('ID_DESCRIPTION'), - width: 250, - height: 120 - }] - },{ - xtype: 'hidden', - name: 'TRI_UID' - }], - buttons: [{ - text: _('ID_SAVE'), - //formBind :true, - handler: function(){ - var getForm = editPropertiesForm.getForm().getValues(); - var triggerUid = getForm.TRI_UID; - var title = getForm.TRI_TITLE; - var desc = getForm.TRI_DESCRIPTION; - //First check whether trigger name already exist or not - Ext.Ajax.request({ - url : '../triggers/triggers_Save.php', - method: 'POST', - params: { - functions : 'lookforNameTrigger', - proUid : pro_uid, - NAMETRIGGER : title - }, - success: function(response) { - var result = response.responseText; - if(result) { - //now save trigger - Ext.Ajax.request({ - url : '../triggers/triggers_Save.php', - method: 'POST', - params:{ - TRI_TITLE : title, - PRO_UID : pro_uid, - TRI_UID :triggerUid, - TRI_PARAM :'', - TRI_TYPE :'SCRIPT', - TRI_DESCRIPTION :desc, - mode :'ext' - }, - success: function(response) { - var result = Ext.util.JSON.decode(response.responseText); - if( result.success ){ - PMExt.notify( _('ID_STATUS') , result.msg); - - //Reloading store after saving triggers - triggerStore.reload(); - editPropertiesFormWindow.hide(); - } else { - PMExt.error(_('ID_ERROR'), result.msg); - } - } - }); - } else { - PMExt.error(_('ID_VALIDATION_ERROR'), 'There is a triggers with the same name in this process.'); - } - } - }); - editPropertiesFormWindow.hide(); - } - },{ - text: _('ID_CANCEL'), - handler: function(){ - // when this button clicked, - editPropertiesFormWindow.hide(); - } - }] - }); - - var editTriggerFormWindow = new Ext.Window({ - title: _('ID_EDIT_TRIGGERS'), - autoScroll: true, - collapsible: false, - width: 600, - //autoHeight: true, - height: 400, - layout: 'fit', - plain: true, - buttonAlign: 'center', - items: editTriggerForm - }); - - var editPropertiesFormWindow = new Ext.Window({ - title: _('ID_EDIT_TRIGGERS'), - autoScroll: true, - collapsible: false, - width: 450, - //autoHeight: true, - height: 280, - layout: 'fit', - plain: true, - buttonAlign: 'center', - items: editPropertiesForm - }); - - - var formWindow = new Ext.Window({ - title: _('ID_TRIGGERS'), - autoScroll: true, - collapsible: false, - maximizable: true, - width: 450, - //autoHeight: true, - height: 240, - layout: 'fit', - plain: true, - buttonAlign: 'center', - items: triggersForm - }); - - var gridWindow = new Ext.Window({ - title: _('ID_TRIGGERS'), - autoScroll: true, - collapsible: false, - maximizable: true, - width: 600, - //autoHeight: true, - height: 350, - layout: 'fit', - plain: true, - buttonAlign: 'center', - items: triggersGrid - }); - gridWindow.show(); -} - - -///*** from ProcessMapContext ***/// -var PMVariables = function() { - var varFields = Ext.data.Record.create( [ { - name : 'variable', - type : 'string' - }, { - name : 'type', - type : 'string' - }, { - name : 'label', - type : 'string' - } ]); - var varStore = ''; - varStore = new Ext.data.JsonStore( { - root : 'data', - totalProperty : 'totalCount', - idProperty : 'gridIndex', - remoteSort : true, - fields : varFields, - proxy : new Ext.data.HttpProxy( { - url : 'bpmn/proxyExtjs?pid=' + pro_uid + '&action=getVariables&sFieldName=form[CTO_CONDITION]&sSymbol=@@' - }) - }); - //varStore.load(); - - var varColumns = new Ext.grid.ColumnModel( { - columns : [ new Ext.grid.RowNumberer(), { - id : 'FLD_NAME', - header : _('ID_VARIABLES'), - dataIndex : 'variable', - width : 170, - editable : false, - sortable : true - }, { - id : 'PRO_VARIABLE', - header : _('ID_LABEL'), - dataIndex : 'label', - width : 150, - sortable : true - } ] - }); - - var varForm = new Ext.FormPanel( { - labelWidth : 100, - monitorValid : true, - width : 400, - bodyStyle : 'padding:10px 0 0 10px;', - height : 350, - renderer : function(val) { - return '
@@ Replace the value in quotes
'; - }, - items : { - xtype : 'tabpanel', - activeTab : 0, - defaults : { - autoHeight : true - }, - items : [ { - title : _('ID_ALL_VARIABLES'), - id : 'allVar', - layout : 'form', - listeners : { - activate : function(tabPanel) { - // use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request. - var link = 'bpmn/proxyExtjs?pid=' + pro_uid + '&action=getVariables&type=' + tabPanel.id + '&sFieldName=form[CTO_CONDITION]&sSymbol=@@'; - varStore.proxy.setUrl(link, true); - varStore.load(); - } - }, - items : [ { - xtype : 'grid', - ds : varStore, - cm : varColumns, - width : 380, - autoHeight : true, - //plugins: [editor], - //loadMask : true, - loadingText : 'Loading...', - border : false, - listeners : { - //rowdblclick: alert("ok"), - rowdblclick : function() { - var objectSelected = workflow.variablesAction; - switch (objectSelected) { - case 'grid': - var getObjectGridRow = workflow.gridObjectRowSelected; - var FieldSelected = workflow.gridField; - //getting selected row of variables - var rowSelected = this.getSelectionModel().getSelected(); - var rowLabel = rowSelected.data.variable; - - //Assigned new object with condition - if (typeof getObjectGridRow.colModel != 'undefined') - getObjectGridRow.colModel.config[3].editor.setValue(rowLabel); - //Assigning / updating Condition for a row - else - getObjectGridRow[0].set(FieldSelected, rowLabel); - - if (FieldSelected == 'CTO_CONDITION') { - Ext.Ajax.request( { - url : '../tracker/tracker_ConditionsSave.php', - method : 'POST', - params : { - PRO_UID : pro_uid, - CTO_UID : getObjectGridRow[0].data.CTO_UID, - CTO_CONDITION : getObjectGridRow[0].data.CTO_CONDITION - }, - success : function(response) { - Ext.MessageBox.alert('Status', 'Objects has been edited successfully '); - } - }) - } else if (FieldSelected == 'STEP_CONDITION') { - Ext.Ajax.request( { - url : '../steps/conditions_Save.php', - method : 'POST', - params : { - PRO_UID : pro_uid, - STEP_UID : getObjectGridRow[0].data.STEP_UID, - STEP_CONDITION : getObjectGridRow[0].data.STEP_CONDITION - }, - success : function(response) { - Ext.MessageBox.alert('Status', 'Objects has been edited successfully '); - } - }) - } else if (FieldSelected == 'ST_CONDITION') { - Ext.Ajax.request( { - url : '../steps/steps_Ajax.php', - method : 'POST', - params : { - action : 'saveTriggerCondition', - PRO_UID : pro_uid, - STEP_UID : getObjectGridRow[0].data.STEP_UID, - ST_CONDITION : getObjectGridRow[0].data.STEP_CONDITION, - TAS_UID : taskId, - TRI_UID : getObjectGridRow[0].data.TRI_UID, - ST_TYPE : getObjectGridRow[0].data.ST_TYPE - - }, - success : function(response) { - Ext.MessageBox.alert('Status', 'Objects has been edited successfully '); - } - }) - } - - window.hide(); - - break; - case 'form': - FormSelected = workflow.formSelected; - rowSelected = this.getSelectionModel().getSelected(); - FieldSelected = workflow.fieldName; - rowLabel = rowSelected.data.variable; - var prevContent = FormSelected.getForm().findField(FieldSelected).getValue(); - var newContent = prevContent + ' ' + rowLabel; - var value = FormSelected.getForm().findField(FieldSelected).setValue(newContent); -// if (FormSelected.getForm().findField(FieldSelected).code){ -// FormSelected.getForm().findField(FieldSelected).code=value; -// } - window.hide(); - break; - - } - - } - } - } ] - }, { - title : _('ID_SYSTEM'), - id : 'system', - layout : 'form', - listeners : { - activate : function(tabPanel) { - // use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request. - var link = 'bpmn/proxyExtjs?pid=' + pro_uid + '&action=getVariables&type=' + tabPanel.id + '&sFieldName=form[CTO_CONDITION]&sSymbol=@@'; - varStore.proxy.setUrl(link, true); - varStore.load(); - } - }, - items : [ { - xtype : 'grid', - ds : varStore, - cm : varColumns, - width : 380, - autoHeight : true, - //plugins: [editor], - //loadMask : true, - loadingText : 'Loading...', - border : false, - listeners : { - //rowdblclick: alert("ok"), - rowdblclick : function() { - var objectSelected = workflow.variablesAction; - switch (objectSelected) { - case 'grid': - var getObjectGridRow = workflow.gridObjectRowSelected; - var FieldSelected = workflow.gridField; - //getting selected row of variables - var rowSelected = this.getSelectionModel().getSelected(); - var rowLabel = rowSelected.data.variable; - //Assigned new object with condition - if (typeof getObjectGridRow.colModel != 'undefined') - getObjectGridRow.colModel.config[3].editor.setValue(rowLabel); - //Assigning / updating Condition for a row - else - getObjectGridRow[0].set(FieldSelected, rowLabel); - if (CTO_UID != '') { - Ext.Ajax.request( { - url : '../tracker/tracker_ConditionsSave.php', - method : 'POST', - params : { - PRO_UID : pro_uid, - CTO_UID : getObjectGridRow[0].data.CTO_UID, - CTO_CONDITION : getObjectGridRow[0].data.CTO_CONDITION - }, - success : function(response) { - Ext.MessageBox.alert('Status', 'Objects has been edited successfully '); - } - }) - window.hide(); - } - - break; - case 'form': - FormSelected = workflow.formSelected; - rowSelected = this.getSelectionModel().getSelected(); - FieldSelected = workflow.fieldName; - rowLabel = rowSelected.data.variable; - var value = FormSelected.getForm().findField(FieldSelected).setValue(rowLabel); - window.hide(); - break; - - } - - } - } - } ] - }, { - title : _('ID_CASESLIST_APP_PRO_TITLE'), - id : 'process', - layout : 'form', - listeners : { - activate : function(tabPanel) { - // use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request. - var link = 'bpmn/proxyExtjs?pid=' + pro_uid + '&action=getVariables&type=' + tabPanel.id + '&sFieldName=form[CTO_CONDITION]&sSymbol=@@'; - varStore.proxy.setUrl(link, true); - varStore.load(); - } - }, - items : [ { - xtype : 'grid', - ds : varStore, - cm : varColumns, - width : 380, - autoHeight : true, - //plugins: [editor], - //loadMask : true, - loadingText : 'Loading...', - border : false, - listeners : { - //rowdblclick: alert("ok"), - rowdblclick : function() { - var objectSelected = workflow.variablesAction; - switch (objectSelected) { - case 'grid': - var getObjectGridRow = workflow.gridObjectRowSelected; - var FieldSelected = workflow.gridField; - //getting selected row of variables - var rowSelected = this.getSelectionModel().getSelected(); - var rowLabel = rowSelected.data.variable; - //Assigned new object with condition - if (typeof getObjectGridRow.colModel != 'undefined') - getObjectGridRow.colModel.config[3].editor.setValue(rowLabel); - //Assigning / updating Condition for a row - else - getObjectGridRow[0].set(FieldSelected, rowLabel); - Ext.Ajax.request( { - url : '../tracker/tracker_ConditionsSave.php', - method : 'POST', - params : { - PRO_UID : pro_uid, - CTO_UID : getObjectGridRow[0].data.CTO_UID, - CTO_CONDITION : getObjectGridRow[0].data.CTO_CONDITION - }, - success : function(response) { - Ext.MessageBox.alert('Status', 'Objects has been edited successfully '); - } - }) - window.hide(); - break; - case 'form': - FormSelected = workflow.formSelected; - rowSelected = this.getSelectionModel().getSelected(); - FieldSelected = workflow.fieldName; - rowLabel = rowSelected.data.variable; - var value = FormSelected.getForm().findField(FieldSelected).setValue(rowLabel); - window.hide(); - break; - - } - - } - } - } ] - } ] - } - }); - - var window = new Ext.Window( { - title : _('ID_VARIABLES'), - collapsible : false, - maximizable : false, - scrollable : true, - width : 400, - height : 350, - minWidth : 200, - minHeight : 150, - autoScroll : true, - layout : 'fit', - plain : true, - buttonAlign : 'center', - items : [ varForm ] - }); - window.show(); -} diff --git a/workflow/engine/templates/bpmn/SubProcess.js b/workflow/engine/templates/bpmn/SubProcess.js deleted file mode 100755 index 93afc9afd..000000000 --- a/workflow/engine/templates/bpmn/SubProcess.js +++ /dev/null @@ -1,233 +0,0 @@ -bpmnSubProcess = function (_30ab) { - VectorFigure.call(this); - //Setting width and height values as per the zoom ratio - if(typeof workflow.zoomTaskWidth != 'undefined' || typeof workflow.zoomTaskHeight != 'undefined') - this.setDimension(workflow.zoomTaskWidth, workflow.zoomTaskHeight); - else - this.setDimension(165, 50); - this.subProcessName = _30ab.subProcessName; //It will set the Default Task Name with appropriate count While dragging a task on the canvas -}; - -bpmnSubProcess.prototype = new VectorFigure; -bpmnSubProcess.prototype.type = "bpmnSubProcess" -bpmnSubProcess.prototype.setSubProcessName = function () { - this.subProcessName = 'Sub Process'; -}; - -bpmnSubProcess.prototype.coord_converter = function (bound_width, bound_height, text_length) { - //bound_width = this.workflow.currentSelection.width; - //bound_height = this.workflow.currentSelection.height; - input_width = text_length * 6 - input_height = 10 - - temp_width = bound_width - input_width; - temp_width /= 2; - temp_x = temp_width; - - temp_height = bound_height - 10; - temp_height /= 2; - temp_y = temp_height; - - var temp_coord = new Object(); - temp_coord.temp_x = temp_x; - temp_coord.temp_y = temp_y; - return temp_coord; -}; - -//curWidth = this.getWidth(); - -bpmnSubProcess.prototype.paint = function () { - VectorFigure.prototype.paint.call(this); - if(typeof workflow.zoomfactor == 'undefined') - workflow.zoomfactor = 1; - //For Zooming - - if(typeof this.limitFlag == 'undefined' || this.limitFlag == false) - { - this.originalWidth = 165; - this.originalHeight = 40; - this.orgXPos = this.getX(); - this.orgYPos = this.getY(); - this.orgFontSize =this.fontSize; - } - - this.width = this.originalWidth * workflow.zoomfactor; - this.height = this.originalHeight * workflow.zoomfactor; - - var x = new Array(6, this.getWidth() - 3, this.getWidth(), this.getWidth(), this.getWidth() - 3, 6, 3, 3, 6); - var y = new Array(3, 3, 6, this.getHeight() - 3, this.getHeight(), this.getHeight(), this.getHeight() - 3, 6, 3); - this.graphics.setStroke(this.stroke); - this.graphics.setColor("#c0c0c0"); - this.graphics.fillPolygon(x, y); - for (var i = 0; i < x.length; i++) { - x[i] = x[i] - 3; - y[i] = y[i] - 3; - } - this.graphics.setColor("#ffffff"); - this.graphics.fillPolygon(x, y); - this.graphics.setColor("#5164b5"); //Blue Color - this.graphics.drawPolygon(x, y); - - //Circle on right top corner - //var x_cir = this.getWidth()/1.3; - //var y_cir = this.getHeight()/8.75; - // - //this.graphics.setColor("#ffffff"); - //this.graphics.fillEllipse(x_cir,y_cir,this.getHeight()/5,this.getHeight()/5); - //this.graphics.setColor("#5891B7"); - //this.graphics.setStroke(2); - //this.graphics.drawEllipse(x_cir,y_cir,this.getHeight()/5,this.getHeight()/5); - - //Plus symbol on bottom - //Plus symbol on bottom - var zoomfactor = workflow.zoomfactor; - var xb = this.getWidth()/2 - 5*zoomfactor; - var yb = this.getHeight() - 5 - 11*zoomfactor; - var x1 = new Array(xb, xb , xb + 11.5*zoomfactor, xb + 11.5*zoomfactor ); - var y1 = new Array(yb, yb + 11*zoomfactor, yb + 11*zoomfactor, yb ); - - this.graphics.setStroke(1); - this.graphics.setColor("#5891B7"); - this.graphics.drawPolygon(x1,y1); - var x_cross = new Array(xb+ 5*zoomfactor, xb+ 6*zoomfactor, xb+ 6*zoomfactor, xb+ 9*zoomfactor, xb+ 9*zoomfactor, xb+ 6*zoomfactor, xb+ 6*zoomfactor, xb+ 5*zoomfactor, xb+ 5*zoomfactor, xb+ 2*zoomfactor, xb+ 2*zoomfactor, xb+ 5*zoomfactor ); - var y_cross = new Array(yb+ 2*zoomfactor, yb+ 2*zoomfactor, yb+ 5*zoomfactor, yb+ 5*zoomfactor, yb+ 6*zoomfactor, yb+ 6*zoomfactor, yb+ 9*zoomfactor, yb+ 9*zoomfactor, yb+ 6*zoomfactor, yb+ 6*zoomfactor, yb+ 5*zoomfactor, yb+ 5*zoomfactor ); - this.graphics.setColor( "#5891B7" ); - this.graphics.fillPolygon(x_cross,y_cross); - this.graphics.paint(); - - var bpmnText = new jsGraphics(this.id); - var padleft = 0.025*this.getWidth(); - var padtop = 0.15*this.getHeight(); - var rectwidth = this.getWidth() - 3*padleft; - var rectheight = this.getHeight() - 3*padtop; - - - if(typeof this.fontSize == 'undefined' || this.fontSize == '') - this.fontSize = 11; - var fontSize = zoomfactor * this.fontSize; - bpmnText.setFont('verdana', +fontSize+'px', Font.PLAIN); - bpmnText.drawStringRect(this.subProcessName,padleft,padtop,rectwidth,rectheight,'center'); - bpmnText.paint(); - - this.bpmnNewText = bpmnText; - - if (this.input1 != null) { - this.input1.setPosition(0, this.height / 2 -1); - } - if (this.output1 != null) { - this.output1.setPosition(this.width / 2, this.height); - } - if (this.input2 != null) { - this.input2.setPosition(this.width / 2, 0); - } - if (this.output2 != null) { - this.output2.setPosition(this.width, this.height / 2-1); - } - -}; - - jsGraphics.prototype.drawTextString = function (txt, x, y, dx, dy) { - this.htm += '
' + txt + '<\/div>'; -}; - -bpmnSubProcess.prototype.setWorkflow = function (_40c5) { - VectorFigure.prototype.setWorkflow.call(this, _40c5); - if (_40c5 != null) { - /*Adding Port to the Task After dragging Task on the Canvas - *Ports will be invisibe After Drag and Drop, But It will be created - */ - var TaskPortName = ['output1','output2','input1','input2']; - var TaskPortType = ['OutputPort','OutputPort','InputPort','InputPort']; - var TaskPositionX= [this.width/2,this.width,0,this.width/2]; - var TaskPositionY= [this.height,this.height/2,this.height/2,0]; - - for(var i=0; i< TaskPortName.length ; i++){ - eval('this.'+TaskPortName[i]+' = new '+TaskPortType[i]+'()'); //Create New Port - eval('this.'+TaskPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.'+TaskPortName[i]+'.setName("'+TaskPortName[i]+'")'); //Set PortName - eval('this.'+TaskPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.'+TaskPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.'+TaskPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - eval('this.addPort(this.'+TaskPortName[i]+','+TaskPositionX[i]+', '+TaskPositionY[i]+')'); //Setting Position of the port - } - } -}; - -bpmnSubProcessDialog = function (_2e5e) { - this.figure = _2e5e; - var title = 'Sub Process'; - Dialog.call(this, title); - this.setDimension(400, 150); //Set the width and height of the Dialog box -} - -bpmnSubProcessDialog.prototype = new Dialog(); -bpmnSubProcessDialog.prototype.createHTMLElement = function () { - var item = Dialog.prototype.createHTMLElement.call(this); - var inputDiv = document.createElement("form"); - inputDiv.style.position = "absolute"; - inputDiv.style.left = "10px"; - inputDiv.style.top = "30px"; - inputDiv.style.width = "375px"; - inputDiv.style.font = "normal 10px verdana"; - item.appendChild(inputDiv); - this.label = document.createTextNode("Sub Process Name"); - inputDiv.appendChild(this.label); - this.input = document.createElement("textarea"); - this.input.style.border = "1px solid gray"; - this.input.style.font = "normal 10px verdana"; - //this.input.type = "text"; - this.input.maxLength = "500"; - this.input.cols = "50"; - this.input.rows = "3"; - var value = bpmnTask.prototype.trim(this.figure.workflow.currentSelection.subProcessName); - if (value) this.input.value = value; - else this.input.value = ""; - this.input.style.width = "100%"; - inputDiv.appendChild(this.input); - this.input.focus(); - return item; -}; - -/*Double Click Event for opening the dialog Box*/ -bpmnSubProcess.prototype.onDoubleClick = function () { - var _409d = new bpmnSubProcessDialog(this); - this.workflow.showDialog(_409d, this.workflow.currentSelection.x, this.workflow.currentSelection.y); -}; - - -/** - * This method will be called if the user pressed the OK button in buttonbar of the dialog.
- * The string is first cleared and new string is painted.

- **/ - bpmnSubProcessDialog.prototype.onOk = function () { - this.figure.bpmnNewText.clear(); - - len = Math.ceil(this.input.value.length/16); - if(this.input.value.length < 19) - { - len = 1.5; - if(this.input.value.length > 9) - this.figure.rectWidth = this.input.value.length*8; - else - this.figure.rectWidth = 48; - } - else - this.figure.rectWidth = 150; - //tempcoord = this.workflow.currentSelection.coord_converter(this.workflow.currentSelection.width, this.workflow.currentSelection.height, this.input.value.length) - this.figure.bpmnNewText.drawStringRect(this.input.value,20,20,this.figure.rectWidth,'left'); - // this.figure.bpmnNewText.drawTextString(this.input.value, this.workflow.currentSelection.width, this.workflow.currentSelection.height, tempcoord.temp_x, tempcoord.temp_y); - this.figure.bpmnNewText.paint(); - this.figure.subProcessName = this.input.value; //Set Updated Text value - - if(this.figure.rectWidth<80) - tempW = 110; - else - tempW = this.figure.rectWidth+35; - this.workflow.currentSelection.setDimension(tempW, len*13+40); - - this.workflow.removeFigure(this); -}; - -bpmnSubProcess.prototype.getContextMenu = function () { - this.workflow.handleContextMenu(this); -}; \ No newline at end of file diff --git a/workflow/engine/templates/bpmn/TaskContext.js b/workflow/engine/templates/bpmn/TaskContext.js deleted file mode 100755 index b99e5ebb3..000000000 --- a/workflow/engine/templates/bpmn/TaskContext.js +++ /dev/null @@ -1,2585 +0,0 @@ -TaskContext=function(id){ - Workflow.call(this,id); -}; -TaskContext.prototype=new Workflow; -TaskContext.prototype.type="TaskContext"; - - -TaskContext.prototype.editTaskSteps = function(_3252){ - var taskExtObj = new TaskContext(); - var ProcMapObj= new ProcessMapContext(); - var taskId = _3252.scope.workflow.currentSelection.id; - - var stepsFields = Ext.data.Record.create([ - { - name: 'STEP_TITLE', - type: 'string' - }, - { - name: 'STEP_UID', - type: 'string' - }, - { - name: 'STEP_TYPE_OBJ', - type: 'string' - }, - { - name: 'STEP_CONDITION', - type: 'string' - }, - { - name: 'STEP_POSITION', - type: 'string' - }, - { - name: 'STEP_MODE', - type: 'string' - }, - { - name: 'STEP_UID_OBJ', - type: 'string' - } - ]); - - var editor = new Ext.ux.grid.RowEditor({ - saveText: _('ID_UPDATE') - }); - - var btnAdd = new Ext.Button({ - id: 'btnAdd', - text: _('ID_ASSIGN'), - iconCls: 'button_menu_ext ss_sprite ss_add', - handler: function(){ - var User = grid.getStore(); - var e = new stepsFields({ - //STEP_TITLE: User.data.items[0].data.STEP_TITLE, - STEP_UID : '', - STEP_TYPE_OBJ : '', - STEP_CONDITION : '', - STEP_POSITION : '', - STEP_MODE : '', - STEP_UID_OBJ : '' - }); - - if(availableSteps.data.items.length == 0) - PMExt.notify( _('ID_STATUS') , _('ID_STEPS_UNAVAILABLE') ); - else - { - editor.stopEditing(); - taskSteps.insert(0, e); - grid.getView().refresh(); - //grid.getSelectionModel().selectRow(0); - editor.startEditing(0, 0); - } - } - }); - - var btnRemove = new Ext.Button({ - id: 'btnRemove', - text: _('ID_REMOVE'), - iconCls: 'button_menu_ext ss_sprite ss_pencil', - handler: function (s) { - editor.stopEditing(); - var s = grid.getSelectionModel().getSelections(); - for(var i = 0, r; r = s[i]; i++){ - - //First Deleting step from Database using Ajax - var stepUID = r.data.STEP_UID; - var stepPosition = r.data.STEP_POSITION; - - //if STEP_UID is properly defined (i.e. set to valid value) then only delete the row - //else its a BLANK ROW for which Ajax should not be called. - if(r.data.STEP_UID != "") - { - Ext.Ajax.request({ - url : '../steps/steps_Delete.php', - method: 'POST', - params: { - TASK : taskId, - STEP_UID : stepUID, - STEP_POSITION : stepPosition - }, - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_STEP_REMOVED') ); - //Secondly deleting from Grid - taskSteps.remove(r); - //Reloading store after removing steps - taskSteps.reload(); - } - }); - } - else - taskSteps.remove(r); - } - } - }); - - var tb = new Ext.Toolbar({ - items: [btnAdd, btnRemove] - }); - - // create the Data Store of all Steps that are already been assigned to a task - var taskSteps = new Ext.data.JsonStore({ - root : 'data', - totalProperty: 'totalCount', - idProperty : 'gridIndex', - remoteSort : true, - fields : stepsFields, - proxy : new Ext.data.HttpProxy({ - url : 'bpmn/proxyExtjs?tid='+taskId+'&action=getAssignedSteps' - }) - }); - taskSteps.load({params:{start : 0 , limit : 10 }}); - - // create the Data Store of all Steps that are not been assigned to a task i.e available steps - var availableSteps = new Ext.data.JsonStore({ - root : 'data', - url : 'bpmn/proxyExtjs?pid='+pro_uid+'&tid='+taskId+'&action=getAvailableSteps', - totalProperty : 'totalCount', - idProperty : 'gridIndex', - remoteSort : false, - autoLoad : true, - fields : stepsFields - - }); - availableSteps.load(); - - var btnStepsCondition = new Ext.Button({ - id: 'btnCondition', - text: _('ID_CONDITION'), - handler: function (s) { - workflow.taskUID = taskId - workflow.variablesAction = 'grid'; - workflow.variable = '@@', - workflow.gridField = 'STEP_CONDITION'; - var rowSelected = conditionGrid.getSelectionModel().getSelections(); - if(rowSelected == '') - workflow.gridObjectRowSelected = conditionGrid; - else - workflow.gridObjectRowSelected = rowSelected; - - var rowData = ProcMapObj.ExtVariables(); - console.log(rowData); - } - }) - - - var toolbar = new Ext.Toolbar({ - items: [btnStepsCondition] - }); - //availableSteps.load(); - var conditionGrid = new Ext.grid.GridPanel({ - store : taskSteps, - id : 'conditiongrid', - loadMask : true, - loadingText : 'Loading...', - frame : false, - autoHeight : false, - //enableDragDrop : true, - layout : 'form', - tbar : toolbar, - //ddGroup : 'firstGridDDGroup', - clicksToEdit : 1, - minHeight :400, - height :400, - plugins : [editor], - columns : [{ - id: 'STEP_TITLE', - header: _('ID_STEPS'), - dataIndex: 'STEP_TITLE', - width: 280, - editor: new Ext.form.TextField({ - }) - }, - { - id: 'STEP_CONDITION', - header: _('ID_CONDITION'), - dataIndex: 'STEP_CONDITION', - width: 250, - //editable: true, - editor: new Ext.form.TextField({ - editable : true - }) - } - ] - }); - - - - var grid = new Ext.grid.GridPanel({ - store : taskSteps, - id : 'mygrid', - loadMask : true, - loadingText : 'Loading...', - //renderTo : 'cases-grid', - frame : false, - autoHeight : false, - //enableDragDrop : true, - //ddGroup : 'firstGridDDGroup', - clicksToEdit: 1, - minHeight :400, - height :340, - layout : 'form', - plugins : [editor], - columns : [{ - id: 'STEP_TITLE', - header: _('ID_STEPS'), - dataIndex: 'STEP_TITLE', - width: 200, - sortable: true, - editor: new Ext.form.ComboBox({ - xtype : 'combo', - fieldLabel : 'Users_groups', - store : availableSteps, - displayField : 'STEP_TITLE' , - valueField : 'STEP_TITLE', - scope : this, - triggerAction: 'all', - emptyText : 'Select Step', - allowBlank : false, - onSelect: function(record, index){ - var User = grid.getStore(); - - if(typeof _3252.scope.workflow.currentrowIndex == 'undefined') - var selectedrowIndex = '0'; - else - selectedrowIndex = _3252.scope.workflow.currentrowIndex; //getting Index of the row that has been edited - - //User.data.items[0].data.STEP_TITLE= record.data.STEP_TITLE; - User.data.items[selectedrowIndex].data.STEP_UID = record.data.STEP_UID; - User.data.items[selectedrowIndex].data.STEP_TYPE_OBJ =record.data.STEP_TYPE_OBJ; - User.data.items[selectedrowIndex].data.STEP_CONDITION =record.data.STEP_CONDITION; - User.data.items[selectedrowIndex].data.STEP_POSITION =record.data.STEP_POSITION; - User.data.items[selectedrowIndex].data.STEP_UID_OBJ =record.data.STEP_UID_OBJ; - User.data.items[selectedrowIndex].data.STEP_MODE =record.data.STEP_MODE; - - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - }) - }, - { - id: 'STEP_MODE', - header: _('STEP_MODE'), - dataIndex: 'STEP_MODE', - width: 100, - sortable: true, - editor: new Ext.form.ComboBox ({ - editable : false, - triggerAction: 'all', - lazyRender:true, - allowBlank : false, - emptyText : 'Select Mode', - mode: 'local', - scope: this, - store: new Ext.data.ArrayStore({ - id: 0, - fields: [ - 'STEP_MODE', - 'STEP_MODE' - ], - data: [['EDIT', 'Edit'], ['VIEW', 'View']] - }), - valueField: 'STEP_MODE', - defaultValue: 'EDIT', - displayField: 'STEP_MODE', - onSelect: function(record, index){ - var User = grid.getStore(); - User.data.items[0].data.STEP_MODE=record.data.STEP_MODE; - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - }) - }, - { - sortable: false, - renderer: function() - { - return String.format("
Edit",pro_uid,taskId); - } - } - ], - sm: new Ext.grid.RowSelectionModel({ - singleSelect: true, - listeners: { - rowselect: function(smObj, rowIndex, record) { - _3252.scope.workflow.currentrowIndex = rowIndex; - } - } - }), - stripeRows: true, - viewConfig: {forceFit: true}, - tbar: tb, - bbar: new Ext.PagingToolbar({ - pageSize: 10, - store: taskSteps, - displayInfo: true, - displayMsg: 'Displaying Steps {0} - {1} of {2}', - emptyMsg: "No Steps to display", - items:[] - }) - }); - - editor.on({ - scope: this, - afteredit: function(roweditor, changes, record, rowIndex) { - - var stepUIDObj = record.data.STEP_UID_OBJ; - var stepTypeObj = record.data.STEP_TYPE_OBJ; - var stepMode = record.data.STEP_MODE; - - Ext.Ajax.request({ - url : '../steps/steps_Save.php', - method: 'POST', - params: { - sProcess : pro_uid, - sTask : taskId, - sType : stepTypeObj, - sUID : stepUIDObj, - sMode : stepMode - }, - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_STEP_ASSIGNED') ); - } - }); - //availableSteps.reload(); - //Deleting previously assigned step on updating/replacing with new step. - if(changes != '' && typeof record.json != 'undefined') - { - var stepUID = record.json.STEP_UID; - var stepPosition = record.json.STEP_POSITION; - - Ext.Ajax.request({ - url : '../steps/steps_Delete.php', - method: 'POST', - params: { - TASK : taskId, - STEP_UID : stepUID, - STEP_POSITION : stepPosition - }, - success: function(response) { - //Ext.MessageBox.alert ('Status','Step has been updated successfully.'); - } - }); - } - - } - }); - - - - //Getting triggers data using stepTriggers function - var treeGrid = taskExtObj.stepTriggers(_3252); - treeGrid.render(document.body); - - var taskStepsTabs = new Ext.FormPanel({ - labelWidth: 100, - monitorValid : true, - width : 850, - height : 400, - items: - { - xtype:'tabpanel', - activeTab: 0, - defaults:{ - autoHeight:true - }, - items:[{ - title:_('ID_STEPS'), - layout:'fit', - defaults: { - width: 400 - }, - listeners: { - tabchange: function(tabPanel,newTab){ - taskSteps.reload(); - } - }, - items:[grid] - },{ - title:_('ID_CONDITION'), - layout:'fit', - defaults: { - width: 400 - }, - listeners: { - tabchange: function(tabPanel,newTab){ - taskSteps.reload(); - } - }, - items:[conditionGrid] - },{ - title:_('ID_TRIGGERS'), - layout:'form', - defaults: { - width: 400 - }, - items:[treeGrid] - }] - } - }); - - taskStepsTabs.render(document.body); - _3252.scope.workflow.taskStepsTabs = taskStepsTabs; - - var window = new Ext.Window({ - title: _('ID_STEPS_OF'), - collapsible: false, - maximizable: false, - width: 770, - height: 380, - minWidth: 200, - minHeight: 150, - layout: 'fit', - plain: true, - buttonAlign: 'center', - items: taskStepsTabs - - }); - window.show(); -} - -TaskContext.prototype.editUsers= function() -{ - var taskExtObj = new TaskContext(); - var taskId = workflow.currentSelection.id; - var userFields = Ext.data.Record.create([ - { - name: 'LABEL', - type: 'string' - }, - { - name: 'TU_TYPE', - type: 'string' - }, - { - name: 'TU_RELATION', - type: 'string' - }, - { - name: 'TAS_UID', - type: 'string' - }, - { - name: 'USR_UID', - type: 'string' - } - ]); - var editor = new Ext.ux.grid.RowEditor({ - saveText: _('ID_UPDATE') - }); - - - var btnAdd = new Ext.Button({ - id: 'btnAdd', - text: _('ID_ASSIGN'), - iconCls: 'button_menu_ext ss_sprite ss_add', - handler: function(){ - var User = grid.getStore(); - var e = new userFields({ - TAS_UID : '', - TU_TYPE : '', - USR_UID : '', - TU_RELATION: '' - }); - //storeUsers.reload(); - if(storeUsers.data.items.length == 0) - PMExt.notify( _('ID_STATUS') , _('ID_USERS_UNAVAILABLE') ); - else - { - editor.stopEditing(); - taskUsers.insert(0, e); - grid.getView().refresh(); - editor.startEditing(0, 0); - } - } - }); - - var btnRemove = new Ext.Button({ - id: 'btnRemove', - text: _('ID_REMOVE'), - iconCls: 'application_delete', - handler: function (s) { - editor.stopEditing(); - var s = grid.getSelectionModel().getSelections(); - for(var i = 0, r; r = s[i]; i++){ - - //First Deleting assigned users from Database - var user_TURel = r.data.TU_RELATION; - var userUID = r.data.USR_UID; - var user_TUtype = r.data.TU_TYPE; - var urlparams = '?action=ofToAssign&data={"TAS_UID":"'+taskId+'","TU_RELATION":"'+user_TURel+'","USR_UID":"'+userUID+'","TU_TYPE":"'+user_TUtype+'"}'; - - //if USR_UID is properly defined (i.e. set to valid value) then only delete the row - //else its a BLANK ROW for which Ajax should not be called. - if(r.data.USR_UID != "") - { - Ext.Ajax.request({ - url : 'bpmn/processes_Ajax.php' +urlparams , - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_USERS_REMOVED') ); - //Secondly deleting from Grid - taskUsers.remove(r); - - //Reloading available user store - taskUsers.reload(); - } - }); - } - else - taskUsers.remove(r); - } - } - }); - - var tb = new Ext.Toolbar({ - items: [btnAdd, btnRemove] - }); - - // create the Data Store of users that are already assigned to a task - var taskUsers = new Ext.data.JsonStore({ - root : 'data', - totalProperty: 'totalCount', - idProperty : 'gridIndex', - remoteSort : true, - fields : userFields, - proxy: new Ext.data.HttpProxy({ - url: 'bpmn/proxyExtjs?pid='+pro_uid+'&tid='+taskId+'&action=getAssignedUsersList' - }) - }); - taskUsers.setDefaultSort('LABEL', 'asc'); - - - // create the Data Store of users that are not assigned to a task - var storeUsers = new Ext.data.JsonStore({ - root : 'data', - url : 'bpmn/proxyExtjs?tid='+taskId+'&action=getAvailableUsersList', - totalProperty : 'totalCount', - idProperty : 'gridIndex', - remoteSort : false, //true, - autoLoad : true, - fields : userFields - }); - storeUsers.load(); - - var grid = new Ext.grid.GridPanel({ - store: taskUsers, - id : 'mygrid', - loadMask: true, - loadingText: 'Loading...', - //renderTo: 'cases-grid', - frame: false, - autoHeight:false, - clicksToEdit: 1, - minHeight:400, - height :320, - layout: 'fit', - plugins: [editor], - cm: new Ext.grid.ColumnModel({ - defaults: { - width: 200, - sortable: true - }, - columns: [ - new Ext.grid.RowNumberer(), - { - id: 'LABEL', - header:_('ID_GROUP_USER'), - dataIndex: 'LABEL', - width: 100, - editor: new Ext.form.ComboBox({ - xtype: 'combo', - fieldLabel: 'Users_groups', - hiddenName: 'number', - store : storeUsers, - displayField : 'LABEL' , - valueField : 'LABEL', - name : 'LABEL', - triggerAction: 'all', - emptyText: 'Select User or Group', - allowBlank: false, - onSelect: function(record, index){ - var User = grid.getStore(); - - if(typeof workflow.currentrowIndex == 'undefined') - var selectedrowIndex = '0'; - else - selectedrowIndex = workflow.currentrowIndex; //getting Index of the row that has been edited - - //User.data.items[0].data.LABEL= record.data.LABEL; - User.data.items[selectedrowIndex].data.TAS_UID = record.data.TAS_UID; - User.data.items[selectedrowIndex].data.TU_TYPE = record.data.TU_TYPE; - User.data.items[selectedrowIndex].data.USR_UID = record.data.USR_UID; - User.data.items[selectedrowIndex].data.TU_RELATION = record.data.TU_RELATION; - - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - }) - }, - ] - }), - sm: new Ext.grid.RowSelectionModel({ - singleSelect: true, - listeners: { - rowselect: function(smObj, rowIndex, record) { - workflow.currentrowIndex = rowIndex; - } - } - }), - - stripeRows: true, - viewConfig: {forceFit: true}, - bbar: new Ext.PagingToolbar({ - pageSize: 10, - store: taskUsers, - displayInfo: true, - displayMsg: 'Displaying Users {0} - {1} of {2}', - emptyMsg: "No Users to display", - items:[] - }), - tbar: tb - }); - - taskUsers.load({params:{start : 0 , limit : 10 }}); - - editor.on({ - scope: this, - afteredit: function(roweditor, changes, record, rowIndex) { - var taskId = record.data.TAS_UID; - var userId = record.data.USR_UID; - var tu_Type = record.data.TU_TYPE; - var tu_Relation = record.data.TU_RELATION; - var urlparams = '?action=assign&data={"TAS_UID":"'+taskId+'","USR_UID":"'+userId+'","TU_TYPE":"'+tu_Type+'","TU_RELATION":"'+tu_Relation+'"}'; - - Ext.Ajax.request({ - url: 'bpmn/processes_Ajax.php' +urlparams , - success: function (response) { // When saving data success - PMExt.notify( _('ID_STATUS') , _('ID_USER_ASSIGNED') ); - }, - failure: function () { // when saving data failed - PMExt.notify( _('ID_STATUS') , _('ID_USER_SAVE_FAIL') ); - } - }); - - //Updating the user incase if already assigned user has been replaced by other user - if(changes != '' && typeof record.json != 'undefined') - { - var user_TURel = record.json.TU_RELATION; - var userUID = record.json.USR_UID; - var user_TUtype = record.json.TU_TYPE; - urlparams = '?action=ofToAssign&data={"TAS_UID":"'+taskId+'","TU_RELATION":"'+user_TURel+'","USR_UID":"'+userUID+'","TU_TYPE":"'+user_TUtype+'"}'; - Ext.Ajax.request({ - url : 'bpmn/processes_Ajax.php' +urlparams , - success: function(response) { - //Ext.MessageBox.alert ('Status','User has been updated successfully.'); - } - }); - } - storeUsers.reload(); - } - }); - - var panel = new Ext.Panel({ - id: 'panel', - //renderTo: Ext.getBody(), - items: [grid] - }); - - var window = new Ext.Window({ - title: _('ID_USERS_GROUPS'), - collapsible: false, - maximizable: false, - width: 400, - height: 350, - minWidth: 200, - minHeight: 150, - //layout: 'fit', - plain: true, - buttonAlign: 'center', - items: panel - }); - window.show(); -} - - -TaskContext.prototype.editTaskProperties= function() -{ - var ProcMapObj = new ProcessMapContext(); - var taskExtObj = new TaskContext(); - var taskId = workflow.currentSelection.id; - var oPmosExt = new pmosExt(); - - var fieldsToToggle = new Array(); - - var taskPropertiesTabs = new Ext.FormPanel({ - labelWidth : 140, - //border : false, - monitorValid : true, - // store : taskDetails, - //url : 'proxyTaskPropertiesDetails.php', - width : 600, - items: [{ - xtype:'tabpanel', - activeTab: 0, - bodyStyle : 'padding:5px 0 0 5px;', - defaults:{ - labelWidth : 140, - height : 300 - }, - items:[ - { - title:_('ID_DEFINITION'), - layout:'form', - defaults: { - width: 230 - }, - defaultType: 'textfield', - items: [{ - fieldLabel: _('ID_TITLE'), - name: 'TAS_TITLE', - width: 350 - },{ - xtype: 'textarea', - fieldLabel: _('ID_DESCRIPTION'), - name: 'TAS_DESCRIPTION', - allowBlank: true, - width: 350, - height : 150 - },{ - xtype: 'fieldset', - layout:'column', - border : false, - width: 550, - items:[{ - columnWidth:.7, - layout: 'form', - border : false, - items: [{ - xtype: 'textfield', - labelWidth : 130, - fieldLabel: _('ID_VARIABLES_CASE_PRIORITY'), - name: 'TAS_PRIORITY_VARIABLE', - anchor:'100%' - }] - },{ - columnWidth:.2, - layout: 'form', - border:false, - items: [{ - xtype:'button', - title: ' ', - text: '@@', - name: 'selectorigin', - handler: function (s) { - workflow.variablesAction = 'form'; - workflow.fieldName = 'TAS_PRIORITY_VARIABLE' ; - workflow.formSelected = taskPropertiesTabs; - var rowData = ProcMapObj.ExtVariables(); - console.log(rowData); - } - }] - }] - },{ - xtype: 'checkbox', - fieldLabel: _('ID_START_TASK'), - name: 'TAS_START', - checked:workflow.checkStartingTask - }] - },{ - title:_('ID_ASSIGNMENT_RULES'), - layout : 'form', - defaults: { - width: 260 - }, - items: [{ - xtype: 'radiogroup', - //id: 'assignType', - fieldLabel: _('ID_CASES_ASSIGNED_BY'), - itemCls: 'x-check-group-alt', - columns: 1, - items: [{ - boxLabel: _('ID_CYCLIC_ASSIGNMENT'), - //id: 'BALANCED', - name: 'TAS_ASSIGN_TYPE', - inputValue: 'BALANCED', - checked: false -// listeners: { -// 'check':{ -// fn: function(){ -// Ext.getCmp("staticMI").hide(); -// Ext.getCmp("cancelMI").hide(); -// Ext.getCmp("evaluate").hide(); -// } -// } -// } - },{ - boxLabel: _('ID_MANUAL_ASSIGNMENT'), - // id: 'MANUAL', - name: 'TAS_ASSIGN_TYPE', - inputValue: 'MANUAL', - checked:false -// listeners: { -// 'check':{ -// fn: function(){ -// Ext.getCmp("staticMI").hide(); -// Ext.getCmp("cancelMI").hide(); -// Ext.getCmp("evaluate").hide(); -// } -// } -// } - },{ - boxLabel: _('ID_VALUE_BASED'), - //id:'EVALUATE', - name: 'TAS_ASSIGN_TYPE', - inputValue: 'EVALUATE', - checked:false -// listeners: { -// 'check':{ -// fn: function(){ - - -// var fields = workflow.taskPropertiesTabs.items.items[0].items.items[1].items.items; -// var fieldsToToggle = new Array(); -// fieldsToToggle = [fields[1].items.items[0].items.items[0]]; -// oPmosExt.toggleFields(fieldsToToggle,true); -// } -// } -// } - },{ - boxLabel: _('ID_REPORTS_TO'), - //id:'REPORT_TO', - name: 'TAS_ASSIGN_TYPE', - inputValue: 'REPORT_TO', - checked:false -// listeners: { -// 'check':{ -// fn: function(){ -// Ext.getCmp("staticMI").hide(); -// Ext.getCmp("cancelMI").hide(); -// Ext.getCmp("evaluate").hide(); -// } -// } -// } - },{ - boxLabel: _('ID_SELF_SERVICE'), - //id:'SELF_SERVICE', - name: 'TAS_ASSIGN_TYPE', - inputValue: 'SELF_SERVICE', - checked:false -// listeners: { -// 'check': -// {fn: function(){ -// //fieldsToToggle = [fields[0],fields[1],fields[2],fields[3],fields[4],fields[5],fields[6],fields[7],fields[8]] -// Ext.getCmp("staticMI").hide(); -// Ext.getCmp("cancelMI").hide(); -// Ext.getCmp("evaluate").hide(); -// } -// } -// } - },{ - boxLabel: _('ID_STATIC_PARTIAL_JOIN_MULTIPLE_INSTANCES'), - //id:'STATIC_MI', - name: 'TAS_ASSIGN_TYPE', - inputValue: 'STATIC_MI', - checked:false -// listeners: { -// 'check':{ -// fn: function(){ -// Ext.getCmp("staticMI").show(); -// Ext.getCmp("cancelMI").show(); -// Ext.getCmp("evaluate").hide(); -// } -// } -// } - },{ - boxLabel: _('ID_CANCEL_PARTIAL_JOIN_MULTIPLE_INSTANCE'), - //id : 'CANCEL_MI', - name : 'TAS_ASSIGN_TYPE', - inputValue: 'CANCEL_MI', - checked:false -// listeners: { -// 'check':{ -// fn: function(){ -// Ext.getCmp("staticMI").show(); -// Ext.getCmp("cancelMI").show(); -// Ext.getCmp("evaluate").hide(); -// } -// } -// } - }] - - - },{ - xtype: 'fieldset', - layout:'column', - border:false, - width: 550, - hidden: true, - id: 'evaluate', - items:[{ - columnWidth:.8, - layout: 'form', - border:false, - items: [{ - xtype: 'textfield', - fieldLabel: _('ID_VARIABLES_VALUE_ASSIGNMENT'), - name: 'TAS_ASSIGN_VARIABLE', - anchor:'100%' - }] - },{ - columnWidth:.2, - layout: 'form', - border:false, - items: [{ - xtype:'button', - title: ' ', - text: '@@', - name: 'selectorigin' - }] - } - ] - },{ - xtype: 'fieldset', - layout:'column', - border:false, - width: 550, - hidden: true, - id: 'staticMI', - items:[{ - columnWidth:.8, - layout: 'form', - border:false, - items: [{ - xtype: 'textfield', - fieldLabel: _('ID_VARIABLES_NO_INSTANCES'), - name: 'TAS_MI_INSTANCE_VARIABLE', - anchor:'100%' - }] - },{ - columnWidth:.2, - layout: 'form', - border:false, - items: [{ - xtype:'button', - title: ' ', - text: '@@', - name: 'selectorigin' - }] - }] - },{ - xtype: 'fieldset', - layout:'column', - border:false, - width: 550, - hidden: true, - id: 'cancelMI', - items:[{ - columnWidth:.8, - layout: 'form', - border:false, - items: [{ - xtype: 'textfield', - fieldLabel: _('ID_VARIABLES_INSTANCES_TO _COMPLETE'), - name: 'TAS_MI_COMPLETE_VARIABLE', - anchor:'100%' - }] - },{ - columnWidth:.2, - layout: 'form', - border:false, - items: [{ - xtype:'button', - title: ' ', - text: '@@', - name: 'selectorigin' - }] - }] - }] - },{ - title:'Timing Control Rules', - layout:'form', - defaults: { - width: 260 - }, - defaultType: 'textfield', - items: [{ - xtype: 'checkbox', - boxLabel: _('ID_USER_DEFINED_TIMING_CONTROL'), - name: 'TAS_TRANSFER_FLY', - checked: 'TAS_TRANSFER_FLY', - labelWidth: 100, - listeners: { - /**Listeners for hiding all the fields - * under "Timing Control Rules" tabs - * when user clicks on 'Allow user defined timing control' checkbox - **/ - check : function(a,checked,c) { - if(checked == true) - Ext.getCmp("userDefinedTiming").hide(); - else - Ext.getCmp("userDefinedTiming").show(); - } - } - },{ - xtype: 'fieldset', - layout:'form', - border:false, - width: 550, - hidden: false, - id: 'userDefinedTiming', - - items:[{ - xtype: 'textfield', - fieldLabel: _('ID_TASK_DURATION'), - name: 'TAS_DURATION', - width : 100, - allowBlank:false - },{ - width: 100, - xtype: 'combo', - mode: 'local', - triggerAction: 'all', - forceSelection: true, - editable: false, - fieldLabel: _('ID_TIME_UNIT'), - name: 'TAS_TIMEUNIT', - hiddenName: 'TAS_TIMEUNIT', - displayField: 'name', - valueField: 'value', - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - { - name : 'Days', - value: 'Days' - },{ - name : 'Hours', - value: 'Hours' - }] - }) - },{ - width: 120, - xtype: 'combo', - mode: 'local', - //value: '- None -', - triggerAction: 'all', - forceSelection: true, - editable: false, - fieldLabel: _('ID_COUNT_DAYS'), - name: 'TAS_TYPE_DAY', - hiddenName: 'TAS_TYPE_DAY', - displayField: 'name', - //value: 'TAS_TYPE_DAY', - valueField: 'value', - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - { - name : 'Work Days', - value: '1' - }, - - { - name : 'Calendar Days', - value: '2' - }, - ] - }) - },{ - width: 100, - xtype: 'combo', - mode: 'local', - value: 'Default', - forceSelection: true, - triggerAction: 'all', - editable: false, - fieldLabel: _('ID_CALENDAR'), - name: 'TAS_CALENDAR', - hiddenName: 'TAS_CALENDAR', - displayField: 'name', - valueField: 'value', - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - { - name : '- None-', - value: '- None-' - }, - - { - name : 'Default', - value: 'Default' - }, - ] - }) - }] - }] - },{ - title:_('ID_PERMISSION'), - layout:'form', - defaults: { - width: 260 - }, - defaultType: 'textfield', - labelWidth: 200, - items: [{ - xtype: 'checkbox', - //id: 'ADHOC', - fieldLabel: _('ID_ALLOW_ARBITARY_TRANSFER'), - inputValue:'ADHOC', - checked: false, - name: 'TAS_TYPE' - }] - },{ - title:_('ID_CASE_LABELS'), - layout:'form', - defaults: { - width: 600 - }, - defaultType: 'textfield', - labelWidth: 70, - items: [{ - xtype: 'fieldset', - layout:'column', - border:false, - width: 600, - items:[{ - columnWidth:.8, - layout: 'form', - border:false, - items: [{ - xtype: 'textarea', - fieldLabel: _('ID_CASE_TITLE'), - //id: 'caseTitle', - name: 'TAS_DEF_TITLE', - height : 120, - //value: _5625.scope.workflow.taskDetails.TAS_ASSIGN_VARIABLE - anchor:'100%' - }] - },{ - columnWidth:.2, - layout: 'form', - border:false, - items: [{ - xtype:'button', - title: ' ', - text: '@#', - name: 'selectCaseTitle', - handler: function (s) { - workflow.variablesAction = 'form'; - workflow.variable = '@%23', - workflow.fieldName = 'TAS_DEF_TITLE' ; - workflow.formSelected = taskPropertiesTabs; - var rowData = ProcMapObj.ExtVariables(); - console.log(rowData); - } - }] - }] - },{ - xtype: 'fieldset', - layout:'column', - border:false, - width: 600, - items:[{ - columnWidth:.8, - layout: 'form', - border:false, - items: [{ - xtype: 'textarea', - //id: 'caseDescription', - fieldLabel: _('ID_CASE_DESCRIPTION'), - name: 'TAS_DEF_DESCRIPTION', - height : 120, - anchor:'100%' - - }] - },{ - columnWidth:.2, - layout: 'form', - border:false, - items: [{ - xtype:'button', - title: ' ', - text: '@#', - name: 'selectCaseDesc', - handler: function (s) { - workflow.variablesAction = 'form'; - workflow.variable = '@%23', - workflow.fieldName= 'TAS_DEF_DESCRIPTION' ; - workflow.formSelected = taskPropertiesTabs; - var rowData = ProcMapObj.ExtVariables(); - console.log(rowData); - } - }] - }] - }] - },{ - title:_('ID_NOTIFICATION'), - layout:'form', - defaultType: 'textfield', - labelWidth: 170, - items: [{ - xtype: 'checkbox', - boxLabel: _('ID_NOTIFY_USERS_AFTER_ASSIGN'), - labelWidth: 100, - name: 'SEND_EMAIL', - checked: 'TAS_DEF_MESSAGE_CHECKBOX', - listeners: { - /**Listeners for showing "TAS_DEF_MESSAGE" textarea field - * under "Notification" tab - * when user clicks on 'After routing notify the next assigned user(s).' checkbox - **/ - check : function(a,checked,c) { - if(checked == true) - Ext.getCmp("notifyUser").show(); - else - Ext.getCmp("notifyUser").hide(); - } - } - },{ - xtype: 'fieldset', - id: 'notifyUser', - border: false, - defaults: { - width: 400 - }, - labelWidth: 50, - hidden: true, - items :[{ - xtype: 'textarea', - name: 'TAS_DEF_MESSAGE', - width: 400, - height : 180 - }] - }] - } - ] - }] - }); - - workflow.taskPropertiesTabs = taskPropertiesTabs; - - - //Loading Task Details into the form - taskPropertiesTabs.form.load({ - url:'bpmn/proxyExtjs.php?tid='+taskId+'&action=getTaskPropertiesList', - method:'GET', - waitMsg:'Loading', - success:function(form, action) { - alert(action.result.data.TAS_START); - if(action.result.data.TAS_START== true) - workflow.checkStartingTask = 'on'; - else - workflow.checkStartingTask = 'off'; - - //To load the values of the selecte radio button in Assignment Rules - if(action.result.data.TAS_ASSIGN_TYPE=='BALANCED') - form.items.items[4].items[0].checked=true; - - else if(action.result.data.TAS_ASSIGN_TYPE=='MANUAL') - { - form.items.items[4].items[1].checked=true; - //Ext.getCmp(ID).setValue(true); - //taskPropertiesTabs.getForm().findField('TAS_ASSIGN_TYPE').setValue(true); - } - else if(action.result.data.TAS_ASSIGN_TYPE=='EVALUATE') - { - form.items.items[4].items[2].checked=true; - taskPropertiesTabs.getForm().findField('TAS_ASSIGN_VARIABLE').show(); - } - - else if(action.result.data.TAS_ASSIGN_TYPE=='REPORT_TO') - form.items.items[4].items[3].checked=true; - - else if(action.result.data.TAS_ASSIGN_TYPE=='SELF_SERVICE') - {form.items.items[4].items[4].checked=true; - Ext.getCmp("staticMI").hide(); - Ext.getCmp("cancelMI").hide();} - - else if(action.result.data.TAS_ASSIGN_TYPE=='STATIC_MI') - { - form.items.items[4].items[5].checked=true; - Ext.getCmp("staticMI").show(); - Ext.getCmp("cancelMI").show(); - Ext.getCmp("evaluate").hide(); - } - - else if(action.result.data.TAS_ASSIGN_TYPE=='CANCEL_MI') - { - form.items.items[4].items[6].checked=true; - Ext.getCmp("staticMI").show(); - Ext.getCmp("cancelMI").show(); - Ext.getCmp("evaluate").hide(); - } - - if(action.result.data.TAS_TYPE == 'ADHOC') - form.items.items[13].checked=false; - else - form.items.items[13].checked=true; - - - if(action.result.data.TAS_ASSIGN_TYPE == 'EVALUATE') - form.findField('TAS_ASSIGN_VARIABLE').show(); - - - - }, - failure:function(form, action) { - PMExt.notify( _('ID_STATUS') , _('ID_FAILURE') ); - } - }); - - taskPropertiesTabs.render(document.body); - workflow.taskPropertiesTabs = taskPropertiesTabs; - - var window = new Ext.Window({ - title: _('ID_TASK'), - collapsible: false, - maximizable: false, - width: 600, - height: 370, - minWidth: 300, - minHeight: 150, - layout: 'fit', - plain: true, - buttonAlign: 'center', - items: taskPropertiesTabs, - buttons: [{ - text: _('ID_SAVE'), - formBind :true, - handler: function(){ - //var getstore = taskPropertiesTabs.getStore(); - //var getData = getstore.data.items; - taskExtObj.saveTaskProperties(); - //window.hide(); - - } - },{ - text: _('ID_CANCEL'), - handler: function(){ - // when this button clicked, - window.hide(); - } - }] - }); - window.show(); - -} - -TaskContext.prototype.saveTaskProperties= function() -{ - var saveTaskform = workflow.taskPropertiesTabs.getForm().getValues(); - var taskId = workflow.currentSelection.id; - var tas_start = saveTaskform['TAS_START']; - var tas_type = saveTaskform['TAS_TYPE']; - var tas_transfer_fly = saveTaskform['TAS_TRANSFER_FLY']; - var send_email = saveTaskform['SEND_EMAIL']; - saveTaskform['TAS_UID'] = taskId; - alert(tas_start); - - //Checking checkbox fields - if(typeof tas_start != 'undefined' && tas_start != ''){ - if(tas_start == 'on') - saveTaskform['TAS_START'] = 'TRUE'; - } - else - saveTaskform['TAS_START'] = 'FALSE'; - - if(typeof tas_transfer_fly != 'undefined' && tas_transfer_fly != ''){ - if(tas_transfer_fly == 'on') - saveTaskform['TAS_TRANSFER_FLY'] = 'TRUE'; - } - else - saveTaskform['TAS_TRANSFER_FLY'] = 'FALSE'; - - if(typeof send_email != 'undefined' && send_email != ''){ - if(send_email == 'on') - saveTaskform['SEND_EMAIL'] = 'TRUE'; - } - else - saveTaskform['SEND_EMAIL'] = 'FALSE'; - - if(typeof tas_type != 'undefined' && tas_type != ''){ - if(tas_type == 'on') - saveTaskform['TAS_TYPE'] = 'ADHOC'; - } - else - saveTaskform['TAS_TYPE'] = 'NORMAL'; - - var object_data = Ext.util.JSON.encode(saveTaskform); - - Ext.Ajax.request({ - url: '../tasks/tasks_Ajax.php' , - success: function (response) { // When saving data success - PMExt.notify( _('ID_STATUS') , _('ID_TASK_PROPERTIES_SAVE') ); - }, - failure: function () { // when saving data failed - PMExt.notify( _('ID_STATUS') , _('ID_ERROR_TASK_SAVE') ); - }, - params: { - functions:'saveTaskData', - oData:object_data - } - }); -} - -TaskContext.prototype.stepTriggers = function() - { - var taskId = workflow.currentSelection.id; - var ProcMapObj= new ProcessMapContext(); - var triggersFields = Ext.data.Record.create([ - { - name: 'CON_VALUE', - type: 'string' - }, - { - name: 'ST_TYPE', - type: 'string' - }, - { - name: 'STEP_UID', - type: 'string' - }, - { - name: 'TRI_UID', - type: 'string' - }, - { - name: 'ST_POSITION', - type: 'string' - }, - { - name: 'TRI_TITLE', - type: 'string' - }, - { - name: 'ST_CONDITION', - type: 'string' - } - ]); - - var triggerEditor = new Ext.ux.grid.RowEditor({ - saveText: _('ID_UPDATE') - }); - - var root = new Ext.tree.AsyncTreeNode({text: 'treeRoot',id:'0'}); - var tree = new Ext.tree.TreePanel({ - //renderTo : 'cases-grid', - dataUrl : 'get-triggers-tree.php?tid='+taskId, - border : false, - rootVisible : false, - height : 320, - width : 230, - useArrows : false, - autoScroll : true, - animate : true - }); - tree.setRootNode(root); - root.expand(true); - - tree.on('click', function (node){ - if(node.isLeaf()){ - var sStepUID = node.attributes.id; - workflow.selectedStepUID = sStepUID; - - stepsTriggers.on({ - beforeload: { - fn: function (store, options) { - // use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request. - var link = 'bpmn/proxyExtjs?tid='+taskId+'&stepid='+sStepUID+'&action=getAssignedStepTriggers'; - store.proxy.setUrl(link, true); - } - } - }); - - availableTriggers.on({ - beforeload: { - fn: function (store, options) { - // use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request. - var link = 'bpmn/proxyExtjs?pid='+pro_uid+'&tid='+taskId+'&stepid='+sStepUID+'&action=getAvailableStepTriggers'; - store.proxy.setUrl(link, true); - } - } - }); - - triggerGrid.store.load(); - availableTriggers.load(); - //availableTriggers.reload(); - triggerGrid.show(); - } - else - triggerGrid.hide(); - }); - - - var addBtn = new Ext.Button({ - id: 'addBtn', - text: _('ID_ADD'), - iconCls: 'button_menu_ext ss_sprite ss_add', - handler: function(){ - //var User = triggerGrid.getStore(); - var e1 = new triggersFields({ - //STEP_TITLE: User.data.items[0].data.STEP_TITLE, - CON_VALUE : '', - ST_TYPE : '', - STEP_UID : '', - TRI_UID : '', - ST_POSITION : '', - ST_CONDITION : '', - TRI_TITLE : '' - }); - - if(availableTriggers.data.items.length == 0) - PMExt.notify( _('ID_STATUS') , _('ID_TRIGGERS_UNAVAILABLE') ); - else - { - triggerEditor.stopEditing(); - stepsTriggers.insert(0, e1); - triggerGrid.getView().refresh(); - //triggerGrid.getSelectionModel().selectRow(0); - triggerEditor.startEditing(0, 0); - } - - } - }); - - var removeBtn = new Ext.Button({ - id: 'removeBtn', - text: _('ID_REMOVE'), - iconCls: 'button_menu_ext ss_sprite ss_delete', - handler: function (s) { - triggerEditor.stopEditing(); - var s = triggerGrid.getSelectionModel().getSelections(); - for(var i = 0, r; r = s[i]; i++){ - - //First Deleting step from Database using Ajax - var stepUID = r.data.STEP_UID; - var sTrigger = r.data.TRI_UID; - var sType = r.data.ST_TYPE; - var iPosition = r.data.ST_POSITION; - var urlparams = '?action=ofToAssignTrigger&sStep=' + stepUID + '&sTrigger=' + sTrigger + '&sType=' + sType + '&iPosition=' + iPosition - - //if STEP_UID is properly defined (i.e. set to valid value) then only delete the row - //else its a BLANK ROW for which Ajax should not be called. - if(r.data.STEP_UID != "") - { - Ext.Ajax.request({ - url : '../steps/steps_Ajax.php' + urlparams, - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_TRIGGER_REMOVE') ); - //Secondly deleting from Grid - stepsTriggers.remove(r); - - availableTriggers.reload(); - } - }); - } - else - stepsTriggers.remove(r); - } - } - }); - - - var btnTriggerCondition = new Ext.Button({ - //id: 'btnCondition', - text: _('ID_CONDITION'), - handler: function (s) { - workflow.variablesAction = 'grid'; - workflow.variable = '@@', - workflow.gridField = 'ST_CONDITION'; - var rowSelected = triggerGrid.getSelectionModel().getSelections(); - if(rowSelected == '') - workflow.gridObjectRowSelected = triggerGrid; - else - workflow.gridObjectRowSelected = rowSelected; - //var rowSelected = Objectsgrid; - //workflow.gridObject = Objectsgrid; - var rowData = ProcMapObj.ExtVariables(); - } - }); - - var toolBar = new Ext.Toolbar({ - items: [addBtn, removeBtn, btnTriggerCondition] - }); - - - // create the Data Store of users that are already assigned to a task - var stepsTriggers = new Ext.data.JsonStore({ - root : 'data', - url : 'bpmn/proxyExtjs?tid='+taskId+'&action=',//+'&stepid='+workflow.selectedStepUID, - totalProperty : 'totalCount', - idProperty : 'gridIndex', - remoteSort : true, - fields : triggersFields - }); - //taskUsers.setDefaultSort('LABEL', 'asc'); - stepsTriggers.load({params:{start : 0 , limit : 5 }}); - - var availableTriggers = new Ext.data.JsonStore({ - root : 'data', - url : 'bpmn/proxyExtjs?pid='+pro_uid+'&tid='+taskId+'&action=',//+'&stepid='+workflow.selectedStepUID, - totalProperty : 'totalCount', - idProperty : 'gridIndex', - remoteSort : false, //true, - autoLoad : true, - fields : triggersFields - }); - - //availableTriggers.load(); - - var triggerGrid = new Ext.grid.GridPanel({ - store: stepsTriggers, - id : 'triggerGrid', - //cm: cm, - loadMask: true, - loadingText: 'Loading...', - //renderTo: 'cases-grid', - frame: false, - autoHeight:false, - hidden :true, - clicksToEdit: 1, - width : 450, - minHeight:400, - height :320, - layout: 'fit', - plugins: [triggerEditor], - columns: [ - new Ext.grid.RowNumberer(), - { - id: 'blank', - hidden : true, - //width:0, - editable: true, - editor: new Ext.form.TextField({ - allowBlank: true - }) - }, - { - id: 'CON_VALUE', - header: _('ID_TRIGGERS'), - dataIndex: 'CON_VALUE', - //width: 200, - sortable: true, - editor: new Ext.form.ComboBox({ - id : 'available', - xtype : 'combo', - fieldLabel : 'Users_groups', - hiddenName : 'number', - store : availableTriggers, - displayField : 'CON_VALUE', - valueField : 'CON_VALUE', - name : 'CON_VALUE', - scope : this, - triggerAction: 'all', - emptyText : 'Select Triggers', - allowBlank : false, - onSelect : function(record, index){ - var triggerStore = triggerGrid.getStore(); - - if(typeof workflow.currentRowTrigger == 'undefined') - var selectedrowIndex = '0'; - else - selectedrowIndex = workflow.currentRowTrigger; //getting Index of the row that has been edited - - //User.data.items[0].data.CON_VALUE = record.data.CON_VALUE; - triggerStore.data.items[selectedrowIndex].data.ST_TYPE = record.data.ST_TYPE; - triggerStore.data.items[selectedrowIndex].data.STEP_UID = record.data.STEP_UID; - triggerStore.data.items[selectedrowIndex].data.TRI_UID = record.data.TRI_UID; - triggerStore.data.items[selectedrowIndex].data.ST_POSITION = record.data.ST_POSITION; - triggerStore.data.items[selectedrowIndex].data.TRI_TITLE = record.data.TRI_TITLE; - - workflow.currentrowIndex = '0'; - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - }) - }, - { - //id: 'STEP_TITLE', - header: _('ID_CONDITION'), - dataIndex: 'ST_CONDITION', - //width: 200, - editable: true, - editor: new Ext.form.TextField({ - allowBlank: true - }) - } - - ], - sm: new Ext.grid.RowSelectionModel({ - singleSelect: true, - listeners: { - rowselect: function(smObj, rowIndex, record) { - workflow.currentRowTrigger = rowIndex; - } - } - }), - stripeRows: true, - viewConfig: {forceFit: true}, - bbar: new Ext.PagingToolbar({ - pageSize: 5, - store: stepsTriggers, - displayInfo: true, - displayMsg: 'Displaying Step Tiggers {0} - {1} of {2}', - emptyMsg: "No Step Tiggers to display", - items:[] - }), - tbar: toolBar - }); - - triggerEditor.on({ - scope: this, - afteredit: function(roweditor, changes, record, rowIndex) { - - var stepUID = record.data.STEP_UID; - var triUID = record.data.TRI_UID; - var sType = record.data.ST_TYPE; - var sCondition = record.data.ST_CONDITION; - //var urlparams = '?action=assignTrigger&data={"STEP_UID":"'+stepUID+'","TRI_UID":"'+triUID+'","ST_TYPE":"'+sType+'","ST_CONDITION":""}'; - Ext.Ajax.request({ - url : '../steps/steps_Ajax.php', - method: 'POST', - params:{ - action : 'assignTrigger', - STEP_UID : stepUID, - TRI_UID : triUID, - ST_TYPE : sType, - ST_CONDITION : sCondition - }, - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_TRIGGER_ASSIGN') ); - tree.getLoader().dataUrl = 'get-triggers-tree.php?tid='+taskId; - tree.getLoader().load(tree.root); - } - }); - - //Deleting previously assigned trigger on updating/replacing with new trigger. - if(changes != '' && typeof record.json != 'undefined' ) - { - stepUID = record.json.STEP_UID; - var sTrigger = record.json.TRI_UID; - sType = record.json.ST_TYPE; - var iPosition = record.json.ST_POSITION; - var condition = record.json.ST_CONDITION; - - var urlparams = '?action=ofToAssignTrigger&sStep=' + stepUID + '&sTrigger=' + sTrigger + '&sType=' + sType + '&iPosition=' + iPosition - - Ext.Ajax.request({ - url : '../steps/steps_Ajax.php' + urlparams, - success: function(response) { - //Ext.MessageBox.alert ('Status','Trigger has been updated successfully.'); - } - }); - } - availableTriggers.reload(); - } - }); - - var treeGrid = new Ext.FormPanel({ - frame: false, - monitorValid : true, - labelAlign: 'left', - width: 750, - height: 500, - layout: 'column', - items: [{ - columnWidth: 0.4, - layout: 'fit', - items: [tree] - },{ - columnWidth: 0.6, - xtype: 'fieldset', - //labelWidth: 120, - title:_('ID_ASSIGN_TRIGGERS'), - //defaults: {width: 140, border:false}, - autoHeight: true, - border: false, - items: [triggerGrid] - }] - }); - - return treeGrid; -} - -TaskContext.prototype.editUsersAdHoc= function() -{ - var taskExtObj = new TaskContext(); - var taskId = workflow.currentSelection.id; - var userFields = Ext.data.Record.create([ - { - name: 'LABEL', - type: 'string' - },{ - name: 'TU_TYPE', - type: 'string' - },{ - name: 'TU_RELATION', - type: 'string' - },{ - name: 'TAS_UID', - type: 'string' - },{ - name: 'USR_UID', - type: 'string' - } - ]); - var editor = new Ext.ux.grid.RowEditor({ - saveText: _('ID_UPDATE') - }); - var taskUsers = new Ext.data.JsonStore({ - root : 'data', - totalProperty: 'totalCount', - idProperty : 'gridIndex', - remoteSort : true, - fields : userFields, - proxy: new Ext.data.HttpProxy({ - url: 'bpmn/proxyExtjs?pid='+pro_uid+'&tid='+taskId+'&action=assignedUsers' - }) - }); - //taskUsers.setDefaultSort('LABEL', 'asc'); - taskUsers.load({params:{start : 0 , limit : 10 }}); - - // create the Data Store of users that are not assigned to a task - var storeUsers = new Ext.data.JsonStore({ - root : 'data', - url : 'bpmn/proxyExtjs?tid='+taskId+'&action=availableUsers', - totalProperty : 'totalCount', - idProperty : 'gridIndex', - remoteSort : false, //true, - autoLoad : true, - fields : userFields - }); - - - var btnAdd = new Ext.Button({ - id: 'btnAdd', - text: _('ID_ASSIGN'), - iconCls: 'button_menu_ext ss_sprite ss_add', - handler: function(){ - var User = grid.getStore(); - var e = new userFields({ - //LABEL: 'Select User or Group', - //LABEL: User.data.items[0].data.LABEL, - TAS_UID: '', - TU_TYPE: '', - USR_UID: '', - TU_RELATION: '' - }); - - //storeUsers.reload(); - if(storeUsers.data.items.length == 0) - PMExt.notify( _('ID_STATUS') , _('ID_USERS_UNAVAILABLE') ); - else - { - editor.stopEditing(); - taskUsers.insert(0, e); - grid.getView().refresh(); - //grid.getSelectionModel().selectRow(0); - editor.startEditing(0, 0); - - } - - } - - }); - - var btnRemove = new Ext.Button({ - id: 'btnRemove', - text: _('ID_REMOVE'), - iconCls: 'button_menu_ext ss_sprite ss_delete', - handler: function (s) { - editor.stopEditing(); - var s = grid.getSelectionModel().getSelections(); - for(var i = 0, r; r = s[i]; i++){ - - //First Deleting assigned users from Database - var user_TURel = r.data.TU_RELATION; - var userUID = r.data.USR_UID; - var user_TUtype = r.data.TU_TYPE; - var urlparams = '?action=ofToAssign&data={"TAS_UID":"'+taskId+'","TU_RELATION":"'+user_TURel+'","USR_UID":"'+userUID+'","TU_TYPE":"'+user_TUtype+'"}'; - - //if USR_UID is properly defined (i.e. set to valid value) then only delete the row - //else its a BLANK ROW for which Ajax should not be called. - if(r.data.USR_UID != "") - { - Ext.Ajax.request({ - url : 'bpmn/processes_Ajax.php' +urlparams , - /*method: 'POST', - params: { - functions : 'ofToAssign', - TAS_UID : taskId, - TU_RELATION : user_TURel, - USR_UID : userUID, - TU_TYPE : user_TUtype - - },*/ - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_USERS_REMOVED') ); - //Secondly deleting from Grid - taskUsers.remove(r); - //Reloading available user store - taskUsers.reload(); - } - }); - } - else - taskUsers.remove(r); - } - } - }); - - var tb = new Ext.Toolbar({ - items: [btnAdd, btnRemove] - }); - - // create the Data Store of users that are already assigned to a task - var grid = new Ext.grid.GridPanel({ - store: taskUsers, - id : 'mygrid', - //cm: cm, - loadMask: true, - loadingText: 'Loading...', - //renderTo: 'cases-grid', - frame: false, - autoHeight:false, - clicksToEdit: 1, - minHeight:400, - height :330, - layout: 'fit', - plugins: [editor], - columns: [ - new Ext.grid.RowNumberer(), - { - id: 'LABEL', - header: _('ID_GROUP_USER'), - dataIndex: 'LABEL', - width: 100, - sortable: true, - editor: new Ext.form.ComboBox({ - xtype: 'combo', - fieldLabel: 'Users_groups', - hiddenName: 'number', - store : storeUsers, - displayField : 'LABEL', - valueField : 'LABEL', - name : 'LABEL', - triggerAction: 'all', - emptyText: 'Select User or Group', - allowBlank: false, - onSelect: function(record, index){ - var User = grid.getStore(); - - if(typeof workflow.currentrowIndex == 'undefined') - var selectedrowIndex = '0'; - else - selectedrowIndex = workflow.currentrowIndex; //getting Index of the row that has been edited - - //User.data.items[0].data.LABEL= record.data.LABEL; - User.data.items[selectedrowIndex].data.TAS_UID = record.data.TAS_UID; - User.data.items[selectedrowIndex].data.TU_TYPE = record.data.TU_TYPE; - User.data.items[selectedrowIndex].data.USR_UID = record.data.USR_UID; - User.data.items[selectedrowIndex].data.TU_RELATION = record.data.TU_RELATION; - - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - }) - } - ], - sm: new Ext.grid.RowSelectionModel({ - singleSelect: true, - listeners: { - rowselect: function(smObj, rowIndex, record) { - workflow.currentrowIndex = rowIndex; - } - } - }), - stripeRows: true, - viewConfig: {forceFit: true}, - bbar: new Ext.PagingToolbar({ - pageSize: 10, - store: taskUsers, - displayInfo: true, - displayMsg: 'Displaying Users {0} - {1} of {2}', - emptyMsg: "No Users to display", - items:[] - }), - tbar: tb - }); - - storeUsers.load(); - - editor.on({ - scope: this, - afteredit: function(roweditor, changes, record, rowIndex) { - - var taskId = record.data.TAS_UID; - var userId = record.data.USR_UID; - var tu_Type = record.data.TU_TYPE; - var tu_Relation = record.data.TU_RELATION; - ///var urlparams = '?action=assign&data={"TAS_UID":"'+taskId+'","USR_UID":"'+userId+'","TU_TYPE":"'+tu_Type+'","TU_RELATION":"'+tu_Relation+'"}'; - - Ext.Ajax.request({ - url: '../users/users_Ajax.php', - METHOD:'post', - success: function (response) { // When saving data success - PMExt.notify( _('ID_STATUS') , _('ID_USER_ASSIGNED') ); - }, - params:{ - functions : 'assign', - TAS_UID : taskId, - USR_UID : userId, - TU_TYPE : tu_Type, - TU_RELATION:tu_Relation - - }, - failure: function () { // when saving data failed - PMExt.notify( _('ID_STATUS') , _('ID_USER_SAVE_FAIL') ); - } - }); - - //Updating the user incase if already assigned user has been replaced by other user - if(changes != '' && typeof record.json != 'undefined') - { - var user_TURel = record.json.TU_RELATION; - var userUID = record.json.USR_UID; - var user_TUtype = record.json.TU_TYPE; - //urlparams = '?action=ofToAssign&data={"TAS_UID":"'+taskId+'","TU_RELATION":"'+user_TURel+'","USR_UID":"'+userUID+'","TU_TYPE":"'+user_TUtype+'"}'; - Ext.Ajax.request({ - url : '../users/users_Ajax.php', - method: 'POST', - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_USER_ASSIGNED') ); - //Ext.MessageBox.alert ('Status','User has been updated successfully.'); - }, - params:{ - functions : 'ofToAssign', - TAS_UID : taskId, - USR_UID : userId, - TU_TYPE : tu_Type, - TU_RELATION:tu_Relation - - } - }); - } - //storeUsers.reload(); - } - }); - - var panel = new Ext.Panel({ - id: 'panel', - //renderTo: Ext.getBody(), - items: [grid] - }); - - var window = new Ext.Window({ - title: _('ID_USER_GROUPS_ADHOC'), - collapsible: false, - maximizable: false, - width: 400, - height: 360, - minWidth: 200, - minHeight: 150, - layout: 'fit', - plain: true, - buttonAlign: 'center', - items: panel - }); - window.show(); -} - -/** - * ExtJs Form of SubProcess Properties - * @Param Shape Object - * @Author Safan Maredia - */ -TaskContext.prototype.editSubProcessProperties= function(_3525) -{ - var taskId = workflow.currentSelection.id; - //Variables Out Grid - var subProcessFields = Ext.data.Record.create([ - {name: 'SP_UID',type: 'string'}, - {name: 'TAS_UID',type: 'string'}, - {name: 'PRO_PARENT',type: 'string'}, - {name: 'PRO_UID',type: 'string'}, - {name: 'PRO_TITLE',type: 'string'}, - {name: 'TAS_PARENT',type: 'string'}, - {name: 'SP_SYNCHRONOUS',type: 'string'}, - {name: 'SPROCESS_NAME',type: 'string'}, - {name: 'TASKS',type: 'string'}, - {name: 'TAS_TITLE',type: 'string'}, - {name: 'CON_VALUE',type: 'string'}, - {name: 'VAR_OUT1',type: 'string'}, - {name: 'VAR_OUT2',type: 'string'}, - {name: 'VAR_IN1',type: 'string'}, - {name: 'VAR_IN2',type: 'string'} - ]); - - var editorOut = new Ext.ux.grid.RowEditor({ - saveText: _('ID_UPDATE') - }); - var editorIn = new Ext.ux.grid.RowEditor({ - saveText: _('ID_UPDATE') - }); - - //Variable out grid configuration starts here - var btnAddOut = new Ext.Button({ - id: 'btnAddOut', - text: _('ID_ASSIGN_VARIABLES_OUT'), - iconCls: 'button_menu_ext ss_sprite ss_add', - handler: function(){ - var storeData = variableOutGrid.getStore(); - //STEP_TITLE: storeData.data.items[0].data.STEP_TITLE, - var e = new subProcessFields({ - SP_UID : '', - PRO_PARENT : '', - SP_SYNCHRONOUS : '', - TAS_PARENT : '', - TASKS : '', - VAR_OUT1 : '', - VAR_OUT2 : '' - }); - - editorOut.stopEditing(); - variablesOutStore.insert(0, e); - variableOutGrid.getView().refresh(); - //grid.getSelectionModel().selectRow(0); - editorOut.startEditing(0, 0); - } - }); - - var btnRemoveOut = new Ext.Button({ - id: 'btnRemoveOut', - text: _('ID_REMOVE_VARIABLES_OUT'), - iconCls: 'button_menu_ext ss_sprite ss_delete', - handler: function (s) { - editorOut.stopEditing(); - var s = variableOutGrid.getSelectionModel().getSelections(); - for(var i = 0, r; r = s[i]; i++){ - variablesOutStore.remove(r); - } - } - }); - - var tbOut = new Ext.Toolbar({ - items: [btnAddOut, btnRemoveOut] - }); - - - //Variable out grid configuration starts here - var btnAddIn = new Ext.Button({ - id: 'btnAddIn', - text: 'ID_ASSIGN_VARIABLES_IN', - iconCls: 'button_menu_ext ss_sprite ss_add', - handler: function(){ - var e = new subProcessFields({ - SP_UID : '', - PRO_PARENT : '', - SP_SYNCHRONOUS : '', - TAS_PARENT : '', - VAR_IN1 : '', - VAR_IN2 : '' - }); - - editorIn.stopEditing(); - variablesInStore.insert(0, e); - variableInGrid.getView().refresh(); - editorIn.startEditing(0, 0); - } - }); - - var btnRemoveIn = new Ext.Button({ - id: 'btnRemoveIn', - text: 'ID_REMOVE_VARIABLES_IN', - iconCls: 'button_menu_ext ss_sprite ss_delete', - handler: function (s) { - editorIn.stopEditing(); - var s = variableInGrid.getSelectionModel().getSelections(); - for(var i = 0, r; r = s[i]; i++){ - - - //Secondly deleting from Grid - variablesInStore.remove(r); - } - } - }); - - var tbIn = new Ext.Toolbar({ - items: [btnAddIn, btnRemoveIn] - }); - - // create the Data Store of all Variables Out - var variablesOutStore = new Ext.data.JsonStore({ - root : 'data', - totalProperty: 'totalCount', - idProperty : 'gridIndex', - remoteSort : true, - fields : subProcessFields, - proxy : new Ext.data.HttpProxy({ - url : 'bpmn/proxyExtjs?pid='+pro_uid+'&action=getSubProcessProperties&tid='+taskId+'&type=0' //type=0 specifies Variables Out (Asynchronous) - }) - }); - variablesOutStore.load(); - - // create the Data Store of all Variables In - var variablesInStore = new Ext.data.JsonStore({ - root : 'data', - totalProperty: 'totalCount', - idProperty : 'gridIndex', - remoteSort : true, - fields : subProcessFields, - proxy : new Ext.data.HttpProxy({ - url : 'bpmn/proxyExtjs?pid='+pro_uid+'&action=getSubProcessProperties&tid='+taskId+'&type=1' //type=1 specifies Variables In (Synchronous) - }) - }); - //taskUsers.setDefaultSort('LABEL', 'asc'); - variablesInStore.load(); - - var processListStore = new Ext.data.JsonStore({ - root : 'data', - totalProperty: 'totalCount', - idProperty : 'gridIndex', - remoteSort : true, - fields : subProcessFields, - proxy : new Ext.data.HttpProxy({ - url : '../processes/processesList' - }) - }); - processListStore.load(); - - var variableOutGrid = new Ext.grid.GridPanel({ - store : variablesOutStore, - id : 'mygrid', - loadMask : true, - loadingText : 'Loading...', - //renderTo : 'cases-grid', - frame : false, - autoHeight : true, - autoScroll : true, - clicksToEdit: 1, - layout : 'form', - plugins : [editorOut], - columns : [{ - id : 'VAR_OUT1', - name : 'VAR_OUT1', - header : _('ID_ORIGIN'), - dataIndex: 'VAR_OUT1', - width : 200, - sortable : true, - editor : new Ext.form.TextField({ - allowBlank: true - }) - }, - { - sortable: false, - renderer: function() - { - return ''; - } - }, - { - id : 'VAR_OUT2', - name : 'VAR_OUT2', - header : _('ID_TARGET'), - dataIndex : 'VAR_OUT2', - width : 200, - sortable : true, - editor : new Ext.form.TextField({ - allowBlank: true - }) - }, - { - sortable: false, - renderer: function() - { - return ''; - } - } - ], - viewConfig: {forceFit: true}, - stripeRows: true, - tbar: tbOut - }); - - var variableInGrid = new Ext.grid.GridPanel({ - store : variablesInStore, - id : 'mygrid1', - loadMask : true, - loadingText : 'Loading...', - //renderTo : 'cases-grid', - frame : false, - autoHeight : true, - autoScroll : true, - clicksToEdit: 1, - layout : 'form', - plugins : [editorIn], - columns : [{ - id : 'VAR_IN1', - name : 'VAR_IN1', - header : _('ID_ORIGIN'), - dataIndex: 'VAR_IN1', - width : 200, - sortable : true, - editor : new Ext.form.TextField({ - allowBlank: true - }) - }, - { - sortable: false, - renderer: function() - { - return ''; - } - }, - { - id : 'VAR_IN2', - name : 'VAR_IN2', - header : _('ID_TARGET'), - dataIndex : 'VAR_IN2', - width : 200, - sortable : true, - editor : new Ext.form.TextField({ - allowBlank: true - }) - }, - { - sortable: false, - renderer: function() - { - return ''; - } - } - ], - viewConfig: {forceFit: true}, - stripeRows: true, - tbar: tbIn - }); - - var subProcessProperties = new Ext.FormPanel({ - labelWidth : 110, // label settings here cascade unless overridden - //frame:true, - width: 500, - bodyStyle: 'padding:5px 0 0 5px;', - autoScroll: true, - items: [ - { - xtype:'fieldset', - title: _('ID_SUBPROCESS'), - collapsible: false, - autoHeight:true, - //width: 600, - defaultType: 'textfield', - items:[ - { - id: 'subProcessName', - xtype: 'textfield', - width: 350, - fieldLabel: _('ID_SUBPROCESS_NAME'), - name : 'SPROCESS_NAME', - allowBlank: false - }, - { - width: 300, - xtype: 'combo', - mode: 'local', - triggerAction: 'all', - forceSelection: true, - editable: false, - fieldLabel: _('ID_PROCESS'), - name: 'PRO_TITLE', - emptyText : 'Select Process', - displayField: 'PRO_TITLE', - valueField: 'PRO_TITLE', - store: processListStore, - onSelect: function(record, index){ - //processListStore.data.items[0].data.PRO_UID = record.data.PRO_UID; - Ext.getCmp("SEL_PROCESS").setValue(record.data.PRO_UID); - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - },{ - xtype :'hidden', - name :'SEL_PROCESS', - id :'SEL_PROCESS' - }, - { - width: 150, - id : 'spType', - xtype: 'combo', - mode: 'local', - triggerAction: 'all', - forceSelection: true, - editable: false, - fieldLabel: _('ID_TYPE'), - name: 'SP_SYNCHRONOUS', - hiddenName: 'SP_SYNCHRONOUS', - displayField: 'name', - valueField: 'value', - emptyText : 'Select Type', - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name : 'Asynchronous', value: '0'}, - {name : 'Synchronous', value: '1'}, - ] - }), - onSelect: function(record, index){ - if(record.data.name == 'Synchronous') - Ext.getCmp("variablein").show(); - else - Ext.getCmp("variablein").hide(); - - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - }] - }, - { - id :'variableout', - name :'VAR_OUT1', - xtype:'fieldset', - title: _('ID_VARIABLES_OUT'), - collapsible: false, - labelAlign: 'top', - items:[variableOutGrid] - }, - { - id :'variablein', - name :'VAR_IN1', - xtype:'fieldset', - title: _('ID_VARIABLES_IN'), - //hidden: true, - collapsible: false, - labelAlign: 'top', - items:[variableInGrid] - }] - }); - - //Loading Task Details into the form - subProcessProperties.form.load({ - url:'bpmn/proxyExtjs?pid='+pro_uid+'&action=getSubProcessProperties&tid='+taskId+'&type=2', - method:'GET', - waitMsg:'Loading....', - success:function(form, action) { - var response = action.response.responseText; - var aData = Ext.util.JSON.decode(response); - spUID = aData.data[0].SP_UID; - proUID = aData.data[0].PRO_UID; - proParent = aData.data[0].PRO_PARENT; - spSync = aData.data[0].SP_SYNCHRONOUS; - tasParent = aData.data[0].TAS_PARENT; - tasks = aData.data[0].TASKS; - var processName = aData.data[0].SPROCESS_NAME; - if(action.result.data[0].SP_SYNCHRONOUS == 0) - { - Ext.getCmp("variablein").hide(); - form.findField('SP_SYNCHRONOUS').setValue('Asynchronous'); - } - else - { - Ext.getCmp("variablein").show(); - form.findField('SP_SYNCHRONOUS').setValue('Synchronous'); - } - form.findField('PRO_TITLE').setValue(action.result.data[0].PRO_TITLE); - form.findField('SPROCESS_NAME').setValue(processName); - }, - failure:function(form, action) { - PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED') ); - } - }); - - //subProcessProperties.render(document.body); - - var window = new Ext.Window({ - title: _('ID_PROPERTIES'), - collapsible: false, - maximizable: false, - width: 800, - height: 400, - layout: 'fit', - plain: true, - buttonAlign: 'center', - items: subProcessProperties, - buttons: [{ - text: _('ID_SAVE'), - handler: function(){ - var getForm = subProcessProperties.getForm().getValues(); - - //Getting data from Grid (Variables In and Out) - var storeOutData = variableOutGrid.getStore(); - var storeInData = variableInGrid.getStore(); - var storeOutLength = storeOutData.data.items.length; - var storeInLength = storeInData.data.items.length; - var varOut1 = new Array(); - var varOut2 = new Array(); - for(var i=0;i 200 || this.getHeight() > 100) && this.limitFlag == false) { - this.originalWidth = 200; - this.originalHeight = 100; - this.width = 200; - this.height = 100; - } - if ((this.getWidth() < 165 || this.getHeight() < 40) && this.limitFlag == false) { - this.originalWidth = 165; - this.originalHeight = 40; - this.width = 165; - this.height = 40; - } - } - else { - this.width = this.originalWidth * workflow.zoomfactor; - this.height = this.originalHeight * workflow.zoomfactor; - } - //For Zooming - - //Set the Task Limitation - /*if ((this.getWidth() >= 200 || this.getHeight() >= 100 ) && this.limitFlag != true) { - this.originalWidth = 200; - this.originalHeight = 100; - } - else if ((this.getWidth() <= 165 || this.getHeight() <= 40) && this.limitFlag != true) { - this.originalWidth = 165; - this.originalHeight = 40; - }*/ - - - - var x = new Array(6, this.getWidth() - 3, this.getWidth(), this.getWidth(), this.getWidth() - 3, 6, 3, 3, 6); - var y = new Array(3, 3, 6, this.getHeight() - 3, this.getHeight(), this.getHeight(), this.getHeight() - 3, 6, 3); - this.stroke = 2; - this.graphics.setStroke(this.stroke); - this.graphics.setColor("#c0c0c0"); - this.graphics.fillPolygon(x, y); - for (var i = 0; i < x.length; i++) { - x[i] = x[i] - 3; - y[i] = y[i] - 3; - } - this.graphics.setColor("#DBDFF6"); - this.graphics.fillPolygon(x, y); - - this.graphics.setColor("#5164b5"); //Blue Color - this.graphics.drawPolygon(x, y); - this.graphics.paint(); - this.x_text = this.workflow.getAbsoluteX(); //Get x co-ordinate from figure - this.y_text = this.workflow.getAbsoluteY(); //Get x co-ordinate from figure - - /* Created New Object of jsGraphics to draw String. - * New object is created to implement changing of Text functionality - */ - this.bpmnText = new jsGraphics(this.id); - //erik: overridden the drawStringRect method - this.bpmnText.drawStringRect = function(txt, x, y, width, height, halign, cls) - { - var classBk = typeof(cls) != 'undefined' ? 'class="'+cls+'" ' : ''; - this.htm += '
'+ - '' +txt + '<\/span>'+ - '<\/div>'; - }; - - var zoomRate = workflow.zoomfactor; - var len = this.getWidth() / 18; - if (len >= 6) { - this.padleft = 0.05 * this.getWidth(); - this.padtop = 0.13 * this.getHeight() -1; - this.rectWidth = this.getWidth() - 2 * this.padleft; - } - else { - this.padleft = 2; //0.06 * this.getWidth(); - this.padtop = 2; //0.09 * this.getHeight() -3; - this.rectWidth = this.getWidth() - 2 * this.padleft; - } - - this.rectheight = this.getHeight() - this.padtop -3; - if ( this.rectheight < 7 ) this.rectheight = 7; - - - if(typeof this.taskName == 'undefined') - this.taskName = ''; - - //if (typeof this.fontSize == 'undefined' || this.fontSize == '') - this.fontSize = 11; - var fontSize = zoomRate * this.fontSize; - - this.graphics.setFont('verdana', + fontSize+'px', Font.PLAIN); - - this.graphics.drawStringRect(this.taskName, this.padleft, this.padtop, this.rectWidth, this.rectheight, 'center', 'x-task'); - this.graphics.paint(); - //***** Drawing Timer Boundary event starts here - this.boundaryTimer = new jsGraphics(this.id); - - var x_cir1=5; - var y_cir1=45; - this.x3 = x[3]; - this.y4 = y[4]; - this.y5 = y[5]; - - var xbt = 13*zoomRate; //x-base boundaryTimer - var ybt = this.y4 - 13*zoomRate; //y-base boundaryTimer - var dbt = 30*zoomRate; //diameter boundaryTimer - var ycbt = ybt + 11*zoomRate; //y-center boundaryTimer - this.graphics.setColor("#c0c0c0"); - this.graphics.fillEllipse(xbt+2, ybt+2, dbt, dbt); - this.graphics.setStroke(this.stroke-1); - this.graphics.setColor( "#f9faf2" ); - this.graphics.fillEllipse(xbt, ybt, dbt, dbt); - this.graphics.setColor("#adae5e"); - this.graphics.drawEllipse(xbt,ybt, dbt, dbt); - - var x_cir2=8; - var y_cir2=48; - //this.boundaryTimer.setColor( "#f9faf2" ); - //this.boundaryTimer.fillEllipse(xbt, ybt-9*zoomRate,(30-6)*zoomRate,(30-6)*zoomRate); - this.graphics.setColor("#adae5e"); - this.graphics.drawEllipse(xbt+(3*zoomRate), ybt+3*zoomRate,(24.4)*zoomRate,(24.4)*zoomRate); - - this.graphics.setColor("#adae5e"); - this.graphics.drawLine(dbt*0.45 +xbt, dbt*0.45+this.y5-10*zoomRate, dbt/1.6+xbt, dbt/2 +this.y5-10*zoomRate); //horizontal line - this.graphics.drawLine(dbt*0.45 +xbt, dbt*0.45+this.y5-10*zoomRate, dbt/2.2+xbt, dbt/3.7+this.y5-10*zoomRate); //vertical line - - this.graphics.setStroke(this.stroke-1); - this.graphics.drawLine(xbt +24*zoomRate,ycbt -3*zoomRate, xbt+20*zoomRate, ycbt ); //10th min line - this.graphics.drawLine(xbt +21*zoomRate,ycbt +4*zoomRate, xbt+25*zoomRate, ycbt +4*zoomRate); //15th min line - this.graphics.drawLine(xbt +24*zoomRate,ycbt +11*zoomRate, xbt+19*zoomRate, ycbt +9*zoomRate); //25th min line - this.graphics.drawLine(xbt +15*zoomRate,ycbt +11*zoomRate, xbt+15*zoomRate, ycbt+14*zoomRate); //30th min line - this.graphics.drawLine(xbt +8 *zoomRate,ycbt +11*zoomRate, xbt+12*zoomRate, ycbt +8*zoomRate); //40th min line - this.graphics.drawLine(xbt +5 *zoomRate,ycbt +4*zoomRate, xbt+8 *zoomRate, ycbt +4*zoomRate); //45th min line - this.graphics.drawLine(xbt +8 *zoomRate,ycbt -4*zoomRate, xbt+11*zoomRate, ycbt -1*zoomRate); //50th min line - this.graphics.drawLine(xbt+15 *zoomRate,ycbt -7*zoomRate, xbt+15*zoomRate, ycbt -4*zoomRate); //60th min line - - if(this.boundaryEvent == true) { - this.graphics.paint(); - } - //****************Drawing Timer Boundary event ends here **************** - - //this.bpmnText.paint(); - - //Code Added to Dynamically shift Ports on resizing of shapes - if (this.input1 != null) { - this.input1.setPosition(0, this.height / 2 -1); - } - if (this.output1 != null) { - this.output1.setPosition(this.width / 2, this.height -3); - } - if (this.input2 != null) { - this.input2.setPosition(this.width / 2, 0); - } - if (this.output2 != null) { - this.output2.setPosition(this.width-3, this.height / 2-1); - } - -}; - - -Figure.prototype.onDragend=function() { - if(typeof workflow.currentSelection != 'undefined' && workflow.currentSelection != null){ - var currObj = workflow.currentSelection; - currObj.orgXPos = eval(currObj.getX()/workflow.zoomfactor); - currObj.orgYPos = eval(currObj.getY()/workflow.zoomfactor); - //setPosition(); - if(typeof currObj.id != 'undefined' && currObj.id.length == 32){ - switch (currObj.type) { - case 'bpmnTask': - case 'bpmnSubProcess': - currObj.actiontype = 'saveTaskPosition'; - currObj.workflow.savePosition(currObj); - break; - case 'bpmnAnnotation': - currObj.actiontype = 'saveTextPosition'; - currObj.workflow.savePosition(currObj); - break; - default: - if(currObj.type.match(/Gateway/)){ - currObj.actiontype = 'saveGatewayPosition'; - currObj.workflow.savePosition(currObj); - } - else if(currObj.type.match(/Event/)) { - currObj.actiontype = 'saveEventPosition'; - currObj.workflow.savePosition(currObj); - } - } - } - workflow.setBoundary(currObj); - } - - if(this.getWorkflow().getEnableSmoothFigureHandling()==true) { - var _3dfe=this; - var _3dff=function(){ - if(_3dfe.alpha<1){ - _3dfe.setAlpha(Math.min(1,_3dfe.alpha+0.05)); - } - else { - window.clearInterval(_3dfe.timer); - _3dfe.timer=-1; - } - }; - if(_3dfe.timer>0){ - window.clearInterval(_3dfe.timer); - } - _3dfe.timer=window.setInterval(_3dff,20); - } - else{ - this.setAlpha(1); - } - this.command.setPosition(this.x,this.y); - this.workflow.commandStack.execute(this.command); - this.command=null; - this.isMoving=false; - this.workflow.hideSnapToHelperLines(); - this.fireMoveEvent(); - }; - - Figure.prototype.onKeyDown=function(_3e0e,ctrl){ - if(_3e0e==46&&this.isDeleteable()==true){ - workflow.getDeleteCriteria(); - //this.workflow.commandStack.execute(new CommandDelete(this)); - } - if(ctrl){ - this.workflow.onKeyDown(_3e0e,ctrl); - } -}; - -bpmnTask.prototype.setWorkflow = function (_40c5) { - VectorFigure.prototype.setWorkflow.call(this, _40c5); - if (_40c5 != null) { - /*Adding Port to the Task After dragging Task on the Canvas - *Ports will be invisibe After Drag and Drop, But It will be created - */ - var TaskPortName = ['output1', 'output2', 'input1', 'input2']; - var TaskPortType = ['OutputPort', 'OutputPort', 'InputPort', 'InputPort']; - var TaskPositionX = [this.width / 2, this.width, 0, this.width / 2]; - var TaskPositionY = [this.height-1, this.height / 2, this.height / 2, 0+1]; - - for (var i = 0; i < TaskPortName.length; i++) { - eval('this.' + TaskPortName[i] + ' = new ' + TaskPortType[i] + '()'); //Create New Port - eval('this.' + TaskPortName[i] + '.setWorkflow(_40c5)'); //Add port to the workflow - eval('this.' + TaskPortName[i] + '.setName("' + TaskPortName[i] + '")'); //Set PortName - eval('this.' + TaskPortName[i] + '.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('this.' + TaskPortName[i] + '.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('this.' + TaskPortName[i] + '.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - var oPort = eval('this.addPort(this.' + TaskPortName[i] + ',' + TaskPositionX[i] + ', ' + TaskPositionY[i] + ')'); //Setting Position of the port - var test = oPort; - } - } -}; - -InputPort.prototype.onDrop = function (port) { - if (port.getMaxFanOut && port.getMaxFanOut() <= port.getFanOut()) { - return; - } - if (this.parentNode.id == port.parentNode.id) { - } - else { - var _4070 = new CommandConnect(this.parentNode.workflow, port, this); - if (_4070.source.type == _4070.target.type) { - return; - } - - if(this.workflow.currentSelection.type.match(/Annotation/)) //Setting connection to Dotted for Annotation - _4070.setConnection(new DottedConnection()); - else - _4070.setConnection(new DecoratedConnection()); - - this.parentNode.workflow.getCommandStack().execute(_4070); - - //Saving Start Event - var preObj = new Array(); - var bpmnType = this.workflow.currentSelection.type; - - //Routing from end event to task - if(bpmnType.match(/End/) && bpmnType.match(/Event/) && port.parentNode.type.match(/Task/)) { - preObj = this.workflow.currentSelection; //end event - var newObj = port.parentNode; //task - newObj.conn = _4070.connection; - newObj.reverse = 1; //setting reverse parameter if user is routing from down to up - this.workflow.saveRoute(preObj,newObj); - } - //Routing from task to start event - else if(bpmnType.match(/Task/) && port.parentNode.type.match(/Event/)) { - preObj = this.workflow.currentSelection; //task - newObj = port.parentNode; //start event - var tas_uid = preObj.id; - this.workflow.saveEvents(newObj,tas_uid); - } - //Routing from task to task - else if(bpmnType.match(/Task/) && port.parentNode.type.match(/Task/)){ - preObj = workflow.currentSelection; - newObj = port.parentNode; - newObj.conn = _4070.connection; - newObj.sPortType =port.properties.name; - preObj.sPortType =this.properties.name; - workflow.saveRoute(newObj,preObj); - } - //Routing from task to gateway - else if(bpmnType.match(/Task/) && port.parentNode.type.match(/Gateway/)){ - var shape = new Array(); - shape.type = ''; - preObj = workflow.currentSelection; - newObj = port.parentNode; - workflow.saveRoute(newObj,shape); - } - //Routing from gateway to task - else if(bpmnType.match(/Gateway/) && (port.parentNode.type.match(/Gateway/) || port.parentNode.type.match(/Task/))){ - preObj = this.workflow.currentSelection; - newObj = port.parentNode; - this.workflow.saveRoute(preObj,newObj); - } - //Routing from task to Intermediate event - else if(port.parentNode.type.match(/Inter/) && port.parentNode.type.match(/Event/) && bpmnType.match(/Task/)){ - workflow.saveEvents(port.parentNode); - } - else if(port.parentNode.type.match(/Task/) && bpmnType.match(/Inter/) && bpmnType.match(/Event/)){ - workflow.saveEvents(workflow.currentSelection); - } - else if(bpmnType.match(/Annotation/)) { //Routing from task to Annotation - newObj = port.parentNode; - preObj = this.workflow.currentSelection; - newObj.actiontype = 'updateText'; - preObj.actiontype = 'updateText'; - this.workflow.saveShape(preObj); - } - } -}; - -OutputPort.prototype.onDrop = function (port) { - if (this.getMaxFanOut() <= this.getFanOut()) { - return; - } - - var connect = true; - var conn = port.workflow.checkConnectionsExist(port, 'targetPort', 'OutputPort'); - if (conn == 0) //If no connection Exist then Allow connect - connect = true; - else - if (conn < 2) //If One connection exist then Do not Allow to connect - connect = false; - - if (this.parentNode.id == port.parentNode.id || connect == false) { - } - else { - var _4070 = new CommandConnect(this.parentNode.workflow, this, port); - if (_4070.source.type == _4070.target.type) { - return; - } - - if(port.parentNode.type.match(/Annotation/)) //Setting connection to Dotted for Annotation - _4070.setConnection(new DottedConnection()); - else - _4070.setConnection(new DecoratedConnection()); - - this.parentNode.workflow.getCommandStack().execute(_4070); - - //Saving Start Event - var preObj = new Array(); - var bpmnType = this.workflow.currentSelection.type; - if(bpmnType.match(/Event/) && port.parentNode.type.match(/Task/)){ - var tas_uid = port.parentNode.id; - this.workflow.saveEvents(this.workflow.currentSelection,tas_uid); - } - else if(bpmnType.match(/Task/) && port.parentNode.type.match(/End/) && port.parentNode.type.match(/Event/)){ - preObj = this.workflow.currentSelection; - var newObj = port.parentNode; - newObj.conn = _4070.connection; - this.workflow.saveRoute(preObj,newObj); - } - else if(port.parentNode.type.match(/Task/) && bpmnType.match(/Inter/) && bpmnType.match(/Event/)){ - this.workflow.saveEvents(workflow.currentSelection); - } - else if(port.parentNode.type.match(/Event/) && port.parentNode.type.match(/Inter/) && bpmnType.match(/Task/)){ - this.workflow.saveEvents(port.parentNode); - } - else if(bpmnType.match(/Task/) && port.parentNode.type.match(/Task/)){ - preObj = this.workflow.currentSelection; - newObj = port.parentNode; - newObj.conn = _4070.connection; - newObj.sPortType =port.properties.name; - preObj.sPortType =this.properties.name; - this.workflow.saveRoute(preObj,newObj); - } - else if(bpmnType.match(/Gateway/) && (port.parentNode.type.match(/Task/) || port.parentNode.type.match(/Gateway/))){ //Routing from gateway to task - var shape = new Array(); - shape.type = ''; - preObj = this.workflow.currentSelection; - this.workflow.saveRoute(preObj,shape); - } - else if(bpmnType.match(/Task/) && port.parentNode.type.match(/Gateway/)){ //Routing from task to gateway - newObj = port.parentNode; - preObj = this.workflow.currentSelection; - this.workflow.saveRoute(newObj,preObj); - } - else if(port.parentNode.type.match(/Annotation/)){ //Routing from task to Annotation - newObj = port.parentNode; - preObj = this.workflow.currentSelection; - newObj.actiontype = 'updateText'; - this.workflow.saveShape(newObj); - } - } -}; - -LineEndResizeHandle.prototype.onDrop=function(_3f3e){ - var line=this.workflow.currentSelection; - line.isMoving=false; - if(line instanceof Connection){ - this.command.setNewPorts(line.getSource(),_3f3e); - - //If Input Port /Output Port is connected to respective ports, then should not connected - if(this.command.newSourcePort.type == this.command.newTargetPort.type) - return; - else { - this.command.newTargetPort.parentNode.conn = this.command.con; - this.command.newTargetPort.parentNode.sPortType = this.command.newTargetPort.properties.name; - this.command.newSourcePort.parentNode.sPortType = this.command.newSourcePort.properties.name; - this.workflow.saveRoute(this.command.newSourcePort.parentNode,this.command.newTargetPort.parentNode); - this.getWorkflow().getCommandStack().execute(this.command); - } - } - this.command=null; -}; - -LineStartResizeHandle.prototype.onDrop=function(_410d){ - var line=this.workflow.currentSelection; - line.isMoving=false; - if(line instanceof Connection){ - this.command.setNewPorts(_410d,line.getTarget()); - - //If Input Port /Output Port is connected to respective ports, then should not connected - if(this.command.newSourcePort.type == this.command.newTargetPort.type) - return; - else{ - this.command.newTargetPort.parentNode.conn = this.command.con; - this.command.newTargetPort.parentNode.sPortType = this.command.newTargetPort.properties.name; - this.command.newSourcePort.parentNode.sPortType = this.command.newSourcePort.properties.name; - this.command.newTargetPort.parentNode.conn = this.command.con; - this.workflow.saveRoute(this.command.newSourcePort.parentNode,this.command.newTargetPort.parentNode); - this.getWorkflow().getCommandStack().execute(this.command); - } - } - this.command=null; -}; - -ResizeHandle.prototype.onDragend=function(){ - if(this.commandMove==null){ - return; - } - var currentSelection = workflow.currentSelection; - if(typeof currentSelection.id != 'undefined' && currentSelection.id.length == 32){ - if(currentSelection.type.match(/Task/)) { - currentSelection.actiontype = 'saveTaskCordinates'; - workflow.savePosition(currentSelection); - } - else if(currentSelection.type.match(/Annotation/)){ - currentSelection.actiontype = 'saveAnnotationCordinates'; - workflow.savePosition(currentSelection); - } - } -} - -VectorFigure.prototype.addChild=function(_4078){ - _4078.setParent(this); - //_4078.setZOrder(this.getZOrder()+1); - //_4078.setParent(this); - //_4078.parent.addChild(_4078); - //this.children[_4078.id]=_4078; - //this.scrollarea.appendChild(_4078.getHTMLElement()); -}; - -////// Decorators to add an arrow to the flow line. To show the direction of flow ////////////// -DecoratedConnection = function () { - Connection.call(this); - this.setTargetDecorator(new ArrowConnectionDecorator()); - this.setRouter(new ManhattanConnectionRouter()); -}; -DecoratedConnection.prototype = new Connection(); -DecoratedConnection.prototype.type = "DecoratedConnection"; -DecoratedConnection.prototype.getContextMenu = function () { - if (this.id != null) { - this.workflow.contextClicked = true; - this.workflow.connectionContextMenu(this); - } -}; - - -//dotted connection and its router -DottedConnectionRouter=function(_354a){ -if(!_354a){ -this.cheapRouter=new ManhattanConnectionRouter(); -}else{ -this.cheapRouter=null; -} -this.iteration=4; -}; -DottedConnectionRouter.prototype=new ConnectionRouter; -DottedConnectionRouter.prototype.type="DottedConnectionRouter"; -DottedConnectionRouter.prototype.drawBezier=function(_354b,_354c,t,iter){ - var n=_354b.length-1; - var q=new Array(); - var _3551=n+1; - for(var i=0;i<_3551;i++){ - q[i]=new Array(); - q[i][0]=_354b[i]; - } - for(var j=1;j<=n;j++){ - for(var i=0;i<=(n-j);i++){ - q[i][j]=new Point((1-t)*q[i][j-1].x+t*q[i+1][j-1].x,(1-t)*q[i][j-1].y+t*q[i+1][j-1].y); - } - } - var c1=new Array(); - var c2=new Array(); - for(var i=0;i=0){ - this.drawBezier(c1,_354c,t,--iter); - this.drawBezier(c2,_354c,t,--iter); - } - else{ - for(var i=0;i0)&&((yDiff*yDiff)0)&&(toDir==DOWN))||((yDiff<0)&&(toDir==UP))){ - point=new Point(toPt.x,_355e.y); - }else{ - if(_355f==toDir){ - var pos=Math.min(_355e.x,toPt.x)-_3564; - point=new Point(pos,_355e.y); - }else{ - point=new Point(_355e.x-(xDiff/2),_355e.y); - } - } - } - if(yDiff>0){ - dir=UP; - }else{ - dir=DOWN; - } - } - } - else{ - if(_355f==RIGHT){ - if((xDiff<0)&&((yDiff*yDiff)0){ - point=new Point(_355e.x+_3564,_355e.y); - }else{ - if(((yDiff>0)&&(toDir==DOWN))||((yDiff<0)&&(toDir==UP))){ - point=new Point(toPt.x,_355e.y); - }else{ - if(_355f==toDir){ - var pos=Math.max(_355e.x,toPt.x)+_3564; - point=new Point(pos,_355e.y); - }else{ - point=new Point(_355e.x-(xDiff/2),_355e.y); - } - } - } - if(yDiff>0){ - dir=UP; - }else{ - dir=DOWN; - } - } - }else{ - if(_355f==DOWN){ - if(((xDiff*xDiff)0){ - point=new Point(_355e.x,_355e.y+_3564); - } - else { - if(((xDiff>0)&&(toDir==RIGHT))||((xDiff<0)&&(toDir==LEFT))){ - point=new Point(_355e.x,toPt.y); - } - else{ - if(_355f==toDir){ - var pos=Math.max(_355e.y,toPt.y)+_3564; - point=new Point(_355e.x,pos); - } - else{ - point=new Point(_355e.x,_355e.y-(yDiff/2)); - } - } - } - if(xDiff>0){ - dir=LEFT; - } - else{ - dir=RIGHT; - } - } - } - else { - if(_355f==UP){ - if(((xDiff*xDiff)0)&&(toDir==DOWN)){ - point=toPt; - dir=toDir; - } - else{ - if(yDiff<0){ - point=new Point(_355e.x,_355e.y-_3564); - } - else{ - if(((xDiff>0)&&(toDir==RIGHT))||((xDiff<0)&&(toDir==LEFT))){ - point=new Point(_355e.x,toPt.y); - } - else{ - if(_355f==toDir){ - var pos=Math.min(_355e.y,toPt.y)-_3564; - point=new Point(_355e.x,pos); - } - else{ - point=new Point(_355e.x,_355e.y-(yDiff/2)); - } - } - } - if(xDiff>0){ - dir=LEFT; - } - else{ - dir=RIGHT; - } - } - } - } - } - } - this._route(_355c,conn,point,dir,toPt,toDir); - _355c.push(_355e); -}; - -DottedConnection = function () { - Connection.call(this); - this.setColor(new Color(0,0,80)); - this.setRouter(new DottedConnectionRouter()); - this.setRouter(new FanConnectionRouter()); -}; -DottedConnection.prototype = new Connection(); -DottedConnection.prototype.type = "DottedConnection"; -DottedConnection.prototype.addPoint=function(p){ - p=new Point(parseInt(p.x),parseInt(p.y)); - var bgColor = new Color(255,255,255); - var fgColor = new Color(0,0,128); - if(this.oldPoint!=null){ - //this.graphics.setColor(new Color(250,250,250)); - this.graphics.setColor(bgColor.getHTMLStyle()); - this.graphics.setStroke( 2); - this.graphics.drawLine(this.oldPoint.x,this.oldPoint.y,p.x,p.y); - this.graphics.setColor(fgColor.getHTMLStyle()); - this.graphics.setStroke( Stroke.DOTTED ); - this.graphics.drawLine(this.oldPoint.x,this.oldPoint.y,p.x,p.y); - //this.graphics.drawLine(p.x,p.y,p.x,p.y); - var line=new Object(); - line.start=this.oldPoint; - line.end=p; - this.lineSegments.add(line); - } - this.oldPoint=new Object(); - this.oldPoint.x=p.x; - this.oldPoint.y=p.y; -}; -DottedConnection.prototype.getContextMenu = function () { - if (this.id != null) { - this.workflow.contextClicked = true; - this.workflow.connectionContextMenu(this); - } -}; - -////////--------------------------------------------------------------------------------------------/////// -FlowMenu = function (_39f9) { - this.actionAdd = new ButtonAdd(this); - this.actionTask = new ButtonTask(this); - this.actionInterEvent = new ButtonInterEvent(this); - this.actionEndEvent = new ButtonEndEvent(this); - this.actionGateway = new ButtonGateway(this); - this.actionFront = new ButtonMoveFront(this); - this.actionBack = new ButtonMoveBack(this); - this.actionDelete = new ButtonDelete(this); - this.actionAnnotation = new ButtonAnnotation(this); - ToolPalette.call(this); - this.setDimension(20, 80); - this.setBackgroundColor(new Color(220, 255, 255)); - this.currentFigure = null; - this.myworkflow = _39f9; - this.added = false; - this.setDeleteable(false); - this.setCanDrag(false); - this.setResizeable(false); - this.setSelectable(false); - var zOrder = this.getZOrder(); - this.setZOrder(4000); - this.setBackgroundColor(null); - this.setColor(null); - this.scrollarea.style.borderBottom = "0px"; - this.actionAdd.setPosition(0, 0); - this.actionInterEvent.setPosition(20, 0); - this.actionGateway.setPosition(20, 20); - this.actionFront.setPosition(0, 18); - this.actionBack.setPosition(0, 36); - this.actionDelete.setPosition(0, 54); -}; - -ToolPalette.prototype.removechild = function (_4079) { - if (_4079 != null) { - var parentNode = this.html; - if (parentNode != null) { - if (typeof parentNode.children != 'undefined') { - var len = parentNode.children[0].children.length; - for (var i = 0; i < len; i++) { - var childNode = parentNode.children[0].children[i]; - if (childNode == _4079.html) { - parentNode.children[0].removeChild(childNode); - } - } - } - } - } -}; -FlowMenu.prototype = new ToolPalette; -FlowMenu.prototype.setAlpha = function (_39fa) { - Figure.prototype.setAlpha.call(this, _39fa); -}; -FlowMenu.prototype.hasTitleBar = function () { - return false; -}; -FlowMenu.prototype.setFigure = function (_3087) { -} - -FlowMenu.prototype.onSelectionChanged = function (_39fb) { - var newWorkflow = ''; - //If Right Clicked on the figure, Disabling Flow menu - if (_39fb != null) { - newWorkflow = _39fb.workflow; - } - else if (this.workflow != null) { - newWorkflow = this.workflow; - } - else { - newWorkflow = this.myworkflow; - } - var contextClicked = newWorkflow.contextClicked; - //Check wheather the figure selected is same as previous figure. - //If figure is different ,then remove the port from the previous selected figure. - if (newWorkflow.currentSelection != null && typeof newWorkflow.preSelectedFigure != 'undefined') { - if (newWorkflow.currentSelection.id != newWorkflow.preSelectedFigure.id) { - newWorkflow.disablePorts(newWorkflow.preSelectedFigure); - } - } - if (_39fb == this.currentFigure && contextClicked == true) { - return; - } - if (this.added == true) { - this.myworkflow.removeFigure(this); - this.added = false; - } - if (_39fb != null && this.added == false) { - if (this.myworkflow.getEnableSmoothFigureHandling() == true) { - this.setAlpha(0.01); - } - this.myworkflow.addFigure(this, 100, 100); - this.added = true; - } - if (this.currentFigure != null) { - this.currentFigure.detachMoveListener(this); - } - this.currentFigure = _39fb; - if (this.currentFigure != null) { - this.currentFigure.attachMoveListener(this); - this.onOtherFigureMoved(this.currentFigure); - } -}; - -FlowMenu.prototype.setWorkflow = function (_39fc) { - Figure.prototype.setWorkflow.call(this, _39fc); -}; - -FlowMenu.prototype.onOtherFigureMoved = function (_39fd) { - if (_39fd != null) { - //Get the workflow object of the selected Figure object, so that we can compare with the new selected figure to remove ports - _39fd.workflow.preSelectedFigure = _39fd.workflow.currentSelection; - var countConn = 0; - //workflow.setBoundary(workflow.currentSelection); - - //Preventing Task from drawing outside canvas Code Ends here - if (_39fd.type == 'DecoratedConnection' || _39fd.type == 'DottedConnection' || _39fd.workflow.contextClicked == true) { - this.removechild(this.actionAdd); - this.removechild(this.actionInterEvent); - this.removechild(this.actionGateway); - this.removechild(this.actionAnnotation); - this.removechild(this.actionTask); - this.removechild(this.actionEndEvent); - this.removechild(this.actionBack); - this.removechild(this.actionDelete); - this.removechild(this.actionFront); - _39fd.workflow.hideResizeHandles(); - } - else { - var pos = _39fd.getPosition(); - this.setPosition(pos.x + _39fd.getWidth() + 7, pos.y - 16); - if (_39fd.workflow != null) { - var bpmnShape = _39fd.workflow.currentSelection.type; - this.addChild(this.actionFront); - this.addChild(this.actionBack); - this.addChild(this.actionDelete); - var ports = ''; - //Disable Resize for All Events and Gateway - if (bpmnShape.match(/Event/) || bpmnShape.match(/Gateway/) || bpmnShape.match(/bpmnDataobject/) || bpmnShape.match(/bpmnSubProcess/)) { - _39fd.workflow.hideResizeHandles(); - } - if (bpmnShape.match(/Task/) || bpmnShape.match(/SubProcess/)) { - this.addChild(this.actionAdd); - this.addChild(this.actionInterEvent); - this.addChild(this.actionEndEvent); - this.addChild(this.actionGateway); - this.addChild(this.actionAnnotation); - this.actionAnnotation.setPosition(20, 60); - this.actionEndEvent.setPosition(20, 40) - this.removechild(this.actionTask); - ports = ['output1', 'input1', 'output2', 'input2']; - //ports = ['output1', 'output2']; - _39fd.workflow.enablePorts(_39fd, ports); - } - else if (bpmnShape.match(/Start/)) { - this.addChild(this.actionAdd); - this.addChild(this.actionAnnotation); - this.actionAnnotation.setPosition(20, 40); - this.addChild(this.actionInterEvent); - this.actionInterEvent.setPosition(20, 20) - this.addChild(this.actionGateway); - this.actionGateway.setPosition(20, 0) - this.removechild(this.actionEndEvent); - ports = ['output1', 'output2']; - _39fd.workflow.enablePorts(_39fd, ports); - } - else if (bpmnShape.match(/Inter/)) { - this.addChild(this.actionAdd); - this.addChild(this.actionAnnotation); - this.actionAnnotation.setPosition(20, 60); - this.addChild(this.actionInterEvent); - this.actionInterEvent.setPosition(20, 20) - this.addChild(this.actionGateway); - this.actionGateway.setPosition(20, 0); - this.addChild(this.actionEndEvent); - this.actionEndEvent.setPosition(20, 40); - ports = ['output1', 'input1', 'output2', 'input2']; - _39fd.workflow.enablePorts(_39fd, ports); - } - else if (bpmnShape.match(/End/)) { - this.removechild(this.actionInterEvent); - this.removechild(this.actionEndEvent); - this.removechild(this.actionAnnotation); - this.removechild(this.actionTask); - this.removechild(this.actionGateway); - this.removechild(this.actionAdd); - ports = ['input1', 'input2']; - _39fd.workflow.enablePorts(_39fd, ports); - } - else if (bpmnShape.match(/Gateway/)) { - this.addChild(this.actionAdd); - this.addChild(this.actionAnnotation); - this.actionAnnotation.setPosition(20, 60); - this.addChild(this.actionInterEvent); - this.actionInterEvent.setPosition(20, 20) - this.addChild(this.actionGateway); - this.actionGateway.setPosition(20, 0); - this.addChild(this.actionEndEvent); - this.actionEndEvent.setPosition(20, 40); - ports = ['output1', 'input1', 'output2', 'input2','output3']; - _39fd.workflow.enablePorts(_39fd, ports); - } - else if (bpmnShape.match(/Annotation/) || bpmnShape.match(/Dataobject/)) { - this.removechild(this.actionAdd); - this.removechild(this.actionAnnotation); - this.removechild(this.actionInterEvent); - this.removechild(this.actionGateway); - this.removechild(this.actionEndEvent); - this.removechild(this.actionAnnotation); - this.removechild(this.actionEndEvent); - if (bpmnShape.match(/Annotation/)) { - ports = ['input1']; - _39fd.workflow.enablePorts(_39fd, ports); - } - } - else if (bpmnShape.match(/Pool/)) { - this.removechild(this.actionAdd); - this.removechild(this.actionInterEvent); - this.removechild(this.actionGateway); - this.removechild(this.actionEndEvent); - this.removechild(this.actionAnnotation); - this.removechild(this.actionEndEvent); - this.removechild(this.actionFront); - this.removechild(this.actionBack); - this.removechild(this.actionDelete); - } - } - } - } -}; - -bpmnTask.prototype.addShapes = function (oStore) { - var xOffset = workflow.currentSelection.getX(); //Get x co-ordinate from figure - var y = workflow.currentSelection.getY(); //Get y co-ordinate from figure - //var xOffset = parseFloat(x + _3896.workflow.currentSelection.width); //Get x-offset co-ordinate from figure - var yOffset = parseFloat(y + workflow.currentSelection.height + 25); //Get y-offset co-ordinate from figure - var shape = workflow.currentSelection.type; - var count; - if (oStore.newShapeName == 'bpmnTask' && shape.match(/Event/)) { - xOffset = workflow.currentSelection.getX() - 67; //Setting new offset value when currentselection is not Task i.e deriving task from events - } - else if (oStore.newShapeName == 'bpmnTask' && shape.match(/Gateway/)) { - xOffset = workflow.currentSelection.getX() - 62; //Setting new offset value when currentselection is not Task i.e deriving task from gateways - } - else if (oStore.newShapeName.match(/Gateway/) && shape.match(/Gateway/)) { - xOffset = workflow.currentSelection.getX(); //Setting new offset value when currentselection is not Task i.e deriving task from gateways - } - else if (oStore.newShapeName.match(/Event/)) { - xOffset = workflow.currentSelection.getX() + 67; //Setting new offset value when newShape is not Task i.e aligning events - } - else if (oStore.newShapeName.match(/Gateway/)) { - xOffset = workflow.currentSelection.getX() + 62; - } - else if (oStore.newShapeName.match(/Annotation/) ) { - xOffset = workflow.currentSelection.getX() + 250; - yOffset = workflow.currentSelection.getY() - 10.5; - } - - workflow.subProcessName = 'Sub Process'; - workflow.annotationName = 'Annotation'; - var newShape = eval("new " + oStore.newShapeName + "(workflow)"); - workflow.addFigure(newShape, xOffset, yOffset); - //Assigning values to newShape Object for Saving Task automatically (Async Ajax Call) - newShape.x = xOffset; - newShape.y = yOffset; - - if(shape.match(/Annotation/) || oStore.newShapeName.match(/Annotation/)) - var conn = new DottedConnection(); - else - conn = new DecoratedConnection(); - - if (newShape.type.match(/Gateway/)) { - conn.setTarget(newShape.getPort("input2")); - conn.setSource(workflow.currentSelection.getPort("output1")); - workflow.addFigure(conn); - newShape.actiontype = 'addGateway'; - workflow.saveShape(newShape); - } - else if (newShape.type.match(/Start/)) { - conn.setTarget(newShape.getPort("output1")); - conn.setSource(workflow.currentSelection.getPort("input2")); - workflow.addFigure(conn); - } - else if (newShape.type.match(/Event/)) { - conn.setTarget(newShape.getPort("input2")); - conn.setSource(workflow.currentSelection.getPort("output1")); - workflow.addFigure(conn); - newShape.conn = conn; - newShape.actiontype = 'addEvent'; - workflow.saveShape(newShape); - } - else if (newShape.type.match(/Task/)) { - conn.setTarget(newShape.getPort("input2")); - conn.setSource(workflow.currentSelection.getPort("output1")); - workflow.addFigure(conn); - } - else if (newShape.type.match(/Annotation/)) { - conn.setTarget(newShape.getPort("input1")); - conn.setSource(workflow.currentSelection.getPort("output2")); - workflow.addFigure(conn); - newShape.actiontype = 'addText'; - newShape.conn = conn; - workflow.saveShape(newShape); //Saving Task automatically (Async Ajax Call) - } - /*if (oStore.newShapeName.match(/Event/) && oStore.newShapeName.match(/End/)) { - newShape.conn = conn; - workflow.saveRoute(workflow.currentSelection,newShape); - }*/ - if (oStore.newShapeName == 'bpmnTask') { - newShape.actiontype = 'addTask'; - newShape.conn = conn; - workflow.saveShape(newShape); //Saving Task automatically (Async Ajax Call) - } -} - -ButtonInterEvent = function (_30a8) { - Button.call(this, _30a8, 16, 16); -}; -ButtonInterEvent.prototype = new Button; -ButtonInterEvent.prototype.type = "/images/ext/gray/shapes/interevent"; -ButtonInterEvent.prototype.execute = function () { - var count = 0; - this.palette.newShapeName = 'bpmnEventEmptyInter'; - bpmnTask.prototype.addShapes(this.palette); -}; - -ButtonEndEvent = function (_30a8) { - Button.call(this, _30a8, 16, 16); -}; -ButtonEndEvent.prototype = new Button; -ButtonEndEvent.prototype.type = "/images/ext/gray/shapes/endevent"; -ButtonEndEvent.prototype.execute = function () { - var count = 0; - this.palette.newShapeName = 'bpmnEventEmptyEnd'; - bpmnTask.prototype.addShapes(this.palette); -}; - -ButtonGateway = function (_30a8) { - Button.call(this, _30a8, 16, 16); -}; -ButtonGateway.prototype = new Button; -ButtonGateway.prototype.type = "/images/ext/gray/shapes/gateway-small"; -ButtonGateway.prototype.execute = function () { - this.palette.newShapeName = 'bpmnGatewayExclusiveData'; - workflow.preSelectedObj = workflow.currentSelection; - bpmnTask.prototype.addShapes(this.palette); -}; - -ButtonAnnotation = function (_30a8) { - Button.call(this, _30a8, 16, 16); -}; -ButtonAnnotation.prototype = new Button; -ButtonAnnotation.prototype.type = "/images/ext/gray/shapes/annotation"; -ButtonAnnotation.prototype.execute = function () { - var count = 0; - this.palette.newShapeName = 'bpmnAnnotation'; - this.palette.workflow.preSelectedObj = this.palette.workflow.currentSelection; - bpmnTask.prototype.addShapes(this.palette); -}; - -ButtonTask = function (_30a8) { - Button.call(this, _30a8, 16, 16); -}; -ButtonTask.prototype = new Button; -ButtonTask.prototype.type = "/images/ext/gray/shapes/Task"; -ButtonTask.prototype.execute = function () { - this.palette.newShapeName = 'bpmnTask'; - bpmnTask.prototype.addShapes(this.palette); -}; - - -ButtonAdd = function (_30a8) { - Button.call(this, _30a8, 16, 16); -}; -ButtonAdd.prototype = new Button; -ButtonAdd.prototype.type = "/images/ext/gray/shapes/btn-add"; -ButtonAdd.prototype.execute = function () { - this.palette.newShapeName = 'bpmnTask'; - this.palette.workflow.preSelectedObj = this.palette.workflow.currentSelection; - bpmnTask.prototype.addShapes(this.palette); -}; - -ButtonDelete = function (_30a9) { - Button.call(this, _30a9, 16, 16); -}; -ButtonDelete.prototype = new Button; -ButtonDelete.prototype.type = "/images/ext/gray/shapes/btn-del"; -ButtonDelete.prototype.execute = function () { - workflow.hideResizeHandles(); - workflow.getDeleteCriteria(); -}; -ButtonMoveFront = function (_3e22) { - Button.call(this, _3e22, 16, 16); -}; -ButtonMoveFront.prototype = new Button; -ButtonMoveFront.prototype.type = "/images/ext/gray/shapes/btn-movefrnt"; -ButtonMoveFront.prototype.execute = function () { - this.palette.workflow.moveFront(this.palette.workflow.getCurrentSelection()); - ToolGeneric.prototype.execute.call(this); -}; -ButtonMoveBack = function (_4091) { - Button.call(this, _4091, 16, 16); -}; -ButtonMoveBack.prototype = new Button; -ButtonMoveBack.prototype.type = "/images/ext/gray/shapes/btn-movebk"; -ButtonMoveBack.prototype.execute = function () { - this.palette.workflow.moveBack(this.palette.workflow.getCurrentSelection()); - ToolGeneric.prototype.execute.call(this); -}; - -bpmnTaskDialog = function (_2e5e) { - this.figure = _2e5e; - var title = 'Task Detail'; - Dialog.call(this, title); - this.setDimension(400, 150); //Set the width and height of the Dialog box -} - -bpmnTaskDialog.prototype = new Dialog(this); -bpmnTaskDialog.prototype.createHTMLElement = function () { - var item = Dialog.prototype.createHTMLElement.call(this); - var inputDiv = document.createElement("form"); - inputDiv.style.position = "absolute"; - inputDiv.style.left = "10px"; - inputDiv.style.top = "30px"; - inputDiv.style.width = "375px"; - inputDiv.style.font = "normal 10px verdana"; - item.appendChild(inputDiv); - this.label = document.createTextNode("Task Name"); - inputDiv.appendChild(this.label); - this.input = document.createElement("textarea"); - this.input.size = '1'; - this.input.style.border = "1px solid gray"; - this.input.style.font = "normal 10px verdana"; - //this.input.type = "text"; - this.input.cols = "50"; - this.input.rows = "3"; - this.input.maxLength = "100"; - var value = bpmnTask.prototype.trim(workflow.currentSelection.taskName); - if (value) this.input.value = value; - else this.input.value = ""; - this.input.style.width = "100%"; - inputDiv.appendChild(this.input); - this.input.focus(); - return item; -}; - -//Double Click Event for opening the dialog Box -bpmnTask.prototype.onDoubleClick = function () { - var _409d = new bpmnTaskDialog(this); - workflow.showDialog(_409d, this.workflow.currentSelection.x, this.workflow.currentSelection.y); -}; - -/** - * erik: Setting task target to Drop user & group assignment - */ -bpmnTask.prototype.onMouseEnter = function () { - if( this.type == 'bpmnTask' ) { - _targetTask = {id: this.id, name: this.taskName}; - } -}; - -bpmnTask.prototype.trim = function (str) { - if (str != null) - return str.replace(/^\s+|\s+$/g, ''); - else - return null; -}; - -/** - * This method will be called if the user pressed the OK button in buttonbar of the dialog.
- * The string is first cleared and new string is painted.

- **/ -bpmnTaskDialog.prototype.onOk = function () { - this.figure.bpmnText.clear(); - //len = Math.ceil(this.input.value.length/16); - var len = this.workflow.currentSelection.width / 18; - if (len >= 6) { - // len = 1.5; - var padleft = 0.12 * this.workflow.currentSelection.width; - var padtop = 0.32 * this.workflow.currentSelection.height - 3; - this.figure.rectWidth = this.workflow.currentSelection.width - 2 * padleft; - } - else { - padleft = 0.1 * this.workflow.currentSelection.width; - padtop = 0.09 * this.workflow.currentSelection.height - 3; - this.figure.rectWidth = this.workflow.currentSelection.width - 2 * padleft; - } - - var rectheight = this.workflow.currentSelection.height - 2*padtop; - this.figure.bpmnText.setFont('verdana', +this.figure.fontSize+'px', Font.PLAIN); - this.figure.bpmnText.drawStringRect(this.input.value, padleft, padtop, this.figure.rectWidth, rectheight, 'center'); - this.figure.bpmnText.paint(); - this.workflow.currentSelection.taskName = this.input.value; //Set Updated Text value - //Saving task name (whenever updated) onAsynch AJAX call - this.figure.actiontype = 'updateTaskName'; - this.workflow.saveShape(this.figure); - if (this.figure.rectWidth < 80) tempW = 110; - else tempW = this.figure.rectWidth + 35; - this.workflow.removeFigure(this); -}; - -bpmnTask.prototype.getContextMenu = function () { - this.workflow.handleContextMenu(this); -}; diff --git a/workflow/engine/templates/bpmn/bpmnZoom.js b/workflow/engine/templates/bpmn/bpmnZoom.js deleted file mode 100755 index 4e627974b..000000000 --- a/workflow/engine/templates/bpmn/bpmnZoom.js +++ /dev/null @@ -1,380 +0,0 @@ -// -------------------------------------------------------------------- -// Javascript Magnifier v 0.97 -// Written by Dino Termini - termini@email.it - May 9, 2003 -// This script is freeware (GPL) but if you use it, please let me know! -// -// Portions of code by zoomIN, zoomOUT -// Author: Nguyen Duong Minh (Obie) - obie4web@yahoo.com -// WWW: http://ObieWebsite.SourceForge.net -// License: GNU (GPL) -// -// Portions of code by Webreference Javascript Cookie Functions -// Jupirmedia Corporation -// http://www.internet.com - - -bpmnZoom=function(){ -// Configuration parameters -// ------------------------ -// Measure unit in pixel (px) or points (pt) -// measureUnit = "pt" -measureUnit = "px" - -// Minimum size allowed for SIZE attribute (like in ) -minSize = 1; - -// Minimum size allowed for STYLE attribute (like in ) -minStyleSize = 10; - -// Maximum size allowed for SIZE attribute -maxSize = 6; - -// Maximum size allowed for STYLE attribute -maxStyleSize = 30; - -// Start size for tags with no SIZE attribute defined -startSize = 1; - -// Start size for tags with no font-size STYLE or CLASS attribute defined -startStyleSize = 10; - -// Increasing and decreasing step -stepSize = 1; - -// Increasing step for STYLE definition (measure previously declared will be used) -stepStyleSize = 2; - -// To set your own hotkeys, use key generator tool page included -// Keys to zooming in (with and without CAPS lock). Default: "+" -var keyin = 61; -var keyinCAPS = 43; - -// Keys to zooming out (with and without CAPS lock). Default: "-" -var keyout = 45; -var keyoutCAPS = 95; - -// Keys for "hard" zooming in (with and without CAPS lock). Default: ">" -var keyinIe = 46; -var keyinIeCAPS = 62; - -// Keys for "hard" zooming out (with and without CAPS lock). Default: "<" -var keyoutIe = 44; -var keyoutIeCAPS = 60; - -// "Hard" zoom factor -var zoomFactor = 1.1; - -// Max zoom allowed -var maxZoom = 4.096; - -// Min zoom allowed -var minZoom = 0.625; - -// Initial decrease zoom -var startDecZoom = 0.7; - -// Initial increase zoom -var startIncZoom = 1.3; - -// Cookie expiry (default one year, actually 365 days) -// 365 days in a year -// 24 hours in a day -// 60 minutes in an hour -// 60 seconds in a minute -// 1000 milliseconds in a second -userExpiry = 365 * 24 * 60 * 60 * 1000; - -// Enable or disable alert messages -alertEnabled = false; - -// Allow input fields resize (text, buttons, and so on) -allowInputResize = false; - -// End of configuration parameters. Please do not edit below this line -// -------------------------------------------------------------------------------- -} - -// Input values: -// name - name of the cookie -// value - value of the cookie -// [expires] - expiration date of the cookie (defaults to end of current session) -// [path] - path for which the cookie is valid (defaults to path of calling document) -// [domain] - domain for which the cookie is valid (defaults to domain of calling document) -// [secure] - Boolean value indicating if the cookie transmission requires a secure transmission -// * an argument defaults when it is assigned null as a placeholder -// * a null placeholder is not required for trailing omitted arguments -bpmnZoom.prototype.setCookie = function(name, value, expires, path, domain, secure) { - // Check whether cookies enabled - document.cookie = "Enabled=true"; - var cookieValid = document.cookie; - - // if retrieving the VALUE we just set actually works - // then we know cookies enabled - if (cookieValid.indexOf("Enabled=true") != -1) { - var curCookie = name + "=" + escape(value) + - ((expires) ? "; expires=" + expires.toGMTString() : "") + - ((path) ? "; path=" + path : "") + - ((domain) ? "; domain=" + domain : "") + - ((secure) ? "; secure" : ""); - - document.cookie = curCookie; - return(true); - } - else { - return(false); - } -} - -// Input value: -// name - name of the desired cookie -// * return string containing value of specified cookie or null if cookie does not exist -bpmnZoom.prototype.getCookie = function(name) { - var dc = document.cookie; - var prefix = name + "="; - var begin = dc.indexOf("; " + prefix); - if (begin == -1) { - begin = dc.indexOf(prefix); - if (begin != 0) return null; - } else - begin += 2; - var end = document.cookie.indexOf(";", begin); - if (end == -1) - end = dc.length; - return unescape(dc.substring(begin + prefix.length, end)); -} - -// Input values: -// name - name of the cookie -// [path] - path of the cookie (must be same as path used to create cookie) -// [domain] - domain of the cookie (must be same as domain used to create cookie) -// * path and domain default if assigned null or omitted if no explicit argument proceeds -bpmnZoom.prototype.deleteCookie = function(name, path, domain) { - if (this.getCookie(name)) { - document.cookie = name + "=" + - ((path) ? "; path=" + path : "") + - ((domain) ? "; domain=" + domain : "") + - "; expires=Thu, 01-Jan-70 00:00:01 GMT"; - } -} - -// Input value: -// date - any instance of the Date object -// * hand all instances of the Date object to this function for "repairs" -bpmnZoom.prototype.fixDate = function(date) { - var base = new Date(0); - var skew = base.getTime(); - if (skew > 0) - date.setTime(date.getTime() - skew); -} - -bpmnZoom.prototype.searchTags = function(childTree, level) { - var retArray = new Array(); - var tmpArray = new Array(); - var j = 0; - var childName = ""; - for (var i=0; i maxSize)) - size = startSize; - - if (isNaN(styleSize) || (styleSize < minStyleSize) || (styleSize > maxStyleSize)) - styleSize = startStyleSize; - - if ( ((size > minSize) && (size < maxSize)) || - ((size == minSize) && (stepSize > 0)) || - ((size == maxSize) && (stepSize < 0)) || useCookie) { - myObj[i].setAttribute("size", size+myStepSize); - } - - if ( ((styleSize > minStyleSize) && (styleSize < maxStyleSize)) || - ((styleSize == minStyleSize) && (stepStyleSize > 0)) || - ((styleSize == maxStyleSize) && (stepStyleSize < 0)) || useCookie) { - newStyleSize = styleSize+myStepStyleSize; - myObj[i].style.fontSize = newStyleSize+measureUnit; - } - } // End if condition ("only some tags") - } // End main for cycle - - // Set the cookies - if (!useCookie) { - cookieIsSet = this.setCookie("incrSize", myStepSize+myCookieSize, now); - cookieIsSet = this.setCookie("incrStyleSize", myStepStyleSize+myCookieStyleSize, now); - if (alertEnabled && !cookieIsSet) { - alert("Per mantenere in memoria la dimensione scelta, abilita i cookie nel browser"); - } - } - - } // End if condition ("document.body exists") -} // End function declaration - -bpmnZoom.prototype.increaseFontSize = function() { - if (document.body) { - this.changeFontSize(stepSize, stepStyleSize, false); - } - else { - if (alertEnabled) { - alert("Spiacente, il tuo browser non supporta questa funzione"); - } - } -} - -bpmnZoom.prototype.decreaseFontSize = function() { - if (document.body) { - myStepSize = -stepSize; - myStepStyleSize = -stepStyleSize; - this.changeFontSize(myStepSize, myStepStyleSize, false); - } - else { - if (alertEnabled) { - alert("Spiacente, il tuo browser non supporta questa funzione"); - } - } -} - -bpmnZoom.prototype.zoomin = function() { - if (window.parent.document.body.style.zoom < maxZoom) { - if (window.parent.document.body.style.zoom > 0) { - window.parent.document.body.style.zoom *= zoomFactor; - } - else { - window.parent.document.body.style.zoom = startIncZoom; - } - } - else { - if (alertEnabled) { - alert("Warning: Max size reached"); - } - } -} - -bpmnZoom.prototype.zoomout = function() { - if ( (window.parent.document.body.style.zoom > minZoom) || - (window.parent.document.body.style.zoom == 0) ) { - if (window.parent.document.body.style.zoom > 0) { - window.parent.document.body.style.zoom /= zoomFactor; - } - else { - window.parent.document.body.style.zoom = startDecZoom; - } - } - else { - if (alertEnabled) { - alert("Warning: Min size reached"); - } - } -} - -bpmnZoom.prototype.checkzoom = function(e) { - - if (document.all) { - myEvent = event.keyCode; - } - else { - myEvent = e.which; - } - - switch(myEvent) { - case keyinIe: - case keyinIeCAPS: - this.zoomin(); - break; - - case keyoutIe: - case keyoutIeCAPS: - this.zoomout(); - break; - - case keyin: - case keyinCAPS: - this.increaseFontSize(); - break; - - case keyout: - case keyoutCAPS: - this.decreaseFontSize(); - break; - - default: - break; - } -} - -if (document.layers) { - document.captureEvents(Event.KEYPRESS); -} - -document.onkeypress = this.checkzoom; - diff --git a/workflow/engine/templates/bpmn/designer.html b/workflow/engine/templates/bpmn/designer.html deleted file mode 100755 index bf830ac66..000000000 --- a/workflow/engine/templates/bpmn/designer.html +++ /dev/null @@ -1,12 +0,0 @@ -
-
-
-
-
-
-
-
-
-
-
-
diff --git a/workflow/engine/templates/bpmn/designer.js b/workflow/engine/templates/bpmn/designer.js deleted file mode 100755 index 87bb991b6..000000000 --- a/workflow/engine/templates/bpmn/designer.js +++ /dev/null @@ -1,926 +0,0 @@ -/** - * BPMN Designer v1.1 - * @date Feb 2th, 2011 - * @author Erik A. O. - */ - -var saveProcess; -var usersPanel; -var _TAS_UID; -var _TU_TYPE; -var processObj; -var ProcessMapObj; - -Ext.onReady(function(){ - //Ext.state.Manager.setProvider(new Ext.state.CookieProvider()); - //Ext.BLANK_IMAGE_URL = '/images/s.gif'; - - var northPanel = new Ext.Toolbar({ - region: 'north', - height: 25, // give north and south regions a height - items: northPanelItems - }) - - var southPanel = { - // lazily created panel (xtype:'panel' is default) - region: 'south', - contentEl: 'south', - split: true, - height: 100, - minSize: 100, - maxSize: 200, - collapsible: true, - title: 'South', - margins: '0 0 0 0' - } - - var eastPanel = { - id: 'eastPanel', - region: 'east', - title: ' ', - collapsible: true, - split: true, - width: 225, // give east and west regions a width - minSize: 175, - maxSize: 400, - margins: '0 3 0 0', - layout:'border', // specify layout manager for items - items: // this TabPanel is wrapped by another Panel so the title will be applied - [ - eastPanelTree, - { - id: 'eastPanelCenter', - xtype: 'panel', - title: _('ID_PROCESS')+': '+pro_title, - region: 'center', - layout: 'fit', - items:[ - new Ext.TabPanel({ - id : 'usersPanelTabs', - title : '', - border: true, // already wrapped so don't add another border - activeTab : 0, // second tab initially active - tabPosition : 'top', - split : true, - collapseMode:'mini', - //height : 318, - items : [ - propertiesGrid, - usersTaskGrid, - usersTaskAdHocGrid - ] - }) - ] - } - ] - } - var westPanel = { - region: 'west', - id: 'west-panel', // see Ext.getCmp() below - title: ' ', - split: false, - width: 37, - minSize: 20, - maxSize: 400, - collapsible: true, - layout: 'table', - layoutConfig: {columns:1}, - defaults: {frame:true}, - margins: '0 3 3 0', - items: [ - toolbarPanel, - actorsPanel - ] - } - - var centerPanel = new Ext.Panel({ - //title: '', - region: 'center', // a center region is ALWAYS required for border layout - id: 'designerPanel', - contentEl: 'center1', - autoScroll: true, - tbar: northPanelItems - }) - - var viewport = new Ext.Viewport({ - layout: 'border', - items:[ - /*new Ext.Toolbar({ - region: 'north', - height: 25, // give north and south regions a height - items: mainMenu - }),*/ - new Ext.TabPanel({ - id: 'mainTabPanel', - region: 'center', - deferredRender: false, - activeTab: 0, // first tab initially active - items: [ - { - title:'BPMN Designer', - id: 'designerTab', - layout: 'border', - items:[ - // create instance immediately - //northPanel, - //southPanel, - eastPanel, - westPanel, - // in this instance the TabPanel is not wrapped by another panel - // since no title is needed, this Panel is added directly - // as a Container - centerPanel - ], - _setDesignerTitle: function(title) { - title = title.length > 20 ? title.substring(0, 20) + '...' : title; - Ext.getCmp('designerTab').setTitle(''+_('ID_PROCESSMAP_TITLE')+': ' + title); - } - } - ], - _addTab: function(option) { - alert(option); - }, - _addTabFrame: tabFrame = function(name, title, url) { - title = title.length > 20 ? title.substring(0, 20) + '...' : title; - tabId = 'pm-tab-'+name ; - //var uri = 'ajaxListener?action=' + name; - var TabPanel = Ext.getCmp('mainTabPanel'); - var tab = TabPanel.getItem(tabId); - - if( tab ) { - TabPanel.setActiveTab(tabId); - } else { - TabPanel.add({ - xtype:'iframepanel', - id: tabId, - title: title, - frameConfig:{name: name + 'Frame', id: name + 'Frame'}, - defaultSrc : url, - loadMask:{msg:'Loading...'}, - bodyStyle:{height:'600px'}, - width:'1024px', - closable:true, - autoScroll: true - }).show(); - - TabPanel.doLayout(); - } - } - }) - ] - }); - - Ext.getCmp('designerTab')._setDesignerTitle(pro_title); - Ext.fly(document).on("scroll", function(){ - if( usersPanel.isVisible() ) { - if (usersPanel._scrollPosTimer) { - clearTimeout(usersPanel._scrollPosTimer); - } - usersPanel._scrollPosTimer = setTimeout(function() { - usersPanel.setPosition(usersPanel._posRelToView[0] + divScroll.scrollLeft, usersPanel._posRelToView[1] + divScroll.scrollTop); - }, 100); - } - }); - - - processObj = new ProcessOptions(); - ProcessMapObj = new ProcessMapContext(); - workflow = new MyWorkflow("paintarea"); - workflow.setEnableSmoothFigureHandling(false); - //workflow.scrollArea.width = 2000; - var listener = new SelectionListener1(workflow); - workflow.addSelectionListener(listener); - - - if(typeof pro_uid !== 'undefined') { - Ext.Ajax.request({ - url: 'bpmnProxy/openProcess?PRO_UID=' + pro_uid, - success: function(response) { - shapesData = createShapes(response.responseText); - createConnection(shapesData); - - /** - * erik: Setting Drop targets from users & groups grids to assignment to tasks - * for all existing tasks - */ - var dropEls = Ext.get('paintarea').query('.x-task'); - for(var i = 0; i < dropEls.length; i++) - new Ext.dd.DropTarget(dropEls[i], {ddGroup:'task-assignment', notifyDrop : _onDropActors}); - - }, - failure: function(){ - Ext.Msg.alert ('Failure'); - } - }); - } - - - - //Get main into workflow object - workflow.main = Ext.getCmp('centerRegion'); - //workflow.setSnapToGeometry(false); - canvas = Ext.get('paintarea'); - - contextCanvasMenu = new Ext.menu.Menu({ - items: [ -/* { - text: 'Edit Process', - handler: ProcessMapObj.editProcess, - iconCls: 'button_menu_ext ss_sprite ss_page_white_edit', - scope: this - }, -*/ - { - text: 'Export Process', - handler: ProcessMapObj.exportProcess, - iconCls: 'button_menu_ext ss_sprite ss_script_go', - scope: this - }, { - text: 'Add Task', - handler: ProcessMapObj.addTask, - iconCls: 'button_menu_ext ss_sprite ss_layout_add', - scope: this - }, { - text: 'Add Subprocess', - handler: workflow.subProcess, - iconCls: 'button_menu_ext ss_sprite ss_layout_link', - scope: this - }/*, { - text: 'Horizontal Line', - handler: ProcessMapObj.horiLine, - scope: this - }, { - text: 'Vertical Line', - handler: ProcessMapObj.vertiLine, - scope: this - }, { - text: 'Delete All Lines', - handler: ProcessMapObj.delLines, - scope: this - }, */ -/* - { - text: 'Process Permission', - iconCls: 'button_menu_ext ss_sprite ss_application_key', - handler: ProcessMapObj.processPermission, - scope: this - },{ - text: 'Process Supervisor', - iconCls: 'button_menu_ext ss_sprite ss_group', - menu: { // <-- submenu by nested config object - items: [ - // stick any markup in a menu - { - text: 'Supervisors', - iconCls: 'button_menu_ext ss_sprite ss_group', - handler: ProcessMapObj.processSupervisors - }, - { - text: 'DynaForm', - iconCls: 'button_menu_ext ss_sprite ss_application_form', - handler: ProcessMapObj.processDynaform - }, - { - text: 'Input Documents', - iconCls: 'button_menu_ext ss_sprite ss_page_white_put', - handler: ProcessMapObj.processIODoc - } - ] - } - },{ - text: 'Case Tracker', - iconCls: 'button_menu_ext ss_sprite ss_exclamation', - - menu: { // <-- submenu by nested config object - items: [ - // stick any markup in a menu - { - text: 'Properties', - iconCls: 'button_menu_ext ss_sprite ss_exclamation', - handler: ProcessMapObj.caseTrackerProperties, - scope:this - }, - { - text: 'Objects', - iconCls: 'button_menu_ext ss_sprite ss_exclamation', - handler: ProcessMapObj.caseTrackerObjects, - scope:this - } - ] - } - }, { - text: 'Process File Manager', - iconCls: 'button_menu_ext ss_sprite ss_folder', - menu: { // <-- submenu by nested config object - items: [ - // stick any markup in a menu - { - text: 'mailTemplates', - iconCls: 'button_menu_ext ss_sprite ss_email', - handler: ProcessMapObj.processFileManager - }, - { - text: 'public', - iconCls: 'button_menu_ext ss_sprite ss_folder_go', - handler: ProcessMapObj.processFileManager - } - ] - } - } -*/ - ] - }); - - canvas.on('contextmenu', function(e) { - e.stopEvent(); - this.workflow.contextX = e.xy[0]; - this.workflow.contextY = e.xy[1]; - var pmosExtObj = new pmosExt(); - this.contextCanvasMenu.showAt(e.getXY()); - }, this); - - /*canvas.on('click', function(e) { - e.stopEvent(); - this.workflow.contextClicked = false; - if(this.workflow.currentSelection != null) - this.workflow.disablePorts(this.workflow.currentSelection); - //Removes Flow menu - this.workflow.setCurrentSelection(null); - }, this);*/ - - var simpleToolbar = new Ext.Toolbar('toolbar'); - simpleToolbar.addButton({ - text: 'Save', - cls: 'x-btn-text-icon scroll-bottom' - }); - simpleToolbar.addButton({ - text: 'Save As', - cls: 'x-btn-text-icon scroll-bottom' - }); - simpleToolbar.addButton({ - text: 'Undo', - cls: 'x-btn-text-icon' - }); - simpleToolbar.addButton({ - text: 'Redo', - cls: 'x-btn-text-icon' - }); - - var menu = new FlowMenu(workflow); - workflow.addSelectionListener(menu); - workflow.scrollArea = document.getElementById("center1").parentNode; - - Ext.get('x-shapes-task').child('.x-btn-mc').setStyle('text-align', 'left'); - Ext.get('x-shapes-startEvent').child('.x-btn-mc').setStyle('text-align', 'left'); - Ext.get('x-shapes-interEvent').child('.x-btn-mc').setStyle('text-align', 'left'); - Ext.get('x-shapes-endEvent').child('.x-btn-mc').setStyle('text-align', 'left'); - Ext.get('x-shapes-gateways').child('.x-btn-mc').setStyle('text-align', 'left'); - Ext.get('x-shapes-annotation').child('.x-btn-mc').setStyle('text-align', 'left'); - - Ext.get('x-pm-users').child('.x-btn-mc').setStyle('text-align', 'left'); - Ext.get('x-pm-groups').child('.x-btn-mc').setStyle('text-align', 'left'); - Ext.get('x-pm-users-adhoc').child('.x-btn-mc').setStyle('text-align', 'left'); - Ext.get('x-pm-groups-adhoc').child('.x-btn-mc').setStyle('text-align', 'left'); - - - /** - * Setting tooltips ti tollbar items - */ - new Ext.ToolTip({ - target: 'x-shapes-task', - title: 'Task', - trackMouse: true, - anchor: 'right', - html: '' - }); - new Ext.ToolTip({ - target: 'x-shapes-startEvent', - title: 'Event', - trackMouse: true, - anchor: 'right', - html: 'Start' - }); - new Ext.ToolTip({ - target: 'x-shapes-interEvent', - title: 'Event', - trackMouse: true, - anchor: 'right', - html: 'Intermediate' - }); - new Ext.ToolTip({ - target: 'x-shapes-endEvent', - title: 'Event', - trackMouse: true, - anchor: 'right', - html: 'End' - }); - new Ext.ToolTip({ - target: 'x-shapes-gateways', - title: 'Gateway', - trackMouse: true, - anchor: 'right', - html: '' - }); - new Ext.ToolTip({ - target: 'x-shapes-annotation', - title: 'Annotation', - anchor: 'right', - trackMouse: true, - html: '' - }); - - new Ext.ToolTip({ - target: 'x-pm-users', - title: 'Actors', - anchor: 'right', - trackMouse: true, - html: 'Users' - }); - new Ext.ToolTip({ - target: 'x-pm-groups', - title: 'Actors', - anchor: 'right', - trackMouse: true, - html: 'Groups' - }); - new Ext.ToolTip({ - target: 'x-pm-users-adhoc', - title: 'Actors', - anchor: 'right', - trackMouse: true, - html: 'Ad Hoc Users' - }); - new Ext.ToolTip({ - target: 'x-pm-groups-adhoc', - title: 'Actors', - anchor: 'right', - trackMouse: true, - html: 'Ad Hoc Groups' - }); - - - /** - * setting drag sources for Toolbar items - */ - var dragsource=new Ext.dd.DragSource("x-shapes-task", { - ddGroup:'TreeDD', - dragData:{ - name: "bpmnTask" - } - }); - var dragsource=new Ext.dd.DragSource("x-shapes-startEvent", { - ddGroup:'TreeDD', - dragData:{ - name: "bpmnEventEmptyStart" - } - }); - var dragsource=new Ext.dd.DragSource("x-shapes-interEvent", { - ddGroup:'TreeDD', - dragData:{ - name: "bpmnEventEmptyInter" - } - }); - var dragsource=new Ext.dd.DragSource("x-shapes-endEvent", { - ddGroup:'TreeDD', - dragData:{ - name: "bpmnEventEmptyEnd" - } - }); - var dragsource=new Ext.dd.DragSource("x-shapes-gateways", { - ddGroup:'TreeDD', - dragData:{ - name: "bpmnGatewayExclusiveData" - } - }); - - var dragsource=new Ext.dd.DragSource("x-shapes-annotation", { - ddGroup:'TreeDD', - dragData:{ - name: "bpmnAnnotation" - } - }); - - /*var dragsource=new Ext.dd.DragSource("x-shapes-dataobject", { - ddGroup:'TreeDD', - dragData:{ - name: "bpmnDataobject" - } - }); - var dragsource=new Ext.dd.DragSource("x-shapes-pool", { - ddGroup:'TreeDD', - dragData:{ - name: "bpmnPool" - } - });*/ - - - - - var droptarget=new Ext.dd.DropTarget('paintarea',{ - ddGroup:'TreeDD' - }); - - //Creating Pool - //var oPool = new bpmnPool(workflow); - //workflow.addFigure(oPool,100,70); - - if(workflow.taskNo == '') - workflow.taskNo= 0; //Initializing Count for the bpmnTask - var count = 0; - this.taskName=''; - droptarget.notifyDrop=function(dd, e, data) - { - if(data.name) - { - var xOffset = workflow.getAbsoluteX(); - var yOffset = workflow.getAbsoluteY(); - var scrollLeft = workflow.getScrollLeft(); - var scrollTop = workflow.getScrollTop(); - if(data.name == 'bpmnTask') { - workflow.boundaryEvent = false; - } - if(typeof workflow.zoomfactor == 'undefined') { - workflow.zoomfactor = 1; - } - workflow.task_width=''; - workflow.annotationName='Annotation'; - workflow.orgXPos = eval(e.xy[0]/workflow.zoomfactor); - workflow.orgYPos = eval(e.xy[1]/workflow.zoomfactor); - NewShape = eval("new "+data.name+"(workflow)"); - NewShape.x = e.xy[0]; - NewShape.y = e.xy[1]; - if(data.name == 'bpmnAnnotation') { - NewShape.actiontype = 'addText'; - workflow.saveShape(NewShape); //Saving task when user drags and drops it - } - else if(data.name == 'bpmnTask') { - NewShape.actiontype = 'addTask'; - workflow.saveShape(NewShape); //Saving Annotations when user drags and drops it - } - else if(data.name.match(/Event/)) { - NewShape.actiontype = 'addEvent'; - NewShape.mode = 'ddEvent'; - workflow.saveShape(NewShape); //Saving Annotations when user drags and drops it - } - else if(data.name.match(/Gateway/)){ - NewShape.actiontype = 'addGateway'; - NewShape.mode = 'ddGateway'; - workflow.saveShape(NewShape); //Saving Annotations when user drags and drops it - } - workflow.addFigure(NewShape,e.xy[0]-xOffset+scrollLeft,e.xy[1]-yOffset+scrollTop); - return true; - } - } - - function createConnection(shapes) - { - //var totaltask = shapes[0].length; //shapes[0] is an array for all the tasks - //var totalgateways = shapes[1].length; //shapes[1] is an array for all the gateways - //var totalevents = shapes[2].length; //shapes[2] is an array for all the events - if(typeof shapes.routes != 'undefined' && shapes.routes != '') { - var totalroutes = shapes.routes.length; //shapes[3] is an array for all the routes - for(var i=0;i<=totalroutes-1;i++){ - var sourceid = shapes.routes[i][1]; //getting source id for connection from Routes array - var targetid = shapes.routes[i][2]; //getting target id for connection from Routes array - //After creating all the shapes, check one by one shape id - for(var conn =0; conn < this.workflow.figures.data.length ; conn++){ - if(typeof this.workflow.figures.data[conn] === 'object'){ - if(sourceid == this.workflow.figures.data[conn].id){ - sourceObj = this.workflow.figures.data[conn]; - } - } - } - for(var conn =0; conn < this.workflow.figures.data.length ; conn++){ - if(typeof this.workflow.figures.data[conn] === 'object'){ - if(targetid == this.workflow.figures.data[conn].id ){ - targetObj = this.workflow.figures.data[conn]; - } - } - } - //Making Connections - if(targetObj.type == 'bpmnAnnotation') { - var connObj = new DottedConnection(); - connObj.setSource(sourceObj.output2); - connObj.setTarget(targetObj.input1); - } - else { - var connObj = new DecoratedConnection(); - connObj.setSource(sourceObj.output1); - connObj.setTarget(targetObj.input2); - } - - connObj.id = shapes.routes[i][0]; - this.workflow.addFigure(connObj); - } - } - } - - function createShapes(stringData) - { - - var shapes = Ext.util.JSON.decode(stringData); //stringData.split("|"); - workflow.taskNo = 0; - //Create all shapes - - //case 'tasks': - for(var k=0;k"+msg; - } - - saveProcess = function() - { - // console.dir(this.workflow); - - var tasks = new Array(); - var events = new Array(); - var gateways = new Array(); - var annotations = new Array(); - var subprocess = new Array(); - var l=0; - var m=0; - var n=0; - var p=0; - var r=0; - - for(var c = 0; c - */ - -var toolbarPanel; -var actorsPanel; -var northPanelItems; -var eastPanelTree; -var ActiveProperty; -var comboCategory; -var comboCalendar; -var comboPMVariables; -var propertiesGrid; -var propertyStore; -var usersTaskStore; -var usersTaskGrid; -var usersTaskGridContextMenu; -var usersTaskAdHocStore; -var usersTaskAdHocGrid; -var usersTaskAdHocGridContextMenu; -var mainMenu; -var tbar1; - -var usersPanelStart = 0; -var usersPanelLimit = 1000; -var usersStore; -var usersGrid; -var groupsStore; -var groupsGrid; -var adHocUsersStore; -var adHocUsersGrid; -var adHocGroupsStore; -var adHocGroupsGrid; - -var usersActorsWin; -var groupsActorsWin; -var adhocUsersActorsWin; -var adHocGroupsActorsWin; - -var _onDropActors; -var _targetTask; - -Ext.onReady(function(){ - divScroll = document.body; - -toolbarPanel = { - title: ' ', - border: true, - xtype:'buttongroup', - defaultType: 'button', - cls: 'btn-panel-pmtoolbar', - columns: 1, - defaults: { - scale: 'small' - }, - - items : [{ - iconCls: 'button_small_ext ss_sprite ss_bpmn_task-18x18', - id:"x-shapes-task", - text: ' ', - width: 22 - },{ - iconCls: 'button_small_ext ss_sprite ss_bpmn_startevent-18x18', - id:"x-shapes-startEvent", - text: ' ', - width: 22 - },{ - iconCls: 'button_small_ext ss_sprite ss_bpmn_interevent-18x18', - id:"x-shapes-interEvent", - text: ' ', - width: 22 - },{ - iconCls: 'button_small_ext ss_sprite ss_bpmn_endevent-18x18', - id:"x-shapes-endEvent", - text: ' ', - width: 22 - },{ - iconCls: 'ss_sprite ss_bpmn_gateway-18x18', - id:"x-shapes-gateways", - text: ' ', - width: 22 - },{ - iconCls: 'ss_sprite ss_bpmn_annotation-18x18', - id:"x-shapes-annotation", - text: ' ', - width: 22 - } - ] -}; - - -actorsPanel = { - title: ' ',//_('ID_ACTORS'), - border: true, - xtype:'buttongroup', - defaultType: 'button', - cls: 'btn-panel-pmtoolbar', - columns: 1, - defaults: { - scale: 'small' - }, - items : [ - { - iconCls: 'ICON_USERS', - id:"x-pm-users", - text: ' ', - width: 22, - handler: function(){ - usersActorsWin.show(); - } - },{ - iconCls: 'ICON_GROUPS', - id:"x-pm-groups", - text: ' ', - width: 22, - handler: function(){ - groupsActorsWin.show(); - } - },{ - iconCls: 'ss_sprite ss_user_suit', - id:"x-pm-users-adhoc", - text: ' ', - width: 22, - handler: function(){ - adHocUsersActorsWin.show(); - } - },{ - iconCls: 'ss_sprite ss_group_suit', - id:"x-pm-groups-adhoc", - text: ' ', - width: 22, - handler: function(){ - adHocGroupsActorsWin.show(); - } - } - ] -}; - - -northPanelItems = [ -/* - { - text: 'Save', - cls: 'x-btn-text-icon', - iconCls: 'button_menu_ext ss_sprite ss_disk', - handler: function() { - saveProcess(); - } - }, { - text:'Save as', - iconCls: 'button_menu_ext ss_sprite ss_disk_multiple' - }, { - xtype: 'tbseparator' - }, -*/{ - //xtype: 'tbsplit', - text:'Edit', - //iconCls: '', - menu: new Ext.menu.Menu({ - items: [ - { - text: _('ID_SWITCH_EDITOR'), - iconCls: 'ss_sprite ss_arrow_switch', - handler: function() { - if(typeof pro_uid !== 'undefined') { - location.href = 'processes/processes_Map?PRO_UID=' +pro_uid+ '&rand=' +Math.random() - } - } - }, { - text: _('ID_SNAP_GEOMETRY'), - checked: false, // when checked has a boolean value, it is assumed to be a CheckItem - checkHandler: function(item, checked){ - workflow.setSnapToGeometry(checked); - } - } - ] - }) - }, - { - //xtype: 'tbsplit', - //iconCls: 'button_menu_ext ss_sprite ss_application', - text: 'Process', - menu: new Ext.menu.Menu({ - items: [{ - text : 'Dynaform', - iconCls: 'button_menu_ext ss_sprite ss_application_form', - handler : function() { - processObj.addDynaform(); - } - }, { - text: 'Input Document', - iconCls: 'button_menu_ext ss_sprite ss_page_white_put', - handler : function() { - processObj.addInputDoc(); - } - }, { - text: 'Output Document', - iconCls: 'button_menu_ext ss_sprite ss_page_white_get', - - handler : function() { - processObj.addOutputDoc(); - } - }, { - text: 'Trigger', - iconCls: 'button_menu_ext ss_sprite ss_cog', - handler : function() { - processObj.addTriggers(); - } - }, { - text: 'Report Table', - iconCls: 'button_menu_ext ss_sprite ss_table', - handler : function() { - processObj.addReportTable(); - } - }, { - text: 'Database Connection', - iconCls: 'button_menu_ext ss_sprite ss_database_connect', - handler : function() { - processObj.dbConnection(); - } - } - - ] - }) - - }, - '-', - { - text:'Undo', - iconCls: 'button_menu_ext ss_sprite ss_arrow_undo', - handler: function() { - workflow.getCommandStack().undo(); - } - }, { - text:'Redo', - iconCls: 'button_menu_ext ss_sprite ss_arrow_redo', - handler: function() { - workflow.getCommandStack().redo(); - } - },{ - //xtype: 'tbsplit', - text:'Zoom', - iconCls: 'button_menu_ext ss_sprite ss_zoom', - menu: new Ext.menu.Menu({ - items: [{ - text : '25%', - handler: function() { - Ext.getCmp('designerTab')._setDesignerTitle(pro_title + ' (25%)'); - workflow.zoom('25'); - } - },{ - text : '50%', - handler: function() { - Ext.getCmp('designerTab')._setDesignerTitle(pro_title + ' (50%)'); - workflow.zoom('50'); - } - },{ - text : '75%', - handler: function() { - Ext.getCmp('designerTab')._setDesignerTitle(pro_title + ' (75%)'); - workflow.zoom('75'); - } - },{ - text : '100%', - handler: function() { - Ext.getCmp('designerTab')._setDesignerTitle(pro_title + ' (100%)'); - workflow.zoom('100'); - } - },{ - text : '125%', - handler: function() { - Ext.getCmp('designerTab')._setDesignerTitle(pro_title + ' (125%)'); - workflow.zoom('125'); - } - },{ - text : '150%', - handler: function() { - Ext.getCmp('designerTab')._setDesignerTitle(pro_title + ' (150%)'); - workflow.zoom('150'); - } - },{ - text : '200%', - handler: function() { - Ext.getCmp('designerTab')._setDesignerTitle(pro_title + ' (200%)'); - workflow.zoom('200'); - } - } - ] - }) - } /*,{ - xtype: 'tbseparator' - }, { - text: _('ID_ACTORS'), - iconCls: 'ICON_USERS', - handler: function(){ - usersPanel.show() - } - - }, { - xtype: 'tbfill' - }, { - text: _('ID_SWITCH_EDITOR'), - iconCls: 'button_menu_ext ss_sprite ss_pencil', - handler: function() { - if(typeof pro_uid !== 'undefined') { - location.href = 'processes/processes_Map?PRO_UID=' +pro_uid+ '&rand=' +Math.random() - } - } - }*/ -] - - - -eastPanelTree = new Ext.tree.TreePanel({ - id: 'eastPanelTree', - useArrows: false, - autoScroll: true, - animate: true, - rootVisible : false, - border: true, - height: PMExt.getBrowser().screen.height * 0.3, - region: 'north', - split : true, - collapseMode:'mini', - loader : new Ext.tree.TreeLoader({ - preloadChildren : true, - dataUrl : 'processProxy/getProcessDetail', - baseParams : { - PRO_UID: pro_uid - } - }), - root: { - nodeType : 'async', - draggable : false, - id : 'root', - expanded : true - } -}); - -// tree east panel selection change -eastPanelTree.getSelectionModel().on('selectionchange', function(tree, node){ - if( node.attributes.type == 'task') { - _TAS_UID = node.attributes.id; - - Ext.getCmp('usersPanelTabs').getTabEl('usersTaskGrid').style.display = ''; - Ext.getCmp('usersPanelTabs').getTabEl('usersTaskAdHocGrid').style.display = ''; - Ext.getCmp('usersTaskGrid').store.reload({params: {tas_uid: _TAS_UID, tu_type: 1}}); - Ext.getCmp('usersTaskAdHocGrid').store.reload({params: {tas_uid: _TAS_UID, tu_type: 2}}); - } else { - Ext.getCmp('usersPanelTabs').setActiveTab(0); - Ext.getCmp('usersPanelTabs').getTabEl('usersTaskGrid').style.display = 'none'; - Ext.getCmp('usersPanelTabs').getTabEl('usersTaskAdHocGrid').style.display = 'none'; - } - propertyStore.reload({params: { - action : 'getProperties', - UID : node.attributes.id, - type : node.attributes.type - }}); - Ext.getCmp('eastPanelCenter').setTitle(node.attributes.typeLabel+': '+node.attributes.text); - //propertiesGrid.store.sort('name','DESC'); - propertiesGrid.setSource(propertyStore.reader.jsonData.prop); - -}) - -ActiveProperty = new Ext.form.Checkbox({ - name : 'active', - fieldLabel : 'Active', - checked : true, - inputValue : '1' -}); - -comboCategory = new Ext.form.ComboBox({ - fieldLabel : 'Category', - name : 'category', - allowBlank : true, - store : new Ext.data.Store( { - //autoLoad: true, //autoload the data - proxy : new Ext.data.HttpProxy( { - url : 'processProxy/getCategoriesList', - method : 'POST' - }), - baseParams : { - action : 'getCategoriesList' - }, - reader : new Ext.data.JsonReader( { - //root : 'rows', - fields : [ - {name : 'CATEGORY_UID'}, - {name : 'CATEGORY_NAME'} - ] - }) - }), - valueField : 'CATEGORY_NAME', - displayField : 'CATEGORY_NAME', - typeAhead : true, - //mode : 'local', - triggerAction : 'all', - editable: true, - forceSelection: true, - selectOnFocus : true -}); - -comboCalendar = new Ext.form.ComboBox({ - fieldLabel : 'Calendar', - name : 'calendar', - allowBlank : true, - store : new Ext.data.Store( { - //autoLoad: true, //autoload the data - proxy : new Ext.data.HttpProxy({ url: 'processProxy/getCaledarList'}), - //baseParams : {action: 'getCaledarList'}, - reader : new Ext.data.JsonReader( { - root : 'rows', - fields : [ - {name : 'CALENDAR_UID'}, - {name : 'CALENDAR_NAME'} - ] - }) - }), - valueField : 'CALENDAR_NAME', - displayField : 'CALENDAR_NAME', - typeAhead : true, - //mode : 'local', - triggerAction : 'all', - editable: true, - forceSelection: true -}); - -var comboPMVariables = new Ext.form.ComboBox({ - fieldLabel : 'Calendar', - name : 'calendar', - allowBlank : true, - store : new Ext.data.Store( { - //autoLoad: false, //autoload the data - proxy : new Ext.data.HttpProxy({ url: 'processProxy/getPMVariables'}), - baseParams : {PRO_UID: pro_uid}, - reader : new Ext.data.JsonReader( { - root : 'rows', - fields : [ - {name : 'sName'}, - {name : 'sName'} - ] - }) - }), - valueField : 'sName', - displayField : 'sName', - typeAhead : true, - //mode : 'local', - triggerAction: 'all', - editable: true, - forceSelection: true -}); - -propertiesGrid = new Ext.grid.PropertyGrid({ - id: 'propGrid', - title: 'Properties', - loadMask : {msg:"Loading..."}, - autoHeight: true, - viewConfig : { - forceFit: true, - scrollOffset: 2 // the grid will never have scrollbars - }, - customEditors: { - //'Debug' : new Ext.grid.GridEditor(ActiveProperty), - 'Category' : new Ext.grid.GridEditor(comboCategory), - 'Calendar' : new Ext.grid.GridEditor(comboCalendar), - 'Variable for case priority' : new Ext.grid.GridEditor(comboPMVariables) - } -}); - -propertiesGrid.on('afteredit', function afterEdit(r) { - var node = Ext.getCmp('eastPanelTree').getSelectionModel().getSelectedNode(); - var UID; - var type; - - if( node ) { - UID = node.attributes.id; - type = node.attributes.type; - } else { - UID = pro_uid; - type = 'process'; - } - Ext.Ajax.request({ - url: 'processProxy/saveProperties', - params: { - UID: UID, - type: type, - property: r.record.data.name, - value: r.value - }, - success: function(response) { - if( type == 'process' && r.record.data.name == 'Title') { - pro_title = r.value; - - Ext.getCmp('designerTab')._setDesignerTitle(pro_title); - Ext.getCmp('eastPanelTree').getNodeById(UID).setText(pro_title); - } else if( type == 'task' && r.record.data.name == 'Title') { - Ext.getCmp('eastPanelTree').getNodeById(UID).setText(r.value); - //here we need to find and update the task title into task figure on designer - //if the current selection is the same node editing the title property - - if( workflow.currentSelection.id == UID ) { - workflow.currentSelection.taskName = r.value; - } - } - }, - failure: function(){ - //Ext.Msg.alert ('Failure'); - } - }); - - //r.record.commit(); -}, this ); - - -propertyStore = new Ext.data.JsonStore({ - id: 'propertyStore', - autoLoad: true, //autoload the data - url: 'processProxy/getProperties', - root: 'prop', - fields: ['title', 'description'], - store: new Ext.grid.PropertyStore({ - sortable: false, - defaultSortable: false - }), - listeners: { - load: { - fn: function(store, records, options){ - //propertiesGrid.store.sort('name','DESC'); - propertiesGrid.setSource(store.reader.jsonData.prop); - } - } - }, - baseParams: { - UID : pro_uid, - type : 'process' - } -}); - - -usersTaskStore = new Ext.data.GroupingStore( { - autoLoad: false, - url: 'processProxy/getActorsTask', - reader : new Ext.data.JsonReader({ - totalProperty: 'totalCount', - root: 'data', - fields : [ - {name : 'USR_UID'}, - {name : 'USR_USERNAME'}, - {name : 'USR_FIRSTNAME'}, - {name : 'USR_LASTNAME'}, - {name : 'NAME'}, - {name : 'TU_RELATION'} - ] - }), - baseParams: {tas_uid: '', tu_type: ''}, - groupField: 'TU_RELATION' - }); - - usersTaskGrid = new Ext.grid.GridPanel({ - id : 'usersTaskGrid', - title : _('ID_ACTORS'), - height : 180, - stateful : true, - stateId : 'usersTaskGrid', - sortable:false, - view: new Ext.grid.GroupingView({ - forceFit:true, - groupTextTpl: '{[values.rs.length]} {[values.rs[0].data["TU_RELATION"] == 1 ? "Users" : "Groups"]}' - }), - cm : new Ext.grid.ColumnModel({ - defaults: { - width: 300, - sortable: true - }, - columns : [ - {id:'USR_UID', dataIndex: 'USR_UID', hidden:true, hideable:false}, - {header: 'Assigned', id:'TU_RELATION', dataIndex: 'TU_RELATION', hidden:true, hideable:false}, - {header: 'User', dataIndex: 'USER', width: 249, renderer:function(v,p,r){ - if( r.data.TU_RELATION == '1' ) - return _FNF(r.data.USR_USERNAME, r.data.USR_FIRSTNAME, r.data.USR_LASTNAME); - else - return r.data.NAME; - }} - ] - }), - store: usersTaskStore, - listeners: { - render: function(){ - this.loadMask = new Ext.LoadMask(this.body, {msg:_('ID_LOADING')}); - } - }/*, - tbar:[ - '->', { - text: _('ID_REMOVE'), - iconCls: 'button_menu_ext ss_sprite ss_delete', - handler: removeUsersTask - } - ]*/, - bbar: [new Ext.PagingToolbar({ - pageSize : 10, - store : usersTaskStore, - displayInfo: true, - displayMsg : '{2} Users', - emptyMsg : '' - })] - }); - - //connecting context menu to grid - usersTaskGrid.addListener('rowcontextmenu', function(grid, rowIndex, e){ - e.stopEvent(); - var coords = e.getXY(); - usersTaskGridContextMenu.showAt([coords[0], coords[1]]); - }); - - //by default the right click is not selecting the grid row over the mouse - usersTaskGrid.on('rowcontextmenu', function (grid, rowIndex, evt) { - var sm = grid.getSelectionModel(); - sm.selectRow(rowIndex, sm.isSelected(rowIndex)); - }); - - //prevent default - usersTaskGrid.on('contextmenu', function (evt) { - evt.preventDefault(); - }); - - usersTaskGridContextMenu = new Ext.menu.Menu({ - id: 'messageContextMenu', - items: [{ - text: _('ID_REMOVE'), - iconCls: 'button_menu_ext ss_sprite ss_delete', - handler: removeUsersTask - } - ] - }); - - //AD HOC - usersTaskAdHocStore = new Ext.data.GroupingStore( { - autoLoad: false, - url: 'processProxy/getActorsTask', - reader : new Ext.data.JsonReader({ - totalProperty: 'totalCount', - root: 'data', - fields : [ - {name : 'USR_UID'}, - {name : 'USR_USERNAME'}, - {name : 'USR_FIRSTNAME'}, - {name : 'USR_LASTNAME'}, - {name : 'NAME'}, - {name : 'TU_RELATION'} - ] - }), - baseParams: {tas_uid: '', tu_type: ''}, - groupField: 'TU_RELATION' - }); - - usersTaskAdHocGrid = new Ext.grid.GridPanel({ - id : 'usersTaskAdHocGrid', - title : _('ID_AD_HOC_ACTORS'), - height : 180, - stateful : true, - stateId : 'usersTaskAdHocGrid', - sortable:false, - view: new Ext.grid.GroupingView({ - forceFit:true, - groupTextTpl: '{[values.rs.length]} {[values.rs[0].data["TU_RELATION"] == 1 ? "Users" : "Groups"]}' - }), - cm : new Ext.grid.ColumnModel({ - defaults: { - width: 300, - sortable: true - }, - columns : [ - {id:'USR_UID', dataIndex: 'USR_UID', hidden:true, hideable:false}, - {header: 'Assigned', id:'TU_RELATION', dataIndex: 'TU_RELATION', hidden:true, hideable:false}, - {header: 'User', dataIndex: 'USER', width: 249, renderer:function(v,p,r){ - if( r.data.TU_RELATION == '1' ) - return _FNF(r.data.USR_USERNAME, r.data.USR_FIRSTNAME, r.data.USR_LASTNAME); - else - return r.data.NAME; - }} - ] - }), - store: usersTaskAdHocStore, - listeners: { - render: function(){ - this.loadMask = new Ext.LoadMask(this.body, {msg:_('ID_LOADING')}); - } - }/*, - tbar:[ - '->', { - text: _('ID_REMOVE'), - iconCls: 'button_menu_ext ss_sprite ss_delete', - handler: removeUsersTask - } - ]*/, - bbar: [new Ext.PagingToolbar({ - pageSize : 10, - store : usersTaskStore, - displayInfo: true, - displayMsg : '{2} Users', - emptyMsg : '' - })] - }); - - - //connecting context menu to grid - usersTaskAdHocGrid.addListener('rowcontextmenu', function(grid, rowIndex, e) { - e.stopEvent(); - var coords = e.getXY(); - usersTaskAdHocGridContextMenu.showAt([coords[0], coords[1]]); - },this); - - //by default the right click is not selecting the grid row over the mouse - //we need to set this four lines - usersTaskAdHocGrid.on('rowcontextmenu', function (grid, rowIndex, evt) { - var sm = grid.getSelectionModel(); - sm.selectRow(rowIndex, sm.isSelected(rowIndex)); - }, this); - - //prevent default - usersTaskGrid.on('contextmenu', function (evt) { - evt.preventDefault(); - }, this); - - usersTaskAdHocGridContextMenu = new Ext.menu.Menu({ - id: 'messagAdHocGrideContextMenu', - items: [{ - text: _('ID_REMOVE'), - iconCls: 'button_menu_ext ss_sprite ss_delete', - handler: removeUsersAdHocTask - } - ] - }); - - /*** for actors ***/ - usersStore = new Ext.data.Store({ - autoLoad: false, - proxy : new Ext.data.HttpProxy({ - url: 'processProxy/getUsers?start='+usersPanelStart+'&limit='+usersPanelLimit - }), - reader : new Ext.data.JsonReader( { - totalProperty: 'totalCount', - root: 'data', - fields : [ - {name : 'USR_UID'}, - {name : 'USER'}, - {name : 'USR_USERNAME'}, - {name : 'USR_FIRSTNAME'}, - {name : 'USR_LASTNAME'} - ] - }), - listeners: { - load: function(){ - usersActorsWin.setTitle(_('ID_USERS_ACTORS') + ' (' +usersStore.reader.jsonData.totalCount+ ')'); - } - } - }); - - usersGrid = new Ext.grid.GridPanel({ - id : 'usersGrid', - height : 180, - ddGroup : 'task-assignment', - enableDragDrop : true, - width: 150, - cm : new Ext.grid.ColumnModel({ - defaults: { - width: 200, - sortable: true - }, - columns : [ - {header: 'USR_UID', id:'USR_UID', dataIndex: 'USR_UID', hidden:true, hideable:false}, - {header: 'User', dataIndex: 'USER', width: 249, renderer:function(v,p,r){ - return _FNF(r.data.USR_USERNAME, r.data.USR_FIRSTNAME, r.data.USR_LASTNAME); - }} - ] - }), - store: usersStore, - loadMask: {msg:_('ID_LOADING')}, - tbar : [ - new Ext.form.TextField ({ - id : 'usersSearchTxt', - ctCls :'pm_search_text_field', - allowBlank : true, - width : 170, - emptyText : _('ID_ENTER_SEARCH_TERM'), - listeners : { - specialkey: function(f,e){ - if (e.getKey() == e.ENTER) - usersSearch(); - } - } - }), { - text :'X', - ctCls :'pm_search_x_button', - handler : function(){ - usersStore.setBaseParam( 'search', ''); - usersStore.load({params:{start : 0 , limit : usersPanelLimit}}); - Ext.getCmp('usersSearchTxt').setValue(''); - } - }, { - text :TRANSLATIONS.ID_SEARCH, - handler : usersSearch - } - ] - /*, - bbar: [new Ext.PagingToolbar({ - pageSize : usersPanelLimit, - store : usersStore, - displayInfo: true, - displayMsg : '{2} Users', - emptyMsg : '' - })]*/ - }); - - adHocUsersStore = new Ext.data.Store({ - autoLoad: false, - proxy : new Ext.data.HttpProxy({ - url: 'processProxy/getUsers?start='+usersPanelStart+'&limit='+usersPanelLimit - }), - reader : new Ext.data.JsonReader( { - totalProperty: 'totalCount', - root: 'data', - fields : [ - {name : 'USR_UID'}, - {name : 'USER'}, - {name : 'USR_USERNAME'}, - {name : 'USR_FIRSTNAME'}, - {name : 'USR_LASTNAME'} - ] - }), - listeners: { - load: function(){ - adHocUsersActorsWin.setTitle(_('ID_ADHOC_USERS_ACTORS') + ' (' +adHocUsersStore.reader.jsonData.totalCount+ ')'); - } - } - }); - - adHocUsersGrid = new Ext.grid.GridPanel({ - id : 'adHocUsersGrid', - height : 180, - ddGroup : 'task-assignment', - enableDragDrop : true, - width: 150, - cm : new Ext.grid.ColumnModel({ - defaults: { - width: 200, - sortable: true - }, - columns : [ - {header: 'USR_UID', id:'USR_UID', dataIndex: 'USR_UID', hidden:true, hideable:false}, - {header: 'User', dataIndex: 'USER', width: 249, renderer:function(v,p,r){ - return _FNF(r.data.USR_USERNAME, r.data.USR_FIRSTNAME, r.data.USR_LASTNAME); - }} - ] - }), - store: adHocUsersStore, - loadMask: {msg:_('ID_LOADING')}, - tbar : [ - new Ext.form.TextField ({ - id : 'adHocUsersSearchTxt', - ctCls :'pm_search_text_field', - allowBlank : true, - width : 170, - emptyText : _('ID_ENTER_SEARCH_TERM'), - listeners : { - specialkey: function(f,e){ - if (e.getKey() == e.ENTER) - adHocUsersSearch(); - } - } - }), { - text :'X', - ctCls :'pm_search_x_button', - handler : function(){ - adHocUsersStore.setBaseParam( 'search', ''); - adHocUsersStore.load({params:{start : 0 , limit : usersPanelLimit}}); - Ext.getCmp('adHocUsersSearchTxt').setValue(''); - } - }, { - text :TRANSLATIONS.ID_SEARCH, - handler : adHocUsersSearch - } - ] - /*, - bbar: [new Ext.PagingToolbar({ - pageSize : usersPanelLimit, - store : usersStore, - displayInfo: true, - displayMsg : '{2} Users', - emptyMsg : '' - })]*/ - }); - - groupsStore = new Ext.data.Store( { - autoLoad: false, - proxy : new Ext.data.HttpProxy({ - url: 'processProxy/getGroups?start='+usersPanelStart+'&limit='+usersPanelLimit - }), - reader : new Ext.data.JsonReader( { - totalProperty: 'totalCount', - root: 'data', - fields : [ - {name : 'GRP_UID'}, - {name : 'CON_VALUE'} - ] - }), - listeners: { - load: function(){ - groupsActorsWin.setTitle(_('ID_GROUPS_ACTORS') + ' (' +groupsStore.reader.jsonData.totalCount+ ')'); - } - } - }); - - groupsGrid = new Ext.grid.GridPanel({ - id : 'groupsGrid', - ddGroup : 'task-assignment', - height : 180, - width : 150, - enableDragDrop : true, - cm : new Ext.grid.ColumnModel({ - defaults : { - width : 250, - sortable : true - }, - columns: [ - {id:'GRP_UID', dataIndex: 'GRP_UID', hidden:true, hideable:false}, - {header: 'Group', dataIndex: 'CON_VALUE', width: 249} - ] - }), - store : groupsStore, - loadMask: {msg:_('ID_LOADING')}, - tbar : [ - new Ext.form.TextField ({ - id : 'groupsSearchTxt', - ctCls :'pm_search_text_field', - allowBlank : true, - width : 170, - emptyText : _('ID_ENTER_SEARCH_TERM'), - listeners : { - specialkey: function(f,e){ - if (e.getKey() == e.ENTER) - groupsSearch(); - } - } - }), { - text :'X', - ctCls :'pm_search_x_button', - handler : function(){ - groupsStore.setBaseParam( 'search', ''); - groupsStore.load({params:{start : 0 , limit : usersPanelLimit}}); - Ext.getCmp('groupsSearchTxt').setValue(''); - } - }, { - text :TRANSLATIONS.ID_SEARCH, - handler : groupsSearch - } - ]/*, - bbar: [new Ext.PagingToolbar({ - pageSize : usersPanelLimit, - store : groupsStore, - displayInfo: true, - displayMsg : '{2} Groups', - emptyMsg : 'No records found' - })]*/ - }); - - adHocGroupsStore = new Ext.data.Store( { - autoLoad: false, - proxy : new Ext.data.HttpProxy({ - url: 'processProxy/getGroups?start='+usersPanelStart+'&limit='+usersPanelLimit - }), - reader : new Ext.data.JsonReader( { - totalProperty: 'totalCount', - root: 'data', - fields : [ - {name : 'GRP_UID'}, - {name : 'CON_VALUE'} - ] - }), - listeners: { - load: function(){ - adHocGroupsActorsWin.setTitle(_('ID_ADHOC_GROUPS_ACTORS') + ' (' +adHocGroupsStore.reader.jsonData.totalCount+ ')'); - } - } - }); - - adHocGroupsGrid = new Ext.grid.GridPanel({ - id : 'adHocGroupsGrid', - ddGroup : 'task-assignment', - height : 180, - width : 150, - enableDragDrop : true, - cm : new Ext.grid.ColumnModel({ - defaults : { - width : 250, - sortable : true - }, - columns: [ - {id:'GRP_UID', dataIndex: 'GRP_UID', hidden:true, hideable:false}, - {header: 'Group', dataIndex: 'CON_VALUE', width: 249} - ] - }), - store : adHocGroupsStore, - loadMask: {msg:_('ID_LOADING')}, - tbar : [ - new Ext.form.TextField ({ - id : 'adHocGroupsSearchTxt', - ctCls :'pm_search_text_field', - allowBlank : true, - width : 170, - emptyText : _('ID_ENTER_SEARCH_TERM'), - listeners : { - specialkey: function(f,e){ - if (e.getKey() == e.ENTER) - adHocGroupsSearch(); - } - } - }), { - text :'X', - ctCls :'pm_search_x_button', - handler : function(){ - adHocGroupsStore.setBaseParam( 'search', ''); - adHocGroupsStore.load({params:{start : 0 , limit : usersPanelLimit}}); - Ext.getCmp('adHocGroupsSearchTxt').setValue(''); - } - }, { - text :TRANSLATIONS.ID_SEARCH, - handler : adHocGroupsSearch - } - ]/*, - bbar: [new Ext.PagingToolbar({ - pageSize : usersPanelLimit, - store : groupsStore, - displayInfo: true, - displayMsg : '{2} Groups', - emptyMsg : 'No records found' - })]*/ - }); - - _onDropActors = function(ddSource, e, data) { - - var records = ddSource.dragData.selections; - var uids = Array(); - _TAS_UID = _targetTask.id; - - if( data.grid.id == 'usersGrid' || data.grid.id == 'groupsGrid') { - _TU_TYPE = 1; - } else { //some groups grid items were dropped - _TU_TYPE = 2; - } - - Ext.each(records, function(gridRow){ - if( data.grid.id == 'usersGrid' || data.grid.id == 'adHocUsersGrid') {//some users grid items were dropped - _RELATION = 1; - uids.push(gridRow.data.USR_UID); - } else { //some groups grid items were dropped - _RELATION = 2; - uids.push(gridRow.data.GRP_UID); - } - }); - - uids = uids.join(','); - - - Ext.getCmp('eastPanelCenter').setTitle(_('ID_TASK')+': '+_targetTask.name); - - Ext.Ajax.request({ - url: 'processProxy/assignActorsTask', - success: function(response){ - var result = Ext.util.JSON.decode(response.responseText); - if( result.success ) { - PMExt.notify(_('ID_RESPONSABILITIES_ASSIGNMENT'), result.msg); - - Ext.getCmp('eastPanel').show(); - Ext.getCmp('usersPanelTabs').getTabEl('usersTaskGrid').style.display = ''; - Ext.getCmp('usersPanelTabs').getTabEl('usersTaskAdHocGrid').style.display = ''; - Ext.getCmp('eastPanelTree').getNodeById(_TAS_UID).select(); - if( _TU_TYPE == 1 ) { - Ext.getCmp('usersPanelTabs').setActiveTab(1); - Ext.getCmp('usersTaskGrid').store.reload({params:{tas_uid: _TAS_UID, tu_type: 1}}); - } else { - Ext.getCmp('usersPanelTabs').setActiveTab(2); - Ext.getCmp('usersTaskAdHocGrid').store.reload({params:{tas_uid: _TAS_UID, tu_type: 2}}); - } - - } else { - PMExt.error(_('ID_ERROR'), result.msg); - } - }, - failure: function(){}, - params: { - TAS_UID : _TAS_UID, - TU_TYPE : _TU_TYPE, - TU_RELATION : _RELATION, - UIDS : uids - } - }); - } - - - //last - usersActorsWin = new Ext.Window({ - layout:'fit', - padding: '0 10 0 0', - iconCls: 'ICON_USERS', - width:260, x:45, y:55, - height:PMExt.getBrowser().screen.height/2 - 20, - closeAction:'hide', - plain: true, - plugins: [ new Ext.ux.WindowCascade() ], - offset: 50, - items: [usersGrid], - listeners:{ - beforerender:function(){ - usersGrid.store.load(); - } - } - }); - - adHocUsersActorsWin = new Ext.Window({ - layout:'fit', - padding: '0 10 0 0', - iconCls: 'ss_sprite ss_user_suit', - width:260, - height:PMExt.getBrowser().screen.height/2 - 20, - closeAction:'hide', - plain: true, - plugins: [ new Ext.ux.WindowCascade() ], - offset: 50, - items: [adHocUsersGrid], - listeners:{ - beforerender:function(){ - adHocUsersGrid.store.load(); - } - } - }); - - groupsActorsWin = new Ext.Window({ - layout:'fit', - padding: '0 10 0 0', - iconCls: 'ICON_GROUPS', - width:260, - height:PMExt.getBrowser().screen.height/2 - 20, - closeAction:'hide', - plain: true, - plugins: [ new Ext.ux.WindowCascade() ], - offset: 50, - items: [groupsGrid], - listeners:{ - beforerender:function(){ - groupsGrid.store.load(); - } - } - }); - - adHocGroupsActorsWin = new Ext.Window({ - layout:'fit', - padding: '0 10 0 0', - iconCls: 'ss_sprite ss_group_suit', - width:260, - height:PMExt.getBrowser().screen.height/2 - 20, - closeAction:'hide', - plain: true, - plugins: [ new Ext.ux.WindowCascade() ], - offset: 50, - items: [adHocGroupsGrid], - listeners:{ - beforerender:function(){ - adHocGroupsGrid.store.load(); - } - } - }); - -}); -//end onReady - - -function removeUsersTask(){ - - var usr_uid = Array(); - var tu_relation = Array(); - var rowsSelected = Ext.getCmp('usersTaskGrid').getSelectionModel().getSelections(); - - if( rowsSelected.length == 0 ) { - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - return false; - } - - for(i=0; i