Merged trekglobal/idempiere/release-2.0 into development

This commit is contained in:
Heng Sin Low 2013-11-08 18:27:19 +08:00
commit bd8ca80a10
8 changed files with 138 additions and 23 deletions

View File

@ -0,0 +1,39 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Nov 7, 2013 4:46:57 PM COT
-- IDEMPIERE-1442 Additional confirmation on close and void action
UPDATE AD_Field SET SeqNo=50,Updated=TO_DATE('2013-11-07 16:46:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1311
;
-- Nov 7, 2013 4:46:57 PM COT
UPDATE AD_Field SET SeqNo=70,Updated=TO_DATE('2013-11-07 16:46:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3052
;
-- Nov 7, 2013 4:46:57 PM COT
UPDATE AD_Field SET SeqNo=80,Updated=TO_DATE('2013-11-07 16:46:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3054
;
-- Nov 7, 2013 4:46:57 PM COT
UPDATE AD_Field SET SeqNo=90, IsDisplayed='Y', XPosition=4,Updated=TO_DATE('2013-11-07 16:46:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201340
;
-- Nov 7, 2013 4:46:57 PM COT
UPDATE AD_Field SET SeqNo=100, IsDisplayed='Y', XPosition=1,Updated=TO_DATE('2013-11-07 16:46:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200948
;
-- Nov 7, 2013 4:46:57 PM COT
UPDATE AD_Field SET SeqNo=110, IsDisplayed='Y', XPosition=4,Updated=TO_DATE('2013-11-07 16:46:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200949
;
-- Nov 7, 2013 4:46:57 PM COT
UPDATE AD_Field SET SeqNo=120, IsDisplayed='Y', XPosition=2,Updated=TO_DATE('2013-11-07 16:46:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202532
;
-- Nov 7, 2013 4:46:57 PM COT
UPDATE AD_Field SET SeqNo=130, IsDisplayed='Y', XPosition=5,Updated=TO_DATE('2013-11-07 16:46:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202533
;
SELECT register_migration_script('201311071647_IDEMPIERE-1442.sql') FROM dual
;

View File

@ -0,0 +1,36 @@
-- Nov 7, 2013 4:46:57 PM COT
-- IDEMPIERE-1442 Additional confirmation on close and void action
UPDATE AD_Field SET SeqNo=50,Updated=TO_TIMESTAMP('2013-11-07 16:46:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1311
;
-- Nov 7, 2013 4:46:57 PM COT
UPDATE AD_Field SET SeqNo=70,Updated=TO_TIMESTAMP('2013-11-07 16:46:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3052
;
-- Nov 7, 2013 4:46:57 PM COT
UPDATE AD_Field SET SeqNo=80,Updated=TO_TIMESTAMP('2013-11-07 16:46:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3054
;
-- Nov 7, 2013 4:46:57 PM COT
UPDATE AD_Field SET SeqNo=90, IsDisplayed='Y', XPosition=4,Updated=TO_TIMESTAMP('2013-11-07 16:46:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201340
;
-- Nov 7, 2013 4:46:57 PM COT
UPDATE AD_Field SET SeqNo=100, IsDisplayed='Y', XPosition=1,Updated=TO_TIMESTAMP('2013-11-07 16:46:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200948
;
-- Nov 7, 2013 4:46:57 PM COT
UPDATE AD_Field SET SeqNo=110, IsDisplayed='Y', XPosition=4,Updated=TO_TIMESTAMP('2013-11-07 16:46:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200949
;
-- Nov 7, 2013 4:46:57 PM COT
UPDATE AD_Field SET SeqNo=120, IsDisplayed='Y', XPosition=2,Updated=TO_TIMESTAMP('2013-11-07 16:46:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202532
;
-- Nov 7, 2013 4:46:57 PM COT
UPDATE AD_Field SET SeqNo=130, IsDisplayed='Y', XPosition=5,Updated=TO_TIMESTAMP('2013-11-07 16:46:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202533
;
SELECT register_migration_script('201311071647_IDEMPIERE-1442.sql') FROM dual
;

View File

@ -286,6 +286,8 @@ public class ColumnSync extends SvrProcess
else if (fkConstraintType.equals(MColumn.FKCONSTRAINTTYPE_SetNull)) else if (fkConstraintType.equals(MColumn.FKCONSTRAINTTYPE_SetNull))
fkConstraint.append(" ON DELETE SET NULL"); fkConstraint.append(" ON DELETE SET NULL");
fkConstraint.append(" DEFERRABLE INITIALLY DEFERRED");
fkConstraintSql.append(DB.SQLSTATEMENT_SEPARATOR); fkConstraintSql.append(DB.SQLSTATEMENT_SEPARATOR);
fkConstraintSql.append("ALTER TABLE ").append(table.getTableName()); fkConstraintSql.append("ALTER TABLE ").append(table.getTableName());
fkConstraintSql.append(" ADD "); fkConstraintSql.append(" ADD ");

View File

@ -566,6 +566,8 @@ public abstract class Convert
return false; return false;
} }
private static String m_oldprm_COMMENT = "";
private static void writeLogMigrationScript(Writer w, String statement) throws IOException private static void writeLogMigrationScript(Writer w, String statement) throws IOException
{ {
boolean isUseCentralizedID = "Y".equals(MSysConfig.getValue(MSysConfig.DICTIONARY_ID_USE_CENTRALIZED_ID, "Y")); // defaults to Y boolean isUseCentralizedID = "Y".equals(MSysConfig.getValue(MSysConfig.DICTIONARY_ID_USE_CENTRALIZED_ID, "Y")); // defaults to Y
@ -581,10 +583,14 @@ public abstract class Convert
w.append("-- "); w.append("-- ");
w.append(dateTimeText); w.append(dateTimeText);
w.append("\n"); w.append("\n");
// log sysconfig comment if (prm_COMMENT != null && ! m_oldprm_COMMENT.equals(prm_COMMENT)) {
w.append("-- "); // log sysconfig comment
w.append(prm_COMMENT); w.append("-- ");
w.append("\n"); w.append(prm_COMMENT);
w.append("\n");
if (w == writerPg)
m_oldprm_COMMENT = prm_COMMENT;
}
// log statement // log statement
w.append(statement); w.append(statement);
// close statement // close statement

View File

@ -444,6 +444,8 @@ public class CreateForeignKey extends SvrProcess {
else if (fkConstraintType.equals(MColumn.FKCONSTRAINTTYPE_SetNull)) else if (fkConstraintType.equals(MColumn.FKCONSTRAINTTYPE_SetNull))
fkConstraint.append(" ON DELETE SET NULL"); fkConstraint.append(" ON DELETE SET NULL");
fkConstraint.append(" DEFERRABLE INITIALLY DEFERRED");
column.setFKConstraintName(fkConstraintName); column.setFKConstraintName(fkConstraintName);
column.setFKConstraintType(fkConstraintType); column.setFKConstraintType(fkConstraintType);
column.saveEx(); column.saveEx();

View File

@ -469,21 +469,21 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
super.prepareTable(layout, from, where, orderBy); super.prepareTable(layout, from, where, orderBy);
if (m_sqlMain.indexOf("@") >= 0) { if (m_sqlMain.indexOf("@") >= 0) {
String sql = Env.parseContext(infoContext, p_WindowNo, m_sqlMain, true); String sql = Env.parseContext(infoContext, p_WindowNo, m_sqlMain, true);
if (sql == null || sql.length() == 9) { if (sql == null || sql.length() == 0) {
log.severe("Failed to parsed sql. sql=" + m_sqlMain); log.severe("Failed to parsed sql. sql=" + m_sqlMain);
} else { } else {
m_sqlMain = sql; m_sqlMain = sql;
} }
} }
if (infoWindow.isDistinct()) { if (m_sqlMain.length() > 0 && infoWindow.isDistinct()) {
m_sqlMain = m_sqlMain.substring("SELECT ".length()); m_sqlMain = m_sqlMain.substring("SELECT ".length());
m_sqlMain = "SELECT DISTINCT " + m_sqlMain; m_sqlMain = "SELECT DISTINCT " + m_sqlMain;
} }
if (m_sqlOrder != null && m_sqlOrder.indexOf("@") >= 0) { if (m_sqlOrder != null && m_sqlOrder.indexOf("@") >= 0) {
String sql = Env.parseContext(infoContext, p_WindowNo, m_sqlOrder, false, false); String sql = Env.parseContext(infoContext, p_WindowNo, m_sqlOrder, false, false);
if (sql == null || sql.length() == 9) { if (sql == null || sql.length() == 0) {
log.severe("Failed to parsed sql. sql=" + m_sqlOrder); log.severe("Failed to parsed sql. sql=" + m_sqlOrder);
} else { } else {
m_sqlOrder = sql; m_sqlOrder = sql;

View File

@ -305,13 +305,10 @@ public class WDocActionPanel extends Window implements EventListener<Event>, Dia
if (Events.ON_CLICK.equals(event.getName())) if (Events.ON_CLICK.equals(event.getName()))
{ {
if (confirmPanel.getButton("Ok").equals(event.getTarget())) if (confirmPanel.getButton("Ok").equals(event.getTarget()))
{ {
m_OKpressed = true;
setValue();
MClientInfo clientInfo = MClientInfo.get(Env.getCtx()); MClientInfo clientInfo = MClientInfo.get(Env.getCtx());
if(clientInfo.isConfirmOnDocClose() || clientInfo.isConfirmOnDocVoid()) if(clientInfo.isConfirmOnDocClose() || clientInfo.isConfirmOnDocVoid())
{ {
final Window window = this;
String selected = lstDocAction.getSelectedItem().getValue().toString(); String selected = lstDocAction.getSelectedItem().getValue().toString();
if((selected.equals(org.compiere.process.DocAction.ACTION_Close) && clientInfo.isConfirmOnDocClose()) if((selected.equals(org.compiere.process.DocAction.ACTION_Close) && clientInfo.isConfirmOnDocClose())
|| (selected.equals(org.compiere.process.DocAction.ACTION_Void) && clientInfo.isConfirmOnDocVoid())) || (selected.equals(org.compiere.process.DocAction.ACTION_Void) && clientInfo.isConfirmOnDocVoid()))
@ -323,17 +320,23 @@ public class WDocActionPanel extends Window implements EventListener<Event>, Dia
@Override @Override
public void onCallback(Boolean result) { public void onCallback(Boolean result) {
if(result) if(result)
window.detach(); {
setValueAndClose();
}
else else
return; return;
} }
}); });
} }
else else
this.detach(); {
setValueAndClose();
}
} }
else else
this.detach(); {
setValueAndClose();
}
} }
else if (confirmPanel.getButton("Cancel").equals(event.getTarget())) else if (confirmPanel.getButton("Cancel").equals(event.getTarget()))
{ {
@ -351,6 +354,12 @@ public class WDocActionPanel extends Window implements EventListener<Event>, Dia
} }
} }
private void setValueAndClose() {
m_OKpressed = true;
setValue();
detach();
}
private void setValue() private void setValue()
{ {
int index = getSelectedIndex(); int index = getSelectedIndex();

View File

@ -269,6 +269,13 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
{ {
return false; return false;
} }
if (!winMain.getComponent().getTabpanel(0).isVisible())
{
winMain.getComponent().setSelectedIndex(1);
onAdvanceTabSelected();
}
return true; return true;
} }
@ -676,6 +683,12 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
addSelectionColumn (field); addSelectionColumn (field);
} }
if (m_sEditors.isEmpty()) {
Tabpanel tabPanel = winMain.getComponent().getTabpanel(0);
tabPanel.getLinkedTab().setVisible(false);
tabPanel.setVisible(false);
}
gridFieldList = null; gridFieldList = null;
m_total = getNoOfRecords(null, false); m_total = getNoOfRecords(null, false);
@ -1072,16 +1085,9 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
} }
else if (event.getTarget() instanceof Tab) { else if (event.getTarget() instanceof Tab) {
if (winMain.getComponent().getSelectedIndex() == 1) { if (winMain.getComponent().getSelectedIndex() == 1) {
fQueryName.setReadonly(false); onAdvanceTabSelected();
btnSave.setDisabled(m_AD_Tab_ID <= 0);
historyCombo.setSelectedItem(null);
if (advancedPanel.getItems().size() == 0) {
createFields();
}
} else { } else {
fQueryName.setReadonly(true); onSimpleTabSelected();
btnSave.setDisabled(true);
historyCombo.setDisabled(false);
} }
} }
} // } //
@ -1171,6 +1177,21 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
} // onEvent } // onEvent
private void onSimpleTabSelected() {
fQueryName.setReadonly(true);
btnSave.setDisabled(true);
historyCombo.setDisabled(false);
}
private void onAdvanceTabSelected() {
fQueryName.setReadonly(false);
btnSave.setDisabled(m_AD_Tab_ID <= 0);
historyCombo.setSelectedItem(null);
if (advancedPanel.getItems().size() == 0) {
createFields();
}
}
private void parseUserQuery(MUserQuery userQuery) private void parseUserQuery(MUserQuery userQuery)
{ {
String code = userQuery.getCode(); String code = userQuery.getCode();