Merged release-1.0c into development
This commit is contained in:
commit
542eba5a98
|
@ -0,0 +1,11 @@
|
|||
SET SQLBLANKLINES ON
|
||||
SET DEFINE OFF
|
||||
|
||||
-- Sep 9, 2013 4:25:23 PM COT
|
||||
-- IDEMPIERE-1345 Allow Translation Export from webui
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Org_ID,Created,AD_Client_ID) VALUES ('I','Export ZIP',200230,'D','d68b4fb8-d613-47a5-879b-c54aa9d3c415','ExportZIP','Y',TO_DATE('2013-09-09 16:25:22','YYYY-MM-DD HH24:MI:SS'),100,100,0,TO_DATE('2013-09-09 16:25:22','YYYY-MM-DD HH24:MI:SS'),0)
|
||||
;
|
||||
|
||||
SELECT register_migration_script('201309091625_IDEMPIERE-1345.sql') FROM dual
|
||||
;
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
-- Aug 28, 2013 5:35:23 PM COT
|
||||
-- IDEMPIERE-1304 Document allow to select price list without version
|
||||
UPDATE AD_Val_Rule SET Code='M_PriceList.IsSOPriceList = ''@IsSOTrx@'' AND (SELECT COUNT(*) FROM M_PriceList_Version WHERE M_PriceList.M_PriceList_ID=M_PriceList_Version.M_PriceList_ID AND M_PriceList_Version.IsActive=''Y'')>0',Updated=TO_DATE('2013-08-28 17:35:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=271
|
||||
;
|
||||
|
||||
-- Aug 29, 2013 9:45:47 AM COT
|
||||
-- IDEMPIERE-1304 Document allow to select price list without version
|
||||
UPDATE AD_Column SET AD_Val_Rule_ID=271,Updated=TO_DATE('2013-08-29 09:45:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3789
|
||||
;
|
||||
|
||||
SELECT register_migration_script('201309100739_IDEMPIERE-1304.sql') FROM dual
|
||||
;
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
-- Sep 9, 2013 4:25:23 PM COT
|
||||
-- IDEMPIERE-1345 Allow Translation Export from webui
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Org_ID,Created,AD_Client_ID) VALUES ('I','Export ZIP',200230,'D','d68b4fb8-d613-47a5-879b-c54aa9d3c415','ExportZIP','Y',TO_TIMESTAMP('2013-09-09 16:25:22','YYYY-MM-DD HH24:MI:SS'),100,100,0,TO_TIMESTAMP('2013-09-09 16:25:22','YYYY-MM-DD HH24:MI:SS'),0)
|
||||
;
|
||||
|
||||
SELECT register_migration_script('201309091625_IDEMPIERE-1345.sql') FROM dual
|
||||
;
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
-- Aug 28, 2013 5:35:23 PM COT
|
||||
-- IDEMPIERE-1304 Document allow to select price list without version
|
||||
UPDATE AD_Val_Rule SET Code='M_PriceList.IsSOPriceList = ''@IsSOTrx@'' AND (SELECT COUNT(*) FROM M_PriceList_Version WHERE M_PriceList.M_PriceList_ID=M_PriceList_Version.M_PriceList_ID AND M_PriceList_Version.IsActive=''Y'')>0',Updated=TO_TIMESTAMP('2013-08-28 17:35:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=271
|
||||
;
|
||||
|
||||
-- Aug 29, 2013 9:45:47 AM COT
|
||||
-- IDEMPIERE-1304 Document allow to select price list without version
|
||||
UPDATE AD_Column SET AD_Val_Rule_ID=271,Updated=TO_TIMESTAMP('2013-08-29 09:45:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3789
|
||||
;
|
||||
|
||||
SELECT register_migration_script('201309100739_IDEMPIERE-1304.sql') FROM dual
|
||||
;
|
||||
|
|
@ -170,7 +170,7 @@ import org.compiere.util.Env;
|
|||
updateHeader();
|
||||
if (getC_Payment_ID() != 0 )
|
||||
{
|
||||
String sql = "UPDATE C_Payment p SET C_DepositBatch_ID= 0 WHERE p.C_Payment_ID=?";
|
||||
String sql = "UPDATE C_Payment p SET C_DepositBatch_ID= Null WHERE p.C_Payment_ID=?";
|
||||
DB.executeUpdateEx(sql, new Object[] {getC_Payment_ID()}, get_TrxName());
|
||||
}
|
||||
|
||||
|
|
|
@ -524,6 +524,8 @@ public class GLJournalGenerate extends SvrProcess
|
|||
if (j != null) {
|
||||
StringBuilder msg = new StringBuilder(Msg.parseTranslation(getCtx(), "@Created@ @GL_Journal_ID@=")).append(j.getDocumentNo());
|
||||
addLog(j.get_ID(), null, null, msg.toString(), MJournal.Table_ID, j.get_ID());
|
||||
}else{
|
||||
return "0 @GL_Journal_ID@ @Created@";
|
||||
}
|
||||
|
||||
return "@OK@";
|
||||
|
|
|
@ -51,7 +51,6 @@ public class ColumnElementHandler extends AbstractElementHandler {
|
|||
|
||||
public void startElement(PIPOContext ctx, Element element)
|
||||
throws SAXException {
|
||||
int success = 0;
|
||||
String entitytype = getStringValue(element, "EntityType");
|
||||
if (isProcessElement(ctx.ctx, entitytype)) {
|
||||
if (isParentDefer(element, I_AD_Table.Table_Name)) {
|
||||
|
@ -78,8 +77,13 @@ public class ColumnElementHandler extends AbstractElementHandler {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!mColumn.is_new() && !mColumn.is_Changed())
|
||||
if (!mColumn.is_new() && !mColumn.is_Changed()) {
|
||||
boolean syncDatabase = "Y".equalsIgnoreCase(getStringValue(element, "IsSyncDatabase"));
|
||||
if (syncDatabase) {
|
||||
syncColumn(ctx, mColumn, "Sync", false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
X_AD_Package_Imp_Detail impDetail = createImportDetail(ctx, element.qName, X_AD_Column.Table_Name, X_AD_Column.Table_ID);
|
||||
String action = null;
|
||||
|
@ -156,26 +160,32 @@ public class ColumnElementHandler extends AbstractElementHandler {
|
|||
}
|
||||
|
||||
if (recreateColumn || syncDatabase) {
|
||||
MTable table = new MTable(ctx.ctx, mColumn.getAD_Table_ID(), getTrxName(ctx));
|
||||
if (!table.isView() && !mColumn.isVirtualColumn()) {
|
||||
success = createColumn(ctx, table, mColumn, recreateColumn);
|
||||
|
||||
X_AD_Package_Imp_Detail dbDetail = createImportDetail(ctx, "dbColumn", X_AD_Column.Table_Name, X_AD_Column.Table_ID);
|
||||
if (success == 1) {
|
||||
logImportDetail(ctx, dbDetail, 1, mColumn.getColumnName(),
|
||||
mColumn.get_ID(), action);
|
||||
} else {
|
||||
logImportDetail(ctx, dbDetail, 0, mColumn.getColumnName(),
|
||||
mColumn.get_ID(), action);
|
||||
throw new DatabaseAccessException("Failed to create column or related constraint for " + mColumn.getColumnName());
|
||||
}
|
||||
}
|
||||
syncColumn(ctx, mColumn, action, recreateColumn);
|
||||
}
|
||||
} else {
|
||||
element.skip = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void syncColumn(PIPOContext ctx, MColumn mColumn, String action,
|
||||
boolean recreateColumn) throws SAXException {
|
||||
int success = 0;
|
||||
MTable table = new MTable(ctx.ctx, mColumn.getAD_Table_ID(), getTrxName(ctx));
|
||||
if (!table.isView() && !mColumn.isVirtualColumn()) {
|
||||
success = createColumn(ctx, table, mColumn, recreateColumn);
|
||||
|
||||
X_AD_Package_Imp_Detail dbDetail = createImportDetail(ctx, "dbColumn", X_AD_Column.Table_Name, X_AD_Column.Table_ID);
|
||||
if (success == 1) {
|
||||
logImportDetail(ctx, dbDetail, 1, mColumn.getColumnName(),
|
||||
mColumn.get_ID(), action);
|
||||
} else {
|
||||
logImportDetail(ctx, dbDetail, 0, mColumn.getColumnName(),
|
||||
mColumn.get_ID(), action);
|
||||
throw new DatabaseAccessException("Failed to create column or related constraint for " + mColumn.getColumnName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if column exists in database and modify. If not create column.
|
||||
*
|
||||
|
|
|
@ -16,6 +16,7 @@ import org.adempiere.pipo2.ElementHandler;
|
|||
import org.adempiere.pipo2.PIPOContext;
|
||||
import org.adempiere.pipo2.PackOut;
|
||||
import org.adempiere.pipo2.PoExporter;
|
||||
import org.compiere.model.MLanguage;
|
||||
import org.compiere.model.MTable;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
|
@ -52,6 +53,10 @@ public class CommonTranslationHandler extends AbstractElementHandler implements
|
|||
throw new SAXException();
|
||||
|
||||
String language = getStringValue(element, "AD_Language");
|
||||
MLanguage lang = MLanguage.get(ctx.ctx, language);
|
||||
// skip if not system installed language
|
||||
if (! lang.isSystemLanguage())
|
||||
return;
|
||||
|
||||
if (log.isLoggable(Level.INFO)) log.info(elementValue+" "+getStringValue(element, "Name"));
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@ import java.util.logging.Level;
|
|||
import org.adempiere.base.IDictionaryService;
|
||||
import org.adempiere.pipo2.PackIn;
|
||||
import org.adempiere.pipo2.Zipper;
|
||||
import org.compiere.Adempiere;
|
||||
import org.compiere.model.X_AD_Package_Imp_Proc;
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.Env;
|
||||
|
@ -30,7 +29,7 @@ public class PipoDictionaryService implements IDictionaryService {
|
|||
packIn.setPackageName(context.getBundle().getSymbolicName());
|
||||
packIn.setPackageVersion((String) context.getBundle().getHeaders().get("Bundle-Version"));
|
||||
packIn.setUpdateDictionary(false);
|
||||
packIn.setPackageDirectory(getPackageDir());
|
||||
// packIn.setPackageDirectory(getPackageDir());
|
||||
|
||||
X_AD_Package_Imp_Proc adPackageImp = new X_AD_Package_Imp_Proc(Env.getCtx(),
|
||||
0, trxName);
|
||||
|
@ -42,6 +41,8 @@ public class PipoDictionaryService implements IDictionaryService {
|
|||
|
||||
String dict_file = targetDir + File.separator + parentDir + File.separator
|
||||
+ "dict" + File.separator + "PackOut.xml";
|
||||
|
||||
packIn.setPackageDirectory(targetDir + File.separator + parentDir);
|
||||
|
||||
if (logger.isLoggable(Level.INFO)) logger.info("dict file->" + dict_file);
|
||||
|
||||
|
@ -64,6 +65,7 @@ public class PipoDictionaryService implements IDictionaryService {
|
|||
|
||||
}
|
||||
|
||||
/*
|
||||
private String getPackageDir() {
|
||||
|
||||
// Create Target directory if required
|
||||
|
@ -79,6 +81,6 @@ public class PipoDictionaryService implements IDictionaryService {
|
|||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
|
|
@ -306,11 +306,14 @@ public abstract class AbstractElementHandler implements ElementHandler {
|
|||
* @return string value
|
||||
*/
|
||||
protected String getStringValue(Element element, String qName, List<String> excludes) {
|
||||
String name = qName;
|
||||
String s = element.properties.get(qName).contents.toString();
|
||||
if (element == null) return null;
|
||||
if (qName == null) return null;
|
||||
Element propertyElement = element.properties.get(qName);
|
||||
if (propertyElement == null || propertyElement.contents == null) return null;
|
||||
String s = propertyElement.contents.toString();
|
||||
|
||||
if (s != null && s.trim().length() > 0 && excludes != null) {
|
||||
excludes.add(name);
|
||||
excludes.add(qName);
|
||||
}
|
||||
return ((s == null || s.trim().length() == 0) ? null : s.trim());
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import org.adempiere.exceptions.AdempiereException;
|
||||
import org.compiere.model.MColumn;
|
||||
import org.compiere.model.MTable;
|
||||
import org.compiere.model.PO;
|
||||
import org.compiere.model.POInfo;
|
||||
|
@ -161,7 +162,14 @@ public class PoFiller{
|
|||
po.set_ValueNoCheck(columnName, id);
|
||||
}
|
||||
return id;
|
||||
}
|
||||
} else if (id == 0) {
|
||||
MColumn col = MColumn.get(ctx.ctx, po.get_TableName(), columnName);
|
||||
String refTableName = col.getReferenceTableName();
|
||||
if (refTableName != null && MTable.isZeroIDTable(refTableName)) {
|
||||
po.set_ValueNoCheck(columnName, id);
|
||||
return id;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
} else {
|
||||
return 0;
|
||||
|
|
|
@ -11,6 +11,8 @@ Import-Package: javax.activation;version="1.1.1",
|
|||
org.apache.commons.codec.binary,
|
||||
org.apache.ecs,
|
||||
org.apache.ecs.xhtml,
|
||||
org.apache.tools.ant,
|
||||
org.apache.tools.ant.taskdefs,
|
||||
org.compiere.css,
|
||||
org.osgi.framework;version="1.5.0",
|
||||
org.osgi.service.event;version="1.3.0",
|
||||
|
|
|
@ -386,8 +386,13 @@ public final class AEnv
|
|||
zoomQuery.addRestriction(column, MQuery.EQUAL, value);
|
||||
zoomQuery.setRecordCount(1); // guess
|
||||
}
|
||||
int windowId = lookup.getZoom(zoomQuery);
|
||||
zoom(windowId, zoomQuery);
|
||||
if (value instanceof Integer && ((Integer) value).intValue() >= 0 && zoomQuery != null && zoomQuery.getZoomTableName() != null) {
|
||||
int tableId = MTable.getTable_ID(zoomQuery.getZoomTableName());
|
||||
zoom(tableId, ((Integer) value).intValue());
|
||||
} else {
|
||||
int windowId = lookup.getZoom(zoomQuery);
|
||||
zoom(windowId, zoomQuery);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -199,7 +199,7 @@ public class WAllocation extends Allocation
|
|||
row = rows.newRow();
|
||||
row.appendCellChild(bpartnerLabel.rightAlign());
|
||||
bpartnerSearch.getComponent().setHflex("true");
|
||||
row.appendCellChild(bpartnerSearch.getComponent(),1);
|
||||
row.appendCellChild(bpartnerSearch.getComponent(),2);
|
||||
row.appendCellChild(dateLabel.rightAlign());
|
||||
row.appendCellChild(dateField.getComponent());
|
||||
row.appendCellChild(organizationLabel.rightAlign());
|
||||
|
@ -211,16 +211,8 @@ public class WAllocation extends Allocation
|
|||
currencyPick.getComponent().setHflex("true");
|
||||
row.appendCellChild(currencyPick.getComponent(),1);
|
||||
row.appendCellChild(multiCurrency,2);
|
||||
row.appendCellChild(new Space(),1);
|
||||
row.appendCellChild(new Space(),1);
|
||||
|
||||
row = rows.newRow();
|
||||
row.appendCellChild(new Space());
|
||||
row.appendCellChild(autoWriteOff);
|
||||
row.appendCellChild(new Space());
|
||||
row.appendCellChild(new Space());
|
||||
row.appendCellChild(new Space());
|
||||
row.appendCellChild(new Space());
|
||||
row.appendCellChild(autoWriteOff,2);
|
||||
row.appendCellChild(new Space(),1);
|
||||
|
||||
South south = new South();
|
||||
south.setStyle("border: none");
|
||||
|
|
|
@ -27,7 +27,6 @@ import org.adempiere.base.event.IEventManager;
|
|||
import org.adempiere.base.event.IEventTopics;
|
||||
import org.adempiere.model.MBroadcastMessage;
|
||||
import org.adempiere.util.ServerContext;
|
||||
import org.adempiere.webui.LayoutUtils;
|
||||
import org.adempiere.webui.adwindow.ADWindow;
|
||||
import org.adempiere.webui.apps.AEnv;
|
||||
import org.adempiere.webui.apps.BusyDialog;
|
||||
|
@ -103,6 +102,8 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
|
|||
private static final String IMAGES_UPARROW_PNG = "images/collapse-header.png";
|
||||
|
||||
private static final String IMAGES_DOWNARROW_PNG = "images/expand-header.png";
|
||||
|
||||
private static final String IMAGES_CONTEXT_HELP_PNG = "images/Help16.png";
|
||||
|
||||
/**
|
||||
* generated serial version ID
|
||||
|
@ -133,6 +134,8 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
|
|||
private HelpController helpController;
|
||||
|
||||
private ToolBarButton max;
|
||||
|
||||
private ToolBarButton contextHelp;
|
||||
|
||||
public DefaultDesktop()
|
||||
{
|
||||
|
@ -196,11 +199,9 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
|
|||
updateHelpCollapsedPreference(!oe.isOpen());
|
||||
HtmlBasedComponent comp = windowContainer.getComponent();
|
||||
if (comp != null) {
|
||||
if (oe.isOpen()) {
|
||||
LayoutUtils.removeSclass("with-right-icon", comp);
|
||||
} else {
|
||||
LayoutUtils.addSclass("with-right-icon", comp);
|
||||
}
|
||||
contextHelp.setVisible(!oe.isOpen());
|
||||
if (!oe.isOpen())
|
||||
layout.getEast().setVisible(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -220,11 +221,8 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
|
|||
});
|
||||
|
||||
boolean helpCollapsed= pref.isPropertyBool(UserPreference.P_HELP_COLLAPSED);
|
||||
e.setOpen(!helpCollapsed);
|
||||
Clients.evalJavaScript("$('.desktop-layout > div > .z-east-colpsd > .z-borderlayout-icon').attr('title', '" +
|
||||
Msg.getElement(Env.getCtx(), "AD_CtxHelp_ID") + "');");
|
||||
|
||||
|
||||
e.setVisible(!helpCollapsed);
|
||||
|
||||
helpController.render(e, this);
|
||||
|
||||
Center windowArea = layout.getCenter();
|
||||
|
@ -273,6 +271,7 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
|
|||
|
||||
ToolBar toolbar = new ToolBar();
|
||||
windowContainer.getComponent().appendChild(toolbar);
|
||||
|
||||
max = new ToolBarButton();
|
||||
toolbar.appendChild(max);
|
||||
max.setImage(ThemeManager.getThemeResource(IMAGES_UPARROW_PNG));
|
||||
|
@ -280,9 +279,13 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
|
|||
max.setSclass("window-container-toolbar-btn");
|
||||
max.setStyle("cursor: pointer; border: 1px solid transparent; padding: 2px;");
|
||||
|
||||
if (!e.isOpen()) {
|
||||
LayoutUtils.addSclass("with-right-icon", windowContainer.getComponent());
|
||||
}
|
||||
contextHelp = new ToolBarButton();
|
||||
toolbar.appendChild(contextHelp);
|
||||
contextHelp.setImage(ThemeManager.getThemeResource(IMAGES_CONTEXT_HELP_PNG));
|
||||
contextHelp.addEventListener(Events.ON_CLICK, this);
|
||||
contextHelp.setSclass("window-container-toolbar-btn context-help-btn");
|
||||
contextHelp.setStyle("cursor: pointer; border: 1px solid transparent; padding: 2px;");
|
||||
contextHelp.setTooltiptext(Util.cleanAmp(Msg.getElement(Env.getCtx(), "AD_CtxHelp_ID")));
|
||||
|
||||
return layout;
|
||||
}
|
||||
|
@ -331,6 +334,12 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
|
|||
max.setImage(ThemeManager.getThemeResource(IMAGES_UPARROW_PNG));
|
||||
}
|
||||
}
|
||||
else if (comp == contextHelp)
|
||||
{
|
||||
layout.getEast().setVisible(true);
|
||||
layout.getEast().setOpen(true);
|
||||
contextHelp.setVisible(false);
|
||||
}
|
||||
else if(comp instanceof ToolBarButton)
|
||||
{
|
||||
ToolBarButton btn = (ToolBarButton) comp;
|
||||
|
|
|
@ -121,6 +121,7 @@ public class WEditorPopupMenu extends Menupopup implements EventListener<Event>
|
|||
|
||||
if (lookup != null) {
|
||||
int winID = lookup.getZoom();
|
||||
int winIDPO = lookup.getZoom(false) ;
|
||||
Boolean canAccess = MRole.getDefault().getWindowAccess(winID);
|
||||
if (winID <= 0 || canAccess == null || ! canAccess) {
|
||||
this.zoomEnabled = false;
|
||||
|
@ -144,13 +145,13 @@ public class WEditorPopupMenu extends Menupopup implements EventListener<Event>
|
|||
+ "FROM AD_Field f "
|
||||
+ " JOIN AD_Tab t "
|
||||
+ " ON ( t.AD_Tab_ID = f.AD_Tab_ID ) "
|
||||
+ "WHERE t.AD_Window_ID = ? "
|
||||
+ "WHERE t.AD_Window_ID IN (?,?) "
|
||||
+ " AND f.IsActive = 'Y' "
|
||||
+ " AND t.IsActive = 'Y' "
|
||||
+ " AND f.IsQuickEntry = 'Y' "
|
||||
+ " AND (t.TabLevel = 0 "
|
||||
+ " AND t.AD_Table_ID IN (SELECT AD_Table_ID FROM AD_Table WHERE TableName = ? )) ",
|
||||
winID,tableName);
|
||||
winID,winIDPO,tableName);
|
||||
if (cnt > 0) {
|
||||
this.newEnabled = true;
|
||||
this.updateEnabled = true;
|
||||
|
|
|
@ -494,7 +494,10 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
|
|||
if(!getComponent().isEnabled())
|
||||
return;
|
||||
|
||||
final WQuickEntry vqe = new WQuickEntry (lookup.getWindowNo(), lookup.getZoom());
|
||||
int zoomWindowId = gridField != null ? lookup.getZoom(Env.isSOTrx(Env.getCtx(), gridField.getWindowNo())) : lookup.getZoom(Env.isSOTrx(Env.getCtx()));
|
||||
final WQuickEntry vqe = new WQuickEntry (lookup.getWindowNo(), zoomWindowId);
|
||||
if (vqe.getQuickFields()<=0)
|
||||
return;
|
||||
int Record_ID = 0;
|
||||
|
||||
// if update, get current value
|
||||
|
|
|
@ -516,5 +516,12 @@ public class WQuickEntry extends Window implements EventListener<Event>, ValueCh
|
|||
editor.setVisible(field.isDisplayed(true));
|
||||
}
|
||||
} // dynamicDisplay
|
||||
|
||||
/**
|
||||
* get size quickfields
|
||||
*/
|
||||
public int getQuickFields(){
|
||||
return quickFields.size();
|
||||
}// size of quickfields
|
||||
|
||||
} // WQuickEntry
|
||||
|
|
|
@ -46,7 +46,11 @@ import org.adempiere.webui.panel.StatusBarPanel;
|
|||
import org.adempiere.webui.session.SessionManager;
|
||||
import org.adempiere.webui.util.ReaderInputStream;
|
||||
import org.adempiere.webui.window.FDialog;
|
||||
import org.adempiere.webui.window.MultiFileDownloadDialog;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.tools.ant.Project;
|
||||
import org.apache.tools.ant.Target;
|
||||
import org.apache.tools.ant.taskdefs.Zip;
|
||||
import org.compiere.install.Translation;
|
||||
import org.compiere.install.TranslationController;
|
||||
import org.compiere.util.Env;
|
||||
|
@ -100,6 +104,7 @@ public class WTranslationDialog extends TranslationController implements IFormCo
|
|||
|
||||
private Button bExport = new Button();
|
||||
private Button bImport = new Button();
|
||||
private Button bExportZIP = new Button();
|
||||
private Button bImportZIP = new Button();
|
||||
|
||||
private Label lClient = new Label();
|
||||
|
@ -128,6 +133,8 @@ public class WTranslationDialog extends TranslationController implements IFormCo
|
|||
bExport.setStyle("text-align: right;");
|
||||
bImport.setLabel(Msg.getMsg(Env.getCtx(), "Import"));
|
||||
bImport.addActionListener(this);
|
||||
bExportZIP.setLabel(Msg.getMsg(Env.getCtx(), "ExportZIP"));
|
||||
bExportZIP.addActionListener(this);
|
||||
bImportZIP.setLabel(Msg.getMsg(Env.getCtx(), "ImportZIP"));
|
||||
bImportZIP.setUpload(AdempiereWebUI.getUploadSetting());
|
||||
bImportZIP.addEventListener(Events.ON_UPLOAD, this);
|
||||
|
@ -152,10 +159,16 @@ public class WTranslationDialog extends TranslationController implements IFormCo
|
|||
row.appendChild(div);
|
||||
|
||||
div = new Div();
|
||||
div.setStyle("text-align: center;");
|
||||
div.setStyle("text-align: left;");
|
||||
div.appendChild(bImport);
|
||||
row.appendChild(div);
|
||||
|
||||
row = rows.newRow();
|
||||
div = new Div();
|
||||
div.setStyle("text-align: right;");
|
||||
div.appendChild(bExportZIP);
|
||||
row.appendChild(div);
|
||||
|
||||
div = new Div();
|
||||
div.setStyle("text-align: left;");
|
||||
div.appendChild(bImportZIP);
|
||||
|
@ -247,13 +260,17 @@ public class WTranslationDialog extends TranslationController implements IFormCo
|
|||
return;
|
||||
}
|
||||
|
||||
final FolderBrowser directoryDialog = new FolderBrowser(true);
|
||||
directoryDialog.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
|
||||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
callImportProcess(directoryDialog.getPath());
|
||||
}
|
||||
});
|
||||
if ((e.getTarget() == bImport || e.getTarget() == bExport)) {
|
||||
final FolderBrowser directoryDialog = new FolderBrowser(true);
|
||||
directoryDialog.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
|
||||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
callImportProcess(directoryDialog.getPath());
|
||||
}
|
||||
});
|
||||
} else if (e.getTarget() == bExportZIP) {
|
||||
processExportZIP();
|
||||
}
|
||||
} // onEvent
|
||||
|
||||
private void callImportProcess(String directory) {
|
||||
|
@ -408,4 +425,48 @@ public class WTranslationDialog extends TranslationController implements IFormCo
|
|||
out.close();
|
||||
}
|
||||
|
||||
private void processExportZIP() {
|
||||
File tempfolder;
|
||||
try {
|
||||
tempfolder = File.createTempFile(m_AD_Language.getValue(), ".trl");
|
||||
tempfolder.delete();
|
||||
tempfolder.mkdir();
|
||||
} catch (IOException e1) {
|
||||
throw new AdempiereException("Problem creating temp folder", e1);
|
||||
}
|
||||
// export to temp folder
|
||||
callImportProcess(tempfolder.getPath());
|
||||
|
||||
// and now zip the exported files
|
||||
File destZipFile = null;
|
||||
try {
|
||||
destZipFile = File.createTempFile(m_AD_Language.getValue() + "_trlExport_", ".zip");
|
||||
} catch (Throwable e) {
|
||||
throw new AdempiereException("Unable to create temp file", e);
|
||||
}
|
||||
destZipFile.delete();
|
||||
|
||||
Zip zipper = new Zip();
|
||||
zipper.setDestFile(destZipFile);
|
||||
zipper.setBasedir(tempfolder);
|
||||
zipper.setUpdate(false);
|
||||
zipper.setCompress(true);
|
||||
zipper.setCaseSensitive(false);
|
||||
zipper.setFilesonly(true);
|
||||
zipper.setTaskName("zip");
|
||||
zipper.setTaskType("zip");
|
||||
zipper.setProject(new Project());
|
||||
zipper.setOwningTarget(new Target());
|
||||
zipper.execute();
|
||||
|
||||
try {
|
||||
FileUtils.deleteDirectory(tempfolder);
|
||||
} catch (IOException e) {}
|
||||
|
||||
MultiFileDownloadDialog downloadDialog = new MultiFileDownloadDialog(new File [] {destZipFile});
|
||||
downloadDialog.setPage(getForm().getPage());
|
||||
downloadDialog.setTitle(Msg.getMsg(Env.getCtx(), "ExportZIP"));
|
||||
Events.postEvent(downloadDialog, new Event(MultiFileDownloadDialog.ON_SHOW));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -151,6 +151,12 @@ html,body {
|
|||
height: 22px;
|
||||
}
|
||||
|
||||
.window-container-toolbar-btn.context-help-btn .z-toolbarbutton-cnt img {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
padding: 3px 3px;
|
||||
}
|
||||
|
||||
.tree-search-combo .z-comboitem-img img {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
|
@ -496,10 +502,6 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none {
|
|||
margin: 0px !important;
|
||||
}
|
||||
|
||||
.desktop-tabbox.with-right-icon .z-tabs .z-toolbar-tabs-body {
|
||||
margin-right: 12px !important;
|
||||
}
|
||||
|
||||
.desktop-tabbox .z-tabs .z-toolbar-tabs-body .z-toolbarbutton {
|
||||
padding: 0px !important;
|
||||
border: 1px solid transparent !important;
|
||||
|
@ -1915,36 +1917,3 @@ table.z-vbox > tbody > tr > td > table {
|
|||
border-radius: 0px;
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
<%-- Context Help --%>
|
||||
.desktop-layout > div > .z-east-colpsd {
|
||||
border: none;
|
||||
width: 0px !important;
|
||||
position: absolute;
|
||||
overflow: visible;
|
||||
padding: 0px !important;
|
||||
margin: 0px !important;
|
||||
}
|
||||
|
||||
.desktop-layout > div > .z-east-colpsd > .z-borderlayout-icon {
|
||||
background-image: url(${c:encodeURL('/theme/default/images/Help16.png')}) !important;
|
||||
background-position:center !important;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
position: relative;
|
||||
left: -20px;
|
||||
background-size: 16px 16px;
|
||||
margin-left: 0px !important;
|
||||
margin-right: 0px !important;
|
||||
margin-top: 4px !important;
|
||||
padding: 3px !important;
|
||||
}
|
||||
|
||||
.desktop-layout > div > .z-east-colpsd > .z-borderlayout-icon:hover {
|
||||
background-color:#DDD !important;
|
||||
-webkit-box-shadow:inset 0px 0px 3px #CCC;
|
||||
-moz-box-shadow:inset 0px 0px 3px #CCC;
|
||||
-o-box-shadow:inset 0px 0px 3px #CCC;
|
||||
-ms-box-shadow:inset 0px 0px 3px #CCC;
|
||||
box-shadow:inset 0px 0px 3px #CCC;
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.compiere.model.GridTab;
|
|||
import org.compiere.model.MRole;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.KeyNamePair;
|
||||
import org.compiere.util.Env;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -52,9 +53,21 @@ public abstract class PaymentFormOnCredit extends PaymentForm {
|
|||
/**
|
||||
* Load Payment Terms
|
||||
*/
|
||||
String ad_language = Env.getAD_Language(Env.getCtx());
|
||||
boolean isBaseLanguage = Env.isBaseLanguage(ad_language, "C_PaymentTerm");
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (isBaseLanguage) {
|
||||
sb.append("SELECT p.C_PaymentTerm_ID, p.Name FROM C_PaymentTerm p")
|
||||
.append(" WHERE p.IsActive='Y' ORDER BY p.Name");
|
||||
} else {
|
||||
sb.append("SELECT p.C_PaymentTerm_ID, pt.Name FROM C_PaymentTerm p")
|
||||
.append(" JOIN C_PaymentTerm_Trl pt ON (p.C_PaymentTerm_ID=pt.C_PaymentTerm_ID AND pt.AD_Language='")
|
||||
.append(ad_language).append("')")
|
||||
.append(" WHERE p.IsActive='Y' ORDER BY p.Name");
|
||||
}
|
||||
|
||||
String SQL = MRole.getDefault().addAccessSQL(
|
||||
"SELECT C_PaymentTerm_ID, Name FROM C_PaymentTerm WHERE IsActive='Y' ORDER BY Name",
|
||||
"C_PaymentTerm", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO);
|
||||
sb.toString(), "p", MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO);
|
||||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
try
|
||||
|
|
Loading…
Reference in New Issue