From dc9bd178d6f5eb4d8e7160a12f0f3afc3b899698 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Tue, 16 Nov 2010 05:55:43 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=88=B0=205.2=20=E6=AD=A3?= =?UTF-8?q?=E5=BC=8F=E7=89=88=E5=90=8E=E7=AC=AC=E4=B8=80=E6=AC=A1=20SVN=20?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit yuchenghu@hawebs.net git-svn-id: https://svn.code.sf.net/p/hawebs/svn@590 a2543c7e-f6e9-4f8a-8bff-1ffc34733512 --- .../trunk/modules/CustomView/ChangeStatus.php | 54 - .../trunk/modules/CustomView/CustomView.js | 393 ---- .../trunk/modules/CustomView/CustomView.php | 2057 ----------------- .../modules/CustomView/CustomViewAjax.php | 13 - .../trunk/modules/CustomView/Delete.php | 31 - .../trunk/modules/CustomView/EditView.php | 391 ---- oss/vtiger/trunk/modules/CustomView/Forms.php | 253 -- .../trunk/modules/CustomView/ListViewTop.php | 169 -- .../modules/CustomView/PopulateCustomView.php | 644 ------ oss/vtiger/trunk/modules/CustomView/Save.php | 247 -- .../trunk/modules/CustomView/SaveAction.php | 52 - .../modules/CustomView/SendMailAction.php | 172 -- oss/vtiger/trunk/modules/CustomView/index.php | 17 - .../CustomView/language/en_us.lang.php | 285 --- .../CustomView/language/zh_cn.lang.php | 282 --- 15 files changed, 5060 deletions(-) delete mode 100644 oss/vtiger/trunk/modules/CustomView/ChangeStatus.php delete mode 100644 oss/vtiger/trunk/modules/CustomView/CustomView.js delete mode 100644 oss/vtiger/trunk/modules/CustomView/CustomView.php delete mode 100644 oss/vtiger/trunk/modules/CustomView/CustomViewAjax.php delete mode 100644 oss/vtiger/trunk/modules/CustomView/Delete.php delete mode 100644 oss/vtiger/trunk/modules/CustomView/EditView.php delete mode 100644 oss/vtiger/trunk/modules/CustomView/Forms.php delete mode 100644 oss/vtiger/trunk/modules/CustomView/ListViewTop.php delete mode 100644 oss/vtiger/trunk/modules/CustomView/PopulateCustomView.php delete mode 100644 oss/vtiger/trunk/modules/CustomView/Save.php delete mode 100644 oss/vtiger/trunk/modules/CustomView/SaveAction.php delete mode 100644 oss/vtiger/trunk/modules/CustomView/SendMailAction.php delete mode 100644 oss/vtiger/trunk/modules/CustomView/index.php delete mode 100644 oss/vtiger/trunk/modules/CustomView/language/en_us.lang.php delete mode 100644 oss/vtiger/trunk/modules/CustomView/language/zh_cn.lang.php diff --git a/oss/vtiger/trunk/modules/CustomView/ChangeStatus.php b/oss/vtiger/trunk/modules/CustomView/ChangeStatus.php deleted file mode 100644 index c4a224df..00000000 --- a/oss/vtiger/trunk/modules/CustomView/ChangeStatus.php +++ /dev/null @@ -1,54 +0,0 @@ -isPermittedCustomView($cvid,$now_action,$oCustomView->customviewmodule) == 'yes') - { - $updateStatusSql = "update vtiger_customview set status=? where cvid=? and entitytype=?"; - $updateresult = $adb->pquery($updateStatusSql, array($status, $cvid, $module)); - if(!$updateresult) - echo ':#:FAILURE:#:'; - else - echo ':#:SUCCESS:#:' . $module . ':#:'; - } - else - { - global $theme, $app_strings; - echo "
"; - echo "
- - - - - - - - - -
- $app_strings[LBL_PERMISSION]
- $app_strings[LBL_GO_BACK]
-
-
"; - echo "
"; - exit; - } -} -?> \ No newline at end of file diff --git a/oss/vtiger/trunk/modules/CustomView/CustomView.js b/oss/vtiger/trunk/modules/CustomView/CustomView.js deleted file mode 100644 index 9e234cef..00000000 --- a/oss/vtiger/trunk/modules/CustomView/CustomView.js +++ /dev/null @@ -1,393 +0,0 @@ - /********************************************************************************* - ** 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 trimfValues(value) -{ - var string_array; - string_array = value.split(":"); - return string_array[4]; -} - -function updatefOptions(sel, opSelName) { - var selObj = document.getElementById(opSelName); - var fieldtype = null ; - - var currOption = selObj.options[selObj.selectedIndex]; - var currField = sel.options[sel.selectedIndex]; - var fld = currField.value.split(":"); - var tod = fld[4]; - if(fld[4] == 'D' || fld[4] == 'DT') - { - $("and"+sel.id).innerHTML = ""; - if(sel.id != "fcol5") - $("and"+sel.id).innerHTML = "("+$("user_dateformat").value+") "+alert_arr.LBL_AND; - else - $("and"+sel.id).innerHTML = "("+$("user_dateformat").value+") "; - } - else if(fld[4] == 'T' && fld[1] != 'time_start' && fld[1] != 'time_end') - { - $("and"+sel.id).innerHTML = ""; - if(sel.id != "fcol5") - $("and"+sel.id).innerHTML = "("+$("user_dateformat").value+" hh:mm:ss) "+alert_arr.LBL_AND; - else - $("and"+sel.id).innerHTML = "("+$("user_dateformat").value+" hh:mm:ss) "; - } - -else if(fld[4] == 'I' && fld[1] == 'time_start' || fld[1] == 'time_end') - { - $("and"+sel.id).innerHTML = ""; - if(sel.id != "fcol5") - $("and"+sel.id).innerHTML = "hh:mm "+alert_arr.LBL_AND; - else - $("and"+sel.id).innerHTML = "hh:mm"; - } - - else if(fld[4] == 'T' && fld[1] == 'time_start' || fld[1] == 'time_end') - { - $("and"+sel.id).innerHTML = ""; - if(sel.id != "fcol5") - $("and"+sel.id).innerHTML = "hh:mm "+alert_arr.LBL_AND; - else - $("and"+sel.id).innerHTML = "hh:mm"; - } - - - else if(fld[4] == 'C') - { - $("and"+sel.id).innerHTML = ""; - if(sel.id != "fcol5") - $("and"+sel.id).innerHTML = "( Yes / No ) "+alert_arr.LBL_AND; - else - $("and"+sel.id).innerHTML = "( Yes / No ) "; - } - else { - $("and"+sel.id).innerHTML = ""; - if(sel.id != "fcol5") - $("and"+sel.id).innerHTML = " "+alert_arr.LBL_AND; - else - $("and"+sel.id).innerHTML = " "; - } - - if(currField.value != null && currField.value.length != 0) - { - fieldtype = trimfValues(currField.value); - ops = typeofdata[fieldtype]; - var off = 0; - if(ops != null) - { - - var nMaxVal = selObj.length; - for(nLoop = 0; nLoop < nMaxVal; nLoop++) - { - selObj.remove(0); - } - selObj.options[0] = new Option ('None', ''); - if (currField.value == '') { - selObj.options[0].selected = true; - } - off = 1; - for (var i = 0; i < ops.length; i++) - { - var label = fLabels[ops[i]]; - if (label == null) continue; - var option = new Option (fLabels[ops[i]], ops[i]); - selObj.options[i + off] = option; - if (currOption != null && currOption.value == option.value) - { - option.selected = true; - } - } - } - }else - { - if (currField.value == '') { - selObj.options[0].selected = true; - } - } - -} -function verify_data() { - var isError = false; - var errorMessage = ""; - if (trim(document.CustomView.viewName.value) == "") { - isError = true; - errorMessage += "\nView Name"; - } - // Here we decide whether to submit the form. - if (isError == true) { - alert(alert_arr.MISSING_REQUIRED_FIELDS + errorMessage); - return false; - } - //return true; -} - - -function CancelForm() -{ -var cvmodule = document.templatecreate.cvmodule.value; -var viewid = document.templatecreate.cvid.value; -document.location.href = "index.php?module="+cvmodule+"&action=index&viewname="+viewid; -} - - -function check4null(form) -{ - var isError = false; - var errorMessage = ""; - // Here we decide whether to submit the form. - if (trim(form.subject.value) =='') { - isError = true; - errorMessage += "\n subject"; - form.subject.focus(); - } - - // Here we decide whether to submit the form. - if (isError == true) { - alert(alert_arr.MISSING_REQUIRED_FIELDS + errorMessage); - return false; - } - return true; -} - -// Added for Custom View Advance Filter validation -function checkval() -{ - var value,option,arr,dttime,sep; - for(var i=1;i<=5;i++) - { - value=trim(getObj("fval"+i).value); - option=getObj("fcol"+i).value; - fopvalue=trim(getObj("fop"+i).value); - if(option !="" && value !="") - { - if(getObj("fop"+i).selectedIndex == 0) - { - alert(alert_arr.LBL_SELECT_CRITERIA); - return false; - } - arr=option.split(":"); - if(arr[4] == "N" || arr[4] == "I" || arr[4] == "NN") - { - sep=value.split(","); - for(var j=0;j 1) - { - if(!cv_patternValidate(dttime[1],"Time","TIMESECONDS")) - { - getObj("fval"+i).select(); - return false; - } - } - } - - } - if(arr[4] == "C") - { - if(value == "1") - { - getObj("fval"+i).value= "yes"; - continue; - } - else if(value == "0") - { - getObj("fval"+i).value= "no"; - continue; - } - if(value.toLowerCase() != "yes") if(value.toLowerCase() != "no") - { - alert(alert_arr.LBL_PROVIDE_YES_NO); - getObj("fval"+i).select(); - return false; - } - } - } - else if (!(option =="" && fopvalue == "" && value == "")) - { - if(option =="") - { - alert(alert_arr.LBL_SELECT_COLUMN); - return false; - } - if(fopvalue == "") - { - alert(alert_arr.LBL_SELECT_CRITERIA); - return false; - } - } - } -return true; -} - -//Added for Custom view validation -//Copied from general.js and altered some lines. becos we cant send vales to function present in general.js. it accept only field names. -function cv_dateValidate(fldval,fldLabel,type) { - if(cv_patternValidate(fldval,fldLabel,"DATE")==false) - return false; - dateval=fldval.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) - return false - } - - if ((mm==2) && (dd>29)) {//checking of no. of days in february month - alert(alert_arr.ENTER_VALID+fldLabel) - return false - } - - if ((mm==2) && (dd>28) && ((yyyy%4)!=0)) {//leap year checking - alert(alert_arr.ENTER_VALID+fldLabel) - return false - } - - switch (parseInt(mm)) { - case 2 : - case 4 : - case 6 : - case 9 : - case 11 : if (dd>30) { - alert(alert_arr.ENTER_VALID+fldLabel) - 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)) { - return false - } else return true; - } else return true; -} - -//Added for Custom view validation -//Copied from general.js and altered some lines. becos we cant send vales to function present in general.js. it accept only field names. -function cv_patternValidate(fldval,fldLabel,type) { - if (type.toUpperCase()=="DATE") {//DATE validation - - 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()=="TIMESECONDS") - { - //TIME validation.optional hour, min and seconds - //var re = new RegExp("^([0-1][0-9]|[2][0-3]):([0-5][0-9]):([0-5][0-9])$"); - var re = new RegExp("^(([0-1]?[0-9])|([2][0-3]))(:([0-5]?[0-9]))?(:([0-5]?[0-9]))?$"); - } - else if (type.toUpperCase()=="TIME") - { - //TIME validation. optional hours and minutes only. dont accept second. added for calendar start and end time field. - var re = new RegExp("^(([0-1]?[0-9])|([2][0-3]))(:([0-5]?[0-9]))$"); - } - if (!re.test(fldval)) { - alert(alert_arr.ENTER_VALID + fldLabel) - return false - } - else return true - - - - -} -//added to hide date selection option, if a user doesn't have permission for not permitter standard filter column -//added to fix the ticket #5117 -function standardFilterDisplay() -{ - if(getObj("stdDateFilterField")) - { - if(document.CustomView.stdDateFilterField.selectedIndex > -1 && document.CustomView.stdDateFilterField.options[document.CustomView.stdDateFilterField.selectedIndex].value == "not_accessible") - { - getObj('stdDateFilter').disabled = true; - getObj('startdate').disabled = true; getObj('enddate').disabled = true; - getObj('jscal_trigger_date_start').style.visibility="hidden"; - getObj('jscal_trigger_date_end').style.visibility="hidden"; - } - else - { - getObj('stdDateFilter').disabled = false; - getObj('startdate').disabled = false; - getObj('enddate').disabled = false; - getObj('jscal_trigger_date_start').style.visibility="visible"; - getObj('jscal_trigger_date_end').style.visibility="visible"; - } - } -} - diff --git a/oss/vtiger/trunk/modules/CustomView/CustomView.php b/oss/vtiger/trunk/modules/CustomView/CustomView.php deleted file mode 100644 index 5bfb7379..00000000 --- a/oss/vtiger/trunk/modules/CustomView/CustomView.php +++ /dev/null @@ -1,2057 +0,0 @@ -"".$mod_strings['equals']."", - "n"=>"".$mod_strings['not equal to']."", - "s"=>"".$mod_strings['starts with']."", - "ew"=>"".$mod_strings['ends with']."", - "c"=>"".$mod_strings['contains']."", - "k"=>"".$mod_strings['does not contain']."", - "l"=>"".$mod_strings['less than']."", - "g"=>"".$mod_strings['greater than']."", - "m"=>"".$mod_strings['less or equal']."", - "h"=>"".$mod_strings['greater or equal']."", - ); - -class CustomView extends CRMEntity{ - - - - var $module_list = Array(); - - var $customviewmodule; - - var $list_fields; - - var $list_fields_name; - - var $setdefaultviewid; - - var $escapemodule; - - var $mandatoryvalues; - - var $showvalues; - - var $data_type; - - // Information as defined for this instance in the database table. - protected $_status = false; - protected $_userid = false; - protected $meta; - protected $moduleMetaInfo; - - /** This function sets the currentuser id to the class variable smownerid, - * modulename to the class variable customviewmodule - * @param $module -- The module Name:: Type String(optional) - * @returns nothing - */ - function CustomView($module="") - { - global $current_user,$adb; - $this->customviewmodule = $module; - $this->escapemodule[] = $module."_"; - $this->escapemodule[] = "_"; - $this->smownerid = $current_user->id; - $this->moduleMetaInfo = array(); - if($module != "" && $module != 'Calendar') { - $this->meta = $this->getMeta($module, $current_user); - } - } - - /** - * - * @param String:ModuleName $module - * @return EntityMeta - */ - public function getMeta($module, $user) { - $db = PearDatabase::getInstance(); - if (empty($this->moduleMetaInfo[$module])) { - $handler = vtws_getModuleHandlerFromName($module, $user); - $meta = $handler->getMeta(); - $this->moduleMetaInfo[$module] = $meta; - } - return $this->moduleMetaInfo[$module]; - } - - /** To get the customViewId of the specified module - * @param $module -- The module Name:: Type String - * @returns customViewId :: Type Integer - */ - function getViewId($module) - { - global $adb,$current_user; - $now_action = vtlib_purify($_REQUEST['action']); - if(empty($_REQUEST['viewname'])) { - if (isset($_SESSION['lvs'][$module]["viewname"]) && $_SESSION['lvs'][$module]["viewname"]!='') { - $viewid = $_SESSION['lvs'][$module]["viewname"]; - } - elseif($this->setdefaultviewid != "") { - $viewid = $this->setdefaultviewid; - } else { - $defcv_result = $adb->pquery("select default_cvid from vtiger_user_module_preferences where userid = ? and tabid =?", array($current_user->id, getTabid($module))); - if($adb->num_rows($defcv_result) > 0) { - $viewid = $adb->query_result($defcv_result,0,'default_cvid'); - } else { - $query="select cvid from vtiger_customview where setdefault=1 and entitytype=?"; - $cvresult=$adb->pquery($query, array($module)); - if($adb->num_rows($cvresult) > 0) { - $viewid = $adb->query_result($cvresult,0,'cvid'); - } else $viewid = ''; - } - } - - if($viewid == '' || $viewid == 0 || $this->isPermittedCustomView($viewid,$now_action,$module) != 'yes') { - $query="select cvid from vtiger_customview where viewname='All' and entitytype=?"; - $cvresult=$adb->pquery($query, array($module)); - $viewid = $adb->query_result($cvresult,0,'cvid'); - } - } - else { - $viewname = vtlib_purify($_REQUEST['viewname']); - if((is_string($viewname) && strtolower($viewname) == 'all') || $viewname == 0) { - $viewid = $this->getViewIdByName('All', $module); - } else { - $viewid = $viewname; - } - if($this->isPermittedCustomView($viewid,$now_action,$this->customviewmodule) != 'yes') - $viewid = 0; - } - $_SESSION['lvs'][$module]["viewname"] = $viewid; - return $viewid; - - } - //Return id of a view : Added by Pavani - function getViewIdByName($viewname, $module) - { - global $adb; - if(isset($viewname)) { - $query="select cvid from vtiger_customview where viewname=? and entitytype=?"; - $cvresult=$adb->pquery($query, array($viewname,$module)); - $viewid = $adb->query_result($cvresult,0,'cvid');; - return $viewid; - } else { - return 0; - } - } - - // return type array - /** to get the details of a customview - * @param $cvid :: Type Integer - * @returns $customviewlist Array in the following format - * $customviewlist = Array('viewname'=>value, - * 'setdefault'=>defaultchk, - * 'setmetrics'=>setmetricschk) - */ - - function getCustomViewByCvid($cvid) - { - global $adb,$current_user; - $tabid = getTabid($this->customviewmodule); - - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - - $ssql = "select vtiger_customview.* from vtiger_customview inner join vtiger_tab on vtiger_tab.name = vtiger_customview.entitytype"; - $ssql .= " where vtiger_customview.cvid=?"; - $sparams = array($cvid); - - if($is_admin == false) { - $ssql .= " and (vtiger_customview.status=0 or vtiger_customview.userid = ? or vtiger_customview.status = 3 or vtiger_customview.userid in(select vtiger_user2role.userid from vtiger_user2role inner join vtiger_users on vtiger_users.id=vtiger_user2role.userid inner join vtiger_role on vtiger_role.roleid=vtiger_user2role.roleid where vtiger_role.parentrole like '".$current_user_parent_role_seq."::%'))"; - array_push($sparams, $current_user->id); - } - $result = $adb->pquery($ssql, $sparams); - - $usercv_result = $adb->pquery("select default_cvid from vtiger_user_module_preferences where userid = ? and tabid = ?", array($current_user->id, $tabid)); - $def_cvid = $adb->query_result($usercv_result, 0, 'default_cvid'); - - while($cvrow=$adb->fetch_array($result)) - { - $customviewlist["viewname"] = $cvrow["viewname"]; - if((isset($def_cvid) || $def_cvid != '') && $def_cvid == $cvid) { - $customviewlist["setdefault"] = 1; - } else { - $customviewlist["setdefault"] = $cvrow["setdefault"]; - } - $customviewlist["setmetrics"] = $cvrow["setmetrics"]; - $customviewlist["userid"] = $cvrow["userid"]; - $customviewlist["status"] = $cvrow["status"]; - } - return $customviewlist; - } - - /** to get the customviewCombo for the class variable customviewmodule - * @param $viewid :: Type Integer - * $viewid will make the corresponding selected - * @returns $customviewCombo :: Type String - */ - - function getCustomViewCombo($viewid='', $markselected=true) - { - global $adb,$current_user; - global $app_strings; - $tabid = getTabid($this->customviewmodule); - - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - - $shtml_user = ''; - $shtml_pending = ''; - $shtml_public = ''; - $shtml_others = ''; - - $selected = 'selected'; - if ($markselected == false) $selected = ''; - - $ssql = "select vtiger_customview.*, vtiger_users.user_name from vtiger_customview inner join vtiger_tab on vtiger_tab.name = vtiger_customview.entitytype - left join vtiger_users on vtiger_customview.userid = vtiger_users.id "; - $ssql .= " where vtiger_tab.tabid=?"; - $sparams = array($tabid); - - if($is_admin == false){ - $ssql .= " and (vtiger_customview.status=0 or vtiger_customview.userid = ? or vtiger_customview.status = 3 or vtiger_customview.userid in(select vtiger_user2role.userid from vtiger_user2role inner join vtiger_users on vtiger_users.id=vtiger_user2role.userid inner join vtiger_role on vtiger_role.roleid=vtiger_user2role.roleid where vtiger_role.parentrole like '".$current_user_parent_role_seq."::%'))"; - array_push($sparams, $current_user->id); - } - $ssql .= " ORDER BY viewname"; - $result = $adb->pquery($ssql, $sparams); - while($cvrow=$adb->fetch_array($result)) - { - if($cvrow['viewname'] == 'All') - { - $cvrow['viewname'] = $app_strings['COMBO_ALL']; - } - - $option = ''; - $viewname = $cvrow['viewname']; - if ($cvrow['status'] == CV_STATUS_DEFAULT || $cvrow['userid'] == $current_user->id) { - $disp_viewname = $viewname; - } else { - $disp_viewname = $viewname . " [" . $cvrow['user_name'] . "] "; - } - - - if($cvrow['setdefault'] == 1 && $viewid =='') - { - $option = ""; - $this->setdefaultviewid = $cvrow['cvid']; - } - elseif($cvrow['cvid'] == $viewid) - { - $option = ""; - $this->setdefaultviewid = $cvrow['cvid']; - } - else - { - $option = ""; - } - - // Add the option to combo box at appropriate section - if($option != '') { - if ($cvrow['status'] == CV_STATUS_DEFAULT || $cvrow['userid'] == $current_user->id) { - $shtml_user .= $option; - } elseif ($cvrow['status'] == CV_STATUS_PUBLIC) { - if ($shtml_public == '') - $shtml_public = ""; - $shtml_public .= $option; - } elseif ($cvrow['status'] == CV_STATUS_PENDING) { - if ($shtml_pending == '') - $shtml_pending = ""; - $shtml_pending .= $option; - } else { - if ($shtml_others == '') - $shtml_others = ""; - $shtml_others .= $option; - } - } - } - $shtml = $shtml_user; - if ($is_admin == true) $shtml .= $shtml_pending; - $shtml = $shtml . $shtml_public . $shtml_others; - return $shtml; - } - - /** to get the getColumnsListbyBlock for the given module and Block - * @param $module :: Type String - * @param $block :: Type Integer - * @returns $columnlist Array in the format - * $columnlist = Array ($fieldlabel =>'$fieldtablename:$fieldcolname:$fieldname:$module_$fieldlabel1:$fieldtypeofdata', - $fieldlabel1 =>'$fieldtablename1:$fieldcolname1:$fieldname1:$module_$fieldlabel11:$fieldtypeofdata1', - | - $fieldlabeln =>'$fieldtablenamen:$fieldcolnamen:$fieldnamen:$module_$fieldlabel1n:$fieldtypeofdatan') - */ - - function getColumnsListbyBlock($module,$block) - { - global $adb,$mod_strings,$app_strings; - $block_ids = explode(",", $block); - $tabid = getTabid($module); - global $current_user; - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - if (empty($this->meta) && $module != 'Calendar') { - $this->meta = $this->getMeta($module, $current_user); - } - if($tabid == 9) - $tabid ="9,16"; - $display_type = " vtiger_field.displaytype in (1,2,3)"; - - if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) - { - $tab_ids = explode(",", $tabid); - $sql = "select * from vtiger_field "; - $sql.= " where vtiger_field.tabid in (". generateQuestionMarks($tab_ids) .") and vtiger_field.block in (". generateQuestionMarks($block_ids) .") and vtiger_field.presence in (0,2) and"; - $sql.= $display_type; - if($tabid == 9 || $tabid==16) - { - $sql.= " and vtiger_field.fieldname not in('notime','duration_minutes','duration_hours')"; - } - $sql.= " order by sequence"; - $params = array($tab_ids, $block_ids); - } - else - { - $tab_ids = explode(",", $tabid); - $profileList = getCurrentUserProfileList(); - $sql = "select * from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid "; - $sql.= " where vtiger_field.tabid in (". generateQuestionMarks($tab_ids) .") and vtiger_field.block in (". generateQuestionMarks($block_ids) .") and"; - $sql.= "$display_type and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_field.presence in (0,2)"; - - $params = array($tab_ids, $block_ids); - - if (count($profileList) > 0) { - $sql.= " and vtiger_profile2field.profileid in (". generateQuestionMarks($profileList) .")"; - array_push($params, $profileList); - } - if($tabid == 9 || $tabid==16) - { - $sql.= " and vtiger_field.fieldname not in('notime','duration_minutes','duration_hours')"; - } - - $sql.= " group by columnname order by sequence"; - } - if($tabid == '9,16') - $tabid = "9"; - $result = $adb->pquery($sql, $params); - $noofrows = $adb->num_rows($result); - //Added on 14-10-2005 -- added ticket id in list - if($module == 'HelpDesk' && $block == 25) - { - $module_columnlist['vtiger_crmentity:crmid::HelpDesk_Ticket_ID:I'] = 'Ticket ID'; - } - //Added to include vtiger_activity type in vtiger_activity vtiger_customview list - if($module == 'Calendar' && $block == 19) - { - $module_columnlist['vtiger_activity:activitytype:activitytype:Calendar_Activity_Type:V'] = 'Activity Type'; - } - - if($module == 'SalesOrder' && $block == 63) - $module_columnlist['vtiger_crmentity:crmid::SalesOrder_Order_No:I'] = $app_strings['Order No']; - - if($module == 'PurchaseOrder' && $block == 57) - $module_columnlist['vtiger_crmentity:crmid::PurchaseOrder_Order_No:I'] = $app_strings['Order No']; - - if($module == 'Quotes' && $block == 51) - $module_columnlist['vtiger_crmentity:crmid::Quotes_Quote_No:I'] = $app_strings['Quote No']; - if ($module != 'Calendar') { - $moduleFieldList = $this->meta->getModuleFields(); - } - for($i=0; $i<$noofrows; $i++) - { - $fieldtablename = $adb->query_result($result,$i,"tablename"); - $fieldcolname = $adb->query_result($result,$i,"columnname"); - $fieldname = $adb->query_result($result,$i,"fieldname"); - $fieldtype = $adb->query_result($result,$i,"typeofdata"); - $fieldtype = explode("~",$fieldtype); - $fieldtypeofdata = $fieldtype[0]; - $fieldlabel = $adb->query_result($result,$i,"fieldlabel"); - $field = $moduleFieldList[$fieldname]; - if(!empty($field) && $field->getFieldDataType() == 'reference') { - $fieldtypeofdata = 'V'; - } else { - //Here we Changing the displaytype of the field. So that its criteria will be - //displayed Correctly in Custom view Advance Filter. - $fieldtypeofdata=ChangeTypeOfData_Filter($fieldtablename,$fieldcolname, - $fieldtypeofdata); - } - if($fieldlabel == "Related To") - { - $fieldlabel = "Related to"; - } - if($fieldlabel == "Start Date & Time") - { - $fieldlabel = "Start Date"; - if($module == 'Calendar' && $block == 19) - $module_columnlist['vtiger_activity:time_start::Calendar_Start_Time:I'] = 'Start Time'; - - } - $fieldlabel1 = str_replace(" ","_",$fieldlabel); - $optionvalue = $fieldtablename.":".$fieldcolname.":".$fieldname.":".$module."_". - $fieldlabel1.":".$fieldtypeofdata; - //added to escape attachments fields in customview as we have multiple attachments - $fieldlabel = getTranslatedString($fieldlabel); //added to support i18n issue - if($module != 'HelpDesk' || $fieldname !='filename') - $module_columnlist[$optionvalue] = $fieldlabel; - if($fieldtype[1] == "M") - { - $this->mandatoryvalues[] = "'".$optionvalue."'"; - $this->showvalues[] = $fieldlabel; - $this->data_type[$fieldlabel] = $fieldtype[1]; - } - } - return $module_columnlist; - } - - /** to get the getModuleColumnsList for the given module - * @param $module :: Type String - * @returns $ret_module_list Array in the following format - * $ret_module_list = - Array ('module' => - Array('BlockLabel1' => - Array('$fieldtablename:$fieldcolname:$fieldname:$module_$fieldlabel1:$fieldtypeofdata'=>$fieldlabel, - Array('$fieldtablename1:$fieldcolname1:$fieldname1:$module_$fieldlabel11:$fieldtypeofdata1'=>$fieldlabel1, - Array('BlockLabel2' => - Array('$fieldtablename:$fieldcolname:$fieldname:$module_$fieldlabel1:$fieldtypeofdata'=>$fieldlabel, - Array('$fieldtablename1:$fieldcolname1:$fieldname1:$module_$fieldlabel11:$fieldtypeofdata1'=>$fieldlabel1, - | - Array('BlockLabeln' => - Array('$fieldtablename:$fieldcolname:$fieldname:$module_$fieldlabel1:$fieldtypeofdata'=>$fieldlabel, - Array('$fieldtablename1:$fieldcolname1:$fieldname1:$module_$fieldlabel11:$fieldtypeofdata1'=>$fieldlabel1, - - - */ - - - function getModuleColumnsList($module) - { - - $module_info = $this->getCustomViewModuleInfo($module); - foreach($this->module_list[$module] as $key=>$value) - { - $columnlist = $this->getColumnsListbyBlock($module,$value); - - if(isset($columnlist)) - { - $ret_module_list[$module][$key] = $columnlist; - } - } - return $ret_module_list; - } - - /** to get the getModuleColumnsList for the given customview - * @param $cvid :: Type Integer - * @returns $columnlist Array in the following format - * $columnlist = Array( $columnindex => $columnname, - * $columnindex1 => $columnname1, - * | - * $columnindexn => $columnnamen) - */ - function getColumnsListByCvid($cvid) - { - global $adb; - - $sSQL = "select vtiger_cvcolumnlist.* from vtiger_cvcolumnlist"; - $sSQL .= " inner join vtiger_customview on vtiger_customview.cvid = vtiger_cvcolumnlist.cvid"; - $sSQL .= " where vtiger_customview.cvid =? order by vtiger_cvcolumnlist.columnindex"; - $result = $adb->pquery($sSQL, array($cvid)); - while($columnrow = $adb->fetch_array($result)) - { - $columnlist[$columnrow['columnindex']] = $columnrow['columnname']; - } - return $columnlist; - } - - /** to get the standard filter fields or the given module - * @param $module :: Type String - * @returns $stdcriteria_list Array in the following format - * $stdcriteria_list = Array( $tablename:$columnname:$fieldname:$module_$fieldlabel => $fieldlabel, - * $tablename1:$columnname1:$fieldname1:$module_$fieldlabel1 => $fieldlabel1, - * | - * $tablenamen:$columnnamen:$fieldnamen:$module_$fieldlabeln => $fieldlabeln) - */ - function getStdCriteriaByModule($module) - { - global $adb; - $tabid = getTabid($module); - - global $current_user; - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - - $module_info = $this->getCustomViewModuleInfo($module); - foreach($this->module_list[$module] as $key=>$blockid) - { - $blockids[] = $blockid; - } - - if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) - { - $sql = "select * from vtiger_field inner join vtiger_tab on vtiger_tab.tabid = vtiger_field.tabid "; - $sql.= " where vtiger_field.tabid=? and vtiger_field.block in (". generateQuestionMarks($blockids) .") - and vtiger_field.uitype in (5,6,23,70)"; - $sql.= " and vtiger_field.presence in (0,2) order by vtiger_field.sequence"; - $params = array($tabid, $blockids); - } - else - { - $profileList = getCurrentUserProfileList(); - $sql = "select * from vtiger_field inner join vtiger_tab on vtiger_tab.tabid = vtiger_field.tabid inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid "; - $sql.= " where vtiger_field.tabid=? and vtiger_field.block in (". generateQuestionMarks($blockids) .") and vtiger_field.uitype in (5,6,23,70)"; - $sql.= " and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_field.presence in (0,2)"; - - $params = array($tabid, $blockids); - - if (count($profileList) > 0) { - $sql.= " and vtiger_profile2field.profileid in (". generateQuestionMarks($profileList) .")"; - array_push($params, $profileList); - } - - $sql.= " order by vtiger_field.sequence"; - } - - $result = $adb->pquery($sql, $params); - - while($criteriatyperow = $adb->fetch_array($result)) - { - $fieldtablename = $criteriatyperow["tablename"]; - $fieldcolname = $criteriatyperow["columnname"]; - $fieldlabel = $criteriatyperow["fieldlabel"]; - $fieldname = $criteriatyperow["fieldname"]; - $fieldlabel1 = str_replace(" ","_",$fieldlabel); - $optionvalue = $fieldtablename.":".$fieldcolname.":".$fieldname.":".$module."_".$fieldlabel1; - $stdcriteria_list[$optionvalue] = $fieldlabel; - } - - return $stdcriteria_list; - - } - - /** to get the standard filter criteria - * @param $selcriteria :: Type String (optional) - * @returns $filter Array in the following format - * $filter = Array( 0 => array('value'=>$filterkey,'text'=>$mod_strings[$filterkey],'selected'=>$selected) - * 1 => array('value'=>$filterkey1,'text'=>$mod_strings[$filterkey1],'selected'=>$selected) - * | - * n => array('value'=>$filterkeyn,'text'=>$mod_strings[$filterkeyn],'selected'=>$selected) - */ - function getStdFilterCriteria($selcriteria = "") - { - global $mod_strings; - $filter = array(); - - $stdfilter = Array("custom"=>"".$mod_strings['Custom']."", - "prevfy"=>"".$mod_strings['Previous FY']."", - "thisfy"=>"".$mod_strings['Current FY']."", - "nextfy"=>"".$mod_strings['Next FY']."", - "prevfq"=>"".$mod_strings['Previous FQ']."", - "thisfq"=>"".$mod_strings['Current FQ']."", - "nextfq"=>"".$mod_strings['Next FQ']."", - "yesterday"=>"".$mod_strings['Yesterday']."", - "today"=>"".$mod_strings['Today']."", - "tomorrow"=>"".$mod_strings['Tomorrow']."", - "lastweek"=>"".$mod_strings['Last Week']."", - "thisweek"=>"".$mod_strings['Current Week']."", - "nextweek"=>"".$mod_strings['Next Week']."", - "lastmonth"=>"".$mod_strings['Last Month']."", - "thismonth"=>"".$mod_strings['Current Month']."", - "nextmonth"=>"".$mod_strings['Next Month']."", - "last7days"=>"".$mod_strings['Last 7 Days']."", - "last30days"=>"".$mod_strings['Last 30 Days']."", - "last60days"=>"".$mod_strings['Last 60 Days']."", - "last90days"=>"".$mod_strings['Last 90 Days']."", - "last120days"=>"".$mod_strings['Last 120 Days']."", - "next30days"=>"".$mod_strings['Next 30 Days']."", - "next60days"=>"".$mod_strings['Next 60 Days']."", - "next90days"=>"".$mod_strings['Next 90 Days']."", - "next120days"=>"".$mod_strings['Next 120 Days']."", - ); - - foreach($stdfilter as $FilterKey=>$FilterValue) - { - if($FilterKey == $selcriteria) - { - $shtml['value'] = $FilterKey; - $shtml['text'] = $FilterValue; - $shtml['selected'] = "selected"; - }else - { - $shtml['value'] = $FilterKey; - $shtml['text'] = $FilterValue; - $shtml['selected'] = ""; - } - $filter[] = $shtml; - } - return $filter; - - } - - /** to get the standard filter criteria scripts - * @returns $jsStr : Type String - * This function will return the script to set the start data and end date - * for the standard selection criteria - */ - function getCriteriaJS() - { - - - $today = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d"), date("Y"))); - $tomorrow = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")+1, date("Y"))); - $yesterday = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")-1, date("Y"))); - - $currentmonth0 = date("Y-m-d",mktime(0, 0, 0, date("m"), "01", date("Y"))); - $currentmonth1 = date("Y-m-t"); - $lastmonth0 = date("Y-m-d",mktime(0, 0, 0, date("m")-1, "01", date("Y"))); - $lastmonth1 = date("Y-m-t", strtotime("-1 Month")); - $nextmonth0 = date("Y-m-d",mktime(0, 0, 0, date("m")+1, "01", date("Y"))); - $nextmonth1 = date("Y-m-t", strtotime("+1 Month")); - - $lastweek0 = date("Y-m-d",strtotime("-2 week Sunday")); - $lastweek1 = date("Y-m-d",strtotime("-1 week Saturday")); - - $thisweek0 = date("Y-m-d",strtotime("-1 week Sunday")); - $thisweek1 = date("Y-m-d",strtotime("this Saturday")); - - $nextweek0 = date("Y-m-d",strtotime("this Sunday")); - $nextweek1 = date("Y-m-d",strtotime("+1 week Saturday")); - - $next7days = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")+6, date("Y"))); - $next30days = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")+29, date("Y"))); - $next60days = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")+59, date("Y"))); - $next90days = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")+89, date("Y"))); - $next120days = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")+119, date("Y"))); - - $last7days = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")-6, date("Y"))); - $last30days = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")-29, date("Y"))); - $last60days = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")-59, date("Y"))); - $last90days = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")-89, date("Y"))); - $last120days = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")-119, date("Y"))); - - $currentFY0 = date("Y-m-d",mktime(0, 0, 0, "01", "01", date("Y"))); - $currentFY1 = date("Y-m-t",mktime(0, 0, 0, "12", date("d"), date("Y"))); - $lastFY0 = date("Y-m-d",mktime(0, 0, 0, "01", "01", date("Y")-1)); - $lastFY1 = date("Y-m-t", mktime(0, 0, 0, "12", date("d"), date("Y")-1)); - - $nextFY0 = date("Y-m-d",mktime(0, 0, 0, "01", "01", date("Y")+1)); - $nextFY1 = date("Y-m-t", mktime(0, 0, 0, "12", date("d"), date("Y")+1)); - - if(date("m") <= 3) - { - $cFq = date("Y-m-d",mktime(0, 0, 0, "01","01",date("Y"))); - $cFq1 = date("Y-m-d",mktime(0, 0, 0, "03","31",date("Y"))); - $nFq = date("Y-m-d",mktime(0, 0, 0, "04","01",date("Y"))); - $nFq1 = date("Y-m-d",mktime(0, 0, 0, "06","30",date("Y"))); - $pFq = date("Y-m-d",mktime(0, 0, 0, "10","01",date("Y")-1)); - $pFq1 = date("Y-m-d",mktime(0, 0, 0, "12","31",date("Y")-1)); - }else if(date("m") > 3 and date("m") <= 6) - { - $pFq = date("Y-m-d",mktime(0, 0, 0, "01","01",date("Y"))); - $pFq1 = date("Y-m-d",mktime(0, 0, 0, "03","31",date("Y"))); - $cFq = date("Y-m-d",mktime(0, 0, 0, "04","01",date("Y"))); - $cFq1 = date("Y-m-d",mktime(0, 0, 0, "06","30",date("Y"))); - $nFq = date("Y-m-d",mktime(0, 0, 0, "07","01",date("Y"))); - $nFq1 = date("Y-m-d",mktime(0, 0, 0, "09","30",date("Y"))); - - }else if(date("m") > 6 and date("m") <= 9) - { - $nFq = date("Y-m-d",mktime(0, 0, 0, "10","01",date("Y"))); - $nFq1 = date("Y-m-d",mktime(0, 0, 0, "12","31",date("Y"))); - $pFq = date("Y-m-d",mktime(0, 0, 0, "04","01",date("Y"))); - $pFq1 = date("Y-m-d",mktime(0, 0, 0, "06","30",date("Y"))); - $cFq = date("Y-m-d",mktime(0, 0, 0, "07","01",date("Y"))); - $cFq1 = date("Y-m-d",mktime(0, 0, 0, "09","30",date("Y"))); - } - else if(date("m") > 9 and date("m") <= 12) - { - $nFq = date("Y-m-d",mktime(0, 0, 0, "01","01",date("Y")+1)); - $nFq1 = date("Y-m-d",mktime(0, 0, 0, "03","31",date("Y")+1)); - $pFq = date("Y-m-d",mktime(0, 0, 0, "07","01",date("Y"))); - $pFq1 = date("Y-m-d",mktime(0, 0, 0, "09","30",date("Y"))); - $cFq = date("Y-m-d",mktime(0, 0, 0, "10","01",date("Y"))); - $cFq1 = date("Y-m-d",mktime(0, 0, 0, "12","31",date("Y"))); - - } - - $sjsStr = ''; - - return $sjsStr; - } - - /** to get the standard filter for the given customview Id - * @param $cvid :: Type Integer - * @returns $stdfilterlist Array in the following format - * $stdfilterlist = Array( 'columnname' => $tablename:$columnname:$fieldname:$module_$fieldlabel,'stdfilter'=>$stdfilter,'startdate'=>$startdate,'enddate'=>$enddate) - */ - - function getStdFilterByCvid($cvid) - { - global $adb; - - $sSQL = "select vtiger_cvstdfilter.* from vtiger_cvstdfilter inner join vtiger_customview on vtiger_customview.cvid = vtiger_cvstdfilter.cvid"; - $sSQL .= " where vtiger_cvstdfilter.cvid=?"; - - $result = $adb->pquery($sSQL, array($cvid)); - $stdfilterrow = $adb->fetch_array($result); - - $stdfilterlist["columnname"] = $stdfilterrow["columnname"]; - $stdfilterlist["stdfilter"] = $stdfilterrow["stdfilter"]; - - if($stdfilterrow["stdfilter"] == "custom" || $stdfilterrow["stdfilter"] == "") - { - if($stdfilterrow["startdate"] != "0000-00-00" && $stdfilterrow["startdate"] != "") - { - $stdfilterlist["startdate"] = $stdfilterrow["startdate"]; - } - if($stdfilterrow["enddate"] != "0000-00-00" && $stdfilterrow["enddate"] != "") - { - $stdfilterlist["enddate"] = $stdfilterrow["enddate"]; - } - }else //if it is not custom get the date according to the selected duration - { - $datefilter = $this->getDateforStdFilterBytype($stdfilterrow["stdfilter"]); - $stdfilterlist["startdate"] = $datefilter[0]; - $stdfilterlist["enddate"] = $datefilter[1]; - } - return $stdfilterlist; - } - - /** to get the Advanced filter for the given customview Id - * @param $cvid :: Type Integer - * @returns $stdfilterlist Array in the following format - * $stdfilterlist = Array( 0=>Array('columnname' => $tablename:$columnname:$fieldname:$module_$fieldlabel,'comparator'=>$comparator,'value'=>$value), - * 1=>Array('columnname' => $tablename1:$columnname1:$fieldname1:$module_$fieldlabel1,'comparator'=>$comparator1,'value'=>$value1), - * | - * 4=>Array('columnname' => $tablename4:$columnname4:$fieldname4:$module_$fieldlabel4,'comparator'=>$comparatorn,'value'=>$valuen), - */ - function getAdvFilterByCvid($cvid) - { - global $adb; - global $modules; - - $sSQL = "select vtiger_cvadvfilter.* from vtiger_cvadvfilter inner join vtiger_customview on vtiger_cvadvfilter.cvid = vtiger_customview.cvid"; - $sSQL .= " where vtiger_cvadvfilter.cvid=?"; - $result = $adb->pquery($sSQL, array($cvid)); - - while($advfilterrow = $adb->fetch_array($result)) - { - $advft["columnname"] = $advfilterrow["columnname"]; - $advft["comparator"] = $advfilterrow["comparator"]; - $advft["value"] = $advfilterrow["value"]; - $advfilterlist[] = $advft; - } - return $advfilterlist; - } - - - /** - * Cache information to perform re-lookups - * - * @var String - */ - protected $_fieldby_tblcol_cache = array(); - - /** - * Function to check if field is present based on - * - * @param String $columnname - * @param String $tablename - */ - function isFieldPresent_ByColumnTable($columnname, $tablename) { - global $adb; - - if(!isset($this->_fieldby_tblcol_cache[$tablename])) { - $query = 'SELECT columnname FROM vtiger_field WHERE tablename = ? and presence in (0,2)'; - - $result = $adb->pquery($query,array($tablename)); - $numrows = $adb->num_rows($result); - - if($numrows) { - $this->_fieldby_tblcol_cache[$tablename] = array(); - for($index = 0; $index < $numrows; ++$index) { - $this->_fieldby_tblcol_cache[$tablename][] = $adb->query_result($result, $index, 'columnname'); - } - } - } - // If still the field was not found (might be disabled or deleted?) - if(!isset($this->_fieldby_tblcol_cache[$tablename])) { - return false; - } - return in_array($columnname, $this->_fieldby_tblcol_cache[$tablename]); - } - - - /** to get the customview Columnlist Query for the given customview Id - * @param $cvid :: Type Integer - * @returns $getCvColumnList as a string - * This function will return the columns for the given customfield in comma seperated values in the format - * $tablename.$columnname,$tablename1.$columnname1, ------ $tablenamen.$columnnamen - * - */ - function getCvColumnListSQL($cvid) - { - global $adb; - $columnslist = $this->getColumnsListByCvid($cvid); - if(isset($columnslist)) - { - foreach($columnslist as $columnname=>$value) - { - $tablefield = ""; - if($value != "") - { - $list = explode(":",$value); - - //Added For getting status for Activities -Jaguar - $sqllist_column = $list[0].".".$list[1]; - if($this->customviewmodule == "Calendar") - { - if($list[1] == "status" || $list[1] == "eventstatus") - { - $sqllist_column = "case when (vtiger_activity.status not like '') then vtiger_activity.status else vtiger_activity.eventstatus end as activitystatus"; - } - } - //Added for assigned to sorting - if($list[1] == "smownerid") - { - $sqllist_column = "case when (vtiger_users.user_name not like '') then vtiger_users.user_name else vtiger_groups.groupname end as user_name"; - } - if($list[0] == "vtiger_contactdetails" && $list[1] == "lastname") - $sqllist_column = "vtiger_contactdetails.lastname,vtiger_contactdetails.firstname"; - $sqllist[] = $sqllist_column; - //Ends - - $tablefield[$list[0]] = $list[1]; - - //Changed as the replace of module name may replace the string if the fieldname has module name in it -- Jeri - $fieldinfo = explode('_',$list[3],2); - $fieldlabel = $fieldinfo[1]; - $fieldlabel = str_replace("_"," ",$fieldlabel); - - if($this->isFieldPresent_ByColumnTable($list[1], $list[0])){ - - $this->list_fields[$fieldlabel] = $tablefield; - $this->list_fields_name[$fieldlabel] = $list[2]; - } - } - } - $returnsql = implode(",",$sqllist); - } - return $returnsql; - } - - /** to get the customview stdFilter Query for the given customview Id - * @param $cvid :: Type Integer - * @returns $stdfiltersql as a string - * This function will return the standard filter criteria for the given customfield - * - */ - function getCVStdFilterSQL($cvid) - { - global $adb; - $stdfilterlist = $this->getStdFilterByCvid($cvid); - if(isset($stdfilterlist)) - { - foreach($stdfilterlist as $columnname=>$value) - { - if($columnname == "columnname") - { - $filtercolumn = $value; - }elseif($columnname == "stdfilter") - { - $filtertype = $value; - }elseif($columnname == "startdate") - { - $startdate = $value; - }elseif($columnname == "enddate") - { - $enddate = $value; - } - } - if($filtertype != "custom") - { - $datearray = $this->getDateforStdFilterBytype($filtertype); - $startdate = $datearray[0]; - $enddate = $datearray[1]; - } - if($startdate != "" && $enddate != "") { - $columns = explode(":",$filtercolumn); - // Fix for http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/5423 - if ($columns[1] != 'birthday') { - $stdfiltersql = $columns[0].".".$columns[1]." between '".$startdate." 00:00:00' and '".$enddate." 23:59:00'"; - } else { - $stdfiltersql = "DATE_FORMAT(".$columns[0].".".$columns[1].", '%m%d') between DATE_FORMAT('".$startdate."', '%m%d') and DATE_FORMAT('".$enddate."', '%m%d')"; - } - } - } - return $stdfiltersql; - } - /** to get the customview AdvancedFilter Query for the given customview Id - * @param $cvid :: Type Integer - * @returns $advfiltersql as a string - * This function will return the advanced filter criteria for the given customfield - * - */ - function getCVAdvFilterSQL($cvid) - { - global $current_user; - $advfilter = $this->getAdvFilterByCvid($cvid); - if(isset($advfilter)) - { - foreach($advfilter as $key=>$advfltrow) - { - if(isset($advfltrow)) - { - $columns = explode(":",$advfltrow["columnname"]); - $datatype = (isset($columns[4])) ? $columns[4] : ""; - if($advfltrow["columnname"] != "" && $advfltrow["comparator"] != "") - { - - $valuearray = explode(",",trim($advfltrow["value"])); - if(isset($valuearray) && count($valuearray) > 1) - { - $advorsql = ""; - for($n=0;$ngetRealValues($columns[0],$columns[1],$advfltrow["comparator"],trim($valuearray[$n]),$datatype); - } - //If negative logic filter ('not equal to', 'does not contain') is used, 'and' condition should be applied instead of 'or' - if($advfltrow["comparator"] == 'n' || $advfltrow["comparator"] == 'k') - $advorsqls = implode(" and ",$advorsql); - else - $advorsqls = implode(" or ",$advorsql); - $advfiltersql[] = " (".$advorsqls.") "; - }else - { - //Added for getting vtiger_activity Status -Jaguar - if($this->customviewmodule == "Calendar" && ($columns[1] == "status" || $columns[1] == "eventstatus")) - { - if(getFieldVisibilityPermission("Calendar", $current_user->id,'taskstatus') == '0') - { - $advfiltersql[] = "case when (vtiger_activity.status not like '') then vtiger_activity.status else vtiger_activity.eventstatus end".$this->getAdvComparator($advfltrow["comparator"],trim($advfltrow["value"]),$datatype); - } - else - $advfiltersql[] = "vtiger_activity.eventstatus".$this->getAdvComparator($advfltrow["comparator"],trim($advfltrow["value"]),$datatype); - } - elseif($this->customviewmodule == "Documents" && $columns[1]=='folderid'){ - $advfiltersql[] = "vtiger_attachmentsfolder.foldername".$this->getAdvComparator($advfltrow["comparator"],trim($advfltrow["value"]),$datatype); - } - elseif($this->customviewmodule == "Assets"){ - if($columns[1]=='account' ){ - $advfiltersql[] = "vtiger_account.accountname".$this->getAdvComparator($advfltrow["comparator"],trim($advfltrow["value"]),$datatype); - } - if($columns[1]=='product'){ - $advfiltersql[] = "vtiger_products.productname".$this->getAdvComparator($advfltrow["comparator"],trim($advfltrow["value"]),$datatype); - } - if($columns[1]=='invoiceid'){ - $advfiltersql[] = "vtiger_invoice.subject".$this->getAdvComparator($advfltrow["comparator"],trim($advfltrow["value"]),$datatype); - } - } - else - { - $advfiltersql[] = $this->getRealValues($columns[0],$columns[1],$advfltrow["comparator"],trim($advfltrow["value"]),$datatype); - } - } - } - } - } - } - if(isset($advfiltersql)) - { - $advfsql = implode(" and ",$advfiltersql); - } - return $advfsql; - } - - /** to get the realvalues for the given value - * @param $tablename :: type string - * @param $fieldname :: type string - * @param $comparator :: type string - * @param $value :: type string - * @returns $value as a string in the following format - * $tablename.$fieldname comparator - */ - function getRealValues($tablename,$fieldname,$comparator,$value,$datatype) - { - //we have to add the fieldname/tablename.fieldname and the corresponding value (which we want) we can add here. So that when these LHS field comes then RHS value will be replaced for LHS in the where condition of the query - global $adb, $mod_strings, $currentModule, $current_user; - //Added for proper check of contact name in advance filter - if($tablename == "vtiger_contactdetails" && $fieldname == "lastname") - $fieldname = "contactid"; - - $contactid = "vtiger_contactdetails.lastname"; - if ($currentModule != "Contacts" && $currentModule != "Leads" && getFieldVisibilityPermission("Contacts", $current_user->id, 'firstname') == '0' && $currentModule != 'Campaigns') { - $contactid = "concat(vtiger_contactdetails.lastname,' ',vtiger_contactdetails.firstname)"; - } - $change_table_field = Array( - - "product_id"=>"vtiger_products.productname", - "contactid"=>$contactid, - "contact_id"=>$contactid, - "accountid"=>"",//in cvadvfilter accountname is stored for Contact, Potential, Quotes, SO, Invoice - "account_id"=>"",//Same like accountid. No need to change - "vendorid"=>"vtiger_vendor.vendorname", - "vendor_id"=>"vtiger_vendor.vendorname", - "potentialid"=>"vtiger_potential.potentialname", - - "vtiger_account.parentid"=>"vtiger_account2.accountname", - "quoteid"=>"vtiger_quotes.subject", - "salesorderid"=>"vtiger_salesorder.subject", - "campaignid"=>"vtiger_campaign.campaignname", - "vtiger_contactdetails.reportsto"=>"concat(vtiger_contactdetails2.lastname,' ',vtiger_contactdetails2.firstname)", - "vtiger_pricebook.currency_id"=>"vtiger_currency_info.currency_name", - ); - - if($fieldname == "smownerid") - { - $temp_value = "( vtiger_users.user_name".$this->getAdvComparator($comparator,$value,$datatype); - $temp_value.= " OR vtiger_groups.groupname".$this->getAdvComparator($comparator,$value,$datatype); - $value=$temp_value.")"; - }elseif( $fieldname == "inventorymanager") - { - $value = $tablename.".".$fieldname.$this->getAdvComparator($comparator,getUserId_Ol($value),$datatype); - } - elseif($change_table_field[$fieldname] != '')//Added to handle special cases - { - $value = $change_table_field[$fieldname].$this->getAdvComparator($comparator,$value,$datatype); - } - elseif($change_table_field[$tablename.".".$fieldname] != '')//Added to handle special cases - { - $tmp_value = ''; - if((($comparator == 'e' || $comparator == 's' || $comparator == 'c') && trim($value) == '') || (($comparator == 'n' || $comparator == 'k') && trim($value) != '')) - { - $tmp_value = $change_table_field[$tablename.".".$fieldname].' IS NULL or '; - } - $value = $tmp_value.$change_table_field[$tablename.".".$fieldname].$this->getAdvComparator($comparator,$value,$datatype); - } - elseif($fieldname == "handler") - { - $value = "vtiger_users.user_name".$this->getAdvComparator($comparator,$value,$datatype); - } - elseif(($fieldname == "crmid" && $tablename != 'vtiger_crmentity') || $fieldname == "parent_id" || $fieldname == 'parentid') - { - //For crmentity.crmid the control should not come here. This is only to get the related to modules - $value = $this->getSalesRelatedName($comparator,$value,$datatype,$tablename,$fieldname); - } - else - { - //For checkbox type values, we have to convert yes/no as 1/0 to get the values - $field_uitype = getUItype($this->customviewmodule, $fieldname); - if($field_uitype == 56) - { - if(strtolower($value) == 'yes') $value = 1; - elseif(strtolower($value) == 'no') $value = 0; - } else if(is_uitype($field_uitype, '_picklist_')) { /* Fix for tickets 4465 and 4629 */ - // Get all the keys for the for the Picklist value - $mod_keys = array_keys($mod_strings, $value); - - // Iterate on the keys, to get the first key which doesn't start with LBL_ (assuming it is not used in PickList) - foreach($mod_keys as $mod_idx=>$mod_key) { - $stridx = strpos($mod_key, 'LBL_'); - // Use strict type comparision, refer strpos for more details - if ($stridx !== 0) { - $value = $mod_key; - break; - } - } - } - //added to fix the ticket - if($this->customviewmodule == "Calendar" && ($fieldname=="status" || $fieldname=="taskstatus" || $fieldname=="eventstatus")) - { - if(getFieldVisibilityPermission("Calendar", $current_user->id,'taskstatus') == '0') - { - $value = " (case when (vtiger_activity.status not like '') then vtiger_activity.status else vtiger_activity.eventstatus end)".$this->getAdvComparator($comparator,$value,$datatype); - } - else - $value = " vtiger_activity.eventstatus ".$this->getAdvComparator($comparator,$value,$datatype); - } elseif ($comparator == 'e' && (trim($value) == "NULL" || trim($value) == '')) { - $value = '('.$tablename.".".$fieldname.' IS NULL OR '.$tablename.".".$fieldname.' = \'\')'; - } else { - $value = $tablename.".".$fieldname.$this->getAdvComparator($comparator,$value,$datatype); - } - //end - } - return $value; - } - - /** to get the related name for the given module - * @param $comparator :: type string, - * @param $value :: type string, - * @param $datatype :: type string, - * @returns $value :: string - */ - - function getSalesRelatedName($comparator,$value,$datatype,$tablename,$fieldname) - { - global $log; - $log->info("in getSalesRelatedName ".$comparator."==".$value."==".$datatype."==".$tablename."==".$fieldname); - global $adb; - - $adv_chk_value = $value; - $value = '('; - $sql = "select distinct(setype) from vtiger_crmentity c INNER JOIN ".$adb->sql_escape_string($tablename)." t ON t.".$adb->sql_escape_string($fieldname)." = c.crmid"; - $res=$adb->pquery($sql, array()); - for($s=0;$s<$adb->num_rows($res);$s++) - { - $modulename=$adb->query_result($res,$s,"setype"); - if($modulename == 'Vendors') - { - continue; - } - if($s != 0) - $value .= ' or '; - if($modulename == 'Accounts') - { - //By Pavani : Related to problem in calender, Ticket: 4284 and 4675 - if(($comparator == 'e' || $comparator == 's' || $comparator == 'c') && trim($adv_chk_value) == '') - { - if($tablename == 'vtiger_seactivityrel' && $fieldname == 'crmid') - { - $value .= 'vtiger_account2.accountname IS NULL or '; - } - else{ - $value .= 'vtiger_account.accountname IS NULL or '; - } - } - if($tablename == 'vtiger_seactivityrel' && $fieldname == 'crmid') - { - $value .= 'vtiger_account2.accountname'; - } - else{ - $value .= 'vtiger_account.accountname'; - } - } - if($modulename == 'Leads') - { - if(($comparator == 'e' || $comparator == 's' || $comparator == 'c') && trim($adv_chk_value) == '') - { - $value .= " concat(vtiger_leaddetails.lastname,' ',vtiger_leaddetails.firstname) IS NULL or "; - } - $value .= " concat(vtiger_leaddetails.lastname,' ',vtiger_leaddetails.firstname)"; - } - if($modulename == 'Potentials') - { - if(($comparator == 'e' || $comparator == 's' || $comparator == 'c') && trim($adv_chk_value) == '') - { - - $value .= ' vtiger_potential.potentialname IS NULL or '; - } - $value .= ' vtiger_potential.potentialname'; - } - if($modulename == 'Products') - { - if(($comparator == 'e' || $comparator == 's' || $comparator == 'c') && trim($adv_chk_value) == '') - { - $value .= ' vtiger_products.productname IS NULL or '; - } - $value .= ' vtiger_products.productname'; - } - if($modulename == 'Invoice') - { - if(($comparator == 'e' || $comparator == 's' || $comparator == 'c') && trim($adv_chk_value) == '') - { - $value .= ' vtiger_invoice.subject IS NULL or '; - } - $value .= ' vtiger_invoice.subject'; - } - if($modulename == 'PurchaseOrder') - { - if(($comparator == 'e' || $comparator == 's' || $comparator == 'c') && trim($adv_chk_value) == '') - { - $value .= ' vtiger_purchaseorder.subject IS NULL or '; - } - $value .= ' vtiger_purchaseorder.subject'; - } - if($modulename == 'SalesOrder') - { - if(($comparator == 'e' || $comparator == 's' || $comparator == 'c') && trim($adv_chk_value) == '') - { - $value .= ' vtiger_salesorder.subject IS NULL or '; - } - $value .= ' vtiger_salesorder.subject'; - } - if($modulename == 'Quotes') - { - - if(($comparator == 'e' || $comparator == 's' || $comparator == 'c') && trim($adv_chk_value) == '') - { - $value .= ' vtiger_quotes.subject IS NULL or '; - } - $value .= ' vtiger_quotes.subject'; - } - if($modulename == 'Contacts') - { - if(($comparator == 'e' || $comparator == 's' || $comparator == 'c') && trim($adv_chk_value) == '') - { - $value .= " concat(vtiger_contactdetails.lastname,' ',vtiger_contactdetails.firstname) IS NULL or "; - } - $value .= " concat(vtiger_contactdetails.lastname,' ',vtiger_contactdetails.firstname)"; - } - if($modulename == 'HelpDesk') - { - if(($comparator == 'e' || $comparator == 's' || $comparator == 'c') && trim($adv_chk_value) == '') - { - $value .= ' vtiger_troubletickets.title IS NULL or '; - } - $value .= ' vtiger_troubletickets.title'; - - } - if($modulename == 'Campaigns') - { - if(($comparator == 'e' || $comparator == 's' || $comparator == 'c') && trim($adv_chk_value) == '') - { - $value .= ' vtiger_campaign.campaignname IS NULL or '; - } - $value .= ' vtiger_campaign.campaignname'; - } - - $value .= $this->getAdvComparator($comparator,$adv_chk_value,$datatype); - } - $value .= ")"; - $log->info("in getSalesRelatedName ".$comparator."==".$value."==".$datatype."==".$tablename."==".$fieldname); - return $value; - } - - /** to get the comparator value for the given comparator and value - * @param $comparator :: type string - * @param $value :: type string - * @returns $rtvalue in the format $comparator $value - */ - - function getAdvComparator($comparator,$value,$datatype = '') - { - - global $adb, $default_charset; - $value=html_entity_decode(trim($value),ENT_QUOTES,$default_charset); - $value = $adb->sql_escape_string($value); - if($comparator == "e") - { - if(trim($value) == "NULL") - { - $rtvalue = " is NULL"; - }elseif(trim($value) != "") - { - $rtvalue = " = ".$adb->quote($value); - }elseif(trim($value) == "" && ($datatype == "V" || $datatype == "E")) - { - $rtvalue = " = ".$adb->quote($value); - }else - { - $rtvalue = " is NULL"; - } - } - if($comparator == "n") - { - if(trim($value) == "NULL") - { - $rtvalue = " is NOT NULL"; - }elseif(trim($value) != "") - { - $rtvalue = " <> ".$adb->quote($value); - }elseif(trim($value) == "" && $datatype == "V") - { - $rtvalue = " <> ".$adb->quote($value); - }elseif(trim($value) == "" && $datatype == "E") - { - $rtvalue = " <> ".$adb->quote($value); - }else - { - $rtvalue = " is NOT NULL"; - } - } - if($comparator == "s") - { - if(trim($value) == "" && ($datatype == "V" || $datatype == "E")) - { - $rtvalue = " like '". formatForSqlLike($value, 3) ."'"; - }else - { - $rtvalue = " like '". formatForSqlLike($value, 2) ."'"; - } - } - if($comparator == "ew") - { - if(trim($value) == "" && ($datatype == "V" || $datatype == "E")) - { - $rtvalue = " like '". formatForSqlLike($value, 3) ."'"; - }else - { - $rtvalue = " like '". formatForSqlLike($value, 1) ."'"; - } - } - if($comparator == "c") - { - if(trim($value) == "" && ($datatype == "V" || $datatype == "E")) - { - $rtvalue = " like '". formatForSqlLike($value, 3) ."'"; - }else - { - $rtvalue = " like '". formatForSqlLike($value) ."'"; - } - } - if($comparator == "k") - { - if(trim($value) == "" && ($datatype == "V" || $datatype == "E")) - { - $rtvalue = " not like ''"; - }else - { - $rtvalue = " not like '". formatForSqlLike($value) ."'"; - } - } - if($comparator == "l") - { - $rtvalue = " < ".$adb->quote($value); - } - if($comparator == "g") - { - $rtvalue = " > ".$adb->quote($value); - } - if($comparator == "m") - { - $rtvalue = " <= ".$adb->quote($value); - } - if($comparator == "h") - { - $rtvalue = " >= ".$adb->quote($value); - } - - return $rtvalue; - } - - /** to get the date value for the given type - * @param $type :: type string - * @returns $datevalue array in the following format - * $datevalue = Array(0=>$startdate,1=>$enddate) - */ - - function getDateforStdFilterBytype($type) - { - $thisyear = date("Y"); - $today = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d"), date("Y"))); - $tomorrow = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")+1, date("Y"))); - $yesterday = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")-1, date("Y"))); - - $currentmonth0 = date("Y-m-d",mktime(0, 0, 0, date("m"), "01", date("Y"))); - $currentmonth1 = date("Y-m-t"); - $lastmonth0 = date("Y-m-d",mktime(0, 0, 0, date("m")-1, "01", date("Y"))); - $lastmonth1 = date("Y-m-t", strtotime("-1 Month")); - $nextmonth0 = date("Y-m-d",mktime(0, 0, 0, date("m")+1, "01", date("Y"))); - $nextmonth1 = date("Y-m-t", strtotime("+1 Month")); - - $lastweek0 = date("Y-m-d",strtotime("-2 week Sunday")); - $lastweek1 = date("Y-m-d",strtotime("-1 week Saturday")); - - $thisweek0 = date("Y-m-d",strtotime("-1 week Sunday")); - $thisweek1 = date("Y-m-d",strtotime("this Saturday")); - - $nextweek0 = date("Y-m-d",strtotime("this Sunday")); - $nextweek1 = date("Y-m-d",strtotime("+1 week Saturday")); - - $next7days = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")+6, date("Y"))); - $next30days = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")+29, date("Y"))); - $next60days = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")+59, date("Y"))); - $next90days = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")+89, date("Y"))); - $next120days = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")+119, date("Y"))); - - $last7days = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")-6, date("Y"))); - $last30days = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")-29, date("Y"))); - $last60days = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")-59, date("Y"))); - $last90days = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")-89, date("Y"))); - $last120days = date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")-119, date("Y"))); - - $currentFY0 = date("Y-m-d",mktime(0, 0, 0, "01", "01", date("Y"))); - $currentFY1 = date("Y-m-t",mktime(0, 0, 0, "12", date("d"), date("Y"))); - $lastFY0 = date("Y-m-d",mktime(0, 0, 0, "01", "01", date("Y")-1)); - $lastFY1 = date("Y-m-t", mktime(0, 0, 0, "12", date("d"), date("Y")-1)); - $nextFY0 = date("Y-m-d",mktime(0, 0, 0, "01", "01", date("Y")+1)); - $nextFY1 = date("Y-m-t", mktime(0, 0, 0, "12", date("d"), date("Y")+1)); - - if(date("m") <= 4) - { - $cFq = date("Y-m-d",mktime(0, 0, 0, "01","01",date("Y"))); - $cFq1 = date("Y-m-d",mktime(0, 0, 0, "04","30",date("Y"))); - $nFq = date("Y-m-d",mktime(0, 0, 0, "05","01",date("Y"))); - $nFq1 = date("Y-m-d",mktime(0, 0, 0, "08","31",date("Y"))); - $pFq = date("Y-m-d",mktime(0, 0, 0, "09","01",date("Y")-1)); - $pFq1 = date("Y-m-d",mktime(0, 0, 0, "12","31",date("Y")-1)); - }else if(date("m") > 4 and date("m") <= 8) - { - $pFq = date("Y-m-d",mktime(0, 0, 0, "01","01",date("Y"))); - $pFq1 = date("Y-m-d",mktime(0, 0, 0, "04","30",date("Y"))); - $cFq = date("Y-m-d",mktime(0, 0, 0, "05","01",date("Y"))); - $cFq1 = date("Y-m-d",mktime(0, 0, 0, "08","31",date("Y"))); - $nFq = date("Y-m-d",mktime(0, 0, 0, "09","01",date("Y"))); - $nFq1 = date("Y-m-d",mktime(0, 0, 0, "12","31",date("Y"))); - - }else - { - $nFq = date("Y-m-d",mktime(0, 0, 0, "01","01",date("Y")+1)); - $nFq1 = date("Y-m-d",mktime(0, 0, 0, "04","30",date("Y")+1)); - $pFq = date("Y-m-d",mktime(0, 0, 0, "05","01",date("Y"))); - $pFq1 = date("Y-m-d",mktime(0, 0, 0, "08","31",date("Y"))); - $cFq = date("Y-m-d",mktime(0, 0, 0, "09","01",date("Y"))); - $cFq1 = date("Y-m-d",mktime(0, 0, 0, "12","31",date("Y"))); - } - - if($type == "today" ) - { - - $datevalue[0] = $today; - $datevalue[1] = $today; - } - elseif($type == "yesterday" ) - { - - $datevalue[0] = $yesterday; - $datevalue[1] = $yesterday; - } - elseif($type == "tomorrow" ) - { - - $datevalue[0] = $tomorrow; - $datevalue[1] = $tomorrow; - } - elseif($type == "thisweek" ) - { - - $datevalue[0] = $thisweek0; - $datevalue[1] = $thisweek1; - } - elseif($type == "lastweek" ) - { - - $datevalue[0] = $lastweek0; - $datevalue[1] = $lastweek1; - } - elseif($type == "nextweek" ) - { - - $datevalue[0] = $nextweek0; - $datevalue[1] = $nextweek1; - } - elseif($type == "thismonth" ) - { - - $datevalue[0] =$currentmonth0; - $datevalue[1] = $currentmonth1; - } - - elseif($type == "lastmonth" ) - { - - $datevalue[0] = $lastmonth0; - $datevalue[1] = $lastmonth1; - } - elseif($type == "nextmonth" ) - { - - $datevalue[0] = $nextmonth0; - $datevalue[1] = $nextmonth1; - } - elseif($type == "next7days" ) - { - - $datevalue[0] = $today; - $datevalue[1] = $next7days; - } - elseif($type == "next30days" ) - { - - $datevalue[0] =$today; - $datevalue[1] =$next30days; - } - elseif($type == "next60days" ) - { - - $datevalue[0] = $today; - $datevalue[1] = $next60days; - } - elseif($type == "next90days" ) - { - - $datevalue[0] = $today; - $datevalue[1] = $next90days; - } - elseif($type == "next120days" ) - { - - $datevalue[0] = $today; - $datevalue[1] = $next120days; - } - elseif($type == "last7days" ) - { - - $datevalue[0] = $last7days; - $datevalue[1] = $today; - } - elseif($type == "last30days" ) - { - - $datevalue[0] = $last30days; - $datevalue[1] = $today; - } - elseif($type == "last60days" ) - { - - $datevalue[0] = $last60days; - $datevalue[1] = $today; - } - else if($type == "last90days" ) - { - - $datevalue[0] = $last90days; - $datevalue[1] = $today; - } - elseif($type == "last120days" ) - { - - $datevalue[0] = $last120days; - $datevalue[1] = $today; - } - elseif($type == "thisfy" ) - { - - $datevalue[0] = $currentFY0; - $datevalue[1] = $currentFY1; - } - elseif($type == "prevfy" ) - { - - $datevalue[0] = $lastFY0; - $datevalue[1] = $lastFY1; - } - elseif($type == "nextfy" ) - { - - $datevalue[0] = $nextFY0; - $datevalue[1] = $nextFY1; - } - elseif($type == "nextfq" ) - { - - $datevalue[0] = $nFq; - $datevalue[1] = $nFq1; - } - elseif($type == "prevfq" ) - { - - $datevalue[0] = $pFq; - $datevalue[1] = $pFq1; - } - elseif($type == "thisfq") - { - $datevalue[0] = $cFq; - $datevalue[1] = $cFq1; - } - else - { - $datevalue[0] = ""; - $datevalue[1] = ""; - } - - return $datevalue; - } - - /** to get the customview query for the given customview - * @param $viewid (custom view id):: type Integer - * @param $listquery (List View Query):: type string - * @param $module (Module Name):: type string - * @returns $query - */ - - //CHANGE : TO IMPROVE PERFORMANCE - function getModifiedCvListQuery($viewid,$listquery,$module) - { - if($viewid != "" && $listquery != "") - { - - $listviewquery = substr($listquery, strpos($listquery,'FROM'),strlen($listquery)); - if($module == "Calendar" || $module == "Emails") - { - $query = "select ".$this->getCvColumnListSQL($viewid).", vtiger_activity.activityid, vtiger_activity.activitytype as type, vtiger_activity.priority, case when (vtiger_activity.status not like '') then vtiger_activity.status else vtiger_activity.eventstatus end as status, vtiger_crmentity.crmid,vtiger_contactdetails.contactid ".$listviewquery; - if($module == "Calendar") - $query = str_replace('vtiger_seactivityrel.crmid,','',$query); - }else if($module == "Documents") - { - $query = "select ".$this->getCvColumnListSQL($viewid)." ,vtiger_crmentity.crmid,vtiger_notes.* ".$listviewquery; - } - else if($module == "Products") - { - $query = "select ".$this->getCvColumnListSQL($viewid)." ,vtiger_crmentity.crmid,vtiger_products.* ".$listviewquery; - } - else if($module == "Vendors") - { - $query = "select ".$this->getCvColumnListSQL($viewid)." ,vtiger_crmentity.crmid ".$listviewquery; - } - else if($module == "PriceBooks") - { - $query = "select ".$this->getCvColumnListSQL($viewid)." ,vtiger_crmentity.crmid ".$listviewquery; - } - else if($module == "Faq") - { - $query = "select ".$this->getCvColumnListSQL($viewid)." ,vtiger_crmentity.crmid ".$listviewquery; - } - else if($module == "Potentials" || $module == "Contacts") - { - $query = "select ".$this->getCvColumnListSQL($viewid)." ,vtiger_crmentity.crmid,vtiger_account.accountid ".$listviewquery; - } - else if($module == "Invoice" || $module == "SalesOrder" || $module == "Quotes") - { - $query = "select ".$this->getCvColumnListSQL($viewid)." ,vtiger_crmentity.crmid,vtiger_contactdetails.contactid,vtiger_account.accountid ".$listviewquery; - } - else if($module == "PurchaseOrder") - { - $query = "select ".$this->getCvColumnListSQL($viewid)." ,vtiger_crmentity.crmid,vtiger_contactdetails.contactid ".$listviewquery; - } - - else - { - $query = "select ".$this->getCvColumnListSQL($viewid)." ,vtiger_crmentity.crmid ".$listviewquery; - } - $stdfiltersql = $this->getCVStdFilterSQL($viewid); - $advfiltersql = $this->getCVAdvFilterSQL($viewid); - if(isset($stdfiltersql) && $stdfiltersql != '') - { - $query .= ' and '.$stdfiltersql; - } - if(isset($advfiltersql) && $advfiltersql != '') - { - $query .= ' and '.$advfiltersql; - } - } - return $query; - } - - /** to get the Key Metrics for the home page query for the given customview to find the no of records - * @param $viewid (custom view id):: type Integer - * @param $listquery (List View Query):: type string - * @param $module (Module Name):: type string - * @returns $query - */ - function getMetricsCvListQuery($viewid,$listquery,$module) - { - if($viewid != "" && $listquery != "") - { - $listviewquery = substr($listquery, strpos($listquery,'FROM'),strlen($listquery)); - - $query = "select count(*) AS count ".$listviewquery; - - $stdfiltersql = $this->getCVStdFilterSQL($viewid); - $advfiltersql = $this->getCVAdvFilterSQL($viewid); - if(isset($stdfiltersql) && $stdfiltersql != '') - { - $query .= ' and '.$stdfiltersql; - } - if(isset($advfiltersql) && $advfiltersql != '') - { - $query .= ' and '.$advfiltersql; - } - - } - - return $query; - } - - /** to get the custom action details for the given customview - * @param $viewid (custom view id):: type Integer - * @returns $calist array in the following format - * $calist = Array ('subject'=>$subject, - 'module'=>$module, - 'content'=>$content, - 'cvid'=>$custom view id) - */ - function getCustomActionDetails($cvid) - { - global $adb; - - $sSQL = "select vtiger_customaction.* from vtiger_customaction inner join vtiger_customview on vtiger_customaction.cvid = vtiger_customview.cvid"; - $sSQL .= " where vtiger_customaction.cvid=?"; - $result = $adb->pquery($sSQL, array($cvid)); - - while($carow = $adb->fetch_array($result)) - { - $calist["subject"] = $carow["subject"]; - $calist["module"] = $carow["module"]; - $calist["content"] = $carow["content"]; - $calist["cvid"] = $carow["cvid"]; - } - return $calist; - } - - - /* This function sets the block information for the given module to the class variable module_list - * and return the array - */ - - function getCustomViewModuleInfo($module) - { - global $adb; - global $current_language; - $current_mod_strings = return_specified_module_language($current_language, $module); - $block_info = Array(); - $modules_list = explode(",", $module); - if($module == "Calendar") { - $module = "Calendar','Events"; - $modules_list = array('Calendar', 'Events'); - } - - // Tabid mapped to the list of block labels to be skipped for that tab. - $skipBlocksList = array( - getTabid('Contacts') => array('LBL_IMAGE_INFORMATION'), - getTabid('HelpDesk') => array('LBL_COMMENTS'), - getTabid('Products') => array('LBL_IMAGE_INFORMATION'), - getTabid('Faq') => array('LBL_COMMENT_INFORMATION'), - getTabid('Quotes') => array('LBL_RELATED_PRODUCTS'), - getTabid('PurchaseOrder') => array('LBL_RELATED_PRODUCTS'), - getTabid('SalesOrder') => array('LBL_RELATED_PRODUCTS'), - getTabid('Invoice') => array('LBL_RELATED_PRODUCTS') - ); - - $Sql = "select distinct block,vtiger_field.tabid,name,blocklabel from vtiger_field inner join vtiger_blocks on vtiger_blocks.blockid=vtiger_field.block inner join vtiger_tab on vtiger_tab.tabid=vtiger_field.tabid where displaytype != 3 and vtiger_tab.name in (". generateQuestionMarks($modules_list) .") and vtiger_field.presence in (0,2) order by block"; - $result = $adb->pquery($Sql, array($modules_list)); - if($module == "Calendar','Events") - $module = "Calendar"; - - $pre_block_label = ''; - while($block_result = $adb->fetch_array($result)) - { - $block_label = $block_result['blocklabel']; - $tabid = $block_result['tabid']; - // Skip certain blocks of certain modules - if(array_key_exists($tabid, $skipBlocksList) && in_array($block_label, $skipBlocksList[$tabid])) continue; - - if (trim($block_label) == '') - { - $block_info[$pre_block_label] = $block_info[$pre_block_label].",".$block_result['block']; - }else - { - $lan_block_label = $current_mod_strings[$block_label]; - if (isset($block_info[$lan_block_label]) && $block_info[$lan_block_label] != '') { - $block_info[$lan_block_label] = $block_info[$lan_block_label].",".$block_result['block']; - } else { - $block_info[$lan_block_label] = $block_result['block']; - } - } - $pre_block_label = $lan_block_label; - } - $this->module_list[$module] = $block_info; - return $this->module_list; - } - - /** - * Get the userid, status information of this custom view. - * - * @param Integer $viewid - * @return Array - */ - - function getStatusAndUserid($viewid) { - global $adb; - - if($this->_status === false || $this->_userid === false) { - $query = "SELECT status, userid FROM vtiger_customview WHERE cvid=?"; - $result = $adb->pquery($query, array($viewid)); - if($result && $adb->num_rows($result)) { - $this->_status = $adb->query_result($result, 0, 'status'); - $this->_userid = $adb->query_result($result, 0, 'userid'); - } else { - return false; - } - } - return array('status' => $this->_status, 'userid' => $this->_userid); - - } - - //Function to check if the current user is able to see the customView - function isPermittedCustomView($record_id, $action, $module) - { - global $log, $adb; - global $current_user; - $log->debug("Entering isPermittedCustomView($record_id,$action,$module) method...."); - - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - $permission = "yes"; - - if($record_id != '') - { - $status_userid_info = $this->getStatusAndUserid($record_id); - - if($status_userid_info) - { - $status = $status_userid_info['status']; - $userid = $status_userid_info['userid']; - - if($status == CV_STATUS_DEFAULT) - { - $log->debug("Entering when status=0"); - if($action == 'ListView' || $action == $module."Ajax" || $action == 'index' || $action == 'DetailView') - { - $permission = "yes"; - } - else - $permission = "no"; - } - elseif($is_admin) - { - $permission = 'yes'; - } - elseif ($action != 'ChangeStatus') - { - if($userid == $current_user->id) - { - $log->debug("Entering when $userid=$current_user->id"); - $permission = "yes"; - } - elseif($status == CV_STATUS_PUBLIC) - { - $log->debug("Entering when status=3"); - if($action == 'ListView' || $action == $module."Ajax" || $action == 'index' || $action == 'DetailView') - { - $permission = "yes"; - } - else - $permission = "no"; - } - elseif($status == CV_STATUS_PRIVATE || $status == CV_STATUS_PENDING) - { - $log->debug("Entering when status=1 or 2"); - if($userid == $current_user->id) - $permission = "yes"; - else - { - /*if($action == 'ListView' || $action == $module."Ajax" || $action == 'index') - {*/ - $log->debug("Entering when status=1 or status=2 & action = ListView or $module.Ajax or index"); - $sql="select vtiger_users.id from vtiger_customview inner join vtiger_users where vtiger_customview.cvid = ? and vtiger_customview.userid in (select vtiger_user2role.userid from vtiger_user2role inner join vtiger_users on vtiger_users.id=vtiger_user2role.userid inner join vtiger_role on vtiger_role.roleid=vtiger_user2role.roleid where vtiger_role.parentrole like '%".$current_user_parent_role_seq."::%')"; - $result = $adb->pquery($sql, array($record_id)); - - while($row = $adb->fetchByAssoc($result)) - { - $temp_result[] = $row['id']; - } - $user_array = $temp_result; - if(sizeof($user_array) > 0) - { - if(!in_array($current_user->id,$user_array)) - $permission = "no"; - else - $permission = "yes"; - } - else - $permission = "no"; - /*} - else - { - $log->debug("Entering when status=1 or 2 & action = Editview or Customview"); - $permission = "no"; - }*/ - } - } - else - $permission = "yes"; - } - else - { - $log->debug("Entering else condition............"); - $permission = "no"; - } - } - else - { - $log->debug("Enters when count =0"); - $permission = 'no'; - } - } - $log->debug("Permission @@@@@@@@@@@@@@@@@@@@@@@@@@@ : $permission"); - $log->debug("Exiting isPermittedCustomView($record_id,$action,$module) method...."); - return $permission; - } - - function isPermittedChangeStatus($status) - { - global $current_user,$log; - global $current_language; - $custom_strings = return_module_language($current_language, "CustomView"); - - $log->debug("Entering isPermittedChangeStatus($status) method.............."); - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - $status_details = Array(); - if($is_admin) - { - if($status == CV_STATUS_PENDING) - { - $changed_status = CV_STATUS_PUBLIC; - $status_label = $custom_strings['LBL_STATUS_PUBLIC_APPROVE']; - } - elseif($status == CV_STATUS_PUBLIC) - { - $changed_status = CV_STATUS_PENDING; - $status_label = $custom_strings['LBL_STATUS_PUBLIC_DENY']; - } - $status_details = Array('Status'=>$status,'ChangedStatus'=>$changed_status,'Label'=>$status_label); - } - $log->debug("Exiting isPermittedChangeStatus($status) method.............."); - return $status_details; - } - -} -?> diff --git a/oss/vtiger/trunk/modules/CustomView/CustomViewAjax.php b/oss/vtiger/trunk/modules/CustomView/CustomViewAjax.php deleted file mode 100644 index de74ef2f..00000000 --- a/oss/vtiger/trunk/modules/CustomView/CustomViewAjax.php +++ /dev/null @@ -1,13 +0,0 @@ - diff --git a/oss/vtiger/trunk/modules/CustomView/Delete.php b/oss/vtiger/trunk/modules/CustomView/Delete.php deleted file mode 100644 index ae42e0f7..00000000 --- a/oss/vtiger/trunk/modules/CustomView/Delete.php +++ /dev/null @@ -1,31 +0,0 @@ -pquery($deletesql, array($cvid)); - $_SESSION['lvs'][$module]["viewname"] = ''; -} -if(isset($smodule) && $smodule != '') -{ - $smodule_url = "&smodule=".$smodule; -} - -header("Location: index.php?action=ListView&parenttab=$parenttab&module=$module".$smodule_url); -?> \ No newline at end of file diff --git a/oss/vtiger/trunk/modules/CustomView/EditView.php b/oss/vtiger/trunk/modules/CustomView/EditView.php deleted file mode 100644 index 2ba836b4..00000000 --- a/oss/vtiger/trunk/modules/CustomView/EditView.php +++ /dev/null @@ -1,391 +0,0 @@ ->>>>> -global $oCustomView; -//<<<<<>>>>>> - -$error_msg = ''; -$theme_path="themes/".$theme."/"; -$image_path=$theme_path."images/"; -require_once('modules/CustomView/CustomView.php'); - -$cv_module = vtlib_purify($_REQUEST['module']); - -$recordid = vtlib_purify($_REQUEST['record']); - -$smarty->assign("MOD", $mod_strings); -$smarty->assign("CATEGORY", getParentTab()); -$smarty->assign("APP", $app_strings); -$smarty->assign("THEME", $theme); -$smarty->assign("IMAGE_PATH", $image_path); -$smarty->assign("MODULE",$cv_module); -$smarty->assign("MODULELABEL",getTranslatedString($cv_module,$cv_module)); -$smarty->assign("CVMODULE", $cv_module); -$smarty->assign("CUSTOMVIEWID",$recordid); -$smarty->assign("DATEFORMAT",$current_user->date_format); -$smarty->assign("JS_DATEFORMAT",parse_calendardate($app_strings['NTC_DATE_FORMAT'])); -$smarty->assign("DATE_JS", ''); -if($recordid == "") -{ - $oCustomView = new CustomView(); - $modulecollist = $oCustomView->getModuleColumnsList($cv_module); - $log->info('CustomView :: Successfully got ColumnsList for the module'.$cv_module); - if(isset($modulecollist)) - { - $choosecolhtml = getByModule_ColumnsHTML($cv_module,$modulecollist); - } - //step2 - $stdfilterhtml = $oCustomView->getStdFilterCriteria(); - $log->info('CustomView :: Successfully got StandardFilter for the module'.$cv_module); - $stdfiltercolhtml = getStdFilterHTML($cv_module); - $stdfilterjs = $oCustomView->getCriteriaJS(); - - //step4 - $advfilterhtml = getAdvCriteriaHTML(); - for($i=1;$i<10;$i++) - { - $smarty->assign("CHOOSECOLUMN".$i,$choosecolhtml); - } - $log->info('CustomView :: Successfully got AdvancedFilter for the module'.$cv_module); - for($i=1;$i<6;$i++) - { - $smarty->assign("FOPTION".$i,$advfilterhtml); - $smarty->assign("BLOCK".$i,$choosecolhtml); - } - - $smarty->assign("STDFILTERCOLUMNS",$stdfiltercolhtml); - $smarty->assign("STDCOLUMNSCOUNT",count($stdfiltercolhtml)); - $smarty->assign("STDFILTERCRITERIA",$stdfilterhtml); - $smarty->assign("STDFILTER_JAVASCRIPT",$stdfilterjs); - - $smarty->assign("MANDATORYCHECK",implode(",",array_unique($oCustomView->mandatoryvalues))); - $smarty->assign("SHOWVALUES",implode(",",$oCustomView->showvalues)); - $data_type[] = $oCustomView->data_type; - $smarty->assign("DATATYPE",$data_type); - -} -else -{ - $oCustomView = new CustomView($cv_module); - $now_action = vtlib_purify($_REQUEST['action']); - if($oCustomView->isPermittedCustomView($recordid,$now_action,$oCustomView->customviewmodule) == 'yes') - { - $customviewdtls = $oCustomView->getCustomViewByCvid($recordid); - $log->info('CustomView :: Successfully got ViewDetails for the Viewid'.$recordid); - $modulecollist = $oCustomView->getModuleColumnsList($cv_module); - $selectedcolumnslist = $oCustomView->getColumnsListByCvid($recordid); - $log->info('CustomView :: Successfully got ColumnsList for the Viewid'.$recordid); - - $smarty->assign("VIEWNAME",$customviewdtls["viewname"]); - - if($customviewdtls["setdefault"] == 1) - { - $smarty->assign("CHECKED","checked"); - } - if($customviewdtls["setmetrics"] == 1) - { - $smarty->assign("MCHECKED","checked"); - } - $status = $customviewdtls["status"]; - $smarty->assign("STATUS",$status); - - for($i=1;$i<10;$i++) - { - $choosecolhtml = getByModule_ColumnsHTML($cv_module,$modulecollist,$selectedcolumnslist[$i-1]); - $smarty->assign("CHOOSECOLUMN".$i,$choosecolhtml); - } - - $stdfilterlist = $oCustomView->getStdFilterByCvid($recordid); - $log->info('CustomView :: Successfully got Standard Filter for the Viewid'.$recordid); - $stdfilterlist["stdfilter"] = ($stdfilterlist["stdfilter"] != "") ? ($stdfilterlist["stdfilter"]) : ("custom"); - $stdfilterhtml = $oCustomView->getStdFilterCriteria($stdfilterlist["stdfilter"]); - $stdfiltercolhtml = getStdFilterHTML($cv_module,$stdfilterlist["columnname"]); - $stdfilterjs = $oCustomView->getCriteriaJS(); - - if(isset($stdfilterlist["startdate"]) && isset($stdfilterlist["enddate"])) - { - $smarty->assign("STARTDATE",getDisplayDate($stdfilterlist["startdate"])); - $smarty->assign("ENDDATE",getDisplayDate($stdfilterlist["enddate"])); - } - else{ - $smarty->assign("STARTDATE",$stdfilterlist["startdate"]); - $smarty->assign("ENDDATE",$stdfilterlist["enddate"]); - } - - $advfilterlist = $oCustomView->getAdvFilterByCvid($recordid); - $log->info('CustomView :: Successfully got Advanced Filter for the Viewid'.$recordid,'info'); - for($i=1;$i<6;$i++) - { - $advfilterhtml = getAdvCriteriaHTML($advfilterlist[$i-1]["comparator"]); - $advcolumnhtml = getByModule_ColumnsHTML($cv_module,$modulecollist,$advfilterlist[$i-1]["columnname"]); - $smarty->assign("FOPTION".$i,$advfilterhtml); - $smarty->assign("BLOCK".$i,$advcolumnhtml); - $col = explode(":",$advfilterlist[$i-1]["columnname"]); - $temp_val = explode(",",$advfilterlist[$i-1]["value"]); - $and_text = " ".$mod_strings['LBL_AND']; - if($col[4] == 'D' || ($col[4] == 'T' && $col[1] != 'time_start' && $col[1] != 'time_end') || $col[4] == 'DT') - { - $val = Array(); - for($x=0;$xdate_format.") ".$mod_strings['LBL_AND']; - } - $smarty->assign("VALUE".$i,$advfilterlist[$i-1]["value"]); - $smarty->assign("AND_TEXT".$i,$and_text); - } - $smarty->assign("STDFILTERCOLUMNS",$stdfiltercolhtml); - $smarty->assign("STDCOLUMNSCOUNT",count($stdfiltercolhtml)); - $smarty->assign("STDFILTERCRITERIA",$stdfilterhtml); - $smarty->assign("STDFILTER_JAVASCRIPT",$stdfilterjs); - $smarty->assign("MANDATORYCHECK",implode(",",array_unique($oCustomView->mandatoryvalues))); - $smarty->assign("SHOWVALUES",implode(",",$oCustomView->showvalues)); - $smarty->assign("EXIST","true"); - $cactionhtml = ""; - - if($cv_module == "Leads" || $cv_module == "Accounts" || $cv_module == "Contacts") - { - $smarty->assign("CUSTOMACTIONBUTTON",$cactionhtml); - } - $data_type[] = $oCustomView->data_type; - $smarty->assign("DATATYPE",$data_type); - } - else - { - echo "
"; - echo "
- - - - - - - - -
$app_strings[LBL_PERMISSION]
- $app_strings[LBL_GO_BACK]
-
-
"; - echo "
"; - exit; - } -} - -$smarty->assign("RETURN_MODULE", $cv_module); -if($cv_module == "Calendar") - $return_action = "ListView"; -else - $return_action = "index"; - -if($recordid == '') - $act = $mod_strings['LBL_NEW']; -else - $act = $mod_strings['LBL_EDIT']; - -$smarty->assign("ACT", $act); -$smarty->assign("RETURN_ACTION", $return_action); - -$smarty->display("CustomView.tpl"); - -function getByModule_ColumnsHTML($module,$columnslist,$selected="") -{ - global $oCustomView, $current_language,$theme; - global $app_list_strings; - $advfilter = array(); - $mod_strings = return_specified_module_language($current_language,$module); - - $check_dup = Array(); - foreach($oCustomView->module_list[$module] as $key=>$value) - { - $advfilter = array(); - $label = $key; - if(isset($columnslist[$module][$key])) - { - foreach($columnslist[$module][$key] as $field=>$fieldlabel) - { - if(!in_array($fieldlabel,$check_dup)) - { - if(isset($mod_strings[$fieldlabel])) - { - if($selected == $field) - { - $advfilter_option['value'] = $field; - $advfilter_option['text'] = $mod_strings[$fieldlabel]; - $advfilter_option['selected'] = "selected"; - }else - { - $advfilter_option['value'] = $field; - $advfilter_option['text'] = $mod_strings[$fieldlabel]; - $advfilter_option['selected'] = ""; - } - }else - { - if($selected == $field) - { - $advfilter_option['value'] = $field; - $advfilter_option['text'] = $fieldlabel; - $advfilter_option['selected'] = "selected"; - }else - { - $advfilter_option['value'] = $field; - $advfilter_option['text'] = $fieldlabel; - $advfilter_option['selected'] = ""; - } - } - $advfilter[] = $advfilter_option; - $check_dup [] = $fieldlabel; - } - } - $advfilter_out[$label]= $advfilter; - } - } - // Special case handling only for Calendar moudle - Not required for other modules. - if($module == 'Calendar') { - $finalfield = Array(); - $finalfield1 = Array(); - $finalfield2 = Array(); - $newLabel = $mod_strings['LBL_CALENDAR_INFORMATION']; - - if(isset($advfilter_out[$mod_strings['LBL_TASK_INFORMATION']])) { - $finalfield1 = $advfilter_out[$mod_strings['LBL_TASK_INFORMATION']]; - } - if(isset($advfilter_out[$mod_strings['LBL_EVENT_INFORMATION']])) { - $finalfield2 = $advfilter_out[$mod_strings['LBL_EVENT_INFORMATION']]; - } - $finalfield[$newLabel] = array_merge($finalfield1,$finalfield2); - if (isset ($advfilter_out[$mod_strings['LBL_CUSTOM_INFORMATION']])) { - $finalfield[$mod_strings['LBL_CUSTOM_INFORMATION']] = $advfilter_out[$mod_strings['LBL_CUSTOM_INFORMATION']]; - } - $advfilter_out=$finalfield; - } - return $advfilter_out; -} - - /** to get the standard filter criteria - * @param $module(module name) :: Type String - * @param $elected (selection status) :: Type String (optional) - * @returns $filter Array in the following format - * $filter = Array( 0 => array('value'=>$tablename:$colname:$fieldname:$fieldlabel,'text'=>$mod_strings[$field label],'selected'=>$selected), - * 1 => array('value'=>$$tablename1:$colname1:$fieldname1:$fieldlabel1,'text'=>$mod_strings[$field label1],'selected'=>$selected), - */ -function getStdFilterHTML($module,$selected="") -{ - global $app_list_strings, $current_language,$app_strings,$current_user; - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - global $oCustomView; - $stdfilter = array(); - $result = $oCustomView->getStdCriteriaByModule($module); - $mod_strings = return_module_language($current_language,$module); - - if(isset($result)) - { - foreach($result as $key=>$value) - { - if($value == 'Start Date & Time') - { - $value = 'Start Date'; - } - $use_module_label = getTranslatedString($module, $module); - if(isset($app_list_strings['moduleList'][$module])) { - $use_module_label = $app_list_strings['moduleList'][$module]; - } - if(isset($mod_strings[$value])) - { - if($key == $selected) - { - - $filter['value'] = $key; - $filter['text'] = $use_module_label." - ".getTranslatedString($value); - $filter['selected'] = "selected"; - }else - { - $filter['value'] = $key; - $filter['text'] = $use_module_label." - ".getTranslatedString($value); - $filter['selected'] =""; - } - } - else - { - if($key == $selected) - { - $filter['value'] = $key; - - $filter['text'] = $use_module_label." - ".$value; - $filter['selected'] = 'selected'; - }else - { - $filter['value'] = $key; - $filter['text'] = $use_module_label." - ".$value; - $filter['selected'] =''; - } - } - $stdfilter[]=$filter; - //added to fix ticket #5117. If a user doesn't have permission for a field and it has been used to fileter a custom view, it should be get displayed to him as Not Accessible. - if(!$is_admin && $selected != '' && $filter['selected'] == '') - { - $keys = explode(":",$selected); - if(getFieldVisibilityPermission($module,$current_user->id,$keys[2]) != '0') - { - $filter['value'] = "not_accessible"; - $filter['text'] = $app_strings["LBL_NOT_ACCESSIBLE"]; - $filter['selected'] = "selected"; - $stdfilter[]=$filter; - } - } - - } - - } - return $stdfilter; -} - - /** to get the Advanced filter criteria - * @param $selected :: Type String (optional) - * @returns $AdvCriteria Array in the following format - * $AdvCriteria = Array( 0 => array('value'=>$tablename:$colname:$fieldname:$fieldlabel,'text'=>$mod_strings[$field label],'selected'=>$selected), - * 1 => array('value'=>$$tablename1:$colname1:$fieldname1:$fieldlabel1,'text'=>$mod_strings[$field label1],'selected'=>$selected), - * | - * n => array('value'=>$$tablenamen:$colnamen:$fieldnamen:$fieldlabeln,'text'=>$mod_strings[$field labeln],'selected'=>$selected)) - */ -function getAdvCriteriaHTML($selected="") -{ - global $adv_filter_options; - global $app_list_strings; - $AdvCriteria = array(); - foreach($adv_filter_options as $key=>$value) - { - if($selected == $key) - { - $advfilter_criteria['value'] = $key; - $advfilter_criteria['text'] = $value; - $advfilter_criteria['selected'] = "selected"; - }else - { - $advfilter_criteria['value'] = $key; - $advfilter_criteria['text'] = $value; - $advfilter_criteria['selected'] = ""; - } - $AdvCriteria[] = $advfilter_criteria; - } - - return $AdvCriteria; -} -?> \ No newline at end of file diff --git a/oss/vtiger/trunk/modules/CustomView/Forms.php b/oss/vtiger/trunk/modules/CustomView/Forms.php deleted file mode 100644 index 6de4e159..00000000 --- a/oss/vtiger/trunk/modules/CustomView/Forms.php +++ /dev/null @@ -1,253 +0,0 @@ -$unused) - { - $print_required_array .= "required['$required'] = '". $all_fields[$required] . "';\n"; - - } - - $the_script = << - - - -EOQ; - - return $the_script; -} - - - - -function get_validate_upload_js () -{ - global $mod_strings; - - $err_missing_required_fields = $mod_strings['ERR_MISSING_REQUIRED_FIELDS']; - $lbl_select_file = $mod_strings['ERR_SELECT_FILE']; - $lbl_custom = $mod_strings['LBL_CUSTOM']; - - $the_script = << - - - -EOQ; - - return $the_script; -} - -function getFieldSelect(&$column_fields,$colnum,&$required_fields,$suggest_field,$translated_fields,$module) -{ - global $mod_strings; - global $app_strings; - global $outlook_contacts_field_map; - require_once('include/database/PearDatabase.php'); - global $adb; - - $output = "\n"; - - return $output; - -} - - -function get_readonly_js () -{ -?> - - - diff --git a/oss/vtiger/trunk/modules/CustomView/ListViewTop.php b/oss/vtiger/trunk/modules/CustomView/ListViewTop.php deleted file mode 100644 index 64799617..00000000 --- a/oss/vtiger/trunk/modules/CustomView/ListViewTop.php +++ /dev/null @@ -1,169 +0,0 @@ -Array(0=>'image name', - * 1=>'Key Metrics', - * 2=>'home_metrics' - * ), - * 'Header'=>Array(0=>'Metrics', - * 1=>'Count' - * ), - * 'Entries'=>Array($cvid=>Array( - * 0=>$customview name, - * 1=>$no of records for the view - * ), - * $cvid=>Array( - * 0=>$customview name, - * 1=>$no of records for the view - * ), - * | - * | - * $cvid=>Array( - * 0=>$customview name, - * 1=>$no of records for the view - * ) - * ) - * - */ -function getKeyMetrics($maxval,$calCnt) -{ - require_once("data/Tracker.php"); - require_once('modules/CustomView/CustomView.php'); - require_once('include/logging.php'); - require_once('include/ListView/ListView.php'); - - global $app_strings; - global $adb; - global $log; - global $current_language; - $metricviewnames = "'Hot Leads'"; - - $current_module_strings = return_module_language($current_language, "CustomView"); - $log = LoggerManager::getLogger('metrics'); - - $metriclists = getMetricList(); - - // Determine if the KeyMetrics widget should appear or not? - if($calCnt == 'calculateCnt') { - return count($metriclists); - } - - $log->info("Metrics :: Successfully got MetricList to be displayed"); - if(isset($metriclists)) - { - global $current_user; - foreach ($metriclists as $key => $metriclist) { - $queryGenerator = new QueryGenerator($metriclist['module'], $current_user); - $queryGenerator->initForCustomViewById($metriclist['id']); - $metricsql = $queryGenerator->getQuery(); - $metricsql = mkCountQuery($metricsql); - $metricresult = $adb->query($metricsql); - if($metricresult) - { - if($metriclist['module'] == "Calendar") - $metriclists[$key]['count'] = $adb->num_rows($metricresult); - else - { - $rowcount = $adb->fetch_array($metricresult); - if(isset($rowcount)) - { - $metriclists[$key]['count'] = $rowcount['count']; - } - } - } - } - $log->info("Metrics :: Successfully build the Metrics"); - } - $title=array(); - $title[]='keyMetrics.gif'; - $title[]=$app_strings['LBL_HOME_KEY_METRICS']; - $title[]='home_metrics'; - $header=Array(); - $header[]=$app_strings['LBL_HOME_METRICS']; - $header[]=$app_strings['LBL_MODULE']; - $header[]=$app_strings['LBL_HOME_COUNT']; - $entries=Array(); - if(isset($metriclists)) - { - $oddRow = true; - foreach($metriclists as $metriclist) - { - $value=array(); - $CVname = (strlen($metriclist['name']) > 20) ? (substr($metriclist['name'],0,20).'...') : $metriclist['name']; - $value[]=''.$CVname . ' ('. $metriclist['user'] .')'; - $value[]=''.getTranslatedString($metriclist['module']). ''; - $value[]=''.$metriclist['count'].''; - $entries[$metriclist['id']]=$value; - } - - } - $values=Array('Title'=>$title,'Header'=>$header,'Entries'=>$entries); - if ( ($display_empty_home_blocks ) || (count($value)!= 0) ) - return $values; - -} - - /** to get the details of a customview Entries - * @returns $metriclists Array in the following format - * $customviewlist []= Array('id'=>custom view id, - * 'name'=>custom view name, - * 'module'=>modulename, - 'count'=>'' - ) - */ -function getMetricList() -{ - global $adb, $current_user; - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - - $ssql = "select vtiger_customview.* from vtiger_customview inner join vtiger_tab on vtiger_tab.name = vtiger_customview.entitytype"; - $ssql .= " where vtiger_customview.setmetrics = 1 "; - $sparams = array(); - - if($is_admin == false){ - $ssql .= " and (vtiger_customview.status=0 or vtiger_customview.userid = ? or vtiger_customview.status =3 or vtiger_customview.userid in(select vtiger_user2role.userid from vtiger_user2role inner join vtiger_users on vtiger_users.id=vtiger_user2role.userid inner join vtiger_role on vtiger_role.roleid=vtiger_user2role.roleid where vtiger_role.parentrole like '".$current_user_parent_role_seq."::%'))"; - array_push($sparams, $current_user->id); - } - $ssql .= " order by vtiger_customview.entitytype"; - $result = $adb->pquery($ssql, $sparams); - while($cvrow=$adb->fetch_array($result)) - { - $metricslist = Array(); - - if(vtlib_isModuleActive($cvrow['entitytype'])){ - $metricslist['id'] = $cvrow['cvid']; - $metricslist['name'] = $cvrow['viewname']; - $metricslist['module'] = $cvrow['entitytype']; - $metricslist['user'] = getUserName($cvrow['userid']); - $metricslist['count'] = ''; - if(isPermitted($cvrow['entitytype'],"index") == "yes"){ - $metriclists[] = $metricslist; - } - } - } - - return $metriclists; -} - -?> diff --git a/oss/vtiger/trunk/modules/CustomView/PopulateCustomView.php b/oss/vtiger/trunk/modules/CustomView/PopulateCustomView.php deleted file mode 100644 index e0025708..00000000 --- a/oss/vtiger/trunk/modules/CustomView/PopulateCustomView.php +++ /dev/null @@ -1,644 +0,0 @@ -'All', - 'setdefault'=>'1','setmetrics'=>'0','status'=>'0','userid'=>'1', - 'cvmodule'=>'Leads','stdfilterid'=>'','advfilterid'=>''), - - Array('viewname'=>'Hot Leads', - 'setdefault'=>'0','setmetrics'=>'1','status'=>'3','userid'=>'1', - 'cvmodule'=>'Leads','stdfilterid'=>'','advfilterid'=>'0'), - - Array('viewname'=>'This Month Leads', - 'setdefault'=>'0','setmetrics'=>'0','status'=>'3','userid'=>'1', - 'cvmodule'=>'Leads','stdfilterid'=>'0','advfilterid'=>''), - - Array('viewname'=>'All', - 'setdefault'=>'1','setmetrics'=>'0','status'=>'0','userid'=>'1', - 'cvmodule'=>'Accounts','stdfilterid'=>'','advfilterid'=>''), - - Array('viewname'=>'Prospect Accounts', - 'setdefault'=>'0','setmetrics'=>'1','status'=>'3','userid'=>'1', - 'cvmodule'=>'Accounts','stdfilterid'=>'','advfilterid'=>'1'), - - Array('viewname'=>'New This Week', - 'setdefault'=>'0','setmetrics'=>'0','status'=>'3','userid'=>'1', - 'cvmodule'=>'Accounts','stdfilterid'=>'1','advfilterid'=>''), - - Array('viewname'=>'All', - 'setdefault'=>'1','setmetrics'=>'0','status'=>'0','userid'=>'1', - 'cvmodule'=>'Contacts','stdfilterid'=>'','advfilterid'=>''), - - Array('viewname'=>'Contacts Address', - 'setdefault'=>'0','setmetrics'=>'0','status'=>'3','userid'=>'1', - 'cvmodule'=>'Contacts','stdfilterid'=>'','advfilterid'=>''), - - Array('viewname'=>'Todays Birthday', - 'setdefault'=>'0','setmetrics'=>'0','status'=>'3','userid'=>'1', - 'cvmodule'=>'Contacts','stdfilterid'=>'2','advfilterid'=>''), - - Array('viewname'=>'All', - 'setdefault'=>'1','setmetrics'=>'0','status'=>'0','userid'=>'1', - 'cvmodule'=>'Potentials','stdfilterid'=>'','advfilterid'=>''), - - Array('viewname'=>'Potentials Won', - 'setdefault'=>'0','setmetrics'=>'1','status'=>'3','userid'=>'1', - 'cvmodule'=>'Potentials','stdfilterid'=>'','advfilterid'=>'2'), - - Array('viewname'=>'Prospecting', - 'setdefault'=>'0','setmetrics'=>'0','status'=>'3','userid'=>'1', - 'cvmodule'=>'Potentials','stdfilterid'=>'','advfilterid'=>'3'), - - Array('viewname'=>'All', - 'setdefault'=>'1','setmetrics'=>'0','status'=>'0','userid'=>'1', - 'cvmodule'=>'HelpDesk','stdfilterid'=>'','advfilterid'=>''), - - Array('viewname'=>'Open Tickets', - 'setdefault'=>'0','setmetrics'=>'1','status'=>'3','userid'=>'1', - 'cvmodule'=>'HelpDesk','stdfilterid'=>'','advfilterid'=>'4'), - - Array('viewname'=>'High Prioriy Tickets', - 'setdefault'=>'0','setmetrics'=>'0','status'=>'3','userid'=>'1', - 'cvmodule'=>'HelpDesk','stdfilterid'=>'','advfilterid'=>'5'), - - Array('viewname'=>'All', - 'setdefault'=>'1','setmetrics'=>'0','status'=>'0','userid'=>'1', - 'cvmodule'=>'Quotes','stdfilterid'=>'','advfilterid'=>''), - - Array('viewname'=>'Open Quotes', - 'setdefault'=>'0','setmetrics'=>'1','status'=>'3','userid'=>'1', - 'cvmodule'=>'Quotes','stdfilterid'=>'','advfilterid'=>'6'), - - Array('viewname'=>'Rejected Quotes', - 'setdefault'=>'0','setmetrics'=>'0','status'=>'3','userid'=>'1', - 'cvmodule'=>'Quotes','stdfilterid'=>'','advfilterid'=>'7'), - - Array('viewname'=>'All', - 'setdefault'=>'1','setmetrics'=>'0','status'=>'0','userid'=>'1', - 'cvmodule'=>'Calendar','stdfilterid'=>'','advfilterid'=>''), - - Array('viewname'=>'All', - 'setdefault'=>'1','setmetrics'=>'0','status'=>'0','userid'=>'1', - 'cvmodule'=>'Emails','stdfilterid'=>'','advfilterid'=>''), - - Array('viewname'=>'All', - 'setdefault'=>'1','setmetrics'=>'0','status'=>'0','userid'=>'1', - 'cvmodule'=>'Invoice','stdfilterid'=>'','advfilterid'=>''), - - Array('viewname'=>'All', - 'setdefault'=>'1','setmetrics'=>'0','status'=>'0','userid'=>'1', - 'cvmodule'=>'Documents','stdfilterid'=>'','advfilterid'=>''), - - Array('viewname'=>'All', - 'setdefault'=>'1','setmetrics'=>'0','status'=>'0','userid'=>'1', - 'cvmodule'=>'PriceBooks','stdfilterid'=>'','advfilterid'=>''), - - Array('viewname'=>'All', - 'setdefault'=>'1','setmetrics'=>'0','status'=>'0','userid'=>'1', - 'cvmodule'=>'Products','stdfilterid'=>'','advfilterid'=>''), - - Array('viewname'=>'All', - 'setdefault'=>'1','setmetrics'=>'0','status'=>'0','userid'=>'1', - 'cvmodule'=>'PurchaseOrder','stdfilterid'=>'','advfilterid'=>''), - - Array('viewname'=>'All', - 'setdefault'=>'1','setmetrics'=>'0','status'=>'0','userid'=>'1', - 'cvmodule'=>'SalesOrder','stdfilterid'=>'','advfilterid'=>''), - - Array('viewname'=>'All', - 'setdefault'=>'1','setmetrics'=>'0','status'=>'0','userid'=>'1', - 'cvmodule'=>'Vendors','stdfilterid'=>'','advfilterid'=>''), - - Array('viewname'=>'All', - 'setdefault'=>'1','setmetrics'=>'0','status'=>'0','userid'=>'1', - 'cvmodule'=>'Faq','stdfilterid'=>'','advfilterid'=>''), - - Array('viewname'=>'All', - 'setdefault'=>'1','setmetrics'=>'0','status'=>'0','userid'=>'1', - 'cvmodule'=>'Campaigns','stdfilterid'=>'','advfilterid'=>''), - - Array('viewname'=>'All', - 'setdefault'=>'1','setmetrics'=>'0','status'=>'0','userid'=>'1', - 'cvmodule'=>'Webmails','stdfilterid'=>'','advfilterid'=>''), - - Array('viewname'=>'Drafted FAQ', - 'setdefault'=>'0','setmetrics'=>'0','status'=>'3','userid'=>'1', - 'cvmodule'=>'Faq','stdfilterid'=>'','advfilterid'=>'8'), - - Array('viewname'=>'Published FAQ', - 'setdefault'=>'0','setmetrics'=>'0','status'=>'3','userid'=>'1', - 'cvmodule'=>'Faq','stdfilterid'=>'','advfilterid'=>'9'), - - Array('viewname'=>'Open Purchase Orders', - 'setdefault'=>'0','setmetrics'=>'0','status'=>'3','userid'=>'1', - 'cvmodule'=>'PurchaseOrder','stdfilterid'=>'','advfilterid'=>'10'), - - Array('viewname'=>'Received Purchase Orders', - 'setdefault'=>'0','setmetrics'=>'0','status'=>'3','userid'=>'1', - 'cvmodule'=>'PurchaseOrder','stdfilterid'=>'','advfilterid'=>'11'), - - Array('viewname'=>'Open Invoices', - 'setdefault'=>'0','setmetrics'=>'0','status'=>'3','userid'=>'1', - 'cvmodule'=>'Invoice','stdfilterid'=>'','advfilterid'=>'12'), - - Array('viewname'=>'Paid Invoices', - 'setdefault'=>'0','setmetrics'=>'0','status'=>'3','userid'=>'1', - 'cvmodule'=>'Invoice','stdfilterid'=>'','advfilterid'=>'13'), - - Array('viewname'=>'Pending Sales Orders', - 'setdefault'=>'0','setmetrics'=>'0','status'=>'3','userid'=>'1', - 'cvmodule'=>'SalesOrder','stdfilterid'=>'','advfilterid'=>'14'), - ); - - -$cvcolumns = Array(Array('vtiger_leaddetails:lead_no:lead_no:Leads_Lead_No:V', - 'vtiger_leaddetails:lastname:lastname:Leads_Last_Name:V', - 'vtiger_leaddetails:firstname:firstname:Leads_First_Name:V', - 'vtiger_leaddetails:company:company:Leads_Company:V', - 'vtiger_leadaddress:phone:phone:Leads_Phone:V', - 'vtiger_leadsubdetails:website:website:Leads_Website:V', - 'vtiger_leaddetails:email:email:Leads_Email:E', - 'vtiger_crmentity:smownerid:assigned_user_id:Leads_Assigned_To:V'), - - Array('vtiger_leaddetails:firstname:firstname:Leads_First_Name:V', - 'vtiger_leaddetails:lastname:lastname:Leads_Last_Name:V', - 'vtiger_leaddetails:company:company:Leads_Company:V', - 'vtiger_leaddetails:leadsource:leadsource:Leads_Lead_Source:V', - 'vtiger_leadsubdetails:website:website:Leads_Website:V', - 'vtiger_leaddetails:email:email:Leads_Email:E'), - - Array('vtiger_leaddetails:firstname:firstname:Leads_First_Name:V', - 'vtiger_leaddetails:lastname:lastname:Leads_Last_Name:V', - 'vtiger_leaddetails:company:company:Leads_Company:V', - 'vtiger_leaddetails:leadsource:leadsource:Leads_Lead_Source:V', - 'vtiger_leadsubdetails:website:website:Leads_Website:V', - 'vtiger_leaddetails:email:email:Leads_Email:E'), - - Array('vtiger_account:account_no:account_no:Accounts_Account_No:V', - 'vtiger_account:accountname:accountname:Accounts_Account_Name:V', - 'vtiger_accountbillads:bill_city:bill_city:Accounts_City:V', - 'vtiger_account:website:website:Accounts_Website:V', - 'vtiger_account:phone:phone:Accounts_Phone:V', - 'vtiger_crmentity:smownerid:assigned_user_id:Accounts_Assigned_To:V'), - - Array('vtiger_account:accountname:accountname:Accounts_Account_Name:V', - 'vtiger_account:phone:phone:Accounts_Phone:V', - 'vtiger_account:website:website:Accounts_Website:V', - 'vtiger_account:rating:rating:Accounts_Rating:V', - 'vtiger_crmentity:smownerid:assigned_user_id:Accounts_Assigned_To:V'), - - Array('vtiger_account:accountname:accountname:Accounts_Account_Name:V', - 'vtiger_account:phone:phone:Accounts_Phone:V', - 'vtiger_account:website:website:Accounts_Website:V', - 'vtiger_accountbillads:bill_city:bill_city:Accounts_City:V', - 'vtiger_crmentity:smownerid:assigned_user_id:Accounts_Assigned_To:V'), - - Array('vtiger_contactdetails:contact_no:contact_no:Contacts_Contact_Id:V', - 'vtiger_contactdetails:firstname:firstname:Contacts_First_Name:V', - 'vtiger_contactdetails:lastname:lastname:Contacts_Last_Name:V', - 'vtiger_contactdetails:title:title:Contacts_Title:V', - 'vtiger_contactdetails:accountid:account_id:Contacts_Account_Name:I', - 'vtiger_contactdetails:email:email:Contacts_Email:E', - 'vtiger_contactdetails:phone:phone:Contacts_Office_Phone:V', - 'vtiger_crmentity:smownerid:assigned_user_id:Contacts_Assigned_To:V'), - - Array('vtiger_contactdetails:firstname:firstname:Contacts_First_Name:V', - 'vtiger_contactdetails:lastname:lastname:Contacts_Last_Name:V', - 'vtiger_contactaddress:mailingstreet:mailingstreet:Contacts_Mailing_Street:V', - 'vtiger_contactaddress:mailingcity:mailingcity:Contacts_Mailing_City:V', - 'vtiger_contactaddress:mailingstate:mailingstate:Contacts_Mailing_State:V', - 'vtiger_contactaddress:mailingzip:mailingzip:Contacts_Mailing_Zip:V', - 'vtiger_contactaddress:mailingcountry:mailingcountry:Contacts_Mailing_Country:V'), - - Array('vtiger_contactdetails:firstname:firstname:Contacts_First_Name:V', - 'vtiger_contactdetails:lastname:lastname:Contacts_Last_Name:V', - 'vtiger_contactdetails:title:title:Contacts_Title:V', - 'vtiger_contactdetails:accountid:account_id:Contacts_Account_Name:I', - 'vtiger_contactdetails:email:email:Contacts_Email:E', - 'vtiger_contactsubdetails:otherphone:otherphone:Contacts_Phone:V', - 'vtiger_crmentity:smownerid:assigned_user_id:Contacts_Assigned_To:V'), - - Array('vtiger_potential:potential_no:potential_no:Potentials_Potential_No:V', - 'vtiger_potential:potentialname:potentialname:Potentials_Potential_Name:V', - 'vtiger_potential:related_to:related_to:Potentials_Related_To:V', - 'vtiger_potential:sales_stage:sales_stage:Potentials_Sales_Stage:V', - 'vtiger_potential:leadsource:leadsource:Potentials_Lead_Source:V', - 'vtiger_potential:closingdate:closingdate:Potentials_Expected_Close_Date:D', - 'vtiger_crmentity:smownerid:assigned_user_id:Potentials_Assigned_To:V'), - - Array('vtiger_potential:potentialname:potentialname:Potentials_Potential_Name:V', - 'vtiger_potential:related_to:related_to:Potentials_Related_To:V', - 'vtiger_potential:amount:amount:Potentials_Amount:N', - 'vtiger_potential:closingdate:closingdate:Potentials_Expected_Close_Date:D', - 'vtiger_crmentity:smownerid:assigned_user_id:Potentials_Assigned_To:V'), - - Array('vtiger_potential:potentialname:potentialname:Potentials_Potential_Name:V', - 'vtiger_potential:related_to:related_to:Potentials_Related_To:V', - 'vtiger_potential:amount:amount:Potentials_Amount:N', - 'vtiger_potential:leadsource:leadsource:Potentials_Lead_Source:V', - 'vtiger_potential:closingdate:closingdate:Potentials_Expected_Close_Date:D', - 'vtiger_crmentity:smownerid:assigned_user_id:Potentials_Assigned_To:V'), - - Array(//'vtiger_crmentity:crmid::HelpDesk_Ticket_ID:I', - 'vtiger_troubletickets:ticket_no:ticket_no:HelpDesk_Ticket_No:V', - 'vtiger_troubletickets:title:ticket_title:HelpDesk_Title:V', - 'vtiger_troubletickets:parent_id:parent_id:HelpDesk_Related_To:I', - 'vtiger_troubletickets:status:ticketstatus:HelpDesk_Status:V', - 'vtiger_troubletickets:priority:ticketpriorities:HelpDesk_Priority:V', - 'vtiger_crmentity:smownerid:assigned_user_id:HelpDesk_Assigned_To:V'), - - Array('vtiger_troubletickets:title:ticket_title:HelpDesk_Title:V', - 'vtiger_troubletickets:parent_id:parent_id:HelpDesk_Related_To:I', - 'vtiger_troubletickets:priority:ticketpriorities:HelpDesk_Priority:V', - 'vtiger_troubletickets:product_id:product_id:HelpDesk_Product_Name:I', - 'vtiger_crmentity:smownerid:assigned_user_id:HelpDesk_Assigned_To:V'), - - Array('vtiger_troubletickets:title:ticket_title:HelpDesk_Title:V', - 'vtiger_troubletickets:parent_id:parent_id:HelpDesk_Related_To:I', - 'vtiger_troubletickets:status:ticketstatus:HelpDesk_Status:V', - 'vtiger_troubletickets:product_id:product_id:HelpDesk_Product_Name:I', - 'vtiger_crmentity:smownerid:assigned_user_id:HelpDesk_Assigned_To:V'), - - Array('vtiger_quotes:quote_no:quote_no:Quotes_Quote_No:V', - 'vtiger_quotes:subject:subject:Quotes_Subject:V', - 'vtiger_quotes:quotestage:quotestage:Quotes_Quote_Stage:V', - 'vtiger_quotes:potentialid:potential_id:Quotes_Potential_Name:I', - 'vtiger_quotes:accountid:account_id:Quotes_Account_Name:I', - 'vtiger_quotes:total:hdnGrandTotal:Quotes_Total:I', - 'vtiger_crmentity:smownerid:assigned_user_id:Quotes_Assigned_To:V'), - - Array('vtiger_quotes:subject:subject:Quotes_Subject:V', - 'vtiger_quotes:quotestage:quotestage:Quotes_Quote_Stage:V', - 'vtiger_quotes:potentialid:potential_id:Quotes_Potential_Name:I', - 'vtiger_quotes:accountid:account_id:Quotes_Account_Name:I', - 'vtiger_quotes:validtill:validtill:Quotes_Valid_Till:D', - 'vtiger_crmentity:smownerid:assigned_user_id:Quotes_Assigned_To:V'), - - Array('vtiger_quotes:subject:subject:Quotes_Subject:V', - 'vtiger_quotes:potentialid:potential_id:Quotes_Potential_Name:I', - 'vtiger_quotes:accountid:account_id:Quotes_Account_Name:I', - 'vtiger_quotes:validtill:validtill:Quotes_Valid_Till:D', - 'vtiger_crmentity:smownerid:assigned_user_id:Quotes_Assigned_To:V'), - - Array('vtiger_activity:status:taskstatus:Calendar_Status:V', - 'vtiger_activity:activitytype:activitytype:Calendar_Type:V', - 'vtiger_activity:subject:subject:Calendar_Subject:V', - 'vtiger_seactivityrel:crmid:parent_id:Calendar_Related_to:V', - 'vtiger_activity:date_start:date_start:Calendar_Start_Date:D', - 'vtiger_activity:due_date:due_date:Calendar_End_Date:D', - 'vtiger_crmentity:smownerid:assigned_user_id:Calendar_Assigned_To:V'), - - Array('vtiger_activity:subject:subject:Emails_Subject:V', - 'vtiger_emaildetails:to_email:saved_toid:Emails_To:V', - 'vtiger_activity:date_start:date_start:Emails_Date_Sent:D'), - - Array('vtiger_invoice:invoice_no:invoice_no:Invoice_Invoice_No:V', - 'vtiger_invoice:subject:subject:Invoice_Subject:V', - 'vtiger_invoice:salesorderid:salesorder_id:Invoice_Sales_Order:I', - 'vtiger_invoice:invoicestatus:invoicestatus:Invoice_Status:V', - 'vtiger_invoice:total:hdnGrandTotal:Invoice_Total:I', - 'vtiger_crmentity:smownerid:assigned_user_id:Invoice_Assigned_To:V'), - - Array('vtiger_notes:note_no:note_no:Notes_Note_No:V', - 'vtiger_notes:title:notes_title:Notes_Title:V', - 'vtiger_notes:filename:filename:Notes_File:V', - 'vtiger_crmentity:modifiedtime:modifiedtime:Notes_Modified_Time:V', - 'vtiger_crmentity:smownerid:assigned_user_id:Notes_Assigned_To:V'), - - Array('vtiger_pricebook:pricebook_no:pricebook_no:PriceBooks_PriceBook_No:V', - 'vtiger_pricebook:bookname:bookname:PriceBooks_Price_Book_Name:V', - 'vtiger_pricebook:active:active:PriceBooks_Active:V', - 'vtiger_pricebook:currency_id:currency_id:PriceBooks_Currency:I'), - - Array('vtiger_products:product_no:product_no:Products_Product_No:V', - 'vtiger_products:productname:productname:Products_Product_Name:V', - 'vtiger_products:productcode:productcode:Products_Part_Number:V', - 'vtiger_products:commissionrate:commissionrate:Products_Commission_Rate:V', - 'vtiger_products:qtyinstock:qtyinstock:Products_Quantity_In_Stock:V', - 'vtiger_products:qty_per_unit:qty_per_unit:Products_Qty/Unit:V', - 'vtiger_products:unit_price:unit_price:Products_Unit_Price:V'), - - Array('vtiger_purchaseorder:purchaseorder_no:purchaseorder_no:PurchaseOrder_PurchaseOrder_No:V', - 'vtiger_purchaseorder:subject:subject:PurchaseOrder_Subject:V', - 'vtiger_purchaseorder:vendorid:vendor_id:PurchaseOrder_Vendor_Name:I', - 'vtiger_purchaseorder:tracking_no:tracking_no:PurchaseOrder_Tracking_Number:V', - 'vtiger_purchaseorder:total:hdnGrandTotal:PurchaseOrder_Total:V', - 'vtiger_crmentity:smownerid:assigned_user_id:PurchaseOrder_Assigned_To:V'), - - Array('vtiger_salesorder:salesorder_no:salesorder_no:SalesOrder_SalesOrder_No:V', - 'vtiger_salesorder:subject:subject:SalesOrder_Subject:V', - 'vtiger_salesorder:accountid:account_id:SalesOrder_Account_Name:I', - 'vtiger_salesorder:quoteid:quote_id:SalesOrder_Quote_Name:I', - 'vtiger_salesorder:total:hdnGrandTotal:SalesOrder_Total:V', - 'vtiger_crmentity:smownerid:assigned_user_id:SalesOrder_Assigned_To:V'), - - Array('vtiger_vendor:vendor_no:vendor_no:Vendors_Vendor_No:V', - 'vtiger_vendor:vendorname:vendorname:Vendors_Vendor_Name:V', - 'vtiger_vendor:phone:phone:Vendors_Phone:V', - 'vtiger_vendor:email:email:Vendors_Email:E', - 'vtiger_vendor:category:category:Vendors_Category:V'), - - - - - Array(//'vtiger_faq:id::Faq_FAQ_Id:I', - 'vtiger_faq:faq_no:faq_no:Faq_Faq_No:V', - 'vtiger_faq:question:question:Faq_Question:V', - 'vtiger_faq:category:faqcategories:Faq_Category:V', - 'vtiger_faq:product_id:product_id:Faq_Product_Name:I', - 'vtiger_crmentity:createdtime:createdtime:Faq_Created_Time:D', - 'vtiger_crmentity:modifiedtime:modifiedtime:Faq_Modified_Time:D'), - //this sequence has to be maintained - Array('vtiger_campaign:campaign_no:campaign_no:Campaigns_Campaign_No:V', - 'vtiger_campaign:campaignname:campaignname:Campaigns_Campaign_Name:V', - 'vtiger_campaign:campaigntype:campaigntype:Campaigns_Campaign_Type:N', - 'vtiger_campaign:campaignstatus:campaignstatus:Campaigns_Campaign_Status:N', - 'vtiger_campaign:expectedrevenue:expectedrevenue:Campaigns_Expected_Revenue:V', - 'vtiger_campaign:closingdate:closingdate:Campaigns_Expected_Close_Date:D', - 'vtiger_crmentity:smownerid:assigned_user_id:Campaigns_Assigned_To:V'), - - - Array('subject:subject:subject:Subject:V', - 'from:fromname:fromname:From:N', - 'to:tpname:toname:To:N', - 'body:body:body:Body:V'), - - Array ('vtiger_faq:question:question:Faq_Question:V', - 'vtiger_faq:status:faqstatus:Faq_Status:V', - 'vtiger_faq:product_id:product_id:Faq_Product_Name:I', - 'vtiger_faq:category:faqcategories:Faq_Category:V', - 'vtiger_crmentity:createdtime:createdtime:Faq_Created_Time:T'), - - Array( 'vtiger_faq:question:question:Faq_Question:V', - 'vtiger_faq:answer:faq_answer:Faq_Answer:V', - 'vtiger_faq:status:faqstatus:Faq_Status:V', - 'vtiger_faq:product_id:product_id:Faq_Product_Name:I', - 'vtiger_faq:category:faqcategories:Faq_Category:V', - 'vtiger_crmentity:createdtime:createdtime:Faq_Created_Time:T'), - - Array( 'vtiger_purchaseorder:subject:subject:PurchaseOrder_Subject:V', - 'vtiger_purchaseorder:postatus:postatus:PurchaseOrder_Status:V', - 'vtiger_purchaseorder:vendorid:vendor_id:PurchaseOrder_Vendor_Name:I', - 'vtiger_crmentity:smownerid:assigned_user_id:PurchaseOrder_Assigned_To:V', - 'vtiger_purchaseorder:duedate:duedate:PurchaseOrder_Due_Date:V'), - - Array ('vtiger_purchaseorder:subject:subject:PurchaseOrder_Subject:V', - 'vtiger_purchaseorder:vendorid:vendor_id:PurchaseOrder_Vendor_Name:I', - 'vtiger_crmentity:smownerid:assigned_user_id:PurchaseOrder_Assigned_To:V', - 'vtiger_purchaseorder:postatus:postatus:PurchaseOrder_Status:V', - 'vtiger_purchaseorder:carrier:carrier:PurchaseOrder_Carrier:V', - 'vtiger_poshipads:ship_street:ship_street:PurchaseOrder_Shipping_Address:V'), - - Array( 'vtiger_invoice:invoice_no:invoice_no:Invoice_Invoice_No:V', - 'vtiger_invoice:subject:subject:Invoice_Subject:V', - 'vtiger_invoice:accountid:account_id:Invoice_Account_Name:I', - 'vtiger_invoice:salesorderid:salesorder_id:Invoice_Sales_Order:I', - 'vtiger_invoice:invoicestatus:invoicestatus:Invoice_Status:V', - 'vtiger_crmentity:smownerid:assigned_user_id:Invoice_Assigned_To:V', - 'vtiger_crmentity:createdtime:createdtime:Invoice_Created_Time:T'), - - Array( 'vtiger_invoice:invoice_no:invoice_no:Invoice_Invoice_No:V', - 'vtiger_invoice:subject:subject:Invoice_Subject:V', - 'vtiger_invoice:accountid:account_id:Invoice_Account_Name:I', - 'vtiger_invoice:salesorderid:salesorder_id:Invoice_Sales_Order:I', - 'vtiger_invoice:invoicestatus:invoicestatus:Invoice_Status:V', - 'vtiger_invoiceshipads:ship_street:ship_street:Invoice_Shipping_Address:V', - 'vtiger_crmentity:smownerid:assigned_user_id:Invoice_Assigned_To:V'), - - Array( 'vtiger_salesorder:subject:subject:SalesOrder_Subject:V', - 'vtiger_salesorder:accountid:account_id:SalesOrder_Account_Name:I', - 'vtiger_salesorder:sostatus:sostatus:SalesOrder_Status:V', - 'vtiger_crmentity:smownerid:assigned_user_id:SalesOrder_Assigned_To:V', - 'vtiger_soshipads:ship_street:ship_street:SalesOrder_Shipping_Address:V', - 'vtiger_salesorder:carrier:carrier:SalesOrder_Carrier:V'), - - ); - - - -$cvstdfilters = Array(Array('columnname'=>'vtiger_crmentity:modifiedtime:modifiedtime:Leads_Modified_Time', - 'datefilter'=>'thismonth', - 'startdate'=>'2005-06-01', - 'enddate'=>'2005-06-30'), - - Array('columnname'=>'vtiger_crmentity:createdtime:createdtime:Accounts_Created_Time', - 'datefilter'=>'thisweek', - 'startdate'=>'2005-06-19', - 'enddate'=>'2005-06-25'), - - Array('columnname'=>'vtiger_contactsubdetails:birthday:birthday:Contacts_Birthdate', - 'datefilter'=>'today', - 'startdate'=>'2005-06-25', - 'enddate'=>'2005-06-25') - ); - -$cvadvfilters = Array( - Array( - Array('columnname'=>'vtiger_leaddetails:leadstatus:leadstatus:Leads_Lead_Status:V', - 'comparator'=>'e', - 'value'=>'Hot' - ) - ), - Array( - Array('columnname'=>'vtiger_account:account_type:accounttype:Accounts_Type:V', - 'comparator'=>'e', - 'value'=>'Prospect' - ) - ), - Array( - Array('columnname'=>'vtiger_potential:sales_stage:sales_stage:Potentials_Sales_Stage:V', - 'comparator'=>'e', - 'value'=>'Closed Won' - ) - ), - Array( - Array('columnname'=>'vtiger_potential:sales_stage:sales_stage:Potentials_Sales_Stage:V', - 'comparator'=>'e', - 'value'=>'Prospecting' - ) - ), - Array( - Array('columnname'=>'vtiger_troubletickets:status:ticketstatus:HelpDesk_Status:V', - 'comparator'=>'n', - 'value'=>'Closed' - ) - ), - Array( - Array('columnname'=>'vtiger_troubletickets:priority:ticketpriorities:HelpDesk_Priority:V', - 'comparator'=>'e', - 'value'=>'High' - ) - ), - Array( - Array('columnname'=>'vtiger_quotes:quotestage:quotestage:Quotes_Quote_Stage:V', - 'comparator'=>'n', - 'value'=>'Accepted' - ), - Array('columnname'=>'vtiger_quotes:quotestage:quotestage:Quotes_Quote_Stage:V', - 'comparator'=>'n', - 'value'=>'Rejected' - ) - ), - Array( - Array('columnname'=>'vtiger_quotes:quotestage:quotestage:Quotes_Quote_Stage:V', - 'comparator'=>'e', - 'value'=>'Rejected' - ) - ), - - Array( - Array('columnname'=>'vtiger_faq:status:faqstatus:Faq_Status:V', - 'comparator'=>'e', - 'value'=>'Draft' - ) - ), - - Array( - Array('columnname'=>'vtiger_faq:status:faqstatus:Faq_Status:V', - 'comparator'=>'e', - 'value'=>'Published' - ) - ), - - Array( - Array('columnname'=>'vtiger_purchaseorder:postatus:postatus:PurchaseOrder_Status:V', - 'comparator'=>'e', - 'value'=>'Created, Approved, Delivered' - ) - ), - - Array( - Array('columnname'=>'vtiger_purchaseorder:postatus:postatus:PurchaseOrder_Status:V', - 'comparator'=>'e', - 'value'=>'Received Shipment' - ) - ), - - Array( - Array('columnname'=>'vtiger_invoice:invoicestatus:invoicestatus:Invoice_Status:V', - 'comparator'=>'e', - 'value'=>'Created, Approved, Sent' - ) - ), - - Array( - Array('columnname'=>'vtiger_invoice:invoicestatus:invoicestatus:Invoice_Status:V', - 'comparator'=>'e', - 'value'=>'Paid' - ) - ), - - Array( - Array('columnname'=>'vtiger_salesorder:sostatus:sostatus:SalesOrder_Status:V', - 'comparator'=>'e', - 'value'=>'Created, Approved' - ) - ) - - ); - -foreach($customviews as $key=>$customview) -{ - $queryid = insertCustomView($customview['viewname'],$customview['setdefault'],$customview['setmetrics'],$customview['cvmodule'],$customview['status'],$customview['userid']); - insertCvColumns($queryid,$cvcolumns[$key]); - - if(isset($cvstdfilters[$customview['stdfilterid']])) - { - $i = $customview['stdfilterid']; - insertCvStdFilter($queryid,$cvstdfilters[$i]['columnname'],$cvstdfilters[$i]['datefilter'],$cvstdfilters[$i]['startdate'],$cvstdfilters[$i]['enddate']); - } - if(isset($cvadvfilters[$customview['advfilterid']])) - { - insertCvAdvFilter($queryid,$cvadvfilters[$customview['advfilterid']]); - } -} - - /** to store the details of the customview in vtiger_customview table - * @param $viewname :: Type String - * @param $setdefault :: Type Integer - * @param $setmetrics :: Type Integer - * @param $cvmodule :: Type String - * @returns $customviewid of the stored custom view :: Type integer - */ -function insertCustomView($viewname,$setdefault,$setmetrics,$cvmodule,$status,$userid) -{ - global $adb; - - $genCVid = $adb->getUniqueID("vtiger_customview"); - - if($genCVid != "") - { - - $customviewsql = "insert into vtiger_customview(cvid,viewname,setdefault,setmetrics,entitytype,status,userid) values(?,?,?,?,?,?,?)"; - $customviewparams = array($genCVid, $viewname, $setdefault, $setmetrics, $cvmodule, $status, $userid); - $customviewresult = $adb->pquery($customviewsql, $customviewparams); - } - return $genCVid; -} - - /** to store the custom view columns of the customview in vtiger_cvcolumnlist table - * @param $cvid :: Type Integer - * @param $columnlist :: Type Array of columnlists - */ -function insertCvColumns($CVid,$columnslist) -{ - global $adb; - if($CVid != "") - { - for($i=0;$ipquery($columnsql, $columnparams); - } - } -} - - /** to store the custom view stdfilter of the customview in vtiger_cvstdfilter table - * @param $cvid :: Type Integer - * @param $filtercolumn($tablename:$columnname:$fieldname:$fieldlabel) :: Type String - * @param $filtercriteria(filter name) :: Type String - * @param $startdate :: Type String - * @param $enddate :: Type String - * returns nothing - */ -function insertCvStdFilter($CVid,$filtercolumn,$filtercriteria,$startdate,$enddate) -{ - global $adb; - if($CVid != "") - { - $stdfiltersql = "insert into vtiger_cvstdfilter(cvid,columnname,stdfilter,startdate,enddate) values (?,?,?,?,?)"; - $stdfilterparams = array($CVid, $filtercolumn, $filtercriteria, $startdate, $enddate); - $stdfilterresult = $adb->pquery($stdfiltersql, $stdfilterparams); - } -} - - /** to store the custom view advfilter of the customview in vtiger_cvadvfilter table - * @param $cvid :: Type Integer - * @param $filters :: Type Array('columnname'=>$tablename:$columnname:$fieldname:$fieldlabel,'comparator'=>$comparator,'value'=>$value) - * returns nothing - */ - -function insertCvAdvFilter($CVid,$filters) -{ - global $adb; - if($CVid != "") - { - foreach($filters as $i=>$filter) - { - $advfiltersql = "insert into vtiger_cvadvfilter(cvid,columnindex,columnname,comparator,value) values (?,?,?,?,?)"; - $advfilterparams = array($CVid, $i, $filter['columnname'], $filter['comparator'], $filter['value']); - $advfilterresult = $adb->pquery($advfiltersql, $advfilterparams); - } - } -} -?> diff --git a/oss/vtiger/trunk/modules/CustomView/Save.php b/oss/vtiger/trunk/modules/CustomView/Save.php deleted file mode 100644 index e6b407ee..00000000 --- a/oss/vtiger/trunk/modules/CustomView/Save.php +++ /dev/null @@ -1,247 +0,0 @@ -id; - - if(isset($_REQUEST["setDefault"])) { - $setdefault = 1; - } else { - $setdefault = 0; - } - - if(isset($_REQUEST["setMetrics"])) { - $setmetrics = 1; - } else { - $setmetrics = 0; - } - - //$allKeys = array_keys($HTTP_POST_VARS); - //this is will cause only the chosen fields to be added to the vtiger_cvcolumnlist table - $allKeys = array_keys($_REQUEST); - - //<<<<<<>>>>>>>>> - for ($i=0;$i>>>>>>>> - - //<<<<<<>>>>>>>> - $stdfiltercolumn = $_REQUEST["stdDateFilterField"]; - $std_filter_list["columnname"] = $stdfiltercolumn; - $stdcriteria = $_REQUEST["stdDateFilter"]; - $std_filter_list["stdfilter"] = $stdcriteria; - $startdate = $_REQUEST["startdate"]; - $enddate = $_REQUEST["enddate"]; - if($stdcriteria == "custom") { - $startdate = getDBInsertDateValue($startdate); - $enddate = getDBInsertDateValue($enddate); - } - $std_filter_list["startdate"] = $startdate; - $std_filter_list["enddate"]=$enddate; - if(empty($startdate) && empty($enddate)) - unset($std_filter_list); - //<<<<<<>>>>>>>> - - //<<<<<<>>>>>>>> - for ($i=0;$i>>>>>>> - - if(!$cvid) { - $genCVid = $adb->getUniqueID("vtiger_customview"); - if($genCVid != "") { - $customviewsql = "INSERT INTO vtiger_customview(cvid, viewname, setdefault, setmetrics, entitytype, status, userid) - VALUES (?,?,?,?,?,?,?)"; - $customviewparams = array($genCVid, $viewname, 0, $setmetrics, $cvmodule, $status, $userid); - $customviewresult = $adb->pquery($customviewsql, $customviewparams); - $log->info("CustomView :: Save :: vtiger_customview created successfully"); - - if($setdefault == 1) { - $sql_result = $adb->pquery("SELECT * FROM vtiger_user_module_preferences WHERE userid = ? and tabid = ?",array($current_user->id, $cv_tabid)); - if($adb->num_rows($sql_result) > 0) { - $updatedefaultsql = "UPDATE vtiger_user_module_preferences SET default_cvid = ? WHERE userid = ? and tabid = ?"; - $updatedefaultresult = $adb->pquery($updatedefaultsql, array($genCVid, $current_user->id, $cv_tabid)); - } else { - $insertdefaultsql = "INSERT INTO vtiger_user_module_preferences(userid, tabid, default_cvid) values (?,?,?)"; - $insertdefaultresult = $adb->pquery($insertdefaultsql, array($userid, $cv_tabid, $genCVid)); - } - } else { - $sql_result = $adb->pquery("SELECT * FROM vtiger_user_module_preferences WHERE userid = ? and tabid = ?",array($current_user->id, $cv_tabid)); - if($adb->num_rows($sql_result) > 0) { - $deletedefaultsql = "DELETE FROM vtiger_user_module_preferences WHERE userid = ? and tabid = ?"; - $deletedefaultresult = $adb->pquery($deletedefaultsql, array($current_user->id, $cv_tabid)); - } - } - - $log->info("CustomView :: Save :: setdefault upated successfully"); - - if($customviewresult) { - if(isset($columnslist)) { - for($i=0;$ipquery($columnsql, $columnparams); - } - $log->info("CustomView :: Save :: vtiger_cvcolumnlist created successfully"); - if($std_filter_list["columnname"] !="") { - $stdfiltersql = "INSERT INTO vtiger_cvstdfilter(cvid,columnname,stdfilter,startdate,enddate) VALUES (?,?,?,?,?)"; - $stdfilterparams = array($genCVid, $std_filter_list["columnname"], $std_filter_list["stdfilter"], $adb->formatDate($std_filter_list["startdate"], true), $adb->formatDate($std_filter_list["enddate"], true)); - $stdfilterresult = $adb->pquery($stdfiltersql, $stdfilterparams); - $log->info("CustomView :: Save :: vtiger_cvstdfilter created successfully"); - } - for($i=0;$ipquery($advfiltersql, $advfilterparams); - } - $log->info("CustomView :: Save :: vtiger_cvadvfilter created successfully"); - } - } - $cvid = $genCVid; - } - } else { - if($is_admin == true || $current_user->id) { - $updatecvsql = "UPDATE vtiger_customview - SET viewname = ?, setmetrics = ?, status = ? WHERE cvid = ?"; - $updatecvparams = array($viewname, $setmetrics, $status, $cvid); - $updatecvresult = $adb->pquery($updatecvsql, $updatecvparams); - $log->info("CustomView :: Save :: vtiger_customview upated successfully".$cvid); - - if($setdefault == 1) { - $sql_result = $adb->pquery("SELECT * FROM vtiger_user_module_preferences WHERE userid = ? and tabid = ?",array($current_user->id, $cv_tabid)); - if($adb->num_rows($sql_result) > 0) { - $updatedefaultsql = "UPDATE vtiger_user_module_preferences SET default_cvid = ? WHERE userid = ? and tabid = ?"; - $updatedefaultresult = $adb->pquery($updatedefaultsql, array($cvid, $current_user->id, $cv_tabid)); - } else { - $insertdefaultsql = "INSERT INTO vtiger_user_module_preferences(userid, tabid, default_cvid) values (?,?,?)"; - $insertdefaultresult = $adb->pquery($insertdefaultsql, array($userid, $cv_tabid, $cvid)); - } - } else { - $sql_result = $adb->pquery("SELECT * FROM vtiger_user_module_preferences WHERE userid = ? and tabid = ?",array($current_user->id, $cv_tabid)); - if($adb->num_rows($sql_result) > 0) { - $deletedefaultsql = "DELETE FROM vtiger_user_module_preferences WHERE userid = ? and tabid = ?"; - $deletedefaultresult = $adb->pquery($deletedefaultsql, array($current_user->id, $cv_tabid)); - } - } - $log->info("CustomView :: Save :: setdefault upated successfully".$cvid); - - $deletesql = "DELETE FROM vtiger_cvcolumnlist WHERE cvid = ?"; - $deleteresult = $adb->pquery($deletesql, array($cvid)); - - $deletesql = "DELETE FROM vtiger_cvstdfilter WHERE cvid = ?"; - $deleteresult = $adb->pquery($deletesql, array($cvid)); - - $deletesql = "DELETE FROM vtiger_cvadvfilter WHERE cvid = ?"; - $deleteresult = $adb->pquery($deletesql, array($cvid)); - $log->info("CustomView :: Save :: vtiger_cvcolumnlist,cvstdfilter,cvadvfilter deleted successfully before update".$genCVid); - - $genCVid = $cvid; - if($updatecvresult) { - if(isset($columnslist)) { - for($i=0;$ipquery($columnsql, $columnparams); - } - $log->info("CustomView :: Save :: vtiger_cvcolumnlist update successfully".$genCVid); - if($std_filter_list["columnname"] !="") { - $stdfiltersql = "INSERT INTO vtiger_cvstdfilter (cvid,columnname,stdfilter,startdate,enddate) VALUES (?,?,?,?,?)"; - $stdfilterparams = array($genCVid, $std_filter_list["columnname"], $std_filter_list["stdfilter"], $adb->formatDate($std_filter_list["startdate"], true), $adb->formatDate($std_filter_list["enddate"], true)); - $stdfilterresult = $adb->pquery($stdfiltersql, $stdfilterparams); - $log->info("CustomView :: Save :: vtiger_cvstdfilter update successfully".$genCVid); - } - for($i=0;$ipquery($advfiltersql, $advfilterparams); - } - $log->info("CustomView :: Save :: vtiger_cvadvfilter update successfully".$cvid); - } - } - } - } -} - -header("Location: index.php?action=$return_action&parenttab=$parenttab&module=$cvmodule&viewname=$cvid"); -?> \ No newline at end of file diff --git a/oss/vtiger/trunk/modules/CustomView/SaveAction.php b/oss/vtiger/trunk/modules/CustomView/SaveAction.php deleted file mode 100644 index 221b74c8..00000000 --- a/oss/vtiger/trunk/modules/CustomView/SaveAction.php +++ /dev/null @@ -1,52 +0,0 @@ -pquery($customactionsql, $customactionparams); - if($customactionresult == false) - { - include('themes/'.$theme.'/header.php'); - $errormessage = "Error Message
    -
  • Error while inserting the record -

" ; - echo $errormessage; - - } - - }elseif($mode == "edit") - { - $updatecasql = "update vtiger_customaction set subject=?, content=? where cvid=?"; - $updatecaresult = $adb->pquery($updatecasql, array($subject, $body, $cvid)); - if($updatecaresult == false) - { - include('themes/'.$theme.'/header.php'); - $errormessage = "Error Message
    -
  • Error while inserting the record -

" ; - echo $errormessage; - } - } -} -header("Location: index.php?action=index&module=$cvmodule&viewname=$cvid"); -?> \ No newline at end of file diff --git a/oss/vtiger/trunk/modules/CustomView/SendMailAction.php b/oss/vtiger/trunk/modules/CustomView/SendMailAction.php deleted file mode 100644 index fe613206..00000000 --- a/oss/vtiger/trunk/modules/CustomView/SendMailAction.php +++ /dev/null @@ -1,172 +0,0 @@ -getCustomActionDetails($viewid); - if(isset($CustomActionDtls)) - { - $subject = $CustomActionDtls["subject"]; - $contents = $CustomActionDtls["content"]; - } -} - -if(trim($subject) != "") -{ - if(isset($storearray) && $camodule != "") - { - foreach($storearray as $id) - { - if($id == '') continue; - if($camodule == "Contacts") - { - $sql="select * from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid where vtiger_crmentity.deleted =0 and vtiger_contactdetails.contactid=?"; - $result = $adb->pquery($sql, array($id)); - $camodulerow = $adb->fetch_array($result); - if(isset($camodulerow)) - { - $emailid = $camodulerow["email"]; - $otheremailid = $camodulerow["otheremail"]; - $yahooid = $camodulerow["yahooid"]; - - if(trim($emailid) != "") - { - SendMailtoCustomView($camodule,$id,$emailid,$current_user->id,$subject,$contents); - }elseif(trim($otheremailid) != "") - { - SendMailtoCustomView($camodule,$id,$otheremailid,$current_user->id,$subject,$contents); - }elseif(trim($yahooid) != "") - { - SendMailtoCustomView($camodule,$id,$yahooid,$current_user->id,$subject,$contents); - } - else - { - $adb->println("There is no email id for this Contact. Please give any email id."); - } - } - - }elseif($camodule == "Leads") - { - $sql="select * from vtiger_leaddetails inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_leaddetails.leadid where vtiger_crmentity.deleted =0 and vtiger_leaddetails.leadid=?"; - $result = $adb->pquery($sql, array($id)); - $camodulerow = $adb->fetch_array($result); - if(isset($camodulerow)) - { - $emailid = $camodulerow["email"]; - $yahooid = $camodulerow["yahooid"]; - - if(trim($emailid) != "") - { - SendMailtoCustomView($camodule,$id,$emailid,$current_user->id,$subject,$contents); - } - elseif($trim($yahooid) != "") - { - SendMailtoCustomView($camodule,$id,$yahooid,$current_user->id,$subject,$contents); - } - else - { - $adb->println("There is no email id for this Lead. Please give any email id."); - } - } - }elseif($camodule == "Accounts") - { - $sql="select * from vtiger_account inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_account.accountid where vtiger_crmentity.deleted =0 and vtiger_account.accountid=?"; - $result = $adb->pquery($sql, array($id)); - $camodulerow = $adb->fetch_array($result); - if(isset($camodulerow)) - { - $emailid = $camodulerow["email1"]; - $otheremailid = $camodulerow["email2"]; - - if(trim($emailid) != "") - { - SendMailtoCustomView($camodule,$id,$emailid,$current_user->id,$subject,$contents); - } - elseif(trim($otheremailid) != "") - { - SendMailtoCustomView($camodule,$id,$otheremailid,$current_user->id,$subject,$contents); - } - else - { - $adb->println("There is no email id for this Account. Please give any email id."); - } - } - } - } - } -} - -function SendMailtoCustomView($module,$id,$to,$current_user_id,$subject,$contents) -{ - - require_once("modules/Emails/class.phpmailer.php"); - - $mail = new PHPMailer(); - - $mail->Subject = $subject; - $mail->Body = nl2br($contents); - $mail->IsSMTP(); - - if($current_user_id != '') - { - global $adb; - $sql = "select * from vtiger_users where id= ?"; - $result = $adb->pquery($sql, array($current_user_id)); - $from = $adb->query_result($result,0,'email1'); - $initialfrom = $adb->query_result($result,0,'user_name'); - } - global $adb; - $mailserverresult=$adb->pquery("select * from vtiger_systems where server_type=?", array('email')); - $mail_server = $adb->query_result($mailserverresult,0,'server'); - $mail_server_username = $adb->query_result($mailserverresult,0,'server_username'); - $mail_server_password = $adb->query_result($mailserverresult,0,'server_password'); - $smtp_auth = $adb->query_result($mailserverresult,0,'smtp_auth'); - - $adb->println("Mail Server Details : '".$mail_server."','".$mail_server_username."','".$mail_server_password."'"); - $_REQUEST['server']=$mail_server; - - $mail->Host = $mail_server; - $mail->SMTPAuth = $smtp_auth; - $mail->Username = $mail_server_username; - $mail->Password = $mail_server_password; - $mail->From = $from; - $mail->FromName = $initialfrom; - - $mail->AddAddress($to); - $mail->AddReplyTo($from); - $mail->WordWrap = 50; - - $mail->IsHTML(true); - $mail->AltBody = "This is the body in plain text for non-HTML mail clients"; - - $adb->println("Mail sending process : To => '".$to."', From => '".$from."'"); - if(!$mail->Send()) - { - $adb->println("(CustomView/SendMailAction.php) Error in Mail Sending : ".$mail->ErrorInfo); - $errormsg = "Mail Could not be sent..."; - } - else - { - $adb->println("(CustomView/SendMailAction.php) Mail has been Sent to => ".$to); - } - -} -header("Location: index.php?action=index&module=$camodule&viewname=$viewid"); -?> \ No newline at end of file diff --git a/oss/vtiger/trunk/modules/CustomView/index.php b/oss/vtiger/trunk/modules/CustomView/index.php deleted file mode 100644 index 1b6d9296..00000000 --- a/oss/vtiger/trunk/modules/CustomView/index.php +++ /dev/null @@ -1,17 +0,0 @@ - diff --git a/oss/vtiger/trunk/modules/CustomView/language/en_us.lang.php b/oss/vtiger/trunk/modules/CustomView/language/en_us.lang.php deleted file mode 100644 index 48a6ff9b..00000000 --- a/oss/vtiger/trunk/modules/CustomView/language/en_us.lang.php +++ /dev/null @@ -1,285 +0,0 @@ -'Custom View', -'LBL_STEP_1_TITLE'=>'View Information', -'LBL_VIEW_NAME'=>'View Name:', -'LBL_SETDEFAULT'=>'Set as Default', -'LBL_LIST_IN_METRICS'=>'List in Metrics', -'LBL_STEP_2_TITLE'=>'Choose Columns', -'LBL_STEP_3_TITLE'=>'Standard Filters', -'LBL_STEP_4_TITLE'=>'Advanced Filters', -'LBL_STEP_5_TITLE'=>'Access Information', -'LBL_SF_COLUMNS'=>'Column', -'LBL_SF_STARTDATE'=>'Start Date', -'LBL_SF_ENDDATE'=>'End Date', -'LBL_AF_HDR1'=>'Set the search conditions to further restrict the list.', -'LBL_AF_HDR2'=>'You can use "or" filters by entering multiple -items in the third column.', -'LBL_AF_HDR3'=>'You can enter up to 10 items, separated by commas. For -example: CA, NY, TX, FL searches for CA or NY or TX or FL.', -'LBL_AF_HDR4'=>'If "Activity Type" is selected, give any one of the -following values "Call","Meeting" or "Task".', - -//strings added for vtiger 5, date format... -'LBL_NONE'=>'None', -'View_Name'=>'View_Name', -'LBL_AND'=>'And', -'LBL_DATE_FORMAT_CUSTOMVIEW'=>'Y-m-d', -//Strings added for filter -'Custom'=>'Custom', -'Previous FY'=>'Previous FY', -'Current FY'=>'Current FY', -'Next FY'=>'Next FY', -'Previous FQ'=>'Previous FQ', -'Current FQ'=>'Current FQ', -'Next FQ'=>'Next FQ', -'Yesterday'=>'Yesterday', -'Today'=>'Today', -'Tomorrow'=>'Tomorrow', -'Last Week'=>'Last Week', -'Current Week'=>'Current Week', -'Next Week'=>'Next Week', -'Last Month'=>'Last Month', -'Current Month'=>'Current Month', -'Next Month'=>'Next Month', -'Last 7 Days'=>'Last 7 Days', -'Last 30 Days'=>'Last 30 Days', -'Last 60 Days'=>'Last 60 Days', -'Last 90 Days'=>'Last 90 Days', -'Last 120 Days'=>'Last 120 Days', -'Next 30 Days'=>'Next 30 Days', -'Next 60 Days'=>'Next 60 Days', -'Next 90 Days'=>'Next 90 Days', -'Next 120 Days'=>'Next 120 Days', - -'equals'=>'equals', -'contains'=>'Contains', -'does not contain'=>'does not contain', -'less than'=>'less than', -'greater than'=>'greater than', -'less or equal'=>'less or equal', -'greater or equal'=>'greater or equal', - -//Strings added to translate field label vtiger_groups -'Address'=>'Address', -'Information'=>'Information', -'Description'=>'Description', -'Custom Information'=>'Custom Information', -'- Event Information'=>'- Event Information', -'- Event Description'=>'- Event Description', -'- Task Information'=>'- Task Information', -'- Task Description'=>'- Task Description', - -//Strings added for helpdesk module fields -'Title'=>'Title', -'Assigned To'=>'Assigned To', -'Related to'=>'Related to', -'Priority'=>'Priority', -'Product Name'=>'Product Name', -'Severity'=>'Severity', -'Status'=>'Status', -'Category'=>'Category', -'Created Time'=>'Created Time', -'Modified Time'=>'Modified Time', -'Attachment'=>'Attachment', - -//Strings added for Leads module fields -'First Name'=>'First Name', -'Phone'=>'Phone', -'Last Name'=>'Last Name', -'Company'=>'Company', -'Lead Source'=>'Lead Source', -'Website'=>'Website', -'Industry'=>'Industry', -'Lead Status'=>'Lead Status', -'Annual Revenue'=>'Annual Revenue', -'Rating'=>'Rating', -'No Of Employees'=>'No of Employees', -'Street'=>'Street', -'Po Box'=>'PO Box', -'Postal Code'=>'Postal Code', -'City'=>'City', -'Country'=>'Country', -'State'=>'State', - -//Strings added for Accounts module fields -'Account Name'=>'Account Name', -'Ticker Symbol'=>'Ticker Symbol', -'Other Phone'=>'Other Phone', -'Member Of'=>'Member Of', -'Employees'=>'Employees', -'Other Email'=>'Other Email', -'Ownership'=>'Ownership', -'industry'=>'industry', -'SIC Code'=>'SIC Code', -'Email Opt Out'=>'Email Opt Out', -'Billing Address'=>'Billing Address', -'Shipping Address'=>'Shipping Address', -'Shipping Po Box'=>'Shipping PO Box', -'Billing Po Box'=>'Billing PO Box', -'Billing City'=>'Billing City', -'Shipping City'=>'Shipping City', -'Billing State'=>'Billing State', -'Shipping State'=>'Shipping State', -'Billing Code'=>'Billing Code', -'Shipping Code'=>'Shipping Code', -'Shipping Country'=>'Shipping Country', -'Billing Country'=>'Billing Country', - - -//Strings added for Contacts module fields - -'Office Phone'=>'Office Phone', -'Home Phone'=>'Home Phone', -'Birthdate'=>'Birthdate', -'Reports To'=>'Reports To', -'Assistant Phone'=>'Assistant Phone', -'Do Not Call'=>'Do Not Call', -'Mailing Street'=>'Mailing Street', -'Other Street'=>'Other Street', -'Mailing Po Box'=>'Mailing PO Box', -'Other Po Box'=>'Other PO Box', -'Mailing City'=>'Mailing City', -'Other City'=>'Other City', -'Mailing State'=>'Mailing State', -'Other State'=>'Other State', -'Mailing Zip'=>'Mailing Zip', -'Other Zip'=>'Other Zip', -'Mailing Country'=>'Mailing Country', -'Other Country'=>'Other Country', - - -//Strings added for Potential module fields - -'Potential Name'=>'Potential Name', -'Amount'=>'Amount', -'Expected Close Date'=>'Expected Close Date', -'Next Step'=>'Next Step', -'Sales Stage'=>'Sales Stage', -'Probability'=>'Probability', - - -//Strings added for Quotes module fields -'Subject'=>'Subject', -'Quote Stage'=>'Quote Stage', -'Valid Till'=>'Valid Till', -'Team'=>'Team', -'Contact Name'=>'Contact Name', -'Carrier'=>'Carrier', -'Shipping'=>'Shipping', -'Inventory Manager'=>'Inventory Manager', - -//Strings added for Sales Orders module fields -'Customer No'=>'Customer No', -'Quote Name'=>'Quote Name', -'Purchase Order'=>'Purchase Order', -'Due Date'=>'Due Date', -'Pending'=>'Pending', -'Sales Commission'=>'Sales Commission', -'Excise Duty'=>'Excise Duty', - -//Strings added for Invoices module fields -'Sales Order'=>'Sales Order', -'Invoice Date'=>'Invoice Date', - -//Strings added for Product module fields -'Product Active'=>'Product Active', -'Product Category'=>'Product Category', -'Sales Start Date'=>'Sales Start Date', -'Sales End Date'=>'Sales End Date', -'Support Start Date'=>'Support Start Date', -'Support Expiry Date'=>'Support Expiry Date', -'Vendor Name'=>'Vendor Name', -'Mfr PartNo'=>'Mfr PartNo', -'Vendor PartNo'=>'Vendor PartNo', - -'Serial No'=>'Serial No', -'Product Sheet'=>'Product Sheet', -'GL Account'=>'GL Account', - -//Strings added for Price book module fields -'Price Book Name'=>'Price Book Name', -'Active'=>'Active', - -//Strings added for tasks & events module fields -'Start Date & Time'=>'Start Date & Time', - -//error message -'Missing required fields'=>'Missing required vtiger_fields', -//Strings added for campaigns -'Campaign Name'=>'Campaign Name', -'Campaign Type'=>'Campaign Type', -'Product'=>'Product', -'Campaign Status'=>'Campaign Status', -'Expected Revenue'=>'Expected Revenue', -'Budget Cost'=>'Budget Cost', -'Actual Cost'=>'Actual Cost', -'Expected Response'=>'Expected Response', -'Num Sent'=>'Num Sent', -'Target Audience'=>'Target Audience', -'TargetSize'=>'TargetSize', -'Sponsor'=>'Sponsor', -'Expected Sales Count'=>'Expected Sales Count', -'Expected Response Count'=>'Expected Response Count', -'Expected ROI'=>'Expected ROI', -'Actual Sales Count'=>'Actual Sales Count', -'Actual Response Count'=>'Actual Response Count', -'Actual ROI'=>'Actual ROI', - - - -//Added for customview.tpl - -'LBL_Select_a_Column'=>'Select a Column', -'Missing_required_fields'=>'Missing required fields', -'Details'=>'Details', -'New_Custom_View'=>'New Custom view', -'Edit_Custom_View'=>'Edit Custom View', -'LBL_AF_HDR5'=>'Simple Time Filter allows you to select date based on -Account Created Time or Account Modified Time', -'Select_Duration'=>'Select Duration', -'Simple_Time_Filter'=>'Simple Time Filter', -'Start_Date'=>'Start Date', -'End_Date'=>'End Date', -'LBL_RULE'=>'RULE', - -// Added/Updated for vtiger CRM 5.0.4 -'not equal to'=>'Not equal to', -'starts with'=>'Starts with', -'ends with'=>'Ends with', -//'Product Code'=>'Product Code', - -// Added after 5.0.4 GA - -//Added for Role based Custom filters -'LBL_SET_AS_PUBLIC'=>'Set as Public ', -'LBL_NEW'=>'New', -'LBL_EDIT'=>'Edit', -'LBL_STATUS_PUBLIC_APPROVE'=>'Approve', -'LBL_STATUS_PUBLIC_DENY'=>'Deny' -); -?> diff --git a/oss/vtiger/trunk/modules/CustomView/language/zh_cn.lang.php b/oss/vtiger/trunk/modules/CustomView/language/zh_cn.lang.php deleted file mode 100644 index eca7e645..00000000 --- a/oss/vtiger/trunk/modules/CustomView/language/zh_cn.lang.php +++ /dev/null @@ -1,282 +0,0 @@ - '自订检视表', - 'LBL_STEP_1_TITLE' => '检视表信息', - 'LBL_VIEW_NAME' => '检视表名称:', - 'LBL_SETDEFAULT' => '默认值', - 'LBL_LIST_IN_METRICS' => '制式化列表', - 'LBL_STEP_2_TITLE' => '选择字段', - 'LBL_STEP_3_TITLE' => '标准规则', - 'LBL_STEP_4_TITLE' => '进阶规则', - 'LBL_STEP_5_TITLE' => '存取信息', - 'LBL_SF_COLUMNS' => '字段', - 'LBL_SF_STARTDATE' => '开始日期', - 'LBL_SF_ENDDATE' => '结束日期', - 'LBL_AF_HDR1' => '设定搜寻条件来缩小范围', - 'LBL_AF_HDR2' => '您可以在第三个字段输入多个项目,之前用"or"分开 ', - 'LBL_AF_HDR3' => '您最多可以输入10个项目,以逗号分隔。例如CA,NY,TX,FL会尝试搜寻CA或NY或TX或FL。', - 'LBL_AF_HDR4' => '如果选择了"活动类型",请输入 "Call"、"Meeting" 或是 "Task"。', - -//strings added for vtiger 5, date format... - 'LBL_NONE' => '无', - 'View_Name' => '检视名称', - 'LBL_AND' => '且', - 'LBL_DATE_FORMAT_CUSTOMVIEW' => '年-月-日', -//Strings added for filter - 'Custom' => '自订', - 'Previous FY' => '上一个财务年度', - 'Current FY' => '目前财务年度', - 'Next FY' => '下一个财务年度', - 'Previous FQ' => '上一个财务季', - 'Current FQ' => '目前财务季', - 'Next FQ' => '下一个财务季', - 'Yesterday' => '昨天', - 'Today' => '今天', - 'Tomorrow' => '明天', - 'Last Week' => '上周', - 'Current Week' => '这周', - 'Next Week' => '下周', - 'Last Month' => '上个月', - 'Current Month' => '这个月', - 'Next Month' => '下个月', - 'Last 7 Days' => '过去七天', - 'Last 30 Days' => '过去 30 天', - 'Last 60 Days' => '过去 60 天', - 'Last 90 Days' => '过去 90 天', - 'Last 120 Days' => '过去 120 天', - 'Next 30 Days' => '未来 30 天', - 'Next 60 Days' => '未来 60 天', - 'Next 90 Days' => '未来 90 天', - 'Next 120 Days' => '未来 120 天', - - 'equals' => '等于', - 'not_equal_to' => '不等于', - 'starts_with' => '开始于', - 'contains' => '包含', - 'does_not_contain' => '不包含', - 'less_than' => '少于', - 'greater_than' => '大于', - 'less_or_equal' => '少于或等于', - 'greater_or_equal' => '大于或等于', - -//Strings added to translate field label vtiger_groups - 'Address' => '住址', - 'Information' => '信息', - 'Description' => '说明', - 'Custom Information' => '自订信息', - '- Event Information' => '- 事件信息', - '- Event Description' => '- 事件说明', - '- Task Information' => '- 任务信息', - '- Task Description' => '- 任务说明', - -//Strings added for helpdesk module fields - 'Title' => '标题', - 'Assigned To' => '负责人', - 'Related to' => '关联', - 'Priority' => '优先序', - 'Product Name' => '产品名称', - 'Severity' => '严重', - 'Status' => '状态', - 'Category' => '类别', - 'Created Time' => '建立时间', - 'Modified Time' => '修改时间', - 'Attachment' => '附加档案', - -//Strings added for Leads module fields - 'First Name' => '姓名', - 'Phone' => '电话', - 'Last Name' => '姓氏', - 'Company' => '公司', - 'Lead Source' => '准客户来源', - 'Website' => '网站', - 'Industry' => '行业', - 'Lead Status' => '准客户状态', - 'Annual Revenue' => '年营业额', - 'Rating' => '评比', - 'No Of Employees' => '员工人数', - 'Street' => '街道巷弄', - 'Po Box' => '邮政信箱', - 'Postal Code' => '邮政编码', - 'City' => '乡镇市区', - 'Country' => '国家', - 'State' => '县市', - -//Strings added for Accounts module fields -'Account Name' => '公司名称', - 'Ticker Symbol' => '传票符号', - 'Other Phone' => '其它电话', - 'Member Of' => '群组', - 'Employees' => '员工', - 'Other Email' => '其它信箱', - 'Ownership' => '负责人', - 'industry' => '产业', - 'SIC Code' => '统一编号', - 'Email Opt Out' => '拒绝邮件打扰', - 'Billing Address' => '付款住址', - 'Shipping Address' => '送货住址', - 'Shipping Po Box' => '[送货住址]邮政信箱', - 'Billing Po Box' => '[付款住址]邮政信箱', - 'Billing City' => '[付款住址]乡镇市区', - 'Shipping City' => '[送货住址]乡镇市区', - 'Billing State' => '[付款住址]县市', - 'Shipping State' => '[送货住址]县市', - 'Billing Code' => '[付款住址]邮政编码', - 'Shipping Code' => '[送货住址]邮政编码', - 'Shipping Country' => '[送货住址]国家', - 'Billing Country' => '[付款住址]国家', - - -//Strings added for Contacts module fields - - 'Office Phone' => '办公室电话', - 'Home Phone' => '住家电话', - 'Birthdate' => '生日', - 'Reports To' => '回报给', - 'Assistant Phone' => '助理电话', - 'Do Not Call' => '拒绝电话打扰', - 'Mailing Street' => '街道巷弄', - 'Other Street' => '[其它]街道巷弄', - 'Mailing Po Box' => '邮政信箱', - 'Other Po Box' => '[其它]邮政信箱', - 'Mailing City' => '乡镇市区', - 'Other City' => '[其它]乡镇市区', - 'Mailing State' => '县市', - 'Other State' => '[其它]县市', - 'Mailing Zip' => '邮政编码', - 'Other Zip' => '[其它]邮政编码', - 'Mailing Country' => '国家', - 'Other Country' => '[其它]国家', - - -//Strings added for Potential module fields - - 'Potential Name' => '潜在机会名称', - 'Amount' => '金额', - 'Expected Close Date' => '预期结案日期', - 'Next Step' => '下一步', - 'Sales Stage' => '销售策略', - 'Probability' => '可能性', - - -//Strings added for Quotes module fields - 'Subject' => '主旨', - 'Quote Stage' => '报价策略', - 'Valid Till' => '有效日期', - 'Team' => '团队', - 'Contact Name' => '联系人名称', - 'Carrier' => '货运商', - 'Shipping' => '船运商', - 'Inventory Manager' => '库存管理', - -//Strings added for Sales Orders module fields - 'Customer No' => '客户编号', - 'Quote Name' => '报价单名称', - 'Purchase Order' => '采购订单', - 'Due Date' => '结束日期', - 'Pending' => '暂缓', - 'Sales Commission' => '销售佣金', - 'Excise Duty' => '关税', - -//Strings added for Invoices module fields - 'Sales Order' => '销售订单', - 'Invoice Date' => '发票日期', - -//Strings added for Product module fields -'Product Code' => '产品代号', - 'Product Active' => '产品状态', - 'Product Category' => '产品类别', - 'Sales Start Date' => '开始销售日期', - 'Sales End Date' => '结束销售日期', - 'Support Start Date' => '开始支持日期', - 'Support Expiry Date' => '结束支持日期', - 'Vendor Name' => '厂商名称', - 'Mfr PartNo' => '工厂零件代号', - 'Vendor PartNo' => '厂商零件代号', - -'Serial No' => '序号', - 'Product Sheet' => '产品型录', - 'GL Account' => '会计科目', - -//Strings added for Price book module fields - 'Price Book Name' => '价格表名称', - 'Active' => '启用', - -//Strings added for tasks & events module fields - 'Start Date & Time' => '开始日期与时间', - -//error message - 'Missing required fields' => '缺少必要字段', -//Strings added for campaigns -'Campaign Name' => '活动名称', - 'Campaign Type' => '活动类型', - 'Product' => '产品', - 'Campaign Status' => '活动状态', - 'Expected Revenue' => '预期收益', - 'Budget Cost' => '预算', - 'Actual Cost' => '实际成本', - 'Expected Response' => '预期回应', - 'Num Sent' => '寄发数量', - 'Target Audience' => '目标族群', - 'TargetSize' => '目标数量', - 'Sponsor' => '赞助商', - 'Expected Sales Count' => '预期销售量', - 'Expected Response Count' => '预期回应量', - 'Expected ROI' => '预期收益', - 'Actual Sales Count' => '实际销售量', - 'Actual Response Count' => '实际回应量', - 'Actual ROI' => '实际收益', - - - -//Added for customview.tpl - - 'LBL_Select_a_Column' => '选择字段', - 'Missing_required_fields' => '缺少必要字段', - 'Details' => '细节', - 'New_Custom_View' => '新增自订检视', - 'LBL_AF_HDR5' => '简易时间过滤可以让您选择介于客户建立时间与异动时间之间的日期', - 'Select_Duration' => '选择期间', - 'Simple_Time_Filter' => '简易时间过滤', - 'Start_Date' => '开始日期', - 'End_Date' => '结束日期', - 'LBL_RULE' => '规则', -// Added/Updated for vtiger CRM 5.0.4 -'not equal to'=>'不等于', -'starts with'=>'开始于', -'ends with'=>'结束于', -//'Product Code'=>'产品编号', - -// Added after 5.0.4 GA - -//Added for Role based Custom filters -'LBL_SET_AS_PUBLIC'=>'设为公共 ', -'LBL_NEW'=>'新', -'LBL_EDIT'=>'修改', -'LBL_STATUS_PUBLIC_APPROVE'=>'批准', -'LBL_STATUS_PUBLIC_DENY'=>'拒绝' -); -?>