diff --git a/workflow/engine/classes/class.pmFunctions.php b/workflow/engine/classes/class.pmFunctions.php index 216cc0995..b3c90e75c 100755 --- a/workflow/engine/classes/class.pmFunctions.php +++ b/workflow/engine/classes/class.pmFunctions.php @@ -1869,10 +1869,23 @@ function PMFGetNextAssignedUser ($application, $task) { } } -//new functions by Erik +/** + * @method + * + * Returns a list or user. + * + * @name PMFGetUserEmailAddress + * @label PMFGet User Email Address + * + * @param string(32) or Array | $id | Case ID | Id of the case + * @param string(32) | $APP_UID or null | Application ID | Id of the Application + * @param string(32) | $prefix or default value 'usr' | prefix | Id of the task + * @return array | $aRecipient | Array of the Recipient | Return an Array of the Recipient + * + */ +function PMFGetUserEmailAddress($id, $APP_UID = null, $prefix='usr') +{ -function PMFGetUserEmailAddress($id, $APP_UID=null, $prefix='usr') { - require_once 'classes/model/UsersPeer.php'; require_once 'classes/model/AppDelegation.php'; G::LoadClass('case'); @@ -1997,7 +2010,22 @@ function PMFGetUserEmailAddress($id, $APP_UID=null, $prefix='usr') { } } -function PMFGetCaseNotes ($applicationID, $type = 'array',$userUid = '') { +/** + * @method + * + * Get of the cases notes an application. + * + * @name PMFGetCaseNotes + * @label Get of the cases notes an application. + * + * @param string(32) | $applicationID | Application ID | ID of the Application + * @param string(32) | $type or default value 'array' | type of the return value | type of the return value (array, object, string) + * @param string(32) | $userUid default value empty string | User ID | Id of the User + * @return array, object or string | $response | Array of the response | Return an Array or Object or String + * + */ +function PMFGetCaseNotes ($applicationID, $type = 'array', $userUid = '') +{ G::LoadClass('case'); $response = Cases::getCaseNotes($applicationID, $type, $userUid); return $response; diff --git a/workflow/engine/templates/triggers/triggers_CreateWizard.html b/workflow/engine/templates/triggers/triggers_CreateWizard.html index 6682c93b2..a9a1fead8 100755 --- a/workflow/engine/templates/triggers/triggers_CreateWizard.html +++ b/workflow/engine/templates/triggers/triggers_CreateWizard.html @@ -102,7 +102,7 @@ {RETURN_LABEL} - params ); $methodLink = isset ( $methodObject->info ['link'] ) && ($methodObject->info ['link'] != "") ? $methodObject->info ['link'] : ""; $methodreturnA = explode ( "|", $methodReturn ); - $methodReturnLabel = isset ( $methodreturnA [3] ) ? $methodreturnA [3] : $methodReturn; - + + $bReturnValue = true; + $displayMode = 'display:block'; + $methodreturnDescription = (trim(strtoupper($methodreturnA [3])) == strtoupper(G::LoadTranslation ( 'ID_NONE')) )? G::LoadTranslation ( 'ID_NOT_REQUIRED') : $methodreturnA [3]; + $methodReturnLabel = isset ( $methodreturnA [3] ) ? $methodreturnDescription : $methodReturn; + if ( (isset($methodreturnA[0]) && isset($methodreturnA[1])) && (trim(strtoupper($methodreturnA[0]) ) != strtoupper(G::LoadTranslation ( 'ID_NONE')) ) ) { + $methodReturnLabelRequired = (trim( $methodreturnA[1] ) != "" )? G::LoadTranslation ( "ID_REQUIRED_FIELD" ) : $methodreturnA[1]; + $methodReturnLabel .= "
" . trim( $methodReturnLabelRequired ) . " | " . trim($methodreturnA[0]); + } + else { + $bReturnValue = false; + $displayMode = 'display:none'; + } $aParametersFun = $methodParameters; $triggerWizardTemplate = PATH_TPL . 'triggers' . PATH_SEP . 'triggers_CreateWizard.html'; $template = new TemplatePower ( $triggerWizardTemplate ); @@ -76,8 +87,10 @@ try { $template->assign ( 'TITLE', G::LoadTranslation ( 'ID_TITLE' ) ); $template->assign ( 'DESCRIPTION', G::LoadTranslation ( 'ID_DESCRIPTION' ) ); $template->assign ( 'DETAILS_LABEL', G::LoadTranslation ( 'ID_DETAILS' ) ); - $template->assign ( 'RETURN_TITLE', G::LoadTranslation ( 'ID_TRIGGER_RETURN_TITLE' ) ); - $template->assign ( 'RETURN_LABEL', G::LoadTranslation ( 'ID_TRIGGER_RETURN_LABEL' ) ); + $template->assign ( 'RETURN_TITLE', G::LoadTranslation ( 'ID_TRIGGER_RETURN_TITLE' ) ); + if ( $bReturnValue ) { + $template->assign ( 'RETURN_LABEL', G::LoadTranslation ( 'ID_TRIGGER_RETURN_LABEL' ) ); + } $template->assign ( 'METHOD_LABEL', G::LoadTranslation ( 'ID_METHOD' ) ); $template->assign ( 'ROWS', sizeof ( $aParametersFun ) + 3 ); $template->assign ( 'TRIGGER_INFORMATION', 'Trigger Information' ); @@ -87,6 +100,7 @@ try { $template->assign ( 'RETURN_DESCRIPTION', $methodReturnLabel ); $template->assign ( 'ID_SAVE', G::LoadTranslation ( 'ID_SAVE' ) ); $template->assign ( 'ID_CANCEL', G::LoadTranslation ( 'ID_CANCEL' ) ); + $template->assign ( 'DISPLAY_MODE', $displayMode ); $sPMfunction = $sNameFun . " ("; $methodParametersOnlyNames = array (); diff --git a/workflow/engine/templates/triggers/triggers_EditWizard.html b/workflow/engine/templates/triggers/triggers_EditWizard.html index 15b815bc2..7b81386f8 100755 --- a/workflow/engine/templates/triggers/triggers_EditWizard.html +++ b/workflow/engine/templates/triggers/triggers_EditWizard.html @@ -109,7 +109,7 @@ {RETURN_LABEL} - params ); $methodLink = isset ( $methodObject->info ['link'] ) && ($methodObject->info ['link'] != "") ? $methodObject->info ['link'] : ""; $methodreturnA = explode ( "|", $methodReturn ); - $methodReturnLabel = isset ( $methodreturnA [3] ) ? $methodreturnA [3] : $methodReturn; - + + $bReturnValue = true; + $displayMode = 'display:block'; + $methodreturnDescription = (trim(strtoupper($methodreturnA [3])) == strtoupper(G::LoadTranslation ( 'ID_NONE')) )? G::LoadTranslation ( 'ID_NOT_REQUIRED') : $methodreturnA [3]; + $methodReturnLabel = isset ( $methodreturnA [3] ) ? $methodreturnDescription : $methodReturn; + if ( (isset($methodreturnA[0]) && isset($methodreturnA[1])) && (trim(strtoupper($methodreturnA[0]) ) != strtoupper(G::LoadTranslation ( 'ID_NONE')) ) ) { + $methodReturnLabelRequired = (trim( $methodreturnA[1] ) != "" )? G::LoadTranslation ( "ID_REQUIRED_FIELD" ) : $methodreturnA[1]; + $methodReturnLabel .= "
" . trim( $methodReturnLabelRequired ) . " | " . trim($methodreturnA[0]); + } + else { + $bReturnValue = false; + $displayMode = 'display:none'; + } $aParametersFun = $methodParameters; $triggerWizardTemplate = PATH_TPL . 'triggers' . PATH_SEP . 'triggers_EditWizard.html'; $template = new TemplatePower ( $triggerWizardTemplate ); @@ -79,7 +90,9 @@ try { $template->assign ( 'DESCRIPTION_CONTENT', $_GET['TRI_DESCRIPTION'] ); $template->assign ( 'DETAILS_LABEL', G::LoadTranslation ( 'ID_DETAILS' ) ); $template->assign ( 'RETURN_TITLE', G::LoadTranslation ( 'ID_TRIGGER_RETURN_TITLE' ) ); - $template->assign ( 'RETURN_LABEL', G::LoadTranslation ( 'ID_TRIGGER_RETURN_LABEL' ) ); + if ( $bReturnValue ) { + $template->assign ( 'RETURN_LABEL', G::LoadTranslation ( 'ID_TRIGGER_RETURN_LABEL' ) ); + } $template->assign ( 'RETURN_VALUE', $_GET['TRI_ANSWER'] ); $template->assign ( 'METHOD_LABEL', G::LoadTranslation ( 'ID_METHOD' ) ); $template->assign ( 'ROWS', sizeof ( $aParametersFun ) + 3 ); @@ -90,7 +103,8 @@ try { $template->assign ( 'RETURN_DESCRIPTION', $methodReturnLabel ); $template->assign ( 'ID_SAVE', G::LoadTranslation ( 'ID_SAVE' ) ); $template->assign ( 'ID_CANCEL', G::LoadTranslation ( 'ID_CANCEL' ) ); - + $template->assign ( 'DISPLAY_MODE', $displayMode ); + $sPMfunction = $sNameFun . " ("; $methodParametersOnlyNames = array (); if (count ( $aParametersFun ) > 0) {