From c8a6843a92a556315b85e6b3f4ed1bebdfd2e35d Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 9 Feb 2006 07:18:08 +0000 Subject: update jscalendar --- httemplate/elements/calendar-en.js | 10 +- httemplate/elements/calendar-setup.js | 45 ++- httemplate/elements/calendar-win2k-2.css | 1 + httemplate/elements/calendar.js | 653 ++++++++++++++++++------------- httemplate/elements/calendar_stripped.js | 12 +- 5 files changed, 419 insertions(+), 302 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/calendar-en.js b/httemplate/elements/calendar-en.js index e9d6a222e..0dbde793d 100644 --- a/httemplate/elements/calendar-en.js +++ b/httemplate/elements/calendar-en.js @@ -1,7 +1,7 @@ // ** I18N // Calendar EN language -// Author: Mihai Bazon, +// Author: Mihai Bazon, // Encoding: any // Distributed under the same terms as the calendar itself. @@ -43,6 +43,10 @@ Calendar._SDN = new Array "Sat", "Sun"); +// First day of the week. "0" means display Sunday first, "1" means display +// Monday first, etc. +Calendar._FD = 0; + // full month names Calendar._MN = new Array ("January", @@ -79,8 +83,8 @@ Calendar._TT["INFO"] = "About the calendar"; Calendar._TT["ABOUT"] = "DHTML Date/Time Selector\n" + -"(c) dynarch.com 2002-2003\n" + // don't translate this this ;-) -"For latest version visit: http://dynarch.com/mishoo/calendar.epl\n" + +"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) +"For latest version visit: http://www.dynarch.com/projects/calendar/\n" + "Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + "\n\n" + "Date selection:\n" + diff --git a/httemplate/elements/calendar-setup.js b/httemplate/elements/calendar-setup.js index 55e22b933..b27d9bed0 100644 --- a/httemplate/elements/calendar-setup.js +++ b/httemplate/elements/calendar-setup.js @@ -19,7 +19,7 @@ * than modifying calendar.js itself). */ -// $Id: calendar-setup.js,v 1.4 2004-09-22 11:04:41 ivan Exp $ +// $Id: calendar-setup.js,v 1.5 2006-02-09 07:18:08 ivan Exp $ /** * This function "patches" an input field (or other element) to use a calendar @@ -71,7 +71,8 @@ Calendar.setup = function (params) { param_default("singleClick", true); param_default("disableFunc", null); param_default("dateStatusFunc", params["disableFunc"]); // takes precedence if both are defined - param_default("firstDay", 0); // defaults to "Sunday" first + param_default("dateText", null); + param_default("firstDay", null); param_default("align", "Br"); param_default("range", [1900, 2999]); param_default("weekNumbers", true); @@ -88,6 +89,7 @@ Calendar.setup = function (params) { param_default("position", null); param_default("cache", false); param_default("showOthers", false); + param_default("multiple", null); var tmp = ["inputField", "displayArea", "button"]; for (var i in tmp) { @@ -95,7 +97,7 @@ Calendar.setup = function (params) { params[tmp[i]] = document.getElementById(params[tmp[i]]); } } - if (!(params.flat || params.inputField || params.displayArea || params.button)) { + if (!(params.flat || params.multiple || params.inputField || params.displayArea || params.button)) { alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code"); return false; } @@ -103,13 +105,6 @@ Calendar.setup = function (params) { function onSelect(cal) { var p = cal.params; var update = (cal.dateClicked || p.electric); - if (update && p.flat) { - if (typeof p.flatCallback == "function") - p.flatCallback(cal); - else - alert("No flatCallback given -- doing nothing."); - return false; - } if (update && p.inputField) { p.inputField.value = cal.date.print(p.ifFormat); if (typeof p.inputField.onchange == "function") @@ -117,10 +112,14 @@ Calendar.setup = function (params) { } if (update && p.displayArea) p.displayArea.innerHTML = cal.date.print(p.daFormat); - if (update && p.singleClick && cal.dateClicked) - cal.callCloseHandler(); if (update && typeof p.onUpdate == "function") p.onUpdate(cal); + if (update && p.flat) { + if (typeof p.flatCallback == "function") + p.flatCallback(cal); + } + if (update && p.singleClick && cal.dateClicked) + cal.callCloseHandler(); }; if (params.flat != null) { @@ -131,12 +130,20 @@ Calendar.setup = function (params) { return false; } var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect); + cal.showsOtherMonths = params.showOthers; cal.showsTime = params.showsTime; cal.time24 = (params.timeFormat == "24"); cal.params = params; cal.weekNumbers = params.weekNumbers; cal.setRange(params.range[0], params.range[1]); cal.setDateStatusHandler(params.dateStatusFunc); + cal.getDateText = params.dateText; + if (params.ifFormat) { + cal.setDateFormat(params.ifFormat); + } + if (params.inputField && typeof params.inputField.value == "string") { + cal.parseDate(params.inputField.value); + } cal.create(params.flat); cal.show(); return false; @@ -148,6 +155,8 @@ Calendar.setup = function (params) { var dateFmt = params.inputField ? params.ifFormat : params.daFormat; var mustCreate = false; var cal = window.calendar; + if (dateEl) + params.date = Date.parseDate(dateEl.value || dateEl.innerHTML, dateFmt); if (!(cal && params.cache)) { window.calendar = cal = new Calendar(params.firstDay, params.date, @@ -162,15 +171,23 @@ Calendar.setup = function (params) { cal.setDate(params.date); cal.hide(); } + if (params.multiple) { + cal.multiple = {}; + for (var i = params.multiple.length; --i >= 0;) { + var d = params.multiple[i]; + var ds = d.print("%Y%m%d"); + cal.multiple[ds] = d; + } + } cal.showsOtherMonths = params.showOthers; cal.yearStep = params.step; cal.setRange(params.range[0], params.range[1]); cal.params = params; cal.setDateStatusHandler(params.dateStatusFunc); + cal.getDateText = params.dateText; cal.setDateFormat(dateFmt); if (mustCreate) cal.create(); - cal.parseDate(dateEl.value || dateEl.innerHTML); cal.refresh(); if (!params.position) cal.showAtElement(params.button || params.displayArea || params.inputField, params.align); @@ -178,4 +195,6 @@ Calendar.setup = function (params) { cal.showAt(params.position[0], params.position[1]); return false; }; + + return cal; }; diff --git a/httemplate/elements/calendar-win2k-2.css b/httemplate/elements/calendar-win2k-2.css index 6001cfaa4..6f37b7dcd 100644 --- a/httemplate/elements/calendar-win2k-2.css +++ b/httemplate/elements/calendar-win2k-2.css @@ -206,6 +206,7 @@ background: #e4d8e0; font-size: 90%; padding: 1px; + z-index: 100; } .calendar .combo .label, diff --git a/httemplate/elements/calendar.js b/httemplate/elements/calendar.js index ec18d80ce..f5c74f608 100644 --- a/httemplate/elements/calendar.js +++ b/httemplate/elements/calendar.js @@ -1,16 +1,18 @@ -/* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/ - * ------------------------------------------------------------------ +/* Copyright Mihai Bazon, 2002-2005 | www.bazon.net/mishoo + * ----------------------------------------------------------- * - * The DHTML Calendar, version 0.9.6 "Keep cool but don't freeze" + * The DHTML Calendar, version 1.0 "It is happening again" * * Details and latest version at: - * http://dynarch.com/mishoo/calendar.epl + * www.dynarch.com/projects/calendar + * + * This script is developed by Dynarch.com. Visit us at www.dynarch.com. * * This script is distributed under the GNU Lesser General Public License. * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html */ -// $Id: calendar.js,v 1.4 2004-09-22 11:04:41 ivan Exp $ +// $Id: calendar.js,v 1.5 2006-02-09 07:18:08 ivan Exp $ /** The Calendar object constructor. */ Calendar = function (firstDayOfWeek, dateStr, onSelected, onClose) { @@ -18,6 +20,8 @@ Calendar = function (firstDayOfWeek, dateStr, onSelected, onClose) { this.activeDiv = null; this.currentDateEl = null; this.getDateStatus = null; + this.getDateToolTip = null; + this.getDateText = null; this.timeout = null; this.onSelected = onSelected || null; this.onClose = onClose || null; @@ -29,13 +33,15 @@ Calendar = function (firstDayOfWeek, dateStr, onSelected, onClose) { this.ttDateFormat = Calendar._TT["TT_DATE_FORMAT"]; this.isPopup = true; this.weekNumbers = true; - this.firstDayOfWeek = firstDayOfWeek; // 0 for Sunday, 1 for Monday, etc. + this.firstDayOfWeek = typeof firstDayOfWeek == "number" ? firstDayOfWeek : Calendar._FD; // 0 for Sunday, 1 for Monday, etc. this.showsOtherMonths = false; this.dateStr = dateStr; this.ar_days = null; this.showsTime = false; this.time24 = true; this.yearStep = 2; + this.hiliteToday = true; + this.multiple = null; // HTML elements this.table = null; this.element = null; @@ -146,20 +152,19 @@ Calendar.addClass = function(el, className) { el.className += " " + className; }; +// FIXME: the following 2 functions totally suck, are useless and should be replaced immediately. Calendar.getElement = function(ev) { - if (Calendar.is_ie) { - return window.event.srcElement; - } else { - return ev.currentTarget; - } + var f = Calendar.is_ie ? window.event.srcElement : ev.currentTarget; + while (f.nodeType != 1 || /^div$/i.test(f.tagName)) + f = f.parentNode; + return f; }; Calendar.getTargetElement = function(ev) { - if (Calendar.is_ie) { - return window.event.srcElement; - } else { - return ev.target; - } + var f = Calendar.is_ie ? window.event.srcElement : ev.target; + while (f.nodeType != 1) + f = f.parentNode; + return f; }; Calendar.stopEvent = function(ev) { @@ -295,7 +300,7 @@ Calendar.showYearsCombo = function (fwd) { var show = false; for (var i = 12; i > 0; --i) { if (Y >= cal.minYear && Y <= cal.maxYear) { - yr.firstChild.data = Y; + yr.innerHTML = Y; yr.year = Y; yr.style.display = "block"; show = true; @@ -416,7 +421,7 @@ Calendar.tableMouseOver = function (ev) { } else if ( ++i >= range.length ) i = 0; var newval = range[i]; - el.firstChild.data = newval; + el.innerHTML = newval; cal.onUpdateTime(); } @@ -504,7 +509,7 @@ Calendar.dayMouseDown = function(ev) { Calendar._C = cal; if (el.navtype != 300) with (Calendar) { if (el.navtype == 50) { - el._current = el.firstChild.data; + el._current = el.innerHTML; addEvent(document, "mousemove", tableMouseOver); } else addEvent(document, Calendar.is_ie5 ? "mousemove" : "mouseover", tableMouseOver); @@ -541,7 +546,7 @@ Calendar.dayMouseOver = function(ev) { if (el.ttip.substr(0, 1) == "_") { el.ttip = el.caldate.print(el.calendar.ttDateFormat) + el.ttip.substr(1); } - el.calendar.tooltips.firstChild.data = el.ttip; + el.calendar.tooltips.innerHTML = el.ttip; } if (el.navtype != 300) { Calendar.addClass(el, "hilite"); @@ -555,14 +560,13 @@ Calendar.dayMouseOver = function(ev) { Calendar.dayMouseOut = function(ev) { with (Calendar) { var el = getElement(ev); - if (isRelated(el, ev) || _C || el.disabled) { + if (isRelated(el, ev) || _C || el.disabled) return false; - } removeClass(el, "hilite"); - if (el.caldate) { + if (el.caldate) removeClass(el.parentNode, "rowhilite"); - } - el.calendar.tooltips.firstChild.data = _TT["SEL_DATE"]; + if (el.calendar) + el.calendar.tooltips.innerHTML = _TT["SEL_DATE"]; return stopEvent(ev); } }; @@ -577,17 +581,23 @@ Calendar.cellClick = function(el, ev) { var newdate = false; var date = null; if (typeof el.navtype == "undefined") { - Calendar.removeClass(cal.currentDateEl, "selected"); - Calendar.addClass(el, "selected"); - closing = (cal.currentDateEl == el); - if (!closing) { - cal.currentDateEl = el; + if (cal.currentDateEl) { + Calendar.removeClass(cal.currentDateEl, "selected"); + Calendar.addClass(el, "selected"); + closing = (cal.currentDateEl == el); + if (!closing) { + cal.currentDateEl = el; + } } - cal.date = new Date(el.caldate); + cal.date.setDateOnly(el.caldate); date = cal.date; - newdate = true; + var other_month = !(cal.dateClicked = !el.otherMonth); + if (!other_month && !cal.currentDateEl) + cal._toggleMultipleDate(new Date(date)); + else + newdate = !el.disabled; // a date was clicked - if (!(cal.dateClicked = !el.otherMonth)) + if (other_month) cal._init(cal.firstDayOfWeek, date); } else { if (el.navtype == 200) { @@ -595,7 +605,9 @@ Calendar.cellClick = function(el, ev) { cal.callCloseHandler(); return; } - date = (el.navtype == 0) ? new Date() : new Date(cal.date); + date = new Date(cal.date); + if (el.navtype == 0) + date.setDateOnly(new Date()); // TODAY // unless "today" was clicked, we assume no date was clicked so // the selected handler will know not to close the calenar when // in single-click mode. @@ -622,7 +634,7 @@ Calendar.cellClick = function(el, ev) { text = "Help and about box text is not translated into this language.\n" + "If you know this language and you feel generous please update\n" + "the corresponding file in \"lang\" subdir to match calendar-en.js\n" + - "and send it back to to get it into the distribution ;-)\n\n" + + "and send it back to to get it into the distribution ;-)\n\n" + "Thank you!\n" + "http://dynarch.com/mishoo/calendar.epl\n"; } @@ -659,7 +671,7 @@ Calendar.cellClick = function(el, ev) { return; case 50: var range = el._range; - var current = el.firstChild.data; + var current = el.innerHTML; for (var i = range.length; --i >= 0;) if (range[i] == current) break; @@ -669,15 +681,13 @@ Calendar.cellClick = function(el, ev) { } else if ( ++i >= range.length ) i = 0; var newval = range[i]; - el.firstChild.data = newval; + el.innerHTML = newval; cal.onUpdateTime(); return; case 0: // TODAY will bring us here - if ((typeof cal.getDateStatus == "function") && cal.getDateStatus(date, date.getFullYear(), date.getMonth(), date.getDate())) { - // remember, "date" was previously set to new - // Date() if TODAY was clicked; thus, it - // contains today date. + if ((typeof cal.getDateStatus == "function") && + cal.getDateStatus(date, date.getFullYear(), date.getMonth(), date.getDate())) { return false; } break; @@ -685,14 +695,15 @@ Calendar.cellClick = function(el, ev) { if (!date.equalsTo(cal.date)) { cal.setDate(date); newdate = true; - } + } else if (el.navtype == 0) + newdate = closing = true; } if (newdate) { - cal.callHandler(); + ev && cal.callHandler(); } if (closing) { Calendar.removeClass(el, "hilite"); - cal.callCloseHandler(); + ev && cal.callCloseHandler(); } }; @@ -749,13 +760,7 @@ Calendar.prototype.create = function (_par) { Calendar._add_evs(cell); cell.calendar = cal; cell.navtype = navtype; - if (text.substr(0, 1) != "&") { - cell.appendChild(document.createTextNode(text)); - } - else { - // FIXME: dirty hack for entities - cell.innerHTML = text; - } + cell.innerHTML = "
" + text + "
"; return cell; }; @@ -797,11 +802,10 @@ Calendar.prototype.create = function (_par) { if (this.weekNumbers) { cell = Calendar.createElement("td", row); cell.className = "name wn"; - cell.appendChild(document.createTextNode(Calendar._TT["WK"])); + cell.innerHTML = Calendar._TT["WK"]; } for (var i = 7; i > 0; --i) { cell = Calendar.createElement("td", row); - cell.appendChild(document.createTextNode("")); if (!i) { cell.navtype = 100; cell.calendar = this; @@ -818,11 +822,9 @@ Calendar.prototype.create = function (_par) { row = Calendar.createElement("tr", tbody); if (this.weekNumbers) { cell = Calendar.createElement("td", row); - cell.appendChild(document.createTextNode("")); } for (var j = 7; j > 0; --j) { cell = Calendar.createElement("td", row); - cell.appendChild(document.createTextNode("")); cell.calendar = this; Calendar._add_evs(cell); } @@ -845,7 +847,7 @@ Calendar.prototype.create = function (_par) { function makeTimePart(className, init, range_start, range_end) { var part = Calendar.createElement("span", cell); part.className = className; - part.appendChild(document.createTextNode(init)); + part.innerHTML = init; part.calendar = cal; part.ttip = Calendar._TT["TIME_PART"]; part.navtype = 50; @@ -870,7 +872,7 @@ Calendar.prototype.create = function (_par) { if (t12 && pm) hrs -= 12; var H = makeTimePart("hour", hrs, t12 ? 1 : 0, t12 ? 12 : 23); var span = Calendar.createElement("span", cell); - span.appendChild(document.createTextNode(":")); + span.innerHTML = ":"; span.className = "colon"; var M = makeTimePart("minute", mins, 0, 59); var AP = null; @@ -883,30 +885,32 @@ Calendar.prototype.create = function (_par) { cell.innerHTML = " "; cal.onSetTime = function() { - var hrs = this.date.getHours(); - var mins = this.date.getMinutes(); - var pm = (hrs > 12); - if (pm && t12) hrs -= 12; - H.firstChild.data = (hrs < 10) ? ("0" + hrs) : hrs; - M.firstChild.data = (mins < 10) ? ("0" + mins) : mins; - if (t12) - AP.firstChild.data = pm ? "pm" : "am"; + var pm, hrs = this.date.getHours(), + mins = this.date.getMinutes(); + if (t12) { + pm = (hrs >= 12); + if (pm) hrs -= 12; + if (hrs == 0) hrs = 12; + AP.innerHTML = pm ? "pm" : "am"; + } + H.innerHTML = (hrs < 10) ? ("0" + hrs) : hrs; + M.innerHTML = (mins < 10) ? ("0" + mins) : mins; }; cal.onUpdateTime = function() { var date = this.date; - var h = parseInt(H.firstChild.data, 10); + var h = parseInt(H.innerHTML, 10); if (t12) { - if (/pm/i.test(AP.firstChild.data) && h < 12) + if (/pm/i.test(AP.innerHTML) && h < 12) h += 12; - else if (/am/i.test(AP.firstChild.data) && h == 12) + else if (/am/i.test(AP.innerHTML) && h == 12) h = 0; } var d = date.getDate(); var m = date.getMonth(); var y = date.getFullYear(); date.setHours(h); - date.setMinutes(parseInt(M.firstChild.data, 10)); + date.setMinutes(parseInt(M.innerHTML, 10)); date.setFullYear(y); date.setMonth(m); date.setDate(d); @@ -938,7 +942,7 @@ Calendar.prototype.create = function (_par) { var mn = Calendar.createElement("div"); mn.className = Calendar.is_ie ? "label-IEfix" : "label"; mn.month = i; - mn.appendChild(document.createTextNode(Calendar._SMN[i])); + mn.innerHTML = Calendar._SMN[i]; div.appendChild(mn); } @@ -948,7 +952,6 @@ Calendar.prototype.create = function (_par) { for (i = 12; i > 0; --i) { var yr = Calendar.createElement("div"); yr.className = Calendar.is_ie ? "label-IEfix" : "label"; - yr.appendChild(document.createTextNode("")); div.appendChild(yr); } @@ -958,14 +961,14 @@ Calendar.prototype.create = function (_par) { /** keyboard navigation, only for popup calendars */ Calendar._keyEvent = function(ev) { - if (!window.calendar) { + var cal = window._dynarch_popupCalendar; + if (!cal || cal.multiple) return false; - } (Calendar.is_ie) && (ev = window.event); - var cal = window.calendar; - var act = (Calendar.is_ie || ev.type == "keypress"); + var act = (Calendar.is_ie || ev.type == "keypress"), + K = ev.keyCode; if (ev.ctrlKey) { - switch (ev.keyCode) { + switch (K) { case 37: // KEY left act && Calendar.cellClick(cal._nav_pm); break; @@ -981,7 +984,7 @@ Calendar._keyEvent = function(ev) { default: return false; } - } else switch (ev.keyCode) { + } else switch (K) { case 32: // KEY space (now) Calendar.cellClick(cal._nav_now); break; @@ -993,48 +996,78 @@ Calendar._keyEvent = function(ev) { case 39: // KEY right case 40: // KEY down if (act) { - var date = cal.date.getDate() - 1; - var el = cal.currentDateEl; - var ne = null; - var prev = (ev.keyCode == 37) || (ev.keyCode == 38); - switch (ev.keyCode) { - case 37: // KEY left - (--date >= 0) && (ne = cal.ar_days[date]); - break; - case 38: // KEY up - date -= 7; - (date >= 0) && (ne = cal.ar_days[date]); - break; - case 39: // KEY right - (++date < cal.ar_days.length) && (ne = cal.ar_days[date]); - break; - case 40: // KEY down - date += 7; - (date < cal.ar_days.length) && (ne = cal.ar_days[date]); + var prev, x, y, ne, el, step; + prev = K == 37 || K == 38; + step = (K == 37 || K == 39) ? 1 : 7; + function setVars() { + el = cal.currentDateEl; + var p = el.pos; + x = p & 15; + y = p >> 4; + ne = cal.ar_days[y][x]; + };setVars(); + function prevMonth() { + var date = new Date(cal.date); + date.setDate(date.getDate() - step); + cal.setDate(date); + }; + function nextMonth() { + var date = new Date(cal.date); + date.setDate(date.getDate() + step); + cal.setDate(date); + }; + while (1) { + switch (K) { + case 37: // KEY left + if (--x >= 0) + ne = cal.ar_days[y][x]; + else { + x = 6; + K = 38; + continue; + } + break; + case 38: // KEY up + if (--y >= 0) + ne = cal.ar_days[y][x]; + else { + prevMonth(); + setVars(); + } + break; + case 39: // KEY right + if (++x < 7) + ne = cal.ar_days[y][x]; + else { + x = 0; + K = 40; + continue; + } + break; + case 40: // KEY down + if (++y < cal.ar_days.length) + ne = cal.ar_days[y][x]; + else { + nextMonth(); + setVars(); + } + break; + } break; } - if (!ne) { - if (prev) { - Calendar.cellClick(cal._nav_pm); - } else { - Calendar.cellClick(cal._nav_nm); - } - date = (prev) ? cal.date.getMonthDays() : 1; - el = cal.currentDateEl; - ne = cal.ar_days[date - 1]; + if (ne) { + if (!ne.disabled) + Calendar.cellClick(ne); + else if (prev) + prevMonth(); + else + nextMonth(); } - Calendar.removeClass(el, "selected"); - Calendar.addClass(ne, "selected"); - cal.date = new Date(ne.caldate); - cal.callHandler(); - cal.currentDateEl = ne; } break; case 13: // KEY enter - if (act) { - cal.callHandler(); - cal.hide(); - } + if (act) + Calendar.cellClick(cal.currentDateEl, ev); break; default: return false; @@ -1046,7 +1079,10 @@ Calendar._keyEvent = function(ev) { * (RE)Initializes the calendar to the given date and firstDayOfWeek */ Calendar.prototype._init = function (firstDayOfWeek, date) { - var today = new Date(); + var today = new Date(), + TY = today.getFullYear(), + TM = today.getMonth(), + TD = today.getDate(); this.table.style.visibility = "hidden"; var year = date.getFullYear(); if (year < this.minYear) { @@ -1074,21 +1110,24 @@ Calendar.prototype._init = function (firstDayOfWeek, date) { var row = this.tbody.firstChild; var MN = Calendar._SMN[month]; - var ar_days = new Array(); + var ar_days = this.ar_days = new Array(); var weekend = Calendar._TT["WEEKEND"]; + var dates = this.multiple ? (this.datesCells = {}) : null; for (var i = 0; i < 6; ++i, row = row.nextSibling) { var cell = row.firstChild; if (this.weekNumbers) { cell.className = "day wn"; - cell.firstChild.data = date.getWeekNumber(); + cell.innerHTML = date.getWeekNumber(); cell = cell.nextSibling; } row.className = "daysrow"; - var hasdays = false; - for (var j = 0; j < 7; ++j, cell = cell.nextSibling, date.setDate(date.getDate() + 1)) { - var iday = date.getDate(); + var hasdays = false, iday, dpos = ar_days[i] = []; + for (var j = 0; j < 7; ++j, cell = cell.nextSibling, date.setDate(iday + 1)) { + iday = date.getDate(); var wday = date.getDay(); cell.className = "day"; + cell.pos = i << 4 | j; + dpos[j] = cell; var current_month = (date.getMonth() == month); if (!current_month) { if (this.showsOtherMonths) { @@ -1105,9 +1144,16 @@ Calendar.prototype._init = function (firstDayOfWeek, date) { hasdays = true; } cell.disabled = false; - cell.firstChild.data = iday; - if (typeof this.getDateStatus == "function") { + cell.innerHTML = this.getDateText ? this.getDateText(date, iday) : iday; + if (dates) + dates[date.print("%Y%m%d")] = cell; + if (this.getDateStatus) { var status = this.getDateStatus(date, year, month, iday); + if (this.getDateToolTip) { + var toolTip = this.getDateToolTip(date, year, month, iday); + if (toolTip) + cell.title = toolTip; + } if (status === true) { cell.className += " disabled"; cell.disabled = true; @@ -1118,33 +1164,66 @@ Calendar.prototype._init = function (firstDayOfWeek, date) { } } if (!cell.disabled) { - ar_days[ar_days.length] = cell; cell.caldate = new Date(date); cell.ttip = "_"; - if (current_month && iday == mday) { + if (!this.multiple && current_month + && iday == mday && this.hiliteToday) { cell.className += " selected"; this.currentDateEl = cell; } - if (date.getFullYear() == today.getFullYear() && - date.getMonth() == today.getMonth() && - iday == today.getDate()) { + if (date.getFullYear() == TY && + date.getMonth() == TM && + iday == TD) { cell.className += " today"; cell.ttip += Calendar._TT["PART_TODAY"]; } - if (weekend.indexOf(wday.toString()) != -1) { + if (weekend.indexOf(wday.toString()) != -1) cell.className += cell.otherMonth ? " oweekend" : " weekend"; - } } } if (!(hasdays || this.showsOtherMonths)) row.className = "emptyrow"; } - this.ar_days = ar_days; - this.title.firstChild.data = Calendar._MN[month] + ", " + year; + this.title.innerHTML = Calendar._MN[month] + ", " + year; this.onSetTime(); this.table.style.visibility = "visible"; + this._initMultipleDates(); // PROFILE - // this.tooltips.firstChild.data = "Generated in " + ((new Date()) - today) + " ms"; + // this.tooltips.innerHTML = "Generated in " + ((new Date()) - today) + " ms"; +}; + +Calendar.prototype._initMultipleDates = function() { + if (this.multiple) { + for (var i in this.multiple) { + var cell = this.datesCells[i]; + var d = this.multiple[i]; + if (!d) + continue; + if (cell) + cell.className += " selected"; + } + } +}; + +Calendar.prototype._toggleMultipleDate = function(date) { + if (this.multiple) { + var ds = date.print("%Y%m%d"); + var cell = this.datesCells[ds]; + if (cell) { + var d = this.multiple[ds]; + if (!d) { + Calendar.addClass(cell, "selected"); + this.multiple[ds] = date; + } else { + Calendar.removeClass(cell, "selected"); + delete this.multiple[ds]; + } + } + } +}; + +Calendar.prototype.setDateToolTipHandler = function (unaryFunction) { + this.getDateToolTip = unaryFunction; }; /** @@ -1209,7 +1288,7 @@ Calendar.prototype.destroy = function () { var el = this.element.parentNode; el.removeChild(this.element); Calendar._C = null; - window.calendar = null; + window._dynarch_popupCalendar = null; }; /** @@ -1226,14 +1305,15 @@ Calendar.prototype.reparent = function (new_parent) { // document, if the calendar is shown. If the click was outside the open // calendar this function closes it. Calendar._checkCalendar = function(ev) { - if (!window.calendar) { + var calendar = window._dynarch_popupCalendar; + if (!calendar) { return false; } var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev); for (; el != null && el != calendar.element; el = el.parentNode); if (el == null) { // calls closeHandler which should hide the calendar. - window.calendar.callCloseHandler(); + window._dynarch_popupCalendar.callCloseHandler(); return Calendar.stopEvent(ev); } }; @@ -1254,7 +1334,7 @@ Calendar.prototype.show = function () { this.element.style.display = "block"; this.hidden = false; if (this.isPopup) { - window.calendar = this; + window._dynarch_popupCalendar = this; Calendar.addEvent(document, "keydown", Calendar._keyEvent); Calendar.addEvent(document, "keypress", Calendar._keyEvent); Calendar.addEvent(document, "mousedown", Calendar._checkCalendar); @@ -1344,8 +1424,8 @@ Calendar.prototype.showAtElement = function (el, opts) { case "L": p.x -= w; break; case "R": p.x += el.offsetWidth; break; case "C": p.x += (el.offsetWidth - w) / 2; break; - case "r": p.x += el.offsetWidth - w; break; - case "l": break; // already there + case "l": p.x += el.offsetWidth - w; break; + case "r": break; // already there } p.width = w; p.height = h + 40; @@ -1373,14 +1453,140 @@ Calendar.prototype.setTtDateFormat = function (str) { * Tries to identify the date represented in a string. If successful it also * calls this.setDate which moves the calendar to the given date. */ -Calendar.prototype.parseDate = function (str, fmt) { +Calendar.prototype.parseDate = function(str, fmt) { + if (!fmt) + fmt = this.dateFormat; + this.setDate(Date.parseDate(str, fmt)); +}; + +Calendar.prototype.hideShowCovered = function () { + if (!Calendar.is_ie && !Calendar.is_opera) + return; + function getVisib(obj){ + var value = obj.style.visibility; + if (!value) { + if (document.defaultView && typeof (document.defaultView.getComputedStyle) == "function") { // Gecko, W3C + if (!Calendar.is_khtml) + value = document.defaultView. + getComputedStyle(obj, "").getPropertyValue("visibility"); + else + value = ''; + } else if (obj.currentStyle) { // IE + value = obj.currentStyle.visibility; + } else + value = ''; + } + return value; + }; + + var tags = new Array("applet", "iframe", "select"); + var el = this.element; + + var p = Calendar.getAbsolutePos(el); + var EX1 = p.x; + var EX2 = el.offsetWidth + EX1; + var EY1 = p.y; + var EY2 = el.offsetHeight + EY1; + + for (var k = tags.length; k > 0; ) { + var ar = document.getElementsByTagName(tags[--k]); + var cc = null; + + for (var i = ar.length; i > 0;) { + cc = ar[--i]; + + p = Calendar.getAbsolutePos(cc); + var CX1 = p.x; + var CX2 = cc.offsetWidth + CX1; + var CY1 = p.y; + var CY2 = cc.offsetHeight + CY1; + + if (this.hidden || (CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) { + if (!cc.__msh_save_visibility) { + cc.__msh_save_visibility = getVisib(cc); + } + cc.style.visibility = cc.__msh_save_visibility; + } else { + if (!cc.__msh_save_visibility) { + cc.__msh_save_visibility = getVisib(cc); + } + cc.style.visibility = "hidden"; + } + } + } +}; + +/** Internal function; it displays the bar with the names of the weekday. */ +Calendar.prototype._displayWeekdays = function () { + var fdow = this.firstDayOfWeek; + var cell = this.firstdayname; + var weekend = Calendar._TT["WEEKEND"]; + for (var i = 0; i < 7; ++i) { + cell.className = "day name"; + var realday = (i + fdow) % 7; + if (i) { + cell.ttip = Calendar._TT["DAY_FIRST"].replace("%s", Calendar._DN[realday]); + cell.navtype = 100; + cell.calendar = this; + cell.fdow = realday; + Calendar._add_evs(cell); + } + if (weekend.indexOf(realday.toString()) != -1) { + Calendar.addClass(cell, "weekend"); + } + cell.innerHTML = Calendar._SDN[(i + fdow) % 7]; + cell = cell.nextSibling; + } +}; + +/** Internal function. Hides all combo boxes that might be displayed. */ +Calendar.prototype._hideCombos = function () { + this.monthsCombo.style.display = "none"; + this.yearsCombo.style.display = "none"; +}; + +/** Internal function. Starts dragging the element. */ +Calendar.prototype._dragStart = function (ev) { + if (this.dragging) { + return; + } + this.dragging = true; + var posX; + var posY; + if (Calendar.is_ie) { + posY = window.event.clientY + document.body.scrollTop; + posX = window.event.clientX + document.body.scrollLeft; + } else { + posY = ev.clientY + window.scrollY; + posX = ev.clientX + window.scrollX; + } + var st = this.element.style; + this.xOffs = posX - parseInt(st.left); + this.yOffs = posY - parseInt(st.top); + with (Calendar) { + addEvent(document, "mousemove", calDragIt); + addEvent(document, "mouseup", calDragEnd); + } +}; + +// BEGIN: DATE OBJECT PATCHES + +/** Adds the number of days array to the Date object. */ +Date._MD = new Array(31,28,31,30,31,30,31,31,30,31,30,31); + +/** Constants used for time computations */ +Date.SECOND = 1000 /* milliseconds */; +Date.MINUTE = 60 * Date.SECOND; +Date.HOUR = 60 * Date.MINUTE; +Date.DAY = 24 * Date.HOUR; +Date.WEEK = 7 * Date.DAY; + +Date.parseDate = function(str, fmt) { + var today = new Date(); var y = 0; var m = -1; var d = 0; var a = str.split(/\W+/); - if (!fmt) { - fmt = this.dateFormat; - } var b = fmt.match(/%./g); var i = 0, j = 0; var hr = 0; @@ -1422,6 +1628,8 @@ Calendar.prototype.parseDate = function (str, fmt) { case "%p": if (/pm/i.test(a[i]) && hr < 12) hr += 12; + else if (/am/i.test(a[i]) && hr >= 12) + hr -= 12; break; case "%M": @@ -1429,10 +1637,13 @@ Calendar.prototype.parseDate = function (str, fmt) { break; } } - if (y != 0 && m != -1 && d != 0) { - this.setDate(new Date(y, m, d, hr, min, 0)); - return; - } + if (isNaN(y)) y = today.getFullYear(); + if (isNaN(m)) m = today.getMonth(); + if (isNaN(d)) d = today.getDate(); + if (isNaN(hr)) hr = today.getHours(); + if (isNaN(min)) min = today.getMinutes(); + if (y != 0 && m != -1 && d != 0) + return new Date(y, m, d, hr, min, 0); y = 0; m = -1; d = 0; for (i = 0; i < a.length; ++i) { if (a[i].search(/[a-zA-Z]+/) != -1) { @@ -1455,142 +1666,13 @@ Calendar.prototype.parseDate = function (str, fmt) { d = a[i]; } } - if (y == 0) { - var today = new Date(); + if (y == 0) y = today.getFullYear(); - } - if (m != -1 && d != 0) { - this.setDate(new Date(y, m, d, hr, min, 0)); - } -}; - -Calendar.prototype.hideShowCovered = function () { - var self = this; - Calendar.continuation_for_the_fucking_khtml_browser = function() { - function getVisib(obj){ - var value = obj.style.visibility; - if (!value) { - if (document.defaultView && typeof (document.defaultView.getComputedStyle) == "function") { // Gecko, W3C - if (!Calendar.is_khtml) - value = document.defaultView. - getComputedStyle(obj, "").getPropertyValue("visibility"); - else - value = ''; - } else if (obj.currentStyle) { // IE - value = obj.currentStyle.visibility; - } else - value = ''; - } - return value; - }; - - var tags = new Array("applet", "iframe", "select"); - var el = self.element; - - var p = Calendar.getAbsolutePos(el); - var EX1 = p.x; - var EX2 = el.offsetWidth + EX1; - var EY1 = p.y; - var EY2 = el.offsetHeight + EY1; - - for (var k = tags.length; k > 0; ) { - var ar = document.getElementsByTagName(tags[--k]); - var cc = null; - - for (var i = ar.length; i > 0;) { - cc = ar[--i]; - - p = Calendar.getAbsolutePos(cc); - var CX1 = p.x; - var CX2 = cc.offsetWidth + CX1; - var CY1 = p.y; - var CY2 = cc.offsetHeight + CY1; - - if (self.hidden || (CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) { - if (!cc.__msh_save_visibility) { - cc.__msh_save_visibility = getVisib(cc); - } - cc.style.visibility = cc.__msh_save_visibility; - } else { - if (!cc.__msh_save_visibility) { - cc.__msh_save_visibility = getVisib(cc); - } - cc.style.visibility = "hidden"; - } - } - } - }; - if (Calendar.is_khtml) - setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()", 10); - else - Calendar.continuation_for_the_fucking_khtml_browser(); -}; - -/** Internal function; it displays the bar with the names of the weekday. */ -Calendar.prototype._displayWeekdays = function () { - var fdow = this.firstDayOfWeek; - var cell = this.firstdayname; - var weekend = Calendar._TT["WEEKEND"]; - for (var i = 0; i < 7; ++i) { - cell.className = "day name"; - var realday = (i + fdow) % 7; - if (i) { - cell.ttip = Calendar._TT["DAY_FIRST"].replace("%s", Calendar._DN[realday]); - cell.navtype = 100; - cell.calendar = this; - cell.fdow = realday; - Calendar._add_evs(cell); - } - if (weekend.indexOf(realday.toString()) != -1) { - Calendar.addClass(cell, "weekend"); - } - cell.firstChild.data = Calendar._SDN[(i + fdow) % 7]; - cell = cell.nextSibling; - } -}; - -/** Internal function. Hides all combo boxes that might be displayed. */ -Calendar.prototype._hideCombos = function () { - this.monthsCombo.style.display = "none"; - this.yearsCombo.style.display = "none"; -}; - -/** Internal function. Starts dragging the element. */ -Calendar.prototype._dragStart = function (ev) { - if (this.dragging) { - return; - } - this.dragging = true; - var posX; - var posY; - if (Calendar.is_ie) { - posY = window.event.clientY + document.body.scrollTop; - posX = window.event.clientX + document.body.scrollLeft; - } else { - posY = ev.clientY + window.scrollY; - posX = ev.clientX + window.scrollX; - } - var st = this.element.style; - this.xOffs = posX - parseInt(st.left); - this.yOffs = posY - parseInt(st.top); - with (Calendar) { - addEvent(document, "mousemove", calDragIt); - addEvent(document, "mouseup", calDragEnd); - } + if (m != -1 && d != 0) + return new Date(y, m, d, hr, min, 0); + return today; }; -// BEGIN: DATE OBJECT PATCHES - -/** Adds the number of days array to the Date object. */ -Date._MD = new Array(31,28,31,30,31,30,31,31,30,31,30,31); - -/** Constants used for time computations */ -Date.SECOND = 1000 /* milliseconds */; -Date.MINUTE = 60 * Date.SECOND; -Date.HOUR = 60 * Date.MINUTE; -Date.DAY = 24 * Date.HOUR; -Date.WEEK = 7 * Date.DAY; - /** Returns the number of days in the current month */ Date.prototype.getMonthDays = function(month) { var year = this.getFullYear(); @@ -1623,7 +1705,7 @@ Date.prototype.getWeekNumber = function() { return Math.round((ms - d.valueOf()) / (7 * 864e5)) + 1; }; -/** Checks dates equality (ignores time) */ +/** Checks date and time equality */ Date.prototype.equalsTo = function(date) { return ((this.getFullYear() == date.getFullYear()) && (this.getMonth() == date.getMonth()) && @@ -1632,6 +1714,15 @@ Date.prototype.equalsTo = function(date) { (this.getMinutes() == date.getMinutes())); }; +/** Set only the year, month, date parts (keep existing time) */ +Date.prototype.setDateOnly = function(date) { + var tmp = new Date(date); + this.setDate(1); + this.setFullYear(tmp.getFullYear()); + this.setMonth(tmp.getMonth()); + this.setDate(tmp.getDate()); +}; + /** Prints the date in a string according to the given format. */ Date.prototype.print = function (str) { var m = this.getMonth(); @@ -1684,7 +1775,7 @@ Date.prototype.print = function (str) { s["%%"] = "%"; // a literal '%' character var re = /%./g; - if (!Calendar.is_ie5) + if (!Calendar.is_ie5 && !Calendar.is_khtml) return str.replace(re, function (par) { return s[par] || par; }); var a = str.match(re); @@ -1712,4 +1803,4 @@ Date.prototype.setFullYear = function(y) { // global object that remembers the calendar -window.calendar = null; +window._dynarch_popupCalendar = null; diff --git a/httemplate/elements/calendar_stripped.js b/httemplate/elements/calendar_stripped.js index 6a8e326af..4fe03f1ea 100644 --- a/httemplate/elements/calendar_stripped.js +++ b/httemplate/elements/calendar_stripped.js @@ -1,12 +1,14 @@ -/* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/ - * ------------------------------------------------------------------ +/* Copyright Mihai Bazon, 2002-2005 | www.bazon.net/mishoo + * ----------------------------------------------------------- * - * The DHTML Calendar, version 0.9.6 "Keep cool but don't freeze" + * The DHTML Calendar, version 1.0 "It is happening again" * * Details and latest version at: - * http://dynarch.com/mishoo/calendar.epl + * www.dynarch.com/projects/calendar + * + * This script is developed by Dynarch.com. Visit us at www.dynarch.com. * * This script is distributed under the GNU Lesser General Public License. * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html */ - Calendar=function(firstDayOfWeek,dateStr,onSelected,onClose){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.timeout=null;this.onSelected=onSelected||null;this.onClose=onClose||null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.dateFormat=Calendar._TT["DEF_DATE_FORMAT"];this.ttDateFormat=Calendar._TT["TT_DATE_FORMAT"];this.isPopup=true;this.weekNumbers=true;this.firstDayOfWeek=firstDayOfWeek;this.showsOtherMonths=false;this.dateStr=dateStr;this.ar_days=null;this.showsTime=false;this.time24=true;this.yearStep=2;this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined")Calendar._SDN_len=3;var ar=new Array();for(var i=8;i>0;){ar[--i]=Calendar._DN[i].substr(0,Calendar._SDN_len);}Calendar._SDN=ar;if(typeof Calendar._SMN_len=="undefined")Calendar._SMN_len=3;ar=new Array();for(var i=12;i>0;){ar[--i]=Calendar._MN[i].substr(0,Calendar._SMN_len);}Calendar._SMN=ar;}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(el){var SL=0,ST=0;var is_div=/^div$/i.test(el.tagName);if(is_div&&el.scrollLeft)SL=el.scrollLeft;if(is_div&&el.scrollTop)ST=el.scrollTop;var r={x:el.offsetLeft-SL,y:el.offsetTop-ST};if(el.offsetParent){var tmp=this.getAbsolutePos(el.offsetParent);r.x+=tmp.x;r.y+=tmp.y;}return r;};Calendar.isRelated=function(el,evt){var related=evt.relatedTarget;if(!related){var type=evt.type;if(type=="mouseover"){related=evt.fromElement;}else if(type=="mouseout"){related=evt.toElement;}}while(related){if(related==el){return true;}related=related.parentNode;}return false;};Calendar.removeClass=function(el,className){if(!(el&&el.className)){return;}var cls=el.className.split(" ");var ar=new Array();for(var i=cls.length;i>0;){if(cls[--i]!=className){ar[ar.length]=cls[i];}}el.className=ar.join(" ");};Calendar.addClass=function(el,className){Calendar.removeClass(el,className);el.className+=" "+className;};Calendar.getElement=function(ev){if(Calendar.is_ie){return window.event.srcElement;}else{return ev.currentTarget;}};Calendar.getTargetElement=function(ev){if(Calendar.is_ie){return window.event.srcElement;}else{return ev.target;}};Calendar.stopEvent=function(ev){ev||(ev=window.event);if(Calendar.is_ie){ev.cancelBubble=true;ev.returnValue=false;}else{ev.preventDefault();ev.stopPropagation();}return false;};Calendar.addEvent=function(el,evname,func){if(el.attachEvent){el.attachEvent("on"+evname,func);}else if(el.addEventListener){el.addEventListener(evname,func,true);}else{el["on"+evname]=func;}};Calendar.removeEvent=function(el,evname,func){if(el.detachEvent){el.detachEvent("on"+evname,func);}else if(el.removeEventListener){el.removeEventListener(evname,func,true);}else{el["on"+evname]=null;}};Calendar.createElement=function(type,parent){var el=null;if(document.createElementNS){el=document.createElementNS("http://www.w3.org/1999/xhtml",type);}else{el=document.createElement(type);}if(typeof parent!="undefined"){parent.appendChild(el);}return el;};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true);}}};Calendar.findMonth=function(el){if(typeof el.month!="undefined"){return el;}else if(typeof el.parentNode.month!="undefined"){return el.parentNode;}return null;};Calendar.findYear=function(el){if(typeof el.year!="undefined"){return el;}else if(typeof el.parentNode.year!="undefined"){return el.parentNode;}return null;};Calendar.showMonthsCombo=function(){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var mc=cal.monthsCombo;if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}if(cal.activeMonth){Calendar.removeClass(cal.activeMonth,"active");}var mon=cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];Calendar.addClass(mon,"active");cal.activeMonth=mon;var s=mc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var mcw=mc.offsetWidth;if(typeof mcw=="undefined")mcw=50;s.left=(cd.offsetLeft+cd.offsetWidth-mcw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";};Calendar.showYearsCombo=function(fwd){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var yc=cal.yearsCombo;if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}if(cal.activeYear){Calendar.removeClass(cal.activeYear,"active");}cal.activeYear=null;var Y=cal.date.getFullYear()+(fwd?1:-1);var yr=yc.firstChild;var show=false;for(var i=12;i>0;--i){if(Y>=cal.minYear&&Y<=cal.maxYear){yr.firstChild.data=Y;yr.year=Y;yr.style.display="block";show=true;}else{yr.style.display="none";}yr=yr.nextSibling;Y+=fwd?cal.yearStep:-cal.yearStep;}if(show){var s=yc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var ycw=yc.offsetWidth;if(typeof ycw=="undefined")ycw=50;s.left=(cd.offsetLeft+cd.offsetWidth-ycw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false;}if(cal.timeout){clearTimeout(cal.timeout);}var el=cal.activeDiv;if(!el){return false;}var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev);}var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev);}};Calendar.tableMouseOver=function(ev){var cal=Calendar._C;if(!cal){return;}var el=cal.activeDiv;var target=Calendar.getTargetElement(ev);if(target==el||target.parentNode==el){Calendar.addClass(el,"hilite active");Calendar.addClass(el.parentNode,"rowhilite");}else{if(typeof el.navtype=="undefined"||(el.navtype!=50&&(el.navtype==0||Math.abs(el.navtype)>2)))Calendar.removeClass(el,"active");Calendar.removeClass(el,"hilite");Calendar.removeClass(el.parentNode,"rowhilite");}ev||(ev=window.event);if(el.navtype==50&&target!=el){var pos=Calendar.getAbsolutePos(el);var w=el.offsetWidth;var x=ev.clientX;var dx;var decrease=true;if(x>pos.x+w){dx=x-pos.x-w;decrease=false;}else dx=pos.x-x;if(dx<0)dx=0;var range=el._range;var current=el._current;var count=Math.floor(dx/10)%range.length;for(var i=range.length;--i>=0;)if(range[i]==current)break;while(count-->0)if(decrease){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.firstChild.data=newval;cal.onUpdateTime();}var mon=Calendar.findMonth(target);if(mon){if(mon.month!=cal.date.getMonth()){if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}Calendar.addClass(mon,"hilite");cal.hilitedMonth=mon;}else if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}}else{if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}var year=Calendar.findYear(target);if(year){if(year.year!=cal.date.getFullYear()){if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}Calendar.addClass(year,"hilite");cal.hilitedYear=year;}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}return Calendar.stopEvent(ev);};Calendar.tableMouseDown=function(ev){if(Calendar.getTargetElement(ev)==Calendar.getElement(ev)){return Calendar.stopEvent(ev);}};Calendar.calDragIt=function(ev){var cal=Calendar._C;if(!(cal&&cal.dragging)){return false;}var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft;}else{posX=ev.pageX;posY=ev.pageY;}cal.hideShowCovered();var st=cal.element.style;st.left=(posX-cal.xOffs)+"px";st.top=(posY-cal.yOffs)+"px";return Calendar.stopEvent(ev);};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false;}cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev);}cal.hideShowCovered();};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false;}var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300)with(Calendar){if(el.navtype==50){el._current=el.firstChild.data;addEvent(document,"mousemove",tableMouseOver);}else addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver);addClass(el,"hilite active");addEvent(document,"mouseup",tableMouseUp);}else if(cal.isPopup){cal._dragStart(ev);}if(el.navtype==-1||el.navtype==1){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout("Calendar.showMonthsCombo()",250);}else if(el.navtype==-2||el.navtype==2){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250);}else{cal.timeout=null;}return Calendar.stopEvent(ev);};Calendar.dayMouseDblClick=function(ev){Calendar.cellClick(Calendar.getElement(ev),ev||window.event);if(Calendar.is_ie){document.selection.empty();}};Calendar.dayMouseOver=function(ev){var el=Calendar.getElement(ev);if(Calendar.isRelated(el,ev)||Calendar._C||el.disabled){return false;}if(el.ttip){if(el.ttip.substr(0,1)=="_"){el.ttip=el.caldate.print(el.calendar.ttDateFormat)+el.ttip.substr(1);}el.calendar.tooltips.firstChild.data=el.ttip;}if(el.navtype!=300){Calendar.addClass(el,"hilite");if(el.caldate){Calendar.addClass(el.parentNode,"rowhilite");}}return Calendar.stopEvent(ev);};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled){return false;}removeClass(el,"hilite");if(el.caldate){removeClass(el.parentNode,"rowhilite");}el.calendar.tooltips.firstChild.data=_TT["SEL_DATE"];return stopEvent(ev);}};Calendar.cellClick=function(el,ev){var cal=el.calendar;var closing=false;var newdate=false;var date=null;if(typeof el.navtype=="undefined"){Calendar.removeClass(cal.currentDateEl,"selected");Calendar.addClass(el,"selected");closing=(cal.currentDateEl==el);if(!closing){cal.currentDateEl=el;}cal.date=new Date(el.caldate);date=cal.date;newdate=true;if(!(cal.dateClicked=!el.otherMonth))cal._init(cal.firstDayOfWeek,date);}else{if(el.navtype==200){Calendar.removeClass(el,"hilite");cal.callCloseHandler();return;}date=(el.navtype==0)?new Date():new Date(cal.date);cal.dateClicked=false;var year=date.getFullYear();var mon=date.getMonth();function setMonth(m){var day=date.getDate();var max=date.getMonthDays(m);if(day>max){date.setDate(max);}date.setMonth(m);};switch(el.navtype){case 400:Calendar.removeClass(el,"hilite");var text=Calendar._TT["ABOUT"];if(typeof text!="undefined"){text+=cal.showsTime?Calendar._TT["ABOUT_TIME"]:"";}else{text="Help and about box text is not translated into this language.\n"+"If you know this language and you feel generous please update\n"+"the corresponding file in \"lang\" subdir to match calendar-en.js\n"+"and send it back to to get it into the distribution ;-)\n\n"+"Thank you!\n"+"http://dynarch.com/mishoo/calendar.epl\n";}alert(text);return;case-2:if(year>cal.minYear){date.setFullYear(year-1);}break;case-1:if(mon>0){setMonth(mon-1);}else if(year-->cal.minYear){date.setFullYear(year);setMonth(11);}break;case 1:if(mon<11){setMonth(mon+1);}else if(year=0;)if(range[i]==current)break;if(ev&&ev.shiftKey){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.firstChild.data=newval;cal.onUpdateTime();return;case 0:if((typeof cal.getDateStatus=="function")&&cal.getDateStatus(date,date.getFullYear(),date.getMonth(),date.getDate())){return false;}break;}if(!date.equalsTo(cal.date)){cal.setDate(date);newdate=true;}}if(newdate){cal.callHandler();}if(closing){Calendar.removeClass(el,"hilite");cal.callCloseHandler();}};Calendar.prototype.create=function(_par){var parent=null;if(!_par){parent=document.getElementsByTagName("body")[0];this.isPopup=true;}else{parent=_par;this.isPopup=false;}this.date=this.dateStr?new Date(this.dateStr):new Date();var table=Calendar.createElement("table");this.table=table;table.cellSpacing=0;table.cellPadding=0;table.calendar=this;Calendar.addEvent(table,"mousedown",Calendar.tableMouseDown);var div=Calendar.createElement("div");this.element=div;div.className="calendar";if(this.isPopup){div.style.position="absolute";div.style.display="none";}div.appendChild(table);var thead=Calendar.createElement("thead",table);var cell=null;var row=null;var cal=this;var hh=function(text,cs,navtype){cell=Calendar.createElement("td",row);cell.colSpan=cs;cell.className="button";if(navtype!=0&&Math.abs(navtype)<=2)cell.className+=" nav";Calendar._add_evs(cell);cell.calendar=cal;cell.navtype=navtype;if(text.substr(0,1)!="&"){cell.appendChild(document.createTextNode(text));}else{cell.innerHTML=text;}return cell;};row=Calendar.createElement("tr",thead);var title_length=6;(this.isPopup)&&--title_length;(this.weekNumbers)&&++title_length;hh("?",1,400).ttip=Calendar._TT["INFO"];this.title=hh("",title_length,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT["DRAG_TO_MOVE"];this.title.style.cursor="move";hh("×",1,200).ttip=Calendar._TT["CLOSE"];}row=Calendar.createElement("tr",thead);row.className="headrow";this._nav_py=hh("«",1,-2);this._nav_py.ttip=Calendar._TT["PREV_YEAR"];this._nav_pm=hh("‹",1,-1);this._nav_pm.ttip=Calendar._TT["PREV_MONTH"];this._nav_now=hh(Calendar._TT["TODAY"],this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT["GO_TODAY"];this._nav_nm=hh("›",1,1);this._nav_nm.ttip=Calendar._TT["NEXT_MONTH"];this._nav_ny=hh("»",1,2);this._nav_ny.ttip=Calendar._TT["NEXT_YEAR"];row=Calendar.createElement("tr",thead);row.className="daynames";if(this.weekNumbers){cell=Calendar.createElement("td",row);cell.className="name wn";cell.appendChild(document.createTextNode(Calendar._TT["WK"]));}for(var i=7;i>0;--i){cell=Calendar.createElement("td",row);cell.appendChild(document.createTextNode(""));if(!i){cell.navtype=100;cell.calendar=this;Calendar._add_evs(cell);}}this.firstdayname=(this.weekNumbers)?row.firstChild.nextSibling:row.firstChild;this._displayWeekdays();var tbody=Calendar.createElement("tbody",table);this.tbody=tbody;for(i=6;i>0;--i){row=Calendar.createElement("tr",tbody);if(this.weekNumbers){cell=Calendar.createElement("td",row);cell.appendChild(document.createTextNode(""));}for(var j=7;j>0;--j){cell=Calendar.createElement("td",row);cell.appendChild(document.createTextNode(""));cell.calendar=this;Calendar._add_evs(cell);}}if(this.showsTime){row=Calendar.createElement("tr",tbody);row.className="time";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;cell.innerHTML=Calendar._TT["TIME"]||" ";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=this.weekNumbers?4:3;(function(){function makeTimePart(className,init,range_start,range_end){var part=Calendar.createElement("span",cell);part.className=className;part.appendChild(document.createTextNode(init));part.calendar=cal;part.ttip=Calendar._TT["TIME_PART"];part.navtype=50;part._range=[];if(typeof range_start!="number")part._range=range_start;else{for(var i=range_start;i<=range_end;++i){var txt;if(i<10&&range_end>=10)txt='0'+i;else txt=''+i;part._range[part._range.length]=txt;}}Calendar._add_evs(part);return part;};var hrs=cal.date.getHours();var mins=cal.date.getMinutes();var t12=!cal.time24;var pm=(hrs>12);if(t12&&pm)hrs-=12;var H=makeTimePart("hour",hrs,t12?1:0,t12?12:23);var span=Calendar.createElement("span",cell);span.appendChild(document.createTextNode(":"));span.className="colon";var M=makeTimePart("minute",mins,0,59);var AP=null;cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;if(t12)AP=makeTimePart("ampm",pm?"pm":"am",["am","pm"]);else cell.innerHTML=" ";cal.onSetTime=function(){var hrs=this.date.getHours();var mins=this.date.getMinutes();var pm=(hrs>12);if(pm&&t12)hrs-=12;H.firstChild.data=(hrs<10)?("0"+hrs):hrs;M.firstChild.data=(mins<10)?("0"+mins):mins;if(t12)AP.firstChild.data=pm?"pm":"am";};cal.onUpdateTime=function(){var date=this.date;var h=parseInt(H.firstChild.data,10);if(t12){if(/pm/i.test(AP.firstChild.data)&&h<12)h+=12;else if(/am/i.test(AP.firstChild.data)&&h==12)h=0;}var d=date.getDate();var m=date.getMonth();var y=date.getFullYear();date.setHours(h);date.setMinutes(parseInt(M.firstChild.data,10));date.setFullYear(y);date.setMonth(m);date.setDate(d);this.dateClicked=false;this.callHandler();};})();}else{this.onSetTime=this.onUpdateTime=function(){};}var tfoot=Calendar.createElement("tfoot",table);row=Calendar.createElement("tr",tfoot);row.className="footrow";cell=hh(Calendar._TT["SEL_DATE"],this.weekNumbers?8:7,300);cell.className="ttip";if(this.isPopup){cell.ttip=Calendar._TT["DRAG_TO_MOVE"];cell.style.cursor="move";}this.tooltips=cell;div=Calendar.createElement("div",this.element);this.monthsCombo=div;div.className="combo";for(i=0;i0;--i){var yr=Calendar.createElement("div");yr.className=Calendar.is_ie?"label-IEfix":"label";yr.appendChild(document.createTextNode(""));div.appendChild(yr);}this._init(this.firstDayOfWeek,this.date);parent.appendChild(this.element);};Calendar._keyEvent=function(ev){if(!window.calendar){return false;}(Calendar.is_ie)&&(ev=window.event);var cal=window.calendar;var act=(Calendar.is_ie||ev.type=="keypress");if(ev.ctrlKey){switch(ev.keyCode){case 37:act&&Calendar.cellClick(cal._nav_pm);break;case 38:act&&Calendar.cellClick(cal._nav_py);break;case 39:act&&Calendar.cellClick(cal._nav_nm);break;case 40:act&&Calendar.cellClick(cal._nav_ny);break;default:return false;}}else switch(ev.keyCode){case 32:Calendar.cellClick(cal._nav_now);break;case 27:act&&cal.callCloseHandler();break;case 37:case 38:case 39:case 40:if(act){var date=cal.date.getDate()-1;var el=cal.currentDateEl;var ne=null;var prev=(ev.keyCode==37)||(ev.keyCode==38);switch(ev.keyCode){case 37:(--date>=0)&&(ne=cal.ar_days[date]);break;case 38:date-=7;(date>=0)&&(ne=cal.ar_days[date]);break;case 39:(++datethis.maxYear){year=this.maxYear;date.setFullYear(year);}this.firstDayOfWeek=firstDayOfWeek;this.date=new Date(date);var month=date.getMonth();var mday=date.getDate();var no_days=date.getMonthDays();date.setDate(1);var day1=(date.getDay()-this.firstDayOfWeek)%7;if(day1<0)day1+=7;date.setDate(-day1);date.setDate(date.getDate()+1);var row=this.tbody.firstChild;var MN=Calendar._SMN[month];var ar_days=new Array();var weekend=Calendar._TT["WEEKEND"];for(var i=0;i<6;++i,row=row.nextSibling){var cell=row.firstChild;if(this.weekNumbers){cell.className="day wn";cell.firstChild.data=date.getWeekNumber();cell=cell.nextSibling;}row.className="daysrow";var hasdays=false;for(var j=0;j<7;++j,cell=cell.nextSibling,date.setDate(date.getDate()+1)){var iday=date.getDate();var wday=date.getDay();cell.className="day";var current_month=(date.getMonth()==month);if(!current_month){if(this.showsOtherMonths){cell.className+=" othermonth";cell.otherMonth=true;}else{cell.className="emptycell";cell.innerHTML=" ";cell.disabled=true;continue;}}else{cell.otherMonth=false;hasdays=true;}cell.disabled=false;cell.firstChild.data=iday;if(typeof this.getDateStatus=="function"){var status=this.getDateStatus(date,year,month,iday);if(status===true){cell.className+=" disabled";cell.disabled=true;}else{if(/disabled/i.test(status))cell.disabled=true;cell.className+=" "+status;}}if(!cell.disabled){ar_days[ar_days.length]=cell;cell.caldate=new Date(date);cell.ttip="_";if(current_month&&iday==mday){cell.className+=" selected";this.currentDateEl=cell;}if(date.getFullYear()==today.getFullYear()&&date.getMonth()==today.getMonth()&&iday==today.getDate()){cell.className+=" today";cell.ttip+=Calendar._TT["PART_TODAY"];}if(weekend.indexOf(wday.toString())!=-1){cell.className+=cell.otherMonth?" oweekend":" weekend";}}}if(!(hasdays||this.showsOtherMonths))row.className="emptyrow";}this.ar_days=ar_days;this.title.firstChild.data=Calendar._MN[month]+", "+year;this.onSetTime();this.table.style.visibility="visible";};Calendar.prototype.setDate=function(date){if(!date.equalsTo(this.date)){this._init(this.firstDayOfWeek,date);}};Calendar.prototype.refresh=function(){this._init(this.firstDayOfWeek,this.date);};Calendar.prototype.setFirstDayOfWeek=function(firstDayOfWeek){this._init(firstDayOfWeek,this.date);this._displayWeekdays();};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(unaryFunction){this.getDateStatus=unaryFunction;};Calendar.prototype.setRange=function(a,z){this.minYear=a;this.maxYear=z;};Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat));}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this);}this.hideShowCovered();};Calendar.prototype.destroy=function(){var el=this.element.parentNode;el.removeChild(this.element);Calendar._C=null;window.calendar=null;};Calendar.prototype.reparent=function(new_parent){var el=this.element;el.parentNode.removeChild(el);new_parent.appendChild(el);};Calendar._checkCalendar=function(ev){if(!window.calendar){return false;}var el=Calendar.is_ie?Calendar.getElement(ev):Calendar.getTargetElement(ev);for(;el!=null&&el!=calendar.element;el=el.parentNode);if(el==null){window.calendar.callCloseHandler();return Calendar.stopEvent(ev);}};Calendar.prototype.show=function(){var rows=this.table.getElementsByTagName("tr");for(var i=rows.length;i>0;){var row=rows[--i];Calendar.removeClass(row,"rowhilite");var cells=row.getElementsByTagName("td");for(var j=cells.length;j>0;){var cell=cells[--j];Calendar.removeClass(cell,"hilite");Calendar.removeClass(cell,"active");}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window.calendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar);}this.hideShowCovered();};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar);}this.element.style.display="none";this.hidden=true;this.hideShowCovered();};Calendar.prototype.showAt=function(x,y){var s=this.element.style;s.left=x+"px";s.top=y+"px";this.show();};Calendar.prototype.showAtElement=function(el,opts){var self=this;var p=Calendar.getAbsolutePos(el);if(!opts||typeof opts!="string"){this.showAt(p.x,p.y+el.offsetHeight);return true;}function fixPosition(box){if(box.x<0)box.x=0;if(box.y<0)box.y=0;var cp=document.createElement("div");var s=cp.style;s.position="absolute";s.right=s.bottom=s.width=s.height="0px";document.body.appendChild(cp);var br=Calendar.getAbsolutePos(cp);document.body.removeChild(cp);if(Calendar.is_ie){br.y+=document.body.scrollTop;br.x+=document.body.scrollLeft;}else{br.y+=window.scrollY;br.x+=window.scrollX;}var tmp=box.x+box.width-br.x;if(tmp>0)box.x-=tmp;tmp=box.y+box.height-br.y;if(tmp>0)box.y-=tmp;};this.element.style.display="block";Calendar.continuation_for_the_fucking_khtml_browser=function(){var w=self.element.offsetWidth;var h=self.element.offsetHeight;self.element.style.display="none";var valign=opts.substr(0,1);var halign="l";if(opts.length>1){halign=opts.substr(1,1);}switch(valign){case "T":p.y-=h;break;case "B":p.y+=el.offsetHeight;break;case "C":p.y+=(el.offsetHeight-h)/2;break;case "t":p.y+=el.offsetHeight-h;break;case "b":break;}switch(halign){case "L":p.x-=w;break;case "R":p.x+=el.offsetWidth;break;case "C":p.x+=(el.offsetWidth-w)/2;break;case "r":p.x+=el.offsetWidth-w;break;case "l":break;}p.width=w;p.height=h+40;self.monthsCombo.style.display="none";fixPosition(p);self.showAt(p.x,p.y);};if(Calendar.is_khtml)setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()",10);else Calendar.continuation_for_the_fucking_khtml_browser();};Calendar.prototype.setDateFormat=function(str){this.dateFormat=str;};Calendar.prototype.setTtDateFormat=function(str){this.ttDateFormat=str;};Calendar.prototype.parseDate=function(str,fmt){var y=0;var m=-1;var d=0;var a=str.split(/\W+/);if(!fmt){fmt=this.dateFormat;}var b=fmt.match(/%./g);var i=0,j=0;var hr=0;var min=0;for(i=0;i29)?1900:2000);break;case "%b":case "%B":for(j=0;j<12;++j){if(Calendar._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){m=j;break;}}break;case "%H":case "%I":case "%k":case "%l":hr=parseInt(a[i],10);break;case "%P":case "%p":if(/pm/i.test(a[i])&&hr<12)hr+=12;break;case "%M":min=parseInt(a[i],10);break;}}if(y!=0&&m!=-1&&d!=0){this.setDate(new Date(y,m,d,hr,min,0));return;}y=0;m=-1;d=0;for(i=0;i31&&y==0){y=parseInt(a[i],10);(y<100)&&(y+=(y>29)?1900:2000);}else if(d==0){d=a[i];}}if(y==0){var today=new Date();y=today.getFullYear();}if(m!=-1&&d!=0){this.setDate(new Date(y,m,d,hr,min,0));}};Calendar.prototype.hideShowCovered=function(){var self=this;Calendar.continuation_for_the_fucking_khtml_browser=function(){function getVisib(obj){var value=obj.style.visibility;if(!value){if(document.defaultView&&typeof(document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml)value=document.defaultView. getComputedStyle(obj,"").getPropertyValue("visibility");else value='';}else if(obj.currentStyle){value=obj.currentStyle.visibility;}else value='';}return value;};var tags=new Array("applet","iframe","select");var el=self.element;var p=Calendar.getAbsolutePos(el);var EX1=p.x;var EX2=el.offsetWidth+EX1;var EY1=p.y;var EY2=el.offsetHeight+EY1;for(var k=tags.length;k>0;){var ar=document.getElementsByTagName(tags[--k]);var cc=null;for(var i=ar.length;i>0;){cc=ar[--i];p=Calendar.getAbsolutePos(cc);var CX1=p.x;var CX2=cc.offsetWidth+CX1;var CY1=p.y;var CY2=cc.offsetHeight+CY1;if(self.hidden||(CX1>EX2)||(CX2EY2)||(CY2=12);var ir=(pm)?(hr-12):hr;var dy=this.getDayOfYear();if(ir==0)ir=12;var min=this.getMinutes();var sec=this.getSeconds();s["%a"]=Calendar._SDN[w];s["%A"]=Calendar._DN[w];s["%b"]=Calendar._SMN[m];s["%B"]=Calendar._MN[m];s["%C"]=1+Math.floor(y/100);s["%d"]=(d<10)?("0"+d):d;s["%e"]=d;s["%H"]=(hr<10)?("0"+hr):hr;s["%I"]=(ir<10)?("0"+ir):ir;s["%j"]=(dy<100)?((dy<10)?("00"+dy):("0"+dy)):dy;s["%k"]=hr;s["%l"]=ir;s["%m"]=(m<9)?("0"+(1+m)):(1+m);s["%M"]=(min<10)?("0"+min):min;s["%n"]="\n";s["%p"]=pm?"PM":"AM";s["%P"]=pm?"pm":"am";s["%s"]=Math.floor(this.getTime()/1000);s["%S"]=(sec<10)?("0"+sec):sec;s["%t"]="\t";s["%U"]=s["%W"]=s["%V"]=(wn<10)?("0"+wn):wn;s["%u"]=w+1;s["%w"]=w;s["%y"]=(''+y).substr(2,2);s["%Y"]=y;s["%%"]="%";var re=/%./g;if(!Calendar.is_ie5)return str.replace(re,function(par){return s[par]||par;});var a=str.match(re);for(var i=0;i0;){ar[--i]=Calendar._DN[i].substr(0,Calendar._SDN_len);}Calendar._SDN=ar;if(typeof Calendar._SMN_len=="undefined")Calendar._SMN_len=3;ar=new Array();for(var i=12;i>0;){ar[--i]=Calendar._MN[i].substr(0,Calendar._SMN_len);}Calendar._SMN=ar;}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(el){var SL=0,ST=0;var is_div=/^div$/i.test(el.tagName);if(is_div&&el.scrollLeft)SL=el.scrollLeft;if(is_div&&el.scrollTop)ST=el.scrollTop;var r={x:el.offsetLeft-SL,y:el.offsetTop-ST};if(el.offsetParent){var tmp=this.getAbsolutePos(el.offsetParent);r.x+=tmp.x;r.y+=tmp.y;}return r;};Calendar.isRelated=function(el,evt){var related=evt.relatedTarget;if(!related){var type=evt.type;if(type=="mouseover"){related=evt.fromElement;}else if(type=="mouseout"){related=evt.toElement;}}while(related){if(related==el){return true;}related=related.parentNode;}return false;};Calendar.removeClass=function(el,className){if(!(el&&el.className)){return;}var cls=el.className.split(" ");var ar=new Array();for(var i=cls.length;i>0;){if(cls[--i]!=className){ar[ar.length]=cls[i];}}el.className=ar.join(" ");};Calendar.addClass=function(el,className){Calendar.removeClass(el,className);el.className+=" "+className;};Calendar.getElement=function(ev){var f=Calendar.is_ie?window.event.srcElement:ev.currentTarget;while(f.nodeType!=1||/^div$/i.test(f.tagName))f=f.parentNode;return f;};Calendar.getTargetElement=function(ev){var f=Calendar.is_ie?window.event.srcElement:ev.target;while(f.nodeType!=1)f=f.parentNode;return f;};Calendar.stopEvent=function(ev){ev||(ev=window.event);if(Calendar.is_ie){ev.cancelBubble=true;ev.returnValue=false;}else{ev.preventDefault();ev.stopPropagation();}return false;};Calendar.addEvent=function(el,evname,func){if(el.attachEvent){el.attachEvent("on"+evname,func);}else if(el.addEventListener){el.addEventListener(evname,func,true);}else{el["on"+evname]=func;}};Calendar.removeEvent=function(el,evname,func){if(el.detachEvent){el.detachEvent("on"+evname,func);}else if(el.removeEventListener){el.removeEventListener(evname,func,true);}else{el["on"+evname]=null;}};Calendar.createElement=function(type,parent){var el=null;if(document.createElementNS){el=document.createElementNS("http://www.w3.org/1999/xhtml",type);}else{el=document.createElement(type);}if(typeof parent!="undefined"){parent.appendChild(el);}return el;};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true);}}};Calendar.findMonth=function(el){if(typeof el.month!="undefined"){return el;}else if(typeof el.parentNode.month!="undefined"){return el.parentNode;}return null;};Calendar.findYear=function(el){if(typeof el.year!="undefined"){return el;}else if(typeof el.parentNode.year!="undefined"){return el.parentNode;}return null;};Calendar.showMonthsCombo=function(){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var mc=cal.monthsCombo;if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}if(cal.activeMonth){Calendar.removeClass(cal.activeMonth,"active");}var mon=cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];Calendar.addClass(mon,"active");cal.activeMonth=mon;var s=mc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var mcw=mc.offsetWidth;if(typeof mcw=="undefined")mcw=50;s.left=(cd.offsetLeft+cd.offsetWidth-mcw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";};Calendar.showYearsCombo=function(fwd){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var yc=cal.yearsCombo;if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}if(cal.activeYear){Calendar.removeClass(cal.activeYear,"active");}cal.activeYear=null;var Y=cal.date.getFullYear()+(fwd?1:-1);var yr=yc.firstChild;var show=false;for(var i=12;i>0;--i){if(Y>=cal.minYear&&Y<=cal.maxYear){yr.innerHTML=Y;yr.year=Y;yr.style.display="block";show=true;}else{yr.style.display="none";}yr=yr.nextSibling;Y+=fwd?cal.yearStep:-cal.yearStep;}if(show){var s=yc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var ycw=yc.offsetWidth;if(typeof ycw=="undefined")ycw=50;s.left=(cd.offsetLeft+cd.offsetWidth-ycw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false;}if(cal.timeout){clearTimeout(cal.timeout);}var el=cal.activeDiv;if(!el){return false;}var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev);}var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev);}};Calendar.tableMouseOver=function(ev){var cal=Calendar._C;if(!cal){return;}var el=cal.activeDiv;var target=Calendar.getTargetElement(ev);if(target==el||target.parentNode==el){Calendar.addClass(el,"hilite active");Calendar.addClass(el.parentNode,"rowhilite");}else{if(typeof el.navtype=="undefined"||(el.navtype!=50&&(el.navtype==0||Math.abs(el.navtype)>2)))Calendar.removeClass(el,"active");Calendar.removeClass(el,"hilite");Calendar.removeClass(el.parentNode,"rowhilite");}ev||(ev=window.event);if(el.navtype==50&&target!=el){var pos=Calendar.getAbsolutePos(el);var w=el.offsetWidth;var x=ev.clientX;var dx;var decrease=true;if(x>pos.x+w){dx=x-pos.x-w;decrease=false;}else dx=pos.x-x;if(dx<0)dx=0;var range=el._range;var current=el._current;var count=Math.floor(dx/10)%range.length;for(var i=range.length;--i>=0;)if(range[i]==current)break;while(count-->0)if(decrease){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.innerHTML=newval;cal.onUpdateTime();}var mon=Calendar.findMonth(target);if(mon){if(mon.month!=cal.date.getMonth()){if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}Calendar.addClass(mon,"hilite");cal.hilitedMonth=mon;}else if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}}else{if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}var year=Calendar.findYear(target);if(year){if(year.year!=cal.date.getFullYear()){if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}Calendar.addClass(year,"hilite");cal.hilitedYear=year;}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}return Calendar.stopEvent(ev);};Calendar.tableMouseDown=function(ev){if(Calendar.getTargetElement(ev)==Calendar.getElement(ev)){return Calendar.stopEvent(ev);}};Calendar.calDragIt=function(ev){var cal=Calendar._C;if(!(cal&&cal.dragging)){return false;}var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft;}else{posX=ev.pageX;posY=ev.pageY;}cal.hideShowCovered();var st=cal.element.style;st.left=(posX-cal.xOffs)+"px";st.top=(posY-cal.yOffs)+"px";return Calendar.stopEvent(ev);};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false;}cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev);}cal.hideShowCovered();};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false;}var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300)with(Calendar){if(el.navtype==50){el._current=el.innerHTML;addEvent(document,"mousemove",tableMouseOver);}else addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver);addClass(el,"hilite active");addEvent(document,"mouseup",tableMouseUp);}else if(cal.isPopup){cal._dragStart(ev);}if(el.navtype==-1||el.navtype==1){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout("Calendar.showMonthsCombo()",250);}else if(el.navtype==-2||el.navtype==2){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250);}else{cal.timeout=null;}return Calendar.stopEvent(ev);};Calendar.dayMouseDblClick=function(ev){Calendar.cellClick(Calendar.getElement(ev),ev||window.event);if(Calendar.is_ie){document.selection.empty();}};Calendar.dayMouseOver=function(ev){var el=Calendar.getElement(ev);if(Calendar.isRelated(el,ev)||Calendar._C||el.disabled){return false;}if(el.ttip){if(el.ttip.substr(0,1)=="_"){el.ttip=el.caldate.print(el.calendar.ttDateFormat)+el.ttip.substr(1);}el.calendar.tooltips.innerHTML=el.ttip;}if(el.navtype!=300){Calendar.addClass(el,"hilite");if(el.caldate){Calendar.addClass(el.parentNode,"rowhilite");}}return Calendar.stopEvent(ev);};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled)return false;removeClass(el,"hilite");if(el.caldate)removeClass(el.parentNode,"rowhilite");if(el.calendar)el.calendar.tooltips.innerHTML=_TT["SEL_DATE"];return stopEvent(ev);}};Calendar.cellClick=function(el,ev){var cal=el.calendar;var closing=false;var newdate=false;var date=null;if(typeof el.navtype=="undefined"){if(cal.currentDateEl){Calendar.removeClass(cal.currentDateEl,"selected");Calendar.addClass(el,"selected");closing=(cal.currentDateEl==el);if(!closing){cal.currentDateEl=el;}}cal.date.setDateOnly(el.caldate);date=cal.date;var other_month=!(cal.dateClicked=!el.otherMonth);if(!other_month&&!cal.currentDateEl)cal._toggleMultipleDate(new Date(date));else newdate=!el.disabled;if(other_month)cal._init(cal.firstDayOfWeek,date);}else{if(el.navtype==200){Calendar.removeClass(el,"hilite");cal.callCloseHandler();return;}date=new Date(cal.date);if(el.navtype==0)date.setDateOnly(new Date());cal.dateClicked=false;var year=date.getFullYear();var mon=date.getMonth();function setMonth(m){var day=date.getDate();var max=date.getMonthDays(m);if(day>max){date.setDate(max);}date.setMonth(m);};switch(el.navtype){case 400:Calendar.removeClass(el,"hilite");var text=Calendar._TT["ABOUT"];if(typeof text!="undefined"){text+=cal.showsTime?Calendar._TT["ABOUT_TIME"]:"";}else{text="Help and about box text is not translated into this language.\n"+"If you know this language and you feel generous please update\n"+"the corresponding file in \"lang\" subdir to match calendar-en.js\n"+"and send it back to to get it into the distribution ;-)\n\n"+"Thank you!\n"+"http://dynarch.com/mishoo/calendar.epl\n";}alert(text);return;case-2:if(year>cal.minYear){date.setFullYear(year-1);}break;case-1:if(mon>0){setMonth(mon-1);}else if(year-->cal.minYear){date.setFullYear(year);setMonth(11);}break;case 1:if(mon<11){setMonth(mon+1);}else if(year=0;)if(range[i]==current)break;if(ev&&ev.shiftKey){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.innerHTML=newval;cal.onUpdateTime();return;case 0:if((typeof cal.getDateStatus=="function")&&cal.getDateStatus(date,date.getFullYear(),date.getMonth(),date.getDate())){return false;}break;}if(!date.equalsTo(cal.date)){cal.setDate(date);newdate=true;}else if(el.navtype==0)newdate=closing=true;}if(newdate){ev&&cal.callHandler();}if(closing){Calendar.removeClass(el,"hilite");ev&&cal.callCloseHandler();}};Calendar.prototype.create=function(_par){var parent=null;if(!_par){parent=document.getElementsByTagName("body")[0];this.isPopup=true;}else{parent=_par;this.isPopup=false;}this.date=this.dateStr?new Date(this.dateStr):new Date();var table=Calendar.createElement("table");this.table=table;table.cellSpacing=0;table.cellPadding=0;table.calendar=this;Calendar.addEvent(table,"mousedown",Calendar.tableMouseDown);var div=Calendar.createElement("div");this.element=div;div.className="calendar";if(this.isPopup){div.style.position="absolute";div.style.display="none";}div.appendChild(table);var thead=Calendar.createElement("thead",table);var cell=null;var row=null;var cal=this;var hh=function(text,cs,navtype){cell=Calendar.createElement("td",row);cell.colSpan=cs;cell.className="button";if(navtype!=0&&Math.abs(navtype)<=2)cell.className+=" nav";Calendar._add_evs(cell);cell.calendar=cal;cell.navtype=navtype;cell.innerHTML="
"+text+"
";return cell;};row=Calendar.createElement("tr",thead);var title_length=6;(this.isPopup)&&--title_length;(this.weekNumbers)&&++title_length;hh("?",1,400).ttip=Calendar._TT["INFO"];this.title=hh("",title_length,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT["DRAG_TO_MOVE"];this.title.style.cursor="move";hh("×",1,200).ttip=Calendar._TT["CLOSE"];}row=Calendar.createElement("tr",thead);row.className="headrow";this._nav_py=hh("«",1,-2);this._nav_py.ttip=Calendar._TT["PREV_YEAR"];this._nav_pm=hh("‹",1,-1);this._nav_pm.ttip=Calendar._TT["PREV_MONTH"];this._nav_now=hh(Calendar._TT["TODAY"],this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT["GO_TODAY"];this._nav_nm=hh("›",1,1);this._nav_nm.ttip=Calendar._TT["NEXT_MONTH"];this._nav_ny=hh("»",1,2);this._nav_ny.ttip=Calendar._TT["NEXT_YEAR"];row=Calendar.createElement("tr",thead);row.className="daynames";if(this.weekNumbers){cell=Calendar.createElement("td",row);cell.className="name wn";cell.innerHTML=Calendar._TT["WK"];}for(var i=7;i>0;--i){cell=Calendar.createElement("td",row);if(!i){cell.navtype=100;cell.calendar=this;Calendar._add_evs(cell);}}this.firstdayname=(this.weekNumbers)?row.firstChild.nextSibling:row.firstChild;this._displayWeekdays();var tbody=Calendar.createElement("tbody",table);this.tbody=tbody;for(i=6;i>0;--i){row=Calendar.createElement("tr",tbody);if(this.weekNumbers){cell=Calendar.createElement("td",row);}for(var j=7;j>0;--j){cell=Calendar.createElement("td",row);cell.calendar=this;Calendar._add_evs(cell);}}if(this.showsTime){row=Calendar.createElement("tr",tbody);row.className="time";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;cell.innerHTML=Calendar._TT["TIME"]||" ";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=this.weekNumbers?4:3;(function(){function makeTimePart(className,init,range_start,range_end){var part=Calendar.createElement("span",cell);part.className=className;part.innerHTML=init;part.calendar=cal;part.ttip=Calendar._TT["TIME_PART"];part.navtype=50;part._range=[];if(typeof range_start!="number")part._range=range_start;else{for(var i=range_start;i<=range_end;++i){var txt;if(i<10&&range_end>=10)txt='0'+i;else txt=''+i;part._range[part._range.length]=txt;}}Calendar._add_evs(part);return part;};var hrs=cal.date.getHours();var mins=cal.date.getMinutes();var t12=!cal.time24;var pm=(hrs>12);if(t12&&pm)hrs-=12;var H=makeTimePart("hour",hrs,t12?1:0,t12?12:23);var span=Calendar.createElement("span",cell);span.innerHTML=":";span.className="colon";var M=makeTimePart("minute",mins,0,59);var AP=null;cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;if(t12)AP=makeTimePart("ampm",pm?"pm":"am",["am","pm"]);else cell.innerHTML=" ";cal.onSetTime=function(){var pm,hrs=this.date.getHours(),mins=this.date.getMinutes();if(t12){pm=(hrs>=12);if(pm)hrs-=12;if(hrs==0)hrs=12;AP.innerHTML=pm?"pm":"am";}H.innerHTML=(hrs<10)?("0"+hrs):hrs;M.innerHTML=(mins<10)?("0"+mins):mins;};cal.onUpdateTime=function(){var date=this.date;var h=parseInt(H.innerHTML,10);if(t12){if(/pm/i.test(AP.innerHTML)&&h<12)h+=12;else if(/am/i.test(AP.innerHTML)&&h==12)h=0;}var d=date.getDate();var m=date.getMonth();var y=date.getFullYear();date.setHours(h);date.setMinutes(parseInt(M.innerHTML,10));date.setFullYear(y);date.setMonth(m);date.setDate(d);this.dateClicked=false;this.callHandler();};})();}else{this.onSetTime=this.onUpdateTime=function(){};}var tfoot=Calendar.createElement("tfoot",table);row=Calendar.createElement("tr",tfoot);row.className="footrow";cell=hh(Calendar._TT["SEL_DATE"],this.weekNumbers?8:7,300);cell.className="ttip";if(this.isPopup){cell.ttip=Calendar._TT["DRAG_TO_MOVE"];cell.style.cursor="move";}this.tooltips=cell;div=Calendar.createElement("div",this.element);this.monthsCombo=div;div.className="combo";for(i=0;i0;--i){var yr=Calendar.createElement("div");yr.className=Calendar.is_ie?"label-IEfix":"label";div.appendChild(yr);}this._init(this.firstDayOfWeek,this.date);parent.appendChild(this.element);};Calendar._keyEvent=function(ev){var cal=window._dynarch_popupCalendar;if(!cal||cal.multiple)return false;(Calendar.is_ie)&&(ev=window.event);var act=(Calendar.is_ie||ev.type=="keypress"),K=ev.keyCode;if(ev.ctrlKey){switch(K){case 37:act&&Calendar.cellClick(cal._nav_pm);break;case 38:act&&Calendar.cellClick(cal._nav_py);break;case 39:act&&Calendar.cellClick(cal._nav_nm);break;case 40:act&&Calendar.cellClick(cal._nav_ny);break;default:return false;}}else switch(K){case 32:Calendar.cellClick(cal._nav_now);break;case 27:act&&cal.callCloseHandler();break;case 37:case 38:case 39:case 40:if(act){var prev,x,y,ne,el,step;prev=K==37||K==38;step=(K==37||K==39)?1:7;function setVars(){el=cal.currentDateEl;var p=el.pos;x=p&15;y=p>>4;ne=cal.ar_days[y][x];};setVars();function prevMonth(){var date=new Date(cal.date);date.setDate(date.getDate()-step);cal.setDate(date);};function nextMonth(){var date=new Date(cal.date);date.setDate(date.getDate()+step);cal.setDate(date);};while(1){switch(K){case 37:if(--x>=0)ne=cal.ar_days[y][x];else{x=6;K=38;continue;}break;case 38:if(--y>=0)ne=cal.ar_days[y][x];else{prevMonth();setVars();}break;case 39:if(++x<7)ne=cal.ar_days[y][x];else{x=0;K=40;continue;}break;case 40:if(++ythis.maxYear){year=this.maxYear;date.setFullYear(year);}this.firstDayOfWeek=firstDayOfWeek;this.date=new Date(date);var month=date.getMonth();var mday=date.getDate();var no_days=date.getMonthDays();date.setDate(1);var day1=(date.getDay()-this.firstDayOfWeek)%7;if(day1<0)day1+=7;date.setDate(-day1);date.setDate(date.getDate()+1);var row=this.tbody.firstChild;var MN=Calendar._SMN[month];var ar_days=this.ar_days=new Array();var weekend=Calendar._TT["WEEKEND"];var dates=this.multiple?(this.datesCells={}):null;for(var i=0;i<6;++i,row=row.nextSibling){var cell=row.firstChild;if(this.weekNumbers){cell.className="day wn";cell.innerHTML=date.getWeekNumber();cell=cell.nextSibling;}row.className="daysrow";var hasdays=false,iday,dpos=ar_days[i]=[];for(var j=0;j<7;++j,cell=cell.nextSibling,date.setDate(iday+1)){iday=date.getDate();var wday=date.getDay();cell.className="day";cell.pos=i<<4|j;dpos[j]=cell;var current_month=(date.getMonth()==month);if(!current_month){if(this.showsOtherMonths){cell.className+=" othermonth";cell.otherMonth=true;}else{cell.className="emptycell";cell.innerHTML=" ";cell.disabled=true;continue;}}else{cell.otherMonth=false;hasdays=true;}cell.disabled=false;cell.innerHTML=this.getDateText?this.getDateText(date,iday):iday;if(dates)dates[date.print("%Y%m%d")]=cell;if(this.getDateStatus){var status=this.getDateStatus(date,year,month,iday);if(this.getDateToolTip){var toolTip=this.getDateToolTip(date,year,month,iday);if(toolTip)cell.title=toolTip;}if(status===true){cell.className+=" disabled";cell.disabled=true;}else{if(/disabled/i.test(status))cell.disabled=true;cell.className+=" "+status;}}if(!cell.disabled){cell.caldate=new Date(date);cell.ttip="_";if(!this.multiple&¤t_month&&iday==mday&&this.hiliteToday){cell.className+=" selected";this.currentDateEl=cell;}if(date.getFullYear()==TY&&date.getMonth()==TM&&iday==TD){cell.className+=" today";cell.ttip+=Calendar._TT["PART_TODAY"];}if(weekend.indexOf(wday.toString())!=-1)cell.className+=cell.otherMonth?" oweekend":" weekend";}}if(!(hasdays||this.showsOtherMonths))row.className="emptyrow";}this.title.innerHTML=Calendar._MN[month]+", "+year;this.onSetTime();this.table.style.visibility="visible";this._initMultipleDates();};Calendar.prototype._initMultipleDates=function(){if(this.multiple){for(var i in this.multiple){var cell=this.datesCells[i];var d=this.multiple[i];if(!d)continue;if(cell)cell.className+=" selected";}}};Calendar.prototype._toggleMultipleDate=function(date){if(this.multiple){var ds=date.print("%Y%m%d");var cell=this.datesCells[ds];if(cell){var d=this.multiple[ds];if(!d){Calendar.addClass(cell,"selected");this.multiple[ds]=date;}else{Calendar.removeClass(cell,"selected");delete this.multiple[ds];}}}};Calendar.prototype.setDateToolTipHandler=function(unaryFunction){this.getDateToolTip=unaryFunction;};Calendar.prototype.setDate=function(date){if(!date.equalsTo(this.date)){this._init(this.firstDayOfWeek,date);}};Calendar.prototype.refresh=function(){this._init(this.firstDayOfWeek,this.date);};Calendar.prototype.setFirstDayOfWeek=function(firstDayOfWeek){this._init(firstDayOfWeek,this.date);this._displayWeekdays();};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(unaryFunction){this.getDateStatus=unaryFunction;};Calendar.prototype.setRange=function(a,z){this.minYear=a;this.maxYear=z;};Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat));}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this);}this.hideShowCovered();};Calendar.prototype.destroy=function(){var el=this.element.parentNode;el.removeChild(this.element);Calendar._C=null;window._dynarch_popupCalendar=null;};Calendar.prototype.reparent=function(new_parent){var el=this.element;el.parentNode.removeChild(el);new_parent.appendChild(el);};Calendar._checkCalendar=function(ev){var calendar=window._dynarch_popupCalendar;if(!calendar){return false;}var el=Calendar.is_ie?Calendar.getElement(ev):Calendar.getTargetElement(ev);for(;el!=null&&el!=calendar.element;el=el.parentNode);if(el==null){window._dynarch_popupCalendar.callCloseHandler();return Calendar.stopEvent(ev);}};Calendar.prototype.show=function(){var rows=this.table.getElementsByTagName("tr");for(var i=rows.length;i>0;){var row=rows[--i];Calendar.removeClass(row,"rowhilite");var cells=row.getElementsByTagName("td");for(var j=cells.length;j>0;){var cell=cells[--j];Calendar.removeClass(cell,"hilite");Calendar.removeClass(cell,"active");}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window._dynarch_popupCalendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar);}this.hideShowCovered();};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar);}this.element.style.display="none";this.hidden=true;this.hideShowCovered();};Calendar.prototype.showAt=function(x,y){var s=this.element.style;s.left=x+"px";s.top=y+"px";this.show();};Calendar.prototype.showAtElement=function(el,opts){var self=this;var p=Calendar.getAbsolutePos(el);if(!opts||typeof opts!="string"){this.showAt(p.x,p.y+el.offsetHeight);return true;}function fixPosition(box){if(box.x<0)box.x=0;if(box.y<0)box.y=0;var cp=document.createElement("div");var s=cp.style;s.position="absolute";s.right=s.bottom=s.width=s.height="0px";document.body.appendChild(cp);var br=Calendar.getAbsolutePos(cp);document.body.removeChild(cp);if(Calendar.is_ie){br.y+=document.body.scrollTop;br.x+=document.body.scrollLeft;}else{br.y+=window.scrollY;br.x+=window.scrollX;}var tmp=box.x+box.width-br.x;if(tmp>0)box.x-=tmp;tmp=box.y+box.height-br.y;if(tmp>0)box.y-=tmp;};this.element.style.display="block";Calendar.continuation_for_the_fucking_khtml_browser=function(){var w=self.element.offsetWidth;var h=self.element.offsetHeight;self.element.style.display="none";var valign=opts.substr(0,1);var halign="l";if(opts.length>1){halign=opts.substr(1,1);}switch(valign){case "T":p.y-=h;break;case "B":p.y+=el.offsetHeight;break;case "C":p.y+=(el.offsetHeight-h)/2;break;case "t":p.y+=el.offsetHeight-h;break;case "b":break;}switch(halign){case "L":p.x-=w;break;case "R":p.x+=el.offsetWidth;break;case "C":p.x+=(el.offsetWidth-w)/2;break;case "l":p.x+=el.offsetWidth-w;break;case "r":break;}p.width=w;p.height=h+40;self.monthsCombo.style.display="none";fixPosition(p);self.showAt(p.x,p.y);};if(Calendar.is_khtml)setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()",10);else Calendar.continuation_for_the_fucking_khtml_browser();};Calendar.prototype.setDateFormat=function(str){this.dateFormat=str;};Calendar.prototype.setTtDateFormat=function(str){this.ttDateFormat=str;};Calendar.prototype.parseDate=function(str,fmt){if(!fmt)fmt=this.dateFormat;this.setDate(Date.parseDate(str,fmt));};Calendar.prototype.hideShowCovered=function(){if(!Calendar.is_ie&&!Calendar.is_opera)return;function getVisib(obj){var value=obj.style.visibility;if(!value){if(document.defaultView&&typeof(document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml)value=document.defaultView. getComputedStyle(obj,"").getPropertyValue("visibility");else value='';}else if(obj.currentStyle){value=obj.currentStyle.visibility;}else value='';}return value;};var tags=new Array("applet","iframe","select");var el=this.element;var p=Calendar.getAbsolutePos(el);var EX1=p.x;var EX2=el.offsetWidth+EX1;var EY1=p.y;var EY2=el.offsetHeight+EY1;for(var k=tags.length;k>0;){var ar=document.getElementsByTagName(tags[--k]);var cc=null;for(var i=ar.length;i>0;){cc=ar[--i];p=Calendar.getAbsolutePos(cc);var CX1=p.x;var CX2=cc.offsetWidth+CX1;var CY1=p.y;var CY2=cc.offsetHeight+CY1;if(this.hidden||(CX1>EX2)||(CX2EY2)||(CY229)?1900:2000);break;case "%b":case "%B":for(j=0;j<12;++j){if(Calendar._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){m=j;break;}}break;case "%H":case "%I":case "%k":case "%l":hr=parseInt(a[i],10);break;case "%P":case "%p":if(/pm/i.test(a[i])&&hr<12)hr+=12;else if(/am/i.test(a[i])&&hr>=12)hr-=12;break;case "%M":min=parseInt(a[i],10);break;}}if(isNaN(y))y=today.getFullYear();if(isNaN(m))m=today.getMonth();if(isNaN(d))d=today.getDate();if(isNaN(hr))hr=today.getHours();if(isNaN(min))min=today.getMinutes();if(y!=0&&m!=-1&&d!=0)return new Date(y,m,d,hr,min,0);y=0;m=-1;d=0;for(i=0;i31&&y==0){y=parseInt(a[i],10);(y<100)&&(y+=(y>29)?1900:2000);}else if(d==0){d=a[i];}}if(y==0)y=today.getFullYear();if(m!=-1&&d!=0)return new Date(y,m,d,hr,min,0);return today;};Date.prototype.getMonthDays=function(month){var year=this.getFullYear();if(typeof month=="undefined"){month=this.getMonth();}if(((0==(year%4))&&((0!=(year%100))||(0==(year%400))))&&month==1){return 29;}else{return Date._MD[month];}};Date.prototype.getDayOfYear=function(){var now=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var then=new Date(this.getFullYear(),0,0,0,0,0);var time=now-then;return Math.floor(time/Date.DAY);};Date.prototype.getWeekNumber=function(){var d=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var DoW=d.getDay();d.setDate(d.getDate()-(DoW+6)%7+3);var ms=d.valueOf();d.setMonth(0);d.setDate(4);return Math.round((ms-d.valueOf())/(7*864e5))+1;};Date.prototype.equalsTo=function(date){return((this.getFullYear()==date.getFullYear())&&(this.getMonth()==date.getMonth())&&(this.getDate()==date.getDate())&&(this.getHours()==date.getHours())&&(this.getMinutes()==date.getMinutes()));};Date.prototype.setDateOnly=function(date){var tmp=new Date(date);this.setDate(1);this.setFullYear(tmp.getFullYear());this.setMonth(tmp.getMonth());this.setDate(tmp.getDate());};Date.prototype.print=function(str){var m=this.getMonth();var d=this.getDate();var y=this.getFullYear();var wn=this.getWeekNumber();var w=this.getDay();var s={};var hr=this.getHours();var pm=(hr>=12);var ir=(pm)?(hr-12):hr;var dy=this.getDayOfYear();if(ir==0)ir=12;var min=this.getMinutes();var sec=this.getSeconds();s["%a"]=Calendar._SDN[w];s["%A"]=Calendar._DN[w];s["%b"]=Calendar._SMN[m];s["%B"]=Calendar._MN[m];s["%C"]=1+Math.floor(y/100);s["%d"]=(d<10)?("0"+d):d;s["%e"]=d;s["%H"]=(hr<10)?("0"+hr):hr;s["%I"]=(ir<10)?("0"+ir):ir;s["%j"]=(dy<100)?((dy<10)?("00"+dy):("0"+dy)):dy;s["%k"]=hr;s["%l"]=ir;s["%m"]=(m<9)?("0"+(1+m)):(1+m);s["%M"]=(min<10)?("0"+min):min;s["%n"]="\n";s["%p"]=pm?"PM":"AM";s["%P"]=pm?"pm":"am";s["%s"]=Math.floor(this.getTime()/1000);s["%S"]=(sec<10)?("0"+sec):sec;s["%t"]="\t";s["%U"]=s["%W"]=s["%V"]=(wn<10)?("0"+wn):wn;s["%u"]=w+1;s["%w"]=w;s["%y"]=(''+y).substr(2,2);s["%Y"]=y;s["%%"]="%";var re=/%./g;if(!Calendar.is_ie5&&!Calendar.is_khtml)return str.replace(re,function(par){return s[par]||par;});var a=str.match(re);for(var i=0;i Date: Wed, 22 Feb 2006 13:07:48 +0000 Subject: add vonage click2call feature --- httemplate/elements/phonenumber.html | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 httemplate/elements/phonenumber.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/phonenumber.html b/httemplate/elements/phonenumber.html new file mode 100644 index 000000000..1330ca109 --- /dev/null +++ b/httemplate/elements/phonenumber.html @@ -0,0 +1,23 @@ +<% + my( $number, %opt ) = @_; + my $conf = new FS::Conf; + ( my $snumber = $number ) =~ s/\D//g; +%> + + + + +<% if ( length($number) ) { %> + <%= $number %> + <% if ( $opt{'callable'} && $conf->config('vonage-username') ) { %> + Call this number + <% } %> +<% } else { %> +   +<% } %> -- cgit v1.2.1 From 5f155263a2c9837640d2fab0817d1f36b8cb3f8c Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 10 Mar 2006 22:30:48 +0000 Subject: fix to (hopefully) allow multiple progress-init's in a page, also add second $cgi arg to all these progressbar calls... --- httemplate/elements/progress-init.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/progress-init.html b/httemplate/elements/progress-init.html index 7844f5678..ba9f6edd6 100644 --- a/httemplate/elements/progress-init.html +++ b/httemplate/elements/progress-init.html @@ -14,7 +14,7 @@ <%= include('/elements/xmlhttp.html', 'method' => 'POST', 'url' => $action, - 'subs' => [ 'start_job' ], + 'subs' => [ $key.'start_job' ], ) %> @@ -32,7 +32,7 @@ function <%=$key%>process () { document.<%=$formname%>.submit.disabled=true; - overlib( 'Submitting job to server...', WIDTH, 432, HEIGHT, 136, CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 ); + overlib( 'Submitting job to server...', WIDTH, 444, HEIGHT, 168, CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 ); var Hash = new Array(); var x = 0; @@ -68,13 +68,13 @@ function <%=$key%>process () { //alert('start_job( ' + Hash + ', <%=$key%>myCallback )' ); //alert('start_job()' ); - start_job( Hash, <%=$key%>myCallback ); + <%=$key%>start_job( Hash, <%=$key%>myCallback ); } function <%=$key%>myCallback( jobnum ) { - overlib( OLiframeContent('<%=$p%>elements/progress-popup.html?jobnum=' + jobnum + ';<%=$url_or_message_link%>;formname=<%=$formname%>' , 432, 136, 'progress_popup'), CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 ); + overlib( OLiframeContent('<%=$p%>elements/progress-popup.html?jobnum=' + jobnum + ';<%=$url_or_message_link%>;formname=<%=$formname%>' , 444, 168, 'progress_popup'), CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 ); } -- cgit v1.2.1 From 36d9b47e5c20ae3bc71c0bd0eaf289b566d0cf7c Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 11 Mar 2006 05:21:20 +0000 Subject: fix the progressbar bug with multiple progressbar forms on a page --- httemplate/elements/progress-init.html | 3 ++- httemplate/elements/xmlhttp.html | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/progress-init.html b/httemplate/elements/progress-init.html index ba9f6edd6..efebe48e9 100644 --- a/httemplate/elements/progress-init.html +++ b/httemplate/elements/progress-init.html @@ -14,7 +14,8 @@ <%= include('/elements/xmlhttp.html', 'method' => 'POST', 'url' => $action, - 'subs' => [ $key.'start_job' ], + 'subs' => [ 'start_job' ], + 'key' => $key, ) %> diff --git a/httemplate/elements/xmlhttp.html b/httemplate/elements/xmlhttp.html index 28130e501..e03438822 100644 --- a/httemplate/elements/xmlhttp.html +++ b/httemplate/elements/xmlhttp.html @@ -4,6 +4,7 @@ my $url = $opt{'url'}; my $method = exists($opt{'method'}) ? $opt{'method'} : 'GET'; #my @subs = @{ $opt{'subs'}; + my $key = exists($opt{'key'}) ? $opt{'key'} : ''; $url .= ( ($url =~ /\?/) ? '&' : '?' ) if $method eq 'GET'; @@ -38,10 +39,10 @@ %> - function <%=$func%>() { + function <%=$key%><%=$func%>() { // count args; build URL var url = "<%=$furl%>"; - var a = <%=$func%>.arguments; + var a = <%=$key%><%=$func%>.arguments; var args; var len; -- cgit v1.2.1 From d6a8b9a62765dbfe757e97c35a1c3ba2e0a32b42 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 11 Mar 2006 07:27:40 +0000 Subject: some pages from ui hoohaw have leaked footer include, need something here for now --- httemplate/elements/footer.html | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 httemplate/elements/footer.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/footer.html b/httemplate/elements/footer.html new file mode 100644 index 000000000..6029d7637 --- /dev/null +++ b/httemplate/elements/footer.html @@ -0,0 +1,2 @@ + + -- cgit v1.2.1 From c1bc54f7523d2af6114d7445bbbe5618f1429794 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 13 Mar 2006 22:32:51 +0000 Subject: fix progress hoohaw for internet exploder again, whew. also make sure error/finish messages are centered, looks better --- httemplate/elements/progress-init.html | 4 +++- httemplate/elements/progress-popup.html | 10 +++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/progress-init.html b/httemplate/elements/progress-init.html index efebe48e9..ec485f438 100644 --- a/httemplate/elements/progress-init.html +++ b/httemplate/elements/progress-init.html @@ -31,7 +31,9 @@ function <%=$key%>process () { //alert('<%=$key%>process for form <%=$formname%>'); - document.<%=$formname%>.submit.disabled=true; + if ( document.<%=$formname%>.submit.disabled == false ) { + document.<%=$formname%>.submit.disabled=true; + } overlib( 'Submitting job to server...', WIDTH, 444, HEIGHT, 168, CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 ); diff --git a/httemplate/elements/progress-popup.html b/httemplate/elements/progress-popup.html index 200f97d9b..544440138 100644 --- a/httemplate/elements/progress-popup.html +++ b/httemplate/elements/progress-popup.html @@ -45,7 +45,9 @@ function updateStatus( status_statustext ) { document.getElementById("progress_bar").innerHTML = ''; document.getElementById("progress_percent").innerHTML = ''; document.getElementById("progress_jobnum").innerHTML = ''; - parent.document.<%=$formname%>.submit.disabled=false; + if ( parent.document.<%=$formname%>.submit.disabled == true ) { + parent.document.<%=$formname%>.submit.disabled=false; + } <% } elsif ( $url ) { %> window.top.location.href = '<%= $url %>'; <% } else { %> @@ -56,7 +58,9 @@ function updateStatus( status_statustext ) { document.getElementById("progress_bar").innerHTML = ''; document.getElementById("progress_percent").innerHTML = ''; document.getElementById("progress_jobnum").innerHTML = ''; - parent.document.<%=$formname%>.submit.disabled=false; + if ( parent.document.<%=$formname%>.submit.disabled == true ) { + parent.document.<%=$formname%>.submit.disabled=false; + } } else { alert('XXX unknown status returned from server: ' + status); } @@ -64,7 +68,7 @@ function updateStatus( status_statustext ) { } - +
+ + + + +<% } %> -- cgit v1.2.1 From e65c6a26ca778166aec2b2d1dd3012ab84fa611a Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 7 May 2006 20:27:21 +0000 Subject: first pass at sales reports per agent and package class --- httemplate/elements/select-month_year.html | 19 ++++++++--- httemplate/elements/select-pkg_class.html | 7 ++-- httemplate/elements/select-table.html | 11 +++++- httemplate/elements/tr-select-from_to.html | 51 ++++++++++++++++++++++++++++ httemplate/elements/tr-select-pkg_class.html | 15 +++----- 5 files changed, 83 insertions(+), 20 deletions(-) create mode 100644 httemplate/elements/tr-select-from_to.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/select-month_year.html b/httemplate/elements/select-month_year.html index a0ea74ddd..2866960bd 100644 --- a/httemplate/elements/select-month_year.html +++ b/httemplate/elements/select-month_year.html @@ -5,13 +5,22 @@ my $prefix = $opt{'prefix'} || ''; my $disabled = $opt{'disabled'} || ''; my $empty = $opt{'empty_option'} || ''; + my $start_year = $opt{'start_year'}; + my $end_year = $opt{'end_year'} || '2037'; + + my @mon; + if ( $opt{'show_month_abbr'} ) { + @mon = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); + } else { + @mon = ( 1 .. 12 ); + } + my $date = $opt{'selected_date'} || ''; $date = '' if $date eq '-'; #$date ||= '01-2000' unless $empty; - my $start_year = $opt{'start_year'}; - my $end_year = $opt{'end_year'} || '2037'; - my( $mon, $year ) = (0, 0); + my $mon = $opt{'selected_mon'} || 0; + my $year = $opt{'selected_year'} || 0; if ( $date ) { if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format ( $mon, $year ) = ( $2, $1 ); @@ -34,8 +43,8 @@ <%= $empty ? ' + + + + + + + + diff --git a/httemplate/elements/tr-select-pkg_class.html b/httemplate/elements/tr-select-pkg_class.html index de10885c8..fbab0db14 100644 --- a/httemplate/elements/tr-select-pkg_class.html +++ b/httemplate/elements/tr-select-pkg_class.html @@ -1,16 +1,12 @@ <% my( $classnum, %opt ) = @_; - my @pkg_class; - if ( $opt{'pkg_class'} ) { - @pkg_class = @{ $opt{'pkg_class'} }; - } else { - @pkg_class = qsearch( 'pkg_class', {} ); # { disabled=>'' } ); - } + $opt{'pkg_class'} ||= [ qsearch( 'pkg_class', {} ) ]; # { disabled=>'' } ) + #warn "***** tr-select-pkg-class: \n". Dumper(%opt); %> -<% if ( scalar(@pkg_class) == 0 ) { %> +<% if ( scalar(@{ $opt{'pkg_class'} }) == 0 ) { %> @@ -19,10 +15,7 @@ -- cgit v1.2.1 From 2c757d7db4cb6a7b9655de13206fcc84fb7ce61f Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 14 May 2006 16:47:31 +0000 Subject: first part of ACL and re-skinning work and some other small stuff --- httemplate/elements/checkboxes-table.html | 110 ++++ httemplate/elements/cssexpr.js | 66 +++ httemplate/elements/footer.html | 3 + httemplate/elements/header.html | 289 +++++++++- httemplate/elements/menubar.html | 1 + httemplate/elements/select-access_group.html | 15 + httemplate/elements/tr-select-access_group.html | 22 + httemplate/elements/xmenu.css | 185 +++++++ httemplate/elements/xmenu.js | 668 ++++++++++++++++++++++++ 9 files changed, 1347 insertions(+), 12 deletions(-) create mode 100644 httemplate/elements/checkboxes-table.html create mode 100644 httemplate/elements/cssexpr.js create mode 100644 httemplate/elements/select-access_group.html create mode 100644 httemplate/elements/tr-select-access_group.html create mode 100644 httemplate/elements/xmenu.css create mode 100644 httemplate/elements/xmenu.js (limited to 'httemplate/elements') diff --git a/httemplate/elements/checkboxes-table.html b/httemplate/elements/checkboxes-table.html new file mode 100644 index 000000000..d26ebef35 --- /dev/null +++ b/httemplate/elements/checkboxes-table.html @@ -0,0 +1,110 @@ +<% + + ## + # required + ## + # 'target_table' => 'table_name', + # 'link_table' => 'table_name', + # + # 'name_col' => 'name_column', + # #or + # 'name_callback' => sub { }, + # + ## + # recommended (required?) + ## + # 'source_obj' => $obj, + # #or? + # #'source_table' => 'table_name', + # #'sourcenum' => '4', #current value of primary key in source_table + # # # (none is okay, just pass it if you have it) + ## + # optional + ## + # 'disable-able' => 1, + + my( %opt ) = @_; + + my $target_pkey = dbdef->table($opt{'target_table'})->primary_key; + + my( $source_pkey, $sourcenum, $source_obj ); + if ( $opt{'source_obj'} ) { + + $source_obj = $opt{'source_obj'}; + #$source_table = $source_obj->dbdef_table->table; + $source_pkey = $source_obj->dbdef_table->primary_key; + $sourcenum = $source_obj->$source_pkey(); + + } else { + + #$source_obj? + $source_pkey = $opt{'source_table'} + ? dbdef->table($opt{'source_table'})->primary_key + : ''; + $sourcenum = $opt{'sourcenum'}; + } + + my $hashref = $opt{'hashref'} || {}; + + my $extra_sql = ''; + + if ( $opt{'disable-able'} ) { + $hashref->{'disabled'} = ''; + + $extra_sql .= ( $sourcenum && $source_pkey ) + ? "OR $source_pkey = $sourcenum" + : ''; + } + +%> + +<% foreach my $target_obj ( + qsearch({ 'table' => $opt{'target_table'}, + 'hashref' => $hashref, + 'select' => $opt{'target_table'}. '.*', + 'addl_from' => "LEFT JOIN $opt{'link_table'} USING ( $target_pkey )", + 'extra_sql' => $extra_sql, + }) + ) { + + my $targetnum = $target_obj->$target_pkey(); +%> + + $sourcenum, + $target_pkey => $targetnum, + }) + ? 'CHECKED ' + : '' + %> VALUE="ON"> + + <% if ( $opt{'target_link'} ) { %> + + <% + + } + %><%= $targetnum %>: + + <% if ( $opt{'name_callback'} ) { %> + + <%= &{ $opt{'name_callback'} }( $target_obj ) %><%= $opt{'target_link'} ? '' : '' %> + + <% } else { + my $name_col = $opt{'name_col'}; + %> + + <%= $target_obj->$name_col() %><%= $opt{'target_link'} ? '' : '' %> + + <% } %> + + <% if ( $opt{'disable-able'} ) { %> + + <%= $target_obj->disabled =~ /^Y/i ? ' (DISABLED)' : '' %> + + <% } %> + +
+ +<% } %> + diff --git a/httemplate/elements/cssexpr.js b/httemplate/elements/cssexpr.js new file mode 100644 index 000000000..c434d8da0 --- /dev/null +++ b/httemplate/elements/cssexpr.js @@ -0,0 +1,66 @@ +function constExpression(x) { + return x; +} + +function simplifyCSSExpression() { + try { + var ss,sl, rs, rl; + ss = document.styleSheets; + sl = ss.length + + for (var i = 0; i < sl; i++) { + simplifyCSSBlock(ss[i]); + } + } + catch (exc) { + //alert("Got an error while processing css. The page should still work but might be a bit slower"); + throw exc; + } +} + +function simplifyCSSBlock(ss) { + var rs, rl; + + for (var i = 0; i < ss.imports.length; i++) + simplifyCSSBlock(ss.imports[i]); + + if (ss.cssText.indexOf("expression(constExpression(") == -1) + return; + + rs = ss.rules; + rl = rs.length; + for (var j = 0; j < rl; j++) + simplifyCSSRule(rs[j]); + +} + +function simplifyCSSRule(r) { + var str = r.style.cssText; + var str2 = str; + var lastStr; + do { + lastStr = str2; + str2 = simplifyCSSRuleHelper(lastStr); + } while (str2 != lastStr) + + if (str2 != str) + r.style.cssText = str2; +} + +function simplifyCSSRuleHelper(str) { + var i, i2; + i = str.indexOf("expression(constExpression("); + if (i == -1) return str; + i2 = str.indexOf("))", i); + var hd = str.substring(0, i); + var tl = str.substring(i2 + 2); + var exp = str.substring(i + 27, i2); + var val = eval(exp) + return hd + val + tl; +} + +if (/msie/i.test(navigator.userAgent) && window.attachEvent != null) { + window.attachEvent("onload", function () { + simplifyCSSExpression(); + }); +} diff --git a/httemplate/elements/footer.html b/httemplate/elements/footer.html index 6029d7637..32d121996 100644 --- a/httemplate/elements/footer.html +++ b/httemplate/elements/footer.html @@ -1,2 +1,5 @@ + + +
Server processing job... -- cgit v1.2.1 From 1a033848671cad2cbe7687b37fc718b3b2a68b83 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 22 Apr 2006 00:58:40 +0000 Subject: start of package class web UI (add/edit package classes, package class selection in package def edit) --- httemplate/elements/select-agent.html | 32 ++++++++------------ httemplate/elements/select-pkg_class.html | 16 ++++++++++ httemplate/elements/select-table.html | 45 ++++++++++++++++++++++++++++ httemplate/elements/tr-select-pkg_class.html | 29 ++++++++++++++++++ 4 files changed, 102 insertions(+), 20 deletions(-) create mode 100644 httemplate/elements/select-pkg_class.html create mode 100644 httemplate/elements/select-table.html create mode 100644 httemplate/elements/tr-select-pkg_class.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/select-agent.html b/httemplate/elements/select-agent.html index c2a5e4bde..aa480a54b 100644 --- a/httemplate/elements/select-agent.html +++ b/httemplate/elements/select-agent.html @@ -1,24 +1,16 @@ <% my( $agentnum, %opt ) = @_; - my @agents; - if ( $opt{'agents'} ) { - @agents = @{ $opt{'agents'} }; - } else { - @agents = qsearch( 'agent', { disabled=>'' } ); - } - + my %select_opt = (); + $select_opt{'records'} = $opt{'agents'} + if $opt{'agents'}; + +%><%= include( '/elements/select-table.html', + 'table' => 'agent', + 'name_col' => 'agent', + 'value' => $agentnum, + 'empty_label' => 'all', + 'hashref' => { 'disabled' => '' }, + %select_opt, + ) %> - - - diff --git a/httemplate/elements/select-pkg_class.html b/httemplate/elements/select-pkg_class.html new file mode 100644 index 000000000..5486e0877 --- /dev/null +++ b/httemplate/elements/select-pkg_class.html @@ -0,0 +1,16 @@ +<% + my( $classnum, %opt ) = @_; + + my %select_opt = (); + $select_opt{'records'} = $opt{'pkg_class'} + if $opt{'pkg_class'}; + +%><%= include( '/elements/select-table.html', + 'table' => 'pkg_class', + 'name_col' => 'classname', + 'value' => $classnum, + 'empty_label' => '(none)', + #'hashref' => { 'disabled' => '' }, + #%select_opt, + ) +%> diff --git a/httemplate/elements/select-table.html b/httemplate/elements/select-table.html new file mode 100644 index 000000000..10cc8b995 --- /dev/null +++ b/httemplate/elements/select-table.html @@ -0,0 +1,45 @@ +<% + + ##required + # 'table' => 'table_name', + # 'name_col' => 'name_column', + # + ##strongly recommended (you want your forms to be "sticky" on errors, right?) + # 'value' => 'current_value', + # + ##opt + # 'empty_label' => '', #better specify it though, the default might change + # 'hashref' => {}, + # 'records' => \@records, #instead of hashref + + my( %opt ) = @_; + + my $key = dbdef->table($opt{'table'})->primary_key; #? $opt{'primary_key'} || + + my $name_col = $opt{'name_col'}; + + my @records = (); + if ( $opt{'records'} ) { + @records = @{ $opt{'records'} }; + } else { + @records = qsearch( $opt{'table'}, ( $opt{'hashref'} || {} ) ); + } + +%> + + + diff --git a/httemplate/elements/tr-select-pkg_class.html b/httemplate/elements/tr-select-pkg_class.html new file mode 100644 index 000000000..de10885c8 --- /dev/null +++ b/httemplate/elements/tr-select-pkg_class.html @@ -0,0 +1,29 @@ +<% + my( $classnum, %opt ) = @_; + + my @pkg_class; + if ( $opt{'pkg_class'} ) { + @pkg_class = @{ $opt{'pkg_class'} }; + } else { + @pkg_class = qsearch( 'pkg_class', {} ); # { disabled=>'' } ); + } + +%> + +<% if ( scalar(@pkg_class) == 0 ) { %> + + + +<% } else { %> + +
<%= $opt{'label'} || 'Package class' %> + <%= include( '/elements/select-pkg_class.html', $classnum, + 'pkg_class' => \@pkg_class, + ) + %> +
From: + <%= include('/elements/select-month_year.html', + 'prefix' => 'start', + 'selected_mon' => $smonth, + 'selected_year' => $syear, + %hash, + ) + %> +
To: + <%= include('/elements/select-month_year.html', + 'prefix' => 'end', + 'selected_mon' => $emonth, + 'selected_year' => $eyear, + %hash, + ) + %> +
<%= $opt{'label'} || 'Package class' %> - <%= include( '/elements/select-pkg_class.html', $classnum, - 'pkg_class' => \@pkg_class, - ) - %> + <%= include( '/elements/select-pkg_class.html', $classnum, %opt ) %>
diff --git a/httemplate/elements/header.html b/httemplate/elements/header.html index 10e4e40f1..49814577e 100644 --- a/httemplate/elements/header.html +++ b/httemplate/elements/header.html @@ -2,20 +2,285 @@ my($title, $menubar) = ( shift, shift ); my $etc = @_ ? shift : ''; #$etc is for things like onLoad= etc. my $head = @_ ? shift : ''; #$head is for things that go in the section + my $conf = new FS::Conf; %> - - - - <%= $title %> - - - - - <%= $head %> - - > + + + + + <%= $title %> + + + + + + + + <% + + tie my %report_menu, 'Tie::IxHash', + 'Report one' => [ 'there', 'theretip' ], + 'Report too' => [ 'here', 'heretip' ], + ; + + tie my %config_employees, 'Tie::IxHash', + 'View/Edit employees' => [ $fsurl.'browse/access_user.html', 'Setup internal users' ], + 'View/Edit employee groups' => [ $fsurl.'browse/access_group.html', 'Employee groups allow you to control access to the backend' ], + ; + + tie my %config_export_svc_pkg, 'Tie::IxHash', + 'View/Edit exports' => [ $fsurl.'browse/part_export.cgi', 'Provisioning services to external machines, databases and APIs' ], + 'View/Edit service definitions' => [ $fsurl.'browse/part_svc.cgi', 'Services are items you offer to your customers' ], + 'View/Edit package definitions' => [ $fsurl.'browse/part_pkg.cgi', 'One or more services are grouped together into a package and given pricing information. Customers purchase packages, not services' ], + 'View/Edit package classes' => [ $fsurl.'browse/pkg_class.html', 'Package classes define groups of packages, for reporting and convenience purposes.' ], + ; + + tie my %config_agent, 'Tie::IxHash', + 'View/Edit agent types' => [ $fsurl.'browse/agent_type.cgi', 'Agent types define groups of package definitions that you can then assign to particular agents' ], + 'View/Edit agents' => [ $fsurl.'browse/agent.cgi', 'Agents are resellers of your service. Agents may be limited to a subset of your full offerings (via their type)' ], + ; + + tie my %config_billing, 'Tie::IxHash', + 'View/Edit payment gateways' => [ $fsurl.'browse/payment_gateway.html', 'Credit card and electronic check processors' ], + 'View/Edit invoice events' => [ $fsurl.'browse/part_bill_event.cgi', 'Actions for overdue invoices' ], + 'View/Edit prepaid cards' => [ $fsurl.'browse/prepay_credit.html', 'View outstanding cards, generate new cards' ], + 'View/Edit call rates and regions' => [ $fsurl.'browse/rate.cgi', 'Manage rate plans, regions and prefixes for VoIP and call billing' ], + 'View/Edit locales and tax rates' => [ $fsurl.'browse/cust_main_county.cgi', 'Change tax rates, or break down a country into states, or a state into counties and assign different tax rates to each' ], + ; + + tie my %config_dialup, 'Tie::IxHash', + 'View/Edit access numbers' => [ $fsurl.'browse/svc_acct_pop.cgi', 'Points of Presence' ], + ; + + tie my %config_broadband, 'Tie::IxHash', + 'View/Edit routers' => [ $fsurl.'browse/router.cgi', 'Broadband access routers' ], + 'View/Edit address blocks' => [ $fsurl.'browse/addr_block.cgi', 'Manage address blocks and block assignments to broadband routers' ], + ; + + tie my %config_misc, 'Tie::IxHash', + 'View/Edit advertising sources' => [ $fsurl.'browse/part_referral.cgi', 'Where a customer heard about your service. Tracked for informational purposes' ], + 'View/Edit virtual fields' => [ $fsurl.'browse/part_virtual_field.cgi', 'Locally defined fields', ], + 'View/Edit message catalog' => [ $fsurl.'browse/msgcat.cgi', 'Change error messages and other customizable labels' ], + 'View/Edit inventory classes and inventory' => [ $fsurl.'browse/inventory_class.html', 'Setup inventory classes and stock inventory' ], + ; + + tie my %config_menu, 'Tie::IxHash', + 'Settings' => [ $fsurl.'config/config-view.cgi', 'XXXconfigittip' ], + 'separator' => '', #its a separator! + 'Employees' => [ \%config_employees, 'XXXtooltip' ], + 'Provisioning, services and packages' + => [ \%config_export_svc_pkg, 'XXXtootip' ], + 'Resellers' => [ \%config_agent, 'XXXtootip' ], + 'Billing' => [ \%config_billing, 'XXXtootip' ], + 'Dialup' => [ \%config_dialup, 'XXXtootip' ], + 'Fixed (username-less) broadband' + => [ \%config_broadband, 'XXXtootip' ], + 'Miscellaneous' => [ \%config_misc, 'XXXtootip' ], + ; + + tie my %menu, 'Tie::IxHash', + 'Home' => [ $fsurl, 'hometip', ], + 'Top item one' => [ 'nowhere_yet', 'nowheretip', ], + 'Top item too' => [ 'nowhere_yet_either', 'eithertip', ], + 'Reports' => [ \%report_menu, 'reportmenutip' ], + 'Configuration' => [ \%config_menu, 'configmenutip' ], + ; + + use vars qw($gmenunum); + $gmenunum = 0; + + sub submenu { + my($submenu, $title) = @_; + my $menunum = $gmenunum++; + + #return two args: html, menuname + + "var myMenu$menunum = new WebFXMenu;\n". + #"myMenu$menunum.useAutoPosition = true;\n". + "myMenu$menunum.emptyText = '$title';\n". + + ( + join("\n", map { + + if ( !ref( $submenu->{$_} ) ) { + + "myMenu$menunum.add(new WebFXMenuSeparator());"; + + } else { + + my($url_or_submenu, $tooltip ) = @{ $submenu->{$_} }; + if ( ref($url_or_submenu) ) { + + my($subhtml, $submenuname ) = submenu($url_or_submenu, $_); #mmm, recursion + + "$subhtml\n". + "myMenu$menunum.add(new WebFXMenuItem(\"$_\", null, \"$tooltip\", $submenuname ));"; + + } else { + + "myMenu$menunum.add(new WebFXMenuItem(\"$_\", \"$url_or_submenu\", \"$tooltip\" ));"; + + } + + } + + } keys %$submenu ) + ). "\n". + "myMenu$menunum.width = 224\n", + + "myMenu$menunum"; + + } + + %> + + + + + <%= $head %> + + + STYLE="margin-top:0; margin-bottom:0; margin-left:0; margin-right:0"> + + + + + + + + + +
+ freeside + + <%= $conf->config('company_name') %> Billing + Logged in as <%= getotaker %> 
Preferences 

+
+ + + + + <% if ( $conf->config('ticket_system') eq 'RT_Internal' ) { %> + <% eval "use RT;"; %> + + + <% } %> + + +
+ + Freeside v<%= $FS::VERSION %>
+ Documentation
+
+
+ + RT v<%= $RT::VERSION %>
+
Documentation
+
+
+ +
+ + + + + + + + + + + +
+ +
+ +
+
+
+ + +
+
+
+ + +
+
+ + + + + + + + + + + + + + +<% } %> diff --git a/httemplate/elements/xmenu.css b/httemplate/elements/xmenu.css new file mode 100644 index 000000000..5bb8a0deb --- /dev/null +++ b/httemplate/elements/xmenu.css @@ -0,0 +1,185 @@ + +.webfx-menu, .webfx-menu * { + /* + Set the box sizing to content box + in the future when IE6 supports box-sizing + there will be an issue to fix the sizes + + There is probably an issue with IE5 mac now + because IE5 uses content-box but the script + assumes all versions of IE uses border-box. + + At the time of this writing mozilla did not support + box-sizing for absolute positioned element. + + Opera only supports content-box + */ + box-sizing: content-box; + -moz-box-sizing: content-box; +} + +.webfx-menu { + position: absolute; + z-index: 100; + visibility: hidden; + width: 154px; + border: 1px solid black; + padding: 1px; + background: white; + filter: progid:DXImageTransform.Microsoft.Shadow(color="#777777", Direction=135, Strength=4) + alpha(Opacity=95); + -moz-opacity: 0.95; + /* a drop shadow would be nice in moz/others too... */ +} + +.webfx-menu-empty { + display: block; + border: 1px solid white; + padding: 2px 5px 2px 5px; + font-size: 11px; + /* font-family: Tahoma, Verdan, Helvetica, Sans-Serif; */ + color: black; +} + +.webfx-menu a { + display: block; + width: expression(constExpression(ieBox ? "100%": "auto")); /* should be ignored by mz and op */ + height: expression(constExpression("1px")); + overflow: visible; + padding: 2px 0px 2px 5px; + font-size: 11px; + font-family: Tahoma, Verdan, Helvetica, Sans-Serif; + text-decoration: none; + vertical-align: center; + color: black; + border: 1px solid white; +} + +.webfx-menu a:visited, +.webfx-menu a:visited:hover { + color: black; +} + +.webfx-menu a:hover { + color: black; + /* background: #faf7fa; #f5ebf4; #efdfef; white; #BC79B8; */ + /* background: #ffe6fe; */ + /* background: #ffc2fe; */ + background: #fff2fe; + border: 1px solid #7e0079; /*rgb(120,172,255);#ff8800;*/ +} + +.webfx-menu a .arrow { + float: right; + border: 0; + width: 3px; + margin-right: 3px; + margin-top: 4px; +} + +/* separtor */ +.webfx-menu div { + height: 0; + height: expression(constExpression(ieBox ? "2px" : "0")); + border-top: 1px solid #7e0079; /* rgb(120,172,255); */ + border-bottom: 1px solid rgb(234,242,255); + overflow: hidden; + margin: 2px 0px 2px 0px; + font-size: 0mm; +} + +.webfx-menu-bar { + /* i want a vertical bar */ + display: block; + + /* background: rgb(120,172,255);/*rgb(255,128,0);*/ + /* background: #a097ed; */ + background: #000000; + /* border: 1px solid #7E0079; */ + /* border: 1px solid #000000; */ + /* border: none */ + + padding: 2px; + + font-family: Verdana, Helvetica, Sans-Serif; + font-size: 11px; + + /* IE5.0 has the wierdest box model for inline elements */ + padding: expression(constExpression(ie50 ? "0px" : "2px")); +} + +.webfx-menu-bar a, +.webfx-menu-bar a:visited { + /* i want a vertical bar */ + display: block; + + /* border: 1px solid black; /*rgb(0,0,0);/*rgb(255,128,0);*/ + /* border: 1px solid black; /* #ffffff; */ + /* border-bottom: 1px solid black; */ + border-bottom: 1px solid white; + /* border-bottom: 1px solid rgb(0,66,174); + /* border-bottom: 1px solid black; + border-bottom: 1px solid black; + border-bottom: 1px solid black; */ + + padding: 1px 5px 1px 5px; + + /* color: black; */ + color: white; + text-decoration: none; + + /* IE5.0 Does not paint borders and padding on inline elements without a height/width */ + height: expression(constExpression(ie50 ? "17px" : "auto")); +} + +.webfx-menu-bar a:hover { + /* color: black; */ + color: white; + /* background: rgb(120,172,255); */ + /* background: #BC79B8; */ + background: #7E0079; + /* border-left: 1px solid rgb(234,242,255); + border-right: 1px solid rgb(0,66,174); + border-top: 1px solid rgb(234,242,255); + border-bottom: 1px solid rgb(0,66,174); */ +} + +.webfx-menu-bar a .arrow { + border: 0; + float: right; +/* vertical-align: top; */ + width: 3px; + margin-right: 3px; + margin-top: 4px; +} + +.webfx-menu-bar a:active, .webfx-menu-bar a:focus { + -moz-outline: none; + outline: none; + /* + ie does not support outline but ie55 can hide the outline using + a proprietary property on HTMLElement. Did I say that IE sucks at CSS? + */ + ie-dummy: expression(this.hideFocus=true); + + border-left: 1px solid rgb(0,66,174); + border-right: 1px solid rgb(234,242,255); + border-top: 1px solid rgb(0,66,174); + border-bottom: 1px solid rgb(234,242,255); +} + +.webfx-menu-title { + color: black; + /* background: #faf7fa; #f5ebf4; #efdfef; white; #BC79B8; */ + background: #7e0079; +/* border: 1px solid #7e0079; /*rgb(120,172,255);#ff8800;*/ + padding: 3px 1px 3px 6px; + display: block; + font-size: 13px; + font-family: Tahoma, Verdan, Helvetica, Sans-Serif; + text-decoration: none; + color: white; +/* border: 1px solid white; */ + border-bottom: 1px solid white; +} + diff --git a/httemplate/elements/xmenu.js b/httemplate/elements/xmenu.js new file mode 100644 index 000000000..134265f53 --- /dev/null +++ b/httemplate/elements/xmenu.js @@ -0,0 +1,668 @@ +// + <% tie my %report_menu, 'Tie::IxHash', @@ -183,10 +184,16 @@ + + @@ -200,7 +207,7 @@ freeside @@ -248,13 +255,13 @@ diff --git a/httemplate/elements/xmenu.css b/httemplate/elements/xmenu.css index 5bb8a0deb..60881b813 100644 --- a/httemplate/elements/xmenu.css +++ b/httemplate/elements/xmenu.css @@ -55,9 +55,14 @@ border: 1px solid white; } -.webfx-menu a:visited, -.webfx-menu a:visited:hover { +.webfx-menu a:visited { color: black; + border: 1px solid white; +} + +.webfx-menu a:hover { + color: black; + border: 1px solid #7e0079; } .webfx-menu a:hover { @@ -98,11 +103,12 @@ /* border: 1px solid #7E0079; */ /* border: 1px solid #000000; */ /* border: none */ + color: white; padding: 2px; font-family: Verdana, Helvetica, Sans-Serif; - font-size: 11px; + /* font-size: 11px; */ /* IE5.0 has the wierdest box model for inline elements */ padding: expression(constExpression(ie50 ? "0px" : "2px")); @@ -132,6 +138,10 @@ height: expression(constExpression(ie50 ? "17px" : "auto")); } +.webfx-menu-bar a:link { + color: white; +} + .webfx-menu-bar a:hover { /* color: black; */ color: white; -- cgit v1.2.1 From 64dc1bb0f70ccc0b828cc1d758cd82f040e0ec33 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 15 May 2006 13:57:15 +0000 Subject: move most of the crap on the "main menu" to the sidebar --- httemplate/elements/freeside.css | 2 +- httemplate/elements/header.html | 169 +--------------------- httemplate/elements/menu.html | 298 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 300 insertions(+), 169 deletions(-) create mode 100644 httemplate/elements/menu.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/freeside.css b/httemplate/elements/freeside.css index 5908e6aab..6f7cadb2e 100644 --- a/httemplate/elements/freeside.css +++ b/httemplate/elements/freeside.css @@ -3,7 +3,7 @@ } A:link IMG, A:visited { border-style: none } -A:focus {text-decoration: underline } +/* A:focus {text-decoration: underline } */ a:link, a:visited { /* text-decoration: none; */ diff --git a/httemplate/elements/header.html b/httemplate/elements/header.html index 0eb5695ce..2be2c7938 100644 --- a/httemplate/elements/header.html +++ b/httemplate/elements/header.html @@ -13,175 +13,8 @@ - - - - - <% - tie my %report_menu, 'Tie::IxHash', - 'Report one' => [ 'there', 'theretip' ], - 'Report too' => [ 'here', 'heretip' ], - ; - - tie my %config_employees, 'Tie::IxHash', - 'View/Edit employees' => [ $fsurl.'browse/access_user.html', 'Setup internal users' ], - 'View/Edit employee groups' => [ $fsurl.'browse/access_group.html', 'Employee groups allow you to control access to the backend' ], - ; - - tie my %config_export_svc_pkg, 'Tie::IxHash', - 'View/Edit exports' => [ $fsurl.'browse/part_export.cgi', 'Provisioning services to external machines, databases and APIs' ], - 'View/Edit service definitions' => [ $fsurl.'browse/part_svc.cgi', 'Services are items you offer to your customers' ], - 'View/Edit package definitions' => [ $fsurl.'browse/part_pkg.cgi', 'One or more services are grouped together into a package and given pricing information. Customers purchase packages, not services' ], - 'View/Edit package classes' => [ $fsurl.'browse/pkg_class.html', 'Package classes define groups of packages, for reporting and convenience purposes.' ], - ; - - tie my %config_agent, 'Tie::IxHash', - 'View/Edit agent types' => [ $fsurl.'browse/agent_type.cgi', 'Agent types define groups of package definitions that you can then assign to particular agents' ], - 'View/Edit agents' => [ $fsurl.'browse/agent.cgi', 'Agents are resellers of your service. Agents may be limited to a subset of your full offerings (via their type)' ], - ; - - tie my %config_billing, 'Tie::IxHash', - 'View/Edit payment gateways' => [ $fsurl.'browse/payment_gateway.html', 'Credit card and electronic check processors' ], - 'View/Edit invoice events' => [ $fsurl.'browse/part_bill_event.cgi', 'Actions for overdue invoices' ], - 'View/Edit prepaid cards' => [ $fsurl.'browse/prepay_credit.html', 'View outstanding cards, generate new cards' ], - 'View/Edit call rates and regions' => [ $fsurl.'browse/rate.cgi', 'Manage rate plans, regions and prefixes for VoIP and call billing' ], - 'View/Edit locales and tax rates' => [ $fsurl.'browse/cust_main_county.cgi', 'Change tax rates, or break down a country into states, or a state into counties and assign different tax rates to each' ], - ; - - tie my %config_dialup, 'Tie::IxHash', - 'View/Edit access numbers' => [ $fsurl.'browse/svc_acct_pop.cgi', 'Points of Presence' ], - ; - - tie my %config_broadband, 'Tie::IxHash', - 'View/Edit routers' => [ $fsurl.'browse/router.cgi', 'Broadband access routers' ], - 'View/Edit address blocks' => [ $fsurl.'browse/addr_block.cgi', 'Manage address blocks and block assignments to broadband routers' ], - ; - - tie my %config_misc, 'Tie::IxHash', - 'View/Edit advertising sources' => [ $fsurl.'browse/part_referral.cgi', 'Where a customer heard about your service. Tracked for informational purposes' ], - 'View/Edit virtual fields' => [ $fsurl.'browse/part_virtual_field.cgi', 'Locally defined fields', ], - 'View/Edit message catalog' => [ $fsurl.'browse/msgcat.cgi', 'Change error messages and other customizable labels' ], - 'View/Edit inventory classes and inventory' => [ $fsurl.'browse/inventory_class.html', 'Setup inventory classes and stock inventory' ], - ; - - tie my %config_menu, 'Tie::IxHash', - 'Settings' => [ $fsurl.'config/config-view.cgi', 'XXXconfigittip' ], - 'separator' => '', #its a separator! - 'Employees' => [ \%config_employees, 'XXXtooltip' ], - 'Provisioning, services and packages' - => [ \%config_export_svc_pkg, 'XXXtootip' ], - 'Resellers' => [ \%config_agent, 'XXXtootip' ], - 'Billing' => [ \%config_billing, 'XXXtootip' ], - 'Dialup' => [ \%config_dialup, 'XXXtootip' ], - 'Fixed (username-less) broadband' - => [ \%config_broadband, 'XXXtootip' ], - 'Miscellaneous' => [ \%config_misc, 'XXXtootip' ], - ; - - tie my %menu, 'Tie::IxHash', - 'Home' => [ $fsurl, 'hometip', ], - 'Top item one' => [ 'nowhere_yet', 'nowheretip', ], - 'Top item too' => [ 'nowhere_yet_either', 'eithertip', ], - 'Reports' => [ \%report_menu, 'reportmenutip' ], - 'Configuration' => [ \%config_menu, 'configmenutip' ], - ; - - use vars qw($gmenunum); - $gmenunum = 0; - - sub submenu { - my($submenu, $title) = @_; - my $menunum = $gmenunum++; - - #return two args: html, menuname - - "var myMenu$menunum = new WebFXMenu;\n". - #"myMenu$menunum.useAutoPosition = true;\n". - "myMenu$menunum.emptyText = '$title';\n". - - ( - join("\n", map { - - if ( !ref( $submenu->{$_} ) ) { - - "myMenu$menunum.add(new WebFXMenuSeparator());"; - - } else { - - my($url_or_submenu, $tooltip ) = @{ $submenu->{$_} }; - if ( ref($url_or_submenu) ) { - - my($subhtml, $submenuname ) = submenu($url_or_submenu, $_); #mmm, recursion - - "$subhtml\n". - "myMenu$menunum.add(new WebFXMenuItem(\"$_\", null, \"$tooltip\", $submenuname ));"; - - } else { - - "myMenu$menunum.add(new WebFXMenuItem(\"$_\", \"$url_or_submenu\", \"$tooltip\" ));"; - - } - - } - - } keys %$submenu ) - ). "\n". - "myMenu$menunum.width = 224\n", - - "myMenu$menunum"; - - } - - %> - + <%= include('menu.html', 'freeside_baseurl' => $fsurl ) %> + + + + + -- cgit v1.2.1 From e631aea6e8c9dbc41192948468314afd7b806613 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 22 May 2006 00:45:37 +0000 Subject: 1.7.0? why not! --- httemplate/elements/menu.html | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index 8502c0746..29ef53575 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -121,6 +121,7 @@ #
--> tie my %tools_menu, 'Tie::IxHash', + 'Quick payment entry' => [ $fsurl.'misc/batch-cust_pay.html', 'Enter multiple payments in a batch' ], 'Job Queue' => [ $fsurl.'search/queue.html', 'View pending job queue' ], 'Importing' => [ \%tools_importing, 'Import tools' ], 'Exporting' => [ \%tools_exporting, 'Export tools' ], @@ -168,17 +169,17 @@ ; tie my %config_menu, 'Tie::IxHash', - 'Settings' => [ $fsurl.'config/config-view.cgi', 'XXXconfigittip' ], + 'Settings' => [ $fsurl.'config/config-view.cgi', '' ], 'separator' => '', #its a separator! - 'Employees' => [ \%config_employees, 'XXXtooltip' ], + 'Employees' => [ \%config_employees, '' ], 'Provisioning, services and packages' - => [ \%config_export_svc_pkg, 'XXXtootip' ], - 'Resellers' => [ \%config_agent, 'XXXtootip' ], - 'Billing' => [ \%config_billing, 'XXXtootip' ], - 'Dialup' => [ \%config_dialup, 'XXXtootip' ], + => [ \%config_export_svc_pkg, '' ], + 'Resellers' => [ \%config_agent, '' ], + 'Billing' => [ \%config_billing, '' ], + 'Dialup' => [ \%config_dialup, '' ], 'Fixed (username-less) broadband' - => [ \%config_broadband, 'XXXtootip' ], - 'Miscellaneous' => [ \%config_misc, 'XXXtootip' ], + => [ \%config_broadband, '' ], + 'Miscellaneous' => [ \%config_misc, '' ], ; tie my %menu, 'Tie::IxHash', @@ -253,7 +254,7 @@ webfxMenuImagePath = "<%=$fsurl%>images/"; webfxMenuUseHover = 1; webfxMenuShowTime = 300; - webfxMenuHideTime = 500; + webfxMenuHideTime = 300; var myBar = new WebFXMenuBar; -- cgit v1.2.1 From 3a820c27d5290f9d2761636b2b4fe865caeb0804 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 2 Jun 2006 13:20:24 +0000 Subject: add a service search --- httemplate/elements/header.html | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/header.html b/httemplate/elements/header.html index 2be2c7938..3aa81be3b 100644 --- a/httemplate/elements/header.html +++ b/httemplate/elements/header.html @@ -21,9 +21,12 @@ if ( what.value = '(cust #, name or company)' ) what.value = ''; } - - - + <% if ( length($number) ) { %> <%= $number %> <% if ( $opt{'callable'} && $conf->config('vonage-username') ) { %> -- cgit v1.2.1 From a0732f52fdcc2bca7c399d1249ccceb191de51cd Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 25 Jul 2006 08:33:46 +0000 Subject: this should finish adding the "inactive" status, i think? --- httemplate/elements/table-grid.html | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'httemplate/elements') diff --git a/httemplate/elements/table-grid.html b/httemplate/elements/table-grid.html index 17eafdf1a..fd1cb9113 100644 --- a/httemplate/elements/table-grid.html +++ b/httemplate/elements/table-grid.html @@ -5,9 +5,15 @@ %>
+ +
+ + +
+ <%= $title %> +

- <%= $menubar ? "$menubar

" : '' %> + <%= $menubar !~ /^\s*$/ ? "$menubar

" : '' %> diff --git a/httemplate/elements/menubar.html b/httemplate/elements/menubar.html index 87a50312c..29facb6b6 100644 --- a/httemplate/elements/menubar.html +++ b/httemplate/elements/menubar.html @@ -2,6 +2,7 @@ my($item, $url, @html); while (@_) { ($item, $url) = splice(@_,0,2); + next if $item =~ /^\s*Main\s+Menu\s*$/i; push @html, qq!$item!; } %> diff --git a/httemplate/elements/select-access_group.html b/httemplate/elements/select-access_group.html new file mode 100644 index 000000000..b05f565ea --- /dev/null +++ b/httemplate/elements/select-access_group.html @@ -0,0 +1,15 @@ +<% + my( $groupnum, %opt ) = @_; + + %opt{'records'} = delete $opt{'access_group'} + if $opt{'access_group'}; + +%><%= include( '/elements/select-table.html', + 'table' => 'access_group', + 'name_col' => 'groupname', + 'value' => $groupnum, + 'empty_label' => '(none)', + #'hashref' => { 'disabled' => '' }, + %opt, + ) +%> diff --git a/httemplate/elements/tr-select-access_group.html b/httemplate/elements/tr-select-access_group.html new file mode 100644 index 000000000..0beec0842 --- /dev/null +++ b/httemplate/elements/tr-select-access_group.html @@ -0,0 +1,22 @@ +<% + my( $groupnum, %opt ) = @_; + + $opt{'access_group'} ||= [ qsearch( 'access_group', {} ) ]; # { disabled=>'' } ) + + #warn "***** tr-select-access_group: \n". Dumper(%opt); +%> + +<% if ( scalar(@{ $opt{'access_group'} }) == 0 ) { %> + + + +<% } else { %> + +
<%= $opt{'label'} || 'Access group' %> + <%= include( '/elements/select-access_group.html', $groupnum, %opt ) %> +
- <%= $conf->config('company_name') %> Billing + <%= $conf->config('company_name') || 'ExampleCo' %> Logged in as <%= getotaker %> 
Preferences 

- +
- +
CELLPADDING=<%= $opt{cellpadding} %> BORDER=1 BORDERCOLOR="#000000" STYLE="border: solid 1px black; empty-cells: show"> -- cgit v1.2.1 From 264ad081e68057c7bc30a8b2ad741b783e1342ff Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 10 Aug 2006 11:55:50 +0000 Subject: agent-virtualize advertising sources --- httemplate/elements/menu.html | 52 ++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 20 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index 8c62d9778..a5b41aefd 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -189,26 +189,36 @@ 'View/Edit address blocks' => [ $fsurl.'browse/addr_block.cgi', 'Manage address blocks and block assignments to broadband routers' ], ; - tie my %config_misc, 'Tie::IxHash', - 'View/Edit advertising sources' => [ $fsurl.'browse/part_referral.cgi', 'Where a customer heard about your service. Tracked for informational purposes' ], - 'View/Edit virtual fields' => [ $fsurl.'browse/part_virtual_field.cgi', 'Locally defined fields', ], - 'View/Edit message catalog' => [ $fsurl.'browse/msgcat.cgi', 'Change error messages and other customizable labels' ], - 'View/Edit inventory classes and inventory' => [ $fsurl.'browse/inventory_class.html', 'Setup inventory classes and stock inventory' ], - ; + tie my %config_misc, 'Tie::IxHash'; + $config_misc{'View/Edit advertising sources'} = [ $fsurl.'browse/part_referral.html', 'Where a customer heard about your service. Tracked for informational purposes' ] + if $curuser->access_right('Configuration') + || $curuser->access_right('Edit advertising sources') + || $curuser->access_right('Edit global advertising sources'); + if ( $curuser->access_right('Configuration') ) { + $config_misc{'View/Edit virtual fields'} = [ $fsurl.'browse/part_virtual_field.cgi', 'Locally defined fields', ]; + $config_misc{'View/Edit message catalog'} = [ $fsurl.'browse/msgcat.cgi', 'Change error messages and other customizable labels' ]; + $config_misc{'View/Edit inventory classes and inventory'} = [ $fsurl.'browse/inventory_class.html', 'Setup inventory classes and stock inventory' ]; + } - tie my %config_menu, 'Tie::IxHash', - 'Settings' => [ $fsurl.'config/config-view.cgi', '' ], - 'separator' => '', #its a separator! - 'Employees' => [ \%config_employees, '' ], - 'Provisioning, services and packages' - => [ \%config_export_svc_pkg, '' ], - 'Resellers' => [ \%config_agent, '' ], - 'Billing' => [ \%config_billing, '' ], - 'Dialup' => [ \%config_dialup, '' ], - 'Fixed (username-less) broadband' - => [ \%config_broadband, '' ], - 'Miscellaneous' => [ \%config_misc, '' ], - ; + tie my %config_menu, 'Tie::IxHash'; + if ( $curuser->access_right('Configuration' ) ) { + %config_menu = ( + 'Settings' => [ $fsurl.'config/config-view.cgi', '' ], + 'separator' => '', #its a separator! + 'Employees' => [ \%config_employees, '' ], + 'Provisioning, services and packages' + => [ \%config_export_svc_pkg, '' ], + 'Resellers' => [ \%config_agent, '' ], + 'Billing' => [ \%config_billing, '' ], + 'Dialup' => [ \%config_dialup, '' ], + 'Fixed (username-less) broadband' + => [ \%config_broadband, '' ], + ); + } + $config_menu{'Miscellaneous'} = [ \%config_misc, '' ] + if $curuser->access_right('Configuration') + || $curuser->access_right('Edit advertising sources') + || $curuser->access_right('Edit global advertising sources'); tie my %menu, 'Tie::IxHash', 'Billing Main' => [ $fsurl, 'Billing start page', ], @@ -225,7 +235,9 @@ $menu{'Tools'} = [ \%tools_menu, 'Tools' ] if keys %tools_menu; $menu{'Configuration'} = [ \%config_menu, 'Configuraiton and setup' ] - if $curuser->access_right('Configuration'); + if $curuser->access_right('Configuration') + || $curuser->access_right('Edit advertising sources') + || $curuser->access_right('Edit global advertising sources'); use vars qw($gmenunum); $gmenunum = 0; -- cgit v1.2.1 From e47e9758f480c664bfc3917d798cd69c7d354999 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 11 Aug 2006 08:02:26 +0000 Subject: virtualize referrals on customer addition --- httemplate/elements/select-agent.html | 8 +++---- httemplate/elements/select-part_referral.html | 17 ++++++++++++++ httemplate/elements/tr-select-agent.html | 10 ++++---- httemplate/elements/tr-select-part_referral.html | 30 ++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 10 deletions(-) create mode 100644 httemplate/elements/select-part_referral.html create mode 100644 httemplate/elements/tr-select-part_referral.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/select-agent.html b/httemplate/elements/select-agent.html index 78ec25f82..009cc6e06 100644 --- a/httemplate/elements/select-agent.html +++ b/httemplate/elements/select-agent.html @@ -1,8 +1,7 @@ <% my( $agentnum, %opt ) = @_; - my %select_opt = (); - $select_opt{'records'} = $opt{'agents'} + $opt{'records'} = delete $opt{'agents'} if $opt{'agents'}; %><%= include( '/elements/select-table.html', @@ -12,7 +11,8 @@ 'empty_label' => 'all', 'hashref' => { 'disabled' => '' }, 'extra_sql' => ' AND '. - $FS::CurrentUser::CurrentUser->agentnums_sql, - %select_opt, + $FS::CurrentUser::CurrentUser->agentnums_sql. + ' ORDER BY agent', + %opt, ) %> diff --git a/httemplate/elements/select-part_referral.html b/httemplate/elements/select-part_referral.html new file mode 100644 index 000000000..deb87bd3b --- /dev/null +++ b/httemplate/elements/select-part_referral.html @@ -0,0 +1,17 @@ +<% + my( $refnum, %opt ) = @_; + + $opt{'records'} = delete $opt{'part_referrals'} + if $opt{'part_referrals'}; + +%><%= include( '/elements/select-table.html', + 'table' => 'part_referral', + 'name_col' => 'referral', + 'value' => $refnum, + 'empty_label' => 'Select advertising source', + 'hashref' => { 'disabled' => '' }, + 'extra_sql' => ' AND '. + FS::part_referral->all_part_referral(1), + %opt, + ) +%> diff --git a/httemplate/elements/tr-select-agent.html b/httemplate/elements/tr-select-agent.html index 83c8d1758..6158f6f47 100644 --- a/httemplate/elements/tr-select-agent.html +++ b/httemplate/elements/tr-select-agent.html @@ -7,12 +7,9 @@ #here is the agent virtualization my $agentnums_href = $FS::CurrentUser::CurrentUser->agentnums_href; @agents = grep $agentnums_href->{$_->agentnum}, @{ $opt{'agents'} }; + delete $opt{'agents'}; } else { - @agents = qsearch( { - 'table' => 'agent', - 'hashref' => { disabled=>'' }, - 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, - }); + @agents = $FS::CurrentUser::CurrentUser->agents; } %> @@ -24,10 +21,11 @@ <% } else { %> - + diff --git a/httemplate/elements/tr-select-part_referral.html b/httemplate/elements/tr-select-part_referral.html new file mode 100644 index 000000000..0108388bc --- /dev/null +++ b/httemplate/elements/tr-select-part_referral.html @@ -0,0 +1,30 @@ +<% + my( $refnum, %opt ) = @_; + + $opt{'part_referrals'} ||= + [ FS::part_referral->all_part_referral( 1 ) ]; #1: include global + + my $r = qq!* !; + +%> + +<% if ( scalar( @{$opt{'part_referrals'}} ) == 0 ) { + eidiot "You have not created any advertising sources. You must create at least one advertising source before adding a customer. Go to ". popurl(2). "browse/part_referral.html and create one or more advertising sources."; + } elsif ( scalar( @{$opt{'part_referrals'}} ) == 1 ) { +%> + + + +<% } else { %> + + + + + + +<% } %> -- cgit v1.2.1 From b19897e1db4c110d7d7e8b52800cda5ab58ce9e0 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 14 Aug 2006 12:13:40 +0000 Subject: sprinkle some magic ajax fairy dust on referring customer SELEKTAH. rewind! make smart search smarter, re-layout the top search bars and add an invoice one --- httemplate/elements/header.html | 94 +++++++++++++---- httemplate/elements/search-cust_main.html | 163 ++++++++++++++++++++++++++++++ 2 files changed, 239 insertions(+), 18 deletions(-) create mode 100644 httemplate/elements/search-cust_main.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/header.html b/httemplate/elements/header.html index 3aa81be3b..ea8c418c3 100644 --- a/httemplate/elements/header.html +++ b/httemplate/elements/header.html @@ -3,6 +3,7 @@ my $etc = @_ ? shift : ''; #$etc is for things like onLoad= etc. my $head = @_ ? shift : ''; #$head is for things that go in the section my $conf = new FS::Conf; + %> @@ -18,17 +19,22 @@ @@ -39,13 +45,11 @@ STYLE="margin-top:0; margin-bottom:0; margin-left:0; margin-right:0">
<%= $opt{'label'} || 'Agent: ' %><%= $opt{'label'} || 'Agent' %> <%= include( '/elements/select-agent.html', $agentnum, 'agents' => \@agents, + %opt, ) %>
<%=$r%>Advertising source + <%= include( '/elements/select-part_referral.html', $refnum, + 'part_referrals' => $opt{'part_referrals'}, + ) + %> +
- + - @@ -77,34 +81,88 @@
- freeside - freeside <%= $conf->config('company_name') || 'ExampleCo' %> Logged in as <%= getotaker %> 
Preferences 

+
Logged in as <%= getotaker %> 
Preferences 
- + + +
- + + - + + + + - +
+ +
- +
- - +
+ Advanced +
+ <% if ( $FS::CurrentUser::CurrentUser->access_right('View invoices') ) { %> +
+ + <% if ( $FS::CurrentUser::CurrentUser->access_right('List invoices') ) { %> + Advanced + <% } %> +
+ +
+ <% } %> +
- - +
+ Advanced +
+ +
- - +
+ Advanced +
diff --git a/httemplate/elements/search-cust_main.html b/httemplate/elements/search-cust_main.html new file mode 100644 index 000000000..ca91b4027 --- /dev/null +++ b/httemplate/elements/search-cust_main.html @@ -0,0 +1,163 @@ +<% + my( %opt ) = @_; + $opt{'field_name'} ||= 'custnum'; + + my $cust_main = ''; + if ( $opt{'value'} ) { + $cust_main = qsearchs( + 'table' => 'cust_main', + 'hashref' => { 'custnum' => $opt{'value'} }, + 'extra_sql' => " AND ". $FS::CurrentUser::CurrentUser->agentnums_sql, + ); + } +%> + + + + + + + + + +<%= include('/elements/xmlhttp.html', + 'url' => $p. 'misc/xmlhttp-cust_main-search.cgi', + 'subs' => [ 'smart_search' ], + ) +%> + + + -- cgit v1.2.1 From 3ce7691203a7737406bf2d4442f7fd84b81f847e Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 23 Aug 2006 22:25:39 +0000 Subject: Will things ever be the same again? It's the final masonize --- httemplate/elements/checkboxes-table-name.html | 162 +++--- httemplate/elements/checkboxes-table.html | 235 ++++---- httemplate/elements/header-popup.html | 21 +- httemplate/elements/header.html | 85 +-- httemplate/elements/jsrsServer.html | 7 +- httemplate/elements/menu.html | 631 +++++++++++---------- httemplate/elements/menubar.html | 19 +- httemplate/elements/pager.html | 83 +-- httemplate/elements/phonenumber.html | 29 +- httemplate/elements/progress-init.html | 51 +- httemplate/elements/progress-popup.html | 49 +- httemplate/elements/search-cust_main.html | 57 +- httemplate/elements/select-access_group.html | 15 +- httemplate/elements/select-agent.html | 15 +- httemplate/elements/select-cust-fields.html | 25 +- httemplate/elements/select-cust_pkg-status.html | 17 +- httemplate/elements/select-month_year.html | 115 ++-- httemplate/elements/select-part_referral.html | 15 +- httemplate/elements/select-pkg_class.html | 19 +- httemplate/elements/select-table.html | 122 ++-- httemplate/elements/select-taxclass.html | 48 +- httemplate/elements/small_custview.html | 5 +- httemplate/elements/table-grid.html | 13 +- httemplate/elements/table.html | 17 +- httemplate/elements/tr-select-access_group.html | 24 +- httemplate/elements/tr-select-agent.html | 42 +- httemplate/elements/tr-select-cust-fields.html | 17 +- httemplate/elements/tr-select-cust_pkg-status.html | 15 +- httemplate/elements/tr-select-from_to.html | 53 +- httemplate/elements/tr-select-part_referral.html | 36 +- httemplate/elements/tr-select-pkg_class.html | 24 +- httemplate/elements/xmlhttp.html | 53 +- 32 files changed, 1081 insertions(+), 1038 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/checkboxes-table-name.html b/httemplate/elements/checkboxes-table-name.html index 8e9dd29d2..0a92e4548 100644 --- a/httemplate/elements/checkboxes-table-name.html +++ b/httemplate/elements/checkboxes-table-name.html @@ -1,85 +1,85 @@ -<% - - ## - # required - ## - # 'link_table' => 'table_name', - # - # 'name_col' => 'name_column', - # #or - # 'name_callback' => sub { }, - # - # 'names_list' => [ 'value', 'other value' ], - # - ## - # recommended (required?) - ## - # 'source_obj' => $obj, - # #or? - # #'source_table' => 'table_name', - # #'sourcenum' => '4', #current value of primary key in source_table - # # # (none is okay, just pass it if you have it) - ## - # optional - ## - # 'num_col' => 'col_name' #if column name is different in link_table than - # #source_table - # 'link_static' => { 'column' => 'value' }, - - my( %opt ) = @_; - - my( $source_pkey, $sourcenum, $source_obj ); - if ( $opt{'source_obj'} ) { - - $source_obj = $opt{'source_obj'}; - #$source_table = $source_obj->dbdef_table->table; - $source_pkey = $source_obj->dbdef_table->primary_key; - $sourcenum = $source_obj->$source_pkey(); - - } else { - - #$source_obj? - $source_pkey = $opt{'source_table'} - ? dbdef->table($opt{'source_table'})->primary_key - : ''; - $sourcenum = $opt{'sourcenum'}; - } - - $source_pkey = $opt{'num_col'} || $source_pkey; - - my $link_static = $opt{'link_static'} || {}; - -%> - -<% foreach my $name ( @{ $opt{'names_list'} } ) { - - my $checked; - if ( $cgi->param('error') ) { - - $checked = $cgi->param($opt{'link_table'}. ".$name" ) - ? 'CHECKED' - : ''; - - } else { - - $checked = - qsearchs( $opt{'link_table'}, { - $source_pkey => $sourcenum, - $opt{'name_col'} => $name, - %$link_static, - } ) - ? 'CHECKED' - : '' - - } - -%> - - " <%= $checked %> VALUE="ON"> - - <%= $name %> +% +% +% ## +% # required +% ## +% # 'link_table' => 'table_name', +% # +% # 'name_col' => 'name_column', +% # #or +% # 'name_callback' => sub { }, +% # +% # 'names_list' => [ 'value', 'other value' ], +% # +% ## +% # recommended (required?) +% ## +% # 'source_obj' => $obj, +% # #or? +% # #'source_table' => 'table_name', +% # #'sourcenum' => '4', #current value of primary key in source_table +% # # # (none is okay, just pass it if you have it) +% ## +% # optional +% ## +% # 'num_col' => 'col_name' #if column name is different in link_table than +% # #source_table +% # 'link_static' => { 'column' => 'value' }, +% +% my( %opt ) = @_; +% +% my( $source_pkey, $sourcenum, $source_obj ); +% if ( $opt{'source_obj'} ) { +% +% $source_obj = $opt{'source_obj'}; +% #$source_table = $source_obj->dbdef_table->table; +% $source_pkey = $source_obj->dbdef_table->primary_key; +% $sourcenum = $source_obj->$source_pkey(); +% +% } else { +% +% #$source_obj? +% $source_pkey = $opt{'source_table'} +% ? dbdef->table($opt{'source_table'})->primary_key +% : ''; +% $sourcenum = $opt{'sourcenum'}; +% } +% +% $source_pkey = $opt{'num_col'} || $source_pkey; +% +% my $link_static = $opt{'link_static'} || {}; +% +% +% foreach my $name ( @{ $opt{'names_list'} } ) { +% +% my $checked; +% if ( $cgi->param('error') ) { +% +% $checked = $cgi->param($opt{'link_table'}. ".$name" ) +% ? 'CHECKED' +% : ''; +% +% } else { +% +% $checked = +% qsearchs( $opt{'link_table'}, { +% $source_pkey => $sourcenum, +% $opt{'name_col'} => $name, +% %$link_static, +% } ) +% ? 'CHECKED' +% : '' +% +% } +% +% + + + " <% $checked %> VALUE="ON"> + + <% $name %>
+% } -<% } %> diff --git a/httemplate/elements/checkboxes-table.html b/httemplate/elements/checkboxes-table.html index 16376fa3d..cdfa58eca 100644 --- a/httemplate/elements/checkboxes-table.html +++ b/httemplate/elements/checkboxes-table.html @@ -1,122 +1,123 @@ -<% +% +% +% ## +% # required +% ## +% # 'target_table' => 'table_name', +% # 'link_table' => 'table_name', +% # +% # 'name_col' => 'name_column', +% # #or +% # 'name_callback' => sub { }, +% # +% ## +% # recommended (required?) +% ## +% # 'source_obj' => $obj, +% # #or? +% # #'source_table' => 'table_name', +% # #'sourcenum' => '4', #current value of primary key in source_table +% # # # (none is okay, just pass it if you have it) +% ## +% # optional +% ## +% # 'disable-able' => 1, +% +% my( %opt ) = @_; +% +% my $target_pkey = dbdef->table($opt{'target_table'})->primary_key; +% +% my( $source_pkey, $sourcenum, $source_obj ); +% if ( $opt{'source_obj'} ) { +% +% $source_obj = $opt{'source_obj'}; +% #$source_table = $source_obj->dbdef_table->table; +% $source_pkey = $source_obj->dbdef_table->primary_key; +% $sourcenum = $source_obj->$source_pkey(); +% +% } else { +% +% #$source_obj? +% $source_pkey = $opt{'source_table'} +% ? dbdef->table($opt{'source_table'})->primary_key +% : ''; +% $sourcenum = $opt{'sourcenum'}; +% } +% +% my $hashref = $opt{'hashref'} || {}; +% +% my $extra_sql = ''; +% +% if ( $opt{'disable-able'} ) { +% $hashref->{'disabled'} = ''; +% +% $extra_sql .= ( $sourcenum && $source_pkey ) +% ? "OR $source_pkey = $sourcenum" +% : ''; +% } +% +% +% foreach my $target_obj ( +% qsearch({ 'table' => $opt{'target_table'}, +% 'hashref' => $hashref, +% 'select' => $opt{'target_table'}. '.*', +% 'addl_from' => "LEFT JOIN $opt{'link_table'} USING ( $target_pkey )", +% 'extra_sql' => $extra_sql, +% }) +% ) { +% +% my $targetnum = $target_obj->$target_pkey(); +% +% my $checked; +% if ( $cgi->param('error') ) { +% +% $checked = $cgi->param($target_pkey.$targetnum) +% ? 'CHECKED' +% : ''; +% +% } else { +% +% $checked = qsearchs( $opt{'link_table'}, { +% $source_pkey => $sourcenum, +% $target_pkey => $targetnum, +% } ) +% ? 'CHECKED' +% : '' +% +% } +% +% + + + VALUE="ON"> +% if ( $opt{'target_link'} ) { + + + +% +% +% } +% +<% $targetnum %>: +% if ( $opt{'name_callback'} ) { + + + <% &{ $opt{'name_callback'} }( $target_obj ) %><% $opt{'target_link'} ? '' : '' %> +% } else { +% my $name_col = $opt{'name_col'}; +% + + + <% $target_obj->$name_col() %><% $opt{'target_link'} ? '' : '' %> +% } +% if ( $opt{'disable-able'} ) { + + + <% $target_obj->disabled =~ /^Y/i ? ' (DISABLED)' : '' %> +% } - ## - # required - ## - # 'target_table' => 'table_name', - # 'link_table' => 'table_name', - # - # 'name_col' => 'name_column', - # #or - # 'name_callback' => sub { }, - # - ## - # recommended (required?) - ## - # 'source_obj' => $obj, - # #or? - # #'source_table' => 'table_name', - # #'sourcenum' => '4', #current value of primary key in source_table - # # # (none is okay, just pass it if you have it) - ## - # optional - ## - # 'disable-able' => 1, - - my( %opt ) = @_; - - my $target_pkey = dbdef->table($opt{'target_table'})->primary_key; - - my( $source_pkey, $sourcenum, $source_obj ); - if ( $opt{'source_obj'} ) { - - $source_obj = $opt{'source_obj'}; - #$source_table = $source_obj->dbdef_table->table; - $source_pkey = $source_obj->dbdef_table->primary_key; - $sourcenum = $source_obj->$source_pkey(); - - } else { - - #$source_obj? - $source_pkey = $opt{'source_table'} - ? dbdef->table($opt{'source_table'})->primary_key - : ''; - $sourcenum = $opt{'sourcenum'}; - } - - my $hashref = $opt{'hashref'} || {}; - - my $extra_sql = ''; - - if ( $opt{'disable-able'} ) { - $hashref->{'disabled'} = ''; - - $extra_sql .= ( $sourcenum && $source_pkey ) - ? "OR $source_pkey = $sourcenum" - : ''; - } - -%> - -<% foreach my $target_obj ( - qsearch({ 'table' => $opt{'target_table'}, - 'hashref' => $hashref, - 'select' => $opt{'target_table'}. '.*', - 'addl_from' => "LEFT JOIN $opt{'link_table'} USING ( $target_pkey )", - 'extra_sql' => $extra_sql, - }) - ) { - - my $targetnum = $target_obj->$target_pkey(); - - my $checked; - if ( $cgi->param('error') ) { - - $checked = $cgi->param($target_pkey.$targetnum) - ? 'CHECKED' - : ''; - - } else { - - $checked = qsearchs( $opt{'link_table'}, { - $source_pkey => $sourcenum, - $target_pkey => $targetnum, - } ) - ? 'CHECKED' - : '' - - } - -%> - - VALUE="ON"> - - <% if ( $opt{'target_link'} ) { %> - - <% - - } - %><%= $targetnum %>: - - <% if ( $opt{'name_callback'} ) { %> - - <%= &{ $opt{'name_callback'} }( $target_obj ) %><%= $opt{'target_link'} ? '' : '' %> - - <% } else { - my $name_col = $opt{'name_col'}; - %> - - <%= $target_obj->$name_col() %><%= $opt{'target_link'} ? '' : '' %> - - <% } %> - - <% if ( $opt{'disable-able'} ) { %> - - <%= $target_obj->disabled =~ /^Y/i ? ' (DISABLED)' : '' %> - - <% } %>
+% } -<% } %> diff --git a/httemplate/elements/header-popup.html b/httemplate/elements/header-popup.html index 73377abfe..43d9bc3af 100644 --- a/httemplate/elements/header-popup.html +++ b/httemplate/elements/header-popup.html @@ -1,22 +1,23 @@ -<% - my($title, $menubar) = ( shift, shift ); #$menubar is unused here though - my $etc = @_ ? shift : ''; #$etc is for things like onLoad= etc. - my $head = @_ ? shift : ''; #$head is for things that go in the section - my $conf = new FS::Conf; -%> +% +% my($title, $menubar) = ( shift, shift ); #$menubar is unused here though +% my $etc = @_ ? shift : ''; #$etc is for things like onLoad= etc. +% my $head = @_ ? shift : ''; #$head is for things that go in the section +% my $conf = new FS::Conf; +% + - <%= $title %> + <% $title %> - <%= $head %> + <% $head %> - > + > -
<%= $title %>
+
<% $title %>

diff --git a/httemplate/elements/header.html b/httemplate/elements/header.html index ea8c418c3..ca74ca5b9 100644 --- a/httemplate/elements/header.html +++ b/httemplate/elements/header.html @@ -1,21 +1,22 @@ -<% - my($title, $menubar) = ( shift, shift ); - my $etc = @_ ? shift : ''; #$etc is for things like onLoad= etc. - my $head = @_ ? shift : ''; #$head is for things that go in the section - my $conf = new FS::Conf; +% +% my($title, $menubar) = ( shift, shift ); +% my $etc = @_ ? shift : ''; #$etc is for things like onLoad= etc. +% my $head = @_ ? shift : ''; #$head is for things that go in the section +% my $conf = new FS::Conf; +% +% -%> - <%= $title %> + <% $title %> - <%= include('menu.html', 'freeside_baseurl' => $fsurl ) %> + <% include('menu.html', 'freeside_baseurl' => $fsurl ) %> - <%= $head %> + <% $head %> - STYLE="margin-top:0; margin-bottom:0; margin-left:0; margin-right:0"> + STYLE="margin-top:0; margin-bottom:0; margin-left:0; margin-right:0">
- + - @@ -59,20 +60,22 @@ - <% if ( $conf->config('ticket_system') eq 'RT_Internal' ) { %> - <% eval "use RT;"; %> +% if ( $conf->config('ticket_system') eq 'RT_Internal' ) { +% eval "use RT;"; + - <% } %> +% } +
freesidefreeside - <%= $conf->config('company_name') || 'ExampleCo' %> + <% $conf->config('company_name') || 'ExampleCo' %> Logged in as <%= getotaker %> 
Preferences 
+
Logged in as <% getotaker %> 
Preferences 
- Freeside v<%= $FS::VERSION %>
- Documentation
+ Freeside v<% $FS::VERSION %>
+ Documentation
- RT v<%= $RT::VERSION %>
+
RT v<% $RT::VERSION %>
Documentation
@@ -115,50 +118,54 @@ input.fsblackbuttonselected { - + @@ -168,8 +175,8 @@ input.fsblackbuttonselected {
-
+
-
+
- Advanced + Advanced
- <% if ( $FS::CurrentUser::CurrentUser->access_right('View invoices') ) { %> -
+% if ( $FS::CurrentUser::CurrentUser->access_right('View invoices') ) { + + - <% if ( $FS::CurrentUser::CurrentUser->access_right('List invoices') ) { %> - Advanced - <% } %> +% if ( $FS::CurrentUser::CurrentUser->access_right('List invoices') ) { + + Advanced +% } +
- <% } %> +% } +
-
+
- Advanced + Advanced
-
+
- Advanced + Advanced
- - + + - + - + - + @@ -37,3 +39,15 @@ +<%init> +my %opt = @_; +my( $input_time, $time_format, $time_hint ) = ( '', '', '' ); +my( $size, $maxlength ) = ( 11, 10 ); +if ( $opt{'input_time'} ) { + $input_time = ', showsTime: true, timeFormat: "12"'; # http://www.dynarch.com/demos/jscalendar/doc/html/reference.html#node_sec_2.3 + $time_format = ' %k:%M:%S'; # http://www.dynarch.com/demos/jscalendar/doc/html/reference.html#node_sec_5.3.5 + $time_hint = ' h:m:s'; + $size = 21; + $maxlength = 27; +} + -- cgit v1.2.1 From 6ea605258e710562ce95153f031e80a4bfb04f83 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 18 Sep 2006 02:21:08 +0000 Subject: ticket system disableability for rainbowshops --- httemplate/elements/menu.html | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index 959a08620..65907339a 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -51,8 +51,9 @@ tie my %report_customers_lists, 'Tie::IxHash', 'by customer number' => [ $fsurl. 'search/cust_main.cgi?browse=custnum', '' ], 'by last name' => [ $fsurl. 'search/cust_main.cgi?browse=last', '' ], 'by company name' => [ $fsurl. 'search/cust_main.cgi?browse=company', '' ], - 'by active trouble tickets' => [ $fsurl. 'search/cust_main.cgi?browse=tickets', '' ], ; +$report_customers_lists{'by active trouble tickets'} = [ $fsurl. 'search/cust_main.cgi?browse=tickets', '' ] + if $conf->config('ticket_system'); tie my %report_customers_search, 'Tie::IxHash', 'by ordering employee' => [ $fsurl. 'search/cust_main-otaker.cgi' ], @@ -270,14 +271,17 @@ $config_menu{'Miscellaneous'} = [ \%config_misc, '' ] tie my %menu, 'Tie::IxHash', 'Billing Main' => [ $fsurl, 'Billing start page', ], - 'Ticketing Main' => [ - ( $conf->config('ticket_system') eq 'RT_External' - ? FS::TicketSystem->baseurl() - : $fsurl.'rt/' - ), - 'Ticketing start page', - ], ; +if ( $conf->config('ticket_system') ) { + $menu{'Ticketing Main'} = + [ + ( $conf->config('ticket_system') eq 'RT_External' + ? FS::TicketSystem->baseurl() + : $fsurl.'rt/' + ), + 'Ticketing start page', + ], +} $menu{'Reports'} = [ \%report_menu, 'Lists, reporting and graphing' ] if keys %report_menu; $menu{'Tools'} = [ \%tools_menu, 'Tools' ] -- cgit v1.2.1 From 3050434f62122e73d748dac26a5e70193b444c0a Mon Sep 17 00:00:00 2001 From: jeff Date: Wed, 4 Oct 2006 21:22:08 +0000 Subject: DoB --- httemplate/elements/tr-input-date-field.html | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 httemplate/elements/tr-input-date-field.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/tr-input-date-field.html b/httemplate/elements/tr-input-date-field.html new file mode 100644 index 000000000..eb8eee450 --- /dev/null +++ b/httemplate/elements/tr-input-date-field.html @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + +<%init> +my($name, $value, $label, $format) = @_; + +$format = "%m/%d/%Y" unless $format; +$label = $name unless $label; + + + -- cgit v1.2.1 From 22c70177969f30e2e419b32cb5d475c143f10b12 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 8 Oct 2006 08:17:06 +0000 Subject: add menu items for credit card batching, debug last-minute changes to payby.pm, add ACL for re-processing batches, separate CARD and CHEK batches, fixed defaults for batch formats --- httemplate/elements/menu.html | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index 65907339a..14c471d58 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -157,10 +157,13 @@ tie my %report_financial, 'Tie::IxHash', 'Sales, Credits and Receipts' => [ $fsurl.'graph/report_money_time.html', 'Sales, credits and receipts summary graph' ], 'Sales Report' => [ $fsurl.'graph/report_cust_bill_pkg.html', 'Sales report and graph (by agent, package class and/or date range)' ], 'Credit Report' => [ $fsurl.'search/report_cust_credit.html', 'Credit report (by employee and/or date range)' ], - 'Payment Report' => [ $fsurl.'search/report_cust_pay.html', 'Credit report (by type and/or date range)' ], - 'A/R Aging' => [ $fsurl.'search/report_receivables.html', 'Accounts Receivable Aging report' ], - 'Prepaid Income' => [ $fsurl.'search/report_prepaid_income.html', 'Prepaid income (unearned revenue) report' ], - 'Sales Tax Liability' => [ $fsurl.'search/report_tax.html', 'Sales tax liability report' ], + 'Payment Report' => [ $fsurl.'search/report_cust_pay.html', 'Payment report (by type and/or date range)' ], +; +$report_financial{'Payment Batch Report'} = [ $fsurl.'search/pay_batch.html', 'Payment batches (by status and/or date range)' ] + if $conf->exists('batch-enable'); +$report_financial{'A/R Aging'} = [ $fsurl.'search/report_receivables.html', 'Accounts Receivable Aging report' ]; +$report_financial{'Prepaid Income'} = [ $fsurl.'search/report_prepaid_income.html', 'Prepaid income (unearned revenue) report' ]; +$report_financial{'Sales Tax Liability'} = [ $fsurl.'search/report_tax.html', 'Sales tax liability report' ]; ; tie my %report_menu, 'Tie::IxHash'; @@ -197,6 +200,8 @@ tie my %tools_exporting, 'Tie::IxHash', tie my %tools_menu, 'Tie::IxHash', (); $tools_menu{'Quick payment entry'} = [ $fsurl.'misc/batch-cust_pay.html', 'Enter multiple payments in a batch' ] if $curuser->access_right('Post payment batch'); +$tools_menu{'Process payment batches'} = [ $fsurl.'search/pay_batch.cgi?magic=_date;open=1;intransit=1', 'Process credit card and electronic check batches' ] + if $conf->exists('batch-enable') && $curuser->access_right('Process batches'); $tools_menu{'Job Queue'} = [ $fsurl.'search/queue.html', 'View pending job queue' ] if $curuser->access_right('Job queue'); $tools_menu{'Importing'} = [ \%tools_importing, 'Import tools' ] -- cgit v1.2.1 From f2d53ad396415b5aaba1d6483c75cb605364b644 Mon Sep 17 00:00:00 2001 From: jeff Date: Wed, 18 Oct 2006 00:05:34 +0000 Subject: fix ugly null dates --- httemplate/elements/tr-input-date-field.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/tr-input-date-field.html b/httemplate/elements/tr-input-date-field.html index eb8eee450..0618fc965 100644 --- a/httemplate/elements/tr-input-date-field.html +++ b/httemplate/elements/tr-input-date-field.html @@ -7,7 +7,7 @@ -- cgit v1.2.1 From 52281cbeaf8d4e02345eca3c1aa0500133823558 Mon Sep 17 00:00:00 2001 From: jeff Date: Wed, 18 Oct 2006 23:07:08 +0000 Subject: suspension and cancellation reasons --- httemplate/elements/menu.html | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index 14c471d58..60f2ab303 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -215,10 +215,14 @@ tie my %config_employees, 'Tie::IxHash', ; tie my %config_export_svc_pkg, 'Tie::IxHash', - 'View/Edit exports' => [ $fsurl.'browse/part_export.cgi', 'Provisioning services to external machines, databases and APIs' ], - 'View/Edit service definitions' => [ $fsurl.'browse/part_svc.cgi', 'Services are items you offer to your customers' ], - 'View/Edit package definitions' => [ $fsurl.'browse/part_pkg.cgi', 'One or more services are grouped together into a package and given pricing information. Customers purchase packages, not services' ], - 'View/Edit package classes' => [ $fsurl.'browse/pkg_class.html', 'Package classes define groups of packages, for reporting and convenience purposes.' ], + 'View/Edit exports' => [ $fsurl.'browse/part_export.cgi', 'Provisioning services to external machines, databases and APIs' ], + 'View/Edit service definitions' => [ $fsurl.'browse/part_svc.cgi', 'Services are items you offer to your customers' ], + 'View/Edit package definitions' => [ $fsurl.'browse/part_pkg.cgi', 'One or more services are grouped together into a package and given pricing information. Customers purchase packages, not services' ], + 'View/Edit package classes' => [ $fsurl.'browse/pkg_class.html', 'Package classes define groups of packages, for reporting and convenience purposes.' ], + 'View/Edit cancel reason types' => [ $fsurl.'browse/reason_type.html?class=C', 'Cancel reason types define groups of reasons, for reporting and convenience purposes.' ], + 'View/Edit cancel reasons' => [ $fsurl.'browse/reason.html?class=C', 'Cancel reasons explain why a service was cancelled.' ], + 'View/Edit suspend reason types' => [ $fsurl.'browse/reason_type.html?class=S', 'Suspend reason types define groups of reasons, for reporting and convenience purposes.' ], + 'View/Edit suspend reasons' => [ $fsurl.'browse/reason_type.html?class=S', 'Suspend reasons explain why a service was suspended.' ], ; tie my %config_agent, 'Tie::IxHash', -- cgit v1.2.1 From ce98306f315a53f2ac4b8c010341c4f84bf728a8 Mon Sep 17 00:00:00 2001 From: jeff Date: Thu, 19 Oct 2006 14:29:27 +0000 Subject: suspension and cancellation reasons --- httemplate/elements/tr-select-reason.html | 94 +++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100755 httemplate/elements/tr-select-reason.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/tr-select-reason.html b/httemplate/elements/tr-select-reason.html new file mode 100755 index 000000000..6c66e8170 --- /dev/null +++ b/httemplate/elements/tr-select-reason.html @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + +<%init> +my($name, $class, $init_reason, $init_type, $init_newreason) = @_; +my($extra_sql, $curuser, $access_right, $display, $disabled); + +if ($class eq 'C') { + $access_right='Add on-the-fly cancel reason'; +}elsif ($class eq 'S') { + $access_right='Add on-the-fly suspend reason'; +}else{ + print "illegal class: $class"; +} + +if ($init_reason == -1){ + $display = 'inline'; + $disabled = 'false'; +}else{ + $display = 'none'; + $disabled = 'true'; +} + +$extra_sql = "WHERE class = '$class' ORDER BY reason_type"; +$curuser = $FS::CurrentUser::CurrentUser; + + + -- cgit v1.2.1 From 1df4b7b2b8859ce8ae32e708d5c66477869209db Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 22 Oct 2006 00:35:24 +0000 Subject: link to wrong place --- httemplate/elements/menu.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index 60f2ab303..ad6138c72 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -222,7 +222,7 @@ tie my %config_export_svc_pkg, 'Tie::IxHash', 'View/Edit cancel reason types' => [ $fsurl.'browse/reason_type.html?class=C', 'Cancel reason types define groups of reasons, for reporting and convenience purposes.' ], 'View/Edit cancel reasons' => [ $fsurl.'browse/reason.html?class=C', 'Cancel reasons explain why a service was cancelled.' ], 'View/Edit suspend reason types' => [ $fsurl.'browse/reason_type.html?class=S', 'Suspend reason types define groups of reasons, for reporting and convenience purposes.' ], - 'View/Edit suspend reasons' => [ $fsurl.'browse/reason_type.html?class=S', 'Suspend reasons explain why a service was suspended.' ], + 'View/Edit suspend reasons' => [ $fsurl.'browse/reason.html?class=S', 'Suspend reasons explain why a service was suspended.' ], ; tie my %config_agent, 'Tie::IxHash', -- cgit v1.2.1 From 9811b8ce65909a293810ddbcd8c9b5ca963fba01 Mon Sep 17 00:00:00 2001 From: jeff Date: Mon, 23 Oct 2006 04:21:04 +0000 Subject: events should attach reasons --- httemplate/elements/tr-select-reason.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/tr-select-reason.html b/httemplate/elements/tr-select-reason.html index 6c66e8170..0c05ae74e 100755 --- a/httemplate/elements/tr-select-reason.html +++ b/httemplate/elements/tr-select-reason.html @@ -4,6 +4,11 @@ { %if ($curuser->access_right($access_right)){ + if (document.getElementById('<% $name %>').selectedIndex == 0){ + <% $controlledbutton ? $controlledbutton.'.disabled = true;' : ';' %> + }else{ + <% $controlledbutton ? $controlledbutton.'.disabled = false;' : ';' %> + } if (document.getElementById('<% $name %>').selectedIndex == (document.getElementById('<% $name %>').length - 1)) { @@ -36,6 +41,7 @@ % extra_sql => $extra_sql, % addl_from => 'LEFT JOIN reason_type ON reason_type.typenum = reason.reason_type', % }); + % foreach my $reason (@reasons) { % } @@ -68,7 +74,7 @@ <%init> -my($name, $class, $init_reason, $init_type, $init_newreason) = @_; +my($name, $class, $init_reason, $init_type, $init_newreason, $controlledbutton) = @_; my($extra_sql, $curuser, $access_right, $display, $disabled); if ($class eq 'C') { -- cgit v1.2.1 From 41d7858c23437581a98492627bcc3ef9ecfccf70 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 23 Oct 2006 09:35:18 +0000 Subject: eek, VALIGN=top for the page --- httemplate/elements/header.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/header.html b/httemplate/elements/header.html index ca74ca5b9..ce5401242 100644 --- a/httemplate/elements/header.html +++ b/httemplate/elements/header.html @@ -61,7 +61,7 @@ % if ( $conf->config('ticket_system') eq 'RT_Internal' ) { @@ -188,7 +188,7 @@ input.fsblackbuttonselected { - + + + -- cgit v1.2.1 From d48a1dfe73f6296ebcc296574b164f33440ed1c7 Mon Sep 17 00:00:00 2001 From: jeff Date: Wed, 25 Oct 2006 04:51:29 +0000 Subject: heh --- httemplate/elements/tr-selectmultiple-part_pkg.html | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/tr-selectmultiple-part_pkg.html b/httemplate/elements/tr-selectmultiple-part_pkg.html index abf96d726..bd96d1c3a 100644 --- a/httemplate/elements/tr-selectmultiple-part_pkg.html +++ b/httemplate/elements/tr-selectmultiple-part_pkg.html @@ -1,9 +1,5 @@ % -% my( $cust_fields, %opt ) = @_; -% -% use FS::ConfDefaults; -% $opt{'avail_fields'} ||= [ FS::ConfDefaults->cust_fields_avail() ]; -% +% my( %opt ) = @_; % -- cgit v1.2.1 From 5eb3dab3ea20a9861074a41bef19c9ac4dcb2336 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 25 Oct 2006 17:36:28 +0000 Subject: pagination patch from UNTD - limit the number of page links displayed and have a drop-down option for selecting number of entries per page --- httemplate/elements/pager.html | 64 +++++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 26 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/pager.html b/httemplate/elements/pager.html index 2327594a8..a53300f53 100644 --- a/httemplate/elements/pager.html +++ b/httemplate/elements/pager.html @@ -1,43 +1,55 @@ +% my %opt = @_; +% my $pager = ''; % +% if ( $opt{'total'} != $opt{'num_rows'} && $opt{'maxrecords'} ) { % -% my %opt = @_; -% -% my $pager = ''; -% if ( $opt{'total'} != $opt{'num_rows'} && $opt{'maxrecords'} ) { -% unless ( $opt{'offset'} == 0 ) { -% $cgi->param('offset', $opt{'offset'} - $opt{'maxrecords'}); -% - +% unless ( $opt{'offset'} == 0 ) { +% $cgi->param('offset', $opt{'offset'} - $opt{'maxrecords'}); Previous + +% } % -% } -% my $page = 0; -% for ( my $poff = 0; $poff < $opt{'total'}; $poff += $opt{'maxrecords'} ) { -% $page++; -% if ( $opt{'offset'} == $poff ) { +% my $page = 0; +% my $prevpage = 0; +% my $over = 0; +% my $step = $opt{total} / 10; # 10 evenly spaced +% for ( my $poff = 0; $poff < $opt{total}; $poff += $opt{maxrecords} ) { +% $page++; +% +% next unless +% $page <= 4 #first four +% || $page >= ( $opt{total} / $opt{maxrecords} ) - 3 #last four +% || abs( ($opt{offset}-$poff) / $opt{maxrecords} ) <= 3 #w/i 3 of current +% || $poff > $over # evenly spaced +% ; % - +% $over += $step if $poff > $over; +% +% if ( $opt{'offset'} == $poff ) { <% $page %> -% -% } else { -% $cgi->param('offset', $poff); -% +% } else { +% $cgi->param('offset', $poff); +% +% if ( $page > $prevpage+1 ) { + ... +% } <% $page %> + +% } % -% } -% } -% unless ( $opt{'offset'} + $opt{'maxrecords'} > $opt{'total'} ) { -% $cgi->param('offset', $opt{'offset'} + $opt{'maxrecords'}); +% $prevpage = $page; % - +% } +% +% unless ( $opt{'offset'} + $opt{'maxrecords'} > $opt{'total'} ) { +% $cgi->param('offset', $opt{'offset'} + $opt{'maxrecords'}); Next % -% } -% } +% } % - +% } -- cgit v1.2.1 From 576c6b48428aa95e0fd80db011fe73c0b728c88b Mon Sep 17 00:00:00 2001 From: jeff Date: Fri, 27 Oct 2006 17:01:31 +0000 Subject: editable notes --- httemplate/elements/overlibmws_crossframe.js | 44 ++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 httemplate/elements/overlibmws_crossframe.js (limited to 'httemplate/elements') diff --git a/httemplate/elements/overlibmws_crossframe.js b/httemplate/elements/overlibmws_crossframe.js new file mode 100644 index 000000000..6b21c42e8 --- /dev/null +++ b/httemplate/elements/overlibmws_crossframe.js @@ -0,0 +1,44 @@ +/* + overlibmws_crossframe.js plug-in module - Copyright Foteos Macrides 2003-2006 + For support of FRAME. + Initial: August 3, 2003 - Last Revised: November 2, 2004 + See the Change History and Command Reference for overlibmws via: + + http://www.macridesweb.com/oltest/ + + Published under an open source license: http://www.macridesweb.com/oltest/license.html +*/ + +OLloaded=0; +OLregCmds('frame'); + +function OLparseCrossframe(pf,i,ar){ +var k=i,v; +if(k0)))&&(((OLns4))|| +((OLie4)&&(v=thisFrame[i].document.all.tags('iframe'))!=null&&v.length==0)|| +((OLns6)&&(v=thisFrame[i].document.getElementsByTagName('iframe'))!=null&&v.length==0))){ +retVal=OLgetFrameRef(thisFrame[i],ofrm);if(retVal=='')continue;} +else if(thisFrame[i]!=ofrm)continue;retVal='['+i+']'+retVal;break;} +return retVal; +} + +function OLoptFRAME(frm){ +o3_frame=OLmkLyr('overDiv',frm)?frm:self;if(o3_frame!=self){ +var l,tFrm=OLgetFrameRef(top.frames,o3_frame),sFrm=OLgetFrameRef(top.frames,ol_frame); +if(sFrm.length==tFrm.length) {l=tFrm.lastIndexOf('[');if(l){ +while(sFrm.substring(0,l)!=tFrm.substring(0,l))l=tFrm.lastIndexOf('[',l-1); +tFrm=tFrm.substr(l);sFrm=sFrm.substr(l);}}var i,k,cnt=0,p='',str=tFrm; +while((k=str.lastIndexOf('['))!= -1){cnt++;str=str.substring(0,k);} +for(i=0;i Date: Mon, 13 Nov 2006 01:09:17 +0000 Subject: add preference page, start with just a password changer --- httemplate/elements/error.html | 4 ++++ httemplate/elements/header.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 httemplate/elements/error.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/error.html b/httemplate/elements/error.html new file mode 100644 index 000000000..e8ba93010 --- /dev/null +++ b/httemplate/elements/error.html @@ -0,0 +1,4 @@ +% if ( $cgi->param('error') ) { + Error: <% $cgi->param('error') %> +

+% } diff --git a/httemplate/elements/header.html b/httemplate/elements/header.html index ce5401242..c543ac040 100644 --- a/httemplate/elements/header.html +++ b/httemplate/elements/header.html @@ -50,7 +50,7 @@
- -- cgit v1.2.1 From 7c1d5f4ce778b4ab56301a042076e7c1dce46152 Mon Sep 17 00:00:00 2001 From: jeff Date: Thu, 16 Nov 2006 06:20:38 +0000 Subject: switch birthdate to DateTime --- httemplate/elements/tr-input-date-field.html | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/tr-input-date-field.html b/httemplate/elements/tr-input-date-field.html index 0618fc965..1624df05c 100644 --- a/httemplate/elements/tr-input-date-field.html +++ b/httemplate/elements/tr-input-date-field.html @@ -7,7 +7,7 @@ @@ -23,10 +23,19 @@ <%init> -my($name, $value, $label, $format) = @_; +my($name, $value, $label, $format, $usedatetime) = @_; $format = "%m/%d/%Y" unless $format; $label = $name unless $label; +if ($usedatetime) { + eval "use DateTime;"; + die $@ if $@; + my $dt = DateTime->from_epoch(epoch => $value, time_zone => 'floating'); + $value = $dt->strftime($format); +}else{ + $value = time2str($format, $value); +} + -- cgit v1.2.1 From 39fd666a49b2be516967131a46891f17ce0101da Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 24 Nov 2006 08:49:09 +0000 Subject: add less than and greater than amounts to credit and payment searches --- httemplate/elements/tr-input-beginning_ending.html | 4 ++-- httemplate/elements/tr-input-lessthan_greaterthan.html | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 httemplate/elements/tr-input-lessthan_greaterthan.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/tr-input-beginning_ending.html b/httemplate/elements/tr-input-beginning_ending.html index a8ab6ed10..397f7498a 100644 --- a/httemplate/elements/tr-input-beginning_ending.html +++ b/httemplate/elements/tr-input-beginning_ending.html @@ -5,7 +5,7 @@ - + - - - + + + + % if ( length($number) ) { <% $number %> diff --git a/httemplate/elements/progress-init.html b/httemplate/elements/progress-init.html index 3894feef9..01bf85935 100644 --- a/httemplate/elements/progress-init.html +++ b/httemplate/elements/progress-init.html @@ -19,8 +19,8 @@ 'key' => $key, ) %> - - + + - - + + + - - + + + + - + - - + + + + -- cgit v1.2.1 From 7871134261d6ee6304ea7164966f6058cb3b6400 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 22 Jan 2007 11:36:40 +0000 Subject: interpolation helps alot --- httemplate/elements/phonenumber.html | 8 ++++---- httemplate/elements/progress-init.html | 4 ++-- httemplate/elements/progress-popup.html | 8 ++++---- httemplate/elements/tr-input-beginning_ending.html | 12 ++++++------ httemplate/elements/tr-input-date-field.html | 10 +++++----- 5 files changed, 21 insertions(+), 21 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/phonenumber.html b/httemplate/elements/phonenumber.html index 8aa3a12e6..ffbd8c100 100644 --- a/httemplate/elements/phonenumber.html +++ b/httemplate/elements/phonenumber.html @@ -4,10 +4,10 @@ % ( my $snumber = $number ) =~ s/\D//g; % - - - - + + + + % if ( length($number) ) { <% $number %> diff --git a/httemplate/elements/progress-init.html b/httemplate/elements/progress-init.html index 01bf85935..1c96a54ac 100644 --- a/httemplate/elements/progress-init.html +++ b/httemplate/elements/progress-init.html @@ -19,8 +19,8 @@ 'key' => $key, ) %> - - + + - - + + + - - + + + + - + - - + + + + -- cgit v1.2.1 From 81152bdb2d34ede928dfa20d19125356f02a884d Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 25 Jan 2007 06:00:40 +0000 Subject: fuck. you. IE7. --- httemplate/elements/menu.html | 2 +- httemplate/elements/xmenu.css | 32 +++++++++++++++----------------- 2 files changed, 16 insertions(+), 18 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index 18a499b7b..25dd619f6 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -331,7 +331,7 @@ sub submenu { } keys %$submenu ) ). "\n". - "myMenu$menunum.width = 224;\n", + "myMenu$menunum.width = 280;\n", "myMenu$menunum"; diff --git a/httemplate/elements/xmenu.css b/httemplate/elements/xmenu.css index 60881b813..531fce77a 100644 --- a/httemplate/elements/xmenu.css +++ b/httemplate/elements/xmenu.css @@ -22,7 +22,6 @@ position: absolute; z-index: 100; visibility: hidden; - width: 154px; border: 1px solid black; padding: 1px; background: white; @@ -43,12 +42,14 @@ .webfx-menu a { display: block; - width: expression(constExpression(ieBox ? "100%": "auto")); /* should be ignored by mz and op */ - height: expression(constExpression("1px")); + /* width: expression(constExpression(ieBox ? "100%": "auto")); /* should be ignored by mz and op */ + width: expression(constExpression(ie ? "98%": "auto")); /* should be ignored by mz and op */ overflow: visible; - padding: 2px 0px 2px 5px; - font-size: 11px; - font-family: Tahoma, Verdan, Helvetica, Sans-Serif; + /* padding: 2px 0px 2px 5px; */ + padding: 1px 0px 1px 5px; + font-size: 14px; +/* font-family: Verdana, Arial, Helvetica, sans-serif; */ + font-weight: bold; text-decoration: none; vertical-align: center; color: black; @@ -94,9 +95,6 @@ } .webfx-menu-bar { - /* i want a vertical bar */ - display: block; - /* background: rgb(120,172,255);/*rgb(255,128,0);*/ /* background: #a097ed; */ background: #000000; @@ -107,9 +105,6 @@ padding: 2px; - font-family: Verdana, Helvetica, Sans-Serif; - /* font-size: 11px; */ - /* IE5.0 has the wierdest box model for inline elements */ padding: expression(constExpression(ie50 ? "0px" : "2px")); } @@ -147,7 +142,7 @@ color: white; /* background: rgb(120,172,255); */ /* background: #BC79B8; */ - background: #7E0079; + background: #7e0079; /* border-left: 1px solid rgb(234,242,255); border-right: 1px solid rgb(0,66,174); border-top: 1px solid rgb(234,242,255); @@ -155,8 +150,8 @@ } .webfx-menu-bar a .arrow { - border: 0; float: right; + border: 0; /* vertical-align: top; */ width: 3px; margin-right: 3px; @@ -183,13 +178,16 @@ /* background: #faf7fa; #f5ebf4; #efdfef; white; #BC79B8; */ background: #7e0079; /* border: 1px solid #7e0079; /*rgb(120,172,255);#ff8800;*/ - padding: 3px 1px 3px 6px; + /* padding: 3px 1px 3px 6px; */ + padding: 3px 1px 3px 5px; display: block; - font-size: 13px; - font-family: Tahoma, Verdan, Helvetica, Sans-Serif; + font-size: 16px; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-weight: bold; text-decoration: none; color: white; /* border: 1px solid white; */ border-bottom: 1px solid white; + width: expression(constExpression(ie ? "98%": "auto")); /* should be ignored by mz and op */ } -- cgit v1.2.1 From 4d68624491e3500a0bdb737a421c3711e5defebf Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 25 Jan 2007 06:04:54 +0000 Subject: fuck. you. IE7. --- httemplate/elements/xmenu.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/xmenu.css b/httemplate/elements/xmenu.css index 531fce77a..46b221bda 100644 --- a/httemplate/elements/xmenu.css +++ b/httemplate/elements/xmenu.css @@ -182,7 +182,7 @@ padding: 3px 1px 3px 5px; display: block; font-size: 16px; - font-family: Verdana, Arial, Helvetica, sans-serif; +/* font-family: Verdana, Arial, Helvetica, sans-serif; */ font-weight: bold; text-decoration: none; color: white; -- cgit v1.2.1 From f01e2ce0aa6c1925e6266d78797025ec68bfac07 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 26 Jan 2007 08:04:37 +0000 Subject: top bar option! --- httemplate/elements/header.html | 68 +++- httemplate/elements/menu.html | 15 +- httemplate/elements/xmenu.css | 11 +- httemplate/elements/xmenu.top.css | 211 ++++++++++++ httemplate/elements/xmenu.top.js | 671 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 959 insertions(+), 17 deletions(-) create mode 100644 httemplate/elements/xmenu.top.css create mode 100644 httemplate/elements/xmenu.top.js (limited to 'httemplate/elements') diff --git a/httemplate/elements/header.html b/httemplate/elements/header.html index 0e69b19ca..1f5674885 100644 --- a/httemplate/elements/header.html +++ b/httemplate/elements/header.html @@ -1,11 +1,3 @@ -% -% my($title, $menubar) = ( shift, shift ); -% my $etc = @_ ? shift : ''; #$etc is for things like onLoad= etc. -% my $head = @_ ? shift : ''; #$head is for things that go in the section -% my $conf = new FS::Conf; -% -% - @@ -16,7 +8,10 @@ - <% include('menu.html', 'freeside_baseurl' => $fsurl ) %> + <% include('menu.html', 'freeside_baseurl' => $fsurl, + 'position' => $menu_position, + ) + %> + + + + + + + + + + + + +% } +
@@ -177,15 +184,15 @@ input.fsblackbuttonselected { document.write(myBar);
- +
- <%= $title %> + <% $title %>

- <%= $menubar !~ /^\s*$/ ? "$menubar

" : '' %> + <% $menubar !~ /^\s*$/ ? "$menubar

" : '' %> diff --git a/httemplate/elements/jsrsServer.html b/httemplate/elements/jsrsServer.html index fd6dc5465..f37b0aaee 100644 --- a/httemplate/elements/jsrsServer.html +++ b/httemplate/elements/jsrsServer.html @@ -1,3 +1,4 @@ -<% - my $server = new FS::UI::Web::JSRPC '', $cgi; -%><%= $server->process %> +% +% my $server = new FS::UI::Web::JSRPC '', $cgi; +% +<% $server->process %> diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index a5b41aefd..f05866046 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -1,329 +1,330 @@ -<% - my( %opt ) = @_; - my $conf = new FS::Conf; - my $fsurl = $opt{'freeside_baseurl'}; - - my $curuser = $FS::CurrentUser::CurrentUser; - - #Active tickets not assigned to a customer - - tie my %report_customers_lists, 'Tie::IxHash', - 'by customer number' => [ $fsurl. 'search/cust_main.cgi?browse=custnum', '' ], - 'by last name' => [ $fsurl. 'search/cust_main.cgi?browse=last', '' ], - 'by company name' => [ $fsurl. 'search/cust_main.cgi?browse=company', '' ], - 'by active trouble tickets' => [ $fsurl. 'search/cust_main.cgi?browse=tickets', '' ], - ; - - tie my %report_customers_search, 'Tie::IxHash', - 'by ordering employee' => [ $fsurl. 'search/cust_main-otaker.cgi' ], - ; - - tie my %report_customers, 'Tie::IxHash', - 'List customers' => [ \%report_customers_lists, 'List customers' ], - 'Search customers' => [ \%report_customers_search, 'Search customers' ], - 'Zip code distribution' => [ $fsurl.'search/report_cust_main-zip.html', 'Zip codes by number of customers' ], - ; - - tie my %report_invoices_open, 'Tie::IxHash', - 'All open invoices' => [ $fsurl.'search/cust_bill.html?OPEN_date', 'All invoices with an unpaid balance' ], - '15 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN15_date', 'Invoices 15 days or older with an unpaid balance' ], - '30 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN30_date', 'Invoices 30 days or older with an unpaid balance' ], - '60 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN60_date', 'Invoices 60 days or older with an unpaid balance' ], - '90 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN90_date', 'Invoices 90 days or older with an unpaid balance' ], - '120 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN120_date', 'Invoices 120 days or older with an unpaid balance' ], - ; - - tie my %report_invoices, 'Tie::IxHash', - 'Open invoices' => [ \%report_invoices_open, 'Open invoices' ], - 'All invoices' => [ $fsurl. 'search/cust_bill.html?date', 'List all invoices' ], - 'Advanced invoice reports' => [ $fsurl.'search/report_cust_bill.html', 'by agent, date range, etc.' ], - ; - - tie my %report_services_acct, 'Tie::IxHash', - 'All accounts by username' => [ $fsurl.'search/svc_acct.cgi?username', '' ], - 'All accounts by UID' => [ $fsurl.'search/svc_acct.cgi?uid', '' ], - ; - $report_services_acct{'Unlinked accounts'} = [ $fsurl.'search/svc_acct.cgi?UN_uid', 'Pre-Freeside accounts without a customer record' ] - if $curuser->access_right('View/link unlinked services'); - - tie my %report_services_domain, 'Tie::IxHash', - 'All domains' => [ $fsurl.'search/svc_domain.cgi?domain', '' ], - ; - $report_services_domain{'Unlinked domains'} = [ $fsurl.'search/svc_domain.cgi?UN_domain', 'Pre-Freeside domains without a customer record' ] - if $curuser->access_right('View/link unlinked services'); - - tie my %report_services_forward, 'Tie::IxHash', - 'All mail forwards' => [ $fsurl.'search/svc_forward.cgi?svcnum', '' ], - ; - $report_services_forward{'Unlinked mail forwards'} = [ $fsurl.'search/svc_forward.cgi?UN_svcnum', 'Pre-Freeside mail forwards without a customer record' ] - if $curuser->access_right('View/link unlinked services'); - - tie my %report_services_www, 'Tie::IxHash', - 'All virtual hosts' => [ $fsurl.'search/svc_www.cgi?svcnum', '' ], - ; - $report_services_www{'Unlinked virtual hosts'} = [ $fsurl.'search/svc_www.cgi?UN_svcnum', 'Pre-Freeside virtual hosts without a customer record' ] - if $curuser->access_right('View/link unlinked services'); - - tie my %report_services_broadband, 'Tie::IxHash', - 'All broadband services' => [ $fsurl.'search/svc_broadband.cgi?svcnum', '' ], - #'Unlinked domain' => [ $fsurl.'search/svc_acct.cgi?UN_uid', 'Pre-Freeside domains without a customer record' ], - ; - - tie my %report_services_phone, 'Tie::IxHash', - 'All phone numbers' => [ $fsurl.'search/svc_phone.cgi?svcnum', '' ], - ; - - tie my %report_services_external, 'Tie::IxHash', - 'All external services' => [ $fsurl.'search/svc_external.cgi?id', '' ], - ; - $report_services_external{'Unlinked external services'} = [ $fsurl.'search/svc_external.cgi?UN_id', 'Pre-Freeside domains without a customer record' ] - if $curuser->access_right('View/link unlinked services'); - - tie my %report_services, 'Tie::IxHash'; - if ( $curuser->access_right('Configuration') ) { - $report_services{'Service definitions'} = [ $fsurl.'browse/part_svc.cgi?orderby=active', 'Service definitions by number of active packages' ]; - $report_services{'separator'} = ''; - } - $report_services{'Accounts'} = [ \%report_services_acct, 'Access accounts and mailboxes' ]; - $report_services{'Domains'} = [ \%report_services_domain, 'Domains', ]; - $report_services{'Mail forwards'} = [ \%report_services_forward, 'Mail forwards', ]; - $report_services{'Virtual hosts'} = [ \%report_services_www, 'Virtual hosting', ]; - $report_services{'Broadband services'} = [ \%report_services_broadband, 'Fixed (username-less) broadband services', ]; - $report_services{'Phone numbers'} = [ \%report_services_phone, 'Telephone numbers', ]; - $report_services{'External services'} = [ \%report_services_external, 'External services', ]; - - tie my %report_packages, 'Tie::IxHash'; - if ( $curuser->access_right('Configuration') ) { - $report_packages{'Package definitions'} = [ $fsurl.'browse/part_pkg.cgi?active=1', 'Package definitions by number of active packages' ]; - $report_packages{'separator'} = ''; - } - $report_packages{'All customer packages'} = [ $fsurl.'search/cust_pkg.cgi?pkgnum', 'List all customer packages', ]; - $report_packages{'Suspended customer packages'} = [ $fsurl.'search/cust_pkg.cgi?magic=suspended', 'List suspended packages' ]; - $report_packages{'Customer packages with unconfigured services'} = [ $fsurl.'search/cust_pkg.cgi?APKG_pkgnum', 'List packages which have provisionable services' ]; - $report_packages{'Advanced package reports'} = [ $fsurl.'search/report_cust_pkg.html', 'by agent, date range, status, package definition' ]; - - tie my %report_rating, 'Tie::IxHash', - 'Call Detail Records (CDRs)' => [ $fsurl.'search/report_cdr.html', '' ], - ; - - tie my %report_financial, 'Tie::IxHash', - 'Sales, Credits and Receipts' => [ $fsurl.'graph/report_money_time.html', 'Sales, credits and receipts summary graph' ], - 'Sales Report' => [ $fsurl.'graph/report_cust_bill_pkg.html', 'Sales report and graph (by agent, package class and/or date range)' ], - 'Credit Report' => [ $fsurl.'search/report_cust_credit.html', 'Credit report (by employee and/or date range)' ], - 'Payment Report' => [ $fsurl.'search/report_cust_pay.html', 'Credit report (by type and/or date range)' ], - 'A/R Aging' => [ $fsurl.'search/report_receivables.html', 'Accounts Receivable Aging report' ], - 'Prepaid Income' => [ $fsurl.'search/report_prepaid_income.html', 'Prepaid income (unearned revenue) report' ], - 'Sales Tax Liability' => [ $fsurl.'search/report_tax.html', 'Sales tax liability report' ], - ; - - tie my %report_menu, 'Tie::IxHash'; - $report_menu{'Customers'} = [ \%report_customers, 'Customer reports' ] - if $curuser->access_right('List customers'); - $report_menu{'Invoices'} = [ \%report_invoices, 'Invoice reports' ] - if $curuser->access_right('List invoices'); - $report_menu{'Packages'} = [ \%report_packages, 'Package reports' ] - if $curuser->access_right('List packages'); - $report_menu{'Services'} = [ \%report_services, 'Services reports' ] - if $curuser->access_right('List services'); - $report_menu{'Rating data'} = [ \%report_rating, 'Rating reports' ] - if $curuser->access_right('List rating data'); - $report_menu{'Financial'} = [ \%report_financial, 'Financial reports' ] - if $curuser->access_right('Financial reports'); - - tie my %tools_importing, 'Tie::IxHash', - 'Import customers from CSV file' => [ $fsurl.'misc/cust_main-import.cgi', '' ], - 'Import one-time charges from CSV file' => [ $fsurl.'misc/cust_main-import_charges.cgi', '' ], - 'Import Call Detail Records (CDRs) from CSV file' => [ $fsurl.'misc/cdr-import.html', '' ], - ; - - tie my %tools_exporting, 'Tie::IxHash', - 'Download database dump' => [ $fsurl. 'misc/dump.cgi', '' ], - ; - - # - # - - tie my %tools_menu, 'Tie::IxHash', (); - $tools_menu{'Quick payment entry'} = [ $fsurl.'misc/batch-cust_pay.html', 'Enter multiple payments in a batch' ] - if $curuser->access_right('Post payment batch'); - $tools_menu{'Job Queue'} = [ $fsurl.'search/queue.html', 'View pending job queue' ] - if $curuser->access_right('Job queue'); - $tools_menu{'Importing'} = [ \%tools_importing, 'Import tools' ] - if $curuser->access_right('Import'); - $tools_menu{'Exporting'} = [ \%tools_exporting, 'Export tools' ] - if $curuser->access_right('Export'); - - tie my %config_employees, 'Tie::IxHash', - 'View/Edit employees' => [ $fsurl.'browse/access_user.html', 'Setup internal users' ], - 'View/Edit employee groups' => [ $fsurl.'browse/access_group.html', 'Employee groups allow you to control access to the backend' ], - ; - - tie my %config_export_svc_pkg, 'Tie::IxHash', - 'View/Edit exports' => [ $fsurl.'browse/part_export.cgi', 'Provisioning services to external machines, databases and APIs' ], - 'View/Edit service definitions' => [ $fsurl.'browse/part_svc.cgi', 'Services are items you offer to your customers' ], - 'View/Edit package definitions' => [ $fsurl.'browse/part_pkg.cgi', 'One or more services are grouped together into a package and given pricing information. Customers purchase packages, not services' ], - 'View/Edit package classes' => [ $fsurl.'browse/pkg_class.html', 'Package classes define groups of packages, for reporting and convenience purposes.' ], - ; - - tie my %config_agent, 'Tie::IxHash', - 'View/Edit agent types' => [ $fsurl.'browse/agent_type.cgi', 'Agent types define groups of package definitions that you can then assign to particular agents' ], - 'View/Edit agents' => [ $fsurl.'browse/agent.cgi', 'Agents are resellers of your service. Agents may be limited to a subset of your full offerings (via their type)' ], - ; - - tie my %config_billing, 'Tie::IxHash', - 'View/Edit payment gateways' => [ $fsurl.'browse/payment_gateway.html', 'Credit card and electronic check processors' ], - 'View/Edit invoice events' => [ $fsurl.'browse/part_bill_event.cgi', 'Actions for overdue invoices' ], - 'View/Edit prepaid cards' => [ $fsurl.'search/prepay_credit.html', 'View outstanding cards, generate new cards' ], - 'View/Edit call rates and regions' => [ $fsurl.'browse/rate.cgi', 'Manage rate plans, regions and prefixes for VoIP and call billing' ], - 'View/Edit locales and tax rates' => [ $fsurl.'browse/cust_main_county.cgi', 'Change tax rates, or break down a country into states, or a state into counties and assign different tax rates to each' ], - ; - - tie my %config_dialup, 'Tie::IxHash', - 'View/Edit access numbers' => [ $fsurl.'browse/svc_acct_pop.cgi', 'Points of Presence' ], - ; - - tie my %config_broadband, 'Tie::IxHash', - 'View/Edit routers' => [ $fsurl.'browse/router.cgi', 'Broadband access routers' ], - 'View/Edit address blocks' => [ $fsurl.'browse/addr_block.cgi', 'Manage address blocks and block assignments to broadband routers' ], - ; - - tie my %config_misc, 'Tie::IxHash'; - $config_misc{'View/Edit advertising sources'} = [ $fsurl.'browse/part_referral.html', 'Where a customer heard about your service. Tracked for informational purposes' ] - if $curuser->access_right('Configuration') - || $curuser->access_right('Edit advertising sources') - || $curuser->access_right('Edit global advertising sources'); - if ( $curuser->access_right('Configuration') ) { - $config_misc{'View/Edit virtual fields'} = [ $fsurl.'browse/part_virtual_field.cgi', 'Locally defined fields', ]; - $config_misc{'View/Edit message catalog'} = [ $fsurl.'browse/msgcat.cgi', 'Change error messages and other customizable labels' ]; - $config_misc{'View/Edit inventory classes and inventory'} = [ $fsurl.'browse/inventory_class.html', 'Setup inventory classes and stock inventory' ]; - } - - tie my %config_menu, 'Tie::IxHash'; - if ( $curuser->access_right('Configuration' ) ) { - %config_menu = ( - 'Settings' => [ $fsurl.'config/config-view.cgi', '' ], - 'separator' => '', #its a separator! - 'Employees' => [ \%config_employees, '' ], - 'Provisioning, services and packages' - => [ \%config_export_svc_pkg, '' ], - 'Resellers' => [ \%config_agent, '' ], - 'Billing' => [ \%config_billing, '' ], - 'Dialup' => [ \%config_dialup, '' ], - 'Fixed (username-less) broadband' - => [ \%config_broadband, '' ], - ); - } - $config_menu{'Miscellaneous'} = [ \%config_misc, '' ] - if $curuser->access_right('Configuration') - || $curuser->access_right('Edit advertising sources') - || $curuser->access_right('Edit global advertising sources'); - - tie my %menu, 'Tie::IxHash', - 'Billing Main' => [ $fsurl, 'Billing start page', ], - 'Ticketing Main' => [ - ( $conf->config('ticket_system') eq 'RT_External' - ? FS::TicketSystem->baseurl() - : $fsurl.'rt/' - ), - 'Ticketing start page', - ], - ; - $menu{'Reports'} = [ \%report_menu, 'Lists, reporting and graphing' ] - if keys %report_menu; - $menu{'Tools'} = [ \%tools_menu, 'Tools' ] - if keys %tools_menu; - $menu{'Configuration'} = [ \%config_menu, 'Configuraiton and setup' ] - if $curuser->access_right('Configuration') - || $curuser->access_right('Edit advertising sources') - || $curuser->access_right('Edit global advertising sources'); - - use vars qw($gmenunum); - $gmenunum = 0; - - sub submenu { - my($submenu, $title) = @_; - my $menunum = $gmenunum++; - - #return two args: html, menuname - - "var myMenu$menunum = new WebFXMenu;\n". - #"myMenu$menunum.useAutoPosition = true;\n". - "myMenu$menunum.emptyText = '$title';\n". - - ( - join("\n", map { - - if ( !ref( $submenu->{$_} ) ) { - - "myMenu$menunum.add(new WebFXMenuSeparator());"; - - } else { - - my($url_or_submenu, $tooltip ) = @{ $submenu->{$_} }; - if ( ref($url_or_submenu) ) { - - my($subhtml, $submenuname ) = submenu($url_or_submenu, $_); #mmm, recursion - - "$subhtml\n". - "myMenu$menunum.add(new WebFXMenuItem(\"$_\", null, \"$tooltip\", $submenuname ));"; - - } else { - - "myMenu$menunum.add(new WebFXMenuItem(\"$_\", \"$url_or_submenu\", \"$tooltip\" ));"; - - } - - } - - } keys %$submenu ) - ). "\n". - "myMenu$menunum.width = 224\n", - - "myMenu$menunum"; - - } - -%> - - - - - +% +% my( %opt ) = @_; +% my $conf = new FS::Conf; +% my $fsurl = $opt{'freeside_baseurl'}; +% +% my $curuser = $FS::CurrentUser::CurrentUser; +% +% #Active tickets not assigned to a customer +% +% tie my %report_customers_lists, 'Tie::IxHash', +% 'by customer number' => [ $fsurl. 'search/cust_main.cgi?browse=custnum', '' ], +% 'by last name' => [ $fsurl. 'search/cust_main.cgi?browse=last', '' ], +% 'by company name' => [ $fsurl. 'search/cust_main.cgi?browse=company', '' ], +% 'by active trouble tickets' => [ $fsurl. 'search/cust_main.cgi?browse=tickets', '' ], +% ; +% +% tie my %report_customers_search, 'Tie::IxHash', +% 'by ordering employee' => [ $fsurl. 'search/cust_main-otaker.cgi' ], +% ; +% +% tie my %report_customers, 'Tie::IxHash', +% 'List customers' => [ \%report_customers_lists, 'List customers' ], +% 'Search customers' => [ \%report_customers_search, 'Search customers' ], +% 'Zip code distribution' => [ $fsurl.'search/report_cust_main-zip.html', 'Zip codes by number of customers' ], +% ; +% +% tie my %report_invoices_open, 'Tie::IxHash', +% 'All open invoices' => [ $fsurl.'search/cust_bill.html?OPEN_date', 'All invoices with an unpaid balance' ], +% '15 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN15_date', 'Invoices 15 days or older with an unpaid balance' ], +% '30 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN30_date', 'Invoices 30 days or older with an unpaid balance' ], +% '60 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN60_date', 'Invoices 60 days or older with an unpaid balance' ], +% '90 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN90_date', 'Invoices 90 days or older with an unpaid balance' ], +% '120 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN120_date', 'Invoices 120 days or older with an unpaid balance' ], +% ; +% +% tie my %report_invoices, 'Tie::IxHash', +% 'Open invoices' => [ \%report_invoices_open, 'Open invoices' ], +% 'All invoices' => [ $fsurl. 'search/cust_bill.html?date', 'List all invoices' ], +% 'Advanced invoice reports' => [ $fsurl.'search/report_cust_bill.html', 'by agent, date range, etc.' ], +% ; +% +% tie my %report_services_acct, 'Tie::IxHash', +% 'All accounts by username' => [ $fsurl.'search/svc_acct.cgi?username', '' ], +% 'All accounts by UID' => [ $fsurl.'search/svc_acct.cgi?uid', '' ], +% ; +% $report_services_acct{'Unlinked accounts'} = [ $fsurl.'search/svc_acct.cgi?UN_uid', 'Pre-Freeside accounts without a customer record' ] +% if $curuser->access_right('View/link unlinked services'); +% +% tie my %report_services_domain, 'Tie::IxHash', +% 'All domains' => [ $fsurl.'search/svc_domain.cgi?domain', '' ], +% ; +% $report_services_domain{'Unlinked domains'} = [ $fsurl.'search/svc_domain.cgi?UN_domain', 'Pre-Freeside domains without a customer record' ] +% if $curuser->access_right('View/link unlinked services'); +% +% tie my %report_services_forward, 'Tie::IxHash', +% 'All mail forwards' => [ $fsurl.'search/svc_forward.cgi?svcnum', '' ], +% ; +% $report_services_forward{'Unlinked mail forwards'} = [ $fsurl.'search/svc_forward.cgi?UN_svcnum', 'Pre-Freeside mail forwards without a customer record' ] +% if $curuser->access_right('View/link unlinked services'); +% +% tie my %report_services_www, 'Tie::IxHash', +% 'All virtual hosts' => [ $fsurl.'search/svc_www.cgi?svcnum', '' ], +% ; +% $report_services_www{'Unlinked virtual hosts'} = [ $fsurl.'search/svc_www.cgi?UN_svcnum', 'Pre-Freeside virtual hosts without a customer record' ] +% if $curuser->access_right('View/link unlinked services'); +% +% tie my %report_services_broadband, 'Tie::IxHash', +% 'All broadband services' => [ $fsurl.'search/svc_broadband.cgi?svcnum', '' ], +% #'Unlinked domain' => [ $fsurl.'search/svc_acct.cgi?UN_uid', 'Pre-Freeside domains without a customer record' ], +% ; +% +% tie my %report_services_phone, 'Tie::IxHash', +% 'All phone numbers' => [ $fsurl.'search/svc_phone.cgi?svcnum', '' ], +% ; +% +% tie my %report_services_external, 'Tie::IxHash', +% 'All external services' => [ $fsurl.'search/svc_external.cgi?id', '' ], +% ; +% $report_services_external{'Unlinked external services'} = [ $fsurl.'search/svc_external.cgi?UN_id', 'Pre-Freeside domains without a customer record' ] +% if $curuser->access_right('View/link unlinked services'); +% +% tie my %report_services, 'Tie::IxHash'; +% if ( $curuser->access_right('Configuration') ) { +% $report_services{'Service definitions'} = [ $fsurl.'browse/part_svc.cgi?orderby=active', 'Service definitions by number of active packages' ]; +% $report_services{'separator'} = ''; +% } +% $report_services{'Accounts'} = [ \%report_services_acct, 'Access accounts and mailboxes' ]; +% $report_services{'Domains'} = [ \%report_services_domain, 'Domains', ]; +% $report_services{'Mail forwards'} = [ \%report_services_forward, 'Mail forwards', ]; +% $report_services{'Virtual hosts'} = [ \%report_services_www, 'Virtual hosting', ]; +% $report_services{'Broadband services'} = [ \%report_services_broadband, 'Fixed (username-less) broadband services', ]; +% $report_services{'Phone numbers'} = [ \%report_services_phone, 'Telephone numbers', ]; +% $report_services{'External services'} = [ \%report_services_external, 'External services', ]; +% +% tie my %report_packages, 'Tie::IxHash'; +% if ( $curuser->access_right('Configuration') ) { +% $report_packages{'Package definitions'} = [ $fsurl.'browse/part_pkg.cgi?active=1', 'Package definitions by number of active packages' ]; +% $report_packages{'separator'} = ''; +% } +% $report_packages{'All customer packages'} = [ $fsurl.'search/cust_pkg.cgi?pkgnum', 'List all customer packages', ]; +% $report_packages{'Suspended customer packages'} = [ $fsurl.'search/cust_pkg.cgi?magic=suspended', 'List suspended packages' ]; +% $report_packages{'Customer packages with unconfigured services'} = [ $fsurl.'search/cust_pkg.cgi?APKG_pkgnum', 'List packages which have provisionable services' ]; +% $report_packages{'Advanced package reports'} = [ $fsurl.'search/report_cust_pkg.html', 'by agent, date range, status, package definition' ]; +% +% tie my %report_rating, 'Tie::IxHash', +% 'Call Detail Records (CDRs)' => [ $fsurl.'search/report_cdr.html', '' ], +% ; +% +% tie my %report_financial, 'Tie::IxHash', +% 'Sales, Credits and Receipts' => [ $fsurl.'graph/report_money_time.html', 'Sales, credits and receipts summary graph' ], +% 'Sales Report' => [ $fsurl.'graph/report_cust_bill_pkg.html', 'Sales report and graph (by agent, package class and/or date range)' ], +% 'Credit Report' => [ $fsurl.'search/report_cust_credit.html', 'Credit report (by employee and/or date range)' ], +% 'Payment Report' => [ $fsurl.'search/report_cust_pay.html', 'Credit report (by type and/or date range)' ], +% 'A/R Aging' => [ $fsurl.'search/report_receivables.html', 'Accounts Receivable Aging report' ], +% 'Prepaid Income' => [ $fsurl.'search/report_prepaid_income.html', 'Prepaid income (unearned revenue) report' ], +% 'Sales Tax Liability' => [ $fsurl.'search/report_tax.html', 'Sales tax liability report' ], +% ; +% +% tie my %report_menu, 'Tie::IxHash'; +% $report_menu{'Customers'} = [ \%report_customers, 'Customer reports' ] +% if $curuser->access_right('List customers'); +% $report_menu{'Invoices'} = [ \%report_invoices, 'Invoice reports' ] +% if $curuser->access_right('List invoices'); +% $report_menu{'Packages'} = [ \%report_packages, 'Package reports' ] +% if $curuser->access_right('List packages'); +% $report_menu{'Services'} = [ \%report_services, 'Services reports' ] +% if $curuser->access_right('List services'); +% $report_menu{'Rating data'} = [ \%report_rating, 'Rating reports' ] +% if $curuser->access_right('List rating data'); +% $report_menu{'Financial'} = [ \%report_financial, 'Financial reports' ] +% if $curuser->access_right('Financial reports'); +% +% tie my %tools_importing, 'Tie::IxHash', +% 'Import customers from CSV file' => [ $fsurl.'misc/cust_main-import.cgi', '' ], +% 'Import one-time charges from CSV file' => [ $fsurl.'misc/cust_main-import_charges.cgi', '' ], +% 'Import Call Detail Records (CDRs) from CSV file' => [ $fsurl.'misc/cdr-import.html', '' ], +% ; +% +% tie my %tools_exporting, 'Tie::IxHash', +% 'Download database dump' => [ $fsurl. 'misc/dump.cgi', '' ], +% ; +% +% # +% # +% +% tie my %tools_menu, 'Tie::IxHash', (); +% $tools_menu{'Quick payment entry'} = [ $fsurl.'misc/batch-cust_pay.html', 'Enter multiple payments in a batch' ] +% if $curuser->access_right('Post payment batch'); +% $tools_menu{'Job Queue'} = [ $fsurl.'search/queue.html', 'View pending job queue' ] +% if $curuser->access_right('Job queue'); +% $tools_menu{'Importing'} = [ \%tools_importing, 'Import tools' ] +% if $curuser->access_right('Import'); +% $tools_menu{'Exporting'} = [ \%tools_exporting, 'Export tools' ] +% if $curuser->access_right('Export'); +% +% tie my %config_employees, 'Tie::IxHash', +% 'View/Edit employees' => [ $fsurl.'browse/access_user.html', 'Setup internal users' ], +% 'View/Edit employee groups' => [ $fsurl.'browse/access_group.html', 'Employee groups allow you to control access to the backend' ], +% ; +% +% tie my %config_export_svc_pkg, 'Tie::IxHash', +% 'View/Edit exports' => [ $fsurl.'browse/part_export.cgi', 'Provisioning services to external machines, databases and APIs' ], +% 'View/Edit service definitions' => [ $fsurl.'browse/part_svc.cgi', 'Services are items you offer to your customers' ], +% 'View/Edit package definitions' => [ $fsurl.'browse/part_pkg.cgi', 'One or more services are grouped together into a package and given pricing information. Customers purchase packages, not services' ], +% 'View/Edit package classes' => [ $fsurl.'browse/pkg_class.html', 'Package classes define groups of packages, for reporting and convenience purposes.' ], +% ; +% +% tie my %config_agent, 'Tie::IxHash', +% 'View/Edit agent types' => [ $fsurl.'browse/agent_type.cgi', 'Agent types define groups of package definitions that you can then assign to particular agents' ], +% 'View/Edit agents' => [ $fsurl.'browse/agent.cgi', 'Agents are resellers of your service. Agents may be limited to a subset of your full offerings (via their type)' ], +% ; +% +% tie my %config_billing, 'Tie::IxHash', +% 'View/Edit payment gateways' => [ $fsurl.'browse/payment_gateway.html', 'Credit card and electronic check processors' ], +% 'View/Edit invoice events' => [ $fsurl.'browse/part_bill_event.cgi', 'Actions for overdue invoices' ], +% 'View/Edit prepaid cards' => [ $fsurl.'search/prepay_credit.html', 'View outstanding cards, generate new cards' ], +% 'View/Edit call rates and regions' => [ $fsurl.'browse/rate.cgi', 'Manage rate plans, regions and prefixes for VoIP and call billing' ], +% 'View/Edit locales and tax rates' => [ $fsurl.'browse/cust_main_county.cgi', 'Change tax rates, or break down a country into states, or a state into counties and assign different tax rates to each' ], +% ; +% +% tie my %config_dialup, 'Tie::IxHash', +% 'View/Edit access numbers' => [ $fsurl.'browse/svc_acct_pop.cgi', 'Points of Presence' ], +% ; +% +% tie my %config_broadband, 'Tie::IxHash', +% 'View/Edit routers' => [ $fsurl.'browse/router.cgi', 'Broadband access routers' ], +% 'View/Edit address blocks' => [ $fsurl.'browse/addr_block.cgi', 'Manage address blocks and block assignments to broadband routers' ], +% ; +% +% tie my %config_misc, 'Tie::IxHash'; +% $config_misc{'View/Edit advertising sources'} = [ $fsurl.'browse/part_referral.html', 'Where a customer heard about your service. Tracked for informational purposes' ] +% if $curuser->access_right('Configuration') +% || $curuser->access_right('Edit advertising sources') +% || $curuser->access_right('Edit global advertising sources'); +% if ( $curuser->access_right('Configuration') ) { +% $config_misc{'View/Edit virtual fields'} = [ $fsurl.'browse/part_virtual_field.cgi', 'Locally defined fields', ]; +% $config_misc{'View/Edit message catalog'} = [ $fsurl.'browse/msgcat.cgi', 'Change error messages and other customizable labels' ]; +% $config_misc{'View/Edit inventory classes and inventory'} = [ $fsurl.'browse/inventory_class.html', 'Setup inventory classes and stock inventory' ]; +% } +% +% tie my %config_menu, 'Tie::IxHash'; +% if ( $curuser->access_right('Configuration' ) ) { +% %config_menu = ( +% 'Settings' => [ $fsurl.'config/config-view.cgi', '' ], +% 'separator' => '', #its a separator! +% 'Employees' => [ \%config_employees, '' ], +% 'Provisioning, services and packages' +% => [ \%config_export_svc_pkg, '' ], +% 'Resellers' => [ \%config_agent, '' ], +% 'Billing' => [ \%config_billing, '' ], +% 'Dialup' => [ \%config_dialup, '' ], +% 'Fixed (username-less) broadband' +% => [ \%config_broadband, '' ], +% ); +% } +% $config_menu{'Miscellaneous'} = [ \%config_misc, '' ] +% if $curuser->access_right('Configuration') +% || $curuser->access_right('Edit advertising sources') +% || $curuser->access_right('Edit global advertising sources'); +% +% tie my %menu, 'Tie::IxHash', +% 'Billing Main' => [ $fsurl, 'Billing start page', ], +% 'Ticketing Main' => [ +% ( $conf->config('ticket_system') eq 'RT_External' +% ? FS::TicketSystem->baseurl() +% : $fsurl.'rt/' +% ), +% 'Ticketing start page', +% ], +% ; +% $menu{'Reports'} = [ \%report_menu, 'Lists, reporting and graphing' ] +% if keys %report_menu; +% $menu{'Tools'} = [ \%tools_menu, 'Tools' ] +% if keys %tools_menu; +% $menu{'Configuration'} = [ \%config_menu, 'Configuraiton and setup' ] +% if $curuser->access_right('Configuration') +% || $curuser->access_right('Edit advertising sources') +% || $curuser->access_right('Edit global advertising sources'); +% +% use vars qw($gmenunum); +% $gmenunum = 0; +% +% sub submenu { +% my($submenu, $title) = @_; +% my $menunum = $gmenunum++; +% +% #return two args: html, menuname +% +% "var myMenu$menunum = new WebFXMenu;\n". +% #"myMenu$menunum.useAutoPosition = true;\n". +% "myMenu$menunum.emptyText = '$title';\n". +% +% ( +% join("\n", map { +% +% if ( !ref( $submenu->{$_} ) ) { +% +% "myMenu$menunum.add(new WebFXMenuSeparator());"; +% +% } else { +% +% my($url_or_submenu, $tooltip ) = @{ $submenu->{$_} }; +% if ( ref($url_or_submenu) ) { +% +% my($subhtml, $submenuname ) = submenu($url_or_submenu, $_); #mmm, recursion +% +% "$subhtml\n". +% "myMenu$menunum.add(new WebFXMenuItem(\"$_\", null, \"$tooltip\", $submenuname ));"; +% +% } else { +% +% "myMenu$menunum.add(new WebFXMenuItem(\"$_\", \"$url_or_submenu\", \"$tooltip\" ));"; +% +% } +% +% } +% +% } keys %$submenu ) +% ). "\n". +% "myMenu$menunum.width = 224\n", +% +% "myMenu$menunum"; +% +% } +% +% + + + + + + -<% if ( length($number) ) { %> - <%= $number %> - <% if ( $opt{'callable'} && $conf->config('vonage-username') ) { %> - Call this number - <% } %> -<% } else { %> +% if ( length($number) ) { + + <% $number %> +% if ( $opt{'callable'} && $conf->config('vonage-username') ) { + + Call this number +% } +% } else { +   -<% } %> +% } + diff --git a/httemplate/elements/progress-init.html b/httemplate/elements/progress-init.html index ec485f438..3894feef9 100644 --- a/httemplate/elements/progress-init.html +++ b/httemplate/elements/progress-init.html @@ -1,17 +1,18 @@ -<% - my( $formname, $fields, $action, $url_or_message, $key ) = @_; - $key = '' unless defined $key; +% +% my( $formname, $fields, $action, $url_or_message, $key ) = @_; +% $key = '' unless defined $key; +% +% my $url_or_message_link; +% if ( ref($url_or_message) ) { #its a message or something +% $url_or_message_link = +% 'message='. uri_escape( $url_or_message->{'message'} ) +% } else { +% $url_or_message_link = "url=$url_or_message"; +% } +% - my $url_or_message_link; - if ( ref($url_or_message) ) { #its a message or something - $url_or_message_link = - 'message='. uri_escape( $url_or_message->{'message'} ) - } else { - $url_or_message_link = "url=$url_or_message"; - } -%> -<%= include('/elements/xmlhttp.html', +<% include('/elements/xmlhttp.html', 'method' => 'POST', 'url' => $action, 'subs' => [ 'start_job' ], @@ -27,12 +28,12 @@ function OLiframeContent(src, width, height, name) { +'
[iframe not supported]
'); } -function <%=$key%>process () { +function <%$key%>process () { - //alert('<%=$key%>process for form <%=$formname%>'); + //alert('<%$key%>process for form <%$formname%>'); - if ( document.<%=$formname%>.submit.disabled == false ) { - document.<%=$formname%>.submit.disabled=true; + if ( document.<%$formname%>.submit.disabled == false ) { + document.<%$formname%>.submit.disabled=true; } overlib( 'Submitting job to server...', WIDTH, 444, HEIGHT, 168, CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 ); @@ -40,9 +41,9 @@ function <%=$key%>process () { var Hash = new Array(); var x = 0; var fieldName; - for (var i = 0; i.elements.length; i++) { - field = document.<%=$formname%>.elements[i]; - if ( <%= join(' || ', map { "(field.name.indexOf('$_') > -1)" } @$fields ) %> + for (var i = 0; i.elements.length; i++) { + field = document.<%$formname%>.elements[i]; + if ( <% join(' || ', map { "(field.name.indexOf('$_') > -1)" } @$fields ) %> ) { if ( field.type == 'select-multiple' ) { @@ -56,7 +57,7 @@ function <%=$key%>process () { } } else if ( ( field.type != 'radio' && field.type != 'checkbox' ) || ( ( field.type == 'radio' || field.type == 'checkbox' ) - && document.<%=$formname%>.elements[i].checked + && document.<%$formname%>.elements[i].checked ) ) { @@ -67,17 +68,17 @@ function <%=$key%>process () { } // jsrsPOST = true; - // jsrsExecute( '<%= $action %>', <%=$key%>myCallback, 'start_job', Hash ); + // jsrsExecute( '<% $action %>', <%$key%>myCallback, 'start_job', Hash ); - //alert('start_job( ' + Hash + ', <%=$key%>myCallback )' ); + //alert('start_job( ' + Hash + ', <%$key%>myCallback )' ); //alert('start_job()' ); - <%=$key%>start_job( Hash, <%=$key%>myCallback ); + <%$key%>start_job( Hash, <%$key%>myCallback ); } -function <%=$key%>myCallback( jobnum ) { +function <%$key%>myCallback( jobnum ) { - overlib( OLiframeContent('<%=$p%>elements/progress-popup.html?jobnum=' + jobnum + ';<%=$url_or_message_link%>;formname=<%=$formname%>' , 444, 168, 'progress_popup'), CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 ); + overlib( OLiframeContent('<%$p%>elements/progress-popup.html?jobnum=' + jobnum + ';<%$url_or_message_link%>;formname=<%$formname%>' , 444, 168, 'progress_popup'), CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 ); } diff --git a/httemplate/elements/progress-popup.html b/httemplate/elements/progress-popup.html index 544440138..8f2ff1982 100644 --- a/httemplate/elements/progress-popup.html +++ b/httemplate/elements/progress-popup.html @@ -1,16 +1,17 @@ -<% - my $jobnum = $cgi->param('jobnum'); - my $url = $cgi->param('url'); - my $message = $cgi->param('message'); - my $formname = scalar($cgi->param('formname')); -%> +% +% my $jobnum = $cgi->param('jobnum'); +% my $url = $cgi->param('url'); +% my $message = $cgi->param('message'); +% my $formname = scalar($cgi->param('formname')); +% + -<%= include('/elements/xmlhttp.html', +<% include('/elements/xmlhttp.html', 'url' => $p.'elements/jsrsServer.html', 'subs' => [ 'job_status' ], ) @@ -20,9 +21,9 @@ -- cgit v1.2.1 From 91c6008ed7760313217797b07e24a58251c81413 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 27 Aug 2006 19:33:27 +0000 Subject: add back invoice event reports --- httemplate/elements/menu.html | 623 +++++++++++++++++++++--------------------- 1 file changed, 308 insertions(+), 315 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index f05866046..80a664cc9 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -1,293 +1,3 @@ -% -% my( %opt ) = @_; -% my $conf = new FS::Conf; -% my $fsurl = $opt{'freeside_baseurl'}; -% -% my $curuser = $FS::CurrentUser::CurrentUser; -% -% #Active tickets not assigned to a customer -% -% tie my %report_customers_lists, 'Tie::IxHash', -% 'by customer number' => [ $fsurl. 'search/cust_main.cgi?browse=custnum', '' ], -% 'by last name' => [ $fsurl. 'search/cust_main.cgi?browse=last', '' ], -% 'by company name' => [ $fsurl. 'search/cust_main.cgi?browse=company', '' ], -% 'by active trouble tickets' => [ $fsurl. 'search/cust_main.cgi?browse=tickets', '' ], -% ; -% -% tie my %report_customers_search, 'Tie::IxHash', -% 'by ordering employee' => [ $fsurl. 'search/cust_main-otaker.cgi' ], -% ; -% -% tie my %report_customers, 'Tie::IxHash', -% 'List customers' => [ \%report_customers_lists, 'List customers' ], -% 'Search customers' => [ \%report_customers_search, 'Search customers' ], -% 'Zip code distribution' => [ $fsurl.'search/report_cust_main-zip.html', 'Zip codes by number of customers' ], -% ; -% -% tie my %report_invoices_open, 'Tie::IxHash', -% 'All open invoices' => [ $fsurl.'search/cust_bill.html?OPEN_date', 'All invoices with an unpaid balance' ], -% '15 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN15_date', 'Invoices 15 days or older with an unpaid balance' ], -% '30 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN30_date', 'Invoices 30 days or older with an unpaid balance' ], -% '60 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN60_date', 'Invoices 60 days or older with an unpaid balance' ], -% '90 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN90_date', 'Invoices 90 days or older with an unpaid balance' ], -% '120 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN120_date', 'Invoices 120 days or older with an unpaid balance' ], -% ; -% -% tie my %report_invoices, 'Tie::IxHash', -% 'Open invoices' => [ \%report_invoices_open, 'Open invoices' ], -% 'All invoices' => [ $fsurl. 'search/cust_bill.html?date', 'List all invoices' ], -% 'Advanced invoice reports' => [ $fsurl.'search/report_cust_bill.html', 'by agent, date range, etc.' ], -% ; -% -% tie my %report_services_acct, 'Tie::IxHash', -% 'All accounts by username' => [ $fsurl.'search/svc_acct.cgi?username', '' ], -% 'All accounts by UID' => [ $fsurl.'search/svc_acct.cgi?uid', '' ], -% ; -% $report_services_acct{'Unlinked accounts'} = [ $fsurl.'search/svc_acct.cgi?UN_uid', 'Pre-Freeside accounts without a customer record' ] -% if $curuser->access_right('View/link unlinked services'); -% -% tie my %report_services_domain, 'Tie::IxHash', -% 'All domains' => [ $fsurl.'search/svc_domain.cgi?domain', '' ], -% ; -% $report_services_domain{'Unlinked domains'} = [ $fsurl.'search/svc_domain.cgi?UN_domain', 'Pre-Freeside domains without a customer record' ] -% if $curuser->access_right('View/link unlinked services'); -% -% tie my %report_services_forward, 'Tie::IxHash', -% 'All mail forwards' => [ $fsurl.'search/svc_forward.cgi?svcnum', '' ], -% ; -% $report_services_forward{'Unlinked mail forwards'} = [ $fsurl.'search/svc_forward.cgi?UN_svcnum', 'Pre-Freeside mail forwards without a customer record' ] -% if $curuser->access_right('View/link unlinked services'); -% -% tie my %report_services_www, 'Tie::IxHash', -% 'All virtual hosts' => [ $fsurl.'search/svc_www.cgi?svcnum', '' ], -% ; -% $report_services_www{'Unlinked virtual hosts'} = [ $fsurl.'search/svc_www.cgi?UN_svcnum', 'Pre-Freeside virtual hosts without a customer record' ] -% if $curuser->access_right('View/link unlinked services'); -% -% tie my %report_services_broadband, 'Tie::IxHash', -% 'All broadband services' => [ $fsurl.'search/svc_broadband.cgi?svcnum', '' ], -% #'Unlinked domain' => [ $fsurl.'search/svc_acct.cgi?UN_uid', 'Pre-Freeside domains without a customer record' ], -% ; -% -% tie my %report_services_phone, 'Tie::IxHash', -% 'All phone numbers' => [ $fsurl.'search/svc_phone.cgi?svcnum', '' ], -% ; -% -% tie my %report_services_external, 'Tie::IxHash', -% 'All external services' => [ $fsurl.'search/svc_external.cgi?id', '' ], -% ; -% $report_services_external{'Unlinked external services'} = [ $fsurl.'search/svc_external.cgi?UN_id', 'Pre-Freeside domains without a customer record' ] -% if $curuser->access_right('View/link unlinked services'); -% -% tie my %report_services, 'Tie::IxHash'; -% if ( $curuser->access_right('Configuration') ) { -% $report_services{'Service definitions'} = [ $fsurl.'browse/part_svc.cgi?orderby=active', 'Service definitions by number of active packages' ]; -% $report_services{'separator'} = ''; -% } -% $report_services{'Accounts'} = [ \%report_services_acct, 'Access accounts and mailboxes' ]; -% $report_services{'Domains'} = [ \%report_services_domain, 'Domains', ]; -% $report_services{'Mail forwards'} = [ \%report_services_forward, 'Mail forwards', ]; -% $report_services{'Virtual hosts'} = [ \%report_services_www, 'Virtual hosting', ]; -% $report_services{'Broadband services'} = [ \%report_services_broadband, 'Fixed (username-less) broadband services', ]; -% $report_services{'Phone numbers'} = [ \%report_services_phone, 'Telephone numbers', ]; -% $report_services{'External services'} = [ \%report_services_external, 'External services', ]; -% -% tie my %report_packages, 'Tie::IxHash'; -% if ( $curuser->access_right('Configuration') ) { -% $report_packages{'Package definitions'} = [ $fsurl.'browse/part_pkg.cgi?active=1', 'Package definitions by number of active packages' ]; -% $report_packages{'separator'} = ''; -% } -% $report_packages{'All customer packages'} = [ $fsurl.'search/cust_pkg.cgi?pkgnum', 'List all customer packages', ]; -% $report_packages{'Suspended customer packages'} = [ $fsurl.'search/cust_pkg.cgi?magic=suspended', 'List suspended packages' ]; -% $report_packages{'Customer packages with unconfigured services'} = [ $fsurl.'search/cust_pkg.cgi?APKG_pkgnum', 'List packages which have provisionable services' ]; -% $report_packages{'Advanced package reports'} = [ $fsurl.'search/report_cust_pkg.html', 'by agent, date range, status, package definition' ]; -% -% tie my %report_rating, 'Tie::IxHash', -% 'Call Detail Records (CDRs)' => [ $fsurl.'search/report_cdr.html', '' ], -% ; -% -% tie my %report_financial, 'Tie::IxHash', -% 'Sales, Credits and Receipts' => [ $fsurl.'graph/report_money_time.html', 'Sales, credits and receipts summary graph' ], -% 'Sales Report' => [ $fsurl.'graph/report_cust_bill_pkg.html', 'Sales report and graph (by agent, package class and/or date range)' ], -% 'Credit Report' => [ $fsurl.'search/report_cust_credit.html', 'Credit report (by employee and/or date range)' ], -% 'Payment Report' => [ $fsurl.'search/report_cust_pay.html', 'Credit report (by type and/or date range)' ], -% 'A/R Aging' => [ $fsurl.'search/report_receivables.html', 'Accounts Receivable Aging report' ], -% 'Prepaid Income' => [ $fsurl.'search/report_prepaid_income.html', 'Prepaid income (unearned revenue) report' ], -% 'Sales Tax Liability' => [ $fsurl.'search/report_tax.html', 'Sales tax liability report' ], -% ; -% -% tie my %report_menu, 'Tie::IxHash'; -% $report_menu{'Customers'} = [ \%report_customers, 'Customer reports' ] -% if $curuser->access_right('List customers'); -% $report_menu{'Invoices'} = [ \%report_invoices, 'Invoice reports' ] -% if $curuser->access_right('List invoices'); -% $report_menu{'Packages'} = [ \%report_packages, 'Package reports' ] -% if $curuser->access_right('List packages'); -% $report_menu{'Services'} = [ \%report_services, 'Services reports' ] -% if $curuser->access_right('List services'); -% $report_menu{'Rating data'} = [ \%report_rating, 'Rating reports' ] -% if $curuser->access_right('List rating data'); -% $report_menu{'Financial'} = [ \%report_financial, 'Financial reports' ] -% if $curuser->access_right('Financial reports'); -% -% tie my %tools_importing, 'Tie::IxHash', -% 'Import customers from CSV file' => [ $fsurl.'misc/cust_main-import.cgi', '' ], -% 'Import one-time charges from CSV file' => [ $fsurl.'misc/cust_main-import_charges.cgi', '' ], -% 'Import Call Detail Records (CDRs) from CSV file' => [ $fsurl.'misc/cdr-import.html', '' ], -% ; -% -% tie my %tools_exporting, 'Tie::IxHash', -% 'Download database dump' => [ $fsurl. 'misc/dump.cgi', '' ], -% ; -% -% # -% # -% -% tie my %tools_menu, 'Tie::IxHash', (); -% $tools_menu{'Quick payment entry'} = [ $fsurl.'misc/batch-cust_pay.html', 'Enter multiple payments in a batch' ] -% if $curuser->access_right('Post payment batch'); -% $tools_menu{'Job Queue'} = [ $fsurl.'search/queue.html', 'View pending job queue' ] -% if $curuser->access_right('Job queue'); -% $tools_menu{'Importing'} = [ \%tools_importing, 'Import tools' ] -% if $curuser->access_right('Import'); -% $tools_menu{'Exporting'} = [ \%tools_exporting, 'Export tools' ] -% if $curuser->access_right('Export'); -% -% tie my %config_employees, 'Tie::IxHash', -% 'View/Edit employees' => [ $fsurl.'browse/access_user.html', 'Setup internal users' ], -% 'View/Edit employee groups' => [ $fsurl.'browse/access_group.html', 'Employee groups allow you to control access to the backend' ], -% ; -% -% tie my %config_export_svc_pkg, 'Tie::IxHash', -% 'View/Edit exports' => [ $fsurl.'browse/part_export.cgi', 'Provisioning services to external machines, databases and APIs' ], -% 'View/Edit service definitions' => [ $fsurl.'browse/part_svc.cgi', 'Services are items you offer to your customers' ], -% 'View/Edit package definitions' => [ $fsurl.'browse/part_pkg.cgi', 'One or more services are grouped together into a package and given pricing information. Customers purchase packages, not services' ], -% 'View/Edit package classes' => [ $fsurl.'browse/pkg_class.html', 'Package classes define groups of packages, for reporting and convenience purposes.' ], -% ; -% -% tie my %config_agent, 'Tie::IxHash', -% 'View/Edit agent types' => [ $fsurl.'browse/agent_type.cgi', 'Agent types define groups of package definitions that you can then assign to particular agents' ], -% 'View/Edit agents' => [ $fsurl.'browse/agent.cgi', 'Agents are resellers of your service. Agents may be limited to a subset of your full offerings (via their type)' ], -% ; -% -% tie my %config_billing, 'Tie::IxHash', -% 'View/Edit payment gateways' => [ $fsurl.'browse/payment_gateway.html', 'Credit card and electronic check processors' ], -% 'View/Edit invoice events' => [ $fsurl.'browse/part_bill_event.cgi', 'Actions for overdue invoices' ], -% 'View/Edit prepaid cards' => [ $fsurl.'search/prepay_credit.html', 'View outstanding cards, generate new cards' ], -% 'View/Edit call rates and regions' => [ $fsurl.'browse/rate.cgi', 'Manage rate plans, regions and prefixes for VoIP and call billing' ], -% 'View/Edit locales and tax rates' => [ $fsurl.'browse/cust_main_county.cgi', 'Change tax rates, or break down a country into states, or a state into counties and assign different tax rates to each' ], -% ; -% -% tie my %config_dialup, 'Tie::IxHash', -% 'View/Edit access numbers' => [ $fsurl.'browse/svc_acct_pop.cgi', 'Points of Presence' ], -% ; -% -% tie my %config_broadband, 'Tie::IxHash', -% 'View/Edit routers' => [ $fsurl.'browse/router.cgi', 'Broadband access routers' ], -% 'View/Edit address blocks' => [ $fsurl.'browse/addr_block.cgi', 'Manage address blocks and block assignments to broadband routers' ], -% ; -% -% tie my %config_misc, 'Tie::IxHash'; -% $config_misc{'View/Edit advertising sources'} = [ $fsurl.'browse/part_referral.html', 'Where a customer heard about your service. Tracked for informational purposes' ] -% if $curuser->access_right('Configuration') -% || $curuser->access_right('Edit advertising sources') -% || $curuser->access_right('Edit global advertising sources'); -% if ( $curuser->access_right('Configuration') ) { -% $config_misc{'View/Edit virtual fields'} = [ $fsurl.'browse/part_virtual_field.cgi', 'Locally defined fields', ]; -% $config_misc{'View/Edit message catalog'} = [ $fsurl.'browse/msgcat.cgi', 'Change error messages and other customizable labels' ]; -% $config_misc{'View/Edit inventory classes and inventory'} = [ $fsurl.'browse/inventory_class.html', 'Setup inventory classes and stock inventory' ]; -% } -% -% tie my %config_menu, 'Tie::IxHash'; -% if ( $curuser->access_right('Configuration' ) ) { -% %config_menu = ( -% 'Settings' => [ $fsurl.'config/config-view.cgi', '' ], -% 'separator' => '', #its a separator! -% 'Employees' => [ \%config_employees, '' ], -% 'Provisioning, services and packages' -% => [ \%config_export_svc_pkg, '' ], -% 'Resellers' => [ \%config_agent, '' ], -% 'Billing' => [ \%config_billing, '' ], -% 'Dialup' => [ \%config_dialup, '' ], -% 'Fixed (username-less) broadband' -% => [ \%config_broadband, '' ], -% ); -% } -% $config_menu{'Miscellaneous'} = [ \%config_misc, '' ] -% if $curuser->access_right('Configuration') -% || $curuser->access_right('Edit advertising sources') -% || $curuser->access_right('Edit global advertising sources'); -% -% tie my %menu, 'Tie::IxHash', -% 'Billing Main' => [ $fsurl, 'Billing start page', ], -% 'Ticketing Main' => [ -% ( $conf->config('ticket_system') eq 'RT_External' -% ? FS::TicketSystem->baseurl() -% : $fsurl.'rt/' -% ), -% 'Ticketing start page', -% ], -% ; -% $menu{'Reports'} = [ \%report_menu, 'Lists, reporting and graphing' ] -% if keys %report_menu; -% $menu{'Tools'} = [ \%tools_menu, 'Tools' ] -% if keys %tools_menu; -% $menu{'Configuration'} = [ \%config_menu, 'Configuraiton and setup' ] -% if $curuser->access_right('Configuration') -% || $curuser->access_right('Edit advertising sources') -% || $curuser->access_right('Edit global advertising sources'); -% -% use vars qw($gmenunum); -% $gmenunum = 0; -% -% sub submenu { -% my($submenu, $title) = @_; -% my $menunum = $gmenunum++; -% -% #return two args: html, menuname -% -% "var myMenu$menunum = new WebFXMenu;\n". -% #"myMenu$menunum.useAutoPosition = true;\n". -% "myMenu$menunum.emptyText = '$title';\n". -% -% ( -% join("\n", map { -% -% if ( !ref( $submenu->{$_} ) ) { -% -% "myMenu$menunum.add(new WebFXMenuSeparator());"; -% -% } else { -% -% my($url_or_submenu, $tooltip ) = @{ $submenu->{$_} }; -% if ( ref($url_or_submenu) ) { -% -% my($subhtml, $submenuname ) = submenu($url_or_submenu, $_); #mmm, recursion -% -% "$subhtml\n". -% "myMenu$menunum.add(new WebFXMenuItem(\"$_\", null, \"$tooltip\", $submenuname ));"; -% -% } else { -% -% "myMenu$menunum.add(new WebFXMenuItem(\"$_\", \"$url_or_submenu\", \"$tooltip\" ));"; -% -% } -% -% } -% -% } keys %$submenu ) -% ). "\n". -% "myMenu$menunum.width = 224\n", -% -% "myMenu$menunum"; -% -% } -% -% - - @@ -298,46 +8,329 @@ webfxMenuImagePath = "<%$fsurl%>images/"; webfxMenuUseHover = 1; webfxMenuShowTime = 300; - webfxMenuHideTime = 300; + webfxMenuHideTime = 500; var myBar = new WebFXMenuBar; + % foreach my $item ( keys %menu ) { % -% my( $url_or_submenu, $tooltip ) = @{ $menu{$item} }; +% my( $url_or_submenu, $tooltip ) = @{ $menu{$item} }; % -% if ( ref($url_or_submenu) ) { +% if ( ref($url_or_submenu) ) { % % #warn $item; % % my( $subhtml, $submenuname ) = submenu($url_or_submenu, $item); -% -% - - <% $subhtml %> - myBar.add(new WebFXMenuButton("<% $item %>", null, "<% $tooltip %>", <% $submenuname %> )); -% } else { + <% $subhtml %> + myBar.add(new WebFXMenuButton("<% $item %>", null, "<% $tooltip %>", <% $submenuname %> )); +% } else { - myBar.add(new WebFXMenuButton("<% $item %>", "<% $url_or_submenu %>", "<% $tooltip %>" )); -% } -% -% } -% + myBar.add(new WebFXMenuButton("<% $item %>", "<% $url_or_submenu %>", "<% $tooltip %>" )); +% } +% +% } myBar.show( null, 'vertical' ); - //myBar.show( null, 'horizontal' ); - - //var myMenu = new WebFXMenu; - //myMenu.add(new WebFXMenuItem("Menu Item 1", "http://www.domain.com", "Tool tip to show")); - //myMenu.add(new WebFXMenuSeparator()); - //myMenu.add(new WebFXMenuItem("Menu Item 2", "http://www.domain.com", "Tool tip to show")); - - //var mySubMenu = new WebFXMenu; - //mySubMenu.add(new WebFXMenuItem("Menu Item 3", "http://www.domain.com", "Tool tip to show")); - //myMenu.add(new WebFXMenuItem("Menu Item 4 with sub menu", null, "Tool tip to show", mySubMenu)); - myBar.width = 154; + +<%init> +my( %opt ) = @_; +my $conf = new FS::Conf; +my $fsurl = $opt{'freeside_baseurl'}; + +my $curuser = $FS::CurrentUser::CurrentUser; + +#Active tickets not assigned to a customer + +tie my %report_customers_lists, 'Tie::IxHash', + 'by customer number' => [ $fsurl. 'search/cust_main.cgi?browse=custnum', '' ], + 'by last name' => [ $fsurl. 'search/cust_main.cgi?browse=last', '' ], + 'by company name' => [ $fsurl. 'search/cust_main.cgi?browse=company', '' ], + 'by active trouble tickets' => [ $fsurl. 'search/cust_main.cgi?browse=tickets', '' ], +; + +tie my %report_customers_search, 'Tie::IxHash', + 'by ordering employee' => [ $fsurl. 'search/cust_main-otaker.cgi' ], +; + +tie my %report_customers, 'Tie::IxHash', + 'List customers' => [ \%report_customers_lists, 'List customers' ], + 'Search customers' => [ \%report_customers_search, 'Search customers' ], + 'Zip code distribution' => [ $fsurl.'search/report_cust_main-zip.html', 'Zip codes by number of customers' ], +; + +tie my %report_invoices_open, 'Tie::IxHash', + 'All open invoices' => [ $fsurl.'search/cust_bill.html?OPEN_date', 'All invoices with an unpaid balance' ], + '15 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN15_date', 'Invoices 15 days or older with an unpaid balance' ], + '30 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN30_date', 'Invoices 30 days or older with an unpaid balance' ], + '60 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN60_date', 'Invoices 60 days or older with an unpaid balance' ], + '90 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN90_date', 'Invoices 90 days or older with an unpaid balance' ], + '120 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN120_date', 'Invoices 120 days or older with an unpaid balance' ], +; + +tie my %report_invoices, 'Tie::IxHash', + 'Open invoices' => [ \%report_invoices_open, 'Open invoices' ], + 'All invoices' => [ $fsurl. 'search/cust_bill.html?date', 'List all invoices' ], + 'Advanced invoice reports' => [ $fsurl.'search/report_cust_bill.html', 'by agent, date range, etc.' ], +; + +tie my %report_services_acct, 'Tie::IxHash', + 'All accounts by username' => [ $fsurl.'search/svc_acct.cgi?username', '' ], + 'All accounts by UID' => [ $fsurl.'search/svc_acct.cgi?uid', '' ], +; +$report_services_acct{'Unlinked accounts'} = [ $fsurl.'search/svc_acct.cgi?UN_uid', 'Pre-Freeside accounts without a customer record' ] + if $curuser->access_right('View/link unlinked services'); + +tie my %report_services_domain, 'Tie::IxHash', + 'All domains' => [ $fsurl.'search/svc_domain.cgi?domain', '' ], +; +$report_services_domain{'Unlinked domains'} = [ $fsurl.'search/svc_domain.cgi?UN_domain', 'Pre-Freeside domains without a customer record' ] + if $curuser->access_right('View/link unlinked services'); + +tie my %report_services_forward, 'Tie::IxHash', + 'All mail forwards' => [ $fsurl.'search/svc_forward.cgi?svcnum', '' ], +; +$report_services_forward{'Unlinked mail forwards'} = [ $fsurl.'search/svc_forward.cgi?UN_svcnum', 'Pre-Freeside mail forwards without a customer record' ] + if $curuser->access_right('View/link unlinked services'); + +tie my %report_services_www, 'Tie::IxHash', + 'All virtual hosts' => [ $fsurl.'search/svc_www.cgi?svcnum', '' ], +; +$report_services_www{'Unlinked virtual hosts'} = [ $fsurl.'search/svc_www.cgi?UN_svcnum', 'Pre-Freeside virtual hosts without a customer record' ] + if $curuser->access_right('View/link unlinked services'); + +tie my %report_services_broadband, 'Tie::IxHash', + 'All broadband services' => [ $fsurl.'search/svc_broadband.cgi?svcnum', '' ], + #'Unlinked domain' => [ $fsurl.'search/svc_acct.cgi?UN_uid', 'Pre-Freeside domains without a customer record' ], +; + +tie my %report_services_phone, 'Tie::IxHash', + 'All phone numbers' => [ $fsurl.'search/svc_phone.cgi?svcnum', '' ], +; + +tie my %report_services_external, 'Tie::IxHash', + 'All external services' => [ $fsurl.'search/svc_external.cgi?id', '' ], +; +$report_services_external{'Unlinked external services'} = [ $fsurl.'search/svc_external.cgi?UN_id', 'Pre-Freeside domains without a customer record' ] + if $curuser->access_right('View/link unlinked services'); + +tie my %report_services, 'Tie::IxHash'; +if ( $curuser->access_right('Configuration') ) { + $report_services{'Service definitions'} = [ $fsurl.'browse/part_svc.cgi?orderby=active', 'Service definitions by number of active packages' ]; + $report_services{'separator'} = ''; +} +$report_services{'Accounts'} = [ \%report_services_acct, 'Access accounts and mailboxes' ]; +$report_services{'Domains'} = [ \%report_services_domain, 'Domains', ]; +$report_services{'Mail forwards'} = [ \%report_services_forward, 'Mail forwards', ]; +$report_services{'Virtual hosts'} = [ \%report_services_www, 'Virtual hosting', ]; +$report_services{'Broadband services'} = [ \%report_services_broadband, 'Fixed (username-less) broadband services', ]; +$report_services{'Phone numbers'} = [ \%report_services_phone, 'Telephone numbers', ]; +$report_services{'External services'} = [ \%report_services_external, 'External services', ]; + +tie my %report_packages, 'Tie::IxHash'; +if ( $curuser->access_right('Configuration') ) { + $report_packages{'Package definitions'} = [ $fsurl.'browse/part_pkg.cgi?active=1', 'Package definitions by number of active packages' ]; + $report_packages{'separator'} = ''; +} +$report_packages{'All customer packages'} = [ $fsurl.'search/cust_pkg.cgi?pkgnum', 'List all customer packages', ]; +$report_packages{'Suspended customer packages'} = [ $fsurl.'search/cust_pkg.cgi?magic=suspended', 'List suspended packages' ]; +$report_packages{'Customer packages with unconfigured services'} = [ $fsurl.'search/cust_pkg.cgi?APKG_pkgnum', 'List packages which have provisionable services' ]; +$report_packages{'Advanced package reports'} = [ $fsurl.'search/report_cust_pkg.html', 'by agent, date range, status, package definition' ]; + +tie my %report_rating, 'Tie::IxHash', + 'Call Detail Records (CDRs)' => [ $fsurl.'search/report_cdr.html', '' ], +; + +tie my %report_bill_event, 'Tie::IxHash', + 'All billing events' => [ $fsurl.'search/cust_bill_event.html', 'All billing events for a date range' ], + 'Invoice event errors' => [ $fsurl.'search/cust_bill_event.html?failed=1', 'failed credit cards, processor or printer problems, etc.' ], +; + +tie my %report_financial, 'Tie::IxHash', + 'Sales, Credits and Receipts' => [ $fsurl.'graph/report_money_time.html', 'Sales, credits and receipts summary graph' ], + 'Sales Report' => [ $fsurl.'graph/report_cust_bill_pkg.html', 'Sales report and graph (by agent, package class and/or date range)' ], + 'Credit Report' => [ $fsurl.'search/report_cust_credit.html', 'Credit report (by employee and/or date range)' ], + 'Payment Report' => [ $fsurl.'search/report_cust_pay.html', 'Credit report (by type and/or date range)' ], + 'A/R Aging' => [ $fsurl.'search/report_receivables.html', 'Accounts Receivable Aging report' ], + 'Prepaid Income' => [ $fsurl.'search/report_prepaid_income.html', 'Prepaid income (unearned revenue) report' ], + 'Sales Tax Liability' => [ $fsurl.'search/report_tax.html', 'Sales tax liability report' ], +; + +tie my %report_menu, 'Tie::IxHash'; +$report_menu{'Customers'} = [ \%report_customers, 'Customer reports' ] + if $curuser->access_right('List customers'); +$report_menu{'Invoices'} = [ \%report_invoices, 'Invoice reports' ] + if $curuser->access_right('List invoices'); +$report_menu{'Packages'} = [ \%report_packages, 'Package reports' ] + if $curuser->access_right('List packages'); +$report_menu{'Services'} = [ \%report_services, 'Services reports' ] + if $curuser->access_right('List services'); +$report_menu{'Rating data'} = [ \%report_rating, 'Rating reports' ] + if $curuser->access_right('List rating data'); +$report_menu{'Billing events'} = [ \%report_bill_event, 'Billing events' ] + if $curuser->access_right('Billing event reports'); +$report_menu{'Financial'} = [ \%report_financial, 'Financial reports' ] + if $curuser->access_right('Financial reports'); + +tie my %tools_importing, 'Tie::IxHash', + 'Import customers from CSV file' => [ $fsurl.'misc/cust_main-import.cgi', '' ], + 'Import one-time charges from CSV file' => [ $fsurl.'misc/cust_main-import_charges.cgi', '' ], + 'Import Call Detail Records (CDRs) from CSV file' => [ $fsurl.'misc/cdr-import.html', '' ], +; + +tie my %tools_exporting, 'Tie::IxHash', + 'Download database dump' => [ $fsurl. 'misc/dump.cgi', '' ], +; + +# +# + +tie my %tools_menu, 'Tie::IxHash', (); +$tools_menu{'Quick payment entry'} = [ $fsurl.'misc/batch-cust_pay.html', 'Enter multiple payments in a batch' ] + if $curuser->access_right('Post payment batch'); +$tools_menu{'Job Queue'} = [ $fsurl.'search/queue.html', 'View pending job queue' ] + if $curuser->access_right('Job queue'); +$tools_menu{'Importing'} = [ \%tools_importing, 'Import tools' ] + if $curuser->access_right('Import'); +$tools_menu{'Exporting'} = [ \%tools_exporting, 'Export tools' ] + if $curuser->access_right('Export'); + +tie my %config_employees, 'Tie::IxHash', + 'View/Edit employees' => [ $fsurl.'browse/access_user.html', 'Setup internal users' ], + 'View/Edit employee groups' => [ $fsurl.'browse/access_group.html', 'Employee groups allow you to control access to the backend' ], +; + +tie my %config_export_svc_pkg, 'Tie::IxHash', + 'View/Edit exports' => [ $fsurl.'browse/part_export.cgi', 'Provisioning services to external machines, databases and APIs' ], + 'View/Edit service definitions' => [ $fsurl.'browse/part_svc.cgi', 'Services are items you offer to your customers' ], + 'View/Edit package definitions' => [ $fsurl.'browse/part_pkg.cgi', 'One or more services are grouped together into a package and given pricing information. Customers purchase packages, not services' ], + 'View/Edit package classes' => [ $fsurl.'browse/pkg_class.html', 'Package classes define groups of packages, for reporting and convenience purposes.' ], +; + +tie my %config_agent, 'Tie::IxHash', + 'View/Edit agent types' => [ $fsurl.'browse/agent_type.cgi', 'Agent types define groups of package definitions that you can then assign to particular agents' ], + 'View/Edit agents' => [ $fsurl.'browse/agent.cgi', 'Agents are resellers of your service. Agents may be limited to a subset of your full offerings (via their type)' ], +; + +tie my %config_billing, 'Tie::IxHash', + 'View/Edit payment gateways' => [ $fsurl.'browse/payment_gateway.html', 'Credit card and electronic check processors' ], + 'View/Edit invoice events' => [ $fsurl.'browse/part_bill_event.cgi', 'Actions for overdue invoices' ], + 'View/Edit prepaid cards' => [ $fsurl.'search/prepay_credit.html', 'View outstanding cards, generate new cards' ], + 'View/Edit call rates and regions' => [ $fsurl.'browse/rate.cgi', 'Manage rate plans, regions and prefixes for VoIP and call billing' ], + 'View/Edit locales and tax rates' => [ $fsurl.'browse/cust_main_county.cgi', 'Change tax rates, or break down a country into states, or a state into counties and assign different tax rates to each' ], +; + +tie my %config_dialup, 'Tie::IxHash', + 'View/Edit access numbers' => [ $fsurl.'browse/svc_acct_pop.cgi', 'Points of Presence' ], +; + +tie my %config_broadband, 'Tie::IxHash', + 'View/Edit routers' => [ $fsurl.'browse/router.cgi', 'Broadband access routers' ], + 'View/Edit address blocks' => [ $fsurl.'browse/addr_block.cgi', 'Manage address blocks and block assignments to broadband routers' ], +; + +tie my %config_misc, 'Tie::IxHash'; +$config_misc{'View/Edit advertising sources'} = [ $fsurl.'browse/part_referral.html', 'Where a customer heard about your service. Tracked for informational purposes' ] + if $curuser->access_right('Configuration') + || $curuser->access_right('Edit advertising sources') + || $curuser->access_right('Edit global advertising sources'); +if ( $curuser->access_right('Configuration') ) { + $config_misc{'View/Edit virtual fields'} = [ $fsurl.'browse/part_virtual_field.cgi', 'Locally defined fields', ]; + $config_misc{'View/Edit message catalog'} = [ $fsurl.'browse/msgcat.cgi', 'Change error messages and other customizable labels' ]; + $config_misc{'View/Edit inventory classes and inventory'} = [ $fsurl.'browse/inventory_class.html', 'Setup inventory classes and stock inventory' ]; +} + +tie my %config_menu, 'Tie::IxHash'; +if ( $curuser->access_right('Configuration' ) ) { + %config_menu = ( + 'Settings' => [ $fsurl.'config/config-view.cgi', '' ], + 'separator' => '', #its a separator! + 'Employees' => [ \%config_employees, '' ], + 'Provisioning, services and packages' + => [ \%config_export_svc_pkg, '' ], + 'Resellers' => [ \%config_agent, '' ], + 'Billing' => [ \%config_billing, '' ], + 'Dialup' => [ \%config_dialup, '' ], + 'Fixed (username-less) broadband' + => [ \%config_broadband, '' ], + ); +} +$config_menu{'Miscellaneous'} = [ \%config_misc, '' ] + if $curuser->access_right('Configuration') + || $curuser->access_right('Edit advertising sources') + || $curuser->access_right('Edit global advertising sources'); + +tie my %menu, 'Tie::IxHash', + 'Billing Main' => [ $fsurl, 'Billing start page', ], + 'Ticketing Main' => [ + ( $conf->config('ticket_system') eq 'RT_External' + ? FS::TicketSystem->baseurl() + : $fsurl.'rt/' + ), + 'Ticketing start page', + ], +; +$menu{'Reports'} = [ \%report_menu, 'Lists, reporting and graphing' ] + if keys %report_menu; +$menu{'Tools'} = [ \%tools_menu, 'Tools' ] + if keys %tools_menu; +$menu{'Configuration'} = [ \%config_menu, 'Configuraiton and setup' ] + if $curuser->access_right('Configuration') + || $curuser->access_right('Edit advertising sources') + || $curuser->access_right('Edit global advertising sources'); + +use vars qw($gmenunum); +$gmenunum = 0; + +sub submenu { + my($submenu, $title) = @_; + my $menunum = $gmenunum++; + + #return two args: html, menuname + + "var myMenu$menunum = new WebFXMenu;\n". + #"myMenu$menunum.useAutoPosition = true;\n". + "myMenu$menunum.emptyText = '$title';\n". + + ( + join("\n", map { + + if ( !ref( $submenu->{$_} ) ) { + + "myMenu$menunum.add(new WebFXMenuSeparator());"; + + } else { + + my($url_or_submenu, $tooltip ) = @{ $submenu->{$_} }; + if ( ref($url_or_submenu) ) { + + my($subhtml, $submenuname ) = submenu($url_or_submenu, $_); #mmm, recursion + + "$subhtml\n". + "myMenu$menunum.add(new WebFXMenuItem(\"$_\", null, \"$tooltip\", $submenuname ));"; + + } else { + + "myMenu$menunum.add(new WebFXMenuItem(\"$_\", \"$url_or_submenu\", \"$tooltip\" ));"; + + } + + } + + } keys %$submenu ) + ). "\n". + "myMenu$menunum.width = 224\n", + + "myMenu$menunum"; + +} + + + -- cgit v1.2.1 From 4b4f61a65ed9780bc9eca211d2bd8fd57173e945 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 4 Sep 2006 16:24:10 +0000 Subject: add RADIUS session search back to main menu --- httemplate/elements/menu.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index 80a664cc9..959a08620 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -143,6 +143,7 @@ $report_packages{'Customer packages with unconfigured services'} = [ $fsurl.'se $report_packages{'Advanced package reports'} = [ $fsurl.'search/report_cust_pkg.html', 'by agent, date range, status, package definition' ]; tie my %report_rating, 'Tie::IxHash', + 'RADIUS sessions' => [ $fsurl.'search/sqlradius.html', '' ], 'Call Detail Records (CDRs)' => [ $fsurl.'search/report_cdr.html', '' ], ; @@ -170,7 +171,7 @@ $report_menu{'Packages'} = [ \%report_packages, 'Package reports' ] if $curuser->access_right('List packages'); $report_menu{'Services'} = [ \%report_services, 'Services reports' ] if $curuser->access_right('List services'); -$report_menu{'Rating data'} = [ \%report_rating, 'Rating reports' ] +$report_menu{'Usage'} = [ \%report_rating, 'Usage reports' ] if $curuser->access_right('List rating data'); $report_menu{'Billing events'} = [ \%report_bill_event, 'Billing events' ] if $curuser->access_right('Billing event reports'); -- cgit v1.2.1 From b9dea1e88a8a13a0d206e23ee5c864a0be813030 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 4 Sep 2006 20:05:58 +0000 Subject: allow time selection in RADIUS searches and grid-ize the resulting table --- httemplate/elements/tr-input-beginning_ending.html | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/tr-input-beginning_ending.html b/httemplate/elements/tr-input-beginning_ending.html index 9fa936bca..a8ab6ed10 100644 --- a/httemplate/elements/tr-input-beginning_ending.html +++ b/httemplate/elements/tr-input-beginning_ending.html @@ -6,26 +6,28 @@
From:
m/d/y
MAXLENGTH=<%$maxlength%>>
m/d/y<% $time_hint %>
To:
m/d/y
MAXLENGTH=<%$maxlength%>>
m/d/y<% $time_hint %>
<% $label %> + + +
<% $label %> - +
Reason + +
+

Reason Type

+
+ +
+

New Reason

+
Freeside v<% $FS::VERSION %>
- Documentation
+ ">Documentation
+ <% $title %> -- cgit v1.2.1 From 221ab7ff23a7d18668f589a4382780b00b351f12 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 23 Oct 2006 09:44:54 +0000 Subject: have the unlinked account search go to UN_username so it doesn't miss accounts with no UID --- httemplate/elements/menu.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index ad6138c72..daabcbbb8 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -84,7 +84,7 @@ tie my %report_services_acct, 'Tie::IxHash', 'All accounts by username' => [ $fsurl.'search/svc_acct.cgi?username', '' ], 'All accounts by UID' => [ $fsurl.'search/svc_acct.cgi?uid', '' ], ; -$report_services_acct{'Unlinked accounts'} = [ $fsurl.'search/svc_acct.cgi?UN_uid', 'Pre-Freeside accounts without a customer record' ] +$report_services_acct{'Unlinked accounts'} = [ $fsurl.'search/svc_acct.cgi?UN_username', 'Pre-Freeside accounts without a customer record' ] if $curuser->access_right('View/link unlinked services'); tie my %report_services_domain, 'Tie::IxHash', @@ -107,7 +107,7 @@ $report_services_www{'Unlinked virtual hosts'} = [ $fsurl.'search/svc_www.cgi?UN tie my %report_services_broadband, 'Tie::IxHash', 'All broadband services' => [ $fsurl.'search/svc_broadband.cgi?svcnum', '' ], - #'Unlinked domain' => [ $fsurl.'search/svc_acct.cgi?UN_uid', 'Pre-Freeside domains without a customer record' ], + #'Unlinked domain' => [ $fsurl.'search/svc_acct.cgi?UN_uid', 'Pre-Freeside broadband services without a customer record' ], ; tie my %report_services_phone, 'Tie::IxHash', @@ -117,7 +117,7 @@ tie my %report_services_phone, 'Tie::IxHash', tie my %report_services_external, 'Tie::IxHash', 'All external services' => [ $fsurl.'search/svc_external.cgi?id', '' ], ; -$report_services_external{'Unlinked external services'} = [ $fsurl.'search/svc_external.cgi?UN_id', 'Pre-Freeside domains without a customer record' ] +$report_services_external{'Unlinked external services'} = [ $fsurl.'search/svc_external.cgi?UN_id', 'Pre-Freeside external services without a customer record' ] if $curuser->access_right('View/link unlinked services'); tie my %report_services, 'Tie::IxHash'; -- cgit v1.2.1 From 0c2f4bccc3810426d4b9e31dca645711c32f0b63 Mon Sep 17 00:00:00 2001 From: jeff Date: Wed, 25 Oct 2006 04:44:48 +0000 Subject: select multiple pkgparts on advanced package report --- .../elements/tr-selectmultiple-part_pkg.html | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 httemplate/elements/tr-selectmultiple-part_pkg.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/tr-selectmultiple-part_pkg.html b/httemplate/elements/tr-selectmultiple-part_pkg.html new file mode 100644 index 000000000..abf96d726 --- /dev/null +++ b/httemplate/elements/tr-selectmultiple-part_pkg.html @@ -0,0 +1,23 @@ +% +% my( $cust_fields, %opt ) = @_; +% +% use FS::ConfDefaults; +% $opt{'avail_fields'} ||= [ FS::ConfDefaults->cust_fields_avail() ]; +% +% + + +
<% $opt{'label'} || 'Packages' %> + <% include( '/elements/select-table.html', + 'table' => 'part_pkg', + 'name_col' => 'pkg', + 'value' => '', + 'empty_label' => '(none)', + 'element_etc' => 'multiple', + %opt, + ) + %> +
<% $conf->config('company_name') || 'ExampleCo' %> Logged in as <% getotaker %> 
Preferences 
+
Logged in as <% getotaker %> 
Preferences 
<% $label %> - +
From: From date: MAXLENGTH=<%$maxlength%>>
m/d/y<% $time_hint %>
From date: MAXLENGTH=<%$maxlength%>>
m/d/y<% $time_hint %>
MAXLENGTH=<%$maxlength%>>
m/d/y<% $time_hint %>
<% $label %> - +
From date: MAXLENGTH=<%$maxlength%>>
m/d/y<% $time_hint %>
MAXLENGTH=<%$maxlength%>>
m/d/y<% $time_hint %>
<% $label %> - +
+
+
@@ -172,13 +191,26 @@ input.fsblackbuttonselected {
+ + + +% if ( $menu_position eq 'left' ) { + - + +% } + + + + + +% if ( $menu_position eq 'left' ) { + - + - +% unless ( $opt{layout} =~ /^h/i ) { #horizontal + + + +% } + - +
- - + +% if ( $opt{'position'} eq 'top' ) { + + + + +% } else { # elsif ( $opt{'position'} eq 'left' ) { + + + + +% } + -
From date: MAXLENGTH=<%$maxlength%>>
m/d/y<% $time_hint %>
MAXLENGTH=<%$maxlength%>>
m/d/y<% $time_hint %>
To date: MAXLENGTH=<%$maxlength%>>
m/d/y<% $time_hint %>
MAXLENGTH=<%$maxlength%>>
m/d/y<% $time_hint %>