diff --git a/gulliver/js/form/core/form.js b/gulliver/js/form/core/form.js index dda581c76..2648f4d54 100755 --- a/gulliver/js/form/core/form.js +++ b/gulliver/js/form/core/form.js @@ -284,7 +284,7 @@ function G_Field ( form, element, name ) return me.element.value; }; this.toJSONString=function() { - return '{'+me.name+':'+me.element.value.toJSONString()+'}'; + return '{"'+me.name+'":'+me.element.value.toJSONString()+'}'; }; this.highLight=function(){ try{ @@ -3060,18 +3060,22 @@ var validateForm = function(sRequiredFields) { } else { var arrayForm = document.getElementsByTagName("form"); + var inputAux; + var id = ""; + var i1 = 0; + var i2 = 0; - for (var i = 0; i <= arrayForm.length - 1; i++) { - var frm = arrayForm[i]; + for (i1 = 0; i1 <= arrayForm.length - 1; i1++) { + var frm = arrayForm[i1]; - for (var i = 0; i <= frm.elements.length - 1; i++) { - var elem = frm.elements[i]; + for (i2 = 0; i2 <= frm.elements.length - 1; i2++) { + var elem = frm.elements[i2]; if (elem.type == "checkbox" && elem.disabled && elem.checked) { - var id = elem.id + "_"; + id = elem.id + "_"; if (!document.getElementById(id)) { - var inputAux = document.createElement("input"); + inputAux = document.createElement("input"); inputAux.type = "hidden"; inputAux.id = id; inputAux.name = elem.name; @@ -3081,7 +3085,47 @@ var validateForm = function(sRequiredFields) { } } } + + var arrayLink = frm.getElementsByTagName("a"); + + for (i2 = 0; i2 <= arrayLink.length - 1; i2++) { + var link = arrayLink[i2]; + + if (typeof link.id != "undefined" && link.id != "" && link.id != "form[DYN_BACKWARD]" && link.id != "form[DYN_FORWARD]") { + var strHtml = link.parentNode.innerHTML; + + strHtml = stringReplace("\\x0A", "", strHtml); //\n 10 + strHtml = stringReplace("\\x0D", "", strHtml); //\r 13 + strHtml = stringReplace("\\x09", "", strHtml); //\t 9 + + if (/^.*pm:field.*$/.test(strHtml)) { + id = link.id + "_"; + + if (!document.getElementById(id)) { + var strAux = link.id.replace("form[", ""); + strAux = strAux.substring(0, strAux.length - 1); + + inputAux = document.createElement("input"); + inputAux.type = "hidden"; + inputAux.id = id; + inputAux.name = link.id; + inputAux.value = link.href; + + frm.appendChild(inputAux); + + inputAux = document.createElement("input"); + inputAux.type = "hidden"; + inputAux.id = id + "label"; + inputAux.name = "form[" + strAux + "_label]"; + inputAux.value = link.innerHTML; + + frm.appendChild(inputAux); + } + } + } + } } + return true; } }; diff --git a/gulliver/js/maborak/core/maborak.js b/gulliver/js/maborak/core/maborak.js index 92a315c83..1bc94bef2 100644 --- a/gulliver/js/maborak/core/maborak.js +++ b/gulliver/js/maborak/core/maborak.js @@ -960,7 +960,7 @@ var callServer;callServer=new leimnud.module.rpc.xmlhttp({url:me.form.ajaxServer else{for(var i=0;i1)dd.remove(0);}else{for(var key in dd.options){dd.options[key]=null;}} for(var o=0;o0){systemMessaggeInvalid+="\n \n"+G_STRINGS.ID_REQUIRED_FIELDS+": \n \n [ "+sMessage+" ]";} if(fielEmailInvalid.length>0){systemMessaggeInvalid+="\n \n"+G_STRINGS.ID_VALIDATED_FIELDS+": \n \n [ "+emailInvalidMessage+" ]";} alert(systemMessaggeInvalid);return false;} -else{var arrayForm=document.getElementsByTagName("form");for(var i=0;i<=arrayForm.length-1;i++){var frm=arrayForm[i];for(var i=0;i<=frm.elements.length-1;i++){var elem=frm.elements[i];if(elem.type=="checkbox"&&elem.disabled&&elem.checked){var id=elem.id+"_";if(!document.getElementById(id)){var inputAux=document.createElement("input");inputAux.type="hidden";inputAux.id=id;inputAux.name=elem.name;inputAux.value=elem.value;frm.appendChild(inputAux);}}}} +else{var arrayForm=document.getElementsByTagName("form");var inputAux;var id="";var i1=0;var i2=0;for(i1=0;i1<=arrayForm.length-1;i1++){var frm=arrayForm[i1];for(i2=0;i2<=frm.elements.length-1;i2++){var elem=frm.elements[i2];if(elem.type=="checkbox"&&elem.disabled&&elem.checked){id=elem.id+"_";if(!document.getElementById(id)){inputAux=document.createElement("input");inputAux.type="hidden";inputAux.id=id;inputAux.name=elem.name;inputAux.value=elem.value;frm.appendChild(inputAux);}}} +var arrayLink=frm.getElementsByTagName("a");for(i2=0;i2<=arrayLink.length-1;i2++){var link=arrayLink[i2];if(typeof link.id!="undefined"&&link.id!=""&&link.id!="form[DYN_BACKWARD]"&&link.id!="form[DYN_FORWARD]"){var strHtml=link.parentNode.innerHTML;strHtml=stringReplace("\\x0A","",strHtml);strHtml=stringReplace("\\x0D","",strHtml);strHtml=stringReplace("\\x09","",strHtml);if(/^.*pm:field.*$/.test(strHtml)){id=link.id+"_";if(!document.getElementById(id)){var strAux=link.id.replace("form[","");strAux=strAux.substring(0,strAux.length-1);inputAux=document.createElement("input");inputAux.type="hidden";inputAux.id=id;inputAux.name=link.id;inputAux.value=link.href;frm.appendChild(inputAux);inputAux=document.createElement("input");inputAux.type="hidden";inputAux.id=id+"label";inputAux.name="form["+strAux+"_label]";inputAux.value=link.innerHTML;frm.appendChild(inputAux);}}}}} return true;}};var getObject=function(sObject){var i;var oAux=null;var iLength=__aObjects__.length;for(i=0;i0){oAux[0].action+='&_REFRESH_=1';oAux[0].submit();}}};var saveForm=function(oObject){if(oObject){ajax_post(oObject.form.action,oObject.form,'POST');} diff --git a/gulliver/js/maborak/core/maborak.loader.js b/gulliver/js/maborak/core/maborak.loader.js index 455df0069..7e23c8033 100644 --- a/gulliver/js/maborak/core/maborak.loader.js +++ b/gulliver/js/maborak/core/maborak.loader.js @@ -723,6 +723,8 @@ return this.dom;}.extend(this);this.dom.remove=function() {if(radio_name[i].value==radio_value) {return radio_name[i];}} return false;}}}); +var $=function(el) +{var d=(typeof el=="string")?document.getElementById(el):el;return new leimnud.module.dom.methods(d);};var button=leimnud.module.dom.button;var input=leimnud.module.dom.input;var DOM=leimnud.module.dom.create;var panel=leimnud.module.panel;var select=leimnud.module.dom.select; leimnud.Package.Public({info:{Class:"maborak",File:"module.dashboard.js",Name:"dashboard",Type:"module",Version:"0.1"},content:function(){this.elements={};this.make=function(options) {this.options={drag:true,panel:[],data:[]}.concat(options||{});this.drop=new this.parent.module.drop();this.drop.make();var width=this.options.target.offsetWidth-50;this.columns=this.options.data.length;this.widthColumn=(width/this.columns);this.elements.column=[];this.elements.table=$dce('table');$(this.elements.table).setStyle({width:width,borderCollapse:'collapse'}) this.elements.tr=this.elements.table.insertRow(-1);this.options.target.append(this.elements.table);this.matriz=[];for(var i=0;i. - * - * For more information, contact Colosa Inc, 2566 Le Jeune Rd., - * Coral Gables, FL, 33134, USA, or email info@colosa.com. - * - */ - - /*NEXT LINE: Runs any configuration defined to be executed before dependent fields recalc*/ - if ( isset($_SESSION['CURRENT_PAGE_INITILIZATION']) ) - eval($_SESSION['CURRENT_PAGE_INITILIZATION']); - - - //G::LoadThirdParty('pear/json','class.json'); - //$json=new Services_JSON(); - if (!defined('XMLFORM_AJAX_PATH')) define('XMLFORM_AJAX_PATH',PATH_XMLFORM); - - $_DBArray = array(); - if (isset($_SESSION['_DBArray'])) { - $_DBArray = $_SESSION['_DBArray']; - } - - $xmlFile = G::getUIDName(urlDecode($_POST['form'])); - $sPath = XMLFORM_AJAX_PATH; - - //if the xmlform file doesn't exist, then try with the plugins folders - if ( !is_file ( XMLFORM_AJAX_PATH . $xmlFile ) ) { - $aux = explode ( PATH_SEP, $xmlFile ); - //check if G_PLUGIN_CLASS is defined, because publisher can be called without an environment - if ( count($aux) == 2 && defined ( 'G_PLUGIN_CLASS' ) ) { - $oPluginRegistry =& PMPluginRegistry::getSingleton(); - if ( $oPluginRegistry->isRegisteredFolder($aux[0]) ) { - $sPath = PATH_PLUGINS; - } - } - } - $G_FORM=new form( $xmlFile , $sPath ); - $G_FORM->id=urlDecode($_POST['form']); - $G_FORM->values=isset($_SESSION[$G_FORM->id]) ? $_SESSION[$G_FORM->id] : array(); - $newValues=(Bootstrap::json_decode(urlDecode(stripslashes($_POST['fields'])))); - if (isset($_POST['grid'])) { - $_POST['row'] = (int)$_POST['row']; - $aAux = array(); - foreach ($newValues as $sKey => $newValue) { - $newValue = (array)$newValue; - $aKeys = array_keys($newValue); - $aValues = array(); - for ($i = 1; $i <= ($_POST['row'] - 1); $i++) { - $aValues[$i] = array($aKeys[0] => ''); - } - $aValues[$_POST['row']] = array($aKeys[0] => $newValue[$aKeys[0]]); - $newValues[$sKey]->$_POST['grid'] = $aValues; - unset($newValues[$sKey]->$aKeys[0]); - } - } - - //Next Lines re-build newValues array to send multiple dependent fields merged by row into a grid. - if (sizeof($newValues)>1 && isset($_POST['grid'])){ - $fieldBase = array(); - foreach ($newValues as $key => $values){ - for ($r2=1; $r2 <= $_POST['row']; $r2++){ - foreach ($values as $class => $value){ - if ($class == $_POST['grid']){ - $value = (array) $value; - $arrayK = $value[$r2]; - foreach ($arrayK as $key2 => $val) { - $fieldBase[$r2][$key2] = is_array($val)? $val[$key2] : $val; - } - } - } - } - } - $newValues = array(); +. + * + * For more information, contact Colosa Inc, 2566 Le Jeune Rd., + * Coral Gables, FL, 33134, USA, or email info@colosa.com. + */ + +/*NEXT LINE: Runs any configuration defined to be executed before dependent fields recalc*/ +if (isset( $_SESSION['CURRENT_PAGE_INITILIZATION'] )) + eval( $_SESSION['CURRENT_PAGE_INITILIZATION'] ); + + // G::LoadThirdParty('pear/json','class.json'); + // $json=new Services_JSON(); +if (! defined( 'XMLFORM_AJAX_PATH' )) + define( 'XMLFORM_AJAX_PATH', PATH_XMLFORM ); + +$_DBArray = array (); +if (isset( $_SESSION['_DBArray'] )) { + $_DBArray = $_SESSION['_DBArray']; +} + +$xmlFile = G::getUIDName( urlDecode( $_POST['form'] ) ); +$sPath = XMLFORM_AJAX_PATH; + +//if the xmlform file doesn't exist, then try with the plugins folders +if (! is_file( XMLFORM_AJAX_PATH . $xmlFile )) { + $aux = explode( PATH_SEP, $xmlFile ); + //check if G_PLUGIN_CLASS is defined, because publisher can be called without an environment + if (count( $aux ) == 2 && defined( 'G_PLUGIN_CLASS' )) { + $oPluginRegistry = & PMPluginRegistry::getSingleton(); + if ($oPluginRegistry->isRegisteredFolder( $aux[0] )) { + $sPath = PATH_PLUGINS; + } + } +} +$G_FORM = new form( $xmlFile, $sPath ); +$G_FORM->id = urlDecode( $_POST['form'] ); +$G_FORM->values = isset( $_SESSION[$G_FORM->id] ) ? $_SESSION[$G_FORM->id] : array (); +$newValues = (Bootstrap::json_decode( urlDecode( stripslashes( $_POST['fields'] ) ) )); +if (isset( $_POST['grid'] )) { + $_POST['row'] = (int) $_POST['row']; + $aAux = array (); + foreach ($newValues as $sKey => $newValue) { + $newValue = (array) $newValue; + $aKeys = array_keys( $newValue ); + $aValues = array (); + for ($i = 1; $i <= ($_POST['row'] - 1); $i ++) { + $aValues[$i] = array ($aKeys[0] => '' + ); + } + $aValues[$_POST['row']] = array ($aKeys[0] => $newValue[$aKeys[0]] + ); + $newValues[$sKey]->$_POST['grid'] = $aValues; + unset( $newValues[$sKey]->$aKeys[0] ); + } +} + +//Next Lines re-build newValues array to send multiple dependent fields merged by row into a grid. +if (sizeof( $newValues ) > 1 && isset( $_POST['grid'] )) { + $fieldBase = array (); + foreach ($newValues as $key => $values) { + for ($r2 = 1; $r2 <= $_POST['row']; $r2 ++) { + foreach ($values as $class => $value) { + if ($class == $_POST['grid']) { + $value = (array) $value; + $arrayK = $value[$r2]; + foreach ($arrayK as $key2 => $val) { + $fieldBase[$r2][$key2] = is_array( $val ) ? $val[$key2] : $val; + } + } + } + } + } + $newValues = array (); //$fieldBase = (array) $fieldBase; - $newValues[0]->$_POST['grid'] = $fieldBase; - } - - //Resolve dependencies - //Returns an array ($dependentFields) with the names of the fields - //that depends of fields passed through AJAX ($_GET/$_POST) - $dependentFields=array(); $aux=array(); - for($r=0;$rsetValues($newValues[$r]); - //Search dependent fields - foreach($newValues[$r] as $k => $v) { - if (!is_array($v)) { - $myDependentFields = subDependencies( $k , $G_FORM , $aux ); - $_SESSION[$G_FORM->id][$k] = $v; - } - else { - foreach($v[$_POST['row']] as $k1 => $v1) { - $myDependentFields = subDependencies( $k1 , $G_FORM , $aux, $_POST['grid'] ); - $_SESSION[$G_FORM->id][$_POST['grid']][$_POST['row']][$k1] = $v1; - } - } - $dependentFields=array_merge($dependentFields, $myDependentFields); - } - } - if (isset($_POST['grid'])) $G_FORM->values=isset($_SESSION[$G_FORM->id]) ? $_SESSION[$G_FORM->id] : array(); - - $dependentFields=array_unique($dependentFields); - - //Parse and update the new content - $template = PATH_CORE . 'templates/xmlform.html'; - $newContent=$G_FORM->getFields($template, (isset($_POST['row']) ? $_POST['row'] : -1)); - //Returns the dependentFields's content - $sendContent=array(); - $r=0; - - foreach($dependentFields as $d) { - $sendContent[$r]->name=$d; - $sendContent[$r]->content=NULL; - if (!isset($_POST['grid'])) { - if (isset($G_FORM->fields[$d])) { - foreach($G_FORM->fields[$d] as $attribute => $value) { - switch($attribute) { - case 'type': - $sendContent[$r]->content->{$attribute}=$value;break; - case 'options': - $sendContent[$r]->content->{$attribute}=toJSArray($value, $sendContent[$r]->content->type); break; - } - } - $sendContent[$r]->value=isset($G_FORM->values[$d]) ? $G_FORM->values[$d] : ''; - } - } - else { - foreach($G_FORM->fields[$_POST['grid']]->fields[$d] as $attribute => $value) { - switch($attribute) { - case 'type': - $sendContent[$r]->content->{$attribute}=$value; break; - case 'options': - if ($sendContent[$r]->content->type != 'text') { - $sendContent[$r]->content->{$attribute}=toJSArray($value); - } - else { - $sendContent[$r]->content->{$attribute}=toJSArray((isset($value[$_POST['row']]) ? array($value[$_POST['row']]) : array())); - } - break; - } - } - $sendContent[$r]->value=isset($G_FORM->values[$_POST['grid']][$_POST['row']][$d]) ? $G_FORM->values[$_POST['grid']][$_POST['row']][$d] : ''; - } - $r++; - } - echo(Bootstrap::json_encode($sendContent)); - - function toJSArray($array, $type= '') - { - $result=array(); - foreach($array as $k => $v){ - $o=NULL; - $o->key=$k; - // TODO: review the condition to make the differentiation to dependent dropdowns in a grid function. - // this way of validation is if you have a dependent field in text fields - $o->value= ($type =='text' || $type =='textarea')? $k:$v; - $result[]=$o; - } - return $result; - } - - function subDependencies( $k , &$G_FORM , &$aux, $grid = '') { - if (array_search( $k, $aux )!==FALSE) return array(); - if ($grid == '') { - if (!array_key_exists( $k , $G_FORM->fields )) return array(); - if (!isset($G_FORM->fields[$k]->dependentFields)) return array(); - $aux[] = $k; - if (strpos($G_FORM->fields[$k]->dependentFields, ',') !== false) { - $myDependentFields = explode( ',', $G_FORM->fields[$k]->dependentFields); - } - else { - $myDependentFields = explode( '|', $G_FORM->fields[$k]->dependentFields); - } - for( $r=0 ; $r < sizeof($myDependentFields) ; $r++ ) { - if ($myDependentFields[$r]=="") unset($myDependentFields[$r]); - } - // $mD = $myDependentFields; - // foreach( $mD as $ki) { - // $myDependentFields = array_merge( $myDependentFields , subDependencies( $ki , $G_FORM , $aux ) ); - // } - } - else { - if (!array_key_exists( $k , $G_FORM->fields[$grid]->fields )) return array(); - if (!isset($G_FORM->fields[$grid]->fields[$k]->dependentFields)) return array(); - $aux[] = $k; - if (strpos($G_FORM->fields[$grid]->fields[$k]->dependentFields, ',') !== false) { - $myDependentFields = explode( ',', $G_FORM->fields[$grid]->fields[$k]->dependentFields); - } - else { - $myDependentFields = explode( '|', $G_FORM->fields[$grid]->fields[$k]->dependentFields); - } - for( $r=0 ; $r < sizeof($myDependentFields) ; $r++ ) { - if ($myDependentFields[$r]=="") unset($myDependentFields[$r]); - } -// $mD = $myDependentFields; -// foreach( $mD as $ki) { -// $myDependentFields = array_merge( $myDependentFields , subDependencies( $ki , $G_FORM , $aux, $grid) ); -// } - } - return $myDependentFields; - } -?> + $newValues[0]->$_POST['grid'] = $fieldBase; +} + +//Resolve dependencies +//Returns an array ($dependentFields) with the names of the fields +//that depends of fields passed through AJAX ($_GET/$_POST) +$dependentFields = array (); +$aux = array (); +for ($r = 0; $r < sizeof( $newValues ); $r ++) { + $newValues[$r] = (array) $newValues[$r]; + $G_FORM->setValues( $newValues[$r] ); + //Search dependent fields + foreach ($newValues[$r] as $k => $v) { + if (! is_array( $v )) { + $myDependentFields = subDependencies( $k, $G_FORM, $aux ); + $_SESSION[$G_FORM->id][$k] = $v; + } else { + foreach ($v[$_POST['row']] as $k1 => $v1) { + $myDependentFields = subDependencies( $k1, $G_FORM, $aux, $_POST['grid'] ); + $_SESSION[$G_FORM->id][$_POST['grid']][$_POST['row']][$k1] = $v1; + } + } + $dependentFields = array_merge( $dependentFields, $myDependentFields ); + } +} +if (isset( $_POST['grid'] )) + $G_FORM->values = isset( $_SESSION[$G_FORM->id] ) ? $_SESSION[$G_FORM->id] : array (); + +$dependentFields = array_unique( $dependentFields ); + +//Parse and update the new content +$template = PATH_CORE . 'templates/xmlform.html'; +$newContent = $G_FORM->getFields( $template, (isset( $_POST['row'] ) ? $_POST['row'] : - 1) ); +//Returns the dependentFields's content +$sendContent = array (); +$r = 0; + +foreach ($dependentFields as $d) { + $sendContent[$r]->name = $d; + $sendContent[$r]->content = NULL; + if (! isset( $_POST['grid'] )) { + if (isset( $G_FORM->fields[$d] )) { + foreach ($G_FORM->fields[$d] as $attribute => $value) { + switch ($attribute) { + case 'type': + $sendContent[$r]->content->{$attribute} = $value; + break; + case 'options': + $sendContent[$r]->content->{$attribute} = toJSArray( $value, $sendContent[$r]->content->type ); + break; + } + } + $sendContent[$r]->value = isset( $G_FORM->values[$d] ) ? $G_FORM->values[$d] : ''; + } + } else { + foreach ($G_FORM->fields[$_POST['grid']]->fields[$d] as $attribute => $value) { + switch ($attribute) { + case 'type': + $sendContent[$r]->content->{$attribute} = $value; + break; + case 'options': + if ($sendContent[$r]->content->type != 'text') { + $sendContent[$r]->content->{$attribute} = toJSArray( $value ); + } else { + $sendContent[$r]->content->{$attribute} = toJSArray( (isset( $value[$_POST['row']] ) ? array ($value[$_POST['row']] + ) : array ()) ); + } + break; + } + } + $sendContent[$r]->value = isset( $G_FORM->values[$_POST['grid']][$_POST['row']][$d] ) ? $G_FORM->values[$_POST['grid']][$_POST['row']][$d] : ''; + } + $r ++; +} +echo (Bootstrap::json_encode( $sendContent )); + +function toJSArray ($array, $type = '') +{ + $result = array (); + foreach ($array as $k => $v) { + $o = NULL; + $o->key = $k; + // TODO: review the condition to make the differentiation to dependent dropdowns in a grid function. + // this way of validation is if you have a dependent field in text fields + $o->value = ($type == 'text' || $type == 'textarea') ? $k : $v; + $result[] = $o; + } + return $result; +} + +function subDependencies ($k, &$G_FORM, &$aux, $grid = '') +{ + if (array_search( $k, $aux ) !== FALSE) + return array (); + if ($grid == '') { + if (! array_key_exists( $k, $G_FORM->fields )) + return array (); + if (! isset( $G_FORM->fields[$k]->dependentFields )) + return array (); + $aux[] = $k; + if (strpos( $G_FORM->fields[$k]->dependentFields, ',' ) !== false) { + $myDependentFields = explode( ',', $G_FORM->fields[$k]->dependentFields ); + } else { + $myDependentFields = explode( '|', $G_FORM->fields[$k]->dependentFields ); + } + for ($r = 0; $r < sizeof( $myDependentFields ); $r ++) { + if ($myDependentFields[$r] == "") + unset( $myDependentFields[$r] ); + } + // $mD = $myDependentFields; + // foreach( $mD as $ki) { + // $myDependentFields = array_merge( $myDependentFields , subDependencies( $ki , $G_FORM , $aux ) ); + // } + } else { + if (! array_key_exists( $k, $G_FORM->fields[$grid]->fields )) + return array (); + if (! isset( $G_FORM->fields[$grid]->fields[$k]->dependentFields )) + return array (); + $aux[] = $k; + if (strpos( $G_FORM->fields[$grid]->fields[$k]->dependentFields, ',' ) !== false) { + $myDependentFields = explode( ',', $G_FORM->fields[$grid]->fields[$k]->dependentFields ); + } else { + $myDependentFields = explode( '|', $G_FORM->fields[$grid]->fields[$k]->dependentFields ); + } + for ($r = 0; $r < sizeof( $myDependentFields ); $r ++) { + if ($myDependentFields[$r] == "") + unset( $myDependentFields[$r] ); + } + // $mD = $myDependentFields; + // foreach( $mD as $ki) { + // $myDependentFields = array_merge( $myDependentFields , subDependencies( $ki , $G_FORM , $aux, $grid) ); + // } + } + return $myDependentFields; +} diff --git a/gulliver/methods/propelTableAjax.php b/gulliver/methods/propelTableAjax.php index 735e1c330..a0f06a5cc 100755 --- a/gulliver/methods/propelTableAjax.php +++ b/gulliver/methods/propelTableAjax.php @@ -36,8 +36,8 @@ //THIS BLOCK SET THE FILTER VARIABLES if (isset($ntable->filterForm_Id) && ($ntable->filterForm_Id!=='')) { - - $sPath = PATH_XMLFORM; + + $sPath = PATH_XMLFORM; //if the xmlform file doesn't exist, then try with the plugins folders if ( !is_file ( $sPath . G::getUIDName( $ntable->filterForm_Id ) ) ) { $aux = explode ( PATH_SEP, G::getUIDName( $ntable->filterForm_Id ) ); @@ -49,11 +49,11 @@ } } } - + $filterForm=new filterForm(G::getUIDName( $ntable->filterForm_Id ),$sPath); - - - + + + $filterForm->values=$_SESSION[$filterForm->id]; parse_str( urldecode(get_ajax_value('filter')) , $newValues); if (isset($newValues['form'])) { @@ -77,10 +77,10 @@ //order by $orderBy = get_ajax_value('order'); - if (isset($orderBy)) { - $orderBy = urldecode($orderBy); - $ntable->orderBy = $orderBy; - } + if (isset($orderBy)) { + $orderBy = urldecode($orderBy); + $ntable->orderBy = $orderBy; + } if ( isset($page) && $page!=='' ) $ntable->currentPage = (int) $page; diff --git a/gulliver/system/class.bootstrap.php b/gulliver/system/class.bootstrap.php index 4169c05e7..7eece039c 100644 --- a/gulliver/system/class.bootstrap.php +++ b/gulliver/system/class.bootstrap.php @@ -341,7 +341,7 @@ class Bootstrap if (strtolower( $typefile ) == 'js' && $typearray[0] == 'translation') { Bootstrap::sendHeaders( $filename, 'text/javascript', $download, $downloadFileName ); $output = Bootstrap::streamJSTranslationFile( $filename, $typearray[1] ); - print $output; + echo $output; return; } @@ -349,7 +349,7 @@ class Bootstrap if (strtolower( $typefile ) == 'css' && $folderarray[count( $folderarray ) - 2] == 'css') { Bootstrap::sendHeaders( $filename, 'text/css', $download, $downloadFileName ); $output = Bootstrap::streamCSSBigFile( $typearray[0] ); - print $output; + echo $output; return; } @@ -397,7 +397,7 @@ class Bootstrap break; case 'php': if ($download) { - G::sendHeaders( $filename, 'text/plain', $download, $downloadFileName ); + Bootstrap::sendHeaders( $filename, 'text/plain', $download, $downloadFileName ); } else { require_once ($filename); return; @@ -469,6 +469,10 @@ class Bootstrap * return true if the file exists, otherwise false. */ public function isPMUnderUpdating($setFlag = 2) { + if (!defined('PATH_DATA')) { + return false; + } + $fileCheck = PATH_DATA . "UPDATE.dat"; if ($setFlag == 0) { if (file_exists ( $fileCheck )) { @@ -1101,7 +1105,11 @@ class Bootstrap // if ( ereg("msie", $userAgent)) { header ( 'Pragma: cache' ); - $mtime = filemtime ( $filename ); + if (file_exists ( $filename )) { + $mtime = filemtime ( $filename ); + } else { + $mtime = date ( 'U' ); + } $gmt_mtime = gmdate ( "D, d M Y H:i:s", $mtime ) . " GMT"; header ( 'ETag: "' . md5 ( $mtime . $filename ) . '"' ); header ( "Last-Modified: " . $gmt_mtime ); diff --git a/gulliver/system/class.form.php b/gulliver/system/class.form.php index 1c335d25c..b0d1c1a8e 100755 --- a/gulliver/system/class.form.php +++ b/gulliver/system/class.form.php @@ -236,6 +236,14 @@ class Form extends XmlForm foreach ($newValues[$k] as $j => $item) { if ($this->fields[$k]->validateValue( $newValues[$k][$j], $this )) { $this->values[$k][$j] = $newValues[$k][$j]; + + switch ($this->fields[$k]->type) { + case "link": + if (isset($newValues[$k . "_label"][$j])) { + $this->values[$k . "_label"][$j] = $newValues[$k . "_label"][$j]; + } + break; + } } } if ((sizeof( $this->values[$k] ) === 1) && ($v->type !== 'grid') && isset( $this->values[$k][0] )) { @@ -247,6 +255,14 @@ class Form extends XmlForm } else { if ($this->fields[$k]->validateValue( $newValues[$k], $this )) { $this->values[$k] = $newValues[$k]; + + switch ($this->fields[$k]->type) { + case "link": + if (isset($newValues[$k . "_label"])) { + $this->values[$k . "_label"] = $newValues[$k . "_label"]; + } + break; + } } } } @@ -331,7 +347,6 @@ class Form extends XmlForm if (($v->type != 'submit')) { if ($v->type != 'file') { if (array_key_exists( $k, $newValues )) { - switch ($v->type) { case 'radiogroup': $values[$k] = $newValues[$k]; @@ -414,6 +429,10 @@ class Form extends XmlForm } } break; + case "link": + $values[$k] = $newValues[$k]; + $values[$k . "_label"] = $newValues[$k . "_label"]; + break; case 'grid': foreach ($newValues[$k] as $j => $item) { if (is_array( $item )) { @@ -457,6 +476,10 @@ class Form extends XmlForm } } break; + case "link": + $values[$k][$j] = $newValues[$k][$j]; + $values[$k][$j][$kk . "_label"] = $newValues[$k][$j][$kk . "_label"]; + break; default: //If there are no dropdowns previously setted and the evaluated field is not a dropdown //only then rewritte the $values diff --git a/gulliver/system/class.headPublisher.php b/gulliver/system/class.headPublisher.php index 3f447dc11..4d71d8e92 100644 --- a/gulliver/system/class.headPublisher.php +++ b/gulliver/system/class.headPublisher.php @@ -9,7 +9,7 @@ * Copyright (C) 2004 - 2011 Colosa Inc. * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as$translationsFile = "/js/ext/translation." . SYS_LANG . ".js"; + * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * @@ -230,6 +230,7 @@ class headPublisher } $head .= $this->headerScript; $head .= "\n"; + $head .= "\n"; return $head; } diff --git a/gulliver/system/class.webResource.php b/gulliver/system/class.webResource.php index a64d3596d..021d00ba9 100755 --- a/gulliver/system/class.webResource.php +++ b/gulliver/system/class.webResource.php @@ -109,7 +109,7 @@ class WebResource } /* end class WebResource */ -if (! function_exists( 'json_encode' )) { +/*if (! function_exists( 'json_encode' )) { G::LoadThirdParty( 'pear/json', 'class.json' ); function json_encode (&$value) @@ -127,5 +127,5 @@ if (! function_exists( 'json_decode' )) { $json = new Services_JSON(); return $json->decode( $value ); } -} +}*/ diff --git a/gulliver/system/class.xmlform.php b/gulliver/system/class.xmlform.php index 43fd2b10f..56c7ea2a2 100755 --- a/gulliver/system/class.xmlform.php +++ b/gulliver/system/class.xmlform.php @@ -2495,19 +2495,54 @@ class XmlForm_Field_Link extends XmlForm_Field * @param string value * @return string */ - public function render ($value = null, $owner = null) + public function render($value = null, $label = null, $owner = null, $row = -1) { - $onclick = G::replaceDataField( $this->onclick, $owner->values ); - $link = G::replaceDataField( $this->link, $owner->values ); - $target = G::replaceDataField( $this->target, $owner->values ); - $value = G::replaceDataField( $this->value, $owner->values ); - $label = G::replaceDataField( $this->label, $owner->values ); - $html = 'htmlentities( $link, ENT_QUOTES, 'utf-8' ) . '\''; - $html .= 'id="form[' . $this->name . ']" name="form[' . $this->name . ']" style="' . htmlentities( $this->style, ENT_QUOTES, 'utf-8' ) . '" '; - $html .= (($this->onclick) ? ' onclick="' . htmlentities( $onclick, ENT_QUOTES, 'utf-8' ) . '"' : ''); - $html .= (($this->target) ? ' target="' . htmlentities( $target, ENT_QUOTES, 'utf-8' ) . '"' : '') . '>'; - $html .= $this->htmlentities( $this->value === '' ? $label : $value, ENT_QUOTES, 'utf-8' ) . ''; - $html .= $this->renderHint(); + $id = null; + $v = null; + + switch ($owner->type) { + case "grid": + $id = $owner->name . "][" . $row . "][" . $this->name; + $v = (isset($owner->values[$owner->name][$row]))? $owner->values[$owner->name][$row] : array(); + break; + default: + $id = $this->name; + $v = $owner->values; + break; + } + + $link = (!empty($value))? $value : G::replaceDataField($this->link, $v); + $labelAux1 = (!empty($label))? $label : G::replaceDataField($this->label, $v); + $labelAux2 = (!empty($label))? $label : G::replaceDataField($this->value, $v); + $onclick = G::replaceDataField($this->onclick, $v); + $target = G::replaceDataField($this->target, $v); + + $html = "htmlentities($link, ENT_QUOTES, "utf-8") . "\""; + $html = $html . " id=\"form[$id]\" name=\"form[$id]\" pm:field=\"pm:field\""; + $html = $html . (($this->onclick)? " onclick=\"" . htmlentities($onclick, ENT_QUOTES, "utf-8") . "\"" : null); + $html = $html . (($this->target)? " target=\"" . htmlentities($target, ENT_QUOTES, "utf-8") . "\"" : null); + + switch ($owner->type) { + case "grid": + if ($this->mode == "view") { + $html = $html . " style=\"color: #006699; text-decoration: none; font-weight: normal;\""; + } + break; + default: + $html = $html . " style=\"" . htmlentities($this->style, ENT_QUOTES, "utf-8") . "\""; + break; + } + + $html = $html . ">" . $this->htmlentities(($this->value == "")? $labelAux1 : $labelAux2, ENT_QUOTES, "utf-8") . ""; + + switch ($owner->type) { + case "grid": + break; + default: + $html = $html . $this->renderHint(); + break; + } + return $html; } @@ -2518,30 +2553,22 @@ class XmlForm_Field_Link extends XmlForm_Field * @param $owner * @return */ - public function renderGrid ($values = array(), $owner = null) + public function renderGrid($value = array(), $label = array(), $owner = null) { - $result = array (); - $r = 1; - foreach ($values as $v) { - $_aData_ = (isset( $owner->values[$owner->name][$r] ) ? $owner->values[$owner->name][$r] : array ()); - $onclick = G::replaceDataField( $this->onclick, $_aData_ ); - $link = G::replaceDataField( $this->link, $_aData_ ); - $target = G::replaceDataField( $this->target, $_aData_ ); - $value = G::replaceDataField( $this->value, $_aData_ ); - $label = G::replaceDataField( $this->label, $_aData_ ); - $html = 'htmlentities( $link, ENT_QUOTES, 'utf-8' ) . '\''; - $html .= 'id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']"'; - $html .= 'name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']"'; - $html .= (($this->onclick) ? ' onclick="' . htmlentities( $onclick, ENT_QUOTES, 'utf-8' ) . '"' : ''); - $html .= (($this->target) ? ' target="' . htmlentities( $target, ENT_QUOTES, 'utf-8' ) . '"' : ''); - if ($this->mode == 'view') { - $html .= 'style="color: #006699; text-decoration: none;font-weight: normal;"'; - } - $html .= '>' . $this->htmlentities( $this->value === '' ? $label : $value, ENT_QUOTES, 'utf-8' ) . ''; - $result[] = $html; - $r ++; + $arrayResult = array(); + $row = 1; + + foreach ($value as $index => $v) { + $arrayResult[] = $this->render( + (isset($value[$index]))? $value[$index] : null, + (isset($label[$index]))? $label[$index] : null, + $owner, + $row + ); + $row = $row + 1; } - return $result; + + return $arrayResult; } /** @@ -5246,7 +5273,18 @@ class xmlformTemplate extends Smarty } $result['form'][$k] = $form->fields[$k]->renderGrid( $aAux, $form ); } else { - $result['form'][$k] = $form->fields[$k]->render( $value, $form ); + switch ($v->type) { + case "link": + $result["form"][$k] = $form->fields[$k]->render( + $value, + (isset($form->values[$k . "_label"]))? $form->values[$k . "_label"] : null, + $form + ); + break; + default: + $result["form"][$k] = $form->fields[$k]->render($value, $form); + break; + } } } else { /*if (isset ( $form->owner )) { @@ -5270,6 +5308,13 @@ class xmlformTemplate extends Smarty case "file": $result["form"][$k] = $form->fields[$k]->renderGrid( $value, $form, $therow ); break; + case "link": + $result["form"][$k] = $form->fields[$k]->renderGrid( + $value, + (isset($form->values[$k . "_label"]))? $form->values[$k . "_label"] : array(), + $form + ); + break; default: $result["form"][$k] = $form->fields[$k]->renderGrid( $value, $form ); break; diff --git a/rbac/engine/classes/plugins/class.ldap.php b/rbac/engine/classes/plugins/class.ldap.php index 1bd1f1872..42d6d50a9 100755 --- a/rbac/engine/classes/plugins/class.ldap.php +++ b/rbac/engine/classes/plugins/class.ldap.php @@ -147,18 +147,21 @@ class LDAP $sKeyword .= '*'; } } + + $additionalFilter = isset($aAuthSource['AUTH_SOURCE_DATA']['AUTH_SOURCE_ADDITIONAL_FILTER']) ? trim($aAuthSource['AUTH_SOURCE_DATA']['AUTH_SOURCE_ADDITIONAL_FILTER']) : ''; + $sFilter = '(&(|(objectClass=*))'; - + if ( isset( $aAuthSource['AUTH_SOURCE_DATA']['LDAP_TYPE']) && $aAuthSource['AUTH_SOURCE_DATA']['LDAP_TYPE'] == 'ad' ) { - $sFilter = "(&(|(objectClass=*))(|(samaccountname=$sKeyword)(userprincipalname=$sKeyword))(objectCategory=person))"; + $sFilter = "(&(|(objectClass=*))(|(samaccountname=$sKeyword)(userprincipalname=$sKeyword))$additionalFilter)"; } else - $sFilter = "(&(|(objectClass=*))(|(uid=$sKeyword)(cn=$sKeyword)))"; + $sFilter = "(&(|(objectClass=*))(|(uid=$sKeyword)(cn=$sKeyword))$additionalFilter)"; //G::pr($sFilter); $aUsers = array(); $oSearch = @ldap_search($oLink, $aAuthSource['AUTH_SOURCE_BASE_DN'], $sFilter, array('dn','uid','samaccountname', 'cn','givenname','sn','mail','userprincipalname','objectcategory', 'manager')); - + if ($oError = @ldap_errno($oLink)) { return $aUsers; } @@ -179,7 +182,7 @@ class LDAP 'sFirstname' => isset($aAttr['givenname']) ? $aAttr['givenname'] : '', 'sLastname' => isset($aAttr['sn']) ? $aAttr['sn'] : '', 'sEmail' => isset($aAttr['mail']) ? $aAttr['mail'] : ( isset($aAttr['userprincipalname'])?$aAttr['userprincipalname'] : '') , - 'sDN' => $aAttr['dn'] ); + 'sDN' => $aAttr['dn'] ); } } while ($oEntry = @ldap_next_entry($oLink, $oEntry)); } diff --git a/workflow/engine/bin/cron_single.php b/workflow/engine/bin/cron_single.php index 9a2b984b3..0aa1f4ced 100755 --- a/workflow/engine/bin/cron_single.php +++ b/workflow/engine/bin/cron_single.php @@ -89,12 +89,62 @@ if (!defined('PATH_HOME')) { define ('TIME_ZONE', $config['time_zone']); } -require_once ("classes/model/Configuration.php"); -require_once ("classes/model/AppCacheView.php"); -require_once ("classes/model/AppDelegation.php"); -require_once ("classes/model/Event.php"); -require_once ("classes/model/AppEvent.php"); -require_once ("classes/model/CaseScheduler.php"); +require_once (PATH_GULLIVER . PATH_SEP . 'class.bootstrap.php'); +//define( 'PATH_GULLIVER_HOME', PATH_TRUNK . 'gulliver' . PATH_SEP ); + +spl_autoload_register(array('Bootstrap', 'autoloadClass')); + +Bootstrap::registerClass('BaseConfiguration', PATH_HOME . "engine/classes/model/om/BaseConfiguration.php"); +Bootstrap::registerClass('Configuration', PATH_HOME . "engine/classes/model/Configuration.php"); + +Bootstrap::registerClass('EventPeer', PATH_HOME . "engine/classes/model/EventPeer.php"); +Bootstrap::registerClass('ApplicationPeer', PATH_HOME . "engine/classes/model/ApplicationPeer.php"); + +Bootstrap::registerClass('BaseGroupUser', PATH_HOME . "engine/classes/model/om/BaseGroupUser.php"); +Bootstrap::registerClass('BaseUsers', PATH_HOME . "engine/classes/model/om/BaseUsers.php"); +Bootstrap::registerClass('BaseProcess', PATH_HOME . "engine/classes/model/om/BaseProcess.php"); +Bootstrap::registerClass('BaseContentPeer', PATH_HOME . "engine/classes/model/om/BaseContentPeer.php"); +Bootstrap::registerClass('BaseContent', PATH_HOME . "engine/classes/model/om/BaseContent.php"); +Bootstrap::registerClass('BaseLogCasesScheduler', PATH_HOME . "engine/classes/model/om/BaseLogCasesScheduler.php"); +Bootstrap::registerClass('BaseApplication', PATH_HOME . "engine/classes/model/om/BaseApplication.php"); +Bootstrap::registerClass('BaseEvent', PATH_HOME . "engine/classes/model/om/BaseEvent.php"); +Bootstrap::registerClass('BaseEventPeer', PATH_HOME . "engine/classes/model/om/BaseEventPeer.php"); +Bootstrap::registerClass('BaseTriggers', PATH_HOME . "engine/classes/model/om/BaseTriggers.php"); +Bootstrap::registerClass('BaseTriggersPeer', PATH_HOME . "engine/classes/model/om/BaseTriggersPeer.php"); +Bootstrap::registerClass('BaseAppMessage', PATH_HOME . "engine/classes/model/om/BaseAppMessage.php"); +Bootstrap::registerClass('BaseAppMessagePeer', PATH_HOME . "engine/classes/model/om/BaseAppMessagePeer.php"); + +Bootstrap::registerClass('BaseAppDelegation', PATH_HOME . "engine/classes/model/om/BaseAppDelegation.php"); +Bootstrap::registerClass('BaseHoliday', PATH_HOME . "engine/classes/model/om/BaseHoliday.php"); +Bootstrap::registerClass('BaseHolidayPeer', PATH_HOME . "engine/classes/model/om/BaseHolidayPeer.php"); +Bootstrap::registerClass('BaseTask', PATH_HOME . "engine/classes/model/om/BaseTask.php"); +Bootstrap::registerClass('BaseTaskPeer', PATH_HOME . "engine/classes/model/om/BaseTaskPeer.php"); +Bootstrap::registerClass('HolidayPeer', PATH_HOME . "engine/classes/model/HolidayPeer.php"); +Bootstrap::registerClass('Holiday', PATH_HOME . "engine/classes/model/Holiday.php"); + +Bootstrap::registerClass('Task', PATH_HOME . "engine/classes/model/Task.php"); +Bootstrap::registerClass('TaskPeer', PATH_HOME . "engine/classes/model/TaskPeer.php"); +Bootstrap::registerClass('dates', PATH_HOME . "engine/classes/class.dates.php"); +Bootstrap::registerClass('AppDelegation', PATH_HOME . "engine/classes/model/AppDelegation.php"); +Bootstrap::registerClass('AppDelegationPeer', PATH_HOME . "engine/classes/model/AppDelegationPeer.php"); +Bootstrap::registerClass('BaseAppDelay', PATH_HOME . "engine/classes/model/om/BaseAppDelay.php"); +Bootstrap::registerClass('AppDelayPeer', PATH_HOME . "engine/classes/model/AppDelayPeer.php"); +Bootstrap::registerClass('AppDelay', PATH_HOME . "engine/classes/model/AppDelay.php"); +Bootstrap::registerClass('BaseAdditionalTables',PATH_HOME . "engine/classes/model/om/BaseAdditionalTables.php"); +Bootstrap::registerClass('AdditionalTables', PATH_HOME . "engine/classes/model/AdditionalTables.php"); +Bootstrap::registerClass('BaseAppCacheView', PATH_HOME . "engine/classes/model/om/BaseAppCacheView.php"); +Bootstrap::registerClass('AppCacheView', PATH_HOME . "engine/classes/model/AppCacheView.php"); +Bootstrap::registerClass('AppCacheViewPeer', PATH_HOME . "engine/classes/model/AppCacheViewPeer.php"); + +Bootstrap::registerClass('BaseEvent', PATH_HOME . "engine/classes/model/om/BaseEvent.php"); +Bootstrap::registerClass('Event', PATH_HOME . "engine/classes/model/Event.php"); + +Bootstrap::registerClass('BaseAppEvent', PATH_HOME . "engine/classes/model/om/BaseAppEvent.php"); +Bootstrap::registerClass('AppEvent', PATH_HOME . "engine/classes/model/AppEvent.php"); +Bootstrap::registerClass('AppEventPeer', PATH_HOME . "engine/classes/model/AppEventPeer.php"); + +Bootstrap::registerClass('BaseCaseScheduler', PATH_HOME . "engine/classes/model/om/BaseCaseScheduler.php"); +Bootstrap::registerClass('CaseScheduler', PATH_HOME . "engine/classes/model/CaseScheduler.php"); G::LoadClass("case"); G::LoadClass("dates"); diff --git a/workflow/engine/bin/tasks/libraries.json b/workflow/engine/bin/tasks/libraries.json index 0281a861e..c7365cd89 100644 --- a/workflow/engine/bin/tasks/libraries.json +++ b/workflow/engine/bin/tasks/libraries.json @@ -135,6 +135,12 @@ "mini": "gulliver/js/maborak/core/module.dom.js", "minify": true }, + { + "name": "module.abbr", + "full": "gulliver/js/maborak/core/module.abbr.js", + "mini": "gulliver/js/maborak/core/module.abbr.js", + "minify": true + }, { "name": "module.dashboard", "full": "gulliver/js/maborak/core/module.dashboard.js", diff --git a/workflow/engine/classes/class.case.php b/workflow/engine/classes/class.case.php index b731cac28..250ebe228 100755 --- a/workflow/engine/classes/class.case.php +++ b/workflow/engine/classes/class.case.php @@ -3467,6 +3467,201 @@ class Cases } } + /** + * Add a input document + * + * Return the application document ID + * + * @param string $inputDocumentUid Input document ID + * @param string $appDocUid Application document ID + * @param int $docVersion Document version + * @param string $appDocType Document type + * @param string $appDocComment Document comment + * @param string $inputDocumentAction Action, posible values: null or empty (Add), "R" (Replace), "NV" (New Version) + * @param string $applicationUid Application ID + * @param int $delIndex Delegation index + * @param string $taskUid Task ID + * @param string $userUid User ID + * @param string $option Option, posible values: "xmlform", "file" + * @param string $file File ($_FILES["form"]["name"]["APP_DOC_FILENAME"] or path to file) + * @param int $fileError File error ($_FILES["form"]["error"]["APP_DOC_FILENAME"] or 0) + * @param string $fileTmpName File temporal name ($_FILES["form"]["tmp_name"]["APP_DOC_FILENAME"] or null) + * @return string Return application document ID + */ + public function addInputDocument( + $inputDocumentUid, + $appDocUid, + $docVersion, + $appDocType, + $appDocComment, + $inputDocumentAction, + $applicationUid, + $delIndex, + $taskUid, + $userUid, + $option, + $file, + $fileError = 0, + $fileTmpName = null + ) { + $appDocFileName = null; + $sw = 0; + + switch ($option) { + case "xmlform": + $appDocFileName = $file; + + if ($fileError == 0) { + $sw = 1; + } + break; + case "file": + $appDocFileName = basename($file); + + if (file_exists($file) && is_file($file)) { + $sw = 1; + } + break; + } + + if ($sw == 0) { + return null; + } + + //Info + $inputDocument = new InputDocument(); + $arrayInputDocumentData = $inputDocument->load($inputDocumentUid); + + //Get the Custom Folder ID (create if necessary) + $appFolder = new AppFolder(); + $folderId = $appFolder->createFromPath($arrayInputDocumentData["INP_DOC_DESTINATION_PATH"], $applicationUid); + + $tags = $appFolder->parseTags($arrayInputDocumentData["INP_DOC_TAGS"], $applicationUid); + + $appDocument = new AppDocument(); + $arrayField = array(); + + switch ($inputDocumentAction) { + case "R": + //Replace + $arrayField = array( + "APP_DOC_UID" => $appDocUid, + "APP_UID" => $applicationUid, + "DOC_VERSION" => $docVersion, + "DEL_INDEX" => $delIndex, + "USR_UID" => $userUid, + "DOC_UID" => $inputDocumentUid, + "APP_DOC_TYPE" => $appDocType, + "APP_DOC_CREATE_DATE" => date("Y-m-d H:i:s"), + "APP_DOC_COMMENT" => $appDocComment, + "APP_DOC_TITLE" => "", + "APP_DOC_FILENAME" => $appDocFileName, + "FOLDER_UID" => $folderId, + "APP_DOC_TAGS" => $tags + ); + + $appDocument->update($arrayField); + break; + case "NV": + //New Version + $arrayField = array( + "APP_DOC_UID" => $appDocUid, + "APP_UID" => $applicationUid, + "DEL_INDEX" => $delIndex, + "USR_UID" => $userUid, + "DOC_UID" => $inputDocumentUid, + "APP_DOC_TYPE" => $appDocType, + "APP_DOC_CREATE_DATE" => date("Y-m-d H:i:s"), + "APP_DOC_COMMENT" => $appDocComment, + "APP_DOC_TITLE" => "", + "APP_DOC_FILENAME" => $appDocFileName, + "FOLDER_UID" => $folderId, + "APP_DOC_TAGS" => $tags + ); + + $appDocument->create($arrayField); + break; + default: + //New + $arrayField = array( + "APP_UID" => $applicationUid, + "DEL_INDEX" => $delIndex, + "USR_UID" => $userUid, + "DOC_UID" => $inputDocumentUid, + "APP_DOC_TYPE" => $appDocType, + "APP_DOC_CREATE_DATE" => date("Y-m-d H:i:s"), + "APP_DOC_COMMENT" => $appDocComment, + "APP_DOC_TITLE" => "", + "APP_DOC_FILENAME" => $appDocFileName, + "FOLDER_UID" => $folderId, + "APP_DOC_TAGS" => $tags + ); + + $appDocument->create($arrayField); + break; + } + + //Save the file + $appDocUid = $appDocument->getAppDocUid(); + $docVersion = $appDocument->getDocVersion(); + $arrayInfo = pathinfo($appDocument->getAppDocFilename()); + $extension = (isset($arrayInfo["extension"]))? $arrayInfo["extension"] : null; + $strPathName = PATH_DOCUMENT . $applicationUid . PATH_SEP; + $strFileName = $appDocUid . "_" . $docVersion . "." . $extension; + + switch ($option) { + case "xmlform": + G::uploadFile($fileTmpName, $strPathName, $strFileName); + break; + case "file": + $umaskOld = umask(0); + + if (!is_dir($strPathName)) { + G::verifyPath($strPathName, true); + } + + copy($file, $strPathName . $strFileName); + chmod($strPathName . $strFileName, 0666); + umask($umaskOld); + break; + } + + //Plugin Hook PM_UPLOAD_DOCUMENT for upload document + $pluginRegistry = &PMPluginRegistry::getSingleton(); + + if ($pluginRegistry->existsTrigger(PM_UPLOAD_DOCUMENT) && class_exists("uploadDocumentData")) { + $triggerDetail = $pluginRegistry->getTriggerInfo(PM_UPLOAD_DOCUMENT); + $documentData = new uploadDocumentData( + $applicationUid, + $userUid, + $strPathName . $strFileName, + $arrayField["APP_DOC_FILENAME"], + $appDocUid, + $docVersion + ); + $uploadReturn = $pluginRegistry->executeTriggers(PM_UPLOAD_DOCUMENT, $documentData); + + if ($uploadReturn) { + $arrayField["APP_DOC_PLUGIN"] = $triggerDetail->sNamespace; + + if (!isset($arrayField["APP_DOC_UID"])) { + $arrayField["APP_DOC_UID"] = $appDocUid; + } + + if (!isset($arrayField["DOC_VERSION"])) { + $arrayField["DOC_VERSION"] = $docVersion; + } + + $appDocument->update($arrayField); + + unlink($strPathName . $strFileName); + } + } + //End plugin + + return $appDocUid; + } + /* * Return the input documents list to Review * @@ -4717,10 +4912,10 @@ class Cases if ($sTo != null) { $oSpool = new spoolRun(); - if ($aConfiguration['MESS_RAUTH'] == false || (is_string($aConfiguration['MESS_RAUTH']) && $aConfiguration['MESS_RAUTH'] == 'false')) { - $aConfiguration['MESS_RAUTH'] = 0; - } else { - $aConfiguration['MESS_RAUTH'] = 1; + if ($aConfiguration['MESS_RAUTH'] == false || (is_string($aConfiguration['MESS_RAUTH']) && $aConfiguration['MESS_RAUTH'] == 'false')) { + $aConfiguration['MESS_RAUTH'] = 0; + } else { + $aConfiguration['MESS_RAUTH'] = 1; } $oSpool->setConfig(array( diff --git a/workflow/engine/classes/class.dynaformEditor.php b/workflow/engine/classes/class.dynaformEditor.php index ec01b0181..308863436 100755 --- a/workflow/engine/classes/class.dynaformEditor.php +++ b/workflow/engine/classes/class.dynaformEditor.php @@ -219,6 +219,7 @@ class dynaformEditor extends WebResource //for showHide tab option @Neyek $G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_CONDITIONS_EDITOR"), $sName . '[9]', 'dynaformEditor.changeToShowHide', 'dynaformEditor.saveShowHide'); $G_PUBLISH->AddContent('panel-close'); + $oHeadPublisher->addScriptFile("/js/maborak/core/maborak.loader.js",2); $oHeadPublisher->addScriptFile('/jscore/dynaformEditor/core/dynaformEditor.js'); //$oHeadPublisher->addScriptFile('/js/dveditor/core/dveditor.js'); //$oHeadPublisher->addScriptFile('/codepress/codepress.js',1); diff --git a/workflow/engine/classes/class.pmFunctions.php b/workflow/engine/classes/class.pmFunctions.php index e7a772d23..937b8bdd5 100755 --- a/workflow/engine/classes/class.pmFunctions.php +++ b/workflow/engine/classes/class.pmFunctions.php @@ -786,12 +786,25 @@ function getEmailConfiguration () * @param string(32) | $sTemplate | Name of the template | The name of the template file in plain text or HTML format which will produce the body of the email. * @param array | $aFields | An optional associative array | Optional parameter. An associative array where the keys are the variable names and the values are the variables' values. * @param array | $aAttachment | Attachment | An Optional arrray. An array of files (full paths) to be attached to the email. + * @param boolean | $showMessage = true | Show message | Optional parameter. + * @param int | $delIndex = 0 | Delegation index of the case | Optional parameter. The delegation index of the current task in the case. * @return int | $result | result | Result of sending email * */ //@param array | $aFields=array() | An associative array optional | Optional parameter. An associative array where the keys are the variable name and the values are the variable's value. -function PMFSendMessage ($caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $aFields = array(), $aAttachment = array(), $showMessage = true) -{ +function PMFSendMessage( + $caseId, + $sFrom, + $sTo, + $sCc, + $sBcc, + $sSubject, + $sTemplate, + $aFields = array(), + $aAttachment = array(), + $showMessage = true, + $delIndex = 0 +) { global $oPMScript; if (isset( $oPMScript->aFields ) && is_array( $oPMScript->aFields )) { @@ -802,9 +815,22 @@ function PMFSendMessage ($caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTempla } } - G::LoadClass( 'wsBase' ); + G::LoadClass("wsBase"); + $ws = new wsBase(); - $result = $ws->sendMessage( $caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $aFields, $aAttachment, $showMessage); + $result = $ws->sendMessage( + $caseId, + $sFrom, + $sTo, + $sCc, + $sBcc, + $sSubject, + $sTemplate, + $aFields, + $aAttachment, + $showMessage, + $delIndex + ); if ($result->status_code == 0) { return 1; @@ -1420,6 +1446,65 @@ function PMFUserList () //its test was successfull return $rows; } +/** + * @method + * + * Add a input document. + * + * @name PMFAddInputDocument + * @label PMF Add a input document. + * @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFAddInputDocument.28.29 + * + * @param string(32) | $inputDocumentUid | ID of the input document | The unique ID of the input document. + * @param string(32) | $appDocUid | ID of the application document | The unique ID of the application document; if action is set to null or empty (Add), then this parameter it set to null or empty. + * @param int | $docVersion | Document version | Document version. + * @param string | $appDocType = "INPUT" | Document type | Document type. + * @param string | $appDocComment | Document comment | Document comment. + * @param string | $inputDocumentAction | Action | Action, posible values: null or empty (Add), "R" (Replace), "NV" (New Version). + * @param string(32) | $caseUid | ID of the case | The unique ID of the case. + * @param int | $delIndex | Delegation index of the case | The delegation index of the current task in the case. + * @param string(32) | $taskUid | ID of the task | The unique ID of the task. + * @param string(32) | $userUid | ID user | The unique ID of the user who will add a input document. + * @param string | $option = "file" | Option | Option, value: "file". + * @param string | $file = "path_to_file/myfile.txt" | File, path to file | File, path to file. + * @return string | $appDocUid | ID of the application document | Returns ID if it has added the input document successfully; otherwise, returns null or empty if an error occurred. + * + */ +function PMFAddInputDocument( + $inputDocumentUid, + $appDocUid, + $docVersion, + $appDocType = "INPUT", + $appDocComment, + $inputDocumentAction, + $caseUid, + $delIndex, + $taskUid, + $userUid, + $option = "file", + $file = "path_to_file/myfile.txt" +) { + G::LoadClass("case"); + $case = new Cases(); + + $appDocUid = $case->addInputDocument( + $inputDocumentUid, + $appDocUid, + $docVersion, + $appDocType, + $appDocComment, + $inputDocumentAction, + $caseUid, + $delIndex, + $taskUid, + $userUid, + $option, + $file + ); + + return $appDocUid; +} + /** * * @method Generates an Output Document @@ -2339,10 +2424,13 @@ function PMFGetCaseNotes ($applicationID, $type = 'array', $userUid = '') /** * - * @method Delete a specified case. + * @method + * + * Delete a specified case. * * @name PMFDeleteCase * @label PMF Delete a specified case. + * @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFDeleteCase.28.29 * * @param string(32) | $caseUid | ID of the case | The unique ID of the case. * @return int | $result | Result of the elimination | Returns 1 if the case is delete successfully; otherwise, returns 0 if an error occurred. @@ -2364,10 +2452,13 @@ function PMFDeleteCase ($caseUid) /** * - * @method Cancel a specified case. + * @method + * + * Cancel a specified case. * * @name PMFCancelCase * @label PMF Cancel a specified case. + * @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFCancelCase.28.29 * * @param string(32) | $caseUid | ID of the case | The unique ID of the case. * @param int | $delIndex | Delegation index of the case | The delegation index of the current task in the case. @@ -2401,10 +2492,13 @@ function PMFCancelCase ($caseUid, $delIndex, $userUid) /** * - * @method Pauses a specified case. + * @method + * + * Pauses a specified case. * * @name PMFPauseCase * @label PMF Pauses a specified case. + * @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFPauseCase.28.29 * * @param string(32) | $caseUid | ID of the case | The unique ID of the case. * @param int | $delIndex | Delegation index of the case | The delegation index of the current task in the case. @@ -2439,10 +2533,13 @@ function PMFPauseCase ($caseUid, $delIndex, $userUid, $unpauseDate = null) /** * - * @method Unpause a specified case. + * @method + * + * Unpause a specified case. * * @name PMFUnpauseCase * @label PMF Unpause a specified case. + * @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFUnpauseCase.28.29 * * @param string(32) | $caseUid | ID of the case | The unique ID of the case. * @param int | $delIndex | Delegation index of the case | The delegation index of the current task in the case. @@ -2466,10 +2563,13 @@ function PMFUnpauseCase ($caseUid, $delIndex, $userUid) /** * - * @method Add case note. + * @method + * + * Add case note. * * @name PMFAddCaseNote * @label PMF Add case note + * @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFAddCaseNote.28.29 * * @param string(32) | $caseUid | ID of the case | The unique ID of the case. * @param string(32) | $processUid | ID of the process | The unique ID of the process. diff --git a/workflow/engine/classes/class.processMap.php b/workflow/engine/classes/class.processMap.php index 9e0b12506..35dd9ba6d 100755 --- a/workflow/engine/classes/class.processMap.php +++ b/workflow/engine/classes/class.processMap.php @@ -28,41 +28,41 @@ * * @package workflow.engine.ProcessMaker */ -G::LoadThirdParty( 'pear/json', 'class.json' ); -G::LoadClass( 'groups' ); -G::LoadClass( 'tasks' ); +//G::LoadThirdParty( 'pear/json', 'class.json' ); +//G::LoadClass( 'groups' ); +//G::LoadClass( 'tasks' ); G::LoadClass( 'xmlfield_InputPM' ); -G::LoadClass( 'calendar' ); +//G::LoadClass( 'calendar' ); -require_once 'classes/model/AppDelegation.php'; -require_once 'classes/model/CaseTracker.php'; -require_once 'classes/model/CaseTrackerObject.php'; -require_once 'classes/model/Configuration.php'; -require_once 'classes/model/Content.php'; -require_once 'classes/model/DbSource.php'; -require_once 'classes/model/Dynaform.php'; -require_once 'classes/model/Event.php'; -require_once 'classes/model/Groupwf.php'; -require_once 'classes/model/InputDocument.php'; -require_once 'classes/model/ObjectPermission.php'; -require_once 'classes/model/OutputDocument.php'; -require_once 'classes/model/Process.php'; -require_once 'classes/model/ProcessUser.php'; -require_once 'classes/model/ReportTable.php'; -require_once 'classes/model/Route.php'; -require_once 'classes/model/CaseScheduler.php'; -require_once 'classes/model/LogCasesScheduler.php'; -require_once 'classes/model/Step.php'; -require_once 'classes/model/StepSupervisor.php'; -require_once 'classes/model/StepTrigger.php'; -require_once 'classes/model/SubProcess.php'; -require_once 'classes/model/SwimlanesElements.php'; -require_once 'classes/model/Task.php'; -require_once 'classes/model/TaskUser.php'; -require_once 'classes/model/Triggers.php'; -require_once 'classes/model/Users.php'; -require_once 'classes/model/Gateway.php'; -require_once 'classes/model/om/BaseUsers.php'; +//require_once 'classes/model/AppDelegation.php'; +//require_once 'classes/model/CaseTracker.php'; +//require_once 'classes/model/CaseTrackerObject.php'; +//require_once 'classes/model/Configuration.php'; +//require_once 'classes/model/Content.php'; +//require_once 'classes/model/DbSource.php'; +//require_once 'classes/model/Dynaform.php'; +//require_once 'classes/model/Event.php'; +//require_once 'classes/model/Groupwf.php'; +//require_once 'classes/model/InputDocument.php'; +//require_once 'classes/model/ObjectPermission.php'; +//require_once 'classes/model/OutputDocument.php'; +//require_once 'classes/model/Process.php'; +//require_once 'classes/model/ProcessUser.php'; +//require_once 'classes/model/ReportTable.php'; +//require_once 'classes/model/Route.php'; +//require_once 'classes/model/CaseScheduler.php'; +//require_once 'classes/model/LogCasesScheduler.php'; +//require_once 'classes/model/Step.php'; +//require_once 'classes/model/StepSupervisor.php'; +//require_once 'classes/model/StepTrigger.php'; +//require_once 'classes/model/SubProcess.php'; +//require_once 'classes/model/SwimlanesElements.php'; +//require_once 'classes/model/Task.php'; +//require_once 'classes/model/TaskUser.php'; +//require_once 'classes/model/Triggers.php'; +//require_once 'classes/model/Users.php'; +//require_once 'classes/model/Gateway.php'; +//require_once 'classes/model/om/BaseUsers.php'; /** * processMap - Process Map class @@ -418,8 +418,8 @@ class processMap $oPM->taskOptions[] = $taskOption; } - $oJSON = new Services_JSON(); - return $oJSON->encode( $oPM ); + //$oJSON = new Services_JSON(); + return Bootstrap::json_encode($oPM);//$oJSON->encode( $oPM ); } catch (Exception $oError) { throw ($oError); } @@ -1426,9 +1426,8 @@ class processMap $oNewTask->statusIcons = array (); $oNewTask->statusIcons[] = array ('label' => '','icon' => '/images/alert.gif','message' => '','url' => '' ); - $oJSON = new Services_JSON(); - - return $oJSON->encode( $oNewTask ); + //$oJSON = new Services_JSON(); + return Bootstrap::json_encode($oNewTask);//$oJSON->encode( $oNewTask ); } catch (Exception $oError) { throw ($oError); } @@ -1669,8 +1668,8 @@ class processMap $oGateway->update( $aData ); } $oEncode->uid = $sGat_uid; - $oJSON = new Services_JSON(); - return $oJSON->encode( $oEncode ); + //$oJSON = new Services_JSON(); + return Bootstrap::json_encode($oEncode);//$oJSON->encode( $oEncode ); } catch (Exception $oError) { throw ($oError); } @@ -1700,8 +1699,8 @@ class processMap ) ); break; } - $oJSON = new Services_JSON(); - return $oJSON->encode( $oNewGuide ); + //$oJSON = new Services_JSON(); + return Bootstrap::json_encode($oNewGuide);//$oJSON->encode( $oNewGuide ); } catch (Exception $oError) { throw ($oError); } @@ -1791,8 +1790,8 @@ class processMap $oSL = new SwimlanesElements(); $oNewText->uid = $oSL->create( array ('PRO_UID' => $sProcessUID,'SWI_TYPE' => 'TEXT','SWI_TEXT' => $sLabel,'SWI_X' => $iX,'SWI_Y' => $iY,'SWI_NEXT_UID' => $sNext_uid ) ); - $oJSON = new Services_JSON(); - return $oJSON->encode( $oNewText ); + //$oJSON = new Services_JSON(); + return Bootstrap::json_encode($oNewText);//$oJSON->encode( $oNewText ); } catch (Exception $oError) { throw ($oError); } @@ -4660,14 +4659,14 @@ class processMap $oNewTask->label = 'Sub-Process'; //G::LoadTranslation('ID_TASK'); $oNewTask->uid = $oTask->create( array ('PRO_UID' => $sProcessUID,'TAS_TITLE' => $oNewTask->label,'TAS_POSX' => $iX,'TAS_POSY' => $iY,'TAS_TYPE' => 'SUBPROCESS' ) ); - $oJSON = new Services_JSON(); + //$oJSON = new Services_JSON(); $oOP = new SubProcess(); $aData = array ('SP_UID' => G::generateUniqueID(),'PRO_UID' => 0,'TAS_UID' => 0,'PRO_PARENT' => $sProcessUID,'TAS_PARENT' => $oNewTask->uid,'SP_TYPE' => 'SIMPLE','SP_SYNCHRONOUS' => 0,'SP_SYNCHRONOUS_TYPE' => 'ALL','SP_SYNCHRONOUS_WAIT' => 0,'SP_VARIABLES_OUT' => '','SP_VARIABLES_IN' => '','SP_GRID_IN' => '' ); $oOP->create( $aData ); - return $oJSON->encode( $oNewTask ); + return Bootstrap::json_endoce($oNewTask);//$oJSON->encode( $oNewTask ); } catch (Exception $oError) { throw ($oError); } @@ -5081,8 +5080,8 @@ class processMap ); $oDataset->next(); } - $oJSON = new Services_JSON(); - return $oJSON->encode( $aProcesses ); + //$oJSON = new Services_JSON(); + return Bootstrap::json_encode($aProcesses);//$oJSON->encode( $aProcesses ); } /* @@ -7396,8 +7395,8 @@ class processMap $oEvent->update( $aData ); } $oEncode->uid = $sEvn_uid; - $oJSON = new Services_JSON(); - return $oJSON->encode( $oEncode ); + //$oJSON = new Services_JSON(); + return Bootstrap::json_encode($oEncode);//$oJSON->encode( $oEncode ); } public function saveExtEvents ($oData) diff --git a/workflow/engine/classes/class.propelTable.php b/workflow/engine/classes/class.propelTable.php index c4f616b8a..0cbd101df 100755 --- a/workflow/engine/classes/class.propelTable.php +++ b/workflow/engine/classes/class.propelTable.php @@ -338,8 +338,13 @@ class propelTable $this->tpl->newBlock( "headers" ); $sortOrder = (((isset( $this->aOrder[$this->fields[$r]['Name']] )) && ($this->aOrder[$this->fields[$r]['Name']] === 'ASC')) ? 'DESC' : 'ASC'); $sortOrder = (((isset( $this->aOrder[$this->fields[$r]['Name']] )) && ($this->aOrder[$this->fields[$r]['Name']] === 'DESC')) ? '' : $sortOrder); - $this->style[$r]['href'] = $this->ownerPage . '?order=' . ($sortOrder !== '' ? (G::createUID( '', $this->fields[$r]['Name'] ) . '=' . $sortOrder) : '') . '&page=' . $this->currentPage; - $this->style[$r]['onsort'] = $this->id . '.doSort("' . G::createUID( '', $this->fields[$r]['Name'] ) . '" , "' . $sortOrder . '");return false;'; + if ($this->style[$r]['titleVisibility'] != '0') { + $this->style[$r]['href'] = $this->ownerPage . '?order=' . ($sortOrder !== '' ? (G::createUID( '', $this->fields[$r]['Name'] ) . '=' . $sortOrder) : '') . '&page=' . $this->currentPage; + $this->style[$r]['onsort'] = $this->id . '.doSort("' . G::createUID( '', $this->fields[$r]['Name'] ) . '" , "' . $sortOrder . '");return false;'; + } else { + $this->style[$r]['href'] = '#'; + $this->style[$r]['onsort'] = 'return false;'; + } if (isset( $this->style[$r]['href'] )) { $this->tpl->assign( "href", $this->style[$r]['href'] ); } @@ -492,7 +497,7 @@ class propelTable } } //Hidden titles - if (! (strpos( ' linknew button endgrid2 ', ' ' . $this->fields[$r]['Type'] . ' ' ) === false)) { + if (! (strpos( ' linknew button link endgrid2 ', ' ' . $this->fields[$r]['Type'] . ' ' ) === false)) { $this->style[$r]['titleVisibility'] = '0'; } //Align titles diff --git a/workflow/engine/classes/class.wsBase.php b/workflow/engine/classes/class.wsBase.php index d386d54d9..fe9a6f8dd 100755 --- a/workflow/engine/classes/class.wsBase.php +++ b/workflow/engine/classes/class.wsBase.php @@ -729,10 +729,24 @@ class wsBase * @param string $sSubject * @param string $sTemplate * @param $appFields = null + * @param $aAttachment = null + * @param boolean $showMessage = true + * @param int $delIndex = 0 * @return $result will return an object */ - public function sendMessage ($caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $appFields = null, $aAttachment = null, $showMessage = true) - { + public function sendMessage( + $caseId, + $sFrom, + $sTo, + $sCc, + $sBcc, + $sSubject, + $sTemplate, + $appFields = null, + $aAttachment = null, + $showMessage = true, + $delIndex = 0 + ) { try { G::loadClass( 'system' ); @@ -789,7 +803,21 @@ class wsBase } $showMessage = ($showMessage) ? 1 : 0 ; - $messageArray = array ('msg_uid' => '','app_uid' => $caseId,'del_index' => 0,'app_msg_type' => 'TRIGGER','app_msg_subject' => $sSubject,'app_msg_from' => $sFrom,'app_msg_to' => $sTo,'app_msg_body' => $sBody,'app_msg_cc' => $sCc,'app_msg_bcc' => $sBcc,'app_msg_attach' => $aAttachment,'app_msg_template' => '','app_msg_status' => 'pending', 'app_msg_show_message' => $showMessage + $messageArray = array( + "msg_uid" => "", + "app_uid" => $caseId, + "del_index" => $delIndex, + "app_msg_type" => "TRIGGER", + "app_msg_subject" => $sSubject, + "app_msg_from" => $sFrom, + "app_msg_to" => $sTo, + "app_msg_body" => $sBody, + "app_msg_cc" => $sCc, + "app_msg_bcc" => $sBcc, + "app_msg_attach" => $aAttachment, + "app_msg_template" => "", + "app_msg_status" => "pending", + "app_msg_show_message" => $showMessage ); $oSpool->create( $messageArray ); diff --git a/workflow/engine/classes/class.xmlfield_InputPM.php b/workflow/engine/classes/class.xmlfield_InputPM.php index fd9ac6851..9474f8ff9 100755 --- a/workflow/engine/classes/class.xmlfield_InputPM.php +++ b/workflow/engine/classes/class.xmlfield_InputPM.php @@ -387,10 +387,10 @@ function getDynaformsVars ($sProcessUID, $bSystemVars = true, $bIncMulSelFields $aFields[] = array ('sName' => 'PIN','sType' => 'system','sLabel' => 'System variable' ); } - $aInvalidTypes = array ('title','subtitle','link','file','button','reset','submit','javascript' - ); - $aMultipleSelectionFields = array ('listbox','checkgroup','grid' - ); + + $aInvalidTypes = array("title", "subtitle", "file", "button", "reset", "submit", "javascript"); + $aMultipleSelectionFields = array("listbox", "checkgroup", "grid"); + if ($bIncMulSelFields != 0) { $aInvalidTypes = array_merge( $aInvalidTypes, $aMultipleSelectionFields ); } diff --git a/workflow/engine/classes/model/AppFolder.php b/workflow/engine/classes/model/AppFolder.php index 0f8403385..cc04b654b 100755 --- a/workflow/engine/classes/model/AppFolder.php +++ b/workflow/engine/classes/model/AppFolder.php @@ -5,8 +5,8 @@ * @package workflow.engine.classes.model */ -require_once 'classes/model/om/BaseAppFolder.php'; -require_once 'classes/model/Application.php'; +//require_once 'classes/model/om/BaseAppFolder.php'; +//require_once 'classes/model/Application.php'; /** * Skeleton subclass for representing a row from the 'APP_FOLDER' table. diff --git a/workflow/engine/classes/model/CaseScheduler.php b/workflow/engine/classes/model/CaseScheduler.php index 5f60e661d..1e0e09bf0 100755 --- a/workflow/engine/classes/model/CaseScheduler.php +++ b/workflow/engine/classes/model/CaseScheduler.php @@ -5,10 +5,10 @@ * @package workflow.engine.classes.model */ -require_once 'classes/model/om/BaseCaseScheduler.php'; +//require_once 'classes/model/om/BaseCaseScheduler.php'; -require_once 'classes/model/Process.php'; -require_once 'classes/model/Task.php'; +//require_once 'classes/model/Process.php'; +//require_once 'classes/model/Task.php'; /** * Skeleton subclass for representing a row from the 'CASE_SCHEDULER' table. diff --git a/workflow/engine/classes/model/ContentPeer.php b/workflow/engine/classes/model/ContentPeer.php index 99dbb2945..9891ff4db 100755 --- a/workflow/engine/classes/model/ContentPeer.php +++ b/workflow/engine/classes/model/ContentPeer.php @@ -25,10 +25,10 @@ */ // include base peer class - require_once 'classes/model/om/BaseContentPeer.php'; + //require_once 'classes/model/om/BaseContentPeer.php'; // include object class - include_once 'classes/model/Content.php'; + //include_once 'classes/model/Content.php'; /** diff --git a/workflow/engine/classes/model/Event.php b/workflow/engine/classes/model/Event.php index 6336c1a7b..5538a72a9 100755 --- a/workflow/engine/classes/model/Event.php +++ b/workflow/engine/classes/model/Event.php @@ -5,8 +5,8 @@ * @package workflow.engine.classes.model */ -require_once 'classes/model/Content.php'; -require_once 'classes/model/om/BaseEvent.php'; +//require_once 'classes/model/Content.php'; +//require_once 'classes/model/om/BaseEvent.php'; /** * Skeleton subclass for representing a row from the 'EVENT' table. @@ -18,9 +18,9 @@ require_once 'classes/model/om/BaseEvent.php'; * long as it does not already exist in the output directory. */ -require_once 'classes/model/AppDelegation.php'; -require_once 'classes/model/AppEvent.php'; -require_once 'classes/model/Triggers.php'; +//require_once 'classes/model/AppDelegation.php'; +//require_once 'classes/model/AppEvent.php'; +//require_once 'classes/model/Triggers.php'; /** * diff --git a/workflow/engine/classes/model/Gateway.php b/workflow/engine/classes/model/Gateway.php index 9de80617a..9715e6f5a 100755 --- a/workflow/engine/classes/model/Gateway.php +++ b/workflow/engine/classes/model/Gateway.php @@ -5,7 +5,7 @@ * @package workflow.engine.classes.model */ -require_once 'classes/model/om/BaseGateway.php'; +//require_once 'classes/model/om/BaseGateway.php'; /** * Skeleton subclass for representing a row from the 'GATEWAY' table. diff --git a/workflow/engine/classes/model/LogCasesScheduler.php b/workflow/engine/classes/model/LogCasesScheduler.php index a4a8c9cfd..1960b3084 100755 --- a/workflow/engine/classes/model/LogCasesScheduler.php +++ b/workflow/engine/classes/model/LogCasesScheduler.php @@ -4,7 +4,7 @@ * @package workflow.engine.classes.model */ -require_once 'classes/model/om/BaseLogCasesScheduler.php'; +//require_once 'classes/model/om/BaseLogCasesScheduler.php'; /** diff --git a/workflow/engine/classes/model/StepSupervisorPeer.php b/workflow/engine/classes/model/StepSupervisorPeer.php index 6e92b7a78..02bb99925 100755 --- a/workflow/engine/classes/model/StepSupervisorPeer.php +++ b/workflow/engine/classes/model/StepSupervisorPeer.php @@ -5,10 +5,10 @@ */ // include base peer class - require_once 'classes/model/om/BaseStepSupervisorPeer.php'; + //require_once 'classes/model/om/BaseStepSupervisorPeer.php'; // include object class - include_once 'classes/model/StepSupervisor.php'; + //include_once 'classes/model/StepSupervisor.php'; /** diff --git a/workflow/engine/classes/model/SubProcess.php b/workflow/engine/classes/model/SubProcess.php index 1115d1c7f..2e7361d9c 100755 --- a/workflow/engine/classes/model/SubProcess.php +++ b/workflow/engine/classes/model/SubProcess.php @@ -5,7 +5,7 @@ * @package workflow.engine.classes.model */ -require_once 'classes/model/om/BaseSubProcess.php'; +//require_once 'classes/model/om/BaseSubProcess.php'; /** * Skeleton subclass for representing a row from the 'SUB_PROCESS' table. diff --git a/workflow/engine/classes/model/SwimlanesElements.php b/workflow/engine/classes/model/SwimlanesElements.php index 10afdedc7..3da57aaa5 100755 --- a/workflow/engine/classes/model/SwimlanesElements.php +++ b/workflow/engine/classes/model/SwimlanesElements.php @@ -25,8 +25,8 @@ * */ -require_once 'classes/model/om/BaseSwimlanesElements.php'; -require_once 'classes/model/Content.php'; +//require_once 'classes/model/om/BaseSwimlanesElements.php'; +//require_once 'classes/model/Content.php'; /** * Skeleton subclass for representing a row from the 'SWIMLANES_ELEMENTS' table. diff --git a/workflow/engine/classes/model/SwimlanesElementsPeer.php b/workflow/engine/classes/model/SwimlanesElementsPeer.php index f49d23f8d..fa40adcae 100755 --- a/workflow/engine/classes/model/SwimlanesElementsPeer.php +++ b/workflow/engine/classes/model/SwimlanesElementsPeer.php @@ -25,10 +25,10 @@ */ // include base peer class - require_once 'classes/model/om/BaseSwimlanesElementsPeer.php'; + //require_once 'classes/model/om/BaseSwimlanesElementsPeer.php'; // include object class - include_once 'classes/model/SwimlanesElements.php'; + //include_once 'classes/model/SwimlanesElements.php'; /** diff --git a/workflow/engine/classes/model/TriggersPeer.php b/workflow/engine/classes/model/TriggersPeer.php index eec2ccf9f..155247baf 100755 --- a/workflow/engine/classes/model/TriggersPeer.php +++ b/workflow/engine/classes/model/TriggersPeer.php @@ -25,10 +25,10 @@ */ // include base peer class -require_once 'classes/model/om/BaseTriggersPeer.php'; +//require_once 'classes/model/om/BaseTriggersPeer.php'; // include object class -include_once 'classes/model/Triggers.php'; +//include_once 'classes/model/Triggers.php'; /** diff --git a/workflow/engine/js/dynaformEditor/core/dynaformEditor.js b/workflow/engine/js/dynaformEditor/core/dynaformEditor.js index 40f0de85b..a2033f8d1 100755 --- a/workflow/engine/js/dynaformEditor/core/dynaformEditor.js +++ b/workflow/engine/js/dynaformEditor/core/dynaformEditor.js @@ -264,6 +264,50 @@ var dynaformEditor={ url='dynaforms_Saveas'; popupWindow('Save as', url+'?DYN_UID='+this.dynUid+'&AA='+this.A , 500, 350); }, + importForm:function(){ + panelImportDyna = new leimnud.module.panel(); + panelImportDyna.options={ + limit : true, + size : {w:410,h:160}, + position : {x:0,y:0,center:true}, + title : '', + theme : 'processmaker', + statusBar: false, + control : {drag:false,resize:true,close:false}, + fx : {opacity:true,rolled:false,modal:true} + }; + panelImportDyna.setStyle = {modal: { + backgroundColor: 'white' + }}; + panelImportDyna.make(); + panelImportDyna.addContent('
'); + var oRPC = new leimnud.module.rpc.xmlhttp({ + url : '../dynaforms/fieldsHandlerAjax', + async : false, + method: 'POST', + args : 'request=showImportForm' + '&DYN_UID=' + this.dynUid + }); + oRPC.make(); + document.getElementById('importAjax').style.display = 'none'; + panelImportDyna.addContent(oRPC.xmlhttp.responseText); + }, + import:function(uidDynaSelect){ + document.getElementById('importAjax').style.display = 'block'; + document.getElementById('importForm').style.display = 'none'; + var oRPC = new leimnud.module.rpc.xmlhttp({ + url : '../dynaforms/fieldsHandlerAjax', + async : false, + method: 'POST', + args : 'request=import' + '&DYN_UID=' + this.dynUid + '&FILE=' + uidDynaSelect + }); + oRPC.make(); + resp = oRPC.xmlhttp.responseText; + if (resp == 'success') { + location.reload(true); + } else { + alert("Error: " + resp); + } + }, close:function() { if (!sessionPersits()) { diff --git a/workflow/engine/methods/cases/cases_SaveDocument.php b/workflow/engine/methods/cases/cases_SaveDocument.php index d4209dd10..21f64884f 100755 --- a/workflow/engine/methods/cases/cases_SaveDocument.php +++ b/workflow/engine/methods/cases/cases_SaveDocument.php @@ -59,136 +59,86 @@ if ((isset( $_FILES['form'] )) && ($_FILES['form']['error']['APP_DOC_FILENAME'] die(); } -$docUid = $_POST['form']['DOC_UID']; -$appDocUid = $_POST['form']['APP_DOC_UID']; -$docVersion = $_POST['form']['docVersion']; -$actionType = $_POST['form']['actionType']; +G::LoadClass("case"); -//load the variables -G::LoadClass( 'case' ); -$oCase = new Cases(); -$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List' ); -$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] ); -$Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], G::getSystemConstants() ); +$inputDocumentUid = $_GET["UID"]; //$_POST["form"]["DOC_UID"] +$appDocUid = $_POST["form"]["APP_DOC_UID"]; +$docVersion = intval($_POST["form"]["docVersion"]); +$appDocType = $_POST["form"]["APP_DOC_TYPE"]; +$appDocComment = (isset($_POST["form"]["APP_DOC_COMMENT"]))? $_POST["form"]["APP_DOC_COMMENT"] : ""; +$actionType = $_POST["form"]["actionType"]; -#trigger debug routines... +$case = new Cases(); +$case->thisIsTheCurrentUser($_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["USER_LOGGED"], "REDIRECT", "cases_List"); +//Load the fields +$arrayField = $case->loadCase($_SESSION["APPLICATION"]); +$arrayField["APP_DATA"] = array_merge($arrayField["APP_DATA"], G::getSystemConstants()); -//cleaning debug variables -$_SESSION['TRIGGER_DEBUG']['ERRORS'] = Array (); -$_SESSION['TRIGGER_DEBUG']['DATA'] = Array (); -$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = Array (); -$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = Array (); +//Triggers +$arrayTrigger = $case->loadTriggers($_SESSION["TASK"], "INPUT_DOCUMENT", $inputDocumentUid, "AFTER"); -$triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'INPUT_DOCUMENT', $_GET['UID'], 'AFTER' ); +//Trigger debug routines +//Cleaning debug variables +$_SESSION["TRIGGER_DEBUG"]["ERRORS"] = array(); +$_SESSION["TRIGGER_DEBUG"]["DATA"] = array(); +$_SESSION["TRIGGER_DEBUG"]["TRIGGERS_NAMES"] = array(); +$_SESSION["TRIGGER_DEBUG"]["TRIGGERS_VALUES"] = array(); -$_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] = count( $triggers ); -$_SESSION['TRIGGER_DEBUG']['TIME'] = 'AFTER'; -if ($_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0) { - $_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = $oCase->getTriggerNames( $triggers ); - $_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = $triggers; +$_SESSION["TRIGGER_DEBUG"]["NUM_TRIGGERS"] = count($arrayTrigger); +$_SESSION["TRIGGER_DEBUG"]["TIME"] = "AFTER"; + +if ($_SESSION["TRIGGER_DEBUG"]["NUM_TRIGGERS"] > 0) { + $_SESSION["TRIGGER_DEBUG"]["TRIGGERS_NAMES"] = $case->getTriggerNames($arrayTrigger); + $_SESSION["TRIGGER_DEBUG"]["TRIGGERS_VALUES"] = $arrayTrigger; } -if ($_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0) { - //Execute after triggers - Start - $Fields['APP_DATA'] = $oCase->ExecuteTriggers( $_SESSION['TASK'], 'INPUT_DOCUMENT', $_GET['UID'], 'AFTER', $Fields['APP_DATA'] ); - //Execute after triggers - End +if ($_SESSION["TRIGGER_DEBUG"]["NUM_TRIGGERS"] > 0) { + //Trigger - Execute after - Start + $arrayField["APP_DATA"] = $case->executeTriggers( + $_SESSION["TASK"], + "INPUT_DOCUMENT", + $inputDocumentUid, + "AFTER", + $arrayField["APP_DATA"] + ); + //Trigger - Execute after - End } -//save data -$aData = array (); -$aData['APP_NUMBER'] = $Fields['APP_NUMBER']; -$aData['APP_PROC_STATUS'] = $Fields['APP_PROC_STATUS']; -$aData['APP_DATA'] = $Fields['APP_DATA']; -$aData['DEL_INDEX'] = $_SESSION['INDEX']; -$aData['TAS_UID'] = $_SESSION['TASK']; -//$aData = $oCase->loadCase($_SESSION['APPLICATION']); -$oCase->updateCase( $_SESSION['APPLICATION'], $aData ); +//Save data +$arrayData = array(); +$arrayData["APP_NUMBER"] = $arrayField["APP_NUMBER"]; +$arrayData["APP_PROC_STATUS"] = $arrayField["APP_PROC_STATUS"]; +$arrayData["APP_DATA"] = $arrayField["APP_DATA"]; +$arrayData["DEL_INDEX"] = $_SESSION["INDEX"]; +$arrayData["TAS_UID"] = $_SESSION["TASK"]; -//save info +$case->updateCase($_SESSION["APPLICATION"], $arrayData); - -//require_once ("classes/model/AppDocument.php"); -//require_once ('classes/model/AppFolder.php'); -//require_once ('classes/model/InputDocument.php'); - -$oInputDocument = new InputDocument(); -$aID = $oInputDocument->load( $_GET['UID'] ); - -$oAppDocument = new AppDocument(); - -//Get the Custom Folder ID (create if necessary) -$oFolder = new AppFolder(); -$folderId = $oFolder->createFromPath( $aID['INP_DOC_DESTINATION_PATH'] ); - -//Tags -$fileTags = $oFolder->parseTags( $aID['INP_DOC_TAGS'] ); - -switch ($actionType) { - case "R": //replace - $aFields = array ('APP_DOC_UID' => $appDocUid,'APP_UID' => $_SESSION['APPLICATION'],'DOC_VERSION' => $docVersion,'DEL_INDEX' => $_SESSION['INDEX'],'USR_UID' => $_SESSION['USER_LOGGED'],'DOC_UID' => $docUid,'APP_DOC_TYPE' => $_POST['form']['APP_DOC_TYPE'],'APP_DOC_CREATE_DATE' => date( 'Y-m-d H:i:s' ),'APP_DOC_COMMENT' => isset( $_POST['form']['APP_DOC_COMMENT'] ) ? $_POST['form']['APP_DOC_COMMENT'] : '','APP_DOC_TITLE' => '','APP_DOC_FILENAME' => isset( $_FILES['form']['name']['APP_DOC_FILENAME'] ) ? $_FILES['form']['name']['APP_DOC_FILENAME'] : '','FOLDER_UID' => $folderId,'APP_DOC_TAGS' => $fileTags - ); - - $oAppDocument->update( $aFields ); - break; - case "NV": //New Version - - - $aFields = array ('APP_DOC_UID' => $appDocUid,'APP_UID' => $_SESSION['APPLICATION'],'DEL_INDEX' => $_SESSION['INDEX'],'USR_UID' => $_SESSION['USER_LOGGED'],'DOC_UID' => $docUid,'APP_DOC_TYPE' => $_POST['form']['APP_DOC_TYPE'],'APP_DOC_CREATE_DATE' => date( 'Y-m-d H:i:s' ),'APP_DOC_COMMENT' => isset( $_POST['form']['APP_DOC_COMMENT'] ) ? $_POST['form']['APP_DOC_COMMENT'] : '','APP_DOC_TITLE' => '','APP_DOC_FILENAME' => isset( $_FILES['form']['name']['APP_DOC_FILENAME'] ) ? $_FILES['form']['name']['APP_DOC_FILENAME'] : '','FOLDER_UID' => $folderId,'APP_DOC_TAGS' => $fileTags - ); - - $oAppDocument->create( $aFields ); - break; - default: //New - $aFields = array ('APP_UID' => $_SESSION['APPLICATION'],'DEL_INDEX' => $_SESSION['INDEX'],'USR_UID' => $_SESSION['USER_LOGGED'],'DOC_UID' => $docUid,'APP_DOC_TYPE' => $_POST['form']['APP_DOC_TYPE'],'APP_DOC_CREATE_DATE' => date( 'Y-m-d H:i:s' ),'APP_DOC_COMMENT' => isset( $_POST['form']['APP_DOC_COMMENT'] ) ? $_POST['form']['APP_DOC_COMMENT'] : '','APP_DOC_TITLE' => '','APP_DOC_FILENAME' => isset( $_FILES['form']['name']['APP_DOC_FILENAME'] ) ? $_FILES['form']['name']['APP_DOC_FILENAME'] : '','FOLDER_UID' => $folderId,'APP_DOC_TAGS' => $fileTags - ); - - $oAppDocument->create( $aFields ); - break; -} - -$sAppDocUid = $oAppDocument->getAppDocUid(); -$iDocVersion = $oAppDocument->getDocVersion(); -$info = pathinfo( $oAppDocument->getAppDocFilename() ); -$ext = (isset( $info['extension'] ) ? $info['extension'] : ''); - -//save the file -if (! empty( $_FILES['form'] )) { - if ($_FILES['form']['error']['APP_DOC_FILENAME'] == 0) { - $sPathName = PATH_DOCUMENT . $_SESSION['APPLICATION'] . PATH_SEP; - $sFileName = $sAppDocUid . "_" . $iDocVersion . '.' . $ext; - G::uploadFile( $_FILES['form']['tmp_name']['APP_DOC_FILENAME'], $sPathName, $sFileName ); - - //Plugin Hook PM_UPLOAD_DOCUMENT for upload document - $oPluginRegistry = & PMPluginRegistry::getSingleton(); - if ($oPluginRegistry->existsTrigger( PM_UPLOAD_DOCUMENT ) && class_exists( 'uploadDocumentData' )) { - $triggerDetail = $oPluginRegistry->getTriggerInfo( PM_UPLOAD_DOCUMENT ); - $oData['APP_UID'] = $_SESSION['APPLICATION']; - $documentData = new uploadDocumentData( $_SESSION['APPLICATION'], $_SESSION['USER_LOGGED'], $sPathName . $sFileName, $aFields['APP_DOC_FILENAME'], $sAppDocUid, $iDocVersion ); - - $uploadReturn = $oPluginRegistry->executeTriggers( PM_UPLOAD_DOCUMENT, $documentData ); - if ($uploadReturn) { - $aFields['APP_DOC_PLUGIN'] = $triggerDetail->sNamespace; - if (! isset( $aFields['APP_DOC_UID'] )) { - $aFields['APP_DOC_UID'] = $sAppDocUid; - } - if (! isset( $aFields['DOC_VERSION'] )) { - $aFields['DOC_VERSION'] = $iDocVersion; - } - //$oAppDocument1 = new AppDocument(); - //G::pr($aFields);die; - $oAppDocument->update( $aFields ); - unlink( $sPathName . $sFileName ); - } - } - //end plugin - } +//Add Input Document +if (isset($_FILES) && isset($_FILES["form"]) && count($_FILES["form"]) > 0) { + $appDocUid = $case->addInputDocument( + $inputDocumentUid, + $appDocUid, + $docVersion, + $appDocType, + $appDocComment, + $actionType, + $_SESSION["APPLICATION"], + $_SESSION["INDEX"], + $_SESSION["TASK"], + $_SESSION["USER_LOGGED"], + "xmlform", + $_FILES["form"]["name"]["APP_DOC_FILENAME"], + $_FILES["form"]["error"]["APP_DOC_FILENAME"], + $_FILES["form"]["tmp_name"]["APP_DOC_FILENAME"] + ); } //go to the next step //if (!isset($_POST['form']['MORE'])) { if (false) { - $aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] ); + $aNextStep = $case->getNextStep($_SESSION["PROCESS"], $_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["STEP_POSITION"]); $_SESSION['STEP_POSITION'] = $aNextStep['POSITION']; if ($_SESSION['TRIGGER_DEBUG']['ISSET']) { @@ -212,7 +162,7 @@ if (false) { G::header( 'location: ' . $_SERVER['HTTP_REFERER'] ); die(); } else { - $aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] - 1 ); + $aNextStep = $case->getNextStep($_SESSION["PROCESS"], $_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["STEP_POSITION"] - 1); $_SESSION['STEP_POSITION'] = $aNextStep['POSITION']; if ($_SESSION['TRIGGER_DEBUG']['ISSET']) { @@ -225,7 +175,7 @@ if (false) { die(); } } else { - $aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] - 1 ); + $aNextStep = $case->getNextStep($_SESSION["PROCESS"], $_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["STEP_POSITION"] - 1); $_SESSION['STEP_POSITION'] = $aNextStep['POSITION']; if ($_SESSION['TRIGGER_DEBUG']['ISSET']) { diff --git a/workflow/engine/methods/dynaforms/fieldsHandlerAjax.php b/workflow/engine/methods/dynaforms/fieldsHandlerAjax.php index 01c8002c1..83eed3f72 100755 --- a/workflow/engine/methods/dynaforms/fieldsHandlerAjax.php +++ b/workflow/engine/methods/dynaforms/fieldsHandlerAjax.php @@ -94,6 +94,118 @@ switch ($request) { $o->remove( '___pm_boot_strap___' ); } break; + case 'showImportForm': + require_once 'classes/model/Dynaform.php'; + require_once 'classes/model/Content.php'; + $uidDynafom = $_POST['DYN_UID']; + + $oCriteria = new Criteria( 'workflow' ); + $oCriteria->clearSelectColumns(); + $oCriteria->addSelectColumn( DynaformPeer::DYN_FILENAME ); + $oCriteria->addAsColumn( 'DYNA_NAME', 'C_DYNA.CON_VALUE' ); + $oCriteria->addAsColumn( 'PROC_NAME', 'C_PROC.CON_VALUE' ); + + $oCriteria->addAlias("C_DYNA", "CONTENT"); + $oCriteria->addAlias("C_PROC", "CONTENT"); + + $arrayCondition = array(); + $arrayCondition[] = array(DynaformPeer::DYN_UID, "C_DYNA.CON_ID"); + $oCriteria->addJoinMC($arrayCondition, Criteria::LEFT_JOIN); + + $arrayCondition = array(); + $arrayCondition[] = array(DynaformPeer::PRO_UID, "C_PROC.CON_ID"); + $oCriteria->addJoinMC($arrayCondition, Criteria::LEFT_JOIN); + + $oCriteria->add( 'C_DYNA.CON_LANG', SYS_LANG ); + $oCriteria->add( 'C_DYNA.CON_CATEGORY', 'DYN_TITLE' ); + + $oCriteria->add( 'C_PROC.CON_LANG', SYS_LANG ); + $oCriteria->add( 'C_PROC.CON_CATEGORY', 'PRO_TITLE' ); + + $oCriteria->add( DynaformPeer::DYN_UID, $uidDynafom, Criteria::NOT_EQUAL); + + $oCriteria->addAscendingOrderByColumn ('PROC_NAME'); + $oCriteria->addAscendingOrderByColumn ('DYNA_NAME'); + $oDataset = DynaformPeer::doSelectRS( $oCriteria ); + $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); + $oDataset->next(); + $aRow = $oDataset->getRow(); + + + $select = ''; + $html = '
+ + + + + + + + + + + + +
+ ' . G::LoadTranslation('ID_SELECT_DYNAFORM_IMPORT') . ' +
+ + ' . $select . ' +
+   + +
'; + echo $html; + break; + case 'import': + require_once 'classes/model/Dynaform.php'; + $uidDynafom = $_POST['DYN_UID']; + $oCriteria = new Criteria( 'workflow' ); + $oCriteria->clearSelectColumns(); + $oCriteria->addSelectColumn( DynaformPeer::DYN_FILENAME ); + $oCriteria->add( DynaformPeer::DYN_UID, $uidDynafom, Criteria::EQUAL); + $oDataset = DynaformPeer::doSelectRS( $oCriteria ); + $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); + $oDataset->next(); + $aRow = $oDataset->getRow(); + + $dynaFile = PATH_DYNAFORM . $aRow['DYN_FILENAME'] . '.xml'; + $importFile = PATH_DYNAFORM . $_POST['FILE'] . '.xml'; + + $importFp = fopen ($importFile, "r+"); + $fileText = fread($importFp, filesize($importFile)); + fclose ( $importFp ); + $newFile = str_replace($_POST['FILE'], $aRow['DYN_FILENAME'], $fileText); + + $dynaFileTmp = PATH_DYNAFORM . $aRow['DYN_FILENAME'] . '_tmp0.xml'; + $dynafmFp = fopen ($dynaFileTmp,"w+"); + fwrite ( $dynafmFp, $newFile); + fclose ( $dynafmFp ); + + /* + $dynafmFp = fopen ($dynaFile,"w+"); + fwrite ( $dynafmFp, $newFile); + fclose ( $dynafmFp ); + */ + echo 'success'; + break; default: echo 'no request param.'; } diff --git a/workflow/engine/methods/processes/processes_Ajax.php b/workflow/engine/methods/processes/processes_Ajax.php index ea29acac2..1eb3a52e7 100755 --- a/workflow/engine/methods/processes/processes_Ajax.php +++ b/workflow/engine/methods/processes/processes_Ajax.php @@ -42,9 +42,10 @@ try { $oData = G::json_decode( stripslashes( $_REQUEST['data'] ) ); //$oData = $oJSON->decode( stripslashes( $_REQUEST['data'] ) ); $sOutput = ''; + $sTask = ''; } - G::LoadClass( 'processMap' ); + //G::LoadClass( 'processMap' ); $oProcessMap = new processMap( new DBConnection() ); switch ($_REQUEST['action']) { diff --git a/workflow/engine/methods/setup/loginSettingsAjax.php b/workflow/engine/methods/setup/loginSettingsAjax.php index eb191a601..a0a29bdc6 100755 --- a/workflow/engine/methods/setup/loginSettingsAjax.php +++ b/workflow/engine/methods/setup/loginSettingsAjax.php @@ -4,7 +4,7 @@ $request = isset( $_REQUEST['request'] ) ? $_REQUEST['request'] : null; switch ($request) { case 'getLangList': - $Translations = G::getModel( 'Translation' ); + $Translations = new Translation(); $result = new stdClass(); $result->rows = Array (); diff --git a/workflow/engine/templates/authSources/authSourcesEdit.js b/workflow/engine/templates/authSources/authSourcesEdit.js index d61dba2b9..c066ed5dc 100644 --- a/workflow/engine/templates/authSources/authSourcesEdit.js +++ b/workflow/engine/templates/authSources/authSourcesEdit.js @@ -37,7 +37,7 @@ Ext.onReady(function(){ hiddenName: 'LDAP_TYPE', store: new Ext.data.SimpleStore({ fields: ['ldap','ad'], - data : my_values + data : my_values }), displayField: 'ldap', typeAhead: true, @@ -48,10 +48,8 @@ Ext.onReady(function(){ listeners:{ select: function(c,d,i){ if(i){ - formAuthSourceE.getForm().findField('AUTH_SOURCE_ATTRIBUTES').setValue('cn' + "\n" + 'samaccountname' + "\n" + 'givenname' + "\n" + 'sn' + "\n" + 'userprincipalname' + "\n" + 'telephonenumber'); formAuthSourceE.getForm().findField('AUTH_SOURCE_IDENTIFIER_FOR_USER').setValue('samaccountname'); } else { - formAuthSourceE.getForm().findField('AUTH_SOURCE_ATTRIBUTES').setValue('cn' + "\n" + 'uid' + "\n" + 'givenname' + "\n" + 'sn' + "\n" + 'mail' + "\n" + 'mobile'); formAuthSourceE.getForm().findField('AUTH_SOURCE_IDENTIFIER_FOR_USER').setValue('uid'); } } @@ -59,8 +57,8 @@ Ext.onReady(function(){ }); var txtServerName=new Ext.form.TextField({ - id: 'AUTH_SOURCE_SERVER_NAME', - fieldLabel: _('ID_SERVER_NAME'), + id: 'AUTH_SOURCE_SERVER_NAME', + fieldLabel: _('ID_SERVER_NAME'), xtype:'textfield', value:'', width: 200, @@ -75,8 +73,8 @@ Ext.onReady(function(){ }); var txtPort=new Ext.form.TextField({ - id: 'AUTH_SOURCE_PORT', - fieldLabel: _('ID_PORT'), + id: 'AUTH_SOURCE_PORT', + fieldLabel: _('ID_PORT'), xtype:'textfield', value:'389', width: 200, @@ -123,11 +121,11 @@ Ext.onReady(function(){ var txtBaseDN=new Ext.form.TextField({ - id: 'AUTH_SOURCE_BASE_DN', - fieldLabel: _('ID_BASE_DN'), + id: 'AUTH_SOURCE_BASE_DN', + fieldLabel: _('ID_BASE_DN'), xtype:'textfield', value:sUID, - width: 200, + width: 300, autoCreate: {tag: 'input', type: 'text', size: '10', autocomplete: 'off', maxlength: '128'}, allowBlank: false, listeners: { @@ -163,20 +161,20 @@ Ext.onReady(function(){ Ext.getCmp("AUTH_SOURCE_PASSWORD").show(); txtPassword.getEl().up('.x-form-item').setDisplayed(true); }else{ - Ext.getCmp("AUTH_SOURCE_SEARCH_USER").disable(); + Ext.getCmp("AUTH_SOURCE_SEARCH_USER").disable(); Ext.getCmp("AUTH_SOURCE_SEARCH_USER").hide(); txtSearchUser.getEl().up('.x-form-item').setDisplayed(false); - Ext.getCmp("AUTH_SOURCE_PASSWORD").disable(); + Ext.getCmp("AUTH_SOURCE_PASSWORD").disable(); Ext.getCmp("AUTH_SOURCE_PASSWORD").hide(); - txtPassword.getEl().up('.x-form-item').setDisplayed(false); - } + txtPassword.getEl().up('.x-form-item').setDisplayed(false); + } } } }); var txtSearchUser=new Ext.form.TextField({ - id: 'AUTH_SOURCE_SEARCH_USER', - fieldLabel: _('ID_SEARCH_USER'), + id: 'AUTH_SOURCE_SEARCH_USER', + fieldLabel: _('ID_SEARCH_USER'), xtype:'textfield', value:'', width: 200, @@ -191,7 +189,7 @@ Ext.onReady(function(){ var txtPassword=new Ext.form.TextField({ id: 'AUTH_SOURCE_PASSWORD', - fieldLabel: _('ID_CACHE_PASSWORD'), + fieldLabel: _('ID_CACHE_PASSWORD'), xtype:'textfield', inputType:'password', value:'', @@ -208,7 +206,7 @@ Ext.onReady(function(){ //Identifier for an imported user var txtIdentifier=new Ext.form.TextField({ id: 'AUTH_SOURCE_IDENTIFIER_FOR_USER', - fieldLabel: _('ID_IDENTIFIER_IMPORT_USER'), + fieldLabel: _('ID_IDENTIFIER_IMPORT_USER'), xtype:'textfield', value:'', width: 200, @@ -221,28 +219,13 @@ Ext.onReady(function(){ } } }); -//Object Classes - var txtaClass=new Ext.form.TextArea({ - id: 'AUTH_SOURCE_OBJECT_CLASSES', - fieldLabel: _('ID_OBJECT_CLASS'), - xtype:'textarea', - value:'*', - width: 200, - allowBlank: false, - listeners: { - 'render': function(c) { - c.getEl().on('keyup', function() { - }, c); - } - } - }); //Additional Filter var txtoAddFilter=new Ext.form.TextField({ id: 'AUTH_SOURCE_ADDITIONAL_FILTER', - fieldLabel: _('ID_ADDITIONAL_FILTER'), + fieldLabel: _('ID_ADDITIONAL_FILTER'), xtype:'textfield', value:'', - width: 200, + width: 300, autoCreate: {tag: 'input', type: 'text', size: '20', autocomplete: 'off', maxlength: '200'}, allowBlank: true, listeners: { @@ -252,21 +235,6 @@ Ext.onReady(function(){ } } }); -//Attributes - var txtAttributes=new Ext.form.TextArea({ - id: 'AUTH_SOURCE_ATTRIBUTES', - fieldLabel: _('ID_ATTRIBUTES'), - xtype:'textArea', - value:'cn' + "\n" + 'uid' + "\n" + 'givenname' + "\n" + 'sn' + "\n" + 'mail' + "\n" + 'mobile', - width: 200, - allowBlank: false, - listeners: { - 'render': function(c) { - c.getEl().on('keyup', function() { - }, c); - } - } - }); //here we are setting the fields fieldsAS = new Ext.form.FieldSet({ title: _('ID_AUTHENTICATION_SOURCE_INF_TITLE'), @@ -274,7 +242,7 @@ Ext.onReady(function(){ txtSourceId, txtName, cboxType, - txtServerName, + txtServerName, txtPort, cboxTLS, cboxVersion, @@ -283,14 +251,12 @@ Ext.onReady(function(){ txtSearchUser, txtPassword , txtIdentifier, - txtaClass, txtoAddFilter, - txtAttributes - ] + ] }); formAuthSourceE = new Ext.FormPanel({ - id:'formAuthSourceE', + id:'formAuthSourceE', labelWidth: 250, labelAlign:'right', autoScroll: true, @@ -304,7 +270,7 @@ Ext.onReady(function(){ allowBlank: false, resizable: true, msgTarget: 'side', - align:'center' + align:'center' }, items:[ fieldsAS @@ -312,19 +278,19 @@ Ext.onReady(function(){ buttons: [ { text: _('ID_SAVE'), - handler: saveAuthSources + handler: saveAuthSources }, - { + { text: _('ID_CANCEL'), handler: goback } ] - + }); formAuthSourceE.render(document.body); loadAuthSourceData(sUID, txtSearchUser, txtPassword); - + }); function goback(){ window.location = 'authSources_List'; @@ -334,7 +300,7 @@ Ext.onReady(function(){ url: '../adminProxy/saveAuthSources', params: { // action : 'tryit', - AUTH_SOURCE_UID: formAuthSourceE.getForm().findField('AUTH_SOURCE_UID').getValue(), + AUTH_SOURCE_UID: formAuthSourceE.getForm().findField('AUTH_SOURCE_UID').getValue(), AUTH_SOURCE_NAME: formAuthSourceE.getForm().findField('AUTH_SOURCE_NAME').getValue(), LDAP_TYPE: formAuthSourceE.getForm().findField('LDAP_TYPE').getValue(), AUTH_SOURCE_SERVER_NAME: formAuthSourceE.getForm().findField('AUTH_SOURCE_SERVER_NAME').getValue(), @@ -344,14 +310,12 @@ Ext.onReady(function(){ AUTH_SOURCE_SEARCH_USER: formAuthSourceE.getForm().findField('AUTH_SOURCE_SEARCH_USER').getValue(), AUTH_SOURCE_PASSWORD: formAuthSourceE.getForm().findField('AUTH_SOURCE_PASSWORD').getValue(), AUTH_SOURCE_VERSION: formAuthSourceE.getForm().findField('AUTH_SOURCE_VERSION').getValue(), - AUTH_SOURCE_BASE_DN: formAuthSourceE.getForm().findField('AUTH_SOURCE_BASE_DN').getValue(), - AUTH_SOURCE_OBJECT_CLASSES: formAuthSourceE.getForm().findField('AUTH_SOURCE_OBJECT_CLASSES').getValue(), - AUTH_SOURCE_ATTRIBUTES: formAuthSourceE.getForm().findField('AUTH_SOURCE_ATTRIBUTES').getValue() + AUTH_SOURCE_BASE_DN: formAuthSourceE.getForm().findField('AUTH_SOURCE_BASE_DN').getValue() }, - waitMsg : 'testing...', + waitMsg : _('ID_SAVING'), timeout : 3600, success: function(f,a){ - + resp = Ext.util.JSON.decode(a.response.responseText); if (resp.success){ window.location = 'authSources_List'; @@ -367,7 +331,7 @@ Ext.onReady(function(){ } }); } - + // Load authosource data for the Edit mode function loadAuthSourceData(sUID, txtSearchUser, txtPassword){ Ext.Ajax.request({ @@ -376,7 +340,7 @@ function loadAuthSourceData(sUID, txtSearchUser, txtPassword){ 'action': 'loadauthSourceData', sUID:sUID }, - waitMsg: _('ID_UPLOADING_PROCESS_FILE'), + waitMsg: _('ID_UPLOADING_PROCESS_FILE'), success: function(r,o){ var data = Ext.util.JSON.decode(r.responseText); @@ -388,16 +352,16 @@ function loadAuthSourceData(sUID, txtSearchUser, txtPassword){ Ext.getCmp("AUTH_SOURCE_PASSWORD").show(); txtPassword.getEl().up('.x-form-item').setDisplayed(true); }else{ - Ext.getCmp("AUTH_SOURCE_SEARCH_USER").disable(); + Ext.getCmp("AUTH_SOURCE_SEARCH_USER").disable(); Ext.getCmp("AUTH_SOURCE_SEARCH_USER").hide(); txtSearchUser.getEl().up('.x-form-item').setDisplayed(false); - Ext.getCmp("AUTH_SOURCE_PASSWORD").disable(); + Ext.getCmp("AUTH_SOURCE_PASSWORD").disable(); Ext.getCmp("AUTH_SOURCE_PASSWORD").hide(); - txtPassword.getEl().up('.x-form-item').setDisplayed(false); + txtPassword.getEl().up('.x-form-item').setDisplayed(false); } Ext.getCmp('formAuthSourceE').getForm().setValues({ - + AUTH_SOURCE_UID: data.sources.AUTH_SOURCE_UID, AUTH_SOURCE_NAME: data.sources.AUTH_SOURCE_NAME , LDAP_TYPE: (data.sources.LDAP_TYPE=='ad')?'Active Directory':data.sources.LDAP_TYPE, @@ -410,8 +374,6 @@ function loadAuthSourceData(sUID, txtSearchUser, txtPassword){ AUTH_SOURCE_IDENTIFIER_FOR_USER: data.sources.AUTH_SOURCE_IDENTIFIER_FOR_USER, AUTH_SOURCE_VERSION: data.sources.AUTH_SOURCE_VERSION, AUTH_SOURCE_BASE_DN: data.sources.AUTH_SOURCE_BASE_DN, - AUTH_SOURCE_OBJECT_CLASSES: data.sources.AUTH_SOURCE_OBJECT_CLASSES, - AUTH_SOURCE_ATTRIBUTES:data.sources.AUTH_SOURCE_ATTRIBUTES, AUTH_SOURCE_ADDITIONAL_FILTER:data.sources.AUTH_SOURCE_ADDITIONAL_FILTER }) }, diff --git a/workflow/engine/templates/authSources/authSourceskindof.js b/workflow/engine/templates/authSources/authSourceskindof.js index d0512dd36..e7e360500 100644 --- a/workflow/engine/templates/authSources/authSourceskindof.js +++ b/workflow/engine/templates/authSources/authSourceskindof.js @@ -47,7 +47,7 @@ Ext.onReady(function(){ hiddenName: 'LDAP_TYPE', store: new Ext.data.SimpleStore({ fields: ['ldap','ad'], - data : my_values + data : my_values }), displayField: 'ldap', typeAhead: true, @@ -59,10 +59,8 @@ Ext.onReady(function(){ listeners:{ select: function(c,d,i){ if(i){ - formAuthSource.getForm().findField('AUTH_SOURCE_ATTRIBUTES').setValue('cn' + "\n" + 'samaccountname' + "\n" + 'givenname' + "\n" + 'sn' + "\n" + 'userprincipalname' + "\n" + 'telephonenumber'); formAuthSource.getForm().findField('AUTH_SOURCE_IDENTIFIER_FOR_USER').setValue('samaccountname'); } else { - formAuthSource.getForm().findField('AUTH_SOURCE_ATTRIBUTES').setValue('cn' + "\n" + 'uid' + "\n" + 'givenname' + "\n" + 'sn' + "\n" + 'mail' + "\n" + 'mobile'); formAuthSource.getForm().findField('AUTH_SOURCE_IDENTIFIER_FOR_USER').setValue('uid'); } } @@ -71,7 +69,7 @@ Ext.onReady(function(){ var txtServerName=new Ext.form.TextField({ id: 'AUTH_SOURCE_SERVER_NAME', - fieldLabel: _('ID_SERVER_NAME'), + fieldLabel: _('ID_SERVER_NAME'), xtype:'textfield', value:'', width: 200, @@ -87,7 +85,7 @@ Ext.onReady(function(){ var txtPort=new Ext.form.TextField({ id: 'AUTH_SOURCE_PORT', - fieldLabel: _('ID_PORT'), + fieldLabel: _('ID_PORT'), xtype:'textfield', value:'389', width: 200, @@ -143,7 +141,7 @@ Ext.onReady(function(){ fieldLabel: _('ID_BASE_DN'), xtype:'textfield', value:'', - width: 200, + width: 300, autoCreate: {tag: 'input', type: 'text', size: '10', autocomplete: 'off', maxlength: '128'}, allowBlank: false, listeners: { @@ -181,20 +179,20 @@ Ext.onReady(function(){ Ext.getCmp("AUTH_SOURCE_PASSWORD").show(); txtPassword.getEl().up('.x-form-item').setDisplayed(true); }else{ - Ext.getCmp("AUTH_SOURCE_SEARCH_USER").disable(); + Ext.getCmp("AUTH_SOURCE_SEARCH_USER").disable(); Ext.getCmp("AUTH_SOURCE_SEARCH_USER").hide(); txtSearchUser.getEl().up('.x-form-item').setDisplayed(false); - Ext.getCmp("AUTH_SOURCE_PASSWORD").disable(); + Ext.getCmp("AUTH_SOURCE_PASSWORD").disable(); Ext.getCmp("AUTH_SOURCE_PASSWORD").hide(); txtPassword.getEl().up('.x-form-item').setDisplayed(false); - } + } } } }); var txtSearchUser=new Ext.form.TextField({ id: 'AUTH_SOURCE_SEARCH_USER', - fieldLabel: _('ID_SEARCH_USER'), + fieldLabel: _('ID_SEARCH_USER'), xtype:'textfield', value:'', width: 200, @@ -209,7 +207,7 @@ Ext.onReady(function(){ var txtPassword=new Ext.form.TextField({ id: 'AUTH_SOURCE_PASSWORD', - fieldLabel: _('ID_CACHE_PASSWORD'), + fieldLabel: _('ID_CACHE_PASSWORD'), xtype:'textfield', inputType:'password', value:'', @@ -226,7 +224,7 @@ Ext.onReady(function(){ //Identifier for an imported user var txtIdentifier=new Ext.form.TextField({ id: 'AUTH_SOURCE_IDENTIFIER_FOR_USER', - fieldLabel: _('ID_IDENTIFIER_IMPORT_USER'), + fieldLabel: _('ID_IDENTIFIER_IMPORT_USER'), xtype:'textfield', value:'uid', width: 200, @@ -239,28 +237,13 @@ Ext.onReady(function(){ } } }); -//Object Classes - var txtaClass=new Ext.form.TextArea({ - id: 'AUTH_SOURCE_OBJECT_CLASSES', - fieldLabel: _('ID_OBJECT_CLASS'), - xtype:'textarea', - value:'*', - width: 200, - allowBlank: false, - listeners: { - 'render': function(c) { - c.getEl().on('keyup', function() { - }, c); - } - } - }); //Additional Filter var txtoAddFilter=new Ext.form.TextField({ id: 'AUTH_SOURCE_ADDITIONAL_FILTER', fieldLabel: _('ID_ADDITIONAL_FILTER'), xtype:'textfield', value:'', - width: 200, + width: 300, autoCreate: {tag: 'input', type: 'text', size: '20', autocomplete: 'off', maxlength: '200'}, allowBlank: true, listeners: { @@ -270,21 +253,6 @@ Ext.onReady(function(){ } } }); -//Attributes - var txtAttributes=new Ext.form.TextArea({ - id: 'AUTH_SOURCE_ATTRIBUTES', - fieldLabel: _('ID_ATTRIBUTES'), - xtype:'textArea', - value:'cn' + "\n" + 'uid' + "\n" + 'givenname' + "\n" + 'sn' + "\n" + 'mail' + "\n" + 'mobile', - width: 200, - allowBlank: false, - listeners: { - 'render': function(c) { - c.getEl().on('keyup', function() { - }, c); - } - } - }); //here we are setting the fields fieldsAS = new Ext.form.FieldSet({ title: _('ID_AUTHENTICATION_SOURCE_INFORMATION'), @@ -302,9 +270,7 @@ Ext.onReady(function(){ txtSearchUser, txtPassword , txtIdentifier, - txtaClass, - txtoAddFilter, - txtAttributes + txtoAddFilter ] }); @@ -333,18 +299,18 @@ Ext.onReady(function(){ { text: _('ID_SAVE'), handler: TestSite - + }, - { + { text: _('ID_CANCEL'), handler: goback } ] - + }); formAuthSource.render(document.body); - + }); function goback(){ window.location = 'authSources_List'; @@ -354,7 +320,7 @@ Ext.onReady(function(){ url: '../adminProxy/saveAuthSources', params: { // action : 'tryit', - AUTH_SOURCE_UID: formAuthSource.getForm().findField('AUTH_SOURCE_UID').getValue(), + AUTH_SOURCE_UID: formAuthSource.getForm().findField('AUTH_SOURCE_UID').getValue(), AUTH_SOURCE_NAME: formAuthSource.getForm().findField('AUTH_SOURCE_NAME').getValue(), LDAP_TYPE: formAuthSource.getForm().findField('LDAP_TYPE').getValue(), AUTH_SOURCE_SERVER_NAME: formAuthSource.getForm().findField('AUTH_SOURCE_SERVER_NAME').getValue(), @@ -365,15 +331,13 @@ Ext.onReady(function(){ AUTH_SOURCE_PASSWORD: formAuthSource.getForm().findField('AUTH_SOURCE_PASSWORD').getValue(), AUTH_SOURCE_VERSION: formAuthSource.getForm().findField('AUTH_SOURCE_VERSION').getValue(), AUTH_SOURCE_BASE_DN: formAuthSource.getForm().findField('AUTH_SOURCE_BASE_DN').getValue(), - AUTH_SOURCE_OBJECT_CLASSES: formAuthSource.getForm().findField('AUTH_SOURCE_OBJECT_CLASSES').getValue(), - AUTH_SOURCE_ATTRIBUTES: formAuthSource.getForm().findField('AUTH_SOURCE_ATTRIBUTES').getValue(), AUTH_SOURCE_ADDITIONAL_FILTER: formAuthSource.getForm().findField('AUTH_SOURCE_ADDITIONAL_FILTER').getValue() - + }, - waitMsg : 'testing...', + waitMsg : _('ID_SAVING'), timeout : 3600, success: function(f,a){ - + resp = Ext.util.JSON.decode(a.response.responseText); if (resp.success){ window.location = 'authSources_List'; diff --git a/workflow/engine/templates/triggers/triggersTree.php b/workflow/engine/templates/triggers/triggersTree.php index b66657760..3d840e026 100755 --- a/workflow/engine/templates/triggers/triggersTree.php +++ b/workflow/engine/templates/triggers/triggersTree.php @@ -70,9 +70,6 @@ try { } } - error_log("\n*****\n", 3, "/home/victor/MyLog.log"); - error_log(print_r($oTree, true), 3, "/home/victor/MyLog.log"); - echo $oTree->render(); } catch (Exception $e) { die($e->getMessage()); diff --git a/workflow/engine/xmlform/dbConnections/dbConnections.xml b/workflow/engine/xmlform/dbConnections/dbConnections.xml index 54948ec87..d9b931c44 100755 --- a/workflow/engine/xmlform/dbConnections/dbConnections.xml +++ b/workflow/engine/xmlform/dbConnections/dbConnections.xml @@ -29,6 +29,7 @@ Delete - + + diff --git a/workflow/engine/xmlform/dynaforms/fields_Options.xml b/workflow/engine/xmlform/dynaforms/fields_Options.xml index 0e97b4c5f..d0486418e 100755 --- a/workflow/engine/xmlform/dynaforms/fields_Options.xml +++ b/workflow/engine/xmlform/dynaforms/fields_Options.xml @@ -18,6 +18,7 @@ popupWindow('@G::LoadTranslation(ID_EDIT_FIELD)', '@G::encryptlink(@#fields_Edit)?A=@%URL&XMLNODE_NAME='+ uid , 500, 650, null,false,true); } function fieldsSave( form ) { + alert("save"); if (pme_validating) { validatingForm=form; setTimeout('fieldsSave(validatingForm);',100); diff --git a/workflow/engine/xmlform/dynaforms/fields_Toolbar.xml b/workflow/engine/xmlform/dynaforms/fields_Toolbar.xml index d8ba50262..311a3affa 100755 --- a/workflow/engine/xmlform/dynaforms/fields_Toolbar.xml +++ b/workflow/engine/xmlform/dynaforms/fields_Toolbar.xml @@ -9,6 +9,9 @@ Save as + + Import + diff --git a/workflow/engine/xmlform/triggers/triggerCopy.xml b/workflow/engine/xmlform/triggers/triggerCopy.xml index a675c6229..d45f947e7 100644 --- a/workflow/engine/xmlform/triggers/triggerCopy.xml +++ b/workflow/engine/xmlform/triggers/triggerCopy.xml @@ -13,10 +13,12 @@ + Process @@ -25,11 +27,13 @@ + Trigger @@ -42,17 +46,21 @@ + Description of the new trigger + Script diff --git a/workflow/public_html/sysGeneric.php b/workflow/public_html/sysGeneric.php index f75f01c53..83d75b214 100755 --- a/workflow/public_html/sysGeneric.php +++ b/workflow/public_html/sysGeneric.php @@ -57,9 +57,10 @@ define( 'PATH_OUTTRUNK', $pathOutTrunk ); define( 'PATH_HTML', PATH_HOME . 'public_html' . PATH_SEP ); //this is the first path, if the file exists... -$request = substr($_SERVER['REQUEST_URI'],1,strlen($_SERVER['REQUEST_URI'])); -$fileWithoutParam = explode("?",$request); -$requestFile = PATH_HTML . $fileWithoutParam[0]; +$request = substr($_SERVER['REQUEST_URI'], 1, strlen($_SERVER['REQUEST_URI'])); //removes the first '/' +$fileWithoutParam = explode("?", $request); // split the URI by '?' +$request = $fileWithoutParam[0]; // get the first element of the split URI +$requestFile = PATH_HTML . $request; // temporary assemble a path for the file embedded in the URI if (file_exists($requestFile)) { if (!is_file($requestFile)) { header( "location: /errors/error404.php?url=" . urlencode( $_SERVER['REQUEST_URI'] ) ); @@ -70,8 +71,10 @@ if (file_exists($requestFile)) { if($pos < $size) { //if this file got an extension then assign the content $ext_file = substr($request, $pos, $size); - if ($ext_file == "gif" || $ext_file == "png" || $ext_file == "jpg") { + if ($ext_file == "gif" || $ext_file == "png") { $ext_file = 'image/'.$ext_file ; + } elseif ($ext_file == "jpg" || $ext_file == "jpeg") { + $ext_file = 'image/jpeg'; } elseif ($ext_file == "swf") { $ext_file = "application/x-shockwave-flash"; } elseif ($ext_file == "json" || $ext_file == "htc" ) { @@ -116,6 +119,7 @@ if (file_exists($requestFile)) { die; } + // Defining RBAC Paths constants define( 'PATH_RBAC_HOME', PATH_TRUNK . 'rbac' . PATH_SEP ); @@ -154,12 +158,6 @@ define( 'PATH_RBAC_MSSQL_DATA', PATH_RBAC_CORE . 'data' . PATH_SEP . 'mssql' . P define( 'PATH_CONTROLLERS', PATH_CORE . 'controllers' . PATH_SEP ); define( 'PATH_SERVICES_REST', PATH_CORE . 'services' . PATH_SEP . 'rest' . PATH_SEP ); -//TEST -//if($_SERVER['REQUEST_URI'] == "/sysworkflow/en/classic/processes/mainInit") -//{ -// echo PATH_TRUNK . "engine/methods/processes/mainInit.php"; -//} - // include Gulliver Class require_once (PATH_GULLIVER . PATH_SEP . 'class.bootstrap.php'); @@ -430,10 +428,12 @@ Bootstrap::registerClass('Calendar', PATH_HOME . "engine/classes/class.calen Bootstrap::registerClass('processMap', PATH_HOME . "engine/classes/class.processMap.php"); //DATABASE propel classes used in 'Cases' Options -Bootstrap::registerClass('Entity_Base', PATH_HOME . "engine/classes/entities/Base.php"); +Bootstrap::registerClass('Entity_Base', PATH_HOME . "engine/classes/entities/Base.php"); Bootstrap::registerClass('BaseContent', PATH_HOME . "engine/classes/model/om/BaseContent.php"); Bootstrap::registerClass('Content', PATH_HOME . "engine/classes/model/Content.php"); +Bootstrap::registerClass('BaseContentPeer', PATH_HOME . "engine/classes/model/om/BaseContentPeer.php"); +Bootstrap::registerClass('ContentPeer', PATH_HOME . "engine/classes/model/ContentPeer.php"); Bootstrap::registerClass('BaseApplication', PATH_HOME . "engine/classes/model/om/BaseApplication.php"); Bootstrap::registerClass('ApplicationPeer', PATH_HOME . "engine/classes/model/ApplicationPeer.php"); Bootstrap::registerClass('Application', PATH_HOME . "engine/classes/model/Application.php"); @@ -473,6 +473,10 @@ Bootstrap::registerClass('BaseAppHistory', PATH_HOME . "engine/classes/model Bootstrap::registerClass('AppHistory', PATH_HOME . "engine/classes/model/AppHistory.php"); Bootstrap::registerClass('AppHistoryPeer', PATH_HOME . "engine/classes/model/AppHistoryPeer.php"); +Bootstrap::registerClass('BaseAppFolder', PATH_HOME . "engine/classes/model/om/BaseAppFolder.php"); +Bootstrap::registerClass('AppFolder', PATH_HOME . "engine/classes/model/AppFolder.php"); +Bootstrap::registerClass('AppFolderPeer', PATH_HOME . "engine/classes/model/AppFolderPeer.php"); + Bootstrap::registerClass('BaseAppMessage', PATH_HOME . "engine/classes/model/om/BaseAppMessage.php"); Bootstrap::registerClass('AppMessage', PATH_HOME . "engine/classes/model/AppMessage.php"); Bootstrap::registerClass('BaseAppMessagePeer', PATH_HOME . "engine/classes/model/om/BaseAppMessagePeer.php"); @@ -495,8 +499,8 @@ Bootstrap::registerClass('BaseAppThread', PATH_HOME . "engine/classes/mode Bootstrap::registerClass('AppThread', PATH_HOME . "engine/classes/model/AppThread.php"); Bootstrap::registerClass('AppThreadPeer', PATH_HOME . "engine/classes/model/AppThreadPeer.php"); -Bootstrap::registerClass('BaseCaseScheduler', PATH_HOME . "engine/classes/model/om/BaseCaseScheduler.php"); -Bootstrap::registerClass('CaseScheduler', PATH_HOME . "engine/classes/model/CaseScheduler.php"); +Bootstrap::registerClass('BaseCaseScheduler', PATH_HOME . "engine/classes/model/om/BaseCaseScheduler.php"); +Bootstrap::registerClass('CaseScheduler', PATH_HOME . "engine/classes/model/CaseScheduler.php"); Bootstrap::registerClass('BaseCaseTracker', PATH_HOME . "engine/classes/model/om/BaseCaseTracker.php"); Bootstrap::registerClass('CaseTracker', PATH_HOME . "engine/classes/model/CaseTracker.php"); @@ -579,6 +583,9 @@ Bootstrap::registerClass('StepPeer', PATH_HOME . "engine/classes/mode Bootstrap::registerClass('BaseStepSupervisor', PATH_HOME . "engine/classes/model/om/BaseStepSupervisor.php"); Bootstrap::registerClass('StepSupervisor', PATH_HOME . "engine/classes/model/StepSupervisor.php"); +Bootstrap::registerClass('BaseStepSupervisorPeer',PATH_HOME . "engine/classes/model/om/BaseStepSupervisorPeer.php"); +Bootstrap::registerClass('StepSupervisorPeer', PATH_HOME . "engine/classes/model/StepSupervisorPeer.php"); + Bootstrap::registerClass('BaseStepTrigger', PATH_HOME . "engine/classes/model/om/BaseStepTrigger.php"); Bootstrap::registerClass('StepTrigger', PATH_HOME . "engine/classes/model/StepTrigger.php"); Bootstrap::registerClass('StepTriggerPeer', PATH_HOME . "engine/classes/model/StepTriggerPeer.php"); @@ -608,6 +615,7 @@ Bootstrap::registerClass('TaskUser', PATH_HOME . "engine/classes/mode Bootstrap::registerClass('BaseTriggers', PATH_HOME . "engine/classes/model/om/BaseTriggers.php"); Bootstrap::registerClass('Triggers', PATH_HOME . "engine/classes/model/Triggers.php"); +Bootstrap::registerClass('BaseTriggersPeer', PATH_HOME . "engine/classes/model/om/BaseTriggersPeer.php"); Bootstrap::registerClass('TriggersPeer', PATH_HOME . "engine/classes/model/TriggersPeer.php"); Bootstrap::registerClass('BaseUsers', PATH_HOME . "engine/classes/model/om/BaseUsers.php");