Merge deb80b3b3124
This commit is contained in:
commit
b8851a6661
|
@ -0,0 +1,29 @@
|
|||
-- Feb 13, 2013 7:08:02 PM COT
|
||||
--
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Zoom Action',200144,'D','8ba56d3a-1fff-4e6c-b1a6-34cbe8a50071','ZoomLabel','Y',TO_DATE('2013-02-13 19:08:01','YYYY-MM-DD HH24:MI:SS'),0,0,0,0,TO_DATE('2013-02-13 19:08:01','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Feb 13, 2013 7:08:02 PM COT
|
||||
--
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200144 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Feb 13, 2013 7:25:37 PM COT
|
||||
--
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Setup Task:',200145,'D','ed196c88-09f4-40a7-8959-e6747b890420','Setup Task','Y',TO_DATE('2013-02-13 19:25:37','YYYY-MM-DD HH24:MI:SS'),0,0,0,0,TO_DATE('2013-02-13 19:25:37','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Feb 13, 2013 7:25:37 PM COT
|
||||
--
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200145 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Feb 13, 2013 7:28:34 PM COT
|
||||
--
|
||||
UPDATE AD_Message SET Value='SetupTask',Updated=TO_DATE('2013-02-13 19:28:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Message_ID=200145
|
||||
;
|
||||
|
||||
SELECT register_migration_script('201302190934_IDEMPIERE-393.sql') FROM dual
|
||||
;
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
DROP INDEX ad_impformat_name
|
||||
;
|
||||
|
||||
CREATE UNIQUE INDEX ad_impformat_name
|
||||
ON ad_impformat (ad_client_id, name)
|
||||
;
|
||||
SELECT register_migration_script('201303010917_IDEMPIERE-671.sql') FROM dual
|
||||
;
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
-- Feb 13, 2013 7:08:02 PM COT
|
||||
--
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Zoom Action',200144,'D','8ba56d3a-1fff-4e6c-b1a6-34cbe8a50071','ZoomLabel','Y',TO_TIMESTAMP('2013-02-13 19:08:01','YYYY-MM-DD HH24:MI:SS'),0,0,0,0,TO_TIMESTAMP('2013-02-13 19:08:01','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Feb 13, 2013 7:08:02 PM COT
|
||||
--
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200144 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Feb 13, 2013 7:25:37 PM COT
|
||||
--
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Setup Task:',200145,'D','ed196c88-09f4-40a7-8959-e6747b890420','Setup Task','Y',TO_TIMESTAMP('2013-02-13 19:25:37','YYYY-MM-DD HH24:MI:SS'),0,0,0,0,TO_TIMESTAMP('2013-02-13 19:25:37','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Feb 13, 2013 7:25:37 PM COT
|
||||
--
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200145 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Feb 13, 2013 7:28:34 PM COT
|
||||
--
|
||||
UPDATE AD_Message SET Value='SetupTask',Updated=TO_TIMESTAMP('2013-02-13 19:28:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Message_ID=200145
|
||||
;
|
||||
|
||||
SELECT register_migration_script('201302190934_IDEMPIERE-393.sql') FROM dual
|
||||
;
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
DROP INDEX ad_impformat_name
|
||||
;
|
||||
|
||||
CREATE UNIQUE INDEX ad_impformat_name
|
||||
ON ad_impformat (ad_client_id, name)
|
||||
;
|
||||
SELECT register_migration_script('201303010917_IDEMPIERE-671.sql') FROM dual
|
||||
;
|
||||
|
|
@ -150,14 +150,7 @@ public final class ImpFormat
|
|||
m_tableUniqueParent = "";
|
||||
m_tableUniqueChild = "";
|
||||
|
||||
if (m_AD_Table_ID == 311) // I_061_SyncItem
|
||||
{
|
||||
m_tableUnique1 = "H_UPC"; // UPC = unique
|
||||
m_tableUnique2 = "Value";
|
||||
m_tableUniqueChild = "H_Commodity1"; // Vendor No may not be unique !
|
||||
m_tableUniqueParent = "H_PartnrID"; // Makes it unique
|
||||
}
|
||||
else if (m_AD_Table_ID == TABLE_I_PRODUCT) // I_Product
|
||||
if (m_AD_Table_ID == TABLE_I_PRODUCT) // I_Product
|
||||
{
|
||||
m_tableUnique1 = "UPC"; // UPC = unique
|
||||
m_tableUnique2 = "Value";
|
||||
|
@ -266,26 +259,24 @@ public final class ImpFormat
|
|||
|
||||
/*************************************************************************
|
||||
* Factory load
|
||||
* @param name name
|
||||
* @param Id id
|
||||
* @return Import Format
|
||||
*/
|
||||
public static ImpFormat load (String name)
|
||||
public static ImpFormat load (int Id)
|
||||
{
|
||||
log.config(name);
|
||||
if (log.isLoggable(Level.CONFIG))log.config(String.valueOf(Id));
|
||||
ImpFormat retValue = null;
|
||||
String sql = "SELECT * FROM AD_ImpFormat WHERE Name=?";
|
||||
int ID = 0;
|
||||
String sql = "SELECT * FROM AD_ImpFormat WHERE AD_Impformat_ID=?";
|
||||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
try
|
||||
{
|
||||
pstmt = DB.prepareStatement(sql, null);
|
||||
pstmt.setString (1, name);
|
||||
pstmt.setInt (1, Id);
|
||||
rs = pstmt.executeQuery();
|
||||
if (rs.next())
|
||||
{
|
||||
retValue = new ImpFormat (name, rs.getInt("AD_Table_ID"), rs.getString("FormatType"));
|
||||
ID = rs.getInt ("AD_ImpFormat_ID");
|
||||
retValue = new ImpFormat (rs.getString("Name"), rs.getInt("AD_Table_ID"), rs.getString("FormatType"));
|
||||
if (X_AD_ImpFormat.FORMATTYPE_CustomSeparatorChar.equals(rs.getString(I_AD_ImpFormat.COLUMNNAME_FormatType))) {
|
||||
retValue.setSeparatorChar(rs.getString(I_AD_ImpFormat.COLUMNNAME_SeparatorChar));
|
||||
}
|
||||
|
@ -302,7 +293,7 @@ public final class ImpFormat
|
|||
rs = null;
|
||||
pstmt = null;
|
||||
}
|
||||
loadRows (retValue, ID);
|
||||
loadRows (retValue, Id);
|
||||
return retValue;
|
||||
} // getFormat
|
||||
|
||||
|
|
|
@ -170,11 +170,22 @@ public class MRecentItem extends X_AD_RecentItem
|
|||
ri.setAD_Table_ID(AD_Table_ID);
|
||||
ri.setRecord_ID(Record_ID);
|
||||
ri.setAD_User_ID(AD_User_ID);
|
||||
}
|
||||
ri.setAD_Role_ID(AD_Role_ID);
|
||||
ri.setAD_Window_ID(AD_Window_ID);
|
||||
ri.setAD_Tab_ID(AD_Tab_ID);
|
||||
ri.saveEx();
|
||||
} else {
|
||||
if ( ri.getAD_Role_ID() != AD_Role_ID
|
||||
|| ri.getAD_Window_ID() != AD_Window_ID
|
||||
|| ri.getAD_Tab_ID() != AD_Tab_ID) {
|
||||
ri.setAD_Role_ID(AD_Role_ID);
|
||||
ri.setAD_Window_ID(AD_Window_ID);
|
||||
ri.setAD_Tab_ID(AD_Tab_ID);
|
||||
ri.saveEx();
|
||||
} else {
|
||||
DB.executeUpdateEx("UPDATE AD_RecentItem SET Updated=SYSDATE WHERE AD_RecentItem_ID=?", new Object[] {ri.getAD_RecentItem_ID()}, null);
|
||||
}
|
||||
}
|
||||
publishChangedEvent(AD_User_ID);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ import org.adempiere.base.IDictionaryService;
|
|||
import org.adempiere.base.Service;
|
||||
import org.compiere.model.Query;
|
||||
import org.compiere.model.X_AD_Package_Imp;
|
||||
import org.compiere.util.AdempiereSystemError;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.Trx;
|
||||
import org.osgi.framework.BundleActivator;
|
||||
|
@ -97,6 +98,8 @@ public class AdempiereActivator implements BundleActivator {
|
|||
IDictionaryService service = Service.locator().locate(IDictionaryService.class).getService();
|
||||
FileOutputStream zipstream = null;
|
||||
try {
|
||||
if (service == null)
|
||||
throw new AdempiereSystemError("Could not find/load OSGi service for packin");
|
||||
// copy the resource to a temporary file to process it with 2pack
|
||||
InputStream stream = context.getBundle().getEntry("/META-INF/2Pack.zip").openStream();
|
||||
File zipfile = File.createTempFile(getName(), ".zip");
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -56,6 +56,7 @@ import org.compiere.util.CLogger;
|
|||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.Ini;
|
||||
import org.compiere.util.KeyNamePair;
|
||||
import org.compiere.util.Msg;
|
||||
|
||||
|
||||
|
@ -205,8 +206,8 @@ public class VFileImport extends CPanel
|
|||
private void dynInit()
|
||||
{
|
||||
// Load Formats
|
||||
pickFormat.addItem(s_none);
|
||||
String sql = MRole.getDefault().addAccessSQL("SELECT Name FROM AD_ImpFormat", "AD_ImpFormat",
|
||||
pickFormat.addItem(new KeyNamePair(-1,s_none));
|
||||
String sql = MRole.getDefault().addAccessSQL("SELECT AD_Impformat_ID,Name FROM AD_ImpFormat WHERE isactive='Y'", "AD_ImpFormat",
|
||||
MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO);
|
||||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
|
@ -215,7 +216,7 @@ public class VFileImport extends CPanel
|
|||
pstmt = DB.prepareStatement(sql, null);
|
||||
rs = pstmt.executeQuery();
|
||||
while (rs.next())
|
||||
pickFormat.addItem(rs.getString(1));
|
||||
pickFormat.addItem(new KeyNamePair(rs.getInt(1),rs.getString(2)));
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
|
@ -373,13 +374,13 @@ public class VFileImport extends CPanel
|
|||
// clear panel
|
||||
previewPanel.removeAll();
|
||||
//
|
||||
String formatName = pickFormat.getSelectedItem().toString();
|
||||
if (formatName.equals(s_none))
|
||||
KeyNamePair pickFormatKNPair = (KeyNamePair)pickFormat.getSelectedItem();
|
||||
if (pickFormatKNPair.getName().equals(s_none))
|
||||
return;
|
||||
m_format = ImpFormat.load (formatName);
|
||||
m_format = ImpFormat.load (pickFormatKNPair.getKey());
|
||||
if (m_format == null)
|
||||
{
|
||||
ADialog.error(m_WindowNo, this, "FileImportNoFormat", formatName);
|
||||
ADialog.error(m_WindowNo, this, "FileImportNoFormat", pickFormatKNPair.getName());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -158,6 +158,7 @@ public class WArchive implements EventListener<Event>
|
|||
ADForm form = ADForm.openForm(AD_Form_ID);
|
||||
|
||||
WArchiveViewer av = (WArchiveViewer) form.getICustomForm();
|
||||
av.setShowQuery(false);
|
||||
if (e.getTarget() == m_documents)
|
||||
av.query(false, m_AD_Table_ID, m_Record_ID);
|
||||
else if (e.getTarget() == m_reports)
|
||||
|
|
|
@ -59,6 +59,7 @@ import org.compiere.util.Env;
|
|||
import org.compiere.util.KeyNamePair;
|
||||
import org.compiere.util.Msg;
|
||||
import org.zkoss.util.media.AMedia;
|
||||
import org.zkoss.zk.ui.Page;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zk.ui.event.Events;
|
||||
|
@ -122,13 +123,20 @@ public class WArchiveViewer extends Archive implements IFormController, EventLis
|
|||
|
||||
private Iframe iframe = new Iframe();
|
||||
private Button bRefresh = new Button();
|
||||
private boolean showQuery = true;
|
||||
|
||||
public WArchiveViewer()
|
||||
{
|
||||
log.info("");
|
||||
|
||||
try
|
||||
{
|
||||
form = new CustomForm() {
|
||||
private static final long serialVersionUID = 7226661630651936293L;
|
||||
|
||||
@Override
|
||||
public void onPageAttached(Page newpage, Page oldpage) {
|
||||
super.onPageAttached(newpage, oldpage);
|
||||
if (newpage != null)
|
||||
try {
|
||||
dynInit();
|
||||
jbInit();
|
||||
}
|
||||
|
@ -136,6 +144,10 @@ public class WArchiveViewer extends Archive implements IFormController, EventLis
|
|||
{
|
||||
log.log(Level.SEVERE, "init", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -221,23 +233,28 @@ public class WArchiveViewer extends Archive implements IFormController, EventLis
|
|||
reportField.setLabel(Msg.translate(Env.getCtx(), "IsReport"));
|
||||
reportField.addEventListener(Events.ON_CHECK, this);
|
||||
|
||||
Rows rows;
|
||||
Row row;
|
||||
Div div;
|
||||
|
||||
if(showQuery){
|
||||
Grid gridQuery = new Grid();
|
||||
gridQuery.setWidth("500px");
|
||||
gridQuery.setStyle("margin:0; padding:0;");
|
||||
gridQuery.makeNoStrip();
|
||||
gridQuery.setOddRowSclass("even");
|
||||
|
||||
Rows rows = new Rows();
|
||||
rows = new Rows();
|
||||
gridQuery.appendChild(rows);
|
||||
|
||||
Row row = new Row();
|
||||
row = new Row();
|
||||
rows.appendChild(row);
|
||||
row.setAlign("right");
|
||||
row.appendCellChild(reportField, 3);
|
||||
|
||||
row = new Row();
|
||||
rows.appendChild(row);
|
||||
Div div = new Div();
|
||||
div = new Div();
|
||||
div.setStyle("text-align: right;");
|
||||
div.appendChild(processLabel);
|
||||
row.appendCellChild(div, 1);
|
||||
|
@ -317,7 +334,7 @@ public class WArchiveViewer extends Archive implements IFormController, EventLis
|
|||
|
||||
tabpanels.appendChild(tabQueryPanel);
|
||||
tabs.appendChild(tabQuery);
|
||||
|
||||
}
|
||||
Grid gridView = new Grid();
|
||||
gridView.setStyle("margin:0; padding:0;");
|
||||
gridView.makeNoStrip();
|
||||
|
@ -450,10 +467,10 @@ public class WArchiveViewer extends Archive implements IFormController, EventLis
|
|||
SessionManager.getAppDesktop().closeActiveWindow();
|
||||
else if (e.getTarget().getId().equals(ConfirmPanel.A_OK))
|
||||
{
|
||||
if (tabbox.getSelectedIndex() == 1)
|
||||
SessionManager.getAppDesktop().closeActiveWindow();
|
||||
else
|
||||
if (showQuery && tabbox.getSelectedIndex() == 0)
|
||||
cmd_query();
|
||||
else
|
||||
SessionManager.getAppDesktop().closeActiveWindow();
|
||||
}
|
||||
else if (e.getTarget() == reportField)
|
||||
updateQDisplay();
|
||||
|
@ -465,7 +482,7 @@ public class WArchiveViewer extends Archive implements IFormController, EventLis
|
|||
iframe.invalidate();
|
||||
else if (e.getTarget() instanceof Tab)
|
||||
{
|
||||
if(tabbox.getSelectedIndex() == 1)
|
||||
if(tabbox.getSelectedIndex() == (showQuery ? 1 : 0))
|
||||
iframe.invalidate();
|
||||
}
|
||||
|
||||
|
@ -504,6 +521,7 @@ public class WArchiveViewer extends Archive implements IFormController, EventLis
|
|||
MArchive ar = m_archives[m_index];
|
||||
ar.delete(true);
|
||||
tabbox.setSelectedIndex(0);
|
||||
cmd_query();
|
||||
dynInit();
|
||||
}
|
||||
}
|
||||
|
@ -639,51 +657,68 @@ public class WArchiveViewer extends Archive implements IFormController, EventLis
|
|||
{
|
||||
boolean reports = reportField.isChecked();
|
||||
|
||||
ListItem listitem = processField.getSelectedItem();
|
||||
KeyNamePair process = null;
|
||||
Integer C_BPartner_ID = null;
|
||||
String name = null;
|
||||
String description = null;
|
||||
String help = null;
|
||||
KeyNamePair table = null;
|
||||
KeyNamePair createdBy = null;
|
||||
Timestamp createdFrom = null;
|
||||
Timestamp createdTo = null;
|
||||
|
||||
if (showQuery) {
|
||||
ListItem listitem = processField.getSelectedItem();
|
||||
process = null;
|
||||
if (listitem != null)
|
||||
process = (KeyNamePair)listitem.getValue();
|
||||
|
||||
listitem = tableField.getSelectedItem();
|
||||
KeyNamePair table = null;
|
||||
table = null;
|
||||
if (listitem != null)
|
||||
table = (KeyNamePair)listitem.getValue();
|
||||
|
||||
Integer C_BPartner_ID = (Integer)bPartnerField.getValue();
|
||||
String name = nameQField.getText();
|
||||
String description = descriptionQField.getText();
|
||||
String help = helpQField.getText();
|
||||
C_BPartner_ID = (Integer)bPartnerField.getValue();
|
||||
name = nameQField.getText();
|
||||
description = descriptionQField.getText();
|
||||
help = helpQField.getText();
|
||||
|
||||
listitem = createdByQField.getSelectedItem();
|
||||
KeyNamePair createdBy = null;
|
||||
createdBy = null;
|
||||
if (listitem != null)
|
||||
createdBy = (KeyNamePair)listitem.getValue();
|
||||
|
||||
Date date = null;
|
||||
Timestamp createdFrom = null;
|
||||
createdFrom = null;
|
||||
if (createdQFrom.getValue() != null)
|
||||
{
|
||||
date = createdQFrom.getValue();
|
||||
createdFrom = new Timestamp(date.getTime());
|
||||
}
|
||||
|
||||
Timestamp createdTo = null;
|
||||
createdTo = null;
|
||||
if (createdQTo.getValue() != null)
|
||||
{
|
||||
date = createdQTo.getValue();
|
||||
createdTo = new Timestamp(date.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
cmd_query(reports, process, table, C_BPartner_ID, name, description, help,
|
||||
createdBy, createdFrom, createdTo);
|
||||
|
||||
// Display
|
||||
tabbox.setSelectedIndex(1);
|
||||
|
||||
m_index = 1;
|
||||
if (showQuery)
|
||||
tabbox.setSelectedIndex(1);
|
||||
|
||||
updateVDisplay(false);
|
||||
} // cmd_query
|
||||
|
||||
public void setShowQuery(boolean showQuery) {
|
||||
this.showQuery = showQuery;
|
||||
}
|
||||
|
||||
public ADForm getForm() {
|
||||
return form;
|
||||
}
|
||||
|
|
|
@ -233,7 +233,7 @@ public class WFileImport extends ADForm implements EventListener<Event>
|
|||
// Load Formats
|
||||
pickFormat.appendItem(s_none, s_none);
|
||||
|
||||
String sql = MRole.getDefault().addAccessSQL("SELECT Name FROM AD_ImpFormat", "AD_ImpFormat",
|
||||
String sql = MRole.getDefault().addAccessSQL("SELECT Name,AD_Impformat_ID FROM AD_ImpFormat WHERE isactive='Y'", "AD_ImpFormat",
|
||||
MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO);
|
||||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
|
@ -243,7 +243,7 @@ public class WFileImport extends ADForm implements EventListener<Event>
|
|||
rs = pstmt.executeQuery();
|
||||
|
||||
while (rs.next())
|
||||
pickFormat.appendItem(rs.getString(1), rs.getString(1));
|
||||
pickFormat.appendItem(rs.getString(1), rs.getInt(2));
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
|
@ -451,12 +451,13 @@ public class WFileImport extends ADForm implements EventListener<Event>
|
|||
|
||||
ListItem listitem = pickFormat.getSelectedItem();
|
||||
|
||||
String formatName = (String)listitem.getValue();
|
||||
String formatName = (String)listitem.getLabel();
|
||||
|
||||
if (formatName.equals(s_none))
|
||||
return;
|
||||
|
||||
m_format = ImpFormat.load (formatName);
|
||||
int formatId = (Integer)listitem.getValue();
|
||||
m_format = ImpFormat.load (formatId);
|
||||
|
||||
if (m_format == null)
|
||||
{
|
||||
|
|
|
@ -27,11 +27,8 @@ import org.adempiere.webui.LayoutUtils;
|
|||
import org.adempiere.webui.apps.AEnv;
|
||||
import org.adempiere.webui.component.Button;
|
||||
import org.adempiere.webui.component.Checkbox;
|
||||
import org.adempiere.webui.component.Grid;
|
||||
import org.adempiere.webui.component.Label;
|
||||
import org.adempiere.webui.component.Panel;
|
||||
import org.adempiere.webui.component.Row;
|
||||
import org.adempiere.webui.component.Rows;
|
||||
import org.adempiere.webui.component.Textbox;
|
||||
import org.adempiere.webui.component.Window;
|
||||
import org.adempiere.webui.editor.WSearchEditor;
|
||||
|
@ -54,11 +51,13 @@ import org.zkoss.zk.ui.event.Event;
|
|||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zk.ui.event.Events;
|
||||
import org.zkoss.zul.Borderlayout;
|
||||
import org.zkoss.zul.Center;
|
||||
import org.zkoss.zul.Div;
|
||||
import org.zkoss.zul.East;
|
||||
import org.zkoss.zul.Iframe;
|
||||
import org.zkoss.zul.North;
|
||||
import org.zkoss.zul.Progressmeter;
|
||||
import org.zkoss.zul.Separator;
|
||||
import org.zkoss.zul.Space;
|
||||
import org.zkoss.zul.Tree;
|
||||
import org.zkoss.zul.Treecell;
|
||||
|
@ -66,8 +65,6 @@ import org.zkoss.zul.Treechildren;
|
|||
import org.zkoss.zul.Treeitem;
|
||||
import org.zkoss.zul.Treerow;
|
||||
import org.zkoss.zul.Vbox;
|
||||
import org.zkoss.zul.West;
|
||||
|
||||
/**
|
||||
* View for Setup Wizard
|
||||
*
|
||||
|
@ -86,6 +83,7 @@ public class WSetupWizard extends SetupWizard implements IFormController, EventL
|
|||
private Tree wfnodeTree;
|
||||
private Treeitem prevti = null;
|
||||
|
||||
private Label pretitleLabel = new Label(Msg.getMsg(Env.getCtx(), "SetupTask"));
|
||||
private Label titleLabel = new Label();
|
||||
private Iframe helpFrame = new Iframe();
|
||||
private Label notesLabel = new Label(Msg.getElement(Env.getCtx(), MWizardProcess.COLUMNNAME_Note));
|
||||
|
@ -97,6 +95,7 @@ public class WSetupWizard extends SetupWizard implements IFormController, EventL
|
|||
private Label statusLabel = new Label();
|
||||
private WTableDirEditor statusField;
|
||||
|
||||
private Label bZoomLabel = new Label(Msg.getMsg(Env.getCtx(), "ZoomLabel"));
|
||||
private Button bRefresh = new Button();
|
||||
private Button bOK = new Button();
|
||||
private Button bNext = new Button();
|
||||
|
@ -111,8 +110,9 @@ public class WSetupWizard extends SetupWizard implements IFormController, EventL
|
|||
private static final String WIZARD_LABEL_STYLE = "font-weight: bold";
|
||||
|
||||
private boolean expandTree = false;
|
||||
private Vbox east = new Vbox();
|
||||
private Vbox eastdown = new Vbox();
|
||||
private boolean allFinished = true;
|
||||
private Vbox centerBox = new Vbox();
|
||||
private Vbox centerBoxdown = new Vbox();
|
||||
private Vbox westdown = new Vbox();
|
||||
private ArrayList<Integer> openNodes = new ArrayList<Integer>();
|
||||
|
||||
|
@ -163,6 +163,7 @@ public class WSetupWizard extends SetupWizard implements IFormController, EventL
|
|||
|
||||
protected void addWfEntry(MWorkflow wfwizard) {
|
||||
/* TODO: Color of workflow according to wizard status */
|
||||
allFinished = true;
|
||||
Treechildren treeChildren = wfnodeTree.getTreechildren();
|
||||
Treeitem treeitemwf = new Treeitem();
|
||||
treeChildren.appendChild(treeitemwf);
|
||||
|
@ -185,6 +186,10 @@ public class WSetupWizard extends SetupWizard implements IFormController, EventL
|
|||
treeitemwf.setOpen(true);
|
||||
addNodes(wfwizard, treeitemwf);
|
||||
|
||||
if(allFinished && showColors.isChecked()){
|
||||
wizardLabel.setZclass("tree-wsetupwizard-finished-all");
|
||||
}
|
||||
|
||||
treeitemwf.setAttribute("AD_Workflow_ID", wfwizard.getAD_Workflow_ID());
|
||||
if (prevti != null && prevti.getAttribute("AD_Workflow_ID") != null) {
|
||||
if (prevti.getAttribute("AD_Workflow_ID").equals(treeitemwf.getAttribute("AD_Workflow_ID")))
|
||||
|
@ -206,12 +211,27 @@ public class WSetupWizard extends SetupWizard implements IFormController, EventL
|
|||
if (node != null && showColors.isChecked()) {
|
||||
MWizardProcess wp = MWizardProcess.get(Env.getCtx(), node.getAD_WF_Node_ID(), Env.getAD_Client_ID(Env.getCtx()));
|
||||
String status = wp.getWizardStatus();
|
||||
if ( MWizardProcess.WIZARDSTATUS_Finished.equals(status)
|
||||
|| MWizardProcess.WIZARDSTATUS_Skipped.equals(status)) {
|
||||
nodeLabel.setStyle("background-color: #90EE90;margin-left:20px;");
|
||||
if (MWizardProcess.WIZARDSTATUS_Finished.equals(status)){
|
||||
nodeLabel.setZclass("tree-wsetupwizard-finished");
|
||||
allFinished = allFinished && true;
|
||||
}else if (MWizardProcess.WIZARDSTATUS_Skipped.equals(status)) {
|
||||
nodeLabel.setZclass("tree-wsetupwizard-skipped");
|
||||
allFinished = allFinished && true;
|
||||
}else if (MWizardProcess.WIZARDSTATUS_Delayed.equals(status)) {
|
||||
nodeLabel.setZclass("tree-wsetupwizard-delayed");
|
||||
allFinished = allFinished && false;
|
||||
}else if (MWizardProcess.WIZARDSTATUS_In_Progress.equals(status)) {
|
||||
nodeLabel.setZclass("tree-wsetupwizard-in-progress");
|
||||
allFinished = allFinished && false;
|
||||
}else if (MWizardProcess.WIZARDSTATUS_Pending.equals(status)) {
|
||||
nodeLabel.setZclass("tree-wsetupwizard-pending");
|
||||
allFinished = allFinished && false;
|
||||
}else {
|
||||
nodeLabel.setStyle("background-color: #FFFF00;margin-left:20px;");
|
||||
nodeLabel.setZclass("tree-setupwizard-nostatus");
|
||||
allFinished = false;
|
||||
}
|
||||
}else{
|
||||
nodeLabel.setStyle("margin-left:20px;");
|
||||
}
|
||||
|
||||
Div div = new Div();
|
||||
|
@ -245,6 +265,7 @@ public class WSetupWizard extends SetupWizard implements IFormController, EventL
|
|||
* Static init
|
||||
* @throws Exception
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
private void jbInit () throws Exception
|
||||
{
|
||||
form.setWidth("99%");
|
||||
|
@ -279,12 +300,10 @@ public class WSetupWizard extends SetupWizard implements IFormController, EventL
|
|||
justmine.setTooltiptext(Msg.getMsg(Env.getCtx(), "JustMine"));
|
||||
justmine.addEventListener(Events.ON_CHECK,this);
|
||||
|
||||
|
||||
showColors.setLabel("Show Colors");
|
||||
showColors.setTooltiptext(Msg.getMsg(Env.getCtx(), "ShowColors"));
|
||||
showColors.addEventListener(Events.ON_CHECK,this);
|
||||
|
||||
|
||||
North north = new North();
|
||||
mainLayout.appendChild(north);
|
||||
north.appendChild(northPanel);
|
||||
|
@ -292,6 +311,7 @@ public class WSetupWizard extends SetupWizard implements IFormController, EventL
|
|||
//
|
||||
northPanel.appendChild(progressbar);
|
||||
progressbar.setWidth("100%");
|
||||
progressbar.setZclass("progressmeter-setupwizard");
|
||||
northPanel.appendChild(progressLabel);
|
||||
progressLabel.setWidth("100%");
|
||||
progressLabel.setStyle("margin:0; padding:0; position: absolute; align: center; valign: center; border:0; text-align: center; ");
|
||||
|
@ -304,62 +324,53 @@ public class WSetupWizard extends SetupWizard implements IFormController, EventL
|
|||
statusField = new WTableDirEditor("WizardStatus", true, false, true,wizardL);
|
||||
statusField.setValue(MWizardProcess.WIZARDSTATUS_Pending);
|
||||
|
||||
east.setVflex("1");
|
||||
east.setHflex("1");
|
||||
West west = new West();
|
||||
mainLayout.appendChild(west);
|
||||
west.appendChild(east);
|
||||
east.appendChild(wfnodeTree);
|
||||
centerBox.setVflex("1");
|
||||
centerBox.setHflex("1");
|
||||
Center center = new Center();
|
||||
mainLayout.appendChild(center);
|
||||
center.appendChild(centerBox);
|
||||
centerBox.appendChild(wfnodeTree);
|
||||
centerBox.setWidth("100%");
|
||||
wfnodeTree.setVflex("1");
|
||||
wfnodeTree.setHflex("1");
|
||||
east.appendChild(eastdown);
|
||||
eastdown.setOrient("horizontal");
|
||||
eastdown.appendChild(bExpand);
|
||||
eastdown.appendChild(justmine);
|
||||
eastdown.appendChild(showColors);
|
||||
west.setAutoscroll(true);
|
||||
west.setWidth("30%");
|
||||
centerBox.appendChild(centerBoxdown);
|
||||
centerBoxdown.setOrient("horizontal");
|
||||
centerBoxdown.appendChild(bExpand);
|
||||
centerBoxdown.appendChild(justmine);
|
||||
centerBoxdown.appendChild(showColors);
|
||||
center.setAutoscroll(true);
|
||||
|
||||
Grid gridView = new Grid();
|
||||
gridView.setStyle("margin:0; padding:0;");
|
||||
gridView.makeNoStrip();
|
||||
gridView.setOddRowSclass("even");
|
||||
Div div = new Div();
|
||||
div.setHeight("88%");
|
||||
div.setHflex("1");
|
||||
|
||||
Rows rows = new Rows();
|
||||
gridView.appendChild(rows);
|
||||
|
||||
Row row = new Row();
|
||||
rows.appendChild(row);
|
||||
row.setAlign("center");
|
||||
row.appendChild(titleLabel);
|
||||
div.setStyle("text-align:center ");
|
||||
pretitleLabel.setStyle("font-weight: bold; font-size: 14px");
|
||||
div.appendChild(titleLabel);
|
||||
titleLabel.setStyle("font-weight: bold; font-size: 14px");
|
||||
titleLabel.setLeft("50%");
|
||||
|
||||
row = new Row();
|
||||
rows.appendChild(row);
|
||||
row.appendChild(helpFrame);
|
||||
div.appendChild(helpFrame);
|
||||
helpFrame.setWidth("99%");
|
||||
helpFrame.setHeight("90%");
|
||||
helpFrame.setStyle("min-height:300px; border: 1px solid lightgray; margin:auto");
|
||||
helpFrame.setStyle("border: 1px solid lightgray; margin:auto");
|
||||
|
||||
row = new Row();
|
||||
rows.appendChild(row);
|
||||
row.appendChild(notesLabel);
|
||||
notesLabel.setWidth("100%");
|
||||
Div divNote = new Div();
|
||||
divNote.setStyle("text-align:left");
|
||||
Separator separator = new Separator();
|
||||
divNote.appendChild(separator);
|
||||
divNote.appendChild(notesLabel);
|
||||
|
||||
row = new Row();
|
||||
rows.appendChild(row);
|
||||
row.appendChild(notesField);
|
||||
divNote.appendChild(notesField);
|
||||
notesField.setRows(4);
|
||||
notesField.setWidth("100%");
|
||||
notesField.setWidth("99%");
|
||||
|
||||
MLookup lookup = MLookupFactory.get(Env.getCtx(), form.getWindowNo(),
|
||||
0, 200913, DisplayType.Search);
|
||||
userField = new WSearchEditor(lookup, Msg.translate(
|
||||
Env.getCtx(), "AD_User_ID"), "", false, false, true);
|
||||
|
||||
row = new Row();
|
||||
rows.appendChild(row);
|
||||
westdown.setOrient("horizontal");
|
||||
westdown.appendChild(bZoomLabel);
|
||||
westdown.appendChild(bZoom);
|
||||
westdown.appendChild(userLabel);
|
||||
westdown.appendChild(userField.getComponent());
|
||||
|
@ -370,17 +381,26 @@ public class WSetupWizard extends SetupWizard implements IFormController, EventL
|
|||
westdown.appendChild(bRefresh);
|
||||
westdown.appendChild(bOK);
|
||||
westdown.appendChild(bNext);
|
||||
row.appendChild(westdown);
|
||||
row.setAlign("right");
|
||||
Div divButton = new Div();
|
||||
divButton.setAlign("right");
|
||||
divButton.appendChild(westdown);
|
||||
|
||||
East east = new East();
|
||||
mainLayout.appendChild(east);
|
||||
east.appendChild(gridView);
|
||||
east.setCollapsible(false);
|
||||
div.appendChild(divNote);
|
||||
div.appendChild(divButton);
|
||||
east.appendChild(div);
|
||||
east.setCollapsible(true);
|
||||
east.setSplittable(true);
|
||||
east.setWidth("70%");
|
||||
east.setAutoscroll(true);
|
||||
|
||||
setNotesPanelVisible(false);
|
||||
|
||||
MWorkflow wf = MWorkflow.get(Env.getCtx(), getWfWizards().get(0).get_ID());
|
||||
showInRightPanel(wf.getAD_Workflow_ID(), 0);
|
||||
|
||||
|
||||
} // jbInit
|
||||
|
||||
private void refreshProgress() {
|
||||
|
@ -396,7 +416,6 @@ public class WSetupWizard extends SetupWizard implements IFormController, EventL
|
|||
progressLabel.setText(msg);
|
||||
progressbar.setValue(percent);
|
||||
progressbar.setTooltiptext(msg);
|
||||
progressbar.setStyle("background: #BBC2DB;");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -419,6 +438,7 @@ public class WSetupWizard extends SetupWizard implements IFormController, EventL
|
|||
showInRightPanel(0, m_node.getAD_WF_Node_ID());
|
||||
} else if (e.getTarget() == bOK) {
|
||||
int userid = 0;
|
||||
allFinished=true;
|
||||
if (!userField.isNullOrEmpty())
|
||||
userid = (Integer)userField.getValue();
|
||||
if (save(notesField.getText(), (String) statusField.getValue(), userid))
|
||||
|
@ -438,14 +458,8 @@ public class WSetupWizard extends SetupWizard implements IFormController, EventL
|
|||
} // actionPerformed
|
||||
|
||||
private void showColors() {
|
||||
if (!showColors.isChecked()) {
|
||||
for (Treeitem nextItem : nextItems){
|
||||
Treeitem ti= nextItem;
|
||||
if (ti.getLevel() != 0) {
|
||||
ti.setStyle("background-color: #FFFFFF;");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (showColors.isChecked())
|
||||
allFinished = true;
|
||||
repaintTree();
|
||||
}
|
||||
|
||||
|
@ -496,10 +510,6 @@ public class WSetupWizard extends SetupWizard implements IFormController, EventL
|
|||
}
|
||||
|
||||
private void repaintTree() {
|
||||
east.removeChild(wfnodeTree);
|
||||
east.removeChild(eastdown);
|
||||
east.setVflex("1");
|
||||
east.setHflex("1");
|
||||
openNodes.removeAll(openNodes);
|
||||
for (Treeitem nextItem : nextItems) {
|
||||
if (nextItem.isOpen() && nextItem.getAttribute("AD_Workflow_ID") != null) {
|
||||
|
@ -509,8 +519,6 @@ public class WSetupWizard extends SetupWizard implements IFormController, EventL
|
|||
prevti = wfnodeTree.getSelectedItem();
|
||||
wfnodeTree.clear();
|
||||
loadWizardNodes();
|
||||
east.appendChild(wfnodeTree);
|
||||
east.appendChild(eastdown);
|
||||
refreshProgress();
|
||||
}
|
||||
|
||||
|
@ -580,7 +588,7 @@ public class WSetupWizard extends SetupWizard implements IFormController, EventL
|
|||
setNotesPanelVisible(false);
|
||||
m_node = null;
|
||||
}
|
||||
titleLabel.setText(title);
|
||||
titleLabel.setText(pretitleLabel.getValue() + title);
|
||||
if (help != null) {
|
||||
AMedia media = new AMedia("Help", "html", "text/html", help.getBytes());
|
||||
helpFrame.setContent(media);
|
||||
|
@ -600,6 +608,7 @@ public class WSetupWizard extends SetupWizard implements IFormController, EventL
|
|||
statusField.setVisible(visible);
|
||||
userLabel.setVisible(visible);
|
||||
userField.setVisible(visible);
|
||||
bZoomLabel.setVisible(visible);
|
||||
bZoom.setVisible(visible);
|
||||
}
|
||||
|
||||
|
|
|
@ -1220,6 +1220,57 @@ tbody.z-grid-empty-body td {
|
|||
font-weight: normal;
|
||||
}
|
||||
|
||||
<%-- Tree nodes configurable on Setup Wizard --%>
|
||||
.tree-wsetupwizard-finished {
|
||||
background-color: #90EE90;
|
||||
margin-left:20px
|
||||
}
|
||||
|
||||
.tree-wsetupwizard-skipped {
|
||||
background-color: #00FF00;
|
||||
margin-left:20px
|
||||
}
|
||||
|
||||
.tree-wsetupwizard-delayed {
|
||||
background-color: #0080FF;
|
||||
margin-left:20px;
|
||||
}
|
||||
|
||||
.tree-wsetupwizard-in-progress {
|
||||
background-color: #FFFF33;
|
||||
margin-left:20px;
|
||||
}
|
||||
|
||||
.tree-wsetupwizard-pending {
|
||||
background-color: #FFFF00;
|
||||
margin-left:20px;
|
||||
}
|
||||
|
||||
.tree-setupwizard-nostatus{
|
||||
margin-left:20px;
|
||||
}
|
||||
|
||||
.tree-wsetupwizard-finished-all {
|
||||
background-color: #90EE90;
|
||||
}
|
||||
|
||||
.progressmeter-setupwizard {
|
||||
background: #FFFF00 repeat-x 0 0 ;
|
||||
background-image: none;
|
||||
border: 1px solid #CFCFCF;
|
||||
text-align: left;
|
||||
height: 20px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.progressmeter-setupwizard-img {
|
||||
display: inline-block;
|
||||
background: #90EE90;
|
||||
background-image: none;
|
||||
height: 20px;
|
||||
line-height: 0;
|
||||
font-size: 0;
|
||||
}
|
||||
.
|
||||
.menu-search-toggle-box {
|
||||
display: inline-block;
|
||||
border: 1px solid #ababab;
|
||||
|
|
Loading…
Reference in New Issue