BUG 12562 "Date appears incorrect in the Generated Document..." SOLVED
- Date appears incorrect in the Generated Document List and Input Document List - Bug has been reviewed and has not been able to replicate, it has been tested on a local installation version 2.0.43 where I verify that the dates are correct - We found hardcoded code, the same has been corrected * Available from version ProcessMaker-2.5.2-testing.1
This commit is contained in:
@@ -4129,6 +4129,12 @@ class Cases
|
||||
|
||||
public function getAllUploadedDocumentsCriteria($sProcessUID, $sApplicationUID, $sTasKUID, $sUserUID)
|
||||
{
|
||||
G::LoadClass("configuration");
|
||||
|
||||
$conf = new Configurations();
|
||||
|
||||
$confEnvSetting = $conf->getFormats();
|
||||
|
||||
//verifica si existe la tabla OBJECT_PERMISSION
|
||||
$this->verifyTable();
|
||||
$listing = false;
|
||||
@@ -4218,13 +4224,16 @@ class Cases
|
||||
}
|
||||
$aAux = $oAppDocument->load($aRow['APP_DOC_UID'], $aRow['DOC_VERSION']);
|
||||
$lastVersion = $oAppDocument->getLastAppDocVersion($aRow['APP_DOC_UID'], $sApplicationUID);
|
||||
|
||||
try {
|
||||
$aAux1 = $oUser->load($aAux['USR_UID']);
|
||||
$sUser = $aAux1['USR_FIRSTNAME'] . ' ' . $aAux1['USR_LASTNAME'];
|
||||
|
||||
$sUser = $conf->usersNameFormatBySetParameters($confEnvSetting["format"], $aAux1["USR_USERNAME"], $aAux1["USR_FIRSTNAME"], $aAux1["USR_LASTNAME"]);
|
||||
} catch (Exception $oException) {
|
||||
//$sUser = '(USER DELETED)';
|
||||
$sUser = '***';
|
||||
}
|
||||
|
||||
$aFields = array(
|
||||
'APP_DOC_UID' => $aAux['APP_DOC_UID'],
|
||||
'DOC_UID' => $aAux['DOC_UID'],
|
||||
@@ -4302,12 +4311,15 @@ class Cases
|
||||
}
|
||||
$aAux = $oAppDocument->load($aRow['APP_DOC_UID'], $aRow['DOC_VERSION']);
|
||||
$lastVersion = $oAppDocument->getLastAppDocVersion($aRow['APP_DOC_UID'], $sApplicationUID);
|
||||
|
||||
try {
|
||||
$aAux1 = $oUser->load($aAux['USR_UID']);
|
||||
$sUser = $aAux1['USR_FIRSTNAME'] . ' ' . $aAux1['USR_LASTNAME'];
|
||||
|
||||
$sUser = $conf->usersNameFormatBySetParameters($confEnvSetting["format"], $aAux1["USR_USERNAME"], $aAux1["USR_FIRSTNAME"], $aAux1["USR_LASTNAME"]);
|
||||
} catch (Exception $oException) {
|
||||
$sUser = '***';
|
||||
}
|
||||
|
||||
$aFields = array(
|
||||
'APP_DOC_UID' => $aAux['APP_DOC_UID'],
|
||||
'DOC_UID' => $aAux['DOC_UID'],
|
||||
@@ -4364,12 +4376,15 @@ class Cases
|
||||
$aTask = array('TAS_TITLE' => '[ ' . G::LoadTranslation('ID_SUPERVISOR') . ' ]');
|
||||
$aAux = $oAppDocument->load($aRow['APP_DOC_UID'], $aRow['DOC_VERSION']);
|
||||
$lastVersion = $oAppDocument->getLastAppDocVersion($aRow['APP_DOC_UID'], $sApplicationUID);
|
||||
|
||||
try {
|
||||
$aAux1 = $oUser->load($aAux['USR_UID']);
|
||||
$sUser = $aAux1['USR_FIRSTNAME'] . ' ' . $aAux1['USR_LASTNAME'];
|
||||
|
||||
$sUser = $conf->usersNameFormatBySetParameters($confEnvSetting["format"], $aAux1["USR_USERNAME"], $aAux1["USR_FIRSTNAME"], $aAux1["USR_LASTNAME"]);
|
||||
} catch (Exception $oException) {
|
||||
$sUser = '***';
|
||||
}
|
||||
|
||||
$aFields = array(
|
||||
'APP_DOC_UID' => $aAux['APP_DOC_UID'],
|
||||
'DOC_UID' => $aAux['DOC_UID'],
|
||||
@@ -4434,6 +4449,12 @@ class Cases
|
||||
|
||||
public function getAllGeneratedDocumentsCriteria($sProcessUID, $sApplicationUID, $sTasKUID, $sUserUID)
|
||||
{
|
||||
G::LoadClass("configuration");
|
||||
|
||||
$conf = new Configurations();
|
||||
|
||||
$confEnvSetting = $conf->getFormats();
|
||||
|
||||
//verifica si la tabla OBJECT_PERMISSION
|
||||
$this->verifyTable();
|
||||
$listing = false;
|
||||
@@ -4590,9 +4611,11 @@ class Cases
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
try {
|
||||
$aAux1 = $oUser->load($aAux['USR_UID']);
|
||||
$sUser = $aAux1['USR_FIRSTNAME'] . ' ' . $aAux1['USR_LASTNAME'];
|
||||
|
||||
$sUser = $conf->usersNameFormatBySetParameters($confEnvSetting["format"], $aAux1["USR_USERNAME"], $aAux1["USR_FIRSTNAME"], $aAux1["USR_LASTNAME"]);
|
||||
} catch (Exception $oException) {
|
||||
$sUser = '(USER DELETED)';
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ class Configurations // extends Configuration
|
||||
|
||||
public function usersNameFormatBySetParameters($formatUserName, $userName, $firstName, $lastName)
|
||||
{
|
||||
$usersNameFormat = (!empty($formatUserName))? str_replace(array("@userName", "@firstName", "@lastName"), array($userName, $firstName, $lastName), $formatUserName) : null;
|
||||
$usersNameFormat = str_replace(array("@userName", "@firstName", "@lastName"), array($userName, $firstName, $lastName), $formatUserName);
|
||||
$usersNameFormat = trim($usersNameFormat);
|
||||
|
||||
return $usersNameFormat;
|
||||
@@ -356,23 +356,21 @@ class Configurations // extends Configuration
|
||||
{
|
||||
$field = "USR_LASTNAME";
|
||||
|
||||
$confEnvSetting = $this->getConfiguration("ENVIRONMENT_SETTINGS", "");
|
||||
$confEnvSetting = $this->getFormats();
|
||||
|
||||
if (is_array($confEnvSetting) && isset($confEnvSetting["format"])) {
|
||||
$arrayAux = explode(" ", str_replace(array("(", ")", ","), array(null, null, null), $confEnvSetting["format"]));
|
||||
$arrayAux = explode(" ", str_replace(array("(", ")", ","), array(null, null, null), $confEnvSetting["format"]));
|
||||
|
||||
if (isset($arrayAux[0])) {
|
||||
switch (trim($arrayAux[0])) {
|
||||
case "@userName":
|
||||
$field = "USR_USERNAME";
|
||||
break;
|
||||
case "@firstName":
|
||||
$field = "USR_FIRSTNAME";
|
||||
break;
|
||||
case "@lastName":
|
||||
$field = "USR_LASTNAME";
|
||||
break;
|
||||
}
|
||||
if (isset($arrayAux[0])) {
|
||||
switch (trim($arrayAux[0])) {
|
||||
case "@userName":
|
||||
$field = "USR_USERNAME";
|
||||
break;
|
||||
case "@firstName":
|
||||
$field = "USR_FIRSTNAME";
|
||||
break;
|
||||
case "@lastName":
|
||||
$field = "USR_LASTNAME";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -412,6 +412,7 @@ class Ajax
|
||||
$conf = new Configurations();
|
||||
$oHeadPublisher->addExtJsScript('cases/casesUploadedDocumentsPage', true); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/casesUploadedDocumentsPage'); //adding a html file .html.
|
||||
$oHeadPublisher->assign("FORMATS", $conf->getFormats());
|
||||
$oHeadPublisher->assign('pageSize', $conf->getEnvSetting('casesListRowNumber'));
|
||||
G::RenderPage('publish', 'extJs');
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@ if ($actionAjax == 'casesGenerateDocumentPage') {
|
||||
$conf = new Configurations();
|
||||
$oHeadPublisher->addExtJsScript( 'cases/casesGenerateDocumentPage', true ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'cases/casesGenerateDocumentPage' ); //adding a html file .html.
|
||||
$oHeadPublisher->assign("FORMATS", $conf->getFormats());
|
||||
$oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber' ) );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
}
|
||||
|
||||
@@ -58,12 +58,7 @@ if ($actionAjax == "userValues") {
|
||||
|
||||
$conf = new Configurations();
|
||||
|
||||
$confEnvSetting = $conf->getConfiguration("ENVIRONMENT_SETTINGS", "");
|
||||
$formatUserName = null;
|
||||
|
||||
if (is_array($confEnvSetting) && isset($confEnvSetting["format"])) {
|
||||
$formatUserName = $confEnvSetting["format"];
|
||||
}
|
||||
$confEnvSetting = $conf->getFormats();
|
||||
|
||||
$cUsers = new Criteria( 'workflow' );
|
||||
$cUsers->clearSelectColumns();
|
||||
@@ -79,8 +74,7 @@ if ($actionAjax == "userValues") {
|
||||
while ($oDataset->next()) {
|
||||
$row = $oDataset->getRow();
|
||||
|
||||
$usrFullName = $conf->usersNameFormatBySetParameters($formatUserName, $row["USR_USERNAME"], $row["USR_FIRSTNAME"], $row["USR_LASTNAME"]);
|
||||
$usrFullName = (!empty($usrFullName))? $usrFullName : $row["USR_LASTNAME"] . " " . $row["USR_FIRSTNAME"];
|
||||
$usrFullName = $conf->usersNameFormatBySetParameters($confEnvSetting["format"], $row["USR_USERNAME"], $row["USR_FIRSTNAME"], $row["USR_LASTNAME"]);
|
||||
|
||||
$users[] = array("USR_UID" => $row["USR_UID"], "USR_FULLNAME" => $usrFullName);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* @author: Douglas Medrano
|
||||
* May 03, 2011
|
||||
*/
|
||||
* May 03, 2011
|
||||
*/
|
||||
function deleteFiles(sDocUid, sVersion) {
|
||||
Ext.MessageBox.confirm(_('ID_CONFIRM'), _('ID_DELETE_DOCUMENT'), function(res){
|
||||
Ext.MessageBox.confirm(_('ID_CONFIRM'), _('ID_DELETE_DOCUMENT'), function(res){
|
||||
if(res == 'yes') {
|
||||
Ext.MessageBox.show({
|
||||
msg: _('ID_LOADING'),
|
||||
@@ -38,25 +38,25 @@
|
||||
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){
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,17 +64,17 @@
|
||||
alert( _('ID_BROWSER_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 + ')');
|
||||
}
|
||||
@@ -83,27 +83,27 @@
|
||||
http_request.open('GET', url, true);
|
||||
http_request.send(null);
|
||||
}
|
||||
|
||||
|
||||
function ajaxPostRequestUrlIntact(url, callback_function, id){
|
||||
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){
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,17 +111,17 @@
|
||||
alert( _('ID_BROWSER_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 + ')');
|
||||
}
|
||||
@@ -130,10 +130,10 @@
|
||||
http_request.open('GET', url, true);
|
||||
http_request.send(null);
|
||||
}
|
||||
|
||||
|
||||
var processesGrid;
|
||||
var store;
|
||||
|
||||
|
||||
new Ext.KeyMap(
|
||||
document,
|
||||
{
|
||||
@@ -156,58 +156,58 @@
|
||||
Ext.onReady(function(){
|
||||
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
|
||||
Ext.QuickTips.init();
|
||||
|
||||
|
||||
generateDocumentGrid();
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
var generateDocumentGridDownloadGlobal = {};
|
||||
generateDocumentGridDownloadGlobal.APP_DOC_UID = '';
|
||||
generateDocumentGridDownloadGlobal.FILEDOC = '';
|
||||
generateDocumentGridDownloadGlobal.FILEPDF = '';
|
||||
generateDocumentGridDownloadGlobal.DOWNLOAD = '';
|
||||
|
||||
|
||||
function generateDocumentGridDownload(){
|
||||
//!generateDocumentGridDownloadGlobalSystem
|
||||
var APP_DOC_UID = generateDocumentGridDownloadGlobal.APP_DOC_UID;
|
||||
var FILEDOC = generateDocumentGridDownloadGlobal.FILEDOC;
|
||||
var FILEPDF = generateDocumentGridDownloadGlobal.FILEPDF;
|
||||
var DOWNLOAD = generateDocumentGridDownloadGlobal.DOWNLOAD;
|
||||
|
||||
|
||||
//!dataSystem
|
||||
var downloadLink = '';
|
||||
|
||||
|
||||
if(DOWNLOAD=='FILEDOC'){
|
||||
downloadLink = FILEDOC;
|
||||
}
|
||||
else if(DOWNLOAD=='FILEPDF'){
|
||||
downloadLink = FILEPDF;
|
||||
}
|
||||
|
||||
|
||||
var d = new Date();
|
||||
var time = d.getTime();
|
||||
downloadLink = downloadLink + '&nocachetime='+time;
|
||||
|
||||
|
||||
|
||||
|
||||
window.location.href= downloadLink;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
var generateDocumentGridGlobal = {};
|
||||
generateDocumentGridGlobal.ref = "";
|
||||
|
||||
|
||||
function generateDocumentGrid(){
|
||||
|
||||
|
||||
//dataGlobalConstructor
|
||||
generateDocumentGridGlobal.ref = 'cases_Ajax.php';
|
||||
|
||||
|
||||
//dataGlobal
|
||||
generateDocumentGridGlobal.ref = generateDocumentGridGlobal.ref;
|
||||
|
||||
|
||||
//!dataSystemGlobal
|
||||
var ref = generateDocumentGridGlobal.ref;
|
||||
|
||||
|
||||
//!dataSystem
|
||||
var url = ref+'?action=generateDocumentGrid_Ajax';
|
||||
store = new Ext.data.GroupingStore({
|
||||
@@ -216,7 +216,7 @@
|
||||
{
|
||||
url: url
|
||||
}
|
||||
),
|
||||
),
|
||||
reader : new Ext.data.JsonReader
|
||||
(
|
||||
{
|
||||
@@ -240,35 +240,33 @@
|
||||
{name : 'DOC_VERSION'}
|
||||
]
|
||||
}
|
||||
)
|
||||
)
|
||||
});
|
||||
|
||||
|
||||
var expander = new Ext.ux.grid.RowExpander({
|
||||
tpl : new Ext.Template(
|
||||
'<p><b>'+TRANSLATIONS.ID_PRO_DESCRIPTION+':</b> {PRO_DESCRIPTION}</p><br>'
|
||||
)
|
||||
});
|
||||
|
||||
|
||||
startDateRender = function(v){
|
||||
var processesGrid_ = Ext.getCmp("processesGrid");
|
||||
var dataFormat = processesGrid_.store.reader.jsonData.dataFormat;
|
||||
dataFormat = dataFormat!=""?dataFormat:"m/d/Y H:i:s";
|
||||
var dateString = "-";
|
||||
if(v!="-"){
|
||||
dataFormat
|
||||
dateString = _DF(v,dataFormat);
|
||||
}
|
||||
return dateString;
|
||||
|
||||
startDateRender = function (v)
|
||||
{
|
||||
var dateString = "-";
|
||||
|
||||
if(v != "-") {
|
||||
dateString = _DF(v, FORMATS.casesListDateFormat);
|
||||
}
|
||||
|
||||
return dateString;
|
||||
}
|
||||
|
||||
|
||||
escapeHtml = function(v){
|
||||
var pre = document.createElement('pre');
|
||||
var text = document.createTextNode( v );
|
||||
pre.appendChild(text);
|
||||
return pre.innerHTML;
|
||||
}
|
||||
|
||||
|
||||
actionRenderingTranslation = function(v){
|
||||
var actionTranslate = "";
|
||||
if(v=="PAUSE"){
|
||||
@@ -285,7 +283,7 @@
|
||||
}
|
||||
else if(v==""||v==null){
|
||||
actionTranslate = _("ID_DERIVATED");
|
||||
}
|
||||
}
|
||||
return actionTranslate;
|
||||
};
|
||||
|
||||
@@ -300,7 +298,7 @@
|
||||
var processesGrid = new Ext.grid.GridPanel({
|
||||
region: 'center',
|
||||
layout: 'fit',
|
||||
id: 'processesGrid',
|
||||
id: 'processesGrid',
|
||||
height: '100%',
|
||||
//autoWidth : true,
|
||||
width:'',
|
||||
@@ -312,15 +310,15 @@
|
||||
frame:false,
|
||||
//plugins: expander,
|
||||
cls : 'grid_with_checkbox',
|
||||
columnLines: true,
|
||||
columnLines: true,
|
||||
viewConfig: {
|
||||
forceFit:true
|
||||
},
|
||||
},
|
||||
cm: new Ext.grid.ColumnModel({
|
||||
defaults: {
|
||||
width: 200,
|
||||
sortable: true
|
||||
},
|
||||
},
|
||||
columns:
|
||||
[
|
||||
{id:'APP_DOC_UID', dataIndex: 'APP_DOC_UID', hidden:true, hideable:false},
|
||||
@@ -334,20 +332,20 @@
|
||||
{header: _("ID_CREATED_BY"), dataIndex: 'CREATED_BY', width: 70},
|
||||
{header: _("ID_CREATE_DATE"), dataIndex: 'CREATE_DATE', width: 70,renderer:startDateRender},
|
||||
{header: '', dataIndex: 'DELETE_FILE', width: 30,renderer:renderDeleteFile}
|
||||
|
||||
|
||||
]
|
||||
}),
|
||||
store: store,
|
||||
tbar:[
|
||||
{
|
||||
{
|
||||
text:_("ID_DOWNLOAD"),
|
||||
id:'ID_DOWNLOAD_DOC',
|
||||
iconCls: 'button_menu_ext',
|
||||
icon: '/images/extensionDoc.png',
|
||||
handler: function(){
|
||||
|
||||
|
||||
var rowSelected = processesGrid.getSelectionModel().getSelected();
|
||||
|
||||
|
||||
if( rowSelected ){
|
||||
Ext.Ajax.request({
|
||||
url : 'cases_ShowDocument' ,
|
||||
@@ -371,12 +369,12 @@
|
||||
generateDocumentGridDownloadGlobal.FILEDOC = rowSelected.data.FILEDOC;
|
||||
generateDocumentGridDownloadGlobal.FILEPDF = rowSelected.data.FILEPDF;
|
||||
generateDocumentGridDownloadGlobal.DOWNLOAD = 'FILEDOC';
|
||||
|
||||
|
||||
var APP_DOC_UID = generateDocumentGridDownloadGlobal.APP_DOC_UID;
|
||||
var FILEDOC = generateDocumentGridDownloadGlobal.FILEDOC;
|
||||
var FILEPDF = generateDocumentGridDownloadGlobal.FILEPDF;
|
||||
var DOWNLOAD = generateDocumentGridDownloadGlobal.DOWNLOAD;
|
||||
|
||||
|
||||
generateDocumentGridDownload();
|
||||
}
|
||||
},
|
||||
@@ -397,7 +395,7 @@
|
||||
icon: Ext.MessageBox.INFO,
|
||||
buttons: Ext.MessageBox.OK
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
disabled:true
|
||||
@@ -405,15 +403,15 @@
|
||||
{
|
||||
xtype: 'tbseparator'
|
||||
},
|
||||
{
|
||||
{
|
||||
text:_("ID_DOWNLOAD"),
|
||||
id:'ID_DOWNLOAD_PDF',
|
||||
iconCls: 'button_menu_ext',
|
||||
icon: '/images/extensionPdf.png',
|
||||
handler: function(){
|
||||
|
||||
|
||||
var rowSelected = processesGrid.getSelectionModel().getSelected();
|
||||
|
||||
|
||||
if( rowSelected ){
|
||||
Ext.Ajax.request({
|
||||
url : 'cases_ShowDocument' ,
|
||||
@@ -437,12 +435,12 @@
|
||||
generateDocumentGridDownloadGlobal.FILEDOC = rowSelected.data.FILEDOC;
|
||||
generateDocumentGridDownloadGlobal.FILEPDF = rowSelected.data.FILEPDF;
|
||||
generateDocumentGridDownloadGlobal.DOWNLOAD = 'FILEPDF';
|
||||
|
||||
|
||||
var APP_DOC_UID = generateDocumentGridDownloadGlobal.APP_DOC_UID;
|
||||
var FILEDOC = generateDocumentGridDownloadGlobal.FILEDOC;
|
||||
var FILEPDF = generateDocumentGridDownloadGlobal.FILEPDF;
|
||||
var DOWNLOAD = generateDocumentGridDownloadGlobal.DOWNLOAD;
|
||||
|
||||
|
||||
generateDocumentGridDownload();
|
||||
}
|
||||
},
|
||||
@@ -463,7 +461,7 @@
|
||||
icon: Ext.MessageBox.INFO,
|
||||
buttons: Ext.MessageBox.OK
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
disabled:true
|
||||
@@ -482,60 +480,60 @@
|
||||
}),
|
||||
listeners: {
|
||||
click: function(){
|
||||
|
||||
|
||||
|
||||
var rowSelected = processesGrid.getSelectionModel().getSelected();
|
||||
|
||||
if (rowSelected) {
|
||||
if (rowSelected) {
|
||||
var FILEDOCEXIST = rowSelected.data.FILEDOCEXIST;
|
||||
var FILEPDFEXIST = rowSelected.data.FILEPDFEXIST;
|
||||
|
||||
|
||||
if (rowSelected.data.FILEDOCLABEL=='') {
|
||||
Ext.getCmp('ID_DOWNLOAD_DOC').setDisabled(true);
|
||||
}
|
||||
else {
|
||||
Ext.getCmp('ID_DOWNLOAD_DOC').setDisabled(false);
|
||||
}
|
||||
|
||||
|
||||
if (rowSelected.data.FILEPDFLABEL=='') {
|
||||
Ext.getCmp('ID_DOWNLOAD_PDF').setDisabled(true);
|
||||
}
|
||||
else {
|
||||
Ext.getCmp('ID_DOWNLOAD_PDF').setDisabled(false);
|
||||
}
|
||||
|
||||
|
||||
if ((rowSelected.data.FILEPDFLABEL=='') && (rowSelected.data.FILEDOCLABEL=='')) {
|
||||
Ext.getCmp('ID_DOWNLOAD_PDF').setDisabled(true);
|
||||
Ext.getCmp('ID_DOWNLOAD_DOC').setDisabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* var ID_DOWNLOAD_PDF2_ = Ext.getCmp('ID_DOWNLOAD_PDF');
|
||||
var ID_DOWNLOAD_DOC2_ = Ext.getCmp('ID_DOWNLOAD_DOC');
|
||||
|
||||
if(FILEDOCEXIST== 'javascript:alert("NO DOC")') {
|
||||
|
||||
if(FILEDOCEXIST== 'javascript:alert("NO DOC")') {
|
||||
ID_DOWNLOAD_DOC2_.setDisabled(false);
|
||||
}
|
||||
else {
|
||||
ID_DOWNLOAD_DOC2_.setDisabled(true);
|
||||
else {
|
||||
ID_DOWNLOAD_DOC2_.setDisabled(true);
|
||||
}
|
||||
|
||||
if(FILEPDFEXIST== 'javascript:alert("NO PDF")') {
|
||||
|
||||
if(FILEPDFEXIST== 'javascript:alert("NO PDF")') {
|
||||
ID_DOWNLOAD_PDF2_.setDisabled(false);
|
||||
}
|
||||
else {
|
||||
ID_DOWNLOAD_PDF2_.setDisabled(true);
|
||||
else {
|
||||
ID_DOWNLOAD_PDF2_.setDisabled(true);
|
||||
}
|
||||
|
||||
if (!(FILEPDFEXIST== 'javascript:alert("NO PDF")') && !(FILEDOCEXIST== 'javascript:alert("NO DOC")')) {
|
||||
|
||||
if (!(FILEPDFEXIST== 'javascript:alert("NO PDF")') && !(FILEDOCEXIST== 'javascript:alert("NO DOC")')) {
|
||||
ID_DOWNLOAD_DOC_.setDisabled(false);
|
||||
ID_DOWNLOAD_PDF2_.setDisabled(false);
|
||||
}*/
|
||||
/*else {
|
||||
/*else {
|
||||
ID_DOWNLOAD_PDF_.setDisabled(true);
|
||||
ID_DOWNLOAD_DOC_.setDisabled(true);
|
||||
ID_DOWNLOAD_DOC_.setDisabled(true);
|
||||
}*/
|
||||
|
||||
|
||||
},
|
||||
rowdblclick: function(grid, rowIndex, e) {
|
||||
var rowSelected = store.getAt(rowIndex);
|
||||
@@ -556,18 +554,18 @@
|
||||
},
|
||||
render: function(){
|
||||
this.loadMask = new Ext.LoadMask(this.body, {msg: _('ID_LOADING_GRID') });
|
||||
|
||||
processesGrid.getSelectionModel().on('rowselect', function(){
|
||||
|
||||
processesGrid.getSelectionModel().on('rowselect', function(){
|
||||
var rowSelected = processesGrid.getSelectionModel().getSelected();
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
processesGrid.store.load({params: {"function":"languagesList"}});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
processesGrid.store.on(
|
||||
'load',
|
||||
function()
|
||||
@@ -579,20 +577,20 @@
|
||||
single: true
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
processesGrid.addListener('rowcontextmenu', emptyReturn,this);
|
||||
processesGrid.on('contextmenu', function (evt) {
|
||||
evt.preventDefault();
|
||||
}, this);
|
||||
|
||||
|
||||
function emptyReturn(){
|
||||
}
|
||||
|
||||
|
||||
var viewport = new Ext.Viewport({
|
||||
layout: 'border',
|
||||
autoScroll: true,
|
||||
items: [
|
||||
processesGrid
|
||||
]
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* @author: Douglas Medrano
|
||||
* May 03, 2011
|
||||
*/
|
||||
* May 03, 2011
|
||||
*/
|
||||
md5 = function(s,raw,hexcase,chrsz){
|
||||
raw = raw || false;
|
||||
raw = raw || false;
|
||||
hexcase = hexcase || false;
|
||||
chrsz = chrsz || 8;
|
||||
function safe_add(x, y){
|
||||
@@ -29,7 +29,7 @@
|
||||
function md5_ii(a, b, c, d, x, s, t){
|
||||
return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
|
||||
}
|
||||
|
||||
|
||||
function core_md5(x, len){
|
||||
x[len >> 5] |= 0x80 << ((len) % 32);
|
||||
x[(((len + 64) >>> 9) << 4) + 14] = len;
|
||||
@@ -129,7 +129,7 @@
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
function binl2hex(binarray){
|
||||
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
|
||||
var str = "";
|
||||
@@ -140,30 +140,30 @@
|
||||
}
|
||||
return (raw ? binl2str(core_md5(str2binl(s), s.length * chrsz)) : binl2hex(core_md5(str2binl(s), s.length * chrsz)) );
|
||||
};
|
||||
|
||||
|
||||
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){
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -171,17 +171,17 @@
|
||||
alert( _('ID_BROWSER_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 + ')');
|
||||
}
|
||||
@@ -190,27 +190,27 @@
|
||||
http_request.open('GET', url, true);
|
||||
http_request.send(null);
|
||||
}
|
||||
|
||||
|
||||
function ajaxPostRequestUrlIntact(url, callback_function, id){
|
||||
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){
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -218,17 +218,17 @@
|
||||
alert( _('ID_BROWSER_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 + ')');
|
||||
}
|
||||
@@ -237,10 +237,10 @@
|
||||
http_request.open('GET', url, true);
|
||||
http_request.send(null);
|
||||
}
|
||||
|
||||
|
||||
var processesGrid;
|
||||
var store;
|
||||
|
||||
|
||||
new Ext.KeyMap(
|
||||
document,
|
||||
{
|
||||
@@ -263,44 +263,44 @@
|
||||
Ext.onReady(function(){
|
||||
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
|
||||
Ext.QuickTips.init();
|
||||
|
||||
uploadDocumentGrid();
|
||||
|
||||
});
|
||||
|
||||
|
||||
uploadDocumentGrid();
|
||||
|
||||
});
|
||||
|
||||
|
||||
var uploadDocumentGridDownloadGlobal = {};
|
||||
uploadDocumentGridDownloadGlobal.APP_DOC_UID = '';
|
||||
|
||||
|
||||
function uploadDocumentGridDownload(){
|
||||
|
||||
|
||||
//!uploadDocumentGridDownloadGlobalSystem
|
||||
var APP_DOC_UID = uploadDocumentGridDownloadGlobal.APP_DOC_UID;
|
||||
var DOWNLOAD_LINK = uploadDocumentGridDownloadGlobal.DOWNLOAD_LINK;
|
||||
var TITLE = uploadDocumentGridDownloadGlobal.TITLE;
|
||||
|
||||
|
||||
var urlString = window.location.href;
|
||||
var urlArray = urlString.split("/");
|
||||
urlArray.pop();
|
||||
urlStrin = urlArray.join("/")+"/"+DOWNLOAD_LINK;
|
||||
|
||||
|
||||
window.location.href= DOWNLOAD_LINK;
|
||||
}
|
||||
|
||||
|
||||
var uploadDocumentGridGlobal = {};
|
||||
uploadDocumentGridGlobal.ref = "";
|
||||
|
||||
|
||||
function uploadDocumentGrid(){
|
||||
|
||||
|
||||
//dataGlobalConstructor
|
||||
uploadDocumentGridGlobal.ref = 'cases_Ajax.php';
|
||||
|
||||
|
||||
//dataGlobal
|
||||
uploadDocumentGridGlobal.ref = uploadDocumentGridGlobal.ref;
|
||||
|
||||
|
||||
//!dataSystemGlobal
|
||||
var ref = uploadDocumentGridGlobal.ref;
|
||||
|
||||
|
||||
//!dataSystem
|
||||
var url = ref+'?action=uploadDocumentGrid_Ajax';
|
||||
store = new Ext.data.GroupingStore({
|
||||
@@ -309,7 +309,7 @@
|
||||
{
|
||||
url: url
|
||||
}
|
||||
),
|
||||
),
|
||||
reader : new Ext.data.JsonReader
|
||||
(
|
||||
{
|
||||
@@ -321,29 +321,31 @@
|
||||
{name : 'DOWNLOAD_LINK'},
|
||||
{name : 'TITLE'},
|
||||
{name : 'APP_DOC_COMMENT'},
|
||||
{name : 'TYPE'},
|
||||
{name : 'TYPE'},
|
||||
{name : 'DOC_VERSION'},
|
||||
{name : 'ORIGIN'},
|
||||
{name : 'CREATED_BY'},
|
||||
{name : 'CREATE_DATE'}
|
||||
]
|
||||
}
|
||||
)
|
||||
)
|
||||
});
|
||||
|
||||
|
||||
var expander = new Ext.ux.grid.RowExpander({
|
||||
tpl : new Ext.Template(
|
||||
'<p><b>'+TRANSLATIONS.ID_PRO_DESCRIPTION+':</b> {PRO_DESCRIPTION}</p><br>'
|
||||
)
|
||||
});
|
||||
|
||||
|
||||
startDateRender = function(v){
|
||||
var dateString = "-";
|
||||
if(v!="-"){
|
||||
dateString = _DF(v,"m/d/Y H:i:s");
|
||||
|
||||
startDateRender = function (v)
|
||||
{
|
||||
var dateString = "-";
|
||||
|
||||
if (v != "-") {
|
||||
dateString = _DF(v, FORMATS.casesListDateFormat);
|
||||
}
|
||||
return dateString;
|
||||
|
||||
return dateString;
|
||||
}
|
||||
escapeHtml = function(v){
|
||||
var pre = document.createElement('pre');
|
||||
@@ -351,7 +353,7 @@
|
||||
pre.appendChild(text);
|
||||
return pre.innerHTML;
|
||||
}
|
||||
|
||||
|
||||
actionRenderingTranslation = function(v){
|
||||
var actionTranslate = "";
|
||||
if(v=="PAUSE"){
|
||||
@@ -368,9 +370,9 @@
|
||||
}
|
||||
else if(v==""||v==null){
|
||||
actionTranslate = _("ID_DERIVATED");
|
||||
}
|
||||
}
|
||||
return actionTranslate;
|
||||
};
|
||||
};
|
||||
var processesGrid = new Ext.grid.GridPanel({
|
||||
region: 'center',
|
||||
layout: 'fit',
|
||||
@@ -386,15 +388,15 @@
|
||||
frame:false,
|
||||
//plugins: expander,
|
||||
cls : 'grid_with_checkbox',
|
||||
columnLines: true,
|
||||
columnLines: true,
|
||||
viewConfig: {
|
||||
forceFit:true
|
||||
},
|
||||
},
|
||||
cm: new Ext.grid.ColumnModel({
|
||||
defaults: {
|
||||
width: 200,
|
||||
sortable: true
|
||||
},
|
||||
},
|
||||
columns:
|
||||
[
|
||||
{id:'APP_DOC_UID', dataIndex: 'APP_DOC_UID', hidden:true, hideable:false},
|
||||
@@ -406,21 +408,21 @@
|
||||
{header: _("ID_ORIGIN_TASK"), dataIndex: 'ORIGIN', width: 70},
|
||||
{header: _("ID_CREATED_BY"), dataIndex: 'CREATED_BY', width: 70},
|
||||
{header: _("ID_CREATE_DATE"), dataIndex: 'CREATE_DATE', width: 70,renderer:startDateRender}
|
||||
|
||||
|
||||
]
|
||||
}),
|
||||
store: store,
|
||||
tbar:[
|
||||
{
|
||||
|
||||
|
||||
text:_("ID_DOWNLOAD"),
|
||||
id:'sendMailMessageFormRadioId',
|
||||
iconCls: 'button_menu_ext',
|
||||
icon: '/images/documents/_downGreen.png',
|
||||
handler: function(){
|
||||
|
||||
|
||||
var rowSelected = processesGrid.getSelectionModel().getSelected();
|
||||
|
||||
|
||||
if( rowSelected ){
|
||||
Ext.Ajax.request({
|
||||
url : 'cases_ShowDocument' ,
|
||||
@@ -443,11 +445,11 @@
|
||||
uploadDocumentGridDownloadGlobal.APP_DOC_UID = rowSelected.data.APP_DOC_UID;
|
||||
uploadDocumentGridDownloadGlobal.DOWNLOAD_LINK = rowSelected.data.DOWNLOAD_LINK;
|
||||
uploadDocumentGridDownloadGlobal.TITLE = rowSelected.data.TITLE;
|
||||
|
||||
|
||||
var APP_DOC_UID = uploadDocumentGridDownloadGlobal.APP_DOC_UID;
|
||||
var DOWNLOAD_LINK = uploadDocumentGridDownloadGlobal.DOWNLOAD_LINK;
|
||||
var TITLE = uploadDocumentGridDownloadGlobal.TITLE;
|
||||
|
||||
|
||||
uploadDocumentGridDownload();
|
||||
}
|
||||
},
|
||||
@@ -467,7 +469,7 @@
|
||||
icon: Ext.MessageBox.INFO,
|
||||
buttons: Ext.MessageBox.OK
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
disabled:false
|
||||
@@ -504,9 +506,9 @@
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
processesGrid.store.load({params: {"function":"languagesList"}});
|
||||
|
||||
|
||||
processesGrid.store.on(
|
||||
'load',
|
||||
function()
|
||||
@@ -518,16 +520,16 @@
|
||||
single: true
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
processesGrid.addListener('rowcontextmenu', emptyReturn,this);
|
||||
processesGrid.on('rowcontextmenu', function (grid, rowIndex, evt) {
|
||||
var sm = grid.getSelectionModel();
|
||||
sm.selectRow(rowIndex, sm.isSelected(rowIndex));
|
||||
|
||||
|
||||
var rowSelected = Ext.getCmp('processesGrid').getSelectionModel().getSelected();
|
||||
var activator = Ext.getCmp('activator2');
|
||||
var debug = Ext.getCmp('debug');
|
||||
|
||||
|
||||
if( rowSelected.data.PRO_STATUS == 'ACTIVE' ){
|
||||
activator.setIconClass('icon-deactivate');
|
||||
activator.setText(TRANSLATIONS.ID_DEACTIVATE);
|
||||
@@ -535,7 +537,7 @@
|
||||
activator.setIconClass('icon-activate');
|
||||
activator.setText(TRANSLATIONS.ID_ACTIVATE);
|
||||
}
|
||||
|
||||
|
||||
if( rowSelected.data.PRO_DEBUG == 1){
|
||||
debug.setIconClass('icon-debug-disabled');
|
||||
debug.setText(_('ID_DISABLE_DEBUG'));
|
||||
@@ -544,19 +546,19 @@
|
||||
debug.setText(_('ID_ENABLE_DEBUG'));
|
||||
}
|
||||
}, this);
|
||||
|
||||
|
||||
processesGrid.on('contextmenu', function (evt) {
|
||||
evt.preventDefault();
|
||||
}, this);
|
||||
|
||||
|
||||
function emptyReturn(){
|
||||
}
|
||||
|
||||
|
||||
var viewport = new Ext.Viewport({
|
||||
layout: 'fit',
|
||||
autoScroll: false,
|
||||
items: [
|
||||
processesGrid
|
||||
]
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user