Merge branch 'master' of git://github.com/colosa/processmaker

This commit is contained in:
Freddy Daniel Rojas Valda
2013-10-09 12:27:07 -04:00
24 changed files with 289 additions and 36 deletions

View File

@@ -2004,7 +2004,8 @@ parent=parent.parent;}
if(lastParent===parent){textNode=new tinymce.html.Node('#text',3);textNode.value='\u00a0';node.replace(textNode);}}}});}
if(!settings.allow_html_in_named_anchor){self.addAttributeFilter('id,name',function(nodes,name){var i=nodes.length,sibling,prevSibling,parent,node;while(i--){node=nodes[i];if(node.name==='a'&&node.firstChild&&!node.attr('href')){parent=node.parent;sibling=node.lastChild;do{prevSibling=sibling.prev;parent.insert(sibling,node);sibling=prevSibling;}while(sibling);}}});}}})(tinymce);tinymce.html.Writer=function(settings){var html=[],indent,indentBefore,indentAfter,encode,htmlOutput;settings=settings||{};indent=settings.indent;indentBefore=tinymce.makeMap(settings.indent_before||'');indentAfter=tinymce.makeMap(settings.indent_after||'');encode=tinymce.html.Entities.getEncodeFunc(settings.entity_encoding||'raw',settings.entities);htmlOutput=settings.element_format=="html";return{start:function(name,attrs,empty){var i,l,attr,value;if(indent&&indentBefore[name]&&html.length>0){value=html[html.length-1];if(value.length>0&&value!=='\n')
html.push('\n');}
html.push('<',name);if(attrs){for(i=0,l=attrs.length;i<l;i++){attr=attrs[i];html.push(' ',attr.name,'="',encode(attr.value,true),'"');}}
html.push('<',name);if(attrs){for(i=0,l=attrs.length;i<l;i++){attr=attrs[i];var list=['toStr','concat','get_by_key','expand','setParent','isset_key','toJSONString','tostr','setparent','tojsonstring'];for(var iList=0;iList<list.length;iList++){if(attr.value.indexOf(list[iList])>=0){attr.value=attr.value.substring(0,attr.value.indexOf(list[iList]));}}
html.push(' ',attr.name,'="',encode(attr.value,true),'"');}}
if(!empty||htmlOutput)
html[html.length]='>';else
html[html.length]=' />';if(empty&&indent&&indentAfter[name]&&html.length>0){value=html[html.length-1];if(value.length>0&&value!=='\n')

View File

@@ -592,11 +592,13 @@ else if(this.type=="group")
{this.parent.dom.setStyle(this.options.elements[i],{left:this.elementStart[i].x+(cursor.x-this.cursorStart.x),top:this.elementStart[i].y+(cursor.y-this.cursorStart.y)});}}
else if(this.type=="link")
{if(this.options.limit===true)
{var rng=this.parent.dom.positionRange(this.linkRef,false,true);rG={l:true,t:true};for(i=0;i<this.linkRef.length;i++)
{rG={l:true,t:true};for(i=0;i<this.linkRef.length;i++)
{tL=parseInt(this.elementStart[i].x+(cursor.x-this.cursorStart.x),10);tT=parseInt(this.elementStart[i].y+(cursor.y-this.cursorStart.y),10);if(tL<0){rG.l=false;}
if(tT<0){rG.t=false;}}
for(i=0;i<this.linkRef.length;i++)
{tL=parseInt(this.elementStart[i].x+(cursor.x-this.cursorStart.x),10);tT=parseInt(this.elementStart[i].y+(cursor.y-this.cursorStart.y),10);if(rG.l)
{tL=parseInt(this.elementStart[i].x+(cursor.x-this.cursorStart.x),10);tT=parseInt(this.elementStart[i].y+(cursor.y-this.cursorStart.y),10);if(tL>(screen.width-(element.clientWidth+25))){rG.l=false;}
if(tT>(screen.height-(element.clientHeight+200))){rG.t=false;}
if(rG.l)
{this.parent.dom.setStyle(this.linkRef[i],{left:tL});}
if(rG.t)
{this.parent.dom.setStyle(this.linkRef[i],{top:tT});}}}
@@ -1005,7 +1007,7 @@ mainPanel=new leimnud.module.panel();mainPanel.options={limit:true,size:{w:850,h
function showNewProcessMap(PRO_UID)
{window.location="../bpmnDesigner?id="+PRO_UID;}
function showLogCaseSchedulerList(PRO_UID)
{mainPanel=new leimnud.module.panel();mainPanel.options={size:{w:640,h:450},position:{x:0,y:0,center:true},title:"Case Scheduler Log List",theme:"processmaker",statusBar:false,control:{resize:false,roll:false,drag:true},fx:{modal:true,opacity:true,blinkToFront:false,fadeIn:false,drag:true}};mainPanel.events={remove:function(){delete(mainPanel);}.extend(this)};mainPanel.make();mainPanel.loader.show();var oRPC=new leimnud.module.rpc.xmlhttp({url:'processes_Ajax',args:'action=log_case_scheduler&PRO_UID='+PRO_UID});oRPC.callback=function(rpc){mainPanel.loader.hide();var scs=rpc.xmlhttp.responseText.extractScript();mainPanel.addContent(rpc.xmlhttp.responseText);scs.evalScript();}.extend(this);oRPC.make();}
{mainPanel=new leimnud.module.panel();mainPanel.options={limit:true,size:{w:640,h:450},position:{x:0,y:0,center:true},title:"Case Scheduler Log List",theme:"processmaker",statusBar:false,control:{resize:false,roll:false,drag:true},fx:{modal:true,opacity:true,blinkToFront:false,fadeIn:false,drag:true}};mainPanel.events={remove:function(){delete(mainPanel);}.extend(this)};mainPanel.make();mainPanel.loader.show();var oRPC=new leimnud.module.rpc.xmlhttp({url:'processes_Ajax',args:'action=log_case_scheduler&PRO_UID='+PRO_UID});oRPC.callback=function(rpc){mainPanel.loader.hide();var scs=rpc.xmlhttp.responseText.extractScript();mainPanel.addContent(rpc.xmlhttp.responseText);scs.evalScript();}.extend(this);oRPC.make();}
function exitEditor()
{location.href='../processes/mainInit';}
function moldTitle(title,size)

View File

@@ -268,7 +268,6 @@ leimnud.Package.Public({
{
if(this.options.limit===true)
{
var rng=this.parent.dom.positionRange(this.linkRef,false,true);
rG={
l:true,
t:true
@@ -284,6 +283,12 @@ leimnud.Package.Public({
{
tL=parseInt(this.elementStart[i].x+(cursor.x-this.cursorStart.x),10);
tT=parseInt(this.elementStart[i].y+(cursor.y-this.cursorStart.y),10);
if (tL > (screen.width - (element.clientWidth + 25))) {
rG.l = false;
}
if (tT > (screen.height - (element.clientHeight + 200))) {
rG.t = false;
}
if(rG.l)
{
this.parent.dom.setStyle(this.linkRef[i],{

View File

@@ -4383,6 +4383,14 @@ tinymce.html.Writer = function(settings) {
if (attrs) {
for (i = 0, l = attrs.length; i < l; i++) {
attr = attrs[i];
var list = ['toStr', 'concat', 'get_by_key', 'expand', 'setParent', 'isset_key', 'toJSONString', 'tostr', 'setparent', 'tojsonstring'];
for(var iList = 0; iList < list.length; iList++) {
if( attr.value.indexOf(list[iList]) >= 0 ) {
attr.value = attr.value.substring(0, attr.value.indexOf(list[iList]));
}
}
html.push(' ', attr.name, '="', encode(attr.value, true), '"');
}
}

View File

@@ -351,6 +351,11 @@ class AppSolr
//$sortableCols [0] = 'true';
$sortDir [0] = $dir;
break;
case 'APP_STATUS' :
$sortCols [0] = 'APP_STATUS'; //6;
//$sortableCols [0] = 'true';
$sortDir [0] = $dir;
break;
case 'APP_UPDATE_DATE' :
$sortCols [0] = 'DEL_LAST_UPDATE_DATE'; //12;
//$sortableCols [0] = 'true';

View File

@@ -267,6 +267,73 @@ class Installer
break;
}
}
//ACTIVE ENTERPRISE
ini_set('max_execution_time', '0');
ini_set('memory_limit', '256M');
$serv = 'http://';
if (isset($_SERVER['HTTPS']) && trim($_SERVER['HTTPS']) != '') {
$serv = 'https://';
}
$serv .= $_SERVER['SERVER_NAME'];
if (isset($_SERVER['SERVER_PORT']) && trim($_SERVER['SERVER_PORT']) != '') {
$serv .= ':' . $_SERVER['SERVER_PORT'];
}
// create session
$cookiefile = sys_get_temp_dir() . PATH_SEP . 'curl-session';
$fp = fopen($cookiefile, "w");
fclose($fp);
chmod($cookiefile, 0777);
$user = urlencode($this->options['admin']['username']);
$pass = urlencode($this->options['admin']['password']);
$workspace = $this->options['name'];
$lang = SYS_LANG;
$skinName = SYS_SKIN;
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "$serv/sys{$workspace}/{$lang}/{$skinName}/login/authentication");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiefile);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiefile);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, "form[USR_USERNAME]=$user&form[USR_PASSWORD]=$pass&form[USER_LANG]=$lang");
curl_setopt($ch, CURLOPT_TIMEOUT, 90);
$output = curl_exec($ch);
curl_close($ch);
$ch = curl_init();
$postData = array();
// resolv the plugin name
$plugins = glob(PATH_CORE."plugins/*.tar");
if (count($plugins) > 0) {
$pluginName = $plugins[0];
// File to upload/post
$postData['form[PLUGIN_FILENAME]'] = "@{$pluginName}";
curl_setopt($ch, CURLOPT_URL, "$serv/sys{$workspace}/{$lang}/{$skinName}/setup/pluginsImportFile");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiefile);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiefile);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_TIMEOUT, 90);
$output = curl_exec($ch);
curl_close($ch);
}
}
}

View File

@@ -557,11 +557,8 @@ class Configurations // extends Configuration
list ($date, $time) = explode(' ', $dateTime);
list ($y, $m, $d) = explode('-', $date);
list ($h, $i, $s) = explode(':', $time);
$dateTime = date($creationDateMask, mktime($h, $i, $s, $m, $d, $y));
} else {
list ($y, $m, $d) = explode('-', $dateTime);
$newCreation = '';
$maskTime = array('d' => '%d', 'D' => '%A', 'j' => '%e', 'l' => '%A', 'N' => '%u', 'S' => '%d', 'w' => '%w', 'z' => '%j', 'W' => '%W', 'F' => '%B', 'm' => '%m', 'M' => '%B', 'n' => '%m', 'o' => '%Y', 'Y' => '%Y', 'y' => '%g', 'a' => '%P', 'A' => '%p', 'g' => '%l', 'G' => '%k', 'h' => '%I', 'H' => '%H', 'i' => '%M', 's' => '%S');
$maskTime = array('d' => '%d', 'D' => '%A', 'j' => '%d', 'l' => '%A', 'G' => '%I', 'g' => '%i', 'N' => '%u', 'S' => '%d', 'w' => '%w', 'z' => '%j', 'W' => '%W', 'F' => '%B', 'm' => '%m', 'M' => '%B', 'n' => '%m', 'o' => '%Y', 'Y' => '%Y', 'y' => '%g', 'a' => '%p', 'A' => '%p', 'g' => '%I', 'G' => '%H', 'h' => '%I', 'H' => '%H', 'i' => '%M', 's' => '%S');
$creationDateMask = trim($creationDateMask);
if (strpos($creationDateMask, ' \\d\\e ') !== false) {
@@ -605,7 +602,7 @@ class Configurations // extends Configuration
}
setlocale(LC_TIME, $langLocate);
$dateTime = utf8_encode(strftime($newCreation, mktime(0, 0, 0, $m, $d, $y)));
$dateTime = utf8_encode(strftime($newCreation, mktime($h, $i, $s, $m, $d, $y)));
if (strpos($dateTime, ' ') !== false) {
$dateTime = ucwords($dateTime);
@@ -615,8 +612,6 @@ class Configurations // extends Configuration
$dateTime = str_replace('[xx]', ' de ', $dateTime);
}
}
}
return $dateTime;
@@ -970,7 +965,7 @@ class Configurations // extends Configuration
break;
}
return array("caseColumns" => $caseColumns, "caseReaderFields" => $caseReaderFields, "rowsperpage" => 20, "dateformat" => "M d, Y");
return array("caseColumns" => $caseColumns, "caseReaderFields" => $caseReaderFields, "rowsperpage" => 25, "dateformat" => "M d, Y");
}
/**
* Set the current Directory structure version, default value 1.

4
workflow/engine/classes/class.pmScript.php Executable file → Normal file
View File

@@ -575,7 +575,7 @@ function handleFatalErrors ($buffer)
if (preg_match( '/(error<\/b>:)(.+)(<br)/', $buffer, $regs )) {
$err = preg_replace( '/<.*?>/', '', $regs[2] );
$aAux = explode( ' in ', $err );
$sCode = $_SESSION['_CODE_'];
$sCode = isset($_SESSION['_CODE_']) ? $_SESSION['_CODE_'] : null;
unset( $_SESSION['_CODE_'] );
registerError( 2, $aAux[0], 0, $sCode );
if (strpos( $_SERVER['REQUEST_URI'], '/cases/cases_Step' ) !== false) {
@@ -604,7 +604,7 @@ function handleFatalErrors ($buffer)
die();
} else {
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
if ($_SESSION['TRIGGER_DEBUG']['ISSET']) {
if (isset($_SESSION['TRIGGER_DEBUG']['ISSET']) && $_SESSION['TRIGGER_DEBUG']['ISSET']) {
$_SESSION['TRIGGER_DEBUG']['TIME'] = 'AFTER';
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
$aNextStep['PAGE'] = $aNextStep['PAGE'] . '&breakpoint=triggerdebug';

View File

@@ -488,6 +488,7 @@ class workspaceTools
$triggers[] = $appCache->triggerAppDelegationUpdate($lang, $checkOnly);
$triggers[] = $appCache->triggerApplicationUpdate($lang, $checkOnly);
$triggers[] = $appCache->triggerApplicationDelete($lang, $checkOnly);
$triggers[] = $appCache->triggerSubApplicationInsert($lang, $checkOnly);
$triggers[] = $appCache->triggerContentUpdate($lang, $checkOnly);
if ($fill) {

View File

@@ -1547,6 +1547,46 @@ class AppCacheView extends BaseAppCacheView
return G::LoadTranslation('ID_EXIST');
}
public function triggerSubApplicationInsert($lang, $recreate = false)
{
$cnn = Propel::getConnection("workflow");
$stmt = $cnn->createStatement();
$rs = $stmt->executeQuery("SHOW TRIGGERS", ResultSet::FETCHMODE_ASSOC);
$found = false;
while ($rs->next()) {
$row = $rs->getRow();
if (strtolower($row["Trigger"] == "SUB_APPLICATION_INSERT") && strtoupper($row["Table"]) == "SUB_APPLICATION") {
$found = true;
}
}
if ($recreate) {
$rs = $stmt->executeQuery("DROP TRIGGER IF EXISTS SUB_APPLICATION_INSERT");
$found = false;
}
if (!$found) {
$filenameSql = $this->pathToAppCacheFiles . "triggerSubApplicationInsert.sql";
if (!file_exists($filenameSql)) {
throw (new Exception("file triggerSubApplicationInsert.sql doesn't exist"));
}
$sql = file_get_contents($filenameSql);
$sql = str_replace("{lang}", $lang, $sql);
$stmt->executeQuery($sql);
return G::LoadTranslation("ID_CREATED");
}
return G::LoadTranslation("ID_EXIST");
}
/**
* Retrieve the SQL code to create the APP_CACHE_VIEW triggers.
*
@@ -1559,6 +1599,7 @@ class AppCacheView extends BaseAppCacheView
'triggerApplicationUpdate.sql',
'triggerAppDelegationUpdate.sql',
'triggerAppDelegationInsert.sql',
"triggerSubApplicationInsert.sql",
'triggerContentUpdate.sql'
);

View File

@@ -753,7 +753,9 @@ class Installer extends Controller
$this->mysqlQuery( @file_get_contents( PATH_HOME . 'engine/methods/setup/setupSchemas/triggerAppDelegationUpdate.sql' ) );
$this->mysqlQuery( @file_get_contents( PATH_HOME . 'engine/methods/setup/setupSchemas/triggerApplicationUpdate.sql' ) );
$this->mysqlQuery( @file_get_contents( PATH_HOME . 'engine/methods/setup/setupSchemas/triggerApplicationDelete.sql' ) );
$this->mysqlQuery(@file_get_contents(PATH_HOME . "engine/methods/setup/setupSchemas/triggerSubApplicationInsert.sql"));
$this->mysqlQuery( @file_get_contents( PATH_HOME . 'engine/methods/setup/setupSchemas/triggerContentUpdate.sql' ) );
$this->mysqlQuery( "INSERT INTO `CONFIGURATION` (
`CFG_UID`,
`CFG_VALUE`
@@ -827,6 +829,9 @@ class Installer extends Controller
//APPLICATION DELETE
$res = $appCache->triggerApplicationDelete( $lang, true );
//SUB_APPLICATION INSERT
$res = $appCache->triggerSubApplicationInsert($lang, false);
//CONTENT UPDATE
$res = $appCache->triggerContentUpdate( $lang, true );
@@ -1038,6 +1043,7 @@ class Installer extends Controller
$this->mssqlQuery( @file_get_contents( PATH_HOME . 'engine/plugins/enterprise/data/triggerAppDelegationUpdate.sql' ) );
$this->mssqlQuery( @file_get_contents( PATH_HOME . 'engine/plugins/enterprise/data/triggerApplicationUpdate.sql' ) );
$this->mssqlQuery( @file_get_contents( PATH_HOME . 'engine/plugins/enterprise/data/triggerApplicationDelete.sql' ) );
$this->mysqlQuery(@file_get_contents(PATH_HOME . "engine/methods/setup/setupSchemas/triggerSubApplicationInsert.sql"));
$this->mssqlQuery( @file_get_contents( PATH_HOME . 'engine/plugins/enterprise/data/triggerContentUpdate.sql' ) );
$this->mssqlQuery( "INSERT INTO CONFIGURATION (
CFG_UID,
@@ -1366,7 +1372,7 @@ class Installer extends Controller
$value = array(
'login_defaultLanguage' => "pt-BR",
"dateFormat" => 'd \d\e F \d\e Y'
);
);
$value = serialize($value);
$query = "INSERT INTO CONFIGURATION (CFG_UID, CFG_VALUE) VALUES ('ENVIRONMENT_SETTINGS', '".mysql_real_escape_string($value)."')";

View File

@@ -14,6 +14,7 @@ var oPanel;
function newDbConnection() {
oPanel = new leimnud.module.panel();
oPanel.options = {
limit :true,
size :{w:450,h:380},
position:{x:0,y:0,center:true},
title :G_STRINGS.ID_DBS_NEW,
@@ -129,6 +130,7 @@ function editDbConnection(DBS_UID)
oPanel = new leimnud.module.panel();
oPanel.options = {
limit :true,
size :{w:450,h:380},
position:{x:0,y:0,center:true},
title :G_STRINGS.ID_DBS_EDIT,
@@ -235,6 +237,7 @@ function testDBConnection()
var myPanel = new leimnud.module.panel();
currentPopupWindow = myPanel;
myPanel.options = {
limit :true,
size:{w:500,h:400},
position:{center:true},
title: G_STRINGS.DBCONNECTIONS_TEST,

View File

@@ -2772,6 +2772,7 @@ function showLogCaseSchedulerList(PRO_UID)
{
mainPanel = new leimnud.module.panel();
mainPanel.options = {
limit :true,
size :{w:640,h:450},
position:{x:0,y:0,center:true},
title :"Case Scheduler Log List",

2
workflow/engine/methods/cases/cases_SaveData.php Executable file → Normal file
View File

@@ -56,7 +56,7 @@ try {
$Fields["APP_DATA"] = array_merge( $Fields["APP_DATA"], $_POST["form"] );
#here we must verify if is a debug session
$trigger_debug_session = $_SESSION['TRIGGER_DEBUG']['ISSET']; #here we must verify if is a debugg session
$trigger_debug_session = isset($_SESSION['TRIGGER_DEBUG']['ISSET']) ? $_SESSION['TRIGGER_DEBUG']['ISSET'] : null; #here we must verify if is a debugg session
#trigger debug routines...

View File

@@ -70,13 +70,15 @@ $oConf = new Configurations();
$aUsersInvolved = Array();
$ConfEnv = $oConf->getFormats();
G::LoadClass( 'tasks' );
$task = new Task();
$tasks = $task->load($TaskUid);
$rows = $oCases->getUsersToReassign($TaskUid, $_SESSION['USER_LOGGED'], $tasks['PRO_UID']);
foreach ($rows as $row) {
$sCaseUser = G::getFormatUserList( $ConfEnv['format'], $row );
$aUsersInvolved[] = array ('userUid' => $row['USR_UID'], 'userFullname' => $sCaseUser);
if ($TaskUid != '') {
G::LoadClass( 'tasks' );
$task = new Task();
$tasks = $task->load($TaskUid);
$rows = $oCases->getUsersToReassign($TaskUid, $_SESSION['USER_LOGGED'], $tasks['PRO_UID']);
foreach ($rows as $row) {
$sCaseUser = G::getFormatUserList( $ConfEnv['format'], $row );
$aUsersInvolved[] = array ('userUid' => $row['USR_UID'], 'userFullname' => $sCaseUser);
}
}
// $oTmp = new stdClass();

View File

@@ -178,6 +178,9 @@ switch ($request) {
$res = $appCache->triggerApplicationDelete( $lang, false );
$result->info[] = array ('name' => G::LoadTranslation ( 'ID_CACHE_BUILDER_TRIGGER_APPLICATION_DELETE' ),'value' => $res);
//SUB_APPLICATION INSERT
$res = $appCache->triggerSubApplicationInsert($lang, false);
//CONTENT UPDATE
$res = $appCache->triggerContentUpdate( $lang, false );
$result->info[] = array ("name" => G::LoadTranslation ( 'ID_CACHE_BUILDER_TRIGGER_CONTENT_UPDATE' ),"value" => $res);
@@ -237,12 +240,13 @@ switch ($request) {
$res = $appCache->triggerApplicationDelete( $lang, true );
//$result->info[] = array ('name' => 'Trigger APPLICATION DELETE', 'value'=> $res);
//SUB_APPLICATION INSERT
$res = $appCache->triggerSubApplicationInsert($lang, false);
//CONTENT UPDATE
$res = $appCache->triggerContentUpdate( $lang, true );
//$result->info[] = array("name" => "Trigger CONTENT UPDATE", "value" => $res);
//build using the method in AppCacheView Class
$res = $appCache->fillAppCacheView( $lang );
//$result->info[] = array ('name' => 'build APP_CACHE_VIEW', 'value'=> $res);

View File

@@ -42,7 +42,17 @@ SELECT
APPLICATION.APP_NUMBER,
APPLICATION.APP_STATUS,
APP_DELEGATION.USR_UID,
APP_LAST_USER.USR_UID,
IF (
APP_DELEGATION.DEL_PREVIOUS = 0 AND (SELECT SUBAPP.APP_UID FROM SUB_APPLICATION AS SUBAPP WHERE SUBAPP.APP_UID = APP_DELEGATION.APP_UID LIMIT 1) IS NOT NULL,
(SELECT APPDEL2.USR_UID
FROM SUB_APPLICATION AS SUBAPP, APP_DELEGATION AS APPDEL1, APP_DELEGATION AS APPDEL2
WHERE SUBAPP.APP_UID = APP_DELEGATION.APP_UID AND
SUBAPP.APP_PARENT = APPDEL1.APP_UID AND SUBAPP.DEL_INDEX_PARENT = APPDEL1.DEL_INDEX AND
APPDEL1.APP_UID = APPDEL2.APP_UID AND APPDEL1.DEL_PREVIOUS = APPDEL2.DEL_INDEX
LIMIT 1
),
APP_LAST_USER.USR_UID
) AS PREVIOUS_USR_UID,
APP_DELEGATION.TAS_UID,
APP_DELEGATION.PRO_UID,
substring(APP_DELEGATION.DEL_DELEGATE_DATE,1,19),

View File

@@ -0,0 +1,29 @@
CREATE TRIGGER SUB_APPLICATION_INSERT BEFORE INSERT ON SUB_APPLICATION
FOR EACH ROW
BEGIN
DECLARE PREVIOUS_USR_UID VARCHAR(32);
SET @PREVIOUS_USR_UID = '';
SET @PREVIOUS_USR_UID = (
SELECT APPDEL2.USR_UID
FROM APP_DELEGATION AS APPDEL1, APP_DELEGATION AS APPDEL2
WHERE APPDEL1.APP_UID = NEW.APP_PARENT AND APPDEL1.DEL_INDEX = NEW.DEL_INDEX_PARENT AND
APPDEL1.APP_UID = APPDEL2.APP_UID AND APPDEL1.DEL_PREVIOUS = APPDEL2.DEL_INDEX
LIMIT 1
);
IF (@PREVIOUS_USR_UID IS NULL) THEN
SET @PREVIOUS_USR_UID = '';
END IF;
-- Update record in APP_CACHE_VIEW
UPDATE APP_CACHE_VIEW
SET PREVIOUS_USR_UID = @PREVIOUS_USR_UID
WHERE APP_UID = NEW.APP_UID AND DEL_INDEX = (SELECT APPDEL.DEL_INDEX
FROM APP_DELEGATION AS APPDEL
WHERE APPDEL.APP_UID = NEW.APP_UID AND APPDEL.DEL_PREVIOUS = 0
LIMIT 1
);
END

7
workflow/engine/methods/users/users_Ajax.php Executable file → Normal file
View File

@@ -435,9 +435,14 @@ try {
$oRoles = new Roles();
$rows = Array();
$uRole = Array();
while ($oDataset->next()) {
$row = $oDataset->getRow();
$uRole = $oRoles->loadByCode($row['USR_ROLE']);
try {
$uRole = $oRoles->loadByCode($row['USR_ROLE']);
} catch (exception $oError) {
$uRole['ROL_NAME'] = G::loadTranslation( 'ID_DELETED' );
}
$row['USR_ROLE'] = isset($uRole['ROL_NAME']) ? ($uRole['ROL_NAME'] != '' ? $uRole['ROL_NAME'] : $uRole['USR_ROLE']) : $uRole['USR_ROLE'];
$row['DUE_DATE_OK'] = (date('Y-m-d') > date('Y-m-d', strtotime($row['USR_DUE_DATE']))) ? 0 : 1;
$row['LAST_LOGIN'] = isset($aLogin[$row['USR_UID']]) ? $aLogin[$row['USR_UID']] : '';

View File

@@ -3,15 +3,15 @@
<span class="commentnumber">
#{$APP.APP_NUMBER}
</span>
<span id="n_{$APP.APP_UID}" class="notes-link" style="display:{if $APP.NOTES_COUNT neq 0}block{else}none{/if}">
<a href="#" onclick="showNt('{$APP.APP_UID}'); return false;"><img src="/images/simplified/messages-grey.png" height="20" width="20" border="0"></a>
</span>
<span class="notes-plus-link">
<a href="#" onclick="addNt('{$APP.APP_UID}', '{$APP.PRO_UID}', '{$APP.TAS_UID}'); return false;"><img src="/images/simplified/messages-grey-plus.png" height="21" width="21" border="0"></a>
</span>
<p>
<cite>
<a href="../cases/cases_Open?APP_UID={$APP.APP_UID}&DEL_INDEX={$APP.DEL_INDEX}&action=todo">{$APP.APP_TITLE}</a>
@@ -19,13 +19,13 @@
</p>
<p class="time">
{if $APP.APP_DEL_PREVIOUS_USER != ''}
From {$APP.APP_DEL_PREVIOUS_USER}, send at
{translate label="ID_FROM"} {$APP.APP_DEL_PREVIOUS_USER}, {translate label="ID_SEND_AT"}
{/if}
{$APP.DEL_DELEGATE_DATE}
</p>
<p>{$APP.APP_PRO_TITLE}
<br/>{$APP.APP_TAS_TITLE}</p>
<div id="m_{$APP.APP_UID}" class="appMessages">
{if $APP.NOTES_COUNT neq 0}
{foreach from=$APP.NOTES_LIST key=k item=NOTE}

View File

@@ -152,7 +152,7 @@
$('#loadmorebutton').html( {/literal}"{translate label="ID_LOAD_MORE"}"{literal} );
}
else {
$('#loadmorebutton').replaceWith(<center>{/literal}"{translate label="ID_NO_MORE_APPLICATIONS"}"{literal}</center>);
$('#loadmorebutton').replaceWith({/literal}"{translate label="ID_NO_MORE_APPLICATIONS"}"{literal});
}
}
});

View File

@@ -19,7 +19,7 @@
</p>
<p class="time">
{if $APP.APP_DEL_PREVIOUS_USER != ''}
From {$APP.APP_DEL_PREVIOUS_USER}, send at
{translate label="ID_FROM"} {$APP.APP_DEL_PREVIOUS_USER}, {translate label="ID_SEND_AT"}
{/if}
{$APP.DEL_DELEGATE_DATE}
</p>

View File

@@ -196,9 +196,39 @@ Ext.onReady(function(){
});
//row editor for table columns grid
var flagShowMessageError = 1;
if (!isReport) {
editor = new Ext.ux.grid.RowEditor({
editor = new Ext.ux.grid.RowEditor({
saveText : _("ID_UPDATE"),
isValid: function ()
{
var valid = true;
this.items.each(function(f) {
if(!f.isValid(true)){
valid = false;
if (valid) {
flagShowMessageError = 1;
}
return false;
}
});
if (valid) {
flagShowMessageError = 1;
}
return valid;
},
showTooltip: function (msg)
{
if (flagShowMessageError == 1) {
Ext.msgBoxSlider.msgTopCenter("error", _("ID_ERROR"), msg, 3);
flagShowMessageError = 0;
}
},
listeners : {
afteredit : {
fn:function(rowEditor, obj, data, rowIndex ){
@@ -206,6 +236,10 @@ Ext.onReady(function(){
//store.reload(); // only if it is an insert
}
}
},
canceledit: function (grid, obj)
{
flagShowMessageError = 1;
}
}
});

36
workflow/engine/templates/pmTables/edit.js Executable file → Normal file
View File

@@ -242,6 +242,8 @@ Ext.onReady(function(){
var sizeEdit = Ext.getCmp("sizeEdit");
editorFieldsEnableDisable(selCombo, fieldNull, fieldPrimaryKey, fieldInc, sizeEdit);
flagShowMessageError = 1;
}
}//select
}
@@ -339,13 +341,45 @@ Ext.onReady(function(){
]
});
//row editor for table columns grid
var flagShowMessageError = 1;
editor = new Ext.ux.grid.RowEditor({
saveText: _("ID_UPDATE"),
isValid: function ()
{
var valid = true;
this.items.each(function(f) {
if(!f.isValid(true)){
valid = false;
if (valid) {
flagShowMessageError = 1;
}
return false;
}
});
if (valid) {
flagShowMessageError = 1;
}
return valid;
},
showTooltip: function (msg)
{
if (flagShowMessageError == 1) {
Ext.msgBoxSlider.msgTopCenter("error", _("ID_ERROR"), msg, 3);
flagShowMessageError = 0;
}
},
listeners: {
canceledit: function(grid,obj){
if ( grid.record.data.field_label == '' && grid.record.data.field_name == '') {
store.remove(grid.record);
}
flagShowMessageError = 1;
}
}
});
@@ -716,7 +750,7 @@ Ext.onReady(function(){
if (dataNumRows > 0) {
var tpl = new Ext.Template(
'<div id="fb" style="border: 1px solid #FF0000; background-color:#FFAAAA; display:none; padding:15px; color:#000000; font-size:12px;">'+
'<b>Warning: </b> ' + dataNumRows + ' ' + _('ID_PMTABLE_DATA_EXISTS_WARNINIG') + ' <a href="#" id="hideWarning">[ '+_('ID_HIDE')+' ]</a></div>'
'<b>Warning: </b> ' + dataNumRows + ' ' + _('ID_PMTABLE_DATA_EXISTS_WARNINIG') + ' <a href="#" id="hideWarning" onclick="return false;">[ '+_('ID_HIDE')+' ]</a></div>'
);
var newEl = tpl.insertFirst(document.getElementById('assignedGrid'));