IDEMPIERE-1968:valid check box in info window can manual editable / peer review
This commit is contained in:
parent
830f273e54
commit
0becee9edb
|
@ -2,21 +2,9 @@ SET SQLBLANKLINES ON
|
|||
SET DEFINE OFF
|
||||
|
||||
-- Jun 3, 2014 4:22:36 PM ICT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
-- IDEMPIERE-1968 valid check box in info window can manual editable
|
||||
UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_DATE('2014-06-03 16:22:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201639
|
||||
;
|
||||
-- Jun 3, 2014 11:42:11 PM ICT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Column SET AD_Process_ID=NULL,Updated=TO_DATE('2014-06-03 23:42:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=15759
|
||||
;
|
||||
|
||||
-- Jun 3, 2014 11:44:39 PM ICT
|
||||
UPDATE AD_Column SET IsToolbarButton='N', AD_Reference_ID=10,Updated=TO_DATE('2014-06-03 23:44:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=15759
|
||||
;
|
||||
|
||||
-- Jun 3, 2014 11:47:13 PM ICT
|
||||
UPDATE AD_Field SET IsDisplayed='N',Updated=TO_DATE('2014-06-03 23:47:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13580
|
||||
;
|
||||
|
||||
SELECT register_migration_script('201406031604_IDEMPIERE-1968.sql') FROM dual
|
||||
;
|
||||
|
|
|
@ -2,14 +2,10 @@ SET SQLBLANKLINES ON
|
|||
SET DEFINE OFF
|
||||
|
||||
-- Jun 3, 2014 5:05:09 PM ICT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
-- IDEMPIERE-1968 valid check box in info window can manual editable
|
||||
UPDATE AD_Column SET IsUpdateable='N', FKConstraintType='C',Updated=TO_DATE('2014-06-03 17:05:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=208377
|
||||
;
|
||||
|
||||
-- Jun 3, 2014 5:05:16 PM ICT
|
||||
ALTER TABLE AD_InfoWindow_Access MODIFY AD_InfoWindow_ID NUMBER(10)
|
||||
;
|
||||
|
||||
-- Jun 3, 2014 5:05:16 PM ICT
|
||||
ALTER TABLE AD_InfoWindow_Access DROP CONSTRAINT adinfowindow_adinfowindowacces
|
||||
;
|
||||
|
@ -62,7 +58,6 @@ UPDATE AD_Field SET DisplayLogic=NULL, DefaultValue='@AD_InfoWindow_ID@',Updated
|
|||
;
|
||||
|
||||
-- Jun 3, 2014 5:21:06 PM ICT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Tab SET TabLevel=1,Updated=TO_DATE('2014-06-03 17:21:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=200144
|
||||
;
|
||||
|
||||
|
@ -74,5 +69,5 @@ UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_DATE('2014-06-03 17:25:34','YYYY-M
|
|||
UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_DATE('2014-06-03 17:26:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203053
|
||||
;
|
||||
|
||||
SELECT register_migration_script('201406031604_IDEMPIERE-1968-Access.sql') FROM dual
|
||||
SELECT register_migration_script('201406031605_IDEMPIERE-1968-Access.sql') FROM dual
|
||||
;
|
|
@ -1,18 +1,7 @@
|
|||
-- Jun 3, 2014 4:22:36 PM ICT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
-- IDEMPIERE-1968 valid check box in info window can manual editable
|
||||
UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_TIMESTAMP('2014-06-03 16:22:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201639
|
||||
;
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Column SET AD_Process_ID=NULL,Updated=TO_TIMESTAMP('2014-06-03 23:42:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=15759
|
||||
;
|
||||
|
||||
-- Jun 3, 2014 11:44:39 PM ICT
|
||||
UPDATE AD_Column SET IsToolbarButton='N', AD_Reference_ID=10,Updated=TO_TIMESTAMP('2014-06-03 23:44:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=15759
|
||||
;
|
||||
|
||||
-- Jun 3, 2014 11:47:13 PM ICT
|
||||
UPDATE AD_Field SET IsDisplayed='N',Updated=TO_TIMESTAMP('2014-06-03 23:47:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13580
|
||||
;
|
||||
|
||||
SELECT register_migration_script('201406031604_IDEMPIERE-1968.sql') FROM dual
|
||||
;
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
-- Jun 3, 2014 5:05:09 PM ICT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
-- IDEMPIERE-1968 valid check box in info window can manual editable
|
||||
UPDATE AD_Column SET IsUpdateable='N', FKConstraintType='C',Updated=TO_TIMESTAMP('2014-06-03 17:05:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=208377
|
||||
;
|
||||
|
||||
-- Jun 3, 2014 5:05:16 PM ICT
|
||||
INSERT INTO t_alter_column values('ad_infowindow_access','AD_InfoWindow_ID','NUMERIC(10)',null,null)
|
||||
;
|
||||
|
||||
-- Jun 3, 2014 5:05:16 PM ICT
|
||||
ALTER TABLE AD_InfoWindow_Access DROP CONSTRAINT adinfowindow_adinfowindowacces
|
||||
;
|
||||
|
@ -57,8 +53,8 @@ UPDATE AD_Field SET IsReadOnly='Y', DisplayLogic='@AD_InfoWindow_ID@',Updated=TO
|
|||
-- Jun 3, 2014 5:17:05 PM ICT
|
||||
UPDATE AD_Field SET DisplayLogic=NULL, DefaultValue='@AD_InfoWindow_ID@',Updated=TO_TIMESTAMP('2014-06-03 17:17:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203055
|
||||
;
|
||||
|
||||
-- Jun 3, 2014 5:21:06 PM ICT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Tab SET TabLevel=1,Updated=TO_TIMESTAMP('2014-06-03 17:21:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=200144
|
||||
;
|
||||
|
||||
|
@ -69,5 +65,6 @@ UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_TIMESTAMP('2014-06-03 17:25:34','Y
|
|||
-- Jun 3, 2014 5:26:17 PM ICT
|
||||
UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_TIMESTAMP('2014-06-03 17:26:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203053
|
||||
;
|
||||
SELECT register_migration_script('201406031604_IDEMPIERE-1968-Access.sql') FROM dual
|
||||
|
||||
SELECT register_migration_script('201406031605_IDEMPIERE-1968-Access.sql') FROM dual
|
||||
;
|
|
@ -16,11 +16,7 @@
|
|||
*****************************************************************************/
|
||||
package org.compiere.process;
|
||||
|
||||
import java.sql.PreparedStatement;
|
||||
|
||||
import org.compiere.model.MInfoColumn;
|
||||
import org.compiere.model.MInfoWindow;
|
||||
import org.compiere.util.DB;
|
||||
|
||||
/**
|
||||
* Validate Info Window SQL
|
||||
|
@ -50,60 +46,10 @@ public class InfoWindowValidate extends SvrProcess
|
|||
throws Exception
|
||||
{
|
||||
MInfoWindow infoWindow = new MInfoWindow(getCtx(), p_AD_InfoWindow_ID, (String)null);
|
||||
infoWindow.setIsValid(false);
|
||||
infoWindow.validate();
|
||||
infoWindow.saveEx();
|
||||
|
||||
StringBuilder builder = new StringBuilder("SELECT ");
|
||||
if (infoWindow.isDistinct())
|
||||
builder.append("DISTINCT ");
|
||||
|
||||
MInfoColumn[] infoColumns = infoWindow.getInfoColumns();
|
||||
if (infoColumns.length == 0)
|
||||
throw new Exception("NoColumns");
|
||||
|
||||
for (int columnIndex = 0; columnIndex < infoColumns.length; columnIndex++) {
|
||||
if (columnIndex > 0)
|
||||
{
|
||||
builder.append(", ");
|
||||
}
|
||||
builder.append(infoColumns[columnIndex].getSelectClause());
|
||||
}
|
||||
|
||||
builder.append( " FROM ").append(infoWindow.getFromClause());
|
||||
if (infoWindow.getWhereClause() != null && infoWindow.getWhereClause().trim().length() > 0) {
|
||||
builder.append(" WHERE ").append(infoWindow.getWhereClause());
|
||||
}
|
||||
|
||||
if (infoWindow.getOtherClause() != null && infoWindow.getOtherClause().trim().length() > 0) {
|
||||
builder.append(" ").append(infoWindow.getOtherClause());
|
||||
}
|
||||
|
||||
if (infoWindow.getOrderByClause() != null && infoWindow.getOrderByClause().trim().length() > 0) {
|
||||
builder.append(" ORDER BY ").append(infoWindow.getOrderByClause());
|
||||
}
|
||||
|
||||
while(builder.indexOf("@") >= 0) {
|
||||
int start = builder.indexOf("@");
|
||||
int end = builder.indexOf("@", start+1);
|
||||
if (start >=0 && end > start) {
|
||||
builder.replace(start, end+1, "0");
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
PreparedStatement pstmt = null;
|
||||
try {
|
||||
pstmt = DB.prepareStatement(builder.toString(), get_TrxName());
|
||||
pstmt.executeQuery();
|
||||
} finally {
|
||||
DB.close(pstmt);
|
||||
}
|
||||
|
||||
infoWindow.setIsValid(true);
|
||||
infoWindow.saveEx();
|
||||
|
||||
return "Ok";
|
||||
return infoWindow.isValid() ? "@OK@" : "@NotValid@";
|
||||
} // doIt
|
||||
|
||||
} // InfoWindowValidate
|
||||
|
|
|
@ -36,7 +36,7 @@ public class MInfoColumn extends X_AD_InfoColumn
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 4317064257861102601L;
|
||||
private static final long serialVersionUID = 9198213211937136870L;
|
||||
|
||||
/**
|
||||
* Stanfard Constructor
|
||||
|
@ -60,6 +60,20 @@ public class MInfoColumn extends X_AD_InfoColumn
|
|||
super (ctx, rs, trxName);
|
||||
} // MInfoColumn
|
||||
|
||||
/** Parent */
|
||||
private MInfoWindow m_parent = null;
|
||||
|
||||
/**
|
||||
* Get Parent
|
||||
* @return parent
|
||||
*/
|
||||
public MInfoWindow getParent()
|
||||
{
|
||||
if (m_parent == null)
|
||||
m_parent = new MInfoWindow(getCtx(), getAD_InfoWindow_ID(), get_TrxName());
|
||||
return m_parent;
|
||||
} // getParent
|
||||
|
||||
/**
|
||||
* check column read access
|
||||
* @param tableInfos
|
||||
|
@ -144,12 +158,10 @@ public class MInfoColumn extends X_AD_InfoColumn
|
|||
|
||||
// call valid of parrent
|
||||
if (isNeedValid){
|
||||
MInfoWindow parentInfo = new MInfoWindow (getCtx(), this.getAD_InfoWindow_ID(), get_TrxName());
|
||||
parentInfo.validate();
|
||||
parentInfo.saveEx();
|
||||
getParent().validate();
|
||||
getParent().saveEx(get_TrxName());
|
||||
}
|
||||
|
||||
|
||||
return super.afterSave(newRecord, success);
|
||||
}
|
||||
|
||||
|
@ -160,9 +172,8 @@ public class MInfoColumn extends X_AD_InfoColumn
|
|||
*/
|
||||
@Override
|
||||
protected boolean afterDelete(boolean success) {
|
||||
MInfoWindow parentInfo = new MInfoWindow (getCtx(), this.getAD_InfoWindow_ID(), get_TrxName());
|
||||
parentInfo.validate();
|
||||
parentInfo.saveEx();
|
||||
getParent().validate();
|
||||
getParent().saveEx(get_TrxName());
|
||||
return super.afterDelete(success);
|
||||
}
|
||||
} // MInfoColumn
|
||||
|
|
Loading…
Reference in New Issue