添加到 trunk
+YUCHENG HU+ git-svn-id: https://svn.code.sf.net/p/hawebs/svn@354 a2543c7e-f6e9-4f8a-8bff-1ffc34733512
|
After Width: | Height: | Size: 162 B |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 879 B |
|
After Width: | Height: | Size: 326 B |
|
After Width: | Height: | Size: 204 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 946 B |
|
After Width: | Height: | Size: 862 B |
|
After Width: | Height: | Size: 828 B |
|
After Width: | Height: | Size: 564 B |
|
After Width: | Height: | Size: 287 B |
|
After Width: | Height: | Size: 98 B |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
// ===================================================================
|
||||
// Author: Matt Kruse <matt@mattkruse.com>
|
||||
// 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<document.anchors.length;i++){if(document.anchors[i].name==anchorname){found=1;break;}}if(found==0){coordinates.x=0;coordinates.y=0;return coordinates;}x=document.anchors[i].x;y=document.anchors[i].y;}else{coordinates.x=0;coordinates.y=0;return coordinates;}coordinates.x=x;coordinates.y=y;return coordinates;}
|
||||
function getAnchorWindowPosition(anchorname){var coordinates=getAnchorPosition(anchorname);var x=0;var y=0;if(document.getElementById){if(isNaN(window.screenX)){x=coordinates.x-document.body.scrollLeft+window.screenLeft;y=coordinates.y-document.body.scrollTop+window.screenTop;}else{x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;}}else if(document.all){x=coordinates.x-document.body.scrollLeft+window.screenLeft;y=coordinates.y-document.body.scrollTop+window.screenTop;}else if(document.layers){x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;}coordinates.x=x;coordinates.y=y;return coordinates;}
|
||||
function AnchorPosition_getPageOffsetLeft(el){var ol=el.offsetLeft;while((el=el.offsetParent) != null){ol += el.offsetLeft;}return ol;}
|
||||
function AnchorPosition_getWindowOffsetLeft(el){return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;}
|
||||
function AnchorPosition_getPageOffsetTop(el){var ot=el.offsetTop;while((el=el.offsetParent) != null){ot += el.offsetTop;}return ot;}
|
||||
function AnchorPosition_getWindowOffsetTop(el){return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;}
|
||||
|
||||
/* SOURCE FILE: PopupWindow.js */
|
||||
function PopupWindow_getXYPosition(anchorname){var coordinates;if(this.type == "WINDOW"){coordinates = getAnchorWindowPosition(anchorname);}else{coordinates = getAnchorPosition(anchorname);}this.x = coordinates.x;this.y = coordinates.y;}
|
||||
function PopupWindow_setSize(width,height){this.width = width;this.height = height;}
|
||||
function PopupWindow_populate(contents){this.contents = contents;this.populated = false;}
|
||||
function PopupWindow_setUrl(url){this.url = url;}
|
||||
function PopupWindow_setWindowProperties(props){this.windowProperties = props;}
|
||||
function PopupWindow_refresh(){if(this.divName != null){if(this.use_gebi){document.getElementById(this.divName).innerHTML = this.contents;}else if(this.use_css){document.all[this.divName].innerHTML = this.contents;}else if(this.use_layers){var d = document.layers[this.divName];d.document.open();d.document.writeln(this.contents);d.document.close();}}else{if(this.popupWindow != null && !this.popupWindow.closed){if(this.url!=""){this.popupWindow.location.href=this.url;}else{this.popupWindow.document.open();this.popupWindow.document.writeln(this.contents);this.popupWindow.document.close();}this.popupWindow.focus();}}}
|
||||
function PopupWindow_showPopup(anchorname){this.getXYPosition(anchorname);this.x += this.offsetX;this.y += this.offsetY;if(!this.populated &&(this.contents != "")){this.populated = true;this.refresh();}if(this.divName != null){if(this.use_gebi){document.getElementById(this.divName).style.left = this.x + "px";document.getElementById(this.divName).style.top = this.y;document.getElementById(this.divName).style.visibility = "visible";}else if(this.use_css){document.all[this.divName].style.left = this.x;document.all[this.divName].style.top = this.y;document.all[this.divName].style.visibility = "visible";}else if(this.use_layers){document.layers[this.divName].left = this.x;document.layers[this.divName].top = this.y;document.layers[this.divName].visibility = "visible";}}else{if(this.popupWindow == null || this.popupWindow.closed){if(this.x<0){this.x=0;}if(this.y<0){this.y=0;}if(screen && screen.availHeight){if((this.y + this.height) > 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;i<popupWindowObjects.length;i++){if(popupWindowObjects[i] != null){var p = popupWindowObjects[i];p.hideIfNotClicked(e);}}}
|
||||
function PopupWindow_attachListener(){if(document.layers){document.captureEvents(Event.MOUSEUP);}window.popupWindowOldEventListener = document.onmouseup;if(window.popupWindowOldEventListener != null){document.onmouseup = new Function("window.popupWindowOldEventListener();PopupWindow_hidePopupWindows();");}else{document.onmouseup = PopupWindow_hidePopupWindows;}}
|
||||
function PopupWindow(){if(!window.popupWindowIndex){window.popupWindowIndex = 0;}if(!window.popupWindowObjects){window.popupWindowObjects = new Array();}if(!window.listenerAttached){window.listenerAttached = true;PopupWindow_attachListener();}this.index = popupWindowIndex++;popupWindowObjects[this.index] = this;this.divName = null;this.popupWindow = null;this.width=0;this.height=0;this.populated = false;this.visible = false;this.autoHideEnabled = false;this.contents = "";this.url="";this.windowProperties="toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable,alwaysRaised,dependent,titlebar=no";if(arguments.length>0){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("<DIV ID=\"colorPickerDiv\" STYLE=\"position:absolute;visibility:hidden;\"> </DIV>");}
|
||||
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 += "<HTML><HEAD><TITLE>Select Color</TITLE></HEAD>";cp_contents += "<BODY MARGINWIDTH=0 MARGINHEIGHT=0 LEFTMARGIN=0 TOPMARGIN=0><CENTER>";}cp_contents += "<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=0>";var use_highlight =(document.getElementById || document.all)?true:false;for(var i=0;i<total;i++){if((i % width) == 0){cp_contents += "<TR>";}if(use_highlight){var mo = 'onMouseOver="'+windowRef+'ColorPicker_highlightColor(\''+colors[i]+'\',window.document)"';}else{mo = "";}cp_contents += '<TD BGCOLOR="'+colors[i]+'"><FONT SIZE="-3"><A HREF="#" onClick="'+windowRef+'ColorPicker_pickColor(\''+colors[i]+'\','+windowRef+'window.popupWindowObjects['+cp.index+']);return false;" '+mo+' STYLE="text-decoration:none;"> </A></FONT></TD>';if( ((i+1)>=total) ||(((i+1) % width) == 0)){cp_contents += "</TR>";}}if(document.getElementById){var width1 = Math.floor(width/2);var width2 = width = width1;cp_contents += "<TR><TD COLSPAN='"+width1+"' BGCOLOR='#ffffff' ID='colorPickerSelectedColor'> </TD><TD COLSPAN='"+width2+"' ALIGN='CENTER' ID='colorPickerSelectedColorValue'>#FFFFFF</TD></TR>";}cp_contents += "</TABLE>";if(windowMode){cp_contents += "</CENTER></BODY></HTML>";}cp.populate(cp_contents+"\n");cp.offsetY = 25;cp.autoHide();return cp;}
|
||||
|
||||
@@ -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<total;i++){
|
||||
tagName = $('massedit_div'+i);
|
||||
tagName1 = $('tab'+i)
|
||||
tagName.style.display = 'none';
|
||||
tagName1.className = 'dvtUnSelectedCell';
|
||||
}
|
||||
|
||||
tagName = $('massedit_div'+curTabId);
|
||||
tagName.style.display = 'block';
|
||||
tagName1 = $('tab'+curTabId)
|
||||
tagName1.className = 'dvtSelectedCell';
|
||||
}
|
||||
|
||||
function massedit_initOnChangeHandlers() {
|
||||
var form = document.getElementById('massedit_form');
|
||||
// Setup change handlers for input boxes
|
||||
var inputs = form.getElementsByTagName('input');
|
||||
for(var index = 0; index < inputs.length; ++index) {
|
||||
var massedit_input = inputs[index];
|
||||
// TODO Onchange on readonly and hidden fields are to be handled later.
|
||||
massedit_input.onchange = function() {
|
||||
var checkbox = document.getElementById(this.name + '_mass_edit_check');
|
||||
if(checkbox) checkbox.checked = true;
|
||||
}
|
||||
}
|
||||
// Setup change handlers for select boxes
|
||||
var selects = form.getElementsByTagName('select');
|
||||
for(var index = 0; index < selects.length; ++index) {
|
||||
var massedit_select = selects[index];
|
||||
massedit_select.onchange = function() {
|
||||
var checkbox = document.getElementById(this.name + '_mass_edit_check');
|
||||
if(checkbox) checkbox.checked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function mass_edit(obj,divid,module,parenttab) {
|
||||
var select_options = document.getElementById('allselectedboxes').value;
|
||||
var x = select_options.split(';');
|
||||
var count = x.length;
|
||||
|
||||
if(count > 1) {
|
||||
idstring=select_options;
|
||||
mass_edit_formload(idstring,module,parenttab);
|
||||
} else {
|
||||
alert(alert_arr.SELECT);
|
||||
return false;
|
||||
}
|
||||
fnvshobj(obj, divid);
|
||||
}
|
||||
function mass_edit_formload(idstring,module,parenttab) {
|
||||
if(typeof(parenttab) == 'undefined') parenttab = '';
|
||||
$("status").style.display="inline";
|
||||
new Ajax.Request(
|
||||
'index.php',
|
||||
{queue: {position: 'end', scope: 'command'},
|
||||
method: 'post',
|
||||
postBody:"module="+encodeURIComponent(module)+"&action="+encodeURIComponent(module+'Ajax')+"&parenttab="+encodeURIComponent(parenttab)+"&file=MassEdit&mode=ajax&idstring="+idstring,
|
||||
onComplete: function(response) {
|
||||
$("status").style.display="none";
|
||||
var result = response.responseText;
|
||||
$("massedit_form_div").innerHTML= result;
|
||||
$("massedit_form")["massedit_recordids"].value = idstring;
|
||||
$("massedit_form")["massedit_module"].value = module;
|
||||
|
||||
var jscripts = $('massedit_javascript');
|
||||
if(jscripts) {
|
||||
eval(jscripts.innerHTML);
|
||||
// Updating global variables
|
||||
fieldname = mass_fieldname;
|
||||
for(var i=0;i<fieldname.length;i++){
|
||||
calendar_jscript = $('massedit_calendar_'+fieldname[i]);
|
||||
if(calendar_jscript){
|
||||
eval(calendar_jscript.innerHTML);
|
||||
}
|
||||
}
|
||||
fieldlabel = mass_fieldlabel;
|
||||
fielddatatype = mass_fielddatatype;
|
||||
count = mass_count;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
function mass_edit_fieldchange(selectBox) {
|
||||
var oldSelectedIndex = selectBox.oldSelectedIndex;
|
||||
var selectedIndex = selectBox.selectedIndex;
|
||||
|
||||
if($('massedit_field'+oldSelectedIndex)) $('massedit_field'+oldSelectedIndex).style.display='none';
|
||||
if($('massedit_field'+selectedIndex)) $('massedit_field'+selectedIndex).style.display='block';
|
||||
|
||||
selectBox.oldSelectedIndex = selectedIndex;
|
||||
}
|
||||
|
||||
function mass_edit_save(){
|
||||
var masseditform = $("massedit_form");
|
||||
var module = masseditform["massedit_module"].value;
|
||||
var viewid = document.getElementById("viewname").options[document.getElementById("viewname").options.selectedIndex].value;
|
||||
var searchurl = document.getElementById("search_url").value;
|
||||
|
||||
var urlstring =
|
||||
"module="+encodeURIComponent(module)+"&action="+encodeURIComponent(module+'Ajax')+
|
||||
"&return_module="+encodeURIComponent(module)+"&return_action=ListView"+
|
||||
"&mode=ajax&file=MassEditSave&viewname=" + viewid ;//+"&"+ searchurl;
|
||||
|
||||
fninvsh("massedit");
|
||||
|
||||
new Ajax.Request(
|
||||
"index.php",
|
||||
{queue:{position:"end", scope:"command"},
|
||||
method:"post",
|
||||
postBody:urlstring,
|
||||
onComplete:function (response) {
|
||||
$("status").style.display = "none";
|
||||
var result = response.responseText.split("&#&#&#");
|
||||
$("ListViewContents").innerHTML = result[2];
|
||||
if (result[1] != "") {
|
||||
alert(result[1]);
|
||||
}
|
||||
$("basicsearchcolumns").innerHTML = "";
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
function ajax_mass_edit() {
|
||||
alert();
|
||||
$("status").style.display = "inline";
|
||||
|
||||
var masseditform = $("massedit_form");
|
||||
var module = masseditform["massedit_module"].value;
|
||||
|
||||
var viewid = document.getElementById("viewname").options[document.getElementById("viewname").options.selectedIndex].value;
|
||||
var idstring = masseditform["massedit_recordids"].value;
|
||||
var searchurl = document.getElementById("search_url").value;
|
||||
var tplstart = "&";
|
||||
if (gstart != "") { tplstart = tplstart + gstart; }
|
||||
|
||||
var masseditfield = masseditform['massedit_field'].value;
|
||||
var masseditvalue = masseditform['massedit_value_'+masseditfield].value;
|
||||
|
||||
var urlstring =
|
||||
"module="+encodeURIComponent(module)+"&action="+encodeURIComponent(module+'Ajax')+
|
||||
"&return_module="+encodeURIComponent(module)+
|
||||
"&mode=ajax&file=MassEditSave&viewname=" + viewid +
|
||||
"&massedit_field=" + encodeURIComponent(masseditfield) +
|
||||
"&massedit_value=" + encodeURIComponent(masseditvalue) +
|
||||
"&idlist=" + idstring + searchurl;
|
||||
|
||||
fninvsh("massedit");
|
||||
|
||||
new Ajax.Request(
|
||||
"index.php",
|
||||
{queue:{position:"end", scope:"command"},
|
||||
method:"post",
|
||||
postBody:urlstring,
|
||||
onComplete:function (response) {
|
||||
$("status").style.display = "none";
|
||||
var result = response.responseText.split("&#&#&#");
|
||||
$("ListViewContents").innerHTML = result[2];
|
||||
if (result[1] != "") {
|
||||
alert(result[1]);
|
||||
}
|
||||
$("basicsearchcolumns").innerHTML = "";
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// END
|
||||
|
||||
function change(obj,divid)
|
||||
{
|
||||
var select_options = document.getElementById('allselectedboxes').value;
|
||||
//Added to remove the semi colen ';' at the end of the string.done to avoid error.
|
||||
var x = select_options.split(";");
|
||||
var count=x.length;
|
||||
var viewid =getviewId();
|
||||
idstring = "";
|
||||
|
||||
if (count > 1)
|
||||
{
|
||||
idstring=select_options;
|
||||
document.getElementById('idlist').value=idstring;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(alert_arr.SELECT);
|
||||
return false;
|
||||
}
|
||||
fnvshobj(obj,divid);
|
||||
}
|
||||
function getviewId()
|
||||
{
|
||||
if(typeof(document.getElementById("viewname")) != 'undefined')
|
||||
{
|
||||
var oViewname = document.getElementById("viewname");
|
||||
var viewid = oViewname.options[oViewname.selectedIndex].value;
|
||||
}
|
||||
else
|
||||
{
|
||||
var viewid ='';
|
||||
}
|
||||
return viewid;
|
||||
}
|
||||
var gstart='';
|
||||
function massDelete(module)
|
||||
{
|
||||
var select_options = document.getElementById('allselectedboxes').value;
|
||||
var x = select_options.split(";");
|
||||
var searchurl= document.getElementById('search_url').value;
|
||||
var count=x.length
|
||||
var viewid =getviewId();
|
||||
var idstring = "";
|
||||
|
||||
if (count > 1)
|
||||
{
|
||||
//document.getElementById('idlist').value=idstring;
|
||||
document.getElementById('idlist').value=select_options;
|
||||
idstring = select_options;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(alert_arr.SELECT);
|
||||
return false;
|
||||
}
|
||||
//we have to decrese the count value by 1 because when we split with semicolon we will get one extra count
|
||||
count = count - 1;
|
||||
|
||||
var alert_str = alert_arr.DELETE + count +alert_arr.RECORDS;
|
||||
|
||||
if(module=="Accounts")
|
||||
alert_str = alert_arr.DELETE_ACCOUNT +count+alert_arr.RECORDS;
|
||||
else if(module=="Vendors")
|
||||
alert_str = alert_arr.DELETE_VENDOR+count+alert_arr.RECORDS;
|
||||
|
||||
if(confirm(alert_str))
|
||||
{
|
||||
$("status").style.display="inline";
|
||||
new Ajax.Request(
|
||||
'index.php',
|
||||
{queue: {position: 'end', scope: 'command'},
|
||||
method: 'post',
|
||||
postBody:"module=Users&action=massdelete&return_module="+module+"&"+gstart+"&viewname="+viewid+"&idlist="+idstring+searchurl,
|
||||
onComplete: function(response) {
|
||||
$("status").style.display="none";
|
||||
result = response.responseText.split('&#&#&#');
|
||||
$("ListViewContents").innerHTML= result[2];
|
||||
if(result[1] != '')
|
||||
alert(result[1]);
|
||||
$('basicsearchcolumns').innerHTML = '';
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function showDefaultCustomView(selectView,module,parenttab)
|
||||
{
|
||||
$("status").style.display="inline";
|
||||
var viewName = encodeURIComponent(selectView.options[selectView.options.selectedIndex].value);
|
||||
new Ajax.Request(
|
||||
'index.php',
|
||||
{queue: {position: 'end', scope: 'command'},
|
||||
method: 'post',
|
||||
postBody:"module="+module+"&action="+module+"Ajax&file=ListView&ajax=true&start=1&viewname="+viewName+"&parenttab="+parenttab,
|
||||
onComplete: function(response) {
|
||||
$("status").style.display="none";
|
||||
result = response.responseText.split('&#&#&#');
|
||||
$("ListViewContents").innerHTML= result[2];
|
||||
if(result[1] != '')
|
||||
alert(result[1]);
|
||||
$('basicsearchcolumns_real').innerHTML = $('basicsearchcolumns').innerHTML
|
||||
$('basicsearchcolumns').innerHTML = '';
|
||||
document.basicSearch.search_text.value = '';
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
function getListViewEntries_js(module,url)
|
||||
{
|
||||
var select_options = document.getElementsByName('selected_id');
|
||||
var x = select_options.length;
|
||||
var viewid =getviewId();
|
||||
idstring = "";
|
||||
|
||||
xx = 0;
|
||||
for(i = 0; i < x ; i++)
|
||||
{
|
||||
if(select_options[i].checked)
|
||||
{
|
||||
idstring = select_options[i].value +";"+idstring
|
||||
xx++
|
||||
}
|
||||
}
|
||||
var all_selected=document.getElementById('allselectedboxes').value;
|
||||
|
||||
$("status").style.display="inline";
|
||||
if($('search_url').value!='')
|
||||
urlstring = $('search_url').value;
|
||||
else
|
||||
urlstring = '';
|
||||
|
||||
gstart = url;
|
||||
new Ajax.Request(
|
||||
'index.php',
|
||||
{queue: {position: 'end', scope: 'command'},
|
||||
method: 'post',
|
||||
postBody:"module="+module+"&action="+module+"Ajax&file=ListView&ajax=true&allselobjs="+all_selected+"&selobjs="+idstring+"&"+url+urlstring,
|
||||
onComplete: function(response) {
|
||||
$("status").style.display="none";
|
||||
result = response.responseText.split('&#&#&#');
|
||||
$("ListViewContents").innerHTML= result[2];
|
||||
update_selected_checkbox();
|
||||
if(result[1] != '')
|
||||
alert(result[1]);
|
||||
$('basicsearchcolumns').innerHTML = '';
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
//for multiselect check box in list view:
|
||||
|
||||
function check_object(sel_id,groupParentElementId)
|
||||
{
|
||||
var select_global=new Array();
|
||||
var selected=trim(document.getElementById("allselectedboxes").value);
|
||||
select_global=selected.split(";");
|
||||
var box_value=sel_id.checked;
|
||||
var id= sel_id.value;
|
||||
var duplicate=select_global.indexOf(id);
|
||||
var size=select_global.length-1;
|
||||
var result="";
|
||||
//alert("size: "+size);
|
||||
//alert("Box_value: "+box_value);
|
||||
//alert("Duplicate: "+duplicate);
|
||||
if(box_value == true)
|
||||
{
|
||||
if(duplicate == "-1")
|
||||
{
|
||||
select_global[size]=id;
|
||||
}
|
||||
|
||||
size=select_global.length-1;
|
||||
var i=0;
|
||||
for(i=0;i<=size;i++)
|
||||
{
|
||||
if(trim(select_global[i])!='')
|
||||
result=select_global[i]+";"+result;
|
||||
}
|
||||
default_togglestate(sel_id.name,groupParentElementId);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(duplicate != "-1")
|
||||
select_global.splice(duplicate,1)
|
||||
|
||||
size=select_global.length-1;
|
||||
var i=0;
|
||||
for(i=size;i>=0;i--)
|
||||
{
|
||||
if(trim(select_global[i])!='')
|
||||
result=select_global[i]+";"+result;
|
||||
}
|
||||
// getObj("selectall").checked=false
|
||||
default_togglestate(sel_id.name,groupParentElementId);
|
||||
}
|
||||
|
||||
document.getElementById("allselectedboxes").value=result;
|
||||
//alert("Result: "+result);
|
||||
}
|
||||
|
||||
function update_selected_checkbox()
|
||||
{
|
||||
var all=document.getElementById('current_page_boxes').value;
|
||||
var tocheck=document.getElementById('allselectedboxes').value;
|
||||
var allsplit=new Array();
|
||||
allsplit=all.split(";");
|
||||
|
||||
var selsplit=new Array();
|
||||
selsplit=tocheck.split(";");
|
||||
|
||||
var n=selsplit.length;
|
||||
for(var i=0;i<n;i++)
|
||||
{
|
||||
if(allsplit.indexOf(selsplit[i]) != "-1")
|
||||
document.getElementById(selsplit[i]).checked='true';
|
||||
}
|
||||
}
|
||||
|
||||
//Function to Set the status as Approve/Deny for Public access by Admin
|
||||
function ChangeCustomViewStatus(viewid,now_status,changed_status,module,parenttab)
|
||||
{
|
||||
$('status').style.display = 'block';
|
||||
new Ajax.Request(
|
||||
'index.php',
|
||||
{queue: {position: 'end', scope: 'command'},
|
||||
method: 'post',
|
||||
postBody:'module=CustomView&action=CustomViewAjax&file=ChangeStatus&dmodule='+module+'&record='+viewid+'&status='+changed_status,
|
||||
onComplete: function(response)
|
||||
{
|
||||
var responseVal=response.responseText;
|
||||
if(responseVal.indexOf(':#:FAILURE') > -1) {
|
||||
alert('Failed');
|
||||
} else if(responseVal.indexOf(':#:SUCCESS') > -1) {
|
||||
var values = responseVal.split(':#:');
|
||||
var module_name = values[2];
|
||||
var customview_ele = $('viewname');
|
||||
showDefaultCustomView(customview_ele, module_name, parenttab);
|
||||
} else {
|
||||
$('ListViewContents').innerHTML = responseVal;
|
||||
}
|
||||
$('status').style.display = 'none';
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function getListViewCount(module,element,parentElement,url){
|
||||
if(module != 'Documents'){
|
||||
var elementList = document.getElementsByName(module+'_listViewCountRefreshIcon');
|
||||
for(var i=0;i<elementList.length;++i){
|
||||
elementList[i].style.display = 'none';
|
||||
}
|
||||
}else{
|
||||
element.style.display = 'none';
|
||||
}
|
||||
var elementList = document.getElementsByName(module+'_listViewCountContainerBusy');
|
||||
for(var i=0;i<elementList.length;++i){
|
||||
elementList[i].style.display = '';
|
||||
}
|
||||
var element = document.getElementsByName('search_url')[0];
|
||||
var searchURL = '';
|
||||
if(typeof element !='undefined'){
|
||||
searchURL = element.value;
|
||||
}else if(typeof document.getElementsByName('search_text')[0] != 'undefined'){
|
||||
element = document.getElementsByName('search_text')[0];
|
||||
var searchField = document.getElementsByName('search_field')[0];
|
||||
if(element.value.length > 0) {
|
||||
searchURL = '&query=true&searchtype=BasicSearch&search_field='+
|
||||
encodeURIComponent(searchField.value)+'&search_text='+encodeURIComponent(element.value);
|
||||
}
|
||||
}else if(typeof document.getElementById('globalSearchText') != 'undefined'){
|
||||
var searchText = document.getElementById('globalSearchText').value;
|
||||
searchURL = '&query=true&globalSearch=true&globalSearchText='+encodeURIComponent(searchText);
|
||||
}
|
||||
if(module != 'Documents'){
|
||||
searchURL += (url);
|
||||
}
|
||||
// Url parameters to carry forward the Alphabetical search in Popups,
|
||||
// which is stored in the global variable gPopupAlphaSearchUrl
|
||||
if(typeof gPopupAlphaSearchUrl != 'undefined' && gPopupAlphaSearchUrl != '')
|
||||
searchURL += gPopupAlphaSearchUrl;
|
||||
|
||||
new Ajax.Request(
|
||||
'index.php',
|
||||
{queue: {position: 'end', scope: 'command'},
|
||||
method: 'post',
|
||||
postBody:"module="+module+"&action="+module+"Ajax&file=ListViewPagging&ajax=true"+searchURL,
|
||||
onComplete: function(response) {
|
||||
var elementList = document.getElementsByName(module+'_listViewCountContainerBusy');
|
||||
for(var i=0;i<elementList.length;++i){
|
||||
elementList[i].style.display = 'none';
|
||||
}
|
||||
elementList = document.getElementsByName(module+'_listViewCountRefreshIcon');
|
||||
if(module != 'Documents' && typeof parentElement != 'undefined' && elementList.length !=0){
|
||||
for(i=0;i<=elementList.length;){
|
||||
//No need to increment the count, as the element will be eliminated in the next step.
|
||||
elementList[i].parentNode.innerHTML = response.responseText;
|
||||
}
|
||||
}else{
|
||||
parentElement.innerHTML = response.responseText;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function VT_disableFormSubmit(evt) {
|
||||
var evt = (evt) ? evt : ((event) ? event : null);
|
||||
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
|
||||
if ((evt.keyCode == 13) && (node.type=='text')) {
|
||||
node.onchange();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
/*********************************************************************************
|
||||
|
||||
** 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.
|
||||
********************************************************************************/
|
||||
//added by raju for emails
|
||||
|
||||
function eMail(module,oButton)
|
||||
{
|
||||
var select_options = document.getElementById('allselectedboxes').value;
|
||||
//Added to remove the semi colen ';' at the end of the string.done to avoid error.
|
||||
var x = select_options.split(";");
|
||||
var count=x.length
|
||||
var viewid =getviewId();
|
||||
var idstring = "";
|
||||
select_options=select_options.slice(0,(select_options.length-1));
|
||||
|
||||
if (count > 1)
|
||||
{
|
||||
idstring=select_options.replace(/;/g,':')
|
||||
document.getElementById('idlist').value=idstring;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(alert_arr.SELECT);
|
||||
return false;
|
||||
}
|
||||
allids = document.getElementById('idlist').value;
|
||||
fnvshobj(oButton,'sendmail_cont');
|
||||
sendmail(module,allids);
|
||||
}
|
||||
|
||||
|
||||
function massMail(module)
|
||||
{
|
||||
|
||||
var select_options = document.getElementsByName('selected_id');
|
||||
x = select_options.length;
|
||||
var viewid =getviewId();
|
||||
idstring = "";
|
||||
|
||||
xx = 0;
|
||||
for(i = 0; i < x ; i++)
|
||||
{
|
||||
if(select_options[i].checked)
|
||||
{
|
||||
idstring = select_options[i].value +";"+idstring
|
||||
xx++
|
||||
}
|
||||
}
|
||||
if (xx != 0)
|
||||
{
|
||||
document.getElementById('idlist').value=idstring;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(alert_arr.SELECT);
|
||||
return false;
|
||||
}
|
||||
document.massdelete.action="index.php?module=CustomView&action=SendMailAction&return_module="+module+"&return_action=index&viewname="+viewid;
|
||||
}
|
||||
|
||||
//added by rdhital for better emails
|
||||
function set_return_emails(entity_id,email_id,parentname,emailadd,emailadd2,perm){
|
||||
if(perm == 0 || perm == 3)
|
||||
{
|
||||
if(emailadd2 == '')
|
||||
{
|
||||
alert(alert_arr.LBL_DONT_HAVE_EMAIL_PERMISSION);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
emailadd = emailadd2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(emailadd == '')
|
||||
emailadd = emailadd2;
|
||||
}
|
||||
if(emailadd != '')
|
||||
{
|
||||
window.opener.document.EditView.parent_id.value = window.opener.document.EditView.parent_id.value+entity_id+'@'+email_id+'|';
|
||||
window.opener.document.EditView.parent_name.value = window.opener.document.EditView.parent_name.value+parentname+'<'+emailadd+'>,';
|
||||
window.opener.document.EditView.hidden_toid.value = emailadd+','+window.opener.document.EditView.hidden_toid.value;
|
||||
window.close();
|
||||
}else
|
||||
{
|
||||
alert('"'+parentname+alert_arr.DOESNOT_HAVE_AN_MAILID);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//added by raju for emails
|
||||
|
||||
function validate_sendmail(idlist,module)
|
||||
{
|
||||
var j=0;
|
||||
var chk_emails = document.SendMail.elements.length;
|
||||
var oFsendmail = document.SendMail.elements
|
||||
email_type = new Array();
|
||||
for(var i=0 ;i < chk_emails ;i++)
|
||||
{
|
||||
if(oFsendmail[i].type != 'button')
|
||||
{
|
||||
if(oFsendmail[i].checked != false)
|
||||
{
|
||||
email_type [j++]= oFsendmail[i].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(email_type != '')
|
||||
{
|
||||
var field_lists = email_type.join(':');
|
||||
var url= 'index.php?module=Emails&action=EmailsAjax&pmodule='+module+'&file=EditView&sendmail=true&idlist='+idlist+'&field_lists='+field_lists;
|
||||
openPopUp('xComposeEmail',this,url,'createemailWin',820,689,'menubar=no,toolbar=no,location=no,status=no,resizable=no');
|
||||
fninvsh('roleLay');
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(alert_arr.SELECT_MAILID);
|
||||
}
|
||||
}
|
||||
function sendmail(module,idstrings)
|
||||
{
|
||||
new Ajax.Request(
|
||||
'index.php',
|
||||
{queue: {position: 'end', scope: 'command'},
|
||||
method: 'post',
|
||||
postBody: "module=Emails&return_module="+module+"&action=EmailsAjax&file=mailSelect&idlist="+idstrings,
|
||||
onComplete: function(response) {
|
||||
if(response.responseText == "Mail Ids not permitted" || response.responseText == "No Mail Ids")
|
||||
{
|
||||
var url= 'index.php?module=Emails&action=EmailsAjax&pmodule='+module+'&file=EditView&sendmail=true';
|
||||
openPopUp('xComposeEmail',this,url,'createemailWin',820,689,'menubar=no,toolbar=no,location=no,status=no,resizable=no');
|
||||
}
|
||||
else
|
||||
getObj('sendmail_cont').innerHTML=response.responseText;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function rel_eMail(module,oButton,relmod)
|
||||
{
|
||||
var select_options='';
|
||||
var allids='';
|
||||
var cookie_val=get_cookie(relmod+"_all");
|
||||
if(cookie_val != null)
|
||||
select_options=cookie_val;
|
||||
//Added to remove the semi colen ';' at the end of the string.done to avoid error.
|
||||
var x = select_options.split(";");
|
||||
var viewid ='';
|
||||
var count=x.length
|
||||
var idstring = "";
|
||||
select_options=select_options.slice(0,(select_options.length-1));
|
||||
|
||||
if (count > 1)
|
||||
{
|
||||
idstring=select_options.replace(/;/g,':')
|
||||
allids=idstring;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(alert_arr.SELECT);
|
||||
return false;
|
||||
}
|
||||
fnvshobj(oButton,'sendmail_cont');
|
||||
sendmail(relmod,allids);
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
/*********************************************************************************
|
||||
|
||||
** 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.
|
||||
********************************************************************************/
|
||||
|
||||
//to merge a list of acounts with a template
|
||||
function massMerge(module)
|
||||
{
|
||||
var select_options = document.getElementsByName('selected_id');
|
||||
var x = select_options.length;
|
||||
var viewid =getviewId();
|
||||
idstring = "";
|
||||
|
||||
if(getObj('mergefile').value == '')
|
||||
{
|
||||
alert(alert_arr.SELECT_TEMPLATE_TO_MERGE);
|
||||
return false;
|
||||
}
|
||||
xx = 0;
|
||||
for(i = 0; i < x ; i++)
|
||||
{
|
||||
if(select_options[i].checked)
|
||||
{
|
||||
idstring = select_options[i].value +";"+idstring
|
||||
xx++
|
||||
}
|
||||
}
|
||||
if (xx != 0)
|
||||
{
|
||||
document.getElementById('idlist').value=idstring;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(alert_arr.SELECT);
|
||||
return false;
|
||||
}
|
||||
|
||||
document.massdelete.action.value = 'Merge';
|
||||
document.getElementById('massdelete').action="index.php?module="+module+"&action=Merge&return_module="+module+"&return_action=index";
|
||||
}
|
||||
|
||||
function mergeshowhide(argg)
|
||||
{
|
||||
var x=document.getElementById(argg).style
|
||||
if (x.display=="none")
|
||||
{
|
||||
x.display="block"
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
x.display="none"
|
||||
}
|
||||
}
|
||||
|
||||
function mergehide(argg)
|
||||
{
|
||||
var x=document.getElementById(argg);
|
||||
if (x != null) x.style.display = "none";
|
||||
}
|
||||
|
||||
function moveMe(arg1) {
|
||||
var posx = 0;
|
||||
var posy = 0;
|
||||
var e=document.getElementById(arg1);
|
||||
|
||||
if (!e) var e = window.event;
|
||||
|
||||
if (e.pageX || e.pageY)
|
||||
{
|
||||
posx = e.pageX;
|
||||
posy = e.pageY;
|
||||
}
|
||||
else if (e.clientX || e.clientY)
|
||||
{
|
||||
posx = e.clientX + document.body.scrollLeft;
|
||||
posy = e.clientY + document.body.scrollTop;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,305 @@
|
||||
/*********************************************************************************
|
||||
|
||||
** 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 qcemptyCheck(fldName,fldLabel, fldType) {
|
||||
var currObj=window.document.QcEditView[fldName]
|
||||
if (fldType=="text") {
|
||||
if (currObj.value.replace(/^\s+/g, '').replace(/\s+$/g, '').length==0) {
|
||||
alert(fldLabel+alert_arr.CANNOT_BE_EMPTY);
|
||||
currObj.focus();
|
||||
return false;
|
||||
} else{
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (trim(currObj.value) == "" ) {
|
||||
alert(fldLabel+alert_arr.CANNOT_BE_NONE);
|
||||
return false;
|
||||
} else
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function qcpatternValidate(fldName,fldLabel,type) {
|
||||
var currObj=window.document.QcEditView[fldName];
|
||||
if (type.toUpperCase()=="EMAIL") //Email ID validation
|
||||
{
|
||||
/*changes made to fix -- ticket#3278 & ticket#3461
|
||||
var re=new RegExp(/^.+@.+\..+$/)*/
|
||||
//Changes made to fix tickets #4633, #5111 to accomodate all possible email formats
|
||||
var re=new RegExp(/^[a-zA-Z0-9]+([\_\-\.]*[a-zA-Z0-9]+[\_\-]?)*@[a-zA-Z0-9]+([\_\-]?[a-zA-Z0-9]+)*\.+([\_\-]?[a-zA-Z0-9])+(\.?[a-zA-Z0-9]+)*$/)
|
||||
}
|
||||
|
||||
if (type.toUpperCase()=="DATE") {//DATE validation
|
||||
//YMD
|
||||
//var reg1 = /^\d{2}(\-|\/|\.)\d{1,2}\1\d{1,2}$/ //2 digit year
|
||||
//var re = /^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$/ //4 digit year
|
||||
|
||||
//MYD
|
||||
//var reg1 = /^\d{1,2}(\-|\/|\.)\d{2}\1\d{1,2}$/
|
||||
//var reg2 = /^\d{1,2}(\-|\/|\.)\d{4}\1\d{1,2}$/
|
||||
|
||||
//DMY
|
||||
//var reg1 = /^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{2}$/
|
||||
//var reg2 = /^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/
|
||||
|
||||
switch (userDateFormat) {
|
||||
case "yyyy-mm-dd" :
|
||||
var re = /^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$/
|
||||
break;
|
||||
case "mm-dd-yyyy" :
|
||||
case "dd-mm-yyyy" :
|
||||
var re = /^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/
|
||||
}
|
||||
}
|
||||
|
||||
if (type.toUpperCase()=="TIME") {//TIME validation
|
||||
var re = /^\d{1,2}\:\d{1,2}$/
|
||||
}
|
||||
|
||||
//Asha: Remove spaces on either side of a Email id before validating
|
||||
if (type.toUpperCase()=="EMAIL") currObj.value = trim(currObj.value);
|
||||
if (!re.test(currObj.value)) {
|
||||
alert(alert_arr.ENTER_VALID+fldLabel)
|
||||
currObj.focus()
|
||||
return false
|
||||
}
|
||||
else return true
|
||||
}
|
||||
function qcdateValidate(fldName,fldLabel,type) {
|
||||
if(qcpatternValidate(fldName,fldLabel,"DATE")==false)
|
||||
return false;
|
||||
dateval=window.document.QcEditView[fldName].value.replace(/^\s+/g, '').replace(/\s+$/g, '')
|
||||
|
||||
var dateelements=splitDateVal(dateval)
|
||||
|
||||
dd=dateelements[0]
|
||||
mm=dateelements[1]
|
||||
yyyy=dateelements[2]
|
||||
|
||||
if (dd<1 || dd>31 || mm<1 || mm>12 || yyyy<1 || yyyy<1000) {
|
||||
alert(alert_arr.ENTER_VALID+fldLabel)
|
||||
window.document.QcEditView[fldName].focus()
|
||||
return false
|
||||
}
|
||||
|
||||
if ((mm==2) && (dd>29)) {//checking of no. of days in february month
|
||||
alert(alert_arr.ENTER_VALID+fldLabel)
|
||||
window.document.QcEditView[fldName].focus()
|
||||
return false
|
||||
}
|
||||
|
||||
if ((mm==2) && (dd>28) && ((yyyy%4)!=0)) {//leap year checking
|
||||
alert(alert_arr.ENTER_VALID+fldLabel)
|
||||
window.document.QcEditView[fldName].focus()
|
||||
return false
|
||||
}
|
||||
|
||||
switch (parseInt(mm)) {
|
||||
case 2 :
|
||||
case 4 :
|
||||
case 6 :
|
||||
case 9 :
|
||||
case 11 : if (dd>30) {
|
||||
alert(alert_arr.ENTER_VALID+fldLabel)
|
||||
window.document.QcEditView[fldName].focus()
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
var currdate=new Date()
|
||||
var chkdate=new Date()
|
||||
|
||||
chkdate.setYear(yyyy)
|
||||
chkdate.setMonth(mm-1)
|
||||
chkdate.setDate(dd)
|
||||
|
||||
if (type!="OTH") {
|
||||
if (!compareDates(chkdate,fldLabel,currdate,"current date",type)) {
|
||||
window.document.QcEditView[fldName].focus()
|
||||
return false
|
||||
} else return true;
|
||||
} else return true;
|
||||
}
|
||||
|
||||
function qcdateComparison(fldName1,fldLabel1,fldName2,fldLabel2,type) {
|
||||
var dateval1=window.document.QcEditView[fldName1].value.replace(/^\s+/g, '').replace(/\s+$/g, '')
|
||||
var dateval2=window.document.QcEditView[fldName2].value.replace(/^\s+/g, '').replace(/\s+$/g, '')
|
||||
|
||||
var dateelements1=splitDateVal(dateval1)
|
||||
var dateelements2=splitDateVal(dateval2)
|
||||
|
||||
dd1=dateelements1[0]
|
||||
mm1=dateelements1[1]
|
||||
yyyy1=dateelements1[2]
|
||||
|
||||
dd2=dateelements2[0]
|
||||
mm2=dateelements2[1]
|
||||
yyyy2=dateelements2[2]
|
||||
|
||||
var date1=new Date()
|
||||
var date2=new Date()
|
||||
|
||||
date1.setYear(yyyy1)
|
||||
date1.setMonth(mm1-1)
|
||||
date1.setDate(dd1)
|
||||
|
||||
date2.setYear(yyyy2)
|
||||
date2.setMonth(mm2-1)
|
||||
date2.setDate(dd2)
|
||||
|
||||
if (type!="OTH") {
|
||||
if (!compareDates(date1,fldLabel1,date2,fldLabel2,type)) {
|
||||
window.document.QcEditView[fldName1].focus()
|
||||
return false
|
||||
} else return true;
|
||||
} else return true
|
||||
}
|
||||
|
||||
function qcintValidate(fldName,fldLabel) {
|
||||
var val=window.document.QcEditView[fldName].value.replace(/^\s+/g, '').replace(/\s+$/g, '')
|
||||
if (isNaN(val) || (val.indexOf(".")!=-1 && fldName != 'potential_amount'))
|
||||
{
|
||||
alert(alert_arr.INVALID+fldLabel)
|
||||
window.document.QcEditView[fldName].focus()
|
||||
return false
|
||||
}
|
||||
else if( (fldName != 'employees' || fldName != 'noofemployees') && (val < -2147483648 || val > 2147483647))
|
||||
{
|
||||
alert(fldLabel +alert_arr.OUT_OF_RANGE);
|
||||
return false;
|
||||
}
|
||||
else if((fldName == 'employees' || fldName == 'noofemployees') && (val < 0 || val > 2147483647))
|
||||
{
|
||||
alert(fldLabel +alert_arr.OUT_OF_RANGE);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
function qcnumConstComp(fldName,fldLabel,type,constval) {
|
||||
var val=parseFloat(window.document.QcEditView[fldName].value.replace(/^\s+/g, '').replace(/\s+$/g, ''))
|
||||
constval=parseFloat(constval)
|
||||
|
||||
var ret=true
|
||||
switch (type) {
|
||||
case "L" : if (val>=constval) {
|
||||
alert(fldLabel+alert_arr.SHOULDBE_LESS+constval)
|
||||
ret=false
|
||||
}
|
||||
break;
|
||||
case "LE" : if (val>constval) {
|
||||
alert(fldLabel+alert_arr.SHOULDBE_LESS_EQUAL+constval)
|
||||
ret=false
|
||||
}
|
||||
break;
|
||||
case "E" : if (val!=constval) {
|
||||
alert(fldLabel+alert_arr.SHOULDBE_EQUAL+constval)
|
||||
ret=false
|
||||
}
|
||||
break;
|
||||
case "NE" : if (val==constval) {
|
||||
alert(fldLabel+alert_arr.SHOULDNOTBE_EQUAL+constval)
|
||||
ret=false
|
||||
}
|
||||
break;
|
||||
case "G" : if (val<=constval) {
|
||||
alert(fldLabel+alert_arr.SHOULDBE_GREATER+constval)
|
||||
ret=false
|
||||
}
|
||||
break;
|
||||
case "GE" : if (val<constval) {
|
||||
alert(fldLabel+alert_arr.SHOULDBE_GREATER_EQUAL+constval)
|
||||
ret=false
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (ret==false) {
|
||||
window.document.QcEditView[fldName].focus()
|
||||
return false
|
||||
} else return true;
|
||||
}
|
||||
function qcdateTimeValidate(dateFldName,timeFldName,fldLabel,type) {
|
||||
if(qcpatternValidate(dateFldName,fldLabel,"DATE")==false)
|
||||
return false;
|
||||
dateval=window.document.QcEditView[dateFldName].value.replace(/^\s+/g, '').replace(/\s+$/g, '');
|
||||
var dateelements=splitDateVal(dateval);
|
||||
|
||||
dd=dateelements[0];
|
||||
mm=dateelements[1];
|
||||
yyyy=dateelements[2];
|
||||
|
||||
if (dd<1 || dd>31 || mm<1 || mm>12 || yyyy<1 || yyyy<1000) {
|
||||
alert(alert_arr.ENTER_VALID+fldLabel)
|
||||
window.document.QcEditView[dateFldName].focus()
|
||||
return false
|
||||
}
|
||||
|
||||
if ((mm==2) && (dd>29)) {//checking of no. of days in february month
|
||||
alert(alert_arr.ENTER_VALID+fldLabel)
|
||||
window.document.QcEditView[dateFldName].focus()
|
||||
return false
|
||||
}
|
||||
|
||||
if ((mm==2) && (dd>28) && ((yyyy%4)!=0)) {//leap year checking
|
||||
alert(alert_arr.ENTER_VALID+fldLabel)
|
||||
window.document.QcEditView[dateFldName].focus()
|
||||
return false
|
||||
}
|
||||
|
||||
switch (parseInt(mm)) {
|
||||
case 2 :
|
||||
case 4 :
|
||||
case 6 :
|
||||
case 9 :
|
||||
case 11 : if (dd>30) {
|
||||
alert(alert_arr.ENTER_VALID+fldLabel)
|
||||
window.document.QcEditView[dateFldName].focus()
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
if (qcpatternValidate(timeFldName,fldLabel,"TIME")==false)
|
||||
return false
|
||||
|
||||
var timeval=window.document.QcEditView[timeFldName].value.replace(/^\s+/g, '').replace(/\s+$/g, '')
|
||||
var hourval=parseInt(timeval.substring(0,timeval.indexOf(":")))
|
||||
var minval=parseInt(timeval.substring(timeval.indexOf(":")+1,timeval.length))
|
||||
var currObj=window.document.QcEditView[timeFldName]
|
||||
|
||||
if (hourval>23 || minval>59) {
|
||||
alert(alert_arr.ENTER_VALID+fldLabel)
|
||||
currObj.focus()
|
||||
return false
|
||||
}
|
||||
|
||||
var currdate=new Date()
|
||||
var chkdate=new Date()
|
||||
|
||||
chkdate.setYear(yyyy)
|
||||
chkdate.setMonth(mm-1)
|
||||
chkdate.setDate(dd)
|
||||
chkdate.setHours(hourval)
|
||||
chkdate.setMinutes(minval)
|
||||
|
||||
if (type!="OTH") {
|
||||
if (!compareDates(chkdate,fldLabel,currdate,"current date & time",type)) {
|
||||
window.document.QcEditView[dateFldName].focus()
|
||||
return false
|
||||
} else return true;
|
||||
} else return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
Copyright 2005 Rolando Gonzalez (rolosworld@gmail.com)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
function getRequester()
|
||||
{
|
||||
try
|
||||
{
|
||||
if(window.XMLHttpRequest)
|
||||
{
|
||||
return new XMLHttpRequest();
|
||||
}
|
||||
else if(window.ActiveXObject)
|
||||
{
|
||||
try
|
||||
{
|
||||
return new ActiveXObject("Microsoft.XMLHTTP");
|
||||
} catch (e)
|
||||
{
|
||||
try {
|
||||
return new ActiveXObject("Msxml2.XMLHTTP");
|
||||
} catch (e) {return false;}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
return false;
|
||||
//alert("You need a browser which supports an XMLHttpRequest Object.\nMozilla build 0.9.5 has this Object and IE5 and above.");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
onreadystatechange Event handler for an event that fires at every state change
|
||||
readyState Object status integer:
|
||||
0 = uninitialized
|
||||
1 = loading
|
||||
2 = loaded
|
||||
3 = interactive
|
||||
4 = complete
|
||||
responseText String version of data returned from server process
|
||||
responseXML DOM-compatible document object of data returned from server process
|
||||
status Numeric code returned by server, such as 404 for "Not Found" or 200 for "OK"
|
||||
statusText String message accompanying the status code
|
||||
*/
|
||||
function VtigerAjax(cb)
|
||||
{
|
||||
var me = this;
|
||||
this.requester = getRequester();
|
||||
|
||||
if(cb)
|
||||
this.callback = cb;
|
||||
else
|
||||
this.callback = function(req)
|
||||
{
|
||||
return eval(req.responseText);
|
||||
}
|
||||
|
||||
this.requester.onreadystatechange = function(){
|
||||
switch(me.requester.readyState)
|
||||
{
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
break;
|
||||
case 4:
|
||||
var response = me.callback(me.requester);
|
||||
break;
|
||||
default:
|
||||
alert("Error");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this.state = function()
|
||||
{
|
||||
return me.requester.readyState;
|
||||
}
|
||||
|
||||
this.process = function(url, parameters){
|
||||
me.requester.open("POST", url, true);
|
||||
me.requester.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||
me.requester.setRequestHeader("Content-length", parameters.length);
|
||||
me.requester.setRequestHeader("Connection", "close");
|
||||
me.requester.send(parameters);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* this file will poll the vtiger_asteriskincomingcalls table
|
||||
* for any incoming calls
|
||||
*
|
||||
* the variable ASTERISK_POLLTIME denotes the number of milli-seconds after which the crm gets polled
|
||||
* the variable ASRERISK_DIV_TIMEOUT denotes the number of milli-seconds after which the incoming call information div times out (i.e. hidden)
|
||||
*/
|
||||
function _defAsteriskTimer(){
|
||||
var asteriskTimer = null;
|
||||
var ASTERISK_POLLTIME = 5000; //vtigercrm polls the asterisk server for incoming calls after every 3 seconds for now
|
||||
var ASTERISK_INCOMING_DIV_TIMEOUT = 15; //the incoming call div is present for this number of seconds
|
||||
function AsteriskCallback() {
|
||||
var url = "module=PBXManager&action=PBXManagerAjax&file=TraceIncomingCall&mode=ajax&ajax=true";
|
||||
new Ajax.Request(
|
||||
'index.php',
|
||||
{
|
||||
queue: {position: 'end', scope: 'command'},
|
||||
method: 'post',
|
||||
postBody:url,
|
||||
onComplete: function(response){
|
||||
popupText = trim(response.responseText);
|
||||
if(popupText != '' && popupText != 'failure'){
|
||||
var div = popupText;
|
||||
Popup_vtiger = _defPopup();
|
||||
Popup_vtiger.content = div;
|
||||
Popup_vtiger.displayPopup(Popup_vtiger.content,ASTERISK_INCOMING_DIV_TIMEOUT);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function AsteriskRegisterCallback(timeout) {
|
||||
if(timeout == null) timeout = ASTERISK_POLLTIME;
|
||||
if(asteriskTimer == null) {
|
||||
AsteriskCallback();
|
||||
asteriskTimer = setInterval(AsteriskCallback, timeout);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
registerCallback: AsteriskRegisterCallback,
|
||||
pollTimer: ASTERISK_POLLTIME
|
||||
};
|
||||
}
|
||||
|
||||
AsteriskTimer = _defAsteriskTimer();
|
||||
|
||||
AsteriskTimer.registerCallback(AsteriskTimer.pollTimer);
|
||||
@@ -0,0 +1,212 @@
|
||||
if (document.getElementById){
|
||||
|
||||
fCol='#000000'; //face/number colour.
|
||||
dCol='#cccccc'; //dot colour.
|
||||
hCol='#000000'; //hours colour.
|
||||
mCol='#000000'; //minutes colour.
|
||||
sCol='#ff0000'; //seconds colour.
|
||||
cCol='#000000'; //date colour.
|
||||
aCol='#999999'; //am-pm colour.
|
||||
bCol='#ffffff'; //select/form background colour.
|
||||
tCol='#000000'; //select/form text colour.
|
||||
|
||||
//Alter nothing below! Alignments will be lost!
|
||||
y=87;
|
||||
xpos=60;
|
||||
h=4;
|
||||
m=5;
|
||||
s=6;
|
||||
cf=new Array();
|
||||
cd=new Array();
|
||||
ch=new Array();
|
||||
cm=new Array();
|
||||
cs=new Array();
|
||||
face="3 4 5 6 7 8 9 10 11 12 1 2";
|
||||
face=face.split(" ");
|
||||
n=face.length;
|
||||
e=360/n;
|
||||
hDims=7;
|
||||
zone=0;
|
||||
isItLocal=true;
|
||||
ampm="";
|
||||
daysInMonth=31;
|
||||
todaysDate="";
|
||||
var addHours;
|
||||
var oddMinutes;
|
||||
var getOddMinutes;
|
||||
var addOddMinutes;
|
||||
plusMinus=false;
|
||||
|
||||
var mon=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
|
||||
|
||||
document.write('<div id="theDate" class="datestyle" style="color:'+cCol+'">\!<\/div>');
|
||||
document.write('<div id="amOrPm" class="ampmstyle" style="color:'+aCol+'">\!<\/div>');
|
||||
for (i=0; i < n; i++){
|
||||
document.write('<div id="theFace'+i+'" class="facestyle" style="color:'+fCol+'">'+face[i]+'<\/div>');
|
||||
|
||||
cf[i]=document.getElementById("theFace"+i).style;
|
||||
cf[i].top=y-6+30*1.4*Math.sin(i*e*Math.PI/180)+"px";
|
||||
cf[i].left=xpos-6+30*1.4*Math.cos(i*e*Math.PI/180)+"px";
|
||||
}
|
||||
for (i=0; i < n; i++){}
|
||||
for (i=0; i < h; i++){
|
||||
document.write('<div id="H'+i+'" class="handsanddotsstyle" style="background-color:'+hCol+'"><\/div>');
|
||||
ch[i]=document.getElementById("H"+i).style;
|
||||
}
|
||||
for (i=0; i < m; i++){
|
||||
document.write('<div id="M'+i+'" class="handsanddotsstyle" style="background-color:'+mCol+'"><\/div>');
|
||||
cm[i]=document.getElementById("M"+i).style;
|
||||
}
|
||||
for (i=0; i < s; i++){
|
||||
document.write('<div id="S'+i+'" class="handsanddotsstyle" style="background-color:'+sCol+'"><\/div>');
|
||||
cs[i]=document.getElementById("S"+i).style;
|
||||
}
|
||||
|
||||
var dsp1=document.getElementById("amOrPm").style;
|
||||
var dsp2=document.getElementById("theCities").style;
|
||||
var dsp3=document.getElementById("theDate").style;
|
||||
//var dsp4=document.getElementById("city").style;
|
||||
var dsp5=document.getElementById("theClockLayer").style;
|
||||
dsp1.top=y+"px";
|
||||
dsp1.left=xpos-8+"px";
|
||||
dsp2.top=y-80+"px";
|
||||
dsp2.left=xpos-55+"px";
|
||||
dsp3.top=y+55+"px";
|
||||
dsp3.left=xpos-60+"px";
|
||||
|
||||
dsp5.backgroundImage="url(themes/images/clock_bg.gif)"
|
||||
dsp5.backgroundRepeat="no-repeat"
|
||||
dsp5.backgroundPosition="4px 38px"
|
||||
|
||||
function lcl(currIndex,localState){
|
||||
zone=document.frmtimezone.clockcity.options[currIndex].value;
|
||||
isItLocal=localState;
|
||||
plusMinus=(zone.charAt(0) == "-")?true:false;
|
||||
oddMinutes=(zone.indexOf(".") != -1)?true:false;
|
||||
if (oddMinutes){
|
||||
getOddMinutes=zone.substring(zone.indexOf(".")+1,zone.length)
|
||||
}
|
||||
|
||||
addHours=(oddMinutes)?parseInt(zone.substring(0,zone.indexOf("."))):parseInt(zone)
|
||||
if (plusMinus){
|
||||
addOddMinutes=(oddMinutes)?parseInt(-getOddMinutes):0;
|
||||
} else{
|
||||
addOddMinutes=(oddMinutes)?parseInt(getOddMinutes):0;
|
||||
}
|
||||
|
||||
set_cookie("timezone",currIndex)
|
||||
}
|
||||
|
||||
function ClockAndAssign(){
|
||||
hourAdjust=0;
|
||||
dayAdjust=0;
|
||||
monthAdjust=0;
|
||||
now=new Date();
|
||||
|
||||
secs=now.getSeconds();
|
||||
sec=Math.PI*(secs-15)/30;
|
||||
|
||||
mins=(isItLocal)?now.getMinutes():now.getUTCMinutes();
|
||||
if (oddMinutes){
|
||||
mins=eval(mins+addOddMinutes);
|
||||
}
|
||||
min=Math.PI*(mins-15)/30;
|
||||
if (mins<0){
|
||||
mins+=60;hourAdjust=-1;
|
||||
}
|
||||
if (mins>59){
|
||||
mins-=60;hourAdjust=1;
|
||||
}
|
||||
|
||||
hr=(isItLocal)?now.getHours()+hourAdjust:now.getUTCHours()+addHours+hourAdjust
|
||||
hrs=Math.PI*(hr-3)/6+Math.PI*parseInt(now.getMinutes())/360;
|
||||
|
||||
if (!isItLocal){
|
||||
if (addHours<0){
|
||||
if(now.getUTCHours()+parseInt(addHours)<0)
|
||||
dayAdjust-=1
|
||||
} else{
|
||||
if(now.getUTCHours()+parseInt(addHours)>23)
|
||||
dayAdjust+=1
|
||||
}
|
||||
}
|
||||
|
||||
day=now.getDate()+dayAdjust;
|
||||
|
||||
if (day<1){
|
||||
day+=daysInMonth;
|
||||
monthAdjust=-1;
|
||||
}
|
||||
if (day>daysInMonth){
|
||||
day-=daysInMonth;
|
||||
monthAdjust=1;
|
||||
}
|
||||
|
||||
month=parseInt(now.getMonth()+1+monthAdjust);
|
||||
|
||||
if (month==2){
|
||||
daysInMonth=28;
|
||||
}
|
||||
year=now.getYear();
|
||||
if (year<2000){
|
||||
year=year+1900;
|
||||
}
|
||||
leap_year=(eval(year%4)==0)?true:false;
|
||||
if (leap_year&&month==2){
|
||||
daysInMonth=29;
|
||||
}
|
||||
if (month<1){
|
||||
month+=12;
|
||||
year--;
|
||||
}
|
||||
if (month>12){
|
||||
month-=12;
|
||||
year++;
|
||||
}
|
||||
todaysDate=mon[month-1]+" "+day+", "+year;
|
||||
|
||||
if (hr<0) hr+=24;
|
||||
if (hr>23) hr-=24;
|
||||
|
||||
ampm=(hr>11)?"PM":"AM";
|
||||
|
||||
for (i=0;i<s;i++){
|
||||
cs[i].top=y+(i*hDims)*Math.sin(sec)+"px";
|
||||
cs[i].left=xpos+(i*hDims)*Math.cos(sec)+"px";
|
||||
}
|
||||
for (i=0;i<m;i++){
|
||||
cm[i].top=y+(i*hDims)*Math.sin(min)+"px";
|
||||
cm[i].left=xpos+(i*hDims)*Math.cos(min)+"px";
|
||||
}
|
||||
for (i=0;i<h;i++){
|
||||
ch[i].top=y+(i*hDims)*Math.sin(hrs)+"px";
|
||||
ch[i].left=xpos+(i*hDims)*Math.cos(hrs)+"px";
|
||||
}
|
||||
|
||||
document.getElementById("amOrPm").firstChild.data=ampm;
|
||||
|
||||
if (hr==0)
|
||||
{
|
||||
hr=12
|
||||
}
|
||||
else if (hr>12)
|
||||
{
|
||||
hr-=12;
|
||||
}
|
||||
|
||||
|
||||
if (mins.toString().length==1) mins="0"+mins;
|
||||
|
||||
document.getElementById("theDate").firstChild.data=todaysDate+" "+hr+":"+mins+" "+ampm;
|
||||
setTimeout('ClockAndAssign()',100);
|
||||
}
|
||||
ClockAndAssign();
|
||||
}
|
||||
|
||||
|
||||
if (get_cookie("timezone")==null || get_cookie("timezone")==false || get_cookie("timezone")<0 || get_cookie("timezone")=="1") {
|
||||
lcl(0,true)
|
||||
} else {
|
||||
lcl(get_cookie("timezone"),false)
|
||||
document.frmtimezone.clockcity.options[get_cookie("timezone")].selected=true
|
||||
}
|
||||
@@ -0,0 +1,396 @@
|
||||
/*********************************************************************************
|
||||
** 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 splitValues(object) {
|
||||
var picklistObj=object;
|
||||
var pickListContent=picklistObj.value
|
||||
var pickListAry=new Array()
|
||||
var i=0;
|
||||
|
||||
//Splitting up of Values
|
||||
if (pickListContent.indexOf("\n")!=-1) {
|
||||
while(pickListContent.length>0) {
|
||||
if(pickListContent.indexOf("\n")!=-1) {
|
||||
if (pickListContent.replace(/^\s+/g, '').replace(/\s+$/g, '').length>0) {
|
||||
pickListAry[i]=pickListContent.substr(0,pickListContent.indexOf("\n")).replace(/^\s+/g, '').replace(/\s+$/g, '')
|
||||
pickListContent=pickListContent.substr(pickListContent.indexOf("\n")+1,pickListContent.length)
|
||||
i++
|
||||
} else break;
|
||||
} else {
|
||||
pickListAry[i]=pickListContent.substr(0,pickListContent.length)
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (pickListContent.replace(/^\s+/g, '').replace(/\s+$/g, '').length>0) {
|
||||
pickListAry[0]=pickListContent.replace(/^\s+/g, '').replace(/\s+$/g, '')
|
||||
}
|
||||
|
||||
return pickListAry;
|
||||
}
|
||||
|
||||
|
||||
function validate(blockid) {
|
||||
var nummaxlength = 255;
|
||||
var fieldtype = document.getElementById('selectedfieldtype_'+blockid).value;
|
||||
var mode = document.getElementById('cfedit_mode').value;
|
||||
if(fieldtype == "" && mode != 'edit')
|
||||
{
|
||||
alert(alert_arr.FIELD_TYPE_NOT_SELECTED);
|
||||
return false;
|
||||
}
|
||||
lengthLayer=document.getElementById("lengthdetails_"+blockid)
|
||||
decimalLayer=document.getElementById("decimaldetails_"+blockid)
|
||||
var pickListLayer=document.getElementById("fldPickList_"+blockid);
|
||||
var fldlbl = document.getElementById("fldLabel_"+blockid);
|
||||
var str = fldlbl.value;
|
||||
if (!emptyCheck("fldLabel_"+blockid,"Label","text"))
|
||||
return false
|
||||
var re2=/[&\<\>\:\'\"\,\_]/
|
||||
if (re2.test(str))
|
||||
{
|
||||
alert(alert_arr.SPECIAL_CHARACTERS+" & < > ' \" : , _ "+alert_arr.NOT_ALLOWED)
|
||||
return false;
|
||||
}
|
||||
var fieldlength = document.getElementById('fldLength_'+blockid);
|
||||
if (lengthLayer != null && lengthLayer.style.visibility=="visible") {
|
||||
if (!emptyCheck('fldLength_'+blockid,"Length"))
|
||||
return false
|
||||
|
||||
if (!intValidate('fldLength_'+blockid,"Length"))
|
||||
return false
|
||||
|
||||
if (!numConstComp('fldLength_'+blockid,"Length","G",0))
|
||||
return false
|
||||
|
||||
}
|
||||
|
||||
if (decimalLayer != null && decimalLayer.style.visibility=="visible") {
|
||||
if (document.getElementById("fldDecimal_"+blockid).value.replace(/^\s+/g, '').replace(/\s+$/g, '').length>0)
|
||||
if (!intValidate("fldDecimal_"+blockid,"Decimal"))
|
||||
return false
|
||||
if (!numConstComp("fldDecimal_"+blockid,"Decimal","GE",0))
|
||||
return false
|
||||
|
||||
if (!numConstComp("fldDecimal_"+blockid,"Decimal","LE",30))
|
||||
return false
|
||||
}
|
||||
var decimallength = '';
|
||||
if (decimalLayer != null && decimalLayer.style.visibility=="visible" && document.getElementById('fldDecimal_'+blockid) != null)
|
||||
decimallength = document.getElementById("fldDecimal_"+blockid).value;
|
||||
|
||||
if(fieldValueArr[fieldtype] == 'Percent' || fieldValueArr[fieldtype] == 'Currency' || fieldValueArr[fieldtype] == 'Number')
|
||||
{
|
||||
if(decimallength == '')
|
||||
decimallength = 0;
|
||||
nummaxlength = 65 - (eval(decimallength) + 1);
|
||||
}
|
||||
var lengthObj = document.getElementById("lengthdetails_"+blockid);
|
||||
if ( lengthObj != null && lengthObj.style.visibility == "visible" && !numConstComp('fldLength_'+blockid,"Length","LE",nummaxlength))
|
||||
return false
|
||||
var picklistObj=document.getElementById("fldPickList_"+blockid)
|
||||
if (pickListLayer != null && getObj("picklistdetails_"+blockid).style.visibility=="visible") {
|
||||
var pickListAry=new Array();
|
||||
pickListAry=splitValues(pickListLayer);
|
||||
if (emptyCheck("fldPickList_"+blockid,"Picklist values")) {
|
||||
|
||||
//Empty Check validation
|
||||
for (i=0;i<pickListAry.length;i++) {
|
||||
if (pickListAry[i]=="") {
|
||||
alert(alert_arr.PICKLIST_CANNOT_BE_EMPTY);
|
||||
picklistObj.focus();
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
//Duplicate Values' Validation
|
||||
for (i=0;i<pickListAry.length;i++) {
|
||||
for (j=i+1;j<pickListAry.length;j++) {
|
||||
if (trim(pickListAry[i].toUpperCase())== trim(pickListAry[j].toUpperCase())) {
|
||||
alert(alert_arr.DUPLICATE_VALUES_FOUND)
|
||||
picklistObj.focus();
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
} else return false
|
||||
}
|
||||
return true;
|
||||
}
|
||||
var fieldValueArr=new Array('Text','Number','Percent','Currency','Date','Email','Phone','Picklist','URL','Checkbox','TextArea','MultiSelectCombo','Skype');
|
||||
var fieldTypeArr=new Array('text','number','percent','currency','date','email','phone','picklist','url','checkbox','textarea','multiselectcombo','skype');
|
||||
var currFieldIdx=0,totFieldType;
|
||||
var focusFieldType;
|
||||
|
||||
/*function init() {
|
||||
lengthLayer=getObj("lengthdetails")
|
||||
decimalLayer=getObj("decimaldetails")
|
||||
pickListLayer=getObj("picklist")
|
||||
totFieldType=fieldTypeArr.length-1
|
||||
}*/
|
||||
|
||||
|
||||
function setVisible() {
|
||||
if (focusFieldType==true) {
|
||||
var selFieldType=fieldLayer.getObj("field"+currFieldIdx)
|
||||
var height=findPosY(selFieldType)+selFieldType.offsetHeight
|
||||
|
||||
if (currFieldIdx==0) {
|
||||
fieldLayer.document.body.scrollTop=0
|
||||
} else if (height>220) {
|
||||
fieldLayer.document.body.scrollTop+=height-220
|
||||
} else {
|
||||
fieldLayer.document.body.scrollTop-=220-height
|
||||
}
|
||||
|
||||
if (window.navigator.appName.toUpperCase()=="OPERA") {
|
||||
var newDiv=fieldLayer.document.createElement("DIV")
|
||||
newDiv.style.zIndex="-1"
|
||||
newDiv.style.position="absolute"
|
||||
newDiv.style.top=findPosY(selFieldType)+"px"
|
||||
newDiv.style.left="25px"
|
||||
|
||||
var newObj=fieldLayer.document.createElement("INPUT")
|
||||
newObj.type="text"
|
||||
|
||||
fieldLayer.document.body.appendChild(newDiv)
|
||||
newDiv.appendChild(newObj)
|
||||
newObj.focus()
|
||||
|
||||
fieldLayer.document.body.removeChild(newDiv)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function selFieldType(id,scrollLayer,bool,blockid) {
|
||||
currFieldIdx=id
|
||||
var type=fieldTypeArr[id]
|
||||
var lengthLayer=document.getElementById("lengthdetails_"+blockid);
|
||||
var decimalLayer=document.getElementById("decimaldetails_"+blockid);
|
||||
var pickListLayer=document.getElementById("picklistdetails_"+blockid);
|
||||
if (type=='text') {
|
||||
lengthLayer.style.visibility="visible"
|
||||
decimalLayer.style.visibility="hidden"
|
||||
pickListLayer.style.visibility="hidden"
|
||||
} else if (type=='date' || type=='percent' || type=='email' || type=='phone' || type=='url' || type=='checkbox' || type=='textarea' || type=='skype') {
|
||||
document.getElementById("lengthdetails_"+blockid).style.visibility="hidden"
|
||||
decimalLayer.style.visibility="hidden"
|
||||
pickListLayer.style.visibility="hidden"
|
||||
} else if (type=='number' || type=='currency') {
|
||||
lengthLayer.style.visibility="visible"
|
||||
decimalLayer.style.visibility="visible"
|
||||
pickListLayer.style.visibility="hidden"
|
||||
} else if (type=='picklist' || type=='multiselectcombo') {
|
||||
lengthLayer.style.visibility="hidden"
|
||||
decimalLayer.style.visibility="hidden"
|
||||
pickListLayer.style.visibility="visible"
|
||||
}
|
||||
document.getElementById("fieldType_"+blockid).value = fieldValueArr[id];
|
||||
}
|
||||
|
||||
function srchFieldType(ev) {
|
||||
if (browser_ie) {
|
||||
var keyCode=window.fieldLayer.event.keyCode
|
||||
var currElement=window.fieldLayer.event.srcElement
|
||||
if (currElement.id.indexOf("field")>=0) var doSearch=true
|
||||
else var doSearch=false
|
||||
window.fieldLayer.event.cancelBubble=true
|
||||
} else if (browser_nn4 || browser_nn6) {
|
||||
var keyCode=ev.which
|
||||
var currElement=ev.target
|
||||
if (currElement.type) doSearch=false
|
||||
else doSearch=true
|
||||
}
|
||||
|
||||
if (doSearch==true) {
|
||||
switch (keyCode) {
|
||||
case 9 : //Reset Field Type
|
||||
resetFieldTypeHilite();break;
|
||||
case 33 : //Page Up
|
||||
case 36 : //Home
|
||||
selFieldType(0);break;
|
||||
case 34 : //Page Down
|
||||
case 35 : //End
|
||||
selFieldType(totFieldType);break;
|
||||
case 38 : //Up
|
||||
if (currFieldIdx!=0)
|
||||
selFieldType(currFieldIdx-1);
|
||||
else
|
||||
selFieldType(totFieldType,"yes");
|
||||
break;
|
||||
case 40 : //Down
|
||||
if (currFieldIdx!=totFieldType)
|
||||
selFieldType(currFieldIdx+1);
|
||||
else
|
||||
selFieldType(0,"yes");
|
||||
default : //Character Search
|
||||
if (keyCode>=65 && keyCode<=90) {
|
||||
var srchChar=String.fromCharCode(keyCode)
|
||||
if (currFieldIdx==totFieldType) var startIdx=0
|
||||
else var startIdx=currFieldIdx+1
|
||||
|
||||
var loop=1
|
||||
for (i=startIdx;i<=totFieldType;) {
|
||||
currFieldStr=fieldLayer.getObj("field"+i).innerHTML
|
||||
currFieldStr=currFieldStr.replace(/^\s+/g, '').replace(/\s+$/g, '').substr(0,1)
|
||||
if (currFieldStr==srchChar) {
|
||||
selFieldType(i,"yes")
|
||||
i++
|
||||
} else if (i==totFieldType && loop<=2) {
|
||||
i=0
|
||||
loop++
|
||||
} else i++
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function resetFieldTypeHilite() {
|
||||
fieldLayer.getObj("field"+currFieldIdx).className="fieldType sel"
|
||||
}
|
||||
function validateCustomFieldAccounts()
|
||||
{
|
||||
var obj=document.getElementsByTagName("SELECT");
|
||||
var i,j=0,k=0,l=0;
|
||||
var n=obj.length;
|
||||
account = new Array;
|
||||
contact = new Array;
|
||||
potential = new Array;
|
||||
for( i = 0; i < n; i++)
|
||||
{
|
||||
if(obj[i].name.indexOf("_account")>0)
|
||||
{
|
||||
account[j]=obj[i].value;
|
||||
j++;
|
||||
}
|
||||
if(obj[i].name.indexOf("_contact")>0)
|
||||
{
|
||||
contact[k]=obj[i].value;
|
||||
k++;
|
||||
}
|
||||
if(obj[i].name.indexOf("_potential")>0)
|
||||
{
|
||||
potential[l]=obj[i].value;
|
||||
l++;
|
||||
}
|
||||
}
|
||||
for( i = 0; i < account.length; i++)
|
||||
{
|
||||
for(j=i+1; j<account.length; j++)
|
||||
{
|
||||
if( account[i] == account[j] && account[i]!="None" && account[j] !="None")
|
||||
{
|
||||
alert(alert_arr.DUPLICATE_MAPPING_ACCOUNTS);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
for( i = 0; i < contact.length; i++)
|
||||
{
|
||||
for(k=i+1; k< contact.length; k++)
|
||||
{
|
||||
if( contact[i] == contact[k] && contact[i]!="None" && contact[k]!="None")
|
||||
{
|
||||
alert(alert_arr.DUPLICATE_MAPPING_CONTACTS);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
for( i = 0; i < potential.length; i++)
|
||||
{
|
||||
for(l=i+1; l<potential.length; l++)
|
||||
{
|
||||
if( potential[i] == potential[l] && potential[i]!="None" && potential[l]!="None")
|
||||
{
|
||||
alert(alert_arr.DUPLICATE_MAPPING_POTENTIAL);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function gotourl(url)
|
||||
{
|
||||
document.location.href=url;
|
||||
}
|
||||
|
||||
function validateTypeforCFMapping(leadtype,leadtypeofdata,field_name,cf_form)
|
||||
{
|
||||
var alertmessage = new Array(alert_arr.LBL_TYPEALERT_1,alert_arr.LBL_WITH,alert_arr.LBL_TYPEALERT_2,alert_arr.LBL_LENGTHALERT,alert_arr.LBL_DECIMALALERT);
|
||||
var combo_val = cf_form.options[cf_form.selectedIndex].value;
|
||||
if(combo_val != 'None')
|
||||
{
|
||||
var type = document.getElementById(combo_val+"_type").value;
|
||||
var typeofdata = document.getElementById(combo_val+"_typeofdata").value;
|
||||
if(leadtype == type)
|
||||
{
|
||||
if(leadtypeofdata == typeofdata)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
var lead_tod = leadtypeofdata.split("~");
|
||||
var tod = typeofdata.split("~");
|
||||
switch (lead_tod[0]) {
|
||||
case "V" :
|
||||
if(lead_tod[3] <= tod[3])
|
||||
return true;
|
||||
else
|
||||
{
|
||||
alert(alertmessage[3]);
|
||||
document.getElementById(field_name).value = 'None';
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case "N" :
|
||||
if(lead_tod[2].indexOf(",")>0)
|
||||
{
|
||||
var lead_dec = lead_tod[2].split(",");
|
||||
var dec = tod[2].split(",");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var lead_dec = lead_tod[2].split("~");
|
||||
var dec = tod[2].split("~");
|
||||
}
|
||||
if(lead_dec[0] <= dec[0])
|
||||
{
|
||||
if(lead_dec[1] <= dec[1])
|
||||
return true;
|
||||
else
|
||||
{
|
||||
alert(alertmessage[4]);
|
||||
document.getElementById(field_name).value = 'None';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(alertmessage[3]);
|
||||
document.getElementById(field_name).value = 'None';
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(alertmessage[0]+" "+leadtype+" "+alertmessage[1]+" "+type+" "+alertmessage[2]);
|
||||
document.getElementById(field_name).value = 'None';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,521 @@
|
||||
/*********************************************************************************
|
||||
** 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.
|
||||
*
|
||||
********************************************************************************/
|
||||
var globaldtlviewspanid = "";
|
||||
var globaleditareaspanid = "";
|
||||
var globaltxtboxid = "";
|
||||
var itsonview=false;
|
||||
// to retain the old value if we cancel the ajax edit
|
||||
var globaltempvalue = '';
|
||||
var globaluitype = '';
|
||||
function showHide(showId, hideId)
|
||||
{
|
||||
show(showId);
|
||||
fnhide(hideId);
|
||||
}
|
||||
|
||||
function hndCancel(valuespanid,textareapanid,fieldlabel)
|
||||
{
|
||||
|
||||
showHide(valuespanid,textareapanid);
|
||||
if(globaluitype == '56')
|
||||
{
|
||||
if(globaltempvalue == 1)
|
||||
getObj(globaltxtboxid).checked = true;
|
||||
else
|
||||
getObj(globaltxtboxid).checked = false;
|
||||
}
|
||||
else if(globaluitype != '53' && globaluitype != '33')
|
||||
getObj(globaltxtboxid).value = globaltempvalue;
|
||||
globaltempvalue = '';
|
||||
itsonview=false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function hndMouseOver(uitype,fieldLabel)
|
||||
{
|
||||
var mouseArea="";
|
||||
mouseArea="mouseArea_"+ fieldLabel;
|
||||
if(itsonview)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
show("crmspanid");
|
||||
globaluitype = uitype;
|
||||
globaldtlviewspanid= "dtlview_"+ fieldLabel;//valuespanid;
|
||||
globaleditareaspanid="editarea_"+ fieldLabel;//textareapanid;
|
||||
globalfieldlabel = fieldLabel;
|
||||
if(globaluitype == 53)
|
||||
{
|
||||
if(typeof(document.DetailView.assigntype[0]) != 'undefined')
|
||||
{
|
||||
var assign_type_U = document.DetailView.assigntype[0].checked;
|
||||
var assign_type_G = document.DetailView.assigntype[1].checked;
|
||||
if(assign_type_U == true)
|
||||
globaltxtboxid= 'txtbox_U'+fieldLabel;
|
||||
else if(assign_type_G == true)
|
||||
globaltxtboxid= 'txtbox_G'+fieldLabel;
|
||||
}else
|
||||
{
|
||||
globaltxtboxid= 'txtbox_U'+fieldLabel;
|
||||
}
|
||||
}else
|
||||
{
|
||||
globaltxtboxid="txtbox_"+ fieldLabel;//textboxpanid;
|
||||
}
|
||||
divObj = getObj('crmspanid');
|
||||
crmy = findPosY(getObj(mouseArea));
|
||||
crmx = findPosX(getObj(mouseArea));
|
||||
if(document.all)
|
||||
{
|
||||
divObj.onclick=handleEdit;
|
||||
}
|
||||
else
|
||||
{
|
||||
divObj.setAttribute('onclick','handleEdit();');
|
||||
}
|
||||
divObj.style.left=(crmx+getObj(mouseArea).offsetWidth -divObj.offsetWidth)+"px";
|
||||
divObj.style.top=crmy+"px";
|
||||
}
|
||||
|
||||
function handleEdit()
|
||||
{
|
||||
show(globaleditareaspanid) ;
|
||||
fnhide(globaldtlviewspanid);
|
||||
if(globaluitype != 53)
|
||||
{
|
||||
globaltempvalue = getObj(globaltxtboxid).value;
|
||||
if(getObj(globaltxtboxid).type != 'hidden')
|
||||
getObj(globaltxtboxid).focus();
|
||||
}
|
||||
fnhide('crmspanid');
|
||||
itsonview=true;
|
||||
return false;
|
||||
}
|
||||
|
||||
//Asha: Function changed to trim both leading and trailing spaces.
|
||||
function trim(str) {
|
||||
var s = str.replace(/\s+$/,'');
|
||||
s = s.replace(/^\s+/,'');
|
||||
return s;
|
||||
}
|
||||
|
||||
var genUiType = "";
|
||||
var genFldValue = "";
|
||||
|
||||
function dtlViewAjaxSave(fieldLabel,module,uitype,tableName,fieldName,crmId)
|
||||
{
|
||||
var dtlView = "dtlview_"+ fieldLabel;
|
||||
var editArea = "editarea_"+ fieldLabel;
|
||||
var groupurl = "";
|
||||
|
||||
if(globaluitype == 53)
|
||||
{
|
||||
if(typeof(document.DetailView.assigntype[0]) != 'undefined')
|
||||
{
|
||||
var assign_type_U = document.DetailView.assigntype[0].checked;
|
||||
var assign_type_G = document.DetailView.assigntype[1].checked;
|
||||
}else
|
||||
{
|
||||
var assign_type_U = document.DetailView.assigntype.checked;
|
||||
}
|
||||
if(assign_type_U == true)
|
||||
{
|
||||
var txtBox= 'txtbox_U'+fieldLabel;
|
||||
}
|
||||
else if(assign_type_G == true)
|
||||
{
|
||||
var txtBox= 'txtbox_G'+fieldLabel;
|
||||
var group_id = encodeURIComponent($(txtBox).options[$(txtBox).selectedIndex].text);
|
||||
var groupurl = "&assigned_group_id="+group_id+"&assigntype=T"
|
||||
}
|
||||
|
||||
}
|
||||
else if(uitype == 15 || uitype == 16)
|
||||
{
|
||||
var txtBox= "txtbox_"+ fieldLabel;
|
||||
var not_access =document.getElementById(txtBox);
|
||||
pickval = not_access.options[not_access.selectedIndex].value;
|
||||
if(pickval == alert_arr.LBL_NOT_ACCESSIBLE)
|
||||
{
|
||||
document.getElementById(editArea).style.display='none';
|
||||
document.getElementById(dtlView).style.display='block';
|
||||
itsonview=false; //to show the edit link again after hiding the editdiv.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if(globaluitype == 33)
|
||||
{
|
||||
var txtBox= "txtbox_"+ fieldLabel;
|
||||
var oMulSelect = $(txtBox);
|
||||
var r = new Array();
|
||||
var notaccess_label = new Array();
|
||||
for (iter=0;iter < oMulSelect.options.length ; iter++)
|
||||
{
|
||||
if (oMulSelect.options[iter].selected)
|
||||
{
|
||||
r[r.length] = oMulSelect.options[iter].value;
|
||||
notaccess_label[notaccess_label.length] = oMulSelect.options[iter].text;
|
||||
}
|
||||
}
|
||||
}else
|
||||
{
|
||||
var txtBox= "txtbox_"+ fieldLabel;
|
||||
}
|
||||
|
||||
var popupTxt= "popuptxt_"+ fieldLabel;
|
||||
var hdTxt = "hdtxt_"+ fieldLabel;
|
||||
|
||||
if(formValidate() == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$("vtbusy_info").style.display="inline";
|
||||
var isAdmin = document.getElementById("hdtxt_IsAdmin").value;
|
||||
|
||||
|
||||
//overriden the tagValue based on UI Type for checkbox
|
||||
if(uitype == '56')
|
||||
{
|
||||
if(document.getElementById(txtBox).checked == true)
|
||||
{
|
||||
if(module == "Contacts")
|
||||
{
|
||||
var obj = getObj("email");
|
||||
if((fieldName == "portal") && (obj == null || obj.value == ''))
|
||||
{
|
||||
tagValue = "0";
|
||||
alert(alert_arr.PORTAL_PROVIDE_EMAILID);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
tagValue = "1";
|
||||
|
||||
}
|
||||
else
|
||||
tagValue = "1";
|
||||
}else
|
||||
{
|
||||
tagValue = "0";
|
||||
}
|
||||
}else if(uitype == '156')
|
||||
{
|
||||
if(document.getElementById(txtBox).checked == true)
|
||||
{
|
||||
tagValue = "on";
|
||||
}else
|
||||
{
|
||||
tagValue = "off";
|
||||
}
|
||||
}else if(uitype == '33')
|
||||
{
|
||||
tagValue = r.join(" |##| ");
|
||||
}else if(uitype == '24' || uitype == '21')
|
||||
{
|
||||
tagValue = document.getElementById(txtBox).value.replace(/<br\s*\/>/g, " ");
|
||||
|
||||
}else
|
||||
{
|
||||
tagValue = trim(document.getElementById(txtBox).value);
|
||||
if(module == "Contacts")
|
||||
{
|
||||
if(getObj('portal'))
|
||||
{
|
||||
var port_obj = getObj('portal').checked;
|
||||
if(fieldName == "email" && tagValue == '' && port_obj == true)
|
||||
{
|
||||
alert(alert_arr.PORTAL_PROVIDE_EMAILID);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var data = "file=DetailViewAjax&module=" + module + "&action=" + module + "Ajax&record=" + crmId+"&recordid=" + crmId ;
|
||||
data = data + "&fldName=" + fieldName + "&fieldValue=" + escapeAll(tagValue) + "&ajxaction=DETAILVIEW"+groupurl;
|
||||
new Ajax.Request(
|
||||
'index.php',
|
||||
{queue: {position: 'end', scope: 'command'},
|
||||
method: 'post',
|
||||
postBody: data,
|
||||
onComplete: function(response) {
|
||||
if(response.responseText.indexOf(":#:FAILURE")>-1) {
|
||||
alert(alert_arr.ERROR_WHILE_EDITING);
|
||||
}
|
||||
else if(response.responseText.indexOf(":#:SUCCESS")>-1) {
|
||||
//For HD & FAQ - comments, we should empty the field value
|
||||
if((module == "HelpDesk" || module == "Faq") && fieldName == "comments") {
|
||||
var comments = response.responseText.replace(":#:SUCCESS","");
|
||||
if(getObj("comments_div") != null) getObj("comments_div").innerHTML = comments;
|
||||
if(getObj(dtlView) != null) getObj(dtlView).innerHTML = "";
|
||||
if(getObj("comments") != null) getObj("comments").value = "";
|
||||
}
|
||||
$("vtbusy_info").style.display="none";
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
tagValue = get_converted_html(tagValue);
|
||||
if(uitype == '13' || uitype == '104')
|
||||
{
|
||||
var temp_fieldname = 'internal_mailer_'+fieldName;
|
||||
if($(temp_fieldname))
|
||||
{
|
||||
var mail_chk_arr = $(temp_fieldname).innerHTML.split("####");
|
||||
var fieldId = mail_chk_arr[0];
|
||||
var internal_mailer_flag = mail_chk_arr[1];
|
||||
if(internal_mailer_flag == 1)
|
||||
var email_link = "<a href=\"javascript:InternalMailer("+crmId+","+fieldId+",'"+fieldName+"','"+module+"','record_id');\">"+tagValue+" </a>";
|
||||
else
|
||||
var email_link = "<a href=\"mailto:"+ tagValue+"\" target=\"_blank\">"+tagValue+" </a>";
|
||||
}
|
||||
|
||||
getObj(dtlView).innerHTML = email_link;
|
||||
if(fieldName == "email" || fieldName == "email1"){
|
||||
var priEmail = getObj("pri_email");
|
||||
if(priEmail)
|
||||
priEmail.value = tagValue;
|
||||
}else{
|
||||
var secEmail = getObj("sec_email");
|
||||
if(secEmail)
|
||||
secEmail.value = tagValue;
|
||||
}
|
||||
}else if(uitype == '11'){
|
||||
if(typeof(use_asterisk) != 'undefined' && use_asterisk == true){
|
||||
getObj(dtlView).innerHTML = "<a href=\"javascript:;\" onclick=\"startCall('"+tagValue+"')\">"+tagValue+"</a>";
|
||||
}else{
|
||||
getObj(dtlView).innerHTML = tagValue;
|
||||
}
|
||||
}else if(uitype == '17')
|
||||
{
|
||||
getObj(dtlView).innerHTML = "<a href=\"http://"+ tagValue+"\" target=\"_blank\">"+tagValue+" </a>";
|
||||
}else if(uitype == '85')
|
||||
{
|
||||
getObj(dtlView).innerHTML = "<a href=\"skype://"+ tagValue+"?call\">"+tagValue+" </a>";
|
||||
}else if(uitype == '53')
|
||||
{
|
||||
var hdObj = getObj(hdTxt);
|
||||
if(typeof(document.DetailView.assigntype[0]) != 'undefined')
|
||||
{
|
||||
var assign_type_U = document.DetailView.assigntype[0].checked;
|
||||
var assign_type_G = document.DetailView.assigntype[1].checked;
|
||||
}else
|
||||
{
|
||||
var assign_type_U = document.DetailView.assigntype.checked;
|
||||
}
|
||||
if(isAdmin == "0")
|
||||
{
|
||||
getObj(dtlView).innerHTML = hdObj.value;
|
||||
}else if(isAdmin == "1" && assign_type_U == true)
|
||||
{
|
||||
getObj(dtlView).innerHTML = "<a href=\"index.php?module=Users&action=DetailView&record="+tagValue+"\">"+hdObj.value+" </a>";
|
||||
}else if(isAdmin == "1" && assign_type_G == true)
|
||||
{
|
||||
getObj(dtlView).innerHTML = "<a href=\"index.php?module=Settings&action=GroupDetailView&groupId="+tagValue+"\">"+hdObj.value+" </a>";
|
||||
}
|
||||
}
|
||||
else if(uitype == '52' || uitype == '77')
|
||||
{
|
||||
if(isAdmin == "1")
|
||||
getObj(dtlView).innerHTML = "<a href=\"index.php?module=Users&action=DetailView&record="+tagValue+"\">"+document.getElementById(txtBox).options[document.getElementById(txtBox).selectedIndex].text+" </a>";
|
||||
else
|
||||
getObj(dtlView).innerHTML = document.getElementById(txtBox).options[document.getElementById(txtBox).selectedIndex].text;
|
||||
}
|
||||
else if(uitype == '56')
|
||||
{
|
||||
if(tagValue == '1')
|
||||
{
|
||||
getObj(dtlView).innerHTML = alert_arr.YES;
|
||||
}else
|
||||
{
|
||||
getObj(dtlView).innerHTML = alert_arr.NO;
|
||||
}
|
||||
|
||||
}else if(uitype == 116 || uitype == 117)
|
||||
{
|
||||
getObj(dtlView).innerHTML = document.getElementById(txtBox).options[document.getElementById(txtBox).selectedIndex].text;
|
||||
}
|
||||
else if(getObj(popupTxt))
|
||||
{
|
||||
var popObj = getObj(popupTxt);
|
||||
if(uitype == '50' || uitype == '73' || uitype == '51')
|
||||
{
|
||||
getObj(dtlView).innerHTML = "<a href=\"index.php?module=Accounts&action=DetailView&record="+tagValue+"\">"+popObj.value+" </a>";
|
||||
}
|
||||
else if(uitype == '57')
|
||||
{
|
||||
getObj(dtlView).innerHTML = "<a href=\"index.php?module=Contacts&action=DetailView&record="+tagValue+"\">"+popObj.value+" </a>";
|
||||
}
|
||||
else if(uitype == '59')
|
||||
{
|
||||
getObj(dtlView).innerHTML = "<a href=\"index.php?module=Products&action=DetailView&record="+tagValue+"\">"+popObj.value+" </a>";
|
||||
}
|
||||
else if(uitype == '75' || uitype == '81' )
|
||||
{
|
||||
getObj(dtlView).innerHTML = "<a href=\"index.php?module=Vendors&action=DetailView&record="+tagValue+"\">"+popObj.value+" </a>";
|
||||
|
||||
}
|
||||
else if(uitype == '76')
|
||||
{
|
||||
getObj(dtlView).innerHTML = "<a href=\"index.php?module=Potentials&action=DetailView&record="+tagValue+"\">"+popObj.value+" </a>";
|
||||
}
|
||||
else if(uitype == '78')
|
||||
{
|
||||
getObj(dtlView).innerHTML = "<a href=\"index.php?module=Quotes&action=DetailView&record="+tagValue+"\">"+popObj.value+" </a>";
|
||||
}
|
||||
else if(uitype == '80')
|
||||
{
|
||||
getObj(dtlView).innerHTML = "<a href=\"index.php?module=SalesOrder&action=DetailView&record="+tagValue+"\">"+popObj.value+" </a>";
|
||||
}
|
||||
else if(uitype == '53')
|
||||
{
|
||||
var hdObj = getObj(hdTxt);
|
||||
if(isAdmin == "0")
|
||||
{
|
||||
getObj(dtlView).innerHTML = hdObj.value;
|
||||
}else if(isAdmin == "1")
|
||||
{
|
||||
getObj(dtlView).innerHTML = "<a href=\"index.php?module=Users&action=DetailView&record="+tagValue+"\">"+hdObj.value+" </a>";;
|
||||
}
|
||||
}
|
||||
else if(uitype == '56')
|
||||
{
|
||||
if(tagValue == '1')
|
||||
{
|
||||
getObj(dtlView).innerHTML = alert_arr.YES;
|
||||
}else
|
||||
{
|
||||
getObj(dtlView).innerHTML = "";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
getObj(dtlView).innerHTML = popObj.value;
|
||||
}
|
||||
}
|
||||
else if(uitype == '15' || uitype == '16' )
|
||||
{
|
||||
var notaccess =document.getElementById(txtBox);
|
||||
tagValue = notaccess.options[notaccess.selectedIndex].text;
|
||||
if(tagValue == alert_arr.LBL_NOT_ACCESSIBLE)
|
||||
getObj(dtlView).innerHTML = "<font color='red'>"+get_converted_html(tagValue)+"</font>";
|
||||
else
|
||||
getObj(dtlView).innerHTML = get_converted_html(tagValue);
|
||||
}
|
||||
else if(uitype == '33')
|
||||
{
|
||||
/* Wordwrap a long list of multi-select combo box items at the
|
||||
* item separator string */
|
||||
var DETAILVIEW_WORDWRAP_WIDTH = "70"; // must match value in DetailViewUI.tpl.
|
||||
|
||||
var lineLength = 0;
|
||||
for(var i=0; i < notaccess_label.length; i++) {
|
||||
lineLength += notaccess_label[i].length + 2; // + 2 for item separator string
|
||||
/*if(lineLength > DETAILVIEW_WORDWRAP_WIDTH && i > 0) {
|
||||
lineLength = notaccess_label[i].length + 2; // reset.
|
||||
notaccess_label[i] = '<br/> ' + notaccess_label[i]; // prepend newline.
|
||||
}*/
|
||||
notaccess_label[i] = get_converted_html(notaccess_label[i]);
|
||||
// Prevent a browser splitting multiword items:
|
||||
//notaccess_label[i] = notaccess_label[i].replace(/ /g, ' ');
|
||||
notaccess_label[i] = notaccess_label[i].replace(alert_arr.LBL_NOT_ACCESSIBLE,"<font color='red'>"+alert_arr.LBL_NOT_ACCESSIBLE+"</font>"); // for Not accessible label.
|
||||
}
|
||||
/* Join items with item separator string (which must match string in DetailViewUI.tpl,
|
||||
* EditViewUtils.php and CRMEntity.php)!!
|
||||
*/
|
||||
getObj(dtlView).innerHTML = notaccess_label.join(", ");
|
||||
}else if(uitype == '19'){
|
||||
var desc = tagValue.replace(/(^|[\n ])([\w]+?:\/\/.*?[^ \"\n\r\t<]*)/g, "$1<a href=\"$2\" target=\"_blank\">$2</a>");
|
||||
desc = desc.replace(/(^|[\n ])((www|ftp)\.[\w\-]+\.[\w\-.\~]+(?:\/[^ \"\t\n\r<]*)?)/g, "$1<a href=\"http://$2\" target=\"_blank\">$2</a>");
|
||||
desc = desc.replace(/(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)/i, "$1<a href=\"mailto:$2@$3\">$2@$3</a>");
|
||||
desc = desc.replace(/,\"|\.\"|\)\"|\)\.\"|\.\)\"/, "\"");
|
||||
desc = desc.replace(/[\n\r]+/g, "<br> ");
|
||||
getObj(dtlView).innerHTML = desc;
|
||||
}
|
||||
else
|
||||
{
|
||||
getObj(dtlView).innerHTML = tagValue.replace(/[\n\r]+/g, "<br> ");
|
||||
}
|
||||
showHide(dtlView,editArea); //show,hide
|
||||
itsonview=false;
|
||||
}
|
||||
|
||||
function SaveTag(tagfield,crmId,module)
|
||||
{
|
||||
var tagValue = $(tagfield).value;
|
||||
tagValue = encodeURIComponent(tagValue);
|
||||
$("vtbusy_info").style.display="inline";
|
||||
new Ajax.Request(
|
||||
'index.php',
|
||||
{queue: {position: 'end', scope: 'command'},
|
||||
method: 'post',
|
||||
postBody: "file=TagCloud&module=" + module + "&action=" + module + "Ajax&recordid=" + crmId + "&ajxaction=SAVETAG&tagfields=" +tagValue,
|
||||
onComplete: function(response) {
|
||||
if(response.responseText.indexOf(":#:FAILURE") > -1)
|
||||
{
|
||||
alert(alert_arr.VALID_DATA)
|
||||
}else{
|
||||
getObj('tagfields').innerHTML = response.responseText;
|
||||
$(tagfield).value = '';
|
||||
}
|
||||
$("vtbusy_info").style.display="none";
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
function setSelectValue(fieldLabel)
|
||||
{
|
||||
if(globaluitype == 53)
|
||||
{
|
||||
if(typeof(document.DetailView.assigntype[0]) != 'undefined')
|
||||
{
|
||||
var assign_type_U = document.DetailView.assigntype[0].checked;
|
||||
var assign_type_G = document.DetailView.assigntype[1].checked;
|
||||
if(assign_type_U == true)
|
||||
var selCombo= 'txtbox_U'+fieldLabel;
|
||||
else if(assign_type_G == true)
|
||||
var selCombo= 'txtbox_G'+fieldLabel;
|
||||
}else
|
||||
{
|
||||
var selCombo= 'txtbox_U'+fieldLabel;
|
||||
}
|
||||
}else
|
||||
{
|
||||
var selCombo= 'txtbox_'+fieldLabel;
|
||||
}
|
||||
var hdTxtBox = 'hdtxt_'+fieldLabel;
|
||||
var oHdTxtBox = document.getElementById(hdTxtBox);
|
||||
var oSelCombo = document.getElementById(selCombo);
|
||||
|
||||
oHdTxtBox.value = oSelCombo.options[oSelCombo.selectedIndex].text;
|
||||
}
|
||||
|
||||
//Added to ajax edit the folder name in Documents Module
|
||||
function hndMouseClick(fieldLabel)
|
||||
{
|
||||
var mouseArea="";
|
||||
mouseArea="mouseArea_"+ fieldLabel;
|
||||
if(itsonview)
|
||||
{
|
||||
return;
|
||||
}
|
||||
globaldtlviewspanid= "dtlview_"+ fieldLabel;//valuespanid;
|
||||
globaleditareaspanid="editarea_"+ fieldLabel;//textareapanid;
|
||||
globalfieldlabel = fieldLabel;
|
||||
globaltxtboxid="txtbox_"+ fieldLabel;//textboxpanid;
|
||||
$(globaltxtboxid).value = $(globaldtlviewspanid).innerHTML;
|
||||
handleEdit();
|
||||
$(globaltxtboxid).select();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,297 @@
|
||||
/*********************************************************************************
|
||||
|
||||
** 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.
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
var alert_arr = { DELETE:'Are you sure you want to delete the selected ',
|
||||
RECORDS:' records?',
|
||||
SELECT:'Please select at least one entity',
|
||||
DELETE_ACCOUNT:'Deleting this account(s) will remove its related Potentials & Quotes. Are you sure you want to delete the selected ',
|
||||
DELETE_VENDOR:'Deleting this vendor(s) will remove its related Purchase Orders. Are you sure you want to delete the selected ',
|
||||
SELECT_MAILID:'Please Select a mailid',
|
||||
OVERWRITE_EXISTING_ACCOUNT1:'Overwrite the existing address with this selected account(',
|
||||
OVERWRITE_EXISTING_ACCOUNT2:') address details?',
|
||||
OVERWRITE_EXISTING_CONTACT1:'Overwrite the existing address with this selected contact(',
|
||||
OVERWRITE_EXISTING_CONTACT2:') address details?',
|
||||
MISSING_FIELDS:'Missing required fields:',
|
||||
NOT_ALLOWED_TO_EDIT:'you are not allowed to edit this field',
|
||||
NOT_ALLOWED_TO_EDIT_FIELDS:'you are not allowed to edit the field(s)',
|
||||
COLUMNS_CANNOT_BE_EMPTY:'Selected Columns cannot be empty',
|
||||
CANNOT_BE_EMPTY:' cannot be empty',
|
||||
CANNOT_BE_NONE:' cannot be none',
|
||||
ENTER_VALID:'Please enter a valid ',
|
||||
SHOULDBE_LESS:' should be less than ',
|
||||
SHOULDBE_LESS_EQUAL:' should be less than or equal to ',
|
||||
SHOULDBE_EQUAL:' should be equal to ',
|
||||
SHOULDBE_GREATER:' should be greater than ',
|
||||
SHOULDBE_GREATER_EQUAL:' should be greater than or equal to ',
|
||||
INVALID:'Invalid ',
|
||||
EXCEEDS_MAX:' exceeds the maximum limit ',
|
||||
OUT_OF_RANGE:' is out of range',
|
||||
SHOULDNOTBE_EQUAL:' should not be equal to ',
|
||||
PORTAL_PROVIDE_EMAILID:'Please provide valid Email Id to enable Portal User',
|
||||
ADD_CONFIRMATION:'Are you sure you want to add the selected ',
|
||||
ACCOUNTNAME_CANNOT_EMPTY:'AccountName Cannot be Empty',
|
||||
CANT_SELECT_CONTACTS:"You can\'t select related contacts from Lead",
|
||||
LBL_THIS:'This ',
|
||||
DOESNOT_HAVE_MAILIDS:" doesn\'t have any mail ids",
|
||||
ARE_YOU_SURE:'Are you sure?',
|
||||
DOESNOT_HAVE_AN_MAILID:'" '+"doesn\'t have an Email Id",
|
||||
MISSING_REQUIRED_FIELDS:'Missing required fields: ',
|
||||
READONLY:"it\'s readonly",
|
||||
SELECT_ATLEAST_ONE_USER:'Please select at least one user',
|
||||
DISABLE_SHARING_CONFIRMATION:'Are you sure you want to disable sharing for selected ',
|
||||
USERS:' user(s) ?',
|
||||
ENDTIME_GREATER_THAN_STARTTIME:'End Time should be greater than Start Time ',
|
||||
FOLLOWUPTIME_GREATER_THAN_STARTTIME:'Followup Time should be greater than End Time ',
|
||||
MISSING_EVENT_NAME:'Missing Event Name',
|
||||
EVENT_TYPE_NOT_SELECTED:'Event Type is not selected',
|
||||
CLOSEDATE_CANNOT_BE_EMPTY:'Close Date field cannot be empty',
|
||||
SITEURL_CANNOT_BE_EMPTY:'Site Url cannot be empty',
|
||||
SITENAME_CANNOT_BE_EMPTY:'Site Name cannot be empty',
|
||||
LISTPRICE_CANNOT_BE_EMPTY:'List Price cannot be empty',
|
||||
INVALID_LIST_PRICE:'Invalid List Price',
|
||||
PROBLEM_ACCESSSING_URL:'Problem accessing url: ',
|
||||
CODE:' Code: ',
|
||||
WISH_TO_QUALIFY_MAIL_AS_CONTACT:'Are you sure you wish to Qualify this Mail as Contact?',
|
||||
SELECT_ATLEAST_ONEMSG_TO_DEL:'Please select at least one message to delete',
|
||||
ERROR:'Error',
|
||||
FIELD_TYPE_NOT_SELECTED:'Field Type is not selected',
|
||||
SPECIAL_CHARACTERS_NOT_ALLOWED:'Special characters are not allowed in Label field',
|
||||
SPECIAL_CHARACTERS:'Special characters',
|
||||
NOT_ALLOWED:'are not allowed. Please try with some other values',
|
||||
PICKLIST_CANNOT_BE_EMPTY:'Picklist value cannot be empty',
|
||||
DUPLICATE_VALUES_FOUND:'Duplicate Values found',
|
||||
DUPLICATE_MAPPING_ACCOUNTS:'Duplicate mapping for accounts!!',
|
||||
DUPLICATE_MAPPING_CONTACTS:'Duplicate mapping for Contacts!!',
|
||||
DUPLICATE_MAPPING_POTENTIAL:'Duplicate mapping for Potential!!',
|
||||
ERROR_WHILE_EDITING:'Error while Editing',
|
||||
CURRENCY_CHANGE_INFO:'Currency Changes has been made Successfully',
|
||||
CURRENCY_CONVERSION_INFO:'Are you using Dollar $ as Currency? \n Click OK to remain as $, Cancel to change the currency conversion rate.',
|
||||
THE_EMAILID: "The email id \'",
|
||||
EMAIL_FIELD_INVALID:"\' in the email field is invalid",
|
||||
MISSING_REPORT_NAME:'Missing Report Name',
|
||||
REPORT_NAME_EXISTS:'Report name already exists, try again...',
|
||||
WANT_TO_CHANGE_CONTACT_ADDR:'Do you want to change the addresses of the Contacts related to this Account?',
|
||||
SURE_TO_DELETE:'Are you sure you want to delete ?',
|
||||
NO_PRODUCT_SELECTED:'No product is selected. Select at least one Product',
|
||||
VALID_FINAL_PERCENT:'Enter valid Final Discount Percentage',
|
||||
VALID_FINAL_AMOUNT:'Enter valid Final Discount Amount',
|
||||
VALID_SHIPPING_CHARGE:'Enter a valid Shipping & Handling charge',
|
||||
VALID_ADJUSTMENT:'Enter a valid Adjustment',
|
||||
WANT_TO_CONTINUE:'Do you want to Continue?',
|
||||
ENTER_VALID_TAX:'Please enter Valid TAX value',
|
||||
VALID_TAX_NAME:'Enter valid Tax Name',
|
||||
CORRECT_TAX_VALUE:'Enter Correct Tax Value',
|
||||
ENTER_POSITIVE_VALUE:'Please enter positive value',
|
||||
LABEL_SHOULDNOT_EMPTY:'The tax label name should not be empty',
|
||||
NOT_VALID_ENTRY:'is not a valid entry. Please enter correct value',
|
||||
VALID_DISCOUNT_PERCENT:'Enter a valid Discount percentage',
|
||||
VALID_DISCOUNT_AMOUNT:'Enter a valid Discount Amount',
|
||||
SELECT_TEMPLATE_TO_MERGE:'Please select a template to merge',
|
||||
SELECTED_MORE_THAN_ONCE:'You have selected the following item(s) more than once.',
|
||||
YES:'yes',
|
||||
NO:'no',
|
||||
MAIL:'mail',
|
||||
EQUALS:'equals',
|
||||
NOT_EQUALS_TO:'not equal to',
|
||||
STARTS_WITH:'starts with',
|
||||
CONTAINS:'contains',
|
||||
DOES_NOT_CONTAINS:'does not contains',
|
||||
LESS_THAN:'less than',
|
||||
GREATER_THAN:'greater than',
|
||||
LESS_OR_EQUALS:'less or equal',
|
||||
GREATER_OR_EQUALS:'greater or equal',
|
||||
|
||||
NO_SPECIAL_CHARS:'Special Characters are not allowed in Invoice String',
|
||||
PLS_SELECT_VALID_FILE:'Please select a file with the following extension:\n',
|
||||
NO_SPECIAL:'Special Characters are not allowed',
|
||||
NO_QUOTES:'Quotes (\' ") and + symbol are not allowed ',
|
||||
IN_PROFILENAME:' in Profile Name',
|
||||
IN_GROUPNAME:' in Group Name',
|
||||
IN_ROLENAME:' in Role Name',
|
||||
VALID_TAX_PERCENT:'Enter a valid Tax percentage',
|
||||
VALID_SH_TAX:'Enter valid Taxes for shipping and handling ',
|
||||
ROLE_DRAG_ERR_MSG:'You cannot move a Parent Node under a Child Node',
|
||||
LBL_DEL:'del',
|
||||
VALID_DATA :' Enter Valid Data ,Please try again... ',
|
||||
STDFILTER : 'Standard Filters',
|
||||
STARTDATE : 'Start Date',
|
||||
ENDDATE : 'End Date',
|
||||
START_DATE_TIME : 'Start Date & Time',
|
||||
START_TIME : 'Start Time',
|
||||
DATE_SHOULDNOT_PAST :'Current date & time for Activities with status as Planned',
|
||||
TIME_SHOULDNOT_PAST :'Current Time for Activities with status as Planned',
|
||||
LBL_AND : 'And',
|
||||
LBL_ENTER_VALID_PORT: 'Please enter valid port number',
|
||||
IN_USERNAME :' in Username ',
|
||||
LBL_ENTER_VALID_NO: 'Please enter valid number',
|
||||
LBL_PROVIDE_YES_NO: ' Invalid value.\n Please Provide Yes or No',
|
||||
LBL_SELECT_CRITERIA: ' Invalid criteria.\n Please select criteria',
|
||||
// Added/Updated for vtiger CRM 5.0.4
|
||||
OPPORTUNITYNAME_CANNOT_BE_EMPTY:'Potential Name field cannot be empty',
|
||||
OVERWRITE_EXISTING_ACCOUNT1:'Do you want to Overwrite the existing address with this selected account(',
|
||||
NAME_DESC:' for Folder Name & Description',
|
||||
ENDS_WITH:'ends with',
|
||||
SHARED_EVENT_DEL_MSG:'The User does not have permission to Edit/Delete Shared Event.',
|
||||
|
||||
|
||||
LBL_WRONG_IMAGE_TYPE: 'Allowed file types for Contacts - jpeg, png, jpg, pjpeg, x-png or gif',
|
||||
SELECT_MAIL_MOVE: 'Please select a mail and then move..',
|
||||
|
||||
LBL_NOTSEARCH_WITHSEARCH_ALL:'You haven\'t used the search. All the records will be Exported from ',
|
||||
LBL_NOTSEARCH_WITHSEARCH_CURRENTPAGE:'You haven\'t searched any thing. But you selected with search & current page options. So the records in the current page will be Exported from ',
|
||||
LBL_NO_DATA_SELECTED:'There is no record selected. Select at least one record to Export',
|
||||
LBL_SEARCH_WITHOUTSEARCH_ALL:'You have used search option but you have not selected without search & all options.\nYou can click [ok] to export all data or You can click [cancel] and try again with other export criteria',
|
||||
STOCK_IS_NOT_ENOUGH : 'Stock is not enough',
|
||||
INVALID_QTY : 'Invalid Qty',
|
||||
LBL_SEARCH_WITHOUTSEARCH_CURRENTPAGE:'You have used search option but you have not selected without search & currentpage options.\nYou can click [ok] to export current page data or You can click [cancel] and try again with some other export criteria.',
|
||||
LBL_SELECT_COLUMN: ' Invalid column.\n Please select column',
|
||||
LBL_NOT_ACCESSIBLE : 'Not Accessible',
|
||||
LBL_FILENAME_LENGTH_EXCEED_ERR: 'Filename cannot exceed 255 characters',
|
||||
LBL_DONT_HAVE_EMAIL_PERMISSION : "You don't have permission for Email field so you can't choose the email id",
|
||||
LBL_NO_FEEDS_SELECTED: 'No Feeds Selected',
|
||||
LBL_SELECT_PICKLIST:'Please select atleast one value to delete',
|
||||
LBL_CANT_REMOVE:'You can\'t remove all the values',
|
||||
|
||||
// Added after 5.0.4 GA
|
||||
|
||||
/*For global add/delete in picklist*/
|
||||
LBL_GIVE_PICKLIST_VALUE:'Please provide some value for the selected picklist to be replaced',
|
||||
LBL_SELECT_ROLE:'Please select atleast one role for which the new values are to be added',
|
||||
LBL_ADD_PICKLIST_VALUE:'Please provide atleast one new value to be added',
|
||||
LBL_NO_VALUES_TO_DELETE: "no values to delete",
|
||||
|
||||
/* For Duplicate merging feature */
|
||||
SAME_GROUPS: 'You have to select the records in the same groups for merging',
|
||||
ATLEAST_TWO: 'Select atleast two records for merging',
|
||||
MAX_THREE: 'You are allowed to select a maximum of three records',
|
||||
//PARENT_RECORD: 'Select a record as parent record', MergeFields.tpl Line:59
|
||||
MAX_RECORDS: 'You are allowed to select a maximum of four records',
|
||||
CON_MANDATORY: 'Select the mandatory field Last Name',
|
||||
LE_MANDATORY: 'Select the mandatory fields Last Name and Company',
|
||||
ACC_MANDATORY: 'Select the mandatory field Account Name',
|
||||
PRO_MANDATORY: 'Select the mandatory field Product Name',
|
||||
TIC_MANDATORY: 'Select the mandatory field Ticket Title',
|
||||
POTEN_MANDATORY: 'Select the mandatory field Potential Name',
|
||||
VEN_MANDATORY: 'Select the mandatory field Vendor Name',
|
||||
DEL_MANDATORY: 'You are not allowed to delete the mandatory field',
|
||||
|
||||
/* For Multi-Currency Support */
|
||||
MSG_CHANGE_CURRENCY_REVISE_UNIT_PRICE: 'Unit price of all the Currencies will be revised based on the selected Currency. Are you sure?',
|
||||
|
||||
Select_one_record_as_parent_record : 'Select one record as parent record',
|
||||
RECURRING_FREQUENCY_NOT_PROVIDED : 'Recurring frequency not provided',
|
||||
RECURRING_FREQNECY_NOT_ENABLED : 'Recurring frequency is provided, but recurring is not enabled',
|
||||
/* Added for Documents module */
|
||||
NO_SPECIAL_CHARS_DOCS:'Special characters like quotes, backslash, + symbol, % and ? are not allowed',
|
||||
FOLDER_NAME_TOO_LONG:'Folder name is too long. Try again!',
|
||||
FOLDERNAME_EMPTY:'The Folder name cannot be empty',
|
||||
DUPLICATE_FOLDER_NAME:'Trying to duplicate an existing folder name. Please try again !',
|
||||
FOLDER_DESCRIPTION_TOO_LONG:'Folder description is too long. Try again!',
|
||||
NOT_PERMITTED:"You are not permitted to execute this operation.",
|
||||
|
||||
ALL_FILTER_CREATION_DENIED:'Cannot create CustomView using name "All", try using different ViewName',
|
||||
OPERATION_DENIED:'You are denied to perform this operation',
|
||||
EMAIL_CHECK_MSG: 'Disable portal access to save the email field as blank',
|
||||
IS_PARENT : 'This Product has Sub Products, You are not allowed to choose a Parent for this Product',
|
||||
|
||||
/*global actions on picklist*/
|
||||
PICKLIST_CANNOT_BE_EMPTY: 'Picklist value cannot be empty',
|
||||
DUPLICATE_VALUES_FOUND: 'Duplicate Values found',
|
||||
LBL_NO_ROLES_SELECTED: 'No roles have been selected, do you wish to continue?',
|
||||
LBL_DUPLICATE_FOUND: 'Duplicate entries found for the value ',
|
||||
LBL_CANNOT_HAVE_EMPTY_VALUE: 'Cannot replace with blank value, to remove the value use Delete option.',
|
||||
LBL_DUPLICATE_VALUE_EXISTS: 'Duplicate value exists',
|
||||
LBL_WANT_TO_DELETE: "This will delete the selected picklist value(s) for all roles. You sure you want to continue? ",
|
||||
LBL_DELETE_ALL_WARNING: "Must have atleast one value for the picklist",
|
||||
LBL_PLEASE_CHANGE_REPLACEMENT: "please change the replacement value; it is also selected for delete",
|
||||
|
||||
/*layout Editor changes*/
|
||||
BLOCK_NAME_CANNOT_BE_BLANK : 'Block name can not be blank',
|
||||
ARE_YOU_SURE_YOU_WANT_TO_DELETE : 'Are you sure you want to delete ?',
|
||||
PLEASE_MOVE_THE_FIELDS_TO_ANOTHER_BLOCK : 'Please move the fields to another block',
|
||||
ARE_YOU_SURE_YOU_WANT_TO_DELETE_BLOCK : 'Are you sure you want to delete block?',
|
||||
LABEL_CANNOT_NOT_EMPTY : 'Label cannot be Emtpy',
|
||||
LBL_TYPEALERT_1 : 'Sorry, you cannot map the',
|
||||
LBL_WITH : 'with',
|
||||
LBL_TYPEALERT_2 : 'data type. Kindly map the same data types.',
|
||||
LBL_LENGTHALERT : 'Sorry, you can cannot map fields with different character size. Kindly map the data with same or more character size.',
|
||||
LBL_DECIMALALERT : 'Sorry, you can cannot map fields with different decimal places. Kindly map the data with same or more decimal places.',
|
||||
FIELD_IS_MANDATORY : 'Mandatory Field',
|
||||
FIELD_IS_ACTIVE : 'Field is available for use',
|
||||
FIELD_IN_QCREATE : 'Present in Quick Create',
|
||||
FIELD_IS_MASSEDITABLE : 'Available for Mass Edit',
|
||||
|
||||
IS_MANDATORY_FIELD : 'is Mandatory Field',
|
||||
CLOSEDATE_CANNOT_BE_EMPTY : 'Closing Date cannot be Empty',
|
||||
AMOUNT_CANNOT_BE_EMPTY : 'Amount cannot be Empty',
|
||||
ARE_YOU_SURE : 'Are You Sure You want to Delete?',
|
||||
LABEL_ALREADY_EXISTS : 'Label already exists. Please specify a different Label',
|
||||
LENGTH_OUT_OF_RANGE : 'Length of the Block should be less than 50 characters',
|
||||
LBL_SELECT_ONE_FILE : 'Please select atleast one File',
|
||||
LBL_UNABLE_TO_ADD_FOLDER : 'Unable to add Folder. Please try again.',
|
||||
LBL_ARE_YOU_SURE_YOU_WANT_TO_DELETE_FOLDER : 'Are you sure you want to delete the folder?',
|
||||
LBL_ERROR_WHILE_DELETING_FOLDER : 'Error while deleting the folder.Please try again later.',
|
||||
LBL_FILE_CAN_BE_DOWNLOAD : 'File is available for download',
|
||||
LBL_DOCUMENT_LOST_INTEGRITY:'This Documents is not available. It will be marked as Inactive',
|
||||
LBL_DOCUMENT_NOT_AVAILABLE : 'This Document is not available for Download',
|
||||
LBL_FOLDER_SHOULD_BE_EMPTY : 'Folder should be empty to remove it!',
|
||||
|
||||
LBL_PLEASE_SELECT_FILE_TO_UPLOAD : 'Please select the file to upload.',
|
||||
LBL_ARE_YOU_SURE_TO_MOVE_TO : 'Are you sure you want to move the file(s) to ',
|
||||
LBL_FOLDER : ' folder',
|
||||
LBL_UNABLE_TO_UPDATE : 'Unable to update! Please try it again.',
|
||||
LBL_BLANK_REPLACEMENT: "Cannot select blank value for replacement",
|
||||
|
||||
LBL_IMAGE_DELETED : 'Image Deleted',
|
||||
|
||||
/* Tooltip management */
|
||||
ERR_FIELD_SELECTION : 'Some error in field selection',
|
||||
|
||||
/* Inventory validation strings */
|
||||
NO_LINE_ITEM_SELECTED : 'No line item is selected. Please select at least one line item.',
|
||||
LINE_ITEM : 'Line item',
|
||||
LIST_PRICE: 'List Price',
|
||||
|
||||
/* Webmails */
|
||||
LBL_PRINT_EMAIL : 'Print',
|
||||
LBL_DELETE_EMAIL : 'Delete',
|
||||
LBL_DOWNLOAD_ATTACHMENTS : 'Download Attachments',
|
||||
LBL_QUALIFY_EMAIL : 'Qualify',
|
||||
LBL_FORWARD_EMAIL : 'Forward',
|
||||
LBL_REPLY_TO_SENDER : 'Reply To Sender',
|
||||
LBL_REPLY_TO_ALL : 'Reply To All',
|
||||
|
||||
LBL_WIDGET_HIDDEN : 'Widget Hidden',
|
||||
LBL_RESTORE_FROM_PREFERENCES : 'You can restore it from your preferences',
|
||||
ERR_HIDING : 'Error while hiding',
|
||||
MSG_TRY_AGAIN : 'Please try again',
|
||||
|
||||
MSG_ENABLE_SINGLEPANE_VIEW : 'Singlepane View Enabled',
|
||||
MSG_DISABLE_SINGLEPANE_VIEW : 'Singlepane View Disabled',
|
||||
|
||||
MSG_FTP_BACKUP_DISABLED : 'FTP Backup Disabled',
|
||||
MSG_LOCAL_BACKUP_DISABLED : 'Local Backup Disabled',
|
||||
MSG_FTP_BACKUP_ENABLED : 'FTP Backup Enabled',
|
||||
MSG_LOCAL_BACKUP_ENABLED : 'Local Backup Enabled',
|
||||
MSG_CONFIRM_PATH : 'confirm with the Path details',
|
||||
MSG_CONFIRM_FTP_DETAILS : 'confirm with the FTP details',
|
||||
|
||||
START_PERIOD_END_PERIOD_CANNOT_BE_EMPTY : 'Start period or End period cannot be empty',
|
||||
|
||||
/* added to fix i18n issues with home page*/
|
||||
LBL_ADD: 'Add ',
|
||||
Module: 'Module',
|
||||
DashBoard: 'DashBoard',
|
||||
RSS: 'RSS',
|
||||
Default: 'Default',
|
||||
Notebook: 'Notebook',
|
||||
SPECIAL_CHARS:'\\ / < > + \' " '
|
||||
};
|
||||
@@ -0,0 +1,263 @@
|
||||
/*
|
||||
json2.js
|
||||
2007-11-06
|
||||
|
||||
Public Domain
|
||||
|
||||
See http://www.JSON.org/js.html
|
||||
|
||||
This file creates a global JSON object containing two methods:
|
||||
|
||||
JSON.stringify(value, whitelist)
|
||||
value any JavaScript value, usually an object or array.
|
||||
|
||||
whitelist an optional that determines how object values are
|
||||
stringified.
|
||||
|
||||
This method produces a JSON text from a JavaScript value.
|
||||
There are three possible ways to stringify an object, depending
|
||||
on the optional whitelist parameter.
|
||||
|
||||
If an object has a toJSON method, then the toJSON() method will be
|
||||
called. The value returned from the toJSON method will be
|
||||
stringified.
|
||||
|
||||
Otherwise, if the optional whitelist parameter is an array, then
|
||||
the elements of the array will be used to select members of the
|
||||
object for stringification.
|
||||
|
||||
Otherwise, if there is no whitelist parameter, then all of the
|
||||
members of the object will be stringified.
|
||||
|
||||
Values that do not have JSON representaions, such as undefined or
|
||||
functions, will not be serialized. Such values in objects will be
|
||||
dropped, in arrays will be replaced with null. JSON.stringify()
|
||||
returns undefined. Dates will be stringified as quoted ISO dates.
|
||||
|
||||
Example:
|
||||
|
||||
var text = JSON.stringify(['e', {pluribus: 'unum'}]);
|
||||
// text is '["e",{"pluribus":"unum"}]'
|
||||
|
||||
JSON.parse(text, filter)
|
||||
This method parses a JSON text to produce an object or
|
||||
array. It can throw a SyntaxError exception.
|
||||
|
||||
The optional filter parameter is a function that can filter and
|
||||
transform the results. It receives each of the keys and values, and
|
||||
its return value is used instead of the original value. If it
|
||||
returns what it received, then structure is not modified. If it
|
||||
returns undefined then the member is deleted.
|
||||
|
||||
Example:
|
||||
|
||||
// Parse the text. If a key contains the string 'date' then
|
||||
// convert the value to a date.
|
||||
|
||||
myData = JSON.parse(text, function (key, value) {
|
||||
return key.indexOf('date') >= 0 ? new Date(value) : value;
|
||||
});
|
||||
|
||||
This is a reference implementation. You are free to copy, modify, or
|
||||
redistribute.
|
||||
|
||||
Use your own copy. It is extremely unwise to load third party
|
||||
code into your pages.
|
||||
*/
|
||||
|
||||
/*jslint evil: true */
|
||||
/*extern JSON */
|
||||
|
||||
if (!this.JSON) {
|
||||
|
||||
JSON = function () {
|
||||
|
||||
function f(n) { // Format integers to have at least two digits.
|
||||
return n < 10 ? '0' + n : n;
|
||||
}
|
||||
|
||||
Date.prototype.toJSON = function () {
|
||||
|
||||
// Eventually, this method will be based on the date.toISOString method.
|
||||
|
||||
return this.getUTCFullYear() + '-' +
|
||||
f(this.getUTCMonth() + 1) + '-' +
|
||||
f(this.getUTCDate()) + 'T' +
|
||||
f(this.getUTCHours()) + ':' +
|
||||
f(this.getUTCMinutes()) + ':' +
|
||||
f(this.getUTCSeconds()) + 'Z';
|
||||
};
|
||||
|
||||
|
||||
var m = { // table of character substitutions
|
||||
'\b': '\\b',
|
||||
'\t': '\\t',
|
||||
'\n': '\\n',
|
||||
'\f': '\\f',
|
||||
'\r': '\\r',
|
||||
'"' : '\\"',
|
||||
'\\': '\\\\'
|
||||
};
|
||||
|
||||
function stringify(value, whitelist) {
|
||||
var a, // The array holding the partial texts.
|
||||
i, // The loop counter.
|
||||
k, // The member key.
|
||||
l, // Length.
|
||||
r = /["\\\x00-\x1f\x7f-\x9f]/g,
|
||||
v; // The member value.
|
||||
|
||||
switch (typeof value) {
|
||||
case 'string':
|
||||
|
||||
// If the string contains no control characters, no quote characters, and no
|
||||
// backslash characters, then we can safely slap some quotes around it.
|
||||
// Otherwise we must also replace the offending characters with safe sequences.
|
||||
|
||||
return r.test(value) ?
|
||||
'"' + value.replace(r, function (a) {
|
||||
var c = m[a];
|
||||
if (c) {
|
||||
return c;
|
||||
}
|
||||
c = a.charCodeAt();
|
||||
return '\\u00' + Math.floor(c / 16).toString(16) +
|
||||
(c % 16).toString(16);
|
||||
}) + '"' :
|
||||
'"' + value + '"';
|
||||
|
||||
case 'number':
|
||||
|
||||
// JSON numbers must be finite. Encode non-finite numbers as null.
|
||||
|
||||
return isFinite(value) ? String(value) : 'null';
|
||||
|
||||
case 'boolean':
|
||||
case 'null':
|
||||
return String(value);
|
||||
|
||||
case 'object':
|
||||
|
||||
// Due to a specification blunder in ECMAScript,
|
||||
// typeof null is 'object', so watch out for that case.
|
||||
|
||||
if (!value) {
|
||||
return 'null';
|
||||
}
|
||||
|
||||
// If the object has a toJSON method, call it, and stringify the result.
|
||||
|
||||
if (typeof value.toJSON === 'function') {
|
||||
return stringify(value.toJSON());
|
||||
}
|
||||
a = [];
|
||||
if (typeof value.length === 'number' &&
|
||||
!(value.propertyIsEnumerable('length'))) {
|
||||
|
||||
// The object is an array. Stringify every element. Use null as a placeholder
|
||||
// for non-JSON values.
|
||||
|
||||
l = value.length;
|
||||
for (i = 0; i < l; i += 1) {
|
||||
a.push(stringify(value[i], whitelist) || 'null');
|
||||
}
|
||||
|
||||
// Join all of the elements together and wrap them in brackets.
|
||||
|
||||
return '[' + a.join(',') + ']';
|
||||
}
|
||||
if (whitelist) {
|
||||
|
||||
// If a whitelist (array of keys) is provided, use it to select the components
|
||||
// of the object.
|
||||
|
||||
l = whitelist.length;
|
||||
for (i = 0; i < l; i += 1) {
|
||||
k = whitelist[i];
|
||||
if (typeof k === 'string') {
|
||||
v = stringify(value[k], whitelist);
|
||||
if (v) {
|
||||
a.push(stringify(k) + ':' + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
// Otherwise, iterate through all of the keys in the object.
|
||||
|
||||
for (k in value) {
|
||||
if (typeof k === 'string') {
|
||||
v = stringify(value[k], whitelist);
|
||||
if (v) {
|
||||
a.push(stringify(k) + ':' + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Join all of the member texts together and wrap them in braces.
|
||||
|
||||
return '{' + a.join(',') + '}';
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return {
|
||||
stringify: stringify,
|
||||
parse: function (text, filter) {
|
||||
var j;
|
||||
|
||||
function walk(k, v) {
|
||||
var i, n;
|
||||
if (v && typeof v === 'object') {
|
||||
for (i in v) {
|
||||
if (Object.prototype.hasOwnProperty.apply(v, [i])) {
|
||||
n = walk(i, v[i]);
|
||||
if (n !== undefined) {
|
||||
v[i] = n;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return filter(k, v);
|
||||
}
|
||||
|
||||
|
||||
// Parsing happens in three stages. In the first stage, we run the text against
|
||||
// regular expressions that look for non-JSON patterns. We are especially
|
||||
// concerned with '()' and 'new' because they can cause invocation, and '='
|
||||
// because it can cause mutation. But just to be safe, we want to reject all
|
||||
// unexpected forms.
|
||||
|
||||
// We split the first stage into 4 regexp operations in order to work around
|
||||
// crippling inefficiencies in IE's and Safari's regexp engines. First we
|
||||
// replace all backslash pairs with '@' (a non-JSON character). Second, we
|
||||
// replace all simple value tokens with ']' characters. Third, we delete all
|
||||
// open brackets that follow a colon or comma or that begin the text. Finally,
|
||||
// we look to see that the remaining characters are only whitespace or ']' or
|
||||
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
|
||||
|
||||
if (/^[\],:{}\s]*$/.test(text.replace(/\\./g, '@').
|
||||
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(:?[eE][+\-]?\d+)?/g, ']').
|
||||
replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
|
||||
|
||||
// In the second stage we use the eval function to compile the text into a
|
||||
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
|
||||
// in JavaScript: it can begin a block or an object literal. We wrap the text
|
||||
// in parens to eliminate the ambiguity.
|
||||
|
||||
j = eval('(' + text + ')');
|
||||
|
||||
// In the optional third stage, we recursively walk the new structure, passing
|
||||
// each name/value pair to a filter function for possible transformation.
|
||||
|
||||
return typeof filter === 'function' ? walk('', j) : j;
|
||||
}
|
||||
|
||||
// If the text is not JSON parseable, then a SyntaxError is thrown.
|
||||
|
||||
throw new SyntaxError('parseJSON');
|
||||
}
|
||||
};
|
||||
}();
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
/*********************************************************************************
|
||||
** 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.
|
||||
*
|
||||
********************************************************************************/
|
||||
// JavaScript Document
|
||||
//Layer Function
|
||||
/* NEW SCRIPT FOR MENU SLIDE */
|
||||
|
||||
var menu_i;
|
||||
var menu_max;
|
||||
var closeLimit;
|
||||
var openLimit = 0;
|
||||
|
||||
function fnSlide(obj,inner)
|
||||
{
|
||||
var buff = document.getElementById(obj).width;
|
||||
closeLimit = buff.substring(0,buff.length-1);
|
||||
menu_max = eval(closeLimit);
|
||||
var tagName = document.getElementById(inner);
|
||||
document.getElementById(obj).style.width=0 + "%"; menu_i=0;
|
||||
if (tagName.style.display == 'none')
|
||||
fnexpanLay(obj,inner);
|
||||
else
|
||||
fncloseLay(obj,inner);
|
||||
}
|
||||
|
||||
function fnexpanLay(obj,inner)
|
||||
{
|
||||
var setText = eval(closeLimit) - 1;
|
||||
if (menu_i<=eval(closeLimit))
|
||||
{
|
||||
if (menu_i>setText){document.getElementById(inner).style.display='block';}
|
||||
document.getElementById(obj).style.width=menu_i+"%";
|
||||
setTimeout(function() { fnexpanLay(obj,inner); },5);
|
||||
menu_i=menu_i+1;
|
||||
}
|
||||
}
|
||||
|
||||
function fncloseLay(obj,inner)
|
||||
{
|
||||
if (menu_max >= eval(openLimit))
|
||||
{
|
||||
if (menu_max<eval(closeLimit)){document.getElementById(inner).style.display='none';}
|
||||
document.getElementById(obj).style.width=menu_max +"%";
|
||||
setTimeout(function() { fncloseLay(obj,inner); }, 5);
|
||||
menu_max = menu_max -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* NEW SCRIPT FOR MENU WIPE */
|
||||
|
||||
var wipe_i;
|
||||
var wipe_max;
|
||||
var closeLimit;
|
||||
var openLimit = 0;
|
||||
|
||||
function fnWipe(obj,inner)
|
||||
{
|
||||
var buff = document.getElementById(inner).style.height;
|
||||
closeLimit = buff.substring(0,buff.length-2);
|
||||
wipe_max = eval(closeLimit);
|
||||
var tagName = document.getElementById(inner);
|
||||
document.getElementById(obj).style.height=0 + "px"; wipe_i=0;
|
||||
if (tagName.style.display == 'none')
|
||||
fnWipeLay(obj,inner);
|
||||
else
|
||||
fnUnWipeLay(obj,inner);
|
||||
}
|
||||
|
||||
function fnWipeLay(obj,inner)
|
||||
{
|
||||
var setText = eval(closeLimit) - 1;
|
||||
if (wipe_i<=eval(closeLimit))
|
||||
{
|
||||
if (wipe_i>setText){document.getElementById(inner).style.display='block';}
|
||||
document.getElementById(obj).style.height=wipe_i+"px";
|
||||
setTimeout(function() { fnWipeLay(obj,inner); },5);
|
||||
wipe_i = wipe_i + 5;
|
||||
}
|
||||
}
|
||||
|
||||
function fnUnWipeLay(obj,inner)
|
||||
{
|
||||
if (wipe_max >= eval(openLimit))
|
||||
{
|
||||
if (wipe_max<eval(closeLimit)){document.getElementById(inner).style.display='none';}
|
||||
document.getElementById(obj).style.height = wipe_max + "px";
|
||||
setTimeout(function() { fnUnWipeLay(obj,inner); }, 5);
|
||||
wipe_max = wipe_max - 5;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function fnSlide1(obj,inner)
|
||||
{
|
||||
var buff = document.getElementById(obj).width;
|
||||
closeLimit = buff.substring(0,buff.length);
|
||||
menu_max = eval(closeLimit);
|
||||
var tagName = document.getElementById(inner);
|
||||
document.getElementById(obj).style.width=0 + "px"; menu_i=0;
|
||||
if (tagName.style.display == 'none')
|
||||
fnexpanLay1(obj,inner);
|
||||
else
|
||||
fncloseLay1(obj,inner);
|
||||
}
|
||||
|
||||
function fnexpanLay1(obj,inner)
|
||||
{
|
||||
document.getElementById(obj).style.display = 'block';
|
||||
var setText = eval(closeLimit) - 1;
|
||||
if (menu_i<=eval(closeLimit))
|
||||
{
|
||||
if (menu_i>setText){document.getElementById(inner).style.display='block';}
|
||||
document.getElementById(obj).style.width=menu_i + "px";
|
||||
setTimeout(function() { fnexpanLay1(obj,inner); },5);
|
||||
menu_i=menu_i+14;
|
||||
}
|
||||
}
|
||||
|
||||
function fncloseLay1(obj,inner)
|
||||
{
|
||||
if (menu_max >= eval(openLimit))
|
||||
{
|
||||
if (menu_max<eval(closeLimit)){document.getElementById(inner).style.display='none';}
|
||||
document.getElementById(obj).style.width=menu_max +"px";
|
||||
setTimeout(function() { fncloseLay1(obj,inner); }, 5);
|
||||
menu_max = menu_max -14;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/*********************************************************************************
|
||||
** 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.
|
||||
********************************************************************************/
|
||||
/**
|
||||
* this file contains all the utility functions for notebook
|
||||
*/
|
||||
|
||||
/**
|
||||
* this function saves the contents of the notebook and restores the div once the control is moved out of the textarea
|
||||
* @param object node - the textarea div
|
||||
*/
|
||||
function saveContents(node, notebookid) {
|
||||
var contents = node.value;
|
||||
new Ajax.Request(
|
||||
'index.php',
|
||||
{
|
||||
queue: {position: 'end', scope: 'command'},
|
||||
method: 'post',
|
||||
postBody:'module=Home&action=HomeAjax&file=SaveNotebookContents&contents='+encodeURIComponent(contents)+'¬ebookid='+notebookid,
|
||||
onComplete: function(response){
|
||||
if(response.responseText == false){
|
||||
alert("Some error has occurred during save");
|
||||
}else{
|
||||
//success
|
||||
node.style.display = 'none';
|
||||
|
||||
temp = $('notebook_contents_'+notebookid);
|
||||
temp.style.display = 'block';
|
||||
temp.innerHTML = contents;
|
||||
$('notebook_'+notebookid).style.display = 'block';
|
||||
|
||||
var notebook_dbl_click_message = $('notebook_dbl_click_message');
|
||||
var notebook_save_message = $('notebook_save_message');
|
||||
notebook_dbl_click_message.style.display = 'block';
|
||||
notebook_save_message.style.display = 'none';
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
/**
|
||||
* this function changes the div of the notebook to a textarea when double-clicked
|
||||
* @param object node - the notebook div
|
||||
*/
|
||||
function editContents(node, notebookid) {
|
||||
var notebook = $('notebook_textarea_'+notebookid);
|
||||
var contents = $('notebook_contents_'+notebookid);
|
||||
var notebook_dbl_click_message = $('notebook_dbl_click_message');
|
||||
var notebook_save_message = $('notebook_save_message');
|
||||
|
||||
notebook.value = contents.innerHTML;
|
||||
node.style.display = 'none';
|
||||
notebook.style.display = 'block';
|
||||
notebook_dbl_click_message.style.display = 'none';
|
||||
notebook_save_message.style.display = 'block';
|
||||
|
||||
notebook.focus();
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
|
||||
/**
|
||||
* this function takes a node and displays it as a popup in the right-hand side corner of the window
|
||||
*
|
||||
* @param node - the node to display as popup
|
||||
*/
|
||||
function _defPopup(){
|
||||
var maxheight = 75; //maximum height of the popup
|
||||
var incrementHeight = 2; //incremental height of the popup
|
||||
var remainOnScreen = 10 * 1000; //the time for which the popup remains on screen
|
||||
var randomID = Math.floor(Math.random()*10001);
|
||||
|
||||
var popupDiv = document.createElement('div');
|
||||
var parentDiv = document.getElementById('notificationDiv');
|
||||
parentDiv.appendChild(popupDiv);
|
||||
popupDiv.id = randomID;
|
||||
popupDiv.className = "lvtCol";
|
||||
popupDiv.style.float="right";
|
||||
popupDiv.style.paddingRight="5px";
|
||||
popupDiv.style.overflow="hidden";
|
||||
popupDiv.style.right="0px";
|
||||
popupDiv.style.bottom="0px";
|
||||
popupDiv.style.borderColor="rgb(141, 141, 141)";
|
||||
popupDiv.style.borderTop="1px black solid";
|
||||
popupDiv.style.borderBottom="1px black solid";
|
||||
popupDiv.style.padding="2px";
|
||||
popupDiv.style.zIndex=10;
|
||||
popupDiv.style.fontWeight="normal";
|
||||
popupDiv.align="left"; //the popup to be displayed on screen
|
||||
var node;
|
||||
|
||||
/**
|
||||
* this function creates a popup div and displays in on the screen
|
||||
* after a timeinterval of time seconds the popup is hidden
|
||||
*
|
||||
* @param node - the node to display
|
||||
* @param height - the maximum height of the popup
|
||||
* @param time - the time for which it is displayed
|
||||
*/
|
||||
function CreatePopup(node, time){
|
||||
parentDiv.style.display = "block";
|
||||
if(time != undefined && time != ""){
|
||||
remainOnScreen = time * 1000;
|
||||
}
|
||||
popupDiv.innerHTML = node;
|
||||
popupDiv.style.display = "block";
|
||||
popupDiv.style.display = "";
|
||||
var dimension = getDimension(popupDiv);
|
||||
maxheight = dimension.y;
|
||||
|
||||
popupDiv.style.height = "0px";
|
||||
ShowPopup();
|
||||
}
|
||||
|
||||
/**
|
||||
* this function is used to display the popup on screen
|
||||
*/
|
||||
function ShowPopup(){
|
||||
var height = popupDiv.style.height.substring(0,popupDiv.style.height.indexOf("px"));
|
||||
if (parseInt(height) < maxheight) {
|
||||
height = parseInt(height) + incrementHeight;
|
||||
if(height > maxheight){
|
||||
height = maxheight;
|
||||
}
|
||||
popupDiv.style.height = height + "px";
|
||||
setTimeout(ShowPopup, 1);
|
||||
} else {
|
||||
popupDiv.style.height = maxheight + "px";
|
||||
setTimeout(HidePopup, remainOnScreen);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* this function is used to hide the popup from screen
|
||||
*/
|
||||
function HidePopup(){
|
||||
var height = popupDiv.style.height.substring(0,popupDiv.style.height.indexOf("px"));
|
||||
if (parseInt(height) > 0) {
|
||||
height = parseInt(height) - incrementHeight;
|
||||
if(height<0){
|
||||
height=0;
|
||||
}
|
||||
popupDiv.style.height = height+"px";
|
||||
setTimeout(HidePopup, 1);
|
||||
} else {
|
||||
ResetPopup();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* this function is used to reset the popup
|
||||
*/
|
||||
function ResetPopup(){
|
||||
popupDiv.innerHTML = "";
|
||||
popupDiv.style.height = "0px";
|
||||
popupDiv.style.display = "none";
|
||||
parentDiv.style.display = "none";
|
||||
}
|
||||
|
||||
return {
|
||||
displayPopup: CreatePopup,
|
||||
content: node
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,676 @@
|
||||
/*********************************************************************************
|
||||
** 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.
|
||||
********************************************************************************/
|
||||
|
||||
/**
|
||||
* this function is used to get the picklist values using ajax
|
||||
* it does not accept any parameters but calculates the modulename and roleid from the document
|
||||
*/
|
||||
function changeModule(){
|
||||
$("status").style.display="inline";
|
||||
var oModulePick = $('pickmodule')
|
||||
var module=oModulePick.options[oModulePick.selectedIndex].value;
|
||||
var oRolePick = $('pickid');
|
||||
var role=oRolePick.options[oRolePick.selectedIndex].value;
|
||||
|
||||
new Ajax.Request(
|
||||
'index.php',
|
||||
{queue: {position: 'end', scope: 'command'},
|
||||
method: 'post',
|
||||
postBody: 'action=PickListAjax&module=PickList&directmode=ajax&file=PickList&moduleName='+encodeURIComponent(module)+'&roleid='+role,
|
||||
onComplete: function(response) {
|
||||
$("status").style.display="none";
|
||||
$("picklist_datas").innerHTML=response.responseText;
|
||||
}
|
||||
}
|
||||
);
|
||||
fnhide('actiondiv');
|
||||
}
|
||||
|
||||
/**
|
||||
* this function is used to assign picklist values to role
|
||||
* @param string module - the module name
|
||||
* @param string fieldname - the name of the field
|
||||
* @param string fieldlabel - the label for the field
|
||||
*/
|
||||
function assignPicklistValues(module,fieldname,fieldlabel){
|
||||
var elem = $('pickid');
|
||||
var role=elem.options[elem.selectedIndex].value;
|
||||
|
||||
$("status").style.display="inline";
|
||||
new Ajax.Request(
|
||||
'index.php',
|
||||
{queue: {position: 'end', scope: 'command'},
|
||||
method: 'post',
|
||||
postBody: 'action=PickListAjax&module=PickList&file=AssignValues&moduleName='+encodeURIComponent(module)+'&fieldname='+encodeURIComponent(fieldname)+'&fieldlabel='+encodeURIComponent(fieldlabel)+'&roleid='+role,
|
||||
onComplete: function(response) {
|
||||
$("status").style.display="none";
|
||||
$("actiondiv").style.display="block";
|
||||
$("actiondiv").innerHTML=response.responseText;
|
||||
placeAtCenter($('actiondiv'));
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* this function is used to select the value from select box of picklist to the edit box
|
||||
*/
|
||||
function selectForEdit(){
|
||||
var node = document.getElementById('edit_availPickList');
|
||||
if(node.selectedIndex >=0){
|
||||
var value = node.options[node.selectedIndex].text;
|
||||
document.getElementById('replaceVal').value = value;
|
||||
$('replaceVal').focus();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* this function checks if the edited value already exists;
|
||||
* if not it pushes the edited value back to the picklist
|
||||
*/
|
||||
function pushEditedValue(e){
|
||||
var node = document.getElementById('edit_availPickList');
|
||||
if(typeof e.keyCode != 'undefined'){
|
||||
var keyCode = e.keyCode;
|
||||
//check if escape key is being pressed:: if yes then substitue the original value
|
||||
if(keyCode == 27){
|
||||
node.options[node.selectedIndex].text = node.options[node.selectedIndex].value;
|
||||
$('replaceVal').value = node.options[node.selectedIndex].value;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var newVal = trim(document.getElementById('replaceVal').value);
|
||||
for(var i=0;i<node.length;i++){
|
||||
if(node[i].text.toLowerCase() == newVal.toLowerCase() && node.options[node.selectedIndex].text.toLowerCase() != newVal.toLowerCase()){
|
||||
alert(alert_arr.LBL_DUPLICATE_VALUE_EXISTS);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var nonEdit = document.getElementsByClassName('nonEditablePicklistValues');
|
||||
if(nonEdit){
|
||||
for(var i=0;i<nonEdit.length;i++){
|
||||
var val = trim(nonEdit[i].innerHTML);
|
||||
if(val.toLowerCase() == newVal.toLowerCase()){
|
||||
alert(alert_arr.LBL_DUPLICATE_VALUE_EXISTS);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(node.selectedIndex >=0){
|
||||
node.options[node.selectedIndex].text = newVal;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* this function is used to show the delete div for a picklist
|
||||
*/
|
||||
function showDeleteDiv(){
|
||||
var moduleElem = $('pickmodule');
|
||||
var module = moduleElem.options[moduleElem.selectedIndex].value;
|
||||
|
||||
var oModPick = $('allpick');
|
||||
var fieldName=oModPick.options[oModPick.selectedIndex].value;
|
||||
var fieldLabel=oModPick.options[oModPick.selectedIndex].text;
|
||||
|
||||
$("status").style.display="inline";
|
||||
new Ajax.Request(
|
||||
'index.php',
|
||||
{queue: {position: 'end', scope: 'command'},
|
||||
method: 'post',
|
||||
postBody: 'action=PickListAjax&module=PickList&mode=delete&file=ShowActionDivs&moduleName='+encodeURIComponent(module)+'&fieldname='+encodeURIComponent(fieldName)+'&fieldlabel='+encodeURIComponent(fieldLabel),
|
||||
onComplete: function(response) {
|
||||
$("status").style.display="none";
|
||||
$("actiondiv").style.display ='block';
|
||||
$("actiondiv").innerHTML=response.responseText;
|
||||
placeAtCenter($('actiondiv'));
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* this function is used to show the add div for a picklist
|
||||
*/
|
||||
function showAddDiv(){
|
||||
var moduleElem = $('pickmodule');
|
||||
var module = moduleElem.options[moduleElem.selectedIndex].value;
|
||||
|
||||
var oModPick = $('allpick');
|
||||
var fieldName=oModPick.options[oModPick.selectedIndex].value;
|
||||
var fieldLabel=oModPick.options[oModPick.selectedIndex].text;
|
||||
|
||||
$("status").style.display="inline";
|
||||
new Ajax.Request(
|
||||
'index.php',
|
||||
{queue: {position: 'end', scope: 'command'},
|
||||
method: 'post',
|
||||
postBody: 'action=PickListAjax&module=PickList&mode=add&file=ShowActionDivs&moduleName='+encodeURIComponent(module)+'&fieldname='+encodeURIComponent(fieldName)+'&fieldlabel='+encodeURIComponent(fieldLabel),
|
||||
onComplete: function(response) {
|
||||
$("status").style.display="none";
|
||||
$("actiondiv").style.display ='block';
|
||||
$("actiondiv").innerHTML=response.responseText;
|
||||
placeAtCenter($('actiondiv'));
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* this function is used to show the edit div for a picklist
|
||||
*/
|
||||
function showEditDiv(){
|
||||
var moduleElem = $('pickmodule');
|
||||
var module = moduleElem.options[moduleElem.selectedIndex].value;
|
||||
|
||||
var oModPick = $('allpick');
|
||||
var fieldName=oModPick.options[oModPick.selectedIndex].value;
|
||||
var fieldLabel=oModPick.options[oModPick.selectedIndex].text;
|
||||
|
||||
$("status").style.display="inline";
|
||||
new Ajax.Request(
|
||||
'index.php',
|
||||
{queue: {position: 'end', scope: 'command'},
|
||||
method: 'post',
|
||||
postBody: 'action=PickListAjax&module=PickList&mode=edit&file=ShowActionDivs&moduleName='+encodeURIComponent(module)+'&fieldname='+encodeURIComponent(fieldName)+'&fieldlabel='+encodeURIComponent(fieldLabel),
|
||||
onComplete: function(response) {
|
||||
$("status").style.display="none";
|
||||
$("actiondiv").style.display ='block';
|
||||
$("actiondiv").innerHTML=response.responseText;
|
||||
placeAtCenter($('actiondiv'));
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* this function validates the add action
|
||||
* @param string fieldname - the name of the picklist field
|
||||
* @param string module - the name of the module
|
||||
*/
|
||||
function validateAdd(fieldname, module){
|
||||
var pickArr=new Array();
|
||||
var pick_options = document.getElementsByClassName('picklist_existing_options');
|
||||
for(var i=0;i<pick_options.length;i++){
|
||||
if(pick_options[i].value != ''){
|
||||
pickArr[i]=pick_options[i].innerHTML;
|
||||
}
|
||||
}
|
||||
|
||||
var new_vals = new Array();
|
||||
new_vals=trim($("add_picklist_values").value).split('\n');
|
||||
if(new_vals == '' || new_vals.length == 0) {
|
||||
alert(alert_arr.LBL_ADD_PICKLIST_VALUE);
|
||||
return false;
|
||||
}
|
||||
|
||||
var node = document.getElementsByClassName('picklist_noneditable_options');
|
||||
var nonEdit = new Array();
|
||||
for(var i=0;i<node.length;i++){
|
||||
nonEdit[i] = trim(node[i].innerHTML);
|
||||
}
|
||||
|
||||
pickArr = pickArr.concat(new_vals);
|
||||
pickArr = pickArr.concat(nonEdit);
|
||||
if(checkDuplicatePicklistValues(pickArr) == true){
|
||||
pickAdd(module,fieldname);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* this function is used to check duplicate values in a given picklist values arrays
|
||||
* @param array arr - the picklist values array
|
||||
* @return boolean - true if no duplicates :: false otherwise
|
||||
*/
|
||||
function checkDuplicatePicklistValues(arr){
|
||||
var len=arr.length;
|
||||
for(i=0;i<len;i++){
|
||||
for(j=i+1;j<len;j++){
|
||||
if(trim(arr[i]).toLowerCase() == trim(arr[j]).toLowerCase()){
|
||||
alert(alert_arr.LBL_DUPLICATE_FOUND+"'"+trim(arr[i])+"'");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* this function adds a new value to the given picklist
|
||||
* @param string module - the module name
|
||||
* @param string fieldname - the picklist field name
|
||||
*/
|
||||
function pickAdd(module, fieldname){
|
||||
var arr = new Array();
|
||||
arr = $("add_picklist_values").value.split("\n");
|
||||
var trimmedArr = new Array();
|
||||
for(var i=0,j=0;i<arr.length;i++){
|
||||
if(trim(arr[i]) != ''){
|
||||
trimmedArr[j++] = trim(arr[i]);
|
||||
}
|
||||
}
|
||||
var newValues = JSON.stringify(trimmedArr);
|
||||
arr = new Array();
|
||||
|
||||
var roles = $("add_availRoles").options;
|
||||
var roleValues = '';
|
||||
if(roles.selectedIndex > -1){
|
||||
for (var i=0,j=0;i<roles.length;i++){
|
||||
if(roles[i].selected == true){
|
||||
arr[j++] = roles[i].value;
|
||||
}
|
||||
}
|
||||
roleValues = JSON.stringify(arr);
|
||||
}
|
||||
|
||||
if(trim(roleValues) == '') {
|
||||
if(!confirm(alert_arr.LBL_NO_ROLES_SELECTED)){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var node = document.getElementById('saveAddButton');
|
||||
node.disabled = true;
|
||||
$("status").style.display="inline";
|
||||
new Ajax.Request(
|
||||
'index.php',
|
||||
{queue: {position: 'end', scope: 'command'},
|
||||
method: 'post',
|
||||
postBody: 'action=PickListAjax&module=PickList&mode=add&file=PickListAction&fld_module='+encodeURIComponent(module)+'&fieldname='+encodeURIComponent(fieldname)+'&newValues='+encodeURIComponent(newValues)+'&selectedRoles='+encodeURIComponent(roleValues),
|
||||
onComplete: function(response) {
|
||||
var str = response.responseText;
|
||||
if(str=="SUCCESS"){
|
||||
changeModule();
|
||||
fnhide('actiondiv');
|
||||
}else{
|
||||
alert(str);
|
||||
}
|
||||
$("status").style.display="none";
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* this function validates the edit action for a picklist
|
||||
* @param string fieldname - the fieldname of the picklist
|
||||
* @param string module - the module name
|
||||
*/
|
||||
function validateEdit(fieldname, module){
|
||||
var newVal = Array();
|
||||
var oldVal = Array();
|
||||
|
||||
var node = document.getElementById('edit_availPickList');
|
||||
for(var i=0;i<node.length;i++){
|
||||
newVal[i] = node[i].text;
|
||||
if(trim(newVal[i]) == ''){
|
||||
alert(alert_arr.LBL_CANNOT_HAVE_EMPTY_VALUE);
|
||||
return false;
|
||||
}
|
||||
oldVal[i] = node[i].value;
|
||||
}
|
||||
pickReplace(module, fieldname, JSON.stringify(newVal), JSON.stringify(oldVal));
|
||||
}
|
||||
|
||||
/**
|
||||
* this function is used to modify the picklist values
|
||||
* @param string module - the module name
|
||||
* @param string fieldname - the field name
|
||||
* @param array newVal - the new values for the picklist in json encoded string format
|
||||
* @param array oldVal - the old values for the picklist in json encoded string format
|
||||
*/
|
||||
function pickReplace(module, fieldname, newVal, oldVal){
|
||||
$("status").style.display="inline";
|
||||
new Ajax.Request(
|
||||
'index.php',
|
||||
{queue: {position: 'end', scope: 'command'},
|
||||
method: 'post',
|
||||
postBody: 'action=PickListAjax&module=PickList&mode=edit&file=PickListAction&fld_module='+encodeURIComponent(module)+'&fieldname='+encodeURIComponent(fieldname)+'&newValues='+encodeURIComponent(newVal)+'&oldValues='+encodeURIComponent(oldVal),
|
||||
onComplete: function(response) {
|
||||
var str = response.responseText;
|
||||
if(str == "SUCCESS"){
|
||||
changeModule();
|
||||
fnhide('actiondiv');
|
||||
}else{
|
||||
alert(str);
|
||||
}
|
||||
$("status").style.display="none";
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* this function validates the delete action
|
||||
* @param string fieldname - the name of the picklist field
|
||||
* @param string module - the name of the module
|
||||
*/
|
||||
function validateDelete(fieldname, module){
|
||||
var node = $('replace_picklistval');
|
||||
var replaceVal = node.options[node.selectedIndex].value;
|
||||
if(trim(replaceVal) == ''){
|
||||
alert(alert_arr.LBL_BLANK_REPLACEMENT);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!confirm(alert_arr.LBL_WANT_TO_DELETE)){
|
||||
return false;
|
||||
}
|
||||
|
||||
node = document.getElementById('delete_availPickList');
|
||||
var arr = new Array();
|
||||
for(var i=0;i<node.length;i++){
|
||||
if(node.selectedIndex == -1){
|
||||
alert(alert_arr.LBL_NO_VALUES_TO_DELETE);
|
||||
return false;
|
||||
}else{
|
||||
for(var j=0, k=0; j<node.length; j++){
|
||||
if(node.options[j].selected == true){
|
||||
arr[k++] = encodeURIComponent(node.options[j].value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//check if replacement value is not equal to any deleted value
|
||||
for(var i=0; i<arr.length; i++){
|
||||
if(replaceVal == arr[i]){
|
||||
alert(alert_arr.LBL_PLEASE_CHANGE_REPLACEMENT);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var nonEditableLength = 0;
|
||||
var nonEditable = $('nonEditablePicklistVal');
|
||||
if(typeof nonEditable != 'undefined'){
|
||||
nonEditableLength = nonEditable.options.length;
|
||||
}
|
||||
|
||||
if(arr.length == (node.length+nonEditableLength)){
|
||||
alert(alert_arr.LBL_DELETE_ALL_WARNING);
|
||||
return false;
|
||||
}
|
||||
pickDelete(module,fieldname, arr, replaceVal);
|
||||
}
|
||||
|
||||
/**
|
||||
* this function deletes the given picklist values
|
||||
* @param string module - the module name
|
||||
* @param string fieldname - the field name of the picklist
|
||||
* @param array arr - the picklist values to delete
|
||||
* @param array replaceVal - the replacement value for the deleted value(s)
|
||||
*/
|
||||
function pickDelete(module, fieldname, arr, replaceVal){
|
||||
$("status").style.display="inline";
|
||||
new Ajax.Request(
|
||||
'index.php',
|
||||
{queue: {position: 'end', scope: 'command'},
|
||||
method: 'post',
|
||||
postBody: 'action=PickListAjax&module=PickList&mode=delete&file=PickListAction&fld_module='+encodeURIComponent(module)+'&fieldname='+encodeURIComponent(fieldname)+'&values='+JSON.stringify(arr)+'&replaceVal='+encodeURIComponent(replaceVal),
|
||||
onComplete: function(response) {
|
||||
var str = response.responseText;
|
||||
if(str == "SUCCESS"){
|
||||
changeModule();
|
||||
fnhide('actiondiv');
|
||||
}else{
|
||||
alert(str);
|
||||
}
|
||||
$("status").style.display="none";
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* this function is used to assign the available picklist values to the assigend picklist values section
|
||||
*/
|
||||
function moveRight(){
|
||||
var rightElem = $('selectedColumns');
|
||||
for (var i=0;i<rightElem.length;i++){
|
||||
rightElem.options[i].selected=false;
|
||||
}
|
||||
|
||||
var leftElem = $('availList');
|
||||
|
||||
for (var i=0;i<leftElem.length;i++){
|
||||
if(leftElem.options[i].selected==true){
|
||||
var rowFound=false;
|
||||
//check if the value already exists
|
||||
for(var j=0;j<rightElem.length;j++){
|
||||
if(rightElem.options[j].value==leftElem.options[i].value){
|
||||
rowFound=true;
|
||||
rightElem.options[j].selected=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//if the value does not exist then create it and set it as selected
|
||||
if(rowFound!=true){
|
||||
var newColObj=document.createElement("OPTION");
|
||||
newColObj.value=leftElem.options[i].value;
|
||||
newColObj.innerHTML=leftElem.options[i].innerHTML;
|
||||
|
||||
rightElem.appendChild(newColObj);
|
||||
leftElem.options[i].selected=false;
|
||||
newColObj.selected=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* this function is used to remove values from the assigned picklist values section
|
||||
*/
|
||||
function removeValue(){
|
||||
var elem = $('selectedColumns');
|
||||
if(elem.options.selectedIndex>=0){
|
||||
for (var i=0;i<elem.options.length;i++){
|
||||
if(elem.options[i].selected == true){
|
||||
elem.removeChild(elem.options[i--]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* this function is used to move the selected option up in the assigned picklist
|
||||
*/
|
||||
function moveUp(){
|
||||
var elem = document.getElementById('selectedColumns');
|
||||
if(elem.options.selectedIndex>=0){
|
||||
for (var i=1;i<elem.options.length;i++){
|
||||
if(elem.options[i].selected == true){
|
||||
//swap with one up
|
||||
var first = elem.options[i-1];
|
||||
var second = elem.options[i];
|
||||
var temp = new Array();
|
||||
|
||||
temp.value = first.value;
|
||||
temp.innerHTML = first.innerHTML;
|
||||
|
||||
first.value = second.value;
|
||||
first.innerHTML = second.innerHTML;
|
||||
|
||||
second.value = temp.value;
|
||||
second.innerHTML = temp.innerHTML;
|
||||
|
||||
first.selected = true;
|
||||
second.selected = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* this function is used to move the selected option down in the assigned picklist
|
||||
*/
|
||||
function moveDown(){
|
||||
var elem = document.getElementById('selectedColumns');
|
||||
if(elem.options.selectedIndex>=0){
|
||||
for (var i=elem.options.length-2;i>=0;i--){
|
||||
if(elem.options[i].selected == true){
|
||||
//swap with one down
|
||||
var first = elem.options[i+1];
|
||||
var second = elem.options[i];
|
||||
var temp = new Array();
|
||||
|
||||
temp.value = first.value;
|
||||
temp.innerHTML = first.innerHTML;
|
||||
|
||||
first.value = second.value;
|
||||
first.innerHTML = second.innerHTML;
|
||||
|
||||
second.value = temp.value;
|
||||
second.innerHTML = temp.innerHTML;
|
||||
|
||||
first.selected = true;
|
||||
second.selected = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* this function is used to save the assigned picklist values for a given role
|
||||
* @param string moduleName - the name of the module
|
||||
* @param string fieldName - the name of the field
|
||||
* @param string roleid - the id of the given role
|
||||
*/
|
||||
function saveAssignedValues(moduleName, fieldName, roleid){
|
||||
var node = document.getElementById('selectedColumns');
|
||||
if(node.length == 0){
|
||||
alert(alert_arr.LBL_DELETE_ALL_WARNING);
|
||||
return false;
|
||||
}
|
||||
var arr = new Array();
|
||||
for(var i=0;i<node.length;i++){
|
||||
arr[i] = node[i].value;
|
||||
}
|
||||
|
||||
node = document.getElementById('roleselect');
|
||||
var otherRoles = new Array();
|
||||
if(node != null){
|
||||
if(node.selectedIndex > -1){
|
||||
for(var i=0,j=0; i<node.options.length; i++){
|
||||
if(node.options[i].selected == true){
|
||||
otherRoles[j++] = node.options[i].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
otherRoles = JSON.stringify(otherRoles);
|
||||
|
||||
var values = JSON.stringify(arr);
|
||||
$("status").style.display="inline";
|
||||
new Ajax.Request(
|
||||
'index.php',
|
||||
{queue: {position: 'end', scope: 'command'},
|
||||
method: 'post',
|
||||
postBody: 'action=PickListAjax&module=PickList&file=SaveAssignedValues&moduleName='+encodeURIComponent(moduleName)+'&fieldname='+encodeURIComponent(fieldName)+'&roleid='+roleid+'&values='+encodeURIComponent(values)+'&otherRoles='+encodeURIComponent(otherRoles),
|
||||
onComplete: function(response) {
|
||||
if(response.responseText == "SUCCESS"){
|
||||
$("status").style.display="none";
|
||||
$("actiondiv").style.display="none";
|
||||
showPicklistEntries();
|
||||
}else{
|
||||
alert(response.responseText);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* this function is used to display the picklist entries for a given module for a given field for a given roleid
|
||||
* it accepts the module name as parameter while retrieves other values from DOM
|
||||
* @param string module - the module name
|
||||
*/
|
||||
function showPicklistEntries(){
|
||||
var moduleNode = $('pickmodule');
|
||||
var moduleName = moduleNode.options[moduleNode.selectedIndex].value;
|
||||
|
||||
var node = $('pickid');
|
||||
var roleid = node.options[node.selectedIndex].value;
|
||||
|
||||
$("status").style.display="inline";
|
||||
new Ajax.Request(
|
||||
'index.php',
|
||||
{queue: {position: 'end', scope: 'command'},
|
||||
method: 'post',
|
||||
postBody: 'action=PickListAjax&module=PickList&file=PickList&moduleName='+encodeURIComponent(moduleName)+'&roleid='+roleid+'&directmode=ajax',
|
||||
onComplete: function(response) {
|
||||
if(response.responseText){
|
||||
$("status").style.display="none";
|
||||
$('pickListContents').innerHTML = response.responseText;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* this function is used to display the select role div
|
||||
* @param string roleid - the roleid of the current role
|
||||
*/
|
||||
function showRoleSelectDiv(roleid){
|
||||
$("status").style.display="inline";
|
||||
new Ajax.Request(
|
||||
'index.php',
|
||||
{queue: {position: 'end', scope: 'command'},
|
||||
method: 'post',
|
||||
postBody: 'action=PickListAjax&module=PickList&file=ShowRoleSelect&roleid='+roleid,
|
||||
onComplete: function(response) {
|
||||
if(response.responseText){
|
||||
$("status").style.display="none";
|
||||
var node = $('assignPicklistTable');
|
||||
var tr = document.createElement('tr');
|
||||
var td = document.createElement('td');
|
||||
td.innerHTML = response.responseText;
|
||||
tr.appendChild(td);
|
||||
$('addRolesLink').style.display = "none";
|
||||
|
||||
var tbody = getChildByTagName(node,'tbody');
|
||||
var sibling = getChildByTagName(tbody, "tr");
|
||||
sibling = getSiblingByTagName(sibling, "tr");
|
||||
tbody.insertBefore(tr,sibling);
|
||||
placeAtCenter($('actiondiv'));
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function getSiblingByTagName(elem,tagName){
|
||||
var sibling = elem.nextSibling;
|
||||
while(sibling.nodeName.toLowerCase()!=tagName.toLowerCase()){
|
||||
sibling = sibling.nextSibling;
|
||||
}
|
||||
return sibling;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function getChildByTagName(elem,tagName){
|
||||
for(var i=0;elem.childNodes.length;++i){
|
||||
if(elem.childNodes[i].nodeName.toLowerCase()==tagName.toLowerCase()){
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(i >= elem.childNodes.length){
|
||||
return null;
|
||||
}
|
||||
return elem.childNodes[i];
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/*********************************************************************************
|
||||
** 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 mypopup()
|
||||
{
|
||||
mywindow = window.open("copyright.html","mywindow", "height=115, width=575");
|
||||
mywindow.moveTo(210,620);
|
||||
}
|
||||
|
||||
function newpopup(str){
|
||||
window.open (str,"mywinw","menubar=1,resizable=1,scrollbars=yes");
|
||||
// window.parent.close();
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
/**
|
||||
* reflection.js v1.5
|
||||
*
|
||||
* Contributors: Cow http://cow.neondragon.net
|
||||
* Gfx http://www.jroller.com/page/gfx/
|
||||
* Sitharus http://www.sitharus.com
|
||||
* Andreas Linde http://www.andreaslinde.de
|
||||
* Tralala, coder @ http://www.vbulletin.org
|
||||
*
|
||||
* Freely distributable under MIT-style license.
|
||||
*/
|
||||
|
||||
/* From prototype.js */
|
||||
document.getElementsByClassName = function(className) {
|
||||
var children = document.getElementsByTagName('*') || document.all;
|
||||
var elements = new Array();
|
||||
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
var child = children[i];
|
||||
var classNames = child.className.split(' ');
|
||||
for (var j = 0; j < classNames.length; j++) {
|
||||
if (classNames[j] == className) {
|
||||
elements.push(child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return elements;
|
||||
}
|
||||
|
||||
var Reflection = {
|
||||
defaultHeight : 0.5,
|
||||
defaultOpacity: 0.5,
|
||||
|
||||
add: function(image, options) {
|
||||
Reflection.remove(image);
|
||||
|
||||
doptions = { "height" : Reflection.defaultHeight, "opacity" : Reflection.defaultOpacity }
|
||||
if (options) {
|
||||
for (var i in doptions) {
|
||||
if (!options[i]) {
|
||||
options[i] = doptions[i];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
options = doptions;
|
||||
}
|
||||
|
||||
try {
|
||||
var d = document.createElement('div');
|
||||
var p = image;
|
||||
|
||||
var classes = p.className.split(' ');
|
||||
var newClasses = '';
|
||||
for (j=0;j<classes.length;j++) {
|
||||
if (classes[j] != "reflect") {
|
||||
if (newClasses) {
|
||||
newClasses += ' '
|
||||
}
|
||||
|
||||
newClasses += classes[j];
|
||||
}
|
||||
}
|
||||
|
||||
var reflectionHeight = Math.floor(p.height*options['height']);
|
||||
var divHeight = Math.floor(p.height*(1+options['height']));
|
||||
|
||||
var reflectionWidth = p.width;
|
||||
|
||||
/* Copy original image's classes & styles to div */
|
||||
d.className = newClasses;
|
||||
p.className = 'reflected';
|
||||
|
||||
d.style.cssText = p.style.cssText;
|
||||
p.style.cssText = ' ';
|
||||
|
||||
if (document.all && !window.opera) {
|
||||
var reflection = document.createElement('img');
|
||||
reflection.src = p.src;
|
||||
reflection.style.width = reflectionWidth+'px';
|
||||
|
||||
reflection.style.marginBottom = "-"+(p.height-reflectionHeight)+'px';
|
||||
reflection.style.filter = 'flipv progid:DXImageTransform.Microsoft.Alpha(opacity='+(options['opacity']*100)+', style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy='+(options['height']*100)+')';
|
||||
|
||||
d.style.width = reflectionWidth+'px';
|
||||
d.style.height = divHeight+'px';
|
||||
p.parentNode.replaceChild(d, p);
|
||||
|
||||
d.appendChild(p);
|
||||
d.appendChild(reflection);
|
||||
} else {
|
||||
var canvas = document.createElement('canvas');
|
||||
var context = canvas.getContext("2d");
|
||||
|
||||
canvas.style.height = reflectionHeight+'px';
|
||||
canvas.style.width = reflectionWidth+'px';
|
||||
canvas.height = reflectionHeight;
|
||||
canvas.width = reflectionWidth;
|
||||
|
||||
d.style.width = reflectionWidth+'px';
|
||||
d.style.height = divHeight+'px';
|
||||
p.parentNode.replaceChild(d, p);
|
||||
|
||||
d.appendChild(p);
|
||||
d.appendChild(canvas);
|
||||
|
||||
context.save();
|
||||
|
||||
context.translate(0,image.height-1);
|
||||
context.scale(1,-1);
|
||||
|
||||
context.drawImage(image, 0, 0, reflectionWidth, image.height);
|
||||
|
||||
context.restore();
|
||||
|
||||
context.globalCompositeOperation = "destination-out";
|
||||
var gradient = context.createLinearGradient(0, 0, 0, reflectionHeight);
|
||||
|
||||
gradient.addColorStop(1, "rgba(255, 255, 255, 1.0)");
|
||||
gradient.addColorStop(0, "rgba(255, 255, 255, "+(1-options['opacity'])+")");
|
||||
|
||||
context.fillStyle = gradient;
|
||||
if (navigator.appVersion.indexOf('WebKit') != -1) {
|
||||
context.fill();
|
||||
} else {
|
||||
context.fillRect(0, 0, reflectionWidth, reflectionHeight*2);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
},
|
||||
|
||||
remove : function(image) {
|
||||
if (image.className == "reflected") {
|
||||
image.className = image.parentNode.className;
|
||||
image.parentNode.parentNode.replaceChild(image, image.parentNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addReflections() {
|
||||
var rimages = document.getElementsByClassName('reflect');
|
||||
for (i=0;i<rimages.length;i++) {
|
||||
var rheight = null;
|
||||
var ropacity = null;
|
||||
|
||||
var classes = rimages[i].className.split(' ');
|
||||
for (j=0;j<classes.length;j++) {
|
||||
if (classes[j].indexOf("rheight") == 0) {
|
||||
var rheight = classes[j].substring(7)/100;
|
||||
} else if (classes[j].indexOf("ropacity") == 0) {
|
||||
var ropacity = classes[j].substring(8)/100;
|
||||
}
|
||||
}
|
||||
|
||||
Reflection.add(rimages[i], { height: rheight, opacity : ropacity});
|
||||
}
|
||||
}
|
||||
|
||||
var previousOnload = window.onload;
|
||||
window.onload = function () { if(previousOnload) previousOnload(); addReflections(); }
|
||||
@@ -0,0 +1,56 @@
|
||||
/*********************************************************************************
|
||||
** 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 searchshowhide(argg,argg2)
|
||||
{
|
||||
var ele_x = document.getElementById(argg);
|
||||
var ele_y = document.getElementById(argg2);
|
||||
var x, y;
|
||||
if (ele_x != null) x = ele_x.style;
|
||||
if (ele_y != null) y = ele_y.style;
|
||||
if (x != null && x.display=="none" && (y == null || y.display=="none"))
|
||||
{
|
||||
x.display="block"
|
||||
|
||||
}
|
||||
else {
|
||||
if (y != null) y.display="none";
|
||||
if (x != null) x.display="none";
|
||||
}
|
||||
}
|
||||
|
||||
function searchhide(argg,argg2)
|
||||
{
|
||||
var ele_x = document.getElementById(argg);
|
||||
var ele_y = document.getElementById(argg2);
|
||||
var x, y;
|
||||
if (ele_x != null) x = ele_x.style;
|
||||
if (ele_y != null) y = ele_y.style;
|
||||
if (y != null) y.display="none";
|
||||
if (x != null) x.display="none";
|
||||
}
|
||||
|
||||
function moveMe(arg1) {
|
||||
var posx = 0;
|
||||
var posy = 0;
|
||||
var e=document.getElementById(arg1);
|
||||
|
||||
if (!e) var e = window.event;
|
||||
|
||||
if (e.pageX || e.pageY)
|
||||
{
|
||||
posx = e.pageX;
|
||||
posy = e.pageY;
|
||||
}
|
||||
else if (e.clientX || e.clientY)
|
||||
{
|
||||
posx = e.clientX + document.body.scrollLeft;
|
||||
posy = e.clientY + document.body.scrollTop;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,275 @@
|
||||
// Copyright (c) 2005 Marty Haught, Thomas Fuchs
|
||||
//
|
||||
// See http://script.aculo.us for more info
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
if(!Control) var Control = {};
|
||||
Control.Slider = Class.create();
|
||||
|
||||
// options:
|
||||
// axis: 'vertical', or 'horizontal' (default)
|
||||
//
|
||||
// callbacks:
|
||||
// onChange(value)
|
||||
// onSlide(value)
|
||||
Control.Slider.prototype = {
|
||||
initialize: function(handle, track, options) {
|
||||
var slider = this;
|
||||
|
||||
if(handle instanceof Array) {
|
||||
this.handles = handle.collect( function(e) { return $(e) });
|
||||
} else {
|
||||
this.handles = [$(handle)];
|
||||
}
|
||||
|
||||
this.track = $(track);
|
||||
this.options = options || {};
|
||||
|
||||
this.axis = this.options.axis || 'horizontal';
|
||||
this.increment = this.options.increment || 1;
|
||||
this.step = parseInt(this.options.step || '1');
|
||||
this.range = this.options.range || $R(0,1);
|
||||
|
||||
this.value = 0; // assure backwards compat
|
||||
this.values = this.handles.map( function() { return 0 });
|
||||
this.spans = this.options.spans ? this.options.spans.map(function(s){ return $(s) }) : false;
|
||||
this.options.startSpan = $(this.options.startSpan || null);
|
||||
this.options.endSpan = $(this.options.endSpan || null);
|
||||
|
||||
this.restricted = this.options.restricted || false;
|
||||
|
||||
this.maximum = this.options.maximum || this.range.end;
|
||||
this.minimum = this.options.minimum || this.range.start;
|
||||
|
||||
// Will be used to align the handle onto the track, if necessary
|
||||
this.alignX = parseInt(this.options.alignX || '0');
|
||||
this.alignY = parseInt(this.options.alignY || '0');
|
||||
|
||||
this.trackLength = this.maximumOffset() - this.minimumOffset();
|
||||
|
||||
this.active = false;
|
||||
this.dragging = false;
|
||||
this.disabled = false;
|
||||
|
||||
if(this.options.disabled) this.setDisabled();
|
||||
|
||||
// Allowed values array
|
||||
this.allowedValues = this.options.values ? this.options.values.sortBy(Prototype.K) : false;
|
||||
if(this.allowedValues) {
|
||||
this.minimum = this.allowedValues.min();
|
||||
this.maximum = this.allowedValues.max();
|
||||
}
|
||||
|
||||
this.eventMouseDown = this.startDrag.bindAsEventListener(this);
|
||||
this.eventMouseUp = this.endDrag.bindAsEventListener(this);
|
||||
this.eventMouseMove = this.update.bindAsEventListener(this);
|
||||
|
||||
// Initialize handles in reverse (make sure first handle is active)
|
||||
this.handles.each( function(h,i) {
|
||||
i = slider.handles.length-1-i;
|
||||
slider.setValue(parseFloat(
|
||||
(slider.options.sliderValue instanceof Array ?
|
||||
slider.options.sliderValue[i] : slider.options.sliderValue) ||
|
||||
slider.range.start), i);
|
||||
Element.makePositioned(h); // fix IE
|
||||
Event.observe(h, "mousedown", slider.eventMouseDown);
|
||||
});
|
||||
|
||||
Event.observe(this.track, "mousedown", this.eventMouseDown);
|
||||
Event.observe(document, "mouseup", this.eventMouseUp);
|
||||
Event.observe(document, "mousemove", this.eventMouseMove);
|
||||
|
||||
this.initialized = true;
|
||||
},
|
||||
dispose: function() {
|
||||
var slider = this;
|
||||
Event.stopObserving(this.track, "mousedown", this.eventMouseDown);
|
||||
Event.stopObserving(document, "mouseup", this.eventMouseUp);
|
||||
Event.stopObserving(document, "mousemove", this.eventMouseMove);
|
||||
this.handles.each( function(h) {
|
||||
Event.stopObserving(h, "mousedown", slider.eventMouseDown);
|
||||
});
|
||||
},
|
||||
setDisabled: function(){
|
||||
this.disabled = true;
|
||||
},
|
||||
setEnabled: function(){
|
||||
this.disabled = false;
|
||||
},
|
||||
getNearestValue: function(value){
|
||||
if(this.allowedValues){
|
||||
if(value >= this.allowedValues.max()) return(this.allowedValues.max());
|
||||
if(value <= this.allowedValues.min()) return(this.allowedValues.min());
|
||||
|
||||
var offset = Math.abs(this.allowedValues[0] - value);
|
||||
var newValue = this.allowedValues[0];
|
||||
this.allowedValues.each( function(v) {
|
||||
var currentOffset = Math.abs(v - value);
|
||||
if(currentOffset <= offset){
|
||||
newValue = v;
|
||||
offset = currentOffset;
|
||||
}
|
||||
});
|
||||
return newValue;
|
||||
}
|
||||
if(value > this.range.end) return this.range.end;
|
||||
if(value < this.range.start) return this.range.start;
|
||||
return value;
|
||||
},
|
||||
setValue: function(sliderValue, handleIdx){
|
||||
if(!this.active) {
|
||||
this.activeHandle = this.handles[handleIdx];
|
||||
this.activeHandleIdx = handleIdx;
|
||||
this.updateStyles();
|
||||
}
|
||||
handleIdx = handleIdx || this.activeHandleIdx || 0;
|
||||
if(this.initialized && this.restricted) {
|
||||
if((handleIdx>0) && (sliderValue<this.values[handleIdx-1]))
|
||||
sliderValue = this.values[handleIdx-1];
|
||||
if((handleIdx < (this.handles.length-1)) && (sliderValue>this.values[handleIdx+1]))
|
||||
sliderValue = this.values[handleIdx+1];
|
||||
}
|
||||
sliderValue = this.getNearestValue(sliderValue);
|
||||
this.values[handleIdx] = sliderValue;
|
||||
this.value = this.values[0]; // assure backwards compat
|
||||
|
||||
this.handles[handleIdx].style[this.isVertical() ? 'top' : 'left'] =
|
||||
this.translateToPx(sliderValue);
|
||||
|
||||
this.drawSpans();
|
||||
if(!this.dragging || !this.event) this.updateFinished();
|
||||
},
|
||||
setValueBy: function(delta, handleIdx) {
|
||||
this.setValue(this.values[handleIdx || this.activeHandleIdx || 0] + delta,
|
||||
handleIdx || this.activeHandleIdx || 0);
|
||||
},
|
||||
translateToPx: function(value) {
|
||||
return Math.round((this.trackLength / (this.range.end - this.range.start)) * (value - this.range.start)) + "px";
|
||||
},
|
||||
translateToValue: function(offset) {
|
||||
return ((offset/this.trackLength) * (this.range.end - this.range.start)) + this.range.start;
|
||||
},
|
||||
getRange: function(range) {
|
||||
var v = this.values.sortBy(Prototype.K);
|
||||
range = range || 0;
|
||||
return $R(v[range],v[range+1]);
|
||||
},
|
||||
minimumOffset: function(){
|
||||
return(this.isVertical() ? this.alignY : this.alignX);
|
||||
},
|
||||
maximumOffset: function(){
|
||||
return(this.isVertical() ?
|
||||
this.track.offsetHeight - this.alignY : this.track.offsetWidth - this.alignX);
|
||||
},
|
||||
isVertical: function(){
|
||||
return (this.axis == 'vertical');
|
||||
},
|
||||
drawSpans: function() {
|
||||
var slider = this;
|
||||
if(this.spans)
|
||||
$R(0, this.spans.length-1).each(function(r) { slider.setSpan(slider.spans[r], slider.getRange(r)) });
|
||||
if(this.options.startSpan)
|
||||
this.setSpan(this.options.startSpan,
|
||||
$R(0, this.values.length>1 ? this.getRange(0).min() : this.value ));
|
||||
if(this.options.endSpan)
|
||||
this.setSpan(this.options.endSpan,
|
||||
$R(this.values.length>1 ? this.getRange(this.spans.length-1).max() : this.value, this.maximum));
|
||||
},
|
||||
setSpan: function(span, range) {
|
||||
if(this.isVertical()) {
|
||||
span.style.top = this.translateToPx(range.start);
|
||||
span.style.height = this.translateToPx(range.end - range.start);
|
||||
} else {
|
||||
span.style.left = this.translateToPx(range.start);
|
||||
span.style.width = this.translateToPx(range.end - range.start);
|
||||
}
|
||||
},
|
||||
updateStyles: function() {
|
||||
this.handles.each( function(h){ Element.removeClassName(h, 'selected') });
|
||||
Element.addClassName(this.activeHandle, 'selected');
|
||||
},
|
||||
startDrag: function(event) {
|
||||
if(Event.isLeftClick(event)) {
|
||||
if(!this.disabled){
|
||||
this.active = true;
|
||||
|
||||
var handle = Event.element(event);
|
||||
var pointer = [Event.pointerX(event), Event.pointerY(event)];
|
||||
if(handle==this.track) {
|
||||
var offsets = Position.cumulativeOffset(this.track);
|
||||
this.event = event;
|
||||
this.setValue(this.translateToValue(
|
||||
this.isVertical() ? pointer[1]-offsets[1] : pointer[0]-offsets[0]
|
||||
));
|
||||
} else {
|
||||
// find the handle (prevents issues with Safari)
|
||||
while((this.handles.indexOf(handle) == -1) && handle.parentNode)
|
||||
handle = handle.parentNode;
|
||||
|
||||
this.activeHandle = handle;
|
||||
this.activeHandleIdx = this.handles.indexOf(this.activeHandle);
|
||||
this.updateStyles();
|
||||
|
||||
var offsets = Position.cumulativeOffset(this.activeHandle);
|
||||
this.offsetX = (pointer[0] - offsets[0]);
|
||||
this.offsetY = (pointer[1] - offsets[1]);
|
||||
}
|
||||
}
|
||||
Event.stop(event);
|
||||
}
|
||||
},
|
||||
update: function(event) {
|
||||
if(this.active) {
|
||||
if(!this.dragging) this.dragging = true;
|
||||
this.draw(event);
|
||||
// fix AppleWebKit rendering
|
||||
if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0);
|
||||
Event.stop(event);
|
||||
}
|
||||
},
|
||||
draw: function(event) {
|
||||
var pointer = [Event.pointerX(event), Event.pointerY(event)];
|
||||
var offsets = Position.cumulativeOffset(this.track);
|
||||
pointer[0] -= this.offsetX + offsets[0];
|
||||
pointer[1] -= this.offsetY + offsets[1];
|
||||
this.event = event;
|
||||
this.setValue(this.translateToValue( this.isVertical() ? pointer[1] : pointer[0] ));
|
||||
if(this.initialized && this.options.onSlide) this.options.onSlide(this.values.length>1 ? this.values : this.value, this);
|
||||
},
|
||||
endDrag: function(event) {
|
||||
if(this.active && this.dragging) {
|
||||
this.finishDrag(event, true);
|
||||
Event.stop(event);
|
||||
}
|
||||
this.active = false;
|
||||
this.dragging = false;
|
||||
},
|
||||
finishDrag: function(event, success) {
|
||||
this.active = false;
|
||||
this.dragging = false;
|
||||
this.updateFinished();
|
||||
},
|
||||
updateFinished: function() {
|
||||
if(this.initialized && this.options.onChange)
|
||||
this.options.onChange(this.values.length>1 ? this.values : this.value, this);
|
||||
this.event = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
/* Smooth scrolling
|
||||
Changes links that link to other parts of this page to scroll
|
||||
smoothly to those links rather than jump to them directly, which
|
||||
can be a little disorienting.
|
||||
|
||||
sil, http://www.kryogenix.org/
|
||||
|
||||
v1.0 2003-11-11
|
||||
v1.1 2005-06-16 wrap it up in an object
|
||||
*/
|
||||
|
||||
var ss = {
|
||||
fixAllLinks: function() {
|
||||
// Get a list of all links in the page
|
||||
var allLinks = document.getElementsByTagName('a');
|
||||
// Walk through the list
|
||||
for (var i=0;i<allLinks.length;i++) {
|
||||
var lnk = allLinks[i];
|
||||
if ((lnk.href && lnk.href.indexOf('#') != -1) &&
|
||||
( (lnk.pathname == location.pathname) ||
|
||||
('/'+lnk.pathname == location.pathname) ) &&
|
||||
(lnk.search == location.search)) {
|
||||
// If the link is internal to the page (begins in #)
|
||||
// then attach the smoothScroll function as an onclick
|
||||
// event handler
|
||||
ss.addEvent(lnk,'click',ss.smoothScroll);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
smoothScroll: function(e) {
|
||||
// This is an event handler; get the clicked on element,
|
||||
// in a cross-browser fashion
|
||||
if (window.event) {
|
||||
target = window.event.srcElement;
|
||||
} else if (e) {
|
||||
target = e.target;
|
||||
} else return;
|
||||
|
||||
// Make sure that the target is an element, not a text node
|
||||
// within an element
|
||||
if (target.nodeName.toLowerCase() != 'a') {
|
||||
target = target.parentNode;
|
||||
}
|
||||
|
||||
// Paranoia; check this is an A tag
|
||||
if (target.nodeName.toLowerCase() != 'a') return;
|
||||
|
||||
// Find the <a name> tag corresponding to this href
|
||||
// First strip off the hash (first character)
|
||||
anchor = target.hash.substr(1);
|
||||
// Now loop all A tags until we find one with that name
|
||||
var allLinks = document.getElementsByTagName('a');
|
||||
var destinationLink = null;
|
||||
for (var i=0;i<allLinks.length;i++) {
|
||||
var lnk = allLinks[i];
|
||||
if (lnk.name && (lnk.name == anchor)) {
|
||||
destinationLink = lnk;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If we didn't find a destination, give up and let the browser do
|
||||
// its thing
|
||||
if (!destinationLink) return true;
|
||||
|
||||
// Find the destination's position
|
||||
var destx = destinationLink.offsetLeft;
|
||||
var desty = destinationLink.offsetTop;
|
||||
var thisNode = destinationLink;
|
||||
while (thisNode.offsetParent &&
|
||||
(thisNode.offsetParent != document.body)) {
|
||||
thisNode = thisNode.offsetParent;
|
||||
destx += thisNode.offsetLeft;
|
||||
desty += thisNode.offsetTop;
|
||||
}
|
||||
|
||||
// Stop any current scrolling
|
||||
clearInterval(ss.INTERVAL);
|
||||
|
||||
cypos = ss.getCurrentYPos();
|
||||
|
||||
ss_stepsize = parseInt((desty-cypos)/ss.STEPS);
|
||||
ss.INTERVAL =
|
||||
setInterval('ss.scrollWindow('+ss_stepsize+','+desty+',"'+anchor+'")',10);
|
||||
|
||||
// And stop the actual click happening
|
||||
if (window.event) {
|
||||
window.event.cancelBubble = true;
|
||||
window.event.returnValue = false;
|
||||
}
|
||||
if (e && e.preventDefault && e.stopPropagation) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
},
|
||||
|
||||
scrollWindow: function(scramount,dest,anchor) {
|
||||
wascypos = ss.getCurrentYPos();
|
||||
isAbove = (wascypos < dest);
|
||||
window.scrollTo(0,wascypos + scramount);
|
||||
iscypos = ss.getCurrentYPos();
|
||||
isAboveNow = (iscypos < dest);
|
||||
if ((isAbove != isAboveNow) || (wascypos == iscypos)) {
|
||||
// if we've just scrolled past the destination, or
|
||||
// we haven't moved from the last scroll (i.e., we're at the
|
||||
// bottom of the page) then scroll exactly to the link
|
||||
window.scrollTo(0,dest);
|
||||
// cancel the repeating timer
|
||||
clearInterval(ss.INTERVAL);
|
||||
// and jump to the link directly so the URL's right
|
||||
location.hash = anchor;
|
||||
}
|
||||
},
|
||||
|
||||
getCurrentYPos: function() {
|
||||
if (document.body && document.body.scrollTop)
|
||||
return document.body.scrollTop;
|
||||
if (document.documentElement && document.documentElement.scrollTop)
|
||||
return document.documentElement.scrollTop;
|
||||
if (window.pageYOffset)
|
||||
return window.pageYOffset;
|
||||
return 0;
|
||||
},
|
||||
|
||||
addEvent: function(elm, evType, fn, useCapture) {
|
||||
// addEvent and removeEvent
|
||||
// cross-browser event handling for IE5+, NS6 and Mozilla
|
||||
// By Scott Andrew
|
||||
if (elm.addEventListener){
|
||||
elm.addEventListener(evType, fn, useCapture);
|
||||
return true;
|
||||
} else if (elm.attachEvent){
|
||||
var r = elm.attachEvent("on"+evType, fn);
|
||||
return r;
|
||||
} else {
|
||||
alert("Handler could not be removed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ss.STEPS = 25;
|
||||
|
||||
ss.addEvent(window,"load",ss.fixAllLinks);
|
||||
@@ -0,0 +1,35 @@
|
||||
/*********************************************************************************
|
||||
** 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.
|
||||
*
|
||||
********************************************************************************/
|
||||
var selTags=document.getElementsByTagName("SELECT")
|
||||
function showSubMenu() {
|
||||
getObj("subMenuBg").style.display=getObj("subMenu").style.display="block"
|
||||
getObj("subMenuBg").style.top=getObj("subMenu").style.top=findPosY(getObj("showSubMenu"))+15
|
||||
getObj("subMenuBg").style.left=getObj("subMenu").style.left=findPosX(getObj("showSubMenu"))+getObj("showSubMenu").offsetWidth-getObj("subMenu").offsetWidth
|
||||
getObj("subMenuBg").style.width=getObj("subMenu").offsetWidth
|
||||
getObj("subMenuBg").style.height=getObj("subMenu").offsetHeight
|
||||
|
||||
/*for (i=0;i<selTags.length;i++)
|
||||
selTags[i].style.visibility="hidden"*/
|
||||
}
|
||||
function hideSubMenu(ev) {
|
||||
if (!ev) var obj = window.event.srcElement;
|
||||
else var obj = ev.target;
|
||||
|
||||
if (obj.id!="showSubMenu") {
|
||||
if (getObj("subMenu").style.display=="block") {
|
||||
getObj("subMenuBg").style.display="none"
|
||||
getObj("subMenu").style.display="none"
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0;i<selTags.length;i++)
|
||||
selTags[i].style.visibility="visible"
|
||||
}
|
||||
document.onclick=hideSubMenu;
|
||||
@@ -0,0 +1,54 @@
|
||||
/***********************************************
|
||||
* Image Thumbnail Viewer II script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
|
||||
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
|
||||
* This notice must stay intact for legal use
|
||||
***********************************************/
|
||||
|
||||
//Specify image paths and optional link (set link to "" for no link):
|
||||
//from getContactImages function in include/utils/Commonutils.php
|
||||
//Preload images ("yes" or "no"):
|
||||
var preloadimg="no"
|
||||
|
||||
//Set optional link target to be added to all images with a link:
|
||||
var optlinktarget=""
|
||||
|
||||
//Set image border width
|
||||
var imgborderwidth=0
|
||||
|
||||
//Optionally, change 1.0 and 0.7 below to affect Wipe gradient size and duration in seconds in IE5.5+:
|
||||
var filterstring="progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)"
|
||||
|
||||
///////No need to edit beyond here/////
|
||||
|
||||
if (preloadimg=="yes"){
|
||||
for (x=0; x<dynimages.length; x++){
|
||||
var myimage=new Image()
|
||||
myimage.src=dynimages[x][0]
|
||||
}
|
||||
}
|
||||
|
||||
function returnimgcode(theimg){
|
||||
var imghtml=""
|
||||
if (theimg[1]!="")
|
||||
imghtml='<div class=thumbnail><a href="'+theimg[1]+'" target="'+optlinktarget+'">'
|
||||
imghtml+='<img src="'+theimg[0]+'" border="'+imgborderwidth+'" width=270 height=200>'
|
||||
if (theimg[1]!="")
|
||||
imghtml+='</a></div>'
|
||||
document.getElementById("dynloadarea").style.display="block";
|
||||
return imghtml
|
||||
}
|
||||
|
||||
function modifyimage(loadarea, imgindex){
|
||||
if (document.getElementById){
|
||||
var imgobj=document.getElementById(loadarea)
|
||||
if (imgobj.filters && window.createPopup){
|
||||
imgobj.style.filter=filterstring
|
||||
imgobj.filters[0].Apply()
|
||||
}
|
||||
imgobj.innerHTML=returnimgcode(dynimages[imgindex])
|
||||
if (imgobj.filters && window.createPopup)
|
||||
imgobj.filters[0].Play()
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
/*+*******************************************************************************
|
||||
* 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.
|
||||
******************************************************************************/
|
||||
|
||||
/**
|
||||
* Generic uitype popup selection handler
|
||||
*/
|
||||
function vtlib_setvalue_from_popup(recordid,value,target_fieldname) {
|
||||
if(window.opener.document.EditView) {
|
||||
var domnode_id = window.opener.document.EditView[target_fieldname];
|
||||
var domnode_display = window.opener.document.EditView[target_fieldname+'_display'];
|
||||
if(domnode_id) domnode_id.value = recordid;
|
||||
if(domnode_display) domnode_display.value = value;
|
||||
return true;
|
||||
} else if(window.opener.document.QcEditView) {
|
||||
var domnode_id = window.opener.document.QcEditView[target_fieldname];
|
||||
var domnode_display = window.opener.document.QcEditView[target_fieldname+'_display'];
|
||||
if(domnode_id) domnode_id.value = recordid;
|
||||
if(domnode_display) domnode_display.value = value;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the vtiger field help if available.
|
||||
*/
|
||||
function vtlib_field_help_show(basenode, fldname) {
|
||||
var domnode = $('vtlib_fieldhelp_div');
|
||||
|
||||
if(typeof(fieldhelpinfo) == 'undefined') return;
|
||||
|
||||
var helpcontent = fieldhelpinfo[fldname];
|
||||
if(typeof(helpcontent) == 'undefined') return;
|
||||
|
||||
if(!domnode) {
|
||||
domnode = document.createElement('div');
|
||||
domnode.id = 'vtlib_fieldhelp_div';
|
||||
domnode.className = 'dvtSelectedCell';
|
||||
domnode.style.position = 'absolute';
|
||||
domnode.style.width = '150px';
|
||||
domnode.style.padding = '4px';
|
||||
domnode.style.fontWeight = 'normal';
|
||||
document.body.appendChild(domnode);
|
||||
|
||||
domnode = $('vtlib_fieldhelp_div');
|
||||
Event.observe(domnode, 'mouseover', function() { $('vtlib_fieldhelp_div').show(); });
|
||||
Event.observe(domnode, 'mouseout', vtlib_field_help_hide);
|
||||
}
|
||||
else {
|
||||
domnode.show();
|
||||
}
|
||||
domnode.innerHTML = helpcontent;
|
||||
fnvshobj(basenode,'vtlib_fieldhelp_div');
|
||||
}
|
||||
/**
|
||||
* Hide the vtiger field help
|
||||
*/
|
||||
function vtlib_field_help_hide(evt) {
|
||||
var domnode = $('vtlib_fieldhelp_div');
|
||||
if(domnode) domnode.hide();
|
||||
}
|
||||
|
||||
/**
|
||||
* Listview Javascript Event handlers API
|
||||
*
|
||||
* Example:
|
||||
* vtlib_listview.register('cell.onmouseover', function(evtparams, moreparams) { console.log(evtparams); }, [10,20]);
|
||||
* vtlib_listview.register('cell.onmouseout', function(evtparams) {console.log(evtparams); });
|
||||
*/
|
||||
var vtlib_listview = {
|
||||
/**
|
||||
* Callback function handlers that needs to be triggered for an event
|
||||
*
|
||||
* _handlers = {
|
||||
* 'event1' : [ [handlerfn11, handlerfn11_moreparams], [handlerfn2, handlerfn12_moreparams] ],
|
||||
* 'event2' : [ [handlerfn21, handlerfn21_moreparams], [handlerfn2, handlerfn22_moreparams] ]
|
||||
* }
|
||||
*/
|
||||
_handlers : {},
|
||||
|
||||
/**
|
||||
* Register handler function for the event
|
||||
*/
|
||||
register : function(evttype, handler, callback_params) {
|
||||
if(typeof(callback_params) == 'undefined') callback_params = false;
|
||||
if(typeof(vtlib_listview._handlers[evttype]) == 'undefined') {
|
||||
vtlib_listview._handlers[evttype] = [];
|
||||
}
|
||||
// Event handlerinfo is an array having (function, optional_more_parameters)
|
||||
vtlib_listview._handlers[evttype].push([handler, callback_params]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Invoke handler function based on event type
|
||||
*/
|
||||
invoke_handler : function(evttype, event_params) {
|
||||
var evthandlers = vtlib_listview._handlers[evttype];
|
||||
if(typeof(evthandlers) == 'undefined') return;
|
||||
for(var index = 0; index < evthandlers.length; ++index) {
|
||||
var evthandlerinfo = evthandlers[index];
|
||||
// Event handlerinfo is an array having (function, optional_more_parameters)
|
||||
var evthandlerfn = evthandlerinfo[0];
|
||||
if(typeof(evthandlerfn) == 'function') {
|
||||
evthandlerfn(event_params, evthandlerinfo[1]);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Trigger handler function for the event
|
||||
*/
|
||||
trigger : function(evttype, node) {
|
||||
if(evttype == 'cell.onmouseover' || evttype == 'cell.onmouseout') {
|
||||
// Catch hold of DOM element which has meta inforamtion.
|
||||
var innerNodes = node.getElementsByTagName('span');
|
||||
if(typeof(innerNodes) != 'undefined') {
|
||||
var cellhandler = false;
|
||||
for(var index = 0; index < innerNodes.length; ++index) {
|
||||
var innerNodeAttrs = innerNodes[index].attributes;
|
||||
if(typeof(innerNodeAttrs) != 'undefined' && typeof(innerNodeAttrs.type) != 'undefined' && innerNodeAttrs['type'].nodeValue == 'vtlib_metainfo') {
|
||||
cellhandler = innerNodes[index];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(cellhandler == false) return;
|
||||
var event_params = {
|
||||
'event' : evttype,
|
||||
'domnode': node,
|
||||
'module' : cellhandler.attributes['vtmodule'].nodeValue,
|
||||
'fieldname': cellhandler.attributes['vtfieldname'].nodeValue,
|
||||
'recordid': cellhandler.attributes['vtrecordid'].nodeValue
|
||||
}
|
||||
vtlib_listview.invoke_handler(evttype, event_params);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/** END **/
|
||||