Merge remote-tracking branch 'upstream/master'

This commit is contained in:
user
2012-11-28 09:04:51 -04:00
44 changed files with 1221 additions and 651 deletions

View File

@@ -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;
}
};

View File

@@ -960,7 +960,7 @@ var callServer;callServer=new leimnud.module.rpc.xmlhttp({url:me.form.ajaxServer
else{for(var i=0;i<newcont.length;i++){var oAux=me.form.getElementByName(grid);if(oAux){var oAux2=oAux.getElementByName(row,newcont[i].name);if(oAux2){oAux2.setValue(newcont[i].value);oAux2.setContent(newcont[i].content);oAux2.updateDepententFields();}}}}}else{alert('Invalid response: '+response);}
return true;};this.setValue=function(newValue){me.element.value=newValue;};this.setContent=function(newContent){};this.setAttributes=function(attributes){for(var a in attributes){if(a=='formula'&&attributes[a]){sumaformu(this.element,attributes[a],attributes['mask']);}
switch(typeof(attributes[a])){case'string':case'int':case'boolean':if(a!='strTo'){switch(true){case typeof(me[a])==='undefined':case typeof(me[a])==='object':case typeof(me[a])==='function':case a==='isObject':case a==='isArray':break;default:me[a]=attributes[a];}}
else{me[a]=attributes[a];}}}};this.value=function(){return me.element.value;};this.toJSONString=function(){return'{'+me.name+':'+me.element.value.toJSONString()+'}';};this.highLight=function(){try{G.highLight(me.element);if(G.autoFirstField){me.element.focus();G.autoFirstField=false;setTimeout("G.autoFirstField=true;",1000);}}catch(e){}};}
else{me[a]=attributes[a];}}}};this.value=function(){return me.element.value;};this.toJSONString=function(){return'{"'+me.name+'":'+me.element.value.toJSONString()+'}';};this.highLight=function(){try{G.highLight(me.element);if(G.autoFirstField){me.element.focus();G.autoFirstField=false;setTimeout("G.autoFirstField=true;",1000);}}catch(e){}};}
function G_DropDown(form,element,name)
{var me=this;this.parent=G_Field;this.parent(form,element,name);this.setContent=function(content){var dd=me.element;var browser=getBrowserClient();if((browser.name=='msie')||((browser.name=='firefox')&&(browser.version<12))){while(dd.options.length>1)dd.remove(0);}else{for(var key in dd.options){dd.options[key]=null;}}
for(var o=0;o<content.options.length;o++){var optn=$dce("OPTION");optn.text=content.options[o].value;optn.value=content.options[o].key;dd.options[o]=optn;}};if(!element)return;leimnud.event.add(this.element,'change',this.updateDepententFields);}
@@ -1214,7 +1214,8 @@ var emailInvalidMessage="";for(j=0;j<fielEmailInvalid.length;j++){emailInvalidMe
var systemMessaggeInvalid="";if(invalid_fields.length>0){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;i<iLength;i++){oAux=__aObjects__[i].getElementByName(sObject);if(oAux){return oAux;}}
return oAux;};var saveAndRefreshForm=function(oObject){if(oObject){oObject.form.action+='&_REFRESH_=1';oObject.form.submit();}
else{var oAux=window.document.getElementsByTagName('form');if(oAux.length>0){oAux[0].action+='&_REFRESH_=1';oAux[0].submit();}}};var saveForm=function(oObject){if(oObject){ajax_post(oObject.form.action,oObject.form,'POST');}

View File

@@ -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<this.columns;i++)

View File

@@ -20,200 +20,208 @@
*
* 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']);
/*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 );
//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 = array ();
if (isset( $_SESSION['_DBArray'] )) {
$_DBArray = $_SESSION['_DBArray'];
}
}
$xmlFile = G::getUIDName(urlDecode($_POST['form']));
$sPath = XMLFORM_AJAX_PATH;
$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 );
//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]) ) {
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();
}
$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] => '');
$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]]);
$aValues[$_POST['row']] = array ($aKeys[0] => $newValue[$aKeys[0]]
);
$newValues[$sKey]->$_POST['grid'] = $aValues;
unset($newValues[$sKey]->$aKeys[0]);
}
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']){
//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;
$fieldBase[$r2][$key2] = is_array( $val ) ? $val[$key2] : $val;
}
}
}
}
}
$newValues = array();
$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;$r<sizeof($newValues);$r++) {
$newValues[$r]=(array)$newValues[$r];
$G_FORM->setValues($newValues[$r]);
//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 );
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'] );
} 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);
$dependentFields = array_merge( $dependentFields, $myDependentFields );
}
}
if (isset($_POST['grid'])) $G_FORM->values=isset($_SESSION[$G_FORM->id]) ? $_SESSION[$G_FORM->id] : array();
}
if (isset( $_POST['grid'] ))
$G_FORM->values = isset( $_SESSION[$G_FORM->id] ) ? $_SESSION[$G_FORM->id] : array ();
$dependentFields=array_unique($dependentFields);
$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;
//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) {
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;
$sendContent[$r]->content->{$attribute} = $value;
break;
case 'options':
$sendContent[$r]->content->{$attribute}=toJSArray($value, $sendContent[$r]->content->type); break;
$sendContent[$r]->content->{$attribute} = toJSArray( $value, $sendContent[$r]->content->type );
break;
}
}
$sendContent[$r]->value=isset($G_FORM->values[$d]) ? $G_FORM->values[$d] : '';
$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) {
} else {
foreach ($G_FORM->fields[$_POST['grid']]->fields[$d] as $attribute => $value) {
switch ($attribute) {
case 'type':
$sendContent[$r]->content->{$attribute}=$value; break;
$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()));
$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] : '';
$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));
$r ++;
}
echo (Bootstrap::json_encode( $sendContent ));
function toJSArray($array, $type= '')
{
$result=array();
foreach($array as $k => $v){
$o=NULL;
$o->key=$k;
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;
$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();
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();
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);
if (strpos( $G_FORM->fields[$k]->dependentFields, ',' ) !== false) {
$myDependentFields = explode( ',', $G_FORM->fields[$k]->dependentFields );
} else {
$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]);
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();
} 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);
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 );
}
else {
$myDependentFields = explode( '|', $G_FORM->fields[$grid]->fields[$k]->dependentFields);
for ($r = 0; $r < sizeof( $myDependentFields ); $r ++) {
if ($myDependentFields[$r] == "")
unset( $myDependentFields[$r] );
}
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) );
// }
// $mD = $myDependentFields;
// foreach( $mD as $ki) {
// $myDependentFields = array_merge( $myDependentFields , subDependencies( $ki , $G_FORM , $aux, $grid) );
// }
}
return $myDependentFields;
}
?>
}

View File

@@ -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' );
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 );

View File

@@ -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

View File

@@ -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 .= "</script>\n";
$head .= "<script type='text/javascript' src='/js/maborak/core/maborak.loader.js'></script>\n";
return $head;
}

View File

@@ -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 );
}
}
}*/

View File

@@ -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 = '<a class="tableOption" href=\'' . $this->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' ) . '</a>';
$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 = "<a class=\"tableOption\" href=\"" . $this->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") . "</a>";
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 <array>
*/
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 = '<a class="tableOption" href=\'' . $this->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;"';
$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;
}
$html .= '>' . $this->htmlentities( $this->value === '' ? $label : $value, ENT_QUOTES, 'utf-8' ) . '</a>';
$result[] = $html;
$r ++;
}
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;

View File

@@ -147,13 +147,16 @@ 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();

View File

@@ -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");

View File

@@ -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",

View File

@@ -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
*

View File

@@ -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);

View File

@@ -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.

View File

@@ -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)

View File

@@ -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);
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

View File

@@ -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 );

View File

@@ -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 );
}

View File

@@ -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.

View File

@@ -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.

View File

@@ -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';
/**

View File

@@ -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';
/**
*

View File

@@ -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.

View File

@@ -4,7 +4,7 @@
* @package workflow.engine.classes.model
*/
require_once 'classes/model/om/BaseLogCasesScheduler.php';
//require_once 'classes/model/om/BaseLogCasesScheduler.php';
/**

View File

@@ -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';
/**

View File

@@ -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.

View File

@@ -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.

View File

@@ -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';
/**

View File

@@ -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';
/**

View File

@@ -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('<div id="importAjax" align="center"><img src="/images/ext/default/grid/loading.gif" /></div>');
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()) {

View File

@@ -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
//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"]
);
$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
}
}
//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']) {

View File

@@ -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 = '<select name="form[IMPORT_DYNA]" id="form[IMPORT_DYNA]" width="300" style="width: 300px" class="module_app_input___gray">';
$selectGroup = '';
while (is_array( $aRow )) {
if ($selectGroup != $aRow['PROC_NAME']) {
if ($selectGroup != '') {
$select .= '</optgroup>';
}
$selectGroup = $aRow['PROC_NAME'];
$select .= '<optgroup label="' . $aRow['PROC_NAME'] . '">';
}
$select .= '<option value="' . $aRow['DYN_FILENAME'] . '">' . $aRow['DYNA_NAME'] . '</option>';
$oDataset->next();
$aRow = $oDataset->getRow();
}
$select .= '</optgroup></select>';
$html = '<div id="importForm"><table width="100%" cellspacing="3" cellpadding="3" border="0">
<tbody>
<tr>
<td align="" colspan="2" style="background: none repeat scroll 0 0 #E0E7EF; border-bottom: 1px solid #C3D1DF;
color: #000000; font-weight: bold; padding-left: 5px; text-shadow: 0 1px 0 #FFFFFF;
font: 8px">
<span>' . G::LoadTranslation('ID_SELECT_DYNAFORM_IMPORT') . '</span>
</td>
</tr>
<tr>
<td width="40%" style="font: 11px/180% sans-serif,MiscFixed; color: #808080; text-align: right;">
<label for="form[IMPORT_DYNA]">' . G::LoadTranslation('ID_DYNAFORM') . '</label>
</td>
<td width="615" class="FormFieldContent">' . $select . '
</td>
</tr>
<tr>
<td align="center" colspan="2" class="FormButton">
<input type="button" onclick="dynaformEditor.import(document.getElementById(&#39;form[IMPORT_DYNA]&#39;).value);" value="' . G::LoadTranslation('ID_IMPORT') . '" class="module_app_button___gray " style=""> &nbsp;
<input type="button" onclick="panelImportDyna.remove();" value="' . G::LoadTranslation('ID_CANCEL') . '" class="module_app_button___gray " style="">
</td>
</tr>
</tbody>
</table><div>';
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.';
}

View File

@@ -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']) {

View File

@@ -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 ();

View File

@@ -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');
}
}
@@ -127,7 +125,7 @@ Ext.onReady(function(){
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: {
@@ -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'),
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'),
@@ -283,9 +251,7 @@ Ext.onReady(function(){
txtSearchUser,
txtPassword ,
txtIdentifier,
txtaClass,
txtoAddFilter,
txtAttributes
]
});
@@ -344,11 +310,9 @@ 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){
@@ -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
})
},

View File

@@ -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');
}
}
@@ -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: {
@@ -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
]
});
@@ -365,12 +331,10 @@ 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){

View File

@@ -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());

View File

@@ -31,4 +31,5 @@
<GET_UID type="link" colWidth="40" value="UID" link="#" onclick="msgBox(&#039;UID: &#039;+@QDBS_UID, &#039;info&#039;);return false;"/>
</dynaForm>

View File

@@ -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);

View File

@@ -9,6 +9,9 @@
<saveasDyna type="toolButton" class="ss_sprite button_toolbar ss_disk_multiple" onclick="dynaformEditor.save_as()" buttonType="class">
<en>Save as</en>
</saveasDyna>
<importDyna type="toolButton" class="ss_sprite button_toolbar ss_application_side_expand" onclick="dynaformEditor.importForm()" buttonType="class">
<en>Import</en>
</importDyna>
<!--.-->
<separator2 type="toolButton" file="images/dynamicForm/separatorTable.gif" home="public_html" buttonStyle=""/>
<text type="toolButton" class="ss_sprite button_toolbar ss_textfield" onclick="fieldsAdd('text')" buttonType="class">

View File

@@ -13,10 +13,12 @@
</LBLTITLE1>
<PROCESS_UID type="dropdown" dependentfields="TRIGGER_UID">
<![CDATA[
SELECT PRO.PRO_UID, CON.CON_VALUE
FROM PROCESS AS PRO, CONTENT AS CON
WHERE PRO.PRO_UID = CON.CON_ID AND CON.CON_CATEGORY = 'PRO_TITLE' AND CON.CON_LANG = '@#LANG'
ORDER BY CON.CON_VALUE ASC
]]>
<en>
Process
@@ -25,11 +27,13 @@
</PROCESS_UID>
<TRIGGER_UID type="dropdown" dependentfields="TRI_DESCRIPTION,TRI_WEBBOT">
<![CDATA[
SELECT TGR.TRI_UID, CON.CON_VALUE
FROM TRIGGERS AS TGR, CONTENT AS CON
WHERE TGR.PRO_UID = '@#PROCESS_UID' AND
TGR.TRI_UID = CON.CON_ID AND CON.CON_CATEGORY = 'TRI_TITLE' AND CON.CON_LANG = '@#LANG'
ORDER BY CON.CON_VALUE ASC
]]>
<en>
Trigger
@@ -42,17 +46,21 @@
</TRI_TITLE>
<TRI_DESCRIPTION type="textarea" rows="3" cols="67">
<![CDATA[
SELECT CON.CON_VALUE
FROM CONTENT AS CON
WHERE CON.CON_ID = '@#TRIGGER_UID' AND CON.CON_CATEGORY = 'TRI_DESCRIPTION' AND CON.CON_LANG = '@#LANG'
]]>
<en>Description of the new trigger</en>
</TRI_DESCRIPTION>
<TRI_WEBBOT type="textarea" rows="10" cols="67" readonly="1">
<![CDATA[
SELECT TGR.TRI_WEBBOT
FROM TRIGGERS AS TGR
WHERE TGR.TRI_UID = '@#TRIGGER_UID'
]]>
<en>Script</en>
</TRI_WEBBOT>

View File

@@ -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');
@@ -434,6 +432,8 @@ Bootstrap::registerClass('Entity_Base', PATH_HOME . "engine/classes/enti
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");
@@ -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");