BUG 7055 FIx Bug. Modify records with more than one primary key.

This commit is contained in:
Hector Cortez
2011-06-13 09:30:55 -04:00
parent 42fcf9ce88
commit db0153cb6d
2 changed files with 34 additions and 15 deletions

View File

@@ -40,18 +40,20 @@ $c = new Configurations();
$configPage = $c->getConfiguration('additionalTablesData', 'pageSize','',$_SESSION['USER_LOGGED']);
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
$arrNames = Array();
$arrNames = Array();
$arrDescrip = Array();
$arrPKF = Array();
$c = 0;
$xPKF = "";
foreach ($fields as $field){
$c++;
$arrNames[] = $field['FLD_NAME'];
$arrDescrip[] = $field['FLD_DESCRIPTION'];
if ($field['FLD_KEY']=='1'){
$xPKF = $field['FLD_NAME'];
}
$c++;
$arrNames[] = $field['FLD_NAME'];
$arrDescrip[] = $field['FLD_DESCRIPTION'];
if ($field['FLD_KEY']=='1'){
$arrPKF[] = $field['FLD_NAME'];
}
}
$xPKF = implode(',', $arrPKF);
//$oHeadPublisher->usingExtJs('ux/Ext.ux.fileUploadField');

View File

@@ -255,9 +255,15 @@ NewPMTableRow = function(){
//Load PM Table Edition Row Form
EditPMTableRow = function(){
iGrid = Ext.getCmp('infoGrid');
rowsSelected = iGrid.getSelectionModel().getSelections();
location.href = 'additionalTablesDataEdit?sUID='+TABLES.UID+'&'+TABLES.PKF+'='+RetrieveRowsID(rowsSelected);
iGrid = Ext.getCmp('infoGrid');
rowsSelected = iGrid.getSelectionModel().getSelections();
var aRowsSeleted = (RetrieveRowsID(rowsSelected)).split(",") ;
var aTablesPKF = (TABLES.PKF).split(","); ;
var sParam = '';
for(var i=0;i<aTablesPKF.length; i++){
sParam += '&' + aTablesPKF[i] + '=' + aRowsSeleted[i];
}
location.href = 'additionalTablesDataEdit?sUID='+TABLES.UID+sParam;
};
//Confirm PM Table Row Deletion Tasks
@@ -267,8 +273,14 @@ DeletePMTableRow = function(){
Ext.Msg.confirm(_('ID_CONFIRM'), _('ID_MSG_CONFIRM_DELETE_ROW'),
function(btn, text){
if (btn=="yes"){
location.href = 'additionalTablesDataDelete?sUID='+TABLES.UID+'&'+TABLES.PKF+'='+RetrieveRowsID(rowsSelected);
}
var aRowsSeleted = (RetrieveRowsID(rowsSelected)).split(",") ;
var aTablesPKF = (TABLES.PKF).split(","); ;
var sParam = '';
for(var i=0;i<aTablesPKF.length; i++){
sParam += '&' + aTablesPKF[i] + '=' + aRowsSeleted[i];
}
location.href = 'additionalTablesDataDelete?sUID='+TABLES.UID+sParam;
}
});
};
@@ -285,9 +297,14 @@ BackPMList = function(){
//Gets UIDs from a array of rows
RetrieveRowsID = function(rows){
var arrAux = new Array();
for(var c=0; c<rows.length; c++){
arrAux[c] = rows[c].get(TABLES.PKF);
}
var arrPKF = new Array();
arrPKF = TABLES.PKF.split(',');
if(rows.length>0){
var c = 0;
for(var i=0; i<arrPKF.length; i++){
arrAux[i] = rows[c].get(arrPKF[i]);
}
}
return arrAux.join(',');
};