diff --git a/workflow/engine/controllers/home.php b/workflow/engine/controllers/home.php index bd04ed24c..3e9f932f2 100755 --- a/workflow/engine/controllers/home.php +++ b/workflow/engine/controllers/home.php @@ -222,46 +222,49 @@ class Home extends Controller $this->render(); } - public function getAppsData($type, $start=null, $limit=null) - { - require_once ( "classes/model/AppNotes.php" ); - G::LoadClass('applications'); + public function getAppsData($type, $start=null, $limit=null) + { + require_once ( "classes/model/AppNotes.php" ); + G::LoadClass('applications'); - $apps = new Applications(); - $appNotes = new AppNotes(); + $apps = new Applications(); + $appNotes = new AppNotes(); - $start = empty($start) ? $this->appListStart : $start; - $limit = empty($limit) ? $this->appListLimit : $limit; + $start = empty($start) ? $this->appListStart : $start; + $limit = empty($limit) ? $this->appListLimit : $limit; - $notesStart = 0; - $notesLimit = 4; + $notesStart = 0; + $notesLimit = 4; - $cases = $apps->getAll($this->userID, $start, $limit, $type); - //g::pr($cases['data']); die; + $cases = $apps->getAll($this->userID, $start, $limit, $type); + //g::pr($cases['data']); die; - // formating & complitting apps data with 'Notes' - foreach ($cases['data'] as $i => $row) { - // Formatting - $appTitle = str_replace('#', '', $row['APP_TITLE']); + // formating & complitting apps data with 'Notes' + foreach ($cases['data'] as $i => $row) { + // Formatting + $appTitle = str_replace('#', '', $row['APP_TITLE']); - if (is_numeric($appTitle)) { - $cases['data'][$i]['APP_TITLE'] = G::LoadTranslation('ID_CASE'). ' ' . $appTitle; - } + if (is_numeric($appTitle)) { + $cases['data'][$i]['APP_TITLE'] = G::LoadTranslation('ID_CASE'). ' ' . $appTitle; + } - $cases['data'][$i]['DEL_DELEGATE_DATE'] = G::getformatedDate($row['DEL_DELEGATE_DATE'], 'M d, yyyy - h:i:s'); - $cases['data'][$i]['APP_DEL_PREVIOUS_USER'] = ucwords($row['APP_DEL_PREVIOUS_USER']); - - // Completting with Notes - $notes = $appNotes->getNotesList($row['APP_UID'], '', $notesStart, $notesLimit); - $notes = $notes['array']; - - $cases['data'][$i]['NOTES_COUNT'] = $notes['totalCount']; - $cases['data'][$i]['NOTES_LIST'] = $notes['notes']; + if (isset($row['DEL_DELEGATE_DATE'])) { + $cases['data'][$i]['DEL_DELEGATE_DATE'] = G::getformatedDate($row['DEL_DELEGATE_DATE'], + 'M d, yyyy - h:i:s'); + } + if (isset($row['APP_DEL_PREVIOUS_USER'])) { + $cases['data'][$i]['APP_DEL_PREVIOUS_USER'] = ucwords($row['APP_DEL_PREVIOUS_USER']); + } + // Completting with Notes + $notes = $appNotes->getNotesList($row['APP_UID'], '', $notesStart, $notesLimit); + $notes = $notes['array']; + + $cases['data'][$i]['NOTES_COUNT'] = $notes['totalCount']; + $cases['data'][$i]['NOTES_LIST'] = $notes['notes']; + } + return $cases; } - return $cases; - } - public function startCase($httpData) { G::LoadClass('case'); @@ -296,4 +299,4 @@ class Home extends Controller $this->setView($tpl); $this->render(); } -} \ No newline at end of file +} diff --git a/workflow/engine/templates/cases/caseHistory.js b/workflow/engine/templates/cases/caseHistory.js index 7e3bab5f6..2ffd95920 100644 --- a/workflow/engine/templates/cases/caseHistory.js +++ b/workflow/engine/templates/cases/caseHistory.js @@ -1,35 +1,35 @@ /* * @author: Douglas Medrano - * May 03, 2011 + * May 03, 2011 */ - function onResizeIframe(idIframe){ - window.parent.tabIframeWidthFix2(idIframe); - } - + function onResizeIframe(idIframe){ + window.parent.tabIframeWidthFix2(idIframe); + } + function ajaxPostRequest(url, callback_function, id){ var d = new Date(); var time = d.getTime(); url= url + '&nocachetime='+time; - var return_xml=false; + var return_xml=false; var http_request = false; - + if (window.XMLHttpRequest){ // Mozilla, Safari,... http_request = new XMLHttpRequest(); if (http_request.overrideMimeType){ - http_request.overrideMimeType('text/xml'); + http_request.overrideMimeType('text/xml'); } } else if (window.ActiveXObject){// IE try{ http_request = new ActiveXObject("Msxml2.XMLHTTP"); - } + } catch (e){ try{ http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ - + } } } @@ -37,17 +37,17 @@ alert('This browser is not supported.'); return false; } - + http_request.onreadystatechange = function(){ if (http_request.readyState == 4){ if (http_request.status == 200){ if (return_xml){ eval(callback_function + '(http_request.responseXML)'); } - else{ - eval(callback_function + '(http_request.responseText, \''+id+'\')'); + else{ + eval(callback_function + '(http_request.responseText, \''+id+'\')'); } - } + } else{ alert('Error found on request:(Code: ' + http_request.status + ')'); } @@ -55,8 +55,8 @@ } http_request.open('GET', url, true); http_request.send(null); - } - + } + var processesGrid; var store; @@ -68,7 +68,7 @@ table.style.display = ''; } } - + new Ext.KeyMap( document, { @@ -91,31 +91,31 @@ Ext.onReady(function(){ Ext.state.Manager.setProvider(new Ext.state.CookieProvider()); Ext.QuickTips.init(); - + historyGridList(); - - }); - - //!historyGridList| + + }); + + //!historyGridList| //!!historyGridList|changeLog function historyGridListChangeLogPanelBody_RSP(resp,id){ - var historyGridListChangeLogPanel_id_ = Ext.getCmp('historyGridListChangeLogPanel_id'); - historyGridListChangeLogPanel_id_.show(); + var historyGridListChangeLogPanel_id_ = Ext.getCmp('historyGridListChangeLogPanel_id'); + historyGridListChangeLogPanel_id_.show(); var historyGridListChangeLogPanelBody_= document.getElementById('historyGridListChangeLogPanelBody_JXP'); - historyGridListChangeLogPanelBody_.innerHTML= resp; + historyGridListChangeLogPanelBody_.innerHTML= resp; } - + function historyGridListChangeLogPanelBody_JXP(){ //!historyGridListChangeLogGlobal historyGridListChangeLogGlobal.idHistory = historyGridListChangeLogGlobal.idHistory; - + //dataSystem var idHistory = historyGridListChangeLogGlobal.idHistory; - + var url = "caseHistory_Ajax.php?actionAjax=historyGridListChangeLogPanelBody_JXP&idHistory="+idHistory; ajaxPostRequest(url,'historyGridListChangeLogPanelBody_RSP'); } - + function historyGridListChangeLogPanel(){ var w = new Ext.Window({ //draggable: Ext.util.Draggable, @@ -136,23 +136,23 @@ }, { name:'ajaxAction', - xtype:'hidden', + xtype:'hidden', value:'uploadFileNewProcess' } ] - }); - historyGridListChangeLogPanelBody_JXP(); - } - + }); + historyGridListChangeLogPanelBody_JXP(); + } + var historyGridListChangeLogGlobal = {}; historyGridListChangeLogGlobal.idHistory =''; - + function historyGridListChangeLog(){ - - historyGridListChangeLogGlobal.idHistory = historyGridListChangeLogGlobal.idHistory; + + historyGridListChangeLogGlobal.idHistory = historyGridListChangeLogGlobal.idHistory; var rowSelected = processesGrid.getSelectionModel().getSelected(); - if( rowSelected ){ - var idHistory = rowSelected.data.ID_HISTORY; + if( rowSelected ){ + var idHistory = rowSelected.data.ID_HISTORY; historyGridListChangeLogGlobal.idHistory = idHistory; historyGridListChangeLogPanel(); } @@ -167,10 +167,10 @@ buttons: Ext.MessageBox.OK }); } - + } //!!historyGridList|changeLog - + function historyGridList(){ store = new Ext.data.GroupingStore({ proxy : new Ext.data.HttpProxy @@ -178,8 +178,8 @@ { url: 'caseHistory_Ajax.php?actionAjax=historyGridList_JXP' } - ), - + ), + reader : new Ext.data.JsonReader ( { @@ -203,24 +203,24 @@ {name : 'APP_DISABLE_ACTION_DATE', type:'float'} ] } - ) + ) }); - + var expander = new Ext.ux.grid.RowExpander({ tpl : new Ext.Template( '
'+TRANSLATIONS.ID_PRO_DESCRIPTION+': {PRO_DESCRIPTION}