hg merge default into experimental

This commit is contained in:
Carlos Ruiz 2017-10-29 10:13:58 +01:00
commit 4758bd00b8
62 changed files with 62601 additions and 277 deletions

View File

@ -0,0 +1,23 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-3528 Add to Favorite for Menu Search Panel
-- Oct 23, 2017 11:59:39 PM GMT+08:00
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','Add To Favourite',0,0,'Y',TO_DATE('2017-10-23 23:59:38','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2017-10-23 23:59:38','YYYY-MM-DD HH24:MI:SS'),100,200435,'AddToFavourite','D','ddbf357f-3f1c-49dd-9ce7-3d8f0cc3b30a')
;
-- Oct 24, 2017 12:00:05 AM GMT+08:00
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','Remove From Favourite',0,0,'Y',TO_DATE('2017-10-24 00:00:05','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2017-10-24 00:00:05','YYYY-MM-DD HH24:MI:SS'),100,200436,'RemoveFromFavourite','D','36985206-17fb-4bf2-a339-3aac5e2601f3')
;
-- Oct 24, 2017 12:00:51 AM GMT+08:00
UPDATE AD_Message SET MsgText='Add To Favourites', Value='AddToFavourites',Updated=TO_DATE('2017-10-24 00:00:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200435
;
-- Oct 24, 2017 12:00:58 AM GMT+08:00
UPDATE AD_Message SET MsgText='Remove From Favourites', Value='RemoveFromFavourites',Updated=TO_DATE('2017-10-24 00:00:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200436
;
SELECT register_migration_script('201710232100_IDEMPIERE-3528.sql') FROM dual
;

View File

@ -0,0 +1,11 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-3518 Improvement For Mobile Compatibility
-- Oct 24, 2017 7:34:07 AM GMT+08:00
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','Select location to move selected item to',0,0,'Y',TO_DATE('2017-10-24 07:34:06','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2017-10-24 07:34:06','YYYY-MM-DD HH24:MI:SS'),100,200437,'MoveSelectedTreeItem','D','95d7bb4b-c7af-4b17-b274-23916870a7fa')
;
SELECT register_migration_script('201710240900_IDEMPIERE-3518.sql') FROM dual
;

View File

@ -0,0 +1,20 @@
-- IDEMPIERE-3528 Add to Favorite for Menu Search Panel
-- Oct 23, 2017 11:59:39 PM GMT+08:00
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','Add To Favourite',0,0,'Y',TO_TIMESTAMP('2017-10-23 23:59:38','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2017-10-23 23:59:38','YYYY-MM-DD HH24:MI:SS'),100,200435,'AddToFavourite','D','ddbf357f-3f1c-49dd-9ce7-3d8f0cc3b30a')
;
-- Oct 24, 2017 12:00:05 AM GMT+08:00
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','Remove From Favourite',0,0,'Y',TO_TIMESTAMP('2017-10-24 00:00:05','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2017-10-24 00:00:05','YYYY-MM-DD HH24:MI:SS'),100,200436,'RemoveFromFavourite','D','36985206-17fb-4bf2-a339-3aac5e2601f3')
;
-- Oct 24, 2017 12:00:51 AM GMT+08:00
UPDATE AD_Message SET MsgText='Add To Favourites', Value='AddToFavourites',Updated=TO_TIMESTAMP('2017-10-24 00:00:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200435
;
-- Oct 24, 2017 12:00:58 AM GMT+08:00
UPDATE AD_Message SET MsgText='Remove From Favourites', Value='RemoveFromFavourites',Updated=TO_TIMESTAMP('2017-10-24 00:00:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200436
;
SELECT register_migration_script('201710232100_IDEMPIERE-3528.sql') FROM dual
;

View File

@ -0,0 +1,8 @@
-- IDEMPIERE-3518 Improvement For Mobile Compatibility
-- Oct 24, 2017 7:34:07 AM GMT+08:00
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','Select location to move selected item to',0,0,'Y',TO_TIMESTAMP('2017-10-24 07:34:06','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2017-10-24 07:34:06','YYYY-MM-DD HH24:MI:SS'),100,200437,'MoveSelectedTreeItem','D','95d7bb4b-c7af-4b17-b274-23916870a7fa')
;
SELECT register_migration_script('201710240900_IDEMPIERE-3518.sql') FROM dual
;

View File

@ -41,16 +41,30 @@ public class PoFiller{
this.handler = handler;
}
protected String getStringValue (String columnName){
Element e = element.properties.get(columnName);
String value = e != null ? e.contents.toString() : null;
value = "".equals(value) ? null : value;
return value;
}
protected boolean isBlobOnPackinFile (String columnName){
String value = getStringValue(columnName);
if(value == null)
return false;
String strParts [] = value.split("[|]");
return strParts.length == 2;
}
/**
*
* @param columnName
*/
public void setString(String columnName){
Element e = element.properties.get(columnName);
String value = e != null ? e.contents.toString() : null;
value = "".equals(value) ? null : value;
String value = getStringValue(columnName);
Object oldValue = po.get_Value(columnName);
if (value == null && oldValue == null)
@ -288,6 +302,12 @@ public class PoFiller{
setInteger(qName);
} else if (info.getColumnClass(index) == Timestamp.class) {
setTimestamp(qName);
}else if(DisplayType.TextLong == info.getColumnDisplayType(index)) {// export column from system have type is normal string, but import to system have this column but type is textlong (mean blob)
if (getStringValue (qName) != null || !isBlobOnPackinFile(qName)) {
setString(qName);
}else {
setBlob(qName);
}
} else if (DisplayType.isLOB(info.getColumnDisplayType(index))) {
setBlob(qName);
} else {

View File

@ -38,6 +38,10 @@
id="org.idempiere.fitnesse"
version="0.0.0"/>
<includes
id="org.idempiere.equinox.p2.director"
version="0.0.0"/>
<plugin
id="org.eclipse.swt"
download-size="0"

View File

@ -5,7 +5,7 @@
xmlns="http://www.eclipse.org/buckminster/CSpec-1.0">
<dependencies>
<!-- Place your Dependencies here -->
<dependency name="org.idempiere.eclipse.platform" componentType="eclipse.feature"/>
<dependency name="org.idempiere.equinox.p2.director" componentType="eclipse.feature"/>
<dependency name="org.idempiere.fitnesse" componentType="eclipse.feature"/>
<dependency name="org.idempiere.fitnesse.fixture" componentType="osgi.bundle"/>
<dependency name="org.idempiere.fitnesse.server" componentType="osgi.bundle"/>
@ -74,7 +74,6 @@
</alterActions>
<alterGroups>
<public name="bundle.jars">
<attribute name="bundle.jars" component="org.idempiere.eclipse.platform"/>
<attribute name="bundle.jars" component="org.idempiere.fitnesse.fixture"/>
<attribute name="bundle.jars" component="org.idempiere.fitnesse.server"/>
<attribute name="bundle.jars" component="org.idempiere.fitnesse"/>
@ -82,7 +81,7 @@
<attribute name="bundle.jars" component="org.idempiere.ui.zk.selenium"/>
</public>
<public name="feature.references">
<attribute name="feature.jars" component="org.idempiere.eclipse.platform"/>
<attribute name="feature.jars" component="org.idempiere.equinox.p2.director"/>
<attribute name="feature.jars" component="org.idempiere.fitnesse"/>
</public>
</alterGroups>

View File

@ -10,9 +10,9 @@ target.os=*
target.ws=*
target.arch=*
product.features=org.idempiere.eclipse.platform.feature.group, org.idempiere.fitnesse.feature.group
product.features=org.idempiere.fitnesse.feature.group, org.idempiere.equinox.p2.director.feature.group
product.profile=DefaultProfile
product.id=org.adempiere.server.product
product.id=org.adempiere.server.product, org.eclipse.equinox.p2.director
osgi.user.area=${user.home}
osgi.user.area.default=${user.home}

View File

@ -10,9 +10,9 @@ target.os=linux
target.ws=gtk
target.arch=x86
product.features=org.idempiere.eclipse.platform.feature.group, org.idempiere.fitnesse.feature.group
product.features=org.idempiere.fitnesse.feature.group, org.idempiere.equinox.p2.director.feature.group
product.profile=DefaultProfile
product.id=org.adempiere.server.product
product.id=org.adempiere.server.product, org.eclipse.equinox.p2.director
osgi.user.area=${user.home}
osgi.user.area.default=${user.home}

View File

@ -10,9 +10,9 @@ target.os=linux
target.ws=gtk
target.arch=x86_64
product.features=org.idempiere.eclipse.platform.feature.group, org.idempiere.fitnesse.feature.group
product.features=org.idempiere.fitnesse.feature.group, org.idempiere.equinox.p2.director.feature.group
product.profile=DefaultProfile
product.id=org.adempiere.server.product
product.id=org.adempiere.server.product, org.eclipse.equinox.p2.director
osgi.user.area=${user.home}
osgi.user.area.default=${user.home}

View File

@ -10,9 +10,9 @@ target.os=macosx
target.ws=cocoa
target.arch=x86
product.features=org.idempiere.eclipse.platform.feature.group, org.idempiere.fitnesse.feature.group
product.features=org.idempiere.fitnesse.feature.group, org.idempiere.equinox.p2.director.feature.group
product.profile=DefaultProfile
product.id=org.adempiere.server.product
product.id=org.adempiere.server.product, org.eclipse.equinox.p2.director
osgi.user.area=${user.home}
osgi.user.area.default=${user.home}

View File

@ -10,9 +10,9 @@ target.os=solaris
target.ws=gtk
target.arch=x86
product.features=org.idempiere.eclipse.platform.feature.group, org.idempiere.fitnesse.feature.group
product.features=org.idempiere.fitnesse.feature.group, org.idempiere.equinox.p2.director.feature.group
product.profile=DefaultProfile
product.id=org.adempiere.server.product
product.id=org.adempiere.server.product, org.eclipse.equinox.p2.director
osgi.user.area=${user.home}
osgi.user.area.default=${user.home}

View File

@ -10,9 +10,9 @@ target.os=win32
target.ws=win32
target.arch=x86
product.features=org.idempiere.eclipse.platform.feature.group, org.idempiere.fitnesse.feature.group
product.features=org.idempiere.fitnesse.feature.group, org.idempiere.equinox.p2.director.feature.group
product.profile=DefaultProfile
product.id=org.adempiere.server.product
product.id=org.adempiere.server.product, org.eclipse.equinox.p2.director
osgi.user.area=${user.home}
osgi.user.area.default=${user.home}

View File

@ -0,0 +1,19 @@
## buckminster.properties ##
#Where all the output should go
buckminster.output.root=${user.home}/buckminster.output
# Where the temp files should go
buckminster.temp.root=${user.home}/tmp
# How .qualifier in versions should be replaced
qualifier.replacement.*=generator:buildTimestamp
generator.buildTimestamp.format='v'yyyyMMdd-HHmm
target.os=win32
target.ws=win32
target.arch=x86_64
product.features=org.idempiere.fitnesse.feature.group, org.idempiere.equinox.p2.director.feature.group
product.profile=DefaultProfile
product.id=org.adempiere.server.product, org.eclipse.equinox.p2.director
osgi.user.area=${user.home}
osgi.user.area.default=${user.home}
osgi.configuration.area.default=configuration

View File

@ -1,7 +1,6 @@
<project name="zklibrary" basedir="." default="copy">
<target name="copy">
<mkdir dir="data/seed" />
<get src="${url.file.srv}/database/4.1/Adempiere_pg84.jar" dest="data/seed/Adempiere_pg84.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="${url.file.srv}/database/4.1/Adempiere_pg.jar" dest="data/seed/Adempiere_pg.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="${url.file.srv}/database/4.1/Adempiere.jar" dest="data/seed/Adempiere.jar" usetimestamp="true" verbose="true" retries="5" />

File diff suppressed because one or more lines are too long

View File

@ -16,17 +16,6 @@ then
SYSUSER=postgres
fi
# for oracle or postgres version 9.1 or higher you run this the usual way:
# RUN_ImportIdempiere.sh
# for postgres versions 8.4 or 9.0 you can run this way:
# RUN_ImportIdempiere.sh 8.4
# or
# RUN_ImportIdempiere.sh 9.0
if [ "x$1" = x8.4 -o "x$1" = x9.0 ]
then
SUFFIX="_pg84"
fi
echo Re-Create idempiere User and import $IDEMPIERE_HOME/data/Adempiere${SUFFIX}.dmp - \($ADEMPIERE_DB_NAME\)
echo == The import will show warnings. This is OK ==
cd $IDEMPIERE_HOME/data/seed

View File

@ -8,15 +8,6 @@ SET SYSUSER=system
if (%ADEMPIERE_DB_PATH%) == (postgresql) SET SUFFIX=_pg
if (%ADEMPIERE_DB_PATH%) == (postgresql) SET SYSUSER=postgres
@Rem for oracle or postgres version 9.1 or higher you run this the usual way:
@Rem RUN_ImportIdempiere.sh
@Rem for postgres versions 8.4 or 9.0 you can run this way:
@Rem RUN_ImportIdempiere.sh 8.4
@Rem or
@Rem RUN_ImportIdempiere.sh 9.0
if (%1) == (8.4) SET SUFFIX=_pg84
if (%1) == (9.0) SET SUFFIX=_pg84
@echo Re-Create idempiere User and import %IDEMPIERE_HOME%\data\Adempiere.dmp - (%ADEMPIERE_DB_NAME%)
cd %IDEMPIERE_HOME%\data\seed
jar xvf Adempiere%SUFFIX%.jar

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/ckez.jar"/>
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/daisydiff-min.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>

View File

@ -21,6 +21,11 @@ Import-Package: groovy.transform.stc;version="2.4.7",
net.sf.jasperreports.export,
org.adempiere.report.jasper,
org.apache.commons.codec.binary,
org.apache.commons.fileupload;version="1.2.2",
org.apache.commons.fileupload.disk;version="1.2.2",
org.apache.commons.fileupload.portlet;version="1.2.2",
org.apache.commons.fileupload.servlet;version="1.2.2",
org.apache.commons.fileupload.util;version="1.2.2",
org.apache.ecs,
org.apache.ecs.xhtml,
org.apache.tools.ant,
@ -44,7 +49,8 @@ Import-Package: groovy.transform.stc;version="2.4.7",
org.springframework.web.util
DynamicImport-Package: action.images
Bundle-ClassPath: .,
WEB-INF/lib/daisydiff-min.jar
WEB-INF/lib/daisydiff-min.jar,
WEB-INF/lib/ckez.jar
Export-Package: fi.jawsy.jawwa.zk.atmosphere,
metainfo.zk,
org.adempiere.webui,
@ -77,7 +83,60 @@ Export-Package: fi.jawsy.jawwa.zk.atmosphere,
org.adempiere.webui.theme,
org.adempiere.webui.util,
org.adempiere.webui.window,
org.zkforge.ckez,
org.zkforge.keylistener,
web.ckez.html,
web.ckez.img,
web.js.ckez,
web.js.ckez.ext.CKeditor,
web.js.ckez.ext.CKeditor.adapters,
web.js.ckez.ext.CKeditor.lang,
web.js.ckez.ext.CKeditor.plugins,
web.js.ckez.ext.CKeditor.plugins.a11yhelp.dialogs,
web.js.ckez.ext.CKeditor.plugins.a11yhelp.dialogs.lang,
web.js.ckez.ext.CKeditor.plugins.about.dialogs,
web.js.ckez.ext.CKeditor.plugins.about.dialogs.hidpi,
web.js.ckez.ext.CKeditor.plugins.colordialog.dialogs,
web.js.ckez.ext.CKeditor.plugins.copyformatting.cursors,
web.js.ckez.ext.CKeditor.plugins.copyformatting.styles,
web.js.ckez.ext.CKeditor.plugins.dialog,
web.js.ckez.ext.CKeditor.plugins.div.dialogs,
web.js.ckez.ext.CKeditor.plugins.find.dialogs,
web.js.ckez.ext.CKeditor.plugins.flash.dialogs,
web.js.ckez.ext.CKeditor.plugins.flash.images,
web.js.ckez.ext.CKeditor.plugins.forms.dialogs,
web.js.ckez.ext.CKeditor.plugins.forms.images,
web.js.ckez.ext.CKeditor.plugins.iframe.dialogs,
web.js.ckez.ext.CKeditor.plugins.iframe.images,
web.js.ckez.ext.CKeditor.plugins.image.dialogs,
web.js.ckez.ext.CKeditor.plugins.image.images,
web.js.ckez.ext.CKeditor.plugins.link.dialogs,
web.js.ckez.ext.CKeditor.plugins.link.images,
web.js.ckez.ext.CKeditor.plugins.link.images.hidpi,
web.js.ckez.ext.CKeditor.plugins.liststyle.dialogs,
web.js.ckez.ext.CKeditor.plugins.magicline.images,
web.js.ckez.ext.CKeditor.plugins.magicline.images.hidpi,
web.js.ckez.ext.CKeditor.plugins.pagebreak.images,
web.js.ckez.ext.CKeditor.plugins.pastefromword.filter,
web.js.ckez.ext.CKeditor.plugins.preview,
web.js.ckez.ext.CKeditor.plugins.scayt,
web.js.ckez.ext.CKeditor.plugins.scayt.dialogs,
web.js.ckez.ext.CKeditor.plugins.scayt.skins,
web.js.ckez.ext.CKeditor.plugins.showblocks.images,
web.js.ckez.ext.CKeditor.plugins.smiley.dialogs,
web.js.ckez.ext.CKeditor.plugins.smiley.images,
web.js.ckez.ext.CKeditor.plugins.specialchar.dialogs,
web.js.ckez.ext.CKeditor.plugins.specialchar.dialogs.lang,
web.js.ckez.ext.CKeditor.plugins.table.dialogs,
web.js.ckez.ext.CKeditor.plugins.tableselection.styles,
web.js.ckez.ext.CKeditor.plugins.tabletools.dialogs,
web.js.ckez.ext.CKeditor.plugins.templates.dialogs,
web.js.ckez.ext.CKeditor.plugins.templates.templates,
web.js.ckez.ext.CKeditor.plugins.templates.templates.images,
web.js.ckez.ext.CKeditor.plugins.wsc,
web.js.ckez.ext.CKeditor.plugins.wsc.dialogs,
web.js.ckez.ext.CKeditor.plugins.wsc.skins,
web.js.ckez.ext.CKeditor.skins,
web.js.zkforge,
web.js.zkforge.mold
Require-Bundle: org.adempiere.base;bundle-version="0.0.0",
@ -100,4 +159,3 @@ Eclipse-ExtensibleAPI: true
Web-ContextPath: webui
Service-Component: OSGI-INF/reportviewerprovider.xml, OSGI-INF/defaultinfofactory.xml, OSGI-INF/defaulteditorfactory.xml, OSGI-INF/jrviewerprovider.xml, OSGI-INF/resourcefinder.xml, OSGI-INF/defaultpaymentformfactory.xml, OSGI-INF/processfactory.xml, OSGI-INF/defaultprintshippinglabel.xml, OSGI-INF/defaultcreatefromfactory.xml, OSGI-INF/defaultformfactory.xml, OSGI-INF/feedbackservice.xml, OSGI-INF/zulgadgetfactory.xml, OSGI-INF/jfgchartrenderer.xml
Bundle-ActivationPolicy: lazy
Eclipse-RegisterBuddy: org.idempiere.zk.extra

View File

@ -35,6 +35,7 @@ import org.adempiere.webui.component.DrillCommand;
import org.adempiere.webui.component.TokenCommand;
import org.adempiere.webui.component.ZoomCommand;
import org.adempiere.webui.desktop.DefaultDesktop;
import org.adempiere.webui.desktop.FavouriteController;
import org.adempiere.webui.desktop.IDesktop;
import org.adempiere.webui.session.SessionContextListener;
import org.adempiere.webui.session.SessionManager;
@ -233,7 +234,7 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, IWeb
mSession.saveEx();
}
currSess.setAttribute("Check_AD_User_ID", Env.getAD_User_ID(ctx));
currSess.setAttribute("Check_AD_User_ID", Env.getAD_User_ID(ctx));
//enable full interface, relook into this when doing preference
Env.setContext(ctx, "#ShowTrl", true);
@ -281,6 +282,9 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, IWeb
Env.setContext(ctx, "#LocalHttpAddr", localHttpAddr.toString());
Clients.response(new AuScript("zAu.cmd0.clearBusy()"));
//init favorite
FavouriteController.getInstance(currSess);
processParameters();
}

View File

@ -31,8 +31,10 @@ import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.action.Actions;
import org.adempiere.webui.action.IAction;
import org.adempiere.webui.component.FToolbar;
import org.adempiere.webui.component.Tabpanel;
import org.adempiere.webui.component.ToolBarButton;
import org.adempiere.webui.event.ToolbarListener;
import org.adempiere.webui.part.WindowContainer;
import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.ZKUpdateUtil;
@ -829,6 +831,18 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
"}");
addEventListener(Events.ON_AFTER_SIZE, (AfterSizeEvent evt) -> onAfterSize(evt));
addCallback(AFTER_PAGE_ATTACHED, t -> afterPageAttached());
}
private void afterPageAttached() {
Component p = getParent();
while (p != null) {
if (p instanceof Tabpanel) {
p.addEventListener(WindowContainer.ON_MOBILE_SET_SELECTED_TAB, evt -> this.invalidate());
break;
}
p = p.getParent();
}
}
private void onAfterSize(AfterSizeEvent evt) {
@ -905,7 +919,9 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
}
public void onPostAfterSize() {
String script = "var w = zk.Widget.$('#" + getUuid() + "'); w.toolbarScrollable(w);";
Clients.evalJavaScript(script);
if (this.getPage() != null) {
String script = "var w = zk.Widget.$('#" + getUuid() + "'); w.toolbarScrollable(w);";
Clients.evalJavaScript(script);
}
}
}

View File

@ -3060,8 +3060,15 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
//dialog.setWidth("500px");
dialog.setBorder("normal");
getComponent().getParent().appendChild(dialog);
showBusyMask(dialog);
LayoutUtils.openOverlappedWindow(getComponent(), dialog, "middle_center");
if (ClientInfo.isMobile())
{
dialog.doHighlighted();
}
else
{
showBusyMask(dialog);
LayoutUtils.openOverlappedWindow(getComponent(), dialog, "middle_center");
}
dialog.focus();
}
else

View File

@ -248,7 +248,7 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI
}
layout();
return true;
}
@ -375,7 +375,8 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI
row.appendChild(notificationTypeField.getComponent());
runAsJobField.setChecked(MSysConfig.getBooleanValue(MSysConfig.BACKGROUND_JOB_BY_DEFAULT, false));
notificationTypeField.getComponent().getParent().setVisible(runAsJobField.isChecked());
notificationTypeField.getComponent().getParent().setVisible(runAsJobField.isChecked());
notificationTypeField.fillHorizontal();
}
}
@ -405,13 +406,13 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI
bottomParameterLayout.appendChild(reportOptionLayout);
freportType = new Listbox();
freportType.setSclass("option-input-parameter");
freportType.setSclass("option-input-parameter view-report-list");
chbIsSummary = new Checkbox();
chbIsSummary.setSclass("option-input-parameter");
Label lPrintFormat = new Label(Msg.translate(Env.getCtx(), "AD_PrintFormat_ID"));
lPrintFormat.setSclass("option-input-parameter");
lPrintFormat.setSclass("option-input-parameter print-format-label");
Label lreportType = new Label(Msg.translate(Env.getCtx(), "view.report"));
lreportType.setSclass("option-input-parameter");
lreportType.setSclass("option-input-parameter view-report-label");
Label lIsSummary = new Label(Msg.translate(Env.getCtx(), "Summary"));
lIsSummary.setSclass("option-input-parameter");
@ -426,7 +427,8 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI
reportOptionLayout.appendChild(fLanguageType.getComponent());
((Combobox)fLanguageType.getComponent()).setSclass("option-input-parameter");
}
fPrintFormat.getComponent().setSclass("option-input-parameter");
fPrintFormat.getComponent().setSclass("option-input-parameter print-format-list");
fPrintFormat.getComponent().setPlaceholder(lPrintFormat.getValue());
reportOptionLayout.appendChild(lreportType);
reportOptionLayout.appendChild(freportType);
reportOptionLayout.appendChild(lIsSummary);
@ -440,15 +442,19 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI
}
protected void savePrameterLayout(HtmlBasedComponent bottomParameterLayout) {
HtmlBasedComponent savePrameterLayout = new Hlayout();
Hlayout savePrameterLayout = new Hlayout();
savePrameterLayout.setSclass("save-parameter-container");
bottomParameterLayout.appendChild(savePrameterLayout);
savePrameterLayout.setValign("middle");
lSaved = new Label(Msg.getMsg(Env.getCtx(), "SavedParameter"));
lSaved.setClass("saved-parameter-label");
savePrameterLayout.appendChild(lSaved);
fSavedName = new Combobox();
fSavedName.addEventListener(Events.ON_CHANGE, this);
savePrameterLayout.appendChild(fSavedName);
fSavedName.setPlaceholder(lSaved.getValue());
fSavedName.setSclass("saved-parameter-list");
bSave.setEnabled(false);
bSave.addActionListener(this);
@ -609,6 +615,7 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI
if (component == runAsJobField && event.getName().equals(Events.ON_CHECK))
{
notificationTypeField.getComponent().getParent().setVisible(runAsJobField.isChecked());
mainParameterLayout.invalidate();
}
else if (event.getName().equals(ON_COMPLETE))

View File

@ -20,6 +20,8 @@ import java.util.List;
import org.adempiere.webui.component.ListHead;
import org.adempiere.webui.component.ListItem;
import org.adempiere.webui.component.Listbox;
import org.adempiere.webui.component.ToolBarButton;
import org.adempiere.webui.desktop.FavouriteController;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.TreeItemAction;
import org.adempiere.webui.util.TreeNodeAction;
@ -47,7 +49,6 @@ import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
import org.zkoss.zul.ListitemRendererExt;
import org.zkoss.zul.Textbox;
import org.zkoss.zul.Toolbarbutton;
import org.zkoss.zul.Tree;
import org.zkoss.zul.Treechildren;
import org.zkoss.zul.Treeitem;
@ -61,14 +62,21 @@ import org.zkoss.zul.impl.LabelImageElement;
*/
public class MenuSearchController implements EventListener<Event>{
public static final String M_TREE_NODE_ATTR = "MTreeNode";
private static final String Z_ICON_STAR_O = "z-icon-star-o";
private static final String Z_ICON_STAR = "z-icon-star";
private static final String ON_SEARCH_ECHO = "onSearchEcho";
private static final String ON_LOAD_MORE = "onLoadMore";
private static final String ONSELECT_TIMESTAMP = "onselect.timestamp";
private static final String STAR_BUTTON_NAME = "Star";
private static final String NEW_BUTTON_NAME = "New";
private Tree tree;
private Listbox listbox;
private ListModelList<MenuItem> model;
private Vlayout layout;
private ListModelList<MenuItem> fullModel;
private boolean inStarEvent;
private static final String ON_POST_SELECT_TREEITEM_EVENT = "onPostSelectTreeitem";
@ -196,12 +204,21 @@ public class MenuSearchController implements EventListener<Event>{
Listheader listheader = new Listheader();
listhead.appendChild(listheader);
listheader = new Listheader();
ZKUpdateUtil.setWidth(listheader, "32px");
listheader.setAlign("center");
ZKUpdateUtil.setWidth(listheader, "28px");
listhead.appendChild(listheader);
listheader = new Listheader();
listheader.setAlign("center");
ZKUpdateUtil.setWidth(listheader, "28px");
listhead.appendChild(listheader);
layout.addEventListener(ON_SEARCH_ECHO, this);
layout.addEventListener(ON_LOAD_MORE, this);
updateListboxModel(model);
FavouriteController controller = FavouriteController.getInstance(Executions.getCurrent().getSession());
controller.addDeletedCallback(t -> onDeletedCallback(t));
controller.addInsertedCallback(t -> onInsertedCallback(t));
}
@Override
@ -221,18 +238,34 @@ public class MenuSearchController implements EventListener<Event>{
} else if (System.currentTimeMillis() - onSelect.longValue() > 1000) {
onSelect(item, Boolean.FALSE);
}
} else if (event.getTarget() instanceof Toolbarbutton) {
ListItem item = null;
Component parent = event.getTarget();
while (parent != null) {
if (parent instanceof ListItem) {
item = (ListItem) parent;
break;
} else if (event.getTarget() instanceof ToolBarButton) {
ToolBarButton btn = (ToolBarButton) event.getTarget();
if (NEW_BUTTON_NAME.equals(btn.getName())) {
ListItem item = null;
Component parent = event.getTarget();
while (parent != null) {
if (parent instanceof ListItem) {
item = (ListItem) parent;
break;
}
parent = parent.getParent();
}
parent = parent.getParent();
}
if (item != null) {
onSelect(item, Boolean.TRUE);
if (item != null) {
onSelect(item, Boolean.TRUE);
}
} else if (STAR_BUTTON_NAME.equals(btn.getName())) {
inStarEvent = true;
FavouriteController controller = FavouriteController.getInstance(Executions.getCurrent().getSession());
if (Z_ICON_STAR_O.equals(btn.getIconSclass())) {
btn.setIconSclass(Z_ICON_STAR);
btn.setTooltiptext(Msg.getMsg(Env.getCtx(), "RemoveFromFavourites"));
controller.addNode((MTreeNode) btn.getAttribute(M_TREE_NODE_ATTR));
} else if (Z_ICON_STAR.equals(btn.getIconSclass())) {
btn.setIconSclass(Z_ICON_STAR_O);
btn.setTooltiptext(Msg.getMsg(Env.getCtx(), "AddToFavourites"));
controller.removeNode(((MTreeNode) btn.getAttribute(M_TREE_NODE_ATTR)).getNode_ID());
}
inStarEvent = false;
}
}
} else if (event.getName().equals(ON_SEARCH_ECHO)) {
@ -241,6 +274,20 @@ public class MenuSearchController implements EventListener<Event>{
loadMore();
}
}
private void onInsertedCallback(MTreeNode node) {
if (inStarEvent) return;
ListModel<?> t = listbox.getModel();
listbox.setModel((ListModel<?>)null);
listbox.setModel(t);
}
private void onDeletedCallback(Integer nodeId) {
if (inStarEvent) return;
ListModel<?> t = listbox.getModel();
listbox.setModel((ListModel<?>)null);
listbox.setModel(t);
}
private void onSelect(ListItem selected, Boolean newRecord) {
MenuItem item = selected.getValue();
@ -438,6 +485,9 @@ public class MenuSearchController implements EventListener<Event>{
}
private class MenuItemRenderer implements ListitemRenderer<MenuItem>, ListitemRendererExt {
private static final String REMOVE_FROM_FAVOURITES_MSG = "RemoveFromFavourites";
private static final String ADD_TO_FAVOURITES_MSG = "AddToFavourites";
@Override
public Listitem newListitem(org.zkoss.zul.Listbox listbox) {
return new ListItem();
@ -466,13 +516,41 @@ public class MenuSearchController implements EventListener<Event>{
item.appendChild(cell);
boolean isWindow = data.getType() != null && data.getType().equals("window");
if (isWindow) {
Toolbarbutton newBtn = new Toolbarbutton(null, ThemeManager.getThemeResource("images/New16.png"));
ToolBarButton newBtn = new ToolBarButton();
newBtn.setImage(ThemeManager.getThemeResource("images/New16.png"));
newBtn.addEventListener(Events.ON_CLICK, MenuSearchController.this);
newBtn.setSclass("fav-new-btn");
newBtn.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "New")));
newBtn.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), NEW_BUTTON_NAME)));
newBtn.setName(NEW_BUTTON_NAME);
cell.appendChild(newBtn);
}
}
cell = new Listcell();
item.appendChild(cell);
MTreeNode node = null;
if (data.getData() instanceof MTreeNode) {
node = (MTreeNode) data.getData();
} else if (data.getData() instanceof Treeitem) {
Treeitem value = (Treeitem) data.getData();
if (value != null) {
node = (MTreeNode) value.getAttribute(M_TREE_NODE_ATTR);
}
}
if (node != null) {
FavouriteController controller = FavouriteController.getInstance(Executions.getCurrent().getSession());
ToolBarButton starBtn = new ToolBarButton();
starBtn.setAttribute(M_TREE_NODE_ATTR, node);
starBtn.setName(STAR_BUTTON_NAME);
if (controller.hasNode(node.getNode_ID())) {
starBtn.setIconSclass(Z_ICON_STAR);
starBtn.setTooltiptext(Msg.getMsg(Env.getCtx(), REMOVE_FROM_FAVOURITES_MSG));
} else {
starBtn.setIconSclass(Z_ICON_STAR_O);
starBtn.setTooltiptext(Msg.getMsg(Env.getCtx(), ADD_TO_FAVOURITES_MSG));
}
cell.appendChild(starBtn);
starBtn.addEventListener(Events.ON_CLICK, MenuSearchController.this);
}
}
}
}

View File

@ -18,14 +18,16 @@ package org.adempiere.webui.apps;
import java.util.logging.Level;
import org.adempiere.webui.ClientInfo;
import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.component.Window;
import org.adempiere.webui.event.DialogEvents;
import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.util.ZKUpdateUtil;
import org.compiere.process.ProcessInfo;
import org.compiere.util.CLogger;
import org.compiere.util.Env;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.HtmlBasedComponent;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
@ -49,6 +51,7 @@ public class ProcessModalDialog extends AbstractProcessDialog implements EventLi
/** Logger */
private static CLogger log = CLogger.getCLogger(ProcessModalDialog.class);
//
private String orientation;
/**
* @param aProcess
@ -82,8 +85,28 @@ public class ProcessModalDialog extends AbstractProcessDialog implements EventLi
{
init(Env.getCtx(), WindowNo, pi.getAD_Process_ID(), pi, autoStart, true);
if (mainParameterLayout != null)// when auto start it's null
mainParameterLayout.setStyle("max-height:" + (SessionManager.getAppDesktop().getClientInfo().desktopHeight - 150) + "px");
this.setSclass("popup-dialog");
{
mainParameterLayout.setStyle("max-height:" + ClientInfo.get().desktopHeight + "px");
ZKUpdateUtil.setVflex(mainParameterLayout, "min");
}
if (topParameterLayout != null)
{
topParameterLayout.setStyle("max-height:" + (ClientInfo.get().desktopHeight-130) + "px");
}
if (bottomParameterLayout != null)
{
for(Component c : bottomParameterLayout.getChildren())
{
if (c instanceof HtmlBasedComponent)
ZKUpdateUtil.setVflex((HtmlBasedComponent) c, "min");
}
}
this.setSclass("popup-dialog process-modal-dialog");
if (ClientInfo.isMobile())
{
orientation = ClientInfo.get().orientation;
ClientInfo.onClientInfo(this, this::onClientInfo);
}
}
catch(Exception ex)
{
@ -183,5 +206,23 @@ public class ProcessModalDialog extends AbstractProcessDialog implements EventLi
}else {
super.onEvent(event);
}
}
}
protected void onClientInfo() {
if (getPage() != null) {
String newOrientation = ClientInfo.get().orientation;
if (!newOrientation.equals(orientation)) {
orientation = newOrientation;
if (mainParameterLayout != null)// when auto start it's null
{
mainParameterLayout.setStyle("max-height:" + ClientInfo.get().desktopHeight + "px");
}
if (topParameterLayout != null)
{
topParameterLayout.setStyle("max-height:" + (ClientInfo.get().desktopHeight-130) + "px");
}
this.invalidate();
}
}
}
} // ProcessModalDialog

View File

@ -62,8 +62,9 @@ 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.Div;
import org.zkoss.zul.Hbox;
import org.zkoss.zul.Label;
import org.zkoss.zul.Space;
import org.zkoss.zul.impl.InputElement;
import org.zkoss.zul.impl.XulElement;
/**
@ -131,7 +132,7 @@ public class ProcessParameterPanel extends Panel implements
// ranges
private ArrayList<GridField> m_mFields = new ArrayList<GridField>();
private ArrayList<GridField> m_mFields2 = new ArrayList<GridField>();
private ArrayList<Label> m_separators = new ArrayList<Label>();
private ArrayList<Space> m_separators = new ArrayList<Space>();
//
private Grid centerPanel = null;
@ -327,8 +328,11 @@ public class ProcessParameterPanel extends Panel implements
//
if (voF.isRange) {
Hbox box = new Hbox();
Div box = new Div();
ZKUpdateUtil.setWidth(box, "100%");
box.appendChild(editor.getComponent());
ZKUpdateUtil.setWidth((HtmlBasedComponent) editor.getComponent(), "49%");
setEditorPlaceHolder(editor, Msg.getMsg(Env.getCtx(), "From"));
//
GridFieldVO voF2 = GridFieldVO.createParameter(voF);
GridField mField2 = new GridField(voF2);
@ -342,7 +346,8 @@ public class ProcessParameterPanel extends Panel implements
// New Field value to be updated to editor
mField2.addPropertyChangeListener(editor2);
editor2.dynamicDisplay();
editor2.fillHorizontal();
ZKUpdateUtil.setWidth((HtmlBasedComponent) editor2.getComponent(), "49%");
setEditorPlaceHolder(editor2, Msg.getMsg(Env.getCtx(), "To"));
// setup editor context menu
popupMenu = editor2.getPopupMenu();
if (popupMenu != null) {
@ -354,7 +359,8 @@ public class ProcessParameterPanel extends Panel implements
mField2.setValue(defaultObject2, true);
//
m_wEditors2.add(editor2);
Label separator = new Label(" - ");
Space separator = new Space();
separator.setSpacing("2%");
m_separators.add(separator);
box.appendChild(separator);
box.appendChild(editor2.getComponent());
@ -368,6 +374,21 @@ public class ProcessParameterPanel extends Panel implements
rows.appendChild(row);
} // createField
private void setEditorPlaceHolder(WEditor editor, String msg) {
Component c = editor.getComponent();
if (c instanceof InputElement) {
((InputElement) c).setPlaceholder(msg);
} else {
for (Component e : c.getChildren()) {
if (e instanceof InputElement) {
((InputElement) e).setPlaceholder(msg);
break;
}
}
}
}
/**
* Validate Parameter values
*

View File

@ -19,6 +19,7 @@ import java.util.List;
import java.util.logging.Level;
import org.adempiere.webui.ClientInfo;
import org.adempiere.webui.panel.TreeSearchPanel;
import org.compiere.model.MTree;
import org.compiere.model.MTreeNode;
import org.compiere.util.CLogger;
@ -161,16 +162,17 @@ public class SimpleTreeModel extends org.zkoss.zul.DefaultTreeModel<Object> impl
if(ti.getTreerow()==null){
tr = new Treerow();
tr.setParent(ti);
//zk's dnd doesn't work well on touch device with vertical scroll enable
//need different approach
if (!ClientInfo.isMobile()) {
if (isItemDraggable()) {
if (isItemDraggable()) {
//use different approach on mobile, dnd not working well
if (ClientInfo.isMobile()) {
tr.setAttribute(TreeSearchPanel.TREE_ROW_MOVABLE, Boolean.TRUE);
} else {
tr.setDraggable("true");
}
if (!onDropListners.isEmpty()) {
tr.setDroppable("true");
tr.addEventListener(Events.ON_DROP, this);
}
}
if (!onDropListners.isEmpty()) {
tr.setDroppable("true");
tr.addEventListener(Events.ON_DROP, this);
}
// Color

View File

@ -28,10 +28,11 @@ import java.util.Map;
import java.util.Properties;
import java.util.TimeZone;
import org.adempiere.webui.ClientInfo;
import org.adempiere.webui.component.Tabpanel;
import org.adempiere.webui.component.Window;
import org.adempiere.webui.panel.ITabOnCloseHandler;
import org.adempiere.webui.part.WindowContainer;
import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.ZKUpdateUtil;
@ -80,6 +81,7 @@ public class CalendarWindow extends Window implements EventListener<Event>, ITab
*
*/
private static final long serialVersionUID = 1576992746053720647L;
private static final String ON_MOBILE_SET_SELECTED_TAB_ECHO = "onMobileSetSelectedTabEcho";
private Calendars calendars;
private SimpleCalendarModel scm;
@ -187,15 +189,35 @@ public class CalendarWindow extends Window implements EventListener<Event>, ITab
calendars.addEventListener("onEventUpdate", this);
calendars.addEventListener("onMouseOver", this);
if (ClientInfo.isMobile()) {
addCallback(AFTER_PAGE_ATTACHED, t -> afterPageAttached());
addEventListener(ON_MOBILE_SET_SELECTED_TAB_ECHO, evt -> calendars.invalidate());
}
SessionManager.getAppDesktop().showWindow(this);
// IDEMPIERE-1457: when show this window on tab, handle event close to remove calendars away scm
Component parentTab = this.getParent();
if (parentTab != null && parentTab.getClass().equals(Tabpanel.class)) {
((Tabpanel)parentTab).setOnCloseHandler(this);
}
}
private void afterPageAttached() {
Component p = getParent();
while (p != null) {
if (p instanceof Tabpanel) {
p.addEventListener(WindowContainer.ON_MOBILE_SET_SELECTED_TAB, evt -> onMobileSelected());
break;
}
p = p.getParent();
}
}
private void onMobileSelected() {
Events.echoEvent(ON_MOBILE_SET_SELECTED_TAB_ECHO, this, null);
}
public void onClose(Tabpanel tabPanel){
//IDEMPIERE-1457: On close, remove calendars away scm
calendars.setModel(null);

View File

@ -30,6 +30,9 @@ import org.adempiere.base.Service;
import org.adempiere.base.event.AbstractEventHandler;
import org.adempiere.base.event.EventManager;
import org.adempiere.base.event.IEventTopics;
import org.adempiere.webui.ClientInfo;
import org.adempiere.webui.component.Tabpanel;
import org.adempiere.webui.part.WindowContainer;
import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.ServerPushTemplate;
@ -70,11 +73,12 @@ import org.zkoss.zul.impl.LabelImageElement;
*/
public class DPCalendar extends DashboardPanel implements EventListener<Event>, EventHandler {
/**
*
*/
private static final long serialVersionUID = -224914882522997787L;
private static final String ON_MOBILE_SET_SELECTED_TAB_ECHO = "onMobileSetSelectedTabEcho";
private Calendars calendars;
private SimpleCalendarModel scm;
private LabelImageElement btnCal, btnRefresh;
@ -137,6 +141,26 @@ public class DPCalendar extends DashboardPanel implements EventListener<Event>,
DPCalendar.this.cleanup();
}
};
if (ClientInfo.isMobile()) {
addCallback(AFTER_PAGE_ATTACHED, t -> afterPageAttached());
addEventListener(ON_MOBILE_SET_SELECTED_TAB_ECHO, evt -> calendars.invalidate());
}
}
private void afterPageAttached() {
Component p = getParent();
while (p != null) {
if (p instanceof Tabpanel) {
p.addEventListener(WindowContainer.ON_MOBILE_SET_SELECTED_TAB, evt -> onMobileSelected());
break;
}
p = p.getParent();
}
}
private void onMobileSelected() {
Events.echoEvent(ON_MOBILE_SET_SELECTED_TAB_ECHO, this, null);
}
private synchronized void createStaticListeners() {

View File

@ -13,13 +13,13 @@
*****************************************************************************/
package org.adempiere.webui.dashboard;
import static org.compiere.model.SystemIDs.TREE_MENUPRIMARY;
import java.util.Enumeration;
import java.util.ArrayList;
import java.util.List;
import org.adempiere.util.Callback;
import org.adempiere.webui.adwindow.ADTabpanel;
import org.adempiere.webui.adwindow.ADWindow;
import org.adempiere.webui.desktop.FavouriteController;
import org.adempiere.webui.exception.ApplicationException;
import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ITheme;
@ -27,13 +27,12 @@ import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.FDialog;
import org.compiere.model.MMenu;
import org.compiere.model.MQuery;
import org.compiere.model.MTree;
import org.compiere.model.MTreeNode;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.compiere.util.Util;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.event.DropEvent;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
@ -74,8 +73,10 @@ public class DPFavourites extends DashboardPanel implements EventListener<Event>
private Label lblMsg;
private int m_AD_Tree_ID;
private List<A> links = new ArrayList<>();
private boolean inCallingController;
public DPFavourites()
{
super();
@ -108,35 +109,44 @@ public class DPFavourites extends DashboardPanel implements EventListener<Event>
private void createFavouritesPanel()
{
int AD_Role_ID = Env.getAD_Role_ID(Env.getCtx());
int AD_Tree_ID = DB.getSQLValue(null,
"SELECT COALESCE(r.AD_Tree_Menu_ID, ci.AD_Tree_Menu_ID)"
+ "FROM AD_ClientInfo ci"
+ " INNER JOIN AD_Role r ON (ci.AD_Client_ID=r.AD_Client_ID) "
+ "WHERE AD_Role_ID=?", AD_Role_ID);
if (AD_Tree_ID <= 0)
AD_Tree_ID = TREE_MENUPRIMARY; // Menu
m_AD_Tree_ID = AD_Tree_ID;
MTree vTree = new MTree(Env.getCtx(), AD_Tree_ID, false, true, null);
MTreeNode m_root = vTree.getRoot();
Enumeration<?> enTop = m_root.children();
while(enTop.hasMoreElements())
FavouriteController controller = FavouriteController.getInstance(Executions.getCurrent().getSession());
List<MTreeNode> favorites = controller.getFavourites();
for (MTreeNode nd : favorites)
{
MTreeNode ndTop = (MTreeNode)enTop.nextElement();
Enumeration<?> en = ndTop.preorderEnumeration();
while (en.hasMoreElements())
{
MTreeNode nd = (MTreeNode)en.nextElement();
if (nd.isOnBar()) {
addNode(nd.getNode_ID(), nd.toString().trim(), nd.getDescription(), getIconFile(nd), (nd.isWindow() && !nd.isForm()));
}
}
addNode(nd);
}
lblMsg = new Label(Msg.getMsg(Env.getCtx(), "DropMenuItemHere"));
if(bxFav.getChildren().isEmpty()) bxFav.appendChild(lblMsg);
controller.addInsertedCallback(t -> onInsertedCallback(t));
controller.addDeletedCallback(t -> onDeletedCallback(t));
}
private void addNode(MTreeNode nd) {
addNode(nd.getNode_ID(), nd.toString().trim(), nd.getDescription(), getIconFile(nd), (nd.isWindow() && !nd.isForm()));
}
private void onDeletedCallback(Integer nodeId) {
if (inCallingController) return;
for (A link : links) {
String id = (String) link.getAttribute(NODE_ID_ATTR);
if (id.equals(nodeId.toString())) {
removeLinkFromUI(link);
break;
}
}
}
private void onInsertedCallback(MTreeNode node) {
if (inCallingController) return;
for (A link : links) {
String id = (String) link.getAttribute(NODE_ID_ATTR);
if (id.equals(String.valueOf(node.getNode_ID()))) {
return;
}
}
addNode(node);
}
protected void addNode(int nodeId, String label, String description, String imageSrc, boolean addNewBtn) {
@ -168,54 +178,9 @@ public class DPFavourites extends DashboardPanel implements EventListener<Event>
newBtn.setSclass("fav-new-btn");
newBtn.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "New")));
}
links.add(btnFavItem);
}
/**
* Make Bar add/remove persistent
* @param add true if add - otherwise remove
* @param Node_ID Node ID
* @return true if updated
*/
private boolean barDBupdate(boolean add, int Node_ID)
{
int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx());
int AD_Org_ID = Env.getContextAsInt(Env.getCtx(), "#AD_Org_ID");
int AD_User_ID = Env.getContextAsInt(Env.getCtx(), "#AD_User_ID");
StringBuilder sql = new StringBuilder();
if (add) {
// If record already exist, we will only make an update
if (DB.getSQLValueEx(null, "SELECT 1 FROM AD_TreeBar WHERE AD_Tree_ID = ? AND AD_User_ID = ? AND Node_ID = ?", m_AD_Tree_ID, AD_User_ID, Node_ID) == 1) {
sql.append("UPDATE AD_TreeBar SET IsFavourite = 'Y', Updated = Sysdate, UpdatedBy = ").append(AD_User_ID).append(" WHERE AD_Tree_ID = ").append(m_AD_Tree_ID)
.append(" AND AD_User_ID=").append(AD_User_ID)
.append(" AND Node_ID=").append(Node_ID);
}
else // we will create the record
sql.append("INSERT INTO AD_TreeBar "
+ "(AD_Tree_ID,AD_User_ID,Node_ID, "
+ "AD_Client_ID,AD_Org_ID, "
+ "IsActive,Created,CreatedBy,Updated,UpdatedBy)VALUES (")
.append(m_AD_Tree_ID).append(",").append(AD_User_ID).append(",").append(Node_ID).append(",")
.append(AD_Client_ID).append(",").append(AD_Org_ID).append(",")
.append("'Y',SysDate,").append(AD_User_ID).append(",SysDate,").append(AD_User_ID).append(")");
// if already exist, will result in ORA-00001: unique constraint (ADEMPIERE.AD_TREEBAR_KEY)
}
else {
// if the menu entry is opened at login, we will only remove it from favourites
if (DB.getSQLValueEx(null, "SELECT LoginOpenSeqNo FROM AD_TreeBar WHERE AD_Tree_ID = ? AND AD_User_ID = ? AND Node_ID = ?", m_AD_Tree_ID, AD_User_ID, Node_ID) > 0) {
sql.append("UPDATE AD_TreeBar SET IsFavourite = 'N', Updated = Sysdate, UpdatedBy = ").append(AD_User_ID).append(" WHERE AD_Tree_ID = ").append(m_AD_Tree_ID)
.append(" AND AD_User_ID=").append(AD_User_ID)
.append(" AND Node_ID=").append(Node_ID);
}
else // otherwise, we remove the record
sql.append("DELETE AD_TreeBar WHERE AD_Tree_ID=").append(m_AD_Tree_ID)
.append(" AND AD_User_ID=").append(AD_User_ID)
.append(" AND Node_ID=").append(Node_ID);
}
int no = DB.executeUpdate(sql.toString(), false, null);
return no == 1;
}
public void onEvent(Event event)
{
Component comp = event.getTarget();
@ -318,20 +283,27 @@ public class DPFavourites extends DashboardPanel implements EventListener<Event>
if(value != null)
{
int Node_ID = Integer.valueOf(value.toString());
if(barDBupdate(false, Node_ID))
FavouriteController controller = FavouriteController.getInstance(Executions.getCurrent().getSession());
inCallingController = true;
if(controller.removeNode(Node_ID))
{
if (btn.getParent() instanceof Hlayout)
bxFav.removeChild(btn.getParent());
// bxFav.removeChild(btn);
if(bxFav.getChildren().isEmpty())
bxFav.appendChild(lblMsg);
bxFav.invalidate();
removeLinkFromUI(btn);
}
inCallingController = false;
}
}
private void removeLinkFromUI(A btn) {
if (btn.getParent() instanceof Hlayout)
bxFav.removeChild(btn.getParent());
if(bxFav.getChildren().isEmpty())
bxFav.appendChild(lblMsg);
bxFav.invalidate();
links.remove(btn);
}
/**
* Add menu treeitem into the user favorite panel
* @param treeitem
@ -341,7 +313,9 @@ public class DPFavourites extends DashboardPanel implements EventListener<Event>
if(value != null)
{
int Node_ID = Integer.valueOf(value.toString());
if(barDBupdate(true, Node_ID))
FavouriteController controller = FavouriteController.getInstance(Executions.getCurrent().getSession());
inCallingController = true;
if(controller.addNode(Node_ID))
{
String menuType = (String) treeitem.getAttribute("menu.type");
boolean isWindow = menuType != null && menuType.equals("window");
@ -364,6 +338,7 @@ public class DPFavourites extends DashboardPanel implements EventListener<Event>
} else {
FDialog.error(0, this, "BookmarkExist", null);
}
inCallingController = false;
}
}

View File

@ -0,0 +1,187 @@
/**
*
*/
package org.adempiere.webui.desktop;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.adempiere.util.Callback;
import org.compiere.model.MTree;
import org.compiere.model.MTreeNode;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.zkoss.zk.ui.Session;
import static org.compiere.model.SystemIDs.TREE_MENUPRIMARY;
/**
* @author hengsin
*
*/
public class FavouriteController {
private static final String DESKTOP_FAVOURITE_CONTROLLER = "desktop.FavouriteController";
private Map<Integer, MTreeNode> nodeMap;
private int m_AD_Tree_ID;
private MTreeNode rootNode;
private List<Callback<Integer>> deletedCallbacks;
private List<Callback<MTreeNode>> insertedCallbacks;
private FavouriteController() {
init();
}
private void init() {
nodeMap = new LinkedHashMap<>();
deletedCallbacks = new ArrayList<>();
insertedCallbacks = new ArrayList<>();
int AD_Role_ID = Env.getAD_Role_ID(Env.getCtx());
int AD_Tree_ID = DB.getSQLValue(null,
"SELECT COALESCE(r.AD_Tree_Menu_ID, ci.AD_Tree_Menu_ID)"
+ "FROM AD_ClientInfo ci"
+ " INNER JOIN AD_Role r ON (ci.AD_Client_ID=r.AD_Client_ID) "
+ "WHERE AD_Role_ID=?", AD_Role_ID);
if (AD_Tree_ID <= 0)
AD_Tree_ID = TREE_MENUPRIMARY; // Menu
m_AD_Tree_ID = AD_Tree_ID;
MTree vTree = new MTree(Env.getCtx(), AD_Tree_ID, false, true, false, null);
rootNode = vTree.getRoot();
Enumeration<?> enTop = rootNode.children();
while(enTop.hasMoreElements())
{
MTreeNode ndTop = (MTreeNode)enTop.nextElement();
Enumeration<?> en = ndTop.preorderEnumeration();
while (en.hasMoreElements())
{
MTreeNode nd = (MTreeNode)en.nextElement();
if (nd.isOnBar()) {
nodeMap.put(nd.getNode_ID(), nd);
}
}
}
}
/**
* Get favourites controller instance for current session
* @param currSess
* @return FavouriteController session instance
*/
public static synchronized FavouriteController getInstance(Session currSess) {
FavouriteController controller = (FavouriteController) currSess.getAttribute(DESKTOP_FAVOURITE_CONTROLLER);
if (controller == null) {
controller = new FavouriteController();
currSess.setAttribute(DESKTOP_FAVOURITE_CONTROLLER, controller);
}
return controller;
}
private boolean barDBupdate(boolean add, int Node_ID)
{
int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx());
int AD_Org_ID = Env.getContextAsInt(Env.getCtx(), "#AD_Org_ID");
int AD_User_ID = Env.getContextAsInt(Env.getCtx(), "#AD_User_ID");
StringBuilder sql = new StringBuilder();
if (add)
sql.append("INSERT INTO AD_TreeBar "
+ "(AD_Tree_ID,AD_User_ID,Node_ID, "
+ "AD_Client_ID,AD_Org_ID, "
+ "IsActive,Created,CreatedBy,Updated,UpdatedBy)VALUES (")
.append(m_AD_Tree_ID).append(",").append(AD_User_ID).append(",").append(Node_ID).append(",")
.append(AD_Client_ID).append(",").append(AD_Org_ID).append(",")
.append("'Y',SysDate,").append(AD_User_ID).append(",SysDate,").append(AD_User_ID).append(")");
// if already exist, will result in ORA-00001: unique constraint (ADEMPIERE.AD_TREEBAR_KEY)
else
sql.append("DELETE AD_TreeBar WHERE AD_Tree_ID=").append(m_AD_Tree_ID)
.append(" AND AD_User_ID=").append(AD_User_ID)
.append(" AND Node_ID=").append(Node_ID);
int no = DB.executeUpdate(sql.toString(), false, null);
return no == 1;
}
/**
* Add node (by node id) to favourties
* @param nodeId
* @return true if successfully added
*/
public boolean addNode(int nodeId) {
MTreeNode node = rootNode.findNode(nodeId);
if (node != null) {
return addNode(node);
}
return false;
}
/**
* add tree node to favourites
* @param node
* @return true if successfully added
*/
public boolean addNode(MTreeNode node) {
if(barDBupdate(true, node.getNode_ID())) {
nodeMap.put(node.getNode_ID(), node);
for (Callback<MTreeNode> callback : insertedCallbacks) {
callback.onCallback(node);
}
return true;
}
return false;
}
/**
* remove node (by node id) from favourites
* @param nodeId
* @return true if found and remove
*/
public boolean removeNode(int nodeId) {
if(barDBupdate(false, nodeId))
{
nodeMap.remove(nodeId);
for (Callback<Integer> callback : deletedCallbacks) {
callback.onCallback(nodeId);
}
return true;
}
return false;
}
/**
* @param nodeId
* @return true if node id is in the current favourites list
*/
public boolean hasNode(int nodeId) {
return nodeMap.keySet().contains(nodeId);
}
/**
* @return List of favourites node
*/
public List<MTreeNode> getFavourites() {
List<MTreeNode> list = new ArrayList<>();
for(int key : nodeMap.keySet()) {
list.add(nodeMap.get(key));
}
return list;
}
/**
* add callback for after add node to favourites
* @param callback
*/
public void addInsertedCallback(Callback<MTreeNode> callback) {
insertedCallbacks.add(callback);
}
/**
* add callback for after remove node from favourites
* @param callback
*/
public void addDeletedCallback(Callback<Integer> callback) {
deletedCallbacks.add(callback);
}
}

View File

@ -23,6 +23,7 @@ import java.util.Properties;
import org.adempiere.util.Callback;
import org.adempiere.webui.adwindow.ADTabpanel;
import org.adempiere.webui.adwindow.ADWindow;
import org.adempiere.webui.apps.MenuSearchController;
import org.adempiere.webui.exception.ApplicationException;
import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
@ -205,6 +206,7 @@ public abstract class AbstractMenuPanel extends Panel implements EventListener<E
link.setSclass("menu-href");
treeitem.getTreerow().setDraggable("favourite"); // Elaine 2008/07/24
treeitem.setAttribute(MenuSearchController.M_TREE_NODE_ATTR, mChildNode);
}
}
}

View File

@ -21,10 +21,12 @@ import java.util.List;
import java.util.Set;
import java.util.TreeMap;
import org.adempiere.webui.ClientInfo;
import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.component.AutoComplete;
import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.Panel;
import org.adempiere.webui.component.ToolBarButton;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.DocumentSearch;
import org.adempiere.webui.util.TreeItemAction;
@ -39,6 +41,7 @@ import org.zkoss.zk.au.out.AuScript;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.IdSpace;
import org.zkoss.zk.ui.event.DropEvent;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
@ -51,6 +54,7 @@ import org.zkoss.zul.Hlayout;
import org.zkoss.zul.Tree;
import org.zkoss.zul.Treechildren;
import org.zkoss.zul.Treeitem;
import org.zkoss.zul.Treerow;
import org.zkoss.zul.event.TreeDataEvent;
import org.zkoss.zul.event.TreeDataListener;
import org.zkoss.zul.impl.LabelElement;
@ -64,6 +68,8 @@ import org.zkoss.zul.impl.LabelImageElement;
*/
public class TreeSearchPanel extends Panel implements EventListener<Event>, TreeDataListener, IdSpace
{
public static final String TREE_ROW_MOVABLE = "tree.row.movable";
/**
*
*/
@ -91,6 +97,10 @@ public class TreeSearchPanel extends Panel implements EventListener<Event>, Tree
private Treeitem selectedItem;
protected Hlayout layout;
private Hlayout moveItemBox;
private ToolBarButton moveItemBtn;
private static final String PREFIX_DOCUMENT_SEARCH = "/";
/**
@ -173,13 +183,97 @@ public class TreeSearchPanel extends Panel implements EventListener<Event>, Tree
}
layout.appendChild(lblSearch);
layout.appendChild(cmbSearch);
layout.appendChild(cmbSearch);
//move selected treeitem for mobile, alternative to dnd
if (ClientInfo.isMobile())
{
moveItemBtn = new ToolBarButton();
moveItemBtn.setSclass("tree-moveitem-btn");
moveItemBtn.setIconSclass("z-icon-arrows-alt");
layout.appendChild(moveItemBtn);
moveItemBtn.addEventListener(Events.ON_CLICK, evt -> onMoveBtnClicked());
tree.addEventListener("onPostMove", evt -> onPostMove(evt));
}
this.appendChild(layout);
addEventListener(ON_POST_FIRE_TREE_EVENT, this);
if (ClientInfo.isMobile()) {
tree.addEventListener(Events.ON_SELECT, evt -> onSelect(evt));
}
}
protected void addTreeItem(Treeitem treeItem)
private void onSelect(Event evt) {
if (moveItemBox != null) {
Treeitem selected = tree.getSelectedItem();
Treerow selectedRow = selected.getTreerow();
Component dragged = (Component) moveItemBox.getAttribute("draggedComponent");
DropEvent event = new DropEvent(Events.ON_DROP, selectedRow, dragged, 0, 0, 0, 0, 0);
moveItemBox.detach();
moveItemBox = null;
moveItemBtn.setSclass("tree-moveitem-btn");
moveItemBtn.setAttribute("draggedComponent", dragged);
Events.postEvent(event);
Events.postEvent("onPostMove", tree, selected);
}
}
private void onPostMove(Event evt) {
Treeitem item = (Treeitem) evt.getData();
Treerow dragged = (Treerow) moveItemBtn.getAttribute("draggedComponent");
if (dragged == null) return;
Treeitem draggedItem = (Treeitem) dragged.getParent();
if (item.getNextSibling() != null) {
Treeitem next = (Treeitem) item.getNextSibling();
if (next.getValue().equals(draggedItem.getValue())) {
tree.setSelectedItem(next);
next.focus();
Events.postEvent(Events.ON_SELECT, tree, next);
}
}
}
private void onMoveBtnClicked() {
if (moveItemBox != null) {
moveItemBox.detach();
moveItemBox = null;
moveItemBtn.setSclass("tree-moveitem-btn");
Treeitem ti = tree.getSelectedItem();
if (ti != null)
ti.focus();
return;
}
moveItemBtn.setSclass("tree-moveitem-btn pressed");
Treeitem ti = tree.getSelectedItem();
if (ti == null) return;
Treerow tr = ti.getTreerow();
if (tr == null) return;
if (tr.getAttribute(TREE_ROW_MOVABLE) == null) return;
moveItemBox = new Hlayout();
Label l = new Label(Msg.getMsg(Env.getCtx(), "MoveSelectedTreeItem"));
l.setStyle("font-weight: 600");
moveItemBox.appendChild(l);
moveItemBox.setValign("middle");
ToolBarButton btn = new ToolBarButton();
btn.setIconSclass("z-icon-remove");
moveItemBox.appendChild(btn);
moveItemBox.setAttribute("draggedComponent", tr);
btn.addEventListener(Events.ON_CLICK, e -> {
moveItemBox.detach();
moveItemBox = null;
moveItemBtn.setSclass("tree-moveitem-btn");
if (tree.getSelectedItem() != null)
tree.getSelectedItem().focus();
});
this.insertBefore(moveItemBox, layout);
String script = "var w=zk.Widget.$('#" + moveItemBox.getUuid() + "'); ";
script += "var e=jq('#" + layout.getUuid() + "'); ";
script += "w.setWidth(e.css('width')); ";
Clients.response(new AuScript(script));
ti.focus();
}
protected void addTreeItem(Treeitem treeItem)
{
StringBuilder key = new StringBuilder(getLabel(treeItem)).append(".").append(treeItem.getAttribute("menu.type"));
treeNodeItemMap.put(key.toString(), treeItem);

View File

@ -24,9 +24,12 @@ import java.util.GregorianCalendar;
import java.util.TimeZone;
import java.util.logging.Level;
import org.adempiere.webui.ClientInfo;
import org.adempiere.webui.component.Tabpanel;
import org.adempiere.webui.component.ToolBarButton;
import org.adempiere.webui.component.Window;
import org.adempiere.webui.component.ZkCssHelper;
import org.adempiere.webui.part.WindowContainer;
import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.ZKUpdateUtil;
@ -69,6 +72,7 @@ public class WSchedule extends Window implements EventListener<Event>
*
*/
private static final long serialVersionUID = -4819513326165148245L;
private static final String ON_MOBILE_SET_SELECTED_TAB_ECHO = "onMobileSetSelectedTabEcho";
@SuppressWarnings("unused")
private InfoSchedule infoSchedule;
@ -204,7 +208,27 @@ public class WSchedule extends Window implements EventListener<Event>
divTabClicked(7);
addEventListener("onAfterReCreate", this);
} // jbInit
if (ClientInfo.isMobile()) {
addCallback(AFTER_PAGE_ATTACHED, t -> afterPageAttached());
addEventListener(ON_MOBILE_SET_SELECTED_TAB_ECHO, evt -> calendars.invalidate());
}
}
private void afterPageAttached() {
Component p = getParent();
while (p != null) {
if (p instanceof Tabpanel) {
p.addEventListener(WindowContainer.ON_MOBILE_SET_SELECTED_TAB, evt -> onMobileSelected());
break;
}
p = p.getParent();
}
}
private void onMobileSelected() {
Events.echoEvent(ON_MOBILE_SET_SELECTED_TAB_ECHO, this, null);
}
/**
* Recreate View

View File

@ -49,6 +49,8 @@ import org.zkoss.zul.Menuitem;
*/
public class WindowContainer extends AbstractUIPart implements EventListener<Event>
{
public static final String ON_MOBILE_SET_SELECTED_TAB = "onMobileSetSelectedTab";
private static final String ON_AFTER_TAB_CLOSE = "onAfterTabClose";
private static final String ON_DEFER_SET_SELECTED_TAB = "onDeferSetSelectedTab";
@ -100,8 +102,11 @@ public class WindowContainer extends AbstractUIPart implements EventListener<Eve
}
});
tabbox.addEventListener(ON_AFTER_TAB_CLOSE, evt -> {
updateMobileTabState(tabbox.getSelectedTab());
updateTabListButton();
if (isMobile()) {
updateMobileTabState(tabbox.getSelectedTab());
updateTabListButton();
tabbox.getTabs().invalidate();
}
});
Tabpanels tabpanels = new Tabpanels();
@ -395,7 +400,7 @@ public class WindowContainer extends AbstractUIPart implements EventListener<Eve
}
private void updateTabListButton() {
if (isMobile()) {
if (isMobile() && tabListBtn != null) {
int cnt = tabbox.getTabs().getChildren().size()-1;
if (cnt > 0) {
tabListBtn.setLabel(Integer.toString(cnt));
@ -474,22 +479,27 @@ public class WindowContainer extends AbstractUIPart implements EventListener<Eve
*/
public void setSelectedTab(org.zkoss.zul.Tab tab)
{
tabbox.setSelectedTab(tab);
updateMobileTabState(tab);
if (isMobile())
updateMobileTabState(tab);
tabbox.setSelectedTab(tab);
if (isMobile())
tabbox.getTabs().invalidate();
}
private void updateMobileTabState(org.zkoss.zul.Tab tab) {
if (isMobile())
if (isMobile() && tabListBtn != null)
{
List<Component> tabs = tabbox.getTabs().getChildren();
for(Component c: tabs) {
if (c instanceof Tab) {
Tab t = (Tab) c;
t.setVisible(t == tab);
t.getLinkedPanel().setVisible(t == tab);
t.getLinkedPanel().setVisible(t == tab);
if (t.isVisible()) {
Events.postEvent(ON_MOBILE_SET_SELECTED_TAB, t.getLinkedPanel(), null);
}
}
}
tabbox.getTabs().invalidate();
}
}
}

View File

@ -33,7 +33,8 @@ bin.includes = META-INF/,\
OSGI-INF/jfgchartrenderer.xml,\
WEB-INF/lib/daisydiff-min.jar,\
manifest.json,\
pdf.js/
pdf.js/,\
WEB-INF/lib/ckez.jar
src.includes = WEB-INF/tld/,\
WEB-INF/web.xml,\
WEB-INF/xsd/,\

View File

@ -5,6 +5,6 @@
<mkdir dir="WEB-INF/lib" />
<get src="${url.file.srv}/jarfile/4.1/labelapplet.jar" dest="labelapplet.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="${url.file.srv}/jarfile/4.1/daisydiff-min.jar" dest="WEB-INF/lib/daisydiff-min.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="${url.maven.zkoss.lib}/maven2/org/zkoss/zkforge/ckez/4.7.0.0/ckez-4.7.0.0.jar" dest="WEB-INF/lib/ckez.jar" usetimestamp="true" verbose="true" retries="5" />
</target>
</project>

View File

@ -215,6 +215,42 @@ Copyright (C) 2007 Ashley G Ramdass.
return '[ ' + (acp * psz + 1) + dash + ' / ' + tsz + ' ]';
});
});
zk.afterLoad('calendar', function () {
zk.override(calendar.Event.prototype, "calculate_", function () {
if (typeof this.event === "undefined" || this.event == null) {
return;
}
this.$calculate_.apply(this, arguments);
});
zk.override(calendar.Event.prototype, "unbind_", function() {
var node = this.$n();
if (typeof node === "undefined") {
return;
}
if (typeof this.$unbind_ === "undefined") {
return;
}
this.$unbind_.apply(this, arguments);
});
zk.override(calendar.CalendarsMonth.prototype, "onSize", function () {
var cmp = this.$n();
if (typeof cmp === "undefined" || cmp == null) {
return;
}
this.$onSize.apply(this, arguments);
});
zk.override(calendar.CalendarsDefault.prototype, "onSize", function () {
var cmp = this.$n();
if (typeof cmp === "undefined" || cmp == null) {
return;
}
this.$onSize.apply(this, arguments);
});
});
]]>
</script>

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,4 @@
.fav-new-btn {
margin-left: 4px;
margin-bottom: 3px;
padding-left: 1px;
}
.fav-new-btn img {

View File

@ -8,6 +8,9 @@ when detect side effect, fix to only apply for parameter window*/
.main-parameter-layout{
height: 100%;
}
.process-modal-dialog.z-window > .z-window-content {
height: 100%;
}
.main-parameter-layout,
.top-parameter-layout,
@ -19,6 +22,7 @@ when detect side effect, fix to only apply for parameter window*/
.bottom-container{
width: 100%;
}
.report-option-container {
overflow-x: auto;
}
@ -27,7 +31,8 @@ when detect side effect, fix to only apply for parameter window*/
}
.bottom-parameter-layout{
padding-top: 4px;
border-top: 1px solid rgba(0, 0, 0, 0.2);
}
.message-paramenter{
@ -69,7 +74,69 @@ when detect side effect, fix to only apply for parameter window*/
.input-paramenter-layout{
width: 70%;
}
@media screen and (max-width: 700px) {
.input-paramenter-layout{
width: 90%;
}
}
@media screen and (max-width: 500px) {
.input-paramenter-layout{
width: 100%;
}
}
.popup-dialog .input-paramenter-layout{
width: 90%;
}
}
@media screen and (max-width: 500px) {
.option-input-parameter.z-label.print-format-label,
.option-input-parameter.z-label.view-report-label {
display: none;
}
}
@media screen and (min-width: 501px) {
.option-input-parameter.print-format-list > input::-webkit-input-placeholder {
color: white;
}
}
@media screen and (min-width: 501px) {
.option-input-parameter.print-format-list > input::-moz-placeholder {
color: white;
}
}
@media screen and (min-width: 501px) {
.option-input-parameter.print-format-list > input::-ms-input-placeholder {
color: white;
}
}
@media screen and (max-width: 400px) {
.option-input-parameter.print-format-list {
width: 180px !important;
}
}
@media screen and (max-width: 320px) {
.option-input-parameter.print-format-list {
width: 150px !important;
}
}
@media screen and (max-width: 500px) {
.save-parameter-container .saved-parameter-label {
display: none;
}
}
@media screen and (min-width: 501px) {
.save-parameter-container .saved-parameter-list > input::-webkit-input-placeholder {
color: white;
}
}
@media screen and (min-width: 501px) {
.save-parameter-container .saved-parameter-list > input::-moz-placeholder {
color: white;
}
}
@media screen and (min-width: 501px) {
.save-parameter-container .saved-parameter-list > input::-ms-input-placeholder {
color: white;
}
}

View File

@ -7,3 +7,11 @@
.z-treecell-content {
padding: 2px 1px;
}
.tree-moveitem-btn {
padding: 2px 4px;
border-radius: 3px;
}
.tree-moveitem-btn.pressed {
box-shadow: inset 0 0 0 1px #efefef,inset 0 3px 15px #9f9f9f;
}

View File

@ -373,3 +373,9 @@
height: 100%;
}
}
@media screen and (max-height: 600px) {
.popup-dialog.process-modal-dialog {
height: 100%;
}
}

View File

@ -1,20 +1,11 @@
bin.includes = feature.xml
root.folder.director=director
root.linux.gtk.x86_64=file:director.sh,file:update.sh,file:update-prd.sh
root.linux.gtk.x86_64.permissions.755=*.sh,**/*.sh
root.linux.gtk.x86=file:director.sh,file:update.sh,file:update-prd.sh
root.linux.gtk.x86.permissions.755=*.sh,**/*.sh
root.macosx.cocoa.x86=file:director.sh,file:update.sh,file:update-prd.sh
root.macosx.cocoa.x86.permissions.755=*.sh,**/*.sh
root.macosx.cocoa.x86_64=file:director.sh,file:update.sh,file:update-prd.sh
root.macosx.cocoa.x86_64.permissions.755=*.sh,**/*.sh
root.win32.win32.x86=file:director.bat,file:update.bat,file:update-prd.bat
root.win32.win32.x86_64=file:director.bat,file:update.bat,file:update-prd.bat
root.solaris.gtk.x86=file:director.sh,file:update.sh,file:update-prd.sh
root.solaris.gtk.x86.permissions.755=*.sh,**/*.sh
root.solaris.gtk.x86.permissions.755=*.sh,**/*.sh

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.idempiere.equinox.p2.director-feature</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.FeatureBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.FeatureNature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,24 @@
bin.includes = feature.xml
root.folder.director=director
root.linux.gtk.x86_64=file:director.sh,file:update.sh,file:update-prd.sh
root.linux.gtk.x86_64.permissions.755=*.sh,**/*.sh
root.linux.gtk.x86=file:director.sh,file:update.sh,file:update-prd.sh
root.linux.gtk.x86.permissions.755=*.sh,**/*.sh
root.macosx.cocoa.x86=file:director.sh,file:update.sh,file:update-prd.sh
root.macosx.cocoa.x86.permissions.755=*.sh,**/*.sh
root.macosx.cocoa.x86_64=file:director.sh,file:update.sh,file:update-prd.sh
root.macosx.cocoa.x86_64.permissions.755=*.sh,**/*.sh
root.win32.win32.x86=file:director.bat,file:update.bat,file:update-prd.bat
root.win32.win32.x86.permissions.755=*.sh,**/*.sh
root.win32.win32.x86_64=file:director.bat,file:update.bat,file:update-prd.bat
root.win32.win32.x86_64.permissions.755=*.sh,**/*.sh
root.solaris.gtk.x86=file:director.sh,file:update.sh,file:update-prd.sh
root.solaris.gtk.x86.permissions.755=*.sh,**/*.sh

View File

@ -32,7 +32,6 @@ osgi.bundles=org.eclipse.core.net@start,\
org.eclipse.equinox.p2.jarprocessor,\
org.eclipse.equinox.p2.metadata,\
org.eclipse.equinox.p2.metadata.repository,\
org.eclipse.equinox.p2.ql,\
org.eclipse.equinox.p2.repository,\
org.eclipse.equinox.p2.touchpoint.eclipse,\
org.eclipse.equinox.p2.touchpoint.natives,\
@ -58,7 +57,12 @@ osgi.bundles=org.eclipse.core.net@start,\
org.junit,\
org.eclipse.osgi.compatibility.state,\
org.eclipse.osgi.compatibility.plugins,\
org.eclipse.osgi@start
org.eclipse.osgi@start,\
org.eclipse.osgi.services,\
org.eclipse.osgi.util,\
org.apache.felix.scr,\
org.eclipse.equinox.ds,\
org.tukaani.xz
osgi.framework.extensions=
osgi.bundles.defaultStartLevel=4
eclipse.p2.profile=DefaultProfile

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="org.idempiere.equinox.p2.director"
label="Idempiere P2 Director"
version="4.1.0.qualifier"
provider-name="www.idempiere.org">
<description url="http://www.example.com/description">
[Enter Feature Description here.]
</description>
<copyright url="http://www.example.com/copyright">
[Enter Copyright Description here.]
</copyright>
<license url="http://www.example.com/license">
[Enter License Description here.]
</license>
</feature>

View File

@ -6,6 +6,12 @@ set DESTINATION=%cd%
@echo %DESTINATION%
@echo %1%
set INSTALL_UI=%2%
set UNINSTALL_UI=%2%
if [%3]==[] goto nothird
set UNINSTALL_UI=%3%
:nothird
FOR %%c in (plugins\org.eclipse.equinox.launcher_1.*.jar) DO set JARFILE=%%c
java -Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4 -Djava.net.preferIPv4Stack=true -jar %JARFILE% -install director -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination %DESTINATION% -repository %1% -u %2%
java -Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4 -Djava.net.preferIPv4Stack=true -jar %JARFILE% -install director -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination %DESTINATION% -repository %1% -i %2%
java -Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4 -Djava.net.preferIPv4Stack=true -jar %JARFILE% -install director -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination %DESTINATION% -repository %1 -u %UNINSTALL_UI%
java -Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4 -Djava.net.preferIPv4Stack=true -jar %JARFILE% -install director -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination %DESTINATION% -repository %1 -i %INSTALL_UI%

View File

@ -4,6 +4,13 @@
cd $(dirname "${0}")
DESTINATION=$(pwd)
VMOPTS="-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4 -Djava.net.preferIPv4Stack=true"
java $VMOPTS -jar plugins/org.eclipse.equinox.launcher_1.*.jar -install director -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination $DESTINATION -repository $1 -u $2
java $VMOPTS -jar plugins/org.eclipse.equinox.launcher_1.*.jar -install director -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination $DESTINATION -repository $1 -i $2
VMOPTS="-Declipse.log.level=ALL -Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4 -Djava.net.preferIPv4Stack=true"
INSTALL_UI="$2"
UNINSTALL_UI="$2"
if [ -n "$3" ]; then
# case update org.adempiere.server.product, install and un-install is difference
UNINSTALL_UI="$3"
fi
java $VMOPTS -jar plugins/org.eclipse.equinox.launcher_1.*.jar -install director -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination $DESTINATION -repository $1 -u "$UNINSTALL_UI"
java $VMOPTS -jar plugins/org.eclipse.equinox.launcher_1.*.jar -install director -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination $DESTINATION -repository $1 -i "$INSTALL_UI"

View File

@ -23,7 +23,9 @@ if exist jettyhome\etc\jetty-selector.xml (
copy jettyhome\etc\jetty-selector.xml jetty-selector.xml.sav
)
@call %DESTINATION%\update-prd %1% org.adempiere.server.product
set UNINSTALL_UI="org.adempiere.server.product, org.idempiere.fitnesse.feature.group"
set INSTALL_UI="org.adempiere.server.product, org.eclipse.equinox.p2.director, org.idempiere.fitnesse.feature.group, org.idempiere.equinox.p2.director.feature.group"
@call %DESTINATION%\update-prd %1 %INSTALL_UI% %UNINSTALL_UI%
copy idempiere.ini.sav idempiere.ini

View File

@ -33,7 +33,10 @@ then
cp jettyhome/etc/jetty-selector.xml jetty-selector.xml.sav
fi
$DESTINATION/update-prd.sh $1 org.adempiere.server.product
UNINSTALL_UI="org.adempiere.server.product, org.idempiere.fitnesse.feature.group"
INSTALL_UI="org.adempiere.server.product, org.eclipse.equinox.p2.director, org.idempiere.fitnesse.feature.group, org.idempiere.equinox.p2.director.feature.group"
$DESTINATION/update-prd.sh $1 "$INSTALL_UI" "$UNINSTALL_UI"
cp idempiere.ini.sav idempiere.ini

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/calendar.jar"/>
<classpathentry exported="true" kind="lib" path="lib/ckez.jar"/>
<classpathentry exported="true" kind="lib" path="lib/gmapsz.jar"/>
<classpathentry exported="true" kind="lib" path="lib/timelinez.jar"/>
<classpathentry exported="true" kind="lib" path="lib/timeplotz.jar"/>

View File

@ -5,13 +5,11 @@ Bundle-SymbolicName: org.idempiere.zk.extra
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ClassPath: lib/calendar.jar,
lib/ckez.jar,
lib/gmapsz.jar,
lib/timelinez.jar,
lib/timeplotz.jar,
.
Export-Package: metainfo.zk,
org.zkforge.ckez,
org.zkforge.json.simple,
org.zkforge.json.simple.parser,
org.zkforge.timeline,
@ -31,63 +29,11 @@ Export-Package: metainfo.zk,
org.zkoss.gmaps,
org.zkoss.gmaps.event,
org.zkoss.zul.impl,
web.ckez.html,
web.ckez.img,
web.js.calendar,
web.js.calendar.css,
web.js.calendar.img,
web.js.calendar.lang,
web.js.calendar.mold,
web.js.ckez,
web.js.ckez.ext.CKeditor,
web.js.ckez.ext.CKeditor.adapters,
web.js.ckez.ext.CKeditor.lang,
web.js.ckez.ext.CKeditor.plugins,
web.js.ckez.ext.CKeditor.plugins.a11yhelp.dialogs,
web.js.ckez.ext.CKeditor.plugins.a11yhelp.dialogs.lang,
web.js.ckez.ext.CKeditor.plugins.about.dialogs,
web.js.ckez.ext.CKeditor.plugins.about.dialogs.hidpi,
web.js.ckez.ext.CKeditor.plugins.colordialog.dialogs,
web.js.ckez.ext.CKeditor.plugins.copyformatting.cursors,
web.js.ckez.ext.CKeditor.plugins.copyformatting.styles,
web.js.ckez.ext.CKeditor.plugins.dialog,
web.js.ckez.ext.CKeditor.plugins.div.dialogs,
web.js.ckez.ext.CKeditor.plugins.find.dialogs,
web.js.ckez.ext.CKeditor.plugins.flash.dialogs,
web.js.ckez.ext.CKeditor.plugins.flash.images,
web.js.ckez.ext.CKeditor.plugins.forms.dialogs,
web.js.ckez.ext.CKeditor.plugins.forms.images,
web.js.ckez.ext.CKeditor.plugins.iframe.dialogs,
web.js.ckez.ext.CKeditor.plugins.iframe.images,
web.js.ckez.ext.CKeditor.plugins.image.dialogs,
web.js.ckez.ext.CKeditor.plugins.image.images,
web.js.ckez.ext.CKeditor.plugins.link.dialogs,
web.js.ckez.ext.CKeditor.plugins.link.images,
web.js.ckez.ext.CKeditor.plugins.link.images.hidpi,
web.js.ckez.ext.CKeditor.plugins.liststyle.dialogs,
web.js.ckez.ext.CKeditor.plugins.magicline.images,
web.js.ckez.ext.CKeditor.plugins.magicline.images.hidpi,
web.js.ckez.ext.CKeditor.plugins.pagebreak.images,
web.js.ckez.ext.CKeditor.plugins.pastefromword.filter,
web.js.ckez.ext.CKeditor.plugins.preview,
web.js.ckez.ext.CKeditor.plugins.scayt,
web.js.ckez.ext.CKeditor.plugins.scayt.dialogs,
web.js.ckez.ext.CKeditor.plugins.scayt.skins,
web.js.ckez.ext.CKeditor.plugins.showblocks.images,
web.js.ckez.ext.CKeditor.plugins.smiley.dialogs,
web.js.ckez.ext.CKeditor.plugins.smiley.images,
web.js.ckez.ext.CKeditor.plugins.specialchar.dialogs,
web.js.ckez.ext.CKeditor.plugins.specialchar.dialogs.lang,
web.js.ckez.ext.CKeditor.plugins.table.dialogs,
web.js.ckez.ext.CKeditor.plugins.tableselection.styles,
web.js.ckez.ext.CKeditor.plugins.tabletools.dialogs,
web.js.ckez.ext.CKeditor.plugins.templates.dialogs,
web.js.ckez.ext.CKeditor.plugins.templates.templates,
web.js.ckez.ext.CKeditor.plugins.templates.templates.images,
web.js.ckez.ext.CKeditor.plugins.wsc,
web.js.ckez.ext.CKeditor.plugins.wsc.dialogs,
web.js.ckez.ext.CKeditor.plugins.wsc.skins,
web.js.ckez.ext.CKeditor.skins,
web.js.gmaps,
web.js.gmaps.css,
web.js.gmaps.ext,
@ -133,4 +79,3 @@ Import-Package: javax.servlet;version="3.1.0",
javax.servlet.descriptor;version="3.1.0",
javax.servlet.http;version="3.1.0",
org.slf4j;version="1.7.2"
Eclipse-BuddyPolicy: registered

View File

@ -3,7 +3,6 @@ output.. = bin/
bin.includes = META-INF/,\
.,\
lib/calendar.jar,\
lib/ckez.jar,\
lib/gmapsz.jar,\
lib/timelinez.jar,\
lib/timeplotz.jar

View File

@ -1,7 +1,6 @@
<project name="zklibrary" basedir="." default="copy">
<target name="copy">
<mkdir dir="lib" />
<get src="${url.maven.zkoss.lib}/maven2/org/zkoss/zkforge/ckez/4.7.0.0/ckez-4.7.0.0.jar" dest="lib/ckez.jar" usetimestamp="true" verbose="true" retries="5" />
<mkdir dir="lib" />
<get src="${url.maven.zkoss.lib}/maven2/org/zkoss/zkforge/gmapsz/3.0.3/gmapsz-3.0.3.jar" dest="lib/gmapsz.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="${url.maven.zkoss.lib}/maven2/org/zkoss/zkforge/timelinez/2.3.1_50/timelinez-2.3.1_50.jar" dest="lib/timelinez.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="${url.maven.zkoss.lib}/maven2/org/zkoss/zkforge/timeplotz/1.1_50/timeplotz-1.1_50.jar" dest="lib/timeplotz.jar" usetimestamp="true" verbose="true" retries="5" />