Merged release-1.0c into development

This commit is contained in:
Carlos Ruiz 2013-10-23 11:12:01 -05:00
commit 7f4a8d08ae
11 changed files with 533 additions and 27 deletions

View File

@ -0,0 +1,21 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Oct 23, 2013 6:07:31 PM MYT
-- 1003373 Lookup Box on Dashboard Preference window doesn't have fields
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_DATE('2013-10-23 18:07:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200327
;
-- Oct 23, 2013 6:07:44 PM MYT
-- 1003373 Lookup Box on Dashboard Preference window doesn't have fields
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_DATE('2013-10-23 18:07:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200328
;
-- Oct 23, 2013 6:08:14 PM MYT
-- 1003373 Lookup Box on Dashboard Preference window doesn't have fields
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_DATE('2013-10-23 18:08:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200350
;
SELECT register_migration_script('201310230810_1003373.sql') FROM dual
;

View File

@ -0,0 +1,18 @@
-- Oct 23, 2013 6:07:31 PM MYT
-- 1003373 Lookup Box on Dashboard Preference window doesn't have fields
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2013-10-23 18:07:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200327
;
-- Oct 23, 2013 6:07:44 PM MYT
-- 1003373 Lookup Box on Dashboard Preference window doesn't have fields
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2013-10-23 18:07:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200328
;
-- Oct 23, 2013 6:08:14 PM MYT
-- 1003373 Lookup Box on Dashboard Preference window doesn't have fields
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2013-10-23 18:08:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200350
;
SELECT register_migration_script('201310230810_1003373.sql') FROM dual
;

View File

@ -842,7 +842,7 @@ public class MPrintFormat extends X_AD_PrintFormat
// Get Column List from Tab // Get Column List from Tab
String sql = "SELECT AD_Column_ID " //, Name, IsDisplayed, SeqNo String sql = "SELECT AD_Column_ID " //, Name, IsDisplayed, SeqNo
+ "FROM AD_Field " + "FROM AD_Field "
+ "WHERE AD_Tab_ID=(SELECT MIN(AD_Tab_ID) FROM AD_Tab WHERE AD_Table_ID=?)" + "WHERE IsActive='Y' AND AD_Tab_ID=(SELECT MIN(AD_Tab_ID) FROM AD_Tab WHERE AD_Table_ID=? AND IsActive='Y')"
+ " AND IsEncrypted='N' AND ObscureType IS NULL " + " AND IsEncrypted='N' AND ObscureType IS NULL "
+ " AND AD_Column_ID NOT IN (SELECT pfi.AD_Column_ID FROM AD_PrintFormatItem pfi WHERE pfi.AD_PrintFormat_ID=? AND pfi.AD_Column_ID IS NOT NULL) " + " AND AD_Column_ID NOT IN (SELECT pfi.AD_Column_ID FROM AD_PrintFormatItem pfi WHERE pfi.AD_PrintFormat_ID=? AND pfi.AD_Column_ID IS NOT NULL) "
+ "ORDER BY COALESCE(IsDisplayed,'N') DESC, SortNo, SeqNo, Name"; + "ORDER BY COALESCE(IsDisplayed,'N') DESC, SortNo, SeqNo, Name";
@ -879,7 +879,7 @@ public class MPrintFormat extends X_AD_PrintFormat
s_log.fine("From Table ..."); s_log.fine("From Table ...");
sql = "SELECT AD_Column_ID " sql = "SELECT AD_Column_ID "
+ "FROM AD_Column " + "FROM AD_Column "
+ "WHERE AD_Table_ID=? " + "WHERE IsActive='Y' AND AD_Table_ID=? "
+ " AND AD_Column_ID NOT IN (SELECT pfi.AD_Column_ID FROM AD_PrintFormatItem pfi WHERE pfi.AD_PrintFormat_ID=? AND pfi.AD_Column_ID IS NOT NULL) " + " AND AD_Column_ID NOT IN (SELECT pfi.AD_Column_ID FROM AD_PrintFormatItem pfi WHERE pfi.AD_PrintFormat_ID=? AND pfi.AD_Column_ID IS NOT NULL) "
+ "ORDER BY IsIdentifier DESC, SeqNo, Name"; + "ORDER BY IsIdentifier DESC, SeqNo, Name";
try try

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,437 @@
(function () {
var _decs = {lt: '<', gt: '>', amp: '&', quot: '"'},
_encs = {};
for (var v in _decs)
_encs[_decs[v]] = v;
function _pathname(url) {
var j = url.indexOf("//");
if (j > 0) {
j = url.indexOf("/", j + 2);
if (j > 0) return url.substring(j);
}
}
function _frames(ary, w) {
ary.push(w);
for (var fs = w.frames, j = 0, l = fs.length; j < l; ++j)
_frames(ary, fs[j]);
}
function _onSizeTarget(wgt) {
var r1 = wgt, p1 = r1,
j1 = -1;
for (; p1 && p1._hflex == 'min'; p1 = p1.parent) {
delete p1._hflexsz;
r1 = p1;
++j1;
if (p1.ignoreFlexSize_('w'))
break;
}
var r2 = wgt, p2 = r2,
j2 = -1;
for (; p2 && p2._vflex == 'min'; p2 = p2.parent) {
delete p2._vflexsz;
r2 = p2;
++j2;
if (p2.ignoreFlexSize_('h'))
break;
}
return j1 > 0 || j2 > 0 ? j1 > j2 ? r1 : r2: wgt;
}
zUtl = {
isChar: function (cc, opts) {
return (opts.digit && cc >= '0' && cc <= '9')
|| (opts.upper && cc >= 'A' && cc <= 'Z')
|| (opts.lower && cc >= 'a' && cc <= 'z')
|| (opts.whitespace && (cc == ' ' || cc == '\t' || cc == '\n' || cc == '\r'))
|| opts[cc];
},
parseMap: function (text, separator, quote) {
var map = {};
if (text) {
var ps = text.split(separator || ',');
if (quote) {
var tmp = [],
re = new RegExp(quote, 'g'),
key = '', t, pair;
while((t = ps.shift()) !== undefined) {
if ((pair = (key += t).match(re)) && pair.length != 1) {
if (key)
tmp.push(key);
key = '';
} else
key += separator;
}
ps = tmp;
}
for (var len = ps.length; len--;) {
var key = ps[len].trim(),
index = key.indexOf('=');
if (index != -1)
map[key.substring(0, index)] = key.substring(index + 1, key.length).trim();
}
}
return map;
},
encodeXML: function (txt, opts) {
txt = txt != null ? String(txt):'';
var tl = txt.length,
pre = opts && opts.pre,
multiline = pre || (opts && opts.multiline),
maxlength = opts ? opts.maxlength : 0;
if (!multiline && maxlength && tl > maxlength) {
var j = maxlength;
while (j > 0 && txt.charAt(j - 1) == ' ')
--j;
opts.maxlength = 0;
return zUtl.encodeXML(txt.substring(0, j) + '...', opts);
}
var out = [], k = 0, enc;
if (multiline || pre)
for (var j = 0; j < tl; ++j) {
var cc = txt.charAt(j);
if (enc = _encs[cc]) {
out.push(txt.substring(k, j), '&', enc, ';');
k = j + 1;
} else if (multiline && cc == '\n') {
out.push(txt.substring(k, j), "<br/>\n");
k = j + 1;
} else if (pre && (cc == ' ' || cc == '\t')) {
out.push(txt.substring(k, j), "&nbsp;");
if (cc == '\t')
out.push("&nbsp;&nbsp;&nbsp;");
k = j + 1;
}
}
else
for (var j = 0; j < tl; ++j)
if (enc = _encs[txt.charAt(j)]) {
out.push(txt.substring(k, j), '&', enc, ';');
k = j + 1;
}
if (!k) return txt;
if (k < tl)
out.push(txt.substring(k));
return out.join('');
},
decodeXML: function (txt) {
var out = "";
if (!txt) return out;
var k = 0, tl = txt.length;
for (var j = 0; j < tl; ++j) {
var cc = txt.charAt(j);
if (cc == '&') {
var l = txt.indexOf(';', j + 1);
if (l >= 0) {
var dec = txt.charAt(j + 1) == '#' ?
String.fromCharCode(txt.charAt(j + 2).toLowerCase() == 'x' ?
parseInt(txt.substring(j + 3, l), 16):
parseInt(txt.substring(j + 2, l), 10)):
_decs[txt.substring(j + 1, l)];
if (dec) {
out += txt.substring(k, j) + dec;
k = (j = l) + 1;
}
}
}
}
return !k ? txt:
k < tl ? out + txt.substring(k): out;
},
cellps0: ' cellpadding="0" cellspacing="0" border="0"',
img0: '<img style="height:0;width:0"/>',
i0: '<i style="height:0;width:0"/>',
now: jq.now,
today: function (fmt) {
var d = new Date(), hr = 0, min = 0, sec = 0, msec = 0;
if (typeof fmt == "string") {
var fmt0 = fmt.toLowerCase();
if (fmt0.indexOf('h') >= 0 || fmt0.indexOf('k') >= 0) hr = d.getHours();
if (fmt.indexOf('m') >= 0) min = d.getMinutes();
if (fmt.indexOf('s') >= 0) sec = d.getSeconds();
if (fmt.indexOf('S') >= 0) msec = d.getMilliseconds();
} else if (fmt)
return d;
return new Date(d.getFullYear(), d.getMonth(), d.getDate(),
hr, min, sec, msec);
},
isAncestor: function (p, c) {
if (!p) return true;
for (; c; c = c.getParent ? c.getParent(): c.parent)
if (p == c)
return true;
return false;
},
progressbox: function (id, msg, mask, icon, _opts) {
if (mask && zk.Page.contained.length) {
for (var c = zk.Page.contained.length, e = zk.Page.contained[--c]; e; e = zk.Page.contained[--c]) {
if (!e._applyMask)
e._applyMask = new zk.eff.Mask({
id: e.uuid + "-mask",
message: msg,
anchor: e.$n()
});
}
return;
}
if (_opts && _opts.busy) {
zk.busy++;
jq.focusOut();
}
var x = jq.innerX(), y = jq.innerY(),
style = ' style="left:'+x+'px;top:'+y+'px"',
idtxt = id + '-t',
idmsk = id + '-m',
html = '<div id="'+id+'"';
if (mask)
html += '><div id="' + idmsk + '" class="z-modal-mask"'+style+'></div';
html += '><div id="'+idtxt+'" class="z-loading"'+style
+'><div class="z-loading-indicator"><span class="z-loading-icon"></span> '
+msg+'</div></div>';
if (icon)
html += '<div class="' + icon + '"></div>';
jq(document.body).append(html + '</div>');
var $n = jq(id, zk),
n = $n[0],
$txt = jq(idtxt, zk),
txt = $txt[0],
st = txt.style;
if (mask)
n.z_mask = new zk.eff.FullMask({
mask: jq(idmsk, zk)[0],
zIndex: $txt.css('z-index') - 1
});
if (mask && $txt.length) {
st.left = jq.px((jq.innerWidth() - txt.offsetWidth) / 2 + x);
st.top = jq.px((jq.innerHeight() - txt.offsetHeight) / 2 + y);
} else {
var pos = zk.progPos;
if (pos) {
var left,
top,
width = jq.innerWidth(),
height = jq.innerHeight(),
wdgap = width - zk(txt).offsetWidth(),
hghgap = height - zk(txt).offsetHeight();
if (pos.indexOf("mouse") >= 0) {
var offset = zk.currentPointer;
left = offset[0] + 10;
top = offset[1] + 10;
} else {
if (pos.indexOf("left") >= 0) left = x;
else if (pos.indexOf("right") >= 0) left = x + wdgap -1;
else if (pos.indexOf("center") >= 0) left = x + wdgap / 2;
else left = 0;
if (pos.indexOf("top") >= 0) top = y;
else if (pos.indexOf("bottom") >= 0) top = y + hghgap - 1;
else if (pos.indexOf("center") >= 0) top = y + hghgap / 2;
else top = 0;
left = left < x ? x : left;
top = top < y ? y : top;
}
st.left = jq.px(left);
st.top = jq.px(top);
}
}
$n.zk.cleanVisibility();
},
destroyProgressbox: function (id, _opts) {
if (_opts && _opts.busy && --zk.busy < 0)
zk.busy = 0;
var $n = jq(id, zk), n;
if ($n.length) {
if (n = $n[0].z_mask) n.destroy();
$n.remove();
}
for (var c = zk.Page.contained.length, e = zk.Page.contained[--c]; e; e = zk.Page.contained[--c])
if (e._applyMask) {
e._applyMask.destroy();
e._applyMask = null;
}
},
go: function (url, opts) {
opts = opts || {};
if (opts.target) {
open(url, opts.target);
} else if (opts.overwrite) {
location.replace(url ? url: location.href);
} else {
if (url) {
location.href = url;
var j = url.indexOf('#');
if(j < 0)
return;
var un = j >= 0 ? url.substring(0, j): url,
pn = _pathname(location.href);
j = pn.indexOf('#');
if (j >= 0) pn = pn.substring(0, j);
if (pn != un)
return;
}
location.reload();
}
},
frames: function (w) {
var ary = [];
_frames(ary, w);
return ary;
},
intsToString: function (ary) {
if (!ary) return "";
var sb = [];
for (var j = 0, k = ary.length; j < k; ++j)
sb.push(ary[j]);
return sb.join();
},
stringToInts: function (text, defaultValue) {
if (text == null)
return null;
var list = [];
for (var j = 0;;) {
var k = text.indexOf(',', j),
s = (k >= 0 ? text.substring(j, k): text.substring(j)).trim();
if (s.length == 0) {
if (k < 0) break;
list.push(defaultValue);
} else
list.push(zk.parseInt(s));
if (k < 0) break;
j = k + 1;
}
return list;
},
mapToString: function (map, assign, separator) {
assign = assign || '=';
separator = separator || ' ';
var out = [];
for (var v in map)
out.push(separator, v, assign, map[v]);
out[0] = '';
return out.join('');
},
appendAttr: function (nm, val, force) {
return val || force ? ' ' + nm + '="' + val + '"': "";
},
fireSized: function (wgt, bfsz) {
if (zUtl.isImageLoading() || zk.clientinfo) {
var f = arguments.callee;
setTimeout(function () {
return f(wgt, bfsz);
}, 20);
return;
}
wgt = _onSizeTarget(wgt);
if (!(bfsz < 0))
zWatch.fireDown('beforeSize', wgt, null, bfsz > 0);
zWatch.fireDown('onFitSize', wgt, {reverse: true});
zWatch.fireDown('onSize', wgt);
},
fireShown: function (wgt, bfsz) {
zWatch.fireDown('onShow', wgt);
zUtl.fireSized(wgt, bfsz);
},
loadImage: function (url) {
if (!_imgMap[url]) {
_imgMap[url] = true;
_loadImage(url);
}
},
isImageLoading: function () {
for (var img in _imgObjectMap) {
if (img.complete) {
try {
delete _imgMap[img.src];
} catch (err) {}
try {
delete _imgObjectMap[img.src];
} catch (err) {}
}
}
for (var n in _imgMap) {
return true;
}
return false;
}
};
var _imgMap = {};
var _imgObjectMap = {};
function _loadImage(url) {
var img = new Image(),
f = function () {
try {
delete _imgMap[url];
} catch (err) {}
try {
delete _imgObjectMap[url];
} catch (err) {}
};
_imgObjectMap[url]=img;
img.onerror = img.onload = img.onabort = f;
img.src = url;
}
})();

View File

@ -311,8 +311,7 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
if (gridTab.isTreeTab()) if (gridTab.isTreeTab())
AD_Tree_ID = MTree.getDefaultAD_Tree_ID ( AD_Tree_ID = MTree.getDefaultAD_Tree_ID (
Env.getAD_Client_ID(Env.getCtx()), gridTab.getKeyColumnName()); Env.getAD_Client_ID(Env.getCtx()), gridTab.getKeyColumnName());
if (gridTab.isTreeTab() && AD_Tree_ID != 0)
{
StringBuilder cssContent = new StringBuilder(); StringBuilder cssContent = new StringBuilder();
cssContent.append(".adtab-form-borderlayout .z-south-colpsd:before { "); cssContent.append(".adtab-form-borderlayout .z-south-colpsd:before { ");
cssContent.append("content: \""); cssContent.append("content: \"");
@ -327,6 +326,8 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
style.setContent(cssContent.toString()); style.setContent(cssContent.toString());
appendChild(style); appendChild(style);
if (gridTab.isTreeTab() && AD_Tree_ID != 0)
{
Borderlayout layout = new Borderlayout(); Borderlayout layout = new Borderlayout();
layout.setParent(this); layout.setParent(this);
layout.setSclass("adtab-form-borderlayout"); layout.setSclass("adtab-form-borderlayout");

View File

@ -73,10 +73,11 @@ public class Tabpanel extends org.zkoss.zul.Tabpanel implements IdSpace
} }
public void onClose() { public void onClose() {
if (onCloseHandler != null) if (onCloseHandler != null) {
onCloseHandler.onClose(this); onCloseHandler.onClose(this);
else { } else {
Tab tab = this.getLinkedTab(); Tab tab = this.getLinkedTab();
if (tab != null)
tab.close(); tab.close();
} }
} }

View File

@ -30,7 +30,9 @@ import java.util.Map;
import java.util.Properties; import java.util.Properties;
import java.util.TimeZone; import java.util.TimeZone;
import org.adempiere.webui.component.Tabpanel;
import org.adempiere.webui.component.Window; import org.adempiere.webui.component.Window;
import org.adempiere.webui.panel.ITabOnCloseHandler;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager; import org.adempiere.webui.theme.ThemeManager;
import org.compiere.model.MSysConfig; import org.compiere.model.MSysConfig;
@ -64,6 +66,7 @@ import org.zkoss.zul.Listbox;
import org.zkoss.zul.Listitem; import org.zkoss.zul.Listitem;
import org.zkoss.zul.Popup; import org.zkoss.zul.Popup;
import org.zkoss.zul.Span; import org.zkoss.zul.Span;
import org.zkoss.zul.Tab;
import org.zkoss.zul.Timer; import org.zkoss.zul.Timer;
import org.zkoss.zul.Toolbarbutton; import org.zkoss.zul.Toolbarbutton;
@ -72,12 +75,12 @@ import org.zkoss.zul.Toolbarbutton;
* @author Elaine * @author Elaine
* *
*/ */
public class CalendarWindow extends Window implements EventListener<Event> { public class CalendarWindow extends Window implements EventListener<Event>, ITabOnCloseHandler {
/** /**
* *
*/ */
private static final long serialVersionUID = 5620139733919619691L; private static final long serialVersionUID = 1576992746053720647L;
private Calendars calendars; private Calendars calendars;
private SimpleCalendarModel scm; private SimpleCalendarModel scm;
private Toolbarbutton btnRefresh; private Toolbarbutton btnRefresh;
@ -185,6 +188,19 @@ public class CalendarWindow extends Window implements EventListener<Event> {
calendars.addEventListener("onMouseOver", this); calendars.addEventListener("onMouseOver", this);
SessionManager.getAppDesktop().showWindow(this); 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);
}
}
public void onClose(Tabpanel tabPanel){
//IDEMPIERE-1457: On close, remove calendars away scm
calendars.setModel(null);
Tab tab = tabPanel.getLinkedTab();
tab.close();
} }
public void onEvent(Event e) throws Exception { public void onEvent(Event e) throws Exception {
@ -231,7 +247,7 @@ public class CalendarWindow extends Window implements EventListener<Event> {
ArrayList<ADCalendarEvent> events = DPCalendar.getEvents(R_RequestType_ID, Env.getCtx()); ArrayList<ADCalendarEvent> events = DPCalendar.getEvents(R_RequestType_ID, Env.getCtx());
for (ADCalendarEvent event : events) for (ADCalendarEvent event : events)
scm.add(event); scm.add(event);
calendars.setModel(scm);
calendars.invalidate(); calendars.invalidate();
syncModel(); syncModel();
} }
@ -368,7 +384,7 @@ public class CalendarWindow extends Window implements EventListener<Event> {
ArrayList<ADCalendarEvent> events = DPCalendar.getEvents(R_RequestType_ID, Env.getCtx()); ArrayList<ADCalendarEvent> events = DPCalendar.getEvents(R_RequestType_ID, Env.getCtx());
for (ADCalendarEvent event : events) for (ADCalendarEvent event : events)
scm.add(event); scm.add(event);
calendars.setModel(scm);
calendars.invalidate(); calendars.invalidate();
syncModel(); syncModel();
} }

View File

@ -373,10 +373,15 @@ public class DPCalendar extends DashboardPanel implements EventListener<Event>,
@Override @Override
public void updateUI() { public void updateUI() {
if (scm == null) {
scm = new SimpleCalendarModel(); scm = new SimpleCalendarModel();
calendars.setModel(scm);
}
scm.clear();
for (ADCalendarEvent event : events) for (ADCalendarEvent event : events)
scm.add(event); scm.add(event);
calendars.setModel(scm);
calendars.invalidate(); calendars.invalidate();
} }

View File

@ -21,5 +21,7 @@ import org.adempiere.webui.component.Tabpanel;
* *
*/ */
public interface ITabOnCloseHandler { public interface ITabOnCloseHandler {
/* NOTE onClose method must implement the actual closing of the tab */
public void onClose(Tabpanel tabPanel); public void onClose(Tabpanel tabPanel);
} }

View File

@ -89,6 +89,10 @@
<name>org.zkoss.zul.borderlayout.animation.disabed</name> <name>org.zkoss.zul.borderlayout.animation.disabed</name>
<value>true</value> <value>true</value>
</library-property> </library-property>
<library-property>
<name>org.zkoss.web.util.resource.dir</name>
<value>/WEB-INF/cwr</value>
</library-property>
<preference> <preference>
<name>org.zkoss.zk.ui.WebApp.name</name> <name>org.zkoss.zk.ui.WebApp.name</name>