diff --git a/oss/vtiger/trunk/include/install/images/bottomGradient.gif b/oss/vtiger/trunk/include/install/images/bottomGradient.gif new file mode 100644 index 00000000..46470c9f Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/bottomGradient.gif differ diff --git a/oss/vtiger/trunk/include/install/images/bottomShadow.jpg b/oss/vtiger/trunk/include/install/images/bottomShadow.jpg new file mode 100644 index 00000000..580b2f77 Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/bottomShadow.jpg differ diff --git a/oss/vtiger/trunk/include/install/images/checkagain.png b/oss/vtiger/trunk/include/install/images/checkagain.png new file mode 100644 index 00000000..721591b4 Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/checkagain.png differ diff --git a/oss/vtiger/trunk/include/install/images/checkagain_blue.png b/oss/vtiger/trunk/include/install/images/checkagain_blue.png new file mode 100644 index 00000000..69bc2363 Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/checkagain_blue.png differ diff --git a/oss/vtiger/trunk/include/install/images/checkagain_blue2.png b/oss/vtiger/trunk/include/install/images/checkagain_blue2.png new file mode 100644 index 00000000..cfc1d99c Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/checkagain_blue2.png differ diff --git a/oss/vtiger/trunk/include/install/images/confWizConfFile.gif b/oss/vtiger/trunk/include/install/images/confWizConfFile.gif new file mode 100644 index 00000000..89c24c60 Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/confWizConfFile.gif differ diff --git a/oss/vtiger/trunk/include/install/images/confWizConfirmSettings.gif b/oss/vtiger/trunk/include/install/images/confWizConfirmSettings.gif new file mode 100644 index 00000000..8d2731ea Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/confWizConfirmSettings.gif differ diff --git a/oss/vtiger/trunk/include/install/images/confWizDbGeneration.gif b/oss/vtiger/trunk/include/install/images/confWizDbGeneration.gif new file mode 100644 index 00000000..88f4b9c4 Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/confWizDbGeneration.gif differ diff --git a/oss/vtiger/trunk/include/install/images/confWizFinish.gif b/oss/vtiger/trunk/include/install/images/confWizFinish.gif new file mode 100644 index 00000000..5f2db8d2 Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/confWizFinish.gif differ diff --git a/oss/vtiger/trunk/include/install/images/confWizInstallCheck.gif b/oss/vtiger/trunk/include/install/images/confWizInstallCheck.gif new file mode 100644 index 00000000..1e83cf71 Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/confWizInstallCheck.gif differ diff --git a/oss/vtiger/trunk/include/install/images/confWizPreMigrationTools.gif b/oss/vtiger/trunk/include/install/images/confWizPreMigrationTools.gif new file mode 100644 index 00000000..469ffbea Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/confWizPreMigrationTools.gif differ diff --git a/oss/vtiger/trunk/include/install/images/confWizSysConfig.gif b/oss/vtiger/trunk/include/install/images/confWizSysConfig.gif new file mode 100644 index 00000000..90e671a6 Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/confWizSysConfig.gif differ diff --git a/oss/vtiger/trunk/include/install/images/configwizard.gif b/oss/vtiger/trunk/include/install/images/configwizard.gif new file mode 100644 index 00000000..da2dc80e Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/configwizard.gif differ diff --git a/oss/vtiger/trunk/include/install/images/cwBtnBack.gif b/oss/vtiger/trunk/include/install/images/cwBtnBack.gif new file mode 100644 index 00000000..c9afdf2c Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/cwBtnBack.gif differ diff --git a/oss/vtiger/trunk/include/install/images/cwBtnChange.gif b/oss/vtiger/trunk/include/install/images/cwBtnChange.gif new file mode 100644 index 00000000..61f9f8df Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/cwBtnChange.gif differ diff --git a/oss/vtiger/trunk/include/install/images/cwBtnFinish.gif b/oss/vtiger/trunk/include/install/images/cwBtnFinish.gif new file mode 100644 index 00000000..b946d1b7 Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/cwBtnFinish.gif differ diff --git a/oss/vtiger/trunk/include/install/images/cwBtnInstall.gif b/oss/vtiger/trunk/include/install/images/cwBtnInstall.gif new file mode 100644 index 00000000..b0a6bd59 Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/cwBtnInstall.gif differ diff --git a/oss/vtiger/trunk/include/install/images/cwBtnMigrate.gif b/oss/vtiger/trunk/include/install/images/cwBtnMigrate.gif new file mode 100644 index 00000000..ee128499 Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/cwBtnMigrate.gif differ diff --git a/oss/vtiger/trunk/include/install/images/cwBtnNext.gif b/oss/vtiger/trunk/include/install/images/cwBtnNext.gif new file mode 100644 index 00000000..4eca04a3 Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/cwBtnNext.gif differ diff --git a/oss/vtiger/trunk/include/install/images/dbCopy.gif b/oss/vtiger/trunk/include/install/images/dbCopy.gif new file mode 100644 index 00000000..c5f89a9b Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/dbCopy.gif differ diff --git a/oss/vtiger/trunk/include/install/images/dbDump.gif b/oss/vtiger/trunk/include/install/images/dbDump.gif new file mode 100644 index 00000000..47228812 Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/dbDump.gif differ diff --git a/oss/vtiger/trunk/include/install/images/loading.gif b/oss/vtiger/trunk/include/install/images/loading.gif new file mode 100644 index 00000000..0f39792e Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/loading.gif differ diff --git a/oss/vtiger/trunk/include/install/images/pageBackground.gif b/oss/vtiger/trunk/include/install/images/pageBackground.gif new file mode 100644 index 00000000..4b5e02f8 Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/pageBackground.gif differ diff --git a/oss/vtiger/trunk/include/install/images/qcBg.gif b/oss/vtiger/trunk/include/install/images/qcBg.gif new file mode 100644 index 00000000..54430417 Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/qcBg.gif differ diff --git a/oss/vtiger/trunk/include/install/images/settingsMTBg.gif b/oss/vtiger/trunk/include/install/images/settingsMTBg.gif new file mode 100644 index 00000000..1fd616fa Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/settingsMTBg.gif differ diff --git a/oss/vtiger/trunk/include/install/images/settingsSelUIBg.gif b/oss/vtiger/trunk/include/install/images/settingsSelUIBg.gif new file mode 100644 index 00000000..071e53e8 Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/settingsSelUIBg.gif differ diff --git a/oss/vtiger/trunk/include/install/images/start.jpg b/oss/vtiger/trunk/include/install/images/start.jpg new file mode 100644 index 00000000..b73fda5c Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/start.jpg differ diff --git a/oss/vtiger/trunk/include/install/images/tabSelectedBg.gif b/oss/vtiger/trunk/include/install/images/tabSelectedBg.gif new file mode 100644 index 00000000..7ecb1d1b Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/tabSelectedBg.gif differ diff --git a/oss/vtiger/trunk/include/install/images/tabSeperatorBg.gif b/oss/vtiger/trunk/include/install/images/tabSeperatorBg.gif new file mode 100644 index 00000000..c9f7845c Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/tabSeperatorBg.gif differ diff --git a/oss/vtiger/trunk/include/install/images/tabUnSelectedBg.gif b/oss/vtiger/trunk/include/install/images/tabUnSelectedBg.gif new file mode 100644 index 00000000..a57da829 Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/tabUnSelectedBg.gif differ diff --git a/oss/vtiger/trunk/include/install/images/topHeadBg.gif b/oss/vtiger/trunk/include/install/images/topHeadBg.gif new file mode 100644 index 00000000..ac65cc6a Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/topHeadBg.gif differ diff --git a/oss/vtiger/trunk/include/install/images/topInnerShadow.gif b/oss/vtiger/trunk/include/install/images/topInnerShadow.gif new file mode 100644 index 00000000..2a0c9b93 Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/topInnerShadow.gif differ diff --git a/oss/vtiger/trunk/include/install/images/trans.gif b/oss/vtiger/trunk/include/install/images/trans.gif new file mode 100644 index 00000000..170a5b17 Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/trans.gif differ diff --git a/oss/vtiger/trunk/include/install/images/vtigercrm5.gif b/oss/vtiger/trunk/include/install/images/vtigercrm5.gif new file mode 100644 index 00000000..71c6e61d Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/vtigercrm5.gif differ diff --git a/oss/vtiger/trunk/include/install/images/welcome.gif b/oss/vtiger/trunk/include/install/images/welcome.gif new file mode 100644 index 00000000..915f75b9 Binary files /dev/null and b/oss/vtiger/trunk/include/install/images/welcome.gif differ diff --git a/oss/vtiger/trunk/include/install/install.css b/oss/vtiger/trunk/include/install/install.css new file mode 100644 index 00000000..297343f0 --- /dev/null +++ b/oss/vtiger/trunk/include/install/install.css @@ -0,0 +1,295 @@ +/********************************************************************************* + * The contents of this file are subject to the Mozilla Public License Version 1.1 + * ("License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at http://www.mozilla.org/MPL + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for + * the specific language governing rights and limitations under the License. + * The Original Code is: SugarCRM Open Source + * The Initial Developer of the Original Code is SugarCRM, Inc. + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.; + * All Rights Reserved. + * Contributor(s): ______________________________________. + ********************************************************************************/ +/********************************************************************************* + * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/install/install.css,v 1.5 2004/08/26 11:44:30 saraj Exp $ + * Description: Defines the stylesheet used for the application installation. + ********************************************************************************/ +/* Install - Configuration Wizard */ +.cwPageBg { + background-color:#cccccc; + background-image:url(images/pageBackground.gif); + background-repeat:repeat-x; +} +.cwHeadBg { + -moz-border-radius-topleft:15px; + background-image:url(images/topHeadBg.gif); + background-repeat:repeat-x; + +} +.cwfooterBg { + -moz-border-radius-bottomleft:15px; + -moz-border-radius-bottomright:15px; + background-repeat:repeat-x; + +} +.cwHeadBg1 { + background-image:url(images/topHeadBg.gif); + background-repeat:repeat-x; + -moz-border-radius-topright:15px; + +} +.cwContentDisplay{ + background-color:#ffffff; +} +.cwSelectedTab { + background-color:#ffffff; +} +.cwUnSelectedTab { + background-color:#1B9AE3; + color:#ffffff; +} + +.txtBox{ + width:85%; + border:1px solid #666666; + font-family:Arial, Helvetica, sans-serif; + font-size:11px; +} + +.small { + font-family: Arial, Helvetica, sans-serif; + font-size: 11px; + line-height: 14px; +} + +td{ + font-family: Arial, Helvetica, sans-serif; + font-size:11px; +} + +.header{ + -moz-border-radius-bottomleft:5px; + -moz-border-radius-bottomright:5px; + -moz-border-radius-topleft:5px; + -moz-border-radius-topright:5px; + background-color:#000000; + background-image:url('include/install/images/header_1.gif'); + border:1px outset #CCCCCC; + color:black; + height:5em; + line-height:6em; + padding:1px 4px; +} + +.level2{ + -moz-border-radius-bottomleft:5px; + -moz-border-radius-bottomright:5px; + -moz-border-radius-topleft:5px; + -moz-border-radius-topright:5px; + background-color:#DEDEDE; + border:1px outset #CCCCCC; + color:black; + font-size:20px; + line-height:1.4em; + padding:1px 4px; +} + +.level1{ + background-color:white; +} + +tr{ + font-family: Arial, Helvetica, sans-serif; + font-size:12px; +} + +.header{ + -moz-border-radius-bottomleft:5px; + -moz-border-radius-bottomright:5px; + -moz-border-radius-topleft:5px; + -moz-border-radius-topright:5px; + background-color:#000000; + background-image:url('include/install/images/header_1.gif'); + border:1px outset #CCCCCC; + color:black; + height:5em; + line-height:6em; + padding:1px 4px; +} + +.level2{ + -moz-border-radius-bottomleft:5px; + -moz-border-radius-bottomright:5px; + -moz-border-radius-topleft:5px; + -moz-border-radius-topright:5px; + background-color:#DEDEDE; + border:1px outset #CCCCCC; + color:black; + font-size:20px; + line-height:1.4em; + padding:1px 4px; +} + +.level1{ + background-color:white; +} + +table +.level0{ + background-color:#FFFFFF; +} + +.level2{ + -moz-border-radius-bottomleft:5px; + -moz-border-radius-bottomright:5px; + -moz-border-radius-topleft:5px; + -moz-border-radius-topright:5px; + background-color:#DEDEDE; + border:1px outset #CCCCCC; + color:black; + padding:1px 4px; +} + +.level1{ + -moz-border-radius-bottomleft:5px; + -moz-border-radius-bottomright:5px; + -moz-border-radius-topleft:5px; + -moz-border-radius-topright:5px; + background-color:#EEEEEE; + border:1px solid #CCCCCC; + align:right; +} + +.level3{ + -moz-border-radius-bottomleft:.8em; + -moz-border-radius-bottomright:.8em; + -moz-border-radius-topleft:.8em; + -moz-border-radius-topright:.8em; + background-color:#E7E7E7; + border:1px solid #CCCCCC; + font-size:20px; + line-height:1.4em; + padding:1px 4px; +} + +.licence{ + height:375px; + padding:5px; + width:95%; +} + +.veil, .veil_new { + Filter: Alpha(opacity = 50); + -moz-opacity: 0.5; + opacity: 0.5; +} + +.contentDisplay{ + -moz-border-radius-bottomleft:1em; + -moz-border-radius-bottomright:1em; + -moz-border-radius-topleft:1em; + -moz-border-radius-topright:1em; + background-color:#E1E1FD; + border:1px dashed #000000; + font-size: 12px; +} + +.leftAbsPopup{ + position: absolute; + right: 25%; + top: 10%; + background-color: #b7b7b7; + border: 2px solid #777; + width: 65em; +} + +.floatRightTiny{ + width: 1em; + float: right; + font-size: 16px; + border: 1px solid black; + background-color: #b7b7b7; + } + +.floatRightTinyOn{ + width: 1em; + float: right; + font-size: 16px; + border: 1px solid black; + background-color: #070707; +} + +.floatRightTiny a{ + text-decoration: none; + color: black; +} + +.floatRightTinyOn a{ + text-decoration: none; + color: white; +} + +.leftAbsPopup textarea{ + height:40em; + width: 54em; + border:1px solid #dadada; +} + +.posLayPopup { + border:2px solid #ddd; + background:#fffff5 url(../../themes/softed/images/layerPopupBg.gif) ; + position:absolute; + width: 40em; + padding-left: 0.5em; + padding-bottom: 0.5em; +} + +.cellBackground { + background-color: #E7E7E7; +} + +.textCenter { + text-align: center; +} + +.higherLineHeight { + line-height: 20px; +} + +.mediumLineHeight { + line-height: 16px; +} + +.paddingPoint5em { + padding: .5em; +} + +.redColor { + color: red; +} + +.smallFont { + font-size: small; +} + +#unhealthyTablesList { + border : 1px solid black; +} + +#unhealthyTablesList td { + border : 1px solid black; + border-left: 0px; + border-top: 0px; +} + +#dbMirrorCopy { + font-size: 12px; +} + +#dbMirrorCopy .floatRightTiny, #dbMirrorCopy .floatRightTinyOn, +#responsePopupContainer .floatRightTiny, #responsePopupContainer .floatRightTinyOn { + background: none; + border: 0; + padding-top: 0.2em; +} \ No newline at end of file diff --git a/oss/vtiger/trunk/include/js/ColorPicker2.js b/oss/vtiger/trunk/include/js/ColorPicker2.js new file mode 100644 index 00000000..eb39b435 --- /dev/null +++ b/oss/vtiger/trunk/include/js/ColorPicker2.js @@ -0,0 +1,75 @@ +// =================================================================== +// Author: Matt Kruse +// WWW: http://www.mattkruse.com/ +// +// NOTICE: You may use this code for any purpose, commercial or +// private, without any further permission from the author. You may +// remove this notice from your final code if you wish, however it is +// appreciated by the author if at least my web site address is kept. +// +// You may *NOT* re-distribute this code in any way except through its +// use. That means, you can include it in your product, or your web +// site, or any other form where the code is actually being used. You +// may not put the plain javascript up on your site for download or +// include it in your javascript libraries for download. +// If you wish to share this code with others, please just point them +// to the URL instead. +// Please DO NOT link directly to my .js files from your site. Copy +// the files to your server and use them there. Thank you. +// =================================================================== + +/* SOURCE FILE: AnchorPosition.js */ +function getAnchorPosition(anchorname){var useWindow=false;var coordinates=new Object();var x=0,y=0;var use_gebi=false, use_css=false, use_layers=false;if(document.getElementById){use_gebi=true;}else if(document.all){use_css=true;}else if(document.layers){use_layers=true;}if(use_gebi && document.all){x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);}else if(use_gebi){var o=document.getElementById(anchorname);x=AnchorPosition_getPageOffsetLeft(o);y=AnchorPosition_getPageOffsetTop(o);}else if(use_css){x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);}else if(use_layers){var found=0;for(var i=0;i screen.availHeight){this.y = screen.availHeight - this.height;}}if(screen && screen.availWidth){if((this.x + this.width) > screen.availWidth){this.x = screen.availWidth - this.width;}}var avoidAboutBlank = window.opera ||( document.layers && !navigator.mimeTypes['*']) || navigator.vendor == 'KDE' ||( document.childNodes && !document.all && !navigator.taintEnabled);this.popupWindow = window.open(avoidAboutBlank?"":"about:blank","window_"+anchorname,this.windowProperties+",width="+this.width+",height="+this.height+",screenX="+this.x+",left="+this.x+",screenY="+this.y+",top="+this.y+"");}this.refresh();}} +function PopupWindow_hidePopup(){if(this.divName != null){if(this.use_gebi){document.getElementById(this.divName).style.visibility = "hidden";}else if(this.use_css){document.all[this.divName].style.visibility = "hidden";}else if(this.use_layers){document.layers[this.divName].visibility = "hidden";}}else{if(this.popupWindow && !this.popupWindow.closed){this.popupWindow.close();this.popupWindow = null;}}} +function PopupWindow_isClicked(e){if(this.divName != null){if(this.use_layers){var clickX = e.pageX;var clickY = e.pageY;var t = document.layers[this.divName];if((clickX > t.left) &&(clickX < t.left+t.clip.width) &&(clickY > t.top) &&(clickY < t.top+t.clip.height)){return true;}else{return false;}}else if(document.all){var t = window.event.srcElement;while(t.parentElement != null){if(t.id==this.divName){return true;}t = t.parentElement;}return false;}else if(this.use_gebi && e){var t = e.originalTarget;while(t.parentNode != null){if(t.id==this.divName){return true;}t = t.parentNode;}return false;}return false;}return false;} +function PopupWindow_hideIfNotClicked(e){if(this.autoHideEnabled && !this.isClicked(e)){this.hidePopup();}} +function PopupWindow_autoHide(){this.autoHideEnabled = true;} +function PopupWindow_hidePopupWindows(e){for(var i=0;i0){this.type="DIV";this.divName = arguments[0];}else{this.type="WINDOW";}this.use_gebi = false;this.use_css = false;this.use_layers = false;if(document.getElementById){this.use_gebi = true;}else if(document.all){this.use_css = true;}else if(document.layers){this.use_layers = true;}else{this.type = "WINDOW";}this.offsetX = 0;this.offsetY = 0;this.getXYPosition = PopupWindow_getXYPosition;this.populate = PopupWindow_populate;this.setUrl = PopupWindow_setUrl;this.setWindowProperties = PopupWindow_setWindowProperties;this.refresh = PopupWindow_refresh;this.showPopup = PopupWindow_showPopup;this.hidePopup = PopupWindow_hidePopup;this.setSize = PopupWindow_setSize;this.isClicked = PopupWindow_isClicked;this.autoHide = PopupWindow_autoHide;this.hideIfNotClicked = PopupWindow_hideIfNotClicked;} + + +/* SOURCE FILE: ColorPicker2.js */ + +ColorPicker_targetInput = null; +function ColorPicker_writeDiv(){document.writeln("");} +function ColorPicker_show(anchorname){this.showPopup(anchorname);} +function ColorPicker_pickColor(color,obj){obj.hidePopup();pickColor(color);} +function pickColor(color){if(ColorPicker_targetInput==null){alert("Target Input is null, which means you either didn't use the 'select' function or you have no defined your own 'pickColor' function to handle the picked color!");return;}ColorPicker_targetInput.value = color;} +function ColorPicker_select(inputobj,linkname){if(inputobj.type!="text" && inputobj.type!="hidden" && inputobj.type!="textarea"){alert("colorpicker.select: Input object passed is not a valid form input object");window.ColorPicker_targetInput=null;return;}window.ColorPicker_targetInput = inputobj;this.show(linkname);} +function ColorPicker_highlightColor(c){var thedoc =(arguments.length>1)?arguments[1]:window.document;var d = thedoc.getElementById("colorPickerSelectedColor");d.style.backgroundColor = c;d = thedoc.getElementById("colorPickerSelectedColorValue");d.innerHTML = c;} +function ColorPicker(){var windowMode = false;if(arguments.length==0){var divname = "colorPickerDiv";}else if(arguments[0] == "window"){var divname = '';windowMode = true;}else{var divname = arguments[0];}if(divname != ""){var cp = new PopupWindow(divname);}else{var cp = new PopupWindow();cp.setSize(225,250);}cp.currentValue = "#FFFFFF";cp.writeDiv = ColorPicker_writeDiv;cp.highlightColor = ColorPicker_highlightColor;cp.show = ColorPicker_show;cp.select = ColorPicker_select;var colors = new Array("#000000","#000033","#000066","#000099","#0000CC","#0000FF","#330000","#330033","#330066","#330099","#3300CC", +"#3300FF","#660000","#660033","#660066","#660099","#6600CC","#6600FF","#990000","#990033","#990066","#990099", +"#9900CC","#9900FF","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#FF0000","#FF0033","#FF0066", +"#FF0099","#FF00CC","#FF00FF","#003300","#003333","#003366","#003399","#0033CC","#0033FF","#333300","#333333", +"#333366","#333399","#3333CC","#3333FF","#663300","#663333","#663366","#663399","#6633CC","#6633FF","#993300", +"#993333","#993366","#993399","#9933CC","#9933FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF", +"#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#006600","#006633","#006666","#006699","#0066CC", +"#0066FF","#336600","#336633","#336666","#336699","#3366CC","#3366FF","#666600","#666633","#666666","#666699", +"#6666CC","#6666FF","#996600","#996633","#996666","#996699","#9966CC","#9966FF","#CC6600","#CC6633","#CC6666", +"#CC6699","#CC66CC","#CC66FF","#FF6600","#FF6633","#FF6666","#FF6699","#FF66CC","#FF66FF","#009900","#009933", +"#009966","#009999","#0099CC","#0099FF","#339900","#339933","#339966","#339999","#3399CC","#3399FF","#669900", +"#669933","#669966","#669999","#6699CC","#6699FF","#999900","#999933","#999966","#999999","#9999CC","#9999FF", +"#CC9900","#CC9933","#CC9966","#CC9999","#CC99CC","#CC99FF","#FF9900","#FF9933","#FF9966","#FF9999","#FF99CC", +"#FF99FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#33CC00","#33CC33","#33CC66","#33CC99", +"#33CCCC","#33CCFF","#66CC00","#66CC33","#66CC66","#66CC99","#66CCCC","#66CCFF","#99CC00","#99CC33","#99CC66", +"#99CC99","#99CCCC","#99CCFF","#CCCC00","#CCCC33","#CCCC66","#CCCC99","#CCCCCC","#CCCCFF","#FFCC00","#FFCC33", +"#FFCC66","#FFCC99","#FFCCCC","#FFCCFF","#00FF00","#00FF33","#00FF66","#00FF99","#00FFCC","#00FFFF","#33FF00", +"#33FF33","#33FF66","#33FF99","#33FFCC","#33FFFF","#66FF00","#66FF33","#66FF66","#66FF99","#66FFCC","#66FFFF", +"#99FF00","#99FF33","#99FF66","#99FF99","#99FFCC","#99FFFF","#CCFF00","#CCFF33","#CCFF66","#CCFF99","#CCFFCC", +"#CCFFFF","#FFFF00","#FFFF33","#FFFF66","#FFFF99","#FFFFCC","#FFFFFF");var total = colors.length;var width = 18;var cp_contents = "";var windowRef =(windowMode)?"window.opener.":"";if(windowMode){cp_contents += "Select Color";cp_contents += "
";}cp_contents += "";var use_highlight =(document.getElementById || document.all)?true:false;for(var i=0;i   ';if( ((i+1)>=total) ||(((i+1) % width) == 0)){cp_contents += "";}}if(document.getElementById){var width1 = Math.floor(width/2);var width2 = width = width1;cp_contents += "";}cp_contents += "
 #FFFFFF
";if(windowMode){cp_contents += "
";}cp.populate(cp_contents+"\n");cp.offsetY = 25;cp.autoHide();return cp;} + diff --git a/oss/vtiger/trunk/include/js/Inventory.js b/oss/vtiger/trunk/include/js/Inventory.js new file mode 100644 index 00000000..58e961ad --- /dev/null +++ b/oss/vtiger/trunk/include/js/Inventory.js @@ -0,0 +1,1255 @@ +/********************************************************************************* + +** The contents of this file are subject to the vtiger CRM Public License Version 1.0 + * ("License"); You may not use this file except in compliance with the License + * The Original Code is: vtiger CRM Open Source + * The Initial Developer of the Original Code is vtiger. + * Portions created by vtiger are Copyright (C) vtiger. + * All Rights Reserved. + ********************************************************************************/ + +function copyAddressRight(form) { + + if(typeof(form.bill_street) != 'undefined' && typeof(form.ship_street) != 'undefined') + form.ship_street.value = form.bill_street.value; + + if(typeof(form.bill_city) != 'undefined' && typeof(form.ship_city) != 'undefined') + form.ship_city.value = form.bill_city.value; + + if(typeof(form.bill_state) != 'undefined' && typeof(form.ship_state) != 'undefined') + form.ship_state.value = form.bill_state.value; + + if(typeof(form.bill_code) != 'undefined' && typeof(form.ship_code) != 'undefined') + form.ship_code.value = form.bill_code.value; + + if(typeof(form.bill_country) != 'undefined' && typeof(form.ship_country) != 'undefined') + form.ship_country.value = form.bill_country.value; + + if(typeof(form.bill_pobox) != 'undefined' && typeof(form.ship_pobox) != 'undefined') + form.ship_pobox.value = form.bill_pobox.value; + + return true; + +} + +function copyAddressLeft(form) { + + if(typeof(form.bill_street) != 'undefined' && typeof(form.ship_street) != 'undefined') + form.bill_street.value = form.ship_street.value; + + if(typeof(form.bill_city) != 'undefined' && typeof(form.ship_city) != 'undefined') + form.bill_city.value = form.ship_city.value; + + if(typeof(form.bill_state) != 'undefined' && typeof(form.ship_state) != 'undefined') + form.bill_state.value = form.ship_state.value; + + if(typeof(form.bill_code) != 'undefined' && typeof(form.ship_code) != 'undefined') + form.bill_code.value = form.ship_code.value; + + if(typeof(form.bill_country) != 'undefined' && typeof(form.ship_country) != 'undefined') + form.bill_country.value = form.ship_country.value; + + if(typeof(form.bill_pobox) != 'undefined' && typeof(form.ship_pobox) != 'undefined') + form.bill_pobox.value = form.ship_pobox.value; + + return true; + +} + +function settotalnoofrows() { + var max_row_count = document.getElementById('proTab').rows.length; + max_row_count = eval(max_row_count)-2; + + //set the total number of products + document.EditView.totalProductCount.value = max_row_count; +} + +function productPickList(currObj,module, row_no) { + var trObj=currObj.parentNode.parentNode + + var rowId = row_no; + var currentRowId = parseInt(currObj.id.match(/([0-9]+)$/)[1]); + + // If we have mismatching rowId and currentRowId, it is due swapping of rows + if(rowId != currentRowId) { + rowId = currentRowId; + } + + var currencyid = document.getElementById("inventory_currency").value; + popuptype = 'inventory_prod'; + if(module == 'PurchaseOrder') + popuptype = 'inventory_prod_po'; + var record_id = ''; + if(document.getElementsByName("account_id").length != 0) + record_id= document.EditView.account_id.value; + if(record_id != '') + window.open("index.php?module=Products&action=Popup&html=Popup_picker&select=enable&form=HelpDeskEditView&popuptype="+popuptype+"&curr_row="+rowId+"&relmod_id="+record_id+"&parent_module=Accounts&return_module="+module+"¤cyid="+currencyid,"productWin","width=640,height=600,resizable=0,scrollbars=0,status=1,top=150,left=200"); + else + window.open("index.php?module=Products&action=Popup&html=Popup_picker&select=enable&form=HelpDeskEditView&popuptype="+popuptype+"&curr_row="+rowId+"&return_module="+module+"¤cyid="+currencyid,"productWin","width=640,height=600,resizable=0,scrollbars=0,status=1,top=150,left=200"); +} + +function priceBookPickList(currObj, row_no) { + var trObj=currObj.parentNode.parentNode + var rowId=row_no;//parseInt(trObj.id.substr(trObj.id.indexOf("w")+1,trObj.id.length)) + var currencyid = document.getElementById("inventory_currency").value; + var productId=getObj("hdnProductId"+rowId).value || -1; + window.open("index.php?module=PriceBooks&action=Popup&html=Popup_picker&form=EditView&popuptype=inventory_pb&fldname=listPrice"+rowId+"&productid="+productId+"¤cyid="+currencyid,"priceBookWin","width=640,height=565,resizable=0,scrollbars=0,top=150,left=200"); +} + + +function getProdListBody() { + if (browser_ie) { + var prodListBody=getObj("productList").children[0].children[0] + } else if (browser_nn4 || browser_nn6) { + if (getObj("productList").childNodes.item(0).tagName=="TABLE") { + var prodListBody=getObj("productList").childNodes.item(0).childNodes.item(0) + } else { + var prodListBody=getObj("productList").childNodes.item(1).childNodes.item(1) + } + } + return prodListBody; +} + + +function deleteRow(module,i,image_path) +{ + rowCnt--; + var tableName = document.getElementById('proTab'); + var prev = tableName.rows.length; + +// document.getElementById('proTab').deleteRow(i); + document.getElementById("row"+i).style.display = 'none'; + +// Added For product Reordering starts + image_path = document.getElementById("hidImagePath").value; + iMax = tableName.rows.length; + for(iCount=i;iCount>=1;iCount--) + { + if(document.getElementById("row"+iCount) && document.getElementById("row"+iCount).style.display != 'none') + { + iPrevRowIndex = iCount; + break; + } + } + iPrevCount = iPrevRowIndex; + oCurRow = eval(document.getElementById("row"+i)); + sTemp = oCurRow.cells[0].innerHTML; + ibFound = sTemp.indexOf("down_layout.gif"); + + if(i != 2 && ibFound == -1 && iPrevCount != 1) + { + oPrevRow = eval(document.getElementById("row"+iPrevCount)); + + iPrevCount = eval(iPrevCount); + oPrevRow.cells[0].innerHTML = ' '; + } + else if(iPrevCount == 1) + { + iSwapIndex = i; + for(iCount=i;iCount<=iMax-2;iCount++) + { + if(document.getElementById("row"+iCount) && document.getElementById("row"+iCount).style.display != 'none') + { + iSwapIndex = iCount; + break; + } + } + if(iSwapIndex == i) + { + oPrevRow = eval(document.getElementById("row"+iPrevCount)); + iPrevCount = eval(iPrevCount); + oPrevRow.cells[0].innerHTML = ' '; + } + } +// Product reordering addition ends + document.getElementById("hdnProductId"+i).value = ""; + //document.getElementById("productName"+i).value = ""; + document.getElementById('deleted'+i).value = 1; + + calcTotal() +} +/* End */ + + +// Function to Calcuate the Inventory total including all products +function calcTotal() { + + var max_row_count = document.getElementById('proTab').rows.length; + max_row_count = eval(max_row_count)-2;//Because the table has two header rows. so we will reduce two from row length + var netprice = 0.00; + for(var i=1;i<=max_row_count;i++) + { + rowId = i; + calcProductTotal(rowId); + } + calcGrandTotal(); +} + +// Function to Calculate the Total for a particular product in an Inventory +function calcProductTotal(rowId) { + + if(document.getElementById('deleted'+rowId) && document.getElementById('deleted'+rowId).value == 0) + { + + var total=eval(getObj("qty"+rowId).value*getObj("listPrice"+rowId).value); + getObj("productTotal"+rowId).innerHTML=roundValue(total.toString()) + + var totalAfterDiscount = eval(total-document.getElementById("discountTotal"+rowId).innerHTML); + getObj("totalAfterDiscount"+rowId).innerHTML=roundValue(totalAfterDiscount.toString()) + + + var tax_type = document.getElementById("taxtype").value; + //if the tax type is individual then add the tax with net price + if(tax_type == 'individual') + { + callTaxCalc(i); + netprice = totalAfterDiscount+eval(document.getElementById("taxTotal"+rowId).innerHTML); + } + else + netprice = totalAfterDiscount; + + getObj("netPrice"+rowId).innerHTML=roundValue(netprice.toString()) + + } +} + +// Function to Calculate the Net and Grand total for all the products together of an Inventory +function calcGrandTotal() { + var netTotal = 0.0, grandTotal = 0.0; + var discountTotal_final = 0.0, finalTax = 0.0, sh_amount = 0.0, sh_tax = 0.0, adjustment = 0.0; + + var taxtype = document.getElementById("taxtype").value; + + var max_row_count = document.getElementById('proTab').rows.length; + max_row_count = eval(max_row_count)-2;//Because the table has two header rows. so we will reduce two from row length + + for (var i=1;i<=max_row_count;i++) + { + if(document.getElementById('deleted'+i).value == 0) + { + + if (document.getElementById("netPrice"+i).innerHTML=="") + document.getElementById("netPrice"+i).innerHTML = 0.0 + if (!isNaN(document.getElementById("netPrice"+i).innerHTML)) + netTotal += parseFloat(document.getElementById("netPrice"+i).innerHTML) + } + } +// alert(netTotal); + document.getElementById("netTotal").innerHTML = netTotal; + document.getElementById("subtotal").value = netTotal; + setDiscount(this,'_final'); + calcGroupTax(); + //Tax and Adjustment values will be taken when they are valid integer or decimal values + //if(/^-?(0|[1-9]{1}\d{0,})(\.(\d{1}\d{0,}))?$/.test(document.getElementById("txtTax").value)) + // txtTaxVal = parseFloat(getObj("txtTax").value); + //if(/^-?(0|[1-9]{1}\d{0,})(\.(\d{1}\d{0,}))?$/.test(document.getElementById("txtAdjustment").value)) + // txtAdjVal = parseFloat(getObj("txtAdjustment").value); + + discountTotal_final = document.getElementById("discountTotal_final").innerHTML + + //get the final tax based on the group or individual tax selection + var taxtype = document.getElementById("taxtype").value; + if(taxtype == 'group') + finalTax = document.getElementById("tax_final").innerHTML + + sh_amount = getObj("shipping_handling_charge").value + sh_tax = document.getElementById("shipping_handling_tax").innerHTML + + adjustment = getObj("adjustment").value + + //Add or substract the adjustment based on selection + adj_type = document.getElementById("adjustmentType").value; + + grandTotal = eval(netTotal)-eval(discountTotal_final)+eval(finalTax); + if (sh_amount != '') { + grandTotal = grandTotal + eval(sh_amount)+eval(sh_tax); + } + if (adjustment != '') { + if(adj_type == '+') { + grandTotal = grandTotal + eval(adjustment) + } + else { + grandTotal = grandTotal - eval(adjustment) + } + } + + document.getElementById("grandTotal").innerHTML = roundValue(grandTotal.toString()) + document.getElementById("total").value = roundValue(grandTotal.toString()) +} + +//Method changed as per advice by jon http://forums.vtiger.com/viewtopic.php?t=4162 +function roundValue(val) { + val = parseFloat(val); + val = Math.round(val*100)/100; + val = val.toString(); + + if (val.indexOf(".")<0) { + val+=".00" + } else { + var dec=val.substring(val.indexOf(".")+1,val.length) + if (dec.length>2) + val=val.substring(0,val.indexOf("."))+"."+dec.substring(0,2) + else if (dec.length==1) + val=val+"0" + } + + return val; +} + +//This function is used to validate the Inventory modules +function validateInventory(module) +{ + if(!formValidate()) + return false + + //for products, vendors and pricebook modules we won't validate the product details. here return the control + if(module == 'Products' || module == 'Vendors' || module == 'PriceBooks' || module == 'Services') + { + return true; + } + + var max_row_count = document.getElementById('proTab').rows.length; + max_row_count = eval(max_row_count)-2;//As the table has two header rows, we will reduce two from table row length + + if(!FindDuplicate()) + return false; + + if(max_row_count == 0) + { + alert(alert_arr.NO_LINE_ITEM_SELECTED); + return false; + } + + for (var i=1;i<=max_row_count;i++) + { + //if the row is deleted then avoid validate that row values + if(document.getElementById("deleted"+i).value == 1) + continue; + + if (!emptyCheck("productName"+i,alert_arr.LINE_ITEM,"text")) return false + if (!emptyCheck("qty"+i,"Qty","text")) return false + if (!numValidate("qty"+i,"Qty","any")) return false + if (!numConstComp("qty"+i,"Qty","G","0")) return false + if (!emptyCheck("listPrice"+i,alert_arr.LIST_PRICE,"text")) return false + if (!numValidate("listPrice"+i,alert_arr.LIST_PRICE,"any")) return false + } + + //Product - Discount validation - not allow negative values + if(!validateProductDiscounts()) + return false; + + //Final Discount validation - not allow negative values + discount_checks = document.getElementsByName("discount_final"); + + //Percentage selected, so validate the percentage + if(discount_checks[1].checked == true) + { + temp = /^(0|[1-9]{1}\d{0,})(\.(\d{1}\d{0,}))?$/.test(document.getElementById("discount_percentage_final").value); + if(!temp) + { + alert(alert_arr.VALID_FINAL_PERCENT); + return false; + } + } + if(discount_checks[2].checked == true) + { + temp = /^(0|[1-9]{1}\d{0,})(\.(\d{1}\d{0,}))?$/.test(document.getElementById("discount_amount_final").value); + if(!temp) + { + alert(alert_arr.VALID_FINAL_AMOUNT); + return false; + } + } + + //Shipping & Handling validation - not allow negative values + temp = /^(0|[1-9]{1}\d{0,})(\.(\d{1}\d{0,}))?$/.test(document.getElementById("shipping_handling_charge").value); + if(!temp) + { + alert(alert_arr.VALID_SHIPPING_CHARGE); + return false; + } + + //Adjustment validation - allow negative values + temp = /^-?(0|[1-9]{1}\d{0,})(\.(\d{1}\d{0,}))?$/.test(document.getElementById("adjustment").value) + if(!temp) + { + alert(alert_arr.VALID_ADJUSTMENT); + return false; + } + + //Group - Tax Validation - not allow negative values + //We need to validate group tax only if taxtype is group. + var taxtype=document.getElementById("taxtype").value; + if(taxtype=="group") + { + var tax_count=document.getElementById("group_tax_count").value; + for(var i=1;i<=tax_count;i++) + { + + temp = /^(0|[1-9]{1}\d{0,})(\.(\d{1}\d{0,}))?$/.test(document.getElementById("group_tax_percentage"+i).value); + if(!temp) + { + alert(alert_arr.VALID_TAX_PERCENT); + return false; + } + } + } + + //Taxes for Shippring and Handling validation - not allow negative values + var shtax_count=document.getElementById("sh_tax_count").value; + for(var i=1;i<=shtax_count;i++) + { + + temp = /^(0|[1-9]{1}\d{0,})(\.(\d{1}\d{0,}))?$/.test(document.getElementById("sh_tax_percentage"+i).value); + if(!temp) + { + alert(alert_arr.VALID_SH_TAX); + return false; + } + } + calcTotal(); /* Product Re-Ordering Feature Code Addition */ + + return true; +} + +function FindDuplicate() +{ + var max_row_count = document.getElementById('proTab').rows.length; + max_row_count = eval(max_row_count)-2;//As the table has two header rows, we will reduce two from row length + + var duplicate = false, iposition = '', positions = '', duplicate_products = ''; + + var product_id = new Array(max_row_count-1); + var product_name = new Array(max_row_count-1); + product_id[1] = getObj("hdnProductId"+1).value; + product_name[1] = getObj("productName"+1).value; + for (var i=1;i<=max_row_count;i++) + { + iposition = ""+i; + for(var j=i+1;j<=max_row_count;j++) + { + if(i == 1) + { + product_id[j] = getObj("hdnProductId"+j).value; + } + if(product_id[i] == product_id[j] && product_id[i] != '') + { + if(!duplicate) positions = iposition; + duplicate = true; + if(positions.search(j) == -1) positions = positions+" & "+j; + + if(duplicate_products.search(getObj("productName"+j).value) == -1) + duplicate_products = duplicate_products+getObj("productName"+j).value+" \n"; + } + } + } + if(duplicate) + { + //alert("You have selected < "+duplicate_products+" > more than once in line items "+positions+".\n It is advisable to select the product just once but change the Qty. Thank You"); + if(!confirm(alert_arr.SELECTED_MORE_THAN_ONCE+"\n"+duplicate_products+"\n "+alert_arr.WANT_TO_CONTINUE)) + return false; + } + return true; +} + +function fnshow_Hide(Lay){ + var tagName = document.getElementById(Lay); + if(tagName.style.display == 'none') + tagName.style.display = 'block'; + else + tagName.style.display = 'none'; +} + +function ValidateTax(txtObj) +{ + temp= /^\d+(\.\d\d*)*$/.test(document.getElementById(txtObj).value); + if(temp == false) + alert(alert_arr.ENTER_VALID_TAX); +} + +function loadTaxes_Ajax(curr_row) +{ + //Retrieve all the tax values for the currently selected product + var lineItemType = document.getElementById("lineItemType"+curr_row).value; + new Ajax.Request( + 'index.php', + {queue: {position: 'end', scope: 'command'}, + method: 'post', + postBody: 'module='+lineItemType+'&action='+lineItemType+'Ajax&file=InventoryTaxAjax&productid='+document.getElementById("hdnProductId"+curr_row).value+'&curr_row='+curr_row+'&productTotal='+document.getElementById('totalAfterDiscount'+curr_row).innerHTML, + onComplete: function(response) + { + $("tax_div"+curr_row).innerHTML=response.responseText; + document.getElementById("taxTotal"+curr_row).innerHTML = getObj('hdnTaxTotal'+curr_row).value; + calcTotal(); + } + } + ); + +} + + +function fnAddTaxConfigRow(sh){ + + var table_id = 'add_tax'; + var td_id = 'td_add_tax'; + var label_name = 'addTaxLabel'; + var label_val = 'addTaxValue'; + var add_tax_flag = 'add_tax_type'; + + if(sh != '' && sh == 'sh') + { + table_id = 'sh_add_tax'; + td_id = 'td_sh_add_tax'; + label_name = 'sh_addTaxLabel'; + label_val = 'sh_addTaxValue'; + add_tax_flag = 'sh_add_tax_type'; + } + var tableName = document.getElementById(table_id); + var prev = tableName.rows.length; + var count = rowCnt; + + var row = tableName.insertRow(0); + + var colone = row.insertCell(0); + var coltwo = row.insertCell(1); + + colone.className = "cellLabel small"; + coltwo.className = "cellText small"; + + colone.innerHTML=""; + coltwo.innerHTML=""; + + document.getElementById(td_id).innerHTML=" "; +} + +function validateNewTaxType(fieldname, fieldvalue) +{ + if(trim(document.getElementById(fieldname).value)== '') + { + alert(alert_arr.VALID_TAX_NAME); + return false; + } + if(trim(document.getElementById(fieldvalue).value)== '') + { + alert(alert_arr.CORRECT_TAX_VALUE); + return false; + } + else + { + var temp = /^(0|[1-9]{1}\d{0,})(\.(\d{1}\d{0,}))?$/.test(document.getElementById(fieldvalue).value); + if(!temp) + { + alert(alert_arr.ENTER_POSITIVE_VALUE); + return false; + } + } + + return true; +} + +function validateTaxes(countname) +{ + taxcount = eval(document.getElementById(countname).value)+1; + + if(countname == 'tax_count') + { + taxprefix = 'tax'; + taxLabelPrefix = 'taxlabel_tax'; + } + else + { + taxprefix = 'shtax'; + taxLabelPrefix = 'taxlabel_shtax'; + } + + for(var i=1;i<=taxcount;i++) + { + taxval = document.getElementById(taxprefix+i).value; + taxLabelVal = document.getElementById(taxLabelPrefix+i).value; + document.getElementById(taxLabelPrefix+i).value = taxLabelVal.replace(/^\s*|\s*$/g,'').replace(/\s+/g,''); + + if(document.getElementById(taxLabelPrefix+i).value.length == 0) + { + alert(alert_arr.LABEL_SHOULDNOT_EMPTY); + return false + } + + //Tax value - numeric validation + var temp = /^(0|[1-9]{1}\d{0,})(\.(\d{1}\d{0,}))?$/.test(taxval); + if(!temp) + { + alert("'"+taxval+"' "+alert_arr.NOT_VALID_ENTRY); + return false; + } + } + return true; +} + + + +//Function used to add a new product row in PO, SO, Quotes and Invoice +function fnAddProductRow(module,image_path){ + rowCnt++; + + var tableName = document.getElementById('proTab'); + var prev = tableName.rows.length; + var count = eval(prev)-1;//As the table has two headers, we should reduce the count + var row = tableName.insertRow(prev); + row.id = "row"+count; + row.style.verticalAlign = "top"; + + var colone = row.insertCell(0); + var coltwo = row.insertCell(1); + if(module == "PurchaseOrder"){ + var colfour = row.insertCell(2); + var colfive = row.insertCell(3); + var colsix = row.insertCell(4); + var colseven = row.insertCell(5); + } + else{ + var colthree = row.insertCell(2); + var colfour = row.insertCell(3); + var colfive = row.insertCell(4); + var colsix = row.insertCell(5); + var colseven = row.insertCell(6); + } + /* Product Re-Ordering Feature Code Addition Starts */ + iMax = tableName.rows.length; + for(iCount=1;iCount<=iMax-3;iCount++) + { + if(document.getElementById("row"+iCount) && document.getElementById("row"+iCount).style.display != 'none') + { + iPrevRowIndex = iCount; + } + } + iPrevCount = eval(iPrevRowIndex); + var oPrevRow = tableName.rows[iPrevRowIndex+1]; + var delete_row_count=count; + /* Product Re-Ordering Feature Code Addition ends */ + + + //Delete link + colone.className = "crmTableRow small"; + colone.id = row.id+"_col1"; + colone.innerHTML='

 '; + /* Product Re-Ordering Feature Code Addition Starts */ + if(iPrevCount != 1) + { + oPrevRow.cells[0].innerHTML = '

   '; + } + else + { + oPrevRow.cells[0].innerHTML = '

'; + } + /* Product Re-Ordering Feature Code Addition ends */ + + //Product Name with Popup image to select product + coltwo.className = "crmTableRow small" + coltwo.innerHTML= '
'+ + ''+ + ' '+ + '
'+ + '
'; + + //Quantity In Stock - only for SO, Quotes and Invoice + if(module != "PurchaseOrder"){ + colthree.className = "crmTableRow small" + colthree.innerHTML=' '; + } + + //Quantity + var temp=''; + colfour.className = "crmTableRow small" + temp='
'; + colfour.innerHTML=temp; + //List Price with Discount, Total after Discount and Tax labels + colfive.className = "crmTableRow small" + colfive.innerHTML='
 
(-) '+product_labelarr.DISCOUNT+' :
  '+product_labelarr.ZERO_DISCOUNT+' 
  % '+product_labelarr.PERCENT_OF_PRICE+'  %
  '+product_labelarr.DIRECT_PRICE_REDUCTION+'
'+product_labelarr.TOTAL_AFTER_DISCOUNT+' :
(+) '+product_labelarr.TAX+' :
'; + + //Total and Discount, Total after Discount and Tax details + colsix.className = "crmTableRow small" + colsix.innerHTML = '
 
0.00
 
0.00
'; + + //Net Price + colseven.className = "crmTableRow small"; + colseven.align = "right"; + colseven.style.verticalAlign = "bottom"; + colseven.innerHTML = ' '; + + //This is to show or hide the individual or group tax + decideTaxDiv(); + + calcTotal(); + + return count; +} + +function decideTaxDiv() +{ + var taxtype = document.getElementById("taxtype").value + + calcTotal(); + + if(taxtype == 'group') + { + //if group tax selected then we have to hide the individual taxes and also calculate the group tax + hideIndividualTaxes() + calcGroupTax(); + } + else if(taxtype == 'individual') + hideGroupTax() + +} + +function hideIndividualTaxes() +{ + var max_row_count = document.getElementById('proTab').rows.length; + max_row_count = eval(max_row_count)-2;//Because the table has two header rows. so we will reduce two from row length + + for(var i=1;i<=max_row_count;i++) + { + document.getElementById("individual_tax_row"+i).className = 'TaxHide'; + document.getElementById("taxTotal"+i).style.display = 'none'; + } + document.getElementById("group_tax_row").className = 'TaxShow'; +} + +function hideGroupTax() +{ + var max_row_count = document.getElementById('proTab').rows.length; + max_row_count = eval(max_row_count)-2;//Because the table has two header rows. so we will reduce two from table row length + + for(var i=1;i<=max_row_count;i++) + { + document.getElementById("individual_tax_row"+i).className = 'TaxShow'; + document.getElementById("taxTotal"+i).style.display = 'block'; + } + document.getElementById("group_tax_row").className = 'TaxHide'; +} + +function setDiscount(currObj,curr_row) +{ + var discount_checks = new Array(); + + discount_checks = document.getElementsByName("discount"+curr_row); + + if(discount_checks[0].checked == true) + { + document.getElementById("discount_type"+curr_row).value = 'zero'; + document.getElementById("discount_percentage"+curr_row).style.visibility = 'hidden'; + document.getElementById("discount_amount"+curr_row).style.visibility = 'hidden'; + document.getElementById("discountTotal"+curr_row).innerHTML = 0.00; + } + if(discount_checks[1].checked == true) + { + document.getElementById("discount_type"+curr_row).value = 'percentage'; + document.getElementById("discount_percentage"+curr_row).style.visibility = 'visible'; + document.getElementById("discount_amount"+curr_row).style.visibility = 'hidden'; + + var discount_amount = 0.00; + //This is to calculate the final discount + if(curr_row == '_final') + { + var discount_percentage_final_value = document.getElementById("discount_percentage"+curr_row).value; + if(discount_percentage_final_value == '') discount_percentage_final_value = 0; + discount_amount = eval(document.getElementById("netTotal").innerHTML)*eval(discount_percentage_final_value)/eval(100); + } + else//This is to calculate the product discount + { + var discount_percentage_value = document.getElementById("discount_percentage"+curr_row).value; + if(discount_percentage_value == '') discount_percentage_value = 0; + discount_amount = eval(document.getElementById("productTotal"+curr_row).innerHTML)*eval(discount_percentage_value)/eval(100); + } + //Rounded the decimal part of discount amount to two digits + document.getElementById("discountTotal"+curr_row).innerHTML = roundValue(discount_amount.toString()); + } + if(discount_checks[2].checked == true) + { + document.getElementById("discount_type"+curr_row).value = 'amount'; + document.getElementById("discount_percentage"+curr_row).style.visibility = 'hidden'; + document.getElementById("discount_amount"+curr_row).style.visibility = 'visible'; + //Rounded the decimal part of discount amount to two digits + var discount_amount_value = document.getElementById("discount_amount"+curr_row).value.toString(); + if(discount_amount_value == '') discount_amount_value = 0; + document.getElementById("discountTotal"+curr_row).innerHTML = roundValue(discount_amount_value); + } + // Update product total as discount would have changed. + if(curr_row != '_final') { + calcProductTotal(curr_row); + } + +} + +//This function is added to call the tax calculation function +function callTaxCalc(curr_row) +{ + //when we change discount or list price, we have to calculate the taxes again before calculate the total + if(getObj('tax_table'+curr_row)) + { + tax_count = eval(document.getElementById('tax_table'+curr_row).rows.length-1);//subtract the title tr length + for(var i=0, j=i+1;i eval(stock)) + getObj("stock_alert"+curr_row).innerHTML=''+alert_arr.STOCK_IS_NOT_ENOUGH+''; + else + getObj("stock_alert"+curr_row).innerHTML=''; + } + else + getObj("stock_alert"+curr_row).innerHTML=''+alert_arr.INVALID_QTY+''; +} + +// Function to Get the price for all the products of an Inventory based on the Currency choosen by the User +function updatePrices() { + + var prev_cur = document.getElementById('prev_selected_currency_id'); + var inventory_currency = document.getElementById('inventory_currency'); + if(confirm(alert_arr.MSG_CHANGE_CURRENCY_REVISE_UNIT_PRICE)) { + var productsListElem = document.getElementById('proTab'); + if (productsListElem == null) return; + + var max_row_count = productsListElem.rows.length; + max_row_count = eval(max_row_count)-2;//Because the table has two header rows. so we will reduce two from row length + + var products_list = ""; + for(var i=1;i<=max_row_count;i++) + { + var productid = document.getElementById("hdnProductId"+i).value; + if (i != 1) + products_list = products_list + "::"; + products_list = products_list + productid; + } + + if (prev_cur != null && inventory_currency != null) + prev_cur.value = inventory_currency.value; + + var currency_id = inventory_currency.value; + //Retrieve all the prices for all the products in currently selected currency + new Ajax.Request( + 'index.php', + {queue: {position: 'end', scope: 'command'}, + method: 'post', + postBody: 'module=Products&action=ProductsAjax&file=InventoryPriceAjax¤cyid='+currency_id+'&productsList='+products_list, + onComplete: function(response) + { + if(trim(response.responseText).indexOf('SUCCESS') == 0) { + var res = trim(response.responseText).split("$"); + updatePriceValues(res[1]); + } else { + alert(alert_arr.OPERATION_DENIED); + } + } + } + ); + } else { + if (prev_cur != null && inventory_currency != null) + inventory_currency.value = prev_cur.value; + } +} + +// Function to Update the price for the products in the Inventory Edit View based on the Currency choosen by the User. +function updatePriceValues(pricesList) { + + if (pricesList == null || pricesList == '') return; + var prices_list = pricesList.split("::"); + + var productsListElem = document.getElementById('proTab'); + if (productsListElem == null) return; + + var max_row_count = productsListElem.rows.length; + max_row_count = eval(max_row_count)-2;//Because the table has two header rows. so we will reduce two from row length + + var products_list = ""; + for(var i=1;i<=max_row_count;i++) + { + var list_price_elem = document.getElementById("listPrice"+i); + var unit_price = prices_list[i-1]; // Price values index starts from 0 + list_price_elem.value = unit_price; + + // Set Direct Discout amount to 0 + var discount_amount = document.getElementById("discount_amount"+i); + if(discount_amount != null) discount_amount.value = '0'; + + calcProductTotal(i); + setDiscount(list_price_elem,i); + callTaxCalc(i); + } + resetSHandAdjValues(); + calcTotal(); +} + +// Function to Reset the S&H Charges and Adjustment value with change in Currency +function resetSHandAdjValues() { + var sh_amount = document.getElementById('shipping_handling_charge'); + if (sh_amount != null) sh_amount.value = '0'; + + var sh_amount_tax = document.getElementById('shipping_handling_tax'); + if (sh_amount_tax != null) sh_amount_tax.innerHTML = '0'; + + var adjustment = document.getElementById('adjustment'); + if (adjustment != null) adjustment.value = '0'; + + var final_discount = document.getElementById('discount_amount_final'); + if (final_discount != null) final_discount.value = '0'; +} +// End + +/** Function for Product Re-Ordering Feature Code Addition Starts + * It will be responsible for moving record up/down, 1 step at a time + */ +function moveUpDown(sType,oModule,iIndex) +{ + var aFieldIds = Array('hidtax_row_no','productName','subproduct_ids','hdnProductId','comment','qty','listPrice','discount_type','discount_percentage','discount_amount','tax1_percentage','hidden_tax1_percentage','popup_tax_row','tax2_percentage','hidden_tax2_percentage','lineItemType'); + var aContentIds = Array('qtyInStock','netPrice','subprod_names'); + var aOnClickHandlerIds = Array('searchIcon'); + + iIndex = eval(iIndex) + 1; + var oTable = document.getElementById('proTab'); + iMax = oTable.rows.length; + iSwapIndex = 1; + if(sType == 'UP') + { + for(iCount=iIndex-2;iCount>=1;iCount--) + { + if(document.getElementById("row"+iCount)) + { + if(document.getElementById("row"+iCount).style.display != 'none' && document.getElementById('deleted'+iCount).value == 0) + { + iSwapIndex = iCount+1; + break; + } + } + } + } + else + { + for(iCount=iIndex;iCount<=iMax-2;iCount++) + { + if(document.getElementById("row"+iCount) && document.getElementById("row"+iCount).style.display != 'none' && document.getElementById('deleted'+iCount).value == 0) + { + iSwapIndex = iCount; + break; + } + } + iSwapIndex += 1; + } + + var oCurTr = oTable.rows[iIndex]; + var oSwapRow = oTable.rows[iSwapIndex]; + + iMaxCols = oCurTr.cells.length; + iIndex -= 1; + iSwapIndex -= 1; + + iCheckIndex = 0; + iSwapCheckIndex = 0; + for(j=0;j<=2;j++) + { + if(eval('document.getElementById(\'frmEditView\').discount'+iIndex+'['+j+']')) + { + sFormElement = eval('document.getElementById(\'frmEditView\').discount'+iIndex+'['+j+']'); + if(sFormElement.checked) + { + iCheckIndex = j; + break; + } + } + } + + for(j=0;j<=2;j++) + { + if(eval('document.getElementById(\'frmEditView\').discount'+iSwapIndex+'['+j+']')) + { + sFormElement = eval('document.getElementById(\'frmEditView\').discount'+iSwapIndex+'['+j+']'); + if(sFormElement.checked) + { + iSwapCheckIndex = j; + break; + } + } + } + if(eval('document.getElementById(\'frmEditView\').discount'+iIndex+'['+iSwapCheckIndex+']')) + { + oElement = eval('document.getElementById(\'frmEditView\').discount'+iIndex+'['+iSwapCheckIndex+']'); + oElement.checked = true; + } + if(eval('document.getElementById(\'frmEditView\').discount'+iSwapIndex+'['+iCheckIndex+']')) + { + oSwapElement = eval('document.getElementById(\'frmEditView\').discount'+iSwapIndex+'['+iCheckIndex+']'); + oSwapElement.checked = true; + } + + iMaxElement = aFieldIds.length; + for(iCt=0;iCt0) { + var row_id = window.opener.fnAddProductRow(mod,image_pth); + } else { + var row_id = prod_array['rowid']; + } + + if(mod!='PurchaseOrder') { + var qtyinstk = prod_array['qtyinstk']; + set_return_inventory(prod_id,prod_name,unit_price,qtyinstk,taxstring,parseInt(row_id),desc,subprod_ids); + } else { + set_return_inventory_po(prod_id,prod_name,unit_price,taxstring,parseInt(row_id),desc,subprod_ids); + } + y=y+1; + } + } + } + if (y != 0) { + document.selectall.idlist.value=idstring; + return true; + } else { + alert(alert_arr.SELECT); + return false; + } + } +} diff --git a/oss/vtiger/trunk/include/js/ListView.js b/oss/vtiger/trunk/include/js/ListView.js new file mode 100644 index 00000000..2d5431bd --- /dev/null +++ b/oss/vtiger/trunk/include/js/ListView.js @@ -0,0 +1,506 @@ +/********************************************************************************* + +** The contents of this file are subject to the vtiger CRM Public License Version 1.0 + * ("License"); You may not use this file except in compliance with the License + * The Original Code is: vtiger CRM Open Source + * The Initial Developer of the Original Code is vtiger. + * Portions created by vtiger are Copyright (C) vtiger. + * All Rights Reserved. + ********************************************************************************/ + +// MassEdit Feature +function massedit_togglediv(curTabId,total){ + + for(var i=0;i