Conflictos arreglados

This commit is contained in:
Brayan Pereyra
2015-02-12 16:37:06 -04:00
20 changed files with 408 additions and 269 deletions

View File

@@ -1915,15 +1915,29 @@ function msgBox(msg, type, callbackAccept, callbackCancel){
switch(type){
case 'alert':
new leimnud.module.app.alert().make({
label: msg,
width: 350,
action:function(){
if( acceptEv ){
setTimeout(acceptEv, 1);
}
}.extend(this)
});
if (leimnud.browser.isIE) {
new leimnud.module.app.alert().make({
label: msg,
width: 450,
height: 120,
action:function(){
if( acceptEv ){
setTimeout(acceptEv, 1);
}
}.extend(this)
});
}else{
new leimnud.module.app.alert().make({
label: msg,
width: 350,
action:function(){
if( acceptEv ){
setTimeout(acceptEv, 1);
}
}.extend(this)
});
}
break;
case 'info':
new leimnud.module.app.info().make({

View File

@@ -742,36 +742,75 @@ var G_Grid = function(oForm, sGridName){
this.deleteGridRow = function (sRow, bWithoutConfirm)
{
if (typeof(bWithoutConfirm) == "undefined") {
bWithoutConfirm = false;
}
if (this.oGrid.rows.length == 2) {
new leimnud.module.app.alert().make({
label: G_STRINGS.ID_MSG_NODELETE_GRID_ITEM
});
return false;
}
if (bWithoutConfirm) {
if (this.oGrid.rows.length == 3) {
this.clearRowWC(this, sRow);
} else {
this.deleteRowWC(this, sRow);
if (leimnud.browser.isIE) {
if (typeof(bWithoutConfirm) == "undefined") {
bWithoutConfirm = false;
}
} else {
if (this.oGrid.rows.length == 3) {
new leimnud.module.app.confirm().make({
label: _('ID_MSG_CLEAR_GRID_FIRST_ITEM'),
action: function () {
this.clearRowWC(this, sRow);
}.extend(this)
if (this.oGrid.rows.length == 2) {
new leimnud.module.app.alert().make({
label: G_STRINGS.ID_MSG_NODELETE_GRID_ITEM,
width:400, height:120
});
return false;
}
if (bWithoutConfirm) {
if (this.oGrid.rows.length == 3) {
this.clearRowWC(this, sRow);
} else {
this.deleteRowWC(this, sRow);
}
} else {
new leimnud.module.app.confirm().make({
label: G_STRINGS.ID_MSG_DELETE_GRID_ITEM,
action: function () {
this.deleteRowWC(this, sRow);
}.extend(this)
if (this.oGrid.rows.length == 3) {
new leimnud.module.app.confirm().make({
label: _('ID_MSG_CLEAR_GRID_FIRST_ITEM'),
width:400, height:120,
action: function () {
this.clearRowWC(this, sRow);
}.extend(this)
});
} else {
new leimnud.module.app.confirm().make({
label: G_STRINGS.ID_MSG_DELETE_GRID_ITEM,
width:400, height:120,
action: function () {
this.deleteRowWC(this, sRow);
}.extend(this)
});
}
}
}else{
if (typeof(bWithoutConfirm) == "undefined") {
bWithoutConfirm = false;
}
if (this.oGrid.rows.length == 2) {
new leimnud.module.app.alert().make({
label: G_STRINGS.ID_MSG_NODELETE_GRID_ITEM
});
return false;
}
if (bWithoutConfirm) {
if (this.oGrid.rows.length == 3) {
this.clearRowWC(this, sRow);
} else {
this.deleteRowWC(this, sRow);
}
} else {
if (this.oGrid.rows.length == 3) {
new leimnud.module.app.confirm().make({
label: _('ID_MSG_CLEAR_GRID_FIRST_ITEM'),
action: function () {
this.clearRowWC(this, sRow);
}.extend(this)
});
} else {
new leimnud.module.app.confirm().make({
label: G_STRINGS.ID_MSG_DELETE_GRID_ITEM,
action: function () {
this.deleteRowWC(this, sRow);
}.extend(this)
});
}
}
}
};

View File

@@ -136,7 +136,7 @@ if(methods[i][2]===true){_return_.push(tmp);}}}
else if(typeof methods[i]=="function")
{methods[i].apply(instance);}}}
return(_return_.length==1)?_return_[0]:_return_;};this.checkBrowser=function()
{var userAgent=navigator.userAgent;var u;this.browser={isIE:((userAgent.indexOf('MSIE')>=0)?true:false),isNS:((userAgent.indexOf('Netscape6/')>=0)?true:false),isFF:((userAgent.indexOf('Firefox')>=0)?true:false),isSF:((userAgent.indexOf('Safari')>=0)?true:false),isGK:((userAgent.indexOf('Gecko')>=0)?true:false),isIphone:((userAgent.indexOf('iPhone')>=0)?true:false),isOP:((userAgent.indexOf('Opera')>=0)?true:false)};this.browser.isIE=(this.browser.isOP)?false:this.browser.isIE;var checkFor=["MSIE","Netscape/6","Firefox","Safari","Gecko","Opera","iPhone"];for(var i=0;i<checkFor.length;i++)
{var userAgent=navigator.userAgent;var u;this.browser={isIE:((userAgent.indexOf('MSIE')>=0||!!navigator.userAgent.match(/Trident.*rv\:11\./))?true:false),isNS:((userAgent.indexOf('Netscape6/')>=0)?true:false),isFF:((userAgent.indexOf('Firefox')>=0)?true:false),isSF:((userAgent.indexOf('Safari')>=0)?true:false),isGK:((userAgent.indexOf('Gecko')>=0)?true:false),isIphone:((userAgent.indexOf('iPhone')>=0)?true:false),isOP:((userAgent.indexOf('Opera')>=0)?true:false)};this.browser.isIE=(this.browser.isOP)?false:this.browser.isIE;var checkFor=["MSIE","Netscape/6","Firefox","Safari","Gecko","Opera","iPhone"];for(var i=0;i<checkFor.length;i++)
{var j=userAgent.indexOf(checkFor[i]);this.browser.version=userAgent+"::::"+userAgent.substr(j+checkFor[i].length);}};this.mantis=function()
{this.db=[];this.flush=function()
{var i=0;while(this.db.length>0)
@@ -762,7 +762,8 @@ Array.prototype.drop=function(x){this.splice(x,1);}
Array.prototype.deleteByValue=function(val){var eindex=this.find(val);this.drop(eindex);}
function Timer(functionName,time){setTimeout(functionName,time*1000);}
function PMOS_TemporalMessage(timeToHide){fade('temporalMessageTD','inOut');if(typeof(timeToHide)!='undefined'){Timer(function(){try{document.getElementById('temporalMessageTD').style.display='none';}catch(e){}},timeToHide);}}
function msgBox(msg,type,callbackAccept,callbackCancel){type=typeof(type)!='undefined'?type:'info';acceptEv=typeof(callbackAccept)!='undefined'?callbackAccept:false;cancelEv=typeof(callbackCancel)!='undefined'?callbackCancel:false;switch(type){case'alert':new leimnud.module.app.alert().make({label:msg,width:350,action:function(){if(acceptEv){setTimeout(acceptEv,1);}}.extend(this)});break;case'info':new leimnud.module.app.info().make({label:msg,width:350,action:function(){if(acceptEv){setTimeout(acceptEv,1);}}.extend(this)});break;case'confirm':if(cancelEv){new leimnud.module.app.confirm().make({label:msg,action:function(){if(acceptEv){setTimeout(acceptEv,0);}}.extend(this),cancel:function(){setTimeout(cancelEv,1);}.extend(this)});}else{new leimnud.module.app.confirm().make({label:msg,action:function(){if(acceptEv){setTimeout(acceptEv,1);}}.extend(this)});}
function msgBox(msg,type,callbackAccept,callbackCancel){type=typeof(type)!='undefined'?type:'info';acceptEv=typeof(callbackAccept)!='undefined'?callbackAccept:false;cancelEv=typeof(callbackCancel)!='undefined'?callbackCancel:false;switch(type){case'alert':if(leimnud.browser.isIE){new leimnud.module.app.alert().make({label:msg,width:450,height:120,action:function(){if(acceptEv){setTimeout(acceptEv,1);}}.extend(this)});}else{new leimnud.module.app.alert().make({label:msg,width:350,action:function(){if(acceptEv){setTimeout(acceptEv,1);}}.extend(this)});}
break;case'info':new leimnud.module.app.info().make({label:msg,width:350,action:function(){if(acceptEv){setTimeout(acceptEv,1);}}.extend(this)});break;case'confirm':if(cancelEv){new leimnud.module.app.confirm().make({label:msg,action:function(){if(acceptEv){setTimeout(acceptEv,0);}}.extend(this),cancel:function(){setTimeout(cancelEv,1);}.extend(this)});}else{new leimnud.module.app.confirm().make({label:msg,action:function(){if(acceptEv){setTimeout(acceptEv,1);}}.extend(this)});}
break;}}
function executeEvent(id,ev){switch(ev){case'click':document.getElementById(id).checked=true;if(document.getElementById(id).onclick){try{document.getElementById(id).onclick();}catch(e){}}
break;}}
@@ -1416,9 +1417,11 @@ if(!exist){oAux.updateDepententFields();}}}}
for(var i=0;i<this.aFields.length;i++){var fieldName='form['+sGridName+']['+currentRow+']['+this.aFields[i].sFieldName+']';if(this.aFields[i].sType=='suggest'){fieldName='form['+sGridName+']['+currentRow+']['+this.aFields[i].sFieldName+'_label]';}
if(this.aFields[i].sType!='file'&&this.aFields[i].sType!='hidden'&&document.getElementById(fieldName).focus){document.getElementById(fieldName).focus();break;}}
if(this.onaddrow){this.onaddrow(currentRow);}};this.deleteGridRow=function(sRow,bWithoutConfirm)
{if(typeof(bWithoutConfirm)=="undefined"){bWithoutConfirm=false;}
{if(leimnud.browser.isIE){if(typeof(bWithoutConfirm)=="undefined"){bWithoutConfirm=false;}
if(this.oGrid.rows.length==2){new leimnud.module.app.alert().make({label:G_STRINGS.ID_MSG_NODELETE_GRID_ITEM,width:400,height:120});return false;}
if(bWithoutConfirm){if(this.oGrid.rows.length==3){this.clearRowWC(this,sRow);}else{this.deleteRowWC(this,sRow);}}else{if(this.oGrid.rows.length==3){new leimnud.module.app.confirm().make({label:_('ID_MSG_CLEAR_GRID_FIRST_ITEM'),width:400,height:120,action:function(){this.clearRowWC(this,sRow);}.extend(this)});}else{new leimnud.module.app.confirm().make({label:G_STRINGS.ID_MSG_DELETE_GRID_ITEM,width:400,height:120,action:function(){this.deleteRowWC(this,sRow);}.extend(this)});}}}else{if(typeof(bWithoutConfirm)=="undefined"){bWithoutConfirm=false;}
if(this.oGrid.rows.length==2){new leimnud.module.app.alert().make({label:G_STRINGS.ID_MSG_NODELETE_GRID_ITEM});return false;}
if(bWithoutConfirm){if(this.oGrid.rows.length==3){this.clearRowWC(this,sRow);}else{this.deleteRowWC(this,sRow);}}else{if(this.oGrid.rows.length==3){new leimnud.module.app.confirm().make({label:_('ID_MSG_CLEAR_GRID_FIRST_ITEM'),action:function(){this.clearRowWC(this,sRow);}.extend(this)});}else{new leimnud.module.app.confirm().make({label:G_STRINGS.ID_MSG_DELETE_GRID_ITEM,action:function(){this.deleteRowWC(this,sRow);}.extend(this)});}}};this.deleteRowWC=function(oObj,aRow)
if(bWithoutConfirm){if(this.oGrid.rows.length==3){this.clearRowWC(this,sRow);}else{this.deleteRowWC(this,sRow);}}else{if(this.oGrid.rows.length==3){new leimnud.module.app.confirm().make({label:_('ID_MSG_CLEAR_GRID_FIRST_ITEM'),action:function(){this.clearRowWC(this,sRow);}.extend(this)});}else{new leimnud.module.app.confirm().make({label:G_STRINGS.ID_MSG_DELETE_GRID_ITEM,action:function(){this.deleteRowWC(this,sRow);}.extend(this)});}}}};this.deleteRowWC=function(oObj,aRow)
{var sRow=new String(aRow);sRow=sRow.replace("[","");sRow=sRow.replace("]","");var iRow=Number(sRow);var iRowAux=iRow+1;var lastItem=oObj.oGrid.rows.length-2;var elemNodeName="";var elem2ParentNode;var elem2Id="";var elem2Name="";var elemAux;deleteRowOnDynaform(oObj,iRow);var i=0;while(iRowAux<=(lastItem)){for(i=1;i<oObj.oGrid.rows[iRowAux-1].cells.length;i++){var oCell1=oObj.oGrid.rows[iRowAux-1].cells[i];var oCell2=oObj.oGrid.rows[iRowAux].cells[i];elemNodeName=oCell1.innerHTML.substring(oCell1.innerHTML.indexOf("<")+1,oCell1.innerHTML.indexOf(" ")).toLowerCase();switch(elemNodeName){case"input":aObjects1=oCell1.getElementsByTagName('input');aObjects2=oCell2.getElementsByTagName('input');if(aObjects1&&aObjects2){switch(aObjects2[0].type){case"file":elem2ParentNode=aObjects2[0].parentNode;elem2Id=aObjects2[0].id;elem2Name=aObjects2[0].name;aObjects2[0].id=aObjects1[0].id;aObjects2[0].name=aObjects1[0].name;aObjects1[0].parentNode.replaceChild(aObjects2[0],aObjects1[0]);elemAux=document.createElement("input");elemAux.type="file";elemAux.setAttribute("id",elem2Id);elemAux.setAttribute("name",elem2Name);elem2ParentNode.insertBefore(elemAux,elem2ParentNode.firstChild);break;default:if(aObjects2[0].type=="checkbox"){aObjects1[0].checked=aObjects2[0].checked;}
aObjects1[0].value=aObjects2[0].value;aObjects1[0].className=aObjects2[0].className;if(typeof(aObjects1[1])!='undefined'&&typeof(aObjects2[1])!='undefined'){aObjects1[1].value=aObjects2[1].value;}
break;}}

View File

@@ -834,7 +834,8 @@ var maborak = function(forceCssLoad){
var userAgent=navigator.userAgent;
var u;
this.browser={
isIE:((userAgent.indexOf('MSIE')>=0)?true:false),
isIE:((userAgent.indexOf('MSIE')>=0 || !!navigator.userAgent.match(/Trident.*rv\:11\./))?true:false),
isNS:((userAgent.indexOf('Netscape6/')>=0)?true:false),
isFF:((userAgent.indexOf('Firefox')>=0)?true:false),
isSF:((userAgent.indexOf('Safari')>=0)?true:false),

View File

@@ -373,8 +373,12 @@ class Configurations // extends Configuration
*/
public function getFormats()
{
$this->UserConfig = $this->getConfiguration("ENVIRONMENT_SETTINGS", "");
if (!isset($this->UserConfig)) {
$this->UserConfig = array();
}
if (empty($this->UserConfig)) {
$this->UserConfig = $this->getConfiguration("ENVIRONMENT_SETTINGS", "");
}
if (is_numeric($this->UserConfig)) {
$this->UserConfig = array();
}

View File

@@ -86,8 +86,8 @@ class spoolRun
$this->ExceptionCode['WARNING'] = 2;
$this->ExceptionCode['NOTICE'] = 3;
$this->longMailEreg = '/(.*)(<([\w\-\.]+@[\w\-_\.]+\.\w{2,5})+>)/';
$this->mailEreg = '/^([\w\-_\.]+@[\w\-_\.]+\.\w{2,5}+)$/';
$this->longMailEreg = "/(.*)(<([\w\-\.']+@[\w\-_\.]+\.\w{2,5})+>)/";
$this->mailEreg = "/^([\w\-_\.']+@[\w\-_\.]+\.\w{2,5}+)$/";
}
/**
@@ -229,15 +229,17 @@ class spoolRun
$this->fileData['envelope_to'] = array ();
$this->fileData["contentTypeIsHtml"] = $bContentTypeIsHtml;
if ($this->config['MESS_ENGINE'] == 'OPENMAIL') {
if ($this->config['MESS_SERVER'] != '') {
if (($sAux = @gethostbyaddr( $this->config['MESS_SERVER'] ))) {
$this->fileData['domain'] = $sAux;
if (array_key_exists('MESS_ENGINE',$this->config)) {
if ($this->config['MESS_ENGINE'] == 'OPENMAIL') {
if ($this->config['MESS_SERVER'] != '') {
if (($sAux = @gethostbyaddr( $this->config['MESS_SERVER'] ))) {
$this->fileData['domain'] = $sAux;
} else {
$this->fileData['domain'] = $this->config['MESS_SERVER'];
}
} else {
$this->fileData['domain'] = $this->config['MESS_SERVER'];
$this->fileData['domain'] = gethostbyaddr( '127.0.0.1' );
}
} else {
$this->fileData['domain'] = gethostbyaddr( '127.0.0.1' );
}
}
}
@@ -287,7 +289,7 @@ class spoolRun
*/
private function handleFrom ()
{
$eregA = "/^.*@.*$/";
$eregA = "/^'.*@.*$/";
if (strpos( $this->fileData['from'], '<' ) !== false) {
//to validate complex email address i.e. Erik A. O <erik@colosa.com>
@@ -416,164 +418,166 @@ class spoolRun
private function handleMail ()
{
if (count( $this->fileData['envelope_to'] ) > 0) {
switch ($this->config['MESS_ENGINE']) {
case 'MAIL':
case 'PHPMAILER':
G::LoadThirdParty( 'phpmailer', 'class.phpmailer' );
switch ($this->config['MESS_ENGINE']) {
case 'MAIL':
$oPHPMailer = new PHPMailer();
$oPHPMailer->Mailer = 'mail';
break;
case 'PHPMAILER':
$oPHPMailer = new PHPMailer( true );
$oPHPMailer->Mailer = 'smtp';
break;
}
$oPHPMailer->SMTPAuth = (isset( $this->config['SMTPAuth'] ) ? $this->config['SMTPAuth'] : '');
switch ($this->config['MESS_ENGINE']) {
case 'MAIL':
break;
case 'PHPMAILER':
//Posible Options for SMTPSecure are: "", "ssl" or "tls"
if (isset( $this->config['SMTPSecure'] ) && preg_match( '/^(ssl|tls)$/', $this->config['SMTPSecure'] )) {
$oPHPMailer->SMTPSecure = $this->config['SMTPSecure'];
}
break;
}
$oPHPMailer->CharSet = "UTF-8";
$oPHPMailer->Encoding = "8bit";
$oPHPMailer->Host = $this->config['MESS_SERVER'];
$oPHPMailer->Port = $this->config['MESS_PORT'];
$oPHPMailer->Username = $this->config['MESS_ACCOUNT'];
$oPHPMailer->Password = $this->config['MESS_PASSWORD'];
$oPHPMailer->From = $this->fileData['from_email'];
$oPHPMailer->FromName = utf8_decode( $this->fileData['from_name'] );
if (isset($this->fileData['reply_to'])) {
if ($this->fileData['reply_to'] != '') {
$oPHPMailer->AddReplyTo($this->fileData['reply_to'], $this->fileData['reply_to_name']);
if (array_key_exists('MESS_ENGINE',$this->config)) {
switch ($this->config['MESS_ENGINE']) {
case 'MAIL':
case 'PHPMAILER':
G::LoadThirdParty( 'phpmailer', 'class.phpmailer' );
switch ($this->config['MESS_ENGINE']) {
case 'MAIL':
$oPHPMailer = new PHPMailer();
$oPHPMailer->Mailer = 'mail';
break;
case 'PHPMAILER':
$oPHPMailer = new PHPMailer( true );
$oPHPMailer->Mailer = 'smtp';
break;
}
}
$msSubject = $this->fileData['subject'];
if (! (mb_detect_encoding( $msSubject, "UTF-8" ) == "UTF-8")) {
$msSubject = utf8_encode( $msSubject );
}
$oPHPMailer->Subject = $msSubject;
$msBody = $this->fileData['body'];
if (! (mb_detect_encoding( $msBody, "UTF-8" ) == "UTF-8")) {
$msBody = utf8_encode( $msBody );
}
$oPHPMailer->Body = $msBody;
$attachment = @unserialize($this->fileData['attachments']);
if ($attachment === false) {
$attachment = $this->fileData['attachments'];
}
if (is_array($attachment)) {
foreach ($attachment as $key => $fileAttach) {
if (file_exists( $fileAttach )) {
$oPHPMailer->AddAttachment( $fileAttach, is_int( $key ) ? '' : $key );
$oPHPMailer->SMTPAuth = (isset( $this->config['SMTPAuth'] ) ? $this->config['SMTPAuth'] : '');
switch ($this->config['MESS_ENGINE']) {
case 'MAIL':
break;
case 'PHPMAILER':
//Posible Options for SMTPSecure are: "", "ssl" or "tls"
if (isset( $this->config['SMTPSecure'] ) && preg_match( '/^(ssl|tls)$/', $this->config['SMTPSecure'] )) {
$oPHPMailer->SMTPSecure = $this->config['SMTPSecure'];
}
break;
}
$oPHPMailer->CharSet = "UTF-8";
$oPHPMailer->Encoding = "8bit";
$oPHPMailer->Host = $this->config['MESS_SERVER'];
$oPHPMailer->Port = $this->config['MESS_PORT'];
$oPHPMailer->Username = $this->config['MESS_ACCOUNT'];
$oPHPMailer->Password = $this->config['MESS_PASSWORD'];
$oPHPMailer->From = $this->fileData['from_email'];
$oPHPMailer->FromName = utf8_decode( $this->fileData['from_name'] );
if (isset($this->fileData['reply_to'])) {
if ($this->fileData['reply_to'] != '') {
$oPHPMailer->AddReplyTo($this->fileData['reply_to'], $this->fileData['reply_to_name']);
}
}
}
foreach ($this->fileData['envelope_to'] as $sEmail) {
if (strpos( $sEmail, '<' ) !== false) {
preg_match( $this->longMailEreg, $sEmail, $matches );
$sTo = trim( $matches[3] );
$sToName = trim( $matches[1] );
$oPHPMailer->AddAddress( $sTo, $sToName );
} else {
$oPHPMailer->AddAddress( $sEmail );
$msSubject = $this->fileData['subject'];
if (! (mb_detect_encoding( $msSubject, "UTF-8" ) == "UTF-8")) {
$msSubject = utf8_encode( $msSubject );
}
}
//CC
foreach ($this->fileData['envelope_cc'] as $sEmail) {
if (strpos( $sEmail, '<' ) !== false) {
preg_match( $this->longMailEreg, $sEmail, $matches );
$sTo = trim( $matches[3] );
$sToName = trim( $matches[1] );
$oPHPMailer->AddCC( $sTo, $sToName );
} else {
$oPHPMailer->AddCC( $sEmail );
$oPHPMailer->Subject = $msSubject;
$msBody = $this->fileData['body'];
if (! (mb_detect_encoding( $msBody, "UTF-8" ) == "UTF-8")) {
$msBody = utf8_encode( $msBody );
}
}
//BCC
foreach ($this->fileData['envelope_bcc'] as $sEmail) {
if (strpos( $sEmail, '<' ) !== false) {
preg_match( $this->longMailEreg, $sEmail, $matches );
$sTo = trim( $matches[3] );
$sToName = trim( $matches[1] );
$oPHPMailer->AddBCC( $sTo, $sToName );
} else {
$oPHPMailer->AddBCC( $sEmail );
$oPHPMailer->Body = $msBody;
$attachment = @unserialize($this->fileData['attachments']);
if ($attachment === false) {
$attachment = $this->fileData['attachments'];
}
}
$oPHPMailer->IsHTML($this->fileData["contentTypeIsHtml"]);
if ( $this->config['MESS_ENGINE'] == 'MAIL') {
$oPHPMailer->WordWrap = 300;
}
if ($oPHPMailer->Send()) {
$this->error = '';
$this->status = 'sent';
} else {
$this->error = $oPHPMailer->ErrorInfo;
$this->status = 'failed';
}
break;
case 'OPENMAIL':
G::LoadClass( 'package' );
G::LoadClass( 'smtp' );
$pack = new package( $this->fileData );
$header = $pack->returnHeader();
$body = $pack->returnBody();
$send = new smtp();
$send->setServer( $this->config['MESS_SERVER'] );
$send->setPort( $this->config['MESS_PORT'] );
$send->setUsername( $this->config['MESS_ACCOUNT'] );
$passwd = $this->config['MESS_PASSWORD'];
$passwdDec = G::decrypt( $passwd, 'EMAILENCRYPT' );
$auxPass = explode( 'hash:', $passwdDec );
if (count( $auxPass ) > 1) {
if (count( $auxPass ) == 2) {
$passwd = $auxPass[1];
} else {
array_shift( $auxPass );
$passwd = implode( '', $auxPass );
if (is_array($attachment)) {
foreach ($attachment as $key => $fileAttach) {
if (file_exists( $fileAttach )) {
$oPHPMailer->AddAttachment( $fileAttach, is_int( $key ) ? '' : $key );
}
}
}
}
$this->config['MESS_PASSWORD'] = $passwd;
$send->setPassword( $this->config['MESS_PASSWORD'] );
$send->setReturnPath( $this->fileData['from_email'] );
$send->setHeaders( $header );
$send->setBody( $body );
$send->setEnvelopeTo( $this->fileData['envelope_to'] );
if ($send->sendMessage()) {
$this->error = '';
$this->status = 'sent';
} else {
$this->error = implode( ', ', $send->returnErrors() );
$this->status = 'failed';
}
break;
foreach ($this->fileData['envelope_to'] as $sEmail) {
if (strpos( $sEmail, '<' ) !== false) {
preg_match( $this->longMailEreg, $sEmail, $matches );
$sTo = trim( $matches[3] );
$sToName = trim( $matches[1] );
$oPHPMailer->AddAddress( $sTo, $sToName );
} else {
$oPHPMailer->AddAddress( $sEmail );
}
}
//CC
foreach ($this->fileData['envelope_cc'] as $sEmail) {
if (strpos( $sEmail, '<' ) !== false) {
preg_match( $this->longMailEreg, $sEmail, $matches );
$sTo = trim( $matches[3] );
$sToName = trim( $matches[1] );
$oPHPMailer->AddCC( $sTo, $sToName );
} else {
$oPHPMailer->AddCC( $sEmail );
}
}
//BCC
foreach ($this->fileData['envelope_bcc'] as $sEmail) {
if (strpos( $sEmail, '<' ) !== false) {
preg_match( $this->longMailEreg, $sEmail, $matches );
$sTo = trim( $matches[3] );
$sToName = trim( $matches[1] );
$oPHPMailer->AddBCC( $sTo, $sToName );
} else {
$oPHPMailer->AddBCC( $sEmail );
}
}
$oPHPMailer->IsHTML($this->fileData["contentTypeIsHtml"]);
if ( $this->config['MESS_ENGINE'] == 'MAIL') {
$oPHPMailer->WordWrap = 300;
}
if ($oPHPMailer->Send()) {
$this->error = '';
$this->status = 'sent';
} else {
$this->error = $oPHPMailer->ErrorInfo;
$this->status = 'failed';
}
break;
case 'OPENMAIL':
G::LoadClass( 'package' );
G::LoadClass( 'smtp' );
$pack = new package( $this->fileData );
$header = $pack->returnHeader();
$body = $pack->returnBody();
$send = new smtp();
$send->setServer( $this->config['MESS_SERVER'] );
$send->setPort( $this->config['MESS_PORT'] );
$send->setUsername( $this->config['MESS_ACCOUNT'] );
$passwd = $this->config['MESS_PASSWORD'];
$passwdDec = G::decrypt( $passwd, 'EMAILENCRYPT' );
$auxPass = explode( 'hash:', $passwdDec );
if (count( $auxPass ) > 1) {
if (count( $auxPass ) == 2) {
$passwd = $auxPass[1];
} else {
array_shift( $auxPass );
$passwd = implode( '', $auxPass );
}
}
$this->config['MESS_PASSWORD'] = $passwd;
$send->setPassword( $this->config['MESS_PASSWORD'] );
$send->setReturnPath( $this->fileData['from_email'] );
$send->setHeaders( $header );
$send->setBody( $body );
$send->setEnvelopeTo( $this->fileData['envelope_to'] );
if ($send->sendMessage()) {
$this->error = '';
$this->status = 'sent';
} else {
$this->error = implode( ', ', $send->returnErrors() );
$this->status = 'failed';
}
break;
}
}
}
}

View File

@@ -576,5 +576,30 @@ class AppDelegation extends BaseAppDelegation
$data = $oRuleSet->getRow();
return $data['TAS_UID'];
}
/**
* Verify if the current case is already routed.
*
* @param string $AppUid the uid of the application
* @return array $Fields the fields
*/
public function alreadyRouted ($appUid, $sDelIndex)
{
$c = new Criteria("workflow");
$c->clearSelectColumns();
$c->addSelectColumn(AppDelegationPeer::APP_UID);
$c->add(AppDelegationPeer::APP_UID, $appUid);
$c->add(AppDelegationPeer::DEL_INDEX, $sDelIndex);
$c->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNOTNULL);
$result = AppDelegationPeer::doSelectRS($c);
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
if($result->next()) {
return true;
} else {
return false;
}
}
}

View File

@@ -42,14 +42,26 @@ G::LoadClass( 'case' );
$actionAjax = isset( $_REQUEST['actionAjax'] ) ? $_REQUEST['actionAjax'] : null;
function filterUserListArray($users = array(), $filter = '')
{
$filteredUsers = array();
foreach ($users as $user) {
if(stripos($user['USR_FULLNAME'], $filter) || empty($filter)) {
$filteredUsers[] = $user;
}
}
return $filteredUsers;
}
if ($actionAjax == "userValues") {
//global $oAppCache;
$oAppCache = new AppCacheView();
$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : null;
$query = isset( $_REQUEST['query'] ) ? $_REQUEST['query'] : null;
$users = array();
$users[] = array ("USR_UID" => "", "USR_FULLNAME" => G::LoadTranslation( "ID_ALL_USERS" ));
$users[] = array ("USR_UID" => "CURRENT_USER", "USR_FULLNAME" => G::LoadTranslation( "ID_CURRENT_USER" ));
$users = filterUserListArray($users, $query);
//now get users, just for the Search action
switch ($action) {
case 'search_simple':
@@ -67,6 +79,14 @@ if ($actionAjax == "userValues") {
$cUsers->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$cUsers->addSelectColumn(UsersPeer::USR_LASTNAME);
$cUsers->add( UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL );
if (!is_null($query)) {
$filters = $cUsers->getNewCriterion( UsersPeer::USR_FIRSTNAME, '%'.$query.'%', Criteria::LIKE )->addOr(
$cUsers->getNewCriterion( UsersPeer::USR_LASTNAME, '%'.$query.'%', Criteria::LIKE )->addOr(
$cUsers->getNewCriterion( UsersPeer::USR_USERNAME, '%'.$query.'%', Criteria::LIKE )));
$cUsers->addOr( $filters );
}
$cUsers->setLimit(20);
$cUsers->addAscendingOrderByColumn(UsersPeer::TABLE_NAME . "." . $conf->userNameFormatGetFirstFieldByUsersTable());
$oDataset = UsersPeer::doSelectRS( $cUsers );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
@@ -453,7 +473,7 @@ if ($actionAjax == 'showDynaformListHistory') {
var showDynaformHistoryGlobal = {};
showDynaformHistoryGlobal.dynUID = '';
showDynaformHistoryGlobal.tablename = '';
showDynaformHistoryGlobal.dynDate = '';casesList_Ajax.php
showDynaformHistoryGlobal.dynDate = '';
showDynaformHistoryGlobal.dynTitle = '';
function showDynaformHistory(dynUID,tablename,dynDate,dynTitle){
showDynaformHistoryGlobal.dynUID = dynUID;

View File

@@ -77,7 +77,11 @@ try {
$aFields = $oCase->loadCase( $sAppUid, $iDelIndex );
// g::pr($aFields);
// die;
if (!isset($_SESSION['CURRENT_TASK'])) {
$_SESSION['CURRENT_TASK'] = $aFields['TAS_UID'];
} else if ($_SESSION['CURRENT_TASK'] == '') {
$_SESSION['CURRENT_TASK'] = $aFields['TAS_UID'];
}
switch ($aFields['APP_STATUS']) {
case 'DRAFT':
case 'TO_DO':

View File

@@ -1,4 +1,11 @@
<?php
require_once 'classes/model/AppDelegation.php';
$delegation = new AppDelegation();
if( $delegation->alreadyRouted($_SESSION['APPLICATION'],$_SESSION['INDEX']) ) {
G::header('location: ../cases/casesListExtJs');
die();
}
if (!isset($_SESSION['USER_LOGGED'])) {
G::SendTemporalMessage( 'ID_LOGIN_AGAIN', 'warning', 'labels' );
die( '<script type="text/javascript">

View File

@@ -62,6 +62,7 @@ foreach ($DEBUG_ERRORS as $error) {
]}';
*/
$triggersRet = new StdClass();
$triggersRet->total = count( $triggersList );
$triggersRet->data = $triggersList;
echo G::json_encode( $triggersRet );

View File

@@ -5,7 +5,6 @@
* @date Sept 13th, 2010
*
*/
G::LoadClass( "configuration" );
$request = isset( $_POST["request"] ) ? $_POST["request"] : (isset( $_GET["request"] ) ? $_GET["request"] : null);
@@ -39,17 +38,27 @@ switch ($request) {
if (is_numeric($config)) {
$config = array();
}
$config['format'] = $_POST["userFormat"];
$config['dateFormat'] = $_POST["dateFormat"];
if (isset($_POST["userFormat"])) {
$config['format'] = $_POST["userFormat"];
}
if (isset($_POST["dateFormat"])) {
$config['dateFormat'] = $_POST["dateFormat"];
}
$config['startCaseHideProcessInf'] = ((isset( $_POST["hideProcessInf"] )) ? true : false);
$config['casesListDateFormat'] = $_POST["casesListDateFormat"];
$config['casesListRowNumber'] = intval( $_POST["casesListRowNumber"] );
$config['casesListRefreshTime'] = intval( $_POST["txtCasesRefreshTime"]);
if (isset($_POST["casesListDateFormat"])) {
$config['casesListDateFormat'] = $_POST["casesListDateFormat"];
}
if (isset($_POST["casesListDateFormat"])) {
$config['casesListRowNumber'] = intval( $_POST["casesListRowNumber"] );
}
if (isset($_POST["txtCasesRefreshTime"])) {
$config['casesListRefreshTime'] = intval( $_POST["txtCasesRefreshTime"]);
}
$conf->aConfig = $config;
$conf->saveConfig( "ENVIRONMENT_SETTINGS", "" );
G::auditLog("UpdateEnvironmentSettings", "UserNameDisplayFormat -> ".$_POST["userFormat"].", GlobalDateFormat -> ".$_POST["dateFormat"].", HideProcessInformation -> ".(string)isset($_POST["hideProcessInf"]).", DateFormat -> ".$_POST["casesListDateFormat"].", NumberOfRowsPerPage -> ".$_POST["casesListRowNumber"].", RefreshTimeSeconds -> ".$_POST["txtCasesRefreshTime"]);
G::auditLog("UpdateEnvironmentSettings", "UserNameDisplayFormat -> ".(isset($_POST["userFormat"]) ? $_POST["userFormat"] : '').", GlobalDateFormat -> ".(isset($_POST["dateFormat"]) ? $_POST["dateFormat"] : '').", HideProcessInformation -> ".(string)isset($_POST["hideProcessInf"]).", DateFormat -> ".(isset($_POST["casesListDateFormat"]) ? $_POST["casesListDateFormat"] : '').", NumberOfRowsPerPage -> ".(isset($_POST["casesListRowNumber"]) ? $_POST["casesListRowNumber"] : '').", RefreshTimeSeconds -> ".(isset($_POST["txtCasesRefreshTime"]) ? $_POST["txtCasesRefreshTime"] : ''));
$response = new stdclass();
$response->success = true;

View File

@@ -22,13 +22,13 @@
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
/*
* dynaforms & documents for Case Tracker
*
* @author Everth S. Berrios Morales <everth@colosa.com>
*
/*
* dynaforms & documents for Case Tracker
*
* @author Everth S. Berrios Morales <everth@colosa.com>
*
*/
if (! isset( $_SESSION['PROCESS'] )) {
if (! isset( $_SESSION['PROCESS'] ) || ! isset( $_SESSION['APPLICATION'] )) {
G::header( 'location: login' );
}
$G_MAIN_MENU = 'caseTracker';

View File

@@ -22,13 +22,13 @@
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
/*
* Hystory case for Case Tracker
*
* @author Everth S. Berrios Morales <everth@colosa.com>
*
/*
* Hystory case for Case Tracker
*
* @author Everth S. Berrios Morales <everth@colosa.com>
*
*/
if (! isset( $_SESSION['PROCESS'] )) {
if (! isset( $_SESSION['PROCESS'] ) || ! isset( $_SESSION['APPLICATION'] ) ) {
G::header( 'location: login' );
}

View File

@@ -22,13 +22,13 @@
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
/*
* History messages for Case Tracker
*
* @author Everth S. Berrios Morales <everth@colosa.com>
*
/*
* History messages for Case Tracker
*
* @author Everth S. Berrios Morales <everth@colosa.com>
*
*/
if (! isset( $_SESSION['PROCESS'] )) {
if (! isset( $_SESSION['PROCESS'] ) || ! isset( $_SESSION['APPLICATION'] )) {
G::header( 'location: login' );
}
$G_MAIN_MENU = 'caseTracker';

View File

@@ -29,7 +29,7 @@
*
*/
require_once 'classes/model/Process.php';
if (! isset( $_SESSION['PROCESS'] )) {
if (! isset( $_SESSION['PROCESS'] ) || ! isset( $_SESSION['APPLICATION'] )) {
G::header( 'location: login' );
}
$G_MAIN_MENU = 'caseTracker';

View File

@@ -81,7 +81,7 @@ foreach ($aInfoFunction as $k => $v) {
$option = floatval($aDataTriggers[$sOptionTrigger]);
break;
default:
$option = (is_numeric($aDataTriggers[$sOptionTrigger]) || is_bool($aDataTriggers[$sOptionTrigger]) ) ? trim($aDataTriggers[$sOptionTrigger]) : (strstr($aDataTriggers[$sOptionTrigger], "array")) ? trim($aDataTriggers[$sOptionTrigger]) : "'" . trim($aDataTriggers[$sOptionTrigger]) . "'";
$option = (is_numeric($aDataTriggers[$sOptionTrigger]) || is_bool($aDataTriggers[$sOptionTrigger]) ) ? trim($aDataTriggers[$sOptionTrigger]) : (strstr($aDataTriggers[$sOptionTrigger], "'.array.'")) ? trim($aDataTriggers[$sOptionTrigger]) : "'" . trim($aDataTriggers[$sOptionTrigger]) . "'";
break;
}
}

View File

@@ -51,7 +51,6 @@ function formatAMPM(date, initVal, calendarDate) {
return strTime;
}
Ext.Ajax.timeout = 4 * 60 * 1000;
var caseSummary = function() {
@@ -264,7 +263,6 @@ function pauseCase(date){
items: [
{
html: '<div align="center" style="font: 14px tahoma,arial,helvetica,sans-serif">' + _('ID_PAUSE_CASE_TO_DATE') +' '+date.format('M j, Y')+'? </div> <br/>'
},
new Ext.form.TimeField({
id: 'unpauseTime',
@@ -1153,44 +1151,45 @@ Ext.onReady ( function() {
});
// ComboBox creation processValues
var comboUser = new Ext.form.ComboBox({
store : new Ext.data.Store( {
proxy : new Ext.data.HttpProxy( {
url : 'casesList_Ajax?actionAjax=userValues&action='+action,
method : 'POST'
}),
reader : new Ext.data.JsonReader( {
fields : [ {
name : 'USR_UID'
}, {
name : 'USR_FULLNAME'
} ]
})
}),
var userStore = new Ext.data.Store( {
proxy : new Ext.data.HttpProxy( {
url : 'casesList_Ajax?actionAjax=userValues&action='+action,
method : 'POST'
}),
reader : new Ext.data.JsonReader( {
fields : [ {
name : 'USR_UID'
}, {
name : 'USR_FULLNAME'
} ]
})
});
var suggestUser = new Ext.form.ComboBox({
store: userStore,
valueField : 'USR_UID',
displayField : 'USR_FULLNAME',
triggerAction : 'all',
displayField:'USR_FULLNAME',
typeAhead: true,
triggerAction: 'all',
emptyText : _('ID_ALL_USERS'),
selectOnFocus : true,
editable : false,
editable : true,
width: 180,
allowBlank : true,
autocomplete: true,
typeAhead: true,
//allowBlankText : _('ID_SHOULD_SELECT_LANGUAGE_FROM_LIST'),
hideTrigger:true,
listeners:{
scope: this,
'select': function() {
storeCases.setBaseParam("user", comboUser.store.getAt(0).get(comboUser.valueField));
filterUser = comboUser.value;
storeCases.setBaseParam( 'user', filterUser);
storeCases.setBaseParam( 'start', 0);
storeCases.setBaseParam( 'limit', pageSize);
//storeCases.load();
//storeCases.setBaseParam( 'user', comboUser.store.getAt(0).get(comboUser.valueField));
filterUser = suggestUser.value;
storeCases.setBaseParam( 'user', filterUser);
storeCases.setBaseParam( 'start', 0);
storeCases.setBaseParam( 'limit', pageSize);
}
}
});
});
var textSearch = new Ext.form.TextField ({
allowBlank: true,
@@ -1864,7 +1863,8 @@ Ext.onReady ( function() {
comboStatus,
"-",
_("ID_USER"),
comboUser,
//comboUser,
suggestUser,
'&nbsp;&nbsp;&nbsp;'
//'-',
//textSearch,

View File

@@ -130,7 +130,6 @@
}
function dynaformDelete ( uid,proUid ){
isokDependent = ajax_function('@G::encryptlink(@#dynaformsDelete)','getDynaformAssign','DYN_UID='+uid+'&PRO_UID='+proUid,'POST');
if(isokDependent){
msgBox(G_STRINGS.ID_DYNAFORM_ASSIGN,"alert");

View File

@@ -43,12 +43,21 @@
}
function stepDelete( uid, stepPos ){
PROCESSMAP_STEP_EDIT = true;
new leimnud.module.app.confirm().make({label:'@#CONFIRM',action:function(){
ajax_function('@G::encryptlink(@#URL_STEP_DELETE)','','STEP_UID='+uid+'&TASK=@#TASK&STEP_POSITION='+stepPos,'POST');
@#PAGED_TABLE_ID.refresh();
}.extend(this)
});
PROCESSMAP_STEP_EDIT = true;
if (leimnud.browser.isIE) {
new leimnud.module.app.confirm().make({label:'@#CONFIRM',width:450, height:110, action:function(){
ajax_function('@G::encryptlink(@#URL_STEP_DELETE)','','STEP_UID='+uid+'&TASK=@#TASK&STEP_POSITION='+stepPos,'POST');
@#PAGED_TABLE_ID.refresh();
}.extend(this)
});
}else{
new leimnud.module.app.confirm().make({label:'@#CONFIRM',action:function(){
ajax_function('@G::encryptlink(@#URL_STEP_DELETE)','','STEP_UID='+uid+'&TASK=@#TASK&STEP_POSITION='+stepPos,'POST');
@#PAGED_TABLE_ID.refresh();
}.extend(this)
});
}
}
function externalStepEdit(stpUid, urlExternalStepEdit ){